1
0
Fork 0
mirror of synced 2024-10-03 10:36:59 +13: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/longform": FormFieldSelect,
"field/datetime": FormFieldSelect, "field/datetime": FormFieldSelect,
"field/attachment": FormFieldSelect, "field/attachment": FormFieldSelect,
"field/attachment_single": FormFieldSelect,
"field/s3": Input, "field/s3": Input,
"field/link": FormFieldSelect, "field/link": FormFieldSelect,
"field/array": FormFieldSelect, "field/array": FormFieldSelect,

View file

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

View file

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

View file

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

View file

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