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/solid/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createComponent as e, Dynamic as t,
|
|
1
|
+
import { createComponent as e, Dynamic as t, spread as r, mergeProps as n, insert as o, template as s, use as i, setStyleProperty as c, effect as l } from "solid-js/web";
|
|
2
2
|
|
|
3
|
-
import { mergeProps as u, createEffect as
|
|
3
|
+
import { mergeProps as u, createEffect as f, createMemo as a, onCleanup as d, createSignal as g, onMount as h, createComputed as p, on as v, untrack as m, For as S, splitProps as $ } from "solid-js";
|
|
4
4
|
|
|
5
5
|
const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r, w(t, e)), I = e => [ ...e ].sort(((e, t) => e - t)), k = "function" == typeof queueMicrotask ? queueMicrotask : e => {
|
|
6
6
|
Promise.resolve().then(e);
|
|
@@ -41,14 +41,14 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
41
41
|
return e.l = r ? -1 : z(t - 1, e.l), e.u = t, n > 0 ? (O(e.h, n), O(e.o, n, r),
|
|
42
42
|
e.i * n) : (e.h.splice(n), (r ? e.o.splice(0, -n) : e.o.splice(n)).reduce(((t, r) => t - (-1 === r ? e.i : r)), 0));
|
|
43
43
|
}, E = e => e.documentElement, H = e => e.ownerDocument, L = e => e.defaultView, W = /*#__PURE__*/ M((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0)), j = /*#__PURE__*/ M((() => "scrollBehavior" in E(document).style)), q = (e, t = 40, r = 0, n, o = !1) => {
|
|
44
|
-
let s = !!r, i = 1, c = 0, l = 0, u = 0,
|
|
44
|
+
let s = !!r, i = 1, c = 0, l = 0, u = 0, f = 0, a = 0, d = 0, g = 0, h = 0, p = b, v = [ 0, s ? w(r - 1, 0) : -1 ], m = 0, S = !1;
|
|
45
45
|
const $ = ((e, t, r) => ({
|
|
46
46
|
i: t,
|
|
47
47
|
o: r ? O(r.slice(0, z(e, r.length)), w(0, e - r.length)) : O([], e),
|
|
48
48
|
u: e,
|
|
49
49
|
l: -1,
|
|
50
50
|
h: O([], e + 1)
|
|
51
|
-
}))(e, n ? n[1] : t, n && n[0]), y = new Set, _ = () => u - l, k = () => _() +
|
|
51
|
+
}))(e, n ? n[1] : t, n && n[0]), y = new Set, _ = () => u - l, k = () => _() + a + f, T = (e, t) => ((e, t, r, n) => {
|
|
52
52
|
if (n = z(n, e.u - 1), P(e, n) <= t) {
|
|
53
53
|
const o = B(e, r, n);
|
|
54
54
|
return [ B(e, t, n, o), o ];
|
|
@@ -57,25 +57,25 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
57
57
|
const o = B(e, t, void 0, n);
|
|
58
58
|
return [ o, B(e, r, o) ];
|
|
59
59
|
}
|
|
60
|
-
})($, e, t,
|
|
61
|
-
const r = P($, e) -
|
|
60
|
+
})($, e, t, v[0]), M = () => P($, $.u), E = (e, t) => {
|
|
61
|
+
const r = P($, e) - a;
|
|
62
62
|
return t ? M() - r - H(e) : r;
|
|
63
63
|
}, H = e => R($, e), L = (e, t = -1) => $.o[e] === t, j = e => {
|
|
64
|
-
e && (W() && 0 !== g ||
|
|
64
|
+
e && (W() && 0 !== g || p && 1 === h ? a += e : f += e);
|
|
65
65
|
};
|
|
66
66
|
return {
|
|
67
|
-
|
|
67
|
+
p: () => {
|
|
68
68
|
y.clear();
|
|
69
69
|
},
|
|
70
|
-
|
|
70
|
+
v: () => i,
|
|
71
71
|
m: () => (e => [ e.o.slice(), e.i ])($),
|
|
72
72
|
S: (e = 200) => {
|
|
73
|
-
if (!S || s) return
|
|
73
|
+
if (!S || s) return v;
|
|
74
74
|
let t, r;
|
|
75
|
-
if (d) [t, r] =
|
|
75
|
+
if (d) [t, r] = v; else {
|
|
76
76
|
let n = w(0, k()), s = n + c;
|
|
77
|
-
o || (e = w(0, e), 1 !== g && (n -= e), 2 !== g && (s += e)), [t, r] =
|
|
78
|
-
|
|
77
|
+
o || (e = w(0, e), 1 !== g && (n -= e), 2 !== g && (s += e)), [t, r] = v = T(w(0, n), w(0, s)),
|
|
78
|
+
p && (t = z(t, p[0]), r = w(r, p[1]));
|
|
79
79
|
}
|
|
80
80
|
return [ w(t, 0), z(r, $.u - 1) ];
|
|
81
81
|
},
|
|
@@ -89,7 +89,7 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
89
89
|
R: () => c,
|
|
90
90
|
J: () => l,
|
|
91
91
|
P: M,
|
|
92
|
-
B: () => (d =
|
|
92
|
+
B: () => (d = f, f = 0, [ d, 2 === h ]),
|
|
93
93
|
C: (e, t) => {
|
|
94
94
|
const r = [ e, t ];
|
|
95
95
|
return y.add(r), () => {
|
|
@@ -97,7 +97,7 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
97
97
|
};
|
|
98
98
|
},
|
|
99
99
|
H: (e, t) => {
|
|
100
|
-
let r, n,
|
|
100
|
+
let r, n, v = 0;
|
|
101
101
|
switch (e) {
|
|
102
102
|
case 1:
|
|
103
103
|
{
|
|
@@ -105,22 +105,28 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
105
105
|
const e = d;
|
|
106
106
|
d = 0;
|
|
107
107
|
const r = t - u, o = x(r);
|
|
108
|
-
e && o < x(e) + 1 || 0 !== h || (g = r < 0 ? 2 : 1), s && (s = !1), u = t,
|
|
108
|
+
e && o < x(e) + 1 || 0 !== h || (g = r < 0 ? 2 : 1), s && (s = !1), u = t, v = 4;
|
|
109
109
|
const i = _();
|
|
110
|
-
i >= -c && i <= M() && (
|
|
110
|
+
i >= -c && i <= M() && (v += 1, n = o > c);
|
|
111
111
|
break;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
case 2:
|
|
115
|
-
|
|
115
|
+
v = 8, 0 !== g && (r = !0, v += 1), g = 0, h = 0, p = b;
|
|
116
116
|
break;
|
|
117
117
|
|
|
118
118
|
case 3:
|
|
119
119
|
{
|
|
120
120
|
const e = t.filter((([e, t]) => !L(e, t)));
|
|
121
121
|
if (!e.length) break;
|
|
122
|
-
j(e.reduce(((e, [t, r]) =>
|
|
123
|
-
|
|
122
|
+
j(e.reduce(((e, [t, r]) => {
|
|
123
|
+
let n;
|
|
124
|
+
if (2 === h) n = !0; else if (p && 1 === h) n = t < p[0]; else {
|
|
125
|
+
const e = _(), r = E(t), o = H(t);
|
|
126
|
+
n = 1 !== g && 0 === h ? r + o < e : r < e && r + o < e + c;
|
|
127
|
+
}
|
|
128
|
+
return n && (e += r - H(t)), e;
|
|
129
|
+
}), 0));
|
|
124
130
|
for (const [t, r] of e) {
|
|
125
131
|
const e = H(t), n = J($, t, r);
|
|
126
132
|
o && (m += n ? r : r - e);
|
|
@@ -133,16 +139,16 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
133
139
|
})), e.l = -1;
|
|
134
140
|
const o = I(n), s = o.length, i = s / 2 | 0, c = s % 2 == 0 ? (o[i - 1] + o[i]) / 2 : o[i], l = e.i;
|
|
135
141
|
return ((e.i = c) - l) * w(t - r, 0);
|
|
136
|
-
})($, B($, k()))), o = !1),
|
|
142
|
+
})($, B($, k()))), o = !1), v = 3, n = !0;
|
|
137
143
|
break;
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
case 4:
|
|
141
|
-
c !== t && (c || (S = n = !0), c = t,
|
|
147
|
+
c !== t && (c || (S = n = !0), c = t, v = 3);
|
|
142
148
|
break;
|
|
143
149
|
|
|
144
150
|
case 5:
|
|
145
|
-
t[1] ? (j(C($, t[0], !0)), h = 2,
|
|
151
|
+
t[1] ? (j(C($, t[0], !0)), h = 2, v = 1) : (C($, t[0]), v = 1);
|
|
146
152
|
break;
|
|
147
153
|
|
|
148
154
|
case 6:
|
|
@@ -154,16 +160,16 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
154
160
|
break;
|
|
155
161
|
|
|
156
162
|
case 8:
|
|
157
|
-
|
|
163
|
+
p = T(t, t + c), v = 1;
|
|
158
164
|
}
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
v && (i = 1 + (2147483647 & i), r && a && (f += a, a = 0), y.forEach((([e, t]) => {
|
|
166
|
+
v & e && t(n);
|
|
161
167
|
})));
|
|
162
168
|
}
|
|
163
169
|
};
|
|
164
170
|
}, N = setTimeout, V = (e, t) => t ? -e : e, X = (e, t, r, n, o, s) => {
|
|
165
171
|
const i = Date.now;
|
|
166
|
-
let c = 0, l = !1, u = !1,
|
|
172
|
+
let c = 0, l = !1, u = !1, f = !1, a = !1;
|
|
167
173
|
const d = (() => {
|
|
168
174
|
let t;
|
|
169
175
|
const r = () => {
|
|
@@ -172,36 +178,36 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
172
178
|
r(), t = N((() => {
|
|
173
179
|
t = b, (() => {
|
|
174
180
|
if (l || u) return l = !1, void d();
|
|
175
|
-
|
|
181
|
+
f = !1, e.H(2);
|
|
176
182
|
})();
|
|
177
183
|
}), 150);
|
|
178
184
|
};
|
|
179
185
|
return n.L = r, n;
|
|
180
186
|
})(), g = () => {
|
|
181
|
-
c = i(),
|
|
187
|
+
c = i(), f && (a = !0), s && e.H(6, s()), e.H(1, n()), d();
|
|
182
188
|
}, h = t => {
|
|
183
189
|
if (l || !e.O() || t.ctrlKey) return;
|
|
184
190
|
const n = i() - c;
|
|
185
191
|
150 > n && 50 < n && (r ? t.deltaX : t.deltaY) && (l = !0);
|
|
186
|
-
}, v = () => {
|
|
187
|
-
u = !0, a = f = !1;
|
|
188
192
|
}, p = () => {
|
|
189
|
-
u = !
|
|
193
|
+
u = !0, f = a = !1;
|
|
194
|
+
}, v = () => {
|
|
195
|
+
u = !1, W() && (f = !0);
|
|
190
196
|
};
|
|
191
197
|
return t.addEventListener("scroll", g), t.addEventListener("wheel", h, {
|
|
192
198
|
passive: !0
|
|
193
|
-
}), t.addEventListener("touchstart",
|
|
199
|
+
}), t.addEventListener("touchstart", p, {
|
|
194
200
|
passive: !0
|
|
195
|
-
}), t.addEventListener("touchend",
|
|
201
|
+
}), t.addEventListener("touchend", v, {
|
|
196
202
|
passive: !0
|
|
197
203
|
}), {
|
|
198
204
|
W: () => {
|
|
199
|
-
t.removeEventListener("scroll", g), t.removeEventListener("wheel", h), t.removeEventListener("touchstart",
|
|
200
|
-
t.removeEventListener("touchend",
|
|
205
|
+
t.removeEventListener("scroll", g), t.removeEventListener("wheel", h), t.removeEventListener("touchstart", p),
|
|
206
|
+
t.removeEventListener("touchend", v), d.L();
|
|
201
207
|
},
|
|
202
208
|
j: () => {
|
|
203
209
|
const [t, r] = e.B();
|
|
204
|
-
t && (o(t, r,
|
|
210
|
+
t && (o(t, r, a), a = !1, r && e.R() > e.P() && e.H(1, n()));
|
|
205
211
|
}
|
|
206
212
|
};
|
|
207
213
|
}, Y = (e, t, r) => {
|
|
@@ -261,10 +267,10 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
261
267
|
let n;
|
|
262
268
|
r = u({
|
|
263
269
|
V: "div"
|
|
264
|
-
}, r),
|
|
270
|
+
}, r), f((() => {
|
|
265
271
|
n && d(r.X(n, r.Y));
|
|
266
272
|
}));
|
|
267
|
-
const o =
|
|
273
|
+
const o = a((() => {
|
|
268
274
|
const e = r.D, t = {
|
|
269
275
|
contain: "layout style",
|
|
270
276
|
position: "absolute",
|
|
@@ -315,7 +321,7 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
315
321
|
K: (e, t) => (o.set(e, t), s.q(e), () => {
|
|
316
322
|
o.delete(e), s.N(e);
|
|
317
323
|
}),
|
|
318
|
-
|
|
324
|
+
p: s.W
|
|
319
325
|
};
|
|
320
326
|
})(c, s), $ = ((e, t) => {
|
|
321
327
|
let r, n, o = T(), s = !1;
|
|
@@ -326,18 +332,18 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
326
332
|
}) : r[i] = e;
|
|
327
333
|
}));
|
|
328
334
|
return {
|
|
329
|
-
Z(l,
|
|
330
|
-
r =
|
|
335
|
+
Z(l, f) {
|
|
336
|
+
r = f, t && (s = "rtl" === getComputedStyle(f).direction), n = X(e, f, t, (() => V(f[i], s)), ((t, r, n) => {
|
|
331
337
|
if (n) {
|
|
332
|
-
const e =
|
|
338
|
+
const e = f.style, t = e[c];
|
|
333
339
|
e[c] = "hidden", N((() => {
|
|
334
340
|
e[c] = t;
|
|
335
341
|
}));
|
|
336
342
|
}
|
|
337
|
-
|
|
343
|
+
f[i] = V(e.M() + t, s), r && u();
|
|
338
344
|
})), o[1](!0);
|
|
339
345
|
},
|
|
340
|
-
|
|
346
|
+
p() {
|
|
341
347
|
n && n.W(), o[1](!1), o = T();
|
|
342
348
|
},
|
|
343
349
|
ee: () => s,
|
|
@@ -361,21 +367,19 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
361
367
|
n && n.j();
|
|
362
368
|
}
|
|
363
369
|
};
|
|
364
|
-
})(c, s), [z, x] = g(c.
|
|
370
|
+
})(c, s), [z, x] = g(c.v());
|
|
365
371
|
c.C(1, (() => {
|
|
366
|
-
x(c.
|
|
372
|
+
x(c.v());
|
|
367
373
|
})), c.C(4, (() => {
|
|
368
|
-
|
|
369
|
-
null === (e = r.onScroll) || void 0 === e || e.call(r, c.M());
|
|
374
|
+
r.onScroll?.(c.M());
|
|
370
375
|
})), c.C(8, (() => {
|
|
371
|
-
|
|
372
|
-
null === (e = r.onScrollEnd) || void 0 === e || e.call(r);
|
|
376
|
+
r.onScrollEnd?.();
|
|
373
377
|
}));
|
|
374
|
-
const y =
|
|
378
|
+
const y = a((e => {
|
|
375
379
|
z();
|
|
376
380
|
const t = c.S(r.bufferSize);
|
|
377
381
|
return e && A(e, t) ? e : t;
|
|
378
|
-
})), k =
|
|
382
|
+
})), k = a((() => z() && c.O())), M = a((() => z() && c.P())), O = a((() => z() && $.ee()));
|
|
379
383
|
h((() => {
|
|
380
384
|
r.ref && r.ref({
|
|
381
385
|
get cache() {
|
|
@@ -399,14 +403,14 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
399
403
|
});
|
|
400
404
|
const e = n, t = r.scrollRef || e.parentElement;
|
|
401
405
|
l.G(t), $.Z(e, t), d((() => {
|
|
402
|
-
r.ref && r.ref(), c.
|
|
406
|
+
r.ref && r.ref(), c.p(), l.p(), $.p();
|
|
403
407
|
}));
|
|
404
|
-
})), v(
|
|
408
|
+
})), p(v((() => r.startMargin || 0), (e => {
|
|
405
409
|
e !== c.J() && c.H(6, e);
|
|
406
|
-
}))),
|
|
410
|
+
}))), f(v(z, (() => {
|
|
407
411
|
$.oe();
|
|
408
412
|
})));
|
|
409
|
-
const R =
|
|
413
|
+
const R = a((() => {
|
|
410
414
|
const e = r.data.length;
|
|
411
415
|
m((() => {
|
|
412
416
|
e !== c.T() && c.H(5, [ e, r.shift ]);
|
|
@@ -448,7 +452,7 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
448
452
|
return R().se;
|
|
449
453
|
},
|
|
450
454
|
children: (t, n) => ((t, n) => {
|
|
451
|
-
const o =
|
|
455
|
+
const o = a((() => (z(), c.I(n(), O())))), i = a((() => (z(), c._(n())))), u = a((() => m((() => r.children(t, n)))));
|
|
452
456
|
return e(U, {
|
|
453
457
|
get V() {
|
|
454
458
|
return r.item;
|
|
@@ -470,74 +474,74 @@ const b = null, {min: z, max: w, abs: x, floor: y} = Math, _ = (e, t, r) => z(r,
|
|
|
470
474
|
},
|
|
471
475
|
D: s
|
|
472
476
|
});
|
|
473
|
-
})(t,
|
|
477
|
+
})(t, a((() => R().ie[n()])))
|
|
474
478
|
});
|
|
475
479
|
}
|
|
476
480
|
});
|
|
477
481
|
};
|
|
478
482
|
|
|
479
|
-
var G = /*#__PURE__*/
|
|
483
|
+
var G = /*#__PURE__*/ s("<div>");
|
|
480
484
|
|
|
481
485
|
const K = t => {
|
|
482
|
-
const [
|
|
483
|
-
return c = G(),
|
|
486
|
+
const [s, i] = $(t, [ "ref", "data", "children", "bufferSize", "itemSize", "shift", "horizontal", "keepMounted", "cache", "item", "onScroll", "onScrollEnd", "style" ]);
|
|
487
|
+
return c = G(), r(c, n(i, {
|
|
484
488
|
get style() {
|
|
485
489
|
return {
|
|
486
|
-
display:
|
|
487
|
-
[
|
|
490
|
+
display: s.horizontal ? "inline-block" : "block",
|
|
491
|
+
[s.horizontal ? "overflow-x" : "overflow-y"]: "auto",
|
|
488
492
|
contain: "strict",
|
|
489
493
|
width: "100%",
|
|
490
494
|
height: "100%",
|
|
491
|
-
...
|
|
495
|
+
...s.style
|
|
492
496
|
};
|
|
493
497
|
}
|
|
494
|
-
}), !1, !0),
|
|
498
|
+
}), !1, !0), o(c, e(F, {
|
|
495
499
|
ref(e) {
|
|
496
|
-
var t =
|
|
497
|
-
"function" == typeof t ? t(e) :
|
|
500
|
+
var t = s.ref;
|
|
501
|
+
"function" == typeof t ? t(e) : s.ref = e;
|
|
498
502
|
},
|
|
499
503
|
get data() {
|
|
500
|
-
return
|
|
504
|
+
return s.data;
|
|
501
505
|
},
|
|
502
506
|
get bufferSize() {
|
|
503
|
-
return
|
|
507
|
+
return s.bufferSize;
|
|
504
508
|
},
|
|
505
509
|
get itemSize() {
|
|
506
|
-
return
|
|
510
|
+
return s.itemSize;
|
|
507
511
|
},
|
|
508
512
|
get shift() {
|
|
509
|
-
return
|
|
513
|
+
return s.shift;
|
|
510
514
|
},
|
|
511
515
|
get horizontal() {
|
|
512
|
-
return
|
|
516
|
+
return s.horizontal;
|
|
513
517
|
},
|
|
514
518
|
get keepMounted() {
|
|
515
|
-
return
|
|
519
|
+
return s.keepMounted;
|
|
516
520
|
},
|
|
517
521
|
get cache() {
|
|
518
|
-
return
|
|
522
|
+
return s.cache;
|
|
519
523
|
},
|
|
520
524
|
get item() {
|
|
521
|
-
return
|
|
525
|
+
return s.item;
|
|
522
526
|
},
|
|
523
527
|
get onScroll() {
|
|
524
|
-
return
|
|
528
|
+
return s.onScroll;
|
|
525
529
|
},
|
|
526
530
|
get onScrollEnd() {
|
|
527
|
-
return
|
|
531
|
+
return s.onScrollEnd;
|
|
528
532
|
},
|
|
529
533
|
get children() {
|
|
530
|
-
return
|
|
534
|
+
return s.children;
|
|
531
535
|
}
|
|
532
536
|
})), c;
|
|
533
537
|
var c;
|
|
534
538
|
};
|
|
535
539
|
|
|
536
|
-
var Q = /*#__PURE__*/
|
|
540
|
+
var Q = /*#__PURE__*/ s("<div style=overflow-anchor:none>");
|
|
537
541
|
|
|
538
542
|
const Z = t => {
|
|
539
543
|
let r;
|
|
540
|
-
const {ref: n, data:
|
|
544
|
+
const {ref: n, data: s, children: u, itemSize: p, shift: $, horizontal: z = !1, cache: w, onScrollEnd: x} = t, y = q(t.data.length, p, void 0, w, !p), I = ((e, t) => {
|
|
541
545
|
const r = t ? "width" : "height", n = t ? "innerWidth" : "innerHeight", o = new WeakMap, s = D((t => {
|
|
542
546
|
const n = [];
|
|
543
547
|
for (const {target: e, contentRect: s} of t) {
|
|
@@ -560,7 +564,7 @@ const Z = t => {
|
|
|
560
564
|
K: (e, t) => (o.set(e, t), s.q(e), () => {
|
|
561
565
|
o.delete(e), s.N(e);
|
|
562
566
|
}),
|
|
563
|
-
|
|
567
|
+
p() {
|
|
564
568
|
i && i(), s.W();
|
|
565
569
|
}
|
|
566
570
|
};
|
|
@@ -582,16 +586,16 @@ const Z = t => {
|
|
|
582
586
|
return {
|
|
583
587
|
Z(c) {
|
|
584
588
|
r = c;
|
|
585
|
-
const u = t ? "scrollX" : "scrollY",
|
|
586
|
-
t && (s = "rtl" === getComputedStyle(E(
|
|
587
|
-
r ?
|
|
589
|
+
const u = t ? "scrollX" : "scrollY", f = H(c), a = L(f);
|
|
590
|
+
t && (s = "rtl" === getComputedStyle(E(f)).direction), n = X(e, a, t, (() => V(a[u], s)), ((t, r) => {
|
|
591
|
+
r ? a.scroll({
|
|
588
592
|
[i]: V(e.M() + t, s)
|
|
589
|
-
}) :
|
|
593
|
+
}) : a.scrollBy({
|
|
590
594
|
[i]: V(t, s)
|
|
591
595
|
});
|
|
592
|
-
}), (() => l(c,
|
|
596
|
+
}), (() => l(c, f.body, a, t))), o[1](!0);
|
|
593
597
|
},
|
|
594
|
-
|
|
598
|
+
p() {
|
|
595
599
|
n && n.W(), r = void 0, o[1](!1), o = T();
|
|
596
600
|
},
|
|
597
601
|
ee: () => s,
|
|
@@ -607,25 +611,23 @@ const Z = t => {
|
|
|
607
611
|
o = "end";
|
|
608
612
|
}
|
|
609
613
|
}
|
|
610
|
-
const u = H(r),
|
|
611
|
-
c((() => i + l(r, u.body,
|
|
614
|
+
const u = H(r), f = L(u), a = E(u), d = () => e.R() - (t ? a.clientWidth : a.clientHeight);
|
|
615
|
+
c((() => i + l(r, u.body, f, t) + e.I(n) + ("end" === o ? e.k(n) - (e.R() - d()) : "center" === o ? (e.k(n) - (e.R() - d())) / 2 : 0)), s);
|
|
612
616
|
}
|
|
613
617
|
};
|
|
614
|
-
})(y, z), [O, R] = g(y.
|
|
618
|
+
})(y, z), [O, R] = g(y.v());
|
|
615
619
|
y.C(1, (() => {
|
|
616
|
-
R(y.
|
|
620
|
+
R(y.v());
|
|
617
621
|
})), y.C(4, (() => {
|
|
618
|
-
|
|
619
|
-
null === (e = t.onScroll) || void 0 === e || e.call(t);
|
|
622
|
+
t.onScroll?.();
|
|
620
623
|
})), y.C(8, (() => {
|
|
621
|
-
|
|
622
|
-
null === (e = t.onScrollEnd) || void 0 === e || e.call(t);
|
|
624
|
+
t.onScrollEnd?.();
|
|
623
625
|
}));
|
|
624
|
-
const J =
|
|
626
|
+
const J = a((e => {
|
|
625
627
|
O();
|
|
626
628
|
const r = y.S(t.bufferSize);
|
|
627
629
|
return e && A(e, r) ? e : r;
|
|
628
|
-
})), P =
|
|
630
|
+
})), P = a((() => O() && y.O())), B = a((() => O() && y.P())), C = a((() => O() && M.ee()));
|
|
629
631
|
h((() => {
|
|
630
632
|
t.ref && t.ref({
|
|
631
633
|
get cache() {
|
|
@@ -642,12 +644,12 @@ const Z = t => {
|
|
|
642
644
|
getItemSize: y.k,
|
|
643
645
|
scrollToIndex: M.ne
|
|
644
646
|
}), I.G(r), M.Z(r), d((() => {
|
|
645
|
-
t.ref && t.ref(), y.
|
|
647
|
+
t.ref && t.ref(), y.p(), I.p(), M.p();
|
|
646
648
|
}));
|
|
647
|
-
})),
|
|
649
|
+
})), f(v(O, (() => {
|
|
648
650
|
M.oe();
|
|
649
651
|
})));
|
|
650
|
-
const W =
|
|
652
|
+
const W = a((() => {
|
|
651
653
|
const e = t.data.length;
|
|
652
654
|
m((() => {
|
|
653
655
|
e !== y.T() && y.H(5, [ e, t.shift ]);
|
|
@@ -657,13 +659,13 @@ const Z = t => {
|
|
|
657
659
|
return r;
|
|
658
660
|
}));
|
|
659
661
|
return j = Q(), "function" == typeof r ? i(r, j) : r = j, c(j, "contain", "size style"),
|
|
660
|
-
c(j, "flex", "none"), c(j, "position", "relative"),
|
|
662
|
+
c(j, "flex", "none"), c(j, "position", "relative"), o(j, e(S, {
|
|
661
663
|
get each() {
|
|
662
664
|
return W();
|
|
663
665
|
},
|
|
664
666
|
children: (r, n) => {
|
|
665
|
-
const o =
|
|
666
|
-
y._(o())))), c =
|
|
667
|
+
const o = a((() => J()[0] + n())), s = a((() => (O(), y.I(o(), C())))), i = a((() => (O(),
|
|
668
|
+
y._(o())))), c = a((() => m((() => t.children(r, o)))));
|
|
667
669
|
return e(U, {
|
|
668
670
|
get Y() {
|
|
669
671
|
return o();
|