- Element
igc-file-input
- Slots
-
prefix— Renders content before the input. -
suffix— Renders content after input. -
helper-text— Renders content below the input. -
file-selector-text— Renders content for the browse button when input type is file. -
file-missing-text— Renders content when input type is file and no file is chosen. -
value-missing— Renders content when the required validation fails. -
custom-error— Renders content when setCustomValidity(message) is set. -
invalid— Renders content when the component is in invalid state (validity.valid = false).
- CSS Parts
container— The main wrapper that holds all main input elements.input— The native input element.label— The native label element.file-names— The file names wrapper when input type is 'file'.file-selector-button— The browse button when input type is 'file'.prefix— The prefix wrapper.suffix— The suffix wrapper.helper-text— The helper text wrapper.
Properties
Section titled "Properties"accept
Section titled "accept"The accept attribute of the control. Defines the file types as a list of comma-separated values that the file input should accept.
accept: string = '' Defined in src/components/file-input/file-input.ts:190
autofocus
Section titled "autofocus"The autofocus attribute of the control.
autofocus: boolean Defined in src/components/file-input/file-input.ts:197
disabled
Section titled "disabled"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
The disabled state of the component.
disabled: boolean Defined in src/components/common/mixins/forms/types.ts:29
invalid
Section titled "invalid"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Sets the control into invalid state (visual state only).
invalid: boolean Defined in src/components/common/mixins/forms/types.ts:36
label
Section titled "label"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
The label for the control.
label: string Defined in src/components/input/input-base.ts:70
multiple
Section titled "multiple"The multiple attribute of the control. Used to indicate that a file input allows the user to select more than one file.
multiple: boolean = false Defined in src/components/file-input/file-input.ts:182
Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
The name attribute of the control.
name: string Defined in src/components/common/mixins/forms/types.ts:42
outlined
Section titled "outlined"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Whether the control will have outlined appearance.
outlined: boolean = false Defined in src/components/input/input-base.ts:56
placeholder
Section titled "placeholder"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
The placeholder attribute of the control.
placeholder: string Defined in src/components/input/input-base.ts:63
tagName
Section titled "tagName"The tagName read-only property of the Element interface returns the tag name of the element on which it's called.
tagName: "igc-file-input" = 'igc-file-input' Defined in src/components/file-input/file-input.ts:78
value
Section titled "value"value: string Defined in src/components/file-input/file-input.ts:139, src/components/file-input/file-input.ts:145
Accessors
Section titled "Accessors"files
Section titled "files"Returns the list of selected files.
get files(): FileList Defined in src/components/file-input/file-input.ts:200
Returns FileList
Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Returns the HTMLFormElement associated with this element.
get form(): HTMLFormElement | null Defined in src/components/common/mixins/forms/types.ts:45
Returns HTMLFormElement | null
validationMessage
Section titled "validationMessage"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
A string containing the validation message of this element.
get validationMessage(): string Defined in src/components/common/mixins/forms/types.ts:54
Returns string
validity
Section titled "validity"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.
get validity(): ValidityState Defined in src/components/common/mixins/forms/types.ts:51
Returns ValidityState
willValidate
Section titled "willValidate"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.
get willValidate(): boolean Defined in src/components/common/mixins/forms/types.ts:60
Returns boolean
Methods
Section titled "Methods"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Removes focus from the control.
blur(): void Defined in src/components/input/input-base.ts:102
Returns void
checkValidity
Section titled "checkValidity"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Checks for validity of the control and emits the invalid event if it invalid.
checkValidity(): boolean Defined in src/components/common/mixins/forms/types.ts:140
Returns boolean
focus
Section titled "focus"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Sets focus on the control.
focus(options: FocusOptions): void Defined in src/components/input/input-base.ts:96
Parameters
- options:
FocusOptions
Returns void
reportValidity
Section titled "reportValidity"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Checks for validity of the control and shows the browser message if it invalid.
reportValidity(): boolean Defined in src/components/common/mixins/forms/types.ts:143
Returns boolean
select
Section titled "select"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Selects all the text inside the input.
select(): void Defined in src/components/input/input-base.ts:90
Returns void
setCustomValidity
Section titled "setCustomValidity"Inherited from: EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent)
Sets a custom validation message for the control.
As long as message is not empty, the control is considered invalid.
setCustomValidity(message: string): void Defined in src/components/common/mixins/forms/types.ts:149
Parameters
- message:
string