UNPKG

igniteui-webcomponents

Version:

Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.

86 lines (85 loc) 3.27 kB
import { type FormValue } from '../common/mixins/forms/form-value.js'; import { IgcInputBaseComponent } from '../input/input-base.js'; /** * @element igc-file-input * * @slot prefix - Renders content before the input. * @slot suffix - Renders content after input. * @slot helper-text - Renders content below the input. * @slot file-selector-text - Renders content for the browse button when input type is file. * @slot file-missing-text - Renders content when input type is file and no file is chosen. * @slot value-missing - Renders content when the required validation fails. * @slot custom-error - Renders content when setCustomValidity(message) is set. * @slot invalid - Renders content when the component is in invalid state (validity.valid = false). * * @fires igcInput - Emitted when the control input receives user input. * @fires igcChange - Emitted when the control's checked state changes. * @fires igcCancel - Emitted when the control's file picker dialog is canceled. * * @csspart container - The main wrapper that holds all main input elements. * @csspart input - The native input element. * @csspart label - The native label element. * @csspart file-names - The file names wrapper when input type is 'file'. * @csspart file-selector-button - The browse button when input type is 'file'. * @csspart prefix - The prefix wrapper. * @csspart suffix - The suffix wrapper. * @csspart helper-text - The helper text wrapper. */ export default class IgcFileInputComponent extends IgcInputBaseComponent { static readonly tagName = "igc-file-input"; static styles: import("lit").CSSResult[]; static register(): void; protected get __validators(): import("../common/validators.js").Validator<IgcFileInputComponent>[]; protected _formValue: FormValue<FileList | null>; private _hasActivation; private get _fileNames(); /** * The value of the control. * @attr */ set value(value: string); get value(): string; /** * The multiple attribute of the control. * Used to indicate that a file input allows the user to select more than one file. * @attr */ multiple: boolean; /** * The accept attribute of the control. * Defines the file types as a list of comma-separated values that the file input should accept. * @attr */ accept: string; /** * The autofocus attribute of the control. * @attr */ autofocus: boolean; /** * @internal */ tabIndex: number; /** @hidden */ readonly readOnly = false; /** Returns the selected files when input type is 'file', otherwise returns null. */ get files(): FileList | null; constructor(); protected _restoreDefaultValue(): void; /** @hidden */ setSelectionRange(): void; /** @hidden */ setRangeText(): void; private _handleChange; private _handleCancel; protected _handleFocus(): void; protected _handleBlur(): void; protected _handleClick(): void; protected renderFileParts(): import("lit-html").TemplateResult<1>; protected renderInput(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'igc-file-input': IgcFileInputComponent; } }