@syncfusion/ej2-dropdowns 25.1.39 → 25.1.40

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.
@@ -10040,7 +10040,7 @@ let ComboBox = class ComboBox extends DropDownList {
10040
10040
  }
10041
10041
  }
10042
10042
  setValue(e) {
10043
- if (e && e.type === 'keydown' && e.action === 'enter') {
10043
+ if ((e && e.type === 'keydown' && e.action === 'enter') || (e && e.type === 'click')) {
10044
10044
  this.removeFillSelection();
10045
10045
  }
10046
10046
  if (this.autofill && this.getModuleName() === 'combobox' && e && e.type === 'keydown' && e.action !== 'enter') {
@@ -17849,12 +17849,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
17849
17849
  else {
17850
17850
  scrollParent = wrapper;
17851
17851
  }
17852
- boundRect = scrollParent.getBoundingClientRect();
17853
- if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
17854
- this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
17855
- }
17856
- else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
17857
- this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
17852
+ if (scrollParent) {
17853
+ boundRect = scrollParent.getBoundingClientRect();
17854
+ if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
17855
+ this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
17856
+ }
17857
+ else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
17858
+ this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
17859
+ }
17858
17860
  }
17859
17861
  }
17860
17862
  if (args.target === null) {
@@ -18272,6 +18274,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18272
18274
  if (this.listData.length === 0) {
18273
18275
  this.l10nUpdate();
18274
18276
  }
18277
+ if (this.listData.length !== this.sortedData.length) {
18278
+ this.sortedData = this.listData;
18279
+ }
18275
18280
  this.value = [];
18276
18281
  this.updateToolBarState();
18277
18282
  }
@@ -18980,6 +18985,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18980
18985
  const jsonData = [].slice.call(tListBox.jsonData);
18981
18986
  const isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
18982
18987
  fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
18988
+ const tempLiColl = [];
18989
+ const tempData = [];
18990
+ let flistboxarray = [];
18983
18991
  this.removeSelected(fListBox, fListBox.getSelectedItems());
18984
18992
  const tempItems = [].slice.call(fListBox.listData);
18985
18993
  const localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
@@ -18999,23 +19007,40 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18999
19007
  fListBox.ulElement.removeChild(noRecElem);
19000
19008
  }
19001
19009
  }
19002
- moveTo(fListBox.ulElement, tListBox.ulElement,
19003
- // eslint-disable-next-line prefer-spread
19004
- Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number), index);
19010
+ if (fListBox.listData.length > 0) {
19011
+ // eslint-disable-next-line prefer-spread
19012
+ flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
19013
+ }
19014
+ for (let i = 0; i < fListBox.ulElement.childElementCount; i++) {
19015
+ if (fListBox.ulElement.childNodes[i].classList.contains('e-disabled')) {
19016
+ flistboxarray = flistboxarray.filter(function (item) { return item !== i; });
19017
+ tempLiColl.push(fListBox.ulElement.childNodes[i]);
19018
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19019
+ tempData.push(fListBox.listData[i]);
19020
+ }
19021
+ }
19022
+ moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
19005
19023
  this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
19006
19024
  if (isKey) {
19007
19025
  this.list.focus();
19008
19026
  }
19009
19027
  index = (index) ? index : listData.length;
19010
- for (let i = 0; i < fListBox.listData.length; i++) {
19011
- listData.splice(index + i, 0, fListBox.listData[i]);
19028
+ for (let i = 0; i < flistboxarray.length; i++) {
19029
+ listData.splice(index + i, 0, fListBox.listData[flistboxarray[i]]);
19012
19030
  }
19013
- for (let i = 0; i < fListBox.jsonData.length; i++) {
19014
- jsonData.splice(index + i, 0, fListBox.jsonData[i]);
19031
+ for (let i = 0; i < flistboxarray.length; i++) {
19032
+ jsonData.splice(index + i, 0, fListBox.jsonData[flistboxarray[i]]);
19033
+ }
19034
+ let fliCollections = [];
19035
+ if (tempLiColl.length > 0) {
19036
+ fListBox.liCollections = tempLiColl;
19037
+ fliCollections = [].slice.call(fListBox.liCollections);
19038
+ }
19039
+ else {
19040
+ fliCollections = [].slice.call(fListBox.liCollections);
19041
+ fListBox.liCollections = [];
19015
19042
  }
19016
- const fliCollections = [].slice.call(fListBox.liCollections);
19017
19043
  const tliCollections = [].slice.call(tListBox.liCollections);
19018
- fListBox.liCollections = [];
19019
19044
  if (index) {
19020
19045
  const toColl = tliCollections.splice(0, index);
19021
19046
  tListBox.liCollections = toColl.concat(fliCollections).concat(tliCollections);
@@ -19035,7 +19060,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19035
19060
  }
19036
19061
  tListBox.listData = listData;
19037
19062
  if (fListBox.listData.length === fListBox.jsonData.length) {
19038
- fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
19063
+ fListBox.listData = fListBox.sortedData = fListBox.jsonData = tempData;
19039
19064
  }
19040
19065
  else if (fListBox.allowFiltering) {
19041
19066
  for (let i = 0; i < fListBox.listData.length; i++) {
@@ -19056,6 +19081,11 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19056
19081
  tListBox.sortedData = listData;
19057
19082
  }
19058
19083
  fListBox.updateSelectedOptions();
19084
+ if (tempLiColl.length > 0) {
19085
+ const wrap = this.list.parentElement.getElementsByClassName('e-listbox-tool')[0];
19086
+ const btn = wrap.querySelector('[data-value="' + this.toolbarAction + '"]');
19087
+ btn.disabled = true;
19088
+ }
19059
19089
  if (fListBox.listData.length === 0) {
19060
19090
  fListBox.l10nUpdate();
19061
19091
  }
@@ -19274,6 +19304,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19274
19304
  if (!args.cancel && !this.isCustomFiltering && !args.preventDefaultAction) {
19275
19305
  this.inputString = this.filterInput.value;
19276
19306
  this.filteringAction(this.jsonData, new Query(), this.fields);
19307
+ if (this.toolbarSettings.items.length > 0) {
19308
+ this.updateToolBarState();
19309
+ }
19277
19310
  }
19278
19311
  if (!this.isFiltered && !this.isCustomFiltering && !args.preventDefaultAction) {
19279
19312
  this.dataUpdater(this.jsonData, new Query(), this.fields);