@progress/kendo-angular-utils 13.0.0-develop.2 → 13.0.0-develop.21
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/draghandle.directive.d.ts +1 -1
- package/drag-and-drop/dragtarget-container.directive.d.ts +10 -10
- package/drag-and-drop/dragtarget.directive.d.ts +7 -7
- package/drag-and-drop/droptarget-container.directive.d.ts +5 -5
- package/drag-and-drop/droptarget.directive.d.ts +6 -6
- package/drag-and-drop/models/functions.d.ts +32 -2
- package/esm2020/drag-and-drop/draghandle.directive.mjs +4 -4
- package/esm2020/drag-and-drop/dragtarget-container.directive.mjs +41 -36
- package/esm2020/drag-and-drop/dragtarget.directive.mjs +32 -30
- package/esm2020/drag-and-drop/droptarget-container.directive.mjs +14 -14
- package/esm2020/drag-and-drop/droptarget.directive.mjs +17 -23
- package/esm2020/package-metadata.mjs +2 -2
- package/fesm2015/progress-kendo-angular-utils.mjs +112 -111
- package/fesm2020/progress-kendo-angular-utils.mjs +110 -109
- package/package.json +3 -3
|
@@ -19,8 +19,8 @@ const packageMetadata = {
|
|
|
19
19
|
name: '@progress/kendo-angular-utils',
|
|
20
20
|
productName: 'Kendo UI for Angular',
|
|
21
21
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
22
|
-
publishDate:
|
|
23
|
-
version: '13.0.0-develop.
|
|
22
|
+
publishDate: 1685972670,
|
|
23
|
+
version: '13.0.0-develop.21',
|
|
24
24
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -31,20 +31,20 @@ const packageMetadata = {
|
|
|
31
31
|
class DragHandleDirective {
|
|
32
32
|
constructor(element) {
|
|
33
33
|
this.element = element;
|
|
34
|
-
this.
|
|
34
|
+
this.cursorStyle = 'move';
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
DragHandleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragHandleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
38
|
-
DragHandleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DragHandleDirective, selector: "[kendoDragHandle]", host: { properties: { "
|
|
38
|
+
DragHandleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DragHandleDirective, selector: "[kendoDragHandle]", host: { properties: { "style.cursor": "this.cursorStyle" } }, exportAs: ["kendoDragHandle"], ngImport: i0 });
|
|
39
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragHandleDirective, decorators: [{
|
|
40
40
|
type: Directive,
|
|
41
41
|
args: [{
|
|
42
42
|
selector: '[kendoDragHandle]',
|
|
43
43
|
exportAs: 'kendoDragHandle'
|
|
44
44
|
}]
|
|
45
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: {
|
|
45
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { cursorStyle: [{
|
|
46
46
|
type: HostBinding,
|
|
47
|
-
args: ['
|
|
47
|
+
args: ['style.cursor']
|
|
48
48
|
}] } });
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -489,27 +489,27 @@ class DragTargetDirective {
|
|
|
489
489
|
/**
|
|
490
490
|
* Fires when the user presses the DragTarget element.
|
|
491
491
|
*/
|
|
492
|
-
this.
|
|
492
|
+
this.onPress = new EventEmitter();
|
|
493
493
|
/**
|
|
494
494
|
* Fires when the dragging of the DragTarget element begins.
|
|
495
495
|
*/
|
|
496
|
-
this.
|
|
496
|
+
this.onDragStart = new EventEmitter();
|
|
497
497
|
/**
|
|
498
498
|
* Fires while the user drags the DragTarget element.
|
|
499
499
|
*/
|
|
500
|
-
this.
|
|
500
|
+
this.onDrag = new EventEmitter();
|
|
501
501
|
/**
|
|
502
502
|
* Fires when the DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
503
503
|
*/
|
|
504
|
-
this.
|
|
504
|
+
this.onDragReady = new EventEmitter();
|
|
505
505
|
/**
|
|
506
506
|
* Fires when the user releases the DragTarget element after being pressed.
|
|
507
507
|
*/
|
|
508
|
-
this.
|
|
508
|
+
this.onRelease = new EventEmitter();
|
|
509
509
|
/**
|
|
510
510
|
* Fires when the dragging of the DragTarget ends and the element is released.
|
|
511
511
|
*/
|
|
512
|
-
this.
|
|
512
|
+
this.onDragEnd = new EventEmitter();
|
|
513
513
|
this.dragTarget = null;
|
|
514
514
|
this.domSubscriptions = [];
|
|
515
515
|
this.hintComponent = null;
|
|
@@ -576,7 +576,7 @@ class DragTargetDirective {
|
|
|
576
576
|
if (isPresent(this.element) || isPresent(this.dragTarget)) {
|
|
577
577
|
this.attachDomHandlers();
|
|
578
578
|
if (!this.dragHandles.length) {
|
|
579
|
-
this.renderer.
|
|
579
|
+
this.renderer.setStyle(this.nativeElement, 'cursor', 'move');
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
this.service.dragTargets.push(this.dragTarget);
|
|
@@ -588,14 +588,14 @@ class DragTargetDirective {
|
|
|
588
588
|
if (this.dragDelay > 0) {
|
|
589
589
|
this.dragTimeout = window.setTimeout(() => {
|
|
590
590
|
this.pressed = true;
|
|
591
|
-
this.emitZoneAwareEvent('
|
|
591
|
+
this.emitZoneAwareEvent('onDragReady', event);
|
|
592
592
|
}, this.dragDelay);
|
|
593
593
|
}
|
|
594
594
|
else {
|
|
595
595
|
this.pressed = true;
|
|
596
596
|
}
|
|
597
597
|
this.scrollableParent = this.dragTarget.element ? getScrollableParent(this.dragTarget.element) : null;
|
|
598
|
-
this.emitZoneAwareEvent('
|
|
598
|
+
this.emitZoneAwareEvent('onPress', event);
|
|
599
599
|
}
|
|
600
600
|
handleDragStart(event) {
|
|
601
601
|
if (!this.pressed) {
|
|
@@ -605,7 +605,7 @@ class DragTargetDirective {
|
|
|
605
605
|
}
|
|
606
606
|
return;
|
|
607
607
|
}
|
|
608
|
-
isDragStartPrevented$1 = this.emitZoneAwareEvent('
|
|
608
|
+
isDragStartPrevented$1 = this.emitZoneAwareEvent('onDragStart', event).isDefaultPrevented();
|
|
609
609
|
if (isDragStartPrevented$1) {
|
|
610
610
|
return;
|
|
611
611
|
}
|
|
@@ -622,13 +622,13 @@ class DragTargetDirective {
|
|
|
622
622
|
this.dragStarted = this.threshold === 0;
|
|
623
623
|
this.service.dragTarget = this.dragTarget;
|
|
624
624
|
this.service.dragTargetDirective = this;
|
|
625
|
-
this.service.dragData = this.dragData(this.dragTarget.element, this.dragTargetIdResult);
|
|
625
|
+
this.service.dragData = this.dragData({ dragTarget: this.dragTarget.element, dragTargetId: this.dragTargetIdResult, dragTargetIndex: null });
|
|
626
626
|
}
|
|
627
627
|
handleDrag(event) {
|
|
628
628
|
if (!this.pressed || isDragStartPrevented$1) {
|
|
629
629
|
return;
|
|
630
630
|
}
|
|
631
|
-
isDragPrevented$1 = this.emitZoneAwareEvent('
|
|
631
|
+
isDragPrevented$1 = this.emitZoneAwareEvent('onDrag', event).isDefaultPrevented();
|
|
632
632
|
if (isDragPrevented$1) {
|
|
633
633
|
return;
|
|
634
634
|
}
|
|
@@ -645,7 +645,7 @@ class DragTargetDirective {
|
|
|
645
645
|
this.dragTimeout = null;
|
|
646
646
|
this.pressed = false;
|
|
647
647
|
}
|
|
648
|
-
this.emitZoneAwareEvent('
|
|
648
|
+
this.emitZoneAwareEvent('onRelease', event);
|
|
649
649
|
}
|
|
650
650
|
handleDragEnd(event) {
|
|
651
651
|
if (this.mode === 'auto') {
|
|
@@ -670,7 +670,7 @@ class DragTargetDirective {
|
|
|
670
670
|
if (!this.dragStarted || isDragStartPrevented$1 || isDragPrevented$1) {
|
|
671
671
|
return;
|
|
672
672
|
}
|
|
673
|
-
this.emitZoneAwareEvent('
|
|
673
|
+
this.emitZoneAwareEvent('onDragEnd', event);
|
|
674
674
|
this.dragStarted = false;
|
|
675
675
|
}
|
|
676
676
|
initializeDragTarget() {
|
|
@@ -806,22 +806,22 @@ class DragTargetDirective {
|
|
|
806
806
|
}
|
|
807
807
|
let eventArgs;
|
|
808
808
|
switch (event) {
|
|
809
|
-
case '
|
|
809
|
+
case 'onDragReady':
|
|
810
810
|
eventArgs = new DragTargetDragReadyEvent(eventProps);
|
|
811
811
|
break;
|
|
812
|
-
case '
|
|
812
|
+
case 'onPress':
|
|
813
813
|
eventArgs = new DragTargetPressEvent(eventProps);
|
|
814
814
|
break;
|
|
815
|
-
case '
|
|
815
|
+
case 'onDragStart':
|
|
816
816
|
eventArgs = new DragTargetDragStartEvent(eventProps);
|
|
817
817
|
break;
|
|
818
|
-
case '
|
|
818
|
+
case 'onDrag':
|
|
819
819
|
eventArgs = new DragTargetDragEvent(eventProps);
|
|
820
820
|
break;
|
|
821
|
-
case '
|
|
821
|
+
case 'onRelease':
|
|
822
822
|
eventArgs = new DragTargetReleaseEvent(eventProps);
|
|
823
823
|
break;
|
|
824
|
-
case '
|
|
824
|
+
case 'onDragEnd':
|
|
825
825
|
eventArgs = new DragTargetDragEndEvent(eventProps);
|
|
826
826
|
break;
|
|
827
827
|
default:
|
|
@@ -834,7 +834,7 @@ class DragTargetDirective {
|
|
|
834
834
|
}
|
|
835
835
|
get dragTargetIdResult() {
|
|
836
836
|
if (this.dragTargetId && this.dragTargetId !== '') {
|
|
837
|
-
return typeof this.dragTargetId === 'string' ? this.dragTargetId : this.dragTargetId(this.dragTarget.element);
|
|
837
|
+
return typeof this.dragTargetId === 'string' ? this.dragTargetId : this.dragTargetId({ dragTarget: this.dragTarget.element, dragTargetIndex: null });
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
840
|
performDrag(event) {
|
|
@@ -847,8 +847,10 @@ class DragTargetDirective {
|
|
|
847
847
|
if (!this.dragStarted && this.threshold > 0) {
|
|
848
848
|
this.dragStarted = true;
|
|
849
849
|
}
|
|
850
|
-
|
|
851
|
-
|
|
850
|
+
if (elem) {
|
|
851
|
+
const styles = this.getStylesPerElement(elem);
|
|
852
|
+
setElementStyles(this.renderer, elem, styles);
|
|
853
|
+
}
|
|
852
854
|
}
|
|
853
855
|
calculatePosition(element, event) {
|
|
854
856
|
let position = null;
|
|
@@ -887,7 +889,7 @@ class DragTargetDirective {
|
|
|
887
889
|
}
|
|
888
890
|
}
|
|
889
891
|
DragTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragTargetDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: DragStateService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
890
|
-
DragTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DragTargetDirective, selector: "[kendoDragTarget]", inputs: { hint: "hint", threshold: "threshold", autoScroll: "autoScroll", dragTargetId: "dragTargetId", dragDelay: "dragDelay", restrictByAxis: "restrictByAxis", mode: "mode", dragData: "dragData" }, outputs: {
|
|
892
|
+
DragTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DragTargetDirective, selector: "[kendoDragTarget]", inputs: { hint: "hint", threshold: "threshold", autoScroll: "autoScroll", dragTargetId: "dragTargetId", dragDelay: "dragDelay", restrictByAxis: "restrictByAxis", mode: "mode", dragData: "dragData" }, outputs: { onPress: "onPress", onDragStart: "onDragStart", onDrag: "onDrag", onDragReady: "onDragReady", onRelease: "onRelease", onDragEnd: "onDragEnd" }, queries: [{ propertyName: "dragHandles", predicate: DragHandleDirective }], exportAs: ["kendoDragTarget"], ngImport: i0 });
|
|
891
893
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragTargetDirective, decorators: [{
|
|
892
894
|
type: Directive,
|
|
893
895
|
args: [{
|
|
@@ -910,17 +912,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
910
912
|
type: Input
|
|
911
913
|
}], dragData: [{
|
|
912
914
|
type: Input
|
|
913
|
-
}],
|
|
915
|
+
}], onPress: [{
|
|
914
916
|
type: Output
|
|
915
|
-
}],
|
|
917
|
+
}], onDragStart: [{
|
|
916
918
|
type: Output
|
|
917
|
-
}],
|
|
919
|
+
}], onDrag: [{
|
|
918
920
|
type: Output
|
|
919
|
-
}],
|
|
921
|
+
}], onDragReady: [{
|
|
920
922
|
type: Output
|
|
921
|
-
}],
|
|
923
|
+
}], onRelease: [{
|
|
922
924
|
type: Output
|
|
923
|
-
}],
|
|
925
|
+
}], onDragEnd: [{
|
|
924
926
|
type: Output
|
|
925
927
|
}], dragHandles: [{
|
|
926
928
|
type: ContentChildren,
|
|
@@ -964,19 +966,19 @@ class DropTargetDirective {
|
|
|
964
966
|
/**
|
|
965
967
|
* Fires when a DragTarget element enters the DropTarget.
|
|
966
968
|
*/
|
|
967
|
-
this.
|
|
969
|
+
this.onDragEnter = new EventEmitter();
|
|
968
970
|
/**
|
|
969
971
|
* Fires when a DragTarget element is being dragged over the DropTarget.
|
|
970
972
|
*/
|
|
971
|
-
this.
|
|
973
|
+
this.onDragOver = new EventEmitter();
|
|
972
974
|
/**
|
|
973
975
|
* Fires when a DragTarget element leaves the DropTarget.
|
|
974
976
|
*/
|
|
975
|
-
this.
|
|
977
|
+
this.onDragLeave = new EventEmitter();
|
|
976
978
|
/**
|
|
977
979
|
* Fires when a DragTarget element is dropped over the DropTarget.
|
|
978
980
|
*/
|
|
979
|
-
this.
|
|
981
|
+
this.onDrop = new EventEmitter();
|
|
980
982
|
validatePackage(packageMetadata);
|
|
981
983
|
}
|
|
982
984
|
ngOnInit() {
|
|
@@ -991,9 +993,7 @@ class DropTargetDirective {
|
|
|
991
993
|
return;
|
|
992
994
|
}
|
|
993
995
|
this.service.dropTarget = this.dropTarget;
|
|
994
|
-
this.
|
|
995
|
-
this.emitEvent('dragEnter', event);
|
|
996
|
-
});
|
|
996
|
+
this.emitZoneAwareEvent('onDragEnter', event);
|
|
997
997
|
}
|
|
998
998
|
/**
|
|
999
999
|
* @hidden
|
|
@@ -1003,9 +1003,7 @@ class DropTargetDirective {
|
|
|
1003
1003
|
if (!this.service.dragTarget) {
|
|
1004
1004
|
return;
|
|
1005
1005
|
}
|
|
1006
|
-
this.
|
|
1007
|
-
this.emitEvent('dragLeave', event);
|
|
1008
|
-
});
|
|
1006
|
+
this.emitZoneAwareEvent('onDragLeave', event);
|
|
1009
1007
|
}
|
|
1010
1008
|
/**
|
|
1011
1009
|
* @hidden
|
|
@@ -1014,17 +1012,13 @@ class DropTargetDirective {
|
|
|
1014
1012
|
if (!this.service.dragTarget) {
|
|
1015
1013
|
return;
|
|
1016
1014
|
}
|
|
1017
|
-
this.
|
|
1018
|
-
this.emitEvent('dragOver', event);
|
|
1019
|
-
});
|
|
1015
|
+
this.emitZoneAwareEvent('onDragOver', event);
|
|
1020
1016
|
}
|
|
1021
1017
|
/**
|
|
1022
1018
|
* @hidden
|
|
1023
1019
|
*/
|
|
1024
1020
|
handleDrop(event) {
|
|
1025
|
-
this.
|
|
1026
|
-
this.emitEvent('drop', event);
|
|
1027
|
-
});
|
|
1021
|
+
this.emitZoneAwareEvent('onDrop', event);
|
|
1028
1022
|
}
|
|
1029
1023
|
initializeDropTarget() {
|
|
1030
1024
|
this.dropTarget = {
|
|
@@ -1035,7 +1029,7 @@ class DropTargetDirective {
|
|
|
1035
1029
|
onDrop: this.handleDrop.bind(this)
|
|
1036
1030
|
};
|
|
1037
1031
|
}
|
|
1038
|
-
|
|
1032
|
+
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1039
1033
|
const eventProps = {
|
|
1040
1034
|
dropTarget: this.element.nativeElement,
|
|
1041
1035
|
dragTarget: this.service.dragTarget?.element,
|
|
@@ -1046,24 +1040,26 @@ class DropTargetDirective {
|
|
|
1046
1040
|
eventProps.hintElement = this.service.dragTarget.element;
|
|
1047
1041
|
}
|
|
1048
1042
|
const eventArgs = new DropTargetEvent(eventProps);
|
|
1049
|
-
this
|
|
1043
|
+
this.ngZone.run(() => {
|
|
1044
|
+
this[event].emit(eventArgs);
|
|
1045
|
+
});
|
|
1050
1046
|
}
|
|
1051
1047
|
}
|
|
1052
1048
|
DropTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetDirective, deps: [{ token: DragStateService }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1053
|
-
DropTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetDirective, selector: "[kendoDropTarget]", outputs: {
|
|
1049
|
+
DropTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetDirective, selector: "[kendoDropTarget]", outputs: { onDragEnter: "onDragEnter", onDragOver: "onDragOver", onDragLeave: "onDragLeave", onDrop: "onDrop" }, exportAs: ["kendoDropTarget"], ngImport: i0 });
|
|
1054
1050
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetDirective, decorators: [{
|
|
1055
1051
|
type: Directive,
|
|
1056
1052
|
args: [{
|
|
1057
1053
|
selector: '[kendoDropTarget]',
|
|
1058
1054
|
exportAs: 'kendoDropTarget'
|
|
1059
1055
|
}]
|
|
1060
|
-
}], ctorParameters: function () { return [{ type: DragStateService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: {
|
|
1056
|
+
}], ctorParameters: function () { return [{ type: DragStateService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { onDragEnter: [{
|
|
1061
1057
|
type: Output
|
|
1062
|
-
}],
|
|
1058
|
+
}], onDragOver: [{
|
|
1063
1059
|
type: Output
|
|
1064
|
-
}],
|
|
1060
|
+
}], onDragLeave: [{
|
|
1065
1061
|
type: Output
|
|
1066
|
-
}],
|
|
1062
|
+
}], onDrop: [{
|
|
1067
1063
|
type: Output
|
|
1068
1064
|
}] } });
|
|
1069
1065
|
|
|
@@ -1089,13 +1085,13 @@ class DragTargetContainerDirective {
|
|
|
1089
1085
|
this.viewContainer = viewContainer;
|
|
1090
1086
|
this.cdr = cdr;
|
|
1091
1087
|
/**
|
|
1092
|
-
* Defines whether a hint will be used for dragging. By default, the hint is a copy of the current drag target. ([see example]({% slug
|
|
1088
|
+
* Defines whether a hint will be used for dragging. By default, the hint is a copy of the current drag target. ([see example]({% slug drag_hint %})).
|
|
1093
1089
|
*
|
|
1094
1090
|
* @default false
|
|
1095
1091
|
*/
|
|
1096
1092
|
this.hint = false;
|
|
1097
1093
|
/**
|
|
1098
|
-
* Defines the delay in milliseconds after which the drag will begin ([see example](
|
|
1094
|
+
* Defines the delay in milliseconds after which the drag will begin ([see example](slug drag_target_container#toc-events)).
|
|
1099
1095
|
*
|
|
1100
1096
|
* @default 0
|
|
1101
1097
|
*/
|
|
@@ -1115,27 +1111,27 @@ class DragTargetContainerDirective {
|
|
|
1115
1111
|
/**
|
|
1116
1112
|
* Fires when a DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
1117
1113
|
*/
|
|
1118
|
-
this.
|
|
1114
|
+
this.onDragReady = new EventEmitter();
|
|
1119
1115
|
/**
|
|
1120
1116
|
* Fires when the user presses a DragTarget element.
|
|
1121
1117
|
*/
|
|
1122
|
-
this.
|
|
1118
|
+
this.onPress = new EventEmitter();
|
|
1123
1119
|
/**
|
|
1124
1120
|
* Fires when the dragging of a DragTarget element begins.
|
|
1125
1121
|
*/
|
|
1126
|
-
this.
|
|
1122
|
+
this.onDragStart = new EventEmitter();
|
|
1127
1123
|
/**
|
|
1128
1124
|
* Fires while the user drags a DragTarget element.
|
|
1129
1125
|
*/
|
|
1130
|
-
this.
|
|
1126
|
+
this.onDrag = new EventEmitter();
|
|
1131
1127
|
/**
|
|
1132
1128
|
* Fires when the user releases a DragTarget element after being pressed.
|
|
1133
1129
|
*/
|
|
1134
|
-
this.
|
|
1130
|
+
this.onRelease = new EventEmitter();
|
|
1135
1131
|
/**
|
|
1136
1132
|
* Fires when the dragging of a DragTarget ends and the element is released.
|
|
1137
1133
|
*/
|
|
1138
|
-
this.
|
|
1134
|
+
this.onDragEnd = new EventEmitter();
|
|
1139
1135
|
this.currentDragTarget = null;
|
|
1140
1136
|
this.dragTimeout = null;
|
|
1141
1137
|
this.pressed = false;
|
|
@@ -1266,7 +1262,7 @@ class DragTargetContainerDirective {
|
|
|
1266
1262
|
if (this.dragDelay > 0) {
|
|
1267
1263
|
this.dragTimeout = window.setTimeout(() => {
|
|
1268
1264
|
this.pressed = true;
|
|
1269
|
-
this.emitZoneAwareEvent('
|
|
1265
|
+
this.emitZoneAwareEvent('onDragReady', event);
|
|
1270
1266
|
}, this.dragDelay);
|
|
1271
1267
|
}
|
|
1272
1268
|
else {
|
|
@@ -1277,7 +1273,7 @@ class DragTargetContainerDirective {
|
|
|
1277
1273
|
this.currentDragTarget.element = this.currentDragTargetElement;
|
|
1278
1274
|
this.service.dragIndex = this.getDragIndex();
|
|
1279
1275
|
this.scrollableParent = this.hintTemplate ? document.body : this.currentDragTargetElement ? getScrollableParent(this.currentDragTargetElement) : null;
|
|
1280
|
-
this.emitZoneAwareEvent('
|
|
1276
|
+
this.emitZoneAwareEvent('onPress', event);
|
|
1281
1277
|
}
|
|
1282
1278
|
handleDragStart(event) {
|
|
1283
1279
|
if (!this.pressed) {
|
|
@@ -1287,7 +1283,7 @@ class DragTargetContainerDirective {
|
|
|
1287
1283
|
}
|
|
1288
1284
|
return;
|
|
1289
1285
|
}
|
|
1290
|
-
isDragStartPrevented = this.emitZoneAwareEvent('
|
|
1286
|
+
isDragStartPrevented = this.emitZoneAwareEvent('onDragStart', event).isDefaultPrevented();
|
|
1291
1287
|
if (isDragStartPrevented) {
|
|
1292
1288
|
return;
|
|
1293
1289
|
}
|
|
@@ -1303,14 +1299,16 @@ class DragTargetContainerDirective {
|
|
|
1303
1299
|
}
|
|
1304
1300
|
this.dragStarted = this.threshold === 0;
|
|
1305
1301
|
this.service.dragTarget = this.currentDragTarget;
|
|
1306
|
-
|
|
1307
|
-
this.service.
|
|
1302
|
+
const targetIdArgs = { dragTarget: this.currentDragTargetElement, dragTargetIndex: this.service.dragIndex };
|
|
1303
|
+
this.service.dragTargetId = this.dragTargetId(targetIdArgs);
|
|
1304
|
+
const targetDataArgs = Object.assign({ dragTargetId: this.service.dragTargetId }, targetIdArgs);
|
|
1305
|
+
this.service.dragData = this.dragData(targetDataArgs);
|
|
1308
1306
|
}
|
|
1309
1307
|
handleDrag(event) {
|
|
1310
1308
|
if (!this.pressed || isDragStartPrevented) {
|
|
1311
1309
|
return;
|
|
1312
1310
|
}
|
|
1313
|
-
isDragPrevented = this.emitZoneAwareEvent('
|
|
1311
|
+
isDragPrevented = this.emitZoneAwareEvent('onDrag', event).isDefaultPrevented();
|
|
1314
1312
|
if (isDragPrevented) {
|
|
1315
1313
|
return;
|
|
1316
1314
|
}
|
|
@@ -1320,7 +1318,6 @@ class DragTargetContainerDirective {
|
|
|
1320
1318
|
else {
|
|
1321
1319
|
this.dragStarted = true;
|
|
1322
1320
|
}
|
|
1323
|
-
this.dragStarted && this.emitZoneAwareEvent('drag', event);
|
|
1324
1321
|
}
|
|
1325
1322
|
handleRelease(event) {
|
|
1326
1323
|
if (this.dragStarted) {
|
|
@@ -1331,7 +1328,7 @@ class DragTargetContainerDirective {
|
|
|
1331
1328
|
this.dragTimeout = null;
|
|
1332
1329
|
this.pressed = false;
|
|
1333
1330
|
}
|
|
1334
|
-
this.emitZoneAwareEvent('
|
|
1331
|
+
this.emitZoneAwareEvent('onRelease', event);
|
|
1335
1332
|
}
|
|
1336
1333
|
handleDragEnd(event) {
|
|
1337
1334
|
if (!this.dragStarted) {
|
|
@@ -1357,7 +1354,7 @@ class DragTargetContainerDirective {
|
|
|
1357
1354
|
this.service.dragTarget = null;
|
|
1358
1355
|
this.service.dragIndex = null;
|
|
1359
1356
|
this.currentDragTarget.element = null;
|
|
1360
|
-
this.emitZoneAwareEvent('
|
|
1357
|
+
this.emitZoneAwareEvent('onDragEnd', event);
|
|
1361
1358
|
if (isDragStartPrevented || isDragPrevented) {
|
|
1362
1359
|
return;
|
|
1363
1360
|
}
|
|
@@ -1417,33 +1414,34 @@ class DragTargetContainerDirective {
|
|
|
1417
1414
|
});
|
|
1418
1415
|
}
|
|
1419
1416
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1417
|
+
const targetIdArgs = { dragTarget: this.currentDragTargetElement, dragTargetIndex: this.service.dragIndex };
|
|
1420
1418
|
const eventProps = {
|
|
1421
1419
|
dragTarget: this.currentDragTargetElement,
|
|
1422
1420
|
dragEvent: normalizedEvent,
|
|
1423
1421
|
dragTargetIndex: this.service.dragIndex,
|
|
1424
|
-
dragTargetId: this.dragTargetId(
|
|
1422
|
+
dragTargetId: this.dragTargetId(targetIdArgs)
|
|
1425
1423
|
};
|
|
1426
1424
|
if (this.hint && isPresent(this.hintElem)) {
|
|
1427
1425
|
eventProps.hintElement = this.hintElem;
|
|
1428
1426
|
}
|
|
1429
1427
|
let eventArgs;
|
|
1430
1428
|
switch (event) {
|
|
1431
|
-
case '
|
|
1429
|
+
case 'onDragReady':
|
|
1432
1430
|
eventArgs = new DragTargetDragReadyEvent(eventProps);
|
|
1433
1431
|
break;
|
|
1434
|
-
case '
|
|
1432
|
+
case 'onPress':
|
|
1435
1433
|
eventArgs = new DragTargetPressEvent(eventProps);
|
|
1436
1434
|
break;
|
|
1437
|
-
case '
|
|
1435
|
+
case 'onDragStart':
|
|
1438
1436
|
eventArgs = new DragTargetDragStartEvent(eventProps);
|
|
1439
1437
|
break;
|
|
1440
|
-
case '
|
|
1438
|
+
case 'onDrag':
|
|
1441
1439
|
eventArgs = new DragTargetDragEvent(eventProps);
|
|
1442
1440
|
break;
|
|
1443
|
-
case '
|
|
1441
|
+
case 'onRelease':
|
|
1444
1442
|
eventArgs = new DragTargetReleaseEvent(eventProps);
|
|
1445
1443
|
break;
|
|
1446
|
-
case '
|
|
1444
|
+
case 'onDragEnd':
|
|
1447
1445
|
eventArgs = new DragTargetDragEndEvent(eventProps);
|
|
1448
1446
|
break;
|
|
1449
1447
|
default:
|
|
@@ -1496,7 +1494,8 @@ class DragTargetContainerDirective {
|
|
|
1496
1494
|
this.hintComponent.instance.template = this.hintTemplate;
|
|
1497
1495
|
this.hintComponent.instance.directive = this;
|
|
1498
1496
|
this.hintComponent.instance.targetIndex = this.service.dragIndex;
|
|
1499
|
-
|
|
1497
|
+
const targetDataArgs = { dragTarget: this.currentDragTargetElement, dragTargetId: this.service.dragTargetId, dragTargetIndex: this.service.dragIndex };
|
|
1498
|
+
this.hintComponent.instance.contextData = this.dragData(targetDataArgs);
|
|
1500
1499
|
this.hintComponent.changeDetectorRef.detectChanges();
|
|
1501
1500
|
}
|
|
1502
1501
|
destroyHint() {
|
|
@@ -1568,12 +1567,12 @@ class DragTargetContainerDirective {
|
|
|
1568
1567
|
}
|
|
1569
1568
|
if (isPresent(this.dragHandles) && this.dragHandles.length > 0) {
|
|
1570
1569
|
this.dragHandles.forEach(handle => {
|
|
1571
|
-
this.renderer.
|
|
1570
|
+
this.renderer.setStyle(handle, 'cursor', 'move');
|
|
1572
1571
|
});
|
|
1573
1572
|
}
|
|
1574
1573
|
else {
|
|
1575
1574
|
this.allDragTargets.forEach(target => {
|
|
1576
|
-
this.renderer.
|
|
1575
|
+
this.renderer.setStyle(target, 'cursor', 'move');
|
|
1577
1576
|
});
|
|
1578
1577
|
}
|
|
1579
1578
|
}
|
|
@@ -1601,8 +1600,10 @@ class DragTargetContainerDirective {
|
|
|
1601
1600
|
if (!this.dragStarted && this.threshold > 0) {
|
|
1602
1601
|
this.dragStarted = true;
|
|
1603
1602
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1603
|
+
if (elem) {
|
|
1604
|
+
const styles = this.getStylesPerElement(elem);
|
|
1605
|
+
setElementStyles(this.renderer, elem, styles);
|
|
1606
|
+
}
|
|
1606
1607
|
}
|
|
1607
1608
|
calculatePosition(element, event) {
|
|
1608
1609
|
let position = null;
|
|
@@ -1635,7 +1636,7 @@ class DragTargetContainerDirective {
|
|
|
1635
1636
|
}
|
|
1636
1637
|
}
|
|
1637
1638
|
DragTargetContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragTargetContainerDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: DragStateService }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1638
|
-
DragTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DragTargetContainerDirective, selector: "[kendoDragTargetContainer]", inputs: { hint: "hint", dragTargetFilter: "dragTargetFilter", dragHandle: "dragHandle", dragDelay: "dragDelay", threshold: "threshold", dragTargetId: "dragTargetId", dragData: "dragData", dragDisabled: "dragDisabled", mode: "mode" }, outputs: {
|
|
1639
|
+
DragTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DragTargetContainerDirective, selector: "[kendoDragTargetContainer]", inputs: { hint: "hint", dragTargetFilter: "dragTargetFilter", dragHandle: "dragHandle", dragDelay: "dragDelay", threshold: "threshold", dragTargetId: "dragTargetId", dragData: "dragData", dragDisabled: "dragDisabled", mode: "mode" }, outputs: { onDragReady: "onDragReady", onPress: "onPress", onDragStart: "onDragStart", onDrag: "onDrag", onRelease: "onRelease", onDragEnd: "onDragEnd" }, exportAs: ["kendoDragTargetContainer"], ngImport: i0 });
|
|
1639
1640
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragTargetContainerDirective, decorators: [{
|
|
1640
1641
|
type: Directive,
|
|
1641
1642
|
args: [{
|
|
@@ -1660,17 +1661,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1660
1661
|
type: Input
|
|
1661
1662
|
}], mode: [{
|
|
1662
1663
|
type: Input
|
|
1663
|
-
}],
|
|
1664
|
+
}], onDragReady: [{
|
|
1664
1665
|
type: Output
|
|
1665
|
-
}],
|
|
1666
|
+
}], onPress: [{
|
|
1666
1667
|
type: Output
|
|
1667
|
-
}],
|
|
1668
|
+
}], onDragStart: [{
|
|
1668
1669
|
type: Output
|
|
1669
|
-
}],
|
|
1670
|
+
}], onDrag: [{
|
|
1670
1671
|
type: Output
|
|
1671
|
-
}],
|
|
1672
|
+
}], onRelease: [{
|
|
1672
1673
|
type: Output
|
|
1673
|
-
}],
|
|
1674
|
+
}], onDragEnd: [{
|
|
1674
1675
|
type: Output
|
|
1675
1676
|
}] } });
|
|
1676
1677
|
|
|
@@ -1694,19 +1695,19 @@ class DropTargetContainerDirective {
|
|
|
1694
1695
|
/**
|
|
1695
1696
|
* Fires when a DragTarget element enters the DropTarget.
|
|
1696
1697
|
*/
|
|
1697
|
-
this.
|
|
1698
|
+
this.onDragEnter = new EventEmitter();
|
|
1698
1699
|
/**
|
|
1699
1700
|
* Fires when a DragTarget element is being dragged over the DropTarget.
|
|
1700
1701
|
*/
|
|
1701
|
-
this.
|
|
1702
|
+
this.onDragOver = new EventEmitter();
|
|
1702
1703
|
/**
|
|
1703
1704
|
* Fires when a DragTarget element leaves the DropTarget.
|
|
1704
1705
|
*/
|
|
1705
|
-
this.
|
|
1706
|
+
this.onDragLeave = new EventEmitter();
|
|
1706
1707
|
/**
|
|
1707
1708
|
* Fires when a DragTarget element is dropped over the DropTarget.
|
|
1708
1709
|
*/
|
|
1709
|
-
this.
|
|
1710
|
+
this.onDrop = new EventEmitter();
|
|
1710
1711
|
this.currentDropTarget = null;
|
|
1711
1712
|
this.currentDropTargetElement = null;
|
|
1712
1713
|
this.previousDropTargets = [];
|
|
@@ -1773,7 +1774,7 @@ class DropTargetContainerDirective {
|
|
|
1773
1774
|
this.currentDropTarget = this.service.dropTargets.find(dt => dt.element === this.currentDropTargetElement);
|
|
1774
1775
|
this.service.dropTarget = this.currentDropTarget;
|
|
1775
1776
|
this.service.dropIndex = this.getDropIndex();
|
|
1776
|
-
this.emitZoneAwareEvent('
|
|
1777
|
+
this.emitZoneAwareEvent('onDragEnter', event);
|
|
1777
1778
|
}
|
|
1778
1779
|
/**
|
|
1779
1780
|
* @hidden
|
|
@@ -1783,7 +1784,7 @@ class DropTargetContainerDirective {
|
|
|
1783
1784
|
if (!this.service.dragTarget) {
|
|
1784
1785
|
return;
|
|
1785
1786
|
}
|
|
1786
|
-
this.emitZoneAwareEvent('
|
|
1787
|
+
this.emitZoneAwareEvent('onDragLeave', event);
|
|
1787
1788
|
}
|
|
1788
1789
|
/**
|
|
1789
1790
|
* @hidden
|
|
@@ -1792,7 +1793,7 @@ class DropTargetContainerDirective {
|
|
|
1792
1793
|
if (!this.service.dragTarget) {
|
|
1793
1794
|
return;
|
|
1794
1795
|
}
|
|
1795
|
-
this.emitZoneAwareEvent('
|
|
1796
|
+
this.emitZoneAwareEvent('onDragOver', event);
|
|
1796
1797
|
}
|
|
1797
1798
|
/**
|
|
1798
1799
|
* @hidden
|
|
@@ -1801,7 +1802,7 @@ class DropTargetContainerDirective {
|
|
|
1801
1802
|
if (!this.service.dragTarget) {
|
|
1802
1803
|
return;
|
|
1803
1804
|
}
|
|
1804
|
-
this.emitZoneAwareEvent('
|
|
1805
|
+
this.emitZoneAwareEvent('onDrop', event);
|
|
1805
1806
|
this.currentDropTarget = null;
|
|
1806
1807
|
this.currentDropTargetElement = null;
|
|
1807
1808
|
this.service.dropIndex = null;
|
|
@@ -1838,7 +1839,7 @@ class DropTargetContainerDirective {
|
|
|
1838
1839
|
}
|
|
1839
1840
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1840
1841
|
const eventProps = {
|
|
1841
|
-
dragTarget: this.service.dragTarget,
|
|
1842
|
+
dragTarget: this.service.dragTarget?.element,
|
|
1842
1843
|
dropTarget: this.currentDropTargetElement,
|
|
1843
1844
|
dragData: this.service.dragData,
|
|
1844
1845
|
dragEvent: normalizedEvent,
|
|
@@ -1867,7 +1868,7 @@ class DropTargetContainerDirective {
|
|
|
1867
1868
|
}
|
|
1868
1869
|
}
|
|
1869
1870
|
DropTargetContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetContainerDirective, deps: [{ token: DragStateService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1870
|
-
DropTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetContainerDirective, selector: "[kendoDropTargetContainer]", inputs: { dropTargetFilter: "dropTargetFilter", dropDisabled: "dropDisabled" }, outputs: {
|
|
1871
|
+
DropTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetContainerDirective, selector: "[kendoDropTargetContainer]", inputs: { dropTargetFilter: "dropTargetFilter", dropDisabled: "dropDisabled" }, outputs: { onDragEnter: "onDragEnter", onDragOver: "onDragOver", onDragLeave: "onDragLeave", onDrop: "onDrop" }, exportAs: ["kendoDropTargetContainer"], ngImport: i0 });
|
|
1871
1872
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetContainerDirective, decorators: [{
|
|
1872
1873
|
type: Directive,
|
|
1873
1874
|
args: [{
|
|
@@ -1878,13 +1879,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1878
1879
|
type: Input
|
|
1879
1880
|
}], dropDisabled: [{
|
|
1880
1881
|
type: Input
|
|
1881
|
-
}],
|
|
1882
|
+
}], onDragEnter: [{
|
|
1882
1883
|
type: Output
|
|
1883
|
-
}],
|
|
1884
|
+
}], onDragOver: [{
|
|
1884
1885
|
type: Output
|
|
1885
|
-
}],
|
|
1886
|
+
}], onDragLeave: [{
|
|
1886
1887
|
type: Output
|
|
1887
|
-
}],
|
|
1888
|
+
}], onDrop: [{
|
|
1888
1889
|
type: Output
|
|
1889
1890
|
}] } });
|
|
1890
1891
|
|