@progress/kendo-angular-dropdowns 5.5.0 → 6.0.0-dev.202201171002
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 +97 -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 +338 -46
- 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 +26 -1
- package/dist/es2015/common/list.component.js +129 -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 +77 -13
- package/dist/es2015/dropdownlist/dropdownlist.component.js +390 -159
- 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 +1974 -834
- package/dist/fesm5/index.js +1577 -225
- 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 +96 -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 +336 -44
- 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 +18 -14
|
@@ -35,8 +35,9 @@ var ListComponent = /** @class */ (function () {
|
|
|
35
35
|
this.focused = -1;
|
|
36
36
|
this.show = true;
|
|
37
37
|
this.multipleSelection = false;
|
|
38
|
-
this.
|
|
38
|
+
this.type = 'list';
|
|
39
39
|
this.checkboxes = { enabled: false };
|
|
40
|
+
this.rounded = 'medium';
|
|
40
41
|
this.onClick = new core_1.EventEmitter();
|
|
41
42
|
this.pageChange = new core_1.EventEmitter();
|
|
42
43
|
this.listResize = new core_1.EventEmitter();
|
|
@@ -44,11 +45,13 @@ var ListComponent = /** @class */ (function () {
|
|
|
44
45
|
this.lastLoaded = 0;
|
|
45
46
|
this.lastScrollTop = 0;
|
|
46
47
|
this.scrollToFocused = false;
|
|
48
|
+
this._size = 'medium';
|
|
47
49
|
this.selectSubscription = rxjs_1.merge(this.selectionService.onSelect.pipe(operators_1.map(function (args) { return args.indices[0]; })), this.selectionService.onFocus)
|
|
48
50
|
.pipe(
|
|
49
51
|
// handle only the very last onSelect/onFocus emission
|
|
50
52
|
operators_1.switchMap(function (event) { return _this.zone.onStable.pipe(operators_1.take(1), operators_1.map(function () { return event; })); }))
|
|
51
53
|
.subscribe(this.scrollToItem.bind(this));
|
|
54
|
+
this.prepareClasses();
|
|
52
55
|
}
|
|
53
56
|
Object.defineProperty(ListComponent.prototype, "data", {
|
|
54
57
|
get: function () {
|
|
@@ -60,6 +63,22 @@ var ListComponent = /** @class */ (function () {
|
|
|
60
63
|
enumerable: true,
|
|
61
64
|
configurable: true
|
|
62
65
|
});
|
|
66
|
+
Object.defineProperty(ListComponent.prototype, "size", {
|
|
67
|
+
get: function () {
|
|
68
|
+
return this._size;
|
|
69
|
+
},
|
|
70
|
+
set: function (size) {
|
|
71
|
+
if (this.type === 'list') {
|
|
72
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getSizeClass('list', this.size));
|
|
73
|
+
if (size) {
|
|
74
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('list', size));
|
|
75
|
+
}
|
|
76
|
+
this._size = size;
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true
|
|
81
|
+
});
|
|
63
82
|
Object.defineProperty(ListComponent.prototype, "pageSize", {
|
|
64
83
|
get: function () {
|
|
65
84
|
if (this.virtual.pageSize) {
|
|
@@ -88,21 +107,40 @@ var ListComponent = /** @class */ (function () {
|
|
|
88
107
|
enumerable: true,
|
|
89
108
|
configurable: true
|
|
90
109
|
});
|
|
110
|
+
Object.defineProperty(ListComponent.prototype, "checkboxClasses", {
|
|
111
|
+
/**
|
|
112
|
+
* @hidden
|
|
113
|
+
*/
|
|
114
|
+
get: function () {
|
|
115
|
+
return (this.size ? util_1.getSizeClass('checkbox', this.size) : '') + " " + (this.rounded ? util_1.getRoundedClass(this.rounded) : '');
|
|
116
|
+
},
|
|
117
|
+
enumerable: true,
|
|
118
|
+
configurable: true
|
|
119
|
+
});
|
|
91
120
|
ListComponent.prototype.ngOnChanges = function (changes) {
|
|
92
121
|
if (kendo_angular_common_1.isChanged('data', changes, false)) {
|
|
93
122
|
if (this.lastLoaded <= 0) {
|
|
94
123
|
this.lastLoaded = this.data.length - 1;
|
|
95
124
|
this.scrollToFocused = !changes.data.isFirstChange();
|
|
96
125
|
}
|
|
126
|
+
this.setOverflow();
|
|
127
|
+
}
|
|
128
|
+
if (kendo_angular_common_1.isChanged('virtual', changes, false)) {
|
|
129
|
+
this.setOverflow();
|
|
130
|
+
}
|
|
131
|
+
if (kendo_angular_common_1.isChanged('type', changes, false)) {
|
|
132
|
+
this.prepareClasses();
|
|
97
133
|
}
|
|
98
134
|
};
|
|
99
135
|
ListComponent.prototype.ngAfterViewInit = function () {
|
|
100
136
|
var _this = this;
|
|
137
|
+
this.setComponentClasses();
|
|
101
138
|
this.zone.runOutsideAngular(function () {
|
|
102
139
|
_this.scrollSubscription = rxjs_1.fromEvent(_this.content.nativeElement, "scroll").pipe(operators_1.auditTime(100), operators_1.tap(_this.prefetchData.bind(_this)), operators_1.tap(_this.findCurrentGroup.bind(_this))).subscribe(function () {
|
|
103
140
|
_this.lastScrollTop = _this.content.nativeElement.scrollTop;
|
|
104
141
|
});
|
|
105
142
|
});
|
|
143
|
+
this.setOverflow();
|
|
106
144
|
};
|
|
107
145
|
ListComponent.prototype.ngAfterViewChecked = function () {
|
|
108
146
|
if (this.virtual) {
|
|
@@ -132,6 +170,28 @@ var ListComponent = /** @class */ (function () {
|
|
|
132
170
|
this.selectionService.unselect(index);
|
|
133
171
|
}
|
|
134
172
|
};
|
|
173
|
+
ListComponent.prototype.prepareClasses = function () {
|
|
174
|
+
if (this.type === 'list') {
|
|
175
|
+
this.listContentClass = 'k-list-content';
|
|
176
|
+
this.listClass = 'k-list-ul';
|
|
177
|
+
this.listItemClass = 'k-list-item';
|
|
178
|
+
this.listVirtualClass = 'k-virtual-list';
|
|
179
|
+
this.listGroupStickyHeaderClass = 'k-list-group-sticky-header';
|
|
180
|
+
this.listGroupStickyHeaderTextClass = 'k-list-header-text';
|
|
181
|
+
this.listGroupItemClass = 'k-list-group-item';
|
|
182
|
+
this.listGroupItemTextClass = 'k-list-item-text';
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
this.listContentClass = 'k-table-body k-table-scroller';
|
|
186
|
+
this.listClass = 'k-table k-table-list';
|
|
187
|
+
this.listItemClass = 'k-table-row';
|
|
188
|
+
this.listVirtualClass = 'k-virtual-table';
|
|
189
|
+
this.listGroupStickyHeaderClass = 'k-table-group-sticky-header';
|
|
190
|
+
this.listGroupStickyHeaderTextClass = 'k-table-th';
|
|
191
|
+
this.listGroupItemClass = 'k-table-group-row';
|
|
192
|
+
this.listGroupItemTextClass = 'k-table-th';
|
|
193
|
+
}
|
|
194
|
+
};
|
|
135
195
|
ListComponent.prototype.isChecked = function (index) {
|
|
136
196
|
var normalizedIndex = this.virtual ? index + this.virtual.skip : index;
|
|
137
197
|
return this.selectionService.isSelected(normalizedIndex);
|
|
@@ -141,7 +201,7 @@ var ListComponent = /** @class */ (function () {
|
|
|
141
201
|
var content = this.content.nativeElement;
|
|
142
202
|
var rect = content.getBoundingClientRect();
|
|
143
203
|
// IE9 hack
|
|
144
|
-
var disabled = Array.prototype.slice.call(content.querySelectorAll(".k-
|
|
204
|
+
var disabled = Array.prototype.slice.call(content.querySelectorAll(".k-disabled"));
|
|
145
205
|
// This is a workaround for finding elements with pointer-events: none;
|
|
146
206
|
disabled.forEach(function (el) { return _this.renderer.setStyle(el, "pointer-events", "auto"); });
|
|
147
207
|
var item = document.elementFromPoint(rect.left + 1, rect.top + 1);
|
|
@@ -220,6 +280,9 @@ var ListComponent = /** @class */ (function () {
|
|
|
220
280
|
}
|
|
221
281
|
return this.disabledItemsService.isIndexDisabled(index);
|
|
222
282
|
};
|
|
283
|
+
ListComponent.prototype.isAltRow = function (index) {
|
|
284
|
+
return this.type === 'dropdowngrid' && index % 2 !== 0;
|
|
285
|
+
};
|
|
223
286
|
ListComponent.prototype.scrollToItem = function (index) {
|
|
224
287
|
var flatIndex = index;
|
|
225
288
|
if (this.dataService.grouped) {
|
|
@@ -278,6 +341,15 @@ var ListComponent = /** @class */ (function () {
|
|
|
278
341
|
var hasVirtualScroll = util_1.isPresent(this.virtual) && this.hasVirtualScrollbar();
|
|
279
342
|
return hasVirtualScroll || this.list.nativeElement.scrollHeight > this.content.nativeElement.offsetHeight;
|
|
280
343
|
};
|
|
344
|
+
/**
|
|
345
|
+
* Sets the list's content overflow (hides/shows scrollbar)
|
|
346
|
+
*/
|
|
347
|
+
ListComponent.prototype.setOverflow = function () {
|
|
348
|
+
if (this.virtual) {
|
|
349
|
+
var overflow = this.hasVirtualScrollbar() ? 'scroll' : 'hidden';
|
|
350
|
+
this.renderer.setStyle(this.content.nativeElement, 'overflow-y', overflow);
|
|
351
|
+
}
|
|
352
|
+
};
|
|
281
353
|
/**
|
|
282
354
|
* Indicates whether the scrollbar should be visible in virtual mode.
|
|
283
355
|
*/
|
|
@@ -302,6 +374,17 @@ var ListComponent = /** @class */ (function () {
|
|
|
302
374
|
}
|
|
303
375
|
return this.virtual.skip === 0 && (this.virtual.pageSize > itemIndex);
|
|
304
376
|
};
|
|
377
|
+
ListComponent.prototype.setComponentClasses = function () {
|
|
378
|
+
if (this.type === 'list') {
|
|
379
|
+
this.renderer.addClass(this.wrapper.nativeElement, 'k-list');
|
|
380
|
+
if (this.size) {
|
|
381
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('list', this.size));
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (util_1.isPresent(this.virtual)) {
|
|
385
|
+
this.renderer.addClass(this.wrapper.nativeElement, this.listVirtualClass);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
305
388
|
tslib_1.__decorate([
|
|
306
389
|
core_1.Input(),
|
|
307
390
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -357,7 +440,7 @@ var ListComponent = /** @class */ (function () {
|
|
|
357
440
|
tslib_1.__decorate([
|
|
358
441
|
core_1.Input(),
|
|
359
442
|
tslib_1.__metadata("design:type", String)
|
|
360
|
-
], ListComponent.prototype, "
|
|
443
|
+
], ListComponent.prototype, "type", void 0);
|
|
361
444
|
tslib_1.__decorate([
|
|
362
445
|
core_1.Input(),
|
|
363
446
|
tslib_1.__metadata("design:type", Object)
|
|
@@ -367,6 +450,15 @@ var ListComponent = /** @class */ (function () {
|
|
|
367
450
|
tslib_1.__metadata("design:type", Array),
|
|
368
451
|
tslib_1.__metadata("design:paramtypes", [Array])
|
|
369
452
|
], ListComponent.prototype, "data", null);
|
|
453
|
+
tslib_1.__decorate([
|
|
454
|
+
core_1.Input(),
|
|
455
|
+
tslib_1.__metadata("design:type", String),
|
|
456
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
457
|
+
], ListComponent.prototype, "size", null);
|
|
458
|
+
tslib_1.__decorate([
|
|
459
|
+
core_1.Input(),
|
|
460
|
+
tslib_1.__metadata("design:type", String)
|
|
461
|
+
], ListComponent.prototype, "rounded", void 0);
|
|
370
462
|
tslib_1.__decorate([
|
|
371
463
|
core_1.Output(),
|
|
372
464
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -398,7 +490,7 @@ var ListComponent = /** @class */ (function () {
|
|
|
398
490
|
ListComponent = tslib_1.__decorate([
|
|
399
491
|
core_1.Component({
|
|
400
492
|
selector: 'kendo-list',
|
|
401
|
-
template: "\n <div *ngIf=\"dataService.grouped\"\n class
|
|
493
|
+
template: "\n <div *ngIf=\"dataService.grouped\"\n [class]=\"listGroupStickyHeaderClass\"\n [ngStyle]=\"{\n 'height.px': virtual?.itemHeight,\n 'minHeight.px' : virtual?.itemHeight,\n 'boxSizing' : virtual ? 'border-box' : 'inherit'}\"\n >\n <ng-template *ngIf=\"fixedGroupTemplate\"\n [templateContext]=\"{\n templateRef: fixedGroupTemplate.templateRef,\n $implicit: currentGroup\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!fixedGroupTemplate\"><span [class]=\"listGroupStickyHeaderTextClass\">{{ currentGroup }}</span></ng-template>\n </div>\n <div #content\n [class]=\"listContentClass\"\n [style.overscrollBehavior]=\"'none'\"\n [style.maxHeight.px]=\"height\"\n unselectable=\"on\">\n <ul #list\n role=\"listbox\"\n [class]=\"listClass\"\n [attr.id]=\"id\"\n [attr.aria-hidden]=\"!show\">\n <ng-template *ngIf=\"!dataService.grouped && show\" ngFor let-dataItem let-itemIndex=\"index\" [ngForOf]=\"data\">\n <li\n role=\"option\"\n kendoDropDownsSelectable\n [checkboxes]=\"checkboxes\"\n [height]=\"virtual?.itemHeight\"\n [index]=\"itemIndex + startFrom\"\n [multipleSelection]=\"multipleSelection\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem)\"\n [attr.tabIndex]=\"-1\"\n [class]=\"listItemClass\"\n [ngClass]=\"{\n 'k-disabled': isDisabled(itemIndex),\n 'k-table-alt-row': isAltRow(itemIndex)\n }\"\n >\n <input\n *ngIf=\"checkboxes.enabled\"\n type=\"checkbox\"\n class=\"k-checkbox\"\n [ngClass]=\"checkboxClasses\"\n (change)=\"onCheckedChange($event, itemIndex)\"\n [checked]=\"isChecked(itemIndex)\"\n />\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\"><span class=\"k-list-item-text\">{{ getText(dataItem) }}</span></ng-template>\n </li>\n </ng-template>\n <ng-template *ngIf=\"dataService.grouped\" ngFor let-dataItem let-itemIndex=\"index\" [ngForOf]=\"data\">\n <li\n *ngIf=\"dataItem.header && dataItem.index > 0\"\n role=\"group\"\n [class]=\"listGroupItemClass\"\n [class.k-table-alt-row]=\"isAltRow(itemIndex - 1)\"\n [ngStyle]=\"{\n 'height.px': virtual?.itemHeight,\n 'minHeight.px' : virtual?.itemHeight,\n 'boxSizing' : virtual ? 'border-box' : 'inherit'}\"\n [attr.group-index]=\"dataItem.index\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem.value)\"\n [attr.tabIndex]=\"-1\">\n <span [class]=\"listGroupItemTextClass\">\n <ng-template *ngIf=\"groupTemplate\"\n [templateContext]=\"{\n templateRef: groupTemplate.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!groupTemplate\">{{ dataItem.value }}</ng-template>\n </span>\n </li>\n <li\n *ngIf=\"!dataItem.header\"\n role=\"option\"\n kendoDropDownsSelectable\n [height]=\"virtual?.itemHeight\"\n [index]=\"dataItem.offsetIndex\"\n [multipleSelection]=\"multipleSelection\"\n [attr.absolute-index]=\"dataItem.index\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem.value)\"\n [attr.tabIndex]=\"-1\"\n [class]=\"listItemClass\"\n [ngClass]=\"{\n 'k-disabled': isDisabled(dataItem.offsetIndex),\n 'k-table-alt-row': isAltRow(itemIndex - 1)\n }\"\n >\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\"><span class=\"k-list-item-text\">{{ getText(dataItem.value) }}</span></ng-template>\n </li>\n </ng-template>\n <kendo-resize-sensor\n *ngIf=\"!virtual\"\n (resize)=\"listResize.emit()\"\n >\n </kendo-resize-sensor>\n </ul>\n <div *ngIf=\"virtual\" #virtualContainer class=\"k-height-container\" role=\"presentation\">\n <div [style.height.px]=\"scrollHeight\">\n <kendo-resize-sensor (resize)=\"listResize.emit()\"></kendo-resize-sensor>\n </div>\n </div>\n </div>\n "
|
|
402
494
|
}),
|
|
403
495
|
tslib_1.__metadata("design:paramtypes", [data_service_1.DataService,
|
|
404
496
|
core_1.ElementRef,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -238,7 +238,7 @@ var SearchBarComponent = /** @class */ (function () {
|
|
|
238
238
|
SearchBarComponent = tslib_1.__decorate([
|
|
239
239
|
core_1.Component({
|
|
240
240
|
selector: 'kendo-searchbar',
|
|
241
|
-
template: "\n <input #input\n autocomplete=\"off\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [class]=\"'k-input'\"\n (input)=\"handleInput($event)\"\n (keydown)=\"handleKeydown($event)\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.dir]=\"direction\"\n [attr.role]=\"role\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-readonly]=\"readonly\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"popupOpen\"\n [attr.aria-owns]=\"listId\"\n [attr.aria-describedby]=\"tagListId\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-label]=\"noDataLabel\"\n />\n "
|
|
241
|
+
template: "\n <input #input\n autocomplete=\"off\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [class]=\"'k-input-inner'\"\n (input)=\"handleInput($event)\"\n (keydown)=\"handleKeydown($event)\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.dir]=\"direction\"\n [attr.role]=\"role\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-readonly]=\"readonly\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"popupOpen\"\n [attr.aria-owns]=\"listId\"\n [attr.aria-describedby]=\"tagListId\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-label]=\"noDataLabel\"\n />\n "
|
|
242
242
|
}),
|
|
243
243
|
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService,
|
|
244
244
|
core_1.Renderer2])
|
|
@@ -69,12 +69,12 @@ var SelectableDirective = /** @class */ (function () {
|
|
|
69
69
|
tslib_1.__metadata("design:type", Boolean)
|
|
70
70
|
], SelectableDirective.prototype, "multipleSelection", void 0);
|
|
71
71
|
tslib_1.__decorate([
|
|
72
|
-
core_1.HostBinding('class.k-
|
|
72
|
+
core_1.HostBinding('class.k-focus'),
|
|
73
73
|
tslib_1.__metadata("design:type", Boolean),
|
|
74
74
|
tslib_1.__metadata("design:paramtypes", [])
|
|
75
75
|
], SelectableDirective.prototype, "focusedClassName", null);
|
|
76
76
|
tslib_1.__decorate([
|
|
77
|
-
core_1.HostBinding('class.k-
|
|
77
|
+
core_1.HostBinding('class.k-selected'),
|
|
78
78
|
tslib_1.__metadata("design:type", Boolean),
|
|
79
79
|
tslib_1.__metadata("design:paramtypes", [])
|
|
80
80
|
], SelectableDirective.prototype, "selectedClassName", null);
|
|
@@ -13,13 +13,40 @@ var util_1 = require("../common/util");
|
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
15
15
|
var TagListComponent = /** @class */ (function () {
|
|
16
|
-
function TagListComponent() {
|
|
16
|
+
function TagListComponent(renderer, hostElement) {
|
|
17
|
+
this.renderer = renderer;
|
|
18
|
+
this.hostElement = hostElement;
|
|
19
|
+
this.rounded = 'medium';
|
|
20
|
+
this.fillMode = 'solid';
|
|
17
21
|
/**
|
|
18
22
|
* A collection with the disabled tags' indices.
|
|
19
23
|
*/
|
|
20
24
|
this.disabledIndices = new Set();
|
|
21
25
|
this.removeTag = new core_1.EventEmitter();
|
|
26
|
+
this.hostClasses = true;
|
|
27
|
+
this._size = 'medium';
|
|
22
28
|
}
|
|
29
|
+
Object.defineProperty(TagListComponent.prototype, "size", {
|
|
30
|
+
get: function () {
|
|
31
|
+
return this._size;
|
|
32
|
+
},
|
|
33
|
+
set: function (size) {
|
|
34
|
+
this.renderer.removeClass(this.hostElement.nativeElement, util_1.getSizeClass('chip-list', this.size));
|
|
35
|
+
if (size) {
|
|
36
|
+
this.renderer.addClass(this.hostElement.nativeElement, util_1.getSizeClass('chip-list', size));
|
|
37
|
+
}
|
|
38
|
+
this._size = size;
|
|
39
|
+
},
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(TagListComponent.prototype, "hostId", {
|
|
44
|
+
get: function () {
|
|
45
|
+
return this.id;
|
|
46
|
+
},
|
|
47
|
+
enumerable: true,
|
|
48
|
+
configurable: true
|
|
49
|
+
});
|
|
23
50
|
TagListComponent.prototype.tagProp = function (tag, prop, index) {
|
|
24
51
|
var propField = prop && this.getPropField(tag, prop, index);
|
|
25
52
|
return util_1.getter(tag, propField);
|
|
@@ -109,6 +136,19 @@ var TagListComponent = /** @class */ (function () {
|
|
|
109
136
|
core_1.Input(),
|
|
110
137
|
tslib_1.__metadata("design:type", String)
|
|
111
138
|
], TagListComponent.prototype, "id", void 0);
|
|
139
|
+
tslib_1.__decorate([
|
|
140
|
+
core_1.Input(),
|
|
141
|
+
tslib_1.__metadata("design:type", String),
|
|
142
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
143
|
+
], TagListComponent.prototype, "size", null);
|
|
144
|
+
tslib_1.__decorate([
|
|
145
|
+
core_1.Input(),
|
|
146
|
+
tslib_1.__metadata("design:type", String)
|
|
147
|
+
], TagListComponent.prototype, "rounded", void 0);
|
|
148
|
+
tslib_1.__decorate([
|
|
149
|
+
core_1.Input(),
|
|
150
|
+
tslib_1.__metadata("design:type", String)
|
|
151
|
+
], TagListComponent.prototype, "fillMode", void 0);
|
|
112
152
|
tslib_1.__decorate([
|
|
113
153
|
core_1.Input(),
|
|
114
154
|
tslib_1.__metadata("design:type", Set)
|
|
@@ -117,11 +157,24 @@ var TagListComponent = /** @class */ (function () {
|
|
|
117
157
|
core_1.Output(),
|
|
118
158
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
119
159
|
], TagListComponent.prototype, "removeTag", void 0);
|
|
160
|
+
tslib_1.__decorate([
|
|
161
|
+
core_1.HostBinding('class.k-input-values'),
|
|
162
|
+
core_1.HostBinding('class.k-chip-list'),
|
|
163
|
+
core_1.HostBinding('class.k-selection-multiple'),
|
|
164
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
165
|
+
], TagListComponent.prototype, "hostClasses", void 0);
|
|
166
|
+
tslib_1.__decorate([
|
|
167
|
+
core_1.HostBinding('attr.id'),
|
|
168
|
+
tslib_1.__metadata("design:type", String),
|
|
169
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
170
|
+
], TagListComponent.prototype, "hostId", null);
|
|
120
171
|
TagListComponent = tslib_1.__decorate([
|
|
121
172
|
core_1.Component({
|
|
122
173
|
selector: 'kendo-taglist',
|
|
123
|
-
template: "\n <
|
|
124
|
-
})
|
|
174
|
+
template: "\n <div\n *ngFor=\"let tag of tags; let index = index;\"\n role=\"option\"\n [attr.id]=\"itemId(tag, index)\"\n [attr.aria-hidden]=\"tagAriaHidden(index)\"\n aria-selected=\"true\"\n [attr.aria-setsize]=\"tags?.length\"\n class=\"k-chip\"\n [ngClass]=\"{\n 'k-focus': index === focused,\n 'k-disabled': isTagDisabled(tag, index),\n 'k-chip-sm': size === 'small',\n 'k-chip-md': size === 'medium',\n 'k-chip-lg': size === 'large',\n 'k-rounded-sm': rounded === 'small',\n 'k-rounded-md': rounded === 'medium',\n 'k-rounded-lg': rounded === 'large',\n 'k-rounded-full': rounded === 'full',\n 'k-chip-solid k-chip-solid-base': fillMode === 'solid',\n 'k-chip-flat k-chip-flat-base': fillMode === 'flat',\n 'k-chip-outline k-chip-outline-base': fillMode === 'outline'\n }\"\n >\n <span class=\"k-chip-content\">\n <ng-template *ngIf=\"isGroupTag(tag); then groupTag else singleTag\"></ng-template>\n <ng-template #groupTag>\n <span class=\"k-chip-label k-text-ellipsis\">\n <ng-template *ngIf=\"groupTemplate\"\n [templateContext]=\"{\n templateRef: groupTemplate.templateRef,\n $implicit: tag\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!groupTemplate\">{{ tag.length }} {{ tag.length === 1 ? 'item' : 'items' }} selected</ng-template>\n </span>\n </ng-template>\n <ng-template #singleTag>\n <span class=\"k-chip-label k-text-ellipsis\">\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: tag\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ tagProp(tag, textField, index) }}</ng-template>\n </span>\n </ng-template>\n </span>\n\n <span class=\"k-chip-actions\">\n <span aria-label=\"delete\" [attr.aria-hidden]=\"index !== focused\" class=\"k-chip-action k-chip-remove-action\">\n <span class=\"k-icon k-i-x-circle\" (mousedown)=\"deleteTag($event, tag, index)\">\n </span>\n </span>\n </span>\n </div>\n <ng-content></ng-content>\n "
|
|
175
|
+
}),
|
|
176
|
+
tslib_1.__metadata("design:paramtypes", [core_1.Renderer2,
|
|
177
|
+
core_1.ElementRef])
|
|
125
178
|
], TagListComponent);
|
|
126
179
|
return TagListComponent;
|
|
127
180
|
}());
|
package/dist/npm/common/util.js
CHANGED
|
@@ -300,3 +300,40 @@ exports.valueFrom = function (_a, valueField) {
|
|
|
300
300
|
var field = fields[normalizedLevel];
|
|
301
301
|
return kendo_common_1.getter(field)(dataItem);
|
|
302
302
|
};
|
|
303
|
+
/**
|
|
304
|
+
* @hidden
|
|
305
|
+
* Returns the size class based on the component and size input.
|
|
306
|
+
*/
|
|
307
|
+
exports.getSizeClass = function (component, size) {
|
|
308
|
+
var SIZE_CLASSES = {
|
|
309
|
+
'small': "k-" + component + "-sm",
|
|
310
|
+
'medium': "k-" + component + "-md",
|
|
311
|
+
'large': "k-" + component + "-lg"
|
|
312
|
+
};
|
|
313
|
+
return SIZE_CLASSES[size];
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* @hidden
|
|
317
|
+
* Returns the rounded class based on the rounded input.
|
|
318
|
+
*/
|
|
319
|
+
exports.getRoundedClass = function (rounded) {
|
|
320
|
+
var ROUNDED_CLASSES = {
|
|
321
|
+
'small': 'k-rounded-sm',
|
|
322
|
+
'medium': 'k-rounded-md',
|
|
323
|
+
'large': 'k-rounded-lg',
|
|
324
|
+
'full': 'k-rounded-full'
|
|
325
|
+
};
|
|
326
|
+
return ROUNDED_CLASSES[rounded];
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* @hidden
|
|
330
|
+
* Return the fillMode class based on the component and fillMode input.
|
|
331
|
+
*/
|
|
332
|
+
exports.getFillModeClass = function (component, fillMode) {
|
|
333
|
+
var FILLMODE_CLASSES = {
|
|
334
|
+
'solid': "k-" + component + "-solid",
|
|
335
|
+
'flat': "k-" + component + "-flat",
|
|
336
|
+
'outline': "k-" + component + "-outline"
|
|
337
|
+
};
|
|
338
|
+
return FILLMODE_CLASSES[fillMode];
|
|
339
|
+
};
|