@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/* tslint:disable:member-ordering */
|
|
6
6
|
import * as tslib_1 from "tslib";
|
|
7
|
-
import { Component, Renderer2, forwardRef, ElementRef, Input, Output, HostBinding, EventEmitter, ContentChild, ViewChild, ViewContainerRef, isDevMode, Optional, Inject, NgZone, TemplateRef, ChangeDetectorRef } from '@angular/core';
|
|
7
|
+
import { Component, Renderer2, forwardRef, ElementRef, Input, Output, HostBinding, EventEmitter, ContentChild, ViewChild, ViewContainerRef, isDevMode, Optional, Inject, NgZone, TemplateRef, ChangeDetectorRef, HostListener } from '@angular/core';
|
|
8
8
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
10
|
import { packageMetadata } from '../package-metadata';
|
|
@@ -12,7 +12,7 @@ import { merge, interval, Subscription } from 'rxjs';
|
|
|
12
12
|
import { concatMap, filter, map, skipWhile, take, takeUntil, tap } from 'rxjs/operators';
|
|
13
13
|
import { isDocumentAvailable, KendoInput, hasObservers, anyChanged, isChanged } from '@progress/kendo-angular-common';
|
|
14
14
|
import { Keys } from '@progress/kendo-angular-common';
|
|
15
|
-
import { isPresent, guid, getter, shuffleData, sameCharsOnly, matchText, isUntouched, inDropDown } from '../common/util';
|
|
15
|
+
import { isPresent, guid, getter, shuffleData, sameCharsOnly, matchText, isUntouched, inDropDown, getSizeClass, getRoundedClass, getFillModeClass } from '../common/util';
|
|
16
16
|
import { SelectionService } from '../common/selection/selection.service';
|
|
17
17
|
import { NavigationService, NavigationEvent } from '../common/navigation/navigation.service';
|
|
18
18
|
import { ItemTemplateDirective } from '../common/templates/item-template.directive';
|
|
@@ -59,7 +59,8 @@ export var DROPDOWNLIST_VALUE_ACCESSOR = {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
var DropDownListComponent = /** @class */ (function () {
|
|
62
|
-
function DropDownListComponent(localization, popupService, selectionService, navigationService, disabledItemsService, dataService, _zone, renderer,
|
|
62
|
+
function DropDownListComponent(wrapper, localization, popupService, selectionService, navigationService, disabledItemsService, dataService, _zone, renderer, cdr, touchEnabled) {
|
|
63
|
+
this.wrapper = wrapper;
|
|
63
64
|
this.localization = localization;
|
|
64
65
|
this.popupService = popupService;
|
|
65
66
|
this.selectionService = selectionService;
|
|
@@ -68,13 +69,8 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
68
69
|
this.dataService = dataService;
|
|
69
70
|
this._zone = _zone;
|
|
70
71
|
this.renderer = renderer;
|
|
71
|
-
this.hostElement = hostElement;
|
|
72
72
|
this.cdr = cdr;
|
|
73
73
|
this.touchEnabled = touchEnabled;
|
|
74
|
-
/**
|
|
75
|
-
* @hidden
|
|
76
|
-
*/
|
|
77
|
-
this.focusableId = "k-" + guid();
|
|
78
74
|
/**
|
|
79
75
|
* Sets the height of the options list. By default, `listHeight` is 200px.
|
|
80
76
|
*
|
|
@@ -152,7 +148,12 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
152
148
|
* Fires each time the DropDownList gets blurred.
|
|
153
149
|
*/
|
|
154
150
|
this.onBlur = new EventEmitter();
|
|
155
|
-
this.
|
|
151
|
+
this.hostClasses = true;
|
|
152
|
+
/**
|
|
153
|
+
* @hidden
|
|
154
|
+
*/
|
|
155
|
+
this.focusableId = "k-" + guid();
|
|
156
|
+
this.role = 'listbox';
|
|
156
157
|
this.groupIndices = [];
|
|
157
158
|
this.listBoxId = guid();
|
|
158
159
|
this.optionPrefix = guid();
|
|
@@ -164,16 +165,20 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
164
165
|
this.last = "";
|
|
165
166
|
this.filterFocused = new EventEmitter();
|
|
166
167
|
this.filterBlurred = new EventEmitter();
|
|
167
|
-
this.
|
|
168
|
-
this.
|
|
168
|
+
this.hostElementFocused = new EventEmitter();
|
|
169
|
+
this.hostElementBlurred = new EventEmitter();
|
|
169
170
|
this.selectionSubscription = new Subscription();
|
|
170
171
|
this._open = false;
|
|
171
172
|
this._popupSettings = { animate: true };
|
|
173
|
+
this._size = 'medium';
|
|
174
|
+
this._rounded = 'medium';
|
|
175
|
+
this._fillMode = 'solid';
|
|
172
176
|
validatePackage(packageMetadata);
|
|
173
177
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
174
178
|
this.data = [];
|
|
175
179
|
this.subscribeEvents();
|
|
176
180
|
this.subscribeTouchEvents();
|
|
181
|
+
this.subscribeFocusEvents();
|
|
177
182
|
this.popupMouseDownHandler = this.onMouseDown.bind(this);
|
|
178
183
|
}
|
|
179
184
|
DropDownListComponent_1 = DropDownListComponent;
|
|
@@ -382,11 +387,88 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
382
387
|
enumerable: true,
|
|
383
388
|
configurable: true
|
|
384
389
|
});
|
|
390
|
+
Object.defineProperty(DropDownListComponent.prototype, "size", {
|
|
391
|
+
get: function () {
|
|
392
|
+
return this._size;
|
|
393
|
+
},
|
|
394
|
+
/**
|
|
395
|
+
* Sets the size of the component.
|
|
396
|
+
*
|
|
397
|
+
* The possible values are:
|
|
398
|
+
* * `'small'`
|
|
399
|
+
* * `'medium'` (default)
|
|
400
|
+
* * `'large'`
|
|
401
|
+
* * `null`
|
|
402
|
+
*
|
|
403
|
+
*/
|
|
404
|
+
set: function (size) {
|
|
405
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('picker', this.size));
|
|
406
|
+
if (size) {
|
|
407
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('picker', size));
|
|
408
|
+
}
|
|
409
|
+
this._size = size;
|
|
410
|
+
},
|
|
411
|
+
enumerable: true,
|
|
412
|
+
configurable: true
|
|
413
|
+
});
|
|
414
|
+
Object.defineProperty(DropDownListComponent.prototype, "rounded", {
|
|
415
|
+
get: function () {
|
|
416
|
+
return this._rounded;
|
|
417
|
+
},
|
|
418
|
+
/**
|
|
419
|
+
* Sets the border radius of the component.
|
|
420
|
+
*
|
|
421
|
+
* The possible values are:
|
|
422
|
+
* * `'small'`
|
|
423
|
+
* * `'medium'` (default)
|
|
424
|
+
* * `'large'`
|
|
425
|
+
* * `'full'`
|
|
426
|
+
* * `null`
|
|
427
|
+
*
|
|
428
|
+
*/
|
|
429
|
+
set: function (rounded) {
|
|
430
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
431
|
+
if (rounded) {
|
|
432
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(rounded));
|
|
433
|
+
}
|
|
434
|
+
this._rounded = rounded;
|
|
435
|
+
},
|
|
436
|
+
enumerable: true,
|
|
437
|
+
configurable: true
|
|
438
|
+
});
|
|
439
|
+
Object.defineProperty(DropDownListComponent.prototype, "fillMode", {
|
|
440
|
+
get: function () {
|
|
441
|
+
return this._fillMode;
|
|
442
|
+
},
|
|
443
|
+
/**
|
|
444
|
+
* Sets the fillMode of the component.
|
|
445
|
+
*
|
|
446
|
+
* The possible values are:
|
|
447
|
+
* * `'flat'`
|
|
448
|
+
* * `'solid'` (default)
|
|
449
|
+
* * `'outline'`
|
|
450
|
+
* * `null`
|
|
451
|
+
*
|
|
452
|
+
*/
|
|
453
|
+
set: function (fillMode) {
|
|
454
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('picker', this.fillMode));
|
|
455
|
+
if (fillMode) {
|
|
456
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('picker', fillMode));
|
|
457
|
+
}
|
|
458
|
+
this._fillMode = fillMode;
|
|
459
|
+
},
|
|
460
|
+
enumerable: true,
|
|
461
|
+
configurable: true
|
|
462
|
+
});
|
|
385
463
|
/**
|
|
386
464
|
* @hidden
|
|
387
465
|
*/
|
|
388
|
-
DropDownListComponent.prototype.blurComponent = function () {
|
|
389
|
-
this.
|
|
466
|
+
DropDownListComponent.prototype.blurComponent = function (event) {
|
|
467
|
+
if (event.target !== this.wrapper.nativeElement) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
event.stopImmediatePropagation();
|
|
471
|
+
this.hostElementBlurred.emit();
|
|
390
472
|
};
|
|
391
473
|
/**
|
|
392
474
|
* @hidden
|
|
@@ -397,9 +479,13 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
397
479
|
/**
|
|
398
480
|
* @hidden
|
|
399
481
|
*/
|
|
400
|
-
DropDownListComponent.prototype.focusComponent = function () {
|
|
482
|
+
DropDownListComponent.prototype.focusComponent = function (event) {
|
|
401
483
|
var _this = this;
|
|
402
|
-
this.
|
|
484
|
+
if (event.target !== this.wrapper.nativeElement) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
event.stopImmediatePropagation();
|
|
488
|
+
this.hostElementFocused.emit();
|
|
403
489
|
if (!this.isFocused) {
|
|
404
490
|
this.isFocused = true;
|
|
405
491
|
if (hasObservers(this.onFocus)) {
|
|
@@ -409,6 +495,80 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
409
495
|
}
|
|
410
496
|
}
|
|
411
497
|
};
|
|
498
|
+
/**
|
|
499
|
+
* @hidden
|
|
500
|
+
*/
|
|
501
|
+
DropDownListComponent.prototype.onResize = function () {
|
|
502
|
+
if (this._open) {
|
|
503
|
+
var popupWrapper = this.popupRef.popupElement;
|
|
504
|
+
var _a = this.width, min = _a.min, max = _a.max;
|
|
505
|
+
popupWrapper.style.minWidth = min;
|
|
506
|
+
popupWrapper.style.width = max;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
Object.defineProperty(DropDownListComponent.prototype, "isDisabled", {
|
|
510
|
+
get: function () {
|
|
511
|
+
return this.disabled;
|
|
512
|
+
},
|
|
513
|
+
enumerable: true,
|
|
514
|
+
configurable: true
|
|
515
|
+
});
|
|
516
|
+
Object.defineProperty(DropDownListComponent.prototype, "isLoading", {
|
|
517
|
+
get: function () {
|
|
518
|
+
return this.loading;
|
|
519
|
+
},
|
|
520
|
+
enumerable: true,
|
|
521
|
+
configurable: true
|
|
522
|
+
});
|
|
523
|
+
Object.defineProperty(DropDownListComponent.prototype, "dir", {
|
|
524
|
+
get: function () {
|
|
525
|
+
return this.direction;
|
|
526
|
+
},
|
|
527
|
+
enumerable: true,
|
|
528
|
+
configurable: true
|
|
529
|
+
});
|
|
530
|
+
Object.defineProperty(DropDownListComponent.prototype, "hostTabIndex", {
|
|
531
|
+
get: function () {
|
|
532
|
+
return this.widgetTabIndex;
|
|
533
|
+
},
|
|
534
|
+
enumerable: true,
|
|
535
|
+
configurable: true
|
|
536
|
+
});
|
|
537
|
+
Object.defineProperty(DropDownListComponent.prototype, "isReadonly", {
|
|
538
|
+
get: function () {
|
|
539
|
+
return this.readonly;
|
|
540
|
+
},
|
|
541
|
+
enumerable: true,
|
|
542
|
+
configurable: true
|
|
543
|
+
});
|
|
544
|
+
Object.defineProperty(DropDownListComponent.prototype, "isAriaExpanded", {
|
|
545
|
+
get: function () {
|
|
546
|
+
return this.ariaExpanded;
|
|
547
|
+
},
|
|
548
|
+
enumerable: true,
|
|
549
|
+
configurable: true
|
|
550
|
+
});
|
|
551
|
+
Object.defineProperty(DropDownListComponent.prototype, "hostAriaOwns", {
|
|
552
|
+
get: function () {
|
|
553
|
+
return this.ariaOwns;
|
|
554
|
+
},
|
|
555
|
+
enumerable: true,
|
|
556
|
+
configurable: true
|
|
557
|
+
});
|
|
558
|
+
Object.defineProperty(DropDownListComponent.prototype, "hostAriaActivedescendant", {
|
|
559
|
+
get: function () {
|
|
560
|
+
return this.ariaActivedescendant;
|
|
561
|
+
},
|
|
562
|
+
enumerable: true,
|
|
563
|
+
configurable: true
|
|
564
|
+
});
|
|
565
|
+
Object.defineProperty(DropDownListComponent.prototype, "hostNoDataLabel", {
|
|
566
|
+
get: function () {
|
|
567
|
+
return this.noDataLabel;
|
|
568
|
+
},
|
|
569
|
+
enumerable: true,
|
|
570
|
+
configurable: true
|
|
571
|
+
});
|
|
412
572
|
/**
|
|
413
573
|
* @hidden
|
|
414
574
|
*/
|
|
@@ -469,30 +629,12 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
469
629
|
this.focus();
|
|
470
630
|
this.togglePopup(!this.isOpen);
|
|
471
631
|
};
|
|
472
|
-
/**
|
|
473
|
-
* @hidden
|
|
474
|
-
*/
|
|
475
|
-
DropDownListComponent.prototype.onResize = function () {
|
|
476
|
-
if (this._open) {
|
|
477
|
-
var popupWrapper = this.popupRef.popupElement;
|
|
478
|
-
var _a = this.width, min = _a.min, max = _a.max;
|
|
479
|
-
popupWrapper.style.minWidth = min;
|
|
480
|
-
popupWrapper.style.width = max;
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
Object.defineProperty(DropDownListComponent.prototype, "dir", {
|
|
484
|
-
get: function () {
|
|
485
|
-
return this.direction;
|
|
486
|
-
},
|
|
487
|
-
enumerable: true,
|
|
488
|
-
configurable: true
|
|
489
|
-
});
|
|
490
632
|
Object.defineProperty(DropDownListComponent.prototype, "isFocused", {
|
|
491
633
|
get: function () {
|
|
492
634
|
return this._isFocused;
|
|
493
635
|
},
|
|
494
636
|
set: function (isFocused) {
|
|
495
|
-
this.renderer[isFocused ? 'addClass' : 'removeClass'](this.wrapper.nativeElement, 'k-
|
|
637
|
+
this.renderer[isFocused ? 'addClass' : 'removeClass'](this.wrapper.nativeElement, 'k-focus');
|
|
496
638
|
this._isFocused = isFocused;
|
|
497
639
|
},
|
|
498
640
|
enumerable: true,
|
|
@@ -500,7 +642,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
500
642
|
});
|
|
501
643
|
DropDownListComponent.prototype.ngOnInit = function () {
|
|
502
644
|
var _this = this;
|
|
503
|
-
this.renderer.removeAttribute(this.
|
|
645
|
+
this.renderer.removeAttribute(this.wrapper.nativeElement, "tabindex");
|
|
504
646
|
this.localizationChangesSubscription = this.localization
|
|
505
647
|
.changes.subscribe(function (_a) {
|
|
506
648
|
var rtl = _a.rtl;
|
|
@@ -509,6 +651,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
509
651
|
});
|
|
510
652
|
this.setMessages();
|
|
511
653
|
this.assignAriaDescribedBy();
|
|
654
|
+
this.setComponentClasses();
|
|
512
655
|
};
|
|
513
656
|
/**
|
|
514
657
|
* @hidden
|
|
@@ -690,6 +833,36 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
690
833
|
enumerable: true,
|
|
691
834
|
configurable: true
|
|
692
835
|
});
|
|
836
|
+
Object.defineProperty(DropDownListComponent.prototype, "selectButtonClasses", {
|
|
837
|
+
/**
|
|
838
|
+
* @hidden
|
|
839
|
+
*/
|
|
840
|
+
get: function () {
|
|
841
|
+
return (this.size ? getSizeClass('button', this.size) : '') + " " + (this.fillMode ? 'k-button-' + this.fillMode : '') + " " + (this.fillMode ? 'k-button-' + this.fillMode + '-base' : '');
|
|
842
|
+
},
|
|
843
|
+
enumerable: true,
|
|
844
|
+
configurable: true
|
|
845
|
+
});
|
|
846
|
+
Object.defineProperty(DropDownListComponent.prototype, "filterInputClasses", {
|
|
847
|
+
/**
|
|
848
|
+
* @hidden
|
|
849
|
+
*/
|
|
850
|
+
get: function () {
|
|
851
|
+
return (this.size ? getSizeClass('input', this.size) : '') + " " + (this.fillMode ? 'k-input-' + this.fillMode : '') + " " + (this.rounded ? getRoundedClass(this.rounded) : '');
|
|
852
|
+
},
|
|
853
|
+
enumerable: true,
|
|
854
|
+
configurable: true
|
|
855
|
+
});
|
|
856
|
+
Object.defineProperty(DropDownListComponent.prototype, "optionLabelSizeClass", {
|
|
857
|
+
/**
|
|
858
|
+
* @hidden
|
|
859
|
+
*/
|
|
860
|
+
get: function () {
|
|
861
|
+
return "" + (this.size ? getSizeClass('list', this.size) : '');
|
|
862
|
+
},
|
|
863
|
+
enumerable: true,
|
|
864
|
+
configurable: true
|
|
865
|
+
});
|
|
693
866
|
Object.defineProperty(DropDownListComponent.prototype, "listContainerClasses", {
|
|
694
867
|
/**
|
|
695
868
|
* @hidden
|
|
@@ -837,13 +1010,13 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
837
1010
|
.subscribe(this.handleEnter.bind(this));
|
|
838
1011
|
this.escSubscription = this.navigationService.esc
|
|
839
1012
|
.subscribe(this.handleEscape.bind(this));
|
|
840
|
-
this.filterBlurredSubscription = this.filterBlurred.pipe(concatMap(function () { return interval(10).pipe(take(1), takeUntil(_this.
|
|
1013
|
+
this.filterBlurredSubscription = this.filterBlurred.pipe(concatMap(function () { return interval(10).pipe(take(1), takeUntil(_this.hostElementFocused)); }))
|
|
841
1014
|
.subscribe(function () {
|
|
842
|
-
_this.
|
|
1015
|
+
_this.hostElementBlurred.emit();
|
|
843
1016
|
});
|
|
844
1017
|
this._zone.runOutsideAngular(function () {
|
|
845
1018
|
_this.componentBlurredSubscription =
|
|
846
|
-
merge(_this.
|
|
1019
|
+
merge(_this.hostElementBlurred.pipe(concatMap(function () { return interval(10).pipe(take(1), takeUntil(_this.filterFocused)); })), _this.navigationService.tab).pipe(tap(function (event) { return event instanceof NavigationEvent && _this.focus(); }), filter(function () { return _this.isFocused; }))
|
|
847
1020
|
.subscribe(function () { return _this.componentBlur(); });
|
|
848
1021
|
});
|
|
849
1022
|
};
|
|
@@ -856,7 +1029,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
856
1029
|
// Roll up DropDownList on iOS when tapped outside
|
|
857
1030
|
return _this.touchstartDisposeHandler = _this.renderer.listen(document, 'touchstart', function (e) {
|
|
858
1031
|
var target = e.target;
|
|
859
|
-
if (_this.isFocused && !inDropDown(_this.
|
|
1032
|
+
if (_this.isFocused && !inDropDown(_this.wrapper, target, _this.popupRef)) {
|
|
860
1033
|
_this._zone.run(function () {
|
|
861
1034
|
if (_this.filterFocused) {
|
|
862
1035
|
// Close popup if filter is focused
|
|
@@ -868,6 +1041,25 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
868
1041
|
});
|
|
869
1042
|
});
|
|
870
1043
|
};
|
|
1044
|
+
DropDownListComponent.prototype.subscribeFocusEvents = function () {
|
|
1045
|
+
var _this = this;
|
|
1046
|
+
if (isDocumentAvailable()) {
|
|
1047
|
+
this.focusComponent = this.focusComponent.bind(this);
|
|
1048
|
+
this.blurComponent = this.blurComponent.bind(this);
|
|
1049
|
+
this._zone.runOutsideAngular(function () {
|
|
1050
|
+
var useCapture = true;
|
|
1051
|
+
document.addEventListener('focus', _this.focusComponent, useCapture);
|
|
1052
|
+
document.addEventListener('blur', _this.blurComponent, useCapture);
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
DropDownListComponent.prototype.unSubscribeFocusEvents = function () {
|
|
1057
|
+
if (isDocumentAvailable()) {
|
|
1058
|
+
var useCapture = true;
|
|
1059
|
+
document.removeEventListener('focus', this.focusComponent, useCapture);
|
|
1060
|
+
document.removeEventListener('blur', this.blurComponent, useCapture);
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
871
1063
|
DropDownListComponent.prototype.unsubscribeEvents = function () {
|
|
872
1064
|
if (!isDocumentAvailable()) {
|
|
873
1065
|
return;
|
|
@@ -879,6 +1071,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
879
1071
|
this.escSubscription.unsubscribe();
|
|
880
1072
|
this.componentBlurredSubscription.unsubscribe();
|
|
881
1073
|
this.filterBlurredSubscription.unsubscribe();
|
|
1074
|
+
this.unSubscribeFocusEvents();
|
|
882
1075
|
if (this.touchstartDisposeHandler) {
|
|
883
1076
|
this.touchstartDisposeHandler();
|
|
884
1077
|
}
|
|
@@ -971,7 +1164,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
971
1164
|
hasObservers(this.close) ||
|
|
972
1165
|
hasObservers(this.onBlur) ||
|
|
973
1166
|
hasObservers(this.filterChange) ||
|
|
974
|
-
isUntouched(this.
|
|
1167
|
+
isUntouched(this.wrapper.nativeElement)) {
|
|
975
1168
|
this._zone.run(function () {
|
|
976
1169
|
if (valueHasChanged) {
|
|
977
1170
|
_this.selectionService.change(_this.selectionService.selected[0]);
|
|
@@ -1155,11 +1348,18 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1155
1348
|
var newValue = (this.valueLabelId + " " + trimmed).trim();
|
|
1156
1349
|
this.renderer.setAttribute(this.wrapper.nativeElement, 'aria-describedby', newValue);
|
|
1157
1350
|
};
|
|
1351
|
+
DropDownListComponent.prototype.setComponentClasses = function () {
|
|
1352
|
+
if (this.size) {
|
|
1353
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('picker', this.size));
|
|
1354
|
+
}
|
|
1355
|
+
if (this.rounded) {
|
|
1356
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
1357
|
+
}
|
|
1358
|
+
if (this.fillMode) {
|
|
1359
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('picker', this.fillMode));
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1158
1362
|
var DropDownListComponent_1;
|
|
1159
|
-
tslib_1.__decorate([
|
|
1160
|
-
Input(),
|
|
1161
|
-
tslib_1.__metadata("design:type", String)
|
|
1162
|
-
], DropDownListComponent.prototype, "focusableId", void 0);
|
|
1163
1363
|
tslib_1.__decorate([
|
|
1164
1364
|
Input(),
|
|
1165
1365
|
tslib_1.__metadata("design:type", String)
|
|
@@ -1243,6 +1443,21 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1243
1443
|
tslib_1.__metadata("design:type", Number),
|
|
1244
1444
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
1245
1445
|
], DropDownListComponent.prototype, "tabIndex", null);
|
|
1446
|
+
tslib_1.__decorate([
|
|
1447
|
+
Input(),
|
|
1448
|
+
tslib_1.__metadata("design:type", String),
|
|
1449
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1450
|
+
], DropDownListComponent.prototype, "size", null);
|
|
1451
|
+
tslib_1.__decorate([
|
|
1452
|
+
Input(),
|
|
1453
|
+
tslib_1.__metadata("design:type", String),
|
|
1454
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1455
|
+
], DropDownListComponent.prototype, "rounded", null);
|
|
1456
|
+
tslib_1.__decorate([
|
|
1457
|
+
Input(),
|
|
1458
|
+
tslib_1.__metadata("design:type", String),
|
|
1459
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1460
|
+
], DropDownListComponent.prototype, "fillMode", null);
|
|
1246
1461
|
tslib_1.__decorate([
|
|
1247
1462
|
Output(),
|
|
1248
1463
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1315,24 +1530,90 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1315
1530
|
ViewChild('popupTemplate', { static: true }),
|
|
1316
1531
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
1317
1532
|
], DropDownListComponent.prototype, "popupTemplate", void 0);
|
|
1318
|
-
tslib_1.__decorate([
|
|
1319
|
-
ViewChild('wrapper', { static: true }),
|
|
1320
|
-
tslib_1.__metadata("design:type", ElementRef)
|
|
1321
|
-
], DropDownListComponent.prototype, "wrapper", void 0);
|
|
1322
1533
|
tslib_1.__decorate([
|
|
1323
1534
|
ViewChild('optionsList', { static: false }),
|
|
1324
1535
|
tslib_1.__metadata("design:type", ListComponent)
|
|
1325
1536
|
], DropDownListComponent.prototype, "optionsList", void 0);
|
|
1326
1537
|
tslib_1.__decorate([
|
|
1327
|
-
HostBinding('class.k-
|
|
1328
|
-
HostBinding('class.k-
|
|
1538
|
+
HostBinding('class.k-dropdownlist'),
|
|
1539
|
+
HostBinding('class.k-picker'),
|
|
1329
1540
|
tslib_1.__metadata("design:type", Boolean)
|
|
1330
|
-
], DropDownListComponent.prototype, "
|
|
1541
|
+
], DropDownListComponent.prototype, "hostClasses", void 0);
|
|
1542
|
+
tslib_1.__decorate([
|
|
1543
|
+
HostBinding('class.k-disabled'),
|
|
1544
|
+
HostBinding('attr.aria-disabled'),
|
|
1545
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1546
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1547
|
+
], DropDownListComponent.prototype, "isDisabled", null);
|
|
1548
|
+
tslib_1.__decorate([
|
|
1549
|
+
HostBinding('class.k-loading'),
|
|
1550
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1551
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1552
|
+
], DropDownListComponent.prototype, "isLoading", null);
|
|
1553
|
+
tslib_1.__decorate([
|
|
1554
|
+
Input('id'),
|
|
1555
|
+
HostBinding('attr.id'),
|
|
1556
|
+
tslib_1.__metadata("design:type", String)
|
|
1557
|
+
], DropDownListComponent.prototype, "focusableId", void 0);
|
|
1331
1558
|
tslib_1.__decorate([
|
|
1332
1559
|
HostBinding('attr.dir'),
|
|
1333
1560
|
tslib_1.__metadata("design:type", String),
|
|
1334
1561
|
tslib_1.__metadata("design:paramtypes", [])
|
|
1335
1562
|
], DropDownListComponent.prototype, "dir", null);
|
|
1563
|
+
tslib_1.__decorate([
|
|
1564
|
+
HostBinding('attr.tabindex'),
|
|
1565
|
+
tslib_1.__metadata("design:type", Number),
|
|
1566
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1567
|
+
], DropDownListComponent.prototype, "hostTabIndex", null);
|
|
1568
|
+
tslib_1.__decorate([
|
|
1569
|
+
HostBinding('attr.readonly'),
|
|
1570
|
+
HostBinding('attr.aria-readonly'),
|
|
1571
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1572
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1573
|
+
], DropDownListComponent.prototype, "isReadonly", null);
|
|
1574
|
+
tslib_1.__decorate([
|
|
1575
|
+
HostBinding('attr.role'),
|
|
1576
|
+
HostBinding('attr.aria-haspopup'),
|
|
1577
|
+
tslib_1.__metadata("design:type", String)
|
|
1578
|
+
], DropDownListComponent.prototype, "role", void 0);
|
|
1579
|
+
tslib_1.__decorate([
|
|
1580
|
+
HostBinding('attr.aria-expanded'),
|
|
1581
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1582
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1583
|
+
], DropDownListComponent.prototype, "isAriaExpanded", null);
|
|
1584
|
+
tslib_1.__decorate([
|
|
1585
|
+
HostBinding('attr.aria-owns'),
|
|
1586
|
+
tslib_1.__metadata("design:type", String),
|
|
1587
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1588
|
+
], DropDownListComponent.prototype, "hostAriaOwns", null);
|
|
1589
|
+
tslib_1.__decorate([
|
|
1590
|
+
HostBinding('attr.aria-activedescendant'),
|
|
1591
|
+
tslib_1.__metadata("design:type", String),
|
|
1592
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1593
|
+
], DropDownListComponent.prototype, "hostAriaActivedescendant", null);
|
|
1594
|
+
tslib_1.__decorate([
|
|
1595
|
+
HostBinding('attr.aria-label'),
|
|
1596
|
+
tslib_1.__metadata("design:type", String),
|
|
1597
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1598
|
+
], DropDownListComponent.prototype, "hostNoDataLabel", null);
|
|
1599
|
+
tslib_1.__decorate([
|
|
1600
|
+
HostListener('keydown', ['$event']),
|
|
1601
|
+
tslib_1.__metadata("design:type", Function),
|
|
1602
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
1603
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
1604
|
+
], DropDownListComponent.prototype, "keydown", null);
|
|
1605
|
+
tslib_1.__decorate([
|
|
1606
|
+
HostListener('keypress', ['$event']),
|
|
1607
|
+
tslib_1.__metadata("design:type", Function),
|
|
1608
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
1609
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
1610
|
+
], DropDownListComponent.prototype, "keypress", null);
|
|
1611
|
+
tslib_1.__decorate([
|
|
1612
|
+
HostListener('click', ['$event']),
|
|
1613
|
+
tslib_1.__metadata("design:type", Function),
|
|
1614
|
+
tslib_1.__metadata("design:paramtypes", [MouseEvent]),
|
|
1615
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
1616
|
+
], DropDownListComponent.prototype, "click", null);
|
|
1336
1617
|
DropDownListComponent = DropDownListComponent_1 = tslib_1.__decorate([
|
|
1337
1618
|
Component({
|
|
1338
1619
|
exportAs: 'kendoDropDownList',
|
|
@@ -1355,10 +1636,11 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1355
1636
|
}
|
|
1356
1637
|
],
|
|
1357
1638
|
selector: 'kendo-dropdownlist',
|
|
1358
|
-
template: "\n <ng-container kendoDropDownListLocalizedMessages\n i18n-noDataText=\"kendo.dropdownlist.noDataText|The text displayed in the popup when there are no items\"\n noDataText=\"NO DATA FOUND\"\n >\n </ng-container>\n <span
|
|
1639
|
+
template: "\n <ng-container kendoDropDownListLocalizedMessages\n i18n-noDataText=\"kendo.dropdownlist.noDataText|The text displayed in the popup when there are no items\"\n noDataText=\"NO DATA FOUND\"\n >\n </ng-container>\n <span class=\"k-input-inner\" unselectable=\"on\" [id]=\"valueLabelId\">\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\">{{ getText() }}</ng-template>\n </span>\n </span>\n <button\n tabindex=\"-1\"\n unselectable=\"on\"\n type=\"button\"\n class=\"k-input-button k-button k-icon-button\"\n [ngClass]=\"selectButtonClasses\"\n [kendoEventsOutsideAngular]=\"{\n mousedown: onMouseDown\n }\"\n >\n <span\n class=\"k-button-icon k-icon\"\n unselectable=\"on\"\n [ngClass]=\"buttonClasses\"\n ></span>\n </button>\n <ng-template #popupTemplate>\n <!--filterable-->\n\n <ng-template [ngIf]=\"filterable\">\n <div class=\"k-list-filter\" (click)=\"$event.stopImmediatePropagation()\">\n <span\n class=\"k-searchbox k-input\"\n [ngClass]=\"filterInputClasses\"\n >\n <span class=\"k-input-icon k-icon k-i-search\" unselectable=\"on\"></span>\n <input\n [attr.aria-owns]=\"ariaOwns\"\n [attr.aria-activedescendant]=\"ariaActivedescendant\"\n [attr.aria-label]=\"noDataLabel\"\n tabindex=\"-1\"\n [filterInput]=\"isFocused && !touchEnabled\"\n [dir]=\"direction\"\n [(ngModel)]=\"filterText\"\n class=\"k-input-inner\"\n (keydown)=\"keydown($event)\"\n (input)=\"handleFilter($event)\"\n (focus)=\"onFilterFocus()\"\n (blur)=\"blurFilterInput()\" />\n </span>\n </div>\n </ng-template>\n <!--default item-->\n <ng-template [ngIf]=\"defaultItem && !itemTemplate\">\n <div\n class=\"k-list\"\n [ngClass]=\"optionLabelSizeClass\"\n >\n <div class=\"k-list-optionlabel k-list-item\" [ngClass]=\"{ 'k-disabled': isDisabledDefaultItem }\" kendoDropDownsSelectable [index]=\"-1\">\n {{ getDefaultItemText() }}\n </div>\n </div>\n </ng-template>\n <ng-template [ngIf]=\"defaultItem && itemTemplate\">\n <div\n class=\"k-list\"\n [ngClass]=\"optionLabelSizeClass\"\n >\n <div class=\"k-list-optionlabel k-list-item\" [ngClass]=\"{ 'k-disabled': isDisabledDefaultItem }\" kendoDropDownsSelectable [index]=\"-1\">\n <ng-template\n [templateContext]=\"{\n templateRef: itemTemplate.templateRef,\n $implicit: defaultItem\n }\">\n </ng-template>\n </div>\n </div>\n </ng-template>\n <!--header template-->\n <ng-template *ngIf=\"headerTemplate\"\n [templateContext]=\"{\n templateRef: headerTemplate.templateRef\n }\">\n </ng-template>\n <!--list-->\n <kendo-list\n #optionsList\n [size]=\"size\"\n [rounded]=\"rounded\"\n [id]=\"listBoxId\"\n [optionPrefix]=\"optionPrefix\"\n [data]=\"data\"\n [textField]=\"textField\"\n [valueField]=\"valueField\"\n [template]=\"itemTemplate\"\n [groupTemplate]=\"groupTemplate\"\n [fixedGroupTemplate]=\"fixedGroupTemplate\"\n [height]=\"listHeight\"\n [show]=\"isOpen\"\n [virtual]=\"virtual\"\n (pageChange)=\"pageChange($event)\"\n >\n </kendo-list>\n <!--no-data template-->\n <div class=\"k-no-data\" *ngIf=\"data.length === 0\">\n <ng-template [ngIf]=\"noDataTemplate\"\n [templateContext]=\"{\n templateRef: noDataTemplate ? noDataTemplate.templateRef : undefined\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!noDataTemplate\">\n <div>{{ noDataText }}</div>\n </ng-template>\n </div>\n <!--footer template-->\n <ng-template *ngIf=\"footerTemplate\"\n [templateContext]=\"{\n templateRef: footerTemplate.templateRef\n }\">\n </ng-template>\n </ng-template>\n <ng-template [ngIf]=\"isOpen\">\n <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n </ng-template>\n <ng-container #container></ng-container>\n "
|
|
1359
1640
|
}),
|
|
1360
1641
|
tslib_1.__param(10, Optional()), tslib_1.__param(10, Inject(TOUCH_ENABLED)),
|
|
1361
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
1642
|
+
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
1643
|
+
LocalizationService,
|
|
1362
1644
|
PopupService,
|
|
1363
1645
|
SelectionService,
|
|
1364
1646
|
NavigationService,
|
|
@@ -1366,7 +1648,6 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1366
1648
|
DataService,
|
|
1367
1649
|
NgZone,
|
|
1368
1650
|
Renderer2,
|
|
1369
|
-
ElementRef,
|
|
1370
1651
|
ChangeDetectorRef, Boolean])
|
|
1371
1652
|
], DropDownListComponent);
|
|
1372
1653
|
return DropDownListComponent;
|