1
0
Fork 0
mirror of synced 2024-07-03 13:30:46 +12:00

PR comments

This commit is contained in:
Adria Navarro 2024-04-10 10:07:07 +02:00
parent 4ca090bf10
commit f69056c9fe
5 changed files with 6 additions and 7 deletions

View file

@ -70,6 +70,7 @@ const componentMap = {
"field/longform": FormFieldSelect,
"field/datetime": FormFieldSelect,
"field/attachment": FormFieldSelect,
"field/attachment_single": FormFieldSelect,
"field/s3": Input,
"field/link": FormFieldSelect,
"field/array": FormFieldSelect,

View file

@ -4354,12 +4354,6 @@
"label": "Extensions",
"key": "extensions"
},
{
"type": "number",
"label": "Max attachments",
"key": "maximum",
"min": 1
},
{
"type": "event",
"label": "On change",

View file

@ -20,6 +20,7 @@
get: value => value,
set: value => value,
}
export let defaultValue = []
let fieldState
let fieldApi
@ -88,7 +89,7 @@
{type}
bind:fieldState
bind:fieldApi
defaultValue={[]}
{defaultValue}
>
{#if fieldState}
<CoreDropzone

View file

@ -12,5 +12,6 @@
{...$$restProps}
type={FieldType.ATTACHMENT_SINGLE}
maximum={1}
defaultValue={null}
{fieldApiMapper}
/>

View file

@ -3,6 +3,7 @@
export let value
export let onChange
export let api
$: arrayValue = (!Array.isArray(value) && value ? [value] : value) || []
@ -13,6 +14,7 @@
</script>
<AttachmentCell
bind:api
{...$$restProps}
maximum={1}
value={arrayValue}