@syncfusion/ej2-lists 25.1.41 → 26.1.35-750253

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.
Files changed (105) hide show
  1. package/.eslintrc.json +3 -2
  2. package/dist/ej2-lists.min.js +2 -2
  3. package/dist/ej2-lists.umd.min.js +2 -2
  4. package/dist/ej2-lists.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-lists.es2015.js +255 -279
  6. package/dist/es6/ej2-lists.es2015.js.map +1 -1
  7. package/dist/es6/ej2-lists.es5.js +241 -265
  8. package/dist/es6/ej2-lists.es5.js.map +1 -1
  9. package/dist/global/ej2-lists.min.js +2 -2
  10. package/dist/global/ej2-lists.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +10 -10
  13. package/src/common/list-base.d.ts +61 -30
  14. package/src/common/list-base.js +167 -94
  15. package/src/list-view/list-view.d.ts +7 -9
  16. package/src/list-view/list-view.js +42 -75
  17. package/src/list-view/virtualization.d.ts +0 -1
  18. package/src/list-view/virtualization.js +10 -66
  19. package/src/sortable/sortable.d.ts +5 -0
  20. package/src/sortable/sortable.js +14 -7
  21. package/styles/bootstrap-dark.css +100 -122
  22. package/styles/bootstrap-dark.scss +8 -2
  23. package/styles/bootstrap.css +100 -122
  24. package/styles/bootstrap.scss +8 -2
  25. package/styles/bootstrap4.css +139 -161
  26. package/styles/bootstrap4.scss +8 -2
  27. package/styles/bootstrap5-dark.css +101 -125
  28. package/styles/bootstrap5-dark.scss +8 -2
  29. package/styles/bootstrap5.css +101 -125
  30. package/styles/bootstrap5.scss +8 -2
  31. package/styles/fabric-dark.css +100 -122
  32. package/styles/fabric-dark.scss +8 -2
  33. package/styles/fabric.css +100 -122
  34. package/styles/fabric.scss +8 -2
  35. package/styles/fluent-dark.css +143 -165
  36. package/styles/fluent-dark.scss +8 -2
  37. package/styles/fluent.css +143 -165
  38. package/styles/fluent.scss +8 -2
  39. package/styles/fluent2.css +1485 -0
  40. package/styles/fluent2.scss +8 -0
  41. package/styles/highcontrast-light.css +100 -122
  42. package/styles/highcontrast-light.scss +8 -2
  43. package/styles/highcontrast.css +100 -122
  44. package/styles/highcontrast.scss +8 -2
  45. package/styles/list-view/_bootstrap4-definition.scss +5 -0
  46. package/styles/list-view/_bootstrap5.3-definition.scss +132 -0
  47. package/styles/list-view/_fluent2-definition.scss +132 -0
  48. package/styles/list-view/_layout.scss +377 -393
  49. package/styles/list-view/_material3-definition.scss +0 -7
  50. package/styles/list-view/_theme.scss +84 -95
  51. package/styles/list-view/bootstrap-dark.css +97 -121
  52. package/styles/list-view/bootstrap.css +97 -121
  53. package/styles/list-view/bootstrap4.css +136 -160
  54. package/styles/list-view/bootstrap5-dark.css +98 -124
  55. package/styles/list-view/bootstrap5.css +98 -124
  56. package/styles/list-view/fabric-dark.css +97 -121
  57. package/styles/list-view/fabric.css +97 -121
  58. package/styles/list-view/fluent-dark.css +140 -164
  59. package/styles/list-view/fluent.css +140 -164
  60. package/styles/list-view/fluent2.css +1455 -0
  61. package/styles/list-view/fluent2.scss +5 -0
  62. package/styles/list-view/highcontrast-light.css +97 -121
  63. package/styles/list-view/highcontrast.css +97 -121
  64. package/styles/list-view/icons/_bootstrap5.3.scss +8 -0
  65. package/styles/list-view/icons/_fluent2.scss +10 -0
  66. package/styles/list-view/material-dark.css +97 -121
  67. package/styles/list-view/material.css +97 -121
  68. package/styles/list-view/material3-dark.css +112 -136
  69. package/styles/list-view/material3.css +112 -136
  70. package/styles/list-view/tailwind-dark.css +207 -235
  71. package/styles/list-view/tailwind.css +207 -235
  72. package/styles/material-dark.css +100 -122
  73. package/styles/material-dark.scss +8 -2
  74. package/styles/material.css +100 -122
  75. package/styles/material.scss +8 -2
  76. package/styles/material3-dark.css +115 -137
  77. package/styles/material3-dark.scss +8 -2
  78. package/styles/material3.css +115 -137
  79. package/styles/material3.scss +8 -2
  80. package/styles/sortable/_bootstrap5.3-definition.scss +1 -0
  81. package/styles/sortable/_fluent2-definition.scss +1 -0
  82. package/styles/sortable/bootstrap-dark.css +3 -1
  83. package/styles/sortable/bootstrap.css +3 -1
  84. package/styles/sortable/bootstrap4.css +3 -1
  85. package/styles/sortable/bootstrap5-dark.css +3 -1
  86. package/styles/sortable/bootstrap5.css +3 -1
  87. package/styles/sortable/fabric-dark.css +3 -1
  88. package/styles/sortable/fabric.css +3 -1
  89. package/styles/sortable/fluent-dark.css +3 -1
  90. package/styles/sortable/fluent.css +3 -1
  91. package/styles/sortable/fluent2.css +1063 -0
  92. package/styles/sortable/fluent2.scss +3 -0
  93. package/styles/sortable/highcontrast-light.css +3 -1
  94. package/styles/sortable/highcontrast.css +3 -1
  95. package/styles/sortable/material-dark.css +3 -1
  96. package/styles/sortable/material.css +3 -1
  97. package/styles/sortable/material3-dark.css +4 -2
  98. package/styles/sortable/material3.css +4 -2
  99. package/styles/sortable/tailwind-dark.css +3 -1
  100. package/styles/sortable/tailwind.css +3 -1
  101. package/styles/tailwind-dark.css +210 -236
  102. package/styles/tailwind-dark.scss +8 -2
  103. package/styles/tailwind.css +210 -236
  104. package/styles/tailwind.scss +8 -2
  105. package/CHANGELOG.md +0 -544
@@ -34,9 +34,7 @@ var Virtualization = /** @class */ (function () {
34
34
  this.wireScrollEvent(false);
35
35
  var curViewDS = this.listViewInstance.curViewDS;
36
36
  var firstDs = curViewDS.slice(0, 1);
37
- this.listViewInstance.ulElement = this.listViewInstance.curUL = ListBase.createList(
38
- // eslint-disable-next-line
39
- this.listViewInstance.createElement, firstDs, this.listViewInstance.listBaseOption, null, this.listViewInstance);
37
+ this.listViewInstance.ulElement = this.listViewInstance.curUL = ListBase.createList(this.listViewInstance.createElement, firstDs, this.listViewInstance.listBaseOption, null, this.listViewInstance);
40
38
  this.listViewInstance.contentContainer = this.listViewInstance.createElement('div', { className: classNames.container });
41
39
  this.listViewInstance.element.appendChild(this.listViewInstance.contentContainer);
42
40
  this.listViewInstance.contentContainer.appendChild(this.listViewInstance.ulElement);
@@ -46,9 +44,7 @@ var Virtualization = /** @class */ (function () {
46
44
  this.uiFirstIndex = 0;
47
45
  this.uiLastIndex = this.domItemCount - 1;
48
46
  var otherDs = curViewDS.slice(1, this.domItemCount);
49
- var listItems = ListBase.createListItemFromJson(
50
- // eslint-disable-next-line
51
- this.listViewInstance.createElement, otherDs, this.listViewInstance.listBaseOption, null, null, this.listViewInstance);
47
+ var listItems = ListBase.createListItemFromJson(this.listViewInstance.createElement, otherDs, this.listViewInstance.listBaseOption, null, null, this.listViewInstance);
52
48
  append(listItems, this.listViewInstance.ulElement);
53
49
  this.listViewInstance.liCollection = this.listViewInstance.curUL.querySelectorAll('li');
54
50
  this.topElement = this.listViewInstance.createElement('div');
@@ -80,31 +76,9 @@ var Virtualization = /** @class */ (function () {
80
76
  }
81
77
  else {
82
78
  EventHandler.remove(this.listViewInstance.element, 'scroll', this.onVirtualUiScroll);
83
- EventHandler.remove(this.listViewInstance.element, 'scroll', this.updateUlContainer);
84
79
  }
85
80
  }
86
81
  };
87
- Virtualization.prototype.updateUlContainer = function (e) {
88
- var listDiff;
89
- var virtualElementContainer = this.listViewInstance.ulElement.querySelector('.' + classNames.virtualElementContainer);
90
- if (isNullOrUndefined(this.listViewInstance.liElementHeight)) {
91
- this.listViewInstance.updateLiElementHeight();
92
- }
93
- if (this.listViewInstance.isWindow) {
94
- // eslint-disable-next-line
95
- listDiff = Math.round(e.target.documentElement.scrollTop / this.listViewInstance.liElementHeight) - 2;
96
- }
97
- else {
98
- // eslint-disable-next-line
99
- listDiff = Math.round(e.target.scrollTop / this.listViewInstance.liElementHeight) - 2;
100
- }
101
- if (((listDiff - 1) * this.listViewInstance.liElementHeight) < 0) {
102
- virtualElementContainer.style.top = '0px';
103
- }
104
- else {
105
- virtualElementContainer.style.top = (listDiff) * this.listViewInstance.liElementHeight + 'px';
106
- }
107
- };
108
82
  Virtualization.prototype.ValidateItemCount = function (dataSourceLength) {
109
83
  var height = parseFloat(formatUnit(this.listViewInstance.height));
110
84
  var itemCount;
@@ -113,7 +87,6 @@ var Virtualization = /** @class */ (function () {
113
87
  }
114
88
  else {
115
89
  if (typeof this.listViewInstance.height === 'string' && this.listViewInstance.height.indexOf('%') !== -1) {
116
- // eslint-disable-next-line max-len
117
90
  itemCount = Math.round((this.listViewInstance.element.getBoundingClientRect().height / this.listItemHeight) * listElementCount);
118
91
  }
119
92
  else {
@@ -132,10 +105,8 @@ var Virtualization = /** @class */ (function () {
132
105
  if (this.listViewInstance.showCheckBox && data[i][this.listViewInstance.fields.isChecked]) {
133
106
  this.uiIndices.activeIndices.push(i);
134
107
  }
135
- // eslint-disable-next-line
136
- if (!isNullOrUndefined(data[i][this.listViewInstance.fields.enabled]) &&
108
+ if (!isNullOrUndefined(data[parseInt(i.toString(), 10)][this.listViewInstance.fields.enabled]) &&
137
109
  !data[i][this.listViewInstance.fields.enabled]) {
138
- // eslint-disable-next-line
139
110
  (this.uiIndices.disabledItemIndices.push(i));
140
111
  }
141
112
  }
@@ -160,7 +131,7 @@ var Virtualization = /** @class */ (function () {
160
131
  (pageYOffset - startingHeight)) : ((this.listViewInstance.element.scrollTop - startingHeight) <= 0) ? 0 :
161
132
  (this.listViewInstance.element.scrollTop - startingHeight);
162
133
  };
163
- Virtualization.prototype.onVirtualUiScroll = function (e) {
134
+ Virtualization.prototype.onVirtualUiScroll = function () {
164
135
  var _a;
165
136
  var startingHeight;
166
137
  var curViewDS = this.listViewInstance.curViewDS;
@@ -235,7 +206,6 @@ var Virtualization = /** @class */ (function () {
235
206
  }
236
207
  };
237
208
  Virtualization.prototype.updateUiContent = function (element, index) {
238
- // eslint-disable-next-line
239
209
  var curViewDs = this.listViewInstance.curViewDS;
240
210
  if (typeof this.listViewInstance.dataSource[0] === 'string' ||
241
211
  typeof this.listViewInstance.dataSource[0] === 'number') {
@@ -244,13 +214,10 @@ var Virtualization = /** @class */ (function () {
244
214
  this.listViewInstance.curViewDS[index].toString();
245
215
  }
246
216
  else {
247
- // eslint-disable-next-line
248
- element.dataset.uid = (curViewDs[index][this.listViewInstance.fields.id]) ?
249
- // eslint-disable-next-line
250
- (curViewDs[index][this.listViewInstance.fields.id]) : ListBase.generateId();
217
+ element.dataset.uid = (curViewDs[parseInt(index.toString(), 10)][this.listViewInstance.fields.id]) ?
218
+ (curViewDs[parseInt(index.toString(), 10)][this.listViewInstance.fields.id]) : ListBase.generateId();
251
219
  element.getElementsByClassName(classNames.listItemText)[0].innerHTML =
252
- // eslint-disable-next-line
253
- (curViewDs[index][this.listViewInstance.fields.text]);
220
+ (curViewDs[parseInt(index.toString(), 10)][this.listViewInstance.fields.text]);
254
221
  }
255
222
  if (this.listViewInstance.showIcon) {
256
223
  if (element.querySelector('.' + classNames.listIcon)) {
@@ -353,9 +320,7 @@ var Virtualization = /** @class */ (function () {
353
320
  if (!isNullOrUndefined(fields)) {
354
321
  ds.some(function (data, index) {
355
322
  if ((fields[_this.listViewInstance.fields.id] &&
356
- // eslint-disable-next-line
357
323
  fields[_this.listViewInstance.fields.id]
358
- // eslint-disable-next-line
359
324
  === (data[_this.listViewInstance.fields.id] && data[_this.listViewInstance.fields.id]) || fields === data)) {
360
325
  resultJSON.index = index;
361
326
  resultJSON.data = data;
@@ -383,7 +348,6 @@ var Virtualization = /** @class */ (function () {
383
348
  }
384
349
  return {
385
350
  text: dataCollection,
386
- // eslint-disable-next-line
387
351
  data: dataCollection,
388
352
  index: this.uiIndices.activeIndices.map(function (index) {
389
353
  return _this.listViewInstance.dataSource.indexOf(curViewDS_1[index]);
@@ -405,15 +369,12 @@ var Virtualization = /** @class */ (function () {
405
369
  var indexArray = this.uiIndices.activeIndices;
406
370
  for (var i = 0; i < indexArray.length; i++) {
407
371
  textCollection.push(curViewDS_2[indexArray[i]]["" + text]);
408
- // eslint-disable-next-line
409
- dataCollection.push(curViewDS_2[indexArray[i]]);
372
+ dataCollection.push(curViewDS_2[indexArray[parseInt(i.toString(), 10)]]);
410
373
  }
411
- // eslint-disable-next-line
412
374
  var dataSource_1 = this.listViewInstance.dataSource instanceof DataManager
413
375
  ? curViewDS_2 : this.listViewInstance.dataSource;
414
376
  return {
415
377
  text: textCollection,
416
- // eslint-disable-next-line
417
378
  data: dataCollection,
418
379
  index: this.uiIndices.activeIndices.map(function (index) {
419
380
  return dataSource_1.indexOf(curViewDS_2[index]);
@@ -421,12 +382,10 @@ var Virtualization = /** @class */ (function () {
421
382
  };
422
383
  }
423
384
  else {
424
- // eslint-disable-next-line
425
385
  var dataSource = this.listViewInstance.dataSource instanceof DataManager
426
386
  ? curViewDS_2 : this.listViewInstance.dataSource;
427
387
  return {
428
388
  text: curViewDS_2[this.activeIndex][this.listViewInstance.fields.text],
429
- // eslint-disable-next-line
430
389
  data: curViewDS_2[this.activeIndex],
431
390
  index: dataSource.indexOf(curViewDS_2[this.activeIndex])
432
391
  };
@@ -438,7 +397,6 @@ var Virtualization = /** @class */ (function () {
438
397
  }
439
398
  };
440
399
  Virtualization.prototype.selectItem = function (obj) {
441
- // eslint-disable-next-line
442
400
  var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
443
401
  if (Object.keys(resutJSON).length) {
444
402
  var isSelected = this.activeIndex === resutJSON.index;
@@ -466,7 +424,6 @@ var Virtualization = /** @class */ (function () {
466
424
  }
467
425
  }
468
426
  else {
469
- // eslint-disable-next-line
470
427
  var eventArgs = void 0;
471
428
  if (typeof this.listViewInstance.dataSource[0] === 'string' ||
472
429
  typeof this.listViewInstance.dataSource[0] === 'number') {
@@ -500,28 +457,24 @@ var Virtualization = /** @class */ (function () {
500
457
  }
501
458
  };
502
459
  Virtualization.prototype.enableItem = function (obj) {
503
- // eslint-disable-next-line
504
460
  var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
505
461
  if (Object.keys(resutJSON).length) {
506
462
  this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(resutJSON.index), 1);
507
463
  }
508
464
  };
509
465
  Virtualization.prototype.disableItem = function (obj) {
510
- // eslint-disable-next-line
511
466
  var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
512
467
  if (Object.keys(resutJSON).length && this.uiIndices.disabledItemIndices.indexOf(resutJSON.index) === -1) {
513
468
  this.uiIndices.disabledItemIndices.push(resutJSON.index);
514
469
  }
515
470
  };
516
471
  Virtualization.prototype.showItem = function (obj) {
517
- // eslint-disable-next-line
518
472
  var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
519
473
  if (Object.keys(resutJSON).length) {
520
474
  this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(resutJSON.index), 1);
521
475
  }
522
476
  };
523
477
  Virtualization.prototype.hideItem = function (obj) {
524
- // eslint-disable-next-line
525
478
  var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
526
479
  if (Object.keys(resutJSON).length && this.uiIndices.hiddenItemIndices.indexOf(resutJSON.index) === -1) {
527
480
  this.uiIndices.hiddenItemIndices.push(resutJSON.index);
@@ -530,7 +483,6 @@ var Virtualization = /** @class */ (function () {
530
483
  Virtualization.prototype.removeItem = function (obj) {
531
484
  var dataSource;
532
485
  var curViewDS = this.listViewInstance.curViewDS;
533
- // eslint-disable-next-line
534
486
  var resutJSON = this.findDSAndIndexFromId(curViewDS, obj);
535
487
  if (Object.keys(resutJSON).length) {
536
488
  dataSource = resutJSON.data;
@@ -751,7 +703,6 @@ var Virtualization = /** @class */ (function () {
751
703
  }
752
704
  }
753
705
  else {
754
- // eslint-disable-next-line
755
706
  var index_2 = this.listViewInstance.curViewDS.indexOf(currentItem);
756
707
  // virtually new add list item based on the scollbar position
757
708
  this.addUiItem(index_2);
@@ -766,9 +717,7 @@ var Virtualization = /** @class */ (function () {
766
717
  Virtualization.prototype.createAndInjectNewItem = function (itemData, index) {
767
718
  // generate li item for given datasource
768
719
  var target;
769
- var li = ListBase.createListItemFromJson(this.listViewInstance.createElement,
770
- // eslint-disable-next-line
771
- [itemData], this.listViewInstance.listBaseOption, null, null, this.listViewInstance);
720
+ var li = ListBase.createListItemFromJson(this.listViewInstance.createElement, [itemData], this.listViewInstance.listBaseOption, null, null, this.listViewInstance);
772
721
  // check for target element whether to insert before last item or group item
773
722
  if ((Object.keys(this.listViewInstance.curViewDS).length - 1) === index) {
774
723
  target = this.listViewInstance.curUL.lastElementChild;
@@ -801,7 +750,6 @@ var Virtualization = /** @class */ (function () {
801
750
  this.templateData = args.curData.isHeader ? args.curData.items[0] :
802
751
  args.curData;
803
752
  if (this.listViewInstance.showCheckBox) {
804
- // eslint-disable-next-line
805
753
  this.listViewInstance.renderCheckbox(args);
806
754
  if ((!isNullOrUndefined(this.listViewInstance.virtualCheckBox)) &&
807
755
  (!isNullOrUndefined(this.listViewInstance.virtualCheckBox.outerHTML))) {
@@ -857,9 +805,7 @@ var Virtualization = /** @class */ (function () {
857
805
  var onChange = this.isNgTemplate() ? this.onNgChange : this.onChange;
858
806
  if (this.listViewInstance.template || this.listViewInstance.groupTemplate) {
859
807
  var curViewDS = this.listViewInstance.curViewDS[index];
860
- // eslint-disable-next-line
861
808
  element.dataset.uid = (curViewDS[this.listViewInstance.fields.id]) ?
862
- // eslint-disable-next-line
863
809
  (curViewDS[this.listViewInstance.fields.id]) : ListBase.generateId();
864
810
  onChange(curViewDS, element, this);
865
811
  }
@@ -880,9 +826,7 @@ var Virtualization = /** @class */ (function () {
880
826
  * @returns {void}
881
827
  */
882
828
  Virtualization.prototype.onChange = function (newData, listElement, virtualThis) {
883
- var liItem = ListBase.createListItemFromJson(virtualThis.listViewInstance.createElement,
884
- // eslint-disable-next-line
885
- [newData], virtualThis.listViewInstance.listBaseOption, null, null, virtualThis.listViewInstance);
829
+ var liItem = ListBase.createListItemFromJson(virtualThis.listViewInstance.createElement, [newData], virtualThis.listViewInstance.listBaseOption, null, null, virtualThis.listViewInstance);
886
830
  if (virtualThis.listViewInstance.isReact) {
887
831
  virtualThis.listViewInstance.renderReactTemplates();
888
832
  }
@@ -118,6 +118,11 @@ export declare class Sortable extends Base<HTMLElement> implements INotifyProper
118
118
  /**
119
119
  * It is used to sort array of elements from source element to destination element.
120
120
  *
121
+ * @param {HTMLElement} from - The source element from which to move elements.
122
+ * @param {HTMLElement} [to=from] - The destination element to which to move elements. Defaults to the source element.
123
+ * @param {number[]} [targetIndexes] - The indexes of elements to move. If not provided, all children of the source element will be moved.
124
+ * @param {number} [insertBefore] - The index before which to insert the moved elements in the destination element. If not provided, elements will be appended to the end of the destination element.
125
+ * @returns {void}
121
126
  * @private
122
127
  */
123
128
  export declare function moveTo(from: HTMLElement, to?: HTMLElement, targetIndexes?: number[], insertBefore?: number): void;
@@ -20,6 +20,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
20
20
  import { Base, Event, getUniqueID, NotifyPropertyChanges, Property } from '@syncfusion/ej2-base';
21
21
  import { closest, Draggable, remove, compareElementParent } from '@syncfusion/ej2-base';
22
22
  import { addClass, isNullOrUndefined, getComponent, isBlazor, EventHandler } from '@syncfusion/ej2-base';
23
+ /* eslint-disable @typescript-eslint/no-explicit-any */
23
24
  /**
24
25
  * Sortable Module provides support to enable sortable functionality in Dom Elements.
25
26
  * ```html
@@ -41,7 +42,6 @@ var Sortable = /** @class */ (function (_super) {
41
42
  function Sortable(element, options) {
42
43
  var _this = _super.call(this, options, element) || this;
43
44
  _this.getHelper = function (e) {
44
- // eslint-disable-next-line prefer-const
45
45
  var target = _this.getSortableElement(e.sender.target);
46
46
  if (!_this.isValidTarget(target, _this)) {
47
47
  return false;
@@ -59,7 +59,6 @@ var Sortable = /** @class */ (function (_super) {
59
59
  document.body.appendChild(element);
60
60
  return element;
61
61
  };
62
- // eslint-disable-next-line
63
62
  _this.onDrag = function (e) {
64
63
  if (!e.target) {
65
64
  return;
@@ -137,7 +136,6 @@ var Sortable = /** @class */ (function (_super) {
137
136
  });
138
137
  }
139
138
  };
140
- // eslint-disable-next-line
141
139
  _this.onDragStart = function (e) {
142
140
  _this.target = _this.getSortableElement(e.target);
143
141
  var cancelDrag = false;
@@ -164,11 +162,10 @@ var Sortable = /** @class */ (function (_super) {
164
162
  _this.trigger('dragStart', { event: e.event, element: _this.element, target: _this.target });
165
163
  }
166
164
  };
167
- // eslint-disable-next-line
168
165
  _this.onDragStop = function (e) {
169
166
  var dropInst = _this.getSortableInstance(_this.curTarget);
170
- var prevIdx;
171
167
  var curIdx;
168
+ var prevIdx;
172
169
  var handled;
173
170
  prevIdx = _this.getIndex(_this.target);
174
171
  var isPlaceHolderPresent = _this.isPlaceHolderPresent(dropInst);
@@ -199,12 +196,17 @@ var Sortable = /** @class */ (function (_super) {
199
196
  });
200
197
  }
201
198
  dropInst = _this.getSortableInstance(e.target);
202
- // eslint-disable-next-line prefer-const
203
199
  curIdx = dropInst.element.childElementCount;
204
200
  prevIdx = _this.getIndex(_this.target);
201
+ if (dropInst.element.querySelector('.e-list-nrt')) {
202
+ curIdx = curIdx - 1;
203
+ }
204
+ if (_this.curTarget === _this.target && e.target === _this.curTarget) {
205
+ curIdx = prevIdx;
206
+ }
205
207
  if (dropInst.element === e.target || (!isPlaceHolderPresent && _this.curTarget === _this.target)) {
206
208
  var beforeDropArgs = {
207
- previousIndex: prevIdx, currentIndex: _this.curTarget === _this.target ? prevIdx : curIdx,
209
+ previousIndex: prevIdx, currentIndex: curIdx,
208
210
  target: e.target, droppedElement: _this.target, helper: e.helper, cancel: false
209
211
  };
210
212
  _this.trigger('beforeDrop', beforeDropArgs, function (observedArgs) {
@@ -452,6 +454,11 @@ export { Sortable };
452
454
  /**
453
455
  * It is used to sort array of elements from source element to destination element.
454
456
  *
457
+ * @param {HTMLElement} from - The source element from which to move elements.
458
+ * @param {HTMLElement} [to=from] - The destination element to which to move elements. Defaults to the source element.
459
+ * @param {number[]} [targetIndexes] - The indexes of elements to move. If not provided, all children of the source element will be moved.
460
+ * @param {number} [insertBefore] - The index before which to insert the moved elements in the destination element. If not provided, elements will be appended to the end of the destination element.
461
+ * @returns {void}
455
462
  * @private
456
463
  */
457
464
  export function moveTo(from, to, targetIndexes, insertBefore) {