@progress/kendo-angular-dropdowns 5.4.0-dev.202107201315 → 5.5.0-dev.202110291622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-dropdowns.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/filtering/filter.directive.js +1 -0
- package/dist/es/common/localization/messages.js +4 -0
- package/dist/es/common/shared.module.js +3 -1
- package/dist/es/dropdowntrees/checked-state/base-check.directive.js +54 -0
- package/dist/es/dropdowntrees/checked-state/check-all.directive.js +181 -0
- package/dist/es/dropdowntrees/checked-state/check.directive.js +15 -36
- package/dist/es/dropdowntrees/dropdowntree.component.js +1 -2
- package/dist/es/dropdowntrees/multiselecttree.component.js +58 -13
- package/dist/es/index.js +2 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es2015/common/filtering/filter.directive.d.ts +1 -0
- package/dist/es2015/common/filtering/filter.directive.js +1 -0
- package/dist/es2015/common/localization/messages.d.ts +4 -0
- package/dist/es2015/common/localization/messages.js +4 -0
- package/dist/es2015/common/shared.module.js +3 -1
- package/dist/es2015/dropdowntrees/checked-state/base-check.directive.d.ts +32 -0
- package/dist/es2015/dropdowntrees/checked-state/base-check.directive.js +48 -0
- package/dist/es2015/dropdowntrees/checked-state/check-all.directive.d.ts +53 -0
- package/dist/es2015/dropdowntrees/checked-state/check-all.directive.js +161 -0
- package/dist/es2015/dropdowntrees/checked-state/check.directive.d.ts +3 -5
- package/dist/es2015/dropdowntrees/checked-state/check.directive.js +5 -26
- package/dist/es2015/dropdowntrees/dropdowntree.component.js +1 -2
- package/dist/es2015/dropdowntrees/multiselecttree.component.d.ts +14 -0
- package/dist/es2015/dropdowntrees/multiselecttree.component.js +82 -15
- package/dist/es2015/index.d.ts +2 -0
- package/dist/es2015/index.js +2 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/fesm2015/index.js +289 -45
- package/dist/fesm5/index.js +300 -53
- package/dist/npm/common/filtering/filter.directive.js +1 -0
- package/dist/npm/common/localization/messages.js +4 -0
- package/dist/npm/common/shared.module.js +3 -1
- package/dist/npm/dropdowntrees/checked-state/base-check.directive.js +56 -0
- package/dist/npm/dropdowntrees/checked-state/check-all.directive.js +183 -0
- package/dist/npm/dropdowntrees/checked-state/check.directive.js +14 -35
- package/dist/npm/dropdowntrees/dropdowntree.component.js +1 -2
- package/dist/npm/dropdowntrees/multiselecttree.component.js +58 -13
- package/dist/npm/index.js +4 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-angular-dropdowns.js +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var kendo_angular_treeview_1 = require("@progress/kendo-angular-treeview");
|
|
10
|
+
var util_1 = require("../../common/util");
|
|
11
|
+
var base_check_directive_1 = require("./base-check.directive");
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*
|
|
15
|
+
* A directive which manages the in-memory checked state of the MultiSelectTree nodes.
|
|
16
|
+
*/
|
|
17
|
+
var CheckAllDirective = /** @class */ (function (_super) {
|
|
18
|
+
tslib_1.__extends(CheckAllDirective, _super);
|
|
19
|
+
function CheckAllDirective(element, zone, cdr, renderer) {
|
|
20
|
+
var _this = _super.call(this) || this;
|
|
21
|
+
_this.element = element;
|
|
22
|
+
_this.zone = zone;
|
|
23
|
+
_this.cdr = cdr;
|
|
24
|
+
_this.renderer = renderer;
|
|
25
|
+
/**
|
|
26
|
+
* Fires when the `checkedItems` collection was updated.
|
|
27
|
+
*/
|
|
28
|
+
_this.checkedItemsChange = new core_1.EventEmitter();
|
|
29
|
+
/**
|
|
30
|
+
* Holds a Set with just the checked item keys.
|
|
31
|
+
*
|
|
32
|
+
* Should be updated each time the `checkedItems` value or content is changed.
|
|
33
|
+
* Can be used for efficient look-up of whether an item is checked or not (O(1) access time).
|
|
34
|
+
*/
|
|
35
|
+
_this.checkedKeys = new Set();
|
|
36
|
+
return _this;
|
|
37
|
+
}
|
|
38
|
+
CheckAllDirective.prototype.handleChange = function (event) {
|
|
39
|
+
var _this = this;
|
|
40
|
+
// Need to store the current checkbox state at the moment of click
|
|
41
|
+
this.currentCheckedState = event.checked;
|
|
42
|
+
this.currentIndeterminateState = this.isIndeterminate;
|
|
43
|
+
this.treeview.nodes.map(function (_value, index) {
|
|
44
|
+
var itemIndex = String(index);
|
|
45
|
+
var itemLookup = _this.treeview.itemLookup(itemIndex);
|
|
46
|
+
_this.checkNode(itemLookup);
|
|
47
|
+
});
|
|
48
|
+
this.checkedItemsChange.emit(this.checkedItems.slice());
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(CheckAllDirective.prototype, "isIndeterminate", {
|
|
51
|
+
get: function () {
|
|
52
|
+
var _this = this;
|
|
53
|
+
var isIndeterminate = this.treeview.nodes.some(function (_node, index) {
|
|
54
|
+
var itemIndex = String(index);
|
|
55
|
+
var itemLookup = _this.treeview.itemLookup(itemIndex);
|
|
56
|
+
return _this.someChecked(itemLookup);
|
|
57
|
+
});
|
|
58
|
+
return this.isChecked ? false : isIndeterminate;
|
|
59
|
+
},
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(CheckAllDirective.prototype, "isChecked", {
|
|
64
|
+
get: function () {
|
|
65
|
+
var _this = this;
|
|
66
|
+
var isChecked = this.treeview.nodes.every(function (_node, index) {
|
|
67
|
+
var itemIndex = String(index);
|
|
68
|
+
var itemLookup = _this.treeview.itemLookup(itemIndex);
|
|
69
|
+
return _this.allChecked(itemLookup);
|
|
70
|
+
});
|
|
71
|
+
return isChecked;
|
|
72
|
+
},
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true
|
|
75
|
+
});
|
|
76
|
+
CheckAllDirective.prototype.ngOnChanges = function (changes) {
|
|
77
|
+
if (util_1.isPresent(changes.checkedItems)) {
|
|
78
|
+
this.updateItems();
|
|
79
|
+
this.renderer.setProperty(this.element.nativeElement, 'checked', this.isChecked);
|
|
80
|
+
this.renderer.setProperty(this.element.nativeElement, 'indeterminate', this.isIndeterminate);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
CheckAllDirective.prototype.ngOnInit = function () {
|
|
84
|
+
var _this = this;
|
|
85
|
+
if (this.focused) {
|
|
86
|
+
this.nextTick(function () { return _this.element.nativeElement.focus(); });
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
CheckAllDirective.prototype.nextTick = function (fn) {
|
|
90
|
+
this.zone.runOutsideAngular(function () { return setTimeout(fn); });
|
|
91
|
+
};
|
|
92
|
+
CheckAllDirective.prototype.checkNode = function (itemLookup) {
|
|
93
|
+
var _this = this;
|
|
94
|
+
if (this.treeview.isDisabled(itemLookup.item.dataItem, itemLookup.item.index)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
var pendingCheck = [];
|
|
98
|
+
var filter = function (item) {
|
|
99
|
+
return _this.treeview.isVisible(item.dataItem, item.index) &&
|
|
100
|
+
!_this.treeview.isDisabled(item.dataItem, item.index);
|
|
101
|
+
};
|
|
102
|
+
pendingCheck.push(itemLookup.item);
|
|
103
|
+
util_1.fetchDescendentNodes(itemLookup, filter)
|
|
104
|
+
.forEach(function (lookup) { return pendingCheck.push(lookup.item); });
|
|
105
|
+
pendingCheck.forEach(function (item) {
|
|
106
|
+
if (_this.currentIndeterminateState) {
|
|
107
|
+
_this.lastAction === 'check' ?
|
|
108
|
+
_this.addItem(item) :
|
|
109
|
+
_this.removeItem(item);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
_this.currentCheckedState ?
|
|
113
|
+
_this.addItem(item) :
|
|
114
|
+
_this.removeItem(item);
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
CheckAllDirective.prototype.allChecked = function (lookup) {
|
|
118
|
+
var _this = this;
|
|
119
|
+
var children = lookup && lookup.children;
|
|
120
|
+
if (!Array.isArray(children)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
var childrenChecked = children.every(function (child) {
|
|
124
|
+
if (child.children.length) {
|
|
125
|
+
return _this.isItemChecked(child.item) && _this.allChecked(child);
|
|
126
|
+
}
|
|
127
|
+
return _this.isItemChecked(child.item);
|
|
128
|
+
});
|
|
129
|
+
return childrenChecked && this.isItemChecked(lookup.item);
|
|
130
|
+
};
|
|
131
|
+
CheckAllDirective.prototype.someChecked = function (lookup) {
|
|
132
|
+
var _this = this;
|
|
133
|
+
var children = lookup && lookup.children;
|
|
134
|
+
if (!Array.isArray(children)) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
var childrenChecked = children.some(function (child) {
|
|
138
|
+
if (child.children.length) {
|
|
139
|
+
return _this.isItemChecked(child.item) || _this.someChecked(child);
|
|
140
|
+
}
|
|
141
|
+
return _this.isItemChecked(child.item);
|
|
142
|
+
});
|
|
143
|
+
return childrenChecked || this.isItemChecked(lookup.item);
|
|
144
|
+
};
|
|
145
|
+
tslib_1.__decorate([
|
|
146
|
+
core_1.Input(),
|
|
147
|
+
tslib_1.__metadata("design:type", String)
|
|
148
|
+
], CheckAllDirective.prototype, "lastAction", void 0);
|
|
149
|
+
tslib_1.__decorate([
|
|
150
|
+
core_1.Input(),
|
|
151
|
+
tslib_1.__metadata("design:type", kendo_angular_treeview_1.TreeViewComponent)
|
|
152
|
+
], CheckAllDirective.prototype, "treeview", void 0);
|
|
153
|
+
tslib_1.__decorate([
|
|
154
|
+
core_1.Input(),
|
|
155
|
+
tslib_1.__metadata("design:type", Array)
|
|
156
|
+
], CheckAllDirective.prototype, "checkedItems", void 0);
|
|
157
|
+
tslib_1.__decorate([
|
|
158
|
+
core_1.Input(),
|
|
159
|
+
tslib_1.__metadata("design:type", Object)
|
|
160
|
+
], CheckAllDirective.prototype, "valueField", void 0);
|
|
161
|
+
tslib_1.__decorate([
|
|
162
|
+
core_1.Input('checkAll'),
|
|
163
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
164
|
+
], CheckAllDirective.prototype, "focused", void 0);
|
|
165
|
+
tslib_1.__decorate([
|
|
166
|
+
core_1.Output(),
|
|
167
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
168
|
+
], CheckAllDirective.prototype, "checkedItemsChange", void 0);
|
|
169
|
+
tslib_1.__decorate([
|
|
170
|
+
core_1.HostListener('change', ['$event.target']),
|
|
171
|
+
tslib_1.__metadata("design:type", Function),
|
|
172
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
173
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
174
|
+
], CheckAllDirective.prototype, "handleChange", null);
|
|
175
|
+
CheckAllDirective = tslib_1.__decorate([
|
|
176
|
+
core_1.Directive({
|
|
177
|
+
selector: '[checkAll]' // tslint:disable-line
|
|
178
|
+
}),
|
|
179
|
+
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef, core_1.NgZone, core_1.ChangeDetectorRef, core_1.Renderer2])
|
|
180
|
+
], CheckAllDirective);
|
|
181
|
+
return CheckAllDirective;
|
|
182
|
+
}(base_check_directive_1.BaseCheckDirective));
|
|
183
|
+
exports.CheckAllDirective = CheckAllDirective;
|
|
@@ -10,38 +10,40 @@ var kendo_angular_treeview_1 = require("@progress/kendo-angular-treeview");
|
|
|
10
10
|
var rxjs_1 = require("rxjs");
|
|
11
11
|
var operators_1 = require("rxjs/operators");
|
|
12
12
|
var util_1 = require("../../common/util");
|
|
13
|
+
var base_check_directive_1 = require("./base-check.directive");
|
|
13
14
|
/**
|
|
14
15
|
* @hidden
|
|
15
16
|
*
|
|
16
17
|
* A directive which manages the in-memory checked state of the MultiSelectTree nodes.
|
|
17
18
|
*/
|
|
18
|
-
var CheckDirective = /** @class */ (function () {
|
|
19
|
+
var CheckDirective = /** @class */ (function (_super) {
|
|
20
|
+
tslib_1.__extends(CheckDirective, _super);
|
|
19
21
|
function CheckDirective(treeView) {
|
|
20
|
-
|
|
22
|
+
var _this = _super.call(this) || this;
|
|
23
|
+
_this.treeView = treeView;
|
|
21
24
|
/**
|
|
22
25
|
* Fires when the `checkedItems` collection was updated.
|
|
23
26
|
*/
|
|
24
|
-
|
|
27
|
+
_this.checkedItemsChange = new core_1.EventEmitter();
|
|
25
28
|
/**
|
|
26
29
|
* Holds a Set with just the checked item keys.
|
|
27
30
|
*
|
|
28
31
|
* Should be updated each time the `checkedItems` value or content is changed.
|
|
29
32
|
* Can be used for efficient look-up of whether an item is checked or not (O(1) access time).
|
|
30
33
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.subscribe(
|
|
35
|
-
|
|
34
|
+
_this.checkedKeys = new Set();
|
|
35
|
+
_this.subscriptions = new rxjs_1.Subscription();
|
|
36
|
+
_this.subscriptions.add(_this.treeView.checkedChange
|
|
37
|
+
.subscribe(_this.handleCheckedChange.bind(_this)));
|
|
38
|
+
_this.treeView.isChecked = _this.getCheckedState.bind(_this);
|
|
39
|
+
return _this;
|
|
36
40
|
}
|
|
37
41
|
CheckDirective.prototype.ngOnChanges = function (changes) {
|
|
38
|
-
var _this = this;
|
|
39
42
|
if (util_1.isPresent(changes.checkable)) {
|
|
40
43
|
this.toggleCheckOnClick();
|
|
41
44
|
}
|
|
42
45
|
if (util_1.isPresent(changes.checkedItems)) {
|
|
43
|
-
this.
|
|
44
|
-
this.checkedKeys = new Set(this.checkedItems.map(function (item) { return util_1.valueFrom(item, _this.valueField); }));
|
|
46
|
+
this.updateItems();
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
CheckDirective.prototype.ngOnDestroy = function () {
|
|
@@ -126,29 +128,6 @@ var CheckDirective = /** @class */ (function () {
|
|
|
126
128
|
currentParent = currentParent.parent;
|
|
127
129
|
}
|
|
128
130
|
};
|
|
129
|
-
CheckDirective.prototype.addItem = function (item) {
|
|
130
|
-
if (this.isItemChecked(item)) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
var level = util_1.getHierarchicalItemLevel(item.index);
|
|
134
|
-
var candidate = tslib_1.__assign({}, item, { level: level });
|
|
135
|
-
this.checkedItems.push(candidate);
|
|
136
|
-
this.checkedKeys.add(util_1.valueFrom(candidate, this.valueField));
|
|
137
|
-
};
|
|
138
|
-
CheckDirective.prototype.removeItem = function (item) {
|
|
139
|
-
var _this = this;
|
|
140
|
-
if (!this.isItemChecked(item)) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
var level = util_1.getHierarchicalItemLevel(item.index);
|
|
144
|
-
var candidate = tslib_1.__assign({}, item, { level: level });
|
|
145
|
-
this.checkedItems = this.checkedItems
|
|
146
|
-
.filter(function (item) { return util_1.valueFrom(item, _this.valueField) !== util_1.valueFrom(candidate, _this.valueField); });
|
|
147
|
-
this.checkedKeys.delete(util_1.valueFrom(candidate, this.valueField));
|
|
148
|
-
};
|
|
149
|
-
CheckDirective.prototype.isItemChecked = function (item) {
|
|
150
|
-
return this.checkedKeys.has(util_1.valueFrom(item, this.valueField));
|
|
151
|
-
};
|
|
152
131
|
CheckDirective.prototype.isItemIndeterminate = function (lookup) {
|
|
153
132
|
var children = lookup.children;
|
|
154
133
|
if (!Array.isArray(children) || children.length === 0) {
|
|
@@ -188,5 +167,5 @@ var CheckDirective = /** @class */ (function () {
|
|
|
188
167
|
tslib_1.__metadata("design:paramtypes", [kendo_angular_treeview_1.TreeViewComponent])
|
|
189
168
|
], CheckDirective);
|
|
190
169
|
return CheckDirective;
|
|
191
|
-
}());
|
|
170
|
+
}(base_check_directive_1.BaseCheckDirective));
|
|
192
171
|
exports.CheckDirective = CheckDirective;
|
|
@@ -640,8 +640,8 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
640
640
|
dataItem;
|
|
641
641
|
var shouldUpdateValue = newValue !== this.value;
|
|
642
642
|
if (shouldUpdateValue) {
|
|
643
|
-
this.dataItem = dataItem;
|
|
644
643
|
this.value = newValue;
|
|
644
|
+
this.dataItem = dataItem;
|
|
645
645
|
this.emitValueChange(this.value);
|
|
646
646
|
}
|
|
647
647
|
this.togglePopup(false);
|
|
@@ -848,7 +848,6 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
848
848
|
};
|
|
849
849
|
DropDownTreeComponent.prototype.clearState = function () {
|
|
850
850
|
this.text = undefined;
|
|
851
|
-
this.valueDepth = undefined;
|
|
852
851
|
this.selectedKeys = [];
|
|
853
852
|
};
|
|
854
853
|
DropDownTreeComponent.prototype.subscribeEvents = function () {
|
|
@@ -112,6 +112,12 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
112
112
|
* @default false
|
|
113
113
|
*/
|
|
114
114
|
this.filterable = false;
|
|
115
|
+
/**
|
|
116
|
+
* If `checkАll` is set to `true` and the checkboxes are enabled, a tri-state checkbox appears above the embedded treeview.
|
|
117
|
+
* Clicking the checkbox checks or unchecks all enabled items of the treeview that are loaded.
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
this.checkAll = false;
|
|
115
121
|
/**
|
|
116
122
|
* A function which determines if a specific node has child nodes.
|
|
117
123
|
*/
|
|
@@ -215,6 +221,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
215
221
|
this._checkableSettings = DEFAULT_CHECKABLE_SETTINGS;
|
|
216
222
|
this._isFocused = false;
|
|
217
223
|
this.subscriptions = [];
|
|
224
|
+
this.lastAction = 'check';
|
|
218
225
|
this.onTouchedCallback = util_1.noop;
|
|
219
226
|
this.onChangeCallback = util_1.noop;
|
|
220
227
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
@@ -230,7 +237,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
230
237
|
this._treeview = treeview;
|
|
231
238
|
if (treeview) {
|
|
232
239
|
// If filtering is enabled, focus the TreeView on mobile devices instead of the filter input
|
|
233
|
-
if (this.isFocused && !this.filterable || this.touchEnabled) {
|
|
240
|
+
if (this.isFocused && !this.filterable && !this.checkAll || this.touchEnabled) {
|
|
234
241
|
treeview.focus();
|
|
235
242
|
}
|
|
236
243
|
/**
|
|
@@ -551,6 +558,20 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
551
558
|
enumerable: true,
|
|
552
559
|
configurable: true
|
|
553
560
|
});
|
|
561
|
+
Object.defineProperty(MultiSelectTreeComponent.prototype, "isFilterActive", {
|
|
562
|
+
get: function () {
|
|
563
|
+
return this.filterInput && document.activeElement === this.filterInput.nativeElement;
|
|
564
|
+
},
|
|
565
|
+
enumerable: true,
|
|
566
|
+
configurable: true
|
|
567
|
+
});
|
|
568
|
+
Object.defineProperty(MultiSelectTreeComponent.prototype, "isCheckAllActive", {
|
|
569
|
+
get: function () {
|
|
570
|
+
return this.checkAllInput && document.activeElement === this.checkAllInput.nativeElement;
|
|
571
|
+
},
|
|
572
|
+
enumerable: true,
|
|
573
|
+
configurable: true
|
|
574
|
+
});
|
|
554
575
|
MultiSelectTreeComponent.prototype.ngOnInit = function () {
|
|
555
576
|
var _this = this;
|
|
556
577
|
this.renderer.removeAttribute(this.hostElement.nativeElement, 'tabindex');
|
|
@@ -774,6 +795,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
774
795
|
*/
|
|
775
796
|
MultiSelectTreeComponent.prototype.handleCheckedItemsChange = function (items) {
|
|
776
797
|
this.valueDepth = items.map(function (item) { return item.level; });
|
|
798
|
+
this.lastAction = items.length > this.dataItems.length ? 'check' : 'uncheck';
|
|
777
799
|
this.dataItems = items.slice();
|
|
778
800
|
this.updateValue(this.dataItems);
|
|
779
801
|
};
|
|
@@ -866,6 +888,13 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
866
888
|
this.filterChange.next(term);
|
|
867
889
|
this.allNodesHidden = this.nodes.every(function (node, index) { return !_this.isVisible(node, String(index)); });
|
|
868
890
|
};
|
|
891
|
+
/**
|
|
892
|
+
* @hidden
|
|
893
|
+
*/
|
|
894
|
+
MultiSelectTreeComponent.prototype.toggleCheckAll = function () {
|
|
895
|
+
this.checkAllInput.nativeElement.focus();
|
|
896
|
+
this.checkAllInput.nativeElement.click();
|
|
897
|
+
};
|
|
869
898
|
MultiSelectTreeComponent.prototype.verifySettings = function () {
|
|
870
899
|
if (!core_1.isDevMode()) {
|
|
871
900
|
return;
|
|
@@ -991,17 +1020,20 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
991
1020
|
return;
|
|
992
1021
|
}
|
|
993
1022
|
var isFirstNodeActive = this.treeview['navigationService']['activeIndex'] === '0';
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
if (isFilterActive) {
|
|
997
|
-
this.focus();
|
|
998
|
-
}
|
|
999
|
-
else if (!isFilterActive && isFirstNodeActive) {
|
|
1000
|
-
this.filterInput.nativeElement.focus();
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
if (!this.filterable && isFirstNodeActive) {
|
|
1023
|
+
// Current focus is on the filter input => should focus the wrapper
|
|
1024
|
+
if (this.filterable && this.isFilterActive) {
|
|
1004
1025
|
this.focus();
|
|
1026
|
+
// Current focus is on the treeview first node => should focus the check all checkbox if enabled
|
|
1027
|
+
}
|
|
1028
|
+
else if (this.checkAll && !this.isCheckAllActive && isFirstNodeActive) {
|
|
1029
|
+
this.checkAllInput.nativeElement.focus();
|
|
1030
|
+
// Current focus is either on the check all checkbox or the treeview's first node
|
|
1031
|
+
// => should focus either the filter input (if enabled) or the wrapper
|
|
1032
|
+
}
|
|
1033
|
+
else if (this.isCheckAllActive || isFirstNodeActive) {
|
|
1034
|
+
this.filterable ?
|
|
1035
|
+
this.filterInput.nativeElement.focus() :
|
|
1036
|
+
this.focus();
|
|
1005
1037
|
}
|
|
1006
1038
|
};
|
|
1007
1039
|
MultiSelectTreeComponent.prototype.handleDownKey = function (event) {
|
|
@@ -1009,9 +1041,14 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
1009
1041
|
return;
|
|
1010
1042
|
}
|
|
1011
1043
|
event.originalEvent.preventDefault();
|
|
1012
|
-
//
|
|
1044
|
+
// Current focus is on the wrapper => should focus the filter input
|
|
1013
1045
|
if (this.filterable && this.isWrapperActive) {
|
|
1014
1046
|
this.filterInput.nativeElement.focus();
|
|
1047
|
+
// Current focus is on the wrapper/filter input => should focus check all checkbox if enabled
|
|
1048
|
+
}
|
|
1049
|
+
else if (this.checkAll && (this.isWrapperActive || this.isFilterActive)) {
|
|
1050
|
+
this.checkAllInput.nativeElement.focus();
|
|
1051
|
+
// Should focus the treeview if filterable and check all are disabled
|
|
1015
1052
|
}
|
|
1016
1053
|
else if (!this.treeview.isActive) {
|
|
1017
1054
|
this.treeview.focus();
|
|
@@ -1172,6 +1209,10 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
1172
1209
|
core_1.ViewChild('filterInput', { static: false }),
|
|
1173
1210
|
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
1174
1211
|
], MultiSelectTreeComponent.prototype, "filterInput", void 0);
|
|
1212
|
+
tslib_1.__decorate([
|
|
1213
|
+
core_1.ViewChild('checkAllInput', { static: false }),
|
|
1214
|
+
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
1215
|
+
], MultiSelectTreeComponent.prototype, "checkAllInput", void 0);
|
|
1175
1216
|
tslib_1.__decorate([
|
|
1176
1217
|
core_1.Input(),
|
|
1177
1218
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -1254,6 +1295,10 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
1254
1295
|
core_1.Input(),
|
|
1255
1296
|
tslib_1.__metadata("design:type", Boolean)
|
|
1256
1297
|
], MultiSelectTreeComponent.prototype, "filterable", void 0);
|
|
1298
|
+
tslib_1.__decorate([
|
|
1299
|
+
core_1.Input(),
|
|
1300
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
1301
|
+
], MultiSelectTreeComponent.prototype, "checkAll", void 0);
|
|
1257
1302
|
tslib_1.__decorate([
|
|
1258
1303
|
core_1.Input(),
|
|
1259
1304
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -1354,7 +1399,7 @@ var MultiSelectTreeComponent = /** @class */ (function () {
|
|
|
1354
1399
|
}
|
|
1355
1400
|
],
|
|
1356
1401
|
selector: 'kendo-multiselecttree',
|
|
1357
|
-
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 (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
|
|
1402
|
+
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 "
|
|
1358
1403
|
}),
|
|
1359
1404
|
tslib_1.__param(7, core_1.Optional()), tslib_1.__param(7, core_1.Inject(touch_enabled_1.TOUCH_ENABLED)),
|
|
1360
1405
|
tslib_1.__metadata("design:paramtypes", [kendo_angular_popup_1.PopupService,
|
package/dist/npm/index.js
CHANGED
|
@@ -45,6 +45,10 @@ var tag_template_directive_1 = require("./common/templates/tag-template.directiv
|
|
|
45
45
|
exports.TagTemplateDirective = tag_template_directive_1.TagTemplateDirective
|
|
46
46
|
var dropdownlist_component_1 = require("./dropdownlist/dropdownlist.component");
|
|
47
47
|
exports.DROPDOWNLIST_VALUE_ACCESSOR = dropdownlist_component_1.DROPDOWNLIST_VALUE_ACCESSOR
|
|
48
|
+
var base_check_directive_1 = require("./dropdowntrees/checked-state/base-check.directive");
|
|
49
|
+
exports.BaseCheckDirective = base_check_directive_1.BaseCheckDirective
|
|
50
|
+
var check_all_directive_1 = require("./dropdowntrees/checked-state/check-all.directive");
|
|
51
|
+
exports.CheckAllDirective = check_all_directive_1.CheckAllDirective
|
|
48
52
|
var check_directive_1 = require("./dropdowntrees/checked-state/check.directive");
|
|
49
53
|
exports.CheckDirective = check_directive_1.CheckDirective
|
|
50
54
|
var summary_tag_directive_1 = require("./dropdowntrees/summary-tag/summary-tag.directive");
|
|
@@ -11,7 +11,7 @@ exports.packageMetadata = {
|
|
|
11
11
|
name: '@progress/kendo-angular-dropdowns',
|
|
12
12
|
productName: 'Kendo UI for Angular',
|
|
13
13
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
14
|
-
publishDate:
|
|
14
|
+
publishDate: 1635524416,
|
|
15
15
|
version: '',
|
|
16
16
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
17
17
|
};
|