@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
@@ -396,7 +396,7 @@ var ListComponent = /** @class */ (function () {
396
396
  ListComponent = tslib_1.__decorate([
397
397
  Component({
398
398
  selector: 'kendo-list',
399
- 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 "
399
+ 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 "
400
400
  }),
401
401
  tslib_1.__metadata("design:paramtypes", [DataService,
402
402
  ElementRef,
@@ -21,6 +21,10 @@ var Messages = /** @class */ (function (_super) {
21
21
  Input(),
22
22
  tslib_1.__metadata("design:type", String)
23
23
  ], Messages.prototype, "clearTitle", void 0);
24
+ tslib_1.__decorate([
25
+ Input(),
26
+ tslib_1.__metadata("design:type", String)
27
+ ], Messages.prototype, "checkAllText", void 0);
24
28
  return Messages;
25
29
  }(ComponentMessages));
26
30
  export { Messages };
@@ -16,6 +16,7 @@ import { ListItemDirective } from './list-item.directive';
16
16
  import { SelectableDirective } from './selection/selectable.directive';
17
17
  import { TemplateContextDirective } from './templates/template-context.directive';
18
18
  import { CheckDirective } from '../dropdowntrees/checked-state/check.directive';
19
+ import { CheckAllDirective } from '../dropdowntrees/checked-state/check-all.directive';
19
20
  var INTERNAL_DIRECTIVES = [
20
21
  ListComponent,
21
22
  ListItemDirective,
@@ -23,7 +24,8 @@ var INTERNAL_DIRECTIVES = [
23
24
  SearchBarComponent,
24
25
  TemplateContextDirective,
25
26
  TagListComponent,
26
- CheckDirective
27
+ CheckDirective,
28
+ CheckAllDirective
27
29
  ];
28
30
  /**
29
31
  * @hidden
@@ -0,0 +1,54 @@
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
+ import * as tslib_1 from "tslib";
6
+ import { Input } from '@angular/core';
7
+ import { getHierarchicalItemLevel, valueFrom } from '../../common/util';
8
+ /**
9
+ * @hidden
10
+ *
11
+ * A directive which manages the in-memory checked state of the MultiSelectTree nodes.
12
+ */
13
+ var BaseCheckDirective = /** @class */ (function () {
14
+ function BaseCheckDirective() {
15
+ }
16
+ BaseCheckDirective.prototype.addItem = function (item) {
17
+ if (this.isItemChecked(item)) {
18
+ return;
19
+ }
20
+ var level = getHierarchicalItemLevel(item.index);
21
+ var candidate = tslib_1.__assign({}, item, { level: level });
22
+ this.checkedItems.push(candidate);
23
+ this.checkedKeys.add(valueFrom(candidate, this.valueField));
24
+ };
25
+ BaseCheckDirective.prototype.removeItem = function (item) {
26
+ var _this = this;
27
+ if (!this.isItemChecked(item)) {
28
+ return;
29
+ }
30
+ var level = getHierarchicalItemLevel(item.index);
31
+ var candidate = tslib_1.__assign({}, item, { level: level });
32
+ this.checkedItems = this.checkedItems
33
+ .filter(function (item) { return valueFrom(item, _this.valueField) !== valueFrom(candidate, _this.valueField); });
34
+ this.checkedKeys.delete(valueFrom(candidate, this.valueField));
35
+ };
36
+ BaseCheckDirective.prototype.isItemChecked = function (item) {
37
+ return this.checkedKeys.has(valueFrom(item, this.valueField));
38
+ };
39
+ BaseCheckDirective.prototype.updateItems = function () {
40
+ var _this = this;
41
+ this.checkedItems = this.checkedItems || [];
42
+ this.checkedKeys = new Set(this.checkedItems.map(function (item) { return valueFrom(item, _this.valueField); }));
43
+ };
44
+ tslib_1.__decorate([
45
+ Input(),
46
+ tslib_1.__metadata("design:type", Object)
47
+ ], BaseCheckDirective.prototype, "valueField", void 0);
48
+ tslib_1.__decorate([
49
+ Input(),
50
+ tslib_1.__metadata("design:type", Array)
51
+ ], BaseCheckDirective.prototype, "checkedItems", void 0);
52
+ return BaseCheckDirective;
53
+ }());
54
+ export { BaseCheckDirective };
@@ -0,0 +1,181 @@
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
+ import * as tslib_1 from "tslib";
6
+ import { ChangeDetectorRef, Directive, ElementRef, EventEmitter, HostListener, Input, NgZone, Output, Renderer2 } from '@angular/core';
7
+ import { TreeViewComponent } from '@progress/kendo-angular-treeview';
8
+ import { fetchDescendentNodes, isPresent } from '../../common/util';
9
+ import { BaseCheckDirective } from './base-check.directive';
10
+ /**
11
+ * @hidden
12
+ *
13
+ * A directive which manages the in-memory checked state of the MultiSelectTree nodes.
14
+ */
15
+ var CheckAllDirective = /** @class */ (function (_super) {
16
+ tslib_1.__extends(CheckAllDirective, _super);
17
+ function CheckAllDirective(element, zone, cdr, renderer) {
18
+ var _this = _super.call(this) || this;
19
+ _this.element = element;
20
+ _this.zone = zone;
21
+ _this.cdr = cdr;
22
+ _this.renderer = renderer;
23
+ /**
24
+ * Fires when the `checkedItems` collection was updated.
25
+ */
26
+ _this.checkedItemsChange = new EventEmitter();
27
+ /**
28
+ * Holds a Set with just the checked item keys.
29
+ *
30
+ * Should be updated each time the `checkedItems` value or content is changed.
31
+ * Can be used for efficient look-up of whether an item is checked or not (O(1) access time).
32
+ */
33
+ _this.checkedKeys = new Set();
34
+ return _this;
35
+ }
36
+ CheckAllDirective.prototype.handleChange = function (event) {
37
+ var _this = this;
38
+ // Need to store the current checkbox state at the moment of click
39
+ this.currentCheckedState = event.checked;
40
+ this.currentIndeterminateState = this.isIndeterminate;
41
+ this.treeview.nodes.map(function (_value, index) {
42
+ var itemIndex = String(index);
43
+ var itemLookup = _this.treeview.itemLookup(itemIndex);
44
+ _this.checkNode(itemLookup);
45
+ });
46
+ this.checkedItemsChange.emit(this.checkedItems.slice());
47
+ };
48
+ Object.defineProperty(CheckAllDirective.prototype, "isIndeterminate", {
49
+ get: function () {
50
+ var _this = this;
51
+ var isIndeterminate = this.treeview.nodes.some(function (_node, index) {
52
+ var itemIndex = String(index);
53
+ var itemLookup = _this.treeview.itemLookup(itemIndex);
54
+ return _this.someChecked(itemLookup);
55
+ });
56
+ return this.isChecked ? false : isIndeterminate;
57
+ },
58
+ enumerable: true,
59
+ configurable: true
60
+ });
61
+ Object.defineProperty(CheckAllDirective.prototype, "isChecked", {
62
+ get: function () {
63
+ var _this = this;
64
+ var isChecked = this.treeview.nodes.every(function (_node, index) {
65
+ var itemIndex = String(index);
66
+ var itemLookup = _this.treeview.itemLookup(itemIndex);
67
+ return _this.allChecked(itemLookup);
68
+ });
69
+ return isChecked;
70
+ },
71
+ enumerable: true,
72
+ configurable: true
73
+ });
74
+ CheckAllDirective.prototype.ngOnChanges = function (changes) {
75
+ if (isPresent(changes.checkedItems)) {
76
+ this.updateItems();
77
+ this.renderer.setProperty(this.element.nativeElement, 'checked', this.isChecked);
78
+ this.renderer.setProperty(this.element.nativeElement, 'indeterminate', this.isIndeterminate);
79
+ }
80
+ };
81
+ CheckAllDirective.prototype.ngOnInit = function () {
82
+ var _this = this;
83
+ if (this.focused) {
84
+ this.nextTick(function () { return _this.element.nativeElement.focus(); });
85
+ }
86
+ };
87
+ CheckAllDirective.prototype.nextTick = function (fn) {
88
+ this.zone.runOutsideAngular(function () { return setTimeout(fn); });
89
+ };
90
+ CheckAllDirective.prototype.checkNode = function (itemLookup) {
91
+ var _this = this;
92
+ if (this.treeview.isDisabled(itemLookup.item.dataItem, itemLookup.item.index)) {
93
+ return;
94
+ }
95
+ var pendingCheck = [];
96
+ var filter = function (item) {
97
+ return _this.treeview.isVisible(item.dataItem, item.index) &&
98
+ !_this.treeview.isDisabled(item.dataItem, item.index);
99
+ };
100
+ pendingCheck.push(itemLookup.item);
101
+ fetchDescendentNodes(itemLookup, filter)
102
+ .forEach(function (lookup) { return pendingCheck.push(lookup.item); });
103
+ pendingCheck.forEach(function (item) {
104
+ if (_this.currentIndeterminateState) {
105
+ _this.lastAction === 'check' ?
106
+ _this.addItem(item) :
107
+ _this.removeItem(item);
108
+ return;
109
+ }
110
+ _this.currentCheckedState ?
111
+ _this.addItem(item) :
112
+ _this.removeItem(item);
113
+ });
114
+ };
115
+ CheckAllDirective.prototype.allChecked = function (lookup) {
116
+ var _this = this;
117
+ var children = lookup && lookup.children;
118
+ if (!Array.isArray(children)) {
119
+ return;
120
+ }
121
+ var childrenChecked = children.every(function (child) {
122
+ if (child.children.length) {
123
+ return _this.isItemChecked(child.item) && _this.allChecked(child);
124
+ }
125
+ return _this.isItemChecked(child.item);
126
+ });
127
+ return childrenChecked && this.isItemChecked(lookup.item);
128
+ };
129
+ CheckAllDirective.prototype.someChecked = function (lookup) {
130
+ var _this = this;
131
+ var children = lookup && lookup.children;
132
+ if (!Array.isArray(children)) {
133
+ return;
134
+ }
135
+ var childrenChecked = children.some(function (child) {
136
+ if (child.children.length) {
137
+ return _this.isItemChecked(child.item) || _this.someChecked(child);
138
+ }
139
+ return _this.isItemChecked(child.item);
140
+ });
141
+ return childrenChecked || this.isItemChecked(lookup.item);
142
+ };
143
+ tslib_1.__decorate([
144
+ Input(),
145
+ tslib_1.__metadata("design:type", String)
146
+ ], CheckAllDirective.prototype, "lastAction", void 0);
147
+ tslib_1.__decorate([
148
+ Input(),
149
+ tslib_1.__metadata("design:type", TreeViewComponent)
150
+ ], CheckAllDirective.prototype, "treeview", void 0);
151
+ tslib_1.__decorate([
152
+ Input(),
153
+ tslib_1.__metadata("design:type", Array)
154
+ ], CheckAllDirective.prototype, "checkedItems", void 0);
155
+ tslib_1.__decorate([
156
+ Input(),
157
+ tslib_1.__metadata("design:type", Object)
158
+ ], CheckAllDirective.prototype, "valueField", void 0);
159
+ tslib_1.__decorate([
160
+ Input('checkAll'),
161
+ tslib_1.__metadata("design:type", Boolean)
162
+ ], CheckAllDirective.prototype, "focused", void 0);
163
+ tslib_1.__decorate([
164
+ Output(),
165
+ tslib_1.__metadata("design:type", EventEmitter)
166
+ ], CheckAllDirective.prototype, "checkedItemsChange", void 0);
167
+ tslib_1.__decorate([
168
+ HostListener('change', ['$event.target']),
169
+ tslib_1.__metadata("design:type", Function),
170
+ tslib_1.__metadata("design:paramtypes", [Object]),
171
+ tslib_1.__metadata("design:returntype", void 0)
172
+ ], CheckAllDirective.prototype, "handleChange", null);
173
+ CheckAllDirective = tslib_1.__decorate([
174
+ Directive({
175
+ selector: '[checkAll]' // tslint:disable-line
176
+ }),
177
+ tslib_1.__metadata("design:paramtypes", [ElementRef, NgZone, ChangeDetectorRef, Renderer2])
178
+ ], CheckAllDirective);
179
+ return CheckAllDirective;
180
+ }(BaseCheckDirective));
181
+ export { CheckAllDirective };
@@ -7,39 +7,41 @@ import { Directive, EventEmitter, Input, Output } from '@angular/core';
7
7
  import { TreeViewComponent } from '@progress/kendo-angular-treeview';
8
8
  import { Subscription } from 'rxjs';
9
9
  import { filter } from 'rxjs/operators';
10
- import { fetchDescendentNodes, getHierarchicalItemLevel, isPresent, valueFrom } from '../../common/util';
10
+ import { fetchDescendentNodes, isPresent } from '../../common/util';
11
+ import { BaseCheckDirective } from './base-check.directive';
11
12
  /**
12
13
  * @hidden
13
14
  *
14
15
  * A directive which manages the in-memory checked state of the MultiSelectTree nodes.
15
16
  */
16
- var CheckDirective = /** @class */ (function () {
17
+ var CheckDirective = /** @class */ (function (_super) {
18
+ tslib_1.__extends(CheckDirective, _super);
17
19
  function CheckDirective(treeView) {
18
- this.treeView = treeView;
20
+ var _this = _super.call(this) || this;
21
+ _this.treeView = treeView;
19
22
  /**
20
23
  * Fires when the `checkedItems` collection was updated.
21
24
  */
22
- this.checkedItemsChange = new EventEmitter();
25
+ _this.checkedItemsChange = new EventEmitter();
23
26
  /**
24
27
  * Holds a Set with just the checked item keys.
25
28
  *
26
29
  * Should be updated each time the `checkedItems` value or content is changed.
27
30
  * Can be used for efficient look-up of whether an item is checked or not (O(1) access time).
28
31
  */
29
- this.checkedKeys = new Set();
30
- this.subscriptions = new Subscription();
31
- this.subscriptions.add(this.treeView.checkedChange
32
- .subscribe(this.handleCheckedChange.bind(this)));
33
- this.treeView.isChecked = this.getCheckedState.bind(this);
32
+ _this.checkedKeys = new Set();
33
+ _this.subscriptions = new Subscription();
34
+ _this.subscriptions.add(_this.treeView.checkedChange
35
+ .subscribe(_this.handleCheckedChange.bind(_this)));
36
+ _this.treeView.isChecked = _this.getCheckedState.bind(_this);
37
+ return _this;
34
38
  }
35
39
  CheckDirective.prototype.ngOnChanges = function (changes) {
36
- var _this = this;
37
40
  if (isPresent(changes.checkable)) {
38
41
  this.toggleCheckOnClick();
39
42
  }
40
43
  if (isPresent(changes.checkedItems)) {
41
- this.checkedItems = this.checkedItems || [];
42
- this.checkedKeys = new Set(this.checkedItems.map(function (item) { return valueFrom(item, _this.valueField); }));
44
+ this.updateItems();
43
45
  }
44
46
  };
45
47
  CheckDirective.prototype.ngOnDestroy = function () {
@@ -124,29 +126,6 @@ var CheckDirective = /** @class */ (function () {
124
126
  currentParent = currentParent.parent;
125
127
  }
126
128
  };
127
- CheckDirective.prototype.addItem = function (item) {
128
- if (this.isItemChecked(item)) {
129
- return;
130
- }
131
- var level = getHierarchicalItemLevel(item.index);
132
- var candidate = tslib_1.__assign({}, item, { level: level });
133
- this.checkedItems.push(candidate);
134
- this.checkedKeys.add(valueFrom(candidate, this.valueField));
135
- };
136
- CheckDirective.prototype.removeItem = function (item) {
137
- var _this = this;
138
- if (!this.isItemChecked(item)) {
139
- return;
140
- }
141
- var level = getHierarchicalItemLevel(item.index);
142
- var candidate = tslib_1.__assign({}, item, { level: level });
143
- this.checkedItems = this.checkedItems
144
- .filter(function (item) { return valueFrom(item, _this.valueField) !== valueFrom(candidate, _this.valueField); });
145
- this.checkedKeys.delete(valueFrom(candidate, this.valueField));
146
- };
147
- CheckDirective.prototype.isItemChecked = function (item) {
148
- return this.checkedKeys.has(valueFrom(item, this.valueField));
149
- };
150
129
  CheckDirective.prototype.isItemIndeterminate = function (lookup) {
151
130
  var children = lookup.children;
152
131
  if (!Array.isArray(children) || children.length === 0) {
@@ -186,5 +165,5 @@ var CheckDirective = /** @class */ (function () {
186
165
  tslib_1.__metadata("design:paramtypes", [TreeViewComponent])
187
166
  ], CheckDirective);
188
167
  return CheckDirective;
189
- }());
168
+ }(BaseCheckDirective));
190
169
  export { CheckDirective };
@@ -166,6 +166,10 @@ var DropDownTreeComponent = /** @class */ (function () {
166
166
  * @hidden
167
167
  */
168
168
  this.selectedKeys = [];
169
+ /**
170
+ * @hidden
171
+ */
172
+ this.filterStateChange = new EventEmitter();
169
173
  /**
170
174
  * @hidden
171
175
  */
@@ -106,6 +106,12 @@ var MultiSelectTreeComponent = /** @class */ (function () {
106
106
  * @default false
107
107
  */
108
108
  this.filterable = false;
109
+ /**
110
+ * If `checkАll` is set to `true` and the checkboxes are enabled, a tri-state checkbox appears above the embedded treeview.
111
+ * Clicking the checkbox checks or unchecks all enabled items of the treeview that are loaded.
112
+ * @default false
113
+ */
114
+ this.checkAll = false;
109
115
  /**
110
116
  * A function which determines if a specific node has child nodes.
111
117
  */
@@ -180,6 +186,10 @@ var MultiSelectTreeComponent = /** @class */ (function () {
180
186
  * Fires when the value of the built-in filter input element changes.
181
187
  */
182
188
  this.filterChange = new EventEmitter();
189
+ /**
190
+ * @hidden
191
+ */
192
+ this.filterStateChange = new EventEmitter();
183
193
  /**
184
194
  * @hidden
185
195
  */
@@ -205,6 +215,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
205
215
  this._checkableSettings = DEFAULT_CHECKABLE_SETTINGS;
206
216
  this._isFocused = false;
207
217
  this.subscriptions = [];
218
+ this.lastAction = 'check';
208
219
  this.onTouchedCallback = noop;
209
220
  this.onChangeCallback = noop;
210
221
  this.direction = localization.rtl ? 'rtl' : 'ltr';
@@ -220,7 +231,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
220
231
  this._treeview = treeview;
221
232
  if (treeview) {
222
233
  // If filtering is enabled, focus the TreeView on mobile devices instead of the filter input
223
- if (this.isFocused && !this.filterable || this.touchEnabled) {
234
+ if (this.isFocused && !this.filterable && !this.checkAll || this.touchEnabled) {
224
235
  treeview.focus();
225
236
  }
226
237
  /**
@@ -541,6 +552,20 @@ var MultiSelectTreeComponent = /** @class */ (function () {
541
552
  enumerable: true,
542
553
  configurable: true
543
554
  });
555
+ Object.defineProperty(MultiSelectTreeComponent.prototype, "isFilterActive", {
556
+ get: function () {
557
+ return this.filterInput && document.activeElement === this.filterInput.nativeElement;
558
+ },
559
+ enumerable: true,
560
+ configurable: true
561
+ });
562
+ Object.defineProperty(MultiSelectTreeComponent.prototype, "isCheckAllActive", {
563
+ get: function () {
564
+ return this.checkAllInput && document.activeElement === this.checkAllInput.nativeElement;
565
+ },
566
+ enumerable: true,
567
+ configurable: true
568
+ });
544
569
  MultiSelectTreeComponent.prototype.ngOnInit = function () {
545
570
  var _this = this;
546
571
  this.renderer.removeAttribute(this.hostElement.nativeElement, 'tabindex');
@@ -764,6 +789,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
764
789
  */
765
790
  MultiSelectTreeComponent.prototype.handleCheckedItemsChange = function (items) {
766
791
  this.valueDepth = items.map(function (item) { return item.level; });
792
+ this.lastAction = items.length > this.dataItems.length ? 'check' : 'uncheck';
767
793
  this.dataItems = items.slice();
768
794
  this.updateValue(this.dataItems);
769
795
  };
@@ -785,12 +811,12 @@ var MultiSelectTreeComponent = /** @class */ (function () {
785
811
  if (tag instanceof Array) {
786
812
  // Remove group tag
787
813
  this.dataItems = this.dataItems.filter(function (_item, i) { return i < _this.showAfter || _this.disabledIndices.has(i); });
788
- this.valueDepth = this.valueDepth.filter(function (_item, i) { return i < _this.showAfter; });
814
+ this.valueDepth = this.valueDepth.filter(function (_item, i) { return i < _this.showAfter || _this.disabledIndices.has(i); });
789
815
  }
790
816
  else {
791
817
  // Remove single tag
792
- this.dataItems = this.dataItems.filter(function (_item, i) { return i !== index; });
793
- this.valueDepth = this.valueDepth.filter(function (_item, i) { return i !== index; });
818
+ this.dataItems = this.dataItems.filter(function (_item, i) { return i !== index || _this.disabledIndices.has(i); });
819
+ this.valueDepth = this.valueDepth.filter(function (_item, i) { return i !== index || _this.disabledIndices.has(i); });
794
820
  }
795
821
  this.updateValue(this.dataItems);
796
822
  // focus the wrapper if the component is not focused - the floating label reacts to focus/blur
@@ -816,7 +842,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
816
842
  this.value = this.value.filter(function (_item, index) { return _this.disabledIndices.has(index); });
817
843
  this.dataItems = this.dataItems.filter(function (_item, index) { return _this.disabledIndices.has(index); });
818
844
  this.valueDepth = this.valueDepth.filter(function (_depth, index) { return _this.disabledIndices.has(index); });
819
- this.emitValueChange();
845
+ this.emitValueChange(this.value);
820
846
  };
821
847
  /**
822
848
  * @hidden
@@ -856,6 +882,13 @@ var MultiSelectTreeComponent = /** @class */ (function () {
856
882
  this.filterChange.next(term);
857
883
  this.allNodesHidden = this.nodes.every(function (node, index) { return !_this.isVisible(node, String(index)); });
858
884
  };
885
+ /**
886
+ * @hidden
887
+ */
888
+ MultiSelectTreeComponent.prototype.toggleCheckAll = function () {
889
+ this.checkAllInput.nativeElement.focus();
890
+ this.checkAllInput.nativeElement.click();
891
+ };
859
892
  MultiSelectTreeComponent.prototype.verifySettings = function () {
860
893
  if (!isDevMode()) {
861
894
  return;
@@ -981,17 +1014,20 @@ var MultiSelectTreeComponent = /** @class */ (function () {
981
1014
  return;
982
1015
  }
983
1016
  var isFirstNodeActive = this.treeview['navigationService']['activeIndex'] === '0';
984
- if (this.filterable) {
985
- var isFilterActive = this.filterInput.nativeElement === document.activeElement;
986
- if (isFilterActive) {
987
- this.focus();
988
- }
989
- else if (!isFilterActive && isFirstNodeActive) {
990
- this.filterInput.nativeElement.focus();
991
- }
992
- }
993
- if (!this.filterable && isFirstNodeActive) {
1017
+ // Current focus is on the filter input => should focus the wrapper
1018
+ if (this.filterable && this.isFilterActive) {
994
1019
  this.focus();
1020
+ // Current focus is on the treeview first node => should focus the check all checkbox if enabled
1021
+ }
1022
+ else if (this.checkAll && !this.isCheckAllActive && isFirstNodeActive) {
1023
+ this.checkAllInput.nativeElement.focus();
1024
+ // Current focus is either on the check all checkbox or the treeview's first node
1025
+ // => should focus either the filter input (if enabled) or the wrapper
1026
+ }
1027
+ else if (this.isCheckAllActive || isFirstNodeActive) {
1028
+ this.filterable ?
1029
+ this.filterInput.nativeElement.focus() :
1030
+ this.focus();
995
1031
  }
996
1032
  };
997
1033
  MultiSelectTreeComponent.prototype.handleDownKey = function (event) {
@@ -999,9 +1035,14 @@ var MultiSelectTreeComponent = /** @class */ (function () {
999
1035
  return;
1000
1036
  }
1001
1037
  event.originalEvent.preventDefault();
1002
- // Put the focus back on the filter input if the wrapper is focused
1038
+ // Current focus is on the wrapper => should focus the filter input
1003
1039
  if (this.filterable && this.isWrapperActive) {
1004
1040
  this.filterInput.nativeElement.focus();
1041
+ // Current focus is on the wrapper/filter input => should focus check all checkbox if enabled
1042
+ }
1043
+ else if (this.checkAll && (this.isWrapperActive || this.isFilterActive)) {
1044
+ this.checkAllInput.nativeElement.focus();
1045
+ // Should focus the treeview if filterable and check all are disabled
1005
1046
  }
1006
1047
  else if (!this.treeview.isActive) {
1007
1048
  this.treeview.focus();
@@ -1162,6 +1203,10 @@ var MultiSelectTreeComponent = /** @class */ (function () {
1162
1203
  ViewChild('filterInput', { static: false }),
1163
1204
  tslib_1.__metadata("design:type", ElementRef)
1164
1205
  ], MultiSelectTreeComponent.prototype, "filterInput", void 0);
1206
+ tslib_1.__decorate([
1207
+ ViewChild('checkAllInput', { static: false }),
1208
+ tslib_1.__metadata("design:type", ElementRef)
1209
+ ], MultiSelectTreeComponent.prototype, "checkAllInput", void 0);
1165
1210
  tslib_1.__decorate([
1166
1211
  Input(),
1167
1212
  tslib_1.__metadata("design:type", Number),
@@ -1244,6 +1289,10 @@ var MultiSelectTreeComponent = /** @class */ (function () {
1244
1289
  Input(),
1245
1290
  tslib_1.__metadata("design:type", Boolean)
1246
1291
  ], MultiSelectTreeComponent.prototype, "filterable", void 0);
1292
+ tslib_1.__decorate([
1293
+ Input(),
1294
+ tslib_1.__metadata("design:type", Boolean)
1295
+ ], MultiSelectTreeComponent.prototype, "checkAll", void 0);
1247
1296
  tslib_1.__decorate([
1248
1297
  Input(),
1249
1298
  tslib_1.__metadata("design:type", Function)
@@ -1344,7 +1393,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
1344
1393
  }
1345
1394
  ],
1346
1395
  selector: 'kendo-multiselecttree',
1347
- 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 "
1396
+ 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 "
1348
1397
  }),
1349
1398
  tslib_1.__param(7, Optional()), tslib_1.__param(7, Inject(TOUCH_ENABLED)),
1350
1399
  tslib_1.__metadata("design:paramtypes", [PopupService,
package/dist/es/index.js CHANGED
@@ -24,5 +24,7 @@ export { TagListComponent } from './common/taglist.component';
24
24
  export { NoDataTemplateDirective } from './common/templates/no-data-template.directive';
25
25
  export { TagTemplateDirective } from './common/templates/tag-template.directive';
26
26
  export { DROPDOWNLIST_VALUE_ACCESSOR } from './dropdownlist/dropdownlist.component';
27
+ export { BaseCheckDirective } from './dropdowntrees/checked-state/base-check.directive';
28
+ export { CheckAllDirective } from './dropdowntrees/checked-state/check-all.directive';
27
29
  export { CheckDirective } from './dropdowntrees/checked-state/check.directive';
28
30
  export { MultiSelectTreeSummaryTagDirective } from './dropdowntrees/summary-tag/summary-tag.directive';
@@ -1006,7 +1006,11 @@ var MultiSelectComponent = /** @class */ (function () {
1006
1006
  data = data.filter(function (item) { return !item.header; }).map(function (item) { return item.value; });
1007
1007
  }
1008
1008
  var dataItemValues = new Set(dataItems.map(function (item) { return getter(item, _this.valueField); }));
1009
- this.value = this.value.filter(function (value) { return !dataItemValues.has(getter(value, _this.valueField)); });
1009
+ this.value = this.value.filter(function (value) {
1010
+ var index = selectedIndices([value], data, _this.valueField)[0];
1011
+ var isDataItemDisabled = _this.disabledItemsService.isIndexDisabled(index);
1012
+ return !dataItemValues.has(getter(value, _this.valueField)) || isDataItemDisabled;
1013
+ });
1010
1014
  this.emitValueChange();
1011
1015
  };
1012
1016
  MultiSelectComponent.prototype.removeSingleTag = function (dataItem) {
@@ -1016,6 +1020,9 @@ var MultiSelectComponent = /** @class */ (function () {
1016
1020
  data = data.filter(function (item) { return !item.header; }).map(function (item) { return item.value; });
1017
1021
  }
1018
1022
  var index = selectedIndices([dataItem], data, this.valueField)[0];
1023
+ if (this.disabledItemsService.isIndexDisabled(index)) {
1024
+ return;
1025
+ }
1019
1026
  if (isNumber(index)) {
1020
1027
  this.selectionService.unselect(index);
1021
1028
  this.selectionService.focused = index;