@progress/kendo-angular-treeview 19.1.2-develop.1 → 19.1.2-develop.3
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/check-mode.d.ts +4 -3
- package/check.directive.d.ts +20 -9
- package/checkable-settings.d.ts +14 -19
- package/checkbox/checked-state.d.ts +1 -1
- package/directives.d.ts +15 -1
- package/disable.directive.d.ts +1 -1
- package/drag-and-drop/drag-and-drop-editing.directive.d.ts +20 -8
- package/drag-and-drop/drag-and-drop.directive.d.ts +29 -20
- package/drag-and-drop/drag-clue/drag-clue-template.directive.d.ts +16 -9
- package/drag-and-drop/drop-hint/drop-hint-template.directive.d.ts +16 -7
- package/drag-and-drop/models/drop-action.d.ts +17 -2
- package/drag-and-drop/models/drop-position.d.ts +10 -1
- package/drag-and-drop/models/editing-service.d.ts +6 -6
- package/drag-and-drop/models/scroll-settings.d.ts +6 -6
- package/drag-and-drop/models/tree-item-filter-state.d.ts +11 -10
- package/drag-and-drop/models/treeitem-add-remove-args.d.ts +7 -7
- package/drag-and-drop/models/treeitem-drag-event.d.ts +5 -5
- package/drag-and-drop/models/treeitem-drag-start-event.d.ts +3 -3
- package/drag-and-drop/models/treeitem-drop-event.d.ts +10 -11
- package/esm2022/check.directive.mjs +20 -9
- package/esm2022/directives.mjs +15 -1
- package/esm2022/disable.directive.mjs +1 -1
- package/esm2022/drag-and-drop/drag-and-drop-editing.directive.mjs +20 -8
- package/esm2022/drag-and-drop/drag-and-drop.directive.mjs +29 -20
- package/esm2022/drag-and-drop/drag-clue/drag-clue-template.directive.mjs +16 -9
- package/esm2022/drag-and-drop/drop-hint/drop-hint-template.directive.mjs +16 -7
- package/esm2022/drag-and-drop/models/drop-action.mjs +17 -2
- package/esm2022/drag-and-drop/models/drop-position.mjs +10 -1
- package/esm2022/drag-and-drop/models/treeitem-drag-event.mjs +5 -5
- package/esm2022/drag-and-drop/models/treeitem-drag-start-event.mjs +3 -3
- package/esm2022/drag-and-drop/models/treeitem-drop-event.mjs +10 -11
- package/esm2022/expand.directive.mjs +19 -8
- package/esm2022/flat-binding.directive.mjs +19 -4
- package/esm2022/hierarchy-binding.directive.mjs +18 -4
- package/esm2022/load-more/load-more-button-template.directive.mjs +14 -6
- package/esm2022/load-more/load-more.directive.mjs +25 -13
- package/esm2022/localization/custom-messages.component.mjs +10 -1
- package/esm2022/localization/messages.mjs +1 -1
- package/esm2022/node-template.directive.mjs +14 -46
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/selection/select.directive.mjs +19 -8
- package/esm2022/treeview.component.mjs +73 -129
- package/esm2022/treeview.module.mjs +15 -0
- package/expand.directive.d.ts +19 -8
- package/fesm2022/progress-kendo-angular-treeview.mjs +391 -299
- package/filter-expand-settings.interface.d.ts +13 -12
- package/filter-state.interface.d.ts +6 -6
- package/flat-binding.directive.d.ts +19 -4
- package/hierarchy-binding.directive.d.ts +18 -4
- package/load-more/load-more-button-template.directive.d.ts +14 -6
- package/load-more/load-more-request-args.d.ts +6 -7
- package/load-more/load-more.directive.d.ts +25 -13
- package/localization/custom-messages.component.d.ts +10 -1
- package/localization/messages.d.ts +1 -1
- package/node-click-event.interface.d.ts +4 -4
- package/node-template.directive.d.ts +14 -46
- package/package.json +7 -7
- package/schematics/ngAdd/index.js +4 -4
- package/selection/select.directive.d.ts +19 -8
- package/selection/selectable-settings.d.ts +5 -49
- package/selection/selection-mode.d.ts +3 -42
- package/size.d.ts +1 -1
- package/treeitem-lookup.interface.d.ts +9 -8
- package/treeitem.interface.d.ts +3 -3
- package/treeview-filter-settings.d.ts +13 -23
- package/treeview.component.d.ts +73 -129
- package/treeview.module.d.ts +15 -0
|
@@ -8,31 +8,31 @@ import { DropPosition } from './drop-position';
|
|
|
8
8
|
import { PreventableEvent } from './preventable-event';
|
|
9
9
|
import { TreeItemAddRemoveArgs } from './treeitem-add-remove-args';
|
|
10
10
|
/**
|
|
11
|
-
* Arguments for the TreeView [`nodeDrop`](
|
|
11
|
+
* Arguments for the TreeView [`nodeDrop`](slug:api_treeview_treeviewcomponent#nodedrop) event.
|
|
12
12
|
*/
|
|
13
13
|
export declare class TreeItemDropEvent extends PreventableEvent implements TreeItemAddRemoveArgs {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Reference to the TreeView from which the dragged item originates.
|
|
16
16
|
*/
|
|
17
17
|
sourceTree: TreeViewComponent;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Reference to the TreeView onto which the dragged item is dropped.
|
|
20
20
|
*/
|
|
21
21
|
destinationTree: TreeViewComponent;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Lookup information for the dragged item.
|
|
24
24
|
*/
|
|
25
25
|
sourceItem: TreeItemLookup;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Lookup information for the item onto which the dragged item is dropped.
|
|
28
28
|
*/
|
|
29
29
|
destinationItem: TreeItemLookup;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Represents the drop position relative to the target item.
|
|
32
32
|
*/
|
|
33
33
|
dropPosition: DropPosition;
|
|
34
34
|
/**
|
|
35
|
-
* The original pointer event
|
|
35
|
+
* The original pointer event containing details about the pointer position.
|
|
36
36
|
*/
|
|
37
37
|
originalEvent: PointerEvent;
|
|
38
38
|
/**
|
|
@@ -44,10 +44,9 @@ export declare class TreeItemDropEvent extends PreventableEvent implements TreeI
|
|
|
44
44
|
*/
|
|
45
45
|
constructor(initializer: TreeItemAddRemoveArgs, originalEvent: PointerEvent);
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
* If set to `false`, the
|
|
49
|
-
*
|
|
50
|
-
* will be animated back to the source item to indicate the action is marked as invalid.
|
|
47
|
+
* Sets whether the drop action is valid.
|
|
48
|
+
* If set to `false`, the `addItem` and `removeItem` events will not be fired and the drag clue
|
|
49
|
+
* will animate back to the source item to indicate the action is invalid.
|
|
51
50
|
*/
|
|
52
51
|
setValid(isValid: boolean): void;
|
|
53
52
|
}
|
|
@@ -28,8 +28,18 @@ const matchKey = index => k => {
|
|
|
28
28
|
}, { key: "", result: false }).result;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
* ([see example](
|
|
31
|
+
* Represents a directive that manages the in-memory checked state of the TreeView node
|
|
32
|
+
* ([see example](slug:checkboxes_treeview)).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```html
|
|
36
|
+
* <kendo-treeview
|
|
37
|
+
* kendoTreeViewCheckable
|
|
38
|
+
* checkBy="id"
|
|
39
|
+
* [(checkedKeys)]="checkedKeys"
|
|
40
|
+
* [nodes]="data">
|
|
41
|
+
* </kendo-treeview
|
|
42
|
+
* ```
|
|
33
43
|
*/
|
|
34
44
|
export class CheckDirective {
|
|
35
45
|
treeView;
|
|
@@ -41,21 +51,22 @@ export class CheckDirective {
|
|
|
41
51
|
this.treeView.isChecked = value;
|
|
42
52
|
}
|
|
43
53
|
/**
|
|
44
|
-
* Defines the item key
|
|
54
|
+
* Defines the item key stored in the `checkedKeys` collection.
|
|
45
55
|
*/
|
|
46
56
|
checkKey;
|
|
47
57
|
/**
|
|
48
|
-
* Defines the collection that
|
|
49
|
-
* ([see example](
|
|
58
|
+
* Defines the collection that stores the checked keys
|
|
59
|
+
* ([see example](slug:checkboxes_treeview)).
|
|
50
60
|
*/
|
|
51
61
|
checkedKeys;
|
|
52
62
|
/**
|
|
53
|
-
* Defines the checkable settings
|
|
54
|
-
*
|
|
63
|
+
* Defines the checkable settings
|
|
64
|
+
* ([see example](slug:checkboxes_treeview#setup)).
|
|
65
|
+
* If you do not provide a value, the default [`CheckableSettings`](slug:api_treeview_checkablesettings) apply.
|
|
55
66
|
*/
|
|
56
67
|
checkable;
|
|
57
68
|
/**
|
|
58
|
-
* Fires when the `checkedKeys` collection
|
|
69
|
+
* Fires when the `checkedKeys` collection updates.
|
|
59
70
|
*/
|
|
60
71
|
checkedKeysChange = new EventEmitter();
|
|
61
72
|
subscriptions = new Subscription();
|
|
@@ -80,7 +91,7 @@ export class CheckDirective {
|
|
|
80
91
|
'single': (e) => this.checkSingle(e)
|
|
81
92
|
};
|
|
82
93
|
/**
|
|
83
|
-
*
|
|
94
|
+
* Reflects the internal `checkedKeys` state.
|
|
84
95
|
*/
|
|
85
96
|
state = new Set();
|
|
86
97
|
clickSubscription;
|
package/esm2022/directives.mjs
CHANGED
|
@@ -18,7 +18,21 @@ import { NodeTemplateDirective } from "./node-template.directive";
|
|
|
18
18
|
import { SelectDirective } from "./selection/select.directive";
|
|
19
19
|
import { TreeViewComponent } from "./treeview.component";
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Use the `KENDO_TREEVIEW ` utility array to add all `@progress/kendo-angular-treeview` related components and directives to a standalone Angular component.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { Component } from '@angular/core';
|
|
26
|
+
* import { KENDO_TREEVIEW } from '@progress/kendo-angular-treeview';
|
|
27
|
+
*
|
|
28
|
+
* @Component({
|
|
29
|
+
* selector: 'my-app',
|
|
30
|
+
* standalone: true,
|
|
31
|
+
* imports: [KENDO_TREEVIEW],
|
|
32
|
+
* template: `<kendo-treeview></kendo-treeview>`
|
|
33
|
+
* })
|
|
34
|
+
* export class AppComponent {}
|
|
35
|
+
* ```
|
|
22
36
|
*/
|
|
23
37
|
export const KENDO_TREEVIEW = [
|
|
24
38
|
TreeViewComponent,
|
|
@@ -7,7 +7,7 @@ import { TreeViewComponent } from './treeview.component';
|
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
import * as i1 from "./treeview.component";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Represents a directive which manages the disabled in-memory state of the TreeView node
|
|
11
11
|
* ([see example]({% slug disabledstate_treeview %})).
|
|
12
12
|
*/
|
|
13
13
|
export class DisableDirective {
|
|
@@ -9,19 +9,31 @@ import { isPresent } from '../utils';
|
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
import * as i1 from "../treeview.component";
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Represents the directive that enables you to update the initially provided data array during drag-and-drop.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* or [`kendoTreeViewFlatDataBinding`](
|
|
16
|
-
* your own [`editService`](
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* Use this directive with one of the data-binding directives ([`kendoTreeViewHierarchyBinding`](slug:api_treeview_hierarchybindingdirective)
|
|
15
|
+
* or [`kendoTreeViewFlatDataBinding`](slug:api_treeview_flatdatabindingdirective)), which set their own edit handlers, or provide
|
|
16
|
+
* your own [`editService`](slug:api_treeview_editservice) to this directive.
|
|
17
|
+
*
|
|
18
|
+
* Providing a custom `editService` allows you to handle the
|
|
19
|
+
* [`addItem`](slug:api_treeview_treeviewcomponent#additem) and [`removeItem`](slug:api_treeview_treeviewcomponent#removeitem)
|
|
20
|
+
* events when they are triggered by the TreeView component.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```html
|
|
24
|
+
* <kendo-treeview
|
|
25
|
+
* kendoTreeViewDragAndDrop
|
|
26
|
+
* kendoTreeViewDragAndDropEditing
|
|
27
|
+
* [nodes]="nodes"
|
|
28
|
+
* textField="text">
|
|
29
|
+
* </kendo-treeview>
|
|
30
|
+
* ```
|
|
19
31
|
*/
|
|
20
32
|
export class DragAndDropEditingDirective {
|
|
21
33
|
treeview;
|
|
22
34
|
/**
|
|
23
|
-
* Specifies the handlers called on drag-and-drop [`addItem`](
|
|
24
|
-
* and [`removeItem`](
|
|
35
|
+
* Specifies the handlers called on drag-and-drop [`addItem`](slug:api_treeview_treeviewcomponent#additem)
|
|
36
|
+
* and [`removeItem`](slug:api_treeview_treeviewcomponent#removeitem) events.
|
|
25
37
|
*/
|
|
26
38
|
set editService(service) {
|
|
27
39
|
this.treeview.editService = service;
|
|
@@ -23,16 +23,25 @@ const DEFAULT_SCROLL_SETTINGS = {
|
|
|
23
23
|
interval: 1
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* ([see example](
|
|
26
|
+
* Represents the directive that enables you to drag and drop items inside the current TreeView or between multiple linked TreeView component instances
|
|
27
|
+
* ([see example](slug:draganddrop_treeview)).
|
|
28
28
|
*
|
|
29
|
-
* Triggers the [`nodeDragStart`](
|
|
30
|
-
* [`nodeDrag`](
|
|
31
|
-
* [`nodeDrop`](
|
|
32
|
-
* [`nodeDragEnd`](
|
|
33
|
-
* [`addItem`](
|
|
34
|
-
* [`removeItem`](
|
|
35
|
-
* events when the corresponding actions
|
|
29
|
+
* Triggers the [`nodeDragStart`](slug:api_treeview_treeviewcomponent#nodedragstart),
|
|
30
|
+
* [`nodeDrag`](slug:api_treeview_treeviewcomponent#nodedrag),
|
|
31
|
+
* [`nodeDrop`](slug:api_treeview_treeviewcomponent#nodedrop),
|
|
32
|
+
* [`nodeDragEnd`](slug:api_treeview_treeviewcomponent#nodedragend),
|
|
33
|
+
* [`addItem`](slug:api_treeview_treeviewcomponent#additem) and
|
|
34
|
+
* [`removeItem`](slug:api_treeview_treeviewcomponent#removeitem)
|
|
35
|
+
* events when you perform the corresponding actions.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```html
|
|
39
|
+
* <kendo-treeview
|
|
40
|
+
* kendoTreeViewDragAndDrop
|
|
41
|
+
* [dropZoneTreeViews]="treeView"
|
|
42
|
+
* >
|
|
43
|
+
* </kendo-treeview>
|
|
44
|
+
* ```
|
|
36
45
|
*/
|
|
37
46
|
export class DragAndDropDirective {
|
|
38
47
|
element;
|
|
@@ -41,31 +50,31 @@ export class DragAndDropDirective {
|
|
|
41
50
|
dragClueService;
|
|
42
51
|
dropHintService;
|
|
43
52
|
/**
|
|
44
|
-
* Specifies whether the `removeItem` event
|
|
45
|
-
* If enabled, the `removeItem` event
|
|
46
|
-
* ([see example](
|
|
53
|
+
* Specifies whether the `removeItem` event fires after the user drops an item while pressing the `ctrl` key.
|
|
54
|
+
* If enabled, the `removeItem` event does not fire on the source TreeView
|
|
55
|
+
* ([see example](slug:draganddrop_treeview#multiple-treeviews)).
|
|
47
56
|
*
|
|
48
57
|
* @default false
|
|
49
58
|
*/
|
|
50
59
|
allowCopy = false;
|
|
51
60
|
/**
|
|
52
|
-
*
|
|
53
|
-
* ([see example](
|
|
61
|
+
* Specifies the `TreeViewComponent` instances into which the user can drop dragged items from the current `TreeViewComponent`
|
|
62
|
+
* ([see example](slug:draganddrop_treeview#multiple-treeviews)).
|
|
54
63
|
*/
|
|
55
64
|
dropZoneTreeViews = [];
|
|
56
65
|
/**
|
|
57
|
-
* Specifies the distance in pixels from the initial item pointerdown event
|
|
58
|
-
* The `nodeDragStart` and all
|
|
66
|
+
* Specifies the distance in pixels from the initial item `pointerdown` event before dragging starts.
|
|
67
|
+
* The `nodeDragStart` and all subsequent TreeView drag events do not fire until dragging begins.
|
|
59
68
|
*
|
|
60
69
|
* @default 5
|
|
61
70
|
*/
|
|
62
71
|
startDragAfter = 5;
|
|
63
72
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
73
|
+
* Controls the auto-scrolling behavior during drag-and-drop ([see example](slug:draganddrop_treeview#auto-scrolling)).
|
|
74
|
+
* Enabled by default. To turn off auto-scrolling, set this property to `false`.
|
|
66
75
|
*
|
|
67
|
-
* By default,
|
|
68
|
-
*
|
|
76
|
+
* By default, scrolling occurs by 1 pixel every 1 millisecond when the dragged item reaches the top or bottom of the scrollable container.
|
|
77
|
+
* You can override the `step` and `interval` by providing a `DragAndDropScrollSettings` object.
|
|
69
78
|
*
|
|
70
79
|
* @default true
|
|
71
80
|
*/
|
|
@@ -5,18 +5,25 @@
|
|
|
5
5
|
import { Directive, Optional, TemplateRef } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
|
-
* Represents the template for the TreeView drag clue when an item
|
|
9
|
-
* nest an `<ng-template>` tag with the `kendoTreeViewDragClueTemplate` directive inside a `<kendo-treeview>` tag
|
|
10
|
-
* ([see example]({% slug draganddrop_treeview %}#toc-templates)).
|
|
8
|
+
* Represents the template for the TreeView drag clue when you drag an item.
|
|
11
9
|
*
|
|
10
|
+
* To define the drag clue template, nest an `<ng-template>` tag with the `kendoTreeViewDragClueTemplate` directive inside a `<kendo-treeview>` tag
|
|
11
|
+
* ([see example](slug:draganddrop_treeview#toc-templates)).
|
|
12
12
|
*
|
|
13
|
-
* The
|
|
13
|
+
* The template context provides the following variables:
|
|
14
|
+
* - `let-text="text"` (`string`)—The display text of the item being dragged.
|
|
15
|
+
* - `let-action="action"` ([`DropAction`](slug:api_treeview_dropaction))—The type of drop action that will occur.
|
|
16
|
+
* - `let-sourceItem="sourceItem"` ([`TreeItemLookup`](slug:api_treeview_treeitemlookup))—The TreeView item that is being dragged from its original position.
|
|
17
|
+
* - `let-destinationItem="destinationItem"` ([`TreeItemLookup`](slug:api_treeview_treeitemlookup))—The TreeView item that serves as the target for the drop operation.
|
|
14
18
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* -
|
|
18
|
-
*
|
|
19
|
-
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <kendo-treeview>
|
|
22
|
+
* <ng-template kendoTreeViewDragClueTemplate let-text="text">
|
|
23
|
+
* Dragging: {{ text }}
|
|
24
|
+
* </ng-template>
|
|
25
|
+
* </kendo-treeview>
|
|
26
|
+
* ```
|
|
20
27
|
*/
|
|
21
28
|
export class DragClueTemplateDirective {
|
|
22
29
|
templateRef;
|
|
@@ -5,15 +5,24 @@
|
|
|
5
5
|
import { Directive, Optional, TemplateRef } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
|
-
* Represents the template for the TreeView drop hint when an item
|
|
9
|
-
* nest an `<ng-template>` tag with the `kendoTreeViewDropHintTemplate` directive inside a `<kendo-treeview>` tag
|
|
10
|
-
* ([see example]({% slug draganddrop_treeview %}#toc-templates)).
|
|
8
|
+
* Represents the template for the TreeView drop hint when you drag an item.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
10
|
+
* To define the hint template, nest an `<ng-template>` tag with the `kendoTreeViewDropHintTemplate` directive inside a `<kendo-treeview>` tag
|
|
11
|
+
* ([see example](slug:draganddrop_treeview#toc-templates)).
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
* - `let-
|
|
16
|
-
* - `let-
|
|
13
|
+
* The template context provides the following variables:
|
|
14
|
+
* - `let-action="action"` ([`DropAction`](slug:api_treeview_dropaction))—The drop action being performed.
|
|
15
|
+
* - `let-sourceItem="sourceItem"` ([`TreeItemLookup`](slug:api_treeview_treeitemlookup))—The item being dragged.
|
|
16
|
+
* - `let-destinationItem="destinationItem"` ([`TreeItemLookup`](slug:api_treeview_treeitemlookup))—The target item for the drop operation.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```html
|
|
20
|
+
* <kendo-treeview>
|
|
21
|
+
* <ng-template kendoTreeViewDropHintTemplate let-action="action">
|
|
22
|
+
* Drop action: {{ action }}
|
|
23
|
+
* </ng-template>
|
|
24
|
+
* </kendo-treeview>
|
|
25
|
+
* ```
|
|
17
26
|
*/
|
|
18
27
|
export class DropHintTemplateDirective {
|
|
19
28
|
templateRef;
|
|
@@ -3,15 +3,30 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* Passed as `action` value to the [`kendoTreeViewDragClueTemplate`](
|
|
6
|
+
* Represents the attempted drop action during dragging.
|
|
7
|
+
* Passed as `action` value to the [`kendoTreeViewDragClueTemplate`](slug:api_treeview_dragcluetemplatedirective) directive.
|
|
8
8
|
* By default, this value defines the rendered icon in the drag clue.
|
|
9
9
|
*/
|
|
10
10
|
export var DropAction;
|
|
11
11
|
(function (DropAction) {
|
|
12
|
+
/**
|
|
13
|
+
* The dragged item is added as a child to the target node.
|
|
14
|
+
*/
|
|
12
15
|
DropAction[DropAction["Add"] = 0] = "Add";
|
|
16
|
+
/**
|
|
17
|
+
* The dragged item is inserted above the target node at the same level.
|
|
18
|
+
*/
|
|
13
19
|
DropAction[DropAction["InsertTop"] = 1] = "InsertTop";
|
|
20
|
+
/**
|
|
21
|
+
* The dragged item is inserted below the target node at the same level.
|
|
22
|
+
*/
|
|
14
23
|
DropAction[DropAction["InsertBottom"] = 2] = "InsertBottom";
|
|
24
|
+
/**
|
|
25
|
+
* The dragged item is inserted in the middle position relative to the target node.
|
|
26
|
+
*/
|
|
15
27
|
DropAction[DropAction["InsertMiddle"] = 3] = "InsertMiddle";
|
|
28
|
+
/**
|
|
29
|
+
* The drop action is not valid for the current target location.
|
|
30
|
+
*/
|
|
16
31
|
DropAction[DropAction["Invalid"] = 4] = "Invalid";
|
|
17
32
|
})(DropAction || (DropAction = {}));
|
|
@@ -3,11 +3,20 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Specifies where a dragged item is dropped relative to the target item.
|
|
7
7
|
*/
|
|
8
8
|
export var DropPosition;
|
|
9
9
|
(function (DropPosition) {
|
|
10
|
+
/**
|
|
11
|
+
* The item is dropped over the target item.
|
|
12
|
+
*/
|
|
10
13
|
DropPosition[DropPosition["Over"] = 0] = "Over";
|
|
14
|
+
/**
|
|
15
|
+
* The item is dropped before the target item.
|
|
16
|
+
*/
|
|
11
17
|
DropPosition[DropPosition["Before"] = 1] = "Before";
|
|
18
|
+
/**
|
|
19
|
+
* The item is dropped after the target item.
|
|
20
|
+
*/
|
|
12
21
|
DropPosition[DropPosition["After"] = 2] = "After";
|
|
13
22
|
})(DropPosition || (DropPosition = {}));
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Arguments for the TreeView [`nodeDrag`](
|
|
7
|
-
* [`nodeDragEnd`](
|
|
6
|
+
* Arguments for the TreeView [`nodeDrag`](slug:api_treeview_treeviewcomponent#nodedrag) and
|
|
7
|
+
* [`nodeDragEnd`](slug:api_treeview_treeviewcomponent#nodedragend) events.
|
|
8
8
|
*/
|
|
9
9
|
export class TreeItemDragEvent {
|
|
10
10
|
/** @hidden */
|
|
11
11
|
constructor() { }
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Lookup information for the dragged item.
|
|
14
14
|
*/
|
|
15
15
|
sourceItem;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Lookup information for the item currently under the dragged node, if any.
|
|
18
18
|
*/
|
|
19
19
|
destinationItem;
|
|
20
20
|
/**
|
|
21
|
-
* The original pointer event
|
|
21
|
+
* The original pointer event containing details about the pointer position.
|
|
22
22
|
*/
|
|
23
23
|
originalEvent;
|
|
24
24
|
}
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PreventableEvent } from './preventable-event';
|
|
6
6
|
/**
|
|
7
|
-
* Arguments for the TreeView [`nodeDragStart`](
|
|
7
|
+
* Arguments for the TreeView [`nodeDragStart`](slug:api_treeview_treeviewcomponent#nodedragstart) event.
|
|
8
8
|
*/
|
|
9
9
|
export class TreeItemDragStartEvent extends PreventableEvent {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Lookup information for the dragged item.
|
|
12
12
|
*/
|
|
13
13
|
sourceItem;
|
|
14
14
|
/**
|
|
15
|
-
* The original pointer event
|
|
15
|
+
* The original pointer event containing details about the pointer position.
|
|
16
16
|
*/
|
|
17
17
|
originalEvent;
|
|
18
18
|
/**
|
|
@@ -4,31 +4,31 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PreventableEvent } from './preventable-event';
|
|
6
6
|
/**
|
|
7
|
-
* Arguments for the TreeView [`nodeDrop`](
|
|
7
|
+
* Arguments for the TreeView [`nodeDrop`](slug:api_treeview_treeviewcomponent#nodedrop) event.
|
|
8
8
|
*/
|
|
9
9
|
export class TreeItemDropEvent extends PreventableEvent {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Reference to the TreeView from which the dragged item originates.
|
|
12
12
|
*/
|
|
13
13
|
sourceTree;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Reference to the TreeView onto which the dragged item is dropped.
|
|
16
16
|
*/
|
|
17
17
|
destinationTree;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Lookup information for the dragged item.
|
|
20
20
|
*/
|
|
21
21
|
sourceItem;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Lookup information for the item onto which the dragged item is dropped.
|
|
24
24
|
*/
|
|
25
25
|
destinationItem;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Represents the drop position relative to the target item.
|
|
28
28
|
*/
|
|
29
29
|
dropPosition;
|
|
30
30
|
/**
|
|
31
|
-
* The original pointer event
|
|
31
|
+
* The original pointer event containing details about the pointer position.
|
|
32
32
|
*/
|
|
33
33
|
originalEvent;
|
|
34
34
|
/**
|
|
@@ -44,10 +44,9 @@ export class TreeItemDropEvent extends PreventableEvent {
|
|
|
44
44
|
this.originalEvent = originalEvent;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
* If set to `false`, the
|
|
49
|
-
*
|
|
50
|
-
* will be animated back to the source item to indicate the action is marked as invalid.
|
|
47
|
+
* Sets whether the drop action is valid.
|
|
48
|
+
* If set to `false`, the `addItem` and `removeItem` events will not be fired and the drag clue
|
|
49
|
+
* will animate back to the source item to indicate the action is invalid.
|
|
51
50
|
*/
|
|
52
51
|
setValid(isValid) {
|
|
53
52
|
this.isValid = isValid;
|
|
@@ -16,8 +16,19 @@ const DEFAULT_FILTER_EXPAND_SETTINGS = {
|
|
|
16
16
|
expandedOnClear: "none"
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* ([see example](
|
|
19
|
+
* Represents a directive that manages the expanded state of the TreeView
|
|
20
|
+
* ([see example](slug:expandedstate_treeview)).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```html
|
|
24
|
+
* <kendo-treeview
|
|
25
|
+
* kendoTreeViewExpandable
|
|
26
|
+
* expandBy="id"
|
|
27
|
+
* [(expandedKeys)]="expandedKeys"
|
|
28
|
+
* [expandOnFilter]="true"
|
|
29
|
+
* [nodes]="data">
|
|
30
|
+
* </kendo-treeview>
|
|
31
|
+
* ```
|
|
21
32
|
*/
|
|
22
33
|
export class ExpandDirective {
|
|
23
34
|
component;
|
|
@@ -28,12 +39,12 @@ export class ExpandDirective {
|
|
|
28
39
|
this.component.isExpanded = value;
|
|
29
40
|
}
|
|
30
41
|
/**
|
|
31
|
-
* Defines the item key
|
|
42
|
+
* Defines the item key stored in the `expandedKeys` collection.
|
|
32
43
|
*/
|
|
33
44
|
expandKey;
|
|
34
45
|
/**
|
|
35
|
-
*
|
|
36
|
-
* To fine-tune this behavior, pass a [`FilterExpandSettings`](
|
|
46
|
+
* Specifies whether to auto-expand the nodes leading from the root node to each filter result.
|
|
47
|
+
* To fine-tune this behavior, pass a [`FilterExpandSettings`](slug:api_treeview_filterexpandsettings) object to this input.
|
|
37
48
|
* @default false
|
|
38
49
|
*/
|
|
39
50
|
expandOnFilter = false;
|
|
@@ -42,16 +53,16 @@ export class ExpandDirective {
|
|
|
42
53
|
return Object.assign({}, DEFAULT_FILTER_EXPAND_SETTINGS, settings);
|
|
43
54
|
}
|
|
44
55
|
/**
|
|
45
|
-
* Fires when the `expandedKeys` collection
|
|
56
|
+
* Fires when the `expandedKeys` collection updates.
|
|
46
57
|
*/
|
|
47
58
|
expandedKeysChange = new EventEmitter();
|
|
48
59
|
/**
|
|
49
|
-
* Defines the collection that
|
|
60
|
+
* Defines the collection that stores the expanded keys.
|
|
50
61
|
*/
|
|
51
62
|
expandedKeys;
|
|
52
63
|
subscriptions = new Subscription();
|
|
53
64
|
/**
|
|
54
|
-
*
|
|
65
|
+
* Reflects the internal `expandedKeys` state.
|
|
55
66
|
*/
|
|
56
67
|
state = new Set();
|
|
57
68
|
originalExpandedKeys = new Set();
|
|
@@ -33,12 +33,27 @@ const mapToTree = (currentLevelNodes, allNodes, parentIdField, idField, parent =
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Represents a directive that handles flat data binding and provides built-in filtering functionality for the TreeView.
|
|
37
|
+
*
|
|
38
|
+
* Use this directive to bind flat data where parent-child relationships are defined by ID fields.
|
|
39
|
+
* The directive also enables the built-in filter input and automatic filter handling when used with the `filterable` property.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```html
|
|
43
|
+
* <kendo-treeview
|
|
44
|
+
* kendoTreeViewFlatDataBinding
|
|
45
|
+
* idField="id"
|
|
46
|
+
* parentIdField="parentId"
|
|
47
|
+
* textField="text"
|
|
48
|
+
* [nodes]="data"
|
|
49
|
+
* [filterable]="true">
|
|
50
|
+
* </kendo-treeview>
|
|
51
|
+
* ```
|
|
37
52
|
*/
|
|
38
53
|
export class FlatDataBindingDirective extends FilteringBase {
|
|
39
54
|
component;
|
|
40
55
|
/**
|
|
41
|
-
*
|
|
56
|
+
* Specifies the flat data collection that renders as nodes in the TreeView.
|
|
42
57
|
*/
|
|
43
58
|
set nodes(nodes) {
|
|
44
59
|
// Needs to be a setter so that it can be accessed via `super` call (typescript v5)
|
|
@@ -49,11 +64,11 @@ export class FlatDataBindingDirective extends FilteringBase {
|
|
|
49
64
|
}
|
|
50
65
|
_nodes;
|
|
51
66
|
/**
|
|
52
|
-
*
|
|
67
|
+
* Specifies the field name that contains the parent node identifier.
|
|
53
68
|
*/
|
|
54
69
|
parentIdField;
|
|
55
70
|
/**
|
|
56
|
-
*
|
|
71
|
+
* Specifies the field name that contains the unique node identifier.
|
|
57
72
|
*/
|
|
58
73
|
idField;
|
|
59
74
|
/**
|
|
@@ -34,13 +34,27 @@ const mapToWrappers = (currentLevelNodes, childrenField, parent = null, parentIn
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Represents a directive that handles hierarchical data binding and provides built-in filtering functionality for the TreeView.
|
|
38
|
+
*
|
|
39
|
+
* Use this directive to bind hierarchical data where child nodes are nested within parent nodes.
|
|
40
|
+
* The directive also enables the built-in filter input and automatic filter handling when used with the `filterable` property.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```html
|
|
44
|
+
* <kendo-treeview
|
|
45
|
+
* kendoTreeViewHierarchyBinding
|
|
46
|
+
* childrenField="items"
|
|
47
|
+
* textField="text"
|
|
48
|
+
* [nodes]="data"
|
|
49
|
+
* [filterable]="true">
|
|
50
|
+
* </kendo-treeview>
|
|
51
|
+
* ```
|
|
38
52
|
*/
|
|
39
53
|
export class HierarchyBindingDirective extends FilteringBase {
|
|
40
54
|
component;
|
|
41
55
|
dragAndDropDirective;
|
|
42
56
|
/**
|
|
43
|
-
*
|
|
57
|
+
* Specifies the field name of the parent node that holds the child data items.
|
|
44
58
|
*/
|
|
45
59
|
set childrenField(value) {
|
|
46
60
|
if (!value) {
|
|
@@ -49,13 +63,13 @@ export class HierarchyBindingDirective extends FilteringBase {
|
|
|
49
63
|
this._childrenField = value;
|
|
50
64
|
}
|
|
51
65
|
/**
|
|
52
|
-
*
|
|
66
|
+
* Specifies the field name of the parent node that holds the child data items.
|
|
53
67
|
*/
|
|
54
68
|
get childrenField() {
|
|
55
69
|
return this._childrenField;
|
|
56
70
|
}
|
|
57
71
|
/**
|
|
58
|
-
*
|
|
72
|
+
* Specifies the hierarchical data displayed by the TreeView.
|
|
59
73
|
*/
|
|
60
74
|
set nodes(nodes) {
|
|
61
75
|
// Needs to be a setter so that it can be accessed via `super` call (typescript v5)
|