@progress/kendo-angular-dropdowns 5.5.1 → 6.0.1-dev.202201201129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-dropdowns.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/autocomplete/autocomplete.component.js +120 -5
- package/dist/es/comboboxes/combobox.component.js +141 -20
- package/dist/es/comboboxes/multicolumncombobox.component.js +30 -10
- package/dist/es/common/list.component.js +83 -5
- package/dist/es/common/models/fillmode.js +4 -0
- package/dist/es/common/models/list-type.js +4 -0
- package/dist/es/common/models/rounded.js +4 -0
- package/dist/es/common/models/size.js +4 -0
- package/dist/es/common/searchbar.component.js +1 -1
- package/dist/es/common/selection/selectable.directive.js +2 -2
- package/dist/es/common/taglist.component.js +58 -5
- package/dist/es/common/util.js +37 -0
- package/dist/es/dropdownlist/dropdownlist.component.js +335 -54
- package/dist/es/dropdowntrees/dropdowntree.component.js +276 -42
- package/dist/es/dropdowntrees/multiselecttree.component.js +307 -46
- package/dist/es/multiselect/multiselect.component.js +162 -35
- package/dist/es/package-metadata.js +1 -1
- package/dist/es2015/autocomplete/autocomplete.component.d.ts +42 -0
- package/dist/es2015/autocomplete/autocomplete.component.js +109 -7
- package/dist/es2015/comboboxes/combobox.component.d.ts +49 -4
- package/dist/es2015/comboboxes/combobox.component.js +207 -106
- package/dist/es2015/comboboxes/multicolumncombobox.component.d.ts +9 -1
- package/dist/es2015/comboboxes/multicolumncombobox.component.js +185 -166
- package/dist/es2015/common/list.component.d.ts +22 -1
- package/dist/es2015/common/list.component.js +115 -37
- package/dist/es2015/common/models/fillmode.d.ts +14 -0
- package/dist/es2015/common/models/fillmode.js +4 -0
- package/dist/es2015/common/models/list-type.d.ts +8 -0
- package/dist/es2015/common/models/list-type.js +4 -0
- package/dist/es2015/common/models/rounded.d.ts +15 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/size.d.ts +14 -0
- package/dist/es2015/common/models/size.js +4 -0
- package/dist/es2015/common/searchbar.component.js +1 -1
- package/dist/es2015/common/selection/selectable.directive.js +2 -2
- package/dist/es2015/common/taglist.component.d.ts +13 -1
- package/dist/es2015/common/taglist.component.js +102 -47
- package/dist/es2015/common/util.d.ts +17 -0
- package/dist/es2015/common/util.js +37 -0
- package/dist/es2015/dropdownlist/dropdownlist.component.d.ts +80 -17
- package/dist/es2015/dropdownlist/dropdownlist.component.js +391 -167
- package/dist/es2015/dropdowntrees/dropdowntree.component.d.ts +71 -13
- package/dist/es2015/dropdowntrees/dropdowntree.component.js +287 -99
- package/dist/es2015/dropdowntrees/multiselecttree.component.d.ts +72 -12
- package/dist/es2015/dropdowntrees/multiselecttree.component.js +319 -117
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/multiselect/multiselect.component.d.ts +53 -8
- package/dist/es2015/multiselect/multiselect.component.js +183 -70
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/fesm2015/index.js +1956 -837
- package/dist/fesm5/index.js +1558 -231
- package/dist/npm/autocomplete/autocomplete.component.js +119 -4
- package/dist/npm/comboboxes/combobox.component.js +140 -19
- package/dist/npm/comboboxes/multicolumncombobox.component.js +29 -9
- package/dist/npm/common/list.component.js +82 -4
- package/dist/npm/common/models/fillmode.js +6 -0
- package/dist/npm/common/models/list-type.js +6 -0
- package/dist/npm/common/models/rounded.js +6 -0
- package/dist/npm/common/models/size.js +6 -0
- package/dist/npm/common/searchbar.component.js +1 -1
- package/dist/npm/common/selection/selectable.directive.js +2 -2
- package/dist/npm/common/taglist.component.js +56 -3
- package/dist/npm/common/util.js +37 -0
- package/dist/npm/dropdownlist/dropdownlist.component.js +333 -52
- package/dist/npm/dropdowntrees/dropdowntree.component.js +274 -40
- package/dist/npm/dropdowntrees/multiselecttree.component.js +304 -43
- package/dist/npm/multiselect/multiselect.component.js +160 -33
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-angular-dropdowns.js +1 -1
- package/package.json +21 -17
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostBinding, Input, Output, NgZone, Renderer2, TemplateRef, ViewChild, ChangeDetectorRef, ContentChild, forwardRef, ViewContainerRef, isDevMode, Optional, Inject } from '@angular/core';
|
|
6
|
+
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostBinding, Input, Output, NgZone, Renderer2, TemplateRef, ViewChild, ChangeDetectorRef, ContentChild, forwardRef, ViewContainerRef, isDevMode, Optional, Inject, HostListener } from '@angular/core';
|
|
7
7
|
import { anyChanged, guid, hasObservers, isDocumentAvailable, KendoInput } from '@progress/kendo-angular-common';
|
|
8
8
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
9
9
|
import { TreeViewComponent, DataBoundComponent, ExpandableComponent } from '@progress/kendo-angular-treeview';
|
|
@@ -15,7 +15,7 @@ import { NavigationService } from '../common/navigation/navigation.service';
|
|
|
15
15
|
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
16
16
|
import { SelectionService } from '../common/selection/selection.service';
|
|
17
17
|
import { PreventableEvent } from '../common/models/preventable-event';
|
|
18
|
-
import { inDropDown, isArray, isPresent, isUntouched, noop } from '../common/util';
|
|
18
|
+
import { getFillModeClass, getRoundedClass, getSizeClass, inDropDown, isArray, isPresent, isUntouched, noop } from '../common/util';
|
|
19
19
|
import { NoDataTemplateDirective } from '../common/templates/no-data-template.directive';
|
|
20
20
|
import { of } from 'rxjs';
|
|
21
21
|
import { tap } from 'rxjs/operators';
|
|
@@ -39,16 +39,18 @@ var ɵ3 = isNodeVisible;
|
|
|
39
39
|
* Represents the [Kendo UI DropDownTree component for Angular]({% slug overview_ddt %}).
|
|
40
40
|
*/
|
|
41
41
|
var DropDownTreeComponent = /** @class */ (function () {
|
|
42
|
-
function DropDownTreeComponent(popupService, navigationService, renderer,
|
|
42
|
+
function DropDownTreeComponent(wrapper, popupService, navigationService, renderer, _zone, cdr, localization, touchEnabled) {
|
|
43
|
+
this.wrapper = wrapper;
|
|
43
44
|
this.popupService = popupService;
|
|
44
45
|
this.navigationService = navigationService;
|
|
45
46
|
this.renderer = renderer;
|
|
46
|
-
this.hostElement = hostElement;
|
|
47
47
|
this._zone = _zone;
|
|
48
48
|
this.cdr = cdr;
|
|
49
49
|
this.localization = localization;
|
|
50
50
|
this.touchEnabled = touchEnabled;
|
|
51
51
|
this.hostClasses = true;
|
|
52
|
+
this.role = 'listbox';
|
|
53
|
+
this.ariaHasPopup = 'tree';
|
|
52
54
|
/**
|
|
53
55
|
* Fires each time the popup is about to open
|
|
54
56
|
* ([see example]({% slug openstate_ddt %})).
|
|
@@ -183,21 +185,78 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
183
185
|
this._popupSettings = DEFAULT_POPUP_SETTINGS;
|
|
184
186
|
this._tabindex = 0;
|
|
185
187
|
this._isFocused = false;
|
|
188
|
+
this._size = 'medium';
|
|
189
|
+
this._rounded = 'medium';
|
|
190
|
+
this._fillMode = 'solid';
|
|
186
191
|
this.subscriptions = [];
|
|
187
192
|
this.onTouchedCallback = noop;
|
|
188
193
|
this.onChangeCallback = noop;
|
|
189
194
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
190
195
|
this.subscribeEvents();
|
|
191
196
|
this.subscribeTouchEvents();
|
|
197
|
+
this.subscribeFocusEvents();
|
|
192
198
|
}
|
|
193
199
|
DropDownTreeComponent_1 = DropDownTreeComponent;
|
|
194
|
-
Object.defineProperty(DropDownTreeComponent.prototype, "
|
|
200
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "isDisabled", {
|
|
195
201
|
get: function () {
|
|
196
|
-
return this.
|
|
202
|
+
return this.disabled;
|
|
197
203
|
},
|
|
198
204
|
enumerable: true,
|
|
199
205
|
configurable: true
|
|
200
206
|
});
|
|
207
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "isLoading", {
|
|
208
|
+
get: function () {
|
|
209
|
+
return this.loading;
|
|
210
|
+
},
|
|
211
|
+
enumerable: true,
|
|
212
|
+
configurable: true
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "id", {
|
|
215
|
+
get: function () {
|
|
216
|
+
return this.focusableId;
|
|
217
|
+
},
|
|
218
|
+
enumerable: true,
|
|
219
|
+
configurable: true
|
|
220
|
+
});
|
|
221
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "hostTabIndex", {
|
|
222
|
+
get: function () {
|
|
223
|
+
return this.tabindex;
|
|
224
|
+
},
|
|
225
|
+
enumerable: true,
|
|
226
|
+
configurable: true
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "isAriaExpanded", {
|
|
229
|
+
get: function () {
|
|
230
|
+
return this.isOpen;
|
|
231
|
+
},
|
|
232
|
+
enumerable: true,
|
|
233
|
+
configurable: true
|
|
234
|
+
});
|
|
235
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "isReadonly", {
|
|
236
|
+
get: function () {
|
|
237
|
+
return this.readonly;
|
|
238
|
+
},
|
|
239
|
+
enumerable: true,
|
|
240
|
+
configurable: true
|
|
241
|
+
});
|
|
242
|
+
/**
|
|
243
|
+
* @hidden
|
|
244
|
+
*/
|
|
245
|
+
DropDownTreeComponent.prototype.handleClick = function () {
|
|
246
|
+
this.togglePopup(!this.isOpen);
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* @hidden
|
|
250
|
+
*/
|
|
251
|
+
DropDownTreeComponent.prototype.handleKeydown = function (event) {
|
|
252
|
+
if (this.disabled || this.readonly) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
var eventData = event;
|
|
256
|
+
this.navigationService.process({
|
|
257
|
+
originalEvent: eventData
|
|
258
|
+
});
|
|
259
|
+
};
|
|
201
260
|
Object.defineProperty(DropDownTreeComponent.prototype, "treeview", {
|
|
202
261
|
get: function () {
|
|
203
262
|
return this._treeview;
|
|
@@ -299,12 +358,85 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
299
358
|
enumerable: true,
|
|
300
359
|
configurable: true
|
|
301
360
|
});
|
|
361
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "size", {
|
|
362
|
+
get: function () {
|
|
363
|
+
return this._size;
|
|
364
|
+
},
|
|
365
|
+
/**
|
|
366
|
+
* Sets the size of the component.
|
|
367
|
+
*
|
|
368
|
+
* The possible values are:
|
|
369
|
+
* * `'small'`
|
|
370
|
+
* * `'medium'` (default)
|
|
371
|
+
* * `'large'`
|
|
372
|
+
* * `null`
|
|
373
|
+
*
|
|
374
|
+
*/
|
|
375
|
+
set: function (size) {
|
|
376
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('picker', this.size));
|
|
377
|
+
if (size) {
|
|
378
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('picker', size));
|
|
379
|
+
}
|
|
380
|
+
this._size = size;
|
|
381
|
+
},
|
|
382
|
+
enumerable: true,
|
|
383
|
+
configurable: true
|
|
384
|
+
});
|
|
385
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "rounded", {
|
|
386
|
+
get: function () {
|
|
387
|
+
return this._rounded;
|
|
388
|
+
},
|
|
389
|
+
/**
|
|
390
|
+
* Sets the border radius of the component.
|
|
391
|
+
*
|
|
392
|
+
* The possible values are:
|
|
393
|
+
* * `'small'`
|
|
394
|
+
* * `'medium'` (default)
|
|
395
|
+
* * `'large'`
|
|
396
|
+
* * `'full'`
|
|
397
|
+
* * `null`
|
|
398
|
+
*
|
|
399
|
+
*/
|
|
400
|
+
set: function (rounded) {
|
|
401
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
402
|
+
if (rounded) {
|
|
403
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(rounded));
|
|
404
|
+
}
|
|
405
|
+
this._rounded = rounded;
|
|
406
|
+
},
|
|
407
|
+
enumerable: true,
|
|
408
|
+
configurable: true
|
|
409
|
+
});
|
|
410
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "fillMode", {
|
|
411
|
+
get: function () {
|
|
412
|
+
return this._fillMode;
|
|
413
|
+
},
|
|
414
|
+
/**
|
|
415
|
+
* Sets the fillMode of the component.
|
|
416
|
+
*
|
|
417
|
+
* The possible values are:
|
|
418
|
+
* * `'flat'`
|
|
419
|
+
* * `'solid'` (default)
|
|
420
|
+
* * `'outline'`
|
|
421
|
+
* * `null`
|
|
422
|
+
*
|
|
423
|
+
*/
|
|
424
|
+
set: function (fillMode) {
|
|
425
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('picker', this.fillMode));
|
|
426
|
+
if (fillMode) {
|
|
427
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('picker', fillMode));
|
|
428
|
+
}
|
|
429
|
+
this._fillMode = fillMode;
|
|
430
|
+
},
|
|
431
|
+
enumerable: true,
|
|
432
|
+
configurable: true
|
|
433
|
+
});
|
|
302
434
|
Object.defineProperty(DropDownTreeComponent.prototype, "isFocused", {
|
|
303
435
|
get: function () {
|
|
304
436
|
return this._isFocused;
|
|
305
437
|
},
|
|
306
438
|
set: function (isFocused) {
|
|
307
|
-
this.renderer[isFocused ? 'addClass' : 'removeClass'](this.wrapper.nativeElement, 'k-
|
|
439
|
+
this.renderer[isFocused ? 'addClass' : 'removeClass'](this.wrapper.nativeElement, 'k-focus');
|
|
308
440
|
this._isFocused = isFocused;
|
|
309
441
|
},
|
|
310
442
|
enumerable: true,
|
|
@@ -440,7 +572,7 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
440
572
|
});
|
|
441
573
|
DropDownTreeComponent.prototype.ngOnInit = function () {
|
|
442
574
|
var _this = this;
|
|
443
|
-
this.renderer.removeAttribute(this.
|
|
575
|
+
this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
|
|
444
576
|
this.assignAriaDescribedBy();
|
|
445
577
|
this.subscriptions.push(this.localization
|
|
446
578
|
.changes.subscribe(function (_a) {
|
|
@@ -448,6 +580,7 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
448
580
|
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
449
581
|
_this.cdr.markForCheck();
|
|
450
582
|
}));
|
|
583
|
+
this.setComponentClasses();
|
|
451
584
|
};
|
|
452
585
|
/**
|
|
453
586
|
* @hidden
|
|
@@ -498,8 +631,12 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
498
631
|
/**
|
|
499
632
|
* @hidden
|
|
500
633
|
*/
|
|
501
|
-
DropDownTreeComponent.prototype.handleFocus = function () {
|
|
634
|
+
DropDownTreeComponent.prototype.handleFocus = function (event) {
|
|
502
635
|
var _this = this;
|
|
636
|
+
if (event.target !== this.wrapper.nativeElement) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
event.stopImmediatePropagation();
|
|
503
640
|
if (!this.isFocused) {
|
|
504
641
|
this.isFocused = true;
|
|
505
642
|
if (hasObservers(this.onFocus)) {
|
|
@@ -515,13 +652,13 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
515
652
|
DropDownTreeComponent.prototype.handleBlur = function (e) {
|
|
516
653
|
var _this = this;
|
|
517
654
|
var relatedTarget = e && e.relatedTarget;
|
|
518
|
-
if (this.
|
|
655
|
+
if (this.wrapper.nativeElement.contains(relatedTarget) ||
|
|
519
656
|
(this.isOpen && this.popupRef.popupElement.contains(relatedTarget))) {
|
|
520
657
|
return;
|
|
521
658
|
}
|
|
522
659
|
this.isFocused = false;
|
|
523
660
|
if (hasObservers(this.onBlur) ||
|
|
524
|
-
isUntouched(this.
|
|
661
|
+
isUntouched(this.wrapper.nativeElement)) {
|
|
525
662
|
this._zone.run(function () {
|
|
526
663
|
_this.togglePopup(false);
|
|
527
664
|
_this.onBlur.emit();
|
|
@@ -532,24 +669,6 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
532
669
|
this.togglePopup(false);
|
|
533
670
|
}
|
|
534
671
|
};
|
|
535
|
-
/**
|
|
536
|
-
* @hidden
|
|
537
|
-
*/
|
|
538
|
-
DropDownTreeComponent.prototype.handleKeydown = function (event) {
|
|
539
|
-
if (this.disabled || this.readonly) {
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
var eventData = event;
|
|
543
|
-
this.navigationService.process({
|
|
544
|
-
originalEvent: eventData
|
|
545
|
-
});
|
|
546
|
-
};
|
|
547
|
-
/**
|
|
548
|
-
* @hidden
|
|
549
|
-
*/
|
|
550
|
-
DropDownTreeComponent.prototype.handleClick = function () {
|
|
551
|
-
this.togglePopup(!this.isOpen);
|
|
552
|
-
};
|
|
553
672
|
/**
|
|
554
673
|
* Focuses a specific item of the DropDownTree based on a provided index in the format of `1_1`.
|
|
555
674
|
* The targeted item should be expanded in order for it to be focused.
|
|
@@ -613,7 +732,7 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
613
732
|
* @hidden
|
|
614
733
|
*/
|
|
615
734
|
get: function () {
|
|
616
|
-
var containerClasses = ['k-popup-dropdowntree'
|
|
735
|
+
var containerClasses = ['k-popup-dropdowntree'];
|
|
617
736
|
if (this.popupSettings.popupClass) {
|
|
618
737
|
containerClasses.push(this.popupSettings.popupClass);
|
|
619
738
|
}
|
|
@@ -726,6 +845,26 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
726
845
|
enumerable: true,
|
|
727
846
|
configurable: true
|
|
728
847
|
});
|
|
848
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "selectButtonClasses", {
|
|
849
|
+
/**
|
|
850
|
+
* @hidden
|
|
851
|
+
*/
|
|
852
|
+
get: function () {
|
|
853
|
+
return (this.size ? getSizeClass('button', this.size) : '') + " " + (this.fillMode ? 'k-button-' + this.fillMode : '') + " " + (this.fillMode ? 'k-button-' + this.fillMode + '-base' : '');
|
|
854
|
+
},
|
|
855
|
+
enumerable: true,
|
|
856
|
+
configurable: true
|
|
857
|
+
});
|
|
858
|
+
Object.defineProperty(DropDownTreeComponent.prototype, "filterInputClasses", {
|
|
859
|
+
/**
|
|
860
|
+
* @hidden
|
|
861
|
+
*/
|
|
862
|
+
get: function () {
|
|
863
|
+
return (this.size ? getSizeClass('input', this.size) : '') + " " + (this.fillMode ? 'k-input-' + this.fillMode : '') + " " + (this.rounded ? getRoundedClass(this.rounded) : '');
|
|
864
|
+
},
|
|
865
|
+
enumerable: true,
|
|
866
|
+
configurable: true
|
|
867
|
+
});
|
|
729
868
|
DropDownTreeComponent.prototype.verifySettings = function () {
|
|
730
869
|
if (!isDevMode()) {
|
|
731
870
|
return;
|
|
@@ -889,7 +1028,7 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
889
1028
|
// Roll up DropDownTree on iOS when tapped outside
|
|
890
1029
|
return _this.touchstartDisposeHandler = _this.renderer.listen(document, 'touchstart', function (e) {
|
|
891
1030
|
var target = e.target;
|
|
892
|
-
if (_this.isFocused && !inDropDown(_this.
|
|
1031
|
+
if (_this.isFocused && !inDropDown(_this.wrapper, target, _this.popupRef)) {
|
|
893
1032
|
_this._zone.run(function () {
|
|
894
1033
|
if (_this.isOpen) {
|
|
895
1034
|
_this.treeview.blur();
|
|
@@ -900,34 +1039,118 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
900
1039
|
});
|
|
901
1040
|
});
|
|
902
1041
|
};
|
|
1042
|
+
DropDownTreeComponent.prototype.subscribeFocusEvents = function () {
|
|
1043
|
+
var _this = this;
|
|
1044
|
+
if (isDocumentAvailable()) {
|
|
1045
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
1046
|
+
this.handleDocumentBlur = this.handleDocumentBlur.bind(this);
|
|
1047
|
+
this._zone.runOutsideAngular(function () {
|
|
1048
|
+
var useCapture = true;
|
|
1049
|
+
document.addEventListener('focus', _this.handleFocus, useCapture);
|
|
1050
|
+
document.addEventListener('blur', _this.handleDocumentBlur, useCapture);
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1054
|
+
DropDownTreeComponent.prototype.unSubscribeFocusEvents = function () {
|
|
1055
|
+
if (isDocumentAvailable()) {
|
|
1056
|
+
var useCapture = true;
|
|
1057
|
+
document.removeEventListener('focus', this.handleFocus, useCapture);
|
|
1058
|
+
document.removeEventListener('blur', this.handleDocumentBlur, useCapture);
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
903
1061
|
DropDownTreeComponent.prototype.unsubscribeEvents = function () {
|
|
904
1062
|
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
|
|
1063
|
+
this.unSubscribeFocusEvents();
|
|
905
1064
|
if (this.touchstartDisposeHandler) {
|
|
906
1065
|
this.touchstartDisposeHandler();
|
|
907
1066
|
}
|
|
908
1067
|
};
|
|
1068
|
+
DropDownTreeComponent.prototype.handleDocumentBlur = function (event) {
|
|
1069
|
+
if (event.target !== this.wrapper.nativeElement) {
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
event.stopImmediatePropagation();
|
|
1073
|
+
this.handleBlur(event);
|
|
1074
|
+
};
|
|
909
1075
|
DropDownTreeComponent.prototype.assignAriaDescribedBy = function () {
|
|
910
1076
|
var currentValue = this.wrapper.nativeElement.getAttribute('aria-describedby') || '';
|
|
911
1077
|
// add to the current value - don't replace it (the aria-describedby is used by the FormField component as well)
|
|
912
1078
|
var newValue = (this.valueLabelId + " " + currentValue.trim()).trim();
|
|
913
1079
|
this.renderer.setAttribute(this.wrapper.nativeElement, 'aria-describedby', newValue);
|
|
914
1080
|
};
|
|
1081
|
+
DropDownTreeComponent.prototype.setComponentClasses = function () {
|
|
1082
|
+
if (this.size) {
|
|
1083
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('picker', this.size));
|
|
1084
|
+
}
|
|
1085
|
+
if (this.rounded) {
|
|
1086
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
1087
|
+
}
|
|
1088
|
+
if (this.fillMode) {
|
|
1089
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('picker', this.fillMode));
|
|
1090
|
+
}
|
|
1091
|
+
};
|
|
915
1092
|
var DropDownTreeComponent_1;
|
|
916
1093
|
tslib_1.__decorate([
|
|
917
|
-
HostBinding('class.k-widget'),
|
|
918
1094
|
HostBinding('class.k-dropdowntree'),
|
|
919
|
-
HostBinding('class.k-
|
|
1095
|
+
HostBinding('class.k-picker'),
|
|
920
1096
|
tslib_1.__metadata("design:type", Boolean)
|
|
921
1097
|
], DropDownTreeComponent.prototype, "hostClasses", void 0);
|
|
1098
|
+
tslib_1.__decorate([
|
|
1099
|
+
HostBinding('class.k-disabled'),
|
|
1100
|
+
HostBinding('attr.aria-disabled'),
|
|
1101
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1102
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1103
|
+
], DropDownTreeComponent.prototype, "isDisabled", null);
|
|
1104
|
+
tslib_1.__decorate([
|
|
1105
|
+
HostBinding('class.k-loading'),
|
|
1106
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1107
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1108
|
+
], DropDownTreeComponent.prototype, "isLoading", null);
|
|
1109
|
+
tslib_1.__decorate([
|
|
1110
|
+
HostBinding('attr.id'),
|
|
1111
|
+
tslib_1.__metadata("design:type", String),
|
|
1112
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1113
|
+
], DropDownTreeComponent.prototype, "id", null);
|
|
922
1114
|
tslib_1.__decorate([
|
|
923
1115
|
HostBinding('attr.dir'),
|
|
924
1116
|
tslib_1.__metadata("design:type", String)
|
|
925
1117
|
], DropDownTreeComponent.prototype, "direction", void 0);
|
|
926
1118
|
tslib_1.__decorate([
|
|
927
|
-
HostBinding('
|
|
1119
|
+
HostBinding('attr.tabindex'),
|
|
1120
|
+
tslib_1.__metadata("design:type", Number),
|
|
1121
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1122
|
+
], DropDownTreeComponent.prototype, "hostTabIndex", null);
|
|
1123
|
+
tslib_1.__decorate([
|
|
1124
|
+
HostBinding('attr.role'),
|
|
1125
|
+
tslib_1.__metadata("design:type", String)
|
|
1126
|
+
], DropDownTreeComponent.prototype, "role", void 0);
|
|
1127
|
+
tslib_1.__decorate([
|
|
1128
|
+
HostBinding('attr.aria-haspopup'),
|
|
1129
|
+
tslib_1.__metadata("design:type", String)
|
|
1130
|
+
], DropDownTreeComponent.prototype, "ariaHasPopup", void 0);
|
|
1131
|
+
tslib_1.__decorate([
|
|
1132
|
+
HostBinding('attr.aria-expanded'),
|
|
928
1133
|
tslib_1.__metadata("design:type", Boolean),
|
|
929
1134
|
tslib_1.__metadata("design:paramtypes", [])
|
|
930
|
-
], DropDownTreeComponent.prototype, "
|
|
1135
|
+
], DropDownTreeComponent.prototype, "isAriaExpanded", null);
|
|
1136
|
+
tslib_1.__decorate([
|
|
1137
|
+
HostBinding('attr.readonly'),
|
|
1138
|
+
HostBinding('attr.aria-readonly'),
|
|
1139
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1140
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1141
|
+
], DropDownTreeComponent.prototype, "isReadonly", null);
|
|
1142
|
+
tslib_1.__decorate([
|
|
1143
|
+
HostListener('click'),
|
|
1144
|
+
tslib_1.__metadata("design:type", Function),
|
|
1145
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
1146
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
1147
|
+
], DropDownTreeComponent.prototype, "handleClick", null);
|
|
1148
|
+
tslib_1.__decorate([
|
|
1149
|
+
HostListener('keydown', ['$event']),
|
|
1150
|
+
tslib_1.__metadata("design:type", Function),
|
|
1151
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
1152
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
1153
|
+
], DropDownTreeComponent.prototype, "handleKeydown", null);
|
|
931
1154
|
tslib_1.__decorate([
|
|
932
1155
|
ContentChild(NoDataTemplateDirective, { static: false }),
|
|
933
1156
|
tslib_1.__metadata("design:type", NoDataTemplateDirective)
|
|
@@ -952,10 +1175,6 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
952
1175
|
ViewChild('popupTemplate', { static: true }),
|
|
953
1176
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
954
1177
|
], DropDownTreeComponent.prototype, "popupTemplate", void 0);
|
|
955
|
-
tslib_1.__decorate([
|
|
956
|
-
ViewChild('wrapper', { static: true }),
|
|
957
|
-
tslib_1.__metadata("design:type", ElementRef)
|
|
958
|
-
], DropDownTreeComponent.prototype, "wrapper", void 0);
|
|
959
1178
|
tslib_1.__decorate([
|
|
960
1179
|
ViewChild('container', { read: ViewContainerRef, static: true }),
|
|
961
1180
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
@@ -1082,6 +1301,21 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
1082
1301
|
tslib_1.__metadata("design:type", Number),
|
|
1083
1302
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
1084
1303
|
], DropDownTreeComponent.prototype, "tabindex", null);
|
|
1304
|
+
tslib_1.__decorate([
|
|
1305
|
+
Input(),
|
|
1306
|
+
tslib_1.__metadata("design:type", String),
|
|
1307
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1308
|
+
], DropDownTreeComponent.prototype, "size", null);
|
|
1309
|
+
tslib_1.__decorate([
|
|
1310
|
+
Input(),
|
|
1311
|
+
tslib_1.__metadata("design:type", String),
|
|
1312
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1313
|
+
], DropDownTreeComponent.prototype, "rounded", null);
|
|
1314
|
+
tslib_1.__decorate([
|
|
1315
|
+
Input(),
|
|
1316
|
+
tslib_1.__metadata("design:type", String),
|
|
1317
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1318
|
+
], DropDownTreeComponent.prototype, "fillMode", null);
|
|
1085
1319
|
tslib_1.__decorate([
|
|
1086
1320
|
Input(),
|
|
1087
1321
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -1142,14 +1376,14 @@ var DropDownTreeComponent = /** @class */ (function () {
|
|
|
1142
1376
|
}
|
|
1143
1377
|
],
|
|
1144
1378
|
selector: 'kendo-dropdowntree',
|
|
1145
|
-
template: "\n <ng-container kendoDropDownTreeLocalizedMessages\n i18n-noDataText=\"kendo.dropdowntree.noDataText|The text displayed in the popup when there are no items\"\n noDataText=\"NO DATA FOUND\"\n\n i18n-clearTitle=\"kendo.dropdowntree.clearTitle|The title of the clear button\"\n clearTitle=\"clear\"\n >\n </ng-container>\n <span\n
|
|
1379
|
+
template: "\n <ng-container kendoDropDownTreeLocalizedMessages\n i18n-noDataText=\"kendo.dropdowntree.noDataText|The text displayed in the popup when there are no items\"\n noDataText=\"NO DATA FOUND\"\n\n i18n-clearTitle=\"kendo.dropdowntree.clearTitle|The title of the clear button\"\n clearTitle=\"clear\"\n >\n </ng-container>\n <span\n [attr.id]=\"valueLabelId\"\n class=\"k-input-inner\"\n >\n <span class=\"k-input-value-text\">\n <ng-template *ngIf=\"valueTemplate\"\n [templateContext]=\"{\n templateRef: valueTemplate.templateRef,\n $implicit: dataItem\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!valueTemplate\"> {{ text || placeholder }} </ng-template>\n </span>\n </span>\n <span\n *ngIf=\"!loading && !readonly && clearButton && text?.length && !disabled\"\n class=\"k-clear-value\"\n [style.visibility]=\"clearButtonVisiblity\"\n aria-hidden=\"true\"\n [attr.title]=\"messageFor('clearTitle')\"\n (click)=\"clearValue($event)\"\n >\n <span class=\"k-icon k-i-x\"></span>\n </span>\n <button\n tabindex=\"-1\"\n type=\"button\"\n aria-hidden=\"true\"\n class=\"k-input-button k-button k-icon-button\"\n [ngClass]=\"selectButtonClasses\"\n >\n <span\n class=\"k-button-icon k-icon\"\n [ngClass]=\"buttonClasses\"\n ></span>\n </button>\n <ng-template #popupTemplate>\n <span\n *ngIf=\"filterable\"\n class=\"k-list-filter\"\n >\n <span\n class=\"k-textbox k-input\"\n [ngClass]=\"filterInputClasses\"\n >\n <span class=\"k-input-prefix\">\n <span class=\"k-input-icon k-icon k-i-search\"></span>\n </span>\n <input\n #filterInput\n (input)=\"handleFilterInputChange($event.target.value)\"\n [filterInput]=\"filterable && !touchEnabled\"\n (keydown.arrowdown)=\"handleKeydown($event)\"\n (keydown.alt.arrowup)=\"handleKeydown($event)\"\n [(ngModel)]=\"filter\"\n class=\"k-input-inner\"\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>\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 *ngIf=\"data.length !== 0 && !allNodesHidden\"\n [size]=\"size\"\n [nodes]=\"data\"\n [style.maxHeight.px]=\"listHeight\"\n [animate]=\"false\"\n [(selectedKeys)]=\"selectedKeys\"\n [selectBy]=\"selectBy\"\n [textField]=\"textField\"\n kendoTreeViewSelectable\n [children]=\"children\"\n [hasChildren]=\"hasChildren\"\n [loadOnDemand]=\"loadOnDemand\"\n [isExpanded]=\"isNodeExpanded\"\n [isDisabled]=\"itemDisabled\"\n [nodeTemplate]=\"nodeTemplate\"\n [filter]=\"filter\"\n [isVisible]=\"isNodeVisible\"\n (focusout)=\"handleBlur($event)\"\n (keydown)=\"handleKeydown($event)\"\n (selectionChange)=\"onSelectionChange($event)\"\n (expand)=\"nodeExpand.emit($event)\"\n (collapse)=\"nodeCollapse.emit($event)\"\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-no-data\" *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 ",
|
|
1146
1380
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1147
1381
|
}),
|
|
1148
1382
|
tslib_1.__param(7, Optional()), tslib_1.__param(7, Inject(TOUCH_ENABLED)),
|
|
1149
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
1383
|
+
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
1384
|
+
PopupService,
|
|
1150
1385
|
NavigationService,
|
|
1151
1386
|
Renderer2,
|
|
1152
|
-
ElementRef,
|
|
1153
1387
|
NgZone,
|
|
1154
1388
|
ChangeDetectorRef,
|
|
1155
1389
|
LocalizationService, Boolean])
|