budibase/packages/bbui/src/Form/Dropzone.svelte

37 lines
833 B
Svelte
Raw Normal View History

<script>
import Field from "./Field.svelte"
import CoreDropzone from "./Core/Dropzone.svelte"
import { createEventDispatcher } from "svelte"
export let value = []
export let label = null
export let labelPosition = "above"
export let disabled = false
export let error = null
export let fileSizeLimit = undefined
export let processFiles = undefined
export let handleFileTooLarge = undefined
export let gallery = true
2021-11-25 18:14:07 +01:00
export let fileTags = []
const dispatch = createEventDispatcher()
const onChange = e => {
value = e.detail
dispatch("change", e.detail)
}
</script>
<Field {label} {labelPosition} {error}>
<CoreDropzone
{error}
{disabled}
{value}
{fileSizeLimit}
{processFiles}
{handleFileTooLarge}
{gallery}
2021-11-25 18:14:07 +01:00
{fileTags}
on:change={onChange}
/>
</Field>