@limetech/lime-elements
Version:
92 lines • 2.55 kB
TypeScript
import { Languages } from '../date-picker/date.types';
import { FileInfo } from '../../global/shared-types/file.types';
/**
* This component lets end-users select a *single* file from their device
* storage. Regardless of the user's device or operating system, this component
* opens up a file picker dialog that allows the user to choose a file.
*
* ## Using correct labels
*
* This file picker can be used in different contexts. The component's distinct
* visual design including the upload icon hints end-users that this is not a
* normal input field like other fields in the form for example.
*
* :::important
* you need to use a descriptive `label` that clarifies the
* functionality of the file picker, and/or provides users with clear
* instructions.
*
* Depending on the context, you may need to avoid labels such as:
* - File
* - Document
*
* and instead consider using labels like:
* - Attach a file
* - Upload a file
* - Choose a document
* - Choose a file
*
* and similar phrases...
* :::
*
* @exampleComponent limel-example-file
* @exampleComponent limel-example-file-custom-icon
* @exampleComponent limel-example-file-menu-items
* @exampleComponent limel-example-file-accepted-types
* @exampleComponent limel-example-file-composite
*/
export declare class File {
/**
* The selected file.
*/
value: FileInfo;
/**
* The input label.
*/
label: string;
/**
* Set to `true` to indicate that the field is required.
*/
required: boolean;
/**
* True if the input should be disabled
*/
disabled: boolean;
/**
* Set to `true` to disable adding and removing files, but allow interaction
* with any already existing file.
*/
readonly: boolean;
/**
* Set to `true` to indicate that the current value of the chosen file is
* invalid.
*/
invalid: boolean;
/**
* The [accepted file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers)
*/
accept: string;
/**
* Defines the localisation for translations.
*/
language: Languages;
/**
* Dispatched when a file is selected/deselected
*/
private change;
/**
* Dispatched when clicking on a chip
*/
private interact;
render(): any[];
private renderDragAndDropTip;
private dropZoneTip;
private handleNewFiles;
private getChipArray;
private renderChipset;
private handleChipSetChange;
private handleChipInteract;
private preventAndStop;
private getTranslation;
}
//# sourceMappingURL=file.d.ts.map