@syncfusion/ej2-dropdowns 26.1.40 → 26.1.42
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 +169 -72
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +170 -75
- 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 +10 -10
- package/src/drop-down-list/drop-down-list.js +20 -9
- package/src/drop-down-tree/drop-down-tree.js +5 -3
- package/src/list-box/list-box.js +73 -31
- package/src/mention/mention.js +2 -2
- package/src/multi-select/multi-select.d.ts +1 -0
- package/src/multi-select/multi-select.js +70 -30
- package/styles/bootstrap-dark.css +1 -1
- package/styles/bootstrap.css +1 -1
- package/styles/bootstrap4.css +1 -1
- package/styles/bootstrap5-dark.css +1 -1
- package/styles/bootstrap5.css +1 -1
- package/styles/drop-down-tree/_layout.scss +1 -1
- package/styles/drop-down-tree/bootstrap-dark.css +1 -1
- package/styles/drop-down-tree/bootstrap.css +1 -1
- package/styles/drop-down-tree/bootstrap4.css +1 -1
- package/styles/drop-down-tree/bootstrap5-dark.css +1 -1
- package/styles/drop-down-tree/bootstrap5.css +1 -1
- package/styles/drop-down-tree/fabric-dark.css +1 -1
- package/styles/drop-down-tree/fabric.css +1 -1
- package/styles/drop-down-tree/fluent-dark.css +1 -1
- package/styles/drop-down-tree/fluent.css +1 -1
- package/styles/drop-down-tree/fluent2.css +1 -1
- package/styles/drop-down-tree/highcontrast-light.css +1 -1
- package/styles/drop-down-tree/highcontrast.css +1 -1
- package/styles/drop-down-tree/material-dark.css +1 -1
- package/styles/drop-down-tree/material.css +1 -1
- package/styles/drop-down-tree/material3-dark.css +1 -1
- package/styles/drop-down-tree/material3.css +1 -1
- package/styles/drop-down-tree/tailwind-dark.css +1 -1
- package/styles/drop-down-tree/tailwind.css +1 -1
- package/styles/fabric-dark.css +1 -1
- package/styles/fabric.css +1 -1
- package/styles/fluent-dark.css +1 -1
- package/styles/fluent.css +1 -1
- package/styles/fluent2.css +3 -2
- package/styles/highcontrast-light.css +1 -1
- package/styles/highcontrast.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/material.css +1 -1
- package/styles/material3-dark.css +1 -1
- package/styles/material3.css +1 -1
- package/styles/multi-select/_fluent2-definition.scss +2 -1
- package/styles/multi-select/_theme.scss +3 -0
- package/styles/multi-select/fluent2.css +2 -1
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind.css +1 -1
|
@@ -4019,7 +4019,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4019
4019
|
this.removeSelection();
|
|
4020
4020
|
li.classList.add(dropDownBaseClasses.selected);
|
|
4021
4021
|
this.removeHover();
|
|
4022
|
-
var value = li.getAttribute('data-value') !==
|
|
4022
|
+
var value = li.getAttribute('data-value') !== null ? this.getFormattedValue(li.getAttribute('data-value')) : null;
|
|
4023
4023
|
var selectedData = this.getDataByValue(value);
|
|
4024
4024
|
if (!this.initial && !preventSelect && !isNullOrUndefined(e)) {
|
|
4025
4025
|
var items = this.detachChanges(selectedData);
|
|
@@ -4094,6 +4094,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4094
4094
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4095
4095
|
DropDownList.prototype.setValue = function (e) {
|
|
4096
4096
|
var dataItem = this.getItemData();
|
|
4097
|
+
this.isTouched = !isNullOrUndefined(e);
|
|
4097
4098
|
if (dataItem.value === null) {
|
|
4098
4099
|
Input.setValue(null, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
4099
4100
|
}
|
|
@@ -5986,7 +5987,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5986
5987
|
DropDownList.prototype.checkData = function (newProp) {
|
|
5987
5988
|
if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource)) && this.itemTemplate && this.allowFiltering &&
|
|
5988
5989
|
!(this.isListSearched && (newProp.dataSource instanceof DataManager))) {
|
|
5989
|
-
this.list
|
|
5990
|
+
if (this.list) {
|
|
5991
|
+
this.list.innerHTML = '';
|
|
5992
|
+
}
|
|
5990
5993
|
this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
|
|
5991
5994
|
}
|
|
5992
5995
|
this.isListSearched = false;
|
|
@@ -6028,7 +6031,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
6028
6031
|
this.itemData = this.getDataByValue(currentValue);
|
|
6029
6032
|
var dataItem = this.getItemData();
|
|
6030
6033
|
var value = this.allowObjectBinding ? this.itemData : dataItem.value;
|
|
6031
|
-
|
|
6034
|
+
var index = isNullOrUndefined(value) ? null : this.index;
|
|
6035
|
+
if (isNullOrUndefined(index) && (currentValue == value)) {
|
|
6036
|
+
this.setProperties({ 'text': dataItem.text, 'value': value });
|
|
6037
|
+
}
|
|
6038
|
+
else {
|
|
6039
|
+
this.setProperties({ 'text': dataItem.text, 'index': index, 'value': value });
|
|
6040
|
+
}
|
|
6032
6041
|
};
|
|
6033
6042
|
DropDownList.prototype.updateInputFields = function () {
|
|
6034
6043
|
if (this.getModuleName() === 'dropdownlist') {
|
|
@@ -6630,12 +6639,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
6630
6639
|
Input.setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
|
|
6631
6640
|
}
|
|
6632
6641
|
this.element.style.display = 'block';
|
|
6633
|
-
if (this.inputWrapper.container
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6642
|
+
if (this.inputWrapper.container && this.inputWrapper.container.parentElement) {
|
|
6643
|
+
if (this.inputWrapper.container.parentElement.tagName === this.getNgDirective()) {
|
|
6644
|
+
detach(this.inputWrapper.container);
|
|
6645
|
+
}
|
|
6646
|
+
else {
|
|
6647
|
+
this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
|
|
6648
|
+
detach(this.inputWrapper.container);
|
|
6649
|
+
}
|
|
6639
6650
|
}
|
|
6640
6651
|
delete this.hiddenElement;
|
|
6641
6652
|
this.filterInput = null;
|
|
@@ -7202,6 +7213,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7202
7213
|
_this.isFilteredData = false;
|
|
7203
7214
|
_this.isFilterRestore = true;
|
|
7204
7215
|
fields = _this.cloneFields(_this.fields);
|
|
7216
|
+
_this.treeObj.element.classList.remove('e-filtering');
|
|
7205
7217
|
}
|
|
7206
7218
|
else if (args.preventDefaultAction) {
|
|
7207
7219
|
fields = args.fields;
|
|
@@ -7222,6 +7234,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7222
7234
|
fields = _this.nestedFilter(args.text, args.fields);
|
|
7223
7235
|
}
|
|
7224
7236
|
}
|
|
7237
|
+
_this.treeObj.element.classList.add('e-filtering');
|
|
7225
7238
|
}
|
|
7226
7239
|
_this.hideCheckAll(_this.isFilteredData);
|
|
7227
7240
|
if (flag) {
|
|
@@ -8300,6 +8313,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
8300
8313
|
DropDownTree.prototype.renderPopup = function () {
|
|
8301
8314
|
var _this = this;
|
|
8302
8315
|
if (this.isFilteredData) {
|
|
8316
|
+
this.treeObj.element.classList.remove('e-filtering');
|
|
8303
8317
|
this.filterObj.value = '';
|
|
8304
8318
|
this.treeObj.fields = this.getTreeFields(this.fields);
|
|
8305
8319
|
this.isFilterRestore = true;
|
|
@@ -8369,10 +8383,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
8369
8383
|
_this.popupObj.refreshPosition();
|
|
8370
8384
|
if (!(_this.showCheckBox && _this.showSelectAll) && (!_this.popupDiv.classList.contains(NODATA)
|
|
8371
8385
|
&& _this.treeItems.length > 0)) {
|
|
8372
|
-
var focusedElement =
|
|
8373
|
-
if (
|
|
8386
|
+
var focusedElement = _this.value != null && _this.text != null ? _this.treeObj.element.querySelector('[data-uid="' + _this.value[0] + '"]') : null;
|
|
8387
|
+
if (focusedElement) {
|
|
8374
8388
|
_this.treeObj.element.querySelector('li').setAttribute('tabindex', '-1');
|
|
8375
|
-
focusedElement = _this.treeObj.element.querySelector('[data-uid="' + _this.value[0] + '"]');
|
|
8376
8389
|
focusedElement.setAttribute('tabindex', '0');
|
|
8377
8390
|
}
|
|
8378
8391
|
else {
|
|
@@ -12351,6 +12364,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12351
12364
|
this.isCustomRendered = true;
|
|
12352
12365
|
this.remoteCustomValue = this.enableVirtualization ? false : this.remoteCustomValue;
|
|
12353
12366
|
}
|
|
12367
|
+
if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy) && !isNullOrUndefined(this.fields.disabled)) {
|
|
12368
|
+
this.disableGroupHeader();
|
|
12369
|
+
}
|
|
12354
12370
|
if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
|
|
12355
12371
|
this.removeFocus();
|
|
12356
12372
|
}
|
|
@@ -12514,9 +12530,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12514
12530
|
return (!isNullOrUndefined(liElement) ? liElement : this.liCollections[0]);
|
|
12515
12531
|
};
|
|
12516
12532
|
MultiSelect.prototype.checkSelectAll = function () {
|
|
12517
|
-
var groupItemLength = this.list.querySelectorAll('li.e-list-group-item.e-active').length;
|
|
12533
|
+
var groupItemLength = !isNullOrUndefined(this.fields.disabled) ? this.list.querySelectorAll('li.e-list-group-item.e-active:not(.e-disabled)').length : this.list.querySelectorAll('li.e-list-group-item.e-active').length;
|
|
12518
12534
|
var listItem = this.list.querySelectorAll('li.e-list-item');
|
|
12519
|
-
var searchCount = this.enableVirtualization ? this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-virtual-list)').length : this.list.querySelectorAll('li.' + dropDownBaseClasses.li).length;
|
|
12535
|
+
var searchCount = this.enableVirtualization ? this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-virtual-list)').length : !isNullOrUndefined(this.fields.disabled) ? this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-disabled)').length : this.list.querySelectorAll('li.' + dropDownBaseClasses.li).length;
|
|
12520
12536
|
var searchActiveCount = this.list.querySelectorAll('li.' + dropDownBaseClasses.selected).length;
|
|
12521
12537
|
if (this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {
|
|
12522
12538
|
searchActiveCount = searchActiveCount - groupItemLength;
|
|
@@ -13900,7 +13916,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13900
13916
|
}
|
|
13901
13917
|
var focusedLi = this.list ? this.list.querySelector('.e-item-focus') : null;
|
|
13902
13918
|
if (this.isDisabledElement(focusedLi)) {
|
|
13903
|
-
if (this.list.querySelectorAll('.e-list-item:not(.e-hide-listitem):not(.e-disabled)').length === 0) {
|
|
13919
|
+
if (this.list.querySelectorAll('.e-list-item:not(.e-hide-listitem):not(.e-disabled)').length === 0 || (this.keyCode === 38 && this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy) && focusedLi === this.list.querySelector('li.e-list-group-item'))) {
|
|
13904
13920
|
this.removeFocus();
|
|
13905
13921
|
return;
|
|
13906
13922
|
}
|
|
@@ -14306,9 +14322,17 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14306
14322
|
MultiSelect.prototype.checkMaxSelection = function () {
|
|
14307
14323
|
var limit = this.value && this.value.length ? this.value.length : 0;
|
|
14308
14324
|
if (limit === this.maximumSelectionLength) {
|
|
14309
|
-
var
|
|
14325
|
+
var activeItems = this.list.querySelectorAll('li.'
|
|
14326
|
+
+ dropDownBaseClasses.li + '.e-active');
|
|
14327
|
+
removeClass(activeItems, 'e-disable');
|
|
14328
|
+
var inactiveItems = this.list.querySelectorAll('li.'
|
|
14310
14329
|
+ dropDownBaseClasses.li + ':not(.e-active)');
|
|
14311
|
-
addClass(
|
|
14330
|
+
addClass(inactiveItems, 'e-disable');
|
|
14331
|
+
}
|
|
14332
|
+
if (limit < this.maximumSelectionLength) {
|
|
14333
|
+
var collection = this.list.querySelectorAll('li.'
|
|
14334
|
+
+ dropDownBaseClasses.li);
|
|
14335
|
+
removeClass(collection, 'e-disable');
|
|
14312
14336
|
}
|
|
14313
14337
|
};
|
|
14314
14338
|
MultiSelect.prototype.dispatchSelect = function (value, eve, element, isNotTrigger, length) {
|
|
@@ -14864,7 +14888,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14864
14888
|
if (this.mode === 'CheckBox') {
|
|
14865
14889
|
this.refreshPlaceHolder();
|
|
14866
14890
|
this.refreshInputHight();
|
|
14867
|
-
if (this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
|
|
14891
|
+
if (!this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
|
|
14868
14892
|
this.updateValueState(e, this.value, this.tempValues);
|
|
14869
14893
|
}
|
|
14870
14894
|
}
|
|
@@ -15685,17 +15709,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
15685
15709
|
};
|
|
15686
15710
|
MultiSelect.prototype.findGroupAttrtibutes = function (listElement, checked, unChecked, count, position) {
|
|
15687
15711
|
while (!listElement.classList.contains('e-list-group-item')) {
|
|
15688
|
-
if (
|
|
15689
|
-
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
listElement.classList.contains('e-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15696
|
-
|
|
15712
|
+
if (!(this.fields.disabled && this.isDisabledElement(listElement))) {
|
|
15713
|
+
if (listElement.classList.contains('e-list-icon')) {
|
|
15714
|
+
listElement = listElement.parentElement;
|
|
15715
|
+
}
|
|
15716
|
+
if (listElement.getElementsByClassName('e-frame')[0].classList.contains('e-check') &&
|
|
15717
|
+
listElement.classList.contains('e-list-item')) {
|
|
15718
|
+
checked++;
|
|
15719
|
+
}
|
|
15720
|
+
else if (listElement.classList.contains('e-list-item')) {
|
|
15721
|
+
unChecked++;
|
|
15722
|
+
}
|
|
15723
|
+
count++;
|
|
15697
15724
|
}
|
|
15698
|
-
count++;
|
|
15699
15725
|
listElement = position ? listElement.nextElementSibling : listElement.previousElementSibling;
|
|
15700
15726
|
if (listElement == null) {
|
|
15701
15727
|
break;
|
|
@@ -15704,7 +15730,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
15704
15730
|
return [checked, unChecked, count];
|
|
15705
15731
|
};
|
|
15706
15732
|
MultiSelect.prototype.updateCheckBox = function (groupHeader, checked, unChecked, count) {
|
|
15707
|
-
if (groupHeader === null) {
|
|
15733
|
+
if (groupHeader === null || (!isNullOrUndefined(this.fields.disabled) && count === 0)) {
|
|
15708
15734
|
return;
|
|
15709
15735
|
}
|
|
15710
15736
|
var checkBoxElement = groupHeader.getElementsByClassName('e-frame')[0];
|
|
@@ -15733,6 +15759,28 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
15733
15759
|
groupHeader.setAttribute('aria-selected', 'false');
|
|
15734
15760
|
}
|
|
15735
15761
|
};
|
|
15762
|
+
MultiSelect.prototype.disableGroupHeader = function () {
|
|
15763
|
+
var collection = this.list.querySelectorAll('li.e-list-group-item');
|
|
15764
|
+
if (collection) {
|
|
15765
|
+
for (var index = 0; index < collection.length; index++) {
|
|
15766
|
+
var isDisabled = true;
|
|
15767
|
+
var target = collection[index].nextElementSibling;
|
|
15768
|
+
while (!target.classList.contains('e-list-group-item')) {
|
|
15769
|
+
if (!this.isDisabledElement(target)) {
|
|
15770
|
+
isDisabled = false;
|
|
15771
|
+
break;
|
|
15772
|
+
}
|
|
15773
|
+
target = target.nextElementSibling;
|
|
15774
|
+
if (target == null) {
|
|
15775
|
+
break;
|
|
15776
|
+
}
|
|
15777
|
+
}
|
|
15778
|
+
if (isDisabled) {
|
|
15779
|
+
this.disableListItem(collection[index]);
|
|
15780
|
+
}
|
|
15781
|
+
}
|
|
15782
|
+
}
|
|
15783
|
+
};
|
|
15736
15784
|
MultiSelect.prototype.deselectHeader = function () {
|
|
15737
15785
|
var limit = this.value && this.value.length ? this.value.length : 0;
|
|
15738
15786
|
var collection = this.list.querySelectorAll('li.e-list-group-item:not(.e-active)');
|
|
@@ -16106,22 +16154,24 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16106
16154
|
return;
|
|
16107
16155
|
}
|
|
16108
16156
|
while (listElement.classList.contains('e-list-item')) {
|
|
16109
|
-
if (
|
|
16110
|
-
if (
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16157
|
+
if (!(this.fields.disabled && this.isDisabledElement(listElement))) {
|
|
16158
|
+
if (state) {
|
|
16159
|
+
if (!listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {
|
|
16160
|
+
var selectionLimit = this.value && this.value.length ? this.value.length : 0;
|
|
16161
|
+
if (listElement.classList.contains('e-active')) {
|
|
16162
|
+
selectionLimit -= 1;
|
|
16163
|
+
}
|
|
16164
|
+
if (selectionLimit < this.maximumSelectionLength) {
|
|
16165
|
+
this.updateListSelection(listElement, event);
|
|
16166
|
+
}
|
|
16114
16167
|
}
|
|
16115
|
-
|
|
16168
|
+
}
|
|
16169
|
+
else {
|
|
16170
|
+
if (listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {
|
|
16116
16171
|
this.updateListSelection(listElement, event);
|
|
16117
16172
|
}
|
|
16118
16173
|
}
|
|
16119
16174
|
}
|
|
16120
|
-
else {
|
|
16121
|
-
if (listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {
|
|
16122
|
-
this.updateListSelection(listElement, event);
|
|
16123
|
-
}
|
|
16124
|
-
}
|
|
16125
16175
|
listElement = listElement.nextElementSibling;
|
|
16126
16176
|
if (listElement == null) {
|
|
16127
16177
|
break;
|
|
@@ -16424,7 +16474,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16424
16474
|
}
|
|
16425
16475
|
if (this.mode === 'CheckBox') {
|
|
16426
16476
|
this.updateDelimView();
|
|
16427
|
-
if (!(isRemoveAll || this.isSelectAll) && this.isSelectAllTarget) {
|
|
16477
|
+
if ((!(isRemoveAll || this.isSelectAll) && this.isSelectAllTarget) || (this.isSelectAll && this.isSelectAllTarget)) {
|
|
16428
16478
|
this.updateDelimeter(this.delimiterChar, event);
|
|
16429
16479
|
}
|
|
16430
16480
|
this.refreshInputHight();
|
|
@@ -16981,7 +17031,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16981
17031
|
* @returns {void}
|
|
16982
17032
|
*/
|
|
16983
17033
|
MultiSelect.prototype.render = function () {
|
|
16984
|
-
if (!isNullOrUndefined(this.value)) {
|
|
17034
|
+
if (!isNullOrUndefined(this.value) && this.value.length > 0) {
|
|
16985
17035
|
// eslint-disable-next-line
|
|
16986
17036
|
this.value = this.value.slice();
|
|
16987
17037
|
}
|
|
@@ -17378,6 +17428,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
17378
17428
|
this.removeDisabledItemsValue(this.value);
|
|
17379
17429
|
this.updateVal(this.value, oldValue, 'value');
|
|
17380
17430
|
}
|
|
17431
|
+
if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {
|
|
17432
|
+
this.disableGroupHeader();
|
|
17433
|
+
}
|
|
17381
17434
|
}
|
|
17382
17435
|
}
|
|
17383
17436
|
}
|
|
@@ -18274,6 +18327,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
18274
18327
|
*/
|
|
18275
18328
|
ListBox.prototype.addItem = function (items, itemIndex) {
|
|
18276
18329
|
_super.prototype.addItem.call(this, items, itemIndex);
|
|
18330
|
+
if (this.allowFiltering && this.filterInput.value !== '') {
|
|
18331
|
+
this.filteringAction(this.jsonData, new Query(), this.fields);
|
|
18332
|
+
}
|
|
18277
18333
|
};
|
|
18278
18334
|
/**
|
|
18279
18335
|
* Build and render the component.
|
|
@@ -18874,11 +18930,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
18874
18930
|
}
|
|
18875
18931
|
};
|
|
18876
18932
|
ListBox.prototype.updateListItems = function (sourceElem, destElem) {
|
|
18877
|
-
var i = 0;
|
|
18878
18933
|
destElem.innerHTML = '';
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
}
|
|
18934
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18935
|
+
destElem.append.apply(destElem, sourceElem.childNodes);
|
|
18882
18936
|
};
|
|
18883
18937
|
ListBox.prototype.removeSelected = function (listObj, elems) {
|
|
18884
18938
|
if (listObj.selectionSettings.showCheckbox) {
|
|
@@ -19010,6 +19064,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19010
19064
|
*/
|
|
19011
19065
|
ListBox.prototype.addItems = function (items, itemIndex) {
|
|
19012
19066
|
_super.prototype.addItem.call(this, items, itemIndex);
|
|
19067
|
+
if (this.allowFiltering && this.filterInput.value !== '') {
|
|
19068
|
+
this.filteringAction(this.jsonData, new Query(), this.fields);
|
|
19069
|
+
}
|
|
19013
19070
|
};
|
|
19014
19071
|
/**
|
|
19015
19072
|
* Removes a item from the list. By default, removed the last item in the list,
|
|
@@ -19519,8 +19576,13 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19519
19576
|
};
|
|
19520
19577
|
ListBox.prototype.getDataByElems = function (elems) {
|
|
19521
19578
|
var data = [];
|
|
19522
|
-
|
|
19523
|
-
|
|
19579
|
+
var len = elems.length;
|
|
19580
|
+
for (var i = 0; i < len; i++) {
|
|
19581
|
+
var elem = elems[i];
|
|
19582
|
+
var value = elem.getAttribute('data-value');
|
|
19583
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19584
|
+
var formattedValue = this.getFormattedValue(value);
|
|
19585
|
+
data.push(this.getDataByValue(formattedValue));
|
|
19524
19586
|
}
|
|
19525
19587
|
return data;
|
|
19526
19588
|
};
|
|
@@ -19695,16 +19757,39 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19695
19757
|
fListBox.value = [];
|
|
19696
19758
|
if (elems.length) {
|
|
19697
19759
|
this.removeSelected(fListBox, elems);
|
|
19760
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19761
|
+
var ulChildren_1 = Array.prototype.slice.call(fListBox.ulElement.children);
|
|
19762
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19763
|
+
var listItems_1 = Array.prototype.slice.call(fListBox.ulElement.querySelectorAll('.e-list-item'));
|
|
19764
|
+
var lData_1 = fListBox.listData;
|
|
19765
|
+
var sData_1 = fListBox.sortedData;
|
|
19766
|
+
var jData_1 = fListBox.jsonData;
|
|
19767
|
+
var eData_1;
|
|
19768
|
+
var listDataMap_1 = {};
|
|
19769
|
+
if (elems.length > 199) {
|
|
19770
|
+
for (var _i = 0, _a = fListBox.listData; _i < _a.length; _i++) {
|
|
19771
|
+
var item = _a[_i];
|
|
19772
|
+
if (!isNullOrUndefined(item)) {
|
|
19773
|
+
var key = fListBox.getFormattedValue(getValue((fListBox.fields.value ? fListBox.fields.value : 'value'), item));
|
|
19774
|
+
listDataMap_1[key] = item;
|
|
19775
|
+
}
|
|
19776
|
+
}
|
|
19777
|
+
}
|
|
19698
19778
|
elems.forEach(function (ele) {
|
|
19699
|
-
|
|
19700
|
-
|
|
19701
|
-
|
|
19702
|
-
|
|
19703
|
-
|
|
19704
|
-
|
|
19705
|
-
|
|
19706
|
-
|
|
19707
|
-
|
|
19779
|
+
if (elems.length < 200) {
|
|
19780
|
+
eData_1 = fListBox.getDataByElems([ele])[0];
|
|
19781
|
+
}
|
|
19782
|
+
else {
|
|
19783
|
+
var value_1 = ele.getAttribute('data-value');
|
|
19784
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19785
|
+
var formattedValue = fListBox.getFormattedValue(value_1);
|
|
19786
|
+
eData_1 = listDataMap_1[formattedValue];
|
|
19787
|
+
}
|
|
19788
|
+
idx.push(ulChildren_1.indexOf(ele));
|
|
19789
|
+
dataLiIdx.push(listItems_1.indexOf(ele));
|
|
19790
|
+
dataIdx.push(lData_1.indexOf(eData_1));
|
|
19791
|
+
sortIdx.push(sData_1.indexOf(eData_1));
|
|
19792
|
+
jsonIdx.push(jData_1.indexOf(eData_1));
|
|
19708
19793
|
});
|
|
19709
19794
|
if (this.sortOrder !== 'None') {
|
|
19710
19795
|
sortIdx.forEach(function (i) {
|
|
@@ -19843,20 +19928,27 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19843
19928
|
// eslint-disable-next-line prefer-spread
|
|
19844
19929
|
flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
|
|
19845
19930
|
}
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
19931
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19932
|
+
var childNodes = fListBox.ulElement.childNodes;
|
|
19933
|
+
var childElementCount = fListBox.ulElement.childElementCount;
|
|
19934
|
+
var newFlistboxArray = [];
|
|
19935
|
+
for (var i = 0; i < childElementCount; i++) {
|
|
19936
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19937
|
+
var childNode = childNodes[i];
|
|
19938
|
+
if (childNode.classList.contains('e-disabled')) {
|
|
19939
|
+
tempLiColl.push(childNode);
|
|
19851
19940
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19852
19941
|
tempData.push(fListBox.listData[i]);
|
|
19853
19942
|
}
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19943
|
+
else {
|
|
19944
|
+
newFlistboxArray.push(i);
|
|
19945
|
+
}
|
|
19946
|
+
}
|
|
19947
|
+
flistboxarray = newFlistboxArray;
|
|
19948
|
+
if (!isRefresh) {
|
|
19949
|
+
moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
|
|
19950
|
+
fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
19857
19951
|
}
|
|
19858
|
-
moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
|
|
19859
|
-
this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
19860
19952
|
if (isKey) {
|
|
19861
19953
|
this.list.focus();
|
|
19862
19954
|
}
|
|
@@ -19912,7 +20004,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19912
20004
|
if (isRefresh) {
|
|
19913
20005
|
var sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
19914
20006
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
19915
|
-
|
|
20007
|
+
fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
19916
20008
|
}
|
|
19917
20009
|
else {
|
|
19918
20010
|
tListBox.sortedData = listData;
|
|
@@ -20201,11 +20293,13 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
20201
20293
|
}
|
|
20202
20294
|
};
|
|
20203
20295
|
ListBox.prototype.resizeHandler = function () {
|
|
20204
|
-
if (this.list.
|
|
20205
|
-
this.list.
|
|
20206
|
-
|
|
20207
|
-
|
|
20208
|
-
|
|
20296
|
+
if (this.list && !(this.cssClass && this.cssClass.indexOf('e-horizontal-listbox') > -1)) {
|
|
20297
|
+
if (this.list.scrollWidth > this.list.offsetWidth) {
|
|
20298
|
+
this.list.querySelector('.e-list-parent').style.display = 'inline-block';
|
|
20299
|
+
}
|
|
20300
|
+
else {
|
|
20301
|
+
this.list.querySelector('.e-list-parent').style.display = 'block';
|
|
20302
|
+
}
|
|
20209
20303
|
}
|
|
20210
20304
|
};
|
|
20211
20305
|
ListBox.prototype.getValidIndex = function (cli, index, keyCode) {
|
|
@@ -20349,6 +20443,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
20349
20443
|
};
|
|
20350
20444
|
ListBox.prototype.checkDisabledState = function (inst) {
|
|
20351
20445
|
if (isNullOrUndefined(inst.ulElement)) {
|
|
20446
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20352
20447
|
if (!isNullOrUndefined(this.dataSource) && isNullOrUndefined(this.dataSource.length)) {
|
|
20353
20448
|
return false;
|
|
20354
20449
|
}
|
|
@@ -22035,10 +22130,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
22035
22130
|
}
|
|
22036
22131
|
if (this.isContentEditable(this.inputElement)) {
|
|
22037
22132
|
if (Browser.isAndroid) {
|
|
22038
|
-
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '');
|
|
22133
|
+
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
22039
22134
|
}
|
|
22040
22135
|
else {
|
|
22041
|
-
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '');
|
|
22136
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
22042
22137
|
}
|
|
22043
22138
|
}
|
|
22044
22139
|
else {
|