Design systém gov.cz4.7.0

gov-form-file

Properties

PropertyAttributeDescriptionTypeDefault
acceptacceptSame as original parameterstringundefined
accessibleAttachmentsLabelaccessible-attachments-labelAdds accessible label for the list of attachments.string"Přílohy"
disableddisabledMakes the File component disabled. This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.booleanfalse
displayAttachmentsdisplay-attachmentsShow list of attachmentsbooleantrue
errorAccepterror-acceptInsert unsupported file error messagestring"Soubor tohoto typu není povolen"
errorSizeerror-sizeError message when the maximum file size is exceededstring"Soubor je větší než povolená velikost {FILE_SIZE}"
expandedexpandedExpands the file input to fill 100% of the container width.booleanfalse
identifieridentifierCustom File identifier.stringundefined
ignoreFileDuplicationCheckignore-file-duplication-checkSelected files will not be checked for duplicates based on name and size.booleanfalse
invalidinvalidIndicates the entered value does not conform to the format expected by the application.booleanundefined
maxFileSizemax-file-sizeMaximum embedded file sizenumber-1
multiplemultipleSame as original parameterbooleanfalse
namenameName of the input.stringundefined
requiredrequiredSet whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them. When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.booleanfalse
resetAfterPickreset-after-pickAfter selecting the files, the main input element will be reset. The propagation of the event with the selected files will not be affected.booleanfalse

Events

EventDescriptionType
gov-add-fileCalled when a new file is addedCustomEvent<GovFormFileEvent>
gov-blurEmitted when the File loses focus.CustomEvent<GovFormFileEvent>
gov-filesCalled when the list of inserted files is changedCustomEvent<GovFormFileEvent>
gov-focusEmitted when the File has focus.CustomEvent<GovFormFileEvent>
gov-remove-fileCalled when a file is removed from the listCustomEvent<GovFormFileEvent>

Methods

getAreaRef() => Promise<HTMLDivElement>

Returns the reference of the native area element

Returns

Type: Promise<HTMLDivElement>

getRef() => Promise<HTMLInputElement>

Returns the reference of the native element

Returns

Type: Promise<HTMLInputElement>

reset() => Promise<void>

Remove all files from component state

Returns

Type: Promise<void>

Dependencies

Depends on

Graph


Built with StencilJS