@progress/kendo-angular-treeview 6.0.0-dev.202112021059 → 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/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/package-metadata.js +1 -1
- 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 +36 -4
- package/dist/es/utils.js +17 -5
- 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/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/size.d.ts +14 -0
- package/dist/es2015/size.js +4 -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 +13 -0
- package/dist/es2015/treeview.component.js +46 -13
- package/dist/es2015/utils.d.ts +7 -1
- package/dist/es2015/utils.js +17 -5
- package/dist/fesm2015/index.js +132 -62
- package/dist/fesm5/index.js +84 -20
- 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/package-metadata.js +1 -1
- 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 +35 -3
- package/dist/npm/utils.js +17 -5
- 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
|
|
@@ -417,6 +417,18 @@ var sameValues = function (as, bs) {
|
|
|
417
417
|
}
|
|
418
418
|
return Array.from(as).every(function (v) { return bs.has(v); });
|
|
419
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];
|
|
431
|
+
};
|
|
420
432
|
|
|
421
433
|
var safe = function (node) { return (node || {}); };
|
|
422
434
|
var safeChildren = function (node) { return (safe(node).children || []); };
|
|
@@ -1257,6 +1269,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1257
1269
|
this.isActive = false;
|
|
1258
1270
|
this.data = new BehaviorSubject([]);
|
|
1259
1271
|
this._animate = true;
|
|
1272
|
+
this._size = 'medium';
|
|
1260
1273
|
this.subscriptions = new Subscription();
|
|
1261
1274
|
this.domSubscriptions = [];
|
|
1262
1275
|
validatePackage(packageMetadata);
|
|
@@ -1388,6 +1401,30 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1388
1401
|
enumerable: true,
|
|
1389
1402
|
configurable: true
|
|
1390
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
|
+
});
|
|
1391
1428
|
TreeViewComponent.prototype.ngOnChanges = function (changes) {
|
|
1392
1429
|
this.navigationService.navigable = Boolean(this.navigable);
|
|
1393
1430
|
// TODO: should react to changes.loadOnDemand as well - should preload the data or clear the already cached items
|
|
@@ -1428,6 +1465,9 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1428
1465
|
_this.attachDomHandlers();
|
|
1429
1466
|
});
|
|
1430
1467
|
}
|
|
1468
|
+
if (this.size) {
|
|
1469
|
+
this.renderer.addClass(this.element.nativeElement, getSizeClass('treeview', this.size));
|
|
1470
|
+
}
|
|
1431
1471
|
};
|
|
1432
1472
|
/**
|
|
1433
1473
|
* Blurs the focused TreeView item.
|
|
@@ -1587,7 +1627,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1587
1627
|
return;
|
|
1588
1628
|
}
|
|
1589
1629
|
var index = nodeId(closestNode(target));
|
|
1590
|
-
// 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
|
|
1591
1631
|
if (!index || this.navigationService.isDisabled(index)) {
|
|
1592
1632
|
return;
|
|
1593
1633
|
}
|
|
@@ -1649,7 +1689,6 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1649
1689
|
});
|
|
1650
1690
|
};
|
|
1651
1691
|
__decorate([
|
|
1652
|
-
HostBinding("class.k-widget"),
|
|
1653
1692
|
HostBinding("class.k-treeview"),
|
|
1654
1693
|
__metadata("design:type", Boolean)
|
|
1655
1694
|
], TreeViewComponent.prototype, "classNames", void 0);
|
|
@@ -1823,13 +1862,18 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1823
1862
|
Input(),
|
|
1824
1863
|
__metadata("design:type", String)
|
|
1825
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);
|
|
1826
1870
|
TreeViewComponent = __decorate([
|
|
1827
1871
|
Component({
|
|
1828
1872
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
1829
1873
|
exportAs: 'kendoTreeView',
|
|
1830
1874
|
providers: providers,
|
|
1831
1875
|
selector: 'kendo-treeview',
|
|
1832
|
-
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 "
|
|
1833
1877
|
}),
|
|
1834
1878
|
__metadata("design:paramtypes", [ElementRef,
|
|
1835
1879
|
ChangeDetectorRef,
|
|
@@ -1863,6 +1907,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
1863
1907
|
this.role = 'group';
|
|
1864
1908
|
this.loadOnDemand = true;
|
|
1865
1909
|
this.textField = "";
|
|
1910
|
+
this.size = 'medium';
|
|
1866
1911
|
this.initialNodesLoaded = false;
|
|
1867
1912
|
this.loadingMoreNodes = false;
|
|
1868
1913
|
this._data = [];
|
|
@@ -2096,7 +2141,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2096
2141
|
this.emitChildrenLoaded(mappedChildren);
|
|
2097
2142
|
};
|
|
2098
2143
|
__decorate([
|
|
2099
|
-
HostBinding("class.k-group"),
|
|
2144
|
+
HostBinding("class.k-treeview-group"),
|
|
2100
2145
|
__metadata("design:type", Boolean)
|
|
2101
2146
|
], TreeViewGroupComponent.prototype, "kGroupClass", void 0);
|
|
2102
2147
|
__decorate([
|
|
@@ -2159,6 +2204,10 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2159
2204
|
Input(),
|
|
2160
2205
|
__metadata("design:type", Object)
|
|
2161
2206
|
], TreeViewGroupComponent.prototype, "loadMoreService", void 0);
|
|
2207
|
+
__decorate([
|
|
2208
|
+
Input(),
|
|
2209
|
+
__metadata("design:type", String)
|
|
2210
|
+
], TreeViewGroupComponent.prototype, "size", void 0);
|
|
2162
2211
|
__decorate([
|
|
2163
2212
|
Input(),
|
|
2164
2213
|
__metadata("design:type", Function)
|
|
@@ -2202,7 +2251,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2202
2251
|
])
|
|
2203
2252
|
],
|
|
2204
2253
|
selector: '[kendoTreeViewGroup]',
|
|
2205
|
-
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 "
|
|
2206
2255
|
}),
|
|
2207
2256
|
__metadata("design:paramtypes", [ExpandStateService,
|
|
2208
2257
|
LoadingNotificationService,
|
|
@@ -3103,12 +3152,12 @@ var getDropPosition = function (draggedItem, target, clientY, targetTreeView, co
|
|
|
3103
3152
|
if (!(isPresent(draggedItem) && isPresent(target) && isPresent(targetTreeView) && isPresent(containerOffset))) {
|
|
3104
3153
|
return;
|
|
3105
3154
|
}
|
|
3106
|
-
// the .k-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
|
|
3107
|
-
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');
|
|
3108
3157
|
if (!isPresent(item)) {
|
|
3109
3158
|
return;
|
|
3110
3159
|
}
|
|
3111
|
-
// the content element (.k-
|
|
3160
|
+
// the content element (.k-treeview-leaf:not(.k-treeview-load-more-button)) holds just the treeview item text
|
|
3112
3161
|
var content = getContentElement(item);
|
|
3113
3162
|
var targetChildOfDraggedItem = hasParent(item, closestNode(draggedItem));
|
|
3114
3163
|
if (!isPresent(content) || (content === draggedItem) || targetChildOfDraggedItem) {
|
|
@@ -3825,7 +3874,7 @@ var DragAndDropDirective = /** @class */ (function () {
|
|
|
3825
3874
|
return;
|
|
3826
3875
|
}
|
|
3827
3876
|
// store the drag target on press, show it only when it's actually dragged
|
|
3828
|
-
this.draggedItem = closestWithMatch(originalEvent.target, '.k-
|
|
3877
|
+
this.draggedItem = closestWithMatch(originalEvent.target, '.k-treeview-leaf');
|
|
3829
3878
|
// record the current pointer down coords - copared to the `startDragAfter` value to calculate whether to initiate dragging
|
|
3830
3879
|
this.pendingDragStartEvent = originalEvent;
|
|
3831
3880
|
};
|
|
@@ -3847,7 +3896,7 @@ var DragAndDropDirective = /** @class */ (function () {
|
|
|
3847
3896
|
}
|
|
3848
3897
|
var targetTreeView = this.getTargetTreeView(dropTarget);
|
|
3849
3898
|
var dropPosition = getDropPosition(this.draggedItem, dropTarget, clientY, targetTreeView, this.containerOffset);
|
|
3850
|
-
var dropHintAnchor = closestWithMatch(dropTarget, '.k-mid');
|
|
3899
|
+
var dropHintAnchor = closestWithMatch(dropTarget, '.k-treeview-mid');
|
|
3851
3900
|
var dropAction = getDropAction(dropPosition, dropTarget);
|
|
3852
3901
|
var sourceItem = treeItemFromEventTarget(this.treeview, this.draggedItem);
|
|
3853
3902
|
var destinationItem = treeItemFromEventTarget(targetTreeView, dropTarget);
|
|
@@ -4827,7 +4876,7 @@ var TreeViewItemDirective = /** @class */ (function () {
|
|
|
4827
4876
|
this.setAttribute('aria-checked', this.checkable ? this.ariaChecked : null);
|
|
4828
4877
|
};
|
|
4829
4878
|
TreeViewItemDirective.prototype.setDisabledClass = function () {
|
|
4830
|
-
this.setClass('k-
|
|
4879
|
+
this.setClass('k-disabled', this.isDisabled);
|
|
4831
4880
|
};
|
|
4832
4881
|
TreeViewItemDirective.prototype.setClass = function (className, toggle) {
|
|
4833
4882
|
var action = toggle ? 'addClass' : 'removeClass';
|
|
@@ -4954,10 +5003,10 @@ var TreeViewItemContentDirective = /** @class */ (function () {
|
|
|
4954
5003
|
this.subscriptions.unsubscribe();
|
|
4955
5004
|
};
|
|
4956
5005
|
TreeViewItemContentDirective.prototype.updateFocusClass = function () {
|
|
4957
|
-
this.render(this.navigationService.isActive(this.index), 'k-
|
|
5006
|
+
this.render(this.navigationService.isActive(this.index), 'k-focus');
|
|
4958
5007
|
};
|
|
4959
5008
|
TreeViewItemContentDirective.prototype.updateSelectionClass = function (selected) {
|
|
4960
|
-
this.render(selected, 'k-
|
|
5009
|
+
this.render(selected, 'k-selected');
|
|
4961
5010
|
};
|
|
4962
5011
|
TreeViewItemContentDirective.prototype.render = function (addClass, className) {
|
|
4963
5012
|
var action = addClass ? 'addClass' : 'removeClass';
|
|
@@ -5008,6 +5057,10 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5008
5057
|
* Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
5009
5058
|
*/
|
|
5010
5059
|
this.tabindex = 0;
|
|
5060
|
+
/**
|
|
5061
|
+
* Specifies the size of the component.
|
|
5062
|
+
*/
|
|
5063
|
+
this.size = 'medium';
|
|
5011
5064
|
/**
|
|
5012
5065
|
* Fires when the user changes the check state of the component.
|
|
5013
5066
|
*/
|
|
@@ -5035,6 +5088,13 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5035
5088
|
enumerable: true,
|
|
5036
5089
|
configurable: true
|
|
5037
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
|
+
});
|
|
5038
5098
|
CheckBoxComponent.prototype.ngOnInit = function () {
|
|
5039
5099
|
this.renderer.removeAttribute(this.element.nativeElement, "tabindex");
|
|
5040
5100
|
};
|
|
@@ -5077,6 +5137,10 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5077
5137
|
Input(),
|
|
5078
5138
|
__metadata("design:type", Number)
|
|
5079
5139
|
], CheckBoxComponent.prototype, "tabindex", void 0);
|
|
5140
|
+
__decorate([
|
|
5141
|
+
Input(),
|
|
5142
|
+
__metadata("design:type", String)
|
|
5143
|
+
], CheckBoxComponent.prototype, "size", void 0);
|
|
5080
5144
|
__decorate([
|
|
5081
5145
|
Output(),
|
|
5082
5146
|
__metadata("design:type", EventEmitter)
|
|
@@ -5084,7 +5148,7 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5084
5148
|
CheckBoxComponent = __decorate([
|
|
5085
5149
|
Component({
|
|
5086
5150
|
selector: 'kendo-checkbox',
|
|
5087
|
-
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 "
|
|
5088
5152
|
}),
|
|
5089
5153
|
__metadata("design:paramtypes", [ElementRef,
|
|
5090
5154
|
Renderer2,
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
var tslib_1 = require("tslib");
|
|
8
8
|
var core_1 = require("@angular/core");
|
|
9
9
|
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
10
|
+
var utils_1 = require("../utils");
|
|
10
11
|
/**
|
|
11
12
|
* @hidden
|
|
12
13
|
*
|
|
@@ -26,6 +27,10 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
26
27
|
* Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
27
28
|
*/
|
|
28
29
|
this.tabindex = 0;
|
|
30
|
+
/**
|
|
31
|
+
* Specifies the size of the component.
|
|
32
|
+
*/
|
|
33
|
+
this.size = 'medium';
|
|
29
34
|
/**
|
|
30
35
|
* Fires when the user changes the check state of the component.
|
|
31
36
|
*/
|
|
@@ -53,6 +58,13 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
53
58
|
enumerable: true,
|
|
54
59
|
configurable: true
|
|
55
60
|
});
|
|
61
|
+
Object.defineProperty(CheckBoxComponent.prototype, "checkBoxClasses", {
|
|
62
|
+
get: function () {
|
|
63
|
+
return "k-checkbox " + (this.size ? utils_1.getSizeClass('checkbox', this.size) : '') + " k-rounded-md";
|
|
64
|
+
},
|
|
65
|
+
enumerable: true,
|
|
66
|
+
configurable: true
|
|
67
|
+
});
|
|
56
68
|
CheckBoxComponent.prototype.ngOnInit = function () {
|
|
57
69
|
this.renderer.removeAttribute(this.element.nativeElement, "tabindex");
|
|
58
70
|
};
|
|
@@ -95,6 +107,10 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
95
107
|
core_1.Input(),
|
|
96
108
|
tslib_1.__metadata("design:type", Number)
|
|
97
109
|
], CheckBoxComponent.prototype, "tabindex", void 0);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
core_1.Input(),
|
|
112
|
+
tslib_1.__metadata("design:type", String)
|
|
113
|
+
], CheckBoxComponent.prototype, "size", void 0);
|
|
98
114
|
tslib_1.__decorate([
|
|
99
115
|
core_1.Output(),
|
|
100
116
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -102,7 +118,7 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
102
118
|
CheckBoxComponent = tslib_1.__decorate([
|
|
103
119
|
core_1.Component({
|
|
104
120
|
selector: 'kendo-checkbox',
|
|
105
|
-
template: "\n <input\n
|
|
121
|
+
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 "
|
|
106
122
|
}),
|
|
107
123
|
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
|
|
108
124
|
core_1.Renderer2,
|
|
@@ -99,12 +99,12 @@ exports.getDropPosition = function (draggedItem, target, clientY, targetTreeView
|
|
|
99
99
|
if (!(utils_1.isPresent(draggedItem) && utils_1.isPresent(target) && utils_1.isPresent(targetTreeView) && utils_1.isPresent(containerOffset))) {
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
// the .k-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
|
|
103
|
-
var item = utils_1.closestWithMatch(target, '.k-mid');
|
|
102
|
+
// the .k-treeview-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
|
|
103
|
+
var item = utils_1.closestWithMatch(target, '.k-treeview-mid');
|
|
104
104
|
if (!utils_1.isPresent(item)) {
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
// the content element (.k-
|
|
107
|
+
// the content element (.k-treeview-leaf:not(.k-treeview-load-more-button)) holds just the treeview item text
|
|
108
108
|
var content = utils_1.getContentElement(item);
|
|
109
109
|
var targetChildOfDraggedItem = utils_1.hasParent(item, utils_1.closestNode(draggedItem));
|
|
110
110
|
if (!utils_1.isPresent(content) || (content === draggedItem) || targetChildOfDraggedItem) {
|
|
@@ -109,7 +109,7 @@ var DragAndDropDirective = /** @class */ (function () {
|
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
// store the drag target on press, show it only when it's actually dragged
|
|
112
|
-
this.draggedItem = utils_1.closestWithMatch(originalEvent.target, '.k-
|
|
112
|
+
this.draggedItem = utils_1.closestWithMatch(originalEvent.target, '.k-treeview-leaf');
|
|
113
113
|
// record the current pointer down coords - copared to the `startDragAfter` value to calculate whether to initiate dragging
|
|
114
114
|
this.pendingDragStartEvent = originalEvent;
|
|
115
115
|
};
|
|
@@ -131,7 +131,7 @@ var DragAndDropDirective = /** @class */ (function () {
|
|
|
131
131
|
}
|
|
132
132
|
var targetTreeView = this.getTargetTreeView(dropTarget);
|
|
133
133
|
var dropPosition = drag_and_drop_utils_1.getDropPosition(this.draggedItem, dropTarget, clientY, targetTreeView, this.containerOffset);
|
|
134
|
-
var dropHintAnchor = utils_1.closestWithMatch(dropTarget, '.k-mid');
|
|
134
|
+
var dropHintAnchor = utils_1.closestWithMatch(dropTarget, '.k-treeview-mid');
|
|
135
135
|
var dropAction = drag_and_drop_utils_1.getDropAction(dropPosition, dropTarget);
|
|
136
136
|
var sourceItem = drag_and_drop_utils_1.treeItemFromEventTarget(this.treeview, this.draggedItem);
|
|
137
137
|
var destinationItem = drag_and_drop_utils_1.treeItemFromEventTarget(targetTreeView, dropTarget);
|
|
@@ -11,7 +11,7 @@ exports.packageMetadata = {
|
|
|
11
11
|
name: '@progress/kendo-angular-treeview',
|
|
12
12
|
productName: 'Kendo UI for Angular',
|
|
13
13
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
14
|
-
publishDate:
|
|
14
|
+
publishDate: 1641897008,
|
|
15
15
|
version: '',
|
|
16
16
|
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'
|
|
17
17
|
};
|
package/dist/npm/size.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -35,6 +35,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
35
35
|
this.role = 'group';
|
|
36
36
|
this.loadOnDemand = true;
|
|
37
37
|
this.textField = "";
|
|
38
|
+
this.size = 'medium';
|
|
38
39
|
this.initialNodesLoaded = false;
|
|
39
40
|
this.loadingMoreNodes = false;
|
|
40
41
|
this._data = [];
|
|
@@ -268,7 +269,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
268
269
|
this.emitChildrenLoaded(mappedChildren);
|
|
269
270
|
};
|
|
270
271
|
tslib_1.__decorate([
|
|
271
|
-
core_1.HostBinding("class.k-group"),
|
|
272
|
+
core_1.HostBinding("class.k-treeview-group"),
|
|
272
273
|
tslib_1.__metadata("design:type", Boolean)
|
|
273
274
|
], TreeViewGroupComponent.prototype, "kGroupClass", void 0);
|
|
274
275
|
tslib_1.__decorate([
|
|
@@ -331,6 +332,10 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
331
332
|
core_1.Input(),
|
|
332
333
|
tslib_1.__metadata("design:type", Object)
|
|
333
334
|
], TreeViewGroupComponent.prototype, "loadMoreService", void 0);
|
|
335
|
+
tslib_1.__decorate([
|
|
336
|
+
core_1.Input(),
|
|
337
|
+
tslib_1.__metadata("design:type", String)
|
|
338
|
+
], TreeViewGroupComponent.prototype, "size", void 0);
|
|
334
339
|
tslib_1.__decorate([
|
|
335
340
|
core_1.Input(),
|
|
336
341
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -374,7 +379,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
374
379
|
])
|
|
375
380
|
],
|
|
376
381
|
selector: '[kendoTreeViewGroup]',
|
|
377
|
-
template: "\n <li\n *ngFor=\"let node of data; let index = index; trackBy: trackBy\"\n class=\"k-
|
|
382
|
+
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 "
|
|
378
383
|
}),
|
|
379
384
|
tslib_1.__metadata("design:paramtypes", [expand_state_service_1.ExpandStateService,
|
|
380
385
|
loading_notification_service_1.LoadingNotificationService,
|
|
@@ -50,10 +50,10 @@ var TreeViewItemContentDirective = /** @class */ (function () {
|
|
|
50
50
|
this.subscriptions.unsubscribe();
|
|
51
51
|
};
|
|
52
52
|
TreeViewItemContentDirective.prototype.updateFocusClass = function () {
|
|
53
|
-
this.render(this.navigationService.isActive(this.index), 'k-
|
|
53
|
+
this.render(this.navigationService.isActive(this.index), 'k-focus');
|
|
54
54
|
};
|
|
55
55
|
TreeViewItemContentDirective.prototype.updateSelectionClass = function (selected) {
|
|
56
|
-
this.render(selected, 'k-
|
|
56
|
+
this.render(selected, 'k-selected');
|
|
57
57
|
};
|
|
58
58
|
TreeViewItemContentDirective.prototype.render = function (addClass, className) {
|
|
59
59
|
var action = addClass ? 'addClass' : 'removeClass';
|
|
@@ -217,7 +217,7 @@ var TreeViewItemDirective = /** @class */ (function () {
|
|
|
217
217
|
this.setAttribute('aria-checked', this.checkable ? this.ariaChecked : null);
|
|
218
218
|
};
|
|
219
219
|
TreeViewItemDirective.prototype.setDisabledClass = function () {
|
|
220
|
-
this.setClass('k-
|
|
220
|
+
this.setClass('k-disabled', this.isDisabled);
|
|
221
221
|
};
|
|
222
222
|
TreeViewItemDirective.prototype.setClass = function (className, toggle) {
|
|
223
223
|
var action = toggle ? 'addClass' : 'removeClass';
|
|
@@ -232,6 +232,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
232
232
|
this.isActive = false;
|
|
233
233
|
this.data = new rxjs_1.BehaviorSubject([]);
|
|
234
234
|
this._animate = true;
|
|
235
|
+
this._size = 'medium';
|
|
235
236
|
this.subscriptions = new rxjs_1.Subscription();
|
|
236
237
|
this.domSubscriptions = [];
|
|
237
238
|
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
@@ -363,6 +364,30 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
363
364
|
enumerable: true,
|
|
364
365
|
configurable: true
|
|
365
366
|
});
|
|
367
|
+
Object.defineProperty(TreeViewComponent.prototype, "size", {
|
|
368
|
+
get: function () {
|
|
369
|
+
return this._size;
|
|
370
|
+
},
|
|
371
|
+
/**
|
|
372
|
+
* Sets the size of the component.
|
|
373
|
+
*
|
|
374
|
+
* The possible values are:
|
|
375
|
+
* * `'small'`
|
|
376
|
+
* * `'medium'` (default)
|
|
377
|
+
* * `'large'`
|
|
378
|
+
* * `null`
|
|
379
|
+
*
|
|
380
|
+
*/
|
|
381
|
+
set: function (size) {
|
|
382
|
+
this.renderer.removeClass(this.element.nativeElement, utils_1.getSizeClass('treeview', this.size));
|
|
383
|
+
if (size) {
|
|
384
|
+
this.renderer.addClass(this.element.nativeElement, utils_1.getSizeClass('treeview', size));
|
|
385
|
+
}
|
|
386
|
+
this._size = size;
|
|
387
|
+
},
|
|
388
|
+
enumerable: true,
|
|
389
|
+
configurable: true
|
|
390
|
+
});
|
|
366
391
|
TreeViewComponent.prototype.ngOnChanges = function (changes) {
|
|
367
392
|
this.navigationService.navigable = Boolean(this.navigable);
|
|
368
393
|
// TODO: should react to changes.loadOnDemand as well - should preload the data or clear the already cached items
|
|
@@ -403,6 +428,9 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
403
428
|
_this.attachDomHandlers();
|
|
404
429
|
});
|
|
405
430
|
}
|
|
431
|
+
if (this.size) {
|
|
432
|
+
this.renderer.addClass(this.element.nativeElement, utils_1.getSizeClass('treeview', this.size));
|
|
433
|
+
}
|
|
406
434
|
};
|
|
407
435
|
/**
|
|
408
436
|
* Blurs the focused TreeView item.
|
|
@@ -562,7 +590,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
562
590
|
return;
|
|
563
591
|
}
|
|
564
592
|
var index = utils_1.nodeId(utils_1.closestNode(target));
|
|
565
|
-
// the disabled check is probably not needed due to the k-
|
|
593
|
+
// the disabled check is probably not needed due to the k-disabled styles
|
|
566
594
|
if (!index || this.navigationService.isDisabled(index)) {
|
|
567
595
|
return;
|
|
568
596
|
}
|
|
@@ -624,7 +652,6 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
624
652
|
});
|
|
625
653
|
};
|
|
626
654
|
tslib_1.__decorate([
|
|
627
|
-
core_1.HostBinding("class.k-widget"),
|
|
628
655
|
core_1.HostBinding("class.k-treeview"),
|
|
629
656
|
tslib_1.__metadata("design:type", Boolean)
|
|
630
657
|
], TreeViewComponent.prototype, "classNames", void 0);
|
|
@@ -798,13 +825,18 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
798
825
|
core_1.Input(),
|
|
799
826
|
tslib_1.__metadata("design:type", String)
|
|
800
827
|
], TreeViewComponent.prototype, "filter", void 0);
|
|
828
|
+
tslib_1.__decorate([
|
|
829
|
+
core_1.Input(),
|
|
830
|
+
tslib_1.__metadata("design:type", String),
|
|
831
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
832
|
+
], TreeViewComponent.prototype, "size", null);
|
|
801
833
|
TreeViewComponent = tslib_1.__decorate([
|
|
802
834
|
core_1.Component({
|
|
803
835
|
changeDetection: core_1.ChangeDetectionStrategy.Default,
|
|
804
836
|
exportAs: 'kendoTreeView',
|
|
805
837
|
providers: providers,
|
|
806
838
|
selector: 'kendo-treeview',
|
|
807
|
-
template: "\n <
|
|
839
|
+
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 "
|
|
808
840
|
}),
|
|
809
841
|
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
|
|
810
842
|
core_1.ChangeDetectorRef,
|