@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.
@@ -10234,7 +10234,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
10234
10234
  }
10235
10235
  };
10236
10236
  ComboBox.prototype.setValue = function (e) {
10237
- if (e && e.type === 'keydown' && e.action === 'enter') {
10237
+ if ((e && e.type === 'keydown' && e.action === 'enter') || (e && e.type === 'click')) {
10238
10238
  this.removeFillSelection();
10239
10239
  }
10240
10240
  if (this.autofill && this.getModuleName() === 'combobox' && e && e.type === 'keydown' && e.action !== 'enter') {
@@ -18146,12 +18146,14 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
18146
18146
  else {
18147
18147
  scrollParent = wrapper;
18148
18148
  }
18149
- boundRect = scrollParent.getBoundingClientRect();
18150
- if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
18151
- this.timer = window.setInterval(function () { _this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
18152
- }
18153
- else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
18154
- this.timer = window.setInterval(function () { _this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
18149
+ if (scrollParent) {
18150
+ boundRect = scrollParent.getBoundingClientRect();
18151
+ if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
18152
+ this.timer = window.setInterval(function () { _this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
18153
+ }
18154
+ else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
18155
+ this.timer = window.setInterval(function () { _this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
18156
+ }
18155
18157
  }
18156
18158
  }
18157
18159
  if (args.target === null) {
@@ -18574,6 +18576,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
18574
18576
  if (this.listData.length === 0) {
18575
18577
  this.l10nUpdate();
18576
18578
  }
18579
+ if (this.listData.length !== this.sortedData.length) {
18580
+ this.sortedData = this.listData;
18581
+ }
18577
18582
  this.value = [];
18578
18583
  this.updateToolBarState();
18579
18584
  };
@@ -19296,6 +19301,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
19296
19301
  var jsonData = [].slice.call(tListBox.jsonData);
19297
19302
  var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
19298
19303
  fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
19304
+ var tempLiColl = [];
19305
+ var tempData = [];
19306
+ var flistboxarray = [];
19299
19307
  this.removeSelected(fListBox, fListBox.getSelectedItems());
19300
19308
  var tempItems = [].slice.call(fListBox.listData);
19301
19309
  var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
@@ -19315,23 +19323,43 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
19315
19323
  fListBox.ulElement.removeChild(noRecElem);
19316
19324
  }
19317
19325
  }
19318
- moveTo(fListBox.ulElement, tListBox.ulElement,
19319
- // eslint-disable-next-line prefer-spread
19320
- Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number), index);
19326
+ if (fListBox.listData.length > 0) {
19327
+ // eslint-disable-next-line prefer-spread
19328
+ flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
19329
+ }
19330
+ var _loop_3 = function (i) {
19331
+ if (fListBox.ulElement.childNodes[i].classList.contains('e-disabled')) {
19332
+ flistboxarray = flistboxarray.filter(function (item) { return item !== i; });
19333
+ tempLiColl.push(fListBox.ulElement.childNodes[i]);
19334
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19335
+ tempData.push(fListBox.listData[i]);
19336
+ }
19337
+ };
19338
+ for (var i = 0; i < fListBox.ulElement.childElementCount; i++) {
19339
+ _loop_3(i);
19340
+ }
19341
+ moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
19321
19342
  this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
19322
19343
  if (isKey) {
19323
19344
  this.list.focus();
19324
19345
  }
19325
19346
  index = (index) ? index : listData.length;
19326
- for (var i = 0; i < fListBox.listData.length; i++) {
19327
- listData.splice(index + i, 0, fListBox.listData[i]);
19347
+ for (var i = 0; i < flistboxarray.length; i++) {
19348
+ listData.splice(index + i, 0, fListBox.listData[flistboxarray[i]]);
19328
19349
  }
19329
- for (var i = 0; i < fListBox.jsonData.length; i++) {
19330
- jsonData.splice(index + i, 0, fListBox.jsonData[i]);
19350
+ for (var i = 0; i < flistboxarray.length; i++) {
19351
+ jsonData.splice(index + i, 0, fListBox.jsonData[flistboxarray[i]]);
19352
+ }
19353
+ var fliCollections = [];
19354
+ if (tempLiColl.length > 0) {
19355
+ fListBox.liCollections = tempLiColl;
19356
+ fliCollections = [].slice.call(fListBox.liCollections);
19357
+ }
19358
+ else {
19359
+ fliCollections = [].slice.call(fListBox.liCollections);
19360
+ fListBox.liCollections = [];
19331
19361
  }
19332
- var fliCollections = [].slice.call(fListBox.liCollections);
19333
19362
  var tliCollections = [].slice.call(tListBox.liCollections);
19334
- fListBox.liCollections = [];
19335
19363
  if (index) {
19336
19364
  var toColl = tliCollections.splice(0, index);
19337
19365
  tListBox.liCollections = toColl.concat(fliCollections).concat(tliCollections);
@@ -19351,7 +19379,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
19351
19379
  }
19352
19380
  tListBox.listData = listData;
19353
19381
  if (fListBox.listData.length === fListBox.jsonData.length) {
19354
- fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
19382
+ fListBox.listData = fListBox.sortedData = fListBox.jsonData = tempData;
19355
19383
  }
19356
19384
  else if (fListBox.allowFiltering) {
19357
19385
  for (var i = 0; i < fListBox.listData.length; i++) {
@@ -19372,6 +19400,11 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
19372
19400
  tListBox.sortedData = listData;
19373
19401
  }
19374
19402
  fListBox.updateSelectedOptions();
19403
+ if (tempLiColl.length > 0) {
19404
+ var wrap = this.list.parentElement.getElementsByClassName('e-listbox-tool')[0];
19405
+ var btn = wrap.querySelector('[data-value="' + this.toolbarAction + '"]');
19406
+ btn.disabled = true;
19407
+ }
19375
19408
  if (fListBox.listData.length === 0) {
19376
19409
  fListBox.l10nUpdate();
19377
19410
  }
@@ -19592,6 +19625,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
19592
19625
  if (!args.cancel && !_this.isCustomFiltering && !args.preventDefaultAction) {
19593
19626
  _this.inputString = _this.filterInput.value;
19594
19627
  _this.filteringAction(_this.jsonData, new Query(), _this.fields);
19628
+ if (_this.toolbarSettings.items.length > 0) {
19629
+ _this.updateToolBarState();
19630
+ }
19595
19631
  }
19596
19632
  if (!_this.isFiltered && !_this.isCustomFiltering && !args.preventDefaultAction) {
19597
19633
  _this.dataUpdater(_this.jsonData, new Query(), _this.fields);