virtua 0.48.6 → 0.48.8
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/lib/core/index.cjs +8 -2
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.js +110 -104
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +8 -2
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +8 -2
- package/lib/index.js.map +1 -1
- package/lib/solid/index.cjs +126 -124
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +106 -104
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +30 -20
- package/lib/solid/index.jsx.map +1 -1
- package/lib/vue/index.cjs +44 -40
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +67 -63
- package/lib/vue/index.js.map +1 -1
- package/package.json +12 -9
package/lib/vue/index.cjs
CHANGED
|
@@ -38,15 +38,15 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
38
38
|
const n = t - e.l;
|
|
39
39
|
return e.i = o ? -1 : r(t - 1, e.i), e.l = t, n > 0 ? (f(e.u, n), f(e.t, n, o),
|
|
40
40
|
e.o * n) : (e.u.splice(n), (o ? e.t.splice(0, -n) : e.t.splice(n)).reduce(((t, r) => t - (-1 === r ? e.o : r)), 0));
|
|
41
|
-
}, b = e => e.documentElement,
|
|
42
|
-
let u = !!i, b = 1,
|
|
41
|
+
}, b = e => e.documentElement, g = e => e.ownerDocument, v = e => e.defaultView, y = /*#__PURE__*/ u((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0)), S = /*#__PURE__*/ u((() => "scrollBehavior" in b(document).style)), z = (e, s = 40, i = 0, c, a = !1) => {
|
|
42
|
+
let u = !!i, b = 1, g = 0, v = 0, S = 0, z = 0, x = 0, $ = 0, w = 0, I = 0, O = t, k = [ 0, u ? o(i - 1, 0) : -1 ], j = 0, N = !1;
|
|
43
43
|
const q = ((e, t, n) => ({
|
|
44
44
|
o: t,
|
|
45
45
|
t: n ? f(n.slice(0, r(e, n.length)), o(0, e - n.length)) : f([], e),
|
|
46
46
|
l: e,
|
|
47
47
|
i: -1,
|
|
48
48
|
u: f([], e + 1)
|
|
49
|
-
}))(e, c ? c[1] : s, c && c[0]), B = new Set, T = () => S -
|
|
49
|
+
}))(e, c ? c[1] : s, c && c[0]), B = new Set, T = () => S - v, M = () => T() + x + z, E = (e, t) => ((e, t, o, n) => {
|
|
50
50
|
if (n = r(n, e.l - 1), m(e, n) <= t) {
|
|
51
51
|
const r = h(e, o, n);
|
|
52
52
|
return [ h(e, t, n, r), r ];
|
|
@@ -71,21 +71,21 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
71
71
|
if (!N || u) return k;
|
|
72
72
|
let t, n;
|
|
73
73
|
if ($) [t, n] = k; else {
|
|
74
|
-
let s = o(0, M()), i = s +
|
|
74
|
+
let s = o(0, M()), i = s + g;
|
|
75
75
|
a || (e = o(0, e), 1 !== w && (s -= e), 2 !== w && (i += e)), [t, n] = k = E(o(0, s), o(0, i)),
|
|
76
76
|
O && (t = r(t, O[0]), n = o(n, O[1]));
|
|
77
77
|
}
|
|
78
78
|
return [ o(t, 0), r(n, q.l - 1) ];
|
|
79
79
|
},
|
|
80
|
-
S: e => h(q, e -
|
|
80
|
+
S: e => h(q, e - v),
|
|
81
81
|
I: C,
|
|
82
82
|
O: R,
|
|
83
83
|
k: A,
|
|
84
84
|
j: () => q.l,
|
|
85
85
|
N: () => S,
|
|
86
86
|
q: () => 0 !== w,
|
|
87
|
-
B: () =>
|
|
88
|
-
T: () =>
|
|
87
|
+
B: () => g,
|
|
88
|
+
T: () => v,
|
|
89
89
|
M: P,
|
|
90
90
|
P: () => ($ = z, z = 0, [ $, 2 === I ]),
|
|
91
91
|
R: (e, t) => {
|
|
@@ -105,7 +105,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
105
105
|
const t = r - S, o = n(t);
|
|
106
106
|
e && o < n(e) + 1 || 0 !== I || (w = t < 0 ? 2 : 1), u && (u = !1), S = r, c = 4;
|
|
107
107
|
const s = T();
|
|
108
|
-
s >= -
|
|
108
|
+
s >= -g && s <= P() && (c += 1, i = o > g);
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -117,13 +117,19 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
117
117
|
{
|
|
118
118
|
const e = r.filter((([e, t]) => !C(e, t)));
|
|
119
119
|
if (!e.length) break;
|
|
120
|
-
H(e.reduce(((e, [t, r]) =>
|
|
121
|
-
|
|
120
|
+
H(e.reduce(((e, [t, r]) => {
|
|
121
|
+
let o;
|
|
122
|
+
if (2 === I) o = !0; else if (O && 1 === I) o = t < O[0]; else {
|
|
123
|
+
const e = T(), r = R(t), n = A(t);
|
|
124
|
+
o = 1 !== w && 0 === I ? r + n < e : r < e && r + n < e + g;
|
|
125
|
+
}
|
|
126
|
+
return o && (e += r - A(t)), e;
|
|
127
|
+
}), 0));
|
|
122
128
|
for (const [t, r] of e) {
|
|
123
129
|
const e = A(t), o = p(q, t, r);
|
|
124
130
|
a && (j += o ? r : r - e);
|
|
125
131
|
}
|
|
126
|
-
a &&
|
|
132
|
+
a && g && j > g && (H(((e, t) => {
|
|
127
133
|
let r = 0;
|
|
128
134
|
const n = [];
|
|
129
135
|
e.t.forEach(((e, o) => {
|
|
@@ -136,7 +142,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
136
142
|
}
|
|
137
143
|
|
|
138
144
|
case 4:
|
|
139
|
-
|
|
145
|
+
g !== r && (g || (N = i = !0), g = r, c = 3);
|
|
140
146
|
break;
|
|
141
147
|
|
|
142
148
|
case 5:
|
|
@@ -144,7 +150,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
144
150
|
break;
|
|
145
151
|
|
|
146
152
|
case 6:
|
|
147
|
-
|
|
153
|
+
v = r;
|
|
148
154
|
break;
|
|
149
155
|
|
|
150
156
|
case 7:
|
|
@@ -152,7 +158,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
152
158
|
break;
|
|
153
159
|
|
|
154
160
|
case 8:
|
|
155
|
-
O = E(r, r +
|
|
161
|
+
O = E(r, r + g), c = 1;
|
|
156
162
|
}
|
|
157
163
|
c && (b = 1 + (2147483647 & b), s && x && (z += x, x = 0), B.forEach((([e, t]) => {
|
|
158
164
|
c & e && t(i);
|
|
@@ -246,7 +252,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
246
252
|
let t;
|
|
247
253
|
return {
|
|
248
254
|
F(r) {
|
|
249
|
-
(t || (t = new (g(
|
|
255
|
+
(t || (t = new (v(g(r)).ResizeObserver)(e))).observe(r);
|
|
250
256
|
},
|
|
251
257
|
J(e) {
|
|
252
258
|
t.unobserve(e);
|
|
@@ -299,24 +305,23 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
299
305
|
}), {
|
|
300
306
|
flush: "post"
|
|
301
307
|
}), () => {
|
|
302
|
-
|
|
303
|
-
const {X: i, U: l, G: c, Z: a} = t, u = n.value, {style: f, ...d} = null !== (s = t.ee) && void 0 !== s ? s : {}, p = {
|
|
308
|
+
const {X: s, U: i, G: l, Z: c} = t, a = n.value, {style: u, ...f} = t.ee ?? {}, d = {
|
|
304
309
|
contain: "layout style",
|
|
305
|
-
position:
|
|
306
|
-
[
|
|
307
|
-
[
|
|
308
|
-
[
|
|
309
|
-
visibility: !
|
|
310
|
-
...
|
|
310
|
+
position: a && l ? void 0 : "absolute",
|
|
311
|
+
[i ? "height" : "width"]: "100%",
|
|
312
|
+
[i ? "top" : "left"]: "0px",
|
|
313
|
+
[i ? "left" : "top"]: o.value + "px",
|
|
314
|
+
visibility: !a || l ? void 0 : "hidden",
|
|
315
|
+
...u
|
|
311
316
|
};
|
|
312
|
-
return
|
|
317
|
+
return i && (d.display = "inline-flex"), e.createVNode(c, e.mergeProps({
|
|
313
318
|
ref: r,
|
|
314
|
-
style:
|
|
315
|
-
},
|
|
316
|
-
default: () => [
|
|
319
|
+
style: d
|
|
320
|
+
}, f), "function" == typeof (p = s) || "[object Object]" === Object.prototype.toString.call(p) && !e.isVNode(p) ? s : {
|
|
321
|
+
default: () => [ s ],
|
|
317
322
|
_: 2
|
|
318
323
|
}, 16, [ "style" ]);
|
|
319
|
-
var
|
|
324
|
+
var p;
|
|
320
325
|
};
|
|
321
326
|
}
|
|
322
327
|
}), j = (e, t) => {
|
|
@@ -431,7 +436,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
431
436
|
_.value;
|
|
432
437
|
const t = p.v(r.bufferSize);
|
|
433
438
|
return e && N(e, t) ? e : t;
|
|
434
|
-
})),
|
|
439
|
+
})), g = e.computed((() => _.value && p.q())), v = e.computed((() => _.value && p.M()));
|
|
435
440
|
return e.onMounted((() => {
|
|
436
441
|
u = !1;
|
|
437
442
|
const t = d.value, o = requestAnimationFrame((() => {
|
|
@@ -475,24 +480,23 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
475
480
|
scrollTo: h.se,
|
|
476
481
|
scrollBy: h.ie
|
|
477
482
|
}), () => {
|
|
478
|
-
const t = r.as, o = r.item, n =
|
|
479
|
-
|
|
480
|
-
const i = c.default({
|
|
483
|
+
const t = r.as, o = r.item, n = v.value, s = h.ne(), i = [], a = t => {
|
|
484
|
+
const n = c.default({
|
|
481
485
|
item: r.data[t],
|
|
482
486
|
index: t
|
|
483
487
|
});
|
|
484
488
|
return e.createVNode(k, {
|
|
485
|
-
key: j(
|
|
489
|
+
key: j(n, t),
|
|
486
490
|
L: _,
|
|
487
491
|
W: p,
|
|
488
492
|
Y: m.re,
|
|
489
493
|
D: t,
|
|
490
|
-
X:
|
|
494
|
+
X: n,
|
|
491
495
|
U: f,
|
|
492
496
|
K: s,
|
|
493
497
|
G: u,
|
|
494
498
|
Z: o,
|
|
495
|
-
ee:
|
|
499
|
+
ee: r.itemProps?.({
|
|
496
500
|
item: r.data[t],
|
|
497
501
|
index: t
|
|
498
502
|
})
|
|
@@ -514,7 +518,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
514
518
|
position: "relative",
|
|
515
519
|
width: f ? n + "px" : "100%",
|
|
516
520
|
height: f ? "100%" : n + "px",
|
|
517
|
-
pointerEvents:
|
|
521
|
+
pointerEvents: g.value ? "none" : void 0
|
|
518
522
|
}
|
|
519
523
|
}, "function" == typeof (y = i) || "[object Object]" === Object.prototype.toString.call(y) && !e.isVNode(y) ? i : {
|
|
520
524
|
default: () => [ i ],
|
|
@@ -628,7 +632,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
628
632
|
let l;
|
|
629
633
|
return {
|
|
630
634
|
te(t) {
|
|
631
|
-
const r = g(
|
|
635
|
+
const r = v(g(t)), o = () => {
|
|
632
636
|
e.A(4, r[n]);
|
|
633
637
|
};
|
|
634
638
|
r.addEventListener("resize", o), c(o), l = () => {
|
|
@@ -646,7 +650,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
646
650
|
let r, o, n = a(), s = !1;
|
|
647
651
|
const l = t ? "left" : "top", [c] = I(e, (() => n[0]), ((e, t) => {
|
|
648
652
|
e = $(e, s);
|
|
649
|
-
const o = g(
|
|
653
|
+
const o = v(g(r));
|
|
650
654
|
t ? o.scroll({
|
|
651
655
|
[l]: e,
|
|
652
656
|
behavior: "smooth"
|
|
@@ -660,7 +664,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
660
664
|
return {
|
|
661
665
|
oe(i) {
|
|
662
666
|
r = i;
|
|
663
|
-
const c = t ? "scrollX" : "scrollY", a =
|
|
667
|
+
const c = t ? "scrollX" : "scrollY", a = g(i), f = v(a);
|
|
664
668
|
t && (s = "rtl" === getComputedStyle(b(a)).direction), o = w(e, f, t, (() => $(f[c], s)), ((t, r) => {
|
|
665
669
|
r ? f.scroll({
|
|
666
670
|
[l]: $(e.N() + t, s)
|
|
@@ -685,7 +689,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
685
689
|
n = "end";
|
|
686
690
|
}
|
|
687
691
|
}
|
|
688
|
-
const a =
|
|
692
|
+
const a = g(r), f = v(a), d = b(a), p = () => e.B() - (t ? d.clientWidth : d.clientHeight);
|
|
689
693
|
c((() => l + u(r, a.body, f, t) + e.O(o) + ("end" === n ? e.k(o) - (e.B() - p()) : "center" === n ? (e.k(o) - (e.B() - p())) / 2 : 0)), s);
|
|
690
694
|
}
|
|
691
695
|
};
|