@progress/kendo-angular-utils 17.0.0-develop.4 → 17.0.0-develop.41
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/README.md +27 -16
- package/drag-and-drop/dragtarget-container.directive.d.ts +1 -1
- package/drag-and-drop/dragtarget.directive.d.ts +1 -1
- package/drag-and-drop/droptarget-container.directive.d.ts +1 -1
- package/drag-and-drop/hint.component.d.ts +1 -1
- package/drag-and-drop/models/drag-axis.d.ts +1 -1
- package/drag-and-drop/models/drag-mode.d.ts +1 -1
- package/drag-and-drop/models/functions.d.ts +2 -2
- package/{esm2020 → esm2022}/drag-and-drop/drag-state.service.mjs +28 -24
- package/{esm2020 → esm2022}/drag-and-drop/draghandle.directive.mjs +5 -4
- package/{esm2020 → esm2022}/drag-and-drop/dragtarget-container.directive.mjs +90 -76
- package/{esm2020 → esm2022}/drag-and-drop/dragtarget.directive.mjs +92 -76
- package/{esm2020 → esm2022}/drag-and-drop/droptarget-container.directive.mjs +34 -30
- package/{esm2020 → esm2022}/drag-and-drop/droptarget.directive.mjs +23 -19
- package/{esm2020 → esm2022}/drag-and-drop/events/drag-target/drag-event.mjs +25 -5
- package/{esm2020 → esm2022}/drag-and-drop/events/drag-target/dragready-event.mjs +16 -0
- package/{esm2020 → esm2022}/drag-and-drop/events/drag-target/end-event.mjs +20 -4
- package/{esm2020 → esm2022}/drag-and-drop/events/drag-target/press-event.mjs +20 -4
- package/{esm2020 → esm2022}/drag-and-drop/events/drag-target/release-event.mjs +20 -4
- package/{esm2020 → esm2022}/drag-and-drop/events/drag-target/start-event.mjs +21 -5
- package/{esm2020 → esm2022}/drag-and-drop/events/drop-target-event.mjs +28 -4
- package/{esm2020 → esm2022}/drag-and-drop/hint.component.mjs +10 -5
- package/{esm2020 → esm2022}/drag-and-drop.module.mjs +4 -4
- package/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/{esm2020 → esm2022}/utils.module.mjs +4 -4
- package/{fesm2020 → fesm2022}/progress-kendo-angular-utils.mjs +443 -271
- package/package.json +11 -17
- package/fesm2015/progress-kendo-angular-utils.mjs +0 -2034
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/events/drag-target/index.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/events/index.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/models/autoscroll-options.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/models/coordinates.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/models/drag-axis.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/models/drag-mode.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/models/functions.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/models/hint-settings.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/models/index.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/models/scroll-direction.mjs +0 -0
- /package/{esm2020 → esm2022}/drag-and-drop/util.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-utils.mjs +0 -0
package/README.md
CHANGED
|
@@ -1,31 +1,42 @@
|
|
|
1
|
-
<a href="https://www.telerik.com/kendo-angular-ui/" target="_blank">
|
|
1
|
+
<a href="https://www.telerik.com/kendo-angular-ui/components/utils" target="_blank">
|
|
2
2
|
<img width="631" src="https://www.telerik.com/kendo-angular-ui/npm-banner.svg">
|
|
3
3
|
</a>
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Kendo UI for Angular Utilities Package
|
|
6
6
|
|
|
7
|
-
Kendo UI for Angular is a commercial UI library designed and built for developing business applications with Angular. Every UI component in the Kendo UI for Angular suite has been built from the ground-up specifically for Angular.
|
|
8
|
-
|
|
9
|
-
> **Important**
|
|
10
7
|
> * This package is part of the [Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/)—a commercial UI library.
|
|
11
|
-
> * You
|
|
12
|
-
> *
|
|
13
|
-
|
|
8
|
+
> * You must [install a license key](https://www.telerik.com/kendo-angular-ui/my-license) when adding the package to your project. To receive a license key, either [purchase a license](https://www.telerik.com/purchase/kendo-ui) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-angular-ui).
|
|
9
|
+
> * The 30-day free trial gives you access to all the Kendo UI for Angular components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Angular team!
|
|
10
|
+
|
|
11
|
+
The Kendo UI for Angular Utilities deliver a Drag and Drop functionality that can be used with Angular components or regular HTML elements to enhance their performance and functionality. The Drag and Drop is built from the ground up and specifically for Angular, so that you get high-performance controls which integrate tightly with your application and with the rest of the Kendo UI for Angular components.
|
|
12
|
+
|
|
13
|
+
## Key Features
|
|
14
|
+
|
|
15
|
+
Among the many features which the Kendo UI for Angular Drag and Drop delivers are:
|
|
16
|
+
|
|
17
|
+
* Drag Target—The [`DragTarget`](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/dragtarget) directive turns any HTML element or Angular component in a draggable item. This enables the user to change the position of the element by dragging it. The `DragTarget` can also be dropped on any [`DropTarget`](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/droptarget).
|
|
18
|
+
* Drop Target—The [`DropTarget`](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/droptarget) directive allows for any HTML element or Angular component to handle drag targets that dropped on it. The directive emits a number of events when a valid drag target interacts with it. This enables you to execute custom logic and fine tune the behavior.
|
|
19
|
+
* Drag Target Container—The [`DragTargetContainer`](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/drag-container) directive is an extended [`DragTarget`](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/dragtarget) directive. It enables you to configure multiple elements within а container as drag targets. Thе directive is also suitable when the drag target elements are not accessible in the template.
|
|
20
|
+
* Drop Target Container—The [`DropTargetContainer`](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/drop-container) directive is an extended [`DropTarget`](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/droptarget) directive. It enables you to configure multiple elements within the container as drop targets. This directive is also suitable when the drop target elements are not accessible in the template.
|
|
21
|
+
* Auto Scroll and Axis Lock—The Drag and Drop allows you to automatically scroll the nearest scrollable parent element while also providing an option to restrict the drag either to the horizontal or the vertical axis. Read more about the [auto scroll](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/autoscroll) and [axis lock](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/axis) features.
|
|
22
|
+
* Drag Hint—The Drag and Drop utility allows you to dynamically create and customize an element that can be used for the purpose of dragging instead of the drag target element itself. [Read more about the drag hint element...](https://www.telerik.com/kendo-angular-ui/components/utils/draganddrop/hint)
|
|
23
|
+
|
|
24
|
+
## Support Options
|
|
25
|
+
|
|
26
|
+
For any issues you might encounter while working with the Kendo UI for Angular Drag and Drop, you have the following support channels available:
|
|
27
|
+
|
|
28
|
+
* Industry-leading technical support—Kendo UI for Angular paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use the [dedicated Kendo UI for Angular support system](https://www.telerik.com/account/support-center/contact-us/technical-support).
|
|
29
|
+
* Product forums—The [Kendo UI for Angular forums](https://www.telerik.com/forums/kendo-angular-ui) are part of the free support you can get from the community and from the Kendo UI for Angular team.
|
|
30
|
+
* Feedback portal—The [Kendo UI for Angular feedback portal](https://feedback.telerik.com/kendo-angular-ui) is where you can request and vote for new features to be added.
|
|
14
31
|
|
|
15
32
|
## Resources
|
|
16
33
|
|
|
17
|
-
* [
|
|
34
|
+
* [Getting Started with Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/getting-started)
|
|
35
|
+
* [Getting Started with the Kendo UI for Angular Utilities](https://www.telerik.com/kendo-angular-ui/components/utils/installation/getting-started)
|
|
18
36
|
* [Demos, documentation, and component reference](https://www.telerik.com/kendo-angular-ui/components)
|
|
19
37
|
* [Blogs](http://www.telerik.com/blogs/kendo-ui)
|
|
20
38
|
* [Kendo UI for Angular pricing and licensing](https://www.telerik.com/purchase/kendo-ui)
|
|
21
39
|
|
|
22
|
-
## Questions and Feedback
|
|
23
|
-
|
|
24
|
-
* [Official Forums](https://www.telerik.com/forums/kendo-angular-ui)
|
|
25
|
-
* [GitHub Issues](https://github.com/telerik/kendo-angular/issues)
|
|
26
|
-
* [Feedback Portal](https://feedback.telerik.com/kendo-angular-ui)
|
|
27
|
-
* [StackOverflow](https://stackoverflow.com/questions/tagged/kendo-ui-angular2)
|
|
28
|
-
|
|
29
40
|
*Copyright © 2024 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.*
|
|
30
41
|
|
|
31
42
|
*Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
|
|
@@ -161,5 +161,5 @@ export declare class DragTargetContainerDirective implements AfterViewInit {
|
|
|
161
161
|
private calculatePosition;
|
|
162
162
|
private getStylesPerElement;
|
|
163
163
|
static ɵfac: i0.ɵɵFactoryDeclaration<DragTargetContainerDirective, never>;
|
|
164
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DragTargetContainerDirective, "[kendoDragTargetContainer]", ["kendoDragTargetContainer"], { "hint": "hint"; "dragTargetFilter": "dragTargetFilter"; "dragHandle": "dragHandle"; "dragDelay": "dragDelay"; "threshold": "threshold"; "dragTargetId": "dragTargetId"; "dragData": "dragData"; "dragDisabled": "dragDisabled"; "mode": "mode"; }, { "onDragReady": "onDragReady"; "onPress": "onPress"; "onDragStart": "onDragStart"; "onDrag": "onDrag"; "onRelease": "onRelease"; "onDragEnd": "onDragEnd"; }, never, never, true, never>;
|
|
164
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DragTargetContainerDirective, "[kendoDragTargetContainer]", ["kendoDragTargetContainer"], { "hint": { "alias": "hint"; "required": false; }; "dragTargetFilter": { "alias": "dragTargetFilter"; "required": false; }; "dragHandle": { "alias": "dragHandle"; "required": false; }; "dragDelay": { "alias": "dragDelay"; "required": false; }; "threshold": { "alias": "threshold"; "required": false; }; "dragTargetId": { "alias": "dragTargetId"; "required": false; }; "dragData": { "alias": "dragData"; "required": false; }; "dragDisabled": { "alias": "dragDisabled"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; }, { "onDragReady": "onDragReady"; "onPress": "onPress"; "onDragStart": "onDragStart"; "onDrag": "onDrag"; "onRelease": "onRelease"; "onDragEnd": "onDragEnd"; }, never, never, true, never>;
|
|
165
165
|
}
|
|
@@ -130,5 +130,5 @@ export declare class DragTargetDirective implements OnInit, AfterContentInit, On
|
|
|
130
130
|
private calculatePosition;
|
|
131
131
|
private getStylesPerElement;
|
|
132
132
|
static ɵfac: i0.ɵɵFactoryDeclaration<DragTargetDirective, never>;
|
|
133
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DragTargetDirective, "[kendoDragTarget]", ["kendoDragTarget"], { "hint": "hint"; "threshold": "threshold"; "autoScroll": "autoScroll"; "dragTargetId": "dragTargetId"; "dragDelay": "dragDelay"; "restrictByAxis": "restrictByAxis"; "mode": "mode"; "dragData": "dragData"; }, { "onPress": "onPress"; "onDragStart": "onDragStart"; "onDrag": "onDrag"; "onDragReady": "onDragReady"; "onRelease": "onRelease"; "onDragEnd": "onDragEnd"; }, ["dragHandles"], never, true, never>;
|
|
133
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DragTargetDirective, "[kendoDragTarget]", ["kendoDragTarget"], { "hint": { "alias": "hint"; "required": false; }; "threshold": { "alias": "threshold"; "required": false; }; "autoScroll": { "alias": "autoScroll"; "required": false; }; "dragTargetId": { "alias": "dragTargetId"; "required": false; }; "dragDelay": { "alias": "dragDelay"; "required": false; }; "restrictByAxis": { "alias": "restrictByAxis"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "dragData": { "alias": "dragData"; "required": false; }; }, { "onPress": "onPress"; "onDragStart": "onDragStart"; "onDrag": "onDrag"; "onDragReady": "onDragReady"; "onRelease": "onRelease"; "onDragEnd": "onDragEnd"; }, ["dragHandles"], never, true, never>;
|
|
134
134
|
}
|
|
@@ -84,5 +84,5 @@ export declare class DropTargetContainerDirective implements AfterViewInit {
|
|
|
84
84
|
private getDropIndex;
|
|
85
85
|
private clearPreviousTargets;
|
|
86
86
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropTargetContainerDirective, never>;
|
|
87
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DropTargetContainerDirective, "[kendoDropTargetContainer]", ["kendoDropTargetContainer"], { "dropTargetFilter": "dropTargetFilter"; "dropDisabled": "dropDisabled"; }, { "onDragEnter": "onDragEnter"; "onDragOver": "onDragOver"; "onDragLeave": "onDragLeave"; "onDrop": "onDrop"; }, never, never, true, never>;
|
|
87
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DropTargetContainerDirective, "[kendoDropTargetContainer]", ["kendoDropTargetContainer"], { "dropTargetFilter": { "alias": "dropTargetFilter"; "required": false; }; "dropDisabled": { "alias": "dropDisabled"; "required": false; }; }, { "onDragEnter": "onDragEnter"; "onDragOver": "onDragOver"; "onDragLeave": "onDragLeave"; "onDrop": "onDrop"; }, never, never, true, never>;
|
|
88
88
|
}
|
|
@@ -16,5 +16,5 @@ export declare class HintComponent {
|
|
|
16
16
|
pointerEvents: string;
|
|
17
17
|
constructor(element: ElementRef);
|
|
18
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<HintComponent, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HintComponent, "kendo-draghint", never, { "template": "template"; "directive": "directive"; "targetIndex": "targetIndex"; "contextData": "contextData"; }, {}, never, never, true, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HintComponent, "kendo-draghint", never, { "template": { "alias": "template"; "required": false; }; "directive": { "alias": "directive"; "required": false; }; "targetIndex": { "alias": "targetIndex"; "required": false; }; "contextData": { "alias": "contextData"; "required": false; }; }, {}, never, never, true, never>;
|
|
20
20
|
}
|
|
@@ -8,13 +8,13 @@
|
|
|
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
|
|
11
|
+
export 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
|
|
17
|
+
export type DragTargetIdFn = (args: DragTargetIdArgs) => any;
|
|
18
18
|
/**
|
|
19
19
|
* Represents the callback arguments used by the `dragData` property.
|
|
20
20
|
*/
|
|
@@ -11,29 +11,33 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
*/
|
|
12
12
|
export class DragStateService {
|
|
13
13
|
constructor() {
|
|
14
|
-
this.dragTarget = null;
|
|
15
|
-
this.dropTarget = null;
|
|
16
|
-
this.dragTargets = [];
|
|
17
|
-
this.dropTargets = [];
|
|
18
|
-
this.pressed = false;
|
|
19
|
-
this.ignoreMouse = false;
|
|
20
|
-
this.autoScroll = true;
|
|
21
|
-
this.isScrolling = false;
|
|
22
|
-
this.scrollableParent = null;
|
|
23
|
-
this.autoScrollDirection = { horizontal: true, vertical: true };
|
|
24
|
-
this.initialClientOffset = { x: 0, y: 0 };
|
|
25
|
-
this.clientOffset = { x: 0, y: 0 };
|
|
26
|
-
this.initialScrollOffset = { x: 0, y: 0 };
|
|
27
|
-
this.scrollOffset = { x: 0, y: 0 };
|
|
28
|
-
this.offset = { x: 0, y: 0 };
|
|
29
|
-
this.pageOffset = { x: 0, y: 0 };
|
|
30
|
-
this.velocity = { x: 0, y: 0 };
|
|
31
|
-
this.dragIndex = null;
|
|
32
|
-
this.dropIndex = null;
|
|
33
|
-
this.callbacks = {};
|
|
34
|
-
this.scrollInterval = null;
|
|
35
14
|
this.setCallbacks();
|
|
36
15
|
}
|
|
16
|
+
dragTarget = null;
|
|
17
|
+
dropTarget = null;
|
|
18
|
+
dragTargets = [];
|
|
19
|
+
dropTargets = [];
|
|
20
|
+
pressed = false;
|
|
21
|
+
ignoreMouse = false;
|
|
22
|
+
autoScroll = true;
|
|
23
|
+
isScrolling = false;
|
|
24
|
+
scrollableParent = null;
|
|
25
|
+
autoScrollDirection = { horizontal: true, vertical: true };
|
|
26
|
+
initialClientOffset = { x: 0, y: 0 };
|
|
27
|
+
clientOffset = { x: 0, y: 0 };
|
|
28
|
+
initialScrollOffset = { x: 0, y: 0 };
|
|
29
|
+
scrollOffset = { x: 0, y: 0 };
|
|
30
|
+
offset = { x: 0, y: 0 };
|
|
31
|
+
pageOffset = { x: 0, y: 0 };
|
|
32
|
+
velocity = { x: 0, y: 0 };
|
|
33
|
+
dragTargetDirective;
|
|
34
|
+
state;
|
|
35
|
+
dragIndex = null;
|
|
36
|
+
dropIndex = null;
|
|
37
|
+
dragData;
|
|
38
|
+
dragTargetId;
|
|
39
|
+
callbacks = {};
|
|
40
|
+
scrollInterval = null;
|
|
37
41
|
handleDragAndDrop(action) {
|
|
38
42
|
this.updateState();
|
|
39
43
|
dispatchDragAndDrop(this.state, action, this.callbacks);
|
|
@@ -124,10 +128,10 @@ export class DragStateService {
|
|
|
124
128
|
this.scrollInterval = null;
|
|
125
129
|
}
|
|
126
130
|
}
|
|
131
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
132
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragStateService, providedIn: 'root' });
|
|
127
133
|
}
|
|
128
|
-
|
|
129
|
-
DragStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragStateService, providedIn: 'root' });
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragStateService, decorators: [{
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragStateService, decorators: [{
|
|
131
135
|
type: Injectable,
|
|
132
136
|
args: [{
|
|
133
137
|
providedIn: 'root'
|
|
@@ -9,14 +9,15 @@ import * as i0 from "@angular/core";
|
|
|
9
9
|
* It is used to specify a concrete element within a drag target as a handle for dragging, instead the drag target itself.
|
|
10
10
|
*/
|
|
11
11
|
export class DragHandleDirective {
|
|
12
|
+
element;
|
|
12
13
|
constructor(element) {
|
|
13
14
|
this.element = element;
|
|
14
|
-
this.cursorStyle = 'move';
|
|
15
15
|
}
|
|
16
|
+
cursorStyle = 'move';
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragHandleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
18
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DragHandleDirective, isStandalone: true, selector: "[kendoDragHandle]", host: { properties: { "style.cursor": "this.cursorStyle" } }, exportAs: ["kendoDragHandle"], ngImport: i0 });
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
DragHandleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragHandleDirective, isStandalone: true, selector: "[kendoDragHandle]", host: { properties: { "style.cursor": "this.cursorStyle" } }, exportAs: ["kendoDragHandle"], ngImport: i0 });
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragHandleDirective, decorators: [{
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragHandleDirective, decorators: [{
|
|
20
21
|
type: Directive,
|
|
21
22
|
args: [{
|
|
22
23
|
selector: '[kendoDragHandle]',
|
|
@@ -29,79 +29,18 @@ let isDragPrevented = false;
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export class DragTargetContainerDirective {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.hint = false;
|
|
45
|
-
/**
|
|
46
|
-
* Defines the delay in milliseconds after which the drag will begin ([see example](slug:drag_target_container#toc-events)).
|
|
47
|
-
*
|
|
48
|
-
* @default 0
|
|
49
|
-
*/
|
|
50
|
-
this.dragDelay = 0;
|
|
51
|
-
/**
|
|
52
|
-
* The number of pixels the pointer moves in any direction before the dragging starts ([see example]({% slug minimum_distance %})).
|
|
53
|
-
*
|
|
54
|
-
* @default 0
|
|
55
|
-
*/
|
|
56
|
-
this.threshold = 0;
|
|
57
|
-
/**
|
|
58
|
-
* Specifies whether the default dragging behavior will be performed or the developer will manually handle the drag action.
|
|
59
|
-
*
|
|
60
|
-
* @default 'auto'
|
|
61
|
-
*/
|
|
62
|
-
this.mode = 'auto';
|
|
63
|
-
/**
|
|
64
|
-
* Fires when a DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
65
|
-
*/
|
|
66
|
-
this.onDragReady = new EventEmitter();
|
|
67
|
-
/**
|
|
68
|
-
* Fires when the user presses a DragTarget element.
|
|
69
|
-
*/
|
|
70
|
-
this.onPress = new EventEmitter();
|
|
71
|
-
/**
|
|
72
|
-
* Fires when the dragging of a DragTarget element begins.
|
|
73
|
-
*/
|
|
74
|
-
this.onDragStart = new EventEmitter();
|
|
75
|
-
/**
|
|
76
|
-
* Fires while the user drags a DragTarget element.
|
|
77
|
-
*/
|
|
78
|
-
this.onDrag = new EventEmitter();
|
|
79
|
-
/**
|
|
80
|
-
* Fires when the user releases a DragTarget element after being pressed.
|
|
81
|
-
*/
|
|
82
|
-
this.onRelease = new EventEmitter();
|
|
83
|
-
/**
|
|
84
|
-
* Fires when the dragging of a DragTarget ends and the element is released.
|
|
85
|
-
*/
|
|
86
|
-
this.onDragEnd = new EventEmitter();
|
|
87
|
-
this.currentDragTarget = null;
|
|
88
|
-
this.dragTimeout = null;
|
|
89
|
-
this.pressed = false;
|
|
90
|
-
this.dragStarted = false;
|
|
91
|
-
this.hintComponent = null;
|
|
92
|
-
this.defaultHint = null;
|
|
93
|
-
this.currentDragTargetElement = null;
|
|
94
|
-
this.scrollableParent = null;
|
|
95
|
-
this.previousDragTargets = [];
|
|
96
|
-
this.initialPosition = { x: 0, y: 0 };
|
|
97
|
-
this.position = { x: 0, y: 0 };
|
|
98
|
-
this.positionsMap = new Map();
|
|
99
|
-
this._dragTargetFilter = null;
|
|
100
|
-
this._dragDisabled = false;
|
|
101
|
-
this._dragData = () => null;
|
|
102
|
-
this._dragTargetId = () => null;
|
|
103
|
-
validatePackage(packageMetadata);
|
|
104
|
-
}
|
|
32
|
+
wrapper;
|
|
33
|
+
ngZone;
|
|
34
|
+
renderer;
|
|
35
|
+
service;
|
|
36
|
+
viewContainer;
|
|
37
|
+
cdr;
|
|
38
|
+
/**
|
|
39
|
+
* 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 %})).
|
|
40
|
+
*
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
hint = false;
|
|
105
44
|
/**
|
|
106
45
|
* Specifies a selector for elements within a container which will be configured as draggable
|
|
107
46
|
* ([see example]({% slug drag_target_container %})). The possible values include any
|
|
@@ -116,6 +55,22 @@ export class DragTargetContainerDirective {
|
|
|
116
55
|
get dragTargetFilter() {
|
|
117
56
|
return this._dragTargetFilter;
|
|
118
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Specifies a selector for elements within each DragTarget which will be configured as drag handles.
|
|
60
|
+
*/
|
|
61
|
+
dragHandle;
|
|
62
|
+
/**
|
|
63
|
+
* Defines the delay in milliseconds after which the drag will begin ([see example](slug:drag_target_container#toc-events)).
|
|
64
|
+
*
|
|
65
|
+
* @default 0
|
|
66
|
+
*/
|
|
67
|
+
dragDelay = 0;
|
|
68
|
+
/**
|
|
69
|
+
* The number of pixels the pointer moves in any direction before the dragging starts ([see example]({% slug minimum_distance %})).
|
|
70
|
+
*
|
|
71
|
+
* @default 0
|
|
72
|
+
*/
|
|
73
|
+
threshold = 0;
|
|
119
74
|
/**
|
|
120
75
|
* Defines a unique identifier for each drag target.
|
|
121
76
|
* It exposes the current DragTarget HTML element and its index in the collection of drag targets as arguments.
|
|
@@ -166,6 +121,36 @@ export class DragTargetContainerDirective {
|
|
|
166
121
|
get dragDisabled() {
|
|
167
122
|
return this._dragDisabled;
|
|
168
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Specifies whether the default dragging behavior will be performed or the developer will manually handle the drag action.
|
|
126
|
+
*
|
|
127
|
+
* @default 'auto'
|
|
128
|
+
*/
|
|
129
|
+
mode = 'auto';
|
|
130
|
+
/**
|
|
131
|
+
* Fires when a DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
132
|
+
*/
|
|
133
|
+
onDragReady = new EventEmitter();
|
|
134
|
+
/**
|
|
135
|
+
* Fires when the user presses a DragTarget element.
|
|
136
|
+
*/
|
|
137
|
+
onPress = new EventEmitter();
|
|
138
|
+
/**
|
|
139
|
+
* Fires when the dragging of a DragTarget element begins.
|
|
140
|
+
*/
|
|
141
|
+
onDragStart = new EventEmitter();
|
|
142
|
+
/**
|
|
143
|
+
* Fires while the user drags a DragTarget element.
|
|
144
|
+
*/
|
|
145
|
+
onDrag = new EventEmitter();
|
|
146
|
+
/**
|
|
147
|
+
* Fires when the user releases a DragTarget element after being pressed.
|
|
148
|
+
*/
|
|
149
|
+
onRelease = new EventEmitter();
|
|
150
|
+
/**
|
|
151
|
+
* Fires when the dragging of a DragTarget ends and the element is released.
|
|
152
|
+
*/
|
|
153
|
+
onDragEnd = new EventEmitter();
|
|
169
154
|
/**
|
|
170
155
|
* Used for notifying the DragTargetContainer that its content has changed.
|
|
171
156
|
*/
|
|
@@ -173,6 +158,26 @@ export class DragTargetContainerDirective {
|
|
|
173
158
|
this.cdr.detectChanges();
|
|
174
159
|
this.initializeDragTargets();
|
|
175
160
|
}
|
|
161
|
+
pointerDownSubscription;
|
|
162
|
+
pointerMoveSubscription;
|
|
163
|
+
pointerUpSubscription;
|
|
164
|
+
scrollSubscription;
|
|
165
|
+
currentDragTarget = null;
|
|
166
|
+
dragTimeout = null;
|
|
167
|
+
pressed = false;
|
|
168
|
+
dragStarted = false;
|
|
169
|
+
hintComponent = null;
|
|
170
|
+
defaultHint = null;
|
|
171
|
+
currentDragTargetElement = null;
|
|
172
|
+
scrollableParent = null;
|
|
173
|
+
previousDragTargets = [];
|
|
174
|
+
initialPosition = { x: 0, y: 0 };
|
|
175
|
+
position = { x: 0, y: 0 };
|
|
176
|
+
positionsMap = new Map();
|
|
177
|
+
_dragTargetFilter = null;
|
|
178
|
+
_dragDisabled = false;
|
|
179
|
+
_dragData = () => null;
|
|
180
|
+
_dragTargetId = () => null;
|
|
176
181
|
get allDragTargets() {
|
|
177
182
|
return this.queryHost(this.dragTargetFilter);
|
|
178
183
|
}
|
|
@@ -182,6 +187,15 @@ export class DragTargetContainerDirective {
|
|
|
182
187
|
get hintTemplate() {
|
|
183
188
|
return isPresent(this.hint) && typeof this.hint === 'object' ? this.hint.hintTemplate : null;
|
|
184
189
|
}
|
|
190
|
+
constructor(wrapper, ngZone, renderer, service, viewContainer, cdr) {
|
|
191
|
+
this.wrapper = wrapper;
|
|
192
|
+
this.ngZone = ngZone;
|
|
193
|
+
this.renderer = renderer;
|
|
194
|
+
this.service = service;
|
|
195
|
+
this.viewContainer = viewContainer;
|
|
196
|
+
this.cdr = cdr;
|
|
197
|
+
validatePackage(packageMetadata);
|
|
198
|
+
}
|
|
185
199
|
ngAfterViewInit() {
|
|
186
200
|
const isTargetPresent = isPresent(this.wrapper) || isPresent(this.currentDragTarget);
|
|
187
201
|
if (!this.dragDisabled && isTargetPresent) {
|
|
@@ -590,10 +604,10 @@ export class DragTargetContainerDirective {
|
|
|
590
604
|
};
|
|
591
605
|
}
|
|
592
606
|
}
|
|
607
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragTargetContainerDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.DragStateService }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
608
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DragTargetContainerDirective, isStandalone: true, 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 });
|
|
593
609
|
}
|
|
594
|
-
|
|
595
|
-
DragTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragTargetContainerDirective, isStandalone: true, 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 });
|
|
596
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragTargetContainerDirective, decorators: [{
|
|
610
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragTargetContainerDirective, decorators: [{
|
|
597
611
|
type: Directive,
|
|
598
612
|
args: [{
|
|
599
613
|
selector: '[kendoDragTargetContainer]',
|
|
@@ -22,79 +22,49 @@ let isDragPrevented = false;
|
|
|
22
22
|
* Represents the Kendo UI DragTarget directive for Angular.
|
|
23
23
|
*/
|
|
24
24
|
export class DragTargetDirective {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.onDragStart = new EventEmitter();
|
|
69
|
-
/**
|
|
70
|
-
* Fires while the user drags the DragTarget element.
|
|
71
|
-
*/
|
|
72
|
-
this.onDrag = new EventEmitter();
|
|
73
|
-
/**
|
|
74
|
-
* Fires when the DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
75
|
-
*/
|
|
76
|
-
this.onDragReady = new EventEmitter();
|
|
77
|
-
/**
|
|
78
|
-
* Fires when the user releases the DragTarget element after being pressed.
|
|
79
|
-
*/
|
|
80
|
-
this.onRelease = new EventEmitter();
|
|
81
|
-
/**
|
|
82
|
-
* Fires when the dragging of the DragTarget ends and the element is released.
|
|
83
|
-
*/
|
|
84
|
-
this.onDragEnd = new EventEmitter();
|
|
85
|
-
this.dragTarget = null;
|
|
86
|
-
this.domSubscriptions = [];
|
|
87
|
-
this.hintComponent = null;
|
|
88
|
-
this.dragStarted = false;
|
|
89
|
-
this.pressed = false;
|
|
90
|
-
this.dragTimeout = null;
|
|
91
|
-
this.initialPosition = { x: 0, y: 0 };
|
|
92
|
-
this.position = { x: 0, y: 0 };
|
|
93
|
-
this.scrollableParent = null;
|
|
94
|
-
this.defaultHint = null;
|
|
95
|
-
this._dragData = () => null;
|
|
96
|
-
validatePackage(packageMetadata);
|
|
97
|
-
}
|
|
25
|
+
element;
|
|
26
|
+
renderer;
|
|
27
|
+
ngZone;
|
|
28
|
+
service;
|
|
29
|
+
viewContainer;
|
|
30
|
+
/**
|
|
31
|
+
* Defines whether a hint will be used for dragging. By default, the hint is a copy of the drag target. ([see example]({% slug drag_hint %})).
|
|
32
|
+
*
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
hint = false;
|
|
36
|
+
/**
|
|
37
|
+
* The number of pixels the pointer moves in any direction before the dragging starts ([see example]({% slug minimum_distance %})). Applicable when `manualDrag` is set to `false`.
|
|
38
|
+
*
|
|
39
|
+
* @default 0
|
|
40
|
+
*/
|
|
41
|
+
threshold = 0;
|
|
42
|
+
/**
|
|
43
|
+
* Defines the automatic container scrolling behavior when close to the edge ([see example]({% slug auto_scroll %})).
|
|
44
|
+
*
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
autoScroll = true;
|
|
48
|
+
/**
|
|
49
|
+
* Defines a unique identifier for the dragTarget.
|
|
50
|
+
*/
|
|
51
|
+
dragTargetId;
|
|
52
|
+
/**
|
|
53
|
+
* Defines the delay in milliseconds after which the drag will begin ([see example]({% slug drag_delay %})).
|
|
54
|
+
*
|
|
55
|
+
* @default 0
|
|
56
|
+
*/
|
|
57
|
+
dragDelay = 0;
|
|
58
|
+
/**
|
|
59
|
+
* Restricts the element to be dragged horizontally or vertically only ([see example]({% slug axis_lock %})). Applicable when `mode` is set to `auto`.
|
|
60
|
+
*/
|
|
61
|
+
restrictByAxis;
|
|
62
|
+
/**
|
|
63
|
+
* Specifies whether the default dragging behavior will be performed or the developer will manually handle the drag action.
|
|
64
|
+
*
|
|
65
|
+
* @default 'auto'
|
|
66
|
+
*/
|
|
67
|
+
mode = 'auto';
|
|
98
68
|
/**
|
|
99
69
|
* Defines a callback function used for attaching custom data to the dragTarget.
|
|
100
70
|
* The data will be available in the events of the respective [`DropTarget`]({% slug api_utils_droptargetdirective %}) or [`DropTargetContainer`]({% slug api_utils_droptargetcontainerdirective %}) directives.
|
|
@@ -109,6 +79,41 @@ export class DragTargetDirective {
|
|
|
109
79
|
get dragData() {
|
|
110
80
|
return this._dragData;
|
|
111
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Fires when the user presses the DragTarget element.
|
|
84
|
+
*/
|
|
85
|
+
onPress = new EventEmitter();
|
|
86
|
+
/**
|
|
87
|
+
* Fires when the dragging of the DragTarget element begins.
|
|
88
|
+
*/
|
|
89
|
+
onDragStart = new EventEmitter();
|
|
90
|
+
/**
|
|
91
|
+
* Fires while the user drags the DragTarget element.
|
|
92
|
+
*/
|
|
93
|
+
onDrag = new EventEmitter();
|
|
94
|
+
/**
|
|
95
|
+
* Fires when the DragTarget's `dragDelay` has passed and the user is able to drag the element.
|
|
96
|
+
*/
|
|
97
|
+
onDragReady = new EventEmitter();
|
|
98
|
+
/**
|
|
99
|
+
* Fires when the user releases the DragTarget element after being pressed.
|
|
100
|
+
*/
|
|
101
|
+
onRelease = new EventEmitter();
|
|
102
|
+
/**
|
|
103
|
+
* Fires when the dragging of the DragTarget ends and the element is released.
|
|
104
|
+
*/
|
|
105
|
+
onDragEnd = new EventEmitter();
|
|
106
|
+
dragTarget = null;
|
|
107
|
+
domSubscriptions = [];
|
|
108
|
+
hintComponent = null;
|
|
109
|
+
dragStarted = false;
|
|
110
|
+
pressed = false;
|
|
111
|
+
dragTimeout = null;
|
|
112
|
+
initialPosition = { x: 0, y: 0 };
|
|
113
|
+
position = { x: 0, y: 0 };
|
|
114
|
+
scrollableParent = null;
|
|
115
|
+
defaultHint = null;
|
|
116
|
+
_dragData = () => null;
|
|
112
117
|
get hintTemplate() {
|
|
113
118
|
return isPresent(this.hint) && typeof this.hint === 'object' ? this.hint.hintTemplate : null;
|
|
114
119
|
}
|
|
@@ -141,6 +146,15 @@ export class DragTargetDirective {
|
|
|
141
146
|
this.service.handleDragAndDrop(action);
|
|
142
147
|
this.attachDomHandlers();
|
|
143
148
|
}
|
|
149
|
+
dragHandles;
|
|
150
|
+
constructor(element, renderer, ngZone, service, viewContainer) {
|
|
151
|
+
this.element = element;
|
|
152
|
+
this.renderer = renderer;
|
|
153
|
+
this.ngZone = ngZone;
|
|
154
|
+
this.service = service;
|
|
155
|
+
this.viewContainer = viewContainer;
|
|
156
|
+
validatePackage(packageMetadata);
|
|
157
|
+
}
|
|
144
158
|
ngOnInit() {
|
|
145
159
|
this.initializeDragTarget();
|
|
146
160
|
}
|
|
@@ -155,6 +169,8 @@ export class DragTargetDirective {
|
|
|
155
169
|
}
|
|
156
170
|
ngOnDestroy() {
|
|
157
171
|
this.domSubscriptions.forEach(subscription => subscription());
|
|
172
|
+
const currentDragTargetIndex = this.service.dragTargets.indexOf(this.dragTarget);
|
|
173
|
+
this.service.dragTargets.splice(currentDragTargetIndex, 1);
|
|
158
174
|
}
|
|
159
175
|
handlePress(event) {
|
|
160
176
|
if (this.dragDelay > 0) {
|
|
@@ -460,10 +476,10 @@ export class DragTargetDirective {
|
|
|
460
476
|
};
|
|
461
477
|
}
|
|
462
478
|
}
|
|
479
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragTargetDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.DragStateService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
480
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DragTargetDirective, isStandalone: true, 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 });
|
|
463
481
|
}
|
|
464
|
-
|
|
465
|
-
DragTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragTargetDirective, isStandalone: true, 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 });
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragTargetDirective, decorators: [{
|
|
482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragTargetDirective, decorators: [{
|
|
467
483
|
type: Directive,
|
|
468
484
|
args: [{
|
|
469
485
|
selector: '[kendoDragTarget]',
|