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.

76 lines (75 loc) 3.28 kB
import { default as WJElement } from '../wje-element/element.js'; /** * `ReorderHandle` is a custom web component that represents a reorder handle. * @summary This element represents a reorder handle. * @documentation https://elements.webjet.sk/components/reorder-handle * @status stable * @augments WJElement * @csspart native - The native part of the reorder handle. * @slot - The default slot for the reorder handle. * @tag wje-reorder-handle */ export default class ReorderHandle extends WJElement { /** * Returns the CSS styles for the component. * @returns {*} */ static get cssStyleSheet(): any; /** * Returns the list of attributes to observe for changes. * @returns {string[]} */ static get observedAttributes(): string[]; /** * Draws the component. * @returns {DocumentFragment} */ draw(): DocumentFragment; /** * Draws the component after it is connected to the DOM. */ afterDraw(): void; /** * Handles the attribute changes. * @param {DragEvent} event */ startDrag(event: DragEvent): void; /** * Handles the touch start event. * @param {TouchEvent} event */ startTouchDrag(event: TouchEvent): void; /** * Initiates the drag-and-drop action for a sortable element. * @param {number} clientX The x-coordinate of the mouse pointer at the start of the drag action. * @param {number} clientY The y-coordinate of the mouse pointer at the start of the drag action. */ startDragAction(clientX: number, clientY: number): void; /** * Retrieves the dropzone associated with the given element. * @param {HTMLElement} element The element from which to search for the closest dropzone. * @returns {HTMLElement|null} - The closest dropzone element matching the `dropzone` attribute, or the parent element if no dropzone is found. */ getDropzone(element: HTMLElement): HTMLElement | null; /** * Retrieves the closest dropzone element at the specified coordinates. * @param {number} clientX The x-coordinate relative to the viewport. * @param {number} clientY The y-coordinate relative to the viewport. * @returns {HTMLElement|null} - The closest dropzone element matching the `dropzone` attribute, or `null` if none is found. */ getClosestDropzone(clientX: number, clientY: number): HTMLElement | null; /** * Retrieves all elements at the specified coordinates, including those within shadow DOMs. * @param {number} x The x-coordinate relative to the viewport. * @param {number} y The y-coordinate relative to the viewport. * @param {Document|ShadowRoot} [root] The root context in which to search. Defaults to the main document. * @param {Set<Node>} [visited] A set of already visited nodes to avoid infinite recursion in nested shadow DOMs. * @returns {HTMLElement[]} An array of all elements found at the specified coordinates, including shadow DOM elements. */ getElementsFromPointAll(x: number, y: number, root?: Document | ShadowRoot, visited?: Set<Node>): HTMLElement[]; /** * Re-indexes the items in the container. * @param container */ reIndexItems(container: any): void; }