Skip to content

Commit 71ca9e3

Browse files
committed
fix: handle does not take effect
1 parent 677e4ca commit 71ca9e3

File tree

3 files changed

+43
-42
lines changed

3 files changed

+43
-42
lines changed

dist/virtual-list.js

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-sortable v3.0.0
2+
* vue-virtual-sortable v3.0.1
33
* open source under the MIT license
44
* https://github.com/mfuu/vue3-virtual-drag-list#readme
55
*/
@@ -112,7 +112,7 @@
112112
var sortableDnd_min = {exports: {}};
113113

114114
/*!
115-
* sortable-dnd v0.6.22
115+
* sortable-dnd v0.6.23
116116
* open source under the MIT license
117117
* https://github.com/mfuu/sortable-dnd#readme
118118
*/
@@ -121,21 +121,21 @@
121121
module.exports = e() ;
122122
}(commonjsGlobal, function () {
123123

124-
function t(e) {
125-
return t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
126-
return typeof t;
127-
} : function (t) {
128-
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
129-
}, t(e);
130-
}
131-
function e() {
132-
return e = Object.assign ? Object.assign.bind() : function (t) {
124+
function t() {
125+
return t = Object.assign ? Object.assign.bind() : function (t) {
133126
for (var e = 1; e < arguments.length; e++) {
134127
var n = arguments[e];
135-
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
128+
for (var o in n) ({}).hasOwnProperty.call(n, o) && (t[o] = n[o]);
136129
}
137130
return t;
138-
}, e.apply(this, arguments);
131+
}, t.apply(null, arguments);
132+
}
133+
function e(t) {
134+
return e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
135+
return typeof t;
136+
} : function (t) {
137+
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
138+
}, e(t);
139139
}
140140
var n = {
141141
capture: !1,
@@ -276,12 +276,12 @@
276276
function x(t) {
277277
void 0 !== t.preventDefault && t.cancelable && t.preventDefault();
278278
}
279-
function C(t) {
280-
var n = t.sortable,
281-
o = t.name,
282-
i = t.evt,
279+
function C(e) {
280+
var n = e.sortable,
281+
o = e.name,
282+
i = e.evt,
283283
r = n.options[o];
284-
"function" == typeof r && r(e({}, i));
284+
"function" == typeof r && r(t({}, i));
285285
}
286286
!function () {
287287
if ("undefined" == typeof window || "undefined" == typeof document) return "";
@@ -498,26 +498,26 @@
498498
Z,
499499
$,
500500
tt = [];
501-
function et(e) {
501+
function et(t) {
502502
var n,
503503
o,
504504
i,
505505
r = {},
506-
s = e.group;
507-
s && "object" === t(s) || (s = {
506+
s = t.group;
507+
s && "object" === e(s) || (s = {
508508
name: s,
509509
pull: !0,
510510
put: !0,
511511
revertDrag: !0
512-
}), r.name = s.name, r.pull = null === (n = s.pull) || void 0 === n || n, r.put = null === (o = s.put) || void 0 === o || o, r.revertDrag = null === (i = s.revertDrag) || void 0 === i || i, e.group = r;
512+
}), r.name = s.name, r.pull = null === (n = s.pull) || void 0 === n || n, r.put = null === (o = s.put) || void 0 === o || o, r.revertDrag = null === (i = s.revertDrag) || void 0 === i || i, t.group = r;
513513
}
514514
function nt(t) {
515515
var e = F || U;
516516
return !(void 0 !== t.clientX && void 0 !== t.clientY && Math.abs(t.clientX - e.clientX) <= 0 && Math.abs(t.clientY - e.clientY) <= 0);
517517
}
518-
function ot(t, n) {
519-
if (!t || !t.nodeType || 1 !== t.nodeType) throw "Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
520-
t[M] = this, this.el = t, this.options = n = e({}, n);
518+
function ot(e, n) {
519+
if (!e || !e.nodeType || 1 !== e.nodeType) throw "Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
520+
e[M] = this, this.el = e, this.options = n = t({}, n);
521521
var o = {
522522
store: null,
523523
group: "",
@@ -554,7 +554,7 @@
554554
};
555555
for (var i in o) !(i in this.options) && (this.options[i] = o[i]);
556556
for (var r in et(n), this) "_" === r.charAt(0) && "function" == typeof this[r] && (this[r] = this[r].bind(this));
557-
c(t, this.options.supportTouch ? "touchstart" : "mousedown", this._onDrag), this.autoScroller = new T(this.options), this.multiplayer = new P(this.options), this.animator = new N(this.options), tt.push(t);
557+
c(e, this.options.supportTouch ? "touchstart" : "mousedown", this._onDrag), this.autoScroller = new T(this.options), this.multiplayer = new P(this.options), this.animator = new N(this.options), tt.push(e);
558558
}
559559
return ot.prototype = {
560560
constructor: ot,
@@ -571,7 +571,7 @@
571571
clientY: (n || t).clientY
572572
}, k = i, c(Q = n ? k : document, "mouseup", this._onDrop), c(Q, "touchend", this._onDrop), c(Q, "touchcancel", this._onDrop), !this.multiplayer.useSelectHandle(t, o))) {
573573
var a = this.options.handle;
574-
if (("function" != typeof a || a(t)) && ("string" != typeof a || b(o, a))) {
574+
if (("function" != typeof a || a(t)) && ("string" != typeof a || p(o, a, k))) {
575575
var h = this.options,
576576
u = h.delay,
577577
d = h.delayOnTouchOnly;
@@ -626,17 +626,18 @@
626626
},
627627
_appendGhost: function () {
628628
if (!B) {
629-
var t = this.options.fallbackOnBody ? document.body : this.el,
629+
var e = this.options.fallbackOnBody ? document.body : this.el,
630630
n = this._getGhostElement();
631631
w(B = n.cloneNode(!0), this.options.ghostClass, !0);
632632
var o = d(k),
633-
i = e({
633+
i = t({
634634
position: "fixed",
635635
top: o.top,
636636
left: o.left,
637637
width: o.width,
638638
height: o.height,
639-
zIndex: "100000",
639+
margin: 0,
640+
zIndex: 1e5,
640641
opacity: "0.8",
641642
overflow: "hidden",
642643
boxSizing: "border-box",
@@ -645,7 +646,7 @@
645646
pointerEvents: "none"
646647
}, this.options.ghostStyle);
647648
for (var r in i) S(B, r, i[r]);
648-
ot.ghost = B, t.appendChild(B);
649+
ot.ghost = B, e.appendChild(B);
649650
var s = (U.clientX - o.left) / parseInt(B.style.width) * 100,
650651
l = (U.clientY - o.top) / parseInt(B.style.height) * 100;
651652
S(B, "transform-origin", "".concat(s, "% ").concat(l, "%")), S(B, "will-change", "transform");
@@ -795,32 +796,32 @@
795796
evt: this._getEventProperties(t)
796797
}), F && this._onEnd(t), !F && this.animator.animate()), !nt(t.changedTouches ? t.changedTouches[0] : t) && this.multiplayer.onSelect(t, k, R, this), B && B.parentNode && B.parentNode.removeChild(B), this._nulling();
797798
},
798-
_onEnd: function (t) {
799+
_onEnd: function (e) {
799800
w(Y, this.options.chosenClass, !1), w(Y, this.options.placeholderClass, !1);
800801
var n = "clone" === z;
801802
this.multiplayer.onDrop(H, O, n);
802-
var o = this._getEventProperties(t),
803+
var o = this._getEventProperties(e),
803804
i = this.options,
804805
r = i.swapOnDrop,
805806
s = i.removeCloneOnDrop;
806807
n && H !== O || !("function" == typeof r ? r(o) : r) || A.insertBefore(k, Y), n && H !== O && !this.multiplayer.isActive() || !("function" == typeof s ? s(o) : s) || Y && Y.parentNode && Y.parentNode.removeChild(Y), S(k, "display", ""), this.animator.animate(), H !== O && C({
807808
sortable: H[M],
808809
name: "onDrop",
809-
evt: e({}, o, n ? J : {
810+
evt: t({}, o, n ? J : {
810811
newIndex: -1
811812
})
812813
}), C({
813814
sortable: O[M],
814815
name: "onDrop",
815-
evt: e({}, o, H === O ? {} : {
816+
evt: t({}, o, H === O ? {} : {
816817
oldIndex: -1
817818
})
818819
});
819820
},
820-
_getEventProperties: function (t) {
821+
_getEventProperties: function (e) {
821822
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
822823
o = {};
823-
return o.event = t, o.to = O, o.from = H, o.node = k, o.clone = Y, o.target = W, o.oldIndex = V, o.newIndex = j, o.pullMode = z, e(o, this.multiplayer.eventProperties(), n), o.relative = W === k ? 0 : _(Y, W), o;
824+
return o.event = e, o.to = O, o.from = H, o.node = k, o.clone = Y, o.target = W, o.oldIndex = V, o.newIndex = j, o.pullMode = z, t(o, this.multiplayer.eventProperties(), n), o.relative = W === k ? 0 : _(Y, W), o;
824825
},
825826
_nulling: function () {
826827
O = H = k = L = X = Y = B = R = W = A = z = V = j = G = U = F = q = J = K = Q = Z = $ = ot.clone = ot.ghost = ot.active = ot.dragged = null, this.multiplayer.nulling(), this.autoScroller.nulling();

0 commit comments

Comments
 (0)