@progress/kendo-angular-utils 13.0.0-develop.9 → 13.0.1-develop.1
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 +3 -3
- 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 +16 -10
- package/esm2020/drag-and-drop/dragtarget.directive.mjs +7 -5
- package/esm2020/drag-and-drop/droptarget-container.directive.mjs +1 -1
- package/esm2020/package-metadata.mjs +2 -2
- package/fesm2015/progress-kendo-angular-utils.mjs +32 -24
- package/fesm2020/progress-kendo-angular-utils.mjs +30 -22
- package/package.json +3 -3
|
@@ -11,7 +11,7 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
export declare class DragHandleDirective {
|
|
12
12
|
element: ElementRef;
|
|
13
13
|
constructor(element: ElementRef);
|
|
14
|
-
|
|
14
|
+
cursorStyle: string;
|
|
15
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<DragHandleDirective, never>;
|
|
16
16
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DragHandleDirective, "[kendoDragHandle]", ["kendoDragHandle"], {}, {}, never>;
|
|
17
17
|
}
|
|
@@ -27,7 +27,7 @@ export declare class DragTargetContainerDirective implements AfterViewInit {
|
|
|
27
27
|
private viewContainer;
|
|
28
28
|
private cdr;
|
|
29
29
|
/**
|
|
30
|
-
* Defines whether a hint will be used for dragging. By default, the hint is a copy of the current drag target. ([see example]({% slug
|
|
30
|
+
* 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 %})).
|
|
31
31
|
*
|
|
32
32
|
* @default false
|
|
33
33
|
*/
|
|
@@ -40,11 +40,11 @@ export declare class DragTargetContainerDirective implements AfterViewInit {
|
|
|
40
40
|
set dragTargetFilter(value: string);
|
|
41
41
|
get dragTargetFilter(): string;
|
|
42
42
|
/**
|
|
43
|
-
* Specifies a selector for elements within each DragTarget which will be configured as drag handles
|
|
43
|
+
* Specifies a selector for elements within each DragTarget which will be configured as drag handles.
|
|
44
44
|
*/
|
|
45
45
|
dragHandle: string;
|
|
46
46
|
/**
|
|
47
|
-
* Defines the delay in milliseconds after which the drag will begin ([see example](
|
|
47
|
+
* Defines the delay in milliseconds after which the drag will begin ([see example](slug drag_target_container#toc-events)).
|
|
48
48
|
*
|
|
49
49
|
* @default 0
|
|
50
50
|
*/
|
|
@@ -8,10 +8,40 @@
|
|
|
8
8
|
* It returns the custom data that will be available in the events of the respective [`DropTarget`]({% slug api_utils_droptargetdirective %}) or [`DropTargetContainer`]({% slug api_utils_droptargetcontainerdirective %}) directives upon interaction.
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
export declare type DragTargetDataFn = (
|
|
11
|
+
export declare type DragTargetDataFn = (args: DragTargetDataArgs) => any;
|
|
12
12
|
/**
|
|
13
13
|
* Represents the callback that is used by the `dragTargetId` property of the [`DragTargetContainer`]({% slug api_utils_dragtargetcontainerdirective %}) directive.
|
|
14
14
|
*
|
|
15
15
|
* It returns a custom identifier that will be available in the events of the respective directive upon its interaction with a valid DropTarget.
|
|
16
16
|
*/
|
|
17
|
-
export declare type DragTargetIdFn = (
|
|
17
|
+
export declare type DragTargetIdFn = (args: DragTargetIdArgs) => any;
|
|
18
|
+
/**
|
|
19
|
+
* Represents the callback arguments used by the `dragData` property.
|
|
20
|
+
*/
|
|
21
|
+
export interface DragTargetDataArgs {
|
|
22
|
+
/**
|
|
23
|
+
* The drag target HTML element.
|
|
24
|
+
*/
|
|
25
|
+
dragTarget: HTMLElement;
|
|
26
|
+
/**
|
|
27
|
+
* The drag target unique identifier, result from executing the callback used by the `dragTargetId` property. Applicable for the `DragTargetContainerDirective`.
|
|
28
|
+
*/
|
|
29
|
+
dragTargetId: any;
|
|
30
|
+
/**
|
|
31
|
+
* The index of the current drag target in the collection of drag targets. Applicable for the `DragTargetContainerDirective`.
|
|
32
|
+
*/
|
|
33
|
+
dragTargetIndex: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Represents the callback arguments used by the `dragTargetId` property.
|
|
37
|
+
*/
|
|
38
|
+
export interface DragTargetIdArgs {
|
|
39
|
+
/**
|
|
40
|
+
* The drag target HTML element.
|
|
41
|
+
*/
|
|
42
|
+
dragTarget: HTMLElement;
|
|
43
|
+
/**
|
|
44
|
+
* The index of the current drag target in the collection of drag targets. Applicable for the `DragTargetContainerDirective`.
|
|
45
|
+
*/
|
|
46
|
+
dragTargetIndex: number;
|
|
47
|
+
}
|
|
@@ -11,18 +11,18 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
export class DragHandleDirective {
|
|
12
12
|
constructor(element) {
|
|
13
13
|
this.element = element;
|
|
14
|
-
this.
|
|
14
|
+
this.cursorStyle = 'move';
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
DragHandleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragHandleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
18
|
-
DragHandleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DragHandleDirective, selector: "[kendoDragHandle]", host: { properties: { "
|
|
18
|
+
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 });
|
|
19
19
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragHandleDirective, decorators: [{
|
|
20
20
|
type: Directive,
|
|
21
21
|
args: [{
|
|
22
22
|
selector: '[kendoDragHandle]',
|
|
23
23
|
exportAs: 'kendoDragHandle'
|
|
24
24
|
}]
|
|
25
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: {
|
|
25
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { cursorStyle: [{
|
|
26
26
|
type: HostBinding,
|
|
27
|
-
args: ['
|
|
27
|
+
args: ['style.cursor']
|
|
28
28
|
}] } });
|
|
@@ -37,13 +37,13 @@ export class DragTargetContainerDirective {
|
|
|
37
37
|
this.viewContainer = viewContainer;
|
|
38
38
|
this.cdr = cdr;
|
|
39
39
|
/**
|
|
40
|
-
* Defines whether a hint will be used for dragging. By default, the hint is a copy of the current drag target. ([see example]({% slug
|
|
40
|
+
* 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 %})).
|
|
41
41
|
*
|
|
42
42
|
* @default false
|
|
43
43
|
*/
|
|
44
44
|
this.hint = false;
|
|
45
45
|
/**
|
|
46
|
-
* Defines the delay in milliseconds after which the drag will begin ([see example](
|
|
46
|
+
* Defines the delay in milliseconds after which the drag will begin ([see example](slug drag_target_container#toc-events)).
|
|
47
47
|
*
|
|
48
48
|
* @default 0
|
|
49
49
|
*/
|
|
@@ -251,8 +251,10 @@ export class DragTargetContainerDirective {
|
|
|
251
251
|
}
|
|
252
252
|
this.dragStarted = this.threshold === 0;
|
|
253
253
|
this.service.dragTarget = this.currentDragTarget;
|
|
254
|
-
|
|
255
|
-
this.service.
|
|
254
|
+
const targetIdArgs = { dragTarget: this.currentDragTargetElement, dragTargetIndex: this.service.dragIndex };
|
|
255
|
+
this.service.dragTargetId = this.dragTargetId(targetIdArgs);
|
|
256
|
+
const targetDataArgs = Object.assign({ dragTargetId: this.service.dragTargetId }, targetIdArgs);
|
|
257
|
+
this.service.dragData = this.dragData(targetDataArgs);
|
|
256
258
|
}
|
|
257
259
|
handleDrag(event) {
|
|
258
260
|
if (!this.pressed || isDragStartPrevented) {
|
|
@@ -364,11 +366,12 @@ export class DragTargetContainerDirective {
|
|
|
364
366
|
});
|
|
365
367
|
}
|
|
366
368
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
369
|
+
const targetIdArgs = { dragTarget: this.currentDragTargetElement, dragTargetIndex: this.service.dragIndex };
|
|
367
370
|
const eventProps = {
|
|
368
371
|
dragTarget: this.currentDragTargetElement,
|
|
369
372
|
dragEvent: normalizedEvent,
|
|
370
373
|
dragTargetIndex: this.service.dragIndex,
|
|
371
|
-
dragTargetId: this.dragTargetId(
|
|
374
|
+
dragTargetId: this.dragTargetId(targetIdArgs)
|
|
372
375
|
};
|
|
373
376
|
if (this.hint && isPresent(this.hintElem)) {
|
|
374
377
|
eventProps.hintElement = this.hintElem;
|
|
@@ -443,7 +446,8 @@ export class DragTargetContainerDirective {
|
|
|
443
446
|
this.hintComponent.instance.template = this.hintTemplate;
|
|
444
447
|
this.hintComponent.instance.directive = this;
|
|
445
448
|
this.hintComponent.instance.targetIndex = this.service.dragIndex;
|
|
446
|
-
|
|
449
|
+
const targetDataArgs = { dragTarget: this.currentDragTargetElement, dragTargetId: this.service.dragTargetId, dragTargetIndex: this.service.dragIndex };
|
|
450
|
+
this.hintComponent.instance.contextData = this.dragData(targetDataArgs);
|
|
447
451
|
this.hintComponent.changeDetectorRef.detectChanges();
|
|
448
452
|
}
|
|
449
453
|
destroyHint() {
|
|
@@ -515,12 +519,12 @@ export class DragTargetContainerDirective {
|
|
|
515
519
|
}
|
|
516
520
|
if (isPresent(this.dragHandles) && this.dragHandles.length > 0) {
|
|
517
521
|
this.dragHandles.forEach(handle => {
|
|
518
|
-
this.renderer.
|
|
522
|
+
this.renderer.setStyle(handle, 'cursor', 'move');
|
|
519
523
|
});
|
|
520
524
|
}
|
|
521
525
|
else {
|
|
522
526
|
this.allDragTargets.forEach(target => {
|
|
523
|
-
this.renderer.
|
|
527
|
+
this.renderer.setStyle(target, 'cursor', 'move');
|
|
524
528
|
});
|
|
525
529
|
}
|
|
526
530
|
}
|
|
@@ -548,8 +552,10 @@ export class DragTargetContainerDirective {
|
|
|
548
552
|
if (!this.dragStarted && this.threshold > 0) {
|
|
549
553
|
this.dragStarted = true;
|
|
550
554
|
}
|
|
551
|
-
|
|
552
|
-
|
|
555
|
+
if (elem) {
|
|
556
|
+
const styles = this.getStylesPerElement(elem);
|
|
557
|
+
setElementStyles(this.renderer, elem, styles);
|
|
558
|
+
}
|
|
553
559
|
}
|
|
554
560
|
calculatePosition(element, event) {
|
|
555
561
|
let position = null;
|
|
@@ -148,7 +148,7 @@ export class DragTargetDirective {
|
|
|
148
148
|
if (isPresent(this.element) || isPresent(this.dragTarget)) {
|
|
149
149
|
this.attachDomHandlers();
|
|
150
150
|
if (!this.dragHandles.length) {
|
|
151
|
-
this.renderer.
|
|
151
|
+
this.renderer.setStyle(this.nativeElement, 'cursor', 'move');
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
this.service.dragTargets.push(this.dragTarget);
|
|
@@ -194,7 +194,7 @@ export class DragTargetDirective {
|
|
|
194
194
|
this.dragStarted = this.threshold === 0;
|
|
195
195
|
this.service.dragTarget = this.dragTarget;
|
|
196
196
|
this.service.dragTargetDirective = this;
|
|
197
|
-
this.service.dragData = this.dragData(this.dragTarget.element, this.dragTargetIdResult);
|
|
197
|
+
this.service.dragData = this.dragData({ dragTarget: this.dragTarget.element, dragTargetId: this.dragTargetIdResult, dragTargetIndex: null });
|
|
198
198
|
}
|
|
199
199
|
handleDrag(event) {
|
|
200
200
|
if (!this.pressed || isDragStartPrevented) {
|
|
@@ -406,7 +406,7 @@ export class DragTargetDirective {
|
|
|
406
406
|
}
|
|
407
407
|
get dragTargetIdResult() {
|
|
408
408
|
if (this.dragTargetId && this.dragTargetId !== '') {
|
|
409
|
-
return typeof this.dragTargetId === 'string' ? this.dragTargetId : this.dragTargetId(this.dragTarget.element);
|
|
409
|
+
return typeof this.dragTargetId === 'string' ? this.dragTargetId : this.dragTargetId({ dragTarget: this.dragTarget.element, dragTargetIndex: null });
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
performDrag(event) {
|
|
@@ -419,8 +419,10 @@ export class DragTargetDirective {
|
|
|
419
419
|
if (!this.dragStarted && this.threshold > 0) {
|
|
420
420
|
this.dragStarted = true;
|
|
421
421
|
}
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
if (elem) {
|
|
423
|
+
const styles = this.getStylesPerElement(elem);
|
|
424
|
+
setElementStyles(this.renderer, elem, styles);
|
|
425
|
+
}
|
|
424
426
|
}
|
|
425
427
|
calculatePosition(element, event) {
|
|
426
428
|
let position = null;
|
|
@@ -174,7 +174,7 @@ export class DropTargetContainerDirective {
|
|
|
174
174
|
}
|
|
175
175
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
176
176
|
const eventProps = {
|
|
177
|
-
dragTarget: this.service.dragTarget,
|
|
177
|
+
dragTarget: this.service.dragTarget?.element,
|
|
178
178
|
dropTarget: this.currentDropTargetElement,
|
|
179
179
|
dragData: this.service.dragData,
|
|
180
180
|
dragEvent: normalizedEvent,
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-utils',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
13
|
-
version: '13.0.
|
|
12
|
+
publishDate: 1686070425,
|
|
13
|
+
version: '13.0.1-develop.1',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|
|
@@ -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.
|
|
22
|
+
publishDate: 1686070425,
|
|
23
|
+
version: '13.0.1-develop.1',
|
|
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) {
|
|
@@ -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);
|
|
@@ -622,7 +622,7 @@ 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) {
|
|
@@ -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;
|
|
@@ -1085,13 +1087,13 @@ class DragTargetContainerDirective {
|
|
|
1085
1087
|
this.viewContainer = viewContainer;
|
|
1086
1088
|
this.cdr = cdr;
|
|
1087
1089
|
/**
|
|
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
|
|
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 %})).
|
|
1089
1091
|
*
|
|
1090
1092
|
* @default false
|
|
1091
1093
|
*/
|
|
1092
1094
|
this.hint = false;
|
|
1093
1095
|
/**
|
|
1094
|
-
* 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)).
|
|
1095
1097
|
*
|
|
1096
1098
|
* @default 0
|
|
1097
1099
|
*/
|
|
@@ -1299,8 +1301,10 @@ class DragTargetContainerDirective {
|
|
|
1299
1301
|
}
|
|
1300
1302
|
this.dragStarted = this.threshold === 0;
|
|
1301
1303
|
this.service.dragTarget = this.currentDragTarget;
|
|
1302
|
-
|
|
1303
|
-
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);
|
|
1304
1308
|
}
|
|
1305
1309
|
handleDrag(event) {
|
|
1306
1310
|
if (!this.pressed || isDragStartPrevented) {
|
|
@@ -1413,11 +1417,12 @@ class DragTargetContainerDirective {
|
|
|
1413
1417
|
});
|
|
1414
1418
|
}
|
|
1415
1419
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1420
|
+
const targetIdArgs = { dragTarget: this.currentDragTargetElement, dragTargetIndex: this.service.dragIndex };
|
|
1416
1421
|
const eventProps = {
|
|
1417
1422
|
dragTarget: this.currentDragTargetElement,
|
|
1418
1423
|
dragEvent: normalizedEvent,
|
|
1419
1424
|
dragTargetIndex: this.service.dragIndex,
|
|
1420
|
-
dragTargetId: this.dragTargetId(
|
|
1425
|
+
dragTargetId: this.dragTargetId(targetIdArgs)
|
|
1421
1426
|
};
|
|
1422
1427
|
if (this.hint && isPresent(this.hintElem)) {
|
|
1423
1428
|
eventProps.hintElement = this.hintElem;
|
|
@@ -1492,7 +1497,8 @@ class DragTargetContainerDirective {
|
|
|
1492
1497
|
this.hintComponent.instance.template = this.hintTemplate;
|
|
1493
1498
|
this.hintComponent.instance.directive = this;
|
|
1494
1499
|
this.hintComponent.instance.targetIndex = this.service.dragIndex;
|
|
1495
|
-
|
|
1500
|
+
const targetDataArgs = { dragTarget: this.currentDragTargetElement, dragTargetId: this.service.dragTargetId, dragTargetIndex: this.service.dragIndex };
|
|
1501
|
+
this.hintComponent.instance.contextData = this.dragData(targetDataArgs);
|
|
1496
1502
|
this.hintComponent.changeDetectorRef.detectChanges();
|
|
1497
1503
|
}
|
|
1498
1504
|
destroyHint() {
|
|
@@ -1564,12 +1570,12 @@ class DragTargetContainerDirective {
|
|
|
1564
1570
|
}
|
|
1565
1571
|
if (isPresent(this.dragHandles) && this.dragHandles.length > 0) {
|
|
1566
1572
|
this.dragHandles.forEach(handle => {
|
|
1567
|
-
this.renderer.
|
|
1573
|
+
this.renderer.setStyle(handle, 'cursor', 'move');
|
|
1568
1574
|
});
|
|
1569
1575
|
}
|
|
1570
1576
|
else {
|
|
1571
1577
|
this.allDragTargets.forEach(target => {
|
|
1572
|
-
this.renderer.
|
|
1578
|
+
this.renderer.setStyle(target, 'cursor', 'move');
|
|
1573
1579
|
});
|
|
1574
1580
|
}
|
|
1575
1581
|
}
|
|
@@ -1597,8 +1603,10 @@ class DragTargetContainerDirective {
|
|
|
1597
1603
|
if (!this.dragStarted && this.threshold > 0) {
|
|
1598
1604
|
this.dragStarted = true;
|
|
1599
1605
|
}
|
|
1600
|
-
|
|
1601
|
-
|
|
1606
|
+
if (elem) {
|
|
1607
|
+
const styles = this.getStylesPerElement(elem);
|
|
1608
|
+
setElementStyles(this.renderer, elem, styles);
|
|
1609
|
+
}
|
|
1602
1610
|
}
|
|
1603
1611
|
calculatePosition(element, event) {
|
|
1604
1612
|
let position = null;
|
|
@@ -1833,15 +1841,15 @@ class DropTargetContainerDirective {
|
|
|
1833
1841
|
this.previousDropTargets = this.allDropTargets;
|
|
1834
1842
|
}
|
|
1835
1843
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1836
|
-
var _a;
|
|
1844
|
+
var _a, _b;
|
|
1837
1845
|
const eventProps = {
|
|
1838
|
-
dragTarget: this.service.dragTarget,
|
|
1846
|
+
dragTarget: (_a = this.service.dragTarget) === null || _a === void 0 ? void 0 : _a.element,
|
|
1839
1847
|
dropTarget: this.currentDropTargetElement,
|
|
1840
1848
|
dragData: this.service.dragData,
|
|
1841
1849
|
dragEvent: normalizedEvent,
|
|
1842
1850
|
dropTargetIndex: this.service.dropIndex
|
|
1843
1851
|
};
|
|
1844
|
-
if (isPresent((
|
|
1852
|
+
if (isPresent((_b = this.service.dragTarget) === null || _b === void 0 ? void 0 : _b.hint)) {
|
|
1845
1853
|
eventProps.hintElement = this.service.dragTarget.hint;
|
|
1846
1854
|
}
|
|
1847
1855
|
const eventArgs = new DropTargetEvent(eventProps);
|
|
@@ -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.
|
|
22
|
+
publishDate: 1686070425,
|
|
23
|
+
version: '13.0.1-develop.1',
|
|
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
|
/**
|
|
@@ -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);
|
|
@@ -622,7 +622,7 @@ 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) {
|
|
@@ -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;
|
|
@@ -1083,13 +1085,13 @@ class DragTargetContainerDirective {
|
|
|
1083
1085
|
this.viewContainer = viewContainer;
|
|
1084
1086
|
this.cdr = cdr;
|
|
1085
1087
|
/**
|
|
1086
|
-
* 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 %})).
|
|
1087
1089
|
*
|
|
1088
1090
|
* @default false
|
|
1089
1091
|
*/
|
|
1090
1092
|
this.hint = false;
|
|
1091
1093
|
/**
|
|
1092
|
-
* 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)).
|
|
1093
1095
|
*
|
|
1094
1096
|
* @default 0
|
|
1095
1097
|
*/
|
|
@@ -1297,8 +1299,10 @@ class DragTargetContainerDirective {
|
|
|
1297
1299
|
}
|
|
1298
1300
|
this.dragStarted = this.threshold === 0;
|
|
1299
1301
|
this.service.dragTarget = this.currentDragTarget;
|
|
1300
|
-
|
|
1301
|
-
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);
|
|
1302
1306
|
}
|
|
1303
1307
|
handleDrag(event) {
|
|
1304
1308
|
if (!this.pressed || isDragStartPrevented) {
|
|
@@ -1410,11 +1414,12 @@ class DragTargetContainerDirective {
|
|
|
1410
1414
|
});
|
|
1411
1415
|
}
|
|
1412
1416
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1417
|
+
const targetIdArgs = { dragTarget: this.currentDragTargetElement, dragTargetIndex: this.service.dragIndex };
|
|
1413
1418
|
const eventProps = {
|
|
1414
1419
|
dragTarget: this.currentDragTargetElement,
|
|
1415
1420
|
dragEvent: normalizedEvent,
|
|
1416
1421
|
dragTargetIndex: this.service.dragIndex,
|
|
1417
|
-
dragTargetId: this.dragTargetId(
|
|
1422
|
+
dragTargetId: this.dragTargetId(targetIdArgs)
|
|
1418
1423
|
};
|
|
1419
1424
|
if (this.hint && isPresent(this.hintElem)) {
|
|
1420
1425
|
eventProps.hintElement = this.hintElem;
|
|
@@ -1489,7 +1494,8 @@ class DragTargetContainerDirective {
|
|
|
1489
1494
|
this.hintComponent.instance.template = this.hintTemplate;
|
|
1490
1495
|
this.hintComponent.instance.directive = this;
|
|
1491
1496
|
this.hintComponent.instance.targetIndex = this.service.dragIndex;
|
|
1492
|
-
|
|
1497
|
+
const targetDataArgs = { dragTarget: this.currentDragTargetElement, dragTargetId: this.service.dragTargetId, dragTargetIndex: this.service.dragIndex };
|
|
1498
|
+
this.hintComponent.instance.contextData = this.dragData(targetDataArgs);
|
|
1493
1499
|
this.hintComponent.changeDetectorRef.detectChanges();
|
|
1494
1500
|
}
|
|
1495
1501
|
destroyHint() {
|
|
@@ -1561,12 +1567,12 @@ class DragTargetContainerDirective {
|
|
|
1561
1567
|
}
|
|
1562
1568
|
if (isPresent(this.dragHandles) && this.dragHandles.length > 0) {
|
|
1563
1569
|
this.dragHandles.forEach(handle => {
|
|
1564
|
-
this.renderer.
|
|
1570
|
+
this.renderer.setStyle(handle, 'cursor', 'move');
|
|
1565
1571
|
});
|
|
1566
1572
|
}
|
|
1567
1573
|
else {
|
|
1568
1574
|
this.allDragTargets.forEach(target => {
|
|
1569
|
-
this.renderer.
|
|
1575
|
+
this.renderer.setStyle(target, 'cursor', 'move');
|
|
1570
1576
|
});
|
|
1571
1577
|
}
|
|
1572
1578
|
}
|
|
@@ -1594,8 +1600,10 @@ class DragTargetContainerDirective {
|
|
|
1594
1600
|
if (!this.dragStarted && this.threshold > 0) {
|
|
1595
1601
|
this.dragStarted = true;
|
|
1596
1602
|
}
|
|
1597
|
-
|
|
1598
|
-
|
|
1603
|
+
if (elem) {
|
|
1604
|
+
const styles = this.getStylesPerElement(elem);
|
|
1605
|
+
setElementStyles(this.renderer, elem, styles);
|
|
1606
|
+
}
|
|
1599
1607
|
}
|
|
1600
1608
|
calculatePosition(element, event) {
|
|
1601
1609
|
let position = null;
|
|
@@ -1831,7 +1839,7 @@ class DropTargetContainerDirective {
|
|
|
1831
1839
|
}
|
|
1832
1840
|
emitZoneAwareEvent(event, normalizedEvent) {
|
|
1833
1841
|
const eventProps = {
|
|
1834
|
-
dragTarget: this.service.dragTarget,
|
|
1842
|
+
dragTarget: this.service.dragTarget?.element,
|
|
1835
1843
|
dropTarget: this.currentDropTargetElement,
|
|
1836
1844
|
dragData: this.service.dragData,
|
|
1837
1845
|
dragEvent: normalizedEvent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-utils",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.1-develop.1",
|
|
4
4
|
"description": "Kendo UI Angular utils component",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"@angular/core": "13 - 16",
|
|
24
24
|
"@angular/platform-browser": "13 - 16",
|
|
25
25
|
"@progress/kendo-licensing": "^1.0.2",
|
|
26
|
-
"@progress/kendo-angular-common": "13.0.
|
|
26
|
+
"@progress/kendo-angular-common": "13.0.1-develop.1",
|
|
27
27
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"tslib": "^2.3.1",
|
|
31
|
-
"@progress/kendo-angular-schematics": "13.0.
|
|
31
|
+
"@progress/kendo-angular-schematics": "13.0.1-develop.1",
|
|
32
32
|
"@progress/kendo-draggable-common": "^0.2.3"
|
|
33
33
|
},
|
|
34
34
|
"schematics": "./schematics/collection.json",
|