@syncfusion/ej2-dropdowns 35.1.39 → 35.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +173 -127
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +173 -127
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/drop-down-list/drop-down-list.d.ts +3 -0
- package/src/drop-down-list/drop-down-list.js +120 -3
- package/src/drop-down-tree/drop-down-tree.d.ts +2 -0
- package/src/drop-down-tree/drop-down-tree.js +26 -3
- package/src/multi-select/checkbox-selection.js +8 -6
- package/src/multi-select/float-label.d.ts +2 -1
- package/src/multi-select/float-label.js +7 -3
- package/src/multi-select/multi-select.d.ts +0 -1
- package/src/multi-select/multi-select.js +12 -112
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 35.1.
|
|
3
|
+
* version : 35.1.41
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-dropdowns",
|
|
3
|
-
"version": "35.1.
|
|
3
|
+
"version": "35.1.41",
|
|
4
4
|
"description": "Essential JS 2 DropDown Components",
|
|
5
5
|
"author": "Syncfusion Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN license",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@syncfusion/ej2-base": "~35.1.37",
|
|
12
12
|
"@syncfusion/ej2-data": "~35.1.37",
|
|
13
|
-
"@syncfusion/ej2-inputs": "~35.1.
|
|
13
|
+
"@syncfusion/ej2-inputs": "~35.1.41",
|
|
14
14
|
"@syncfusion/ej2-lists": "~35.1.37",
|
|
15
|
-
"@syncfusion/ej2-navigations": "~35.1.
|
|
15
|
+
"@syncfusion/ej2-navigations": "~35.1.40",
|
|
16
16
|
"@syncfusion/ej2-notifications": "~35.1.37",
|
|
17
17
|
"@syncfusion/ej2-popups": "~35.1.39"
|
|
18
18
|
},
|
|
@@ -113,6 +113,9 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
113
113
|
};
|
|
114
114
|
protected isCustomFilter: boolean;
|
|
115
115
|
private isSecondClick;
|
|
116
|
+
private filterGeneration;
|
|
117
|
+
private pendingFilterRequests;
|
|
118
|
+
private isStaleFilter;
|
|
116
119
|
protected isListSearched: boolean;
|
|
117
120
|
protected preventChange: boolean;
|
|
118
121
|
protected selectedElementID: string;
|
|
@@ -86,6 +86,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
86
86
|
*/
|
|
87
87
|
function DropDownList(options, element) {
|
|
88
88
|
var _this = _super.call(this, options, element) || this;
|
|
89
|
+
_this.filterGeneration = null;
|
|
90
|
+
_this.pendingFilterRequests = 0;
|
|
91
|
+
_this.isStaleFilter = false;
|
|
89
92
|
_this.isListSearched = false;
|
|
90
93
|
_this.preventChange = false;
|
|
91
94
|
_this.isTouched = false;
|
|
@@ -138,6 +141,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
138
141
|
this.preventAltUp = false;
|
|
139
142
|
this.isCustomFilter = false;
|
|
140
143
|
this.isSecondClick = false;
|
|
144
|
+
this.filterGeneration = null;
|
|
145
|
+
this.pendingFilterRequests = 0;
|
|
146
|
+
this.isStaleFilter = false;
|
|
141
147
|
this.previousValue = null;
|
|
142
148
|
this.keyConfigure = {
|
|
143
149
|
tab: 'tab',
|
|
@@ -192,7 +198,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
192
198
|
DropDownList.prototype.floatLabelChange = function () {
|
|
193
199
|
if (this.getModuleName() === 'dropdownlist' && this.floatLabelType === 'Auto') {
|
|
194
200
|
var floatElement = this.inputWrapper.container.querySelector('.e-float-text');
|
|
195
|
-
if (floatElement && this.inputElement.value !== '' || this.isInteracted) {
|
|
201
|
+
if (floatElement && (this.inputElement.value !== '' || this.isInteracted)) {
|
|
196
202
|
classList(floatElement, ['e-label-top'], ['e-label-bottom']);
|
|
197
203
|
}
|
|
198
204
|
else if (floatElement) {
|
|
@@ -1554,6 +1560,10 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1554
1560
|
li = null;
|
|
1555
1561
|
};
|
|
1556
1562
|
DropDownList.prototype.selectEventCallback = function (li, e, preventSelect, selectedData, value) {
|
|
1563
|
+
if (this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
|
|
1564
|
+
this.dataSource instanceof DataManager && this.filterGeneration) {
|
|
1565
|
+
this.isStaleFilter = true;
|
|
1566
|
+
}
|
|
1557
1567
|
this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
|
|
1558
1568
|
if (this.itemData !== selectedData) {
|
|
1559
1569
|
this.previousValue = (!isNullOrUndefined(this.itemData)) ? typeof this.itemData == 'object' &&
|
|
@@ -1600,7 +1610,11 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1600
1610
|
DropDownList.prototype.setValue = function (e, autofill) {
|
|
1601
1611
|
var dataItem = this.getItemData();
|
|
1602
1612
|
this.isTouched = !isNullOrUndefined(e);
|
|
1603
|
-
if (dataItem.value === null)
|
|
1613
|
+
if (dataItem.value === null && !isNullOrUndefined(this.item) &&
|
|
1614
|
+
this.item.getAttribute('data-value') === 'null') {
|
|
1615
|
+
Input.setValue('null', this.inputElement, this.floatLabelType, this.showClearButton);
|
|
1616
|
+
}
|
|
1617
|
+
else if (dataItem.value === null) {
|
|
1604
1618
|
Input.setValue(null, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
1605
1619
|
}
|
|
1606
1620
|
else {
|
|
@@ -1645,6 +1659,10 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1645
1659
|
}
|
|
1646
1660
|
};
|
|
1647
1661
|
DropDownList.prototype.setSelection = function (li, e) {
|
|
1662
|
+
if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
|
|
1663
|
+
this.pendingFilterRequests > 0 && this.isValidLI(li)) {
|
|
1664
|
+
this.isStaleFilter = true;
|
|
1665
|
+
}
|
|
1648
1666
|
if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
|
|
1649
1667
|
&& li.classList.contains(dropDownBaseClasses.selected)))) {
|
|
1650
1668
|
this.updateSelectedItem(li, e, false, true);
|
|
@@ -2217,7 +2235,21 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2217
2235
|
this.previousStartIndex = 0;
|
|
2218
2236
|
this.virtualListInfo = null;
|
|
2219
2237
|
}
|
|
2238
|
+
if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && dataSource instanceof DataManager) {
|
|
2239
|
+
this.filterGeneration = {
|
|
2240
|
+
value: this.value
|
|
2241
|
+
};
|
|
2242
|
+
this.pendingFilterRequests++;
|
|
2243
|
+
}
|
|
2220
2244
|
this.resetList(dataSource, fields, query);
|
|
2245
|
+
if (this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
|
|
2246
|
+
dataSource instanceof DataManager && !this.isRequesting) {
|
|
2247
|
+
this.pendingFilterRequests--;
|
|
2248
|
+
if (this.pendingFilterRequests === 0) {
|
|
2249
|
+
this.filterGeneration = null;
|
|
2250
|
+
this.isStaleFilter = false;
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2221
2253
|
if (this.getModuleName() === 'dropdownlist' && this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
2222
2254
|
this.popupContentElement.setAttribute('role', 'status');
|
|
2223
2255
|
this.popupContentElement.setAttribute('id', 'no-record');
|
|
@@ -2345,6 +2377,14 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2345
2377
|
});
|
|
2346
2378
|
};
|
|
2347
2379
|
DropDownList.prototype.onActionFailure = function (e) {
|
|
2380
|
+
if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
|
|
2381
|
+
this.pendingFilterRequests > 0) {
|
|
2382
|
+
this.pendingFilterRequests--;
|
|
2383
|
+
if (this.pendingFilterRequests === 0) {
|
|
2384
|
+
this.filterGeneration = null;
|
|
2385
|
+
this.isStaleFilter = false;
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2348
2388
|
_super.prototype.onActionFailure.call(this, e);
|
|
2349
2389
|
if (this.beforePopupOpen) {
|
|
2350
2390
|
this.renderPopup();
|
|
@@ -2356,6 +2396,26 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2356
2396
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2357
2397
|
DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
|
|
2358
2398
|
var _this = this;
|
|
2399
|
+
if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
|
|
2400
|
+
!isNullOrUndefined(e) && this.pendingFilterRequests > 0) {
|
|
2401
|
+
this.pendingFilterRequests--;
|
|
2402
|
+
if (this.filterGeneration && (this.isStaleFilter || this.filterGeneration.value !== this.value)) {
|
|
2403
|
+
if (this.actionCompleteData.ulElement && this.actionCompleteData.list) {
|
|
2404
|
+
ulElement = this.actionCompleteData.ulElement.cloneNode(true);
|
|
2405
|
+
list = this.actionCompleteData.list;
|
|
2406
|
+
e = null;
|
|
2407
|
+
this.typedString = '';
|
|
2408
|
+
this.isTyped = false;
|
|
2409
|
+
if (this.filterInput) {
|
|
2410
|
+
this.filterInput.value = '';
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
if (this.pendingFilterRequests === 0) {
|
|
2415
|
+
this.filterGeneration = null;
|
|
2416
|
+
this.isStaleFilter = false;
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2359
2419
|
if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
|
|
2360
2420
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2361
2421
|
this.totalItemCount = e.count;
|
|
@@ -2623,7 +2683,16 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2623
2683
|
return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_1) ||
|
|
2624
2684
|
(getValue(_this.fields.value, data) === value_1));
|
|
2625
2685
|
});
|
|
2626
|
-
|
|
2686
|
+
var isRemoteFilteredDropDownList = this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
|
|
2687
|
+
this.dataSource instanceof DataManager;
|
|
2688
|
+
var isExistInCachedList = Boolean(isRemoteFilteredDropDownList && this.actionCompleteData.list &&
|
|
2689
|
+
this.actionCompleteData.list.some(function (data) {
|
|
2690
|
+
return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_1) ||
|
|
2691
|
+
(getValue(_this.fields.value, data) === value_1));
|
|
2692
|
+
}));
|
|
2693
|
+
var isExistInCachedElement = Boolean(isRemoteFilteredDropDownList && this.actionCompleteData.ulElement &&
|
|
2694
|
+
Array.prototype.some.call(this.actionCompleteData.ulElement.querySelectorAll('li[data-value]'), function (item) { return item.getAttribute('data-value') === String(value_1); }));
|
|
2695
|
+
if (!isExist && (!isRemoteFilteredDropDownList || (!isExistInCachedList && !isExistInCachedElement))) {
|
|
2627
2696
|
this.addItem(this.itemData);
|
|
2628
2697
|
}
|
|
2629
2698
|
}
|
|
@@ -3984,6 +4053,47 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
3984
4053
|
break;
|
|
3985
4054
|
case 'placeholder':
|
|
3986
4055
|
Input.setPlaceholder(newProp.placeholder, this_1.inputElement);
|
|
4056
|
+
if (this_1.getModuleName() === 'dropdownlist') {
|
|
4057
|
+
if (!newProp.placeholder || newProp.placeholder.trim() === '') {
|
|
4058
|
+
var label = this_1.inputWrapper.container.querySelector('.e-float-text');
|
|
4059
|
+
if (label) {
|
|
4060
|
+
label.remove();
|
|
4061
|
+
}
|
|
4062
|
+
this_1.inputElement.removeAttribute('aria-labelledby');
|
|
4063
|
+
}
|
|
4064
|
+
else if (this_1.floatLabelType !== 'Never' && !this_1.value) {
|
|
4065
|
+
var floatLabel = this_1.inputWrapper.container
|
|
4066
|
+
.querySelector('.e-float-text');
|
|
4067
|
+
if (!floatLabel) {
|
|
4068
|
+
floatLabel = this_1.createElement('label');
|
|
4069
|
+
floatLabel.classList.add('e-float-text');
|
|
4070
|
+
if (this_1.floatLabelType === 'Auto') {
|
|
4071
|
+
floatLabel.classList.add('e-label-bottom');
|
|
4072
|
+
}
|
|
4073
|
+
else if (this_1.floatLabelType === 'Always') {
|
|
4074
|
+
floatLabel.classList.add('e-label-top');
|
|
4075
|
+
}
|
|
4076
|
+
floatLabel.id = 'label_' + this_1.inputElement.id;
|
|
4077
|
+
floatLabel.setAttribute('for', this_1.inputElement.id);
|
|
4078
|
+
var floatLine = this_1.inputWrapper.container
|
|
4079
|
+
.querySelector('.e-float-line');
|
|
4080
|
+
var icon = this_1.inputWrapper.container
|
|
4081
|
+
.querySelector('.e-input-group-icon');
|
|
4082
|
+
if (floatLine) {
|
|
4083
|
+
floatLine.insertAdjacentElement('afterend', floatLabel);
|
|
4084
|
+
}
|
|
4085
|
+
else if (icon) {
|
|
4086
|
+
this_1.inputWrapper.container.insertBefore(floatLabel, icon);
|
|
4087
|
+
}
|
|
4088
|
+
else {
|
|
4089
|
+
this_1.inputWrapper.container.appendChild(floatLabel);
|
|
4090
|
+
}
|
|
4091
|
+
}
|
|
4092
|
+
floatLabel.style.width = this_1.inputElement.offsetWidth + 'px';
|
|
4093
|
+
floatLabel.textContent = newProp.placeholder;
|
|
4094
|
+
this_1.inputElement.setAttribute('aria-labelledby', floatLabel.id);
|
|
4095
|
+
}
|
|
4096
|
+
}
|
|
3987
4097
|
break;
|
|
3988
4098
|
case 'filterBarPlaceholder':
|
|
3989
4099
|
if (this_1.filterInput) {
|
|
@@ -4308,6 +4418,10 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
4308
4418
|
label.style.width = calculateWidth + 'px';
|
|
4309
4419
|
}
|
|
4310
4420
|
}
|
|
4421
|
+
if (label && this.getModuleName() === 'dropdownlist' && (!this.placeholder || this.placeholder.trim() === '')) {
|
|
4422
|
+
label.remove();
|
|
4423
|
+
this.inputElement.removeAttribute('aria-labelledby');
|
|
4424
|
+
}
|
|
4311
4425
|
};
|
|
4312
4426
|
/**
|
|
4313
4427
|
* Return the module name of this component.
|
|
@@ -4572,6 +4686,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
4572
4686
|
*/
|
|
4573
4687
|
DropDownList.prototype.destroy = function () {
|
|
4574
4688
|
this.isActive = false;
|
|
4689
|
+
this.isStaleFilter = false;
|
|
4690
|
+
this.filterGeneration = null;
|
|
4691
|
+
this.pendingFilterRequests = 0;
|
|
4575
4692
|
if (this.showClearButton) {
|
|
4576
4693
|
this.clearButton = document.getElementsByClassName('e-clear-icon')[0];
|
|
4577
4694
|
}
|
|
@@ -345,6 +345,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
345
345
|
private previousFilterText;
|
|
346
346
|
private fallbackValue;
|
|
347
347
|
private uncheckedNodeId;
|
|
348
|
+
private isTotalCountClicked;
|
|
348
349
|
/**
|
|
349
350
|
* Specifies the template that renders to the popup list content of the
|
|
350
351
|
* Dropdown Tree component when the data fetch request from the remote server fails.
|
|
@@ -849,6 +850,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
849
850
|
private renderTree;
|
|
850
851
|
private updateIndeterminateNodes;
|
|
851
852
|
private renderPopup;
|
|
853
|
+
protected getAppendToElement(): HTMLElement;
|
|
852
854
|
private checkCollision;
|
|
853
855
|
private removeFocus;
|
|
854
856
|
private updateFocus;
|
|
@@ -179,6 +179,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
179
179
|
_this.isFromFilterChange = false;
|
|
180
180
|
_this.fallbackValue = [];
|
|
181
181
|
_this.uncheckedNodeId = null;
|
|
182
|
+
_this.isTotalCountClicked = false;
|
|
182
183
|
return _this;
|
|
183
184
|
}
|
|
184
185
|
/**
|
|
@@ -319,7 +320,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
319
320
|
this.tree = this.createElement('div', { id: this.element.id + '_tree' });
|
|
320
321
|
this.popupDiv.appendChild(this.tree);
|
|
321
322
|
if (!this.destroyPopupOnHide) {
|
|
322
|
-
|
|
323
|
+
this.getAppendToElement().appendChild(this.popupDiv);
|
|
323
324
|
}
|
|
324
325
|
this.wireTreeEvents();
|
|
325
326
|
addClass([this.popupDiv], DDTHIDEICON);
|
|
@@ -409,6 +410,11 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
409
410
|
_this.hidePopup();
|
|
410
411
|
}
|
|
411
412
|
break;
|
|
413
|
+
case 'tab':
|
|
414
|
+
if (_this.isPopupOpen && !isNOU(_this.popupDiv) && _this.popupDiv.classList.contains('e-no-data')) {
|
|
415
|
+
_this.hidePopup();
|
|
416
|
+
}
|
|
417
|
+
break;
|
|
412
418
|
case 'shiftTab':
|
|
413
419
|
addClass([_this.inputWrapper], [INPUTFOCUS]);
|
|
414
420
|
break;
|
|
@@ -1829,7 +1835,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1829
1835
|
});
|
|
1830
1836
|
_this.popupEle.setAttribute('role', 'region');
|
|
1831
1837
|
_this.popupEle.setAttribute('aria-label', _this.element.id);
|
|
1832
|
-
|
|
1838
|
+
_this.getAppendToElement().appendChild(_this.popupEle);
|
|
1833
1839
|
_this.createPopup(_this.popupEle);
|
|
1834
1840
|
}
|
|
1835
1841
|
else {
|
|
@@ -1922,6 +1928,16 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1922
1928
|
}
|
|
1923
1929
|
});
|
|
1924
1930
|
};
|
|
1931
|
+
DropDownTree.prototype.getAppendToElement = function () {
|
|
1932
|
+
if (this.isAngular) {
|
|
1933
|
+
var cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
|
|
1934
|
+
var popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
|
|
1935
|
+
if (cdkPane && popoverEl) {
|
|
1936
|
+
return cdkPane;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
return document.body;
|
|
1940
|
+
};
|
|
1925
1941
|
DropDownTree.prototype.checkCollision = function (popupEle) {
|
|
1926
1942
|
var collision = isCollide(popupEle);
|
|
1927
1943
|
if (collision.length > 0) {
|
|
@@ -2045,6 +2061,12 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2045
2061
|
var isScroller = target.classList.contains(DROPDOWN) ? true :
|
|
2046
2062
|
(matches(target, '.e-ddt .e-popup') || matches(target, '.e-ddt .e-treeview'));
|
|
2047
2063
|
var isSelectAllArea = target.classList.contains('e-ripple-container');
|
|
2064
|
+
if (this.overFlowWrapper && !this.overFlowWrapper.classList.contains(HIDEICON) && !this.isPopupOpen) {
|
|
2065
|
+
this.isTotalCountClicked = true;
|
|
2066
|
+
}
|
|
2067
|
+
else {
|
|
2068
|
+
this.isTotalCountClicked = false;
|
|
2069
|
+
}
|
|
2048
2070
|
if ((this.isPopupOpen && ((!isNOU(this.inputWrapper) &&
|
|
2049
2071
|
this.inputWrapper.contains(target)) || isTree || isScroller || isHeader || isFooter || isSelectAllArea)) ||
|
|
2050
2072
|
((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
|
|
@@ -3092,7 +3114,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
3092
3114
|
}
|
|
3093
3115
|
};
|
|
3094
3116
|
DropDownTree.prototype.removeChip = function (e) {
|
|
3095
|
-
if (!this.enabled || this.readonly) {
|
|
3117
|
+
if (!this.enabled || this.readonly || this.isTotalCountClicked) {
|
|
3118
|
+
this.isTotalCountClicked = false;
|
|
3096
3119
|
return;
|
|
3097
3120
|
}
|
|
3098
3121
|
if (e.target.classList.contains('e-chips-close') && !this.isPopupOpen) {
|
|
@@ -175,12 +175,14 @@ var CheckBoxSelection = /** @class */ (function () {
|
|
|
175
175
|
var target;
|
|
176
176
|
if (!isNullOrUndefined(args.e)) {
|
|
177
177
|
var frameElm = args.li.querySelector('.e-checkbox-wrapper .e-frame');
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
var checkboxWrapper = args.li.querySelector('.e-checkbox-wrapper');
|
|
179
|
+
target = !isNullOrUndefined(args.e.target)
|
|
180
|
+
? (args.e.target.classList.contains('e-frame') &&
|
|
181
|
+
(!this.parent.showSelectAll ||
|
|
182
|
+
(this.checkAllParent && !this.checkAllParent.contains(args.e.target))))
|
|
183
|
+
? args.e.target
|
|
184
|
+
: (checkboxWrapper ? checkboxWrapper.childNodes[1] : null)
|
|
185
|
+
: (checkboxWrapper ? checkboxWrapper.childNodes[1] : null);
|
|
184
186
|
}
|
|
185
187
|
else {
|
|
186
188
|
var checkboxWrapper = args.li.querySelector('.e-checkbox-wrapper');
|
|
@@ -16,8 +16,9 @@ export declare function createFloatLabel(overAllWrapper: HTMLDivElement, searchW
|
|
|
16
16
|
*
|
|
17
17
|
* @param {string[] | number[] | boolean[]} value - Value of the MultiSelect.
|
|
18
18
|
* @param {HTMLElement} label - Float label element.
|
|
19
|
+
* @param {FloatLabelType} floatlabeltype - specify the float label type.
|
|
19
20
|
*/
|
|
20
|
-
export declare function updateFloatLabelState(value: string[] | number[] | boolean[] | object[], label: HTMLElement): void;
|
|
21
|
+
export declare function updateFloatLabelState(value: string[] | number[] | boolean[] | object[], label: HTMLElement, floatlabeltype?: FloatLabelType): void;
|
|
21
22
|
/**
|
|
22
23
|
* Function to remove Float Label element.
|
|
23
24
|
*
|
|
@@ -44,7 +44,7 @@ export function createFloatLabel(overAllWrapper, searchWrapper, element, inputEl
|
|
|
44
44
|
searchWrapper.appendChild(floatLinelement);
|
|
45
45
|
searchWrapper.appendChild(floatLabelElement);
|
|
46
46
|
overAllWrapper.classList.add('e-float-input');
|
|
47
|
-
updateFloatLabelState(value, floatLabelElement);
|
|
47
|
+
updateFloatLabelState(value, floatLabelElement, floatLabelType);
|
|
48
48
|
if (floatLabelType === 'Always') {
|
|
49
49
|
if (floatLabelElement.classList.contains(LABELBOTTOM)) {
|
|
50
50
|
removeClass([floatLabelElement], LABELBOTTOM);
|
|
@@ -57,9 +57,13 @@ export function createFloatLabel(overAllWrapper, searchWrapper, element, inputEl
|
|
|
57
57
|
*
|
|
58
58
|
* @param {string[] | number[] | boolean[]} value - Value of the MultiSelect.
|
|
59
59
|
* @param {HTMLElement} label - Float label element.
|
|
60
|
+
* @param {FloatLabelType} floatlabeltype - specify the float label type.
|
|
60
61
|
*/
|
|
61
|
-
export function updateFloatLabelState(value, label) {
|
|
62
|
-
|
|
62
|
+
export function updateFloatLabelState(value, label, floatlabeltype) {
|
|
63
|
+
var floatElement = label.closest('.e-float-input');
|
|
64
|
+
var isFocused = floatElement &&
|
|
65
|
+
floatElement.classList.contains('e-input-focus');
|
|
66
|
+
if ((value && value.length > 0) || (isFocused && floatElement.closest('.e-multiselect') && floatlabeltype === 'Auto')) {
|
|
63
67
|
addClass([label], LABELTOP);
|
|
64
68
|
removeClass([label], LABELBOTTOM);
|
|
65
69
|
}
|
|
@@ -851,7 +851,6 @@ export declare class MultiSelect extends DropDownBase implements IInput {
|
|
|
851
851
|
protected preRender(): void;
|
|
852
852
|
protected getLocaleName(): string;
|
|
853
853
|
private initializeData;
|
|
854
|
-
private sanitizeData;
|
|
855
854
|
private updateData;
|
|
856
855
|
private initialTextUpdate;
|
|
857
856
|
protected renderList(isEmptyData?: boolean): void;
|
|
@@ -246,7 +246,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
246
246
|
};
|
|
247
247
|
MultiSelect.prototype.onPopupShown = function (e) {
|
|
248
248
|
var _this = this;
|
|
249
|
-
this.sanitizeData();
|
|
250
249
|
if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
|
|
251
250
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
252
251
|
var proxy_1 = this;
|
|
@@ -1825,6 +1824,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1825
1824
|
}
|
|
1826
1825
|
};
|
|
1827
1826
|
MultiSelect.prototype.showDelimWrapper = function () {
|
|
1827
|
+
if (!this.value || !this.value.length) {
|
|
1828
|
+
return;
|
|
1829
|
+
}
|
|
1828
1830
|
if (this.mode === 'CheckBox') {
|
|
1829
1831
|
this.viewWrapper.style.display = '';
|
|
1830
1832
|
}
|
|
@@ -2964,14 +2966,12 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2964
2966
|
_this.selectedListData.splice(index, 1);
|
|
2965
2967
|
}
|
|
2966
2968
|
_this.setProperties({ value: [].concat([], removeVal) }, true);
|
|
2967
|
-
if (_this.enableVirtualization) {
|
|
2968
|
-
var
|
|
2969
|
-
|
|
2970
|
-
_this.text.replace(
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
_this.text.replace(_this.delimiterChar + _this.text.split(_this.delimiterChar)[index], '');
|
|
2974
|
-
_this.setProperties({ text: currentText.toString() }, true);
|
|
2969
|
+
if (_this.enableVirtualization && !isNullOrUndefined(_this.text)) {
|
|
2970
|
+
var textItems = _this.text.split(_this.delimiterChar);
|
|
2971
|
+
var currentText = index === 0 && textItems.length === 1
|
|
2972
|
+
? _this.text.replace(textItems[index], '') : index === 0 ? _this.text.replace(textItems[index]
|
|
2973
|
+
+ _this.delimiterChar, '') : _this.text.replace(_this.delimiterChar + textItems[index], '');
|
|
2974
|
+
_this.setProperties({ text: currentText }, true);
|
|
2975
2975
|
}
|
|
2976
2976
|
if (element_1 !== null) {
|
|
2977
2977
|
var currentValue_1 = _this.allowObjectBinding ? getValue(((_this.fields.value) ?
|
|
@@ -4094,7 +4094,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4094
4094
|
}
|
|
4095
4095
|
this.preventSetCurrentData = false;
|
|
4096
4096
|
this.initializeData();
|
|
4097
|
-
this.sanitizeData();
|
|
4098
4097
|
this.updateDataAttribute(this.htmlAttributes);
|
|
4099
4098
|
_super.prototype.preRender.call(this);
|
|
4100
4099
|
};
|
|
@@ -4125,56 +4124,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4125
4124
|
endIndex: this.itemCount
|
|
4126
4125
|
};
|
|
4127
4126
|
};
|
|
4128
|
-
MultiSelect.prototype.sanitizeData = function () {
|
|
4129
|
-
if (this.enableVirtualization && this.mode === 'CheckBox') {
|
|
4130
|
-
if (this.dataSource && Array.isArray(this.dataSource) && !(this.dataSource instanceof DataManager)) {
|
|
4131
|
-
var cleanedDataSource = [];
|
|
4132
|
-
for (var i = 0; i < this.dataSource.length; i++) {
|
|
4133
|
-
var item = this.dataSource[i];
|
|
4134
|
-
if (item !== null && item !== undefined && item !== '') {
|
|
4135
|
-
if (typeof item === 'object') {
|
|
4136
|
-
var itemValue = getValue((this.fields.value ? this.fields.value : 'value'), item);
|
|
4137
|
-
if (this.fields.value !== null) {
|
|
4138
|
-
if (itemValue !== null && itemValue !== undefined && itemValue !== '') {
|
|
4139
|
-
cleanedDataSource.push(item);
|
|
4140
|
-
}
|
|
4141
|
-
}
|
|
4142
|
-
else {
|
|
4143
|
-
cleanedDataSource.push(item);
|
|
4144
|
-
}
|
|
4145
|
-
}
|
|
4146
|
-
else if (typeof item === 'string') {
|
|
4147
|
-
if (item !== null && item !== undefined && item.trim() !== '') {
|
|
4148
|
-
cleanedDataSource.push(item);
|
|
4149
|
-
}
|
|
4150
|
-
}
|
|
4151
|
-
else {
|
|
4152
|
-
cleanedDataSource.push(item);
|
|
4153
|
-
}
|
|
4154
|
-
}
|
|
4155
|
-
}
|
|
4156
|
-
if (cleanedDataSource.length !== this.dataSource.length) {
|
|
4157
|
-
this.setProperties({ dataSource: cleanedDataSource }, true);
|
|
4158
|
-
}
|
|
4159
|
-
}
|
|
4160
|
-
if (this.value && Array.isArray(this.value) && this.value.length > 0) {
|
|
4161
|
-
var cleanedValue = [];
|
|
4162
|
-
for (var i = 0; i < this.value.length; i++) {
|
|
4163
|
-
var val = this.value[i];
|
|
4164
|
-
if (val !== null && val !== undefined && val !== '') {
|
|
4165
|
-
cleanedValue.push(val);
|
|
4166
|
-
}
|
|
4167
|
-
}
|
|
4168
|
-
if (cleanedValue.length !== this.value.length) {
|
|
4169
|
-
this.setProperties({ value: cleanedValue }, true);
|
|
4170
|
-
}
|
|
4171
|
-
}
|
|
4172
|
-
return true;
|
|
4173
|
-
}
|
|
4174
|
-
else {
|
|
4175
|
-
return false;
|
|
4176
|
-
}
|
|
4177
|
-
};
|
|
4178
4127
|
MultiSelect.prototype.updateData = function (delimiterChar, e, isInitialVirtualData) {
|
|
4179
4128
|
var data = '';
|
|
4180
4129
|
var delim = this.mode === 'Delimiter' || this.mode === 'CheckBox';
|
|
@@ -4213,7 +4162,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4213
4162
|
var value = this_1.allowObjectBinding ?
|
|
4214
4163
|
getValue(((this_1.fields.value) ? this_1.fields.value : ''), this_1.value[this_1.value.length - 1]) :
|
|
4215
4164
|
this_1.value[this_1.value.length - 1];
|
|
4216
|
-
if (this_1.isRemoveSelection) {
|
|
4165
|
+
if (this_1.isRemoveSelection && this_1.text) {
|
|
4217
4166
|
data = this_1.text.replace(/,/g, delimiterChar + ' ') + delimiterChar + ' ';
|
|
4218
4167
|
text = this_1.text.split(delimiterChar);
|
|
4219
4168
|
}
|
|
@@ -4325,7 +4274,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4325
4274
|
|| this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
|
|
4326
4275
|
isEmptyData = true;
|
|
4327
4276
|
}
|
|
4328
|
-
this.sanitizeData();
|
|
4329
4277
|
_super.prototype.render.call(this, null, isEmptyData);
|
|
4330
4278
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4331
4279
|
this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
@@ -5592,7 +5540,8 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
5592
5540
|
: (_this.fields.value ? obj[_this.fields.value] : obj);
|
|
5593
5541
|
var text = isPlainValue
|
|
5594
5542
|
? String(obj)
|
|
5595
|
-
: (_this.fields.text ? (obj[_this.fields.text]).toString()
|
|
5543
|
+
: (_this.fields.text && obj[_this.fields.text] != null ? (obj[_this.fields.text]).toString()
|
|
5544
|
+
: String(obj));
|
|
5596
5545
|
if (_this.value && value != null && Array.isArray(_this.value) &&
|
|
5597
5546
|
((!_this.allowObjectBinding && _this.value.indexOf(value) < 0) ||
|
|
5598
5547
|
(_this.allowObjectBinding && !_this.isObjectInArray(value, _this.value)))) {
|
|
@@ -6256,7 +6205,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
6256
6205
|
switch (prop) {
|
|
6257
6206
|
case 'query':
|
|
6258
6207
|
case 'dataSource':
|
|
6259
|
-
this.sanitizeData();
|
|
6260
6208
|
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
6261
6209
|
if (!isNullOrUndefined(this.popupObj) && !this.isDimColumnWithCustomStyle()) {
|
|
6262
6210
|
this.popupObj.destroy();
|
|
@@ -6290,7 +6238,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
6290
6238
|
this.updateVal(this.value, this.value, 'text');
|
|
6291
6239
|
break;
|
|
6292
6240
|
case 'value':
|
|
6293
|
-
this.sanitizeData();
|
|
6294
6241
|
if (this.fields.disabled) {
|
|
6295
6242
|
this.removeDisabledItemsValue(this.value);
|
|
6296
6243
|
}
|
|
@@ -6733,8 +6680,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
6733
6680
|
}
|
|
6734
6681
|
this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
|
|
6735
6682
|
var args = { cancel: false };
|
|
6736
|
-
var oldValue = extend([], this.value, [], true);
|
|
6737
|
-
var oldData = extend([], this.dataSource, [], true);
|
|
6738
6683
|
this.trigger('beforeOpen', args, function (args) {
|
|
6739
6684
|
if (!args.cancel) {
|
|
6740
6685
|
if (!_this.ulElement) {
|
|
@@ -6746,50 +6691,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
6746
6691
|
if (_this.inputElement && _this.mode !== 'CheckBox') {
|
|
6747
6692
|
_this.focusIn();
|
|
6748
6693
|
}
|
|
6749
|
-
if (_this.enableVirtualization && _this.mode === 'CheckBox') {
|
|
6750
|
-
if (JSON.stringify(oldData) !== JSON.stringify(_this.dataSource) && _this.sanitizeData() && _this.showSelectAll) {
|
|
6751
|
-
_this.renderPopup();
|
|
6752
|
-
}
|
|
6753
|
-
if (!isNullOrUndefined(oldValue) && !isNullOrUndefined(_this.value) &&
|
|
6754
|
-
JSON.stringify(oldValue) !== JSON.stringify(_this.value) && _this.sanitizeData()) {
|
|
6755
|
-
if (_this.fields.disabled) {
|
|
6756
|
-
_this.removeDisabledItemsValue(_this.value);
|
|
6757
|
-
}
|
|
6758
|
-
if (!_this.validateValues(_this.value, oldValue)) {
|
|
6759
|
-
return;
|
|
6760
|
-
}
|
|
6761
|
-
if (_this.isVue && !_this.changeOnBlur && !_this.validateValues(_this.value, oldValue)) {
|
|
6762
|
-
return;
|
|
6763
|
-
}
|
|
6764
|
-
_this.updateVal(_this.value, oldValue, 'value', _this.enableVirtualization);
|
|
6765
|
-
_this.addValidInputClass();
|
|
6766
|
-
if (_this.showSelectAll) {
|
|
6767
|
-
_this.renderPopup();
|
|
6768
|
-
var totalCount = _this.dataSource instanceof DataManager ? 0 :
|
|
6769
|
-
_this.dataSource.length;
|
|
6770
|
-
var selectedCount = _this.value ? _this.value.length : 0;
|
|
6771
|
-
if (selectedCount === totalCount) {
|
|
6772
|
-
var frame = null;
|
|
6773
|
-
if (_this.popupObj) {
|
|
6774
|
-
frame = _this.popupObj.element.querySelector('.e-selectall-parent .e-frame');
|
|
6775
|
-
}
|
|
6776
|
-
if (frame) {
|
|
6777
|
-
frame.classList.add('e-check');
|
|
6778
|
-
frame.classList.remove('e-uncheck');
|
|
6779
|
-
frame.classList.remove('e-stop');
|
|
6780
|
-
}
|
|
6781
|
-
}
|
|
6782
|
-
}
|
|
6783
|
-
if (!_this.closePopupOnSelect && _this.isPopupOpen()) {
|
|
6784
|
-
_this.refreshPopup();
|
|
6785
|
-
}
|
|
6786
|
-
if (_this.isPopupOpen() && _this.list && _this.list.querySelector('.e-active.e-disable')) {
|
|
6787
|
-
var activeItems = _this.list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active' + '.e-disable');
|
|
6788
|
-
removeClass(activeItems, 'e-disable');
|
|
6789
|
-
}
|
|
6790
|
-
_this.preventChange = _this.isAngular && _this.preventChange ? !_this.preventChange : _this.preventChange;
|
|
6791
|
-
}
|
|
6792
|
-
}
|
|
6793
6694
|
return;
|
|
6794
6695
|
}
|
|
6795
6696
|
if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering && _this.isDeviceFullScreen) {
|
|
@@ -6947,7 +6848,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
6947
6848
|
// eslint-disable-next-line
|
|
6948
6849
|
this.value = this.value.slice();
|
|
6949
6850
|
}
|
|
6950
|
-
this.sanitizeData();
|
|
6951
6851
|
this.setDynValue = this.initStatus = false;
|
|
6952
6852
|
this.isSelectAll = false;
|
|
6953
6853
|
this.selectAllEventEle = [];
|