@nekobird/controls
Version:
A collection of opinionated user-interface controls.
39 lines (38 loc) • 2.3 kB
TypeScript
import { DragEventManager, Point } from '@nekobird/rocket';
import { SortableList } from './sortable-list';
export interface SortableListConfig {
useTransition: boolean;
transitionDuration: number;
transitionTimingFunction: string;
leftMouseButtonOnly: boolean;
disableTouchEventsWhileActive: boolean;
autoScroll: boolean;
groupsSelector?: string;
groups?: HTMLElement[] | NodeListOf<HTMLElement> | HTMLCollection;
childIsItem: (child: HTMLElement) => boolean;
prepareGroup: (group: HTMLElement) => void;
prepareItems: (item: HTMLElement) => void;
createDummyFromItem: (item: HTMLElement, context: SortableList) => HTMLElement;
setDummyElementPropertiesFromItem: (dummyElement: HTMLElement, item: HTMLElement, context: SortableList) => void;
activateOnLongPress: boolean;
listenToLongPress: boolean;
longPressWait: number;
longPressCondition: (event: any, manager: DragEventManager, context: SortableList) => boolean;
condition: (item: HTMLElement, event: any, manager: DragEventManager, context: SortableList) => boolean;
beforeActivate: (context: SortableList) => void;
beforeDeactivate: (context: SortableList) => void;
activateItem: (item: HTMLElement, context: SortableList) => void;
deactivateItem: (item: HTMLElement, context: SortableList) => void;
afterActivate: (context: SortableList) => void;
afterDeactivate: (context: SortableList) => void;
popItem: (item: HTMLElement, context: SortableList) => void;
unpopItem: (item: HTMLElement, context: SortableList) => void;
moveItem: (item: HTMLElement, to: Point, context: SortableList) => void;
onComplete: (context: SortableList) => void;
onDown: (item: HTMLElement, event: any, manager: DragEventManager, context: SortableList) => void;
onDrag: (item: HTMLElement, event: any, manager: DragEventManager, context: SortableList) => void;
onUp: (item: HTMLElement, event: any, manager: DragEventManager, context: SortableList) => void;
onCancel: (item: HTMLElement, event: any, manager: DragEventManager, context: SortableList) => void;
onLongPress: (item: HTMLElement, event: any, manager: DragEventManager, context: SortableList) => void;
}
export declare const SORTABLE_DEFAULT_CONFIG: SortableListConfig;