@progress/kendo-angular-treeview 5.4.3-dev.202111250955 → 6.0.0-dev.202201190736
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- 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 +36 -4
- 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/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 +13 -0
- package/dist/es2015/treeview.component.js +46 -13
- package/dist/es2015/utils.d.ts +9 -4
- package/dist/es2015/utils.js +21 -11
- package/dist/fesm2015/index.js +224 -163
- package/dist/fesm5/index.js +177 -134
- 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 +35 -3
- 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: 1642577609,
|
|
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 || {}); };
|
|
@@ -1259,6 +1269,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1259
1269
|
this.isActive = false;
|
|
1260
1270
|
this.data = new BehaviorSubject([]);
|
|
1261
1271
|
this._animate = true;
|
|
1272
|
+
this._size = 'medium';
|
|
1262
1273
|
this.subscriptions = new Subscription();
|
|
1263
1274
|
this.domSubscriptions = [];
|
|
1264
1275
|
validatePackage(packageMetadata);
|
|
@@ -1390,6 +1401,30 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1390
1401
|
enumerable: true,
|
|
1391
1402
|
configurable: true
|
|
1392
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
|
+
});
|
|
1393
1428
|
TreeViewComponent.prototype.ngOnChanges = function (changes) {
|
|
1394
1429
|
this.navigationService.navigable = Boolean(this.navigable);
|
|
1395
1430
|
// TODO: should react to changes.loadOnDemand as well - should preload the data or clear the already cached items
|
|
@@ -1430,6 +1465,9 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1430
1465
|
_this.attachDomHandlers();
|
|
1431
1466
|
});
|
|
1432
1467
|
}
|
|
1468
|
+
if (this.size) {
|
|
1469
|
+
this.renderer.addClass(this.element.nativeElement, getSizeClass('treeview', this.size));
|
|
1470
|
+
}
|
|
1433
1471
|
};
|
|
1434
1472
|
/**
|
|
1435
1473
|
* Blurs the focused TreeView item.
|
|
@@ -1589,7 +1627,7 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1589
1627
|
return;
|
|
1590
1628
|
}
|
|
1591
1629
|
var index = nodeId(closestNode(target));
|
|
1592
|
-
// 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
|
|
1593
1631
|
if (!index || this.navigationService.isDisabled(index)) {
|
|
1594
1632
|
return;
|
|
1595
1633
|
}
|
|
@@ -1651,7 +1689,6 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1651
1689
|
});
|
|
1652
1690
|
};
|
|
1653
1691
|
__decorate([
|
|
1654
|
-
HostBinding("class.k-widget"),
|
|
1655
1692
|
HostBinding("class.k-treeview"),
|
|
1656
1693
|
__metadata("design:type", Boolean)
|
|
1657
1694
|
], TreeViewComponent.prototype, "classNames", void 0);
|
|
@@ -1825,13 +1862,18 @@ var TreeViewComponent = /** @class */ (function () {
|
|
|
1825
1862
|
Input(),
|
|
1826
1863
|
__metadata("design:type", String)
|
|
1827
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);
|
|
1828
1870
|
TreeViewComponent = __decorate([
|
|
1829
1871
|
Component({
|
|
1830
1872
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
1831
1873
|
exportAs: 'kendoTreeView',
|
|
1832
1874
|
providers: providers,
|
|
1833
1875
|
selector: 'kendo-treeview',
|
|
1834
|
-
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 "
|
|
1835
1877
|
}),
|
|
1836
1878
|
__metadata("design:paramtypes", [ElementRef,
|
|
1837
1879
|
ChangeDetectorRef,
|
|
@@ -1865,6 +1907,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
1865
1907
|
this.role = 'group';
|
|
1866
1908
|
this.loadOnDemand = true;
|
|
1867
1909
|
this.textField = "";
|
|
1910
|
+
this.size = 'medium';
|
|
1868
1911
|
this.initialNodesLoaded = false;
|
|
1869
1912
|
this.loadingMoreNodes = false;
|
|
1870
1913
|
this._data = [];
|
|
@@ -2098,7 +2141,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2098
2141
|
this.emitChildrenLoaded(mappedChildren);
|
|
2099
2142
|
};
|
|
2100
2143
|
__decorate([
|
|
2101
|
-
HostBinding("class.k-group"),
|
|
2144
|
+
HostBinding("class.k-treeview-group"),
|
|
2102
2145
|
__metadata("design:type", Boolean)
|
|
2103
2146
|
], TreeViewGroupComponent.prototype, "kGroupClass", void 0);
|
|
2104
2147
|
__decorate([
|
|
@@ -2161,6 +2204,10 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2161
2204
|
Input(),
|
|
2162
2205
|
__metadata("design:type", Object)
|
|
2163
2206
|
], TreeViewGroupComponent.prototype, "loadMoreService", void 0);
|
|
2207
|
+
__decorate([
|
|
2208
|
+
Input(),
|
|
2209
|
+
__metadata("design:type", String)
|
|
2210
|
+
], TreeViewGroupComponent.prototype, "size", void 0);
|
|
2164
2211
|
__decorate([
|
|
2165
2212
|
Input(),
|
|
2166
2213
|
__metadata("design:type", Function)
|
|
@@ -2204,7 +2251,7 @@ var TreeViewGroupComponent = /** @class */ (function () {
|
|
|
2204
2251
|
])
|
|
2205
2252
|
],
|
|
2206
2253
|
selector: '[kendoTreeViewGroup]',
|
|
2207
|
-
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 "
|
|
2208
2255
|
}),
|
|
2209
2256
|
__metadata("design:paramtypes", [ExpandStateService,
|
|
2210
2257
|
LoadingNotificationService,
|
|
@@ -2254,7 +2301,10 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2254
2301
|
'multiple': function (e) { return _this.checkMultiple(e); },
|
|
2255
2302
|
'single': function (e) { return _this.checkSingle(e); }
|
|
2256
2303
|
};
|
|
2257
|
-
|
|
2304
|
+
/**
|
|
2305
|
+
* Reflectes the internal `checkedKeys` state.
|
|
2306
|
+
*/
|
|
2307
|
+
this.state = new Set();
|
|
2258
2308
|
this.subscriptions.add(this.treeView.checkedChange
|
|
2259
2309
|
.subscribe(function (e) { return _this.check(e); }));
|
|
2260
2310
|
var expandedItems = [];
|
|
@@ -2273,20 +2323,6 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2273
2323
|
enumerable: true,
|
|
2274
2324
|
configurable: true
|
|
2275
2325
|
});
|
|
2276
|
-
Object.defineProperty(CheckDirective.prototype, "checkedKeys", {
|
|
2277
|
-
/**
|
|
2278
|
-
* Defines the collection that will store the checked keys
|
|
2279
|
-
* ([see example]({% slug checkboxes_treeview %})).
|
|
2280
|
-
*/
|
|
2281
|
-
get: function () {
|
|
2282
|
-
return this._checkedKeys;
|
|
2283
|
-
},
|
|
2284
|
-
set: function (keys) {
|
|
2285
|
-
this._checkedKeys = keys;
|
|
2286
|
-
},
|
|
2287
|
-
enumerable: true,
|
|
2288
|
-
configurable: true
|
|
2289
|
-
});
|
|
2290
2326
|
Object.defineProperty(CheckDirective.prototype, "options", {
|
|
2291
2327
|
get: function () {
|
|
2292
2328
|
var defaultOptions = {
|
|
@@ -2311,6 +2347,9 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2311
2347
|
this.treeView.checkboxes = this.options.enabled;
|
|
2312
2348
|
this.toggleCheckOnClick();
|
|
2313
2349
|
}
|
|
2350
|
+
if (isChanged('checkedKeys', changes, false) && changes.checkedKeys.currentValue !== this.lastChange) {
|
|
2351
|
+
this.state = new Set(changes.checkedKeys.currentValue);
|
|
2352
|
+
}
|
|
2314
2353
|
};
|
|
2315
2354
|
CheckDirective.prototype.ngOnDestroy = function () {
|
|
2316
2355
|
this.subscriptions.unsubscribe();
|
|
@@ -2320,11 +2359,11 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2320
2359
|
if (!this.checkKey) {
|
|
2321
2360
|
return this.isIndexChecked(index);
|
|
2322
2361
|
}
|
|
2323
|
-
var
|
|
2324
|
-
return
|
|
2362
|
+
var hasKey = this.state.has(this.itemKey({ dataItem: dataItem, index: index }));
|
|
2363
|
+
return hasKey ? 'checked' : 'none';
|
|
2325
2364
|
};
|
|
2326
2365
|
CheckDirective.prototype.isIndexChecked = function (index) {
|
|
2327
|
-
var checkedKeys = this.
|
|
2366
|
+
var checkedKeys = Array.from(this.state).filter(matchKey(index));
|
|
2328
2367
|
if (indexChecked(checkedKeys, index)) {
|
|
2329
2368
|
return 'checked';
|
|
2330
2369
|
}
|
|
@@ -2355,7 +2394,11 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2355
2394
|
};
|
|
2356
2395
|
CheckDirective.prototype.checkSingle = function (node) {
|
|
2357
2396
|
var key = this.itemKey(node.item);
|
|
2358
|
-
|
|
2397
|
+
var hasKey = this.state.has(key);
|
|
2398
|
+
this.state.clear();
|
|
2399
|
+
if (!hasKey) {
|
|
2400
|
+
this.state.add(key);
|
|
2401
|
+
}
|
|
2359
2402
|
this.notify();
|
|
2360
2403
|
};
|
|
2361
2404
|
CheckDirective.prototype.checkMultiple = function (node) {
|
|
@@ -2392,7 +2435,6 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2392
2435
|
if (!isPresent(currentKey)) {
|
|
2393
2436
|
return;
|
|
2394
2437
|
}
|
|
2395
|
-
var checkedKeys = new Set(this.checkedKeys);
|
|
2396
2438
|
var pendingCheck = [currentKey];
|
|
2397
2439
|
if (this.options.checkChildren) {
|
|
2398
2440
|
var descendants = fetchLoadedDescendants(node, function (_a) {
|
|
@@ -2406,63 +2448,59 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2406
2448
|
});
|
|
2407
2449
|
pendingCheck.push.apply(pendingCheck, descendants);
|
|
2408
2450
|
}
|
|
2409
|
-
var shouldCheck = !
|
|
2451
|
+
var shouldCheck = !this.state.has(currentKey);
|
|
2410
2452
|
pendingCheck.forEach(function (key) {
|
|
2411
2453
|
if (shouldCheck) {
|
|
2412
|
-
|
|
2454
|
+
_this.state.add(key);
|
|
2413
2455
|
}
|
|
2414
2456
|
else {
|
|
2415
|
-
|
|
2457
|
+
_this.state.delete(key);
|
|
2416
2458
|
}
|
|
2417
2459
|
});
|
|
2418
|
-
this.checkedKeys = Array.from(checkedKeys);
|
|
2419
2460
|
};
|
|
2420
2461
|
CheckDirective.prototype.checkParents = function (parent) {
|
|
2421
2462
|
var _this = this;
|
|
2422
2463
|
if (!isPresent(parent)) {
|
|
2423
2464
|
return;
|
|
2424
2465
|
}
|
|
2425
|
-
var checkedKeys = new Set(this.checkedKeys);
|
|
2426
2466
|
var currentParent = parent;
|
|
2427
2467
|
while (currentParent) {
|
|
2428
2468
|
var parentKey = this.itemKey(currentParent.item);
|
|
2429
|
-
var allChildrenSelected = currentParent.children.every(function (item) { return
|
|
2469
|
+
var allChildrenSelected = currentParent.children.every(function (item) { return _this.state.has(_this.itemKey(item)); });
|
|
2430
2470
|
if (allChildrenSelected) {
|
|
2431
|
-
|
|
2471
|
+
this.state.add(parentKey);
|
|
2432
2472
|
}
|
|
2433
2473
|
else {
|
|
2434
|
-
|
|
2474
|
+
this.state.delete(parentKey);
|
|
2435
2475
|
}
|
|
2436
2476
|
currentParent = currentParent.parent;
|
|
2437
2477
|
}
|
|
2438
|
-
this.checkedKeys = Array.from(checkedKeys);
|
|
2439
2478
|
};
|
|
2440
2479
|
CheckDirective.prototype.notify = function () {
|
|
2441
|
-
this.
|
|
2480
|
+
this.lastChange = Array.from(this.state);
|
|
2481
|
+
this.checkedKeysChange.emit(this.lastChange);
|
|
2442
2482
|
};
|
|
2443
2483
|
CheckDirective.prototype.addCheckedItemsChildren = function (lookups) {
|
|
2444
2484
|
var _this = this;
|
|
2445
2485
|
if (!isPresent(lookups) || lookups.length === 0) {
|
|
2446
2486
|
return;
|
|
2447
2487
|
}
|
|
2448
|
-
var initiallyCheckedItemsCount = this.
|
|
2449
|
-
var checkedKeys = new Set(this.checkedKeys);
|
|
2488
|
+
var initiallyCheckedItemsCount = this.state.size;
|
|
2450
2489
|
lookups.forEach(function (lookup) {
|
|
2451
2490
|
var itemKey = _this.itemKey(lookup.item);
|
|
2452
|
-
if (!
|
|
2491
|
+
if (!_this.state.has(itemKey)) {
|
|
2453
2492
|
return;
|
|
2454
2493
|
}
|
|
2455
2494
|
lookup.children.forEach(function (item) {
|
|
2456
2495
|
// ensure both the parent item and each child node is enabled
|
|
2457
2496
|
if (!_this.treeView.isDisabled(lookup.item.dataItem, lookup.item.index) &&
|
|
2458
2497
|
!_this.treeView.isDisabled(item.dataItem, item.index)) {
|
|
2459
|
-
|
|
2498
|
+
_this.state.add(_this.itemKey(item));
|
|
2460
2499
|
}
|
|
2461
2500
|
});
|
|
2462
2501
|
});
|
|
2463
|
-
var hasNewlyCheckedItems = initiallyCheckedItemsCount !==
|
|
2502
|
+
var hasNewlyCheckedItems = initiallyCheckedItemsCount !== this.state.size;
|
|
2464
2503
|
if (hasNewlyCheckedItems) {
|
|
2465
|
-
this.checkedKeys = Array.from(checkedKeys);
|
|
2466
2504
|
this.zone.run(function () { return _this.notify(); });
|
|
2467
2505
|
}
|
|
2468
2506
|
};
|
|
@@ -2477,9 +2515,8 @@ var CheckDirective = /** @class */ (function () {
|
|
|
2477
2515
|
], CheckDirective.prototype, "checkKey", void 0);
|
|
2478
2516
|
__decorate([
|
|
2479
2517
|
Input(),
|
|
2480
|
-
__metadata("design:type", Array)
|
|
2481
|
-
|
|
2482
|
-
], CheckDirective.prototype, "checkedKeys", null);
|
|
2518
|
+
__metadata("design:type", Array)
|
|
2519
|
+
], CheckDirective.prototype, "checkedKeys", void 0);
|
|
2483
2520
|
__decorate([
|
|
2484
2521
|
Input('kendoTreeViewCheckable'),
|
|
2485
2522
|
__metadata("design:type", Object)
|
|
@@ -2584,8 +2621,11 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2584
2621
|
*/
|
|
2585
2622
|
this.expandedKeysChange = new EventEmitter();
|
|
2586
2623
|
this.subscriptions = new Subscription();
|
|
2587
|
-
|
|
2588
|
-
|
|
2624
|
+
/**
|
|
2625
|
+
* Reflectes the internal `expandedKeys` state.
|
|
2626
|
+
*/
|
|
2627
|
+
this.state = new Set();
|
|
2628
|
+
this.originalExpandedKeys = new Set();
|
|
2589
2629
|
this.isFiltered = false;
|
|
2590
2630
|
/**
|
|
2591
2631
|
* Fills array with the correct expand keys according to wrapper metadata.
|
|
@@ -2618,7 +2658,7 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2618
2658
|
this.subscriptions.add(this.component.filterStateChange.subscribe(this.handleAutoExpand.bind(this)));
|
|
2619
2659
|
}
|
|
2620
2660
|
this.component.isExpanded = function (dataItem, index) {
|
|
2621
|
-
return _this.
|
|
2661
|
+
return _this.state.has(_this.itemKey({ dataItem: dataItem, index: index }));
|
|
2622
2662
|
};
|
|
2623
2663
|
}
|
|
2624
2664
|
Object.defineProperty(ExpandDirective.prototype, "isExpanded", {
|
|
@@ -2639,19 +2679,11 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2639
2679
|
enumerable: true,
|
|
2640
2680
|
configurable: true
|
|
2641
2681
|
});
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
return this._expandedKeys;
|
|
2648
|
-
},
|
|
2649
|
-
set: function (keys) {
|
|
2650
|
-
this._expandedKeys = keys;
|
|
2651
|
-
},
|
|
2652
|
-
enumerable: true,
|
|
2653
|
-
configurable: true
|
|
2654
|
-
});
|
|
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
|
+
};
|
|
2655
2687
|
ExpandDirective.prototype.ngOnDestroy = function () {
|
|
2656
2688
|
this.subscriptions.unsubscribe();
|
|
2657
2689
|
};
|
|
@@ -2671,19 +2703,19 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2671
2703
|
};
|
|
2672
2704
|
ExpandDirective.prototype.toggleExpand = function (_a) {
|
|
2673
2705
|
var index = _a.index, dataItem = _a.dataItem, expand = _a.expand;
|
|
2674
|
-
var
|
|
2675
|
-
var
|
|
2706
|
+
var key = this.itemKey({ index: index, dataItem: dataItem });
|
|
2707
|
+
var isExpanded = this.state.has(key);
|
|
2676
2708
|
var notify = false;
|
|
2677
|
-
if (
|
|
2678
|
-
this.
|
|
2709
|
+
if (isExpanded && !expand) {
|
|
2710
|
+
this.state.delete(key);
|
|
2679
2711
|
notify = true;
|
|
2680
2712
|
}
|
|
2681
|
-
else if (
|
|
2682
|
-
this.
|
|
2713
|
+
else if (!isExpanded && expand) {
|
|
2714
|
+
this.state.add(key);
|
|
2683
2715
|
notify = true;
|
|
2684
2716
|
}
|
|
2685
2717
|
if (notify) {
|
|
2686
|
-
this.
|
|
2718
|
+
this.notify();
|
|
2687
2719
|
}
|
|
2688
2720
|
};
|
|
2689
2721
|
ExpandDirective.prototype.handleAutoExpand = function (_a) {
|
|
@@ -2694,7 +2726,7 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2694
2726
|
}
|
|
2695
2727
|
var _b = this.filterExpandSettings, maxAutoExpandResults = _b.maxAutoExpandResults, autoExpandMatches = _b.expandMatches, expandedOnClear = _b.expandedOnClear;
|
|
2696
2728
|
if (!this.isFiltered) {
|
|
2697
|
-
this.originalExpandedKeys = this.
|
|
2729
|
+
this.originalExpandedKeys = new Set(this.state);
|
|
2698
2730
|
}
|
|
2699
2731
|
var exitingFilteredState = this.isFiltered && !term;
|
|
2700
2732
|
var maxExceeded = maxAutoExpandResults !== -1 && matchCount > maxAutoExpandResults;
|
|
@@ -2702,18 +2734,18 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2702
2734
|
if (exitAutoExpandedState) {
|
|
2703
2735
|
switch (expandedOnClear) {
|
|
2704
2736
|
case "initial": {
|
|
2705
|
-
if (!sameValues(this.
|
|
2706
|
-
this.
|
|
2707
|
-
this.
|
|
2737
|
+
if (!sameValues(this.state, this.originalExpandedKeys)) {
|
|
2738
|
+
this.state = this.originalExpandedKeys;
|
|
2739
|
+
this.notify();
|
|
2708
2740
|
}
|
|
2709
2741
|
break;
|
|
2710
2742
|
}
|
|
2711
2743
|
case "all": {
|
|
2712
|
-
this.
|
|
2744
|
+
this.state = new Set(nodes.reduce(function (acc, rootNode) {
|
|
2713
2745
|
_this.getEveryExpandKey(acc, rootNode);
|
|
2714
2746
|
return acc;
|
|
2715
|
-
}, []);
|
|
2716
|
-
this.
|
|
2747
|
+
}, []));
|
|
2748
|
+
this.notify();
|
|
2717
2749
|
break;
|
|
2718
2750
|
}
|
|
2719
2751
|
case "unchanged": {
|
|
@@ -2721,9 +2753,9 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2721
2753
|
}
|
|
2722
2754
|
case "none":
|
|
2723
2755
|
default: {
|
|
2724
|
-
if (this.
|
|
2725
|
-
this.
|
|
2726
|
-
this.
|
|
2756
|
+
if (this.state.size !== 0) {
|
|
2757
|
+
this.state.clear();
|
|
2758
|
+
this.notify();
|
|
2727
2759
|
}
|
|
2728
2760
|
break;
|
|
2729
2761
|
}
|
|
@@ -2731,16 +2763,20 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2731
2763
|
this.isFiltered = false;
|
|
2732
2764
|
return;
|
|
2733
2765
|
}
|
|
2734
|
-
var indicesToExpand = nodes.reduce(function (acc, rootNode) {
|
|
2766
|
+
var indicesToExpand = new Set(nodes.reduce(function (acc, rootNode) {
|
|
2735
2767
|
_this.updateExpandedNodes(acc, rootNode, autoExpandMatches);
|
|
2736
2768
|
return acc;
|
|
2737
|
-
}, []);
|
|
2738
|
-
if (!sameValues(this.
|
|
2739
|
-
this.
|
|
2740
|
-
this.
|
|
2769
|
+
}, []));
|
|
2770
|
+
if (!sameValues(this.state, indicesToExpand)) {
|
|
2771
|
+
this.state = indicesToExpand;
|
|
2772
|
+
this.notify();
|
|
2741
2773
|
}
|
|
2742
2774
|
this.isFiltered = true;
|
|
2743
2775
|
};
|
|
2776
|
+
ExpandDirective.prototype.notify = function () {
|
|
2777
|
+
this.lastChange = Array.from(this.state);
|
|
2778
|
+
this.expandedKeysChange.emit(this.lastChange);
|
|
2779
|
+
};
|
|
2744
2780
|
__decorate([
|
|
2745
2781
|
Input(),
|
|
2746
2782
|
__metadata("design:type", Function),
|
|
@@ -2760,9 +2796,8 @@ var ExpandDirective = /** @class */ (function () {
|
|
|
2760
2796
|
], ExpandDirective.prototype, "expandedKeysChange", void 0);
|
|
2761
2797
|
__decorate([
|
|
2762
2798
|
Input(),
|
|
2763
|
-
__metadata("design:type", Array)
|
|
2764
|
-
|
|
2765
|
-
], ExpandDirective.prototype, "expandedKeys", null);
|
|
2799
|
+
__metadata("design:type", Array)
|
|
2800
|
+
], ExpandDirective.prototype, "expandedKeys", void 0);
|
|
2766
2801
|
ExpandDirective = __decorate([
|
|
2767
2802
|
Directive({ selector: '[kendoTreeViewExpandable]' }),
|
|
2768
2803
|
__metadata("design:paramtypes", [ExpandableComponent])
|
|
@@ -2787,9 +2822,12 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2787
2822
|
'multiple': function (e) { return _this.selectMultiple(e); },
|
|
2788
2823
|
'single': function (e) { return _this.selectSingle(e); }
|
|
2789
2824
|
};
|
|
2790
|
-
|
|
2825
|
+
/**
|
|
2826
|
+
* Reflectes the internal `selectedKeys` state.
|
|
2827
|
+
*/
|
|
2828
|
+
this.state = new Set();
|
|
2791
2829
|
this.subscriptions.add(this.treeView.selectionChange.subscribe(this.select.bind(this)));
|
|
2792
|
-
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 }))); };
|
|
2793
2831
|
}
|
|
2794
2832
|
Object.defineProperty(SelectDirective.prototype, "isSelected", {
|
|
2795
2833
|
/**
|
|
@@ -2801,20 +2839,6 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2801
2839
|
enumerable: true,
|
|
2802
2840
|
configurable: true
|
|
2803
2841
|
});
|
|
2804
|
-
Object.defineProperty(SelectDirective.prototype, "selectedKeys", {
|
|
2805
|
-
/**
|
|
2806
|
-
* Defines the collection that will store the selected keys
|
|
2807
|
-
* ([see example]({% slug selection_treeview %}#toc-selection-modes)).
|
|
2808
|
-
*/
|
|
2809
|
-
get: function () {
|
|
2810
|
-
return this._selectedKeys;
|
|
2811
|
-
},
|
|
2812
|
-
set: function (keys) {
|
|
2813
|
-
this._selectedKeys = keys;
|
|
2814
|
-
},
|
|
2815
|
-
enumerable: true,
|
|
2816
|
-
configurable: true
|
|
2817
|
-
});
|
|
2818
2842
|
Object.defineProperty(SelectDirective.prototype, "getAriaMultiselectable", {
|
|
2819
2843
|
get: function () {
|
|
2820
2844
|
return this.options.mode === 'multiple';
|
|
@@ -2837,6 +2861,11 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2837
2861
|
enumerable: true,
|
|
2838
2862
|
configurable: true
|
|
2839
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
|
+
};
|
|
2840
2869
|
SelectDirective.prototype.ngOnDestroy = function () {
|
|
2841
2870
|
this.subscriptions.unsubscribe();
|
|
2842
2871
|
};
|
|
@@ -2861,29 +2890,29 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2861
2890
|
};
|
|
2862
2891
|
SelectDirective.prototype.selectSingle = function (node) {
|
|
2863
2892
|
var key = this.itemKey(node);
|
|
2864
|
-
if (this.
|
|
2865
|
-
|
|
2893
|
+
if (!this.state.has(key)) {
|
|
2894
|
+
this.state.clear();
|
|
2895
|
+
this.state.add(key);
|
|
2896
|
+
this.notify();
|
|
2866
2897
|
}
|
|
2867
|
-
this.selectedKeys = [key];
|
|
2868
|
-
this.notify();
|
|
2869
2898
|
};
|
|
2870
2899
|
SelectDirective.prototype.selectMultiple = function (node) {
|
|
2871
2900
|
var key = this.itemKey(node);
|
|
2872
|
-
var
|
|
2873
|
-
var isSelected = idx > -1;
|
|
2901
|
+
var isSelected = this.state.has(key);
|
|
2874
2902
|
if (!isPresent(key)) {
|
|
2875
2903
|
return;
|
|
2876
2904
|
}
|
|
2877
2905
|
if (isSelected) {
|
|
2878
|
-
this.
|
|
2906
|
+
this.state.delete(key);
|
|
2879
2907
|
}
|
|
2880
2908
|
else {
|
|
2881
|
-
this.
|
|
2909
|
+
this.state.add(key);
|
|
2882
2910
|
}
|
|
2883
2911
|
this.notify();
|
|
2884
2912
|
};
|
|
2885
2913
|
SelectDirective.prototype.notify = function () {
|
|
2886
|
-
this.
|
|
2914
|
+
this.lastChange = Array.from(this.state);
|
|
2915
|
+
this.selectedKeysChange.emit(this.lastChange);
|
|
2887
2916
|
};
|
|
2888
2917
|
__decorate([
|
|
2889
2918
|
Input(),
|
|
@@ -2900,9 +2929,8 @@ var SelectDirective = /** @class */ (function () {
|
|
|
2900
2929
|
], SelectDirective.prototype, "selection", void 0);
|
|
2901
2930
|
__decorate([
|
|
2902
2931
|
Input(),
|
|
2903
|
-
__metadata("design:type", Array)
|
|
2904
|
-
|
|
2905
|
-
], SelectDirective.prototype, "selectedKeys", null);
|
|
2932
|
+
__metadata("design:type", Array)
|
|
2933
|
+
], SelectDirective.prototype, "selectedKeys", void 0);
|
|
2906
2934
|
__decorate([
|
|
2907
2935
|
Output(),
|
|
2908
2936
|
__metadata("design:type", EventEmitter)
|
|
@@ -3124,12 +3152,12 @@ var getDropPosition = function (draggedItem, target, clientY, targetTreeView, co
|
|
|
3124
3152
|
if (!(isPresent(draggedItem) && isPresent(target) && isPresent(targetTreeView) && isPresent(containerOffset))) {
|
|
3125
3153
|
return;
|
|
3126
3154
|
}
|
|
3127
|
-
// the .k-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
|
|
3128
|
-
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');
|
|
3129
3157
|
if (!isPresent(item)) {
|
|
3130
3158
|
return;
|
|
3131
3159
|
}
|
|
3132
|
-
// the content element (.k-
|
|
3160
|
+
// the content element (.k-treeview-leaf:not(.k-treeview-load-more-button)) holds just the treeview item text
|
|
3133
3161
|
var content = getContentElement(item);
|
|
3134
3162
|
var targetChildOfDraggedItem = hasParent(item, closestNode(draggedItem));
|
|
3135
3163
|
if (!isPresent(content) || (content === draggedItem) || targetChildOfDraggedItem) {
|
|
@@ -3846,7 +3874,7 @@ var DragAndDropDirective = /** @class */ (function () {
|
|
|
3846
3874
|
return;
|
|
3847
3875
|
}
|
|
3848
3876
|
// store the drag target on press, show it only when it's actually dragged
|
|
3849
|
-
this.draggedItem = closestWithMatch(originalEvent.target, '.k-
|
|
3877
|
+
this.draggedItem = closestWithMatch(originalEvent.target, '.k-treeview-leaf');
|
|
3850
3878
|
// record the current pointer down coords - copared to the `startDragAfter` value to calculate whether to initiate dragging
|
|
3851
3879
|
this.pendingDragStartEvent = originalEvent;
|
|
3852
3880
|
};
|
|
@@ -3868,7 +3896,7 @@ var DragAndDropDirective = /** @class */ (function () {
|
|
|
3868
3896
|
}
|
|
3869
3897
|
var targetTreeView = this.getTargetTreeView(dropTarget);
|
|
3870
3898
|
var dropPosition = getDropPosition(this.draggedItem, dropTarget, clientY, targetTreeView, this.containerOffset);
|
|
3871
|
-
var dropHintAnchor = closestWithMatch(dropTarget, '.k-mid');
|
|
3899
|
+
var dropHintAnchor = closestWithMatch(dropTarget, '.k-treeview-mid');
|
|
3872
3900
|
var dropAction = getDropAction(dropPosition, dropTarget);
|
|
3873
3901
|
var sourceItem = treeItemFromEventTarget(this.treeview, this.draggedItem);
|
|
3874
3902
|
var destinationItem = treeItemFromEventTarget(targetTreeView, dropTarget);
|
|
@@ -4848,7 +4876,7 @@ var TreeViewItemDirective = /** @class */ (function () {
|
|
|
4848
4876
|
this.setAttribute('aria-checked', this.checkable ? this.ariaChecked : null);
|
|
4849
4877
|
};
|
|
4850
4878
|
TreeViewItemDirective.prototype.setDisabledClass = function () {
|
|
4851
|
-
this.setClass('k-
|
|
4879
|
+
this.setClass('k-disabled', this.isDisabled);
|
|
4852
4880
|
};
|
|
4853
4881
|
TreeViewItemDirective.prototype.setClass = function (className, toggle) {
|
|
4854
4882
|
var action = toggle ? 'addClass' : 'removeClass';
|
|
@@ -4975,10 +5003,10 @@ var TreeViewItemContentDirective = /** @class */ (function () {
|
|
|
4975
5003
|
this.subscriptions.unsubscribe();
|
|
4976
5004
|
};
|
|
4977
5005
|
TreeViewItemContentDirective.prototype.updateFocusClass = function () {
|
|
4978
|
-
this.render(this.navigationService.isActive(this.index), 'k-
|
|
5006
|
+
this.render(this.navigationService.isActive(this.index), 'k-focus');
|
|
4979
5007
|
};
|
|
4980
5008
|
TreeViewItemContentDirective.prototype.updateSelectionClass = function (selected) {
|
|
4981
|
-
this.render(selected, 'k-
|
|
5009
|
+
this.render(selected, 'k-selected');
|
|
4982
5010
|
};
|
|
4983
5011
|
TreeViewItemContentDirective.prototype.render = function (addClass, className) {
|
|
4984
5012
|
var action = addClass ? 'addClass' : 'removeClass';
|
|
@@ -5029,6 +5057,10 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5029
5057
|
* Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
5030
5058
|
*/
|
|
5031
5059
|
this.tabindex = 0;
|
|
5060
|
+
/**
|
|
5061
|
+
* Specifies the size of the component.
|
|
5062
|
+
*/
|
|
5063
|
+
this.size = 'medium';
|
|
5032
5064
|
/**
|
|
5033
5065
|
* Fires when the user changes the check state of the component.
|
|
5034
5066
|
*/
|
|
@@ -5056,6 +5088,13 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5056
5088
|
enumerable: true,
|
|
5057
5089
|
configurable: true
|
|
5058
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
|
+
});
|
|
5059
5098
|
CheckBoxComponent.prototype.ngOnInit = function () {
|
|
5060
5099
|
this.renderer.removeAttribute(this.element.nativeElement, "tabindex");
|
|
5061
5100
|
};
|
|
@@ -5098,6 +5137,10 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5098
5137
|
Input(),
|
|
5099
5138
|
__metadata("design:type", Number)
|
|
5100
5139
|
], CheckBoxComponent.prototype, "tabindex", void 0);
|
|
5140
|
+
__decorate([
|
|
5141
|
+
Input(),
|
|
5142
|
+
__metadata("design:type", String)
|
|
5143
|
+
], CheckBoxComponent.prototype, "size", void 0);
|
|
5101
5144
|
__decorate([
|
|
5102
5145
|
Output(),
|
|
5103
5146
|
__metadata("design:type", EventEmitter)
|
|
@@ -5105,7 +5148,7 @@ var CheckBoxComponent = /** @class */ (function () {
|
|
|
5105
5148
|
CheckBoxComponent = __decorate([
|
|
5106
5149
|
Component({
|
|
5107
5150
|
selector: 'kendo-checkbox',
|
|
5108
|
-
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 "
|
|
5109
5152
|
}),
|
|
5110
5153
|
__metadata("design:paramtypes", [ElementRef,
|
|
5111
5154
|
Renderer2,
|