UNPKG

3.04 kBTypeScriptView Raw
1import { EventEmitter, TemplateRef } from '@angular/core';
2import { ControlValueAccessor } from '@angular/forms';
3import { DraggableItem } from './draggable-item';
4import { DraggableItemService } from './draggable-item.service';
5import * as ɵngcc0 from '@angular/core';
6export declare class SortableComponent implements ControlValueAccessor {
7 private static globalZoneIndex;
8 /** field name if input array consists of objects */
9 fieldName?: string;
10 /** class name for items wrapper */
11 wrapperClass: string;
12 /** style object for items wrapper */
13 wrapperStyle: Record<string, string>;
14 /** class name for item */
15 itemClass: string;
16 /** style object for item */
17 itemStyle: Record<string, string>;
18 /** class name for active item */
19 itemActiveClass: string;
20 /** style object for active item */
21 itemActiveStyle: Record<string, string>;
22 /** class name for placeholder */
23 placeholderClass: string;
24 /** style object for placeholder */
25 placeholderStyle: Record<string, string>;
26 /** placeholder item which will be shown if collection is empty */
27 placeholderItem: string;
28 /** used to specify a custom item template. Template variables: item and index; */
29 itemTemplate?: TemplateRef<unknown>;
30 /** fired on array change (reordering, insert, remove), same as <code>ngModelChange</code>.
31 * Returns new items collection as a payload.
32 */
33 onChange: EventEmitter<unknown[]>;
34 showPlaceholder: boolean;
35 activeItem: number;
36 get items(): SortableItem[];
37 set items(value: SortableItem[]);
38 onTouched: any;
39 onChanged: any;
40 private transfer;
41 private currentZoneIndex;
42 private _items;
43 constructor(transfer: DraggableItemService);
44 onItemDragstart(event: DragEvent, item: SortableItem, i: number): void;
45 onItemDragover(event: DragEvent, i: number): void;
46 cancelEvent(event?: DragEvent | MouseEvent): void;
47 onDrop(item: DraggableItem): void;
48 resetActiveItem(event?: DragEvent | MouseEvent): void;
49 registerOnChange(callback: () => void): void;
50 registerOnTouched(callback: () => void): void;
51 writeValue(value: any[]): void;
52 updatePlaceholderState(): void;
53 getItemStyle(isActive: boolean): Record<string, string>;
54 private initDragstartEvent;
55 static ɵfac: ɵngcc0.ɵɵFactoryDef<SortableComponent, never>;
56 static ɵcmp: ɵngcc0.ɵɵComponentDefWithMeta<SortableComponent, "bs-sortable", ["bs-sortable"], { "wrapperClass": "wrapperClass"; "wrapperStyle": "wrapperStyle"; "itemClass": "itemClass"; "itemStyle": "itemStyle"; "itemActiveClass": "itemActiveClass"; "itemActiveStyle": "itemActiveStyle"; "placeholderClass": "placeholderClass"; "placeholderStyle": "placeholderStyle"; "placeholderItem": "placeholderItem"; "fieldName": "fieldName"; "itemTemplate": "itemTemplate"; }, { "onChange": "onChange"; }, never, never>;
57}
58export declare interface SortableItem {
59 id: number;
60 value: string;
61 initData: any;
62}
63
64//# sourceMappingURL=sortable.component.d.ts.map
\No newline at end of file