virtua 0.49.0 → 0.49.2
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 +47 -47
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.js +47 -47
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +303 -306
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +343 -346
- package/lib/index.js.map +1 -1
- package/lib/react/VGrid.d.ts +0 -2
- package/lib/solid/index.cjs +81 -81
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +80 -80
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +5 -1
- package/lib/solid/index.jsx.map +1 -1
- package/lib/vue/VList.d.ts +3 -0
- package/lib/vue/Virtualizer.d.ts +3 -0
- package/lib/vue/WindowVirtualizer.d.ts +6 -3
- package/lib/vue/index.cjs +70 -70
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +70 -70
- package/lib/vue/index.js.map +1 -1
- package/package.json +29 -30
- package/lib/react/useMergeRefs.d.ts +0 -1
package/lib/vue/VList.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ interface VListInstance<T = unknown> extends VListHandle {
|
|
|
20
20
|
}) => VNode[];
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Virtualized list component. See {@link VListProps} and {@link VListHandle}.
|
|
25
|
+
*/
|
|
23
26
|
export declare const VList: {
|
|
24
27
|
new <T = unknown>(props: VListProps<T>): VListInstance<T>;
|
|
25
28
|
};
|
package/lib/vue/Virtualizer.d.ts
CHANGED
|
@@ -139,6 +139,9 @@ export interface VirtualizerHandle {
|
|
|
139
139
|
*/
|
|
140
140
|
scrollBy(offset: number): void;
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Customizable list virtualizer for advanced usage. See {@link VirtualizerProps} and {@link VirtualizerHandle}.
|
|
144
|
+
*/
|
|
142
145
|
export declare const Virtualizer: {
|
|
143
146
|
new <T = unknown>(props: VirtualizerProps<T>): VirtualizerInstance<T>;
|
|
144
147
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsxImportSource vue */
|
|
2
|
-
import { type VNode, type
|
|
2
|
+
import { type VNode, type NativeElements, type PublicProps } from "vue";
|
|
3
3
|
import { type ScrollToIndexOpts, type CacheSnapshot } from "../core/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Props of {@link WindowVirtualizer}.
|
|
@@ -33,12 +33,12 @@ export interface WindowVirtualizerProps<T = unknown> extends PublicProps {
|
|
|
33
33
|
* Component or element type for container element.
|
|
34
34
|
* @defaultValue "div"
|
|
35
35
|
*/
|
|
36
|
-
as?: keyof
|
|
36
|
+
as?: keyof NativeElements;
|
|
37
37
|
/**
|
|
38
38
|
* Component or element type for item element.
|
|
39
39
|
* @defaultValue "div"
|
|
40
40
|
*/
|
|
41
|
-
item?: keyof
|
|
41
|
+
item?: keyof NativeElements;
|
|
42
42
|
/**
|
|
43
43
|
* You can restore cache by passing a {@link CacheSnapshot} on mount. This is useful when you want to restore scroll position after navigation. The snapshot can be obtained from {@link WindowVirtualizerHandle.cache}.
|
|
44
44
|
*
|
|
@@ -101,6 +101,9 @@ export interface WindowVirtualizerHandle {
|
|
|
101
101
|
*/
|
|
102
102
|
scrollToIndex(index: number, opts?: ScrollToIndexOpts): void;
|
|
103
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* {@link Virtualizer} controlled by the window scrolling. See {@link WindowVirtualizerProps} and {@link WindowVirtualizerHandle}.
|
|
106
|
+
*/
|
|
104
107
|
export declare const WindowVirtualizer: {
|
|
105
108
|
new <T = unknown>(props: WindowVirtualizerProps<T>): WindowVirtualizerInstance<T>;
|
|
106
109
|
};
|
package/lib/vue/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var e = require("vue");
|
|
2
2
|
|
|
3
|
-
const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n, o(t, e)), l = e => [ ...e ].sort((
|
|
3
|
+
const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n, o(t, e)), l = e => [ ...e ].sort((e, t) => e - t), c = "function" == typeof queueMicrotask ? queueMicrotask : e => {
|
|
4
4
|
Promise.resolve().then(e);
|
|
5
5
|
}, a = () => {
|
|
6
6
|
let e;
|
|
7
|
-
return [ new Promise(
|
|
7
|
+
return [ new Promise(t => {
|
|
8
8
|
e = t;
|
|
9
|
-
})
|
|
9
|
+
}), e ];
|
|
10
10
|
}, u = e => {
|
|
11
11
|
let t;
|
|
12
12
|
return () => (e && (t = e(), e = void 0), t);
|
|
@@ -37,8 +37,8 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
37
37
|
}, _ = (e, t, o) => {
|
|
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
|
-
e.o * n) : (e.u.splice(n), (o ? e.t.splice(0, -n) : e.t.splice(n)).reduce((
|
|
41
|
-
}, b = e => e.documentElement, g = e => e.ownerDocument, v = e => e.defaultView, y = /*#__PURE__*/ u((
|
|
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, 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
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,
|
|
@@ -115,16 +115,16 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
115
115
|
|
|
116
116
|
case 3:
|
|
117
117
|
{
|
|
118
|
-
const e = r.filter((
|
|
118
|
+
const e = r.filter(([e, t]) => !C(e, t));
|
|
119
119
|
if (!e.length) break;
|
|
120
|
-
H(e.reduce((
|
|
120
|
+
H(e.reduce((e, [t, r]) => {
|
|
121
121
|
let o;
|
|
122
122
|
if (2 === I) o = !0; else if (O && 1 === I) o = t < O[0]; else {
|
|
123
123
|
const e = T(), r = R(t), n = A(t);
|
|
124
|
-
o = 1 !== w && 0 === I ? r + n
|
|
124
|
+
o = 1 !== w && 0 === I ? r + n <= e : r < e && r + n < e + g;
|
|
125
125
|
}
|
|
126
126
|
return o && (e += r - A(t)), e;
|
|
127
|
-
}
|
|
127
|
+
}, 0));
|
|
128
128
|
for (const [t, r] of e) {
|
|
129
129
|
const e = A(t), o = p(q, t, r);
|
|
130
130
|
a && (j += o ? r : r - e);
|
|
@@ -132,9 +132,9 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
132
132
|
a && g && j > g && (H(((e, t) => {
|
|
133
133
|
let r = 0;
|
|
134
134
|
const n = [];
|
|
135
|
-
e.t.forEach((
|
|
135
|
+
e.t.forEach((e, o) => {
|
|
136
136
|
-1 !== e && (n.push(e), o < t && r++);
|
|
137
|
-
})
|
|
137
|
+
}), e.i = -1;
|
|
138
138
|
const s = l(n), i = s.length, c = i / 2 | 0, a = i % 2 == 0 ? (s[c - 1] + s[c]) / 2 : s[c], u = e.o;
|
|
139
139
|
return ((e.o = a) - u) * o(t - r, 0);
|
|
140
140
|
})(q, h(q, M()))), a = !1), c = 3, i = !0;
|
|
@@ -160,9 +160,9 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
160
160
|
case 8:
|
|
161
161
|
O = E(r, r + g), c = 1;
|
|
162
162
|
}
|
|
163
|
-
c && (b = 1 + (2147483647 & b), s && x && (z += x, x = 0), B.forEach((
|
|
163
|
+
c && (b = 1 + (2147483647 & b), s && x && (z += x, x = 0), B.forEach(([e, t]) => {
|
|
164
164
|
c & e && t(i);
|
|
165
|
-
}))
|
|
165
|
+
}));
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
}, x = setTimeout, $ = (e, t) => t ? -e : e, w = (e, r, o, n, s, i) => {
|
|
@@ -173,12 +173,12 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
173
173
|
const o = () => {
|
|
174
174
|
r != t && clearTimeout(r);
|
|
175
175
|
}, n = () => {
|
|
176
|
-
o(), r = x((
|
|
176
|
+
o(), r = x(() => {
|
|
177
177
|
r = t, (() => {
|
|
178
178
|
if (a || u) return a = !1, void p();
|
|
179
179
|
f = !1, e.A(2);
|
|
180
180
|
})();
|
|
181
|
-
}
|
|
181
|
+
}, 150);
|
|
182
182
|
};
|
|
183
183
|
return n.C = o, n;
|
|
184
184
|
})(), m = () => {
|
|
@@ -217,11 +217,11 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
217
217
|
const [t, r] = a();
|
|
218
218
|
return o = () => {
|
|
219
219
|
r(!1);
|
|
220
|
-
}, e.B() && x(o, 150), [ t, e.R(2, (
|
|
220
|
+
}, e.B() && x(o, 150), [ t, e.R(2, () => {
|
|
221
221
|
r(!0);
|
|
222
|
-
})
|
|
222
|
+
}) ];
|
|
223
223
|
};
|
|
224
|
-
if (s && S()) e.A(8, n()), c(
|
|
224
|
+
if (s && S()) e.A(8, n()), c(async () => {
|
|
225
225
|
for (;;) {
|
|
226
226
|
let t = !0;
|
|
227
227
|
for (let [r, o] = e.v(); r <= o; r++) if (e.I(r)) {
|
|
@@ -237,7 +237,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
e.A(7), r(n(), s);
|
|
240
|
-
})
|
|
240
|
+
}); else for (;;) {
|
|
241
241
|
const [t, o] = i();
|
|
242
242
|
try {
|
|
243
243
|
if (e.A(7), r(n()), !await t) return;
|
|
@@ -299,10 +299,10 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
299
299
|
ee: Object
|
|
300
300
|
},
|
|
301
301
|
setup(t) {
|
|
302
|
-
const r = e.ref(), o = e.computed((
|
|
303
|
-
return e.watch((
|
|
302
|
+
const r = e.ref(), o = e.computed(() => t.L.value && t.W.O(t.D, t.K)), n = e.computed(() => t.L.value && t.W.I(t.D));
|
|
303
|
+
return e.watch(() => r.value && t.D, (e, o, n) => {
|
|
304
304
|
n(t.Y(r.value, t.D));
|
|
305
|
-
}
|
|
305
|
+
}, {
|
|
306
306
|
flush: "post"
|
|
307
307
|
}), () => {
|
|
308
308
|
const {X: s, U: i, G: l, Z: c} = t, a = n.value, {style: u, ...f} = t.ee ?? {}, d = {
|
|
@@ -363,14 +363,14 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
363
363
|
let u = !!r.ssrCount;
|
|
364
364
|
const f = r.horizontal, d = e.ref(), p = z(r.data.length, r.itemSize, r.ssrCount, r.cache, !r.itemSize), m = ((e, r) => {
|
|
365
365
|
let o;
|
|
366
|
-
const n = r ? "width" : "height", s = new WeakMap, i = O(
|
|
366
|
+
const n = r ? "width" : "height", s = new WeakMap, i = O(r => {
|
|
367
367
|
const i = [];
|
|
368
368
|
for (const {target: l, contentRect: c} of r) if (l.offsetParent) if (l === o) e.A(4, c[n]); else {
|
|
369
369
|
const e = s.get(l);
|
|
370
370
|
e != t && i.push([ e, c[n] ]);
|
|
371
371
|
}
|
|
372
372
|
i.length && e.A(3, i);
|
|
373
|
-
})
|
|
373
|
+
});
|
|
374
374
|
return {
|
|
375
375
|
te(e) {
|
|
376
376
|
i.F(o = e);
|
|
@@ -382,33 +382,33 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
382
382
|
};
|
|
383
383
|
})(p, f), h = ((e, t) => {
|
|
384
384
|
let r, o, n = a(), s = !1;
|
|
385
|
-
const l = t ? "scrollLeft" : "scrollTop", c = t ? "overflowX" : "overflowY", [u, f] = I(e, (
|
|
385
|
+
const l = t ? "scrollLeft" : "scrollTop", c = t ? "overflowX" : "overflowY", [u, f] = I(e, () => n[0], (e, o) => {
|
|
386
386
|
e = $(e, s), o ? r.scrollTo({
|
|
387
387
|
[t ? "left" : "top"]: e,
|
|
388
388
|
behavior: "smooth"
|
|
389
389
|
}) : r[l] = e;
|
|
390
|
-
})
|
|
390
|
+
});
|
|
391
391
|
return {
|
|
392
392
|
oe(i, a) {
|
|
393
|
-
r = a, t && (s = "rtl" === getComputedStyle(a).direction), o = w(e, a, t, (
|
|
393
|
+
r = a, t && (s = "rtl" === getComputedStyle(a).direction), o = w(e, a, t, () => $(a[l], s), (t, r, o) => {
|
|
394
394
|
if (o) {
|
|
395
395
|
const e = a.style, t = e[c];
|
|
396
|
-
e[c] = "hidden", x((
|
|
396
|
+
e[c] = "hidden", x(() => {
|
|
397
397
|
e[c] = t;
|
|
398
|
-
})
|
|
398
|
+
});
|
|
399
399
|
}
|
|
400
400
|
a[l] = $(e.N() + t, s), r && f();
|
|
401
|
-
})
|
|
401
|
+
}), n[1](!0);
|
|
402
402
|
},
|
|
403
403
|
p() {
|
|
404
404
|
o && o.H(), n[1](!1), n = a();
|
|
405
405
|
},
|
|
406
406
|
ne: () => s,
|
|
407
407
|
se(e) {
|
|
408
|
-
u((
|
|
408
|
+
u(() => e);
|
|
409
409
|
},
|
|
410
410
|
ie(t) {
|
|
411
|
-
t += e.N(), u((
|
|
411
|
+
t += e.N(), u(() => t);
|
|
412
412
|
},
|
|
413
413
|
le(t, {align: r, smooth: o, offset: n = 0} = {}) {
|
|
414
414
|
if (t = i(t, 0, e.j() - 1), "nearest" === r) {
|
|
@@ -418,47 +418,47 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
418
418
|
r = "end";
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
u((
|
|
421
|
+
u(() => n + e.T() + e.O(t) + ("end" === r ? e.k(t) - e.B() : "center" === r ? (e.k(t) - e.B()) / 2 : 0), o);
|
|
422
422
|
},
|
|
423
423
|
ce: () => {
|
|
424
424
|
o && o.V();
|
|
425
425
|
}
|
|
426
426
|
};
|
|
427
427
|
})(p, f), _ = e.ref(p.m());
|
|
428
|
-
p.R(1, (
|
|
428
|
+
p.R(1, () => {
|
|
429
429
|
_.value = p.m();
|
|
430
|
-
})
|
|
430
|
+
}), p.R(4, () => {
|
|
431
431
|
n("scroll", p.N());
|
|
432
|
-
})
|
|
432
|
+
}), p.R(8, () => {
|
|
433
433
|
n("scrollEnd");
|
|
434
|
-
})
|
|
435
|
-
const b = e.computed(
|
|
434
|
+
});
|
|
435
|
+
const b = e.computed(e => {
|
|
436
436
|
_.value;
|
|
437
437
|
const t = p.v(r.bufferSize);
|
|
438
438
|
return e && N(e, t) ? e : t;
|
|
439
|
-
})
|
|
440
|
-
return e.onMounted((
|
|
439
|
+
}), g = e.computed(() => _.value && p.q()), v = e.computed(() => _.value && p.M());
|
|
440
|
+
return e.onMounted(() => {
|
|
441
441
|
u = !1;
|
|
442
|
-
const t = d.value, o = requestAnimationFrame((
|
|
442
|
+
const t = d.value, o = requestAnimationFrame(() => {
|
|
443
443
|
const e = e => {
|
|
444
444
|
m.te(e), h.oe(t, e);
|
|
445
445
|
};
|
|
446
446
|
r.scrollRef ? e(r.scrollRef) : e(t.parentElement);
|
|
447
|
-
})
|
|
448
|
-
e.onUnmounted((
|
|
447
|
+
});
|
|
448
|
+
e.onUnmounted(() => {
|
|
449
449
|
cancelAnimationFrame(o);
|
|
450
|
-
})
|
|
451
|
-
})
|
|
450
|
+
});
|
|
451
|
+
}), e.onUnmounted(() => {
|
|
452
452
|
p.p(), m.p(), h.p();
|
|
453
|
-
})
|
|
453
|
+
}), e.watch(() => r.data.length, e => {
|
|
454
454
|
p.A(5, [ e, r.shift ]);
|
|
455
|
-
})
|
|
455
|
+
}), e.watch(() => r.startMargin, e => {
|
|
456
456
|
p.A(6, e);
|
|
457
|
-
}
|
|
457
|
+
}, {
|
|
458
458
|
immediate: !0
|
|
459
|
-
}), e.watch([ _ ], (
|
|
459
|
+
}), e.watch([ _ ], () => {
|
|
460
460
|
h.ce();
|
|
461
|
-
}
|
|
461
|
+
}, {
|
|
462
462
|
flush: "post"
|
|
463
463
|
}), s({
|
|
464
464
|
get cache() {
|
|
@@ -505,9 +505,9 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
505
505
|
if (r.keepMounted) {
|
|
506
506
|
const e = new Set(r.keepMounted);
|
|
507
507
|
for (let [t, r] = b.value; t <= r; t++) e.add(t);
|
|
508
|
-
l([ ...e ]).forEach(
|
|
508
|
+
l([ ...e ]).forEach(e => {
|
|
509
509
|
i.push(a(e));
|
|
510
|
-
})
|
|
510
|
+
});
|
|
511
511
|
} else for (let [e, t] = b.value; e <= t; e++) i.push(a(e));
|
|
512
512
|
return e.createVNode(t, {
|
|
513
513
|
ref: d,
|
|
@@ -620,7 +620,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
620
620
|
emits: [ "scroll", "scrollEnd" ],
|
|
621
621
|
setup(r, {emit: o, slots: n, expose: s}) {
|
|
622
622
|
const l = r.horizontal, u = e.ref(), f = z(r.data.length, r.itemSize, void 0, r.cache, !r.itemSize), d = ((e, r) => {
|
|
623
|
-
const o = r ? "width" : "height", n = r ? "innerWidth" : "innerHeight", s = new WeakMap, i = O(
|
|
623
|
+
const o = r ? "width" : "height", n = r ? "innerWidth" : "innerHeight", s = new WeakMap, i = O(r => {
|
|
624
624
|
const n = [];
|
|
625
625
|
for (const {target: e, contentRect: i} of r) {
|
|
626
626
|
if (!e.offsetParent) continue;
|
|
@@ -628,7 +628,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
628
628
|
r != t && n.push([ r, i[o] ]);
|
|
629
629
|
}
|
|
630
630
|
n.length && e.A(3, n);
|
|
631
|
-
})
|
|
631
|
+
});
|
|
632
632
|
let l;
|
|
633
633
|
return {
|
|
634
634
|
te(t) {
|
|
@@ -648,7 +648,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
648
648
|
};
|
|
649
649
|
})(f, l), p = ((e, t) => {
|
|
650
650
|
let r, o, n = a(), s = !1;
|
|
651
|
-
const l = t ? "left" : "top", [c] = I(e, (
|
|
651
|
+
const l = t ? "left" : "top", [c] = I(e, () => n[0], (e, t) => {
|
|
652
652
|
e = $(e, s);
|
|
653
653
|
const o = v(g(r));
|
|
654
654
|
t ? o.scroll({
|
|
@@ -657,7 +657,7 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
657
657
|
}) : o.scroll({
|
|
658
658
|
[l]: e
|
|
659
659
|
});
|
|
660
|
-
})
|
|
660
|
+
}), u = (e, t, r, o, n = 0) => {
|
|
661
661
|
const i = o ? "offsetLeft" : "offsetTop", l = n + (o && s ? r.innerWidth - e[i] - e.offsetWidth : e[i]), c = e.offsetParent;
|
|
662
662
|
return e !== t && c ? u(c, t, r, o, l) : l;
|
|
663
663
|
};
|
|
@@ -665,13 +665,13 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
665
665
|
oe(i) {
|
|
666
666
|
r = i;
|
|
667
667
|
const c = t ? "scrollX" : "scrollY", a = g(i), f = v(a);
|
|
668
|
-
t && (s = "rtl" === getComputedStyle(b(a)).direction), o = w(e, f, t, (
|
|
668
|
+
t && (s = "rtl" === getComputedStyle(b(a)).direction), o = w(e, f, t, () => $(f[c], s), (t, r) => {
|
|
669
669
|
r ? f.scroll({
|
|
670
670
|
[l]: $(e.N() + t, s)
|
|
671
671
|
}) : f.scrollBy({
|
|
672
672
|
[l]: $(t, s)
|
|
673
673
|
});
|
|
674
|
-
}
|
|
674
|
+
}, () => u(i, a.body, f, t)), n[1](!0);
|
|
675
675
|
},
|
|
676
676
|
p() {
|
|
677
677
|
o && o.H(), r = void 0, n[1](!1), n = a();
|
|
@@ -690,32 +690,32 @@ const t = null, {min: r, max: o, abs: n, floor: s} = Math, i = (e, t, n) => r(n,
|
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
const a = g(r), f = v(a), d = b(a), p = () => e.B() - (t ? d.clientWidth : d.clientHeight);
|
|
693
|
-
c((
|
|
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);
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
696
|
})(f, l), m = e.ref(f.m());
|
|
697
|
-
f.R(1, (
|
|
697
|
+
f.R(1, () => {
|
|
698
698
|
m.value = f.m();
|
|
699
|
-
})
|
|
699
|
+
}), f.R(4, () => {
|
|
700
700
|
o("scroll");
|
|
701
|
-
})
|
|
701
|
+
}), f.R(8, () => {
|
|
702
702
|
o("scrollEnd");
|
|
703
|
-
})
|
|
704
|
-
const h = e.computed(
|
|
703
|
+
});
|
|
704
|
+
const h = e.computed(e => {
|
|
705
705
|
m.value;
|
|
706
706
|
const t = f.v(r.bufferSize);
|
|
707
707
|
return e && N(e, t) ? e : t;
|
|
708
|
-
})
|
|
709
|
-
return e.onMounted((
|
|
708
|
+
}), _ = e.computed(() => m.value && f.q()), y = e.computed(() => m.value && f.M());
|
|
709
|
+
return e.onMounted(() => {
|
|
710
710
|
const e = u.value;
|
|
711
711
|
e && (d.te(e), p.oe(e));
|
|
712
|
-
})
|
|
712
|
+
}), e.onUnmounted(() => {
|
|
713
713
|
f.p(), d.p(), p.p();
|
|
714
|
-
})
|
|
714
|
+
}), e.watch(() => r.data.length, e => {
|
|
715
715
|
f.A(5, [ e, r.shift ]);
|
|
716
|
-
})
|
|
716
|
+
}), e.watch([ m ], () => {
|
|
717
717
|
p.ce();
|
|
718
|
-
}
|
|
718
|
+
}, {
|
|
719
719
|
flush: "post"
|
|
720
720
|
}), s({
|
|
721
721
|
get cache() {
|