@progress/kendo-angular-treeview 5.4.2 → 6.0.0-dev.202201111033
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-treeview.js +18 -18
- package/dist/cdn/main.js +1 -1
- package/dist/es/check.directive.js +30 -39
- package/dist/es/checkbox/checkbox.component.js +17 -1
- package/dist/es/drag-and-drop/drag-and-drop-utils.js +3 -3
- package/dist/es/drag-and-drop/drag-and-drop.directive.js +2 -2
- package/dist/es/expand.directive.js +40 -41
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/selection/select.directive.js +22 -28
- package/dist/es/size.js +4 -0
- package/dist/es/treeview-group.component.js +7 -2
- package/dist/es/treeview-item-content.directive.js +2 -2
- package/dist/es/treeview-item.directive.js +1 -1
- package/dist/es/treeview.component.js +58 -13
- package/dist/es/utils.js +21 -11
- package/dist/es2015/check.directive.d.ts +8 -1
- package/dist/es2015/check.directive.js +30 -35
- package/dist/es2015/checkbox/checkbox.component.d.ts +6 -0
- package/dist/es2015/checkbox/checkbox.component.js +13 -1
- package/dist/es2015/drag-and-drop/drag-and-drop-utils.js +3 -3
- package/dist/es2015/drag-and-drop/drag-and-drop.directive.js +2 -2
- package/dist/es2015/expand.directive.d.ts +12 -3
- package/dist/es2015/expand.directive.js +39 -36
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/main.d.ts +1 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/selection/select.directive.d.ts +11 -3
- package/dist/es2015/selection/select.directive.js +22 -24
- package/dist/es2015/size.d.ts +14 -0
- package/dist/es2015/size.js +4 -0
- package/dist/es2015/treeview-filter-settings.d.ts +2 -0
- package/dist/es2015/treeview-group.component.d.ts +2 -0
- package/dist/es2015/treeview-group.component.js +49 -35
- package/dist/es2015/treeview-item-content.directive.js +2 -2
- package/dist/es2015/treeview-item.directive.js +1 -1
- package/dist/es2015/treeview.component.d.ts +33 -5
- package/dist/es2015/treeview.component.js +70 -24
- package/dist/es2015/utils.d.ts +9 -4
- package/dist/es2015/utils.js +21 -11
- package/dist/fesm2015/index.js +248 -174
- package/dist/fesm5/index.js +199 -143
- package/dist/npm/check.directive.js +30 -39
- package/dist/npm/checkbox/checkbox.component.js +17 -1
- package/dist/npm/drag-and-drop/drag-and-drop-utils.js +3 -3
- package/dist/npm/drag-and-drop/drag-and-drop.directive.js +2 -2
- package/dist/npm/expand.directive.js +40 -41
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/selection/select.directive.js +22 -28
- package/dist/npm/size.js +6 -0
- package/dist/npm/treeview-group.component.js +7 -2
- package/dist/npm/treeview-item-content.directive.js +2 -2
- package/dist/npm/treeview-item.directive.js +1 -1
- package/dist/npm/treeview.component.js +57 -12
- package/dist/npm/utils.js +21 -11
- package/dist/systemjs/kendo-angular-treeview.js +1 -1
- package/package.json +9 -8
package/dist/fesm5/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var packageMetadata = {
|
|
|
22
22
|
name: '@progress/kendo-angular-treeview',
|
|
23
23
|
productName: 'Kendo UI for Angular',
|
|
24
24
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
25
|
-
publishDate:
|
|
25
|
+
publishDate: 1641897008,
|
|
26
26
|
version: '',
|
|
27
27
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
28
28
|
};
|
|
@@ -222,7 +222,7 @@ var isFocusable = function (element) {
|
|
|
222
222
|
* @hidden
|
|
223
223
|
*/
|
|
224
224
|
var isContent = function (element) {
|
|
225
|
-
var scopeSelector = '.k-
|
|
225
|
+
var scopeSelector = '.k-treeview-leaf:not(.k-treeview-load-more-button),.k-treeview-item,.k-treeview';
|
|
226
226
|
if (!isDocumentAvailable()) {
|
|
227
227
|
return null;
|
|
228
228
|
}
|
|
@@ -231,20 +231,20 @@ var isContent = function (element) {
|
|
|
231
231
|
node = node.parentNode;
|
|
232
232
|
}
|
|
233
233
|
if (node) {
|
|
234
|
-
return match(node, '.k-
|
|
234
|
+
return match(node, '.k-treeview-leaf:not(.k-treeview-load-more-button)');
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
237
|
/**
|
|
238
238
|
* @hidden
|
|
239
239
|
*
|
|
240
|
-
* Returns the nested .k-
|
|
240
|
+
* Returns the nested .k-treeview-leaf:not(.k-treeview-load-more-button) element.
|
|
241
241
|
* If the passed parent item is itself a content node, it is returned.
|
|
242
242
|
*/
|
|
243
243
|
var getContentElement = function (parent) {
|
|
244
244
|
if (!isPresent(parent)) {
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
247
|
-
var selector = '.k-
|
|
247
|
+
var selector = '.k-treeview-leaf:not(.k-treeview-load-more-button)';
|
|
248
248
|
if (match(parent, selector)) {
|
|
249
249
|
return parent;
|
|
250
250
|
}
|
|
@@ -254,7 +254,7 @@ var getContentElement = function (parent) {
|
|
|
254
254
|
* @hidden
|
|
255
255
|
*/
|
|
256
256
|
var isLoadMoreButton = function (element) {
|
|
257
|
-
return isPresent(closestWithMatch(element, '.k-
|
|
257
|
+
return isPresent(closestWithMatch(element, '.k-treeview-leaf.k-treeview-load-more-button'));
|
|
258
258
|
};
|
|
259
259
|
/**
|
|
260
260
|
* @hidden
|
|
@@ -407,17 +407,27 @@ var fetchLoadedDescendants = function (lookup, filterExpression) {
|
|
|
407
407
|
/**
|
|
408
408
|
* @hidden
|
|
409
409
|
*
|
|
410
|
-
* Compares two
|
|
410
|
+
* Compares two Seets to determine whether all unique elements in one, are present in the other.
|
|
411
411
|
* Important:
|
|
412
412
|
* - it disregards the element order
|
|
413
|
-
* - it disregards element repetitions - sameValues([1, 1, 2], [1, 2, 2]) will return true
|
|
414
413
|
*/
|
|
415
|
-
var sameValues = function (
|
|
416
|
-
if (
|
|
414
|
+
var sameValues = function (as, bs) {
|
|
415
|
+
if (as.size !== bs.size) {
|
|
417
416
|
return false;
|
|
418
417
|
}
|
|
419
|
-
|
|
420
|
-
|
|
418
|
+
return Array.from(as).every(function (v) { return bs.has(v); });
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* @hidden
|
|
422
|
+
* Returns the size class based on the component and size input.
|
|
423
|
+
*/
|
|
424
|
+
var getSizeClass = function (component, size) {
|
|
425
|
+
var SIZE_CLASSES = {
|
|
426
|
+
'small': "k-" + component + "-sm",
|
|
427
|
+
'medium': "k-" + component + "-md",
|
|
428
|
+
'large': "k-" + component + "-lg"
|
|
429
|
+
};
|
|
430
|
+
return SIZE_CLASSES[size];
|
|
421
431
|
};
|
|
422
432
|
|
|
423
433
|
var safe = function (node) { return (node || {}); };
|
|
@@ -1081,9 +1091,10 @@ var providers = [
|
|
|
1081
1091
|
* Represents the [Kendo UI TreeView component for Angular]({% slug overview_treeview %}).
|
|
1082
1092
|
*
|
|
1083
1093
|
* @example
|
|
1084
|
-
* {% meta height:
|
|
1085
|
-
* {% embed_file
|
|
1086
|
-
* {% embed_file
|
|
1094
|
+
* {% meta height:450 %}
|
|
1095
|
+
* {% embed_file get-started/app.component.ts preview %}
|
|
1096
|
+
* {% embed_file get-started/app.module.ts %}
|
|
1097
|
+
* {% embed_file shared/main.ts %}
|
|
1087
1098
|
* {% endmeta %}
|
|
1088
1099
|
*/
|
|
1089
1100
|
var TreeViewComponent = /** @class */ (function () {
|
|
@@ -1258,6 +1269,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1258
1269
|
this.isActive = false;
|
|
1259
1270
|
this.data = new BehaviorSubject([]);
|
|
1260
1271
|
this._animate = true;
|
|
1272
|
+
this._size = 'medium';
|
|
1261
1273
|
this.subscriptions = new Subscription();
|
|
1262
1274
|
this.domSubscriptions = [];
|
|
1263
1275
|
validatePackage(packageMetadata);
|
|
@@ -1284,21 +1296,33 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1284
1296
|
configurable: true
|
|
1285
1297
|
});
|
|
1286
1298
|
Object.defineProperty(TreeViewComponent.prototype, "nodeTemplateRef", {
|
|
1299
|
+
get: function () {
|
|
1300
|
+
return this._nodeTemplateRef || this.nodeTemplateQuery;
|
|
1301
|
+
},
|
|
1287
1302
|
/**
|
|
1288
1303
|
* @hidden
|
|
1304
|
+
*
|
|
1305
|
+
* Defines the template for each node.
|
|
1306
|
+
* Takes precedence over nested templates in the TreeView tag.
|
|
1289
1307
|
*/
|
|
1290
1308
|
set: function (template) {
|
|
1291
|
-
this.
|
|
1309
|
+
this._nodeTemplateRef = template;
|
|
1292
1310
|
},
|
|
1293
1311
|
enumerable: true,
|
|
1294
1312
|
configurable: true
|
|
1295
1313
|
});
|
|
1296
1314
|
Object.defineProperty(TreeViewComponent.prototype, "loadMoreButtonTemplateRef", {
|
|
1315
|
+
get: function () {
|
|
1316
|
+
return this._loadMoreButtonTemplateRef || this.loadMoreButtonTemplateQuery;
|
|
1317
|
+
},
|
|
1297
1318
|
/**
|
|
1298
1319
|
* @hidden
|
|
1320
|
+
*
|
|
1321
|
+
* Defines the template for each load-more button.
|
|
1322
|
+
* Takes precedence over nested templates in the TreeView tag.
|
|
1299
1323
|
*/
|
|
1300
1324
|
set: function (template) {
|
|
1301
|
-
this.
|
|
1325
|
+
this._loadMoreButtonTemplateRef = template;
|
|
1302
1326
|
},
|
|
1303
1327
|
enumerable: true,
|
|
1304
1328
|
configurable: true
|
|
@@ -1377,6 +1401,30 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1377
1401
|
enumerable: true,
|
|
1378
1402
|
configurable: true
|
|
1379
1403
|
});
|
|
1404
|
+
Object.defineProperty(TreeViewComponent.prototype, "size", {
|
|
1405
|
+
get: function () {
|
|
1406
|
+
return this._size;
|
|
1407
|
+
},
|
|
1408
|
+
/**
|
|
1409
|
+
* Sets the size of the component.
|
|
1410
|
+
*
|
|
1411
|
+
* The possible values are:
|
|
1412
|
+
* * `'small'`
|
|
1413
|
+
* * `'medium'` (default)
|
|
1414
|
+
* * `'large'`
|
|
1415
|
+
* * `null`
|
|
1416
|
+
*
|
|
1417
|
+
*/
|
|
1418
|
+
set: function (size) {
|
|
1419
|
+
this.renderer.removeClass(this.element.nativeElement, getSizeClass('treeview', this.size));
|
|
1420
|
+
if (size) {
|
|
1421
|
+
this.renderer.addClass(this.element.nativeElement, getSizeClass('treeview', size));
|
|
1422
|
+
}
|
|
1423
|
+
this._size = size;
|
|
1424
|
+
},
|
|
1425
|
+
enumerable: true,
|
|
1426
|
+
configurable: true
|
|
1427
|
+
});
|
|
1380
1428
|
TreeViewComponent.prototype.ngOnChanges = function (changes) {
|
|
1381
1429
|
this.navigationService.navigable = Boolean(this.navigable);
|
|
1382
1430
|
// TODO: should react to changes.loadOnDemand as well - should preload the data or clear the already cached items
|
|
@@ -1417,6 +1465,9 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1417
1465
|
_this.attachDomHandlers();
|
|
1418
1466
|
});
|
|
1419
1467
|
}
|
|
1468
|
+
if (this.size) {
|
|
1469
|
+
this.renderer.addClass(this.element.nativeElement, getSizeClass('treeview', this.size));
|
|
1470
|
+
}
|
|
1420
1471
|
};
|
|
1421
1472
|
/**
|
|
1422
1473
|
* Blurs the focused TreeView item.
|
|
@@ -1576,7 +1627,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1576
1627
|
return;
|
|
1577
1628
|
}
|
|
1578
1629
|
var index = nodeId(closestNode(target));
|
|
1579
|
-
// the disabled check is probably not needed due to the k-
|
|
1630
|
+
// the disabled check is probably not needed due to the k-disabled styles
|
|
1580
1631
|
if (!index || this.navigationService.isDisabled(index)) {
|
|
1581
1632
|
return;
|
|
1582
1633
|
}
|
|
@@ -1638,7 +1689,6 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1638
1689
|
});
|
|
1639
1690
|
};
|
|
1640
1691
|
__decorate([
|
|
1641
|
-
HostBinding("class.k-widget"),
|
|
1642
1692
|
HostBinding("class.k-treeview"),
|
|
1643
1693
|
__metadata("design:type", Boolean)
|
|
1644
1694
|
], TreeViewComponent.prototype, "classNames", void 0);
|
|
@@ -1734,18 +1784,18 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1734
1784
|
__metadata("design:type", EventEmitter)
|
|
1735
1785
|
], TreeViewComponent.prototype, "nodeDblClick", void 0);
|
|
1736
1786
|
__decorate([
|
|
1737
|
-
ContentChild(NodeTemplateDirective, { static:
|
|
1787
|
+
ContentChild(NodeTemplateDirective, { static: false }),
|
|
1738
1788
|
__metadata("design:type", NodeTemplateDirective)
|
|
1739
|
-
], TreeViewComponent.prototype, "
|
|
1789
|
+
], TreeViewComponent.prototype, "nodeTemplateQuery", void 0);
|
|
1740
1790
|
__decorate([
|
|
1741
1791
|
Input('nodeTemplate'),
|
|
1742
1792
|
__metadata("design:type", NodeTemplateDirective),
|
|
1743
1793
|
__metadata("design:paramtypes", [NodeTemplateDirective])
|
|
1744
1794
|
], TreeViewComponent.prototype, "nodeTemplateRef", null);
|
|
1745
1795
|
__decorate([
|
|
1746
|
-
ContentChild(LoadMoreButtonTemplateDirective, { static:
|
|
1796
|
+
ContentChild(LoadMoreButtonTemplateDirective, { static: false }),
|
|
1747
1797
|
__metadata("design:type", LoadMoreButtonTemplateDirective)
|
|
1748
|
-
], TreeViewComponent.prototype, "
|
|
1798
|
+
], TreeViewComponent.prototype, "loadMoreButtonTemplateQuery", void 0);
|
|
1749
1799
|
__decorate([
|
|
1750
1800
|
Input('loadMoreButtonTemplate'),
|
|
1751
1801
|
__metadata("design:type", LoadMoreButtonTemplateDirective),
|
|
@@ -1812,13 +1862,18 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1812
1862
|
Input(),
|
|
1813
1863
|
__metadata("design:type", String)
|
|
1814
1864
|
], TreeViewComponent.prototype, "filter", void 0);
|
|
1865
|
+
__decorate([
|
|
1866
|
+
Input(),
|
|
1867
|
+
__metadata("design:type", String),
|
|
1868
|
+
__metadata("design:paramtypes", [String])
|
|
1869
|
+
], TreeViewComponent.prototype, "size", null);
|
|
1815
1870
|
TreeViewComponent = __decorate([
|
|
1816
1871
|
Component({
|
|
1817
1872
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
1818
1873
|
exportAs: 'kendoTreeView',
|
|
1819
1874
|
providers: providers,
|
|
1820
1875
|
selector: 'kendo-treeview',
|
|
1821
|
-
template: "\n <
|
|
1876
|
+
template: "\n <span\n class=\"k-treeview-filter\"\n *ngIf=\"filterable\"\n >\n <kendo-textbox\n [size]=\"size\"\n [value]=\"filter\"\n [clearButton]=\"true\"\n (valueChange)=\"filterChange.emit($event)\"\n [placeholder]=\"filterInputPlaceholder\"\n >\n <ng-template kendoTextBoxPrefixTemplate>\n <span class=\"k-input-icon k-icon k-i-search\"></span>\n </ng-template>\n </kendo-textbox>\n </span>\n <ul class=\"k-treeview-lines\"\n kendoTreeViewGroup\n role=\"group\"\n [size]=\"size\"\n [loadOnDemand]=\"loadOnDemand\"\n [checkboxes]=\"checkboxes\"\n [expandIcons]=\"expandIcons\"\n [selectable]=\"selectable\"\n [touchActions]=\"touchActions\"\n [children]=\"children\"\n [hasChildren]=\"hasChildren\"\n [isChecked]=\"isChecked\"\n [isDisabled]=\"isDisabled\"\n [isExpanded]=\"isExpanded\"\n [isSelected]=\"isSelected\"\n [isVisible]=\"isVisible\"\n [nodeTemplateRef]=\"nodeTemplateRef?.templateRef\"\n [loadMoreButtonTemplateRef]=\"loadMoreButtonTemplateRef?.templateRef\"\n [textField]=\"textField\"\n [nodes]=\"fetchNodes\"\n [loadMoreService]=\"loadMoreService\"\n [trackBy]=\"trackBy\"\n >\n </ul>\n <ng-container #assetsContainer></ng-container>\n "
|
|
1822
1877
|
}),
|
|
1823
1878
|
__metadata("design:paramtypes", [ElementRef,
|
|
1824
1879
|
ChangeDetectorRef,
|
|
@@ -1852,6 +1907,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
1852
1907
|
this.role = 'group';
|
|
1853
1908
|
this.loadOnDemand = true;
|
|
1854
1909
|
this.textField = "";
|
|
1910
|
+
this.size = 'medium';
|
|
1855
1911
|
this.initialNodesLoaded = false;
|
|
1856
1912
|
this.loadingMoreNodes = false;
|
|
1857
1913
|
this._data = [];
|
|
@@ -2085,7 +2141,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2085
2141
|
this.emitChildrenLoaded(mappedChildren);
|
|
2086
2142
|
};
|
|
2087
2143
|
__decorate([
|
|
2088
|
-
HostBinding("class.k-group"),
|
|
2144
|
+
HostBinding("class.k-treeview-group"),
|
|
2089
2145
|
__metadata("design:type", Boolean)
|
|
2090
2146
|
], TreeViewGroupComponent.prototype, "kGroupClass", void 0);
|
|
2091
2147
|
__decorate([
|
|
@@ -2148,6 +2204,10 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2148
2204
|
Input(),
|
|
2149
2205
|
__metadata("design:type", Object)
|
|
2150
2206
|
], TreeViewGroupComponent.prototype, "loadMoreService", void 0);
|
|
2207
|
+
__decorate([
|
|
2208
|
+
Input(),
|
|
2209
|
+
__metadata("design:type", String)
|
|
2210
|
+
], TreeViewGroupComponent.prototype, "size", void 0);
|
|
2151
2211
|
__decorate([
|
|
2152
2212
|
Input(),
|
|
2153
2213
|
__metadata("design:type", Function)
|
|
@@ -2191,7 +2251,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2191
2251
|
])
|
|
2192
2252
|
],
|
|
2193
2253
|
selector: '[kendoTreeViewGroup]',
|
|
2194
|
-
template: "\n <li\n *ngFor=\"let node of data; let index = index; trackBy: trackBy\"\n class=\"k-
|
|
2254
|
+
template: "\n <li\n *ngFor=\"let node of data; let index = index; trackBy: trackBy\"\n class=\"k-treeview-item\"\n [class.k-display-none]=\"!isVisible(node, nodeIndex(index))\"\n kendoTreeViewItem\n [attr.aria-setsize]=\"totalNodesCount\"\n [dataItem]=\"node\"\n [index]=\"nodeIndex(index)\"\n [parentDataItem]=\"parentDataItem\"\n [parentIndex]=\"parentIndex\"\n [loadOnDemand]=\"loadOnDemand\"\n [checkable]=\"checkboxes\"\n [isChecked]=\"isChecked(node, nodeIndex(index))\"\n [isDisabled]=\"disabled || isDisabled(node, nodeIndex(index))\"\n [isVisible]=\"isVisible(node, nodeIndex(index))\"\n [expandable]=\"expandIcons && hasChildren(node)\"\n [isExpanded]=\"isExpanded(node, nodeIndex(index))\"\n [selectable]=\"selectable\"\n [isSelected]=\"isSelected(node, nodeIndex(index))\"\n [attr.data-treeindex]=\"nodeIndex(index)\"\n >\n <div class=\"k-treeview-mid\">\n <span\n class=\"k-treeview-toggle\"\n [kendoTreeViewLoading]=\"nodeIndex(index)\"\n (click)=\"expandNode(nodeIndex(index), node, !isExpanded(node, nodeIndex(index)))\"\n *ngIf=\"expandIcons && hasChildren(node)\"\n >\n <span\n class=\"k-icon\"\n [class.k-i-collapse]=\"isExpanded(node, nodeIndex(index))\"\n [class.k-i-expand]=\"!isExpanded(node, nodeIndex(index))\"\n >\n </span>\n </span>\n <kendo-checkbox\n *ngIf=\"checkboxes\"\n [size]=\"size\"\n [node]=\"node\"\n [index]=\"nodeIndex(index)\"\n [isChecked]=\"isChecked\"\n (checkStateChange)=\"checkNode(nodeIndex(index))\"\n tabindex=\"-1\"\n ></kendo-checkbox>\n <span kendoTreeViewItemContent\n [attr.data-treeindex]=\"nodeIndex(index)\"\n [dataItem]=\"node\"\n [index]=\"nodeIndex(index)\"\n [initialSelection]=\"isSelected(node, nodeIndex(index))\"\n [isSelected]=\"isSelected\"\n class=\"k-treeview-leaf\"\n [style.touch-action]=\"touchActions ? '' : 'none'\"\n >\n <span class=\"k-treeview-leaf-text\">\n <ng-container [ngSwitch]=\"hasTemplate\">\n <ng-container *ngSwitchCase=\"true\">\n <ng-template\n [ngTemplateOutlet]=\"nodeTemplateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: node,\n index: nodeIndex(index)\n }\"\n >\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{nodeText(node)}}\n </ng-container>\n </ng-container>\n </span>\n </span>\n </div>\n <ul\n *ngIf=\"isExpanded(node, nodeIndex(index)) && hasChildren(node)\"\n kendoTreeViewGroup\n role=\"group\"\n [nodes]=\"fetchChildren\"\n [loadOnDemand]=\"loadOnDemand\"\n [checkboxes]=\"checkboxes\"\n [expandIcons]=\"expandIcons\"\n [selectable]=\"selectable\"\n [touchActions]=\"touchActions\"\n [children]=\"children\"\n [hasChildren]=\"hasChildren\"\n [isChecked]=\"isChecked\"\n [isDisabled]=\"isDisabled\"\n [disabled]=\"disabled || isDisabled(node, nodeIndex(index))\"\n [isExpanded]=\"isExpanded\"\n [isSelected]=\"isSelected\"\n [isVisible]=\"isVisible\"\n [nodeTemplateRef]=\"nodeTemplateRef\"\n [loadMoreButtonTemplateRef]=\"loadMoreButtonTemplateRef\"\n [parentIndex]=\"nodeIndex(index)\"\n [parentDataItem]=\"node\"\n [textField]=\"nextFields\"\n [loadMoreService]=\"loadMoreService\"\n [@toggle]=\"true\"\n [trackBy]=\"trackBy\"\n >\n </ul>\n </li>\n <li\n *ngIf=\"initialNodesLoaded && moreNodesAvailable\"\n class=\"k-treeview-item\"\n [class.k-treeview-load-more-checkboxes-container]=\"checkboxes\"\n kendoTreeViewItem\n role=\"button\"\n [selectable]=\"false\"\n [checkable]=\"false\"\n [expandable]=\"false\"\n [index]=\"loadMoreButtonIndex\"\n [parentDataItem]=\"parentDataItem\"\n [parentIndex]=\"parentIndex\"\n [attr.data-treeindex]=\"loadMoreButtonIndex\"\n >\n <div class=\"k-treeview-mid\">\n <span\n *ngIf=\"loadingMoreNodes\"\n class=\"k-icon k-i-loading k-i-expand\"\n >\n </span>\n <span\n class=\"k-treeview-leaf k-treeview-load-more-button\"\n [attr.data-treeindex]=\"loadMoreButtonIndex\"\n kendoTreeViewItemContent\n [index]=\"loadMoreButtonIndex\"\n >\n <span class=\"k-treeview-leaf-text\">\n <ng-template\n *ngIf=\"loadMoreButtonTemplateRef\"\n [ngTemplateOutlet]=\"loadMoreButtonTemplateRef\"\n [ngTemplateOutletContext]=\"{\n index: loadMoreButtonIndex\n }\"\n >\n </ng-template>\n <ng-container *ngIf=\"!loadMoreButtonTemplateRef\">\n Load more\n </ng-container>\n </span>\n </span>\n </div>\n </li>\n "
|
|
2195
2255
|
}),
|
|
2196
2256
|
__metadata("design:paramtypes", [ExpandStateService,
|
|
2197
2257
|
LoadingNotificationService,
|
|
@@ -2241,7 +2301,10 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2241
2301
|
'multiple': function (e) { return _this.checkMultiple(e); },
|
|
2242
2302
|
'single': function (e) { return _this.checkSingle(e); }
|
|
2243
2303
|
};
|
|
2244
|
-
|
|
2304
|
+
/**
|
|
2305
|
+
* Reflectes the internal `checkedKeys` state.
|
|
2306
|
+
*/
|
|
2307
|
+
this.state = new Set();
|
|
2245
2308
|
this.subscriptions.add(this.treeView.checkedChange
|
|
2246
2309
|
.subscribe(function (e) { return _this.check(e); }));
|
|
2247
2310
|
var expandedItems = [];
|
|
@@ -2260,20 +2323,6 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2260
2323
|
enumerable: true,
|
|
2261
2324
|
configurable: true
|
|
2262
2325
|
});
|
|
2263
|
-
Object.defineProperty(CheckDirective.prototype, "checkedKeys", {
|
|
2264
|
-
/**
|
|
2265
|
-
* Defines the collection that will store the checked keys
|
|
2266
|
-
* ([see example]({% slug checkboxes_treeview %})).
|
|
2267
|
-
*/
|
|
2268
|
-
get: function () {
|
|
2269
|
-
return this._checkedKeys;
|
|
2270
|
-
},
|
|
2271
|
-
set: function (keys) {
|
|
2272
|
-
this._checkedKeys = keys;
|
|
2273
|
-
},
|
|
2274
|
-
enumerable: true,
|
|
2275
|
-
configurable: true
|
|
2276
|
-
});
|
|
2277
2326
|
Object.defineProperty(CheckDirective.prototype, "options", {
|
|
2278
2327
|
get: function () {
|
|
2279
2328
|
var defaultOptions = {
|
|
@@ -2298,6 +2347,9 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2298
2347
|
this.treeView.checkboxes = this.options.enabled;
|
|
2299
2348
|
this.toggleCheckOnClick();
|
|
2300
2349
|
}
|
|
2350
|
+
if (isChanged('checkedKeys', changes, false) && changes.checkedKeys.currentValue !== this.lastChange) {
|
|
2351
|
+
this.state = new Set(changes.checkedKeys.currentValue);
|
|
2352
|
+
}
|
|
2301
2353
|
};
|
|
2302
2354
|
CheckDirective.prototype.ngOnDestroy = function () {
|
|
2303
2355
|
this.subscriptions.unsubscribe();
|
|
@@ -2307,11 +2359,11 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2307
2359
|
if (!this.checkKey) {
|
|
2308
2360
|
return this.isIndexChecked(index);
|
|
2309
2361
|
}
|
|
2310
|
-
var
|
|
2311
|
-
return
|
|
2362
|
+
var hasKey = this.state.has(this.itemKey({ dataItem: dataItem, index: index }));
|
|
2363
|
+
return hasKey ? 'checked' : 'none';
|
|
2312
2364
|
};
|
|
2313
2365
|
CheckDirective.prototype.isIndexChecked = function (index) {
|
|
2314
|
-
var checkedKeys = this.
|
|
2366
|
+
var checkedKeys = Array.from(this.state).filter(matchKey(index));
|
|
2315
2367
|
if (indexChecked(checkedKeys, index)) {
|
|
2316
2368
|
return 'checked';
|
|
2317
2369
|
}
|
|
@@ -2342,7 +2394,11 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2342
2394
|
};
|
|
2343
2395
|
CheckDirective.prototype.checkSingle = function (node) {
|
|
2344
2396
|
var key = this.itemKey(node.item);
|
|
2345
|
-
|
|
2397
|
+
var hasKey = this.state.has(key);
|
|
2398
|
+
this.state.clear();
|
|
2399
|
+
if (!hasKey) {
|
|
2400
|
+
this.state.add(key);
|
|
2401
|
+
}
|
|
2346
2402
|
this.notify();
|
|
2347
2403
|
};
|
|
2348
2404
|
CheckDirective.prototype.checkMultiple = function (node) {
|
|
@@ -2379,7 +2435,6 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2379
2435
|
if (!isPresent(currentKey)) {
|
|
2380
2436
|
return;
|
|
2381
2437
|
}
|
|
2382
|
-
var checkedKeys = new Set(this.checkedKeys);
|
|
2383
2438
|
var pendingCheck = [currentKey];
|
|
2384
2439
|
if (this.options.checkChildren) {
|
|
2385
2440
|
var descendants = fetchLoadedDescendants(node, function (_a) {
|
|
@@ -2393,63 +2448,59 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2393
2448
|
});
|
|
2394
2449
|
pendingCheck.push.apply(pendingCheck, descendants);
|
|
2395
2450
|
}
|
|
2396
|
-
var shouldCheck = !
|
|
2451
|
+
var shouldCheck = !this.state.has(currentKey);
|
|
2397
2452
|
pendingCheck.forEach(function (key) {
|
|
2398
2453
|
if (shouldCheck) {
|
|
2399
|
-
|
|
2454
|
+
_this.state.add(key);
|
|
2400
2455
|
}
|
|
2401
2456
|
else {
|
|
2402
|
-
|
|
2457
|
+
_this.state.delete(key);
|
|
2403
2458
|
}
|
|
2404
2459
|
});
|
|
2405
|
-
this.checkedKeys = Array.from(checkedKeys);
|
|
2406
2460
|
};
|
|
2407
2461
|
CheckDirective.prototype.checkParents = function (parent) {
|
|
2408
2462
|
var _this = this;
|
|
2409
2463
|
if (!isPresent(parent)) {
|
|
2410
2464
|
return;
|
|
2411
2465
|
}
|
|
2412
|
-
var checkedKeys = new Set(this.checkedKeys);
|
|
2413
2466
|
var currentParent = parent;
|
|
2414
2467
|
while (currentParent) {
|
|
2415
2468
|
var parentKey = this.itemKey(currentParent.item);
|
|
2416
|
-
var allChildrenSelected = currentParent.children.every(function (item) { return
|
|
2469
|
+
var allChildrenSelected = currentParent.children.every(function (item) { return _this.state.has(_this.itemKey(item)); });
|
|
2417
2470
|
if (allChildrenSelected) {
|
|
2418
|
-
|
|
2471
|
+
this.state.add(parentKey);
|
|
2419
2472
|
}
|
|
2420
2473
|
else {
|
|
2421
|
-
|
|
2474
|
+
this.state.delete(parentKey);
|
|
2422
2475
|
}
|
|
2423
2476
|
currentParent = currentParent.parent;
|
|
2424
2477
|
}
|
|
2425
|
-
this.checkedKeys = Array.from(checkedKeys);
|
|
2426
2478
|
};
|
|
2427
2479
|
CheckDirective.prototype.notify = function () {
|
|
2428
|
-
this.
|
|
2480
|
+
this.lastChange = Array.from(this.state);
|
|
2481
|
+
this.checkedKeysChange.emit(this.lastChange);
|
|
2429
2482
|
};
|
|
2430
2483
|
CheckDirective.prototype.addCheckedItemsChildren = function (lookups) {
|
|
2431
2484
|
var _this = this;
|
|
2432
2485
|
if (!isPresent(lookups) || lookups.length === 0) {
|
|
2433
2486
|
return;
|
|
2434
2487
|
}
|
|
2435
|
-
var initiallyCheckedItemsCount = this.
|
|
2436
|
-
var checkedKeys = new Set(this.checkedKeys);
|
|
2488
|
+
var initiallyCheckedItemsCount = this.state.size;
|
|
2437
2489
|
lookups.forEach(function (lookup) {
|
|
2438
2490
|
var itemKey = _this.itemKey(lookup.item);
|
|
2439
|
-
if (!
|
|
2491
|
+
if (!_this.state.has(itemKey)) {
|
|
2440
2492
|
return;
|
|
2441
2493
|
}
|
|
2442
2494
|
lookup.children.forEach(function (item) {
|
|
2443
2495
|
// ensure both the parent item and each child node is enabled
|
|
2444
2496
|
if (!_this.treeView.isDisabled(lookup.item.dataItem, lookup.item.index) &&
|
|
2445
2497
|
!_this.treeView.isDisabled(item.dataItem, item.index)) {
|
|
2446
|
-
|
|
2498
|
+
_this.state.add(_this.itemKey(item));
|
|
2447
2499
|
}
|
|
2448
2500
|
});
|
|
2449
2501
|
});
|
|
2450
|
-
var hasNewlyCheckedItems = initiallyCheckedItemsCount !==
|
|
2502
|
+
var hasNewlyCheckedItems = initiallyCheckedItemsCount !== this.state.size;
|
|
2451
2503
|
if (hasNewlyCheckedItems) {
|
|
2452
|
-
this.checkedKeys = Array.from(checkedKeys);
|
|
2453
2504
|
this.zone.run(function () { return _this.notify(); });
|
|
2454
2505
|
}
|
|
2455
2506
|
};
|
|
@@ -2464,9 +2515,8 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2464
2515
|
], CheckDirective.prototype, "checkKey", void 0);
|
|
2465
2516
|
__decorate([
|
|
2466
2517
|
Input(),
|
|
2467
|
-
__metadata("design:type", Array)
|
|
2468
|
-
|
|
2469
|
-
], CheckDirective.prototype, "checkedKeys", null);
|
|
2518
|
+
__metadata("design:type", Array)
|
|
2519
|
+
], CheckDirective.prototype, "checkedKeys", void 0);
|
|
2470
2520
|
__decorate([
|
|
2471
2521
|
Input('kendoTreeViewCheckable'),
|
|
2472
2522
|
__metadata("design:type", Object)
|
|
@@ -2571,8 +2621,11 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2571
2621
|
*/
|
|
2572
2622
|
this.expandedKeysChange = new EventEmitter();
|
|
2573
2623
|
this.subscriptions = new Subscription();
|
|
2574
|
-
|
|
2575
|
-
|
|
2624
|
+
/**
|
|
2625
|
+
* Reflectes the internal `expandedKeys` state.
|
|
2626
|
+
*/
|
|
2627
|
+
this.state = new Set();
|
|
2628
|
+
this.originalExpandedKeys = new Set();
|
|
2576
2629
|
this.isFiltered = false;
|
|
2577
2630
|
/**
|
|
2578
2631
|
* Fills array with the correct expand keys according to wrapper metadata.
|
|
@@ -2605,7 +2658,7 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2605
2658
|
this.subscriptions.add(this.component.filterStateChange.subscribe(this.handleAutoExpand.bind(this)));
|
|
2606
2659
|
}
|
|
2607
2660
|
this.component.isExpanded = function (dataItem, index) {
|
|
2608
|
-
return _this.
|
|
2661
|
+
return _this.state.has(_this.itemKey({ dataItem: dataItem, index: index }));
|
|
2609
2662
|
};
|
|
2610
2663
|
}
|
|
2611
2664
|
Object.defineProperty(ExpandDirective.prototype, "isExpanded", {
|
|
@@ -2626,19 +2679,11 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2626
2679
|
enumerable: true,
|
|
2627
2680
|
configurable: true
|
|
2628
2681
|
});
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
return this._expandedKeys;
|
|
2635
|
-
},
|
|
2636
|
-
set: function (keys) {
|
|
2637
|
-
this._expandedKeys = keys;
|
|
2638
|
-
},
|
|
2639
|
-
enumerable: true,
|
|
2640
|
-
configurable: true
|
|
2641
|
-
});
|
|
2682
|
+
ExpandDirective.prototype.ngOnChanges = function (changes) {
|
|
2683
|
+
if (isChanged('expandedKeys', changes, false) && changes.expandedKeys.currentValue !== this.lastChange) {
|
|
2684
|
+
this.state = new Set(changes.expandedKeys.currentValue);
|
|
2685
|
+
}
|
|
2686
|
+
};
|
|
2642
2687
|
ExpandDirective.prototype.ngOnDestroy = function () {
|
|
2643
2688
|
this.subscriptions.unsubscribe();
|
|
2644
2689
|
};
|
|
@@ -2658,19 +2703,19 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2658
2703
|
};
|
|
2659
2704
|
ExpandDirective.prototype.toggleExpand = function (_a) {
|
|
2660
2705
|
var index = _a.index, dataItem = _a.dataItem, expand = _a.expand;
|
|
2661
|
-
var
|
|
2662
|
-
var
|
|
2706
|
+
var key = this.itemKey({ index: index, dataItem: dataItem });
|
|
2707
|
+
var isExpanded = this.state.has(key);
|
|
2663
2708
|
var notify = false;
|
|
2664
|
-
if (
|
|
2665
|
-
this.
|
|
2709
|
+
if (isExpanded && !expand) {
|
|
2710
|
+
this.state.delete(key);
|
|
2666
2711
|
notify = true;
|
|
2667
2712
|
}
|
|
2668
|
-
else if (
|
|
2669
|
-
this.
|
|
2713
|
+
else if (!isExpanded && expand) {
|
|
2714
|
+
this.state.add(key);
|
|
2670
2715
|
notify = true;
|
|
2671
2716
|
}
|
|
2672
2717
|
if (notify) {
|
|
2673
|
-
this.
|
|
2718
|
+
this.notify();
|
|
2674
2719
|
}
|
|
2675
2720
|
};
|
|
2676
2721
|
ExpandDirective.prototype.handleAutoExpand = function (_a) {
|
|
@@ -2681,7 +2726,7 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2681
2726
|
}
|
|
2682
2727
|
var _b = this.filterExpandSettings, maxAutoExpandResults = _b.maxAutoExpandResults, autoExpandMatches = _b.expandMatches, expandedOnClear = _b.expandedOnClear;
|
|
2683
2728
|
if (!this.isFiltered) {
|
|
2684
|
-
this.originalExpandedKeys = this.
|
|
2729
|
+
this.originalExpandedKeys = new Set(this.state);
|
|
2685
2730
|
}
|
|
2686
2731
|
var exitingFilteredState = this.isFiltered && !term;
|
|
2687
2732
|
var maxExceeded = maxAutoExpandResults !== -1 && matchCount > maxAutoExpandResults;
|
|
@@ -2689,18 +2734,18 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2689
2734
|
if (exitAutoExpandedState) {
|
|
2690
2735
|
switch (expandedOnClear) {
|
|
2691
2736
|
case "initial": {
|
|
2692
|
-
if (!sameValues(this.
|
|
2693
|
-
this.
|
|
2694
|
-
this.
|
|
2737
|
+
if (!sameValues(this.state, this.originalExpandedKeys)) {
|
|
2738
|
+
this.state = this.originalExpandedKeys;
|
|
2739
|
+
this.notify();
|
|
2695
2740
|
}
|
|
2696
2741
|
break;
|
|
2697
2742
|
}
|
|
2698
2743
|
case "all": {
|
|
2699
|
-
this.
|
|
2744
|
+
this.state = new Set(nodes.reduce(function (acc, rootNode) {
|
|
2700
2745
|
_this.getEveryExpandKey(acc, rootNode);
|
|
2701
2746
|
return acc;
|
|
2702
|
-
}, []);
|
|
2703
|
-
this.
|
|
2747
|
+
}, []));
|
|
2748
|
+
this.notify();
|
|
2704
2749
|
break;
|
|
2705
2750
|
}
|
|
2706
2751
|
case "unchanged": {
|
|
@@ -2708,9 +2753,9 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2708
2753
|
}
|
|
2709
2754
|
case "none":
|
|
2710
2755
|
default: {
|
|
2711
|
-
if (this.
|
|
2712
|
-
this.
|
|
2713
|
-
this.
|
|
2756
|
+
if (this.state.size !== 0) {
|
|
2757
|
+
this.state.clear();
|
|
2758
|
+
this.notify();
|
|
2714
2759
|
}
|
|
2715
2760
|
break;
|
|
2716
2761
|
}
|
|
@@ -2718,16 +2763,20 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2718
2763
|
this.isFiltered = false;
|
|
2719
2764
|
return;
|
|
2720
2765
|
}
|
|
2721
|
-
var indicesToExpand = nodes.reduce(function (acc, rootNode) {
|
|
2766
|
+
var indicesToExpand = new Set(nodes.reduce(function (acc, rootNode) {
|
|
2722
2767
|
_this.updateExpandedNodes(acc, rootNode, autoExpandMatches);
|
|
2723
2768
|
return acc;
|
|
2724
|
-
}, []);
|
|
2725
|
-
if (!sameValues(this.
|
|
2726
|
-
this.
|
|
2727
|
-
this.
|
|
2769
|
+
}, []));
|
|
2770
|
+
if (!sameValues(this.state, indicesToExpand)) {
|
|
2771
|
+
this.state = indicesToExpand;
|
|
2772
|
+
this.notify();
|
|
2728
2773
|
}
|
|
2729
2774
|
this.isFiltered = true;
|
|
2730
2775
|
};
|
|
2776
|
+
ExpandDirective.prototype.notify = function () {
|
|
2777
|
+
this.lastChange = Array.from(this.state);
|
|
2778
|
+
this.expandedKeysChange.emit(this.lastChange);
|
|
2779
|
+
};
|
|
2731
2780
|
__decorate([
|
|
2732
2781
|
Input(),
|
|
2733
2782
|
__metadata("design:type", Function),
|
|
@@ -2747,9 +2796,8 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2747
2796
|
], ExpandDirective.prototype, "expandedKeysChange", void 0);
|
|
2748
2797
|
__decorate([
|
|
2749
2798
|
Input(),
|
|
2750
|
-
__metadata("design:type", Array)
|
|
2751
|
-
|
|
2752
|
-
], ExpandDirective.prototype, "expandedKeys", null);
|
|
2799
|
+
__metadata("design:type", Array)
|
|
2800
|
+
], ExpandDirective.prototype, "expandedKeys", void 0);
|
|
2753
2801
|
ExpandDirective = __decorate([
|
|
2754
2802
|
Directive({ selector: '[kendoTreeViewExpandable]' }),
|
|
2755
2803
|
__metadata("design:paramtypes", [ExpandableComponent])
|
|
@@ -2774,9 +2822,12 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2774
2822
|
'multiple': function (e) { return _this.selectMultiple(e); },
|
|
2775
2823
|
'single': function (e) { return _this.selectSingle(e); }
|
|
2776
2824
|
};
|
|
2777
|
-
|
|
2825
|
+
/**
|
|
2826
|
+
* Reflectes the internal `selectedKeys` state.
|
|
2827
|
+
*/
|
|
2828
|
+
this.state = new Set();
|
|
2778
2829
|
this.subscriptions.add(this.treeView.selectionChange.subscribe(this.select.bind(this)));
|
|
2779
|
-
this.treeView.isSelected = function (dataItem, index) { return (_this.
|
|
2830
|
+
this.treeView.isSelected = function (dataItem, index) { return (_this.state.has(_this.itemKey({ dataItem: dataItem, index: index }))); };
|
|
2780
2831
|
}
|
|
2781
2832
|
Object.defineProperty(SelectDirective.prototype, "isSelected", {
|
|
2782
2833
|
/**
|
|
@@ -2788,20 +2839,6 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2788
2839
|
enumerable: true,
|
|
2789
2840
|
configurable: true
|
|
2790
2841
|
});
|
|
2791
|
-
Object.defineProperty(SelectDirective.prototype, "selectedKeys", {
|
|
2792
|
-
/**
|
|
2793
|
-
* Defines the collection that will store the selected keys
|
|
2794
|
-
* ([see example]({% slug selection_treeview %}#toc-selection-modes)).
|
|
2795
|
-
*/
|
|
2796
|
-
get: function () {
|
|
2797
|
-
return this._selectedKeys;
|
|
2798
|
-
},
|
|
2799
|
-
set: function (keys) {
|
|
2800
|
-
this._selectedKeys = keys;
|
|
2801
|
-
},
|
|
2802
|
-
enumerable: true,
|
|
2803
|
-
configurable: true
|
|
2804
|
-
});
|
|
2805
2842
|
Object.defineProperty(SelectDirective.prototype, "getAriaMultiselectable", {
|
|
2806
2843
|
get: function () {
|
|
2807
2844
|
return this.options.mode === 'multiple';
|
|
@@ -2824,6 +2861,11 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2824
2861
|
enumerable: true,
|
|
2825
2862
|
configurable: true
|
|
2826
2863
|
});
|
|
2864
|
+
SelectDirective.prototype.ngOnChanges = function (changes) {
|
|
2865
|
+
if (isChanged('selectedKeys', changes, false) && changes.selectedKeys.currentValue !== this.lastChange) {
|
|
2866
|
+
this.state = new Set(changes.selectedKeys.currentValue);
|
|
2867
|
+
}
|
|
2868
|
+
};
|
|
2827
2869
|
SelectDirective.prototype.ngOnDestroy = function () {
|
|
2828
2870
|
this.subscriptions.unsubscribe();
|
|
2829
2871
|
};
|
|
@@ -2848,29 +2890,29 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2848
2890
|
};
|
|
2849
2891
|
SelectDirective.prototype.selectSingle = function (node) {
|
|
2850
2892
|
var key = this.itemKey(node);
|
|
2851
|
-
if (this.
|
|
2852
|
-
|
|
2893
|
+
if (!this.state.has(key)) {
|
|
2894
|
+
this.state.clear();
|
|
2895
|
+
this.state.add(key);
|
|
2896
|
+
this.notify();
|
|
2853
2897
|
}
|
|
2854
|
-
this.selectedKeys = [key];
|
|
2855
|
-
this.notify();
|
|
2856
2898
|
};
|
|
2857
2899
|
SelectDirective.prototype.selectMultiple = function (node) {
|
|
2858
2900
|
var key = this.itemKey(node);
|
|
2859
|
-
var
|
|
2860
|
-
var isSelected = idx > -1;
|
|
2901
|
+
var isSelected = this.state.has(key);
|
|
2861
2902
|
if (!isPresent(key)) {
|
|
2862
2903
|
return;
|
|
2863
2904
|
}
|
|
2864
2905
|
if (isSelected) {
|
|
2865
|
-
this.
|
|
2906
|
+
this.state.delete(key);
|
|
2866
2907
|
}
|
|
2867
2908
|
else {
|
|
2868
|
-
this.
|
|
2909
|
+
this.state.add(key);
|
|
2869
2910
|
}
|
|
2870
2911
|
this.notify();
|
|
2871
2912
|
};
|
|
2872
2913
|
SelectDirective.prototype.notify = function () {
|
|
2873
|
-
this.
|
|
2914
|
+
this.lastChange = Array.from(this.state);
|
|
2915
|
+
this.selectedKeysChange.emit(this.lastChange);
|
|
2874
2916
|
};
|
|
2875
2917
|
__decorate([
|
|
2876
2918
|
Input(),
|
|
@@ -2887,9 +2929,8 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2887
2929
|
], SelectDirective.prototype, "selection", void 0);
|
|
2888
2930
|
__decorate([
|
|
2889
2931
|
Input(),
|
|
2890
|
-
__metadata("design:type", Array)
|
|
2891
|
-
|
|
2892
|
-
], SelectDirective.prototype, "selectedKeys", null);
|
|
2932
|
+
__metadata("design:type", Array)
|
|
2933
|
+
], SelectDirective.prototype, "selectedKeys", void 0);
|
|
2893
2934
|
__decorate([
|
|
2894
2935
|
Output(),
|
|
2895
2936
|
__metadata("design:type", EventEmitter)
|
|
@@ -3111,12 +3152,12 @@ var getDropPosition = function (draggedItem, target, clientY, targetTreeView, co
|
|
|
3111
3152
|
if (!(isPresent(draggedItem) && isPresent(target) && isPresent(targetTreeView) && isPresent(containerOffset))) {
|
|
3112
3153
|
return;
|
|
3113
3154
|
}
|
|
3114
|
-
// the .k-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
|
|
3115
|
-
var item = closestWithMatch(target, '.k-mid');
|
|
3155
|
+
// the .k-treeview-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
|
|
3156
|
+
var item = closestWithMatch(target, '.k-treeview-mid');
|
|
3116
3157
|
if (!isPresent(item)) {
|
|
3117
3158
|
return;
|
|
3118
3159
|
}
|
|
3119
|
-
// the content element (.k-
|
|
3160
|
+
// the content element (.k-treeview-leaf:not(.k-treeview-load-more-button)) holds just the treeview item text
|
|
3120
3161
|
var content = getContentElement(item);
|
|
3121
3162
|
var targetChildOfDraggedItem = hasParent(item, closestNode(draggedItem));
|
|
3122
3163
|
if (!isPresent(content) || (content === draggedItem) || targetChildOfDraggedItem) {
|
|
@@ -3833,7 +3874,7 @@ var DragAndDropDirective = /** @class */ (function () {
|
|
|
3833
3874
|
return;
|
|
3834
3875
|
}
|
|
3835
3876
|
// store the drag target on press, show it only when it's actually dragged
|
|
3836
|
-
this.draggedItem = closestWithMatch(originalEvent.target, '.k-
|
|
3877
|
+
this.draggedItem = closestWithMatch(originalEvent.target, '.k-treeview-leaf');
|
|
3837
3878
|
// record the current pointer down coords - copared to the `startDragAfter` value to calculate whether to initiate dragging
|
|
3838
3879
|
this.pendingDragStartEvent = originalEvent;
|
|
3839
3880
|
};
|
|
@@ -3855,7 +3896,7 @@ var DragAndDropDirective = /** @class */ (function () {
|
|
|
3855
3896
|
}
|
|
3856
3897
|
var targetTreeView = this.getTargetTreeView(dropTarget);
|
|
3857
3898
|
var dropPosition = getDropPosition(this.draggedItem, dropTarget, clientY, targetTreeView, this.containerOffset);
|
|
3858
|
-
var dropHintAnchor = closestWithMatch(dropTarget, '.k-mid');
|
|
3899
|
+
var dropHintAnchor = closestWithMatch(dropTarget, '.k-treeview-mid');
|
|
3859
3900
|
var dropAction = getDropAction(dropPosition, dropTarget);
|
|
3860
3901
|
var sourceItem = treeItemFromEventTarget(this.treeview, this.draggedItem);
|
|
3861
3902
|
var destinationItem = treeItemFromEventTarget(targetTreeView, dropTarget);
|
|
@@ -4835,7 +4876,7 @@ var TreeViewItemDirective = /** @class */ (function () {
|
|
|
4835
4876
|
this.setAttribute('aria-checked', this.checkable ? this.ariaChecked : null);
|
|
4836
4877
|
};
|
|
4837
4878
|
TreeViewItemDirective.prototype.setDisabledClass = function () {
|
|
4838
|
-
this.setClass('k-
|
|
4879
|
+
this.setClass('k-disabled', this.isDisabled);
|
|
4839
4880
|
};
|
|
4840
4881
|
TreeViewItemDirective.prototype.setClass = function (className, toggle) {
|
|
4841
4882
|
var action = toggle ? 'addClass' : 'removeClass';
|
|
@@ -4962,10 +5003,10 @@ var TreeViewItemContentDirective = /** @class */ (function () {
|
|
|
4962
5003
|
this.subscriptions.unsubscribe();
|
|
4963
5004
|
};
|
|
4964
5005
|
TreeViewItemContentDirective.prototype.updateFocusClass = function () {
|
|
4965
|
-
this.render(this.navigationService.isActive(this.index), 'k-
|
|
5006
|
+
this.render(this.navigationService.isActive(this.index), 'k-focus');
|
|
4966
5007
|
};
|
|
4967
5008
|
TreeViewItemContentDirective.prototype.updateSelectionClass = function (selected) {
|
|
4968
|
-
this.render(selected, 'k-
|
|
5009
|
+
this.render(selected, 'k-selected');
|
|
4969
5010
|
};
|
|
4970
5011
|
TreeViewItemContentDirective.prototype.render = function (addClass, className) {
|
|
4971
5012
|
var action = addClass ? 'addClass' : 'removeClass';
|
|
@@ -5016,6 +5057,10 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5016
5057
|
* Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
5017
5058
|
*/
|
|
5018
5059
|
this.tabindex = 0;
|
|
5060
|
+
/**
|
|
5061
|
+
* Specifies the size of the component.
|
|
5062
|
+
*/
|
|
5063
|
+
this.size = 'medium';
|
|
5019
5064
|
/**
|
|
5020
5065
|
* Fires when the user changes the check state of the component.
|
|
5021
5066
|
*/
|
|
@@ -5043,6 +5088,13 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5043
5088
|
enumerable: true,
|
|
5044
5089
|
configurable: true
|
|
5045
5090
|
});
|
|
5091
|
+
Object.defineProperty(CheckBoxComponent.prototype, "checkBoxClasses", {
|
|
5092
|
+
get: function () {
|
|
5093
|
+
return "k-checkbox " + (this.size ? getSizeClass('checkbox', this.size) : '') + " k-rounded-md";
|
|
5094
|
+
},
|
|
5095
|
+
enumerable: true,
|
|
5096
|
+
configurable: true
|
|
5097
|
+
});
|
|
5046
5098
|
CheckBoxComponent.prototype.ngOnInit = function () {
|
|
5047
5099
|
this.renderer.removeAttribute(this.element.nativeElement, "tabindex");
|
|
5048
5100
|
};
|
|
@@ -5085,6 +5137,10 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5085
5137
|
Input(),
|
|
5086
5138
|
__metadata("design:type", Number)
|
|
5087
5139
|
], CheckBoxComponent.prototype, "tabindex", void 0);
|
|
5140
|
+
__decorate([
|
|
5141
|
+
Input(),
|
|
5142
|
+
__metadata("design:type", String)
|
|
5143
|
+
], CheckBoxComponent.prototype, "size", void 0);
|
|
5088
5144
|
__decorate([
|
|
5089
5145
|
Output(),
|
|
5090
5146
|
__metadata("design:type", EventEmitter)
|
|
@@ -5092,7 +5148,7 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5092
5148
|
CheckBoxComponent = __decorate([
|
|
5093
5149
|
Component({
|
|
5094
5150
|
selector: 'kendo-checkbox',
|
|
5095
|
-
template: "\n <input\n
|
|
5151
|
+
template: "\n <input\n type=\"checkbox\"\n [class]=\"checkBoxClasses\"\n [id]=\"id\"\n [checked]=\"checked\"\n [indeterminate]=\"indeterminate\"\n [tabindex]=\"tabindex\"\n (change)=\"handleChange($event)\"\n />\n <label\n class=\"k-checkbox-label\"\n tabindex=\"-1\"\n [for]=\"id\"\n >{{labelText}}</label>\n "
|
|
5096
5152
|
}),
|
|
5097
5153
|
__metadata("design:paramtypes", [ElementRef,
|
|
5098
5154
|
Renderer2,
|