@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.
- package/dist/cdn/js/kendo-angular-dropdowns.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/list.component.js +1 -1
- 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 +4 -0
- package/dist/es/dropdowntrees/multiselecttree.component.js +66 -17
- package/dist/es/index.js +2 -0
- package/dist/es/multiselect/multiselect.component.js +8 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es2015/common/list.component.js +6 -6
- 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.d.ts +4 -0
- package/dist/es2015/dropdowntrees/dropdowntree.component.js +4 -0
- package/dist/es2015/dropdowntrees/multiselecttree.component.d.ts +18 -0
- package/dist/es2015/dropdowntrees/multiselecttree.component.js +91 -20
- 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/multiselect/multiselect.component.js +8 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/fesm2015/index.js +314 -55
- package/dist/fesm5/index.js +319 -57
- package/dist/npm/common/list.component.js +1 -1
- 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 +4 -0
- package/dist/npm/dropdowntrees/multiselecttree.component.js +66 -17
- package/dist/npm/index.js +4 -0
- package/dist/npm/multiselect/multiselect.component.js +8 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-angular-dropdowns.js +1 -1
- package/package.json +1 -1
|
@@ -107,6 +107,12 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
107
107
|
* @default false
|
|
108
108
|
*/
|
|
109
109
|
this.filterable = false;
|
|
110
|
+
/**
|
|
111
|
+
* If `checkАll` is set to `true` and the checkboxes are enabled, a tri-state checkbox appears above the embedded treeview.
|
|
112
|
+
* Clicking the checkbox checks or unchecks all enabled items of the treeview that are loaded.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
this.checkAll = false;
|
|
110
116
|
/**
|
|
111
117
|
* A function which determines if a specific node has child nodes.
|
|
112
118
|
*/
|
|
@@ -181,6 +187,10 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
181
187
|
* Fires when the value of the built-in filter input element changes.
|
|
182
188
|
*/
|
|
183
189
|
this.filterChange = new EventEmitter();
|
|
190
|
+
/**
|
|
191
|
+
* @hidden
|
|
192
|
+
*/
|
|
193
|
+
this.filterStateChange = new EventEmitter();
|
|
184
194
|
/**
|
|
185
195
|
* @hidden
|
|
186
196
|
*/
|
|
@@ -206,6 +216,7 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
206
216
|
this._checkableSettings = DEFAULT_CHECKABLE_SETTINGS;
|
|
207
217
|
this._isFocused = false;
|
|
208
218
|
this.subscriptions = [];
|
|
219
|
+
this.lastAction = 'check';
|
|
209
220
|
this.onTouchedCallback = noop;
|
|
210
221
|
this.onChangeCallback = noop;
|
|
211
222
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
@@ -215,7 +226,7 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
215
226
|
this._treeview = treeview;
|
|
216
227
|
if (treeview) {
|
|
217
228
|
// If filtering is enabled, focus the TreeView on mobile devices instead of the filter input
|
|
218
|
-
if (this.isFocused && !this.filterable || this.touchEnabled) {
|
|
229
|
+
if (this.isFocused && !this.filterable && !this.checkAll || this.touchEnabled) {
|
|
219
230
|
treeview.focus();
|
|
220
231
|
}
|
|
221
232
|
/**
|
|
@@ -446,6 +457,12 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
446
457
|
get isWrapperActive() {
|
|
447
458
|
return document.activeElement === this.wrapper.nativeElement;
|
|
448
459
|
}
|
|
460
|
+
get isFilterActive() {
|
|
461
|
+
return this.filterInput && document.activeElement === this.filterInput.nativeElement;
|
|
462
|
+
}
|
|
463
|
+
get isCheckAllActive() {
|
|
464
|
+
return this.checkAllInput && document.activeElement === this.checkAllInput.nativeElement;
|
|
465
|
+
}
|
|
449
466
|
ngOnInit() {
|
|
450
467
|
this.renderer.removeAttribute(this.hostElement.nativeElement, 'tabindex');
|
|
451
468
|
this.renderer.setAttribute(this.wrapper.nativeElement, 'aria-expanded', String(this.isOpen));
|
|
@@ -662,6 +679,7 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
662
679
|
*/
|
|
663
680
|
handleCheckedItemsChange(items) {
|
|
664
681
|
this.valueDepth = items.map(item => item.level);
|
|
682
|
+
this.lastAction = items.length > this.dataItems.length ? 'check' : 'uncheck';
|
|
665
683
|
this.dataItems = items.slice();
|
|
666
684
|
this.updateValue(this.dataItems);
|
|
667
685
|
}
|
|
@@ -681,12 +699,12 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
681
699
|
if (tag instanceof Array) {
|
|
682
700
|
// Remove group tag
|
|
683
701
|
this.dataItems = this.dataItems.filter((_item, i) => i < this.showAfter || this.disabledIndices.has(i));
|
|
684
|
-
this.valueDepth = this.valueDepth.filter((_item, i) => i < this.showAfter);
|
|
702
|
+
this.valueDepth = this.valueDepth.filter((_item, i) => i < this.showAfter || this.disabledIndices.has(i));
|
|
685
703
|
}
|
|
686
704
|
else {
|
|
687
705
|
// Remove single tag
|
|
688
|
-
this.dataItems = this.dataItems.filter((_item, i) => i !== index);
|
|
689
|
-
this.valueDepth = this.valueDepth.filter((_item, i) => i !== index);
|
|
706
|
+
this.dataItems = this.dataItems.filter((_item, i) => i !== index || this.disabledIndices.has(i));
|
|
707
|
+
this.valueDepth = this.valueDepth.filter((_item, i) => i !== index || this.disabledIndices.has(i));
|
|
690
708
|
}
|
|
691
709
|
this.updateValue(this.dataItems);
|
|
692
710
|
// focus the wrapper if the component is not focused - the floating label reacts to focus/blur
|
|
@@ -711,7 +729,7 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
711
729
|
this.value = this.value.filter((_item, index) => this.disabledIndices.has(index));
|
|
712
730
|
this.dataItems = this.dataItems.filter((_item, index) => this.disabledIndices.has(index));
|
|
713
731
|
this.valueDepth = this.valueDepth.filter((_depth, index) => this.disabledIndices.has(index));
|
|
714
|
-
this.emitValueChange();
|
|
732
|
+
this.emitValueChange(this.value);
|
|
715
733
|
}
|
|
716
734
|
/**
|
|
717
735
|
* @hidden
|
|
@@ -750,6 +768,13 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
750
768
|
this.filterChange.next(term);
|
|
751
769
|
this.allNodesHidden = this.nodes.every((node, index) => !this.isVisible(node, String(index)));
|
|
752
770
|
}
|
|
771
|
+
/**
|
|
772
|
+
* @hidden
|
|
773
|
+
*/
|
|
774
|
+
toggleCheckAll() {
|
|
775
|
+
this.checkAllInput.nativeElement.focus();
|
|
776
|
+
this.checkAllInput.nativeElement.click();
|
|
777
|
+
}
|
|
753
778
|
verifySettings() {
|
|
754
779
|
if (!isDevMode()) {
|
|
755
780
|
return;
|
|
@@ -872,17 +897,20 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
872
897
|
return;
|
|
873
898
|
}
|
|
874
899
|
const isFirstNodeActive = this.treeview['navigationService']['activeIndex'] === '0';
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
if (isFilterActive) {
|
|
878
|
-
this.focus();
|
|
879
|
-
}
|
|
880
|
-
else if (!isFilterActive && isFirstNodeActive) {
|
|
881
|
-
this.filterInput.nativeElement.focus();
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
if (!this.filterable && isFirstNodeActive) {
|
|
900
|
+
// Current focus is on the filter input => should focus the wrapper
|
|
901
|
+
if (this.filterable && this.isFilterActive) {
|
|
885
902
|
this.focus();
|
|
903
|
+
// Current focus is on the treeview first node => should focus the check all checkbox if enabled
|
|
904
|
+
}
|
|
905
|
+
else if (this.checkAll && !this.isCheckAllActive && isFirstNodeActive) {
|
|
906
|
+
this.checkAllInput.nativeElement.focus();
|
|
907
|
+
// Current focus is either on the check all checkbox or the treeview's first node
|
|
908
|
+
// => should focus either the filter input (if enabled) or the wrapper
|
|
909
|
+
}
|
|
910
|
+
else if (this.isCheckAllActive || isFirstNodeActive) {
|
|
911
|
+
this.filterable ?
|
|
912
|
+
this.filterInput.nativeElement.focus() :
|
|
913
|
+
this.focus();
|
|
886
914
|
}
|
|
887
915
|
}
|
|
888
916
|
handleDownKey(event) {
|
|
@@ -890,9 +918,14 @@ let MultiSelectTreeComponent = MultiSelectTreeComponent_1 = class MultiSelectTre
|
|
|
890
918
|
return;
|
|
891
919
|
}
|
|
892
920
|
event.originalEvent.preventDefault();
|
|
893
|
-
//
|
|
921
|
+
// Current focus is on the wrapper => should focus the filter input
|
|
894
922
|
if (this.filterable && this.isWrapperActive) {
|
|
895
923
|
this.filterInput.nativeElement.focus();
|
|
924
|
+
// Current focus is on the wrapper/filter input => should focus check all checkbox if enabled
|
|
925
|
+
}
|
|
926
|
+
else if (this.checkAll && (this.isWrapperActive || this.isFilterActive)) {
|
|
927
|
+
this.checkAllInput.nativeElement.focus();
|
|
928
|
+
// Should focus the treeview if filterable and check all are disabled
|
|
896
929
|
}
|
|
897
930
|
else if (!this.treeview.isActive) {
|
|
898
931
|
this.treeview.focus();
|
|
@@ -1050,6 +1083,10 @@ tslib_1.__decorate([
|
|
|
1050
1083
|
ViewChild('filterInput', { static: false }),
|
|
1051
1084
|
tslib_1.__metadata("design:type", ElementRef)
|
|
1052
1085
|
], MultiSelectTreeComponent.prototype, "filterInput", void 0);
|
|
1086
|
+
tslib_1.__decorate([
|
|
1087
|
+
ViewChild('checkAllInput', { static: false }),
|
|
1088
|
+
tslib_1.__metadata("design:type", ElementRef)
|
|
1089
|
+
], MultiSelectTreeComponent.prototype, "checkAllInput", void 0);
|
|
1053
1090
|
tslib_1.__decorate([
|
|
1054
1091
|
Input(),
|
|
1055
1092
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -1132,6 +1169,10 @@ tslib_1.__decorate([
|
|
|
1132
1169
|
Input(),
|
|
1133
1170
|
tslib_1.__metadata("design:type", Boolean)
|
|
1134
1171
|
], MultiSelectTreeComponent.prototype, "filterable", void 0);
|
|
1172
|
+
tslib_1.__decorate([
|
|
1173
|
+
Input(),
|
|
1174
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
1175
|
+
], MultiSelectTreeComponent.prototype, "checkAll", void 0);
|
|
1135
1176
|
tslib_1.__decorate([
|
|
1136
1177
|
Input(),
|
|
1137
1178
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -1239,6 +1280,9 @@ MultiSelectTreeComponent = MultiSelectTreeComponent_1 = tslib_1.__decorate([
|
|
|
1239
1280
|
|
|
1240
1281
|
i18n-clearTitle="kendo.multiselecttree.clearTitle|The title of the clear button"
|
|
1241
1282
|
clearTitle="clear"
|
|
1283
|
+
|
|
1284
|
+
i18n-checkAllText="kendo.multiselecttree.checkAllText|The text displayed for the check-all checkbox"
|
|
1285
|
+
checkAllText="Check all"
|
|
1242
1286
|
>
|
|
1243
1287
|
</ng-container>
|
|
1244
1288
|
<div #wrapper
|
|
@@ -1289,7 +1333,7 @@ MultiSelectTreeComponent = MultiSelectTreeComponent_1 = tslib_1.__decorate([
|
|
|
1289
1333
|
[attr.title]="messageFor('clearTitle')"
|
|
1290
1334
|
role="button"
|
|
1291
1335
|
tabindex="-1"
|
|
1292
|
-
(
|
|
1336
|
+
(click)="clearAll($event)"
|
|
1293
1337
|
>
|
|
1294
1338
|
</span>
|
|
1295
1339
|
<span
|
|
@@ -1307,9 +1351,7 @@ MultiSelectTreeComponent = MultiSelectTreeComponent_1 = tslib_1.__decorate([
|
|
|
1307
1351
|
#filterInput
|
|
1308
1352
|
(input)="handleFilterInputChange($event.target.value)"
|
|
1309
1353
|
[filterInput]="filterable && !touchEnabled"
|
|
1310
|
-
(keydown
|
|
1311
|
-
(keydown.arrowup)="handleKeydown($event)"
|
|
1312
|
-
(keydown.alt.arrowup)="handleKeydown($event)"
|
|
1354
|
+
(keydown)="handleKeydown($event)"
|
|
1313
1355
|
[(ngModel)]="filter"
|
|
1314
1356
|
class="k-textbox"
|
|
1315
1357
|
role="textbox"
|
|
@@ -1332,6 +1374,35 @@ MultiSelectTreeComponent = MultiSelectTreeComponent_1 = tslib_1.__decorate([
|
|
|
1332
1374
|
templateRef: headerTemplate?.templateRef
|
|
1333
1375
|
}">
|
|
1334
1376
|
</ng-template>
|
|
1377
|
+
<div *ngIf="checkAll" class="k-check-all">
|
|
1378
|
+
<input
|
|
1379
|
+
#checkAllInput
|
|
1380
|
+
[checkAll]="!filterable && !touchEnabled"
|
|
1381
|
+
type="checkbox"
|
|
1382
|
+
class="k-checkbox"
|
|
1383
|
+
role="checkbox"
|
|
1384
|
+
tabindex="0"
|
|
1385
|
+
aria-disabled="false"
|
|
1386
|
+
aria-readonly="false"
|
|
1387
|
+
[treeview]="treeview"
|
|
1388
|
+
[checkedItems]="checkedItems"
|
|
1389
|
+
[valueField]="valueField"
|
|
1390
|
+
[lastAction]="lastAction"
|
|
1391
|
+
(checkedItemsChange)="handleCheckedItemsChange($event)"
|
|
1392
|
+
(keydown)="handleKeydown($event)"
|
|
1393
|
+
[kendoEventsOutsideAngular]="{
|
|
1394
|
+
blur: handleBlur
|
|
1395
|
+
}"
|
|
1396
|
+
[scope]="this"
|
|
1397
|
+
>
|
|
1398
|
+
<span
|
|
1399
|
+
class="k-checkbox-label"
|
|
1400
|
+
(click)="toggleCheckAll()"
|
|
1401
|
+
(mousedown)="$event.preventDefault()"
|
|
1402
|
+
>
|
|
1403
|
+
{{ messageFor('checkAllText') }}
|
|
1404
|
+
</span>
|
|
1405
|
+
</div>
|
|
1335
1406
|
<kendo-treeview
|
|
1336
1407
|
#treeview
|
|
1337
1408
|
[nodes]="data"
|
package/dist/es2015/index.d.ts
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';
|
package/dist/es2015/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';
|