diff --git a/packages/bbui/src/Form/Core/Dropzone.svelte b/packages/bbui/src/Form/Core/Dropzone.svelte index 2bd95df516..3d803c0961 100644 --- a/packages/bbui/src/Form/Core/Dropzone.svelte +++ b/packages/bbui/src/Form/Core/Dropzone.svelte @@ -197,7 +197,9 @@ > - + {#if maximum !== 1} + + {/if} {:else if value?.length} {#each value as file} diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 46c6f5b58e..f6a4f29a06 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -470,7 +470,7 @@ newError.name = `Column name already in use.` } - if (fieldInfo.type === "auto" && !fieldInfo.subtype) { + if (fieldInfo.type === FieldType.AUTO && !fieldInfo.subtype) { newError.subtype = `Auto Column requires a type` } @@ -531,18 +531,18 @@ }} /> - {#if editableColumn.type === "string"} + {#if editableColumn.type === FieldType.STRING} - {:else if editableColumn.type === "options"} + {:else if editableColumn.type === FieldType.OPTIONS} - {:else if editableColumn.type === "longform"} + {:else if editableColumn.type === FieldType.LONGFORM}
@@ -560,12 +560,12 @@ text="Enable rich text support (markdown)" />
- {:else if editableColumn.type === "array"} + {:else if editableColumn.type === FieldType.ARRAY} - {:else if editableColumn.type === "datetime" && !editableColumn.autocolumn} + {:else if editableColumn.type === FieldType.DATETIME && !editableColumn.autocolumn}
@@ -604,7 +604,7 @@
{/if} - {:else if editableColumn.type === "number" && !editableColumn.autocolumn} + {:else if editableColumn.type === FieldType.NUMBER && !editableColumn.autocolumn}
@@ -629,7 +629,7 @@ />
- {:else if editableColumn.type === "link"} + {:else if editableColumn.type === FieldType.LINK} + {:else if editableColumn.type === FieldType.ATTACHMENT} + { + if (!e.detail) { + editableColumn.constraints ??= { length: {} } + editableColumn.constraints.length ??= {} + editableColumn.constraints.length.maximum = 1 + editableColumn.constraints.length.message = + "cannot contain multiple files" + } else { + delete editableColumn.constraints?.length?.maximum + delete editableColumn.constraints?.length?.message + } + }} + thin + text="Allow multiple" + /> {/if} {#if editableColumn.type === AUTO_TYPE || editableColumn.autocolumn}