quasar-ui-danx-legacy 0.3.60 → 0.3.61

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.
package/dist/danx.es.js CHANGED
@@ -16660,7 +16660,7 @@ class hS extends Xd {
16660
16660
  * @param data
16661
16661
  */
16662
16662
  dragStart(n, r) {
16663
- super.dragStart(n, r), this.currentDropZone && (this.listPosition = this.getListPosition(n.target), this.initialPosition = this.listPosition, this.cursorPosition = this.listPosition, this.updateScrollPosition(), this.options.showPlaceholder && this.renderPlaceholder());
16663
+ super.dragStart(n, r), this.currentDropZone && (this.listPosition = this.getListPosition(n.target), this.initialPosition = this.listPosition, this.cursorPosition = this.listPosition, this.updateScrollPosition());
16664
16664
  }
16665
16665
  /**
16666
16666
  * When dragging has ended, check for list position changes and fire the onPositionChange callback if it has
@@ -16675,7 +16675,7 @@ class hS extends Xd {
16675
16675
  * @param e
16676
16676
  */
16677
16677
  dragOver(n) {
16678
- super.dragOver(n), this.updateListPosition(n);
16678
+ super.dragOver(n), this.updateListPosition(n), this.options.showPlaceholder && !this.placeholder && this.renderPlaceholder();
16679
16679
  }
16680
16680
  /**
16681
16681
  * Notify if the targeted position of the cursor is different from the current position
@@ -16689,26 +16689,40 @@ class hS extends Xd {
16689
16689
  this.cursorPosition !== i && (this.cursorPosition = i, this.isGrid() ? this.listPosition = this.cursorPosition : this.listPosition = this.initialPosition < this.cursorPosition ? this.cursorPosition - 1 : this.cursorPosition, this.options.showPlaceholder && this.renderPlaceholder(), this.listPosition !== r && this.onDragPositionChangeCb && this.onDragPositionChangeCb(this.listPosition, this.draggableData));
16690
16690
  }
16691
16691
  /**
16692
- * Find the numeric position of the element in the children of the list
16692
+ * Find the numeric position of the element in the children of the list.
16693
+ * The item may be nested inside wrapper elements, so we walk up to find
16694
+ * the direct child of the drop zone.
16693
16695
  * @returns {Number|null}
16694
16696
  * @param item
16695
16697
  */
16696
16698
  getListPosition(n) {
16697
- let r = 0;
16698
- for (const i of this.getChildren()) {
16699
- if (i === n)
16700
- return r;
16701
- r++;
16699
+ const r = this.getChildren();
16700
+ let i = 0;
16701
+ for (const s of r) {
16702
+ if (s === n)
16703
+ return i;
16704
+ i++;
16705
+ }
16706
+ let o = n;
16707
+ for (; o && o.parentNode !== this.currentDropZone; )
16708
+ o = o.parentNode;
16709
+ if (o) {
16710
+ i = 0;
16711
+ for (const s of r) {
16712
+ if (s === o)
16713
+ return i;
16714
+ i++;
16715
+ }
16702
16716
  }
16703
16717
  return null;
16704
16718
  }
16705
16719
  /**
16706
- * Get all the children of the current drop zone, excluding the placeholder
16720
+ * Get all the children of the current drop zone, excluding the placeholder and hidden elements
16707
16721
  * @returns {*}
16708
16722
  */
16709
16723
  getChildren() {
16710
16724
  return [...this.currentDropZone.children].filter(
16711
- (n) => n.className.match(/drag-placeholder/) === null
16725
+ (n) => n.className.match(/drag-placeholder/) === null && n.offsetParent !== null
16712
16726
  );
16713
16727
  }
16714
16728
  /**
@@ -16828,8 +16842,10 @@ const pS = ["draggable"], gS = { class: "flex items-center" }, bS = { key: 0 },
16828
16842
  }
16829
16843
  });
16830
16844
  function s(a) {
16831
- var u;
16832
- (u = i.value) == null || u.classList.add("is-dragging"), o.dragStart(a);
16845
+ setTimeout(() => {
16846
+ var u;
16847
+ return (u = i.value) == null ? void 0 : u.classList.add("is-dragging");
16848
+ }, 0), o.dragStart(a);
16833
16849
  }
16834
16850
  function l(a) {
16835
16851
  var u;
@@ -21155,7 +21171,7 @@ const CE = {
21155
21171
  });
21156
21172
  };
21157
21173
  }
21158
- }, r3 = "0.3.59", i3 = {
21174
+ }, r3 = "0.3.60", i3 = {
21159
21175
  version: r3
21160
21176
  }, { version: o3 } = i3;
21161
21177
  function dI(t) {