@cds/core
Version:
Clarity Design System - common components, themes, and utilties
33 lines (32 loc) • 1.19 kB
TypeScript
import { ReactiveController, ReactiveElement } from 'lit';
export declare type DraggableItem = HTMLElement & {
cdsDraggableItem?: 'item' | 'dropzone';
};
/**
* Provides support for HTML5 native drag and drop to a component
*/
export declare function draggableList<T extends ReactiveElement>(config?: DraggableListControllerConfig): ClassDecorator;
export interface DraggableListControllerConfig {
layout?: 'both' | 'horizontal' | 'vertical';
item?: string;
dropZone?: string;
manageFocus?: boolean;
manageTabindex?: boolean;
}
export declare type CdsDraggableChangeType = 'grabbed' | 'dropped' | 'reordered';
export declare type CdsDraggableInteractionType = 'touch' | 'key';
export declare class DraggableListController<T extends ReactiveElement> implements ReactiveController {
private host;
private get items();
private get dropZones();
private observer;
private config;
private id;
constructor(host: T, config?: DraggableListControllerConfig);
hostConnected(): Promise<void>;
hostDisconnected(): void;
private initializeKeyListController;
private clickItem;
private focusItem;
private addDragEventListeners;
}