2021-04-22 11:10:42 +02:00
|
|
|
<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
|
2022-05-25 14:46:44 +02:00
|
|
|
export let handleTooManyFiles = undefined
|
2021-05-10 12:53:32 +02:00
|
|
|
export let gallery = true
|
2021-11-25 18:14:07 +01:00
|
|
|
export let fileTags = []
|
2021-12-02 17:51:13 +01:00
|
|
|
export let maximum = undefined
|
2021-04-22 11:10:42 +02:00
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
const onChange = e => {
|
|
|
|
value = e.detail
|
|
|
|
dispatch("change", e.detail)
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-04-29 16:24:59 +02:00
|
|
|
<Field {label} {labelPosition} {error}>
|
2021-04-22 11:10:42 +02:00
|
|
|
<CoreDropzone
|
|
|
|
{error}
|
|
|
|
{disabled}
|
|
|
|
{value}
|
|
|
|
{fileSizeLimit}
|
|
|
|
{processFiles}
|
|
|
|
{handleFileTooLarge}
|
2022-05-25 14:46:44 +02:00
|
|
|
{handleTooManyFiles}
|
2021-05-10 12:53:32 +02:00
|
|
|
{gallery}
|
2021-11-25 18:14:07 +01:00
|
|
|
{fileTags}
|
2021-12-02 17:51:13 +01:00
|
|
|
{maximum}
|
2021-05-04 12:04:42 +02:00
|
|
|
on:change={onChange}
|
|
|
|
/>
|
2021-04-22 11:10:42 +02:00
|
|
|
</Field>
|