@syncfusion/ej2-dropdowns 33.2.4 → 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.
@@ -928,6 +928,7 @@ let DropDownBase = class DropDownBase extends Component {
928
928
  this.isVirtualTrackHeight = false;
929
929
  this.virtualSelectAll = false;
930
930
  this.isVirtualReorder = false;
931
+ this.isVirtualOrder = false;
931
932
  this.incrementalQueryString = '';
932
933
  this.incrementalEndIndex = 0;
933
934
  this.incrementalStartIndex = 0;
@@ -2376,6 +2377,9 @@ let DropDownBase = class DropDownBase extends Component {
2376
2377
  if (this.getModuleName() === 'multiselect' && (this.virtualSelectAll && !isClearAll)) {
2377
2378
  this.virtualSelectAllData = listData;
2378
2379
  listData = listData.slice(this.virtualItemStartIndex, this.virtualItemEndIndex);
2380
+ if (this.virtualSelectAllData.length < (this.itemCount * 2) && this.isCheckBoxSelection && this.isVirtualOrder) {
2381
+ listData = this.virtualSelectAllData;
2382
+ }
2379
2383
  }
2380
2384
  ulElement = this.createListItems(listData, fields);
2381
2385
  if (this.isIncrementalRequest) {
@@ -2399,6 +2403,12 @@ let DropDownBase = class DropDownBase extends Component {
2399
2403
  else {
2400
2404
  virtualUlElement.appendChild(ulElement);
2401
2405
  }
2406
+ if (this.getModuleName() === 'multiselect' && this.isCheckBoxSelection && !this.appendUncheckList && this.isVirtualOrder) {
2407
+ const selectedUlElement = this.list.querySelector('.e-list-parent' + '.e-reorder');
2408
+ if (!isNullOrUndefined(selectedUlElement)) {
2409
+ virtualUlElement.removeChild(selectedUlElement);
2410
+ }
2411
+ }
2402
2412
  }
2403
2413
  this.updateListElements(listData);
2404
2414
  }
@@ -13817,7 +13827,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13817
13827
  if (isCheckbox) {
13818
13828
  const startindex = this.viewPortInfo.startIndex;
13819
13829
  const endindex = (((startindex + this.viewPortInfo.endIndex) <= (valuecheck.length)) &&
13820
- valuecheck[(startindex + this.viewPortInfo.endIndex)]) ? (startindex + this.viewPortInfo.endIndex)
13830
+ valuecheck[(startindex + this.viewPortInfo.endIndex)]) &&
13831
+ (this.dataSource instanceof DataManager && this.totalItemCount !== 0 && this.totalItemCount > (this.itemCount * 2))
13832
+ ? (startindex + this.viewPortInfo.endIndex)
13821
13833
  : (valuecheck.length);
13822
13834
  for (let i = startindex; i < endindex; i++) {
13823
13835
  const value = this.allowObjectBinding ? getValue((this.fields.value) ?
@@ -15581,6 +15593,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15581
15593
  if (!isNullOrUndefined(this.value)) {
15582
15594
  this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
15583
15595
  }
15596
+ const removedChipTitle = selectedElem.getAttribute('title');
15584
15597
  temp = selectedElem.nextElementSibling;
15585
15598
  if (temp !== null) {
15586
15599
  this.removeChipSelection();
@@ -15592,6 +15605,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15592
15605
  this.removeValue(currentChip, e);
15593
15606
  this.updateDelimeter(this.delimiterChar, e);
15594
15607
  this.makeTextBoxEmpty();
15608
+ if (removedChipTitle && this.chipAnnouncerLiveRegion) {
15609
+ const remainingCount = this.value ? this.value.length : 0;
15610
+ const announcement = `${removedChipTitle} removed from selection ${remainingCount} items selected`;
15611
+ this.chipAnnouncerLiveRegion.textContent = announcement;
15612
+ }
15595
15613
  }
15596
15614
  if (this.closePopupOnSelect) {
15597
15615
  this.hidePopup(e);
@@ -15783,6 +15801,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15783
15801
  const selectedChips = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1 + '.' + CHIP_SELECTED);
15784
15802
  if (selectedChips && selectedChips.length === 1) {
15785
15803
  selectedChips[0].removeAttribute('id');
15804
+ selectedChips[0].removeAttribute('aria-hidden');
15786
15805
  if (!isNullOrUndefined(this.inputElement) && this.inputElement.hasAttribute('aria-activedescendant')) {
15787
15806
  this.inputElement.removeAttribute('aria-activedescendant');
15788
15807
  if (!this.inputElement.hasAttribute('aria-describedby') && this.chipCollectionWrapper.id) {
@@ -15797,16 +15816,18 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15797
15816
  addClass([element], CHIP_SELECTED);
15798
15817
  if (element) {
15799
15818
  element.setAttribute('id', this.element.id + '_chip_item');
15819
+ element.setAttribute('aria-hidden', 'true');
15820
+ const chipTitle = element.getAttribute('title');
15821
+ if (chipTitle && this.chipAnnouncerLiveRegion) {
15822
+ const announcement = `${chipTitle} focused. Press Backspace to remove`;
15823
+ this.chipAnnouncerLiveRegion.textContent = announcement;
15824
+ }
15800
15825
  if (!isNullOrUndefined(this.inputElement) && element.id) {
15801
15826
  this.inputElement.setAttribute('aria-activedescendant', element.id);
15802
15827
  if (this.inputElement.hasAttribute('aria-describedby')) {
15803
15828
  this.inputElement.removeAttribute('aria-describedby');
15804
15829
  }
15805
15830
  }
15806
- const chipClose = element.querySelector('span.' + CHIP_CLOSE$1.split(' ')[0]);
15807
- if (chipClose) {
15808
- chipClose.removeAttribute('aria-hidden');
15809
- }
15810
15831
  }
15811
15832
  this.trigger('chipSelection', e);
15812
15833
  }
@@ -16284,15 +16305,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16284
16305
  const closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
16285
16306
  if (Browser.isDevice) {
16286
16307
  for (let index = 0; index < closeElements.length; index++) {
16287
- closeElements[index].setAttribute('aria-hidden', 'true');
16288
16308
  closeElements[index].style.display = 'none';
16289
16309
  }
16290
16310
  }
16291
- else {
16292
- for (let index = 0; index < closeElements.length; index++) {
16293
- closeElements[index].setAttribute('aria-hidden', 'true');
16294
- }
16295
- }
16296
16311
  }
16297
16312
  onMobileChipInteraction(e) {
16298
16313
  const chipElem = closest(e.target, '.' + CHIP$1);
@@ -16332,7 +16347,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16332
16347
  });
16333
16348
  let compiledString;
16334
16349
  const chipContent = this.createElement('span', { className: CHIP_CONTENT$1 });
16335
- const chipClose = this.createElement('span', { className: CHIP_CLOSE$1, attrs: { 'aria-label': 'delete', 'aria-hidden': 'true', 'tabindex': '-1' } });
16350
+ const chipClose = this.createElement('span', { className: CHIP_CLOSE$1, attrs: { 'aria-hidden': 'true' } });
16336
16351
  if (this.mainData) {
16337
16352
  itemData = this.getDataByValue(value);
16338
16353
  }
@@ -16599,6 +16614,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16599
16614
  }, targetExitViewport: () => {
16600
16615
  if (!Browser.isDevice) {
16601
16616
  this.hidePopup();
16617
+ let previousValue = this.tempValues;
16618
+ if (isNullOrUndefined(previousValue)) {
16619
+ previousValue = [];
16620
+ }
16621
+ this.updateValueState(this.scrollEvent, this.value, previousValue);
16602
16622
  }
16603
16623
  }
16604
16624
  });
@@ -16879,6 +16899,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16879
16899
  EventHandler.add(this.componentWrapper, 'mouseout', this.mouseOut, this);
16880
16900
  EventHandler.add(this.overAllClear, 'mousedown', this.clearAll, this);
16881
16901
  EventHandler.add(this.inputElement, 'paste', this.pasteHandler, this);
16902
+ EventHandler.add(document, 'wheel', this.onWheelScroll, this);
16903
+ EventHandler.add(document, 'scroll', this.onWheelScroll, this);
16882
16904
  }
16883
16905
  onInput(e) {
16884
16906
  if (this.keyDownStatus) {
@@ -16893,6 +16915,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16893
16915
  this.search(e);
16894
16916
  }
16895
16917
  }
16918
+ onWheelScroll(e) {
16919
+ this.scrollEvent = e;
16920
+ }
16896
16921
  pasteHandler(event) {
16897
16922
  setTimeout(() => {
16898
16923
  this.expandTextbox();
@@ -17378,7 +17403,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17378
17403
  else {
17379
17404
  this.updateDelimeter(this.delimiterChar, null, isInitialVirtualData);
17380
17405
  }
17381
- if (this.mode === 'CheckBox' && this.showSelectAll && (isNullOrUndefined(this.value) || !this.value.length)) {
17406
+ if (this.mode === 'CheckBox' && this.showSelectAll && (isNullOrUndefined(this.value) || !this.value.length || (this.value.length !== this.listData.length))) {
17382
17407
  this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });
17383
17408
  }
17384
17409
  if (this.mode === 'Box' || (this.mode === 'Default' && this.inputFocus)) {
@@ -18195,6 +18220,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18195
18220
  if (!isNullOrUndefined(this.inputElement)) {
18196
18221
  EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
18197
18222
  }
18223
+ EventHandler.remove(document, 'wheel', this.onWheelScroll);
18224
+ EventHandler.remove(document, 'scroll', this.onWheelScroll);
18198
18225
  }
18199
18226
  resizingWireEvent() {
18200
18227
  // Mouse events
@@ -18506,12 +18533,18 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18506
18533
  this.virtualSelectAllState = state;
18507
18534
  this.virtualSelectAll = true;
18508
18535
  this.CurrentEvent = event;
18536
+ 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) {
18537
+ this.isVirtualOrder = true;
18538
+ }
18509
18539
  if (!this.virtualSelectAllData) {
18510
18540
  this.resetList(this.dataSource, this.fields, new Query());
18511
18541
  }
18512
18542
  if (this.virtualSelectAllData) {
18513
18543
  this.virtualSelectionAll(state, li, event);
18514
18544
  }
18545
+ 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) {
18546
+ this.isVirtualOrder = false;
18547
+ }
18515
18548
  }
18516
18549
  else {
18517
18550
  while (index < length && index <= 50 && index < count) {
@@ -18807,7 +18840,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18807
18840
  if (this.fields.disabled) {
18808
18841
  this.removeDisabledItemsValue(this.value);
18809
18842
  }
18810
- this.updateVal(this.value, oldProp.value, 'value');
18843
+ this.updateVal(this.value, oldProp.value, 'value', this.enableVirtualization);
18811
18844
  this.addValidInputClass();
18812
18845
  if (!this.closePopupOnSelect && this.isPopupOpen()) {
18813
18846
  this.refreshPopup();
@@ -19002,8 +19035,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19002
19035
  this.updateActionList(ulElement, list, event);
19003
19036
  });
19004
19037
  }
19005
- updateVal(newProp, oldProp, prop) {
19006
- if (!this.list) {
19038
+ updateVal(newProp, oldProp, prop, isVirtual = false) {
19039
+ if (!this.list || (isVirtual && prop === 'value' && ((isNullOrUndefined(oldProp) && !isNullOrUndefined(newProp)) || (!isNullOrUndefined(oldProp) && isNullOrUndefined(newProp)) || (this.validateValues(newProp, oldProp) && newProp.length > 0)))) {
19007
19040
  this.onLoadSelect();
19008
19041
  if (this.enableVirtualization) {
19009
19042
  this.setProperties({ text: '' }, true);
@@ -19523,6 +19556,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19523
19556
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
19524
19557
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
19525
19558
  }
19559
+ if (!this.chipAnnouncerLiveRegion) {
19560
+ this.chipAnnouncerLiveRegion = this.createElement('div', {
19561
+ attrs: { 'aria-live': 'polite', 'aria-atomic': 'true', 'class': 'e-chip-announcer' }
19562
+ });
19563
+ this.chipAnnouncerLiveRegion.style.position = 'absolute';
19564
+ this.chipAnnouncerLiveRegion.style.left = '-10000px';
19565
+ this.componentWrapper.appendChild(this.chipAnnouncerLiveRegion);
19566
+ }
19526
19567
  this.renderComplete();
19527
19568
  }
19528
19569
  setResize() {
@@ -20141,6 +20182,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
20141
20182
  this.mainListCollection = null;
20142
20183
  this.footer = null;
20143
20184
  this.selectAllEventEle = null;
20185
+ this.chipAnnouncerLiveRegion = null;
20144
20186
  super.destroy();
20145
20187
  }
20146
20188
  };