- 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 file types the control accepts, as a comma-separated list.
accept: string = '' Defined in src/components/file-input/file-input.ts:169
autofocus
Section titled "autofocus"Whether the control should receive focus automatically.
autofocus: boolean Defined in src/components/file-input/file-input.ts:176
disabled
Section titled "disabled"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
The disabled state of the component.
disabled: boolean Defined in src/internals/mixins/forms/types.ts:30
invalid
Section titled "invalid"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
Sets the control into invalid state (visual state only).
invalid: boolean Defined in src/internals/mixins/forms/types.ts:37
label
Section titled "label"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
The label for the control.
label: string Defined in src/components/input/input-base.ts:85
multiple
Section titled "multiple"Whether the control allows the user to select more than one file.
multiple: boolean = false Defined in src/components/file-input/file-input.ts:162
Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
The name of the control, submitted with the form data.
name: string Defined in src/internals/mixins/forms/types.ts:43
outlined
Section titled "outlined"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
Whether the control will have outlined appearance.
outlined: boolean = false Defined in src/components/input/input-base.ts:71
placeholder
Section titled "placeholder"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
The placeholder text of the control.
placeholder: string Defined in src/components/input/input-base.ts:78
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:88
Accessors
Section titled "Accessors"defaultValue
Section titled "defaultValue"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
get defaultValue(): any Defined in src/internals/mixins/forms/types.ts:182
The initial value of the component.
set defaultValue(value: unknown): void Defined in src/internals/mixins/forms/types.ts:182
Parameters
- value:
unknown
Returns void
files
Section titled "files"Returns the list of selected files.
get files(): FileList Defined in src/components/file-input/file-input.ts:179
Returns FileList
Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
Returns the HTMLFormElement associated with this element.
get form(): HTMLFormElement | null Defined in src/internals/mixins/forms/types.ts:46
Returns HTMLFormElement | null
required
Section titled "required"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
get required(): any Defined in src/internals/mixins/forms/types.ts:207
When set, makes the component a required field for validation.
set required(value: boolean): void Defined in src/internals/mixins/forms/types.ts:207
Parameters
- value:
boolean
Returns void
validationMessage
Section titled "validationMessage"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
A string containing the validation message of this element.
get validationMessage(): string Defined in src/internals/mixins/forms/types.ts:55
Returns string
validity
Section titled "validity"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
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/internals/mixins/forms/types.ts:52
Returns ValidityState
value
Section titled "value"The value of the control.
get value(): string Defined in src/components/file-input/file-input.ts:151
Returns string
The value of the control. Similar to native file input, this property is read-only and cannot be set programmatically.
set value(value: string): void Defined in src/components/file-input/file-input.ts:145
Parameters
- value:
string
Returns void
willValidate
Section titled "willValidate"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
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/internals/mixins/forms/types.ts:61
Returns boolean
Methods
Section titled "Methods"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
Removes focus from the control.
blur(): void Defined in src/components/input/input-base.ts:108
Returns void
checkValidity
Section titled "checkValidity"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
Checks for validity of the control and emits the invalid event if it's invalid.
checkValidity(): boolean Defined in src/internals/mixins/forms/types.ts:166
Returns boolean
focus
Section titled "focus"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
Sets focus on the control.
focus(options: FocusOptions): void Defined in src/components/input/input-base.ts:102
Parameters
- options:
FocusOptions
Returns void
reportValidity
Section titled "reportValidity"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
Checks for validity of the control and shows the browser message if it's invalid.
reportValidity(): boolean Defined in src/internals/mixins/forms/types.ts:169
Returns boolean
select
Section titled "select"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
Selects all the text inside the input.
select(): void Defined in src/components/input/input-base.ts:96
Returns void
setCustomValidity
Section titled "setCustomValidity"Inherited from: I18nMixin( EventEmitterMixin< IgcFileInputComponentEventMap, AbstractConstructor<IgcInputBaseComponent> >(IgcInputBaseComponent), i18n )
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/internals/mixins/forms/types.ts:175
Parameters
- message:
string