@syncfusion/ej2-dropdowns 33.2.3 → 33.2.5

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.
@@ -1006,6 +1006,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1006
1006
  _this.isVirtualTrackHeight = false;
1007
1007
  _this.virtualSelectAll = false;
1008
1008
  _this.isVirtualReorder = false;
1009
+ _this.isVirtualOrder = false;
1009
1010
  _this.incrementalQueryString = '';
1010
1011
  _this.incrementalEndIndex = 0;
1011
1012
  _this.incrementalStartIndex = 0;
@@ -2464,6 +2465,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2464
2465
  if (this.getModuleName() === 'multiselect' && (this.virtualSelectAll && !isClearAll)) {
2465
2466
  this.virtualSelectAllData = listData;
2466
2467
  listData = listData.slice(this.virtualItemStartIndex, this.virtualItemEndIndex);
2468
+ if (this.virtualSelectAllData.length < (this.itemCount * 2) && this.isCheckBoxSelection && this.isVirtualOrder) {
2469
+ listData = this.virtualSelectAllData;
2470
+ }
2467
2471
  }
2468
2472
  ulElement = this.createListItems(listData, fields);
2469
2473
  if (this.isIncrementalRequest) {
@@ -2487,6 +2491,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2487
2491
  else {
2488
2492
  virtualUlElement.appendChild(ulElement);
2489
2493
  }
2494
+ if (this.getModuleName() === 'multiselect' && this.isCheckBoxSelection && !this.appendUncheckList && this.isVirtualOrder) {
2495
+ var selectedUlElement = this.list.querySelector('.e-list-parent' + '.e-reorder');
2496
+ if (!isNullOrUndefined(selectedUlElement)) {
2497
+ virtualUlElement.removeChild(selectedUlElement);
2498
+ }
2499
+ }
2490
2500
  }
2491
2501
  this.updateListElements(listData);
2492
2502
  }
@@ -10006,6 +10016,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
10006
10016
  removeClass([this.popupDiv], NODATA);
10007
10017
  this.hideCheckAll(false);
10008
10018
  }
10019
+ else {
10020
+ this.hideCheckAll(this.treeItems.length <= 1);
10021
+ }
10009
10022
  if (!this.isFilteredData) {
10010
10023
  this.treeDataType = this.getTreeDataType(this.treeItems, this.fields);
10011
10024
  }
@@ -11420,6 +11433,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
11420
11433
  EventHandler.remove(element, 'mouseup', this.removeChip);
11421
11434
  }
11422
11435
  }
11436
+ if (this.keyboardModule) {
11437
+ this.keyboardModule.destroy();
11438
+ }
11423
11439
  this.chipWrapper = null;
11424
11440
  this.chipCollection = null;
11425
11441
  this.checkAllParent = null;
@@ -14069,7 +14085,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14069
14085
  if (isCheckbox) {
14070
14086
  var startindex = this.viewPortInfo.startIndex;
14071
14087
  var endindex = (((startindex + this.viewPortInfo.endIndex) <= (valuecheck.length)) &&
14072
- valuecheck[(startindex + this.viewPortInfo.endIndex)]) ? (startindex + this.viewPortInfo.endIndex)
14088
+ valuecheck[(startindex + this.viewPortInfo.endIndex)]) &&
14089
+ (this.dataSource instanceof DataManager && this.totalItemCount !== 0 && this.totalItemCount > (this.itemCount * 2))
14090
+ ? (startindex + this.viewPortInfo.endIndex)
14073
14091
  : (valuecheck.length);
14074
14092
  for (var i = startindex; i < endindex; i++) {
14075
14093
  var value = this.allowObjectBinding ? getValue((this.fields.value) ?
@@ -15839,6 +15857,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15839
15857
  if (!isNullOrUndefined(this.value)) {
15840
15858
  this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
15841
15859
  }
15860
+ var removedChipTitle = selectedElem.getAttribute('title');
15842
15861
  temp = selectedElem.nextElementSibling;
15843
15862
  if (temp !== null) {
15844
15863
  this.removeChipSelection();
@@ -15850,6 +15869,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15850
15869
  this.removeValue(currentChip, e);
15851
15870
  this.updateDelimeter(this.delimiterChar, e);
15852
15871
  this.makeTextBoxEmpty();
15872
+ if (removedChipTitle && this.chipAnnouncerLiveRegion) {
15873
+ var remainingCount = this.value ? this.value.length : 0;
15874
+ var announcement = removedChipTitle + " removed from selection " + remainingCount + " items selected";
15875
+ this.chipAnnouncerLiveRegion.textContent = announcement;
15876
+ }
15853
15877
  }
15854
15878
  if (this.closePopupOnSelect) {
15855
15879
  this.hidePopup(e);
@@ -16042,6 +16066,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16042
16066
  var selectedChips = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1 + '.' + CHIP_SELECTED);
16043
16067
  if (selectedChips && selectedChips.length === 1) {
16044
16068
  selectedChips[0].removeAttribute('id');
16069
+ selectedChips[0].removeAttribute('aria-hidden');
16045
16070
  if (!isNullOrUndefined(this.inputElement) && this.inputElement.hasAttribute('aria-activedescendant')) {
16046
16071
  this.inputElement.removeAttribute('aria-activedescendant');
16047
16072
  if (!this.inputElement.hasAttribute('aria-describedby') && this.chipCollectionWrapper.id) {
@@ -16056,16 +16081,18 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16056
16081
  addClass([element], CHIP_SELECTED);
16057
16082
  if (element) {
16058
16083
  element.setAttribute('id', this.element.id + '_chip_item');
16084
+ element.setAttribute('aria-hidden', 'true');
16085
+ var chipTitle = element.getAttribute('title');
16086
+ if (chipTitle && this.chipAnnouncerLiveRegion) {
16087
+ var announcement = chipTitle + " focused. Press Backspace to remove";
16088
+ this.chipAnnouncerLiveRegion.textContent = announcement;
16089
+ }
16059
16090
  if (!isNullOrUndefined(this.inputElement) && element.id) {
16060
16091
  this.inputElement.setAttribute('aria-activedescendant', element.id);
16061
16092
  if (this.inputElement.hasAttribute('aria-describedby')) {
16062
16093
  this.inputElement.removeAttribute('aria-describedby');
16063
16094
  }
16064
16095
  }
16065
- var chipClose = element.querySelector('span.' + CHIP_CLOSE$1.split(' ')[0]);
16066
- if (chipClose) {
16067
- chipClose.removeAttribute('aria-hidden');
16068
- }
16069
16096
  }
16070
16097
  this.trigger('chipSelection', e);
16071
16098
  };
@@ -16552,15 +16579,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16552
16579
  var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
16553
16580
  if (Browser.isDevice) {
16554
16581
  for (var index = 0; index < closeElements.length; index++) {
16555
- closeElements[index].setAttribute('aria-hidden', 'true');
16556
16582
  closeElements[index].style.display = 'none';
16557
16583
  }
16558
16584
  }
16559
- else {
16560
- for (var index = 0; index < closeElements.length; index++) {
16561
- closeElements[index].setAttribute('aria-hidden', 'true');
16562
- }
16563
- }
16564
16585
  };
16565
16586
  MultiSelect.prototype.onMobileChipInteraction = function (e) {
16566
16587
  var chipElem = closest(e.target, '.' + CHIP$1);
@@ -16601,7 +16622,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16601
16622
  });
16602
16623
  var compiledString;
16603
16624
  var chipContent = this.createElement('span', { className: CHIP_CONTENT$1 });
16604
- var chipClose = this.createElement('span', { className: CHIP_CLOSE$1, attrs: { 'aria-label': 'delete', 'aria-hidden': 'true', 'tabindex': '-1' } });
16625
+ var chipClose = this.createElement('span', { className: CHIP_CLOSE$1, attrs: { 'aria-hidden': 'true' } });
16605
16626
  if (this.mainData) {
16606
16627
  itemData = this.getDataByValue(value);
16607
16628
  }
@@ -16869,6 +16890,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16869
16890
  }, targetExitViewport: function () {
16870
16891
  if (!Browser.isDevice) {
16871
16892
  _this.hidePopup();
16893
+ var previousValue = _this.tempValues;
16894
+ if (isNullOrUndefined(previousValue)) {
16895
+ previousValue = [];
16896
+ }
16897
+ _this.updateValueState(_this.scrollEvent, _this.value, previousValue);
16872
16898
  }
16873
16899
  }
16874
16900
  });
@@ -17149,6 +17175,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17149
17175
  EventHandler.add(this.componentWrapper, 'mouseout', this.mouseOut, this);
17150
17176
  EventHandler.add(this.overAllClear, 'mousedown', this.clearAll, this);
17151
17177
  EventHandler.add(this.inputElement, 'paste', this.pasteHandler, this);
17178
+ EventHandler.add(document, 'wheel', this.onWheelScroll, this);
17179
+ EventHandler.add(document, 'scroll', this.onWheelScroll, this);
17152
17180
  };
17153
17181
  MultiSelect.prototype.onInput = function (e) {
17154
17182
  if (this.keyDownStatus) {
@@ -17163,6 +17191,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17163
17191
  this.search(e);
17164
17192
  }
17165
17193
  };
17194
+ MultiSelect.prototype.onWheelScroll = function (e) {
17195
+ this.scrollEvent = e;
17196
+ };
17166
17197
  MultiSelect.prototype.pasteHandler = function (event) {
17167
17198
  var _this = this;
17168
17199
  setTimeout(function () {
@@ -17659,7 +17690,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17659
17690
  else {
17660
17691
  this.updateDelimeter(this.delimiterChar, null, isInitialVirtualData);
17661
17692
  }
17662
- if (this.mode === 'CheckBox' && this.showSelectAll && (isNullOrUndefined(this.value) || !this.value.length)) {
17693
+ if (this.mode === 'CheckBox' && this.showSelectAll && (isNullOrUndefined(this.value) || !this.value.length || (this.value.length !== this.listData.length))) {
17663
17694
  this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });
17664
17695
  }
17665
17696
  if (this.mode === 'Box' || (this.mode === 'Default' && this.inputFocus)) {
@@ -18478,6 +18509,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18478
18509
  if (!isNullOrUndefined(this.inputElement)) {
18479
18510
  EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
18480
18511
  }
18512
+ EventHandler.remove(document, 'wheel', this.onWheelScroll);
18513
+ EventHandler.remove(document, 'scroll', this.onWheelScroll);
18481
18514
  };
18482
18515
  MultiSelect.prototype.resizingWireEvent = function () {
18483
18516
  // Mouse events
@@ -18791,12 +18824,18 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18791
18824
  this.virtualSelectAllState = state;
18792
18825
  this.virtualSelectAll = true;
18793
18826
  this.CurrentEvent = event;
18827
+ if (this.mode === 'CheckBox' && this.value && Array.isArray(this.value) && this.value.length > 0 && this.enableSelectionOrder && this.targetElement().trim() === '' && this.viewPortInfo.startIndex < this.value.length) {
18828
+ this.isVirtualOrder = true;
18829
+ }
18794
18830
  if (!this.virtualSelectAllData) {
18795
18831
  this.resetList(this.dataSource, this.fields, new Query());
18796
18832
  }
18797
18833
  if (this.virtualSelectAllData) {
18798
18834
  this.virtualSelectionAll(state, li, event);
18799
18835
  }
18836
+ if (this.mode === 'CheckBox' && this.value && Array.isArray(this.value) && this.value.length > 0 && this.enableSelectionOrder && this.targetElement().trim() === '' && this.viewPortInfo.startIndex < this.value.length) {
18837
+ this.isVirtualOrder = false;
18838
+ }
18800
18839
  }
18801
18840
  else {
18802
18841
  while (index < length && index <= 50 && index < count) {
@@ -19095,7 +19134,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19095
19134
  if (this.fields.disabled) {
19096
19135
  this.removeDisabledItemsValue(this.value);
19097
19136
  }
19098
- this.updateVal(this.value, oldProp.value, 'value');
19137
+ this.updateVal(this.value, oldProp.value, 'value', this.enableVirtualization);
19099
19138
  this.addValidInputClass();
19100
19139
  if (!this.closePopupOnSelect && this.isPopupOpen()) {
19101
19140
  this.refreshPopup();
@@ -19291,9 +19330,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19291
19330
  _this.updateActionList(ulElement, list, event);
19292
19331
  });
19293
19332
  };
19294
- MultiSelect.prototype.updateVal = function (newProp, oldProp, prop) {
19333
+ MultiSelect.prototype.updateVal = function (newProp, oldProp, prop, isVirtual) {
19295
19334
  var _this = this;
19296
- if (!this.list) {
19335
+ if (isVirtual === void 0) { isVirtual = false; }
19336
+ if (!this.list || (isVirtual && prop === 'value' && ((isNullOrUndefined(oldProp) && !isNullOrUndefined(newProp)) || (!isNullOrUndefined(oldProp) && isNullOrUndefined(newProp)) || (this.validateValues(newProp, oldProp) && newProp.length > 0)))) {
19297
19337
  this.onLoadSelect();
19298
19338
  if (this.enableVirtualization) {
19299
19339
  this.setProperties({ text: '' }, true);
@@ -19817,6 +19857,14 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19817
19857
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
19818
19858
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
19819
19859
  }
19860
+ if (!this.chipAnnouncerLiveRegion) {
19861
+ this.chipAnnouncerLiveRegion = this.createElement('div', {
19862
+ attrs: { 'aria-live': 'polite', 'aria-atomic': 'true', 'class': 'e-chip-announcer' }
19863
+ });
19864
+ this.chipAnnouncerLiveRegion.style.position = 'absolute';
19865
+ this.chipAnnouncerLiveRegion.style.left = '-10000px';
19866
+ this.componentWrapper.appendChild(this.chipAnnouncerLiveRegion);
19867
+ }
19820
19868
  this.renderComplete();
19821
19869
  };
19822
19870
  MultiSelect.prototype.setResize = function () {
@@ -20068,7 +20116,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
20068
20116
  });
20069
20117
  }
20070
20118
  else {
20071
- listItems_3 = new DataManager(this.dataSource).executeLocal(new Query().where(predicate));
20119
+ listItems_3 = this.executeLocalForLargeSelection(this.dataSource, this.value, {
20120
+ fields: this.fields,
20121
+ allowObjectBinding: this.allowObjectBinding,
20122
+ isPrimitiveData: this.isPrimitiveData
20123
+ });
20072
20124
  }
20073
20125
  }
20074
20126
  if (!(this.dataSource instanceof DataManager)) {
@@ -20097,6 +20149,55 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
20097
20149
  this.element.setAttribute('data-initial-value', this.text);
20098
20150
  }
20099
20151
  };
20152
+ MultiSelect.prototype.executeLocalForLargeSelection = function (dataSource, values, options) {
20153
+ if (!dataSource || !dataSource.length || !values || !values.length) {
20154
+ return [];
20155
+ }
20156
+ var fields = options.fields, allowObjectBinding = options.allowObjectBinding, isPrimitiveData = options.isPrimitiveData, _a = options.predicateChunkSize, predicateChunkSize = _a === void 0 ? 100 : _a;
20157
+ if (values.length === dataSource.length) {
20158
+ return dataSource.slice();
20159
+ }
20160
+ var field = isPrimitiveData ? '' : fields.value;
20161
+ var allResults = [];
20162
+ var predicate = null;
20163
+ var count = 0;
20164
+ var flushPredicate = function () {
20165
+ if (!predicate) {
20166
+ return;
20167
+ }
20168
+ var query = new Query().where(predicate);
20169
+ var result = new DataManager(dataSource).executeLocal(query);
20170
+ allResults.push.apply(allResults, result);
20171
+ predicate = null;
20172
+ count = 0;
20173
+ };
20174
+ for (var i = 0; i < values.length; i++) {
20175
+ var value = allowObjectBinding
20176
+ ? getValue(fields.value || '', values[i])
20177
+ : values[i];
20178
+ predicate = predicate
20179
+ ? predicate.or(field, 'equal', value)
20180
+ : new Predicate(field, 'equal', value);
20181
+ count++;
20182
+ if (count === predicateChunkSize) {
20183
+ flushPredicate();
20184
+ }
20185
+ }
20186
+ flushPredicate();
20187
+ var uniqueMap = {};
20188
+ var resultArray = [];
20189
+ for (var i = 0; i < allResults.length; i++) {
20190
+ var item = allResults[i];
20191
+ var key = isPrimitiveData
20192
+ ? item.toString()
20193
+ : getValue(fields.value, item);
20194
+ if (!uniqueMap.hasOwnProperty(key)) {
20195
+ uniqueMap[key] = item;
20196
+ resultArray.push(item);
20197
+ }
20198
+ }
20199
+ return resultArray;
20200
+ };
20100
20201
  MultiSelect.prototype.checkAutoFocus = function () {
20101
20202
  if (this.element.hasAttribute('autofocus')) {
20102
20203
  this.inputElement.focus();
@@ -20385,6 +20486,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
20385
20486
  this.mainListCollection = null;
20386
20487
  this.footer = null;
20387
20488
  this.selectAllEventEle = null;
20489
+ this.chipAnnouncerLiveRegion = null;
20388
20490
  _super.prototype.destroy.call(this);
20389
20491
  };
20390
20492
  __decorate$5([
@@ -24358,7 +24460,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
24358
24460
  }
24359
24461
  else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
24360
24462
  e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) ||
24361
- (this.liCollections && this.liCollections.length > 0))) {
24463
+ ((this.liCollections && this.liCollections.length > 0) || (this.isPopupOpen && this.list && this.list.classList.contains('e-nodata'))))) {
24362
24464
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
24363
24465
  this.searchLists(e);
24364
24466
  }