@syncfusion/ej2-dropdowns 32.2.9 → 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 +407 -116
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +382 -91
- 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.js +84 -14
- 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 +228 -72
- 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;
|
|
@@ -5650,15 +5722,16 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5650
5722
|
const value = this.getItemData().value;
|
|
5651
5723
|
this.activeIndex = ((this.enableVirtualization && !isNullOrUndefined(value)) || !this.enableVirtualization) ?
|
|
5652
5724
|
this.getIndexByValue(value) : this.activeIndex;
|
|
5653
|
-
|
|
5725
|
+
let element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
5654
5726
|
this.selectedLI = element;
|
|
5655
5727
|
this.activeItem(element);
|
|
5656
5728
|
if (!(this.enableVirtualization && isNullOrUndefined(element))) {
|
|
5657
5729
|
this.removeFocus();
|
|
5658
5730
|
}
|
|
5731
|
+
element = null;
|
|
5659
5732
|
}
|
|
5660
5733
|
updateSelection() {
|
|
5661
|
-
|
|
5734
|
+
let selectedItem = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
5662
5735
|
if (selectedItem) {
|
|
5663
5736
|
this.setProperties({ 'index': this.getIndexByValue(selectedItem.getAttribute('data-value')) });
|
|
5664
5737
|
this.activeIndex = this.index;
|
|
@@ -5674,6 +5747,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5674
5747
|
}
|
|
5675
5748
|
this.list.querySelector('.' + dropDownBaseClasses.li).classList.add(dropDownListClasses.focus);
|
|
5676
5749
|
}
|
|
5750
|
+
selectedItem = null;
|
|
5677
5751
|
}
|
|
5678
5752
|
updateSelectionList() {
|
|
5679
5753
|
const selectedItem = this.list && this.list.querySelector('.' + 'e-active');
|
|
@@ -5810,12 +5884,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5810
5884
|
if (Browser.isDevice && this.isDeviceFullScreen && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
|
|
5811
5885
|
(this.isDropDownClick && this.getModuleName() === 'combobox')))) {
|
|
5812
5886
|
offsetValue = this.getOffsetValue(popupEle);
|
|
5813
|
-
|
|
5887
|
+
let firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
5814
5888
|
if (!isNullOrUndefined(this.inputElement)) {
|
|
5815
5889
|
left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
|
|
5816
5890
|
parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
|
|
5817
5891
|
parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
|
|
5818
5892
|
}
|
|
5893
|
+
firstItem = null;
|
|
5819
5894
|
}
|
|
5820
5895
|
this.createPopup(popupEle, offsetValue, left);
|
|
5821
5896
|
this.popupContentElement = this.popupObj.element.querySelector('.e-content');
|
|
@@ -6044,9 +6119,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6044
6119
|
open: () => {
|
|
6045
6120
|
EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
|
|
6046
6121
|
this.isPopupOpen = true;
|
|
6047
|
-
|
|
6122
|
+
let actionList = this.actionCompleteData && this.actionCompleteData.ulElement &&
|
|
6048
6123
|
this.actionCompleteData.ulElement.querySelector('li');
|
|
6049
|
-
|
|
6124
|
+
let ulElement = this.list.querySelector('ul li');
|
|
6050
6125
|
if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
6051
6126
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
6052
6127
|
}
|
|
@@ -6067,6 +6142,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6067
6142
|
}
|
|
6068
6143
|
}
|
|
6069
6144
|
this.activeStateChange();
|
|
6145
|
+
actionList = null;
|
|
6146
|
+
ulElement = null;
|
|
6070
6147
|
},
|
|
6071
6148
|
targetExitViewport: () => {
|
|
6072
6149
|
if (!Browser.isDevice) {
|
|
@@ -6103,16 +6180,17 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6103
6180
|
this.popupObj.element.style.width = '100%';
|
|
6104
6181
|
this.list.style.maxHeight = (window.innerHeight - searchBoxHeight) + 'px';
|
|
6105
6182
|
this.list.style.height = (window.innerHeight - searchBoxHeight) + 'px';
|
|
6106
|
-
|
|
6183
|
+
let clearElement = this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon);
|
|
6107
6184
|
detach(this.filterInput);
|
|
6108
6185
|
clearElement.parentElement.insertBefore(this.filterInput, clearElement);
|
|
6186
|
+
clearElement = null;
|
|
6109
6187
|
}
|
|
6110
6188
|
setPopupPosition(border) {
|
|
6111
6189
|
let offsetValue;
|
|
6112
6190
|
const popupOffset = border;
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
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];
|
|
6116
6194
|
const liHeight = firstItem.getBoundingClientRect().height;
|
|
6117
6195
|
this.listItemHeight = liHeight + parseInt(window.getComputedStyle(firstItem).marginBottom, 10);
|
|
6118
6196
|
const listHeight = this.list.offsetHeight / 2;
|
|
@@ -6134,6 +6212,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6134
6212
|
}
|
|
6135
6213
|
const inputHeight = this.inputWrapper.container.offsetHeight;
|
|
6136
6214
|
offsetValue = offsetValue + liHeight + popupOffset - ((liHeight - inputHeight) / 2);
|
|
6215
|
+
selectedLI = null;
|
|
6216
|
+
firstItem = null;
|
|
6217
|
+
lastItem = null;
|
|
6137
6218
|
return -offsetValue;
|
|
6138
6219
|
}
|
|
6139
6220
|
setWidth() {
|
|
@@ -6144,10 +6225,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6144
6225
|
}
|
|
6145
6226
|
if (Browser.isDevice && (width.indexOf('px') > -1) && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
|
|
6146
6227
|
(this.isDropDownClick && this.getModuleName() === 'combobox')))) {
|
|
6147
|
-
|
|
6228
|
+
let firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
6148
6229
|
width = (parseInt(width, 10) + (parseInt(getComputedStyle(firstItem).textIndent, 10) -
|
|
6149
6230
|
parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
|
|
6150
6231
|
parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10)) * 2) + 'px';
|
|
6232
|
+
firstItem = null;
|
|
6151
6233
|
}
|
|
6152
6234
|
return width;
|
|
6153
6235
|
}
|
|
@@ -6396,7 +6478,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6396
6478
|
EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
|
|
6397
6479
|
EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
|
|
6398
6480
|
}
|
|
6399
|
-
if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
|
|
6481
|
+
if (this.allowFiltering && !isNullOrUndefined(this.filterInput) && this.getModuleName() === 'dropdownlist') {
|
|
6400
6482
|
this.filterInput.removeAttribute('aria-activedescendant');
|
|
6401
6483
|
this.filterInput.removeAttribute('aria-disabled');
|
|
6402
6484
|
this.filterInput.removeAttribute('role');
|
|
@@ -6404,7 +6486,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6404
6486
|
this.filterInput.removeAttribute('autocapitalize');
|
|
6405
6487
|
this.filterInput.removeAttribute('spellcheck');
|
|
6406
6488
|
}
|
|
6407
|
-
if (this.filterInput.parentNode) {
|
|
6489
|
+
if (!isNullOrUndefined(this.filterInput) && this.filterInput.parentNode) {
|
|
6408
6490
|
this.filterInput.parentNode.removeChild(this.filterInput);
|
|
6409
6491
|
const attrs = Array.prototype.slice.call(this.filterInput.attributes);
|
|
6410
6492
|
for (let n = 0; n < attrs.length; n++) {
|
|
@@ -6503,7 +6585,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6503
6585
|
if (isNullOrUndefined(currentData)) {
|
|
6504
6586
|
return;
|
|
6505
6587
|
}
|
|
6506
|
-
|
|
6588
|
+
let ulElement = this.renderItems(currentData, this.fields);
|
|
6507
6589
|
this.list.scrollTop = 0;
|
|
6508
6590
|
this.virtualListInfo = {
|
|
6509
6591
|
currentPageNumber: null,
|
|
@@ -6555,6 +6637,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6555
6637
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6556
6638
|
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
6557
6639
|
}
|
|
6640
|
+
ulElement = null;
|
|
6558
6641
|
}
|
|
6559
6642
|
destroyPopup() {
|
|
6560
6643
|
this.isPopupOpen = false;
|
|
@@ -6746,10 +6829,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6746
6829
|
this.viewPortInfo.endIndex : this.itemCount;
|
|
6747
6830
|
}
|
|
6748
6831
|
getListHeight() {
|
|
6749
|
-
|
|
6832
|
+
let listParent = this.createElement('div', {
|
|
6750
6833
|
className: 'e-dropdownbase'
|
|
6751
6834
|
});
|
|
6752
|
-
|
|
6835
|
+
let item = this.createElement('li', {
|
|
6753
6836
|
className: 'e-list-item'
|
|
6754
6837
|
});
|
|
6755
6838
|
const listParentHeight = formatUnit(this.popupHeight);
|
|
@@ -6761,6 +6844,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6761
6844
|
const listItemHeight = Math.ceil(item.getBoundingClientRect().height) +
|
|
6762
6845
|
parseInt(window.getComputedStyle(item).marginBottom, 10);
|
|
6763
6846
|
listParent.remove();
|
|
6847
|
+
listParent = null;
|
|
6848
|
+
item = null;
|
|
6764
6849
|
return listItemHeight;
|
|
6765
6850
|
}
|
|
6766
6851
|
setFooterTemplate(popupEle) {
|
|
@@ -6812,8 +6897,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6812
6897
|
if (headerCompTemp && headerCompTemp.length) {
|
|
6813
6898
|
append(headerCompTemp, this.header);
|
|
6814
6899
|
}
|
|
6815
|
-
|
|
6900
|
+
let contentEle = popupEle.querySelector('div.e-content');
|
|
6816
6901
|
popupEle.insertBefore(this.header, contentEle);
|
|
6902
|
+
contentEle = null;
|
|
6817
6903
|
}
|
|
6818
6904
|
/**
|
|
6819
6905
|
* Sets the enabled state to DropDownBase.
|
|
@@ -6878,6 +6964,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6878
6964
|
((props.dataSource instanceof DataManager) || (!isNullOrUndefined(props) && Array.isArray(props.dataSource) &&
|
|
6879
6965
|
!isNullOrUndefined(oldProps) && Array.isArray(oldProps.dataSource) && props.dataSource.length !== oldProps.dataSource.length))) {
|
|
6880
6966
|
this.typedString = '';
|
|
6967
|
+
this.selectData = null;
|
|
6881
6968
|
this.resetList(this.dataSource);
|
|
6882
6969
|
}
|
|
6883
6970
|
if (!this.isCustomFilter && !this.isFilterFocus && document.activeElement !== this.filterInput) {
|
|
@@ -7029,9 +7116,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7029
7116
|
return;
|
|
7030
7117
|
}
|
|
7031
7118
|
if (this.enableVirtualization) {
|
|
7119
|
+
const isOfflineMode = this.dataSource instanceof DataManager &&
|
|
7120
|
+
this.dataSource.dataSource.offline === true;
|
|
7032
7121
|
if (newProp.value && this.dataSource instanceof DataManager) {
|
|
7033
|
-
const isOfflineMode = this.dataSource instanceof DataManager &&
|
|
7034
|
-
this.dataSource.dataSource.offline === true;
|
|
7035
7122
|
const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
|
|
7036
7123
|
const value = this.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
|
|
7037
7124
|
getValue(checkField, newProp.value) : newProp.value;
|
|
@@ -7104,7 +7191,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7104
7191
|
this.renderList();
|
|
7105
7192
|
}
|
|
7106
7193
|
if (!this.initialRemoteRender && this.liCollections) {
|
|
7107
|
-
|
|
7194
|
+
let element = this.liCollections[newProp.index];
|
|
7108
7195
|
if (!this.checkValidLi(element)) {
|
|
7109
7196
|
if (this.liCollections && this.liCollections.length === 100 &&
|
|
7110
7197
|
this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
|
|
@@ -7115,6 +7202,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7115
7202
|
}
|
|
7116
7203
|
}
|
|
7117
7204
|
this.updateInputFields();
|
|
7205
|
+
element = null;
|
|
7118
7206
|
}
|
|
7119
7207
|
break;
|
|
7120
7208
|
case 'footerTemplate':
|
|
@@ -7198,6 +7286,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7198
7286
|
}
|
|
7199
7287
|
}
|
|
7200
7288
|
};
|
|
7289
|
+
li = null;
|
|
7201
7290
|
}
|
|
7202
7291
|
updatePopupState() {
|
|
7203
7292
|
if (this.beforePopupOpen) {
|
|
@@ -7362,7 +7451,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7362
7451
|
this.isEscapeKey = false;
|
|
7363
7452
|
if (!isNullOrUndefined(this.index)) {
|
|
7364
7453
|
const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
7365
|
-
|
|
7454
|
+
let element = this.findListElement(this.ulElement, 'li', 'data-value', value);
|
|
7366
7455
|
this.selectedLI = this.liCollections[this.index] || element;
|
|
7367
7456
|
if (this.selectedLI) {
|
|
7368
7457
|
this.updateSelectedItem(this.selectedLI, null, true);
|
|
@@ -7370,6 +7459,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7370
7459
|
this.setValueTemplate();
|
|
7371
7460
|
}
|
|
7372
7461
|
}
|
|
7462
|
+
element = null;
|
|
7373
7463
|
}
|
|
7374
7464
|
else {
|
|
7375
7465
|
this.resetSelection();
|
|
@@ -7481,7 +7571,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7481
7571
|
}
|
|
7482
7572
|
const isValidIndex = itemIndex < this.liCollections.length && itemIndex > -1;
|
|
7483
7573
|
if (isValidIndex && !(JSON.parse(JSON.stringify(this.listData[itemIndex]))[this.fields.disabled])) {
|
|
7484
|
-
|
|
7574
|
+
let li = this.liCollections[itemIndex];
|
|
7485
7575
|
if (li) {
|
|
7486
7576
|
this.disableListItem(li);
|
|
7487
7577
|
const parsedData = JSON.parse(JSON.stringify(this.listData[itemIndex]));
|
|
@@ -7495,6 +7585,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7495
7585
|
this.clear();
|
|
7496
7586
|
}
|
|
7497
7587
|
}
|
|
7588
|
+
li = null;
|
|
7498
7589
|
}
|
|
7499
7590
|
}
|
|
7500
7591
|
}
|
|
@@ -7530,7 +7621,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7530
7621
|
if (this.inputElement) {
|
|
7531
7622
|
const attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
|
|
7532
7623
|
'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
|
|
7533
|
-
'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'
|
|
7624
|
+
'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label',
|
|
7625
|
+
'role', 'value', 'style', 'type'];
|
|
7534
7626
|
for (let i = 0; i < attrArray.length; i++) {
|
|
7535
7627
|
this.inputElement.removeAttribute(attrArray[i]);
|
|
7536
7628
|
}
|
|
@@ -7611,6 +7703,43 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7611
7703
|
detach(this.popupObj.element);
|
|
7612
7704
|
this.popupObj.element = null;
|
|
7613
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;
|
|
7614
7743
|
this.ulElement = null;
|
|
7615
7744
|
this.list = null;
|
|
7616
7745
|
this.clearIconElement = null;
|
|
@@ -7624,20 +7753,19 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7624
7753
|
this.header = null;
|
|
7625
7754
|
this.previousSelectedLI = null;
|
|
7626
7755
|
this.valueTempElement = null;
|
|
7627
|
-
|
|
7628
|
-
detach(this.actionData.ulElement);
|
|
7629
|
-
}
|
|
7630
|
-
this.actionData.ulElement = null;
|
|
7631
|
-
if (this.actionCompleteData.ulElement) {
|
|
7632
|
-
detach(this.actionCompleteData.ulElement);
|
|
7633
|
-
}
|
|
7634
|
-
this.actionCompleteData.ulElement = null;
|
|
7756
|
+
this.resizer = null;
|
|
7635
7757
|
if (this.inputElement && !isNullOrUndefined(this.inputElement.onchange)) {
|
|
7636
7758
|
this.inputElement.onchange = null;
|
|
7637
7759
|
}
|
|
7638
7760
|
if (this.inputElement && !isNullOrUndefined(this.inputElement.onselect)) {
|
|
7639
7761
|
this.inputElement.onselect = null;
|
|
7640
7762
|
}
|
|
7763
|
+
if (this.enableVirtualization) {
|
|
7764
|
+
this.notify('destroy', { module: 'VirtualScroll' });
|
|
7765
|
+
this.virtualGroupDataSource = null;
|
|
7766
|
+
this.viewPortInfo = null;
|
|
7767
|
+
this.selectedValueInfo = null;
|
|
7768
|
+
}
|
|
7641
7769
|
Input.destroy({
|
|
7642
7770
|
element: this.inputElement,
|
|
7643
7771
|
floatLabelType: this.floatLabelType,
|
|
@@ -12156,6 +12284,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
12156
12284
|
break;
|
|
12157
12285
|
case 'allowCustom':
|
|
12158
12286
|
break;
|
|
12287
|
+
case 'placeholder':
|
|
12288
|
+
Input.setPlaceholder(newProp.placeholder, this.inputElement, this.getModuleName());
|
|
12289
|
+
break;
|
|
12159
12290
|
default: {
|
|
12160
12291
|
// eslint-disable-next-line max-len
|
|
12161
12292
|
const comboProps = this.getPropObject(prop, newProp, oldProp);
|
|
@@ -14527,7 +14658,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14527
14658
|
setPlaceholderSize(downIconWidth) {
|
|
14528
14659
|
if (isNullOrUndefined(this.value) || this.value.length === 0) {
|
|
14529
14660
|
if (this.dropIcon.offsetWidth !== 0) {
|
|
14530
|
-
|
|
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)';
|
|
14531
14670
|
}
|
|
14532
14671
|
else {
|
|
14533
14672
|
addClass([this.searchWrapper], CUSTOM_WIDTH);
|
|
@@ -15909,10 +16048,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15909
16048
|
if (!isNullOrUndefined(this.chipCollectionWrapper)) {
|
|
15910
16049
|
(this.chipCollectionWrapper.style.display = '');
|
|
15911
16050
|
}
|
|
15912
|
-
if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
|
|
16051
|
+
if (this.mode === 'Delimiter' || (this.mode === 'CheckBox' && !this.isSelectAllClicked)) {
|
|
15913
16052
|
this.showDelimWrapper();
|
|
15914
16053
|
}
|
|
15915
|
-
this.
|
|
16054
|
+
if (!this.isSelectAllClicked) {
|
|
16055
|
+
this.showOverAllClear();
|
|
16056
|
+
}
|
|
15916
16057
|
}
|
|
15917
16058
|
else {
|
|
15918
16059
|
if (!isNullOrUndefined(this.chipCollectionWrapper)) {
|
|
@@ -15950,7 +16091,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15950
16091
|
temp = this.getOverflowVal(this.value.length - 1);
|
|
15951
16092
|
data += temp;
|
|
15952
16093
|
temp = this.viewWrapper.innerHTML;
|
|
15953
|
-
|
|
16094
|
+
if (!this.isSelectAllClicked) {
|
|
16095
|
+
this.updateWrapperText(this.viewWrapper, data);
|
|
16096
|
+
}
|
|
15954
16097
|
}
|
|
15955
16098
|
if (this.enableVirtualization && this.mode === 'CheckBox') {
|
|
15956
16099
|
const currentText = [];
|
|
@@ -17402,6 +17545,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17402
17545
|
this.updateData(delimChar, e, isInitialVirtualData);
|
|
17403
17546
|
}
|
|
17404
17547
|
onMouseClick(e) {
|
|
17548
|
+
this.isSelectAllClicked = false;
|
|
17405
17549
|
if (!this.isClearAllItem) {
|
|
17406
17550
|
this.keyCode = null;
|
|
17407
17551
|
this.scrollFocusStatus = false;
|
|
@@ -17480,7 +17624,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17480
17624
|
}
|
|
17481
17625
|
else {
|
|
17482
17626
|
e.preventDefault();
|
|
17483
|
-
if (this.value.length === this.listData.length && this.isPopupOpen()) {
|
|
17627
|
+
if (this.mode !== 'CheckBox' && this.hideSelectedItem && this.value.length === this.listData.length && this.isPopupOpen()) {
|
|
17484
17628
|
this.hidePopup(e);
|
|
17485
17629
|
}
|
|
17486
17630
|
}
|
|
@@ -17818,6 +17962,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17818
17962
|
const remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
|
|
17819
17963
|
raminElement.innerText = remainCompildTemp;
|
|
17820
17964
|
this.viewWrapper.appendChild(raminElement);
|
|
17965
|
+
if (this.isSelectAllClicked) {
|
|
17966
|
+
this.showOverAllClear();
|
|
17967
|
+
}
|
|
17821
17968
|
this.renderReactTemplates();
|
|
17822
17969
|
const remainSize = raminElement.offsetWidth;
|
|
17823
17970
|
remove(raminElement);
|
|
@@ -18138,9 +18285,22 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18138
18285
|
index++;
|
|
18139
18286
|
}
|
|
18140
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
|
+
}
|
|
18141
18295
|
setTimeout(() => {
|
|
18142
|
-
|
|
18143
|
-
|
|
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) => {
|
|
18144
18304
|
if (this.value && obj[this.fields.value] != null && Array.isArray(this.value) &&
|
|
18145
18305
|
((!this.allowObjectBinding && this.value.indexOf(obj[this.fields.value]) < 0) ||
|
|
18146
18306
|
(this.allowObjectBinding && !this.isObjectInArray(obj[this.fields.value], this.value)))) {
|
|
@@ -18149,21 +18309,34 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18149
18309
|
this.dispatchSelect(value, event, null, false, length, obj, text);
|
|
18150
18310
|
}
|
|
18151
18311
|
});
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
if (!this.changeOnBlur) {
|
|
18156
|
-
this.updateValueState(event, this.value, this.tempValues);
|
|
18157
|
-
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
18158
|
-
}
|
|
18159
|
-
this.updateHiddenElement(true);
|
|
18160
|
-
if (this.popupWrapper && li[index - 1] && li[index - 1].classList.contains('e-item-focus')) {
|
|
18161
|
-
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
18162
|
-
if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
18163
|
-
li[index - 1].classList.remove('e-item-focus');
|
|
18312
|
+
currentIndex = endIndex;
|
|
18313
|
+
if (currentIndex < dataArray.length) {
|
|
18314
|
+
requestAnimationFrame(processBatch);
|
|
18164
18315
|
}
|
|
18165
|
-
|
|
18166
|
-
|
|
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();
|
|
18167
18340
|
}, 0);
|
|
18168
18341
|
}
|
|
18169
18342
|
else if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
|
|
@@ -18177,25 +18350,60 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18177
18350
|
}
|
|
18178
18351
|
else {
|
|
18179
18352
|
if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
|
|
18180
|
-
this.virtualSelectAllData
|
|
18181
|
-
|
|
18182
|
-
|
|
18183
|
-
|
|
18184
|
-
|
|
18185
|
-
|
|
18186
|
-
|
|
18187
|
-
|
|
18188
|
-
|
|
18189
|
-
|
|
18190
|
-
|
|
18191
|
-
|
|
18192
|
-
|
|
18193
|
-
|
|
18194
|
-
|
|
18195
|
-
|
|
18196
|
-
|
|
18197
|
-
|
|
18198
|
-
|
|
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();
|
|
18199
18407
|
}
|
|
18200
18408
|
}
|
|
18201
18409
|
this.checkSelectAll();
|
|
@@ -18253,28 +18461,59 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18253
18461
|
index++;
|
|
18254
18462
|
}
|
|
18255
18463
|
if (length > 50) {
|
|
18256
|
-
|
|
18257
|
-
|
|
18258
|
-
|
|
18259
|
-
|
|
18260
|
-
|
|
18261
|
-
|
|
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;
|
|
18262
18480
|
}
|
|
18263
|
-
|
|
18264
|
-
|
|
18265
|
-
|
|
18266
|
-
|
|
18267
|
-
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
|
|
18274
|
-
|
|
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;
|
|
18275
18502
|
}
|
|
18276
|
-
|
|
18277
|
-
|
|
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
|
+
});
|
|
18278
18517
|
}
|
|
18279
18518
|
}
|
|
18280
18519
|
}
|
|
@@ -18323,7 +18562,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18323
18562
|
this.trigger('selectedAll', args);
|
|
18324
18563
|
}
|
|
18325
18564
|
}
|
|
18326
|
-
this.
|
|
18565
|
+
if (!this.isProcessingVirtualSelectAll &&
|
|
18566
|
+
((!this.isSelectAllClicked) || (this.isSelectAllClicked && (this.enableVirtualization ? length > 30 : length <= 50)))) {
|
|
18567
|
+
this.updatedataValueItems(event);
|
|
18568
|
+
}
|
|
18327
18569
|
this.checkPlaceholderSize();
|
|
18328
18570
|
if (length <= 50 && !beforeSelectArgs.preventSelectEvent) {
|
|
18329
18571
|
if (!this.changeOnBlur) {
|
|
@@ -18414,6 +18656,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18414
18656
|
this.renderPopup();
|
|
18415
18657
|
}
|
|
18416
18658
|
selectAllItems(state, event) {
|
|
18659
|
+
this.isSelectAllClicked = state;
|
|
18417
18660
|
if (isNullOrUndefined(this.list)) {
|
|
18418
18661
|
this.selectAllAction = () => {
|
|
18419
18662
|
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
@@ -19688,6 +19931,50 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
19688
19931
|
if (this.delimiterWrapper && this.delimiterWrapper.parentElement) {
|
|
19689
19932
|
this.delimiterWrapper.parentElement.remove();
|
|
19690
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
|
+
}
|
|
19691
19978
|
// Remove the select element if it exists
|
|
19692
19979
|
const selectElement = this.overAllWrapper.querySelector('select.e-multi-hidden');
|
|
19693
19980
|
if (selectElement && selectElement.parentElement) {
|
|
@@ -19707,7 +19994,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
19707
19994
|
const attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
|
|
19708
19995
|
'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
|
|
19709
19996
|
'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-label', 'aria-hidden', 'tabindex', 'aria-controls',
|
|
19710
|
-
'aria-describedby', 'size', 'role', 'type', 'class'];
|
|
19997
|
+
'aria-describedby', 'size', 'role', 'type', 'class', 'aria-activedescendant'];
|
|
19711
19998
|
for (let i = 0; i < attrArray.length; i++) {
|
|
19712
19999
|
this.inputElement.removeAttribute(attrArray[i]);
|
|
19713
20000
|
}
|
|
@@ -23494,8 +23781,10 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23494
23781
|
return;
|
|
23495
23782
|
}
|
|
23496
23783
|
this.isTyped = e.code !== 'Enter' && e.code !== 'Space' && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' ? true : false;
|
|
23497
|
-
const
|
|
23498
|
-
|
|
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) {
|
|
23499
23788
|
this.inputElement.focus();
|
|
23500
23789
|
}
|
|
23501
23790
|
if (this.isContentEditable(this.inputElement)) {
|
|
@@ -23520,7 +23809,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23520
23809
|
if (!this.requireLeadingSpace && lastWordRange && lastWordRange.includes(this.mentionChar)) {
|
|
23521
23810
|
lastWordRange = this.mentionChar + lastWordRange.split(this.mentionChar).pop();
|
|
23522
23811
|
}
|
|
23523
|
-
if (lastWordRange
|
|
23812
|
+
if (/\s|\u00A0/.test(lastWordRange)) {
|
|
23524
23813
|
return;
|
|
23525
23814
|
}
|
|
23526
23815
|
}
|
|
@@ -24049,7 +24338,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
24049
24338
|
}
|
|
24050
24339
|
setHeight(popupEle) {
|
|
24051
24340
|
if (this.popupHeight !== 'auto' && this.list) {
|
|
24052
|
-
|
|
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
|
|
24053
24344
|
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
24054
24345
|
}
|
|
24055
24346
|
else {
|