@aiquants/virtualscroll 1.25.0 → 2.1.0
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/CHANGELOG.md +60 -1
- package/README.md +8 -7
- package/dist/VirtualScroll.d.cts +28 -4
- package/dist/VirtualScroll.d.ts +28 -4
- package/dist/VirtualScroll.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +298 -294
- package/dist/styles/virtualscroll.css +1 -1
- package/dist/styles/virtualscroll.standalone.css +1 -1
- package/package.json +1 -1
- package/src/VirtualScroll.tsx +48 -7
- package/src/styles/virtualscroll.css +15 -0
package/dist/index.js
CHANGED
|
@@ -190,10 +190,10 @@ const Ke = {
|
|
|
190
190
|
[r]
|
|
191
191
|
), W = S(
|
|
192
192
|
(T, q, H = !1) => {
|
|
193
|
-
const { x: Ht, y: Dt } = C.current, et = T - Ht, nt = q - Dt, G = Math.abs(nt), J = G < ze ? 0 : nt < 0 ? -1 : 1,
|
|
193
|
+
const { x: Ht, y: Dt } = C.current, et = T - Ht, nt = q - Dt, G = Math.abs(nt), J = G < ze ? 0 : nt < 0 ? -1 : 1, vt = V.current;
|
|
194
194
|
let Lt = J;
|
|
195
|
-
const
|
|
196
|
-
J === 0 ?
|
|
195
|
+
const jt = ze + or;
|
|
196
|
+
J === 0 ? vt !== 0 && G < jt ? Lt = vt : (Lt = 0, H || (V.current = 0)) : J !== vt && vt !== 0 && G < jt ? Lt = vt : V.current = J, z({
|
|
197
197
|
active: H || G >= ze,
|
|
198
198
|
offsetX: et,
|
|
199
199
|
offsetY: nt,
|
|
@@ -238,7 +238,7 @@ const Ke = {
|
|
|
238
238
|
T.preventDefault(), W(T.clientX, T.clientY);
|
|
239
239
|
},
|
|
240
240
|
[W]
|
|
241
|
-
),
|
|
241
|
+
), Et = S(
|
|
242
242
|
(T) => {
|
|
243
243
|
if (I.current !== T.pointerId) {
|
|
244
244
|
v.current !== null && v.current.pointerId === T.pointerId && (v.current = null);
|
|
@@ -280,10 +280,10 @@ const Ke = {
|
|
|
280
280
|
}),
|
|
281
281
|
[Q]
|
|
282
282
|
);
|
|
283
|
-
const O = Math.min(Math.max(s, 0), 1),
|
|
283
|
+
const O = Math.min(Math.max(s, 0), 1), P = n / 64, U = Math.min(d.distance, e) / e, Z = d.direction * U * 10 * P, w = a ?? ar, lt = {
|
|
284
284
|
dragState: d,
|
|
285
285
|
normalizedDistance: U,
|
|
286
|
-
sizeScale:
|
|
286
|
+
sizeScale: P,
|
|
287
287
|
size: n,
|
|
288
288
|
opacity: O
|
|
289
289
|
}, j = {
|
|
@@ -302,8 +302,8 @@ const Ke = {
|
|
|
302
302
|
tabIndex: -1,
|
|
303
303
|
onPointerDown: tt,
|
|
304
304
|
onPointerMove: xt,
|
|
305
|
-
onPointerUp:
|
|
306
|
-
onPointerCancel:
|
|
305
|
+
onPointerUp: Et,
|
|
306
|
+
onPointerCancel: Et,
|
|
307
307
|
onLostPointerCapture: A,
|
|
308
308
|
role: "presentation",
|
|
309
309
|
children: w(lt)
|
|
@@ -317,7 +317,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
317
317
|
maxDistance: 240,
|
|
318
318
|
/** 最小速度倍率 (ビューポート比)。 */
|
|
319
319
|
minSpeedMultiplier: 0.2
|
|
320
|
-
}, fr = rr.maxDistance, je = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Ye = 2.2, mr = 8, pr = 120, hr = 1 / 10,
|
|
320
|
+
}, fr = rr.maxDistance, je = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Ye = 2.2, mr = 8, pr = 120, hr = 1 / 10, ee = {
|
|
321
321
|
enabled: !0,
|
|
322
322
|
size: 40,
|
|
323
323
|
offsetX: -80,
|
|
@@ -351,17 +351,17 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
351
351
|
}, br = (r, t) => {
|
|
352
352
|
const e = r?.maxSpeedMultiplier, n = typeof e == "number" ? e : vr(t);
|
|
353
353
|
return {
|
|
354
|
-
enabled: r?.enabled ??
|
|
355
|
-
size: r?.size ??
|
|
356
|
-
offsetX: r?.offsetX ??
|
|
357
|
-
offsetY: r?.offsetY ??
|
|
358
|
-
className: r?.className ??
|
|
359
|
-
maxVisualDistance: r?.maxVisualDistance ??
|
|
354
|
+
enabled: r?.enabled ?? ee.enabled,
|
|
355
|
+
size: r?.size ?? ee.size,
|
|
356
|
+
offsetX: r?.offsetX ?? ee.offsetX,
|
|
357
|
+
offsetY: r?.offsetY ?? ee.offsetY,
|
|
358
|
+
className: r?.className ?? ee.className,
|
|
359
|
+
maxVisualDistance: r?.maxVisualDistance ?? ee.maxVisualDistance,
|
|
360
360
|
maxSpeedMultiplier: n,
|
|
361
|
-
minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ??
|
|
362
|
-
opacity: rt(r?.opacity ??
|
|
363
|
-
renderVisual: r?.renderVisual ??
|
|
364
|
-
maxSpeedCurve: r?.maxSpeedCurve ??
|
|
361
|
+
minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ?? ee.minSpeedMultiplier, 0),
|
|
362
|
+
opacity: rt(r?.opacity ?? ee.opacity, 0, 1),
|
|
363
|
+
renderVisual: r?.renderVisual ?? ee.renderVisual,
|
|
364
|
+
maxSpeedCurve: r?.maxSpeedCurve ?? ee.maxSpeedCurve
|
|
365
365
|
};
|
|
366
366
|
}, xr = ({ isDragging: r, isThumbHovered: t, enableThumbDrag: e }) => Ft(() => e ? r ? "dragging" : t ? "hover" : "idle" : "disabled", [e, r, t]), Ir = ({ canUseArrowButtons: r, enableArrowButtons: t, resetTapScroll: e, scrollByStep: n }) => {
|
|
367
367
|
const i = x(null), s = x(null), a = x(null), c = S(() => {
|
|
@@ -396,12 +396,12 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
396
396
|
const c = Math.max(he(r, 0), 0), d = he(t, 0), b = d > 0 ? Math.min(c, d) / d : 1, I = Math.max(he(e, 0), 0), v = Math.max(he(n, 0), 0), C = Math.max(he(i, 0), 0), p = Math.max(I * v, 40), V = s ? p : 1200, z = Math.max(I * C, V), W = a ? Math.max(he(a.exponentialScale, C), 0) : 0, at = a ? Math.min(z, Math.max(I * W, p)) : z, Q = Math.max(at, p);
|
|
397
397
|
let tt = b ** 1.1;
|
|
398
398
|
if (a) {
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
399
|
+
const Et = Math.min(Math.max(he(a.exponentialSteepness, 0), 0), Tr);
|
|
400
|
+
if (Et === 0)
|
|
401
401
|
tt = b;
|
|
402
402
|
else {
|
|
403
|
-
const A = Math.expm1(
|
|
404
|
-
tt = Math.min(Math.max(Math.expm1(
|
|
403
|
+
const A = Math.expm1(Et) || 1;
|
|
404
|
+
tt = Math.min(Math.max(Math.expm1(Et * b) / A, 0), 1);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
const xt = Math.min(Math.max(he(a?.easedOffset, 0), 0), 1);
|
|
@@ -411,7 +411,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
411
411
|
return Ye;
|
|
412
412
|
const t = Math.max(1, r), e = Math.log10(t), n = Ye + e * mr;
|
|
413
413
|
return rt(n, Ye, pr);
|
|
414
|
-
},
|
|
414
|
+
}, Pr = ({
|
|
415
415
|
contentSize: r,
|
|
416
416
|
viewportSize: t,
|
|
417
417
|
scrollPosition: e,
|
|
@@ -429,45 +429,45 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
429
429
|
visibleStartIndex: V,
|
|
430
430
|
visibleEndIndex: z
|
|
431
431
|
}) => {
|
|
432
|
-
const [W, at] = re(!1), [Q, tt] = re(!1), [xt,
|
|
432
|
+
const [W, at] = re(!1), [Q, tt] = re(!1), [xt, Et] = re(!1), A = x(null), O = x({
|
|
433
433
|
pointerId: null,
|
|
434
434
|
startThumbPosition: 0,
|
|
435
435
|
startClientX: 0,
|
|
436
436
|
startClientY: 0,
|
|
437
437
|
scale: 1,
|
|
438
438
|
captureTarget: null
|
|
439
|
-
}),
|
|
439
|
+
}), P = x({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), U = x(e), Z = x(n), w = x(je), lt = x(null), j = x(null), T = x(null), q = x(0), H = x(0), Ht = Ft(() => br(v, C), [C, v]), Dt = Ft(() => gr(c), [c]), {
|
|
440
440
|
enabled: et,
|
|
441
441
|
size: nt,
|
|
442
442
|
offsetX: G,
|
|
443
443
|
offsetY: J,
|
|
444
|
-
className:
|
|
444
|
+
className: vt,
|
|
445
445
|
maxVisualDistance: Lt,
|
|
446
|
-
maxSpeedMultiplier:
|
|
446
|
+
maxSpeedMultiplier: jt,
|
|
447
447
|
minSpeedMultiplier: R,
|
|
448
448
|
opacity: de,
|
|
449
449
|
renderVisual: it,
|
|
450
450
|
maxSpeedCurve: E
|
|
451
|
-
} = Ht,
|
|
451
|
+
} = Ht, Vt = x({
|
|
452
452
|
viewportSize: t,
|
|
453
453
|
maxScrollPosition: Math.max(r - t, 0),
|
|
454
454
|
scrollBarVisible: r > t,
|
|
455
455
|
effectiveTapMaxDistance: Math.max(Lt, 1),
|
|
456
|
-
tapCircleMaxSpeedMultiplier:
|
|
456
|
+
tapCircleMaxSpeedMultiplier: jt,
|
|
457
457
|
tapCircleMinSpeedMultiplier: R,
|
|
458
458
|
tapCircleMaxSpeedCurve: E,
|
|
459
459
|
tapScrollCircleOptions: v,
|
|
460
460
|
effectiveTrackLength: 0,
|
|
461
461
|
onScroll: n,
|
|
462
462
|
scrollPosition: e
|
|
463
|
-
}), { mainSizeKey: zt, crossSizeKey:
|
|
463
|
+
}), { mainSizeKey: zt, crossSizeKey: Jt, positionKey: $t, selectDelta: h, getPointerCoordinate: k, arrowLabels: gt, arrowIcons: X, directionClass: Pt, orientation: ct } = Dt, It = Math.max(Lt, 1), Mt = t / r, yt = Math.max(t - d * 2, 0), ut = Mt * yt, At = Math.min(Math.max(We, ut || 0), yt || We), dt = r - t, st = Math.max(yt - At, 0), _t = dt <= 0 || st <= 0 ? 0 : rt(e / dt * st, 0, st), Xt = _t + At / 2, Nt = r > t || W, ne = Nt && a;
|
|
464
464
|
ye(() => {
|
|
465
|
-
|
|
465
|
+
Vt.current = {
|
|
466
466
|
viewportSize: t,
|
|
467
467
|
maxScrollPosition: dt,
|
|
468
|
-
scrollBarVisible:
|
|
468
|
+
scrollBarVisible: Nt,
|
|
469
469
|
effectiveTapMaxDistance: It,
|
|
470
|
-
tapCircleMaxSpeedMultiplier:
|
|
470
|
+
tapCircleMaxSpeedMultiplier: jt,
|
|
471
471
|
tapCircleMinSpeedMultiplier: R,
|
|
472
472
|
tapCircleMaxSpeedCurve: E,
|
|
473
473
|
tapScrollCircleOptions: v,
|
|
@@ -482,8 +482,8 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
482
482
|
}, [n]), Y(() => {
|
|
483
483
|
i || tt(!1);
|
|
484
484
|
}, [i]);
|
|
485
|
-
const
|
|
486
|
-
const y =
|
|
485
|
+
const Gt = xr({ isDragging: W, isThumbHovered: Q, enableThumbDrag: i }), Ct = S((o, g) => {
|
|
486
|
+
const y = Vt.current, L = g ?? U.current;
|
|
487
487
|
if (Z.current) {
|
|
488
488
|
const Yt = Z.current(o, L);
|
|
489
489
|
if (typeof Yt == "number" && Number.isFinite(Yt))
|
|
@@ -493,21 +493,21 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
493
493
|
return U.current = Ot, Ot;
|
|
494
494
|
}, []), f = S(
|
|
495
495
|
(o) => {
|
|
496
|
-
const g =
|
|
496
|
+
const g = Vt.current, y = U.current;
|
|
497
497
|
if (!g.scrollBarVisible || g.maxScrollPosition <= 0) {
|
|
498
|
-
const ue =
|
|
498
|
+
const ue = Ct(0, y), l = ue - y;
|
|
499
499
|
return { nextPosition: ue, actualDelta: l, reachedBoundary: !0 };
|
|
500
500
|
}
|
|
501
501
|
if (o === 0)
|
|
502
502
|
return { nextPosition: y, actualDelta: 0, reachedBoundary: !1 };
|
|
503
|
-
const B =
|
|
504
|
-
return { nextPosition: B, actualDelta: bt, reachedBoundary:
|
|
503
|
+
const B = Ct((ue) => rt(ue + o, 0, g.maxScrollPosition), y), bt = B - y, Ot = o < 0 && y + o <= 0, Yt = o > 0 && y + o >= g.maxScrollPosition, Pe = o < 0 && (B <= 0 || Ot && bt === 0) || o > 0 && (B >= g.maxScrollPosition || Yt && bt === 0);
|
|
504
|
+
return { nextPosition: B, actualDelta: bt, reachedBoundary: Pe };
|
|
505
505
|
},
|
|
506
|
-
[
|
|
507
|
-
),
|
|
506
|
+
[Ct]
|
|
507
|
+
), M = S(
|
|
508
508
|
(o, g) => {
|
|
509
509
|
o.current += g;
|
|
510
|
-
const y = Math.max(
|
|
510
|
+
const y = Math.max(Vt.current.maxScrollPosition, 0);
|
|
511
511
|
y > 0 && (o.current = rt(o.current, -y, y));
|
|
512
512
|
const L = f(o.current);
|
|
513
513
|
return o.current -= L.actualDelta, L.reachedBoundary && (o.current = 0), L;
|
|
@@ -516,10 +516,10 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
516
516
|
), ft = S(() => {
|
|
517
517
|
j.current !== null && (window.cancelAnimationFrame(j.current), j.current = null), T.current = null, q.current = 0, H.current = 0;
|
|
518
518
|
}, []), Tt = S(() => {
|
|
519
|
-
w.current = { ...je },
|
|
520
|
-
}, [ft]),
|
|
519
|
+
w.current = { ...je }, Et(!1), lt.current?.reset(), ft();
|
|
520
|
+
}, [ft]), wt = S(
|
|
521
521
|
(o) => {
|
|
522
|
-
const g = w.current, y =
|
|
522
|
+
const g = w.current, y = Vt.current;
|
|
523
523
|
if (!g.active || g.direction === 0) {
|
|
524
524
|
ft();
|
|
525
525
|
return;
|
|
@@ -530,7 +530,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
530
530
|
}
|
|
531
531
|
const L = T.current ?? o, B = Math.max((o - L) / 1e3, 0), bt = Math.min(B, hr);
|
|
532
532
|
if (T.current = o, bt <= 0) {
|
|
533
|
-
j.current = window.requestAnimationFrame(
|
|
533
|
+
j.current = window.requestAnimationFrame(wt);
|
|
534
534
|
return;
|
|
535
535
|
}
|
|
536
536
|
const Ot = Sr({
|
|
@@ -543,26 +543,26 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
543
543
|
curve: y.tapCircleMaxSpeedCurve
|
|
544
544
|
});
|
|
545
545
|
H.current !== g.direction && (H.current = g.direction, q.current = 0);
|
|
546
|
-
const { reachedBoundary: Yt } =
|
|
546
|
+
const { reachedBoundary: Yt } = M(q, g.direction * Ot * bt);
|
|
547
547
|
if (Yt) {
|
|
548
548
|
ft();
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
-
j.current = window.requestAnimationFrame(
|
|
551
|
+
j.current = window.requestAnimationFrame(wt);
|
|
552
552
|
},
|
|
553
|
-
[
|
|
553
|
+
[M, ft]
|
|
554
554
|
), ie = S(() => {
|
|
555
|
-
j.current === null && (T.current = null, q.current = 0, j.current = window.requestAnimationFrame(
|
|
556
|
-
}, [
|
|
555
|
+
j.current === null && (T.current = null, q.current = 0, j.current = window.requestAnimationFrame(wt));
|
|
556
|
+
}, [wt]);
|
|
557
557
|
Y(() => {
|
|
558
558
|
const o = w.current;
|
|
559
559
|
!o.active || o.direction === 0 || ie();
|
|
560
560
|
}, [r, t, ie]), Y(() => () => {
|
|
561
561
|
ft();
|
|
562
562
|
}, [ft]);
|
|
563
|
-
const
|
|
563
|
+
const Qt = S(
|
|
564
564
|
(o) => {
|
|
565
|
-
w.current = o,
|
|
565
|
+
w.current = o, Et(o.active), o.active && o.direction !== 0 ? ie() : ft();
|
|
566
566
|
},
|
|
567
567
|
[ie, ft]
|
|
568
568
|
);
|
|
@@ -593,21 +593,21 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
593
593
|
document.removeEventListener("pointerdown", o, !0);
|
|
594
594
|
};
|
|
595
595
|
}, [Tt, et]);
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
596
|
+
const te = (o) => {
|
|
597
|
+
if (!Nt || st <= 0 || dt <= 0)
|
|
598
598
|
return 0;
|
|
599
599
|
const g = rt(o, 0, st);
|
|
600
600
|
return rt(g / st * dt, 0, dt);
|
|
601
601
|
}, Kt = S((o) => {
|
|
602
|
-
const { scrollBarVisible: g, effectiveTrackLength: y, maxScrollPosition: L } =
|
|
602
|
+
const { scrollBarVisible: g, effectiveTrackLength: y, maxScrollPosition: L } = Vt.current;
|
|
603
603
|
if (N.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: o, trackLen: y, maxScroll: L })), y <= 0 || L <= 0)
|
|
604
604
|
return null;
|
|
605
605
|
const B = rt(o, 0, y);
|
|
606
606
|
return rt(B / y * L, 0, L);
|
|
607
607
|
}, []), se = S(
|
|
608
608
|
(o) => {
|
|
609
|
-
const g = o.getBoundingClientRect(), y = c ? g.width : g.height, L = (
|
|
610
|
-
const ue = Number.parseFloat(
|
|
609
|
+
const g = o.getBoundingClientRect(), y = c ? g.width : g.height, L = (Pe) => {
|
|
610
|
+
const ue = Number.parseFloat(Pe);
|
|
611
611
|
return Number.isFinite(ue) ? ue : 0;
|
|
612
612
|
}, B = window.getComputedStyle(o), bt = L(c ? B.width : B.height), Ot = bt > 0 ? bt + L(c ? B.paddingLeft : B.paddingTop) + L(c ? B.paddingRight : B.paddingBottom) + L(c ? B.borderLeftWidth : B.borderTopWidth) + L(c ? B.borderRightWidth : B.borderBottomWidth) : 0, Yt = Ot > 0 ? Ot : c ? o.offsetWidth : o.offsetHeight;
|
|
613
613
|
return Yt <= 0 || y <= 0 ? 1 : y / Yt;
|
|
@@ -624,18 +624,18 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
624
624
|
startThumbPosition: g.startThumbPosition,
|
|
625
625
|
clientY: o.clientY,
|
|
626
626
|
startClientY: g.startClientY,
|
|
627
|
-
metrics:
|
|
627
|
+
metrics: Vt.current
|
|
628
628
|
}));
|
|
629
629
|
const bt = Kt(g.startThumbPosition + B);
|
|
630
|
-
bt !== null &&
|
|
630
|
+
bt !== null && Ct(bt), o.cancelable && o.preventDefault();
|
|
631
631
|
},
|
|
632
|
-
[h, Kt,
|
|
633
|
-
),
|
|
632
|
+
[h, Kt, Ct]
|
|
633
|
+
), Zt = S(
|
|
634
634
|
(o) => {
|
|
635
635
|
const g = O.current;
|
|
636
636
|
if (g.pointerId !== o.pointerId)
|
|
637
637
|
return;
|
|
638
|
-
document.removeEventListener("pointermove", fe), document.removeEventListener("pointerup",
|
|
638
|
+
document.removeEventListener("pointermove", fe), document.removeEventListener("pointerup", Zt), document.removeEventListener("pointercancel", Zt);
|
|
639
639
|
const y = g.captureTarget;
|
|
640
640
|
if (y?.hasPointerCapture?.(o.pointerId) && y.releasePointerCapture(o.pointerId), O.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, at(!1), A.current) {
|
|
641
641
|
const L = A.current.getBoundingClientRect();
|
|
@@ -646,21 +646,21 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
646
646
|
[fe]
|
|
647
647
|
);
|
|
648
648
|
Y(() => () => {
|
|
649
|
-
document.removeEventListener("pointermove", fe), document.removeEventListener("pointerup",
|
|
650
|
-
}, [fe,
|
|
649
|
+
document.removeEventListener("pointermove", fe), document.removeEventListener("pointerup", Zt), document.removeEventListener("pointercancel", Zt);
|
|
650
|
+
}, [fe, Zt]);
|
|
651
651
|
const we = x(0), mt = x(0), me = S(
|
|
652
652
|
(o) => {
|
|
653
|
-
const g = Math.max(Math.round(
|
|
654
|
-
mt.current !== o && (mt.current = o, we.current = 0),
|
|
653
|
+
const g = Math.max(Math.round(Vt.current.viewportSize / dr), ur);
|
|
654
|
+
mt.current !== o && (mt.current = o, we.current = 0), M(we, o * g);
|
|
655
655
|
},
|
|
656
|
-
[
|
|
656
|
+
[M]
|
|
657
657
|
), { handleArrowPointerDown: Ce, handleArrowPointerUp: ve, handleArrowKeyDown: Ut } = Ir({
|
|
658
658
|
canUseArrowButtons: ne,
|
|
659
659
|
enableArrowButtons: a,
|
|
660
660
|
resetTapScroll: Tt,
|
|
661
661
|
scrollByStep: me
|
|
662
662
|
}), Ve = (o) => {
|
|
663
|
-
if (!
|
|
663
|
+
if (!Nt)
|
|
664
664
|
return;
|
|
665
665
|
if (!i) {
|
|
666
666
|
o.preventDefault(), o.stopPropagation();
|
|
@@ -684,9 +684,9 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
684
684
|
startClientY: o.clientY,
|
|
685
685
|
scale: y,
|
|
686
686
|
captureTarget: L
|
|
687
|
-
}, document.addEventListener("pointermove", fe), document.addEventListener("pointerup",
|
|
687
|
+
}, document.addEventListener("pointermove", fe), document.addEventListener("pointerup", Zt), document.addEventListener("pointercancel", Zt), at(!0), tt(!0), o.preventDefault(), o.stopPropagation();
|
|
688
688
|
}, De = (o) => {
|
|
689
|
-
if (!
|
|
689
|
+
if (!Nt)
|
|
690
690
|
return;
|
|
691
691
|
if (!s) {
|
|
692
692
|
o.preventDefault(), o.stopPropagation();
|
|
@@ -696,13 +696,13 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
696
696
|
return;
|
|
697
697
|
const g = o.currentTarget, y = g.getBoundingClientRect(), L = k(o), B = se(g), bt = (L - (c ? y.left : y.top)) / B;
|
|
698
698
|
Tt();
|
|
699
|
-
const Ot = bt - At / 2, Yt =
|
|
700
|
-
if (
|
|
699
|
+
const Ot = bt - At / 2, Yt = te(Ot);
|
|
700
|
+
if (Ct(Yt), g.setPointerCapture)
|
|
701
701
|
try {
|
|
702
702
|
g.setPointerCapture(o.pointerId);
|
|
703
703
|
} catch {
|
|
704
704
|
}
|
|
705
|
-
|
|
705
|
+
P.current = {
|
|
706
706
|
pointerId: o.pointerId,
|
|
707
707
|
startThumbPosition: Ot,
|
|
708
708
|
startClientX: o.clientX,
|
|
@@ -710,29 +710,29 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
710
710
|
scale: B
|
|
711
711
|
}, o.preventDefault(), o.stopPropagation();
|
|
712
712
|
}, be = () => {
|
|
713
|
-
|
|
713
|
+
P.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
|
|
714
714
|
}, Ae = (o) => {
|
|
715
|
-
const g =
|
|
715
|
+
const g = P.current;
|
|
716
716
|
if (g.pointerId !== o.pointerId)
|
|
717
717
|
return;
|
|
718
718
|
if (o.pointerType === "mouse" && o.buttons === 0) {
|
|
719
719
|
be();
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
|
-
const y = o.clientX - g.startClientX, L = o.clientY - g.startClientY, B = h(y, L) / (g.scale || 1), bt =
|
|
723
|
-
|
|
722
|
+
const y = o.clientX - g.startClientX, L = o.clientY - g.startClientY, B = h(y, L) / (g.scale || 1), bt = te(g.startThumbPosition + B);
|
|
723
|
+
Ct(bt), o.cancelable && o.preventDefault();
|
|
724
724
|
}, ke = (o) => {
|
|
725
|
-
if (
|
|
725
|
+
if (P.current.pointerId !== o.pointerId)
|
|
726
726
|
return;
|
|
727
727
|
const g = o.currentTarget;
|
|
728
728
|
g.hasPointerCapture?.(o.pointerId) && g.releasePointerCapture(o.pointerId), be(), o.preventDefault(), o.stopPropagation();
|
|
729
729
|
}, oe = (o) => {
|
|
730
|
-
if (
|
|
730
|
+
if (P.current.pointerId !== o.pointerId)
|
|
731
731
|
return;
|
|
732
732
|
const g = o.currentTarget;
|
|
733
733
|
g.hasPointerCapture?.(o.pointerId) && g.releasePointerCapture(o.pointerId), be();
|
|
734
734
|
}, pe = (o) => {
|
|
735
|
-
o.target === o.currentTarget &&
|
|
735
|
+
o.target === o.currentTarget && P.current.pointerId === o.pointerId && be();
|
|
736
736
|
}, ae = Ft(() => rt((xt ? 1 : 0.8) * de, 0, 1), [xt, de]), le = Ft(() => {
|
|
737
737
|
const g = `calc(50% - ${nt / 2}px + ${J}px)`;
|
|
738
738
|
return {
|
|
@@ -747,7 +747,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
747
747
|
className: "aqvs-scrollbar-arrow-button",
|
|
748
748
|
style: {
|
|
749
749
|
[zt]: d,
|
|
750
|
-
[
|
|
750
|
+
[Jt]: d
|
|
751
751
|
},
|
|
752
752
|
"aria-label": g,
|
|
753
753
|
onPointerDown: Ce(o),
|
|
@@ -760,7 +760,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
760
760
|
children: /* @__PURE__ */ ot("span", { "aria-hidden": "true", children: y })
|
|
761
761
|
},
|
|
762
762
|
L
|
|
763
|
-
), xe = p &&
|
|
763
|
+
), xe = p && Nt ? {
|
|
764
764
|
orientation: ct,
|
|
765
765
|
scrollPosition: e,
|
|
766
766
|
maxScrollPosition: dt,
|
|
@@ -769,7 +769,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
769
769
|
thumbSize: At,
|
|
770
770
|
thumbPosition: _t,
|
|
771
771
|
thumbCenter: Xt,
|
|
772
|
-
trackSize:
|
|
772
|
+
trackSize: yt,
|
|
773
773
|
isDragging: W,
|
|
774
774
|
isTapScrollActive: xt,
|
|
775
775
|
visibleStartIndex: V,
|
|
@@ -778,10 +778,10 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
778
778
|
return /* @__PURE__ */ Se(
|
|
779
779
|
"div",
|
|
780
780
|
{
|
|
781
|
-
className: Te("aqvs-scrollbar",
|
|
781
|
+
className: Te("aqvs-scrollbar", Pt, !Nt && "pointer-events-none opacity-0", b),
|
|
782
782
|
style: {
|
|
783
783
|
[zt]: t,
|
|
784
|
-
[
|
|
784
|
+
[Jt]: d
|
|
785
785
|
},
|
|
786
786
|
role: "scrollbar",
|
|
787
787
|
tabIndex: -1,
|
|
@@ -791,17 +791,17 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
791
791
|
"aria-valuemax": dt,
|
|
792
792
|
"aria-orientation": c ? "horizontal" : "vertical",
|
|
793
793
|
children: [
|
|
794
|
-
!c &&
|
|
794
|
+
!c && Nt && et && /* @__PURE__ */ ot(
|
|
795
795
|
er,
|
|
796
796
|
{
|
|
797
797
|
ref: lt,
|
|
798
|
-
className: Te("aqvs-scrollbar-tap-circle-wrapper",
|
|
798
|
+
className: Te("aqvs-scrollbar-tap-circle-wrapper", vt),
|
|
799
799
|
size: nt,
|
|
800
800
|
maxVisualDistance: It,
|
|
801
801
|
style: le,
|
|
802
802
|
opacity: ae,
|
|
803
803
|
renderVisual: it,
|
|
804
|
-
onDragChange:
|
|
804
|
+
onDragChange: Qt
|
|
805
805
|
},
|
|
806
806
|
"tap-circle"
|
|
807
807
|
),
|
|
@@ -824,7 +824,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
824
824
|
/* @__PURE__ */ ot(
|
|
825
825
|
"div",
|
|
826
826
|
{
|
|
827
|
-
className: Te("aqvs-scrollbar-thumb-wrapper", !(
|
|
827
|
+
className: Te("aqvs-scrollbar-thumb-wrapper", !(Nt || W) && "pointer-events-none opacity-0"),
|
|
828
828
|
style: {
|
|
829
829
|
[zt]: At,
|
|
830
830
|
[$t]: _t,
|
|
@@ -844,7 +844,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
844
844
|
ref: A,
|
|
845
845
|
className: Te("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
|
|
846
846
|
"data-testid": "aqvs-scrollbar-thumb",
|
|
847
|
-
"data-thumb-state":
|
|
847
|
+
"data-thumb-state": Gt,
|
|
848
848
|
style: {
|
|
849
849
|
borderRadius: d - 1,
|
|
850
850
|
cursor: i ? "pointer" : "default"
|
|
@@ -869,7 +869,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
869
869
|
]
|
|
870
870
|
}
|
|
871
871
|
);
|
|
872
|
-
},
|
|
872
|
+
}, Mr = ["mouse", "pen", "touch"], Be = (r, t) => !(r === "mouse" || r === "pen" || r === "touch") || t.includes(r), yr = (r) => r === "mouse" || r === "pen", Ee = {
|
|
873
873
|
maxVelocity: 6,
|
|
874
874
|
minVelocity: 0.02,
|
|
875
875
|
deceleration: 25e-4,
|
|
@@ -888,7 +888,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
888
888
|
enableTrackClick: s = !0,
|
|
889
889
|
enableArrowButtons: a = !0,
|
|
890
890
|
enablePointerDrag: c = !0,
|
|
891
|
-
pointerDragInputs: d =
|
|
891
|
+
pointerDragInputs: d = Mr,
|
|
892
892
|
onScroll: b,
|
|
893
893
|
className: I,
|
|
894
894
|
testId: v,
|
|
@@ -901,13 +901,13 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
901
901
|
wheelSpeedMultiplier: Q = 1,
|
|
902
902
|
onWheelHorizontal: tt,
|
|
903
903
|
contentInsets: xt,
|
|
904
|
-
visibleStartIndex:
|
|
904
|
+
visibleStartIndex: Et,
|
|
905
905
|
visibleEndIndex: A,
|
|
906
906
|
renderOverlay: O,
|
|
907
|
-
initialScrollPosition:
|
|
907
|
+
initialScrollPosition: P = 0,
|
|
908
908
|
contentProps: U
|
|
909
909
|
}, Z) => {
|
|
910
|
-
const w = x(Number.isFinite(
|
|
910
|
+
const w = x(Number.isFinite(P) ? Math.max(0, P) : 0), lt = x(null), j = x(null), T = x(tt);
|
|
911
911
|
Y(() => {
|
|
912
912
|
T.current = tt;
|
|
913
913
|
}, [tt]);
|
|
@@ -944,14 +944,14 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
944
944
|
Dt.current = { contentSize: t, viewportSize: e };
|
|
945
945
|
const et = Ft(() => t > e, [t, e]), nt = S(
|
|
946
946
|
(h) => {
|
|
947
|
-
const { contentSize: k, viewportSize: gt } = Dt.current, X = k > gt,
|
|
948
|
-
if (N.debug("[ScrollPane] scrollTo called", () => ({ newPosition: h, contentSize: k, viewportSize: gt, currentIsScrollable: X, prevPosition:
|
|
949
|
-
return w.current !== 0 && (w.current = 0, b?.(0,
|
|
947
|
+
const { contentSize: k, viewportSize: gt } = Dt.current, X = k > gt, Pt = w.current;
|
|
948
|
+
if (N.debug("[ScrollPane] scrollTo called", () => ({ newPosition: h, contentSize: k, viewportSize: gt, currentIsScrollable: X, prevPosition: Pt })), !X)
|
|
949
|
+
return w.current !== 0 && (w.current = 0, b?.(0, Pt)), w.current;
|
|
950
950
|
const ct = typeof h == "function" ? h(w.current) : h;
|
|
951
951
|
if (!Number.isFinite(ct))
|
|
952
952
|
return N.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: ct }), w.current;
|
|
953
953
|
const It = Math.max(k - gt, 0), Mt = rt(ct, 0, It);
|
|
954
|
-
return w.current !== Mt && (w.current = Mt, b?.(Mt,
|
|
954
|
+
return w.current !== Mt && (w.current = Mt, b?.(Mt, Pt)), w.current;
|
|
955
955
|
},
|
|
956
956
|
[b]
|
|
957
957
|
), G = x(nt);
|
|
@@ -961,30 +961,30 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
961
961
|
const J = S(() => {
|
|
962
962
|
const h = q.current;
|
|
963
963
|
h.generation += 1, h.frame !== null && cancelAnimationFrame(h.frame), h.frame = null, h.velocity = 0, h.lastTimestamp = null;
|
|
964
|
-
}, []),
|
|
964
|
+
}, []), vt = x(J);
|
|
965
965
|
Y(() => {
|
|
966
|
-
|
|
966
|
+
vt.current = J;
|
|
967
967
|
}, [J]), Y(() => () => {
|
|
968
|
-
|
|
968
|
+
vt.current();
|
|
969
969
|
}, []);
|
|
970
970
|
const Lt = S(
|
|
971
971
|
(h) => {
|
|
972
972
|
if (!et)
|
|
973
973
|
return;
|
|
974
|
-
const { maxVelocity: k, minVelocity: gt, deceleration: X, startVelocityThreshold:
|
|
975
|
-
if (Math.abs(ct) <
|
|
974
|
+
const { maxVelocity: k, minVelocity: gt, deceleration: X, startVelocityThreshold: Pt } = H, ct = rt(h, -k, k);
|
|
975
|
+
if (Math.abs(ct) < Pt)
|
|
976
976
|
return;
|
|
977
977
|
J(), q.current.velocity = ct, q.current.lastTimestamp = null;
|
|
978
|
-
const It = q.current.generation, Mt = (
|
|
978
|
+
const It = q.current.generation, Mt = (yt) => {
|
|
979
979
|
const ut = q.current;
|
|
980
980
|
if (ut.generation !== It)
|
|
981
981
|
return;
|
|
982
982
|
if (ut.lastTimestamp === null) {
|
|
983
|
-
ut.lastTimestamp =
|
|
983
|
+
ut.lastTimestamp = yt, ut.frame = requestAnimationFrame(Mt);
|
|
984
984
|
return;
|
|
985
985
|
}
|
|
986
|
-
const At =
|
|
987
|
-
if (ut.lastTimestamp =
|
|
986
|
+
const At = yt - ut.lastTimestamp;
|
|
987
|
+
if (ut.lastTimestamp = yt, At <= 0) {
|
|
988
988
|
ut.frame = requestAnimationFrame(Mt);
|
|
989
989
|
return;
|
|
990
990
|
}
|
|
@@ -992,12 +992,12 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
992
992
|
let st = dt;
|
|
993
993
|
const _t = X * At;
|
|
994
994
|
dt > 0 ? st = Math.max(0, dt - _t) : dt < 0 && (st = Math.min(0, dt + _t));
|
|
995
|
-
const
|
|
996
|
-
if (
|
|
995
|
+
const Nt = (dt + st) / 2 * At, ne = w.current;
|
|
996
|
+
if (Nt !== 0 && G.current((Tt) => Tt + Nt), q.current.generation !== It)
|
|
997
997
|
return;
|
|
998
|
-
const
|
|
998
|
+
const Gt = w.current, { contentSize: Ct, viewportSize: f } = Dt.current, M = Math.max(Ct - f, 0);
|
|
999
999
|
ut.velocity = st;
|
|
1000
|
-
const ft =
|
|
1000
|
+
const ft = Gt === ne || Gt <= 0 && st <= 0 || Gt >= M && st >= 0;
|
|
1001
1001
|
if (Math.abs(st) < gt || ft) {
|
|
1002
1002
|
J();
|
|
1003
1003
|
return;
|
|
@@ -1007,9 +1007,9 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1007
1007
|
q.current.frame = requestAnimationFrame(Mt);
|
|
1008
1008
|
},
|
|
1009
1009
|
[et, H, J]
|
|
1010
|
-
),
|
|
1010
|
+
), jt = x(Lt);
|
|
1011
1011
|
Y(() => {
|
|
1012
|
-
|
|
1012
|
+
jt.current = Lt;
|
|
1013
1013
|
}, [Lt]), ye(() => {
|
|
1014
1014
|
Dt.current = { contentSize: t, viewportSize: e };
|
|
1015
1015
|
}, [t, e]), ye(() => {
|
|
@@ -1030,7 +1030,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1030
1030
|
const h = (X) => {
|
|
1031
1031
|
if (X.ctrlKey)
|
|
1032
1032
|
return;
|
|
1033
|
-
const
|
|
1033
|
+
const Pt = X.shiftKey && X.deltaX === 0, ct = Pt ? X.deltaY : X.deltaX, It = Pt ? 0 : X.deltaY;
|
|
1034
1034
|
if (ct !== 0 && Math.abs(ct) >= Math.abs(It)) {
|
|
1035
1035
|
if (T.current) {
|
|
1036
1036
|
X.preventDefault(), J();
|
|
@@ -1042,8 +1042,8 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1042
1042
|
if (!et || X.deltaY === 0)
|
|
1043
1043
|
return;
|
|
1044
1044
|
X.preventDefault(), J();
|
|
1045
|
-
let
|
|
1046
|
-
X.deltaMode === 1 ?
|
|
1045
|
+
let yt = X.deltaY;
|
|
1046
|
+
X.deltaMode === 1 ? yt *= 16 : X.deltaMode === 2 && (yt *= e), Q !== 1 && (yt *= Q), N.debug("[ScrollPane] wheel event", () => ({ deltaY: yt, scrollPosition: w.current, wheelSpeedMultiplier: Q, deltaMode: X.deltaMode, scrollTop: j.current?.scrollTop })), nt((ut) => ut + yt);
|
|
1047
1047
|
}, k = () => {
|
|
1048
1048
|
J();
|
|
1049
1049
|
}, gt = lt.current;
|
|
@@ -1069,19 +1069,19 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1069
1069
|
shouldCancelNextClick: !1,
|
|
1070
1070
|
clickResetTimer: null,
|
|
1071
1071
|
velocitySamples: []
|
|
1072
|
-
}), E = x(c),
|
|
1072
|
+
}), E = x(c), Vt = x(d);
|
|
1073
1073
|
Y(() => {
|
|
1074
1074
|
E.current = c;
|
|
1075
1075
|
}, [c]), Y(() => {
|
|
1076
|
-
|
|
1076
|
+
Vt.current = d;
|
|
1077
1077
|
}, [d]);
|
|
1078
1078
|
const zt = x(et);
|
|
1079
1079
|
Y(() => {
|
|
1080
1080
|
zt.current = et;
|
|
1081
1081
|
}, [et]);
|
|
1082
|
-
const
|
|
1082
|
+
const Jt = x(H);
|
|
1083
1083
|
Y(() => {
|
|
1084
|
-
|
|
1084
|
+
Jt.current = H;
|
|
1085
1085
|
}, [H]), Y(() => {
|
|
1086
1086
|
const h = it.current;
|
|
1087
1087
|
if (c && et && (h.pointerId === null || Be(h.pointerType, d)) || h.pointerId === null)
|
|
@@ -1097,21 +1097,21 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1097
1097
|
const k = 6, gt = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), X = () => {
|
|
1098
1098
|
const f = it.current;
|
|
1099
1099
|
f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.velocitySamples = [];
|
|
1100
|
-
},
|
|
1100
|
+
}, Pt = () => {
|
|
1101
1101
|
const f = it.current;
|
|
1102
1102
|
f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
|
|
1103
1103
|
}, ct = (f) => {
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
const Tt =
|
|
1107
|
-
|
|
1104
|
+
const M = it.current, ft = gt();
|
|
1105
|
+
M.velocitySamples.push({ clientY: f, time: ft });
|
|
1106
|
+
const Tt = Jt.current.velocitySampleWindow;
|
|
1107
|
+
M.velocitySamples = M.velocitySamples.filter((wt) => ft - wt.time <= Tt);
|
|
1108
1108
|
}, It = (f) => f instanceof HTMLElement && f.closest("[data-scrollpane-ignore-drag='true']") !== null, Mt = (f) => {
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
},
|
|
1112
|
-
const
|
|
1113
|
-
if (!
|
|
1114
|
-
if (
|
|
1109
|
+
const M = it.current;
|
|
1110
|
+
M.shouldCancelNextClick && (f.preventDefault(), f.stopPropagation(), M.shouldCancelNextClick = !1);
|
|
1111
|
+
}, yt = (f) => {
|
|
1112
|
+
const M = it.current;
|
|
1113
|
+
if (!M.isDragging) {
|
|
1114
|
+
if (M.isDragging = !0, M.shouldCancelNextClick = !0, !h.hasPointerCapture(f.pointerId))
|
|
1115
1115
|
try {
|
|
1116
1116
|
h.setPointerCapture(f.pointerId);
|
|
1117
1117
|
} catch {
|
|
@@ -1119,80 +1119,80 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1119
1119
|
ct(f.clientY);
|
|
1120
1120
|
}
|
|
1121
1121
|
}, ut = (f) => f.isTrusted || f.target === h, At = (f) => {
|
|
1122
|
-
const
|
|
1123
|
-
h.hasPointerCapture(f) && h.releasePointerCapture(f),
|
|
1122
|
+
const M = it.current;
|
|
1123
|
+
h.hasPointerCapture(f) && h.releasePointerCapture(f), M.shouldCancelNextClick = !1, Pt(), X();
|
|
1124
1124
|
}, dt = (f) => {
|
|
1125
|
-
const
|
|
1126
|
-
if (
|
|
1125
|
+
const M = it.current;
|
|
1126
|
+
if (M.pointerId !== f.pointerId)
|
|
1127
1127
|
return;
|
|
1128
1128
|
if (f.buttons === 0 && yr(f.pointerType)) {
|
|
1129
1129
|
At(f.pointerId);
|
|
1130
1130
|
return;
|
|
1131
1131
|
}
|
|
1132
|
-
if (!(E.current && zt.current) || !Be(f.pointerType,
|
|
1132
|
+
if (!(E.current && zt.current) || !Be(f.pointerType, Vt.current) || !M.isDragging && (Math.abs(f.clientY - M.startClientY) < k || (yt(f), !M.isDragging)))
|
|
1133
1133
|
return;
|
|
1134
1134
|
ct(f.clientY);
|
|
1135
|
-
const ft = f.clientY -
|
|
1135
|
+
const ft = f.clientY - M.startClientY, Tt = M.startScroll - ft;
|
|
1136
1136
|
G.current(Tt), f.cancelable && f.preventDefault();
|
|
1137
1137
|
}, st = () => {
|
|
1138
1138
|
const f = it.current;
|
|
1139
|
-
return f.pointerId !== null || !f.shouldCancelNextClick ? !1 : (
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1139
|
+
return f.pointerId !== null || !f.shouldCancelNextClick ? !1 : (Pt(), f.clickResetTimer = window.setTimeout(() => {
|
|
1140
|
+
const M = it.current;
|
|
1141
|
+
M.shouldCancelNextClick = !1, M.clickResetTimer = null;
|
|
1142
1142
|
}, 0), !0);
|
|
1143
1143
|
}, _t = (f) => {
|
|
1144
|
-
const
|
|
1145
|
-
if (
|
|
1144
|
+
const M = it.current;
|
|
1145
|
+
if (M.pointerId !== f.pointerId) {
|
|
1146
1146
|
st();
|
|
1147
1147
|
return;
|
|
1148
1148
|
}
|
|
1149
|
-
|
|
1149
|
+
M.isDragging && M.shouldCancelNextClick && f.cancelable && (f.preventDefault(), f.stopPropagation()), M.isDragging && ct(f.clientY);
|
|
1150
1150
|
let ft = 0;
|
|
1151
|
-
if (
|
|
1152
|
-
const
|
|
1153
|
-
if (
|
|
1154
|
-
const Kt =
|
|
1151
|
+
if (M.isDragging && M.velocitySamples.length >= 2) {
|
|
1152
|
+
const wt = M.velocitySamples, ie = Jt.current.velocitySampleWindow, Qt = wt[wt.length - 1], te = wt.find((Kt) => Qt.time - Kt.time <= ie) ?? wt[0];
|
|
1153
|
+
if (Qt && te && Qt.time !== te.time) {
|
|
1154
|
+
const Kt = Qt.clientY - te.clientY, se = Qt.time - te.time;
|
|
1155
1155
|
ft = -(Kt / se);
|
|
1156
1156
|
}
|
|
1157
1157
|
}
|
|
1158
|
-
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1158
|
+
Pt(), M.shouldCancelNextClick && (M.clickResetTimer = window.setTimeout(() => {
|
|
1159
|
+
const wt = it.current;
|
|
1160
|
+
wt.shouldCancelNextClick = !1, wt.clickResetTimer = null;
|
|
1161
1161
|
}, 0));
|
|
1162
|
-
const Tt =
|
|
1163
|
-
X(), h.hasPointerCapture(f.pointerId) && h.releasePointerCapture(f.pointerId), Math.abs(ft) >= Tt &&
|
|
1162
|
+
const Tt = Jt.current.startVelocityThreshold;
|
|
1163
|
+
X(), h.hasPointerCapture(f.pointerId) && h.releasePointerCapture(f.pointerId), Math.abs(ft) >= Tt && jt.current?.(ft);
|
|
1164
1164
|
}, Xt = (f) => {
|
|
1165
1165
|
if (it.current.pointerId !== null) {
|
|
1166
1166
|
if (!f.isPrimary || f.pointerType !== it.current.pointerType)
|
|
1167
1167
|
return;
|
|
1168
1168
|
At(it.current.pointerId);
|
|
1169
1169
|
}
|
|
1170
|
-
if (it.current.shouldCancelNextClick && (
|
|
1170
|
+
if (it.current.shouldCancelNextClick && (Pt(), it.current.shouldCancelNextClick = !1), !(E.current && zt.current) || !Be(f.pointerType, Vt.current) || f.button !== 0 && f.pointerType === "mouse" || f.ctrlKey || f.metaKey || f.altKey || It(f.target))
|
|
1171
1171
|
return;
|
|
1172
|
-
window.dispatchEvent(new CustomEvent(Xe, { detail: { paneId: R } })),
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1175
|
-
},
|
|
1172
|
+
window.dispatchEvent(new CustomEvent(Xe, { detail: { paneId: R } })), vt.current?.();
|
|
1173
|
+
const M = it.current;
|
|
1174
|
+
Pt(), M.pointerId = f.pointerId, M.pointerType = f.pointerType, M.startClientY = f.clientY, M.startScroll = w.current, M.isDragging = !1, M.shouldCancelNextClick = !1, M.velocitySamples = [];
|
|
1175
|
+
}, Nt = (f) => {
|
|
1176
1176
|
if (it.current.pointerId !== f.pointerId) {
|
|
1177
1177
|
st();
|
|
1178
1178
|
return;
|
|
1179
1179
|
}
|
|
1180
1180
|
ut(f) && At(f.pointerId);
|
|
1181
|
-
},
|
|
1181
|
+
}, Gt = [
|
|
1182
1182
|
["click", Mt, !0],
|
|
1183
1183
|
["pointerdown", Xt, { passive: !1 }],
|
|
1184
1184
|
["lostpointercapture", (f) => {
|
|
1185
1185
|
f.target !== h || it.current.pointerId !== f.pointerId || At(f.pointerId);
|
|
1186
1186
|
}, void 0]
|
|
1187
|
-
],
|
|
1187
|
+
], Ct = [
|
|
1188
1188
|
["pointermove", dt, { passive: !1 }],
|
|
1189
1189
|
["pointerup", _t, void 0],
|
|
1190
|
-
["pointercancel",
|
|
1190
|
+
["pointercancel", Nt, void 0]
|
|
1191
1191
|
];
|
|
1192
|
-
return Le(h,
|
|
1193
|
-
Le(h,
|
|
1192
|
+
return Le(h, Gt, "add"), Le(window, Ct, "add"), () => {
|
|
1193
|
+
Le(h, Gt, "remove"), Le(window, Ct, "remove");
|
|
1194
1194
|
const f = it.current;
|
|
1195
|
-
f.pointerId !== null && h.hasPointerCapture(f.pointerId) && h.releasePointerCapture(f.pointerId),
|
|
1195
|
+
f.pointerId !== null && h.hasPointerCapture(f.pointerId) && h.releasePointerCapture(f.pointerId), Pt(), X();
|
|
1196
1196
|
};
|
|
1197
1197
|
}, [R]);
|
|
1198
1198
|
const $t = S(
|
|
@@ -1234,7 +1234,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
1236
|
/* @__PURE__ */ ot(
|
|
1237
|
-
|
|
1237
|
+
Pr,
|
|
1238
1238
|
{
|
|
1239
1239
|
contentSize: t,
|
|
1240
1240
|
viewportSize: e,
|
|
@@ -1248,7 +1248,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1248
1248
|
tapScrollCircleOptions: V,
|
|
1249
1249
|
itemCount: W,
|
|
1250
1250
|
renderThumbOverlay: at,
|
|
1251
|
-
visibleStartIndex:
|
|
1251
|
+
visibleStartIndex: Et,
|
|
1252
1252
|
visibleEndIndex: A
|
|
1253
1253
|
},
|
|
1254
1254
|
"scrollbar"
|
|
@@ -1257,7 +1257,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1257
1257
|
] });
|
|
1258
1258
|
}
|
|
1259
1259
|
), Ge = (r, t, e) => Math.min(Math.max(r, t), e), Br = ({ dragState: r, normalizedDistance: t, sizeScale: e, size: n }) => {
|
|
1260
|
-
const i = Math.max(n / 2, 1), s = 1 + t * 0.65, a = Math.max(0.65, 1 - t * 0.25), c = r.direction * t * 26 * e, d = 0.8 + t * 0.18, b = 3 * e, I = 6 * e, v = 22 * e, C = Math.abs(c) + I, p = c > 0 ? b : -Math.abs(c) - b, V = Math.max(2.5, 3 * e), z = Ge(r.offsetX, -i, i), W = Ge(r.offsetY, -i, i), at = i * 0.35, Q = z / i * at, tt = W / i * at, xt = Q * 0.45,
|
|
1260
|
+
const i = Math.max(n / 2, 1), s = 1 + t * 0.65, a = Math.max(0.65, 1 - t * 0.25), c = r.direction * t * 26 * e, d = 0.8 + t * 0.18, b = 3 * e, I = 6 * e, v = 22 * e, C = Math.abs(c) + I, p = c > 0 ? b : -Math.abs(c) - b, V = Math.max(2.5, 3 * e), z = Ge(r.offsetX, -i, i), W = Ge(r.offsetY, -i, i), at = i * 0.35, Q = z / i * at, tt = W / i * at, xt = Q * 0.45, Et = tt * 0.45, A = Math.max(v * 0.38, 6), O = 0.65 + t * 0.2, P = r.active;
|
|
1261
1261
|
return /* @__PURE__ */ Se(tr, { children: [
|
|
1262
1262
|
/* @__PURE__ */ ot(
|
|
1263
1263
|
"div",
|
|
@@ -1265,7 +1265,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1265
1265
|
className: "aqvs-tap-scroll-circle-gradient",
|
|
1266
1266
|
style: {
|
|
1267
1267
|
transform: `scale(${a}, ${s})`,
|
|
1268
|
-
transition:
|
|
1268
|
+
transition: P ? "40ms transform ease-out" : "200ms ease transform"
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
1271
|
),
|
|
@@ -1277,7 +1277,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1277
1277
|
width: v,
|
|
1278
1278
|
height: v,
|
|
1279
1279
|
transform: `translate(calc(-50% + ${Q}px), calc(-50% + ${tt}px)) scale(${a}, ${d * s})`,
|
|
1280
|
-
transition:
|
|
1280
|
+
transition: P ? "70ms transform ease-out" : "200ms ease transform"
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
1283
|
),
|
|
@@ -1288,10 +1288,10 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1288
1288
|
style: {
|
|
1289
1289
|
width: A,
|
|
1290
1290
|
height: A,
|
|
1291
|
-
transform: `translate(calc(-50% + ${xt}px), calc(-50% + ${
|
|
1291
|
+
transform: `translate(calc(-50% + ${xt}px), calc(-50% + ${Et}px)) scale(${a}, ${s})`,
|
|
1292
1292
|
opacity: O,
|
|
1293
1293
|
boxShadow: "0 0 8px rgba(255,255,255,0.45)",
|
|
1294
|
-
transition:
|
|
1294
|
+
transition: P ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
1297
1297
|
),
|
|
@@ -1304,7 +1304,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1304
1304
|
height: C,
|
|
1305
1305
|
transform: `translate(-50%, ${p}px)`,
|
|
1306
1306
|
opacity: t,
|
|
1307
|
-
transition:
|
|
1307
|
+
transition: P ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
1310
|
)
|
|
@@ -1318,7 +1318,7 @@ const rt = (r, t, e) => Math.max(t, Math.min(e, r)), Xe = "virtualscroll:tap-scr
|
|
|
1318
1318
|
if (!Number.isFinite(r))
|
|
1319
1319
|
throw new Error(`valueFn returned a non-finite value at index ${t}: ${r}`);
|
|
1320
1320
|
return r;
|
|
1321
|
-
},
|
|
1321
|
+
}, Me = (r) => {
|
|
1322
1322
|
if (r <= 0 || !Number.isFinite(r))
|
|
1323
1323
|
return 0;
|
|
1324
1324
|
const t = Math.trunc(r);
|
|
@@ -1565,7 +1565,7 @@ class ge {
|
|
|
1565
1565
|
let n = t + 1;
|
|
1566
1566
|
for (; n <= this.size; ) {
|
|
1567
1567
|
this.tree.set(n, (this.tree.get(n) ?? 0) + e);
|
|
1568
|
-
const i =
|
|
1568
|
+
const i = Me(n);
|
|
1569
1569
|
if (i === 0)
|
|
1570
1570
|
break;
|
|
1571
1571
|
n += i;
|
|
@@ -1609,7 +1609,7 @@ class ge {
|
|
|
1609
1609
|
let t = 0, e = this.size;
|
|
1610
1610
|
for (; e > 0; ) {
|
|
1611
1611
|
t += this.tree.get(e) ?? 0;
|
|
1612
|
-
const n =
|
|
1612
|
+
const n = Me(e);
|
|
1613
1613
|
if (n === 0)
|
|
1614
1614
|
break;
|
|
1615
1615
|
e -= n;
|
|
@@ -1788,7 +1788,7 @@ class ge {
|
|
|
1788
1788
|
for (; a > 0; ) {
|
|
1789
1789
|
const d = this.tree.get(a) ?? 0;
|
|
1790
1790
|
s += d;
|
|
1791
|
-
const b =
|
|
1791
|
+
const b = Me(a);
|
|
1792
1792
|
if (b === 0)
|
|
1793
1793
|
break;
|
|
1794
1794
|
a -= b;
|
|
@@ -1851,7 +1851,7 @@ class ge {
|
|
|
1851
1851
|
let s = n + 1;
|
|
1852
1852
|
for (; s <= this.size; ) {
|
|
1853
1853
|
e.set(s, (e.get(s) ?? 0) + i);
|
|
1854
|
-
const a =
|
|
1854
|
+
const a = Me(s);
|
|
1855
1855
|
if (a === 0)
|
|
1856
1856
|
break;
|
|
1857
1857
|
s += a;
|
|
@@ -1968,14 +1968,14 @@ class ge {
|
|
|
1968
1968
|
_propagateDeltaToGrownNodes(t, e, n, i) {
|
|
1969
1969
|
let s = t + 1;
|
|
1970
1970
|
for (; s <= n; ) {
|
|
1971
|
-
const a =
|
|
1971
|
+
const a = Me(s);
|
|
1972
1972
|
if (a === 0)
|
|
1973
1973
|
break;
|
|
1974
1974
|
s += a;
|
|
1975
1975
|
}
|
|
1976
1976
|
for (; s <= i; ) {
|
|
1977
1977
|
this.tree.set(s, (this.tree.get(s) ?? 0) + e);
|
|
1978
|
-
const a =
|
|
1978
|
+
const a = Me(s);
|
|
1979
1979
|
if (a === 0)
|
|
1980
1980
|
break;
|
|
1981
1981
|
s += a;
|
|
@@ -2180,7 +2180,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2180
2180
|
}, St = (r, t) => t <= 0 ? 0 : rt(r, 0, t - 1), Ze = (r) => ({
|
|
2181
2181
|
top: Math.max(0, r?.top ?? 0),
|
|
2182
2182
|
bottom: Math.max(0, r?.bottom ?? 0)
|
|
2183
|
-
}),
|
|
2183
|
+
}), Wt = (r, t) => r <= t ? 0 : r - t, Ie = (r, t) => r <= 0 ? 0 : r + t, Oe = 1e3, Je = 2e3, Ar = 1048576, Ne = (r) => {
|
|
2184
2184
|
if (!Number.isFinite(r)) return 0n;
|
|
2185
2185
|
const t = Math.trunc(r);
|
|
2186
2186
|
return t <= 0 ? 0n : BigInt(t);
|
|
@@ -2195,26 +2195,26 @@ const Dr = 1e4, qr = () => {
|
|
|
2195
2195
|
const O = Number(A);
|
|
2196
2196
|
if (!Number.isSafeInteger(O))
|
|
2197
2197
|
return null;
|
|
2198
|
-
const { cumulative:
|
|
2199
|
-
if (!Number.isFinite(
|
|
2198
|
+
const { cumulative: P } = s.prefixSum(O, { materializeOption: { materialize: !1 } });
|
|
2199
|
+
if (!Number.isFinite(P))
|
|
2200
2200
|
return null;
|
|
2201
|
-
const { index: U } = s.findIndexAtOrAfter(
|
|
2201
|
+
const { index: U } = s.findIndexAtOrAfter(P + 0.5, { materializeOption: { materialize: !1 } });
|
|
2202
2202
|
if (U === -1)
|
|
2203
2203
|
return null;
|
|
2204
2204
|
const Z = Ne(U);
|
|
2205
2205
|
return Z > A ? Z : null;
|
|
2206
2206
|
}, z = (A) => {
|
|
2207
|
-
let O = 0,
|
|
2208
|
-
for (;
|
|
2209
|
-
const lt = Number(
|
|
2210
|
-
if (O += j, U =
|
|
2207
|
+
let O = 0, P = A, U = A, Z = 0n, w = 0;
|
|
2208
|
+
for (; P < d && O < t; ) {
|
|
2209
|
+
const lt = Number(P), j = i(lt);
|
|
2210
|
+
if (O += j, U = P, P += 1n, Z += 1n, !Number.isFinite(j) || j < 0)
|
|
2211
2211
|
break;
|
|
2212
2212
|
if (j === 0) {
|
|
2213
2213
|
if (w += 1, w > Oe) {
|
|
2214
2214
|
const T = V(U);
|
|
2215
|
-
if (T !== null && T >
|
|
2216
|
-
|
|
2217
|
-
else if (T !== null && T ===
|
|
2215
|
+
if (T !== null && T > P)
|
|
2216
|
+
P = T, w = 0;
|
|
2217
|
+
else if (T !== null && T === P && i(Number(P)) > 0)
|
|
2218
2218
|
w = 0;
|
|
2219
2219
|
else
|
|
2220
2220
|
break;
|
|
@@ -2226,14 +2226,14 @@ const Dr = 1e4, qr = () => {
|
|
|
2226
2226
|
};
|
|
2227
2227
|
let { height: W, end: at } = z(p);
|
|
2228
2228
|
if (W < t && p > 0n) {
|
|
2229
|
-
let A = p, O = W,
|
|
2229
|
+
let A = p, O = W, P = 0;
|
|
2230
2230
|
for (; A > 0n && O < t; ) {
|
|
2231
2231
|
A -= 1n;
|
|
2232
2232
|
const Z = Number(A), w = i(Z);
|
|
2233
2233
|
if (O += w, !Number.isFinite(w) || w < 0)
|
|
2234
2234
|
break;
|
|
2235
2235
|
if (w === 0) {
|
|
2236
|
-
if (
|
|
2236
|
+
if (P += 1, P > Oe) {
|
|
2237
2237
|
const lt = Number(A);
|
|
2238
2238
|
if (!Number.isSafeInteger(lt))
|
|
2239
2239
|
break;
|
|
@@ -2242,23 +2242,23 @@ const Dr = 1e4, qr = () => {
|
|
|
2242
2242
|
break;
|
|
2243
2243
|
const { index: T } = s.findIndexAtOrAfter(j - 0.5, { materializeOption: { materialize: !1 } }), q = T === -1 ? -1n : Ne(T);
|
|
2244
2244
|
if (q >= 0n && q < A)
|
|
2245
|
-
A = q + 1n,
|
|
2245
|
+
A = q + 1n, P = 0;
|
|
2246
2246
|
else if (q === A && A >= 1n && i(Number(A - 1n)) > 0)
|
|
2247
|
-
|
|
2247
|
+
P = 0;
|
|
2248
2248
|
else
|
|
2249
2249
|
break;
|
|
2250
2250
|
}
|
|
2251
2251
|
} else
|
|
2252
|
-
|
|
2252
|
+
P = 0;
|
|
2253
2253
|
}
|
|
2254
2254
|
p = b(A);
|
|
2255
2255
|
const U = z(p);
|
|
2256
2256
|
W = U.height, at = U.end;
|
|
2257
2257
|
}
|
|
2258
|
-
const Q = b(p), tt = b(at), xt = b(Q - BigInt(Math.max(0, e))),
|
|
2258
|
+
const Q = b(p), tt = b(at), xt = b(Q - BigInt(Math.max(0, e))), Et = b(tt + BigInt(Math.max(0, e)));
|
|
2259
2259
|
return {
|
|
2260
2260
|
renderingStartIndex: St(Number(xt), n),
|
|
2261
|
-
renderingEndIndex: St(Number(
|
|
2261
|
+
renderingEndIndex: St(Number(Et), n),
|
|
2262
2262
|
visibleStartIndex: St(Number(Q), n),
|
|
2263
2263
|
visibleEndIndex: St(Number(tt), n)
|
|
2264
2264
|
};
|
|
@@ -2279,17 +2279,17 @@ const Dr = 1e4, qr = () => {
|
|
|
2279
2279
|
V = (A ?? 0) - (O ?? 0) - d;
|
|
2280
2280
|
}
|
|
2281
2281
|
const z = V, W = (A, O) => {
|
|
2282
|
-
let
|
|
2283
|
-
for (;
|
|
2284
|
-
const w = i(
|
|
2285
|
-
if (U += w,
|
|
2282
|
+
let P = A, U = O, Z = 0;
|
|
2283
|
+
for (; P < n && U < t; ) {
|
|
2284
|
+
const w = i(P);
|
|
2285
|
+
if (U += w, P++, !Number.isFinite(w) || w < 0)
|
|
2286
2286
|
break;
|
|
2287
2287
|
if (w === 0) {
|
|
2288
2288
|
if (Z++, Z > Oe) {
|
|
2289
|
-
const { cumulative: lt } = s.prefixSum(
|
|
2290
|
-
if (j >
|
|
2291
|
-
|
|
2292
|
-
else if (j ===
|
|
2289
|
+
const { cumulative: lt } = s.prefixSum(P - 1, { materializeOption: { materialize: !1 } }), { index: j } = Number.isFinite(lt) ? s.findIndexAtOrAfter(lt + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2290
|
+
if (j > P)
|
|
2291
|
+
P = j, Z = 0;
|
|
2292
|
+
else if (j === P && i(P) > 0)
|
|
2293
2293
|
Z = 0;
|
|
2294
2294
|
else
|
|
2295
2295
|
break;
|
|
@@ -2297,11 +2297,11 @@ const Dr = 1e4, qr = () => {
|
|
|
2297
2297
|
} else
|
|
2298
2298
|
Z = 0;
|
|
2299
2299
|
}
|
|
2300
|
-
return { cursor:
|
|
2300
|
+
return { cursor: P, height: U };
|
|
2301
2301
|
}, at = W(p, V);
|
|
2302
2302
|
let Q = at.cursor;
|
|
2303
2303
|
if (V = at.height, V < t && p > 0) {
|
|
2304
|
-
let A = V + Math.abs(Math.min(0, z)), O = p - 1,
|
|
2304
|
+
let A = V + Math.abs(Math.min(0, z)), O = p - 1, P = 0;
|
|
2305
2305
|
for (; O >= 0 && A < t; ) {
|
|
2306
2306
|
const Z = i(O);
|
|
2307
2307
|
if (A += Z, !Number.isFinite(Z) || Z < 0) {
|
|
@@ -2309,29 +2309,29 @@ const Dr = 1e4, qr = () => {
|
|
|
2309
2309
|
break;
|
|
2310
2310
|
}
|
|
2311
2311
|
if (Z === 0) {
|
|
2312
|
-
if (
|
|
2312
|
+
if (P++, P > Oe) {
|
|
2313
2313
|
const { cumulative: w } = s.prefixSum(O, { materializeOption: { materialize: !1 } }), { index: lt } = Number.isFinite(w) ? s.findIndexAtOrAfter(w - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2314
2314
|
if (lt !== -1 && lt < O) {
|
|
2315
|
-
O = lt,
|
|
2315
|
+
O = lt, P = 0;
|
|
2316
2316
|
continue;
|
|
2317
2317
|
}
|
|
2318
2318
|
if (lt === O && O >= 1 && i(O - 1) > 0)
|
|
2319
|
-
|
|
2319
|
+
P = 0;
|
|
2320
2320
|
else {
|
|
2321
2321
|
O--;
|
|
2322
2322
|
break;
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
2325
|
} else
|
|
2326
|
-
|
|
2326
|
+
P = 0;
|
|
2327
2327
|
O--;
|
|
2328
2328
|
}
|
|
2329
2329
|
p = St(O + 1, n);
|
|
2330
2330
|
const U = W(p, 0);
|
|
2331
2331
|
Q = U.cursor, V = U.height;
|
|
2332
2332
|
}
|
|
2333
|
-
const tt = St(p - e, n), xt = St(Math.max(Q - 1, p), n),
|
|
2334
|
-
return { renderingStartIndex: tt, renderingEndIndex:
|
|
2333
|
+
const tt = St(p - e, n), xt = St(Math.max(Q - 1, p), n), Et = St(xt + e, n);
|
|
2334
|
+
return { renderingStartIndex: tt, renderingEndIndex: Et, visibleStartIndex: p, visibleEndIndex: xt };
|
|
2335
2335
|
}, Qe = (r, t, e) => {
|
|
2336
2336
|
const n = Math.max(0, t ?? 0), i = x({ last: 0, id: null, arg: null }).current;
|
|
2337
2337
|
return Y(
|
|
@@ -2412,22 +2412,22 @@ const Dr = 1e4, qr = () => {
|
|
|
2412
2412
|
scrollBarOptions: Q,
|
|
2413
2413
|
behaviorOptions: tt,
|
|
2414
2414
|
onWheelHorizontal: xt,
|
|
2415
|
-
contentProps:
|
|
2415
|
+
contentProps: Et
|
|
2416
2416
|
}, A) => {
|
|
2417
|
-
const { width: O, enableThumbDrag:
|
|
2417
|
+
const { width: O, enableThumbDrag: P, enableTrackClick: U, enableArrowButtons: Z, enableScrollToTopBottomButtons: w, renderThumbOverlay: lt, tapScrollCircleOptions: j } = Q ?? {}, { enablePointerDrag: T, pointerDragInputs: q, enableKeyboardNavigation: H = !0, wheelSpeedMultiplier: Ht, inertiaOptions: Dt, clipItemHeight: et = !1, resetOnGetItemHeightChange: nt = !1 } = tt ?? {}, G = x(null), J = x({
|
|
2418
2418
|
renderingStartIndex: 0,
|
|
2419
2419
|
renderingEndIndex: 0,
|
|
2420
2420
|
visibleStartIndex: 0,
|
|
2421
2421
|
visibleEndIndex: 0,
|
|
2422
2422
|
scrollPosition: 0,
|
|
2423
2423
|
totalHeight: 0
|
|
2424
|
-
}),
|
|
2424
|
+
}), vt = x(V && r > 0 ? { index: rt(Math.trunc(V.index), 0, r - 1), align: "top", offset: -Math.max(0, V.offsetPx ?? 0) } : null), Lt = x(!1), jt = x(!0);
|
|
2425
2425
|
Y(() => {
|
|
2426
|
-
if (
|
|
2427
|
-
|
|
2426
|
+
if (jt.current) {
|
|
2427
|
+
jt.current = !1;
|
|
2428
2428
|
return;
|
|
2429
2429
|
}
|
|
2430
|
-
nt && (
|
|
2430
|
+
nt && (vt.current = null);
|
|
2431
2431
|
}, [nt, n]);
|
|
2432
2432
|
const R = Ft(() => Ze(W), [W]), [de] = re(() => {
|
|
2433
2433
|
const u = V?.index ?? C, m = typeof u == "number" && Number.isFinite(u) ? Math.max(0, Math.trunc(u)) : 0;
|
|
@@ -2443,21 +2443,21 @@ const Dr = 1e4, qr = () => {
|
|
|
2443
2443
|
materialize: !0
|
|
2444
2444
|
}),
|
|
2445
2445
|
[nt, de]
|
|
2446
|
-
), E = Nr(r, n, it), [
|
|
2446
|
+
), E = Nr(r, n, it), [Vt] = re(() => {
|
|
2447
2447
|
let l = 0, u = 0;
|
|
2448
2448
|
if (V && r > 0) {
|
|
2449
|
-
const m = rt(Math.trunc(V.index), 0, r - 1), D = Math.max(0, V.offsetPx ?? 0), _ = rt(m - s * 2, 0, r - 1), F = rt(m + s * 2, 0, r - 1), $ = m > 0 || D > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: _, to: F }] } } : void 0, { cumulative: K, total:
|
|
2450
|
-
l = Ie(ht, R.top), u =
|
|
2449
|
+
const m = rt(Math.trunc(V.index), 0, r - 1), D = Math.max(0, V.offsetPx ?? 0), _ = rt(m - s * 2, 0, r - 1), F = rt(m + s * 2, 0, r - 1), $ = m > 0 || D > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: _, to: F }] } } : void 0, { cumulative: K, total: Rt, currentValue: pt } = E.prefixSum(m, $), ht = Math.max(K - pt + D, 0);
|
|
2450
|
+
l = Ie(ht, R.top), u = Rt ?? E.getTotal();
|
|
2451
2451
|
} else if (typeof C == "number") {
|
|
2452
|
-
const m = rt(C, 0, r - 1), D = rt(m - s * 2, 0, r - 1), _ = rt(m + s * 2, 0, r - 1), F = C > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: D, to: _ }] } } : void 0, { cumulative: $, total: K, currentValue:
|
|
2452
|
+
const m = rt(C, 0, r - 1), D = rt(m - s * 2, 0, r - 1), _ = rt(m + s * 2, 0, r - 1), F = C > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: D, to: _ }] } } : void 0, { cumulative: $, total: K, currentValue: Rt } = E.prefixSum(C, F), pt = Math.max($ - Rt, 0);
|
|
2453
2453
|
l = Ie(pt, R.top), u = K ?? E.getTotal();
|
|
2454
2454
|
} else typeof p == "number" && (l = Ie(Math.max(p, 0), R.top)), u = E.getTotal();
|
|
2455
2455
|
return { position: l, total: u };
|
|
2456
|
-
}), [zt,
|
|
2457
|
-
|
|
2458
|
-
X.current = d ?? void 0,
|
|
2456
|
+
}), [zt, Jt] = re(Vt.position), [$t, h] = re(Vt.total), k = x(Vt.position), gt = x(R.top), X = x(d ?? void 0), Pt = x(b ?? void 0), ct = x(/* @__PURE__ */ new Map()), It = x(null), Mt = x(null), [yt, ut] = re(null), [At, dt] = re(!1), st = x(null), _t = x(!1), Xt = x(0), Nt = x(!1), ne = x(!1), Gt = x(r);
|
|
2457
|
+
Gt.current !== r && (Gt.current = r, ne.current = !0), Y(() => {
|
|
2458
|
+
X.current = d ?? void 0, Pt.current = b ?? void 0;
|
|
2459
2459
|
}, [b, d]);
|
|
2460
|
-
const
|
|
2460
|
+
const Ct = S(
|
|
2461
2461
|
(l) => {
|
|
2462
2462
|
if (H && l && typeof l.focus == "function")
|
|
2463
2463
|
try {
|
|
@@ -2469,30 +2469,30 @@ const Dr = 1e4, qr = () => {
|
|
|
2469
2469
|
[H]
|
|
2470
2470
|
), f = S((l, { position: u, totalHeight: m }) => {
|
|
2471
2471
|
l(u, m);
|
|
2472
|
-
}, []),
|
|
2472
|
+
}, []), M = Qe(X, z, f), ft = S((l, u) => {
|
|
2473
2473
|
l(u);
|
|
2474
|
-
}, []), Tt = Qe(
|
|
2475
|
-
|
|
2476
|
-
const ie = x(
|
|
2477
|
-
ie.current =
|
|
2474
|
+
}, []), Tt = Qe(Pt, z, ft), wt = x(R.top);
|
|
2475
|
+
wt.current = R.top;
|
|
2476
|
+
const ie = x(M);
|
|
2477
|
+
ie.current = M, Y(() => (Lt.current = !1, () => {
|
|
2478
2478
|
Lt.current = !0, st.current && (clearTimeout(st.current), st.current = null);
|
|
2479
2479
|
}), []), Y(() => {
|
|
2480
2480
|
H || (ct.current.clear(), It.current = null, Mt.current = null);
|
|
2481
2481
|
}, [H]);
|
|
2482
|
-
const
|
|
2482
|
+
const Qt = S(
|
|
2483
2483
|
(l, u) => {
|
|
2484
2484
|
if (!u) {
|
|
2485
2485
|
ct.current.delete(l);
|
|
2486
2486
|
return;
|
|
2487
2487
|
}
|
|
2488
|
-
H && (ct.current.set(l, u), It.current === l && (It.current = null, Mt.current = l,
|
|
2488
|
+
H && (ct.current.set(l, u), It.current === l && (It.current = null, Mt.current = l, Ct(u)));
|
|
2489
2489
|
},
|
|
2490
|
-
[H,
|
|
2491
|
-
),
|
|
2490
|
+
[H, Ct]
|
|
2491
|
+
), te = 0.01, Kt = x({
|
|
2492
2492
|
rafId: null,
|
|
2493
2493
|
loopActive: !1,
|
|
2494
2494
|
idleFrames: 0,
|
|
2495
|
-
lastRenderedPosition:
|
|
2495
|
+
lastRenderedPosition: Vt.position
|
|
2496
2496
|
}), se = S(() => {
|
|
2497
2497
|
const l = Kt.current;
|
|
2498
2498
|
l.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(l.rafId), l.rafId = null, l.loopActive = !1, l.idleFrames = 0;
|
|
@@ -2504,11 +2504,11 @@ const Dr = 1e4, qr = () => {
|
|
|
2504
2504
|
[se]
|
|
2505
2505
|
);
|
|
2506
2506
|
const fe = x(() => {
|
|
2507
|
-
}),
|
|
2507
|
+
}), Zt = S(() => {
|
|
2508
2508
|
const l = Kt.current;
|
|
2509
2509
|
l.rafId = null;
|
|
2510
|
-
const u = k.current, m =
|
|
2511
|
-
if (
|
|
2510
|
+
const u = k.current, m = Wt(u, wt.current), D = E.getTotal();
|
|
2511
|
+
if (Jt((F) => Math.abs(F - u) < te ? F : u), Math.abs(l.lastRenderedPosition - u) >= te ? (ie.current({ position: m, totalHeight: D }), l.lastRenderedPosition = u, l.idleFrames = 0) : l.idleFrames += 1, l.idleFrames >= 2) {
|
|
2512
2512
|
se();
|
|
2513
2513
|
return;
|
|
2514
2514
|
}
|
|
@@ -2518,26 +2518,26 @@ const Dr = 1e4, qr = () => {
|
|
|
2518
2518
|
}
|
|
2519
2519
|
l.loopActive = !1;
|
|
2520
2520
|
}, [E, se]);
|
|
2521
|
-
fe.current =
|
|
2521
|
+
fe.current = Zt;
|
|
2522
2522
|
const we = S(() => {
|
|
2523
2523
|
const l = Kt.current;
|
|
2524
2524
|
if (l.idleFrames = 0, !l.loopActive) {
|
|
2525
2525
|
if (l.loopActive = !0, typeof requestAnimationFrame == "function") {
|
|
2526
|
-
l.rafId = requestAnimationFrame(
|
|
2526
|
+
l.rafId = requestAnimationFrame(Zt);
|
|
2527
2527
|
return;
|
|
2528
2528
|
}
|
|
2529
2529
|
l.loopActive = !1;
|
|
2530
2530
|
}
|
|
2531
|
-
}, [
|
|
2531
|
+
}, [Zt]), mt = S(
|
|
2532
2532
|
(l, u) => {
|
|
2533
|
-
const m = u?.immediate ?? !1, D =
|
|
2533
|
+
const m = u?.immediate ?? !1, D = Wt(l, R.top);
|
|
2534
2534
|
if (k.current = l, m) {
|
|
2535
|
-
Kt.current.lastRenderedPosition = l, Kt.current.idleFrames = 0,
|
|
2535
|
+
Kt.current.lastRenderedPosition = l, Kt.current.idleFrames = 0, Jt(l), M({ position: D, totalHeight: E.getTotal() });
|
|
2536
2536
|
return;
|
|
2537
2537
|
}
|
|
2538
2538
|
we();
|
|
2539
2539
|
},
|
|
2540
|
-
[we, E, R.top,
|
|
2540
|
+
[we, E, R.top, M]
|
|
2541
2541
|
), me = S((l) => {
|
|
2542
2542
|
const u = G.current;
|
|
2543
2543
|
if (!u)
|
|
@@ -2545,7 +2545,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2545
2545
|
const m = u.getScrollPosition();
|
|
2546
2546
|
Xt.current += 1;
|
|
2547
2547
|
const D = u.scrollTo(l);
|
|
2548
|
-
return D === m && (Xt.current = Math.max(0, Xt.current - 1)), Math.abs(D - l) > 0.5 && (
|
|
2548
|
+
return D === m && (Xt.current = Math.max(0, Xt.current - 1)), Math.abs(D - l) > 0.5 && (Nt.current = !0), D;
|
|
2549
2549
|
}, []), Ce = x(!1);
|
|
2550
2550
|
Y(() => {
|
|
2551
2551
|
if (!Ce.current)
|
|
@@ -2560,22 +2560,22 @@ const Dr = 1e4, qr = () => {
|
|
|
2560
2560
|
h(l);
|
|
2561
2561
|
return;
|
|
2562
2562
|
}
|
|
2563
|
-
if (
|
|
2564
|
-
|
|
2563
|
+
if (Nt.current) {
|
|
2564
|
+
Nt.current = !1;
|
|
2565
2565
|
const u = G.current;
|
|
2566
2566
|
if (u && Math.abs(u.getScrollPosition() - k.current) > 0.5) {
|
|
2567
2567
|
const m = me(k.current);
|
|
2568
|
-
|
|
2568
|
+
Nt.current = !1, mt(m, { immediate: !0 });
|
|
2569
2569
|
}
|
|
2570
2570
|
}
|
|
2571
2571
|
}, [E, $t, r, me, mt]), Y(() => {
|
|
2572
|
-
if (
|
|
2573
|
-
const { index: l, align: u, offset: m } =
|
|
2572
|
+
if (vt.current !== null) {
|
|
2573
|
+
const { index: l, align: u, offset: m } = vt.current, D = St(l, r), { cumulative: _, currentValue: F } = E.prefixSum(D, { materializeOption: { materialize: !1 } });
|
|
2574
2574
|
if (_ !== void 0 && F !== void 0) {
|
|
2575
2575
|
const $ = Math.max(_ - F, 0);
|
|
2576
2576
|
let K = $;
|
|
2577
2577
|
u === "bottom" ? K = _ - i : u === "center" && (K = $ + F / 2 - i / 2), m && (K -= m), K = Math.max(0, K);
|
|
2578
|
-
const
|
|
2578
|
+
const Rt = Math.max(0, $t + R.top + R.bottom - i), pt = Math.min(Ie(K, R.top), Rt);
|
|
2579
2579
|
Math.abs(pt - k.current) > 1 && (N.debug("[VirtualScroll] Drift correction", {
|
|
2580
2580
|
from: k.current,
|
|
2581
2581
|
to: pt,
|
|
@@ -2586,9 +2586,10 @@ const Dr = 1e4, qr = () => {
|
|
|
2586
2586
|
ne.current = !1;
|
|
2587
2587
|
}, [$t, E, r, R.top, mt, i, R.bottom]), Y(() => {
|
|
2588
2588
|
const l = gt.current;
|
|
2589
|
-
if (l === R.top)
|
|
2590
|
-
|
|
2591
|
-
|
|
2589
|
+
if (l === R.top || (gt.current = R.top, vt.current))
|
|
2590
|
+
return;
|
|
2591
|
+
const u = Wt(k.current, l), m = Ie(u, R.top);
|
|
2592
|
+
k.current = m, G.current?.scrollTo(m), mt(m, { immediate: !0 });
|
|
2592
2593
|
}, [R.top, mt]);
|
|
2593
2594
|
const ve = S(
|
|
2594
2595
|
(l, u) => {
|
|
@@ -2596,14 +2597,14 @@ const Dr = 1e4, qr = () => {
|
|
|
2596
2597
|
return;
|
|
2597
2598
|
const m = St(l, r), D = E.get(m), _ = u - D, F = E.update(m, u);
|
|
2598
2599
|
F !== void 0 && h(F), N.debug("[VirtualScroll] Updated item size manually", { index: m, size: u, total: F });
|
|
2599
|
-
let $ =
|
|
2600
|
+
let $ = vt.current ? vt.current.index : null;
|
|
2600
2601
|
if ($ === null) {
|
|
2601
|
-
const K = k.current,
|
|
2602
|
+
const K = k.current, Rt = Ze(W).top, pt = Wt(K, Rt), { index: ht, cumulative: Bt } = E.findIndexAtOrAfter(pt, { materializeOption: { materialize: !1 } });
|
|
2602
2603
|
$ = Bt !== void 0 && Bt === pt ? ht + 1 : ht;
|
|
2603
2604
|
}
|
|
2604
2605
|
if ($ !== -1 && m < $ && _ !== 0) {
|
|
2605
|
-
const K = k.current,
|
|
2606
|
-
me(
|
|
2606
|
+
const K = k.current, Rt = K + _;
|
|
2607
|
+
me(Rt), mt(Rt, { immediate: !0 }), N.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: K, to: Rt, causedByIndex: m, delta: _, activeVisibleStartIndex: $ });
|
|
2607
2608
|
}
|
|
2608
2609
|
},
|
|
2609
2610
|
[E, r, me, mt, W]
|
|
@@ -2614,11 +2615,11 @@ const Dr = 1e4, qr = () => {
|
|
|
2614
2615
|
const m = St(l, r), D = St(m - s * 2, r), _ = St(m + s * 2, r), { cumulative: F, total: $, currentValue: K } = E.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: D, to: _ }] } });
|
|
2615
2616
|
if (N.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", F, "Total height:", $, "ItemHeight:", K, "safeIndexFrom:", D, "safeIndexTo:", _), !$)
|
|
2616
2617
|
return;
|
|
2617
|
-
const
|
|
2618
|
-
let pt =
|
|
2619
|
-
u?.align === "bottom" ? pt = F - i : u?.align === "center" && (pt =
|
|
2618
|
+
const Rt = Math.max(F - K, 0);
|
|
2619
|
+
let pt = Rt;
|
|
2620
|
+
u?.align === "bottom" ? pt = F - i : u?.align === "center" && (pt = Rt + K / 2 - i / 2), u?.offset && (pt -= u.offset), pt = Math.max(0, pt);
|
|
2620
2621
|
const ht = Ie(pt, R.top), Bt = G.current?.getContentSize() ?? $ + R.top + R.bottom, kt = Math.max(0, Bt - i), qt = Math.min(ht, kt);
|
|
2621
|
-
|
|
2622
|
+
vt.current = {
|
|
2622
2623
|
index: m,
|
|
2623
2624
|
align: u?.align,
|
|
2624
2625
|
offset: u?.offset
|
|
@@ -2643,7 +2644,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2643
2644
|
), be = S(() => {
|
|
2644
2645
|
if (r === 0)
|
|
2645
2646
|
return null;
|
|
2646
|
-
const l =
|
|
2647
|
+
const l = Wt(k.current, R.top), { index: u, cumulative: m, currentValue: D } = E.findIndexAtOrAfter(l, { materializeOption: { materialize: !1 } });
|
|
2647
2648
|
if (u === -1)
|
|
2648
2649
|
return { index: r - 1, offsetPx: 0 };
|
|
2649
2650
|
if (m === l)
|
|
@@ -2652,10 +2653,10 @@ const Dr = 1e4, qr = () => {
|
|
|
2652
2653
|
return { index: u, offsetPx: Math.max(0, l - _) };
|
|
2653
2654
|
}, [E, r, R.top]), Ae = S(
|
|
2654
2655
|
(l) => {
|
|
2655
|
-
const u =
|
|
2656
|
+
const u = Wt(k.current, R.top), m = typeof l == "function" ? l(u) : l;
|
|
2656
2657
|
De(m);
|
|
2657
2658
|
const D = G.current?.getScrollPosition(), _ = typeof D == "number" ? D : k.current;
|
|
2658
|
-
return mt(_), _;
|
|
2659
|
+
return mt(_), Wt(_, wt.current);
|
|
2659
2660
|
},
|
|
2660
2661
|
[R.top, De, mt]
|
|
2661
2662
|
), ke = S(
|
|
@@ -2664,7 +2665,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2664
2665
|
const m = _t.current;
|
|
2665
2666
|
m && (_t.current = !1);
|
|
2666
2667
|
const D = Xt.current > 0;
|
|
2667
|
-
if (D && (Xt.current = 0), m || D || ne.current || (
|
|
2668
|
+
if (D && (Xt.current = 0), m || D || ne.current || (vt.current = null), mt(l), w) {
|
|
2668
2669
|
if (m || D)
|
|
2669
2670
|
return;
|
|
2670
2671
|
const _ = l - u;
|
|
@@ -2677,7 +2678,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2677
2678
|
}
|
|
2678
2679
|
},
|
|
2679
2680
|
[mt, w]
|
|
2680
|
-
), oe = Ft(() =>
|
|
2681
|
+
), oe = Ft(() => Wt(zt, R.top), [R.top, zt]), pe = Ft(() => {
|
|
2681
2682
|
const l = E.getTotal(), u = _r(oe, i, s, r, n, E, l);
|
|
2682
2683
|
return N.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
2683
2684
|
...u,
|
|
@@ -2693,24 +2694,24 @@ const Dr = 1e4, qr = () => {
|
|
|
2693
2694
|
const m = St(l, r);
|
|
2694
2695
|
if (!(u?.ensureVisible ?? !0)) {
|
|
2695
2696
|
const kt = ct.current.get(m);
|
|
2696
|
-
kt && (It.current = null, Mt.current = m,
|
|
2697
|
+
kt && (It.current = null, Mt.current = m, Ct(kt));
|
|
2697
2698
|
return;
|
|
2698
2699
|
}
|
|
2699
|
-
const _ = E.prefixSum(m, { materializeOption: { materialize: !1 } }), F = _.currentValue, $ = Math.max(_.cumulative - F, 0), K = $ + F,
|
|
2700
|
-
if ($ <
|
|
2700
|
+
const _ = E.prefixSum(m, { materializeOption: { materialize: !1 } }), F = _.currentValue, $ = Math.max(_.cumulative - F, 0), K = $ + F, Rt = Wt(k.current, R.top), pt = Rt + i;
|
|
2701
|
+
if ($ < Rt || K > pt) {
|
|
2701
2702
|
Ut(m);
|
|
2702
2703
|
const kt = ct.current.get(m);
|
|
2703
|
-
kt ? (It.current = null, Mt.current = m,
|
|
2704
|
+
kt ? (It.current = null, Mt.current = m, Ct(kt)) : It.current = m;
|
|
2704
2705
|
return;
|
|
2705
2706
|
}
|
|
2706
2707
|
const Bt = ct.current.get(m);
|
|
2707
2708
|
if (Bt) {
|
|
2708
|
-
It.current = null, Mt.current = m,
|
|
2709
|
+
It.current = null, Mt.current = m, Ct(Bt);
|
|
2709
2710
|
return;
|
|
2710
2711
|
}
|
|
2711
2712
|
It.current = m;
|
|
2712
2713
|
},
|
|
2713
|
-
[H, r, E, R.top, Ut,
|
|
2714
|
+
[H, r, E, R.top, Ut, Ct, i]
|
|
2714
2715
|
), g = S(
|
|
2715
2716
|
(l, u) => {
|
|
2716
2717
|
if (!H || l.defaultPrevented || l.altKey || l.metaKey || l.ctrlKey)
|
|
@@ -2754,7 +2755,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2754
2755
|
[H, r, at]
|
|
2755
2756
|
);
|
|
2756
2757
|
Y(() => {
|
|
2757
|
-
const l = G.current?.getScrollPosition() ?? 0, u = k.current, m =
|
|
2758
|
+
const l = G.current?.getScrollPosition() ?? 0, u = k.current, m = Wt(u, R.top);
|
|
2758
2759
|
N.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
2759
2760
|
renderingStartIndex: ae,
|
|
2760
2761
|
renderingEndIndex: le,
|
|
@@ -2774,7 +2775,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2774
2775
|
totalHeight: $t
|
|
2775
2776
|
});
|
|
2776
2777
|
}, [$t, le, ae, R.top, Tt, zt, xe, ce]);
|
|
2777
|
-
const L = S(() => w ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": At &&
|
|
2778
|
+
const L = S(() => w ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": At && yt !== null, children: yt === "up" ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ ot(
|
|
2778
2779
|
"button",
|
|
2779
2780
|
{
|
|
2780
2781
|
type: "button",
|
|
@@ -2794,7 +2795,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2794
2795
|
},
|
|
2795
2796
|
children: "Bottom"
|
|
2796
2797
|
}
|
|
2797
|
-
) }) }) : null, [w, At,
|
|
2798
|
+
) }) }) : null, [w, At, yt, Ut, r]), B = x(0), { visibleItems: bt, renderAnchor: Ot } = Ft(() => {
|
|
2798
2799
|
if (r === 0)
|
|
2799
2800
|
return {
|
|
2800
2801
|
visibleItems: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-text", children: "No items" }) }),
|
|
@@ -2803,7 +2804,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2803
2804
|
const l = St(ae, r), u = St(le, r), { cumulative: m, currentValue: D } = E.prefixSum(l, { materializeOption: { materialize: !1 } }), _ = m - D;
|
|
2804
2805
|
Number.isFinite(_) && Math.abs(_ - B.current) > Ar && (B.current = _);
|
|
2805
2806
|
const F = B.current, $ = [], K = [];
|
|
2806
|
-
let
|
|
2807
|
+
let Rt = 0, pt = _;
|
|
2807
2808
|
for (let ht = l; ht <= u; ht++) {
|
|
2808
2809
|
if (K.length >= Je) {
|
|
2809
2810
|
N.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Je, safeRenderingStartIndex: l, safeRenderingEndIndex: u });
|
|
@@ -2811,7 +2812,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2811
2812
|
}
|
|
2812
2813
|
const Bt = n(ht), kt = E.get(ht), qt = Bt - kt;
|
|
2813
2814
|
qt !== 0 && $.push({ index: ht, value: Bt });
|
|
2814
|
-
const Re = pt +
|
|
2815
|
+
const Re = pt + Rt, Fe = e ? e(ht) : ht;
|
|
2815
2816
|
K.push(
|
|
2816
2817
|
/* @__PURE__ */ ot(
|
|
2817
2818
|
Or,
|
|
@@ -2824,12 +2825,12 @@ const Dr = 1e4, qr = () => {
|
|
|
2824
2825
|
enableKeyboardNavigation: H,
|
|
2825
2826
|
onKeyDown: g,
|
|
2826
2827
|
onFocus: y,
|
|
2827
|
-
registerItemRef:
|
|
2828
|
+
registerItemRef: Qt,
|
|
2828
2829
|
children: I
|
|
2829
2830
|
},
|
|
2830
2831
|
Fe
|
|
2831
2832
|
)
|
|
2832
|
-
),
|
|
2833
|
+
), Rt += qt, pt += kt;
|
|
2833
2834
|
}
|
|
2834
2835
|
return $.length > 0 && Promise.resolve().then(() => {
|
|
2835
2836
|
if (Lt.current)
|
|
@@ -2863,14 +2864,14 @@ const Dr = 1e4, qr = () => {
|
|
|
2863
2864
|
y,
|
|
2864
2865
|
g,
|
|
2865
2866
|
me,
|
|
2866
|
-
|
|
2867
|
+
Qt,
|
|
2867
2868
|
le,
|
|
2868
2869
|
ae,
|
|
2869
2870
|
mt,
|
|
2870
2871
|
ce
|
|
2871
2872
|
]), Yt = S(
|
|
2872
2873
|
(l) => {
|
|
2873
|
-
const u = (z ?? 0) > 0, m = Math.abs(l - zt), D = u && m > 0.5 ? zt : l, _ =
|
|
2874
|
+
const u = (z ?? 0) > 0, m = Math.abs(l - zt), D = u && m > 0.5 ? zt : l, _ = Wt(D, R.top);
|
|
2874
2875
|
if (N.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
2875
2876
|
currentScrollPosition: l,
|
|
2876
2877
|
effectiveScrollPosition: _,
|
|
@@ -2906,7 +2907,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2906
2907
|
] });
|
|
2907
2908
|
},
|
|
2908
2909
|
[z, r, E, oe, Ot, le, ae, R, zt, i, bt]
|
|
2909
|
-
),
|
|
2910
|
+
), Pe = Ft(
|
|
2910
2911
|
() => ({
|
|
2911
2912
|
renderingStartIndex: pe.renderingStartIndex,
|
|
2912
2913
|
renderingEndIndex: pe.renderingEndIndex,
|
|
@@ -2921,11 +2922,14 @@ const Dr = 1e4, qr = () => {
|
|
|
2921
2922
|
[pe, oe, E, $t]
|
|
2922
2923
|
);
|
|
2923
2924
|
Y(() => {
|
|
2924
|
-
J.current =
|
|
2925
|
-
}, [
|
|
2925
|
+
J.current = Pe;
|
|
2926
|
+
}, [Pe]), Ue(
|
|
2926
2927
|
A,
|
|
2927
2928
|
() => ({
|
|
2928
|
-
getScrollPosition: () =>
|
|
2929
|
+
getScrollPosition: () => {
|
|
2930
|
+
const l = G.current?.getScrollPosition();
|
|
2931
|
+
return typeof l == "number" ? Wt(l, wt.current) : -1;
|
|
2932
|
+
},
|
|
2929
2933
|
getContentSize: () => G.current?.getContentSize() ?? -1,
|
|
2930
2934
|
getViewportSize: () => G.current?.getViewportSize() ?? -1,
|
|
2931
2935
|
scrollTo: Ae,
|
|
@@ -2954,7 +2958,7 @@ const Dr = 1e4, qr = () => {
|
|
|
2954
2958
|
inertiaOptions: Dt,
|
|
2955
2959
|
itemCount: r,
|
|
2956
2960
|
scrollBarWidth: O,
|
|
2957
|
-
enableThumbDrag:
|
|
2961
|
+
enableThumbDrag: P,
|
|
2958
2962
|
enableTrackClick: U,
|
|
2959
2963
|
enableArrowButtons: Z,
|
|
2960
2964
|
enablePointerDrag: T,
|
|
@@ -2963,18 +2967,18 @@ const Dr = 1e4, qr = () => {
|
|
|
2963
2967
|
wheelSpeedMultiplier: Ht,
|
|
2964
2968
|
onWheelHorizontal: xt,
|
|
2965
2969
|
contentInsets: R,
|
|
2966
|
-
contentProps:
|
|
2970
|
+
contentProps: Et,
|
|
2967
2971
|
visibleStartIndex: ce,
|
|
2968
2972
|
visibleEndIndex: xe,
|
|
2969
2973
|
renderOverlay: L,
|
|
2970
|
-
initialScrollPosition:
|
|
2974
|
+
initialScrollPosition: Vt.position,
|
|
2971
2975
|
children: Yt
|
|
2972
2976
|
}
|
|
2973
2977
|
);
|
|
2974
2978
|
}, Hr = $e(kr);
|
|
2975
2979
|
export {
|
|
2976
2980
|
ge as FenwickMapTree,
|
|
2977
|
-
|
|
2981
|
+
Pr as ScrollBar,
|
|
2978
2982
|
wr as ScrollPane,
|
|
2979
2983
|
rr as TAP_SCROLL_SPEED_DEFAULTS,
|
|
2980
2984
|
Hr as VirtualScroll,
|