Class IgcFileInputComponent

igc-file-input

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).

igcChange - Emitted when the control's checked state changes.

igcCancel - Emitted when the control's file picker dialog is canceled.

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.

Hierarchy

Hierarchy

Constructors

Properties

accept: string = ''

The accept attribute of the control. Defines the file types as a list of comma-separated values that the file input should accept.

autofocus: boolean

The autofocus attribute of the control.

disabled: boolean

The disabled state of the component.

false
invalid: boolean

Sets the control into invalid state (visual state only).

false
label: string

The label for the control.

multiple: boolean = false

The multiple attribute of the control. Used to indicate that a file input allows the user to select more than one file.

false
name: string

The name attribute of the control.

outlined: boolean = false

Whether the control will have outlined appearance.

false
placeholder: string

The placeholder attribute of the control.

styles: CSSResult[] = ...
tagName: "igc-file-input" = 'igc-file-input'

The tagName read-only property of the Element interface returns the tag name of the element on which it's called.

MDN Reference

Accessors

  • get defaultValue(): unknown

    Returns unknown

  • set defaultValue(value: unknown): void

    The initial value of the component.

    Parameters

    • value: unknown

    Returns void

  • get form(): HTMLFormElement | null

    Returns the HTMLFormElement associated with this element.

    Returns HTMLFormElement | null

  • get required(): boolean

    Returns boolean

  • set required(value: boolean): void

    When set, makes the component a required field for validation.

    false
    

    Parameters

    • value: boolean

    Returns void

  • get validationMessage(): string

    A string containing the validation message of this element.

    Returns string

  • get validity(): ValidityState

    Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.

    Returns ValidityState

  • get value(): string

    The value attribute of the control. Type varies based on the input type and can be string, Date or null.

    Returns string

  • set value(value: string): void

    The value of the control. Similar to native file input, this property is read-only and cannot be set programmatically.

    Parameters

    • value: string

    Returns void

  • get willValidate(): boolean

    A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

    Returns boolean

Methods

  • Type parameters

    Type Parameters

    Parameters

    • type: K
    • listener: (this: HTMLElement, ev: M[K]) => any
    • options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • options: boolean | AddEventListenerOptions

    Returns void

  • Type parameters

    Type Parameters

    Parameters

    • type: K
    • listener: (this: HTMLElement, ev: M[K]) => any
    • options: boolean | AddEventListenerOptions

    Returns void

  • Type parameters

    Type Parameters

    • K extends keyof HTMLElementEventMap

    Parameters

    • type: K
    • listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any
    • options: boolean | AddEventListenerOptions

    Returns void

  • Removes focus from the control.

    Returns void

  • Checks for validity of the control and emits the invalid event if it invalid.

    Returns boolean

  • Sets focus on the control.

    Parameters

    • options: FocusOptions

    Returns void

  • Type parameters

    Type Parameters

    Parameters

    • type: K
    • listener: (this: HTMLElement, ev: M[K]) => any
    • options: boolean | EventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • options: boolean | EventListenerOptions

    Returns void

  • Type parameters

    Type Parameters

    Parameters

    • type: K
    • listener: (this: HTMLElement, ev: M[K]) => any
    • options: boolean | EventListenerOptions

    Returns void

  • Type parameters

    Type Parameters

    • K extends keyof HTMLElementEventMap

    Parameters

    • type: K
    • listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any
    • options: boolean | EventListenerOptions

    Returns void

  • Checks for validity of the control and shows the browser message if it invalid.

    Returns boolean

  • Selects all the text inside the input.

    Returns void

  • Sets a custom validation message for the control. As long as message is not empty, the control is considered invalid.

    Parameters

    • message: string

    Returns void