@syncfusion/ej2-dropdowns 32.2.8 → 33.1.44
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 +490 -139
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +467 -114
- 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 +8 -8
- package/src/combo-box/combo-box.js +3 -0
- package/src/common/virtual-scroll.d.ts +1 -0
- package/src/common/virtual-scroll.js +17 -1
- package/src/drop-down-base/drop-down-base.d.ts +2 -0
- package/src/drop-down-base/drop-down-base.js +42 -0
- package/src/drop-down-list/drop-down-list.d.ts +1 -0
- package/src/drop-down-list/drop-down-list.js +143 -30
- package/src/drop-down-tree/drop-down-tree-model.d.ts +1 -1
- package/src/drop-down-tree/drop-down-tree.d.ts +1 -1
- package/src/mention/mention.js +8 -4
- package/src/multi-select/multi-select.d.ts +2 -0
- package/src/multi-select/multi-select.js +254 -79
- package/styles/bds-lite.css +17 -9
- package/styles/bds.css +29 -15
- package/styles/bootstrap-dark-lite.css +17 -9
- package/styles/bootstrap-dark.css +27 -14
- package/styles/bootstrap-lite.css +17 -9
- package/styles/bootstrap.css +27 -14
- package/styles/bootstrap4-lite.css +17 -9
- package/styles/bootstrap4.css +27 -14
- package/styles/bootstrap5-dark-lite.css +17 -9
- package/styles/bootstrap5-dark.css +27 -14
- package/styles/bootstrap5-lite.css +17 -9
- package/styles/bootstrap5.3-lite.css +19 -9
- package/styles/bootstrap5.3.css +29 -14
- package/styles/bootstrap5.css +27 -14
- package/styles/drop-down-base/_bds-definition.scss +2 -2
- package/styles/drop-down-base/_bigger.scss +3 -3
- package/styles/drop-down-base/_bootstrap-dark-definition.scss +3 -3
- package/styles/drop-down-base/_bootstrap-definition.scss +3 -3
- package/styles/drop-down-base/_bootstrap4-definition.scss +3 -3
- package/styles/drop-down-base/_bootstrap5-dark-definition.scss +3 -3
- package/styles/drop-down-base/_bootstrap5-definition.scss +3 -3
- package/styles/drop-down-base/_bootstrap5.3-definition.scss +6 -3
- package/styles/drop-down-base/_fabric-dark-definition.scss +3 -3
- package/styles/drop-down-base/_fabric-definition.scss +3 -3
- package/styles/drop-down-base/_fluent-dark-definition.scss +3 -3
- package/styles/drop-down-base/_fluent-definition.scss +3 -3
- package/styles/drop-down-base/_fluent2-definition.scss +8 -5
- package/styles/drop-down-base/_fusionnew-definition.scss +2 -2
- package/styles/drop-down-base/_highcontrast-definition.scss +3 -3
- package/styles/drop-down-base/_highcontrast-light-definition.scss +3 -3
- package/styles/drop-down-base/_layout.scss +12 -1
- package/styles/drop-down-base/_material-dark-definition.scss +2 -2
- package/styles/drop-down-base/_material-definition.scss +2 -2
- package/styles/drop-down-base/_material3-dark-definition.scss +6 -4
- package/styles/drop-down-base/_material3-definition.scss +6 -4
- package/styles/drop-down-base/_tailwind-dark-definition.scss +4 -4
- package/styles/drop-down-base/_tailwind-definition.scss +4 -4
- package/styles/drop-down-base/_tailwind3-definition.scss +5 -2
- package/styles/drop-down-base/_theme.scss +6 -0
- package/styles/drop-down-base/bds.css +21 -11
- package/styles/drop-down-base/bootstrap-dark.css +19 -10
- package/styles/drop-down-base/bootstrap.css +19 -10
- package/styles/drop-down-base/bootstrap4.css +19 -10
- package/styles/drop-down-base/bootstrap5-dark.css +19 -10
- package/styles/drop-down-base/bootstrap5.3.css +21 -10
- package/styles/drop-down-base/bootstrap5.css +19 -10
- package/styles/drop-down-base/fabric-dark.css +19 -10
- package/styles/drop-down-base/fabric.css +19 -10
- package/styles/drop-down-base/fluent-dark.css +19 -10
- package/styles/drop-down-base/fluent.css +19 -10
- package/styles/drop-down-base/fluent2.css +28 -12
- package/styles/drop-down-base/highcontrast-light.css +19 -10
- package/styles/drop-down-base/highcontrast.css +19 -10
- package/styles/drop-down-base/material-dark.css +17 -9
- package/styles/drop-down-base/material.css +17 -9
- package/styles/drop-down-base/material3-dark.css +19 -9
- package/styles/drop-down-base/material3.css +19 -9
- package/styles/drop-down-base/tailwind-dark.css +21 -11
- package/styles/drop-down-base/tailwind.css +21 -11
- package/styles/drop-down-base/tailwind3.css +19 -9
- package/styles/drop-down-list/bds.css +4 -2
- package/styles/drop-down-list/bootstrap-dark.css +4 -2
- package/styles/drop-down-list/bootstrap.css +4 -2
- package/styles/drop-down-list/bootstrap4.css +4 -2
- package/styles/drop-down-list/bootstrap5-dark.css +4 -2
- package/styles/drop-down-list/bootstrap5.3.css +4 -2
- package/styles/drop-down-list/bootstrap5.css +4 -2
- package/styles/drop-down-list/fabric-dark.css +4 -2
- package/styles/drop-down-list/fabric.css +4 -2
- package/styles/drop-down-list/fluent-dark.css +4 -2
- package/styles/drop-down-list/fluent.css +4 -2
- package/styles/drop-down-list/fluent2.css +4 -2
- package/styles/drop-down-list/highcontrast-light.css +4 -2
- package/styles/drop-down-list/highcontrast.css +4 -2
- package/styles/drop-down-list/material-dark.css +4 -2
- package/styles/drop-down-list/material.css +4 -2
- package/styles/drop-down-list/material3-dark.css +4 -2
- package/styles/drop-down-list/material3.css +4 -2
- package/styles/drop-down-list/tailwind-dark.css +4 -2
- package/styles/drop-down-list/tailwind.css +4 -2
- package/styles/drop-down-list/tailwind3.css +4 -2
- package/styles/drop-down-tree/bds.css +4 -2
- package/styles/drop-down-tree/bootstrap-dark.css +4 -2
- package/styles/drop-down-tree/bootstrap.css +4 -2
- package/styles/drop-down-tree/bootstrap4.css +4 -2
- package/styles/drop-down-tree/bootstrap5-dark.css +4 -2
- package/styles/drop-down-tree/bootstrap5.3.css +4 -2
- package/styles/drop-down-tree/bootstrap5.css +4 -2
- package/styles/drop-down-tree/fabric-dark.css +4 -2
- package/styles/drop-down-tree/fabric.css +4 -2
- package/styles/drop-down-tree/fluent-dark.css +4 -2
- package/styles/drop-down-tree/fluent.css +4 -2
- package/styles/drop-down-tree/fluent2.css +4 -2
- package/styles/drop-down-tree/highcontrast-light.css +4 -2
- package/styles/drop-down-tree/highcontrast.css +4 -2
- package/styles/drop-down-tree/material-dark.css +4 -2
- package/styles/drop-down-tree/material.css +4 -2
- package/styles/drop-down-tree/material3-dark.css +4 -2
- package/styles/drop-down-tree/material3.css +4 -2
- package/styles/drop-down-tree/tailwind-dark.css +4 -2
- package/styles/drop-down-tree/tailwind.css +4 -2
- package/styles/drop-down-tree/tailwind3.css +4 -2
- package/styles/fabric-dark-lite.css +17 -9
- package/styles/fabric-dark.css +27 -14
- package/styles/fabric-lite.css +17 -9
- package/styles/fabric.css +27 -14
- package/styles/fluent-dark-lite.css +17 -9
- package/styles/fluent-dark.css +27 -14
- package/styles/fluent-lite.css +17 -9
- package/styles/fluent.css +27 -14
- package/styles/fluent2-lite.css +24 -10
- package/styles/fluent2.css +36 -16
- package/styles/highcontrast-light-lite.css +17 -9
- package/styles/highcontrast-light.css +27 -14
- package/styles/highcontrast-lite.css +17 -9
- package/styles/highcontrast.css +27 -14
- package/styles/list-box/bds.css +4 -2
- package/styles/list-box/bootstrap-dark.css +4 -2
- package/styles/list-box/bootstrap.css +4 -2
- package/styles/list-box/bootstrap4.css +4 -2
- package/styles/list-box/bootstrap5-dark.css +4 -2
- package/styles/list-box/bootstrap5.3.css +4 -2
- package/styles/list-box/bootstrap5.css +4 -2
- package/styles/list-box/fabric-dark.css +4 -2
- package/styles/list-box/fabric.css +4 -2
- package/styles/list-box/fluent-dark.css +4 -2
- package/styles/list-box/fluent.css +4 -2
- package/styles/list-box/fluent2.css +4 -2
- package/styles/list-box/highcontrast-light.css +4 -2
- package/styles/list-box/highcontrast.css +4 -2
- package/styles/list-box/material-dark.css +4 -2
- package/styles/list-box/material.css +4 -2
- package/styles/list-box/material3-dark.css +4 -2
- package/styles/list-box/material3.css +4 -2
- package/styles/list-box/tailwind-dark.css +4 -2
- package/styles/list-box/tailwind.css +4 -2
- package/styles/list-box/tailwind3.css +4 -2
- package/styles/material-dark-lite.css +17 -9
- package/styles/material-dark.css +25 -13
- package/styles/material-lite.css +17 -9
- package/styles/material.css +25 -13
- package/styles/material3-dark-lite.css +19 -9
- package/styles/material3-dark.css +27 -13
- package/styles/material3-lite.css +19 -9
- package/styles/material3.css +27 -13
- package/styles/mention/bds.css +4 -2
- package/styles/mention/bootstrap-dark.css +4 -2
- package/styles/mention/bootstrap.css +4 -2
- package/styles/mention/bootstrap4.css +4 -2
- package/styles/mention/bootstrap5-dark.css +4 -2
- package/styles/mention/bootstrap5.3.css +4 -2
- package/styles/mention/bootstrap5.css +4 -2
- package/styles/mention/fabric-dark.css +4 -2
- package/styles/mention/fabric.css +4 -2
- package/styles/mention/fluent-dark.css +4 -2
- package/styles/mention/fluent.css +4 -2
- package/styles/mention/fluent2.css +4 -2
- package/styles/mention/highcontrast-light.css +4 -2
- package/styles/mention/highcontrast.css +4 -2
- package/styles/mention/material-dark.css +4 -2
- package/styles/mention/material.css +4 -2
- package/styles/mention/material3-dark.css +4 -2
- package/styles/mention/material3.css +4 -2
- package/styles/mention/tailwind-dark.css +4 -2
- package/styles/mention/tailwind.css +4 -2
- package/styles/mention/tailwind3.css +4 -2
- package/styles/multi-select/bds.css +12 -6
- package/styles/multi-select/bootstrap-dark.css +12 -6
- package/styles/multi-select/bootstrap.css +12 -6
- package/styles/multi-select/bootstrap4.css +12 -6
- package/styles/multi-select/bootstrap5-dark.css +12 -6
- package/styles/multi-select/bootstrap5.3.css +12 -6
- package/styles/multi-select/bootstrap5.css +12 -6
- package/styles/multi-select/fabric-dark.css +12 -6
- package/styles/multi-select/fabric.css +12 -6
- package/styles/multi-select/fluent-dark.css +12 -6
- package/styles/multi-select/fluent.css +12 -6
- package/styles/multi-select/fluent2.css +12 -6
- package/styles/multi-select/highcontrast-light.css +12 -6
- package/styles/multi-select/highcontrast.css +12 -6
- package/styles/multi-select/material-dark.css +12 -6
- package/styles/multi-select/material.css +12 -6
- package/styles/multi-select/material3-dark.css +12 -6
- package/styles/multi-select/material3.css +12 -6
- package/styles/multi-select/tailwind-dark.css +12 -6
- package/styles/multi-select/tailwind.css +12 -6
- package/styles/multi-select/tailwind3.css +12 -6
- package/styles/tailwind-dark-lite.css +17 -9
- package/styles/tailwind-dark.css +29 -15
- package/styles/tailwind-lite.css +17 -9
- package/styles/tailwind.css +29 -15
- package/styles/tailwind3-lite.css +19 -9
- package/styles/tailwind3.css +27 -13
|
@@ -319,7 +319,8 @@ class VirtualScroll {
|
|
|
319
319
|
this.touchModule = new Touch(this.parent.popupContentElement, {
|
|
320
320
|
scroll: this.popupScrollHandler.bind(this)
|
|
321
321
|
});
|
|
322
|
-
|
|
322
|
+
this.scrollHandler = this.virtualScrollHandler(callback);
|
|
323
|
+
EventHandler.add(this.parent.popupContentElement, 'scroll', this.scrollHandler, this);
|
|
323
324
|
}
|
|
324
325
|
getModuleName() {
|
|
325
326
|
return 'VirtualScroll';
|
|
@@ -448,17 +449,18 @@ class VirtualScroll {
|
|
|
448
449
|
query = query.skip(0).take(this.parent.itemCount - (this.parent.value.length - this.parent.viewPortInfo.startIndex));
|
|
449
450
|
this.parent.appendUncheckList = true;
|
|
450
451
|
this.parent.setCurrentView = false;
|
|
451
|
-
|
|
452
|
+
let oldUlElement = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
|
|
452
453
|
if (oldUlElement) {
|
|
453
454
|
this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
|
|
454
455
|
}
|
|
455
456
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
456
457
|
isListUpdated = false;
|
|
457
458
|
this.parent.appendUncheckList = this.parent.dataSource instanceof DataManager ? this.parent.appendUncheckList : false;
|
|
459
|
+
oldUlElement = null;
|
|
458
460
|
}
|
|
459
461
|
}
|
|
460
462
|
else {
|
|
461
|
-
|
|
463
|
+
let reOrderList = this.parent.list.querySelectorAll('.e-reorder')[0];
|
|
462
464
|
if (this.parent.list.querySelector('.e-virtual-ddl-content') && reOrderList) {
|
|
463
465
|
this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(reOrderList);
|
|
464
466
|
}
|
|
@@ -470,6 +472,7 @@ class VirtualScroll {
|
|
|
470
472
|
this.parent.setCurrentView = false;
|
|
471
473
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
472
474
|
isListUpdated = false;
|
|
475
|
+
reOrderList = null;
|
|
473
476
|
}
|
|
474
477
|
this.parent.totalItemsCount();
|
|
475
478
|
}
|
|
@@ -481,10 +484,11 @@ class VirtualScroll {
|
|
|
481
484
|
for (let i = this.parent.viewPortInfo.startIndex; i < endIndex; i++) {
|
|
482
485
|
const index = i;
|
|
483
486
|
if (this.component === 'multiselect' && this.parent.mode === 'CheckBox') {
|
|
484
|
-
|
|
487
|
+
let oldUlElement = this.parent.list.querySelector('.e-list-parent' + '.e-reorder');
|
|
485
488
|
if (oldUlElement) {
|
|
486
489
|
this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
|
|
487
490
|
}
|
|
491
|
+
oldUlElement = null;
|
|
488
492
|
}
|
|
489
493
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
490
494
|
const alreadyAddedData = this.parent.generatedDataObject[index];
|
|
@@ -808,6 +812,18 @@ class VirtualScroll {
|
|
|
808
812
|
};
|
|
809
813
|
}
|
|
810
814
|
destroy() {
|
|
815
|
+
if (this.parent.popupContentElement) {
|
|
816
|
+
EventHandler.remove(this.parent.popupContentElement, 'wheel mousedown', this.popupScrollHandler);
|
|
817
|
+
EventHandler.remove(this.parent.popupContentElement, 'scroll', this.scrollHandler);
|
|
818
|
+
}
|
|
819
|
+
// Destroy touch module
|
|
820
|
+
if (this.touchModule) {
|
|
821
|
+
this.touchModule.destroy();
|
|
822
|
+
this.touchModule = null;
|
|
823
|
+
}
|
|
824
|
+
// Clear references
|
|
825
|
+
this.containerElementRect = null;
|
|
826
|
+
this.scrollHandler = null;
|
|
811
827
|
this.removeEventListener();
|
|
812
828
|
}
|
|
813
829
|
}
|
|
@@ -1098,7 +1114,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1098
1114
|
return checkTemplate;
|
|
1099
1115
|
}
|
|
1100
1116
|
l10nUpdate(actionFailure) {
|
|
1101
|
-
|
|
1117
|
+
let ele = this.getModuleName() === 'listbox' ? this.ulElement : this.list;
|
|
1102
1118
|
if ((!isNullOrUndefined(this.noRecordsTemplate) && this.noRecordsTemplate !== 'No records found') || this.actionFailureTemplate !== 'Request failed') {
|
|
1103
1119
|
const template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
|
|
1104
1120
|
let compiledString;
|
|
@@ -1169,6 +1185,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1169
1185
|
}
|
|
1170
1186
|
}
|
|
1171
1187
|
}
|
|
1188
|
+
ele = null;
|
|
1172
1189
|
}
|
|
1173
1190
|
checkAndResetCache() {
|
|
1174
1191
|
if (this.isVirtualizationEnabled) {
|
|
@@ -1271,6 +1288,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1271
1288
|
UpdateSkeleton(isSkeletonCountChange, skeletonCount) {
|
|
1272
1289
|
const isContainSkeleton = this.list.querySelector('.e-virtual-ddl-content');
|
|
1273
1290
|
const isContainVirtualList = this.list.querySelector('.e-virtual-list');
|
|
1291
|
+
if (!this.skeletonInstances) {
|
|
1292
|
+
this.skeletonInstances = [];
|
|
1293
|
+
}
|
|
1274
1294
|
if (isContainSkeleton && (!isContainVirtualList || isSkeletonCountChange) && this.isVirtualizationEnabled) {
|
|
1275
1295
|
const totalSkeletonCount = isSkeletonCountChange ? skeletonCount : this.skeletonCount;
|
|
1276
1296
|
for (let i = 0; i < totalSkeletonCount; i++) {
|
|
@@ -1284,6 +1304,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1284
1304
|
width: '95%',
|
|
1285
1305
|
cssClass: 'e-skeleton-text'
|
|
1286
1306
|
});
|
|
1307
|
+
this.skeletonInstances.push(skeleton);
|
|
1287
1308
|
skeleton.appendTo(this.createElement('div'));
|
|
1288
1309
|
liElement.appendChild(skeleton.element);
|
|
1289
1310
|
if (isContainSkeleton.firstChild) {
|
|
@@ -1316,6 +1337,16 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1316
1337
|
}
|
|
1317
1338
|
}
|
|
1318
1339
|
}
|
|
1340
|
+
destroySkeletons() {
|
|
1341
|
+
if (this.skeletonInstances && this.skeletonInstances.length > 0) {
|
|
1342
|
+
this.skeletonInstances.forEach((skeleton) => {
|
|
1343
|
+
if (skeleton && !skeleton.isDestroyed) {
|
|
1344
|
+
skeleton.destroy();
|
|
1345
|
+
}
|
|
1346
|
+
});
|
|
1347
|
+
this.skeletonInstances = [];
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1319
1350
|
getLocaleName() {
|
|
1320
1351
|
return 'drop-down-base';
|
|
1321
1352
|
}
|
|
@@ -1422,8 +1453,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1422
1453
|
this.setProperties({ htmlAttributes: attr }, true);
|
|
1423
1454
|
}
|
|
1424
1455
|
renderItemsBySelect() {
|
|
1425
|
-
|
|
1426
|
-
|
|
1456
|
+
let element = this.element;
|
|
1457
|
+
let group = element.querySelectorAll('select>optgroup');
|
|
1427
1458
|
let fields;
|
|
1428
1459
|
const isSelectGroupCheck = this.getModuleName() === 'multiselect' && this.isGroupChecking && group.length > 0;
|
|
1429
1460
|
fields = isSelectGroupCheck ? { value: 'value', text: 'text', groupBy: 'categeory' } : fields = { value: 'value', text: 'text' };
|
|
@@ -1449,6 +1480,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1449
1480
|
}
|
|
1450
1481
|
this.updateFields(fields.text, fields.value, isSelectGroupCheck ? fields.groupBy : this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss, this.fields.disabled);
|
|
1451
1482
|
this.resetList(jsonElement, fields);
|
|
1483
|
+
element = null;
|
|
1484
|
+
group = null;
|
|
1452
1485
|
}
|
|
1453
1486
|
updateFields(text, value, groupBy, htmlAttributes, iconCss, disabled) {
|
|
1454
1487
|
const field = {
|
|
@@ -1981,6 +2014,12 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1981
2014
|
this.ulElement = this.list.querySelector('ul');
|
|
1982
2015
|
this.postRender(this.list, list, this.bindEvent);
|
|
1983
2016
|
}
|
|
2017
|
+
else if (this.getModuleName() === 'dropdownlist' && this.isVirtualizationEnabled) {
|
|
2018
|
+
this.list.innerHTML = '';
|
|
2019
|
+
this.createVirtualContent();
|
|
2020
|
+
this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
|
|
2021
|
+
this.updateListElements(this.listData);
|
|
2022
|
+
}
|
|
1984
2023
|
}
|
|
1985
2024
|
if (this.getModuleName() === 'multiselect' && this.isAngular && this.ngEle) {
|
|
1986
2025
|
const popupHolder = this.list;
|
|
@@ -2208,7 +2247,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2208
2247
|
}
|
|
2209
2248
|
}
|
|
2210
2249
|
updateFixedGroupTemplateHader(element) {
|
|
2211
|
-
|
|
2250
|
+
let groupData = element.cloneNode ? element.cloneNode(true) : element;
|
|
2212
2251
|
let isGroupDataUpdated = false;
|
|
2213
2252
|
if (this.groupHeaderItems && this.groupHeaderItems.length > 0) {
|
|
2214
2253
|
for (let i = 0; i < this.groupHeaderItems.length; i++) {
|
|
@@ -2229,6 +2268,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2229
2268
|
}
|
|
2230
2269
|
this.fixedHeaderElement.innerHTML = groupData.innerHTML;
|
|
2231
2270
|
this.renderGroupTemplate(this.fixedHeaderElement);
|
|
2271
|
+
groupData = null;
|
|
2232
2272
|
}
|
|
2233
2273
|
updateGroupFixedHeader(element, target) {
|
|
2234
2274
|
if (this.fixedHeaderElement && this.list && this.list.parentElement) {
|
|
@@ -2327,7 +2367,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2327
2367
|
}
|
|
2328
2368
|
if (this.isVirtualizationEnabled) {
|
|
2329
2369
|
let oldUlElement = this.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
|
|
2330
|
-
|
|
2370
|
+
let virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
2331
2371
|
const isRemovedUlelement = false;
|
|
2332
2372
|
if ((!oldUlElement && this.list.querySelector('.e-list-parent' + '.e-reorder')) || (oldUlElement && this.isVirtualReorder && this.list.querySelector('.e-list-parent' + '.e-reorder'))) {
|
|
2333
2373
|
oldUlElement = this.list.querySelector('.e-list-parent' + '.e-reorder');
|
|
@@ -2349,6 +2389,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2349
2389
|
this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
|
|
2350
2390
|
this.updateListElements(listData);
|
|
2351
2391
|
}
|
|
2392
|
+
oldUlElement = null;
|
|
2393
|
+
virtualUlElement = null;
|
|
2352
2394
|
}
|
|
2353
2395
|
}
|
|
2354
2396
|
return ulElement;
|
|
@@ -2761,7 +2803,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2761
2803
|
if (items && fields.groupBy) {
|
|
2762
2804
|
items = ListBase.groupDataSource(items, fields.properties);
|
|
2763
2805
|
}
|
|
2764
|
-
|
|
2806
|
+
let liCollections = [];
|
|
2765
2807
|
for (let i = 0; i < items.length; i++) {
|
|
2766
2808
|
const item = items[i];
|
|
2767
2809
|
const isHeader = item.isHeader;
|
|
@@ -2878,6 +2920,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2878
2920
|
this.updateSelection();
|
|
2879
2921
|
}
|
|
2880
2922
|
this.addedNewItem = true;
|
|
2923
|
+
liCollections = null;
|
|
2881
2924
|
}
|
|
2882
2925
|
/**
|
|
2883
2926
|
* Checks if the given HTML element is disabled.
|
|
@@ -2993,13 +3036,28 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2993
3036
|
detach(this.list);
|
|
2994
3037
|
}
|
|
2995
3038
|
}
|
|
3039
|
+
if (this.generatedDataObject) {
|
|
3040
|
+
this.generatedDataObject = {};
|
|
3041
|
+
}
|
|
3042
|
+
this.destroySkeletons();
|
|
2996
3043
|
this.liCollections = null;
|
|
3044
|
+
this.incrementalLiCollections = null;
|
|
3045
|
+
this.incrementalUlElement = null;
|
|
2997
3046
|
this.ulElement = null;
|
|
3047
|
+
this.fixedHeaderElement = null;
|
|
2998
3048
|
this.list = null;
|
|
3049
|
+
this.item = null;
|
|
2999
3050
|
this.enableRtlElements = null;
|
|
3000
3051
|
this.groupHeaderItems = null;
|
|
3001
3052
|
this.fiteredGroupHeaderItems = null;
|
|
3002
3053
|
this.rippleFun = null;
|
|
3054
|
+
this.popupContentElement = null;
|
|
3055
|
+
this.virtualListInfo = null;
|
|
3056
|
+
this.viewPortInfo = null;
|
|
3057
|
+
this.selectedValueInfo = null;
|
|
3058
|
+
this.virtualGroupDataSource = null;
|
|
3059
|
+
this.virtualSelectAllData = null;
|
|
3060
|
+
this.incrementalListData = null;
|
|
3003
3061
|
super.destroy();
|
|
3004
3062
|
}
|
|
3005
3063
|
};
|
|
@@ -3233,13 +3291,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3233
3291
|
}
|
|
3234
3292
|
floatLabelChange() {
|
|
3235
3293
|
if (this.getModuleName() === 'dropdownlist' && this.floatLabelType === 'Auto') {
|
|
3236
|
-
|
|
3294
|
+
let floatElement = this.inputWrapper.container.querySelector('.e-float-text');
|
|
3237
3295
|
if (floatElement && this.inputElement.value !== '' || this.isInteracted) {
|
|
3238
3296
|
classList(floatElement, ['e-label-top'], ['e-label-bottom']);
|
|
3239
3297
|
}
|
|
3240
3298
|
else if (floatElement) {
|
|
3241
3299
|
classList(floatElement, ['e-label-bottom'], ['e-label-top']);
|
|
3242
3300
|
}
|
|
3301
|
+
floatElement = null;
|
|
3243
3302
|
}
|
|
3244
3303
|
}
|
|
3245
3304
|
resetHandler(e) {
|
|
@@ -3510,7 +3569,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3510
3569
|
this.setSelection(this.getElementByValue(value), null);
|
|
3511
3570
|
}
|
|
3512
3571
|
else if (this.text && isNullOrUndefined(this.value)) {
|
|
3513
|
-
|
|
3572
|
+
let element = this.getElementByText(this.text);
|
|
3514
3573
|
if (isNullOrUndefined(element)) {
|
|
3515
3574
|
this.setProperties({ text: null });
|
|
3516
3575
|
return;
|
|
@@ -3518,6 +3577,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3518
3577
|
else {
|
|
3519
3578
|
this.setSelection(element, null);
|
|
3520
3579
|
}
|
|
3580
|
+
element = null;
|
|
3521
3581
|
}
|
|
3522
3582
|
else {
|
|
3523
3583
|
this.setSelection(this.liCollections[this.activeIndex], null);
|
|
@@ -3674,7 +3734,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3674
3734
|
if (formElement) {
|
|
3675
3735
|
EventHandler.remove(formElement, 'reset', this.resetValueHandler);
|
|
3676
3736
|
}
|
|
3677
|
-
if (!Browser.isDevice) {
|
|
3737
|
+
if (!Browser.isDevice && !isNullOrUndefined(this.keyboardModule)) {
|
|
3678
3738
|
this.keyboardModule.destroy();
|
|
3679
3739
|
}
|
|
3680
3740
|
if (this.showClearButton) {
|
|
@@ -3783,7 +3843,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3783
3843
|
onMouseClick(e) {
|
|
3784
3844
|
const target = e.target;
|
|
3785
3845
|
this.keyboardEvent = null;
|
|
3786
|
-
|
|
3846
|
+
let li = closest(target, '.' + dropDownBaseClasses.li);
|
|
3787
3847
|
if (!this.isValidLI(li) || this.isDisabledElement(li)) {
|
|
3788
3848
|
return;
|
|
3789
3849
|
}
|
|
@@ -3795,10 +3855,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3795
3855
|
const delay = 100;
|
|
3796
3856
|
this.closePopup(delay, e);
|
|
3797
3857
|
}
|
|
3858
|
+
li = null;
|
|
3798
3859
|
}
|
|
3799
3860
|
onMouseOver(e) {
|
|
3800
|
-
|
|
3861
|
+
let currentLi = closest(e.target, '.' + dropDownBaseClasses.li);
|
|
3801
3862
|
this.setHover(currentLi);
|
|
3863
|
+
currentLi = null;
|
|
3802
3864
|
}
|
|
3803
3865
|
setHover(li) {
|
|
3804
3866
|
if (this.enabled && this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
|
|
@@ -3936,6 +3998,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3936
3998
|
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
3937
3999
|
this.list.scrollTop = 0;
|
|
3938
4000
|
}
|
|
4001
|
+
li = null;
|
|
3939
4002
|
}
|
|
3940
4003
|
else {
|
|
3941
4004
|
let li;
|
|
@@ -3950,6 +4013,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3950
4013
|
this.setSelection(li, e);
|
|
3951
4014
|
this.setScrollPosition();
|
|
3952
4015
|
}
|
|
4016
|
+
li = null;
|
|
3953
4017
|
}
|
|
3954
4018
|
}
|
|
3955
4019
|
}
|
|
@@ -4088,7 +4152,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4088
4152
|
this.activeIndex = filterIndex;
|
|
4089
4153
|
}
|
|
4090
4154
|
}
|
|
4091
|
-
|
|
4155
|
+
let focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
4092
4156
|
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
4093
4157
|
this.setSelection(focusEle, e);
|
|
4094
4158
|
if (this.enableVirtualization) {
|
|
@@ -4183,6 +4247,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4183
4247
|
this.ulElement = this.list.querySelector('ul');
|
|
4184
4248
|
this.handleVirtualKeyboardActions(e, this.pageCount);
|
|
4185
4249
|
}
|
|
4250
|
+
nextItem = null;
|
|
4186
4251
|
}
|
|
4187
4252
|
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
4188
4253
|
const value = this.getItemData().value;
|
|
@@ -4219,6 +4284,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4219
4284
|
this.updateUpDownAction(e);
|
|
4220
4285
|
}
|
|
4221
4286
|
e.preventDefault();
|
|
4287
|
+
focusEle = null;
|
|
4222
4288
|
}
|
|
4223
4289
|
updateHomeEndAction(e, isVirtualKeyAction) {
|
|
4224
4290
|
if (this.getModuleName() === 'dropdownlist') {
|
|
@@ -4325,7 +4391,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4325
4391
|
}
|
|
4326
4392
|
selectCurrentItem(e) {
|
|
4327
4393
|
if (this.isPopupOpen) {
|
|
4328
|
-
|
|
4394
|
+
let li = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
4329
4395
|
if (this.isDisabledElement(li)) {
|
|
4330
4396
|
return;
|
|
4331
4397
|
}
|
|
@@ -4339,6 +4405,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4339
4405
|
}
|
|
4340
4406
|
this.hidePopup(e);
|
|
4341
4407
|
this.focusDropDown(e);
|
|
4408
|
+
li = null;
|
|
4342
4409
|
}
|
|
4343
4410
|
else {
|
|
4344
4411
|
this.showPopup();
|
|
@@ -4536,6 +4603,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4536
4603
|
ulElement = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
4537
4604
|
this.actionCompleteData.ulElement = ulElement;
|
|
4538
4605
|
}
|
|
4606
|
+
ulElement = null;
|
|
4539
4607
|
}
|
|
4540
4608
|
}
|
|
4541
4609
|
updateSelectedItem(li, e, preventSelect, isSelection) {
|
|
@@ -4573,6 +4641,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4573
4641
|
this.setSelectOptions(li, e);
|
|
4574
4642
|
}
|
|
4575
4643
|
}
|
|
4644
|
+
li = null;
|
|
4576
4645
|
}
|
|
4577
4646
|
selectEventCallback(li, e, preventSelect, selectedData, value) {
|
|
4578
4647
|
this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
|
|
@@ -4582,7 +4651,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4582
4651
|
}
|
|
4583
4652
|
this.item = li;
|
|
4584
4653
|
this.itemData = selectedData;
|
|
4585
|
-
|
|
4654
|
+
let focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
4586
4655
|
if (focusedItem) {
|
|
4587
4656
|
removeClass([focusedItem], dropDownBaseClasses.focus);
|
|
4588
4657
|
}
|
|
@@ -4607,6 +4676,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4607
4676
|
}
|
|
4608
4677
|
this.activeIndex = this.getIndexByValue(value);
|
|
4609
4678
|
}
|
|
4679
|
+
focusedItem = null;
|
|
4610
4680
|
}
|
|
4611
4681
|
activeItem(li) {
|
|
4612
4682
|
if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.selected)) {
|
|
@@ -5264,7 +5334,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5264
5334
|
}
|
|
5265
5335
|
setSearchBox(popupElement) {
|
|
5266
5336
|
if (this.isFiltering()) {
|
|
5267
|
-
|
|
5337
|
+
let parentElement = popupElement.querySelector('.' + dropDownListClasses.filterParent) ?
|
|
5268
5338
|
popupElement.querySelector('.' + dropDownListClasses.filterParent) : this.createElement('span', {
|
|
5269
5339
|
className: dropDownListClasses.filterParent
|
|
5270
5340
|
});
|
|
@@ -5324,6 +5394,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5324
5394
|
EventHandler.add(this.filterInput, 'keydown', this.onFilterDown, this);
|
|
5325
5395
|
EventHandler.add(this.filterInput, 'blur', this.onBlurHandler, this);
|
|
5326
5396
|
EventHandler.add(this.filterInput, 'paste', this.pasteHandler, this);
|
|
5397
|
+
parentElement = null;
|
|
5327
5398
|
return this.filterInputObj;
|
|
5328
5399
|
}
|
|
5329
5400
|
else {
|
|
@@ -5483,8 +5554,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5483
5554
|
else if (this.enableVirtualization && this.getModuleName() !== 'autocomplete' && !this.isFiltering()) {
|
|
5484
5555
|
const value = this.getItemData().value;
|
|
5485
5556
|
this.activeIndex = this.getIndexByValue(value);
|
|
5486
|
-
|
|
5557
|
+
let element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
5487
5558
|
this.selectedLI = element;
|
|
5559
|
+
element = null;
|
|
5488
5560
|
}
|
|
5489
5561
|
else if (this.enableVirtualization && this.getModuleName() === 'autocomplete') {
|
|
5490
5562
|
this.activeIndex = this.skeletonCount;
|
|
@@ -5530,7 +5602,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5530
5602
|
});
|
|
5531
5603
|
return checkField;
|
|
5532
5604
|
}
|
|
5533
|
-
checkAndFetchItemData(list, value, checkField) {
|
|
5605
|
+
checkAndFetchItemData(list, value, checkField, isOffline = false) {
|
|
5534
5606
|
const fieldValue = this.fields.value.split('.');
|
|
5535
5607
|
let checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
|
|
5536
5608
|
this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
|
|
@@ -5539,27 +5611,66 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5539
5611
|
this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
|
|
5540
5612
|
}
|
|
5541
5613
|
if (!checkVal && this.dataSource instanceof DataManager) {
|
|
5542
|
-
(
|
|
5543
|
-
.
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5614
|
+
if (isOffline) {
|
|
5615
|
+
this.searchOfflineData(value, checkField);
|
|
5616
|
+
}
|
|
5617
|
+
else {
|
|
5618
|
+
(this.dataSource).executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
|
|
5619
|
+
.then((e) => {
|
|
5620
|
+
if (e.result.length > 0) {
|
|
5621
|
+
if (!this.enableVirtualization) {
|
|
5622
|
+
this.addItem(e.result, list.length);
|
|
5623
|
+
}
|
|
5624
|
+
else {
|
|
5625
|
+
this.itemData = e.result[0];
|
|
5626
|
+
const dataItem = this.getItemData();
|
|
5627
|
+
if ((this.value === dataItem.value && this.text !== dataItem.text) ||
|
|
5628
|
+
(this.value !== dataItem.value && this.text === dataItem.text)) {
|
|
5629
|
+
this.setProperties({ text: dataItem.text.toString() });
|
|
5630
|
+
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
5631
|
+
}
|
|
5632
|
+
}
|
|
5633
|
+
this.updateValues();
|
|
5547
5634
|
}
|
|
5548
5635
|
else {
|
|
5549
|
-
this.
|
|
5550
|
-
const dataItem = this.getItemData();
|
|
5551
|
-
if ((this.value === dataItem.value && this.text !== dataItem.text) ||
|
|
5552
|
-
(this.value !== dataItem.value && this.text === dataItem.text)) {
|
|
5553
|
-
this.setProperties({ text: dataItem.text.toString() });
|
|
5554
|
-
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
5555
|
-
}
|
|
5636
|
+
this.updateValues();
|
|
5556
5637
|
}
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5638
|
+
});
|
|
5639
|
+
}
|
|
5640
|
+
}
|
|
5641
|
+
else {
|
|
5642
|
+
this.updateValues();
|
|
5643
|
+
}
|
|
5644
|
+
}
|
|
5645
|
+
searchOfflineData(value, checkField) {
|
|
5646
|
+
if (!(this.dataSource instanceof DataManager)) {
|
|
5647
|
+
this.updateValues();
|
|
5648
|
+
return;
|
|
5649
|
+
}
|
|
5650
|
+
const dataManager = this.dataSource;
|
|
5651
|
+
const fullData = dataManager.dataSource.json || [];
|
|
5652
|
+
if (fullData && fullData.length > 0) {
|
|
5653
|
+
const foundItem = fullData.find((item) => {
|
|
5654
|
+
if (this.fields.value && this.fields.value.includes('.')) {
|
|
5655
|
+
const fieldValueArray = this.fields.value.split('.');
|
|
5656
|
+
const fieldVal = this.checkFieldValue(item, fieldValueArray);
|
|
5657
|
+
return fieldVal === value;
|
|
5561
5658
|
}
|
|
5659
|
+
return item[checkField] === value;
|
|
5562
5660
|
});
|
|
5661
|
+
if (foundItem) {
|
|
5662
|
+
this.itemData = foundItem;
|
|
5663
|
+
const dataItem = this.getItemData();
|
|
5664
|
+
if ((this.value === dataItem.value && this.text !== dataItem.text) ||
|
|
5665
|
+
(this.value !== dataItem.value && this.text === dataItem.text)) {
|
|
5666
|
+
this.setProperties({ text: dataItem.text.toString() });
|
|
5667
|
+
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
5668
|
+
}
|
|
5669
|
+
this.updateValues();
|
|
5670
|
+
}
|
|
5671
|
+
else {
|
|
5672
|
+
this.updateValues();
|
|
5673
|
+
}
|
|
5563
5674
|
}
|
|
5564
5675
|
else {
|
|
5565
5676
|
this.updateValues();
|
|
@@ -5611,15 +5722,16 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5611
5722
|
const value = this.getItemData().value;
|
|
5612
5723
|
this.activeIndex = ((this.enableVirtualization && !isNullOrUndefined(value)) || !this.enableVirtualization) ?
|
|
5613
5724
|
this.getIndexByValue(value) : this.activeIndex;
|
|
5614
|
-
|
|
5725
|
+
let element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
5615
5726
|
this.selectedLI = element;
|
|
5616
5727
|
this.activeItem(element);
|
|
5617
5728
|
if (!(this.enableVirtualization && isNullOrUndefined(element))) {
|
|
5618
5729
|
this.removeFocus();
|
|
5619
5730
|
}
|
|
5731
|
+
element = null;
|
|
5620
5732
|
}
|
|
5621
5733
|
updateSelection() {
|
|
5622
|
-
|
|
5734
|
+
let selectedItem = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
5623
5735
|
if (selectedItem) {
|
|
5624
5736
|
this.setProperties({ 'index': this.getIndexByValue(selectedItem.getAttribute('data-value')) });
|
|
5625
5737
|
this.activeIndex = this.index;
|
|
@@ -5635,6 +5747,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5635
5747
|
}
|
|
5636
5748
|
this.list.querySelector('.' + dropDownBaseClasses.li).classList.add(dropDownListClasses.focus);
|
|
5637
5749
|
}
|
|
5750
|
+
selectedItem = null;
|
|
5638
5751
|
}
|
|
5639
5752
|
updateSelectionList() {
|
|
5640
5753
|
const selectedItem = this.list && this.list.querySelector('.' + 'e-active');
|
|
@@ -5771,12 +5884,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5771
5884
|
if (Browser.isDevice && this.isDeviceFullScreen && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
|
|
5772
5885
|
(this.isDropDownClick && this.getModuleName() === 'combobox')))) {
|
|
5773
5886
|
offsetValue = this.getOffsetValue(popupEle);
|
|
5774
|
-
|
|
5887
|
+
let firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
5775
5888
|
if (!isNullOrUndefined(this.inputElement)) {
|
|
5776
5889
|
left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
|
|
5777
5890
|
parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
|
|
5778
5891
|
parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
|
|
5779
5892
|
}
|
|
5893
|
+
firstItem = null;
|
|
5780
5894
|
}
|
|
5781
5895
|
this.createPopup(popupEle, offsetValue, left);
|
|
5782
5896
|
this.popupContentElement = this.popupObj.element.querySelector('.e-content');
|
|
@@ -6005,9 +6119,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6005
6119
|
open: () => {
|
|
6006
6120
|
EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
|
|
6007
6121
|
this.isPopupOpen = true;
|
|
6008
|
-
|
|
6122
|
+
let actionList = this.actionCompleteData && this.actionCompleteData.ulElement &&
|
|
6009
6123
|
this.actionCompleteData.ulElement.querySelector('li');
|
|
6010
|
-
|
|
6124
|
+
let ulElement = this.list.querySelector('ul li');
|
|
6011
6125
|
if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
6012
6126
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
6013
6127
|
}
|
|
@@ -6028,6 +6142,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6028
6142
|
}
|
|
6029
6143
|
}
|
|
6030
6144
|
this.activeStateChange();
|
|
6145
|
+
actionList = null;
|
|
6146
|
+
ulElement = null;
|
|
6031
6147
|
},
|
|
6032
6148
|
targetExitViewport: () => {
|
|
6033
6149
|
if (!Browser.isDevice) {
|
|
@@ -6064,16 +6180,17 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6064
6180
|
this.popupObj.element.style.width = '100%';
|
|
6065
6181
|
this.list.style.maxHeight = (window.innerHeight - searchBoxHeight) + 'px';
|
|
6066
6182
|
this.list.style.height = (window.innerHeight - searchBoxHeight) + 'px';
|
|
6067
|
-
|
|
6183
|
+
let clearElement = this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon);
|
|
6068
6184
|
detach(this.filterInput);
|
|
6069
6185
|
clearElement.parentElement.insertBefore(this.filterInput, clearElement);
|
|
6186
|
+
clearElement = null;
|
|
6070
6187
|
}
|
|
6071
6188
|
setPopupPosition(border) {
|
|
6072
6189
|
let offsetValue;
|
|
6073
6190
|
const popupOffset = border;
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6191
|
+
let selectedLI = this.list.querySelector('.' + dropDownListClasses.focus) || this.selectedLI;
|
|
6192
|
+
let firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
6193
|
+
let lastItem = this.isEmptyList() ? this.list : this.liCollections[this.getItems().length - 1];
|
|
6077
6194
|
const liHeight = firstItem.getBoundingClientRect().height;
|
|
6078
6195
|
this.listItemHeight = liHeight + parseInt(window.getComputedStyle(firstItem).marginBottom, 10);
|
|
6079
6196
|
const listHeight = this.list.offsetHeight / 2;
|
|
@@ -6095,6 +6212,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6095
6212
|
}
|
|
6096
6213
|
const inputHeight = this.inputWrapper.container.offsetHeight;
|
|
6097
6214
|
offsetValue = offsetValue + liHeight + popupOffset - ((liHeight - inputHeight) / 2);
|
|
6215
|
+
selectedLI = null;
|
|
6216
|
+
firstItem = null;
|
|
6217
|
+
lastItem = null;
|
|
6098
6218
|
return -offsetValue;
|
|
6099
6219
|
}
|
|
6100
6220
|
setWidth() {
|
|
@@ -6105,10 +6225,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6105
6225
|
}
|
|
6106
6226
|
if (Browser.isDevice && (width.indexOf('px') > -1) && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
|
|
6107
6227
|
(this.isDropDownClick && this.getModuleName() === 'combobox')))) {
|
|
6108
|
-
|
|
6228
|
+
let firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
6109
6229
|
width = (parseInt(width, 10) + (parseInt(getComputedStyle(firstItem).textIndent, 10) -
|
|
6110
6230
|
parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
|
|
6111
6231
|
parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10)) * 2) + 'px';
|
|
6232
|
+
firstItem = null;
|
|
6112
6233
|
}
|
|
6113
6234
|
return width;
|
|
6114
6235
|
}
|
|
@@ -6357,7 +6478,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6357
6478
|
EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
|
|
6358
6479
|
EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
|
|
6359
6480
|
}
|
|
6360
|
-
if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
|
|
6481
|
+
if (this.allowFiltering && !isNullOrUndefined(this.filterInput) && this.getModuleName() === 'dropdownlist') {
|
|
6361
6482
|
this.filterInput.removeAttribute('aria-activedescendant');
|
|
6362
6483
|
this.filterInput.removeAttribute('aria-disabled');
|
|
6363
6484
|
this.filterInput.removeAttribute('role');
|
|
@@ -6365,7 +6486,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6365
6486
|
this.filterInput.removeAttribute('autocapitalize');
|
|
6366
6487
|
this.filterInput.removeAttribute('spellcheck');
|
|
6367
6488
|
}
|
|
6368
|
-
if (this.filterInput.parentNode) {
|
|
6489
|
+
if (!isNullOrUndefined(this.filterInput) && this.filterInput.parentNode) {
|
|
6369
6490
|
this.filterInput.parentNode.removeChild(this.filterInput);
|
|
6370
6491
|
const attrs = Array.prototype.slice.call(this.filterInput.attributes);
|
|
6371
6492
|
for (let n = 0; n < attrs.length; n++) {
|
|
@@ -6464,7 +6585,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6464
6585
|
if (isNullOrUndefined(currentData)) {
|
|
6465
6586
|
return;
|
|
6466
6587
|
}
|
|
6467
|
-
|
|
6588
|
+
let ulElement = this.renderItems(currentData, this.fields);
|
|
6468
6589
|
this.list.scrollTop = 0;
|
|
6469
6590
|
this.virtualListInfo = {
|
|
6470
6591
|
currentPageNumber: null,
|
|
@@ -6516,6 +6637,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6516
6637
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6517
6638
|
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
6518
6639
|
}
|
|
6640
|
+
ulElement = null;
|
|
6519
6641
|
}
|
|
6520
6642
|
destroyPopup() {
|
|
6521
6643
|
this.isPopupOpen = false;
|
|
@@ -6707,10 +6829,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6707
6829
|
this.viewPortInfo.endIndex : this.itemCount;
|
|
6708
6830
|
}
|
|
6709
6831
|
getListHeight() {
|
|
6710
|
-
|
|
6832
|
+
let listParent = this.createElement('div', {
|
|
6711
6833
|
className: 'e-dropdownbase'
|
|
6712
6834
|
});
|
|
6713
|
-
|
|
6835
|
+
let item = this.createElement('li', {
|
|
6714
6836
|
className: 'e-list-item'
|
|
6715
6837
|
});
|
|
6716
6838
|
const listParentHeight = formatUnit(this.popupHeight);
|
|
@@ -6722,6 +6844,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6722
6844
|
const listItemHeight = Math.ceil(item.getBoundingClientRect().height) +
|
|
6723
6845
|
parseInt(window.getComputedStyle(item).marginBottom, 10);
|
|
6724
6846
|
listParent.remove();
|
|
6847
|
+
listParent = null;
|
|
6848
|
+
item = null;
|
|
6725
6849
|
return listItemHeight;
|
|
6726
6850
|
}
|
|
6727
6851
|
setFooterTemplate(popupEle) {
|
|
@@ -6773,8 +6897,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6773
6897
|
if (headerCompTemp && headerCompTemp.length) {
|
|
6774
6898
|
append(headerCompTemp, this.header);
|
|
6775
6899
|
}
|
|
6776
|
-
|
|
6900
|
+
let contentEle = popupEle.querySelector('div.e-content');
|
|
6777
6901
|
popupEle.insertBefore(this.header, contentEle);
|
|
6902
|
+
contentEle = null;
|
|
6778
6903
|
}
|
|
6779
6904
|
/**
|
|
6780
6905
|
* Sets the enabled state to DropDownBase.
|
|
@@ -6839,6 +6964,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6839
6964
|
((props.dataSource instanceof DataManager) || (!isNullOrUndefined(props) && Array.isArray(props.dataSource) &&
|
|
6840
6965
|
!isNullOrUndefined(oldProps) && Array.isArray(oldProps.dataSource) && props.dataSource.length !== oldProps.dataSource.length))) {
|
|
6841
6966
|
this.typedString = '';
|
|
6967
|
+
this.selectData = null;
|
|
6842
6968
|
this.resetList(this.dataSource);
|
|
6843
6969
|
}
|
|
6844
6970
|
if (!this.isCustomFilter && !this.isFilterFocus && document.activeElement !== this.filterInput) {
|
|
@@ -6990,11 +7116,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6990
7116
|
return;
|
|
6991
7117
|
}
|
|
6992
7118
|
if (this.enableVirtualization) {
|
|
7119
|
+
const isOfflineMode = this.dataSource instanceof DataManager &&
|
|
7120
|
+
this.dataSource.dataSource.offline === true;
|
|
6993
7121
|
if (newProp.value && this.dataSource instanceof DataManager) {
|
|
6994
7122
|
const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
|
|
6995
7123
|
const value = this.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
|
|
6996
7124
|
getValue(checkField, newProp.value) : newProp.value;
|
|
6997
|
-
this.checkAndFetchItemData(this.listData, value, checkField);
|
|
7125
|
+
this.checkAndFetchItemData(this.listData, value, checkField, isOfflineMode);
|
|
6998
7126
|
}
|
|
6999
7127
|
this.updateValues();
|
|
7000
7128
|
this.updateInputFields();
|
|
@@ -7063,7 +7191,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7063
7191
|
this.renderList();
|
|
7064
7192
|
}
|
|
7065
7193
|
if (!this.initialRemoteRender && this.liCollections) {
|
|
7066
|
-
|
|
7194
|
+
let element = this.liCollections[newProp.index];
|
|
7067
7195
|
if (!this.checkValidLi(element)) {
|
|
7068
7196
|
if (this.liCollections && this.liCollections.length === 100 &&
|
|
7069
7197
|
this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
|
|
@@ -7074,6 +7202,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7074
7202
|
}
|
|
7075
7203
|
}
|
|
7076
7204
|
this.updateInputFields();
|
|
7205
|
+
element = null;
|
|
7077
7206
|
}
|
|
7078
7207
|
break;
|
|
7079
7208
|
case 'footerTemplate':
|
|
@@ -7157,6 +7286,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7157
7286
|
}
|
|
7158
7287
|
}
|
|
7159
7288
|
};
|
|
7289
|
+
li = null;
|
|
7160
7290
|
}
|
|
7161
7291
|
updatePopupState() {
|
|
7162
7292
|
if (this.beforePopupOpen) {
|
|
@@ -7321,7 +7451,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7321
7451
|
this.isEscapeKey = false;
|
|
7322
7452
|
if (!isNullOrUndefined(this.index)) {
|
|
7323
7453
|
const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
7324
|
-
|
|
7454
|
+
let element = this.findListElement(this.ulElement, 'li', 'data-value', value);
|
|
7325
7455
|
this.selectedLI = this.liCollections[this.index] || element;
|
|
7326
7456
|
if (this.selectedLI) {
|
|
7327
7457
|
this.updateSelectedItem(this.selectedLI, null, true);
|
|
@@ -7329,6 +7459,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7329
7459
|
this.setValueTemplate();
|
|
7330
7460
|
}
|
|
7331
7461
|
}
|
|
7462
|
+
element = null;
|
|
7332
7463
|
}
|
|
7333
7464
|
else {
|
|
7334
7465
|
this.resetSelection();
|
|
@@ -7440,7 +7571,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7440
7571
|
}
|
|
7441
7572
|
const isValidIndex = itemIndex < this.liCollections.length && itemIndex > -1;
|
|
7442
7573
|
if (isValidIndex && !(JSON.parse(JSON.stringify(this.listData[itemIndex]))[this.fields.disabled])) {
|
|
7443
|
-
|
|
7574
|
+
let li = this.liCollections[itemIndex];
|
|
7444
7575
|
if (li) {
|
|
7445
7576
|
this.disableListItem(li);
|
|
7446
7577
|
const parsedData = JSON.parse(JSON.stringify(this.listData[itemIndex]));
|
|
@@ -7454,6 +7585,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7454
7585
|
this.clear();
|
|
7455
7586
|
}
|
|
7456
7587
|
}
|
|
7588
|
+
li = null;
|
|
7457
7589
|
}
|
|
7458
7590
|
}
|
|
7459
7591
|
}
|
|
@@ -7489,7 +7621,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7489
7621
|
if (this.inputElement) {
|
|
7490
7622
|
const attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
|
|
7491
7623
|
'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
|
|
7492
|
-
'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'
|
|
7624
|
+
'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label',
|
|
7625
|
+
'role', 'value', 'style', 'type'];
|
|
7493
7626
|
for (let i = 0; i < attrArray.length; i++) {
|
|
7494
7627
|
this.inputElement.removeAttribute(attrArray[i]);
|
|
7495
7628
|
}
|
|
@@ -7570,6 +7703,43 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7570
7703
|
detach(this.popupObj.element);
|
|
7571
7704
|
this.popupObj.element = null;
|
|
7572
7705
|
}
|
|
7706
|
+
if (this.list) {
|
|
7707
|
+
while (this.list.firstChild) {
|
|
7708
|
+
this.list.removeChild(this.list.firstChild);
|
|
7709
|
+
}
|
|
7710
|
+
if (this.list.parentNode) {
|
|
7711
|
+
this.list.parentNode.removeChild(this.list);
|
|
7712
|
+
}
|
|
7713
|
+
detach(this.list);
|
|
7714
|
+
}
|
|
7715
|
+
if (this.ulElement) {
|
|
7716
|
+
while (this.ulElement.firstChild) {
|
|
7717
|
+
this.ulElement.removeChild(this.ulElement.firstChild);
|
|
7718
|
+
}
|
|
7719
|
+
if (this.ulElement.parentNode) {
|
|
7720
|
+
this.ulElement.parentNode.removeChild(this.ulElement);
|
|
7721
|
+
}
|
|
7722
|
+
detach(this.ulElement);
|
|
7723
|
+
}
|
|
7724
|
+
if (this.actionData && this.actionData.ulElement) {
|
|
7725
|
+
while (this.actionData.ulElement.firstChild) {
|
|
7726
|
+
this.actionData.ulElement.removeChild(this.actionData.ulElement.firstChild);
|
|
7727
|
+
}
|
|
7728
|
+
detach(this.actionData.ulElement);
|
|
7729
|
+
this.actionData.ulElement = null;
|
|
7730
|
+
this.actionData.list = null;
|
|
7731
|
+
this.actionData = null;
|
|
7732
|
+
}
|
|
7733
|
+
if (this.actionCompleteData && this.actionCompleteData.ulElement) {
|
|
7734
|
+
while (this.actionCompleteData.ulElement.firstChild) {
|
|
7735
|
+
this.actionCompleteData.ulElement.removeChild(this.actionCompleteData.ulElement.firstChild);
|
|
7736
|
+
}
|
|
7737
|
+
detach(this.actionCompleteData.ulElement);
|
|
7738
|
+
this.actionCompleteData.ulElement = null;
|
|
7739
|
+
this.actionCompleteData.list = null;
|
|
7740
|
+
this.actionCompleteData = null;
|
|
7741
|
+
}
|
|
7742
|
+
this.listData = null;
|
|
7573
7743
|
this.ulElement = null;
|
|
7574
7744
|
this.list = null;
|
|
7575
7745
|
this.clearIconElement = null;
|
|
@@ -7583,20 +7753,19 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7583
7753
|
this.header = null;
|
|
7584
7754
|
this.previousSelectedLI = null;
|
|
7585
7755
|
this.valueTempElement = null;
|
|
7586
|
-
|
|
7587
|
-
detach(this.actionData.ulElement);
|
|
7588
|
-
}
|
|
7589
|
-
this.actionData.ulElement = null;
|
|
7590
|
-
if (this.actionCompleteData.ulElement) {
|
|
7591
|
-
detach(this.actionCompleteData.ulElement);
|
|
7592
|
-
}
|
|
7593
|
-
this.actionCompleteData.ulElement = null;
|
|
7756
|
+
this.resizer = null;
|
|
7594
7757
|
if (this.inputElement && !isNullOrUndefined(this.inputElement.onchange)) {
|
|
7595
7758
|
this.inputElement.onchange = null;
|
|
7596
7759
|
}
|
|
7597
7760
|
if (this.inputElement && !isNullOrUndefined(this.inputElement.onselect)) {
|
|
7598
7761
|
this.inputElement.onselect = null;
|
|
7599
7762
|
}
|
|
7763
|
+
if (this.enableVirtualization) {
|
|
7764
|
+
this.notify('destroy', { module: 'VirtualScroll' });
|
|
7765
|
+
this.virtualGroupDataSource = null;
|
|
7766
|
+
this.viewPortInfo = null;
|
|
7767
|
+
this.selectedValueInfo = null;
|
|
7768
|
+
}
|
|
7600
7769
|
Input.destroy({
|
|
7601
7770
|
element: this.inputElement,
|
|
7602
7771
|
floatLabelType: this.floatLabelType,
|
|
@@ -12115,6 +12284,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
12115
12284
|
break;
|
|
12116
12285
|
case 'allowCustom':
|
|
12117
12286
|
break;
|
|
12287
|
+
case 'placeholder':
|
|
12288
|
+
Input.setPlaceholder(newProp.placeholder, this.inputElement, this.getModuleName());
|
|
12289
|
+
break;
|
|
12118
12290
|
default: {
|
|
12119
12291
|
// eslint-disable-next-line max-len
|
|
12120
12292
|
const comboProps = this.getPropObject(prop, newProp, oldProp);
|
|
@@ -14486,7 +14658,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14486
14658
|
setPlaceholderSize(downIconWidth) {
|
|
14487
14659
|
if (isNullOrUndefined(this.value) || this.value.length === 0) {
|
|
14488
14660
|
if (this.dropIcon.offsetWidth !== 0) {
|
|
14489
|
-
|
|
14661
|
+
let totalIconWidth = downIconWidth + 10;
|
|
14662
|
+
if (this.showClearButton && this.overAllClear) {
|
|
14663
|
+
const display = this.overAllClear.style.display;
|
|
14664
|
+
this.overAllClear.style.display = 'block';
|
|
14665
|
+
const clearWidth = this.overAllClear.offsetWidth;
|
|
14666
|
+
totalIconWidth += clearWidth;
|
|
14667
|
+
this.overAllClear.style.display = display;
|
|
14668
|
+
}
|
|
14669
|
+
this.searchWrapper.style.width = 'calc(100% - ' + totalIconWidth + 'px)';
|
|
14490
14670
|
}
|
|
14491
14671
|
else {
|
|
14492
14672
|
addClass([this.searchWrapper], CUSTOM_WIDTH);
|
|
@@ -15334,7 +15514,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15334
15514
|
}
|
|
15335
15515
|
}
|
|
15336
15516
|
else {
|
|
15337
|
-
this.
|
|
15517
|
+
const listUl = this.list && this.list.querySelector('ul');
|
|
15518
|
+
const isFullList = this.isReact && this.itemTemplate && listUl != null &&
|
|
15519
|
+
listUl.querySelectorAll('.e-list-item').length === this.mainData.length;
|
|
15520
|
+
this.onActionComplete(isFullList ? listUl : list, this.mainData);
|
|
15338
15521
|
}
|
|
15339
15522
|
this.focusAtLastListItem(data);
|
|
15340
15523
|
if (this.value && this.value.length) {
|
|
@@ -15565,9 +15748,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15565
15748
|
addClass([element], CHIP_SELECTED);
|
|
15566
15749
|
if (element) {
|
|
15567
15750
|
element.setAttribute('id', this.element.id + '_chip_item');
|
|
15568
|
-
if (!isNullOrUndefined(this.inputElement) && element.id
|
|
15751
|
+
if (!isNullOrUndefined(this.inputElement) && element.id) {
|
|
15569
15752
|
this.inputElement.setAttribute('aria-activedescendant', element.id);
|
|
15570
15753
|
}
|
|
15754
|
+
const chipClose = element.querySelector('span.' + CHIP_CLOSE$1.split(' ')[0]);
|
|
15755
|
+
if (chipClose) {
|
|
15756
|
+
chipClose.removeAttribute('aria-hidden');
|
|
15757
|
+
}
|
|
15571
15758
|
}
|
|
15572
15759
|
this.trigger('chipSelection', e);
|
|
15573
15760
|
}
|
|
@@ -15861,10 +16048,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15861
16048
|
if (!isNullOrUndefined(this.chipCollectionWrapper)) {
|
|
15862
16049
|
(this.chipCollectionWrapper.style.display = '');
|
|
15863
16050
|
}
|
|
15864
|
-
if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
|
|
16051
|
+
if (this.mode === 'Delimiter' || (this.mode === 'CheckBox' && !this.isSelectAllClicked)) {
|
|
15865
16052
|
this.showDelimWrapper();
|
|
15866
16053
|
}
|
|
15867
|
-
this.
|
|
16054
|
+
if (!this.isSelectAllClicked) {
|
|
16055
|
+
this.showOverAllClear();
|
|
16056
|
+
}
|
|
15868
16057
|
}
|
|
15869
16058
|
else {
|
|
15870
16059
|
if (!isNullOrUndefined(this.chipCollectionWrapper)) {
|
|
@@ -15902,7 +16091,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15902
16091
|
temp = this.getOverflowVal(this.value.length - 1);
|
|
15903
16092
|
data += temp;
|
|
15904
16093
|
temp = this.viewWrapper.innerHTML;
|
|
15905
|
-
|
|
16094
|
+
if (!this.isSelectAllClicked) {
|
|
16095
|
+
this.updateWrapperText(this.viewWrapper, data);
|
|
16096
|
+
}
|
|
15906
16097
|
}
|
|
15907
16098
|
if (this.enableVirtualization && this.mode === 'CheckBox') {
|
|
15908
16099
|
const currentText = [];
|
|
@@ -15962,6 +16153,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15962
16153
|
dispatchSelect(value, eve, element, isNotTrigger, length, dataValue, text) {
|
|
15963
16154
|
const list = this.listData;
|
|
15964
16155
|
if (this.initStatus && !isNotTrigger && (!this.allowObjectBinding || (this.allowObjectBinding && value))) {
|
|
16156
|
+
let selectAllArgsLocal = null;
|
|
15965
16157
|
value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
|
|
15966
16158
|
const val = dataValue ? dataValue : this.getDataByValue(value);
|
|
15967
16159
|
const eventArgs = {
|
|
@@ -15978,15 +16170,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15978
16170
|
this.selectAllEventEle.push(element);
|
|
15979
16171
|
}
|
|
15980
16172
|
if (length === 1) {
|
|
15981
|
-
|
|
16173
|
+
selectAllArgsLocal = {
|
|
15982
16174
|
event: eve,
|
|
15983
16175
|
items: this.selectAllEventEle,
|
|
15984
16176
|
itemData: this.selectAllEventData,
|
|
15985
16177
|
isInteracted: eve ? true : false,
|
|
15986
16178
|
isChecked: true
|
|
15987
16179
|
};
|
|
15988
|
-
this.trigger('selectedAll', args);
|
|
15989
|
-
this.selectAllEventData = [];
|
|
15990
16180
|
}
|
|
15991
16181
|
if (this.allowCustomValue && this.isServerRendered && this.listData !== list) {
|
|
15992
16182
|
this.listData = list;
|
|
@@ -16023,6 +16213,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16023
16213
|
if (this.hideSelectedItem && this.fixedHeaderElement && this.fields.groupBy && this.mode !== 'CheckBox') {
|
|
16024
16214
|
super.scrollStop();
|
|
16025
16215
|
}
|
|
16216
|
+
if (selectAllArgsLocal) {
|
|
16217
|
+
this.trigger('selectedAll', selectAllArgsLocal);
|
|
16218
|
+
this.selectAllEventData = [];
|
|
16219
|
+
}
|
|
16026
16220
|
}
|
|
16027
16221
|
});
|
|
16028
16222
|
}
|
|
@@ -16035,12 +16229,18 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16035
16229
|
removeChipFocus() {
|
|
16036
16230
|
const elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1 + '.' + CHIP_SELECTED);
|
|
16037
16231
|
removeClass(elements, CHIP_SELECTED);
|
|
16232
|
+
const closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
|
|
16038
16233
|
if (Browser.isDevice) {
|
|
16039
|
-
const closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
|
|
16040
16234
|
for (let index = 0; index < closeElements.length; index++) {
|
|
16235
|
+
closeElements[index].setAttribute('aria-hidden', 'true');
|
|
16041
16236
|
closeElements[index].style.display = 'none';
|
|
16042
16237
|
}
|
|
16043
16238
|
}
|
|
16239
|
+
else {
|
|
16240
|
+
for (let index = 0; index < closeElements.length; index++) {
|
|
16241
|
+
closeElements[index].setAttribute('aria-hidden', 'true');
|
|
16242
|
+
}
|
|
16243
|
+
}
|
|
16044
16244
|
}
|
|
16045
16245
|
onMobileChipInteraction(e) {
|
|
16046
16246
|
const chipElem = closest(e.target, '.' + CHIP$1);
|
|
@@ -16080,7 +16280,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16080
16280
|
});
|
|
16081
16281
|
let compiledString;
|
|
16082
16282
|
const chipContent = this.createElement('span', { className: CHIP_CONTENT$1 });
|
|
16083
|
-
const chipClose = this.createElement('span', { className: CHIP_CLOSE$1 });
|
|
16283
|
+
const chipClose = this.createElement('span', { className: CHIP_CLOSE$1, attrs: { 'aria-label': 'delete', 'aria-hidden': 'true', 'tabindex': '-1' } });
|
|
16084
16284
|
if (this.mainData) {
|
|
16085
16285
|
itemData = this.getDataByValue(value);
|
|
16086
16286
|
}
|
|
@@ -17345,6 +17545,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17345
17545
|
this.updateData(delimChar, e, isInitialVirtualData);
|
|
17346
17546
|
}
|
|
17347
17547
|
onMouseClick(e) {
|
|
17548
|
+
this.isSelectAllClicked = false;
|
|
17348
17549
|
if (!this.isClearAllItem) {
|
|
17349
17550
|
this.keyCode = null;
|
|
17350
17551
|
this.scrollFocusStatus = false;
|
|
@@ -17423,6 +17624,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17423
17624
|
}
|
|
17424
17625
|
else {
|
|
17425
17626
|
e.preventDefault();
|
|
17627
|
+
if (this.mode !== 'CheckBox' && this.hideSelectedItem && this.value.length === this.listData.length && this.isPopupOpen()) {
|
|
17628
|
+
this.hidePopup(e);
|
|
17629
|
+
}
|
|
17426
17630
|
}
|
|
17427
17631
|
const isFilterData = this.targetElement().trim() !== '' ? true : false;
|
|
17428
17632
|
this.makeTextBoxEmpty();
|
|
@@ -17758,6 +17962,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17758
17962
|
const remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
|
|
17759
17963
|
raminElement.innerText = remainCompildTemp;
|
|
17760
17964
|
this.viewWrapper.appendChild(raminElement);
|
|
17965
|
+
if (this.isSelectAllClicked) {
|
|
17966
|
+
this.showOverAllClear();
|
|
17967
|
+
}
|
|
17761
17968
|
this.renderReactTemplates();
|
|
17762
17969
|
const remainSize = raminElement.offsetWidth;
|
|
17763
17970
|
remove(raminElement);
|
|
@@ -18078,9 +18285,22 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18078
18285
|
index++;
|
|
18079
18286
|
}
|
|
18080
18287
|
if (length > 50) {
|
|
18288
|
+
createSpinner({ target: this.filterParent, width: Browser.isDevice ? '16px' : '14px' }, this.createElement);
|
|
18289
|
+
showSpinner(this.filterParent);
|
|
18290
|
+
if (this.popupObj && this.filterParent) {
|
|
18291
|
+
[this.popupObj.element.querySelector('.e-content'), this.popupObj.element.querySelector('.e-selectall-parent'), this.filterParent].forEach((el) => el && (el.style.opacity = '0.5'));
|
|
18292
|
+
this.filterParent.querySelector('.e-input').setAttribute('readonly', 'true');
|
|
18293
|
+
this.filterParent.style.cursor = 'progress';
|
|
18294
|
+
}
|
|
18081
18295
|
setTimeout(() => {
|
|
18082
|
-
|
|
18083
|
-
|
|
18296
|
+
const dataArray = this.virtualSelectAllData;
|
|
18297
|
+
const batchSize = 500;
|
|
18298
|
+
let currentIndex = 0;
|
|
18299
|
+
const processBatch = () => {
|
|
18300
|
+
const endIndex = Math.min(currentIndex + batchSize, dataArray.length);
|
|
18301
|
+
const batch = dataArray.slice(currentIndex, endIndex);
|
|
18302
|
+
// Use map on the batch
|
|
18303
|
+
batch.map((obj) => {
|
|
18084
18304
|
if (this.value && obj[this.fields.value] != null && Array.isArray(this.value) &&
|
|
18085
18305
|
((!this.allowObjectBinding && this.value.indexOf(obj[this.fields.value]) < 0) ||
|
|
18086
18306
|
(this.allowObjectBinding && !this.isObjectInArray(obj[this.fields.value], this.value)))) {
|
|
@@ -18089,21 +18309,34 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18089
18309
|
this.dispatchSelect(value, event, null, false, length, obj, text);
|
|
18090
18310
|
}
|
|
18091
18311
|
});
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
|
|
18095
|
-
if (!this.changeOnBlur) {
|
|
18096
|
-
this.updateValueState(event, this.value, this.tempValues);
|
|
18097
|
-
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
18098
|
-
}
|
|
18099
|
-
this.updateHiddenElement(true);
|
|
18100
|
-
if (this.popupWrapper && li[index - 1] && li[index - 1].classList.contains('e-item-focus')) {
|
|
18101
|
-
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
18102
|
-
if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
18103
|
-
li[index - 1].classList.remove('e-item-focus');
|
|
18312
|
+
currentIndex = endIndex;
|
|
18313
|
+
if (currentIndex < dataArray.length) {
|
|
18314
|
+
requestAnimationFrame(processBatch);
|
|
18104
18315
|
}
|
|
18105
|
-
|
|
18106
|
-
|
|
18316
|
+
else {
|
|
18317
|
+
this.updatedataValueItems(event);
|
|
18318
|
+
this.isSelectAllLoop = false;
|
|
18319
|
+
if (!this.changeOnBlur) {
|
|
18320
|
+
this.updateValueState(event, this.value, this.tempValues);
|
|
18321
|
+
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
18322
|
+
}
|
|
18323
|
+
this.updateHiddenElement(true);
|
|
18324
|
+
if (this.popupWrapper && li[index - 1] && li[index - 1].classList.contains('e-item-focus')) {
|
|
18325
|
+
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
18326
|
+
if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
18327
|
+
li[index - 1].classList.remove('e-item-focus');
|
|
18328
|
+
}
|
|
18329
|
+
}
|
|
18330
|
+
this.checkSelectAll();
|
|
18331
|
+
hideSpinner(this.filterParent);
|
|
18332
|
+
if (this.popupObj && this.filterParent) {
|
|
18333
|
+
[this.popupObj.element.querySelector('.e-content'), this.popupObj.element.querySelector('.e-selectall-parent'), this.filterParent].forEach((el) => el && (el.style.opacity = ''));
|
|
18334
|
+
this.filterParent.style.cursor = '';
|
|
18335
|
+
this.filterParent.querySelector('.e-input').removeAttribute('readonly');
|
|
18336
|
+
}
|
|
18337
|
+
}
|
|
18338
|
+
};
|
|
18339
|
+
processBatch();
|
|
18107
18340
|
}, 0);
|
|
18108
18341
|
}
|
|
18109
18342
|
else if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
|
|
@@ -18117,25 +18350,60 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18117
18350
|
}
|
|
18118
18351
|
else {
|
|
18119
18352
|
if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
|
|
18120
|
-
this.virtualSelectAllData
|
|
18121
|
-
|
|
18122
|
-
|
|
18123
|
-
|
|
18124
|
-
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
|
|
18353
|
+
const dataArray = this.virtualSelectAllData;
|
|
18354
|
+
const batchSize = 500;
|
|
18355
|
+
let currentIndex = 0;
|
|
18356
|
+
this.isProcessingVirtualSelectAll = true;
|
|
18357
|
+
createSpinner({ target: this.filterParent, width: Browser.isDevice ? '16px' : '14px' }, this.createElement);
|
|
18358
|
+
showSpinner(this.filterParent);
|
|
18359
|
+
if (this.popupObj && this.filterParent) {
|
|
18360
|
+
[this.popupObj.element.querySelector('.e-content'), this.popupObj.element.querySelector('.e-selectall-parent'), this.filterParent].forEach((el) => el && (el.style.opacity = '0.5'));
|
|
18361
|
+
this.filterParent.querySelector('.e-input').setAttribute('readonly', 'true');
|
|
18362
|
+
this.filterParent.style.cursor = 'progress';
|
|
18363
|
+
}
|
|
18364
|
+
const processBatch = () => {
|
|
18365
|
+
const endIndex = Math.min(currentIndex + batchSize, dataArray.length);
|
|
18366
|
+
const batch = dataArray.slice(currentIndex, endIndex);
|
|
18367
|
+
// Use map on the batch
|
|
18368
|
+
batch.map((obj) => {
|
|
18369
|
+
this.virtualSelectAll = true;
|
|
18370
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
18371
|
+
this.removeValue(this.value[index], event, this.value.length - index);
|
|
18372
|
+
});
|
|
18373
|
+
currentIndex = endIndex;
|
|
18374
|
+
if (currentIndex < dataArray.length) {
|
|
18375
|
+
requestAnimationFrame(processBatch);
|
|
18376
|
+
}
|
|
18377
|
+
else {
|
|
18378
|
+
// All batches completed
|
|
18379
|
+
this.isProcessingVirtualSelectAll = false;
|
|
18380
|
+
hideSpinner(this.filterParent);
|
|
18381
|
+
if (this.popupObj && this.filterParent) {
|
|
18382
|
+
[this.popupObj.element.querySelector('.e-content'), this.popupObj.element.querySelector('.e-selectall-parent'), this.filterParent].forEach((el) => el && (el.style.opacity = ''));
|
|
18383
|
+
this.filterParent.querySelector('.e-input').removeAttribute('readonly');
|
|
18384
|
+
this.filterParent.style.cursor = '';
|
|
18385
|
+
}
|
|
18386
|
+
if (!this.isSelectAllClicked) {
|
|
18387
|
+
this.showOverAllClear();
|
|
18388
|
+
}
|
|
18389
|
+
this.updatedataValueItems(event);
|
|
18390
|
+
if (!this.changeOnBlur) {
|
|
18391
|
+
this.updateValueState(event, this.value, this.tempValues);
|
|
18392
|
+
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
18393
|
+
}
|
|
18394
|
+
this.updateHiddenElement();
|
|
18395
|
+
this.setProperties({ value: [] }, true);
|
|
18396
|
+
this.selectedListData = [];
|
|
18397
|
+
this.virtualSelectAll = false;
|
|
18398
|
+
if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
|
|
18399
|
+
this.notify('setCurrentViewDataAsync', {
|
|
18400
|
+
component: this.getModuleName(),
|
|
18401
|
+
module: 'VirtualScroll'
|
|
18402
|
+
});
|
|
18403
|
+
}
|
|
18404
|
+
}
|
|
18405
|
+
};
|
|
18406
|
+
processBatch();
|
|
18139
18407
|
}
|
|
18140
18408
|
}
|
|
18141
18409
|
this.checkSelectAll();
|
|
@@ -18193,28 +18461,59 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18193
18461
|
index++;
|
|
18194
18462
|
}
|
|
18195
18463
|
if (length > 50) {
|
|
18196
|
-
|
|
18197
|
-
|
|
18198
|
-
|
|
18199
|
-
|
|
18200
|
-
|
|
18201
|
-
|
|
18464
|
+
createSpinner({ target: this.filterParent, width: Browser.isDevice ? '16px' : '14px' }, this.createElement);
|
|
18465
|
+
showSpinner(this.filterParent);
|
|
18466
|
+
if (this.popupObj && this.filterParent) {
|
|
18467
|
+
[this.popupObj.element.querySelector('.e-content'), this.popupObj.element.querySelector('.e-selectall-parent'), this.filterParent].forEach((el) => el && (el.style.opacity = '0.5'));
|
|
18468
|
+
this.filterParent.querySelector('.e-input').setAttribute('readonly', 'true');
|
|
18469
|
+
this.filterParent.style.cursor = 'progress';
|
|
18470
|
+
}
|
|
18471
|
+
this.isProcessingVirtualSelectAll = !this.isSelectAllClicked;
|
|
18472
|
+
let indexLocal = index; // preserve original index value
|
|
18473
|
+
const maxIndex = Math.min(length, count);
|
|
18474
|
+
// Use two-frame yield to ensure spinner paints before heavy work starts
|
|
18475
|
+
const CHUNK_SIZE = 6;
|
|
18476
|
+
requestAnimationFrame(() => {
|
|
18477
|
+
requestAnimationFrame(function processFrame() {
|
|
18478
|
+
if (!this.list) {
|
|
18479
|
+
return;
|
|
18202
18480
|
}
|
|
18203
|
-
|
|
18204
|
-
|
|
18205
|
-
|
|
18206
|
-
|
|
18207
|
-
|
|
18208
|
-
|
|
18209
|
-
|
|
18210
|
-
|
|
18211
|
-
|
|
18212
|
-
|
|
18213
|
-
|
|
18214
|
-
|
|
18481
|
+
if (indexLocal >= maxIndex) {
|
|
18482
|
+
this.isProcessingVirtualSelectAll = !this.isProcessingVirtualSelectAll;
|
|
18483
|
+
this.updatedataValueItems(event);
|
|
18484
|
+
if (!this.changeOnBlur) {
|
|
18485
|
+
this.updateValueState(event, this.value, this.tempValues);
|
|
18486
|
+
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
18487
|
+
}
|
|
18488
|
+
this.updateHiddenElement();
|
|
18489
|
+
if (this.popupWrapper && li[indexLocal - 1] && li[indexLocal - 1].classList.contains('e-item-focus')) {
|
|
18490
|
+
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
18491
|
+
if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
18492
|
+
li[indexLocal - 1].classList.remove('e-item-focus');
|
|
18493
|
+
}
|
|
18494
|
+
}
|
|
18495
|
+
hideSpinner(this.filterParent);
|
|
18496
|
+
if (this.popupObj && this.filterParent) {
|
|
18497
|
+
[this.popupObj.element.querySelector('.e-content'), this.popupObj.element.querySelector('.e-selectall-parent'), this.filterParent].forEach((el) => el && (el.style.opacity = ''));
|
|
18498
|
+
this.filterParent.querySelector('.e-input').removeAttribute('readonly');
|
|
18499
|
+
this.filterParent.style.cursor = '';
|
|
18500
|
+
}
|
|
18501
|
+
return;
|
|
18215
18502
|
}
|
|
18216
|
-
|
|
18217
|
-
|
|
18503
|
+
// process up to CHUNK_SIZE items this frame
|
|
18504
|
+
let processed = 0;
|
|
18505
|
+
while (processed < CHUNK_SIZE && indexLocal < maxIndex) {
|
|
18506
|
+
this.isSelectAllTarget = (length === indexLocal + 1);
|
|
18507
|
+
this.updateListSelection(li[indexLocal], event, length - indexLocal);
|
|
18508
|
+
if (this.enableGroupCheckBox) {
|
|
18509
|
+
this.findGroupStart(li[indexLocal]);
|
|
18510
|
+
}
|
|
18511
|
+
indexLocal++;
|
|
18512
|
+
processed++;
|
|
18513
|
+
}
|
|
18514
|
+
requestAnimationFrame(processFrame.bind(this));
|
|
18515
|
+
}.bind(this));
|
|
18516
|
+
});
|
|
18218
18517
|
}
|
|
18219
18518
|
}
|
|
18220
18519
|
}
|
|
@@ -18263,7 +18562,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18263
18562
|
this.trigger('selectedAll', args);
|
|
18264
18563
|
}
|
|
18265
18564
|
}
|
|
18266
|
-
this.
|
|
18565
|
+
if (!this.isProcessingVirtualSelectAll &&
|
|
18566
|
+
((!this.isSelectAllClicked) || (this.isSelectAllClicked && (this.enableVirtualization ? length > 30 : length <= 50)))) {
|
|
18567
|
+
this.updatedataValueItems(event);
|
|
18568
|
+
}
|
|
18267
18569
|
this.checkPlaceholderSize();
|
|
18268
18570
|
if (length <= 50 && !beforeSelectArgs.preventSelectEvent) {
|
|
18269
18571
|
if (!this.changeOnBlur) {
|
|
@@ -18354,6 +18656,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18354
18656
|
this.renderPopup();
|
|
18355
18657
|
}
|
|
18356
18658
|
selectAllItems(state, event) {
|
|
18659
|
+
this.isSelectAllClicked = state;
|
|
18357
18660
|
if (isNullOrUndefined(this.list)) {
|
|
18358
18661
|
this.selectAllAction = () => {
|
|
18359
18662
|
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
@@ -19057,7 +19360,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
19057
19360
|
}
|
|
19058
19361
|
else {
|
|
19059
19362
|
this.chipCollectionWrapper = this.createElement('span', {
|
|
19060
|
-
className: CHIP_WRAPPER$1
|
|
19363
|
+
className: CHIP_WRAPPER$1, attrs: { role: 'listbox' }
|
|
19061
19364
|
});
|
|
19062
19365
|
this.chipCollectionWrapper.style.display = 'none';
|
|
19063
19366
|
if (this.mode === 'Default') {
|
|
@@ -19628,6 +19931,50 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
19628
19931
|
if (this.delimiterWrapper && this.delimiterWrapper.parentElement) {
|
|
19629
19932
|
this.delimiterWrapper.parentElement.remove();
|
|
19630
19933
|
}
|
|
19934
|
+
if (this.hiddenElement) {
|
|
19935
|
+
if (this.hiddenElement.onchange) {
|
|
19936
|
+
this.hiddenElement.onchange = null;
|
|
19937
|
+
}
|
|
19938
|
+
this.hiddenElement.onchange = null;
|
|
19939
|
+
this.hiddenElement.onclick = null;
|
|
19940
|
+
this.hiddenElement.oninput = null;
|
|
19941
|
+
const attrs = Array.prototype.slice.call(this.hiddenElement.attributes);
|
|
19942
|
+
for (let n = 0; n < attrs.length; n++) {
|
|
19943
|
+
this.hiddenElement.removeAttribute(attrs[n].name);
|
|
19944
|
+
}
|
|
19945
|
+
const children = this.hiddenElement.children;
|
|
19946
|
+
for (let i = 0; i < children.length; i++) {
|
|
19947
|
+
const child = children[i];
|
|
19948
|
+
child.onclick = null;
|
|
19949
|
+
child.onchange = null;
|
|
19950
|
+
child.textContent = '';
|
|
19951
|
+
const attr = Array.prototype.slice.call(child.attributes);
|
|
19952
|
+
for (let n = 0; n < attr.length; n++) {
|
|
19953
|
+
child.removeAttribute(attr[n].name);
|
|
19954
|
+
}
|
|
19955
|
+
}
|
|
19956
|
+
let selectedElement = this.hiddenElement.querySelector('option');
|
|
19957
|
+
if (selectedElement) {
|
|
19958
|
+
selectedElement.removeAttribute('value');
|
|
19959
|
+
selectedElement.removeAttribute('selected');
|
|
19960
|
+
selectedElement.text = '';
|
|
19961
|
+
selectedElement.innerHTML = '';
|
|
19962
|
+
selectedElement = null;
|
|
19963
|
+
}
|
|
19964
|
+
while (this.hiddenElement.firstChild) {
|
|
19965
|
+
this.hiddenElement.removeChild(this.hiddenElement.firstChild);
|
|
19966
|
+
}
|
|
19967
|
+
if (this.hiddenElement.attributes) {
|
|
19968
|
+
const attr = Array.prototype.slice.call(this.hiddenElement.attributes);
|
|
19969
|
+
for (let n = 0; n < attr.length; n++) {
|
|
19970
|
+
this.hiddenElement.removeAttribute(attr[n].name);
|
|
19971
|
+
}
|
|
19972
|
+
}
|
|
19973
|
+
if (this.hiddenElement.parentNode) {
|
|
19974
|
+
this.hiddenElement.parentNode.removeChild(this.hiddenElement);
|
|
19975
|
+
}
|
|
19976
|
+
this.hiddenElement.innerHTML = '';
|
|
19977
|
+
}
|
|
19631
19978
|
// Remove the select element if it exists
|
|
19632
19979
|
const selectElement = this.overAllWrapper.querySelector('select.e-multi-hidden');
|
|
19633
19980
|
if (selectElement && selectElement.parentElement) {
|
|
@@ -19647,7 +19994,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
19647
19994
|
const attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
|
|
19648
19995
|
'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
|
|
19649
19996
|
'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-label', 'aria-hidden', 'tabindex', 'aria-controls',
|
|
19650
|
-
'aria-describedby', 'size', 'role', 'type', 'class'];
|
|
19997
|
+
'aria-describedby', 'size', 'role', 'type', 'class', 'aria-activedescendant'];
|
|
19651
19998
|
for (let i = 0; i < attrArray.length; i++) {
|
|
19652
19999
|
this.inputElement.removeAttribute(attrArray[i]);
|
|
19653
20000
|
}
|
|
@@ -23434,8 +23781,10 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23434
23781
|
return;
|
|
23435
23782
|
}
|
|
23436
23783
|
this.isTyped = e.code !== 'Enter' && e.code !== 'Space' && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' ? true : false;
|
|
23437
|
-
const
|
|
23438
|
-
|
|
23784
|
+
const activeParent = document.activeElement && document.activeElement.parentElement;
|
|
23785
|
+
const isRteImage = activeParent && !!activeParent.querySelector('.e-rte-image');
|
|
23786
|
+
const isBECodeDropdownFocused = activeParent && !!activeParent.querySelector('.e-blockeditor .e-code-block-container .e-input-group.e-input-focus');
|
|
23787
|
+
if (document.activeElement !== this.inputElement && !isRteImage && !isBECodeDropdownFocused) {
|
|
23439
23788
|
this.inputElement.focus();
|
|
23440
23789
|
}
|
|
23441
23790
|
if (this.isContentEditable(this.inputElement)) {
|
|
@@ -23460,7 +23809,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23460
23809
|
if (!this.requireLeadingSpace && lastWordRange && lastWordRange.includes(this.mentionChar)) {
|
|
23461
23810
|
lastWordRange = this.mentionChar + lastWordRange.split(this.mentionChar).pop();
|
|
23462
23811
|
}
|
|
23463
|
-
if (lastWordRange
|
|
23812
|
+
if (/\s|\u00A0/.test(lastWordRange)) {
|
|
23464
23813
|
return;
|
|
23465
23814
|
}
|
|
23466
23815
|
}
|
|
@@ -23989,7 +24338,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23989
24338
|
}
|
|
23990
24339
|
setHeight(popupEle) {
|
|
23991
24340
|
if (this.popupHeight !== 'auto' && this.list) {
|
|
23992
|
-
|
|
24341
|
+
const parentStyle = getComputedStyle(this.list.parentElement);
|
|
24342
|
+
const paddingY = parseInt(parentStyle.paddingTop || '0', 10) + parseInt(parentStyle.paddingBottom || '0', 10);
|
|
24343
|
+
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2 - paddingY).toString() + 'px'; // due to box-sizing property
|
|
23993
24344
|
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
23994
24345
|
}
|
|
23995
24346
|
else {
|