@progress/kendo-angular-treeview 21.4.1-develop.1 → 22.0.0-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/fesm2022/progress-kendo-angular-treeview.mjs +115 -115
- package/filtering-base.d.ts +1 -1
- package/localization/messages.d.ts +1 -1
- package/package.json +11 -19
- package/schematics/ngAdd/index.js +4 -4
- package/esm2022/check-mode.mjs +0 -5
- package/esm2022/check.directive.mjs +0 -334
- package/esm2022/checkable-settings.mjs +0 -5
- package/esm2022/checkbox/checked-state.mjs +0 -5
- package/esm2022/data-bound-component.mjs +0 -19
- package/esm2022/data-change-notification.service.mjs +0 -14
- package/esm2022/default-callbacks.mjs +0 -36
- package/esm2022/directives.mjs +0 -53
- package/esm2022/disable.directive.mjs +0 -83
- package/esm2022/drag-and-drop/drag-and-drop-editing.directive.mjs +0 -76
- package/esm2022/drag-and-drop/drag-and-drop-utils.mjs +0 -270
- package/esm2022/drag-and-drop/drag-and-drop.directive.mjs +0 -348
- package/esm2022/drag-and-drop/drag-clue/drag-clue-template.directive.mjs +0 -44
- package/esm2022/drag-and-drop/drag-clue/drag-clue.component.mjs +0 -132
- package/esm2022/drag-and-drop/drag-clue/drag-clue.service.mjs +0 -123
- package/esm2022/drag-and-drop/drop-hint/drop-hint-template.directive.mjs +0 -43
- package/esm2022/drag-and-drop/drop-hint/drop-hint.component.mjs +0 -102
- package/esm2022/drag-and-drop/drop-hint/drop-hint.service.mjs +0 -41
- package/esm2022/drag-and-drop/editing-services/drag-and-drop-asset.service.mjs +0 -48
- package/esm2022/drag-and-drop/editing-services/flat-editing.service.mjs +0 -141
- package/esm2022/drag-and-drop/editing-services/hierarchy-editing.service.mjs +0 -88
- package/esm2022/drag-and-drop/models/drop-action.mjs +0 -32
- package/esm2022/drag-and-drop/models/drop-position.mjs +0 -22
- package/esm2022/drag-and-drop/models/editing-service.mjs +0 -5
- package/esm2022/drag-and-drop/models/preventable-event.mjs +0 -25
- package/esm2022/drag-and-drop/models/scroll-direction.mjs +0 -12
- package/esm2022/drag-and-drop/models/scroll-settings.mjs +0 -5
- package/esm2022/drag-and-drop/models/tree-item-filter-state.mjs +0 -5
- package/esm2022/drag-and-drop/models/treeitem-add-remove-args.mjs +0 -5
- package/esm2022/drag-and-drop/models/treeitem-drag-event.mjs +0 -24
- package/esm2022/drag-and-drop/models/treeitem-drag-start-event.mjs +0 -25
- package/esm2022/drag-and-drop/models/treeitem-drop-event.mjs +0 -54
- package/esm2022/drag-and-drop/models.mjs +0 -14
- package/esm2022/expand-state.service.mjs +0 -24
- package/esm2022/expand.directive.mjs +0 -226
- package/esm2022/expandable-component.mjs +0 -19
- package/esm2022/filter-expand-settings.interface.mjs +0 -5
- package/esm2022/filter-state.interface.mjs +0 -5
- package/esm2022/filtering-base.mjs +0 -92
- package/esm2022/flat-binding.directive.mjs +0 -165
- package/esm2022/funcs.mjs +0 -9
- package/esm2022/hierarchy-binding.directive.mjs +0 -164
- package/esm2022/index-builder.service.mjs +0 -33
- package/esm2022/index.mjs +0 -31
- package/esm2022/load-more/load-more-button-template.directive.mjs +0 -41
- package/esm2022/load-more/load-more-request-args.mjs +0 -5
- package/esm2022/load-more/load-more-utils.mjs +0 -35
- package/esm2022/load-more/load-more.directive.mjs +0 -137
- package/esm2022/load-more/load-more.service.mjs +0 -5
- package/esm2022/loading-indicator.directive.mjs +0 -69
- package/esm2022/loading-notification.service.mjs +0 -21
- package/esm2022/localization/custom-messages.component.mjs +0 -54
- package/esm2022/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -27
- package/esm2022/navigation/navigation-item.interface.mjs +0 -5
- package/esm2022/navigation/navigation-model.mjs +0 -152
- package/esm2022/navigation/navigation-state.interface.mjs +0 -5
- package/esm2022/navigation/navigation.service.mjs +0 -248
- package/esm2022/node-children.service.mjs +0 -21
- package/esm2022/node-click-event.interface.mjs +0 -5
- package/esm2022/node-template.directive.mjs +0 -45
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-treeview.mjs +0 -8
- package/esm2022/selection/select.directive.mjs +0 -174
- package/esm2022/selection/selectable-settings.mjs +0 -5
- package/esm2022/selection/selection-mode.mjs +0 -5
- package/esm2022/selection/selection.service.mjs +0 -33
- package/esm2022/size.mjs +0 -5
- package/esm2022/treeitem-lookup.interface.mjs +0 -5
- package/esm2022/treeitem.interface.mjs +0 -5
- package/esm2022/treeview-filter-settings.mjs +0 -12
- package/esm2022/treeview-group.component.mjs +0 -759
- package/esm2022/treeview-item-content.directive.mjs +0 -82
- package/esm2022/treeview-item.directive.mjs +0 -245
- package/esm2022/treeview-lookup.service.mjs +0 -89
- package/esm2022/treeview.component.mjs +0 -874
- package/esm2022/treeview.module.mjs +0 -74
- package/esm2022/utils.mjs +0 -301
package/filtering-base.d.ts
CHANGED
|
@@ -34,5 +34,5 @@ export declare abstract class FilteringBase {
|
|
|
34
34
|
protected updateVisibleNodes(items: TreeItemFilterState[]): void;
|
|
35
35
|
protected resetNodesVisibility(items: TreeItemFilterState[]): void;
|
|
36
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<FilteringBase, never>;
|
|
37
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<FilteringBase, never, never, { "filterSettings": { "alias": "filterSettings"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; }, {}, never, never,
|
|
37
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FilteringBase, never, never, { "filterSettings": { "alias": "filterSettings"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; }, {}, never, never, true, never>;
|
|
38
38
|
}
|
|
@@ -13,5 +13,5 @@ export declare class TreeViewMessages extends ComponentMessages {
|
|
|
13
13
|
*/
|
|
14
14
|
loadMore: string;
|
|
15
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeViewMessages, never>;
|
|
16
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TreeViewMessages, "kendo-treeview-messages-base", never, { "loadMore": { "alias": "loadMore"; "required": false; }; }, {}, never, never,
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TreeViewMessages, "kendo-treeview-messages-base", never, { "loadMore": { "alias": "loadMore"; "required": false; }; }, {}, never, never, true, never>;
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-treeview",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0-develop.1",
|
|
4
4
|
"description": "Kendo UI TreeView for Angular",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -15,29 +15,23 @@
|
|
|
15
15
|
"TreeView"
|
|
16
16
|
],
|
|
17
17
|
"@progress": {
|
|
18
|
-
"friendlyName": "TreeView"
|
|
19
|
-
"package": {
|
|
20
|
-
"productName": "Kendo UI for Angular",
|
|
21
|
-
"productCode": "KENDOUIANGULAR",
|
|
22
|
-
"publishDate": 1768386450,
|
|
23
|
-
"licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
|
|
24
|
-
}
|
|
18
|
+
"friendlyName": "TreeView"
|
|
25
19
|
},
|
|
26
20
|
"peerDependencies": {
|
|
27
|
-
"@angular/animations": "
|
|
28
|
-
"@angular/common": "
|
|
29
|
-
"@angular/core": "
|
|
30
|
-
"@angular/platform-browser": "
|
|
21
|
+
"@angular/animations": "19 - 21",
|
|
22
|
+
"@angular/common": "19 - 21",
|
|
23
|
+
"@angular/core": "19 - 21",
|
|
24
|
+
"@angular/platform-browser": "19 - 21",
|
|
31
25
|
"@progress/kendo-licensing": "^1.7.0",
|
|
32
|
-
"@progress/kendo-angular-common": "
|
|
33
|
-
"@progress/kendo-angular-inputs": "
|
|
34
|
-
"@progress/kendo-angular-icons": "
|
|
35
|
-
"@progress/kendo-angular-l10n": "
|
|
26
|
+
"@progress/kendo-angular-common": "22.0.0-develop.1",
|
|
27
|
+
"@progress/kendo-angular-inputs": "22.0.0-develop.1",
|
|
28
|
+
"@progress/kendo-angular-icons": "22.0.0-develop.1",
|
|
29
|
+
"@progress/kendo-angular-l10n": "22.0.0-develop.1",
|
|
36
30
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
37
31
|
},
|
|
38
32
|
"dependencies": {
|
|
39
33
|
"tslib": "^2.3.1",
|
|
40
|
-
"@progress/kendo-angular-schematics": "
|
|
34
|
+
"@progress/kendo-angular-schematics": "22.0.0-develop.1",
|
|
41
35
|
"@progress/kendo-common": "^1.0.1",
|
|
42
36
|
"@progress/kendo-draggable": "^3.0.2"
|
|
43
37
|
},
|
|
@@ -50,8 +44,6 @@
|
|
|
50
44
|
},
|
|
51
45
|
".": {
|
|
52
46
|
"types": "./index.d.ts",
|
|
53
|
-
"esm2022": "./esm2022/progress-kendo-angular-treeview.mjs",
|
|
54
|
-
"esm": "./esm2022/progress-kendo-angular-treeview.mjs",
|
|
55
47
|
"default": "./fesm2022/progress-kendo-angular-treeview.mjs"
|
|
56
48
|
}
|
|
57
49
|
},
|
|
@@ -9,10 +9,10 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
9
9
|
function default_1(options) {
|
|
10
10
|
const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'TreeViewModule', package: 'treeview', peerDependencies: {
|
|
11
11
|
// Peers of kendo-angular-inputs
|
|
12
|
-
'@progress/kendo-angular-buttons': '
|
|
13
|
-
'@progress/kendo-angular-dialog': '
|
|
14
|
-
'@progress/kendo-angular-intl': '
|
|
15
|
-
'@progress/kendo-angular-popup': '
|
|
12
|
+
'@progress/kendo-angular-buttons': '22.0.0-develop.1',
|
|
13
|
+
'@progress/kendo-angular-dialog': '22.0.0-develop.1',
|
|
14
|
+
'@progress/kendo-angular-intl': '22.0.0-develop.1',
|
|
15
|
+
'@progress/kendo-angular-popup': '22.0.0-develop.1',
|
|
16
16
|
'@progress/kendo-drawing': '^1.9.3',
|
|
17
17
|
// Peer dependency of icons
|
|
18
18
|
'@progress/kendo-svg-icons': '^4.0.0'
|
package/esm2022/check-mode.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, EventEmitter, Input, Output, NgZone } from '@angular/core';
|
|
6
|
-
import { TreeViewComponent } from './treeview.component';
|
|
7
|
-
import { fetchLoadedDescendants, isBoolean, isPresent, noop } from './utils';
|
|
8
|
-
import { Subscription } from 'rxjs';
|
|
9
|
-
import { filter, take, switchMap, tap } from 'rxjs/operators';
|
|
10
|
-
import { isChanged } from '@progress/kendo-angular-common';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
import * as i1 from "./treeview.component";
|
|
13
|
-
const indexChecked = (keys, index) => keys.filter(k => k === index).length > 0;
|
|
14
|
-
const matchKey = index => k => {
|
|
15
|
-
if (index === k) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
if (!k.split) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
return k.split('_').reduce(({ key, result }, part) => {
|
|
22
|
-
key += part;
|
|
23
|
-
if (index === key || result) {
|
|
24
|
-
return { result: true };
|
|
25
|
-
}
|
|
26
|
-
key += "_";
|
|
27
|
-
return { key, result: false };
|
|
28
|
-
}, { key: "", result: false }).result;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
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
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* @remarks
|
|
45
|
-
* Applied to: {@link TreeViewComponent}
|
|
46
|
-
*/
|
|
47
|
-
export class CheckDirective {
|
|
48
|
-
treeView;
|
|
49
|
-
zone;
|
|
50
|
-
/**
|
|
51
|
-
* @hidden
|
|
52
|
-
*/
|
|
53
|
-
set isChecked(value) {
|
|
54
|
-
this.treeView.isChecked = value;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Defines the item key stored in the `checkedKeys` collection.
|
|
58
|
-
*/
|
|
59
|
-
checkKey;
|
|
60
|
-
/**
|
|
61
|
-
* Defines the collection that stores the checked keys
|
|
62
|
-
* ([see example](slug:checkboxes_treeview)).
|
|
63
|
-
*/
|
|
64
|
-
checkedKeys;
|
|
65
|
-
/**
|
|
66
|
-
* Defines the checkable settings
|
|
67
|
-
* ([see example](slug:checkboxes_treeview#setup)).
|
|
68
|
-
* If you do not provide a value, the default [`CheckableSettings`](slug:api_treeview_checkablesettings) apply.
|
|
69
|
-
*/
|
|
70
|
-
checkable;
|
|
71
|
-
/**
|
|
72
|
-
* Fires when the `checkedKeys` collection updates.
|
|
73
|
-
*/
|
|
74
|
-
checkedKeysChange = new EventEmitter();
|
|
75
|
-
subscriptions = new Subscription();
|
|
76
|
-
get options() {
|
|
77
|
-
const defaultOptions = {
|
|
78
|
-
checkChildren: true,
|
|
79
|
-
checkParents: true,
|
|
80
|
-
enabled: true,
|
|
81
|
-
mode: "multiple",
|
|
82
|
-
uncheckCollapsedChildren: false
|
|
83
|
-
};
|
|
84
|
-
if (!isPresent(this.checkable) || typeof this.checkable === 'string') {
|
|
85
|
-
return defaultOptions;
|
|
86
|
-
}
|
|
87
|
-
const checkSettings = isBoolean(this.checkable)
|
|
88
|
-
? { enabled: this.checkable }
|
|
89
|
-
: this.checkable;
|
|
90
|
-
return Object.assign(defaultOptions, checkSettings);
|
|
91
|
-
}
|
|
92
|
-
checkActions = {
|
|
93
|
-
'multiple': (e) => this.checkMultiple(e),
|
|
94
|
-
'single': (e) => this.checkSingle(e)
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Reflects the internal `checkedKeys` state.
|
|
98
|
-
*/
|
|
99
|
-
state = new Set();
|
|
100
|
-
clickSubscription;
|
|
101
|
-
/**
|
|
102
|
-
* Holds the last emitted `checkedKeys` collection.
|
|
103
|
-
*/
|
|
104
|
-
lastChange;
|
|
105
|
-
constructor(treeView, zone) {
|
|
106
|
-
this.treeView = treeView;
|
|
107
|
-
this.zone = zone;
|
|
108
|
-
this.subscriptions.add(this.treeView.checkedChange
|
|
109
|
-
.subscribe((e) => this.check(e)));
|
|
110
|
-
const expandedItems = [];
|
|
111
|
-
this.subscriptions.add(this.treeView.childrenLoaded
|
|
112
|
-
.pipe(filter(() => this.options.checkChildren && this.treeView.loadOnDemand), tap(item => expandedItems.push(item)), switchMap(() => this.zone.onStable.pipe(take(1))))
|
|
113
|
-
.subscribe(() => this.addCheckedItemsChildren(expandedItems)));
|
|
114
|
-
this.treeView.isChecked = this.isItemChecked.bind(this);
|
|
115
|
-
}
|
|
116
|
-
ngOnChanges(changes) {
|
|
117
|
-
if (changes.checkable) {
|
|
118
|
-
this.treeView.checkboxes = this.options.enabled;
|
|
119
|
-
this.toggleCheckOnClick();
|
|
120
|
-
}
|
|
121
|
-
if (isChanged('checkedKeys', changes, false) && changes.checkedKeys.currentValue !== this.lastChange) {
|
|
122
|
-
this.state = new Set(changes.checkedKeys.currentValue);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
ngOnDestroy() {
|
|
126
|
-
this.subscriptions.unsubscribe();
|
|
127
|
-
this.unsubscribeClick();
|
|
128
|
-
}
|
|
129
|
-
isItemChecked(dataItem, index) {
|
|
130
|
-
if (!this.checkKey) {
|
|
131
|
-
return this.isIndexChecked(index);
|
|
132
|
-
}
|
|
133
|
-
const hasKey = this.state.has(this.itemKey({ dataItem, index }));
|
|
134
|
-
return hasKey ? 'checked' : 'none';
|
|
135
|
-
}
|
|
136
|
-
isIndexChecked(index) {
|
|
137
|
-
const checkedKeys = Array.from(this.state).filter(matchKey(index));
|
|
138
|
-
if (indexChecked(checkedKeys, index)) {
|
|
139
|
-
return 'checked';
|
|
140
|
-
}
|
|
141
|
-
const { mode, checkParents } = this.options;
|
|
142
|
-
if (mode === 'multiple' && checkParents && checkedKeys.length) {
|
|
143
|
-
return 'indeterminate';
|
|
144
|
-
}
|
|
145
|
-
return 'none';
|
|
146
|
-
}
|
|
147
|
-
itemKey(item) {
|
|
148
|
-
if (!isPresent(this.checkKey)) {
|
|
149
|
-
return item.index;
|
|
150
|
-
}
|
|
151
|
-
if (typeof this.checkKey === "string" && isPresent(item.dataItem)) {
|
|
152
|
-
return item.dataItem[this.checkKey];
|
|
153
|
-
}
|
|
154
|
-
if (typeof this.checkKey === "function") {
|
|
155
|
-
return this.checkKey(item);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
check(e) {
|
|
159
|
-
const { enabled, mode } = this.options;
|
|
160
|
-
const performSelection = this.checkActions[mode] || noop;
|
|
161
|
-
if (!enabled) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
performSelection(e);
|
|
165
|
-
}
|
|
166
|
-
checkSingle(node) {
|
|
167
|
-
const key = this.itemKey(node.item);
|
|
168
|
-
const hasKey = this.state.has(key);
|
|
169
|
-
this.state.clear();
|
|
170
|
-
if (!hasKey) {
|
|
171
|
-
this.state.add(key);
|
|
172
|
-
}
|
|
173
|
-
this.notify();
|
|
174
|
-
}
|
|
175
|
-
checkMultiple(node) {
|
|
176
|
-
this.checkNode(node);
|
|
177
|
-
if (this.options.checkParents) {
|
|
178
|
-
this.checkParents(node.parent);
|
|
179
|
-
}
|
|
180
|
-
this.notify();
|
|
181
|
-
}
|
|
182
|
-
toggleCheckOnClick() {
|
|
183
|
-
this.unsubscribeClick();
|
|
184
|
-
if (this.options.checkOnClick) {
|
|
185
|
-
this.clickSubscription = this.treeView.nodeClick.subscribe(args => {
|
|
186
|
-
if (args.type === 'click') {
|
|
187
|
-
const lookup = this.treeView.itemLookup(args.item.index);
|
|
188
|
-
this.check(lookup);
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
unsubscribeClick() {
|
|
194
|
-
if (this.clickSubscription) {
|
|
195
|
-
this.clickSubscription.unsubscribe();
|
|
196
|
-
this.clickSubscription = null;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
checkNode(node) {
|
|
200
|
-
if (!isPresent(node.item.dataItem) ||
|
|
201
|
-
this.treeView.isDisabled(node.item.dataItem, node.item.index) ||
|
|
202
|
-
!this.treeView.hasCheckbox(node.item.dataItem, node.item.index)) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
const currentKey = this.itemKey(node.item);
|
|
206
|
-
if (!isPresent(currentKey)) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
const pendingCheck = [currentKey];
|
|
210
|
-
if (this.options.checkChildren) {
|
|
211
|
-
const descendants = fetchLoadedDescendants(node, ({ item }) => (this.treeView.disableParentNodesOnly || this.options.checkDisabledChildren ?
|
|
212
|
-
this.treeView.isVisible(item.dataItem, item.index) :
|
|
213
|
-
this.treeView.isVisible(item.dataItem, item.index) &&
|
|
214
|
-
!this.treeView.isDisabled(item.dataItem, item.index) &&
|
|
215
|
-
this.treeView.hasCheckbox(item.dataItem, item.index)));
|
|
216
|
-
pendingCheck.push(...descendants.filter((item) => this.options.checkDisabledChildren ||
|
|
217
|
-
!this.treeView.isDisabled(item.item.dataItem, item.item.index) ||
|
|
218
|
-
this.treeView.hasCheckbox(item.item.dataItem, item.item.index))
|
|
219
|
-
.map(({ item }) => this.itemKey(item)));
|
|
220
|
-
}
|
|
221
|
-
const shouldCheck = !this.state.has(currentKey);
|
|
222
|
-
pendingCheck.forEach(key => {
|
|
223
|
-
if (shouldCheck) {
|
|
224
|
-
this.state.add(key);
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
this.state.delete(key);
|
|
228
|
-
if (this.options.uncheckCollapsedChildren &&
|
|
229
|
-
this.options.mode === 'multiple' &&
|
|
230
|
-
this.treeView.loadOnDemand) {
|
|
231
|
-
if (this.checkKey && this.treeView.hasChildren(node.item.dataItem)) {
|
|
232
|
-
this.uncheckChildren(node.item.dataItem, node.item.index);
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
const checkedKeys = Array.from(this.state).filter(matchKey(node.item.index));
|
|
236
|
-
checkedKeys.forEach(key => this.state.delete(key));
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
uncheckChildren(dataItem, parentNodeIndex) {
|
|
242
|
-
this.treeView.children(dataItem).subscribe(children => children.forEach((item, index) => {
|
|
243
|
-
const nodeIndex = `${parentNodeIndex}_${index}`;
|
|
244
|
-
this.state.delete(this.itemKey({ dataItem: item, index: nodeIndex }));
|
|
245
|
-
if (this.treeView.hasChildren(item)) {
|
|
246
|
-
this.uncheckChildren(item, nodeIndex);
|
|
247
|
-
}
|
|
248
|
-
}));
|
|
249
|
-
}
|
|
250
|
-
checkParents(parent) {
|
|
251
|
-
if (!isPresent(parent)) {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
let currentParent = parent;
|
|
255
|
-
while (currentParent) {
|
|
256
|
-
const parentKey = this.itemKey(currentParent.item);
|
|
257
|
-
const isDisabled = this.treeView.isDisabled(currentParent.item.dataItem, currentParent.item.index);
|
|
258
|
-
const allChildrenSelected = currentParent.children.every(item => this.state.has(this.itemKey(item)));
|
|
259
|
-
const hasCheckbox = this.treeView.hasCheckbox(currentParent.item.dataItem, currentParent.item.index);
|
|
260
|
-
if (hasCheckbox && (!isDisabled || this.options.checkDisabledChildren) && allChildrenSelected) {
|
|
261
|
-
this.state.add(parentKey);
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
this.state.delete(parentKey);
|
|
265
|
-
}
|
|
266
|
-
currentParent = currentParent.parent;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
allChildrenSelected(children) {
|
|
270
|
-
return children.every(item => {
|
|
271
|
-
const childrenSel = this.allChildrenSelected(item.children);
|
|
272
|
-
return this.state.has(this.itemKey(item.item)) && childrenSel;
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
notify() {
|
|
276
|
-
this.lastChange = Array.from(this.state);
|
|
277
|
-
this.checkedKeysChange.emit(this.lastChange);
|
|
278
|
-
}
|
|
279
|
-
addCheckedItemsChildren(lookups) {
|
|
280
|
-
if (!isPresent(lookups) || lookups.length === 0) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
const initiallyCheckedItemsCount = this.state.size;
|
|
284
|
-
const disabledItems = new Set();
|
|
285
|
-
lookups.forEach(lookup => {
|
|
286
|
-
const itemKey = this.itemKey(lookup.item);
|
|
287
|
-
if (!this.state.has(itemKey)) {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
lookup.children.forEach(item => {
|
|
291
|
-
// ensure both the parent item and each child node is enabled
|
|
292
|
-
if ((!this.treeView.isDisabled(lookup.item.dataItem, lookup.item.index) &&
|
|
293
|
-
!this.treeView.isDisabled(item.dataItem, item.index)) &&
|
|
294
|
-
(this.treeView.hasCheckbox(lookup.item.dataItem, lookup.item.index) &&
|
|
295
|
-
this.treeView.hasCheckbox(item.dataItem, item.index)) ||
|
|
296
|
-
this.treeView.disableParentNodesOnly || this.options.checkDisabledChildren) {
|
|
297
|
-
this.state.add(this.itemKey(item));
|
|
298
|
-
}
|
|
299
|
-
if (this.treeView.disableParentNodesOnly &&
|
|
300
|
-
!this.options.checkDisabledChildren &&
|
|
301
|
-
(this.treeView.isDisabled(item.dataItem, item.index) ||
|
|
302
|
-
!this.treeView.hasCheckbox(item.dataItem, item.index))) {
|
|
303
|
-
disabledItems.add(this.itemKey(item));
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
});
|
|
307
|
-
disabledItems.forEach(item => this.state.delete(item));
|
|
308
|
-
const hasNewlyCheckedItems = initiallyCheckedItemsCount !== this.state.size;
|
|
309
|
-
if (hasNewlyCheckedItems) {
|
|
310
|
-
this.zone.run(() => this.notify());
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckDirective, deps: [{ token: i1.TreeViewComponent }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
314
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: CheckDirective, isStandalone: true, selector: "[kendoTreeViewCheckable]", inputs: { isChecked: "isChecked", checkKey: ["checkBy", "checkKey"], checkedKeys: "checkedKeys", checkable: ["kendoTreeViewCheckable", "checkable"] }, outputs: { checkedKeysChange: "checkedKeysChange" }, usesOnChanges: true, ngImport: i0 });
|
|
315
|
-
}
|
|
316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckDirective, decorators: [{
|
|
317
|
-
type: Directive,
|
|
318
|
-
args: [{
|
|
319
|
-
selector: '[kendoTreeViewCheckable]',
|
|
320
|
-
standalone: true
|
|
321
|
-
}]
|
|
322
|
-
}], ctorParameters: () => [{ type: i1.TreeViewComponent }, { type: i0.NgZone }], propDecorators: { isChecked: [{
|
|
323
|
-
type: Input
|
|
324
|
-
}], checkKey: [{
|
|
325
|
-
type: Input,
|
|
326
|
-
args: ["checkBy"]
|
|
327
|
-
}], checkedKeys: [{
|
|
328
|
-
type: Input
|
|
329
|
-
}], checkable: [{
|
|
330
|
-
type: Input,
|
|
331
|
-
args: ['kendoTreeViewCheckable']
|
|
332
|
-
}], checkedKeysChange: [{
|
|
333
|
-
type: Output
|
|
334
|
-
}] } });
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Injectable } from '@angular/core';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*
|
|
10
|
-
* An injection token used by the data binding directives to interface with
|
|
11
|
-
* the TreeView or the DropDownTree components.
|
|
12
|
-
*/
|
|
13
|
-
export class DataBoundComponent {
|
|
14
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataBoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
15
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataBoundComponent });
|
|
16
|
-
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataBoundComponent, decorators: [{
|
|
18
|
-
type: Injectable
|
|
19
|
-
}] });
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { EventEmitter } from '@angular/core';
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
*/
|
|
9
|
-
export class DataChangeNotificationService {
|
|
10
|
-
changes = new EventEmitter();
|
|
11
|
-
notify() {
|
|
12
|
-
this.changes.emit();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export const hasChildren = () => false;
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export const isChecked = () => 'none';
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export const isDisabled = () => false;
|
|
17
|
-
/**
|
|
18
|
-
* @hidden
|
|
19
|
-
*/
|
|
20
|
-
export const hasCheckbox = () => true;
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
export const isExpanded = () => true;
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
export const isSelected = () => false;
|
|
29
|
-
/**
|
|
30
|
-
* @hidden
|
|
31
|
-
*/
|
|
32
|
-
export const isVisible = () => true;
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
export const trackBy = (_, item) => item;
|
package/esm2022/directives.mjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { CheckDirective } from "./check.directive";
|
|
6
|
-
import { DisableDirective } from "./disable.directive";
|
|
7
|
-
import { DragAndDropEditingDirective } from "./drag-and-drop/drag-and-drop-editing.directive";
|
|
8
|
-
import { DragAndDropDirective } from "./drag-and-drop/drag-and-drop.directive";
|
|
9
|
-
import { DragClueTemplateDirective } from "./drag-and-drop/drag-clue/drag-clue-template.directive";
|
|
10
|
-
import { DropHintTemplateDirective } from "./drag-and-drop/drop-hint/drop-hint-template.directive";
|
|
11
|
-
import { ExpandDirective } from "./expand.directive";
|
|
12
|
-
import { FlatDataBindingDirective } from "./flat-binding.directive";
|
|
13
|
-
import { HierarchyBindingDirective } from "./hierarchy-binding.directive";
|
|
14
|
-
import { LoadMoreButtonTemplateDirective } from "./load-more/load-more-button-template.directive";
|
|
15
|
-
import { LoadMoreDirective } from "./load-more/load-more.directive";
|
|
16
|
-
import { CustomMessagesComponent } from "./localization/custom-messages.component";
|
|
17
|
-
import { NodeTemplateDirective } from "./node-template.directive";
|
|
18
|
-
import { SelectDirective } from "./selection/select.directive";
|
|
19
|
-
import { TreeViewComponent } from "./treeview.component";
|
|
20
|
-
/**
|
|
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
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export const KENDO_TREEVIEW = [
|
|
38
|
-
TreeViewComponent,
|
|
39
|
-
NodeTemplateDirective,
|
|
40
|
-
CheckDirective,
|
|
41
|
-
DisableDirective,
|
|
42
|
-
ExpandDirective,
|
|
43
|
-
SelectDirective,
|
|
44
|
-
HierarchyBindingDirective,
|
|
45
|
-
FlatDataBindingDirective,
|
|
46
|
-
DragAndDropDirective,
|
|
47
|
-
DragClueTemplateDirective,
|
|
48
|
-
DropHintTemplateDirective,
|
|
49
|
-
DragAndDropEditingDirective,
|
|
50
|
-
LoadMoreDirective,
|
|
51
|
-
LoadMoreButtonTemplateDirective,
|
|
52
|
-
CustomMessagesComponent
|
|
53
|
-
];
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ChangeDetectorRef, Directive, Input } from '@angular/core';
|
|
6
|
-
import { TreeViewComponent } from './treeview.component';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
import * as i1 from "./treeview.component";
|
|
9
|
-
/**
|
|
10
|
-
* Represents a directive which manages the disabled in-memory state of the TreeView node
|
|
11
|
-
* ([see example]({% slug disabledstate_treeview %})).
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```html
|
|
15
|
-
* <kendo-treeview
|
|
16
|
-
* [nodes]="data"
|
|
17
|
-
* textField="text"
|
|
18
|
-
* [hasChildren]="hasChildren"
|
|
19
|
-
* [children]="fetchChildren"
|
|
20
|
-
* kendoTreeViewDisable
|
|
21
|
-
* [disabledKeys]="disabledKeys">
|
|
22
|
-
* </kendo-treeview>
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* Applied to: {@link TreeViewComponent}
|
|
27
|
-
*/
|
|
28
|
-
export class DisableDirective {
|
|
29
|
-
treeView;
|
|
30
|
-
cdr;
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
set isDisabled(value) {
|
|
35
|
-
this.treeView.isDisabled = value;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Defines the item key that will be stored in the `disabledKeys` collection.
|
|
39
|
-
*/
|
|
40
|
-
disableKey;
|
|
41
|
-
/**
|
|
42
|
-
* Defines the collection that will store the disabled keys.
|
|
43
|
-
*/
|
|
44
|
-
disabledKeys = [];
|
|
45
|
-
constructor(treeView, cdr) {
|
|
46
|
-
this.treeView = treeView;
|
|
47
|
-
this.cdr = cdr;
|
|
48
|
-
this.treeView.isDisabled = (dataItem, index) => (this.disabledKeys.indexOf(this.itemKey({ dataItem, index })) > -1);
|
|
49
|
-
}
|
|
50
|
-
ngOnChanges(changes = {}) {
|
|
51
|
-
const { disabledKeys } = changes;
|
|
52
|
-
if (disabledKeys && !disabledKeys.firstChange) {
|
|
53
|
-
this.cdr.markForCheck();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
itemKey(e) {
|
|
57
|
-
if (!this.disableKey) {
|
|
58
|
-
return e.index;
|
|
59
|
-
}
|
|
60
|
-
if (typeof this.disableKey === "string") {
|
|
61
|
-
return e.dataItem[this.disableKey];
|
|
62
|
-
}
|
|
63
|
-
if (typeof this.disableKey === "function") {
|
|
64
|
-
return this.disableKey(e);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DisableDirective, deps: [{ token: i1.TreeViewComponent }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
68
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: DisableDirective, isStandalone: true, selector: "[kendoTreeViewDisable]", inputs: { isDisabled: "isDisabled", disableKey: ["kendoTreeViewDisable", "disableKey"], disabledKeys: "disabledKeys" }, usesOnChanges: true, ngImport: i0 });
|
|
69
|
-
}
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DisableDirective, decorators: [{
|
|
71
|
-
type: Directive,
|
|
72
|
-
args: [{
|
|
73
|
-
selector: '[kendoTreeViewDisable]',
|
|
74
|
-
standalone: true
|
|
75
|
-
}]
|
|
76
|
-
}], ctorParameters: () => [{ type: i1.TreeViewComponent }, { type: i0.ChangeDetectorRef }], propDecorators: { isDisabled: [{
|
|
77
|
-
type: Input
|
|
78
|
-
}], disableKey: [{
|
|
79
|
-
type: Input,
|
|
80
|
-
args: ["kendoTreeViewDisable"]
|
|
81
|
-
}], disabledKeys: [{
|
|
82
|
-
type: Input
|
|
83
|
-
}] } });
|