@syncfusion/ej2-dropdowns 24.2.9 → 25.1.37
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/CHANGELOG.md +27 -150
- 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 +2014 -514
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +2030 -513
- 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 +13 -13
- package/src/auto-complete/auto-complete-model.d.ts +3 -1
- package/src/auto-complete/auto-complete.d.ts +2 -0
- package/src/auto-complete/auto-complete.js +51 -6
- package/src/combo-box/combo-box-model.d.ts +10 -1
- package/src/combo-box/combo-box.d.ts +10 -2
- package/src/combo-box/combo-box.js +55 -23
- package/src/common/interface.d.ts +32 -0
- package/src/common/virtual-scroll.d.ts +1 -3
- package/src/common/virtual-scroll.js +157 -27
- package/src/drop-down-base/drop-down-base-model.d.ts +1 -1
- package/src/drop-down-base/drop-down-base.d.ts +64 -5
- package/src/drop-down-base/drop-down-base.js +241 -24
- package/src/drop-down-list/drop-down-list-model.d.ts +10 -1
- package/src/drop-down-list/drop-down-list.d.ts +16 -50
- package/src/drop-down-list/drop-down-list.js +150 -196
- package/src/drop-down-tree/drop-down-tree-model.d.ts +16 -12
- package/src/drop-down-tree/drop-down-tree.d.ts +13 -3
- package/src/drop-down-tree/drop-down-tree.js +55 -49
- package/src/global.js +1 -1
- package/src/list-box/list-box.js +9 -4
- package/src/mention/mention.d.ts +2 -0
- package/src/mention/mention.js +16 -8
- package/src/multi-select/checkbox-selection.d.ts +2 -0
- package/src/multi-select/checkbox-selection.js +16 -3
- package/src/multi-select/float-label.d.ts +5 -5
- package/src/multi-select/index.d.ts +1 -0
- package/src/multi-select/index.js +1 -0
- package/src/multi-select/interface.d.ts +1 -0
- package/src/multi-select/multi-select-model.d.ts +17 -2
- package/src/multi-select/multi-select.d.ts +35 -4
- package/src/multi-select/multi-select.js +1282 -174
- package/styles/auto-complete/_bds-definition.scss +2 -0
- package/styles/bootstrap-dark.css +7 -1
- package/styles/bootstrap.css +7 -1
- package/styles/bootstrap4.css +2 -1
- package/styles/bootstrap5-dark.css +2 -1
- package/styles/bootstrap5.css +2 -1
- package/styles/combo-box/_bds-definition.scss +2 -0
- package/styles/drop-down-base/_bds-definition.scss +134 -0
- package/styles/drop-down-list/_bds-definition.scss +134 -0
- package/styles/drop-down-list/icons/_bds.scss +14 -0
- package/styles/drop-down-tree/_bds-definition.scss +61 -0
- package/styles/drop-down-tree/icons/_bds.scss +11 -0
- package/styles/fabric-dark.css +3 -1
- package/styles/fabric.css +3 -1
- package/styles/fluent-dark.css +7 -1
- package/styles/fluent.css +7 -1
- package/styles/highcontrast-light.css +3 -1
- package/styles/highcontrast.css +3 -1
- package/styles/list-box/_bds-definition.scss +136 -0
- package/styles/list-box/icons/_bds.scss +25 -0
- package/styles/material-dark.css +11 -1
- package/styles/material.css +11 -1
- package/styles/material3-dark.css +2 -1
- package/styles/material3.css +2 -1
- package/styles/mention/_bds-definition.scss +1 -0
- package/styles/multi-select/_bds-definition.scss +235 -0
- package/styles/multi-select/_bootstrap-dark-definition.scss +4 -0
- package/styles/multi-select/_bootstrap-definition.scss +4 -0
- package/styles/multi-select/_fluent-definition.scss +5 -0
- package/styles/multi-select/_layout.scss +8 -1
- package/styles/multi-select/_material-dark-definition.scss +11 -0
- package/styles/multi-select/_material-definition.scss +11 -0
- package/styles/multi-select/bootstrap-dark.css +7 -1
- package/styles/multi-select/bootstrap.css +7 -1
- package/styles/multi-select/bootstrap4.css +2 -1
- package/styles/multi-select/bootstrap5-dark.css +2 -1
- package/styles/multi-select/bootstrap5.css +2 -1
- package/styles/multi-select/fabric-dark.css +3 -1
- package/styles/multi-select/fabric.css +3 -1
- package/styles/multi-select/fluent-dark.css +7 -1
- package/styles/multi-select/fluent.css +7 -1
- package/styles/multi-select/highcontrast-light.css +3 -1
- package/styles/multi-select/highcontrast.css +3 -1
- package/styles/multi-select/icons/_bds.scss +26 -0
- package/styles/multi-select/material-dark.css +11 -1
- package/styles/multi-select/material.css +11 -1
- package/styles/multi-select/material3-dark.css +2 -1
- package/styles/multi-select/material3.css +2 -1
- package/styles/multi-select/tailwind-dark.css +2 -1
- package/styles/multi-select/tailwind.css +2 -1
- package/styles/tailwind-dark.css +2 -1
- package/styles/tailwind.css +2 -1
|
@@ -23,6 +23,7 @@ import { NotifyPropertyChanges, rippleEffect, ChildProperty, Complex } from '@sy
|
|
|
23
23
|
import { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';
|
|
24
24
|
import { ListBase } from '@syncfusion/ej2-lists';
|
|
25
25
|
import { select, selectAll } from '@syncfusion/ej2-base';
|
|
26
|
+
import { Skeleton } from '@syncfusion/ej2-notifications';
|
|
26
27
|
var FieldSettings = /** @class */ (function (_super) {
|
|
27
28
|
__extends(FieldSettings, _super);
|
|
28
29
|
function FieldSettings() {
|
|
@@ -58,7 +59,8 @@ export var dropDownBaseClasses = {
|
|
|
58
59
|
li: 'e-list-item',
|
|
59
60
|
group: 'e-list-group-item',
|
|
60
61
|
disabled: 'e-disabled',
|
|
61
|
-
grouping: 'e-dd-group'
|
|
62
|
+
grouping: 'e-dd-group',
|
|
63
|
+
virtualList: 'e-list-item e-virtual-list',
|
|
62
64
|
};
|
|
63
65
|
var ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
|
|
64
66
|
var DISPLAYTEMPLATE_PROPERTY = 'DisplayTemplate';
|
|
@@ -92,13 +94,63 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
92
94
|
_this.isAddNewItemTemplate = false;
|
|
93
95
|
_this.isRequesting = false;
|
|
94
96
|
_this.isVirtualizationEnabled = false;
|
|
97
|
+
_this.isCustomDataUpdated = false;
|
|
95
98
|
_this.isAllowFiltering = false;
|
|
96
99
|
_this.virtualizedItemsCount = 0;
|
|
100
|
+
_this.isCheckBoxSelection = false;
|
|
97
101
|
_this.totalItemCount = 0;
|
|
98
102
|
_this.dataCount = 0;
|
|
99
103
|
_this.isRemoteDataUpdated = false;
|
|
100
104
|
_this.isIncrementalRequest = false;
|
|
101
105
|
_this.itemCount = 10;
|
|
106
|
+
_this.virtualListHeight = 0;
|
|
107
|
+
_this.isVirtualScrolling = false;
|
|
108
|
+
_this.isPreventScrollAction = false;
|
|
109
|
+
_this.scrollPreStartIndex = 0;
|
|
110
|
+
_this.isScrollActionTriggered = false;
|
|
111
|
+
_this.previousStartIndex = 0;
|
|
112
|
+
_this.isMouseScrollAction = false;
|
|
113
|
+
_this.isKeyBoardAction = false;
|
|
114
|
+
_this.isScrollChanged = false;
|
|
115
|
+
_this.isUpwardScrolling = false;
|
|
116
|
+
_this.startIndex = 0;
|
|
117
|
+
_this.currentPageNumber = 0;
|
|
118
|
+
_this.pageCount = 0;
|
|
119
|
+
_this.isPreventKeyAction = false;
|
|
120
|
+
_this.generatedDataObject = {};
|
|
121
|
+
_this.skeletonCount = 32;
|
|
122
|
+
_this.isVirtualTrackHeight = false;
|
|
123
|
+
_this.virtualSelectAll = false;
|
|
124
|
+
_this.incrementalQueryString = '';
|
|
125
|
+
_this.incrementalEndIndex = 0;
|
|
126
|
+
_this.incrementalStartIndex = 0;
|
|
127
|
+
_this.incrementalPreQueryString = '';
|
|
128
|
+
_this.isObjectCustomValue = false;
|
|
129
|
+
_this.appendUncheckList = false;
|
|
130
|
+
_this.virtualListInfo = {
|
|
131
|
+
currentPageNumber: null,
|
|
132
|
+
direction: null,
|
|
133
|
+
sentinelInfo: {},
|
|
134
|
+
offsets: {},
|
|
135
|
+
startIndex: 0,
|
|
136
|
+
endIndex: 0,
|
|
137
|
+
};
|
|
138
|
+
_this.viewPortInfo = {
|
|
139
|
+
currentPageNumber: null,
|
|
140
|
+
direction: null,
|
|
141
|
+
sentinelInfo: {},
|
|
142
|
+
offsets: {},
|
|
143
|
+
startIndex: 0,
|
|
144
|
+
endIndex: 0,
|
|
145
|
+
};
|
|
146
|
+
_this.selectedValueInfo = {
|
|
147
|
+
currentPageNumber: null,
|
|
148
|
+
direction: null,
|
|
149
|
+
sentinelInfo: {},
|
|
150
|
+
offsets: {},
|
|
151
|
+
startIndex: 0,
|
|
152
|
+
endIndex: 0,
|
|
153
|
+
};
|
|
102
154
|
return _this;
|
|
103
155
|
}
|
|
104
156
|
DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
|
|
@@ -312,6 +364,124 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
312
364
|
}
|
|
313
365
|
}
|
|
314
366
|
};
|
|
367
|
+
DropDownBase.prototype.checkAndResetCache = function () {
|
|
368
|
+
if (this.isVirtualizationEnabled) {
|
|
369
|
+
this.generatedDataObject = {};
|
|
370
|
+
this.virtualItemStartIndex = this.virtualItemEndIndex = 0;
|
|
371
|
+
this.viewPortInfo = {
|
|
372
|
+
currentPageNumber: null,
|
|
373
|
+
direction: null,
|
|
374
|
+
sentinelInfo: {},
|
|
375
|
+
offsets: {},
|
|
376
|
+
startIndex: 0,
|
|
377
|
+
endIndex: this.itemCount,
|
|
378
|
+
};
|
|
379
|
+
this.selectedValueInfo = null;
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
DropDownBase.prototype.updateIncrementalInfo = function (startIndex, endIndex) {
|
|
383
|
+
this.viewPortInfo.startIndex = startIndex;
|
|
384
|
+
this.viewPortInfo.endIndex = endIndex;
|
|
385
|
+
this.updateVirtualItemIndex();
|
|
386
|
+
this.isIncrementalRequest = true;
|
|
387
|
+
this.resetList(this.dataSource, this.fields, this.query);
|
|
388
|
+
this.isIncrementalRequest = false;
|
|
389
|
+
};
|
|
390
|
+
DropDownBase.prototype.updateIncrementalView = function (startIndex, endIndex) {
|
|
391
|
+
this.viewPortInfo.startIndex = startIndex;
|
|
392
|
+
this.viewPortInfo.endIndex = endIndex;
|
|
393
|
+
this.updateVirtualItemIndex();
|
|
394
|
+
this.resetList(this.dataSource, this.fields, this.query);
|
|
395
|
+
this.UpdateSkeleton();
|
|
396
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
397
|
+
this.ulElement = this.list.querySelector('ul');
|
|
398
|
+
};
|
|
399
|
+
DropDownBase.prototype.updateVirtualItemIndex = function () {
|
|
400
|
+
this.virtualItemStartIndex = this.viewPortInfo.startIndex;
|
|
401
|
+
this.virtualItemEndIndex = this.viewPortInfo.endIndex;
|
|
402
|
+
this.virtualListInfo = this.viewPortInfo;
|
|
403
|
+
};
|
|
404
|
+
DropDownBase.prototype.getFilteringSkeletonCount = function () {
|
|
405
|
+
var difference = this.dataCount - this.viewPortInfo.endIndex;
|
|
406
|
+
var currentSkeletonCount = this.skeletonCount;
|
|
407
|
+
this.getSkeletonCount(true);
|
|
408
|
+
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
|
|
409
|
+
var skeletonUpdated = true;
|
|
410
|
+
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'multiselect') && (this.totalItemCount < (this.itemCount * 2))) {
|
|
411
|
+
this.skeletonCount = 0;
|
|
412
|
+
skeletonUpdated = false;
|
|
413
|
+
}
|
|
414
|
+
if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
415
|
+
var isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
|
|
416
|
+
if (currentSkeletonCount !== this.skeletonCount && skeletonUpdated) {
|
|
417
|
+
this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
this.UpdateSkeleton();
|
|
421
|
+
}
|
|
422
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
423
|
+
if ((this.list.getElementsByClassName('e-virtual-ddl').length > 0)) {
|
|
424
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
425
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
426
|
+
}
|
|
427
|
+
else if (!this.list.querySelector('.e-virtual-ddl') && this.skeletonCount > 0 && this.list.querySelector('.e-dropdownbase')) {
|
|
428
|
+
var virualElement = this.createElement('div', {
|
|
429
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
430
|
+
});
|
|
431
|
+
this.list.querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
432
|
+
}
|
|
433
|
+
if (this.list.getElementsByClassName('e-virtual-ddl-content').length > 0) {
|
|
434
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
435
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
DropDownBase.prototype.getSkeletonCount = function (retainSkeleton) {
|
|
440
|
+
this.virtualListHeight = this.listContainerHeight != null ? parseInt(this.listContainerHeight, 10) : this.virtualListHeight;
|
|
441
|
+
var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
|
|
442
|
+
this.skeletonCount = actualCount * 2 < this.itemCount ? this.itemCount : actualCount * 2;
|
|
443
|
+
this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
|
|
444
|
+
this.skeletonCount = Math.floor(this.skeletonCount / 2) + 2;
|
|
445
|
+
};
|
|
446
|
+
DropDownBase.prototype.GetVirtualTrackHeight = function () {
|
|
447
|
+
var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
|
|
448
|
+
height = this.isVirtualTrackHeight ? 0 : height;
|
|
449
|
+
var heightDimension = "height: " + (height - this.itemCount * this.listItemHeight) + "px;";
|
|
450
|
+
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'multiselect') && this.skeletonCount === 0) {
|
|
451
|
+
return "height: 0px;";
|
|
452
|
+
}
|
|
453
|
+
return heightDimension;
|
|
454
|
+
};
|
|
455
|
+
DropDownBase.prototype.getTransformValues = function () {
|
|
456
|
+
var translateY = this.viewPortInfo.startIndex * this.listItemHeight;
|
|
457
|
+
translateY = translateY - (this.skeletonCount * this.listItemHeight);
|
|
458
|
+
translateY = this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0 ? 0 : translateY;
|
|
459
|
+
var styleText = "transform: translate(0px, " + translateY + "px);";
|
|
460
|
+
return styleText;
|
|
461
|
+
};
|
|
462
|
+
DropDownBase.prototype.UpdateSkeleton = function (isSkeletonCountChange, skeletonCount) {
|
|
463
|
+
var isContainSkeleton = this.list.querySelector('.e-virtual-ddl-content');
|
|
464
|
+
var isContainVirtualList = this.list.querySelector('.e-virtual-list');
|
|
465
|
+
if (isContainSkeleton && (!isContainVirtualList || isSkeletonCountChange) && this.isVirtualizationEnabled) {
|
|
466
|
+
var totalSkeletonCount = isSkeletonCountChange ? skeletonCount : this.skeletonCount;
|
|
467
|
+
for (var i = 0; i < totalSkeletonCount; i++) {
|
|
468
|
+
var liElement = this.createElement('li', { className: dropDownBaseClasses.virtualList, styles: 'overflow: inherit' });
|
|
469
|
+
if (this.isVirtualizationEnabled && this.itemTemplate) {
|
|
470
|
+
liElement.style.height = this.listItemHeight + 'px';
|
|
471
|
+
}
|
|
472
|
+
var skeleton = new Skeleton({
|
|
473
|
+
shape: "Text",
|
|
474
|
+
height: "10px",
|
|
475
|
+
width: "95%",
|
|
476
|
+
cssClass: "e-skeleton-text",
|
|
477
|
+
});
|
|
478
|
+
skeleton.appendTo(this.createElement('div'));
|
|
479
|
+
liElement.appendChild(skeleton.element);
|
|
480
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
481
|
+
isContainSkeleton.firstChild && isContainSkeleton.firstChild.insertBefore(liElement, isContainSkeleton.firstChild.children[0]);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
};
|
|
315
485
|
DropDownBase.prototype.getLocaleName = function () {
|
|
316
486
|
return 'drop-down-base';
|
|
317
487
|
};
|
|
@@ -560,31 +730,52 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
560
730
|
}
|
|
561
731
|
else {
|
|
562
732
|
_this.isRequesting = false;
|
|
733
|
+
var isReOrder = true;
|
|
563
734
|
var listItems = void 0;
|
|
564
735
|
if (_this.isVirtualizationEnabled && !_this.virtualGroupDataSource && _this.fields.groupBy) {
|
|
565
736
|
var data = new DataManager(_this.dataSource).executeLocal(new Query().group(_this.fields.groupBy));
|
|
566
737
|
_this.virtualGroupDataSource = data.records;
|
|
567
738
|
}
|
|
568
|
-
var dataManager = _this.isVirtualizationEnabled && _this.virtualGroupDataSource ? new DataManager(_this.virtualGroupDataSource) : new DataManager(eventArgs.data);
|
|
739
|
+
var dataManager = _this.isVirtualizationEnabled && _this.virtualGroupDataSource && !_this.isCustomDataUpdated ? new DataManager(_this.virtualGroupDataSource) : new DataManager(eventArgs.data);
|
|
569
740
|
listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
|
|
570
|
-
if (_this.
|
|
741
|
+
if (!_this.virtualSelectAll) {
|
|
571
742
|
var newQuery = _this.getQuery(eventArgs.query);
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
743
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
744
|
+
if (_this.isVirtualizationEnabled && (listItems.count != 0 && listItems.count < (_this.itemCount * 2))) {
|
|
745
|
+
if (newQuery) {
|
|
746
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
747
|
+
if (newQuery.queries[queryElements].fn === 'onTake') {
|
|
748
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
749
|
+
newQuery.queries[queryElements].e.nos = listItems.count;
|
|
750
|
+
listItems = (newQuery).executeLocal(dataManager);
|
|
751
|
+
}
|
|
752
|
+
if (_this.getModuleName() === 'multiselect' && (newQuery.queries[queryElements].e.condition == 'or' || newQuery.queries[queryElements].e.operator == 'equal')) {
|
|
753
|
+
isReOrder = false;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
if (isReOrder) {
|
|
576
757
|
listItems = (newQuery).executeLocal(dataManager);
|
|
577
|
-
|
|
758
|
+
_this.isVirtualTrackHeight = true;
|
|
578
759
|
}
|
|
579
760
|
}
|
|
580
761
|
}
|
|
762
|
+
else {
|
|
763
|
+
_this.isVirtualTrackHeight = false;
|
|
764
|
+
if (newQuery) {
|
|
765
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
766
|
+
if (_this.getModuleName() === 'multiselect' && ((newQuery.queries[queryElements].e && newQuery.queries[queryElements].e.condition == 'or') || (newQuery.queries[queryElements].e && newQuery.queries[queryElements].e.operator == 'equal'))) {
|
|
767
|
+
isReOrder = false;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
if (isReOrder) {
|
|
774
|
+
// eslint-disable @typescript-eslint/no-explicit-any
|
|
775
|
+
_this.dataCount = _this.totalItemCount = _this.virtualSelectAll ? listItems.length : listItems.count;
|
|
581
776
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
585
|
-
_this.totalItemCount = listItems.count;
|
|
586
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
587
|
-
listItems = _this.isVirtualizationEnabled ? listItems.result : listItems;
|
|
777
|
+
listItems = _this.isVirtualizationEnabled && !_this.virtualSelectAll ? listItems.result : listItems;
|
|
778
|
+
// eslint-enable @typescript-eslint/no-explicit-any
|
|
588
779
|
var localDataArgs = { cancel: false, result: listItems };
|
|
589
780
|
_this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
|
|
590
781
|
_this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
|
|
@@ -632,6 +823,13 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
632
823
|
this.raiseDataBound(listItems, e);
|
|
633
824
|
}
|
|
634
825
|
};
|
|
826
|
+
DropDownBase.prototype.isObjectInArray = function (objectToFind, array) {
|
|
827
|
+
return array.some(function (item) {
|
|
828
|
+
return Object.keys(objectToFind).every(function (key) {
|
|
829
|
+
return item.hasOwnProperty(key) && item[key] === objectToFind[key];
|
|
830
|
+
});
|
|
831
|
+
});
|
|
832
|
+
};
|
|
635
833
|
DropDownBase.prototype.updateListValues = function () {
|
|
636
834
|
// Used this method in component side.
|
|
637
835
|
};
|
|
@@ -672,6 +870,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
672
870
|
var listItems = [];
|
|
673
871
|
this.onActionComplete(this.renderItems(listItems, fields), listItems);
|
|
674
872
|
this.isRequested = false;
|
|
873
|
+
this.isRequesting = false;
|
|
675
874
|
this.hideSpinner();
|
|
676
875
|
};
|
|
677
876
|
DropDownBase.prototype.showSpinner = function () {
|
|
@@ -692,7 +891,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
692
891
|
DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
|
|
693
892
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
694
893
|
this.listData = list;
|
|
695
|
-
if (this.isVirtualizationEnabled) {
|
|
894
|
+
if (this.isVirtualizationEnabled && !this.isCustomDataUpdated) {
|
|
696
895
|
this.notify("setGeneratedData", {
|
|
697
896
|
module: "VirtualScroll",
|
|
698
897
|
});
|
|
@@ -751,10 +950,11 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
751
950
|
DropDownBase.prototype.getQuery = function (query) {
|
|
752
951
|
return query ? query : this.query ? this.query : new Query();
|
|
753
952
|
};
|
|
754
|
-
DropDownBase.prototype.updateVirtualizationProperties = function (itemCount, filtering) {
|
|
953
|
+
DropDownBase.prototype.updateVirtualizationProperties = function (itemCount, filtering, isCheckbox) {
|
|
755
954
|
this.isVirtualizationEnabled = true;
|
|
756
955
|
this.virtualizedItemsCount = itemCount;
|
|
757
956
|
this.isAllowFiltering = filtering;
|
|
957
|
+
this.isCheckBoxSelection = isCheckbox;
|
|
758
958
|
};
|
|
759
959
|
/**
|
|
760
960
|
* To render the template content for group header element.
|
|
@@ -866,7 +1066,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
866
1066
|
if (isCount) {
|
|
867
1067
|
count++;
|
|
868
1068
|
}
|
|
869
|
-
if (this.updateGroupHeader(index, liCollections, target)) {
|
|
1069
|
+
if (this.fixedHeaderElement && this.updateGroupHeader(index, liCollections, target)) {
|
|
870
1070
|
loadedGroupList++;
|
|
871
1071
|
if (count >= this.getPageCount()) {
|
|
872
1072
|
break;
|
|
@@ -922,7 +1122,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
922
1122
|
* @param {FieldSettingsModel} fields - Maps the columns of the data table and binds the data to the component.
|
|
923
1123
|
* @returns {HTMLElement} Return the list items.
|
|
924
1124
|
*/
|
|
925
|
-
DropDownBase.prototype.renderItems = function (listData, fields) {
|
|
1125
|
+
DropDownBase.prototype.renderItems = function (listData, fields, isCheckBoxUpdate) {
|
|
926
1126
|
var ulElement;
|
|
927
1127
|
if (this.itemTemplate && listData) {
|
|
928
1128
|
var dataSource = listData;
|
|
@@ -945,6 +1145,10 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
945
1145
|
var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
946
1146
|
if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
|
|
947
1147
|
virtualUlElement.replaceChild(ulElement, oldUlElement);
|
|
1148
|
+
var reOrderList = this.list.querySelectorAll('.e-reorder');
|
|
1149
|
+
if (this.list.querySelector('.e-virtual-ddl-content') && reOrderList && reOrderList.length > 0 && !isCheckBoxUpdate) {
|
|
1150
|
+
this.list.querySelector('.e-virtual-ddl-content').removeChild(reOrderList[0]);
|
|
1151
|
+
}
|
|
948
1152
|
this.updateListElements(listData);
|
|
949
1153
|
}
|
|
950
1154
|
else if ((!virtualUlElement)) {
|
|
@@ -956,6 +1160,10 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
956
1160
|
}
|
|
957
1161
|
}
|
|
958
1162
|
else {
|
|
1163
|
+
if (this.getModuleName() === 'multiselect' && this.virtualSelectAll) {
|
|
1164
|
+
this.virtualSelectAllData = listData;
|
|
1165
|
+
listData = listData.slice(this.virtualItemStartIndex, this.virtualItemEndIndex);
|
|
1166
|
+
}
|
|
959
1167
|
ulElement = this.createListItems(listData, fields);
|
|
960
1168
|
if (this.isIncrementalRequest) {
|
|
961
1169
|
this.incrementalLiCollections = ulElement.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
@@ -964,10 +1172,19 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
964
1172
|
return ulElement;
|
|
965
1173
|
}
|
|
966
1174
|
if (this.isVirtualizationEnabled) {
|
|
967
|
-
var oldUlElement = this.list.querySelector('.e-list-parent');
|
|
1175
|
+
var oldUlElement = this.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
|
|
968
1176
|
var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
969
|
-
|
|
970
|
-
|
|
1177
|
+
var isRemovedUlelement = false;
|
|
1178
|
+
if (!oldUlElement && this.list.querySelector('.e-list-parent' + '.e-reorder')) {
|
|
1179
|
+
oldUlElement = this.list.querySelector('.e-list-parent' + '.e-reorder');
|
|
1180
|
+
}
|
|
1181
|
+
if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'multiselect')) || isRemovedUlelement) {
|
|
1182
|
+
if (!this.appendUncheckList) {
|
|
1183
|
+
virtualUlElement.replaceChild(ulElement, oldUlElement);
|
|
1184
|
+
}
|
|
1185
|
+
else {
|
|
1186
|
+
virtualUlElement.appendChild(ulElement);
|
|
1187
|
+
}
|
|
971
1188
|
this.updateListElements(listData);
|
|
972
1189
|
}
|
|
973
1190
|
else if ((!virtualUlElement)) {
|
|
@@ -1160,11 +1377,11 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1160
1377
|
this.render();
|
|
1161
1378
|
};
|
|
1162
1379
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1163
|
-
DropDownBase.prototype.updateDataSource = function (props) {
|
|
1380
|
+
DropDownBase.prototype.updateDataSource = function (props, oldProps) {
|
|
1164
1381
|
this.resetList(this.dataSource);
|
|
1165
1382
|
this.totalItemCount = this.dataSource instanceof DataManager ? this.dataSource.dataSource.json.length : 0;
|
|
1166
1383
|
};
|
|
1167
|
-
DropDownBase.prototype.setUpdateInitial = function (props, newProp) {
|
|
1384
|
+
DropDownBase.prototype.setUpdateInitial = function (props, newProp, oldProp) {
|
|
1168
1385
|
this.isDataFetched = false;
|
|
1169
1386
|
var updateData = {};
|
|
1170
1387
|
for (var j = 0; props.length > j; j++) {
|
|
@@ -1180,7 +1397,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1180
1397
|
if (Object.keys(updateData).indexOf('dataSource') === -1) {
|
|
1181
1398
|
updateData.dataSource = this.dataSource;
|
|
1182
1399
|
}
|
|
1183
|
-
this.updateDataSource(updateData);
|
|
1400
|
+
this.updateDataSource(updateData, oldProp);
|
|
1184
1401
|
}
|
|
1185
1402
|
};
|
|
1186
1403
|
/**
|
|
@@ -163,6 +163,7 @@ export interface DropDownListModel extends DropDownBaseModel{
|
|
|
163
163
|
* Gets or sets the display text of the selected item in the component.
|
|
164
164
|
*
|
|
165
165
|
* @default null
|
|
166
|
+
* @aspType string
|
|
166
167
|
*/
|
|
167
168
|
text?: string | null;
|
|
168
169
|
|
|
@@ -172,7 +173,14 @@ export interface DropDownListModel extends DropDownBaseModel{
|
|
|
172
173
|
* @default null
|
|
173
174
|
* @isGenericType true
|
|
174
175
|
*/
|
|
175
|
-
value?: number | string | boolean | null;
|
|
176
|
+
value?: number | string | boolean | object | null;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Defines whether the object binding is allowed or not in the component.
|
|
180
|
+
*
|
|
181
|
+
* @default false
|
|
182
|
+
*/
|
|
183
|
+
allowObjectBinding?: boolean;
|
|
176
184
|
|
|
177
185
|
/**
|
|
178
186
|
* Gets or sets the index of the selected item in the component.
|
|
@@ -182,6 +190,7 @@ export interface DropDownListModel extends DropDownBaseModel{
|
|
|
182
190
|
* {% codeBlock src="dropdownlist/index-api/index.html" %}{% endcodeBlock %}
|
|
183
191
|
*
|
|
184
192
|
* @default null
|
|
193
|
+
* @aspType double
|
|
185
194
|
*/
|
|
186
195
|
index?: number | null;
|
|
187
196
|
|
|
@@ -6,14 +6,13 @@ import { DropDownBase, SelectEventArgs, FilteringEventArgs, PopupEventArgs } fro
|
|
|
6
6
|
import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';
|
|
7
7
|
import { DropDownListModel } from '../drop-down-list';
|
|
8
8
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
9
|
-
import { VirtualInfo } from '../common/virtual-scroll';
|
|
10
9
|
export interface ChangeEventArgs extends SelectEventArgs {
|
|
11
10
|
/**
|
|
12
11
|
* Returns the selected value
|
|
13
12
|
*
|
|
14
13
|
* @isGenericType true
|
|
15
14
|
*/
|
|
16
|
-
value: number | string | boolean;
|
|
15
|
+
value: number | string | boolean | object;
|
|
17
16
|
/**
|
|
18
17
|
* Returns the previous selected list item
|
|
19
18
|
*/
|
|
@@ -59,9 +58,6 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
59
58
|
protected previousItemData: {
|
|
60
59
|
[key: string]: Object;
|
|
61
60
|
} | string | number | boolean;
|
|
62
|
-
private listHeight;
|
|
63
|
-
private listItemHeight;
|
|
64
|
-
protected skeletonCount: number;
|
|
65
61
|
protected hiddenElement: HTMLSelectElement;
|
|
66
62
|
protected isPopupOpen: boolean;
|
|
67
63
|
private isDocumentClick;
|
|
@@ -71,11 +67,10 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
71
67
|
protected initial: boolean;
|
|
72
68
|
private searchBoxHeight;
|
|
73
69
|
private popupObj;
|
|
74
|
-
private popupContentElement;
|
|
75
70
|
private backIconElement;
|
|
76
71
|
private clearIconElement;
|
|
77
72
|
private containerStyle;
|
|
78
|
-
protected previousValue: string | number | boolean;
|
|
73
|
+
protected previousValue: string | number | boolean | object;
|
|
79
74
|
protected activeIndex: number;
|
|
80
75
|
protected filterInput: HTMLInputElement;
|
|
81
76
|
private searchKeyModule;
|
|
@@ -100,7 +95,6 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
100
95
|
protected isDropDownClick: boolean;
|
|
101
96
|
protected preventAltUp: boolean;
|
|
102
97
|
private searchKeyEvent;
|
|
103
|
-
private keyboardEvent;
|
|
104
98
|
private filterInputObj;
|
|
105
99
|
protected spinnerElement: HTMLElement;
|
|
106
100
|
protected keyConfigure: {
|
|
@@ -112,36 +106,9 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
112
106
|
protected preventChange: boolean;
|
|
113
107
|
protected isAngular: boolean;
|
|
114
108
|
protected selectedElementID: string;
|
|
115
|
-
private virtualListHeight;
|
|
116
|
-
private virtualItemCount;
|
|
117
|
-
private isVirtualScrolling;
|
|
118
|
-
private observer;
|
|
119
|
-
protected isPreventScrollAction: boolean;
|
|
120
|
-
private scrollPreStartIndex;
|
|
121
|
-
private isScrollActionTriggered;
|
|
122
|
-
protected previousStartIndex: number;
|
|
123
|
-
private isMouseScrollAction;
|
|
124
|
-
private isKeyBoardAction;
|
|
125
|
-
private isUpwardScrolling;
|
|
126
|
-
private containerElementRect;
|
|
127
|
-
protected previousEndIndex: number;
|
|
128
|
-
private previousInfo;
|
|
129
|
-
protected startIndex: number;
|
|
130
|
-
private currentPageNumber;
|
|
131
|
-
private pageCount;
|
|
132
|
-
private isPreventKeyAction;
|
|
133
|
-
protected virtualItemStartIndex: number;
|
|
134
|
-
private virtualItemEndIndex;
|
|
135
|
-
private generatedDataObject;
|
|
136
109
|
private preselectedIndex;
|
|
137
|
-
protected incrementalQueryString: string;
|
|
138
|
-
protected incrementalEndIndex: number;
|
|
139
|
-
protected incrementalStartIndex: number;
|
|
140
|
-
protected incrementalPreQueryString: string;
|
|
141
110
|
private isTouched;
|
|
142
|
-
|
|
143
|
-
protected viewPortInfo: VirtualInfo;
|
|
144
|
-
private selectedValueInfo;
|
|
111
|
+
private clearButton;
|
|
145
112
|
/**
|
|
146
113
|
* Sets CSS classes to the root element of the component that allows customization of appearance.
|
|
147
114
|
*
|
|
@@ -284,6 +251,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
284
251
|
* Gets or sets the display text of the selected item in the component.
|
|
285
252
|
*
|
|
286
253
|
* @default null
|
|
254
|
+
* @aspType string
|
|
287
255
|
*/
|
|
288
256
|
text: string | null;
|
|
289
257
|
/**
|
|
@@ -292,7 +260,13 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
292
260
|
* @default null
|
|
293
261
|
* @isGenericType true
|
|
294
262
|
*/
|
|
295
|
-
value: number | string | boolean | null;
|
|
263
|
+
value: number | string | boolean | object | null;
|
|
264
|
+
/**
|
|
265
|
+
* Defines whether the object binding is allowed or not in the component.
|
|
266
|
+
*
|
|
267
|
+
* @default false
|
|
268
|
+
*/
|
|
269
|
+
allowObjectBinding: boolean;
|
|
296
270
|
/**
|
|
297
271
|
* Gets or sets the index of the selected item in the component.
|
|
298
272
|
*
|
|
@@ -301,6 +275,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
301
275
|
* {% codeBlock src="dropdownlist/index-api/index.html" %}{% endcodeBlock %}
|
|
302
276
|
*
|
|
303
277
|
* @default null
|
|
278
|
+
* @aspType double
|
|
304
279
|
*/
|
|
305
280
|
index: number | null;
|
|
306
281
|
/**
|
|
@@ -414,7 +389,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
414
389
|
protected targetElement(): HTMLElement | HTMLInputElement;
|
|
415
390
|
protected getNgDirective(): string;
|
|
416
391
|
protected getElementByText(text: string): Element;
|
|
417
|
-
protected getElementByValue(value: string | number | boolean): Element;
|
|
392
|
+
protected getElementByValue(value: string | number | boolean | object): Element;
|
|
418
393
|
private initValue;
|
|
419
394
|
protected updateValues(): void;
|
|
420
395
|
protected onBlurHandler(e: MouseEvent): void;
|
|
@@ -442,8 +417,6 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
442
417
|
private onMouseLeave;
|
|
443
418
|
protected removeHover(): void;
|
|
444
419
|
protected isValidLI(li: Element | HTMLElement): boolean;
|
|
445
|
-
protected updateIncrementalInfo(startIndex: number, endIndex: number): void;
|
|
446
|
-
protected updateIncrementalView(startIndex: number, endIndex: number): void;
|
|
447
420
|
protected updateIncrementalItemIndex(startIndex: number, endIndex: number): void;
|
|
448
421
|
protected incrementalSearch(e: KeyboardEventArgs): void;
|
|
449
422
|
/**
|
|
@@ -460,7 +433,6 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
460
433
|
showSpinner(): void;
|
|
461
434
|
protected keyActionHandler(e: KeyboardEventArgs): void;
|
|
462
435
|
private updateUpDownAction;
|
|
463
|
-
private updateVirtualItemIndex;
|
|
464
436
|
private updateHomeEndAction;
|
|
465
437
|
protected selectCurrentValueOnTab(e: KeyboardEventArgs): void;
|
|
466
438
|
protected mobileKeyActionHandler(e: KeyboardEventArgs): void;
|
|
@@ -501,7 +473,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
501
473
|
* @param {MouseEvent | KeyboardEvent | TouchEvent} eve - Specifies the event arguments.
|
|
502
474
|
* @returns {void}
|
|
503
475
|
*/
|
|
504
|
-
protected onChangeEvent(eve: MouseEvent | KeyboardEvent | TouchEvent): void;
|
|
476
|
+
protected onChangeEvent(eve: MouseEvent | KeyboardEvent | TouchEvent, isCustomValue?: boolean): void;
|
|
505
477
|
private detachChanges;
|
|
506
478
|
protected detachChangeEvent(eve: MouseEvent | KeyboardEvent | TouchEvent): void;
|
|
507
479
|
protected setHiddenValue(): void;
|
|
@@ -512,8 +484,6 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
512
484
|
* @returns {void}
|
|
513
485
|
*/
|
|
514
486
|
protected onFilterUp(e: KeyboardEventArgs): void;
|
|
515
|
-
protected getFilteringSkeletonCount(): void;
|
|
516
|
-
protected getSkeletonCount(retainSkeleton?: boolean): void;
|
|
517
487
|
protected onFilterDown(e: KeyboardEventArgs): void;
|
|
518
488
|
protected removeFillSelection(): void;
|
|
519
489
|
protected getQuery(query: Query): Query;
|
|
@@ -538,7 +508,6 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
538
508
|
protected onInput(e: KeyboardEventArgs): void;
|
|
539
509
|
protected pasteHandler(e: KeyboardEventArgs): void;
|
|
540
510
|
protected onActionFailure(e: Object): void;
|
|
541
|
-
private UpdateSkeleton;
|
|
542
511
|
protected getTakeValue(): number;
|
|
543
512
|
protected onActionComplete(ulElement: HTMLElement, list: {
|
|
544
513
|
[key: string]: Object;
|
|
@@ -554,10 +523,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
554
523
|
private focusIndexItem;
|
|
555
524
|
protected updateSelection(): void;
|
|
556
525
|
private updateSelectionList;
|
|
557
|
-
protected checkAndResetCache(): void;
|
|
558
526
|
protected removeFocus(): void;
|
|
559
|
-
protected getTransformValues(): string;
|
|
560
|
-
protected GetVirtualTrackHeight(): string;
|
|
561
527
|
protected renderPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent | Object): void;
|
|
562
528
|
private checkCollision;
|
|
563
529
|
private getOffsetValue;
|
|
@@ -600,10 +566,10 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
600
566
|
*/
|
|
601
567
|
protected setEnabled(): void;
|
|
602
568
|
protected setOldText(text: string): void;
|
|
603
|
-
protected setOldValue(value: string | number | boolean): void;
|
|
569
|
+
protected setOldValue(value: string | number | boolean | object): void;
|
|
604
570
|
protected refreshPopup(): void;
|
|
605
571
|
protected checkData(newProp?: DropDownListModel): void;
|
|
606
|
-
protected updateDataSource(props?: DropDownListModel): void;
|
|
572
|
+
protected updateDataSource(props?: DropDownListModel, oldProps?: DropDownListModel): void;
|
|
607
573
|
protected checkCustomValue(): void;
|
|
608
574
|
private updateInputFields;
|
|
609
575
|
/**
|