@progress/kendo-angular-utils 12.0.0-develop.7 → 12.0.0-develop.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/drag-and-drop/drag-state.service.d.ts +4 -0
- package/drag-and-drop/draghandle.directive.d.ts +1 -0
- package/drag-and-drop/dragtarget-container.directive.d.ts +164 -0
- package/drag-and-drop/dragtarget.directive.d.ts +45 -42
- package/drag-and-drop/droptarget-container.directive.d.ts +89 -0
- package/drag-and-drop/droptarget.directive.d.ts +7 -18
- package/drag-and-drop/events/drag-target/drag-event.d.ts +23 -5
- package/drag-and-drop/events/drag-target/dragready-event.d.ts +30 -0
- package/drag-and-drop/events/drag-target/end-event.d.ts +22 -4
- package/drag-and-drop/events/drag-target/index.d.ts +2 -0
- package/drag-and-drop/events/drag-target/press-event.d.ts +23 -5
- package/drag-and-drop/events/drag-target/release-event.d.ts +40 -0
- package/drag-and-drop/events/drag-target/start-event.d.ts +22 -4
- package/drag-and-drop/events/drop-target-event.d.ts +48 -0
- package/drag-and-drop/events/index.d.ts +6 -0
- package/drag-and-drop/hint.component.d.ts +3 -4
- package/{esm2020/drag-and-drop/events/drop-target/drop-event.mjs → drag-and-drop/models/drag-mode.d.ts} +2 -9
- package/drag-and-drop/models/functions.d.ts +17 -0
- package/drag-and-drop/models/hint-settings.d.ts +22 -0
- package/drag-and-drop/models/index.d.ts +4 -2
- package/drag-and-drop/util.d.ts +22 -2
- package/drag-and-drop.module.d.ts +5 -3
- package/esm2020/drag-and-drop/drag-state.service.mjs +2 -0
- package/esm2020/drag-and-drop/draghandle.directive.mjs +1 -0
- package/esm2020/drag-and-drop/dragtarget-container.directive.mjs +621 -0
- package/esm2020/drag-and-drop/dragtarget.directive.mjs +260 -162
- package/esm2020/drag-and-drop/droptarget-container.directive.mjs +224 -0
- package/esm2020/drag-and-drop/droptarget.directive.mjs +25 -43
- package/esm2020/drag-and-drop/events/drag-target/drag-event.mjs +15 -1
- package/esm2020/drag-and-drop/events/{drop-target/enter-event.mjs → drag-target/dragready-event.mjs} +2 -2
- package/esm2020/drag-and-drop/events/drag-target/end-event.mjs +15 -1
- package/esm2020/drag-and-drop/events/drag-target/index.mjs +2 -0
- package/esm2020/drag-and-drop/events/drag-target/press-event.mjs +15 -1
- package/esm2020/drag-and-drop/events/{drop-target/leave-event.mjs → drag-target/release-event.mjs} +16 -2
- package/esm2020/drag-and-drop/events/drag-target/start-event.mjs +15 -1
- package/esm2020/drag-and-drop/events/drop-target-event.mjs +29 -0
- package/esm2020/drag-and-drop/events/index.mjs +6 -0
- package/esm2020/drag-and-drop/hint.component.mjs +9 -20
- package/esm2020/drag-and-drop/models/functions.mjs +5 -0
- package/esm2020/drag-and-drop/models/hint-settings.mjs +5 -0
- package/esm2020/drag-and-drop/util.mjs +73 -5
- package/esm2020/drag-and-drop.module.mjs +8 -0
- package/esm2020/index.mjs +4 -1
- package/esm2020/package-metadata.mjs +2 -2
- package/fesm2015/progress-kendo-angular-utils.mjs +1346 -307
- package/fesm2020/progress-kendo-angular-utils.mjs +1349 -313
- package/index.d.ts +4 -2
- package/package.json +3 -3
- package/drag-and-drop/events/drop-target/drop-event.d.ts +0 -22
- package/drag-and-drop/events/drop-target/enter-event.d.ts +0 -22
- package/drag-and-drop/events/drop-target/index.d.ts +0 -8
- package/drag-and-drop/events/drop-target/leave-event.d.ts +0 -22
- package/drag-and-drop/events/drop-target/over-event.d.ts +0 -22
- package/drag-and-drop/models/allowed-target.d.ts +0 -16
- package/esm2020/drag-and-drop/events/drop-target/index.mjs +0 -8
- package/esm2020/drag-and-drop/events/drop-target/over-event.mjs +0 -15
- /package/drag-and-drop/models/{dragaxis.d.ts → drag-axis.d.ts} +0 -0
- /package/esm2020/drag-and-drop/models/{allowed-target.mjs → drag-axis.mjs} +0 -0
- /package/esm2020/drag-and-drop/models/{dragaxis.mjs → drag-mode.mjs} +0 -0
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const dragTargetTransition = 'transform .3s ease-in-out';
|
|
5
|
+
function isDocumentNode(container) {
|
|
6
|
+
return container.nodeType === 9;
|
|
7
|
+
}
|
|
9
8
|
/**
|
|
10
9
|
* @hidden
|
|
11
10
|
*/
|
|
@@ -15,6 +14,67 @@ export const getAction = (event, draggable) => {
|
|
|
15
14
|
payload: draggable
|
|
16
15
|
};
|
|
17
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export const dragTargetTransition = 'transform .3s ease-in-out';
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export const isPresent = (value) => value !== null && value !== undefined;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export function closestBySelector(element, selector) {
|
|
29
|
+
if (element.closest) {
|
|
30
|
+
return element.closest(selector);
|
|
31
|
+
}
|
|
32
|
+
const matches = Element.prototype.matches ?
|
|
33
|
+
(el, sel) => el.matches(sel)
|
|
34
|
+
: (el, sel) => el.msMatchesSelector(sel);
|
|
35
|
+
let node = element;
|
|
36
|
+
while (node && !isDocumentNode(node)) {
|
|
37
|
+
if (matches(node, selector)) {
|
|
38
|
+
return node;
|
|
39
|
+
}
|
|
40
|
+
node = node.parentNode;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
export const intersect = (element, candidates) => {
|
|
47
|
+
let max = 0;
|
|
48
|
+
let result = null;
|
|
49
|
+
candidates.forEach((candidate) => {
|
|
50
|
+
if (candidate && element) {
|
|
51
|
+
const ration = getRatio(element, candidate);
|
|
52
|
+
if (ration > max) {
|
|
53
|
+
max = ration;
|
|
54
|
+
result = candidate;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return result;
|
|
59
|
+
};
|
|
60
|
+
const getRatio = (element, target) => {
|
|
61
|
+
const elementRect = element.getBoundingClientRect();
|
|
62
|
+
const targetRect = target.getBoundingClientRect();
|
|
63
|
+
const top = Math.max(targetRect.top, elementRect.top);
|
|
64
|
+
const left = Math.max(targetRect.left, elementRect.left);
|
|
65
|
+
const right = Math.min(targetRect.left + targetRect.width, elementRect.left + elementRect.width);
|
|
66
|
+
const bottom = Math.min(targetRect.top + targetRect.height, elementRect.top + elementRect.height);
|
|
67
|
+
const width = right - left;
|
|
68
|
+
const height = bottom - top;
|
|
69
|
+
if (left < right && top < bottom) {
|
|
70
|
+
const targetArea = targetRect.width * targetRect.height;
|
|
71
|
+
const entryArea = elementRect.width * elementRect.height;
|
|
72
|
+
const intersectionArea = width * height;
|
|
73
|
+
const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea);
|
|
74
|
+
return Number(intersectionRatio.toFixed(4));
|
|
75
|
+
}
|
|
76
|
+
return 0;
|
|
77
|
+
};
|
|
18
78
|
/**
|
|
19
79
|
* @hidden
|
|
20
80
|
*/
|
|
@@ -27,4 +87,12 @@ export const setElementStyles = (renderer, elem, styles) => {
|
|
|
27
87
|
/**
|
|
28
88
|
* @hidden
|
|
29
89
|
*/
|
|
30
|
-
export const
|
|
90
|
+
export const allPointerDownEvents = ['pointerdown', 'mousedown', 'touchstart'];
|
|
91
|
+
/**
|
|
92
|
+
* @hidden
|
|
93
|
+
*/
|
|
94
|
+
export const allPointerMoveEvents = ['pointermove', 'mousemove', 'touchmove'];
|
|
95
|
+
/**
|
|
96
|
+
* @hidden
|
|
97
|
+
*/
|
|
98
|
+
export const allPointerUpEvents = ['pointerup', 'pointercancel', 'mouseup', 'contextmenu', 'touchend', 'touchcancel'];
|
|
@@ -7,12 +7,16 @@ import { NgModule } from '@angular/core';
|
|
|
7
7
|
import { DragTargetDirective } from './drag-and-drop/dragtarget.directive';
|
|
8
8
|
import { DragHandleDirective } from './drag-and-drop/draghandle.directive';
|
|
9
9
|
import { DropTargetDirective } from './drag-and-drop/droptarget.directive';
|
|
10
|
+
import { DragTargetContainerDirective } from './drag-and-drop/dragtarget-container.directive';
|
|
11
|
+
import { DropTargetContainerDirective } from './drag-and-drop/droptarget-container.directive';
|
|
10
12
|
import { HintComponent } from './drag-and-drop/hint.component';
|
|
11
13
|
import * as i0 from "@angular/core";
|
|
12
14
|
const EXPORTS = [
|
|
13
15
|
DragTargetDirective,
|
|
14
16
|
DragHandleDirective,
|
|
15
17
|
DropTargetDirective,
|
|
18
|
+
DragTargetContainerDirective,
|
|
19
|
+
DropTargetContainerDirective,
|
|
16
20
|
HintComponent
|
|
17
21
|
];
|
|
18
22
|
/**
|
|
@@ -52,9 +56,13 @@ DragAndDropModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versio
|
|
|
52
56
|
DragAndDropModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragAndDropModule, declarations: [DragTargetDirective,
|
|
53
57
|
DragHandleDirective,
|
|
54
58
|
DropTargetDirective,
|
|
59
|
+
DragTargetContainerDirective,
|
|
60
|
+
DropTargetContainerDirective,
|
|
55
61
|
HintComponent], imports: [CommonModule], exports: [DragTargetDirective,
|
|
56
62
|
DragHandleDirective,
|
|
57
63
|
DropTargetDirective,
|
|
64
|
+
DragTargetContainerDirective,
|
|
65
|
+
DropTargetContainerDirective,
|
|
58
66
|
HintComponent] });
|
|
59
67
|
DragAndDropModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragAndDropModule, imports: [[CommonModule]] });
|
|
60
68
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragAndDropModule, decorators: [{
|
package/esm2020/index.mjs
CHANGED
|
@@ -7,6 +7,9 @@ export { DragAndDropModule } from './drag-and-drop.module';
|
|
|
7
7
|
export { DragTargetDirective } from './drag-and-drop/dragtarget.directive';
|
|
8
8
|
export { DragHandleDirective } from './drag-and-drop/draghandle.directive';
|
|
9
9
|
export { DropTargetDirective } from './drag-and-drop/droptarget.directive';
|
|
10
|
+
export { DragTargetContainerDirective } from './drag-and-drop/dragtarget-container.directive';
|
|
11
|
+
export { DropTargetContainerDirective } from './drag-and-drop/droptarget-container.directive';
|
|
10
12
|
export { HintComponent } from './drag-and-drop/hint.component';
|
|
13
|
+
export * from './drag-and-drop/models/index';
|
|
14
|
+
export { DropTargetEvent } from './drag-and-drop/events';
|
|
11
15
|
export * from './drag-and-drop/events/drag-target';
|
|
12
|
-
export * from './drag-and-drop/events/drop-target';
|
|
@@ -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: '12.0.0-develop.
|
|
12
|
+
publishDate: 1681884386,
|
|
13
|
+
version: '12.0.0-develop.9',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|