@kaskad/angular-dnd 0.0.7
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/README.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as i1 from '@angular/cdk/drag-drop';
|
|
2
|
+
import { CdkDragHandle, CdkDrag, CdkDropList, CDK_DROP_LIST } from '@angular/cdk/drag-drop';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Directive, input, inject, DestroyRef, effect, Injector } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
const componentsDefinitions = {
|
|
7
|
+
'dnd.Drag': {
|
|
8
|
+
traits: ['sys.Box'],
|
|
9
|
+
properties: {
|
|
10
|
+
'dragData@unknown': null,
|
|
11
|
+
'disabled@boolean': false,
|
|
12
|
+
'dragStarted@(unknown)': null,
|
|
13
|
+
'dragEnded@(unknown, string)': null,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
'dnd.DragHandle': {
|
|
17
|
+
traits: ['sys.Box'],
|
|
18
|
+
properties: {},
|
|
19
|
+
},
|
|
20
|
+
'dnd.DropZone': {
|
|
21
|
+
traits: ['sys.Group', 'browser.Styled'],
|
|
22
|
+
properties: {
|
|
23
|
+
'zoneId@string': null,
|
|
24
|
+
'connectedZones@string[]': [],
|
|
25
|
+
'disabled@boolean': false,
|
|
26
|
+
'dropped@(unknown, string, number)': null,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
'dnd.DropList': {
|
|
30
|
+
traits: ['sys.Box'],
|
|
31
|
+
properties: {
|
|
32
|
+
'listId@string': null,
|
|
33
|
+
'connectedTo@string[]': [],
|
|
34
|
+
'disabled@boolean': false,
|
|
35
|
+
'orientation@string': 'vertical',
|
|
36
|
+
'dropped@(unknown, string, number)': null,
|
|
37
|
+
'itemMoved@(unknown, number, number, string, string)': null,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
class DragHandleDirective {
|
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DragHandleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
44
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: DragHandleDirective, isStandalone: true, selector: "[kkDragHandle]", hostDirectives: [{ directive: i1.CdkDragHandle }], ngImport: i0 });
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DragHandleDirective, decorators: [{
|
|
47
|
+
type: Directive,
|
|
48
|
+
args: [{
|
|
49
|
+
selector: '[kkDragHandle]',
|
|
50
|
+
hostDirectives: [CdkDragHandle],
|
|
51
|
+
}]
|
|
52
|
+
}] });
|
|
53
|
+
|
|
54
|
+
class DragDirective {
|
|
55
|
+
dragData = input(...(ngDevMode ? [undefined, { debugName: "dragData" }] : []));
|
|
56
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
57
|
+
dragStarted = input(...(ngDevMode ? [undefined, { debugName: "dragStarted" }] : []));
|
|
58
|
+
dragEnded = input(...(ngDevMode ? [undefined, { debugName: "dragEnded" }] : []));
|
|
59
|
+
cdkDrag = inject(CdkDrag);
|
|
60
|
+
destroyRef = inject(DestroyRef);
|
|
61
|
+
constructor() {
|
|
62
|
+
effect(() => {
|
|
63
|
+
this.cdkDrag.data = this.dragData();
|
|
64
|
+
});
|
|
65
|
+
const startedSub = this.cdkDrag.started.subscribe(() => {
|
|
66
|
+
this.dragStarted()?.execute(this.dragData());
|
|
67
|
+
});
|
|
68
|
+
const endedSub = this.cdkDrag.ended.subscribe((event) => {
|
|
69
|
+
const dropListId = event.source.dropContainer?.id ?? '';
|
|
70
|
+
this.dragEnded()?.execute(this.dragData(), dropListId);
|
|
71
|
+
});
|
|
72
|
+
this.destroyRef.onDestroy(() => {
|
|
73
|
+
startedSub.unsubscribe();
|
|
74
|
+
endedSub.unsubscribe();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DragDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
78
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.3", type: DragDirective, isStandalone: true, selector: "[kkDrag]", inputs: { dragData: { classPropertyName: "dragData", publicName: "dragData", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dragStarted: { classPropertyName: "dragStarted", publicName: "dragStarted", isSignal: true, isRequired: false, transformFunction: null }, dragEnded: { classPropertyName: "dragEnded", publicName: "dragEnded", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.CdkDrag, inputs: ["cdkDragDisabled", "disabled"] }], ngImport: i0 });
|
|
79
|
+
}
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DragDirective, decorators: [{
|
|
81
|
+
type: Directive,
|
|
82
|
+
args: [{
|
|
83
|
+
selector: '[kkDrag]',
|
|
84
|
+
hostDirectives: [{ directive: CdkDrag, inputs: ['cdkDragDisabled: disabled'] }],
|
|
85
|
+
}]
|
|
86
|
+
}], ctorParameters: () => [], propDecorators: { dragData: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragData", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dragStarted: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragStarted", required: false }] }], dragEnded: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragEnded", required: false }] }] } });
|
|
87
|
+
|
|
88
|
+
class DropListDirective {
|
|
89
|
+
listId = input(...(ngDevMode ? [undefined, { debugName: "listId" }] : []));
|
|
90
|
+
connectedTo = input([], ...(ngDevMode ? [{ debugName: "connectedTo" }] : []));
|
|
91
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
92
|
+
orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
93
|
+
dropped = input(...(ngDevMode ? [undefined, { debugName: "dropped" }] : []));
|
|
94
|
+
itemMoved = input(...(ngDevMode ? [undefined, { debugName: "itemMoved" }] : []));
|
|
95
|
+
cdkDropList = inject(CdkDropList);
|
|
96
|
+
destroyRef = inject(DestroyRef);
|
|
97
|
+
constructor() {
|
|
98
|
+
effect(() => {
|
|
99
|
+
const id = this.listId();
|
|
100
|
+
if (id) {
|
|
101
|
+
this.cdkDropList.id = id;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
effect(() => {
|
|
105
|
+
this.cdkDropList.orientation = this.orientation() === 'horizontal' ? 'horizontal' : 'vertical';
|
|
106
|
+
});
|
|
107
|
+
const droppedSub = this.cdkDropList.dropped.subscribe((event) => {
|
|
108
|
+
this.onDrop(event);
|
|
109
|
+
});
|
|
110
|
+
this.destroyRef.onDestroy(() => {
|
|
111
|
+
droppedSub.unsubscribe();
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
onDrop(event) {
|
|
115
|
+
const dragData = event.item.data;
|
|
116
|
+
const previousIndex = event.previousIndex;
|
|
117
|
+
const currentIndex = event.currentIndex;
|
|
118
|
+
const previousContainer = event.previousContainer.id;
|
|
119
|
+
const currentContainer = event.container.id;
|
|
120
|
+
if (previousContainer === currentContainer && previousIndex === currentIndex) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.dropped()?.execute(dragData, currentContainer, currentIndex);
|
|
124
|
+
this.itemMoved()?.execute(dragData, previousIndex, currentIndex, previousContainer, currentContainer);
|
|
125
|
+
}
|
|
126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DropListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
127
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.3", type: DropListDirective, isStandalone: true, selector: "[kkDropList]", inputs: { listId: { classPropertyName: "listId", publicName: "listId", isSignal: true, isRequired: false, transformFunction: null }, connectedTo: { classPropertyName: "connectedTo", publicName: "connectedTo", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dropped: { classPropertyName: "dropped", publicName: "dropped", isSignal: true, isRequired: false, transformFunction: null }, itemMoved: { classPropertyName: "itemMoved", publicName: "itemMoved", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.CdkDropList, inputs: ["cdkDropListConnectedTo", "connectedTo", "cdkDropListDisabled", "disabled"] }], ngImport: i0 });
|
|
128
|
+
}
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DropListDirective, decorators: [{
|
|
130
|
+
type: Directive,
|
|
131
|
+
args: [{
|
|
132
|
+
selector: '[kkDropList]',
|
|
133
|
+
hostDirectives: [
|
|
134
|
+
{
|
|
135
|
+
directive: CdkDropList,
|
|
136
|
+
inputs: ['cdkDropListConnectedTo: connectedTo', 'cdkDropListDisabled: disabled'],
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
}]
|
|
140
|
+
}], ctorParameters: () => [], propDecorators: { listId: [{ type: i0.Input, args: [{ isSignal: true, alias: "listId", required: false }] }], connectedTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "connectedTo", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], dropped: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropped", required: false }] }], itemMoved: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemMoved", required: false }] }] } });
|
|
141
|
+
|
|
142
|
+
class DropListContextDirective {
|
|
143
|
+
dropList = inject(CdkDropList);
|
|
144
|
+
parentInjector = inject(Injector);
|
|
145
|
+
injector = Injector.create({
|
|
146
|
+
providers: [{ provide: CDK_DROP_LIST, useValue: this.dropList }],
|
|
147
|
+
parent: this.parentInjector,
|
|
148
|
+
});
|
|
149
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DropListContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
150
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: DropListContextDirective, isStandalone: true, selector: "[kkDropListContext]", exportAs: ["kkDropListContext"], ngImport: i0 });
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DropListContextDirective, decorators: [{
|
|
153
|
+
type: Directive,
|
|
154
|
+
args: [{
|
|
155
|
+
selector: '[kkDropListContext]',
|
|
156
|
+
exportAs: 'kkDropListContext',
|
|
157
|
+
}]
|
|
158
|
+
}] });
|
|
159
|
+
|
|
160
|
+
const dnd = {
|
|
161
|
+
definitions: componentsDefinitions,
|
|
162
|
+
components: {
|
|
163
|
+
'dnd.DropList': { directive: DropListDirective },
|
|
164
|
+
'dnd.Drag': { directive: DragDirective },
|
|
165
|
+
'dnd.DragHandle': { directive: DragHandleDirective },
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Generated bundle index. Do not edit.
|
|
171
|
+
*/
|
|
172
|
+
|
|
173
|
+
export { DragDirective, DragHandleDirective, DropListContextDirective, DropListDirective, dnd };
|
|
174
|
+
//# sourceMappingURL=kaskad-angular-dnd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kaskad-angular-dnd.mjs","sources":["../../../../libs/angular-dnd/src/lib/definitions/definitions.ts","../../../../libs/angular-dnd/src/lib/drag-handle.directive.ts","../../../../libs/angular-dnd/src/lib/drag.directive.ts","../../../../libs/angular-dnd/src/lib/drop-list.directive.ts","../../../../libs/angular-dnd/src/lib/drop-list-context.directive.ts","../../../../libs/angular-dnd/src/index.ts","../../../../libs/angular-dnd/src/kaskad-angular-dnd.ts"],"sourcesContent":["import { ComponentRawDefinition } from '@kaskad/schema';\n\nexport const componentsDefinitions: Record<string, ComponentRawDefinition> = {\n 'dnd.Drag': {\n traits: ['sys.Box'],\n properties: {\n 'dragData@unknown': null,\n 'disabled@boolean': false,\n 'dragStarted@(unknown)': null,\n 'dragEnded@(unknown, string)': null,\n },\n },\n 'dnd.DragHandle': {\n traits: ['sys.Box'],\n properties: {},\n },\n 'dnd.DropZone': {\n traits: ['sys.Group', 'browser.Styled'],\n properties: {\n 'zoneId@string': null,\n 'connectedZones@string[]': [],\n 'disabled@boolean': false,\n 'dropped@(unknown, string, number)': null,\n },\n },\n 'dnd.DropList': {\n traits: ['sys.Box'],\n properties: {\n 'listId@string': null,\n 'connectedTo@string[]': [],\n 'disabled@boolean': false,\n 'orientation@string': 'vertical',\n 'dropped@(unknown, string, number)': null,\n 'itemMoved@(unknown, number, number, string, string)': null,\n },\n },\n};\n","import { CdkDragHandle } from '@angular/cdk/drag-drop';\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: '[kkDragHandle]',\n hostDirectives: [CdkDragHandle],\n})\nexport class DragHandleDirective {}\n","import { CommandRef } from '@kaskad/core';\nimport { CdkDrag } from '@angular/cdk/drag-drop';\nimport { DestroyRef, Directive, effect, inject, input } from '@angular/core';\n\n@Directive({\n selector: '[kkDrag]',\n hostDirectives: [{ directive: CdkDrag, inputs: ['cdkDragDisabled: disabled'] }],\n})\nexport class DragDirective {\n dragData = input<unknown>();\n disabled = input<boolean>(false);\n\n dragStarted = input<CommandRef<{ args: unknown[] }, void>>();\n dragEnded = input<CommandRef<{ args: unknown[] }, void>>();\n\n private cdkDrag = inject(CdkDrag);\n private destroyRef = inject(DestroyRef);\n\n constructor() {\n effect(() => {\n this.cdkDrag.data = this.dragData();\n });\n\n const startedSub = this.cdkDrag.started.subscribe(() => {\n this.dragStarted()?.execute(this.dragData());\n });\n\n const endedSub = this.cdkDrag.ended.subscribe((event) => {\n const dropListId = event.source.dropContainer?.id ?? '';\n this.dragEnded()?.execute(this.dragData(), dropListId);\n });\n\n this.destroyRef.onDestroy(() => {\n startedSub.unsubscribe();\n endedSub.unsubscribe();\n });\n }\n}\n","import { CommandRef } from '@kaskad/core';\nimport { CdkDragDrop, CdkDropList } from '@angular/cdk/drag-drop';\nimport { DestroyRef, Directive, effect, inject, input } from '@angular/core';\n\n@Directive({\n selector: '[kkDropList]',\n hostDirectives: [\n {\n directive: CdkDropList,\n inputs: ['cdkDropListConnectedTo: connectedTo', 'cdkDropListDisabled: disabled'],\n },\n ],\n})\nexport class DropListDirective {\n listId = input<string>();\n connectedTo = input<string[]>([]);\n disabled = input<boolean>(false);\n orientation = input<string>('vertical');\n\n dropped = input<CommandRef<{ args: unknown[] }, void>>();\n itemMoved = input<CommandRef<{ args: unknown[] }, void>>();\n\n private cdkDropList = inject(CdkDropList);\n private destroyRef = inject(DestroyRef);\n\n constructor() {\n effect(() => {\n const id = this.listId();\n if (id) {\n this.cdkDropList.id = id;\n }\n });\n\n effect(() => {\n this.cdkDropList.orientation = this.orientation() === 'horizontal' ? 'horizontal' : 'vertical';\n });\n\n const droppedSub = this.cdkDropList.dropped.subscribe((event: CdkDragDrop<unknown>) => {\n this.onDrop(event);\n });\n\n this.destroyRef.onDestroy(() => {\n droppedSub.unsubscribe();\n });\n }\n\n private onDrop(event: CdkDragDrop<unknown>): void {\n const dragData = event.item.data;\n const previousIndex = event.previousIndex;\n const currentIndex = event.currentIndex;\n const previousContainer = event.previousContainer.id;\n const currentContainer = event.container.id;\n\n if (previousContainer === currentContainer && previousIndex === currentIndex) {\n return;\n }\n\n this.dropped()?.execute(dragData, currentContainer, currentIndex);\n this.itemMoved()?.execute(dragData, previousIndex, currentIndex, previousContainer, currentContainer);\n }\n}\n","import { CDK_DROP_LIST, CdkDropList } from '@angular/cdk/drag-drop';\nimport { Directive, inject, Injector } from '@angular/core';\n\n@Directive({\n selector: '[kkDropListContext]',\n exportAs: 'kkDropListContext',\n})\nexport class DropListContextDirective {\n private dropList = inject(CdkDropList);\n private parentInjector = inject(Injector);\n\n readonly injector = Injector.create({\n providers: [{ provide: CDK_DROP_LIST, useValue: this.dropList }],\n parent: this.parentInjector,\n });\n}\n","import { type NgKaskadModule } from '@kaskad/angular';\n\nimport { componentsDefinitions } from './lib/definitions/definitions';\nimport { DragHandleDirective } from './lib/drag-handle.directive';\nimport { DragDirective } from './lib/drag.directive';\nimport { DropListDirective } from './lib/drop-list.directive';\n\nexport { DropListDirective, DragDirective, DragHandleDirective };\nexport { DropListContextDirective } from './lib/drop-list-context.directive';\n\nexport const dnd: NgKaskadModule = {\n definitions: componentsDefinitions,\n components: {\n 'dnd.DropList': { directive: DropListDirective },\n 'dnd.Drag': { directive: DragDirective },\n 'dnd.DragHandle': { directive: DragHandleDirective },\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,qBAAqB,GAA2C;AAC3E,IAAA,UAAU,EAAE;QACV,MAAM,EAAE,CAAC,SAAS,CAAC;AACnB,QAAA,UAAU,EAAE;AACV,YAAA,kBAAkB,EAAE,IAAI;AACxB,YAAA,kBAAkB,EAAE,KAAK;AACzB,YAAA,uBAAuB,EAAE,IAAI;AAC7B,YAAA,6BAA6B,EAAE,IAAI;AACpC,SAAA;AACF,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,MAAM,EAAE,CAAC,SAAS,CAAC;AACnB,QAAA,UAAU,EAAE,EAAE;AACf,KAAA;AACD,IAAA,cAAc,EAAE;AACd,QAAA,MAAM,EA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CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC9B,iBAAA;;;ACIM,MAAM,GAAG,GAAmB;AACjC,IAAA,WAAW,EAAE,qBAAqB;AAClC,IAAA,UAAU,EAAE;AACV,QAAA,cAAc,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE;AAChD,QAAA,UAAU,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE;AACxC,QAAA,gBAAgB,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE;AACrD,KAAA;;;AChBH;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kaskad/angular-dnd",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/cdk": "^21.0.0",
|
|
6
|
+
"@angular/core": "^21.0.0",
|
|
7
|
+
"@kaskad/angular": "0.0.7",
|
|
8
|
+
"@kaskad/core": "0.0.7",
|
|
9
|
+
"@kaskad/schema": "0.0.7"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/kaskad-angular-dnd.mjs",
|
|
13
|
+
"typings": "types/kaskad-angular-dnd.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/kaskad-angular-dnd.d.ts",
|
|
20
|
+
"default": "./fesm2022/kaskad-angular-dnd.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"tslib": "^2.3.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NgKaskadModule } from '@kaskad/angular';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { CommandRef } from '@kaskad/core';
|
|
4
|
+
import * as i1 from '@angular/cdk/drag-drop';
|
|
5
|
+
|
|
6
|
+
declare class DragHandleDirective {
|
|
7
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DragHandleDirective, never>;
|
|
8
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DragHandleDirective, "[kkDragHandle]", never, {}, {}, never, never, true, [{ directive: typeof i1.CdkDragHandle; inputs: {}; outputs: {}; }]>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare class DragDirective {
|
|
12
|
+
dragData: _angular_core.InputSignal<unknown>;
|
|
13
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
14
|
+
dragStarted: _angular_core.InputSignal<CommandRef<{
|
|
15
|
+
args: unknown[];
|
|
16
|
+
}, void> | undefined>;
|
|
17
|
+
dragEnded: _angular_core.InputSignal<CommandRef<{
|
|
18
|
+
args: unknown[];
|
|
19
|
+
}, void> | undefined>;
|
|
20
|
+
private cdkDrag;
|
|
21
|
+
private destroyRef;
|
|
22
|
+
constructor();
|
|
23
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DragDirective, never>;
|
|
24
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DragDirective, "[kkDrag]", never, { "dragData": { "alias": "dragData"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "dragStarted": { "alias": "dragStarted"; "required": false; "isSignal": true; }; "dragEnded": { "alias": "dragEnded"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkDrag; inputs: { "cdkDragDisabled": "disabled"; }; outputs: {}; }]>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare class DropListDirective {
|
|
28
|
+
listId: _angular_core.InputSignal<string | undefined>;
|
|
29
|
+
connectedTo: _angular_core.InputSignal<string[]>;
|
|
30
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
31
|
+
orientation: _angular_core.InputSignal<string>;
|
|
32
|
+
dropped: _angular_core.InputSignal<CommandRef<{
|
|
33
|
+
args: unknown[];
|
|
34
|
+
}, void> | undefined>;
|
|
35
|
+
itemMoved: _angular_core.InputSignal<CommandRef<{
|
|
36
|
+
args: unknown[];
|
|
37
|
+
}, void> | undefined>;
|
|
38
|
+
private cdkDropList;
|
|
39
|
+
private destroyRef;
|
|
40
|
+
constructor();
|
|
41
|
+
private onDrop;
|
|
42
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropListDirective, never>;
|
|
43
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DropListDirective, "[kkDropList]", never, { "listId": { "alias": "listId"; "required": false; "isSignal": true; }; "connectedTo": { "alias": "connectedTo"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "dropped": { "alias": "dropped"; "required": false; "isSignal": true; }; "itemMoved": { "alias": "itemMoved"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkDropList; inputs: { "cdkDropListConnectedTo": "connectedTo"; "cdkDropListDisabled": "disabled"; }; outputs: {}; }]>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class DropListContextDirective {
|
|
47
|
+
private dropList;
|
|
48
|
+
private parentInjector;
|
|
49
|
+
readonly injector: _angular_core.DestroyableInjector;
|
|
50
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropListContextDirective, never>;
|
|
51
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DropListContextDirective, "[kkDropListContext]", ["kkDropListContext"], {}, {}, never, never, true, never>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare const dnd: NgKaskadModule;
|
|
55
|
+
|
|
56
|
+
export { DragDirective, DragHandleDirective, DropListContextDirective, DropListDirective, dnd };
|