Input upload<mds-input-upload>Generato da @maggioli-design-system/magma@2.3.0dist/documentation.json. Incapsulamento: shadow.
Questa pagina è generata dai pacchetti Magma, documentati solo in inglese.
I componenti Magma sono web component: elementi personalizzati che scrivi come i tag HTML, con qualsiasi framework o senza. Le proprietà li configurano, gli eventi dicono cosa è successo, i metodi sono funzioni da chiamare sull'elemento e gli slot accolgono il contenuto che metti al suo interno.
Proprietà
Imposta una proprietà come attributo HTML nel markup, oppure come proprietà da JavaScript. La colonna Attributo dà il nome dell'attributo, un trattino quando coincide con la proprietà; le proprietà senza attributo, come array e funzioni, si impostano solo da JavaScript. Per spegnere un attributo booleano, rimuovilo: non scrivere mai disabled="false".accept
-
stringDefines the file types the file input should accept
disabled
-
boolean | undefinedfalseDisables the component, like a disabled native file input: no file can be added, dropped or
removed, and the files are left out of the form. A disabled <fieldset> around the component
does the same.
maxFileSizemax-file-sizenumber20Specifies the max size of a single file that can be uploaded in MB
maxFilesmax-filesnumber1Specifies the max number of files that can be uploaded
name
-
string | undefinedThe name the accepted files are submitted under with the form, one entry per file
sort
-
date | status | undefinedSpecifies the order the files start sorted by, status or date of upload, and shows the sort tabs that let the user change it; if not defined the tabs are hidden and the order is the user’s last choice
Eventi
mdsInputUploadChangeFileList | nullEmits when the component files are changed
Metodi
getFilesgetFiles() => Promise<FileList | null>Returns a promise of the accepted files as a FileList, empty if there’s none
getFilesErrorgetFilesError() => Promise<FileError[] | null>Returns a promise of files error or null if there’s none