@progress/kendo-angular-treeview 25.3.1-develop.2 → 25.4.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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { EventEmitter, Injectable, Optional, Directive, Input, HostBinding, Component, forwardRef, isDevMode, ViewContainerRef, ContentChild, Output, ViewChild,
|
|
6
|
+
import { EventEmitter, Injectable, Optional, Directive, signal, Input, HostBinding, ChangeDetectionStrategy, Component, forwardRef, isDevMode, ViewContainerRef, ContentChild, Output, ViewChild, afterNextRender, Host, NgModule } from '@angular/core';
|
|
7
7
|
import { isDocumentAvailable, Keys, normalizeKeys, anyChanged, provideComponentName, hasObservers, KENDO_WEBMCP_HOST, isChanged, guid, ResizeBatchService } from '@progress/kendo-angular-common';
|
|
8
8
|
import * as i1 from '@progress/kendo-angular-l10n';
|
|
9
9
|
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
@@ -13,7 +13,7 @@ import { getter, setter } from '@progress/kendo-common';
|
|
|
13
13
|
import { chevronDownIcon, chevronRightIcon, chevronLeftIcon, searchIcon, cancelIcon, insertMiddleIcon, insertBottomIcon, insertTopIcon, plusIcon } from '@progress/kendo-svg-icons';
|
|
14
14
|
import { CheckBoxComponent, TextBoxComponent, TextBoxPrefixTemplateDirective } from '@progress/kendo-angular-inputs';
|
|
15
15
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
16
|
-
import { filter, tap, switchMap, delay, takeUntil, catchError, finalize,
|
|
16
|
+
import { filter, tap, switchMap, delay, takeUntil, catchError, finalize, map, take } from 'rxjs/operators';
|
|
17
17
|
import { NgTemplateOutlet } from '@angular/common';
|
|
18
18
|
import { IconWrapperComponent, IconsService } from '@progress/kendo-angular-icons';
|
|
19
19
|
import { Draggable } from '@progress/kendo-draggable';
|
|
@@ -28,8 +28,8 @@ const packageMetadata = {
|
|
|
28
28
|
productName: 'Kendo UI for Angular',
|
|
29
29
|
productCode: 'KENDOUIANGULAR',
|
|
30
30
|
productCodes: ['KENDOUIANGULAR'],
|
|
31
|
-
publishDate:
|
|
32
|
-
version: '25.
|
|
31
|
+
publishDate: 1791873158,
|
|
32
|
+
version: '25.4.0-develop.1',
|
|
33
33
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -1079,11 +1079,19 @@ class TreeViewItemContentWrapperDirective {
|
|
|
1079
1079
|
navigationService;
|
|
1080
1080
|
selectionService;
|
|
1081
1081
|
renderer;
|
|
1082
|
-
dataItem;
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1082
|
+
set dataItem(value) { this._dataItem.set(value); }
|
|
1083
|
+
get dataItem() { return this._dataItem(); }
|
|
1084
|
+
set index(value) { this._index.set(value); }
|
|
1085
|
+
get index() { return this._index(); }
|
|
1086
|
+
set initialSelection(value) { this._initialSelection.set(value); }
|
|
1087
|
+
get initialSelection() { return this._initialSelection(); }
|
|
1088
|
+
set isSelected(value) { this._isSelected.set(value); }
|
|
1089
|
+
get isSelected() { return this._isSelected(); }
|
|
1090
|
+
_isSelected = signal(isSelected, ...(ngDevMode ? [{ debugName: "_isSelected" }] : /* istanbul ignore next */ []));
|
|
1091
|
+
_initialSelection = signal(false, ...(ngDevMode ? [{ debugName: "_initialSelection" }] : /* istanbul ignore next */ []));
|
|
1086
1092
|
subscriptions = new Subscription();
|
|
1093
|
+
_dataItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_dataItem" }] : /* istanbul ignore next */ []));
|
|
1094
|
+
_index = signal(undefined, ...(ngDevMode ? [{ debugName: "_index" }] : /* istanbul ignore next */ []));
|
|
1087
1095
|
constructor(element, navigationService, selectionService, renderer) {
|
|
1088
1096
|
this.element = element;
|
|
1089
1097
|
this.navigationService = navigationService;
|
|
@@ -1145,35 +1153,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
1145
1153
|
class LoadingIndicatorDirective {
|
|
1146
1154
|
expandService;
|
|
1147
1155
|
loadingService;
|
|
1148
|
-
cd;
|
|
1149
1156
|
get loading() {
|
|
1150
|
-
return this._loading;
|
|
1157
|
+
return this._loading();
|
|
1151
1158
|
}
|
|
1152
1159
|
set loading(value) {
|
|
1153
|
-
this._loading
|
|
1154
|
-
this.cd.markForCheck();
|
|
1160
|
+
this._loading.set(value);
|
|
1155
1161
|
}
|
|
1156
1162
|
set index(value) {
|
|
1157
1163
|
// Cancel any pending loading timer when the node's index shifts (e.g., after drag-and-drop reorder)
|
|
1158
|
-
if (this._index !== undefined && this._index !== value) {
|
|
1164
|
+
if (this._index() !== undefined && this._index() !== value) {
|
|
1159
1165
|
this.cancelLoading$.next();
|
|
1160
1166
|
if (this.loading) {
|
|
1161
1167
|
this.loading = false;
|
|
1162
1168
|
}
|
|
1163
1169
|
}
|
|
1164
|
-
this._index
|
|
1170
|
+
this._index.set(value);
|
|
1165
1171
|
}
|
|
1166
1172
|
get index() {
|
|
1167
|
-
return this._index;
|
|
1173
|
+
return this._index();
|
|
1168
1174
|
}
|
|
1169
|
-
_index;
|
|
1170
|
-
_loading = false;
|
|
1175
|
+
_index = signal(null, ...(ngDevMode ? [{ debugName: "_index" }] : /* istanbul ignore next */ []));
|
|
1171
1176
|
cancelLoading$ = new Subject();
|
|
1177
|
+
_loading = signal(false, ...(ngDevMode ? [{ debugName: "_loading" }] : /* istanbul ignore next */ []));
|
|
1172
1178
|
subscription;
|
|
1173
|
-
constructor(expandService, loadingService
|
|
1179
|
+
constructor(expandService, loadingService) {
|
|
1174
1180
|
this.expandService = expandService;
|
|
1175
1181
|
this.loadingService = loadingService;
|
|
1176
|
-
this.cd = cd;
|
|
1177
1182
|
}
|
|
1178
1183
|
ngOnInit() {
|
|
1179
1184
|
const loadingNotifications = this.loadingService
|
|
@@ -1194,7 +1199,7 @@ class LoadingIndicatorDirective {
|
|
|
1194
1199
|
this.subscription.unsubscribe();
|
|
1195
1200
|
}
|
|
1196
1201
|
}
|
|
1197
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: LoadingIndicatorDirective, deps: [{ token: ExpandStateService }, { token: LoadingNotificationService }
|
|
1202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: LoadingIndicatorDirective, deps: [{ token: ExpandStateService }, { token: LoadingNotificationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1198
1203
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.23", type: LoadingIndicatorDirective, isStandalone: true, selector: "[kendoTreeViewLoading]", inputs: { index: ["kendoTreeViewLoading", "index"] }, exportAs: ["kendoTreeViewLoading"], ngImport: i0 });
|
|
1199
1204
|
}
|
|
1200
1205
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: LoadingIndicatorDirective, decorators: [{
|
|
@@ -1204,7 +1209,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
1204
1209
|
exportAs: 'kendoTreeViewLoading',
|
|
1205
1210
|
standalone: true
|
|
1206
1211
|
}]
|
|
1207
|
-
}], ctorParameters: () => [{ type: ExpandStateService }, { type: LoadingNotificationService }
|
|
1212
|
+
}], ctorParameters: () => [{ type: ExpandStateService }, { type: LoadingNotificationService }], propDecorators: { index: [{
|
|
1208
1213
|
type: Input,
|
|
1209
1214
|
args: ["kendoTreeViewLoading"]
|
|
1210
1215
|
}] } });
|
|
@@ -1226,16 +1231,62 @@ class TreeViewItemDirective {
|
|
|
1226
1231
|
lookupService;
|
|
1227
1232
|
renderer;
|
|
1228
1233
|
ib;
|
|
1229
|
-
dataItem
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1234
|
+
set dataItem(value) {
|
|
1235
|
+
this._dataItem.set(value);
|
|
1236
|
+
}
|
|
1237
|
+
get dataItem() {
|
|
1238
|
+
return this._dataItem();
|
|
1239
|
+
}
|
|
1240
|
+
set index(value) {
|
|
1241
|
+
this._index.set(value);
|
|
1242
|
+
}
|
|
1243
|
+
get index() {
|
|
1244
|
+
return this._index();
|
|
1245
|
+
}
|
|
1246
|
+
set parentDataItem(value) {
|
|
1247
|
+
this._parentDataItem.set(value);
|
|
1248
|
+
}
|
|
1249
|
+
get parentDataItem() {
|
|
1250
|
+
return this._parentDataItem();
|
|
1251
|
+
}
|
|
1252
|
+
set parentIndex(value) {
|
|
1253
|
+
this._parentIndex.set(value);
|
|
1254
|
+
}
|
|
1255
|
+
get parentIndex() {
|
|
1256
|
+
return this._parentIndex();
|
|
1257
|
+
}
|
|
1258
|
+
set role(value) {
|
|
1259
|
+
this._role.set(value);
|
|
1260
|
+
}
|
|
1261
|
+
get role() {
|
|
1262
|
+
return this._role();
|
|
1263
|
+
}
|
|
1264
|
+
set loadOnDemand(value) {
|
|
1265
|
+
this._loadOnDemand.set(value);
|
|
1266
|
+
}
|
|
1267
|
+
get loadOnDemand() {
|
|
1268
|
+
return this._loadOnDemand();
|
|
1269
|
+
}
|
|
1270
|
+
set checkable(value) {
|
|
1271
|
+
this._checkable.set(value);
|
|
1272
|
+
}
|
|
1273
|
+
get checkable() {
|
|
1274
|
+
return this._checkable();
|
|
1275
|
+
}
|
|
1276
|
+
set selectable(value) {
|
|
1277
|
+
this._selectable.set(value);
|
|
1278
|
+
}
|
|
1279
|
+
get selectable() {
|
|
1280
|
+
return this._selectable();
|
|
1281
|
+
}
|
|
1282
|
+
set expandable(value) {
|
|
1283
|
+
this._expandable.set(value);
|
|
1284
|
+
}
|
|
1285
|
+
get expandable() {
|
|
1286
|
+
return this._expandable();
|
|
1287
|
+
}
|
|
1238
1288
|
set isChecked(checked) {
|
|
1289
|
+
this._isChecked.set(checked);
|
|
1239
1290
|
if (checked === 'checked') {
|
|
1240
1291
|
this.ariaChecked = 'true';
|
|
1241
1292
|
}
|
|
@@ -1246,19 +1297,29 @@ class TreeViewItemDirective {
|
|
|
1246
1297
|
this.ariaChecked = 'false';
|
|
1247
1298
|
}
|
|
1248
1299
|
}
|
|
1249
|
-
isDisabled
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1300
|
+
set isDisabled(value) {
|
|
1301
|
+
this._isDisabled.set(value);
|
|
1302
|
+
}
|
|
1303
|
+
get isDisabled() {
|
|
1304
|
+
return this._isDisabled();
|
|
1305
|
+
}
|
|
1306
|
+
set isVisible(value) {
|
|
1307
|
+
this._isVisible.set(value);
|
|
1308
|
+
}
|
|
1309
|
+
get isVisible() {
|
|
1310
|
+
return this._isVisible();
|
|
1253
1311
|
}
|
|
1254
1312
|
set isExpanded(isExpanded) {
|
|
1255
|
-
this._isExpanded
|
|
1313
|
+
this._isExpanded.set(isExpanded);
|
|
1256
1314
|
}
|
|
1257
|
-
get
|
|
1258
|
-
return this.
|
|
1315
|
+
get isExpanded() {
|
|
1316
|
+
return this._isExpanded() || false;
|
|
1259
1317
|
}
|
|
1260
1318
|
set isSelected(isSelected) {
|
|
1261
|
-
this._isSelected
|
|
1319
|
+
this._isSelected.set(isSelected);
|
|
1320
|
+
}
|
|
1321
|
+
get isSelected() {
|
|
1322
|
+
return this._isSelected() || false;
|
|
1262
1323
|
}
|
|
1263
1324
|
get isButton() {
|
|
1264
1325
|
return this.role === BUTTON_ROLE;
|
|
@@ -1271,8 +1332,20 @@ class TreeViewItemDirective {
|
|
|
1271
1332
|
}
|
|
1272
1333
|
ariaChecked = 'false';
|
|
1273
1334
|
id = id++;
|
|
1274
|
-
|
|
1275
|
-
|
|
1335
|
+
_dataItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_dataItem" }] : /* istanbul ignore next */ []));
|
|
1336
|
+
_index = signal(undefined, ...(ngDevMode ? [{ debugName: "_index" }] : /* istanbul ignore next */ []));
|
|
1337
|
+
_parentDataItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_parentDataItem" }] : /* istanbul ignore next */ []));
|
|
1338
|
+
_parentIndex = signal(undefined, ...(ngDevMode ? [{ debugName: "_parentIndex" }] : /* istanbul ignore next */ []));
|
|
1339
|
+
_role = signal(TREE_ITEM_ROLE, ...(ngDevMode ? [{ debugName: "_role" }] : /* istanbul ignore next */ []));
|
|
1340
|
+
_loadOnDemand = signal(true, ...(ngDevMode ? [{ debugName: "_loadOnDemand" }] : /* istanbul ignore next */ []));
|
|
1341
|
+
_checkable = signal(undefined, ...(ngDevMode ? [{ debugName: "_checkable" }] : /* istanbul ignore next */ []));
|
|
1342
|
+
_selectable = signal(undefined, ...(ngDevMode ? [{ debugName: "_selectable" }] : /* istanbul ignore next */ []));
|
|
1343
|
+
_expandable = signal(undefined, ...(ngDevMode ? [{ debugName: "_expandable" }] : /* istanbul ignore next */ []));
|
|
1344
|
+
_isChecked = signal(undefined, ...(ngDevMode ? [{ debugName: "_isChecked" }] : /* istanbul ignore next */ []));
|
|
1345
|
+
_isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_isDisabled" }] : /* istanbul ignore next */ []));
|
|
1346
|
+
_isVisible = signal(true, ...(ngDevMode ? [{ debugName: "_isVisible" }] : /* istanbul ignore next */ []));
|
|
1347
|
+
_isExpanded = signal(false, ...(ngDevMode ? [{ debugName: "_isExpanded" }] : /* istanbul ignore next */ []));
|
|
1348
|
+
_isSelected = signal(false, ...(ngDevMode ? [{ debugName: "_isSelected" }] : /* istanbul ignore next */ []));
|
|
1276
1349
|
isInitialized = false;
|
|
1277
1350
|
subscriptions = [];
|
|
1278
1351
|
constructor(element, expandService, navigationService, selectionService, lookupService, renderer, ib) {
|
|
@@ -1470,31 +1543,49 @@ class TreeViewGroupComponent {
|
|
|
1470
1543
|
/**
|
|
1471
1544
|
* @hidden
|
|
1472
1545
|
*/
|
|
1473
|
-
loadMoreTitle;
|
|
1546
|
+
loadMoreTitle = signal(undefined, ...(ngDevMode ? [{ debugName: "loadMoreTitle" }] : /* istanbul ignore next */ []));
|
|
1474
1547
|
kGroupClass = true;
|
|
1475
1548
|
get role() {
|
|
1476
1549
|
return this.parentIndex ? 'group' : 'tree';
|
|
1477
1550
|
}
|
|
1478
|
-
checkboxes;
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1551
|
+
set checkboxes(value) { this._checkboxes.set(value); }
|
|
1552
|
+
get checkboxes() { return this._checkboxes(); }
|
|
1553
|
+
set loadMoreButtonRole(value) { this._loadMoreButtonRole.set(value); }
|
|
1554
|
+
get loadMoreButtonRole() { return this._loadMoreButtonRole(); }
|
|
1555
|
+
set expandIcons(value) { this._expandIcons.set(value); }
|
|
1556
|
+
get expandIcons() { return this._expandIcons(); }
|
|
1557
|
+
set disabled(value) { this._disabled.set(value); }
|
|
1558
|
+
get disabled() { return this._disabled(); }
|
|
1559
|
+
set selectable(value) { this._selectable.set(value); }
|
|
1560
|
+
get selectable() { return this._selectable(); }
|
|
1561
|
+
set touchActions(value) { this._touchActions.set(value); }
|
|
1562
|
+
get touchActions() { return this._touchActions(); }
|
|
1563
|
+
set disableParentNodesOnly(value) { this._disableParentNodesOnly.set(value); }
|
|
1564
|
+
get disableParentNodesOnly() { return this._disableParentNodesOnly(); }
|
|
1565
|
+
set loadOnDemand(value) { this._loadOnDemand.set(value); }
|
|
1566
|
+
get loadOnDemand() { return this._loadOnDemand(); }
|
|
1567
|
+
set trackBy(value) { this._trackBy.set(value); }
|
|
1568
|
+
get trackBy() { return this._trackBy(); }
|
|
1569
|
+
set nodes(value) { this._nodes.set(value); }
|
|
1570
|
+
get nodes() { return this._nodes(); }
|
|
1571
|
+
set textField(value) { this._textField.set(value); }
|
|
1572
|
+
get textField() { return this._textField(); }
|
|
1573
|
+
set parentDataItem(value) { this._parentDataItem.set(value); }
|
|
1574
|
+
get parentDataItem() { return this._parentDataItem(); }
|
|
1575
|
+
set parentIndex(value) { this._parentIndex.set(value); }
|
|
1576
|
+
get parentIndex() { return this._parentIndex(); }
|
|
1577
|
+
set nodeTemplateRef(value) { this._nodeTemplateRef.set(value); }
|
|
1578
|
+
get nodeTemplateRef() { return this._nodeTemplateRef(); }
|
|
1579
|
+
set loadMoreButtonTemplateRef(value) { this._loadMoreButtonTemplateRef.set(value); }
|
|
1580
|
+
get loadMoreButtonTemplateRef() { return this._loadMoreButtonTemplateRef(); }
|
|
1581
|
+
set loadMoreService(value) { this._loadMoreService.set(value); }
|
|
1582
|
+
get loadMoreService() { return this._loadMoreService(); }
|
|
1583
|
+
set size(value) { this._size.set(value); }
|
|
1584
|
+
get size() { return this._size(); }
|
|
1585
|
+
set expandDisabledNodes(value) { this._expandDisabledNodes.set(value); }
|
|
1586
|
+
get expandDisabledNodes() { return this._expandDisabledNodes(); }
|
|
1587
|
+
initialNodesLoaded = signal(false, ...(ngDevMode ? [{ debugName: "initialNodesLoaded" }] : /* istanbul ignore next */ []));
|
|
1588
|
+
loadingMoreNodes = signal(false, ...(ngDevMode ? [{ debugName: "loadingMoreNodes" }] : /* istanbul ignore next */ []));
|
|
1498
1589
|
isItemExpandable = (node, index) => this.expandDisabledNodes || !this.isItemDisabled(node, index);
|
|
1499
1590
|
isContentDisabled(node, index) {
|
|
1500
1591
|
return this.expandIcons && this.hasChildren(node) ? !this.isItemExpandable(node, index) : this.isItemDisabled(node, index);
|
|
@@ -1529,12 +1620,12 @@ class TreeViewGroupComponent {
|
|
|
1529
1620
|
get data() {
|
|
1530
1621
|
if (isPresent(this.pageSize)) {
|
|
1531
1622
|
const normalizedSizeValue = this.pageSize > 0 ? this.pageSize : 0;
|
|
1532
|
-
return this._data.slice(0, normalizedSizeValue);
|
|
1623
|
+
return this._data().slice(0, normalizedSizeValue);
|
|
1533
1624
|
}
|
|
1534
|
-
return this._data;
|
|
1625
|
+
return this._data();
|
|
1535
1626
|
}
|
|
1536
1627
|
set data(data) {
|
|
1537
|
-
this._data
|
|
1628
|
+
this._data.set(data);
|
|
1538
1629
|
this.registerLoadedNodes(this.data);
|
|
1539
1630
|
}
|
|
1540
1631
|
get loadMoreButtonIndex() {
|
|
@@ -1550,13 +1641,39 @@ class TreeViewGroupComponent {
|
|
|
1550
1641
|
if (!this.loadMoreService) {
|
|
1551
1642
|
return this.data.length;
|
|
1552
1643
|
}
|
|
1553
|
-
return this.loadMoreService.getTotalNodesCount(this.parentDataItem, this._data.length);
|
|
1644
|
+
return this.loadMoreService.getTotalNodesCount(this.parentDataItem, this._data().length);
|
|
1554
1645
|
}
|
|
1555
|
-
_data = [];
|
|
1646
|
+
_data = signal([], ...(ngDevMode ? [{ debugName: "_data" }] : /* istanbul ignore next */ []));
|
|
1556
1647
|
nodesSubscription;
|
|
1557
1648
|
loadMoreNodesSubscription;
|
|
1558
1649
|
singleRecordSubscriptions = new Subscription();
|
|
1559
1650
|
localizationSubscriptions = new Subscription();
|
|
1651
|
+
_checkboxes = signal(undefined, ...(ngDevMode ? [{ debugName: "_checkboxes" }] : /* istanbul ignore next */ []));
|
|
1652
|
+
_expandIcons = signal(undefined, ...(ngDevMode ? [{ debugName: "_expandIcons" }] : /* istanbul ignore next */ []));
|
|
1653
|
+
_disabled = signal(undefined, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
1654
|
+
_selectable = signal(undefined, ...(ngDevMode ? [{ debugName: "_selectable" }] : /* istanbul ignore next */ []));
|
|
1655
|
+
_touchActions = signal(undefined, ...(ngDevMode ? [{ debugName: "_touchActions" }] : /* istanbul ignore next */ []));
|
|
1656
|
+
_disableParentNodesOnly = signal(undefined, ...(ngDevMode ? [{ debugName: "_disableParentNodesOnly" }] : /* istanbul ignore next */ []));
|
|
1657
|
+
_loadOnDemand = signal(true, ...(ngDevMode ? [{ debugName: "_loadOnDemand" }] : /* istanbul ignore next */ []));
|
|
1658
|
+
_trackBy = signal(undefined, ...(ngDevMode ? [{ debugName: "_trackBy" }] : /* istanbul ignore next */ []));
|
|
1659
|
+
_nodes = signal(undefined, ...(ngDevMode ? [{ debugName: "_nodes" }] : /* istanbul ignore next */ []));
|
|
1660
|
+
_textField = signal('', ...(ngDevMode ? [{ debugName: "_textField" }] : /* istanbul ignore next */ []));
|
|
1661
|
+
_parentDataItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_parentDataItem" }] : /* istanbul ignore next */ []));
|
|
1662
|
+
_parentIndex = signal(undefined, ...(ngDevMode ? [{ debugName: "_parentIndex" }] : /* istanbul ignore next */ []));
|
|
1663
|
+
_nodeTemplateRef = signal(undefined, ...(ngDevMode ? [{ debugName: "_nodeTemplateRef" }] : /* istanbul ignore next */ []));
|
|
1664
|
+
_loadMoreButtonTemplateRef = signal(undefined, ...(ngDevMode ? [{ debugName: "_loadMoreButtonTemplateRef" }] : /* istanbul ignore next */ []));
|
|
1665
|
+
_loadMoreService = signal(undefined, ...(ngDevMode ? [{ debugName: "_loadMoreService" }] : /* istanbul ignore next */ []));
|
|
1666
|
+
_size = signal(undefined, ...(ngDevMode ? [{ debugName: "_size" }] : /* istanbul ignore next */ []));
|
|
1667
|
+
_expandDisabledNodes = signal(undefined, ...(ngDevMode ? [{ debugName: "_expandDisabledNodes" }] : /* istanbul ignore next */ []));
|
|
1668
|
+
_loadMoreButtonRole = signal(undefined, ...(ngDevMode ? [{ debugName: "_loadMoreButtonRole" }] : /* istanbul ignore next */ []));
|
|
1669
|
+
_isChecked = signal(() => 'none', ...(ngDevMode ? [{ debugName: "_isChecked" }] : /* istanbul ignore next */ []));
|
|
1670
|
+
_isDisabled = signal(() => false, ...(ngDevMode ? [{ debugName: "_isDisabled" }] : /* istanbul ignore next */ []));
|
|
1671
|
+
_hasCheckbox = signal(() => true, ...(ngDevMode ? [{ debugName: "_hasCheckbox" }] : /* istanbul ignore next */ []));
|
|
1672
|
+
_isExpanded = signal(() => false, ...(ngDevMode ? [{ debugName: "_isExpanded" }] : /* istanbul ignore next */ []));
|
|
1673
|
+
_isVisible = signal(() => true, ...(ngDevMode ? [{ debugName: "_isVisible" }] : /* istanbul ignore next */ []));
|
|
1674
|
+
_isSelected = signal(() => false, ...(ngDevMode ? [{ debugName: "_isSelected" }] : /* istanbul ignore next */ []));
|
|
1675
|
+
_children = signal(() => of([]), ...(ngDevMode ? [{ debugName: "_children" }] : /* istanbul ignore next */ []));
|
|
1676
|
+
_hasChildren = signal(() => false, ...(ngDevMode ? [{ debugName: "_hasChildren" }] : /* istanbul ignore next */ []));
|
|
1560
1677
|
constructor(expandService, loadingService, indexBuilder, treeViewLookupService, navigationService, nodeChildrenService, dataChangeNotification, changeDetectorRef, localization, renderer) {
|
|
1561
1678
|
this.expandService = expandService;
|
|
1562
1679
|
this.loadingService = loadingService;
|
|
@@ -1569,14 +1686,22 @@ class TreeViewGroupComponent {
|
|
|
1569
1686
|
this.localization = localization;
|
|
1570
1687
|
this.renderer = renderer;
|
|
1571
1688
|
}
|
|
1572
|
-
isChecked
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1689
|
+
set isChecked(value) { this._isChecked.set(value); }
|
|
1690
|
+
get isChecked() { return this._isChecked(); }
|
|
1691
|
+
set isDisabled(value) { this._isDisabled.set(value); }
|
|
1692
|
+
get isDisabled() { return this._isDisabled(); }
|
|
1693
|
+
set hasCheckbox(value) { this._hasCheckbox.set(value); }
|
|
1694
|
+
get hasCheckbox() { return this._hasCheckbox(); }
|
|
1695
|
+
set isExpanded(value) { this._isExpanded.set(value); }
|
|
1696
|
+
get isExpanded() { return this._isExpanded(); }
|
|
1697
|
+
set isVisible(value) { this._isVisible.set(value); }
|
|
1698
|
+
get isVisible() { return this._isVisible(); }
|
|
1699
|
+
set isSelected(value) { this._isSelected.set(value); }
|
|
1700
|
+
get isSelected() { return this._isSelected(); }
|
|
1701
|
+
set children(value) { this._children.set(value); }
|
|
1702
|
+
get children() { return this._children(); }
|
|
1703
|
+
set hasChildren(value) { this._hasChildren.set(value); }
|
|
1704
|
+
get hasChildren() { return this._hasChildren(); }
|
|
1580
1705
|
get hasTemplate() {
|
|
1581
1706
|
return isPresent(this.nodeTemplateRef);
|
|
1582
1707
|
}
|
|
@@ -1631,20 +1756,29 @@ class TreeViewGroupComponent {
|
|
|
1631
1756
|
.pipe(filter(index => index === this.loadMoreButtonIndex))
|
|
1632
1757
|
.subscribe(this.loadMoreNodes.bind(this)));
|
|
1633
1758
|
this.localizationSubscriptions.add(this.localization.changes.subscribe(this.l10nChange.bind(this)));
|
|
1759
|
+
// Keyboard check (Space) and selection (Enter) happen outside Angular's change detection
|
|
1760
|
+
// because the keydown handler runs outside the zone. The OnPush component is not
|
|
1761
|
+
// automatically marked dirty by keyboard events the way it is by click events, so
|
|
1762
|
+
// we have to mark it explicitly whenever a check or selection action is triggered.
|
|
1763
|
+
this.singleRecordSubscriptions.add(this.navigationService.checks
|
|
1764
|
+
.subscribe(() => this.changeDetectorRef.markForCheck()));
|
|
1765
|
+
this.singleRecordSubscriptions.add(this.navigationService.selects
|
|
1766
|
+
.subscribe(() => this.changeDetectorRef.markForCheck()));
|
|
1767
|
+
this.singleRecordSubscriptions.add(this.navigationService.deselectAllButCurrentItem
|
|
1768
|
+
.subscribe(() => this.changeDetectorRef.markForCheck()));
|
|
1634
1769
|
}
|
|
1635
1770
|
ngOnChanges(changes) {
|
|
1636
1771
|
if (changes.parentIndex && this.loadOnDemand) {
|
|
1637
1772
|
this.setNodeChildren(this.mapToTreeItem(this.data));
|
|
1638
1773
|
}
|
|
1639
1774
|
if (this.localization.get('loadMore')) {
|
|
1640
|
-
this.loadMoreTitle
|
|
1775
|
+
this.loadMoreTitle.set(this.localization.get('loadMore'));
|
|
1641
1776
|
}
|
|
1642
1777
|
}
|
|
1643
1778
|
l10nChange() {
|
|
1644
1779
|
if (this.localization.get('loadMore')) {
|
|
1645
|
-
this.loadMoreTitle
|
|
1780
|
+
this.loadMoreTitle.set(this.localization.get('loadMore'));
|
|
1646
1781
|
}
|
|
1647
|
-
this.changeDetectorRef.markForCheck();
|
|
1648
1782
|
}
|
|
1649
1783
|
fetchChildren(node, index) {
|
|
1650
1784
|
return this.children(node)
|
|
@@ -1682,10 +1816,10 @@ class TreeViewGroupComponent {
|
|
|
1682
1816
|
this.reselectItemAt(initialLoadMoreButtonIndex);
|
|
1683
1817
|
}
|
|
1684
1818
|
fetchMoreNodes() {
|
|
1685
|
-
if (this.loadingMoreNodes) {
|
|
1819
|
+
if (this.loadingMoreNodes()) {
|
|
1686
1820
|
return;
|
|
1687
1821
|
}
|
|
1688
|
-
this.loadingMoreNodes
|
|
1822
|
+
this.loadingMoreNodes.set(true);
|
|
1689
1823
|
if (isPresent(this.loadMoreNodesSubscription)) {
|
|
1690
1824
|
this.loadMoreNodesSubscription.unsubscribe();
|
|
1691
1825
|
}
|
|
@@ -1695,7 +1829,7 @@ class TreeViewGroupComponent {
|
|
|
1695
1829
|
skip: this.data.length,
|
|
1696
1830
|
take: this.loadMoreService.getInitialPageSize(this.parentDataItem)
|
|
1697
1831
|
})
|
|
1698
|
-
.pipe(finalize(() => this.loadingMoreNodes
|
|
1832
|
+
.pipe(finalize(() => this.loadingMoreNodes.set(false)))
|
|
1699
1833
|
.subscribe(items => {
|
|
1700
1834
|
if (!(Array.isArray(items) && items.length > 0)) {
|
|
1701
1835
|
return;
|
|
@@ -1734,7 +1868,8 @@ class TreeViewGroupComponent {
|
|
|
1734
1868
|
this.nodesSubscription = this.nodes(this.parentDataItem, this.parentIndex)
|
|
1735
1869
|
.subscribe(data => {
|
|
1736
1870
|
this.data = data;
|
|
1737
|
-
this.initialNodesLoaded
|
|
1871
|
+
this.initialNodesLoaded.set(true);
|
|
1872
|
+
this.changeDetectorRef.markForCheck();
|
|
1738
1873
|
});
|
|
1739
1874
|
}
|
|
1740
1875
|
reselectItemAt(index) {
|
|
@@ -1753,7 +1888,7 @@ class TreeViewGroupComponent {
|
|
|
1753
1888
|
this.emitChildrenLoaded(mappedChildren);
|
|
1754
1889
|
}
|
|
1755
1890
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TreeViewGroupComponent, deps: [{ token: ExpandStateService }, { token: LoadingNotificationService }, { token: IndexBuilderService }, { token: TreeViewLookupService }, { token: NavigationService }, { token: NodeChildrenService }, { token: DataChangeNotificationService }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
1756
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TreeViewGroupComponent, isStandalone: true, selector: "[kendoTreeViewGroup]", inputs: { checkboxes: "checkboxes", expandIcons: "expandIcons", disabled: "disabled", selectable: "selectable", touchActions: "touchActions", disableParentNodesOnly: "disableParentNodesOnly", loadOnDemand: "loadOnDemand", trackBy: "trackBy", nodes: "nodes", textField: "textField", parentDataItem: "parentDataItem", parentIndex: "parentIndex", nodeTemplateRef: "nodeTemplateRef", loadMoreButtonTemplateRef: "loadMoreButtonTemplateRef",
|
|
1891
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TreeViewGroupComponent, isStandalone: true, selector: "[kendoTreeViewGroup]", inputs: { checkboxes: "checkboxes", loadMoreButtonRole: "loadMoreButtonRole", expandIcons: "expandIcons", disabled: "disabled", selectable: "selectable", touchActions: "touchActions", disableParentNodesOnly: "disableParentNodesOnly", loadOnDemand: "loadOnDemand", trackBy: "trackBy", nodes: "nodes", textField: "textField", parentDataItem: "parentDataItem", parentIndex: "parentIndex", nodeTemplateRef: "nodeTemplateRef", loadMoreButtonTemplateRef: "loadMoreButtonTemplateRef", loadMoreService: "loadMoreService", size: "size", expandDisabledNodes: "expandDisabledNodes", isChecked: "isChecked", isDisabled: "isDisabled", hasCheckbox: "hasCheckbox", isExpanded: "isExpanded", isVisible: "isVisible", isSelected: "isSelected", children: "children", hasChildren: "hasChildren" }, host: { properties: { "class.k-treeview-group": "this.kGroupClass", "attr.role": "this.role" } }, usesOnChanges: true, ngImport: i0, template: `
|
|
1757
1892
|
@for (node of data; track trackBy ? trackBy(index, node) : index; let index = $index) {
|
|
1758
1893
|
<li
|
|
1759
1894
|
class="k-treeview-item"
|
|
@@ -1872,7 +2007,7 @@ class TreeViewGroupComponent {
|
|
|
1872
2007
|
}
|
|
1873
2008
|
</li>
|
|
1874
2009
|
}
|
|
1875
|
-
@if (initialNodesLoaded && moreNodesAvailable) {
|
|
2010
|
+
@if (initialNodesLoaded() && moreNodesAvailable) {
|
|
1876
2011
|
<li
|
|
1877
2012
|
class="k-treeview-item"
|
|
1878
2013
|
kendoTreeViewItem
|
|
@@ -1889,7 +2024,7 @@ class TreeViewGroupComponent {
|
|
|
1889
2024
|
kendoTreeViewItemContentWrapper
|
|
1890
2025
|
[index]="loadMoreButtonIndex"
|
|
1891
2026
|
class="k-treeview-item-content">
|
|
1892
|
-
@if (loadingMoreNodes) {
|
|
2027
|
+
@if (loadingMoreNodes()) {
|
|
1893
2028
|
<span
|
|
1894
2029
|
class="k-icon k-i-loading"
|
|
1895
2030
|
>
|
|
@@ -1910,14 +2045,14 @@ class TreeViewGroupComponent {
|
|
|
1910
2045
|
</ng-template>
|
|
1911
2046
|
}
|
|
1912
2047
|
@if (!loadMoreButtonTemplateRef) {
|
|
1913
|
-
{{ loadMoreTitle }}
|
|
2048
|
+
{{ loadMoreTitle() }}
|
|
1914
2049
|
}
|
|
1915
2050
|
</span>
|
|
1916
2051
|
</span>
|
|
1917
2052
|
</div>
|
|
1918
2053
|
</li>
|
|
1919
2054
|
}
|
|
1920
|
-
`, isInline: true, dependencies: [{ kind: "component", type: TreeViewGroupComponent, selector: "[kendoTreeViewGroup]", inputs: ["checkboxes", "expandIcons", "disabled", "selectable", "touchActions", "disableParentNodesOnly", "loadOnDemand", "trackBy", "nodes", "textField", "parentDataItem", "parentIndex", "nodeTemplateRef", "loadMoreButtonTemplateRef", "
|
|
2055
|
+
`, isInline: true, dependencies: [{ kind: "component", type: TreeViewGroupComponent, selector: "[kendoTreeViewGroup]", inputs: ["checkboxes", "loadMoreButtonRole", "expandIcons", "disabled", "selectable", "touchActions", "disableParentNodesOnly", "loadOnDemand", "trackBy", "nodes", "textField", "parentDataItem", "parentIndex", "nodeTemplateRef", "loadMoreButtonTemplateRef", "loadMoreService", "size", "expandDisabledNodes", "isChecked", "isDisabled", "hasCheckbox", "isExpanded", "isVisible", "isSelected", "children", "hasChildren"] }, { kind: "directive", type: TreeViewItemDirective, selector: "[kendoTreeViewItem]", inputs: ["dataItem", "index", "parentDataItem", "parentIndex", "role", "loadOnDemand", "checkable", "selectable", "expandable", "isChecked", "isDisabled", "isVisible", "isExpanded", "isSelected"] }, { kind: "directive", type: LoadingIndicatorDirective, selector: "[kendoTreeViewLoading]", inputs: ["kendoTreeViewLoading"], exportAs: ["kendoTreeViewLoading"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }, { kind: "directive", type: TreeViewItemContentWrapperDirective, selector: "[kendoTreeViewItemContentWrapper]", inputs: ["dataItem", "index", "initialSelection", "isSelected"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], animations: [
|
|
1921
2056
|
trigger('toggle', [
|
|
1922
2057
|
transition('void => *', [
|
|
1923
2058
|
style({ height: 0 }),
|
|
@@ -1928,7 +2063,7 @@ class TreeViewGroupComponent {
|
|
|
1928
2063
|
animate('0.1s ease-in', style({ height: 0 }))
|
|
1929
2064
|
])
|
|
1930
2065
|
])
|
|
1931
|
-
] });
|
|
2066
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1932
2067
|
}
|
|
1933
2068
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TreeViewGroupComponent, decorators: [{
|
|
1934
2069
|
type: Component,
|
|
@@ -1945,6 +2080,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
1945
2080
|
])
|
|
1946
2081
|
])
|
|
1947
2082
|
],
|
|
2083
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1948
2084
|
selector: '[kendoTreeViewGroup]',
|
|
1949
2085
|
template: `
|
|
1950
2086
|
@for (node of data; track trackBy ? trackBy(index, node) : index; let index = $index) {
|
|
@@ -2065,7 +2201,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
2065
2201
|
}
|
|
2066
2202
|
</li>
|
|
2067
2203
|
}
|
|
2068
|
-
@if (initialNodesLoaded && moreNodesAvailable) {
|
|
2204
|
+
@if (initialNodesLoaded() && moreNodesAvailable) {
|
|
2069
2205
|
<li
|
|
2070
2206
|
class="k-treeview-item"
|
|
2071
2207
|
kendoTreeViewItem
|
|
@@ -2082,7 +2218,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
2082
2218
|
kendoTreeViewItemContentWrapper
|
|
2083
2219
|
[index]="loadMoreButtonIndex"
|
|
2084
2220
|
class="k-treeview-item-content">
|
|
2085
|
-
@if (loadingMoreNodes) {
|
|
2221
|
+
@if (loadingMoreNodes()) {
|
|
2086
2222
|
<span
|
|
2087
2223
|
class="k-icon k-i-loading"
|
|
2088
2224
|
>
|
|
@@ -2103,7 +2239,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
2103
2239
|
</ng-template>
|
|
2104
2240
|
}
|
|
2105
2241
|
@if (!loadMoreButtonTemplateRef) {
|
|
2106
|
-
{{ loadMoreTitle }}
|
|
2242
|
+
{{ loadMoreTitle() }}
|
|
2107
2243
|
}
|
|
2108
2244
|
</span>
|
|
2109
2245
|
</span>
|
|
@@ -2122,6 +2258,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
2122
2258
|
args: ["attr.role"]
|
|
2123
2259
|
}], checkboxes: [{
|
|
2124
2260
|
type: Input
|
|
2261
|
+
}], loadMoreButtonRole: [{
|
|
2262
|
+
type: Input
|
|
2125
2263
|
}], expandIcons: [{
|
|
2126
2264
|
type: Input
|
|
2127
2265
|
}], disabled: [{
|
|
@@ -2148,8 +2286,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
2148
2286
|
type: Input
|
|
2149
2287
|
}], loadMoreButtonTemplateRef: [{
|
|
2150
2288
|
type: Input
|
|
2151
|
-
}], loadMoreButtonRole: [{
|
|
2152
|
-
type: Input
|
|
2153
2289
|
}], loadMoreService: [{
|
|
2154
2290
|
type: Input
|
|
2155
2291
|
}], size: [{
|
|
@@ -2181,7 +2317,13 @@ class TreeViewMessages extends ComponentMessages {
|
|
|
2181
2317
|
/**
|
|
2182
2318
|
* Sets the text for the `Load More` button title.
|
|
2183
2319
|
*/
|
|
2184
|
-
loadMore
|
|
2320
|
+
set loadMore(value) {
|
|
2321
|
+
this._loadMore.set(value);
|
|
2322
|
+
}
|
|
2323
|
+
get loadMore() {
|
|
2324
|
+
return this._loadMore();
|
|
2325
|
+
}
|
|
2326
|
+
_loadMore = signal(null, ...(ngDevMode ? [{ debugName: "_loadMore" }] : /* istanbul ignore next */ []));
|
|
2185
2327
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TreeViewMessages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
2186
2328
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.23", type: TreeViewMessages, isStandalone: true, selector: "kendo-treeview-messages-base", inputs: { loadMore: "loadMore" }, usesInheritance: true, ngImport: i0 });
|
|
2187
2329
|
}
|
|
@@ -2300,21 +2442,31 @@ class TreeViewComponent {
|
|
|
2300
2442
|
/**
|
|
2301
2443
|
* Sets the placeholder text for the filter input when the component is empty.
|
|
2302
2444
|
*/
|
|
2303
|
-
filterInputPlaceholder
|
|
2445
|
+
set filterInputPlaceholder(value) {
|
|
2446
|
+
this._filterInputPlaceholder.set(value);
|
|
2447
|
+
}
|
|
2448
|
+
get filterInputPlaceholder() {
|
|
2449
|
+
return this._filterInputPlaceholder();
|
|
2450
|
+
}
|
|
2304
2451
|
/**
|
|
2305
2452
|
* Allows expanding disabled nodes.
|
|
2306
2453
|
*
|
|
2307
2454
|
* @default false
|
|
2308
2455
|
*/
|
|
2309
|
-
expandDisabledNodes
|
|
2456
|
+
set expandDisabledNodes(value) {
|
|
2457
|
+
this._expandDisabledNodes.set(value);
|
|
2458
|
+
}
|
|
2459
|
+
get expandDisabledNodes() {
|
|
2460
|
+
return this._expandDisabledNodes();
|
|
2461
|
+
}
|
|
2310
2462
|
/**
|
|
2311
2463
|
* Enables or disables content animation.
|
|
2312
2464
|
*/
|
|
2313
2465
|
set animate(value) {
|
|
2314
|
-
this._animate
|
|
2466
|
+
this._animate.set(value);
|
|
2315
2467
|
}
|
|
2316
2468
|
get animate() {
|
|
2317
|
-
return !this._animate;
|
|
2469
|
+
return !this._animate();
|
|
2318
2470
|
}
|
|
2319
2471
|
/** @hidden */
|
|
2320
2472
|
fetchNodes = () => this.data;
|
|
@@ -2406,10 +2558,10 @@ class TreeViewComponent {
|
|
|
2406
2558
|
* Takes precedence over nested templates in the TreeView tag.
|
|
2407
2559
|
*/
|
|
2408
2560
|
set nodeTemplateRef(template) {
|
|
2409
|
-
this._nodeTemplateRef
|
|
2561
|
+
this._nodeTemplateRef.set(template);
|
|
2410
2562
|
}
|
|
2411
2563
|
get nodeTemplateRef() {
|
|
2412
|
-
return this._nodeTemplateRef || this.nodeTemplateQuery;
|
|
2564
|
+
return this._nodeTemplateRef() || this.nodeTemplateQuery;
|
|
2413
2565
|
}
|
|
2414
2566
|
/**
|
|
2415
2567
|
* @hidden
|
|
@@ -2425,10 +2577,10 @@ class TreeViewComponent {
|
|
|
2425
2577
|
* Takes precedence over nested templates in the TreeView tag.
|
|
2426
2578
|
*/
|
|
2427
2579
|
set loadMoreButtonTemplateRef(template) {
|
|
2428
|
-
this._loadMoreButtonTemplateRef
|
|
2580
|
+
this._loadMoreButtonTemplateRef.set(template);
|
|
2429
2581
|
}
|
|
2430
2582
|
get loadMoreButtonTemplateRef() {
|
|
2431
|
-
return this._loadMoreButtonTemplateRef || this.loadMoreButtonTemplateQuery;
|
|
2583
|
+
return this._loadMoreButtonTemplateRef() || this.loadMoreButtonTemplateQuery;
|
|
2432
2584
|
}
|
|
2433
2585
|
/**
|
|
2434
2586
|
* @hidden
|
|
@@ -2436,12 +2588,22 @@ class TreeViewComponent {
|
|
|
2436
2588
|
* Overrides the role attribute on the load-more button element.
|
|
2437
2589
|
* Used by DropDownTree to set role="treeitem" for a11y compliance.
|
|
2438
2590
|
*/
|
|
2439
|
-
loadMoreButtonRole
|
|
2591
|
+
set loadMoreButtonRole(value) {
|
|
2592
|
+
this._loadMoreButtonRole.set(value);
|
|
2593
|
+
}
|
|
2594
|
+
get loadMoreButtonRole() {
|
|
2595
|
+
return this._loadMoreButtonRole();
|
|
2596
|
+
}
|
|
2440
2597
|
/**
|
|
2441
2598
|
* A function that defines how to track node changes.
|
|
2442
2599
|
* By default, the TreeView tracks the nodes by data item object reference.
|
|
2443
2600
|
*/
|
|
2444
|
-
trackBy
|
|
2601
|
+
set trackBy(value) {
|
|
2602
|
+
this._trackBy.set(value);
|
|
2603
|
+
}
|
|
2604
|
+
get trackBy() {
|
|
2605
|
+
return this._trackBy();
|
|
2606
|
+
}
|
|
2445
2607
|
/**
|
|
2446
2608
|
* The nodes displayed by the TreeView ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/data-binding)).
|
|
2447
2609
|
*/
|
|
@@ -2456,60 +2618,80 @@ class TreeViewComponent {
|
|
|
2456
2618
|
* The fields of the data item that provide the text content of the nodes ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/data-binding)).
|
|
2457
2619
|
* If set to an array, each level uses the field at the same index or the last item in the array.
|
|
2458
2620
|
*/
|
|
2459
|
-
textField
|
|
2621
|
+
set textField(value) {
|
|
2622
|
+
this._textField.set(value);
|
|
2623
|
+
}
|
|
2624
|
+
get textField() {
|
|
2625
|
+
return this._textField();
|
|
2626
|
+
}
|
|
2460
2627
|
/**
|
|
2461
2628
|
* A function that determines if a node has child nodes ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/data-binding)).
|
|
2462
2629
|
*/
|
|
2463
2630
|
get hasChildren() {
|
|
2464
|
-
return this._hasChildren || hasChildren;
|
|
2631
|
+
return this._hasChildren() || hasChildren;
|
|
2465
2632
|
}
|
|
2466
2633
|
set hasChildren(callback) {
|
|
2467
|
-
this._hasChildren
|
|
2468
|
-
this.expandIcons = Boolean(this._isExpanded && this._hasChildren);
|
|
2634
|
+
this._hasChildren.set(callback);
|
|
2635
|
+
this.expandIcons = Boolean(this._isExpanded() && this._hasChildren());
|
|
2469
2636
|
}
|
|
2470
2637
|
/**
|
|
2471
2638
|
* A function that determines if a node is checked ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/checkboxes#modifying-the-checked-state)).
|
|
2472
2639
|
*/
|
|
2473
2640
|
get isChecked() {
|
|
2474
|
-
return this._isChecked || isChecked;
|
|
2641
|
+
return this._isChecked() || isChecked;
|
|
2475
2642
|
}
|
|
2476
2643
|
set isChecked(callback) {
|
|
2477
|
-
this._isChecked
|
|
2478
|
-
this.checkboxes = Boolean(this._isChecked);
|
|
2644
|
+
this._isChecked.set(callback);
|
|
2645
|
+
this.checkboxes = Boolean(this._isChecked());
|
|
2479
2646
|
}
|
|
2480
2647
|
/**
|
|
2481
2648
|
* A function that determines if a node is disabled.
|
|
2482
2649
|
*/
|
|
2483
|
-
isDisabled
|
|
2650
|
+
set isDisabled(value) {
|
|
2651
|
+
this._isDisabled.set(value);
|
|
2652
|
+
}
|
|
2653
|
+
get isDisabled() {
|
|
2654
|
+
return this._isDisabled();
|
|
2655
|
+
}
|
|
2484
2656
|
/**
|
|
2485
2657
|
* A function that determines if a node has a checkbox. If there is no checkbox, the node is not checkable and is excluded from built-in check functionality.
|
|
2486
2658
|
*/
|
|
2487
|
-
hasCheckbox
|
|
2659
|
+
set hasCheckbox(value) {
|
|
2660
|
+
this._hasCheckbox.set(value);
|
|
2661
|
+
}
|
|
2662
|
+
get hasCheckbox() {
|
|
2663
|
+
return this._hasCheckbox();
|
|
2664
|
+
}
|
|
2488
2665
|
/**
|
|
2489
2666
|
* A function that determines if a node is expanded.
|
|
2490
2667
|
*/
|
|
2491
2668
|
get isExpanded() {
|
|
2492
|
-
return this._isExpanded || isExpanded;
|
|
2669
|
+
return this._isExpanded() || isExpanded;
|
|
2493
2670
|
}
|
|
2494
2671
|
set isExpanded(callback) {
|
|
2495
|
-
this._isExpanded
|
|
2496
|
-
this.expandIcons = Boolean(this._isExpanded && this._hasChildren);
|
|
2672
|
+
this._isExpanded.set(callback);
|
|
2673
|
+
this.expandIcons = Boolean(this._isExpanded() && this._hasChildren());
|
|
2497
2674
|
}
|
|
2498
2675
|
/**
|
|
2499
2676
|
* A function that determines if a node is selected ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/selection#modifying-the-selection-behavior)).
|
|
2500
2677
|
*/
|
|
2501
2678
|
get isSelected() {
|
|
2502
|
-
return this._isSelected || isSelected;
|
|
2679
|
+
return this._isSelected() || isSelected;
|
|
2503
2680
|
}
|
|
2504
2681
|
set isSelected(callback) {
|
|
2505
|
-
this._isSelected
|
|
2506
|
-
this.selectable = Boolean(this._isSelected);
|
|
2682
|
+
this._isSelected.set(callback);
|
|
2683
|
+
this.selectable = Boolean(this._isSelected());
|
|
2507
2684
|
}
|
|
2508
2685
|
/**
|
|
2509
2686
|
* A callback that determines whether a TreeView node should be rendered as hidden. Uses the `.k-hidden` utility class. Useful for custom filtering.
|
|
2510
2687
|
*
|
|
2511
2688
|
*/
|
|
2512
|
-
isVisible
|
|
2689
|
+
set isVisible(value) {
|
|
2690
|
+
this._isVisible.set(value);
|
|
2691
|
+
}
|
|
2692
|
+
get isVisible() {
|
|
2693
|
+
return this._isVisible();
|
|
2694
|
+
}
|
|
2513
2695
|
/**
|
|
2514
2696
|
* Enables keyboard navigation for the TreeView.
|
|
2515
2697
|
*
|
|
@@ -2518,28 +2700,53 @@ class TreeViewComponent {
|
|
|
2518
2700
|
* @remarks
|
|
2519
2701
|
* This property is related to accessibility.
|
|
2520
2702
|
*/
|
|
2521
|
-
navigable
|
|
2703
|
+
set navigable(value) {
|
|
2704
|
+
this._navigable.set(value);
|
|
2705
|
+
}
|
|
2706
|
+
get navigable() {
|
|
2707
|
+
return this._navigable();
|
|
2708
|
+
}
|
|
2522
2709
|
/**
|
|
2523
2710
|
* A function that provides the child nodes for a given parent node ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/data-binding)).
|
|
2524
2711
|
*/
|
|
2525
|
-
children
|
|
2712
|
+
set children(value) {
|
|
2713
|
+
this._children.set(value);
|
|
2714
|
+
}
|
|
2715
|
+
get children() {
|
|
2716
|
+
return this._children();
|
|
2717
|
+
}
|
|
2526
2718
|
/**
|
|
2527
2719
|
* Indicates whether child nodes are fetched on expand or initally prefetched.
|
|
2528
2720
|
*
|
|
2529
2721
|
* @default true
|
|
2530
2722
|
*/
|
|
2531
|
-
loadOnDemand
|
|
2723
|
+
set loadOnDemand(value) {
|
|
2724
|
+
this._loadOnDemand.set(value);
|
|
2725
|
+
}
|
|
2726
|
+
get loadOnDemand() {
|
|
2727
|
+
return this._loadOnDemand();
|
|
2728
|
+
}
|
|
2532
2729
|
/**
|
|
2533
2730
|
* Renders the built-in input element for filtering. If `true`, emits the `filterChange` event that can be handled for [manual filtering](https://www.telerik.com/kendo-angular-ui/components/treeview/filtering#manual-filtering).
|
|
2534
2731
|
* Built-in filtering is available with [`kendoTreeViewHierarchyBinding`](https://www.telerik.com/kendo-angular-ui/components/treeview/api/hierarchybindingdirective) and [`kendoTreeViewFlatDataBinding`](https://www.telerik.com/kendo-angular-ui/components/treeview/api/flatdatabindingdirective) directives.
|
|
2535
2732
|
*
|
|
2536
2733
|
* @default false
|
|
2537
2734
|
*/
|
|
2538
|
-
filterable
|
|
2735
|
+
set filterable(value) {
|
|
2736
|
+
this._filterable.set(value);
|
|
2737
|
+
}
|
|
2738
|
+
get filterable() {
|
|
2739
|
+
return this._filterable();
|
|
2740
|
+
}
|
|
2539
2741
|
/**
|
|
2540
2742
|
* Sets the initial value of the built-in filter input.
|
|
2541
2743
|
*/
|
|
2542
|
-
filter
|
|
2744
|
+
set filter(value) {
|
|
2745
|
+
this._filter.set(value);
|
|
2746
|
+
}
|
|
2747
|
+
get filter() {
|
|
2748
|
+
return this._filter();
|
|
2749
|
+
}
|
|
2543
2750
|
/**
|
|
2544
2751
|
* Sets the size of the component.
|
|
2545
2752
|
*
|
|
@@ -2552,10 +2759,10 @@ class TreeViewComponent {
|
|
|
2552
2759
|
if (isPresent(size)) {
|
|
2553
2760
|
this.renderer.addClass(this.element.nativeElement, getSizeClass('treeview', size));
|
|
2554
2761
|
}
|
|
2555
|
-
this._size
|
|
2762
|
+
this._size.set(size);
|
|
2556
2763
|
}
|
|
2557
2764
|
get size() {
|
|
2558
|
-
return this._size;
|
|
2765
|
+
return this._size();
|
|
2559
2766
|
}
|
|
2560
2767
|
get isActive() {
|
|
2561
2768
|
return this.navigationService.isTreeViewActive;
|
|
@@ -2571,7 +2778,12 @@ class TreeViewComponent {
|
|
|
2571
2778
|
*
|
|
2572
2779
|
* @default false
|
|
2573
2780
|
*/
|
|
2574
|
-
disableParentNodesOnly
|
|
2781
|
+
set disableParentNodesOnly(value) {
|
|
2782
|
+
this._disableParentNodesOnly.set(value);
|
|
2783
|
+
}
|
|
2784
|
+
get disableParentNodesOnly() {
|
|
2785
|
+
return this._disableParentNodesOnly();
|
|
2786
|
+
}
|
|
2575
2787
|
/**
|
|
2576
2788
|
* @hidden
|
|
2577
2789
|
*/
|
|
@@ -2586,20 +2798,42 @@ class TreeViewComponent {
|
|
|
2586
2798
|
* @hidden
|
|
2587
2799
|
*/
|
|
2588
2800
|
editService;
|
|
2589
|
-
checkboxes
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2801
|
+
get checkboxes() { return this._checkboxes(); }
|
|
2802
|
+
set checkboxes(value) { this._checkboxes.set(value); }
|
|
2803
|
+
get expandIcons() { return this._expandIcons(); }
|
|
2804
|
+
set expandIcons(value) { this._expandIcons.set(value); }
|
|
2805
|
+
get selectable() { return this._selectable(); }
|
|
2806
|
+
set selectable(value) { this._selectable.set(value); }
|
|
2807
|
+
get touchActions() { return this._touchActions(); }
|
|
2808
|
+
set touchActions(value) { this._touchActions.set(value); }
|
|
2593
2809
|
data = new BehaviorSubject([]);
|
|
2594
|
-
_animate = true;
|
|
2595
|
-
_isChecked;
|
|
2596
|
-
_isExpanded;
|
|
2597
|
-
_isSelected;
|
|
2598
|
-
_hasChildren;
|
|
2599
2810
|
_loadMoreService;
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2811
|
+
_checkboxes = signal(false, ...(ngDevMode ? [{ debugName: "_checkboxes" }] : /* istanbul ignore next */ []));
|
|
2812
|
+
_expandIcons = signal(false, ...(ngDevMode ? [{ debugName: "_expandIcons" }] : /* istanbul ignore next */ []));
|
|
2813
|
+
_selectable = signal(false, ...(ngDevMode ? [{ debugName: "_selectable" }] : /* istanbul ignore next */ []));
|
|
2814
|
+
_touchActions = signal(true, ...(ngDevMode ? [{ debugName: "_touchActions" }] : /* istanbul ignore next */ []));
|
|
2815
|
+
_animate = signal(true, ...(ngDevMode ? [{ debugName: "_animate" }] : /* istanbul ignore next */ []));
|
|
2816
|
+
_filterInputPlaceholder = signal('', ...(ngDevMode ? [{ debugName: "_filterInputPlaceholder" }] : /* istanbul ignore next */ []));
|
|
2817
|
+
_expandDisabledNodes = signal(undefined, ...(ngDevMode ? [{ debugName: "_expandDisabledNodes" }] : /* istanbul ignore next */ []));
|
|
2818
|
+
_trackBy = signal(trackBy, ...(ngDevMode ? [{ debugName: "_trackBy" }] : /* istanbul ignore next */ []));
|
|
2819
|
+
_textField = signal(undefined, ...(ngDevMode ? [{ debugName: "_textField" }] : /* istanbul ignore next */ []));
|
|
2820
|
+
_isChecked = signal(undefined, ...(ngDevMode ? [{ debugName: "_isChecked" }] : /* istanbul ignore next */ []));
|
|
2821
|
+
_isExpanded = signal(undefined, ...(ngDevMode ? [{ debugName: "_isExpanded" }] : /* istanbul ignore next */ []));
|
|
2822
|
+
_isSelected = signal(undefined, ...(ngDevMode ? [{ debugName: "_isSelected" }] : /* istanbul ignore next */ []));
|
|
2823
|
+
_isDisabled = signal(isDisabled, ...(ngDevMode ? [{ debugName: "_isDisabled" }] : /* istanbul ignore next */ []));
|
|
2824
|
+
_hasCheckbox = signal(hasCheckbox, ...(ngDevMode ? [{ debugName: "_hasCheckbox" }] : /* istanbul ignore next */ []));
|
|
2825
|
+
_isVisible = signal(isVisible, ...(ngDevMode ? [{ debugName: "_isVisible" }] : /* istanbul ignore next */ []));
|
|
2826
|
+
_hasChildren = signal(undefined, ...(ngDevMode ? [{ debugName: "_hasChildren" }] : /* istanbul ignore next */ []));
|
|
2827
|
+
_nodeTemplateRef = signal(undefined, ...(ngDevMode ? [{ debugName: "_nodeTemplateRef" }] : /* istanbul ignore next */ []));
|
|
2828
|
+
_loadMoreButtonTemplateRef = signal(undefined, ...(ngDevMode ? [{ debugName: "_loadMoreButtonTemplateRef" }] : /* istanbul ignore next */ []));
|
|
2829
|
+
_navigable = signal(true, ...(ngDevMode ? [{ debugName: "_navigable" }] : /* istanbul ignore next */ []));
|
|
2830
|
+
_children = signal(() => of([]), ...(ngDevMode ? [{ debugName: "_children" }] : /* istanbul ignore next */ []));
|
|
2831
|
+
_loadOnDemand = signal(true, ...(ngDevMode ? [{ debugName: "_loadOnDemand" }] : /* istanbul ignore next */ []));
|
|
2832
|
+
_filterable = signal(false, ...(ngDevMode ? [{ debugName: "_filterable" }] : /* istanbul ignore next */ []));
|
|
2833
|
+
_filter = signal('', ...(ngDevMode ? [{ debugName: "_filter" }] : /* istanbul ignore next */ []));
|
|
2834
|
+
_size = signal(undefined, ...(ngDevMode ? [{ debugName: "_size" }] : /* istanbul ignore next */ []));
|
|
2835
|
+
_disableParentNodesOnly = signal(false, ...(ngDevMode ? [{ debugName: "_disableParentNodesOnly" }] : /* istanbul ignore next */ []));
|
|
2836
|
+
_loadMoreButtonRole = signal(undefined, ...(ngDevMode ? [{ debugName: "_loadMoreButtonRole" }] : /* istanbul ignore next */ []));
|
|
2603
2837
|
subscriptions = new Subscription();
|
|
2604
2838
|
domSubscriptions = [];
|
|
2605
2839
|
_nextId = nextId;
|
|
@@ -2918,12 +3152,12 @@ class TreeViewComponent {
|
|
|
2918
3152
|
>
|
|
2919
3153
|
</ul>
|
|
2920
3154
|
<ng-container #assetsContainer></ng-container>
|
|
2921
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoTreeViewLocalizedMessages]" }, { kind: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "[kendoTextBoxPrefixTemplate]", inputs: ["showSeparator"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: TreeViewGroupComponent, selector: "[kendoTreeViewGroup]", inputs: ["checkboxes", "expandIcons", "disabled", "selectable", "touchActions", "disableParentNodesOnly", "loadOnDemand", "trackBy", "nodes", "textField", "parentDataItem", "parentIndex", "nodeTemplateRef", "loadMoreButtonTemplateRef", "
|
|
3155
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoTreeViewLocalizedMessages]" }, { kind: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "[kendoTextBoxPrefixTemplate]", inputs: ["showSeparator"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: TreeViewGroupComponent, selector: "[kendoTreeViewGroup]", inputs: ["checkboxes", "loadMoreButtonRole", "expandIcons", "disabled", "selectable", "touchActions", "disableParentNodesOnly", "loadOnDemand", "trackBy", "nodes", "textField", "parentDataItem", "parentIndex", "nodeTemplateRef", "loadMoreButtonTemplateRef", "loadMoreService", "size", "expandDisabledNodes", "isChecked", "isDisabled", "hasCheckbox", "isExpanded", "isVisible", "isSelected", "children", "hasChildren"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2922
3156
|
}
|
|
2923
3157
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TreeViewComponent, decorators: [{
|
|
2924
3158
|
type: Component,
|
|
2925
3159
|
args: [{
|
|
2926
|
-
changeDetection: ChangeDetectionStrategy.
|
|
3160
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2927
3161
|
exportAs: 'kendoTreeView',
|
|
2928
3162
|
providers: [...providers, { provide: KENDO_WEBMCP_HOST, useExisting: forwardRef(() => TreeViewComponent) }],
|
|
2929
3163
|
selector: 'kendo-treeview',
|
|
@@ -3134,6 +3368,7 @@ const matchKey = index => k => {
|
|
|
3134
3368
|
class CheckDirective {
|
|
3135
3369
|
treeView;
|
|
3136
3370
|
zone;
|
|
3371
|
+
injector;
|
|
3137
3372
|
/**
|
|
3138
3373
|
* @hidden
|
|
3139
3374
|
*/
|
|
@@ -3143,18 +3378,33 @@ class CheckDirective {
|
|
|
3143
3378
|
/**
|
|
3144
3379
|
* Defines the item key stored in the `checkedKeys` collection.
|
|
3145
3380
|
*/
|
|
3146
|
-
checkKey
|
|
3381
|
+
set checkKey(value) {
|
|
3382
|
+
this._checkKey.set(value);
|
|
3383
|
+
}
|
|
3384
|
+
get checkKey() {
|
|
3385
|
+
return this._checkKey();
|
|
3386
|
+
}
|
|
3147
3387
|
/**
|
|
3148
3388
|
* Defines the collection that stores the checked keys
|
|
3149
3389
|
* ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/checkboxes)).
|
|
3150
3390
|
*/
|
|
3151
|
-
checkedKeys
|
|
3391
|
+
set checkedKeys(value) {
|
|
3392
|
+
this._checkedKeys.set(value);
|
|
3393
|
+
}
|
|
3394
|
+
get checkedKeys() {
|
|
3395
|
+
return this._checkedKeys();
|
|
3396
|
+
}
|
|
3152
3397
|
/**
|
|
3153
3398
|
* Defines the checkable settings
|
|
3154
3399
|
* ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/checkboxes#setup)).
|
|
3155
3400
|
* If you do not provide a value, the default [`CheckableSettings`](https://www.telerik.com/kendo-angular-ui/components/treeview/api/checkablesettings) apply.
|
|
3156
3401
|
*/
|
|
3157
|
-
checkable
|
|
3402
|
+
set checkable(value) {
|
|
3403
|
+
this._checkable.set(value);
|
|
3404
|
+
}
|
|
3405
|
+
get checkable() {
|
|
3406
|
+
return this._checkable();
|
|
3407
|
+
}
|
|
3158
3408
|
/**
|
|
3159
3409
|
* Fires when the `checkedKeys` collection updates.
|
|
3160
3410
|
*/
|
|
@@ -3183,21 +3433,37 @@ class CheckDirective {
|
|
|
3183
3433
|
/**
|
|
3184
3434
|
* Reflects the internal `checkedKeys` state.
|
|
3185
3435
|
*/
|
|
3186
|
-
state = new Set();
|
|
3436
|
+
state = signal(new Set(), ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
3187
3437
|
clickSubscription;
|
|
3438
|
+
_checkKey = signal(null, ...(ngDevMode ? [{ debugName: "_checkKey" }] : /* istanbul ignore next */ []));
|
|
3439
|
+
_checkedKeys = signal([], ...(ngDevMode ? [{ debugName: "_checkedKeys" }] : /* istanbul ignore next */ []));
|
|
3440
|
+
_checkable = signal(null, ...(ngDevMode ? [{ debugName: "_checkable" }] : /* istanbul ignore next */ []));
|
|
3188
3441
|
/**
|
|
3189
3442
|
* Holds the last emitted `checkedKeys` collection.
|
|
3190
3443
|
*/
|
|
3191
3444
|
lastChange;
|
|
3192
|
-
constructor(treeView, zone) {
|
|
3445
|
+
constructor(treeView, zone, injector) {
|
|
3193
3446
|
this.treeView = treeView;
|
|
3194
3447
|
this.zone = zone;
|
|
3448
|
+
this.injector = injector;
|
|
3195
3449
|
this.subscriptions.add(this.treeView.checkedChange
|
|
3196
3450
|
.subscribe((e) => this.check(e)));
|
|
3197
3451
|
const expandedItems = [];
|
|
3452
|
+
let pendingRender = null;
|
|
3198
3453
|
this.subscriptions.add(this.treeView.childrenLoaded
|
|
3199
|
-
.pipe(filter(() => this.options.checkChildren && this.treeView.loadOnDemand), tap(item => expandedItems.push(item))
|
|
3200
|
-
.subscribe(() =>
|
|
3454
|
+
.pipe(filter(() => this.options.checkChildren && this.treeView.loadOnDemand), tap(item => expandedItems.push(item)))
|
|
3455
|
+
.subscribe(() => {
|
|
3456
|
+
// Cancel any previously scheduled render to batch multiple rapid childrenLoaded events
|
|
3457
|
+
// (mirrors the previous switchMap(zone.onStable) cancellation behavior)
|
|
3458
|
+
if (pendingRender) {
|
|
3459
|
+
pendingRender.destroy();
|
|
3460
|
+
pendingRender = null;
|
|
3461
|
+
}
|
|
3462
|
+
pendingRender = afterNextRender(() => {
|
|
3463
|
+
pendingRender = null;
|
|
3464
|
+
this.addCheckedItemsChildren(expandedItems);
|
|
3465
|
+
}, { injector: this.injector });
|
|
3466
|
+
}));
|
|
3201
3467
|
this.treeView.isChecked = this.isItemChecked.bind(this);
|
|
3202
3468
|
}
|
|
3203
3469
|
ngOnChanges(changes) {
|
|
@@ -3206,7 +3472,7 @@ class CheckDirective {
|
|
|
3206
3472
|
this.toggleCheckOnClick();
|
|
3207
3473
|
}
|
|
3208
3474
|
if (isChanged('checkedKeys', changes, false) && changes.checkedKeys.currentValue !== this.lastChange) {
|
|
3209
|
-
this.state
|
|
3475
|
+
this.state.set(new Set(changes.checkedKeys.currentValue));
|
|
3210
3476
|
}
|
|
3211
3477
|
}
|
|
3212
3478
|
ngOnDestroy() {
|
|
@@ -3217,11 +3483,11 @@ class CheckDirective {
|
|
|
3217
3483
|
if (!this.checkKey) {
|
|
3218
3484
|
return this.isIndexChecked(index);
|
|
3219
3485
|
}
|
|
3220
|
-
const hasKey = this.state.has(this.itemKey({ dataItem, index }));
|
|
3486
|
+
const hasKey = this.state().has(this.itemKey({ dataItem, index }));
|
|
3221
3487
|
return hasKey ? 'checked' : 'none';
|
|
3222
3488
|
}
|
|
3223
3489
|
isIndexChecked(index) {
|
|
3224
|
-
const checkedKeys = Array.from(this.state).filter(matchKey(index));
|
|
3490
|
+
const checkedKeys = Array.from(this.state()).filter(matchKey(index));
|
|
3225
3491
|
if (indexChecked(checkedKeys, index)) {
|
|
3226
3492
|
return 'checked';
|
|
3227
3493
|
}
|
|
@@ -3252,10 +3518,10 @@ class CheckDirective {
|
|
|
3252
3518
|
}
|
|
3253
3519
|
checkSingle(node) {
|
|
3254
3520
|
const key = this.itemKey(node.item);
|
|
3255
|
-
const hasKey = this.state.has(key);
|
|
3256
|
-
this.state.clear();
|
|
3521
|
+
const hasKey = this.state().has(key);
|
|
3522
|
+
this.state().clear();
|
|
3257
3523
|
if (!hasKey) {
|
|
3258
|
-
this.state.add(key);
|
|
3524
|
+
this.state().add(key);
|
|
3259
3525
|
}
|
|
3260
3526
|
this.notify();
|
|
3261
3527
|
}
|
|
@@ -3305,13 +3571,13 @@ class CheckDirective {
|
|
|
3305
3571
|
this.treeView.hasCheckbox(item.item.dataItem, item.item.index))
|
|
3306
3572
|
.map(({ item }) => this.itemKey(item)));
|
|
3307
3573
|
}
|
|
3308
|
-
const shouldCheck = !this.state.has(currentKey);
|
|
3574
|
+
const shouldCheck = !this.state().has(currentKey);
|
|
3309
3575
|
pendingCheck.forEach(key => {
|
|
3310
3576
|
if (shouldCheck) {
|
|
3311
|
-
this.state.add(key);
|
|
3577
|
+
this.state().add(key);
|
|
3312
3578
|
}
|
|
3313
3579
|
else {
|
|
3314
|
-
this.state.delete(key);
|
|
3580
|
+
this.state().delete(key);
|
|
3315
3581
|
if (this.options.uncheckCollapsedChildren &&
|
|
3316
3582
|
this.options.mode === 'multiple' &&
|
|
3317
3583
|
this.treeView.loadOnDemand) {
|
|
@@ -3319,8 +3585,8 @@ class CheckDirective {
|
|
|
3319
3585
|
this.uncheckChildren(node.item.dataItem, node.item.index);
|
|
3320
3586
|
return;
|
|
3321
3587
|
}
|
|
3322
|
-
const checkedKeys = Array.from(this.state).filter(matchKey(node.item.index));
|
|
3323
|
-
checkedKeys.forEach(key => this.state.delete(key));
|
|
3588
|
+
const checkedKeys = Array.from(this.state()).filter(matchKey(node.item.index));
|
|
3589
|
+
checkedKeys.forEach(key => this.state().delete(key));
|
|
3324
3590
|
}
|
|
3325
3591
|
}
|
|
3326
3592
|
});
|
|
@@ -3328,7 +3594,7 @@ class CheckDirective {
|
|
|
3328
3594
|
uncheckChildren(dataItem, parentNodeIndex) {
|
|
3329
3595
|
this.treeView.children(dataItem).subscribe(children => children.forEach((item, index) => {
|
|
3330
3596
|
const nodeIndex = `${parentNodeIndex}_${index}`;
|
|
3331
|
-
this.state.delete(this.itemKey({ dataItem: item, index: nodeIndex }));
|
|
3597
|
+
this.state().delete(this.itemKey({ dataItem: item, index: nodeIndex }));
|
|
3332
3598
|
if (this.treeView.hasChildren(item)) {
|
|
3333
3599
|
this.uncheckChildren(item, nodeIndex);
|
|
3334
3600
|
}
|
|
@@ -3342,13 +3608,13 @@ class CheckDirective {
|
|
|
3342
3608
|
while (currentParent) {
|
|
3343
3609
|
const parentKey = this.itemKey(currentParent.item);
|
|
3344
3610
|
const isDisabled = this.treeView.isDisabled(currentParent.item.dataItem, currentParent.item.index);
|
|
3345
|
-
const allChildrenSelected = currentParent.children.every(item => this.state.has(this.itemKey(item)));
|
|
3611
|
+
const allChildrenSelected = currentParent.children.every(item => this.state().has(this.itemKey(item)));
|
|
3346
3612
|
const hasCheckbox = this.treeView.hasCheckbox(currentParent.item.dataItem, currentParent.item.index);
|
|
3347
3613
|
if (hasCheckbox && (!isDisabled || this.options.checkDisabledChildren) && allChildrenSelected) {
|
|
3348
|
-
this.state.add(parentKey);
|
|
3614
|
+
this.state().add(parentKey);
|
|
3349
3615
|
}
|
|
3350
3616
|
else {
|
|
3351
|
-
this.state.delete(parentKey);
|
|
3617
|
+
this.state().delete(parentKey);
|
|
3352
3618
|
}
|
|
3353
3619
|
currentParent = currentParent.parent;
|
|
3354
3620
|
}
|
|
@@ -3356,22 +3622,22 @@ class CheckDirective {
|
|
|
3356
3622
|
allChildrenSelected(children) {
|
|
3357
3623
|
return children.every(item => {
|
|
3358
3624
|
const childrenSel = this.allChildrenSelected(item.children);
|
|
3359
|
-
return this.state.has(this.itemKey(item.item)) && childrenSel;
|
|
3625
|
+
return this.state().has(this.itemKey(item.item)) && childrenSel;
|
|
3360
3626
|
});
|
|
3361
3627
|
}
|
|
3362
3628
|
notify() {
|
|
3363
|
-
this.lastChange = Array.from(this.state);
|
|
3629
|
+
this.lastChange = Array.from(this.state());
|
|
3364
3630
|
this.checkedKeysChange.emit(this.lastChange);
|
|
3365
3631
|
}
|
|
3366
3632
|
addCheckedItemsChildren(lookups) {
|
|
3367
3633
|
if (!isPresent(lookups) || lookups.length === 0) {
|
|
3368
3634
|
return;
|
|
3369
3635
|
}
|
|
3370
|
-
const initiallyCheckedItemsCount = this.state.size;
|
|
3636
|
+
const initiallyCheckedItemsCount = this.state().size;
|
|
3371
3637
|
const disabledItems = new Set();
|
|
3372
3638
|
lookups.forEach(lookup => {
|
|
3373
3639
|
const itemKey = this.itemKey(lookup.item);
|
|
3374
|
-
if (!this.state.has(itemKey)) {
|
|
3640
|
+
if (!this.state().has(itemKey)) {
|
|
3375
3641
|
return;
|
|
3376
3642
|
}
|
|
3377
3643
|
lookup.children.forEach(item => {
|
|
@@ -3381,7 +3647,7 @@ class CheckDirective {
|
|
|
3381
3647
|
(this.treeView.hasCheckbox(lookup.item.dataItem, lookup.item.index) &&
|
|
3382
3648
|
this.treeView.hasCheckbox(item.dataItem, item.index)) ||
|
|
3383
3649
|
this.treeView.disableParentNodesOnly || this.options.checkDisabledChildren) {
|
|
3384
|
-
this.state.add(this.itemKey(item));
|
|
3650
|
+
this.state().add(this.itemKey(item));
|
|
3385
3651
|
}
|
|
3386
3652
|
if (this.treeView.disableParentNodesOnly &&
|
|
3387
3653
|
!this.options.checkDisabledChildren &&
|
|
@@ -3391,13 +3657,13 @@ class CheckDirective {
|
|
|
3391
3657
|
}
|
|
3392
3658
|
});
|
|
3393
3659
|
});
|
|
3394
|
-
disabledItems.forEach(item => this.state.delete(item));
|
|
3395
|
-
const hasNewlyCheckedItems = initiallyCheckedItemsCount !== this.state.size;
|
|
3660
|
+
disabledItems.forEach(item => this.state().delete(item));
|
|
3661
|
+
const hasNewlyCheckedItems = initiallyCheckedItemsCount !== this.state().size;
|
|
3396
3662
|
if (hasNewlyCheckedItems) {
|
|
3397
3663
|
this.zone.run(() => this.notify());
|
|
3398
3664
|
}
|
|
3399
3665
|
}
|
|
3400
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: CheckDirective, deps: [{ token: TreeViewComponent }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3666
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: CheckDirective, deps: [{ token: TreeViewComponent }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3401
3667
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.23", type: CheckDirective, isStandalone: true, selector: "[kendoTreeViewCheckable]", inputs: { isChecked: "isChecked", checkKey: ["checkBy", "checkKey"], checkedKeys: "checkedKeys", checkable: ["kendoTreeViewCheckable", "checkable"] }, outputs: { checkedKeysChange: "checkedKeysChange" }, usesOnChanges: true, ngImport: i0 });
|
|
3402
3668
|
}
|
|
3403
3669
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: CheckDirective, decorators: [{
|
|
@@ -3406,7 +3672,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
3406
3672
|
selector: '[kendoTreeViewCheckable]',
|
|
3407
3673
|
standalone: true
|
|
3408
3674
|
}]
|
|
3409
|
-
}], ctorParameters: () => [{ type: TreeViewComponent }, { type: i0.NgZone }], propDecorators: { isChecked: [{
|
|
3675
|
+
}], ctorParameters: () => [{ type: TreeViewComponent }, { type: i0.NgZone }, { type: i0.Injector }], propDecorators: { isChecked: [{
|
|
3410
3676
|
type: Input
|
|
3411
3677
|
}], checkKey: [{
|
|
3412
3678
|
type: Input,
|
|
@@ -3451,11 +3717,23 @@ class DisableDirective {
|
|
|
3451
3717
|
/**
|
|
3452
3718
|
* Defines the item key that will be stored in the `disabledKeys` collection.
|
|
3453
3719
|
*/
|
|
3454
|
-
disableKey
|
|
3720
|
+
set disableKey(value) {
|
|
3721
|
+
this._disableKey.set(value);
|
|
3722
|
+
}
|
|
3723
|
+
get disableKey() {
|
|
3724
|
+
return this._disableKey();
|
|
3725
|
+
}
|
|
3455
3726
|
/**
|
|
3456
3727
|
* Defines the collection that will store the disabled keys.
|
|
3457
3728
|
*/
|
|
3458
|
-
disabledKeys
|
|
3729
|
+
set disabledKeys(value) {
|
|
3730
|
+
this._disabledKeys.set(value);
|
|
3731
|
+
}
|
|
3732
|
+
get disabledKeys() {
|
|
3733
|
+
return this._disabledKeys();
|
|
3734
|
+
}
|
|
3735
|
+
_disableKey = signal(null, ...(ngDevMode ? [{ debugName: "_disableKey" }] : /* istanbul ignore next */ []));
|
|
3736
|
+
_disabledKeys = signal([], ...(ngDevMode ? [{ debugName: "_disabledKeys" }] : /* istanbul ignore next */ []));
|
|
3459
3737
|
constructor(treeView, cdr) {
|
|
3460
3738
|
this.treeView = treeView;
|
|
3461
3739
|
this.cdr = cdr;
|
|
@@ -3743,19 +4021,39 @@ class DragClueComponent {
|
|
|
3743
4021
|
/**
|
|
3744
4022
|
* The text value of the dragged TreeView item.
|
|
3745
4023
|
*/
|
|
3746
|
-
text
|
|
4024
|
+
set text(value) {
|
|
4025
|
+
this._text.set(value);
|
|
4026
|
+
}
|
|
4027
|
+
get text() {
|
|
4028
|
+
return this._text();
|
|
4029
|
+
}
|
|
3747
4030
|
/**
|
|
3748
4031
|
* The attempted operation according to the current drop target.
|
|
3749
4032
|
*/
|
|
3750
|
-
action
|
|
4033
|
+
set action(value) {
|
|
4034
|
+
this._action.set(value);
|
|
4035
|
+
}
|
|
4036
|
+
get action() {
|
|
4037
|
+
return this._action();
|
|
4038
|
+
}
|
|
3751
4039
|
/**
|
|
3752
4040
|
* The look-up info for the currently dragged item.
|
|
3753
4041
|
*/
|
|
3754
|
-
sourceItem
|
|
4042
|
+
set sourceItem(value) {
|
|
4043
|
+
this._sourceItem.set(value);
|
|
4044
|
+
}
|
|
4045
|
+
get sourceItem() {
|
|
4046
|
+
return this._sourceItem();
|
|
4047
|
+
}
|
|
3755
4048
|
/**
|
|
3756
4049
|
* The look-up info for the destination item (if hovering a valid drop target).
|
|
3757
4050
|
*/
|
|
3758
|
-
destinationItem
|
|
4051
|
+
set destinationItem(value) {
|
|
4052
|
+
this._destinationItem.set(value);
|
|
4053
|
+
}
|
|
4054
|
+
get destinationItem() {
|
|
4055
|
+
return this._destinationItem();
|
|
4056
|
+
}
|
|
3759
4057
|
/**
|
|
3760
4058
|
* Defines the drag clue content template.
|
|
3761
4059
|
*/
|
|
@@ -3784,6 +4082,10 @@ class DragClueComponent {
|
|
|
3784
4082
|
constructor(cdr) {
|
|
3785
4083
|
this.cdr = cdr;
|
|
3786
4084
|
}
|
|
4085
|
+
_text = signal(undefined, ...(ngDevMode ? [{ debugName: "_text" }] : /* istanbul ignore next */ []));
|
|
4086
|
+
_action = signal(undefined, ...(ngDevMode ? [{ debugName: "_action" }] : /* istanbul ignore next */ []));
|
|
4087
|
+
_sourceItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_sourceItem" }] : /* istanbul ignore next */ []));
|
|
4088
|
+
_destinationItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_destinationItem" }] : /* istanbul ignore next */ []));
|
|
3787
4089
|
// exposed as a public method that can be called from outside as the component uses `OnPush` strategy
|
|
3788
4090
|
detectChanges() {
|
|
3789
4091
|
this.cdr.detectChanges();
|
|
@@ -4291,15 +4593,33 @@ class DropHintComponent {
|
|
|
4291
4593
|
/**
|
|
4292
4594
|
* The attempted operation according to the current drop target.
|
|
4293
4595
|
*/
|
|
4294
|
-
action
|
|
4596
|
+
set action(value) {
|
|
4597
|
+
this._action.set(value);
|
|
4598
|
+
}
|
|
4599
|
+
get action() {
|
|
4600
|
+
return this._action();
|
|
4601
|
+
}
|
|
4295
4602
|
/**
|
|
4296
4603
|
* The look-up info for the currently dragged item.
|
|
4297
4604
|
*/
|
|
4298
|
-
sourceItem
|
|
4605
|
+
set sourceItem(value) {
|
|
4606
|
+
this._sourceItem.set(value);
|
|
4607
|
+
}
|
|
4608
|
+
get sourceItem() {
|
|
4609
|
+
return this._sourceItem();
|
|
4610
|
+
}
|
|
4299
4611
|
/**
|
|
4300
4612
|
* The look-up info for the destination item.
|
|
4301
4613
|
*/
|
|
4302
|
-
destinationItem
|
|
4614
|
+
set destinationItem(value) {
|
|
4615
|
+
this._destinationItem.set(value);
|
|
4616
|
+
}
|
|
4617
|
+
get destinationItem() {
|
|
4618
|
+
return this._destinationItem();
|
|
4619
|
+
}
|
|
4620
|
+
_action = signal(undefined, ...(ngDevMode ? [{ debugName: "_action" }] : /* istanbul ignore next */ []));
|
|
4621
|
+
_sourceItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_sourceItem" }] : /* istanbul ignore next */ []));
|
|
4622
|
+
_destinationItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_destinationItem" }] : /* istanbul ignore next */ []));
|
|
4303
4623
|
constructor(changeDetectorRef) {
|
|
4304
4624
|
this.changeDetectorRef = changeDetectorRef;
|
|
4305
4625
|
}
|
|
@@ -4719,6 +5039,10 @@ class DragAndDropDirective {
|
|
|
4719
5039
|
if (!(originalEvent.ctrlKey && this.allowCopy)) {
|
|
4720
5040
|
args.sourceTree.removeItem.emit(args);
|
|
4721
5041
|
}
|
|
5042
|
+
args.destinationTree.rebindChildren();
|
|
5043
|
+
if (args.sourceTree !== args.destinationTree) {
|
|
5044
|
+
args.sourceTree.rebindChildren();
|
|
5045
|
+
}
|
|
4722
5046
|
}
|
|
4723
5047
|
else if (event.isDefaultPrevented()) {
|
|
4724
5048
|
// directly hide the clue if the default is prevented
|
|
@@ -4846,13 +5170,23 @@ class ExpandDirective {
|
|
|
4846
5170
|
/**
|
|
4847
5171
|
* Defines the item key stored in the `expandedKeys` collection.
|
|
4848
5172
|
*/
|
|
4849
|
-
expandKey
|
|
5173
|
+
set expandKey(value) {
|
|
5174
|
+
this._expandKey.set(value);
|
|
5175
|
+
}
|
|
5176
|
+
get expandKey() {
|
|
5177
|
+
return this._expandKey();
|
|
5178
|
+
}
|
|
4850
5179
|
/**
|
|
4851
5180
|
* Specifies whether to auto-expand the nodes leading from the root node to each filter result.
|
|
4852
5181
|
* To fine-tune this behavior, pass a [`FilterExpandSettings`](https://www.telerik.com/kendo-angular-ui/components/treeview/api/filterexpandsettings) object to this input.
|
|
4853
5182
|
* @default false
|
|
4854
5183
|
*/
|
|
4855
|
-
expandOnFilter
|
|
5184
|
+
set expandOnFilter(value) {
|
|
5185
|
+
this._expandOnFilter.set(value);
|
|
5186
|
+
}
|
|
5187
|
+
get expandOnFilter() {
|
|
5188
|
+
return this._expandOnFilter();
|
|
5189
|
+
}
|
|
4856
5190
|
get filterExpandSettings() {
|
|
4857
5191
|
const settings = isBoolean(this.expandOnFilter) ? { enabled: this.expandOnFilter } : { ...this.expandOnFilter, enabled: true };
|
|
4858
5192
|
return Object.assign({}, DEFAULT_FILTER_EXPAND_SETTINGS, settings);
|
|
@@ -4864,14 +5198,22 @@ class ExpandDirective {
|
|
|
4864
5198
|
/**
|
|
4865
5199
|
* Defines the collection that stores the expanded keys.
|
|
4866
5200
|
*/
|
|
4867
|
-
expandedKeys
|
|
5201
|
+
set expandedKeys(value) {
|
|
5202
|
+
this._expandedKeys.set(value);
|
|
5203
|
+
}
|
|
5204
|
+
get expandedKeys() {
|
|
5205
|
+
return this._expandedKeys();
|
|
5206
|
+
}
|
|
4868
5207
|
subscriptions = new Subscription();
|
|
4869
5208
|
/**
|
|
4870
5209
|
* Reflects the internal `expandedKeys` state.
|
|
4871
5210
|
*/
|
|
4872
|
-
state = new Set();
|
|
4873
|
-
|
|
4874
|
-
|
|
5211
|
+
state = signal(new Set(), ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
5212
|
+
_expandedKeys = signal(null, ...(ngDevMode ? [{ debugName: "_expandedKeys" }] : /* istanbul ignore next */ []));
|
|
5213
|
+
originalExpandedKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "originalExpandedKeys" }] : /* istanbul ignore next */ []));
|
|
5214
|
+
isFiltered = signal(false, ...(ngDevMode ? [{ debugName: "isFiltered" }] : /* istanbul ignore next */ []));
|
|
5215
|
+
_expandKey = signal(null, ...(ngDevMode ? [{ debugName: "_expandKey" }] : /* istanbul ignore next */ []));
|
|
5216
|
+
_expandOnFilter = signal(false, ...(ngDevMode ? [{ debugName: "_expandOnFilter" }] : /* istanbul ignore next */ []));
|
|
4875
5217
|
/**
|
|
4876
5218
|
* Holds the last emitted `expandedKeys` collection.
|
|
4877
5219
|
*/
|
|
@@ -4882,11 +5224,11 @@ class ExpandDirective {
|
|
|
4882
5224
|
if (this.component.filterStateChange) {
|
|
4883
5225
|
this.subscriptions.add(this.component.filterStateChange.subscribe(this.handleAutoExpand.bind(this)));
|
|
4884
5226
|
}
|
|
4885
|
-
this.component.isExpanded = (dataItem, index) => this.state.has(this.itemKey({ dataItem, index }));
|
|
5227
|
+
this.component.isExpanded = (dataItem, index) => this.state().has(this.itemKey({ dataItem, index }));
|
|
4886
5228
|
}
|
|
4887
5229
|
ngOnChanges(changes) {
|
|
4888
5230
|
if (isChanged('expandedKeys', changes, false) && changes['expandedKeys'].currentValue !== this.lastChange) {
|
|
4889
|
-
this.state
|
|
5231
|
+
this.state.set(new Set(changes['expandedKeys'].currentValue));
|
|
4890
5232
|
}
|
|
4891
5233
|
}
|
|
4892
5234
|
ngOnDestroy() {
|
|
@@ -4908,14 +5250,18 @@ class ExpandDirective {
|
|
|
4908
5250
|
}
|
|
4909
5251
|
toggleExpand({ index, dataItem, expand }) {
|
|
4910
5252
|
const key = this.itemKey({ index, dataItem });
|
|
4911
|
-
const isExpanded = this.state.has(key);
|
|
5253
|
+
const isExpanded = this.state().has(key);
|
|
4912
5254
|
let notify = false;
|
|
4913
5255
|
if (isExpanded && !expand) {
|
|
4914
|
-
this.state
|
|
5256
|
+
const newState = new Set(this.state());
|
|
5257
|
+
newState.delete(key);
|
|
5258
|
+
this.state.set(newState);
|
|
4915
5259
|
notify = true;
|
|
4916
5260
|
}
|
|
4917
5261
|
else if (!isExpanded && expand) {
|
|
4918
|
-
this.state
|
|
5262
|
+
const newState = new Set(this.state());
|
|
5263
|
+
newState.add(key);
|
|
5264
|
+
this.state.set(newState);
|
|
4919
5265
|
notify = true;
|
|
4920
5266
|
}
|
|
4921
5267
|
if (notify) {
|
|
@@ -4927,26 +5273,26 @@ class ExpandDirective {
|
|
|
4927
5273
|
return;
|
|
4928
5274
|
}
|
|
4929
5275
|
const { maxAutoExpandResults, expandMatches: autoExpandMatches, expandedOnClear } = this.filterExpandSettings;
|
|
4930
|
-
if (!this.isFiltered) {
|
|
4931
|
-
this.originalExpandedKeys
|
|
5276
|
+
if (!this.isFiltered()) {
|
|
5277
|
+
this.originalExpandedKeys.set(new Set(this.state()));
|
|
4932
5278
|
}
|
|
4933
|
-
const exitingFilteredState = this.isFiltered && !term;
|
|
5279
|
+
const exitingFilteredState = this.isFiltered() && !term;
|
|
4934
5280
|
const maxExceeded = maxAutoExpandResults !== -1 && matchCount > maxAutoExpandResults;
|
|
4935
5281
|
const exitAutoExpandedState = exitingFilteredState || maxExceeded;
|
|
4936
5282
|
if (exitAutoExpandedState) {
|
|
4937
5283
|
switch (expandedOnClear) {
|
|
4938
5284
|
case "initial": {
|
|
4939
|
-
if (!sameValues(this.state, this.originalExpandedKeys)) {
|
|
4940
|
-
this.state
|
|
5285
|
+
if (!sameValues(this.state(), this.originalExpandedKeys())) {
|
|
5286
|
+
this.state.set(this.originalExpandedKeys());
|
|
4941
5287
|
this.notify();
|
|
4942
5288
|
}
|
|
4943
5289
|
break;
|
|
4944
5290
|
}
|
|
4945
5291
|
case "all": {
|
|
4946
|
-
this.state
|
|
5292
|
+
this.state.set(new Set(nodes.reduce((acc, rootNode) => {
|
|
4947
5293
|
this.getEveryExpandKey(acc, rootNode);
|
|
4948
5294
|
return acc;
|
|
4949
|
-
}, []));
|
|
5295
|
+
}, [])));
|
|
4950
5296
|
this.notify();
|
|
4951
5297
|
break;
|
|
4952
5298
|
}
|
|
@@ -4955,25 +5301,25 @@ class ExpandDirective {
|
|
|
4955
5301
|
}
|
|
4956
5302
|
case "none":
|
|
4957
5303
|
default: {
|
|
4958
|
-
if (this.state.size !== 0) {
|
|
4959
|
-
this.state.clear();
|
|
5304
|
+
if (this.state().size !== 0) {
|
|
5305
|
+
this.state().clear();
|
|
4960
5306
|
this.notify();
|
|
4961
5307
|
}
|
|
4962
5308
|
break;
|
|
4963
5309
|
}
|
|
4964
5310
|
}
|
|
4965
|
-
this.isFiltered
|
|
5311
|
+
this.isFiltered.set(false);
|
|
4966
5312
|
return;
|
|
4967
5313
|
}
|
|
4968
5314
|
const indicesToExpand = new Set(nodes.reduce((acc, rootNode) => {
|
|
4969
5315
|
this.updateExpandedNodes(acc, rootNode, autoExpandMatches);
|
|
4970
5316
|
return acc;
|
|
4971
5317
|
}, []));
|
|
4972
|
-
if (!sameValues(this.state, indicesToExpand)) {
|
|
4973
|
-
this.state
|
|
5318
|
+
if (!sameValues(this.state(), indicesToExpand)) {
|
|
5319
|
+
this.state.set(indicesToExpand);
|
|
4974
5320
|
this.notify();
|
|
4975
5321
|
}
|
|
4976
|
-
this.isFiltered
|
|
5322
|
+
this.isFiltered.set(true);
|
|
4977
5323
|
}
|
|
4978
5324
|
/**
|
|
4979
5325
|
* Fills array with the correct expand keys according to wrapper metadata.
|
|
@@ -5002,7 +5348,7 @@ class ExpandDirective {
|
|
|
5002
5348
|
}
|
|
5003
5349
|
};
|
|
5004
5350
|
notify() {
|
|
5005
|
-
this.lastChange = Array.from(this.state);
|
|
5351
|
+
this.lastChange = Array.from(this.state());
|
|
5006
5352
|
this.expandedKeysChange.emit(this.lastChange);
|
|
5007
5353
|
}
|
|
5008
5354
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ExpandDirective, deps: [{ token: ExpandableComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -5213,23 +5559,23 @@ class FilteringBase {
|
|
|
5213
5559
|
/**
|
|
5214
5560
|
* Stores the unfiltered nodes
|
|
5215
5561
|
*/
|
|
5216
|
-
filterData;
|
|
5217
|
-
visibleNodes = new Set();
|
|
5218
|
-
currentFilterTerm = '';
|
|
5562
|
+
filterData = signal(null, ...(ngDevMode ? [{ debugName: "filterData" }] : /* istanbul ignore next */ []));
|
|
5563
|
+
visibleNodes = signal(new Set(), ...(ngDevMode ? [{ debugName: "visibleNodes" }] : /* istanbul ignore next */ []));
|
|
5564
|
+
currentFilterTerm = signal('', ...(ngDevMode ? [{ debugName: "currentFilterTerm" }] : /* istanbul ignore next */ []));
|
|
5219
5565
|
/**
|
|
5220
5566
|
* The settings which are applied when performing a filter on the component's data.
|
|
5221
5567
|
*/
|
|
5222
5568
|
set filterSettings(settings) {
|
|
5223
|
-
this._filterSettings
|
|
5569
|
+
this._filterSettings.set({
|
|
5224
5570
|
...DEFAULT_FILTER_SETTINGS,
|
|
5225
5571
|
...settings
|
|
5226
|
-
};
|
|
5227
|
-
this.handleFilterChange(this.currentFilterTerm);
|
|
5572
|
+
});
|
|
5573
|
+
this.handleFilterChange(this.currentFilterTerm());
|
|
5228
5574
|
}
|
|
5229
5575
|
get filterSettings() {
|
|
5230
|
-
return this._filterSettings;
|
|
5576
|
+
return this._filterSettings();
|
|
5231
5577
|
}
|
|
5232
|
-
_filterSettings = DEFAULT_FILTER_SETTINGS;
|
|
5578
|
+
_filterSettings = signal(DEFAULT_FILTER_SETTINGS, ...(ngDevMode ? [{ debugName: "_filterSettings" }] : /* istanbul ignore next */ []));
|
|
5233
5579
|
/**
|
|
5234
5580
|
* Applies a filter and changes the visibility of the component's nodes accordingly.
|
|
5235
5581
|
*/
|
|
@@ -5243,37 +5589,41 @@ class FilteringBase {
|
|
|
5243
5589
|
* @hidden
|
|
5244
5590
|
*/
|
|
5245
5591
|
handleFilterChange(term) {
|
|
5246
|
-
this.currentFilterTerm
|
|
5247
|
-
if (!this.filterData) {
|
|
5592
|
+
this.currentFilterTerm.set(term || '');
|
|
5593
|
+
if (!this.filterData()) {
|
|
5248
5594
|
return;
|
|
5249
5595
|
}
|
|
5250
|
-
this.currentFilterTerm
|
|
5251
|
-
this.resetNodesVisibility(this.filterData);
|
|
5596
|
+
this.currentFilterTerm.set(term);
|
|
5597
|
+
this.resetNodesVisibility(this.filterData());
|
|
5252
5598
|
if (term) {
|
|
5253
|
-
filterTree(this.filterData, term, this.filterSettings, this.component.textField);
|
|
5599
|
+
filterTree(this.filterData(), term, this.filterSettings, this.component.textField);
|
|
5254
5600
|
}
|
|
5255
|
-
this.updateVisibleNodes(this.filterData);
|
|
5601
|
+
this.updateVisibleNodes(this.filterData());
|
|
5256
5602
|
if (isPresent(this.component.filterStateChange)) {
|
|
5257
5603
|
this.component.filterStateChange.emit({
|
|
5258
|
-
nodes: this.filterData,
|
|
5259
|
-
matchCount: this.visibleNodes.size,
|
|
5604
|
+
nodes: this.filterData(),
|
|
5605
|
+
matchCount: this.visibleNodes().size,
|
|
5260
5606
|
term,
|
|
5261
5607
|
filterSettings: this.filterSettings
|
|
5262
5608
|
});
|
|
5263
5609
|
}
|
|
5264
5610
|
}
|
|
5265
5611
|
updateVisibleNodes(items) {
|
|
5612
|
+
const newVisible = new Set();
|
|
5613
|
+
this.collectVisibleNodes(items, newVisible);
|
|
5614
|
+
this.visibleNodes.set(newVisible);
|
|
5615
|
+
}
|
|
5616
|
+
collectVisibleNodes(items, set) {
|
|
5266
5617
|
items.forEach((wrapper) => {
|
|
5267
5618
|
if (wrapper.visible) {
|
|
5268
|
-
|
|
5619
|
+
set.add(wrapper.dataItem);
|
|
5269
5620
|
}
|
|
5270
5621
|
if (wrapper.children) {
|
|
5271
|
-
this.
|
|
5622
|
+
this.collectVisibleNodes(wrapper.children, set);
|
|
5272
5623
|
}
|
|
5273
5624
|
});
|
|
5274
5625
|
}
|
|
5275
5626
|
resetNodesVisibility(items) {
|
|
5276
|
-
this.visibleNodes.clear();
|
|
5277
5627
|
items.forEach((wrapper) => {
|
|
5278
5628
|
wrapper.visible = true;
|
|
5279
5629
|
if (wrapper.children) {
|
|
@@ -5338,24 +5688,39 @@ class FlatDataBindingDirective extends FilteringBase {
|
|
|
5338
5688
|
*/
|
|
5339
5689
|
set nodes(nodes) {
|
|
5340
5690
|
// Needs to be a setter so that it can be accessed via `super` call (typescript v5)
|
|
5341
|
-
this._nodes
|
|
5691
|
+
this._nodes.set(nodes);
|
|
5342
5692
|
}
|
|
5343
5693
|
get nodes() {
|
|
5344
|
-
return this._nodes;
|
|
5694
|
+
return this._nodes();
|
|
5345
5695
|
}
|
|
5346
|
-
_nodes;
|
|
5696
|
+
_nodes = signal(null, ...(ngDevMode ? [{ debugName: "_nodes" }] : /* istanbul ignore next */ []));
|
|
5347
5697
|
/**
|
|
5348
5698
|
* Specifies the field name that contains the parent node identifier.
|
|
5349
5699
|
*/
|
|
5350
|
-
parentIdField
|
|
5700
|
+
set parentIdField(value) {
|
|
5701
|
+
this._parentIdField.set(value);
|
|
5702
|
+
}
|
|
5703
|
+
get parentIdField() {
|
|
5704
|
+
return this._parentIdField();
|
|
5705
|
+
}
|
|
5351
5706
|
/**
|
|
5352
5707
|
* Specifies the field name that contains the unique node identifier.
|
|
5353
5708
|
*/
|
|
5354
|
-
idField
|
|
5709
|
+
set idField(value) {
|
|
5710
|
+
this._idField.set(value);
|
|
5711
|
+
}
|
|
5712
|
+
get idField() {
|
|
5713
|
+
return this._idField();
|
|
5714
|
+
}
|
|
5355
5715
|
/**
|
|
5356
5716
|
* @hidden
|
|
5357
5717
|
*/
|
|
5358
|
-
loadOnDemand
|
|
5718
|
+
set loadOnDemand(value) {
|
|
5719
|
+
this._loadOnDemand.set(value);
|
|
5720
|
+
}
|
|
5721
|
+
get loadOnDemand() {
|
|
5722
|
+
return this._loadOnDemand();
|
|
5723
|
+
}
|
|
5359
5724
|
/**
|
|
5360
5725
|
* @hidden
|
|
5361
5726
|
* A callback which determines whether a TreeView node should be rendered as hidden.
|
|
@@ -5366,11 +5731,20 @@ class FlatDataBindingDirective extends FilteringBase {
|
|
|
5366
5731
|
/**
|
|
5367
5732
|
* @hidden
|
|
5368
5733
|
*/
|
|
5369
|
-
originalData
|
|
5734
|
+
set originalData(value) {
|
|
5735
|
+
this._originalData.set(value);
|
|
5736
|
+
}
|
|
5737
|
+
get originalData() {
|
|
5738
|
+
return this._originalData();
|
|
5739
|
+
}
|
|
5740
|
+
_loadOnDemand = signal(true, ...(ngDevMode ? [{ debugName: "_loadOnDemand" }] : /* istanbul ignore next */ []));
|
|
5741
|
+
_idField = signal(null, ...(ngDevMode ? [{ debugName: "_idField" }] : /* istanbul ignore next */ []));
|
|
5742
|
+
_parentIdField = signal(null, ...(ngDevMode ? [{ debugName: "_parentIdField" }] : /* istanbul ignore next */ []));
|
|
5743
|
+
_originalData = signal([], ...(ngDevMode ? [{ debugName: "_originalData" }] : /* istanbul ignore next */ []));
|
|
5370
5744
|
constructor(component) {
|
|
5371
5745
|
super(component);
|
|
5372
5746
|
this.component = component;
|
|
5373
|
-
this.component.isVisible = (node) => this.visibleNodes.has(node);
|
|
5747
|
+
this.component.isVisible = (node) => this.visibleNodes().has(node);
|
|
5374
5748
|
}
|
|
5375
5749
|
/**
|
|
5376
5750
|
* @hidden
|
|
@@ -5414,12 +5788,12 @@ class FlatDataBindingDirective extends FilteringBase {
|
|
|
5414
5788
|
if (!isNullOrEmptyString(this.parentIdField)) {
|
|
5415
5789
|
const prop = getter(this.parentIdField);
|
|
5416
5790
|
this.component.nodes = this.originalData.filter(compose(isBlank, prop));
|
|
5417
|
-
this.filterData
|
|
5418
|
-
if (this.currentFilterTerm) {
|
|
5419
|
-
this.handleFilterChange(this.currentFilterTerm);
|
|
5791
|
+
this.filterData.set(mapToTree(this.component.nodes, this.originalData, this.parentIdField, this.idField));
|
|
5792
|
+
if (this.currentFilterTerm()) {
|
|
5793
|
+
this.handleFilterChange(this.currentFilterTerm());
|
|
5420
5794
|
}
|
|
5421
5795
|
else {
|
|
5422
|
-
this.updateVisibleNodes(this.filterData);
|
|
5796
|
+
this.updateVisibleNodes(this.filterData());
|
|
5423
5797
|
}
|
|
5424
5798
|
}
|
|
5425
5799
|
else {
|
|
@@ -5468,7 +5842,8 @@ class HierarchyEditingService {
|
|
|
5468
5842
|
Math.min(destinationTree.loadMoreService.getGroupSize(getDataItem(destinationItem)), destinationChildren.length) : // the page size might be greater than the actual children array length
|
|
5469
5843
|
destinationChildren.length;
|
|
5470
5844
|
destinationChildren.splice(targetIndex, 0, clonedSourceDataItem);
|
|
5471
|
-
|
|
5845
|
+
// Replace the mutated array with a new reference so signal-backed child groups detect the change on re-subscribe
|
|
5846
|
+
setter(this.hierarchyBinding.childrenField)(getDataItem(destinationItem), destinationChildren.slice());
|
|
5472
5847
|
this.movedItemNewIndex = buildTreeIndex(destinationItem.item.index, targetIndex);
|
|
5473
5848
|
this.rebindData();
|
|
5474
5849
|
}
|
|
@@ -5477,6 +5852,13 @@ class HierarchyEditingService {
|
|
|
5477
5852
|
const shiftIndex = dropPosition === DropPosition.After ? 1 : 0;
|
|
5478
5853
|
const targetIndex = destinationParentNodes.indexOf(getDataItem(destinationItem)) + shiftIndex;
|
|
5479
5854
|
destinationParentNodes.splice(targetIndex, 0, clonedSourceDataItem);
|
|
5855
|
+
// Replace the mutated array with a new reference so signal-backed child groups detect the change on re-subscribe
|
|
5856
|
+
if (isPresent(destinationItem.parent)) {
|
|
5857
|
+
setter(this.hierarchyBinding.childrenField)(getDataItem(destinationItem.parent), destinationParentNodes.slice());
|
|
5858
|
+
}
|
|
5859
|
+
else {
|
|
5860
|
+
destinationTree.nodes = destinationParentNodes.slice();
|
|
5861
|
+
}
|
|
5480
5862
|
const parentIndex = destinationItem.parent ? destinationItem.parent.item.index : null;
|
|
5481
5863
|
this.movedItemNewIndex = buildTreeIndex(parentIndex, targetIndex);
|
|
5482
5864
|
this.rebindData();
|
|
@@ -5490,6 +5872,7 @@ class HierarchyEditingService {
|
|
|
5490
5872
|
if (sourceTree !== destinationTree && !destinationTree.loadOnDemand) {
|
|
5491
5873
|
destinationTree.preloadChildNodes();
|
|
5492
5874
|
}
|
|
5875
|
+
destinationTree.rebindChildren();
|
|
5493
5876
|
// if the source and destination trees are the same, focusing the moved item here will not have the desired effect
|
|
5494
5877
|
// as the `remove` handler has not yet kicked-in to remove the item from its old position
|
|
5495
5878
|
if (sourceTree !== destinationTree) {
|
|
@@ -5502,6 +5885,13 @@ class HierarchyEditingService {
|
|
|
5502
5885
|
const sourceParentNodes = this.getParentNodes(sourceItem, sourceTree);
|
|
5503
5886
|
const sourceItemIndex = sourceParentNodes.indexOf(getDataItem(sourceItem));
|
|
5504
5887
|
sourceParentNodes.splice(sourceItemIndex, 1);
|
|
5888
|
+
// Replace the mutated array with a new reference so signal-backed child groups detect the change on re-subscribe
|
|
5889
|
+
if (isPresent(sourceItem.parent)) {
|
|
5890
|
+
setter(this.hierarchyBinding.childrenField)(getDataItem(sourceItem.parent), sourceParentNodes.slice());
|
|
5891
|
+
}
|
|
5892
|
+
else {
|
|
5893
|
+
sourceTree.nodes = sourceParentNodes.slice();
|
|
5894
|
+
}
|
|
5505
5895
|
this.rebindData();
|
|
5506
5896
|
// emit collapse for the parent node if its last child node was spliced
|
|
5507
5897
|
collapseEmptyParent(sourceItem.parent, sourceParentNodes, sourceTree);
|
|
@@ -5511,6 +5901,7 @@ class HierarchyEditingService {
|
|
|
5511
5901
|
if (!sourceTree.loadOnDemand) {
|
|
5512
5902
|
sourceTree.preloadChildNodes();
|
|
5513
5903
|
}
|
|
5904
|
+
sourceTree.rebindChildren();
|
|
5514
5905
|
// if the source and destination trees are different we want to focus only the moved item in the destination tree
|
|
5515
5906
|
if (sourceTree === destinationTree) {
|
|
5516
5907
|
// ensure the focus target is rendered and registered
|
|
@@ -5593,12 +5984,12 @@ class HierarchyBindingDirective extends FilteringBase {
|
|
|
5593
5984
|
*/
|
|
5594
5985
|
set nodes(nodes) {
|
|
5595
5986
|
// Needs to be a setter so that it can be accessed via `super` call (typescript v5)
|
|
5596
|
-
this._nodes
|
|
5987
|
+
this._nodes.set(nodes);
|
|
5597
5988
|
}
|
|
5598
5989
|
get nodes() {
|
|
5599
|
-
return this._nodes;
|
|
5990
|
+
return this._nodes();
|
|
5600
5991
|
}
|
|
5601
|
-
_nodes;
|
|
5992
|
+
_nodes = signal(null, ...(ngDevMode ? [{ debugName: "_nodes" }] : /* istanbul ignore next */ []));
|
|
5602
5993
|
/**
|
|
5603
5994
|
* @hidden
|
|
5604
5995
|
* A callback which determines whether a TreeView node should be rendered as hidden.
|
|
@@ -5619,7 +6010,7 @@ class HierarchyBindingDirective extends FilteringBase {
|
|
|
5619
6010
|
super(component);
|
|
5620
6011
|
this.component = component;
|
|
5621
6012
|
this.dragAndDropDirective = dragAndDropDirective;
|
|
5622
|
-
this.component.isVisible = (node) => !this.currentFilterTerm || this.visibleNodes.has(node);
|
|
6013
|
+
this.component.isVisible = (node) => !this.currentFilterTerm() || this.visibleNodes().has(node);
|
|
5623
6014
|
}
|
|
5624
6015
|
ngOnInit() {
|
|
5625
6016
|
if (isPresent(this.childrenField)) {
|
|
@@ -5656,12 +6047,12 @@ class HierarchyBindingDirective extends FilteringBase {
|
|
|
5656
6047
|
*/
|
|
5657
6048
|
updateNodes(values) {
|
|
5658
6049
|
this.originalData = values || [];
|
|
5659
|
-
this.filterData
|
|
5660
|
-
if (this.currentFilterTerm) {
|
|
5661
|
-
this.handleFilterChange(this.currentFilterTerm);
|
|
6050
|
+
this.filterData.set(mapToWrappers(values, this.childrenField) || []);
|
|
6051
|
+
if (this.currentFilterTerm()) {
|
|
6052
|
+
this.handleFilterChange(this.currentFilterTerm());
|
|
5662
6053
|
}
|
|
5663
6054
|
else {
|
|
5664
|
-
this.updateVisibleNodes(this.filterData);
|
|
6055
|
+
this.updateVisibleNodes(this.filterData());
|
|
5665
6056
|
}
|
|
5666
6057
|
}
|
|
5667
6058
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: DataBoundComponent }, { token: DragAndDropDirective, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -5891,17 +6282,32 @@ class SelectDirective {
|
|
|
5891
6282
|
/**
|
|
5892
6283
|
* Sets the item key stored in the `selectedKeys` collection.
|
|
5893
6284
|
*/
|
|
5894
|
-
selectKey
|
|
6285
|
+
set selectKey(value) {
|
|
6286
|
+
this._selectKey.set(value);
|
|
6287
|
+
}
|
|
6288
|
+
get selectKey() {
|
|
6289
|
+
return this._selectKey();
|
|
6290
|
+
}
|
|
5895
6291
|
/**
|
|
5896
6292
|
* Sets the current selection mode
|
|
5897
6293
|
* ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/selection)).
|
|
5898
6294
|
*/
|
|
5899
|
-
selection
|
|
6295
|
+
set selection(value) {
|
|
6296
|
+
this._selection.set(value);
|
|
6297
|
+
}
|
|
6298
|
+
get selection() {
|
|
6299
|
+
return this._selection();
|
|
6300
|
+
}
|
|
5900
6301
|
/**
|
|
5901
6302
|
* Defines the collection that stores the selected keys
|
|
5902
6303
|
* ([see example](https://www.telerik.com/kendo-angular-ui/components/treeview/selection)).
|
|
5903
6304
|
*/
|
|
5904
|
-
selectedKeys
|
|
6305
|
+
set selectedKeys(value) {
|
|
6306
|
+
this._selectedKeys.set(value);
|
|
6307
|
+
}
|
|
6308
|
+
get selectedKeys() {
|
|
6309
|
+
return this._selectedKeys();
|
|
6310
|
+
}
|
|
5905
6311
|
/**
|
|
5906
6312
|
* Emits when the `selectedKeys` collection updates.
|
|
5907
6313
|
*/
|
|
@@ -5933,6 +6339,9 @@ class SelectDirective {
|
|
|
5933
6339
|
* Holds the last emitted `selectedKeys` collection.
|
|
5934
6340
|
*/
|
|
5935
6341
|
lastChange;
|
|
6342
|
+
_selectedKeys = signal([], ...(ngDevMode ? [{ debugName: "_selectedKeys" }] : /* istanbul ignore next */ []));
|
|
6343
|
+
_selectKey = signal(null, ...(ngDevMode ? [{ debugName: "_selectKey" }] : /* istanbul ignore next */ []));
|
|
6344
|
+
_selection = signal(null, ...(ngDevMode ? [{ debugName: "_selection" }] : /* istanbul ignore next */ []));
|
|
5936
6345
|
constructor(treeView, navigationService) {
|
|
5937
6346
|
this.treeView = treeView;
|
|
5938
6347
|
this.navigationService = navigationService;
|
|
@@ -5945,6 +6354,7 @@ class SelectDirective {
|
|
|
5945
6354
|
ngOnChanges(changes) {
|
|
5946
6355
|
if (isChanged('selectedKeys', changes, false) && changes['selectedKeys'].currentValue !== this.lastChange) {
|
|
5947
6356
|
this.state = new Set(changes['selectedKeys'].currentValue);
|
|
6357
|
+
this.treeView.isSelected = (dataItem, index) => this.state.has(this.itemKey({ dataItem, index }));
|
|
5948
6358
|
}
|
|
5949
6359
|
const isSelectionBooleanTrue = typeof this.selection === 'boolean' && this.selection;
|
|
5950
6360
|
this.navigationService.selection = isSelectionBooleanTrue ? 'single' : this.selection?.mode;
|