30 lines
1.5 KiB
Plaintext
30 lines
1.5 KiB
Plaintext
component FileUpload {
|
|
outputs {
|
|
select(payload: { value?: string | number | boolean | null; values?: Array<string | number | boolean | null | object>; sourceEvent?: Event; [key: string]: string | number | boolean | null | object } | string | number | boolean | null)
|
|
upload(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
|
progress(payload: { progress: number; [key: string]: string | number | boolean | null | object } | number)
|
|
success(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
|
error(payload: { error: Error | string; sourceEvent?: Event; [key: string]: string | number | boolean | null | object } | Error | string)
|
|
cancel(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
|
remove(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
|
}
|
|
|
|
props {
|
|
size: string = "default"
|
|
color: string = "primary"
|
|
title: string = "File Upload"
|
|
description: string = ""
|
|
items: unknown[] = []
|
|
variant: string = "default"
|
|
class: string = ""
|
|
}
|
|
view {
|
|
<section class="wire-next wire-next--color-{color} wire-next--size-{size} wire-next--file-upload wire-next--variant-{variant} {class}">
|
|
{#if title}<strong>{title}</strong>{/if}
|
|
{#if description}<p>{description}</p>{/if}
|
|
{#if items}<div class="wire-next__items">{#each items as item}<span>{item.label}</span>{/each}</div>{/if}
|
|
<slot />
|
|
</section>
|
|
}
|
|
}
|