@progress/kendo-angular-utils 11.6.0 → 12.0.0-develop.10
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/drag-and-drop/drag-state.service.d.ts +4 -0
- package/drag-and-drop/draghandle.directive.d.ts +1 -0
- package/drag-and-drop/dragtarget-container.directive.d.ts +164 -0
- package/drag-and-drop/dragtarget.directive.d.ts +45 -42
- package/drag-and-drop/droptarget-container.directive.d.ts +89 -0
- package/drag-and-drop/droptarget.directive.d.ts +7 -18
- package/drag-and-drop/events/drag-target/drag-event.d.ts +23 -5
- package/drag-and-drop/events/drag-target/dragready-event.d.ts +30 -0
- package/drag-and-drop/events/drag-target/end-event.d.ts +22 -4
- package/drag-and-drop/events/drag-target/index.d.ts +2 -0
- package/drag-and-drop/events/drag-target/press-event.d.ts +23 -5
- package/drag-and-drop/events/drag-target/release-event.d.ts +40 -0
- package/drag-and-drop/events/drag-target/start-event.d.ts +22 -4
- package/drag-and-drop/events/drop-target-event.d.ts +48 -0
- package/drag-and-drop/events/index.d.ts +6 -0
- package/drag-and-drop/hint.component.d.ts +3 -4
- package/{esm2020/drag-and-drop/events/drop-target/drop-event.mjs → drag-and-drop/models/drag-mode.d.ts} +2 -9
- package/drag-and-drop/models/functions.d.ts +17 -0
- package/drag-and-drop/models/hint-settings.d.ts +22 -0
- package/drag-and-drop/models/index.d.ts +4 -2
- package/drag-and-drop/util.d.ts +22 -2
- package/drag-and-drop.module.d.ts +5 -3
- package/esm2020/drag-and-drop/drag-state.service.mjs +2 -0
- package/esm2020/drag-and-drop/draghandle.directive.mjs +1 -0
- package/esm2020/drag-and-drop/dragtarget-container.directive.mjs +621 -0
- package/esm2020/drag-and-drop/dragtarget.directive.mjs +260 -162
- package/esm2020/drag-and-drop/droptarget-container.directive.mjs +224 -0
- package/esm2020/drag-and-drop/droptarget.directive.mjs +25 -43
- package/esm2020/drag-and-drop/events/drag-target/drag-event.mjs +15 -1
- package/esm2020/drag-and-drop/events/{drop-target/enter-event.mjs → drag-target/dragready-event.mjs} +2 -2
- package/esm2020/drag-and-drop/events/drag-target/end-event.mjs +15 -1
- package/esm2020/drag-and-drop/events/drag-target/index.mjs +2 -0
- package/esm2020/drag-and-drop/events/drag-target/press-event.mjs +15 -1
- package/esm2020/drag-and-drop/events/{drop-target/leave-event.mjs → drag-target/release-event.mjs} +16 -2
- package/esm2020/drag-and-drop/events/drag-target/start-event.mjs +15 -1
- package/esm2020/drag-and-drop/events/drop-target-event.mjs +29 -0
- package/esm2020/drag-and-drop/events/index.mjs +6 -0
- package/esm2020/drag-and-drop/hint.component.mjs +9 -20
- package/esm2020/drag-and-drop/models/functions.mjs +5 -0
- package/esm2020/drag-and-drop/models/hint-settings.mjs +5 -0
- package/esm2020/drag-and-drop/util.mjs +73 -5
- package/esm2020/drag-and-drop.module.mjs +8 -0
- package/esm2020/index.mjs +4 -1
- package/esm2020/package-metadata.mjs +2 -2
- package/fesm2015/progress-kendo-angular-utils.mjs +1346 -307
- package/fesm2020/progress-kendo-angular-utils.mjs +1349 -313
- package/index.d.ts +4 -2
- package/package.json +3 -3
- package/drag-and-drop/events/drop-target/drop-event.d.ts +0 -22
- package/drag-and-drop/events/drop-target/enter-event.d.ts +0 -22
- package/drag-and-drop/events/drop-target/index.d.ts +0 -8
- package/drag-and-drop/events/drop-target/leave-event.d.ts +0 -22
- package/drag-and-drop/events/drop-target/over-event.d.ts +0 -22
- package/drag-and-drop/models/allowed-target.d.ts +0 -16
- package/esm2020/drag-and-drop/events/drop-target/index.mjs +0 -8
- package/esm2020/drag-and-drop/events/drop-target/over-event.mjs +0 -15
- /package/drag-and-drop/models/{dragaxis.d.ts → drag-axis.d.ts} +0 -0
- /package/esm2020/drag-and-drop/models/{allowed-target.mjs → drag-axis.mjs} +0 -0
- /package/esm2020/drag-and-drop/models/{dragaxis.mjs → drag-mode.mjs} +0 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ChangeDetectorRef, Directive, ElementRef, EventEmitter, Input, NgZone, Output } from '@angular/core';
|
|
6
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
7
|
+
import { packageMetadata } from '../package-metadata';
|
|
8
|
+
import { DragStateService } from './drag-state.service';
|
|
9
|
+
import { DropTargetEvent } from './events/drop-target-event';
|
|
10
|
+
import { isPresent, intersect } from './util';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "./drag-state.service";
|
|
13
|
+
/**
|
|
14
|
+
* Represents the [Kendo UI DropTargetContainer directive for Angular]({% slug api_utils_droptargetcontainerdirective %}).
|
|
15
|
+
* Used to configure multiple elements as drop targets.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts-no-run
|
|
19
|
+
* <div kendoDropTargetContainer dropTargetFilter=".my-droptarget">
|
|
20
|
+
* <div class="my-droptarget">foo</div>
|
|
21
|
+
* </div>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export class DropTargetContainerDirective {
|
|
25
|
+
constructor(service, element, ngZone, cdr) {
|
|
26
|
+
this.service = service;
|
|
27
|
+
this.element = element;
|
|
28
|
+
this.ngZone = ngZone;
|
|
29
|
+
this.cdr = cdr;
|
|
30
|
+
/**
|
|
31
|
+
* Fires when a DragTarget element enters the DropTarget.
|
|
32
|
+
*/
|
|
33
|
+
this.dragEnter = new EventEmitter();
|
|
34
|
+
/**
|
|
35
|
+
* Fires when a DragTarget element is being dragged over the DropTarget.
|
|
36
|
+
*/
|
|
37
|
+
this.dragOver = new EventEmitter();
|
|
38
|
+
/**
|
|
39
|
+
* Fires when a DragTarget element leaves the DropTarget.
|
|
40
|
+
*/
|
|
41
|
+
this.dragLeave = new EventEmitter();
|
|
42
|
+
/**
|
|
43
|
+
* Fires when a DragTarget element is dropped over the DropTarget.
|
|
44
|
+
*/
|
|
45
|
+
this.drop = new EventEmitter();
|
|
46
|
+
this.currentDropTarget = null;
|
|
47
|
+
this.currentDropTargetElement = null;
|
|
48
|
+
this.previousDropTargets = [];
|
|
49
|
+
this._dropTargetFilter = null;
|
|
50
|
+
this._dropDisabled = false;
|
|
51
|
+
validatePackage(packageMetadata);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Specifies a selector for elements within a container which will be configured as drop targets
|
|
55
|
+
* ([see example]({% slug drop_target_container %})). The possible values include any
|
|
56
|
+
* DOM `selector`.
|
|
57
|
+
*/
|
|
58
|
+
set dropTargetFilter(value) {
|
|
59
|
+
this._dropTargetFilter = value;
|
|
60
|
+
if (!this.dropDisabled) {
|
|
61
|
+
this.initializeDropTargets();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
get dropTargetFilter() {
|
|
65
|
+
return this._dropTargetFilter;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Specifies whether the Drop Targets within the container will emit the corresponding events upon interaction with a Drag Target.
|
|
69
|
+
*/
|
|
70
|
+
set dropDisabled(value) {
|
|
71
|
+
if (value) {
|
|
72
|
+
this.clearPreviousTargets();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.initializeDropTargets();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
get dropDisabled() {
|
|
79
|
+
return this._dropDisabled;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Used for notifying the DropTargetContainer that its content has changed.
|
|
83
|
+
*/
|
|
84
|
+
notify() {
|
|
85
|
+
this.cdr.detectChanges();
|
|
86
|
+
this.initializeDropTargets();
|
|
87
|
+
}
|
|
88
|
+
get nativeElement() {
|
|
89
|
+
return this.element.nativeElement;
|
|
90
|
+
}
|
|
91
|
+
ngAfterViewInit() {
|
|
92
|
+
!this.dropDisabled && this.initializeDropTargets();
|
|
93
|
+
}
|
|
94
|
+
get allDropTargets() {
|
|
95
|
+
if (isPresent(this.dropTargetFilter) && this.dropTargetFilter !== '') {
|
|
96
|
+
return Array.from(this.nativeElement.querySelectorAll(this.dropTargetFilter));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @hidden
|
|
101
|
+
*/
|
|
102
|
+
handleDragEnter(event) {
|
|
103
|
+
if (!this.service.dragTarget) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const eventTarget = event.originalEvent.target;
|
|
107
|
+
this.currentDropTargetElement = intersect(eventTarget, this.allDropTargets);
|
|
108
|
+
this.currentDropTarget = this.service.dropTargets.find(dt => dt.element === this.currentDropTargetElement);
|
|
109
|
+
this.service.dropTarget = this.currentDropTarget;
|
|
110
|
+
this.service.dropIndex = this.getDropIndex();
|
|
111
|
+
this.emitZoneAwareEvent('dragEnter', event);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @hidden
|
|
115
|
+
*/
|
|
116
|
+
handleDragLeave(event) {
|
|
117
|
+
this.service.dropTarget = null;
|
|
118
|
+
if (!this.service.dragTarget) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.emitZoneAwareEvent('dragLeave', event);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @hidden
|
|
125
|
+
*/
|
|
126
|
+
handleDragOver(event) {
|
|
127
|
+
if (!this.service.dragTarget) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.emitZoneAwareEvent('dragOver', event);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @hidden
|
|
134
|
+
*/
|
|
135
|
+
handleDrop(event) {
|
|
136
|
+
if (!this.service.dragTarget) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this.emitZoneAwareEvent('drop', event);
|
|
140
|
+
this.currentDropTarget = null;
|
|
141
|
+
this.currentDropTargetElement = null;
|
|
142
|
+
this.service.dropIndex = null;
|
|
143
|
+
}
|
|
144
|
+
initializeDropTargets() {
|
|
145
|
+
if (!isPresent(this.allDropTargets)) {
|
|
146
|
+
if (this.previousDropTargets.length > 0) {
|
|
147
|
+
this.clearPreviousTargets();
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.allDropTargets.forEach(dropTargetEl => {
|
|
152
|
+
const isDropTargetInitialized = this.service.dropTargets.find(dt => dt.element === dropTargetEl);
|
|
153
|
+
if (!isDropTargetInitialized) {
|
|
154
|
+
this.service.dropTargets.push({
|
|
155
|
+
element: dropTargetEl,
|
|
156
|
+
onDragEnter: this.handleDragEnter.bind(this),
|
|
157
|
+
onDragLeave: this.handleDragLeave.bind(this),
|
|
158
|
+
onDragOver: this.handleDragOver.bind(this),
|
|
159
|
+
onDrop: this.handleDrop.bind(this)
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
if (this.previousDropTargets.length > 0) {
|
|
164
|
+
const dropTargetsToRemove = this.previousDropTargets.filter(dt => !this.allDropTargets.includes(dt));
|
|
165
|
+
dropTargetsToRemove.forEach(dropTarget => {
|
|
166
|
+
const idx = this.service.dropTargets.findIndex(serviceDropTarget => serviceDropTarget.element === dropTarget);
|
|
167
|
+
if (idx > -1) {
|
|
168
|
+
this.service.dropTargets.splice(idx, 1);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
this.previousDropTargets = this.allDropTargets;
|
|
173
|
+
}
|
|
174
|
+
emitZoneAwareEvent(event, normalizedEvent) {
|
|
175
|
+
const eventProps = {
|
|
176
|
+
dragTarget: this.service.dragTarget,
|
|
177
|
+
dropTarget: this.currentDropTargetElement,
|
|
178
|
+
dragData: this.service.dragData,
|
|
179
|
+
dragEvent: normalizedEvent,
|
|
180
|
+
dropTargetIndex: this.service.dropIndex
|
|
181
|
+
};
|
|
182
|
+
if (isPresent(this.service.dragTarget?.hint)) {
|
|
183
|
+
eventProps.hintElement = this.service.dragTarget.hint;
|
|
184
|
+
}
|
|
185
|
+
const eventArgs = new DropTargetEvent(eventProps);
|
|
186
|
+
this.ngZone.run(() => {
|
|
187
|
+
this[event].emit(eventArgs);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
getDropIndex() {
|
|
191
|
+
const allTargets = this.nativeElement.querySelectorAll(this.dropTargetFilter);
|
|
192
|
+
return Array.from(allTargets).indexOf(this.currentDropTargetElement);
|
|
193
|
+
}
|
|
194
|
+
clearPreviousTargets() {
|
|
195
|
+
this.previousDropTargets.forEach(dropTarget => {
|
|
196
|
+
const idx = this.service.dropTargets.findIndex(serviceDropTarget => serviceDropTarget.element === dropTarget);
|
|
197
|
+
if (idx > -1) {
|
|
198
|
+
this.service.dropTargets.splice(idx, 1);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
this.previousDropTargets = [];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
DropTargetContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetContainerDirective, deps: [{ token: i1.DragStateService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
205
|
+
DropTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetContainerDirective, selector: "[kendoDropTargetContainer]", inputs: { dropTargetFilter: "dropTargetFilter", dropDisabled: "dropDisabled" }, outputs: { dragEnter: "dragEnter", dragOver: "dragOver", dragLeave: "dragLeave", drop: "drop" }, exportAs: ["kendoDropTargetContainer"], ngImport: i0 });
|
|
206
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetContainerDirective, decorators: [{
|
|
207
|
+
type: Directive,
|
|
208
|
+
args: [{
|
|
209
|
+
selector: '[kendoDropTargetContainer]',
|
|
210
|
+
exportAs: 'kendoDropTargetContainer'
|
|
211
|
+
}]
|
|
212
|
+
}], ctorParameters: function () { return [{ type: i1.DragStateService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { dropTargetFilter: [{
|
|
213
|
+
type: Input
|
|
214
|
+
}], dropDisabled: [{
|
|
215
|
+
type: Input
|
|
216
|
+
}], dragEnter: [{
|
|
217
|
+
type: Output
|
|
218
|
+
}], dragOver: [{
|
|
219
|
+
type: Output
|
|
220
|
+
}], dragLeave: [{
|
|
221
|
+
type: Output
|
|
222
|
+
}], drop: [{
|
|
223
|
+
type: Output
|
|
224
|
+
}] } });
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, ElementRef, EventEmitter,
|
|
5
|
+
import { Directive, ElementRef, EventEmitter, NgZone, Output } from "@angular/core";
|
|
6
6
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
7
7
|
import { packageMetadata } from '../package-metadata';
|
|
8
8
|
import { DragStateService } from "./drag-state.service";
|
|
9
|
-
import {
|
|
10
|
-
import { isPresent } from
|
|
9
|
+
import { DropTargetEvent } from './events/drop-target-event';
|
|
10
|
+
import { isPresent } from "./util";
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
12
|
import * as i1 from "./drag-state.service";
|
|
13
13
|
/**
|
|
@@ -20,22 +20,18 @@ export class DropTargetDirective {
|
|
|
20
20
|
this.ngZone = ngZone;
|
|
21
21
|
/**
|
|
22
22
|
* Fires when a DragTarget element enters the DropTarget.
|
|
23
|
-
* This event is preventable. Preventing it allows full logic customization.
|
|
24
23
|
*/
|
|
25
24
|
this.dragEnter = new EventEmitter();
|
|
26
25
|
/**
|
|
27
26
|
* Fires when a DragTarget element is being dragged over the DropTarget.
|
|
28
|
-
* This event is preventable. Preventing it allows full logic customization.
|
|
29
27
|
*/
|
|
30
28
|
this.dragOver = new EventEmitter();
|
|
31
29
|
/**
|
|
32
30
|
* Fires when a DragTarget element leaves the DropTarget.
|
|
33
|
-
* This event is preventable. Preventing it allows full logic customization.
|
|
34
31
|
*/
|
|
35
32
|
this.dragLeave = new EventEmitter();
|
|
36
33
|
/**
|
|
37
34
|
* Fires when a DragTarget element is dropped over the DropTarget.
|
|
38
|
-
* This event is preventable. Preventing it allows full logic customization.
|
|
39
35
|
*/
|
|
40
36
|
this.drop = new EventEmitter();
|
|
41
37
|
validatePackage(packageMetadata);
|
|
@@ -51,29 +47,10 @@ export class DropTargetDirective {
|
|
|
51
47
|
if (!this.service.dragTarget) {
|
|
52
48
|
return;
|
|
53
49
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
allowed = this.allowedDragTargets(this.service.dragTargetDirective);
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
case 'string': {
|
|
62
|
-
allowed = this.service.dragTargetDirective.link === this.allowedDragTargets;
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
default: {
|
|
66
|
-
allowed = this.allowedDragTargets.some(dt => dt === this.service.dragTargetDirective.link);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (allowed) {
|
|
71
|
-
this.service.dropTarget = this.dropTarget;
|
|
72
|
-
this.ngZone.run(() => {
|
|
73
|
-
const eventArgs = new DropTargetDragEnterEvent({ normalizedEvent: event, hostElement: this.element.nativeElement });
|
|
74
|
-
this.dragEnter.emit(eventArgs);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
50
|
+
this.service.dropTarget = this.dropTarget;
|
|
51
|
+
this.ngZone.run(() => {
|
|
52
|
+
this.emitEvent('dragEnter', event);
|
|
53
|
+
});
|
|
77
54
|
}
|
|
78
55
|
/**
|
|
79
56
|
* @hidden
|
|
@@ -84,8 +61,7 @@ export class DropTargetDirective {
|
|
|
84
61
|
return;
|
|
85
62
|
}
|
|
86
63
|
this.ngZone.run(() => {
|
|
87
|
-
|
|
88
|
-
this.dragLeave.emit(eventArgs);
|
|
64
|
+
this.emitEvent('dragLeave', event);
|
|
89
65
|
});
|
|
90
66
|
}
|
|
91
67
|
/**
|
|
@@ -96,8 +72,7 @@ export class DropTargetDirective {
|
|
|
96
72
|
return;
|
|
97
73
|
}
|
|
98
74
|
this.ngZone.run(() => {
|
|
99
|
-
|
|
100
|
-
this.dragOver.emit(eventArgs);
|
|
75
|
+
this.emitEvent('dragOver', event);
|
|
101
76
|
});
|
|
102
77
|
}
|
|
103
78
|
/**
|
|
@@ -105,13 +80,9 @@ export class DropTargetDirective {
|
|
|
105
80
|
*/
|
|
106
81
|
handleDrop(event) {
|
|
107
82
|
this.ngZone.run(() => {
|
|
108
|
-
|
|
109
|
-
this.drop.emit(eventArgs);
|
|
83
|
+
this.emitEvent('drop', event);
|
|
110
84
|
});
|
|
111
85
|
}
|
|
112
|
-
/**
|
|
113
|
-
* @hidden
|
|
114
|
-
*/
|
|
115
86
|
initializeDropTarget() {
|
|
116
87
|
this.dropTarget = {
|
|
117
88
|
element: this.element.nativeElement,
|
|
@@ -121,18 +92,29 @@ export class DropTargetDirective {
|
|
|
121
92
|
onDrop: this.handleDrop.bind(this)
|
|
122
93
|
};
|
|
123
94
|
}
|
|
95
|
+
emitEvent(event, normalizedEvent) {
|
|
96
|
+
const eventProps = {
|
|
97
|
+
dropTarget: this.element.nativeElement,
|
|
98
|
+
dragTarget: this.service.dragTarget?.element,
|
|
99
|
+
dragEvent: normalizedEvent,
|
|
100
|
+
dragData: this.service.dragData
|
|
101
|
+
};
|
|
102
|
+
if (isPresent(this.service.dragTarget?.hint)) {
|
|
103
|
+
eventProps.hintElement = this.service.dragTarget.element;
|
|
104
|
+
}
|
|
105
|
+
const eventArgs = new DropTargetEvent(eventProps);
|
|
106
|
+
this[event].emit(eventArgs);
|
|
107
|
+
}
|
|
124
108
|
}
|
|
125
109
|
DropTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetDirective, deps: [{ token: i1.DragStateService }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
126
|
-
DropTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetDirective, selector: "[kendoDropTarget]",
|
|
110
|
+
DropTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetDirective, selector: "[kendoDropTarget]", outputs: { dragEnter: "dragEnter", dragOver: "dragOver", dragLeave: "dragLeave", drop: "drop" }, exportAs: ["kendoDropTarget"], ngImport: i0 });
|
|
127
111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetDirective, decorators: [{
|
|
128
112
|
type: Directive,
|
|
129
113
|
args: [{
|
|
130
114
|
selector: '[kendoDropTarget]',
|
|
131
115
|
exportAs: 'kendoDropTarget'
|
|
132
116
|
}]
|
|
133
|
-
}], ctorParameters: function () { return [{ type: i1.DragStateService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: {
|
|
134
|
-
type: Input
|
|
135
|
-
}], dragEnter: [{
|
|
117
|
+
}], ctorParameters: function () { return [{ type: i1.DragStateService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { dragEnter: [{
|
|
136
118
|
type: Output
|
|
137
119
|
}], dragOver: [{
|
|
138
120
|
type: Output
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PreventableEvent } from '@progress/kendo-angular-common';
|
|
6
6
|
/**
|
|
7
|
-
* Arguments for the drag event of the DragTarget.
|
|
7
|
+
* Arguments for the drag event of the DragTarget and DragTargetContainer.
|
|
8
8
|
*/
|
|
9
9
|
export class DragTargetDragEvent extends PreventableEvent {
|
|
10
10
|
/**
|
|
@@ -14,4 +14,18 @@ export class DragTargetDragEvent extends PreventableEvent {
|
|
|
14
14
|
super();
|
|
15
15
|
Object.assign(this, args);
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
get normalizedEvent() {
|
|
22
|
+
return this.dragEvent;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
get hostElement() {
|
|
29
|
+
return this.dragTarget;
|
|
30
|
+
}
|
|
17
31
|
}
|
package/esm2020/drag-and-drop/events/{drop-target/enter-event.mjs → drag-target/dragready-event.mjs}
RENAMED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Arguments for the
|
|
6
|
+
* Arguments for the dragReady event of the DragTarget and DragTargetContainer.
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class DragTargetDragReadyEvent {
|
|
9
9
|
/**
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Arguments for the dragEnd event of the DragTarget.
|
|
6
|
+
* Arguments for the dragEnd event of the DragTarget and DragTargetContainer.
|
|
7
7
|
*/
|
|
8
8
|
export class DragTargetDragEndEvent {
|
|
9
9
|
/**
|
|
@@ -12,4 +12,18 @@ export class DragTargetDragEndEvent {
|
|
|
12
12
|
constructor(args) {
|
|
13
13
|
Object.assign(this, args);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
get normalizedEvent() {
|
|
20
|
+
return this.dragEvent;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
get hostElement() {
|
|
27
|
+
return this.dragTarget;
|
|
28
|
+
}
|
|
15
29
|
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
export { DragTargetPressEvent } from './press-event';
|
|
6
|
+
export { DragTargetDragReadyEvent } from './dragready-event';
|
|
6
7
|
export { DragTargetDragStartEvent } from './start-event';
|
|
7
8
|
export { DragTargetDragEndEvent } from './end-event';
|
|
8
9
|
export { DragTargetDragEvent } from './drag-event';
|
|
10
|
+
export { DragTargetReleaseEvent } from './release-event';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Arguments for the press event of the DragTarget.
|
|
6
|
+
* Arguments for the press event of the DragTarget and DragTargetContainer.
|
|
7
7
|
*/
|
|
8
8
|
export class DragTargetPressEvent {
|
|
9
9
|
/**
|
|
@@ -12,4 +12,18 @@ export class DragTargetPressEvent {
|
|
|
12
12
|
constructor(args) {
|
|
13
13
|
Object.assign(this, args);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
get normalizedEvent() {
|
|
20
|
+
return this.dragEvent;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
get hostElement() {
|
|
27
|
+
return this.dragTarget;
|
|
28
|
+
}
|
|
15
29
|
}
|
package/esm2020/drag-and-drop/events/{drop-target/leave-event.mjs → drag-target/release-event.mjs}
RENAMED
|
@@ -3,13 +3,27 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Arguments for the
|
|
6
|
+
* Arguments for the release event of the DragTarget and DragTargetContainer.
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class DragTargetReleaseEvent {
|
|
9
9
|
/**
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
12
|
constructor(args) {
|
|
13
13
|
Object.assign(this, args);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
get normalizedEvent() {
|
|
20
|
+
return this.dragEvent;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
get hostElement() {
|
|
27
|
+
return this.dragTarget;
|
|
28
|
+
}
|
|
15
29
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PreventableEvent } from '@progress/kendo-angular-common';
|
|
6
6
|
/**
|
|
7
|
-
* Arguments for the dragStart event of the DragTarget.
|
|
7
|
+
* Arguments for the dragStart event of the DragTarget and DragTargetContainer.
|
|
8
8
|
*/
|
|
9
9
|
export class DragTargetDragStartEvent extends PreventableEvent {
|
|
10
10
|
/**
|
|
@@ -14,4 +14,18 @@ export class DragTargetDragStartEvent extends PreventableEvent {
|
|
|
14
14
|
super();
|
|
15
15
|
Object.assign(this, args);
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
get normalizedEvent() {
|
|
22
|
+
return this.dragEvent;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Left for backward compatibility for the DragTarget deprecated events.
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
get hostElement() {
|
|
29
|
+
return this.dragTarget;
|
|
30
|
+
}
|
|
17
31
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Arguments for the drag events of the DropTarget and DropTargetContainer directives.
|
|
7
|
+
*/
|
|
8
|
+
export class DropTargetEvent {
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
constructor(args) {
|
|
13
|
+
Object.assign(this, args);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Left for backward compatibility for the DropTarget deprecated events.
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
get normalizedEvent() {
|
|
20
|
+
return this.dragEvent;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Left for backward compatibility for the DropTarget deprecated events.
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
get hostElement() {
|
|
27
|
+
return this.dropTarget;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export { DropTargetEvent } from './drop-target-event';
|
|
6
|
+
export * from './drag-target';
|
|
@@ -2,31 +2,28 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, ElementRef,
|
|
5
|
+
import { Component, ElementRef, Input, TemplateRef } from "@angular/core";
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
import * as i1 from "@angular/common";
|
|
8
|
-
const DEFAULT_ZINDEX = 10;
|
|
9
8
|
/**
|
|
10
9
|
* @hidden
|
|
11
10
|
*/
|
|
12
11
|
export class HintComponent {
|
|
13
12
|
constructor(element) {
|
|
14
13
|
this.element = element;
|
|
15
|
-
this.hostClasses = true;
|
|
16
|
-
this.zIndex = DEFAULT_ZINDEX;
|
|
17
|
-
this.touchAction = 'none';
|
|
18
14
|
}
|
|
19
15
|
}
|
|
20
16
|
HintComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HintComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
21
|
-
HintComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: HintComponent, selector: "
|
|
22
|
-
<ng-container *ngTemplateOutlet="template; context: { $implicit: directive }">
|
|
17
|
+
HintComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: HintComponent, selector: "kendo-draghint", inputs: { template: "template", directive: "directive", targetIndex: "targetIndex", contextData: "contextData" }, ngImport: i0, template: `
|
|
18
|
+
<ng-container *ngTemplateOutlet="template; context: { $implicit: directive, index: targetIndex, data: contextData }">
|
|
23
19
|
</ng-container>
|
|
24
20
|
`, isInline: true, directives: [{ type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
25
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HintComponent, decorators: [{
|
|
26
22
|
type: Component,
|
|
27
23
|
args: [{
|
|
24
|
+
selector: 'kendo-draghint',
|
|
28
25
|
template: `
|
|
29
|
-
<ng-container *ngTemplateOutlet="template; context: { $implicit: directive }">
|
|
26
|
+
<ng-container *ngTemplateOutlet="template; context: { $implicit: directive, index: targetIndex, data: contextData }">
|
|
30
27
|
</ng-container>
|
|
31
28
|
`
|
|
32
29
|
}]
|
|
@@ -34,16 +31,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
34
31
|
type: Input
|
|
35
32
|
}], directive: [{
|
|
36
33
|
type: Input
|
|
37
|
-
}],
|
|
38
|
-
type:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
type: HostBinding,
|
|
42
|
-
args: ['class.k-cursor-grab']
|
|
43
|
-
}], zIndex: [{
|
|
44
|
-
type: HostBinding,
|
|
45
|
-
args: ['style.zIndex']
|
|
46
|
-
}], touchAction: [{
|
|
47
|
-
type: HostBinding,
|
|
48
|
-
args: ['style.touch-action']
|
|
34
|
+
}], targetIndex: [{
|
|
35
|
+
type: Input
|
|
36
|
+
}], contextData: [{
|
|
37
|
+
type: Input
|
|
49
38
|
}] } });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export {};
|