@progress/kendo-angular-dropdowns 5.4.0-dev.202106231124 → 5.5.0-dev.202110281138

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.
Files changed (47) hide show
  1. package/dist/cdn/js/kendo-angular-dropdowns.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/common/list.component.js +1 -1
  4. package/dist/es/common/localization/messages.js +4 -0
  5. package/dist/es/common/shared.module.js +3 -1
  6. package/dist/es/dropdowntrees/checked-state/base-check.directive.js +54 -0
  7. package/dist/es/dropdowntrees/checked-state/check-all.directive.js +181 -0
  8. package/dist/es/dropdowntrees/checked-state/check.directive.js +15 -36
  9. package/dist/es/dropdowntrees/dropdowntree.component.js +4 -0
  10. package/dist/es/dropdowntrees/multiselecttree.component.js +66 -17
  11. package/dist/es/index.js +2 -0
  12. package/dist/es/multiselect/multiselect.component.js +8 -1
  13. package/dist/es/package-metadata.js +1 -1
  14. package/dist/es2015/common/list.component.js +6 -6
  15. package/dist/es2015/common/localization/messages.d.ts +4 -0
  16. package/dist/es2015/common/localization/messages.js +4 -0
  17. package/dist/es2015/common/shared.module.js +3 -1
  18. package/dist/es2015/dropdowntrees/checked-state/base-check.directive.d.ts +32 -0
  19. package/dist/es2015/dropdowntrees/checked-state/base-check.directive.js +48 -0
  20. package/dist/es2015/dropdowntrees/checked-state/check-all.directive.d.ts +53 -0
  21. package/dist/es2015/dropdowntrees/checked-state/check-all.directive.js +161 -0
  22. package/dist/es2015/dropdowntrees/checked-state/check.directive.d.ts +3 -5
  23. package/dist/es2015/dropdowntrees/checked-state/check.directive.js +5 -26
  24. package/dist/es2015/dropdowntrees/dropdowntree.component.d.ts +4 -0
  25. package/dist/es2015/dropdowntrees/dropdowntree.component.js +4 -0
  26. package/dist/es2015/dropdowntrees/multiselecttree.component.d.ts +18 -0
  27. package/dist/es2015/dropdowntrees/multiselecttree.component.js +91 -20
  28. package/dist/es2015/index.d.ts +2 -0
  29. package/dist/es2015/index.js +2 -0
  30. package/dist/es2015/index.metadata.json +1 -1
  31. package/dist/es2015/multiselect/multiselect.component.js +8 -1
  32. package/dist/es2015/package-metadata.js +1 -1
  33. package/dist/fesm2015/index.js +314 -55
  34. package/dist/fesm5/index.js +319 -57
  35. package/dist/npm/common/list.component.js +1 -1
  36. package/dist/npm/common/localization/messages.js +4 -0
  37. package/dist/npm/common/shared.module.js +3 -1
  38. package/dist/npm/dropdowntrees/checked-state/base-check.directive.js +56 -0
  39. package/dist/npm/dropdowntrees/checked-state/check-all.directive.js +183 -0
  40. package/dist/npm/dropdowntrees/checked-state/check.directive.js +14 -35
  41. package/dist/npm/dropdowntrees/dropdowntree.component.js +4 -0
  42. package/dist/npm/dropdowntrees/multiselecttree.component.js +66 -17
  43. package/dist/npm/index.js +4 -0
  44. package/dist/npm/multiselect/multiselect.component.js +8 -1
  45. package/dist/npm/package-metadata.js +1 -1
  46. package/dist/systemjs/kendo-angular-dropdowns.js +1 -1
  47. package/package.json +1 -1
@@ -23,7 +23,7 @@ var packageMetadata = {
23
23
  name: '@progress/kendo-angular-dropdowns',
24
24
  productName: 'Kendo UI for Angular',
25
25
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
26
- publishDate: 1624447339,
26
+ publishDate: 1635420981,
27
27
  version: '',
28
28
  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'
29
29
  };
@@ -1744,7 +1744,7 @@ var ListComponent = /** @class */ (function () {
1744
1744
  ListComponent = __decorate([
1745
1745
  Component({
1746
1746
  selector: 'kendo-list',
1747
- template: "\n <div *ngIf=\"dataService.grouped\"\n class='k-outer-group-header k-first'\n [ngClass]=\"{'k-virtual-item': virtual}\"\n [ngStyle]=\"{\n 'height.px': virtual?.itemHeight,\n 'minHeight.px' : virtual?.itemHeight,\n 'boxSizing' : virtual ? 'border-box' : 'inherit'}\"\n >\n <ng-template *ngIf=\"fixedGroupTemplate\"\n [templateContext]=\"{\n templateRef: fixedGroupTemplate.templateRef,\n $implicit: currentGroup\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!fixedGroupTemplate\"><strong>{{ currentGroup }}</strong> </ng-template>\n </div>\n <div #content\n [ngClass]=\"{ 'k-virtual-content': virtual, 'k-list-scroller': !virtual }\"\n [style.maxHeight.px]=\"height\"\n [style.overflowY]=\"overflowY\"\n unselectable=\"on\">\n <ul #list\n role=\"listbox\"\n [class]=\"listClass\"\n [ngClass]=\"{ 'k-virtual-list': virtual }\"\n [attr.id]=\"id\"\n [attr.aria-hidden]=\"!show\">\n <ng-template *ngIf=\"!dataService.grouped && show\" ngFor let-dataItem let-itemIndex=\"index\" [ngForOf]=\"data\">\n <li\n role=\"option\"\n kendoDropDownsSelectable\n [checkboxes]=\"checkboxes\"\n [height]=\"virtual?.itemHeight\"\n [index]=\"itemIndex + startFrom\"\n [multipleSelection]=\"multipleSelection\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem)\"\n [attr.tabIndex]=\"-1\"\n class=\"k-item\"\n [ngClass]=\"{ 'k-virtual-item': virtual, 'k-state-disabled': isDisabled(itemIndex) }\">\n <label class=\"k-checkbox-label\">\n <input *ngIf=\"checkboxes.enabled\"\n type=\"checkbox\"\n class=\"k-checkbox\"\n (change)=\"onCheckedChange($event, itemIndex)\"\n [checked]=\"isChecked(itemIndex)\"\n />\n </label>\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ getText(dataItem) }}</ng-template>\n </li>\n </ng-template>\n <ng-template *ngIf=\"dataService.grouped\" ngFor let-dataItem let-itemIndex=\"index\" [ngForOf]=\"data\">\n <li\n *ngIf=\"dataItem.header && dataItem.index > 0\"\n role=\"group\"\n class='k-outer-group-header'\n [ngClass]=\"{ 'k-virtual-item': virtual }\"\n [ngStyle]=\"{\n 'height.px': virtual?.itemHeight,\n 'minHeight.px' : virtual?.itemHeight,\n 'boxSizing' : virtual ? 'border-box' : 'inherit'}\"\n [attr.group-index]=\"dataItem.index\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem.value)\"\n [attr.tabIndex]=\"-1\">\n <ng-template *ngIf=\"groupTemplate\"\n [templateContext]=\"{\n templateRef: groupTemplate.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!groupTemplate\"><strong> {{ dataItem.value }}</strong> </ng-template>\n </li>\n <li\n *ngIf=\"!dataItem.header\"\n role=\"option\"\n kendoDropDownsSelectable\n [height]=\"virtual?.itemHeight\"\n [index]=\"dataItem.offsetIndex\"\n [multipleSelection]=\"multipleSelection\"\n [attr.absolute-index]=\"dataItem.index\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem.value)\"\n [attr.tabIndex]=\"-1\"\n class=\"k-item\"\n [ngClass]=\"{ 'k-virtual-item': virtual, 'k-state-disabled': isDisabled(dataItem.offsetIndex) }\">\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ getText(dataItem.value) }}</ng-template>\n </li>\n </ng-template>\n <kendo-resize-sensor\n *ngIf=\"!virtual\"\n (resize)=\"listResize.emit()\"\n >\n </kendo-resize-sensor>\n </ul>\n <div *ngIf=\"virtual\" #virtualContainer class=\"k-height-container\" role=\"presentation\">\n <div [style.height.px]=\"scrollHeight\">\n <kendo-resize-sensor (resize)=\"listResize.emit()\"></kendo-resize-sensor>\n </div>\n </div>\n </div>\n "
1747
+ template: "\n <div *ngIf=\"dataService.grouped\"\n class='k-outer-group-header k-first'\n [ngClass]=\"{'k-virtual-item': virtual}\"\n [ngStyle]=\"{\n 'height.px': virtual?.itemHeight,\n 'minHeight.px' : virtual?.itemHeight,\n 'boxSizing' : virtual ? 'border-box' : 'inherit'}\"\n >\n <ng-template *ngIf=\"fixedGroupTemplate\"\n [templateContext]=\"{\n templateRef: fixedGroupTemplate.templateRef,\n $implicit: currentGroup\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!fixedGroupTemplate\"><strong>{{ currentGroup }}</strong> </ng-template>\n </div>\n <div #content\n [ngClass]=\"{ 'k-virtual-content': virtual, 'k-list-scroller': !virtual }\"\n [style.maxHeight.px]=\"height\"\n [style.overflowY]=\"overflowY\"\n unselectable=\"on\">\n <ul #list\n role=\"listbox\"\n [class]=\"listClass\"\n [ngClass]=\"{ 'k-virtual-list': virtual }\"\n [attr.id]=\"id\"\n [attr.aria-hidden]=\"!show\">\n <ng-template *ngIf=\"!dataService.grouped && show\" ngFor let-dataItem let-itemIndex=\"index\" [ngForOf]=\"data\">\n <li\n role=\"option\"\n kendoDropDownsSelectable\n [checkboxes]=\"checkboxes\"\n [height]=\"virtual?.itemHeight\"\n [index]=\"itemIndex + startFrom\"\n [multipleSelection]=\"multipleSelection\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem)\"\n [attr.tabIndex]=\"-1\"\n class=\"k-item\"\n [ngClass]=\"{ 'k-virtual-item': virtual, 'k-state-disabled': isDisabled(itemIndex) }\">\n <label *ngIf=\"checkboxes.enabled\"\n class=\"k-checkbox-label\">\n <input type=\"checkbox\"\n class=\"k-checkbox\"\n (change)=\"onCheckedChange($event, itemIndex)\"\n [checked]=\"isChecked(itemIndex)\"\n />\n </label>\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ getText(dataItem) }}</ng-template>\n </li>\n </ng-template>\n <ng-template *ngIf=\"dataService.grouped\" ngFor let-dataItem let-itemIndex=\"index\" [ngForOf]=\"data\">\n <li\n *ngIf=\"dataItem.header && dataItem.index > 0\"\n role=\"group\"\n class='k-outer-group-header'\n [ngClass]=\"{ 'k-virtual-item': virtual }\"\n [ngStyle]=\"{\n 'height.px': virtual?.itemHeight,\n 'minHeight.px' : virtual?.itemHeight,\n 'boxSizing' : virtual ? 'border-box' : 'inherit'}\"\n [attr.group-index]=\"dataItem.index\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem.value)\"\n [attr.tabIndex]=\"-1\">\n <ng-template *ngIf=\"groupTemplate\"\n [templateContext]=\"{\n templateRef: groupTemplate.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!groupTemplate\"><strong> {{ dataItem.value }}</strong> </ng-template>\n </li>\n <li\n *ngIf=\"!dataItem.header\"\n role=\"option\"\n kendoDropDownsSelectable\n [height]=\"virtual?.itemHeight\"\n [index]=\"dataItem.offsetIndex\"\n [multipleSelection]=\"multipleSelection\"\n [attr.absolute-index]=\"dataItem.index\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem.value)\"\n [attr.tabIndex]=\"-1\"\n class=\"k-item\"\n [ngClass]=\"{ 'k-virtual-item': virtual, 'k-state-disabled': isDisabled(dataItem.offsetIndex) }\">\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ getText(dataItem.value) }}</ng-template>\n </li>\n </ng-template>\n <kendo-resize-sensor\n *ngIf=\"!virtual\"\n (resize)=\"listResize.emit()\"\n >\n </kendo-resize-sensor>\n </ul>\n <div *ngIf=\"virtual\" #virtualContainer class=\"k-height-container\" role=\"presentation\">\n <div [style.height.px]=\"scrollHeight\">\n <kendo-resize-sensor (resize)=\"listResize.emit()\"></kendo-resize-sensor>\n </div>\n </div>\n </div>\n "
1748
1748
  }),
1749
1749
  __metadata("design:paramtypes", [DataService,
1750
1750
  ElementRef,
@@ -6886,7 +6886,11 @@ var MultiSelectComponent = /** @class */ (function () {
6886
6886
  data = data.filter(function (item) { return !item.header; }).map(function (item) { return item.value; });
6887
6887
  }
6888
6888
  var dataItemValues = new Set(dataItems.map(function (item) { return getter$1(item, _this.valueField); }));
6889
- this.value = this.value.filter(function (value) { return !dataItemValues.has(getter$1(value, _this.valueField)); });
6889
+ this.value = this.value.filter(function (value) {
6890
+ var index = selectedIndices([value], data, _this.valueField)[0];
6891
+ var isDataItemDisabled = _this.disabledItemsService.isIndexDisabled(index);
6892
+ return !dataItemValues.has(getter$1(value, _this.valueField)) || isDataItemDisabled;
6893
+ });
6890
6894
  this.emitValueChange();
6891
6895
  };
6892
6896
  MultiSelectComponent.prototype.removeSingleTag = function (dataItem) {
@@ -6896,6 +6900,9 @@ var MultiSelectComponent = /** @class */ (function () {
6896
6900
  data = data.filter(function (item) { return !item.header; }).map(function (item) { return item.value; });
6897
6901
  }
6898
6902
  var index = selectedIndices([dataItem], data, this.valueField)[0];
6903
+ if (this.disabledItemsService.isIndexDisabled(index)) {
6904
+ return;
6905
+ }
6899
6906
  if (isNumber(index)) {
6900
6907
  this.selectionService.unselect(index);
6901
6908
  this.selectionService.focused = index;
@@ -7985,6 +7992,10 @@ var DropDownTreeComponent = /** @class */ (function () {
7985
7992
  * @hidden
7986
7993
  */
7987
7994
  this.selectedKeys = [];
7995
+ /**
7996
+ * @hidden
7997
+ */
7998
+ this.filterStateChange = new EventEmitter();
7988
7999
  /**
7989
8000
  * @hidden
7990
8001
  */
@@ -9038,6 +9049,12 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9038
9049
  * @default false
9039
9050
  */
9040
9051
  this.filterable = false;
9052
+ /**
9053
+ * If `checkАll` is set to `true` and the checkboxes are enabled, a tri-state checkbox appears above the embedded treeview.
9054
+ * Clicking the checkbox checks or unchecks all enabled items of the treeview that are loaded.
9055
+ * @default false
9056
+ */
9057
+ this.checkAll = false;
9041
9058
  /**
9042
9059
  * A function which determines if a specific node has child nodes.
9043
9060
  */
@@ -9112,6 +9129,10 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9112
9129
  * Fires when the value of the built-in filter input element changes.
9113
9130
  */
9114
9131
  this.filterChange = new EventEmitter();
9132
+ /**
9133
+ * @hidden
9134
+ */
9135
+ this.filterStateChange = new EventEmitter();
9115
9136
  /**
9116
9137
  * @hidden
9117
9138
  */
@@ -9137,6 +9158,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9137
9158
  this._checkableSettings = DEFAULT_CHECKABLE_SETTINGS;
9138
9159
  this._isFocused = false;
9139
9160
  this.subscriptions = [];
9161
+ this.lastAction = 'check';
9140
9162
  this.onTouchedCallback = noop;
9141
9163
  this.onChangeCallback = noop;
9142
9164
  this.direction = localization.rtl ? 'rtl' : 'ltr';
@@ -9152,7 +9174,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9152
9174
  this._treeview = treeview;
9153
9175
  if (treeview) {
9154
9176
  // If filtering is enabled, focus the TreeView on mobile devices instead of the filter input
9155
- if (this.isFocused && !this.filterable || this.touchEnabled) {
9177
+ if (this.isFocused && !this.filterable && !this.checkAll || this.touchEnabled) {
9156
9178
  treeview.focus();
9157
9179
  }
9158
9180
  /**
@@ -9473,6 +9495,20 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9473
9495
  enumerable: true,
9474
9496
  configurable: true
9475
9497
  });
9498
+ Object.defineProperty(MultiSelectTreeComponent.prototype, "isFilterActive", {
9499
+ get: function () {
9500
+ return this.filterInput && document.activeElement === this.filterInput.nativeElement;
9501
+ },
9502
+ enumerable: true,
9503
+ configurable: true
9504
+ });
9505
+ Object.defineProperty(MultiSelectTreeComponent.prototype, "isCheckAllActive", {
9506
+ get: function () {
9507
+ return this.checkAllInput && document.activeElement === this.checkAllInput.nativeElement;
9508
+ },
9509
+ enumerable: true,
9510
+ configurable: true
9511
+ });
9476
9512
  MultiSelectTreeComponent.prototype.ngOnInit = function () {
9477
9513
  var _this = this;
9478
9514
  this.renderer.removeAttribute(this.hostElement.nativeElement, 'tabindex');
@@ -9696,6 +9732,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9696
9732
  */
9697
9733
  MultiSelectTreeComponent.prototype.handleCheckedItemsChange = function (items) {
9698
9734
  this.valueDepth = items.map(function (item) { return item.level; });
9735
+ this.lastAction = items.length > this.dataItems.length ? 'check' : 'uncheck';
9699
9736
  this.dataItems = items.slice();
9700
9737
  this.updateValue(this.dataItems);
9701
9738
  };
@@ -9717,12 +9754,12 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9717
9754
  if (tag instanceof Array) {
9718
9755
  // Remove group tag
9719
9756
  this.dataItems = this.dataItems.filter(function (_item, i) { return i < _this.showAfter || _this.disabledIndices.has(i); });
9720
- this.valueDepth = this.valueDepth.filter(function (_item, i) { return i < _this.showAfter; });
9757
+ this.valueDepth = this.valueDepth.filter(function (_item, i) { return i < _this.showAfter || _this.disabledIndices.has(i); });
9721
9758
  }
9722
9759
  else {
9723
9760
  // Remove single tag
9724
- this.dataItems = this.dataItems.filter(function (_item, i) { return i !== index; });
9725
- this.valueDepth = this.valueDepth.filter(function (_item, i) { return i !== index; });
9761
+ this.dataItems = this.dataItems.filter(function (_item, i) { return i !== index || _this.disabledIndices.has(i); });
9762
+ this.valueDepth = this.valueDepth.filter(function (_item, i) { return i !== index || _this.disabledIndices.has(i); });
9726
9763
  }
9727
9764
  this.updateValue(this.dataItems);
9728
9765
  // focus the wrapper if the component is not focused - the floating label reacts to focus/blur
@@ -9748,7 +9785,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9748
9785
  this.value = this.value.filter(function (_item, index) { return _this.disabledIndices.has(index); });
9749
9786
  this.dataItems = this.dataItems.filter(function (_item, index) { return _this.disabledIndices.has(index); });
9750
9787
  this.valueDepth = this.valueDepth.filter(function (_depth, index) { return _this.disabledIndices.has(index); });
9751
- this.emitValueChange();
9788
+ this.emitValueChange(this.value);
9752
9789
  };
9753
9790
  /**
9754
9791
  * @hidden
@@ -9788,6 +9825,13 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9788
9825
  this.filterChange.next(term);
9789
9826
  this.allNodesHidden = this.nodes.every(function (node, index) { return !_this.isVisible(node, String(index)); });
9790
9827
  };
9828
+ /**
9829
+ * @hidden
9830
+ */
9831
+ MultiSelectTreeComponent.prototype.toggleCheckAll = function () {
9832
+ this.checkAllInput.nativeElement.focus();
9833
+ this.checkAllInput.nativeElement.click();
9834
+ };
9791
9835
  MultiSelectTreeComponent.prototype.verifySettings = function () {
9792
9836
  if (!isDevMode()) {
9793
9837
  return;
@@ -9913,17 +9957,20 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9913
9957
  return;
9914
9958
  }
9915
9959
  var isFirstNodeActive = this.treeview['navigationService']['activeIndex'] === '0';
9916
- if (this.filterable) {
9917
- var isFilterActive = this.filterInput.nativeElement === document.activeElement;
9918
- if (isFilterActive) {
9919
- this.focus();
9920
- }
9921
- else if (!isFilterActive && isFirstNodeActive) {
9922
- this.filterInput.nativeElement.focus();
9923
- }
9924
- }
9925
- if (!this.filterable && isFirstNodeActive) {
9960
+ // Current focus is on the filter input => should focus the wrapper
9961
+ if (this.filterable && this.isFilterActive) {
9926
9962
  this.focus();
9963
+ // Current focus is on the treeview first node => should focus the check all checkbox if enabled
9964
+ }
9965
+ else if (this.checkAll && !this.isCheckAllActive && isFirstNodeActive) {
9966
+ this.checkAllInput.nativeElement.focus();
9967
+ // Current focus is either on the check all checkbox or the treeview's first node
9968
+ // => should focus either the filter input (if enabled) or the wrapper
9969
+ }
9970
+ else if (this.isCheckAllActive || isFirstNodeActive) {
9971
+ this.filterable ?
9972
+ this.filterInput.nativeElement.focus() :
9973
+ this.focus();
9927
9974
  }
9928
9975
  };
9929
9976
  MultiSelectTreeComponent.prototype.handleDownKey = function (event) {
@@ -9931,9 +9978,14 @@ var MultiSelectTreeComponent = /** @class */ (function () {
9931
9978
  return;
9932
9979
  }
9933
9980
  event.originalEvent.preventDefault();
9934
- // Put the focus back on the filter input if the wrapper is focused
9981
+ // Current focus is on the wrapper => should focus the filter input
9935
9982
  if (this.filterable && this.isWrapperActive) {
9936
9983
  this.filterInput.nativeElement.focus();
9984
+ // Current focus is on the wrapper/filter input => should focus check all checkbox if enabled
9985
+ }
9986
+ else if (this.checkAll && (this.isWrapperActive || this.isFilterActive)) {
9987
+ this.checkAllInput.nativeElement.focus();
9988
+ // Should focus the treeview if filterable and check all are disabled
9937
9989
  }
9938
9990
  else if (!this.treeview.isActive) {
9939
9991
  this.treeview.focus();
@@ -10094,6 +10146,10 @@ var MultiSelectTreeComponent = /** @class */ (function () {
10094
10146
  ViewChild('filterInput', { static: false }),
10095
10147
  __metadata("design:type", ElementRef)
10096
10148
  ], MultiSelectTreeComponent.prototype, "filterInput", void 0);
10149
+ __decorate([
10150
+ ViewChild('checkAllInput', { static: false }),
10151
+ __metadata("design:type", ElementRef)
10152
+ ], MultiSelectTreeComponent.prototype, "checkAllInput", void 0);
10097
10153
  __decorate([
10098
10154
  Input(),
10099
10155
  __metadata("design:type", Number),
@@ -10176,6 +10232,10 @@ var MultiSelectTreeComponent = /** @class */ (function () {
10176
10232
  Input(),
10177
10233
  __metadata("design:type", Boolean)
10178
10234
  ], MultiSelectTreeComponent.prototype, "filterable", void 0);
10235
+ __decorate([
10236
+ Input(),
10237
+ __metadata("design:type", Boolean)
10238
+ ], MultiSelectTreeComponent.prototype, "checkAll", void 0);
10179
10239
  __decorate([
10180
10240
  Input(),
10181
10241
  __metadata("design:type", Function)
@@ -10276,7 +10336,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
10276
10336
  }
10277
10337
  ],
10278
10338
  selector: 'kendo-multiselecttree',
10279
- template: "\n <ng-container kendoMultiSelectTreeLocalizedMessages\n i18n-noDataText=\"kendo.multiselecttree.noDataText|The text displayed in the popup when there are no items\"\n noDataText=\"NO DATA FOUND\"\n\n i18n-clearTitle=\"kendo.multiselecttree.clearTitle|The title of the clear button\"\n clearTitle=\"clear\"\n >\n </ng-container>\n <div #wrapper\n [ngClass]=\"{\n 'k-multiselect-wrap': true,\n 'k-floatwrap': true,\n 'k-state-disabled': this.disabled\n }\"\n role=\"listbox\"\n aria-haspopup=\"tree\"\n [attr.aria-describedby]=\"tagListId\"\n [attr.aria-readonly]=\"readonly\"\n [attr.aria-activedescendant]=\"focusedTagId\"\n [attr.tabindex]=\"tabindex\"\n [attr.id]=\"focusableId\"\n [attr.dir]=\"direction\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n >\n <kendo-taglist\n [id]=\"tagListId\"\n [tags]=\"tags\"\n [focused]=\"focusedTagIndex\"\n [textField]=\"textField\"\n [valueField]=\"valueField\"\n [valueDepth]=\"valueDepth\"\n [disabled]=\"disabled\"\n [tagPrefix]=\"tagPrefix\"\n [template]=\"tagTemplate\"\n [groupTemplate]=\"groupTagTemplate\"\n [disabledIndices]=\"disabledIndices\"\n (removeTag)=\"handleRemoveTag($event)\"\n >\n </kendo-taglist>\n <span *ngIf=\"!tags || !tags.length\"\n class=\"k-input k-readonly\"\n >\n {{ placeholder }}\n </span>\n <span\n *ngIf=\"!disabled && !loading && !readonly && clearButton && tags?.length\"\n class=\"k-icon k-clear-value k-i-close\"\n [attr.title]=\"messageFor('clearTitle')\"\n role=\"button\"\n tabindex=\"-1\"\n (mousedown)=\"clearAll($event)\"\n >\n </span>\n <span\n *ngIf=\"loading\"\n class=\"k-icon k-i-loading\"\n >\n </span>\n </div>\n <ng-template #popupTemplate>\n <span\n *ngIf=\"filterable\"\n class=\"k-list-filter\"\n >\n <input\n #filterInput\n (input)=\"handleFilterInputChange($event.target.value)\"\n [filterInput]=\"filterable && !touchEnabled\"\n (keydown.arrowdown)=\"handleKeydown($event)\"\n (keydown.arrowup)=\"handleKeydown($event)\"\n (keydown.alt.arrowup)=\"handleKeydown($event)\"\n [(ngModel)]=\"filter\"\n class=\"k-textbox\"\n role=\"textbox\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n tabindex=\"0\"\n aria-disabled=\"false\"\n aria-readonly=\"false\"\n [kendoEventsOutsideAngular]=\"{\n blur: handleBlur\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-icon k-i-zoom\"></span>\n </span>\n <!--header template-->\n <ng-template\n *ngIf=\"headerTemplate\"\n [templateContext]=\"{\n templateRef: headerTemplate?.templateRef\n }\">\n </ng-template>\n <kendo-treeview\n #treeview\n [nodes]=\"data\"\n [style.maxHeight.px]=\"listHeight\"\n [animate]=\"false\"\n kendoMultiSelectTreeCheckable\n [checkable]=\"checkableSettings\"\n [checkedItems]=\"checkedItems\"\n [valueField]=\"valueField\"\n [textField]=\"textField\"\n [children]=\"children\"\n [hasChildren]=\"hasChildren\"\n [isExpanded]=\"isNodeExpanded\"\n [isDisabled]=\"itemDisabled\"\n [nodeTemplate]=\"nodeTemplate\"\n [loadOnDemand]=\"loadOnDemand\"\n [filter]=\"filter\"\n [isVisible]=\"isNodeVisible\"\n (keydown)=\"handleKeydown($event)\"\n (nodeClick)=\"handleNodeClick($event)\"\n (expand)=\"nodeExpand.emit($event)\"\n (collapse)=\"nodeCollapse.emit($event)\"\n (checkedItemsChange)=\"handleCheckedItemsChange($event)\"\n [kendoEventsOutsideAngular]=\"{\n focusout: handleBlur\n }\"\n [scope]=\"this\"\n >\n </kendo-treeview>\n <!--footer template-->\n <ng-template\n *ngIf=\"footerTemplate\"\n [templateContext]=\"{\n templateRef: footerTemplate?.templateRef\n }\">\n </ng-template>\n <!--no-data template-->\n <div class=\"k-nodata\" *ngIf=\"data?.length === 0 || allNodesHidden\">\n <ng-template [ngIf]=\"noDataTemplate\"\n [templateContext]=\"{\n templateRef: noDataTemplate?.templateRef\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!noDataTemplate\">\n <div>{{ messageFor('noDataText') }}</div>\n </ng-template>\n </div>\n </ng-template>\n <ng-container #container></ng-container>\n "
10339
+ template: "\n <ng-container kendoMultiSelectTreeLocalizedMessages\n i18n-noDataText=\"kendo.multiselecttree.noDataText|The text displayed in the popup when there are no items\"\n noDataText=\"NO DATA FOUND\"\n\n i18n-clearTitle=\"kendo.multiselecttree.clearTitle|The title of the clear button\"\n clearTitle=\"clear\"\n\n i18n-checkAllText=\"kendo.multiselecttree.checkAllText|The text displayed for the check-all checkbox\"\n checkAllText=\"Check all\"\n >\n </ng-container>\n <div #wrapper\n [ngClass]=\"{\n 'k-multiselect-wrap': true,\n 'k-floatwrap': true,\n 'k-state-disabled': this.disabled\n }\"\n role=\"listbox\"\n aria-haspopup=\"tree\"\n [attr.aria-describedby]=\"tagListId\"\n [attr.aria-readonly]=\"readonly\"\n [attr.aria-activedescendant]=\"focusedTagId\"\n [attr.tabindex]=\"tabindex\"\n [attr.id]=\"focusableId\"\n [attr.dir]=\"direction\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n >\n <kendo-taglist\n [id]=\"tagListId\"\n [tags]=\"tags\"\n [focused]=\"focusedTagIndex\"\n [textField]=\"textField\"\n [valueField]=\"valueField\"\n [valueDepth]=\"valueDepth\"\n [disabled]=\"disabled\"\n [tagPrefix]=\"tagPrefix\"\n [template]=\"tagTemplate\"\n [groupTemplate]=\"groupTagTemplate\"\n [disabledIndices]=\"disabledIndices\"\n (removeTag)=\"handleRemoveTag($event)\"\n >\n </kendo-taglist>\n <span *ngIf=\"!tags || !tags.length\"\n class=\"k-input k-readonly\"\n >\n {{ placeholder }}\n </span>\n <span\n *ngIf=\"!disabled && !loading && !readonly && clearButton && tags?.length\"\n class=\"k-icon k-clear-value k-i-close\"\n [attr.title]=\"messageFor('clearTitle')\"\n role=\"button\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n </span>\n <span\n *ngIf=\"loading\"\n class=\"k-icon k-i-loading\"\n >\n </span>\n </div>\n <ng-template #popupTemplate>\n <span\n *ngIf=\"filterable\"\n class=\"k-list-filter\"\n >\n <input\n #filterInput\n (input)=\"handleFilterInputChange($event.target.value)\"\n [filterInput]=\"filterable && !touchEnabled\"\n (keydown)=\"handleKeydown($event)\"\n [(ngModel)]=\"filter\"\n class=\"k-textbox\"\n role=\"textbox\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n tabindex=\"0\"\n aria-disabled=\"false\"\n aria-readonly=\"false\"\n [kendoEventsOutsideAngular]=\"{\n blur: handleBlur\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-icon k-i-zoom\"></span>\n </span>\n <!--header template-->\n <ng-template\n *ngIf=\"headerTemplate\"\n [templateContext]=\"{\n templateRef: headerTemplate?.templateRef\n }\">\n </ng-template>\n <div *ngIf=\"checkAll\" class=\"k-check-all\">\n <input\n #checkAllInput\n [checkAll]=\"!filterable && !touchEnabled\"\n type=\"checkbox\"\n class=\"k-checkbox\"\n role=\"checkbox\"\n tabindex=\"0\"\n aria-disabled=\"false\"\n aria-readonly=\"false\"\n [treeview]=\"treeview\"\n [checkedItems]=\"checkedItems\"\n [valueField]=\"valueField\"\n [lastAction]=\"lastAction\"\n (checkedItemsChange)=\"handleCheckedItemsChange($event)\"\n (keydown)=\"handleKeydown($event)\"\n [kendoEventsOutsideAngular]=\"{\n blur: handleBlur\n }\"\n [scope]=\"this\"\n >\n <span\n class=\"k-checkbox-label\"\n (click)=\"toggleCheckAll()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n {{ messageFor('checkAllText') }}\n </span>\n </div>\n <kendo-treeview\n #treeview\n [nodes]=\"data\"\n [style.maxHeight.px]=\"listHeight\"\n [animate]=\"false\"\n kendoMultiSelectTreeCheckable\n [checkable]=\"checkableSettings\"\n [checkedItems]=\"checkedItems\"\n [valueField]=\"valueField\"\n [textField]=\"textField\"\n [children]=\"children\"\n [hasChildren]=\"hasChildren\"\n [isExpanded]=\"isNodeExpanded\"\n [isDisabled]=\"itemDisabled\"\n [nodeTemplate]=\"nodeTemplate\"\n [loadOnDemand]=\"loadOnDemand\"\n [filter]=\"filter\"\n [isVisible]=\"isNodeVisible\"\n (keydown)=\"handleKeydown($event)\"\n (nodeClick)=\"handleNodeClick($event)\"\n (expand)=\"nodeExpand.emit($event)\"\n (collapse)=\"nodeCollapse.emit($event)\"\n (checkedItemsChange)=\"handleCheckedItemsChange($event)\"\n [kendoEventsOutsideAngular]=\"{\n focusout: handleBlur\n }\"\n [scope]=\"this\"\n >\n </kendo-treeview>\n <!--footer template-->\n <ng-template\n *ngIf=\"footerTemplate\"\n [templateContext]=\"{\n templateRef: footerTemplate?.templateRef\n }\">\n </ng-template>\n <!--no-data template-->\n <div class=\"k-nodata\" *ngIf=\"data?.length === 0 || allNodesHidden\">\n <ng-template [ngIf]=\"noDataTemplate\"\n [templateContext]=\"{\n templateRef: noDataTemplate?.templateRef\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!noDataTemplate\">\n <div>{{ messageFor('noDataText') }}</div>\n </ng-template>\n </div>\n </ng-template>\n <ng-container #container></ng-container>\n "
10280
10340
  }),
10281
10341
  __param(7, Optional()), __param(7, Inject(TOUCH_ENABLED)),
10282
10342
  __metadata("design:paramtypes", [PopupService,
@@ -10564,6 +10624,10 @@ var Messages = /** @class */ (function (_super) {
10564
10624
  Input(),
10565
10625
  __metadata("design:type", String)
10566
10626
  ], Messages.prototype, "clearTitle", void 0);
10627
+ __decorate([
10628
+ Input(),
10629
+ __metadata("design:type", String)
10630
+ ], Messages.prototype, "checkAllText", void 0);
10567
10631
  return Messages;
10568
10632
  }(ComponentMessages));
10569
10633
 
@@ -10959,33 +11023,81 @@ var TemplateContextDirective = /** @class */ (function () {
10959
11023
  *
10960
11024
  * A directive which manages the in-memory checked state of the MultiSelectTree nodes.
10961
11025
  */
10962
- var CheckDirective = /** @class */ (function () {
11026
+ var BaseCheckDirective = /** @class */ (function () {
11027
+ function BaseCheckDirective() {
11028
+ }
11029
+ BaseCheckDirective.prototype.addItem = function (item) {
11030
+ if (this.isItemChecked(item)) {
11031
+ return;
11032
+ }
11033
+ var level = getHierarchicalItemLevel(item.index);
11034
+ var candidate = __assign({}, item, { level: level });
11035
+ this.checkedItems.push(candidate);
11036
+ this.checkedKeys.add(valueFrom(candidate, this.valueField));
11037
+ };
11038
+ BaseCheckDirective.prototype.removeItem = function (item) {
11039
+ var _this = this;
11040
+ if (!this.isItemChecked(item)) {
11041
+ return;
11042
+ }
11043
+ var level = getHierarchicalItemLevel(item.index);
11044
+ var candidate = __assign({}, item, { level: level });
11045
+ this.checkedItems = this.checkedItems
11046
+ .filter(function (item) { return valueFrom(item, _this.valueField) !== valueFrom(candidate, _this.valueField); });
11047
+ this.checkedKeys.delete(valueFrom(candidate, this.valueField));
11048
+ };
11049
+ BaseCheckDirective.prototype.isItemChecked = function (item) {
11050
+ return this.checkedKeys.has(valueFrom(item, this.valueField));
11051
+ };
11052
+ BaseCheckDirective.prototype.updateItems = function () {
11053
+ var _this = this;
11054
+ this.checkedItems = this.checkedItems || [];
11055
+ this.checkedKeys = new Set(this.checkedItems.map(function (item) { return valueFrom(item, _this.valueField); }));
11056
+ };
11057
+ __decorate([
11058
+ Input(),
11059
+ __metadata("design:type", Object)
11060
+ ], BaseCheckDirective.prototype, "valueField", void 0);
11061
+ __decorate([
11062
+ Input(),
11063
+ __metadata("design:type", Array)
11064
+ ], BaseCheckDirective.prototype, "checkedItems", void 0);
11065
+ return BaseCheckDirective;
11066
+ }());
11067
+
11068
+ /**
11069
+ * @hidden
11070
+ *
11071
+ * A directive which manages the in-memory checked state of the MultiSelectTree nodes.
11072
+ */
11073
+ var CheckDirective = /** @class */ (function (_super) {
11074
+ __extends(CheckDirective, _super);
10963
11075
  function CheckDirective(treeView) {
10964
- this.treeView = treeView;
11076
+ var _this = _super.call(this) || this;
11077
+ _this.treeView = treeView;
10965
11078
  /**
10966
11079
  * Fires when the `checkedItems` collection was updated.
10967
11080
  */
10968
- this.checkedItemsChange = new EventEmitter();
11081
+ _this.checkedItemsChange = new EventEmitter();
10969
11082
  /**
10970
11083
  * Holds a Set with just the checked item keys.
10971
11084
  *
10972
11085
  * Should be updated each time the `checkedItems` value or content is changed.
10973
11086
  * Can be used for efficient look-up of whether an item is checked or not (O(1) access time).
10974
11087
  */
10975
- this.checkedKeys = new Set();
10976
- this.subscriptions = new Subscription();
10977
- this.subscriptions.add(this.treeView.checkedChange
10978
- .subscribe(this.handleCheckedChange.bind(this)));
10979
- this.treeView.isChecked = this.getCheckedState.bind(this);
11088
+ _this.checkedKeys = new Set();
11089
+ _this.subscriptions = new Subscription();
11090
+ _this.subscriptions.add(_this.treeView.checkedChange
11091
+ .subscribe(_this.handleCheckedChange.bind(_this)));
11092
+ _this.treeView.isChecked = _this.getCheckedState.bind(_this);
11093
+ return _this;
10980
11094
  }
10981
11095
  CheckDirective.prototype.ngOnChanges = function (changes) {
10982
- var _this = this;
10983
11096
  if (isPresent(changes.checkable)) {
10984
11097
  this.toggleCheckOnClick();
10985
11098
  }
10986
11099
  if (isPresent(changes.checkedItems)) {
10987
- this.checkedItems = this.checkedItems || [];
10988
- this.checkedKeys = new Set(this.checkedItems.map(function (item) { return valueFrom(item, _this.valueField); }));
11100
+ this.updateItems();
10989
11101
  }
10990
11102
  };
10991
11103
  CheckDirective.prototype.ngOnDestroy = function () {
@@ -11070,29 +11182,6 @@ var CheckDirective = /** @class */ (function () {
11070
11182
  currentParent = currentParent.parent;
11071
11183
  }
11072
11184
  };
11073
- CheckDirective.prototype.addItem = function (item) {
11074
- if (this.isItemChecked(item)) {
11075
- return;
11076
- }
11077
- var level = getHierarchicalItemLevel(item.index);
11078
- var candidate = __assign({}, item, { level: level });
11079
- this.checkedItems.push(candidate);
11080
- this.checkedKeys.add(valueFrom(candidate, this.valueField));
11081
- };
11082
- CheckDirective.prototype.removeItem = function (item) {
11083
- var _this = this;
11084
- if (!this.isItemChecked(item)) {
11085
- return;
11086
- }
11087
- var level = getHierarchicalItemLevel(item.index);
11088
- var candidate = __assign({}, item, { level: level });
11089
- this.checkedItems = this.checkedItems
11090
- .filter(function (item) { return valueFrom(item, _this.valueField) !== valueFrom(candidate, _this.valueField); });
11091
- this.checkedKeys.delete(valueFrom(candidate, this.valueField));
11092
- };
11093
- CheckDirective.prototype.isItemChecked = function (item) {
11094
- return this.checkedKeys.has(valueFrom(item, this.valueField));
11095
- };
11096
11185
  CheckDirective.prototype.isItemIndeterminate = function (lookup) {
11097
11186
  var children = lookup.children;
11098
11187
  if (!Array.isArray(children) || children.length === 0) {
@@ -11132,7 +11221,179 @@ var CheckDirective = /** @class */ (function () {
11132
11221
  __metadata("design:paramtypes", [TreeViewComponent])
11133
11222
  ], CheckDirective);
11134
11223
  return CheckDirective;
11135
- }());
11224
+ }(BaseCheckDirective));
11225
+
11226
+ /**
11227
+ * @hidden
11228
+ *
11229
+ * A directive which manages the in-memory checked state of the MultiSelectTree nodes.
11230
+ */
11231
+ var CheckAllDirective = /** @class */ (function (_super) {
11232
+ __extends(CheckAllDirective, _super);
11233
+ function CheckAllDirective(element, zone, cdr, renderer) {
11234
+ var _this = _super.call(this) || this;
11235
+ _this.element = element;
11236
+ _this.zone = zone;
11237
+ _this.cdr = cdr;
11238
+ _this.renderer = renderer;
11239
+ /**
11240
+ * Fires when the `checkedItems` collection was updated.
11241
+ */
11242
+ _this.checkedItemsChange = new EventEmitter();
11243
+ /**
11244
+ * Holds a Set with just the checked item keys.
11245
+ *
11246
+ * Should be updated each time the `checkedItems` value or content is changed.
11247
+ * Can be used for efficient look-up of whether an item is checked or not (O(1) access time).
11248
+ */
11249
+ _this.checkedKeys = new Set();
11250
+ return _this;
11251
+ }
11252
+ CheckAllDirective.prototype.handleChange = function (event) {
11253
+ var _this = this;
11254
+ // Need to store the current checkbox state at the moment of click
11255
+ this.currentCheckedState = event.checked;
11256
+ this.currentIndeterminateState = this.isIndeterminate;
11257
+ this.treeview.nodes.map(function (_value, index) {
11258
+ var itemIndex = String(index);
11259
+ var itemLookup = _this.treeview.itemLookup(itemIndex);
11260
+ _this.checkNode(itemLookup);
11261
+ });
11262
+ this.checkedItemsChange.emit(this.checkedItems.slice());
11263
+ };
11264
+ Object.defineProperty(CheckAllDirective.prototype, "isIndeterminate", {
11265
+ get: function () {
11266
+ var _this = this;
11267
+ var isIndeterminate = this.treeview.nodes.some(function (_node, index) {
11268
+ var itemIndex = String(index);
11269
+ var itemLookup = _this.treeview.itemLookup(itemIndex);
11270
+ return _this.someChecked(itemLookup);
11271
+ });
11272
+ return this.isChecked ? false : isIndeterminate;
11273
+ },
11274
+ enumerable: true,
11275
+ configurable: true
11276
+ });
11277
+ Object.defineProperty(CheckAllDirective.prototype, "isChecked", {
11278
+ get: function () {
11279
+ var _this = this;
11280
+ var isChecked = this.treeview.nodes.every(function (_node, index) {
11281
+ var itemIndex = String(index);
11282
+ var itemLookup = _this.treeview.itemLookup(itemIndex);
11283
+ return _this.allChecked(itemLookup);
11284
+ });
11285
+ return isChecked;
11286
+ },
11287
+ enumerable: true,
11288
+ configurable: true
11289
+ });
11290
+ CheckAllDirective.prototype.ngOnChanges = function (changes) {
11291
+ if (isPresent(changes.checkedItems)) {
11292
+ this.updateItems();
11293
+ this.renderer.setProperty(this.element.nativeElement, 'checked', this.isChecked);
11294
+ this.renderer.setProperty(this.element.nativeElement, 'indeterminate', this.isIndeterminate);
11295
+ }
11296
+ };
11297
+ CheckAllDirective.prototype.ngOnInit = function () {
11298
+ var _this = this;
11299
+ if (this.focused) {
11300
+ this.nextTick(function () { return _this.element.nativeElement.focus(); });
11301
+ }
11302
+ };
11303
+ CheckAllDirective.prototype.nextTick = function (fn) {
11304
+ this.zone.runOutsideAngular(function () { return setTimeout(fn); });
11305
+ };
11306
+ CheckAllDirective.prototype.checkNode = function (itemLookup) {
11307
+ var _this = this;
11308
+ if (this.treeview.isDisabled(itemLookup.item.dataItem, itemLookup.item.index)) {
11309
+ return;
11310
+ }
11311
+ var pendingCheck = [];
11312
+ var filter$$1 = function (item) {
11313
+ return _this.treeview.isVisible(item.dataItem, item.index) &&
11314
+ !_this.treeview.isDisabled(item.dataItem, item.index);
11315
+ };
11316
+ pendingCheck.push(itemLookup.item);
11317
+ fetchDescendentNodes(itemLookup, filter$$1)
11318
+ .forEach(function (lookup) { return pendingCheck.push(lookup.item); });
11319
+ pendingCheck.forEach(function (item) {
11320
+ if (_this.currentIndeterminateState) {
11321
+ _this.lastAction === 'check' ?
11322
+ _this.addItem(item) :
11323
+ _this.removeItem(item);
11324
+ return;
11325
+ }
11326
+ _this.currentCheckedState ?
11327
+ _this.addItem(item) :
11328
+ _this.removeItem(item);
11329
+ });
11330
+ };
11331
+ CheckAllDirective.prototype.allChecked = function (lookup) {
11332
+ var _this = this;
11333
+ var children = lookup && lookup.children;
11334
+ if (!Array.isArray(children)) {
11335
+ return;
11336
+ }
11337
+ var childrenChecked = children.every(function (child) {
11338
+ if (child.children.length) {
11339
+ return _this.isItemChecked(child.item) && _this.allChecked(child);
11340
+ }
11341
+ return _this.isItemChecked(child.item);
11342
+ });
11343
+ return childrenChecked && this.isItemChecked(lookup.item);
11344
+ };
11345
+ CheckAllDirective.prototype.someChecked = function (lookup) {
11346
+ var _this = this;
11347
+ var children = lookup && lookup.children;
11348
+ if (!Array.isArray(children)) {
11349
+ return;
11350
+ }
11351
+ var childrenChecked = children.some(function (child) {
11352
+ if (child.children.length) {
11353
+ return _this.isItemChecked(child.item) || _this.someChecked(child);
11354
+ }
11355
+ return _this.isItemChecked(child.item);
11356
+ });
11357
+ return childrenChecked || this.isItemChecked(lookup.item);
11358
+ };
11359
+ __decorate([
11360
+ Input(),
11361
+ __metadata("design:type", String)
11362
+ ], CheckAllDirective.prototype, "lastAction", void 0);
11363
+ __decorate([
11364
+ Input(),
11365
+ __metadata("design:type", TreeViewComponent)
11366
+ ], CheckAllDirective.prototype, "treeview", void 0);
11367
+ __decorate([
11368
+ Input(),
11369
+ __metadata("design:type", Array)
11370
+ ], CheckAllDirective.prototype, "checkedItems", void 0);
11371
+ __decorate([
11372
+ Input(),
11373
+ __metadata("design:type", Object)
11374
+ ], CheckAllDirective.prototype, "valueField", void 0);
11375
+ __decorate([
11376
+ Input('checkAll'),
11377
+ __metadata("design:type", Boolean)
11378
+ ], CheckAllDirective.prototype, "focused", void 0);
11379
+ __decorate([
11380
+ Output(),
11381
+ __metadata("design:type", EventEmitter)
11382
+ ], CheckAllDirective.prototype, "checkedItemsChange", void 0);
11383
+ __decorate([
11384
+ HostListener('change', ['$event.target']),
11385
+ __metadata("design:type", Function),
11386
+ __metadata("design:paramtypes", [Object]),
11387
+ __metadata("design:returntype", void 0)
11388
+ ], CheckAllDirective.prototype, "handleChange", null);
11389
+ CheckAllDirective = __decorate([
11390
+ Directive({
11391
+ selector: '[checkAll]' // tslint:disable-line
11392
+ }),
11393
+ __metadata("design:paramtypes", [ElementRef, NgZone, ChangeDetectorRef, Renderer2])
11394
+ ], CheckAllDirective);
11395
+ return CheckAllDirective;
11396
+ }(BaseCheckDirective));
11136
11397
 
11137
11398
  var INTERNAL_DIRECTIVES = [
11138
11399
  ListComponent,
@@ -11141,7 +11402,8 @@ var INTERNAL_DIRECTIVES = [
11141
11402
  SearchBarComponent,
11142
11403
  TemplateContextDirective,
11143
11404
  TagListComponent,
11144
- CheckDirective
11405
+ CheckDirective,
11406
+ CheckAllDirective
11145
11407
  ];
11146
11408
  /**
11147
11409
  * @hidden
@@ -11471,4 +11733,4 @@ var DropDownsModule = /** @class */ (function () {
11471
11733
  * Generated bundle index. Do not edit.
11472
11734
  */
11473
11735
 
11474
- export { AUTOCOMPLETE_VALUE_ACCESSOR, COMBOBOX_VALUE_ACCESSOR, TOUCH_ENABLED, DataService, DisabledItemsService, FilterInputDirective, FilterableComponent, ListItemDirective, CustomMessagesComponent, LocalizedMessagesDirective, Messages, NavigationService, SearchBarComponent, SelectionService, TagListComponent, NoDataTemplateDirective, TagTemplateDirective, DROPDOWNLIST_VALUE_ACCESSOR, CheckDirective, MultiSelectTreeSummaryTagDirective, AutoCompleteComponent, ComboBoxComponent, DropDownListComponent, MultiSelectComponent, MultiColumnComboBoxComponent, ComboBoxColumnComponent, ColumnCellTemplateDirective, ColumnHeaderTemplateDirective, DropDownTreeComponent, MultiSelectTreeComponent, DropDownTreeFlatBindingDirective, DropDownTreeHierarchyBindingDirective, MultiSelectTreeFlatBindingDirective, MultiSelectTreeHierarchyBindingDirective, DropDownTreesExpandDirective, DropDownTreesModule, NodeTemplateDirective, ItemTemplateDirective, GroupTemplateDirective, FixedGroupTemplateDirective, CustomItemTemplateDirective, HeaderTemplateDirective, FooterTemplateDirective, ValueTemplateDirective, TemplateContextDirective, GroupTagTemplateDirective, SelectableDirective, SummaryTagDirective, FilterDirective, DropDownsModule, MultiSelectModule, SharedModule, AutoCompleteModule, ComboBoxModule, DropDownListModule, SharedDirectivesModule, ListComponent, PreventableEvent, RemoveTagEvent };
11736
+ export { AUTOCOMPLETE_VALUE_ACCESSOR, COMBOBOX_VALUE_ACCESSOR, TOUCH_ENABLED, DataService, DisabledItemsService, FilterInputDirective, FilterableComponent, ListItemDirective, CustomMessagesComponent, LocalizedMessagesDirective, Messages, NavigationService, SearchBarComponent, SelectionService, TagListComponent, NoDataTemplateDirective, TagTemplateDirective, DROPDOWNLIST_VALUE_ACCESSOR, BaseCheckDirective, CheckAllDirective, CheckDirective, MultiSelectTreeSummaryTagDirective, AutoCompleteComponent, ComboBoxComponent, DropDownListComponent, MultiSelectComponent, MultiColumnComboBoxComponent, ComboBoxColumnComponent, ColumnCellTemplateDirective, ColumnHeaderTemplateDirective, DropDownTreeComponent, MultiSelectTreeComponent, DropDownTreeFlatBindingDirective, DropDownTreeHierarchyBindingDirective, MultiSelectTreeFlatBindingDirective, MultiSelectTreeHierarchyBindingDirective, DropDownTreesExpandDirective, DropDownTreesModule, NodeTemplateDirective, ItemTemplateDirective, GroupTemplateDirective, FixedGroupTemplateDirective, CustomItemTemplateDirective, HeaderTemplateDirective, FooterTemplateDirective, ValueTemplateDirective, TemplateContextDirective, GroupTagTemplateDirective, SelectableDirective, SummaryTagDirective, FilterDirective, DropDownsModule, MultiSelectModule, SharedModule, AutoCompleteModule, ComboBoxModule, DropDownListModule, SharedDirectivesModule, ListComponent, PreventableEvent, RemoveTagEvent };