UNPKG

wj-elements

Version:

WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.

69 lines (68 loc) 2.62 kB
import { default as WJElement } from '../wje-element/element.js'; import { Localizer } from '../utils/localize.js'; /** * @summary This element allows users to upload files. * `FileUploadItem` is a custom web component that represents a file upload item. * It extends from `WJElement` and uses the `Localizer` utility for localization. * @documentation https://elements.webjet.sk/components/file-upload * @status stable * @augments WJElement * @csspart button - The delete button part * @csspart image - The image part * @csspart name - The name part * @csspart size - The size part * @slot img - Slot for the image * @slot action - Slot for the action buttons * @cssproperty --primary-color - The primary color of the file upload item. * //@fires wje-button:click - Dispatches when the delete button is clicked * @tag wje-file-upload */ export default class FileUploadItem extends WJElement { /** * Returns the CSS styles for the component. * @static * @returns {CSSStyleSheet} */ static get cssStyleSheet(): CSSStyleSheet; /** * Returns the list of attributes to observe for changes. * @static * @returns {Array<string>} */ static get observedAttributes(): Array<string>; localizer: Localizer; set isUploaded(value: boolean); get isUploaded(): boolean; set size(value: string); get size(): string; /** * Dependencies for the component. * @type {object} */ dependencies: object; /** * Handles updates to the attributes of a custom element whenever one of the observed attributes is changed. * Updates the related elements based on the changed attribute and its new value. * @param {string} name The name of the attribute being changed. * @param {string | null} oldValue The previous value of the attribute before the change, or null if the attribute was not previously set. * @param {string | null} newValue The new value of the attribute after the change, or null if the attribute is being removed. * @returns {void} Does not return a value. */ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; /** * Method to draw the component on the screen. * @returns {DocumentFragment} The fragment containing the component. */ draw(): DocumentFragment; button: HTMLElement; uploadedEl: HTMLElement; sliderEl: HTMLElement; /** * Called after the component has been drawn. */ afterDraw(): void; /** * Handles the delete action. */ onDelete: () => void; }