@molecule/app-drag-drop-dndkit-angular 0.0.0-stage → 0.0.1-stage

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Angular sortable list for `@molecule/app-drag-drop-dndkit`.
3
+ *
4
+ * {@link SortableList} (`[molSortableList]`) renders a list the user reorders
5
+ * with the pointer, touch or the keyboard, on `@dnd-kit/dom`. Each row is a
6
+ * {@link SortableItem} (`[molSortableItem]`) — or a component calling
7
+ * {@link useSortableItem} in its field initializer. The options are
8
+ * `@molecule/app-drag-drop-dndkit`'s `SortableListOptions`, the same in the
9
+ * React, Vue, Solid and Svelte bindings, so a list swaps between frameworks
10
+ * unchanged. The row directives {@link SortableItem} and
11
+ * {@link SortableItemHandle} are Angular's own: a row's id comes from a
12
+ * template binding, which `useSortableItem` (read once, when the component is
13
+ * constructed) cannot follow. The callbacks are inputs, not outputs, so a consumer passes the
14
+ * same functions a React list takes.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * import { Component, signal } from '@angular/core'
19
+ * import { SortableItem, SortableList } from '@molecule/app-drag-drop-dndkit-angular'
20
+ *
21
+ * @Component({
22
+ * selector: 'app-tasks',
23
+ * standalone: true,
24
+ * imports: [SortableList, SortableItem],
25
+ * template: `
26
+ * <ul molSortableList [items]="tasks()" [onReorder]="save" [getItemLabel]="label">
27
+ * @for (task of tasks(); track task.id) {
28
+ * <li molSortableItem [molSortableItem]="task.id">{{ task.title }}</li>
29
+ * }
30
+ * </ul>
31
+ * `,
32
+ * })
33
+ * class Tasks {
34
+ * readonly tasks = signal([{ id: 'a', title: 'Alpha' }])
35
+ * readonly save = (items: { id: string; title: string }[]) => this.tasks.set(items)
36
+ * readonly label = (task: { id: string; title: string }) => task.title
37
+ * }
38
+ * ```
39
+ *
40
+ * @remarks
41
+ * The screen-reader instructions and announcements use the
42
+ * `dragDrop.sortable.*` keys; bond `@molecule/app-locales-drag-drop-dndkit` for
43
+ * their translations. Persist the order in `onReorder`; if saving fails,
44
+ * restore the previous `items`.
45
+ *
46
+ * @module
47
+ */
48
+ export * from './sortable-item.js';
49
+ export * from './sortable-list.js';
50
+ export * from './use-sortable-item.js';
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * The dnd-kit sortable behind one row, shared by the item directive and the
3
+ * injection-context function.
4
+ *
5
+ * @module
6
+ */
7
+ import { type WritableSignal } from '@angular/core';
8
+ import type { DragDropManager } from '@dnd-kit/dom';
9
+ import type { SortableItemOptions } from '@molecule/app-drag-drop-dndkit';
10
+ import type { SortableListHost } from './sortable-list-context.js';
11
+ /** What {@link SortableItemController} needs to register one row. */
12
+ export interface SortableItemControllerInput {
13
+ /** The manager the list owns. */
14
+ manager: DragDropManager;
15
+ /** The list the row belongs to. */
16
+ list: SortableListHost;
17
+ /** The row's id, drag data and disabled flag. */
18
+ options: SortableItemOptions;
19
+ /** The row's element, when it is already known. */
20
+ element?: Element;
21
+ /** The signal the row's dragging state is written to (a fresh one when absent). */
22
+ isDragging?: WritableSignal<boolean>;
23
+ /** The signal the row's drop-target state is written to (a fresh one when absent). */
24
+ isDropTarget?: WritableSignal<boolean>;
25
+ }
26
+ /**
27
+ * One row's dnd-kit `Sortable`. It registers itself with the list's manager,
28
+ * follows the drag through two signals (`isDragging`, `isDropTarget`) and lets
29
+ * the caller keep its index, disabled flag, data, element and handle in step
30
+ * with the list.
31
+ */
32
+ export declare class SortableItemController {
33
+ /** `true` while this row is being dragged. */
34
+ readonly isDragging: WritableSignal<boolean>;
35
+ /** `true` while another dragged row is over this one. */
36
+ readonly isDropTarget: WritableSignal<boolean>;
37
+ private readonly manager;
38
+ private id;
39
+ private readonly sortable;
40
+ private readonly unbind;
41
+ private currentData;
42
+ /**
43
+ * Creates the row and registers it with the list.
44
+ *
45
+ * @param input - The manager, the list, the row's options and its signals.
46
+ */
47
+ constructor(input: SortableItemControllerInput);
48
+ /**
49
+ * Sets the row's id, keeping it registered under the same key.
50
+ *
51
+ * @param id - The id of one of the list's `items`.
52
+ */
53
+ setId(id: string): void;
54
+ /**
55
+ * Sets the row's index in the list's current `items`.
56
+ *
57
+ * @param index - The row's index (or `-1` when the list has no such item).
58
+ */
59
+ setIndex(index: number): void;
60
+ /**
61
+ * Sets whether the row is disabled.
62
+ *
63
+ * @param disabled - Whether dragging this row is disabled.
64
+ */
65
+ setDisabled(disabled: boolean): void;
66
+ /**
67
+ * Sets the data carried with the drag, reported on the drag events.
68
+ *
69
+ * @param data - The data, or `undefined` for none.
70
+ */
71
+ setData(data: Record<string, unknown> | undefined): void;
72
+ /**
73
+ * Attaches the row's element. A `null` ref during a live drag leaves the
74
+ * attached element alone (the dragged row is briefly moved out of the DOM by
75
+ * the drop animation), as the React binding does.
76
+ *
77
+ * @param element - The row's element, or `undefined` on unmount.
78
+ */
79
+ setElement(element: Element | undefined): void;
80
+ /**
81
+ * Attaches an optional drag handle so only that element starts a drag.
82
+ *
83
+ * @param handle - The handle's element, or `undefined` on unmount.
84
+ */
85
+ setHandle(handle: Element | undefined): void;
86
+ /** Unregisters the row and removes its drag listeners. */
87
+ destroy(): void;
88
+ }
89
+ //# sourceMappingURL=sortable-item-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortable-item-controller.d.ts","sourceRoot":"","sources":["../src/sortable-item-controller.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,C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IAMxD;;;;;;OAMG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAM9C;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAI5C,0DAA0D;IAC1D,OAAO,IAAI,IAAI;CAIhB"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * The dnd-kit sortable behind one row, shared by the item directive and the
3
+ * injection-context function.
4
+ *
5
+ * @module
6
+ */
7
+ import { signal } from '@angular/core';
8
+ import { Sortable } from '@dnd-kit/dom/sortable';
9
+ /**
10
+ * One row's dnd-kit `Sortable`. It registers itself with the list's manager,
11
+ * follows the drag through two signals (`isDragging`, `isDropTarget`) and lets
12
+ * the caller keep its index, disabled flag, data, element and handle in step
13
+ * with the list.
14
+ */
15
+ export class SortableItemController {
16
+ /** `true` while this row is being dragged. */
17
+ isDragging;
18
+ /** `true` while another dragged row is over this one. */
19
+ isDropTarget;
20
+ manager;
21
+ id;
22
+ sortable;
23
+ unbind;
24
+ currentData;
25
+ /**
26
+ * Creates the row and registers it with the list.
27
+ *
28
+ * @param input - The manager, the list, the row's options and its signals.
29
+ */
30
+ constructor(input) {
31
+ const { list, manager, options } = input;
32
+ this.manager = manager;
33
+ this.id = String(options.id);
34
+ this.currentData = options.data;
35
+ this.isDragging = input.isDragging ?? signal(false);
36
+ this.isDropTarget = input.isDropTarget ?? signal(false);
37
+ this.sortable = new Sortable({
38
+ id: options.id,
39
+ index: list.indexOf(options.id),
40
+ data: options.data,
41
+ disabled: options.disabled ?? false,
42
+ element: input.element,
43
+ }, manager);
44
+ const unbindDragging = manager.monitor.addEventListener('dragstart', ({ operation }) => {
45
+ this.isDragging.set(operation.source ? String(operation.source.id) === this.id : false);
46
+ });
47
+ const unbindOver = manager.monitor.addEventListener('dragover', ({ operation }) => {
48
+ const { source, target } = operation;
49
+ const overThisRow = target !== null && String(target.id) === this.id;
50
+ const draggedRow = source !== null && String(source.id) === this.id;
51
+ this.isDropTarget.set(overThisRow && !draggedRow);
52
+ });
53
+ const unbindEnd = manager.monitor.addEventListener('dragend', () => {
54
+ this.isDragging.set(false);
55
+ this.isDropTarget.set(false);
56
+ });
57
+ this.unbind = () => {
58
+ unbindDragging();
59
+ unbindOver();
60
+ unbindEnd();
61
+ };
62
+ }
63
+ /**
64
+ * Sets the row's id, keeping it registered under the same key.
65
+ *
66
+ * @param id - The id of one of the list's `items`.
67
+ */
68
+ setId(id) {
69
+ if (id === this.id)
70
+ return;
71
+ this.id = id;
72
+ this.sortable.id = id;
73
+ }
74
+ /**
75
+ * Sets the row's index in the list's current `items`.
76
+ *
77
+ * @param index - The row's index (or `-1` when the list has no such item).
78
+ */
79
+ setIndex(index) {
80
+ this.sortable.index = index;
81
+ }
82
+ /**
83
+ * Sets whether the row is disabled.
84
+ *
85
+ * @param disabled - Whether dragging this row is disabled.
86
+ */
87
+ setDisabled(disabled) {
88
+ this.sortable.disabled = disabled;
89
+ }
90
+ /**
91
+ * Sets the data carried with the drag, reported on the drag events.
92
+ *
93
+ * @param data - The data, or `undefined` for none.
94
+ */
95
+ setData(data) {
96
+ if (data === this.currentData)
97
+ return;
98
+ this.currentData = data;
99
+ this.sortable.data = data ?? {};
100
+ }
101
+ /**
102
+ * Attaches the row's element. A `null` ref during a live drag leaves the
103
+ * attached element alone (the dragged row is briefly moved out of the DOM by
104
+ * the drop animation), as the React binding does.
105
+ *
106
+ * @param element - The row's element, or `undefined` on unmount.
107
+ */
108
+ setElement(element) {
109
+ if (!element && this.sortable.element?.isConnected && !this.manager.dragOperation.status.idle)
110
+ return;
111
+ this.sortable.element = element;
112
+ }
113
+ /**
114
+ * Attaches an optional drag handle so only that element starts a drag.
115
+ *
116
+ * @param handle - The handle's element, or `undefined` on unmount.
117
+ */
118
+ setHandle(handle) {
119
+ this.sortable.handle = handle;
120
+ }
121
+ /** Unregisters the row and removes its drag listeners. */
122
+ destroy() {
123
+ this.unbind();
124
+ this.sortable.destroy();
125
+ }
126
+ }
127
+ //# sourceMappingURL=sortable-item-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortable-item-controller.js","sourceRoot":"","sources":["../src/sortable-item-controller.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAuB,MAAM,eAAe,CAAA;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAsBhD;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IACjC,8CAA8C;IACrC,UAAU,CAAyB;IAC5C,yDAAyD;IAChD,YAAY,CAAyB;IAE7B,OAAO,CAAiB;IACjC,EAAE,CAAQ;IACD,QAAQ,CAAmC;IAC3C,MAAM,CAAY;IAC3B,WAAW,CAAqC;IAExD;;;;OAIG;IACH,YAAY,KAAkC;QAC5C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;QACxC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC5B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAA;QAC/B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA;QACnD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA;QACvD,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAC1B;YACE,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;YACnC,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,EACD,OAAO,CACR,CAAA;QACD,MAAM,cAAc,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AAK,IAAI,CAAC,EAAE;YAAE,OAAM;QAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAA;IACvB,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAA;IAC7B,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,QAAiB;QAC3B,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAA;IACnC,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,IAAyC;QAC/C,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW;YAAE,OAAM;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;QACvB,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;IACjC,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CAAC,OAA4B;QACrC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI;YAC3F,OAAM;QACR,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAA;IACjC,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,MAA2B;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAA;IAC/B,CAAC;IAED,0DAA0D;IAC1D,OAAO;QACL,IAAI,CAAC,MAAM,EAAE,CAAA;QACb,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACF"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * The row directives of the Angular sortable list.
3
+ *
4
+ * @module
5
+ */
6
+ import { type OnDestroy, type OnInit } from '@angular/core';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * One row of a `[molSortableList]`. Its host element is the row dnd-kit makes
10
+ * focusable and annotates, so the directive needs no template of its own:
11
+ *
12
+ * ```html
13
+ * <li molSortableItem [molSortableItem]="task.id">{{ task.title }}</li>
14
+ * ```
15
+ *
16
+ * `exportAs: 'molSortableItem'` exposes `isDragging` and `isDropTarget` to the
17
+ * template.
18
+ */
19
+ export declare class SortableItem implements OnInit, OnDestroy {
20
+ /** The id of one of the list's `items`. */
21
+ readonly molSortableItem: import("@angular/core").InputSignal<string>;
22
+ /** Data carried with the drag, reported on the drag events. */
23
+ readonly data: import("@angular/core").InputSignal<Record<string, unknown> | undefined>;
24
+ /** Disables dragging this item. Defaults to `false`. */
25
+ readonly disabled: import("@angular/core").InputSignal<boolean>;
26
+ /** `true` while this row is being dragged. */
27
+ readonly isDragging: import("@angular/core").WritableSignal<boolean>;
28
+ /** `true` while another dragged row is over this one. */
29
+ readonly isDropTarget: import("@angular/core").WritableSignal<boolean>;
30
+ private readonly list;
31
+ private readonly element;
32
+ private controller?;
33
+ /**
34
+ * Keeps the row's index, disabled flag and data in step with the list as its
35
+ * `items` change and the list is disabled or enabled.
36
+ */
37
+ constructor();
38
+ /**
39
+ * Registers the row with the list's manager, on the host element.
40
+ *
41
+ * @throws {Error} When the row is not inside a `[molSortableList]`.
42
+ */
43
+ ngOnInit(): void;
44
+ /**
45
+ * Attaches or clears the element that starts a drag for this row.
46
+ *
47
+ * @param handle - The handle's element, or `undefined` to drag by the whole row.
48
+ */
49
+ setHandle(handle: Element | undefined): void;
50
+ /** Unregisters the row from the list's manager. */
51
+ ngOnDestroy(): void;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortableItem, never>;
53
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SortableItem, "[molSortableItem]", ["molSortableItem"], { "molSortableItem": { "alias": "molSortableItem"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
54
+ }
55
+ /**
56
+ * Marks an element inside a `[molSortableItem]` as its drag handle: only that
57
+ * element starts a drag, while the rest of the row stays inert.
58
+ */
59
+ export declare class SortableItemHandle implements OnInit, OnDestroy {
60
+ private readonly item;
61
+ private readonly element;
62
+ /**
63
+ * Attaches this element as the row's drag handle.
64
+ *
65
+ * @throws {Error} When the handle is not inside a `[molSortableItem]`.
66
+ */
67
+ ngOnInit(): void;
68
+ /** Detaches the handle from the row. */
69
+ ngOnDestroy(): void;
70
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortableItemHandle, never>;
71
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SortableItemHandle, "[molSortableItemHandle]", never, {}, {}, never, never, true, never>;
72
+ }
73
+ //# sourceMappingURL=sortable-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortable-item.d.ts","sourceRoot":"","sources":["../src/sortable-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAML,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ,MAAM,eAAe,CAAA;;AAKtB;;;;;;;;;;GAUG;AACH,qBAKa,YAAa,YAAW,MAAM,EAAE,SAAS;IACpD,2CAA2C;IAC3C,QAAQ,CAAC,eAAe,8CAA2B;IACnD,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,2EAAmC;IAChD,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,+CAAe;IAChC,8CAA8C;IAC9C,QAAQ,CAAC,UAAU,kDAAgB;IACnC,yDAAyD;IACzD,QAAQ,CAAC,YAAY,kDAAgB;IAErC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4C;IACjE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAClE,OAAO,CAAC,UAAU,CAAC,CAAwB;IAE3C;;;OAGG;;IAiBH;;;;OAIG;IACH,QAAQ,IAAI,IAAI;IAiBhB;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAI5C,mDAAmD;IACnD,WAAW,IAAI,IAAI;yCApER,YAAY;2CAAZ,YAAY;CAuExB;AAED;;;GAGG;AACH,qBAIa,kBAAmB,YAAW,MAAM,EAAE,SAAS;IAC1D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2C;IAChE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAElE;;;;OAIG;IACH,QAAQ,IAAI,IAAI;IAMhB,wCAAwC;IACxC,WAAW,IAAI,IAAI;yCAhBR,kBAAkB;2CAAlB,kBAAkB;CAmB9B"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * The row directives of the Angular sortable list.
3
+ *
4
+ * @module
5
+ */
6
+ import { Directive, effect, ElementRef, inject, input, signal, } from '@angular/core';
7
+ import { SortableItemController } from './sortable-item-controller.js';
8
+ import { SORTABLE_LIST } from './sortable-list-context.js';
9
+ import * as i0 from "@angular/core";
10
+ /**
11
+ * One row of a `[molSortableList]`. Its host element is the row dnd-kit makes
12
+ * focusable and annotates, so the directive needs no template of its own:
13
+ *
14
+ * ```html
15
+ * <li molSortableItem [molSortableItem]="task.id">{{ task.title }}</li>
16
+ * ```
17
+ *
18
+ * `exportAs: 'molSortableItem'` exposes `isDragging` and `isDropTarget` to the
19
+ * template.
20
+ */
21
+ export class SortableItem {
22
+ /** The id of one of the list's `items`. */
23
+ molSortableItem = input.required(/* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "molSortableItem" }] : /* istanbul ignore next */ []));
25
+ /** Data carried with the drag, reported on the drag events. */
26
+ data = input(/* @ts-ignore */
27
+ ...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
28
+ /** Disables dragging this item. Defaults to `false`. */
29
+ disabled = input(false, /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
31
+ /** `true` while this row is being dragged. */
32
+ isDragging = signal(false, /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "isDragging" }] : /* istanbul ignore next */ []));
34
+ /** `true` while another dragged row is over this one. */
35
+ isDropTarget = signal(false, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "isDropTarget" }] : /* istanbul ignore next */ []));
37
+ list = inject(SORTABLE_LIST, { optional: true });
38
+ element = inject(ElementRef);
39
+ controller;
40
+ /**
41
+ * Keeps the row's index, disabled flag and data in step with the list as its
42
+ * `items` change and the list is disabled or enabled.
43
+ */
44
+ constructor() {
45
+ effect(() => {
46
+ const id = this.molSortableItem();
47
+ const disabled = this.disabled();
48
+ const listDisabled = this.list?.disabled() ?? false;
49
+ const index = this.list?.indexOf(id) ?? -1;
50
+ const data = this.data();
51
+ const controller = this.controller;
52
+ if (!controller)
53
+ return;
54
+ controller.setId(id);
55
+ controller.setIndex(index);
56
+ controller.setDisabled(disabled || listDisabled);
57
+ controller.setData(data);
58
+ });
59
+ }
60
+ /**
61
+ * Registers the row with the list's manager, on the host element.
62
+ *
63
+ * @throws {Error} When the row is not inside a `[molSortableList]`.
64
+ */
65
+ ngOnInit() {
66
+ const list = this.list;
67
+ if (!list)
68
+ throw new Error('molSortableItem must be used inside a [molSortableList].');
69
+ this.controller = new SortableItemController({
70
+ manager: list.manager,
71
+ list,
72
+ options: {
73
+ id: this.molSortableItem(),
74
+ data: this.data(),
75
+ disabled: this.disabled() || list.disabled(),
76
+ },
77
+ element: this.element.nativeElement,
78
+ isDragging: this.isDragging,
79
+ isDropTarget: this.isDropTarget,
80
+ });
81
+ }
82
+ /**
83
+ * Attaches or clears the element that starts a drag for this row.
84
+ *
85
+ * @param handle - The handle's element, or `undefined` to drag by the whole row.
86
+ */
87
+ setHandle(handle) {
88
+ this.controller?.setHandle(handle);
89
+ }
90
+ /** Unregisters the row from the list's manager. */
91
+ ngOnDestroy() {
92
+ this.controller?.destroy();
93
+ }
94
+ static ɵfac = function SortableItem_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SortableItem)(); };
95
+ static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SortableItem, selectors: [["", "molSortableItem", ""]], inputs: { molSortableItem: [1, "molSortableItem"], data: [1, "data"], disabled: [1, "disabled"] }, exportAs: ["molSortableItem"] });
96
+ }
97
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SortableItem, [{
98
+ type: Directive,
99
+ args: [{
100
+ selector: '[molSortableItem]',
101
+ standalone: true,
102
+ exportAs: 'molSortableItem',
103
+ }]
104
+ }], () => [], { molSortableItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "molSortableItem", required: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] }); })();
105
+ /**
106
+ * Marks an element inside a `[molSortableItem]` as its drag handle: only that
107
+ * element starts a drag, while the rest of the row stays inert.
108
+ */
109
+ export class SortableItemHandle {
110
+ item = inject(SortableItem, { optional: true });
111
+ element = inject(ElementRef);
112
+ /**
113
+ * Attaches this element as the row's drag handle.
114
+ *
115
+ * @throws {Error} When the handle is not inside a `[molSortableItem]`.
116
+ */
117
+ ngOnInit() {
118
+ if (!this.item)
119
+ throw new Error('molSortableItemHandle must be used inside a [molSortableItem].');
120
+ this.item.setHandle(this.element.nativeElement);
121
+ }
122
+ /** Detaches the handle from the row. */
123
+ ngOnDestroy() {
124
+ this.item?.setHandle(undefined);
125
+ }
126
+ static ɵfac = function SortableItemHandle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SortableItemHandle)(); };
127
+ static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SortableItemHandle, selectors: [["", "molSortableItemHandle", ""]] });
128
+ }
129
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SortableItemHandle, [{
130
+ type: Directive,
131
+ args: [{
132
+ selector: '[molSortableItemHandle]',
133
+ standalone: true,
134
+ }]
135
+ }], null, null); })();
136
+ //# sourceMappingURL=sortable-item.js.map
@@ -0,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AiB;aAC5B;;AA0ED;;;GAGG;AAKH,MAAM,OAAO,kBAAkB;IACZ,IAAI,GAAG,MAAM,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/C,OAAO,GAAG,MAAM,CAAsB,UAAU,CAAC,CAAA;IAElE;;;;OAIG;IACH,QAAQ;QACN,IAAI,CAAC,IAAI,CAAC,IAAI;YACZ,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;QACnF,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;IACjD,CAAC;IAED,wCAAwC;IACxC,WAAW;QACT,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;4GAlBU,kBAAkB;6DAAlB,kBAAkB;;iFAAlB,kBAAkB;cAJ9B,SAAS;eAAC;gBACT,QAAQ,EAAE,yBAAyB;gBACnC,UAAU,EAAE,IAAI;aACjB"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The context a sortable list gives its rows.
3
+ *
4
+ * @module
5
+ */
6
+ import { InjectionToken, type Signal } from '@angular/core';
7
+ import type { DragDropManager } from '@dnd-kit/dom';
8
+ /** What an item reads from the sortable list around it. */
9
+ export interface SortableListHost {
10
+ /** The dnd-kit manager the list owns. */
11
+ readonly manager: DragDropManager;
12
+ /** Whether the whole list is disabled. */
13
+ readonly disabled: Signal<boolean>;
14
+ /**
15
+ * The item's index in the list's current `items`.
16
+ *
17
+ * @param id - The item's id.
18
+ * @returns Its index, or `-1` when the list has no such item.
19
+ */
20
+ indexOf(id: string): number;
21
+ }
22
+ /** Set by the list directive; absent outside one. */
23
+ export declare const SORTABLE_LIST: InjectionToken<SortableListHost>;
24
+ //# sourceMappingURL=sortable-list-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortable-list-context.d.ts","sourceRoot":"","sources":["../src/sortable-list-context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;IACjC,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAClC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAC5B;AAED,qDAAqD;AACrD,eAAO,MAAM,aAAa,kCAAwD,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The context a sortable list gives its rows.
3
+ *
4
+ * @module
5
+ */
6
+ import { InjectionToken } from '@angular/core';
7
+ /** Set by the list directive; absent outside one. */
8
+ export const SORTABLE_LIST = new InjectionToken('SORTABLE_LIST');
9
+ //# sourceMappingURL=sortable-list-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortable-list-context.js","sourceRoot":"","sources":["../src/sortable-list-context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAA;AAkB3D,qDAAqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,cAAc,CAAmB,eAAe,CAAC,CAAA"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The Angular sortable list.
3
+ *
4
+ * @module
5
+ */
6
+ import { type OnDestroy } from '@angular/core';
7
+ import { DragDropManager } from '@dnd-kit/dom';
8
+ import type { DragEndEvent, DragOverEvent, DragStartEvent, SortableAxis, SortableStrategy } from '@molecule/app-drag-drop';
9
+ import type { DndKitConfig, SortableListOptions } from '@molecule/app-drag-drop-dndkit';
10
+ import { type SortableListHost } from './sortable-list-context.js';
11
+ import * as i0 from "@angular/core";
12
+ /**
13
+ * The inputs of {@link SortableList} (`[molSortableList]`): the options every
14
+ * framework's list takes. Its rows are the element's content.
15
+ *
16
+ * @template T - The item type. Items must have a stable string `id`.
17
+ */
18
+ export type SortableListProps<T extends {
19
+ id: string;
20
+ }> = SortableListOptions<T>;
21
+ /**
22
+ * A list the user reorders with the pointer, touch or the keyboard (Space or
23
+ * Enter to pick an item up, the arrow keys to move it, Space or Enter to drop
24
+ * it, Escape to cancel). A screen reader hears translated instructions and
25
+ * where the item is as it moves. A drop that moves an item calls `onReorder`
26
+ * with the new order; render `items` from your state.
27
+ *
28
+ * The callbacks are inputs, not outputs, so a consumer passes the same
29
+ * functions a React list takes (`[onReorder]="save"`). Each row carries
30
+ * {@link SortableItem} (`[molSortableItem]`, or `useSortableItem` in a
31
+ * component's field initializer).
32
+ *
33
+ * @template T - The item type. Items must have a stable string `id`.
34
+ */
35
+ export declare class SortableList<T extends {
36
+ id: string;
37
+ } = {
38
+ id: string;
39
+ }> implements SortableListHost, OnDestroy {
40
+ /** The items, in their current order. */
41
+ readonly items: import("@angular/core").InputSignal<T[]>;
42
+ /**
43
+ * Called with the whole list in its new order when a drop moves an item. Not
44
+ * called when the drag is cancelled, the list is disabled, or the item is
45
+ * dropped where it started. Persist the order here; the list renders `items`.
46
+ */
47
+ readonly onReorder: import("@angular/core").InputSignal<(items: T[]) => void>;
48
+ /** The axis an item may move along. Defaults to `strategy`'s axis, else `'vertical'`. */
49
+ readonly axis: import("@angular/core").InputSignal<SortableAxis | undefined>;
50
+ /** The layout: `'grid'` lets items move in any direction. Used when `axis` is absent. */
51
+ readonly strategy: import("@angular/core").InputSignal<SortableStrategy | undefined>;
52
+ /** Disables dragging every item. Defaults to `false`. */
53
+ readonly disabled: import("@angular/core").InputSignal<boolean>;
54
+ /** Pointer activation thresholds and the Escape behavior. */
55
+ readonly config: import("@angular/core").InputSignal<DndKitConfig | undefined>;
56
+ /**
57
+ * The name a screen reader hears for an item in the drag announcements
58
+ * ("Picked up {label}, position 2 of 5."). Defaults to the item's `id`.
59
+ */
60
+ readonly getItemLabel: import("@angular/core").InputSignal<((item: T) => string) | undefined>;
61
+ /** Called when a drag starts. */
62
+ readonly onDragStart: import("@angular/core").InputSignal<((event: DragStartEvent) => void) | undefined>;
63
+ /** Called while a dragged item is over another item. */
64
+ readonly onDragOver: import("@angular/core").InputSignal<((event: DragOverEvent) => void) | undefined>;
65
+ /** Called when a drag ends, before `onReorder`. `overId` is the item whose place it took. */
66
+ readonly onDragEnd: import("@angular/core").InputSignal<((event: DragEndEvent) => void) | undefined>;
67
+ /** The dnd-kit manager this list owns. */
68
+ readonly manager: DragDropManager;
69
+ /**
70
+ * Creates the list's manager with the shared sensors, modifiers and
71
+ * translated plugins, and reports the manager's drag events to the inputs.
72
+ */
73
+ constructor();
74
+ /**
75
+ * The item's index in the list's current `items`.
76
+ *
77
+ * @param id - The item's id.
78
+ * @returns Its index, or `-1` when the list has no such item.
79
+ */
80
+ indexOf(id: string): number;
81
+ /** Destroys the manager, which removes the instructions and the live region. */
82
+ ngOnDestroy(): void;
83
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortableList<any>, never>;
84
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SortableList<any>, "[molSortableList]", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "onReorder": { "alias": "onReorder"; "required": true; "isSignal": true; }; "axis": { "alias": "axis"; "required": false; "isSignal": true; }; "strategy": { "alias": "strategy"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "getItemLabel": { "alias": "getItemLabel"; "required": false; "isSignal": true; }; "onDragStart": { "alias": "onDragStart"; "required": false; "isSignal": true; }; "onDragOver": { "alias": "onDragOver"; "required": false; "isSignal": true; }; "onDragEnd": { "alias": "onDragEnd"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
85
+ }
86
+ //# sourceMappingURL=sortable-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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