@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
|
@@ -61,7 +61,8 @@ exports.DROPDOWNLIST_VALUE_ACCESSOR = {
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
var DropDownListComponent = /** @class */ (function () {
|
|
64
|
-
function DropDownListComponent(localization, popupService, selectionService, navigationService, disabledItemsService, dataService, _zone, renderer,
|
|
64
|
+
function DropDownListComponent(wrapper, localization, popupService, selectionService, navigationService, disabledItemsService, dataService, _zone, renderer, cdr, touchEnabled) {
|
|
65
|
+
this.wrapper = wrapper;
|
|
65
66
|
this.localization = localization;
|
|
66
67
|
this.popupService = popupService;
|
|
67
68
|
this.selectionService = selectionService;
|
|
@@ -70,13 +71,8 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
70
71
|
this.dataService = dataService;
|
|
71
72
|
this._zone = _zone;
|
|
72
73
|
this.renderer = renderer;
|
|
73
|
-
this.hostElement = hostElement;
|
|
74
74
|
this.cdr = cdr;
|
|
75
75
|
this.touchEnabled = touchEnabled;
|
|
76
|
-
/**
|
|
77
|
-
* @hidden
|
|
78
|
-
*/
|
|
79
|
-
this.focusableId = "k-" + util_1.guid();
|
|
80
76
|
/**
|
|
81
77
|
* Sets the height of the options list. By default, `listHeight` is 200px.
|
|
82
78
|
*
|
|
@@ -154,7 +150,12 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
154
150
|
* Fires each time the DropDownList gets blurred.
|
|
155
151
|
*/
|
|
156
152
|
this.onBlur = new core_1.EventEmitter();
|
|
157
|
-
this.
|
|
153
|
+
this.hostClasses = true;
|
|
154
|
+
/**
|
|
155
|
+
* @hidden
|
|
156
|
+
*/
|
|
157
|
+
this.focusableId = "k-" + util_1.guid();
|
|
158
|
+
this.role = 'listbox';
|
|
158
159
|
this.groupIndices = [];
|
|
159
160
|
this.listBoxId = util_1.guid();
|
|
160
161
|
this.optionPrefix = util_1.guid();
|
|
@@ -166,16 +167,20 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
166
167
|
this.last = "";
|
|
167
168
|
this.filterFocused = new core_1.EventEmitter();
|
|
168
169
|
this.filterBlurred = new core_1.EventEmitter();
|
|
169
|
-
this.
|
|
170
|
-
this.
|
|
170
|
+
this.hostElementFocused = new core_1.EventEmitter();
|
|
171
|
+
this.hostElementBlurred = new core_1.EventEmitter();
|
|
171
172
|
this.selectionSubscription = new rxjs_1.Subscription();
|
|
172
173
|
this._open = false;
|
|
173
174
|
this._popupSettings = { animate: true };
|
|
175
|
+
this._size = 'medium';
|
|
176
|
+
this._rounded = 'medium';
|
|
177
|
+
this._fillMode = 'solid';
|
|
174
178
|
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
175
179
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
176
180
|
this.data = [];
|
|
177
181
|
this.subscribeEvents();
|
|
178
182
|
this.subscribeTouchEvents();
|
|
183
|
+
this.subscribeFocusEvents();
|
|
179
184
|
this.popupMouseDownHandler = this.onMouseDown.bind(this);
|
|
180
185
|
}
|
|
181
186
|
DropDownListComponent_1 = DropDownListComponent;
|
|
@@ -384,11 +389,88 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
384
389
|
enumerable: true,
|
|
385
390
|
configurable: true
|
|
386
391
|
});
|
|
392
|
+
Object.defineProperty(DropDownListComponent.prototype, "size", {
|
|
393
|
+
get: function () {
|
|
394
|
+
return this._size;
|
|
395
|
+
},
|
|
396
|
+
/**
|
|
397
|
+
* Sets the size of the component.
|
|
398
|
+
*
|
|
399
|
+
* The possible values are:
|
|
400
|
+
* * `'small'`
|
|
401
|
+
* * `'medium'` (default)
|
|
402
|
+
* * `'large'`
|
|
403
|
+
* * `null`
|
|
404
|
+
*
|
|
405
|
+
*/
|
|
406
|
+
set: function (size) {
|
|
407
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getSizeClass('picker', this.size));
|
|
408
|
+
if (size) {
|
|
409
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('picker', size));
|
|
410
|
+
}
|
|
411
|
+
this._size = size;
|
|
412
|
+
},
|
|
413
|
+
enumerable: true,
|
|
414
|
+
configurable: true
|
|
415
|
+
});
|
|
416
|
+
Object.defineProperty(DropDownListComponent.prototype, "rounded", {
|
|
417
|
+
get: function () {
|
|
418
|
+
return this._rounded;
|
|
419
|
+
},
|
|
420
|
+
/**
|
|
421
|
+
* Sets the border radius of the component.
|
|
422
|
+
*
|
|
423
|
+
* The possible values are:
|
|
424
|
+
* * `'small'`
|
|
425
|
+
* * `'medium'` (default)
|
|
426
|
+
* * `'large'`
|
|
427
|
+
* * `'full'`
|
|
428
|
+
* * `null`
|
|
429
|
+
*
|
|
430
|
+
*/
|
|
431
|
+
set: function (rounded) {
|
|
432
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getRoundedClass(this.rounded));
|
|
433
|
+
if (rounded) {
|
|
434
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getRoundedClass(rounded));
|
|
435
|
+
}
|
|
436
|
+
this._rounded = rounded;
|
|
437
|
+
},
|
|
438
|
+
enumerable: true,
|
|
439
|
+
configurable: true
|
|
440
|
+
});
|
|
441
|
+
Object.defineProperty(DropDownListComponent.prototype, "fillMode", {
|
|
442
|
+
get: function () {
|
|
443
|
+
return this._fillMode;
|
|
444
|
+
},
|
|
445
|
+
/**
|
|
446
|
+
* Sets the fillMode of the component.
|
|
447
|
+
*
|
|
448
|
+
* The possible values are:
|
|
449
|
+
* * `'flat'`
|
|
450
|
+
* * `'solid'` (default)
|
|
451
|
+
* * `'outline'`
|
|
452
|
+
* * `null`
|
|
453
|
+
*
|
|
454
|
+
*/
|
|
455
|
+
set: function (fillMode) {
|
|
456
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getFillModeClass('picker', this.fillMode));
|
|
457
|
+
if (fillMode) {
|
|
458
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getFillModeClass('picker', fillMode));
|
|
459
|
+
}
|
|
460
|
+
this._fillMode = fillMode;
|
|
461
|
+
},
|
|
462
|
+
enumerable: true,
|
|
463
|
+
configurable: true
|
|
464
|
+
});
|
|
387
465
|
/**
|
|
388
466
|
* @hidden
|
|
389
467
|
*/
|
|
390
|
-
DropDownListComponent.prototype.blurComponent = function () {
|
|
391
|
-
this.
|
|
468
|
+
DropDownListComponent.prototype.blurComponent = function (event) {
|
|
469
|
+
if (event.target !== this.wrapper.nativeElement) {
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
event.stopImmediatePropagation();
|
|
473
|
+
this.hostElementBlurred.emit();
|
|
392
474
|
};
|
|
393
475
|
/**
|
|
394
476
|
* @hidden
|
|
@@ -399,9 +481,13 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
399
481
|
/**
|
|
400
482
|
* @hidden
|
|
401
483
|
*/
|
|
402
|
-
DropDownListComponent.prototype.focusComponent = function () {
|
|
484
|
+
DropDownListComponent.prototype.focusComponent = function (event) {
|
|
403
485
|
var _this = this;
|
|
404
|
-
this.
|
|
486
|
+
if (event.target !== this.wrapper.nativeElement) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
event.stopImmediatePropagation();
|
|
490
|
+
this.hostElementFocused.emit();
|
|
405
491
|
if (!this.isFocused) {
|
|
406
492
|
this.isFocused = true;
|
|
407
493
|
if (kendo_angular_common_1.hasObservers(this.onFocus)) {
|
|
@@ -411,6 +497,80 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
411
497
|
}
|
|
412
498
|
}
|
|
413
499
|
};
|
|
500
|
+
/**
|
|
501
|
+
* @hidden
|
|
502
|
+
*/
|
|
503
|
+
DropDownListComponent.prototype.onResize = function () {
|
|
504
|
+
if (this._open) {
|
|
505
|
+
var popupWrapper = this.popupRef.popupElement;
|
|
506
|
+
var _a = this.width, min = _a.min, max = _a.max;
|
|
507
|
+
popupWrapper.style.minWidth = min;
|
|
508
|
+
popupWrapper.style.width = max;
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
Object.defineProperty(DropDownListComponent.prototype, "isDisabled", {
|
|
512
|
+
get: function () {
|
|
513
|
+
return this.disabled;
|
|
514
|
+
},
|
|
515
|
+
enumerable: true,
|
|
516
|
+
configurable: true
|
|
517
|
+
});
|
|
518
|
+
Object.defineProperty(DropDownListComponent.prototype, "isLoading", {
|
|
519
|
+
get: function () {
|
|
520
|
+
return this.loading;
|
|
521
|
+
},
|
|
522
|
+
enumerable: true,
|
|
523
|
+
configurable: true
|
|
524
|
+
});
|
|
525
|
+
Object.defineProperty(DropDownListComponent.prototype, "dir", {
|
|
526
|
+
get: function () {
|
|
527
|
+
return this.direction;
|
|
528
|
+
},
|
|
529
|
+
enumerable: true,
|
|
530
|
+
configurable: true
|
|
531
|
+
});
|
|
532
|
+
Object.defineProperty(DropDownListComponent.prototype, "hostTabIndex", {
|
|
533
|
+
get: function () {
|
|
534
|
+
return this.widgetTabIndex;
|
|
535
|
+
},
|
|
536
|
+
enumerable: true,
|
|
537
|
+
configurable: true
|
|
538
|
+
});
|
|
539
|
+
Object.defineProperty(DropDownListComponent.prototype, "isReadonly", {
|
|
540
|
+
get: function () {
|
|
541
|
+
return this.readonly;
|
|
542
|
+
},
|
|
543
|
+
enumerable: true,
|
|
544
|
+
configurable: true
|
|
545
|
+
});
|
|
546
|
+
Object.defineProperty(DropDownListComponent.prototype, "isAriaExpanded", {
|
|
547
|
+
get: function () {
|
|
548
|
+
return this.ariaExpanded;
|
|
549
|
+
},
|
|
550
|
+
enumerable: true,
|
|
551
|
+
configurable: true
|
|
552
|
+
});
|
|
553
|
+
Object.defineProperty(DropDownListComponent.prototype, "hostAriaOwns", {
|
|
554
|
+
get: function () {
|
|
555
|
+
return this.ariaOwns;
|
|
556
|
+
},
|
|
557
|
+
enumerable: true,
|
|
558
|
+
configurable: true
|
|
559
|
+
});
|
|
560
|
+
Object.defineProperty(DropDownListComponent.prototype, "hostAriaActivedescendant", {
|
|
561
|
+
get: function () {
|
|
562
|
+
return this.ariaActivedescendant;
|
|
563
|
+
},
|
|
564
|
+
enumerable: true,
|
|
565
|
+
configurable: true
|
|
566
|
+
});
|
|
567
|
+
Object.defineProperty(DropDownListComponent.prototype, "hostNoDataLabel", {
|
|
568
|
+
get: function () {
|
|
569
|
+
return this.noDataLabel;
|
|
570
|
+
},
|
|
571
|
+
enumerable: true,
|
|
572
|
+
configurable: true
|
|
573
|
+
});
|
|
414
574
|
/**
|
|
415
575
|
* @hidden
|
|
416
576
|
*/
|
|
@@ -471,30 +631,12 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
471
631
|
this.focus();
|
|
472
632
|
this.togglePopup(!this.isOpen);
|
|
473
633
|
};
|
|
474
|
-
/**
|
|
475
|
-
* @hidden
|
|
476
|
-
*/
|
|
477
|
-
DropDownListComponent.prototype.onResize = function () {
|
|
478
|
-
if (this._open) {
|
|
479
|
-
var popupWrapper = this.popupRef.popupElement;
|
|
480
|
-
var _a = this.width, min = _a.min, max = _a.max;
|
|
481
|
-
popupWrapper.style.minWidth = min;
|
|
482
|
-
popupWrapper.style.width = max;
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
Object.defineProperty(DropDownListComponent.prototype, "dir", {
|
|
486
|
-
get: function () {
|
|
487
|
-
return this.direction;
|
|
488
|
-
},
|
|
489
|
-
enumerable: true,
|
|
490
|
-
configurable: true
|
|
491
|
-
});
|
|
492
634
|
Object.defineProperty(DropDownListComponent.prototype, "isFocused", {
|
|
493
635
|
get: function () {
|
|
494
636
|
return this._isFocused;
|
|
495
637
|
},
|
|
496
638
|
set: function (isFocused) {
|
|
497
|
-
this.renderer[isFocused ? 'addClass' : 'removeClass'](this.wrapper.nativeElement, 'k-
|
|
639
|
+
this.renderer[isFocused ? 'addClass' : 'removeClass'](this.wrapper.nativeElement, 'k-focus');
|
|
498
640
|
this._isFocused = isFocused;
|
|
499
641
|
},
|
|
500
642
|
enumerable: true,
|
|
@@ -502,7 +644,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
502
644
|
});
|
|
503
645
|
DropDownListComponent.prototype.ngOnInit = function () {
|
|
504
646
|
var _this = this;
|
|
505
|
-
this.renderer.removeAttribute(this.
|
|
647
|
+
this.renderer.removeAttribute(this.wrapper.nativeElement, "tabindex");
|
|
506
648
|
this.localizationChangesSubscription = this.localization
|
|
507
649
|
.changes.subscribe(function (_a) {
|
|
508
650
|
var rtl = _a.rtl;
|
|
@@ -511,6 +653,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
511
653
|
});
|
|
512
654
|
this.setMessages();
|
|
513
655
|
this.assignAriaDescribedBy();
|
|
656
|
+
this.setComponentClasses();
|
|
514
657
|
};
|
|
515
658
|
/**
|
|
516
659
|
* @hidden
|
|
@@ -692,6 +835,36 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
692
835
|
enumerable: true,
|
|
693
836
|
configurable: true
|
|
694
837
|
});
|
|
838
|
+
Object.defineProperty(DropDownListComponent.prototype, "selectButtonClasses", {
|
|
839
|
+
/**
|
|
840
|
+
* @hidden
|
|
841
|
+
*/
|
|
842
|
+
get: function () {
|
|
843
|
+
return (this.size ? util_1.getSizeClass('button', this.size) : '') + " " + (this.fillMode ? 'k-button-' + this.fillMode : '') + " " + (this.fillMode ? 'k-button-' + this.fillMode + '-base' : '');
|
|
844
|
+
},
|
|
845
|
+
enumerable: true,
|
|
846
|
+
configurable: true
|
|
847
|
+
});
|
|
848
|
+
Object.defineProperty(DropDownListComponent.prototype, "filterInputClasses", {
|
|
849
|
+
/**
|
|
850
|
+
* @hidden
|
|
851
|
+
*/
|
|
852
|
+
get: function () {
|
|
853
|
+
return (this.size ? util_1.getSizeClass('input', this.size) : '') + " " + (this.fillMode ? 'k-input-' + this.fillMode : '') + " " + (this.rounded ? util_1.getRoundedClass(this.rounded) : '');
|
|
854
|
+
},
|
|
855
|
+
enumerable: true,
|
|
856
|
+
configurable: true
|
|
857
|
+
});
|
|
858
|
+
Object.defineProperty(DropDownListComponent.prototype, "optionLabelSizeClass", {
|
|
859
|
+
/**
|
|
860
|
+
* @hidden
|
|
861
|
+
*/
|
|
862
|
+
get: function () {
|
|
863
|
+
return "" + (this.size ? util_1.getSizeClass('list', this.size) : '');
|
|
864
|
+
},
|
|
865
|
+
enumerable: true,
|
|
866
|
+
configurable: true
|
|
867
|
+
});
|
|
695
868
|
Object.defineProperty(DropDownListComponent.prototype, "listContainerClasses", {
|
|
696
869
|
/**
|
|
697
870
|
* @hidden
|
|
@@ -839,13 +1012,13 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
839
1012
|
.subscribe(this.handleEnter.bind(this));
|
|
840
1013
|
this.escSubscription = this.navigationService.esc
|
|
841
1014
|
.subscribe(this.handleEscape.bind(this));
|
|
842
|
-
this.filterBlurredSubscription = this.filterBlurred.pipe(operators_1.concatMap(function () { return rxjs_1.interval(10).pipe(operators_1.take(1), operators_1.takeUntil(_this.
|
|
1015
|
+
this.filterBlurredSubscription = this.filterBlurred.pipe(operators_1.concatMap(function () { return rxjs_1.interval(10).pipe(operators_1.take(1), operators_1.takeUntil(_this.hostElementFocused)); }))
|
|
843
1016
|
.subscribe(function () {
|
|
844
|
-
_this.
|
|
1017
|
+
_this.hostElementBlurred.emit();
|
|
845
1018
|
});
|
|
846
1019
|
this._zone.runOutsideAngular(function () {
|
|
847
1020
|
_this.componentBlurredSubscription =
|
|
848
|
-
rxjs_1.merge(_this.
|
|
1021
|
+
rxjs_1.merge(_this.hostElementBlurred.pipe(operators_1.concatMap(function () { return rxjs_1.interval(10).pipe(operators_1.take(1), operators_1.takeUntil(_this.filterFocused)); })), _this.navigationService.tab).pipe(operators_1.tap(function (event) { return event instanceof navigation_service_1.NavigationEvent && _this.focus(); }), operators_1.filter(function () { return _this.isFocused; }))
|
|
849
1022
|
.subscribe(function () { return _this.componentBlur(); });
|
|
850
1023
|
});
|
|
851
1024
|
};
|
|
@@ -858,7 +1031,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
858
1031
|
// Roll up DropDownList on iOS when tapped outside
|
|
859
1032
|
return _this.touchstartDisposeHandler = _this.renderer.listen(document, 'touchstart', function (e) {
|
|
860
1033
|
var target = e.target;
|
|
861
|
-
if (_this.isFocused && !util_1.inDropDown(_this.
|
|
1034
|
+
if (_this.isFocused && !util_1.inDropDown(_this.wrapper, target, _this.popupRef)) {
|
|
862
1035
|
_this._zone.run(function () {
|
|
863
1036
|
if (_this.filterFocused) {
|
|
864
1037
|
// Close popup if filter is focused
|
|
@@ -870,6 +1043,25 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
870
1043
|
});
|
|
871
1044
|
});
|
|
872
1045
|
};
|
|
1046
|
+
DropDownListComponent.prototype.subscribeFocusEvents = function () {
|
|
1047
|
+
var _this = this;
|
|
1048
|
+
if (kendo_angular_common_1.isDocumentAvailable()) {
|
|
1049
|
+
this.focusComponent = this.focusComponent.bind(this);
|
|
1050
|
+
this.blurComponent = this.blurComponent.bind(this);
|
|
1051
|
+
this._zone.runOutsideAngular(function () {
|
|
1052
|
+
var useCapture = true;
|
|
1053
|
+
document.addEventListener('focus', _this.focusComponent, useCapture);
|
|
1054
|
+
document.addEventListener('blur', _this.blurComponent, useCapture);
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
DropDownListComponent.prototype.unSubscribeFocusEvents = function () {
|
|
1059
|
+
if (kendo_angular_common_1.isDocumentAvailable()) {
|
|
1060
|
+
var useCapture = true;
|
|
1061
|
+
document.removeEventListener('focus', this.focusComponent, useCapture);
|
|
1062
|
+
document.removeEventListener('blur', this.blurComponent, useCapture);
|
|
1063
|
+
}
|
|
1064
|
+
};
|
|
873
1065
|
DropDownListComponent.prototype.unsubscribeEvents = function () {
|
|
874
1066
|
if (!kendo_angular_common_1.isDocumentAvailable()) {
|
|
875
1067
|
return;
|
|
@@ -881,6 +1073,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
881
1073
|
this.escSubscription.unsubscribe();
|
|
882
1074
|
this.componentBlurredSubscription.unsubscribe();
|
|
883
1075
|
this.filterBlurredSubscription.unsubscribe();
|
|
1076
|
+
this.unSubscribeFocusEvents();
|
|
884
1077
|
if (this.touchstartDisposeHandler) {
|
|
885
1078
|
this.touchstartDisposeHandler();
|
|
886
1079
|
}
|
|
@@ -973,7 +1166,7 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
973
1166
|
kendo_angular_common_1.hasObservers(this.close) ||
|
|
974
1167
|
kendo_angular_common_1.hasObservers(this.onBlur) ||
|
|
975
1168
|
kendo_angular_common_1.hasObservers(this.filterChange) ||
|
|
976
|
-
util_1.isUntouched(this.
|
|
1169
|
+
util_1.isUntouched(this.wrapper.nativeElement)) {
|
|
977
1170
|
this._zone.run(function () {
|
|
978
1171
|
if (valueHasChanged) {
|
|
979
1172
|
_this.selectionService.change(_this.selectionService.selected[0]);
|
|
@@ -1157,11 +1350,18 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1157
1350
|
var newValue = (this.valueLabelId + " " + trimmed).trim();
|
|
1158
1351
|
this.renderer.setAttribute(this.wrapper.nativeElement, 'aria-describedby', newValue);
|
|
1159
1352
|
};
|
|
1353
|
+
DropDownListComponent.prototype.setComponentClasses = function () {
|
|
1354
|
+
if (this.size) {
|
|
1355
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('picker', this.size));
|
|
1356
|
+
}
|
|
1357
|
+
if (this.rounded) {
|
|
1358
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getRoundedClass(this.rounded));
|
|
1359
|
+
}
|
|
1360
|
+
if (this.fillMode) {
|
|
1361
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getFillModeClass('picker', this.fillMode));
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1160
1364
|
var DropDownListComponent_1;
|
|
1161
|
-
tslib_1.__decorate([
|
|
1162
|
-
core_1.Input(),
|
|
1163
|
-
tslib_1.__metadata("design:type", String)
|
|
1164
|
-
], DropDownListComponent.prototype, "focusableId", void 0);
|
|
1165
1365
|
tslib_1.__decorate([
|
|
1166
1366
|
core_1.Input(),
|
|
1167
1367
|
tslib_1.__metadata("design:type", String)
|
|
@@ -1245,6 +1445,21 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1245
1445
|
tslib_1.__metadata("design:type", Number),
|
|
1246
1446
|
tslib_1.__metadata("design:paramtypes", [Number])
|
|
1247
1447
|
], DropDownListComponent.prototype, "tabIndex", null);
|
|
1448
|
+
tslib_1.__decorate([
|
|
1449
|
+
core_1.Input(),
|
|
1450
|
+
tslib_1.__metadata("design:type", String),
|
|
1451
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1452
|
+
], DropDownListComponent.prototype, "size", null);
|
|
1453
|
+
tslib_1.__decorate([
|
|
1454
|
+
core_1.Input(),
|
|
1455
|
+
tslib_1.__metadata("design:type", String),
|
|
1456
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1457
|
+
], DropDownListComponent.prototype, "rounded", null);
|
|
1458
|
+
tslib_1.__decorate([
|
|
1459
|
+
core_1.Input(),
|
|
1460
|
+
tslib_1.__metadata("design:type", String),
|
|
1461
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1462
|
+
], DropDownListComponent.prototype, "fillMode", null);
|
|
1248
1463
|
tslib_1.__decorate([
|
|
1249
1464
|
core_1.Output(),
|
|
1250
1465
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -1317,24 +1532,90 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1317
1532
|
core_1.ViewChild('popupTemplate', { static: true }),
|
|
1318
1533
|
tslib_1.__metadata("design:type", core_1.TemplateRef)
|
|
1319
1534
|
], DropDownListComponent.prototype, "popupTemplate", void 0);
|
|
1320
|
-
tslib_1.__decorate([
|
|
1321
|
-
core_1.ViewChild('wrapper', { static: true }),
|
|
1322
|
-
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
1323
|
-
], DropDownListComponent.prototype, "wrapper", void 0);
|
|
1324
1535
|
tslib_1.__decorate([
|
|
1325
1536
|
core_1.ViewChild('optionsList', { static: false }),
|
|
1326
1537
|
tslib_1.__metadata("design:type", list_component_1.ListComponent)
|
|
1327
1538
|
], DropDownListComponent.prototype, "optionsList", void 0);
|
|
1328
1539
|
tslib_1.__decorate([
|
|
1329
|
-
core_1.HostBinding('class.k-
|
|
1330
|
-
core_1.HostBinding('class.k-
|
|
1540
|
+
core_1.HostBinding('class.k-dropdownlist'),
|
|
1541
|
+
core_1.HostBinding('class.k-picker'),
|
|
1331
1542
|
tslib_1.__metadata("design:type", Boolean)
|
|
1332
|
-
], DropDownListComponent.prototype, "
|
|
1543
|
+
], DropDownListComponent.prototype, "hostClasses", void 0);
|
|
1544
|
+
tslib_1.__decorate([
|
|
1545
|
+
core_1.HostBinding('class.k-disabled'),
|
|
1546
|
+
core_1.HostBinding('attr.aria-disabled'),
|
|
1547
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1548
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1549
|
+
], DropDownListComponent.prototype, "isDisabled", null);
|
|
1550
|
+
tslib_1.__decorate([
|
|
1551
|
+
core_1.HostBinding('class.k-loading'),
|
|
1552
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1553
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1554
|
+
], DropDownListComponent.prototype, "isLoading", null);
|
|
1555
|
+
tslib_1.__decorate([
|
|
1556
|
+
core_1.Input('id'),
|
|
1557
|
+
core_1.HostBinding('attr.id'),
|
|
1558
|
+
tslib_1.__metadata("design:type", String)
|
|
1559
|
+
], DropDownListComponent.prototype, "focusableId", void 0);
|
|
1333
1560
|
tslib_1.__decorate([
|
|
1334
1561
|
core_1.HostBinding('attr.dir'),
|
|
1335
1562
|
tslib_1.__metadata("design:type", String),
|
|
1336
1563
|
tslib_1.__metadata("design:paramtypes", [])
|
|
1337
1564
|
], DropDownListComponent.prototype, "dir", null);
|
|
1565
|
+
tslib_1.__decorate([
|
|
1566
|
+
core_1.HostBinding('attr.tabindex'),
|
|
1567
|
+
tslib_1.__metadata("design:type", Number),
|
|
1568
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1569
|
+
], DropDownListComponent.prototype, "hostTabIndex", null);
|
|
1570
|
+
tslib_1.__decorate([
|
|
1571
|
+
core_1.HostBinding('attr.readonly'),
|
|
1572
|
+
core_1.HostBinding('attr.aria-readonly'),
|
|
1573
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1574
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1575
|
+
], DropDownListComponent.prototype, "isReadonly", null);
|
|
1576
|
+
tslib_1.__decorate([
|
|
1577
|
+
core_1.HostBinding('attr.role'),
|
|
1578
|
+
core_1.HostBinding('attr.aria-haspopup'),
|
|
1579
|
+
tslib_1.__metadata("design:type", String)
|
|
1580
|
+
], DropDownListComponent.prototype, "role", void 0);
|
|
1581
|
+
tslib_1.__decorate([
|
|
1582
|
+
core_1.HostBinding('attr.aria-expanded'),
|
|
1583
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1584
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1585
|
+
], DropDownListComponent.prototype, "isAriaExpanded", null);
|
|
1586
|
+
tslib_1.__decorate([
|
|
1587
|
+
core_1.HostBinding('attr.aria-owns'),
|
|
1588
|
+
tslib_1.__metadata("design:type", String),
|
|
1589
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1590
|
+
], DropDownListComponent.prototype, "hostAriaOwns", null);
|
|
1591
|
+
tslib_1.__decorate([
|
|
1592
|
+
core_1.HostBinding('attr.aria-activedescendant'),
|
|
1593
|
+
tslib_1.__metadata("design:type", String),
|
|
1594
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1595
|
+
], DropDownListComponent.prototype, "hostAriaActivedescendant", null);
|
|
1596
|
+
tslib_1.__decorate([
|
|
1597
|
+
core_1.HostBinding('attr.aria-label'),
|
|
1598
|
+
tslib_1.__metadata("design:type", String),
|
|
1599
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1600
|
+
], DropDownListComponent.prototype, "hostNoDataLabel", null);
|
|
1601
|
+
tslib_1.__decorate([
|
|
1602
|
+
core_1.HostListener('keydown', ['$event']),
|
|
1603
|
+
tslib_1.__metadata("design:type", Function),
|
|
1604
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
1605
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
1606
|
+
], DropDownListComponent.prototype, "keydown", null);
|
|
1607
|
+
tslib_1.__decorate([
|
|
1608
|
+
core_1.HostListener('keypress', ['$event']),
|
|
1609
|
+
tslib_1.__metadata("design:type", Function),
|
|
1610
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
1611
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
1612
|
+
], DropDownListComponent.prototype, "keypress", null);
|
|
1613
|
+
tslib_1.__decorate([
|
|
1614
|
+
core_1.HostListener('click', ['$event']),
|
|
1615
|
+
tslib_1.__metadata("design:type", Function),
|
|
1616
|
+
tslib_1.__metadata("design:paramtypes", [MouseEvent]),
|
|
1617
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
1618
|
+
], DropDownListComponent.prototype, "click", null);
|
|
1338
1619
|
DropDownListComponent = DropDownListComponent_1 = tslib_1.__decorate([
|
|
1339
1620
|
core_1.Component({
|
|
1340
1621
|
exportAs: 'kendoDropDownList',
|
|
@@ -1357,10 +1638,11 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1357
1638
|
}
|
|
1358
1639
|
],
|
|
1359
1640
|
selector: 'kendo-dropdownlist',
|
|
1360
|
-
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
|
|
1641
|
+
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 "
|
|
1361
1642
|
}),
|
|
1362
1643
|
tslib_1.__param(10, core_1.Optional()), tslib_1.__param(10, core_1.Inject(touch_enabled_1.TOUCH_ENABLED)),
|
|
1363
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
1644
|
+
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
|
|
1645
|
+
kendo_angular_l10n_1.LocalizationService,
|
|
1364
1646
|
kendo_angular_popup_1.PopupService,
|
|
1365
1647
|
selection_service_1.SelectionService,
|
|
1366
1648
|
navigation_service_1.NavigationService,
|
|
@@ -1368,7 +1650,6 @@ var DropDownListComponent = /** @class */ (function () {
|
|
|
1368
1650
|
data_service_1.DataService,
|
|
1369
1651
|
core_1.NgZone,
|
|
1370
1652
|
core_1.Renderer2,
|
|
1371
|
-
core_1.ElementRef,
|
|
1372
1653
|
core_1.ChangeDetectorRef, Boolean])
|
|
1373
1654
|
], DropDownListComponent);
|
|
1374
1655
|
return DropDownListComponent;
|