Merge pull request #4088 from mslourens/attachment_field_extensions

add extensions prop to specify accepted file extensions
This commit is contained in:
Martin McKeaveney 2022-01-19 10:33:10 +01:00 committed by GitHub
commit 3d5a3e7902
3 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,7 @@
export let error = null
export let fileTags = []
export let maximum = null
export let extensions = "*"
const dispatch = createEventDispatcher()
const imageExtensions = [
@ -207,6 +208,7 @@
{disabled}
type="file"
multiple
accept={extensions}
on:change={handleFile}
/>
<svg

View File

@ -2236,7 +2236,7 @@
"setting": "optionsSource",
"value": "provider"
}
},
},
{
"type": "options",
"key": "customOptions",
@ -2419,6 +2419,11 @@
"label": "Label",
"key": "label"
},
{
"type": "text",
"label": "Extensions",
"key": "extensions"
},
{
"type": "boolean",
"label": "Disabled",

View File

@ -7,6 +7,7 @@
export let label
export let disabled = false
export let validation
export let extensions
let fieldState
let fieldApi
@ -52,6 +53,7 @@
}}
{processFiles}
{handleFileTooLarge}
{extensions}
/>
{/if}
</Field>