UNPKG

@limetech/lime-elements

Version:
56 lines 1.95 kB
import { EventEmitter } from '../../stencil-public-runtime'; import { FileInfo } from '../../global/shared-types/file.types'; /** * This component enables you to seamlessly transform any other clickable component that * generates a `click` event into a file input selector. * * To use it, just wrap any clickable component inside the `limel-file-input` component. * Upon reception of the `click` event this component will open the native file selection * dialog. * * After receiving the files, the component emits a `filesSelected` event. * * The event detail would be an array of `FileInfo` objects, * each representing a file dropped into the dropzone. * * @exampleComponent limel-example-file-input * @exampleComponent limel-example-file-input-type-filtering * @private */ export declare class FileInput { /** * Specifies the types of files that the dropzone will accept. By default, all file types are accepted. * * For media files, formats can be specified using: `audio/*`, `video/*`, `image/*`. * Unique file type specifiers can also be used, for example: `.jpg`, `.pdf`. * A comma-separated list of file extensions or MIME types is also acceptable, e.g., `image/png, image/jpeg` or * `.png, .jpg, .jpeg`. * * @see [HTML attribute: accept](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept) for more * details. */ accept: string; /** * Set to `true` to disable file input selection. */ disabled: boolean; /** * Set to `true` to enable selection of multiple files */ multiple: boolean; /** * Emitted when files are selected */ filesSelected: EventEmitter<FileInfo[]>; private element; private fileInput; private fileInputId; componentDidLoad(): void; render(): any; private handleClick; private handleKeyUp; private handleKeyDown; private triggerFileDialog; private handleFileChange; } //# sourceMappingURL=file-input.d.ts.map