@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
|
function isDocumentNode(container) {
|
|
@@ -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
|
var _a, _b;
|
|
@@ -671,7 +671,7 @@ class DragTargetDirective {
|
|
|
671
671
|
if (!this.dragStarted || isDragStartPrevented$1 || isDragPrevented$1) {
|
|
672
672
|
return;
|
|
673
673
|
}
|
|
674
|
-
this.emitZoneAwareEvent('
|
|
674
|
+
this.emitZoneAwareEvent('onDragEnd', event);
|
|
675
675
|
this.dragStarted = false;
|
|
676
676
|
}
|
|
677
677
|
initializeDragTarget() {
|
|
@@ -807,22 +807,22 @@ class DragTargetDirective {
|
|
|
807
807
|
}
|
|
808
808
|
let eventArgs;
|
|
809
809
|
switch (event) {
|
|
810
|
-
case '
|
|
810
|
+
case 'onDragReady':
|
|
811
811
|
eventArgs = new DragTargetDragReadyEvent(eventProps);
|
|
812
812
|
break;
|
|
813
|
-
case '
|
|
813
|
+
case 'onPress':
|
|
814
814
|
eventArgs = new DragTargetPressEvent(eventProps);
|
|
815
815
|
break;
|
|
816
|
-
case '
|
|
816
|
+
case 'onDragStart':
|
|
817
817
|
eventArgs = new DragTargetDragStartEvent(eventProps);
|
|
818
818
|
break;
|
|
819
|
-
case '
|
|
819
|
+
case 'onDrag':
|
|
820
820
|
eventArgs = new DragTargetDragEvent(eventProps);
|
|
821
821
|
break;
|
|
822
|
-
case '
|
|
822
|
+
case 'onRelease':
|
|
823
823
|
eventArgs = new DragTargetReleaseEvent(eventProps);
|
|
824
824
|
break;
|
|
825
|
-
case '
|
|
825
|
+
case 'onDragEnd':
|
|
826
826
|
eventArgs = new DragTargetDragEndEvent(eventProps);
|
|
827
827
|
break;
|
|
828
828
|
default:
|
|
@@ -835,7 +835,7 @@ class DragTargetDirective {
|
|
|
835
835
|
}
|
|
836
836
|
get dragTargetIdResult() {
|
|
837
837
|
if (this.dragTargetId && this.dragTargetId !== '') {
|
|
838
|
-
return typeof this.dragTargetId === 'string' ? this.dragTargetId : this.dragTargetId(this.dragTarget.element);
|
|
838
|
+
return typeof this.dragTargetId === 'string' ? this.dragTargetId : this.dragTargetId({ dragTarget: this.dragTarget.element, dragTargetIndex: null });
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
841
|
performDrag(event) {
|
|
@@ -848,8 +848,10 @@ class DragTargetDirective {
|
|
|
848
848
|
if (!this.dragStarted && this.threshold > 0) {
|
|
849
849
|
this.dragStarted = true;
|
|
850
850
|
}
|
|
851
|
-
|
|
852
|
-
|
|
851
|
+
if (elem) {
|
|
852
|
+
const styles = this.getStylesPerElement(elem);
|
|
853
|
+
setElementStyles(this.renderer, elem, styles);
|
|
854
|
+
}
|
|
853
855
|
}
|
|
854
856
|
calculatePosition(element, event) {
|
|
855
857
|
let position = null;
|
|
@@ -888,7 +890,7 @@ class DragTargetDirective {
|
|
|
888
890
|
}
|
|
889
891
|
}
|
|
890
892
|
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 });
|
|
891
|
-
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: {
|
|
893
|
+
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 });
|
|
892
894
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragTargetDirective, decorators: [{
|
|
893
895
|
type: Directive,
|
|
894
896
|
args: [{
|
|
@@ -911,17 +913,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
911
913
|
type: Input
|
|
912
914
|
}], dragData: [{
|
|
913
915
|
type: Input
|
|
914
|
-
}],
|
|
916
|
+
}], onPress: [{
|
|
915
917
|
type: Output
|
|
916
|
-
}],
|
|
918
|
+
}], onDragStart: [{
|
|
917
919
|
type: Output
|
|
918
|
-
}],
|
|
920
|
+
}], onDrag: [{
|
|
919
921
|
type: Output
|
|
920
|
-
}],
|
|
922
|
+
}], onDragReady: [{
|
|
921
923
|
type: Output
|
|
922
|
-
}],
|
|
924
|
+
}], onRelease: [{
|
|
923
925
|
type: Output
|
|
924
|
-
}],
|
|
926
|
+
}], onDragEnd: [{
|
|
925
927
|
type: Output
|
|
926
928
|
}], dragHandles: [{
|
|
927
929
|
type: ContentChildren,
|
|
@@ -965,19 +967,19 @@ class DropTargetDirective {
|
|
|
965
967
|
/**
|
|
966
968
|
* Fires when a DragTarget element enters the DropTarget.
|
|
967
969
|
*/
|
|
968
|
-
this.
|
|
970
|
+
this.onDragEnter = new EventEmitter();
|
|
969
971
|
/**
|
|
970
972
|
* Fires when a DragTarget element is being dragged over the DropTarget.
|
|
971
973
|
*/
|
|
972
|
-
this.
|
|
974
|
+
this.onDragOver = new EventEmitter();
|
|
973
975
|
/**
|
|
974
976
|
* Fires when a DragTarget element leaves the DropTarget.
|
|
975
977
|
*/
|
|
976
|
-
this.
|
|
978
|
+
this.onDragLeave = new EventEmitter();
|
|
977
979
|
/**
|
|
978
980
|
* Fires when a DragTarget element is dropped over the DropTarget.
|
|
979
981
|
*/
|
|
980
|
-
this.
|
|
982
|
+
this.onDrop = new EventEmitter();
|
|
981
983
|
validatePackage(packageMetadata);
|
|
982
984
|
}
|
|
983
985
|
ngOnInit() {
|
|
@@ -992,9 +994,7 @@ class DropTargetDirective {
|
|
|
992
994
|
return;
|
|
993
995
|
}
|
|
994
996
|
this.service.dropTarget = this.dropTarget;
|
|
995
|
-
this.
|
|
996
|
-
this.emitEvent('dragEnter', event);
|
|
997
|
-
});
|
|
997
|
+
this.emitZoneAwareEvent('onDragEnter', event);
|
|
998
998
|
}
|
|
999
999
|
/**
|
|
1000
1000
|
* @hidden
|
|
@@ -1004,9 +1004,7 @@ class DropTargetDirective {
|
|
|
1004
1004
|
if (!this.service.dragTarget) {
|
|
1005
1005
|
return;
|
|
1006
1006
|
}
|
|
1007
|
-
this.
|
|
1008
|
-
this.emitEvent('dragLeave', event);
|
|
1009
|
-
});
|
|
1007
|
+
this.emitZoneAwareEvent('onDragLeave', event);
|
|
1010
1008
|
}
|
|
1011
1009
|
/**
|
|
1012
1010
|
* @hidden
|
|
@@ -1015,17 +1013,13 @@ class DropTargetDirective {
|
|
|
1015
1013
|
if (!this.service.dragTarget) {
|
|
1016
1014
|
return;
|
|
1017
1015
|
}
|
|
1018
|
-
this.
|
|
1019
|
-
this.emitEvent('dragOver', event);
|
|
1020
|
-
});
|
|
1016
|
+
this.emitZoneAwareEvent('onDragOver', event);
|
|
1021
1017
|
}
|
|
1022
1018
|
/**
|
|
1023
1019
|
* @hidden
|
|
1024
1020
|
*/
|
|
1025
1021
|
handleDrop(event) {
|
|
1026
|
-
this.
|
|
1027
|
-
this.emitEvent('drop', event);
|
|
1028
|
-
});
|
|
1022
|
+
this.emitZoneAwareEvent('onDrop', event);
|
|
1029
1023
|
}
|
|
1030
1024
|
initializeDropTarget() {
|
|
1031
1025
|
this.dropTarget = {
|
|
@@ -1036,7 +1030,7 @@ class DropTargetDirective {
|
|
|
1036
1030
|
onDrop: this.handleDrop.bind(this)
|
|
1037
1031
|
};
|
|
1038
1032
|
}
|
|
1039
|
-
|
|
1033
|
+
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1040
1034
|
var _a, _b;
|
|
1041
1035
|
const eventProps = {
|
|
1042
1036
|
dropTarget: this.element.nativeElement,
|
|
@@ -1048,24 +1042,26 @@ class DropTargetDirective {
|
|
|
1048
1042
|
eventProps.hintElement = this.service.dragTarget.element;
|
|
1049
1043
|
}
|
|
1050
1044
|
const eventArgs = new DropTargetEvent(eventProps);
|
|
1051
|
-
this
|
|
1045
|
+
this.ngZone.run(() => {
|
|
1046
|
+
this[event].emit(eventArgs);
|
|
1047
|
+
});
|
|
1052
1048
|
}
|
|
1053
1049
|
}
|
|
1054
1050
|
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 });
|
|
1055
|
-
DropTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetDirective, selector: "[kendoDropTarget]", outputs: {
|
|
1051
|
+
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 });
|
|
1056
1052
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetDirective, decorators: [{
|
|
1057
1053
|
type: Directive,
|
|
1058
1054
|
args: [{
|
|
1059
1055
|
selector: '[kendoDropTarget]',
|
|
1060
1056
|
exportAs: 'kendoDropTarget'
|
|
1061
1057
|
}]
|
|
1062
|
-
}], ctorParameters: function () { return [{ type: DragStateService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: {
|
|
1058
|
+
}], ctorParameters: function () { return [{ type: DragStateService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { onDragEnter: [{
|
|
1063
1059
|
type: Output
|
|
1064
|
-
}],
|
|
1060
|
+
}], onDragOver: [{
|
|
1065
1061
|
type: Output
|
|
1066
|
-
}],
|
|
1062
|
+
}], onDragLeave: [{
|
|
1067
1063
|
type: Output
|
|
1068
|
-
}],
|
|
1064
|
+
}], onDrop: [{
|
|
1069
1065
|
type: Output
|
|
1070
1066
|
}] } });
|
|
1071
1067
|
|
|
@@ -1091,13 +1087,13 @@ class DragTargetContainerDirective {
|
|
|
1091
1087
|
this.viewContainer = viewContainer;
|
|
1092
1088
|
this.cdr = cdr;
|
|
1093
1089
|
/**
|
|
1094
|
-
* Defines whether a hint will be used for dragging. By default, the hint is a copy of the current drag target. ([see example]({% slug
|
|
1090
|
+
* 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 %})).
|
|
1095
1091
|
*
|
|
1096
1092
|
* @default false
|
|
1097
1093
|
*/
|
|
1098
1094
|
this.hint = false;
|
|
1099
1095
|
/**
|
|
1100
|
-
* Defines the delay in milliseconds after which the drag will begin ([see example](
|
|
1096
|
+
* Defines the delay in milliseconds after which the drag will begin ([see example](slug drag_target_container#toc-events)).
|
|
1101
1097
|
*
|
|
1102
1098
|
* @default 0
|
|
1103
1099
|
*/
|
|
@@ -1117,27 +1113,27 @@ class DragTargetContainerDirective {
|
|
|
1117
1113
|
/**
|
|
1118
1114
|
* Fires when a DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
1119
1115
|
*/
|
|
1120
|
-
this.
|
|
1116
|
+
this.onDragReady = new EventEmitter();
|
|
1121
1117
|
/**
|
|
1122
1118
|
* Fires when the user presses a DragTarget element.
|
|
1123
1119
|
*/
|
|
1124
|
-
this.
|
|
1120
|
+
this.onPress = new EventEmitter();
|
|
1125
1121
|
/**
|
|
1126
1122
|
* Fires when the dragging of a DragTarget element begins.
|
|
1127
1123
|
*/
|
|
1128
|
-
this.
|
|
1124
|
+
this.onDragStart = new EventEmitter();
|
|
1129
1125
|
/**
|
|
1130
1126
|
* Fires while the user drags a DragTarget element.
|
|
1131
1127
|
*/
|
|
1132
|
-
this.
|
|
1128
|
+
this.onDrag = new EventEmitter();
|
|
1133
1129
|
/**
|
|
1134
1130
|
* Fires when the user releases a DragTarget element after being pressed.
|
|
1135
1131
|
*/
|
|
1136
|
-
this.
|
|
1132
|
+
this.onRelease = new EventEmitter();
|
|
1137
1133
|
/**
|
|
1138
1134
|
* Fires when the dragging of a DragTarget ends and the element is released.
|
|
1139
1135
|
*/
|
|
1140
|
-
this.
|
|
1136
|
+
this.onDragEnd = new EventEmitter();
|
|
1141
1137
|
this.currentDragTarget = null;
|
|
1142
1138
|
this.dragTimeout = null;
|
|
1143
1139
|
this.pressed = false;
|
|
@@ -1268,7 +1264,7 @@ class DragTargetContainerDirective {
|
|
|
1268
1264
|
if (this.dragDelay > 0) {
|
|
1269
1265
|
this.dragTimeout = window.setTimeout(() => {
|
|
1270
1266
|
this.pressed = true;
|
|
1271
|
-
this.emitZoneAwareEvent('
|
|
1267
|
+
this.emitZoneAwareEvent('onDragReady', event);
|
|
1272
1268
|
}, this.dragDelay);
|
|
1273
1269
|
}
|
|
1274
1270
|
else {
|
|
@@ -1279,7 +1275,7 @@ class DragTargetContainerDirective {
|
|
|
1279
1275
|
this.currentDragTarget.element = this.currentDragTargetElement;
|
|
1280
1276
|
this.service.dragIndex = this.getDragIndex();
|
|
1281
1277
|
this.scrollableParent = this.hintTemplate ? document.body : this.currentDragTargetElement ? getScrollableParent(this.currentDragTargetElement) : null;
|
|
1282
|
-
this.emitZoneAwareEvent('
|
|
1278
|
+
this.emitZoneAwareEvent('onPress', event);
|
|
1283
1279
|
}
|
|
1284
1280
|
handleDragStart(event) {
|
|
1285
1281
|
if (!this.pressed) {
|
|
@@ -1289,7 +1285,7 @@ class DragTargetContainerDirective {
|
|
|
1289
1285
|
}
|
|
1290
1286
|
return;
|
|
1291
1287
|
}
|
|
1292
|
-
isDragStartPrevented = this.emitZoneAwareEvent('
|
|
1288
|
+
isDragStartPrevented = this.emitZoneAwareEvent('onDragStart', event).isDefaultPrevented();
|
|
1293
1289
|
if (isDragStartPrevented) {
|
|
1294
1290
|
return;
|
|
1295
1291
|
}
|
|
@@ -1305,14 +1301,16 @@ class DragTargetContainerDirective {
|
|
|
1305
1301
|
}
|
|
1306
1302
|
this.dragStarted = this.threshold === 0;
|
|
1307
1303
|
this.service.dragTarget = this.currentDragTarget;
|
|
1308
|
-
|
|
1309
|
-
this.service.
|
|
1304
|
+
const targetIdArgs = { dragTarget: this.currentDragTargetElement, dragTargetIndex: this.service.dragIndex };
|
|
1305
|
+
this.service.dragTargetId = this.dragTargetId(targetIdArgs);
|
|
1306
|
+
const targetDataArgs = Object.assign({ dragTargetId: this.service.dragTargetId }, targetIdArgs);
|
|
1307
|
+
this.service.dragData = this.dragData(targetDataArgs);
|
|
1310
1308
|
}
|
|
1311
1309
|
handleDrag(event) {
|
|
1312
1310
|
if (!this.pressed || isDragStartPrevented) {
|
|
1313
1311
|
return;
|
|
1314
1312
|
}
|
|
1315
|
-
isDragPrevented = this.emitZoneAwareEvent('
|
|
1313
|
+
isDragPrevented = this.emitZoneAwareEvent('onDrag', event).isDefaultPrevented();
|
|
1316
1314
|
if (isDragPrevented) {
|
|
1317
1315
|
return;
|
|
1318
1316
|
}
|
|
@@ -1322,7 +1320,6 @@ class DragTargetContainerDirective {
|
|
|
1322
1320
|
else {
|
|
1323
1321
|
this.dragStarted = true;
|
|
1324
1322
|
}
|
|
1325
|
-
this.dragStarted && this.emitZoneAwareEvent('drag', event);
|
|
1326
1323
|
}
|
|
1327
1324
|
handleRelease(event) {
|
|
1328
1325
|
if (this.dragStarted) {
|
|
@@ -1333,7 +1330,7 @@ class DragTargetContainerDirective {
|
|
|
1333
1330
|
this.dragTimeout = null;
|
|
1334
1331
|
this.pressed = false;
|
|
1335
1332
|
}
|
|
1336
|
-
this.emitZoneAwareEvent('
|
|
1333
|
+
this.emitZoneAwareEvent('onRelease', event);
|
|
1337
1334
|
}
|
|
1338
1335
|
handleDragEnd(event) {
|
|
1339
1336
|
var _a, _b;
|
|
@@ -1360,7 +1357,7 @@ class DragTargetContainerDirective {
|
|
|
1360
1357
|
this.service.dragTarget = null;
|
|
1361
1358
|
this.service.dragIndex = null;
|
|
1362
1359
|
this.currentDragTarget.element = null;
|
|
1363
|
-
this.emitZoneAwareEvent('
|
|
1360
|
+
this.emitZoneAwareEvent('onDragEnd', event);
|
|
1364
1361
|
if (isDragStartPrevented || isDragPrevented) {
|
|
1365
1362
|
return;
|
|
1366
1363
|
}
|
|
@@ -1420,33 +1417,34 @@ class DragTargetContainerDirective {
|
|
|
1420
1417
|
});
|
|
1421
1418
|
}
|
|
1422
1419
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1420
|
+
const targetIdArgs = { dragTarget: this.currentDragTargetElement, dragTargetIndex: this.service.dragIndex };
|
|
1423
1421
|
const eventProps = {
|
|
1424
1422
|
dragTarget: this.currentDragTargetElement,
|
|
1425
1423
|
dragEvent: normalizedEvent,
|
|
1426
1424
|
dragTargetIndex: this.service.dragIndex,
|
|
1427
|
-
dragTargetId: this.dragTargetId(
|
|
1425
|
+
dragTargetId: this.dragTargetId(targetIdArgs)
|
|
1428
1426
|
};
|
|
1429
1427
|
if (this.hint && isPresent(this.hintElem)) {
|
|
1430
1428
|
eventProps.hintElement = this.hintElem;
|
|
1431
1429
|
}
|
|
1432
1430
|
let eventArgs;
|
|
1433
1431
|
switch (event) {
|
|
1434
|
-
case '
|
|
1432
|
+
case 'onDragReady':
|
|
1435
1433
|
eventArgs = new DragTargetDragReadyEvent(eventProps);
|
|
1436
1434
|
break;
|
|
1437
|
-
case '
|
|
1435
|
+
case 'onPress':
|
|
1438
1436
|
eventArgs = new DragTargetPressEvent(eventProps);
|
|
1439
1437
|
break;
|
|
1440
|
-
case '
|
|
1438
|
+
case 'onDragStart':
|
|
1441
1439
|
eventArgs = new DragTargetDragStartEvent(eventProps);
|
|
1442
1440
|
break;
|
|
1443
|
-
case '
|
|
1441
|
+
case 'onDrag':
|
|
1444
1442
|
eventArgs = new DragTargetDragEvent(eventProps);
|
|
1445
1443
|
break;
|
|
1446
|
-
case '
|
|
1444
|
+
case 'onRelease':
|
|
1447
1445
|
eventArgs = new DragTargetReleaseEvent(eventProps);
|
|
1448
1446
|
break;
|
|
1449
|
-
case '
|
|
1447
|
+
case 'onDragEnd':
|
|
1450
1448
|
eventArgs = new DragTargetDragEndEvent(eventProps);
|
|
1451
1449
|
break;
|
|
1452
1450
|
default:
|
|
@@ -1499,7 +1497,8 @@ class DragTargetContainerDirective {
|
|
|
1499
1497
|
this.hintComponent.instance.template = this.hintTemplate;
|
|
1500
1498
|
this.hintComponent.instance.directive = this;
|
|
1501
1499
|
this.hintComponent.instance.targetIndex = this.service.dragIndex;
|
|
1502
|
-
|
|
1500
|
+
const targetDataArgs = { dragTarget: this.currentDragTargetElement, dragTargetId: this.service.dragTargetId, dragTargetIndex: this.service.dragIndex };
|
|
1501
|
+
this.hintComponent.instance.contextData = this.dragData(targetDataArgs);
|
|
1503
1502
|
this.hintComponent.changeDetectorRef.detectChanges();
|
|
1504
1503
|
}
|
|
1505
1504
|
destroyHint() {
|
|
@@ -1571,12 +1570,12 @@ class DragTargetContainerDirective {
|
|
|
1571
1570
|
}
|
|
1572
1571
|
if (isPresent(this.dragHandles) && this.dragHandles.length > 0) {
|
|
1573
1572
|
this.dragHandles.forEach(handle => {
|
|
1574
|
-
this.renderer.
|
|
1573
|
+
this.renderer.setStyle(handle, 'cursor', 'move');
|
|
1575
1574
|
});
|
|
1576
1575
|
}
|
|
1577
1576
|
else {
|
|
1578
1577
|
this.allDragTargets.forEach(target => {
|
|
1579
|
-
this.renderer.
|
|
1578
|
+
this.renderer.setStyle(target, 'cursor', 'move');
|
|
1580
1579
|
});
|
|
1581
1580
|
}
|
|
1582
1581
|
}
|
|
@@ -1604,8 +1603,10 @@ class DragTargetContainerDirective {
|
|
|
1604
1603
|
if (!this.dragStarted && this.threshold > 0) {
|
|
1605
1604
|
this.dragStarted = true;
|
|
1606
1605
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1606
|
+
if (elem) {
|
|
1607
|
+
const styles = this.getStylesPerElement(elem);
|
|
1608
|
+
setElementStyles(this.renderer, elem, styles);
|
|
1609
|
+
}
|
|
1609
1610
|
}
|
|
1610
1611
|
calculatePosition(element, event) {
|
|
1611
1612
|
let position = null;
|
|
@@ -1638,7 +1639,7 @@ class DragTargetContainerDirective {
|
|
|
1638
1639
|
}
|
|
1639
1640
|
}
|
|
1640
1641
|
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 });
|
|
1641
|
-
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: {
|
|
1642
|
+
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 });
|
|
1642
1643
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragTargetContainerDirective, decorators: [{
|
|
1643
1644
|
type: Directive,
|
|
1644
1645
|
args: [{
|
|
@@ -1663,17 +1664,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1663
1664
|
type: Input
|
|
1664
1665
|
}], mode: [{
|
|
1665
1666
|
type: Input
|
|
1666
|
-
}],
|
|
1667
|
+
}], onDragReady: [{
|
|
1667
1668
|
type: Output
|
|
1668
|
-
}],
|
|
1669
|
+
}], onPress: [{
|
|
1669
1670
|
type: Output
|
|
1670
|
-
}],
|
|
1671
|
+
}], onDragStart: [{
|
|
1671
1672
|
type: Output
|
|
1672
|
-
}],
|
|
1673
|
+
}], onDrag: [{
|
|
1673
1674
|
type: Output
|
|
1674
|
-
}],
|
|
1675
|
+
}], onRelease: [{
|
|
1675
1676
|
type: Output
|
|
1676
|
-
}],
|
|
1677
|
+
}], onDragEnd: [{
|
|
1677
1678
|
type: Output
|
|
1678
1679
|
}] } });
|
|
1679
1680
|
|
|
@@ -1697,19 +1698,19 @@ class DropTargetContainerDirective {
|
|
|
1697
1698
|
/**
|
|
1698
1699
|
* Fires when a DragTarget element enters the DropTarget.
|
|
1699
1700
|
*/
|
|
1700
|
-
this.
|
|
1701
|
+
this.onDragEnter = new EventEmitter();
|
|
1701
1702
|
/**
|
|
1702
1703
|
* Fires when a DragTarget element is being dragged over the DropTarget.
|
|
1703
1704
|
*/
|
|
1704
|
-
this.
|
|
1705
|
+
this.onDragOver = new EventEmitter();
|
|
1705
1706
|
/**
|
|
1706
1707
|
* Fires when a DragTarget element leaves the DropTarget.
|
|
1707
1708
|
*/
|
|
1708
|
-
this.
|
|
1709
|
+
this.onDragLeave = new EventEmitter();
|
|
1709
1710
|
/**
|
|
1710
1711
|
* Fires when a DragTarget element is dropped over the DropTarget.
|
|
1711
1712
|
*/
|
|
1712
|
-
this.
|
|
1713
|
+
this.onDrop = new EventEmitter();
|
|
1713
1714
|
this.currentDropTarget = null;
|
|
1714
1715
|
this.currentDropTargetElement = null;
|
|
1715
1716
|
this.previousDropTargets = [];
|
|
@@ -1776,7 +1777,7 @@ class DropTargetContainerDirective {
|
|
|
1776
1777
|
this.currentDropTarget = this.service.dropTargets.find(dt => dt.element === this.currentDropTargetElement);
|
|
1777
1778
|
this.service.dropTarget = this.currentDropTarget;
|
|
1778
1779
|
this.service.dropIndex = this.getDropIndex();
|
|
1779
|
-
this.emitZoneAwareEvent('
|
|
1780
|
+
this.emitZoneAwareEvent('onDragEnter', event);
|
|
1780
1781
|
}
|
|
1781
1782
|
/**
|
|
1782
1783
|
* @hidden
|
|
@@ -1786,7 +1787,7 @@ class DropTargetContainerDirective {
|
|
|
1786
1787
|
if (!this.service.dragTarget) {
|
|
1787
1788
|
return;
|
|
1788
1789
|
}
|
|
1789
|
-
this.emitZoneAwareEvent('
|
|
1790
|
+
this.emitZoneAwareEvent('onDragLeave', event);
|
|
1790
1791
|
}
|
|
1791
1792
|
/**
|
|
1792
1793
|
* @hidden
|
|
@@ -1795,7 +1796,7 @@ class DropTargetContainerDirective {
|
|
|
1795
1796
|
if (!this.service.dragTarget) {
|
|
1796
1797
|
return;
|
|
1797
1798
|
}
|
|
1798
|
-
this.emitZoneAwareEvent('
|
|
1799
|
+
this.emitZoneAwareEvent('onDragOver', event);
|
|
1799
1800
|
}
|
|
1800
1801
|
/**
|
|
1801
1802
|
* @hidden
|
|
@@ -1804,7 +1805,7 @@ class DropTargetContainerDirective {
|
|
|
1804
1805
|
if (!this.service.dragTarget) {
|
|
1805
1806
|
return;
|
|
1806
1807
|
}
|
|
1807
|
-
this.emitZoneAwareEvent('
|
|
1808
|
+
this.emitZoneAwareEvent('onDrop', event);
|
|
1808
1809
|
this.currentDropTarget = null;
|
|
1809
1810
|
this.currentDropTargetElement = null;
|
|
1810
1811
|
this.service.dropIndex = null;
|
|
@@ -1840,15 +1841,15 @@ class DropTargetContainerDirective {
|
|
|
1840
1841
|
this.previousDropTargets = this.allDropTargets;
|
|
1841
1842
|
}
|
|
1842
1843
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1843
|
-
var _a;
|
|
1844
|
+
var _a, _b;
|
|
1844
1845
|
const eventProps = {
|
|
1845
|
-
dragTarget: this.service.dragTarget,
|
|
1846
|
+
dragTarget: (_a = this.service.dragTarget) === null || _a === void 0 ? void 0 : _a.element,
|
|
1846
1847
|
dropTarget: this.currentDropTargetElement,
|
|
1847
1848
|
dragData: this.service.dragData,
|
|
1848
1849
|
dragEvent: normalizedEvent,
|
|
1849
1850
|
dropTargetIndex: this.service.dropIndex
|
|
1850
1851
|
};
|
|
1851
|
-
if (isPresent((
|
|
1852
|
+
if (isPresent((_b = this.service.dragTarget) === null || _b === void 0 ? void 0 : _b.hint)) {
|
|
1852
1853
|
eventProps.hintElement = this.service.dragTarget.hint;
|
|
1853
1854
|
}
|
|
1854
1855
|
const eventArgs = new DropTargetEvent(eventProps);
|
|
@@ -1871,7 +1872,7 @@ class DropTargetContainerDirective {
|
|
|
1871
1872
|
}
|
|
1872
1873
|
}
|
|
1873
1874
|
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 });
|
|
1874
|
-
DropTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropTargetContainerDirective, selector: "[kendoDropTargetContainer]", inputs: { dropTargetFilter: "dropTargetFilter", dropDisabled: "dropDisabled" }, outputs: {
|
|
1875
|
+
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 });
|
|
1875
1876
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropTargetContainerDirective, decorators: [{
|
|
1876
1877
|
type: Directive,
|
|
1877
1878
|
args: [{
|
|
@@ -1882,13 +1883,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1882
1883
|
type: Input
|
|
1883
1884
|
}], dropDisabled: [{
|
|
1884
1885
|
type: Input
|
|
1885
|
-
}],
|
|
1886
|
+
}], onDragEnter: [{
|
|
1886
1887
|
type: Output
|
|
1887
|
-
}],
|
|
1888
|
+
}], onDragOver: [{
|
|
1888
1889
|
type: Output
|
|
1889
|
-
}],
|
|
1890
|
+
}], onDragLeave: [{
|
|
1890
1891
|
type: Output
|
|
1891
|
-
}],
|
|
1892
|
+
}], onDrop: [{
|
|
1892
1893
|
type: Output
|
|
1893
1894
|
}] } });
|
|
1894
1895
|
|