@firestitch/list 12.12.12 → 12.12.13

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.
@@ -15,6 +15,7 @@ export declare class FsListDraggableListDirective {
15
15
  private _multipleDraggableElementPreview;
16
16
  private _draggableElementHeight;
17
17
  private _draggableElementIndex;
18
+ private _draggableElementStartIndex;
18
19
  private _dragToHandler;
19
20
  private _dragEndHandler;
20
21
  private _windowTouchMoveHandler;
@@ -1737,7 +1737,8 @@
1737
1737
  };
1738
1738
  DataController.prototype._updateVisibleRows = function () {
1739
1739
  this.visibleRows = this._rowsStack
1740
- .filter(function (row) {
1740
+ .filter(function (row, index) {
1741
+ row.index = index;
1741
1742
  return (!row.isChild && !row.isGroupFooter) || row.visible;
1742
1743
  });
1743
1744
  };
@@ -5216,6 +5217,7 @@
5216
5217
  this._detectSelectedRows();
5217
5218
  this.prepareElements();
5218
5219
  this.initDraggableElement();
5220
+ this._draggableElementStartIndex = this._draggableElementIndex;
5219
5221
  this._draggableElement.classList.add('draggable-elem');
5220
5222
  this._zone.runOutsideAngular(function () {
5221
5223
  window.addEventListener('touchmove', _this._windowTouchMoveHandler, { passive: true });
@@ -5271,7 +5273,8 @@
5271
5273
  var _this = this;
5272
5274
  this._dragInProgress = false;
5273
5275
  this._reorderController.dataController.finishReorder();
5274
- if (this._reorderController.movedCallback) {
5276
+ if (this._reorderController.movedCallback
5277
+ && this._draggableElementStartIndex !== this._draggableElementIndex) {
5275
5278
  this._reorderController.movedCallback(this._reorderController.dataController.reorderData);
5276
5279
  }
5277
5280
  if (this._reorderController.strategy === ReorderStrategy.Always) {
@@ -5298,6 +5301,7 @@
5298
5301
  }
5299
5302
  this._draggableElementHeight = null;
5300
5303
  this._draggableElementIndex = null;
5304
+ this._draggableElementStartIndex = null;
5301
5305
  this._selectedRowsDirectives = [];
5302
5306
  window.removeEventListener('touchmove', this._windowTouchMoveHandler);
5303
5307
  window.document.removeEventListener('mousemove', this._dragToHandler);