@aiquants/virtualscroll 3.6.0 → 3.6.1
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 +19 -0
- package/dist/VirtualGrid.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +565 -559
- package/dist/useGridTapScroll.d.cts +1 -1
- package/dist/useGridTapScroll.d.ts +1 -1
- package/dist/useGridTapScroll.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/VirtualGrid.tsx +27 -1
- package/src/useGridTapScroll.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as Q, jsxs as Wt, Fragment as Xr } from "react/jsx-runtime";
|
|
2
|
-
import zn, { memo as Nn, forwardRef as Rr, useState as Oe, useRef as d, useCallback as w, useImperativeHandle as Pr, useMemo as
|
|
2
|
+
import zn, { memo as Nn, forwardRef as Rr, useState as Oe, useRef as d, useCallback as w, useImperativeHandle as Pr, useMemo as Me, useLayoutEffect as Qe, useEffect as q, useId as Cn, createElement as Cr } from "react";
|
|
3
3
|
import { twMerge as Et } from "tailwind-merge";
|
|
4
4
|
class V {
|
|
5
5
|
level;
|
|
@@ -182,13 +182,13 @@ const Qr = {
|
|
|
182
182
|
)
|
|
183
183
|
] });
|
|
184
184
|
}, qr = Nn(
|
|
185
|
-
Rr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual:
|
|
186
|
-
const [
|
|
185
|
+
Rr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a, axis: l = "y" }, f) => {
|
|
186
|
+
const [x, v] = Oe(Qr), R = d(null), T = d(null), S = d({ x: 0, y: 0 }), N = d(null), ee = d(0), F = w(
|
|
187
187
|
(I) => {
|
|
188
188
|
v(I), t(I);
|
|
189
189
|
},
|
|
190
190
|
[t]
|
|
191
|
-
),
|
|
191
|
+
), Ie = w(
|
|
192
192
|
(I, le, ue = !1) => {
|
|
193
193
|
const { x: Ye, y: _ } = S.current, Xe = I - Ye, ut = le - _;
|
|
194
194
|
let nt, Ge;
|
|
@@ -211,16 +211,16 @@ const Qr = {
|
|
|
211
211
|
});
|
|
212
212
|
},
|
|
213
213
|
[F, l]
|
|
214
|
-
),
|
|
214
|
+
), ye = w((I) => {
|
|
215
215
|
if (I === null)
|
|
216
216
|
return;
|
|
217
217
|
const le = N.current;
|
|
218
218
|
le?.hasPointerCapture(I) && le.releasePointerCapture(I);
|
|
219
219
|
}, []), A = w(
|
|
220
220
|
(I = !1) => {
|
|
221
|
-
I &&
|
|
221
|
+
I && ye(R.current), R.current = null, T.current = null, ee.current = 0, F(Qr);
|
|
222
222
|
},
|
|
223
|
-
[F,
|
|
223
|
+
[F, ye]
|
|
224
224
|
), $ = w(
|
|
225
225
|
(I) => {
|
|
226
226
|
if (R.current !== null && R.current !== I.pointerId) {
|
|
@@ -234,18 +234,18 @@ const Qr = {
|
|
|
234
234
|
le.setPointerCapture(I.pointerId);
|
|
235
235
|
} catch {
|
|
236
236
|
}
|
|
237
|
-
|
|
237
|
+
Ie(I.clientX, I.clientY, !0);
|
|
238
238
|
},
|
|
239
|
-
[
|
|
239
|
+
[Ie]
|
|
240
240
|
), ie = w(
|
|
241
241
|
(I) => {
|
|
242
242
|
if (R.current !== I.pointerId) {
|
|
243
243
|
T.current !== null && T.current.pointerId === I.pointerId && (T.current = { pointerId: I.pointerId, clientX: I.clientX, clientY: I.clientY });
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
|
-
I.preventDefault(),
|
|
246
|
+
I.preventDefault(), Ie(I.clientX, I.clientY);
|
|
247
247
|
},
|
|
248
|
-
[
|
|
248
|
+
[Ie]
|
|
249
249
|
), L = w(
|
|
250
250
|
(I) => {
|
|
251
251
|
if (R.current !== I.pointerId) {
|
|
@@ -255,7 +255,7 @@ const Qr = {
|
|
|
255
255
|
I.preventDefault(), I.stopPropagation();
|
|
256
256
|
const le = T.current;
|
|
257
257
|
if (T.current = null, le !== null) {
|
|
258
|
-
|
|
258
|
+
ye(I.pointerId);
|
|
259
259
|
const ue = N.current;
|
|
260
260
|
let Ye = !0;
|
|
261
261
|
if (ue !== null && typeof ue.setPointerCapture == "function")
|
|
@@ -265,13 +265,13 @@ const Qr = {
|
|
|
265
265
|
(typeof _ == "object" && _ !== null && "name" in _ ? _.name : void 0) === "NotFoundError" && (Ye = !1);
|
|
266
266
|
}
|
|
267
267
|
if (Ye) {
|
|
268
|
-
R.current = le.pointerId,
|
|
268
|
+
R.current = le.pointerId, Ie(le.clientX, le.clientY, !0);
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
A(!0);
|
|
273
273
|
},
|
|
274
|
-
[A,
|
|
274
|
+
[A, ye, Ie]
|
|
275
275
|
), z = w(
|
|
276
276
|
(I) => {
|
|
277
277
|
I.target === I.currentTarget && R.current === I.pointerId && A(!1);
|
|
@@ -288,31 +288,31 @@ const Qr = {
|
|
|
288
288
|
}),
|
|
289
289
|
[A]
|
|
290
290
|
);
|
|
291
|
-
const C = Math.min(Math.max(s, 0), 1), K = n / 64, B = Math.min(
|
|
291
|
+
const C = Math.min(Math.max(s, 0), 1), K = n / 64, B = Math.min(x.distance, r) / r, Y = x.direction * B * 10 * K;
|
|
292
292
|
let ae;
|
|
293
293
|
if (l === "xy") {
|
|
294
|
-
const I =
|
|
294
|
+
const I = x.distance, le = I === 0 ? 0 : Y * x.offsetX / I, ue = I === 0 ? 0 : Y * x.offsetY / I;
|
|
295
295
|
ae = `translate(${le}px, ${ue}px)`;
|
|
296
296
|
} else l === "x" ? ae = `translateX(${Y}px)` : ae = `translateY(${Y}px)`;
|
|
297
|
-
const ce =
|
|
298
|
-
dragState:
|
|
297
|
+
const ce = a ?? An, k = {
|
|
298
|
+
dragState: x,
|
|
299
299
|
normalizedDistance: B,
|
|
300
300
|
sizeScale: K,
|
|
301
301
|
size: n,
|
|
302
302
|
opacity: C
|
|
303
|
-
},
|
|
303
|
+
}, Te = {
|
|
304
304
|
...i,
|
|
305
305
|
width: n,
|
|
306
306
|
height: n,
|
|
307
307
|
transform: ae
|
|
308
308
|
};
|
|
309
|
-
return
|
|
309
|
+
return Te.opacity = C, /* @__PURE__ */ Q(
|
|
310
310
|
"div",
|
|
311
311
|
{
|
|
312
312
|
ref: N,
|
|
313
313
|
"data-testid": "virtual-scroll-tap-circle",
|
|
314
314
|
className: Et("aqvs-tap-scroll-circle", e),
|
|
315
|
-
style:
|
|
315
|
+
style: Te,
|
|
316
316
|
tabIndex: -1,
|
|
317
317
|
onPointerDown: $,
|
|
318
318
|
onPointerMove: ie,
|
|
@@ -330,8 +330,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
330
330
|
const r = e === "x", n = t.getBoundingClientRect(), i = r ? n.width : n.height, s = (v) => {
|
|
331
331
|
const R = Number.parseFloat(v);
|
|
332
332
|
return Number.isFinite(R) ? R : 0;
|
|
333
|
-
},
|
|
334
|
-
return
|
|
333
|
+
}, a = window.getComputedStyle(t), l = s(r ? a.width : a.height), f = l > 0 ? l + s(r ? a.paddingLeft : a.paddingTop) + s(r ? a.paddingRight : a.paddingBottom) + s(r ? a.borderLeftWidth : a.borderTopWidth) + s(r ? a.borderRightWidth : a.borderBottomWidth) : 0, x = f > 0 ? f : r ? t.offsetWidth : t.offsetHeight;
|
|
334
|
+
return x <= 0 || i <= 0 ? 1 : i / x;
|
|
335
335
|
}, mr = "virtualscroll:tap-scroll-cancel", Jr = 20, Dn = 250, Ln = 60, On = 20, _n = 20, pn = {
|
|
336
336
|
/** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
|
|
337
337
|
maxDistance: 240,
|
|
@@ -383,12 +383,12 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
383
383
|
renderVisual: t?.renderVisual ?? Yt.renderVisual,
|
|
384
384
|
maxSpeedCurve: t?.maxSpeedCurve ?? Yt.maxSpeedCurve
|
|
385
385
|
};
|
|
386
|
-
}, qn = ({ isDragging: t, isThumbHovered: e, enableThumbDrag: r }) =>
|
|
387
|
-
const i = d(null), s = d(null),
|
|
388
|
-
i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null),
|
|
386
|
+
}, qn = ({ isDragging: t, isThumbHovered: e, enableThumbDrag: r }) => Me(() => r ? t ? "dragging" : e ? "hover" : "idle" : "disabled", [r, t, e]), $n = ({ canUseArrowButtons: t, enableArrowButtons: e, resetTapScroll: r, scrollByStep: n }) => {
|
|
387
|
+
const i = d(null), s = d(null), a = d(null), l = w(() => {
|
|
388
|
+
i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), a.current !== null && (window.removeEventListener("pointerup", a.current), window.removeEventListener("pointercancel", a.current), window.removeEventListener("blur", a.current), a.current = null);
|
|
389
389
|
}, []), f = w(() => {
|
|
390
390
|
l();
|
|
391
|
-
}, [l]),
|
|
391
|
+
}, [l]), x = w(
|
|
392
392
|
(R) => (T) => {
|
|
393
393
|
if (!t)
|
|
394
394
|
return;
|
|
@@ -398,7 +398,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
398
398
|
}, Ln);
|
|
399
399
|
}, Dn);
|
|
400
400
|
const S = () => l();
|
|
401
|
-
|
|
401
|
+
a.current = S, window.addEventListener("pointerup", S), window.addEventListener("pointercancel", S), window.addEventListener("blur", S);
|
|
402
402
|
},
|
|
403
403
|
[t, l, r, n]
|
|
404
404
|
), v = w(
|
|
@@ -411,21 +411,21 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
411
411
|
t || l();
|
|
412
412
|
}, [t, l]), q(() => () => {
|
|
413
413
|
l();
|
|
414
|
-
}, [l]), { handleArrowPointerDown:
|
|
415
|
-
}, Yn = 700, er = (t, e) => typeof t == "number" && Number.isFinite(t) ? t : e, kr = ({ distance: t, maxDistance: e, viewportSize: r, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve:
|
|
416
|
-
const l = Math.max(er(t, 0), 0), f = er(e, 0),
|
|
417
|
-
let A =
|
|
418
|
-
if (
|
|
419
|
-
const ie = Math.min(Math.max(er(
|
|
414
|
+
}, [l]), { handleArrowPointerDown: x, handleArrowPointerUp: f, handleArrowKeyDown: v };
|
|
415
|
+
}, Yn = 700, er = (t, e) => typeof t == "number" && Number.isFinite(t) ? t : e, kr = ({ distance: t, maxDistance: e, viewportSize: r, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
|
|
416
|
+
const l = Math.max(er(t, 0), 0), f = er(e, 0), x = f > 0 ? Math.min(l, f) / f : 1, v = Math.max(er(r, 0), 0), R = Math.max(er(n, 0), 0), T = Math.max(er(i, 0), 0), S = Math.max(v * R, 40), N = s ? S : 1200, ee = Math.max(v * T, N), F = a ? Math.max(er(a.exponentialScale, T), 0) : 0, Ie = a ? Math.min(ee, Math.max(v * F, S)) : ee, ye = Math.max(Ie, S);
|
|
417
|
+
let A = x ** 1.1;
|
|
418
|
+
if (a) {
|
|
419
|
+
const ie = Math.min(Math.max(er(a.exponentialSteepness, 0), 0), Yn);
|
|
420
420
|
if (ie === 0)
|
|
421
|
-
A =
|
|
421
|
+
A = x;
|
|
422
422
|
else {
|
|
423
423
|
const L = Math.expm1(ie) || 1;
|
|
424
|
-
A = Math.min(Math.max(Math.expm1(ie *
|
|
424
|
+
A = Math.min(Math.max(Math.expm1(ie * x) / L, 0), 1);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
const $ = Math.min(Math.max(er(
|
|
428
|
-
return S + (
|
|
427
|
+
const $ = Math.min(Math.max(er(a?.easedOffset, 0), 0), 1);
|
|
428
|
+
return S + (ye - S) * ($ + (1 - $) * A);
|
|
429
429
|
}, Wn = (t) => {
|
|
430
430
|
if (!t || t <= 0)
|
|
431
431
|
return Vr;
|
|
@@ -438,10 +438,10 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
438
438
|
onScroll: n,
|
|
439
439
|
enableThumbDrag: i = !0,
|
|
440
440
|
enableTrackClick: s = !0,
|
|
441
|
-
enableArrowButtons:
|
|
441
|
+
enableArrowButtons: a = !0,
|
|
442
442
|
horizontal: l = !1,
|
|
443
443
|
enableHorizontalTapCircle: f = !1,
|
|
444
|
-
stretchMainSize:
|
|
444
|
+
stretchMainSize: x = !1,
|
|
445
445
|
scrollBarWidth: v = 12,
|
|
446
446
|
className: R,
|
|
447
447
|
ariaControls: T,
|
|
@@ -449,16 +449,16 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
449
449
|
itemCount: N,
|
|
450
450
|
renderThumbOverlay: ee,
|
|
451
451
|
visibleStartIndex: F,
|
|
452
|
-
visibleEndIndex:
|
|
452
|
+
visibleEndIndex: Ie
|
|
453
453
|
}) => {
|
|
454
|
-
const [
|
|
454
|
+
const [ye, A] = Oe(!1), [$, ie] = Oe(!1), [L, z] = Oe(!1), C = d(null), K = d({
|
|
455
455
|
pointerId: null,
|
|
456
456
|
startThumbPosition: 0,
|
|
457
457
|
startClientX: 0,
|
|
458
458
|
startClientY: 0,
|
|
459
459
|
scale: 1,
|
|
460
460
|
captureTarget: null
|
|
461
|
-
}), B = d({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), Y = d(r), ae = d(n), ce = d(en), k = d(null),
|
|
461
|
+
}), B = d({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), Y = d(r), ae = d(n), ce = d(en), k = d(null), Te = d(null), I = d(null), le = d(0), ue = d(0), Ye = Me(() => Fr(S, N), [N, S]), _ = Me(() => Xn(l), [l]), {
|
|
462
462
|
enabled: Xe,
|
|
463
463
|
size: ut,
|
|
464
464
|
offsetX: nt,
|
|
@@ -482,7 +482,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
482
482
|
effectiveTrackLength: 0,
|
|
483
483
|
onScroll: n,
|
|
484
484
|
scrollPosition: r
|
|
485
|
-
}), { mainSizeKey: re, crossSizeKey: Ke, positionKey: ge, selectDelta: D, getPointerCoordinate: Z, arrowLabels: We, arrowIcons: y, directionClass: vt, orientation: et } = _, xt = Math.max(Pe, 1), ct = e / t, Tt = Math.max(e - v * 2, 0), h = ct * Tt, H = Math.min(Math.max(Jr, h || 0), Tt || Jr), se = Math.max(t - e, 0), ne = Math.max(Tt - H, 0), he = se <= 0 || ne <= 0 ? 0 : oe(r / se * ne, 0, ne), xe = he + H / 2, ve = t > e ||
|
|
485
|
+
}), { mainSizeKey: re, crossSizeKey: Ke, positionKey: ge, selectDelta: D, getPointerCoordinate: Z, arrowLabels: We, arrowIcons: y, directionClass: vt, orientation: et } = _, xt = Math.max(Pe, 1), ct = e / t, Tt = Math.max(e - v * 2, 0), h = ct * Tt, H = Math.min(Math.max(Jr, h || 0), Tt || Jr), se = Math.max(t - e, 0), ne = Math.max(Tt - H, 0), he = se <= 0 || ne <= 0 ? 0 : oe(r / se * ne, 0, ne), xe = he + H / 2, ve = t > e || ye, Re = ve && a;
|
|
486
486
|
Qe(() => {
|
|
487
487
|
Je.current = {
|
|
488
488
|
viewportSize: e,
|
|
@@ -504,7 +504,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
504
504
|
}, [n]), q(() => {
|
|
505
505
|
i || ie(!1);
|
|
506
506
|
}, [i]);
|
|
507
|
-
const _e = qn({ isDragging:
|
|
507
|
+
const _e = qn({ isDragging: ye, isThumbHovered: $, enableThumbDrag: i }), me = w((u, E) => {
|
|
508
508
|
const O = Je.current, te = E ?? Y.current;
|
|
509
509
|
if (ae.current) {
|
|
510
510
|
const He = ae.current(u, te);
|
|
@@ -536,7 +536,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
536
536
|
},
|
|
537
537
|
[dt]
|
|
538
538
|
), Ee = w(() => {
|
|
539
|
-
|
|
539
|
+
Te.current !== null && (window.cancelAnimationFrame(Te.current), Te.current = null), I.current = null, le.current = 0, ue.current = 0;
|
|
540
540
|
}, []), Be = w(() => {
|
|
541
541
|
ce.current = { ...en }, z(!1), k.current?.reset(), Ee();
|
|
542
542
|
}, [Ee]), tt = w(
|
|
@@ -552,7 +552,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
552
552
|
}
|
|
553
553
|
const te = I.current ?? u, Ce = Math.max((u - te) / 1e3, 0), je = Math.min(Ce, gn);
|
|
554
554
|
if (I.current = u, je <= 0) {
|
|
555
|
-
|
|
555
|
+
Te.current = window.requestAnimationFrame(tt);
|
|
556
556
|
return;
|
|
557
557
|
}
|
|
558
558
|
const St = kr({
|
|
@@ -570,11 +570,11 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
570
570
|
Ee();
|
|
571
571
|
return;
|
|
572
572
|
}
|
|
573
|
-
|
|
573
|
+
Te.current = window.requestAnimationFrame(tt);
|
|
574
574
|
},
|
|
575
575
|
[ft, Ee]
|
|
576
576
|
), it = w(() => {
|
|
577
|
-
|
|
577
|
+
Te.current === null && (I.current = null, le.current = 0, Te.current = window.requestAnimationFrame(tt));
|
|
578
578
|
}, [tt]);
|
|
579
579
|
q(() => {
|
|
580
580
|
const u = ce.current;
|
|
@@ -615,7 +615,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
615
615
|
document.removeEventListener("pointerdown", u, !0);
|
|
616
616
|
};
|
|
617
617
|
}, [Be, Xe]);
|
|
618
|
-
const
|
|
618
|
+
const we = (u) => {
|
|
619
619
|
if (!ve || ne <= 0 || se <= 0)
|
|
620
620
|
return 0;
|
|
621
621
|
const E = oe(u, 0, ne);
|
|
@@ -668,8 +668,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
668
668
|
},
|
|
669
669
|
[ft]
|
|
670
670
|
), { handleArrowPointerDown: Fe, handleArrowPointerUp: ht, handleArrowKeyDown: ke } = $n({
|
|
671
|
-
canUseArrowButtons:
|
|
672
|
-
enableArrowButtons:
|
|
671
|
+
canUseArrowButtons: Re,
|
|
672
|
+
enableArrowButtons: a,
|
|
673
673
|
resetTapScroll: Be,
|
|
674
674
|
scrollByStep: Rt
|
|
675
675
|
}), Bt = (u) => {
|
|
@@ -709,7 +709,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
709
709
|
return;
|
|
710
710
|
const E = u.currentTarget, O = E.getBoundingClientRect(), te = Z(u), Ce = p(E), je = (te - (l ? O.left : O.top)) / Ce;
|
|
711
711
|
Be();
|
|
712
|
-
const St = je - H / 2, He =
|
|
712
|
+
const St = je - H / 2, He = we(St);
|
|
713
713
|
if (me(He), E.setPointerCapture)
|
|
714
714
|
try {
|
|
715
715
|
E.setPointerCapture(u.pointerId);
|
|
@@ -732,7 +732,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
732
732
|
Vt();
|
|
733
733
|
return;
|
|
734
734
|
}
|
|
735
|
-
const O = u.clientX - E.startClientX, te = u.clientY - E.startClientY, Ce = D(O, te) / (E.scale || 1), je =
|
|
735
|
+
const O = u.clientX - E.startClientX, te = u.clientY - E.startClientY, Ce = D(O, te) / (E.scale || 1), je = we(E.startThumbPosition + Ce);
|
|
736
736
|
me(je), u.cancelable && u.preventDefault();
|
|
737
737
|
}, zt = (u) => {
|
|
738
738
|
if (B.current.pointerId !== u.pointerId)
|
|
@@ -746,7 +746,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
746
746
|
E.hasPointerCapture?.(u.pointerId) && E.releasePointerCapture(u.pointerId), Vt();
|
|
747
747
|
}, De = (u) => {
|
|
748
748
|
u.target === u.currentTarget && B.current.pointerId === u.pointerId && Vt();
|
|
749
|
-
}, Pt =
|
|
749
|
+
}, Pt = Me(() => oe((L ? 1 : 0.8) * fe, 0, 1), [L, fe]), At = Me(() => {
|
|
750
750
|
const E = `calc(50% - ${ut / 2}px + ${Ge}px)`;
|
|
751
751
|
return {
|
|
752
752
|
left: nt,
|
|
@@ -768,8 +768,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
768
768
|
onPointerLeave: ht,
|
|
769
769
|
onPointerCancel: ht,
|
|
770
770
|
onKeyDown: ke(u),
|
|
771
|
-
"aria-disabled": !
|
|
772
|
-
disabled: !
|
|
771
|
+
"aria-disabled": !a,
|
|
772
|
+
disabled: !Re,
|
|
773
773
|
children: /* @__PURE__ */ Q("span", { "aria-hidden": "true", children: O })
|
|
774
774
|
},
|
|
775
775
|
te
|
|
@@ -783,10 +783,10 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
783
783
|
thumbPosition: he,
|
|
784
784
|
thumbCenter: xe,
|
|
785
785
|
trackSize: Tt,
|
|
786
|
-
isDragging:
|
|
786
|
+
isDragging: ye,
|
|
787
787
|
isTapScrollActive: L,
|
|
788
788
|
visibleStartIndex: F,
|
|
789
|
-
visibleEndIndex:
|
|
789
|
+
visibleEndIndex: Ie
|
|
790
790
|
} : null;
|
|
791
791
|
return /* @__PURE__ */ Wt(
|
|
792
792
|
"div",
|
|
@@ -795,7 +795,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
795
795
|
style: {
|
|
796
796
|
// 自己計測ペインの縦バーはインライン主軸寸を書かない (ラチェット遮断 — ペイン仕様 §2.5)。
|
|
797
797
|
// 横バーは stretch が主軸を寸法決めできないため常に書く
|
|
798
|
-
...
|
|
798
|
+
...x && !l ? {} : { [re]: e },
|
|
799
799
|
[Ke]: v
|
|
800
800
|
},
|
|
801
801
|
"data-visible": ve ? "true" : "false",
|
|
@@ -847,7 +847,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
847
847
|
[ge]: he,
|
|
848
848
|
...l ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
|
|
849
849
|
},
|
|
850
|
-
"data-visible": ve ||
|
|
850
|
+
"data-visible": ve || ye ? "true" : "false",
|
|
851
851
|
onPointerDown: Bt,
|
|
852
852
|
role: "slider",
|
|
853
853
|
"aria-orientation": l ? "horizontal" : "vertical",
|
|
@@ -888,7 +888,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
888
888
|
}
|
|
889
889
|
);
|
|
890
890
|
}, Bn = ({ offsetX: t, offsetY: e, maxDistance: r, x: n, y: i }) => {
|
|
891
|
-
const s = Number.isFinite(t) ? t : 0,
|
|
891
|
+
const s = Number.isFinite(t) ? t : 0, a = Number.isFinite(e) ? e : 0, l = Math.hypot(s, a);
|
|
892
892
|
if (l === 0)
|
|
893
893
|
return { x: 0, y: 0 };
|
|
894
894
|
const f = kr({
|
|
@@ -899,7 +899,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
899
899
|
maxSpeedMultiplier: n.maxSpeedMultiplier,
|
|
900
900
|
hasCustomMaxSpeedMultiplier: n.hasCustomMaxSpeedMultiplier,
|
|
901
901
|
curve: n.curve
|
|
902
|
-
}),
|
|
902
|
+
}), x = kr({
|
|
903
903
|
distance: l,
|
|
904
904
|
maxDistance: r,
|
|
905
905
|
viewportSize: i.viewportSize,
|
|
@@ -908,7 +908,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
908
908
|
hasCustomMaxSpeedMultiplier: i.hasCustomMaxSpeedMultiplier,
|
|
909
909
|
curve: i.curve
|
|
910
910
|
});
|
|
911
|
-
return { x: f * s / l, y:
|
|
911
|
+
return { x: f * s / l, y: x * a / l };
|
|
912
912
|
}, Mi = (t) => {
|
|
913
913
|
const { quantum: e, resetOnDirectionChange: r = !0 } = t;
|
|
914
914
|
if (!(Number.isFinite(e) && e > 0))
|
|
@@ -958,10 +958,10 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
958
958
|
onViewportSizeChange: n,
|
|
959
959
|
scrollBarWidth: i = 12,
|
|
960
960
|
enableThumbDrag: s = !0,
|
|
961
|
-
enableTrackClick:
|
|
961
|
+
enableTrackClick: a = !0,
|
|
962
962
|
enableArrowButtons: l = !0,
|
|
963
963
|
enablePointerDrag: f = !0,
|
|
964
|
-
pointerDragInputs:
|
|
964
|
+
pointerDragInputs: x = jn,
|
|
965
965
|
onScroll: v,
|
|
966
966
|
className: R,
|
|
967
967
|
testId: T,
|
|
@@ -969,8 +969,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
969
969
|
background: N,
|
|
970
970
|
tapScrollCircleOptions: ee,
|
|
971
971
|
inertiaOptions: F,
|
|
972
|
-
itemCount:
|
|
973
|
-
renderThumbOverlay:
|
|
972
|
+
itemCount: Ie,
|
|
973
|
+
renderThumbOverlay: ye,
|
|
974
974
|
wheelSpeedMultiplier: A = 1,
|
|
975
975
|
overscrollBehavior: $ = "auto",
|
|
976
976
|
onWheelHorizontal: ie,
|
|
@@ -982,7 +982,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
982
982
|
initialScrollPosition: Y = 0,
|
|
983
983
|
contentProps: ae
|
|
984
984
|
}, ce) => {
|
|
985
|
-
const k = d(Number.isFinite(Y) ? Math.max(0, Y) : 0),
|
|
985
|
+
const k = d(Number.isFinite(Y) ? Math.max(0, Y) : 0), Te = d(null), I = d(null), le = r === void 0, [ue, Ye] = Oe(0), _ = r ?? ue, Xe = d(null);
|
|
986
986
|
Qe(() => {
|
|
987
987
|
if (!le)
|
|
988
988
|
return;
|
|
@@ -1008,7 +1008,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1008
1008
|
}, [le, ue, n]), Qe(() => {
|
|
1009
1009
|
if (le)
|
|
1010
1010
|
return;
|
|
1011
|
-
const h =
|
|
1011
|
+
const h = Te.current;
|
|
1012
1012
|
if (!h)
|
|
1013
1013
|
return;
|
|
1014
1014
|
const H = () => {
|
|
@@ -1040,7 +1040,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1040
1040
|
velocity: 0,
|
|
1041
1041
|
lastTimestamp: null,
|
|
1042
1042
|
generation: 0
|
|
1043
|
-
}), at =
|
|
1043
|
+
}), at = Me(
|
|
1044
1044
|
() => ({
|
|
1045
1045
|
maxVelocity: F?.maxVelocity ?? fr.maxVelocity,
|
|
1046
1046
|
minVelocity: F?.minVelocity ?? fr.minVelocity,
|
|
@@ -1049,7 +1049,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1049
1049
|
startVelocityThreshold: F?.startVelocityThreshold ?? fr.startVelocityThreshold
|
|
1050
1050
|
}),
|
|
1051
1051
|
[F]
|
|
1052
|
-
), Pe =
|
|
1052
|
+
), Pe = Me(() => ({
|
|
1053
1053
|
top: Math.max(0, z?.top ?? 0),
|
|
1054
1054
|
bottom: Math.max(0, z?.bottom ?? 0)
|
|
1055
1055
|
}), [z]);
|
|
@@ -1064,17 +1064,17 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1064
1064
|
enablePointerDrag: f,
|
|
1065
1065
|
contentInsets: Pe
|
|
1066
1066
|
}));
|
|
1067
|
-
const qe = d({ contentSize: e, viewportSize: _ }), be =
|
|
1067
|
+
const qe = d({ contentSize: e, viewportSize: _ }), be = Me(() => e > _, [e, _]), fe = w(
|
|
1068
1068
|
(h, H) => {
|
|
1069
1069
|
let se = H ?? qe.current;
|
|
1070
1070
|
H && !(Number.isFinite(H.contentSize) && Number.isFinite(H.viewportSize)) && (V.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: H }), se = qe.current);
|
|
1071
1071
|
const { contentSize: ne, viewportSize: he } = se, xe = ne > he, ve = k.current;
|
|
1072
1072
|
if (V.debug("[ScrollPane] scrollTo called", () => ({ newPosition: h, contentSize: ne, viewportSize: he, currentIsScrollable: xe, prevPosition: ve })), !xe)
|
|
1073
1073
|
return k.current !== 0 && (k.current = 0, v?.(0, ve)), k.current;
|
|
1074
|
-
const
|
|
1075
|
-
if (!Number.isFinite(
|
|
1076
|
-
return V.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition:
|
|
1077
|
-
const _e = Math.max(ne - he, 0), me = oe(
|
|
1074
|
+
const Re = typeof h == "function" ? h(k.current) : h;
|
|
1075
|
+
if (!Number.isFinite(Re))
|
|
1076
|
+
return V.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: Re }), k.current;
|
|
1077
|
+
const _e = Math.max(ne - he, 0), me = oe(Re, 0, _e);
|
|
1078
1078
|
return k.current !== me && (k.current = me, v?.(me, ve)), k.current;
|
|
1079
1079
|
},
|
|
1080
1080
|
[v]
|
|
@@ -1099,17 +1099,17 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1099
1099
|
if (Math.abs(xe) < he)
|
|
1100
1100
|
return;
|
|
1101
1101
|
j(), Ge.current.velocity = xe, Ge.current.lastTimestamp = null;
|
|
1102
|
-
const ve = Ge.current.generation,
|
|
1102
|
+
const ve = Ge.current.generation, Re = (_e) => {
|
|
1103
1103
|
const me = Ge.current;
|
|
1104
1104
|
if (me.generation !== ve)
|
|
1105
1105
|
return;
|
|
1106
1106
|
if (me.lastTimestamp === null) {
|
|
1107
|
-
me.lastTimestamp = _e, me.frame = requestAnimationFrame(
|
|
1107
|
+
me.lastTimestamp = _e, me.frame = requestAnimationFrame(Re);
|
|
1108
1108
|
return;
|
|
1109
1109
|
}
|
|
1110
1110
|
const dt = _e - me.lastTimestamp;
|
|
1111
1111
|
if (me.lastTimestamp = _e, dt <= 0) {
|
|
1112
|
-
me.frame = requestAnimationFrame(
|
|
1112
|
+
me.frame = requestAnimationFrame(Re);
|
|
1113
1113
|
return;
|
|
1114
1114
|
}
|
|
1115
1115
|
const ft = me.velocity;
|
|
@@ -1119,16 +1119,16 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1119
1119
|
const it = (ft + Ee) / 2 * dt, pe = k.current;
|
|
1120
1120
|
if (it !== 0 && Ve.current((lt) => lt + it), Ge.current.generation !== ve)
|
|
1121
1121
|
return;
|
|
1122
|
-
const
|
|
1122
|
+
const we = k.current, { contentSize: wt, viewportSize: p } = qe.current, P = Math.max(wt - p, 0);
|
|
1123
1123
|
me.velocity = Ee;
|
|
1124
|
-
const Ae =
|
|
1124
|
+
const Ae = we === pe || we <= 0 && Ee <= 0 || we >= P && Ee >= 0;
|
|
1125
1125
|
if (Math.abs(Ee) < se || Ae) {
|
|
1126
1126
|
j();
|
|
1127
1127
|
return;
|
|
1128
1128
|
}
|
|
1129
|
-
me.frame = requestAnimationFrame(
|
|
1129
|
+
me.frame = requestAnimationFrame(Re);
|
|
1130
1130
|
};
|
|
1131
|
-
Ge.current.frame = requestAnimationFrame(
|
|
1131
|
+
Ge.current.frame = requestAnimationFrame(Re);
|
|
1132
1132
|
},
|
|
1133
1133
|
[be, at, j]
|
|
1134
1134
|
), Ke = d(re);
|
|
@@ -1168,11 +1168,11 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1168
1168
|
return !1;
|
|
1169
1169
|
let ve = xe.verticalDelta;
|
|
1170
1170
|
if (ne !== 1 && (ve *= ne), he !== "contain") {
|
|
1171
|
-
const
|
|
1172
|
-
if (ve > 0 &&
|
|
1171
|
+
const Re = k.current, _e = Math.max(qe.current.contentSize - se, 0);
|
|
1172
|
+
if (ve > 0 && Re >= _e || ve < 0 && Re <= 0)
|
|
1173
1173
|
return !1;
|
|
1174
1174
|
}
|
|
1175
|
-
return rn(h), h.preventDefault(), j(), V.debug("[ScrollPane] wheel event", () => ({ deltaY: ve, scrollPosition: k.current, wheelSpeedMultiplier: ne, deltaMode: h.deltaMode, scrollTop: I.current?.scrollTop })), fe((
|
|
1175
|
+
return rn(h), h.preventDefault(), j(), V.debug("[ScrollPane] wheel event", () => ({ deltaY: ve, scrollPosition: k.current, wheelSpeedMultiplier: ne, deltaMode: h.deltaMode, scrollTop: I.current?.scrollTop })), fe((Re) => Re + ve), !0;
|
|
1176
1176
|
},
|
|
1177
1177
|
[fe, j]
|
|
1178
1178
|
);
|
|
@@ -1181,7 +1181,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1181
1181
|
D(ne);
|
|
1182
1182
|
}, H = () => {
|
|
1183
1183
|
j();
|
|
1184
|
-
}, se =
|
|
1184
|
+
}, se = Te.current;
|
|
1185
1185
|
return se && (se.addEventListener("wheel", h, { passive: !1 }), se.addEventListener("pointerdown", H, { capture: !0, passive: !0 })), () => {
|
|
1186
1186
|
se && (se.removeEventListener("wheel", h), se.removeEventListener("pointerdown", H, { capture: !0 }));
|
|
1187
1187
|
};
|
|
@@ -1209,12 +1209,12 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1209
1209
|
velocitySamples: [],
|
|
1210
1210
|
scale: 1,
|
|
1211
1211
|
scaleX: 1
|
|
1212
|
-
}), vt = d(f), et = d(
|
|
1212
|
+
}), vt = d(f), et = d(x);
|
|
1213
1213
|
q(() => {
|
|
1214
1214
|
vt.current = f;
|
|
1215
1215
|
}, [f]), q(() => {
|
|
1216
|
-
et.current =
|
|
1217
|
-
}, [
|
|
1216
|
+
et.current = x;
|
|
1217
|
+
}, [x]);
|
|
1218
1218
|
const xt = d(be);
|
|
1219
1219
|
q(() => {
|
|
1220
1220
|
xt.current = be;
|
|
@@ -1224,13 +1224,13 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1224
1224
|
ct.current = at;
|
|
1225
1225
|
}, [at]), q(() => {
|
|
1226
1226
|
const h = y.current;
|
|
1227
|
-
if (f && be && (h.pointerId === null || Ar(h.pointerType,
|
|
1227
|
+
if (f && be && (h.pointerId === null || Ar(h.pointerType, x)) || h.pointerId === null)
|
|
1228
1228
|
return;
|
|
1229
1229
|
const H = I.current;
|
|
1230
1230
|
h.clickResetTimer !== null && (window.clearTimeout(h.clickResetTimer), h.clickResetTimer = null);
|
|
1231
1231
|
const se = h.isDragging && h.shouldCancelNextClick, ne = h.pointerId;
|
|
1232
1232
|
h.pointerId = null, h.pointerType = "", h.startClientY = 0, h.startScroll = 0, h.isDragging = !1, h.shouldCancelNextClick = se, h.velocitySamples = [], h.scale = 1, H?.hasPointerCapture(ne) && H.releasePointerCapture(ne);
|
|
1233
|
-
}, [f,
|
|
1233
|
+
}, [f, x, be]), q(() => {
|
|
1234
1234
|
const h = I.current;
|
|
1235
1235
|
if (!h)
|
|
1236
1236
|
return;
|
|
@@ -1245,7 +1245,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1245
1245
|
P.velocitySamples.push({ clientY: p, time: Ae });
|
|
1246
1246
|
const lt = ct.current.velocitySampleWindow;
|
|
1247
1247
|
P.velocitySamples = P.velocitySamples.filter(($e) => Ae - $e.time <= lt);
|
|
1248
|
-
}, ve = (p) => p instanceof HTMLElement && p.closest("[data-scrollpane-ignore-drag='true']") !== null,
|
|
1248
|
+
}, ve = (p) => p instanceof HTMLElement && p.closest("[data-scrollpane-ignore-drag='true']") !== null, Re = (p) => {
|
|
1249
1249
|
const P = y.current;
|
|
1250
1250
|
P.shouldCancelNextClick && (p.preventDefault(), p.stopPropagation(), P.shouldCancelNextClick = !1);
|
|
1251
1251
|
}, _e = (p) => {
|
|
@@ -1329,8 +1329,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1329
1329
|
return;
|
|
1330
1330
|
}
|
|
1331
1331
|
me(p) && dt(p.pointerId);
|
|
1332
|
-
},
|
|
1333
|
-
["click",
|
|
1332
|
+
}, we = [
|
|
1333
|
+
["click", Re, !0],
|
|
1334
1334
|
["pointerdown", tt, { passive: !1 }],
|
|
1335
1335
|
["lostpointercapture", (p) => {
|
|
1336
1336
|
p.target !== h || y.current.pointerId !== p.pointerId || dt(p.pointerId);
|
|
@@ -1340,8 +1340,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1340
1340
|
["pointerup", Be, void 0],
|
|
1341
1341
|
["pointercancel", it, void 0]
|
|
1342
1342
|
];
|
|
1343
|
-
return Mr(h,
|
|
1344
|
-
Mr(h,
|
|
1343
|
+
return Mr(h, we, "add"), Mr(window, wt, "add"), () => {
|
|
1344
|
+
Mr(h, we, "remove"), Mr(window, wt, "remove");
|
|
1345
1345
|
const p = y.current;
|
|
1346
1346
|
p.pointerId !== null && h.hasPointerCapture(p.pointerId) && h.releasePointerCapture(p.pointerId), he(), ne();
|
|
1347
1347
|
};
|
|
@@ -1350,7 +1350,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1350
1350
|
(h) => (j(), fe(h)),
|
|
1351
1351
|
[fe, j]
|
|
1352
1352
|
);
|
|
1353
|
-
return /* @__PURE__ */ Wt("div", { ref:
|
|
1353
|
+
return /* @__PURE__ */ Wt("div", { ref: Te, "data-testid": T, "data-self-measured": le ? "true" : void 0, className: Et("aqvs-scroll-pane", R), style: S, children: [
|
|
1354
1354
|
/* @__PURE__ */ Wt(
|
|
1355
1355
|
"div",
|
|
1356
1356
|
{
|
|
@@ -1378,7 +1378,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1378
1378
|
// 同一条件で揃えてあるため状態としても一貫している。
|
|
1379
1379
|
// 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
|
|
1380
1380
|
// (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
|
|
1381
|
-
...f && be &&
|
|
1381
|
+
...f && be && x.some((h) => h === "touch" || h === "pen") ? { touchAction: "none" } : {}
|
|
1382
1382
|
},
|
|
1383
1383
|
...ae,
|
|
1384
1384
|
id: We,
|
|
@@ -1397,13 +1397,13 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1397
1397
|
scrollPosition: k.current,
|
|
1398
1398
|
onScroll: Tt,
|
|
1399
1399
|
enableThumbDrag: s,
|
|
1400
|
-
enableTrackClick:
|
|
1400
|
+
enableTrackClick: a,
|
|
1401
1401
|
enableArrowButtons: l,
|
|
1402
1402
|
scrollBarWidth: i,
|
|
1403
1403
|
ariaControls: We,
|
|
1404
1404
|
tapScrollCircleOptions: ee,
|
|
1405
|
-
itemCount:
|
|
1406
|
-
renderThumbOverlay:
|
|
1405
|
+
itemCount: Ie,
|
|
1406
|
+
renderThumbOverlay: ye,
|
|
1407
1407
|
visibleStartIndex: C,
|
|
1408
1408
|
visibleEndIndex: K
|
|
1409
1409
|
},
|
|
@@ -1413,14 +1413,14 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1413
1413
|
] });
|
|
1414
1414
|
}
|
|
1415
1415
|
), nn = (t, e, r) => Math.min(Math.max(t, e), r), Ii = ({ dragState: t, normalizedDistance: e, sizeScale: r, size: n }) => {
|
|
1416
|
-
const i = Math.max(n / 2, 1), s = 1 + e * 0.65,
|
|
1416
|
+
const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), l = t.direction * e * 26 * r, f = 0.8 + e * 0.18, x = 3 * r, v = 6 * r, R = 22 * r, T = Math.abs(l) + v, S = l > 0 ? x : -Math.abs(l) - x, N = Math.max(2.5, 3 * r), ee = nn(t.offsetX, -i, i), F = nn(t.offsetY, -i, i), Ie = i * 0.35, ye = ee / i * Ie, A = F / i * Ie, $ = ye * 0.45, ie = A * 0.45, L = Math.max(R * 0.38, 6), z = 0.65 + e * 0.2, C = t.active;
|
|
1417
1417
|
return /* @__PURE__ */ Wt(Xr, { children: [
|
|
1418
1418
|
/* @__PURE__ */ Q(
|
|
1419
1419
|
"div",
|
|
1420
1420
|
{
|
|
1421
1421
|
className: "aqvs-tap-scroll-circle-gradient",
|
|
1422
1422
|
style: {
|
|
1423
|
-
transform: `scale(${
|
|
1423
|
+
transform: `scale(${a}, ${s})`,
|
|
1424
1424
|
transition: C ? "40ms transform ease-out" : "200ms ease transform"
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
@@ -1432,7 +1432,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1432
1432
|
style: {
|
|
1433
1433
|
width: R,
|
|
1434
1434
|
height: R,
|
|
1435
|
-
transform: `translate(calc(-50% + ${
|
|
1435
|
+
transform: `translate(calc(-50% + ${ye}px), calc(-50% + ${A}px)) scale(${a}, ${f * s})`,
|
|
1436
1436
|
transition: C ? "70ms transform ease-out" : "200ms ease transform"
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
@@ -1444,7 +1444,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
|
|
|
1444
1444
|
style: {
|
|
1445
1445
|
width: L,
|
|
1446
1446
|
height: L,
|
|
1447
|
-
transform: `translate(calc(-50% + ${$}px), calc(-50% + ${ie}px)) scale(${
|
|
1447
|
+
transform: `translate(calc(-50% + ${$}px), calc(-50% + ${ie}px)) scale(${a}, ${s})`,
|
|
1448
1448
|
opacity: z,
|
|
1449
1449
|
boxShadow: "0 0 8px rgba(255,255,255,0.45)",
|
|
1450
1450
|
transition: C ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
|
|
@@ -1547,36 +1547,36 @@ class Jt {
|
|
|
1547
1547
|
this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.valueFn = void 0, this.baseValue = r, this.total = this.baseValue * this.size;
|
|
1548
1548
|
return;
|
|
1549
1549
|
}
|
|
1550
|
-
let s = 0,
|
|
1550
|
+
let s = 0, a;
|
|
1551
1551
|
const l = n?.baseValue;
|
|
1552
1552
|
if (l !== void 0 && !(Number.isFinite(l) && l >= 0))
|
|
1553
1553
|
throw new RangeError(`[FenwickMapTree] options.baseValue must be a finite number >= 0, received ${l}.`);
|
|
1554
1554
|
if (i > 0 && l !== void 0) {
|
|
1555
1555
|
if (s = l, n?.materialize) {
|
|
1556
1556
|
const f = n?.sampleRange ?? { from: 0, to: Math.min(lr - 1, i - 1) };
|
|
1557
|
-
let
|
|
1558
|
-
|
|
1557
|
+
let x = Math.max(0, Math.trunc(f.from)), v = Math.min(Math.trunc(f.to), i - 1);
|
|
1558
|
+
x > v && (x = 0, v = Math.min(lr - 1, i - 1)), a = { from: x, values: Jt._collectValidatedValues(r, x, v) };
|
|
1559
1559
|
}
|
|
1560
1560
|
} else if (i > 0) {
|
|
1561
1561
|
const f = n?.sampleRange ?? {
|
|
1562
1562
|
from: 0,
|
|
1563
1563
|
to: Math.min(lr - 1, i - 1)
|
|
1564
1564
|
};
|
|
1565
|
-
let
|
|
1566
|
-
if (
|
|
1567
|
-
s = Jt._sampleBaseValueStrided(r, i, lr), n?.materialize && (
|
|
1565
|
+
let x = Math.max(0, Math.trunc(f.from)), v = Math.min(Math.trunc(f.to), i - 1);
|
|
1566
|
+
if (x > v && (x = 0, v = Math.min(lr - 1, i - 1)), i > lr)
|
|
1567
|
+
s = Jt._sampleBaseValueStrided(r, i, lr), n?.materialize && (a = { from: x, values: Jt._collectValidatedValues(r, x, v) });
|
|
1568
1568
|
else {
|
|
1569
|
-
const R = Jt._collectValidatedValues(r,
|
|
1570
|
-
s = Jt._modeOrMedian([...R]), n?.materialize && (
|
|
1569
|
+
const R = Jt._collectValidatedValues(r, x, v);
|
|
1570
|
+
s = Jt._modeOrMedian([...R]), n?.materialize && (a = { from: x, values: R });
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
|
1573
|
-
if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = r, this.baseValue = s,
|
|
1574
|
-
for (let f = 0; f <
|
|
1575
|
-
const
|
|
1576
|
-
if (
|
|
1573
|
+
if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = r, this.baseValue = s, a)
|
|
1574
|
+
for (let f = 0; f < a.values.length; f++) {
|
|
1575
|
+
const x = a.from + f;
|
|
1576
|
+
if (x >= this.size)
|
|
1577
1577
|
break;
|
|
1578
|
-
const v =
|
|
1579
|
-
v !== 0 && (this.deltas.set(
|
|
1578
|
+
const v = a.values[f] - this.baseValue;
|
|
1579
|
+
v !== 0 && (this.deltas.set(x, v), this._updateTree(x, v));
|
|
1580
1580
|
}
|
|
1581
1581
|
this.total = this.getTotal();
|
|
1582
1582
|
}
|
|
@@ -1621,22 +1621,22 @@ class Jt {
|
|
|
1621
1621
|
static _modeOrMedian(e) {
|
|
1622
1622
|
if (e.length === 0)
|
|
1623
1623
|
return 0;
|
|
1624
|
-
e.sort((
|
|
1624
|
+
e.sort((a, l) => a - l);
|
|
1625
1625
|
const r = Math.floor(e.length / 2);
|
|
1626
1626
|
let n;
|
|
1627
1627
|
e.length % 2 === 0 ? n = Math.floor((e[r - 1] + e[r]) / 2) : n = e[r];
|
|
1628
1628
|
const i = /* @__PURE__ */ new Map();
|
|
1629
1629
|
let s = 0;
|
|
1630
|
-
for (const
|
|
1631
|
-
const l = (i.get(
|
|
1632
|
-
i.set(
|
|
1630
|
+
for (const a of e) {
|
|
1631
|
+
const l = (i.get(a) ?? 0) + 1;
|
|
1632
|
+
i.set(a, l), l > s && (s = l);
|
|
1633
1633
|
}
|
|
1634
1634
|
if (s > e.length * 0.2) {
|
|
1635
|
-
const
|
|
1636
|
-
for (const [f,
|
|
1637
|
-
|
|
1638
|
-
const l =
|
|
1639
|
-
n = Math.floor(l /
|
|
1635
|
+
const a = [];
|
|
1636
|
+
for (const [f, x] of i.entries())
|
|
1637
|
+
x === s && a.push(f);
|
|
1638
|
+
const l = a.reduce((f, x) => f + x, 0);
|
|
1639
|
+
n = Math.floor(l / a.length);
|
|
1640
1640
|
}
|
|
1641
1641
|
return n;
|
|
1642
1642
|
}
|
|
@@ -1656,8 +1656,8 @@ class Jt {
|
|
|
1656
1656
|
let i = Math.max(1, Math.ceil(r / n));
|
|
1657
1657
|
i % 2 === 0 && (i += 1);
|
|
1658
1658
|
const s = [];
|
|
1659
|
-
for (let
|
|
1660
|
-
s.push(Dr(e(
|
|
1659
|
+
for (let a = 0; a < r && s.length < n; a += i)
|
|
1660
|
+
s.push(Dr(e(a), a));
|
|
1661
1661
|
return Jt._modeOrMedian(s);
|
|
1662
1662
|
}
|
|
1663
1663
|
/**
|
|
@@ -1705,14 +1705,14 @@ class Jt {
|
|
|
1705
1705
|
throw new Error(`Index must be an integer: ${n}`);
|
|
1706
1706
|
if (!Number.isFinite(i))
|
|
1707
1707
|
throw new Error(`Change must be a finite number: ${i}`);
|
|
1708
|
-
const
|
|
1709
|
-
if (
|
|
1710
|
-
throw new Error(`Change would make the value at index ${n} negative: ${
|
|
1711
|
-
r.set(n,
|
|
1708
|
+
const a = (r.get(n) ?? this.deltas.get(n) ?? 0) + i;
|
|
1709
|
+
if (a + this.baseValue < -1e-9)
|
|
1710
|
+
throw new Error(`Change would make the value at index ${n} negative: ${a + this.baseValue}`);
|
|
1711
|
+
r.set(n, a);
|
|
1712
1712
|
}
|
|
1713
1713
|
for (const { index: n, change: i } of e) {
|
|
1714
|
-
const
|
|
1715
|
-
|
|
1714
|
+
const a = (this.deltas.get(n) ?? 0) + i;
|
|
1715
|
+
a === 0 ? this.deltas.delete(n) : this.deltas.set(n, a), this._updateTree(n, i);
|
|
1716
1716
|
}
|
|
1717
1717
|
return this.total;
|
|
1718
1718
|
}
|
|
@@ -1756,8 +1756,8 @@ class Jt {
|
|
|
1756
1756
|
throw new Error(`Value must be a finite number: ${s}`);
|
|
1757
1757
|
if (s < 0)
|
|
1758
1758
|
throw new Error("Value cannot be negative.");
|
|
1759
|
-
const
|
|
1760
|
-
f !== 0 && r.push({ index: i, change: f }), n.set(i,
|
|
1759
|
+
const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, l = a + this.baseValue, f = s - l;
|
|
1760
|
+
f !== 0 && r.push({ index: i, change: f }), n.set(i, a + f);
|
|
1761
1761
|
}
|
|
1762
1762
|
return r;
|
|
1763
1763
|
}
|
|
@@ -1793,8 +1793,8 @@ class Jt {
|
|
|
1793
1793
|
if (this.valueFn) {
|
|
1794
1794
|
const n = this.deltas.get(e) ?? 0, s = Dr(this.valueFn(e), e) - this.baseValue;
|
|
1795
1795
|
if (s !== n && (s === 0 ? this.deltas.delete(e) : this.deltas.set(e, s), r)) {
|
|
1796
|
-
const
|
|
1797
|
-
this._updateTree(e,
|
|
1796
|
+
const a = s - n;
|
|
1797
|
+
this._updateTree(e, a);
|
|
1798
1798
|
}
|
|
1799
1799
|
}
|
|
1800
1800
|
}
|
|
@@ -1813,8 +1813,8 @@ class Jt {
|
|
|
1813
1813
|
const i = e.ranges;
|
|
1814
1814
|
if (i && i.length > 0) {
|
|
1815
1815
|
for (const l of i) {
|
|
1816
|
-
const f = Math.max(0, Math.trunc(l.from)),
|
|
1817
|
-
for (let v = f; v <=
|
|
1816
|
+
const f = Math.max(0, Math.trunc(l.from)), x = Math.min(Math.trunc(l.to), this.size - 1);
|
|
1817
|
+
for (let v = f; v <= x; v++)
|
|
1818
1818
|
this._materialize(v);
|
|
1819
1819
|
}
|
|
1820
1820
|
if (r === void 0)
|
|
@@ -1823,8 +1823,8 @@ class Jt {
|
|
|
1823
1823
|
this._materialize(r);
|
|
1824
1824
|
return;
|
|
1825
1825
|
}
|
|
1826
|
-
const s = i[0].from,
|
|
1827
|
-
r >= s && r <=
|
|
1826
|
+
const s = i[0].from, a = i[i.length - 1].to;
|
|
1827
|
+
r >= s && r <= a && this._materialize(r);
|
|
1828
1828
|
return;
|
|
1829
1829
|
}
|
|
1830
1830
|
r !== void 0 && this._materialize(r);
|
|
@@ -1856,13 +1856,13 @@ class Jt {
|
|
|
1856
1856
|
if (this._materialize(s), (this.deltas.get(s) ?? 0) === l)
|
|
1857
1857
|
break;
|
|
1858
1858
|
}
|
|
1859
|
-
const
|
|
1859
|
+
const a = this.prefixSum(s);
|
|
1860
1860
|
return {
|
|
1861
1861
|
index: s,
|
|
1862
|
-
total: this.total ??
|
|
1863
|
-
cumulative:
|
|
1864
|
-
currentValue:
|
|
1865
|
-
safeIndex:
|
|
1862
|
+
total: this.total ?? a.total,
|
|
1863
|
+
cumulative: a.cumulative,
|
|
1864
|
+
currentValue: a.currentValue,
|
|
1865
|
+
safeIndex: a.safeIndex
|
|
1866
1866
|
};
|
|
1867
1867
|
}
|
|
1868
1868
|
/**
|
|
@@ -1879,10 +1879,10 @@ class Jt {
|
|
|
1879
1879
|
for (; s << 1 <= this.size; )
|
|
1880
1880
|
s <<= 1;
|
|
1881
1881
|
for (; s > 0; s >>= 1) {
|
|
1882
|
-
const
|
|
1883
|
-
if (
|
|
1884
|
-
const f = (this.tree.get(
|
|
1885
|
-
(r ? i + f < e : i + f <= e) && (n =
|
|
1882
|
+
const a = n + s;
|
|
1883
|
+
if (a <= this.size) {
|
|
1884
|
+
const f = (this.tree.get(a) ?? 0) + this.baseValue * s;
|
|
1885
|
+
(r ? i + f < e : i + f <= e) && (n = a, i += f);
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
1888
1888
|
return r ? n : n - 1;
|
|
@@ -1901,25 +1901,25 @@ class Jt {
|
|
|
1901
1901
|
this._materializeRanges(r.materializeOption);
|
|
1902
1902
|
const s = r.materializeOption?.materialize === !0;
|
|
1903
1903
|
for (; ; ) {
|
|
1904
|
-
let
|
|
1905
|
-
for (;
|
|
1906
|
-
const S =
|
|
1904
|
+
let a = 0n, l = i - 1n, f, x, v = this.total;
|
|
1905
|
+
for (; a <= l; ) {
|
|
1906
|
+
const S = a + l >> 1n, N = Number(S), ee = this.prefixSum(N);
|
|
1907
1907
|
if (v = ee.total, n ? ee.cumulative >= e : ee.cumulative <= e)
|
|
1908
|
-
if (f = S,
|
|
1908
|
+
if (f = S, x = ee, n) {
|
|
1909
1909
|
if (S === 0n)
|
|
1910
1910
|
break;
|
|
1911
1911
|
l = S - 1n;
|
|
1912
1912
|
} else
|
|
1913
|
-
|
|
1913
|
+
a = S + 1n;
|
|
1914
1914
|
else if (n)
|
|
1915
|
-
|
|
1915
|
+
a = S + 1n;
|
|
1916
1916
|
else {
|
|
1917
1917
|
if (S === 0n)
|
|
1918
1918
|
break;
|
|
1919
1919
|
l = S - 1n;
|
|
1920
1920
|
}
|
|
1921
1921
|
}
|
|
1922
|
-
const R =
|
|
1922
|
+
const R = x, T = f !== void 0 ? Number(f) : -1;
|
|
1923
1923
|
if (s && T >= 0) {
|
|
1924
1924
|
const S = this.deltas.get(T) ?? 0;
|
|
1925
1925
|
if (this._materialize(T), (this.deltas.get(T) ?? 0) !== S)
|
|
@@ -1949,14 +1949,14 @@ class Jt {
|
|
|
1949
1949
|
return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
|
|
1950
1950
|
const n = oe(Math.trunc(e), 0, this.size - 1), i = r?.materializeOption;
|
|
1951
1951
|
this._materializeRanges(i, n, !0);
|
|
1952
|
-
let s = 0,
|
|
1953
|
-
for (;
|
|
1954
|
-
const f = this.tree.get(
|
|
1952
|
+
let s = 0, a = n + 1;
|
|
1953
|
+
for (; a > 0; ) {
|
|
1954
|
+
const f = this.tree.get(a) ?? 0;
|
|
1955
1955
|
s += f;
|
|
1956
|
-
const
|
|
1957
|
-
if (
|
|
1956
|
+
const x = ur(a);
|
|
1957
|
+
if (x === 0)
|
|
1958
1958
|
break;
|
|
1959
|
-
|
|
1959
|
+
a -= x;
|
|
1960
1960
|
}
|
|
1961
1961
|
const l = i?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
|
|
1962
1962
|
return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue: l, safeIndex: n };
|
|
@@ -2016,10 +2016,10 @@ class Jt {
|
|
|
2016
2016
|
let s = n + 1;
|
|
2017
2017
|
for (; s <= this.size; ) {
|
|
2018
2018
|
r.set(s, (r.get(s) ?? 0) + i);
|
|
2019
|
-
const
|
|
2020
|
-
if (
|
|
2019
|
+
const a = ur(s);
|
|
2020
|
+
if (a === 0)
|
|
2021
2021
|
break;
|
|
2022
|
-
s +=
|
|
2022
|
+
s += a;
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
2025
|
this.tree = r, this.total = this._computeTreeTotal();
|
|
@@ -2133,17 +2133,17 @@ class Jt {
|
|
|
2133
2133
|
_propagateDeltaToGrownNodes(e, r, n, i) {
|
|
2134
2134
|
let s = e + 1;
|
|
2135
2135
|
for (; s <= n; ) {
|
|
2136
|
-
const
|
|
2137
|
-
if (
|
|
2136
|
+
const a = ur(s);
|
|
2137
|
+
if (a === 0)
|
|
2138
2138
|
break;
|
|
2139
|
-
s +=
|
|
2139
|
+
s += a;
|
|
2140
2140
|
}
|
|
2141
2141
|
for (; s <= i; ) {
|
|
2142
2142
|
this.tree.set(s, (this.tree.get(s) ?? 0) + r);
|
|
2143
|
-
const
|
|
2144
|
-
if (
|
|
2143
|
+
const a = ur(s);
|
|
2144
|
+
if (a === 0)
|
|
2145
2145
|
break;
|
|
2146
|
-
s +=
|
|
2146
|
+
s += a;
|
|
2147
2147
|
}
|
|
2148
2148
|
}
|
|
2149
2149
|
/**
|
|
@@ -2159,12 +2159,12 @@ class Jt {
|
|
|
2159
2159
|
const n = Jt._minCoveredLowBound(e, r);
|
|
2160
2160
|
if (e - n < this.deltas.size)
|
|
2161
2161
|
for (let s = n; s < e; s++) {
|
|
2162
|
-
const
|
|
2163
|
-
|
|
2162
|
+
const a = this.deltas.get(s);
|
|
2163
|
+
a === void 0 || a === 0 || this._propagateDeltaToGrownNodes(s, a, e, r);
|
|
2164
2164
|
}
|
|
2165
2165
|
else
|
|
2166
|
-
for (const [s,
|
|
2167
|
-
|
|
2166
|
+
for (const [s, a] of this.deltas.entries())
|
|
2167
|
+
a === 0 || s < n || this._propagateDeltaToGrownNodes(s, a, e, r);
|
|
2168
2168
|
}
|
|
2169
2169
|
this.total = this._computeTreeTotal();
|
|
2170
2170
|
}
|
|
@@ -2240,12 +2240,12 @@ const ei = (t, e) => {
|
|
|
2240
2240
|
}, vn = (t, e, r) => {
|
|
2241
2241
|
const n = Number.isFinite(t) && t > 0 ? Math.trunc(t) : 0, i = d(null), s = d({ size: n, valueOrFn: e, options: r });
|
|
2242
2242
|
i.current === null && (i.current = new Jt(n, e, r));
|
|
2243
|
-
const
|
|
2244
|
-
if (
|
|
2243
|
+
const a = i.current, l = s.current, f = l.size !== n, x = l.valueOrFn !== e, v = ei(l.options, r) || l.options?.baseValue !== r?.baseValue, R = l.size === 0 && n > 0 && (!i.current || i.current.base === 0);
|
|
2244
|
+
if (x || v) {
|
|
2245
2245
|
const T = r?.resetOnValueFnChange ?? !0;
|
|
2246
|
-
v ||
|
|
2247
|
-
} else f && (r?.debug && V.debug("[useFenwickMapTree] resize", { from: l.size, to: n }), R ?
|
|
2248
|
-
return
|
|
2246
|
+
v || x && T || R ? (r?.debug && V.debug("[useFenwickMapTree] reset", { valueOrFnChanged: x, optionsChanged: v }), a.reset(n, e, r)) : (f && (r?.debug && V.debug("[useFenwickMapTree] resize (with valueFn change)", { from: l.size, to: n }), a.changeSize(n)), r?.debug && V.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: x }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: r };
|
|
2247
|
+
} else f && (r?.debug && V.debug("[useFenwickMapTree] resize", { from: l.size, to: n }), R ? a.reset(n, e, r) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: r });
|
|
2248
|
+
return a;
|
|
2249
2249
|
};
|
|
2250
2250
|
class ti {
|
|
2251
2251
|
key;
|
|
@@ -2317,7 +2317,7 @@ function ri(t) {
|
|
|
2317
2317
|
const R = e.current.get(v);
|
|
2318
2318
|
if (R)
|
|
2319
2319
|
return r.current.moveToTail(R), R.value;
|
|
2320
|
-
}, []),
|
|
2320
|
+
}, []), a = w((v, R) => {
|
|
2321
2321
|
const T = i.current;
|
|
2322
2322
|
if (Number.isNaN(T) || T <= 0)
|
|
2323
2323
|
return;
|
|
@@ -2334,14 +2334,14 @@ function ri(t) {
|
|
|
2334
2334
|
}, []), l = w((v) => e.current.has(v), []), f = w((v) => {
|
|
2335
2335
|
const R = e.current.get(v);
|
|
2336
2336
|
R && (r.current.remove(R), e.current.delete(v));
|
|
2337
|
-
}, []),
|
|
2337
|
+
}, []), x = w(() => {
|
|
2338
2338
|
e.current.clear(), r.current = new Lr();
|
|
2339
2339
|
}, []);
|
|
2340
|
-
return
|
|
2340
|
+
return Me(() => ({ get: s, set: a, has: l, remove: f, clear: x }), [s, a, l, f, x]);
|
|
2341
2341
|
}
|
|
2342
2342
|
const ni = 1e4, yi = () => {
|
|
2343
2343
|
const { get: t, set: e, has: r, clear: n } = ri(ni);
|
|
2344
|
-
return
|
|
2344
|
+
return Me(() => ({ get: t, set: e, has: r, clear: n }), [t, e, r, n]);
|
|
2345
2345
|
}, Ti = (t, e) => {
|
|
2346
2346
|
const r = d(e), n = d(t);
|
|
2347
2347
|
Qe(() => {
|
|
@@ -2351,18 +2351,18 @@ const ni = 1e4, yi = () => {
|
|
|
2351
2351
|
return w((s) => {
|
|
2352
2352
|
if (!s || i.current.has(s))
|
|
2353
2353
|
return;
|
|
2354
|
-
const
|
|
2354
|
+
const a = (l) => {
|
|
2355
2355
|
r.current?.enableBridge !== !1 && n.current.current?.applyWheel(l);
|
|
2356
2356
|
};
|
|
2357
|
-
return s.addEventListener("wheel",
|
|
2358
|
-
i.current.get(s) ===
|
|
2357
|
+
return s.addEventListener("wheel", a, { passive: !1 }), i.current.set(s, a), () => {
|
|
2358
|
+
i.current.get(s) === a && (s.removeEventListener("wheel", a), i.current.delete(s));
|
|
2359
2359
|
};
|
|
2360
2360
|
}, []);
|
|
2361
2361
|
}, sn = -200, on = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, ii = (t) => {
|
|
2362
2362
|
const e = d(t);
|
|
2363
2363
|
e.current = t;
|
|
2364
|
-
const r = d(on), n = d(null), [i, s] = Oe(!1),
|
|
2365
|
-
|
|
2364
|
+
const r = d(on), n = d(null), [i, s] = Oe(!1), a = d(null), l = d(null), f = d({ residual: 0, direction: 0 }), x = d({ residual: 0, direction: 0 }), v = w(() => {
|
|
2365
|
+
a.current !== null && (window.cancelAnimationFrame(a.current), a.current = null), l.current = null, f.current = { residual: 0, direction: 0 }, x.current = { residual: 0, direction: 0 };
|
|
2366
2366
|
}, []), R = w((A, $, ie, L, z, C) => {
|
|
2367
2367
|
const K = $ > 0 ? 1 : $ < 0 ? -1 : 0;
|
|
2368
2368
|
K !== 0 && K !== A.direction && (A.direction = K, A.residual = 0), A.residual += $ * ie;
|
|
@@ -2373,7 +2373,7 @@ const ni = 1e4, yi = () => {
|
|
|
2373
2373
|
return { actualDelta: 0, atBoundary: !1 };
|
|
2374
2374
|
const ae = L(), ce = C(Y), k = ce - ae;
|
|
2375
2375
|
A.residual -= k;
|
|
2376
|
-
const
|
|
2376
|
+
const Te = Y < 0 && ae + Y <= 0, I = Y > 0 && ae + Y >= B, le = Y < 0 && (ce <= 0 || Te && k === 0) || Y > 0 && (ce >= B || I && k === 0);
|
|
2377
2377
|
return le && (A.residual = 0), { actualDelta: k, atBoundary: le };
|
|
2378
2378
|
}, []), T = w(
|
|
2379
2379
|
(A) => {
|
|
@@ -2384,21 +2384,21 @@ const ni = 1e4, yi = () => {
|
|
|
2384
2384
|
}
|
|
2385
2385
|
const L = l.current ?? A, z = Math.max((A - L) / 1e3, 0), C = Math.min(z, gn);
|
|
2386
2386
|
if (l.current = A, C <= 0) {
|
|
2387
|
-
|
|
2387
|
+
a.current = window.requestAnimationFrame(T);
|
|
2388
2388
|
return;
|
|
2389
2389
|
}
|
|
2390
2390
|
const K = Bn({ offsetX: ie.offsetX, offsetY: ie.offsetY, maxDistance: $.maxDistance, x: $.xSpeedParams, y: $.ySpeedParams }), B = R(f.current, K.x, C, $.getHx, $.getMaxHx, (k) => $.applyHxRef.current($.getHx() + k));
|
|
2391
2391
|
B.actualDelta !== 0 && ($.pendingColAnchorRef.current = null);
|
|
2392
|
-
const Y = R(
|
|
2392
|
+
const Y = R(x.current, K.y, C, $.getVy, $.getMaxVy, $.applyVy), ae = $.getMaxHx() <= 0 || B.atBoundary || ie.offsetX === 0, ce = $.getMaxVy() <= 0 || Y.atBoundary || ie.offsetY === 0;
|
|
2393
2393
|
if (ae && ce) {
|
|
2394
2394
|
v();
|
|
2395
2395
|
return;
|
|
2396
2396
|
}
|
|
2397
|
-
|
|
2397
|
+
a.current = window.requestAnimationFrame(T);
|
|
2398
2398
|
},
|
|
2399
2399
|
[v, R]
|
|
2400
2400
|
), S = w(() => {
|
|
2401
|
-
|
|
2401
|
+
a.current === null && (l.current = null, f.current = { residual: 0, direction: 0 }, x.current = { residual: 0, direction: 0 }, a.current = window.requestAnimationFrame(T));
|
|
2402
2402
|
}, [T]), N = w(() => {
|
|
2403
2403
|
r.current = { ...on }, s(!1), n.current?.reset(), v();
|
|
2404
2404
|
}, [v]), ee = w(
|
|
@@ -2406,11 +2406,11 @@ const ni = 1e4, yi = () => {
|
|
|
2406
2406
|
r.current = A, s(A.active), A.active && A.direction !== 0 ? S() : v();
|
|
2407
2407
|
},
|
|
2408
2408
|
[S, v]
|
|
2409
|
-
), { enabled: F, xExtentFreshness:
|
|
2409
|
+
), { enabled: F, xExtentFreshness: Ie, yExtentFreshness: ye } = t;
|
|
2410
2410
|
return q(() => {
|
|
2411
2411
|
const A = r.current;
|
|
2412
2412
|
!A.active || A.direction === 0 || S();
|
|
2413
|
-
}, [
|
|
2413
|
+
}, [Ie, ye, S]), q(() => {
|
|
2414
2414
|
const A = () => {
|
|
2415
2415
|
N();
|
|
2416
2416
|
};
|
|
@@ -2445,13 +2445,13 @@ const ni = 1e4, yi = () => {
|
|
|
2445
2445
|
if (!Number.isFinite(t)) return 0n;
|
|
2446
2446
|
const e = Math.trunc(t);
|
|
2447
2447
|
return e <= 0 ? 0n : BigInt(e);
|
|
2448
|
-
}, oi = (t, e, r, n, i, s,
|
|
2448
|
+
}, oi = (t, e, r, n, i, s, a, l) => {
|
|
2449
2449
|
const f = hr(n);
|
|
2450
2450
|
if (f === 0n)
|
|
2451
2451
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2452
|
-
const
|
|
2452
|
+
const x = (L) => L < 0n ? 0n : L >= f ? f - 1n : L, v = { materializeOption: { materialize: !1 } }, { index: R, cumulative: T } = s.findIndexAtOrAfter(t, v);
|
|
2453
2453
|
let S;
|
|
2454
|
-
R === -1 ? S = f - 1n : (T === t ? S = hr(R + 1) : S = hr(R), S >= f && (S = f - 1n)), t <= 0 && (S = 0n), l && t >=
|
|
2454
|
+
R === -1 ? S = f - 1n : (T === t ? S = hr(R + 1) : S = hr(R), S >= f && (S = f - 1n)), t <= 0 && (S = 0n), l && t >= a && (S = f - 1n);
|
|
2455
2455
|
const N = (L) => {
|
|
2456
2456
|
const z = Number(L);
|
|
2457
2457
|
if (!Number.isSafeInteger(z))
|
|
@@ -2485,7 +2485,7 @@ const ni = 1e4, yi = () => {
|
|
|
2485
2485
|
}
|
|
2486
2486
|
return B === 0n && (K = L), { height: z, end: K };
|
|
2487
2487
|
};
|
|
2488
|
-
let { height: F, end:
|
|
2488
|
+
let { height: F, end: Ie } = ee(S);
|
|
2489
2489
|
if (F < e && S > 0n) {
|
|
2490
2490
|
let L = S, z = F, C = 0;
|
|
2491
2491
|
for (; L > 0n && z < e; ) {
|
|
@@ -2501,10 +2501,10 @@ const ni = 1e4, yi = () => {
|
|
|
2501
2501
|
const { cumulative: ce } = s.prefixSum(ae, { materializeOption: { materialize: !1 } });
|
|
2502
2502
|
if (!Number.isFinite(ce))
|
|
2503
2503
|
break;
|
|
2504
|
-
const { index: k } = s.findIndexAtOrAfter(ce - 0.5, { materializeOption: { materialize: !1 } }),
|
|
2505
|
-
if (
|
|
2506
|
-
L =
|
|
2507
|
-
else if (
|
|
2504
|
+
const { index: k } = s.findIndexAtOrAfter(ce - 0.5, { materializeOption: { materialize: !1 } }), Te = k === -1 ? -1n : hr(k);
|
|
2505
|
+
if (Te >= 0n && Te < L)
|
|
2506
|
+
L = Te + 1n, C = 0;
|
|
2507
|
+
else if (Te === L && L >= 1n && i(Number(L - 1n)) > 0)
|
|
2508
2508
|
C = 0;
|
|
2509
2509
|
else
|
|
2510
2510
|
break;
|
|
@@ -2512,28 +2512,28 @@ const ni = 1e4, yi = () => {
|
|
|
2512
2512
|
} else
|
|
2513
2513
|
C = 0;
|
|
2514
2514
|
}
|
|
2515
|
-
S =
|
|
2515
|
+
S = x(L);
|
|
2516
2516
|
const K = ee(S);
|
|
2517
|
-
F = K.height,
|
|
2517
|
+
F = K.height, Ie = K.end;
|
|
2518
2518
|
}
|
|
2519
|
-
const
|
|
2519
|
+
const ye = x(S), A = x(Ie), $ = x(ye - BigInt(Math.max(0, r))), ie = x(A + BigInt(Math.max(0, r)));
|
|
2520
2520
|
return {
|
|
2521
2521
|
renderingStartIndex: Ze(Number($), n),
|
|
2522
2522
|
renderingEndIndex: Ze(Number(ie), n),
|
|
2523
|
-
visibleStartIndex: Ze(Number(
|
|
2523
|
+
visibleStartIndex: Ze(Number(ye), n),
|
|
2524
2524
|
visibleEndIndex: Ze(Number(A), n)
|
|
2525
2525
|
};
|
|
2526
|
-
}, Sn = (t, e, r, n, i, s,
|
|
2526
|
+
}, Sn = (t, e, r, n, i, s, a) => {
|
|
2527
2527
|
if (n === 0)
|
|
2528
2528
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2529
|
-
const l = Number.isFinite(
|
|
2529
|
+
const l = Number.isFinite(a), f = l ? Math.min(Math.max(0, t), a) : Math.max(0, t);
|
|
2530
2530
|
if (n >= Number.MAX_SAFE_INTEGER)
|
|
2531
|
-
return oi(f, e, r, n, i, s,
|
|
2532
|
-
const { index:
|
|
2531
|
+
return oi(f, e, r, n, i, s, a, l);
|
|
2532
|
+
const { index: x, cumulative: v, currentValue: R } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), T = x === -1 ? e <= 0 || (v ?? 0) < f + (R ?? 0) ? n - 1 : 0 : x;
|
|
2533
2533
|
let S = Ze(T, n), N = 0;
|
|
2534
|
-
if (
|
|
2535
|
-
S = Ze(
|
|
2536
|
-
else if (S ===
|
|
2534
|
+
if (x !== -1 && v === f)
|
|
2535
|
+
S = Ze(x + 1, n), N = 0;
|
|
2536
|
+
else if (S === x && v !== void 0 && R !== void 0)
|
|
2537
2537
|
N = v - R - f;
|
|
2538
2538
|
else {
|
|
2539
2539
|
const { cumulative: L, currentValue: z } = s.prefixSum(S, { materializeOption: { materialize: !1 } });
|
|
@@ -2559,9 +2559,9 @@ const ni = 1e4, yi = () => {
|
|
|
2559
2559
|
B = 0;
|
|
2560
2560
|
}
|
|
2561
2561
|
return { cursor: C, height: K };
|
|
2562
|
-
},
|
|
2563
|
-
let
|
|
2564
|
-
if (N =
|
|
2562
|
+
}, Ie = F(S, N);
|
|
2563
|
+
let ye = Ie.cursor;
|
|
2564
|
+
if (N = Ie.height, N < e && S > 0) {
|
|
2565
2565
|
let L = N + Math.abs(Math.min(0, ee)), z = S - 1, C = 0;
|
|
2566
2566
|
for (; z >= 0 && L < e; ) {
|
|
2567
2567
|
const B = i(z);
|
|
@@ -2589,9 +2589,9 @@ const ni = 1e4, yi = () => {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
S = Ze(z + 1, n);
|
|
2591
2591
|
const K = F(S, 0);
|
|
2592
|
-
|
|
2592
|
+
ye = K.cursor, N = K.height;
|
|
2593
2593
|
}
|
|
2594
|
-
const A = Ze(S - r, n), $ = Ze(Math.max(
|
|
2594
|
+
const A = Ze(S - r, n), $ = Ze(Math.max(ye - 1, S), n), ie = Ze($ + r, n);
|
|
2595
2595
|
return { renderingStartIndex: A, renderingEndIndex: ie, visibleStartIndex: S, visibleEndIndex: $ };
|
|
2596
2596
|
}, cn = (t, e, r) => {
|
|
2597
2597
|
const n = Math.max(0, e ?? 0), i = d({ last: 0, id: null, arg: null }).current;
|
|
@@ -2610,26 +2610,26 @@ const ni = 1e4, yi = () => {
|
|
|
2610
2610
|
), w(
|
|
2611
2611
|
(s) => {
|
|
2612
2612
|
if (i.arg = s, i.id !== null) return;
|
|
2613
|
-
const
|
|
2613
|
+
const a = (l) => {
|
|
2614
2614
|
if (i.id = null, i.arg === null) return;
|
|
2615
2615
|
const f = l - i.last;
|
|
2616
2616
|
if (n === 0 || i.last === 0 || f >= n) {
|
|
2617
2617
|
if (t.current)
|
|
2618
2618
|
try {
|
|
2619
2619
|
r(t.current, i.arg);
|
|
2620
|
-
} catch (
|
|
2621
|
-
console.error("[useThrottledInvoker] Error invoking callback",
|
|
2620
|
+
} catch (x) {
|
|
2621
|
+
console.error("[useThrottledInvoker] Error invoking callback", x);
|
|
2622
2622
|
}
|
|
2623
2623
|
i.arg = null, i.last = l;
|
|
2624
2624
|
}
|
|
2625
|
-
i.arg !== null && (i.id = requestAnimationFrame(
|
|
2625
|
+
i.arg !== null && (i.id = requestAnimationFrame(a));
|
|
2626
2626
|
};
|
|
2627
|
-
i.id = requestAnimationFrame(
|
|
2627
|
+
i.id = requestAnimationFrame(a);
|
|
2628
2628
|
},
|
|
2629
2629
|
[n, r, t, i]
|
|
2630
2630
|
);
|
|
2631
|
-
}, ai = zn.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation:
|
|
2632
|
-
const R = w((F) => v(t, F), [t, v]), T = w((F) => l(F, t), [t, l]), S = w((F) => f?.(F, t), [t, f]), N = w(() =>
|
|
2631
|
+
}, ai = zn.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: l, onEscapeKeyDown: f, onFocus: x, registerItemRef: v }) => {
|
|
2632
|
+
const R = w((F) => v(t, F), [t, v]), T = w((F) => l(F, t), [t, l]), S = w((F) => f?.(F, t), [t, f]), N = w(() => x(t), [t, x]), ee = w((F) => {
|
|
2633
2633
|
F.currentTarget.focus({ preventScroll: !0 });
|
|
2634
2634
|
}, []);
|
|
2635
2635
|
return (
|
|
@@ -2649,11 +2649,11 @@ const ni = 1e4, yi = () => {
|
|
|
2649
2649
|
height: r,
|
|
2650
2650
|
overflow: s ? "hidden" : void 0
|
|
2651
2651
|
},
|
|
2652
|
-
tabIndex:
|
|
2653
|
-
onPointerDown:
|
|
2654
|
-
onKeyDownCapture:
|
|
2655
|
-
onKeyDown:
|
|
2656
|
-
onFocusCapture:
|
|
2652
|
+
tabIndex: a ? -1 : void 0,
|
|
2653
|
+
onPointerDown: a ? ee : void 0,
|
|
2654
|
+
onKeyDownCapture: a ? T : void 0,
|
|
2655
|
+
onKeyDown: a && f ? S : void 0,
|
|
2656
|
+
onFocusCapture: a ? N : void 0,
|
|
2657
2657
|
children: i(n, t)
|
|
2658
2658
|
}
|
|
2659
2659
|
)
|
|
@@ -2665,10 +2665,10 @@ const ni = 1e4, yi = () => {
|
|
|
2665
2665
|
getItemHeight: n,
|
|
2666
2666
|
viewportSize: i,
|
|
2667
2667
|
overscanCount: s = 15,
|
|
2668
|
-
className:
|
|
2668
|
+
className: a,
|
|
2669
2669
|
testId: l,
|
|
2670
2670
|
onScroll: f,
|
|
2671
|
-
onRangeChange:
|
|
2671
|
+
onRangeChange: x,
|
|
2672
2672
|
children: v,
|
|
2673
2673
|
background: R,
|
|
2674
2674
|
initialScrollIndex: T,
|
|
@@ -2676,8 +2676,8 @@ const ni = 1e4, yi = () => {
|
|
|
2676
2676
|
initialScrollAnchor: N,
|
|
2677
2677
|
callbackThrottleMs: ee = 5,
|
|
2678
2678
|
contentInsets: F,
|
|
2679
|
-
onItemFocus:
|
|
2680
|
-
scrollBarOptions:
|
|
2679
|
+
onItemFocus: Ie,
|
|
2680
|
+
scrollBarOptions: ye,
|
|
2681
2681
|
behaviorOptions: A,
|
|
2682
2682
|
onWheelHorizontal: $,
|
|
2683
2683
|
onPanHorizontal: ie,
|
|
@@ -2686,8 +2686,8 @@ const ni = 1e4, yi = () => {
|
|
|
2686
2686
|
contentProps: C,
|
|
2687
2687
|
liveRegion: K
|
|
2688
2688
|
}, B) => {
|
|
2689
|
-
const { width: Y, enableThumbDrag: ae, enableTrackClick: ce, enableArrowButtons: k, enableScrollToTopBottomButtons:
|
|
2690
|
-
be((
|
|
2689
|
+
const { width: Y, enableThumbDrag: ae, enableTrackClick: ce, enableArrowButtons: k, enableScrollToTopBottomButtons: Te, renderThumbOverlay: I, tapScrollCircleOptions: le } = ye ?? {}, { enablePointerDrag: ue, pointerDragInputs: Ye, enableKeyboardNavigation: _ = !0, enableEscapeRowReturn: Xe = !1, wheelSpeedMultiplier: ut, inertiaOptions: nt, overscrollBehavior: Ge, clipItemHeight: at = !1, resetOnGetItemHeightChange: Pe = !1 } = A ?? {}, [qe, be] = Oe(0), fe = i ?? qe, Ve = w((c) => {
|
|
2690
|
+
be((b) => b === c ? b : c);
|
|
2691
2691
|
}, []), j = d(null), Je = d({
|
|
2692
2692
|
renderingStartIndex: 0,
|
|
2693
2693
|
renderingEndIndex: 0,
|
|
@@ -2703,10 +2703,10 @@ const ni = 1e4, yi = () => {
|
|
|
2703
2703
|
}
|
|
2704
2704
|
Pe && (re.current = null);
|
|
2705
2705
|
}, [Pe, n]);
|
|
2706
|
-
const D =
|
|
2707
|
-
const
|
|
2706
|
+
const D = Me(() => an(F), [F]), [Z] = Oe(() => {
|
|
2707
|
+
const b = N?.index ?? T, m = typeof b == "number" && Number.isFinite(b) ? Math.max(0, Math.trunc(b)) : 0;
|
|
2708
2708
|
return { from: Math.max(0, m - 50), to: m + 50 };
|
|
2709
|
-
}), We =
|
|
2709
|
+
}), We = Me(
|
|
2710
2710
|
// 目的: Fenwick Tree のオプション設定
|
|
2711
2711
|
// 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
|
|
2712
2712
|
// itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
|
|
@@ -2718,23 +2718,23 @@ const ni = 1e4, yi = () => {
|
|
|
2718
2718
|
}),
|
|
2719
2719
|
[Pe, Z]
|
|
2720
2720
|
), y = vn(t, n, We), [vt] = Oe(() => {
|
|
2721
|
-
let c = 0,
|
|
2721
|
+
let c = 0, b = 0;
|
|
2722
2722
|
if (N && t > 0) {
|
|
2723
|
-
const m = oe(Math.trunc(N.index), 0, t - 1), W = Math.max(0, N.offsetPx ?? 0), U = oe(m - s * 2, 0, t - 1), G = oe(m + s * 2, 0, t - 1), J = m > 0 || W > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: U, to: G }] } } : void 0, { cumulative:
|
|
2724
|
-
c = ir(ze, D.top),
|
|
2723
|
+
const m = oe(Math.trunc(N.index), 0, t - 1), W = Math.max(0, N.offsetPx ?? 0), U = oe(m - s * 2, 0, t - 1), G = oe(m + s * 2, 0, t - 1), J = m > 0 || W > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: U, to: G }] } } : void 0, { cumulative: Se, total: Ue, currentValue: Le } = y.prefixSum(m, J), ze = Math.max(Se - Le + W, 0);
|
|
2724
|
+
c = ir(ze, D.top), b = Ue ?? y.getTotal();
|
|
2725
2725
|
} else if (typeof T == "number") {
|
|
2726
|
-
const m = oe(T, 0, t - 1), W = oe(m - s * 2, 0, t - 1), U = oe(m + s * 2, 0, t - 1), G = T > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: W, to: U }] } } : void 0, { cumulative: J, total:
|
|
2727
|
-
c = ir(Le, D.top),
|
|
2728
|
-
} else typeof S == "number" && (c = ir(Math.max(S, 0), D.top)),
|
|
2729
|
-
return { position: c, total:
|
|
2730
|
-
}), [et, xt] = Oe(vt.position), [ct, Tt] = Oe(vt.total), h = d(vt.position), H = d(D.top), se = d(f ?? void 0), ne = d(
|
|
2726
|
+
const m = oe(T, 0, t - 1), W = oe(m - s * 2, 0, t - 1), U = oe(m + s * 2, 0, t - 1), G = T > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: W, to: U }] } } : void 0, { cumulative: J, total: Se, currentValue: Ue } = y.prefixSum(T, G), Le = Math.max(J - Ue, 0);
|
|
2727
|
+
c = ir(Le, D.top), b = Se ?? y.getTotal();
|
|
2728
|
+
} else typeof S == "number" && (c = ir(Math.max(S, 0), D.top)), b = y.getTotal();
|
|
2729
|
+
return { position: c, total: b };
|
|
2730
|
+
}), [et, xt] = Oe(vt.position), [ct, Tt] = Oe(vt.total), h = d(vt.position), H = d(D.top), se = d(f ?? void 0), ne = d(x ?? void 0), he = d($), xe = (L?.length ?? 0) > 0, ve = !!$;
|
|
2731
2731
|
q(() => {
|
|
2732
2732
|
xe && (_ || V.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), ve || V.warn("[VirtualScroll] horizontalKeyInputs is set but onWheelHorizontal is missing; horizontal keyboard scrolling is disabled because the package does not own the horizontal axis."), Number.isFinite(z) && z > 0 || V.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${z}. Horizontal arrow keys are left untouched.`));
|
|
2733
2733
|
}, [xe, ve, _, z]);
|
|
2734
|
-
const
|
|
2734
|
+
const Re = d(/* @__PURE__ */ new Map()), _e = d(null), me = d(null), [dt, ft] = Oe(null), [Ee, Be] = Oe(!1), tt = d(null), it = d(!1), pe = d(0), we = d(!1), wt = d(!1), p = d(t);
|
|
2735
2735
|
p.current !== t && (p.current = t, wt.current = !0), Qe(() => {
|
|
2736
|
-
se.current = f ?? void 0, ne.current =
|
|
2737
|
-
}, [
|
|
2736
|
+
se.current = f ?? void 0, ne.current = x ?? void 0, he.current = $;
|
|
2737
|
+
}, [x, f, $]);
|
|
2738
2738
|
const P = w(
|
|
2739
2739
|
(c) => {
|
|
2740
2740
|
if (_ && c && typeof c.focus == "function")
|
|
@@ -2745,25 +2745,25 @@ const ni = 1e4, yi = () => {
|
|
|
2745
2745
|
}
|
|
2746
2746
|
},
|
|
2747
2747
|
[_]
|
|
2748
|
-
), Ae = w((c, { position:
|
|
2749
|
-
c(
|
|
2750
|
-
}, []), lt = cn(se, ee, Ae), $e = w((c,
|
|
2751
|
-
c(
|
|
2748
|
+
), Ae = w((c, { position: b, totalHeight: m }) => {
|
|
2749
|
+
c(b, m);
|
|
2750
|
+
}, []), lt = cn(se, ee, Ae), $e = w((c, b) => {
|
|
2751
|
+
c(b);
|
|
2752
2752
|
}, []), Rt = cn(ne, ee, $e), Fe = d(D.top);
|
|
2753
2753
|
Fe.current = D.top;
|
|
2754
2754
|
const ht = d(lt);
|
|
2755
2755
|
ht.current = lt, q(() => (Ke.current = !1, () => {
|
|
2756
2756
|
Ke.current = !0, tt.current && (clearTimeout(tt.current), tt.current = null);
|
|
2757
2757
|
}), []), q(() => {
|
|
2758
|
-
_ || (
|
|
2758
|
+
_ || (Re.current.clear(), _e.current = null, me.current = null);
|
|
2759
2759
|
}, [_]);
|
|
2760
2760
|
const ke = w(
|
|
2761
|
-
(c,
|
|
2762
|
-
if (!
|
|
2763
|
-
|
|
2761
|
+
(c, b) => {
|
|
2762
|
+
if (!b) {
|
|
2763
|
+
Re.current.delete(c);
|
|
2764
2764
|
return;
|
|
2765
2765
|
}
|
|
2766
|
-
_ && (
|
|
2766
|
+
_ && (Re.current.set(c, b), _e.current === c && (_e.current = null, me.current = c, P(b)));
|
|
2767
2767
|
},
|
|
2768
2768
|
[_, P]
|
|
2769
2769
|
), Bt = 0.01, Ut = d({
|
|
@@ -2785,8 +2785,8 @@ const ni = 1e4, yi = () => {
|
|
|
2785
2785
|
}), zt = w(() => {
|
|
2786
2786
|
const c = Ut.current;
|
|
2787
2787
|
c.rafId = null;
|
|
2788
|
-
const
|
|
2789
|
-
if (xt((G) => Math.abs(G -
|
|
2788
|
+
const b = h.current, m = yt(b, Fe.current), W = y.getTotal();
|
|
2789
|
+
if (xt((G) => Math.abs(G - b) < Bt ? G : b), Math.abs(c.lastRenderedPosition - b) >= Bt ? (ht.current({ position: m, totalHeight: W }), c.lastRenderedPosition = b, c.idleFrames = 0) : c.idleFrames += 1, c.idleFrames >= 2) {
|
|
2790
2790
|
Vt();
|
|
2791
2791
|
return;
|
|
2792
2792
|
}
|
|
@@ -2807,8 +2807,8 @@ const ni = 1e4, yi = () => {
|
|
|
2807
2807
|
c.loopActive = !1;
|
|
2808
2808
|
}
|
|
2809
2809
|
}, [zt]), De = w(
|
|
2810
|
-
(c,
|
|
2811
|
-
const m =
|
|
2810
|
+
(c, b) => {
|
|
2811
|
+
const m = b?.immediate ?? !1, W = yt(c, D.top);
|
|
2812
2812
|
if (h.current = c, m) {
|
|
2813
2813
|
Ut.current.lastRenderedPosition = c, Ut.current.idleFrames = 0, xt(c), lt({ position: W, totalHeight: y.getTotal() });
|
|
2814
2814
|
return;
|
|
@@ -2816,20 +2816,20 @@ const ni = 1e4, yi = () => {
|
|
|
2816
2816
|
tr();
|
|
2817
2817
|
},
|
|
2818
2818
|
[tr, y, D.top, lt]
|
|
2819
|
-
), Pt = w((c,
|
|
2819
|
+
), Pt = w((c, b = 0) => {
|
|
2820
2820
|
const m = j.current;
|
|
2821
2821
|
if (!m)
|
|
2822
2822
|
return c;
|
|
2823
2823
|
const W = m.getScrollPosition();
|
|
2824
2824
|
pe.current += 1;
|
|
2825
|
-
const U = m.getContentSize() +
|
|
2826
|
-
return J === W && (pe.current = Math.max(0, pe.current - 1)), Math.abs(J - c) > 0.5 && (
|
|
2825
|
+
const U = m.getContentSize() + b, G = m.getViewportSize(), J = m.scrollTo(c, { contentSize: U, viewportSize: G });
|
|
2826
|
+
return J === W && (pe.current = Math.max(0, pe.current - 1)), Math.abs(J - c) > 0.5 && (we.current = !0), J;
|
|
2827
2827
|
}, []), At = d(!1);
|
|
2828
2828
|
q(() => {
|
|
2829
2829
|
if (!At.current)
|
|
2830
2830
|
if (At.current = !0, N == null && typeof T != "number" && typeof S == "number") {
|
|
2831
|
-
const c = ir(Math.max(S, 0), D.top),
|
|
2832
|
-
De(c, { immediate: !0 }),
|
|
2831
|
+
const c = ir(Math.max(S, 0), D.top), b = Math.abs(c - h.current) > 0.5;
|
|
2832
|
+
De(c, { immediate: !0 }), b && j.current?.scrollTo(c);
|
|
2833
2833
|
} else
|
|
2834
2834
|
De(h.current, { immediate: !0 });
|
|
2835
2835
|
}, [N, T, S, D.top, De]), q(() => {
|
|
@@ -2838,22 +2838,22 @@ const ni = 1e4, yi = () => {
|
|
|
2838
2838
|
Tt(c);
|
|
2839
2839
|
return;
|
|
2840
2840
|
}
|
|
2841
|
-
if (
|
|
2842
|
-
|
|
2843
|
-
const
|
|
2844
|
-
if (
|
|
2841
|
+
if (we.current) {
|
|
2842
|
+
we.current = !1;
|
|
2843
|
+
const b = j.current;
|
|
2844
|
+
if (b && Math.abs(b.getScrollPosition() - h.current) > 0.5) {
|
|
2845
2845
|
const m = Pt(h.current);
|
|
2846
|
-
|
|
2846
|
+
we.current = !1, De(m, { immediate: !0 });
|
|
2847
2847
|
}
|
|
2848
2848
|
}
|
|
2849
2849
|
}, [y, ct, t, Pt, De]), q(() => {
|
|
2850
2850
|
if (re.current !== null) {
|
|
2851
|
-
const { index: c, align:
|
|
2851
|
+
const { index: c, align: b, offset: m } = re.current, W = Ze(c, t), { cumulative: U, currentValue: G } = y.prefixSum(W, { materializeOption: { materialize: !1 } });
|
|
2852
2852
|
if (U !== void 0 && G !== void 0) {
|
|
2853
2853
|
const J = Math.max(U - G, 0);
|
|
2854
|
-
let
|
|
2855
|
-
|
|
2856
|
-
const Ue = Math.max(0, ct + D.top + D.bottom - fe), Le = Math.min(ir(
|
|
2854
|
+
let Se = J;
|
|
2855
|
+
b === "bottom" ? Se = U - fe : b === "center" && (Se = J + G / 2 - fe / 2), m && (Se -= m), Se = Math.max(0, Se);
|
|
2856
|
+
const Ue = Math.max(0, ct + D.top + D.bottom - fe), Le = Math.min(ir(Se, D.top), Ue);
|
|
2857
2857
|
Math.abs(Le - h.current) > 1 && (V.debug("[VirtualScroll] Drift correction", {
|
|
2858
2858
|
from: h.current,
|
|
2859
2859
|
to: Le,
|
|
@@ -2866,41 +2866,41 @@ const ni = 1e4, yi = () => {
|
|
|
2866
2866
|
const c = H.current;
|
|
2867
2867
|
if (c === D.top || (H.current = D.top, re.current))
|
|
2868
2868
|
return;
|
|
2869
|
-
const
|
|
2869
|
+
const b = yt(h.current, c), m = ir(b, D.top);
|
|
2870
2870
|
h.current = m, j.current?.scrollTo(m), De(m, { immediate: !0 });
|
|
2871
2871
|
}, [D.top, De]);
|
|
2872
2872
|
const kt = w(
|
|
2873
|
-
(c,
|
|
2873
|
+
(c, b) => {
|
|
2874
2874
|
if (t === 0)
|
|
2875
2875
|
return;
|
|
2876
|
-
const m = Ze(c, t), W = y.get(m), U =
|
|
2877
|
-
G !== void 0 && Tt(G), V.debug("[VirtualScroll] Updated item size manually", { index: m, size:
|
|
2876
|
+
const m = Ze(c, t), W = y.get(m), U = b - W, G = y.update(m, b);
|
|
2877
|
+
G !== void 0 && Tt(G), V.debug("[VirtualScroll] Updated item size manually", { index: m, size: b, total: G });
|
|
2878
2878
|
let J = re.current ? re.current.index : null;
|
|
2879
2879
|
if (J === null) {
|
|
2880
|
-
const
|
|
2880
|
+
const Se = h.current, Ue = an(F).top, Le = yt(Se, Ue), { index: ze, cumulative: pt } = y.findIndexAtOrAfter(Le, { materializeOption: { materialize: !1 } });
|
|
2881
2881
|
J = pt !== void 0 && pt === Le ? ze + 1 : ze;
|
|
2882
2882
|
}
|
|
2883
2883
|
if (J !== -1 && m < J && U !== 0) {
|
|
2884
|
-
const
|
|
2885
|
-
Pt(Ue, U), De(Ue, { immediate: !0 }), V.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from:
|
|
2884
|
+
const Se = h.current, Ue = Se + U;
|
|
2885
|
+
Pt(Ue, U), De(Ue, { immediate: !0 }), V.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: Se, to: Ue, causedByIndex: m, delta: U, activeVisibleStartIndex: J });
|
|
2886
2886
|
}
|
|
2887
2887
|
},
|
|
2888
2888
|
[y, t, Pt, De, F]
|
|
2889
2889
|
), st = w(
|
|
2890
|
-
(c,
|
|
2890
|
+
(c, b) => {
|
|
2891
2891
|
if (!j.current || t === 0)
|
|
2892
2892
|
return;
|
|
2893
|
-
const m = Ze(c, t), W = Ze(m - s * 2, t), U = Ze(m + s * 2, t), { cumulative: G, total: J, currentValue:
|
|
2894
|
-
if (V.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", G, "Total height:", J, "ItemHeight:",
|
|
2893
|
+
const m = Ze(c, t), W = Ze(m - s * 2, t), U = Ze(m + s * 2, t), { cumulative: G, total: J, currentValue: Se } = y.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: W, to: U }] } });
|
|
2894
|
+
if (V.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", G, "Total height:", J, "ItemHeight:", Se, "safeIndexFrom:", W, "safeIndexTo:", U), !J)
|
|
2895
2895
|
return;
|
|
2896
|
-
const Ue = Math.max(G -
|
|
2896
|
+
const Ue = Math.max(G - Se, 0);
|
|
2897
2897
|
let Le = Ue;
|
|
2898
|
-
|
|
2898
|
+
b?.align === "bottom" ? Le = G - fe : b?.align === "center" && (Le = Ue + Se / 2 - fe / 2), b?.offset && (Le -= b.offset), Le = Math.max(0, Le);
|
|
2899
2899
|
const ze = ir(Le, D.top), pt = j.current?.getContentSize() ?? J + D.top + D.bottom, ot = Math.max(0, pt - fe), gt = Math.min(ze, ot);
|
|
2900
2900
|
re.current = {
|
|
2901
2901
|
index: m,
|
|
2902
|
-
align:
|
|
2903
|
-
offset:
|
|
2902
|
+
align: b?.align,
|
|
2903
|
+
offset: b?.offset
|
|
2904
2904
|
};
|
|
2905
2905
|
const nr = j.current?.getScrollPosition() ?? -1, or = Math.abs(nr - gt) > 0.5;
|
|
2906
2906
|
it.current = !1, pe.current = 0, or && (it.current = !0, pe.current += 1, j.current?.scrollTo(gt)), Tt(J), De(gt, { immediate: !0 }), V.debug("[VirtualScroll] Setting scroll position to:", gt, { original: ze, max: ot });
|
|
@@ -2915,47 +2915,47 @@ const ni = 1e4, yi = () => {
|
|
|
2915
2915
|
(c) => {
|
|
2916
2916
|
if (!j.current || t === 0)
|
|
2917
2917
|
return;
|
|
2918
|
-
const
|
|
2919
|
-
st(W, { offset:
|
|
2918
|
+
const b = y.getTotal(), m = oe(Math.floor(c), 0, b), { index: W, cumulative: U, currentValue: G } = y.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), Se = (U ?? 0) - (G ?? 0) - m;
|
|
2919
|
+
st(W, { offset: Se });
|
|
2920
2920
|
},
|
|
2921
2921
|
[y, t, st]
|
|
2922
2922
|
), O = w(() => {
|
|
2923
2923
|
if (t === 0)
|
|
2924
2924
|
return null;
|
|
2925
|
-
const c = yt(h.current, D.top), { index:
|
|
2926
|
-
if (
|
|
2925
|
+
const c = yt(h.current, D.top), { index: b, cumulative: m, currentValue: W } = y.findIndexAtOrAfter(c, { materializeOption: { materialize: !1 } });
|
|
2926
|
+
if (b === -1)
|
|
2927
2927
|
return { index: t - 1, offsetPx: 0 };
|
|
2928
2928
|
if (m === c)
|
|
2929
|
-
return { index: oe(
|
|
2929
|
+
return { index: oe(b + 1, 0, t - 1), offsetPx: 0 };
|
|
2930
2930
|
const U = (m ?? 0) - (W ?? 0);
|
|
2931
|
-
return { index:
|
|
2931
|
+
return { index: b, offsetPx: Math.max(0, c - U) };
|
|
2932
2932
|
}, [y, t, D.top]), te = w(
|
|
2933
2933
|
(c) => {
|
|
2934
|
-
const
|
|
2934
|
+
const b = yt(h.current, D.top), m = typeof c == "function" ? c(b) : c;
|
|
2935
2935
|
E(m);
|
|
2936
2936
|
const W = j.current?.getScrollPosition(), U = typeof W == "number" ? W : h.current;
|
|
2937
2937
|
return De(U), yt(U, Fe.current);
|
|
2938
2938
|
},
|
|
2939
2939
|
[D.top, E, De]
|
|
2940
2940
|
), Ce = w((c) => {
|
|
2941
|
-
const
|
|
2942
|
-
if (!
|
|
2941
|
+
const b = j.current;
|
|
2942
|
+
if (!b)
|
|
2943
2943
|
return yt(h.current, Fe.current);
|
|
2944
|
-
const m =
|
|
2944
|
+
const m = b.scrollTo((W) => W + c);
|
|
2945
2945
|
return yt(m, Fe.current);
|
|
2946
2946
|
}, []), je = w((c) => j.current?.applyWheel(c) ?? !1, []), St = w(
|
|
2947
|
-
(c,
|
|
2947
|
+
(c, b) => {
|
|
2948
2948
|
V.debug("[VirtualScroll] Scroll position changed:", c);
|
|
2949
2949
|
const m = it.current;
|
|
2950
2950
|
m && (it.current = !1);
|
|
2951
2951
|
const W = pe.current > 0;
|
|
2952
2952
|
W && (pe.current = 0);
|
|
2953
2953
|
const U = wt.current && p.current === t;
|
|
2954
|
-
if (m || W || U || (re.current = null), De(c),
|
|
2954
|
+
if (m || W || U || (re.current = null), De(c), Te) {
|
|
2955
2955
|
if (m || W)
|
|
2956
2956
|
return;
|
|
2957
|
-
const G = c -
|
|
2958
|
-
if (V.debug("[VirtualScroll] Scroll diff:", G, "New:", c, "Prev:",
|
|
2957
|
+
const G = c - b;
|
|
2958
|
+
if (V.debug("[VirtualScroll] Scroll diff:", G, "New:", c, "Prev:", b), Math.abs(G) > 1) {
|
|
2959
2959
|
const J = G > 0 ? "down" : "up";
|
|
2960
2960
|
ft(J), Be(!0), V.debug("[VirtualScroll] Showing scroll buttons. Direction:", J), tt.current && clearTimeout(tt.current), tt.current = setTimeout(() => {
|
|
2961
2961
|
Be(!1), V.debug("[VirtualScroll] Hiding scroll buttons");
|
|
@@ -2963,34 +2963,34 @@ const ni = 1e4, yi = () => {
|
|
|
2963
2963
|
}
|
|
2964
2964
|
}
|
|
2965
2965
|
},
|
|
2966
|
-
[De,
|
|
2967
|
-
), He =
|
|
2968
|
-
const c = y.getTotal(),
|
|
2966
|
+
[De, Te, t]
|
|
2967
|
+
), He = Me(() => yt(et, D.top), [D.top, et]), Dt = Me(() => {
|
|
2968
|
+
const c = y.getTotal(), b = Sn(He, fe, s, t, n, y, c);
|
|
2969
2969
|
return V.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
2970
|
-
...
|
|
2970
|
+
...b,
|
|
2971
2971
|
scrollPosition: He,
|
|
2972
2972
|
renderingContentSize: c,
|
|
2973
2973
|
overscanCount: s,
|
|
2974
2974
|
viewportSize: fe
|
|
2975
|
-
})),
|
|
2975
|
+
})), b;
|
|
2976
2976
|
}, [He, fe, s, t, n, y]), { renderingStartIndex: bt, renderingEndIndex: Lt, visibleStartIndex: Ht, visibleEndIndex: Gt } = Dt, Ot = w(
|
|
2977
|
-
(c,
|
|
2977
|
+
(c, b) => {
|
|
2978
2978
|
if (!_ || t === 0)
|
|
2979
2979
|
return;
|
|
2980
2980
|
const m = Ze(c, t);
|
|
2981
|
-
if (!(
|
|
2982
|
-
const ot =
|
|
2981
|
+
if (!(b?.ensureVisible ?? !0)) {
|
|
2982
|
+
const ot = Re.current.get(m);
|
|
2983
2983
|
ot && (_e.current = null, me.current = m, P(ot));
|
|
2984
2984
|
return;
|
|
2985
2985
|
}
|
|
2986
|
-
const U = y.prefixSum(m, { materializeOption: { materialize: !1 } }), G = U.currentValue, J = Math.max(U.cumulative - G, 0),
|
|
2987
|
-
if (J < Ue ||
|
|
2986
|
+
const U = y.prefixSum(m, { materializeOption: { materialize: !1 } }), G = U.currentValue, J = Math.max(U.cumulative - G, 0), Se = J + G, Ue = yt(h.current, D.top), Le = Ue + fe;
|
|
2987
|
+
if (J < Ue || Se > Le) {
|
|
2988
2988
|
st(m);
|
|
2989
|
-
const ot =
|
|
2989
|
+
const ot = Re.current.get(m);
|
|
2990
2990
|
ot ? (_e.current = null, me.current = m, P(ot)) : _e.current = m;
|
|
2991
2991
|
return;
|
|
2992
2992
|
}
|
|
2993
|
-
const pt =
|
|
2993
|
+
const pt = Re.current.get(m);
|
|
2994
2994
|
if (pt) {
|
|
2995
2995
|
_e.current = null, me.current = m, P(pt);
|
|
2996
2996
|
return;
|
|
@@ -2999,7 +2999,7 @@ const ni = 1e4, yi = () => {
|
|
|
2999
2999
|
},
|
|
3000
3000
|
[_, t, y, D.top, st, P, fe]
|
|
3001
3001
|
), sr = w(
|
|
3002
|
-
(c,
|
|
3002
|
+
(c, b) => {
|
|
3003
3003
|
if (!(!_ || c.defaultPrevented) && !(c.altKey || c.metaKey || c.ctrlKey) && c.target === c.currentTarget && !c.currentTarget.isContentEditable) {
|
|
3004
3004
|
if (c.key === "ArrowLeft" || c.key === "ArrowRight") {
|
|
3005
3005
|
const m = he.current;
|
|
@@ -3009,24 +3009,24 @@ const ni = 1e4, yi = () => {
|
|
|
3009
3009
|
return;
|
|
3010
3010
|
}
|
|
3011
3011
|
if (c.key === "ArrowDown") {
|
|
3012
|
-
|
|
3012
|
+
b < t - 1 && (c.preventDefault(), Ot(b + 1));
|
|
3013
3013
|
return;
|
|
3014
3014
|
}
|
|
3015
3015
|
if (c.key === "ArrowUp") {
|
|
3016
|
-
|
|
3016
|
+
b > 0 && (c.preventDefault(), Ot(b - 1));
|
|
3017
3017
|
return;
|
|
3018
3018
|
}
|
|
3019
3019
|
if (c.key === "PageDown") {
|
|
3020
|
-
if (
|
|
3020
|
+
if (b < t - 1) {
|
|
3021
3021
|
c.preventDefault();
|
|
3022
|
-
const { visibleStartIndex: m, visibleEndIndex: W } = Je.current, U = Math.max(W - m + 1, 1), G = Math.max(U, 1), J = Ze(Math.min(
|
|
3022
|
+
const { visibleStartIndex: m, visibleEndIndex: W } = Je.current, U = Math.max(W - m + 1, 1), G = Math.max(U, 1), J = Ze(Math.min(b + G, t - 1), t);
|
|
3023
3023
|
Ot(J);
|
|
3024
3024
|
}
|
|
3025
3025
|
return;
|
|
3026
3026
|
}
|
|
3027
|
-
if (c.key === "PageUp" &&
|
|
3027
|
+
if (c.key === "PageUp" && b > 0) {
|
|
3028
3028
|
c.preventDefault();
|
|
3029
|
-
const { visibleStartIndex: m, visibleEndIndex: W } = Je.current, U = Math.max(W - m + 1, 1), G = Math.max(U, 1), J = Ze(
|
|
3029
|
+
const { visibleStartIndex: m, visibleEndIndex: W } = Je.current, U = Math.max(W - m + 1, 1), G = Math.max(U, 1), J = Ze(b - G, t);
|
|
3030
3030
|
Ot(J);
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
@@ -3040,31 +3040,31 @@ const ni = 1e4, yi = () => {
|
|
|
3040
3040
|
* @param event - Keyboard event (bubble phase on the row wrapper) / 行ラッパー bubble フェーズのキーイベント
|
|
3041
3041
|
* @param index - Row index / 行インデックス
|
|
3042
3042
|
*/
|
|
3043
|
-
(c,
|
|
3043
|
+
(c, b) => {
|
|
3044
3044
|
if (c.key !== "Escape" || c.defaultPrevented || c.nativeEvent.isComposing || c.target === c.currentTarget)
|
|
3045
3045
|
return;
|
|
3046
3046
|
const m = c.target;
|
|
3047
|
-
m instanceof HTMLInputElement || m instanceof HTMLTextAreaElement || m instanceof HTMLSelectElement || m.isContentEditable || (c.preventDefault(), Ot(
|
|
3047
|
+
m instanceof HTMLInputElement || m instanceof HTMLTextAreaElement || m instanceof HTMLSelectElement || m.isContentEditable || (c.preventDefault(), Ot(b));
|
|
3048
3048
|
},
|
|
3049
3049
|
[Ot]
|
|
3050
3050
|
), jt = w(
|
|
3051
3051
|
(c) => {
|
|
3052
3052
|
if (!_)
|
|
3053
3053
|
return;
|
|
3054
|
-
const
|
|
3055
|
-
_e.current = null, me.current =
|
|
3054
|
+
const b = Ze(c, t);
|
|
3055
|
+
_e.current = null, me.current = b, Ie?.(b);
|
|
3056
3056
|
},
|
|
3057
|
-
[_, t,
|
|
3057
|
+
[_, t, Ie]
|
|
3058
3058
|
);
|
|
3059
3059
|
q(() => {
|
|
3060
|
-
const c = j.current?.getScrollPosition() ?? 0,
|
|
3060
|
+
const c = j.current?.getScrollPosition() ?? 0, b = h.current, m = yt(b, D.top);
|
|
3061
3061
|
V.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
3062
3062
|
renderingStartIndex: bt,
|
|
3063
3063
|
renderingEndIndex: Lt,
|
|
3064
3064
|
visibleStartIndex: Ht,
|
|
3065
3065
|
visibleEndIndex: Gt,
|
|
3066
3066
|
scrollPositionState: et,
|
|
3067
|
-
paneScrollPosition:
|
|
3067
|
+
paneScrollPosition: b,
|
|
3068
3068
|
logicalScrollPosition: m,
|
|
3069
3069
|
contentSize: ct,
|
|
3070
3070
|
scrollPaneScrollPosition: c
|
|
@@ -3078,7 +3078,7 @@ const ni = 1e4, yi = () => {
|
|
|
3078
3078
|
});
|
|
3079
3079
|
}, [ct, Lt, bt, D.top, Rt, et, Gt, Ht]);
|
|
3080
3080
|
const gr = w(() => {
|
|
3081
|
-
if (!
|
|
3081
|
+
if (!Te)
|
|
3082
3082
|
return null;
|
|
3083
3083
|
const c = Ee && dt !== null;
|
|
3084
3084
|
return /* @__PURE__ */ Q("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": c, inert: !c, children: dt === "up" ? /* @__PURE__ */ Q("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ Q(
|
|
@@ -3104,25 +3104,25 @@ const ni = 1e4, yi = () => {
|
|
|
3104
3104
|
children: "Bottom"
|
|
3105
3105
|
}
|
|
3106
3106
|
) }) });
|
|
3107
|
-
}, [
|
|
3107
|
+
}, [Te, Ee, dt, st, t]), Mt = d(0), { visibleItems: Nt, renderAnchor: Xt } = Me(() => {
|
|
3108
3108
|
if (t === 0)
|
|
3109
3109
|
return {
|
|
3110
3110
|
visibleItems: /* @__PURE__ */ Q("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ Q("div", { className: "aqvs-no-items-text", children: "No items" }) }),
|
|
3111
3111
|
renderAnchor: 0
|
|
3112
3112
|
};
|
|
3113
|
-
const c = Ze(bt, t),
|
|
3113
|
+
const c = Ze(bt, t), b = Ze(Lt, t), { cumulative: m, currentValue: W } = y.prefixSum(c, { materializeOption: { materialize: !1 } }), U = m - W;
|
|
3114
3114
|
Number.isFinite(U) && Math.abs(U - Mt.current) > wn && (Mt.current = U);
|
|
3115
|
-
const G = Mt.current, J = [],
|
|
3115
|
+
const G = Mt.current, J = [], Se = [];
|
|
3116
3116
|
let Ue = 0, Le = U;
|
|
3117
|
-
for (let ze = c; ze <=
|
|
3118
|
-
if (
|
|
3119
|
-
V.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Hr, safeRenderingStartIndex: c, safeRenderingEndIndex:
|
|
3117
|
+
for (let ze = c; ze <= b; ze++) {
|
|
3118
|
+
if (Se.length >= Hr) {
|
|
3119
|
+
V.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Hr, safeRenderingStartIndex: c, safeRenderingEndIndex: b });
|
|
3120
3120
|
break;
|
|
3121
3121
|
}
|
|
3122
3122
|
const pt = n(ze), ot = y.get(ze), gt = pt - ot;
|
|
3123
3123
|
gt !== 0 && J.push({ index: ze, value: pt });
|
|
3124
3124
|
const nr = Le + Ue, or = r ? r(ze) : ze;
|
|
3125
|
-
|
|
3125
|
+
Se.push(
|
|
3126
3126
|
/* @__PURE__ */ Q(
|
|
3127
3127
|
ai,
|
|
3128
3128
|
{
|
|
@@ -3160,7 +3160,7 @@ const ni = 1e4, yi = () => {
|
|
|
3160
3160
|
const gt = ot + ze;
|
|
3161
3161
|
Pt(gt, ze), De(gt, { immediate: !0 }), V.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: ot, to: gt, shiftAmount: ze });
|
|
3162
3162
|
} else ot !== h.current && De(ot);
|
|
3163
|
-
}), { visibleItems:
|
|
3163
|
+
}), { visibleItems: Se, renderAnchor: G };
|
|
3164
3164
|
}, [
|
|
3165
3165
|
v,
|
|
3166
3166
|
at,
|
|
@@ -3183,7 +3183,7 @@ const ni = 1e4, yi = () => {
|
|
|
3183
3183
|
Ht
|
|
3184
3184
|
]), qt = w(
|
|
3185
3185
|
(c) => {
|
|
3186
|
-
const
|
|
3186
|
+
const b = (ee ?? 0) > 0, m = Math.abs(c - et), W = b && m > 0.5 ? et : c, U = yt(W, D.top);
|
|
3187
3187
|
if (V.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
3188
3188
|
currentScrollPosition: c,
|
|
3189
3189
|
effectiveScrollPosition: U,
|
|
@@ -3219,7 +3219,7 @@ const ni = 1e4, yi = () => {
|
|
|
3219
3219
|
] });
|
|
3220
3220
|
},
|
|
3221
3221
|
[ee, t, y, He, Xt, Lt, bt, D, et, fe, Nt]
|
|
3222
|
-
), Zt =
|
|
3222
|
+
), Zt = Me(
|
|
3223
3223
|
() => ({
|
|
3224
3224
|
renderingStartIndex: Dt.renderingStartIndex,
|
|
3225
3225
|
renderingEndIndex: Dt.renderingEndIndex,
|
|
@@ -3249,10 +3249,10 @@ const ni = 1e4, yi = () => {
|
|
|
3249
3249
|
return;
|
|
3250
3250
|
}
|
|
3251
3251
|
const c = setTimeout(() => {
|
|
3252
|
-
const
|
|
3253
|
-
if (!
|
|
3252
|
+
const b = It.current?.format;
|
|
3253
|
+
if (!b)
|
|
3254
3254
|
return;
|
|
3255
|
-
const m =
|
|
3255
|
+
const m = b({ visibleStartIndex: Ht, visibleEndIndex: Gt, itemCount: t });
|
|
3256
3256
|
Qt(m);
|
|
3257
3257
|
}, Ct);
|
|
3258
3258
|
return () => clearTimeout(c);
|
|
@@ -3285,7 +3285,7 @@ const ni = 1e4, yi = () => {
|
|
|
3285
3285
|
contentSize: Er,
|
|
3286
3286
|
viewportSize: i,
|
|
3287
3287
|
onViewportSizeChange: Ve,
|
|
3288
|
-
className:
|
|
3288
|
+
className: a,
|
|
3289
3289
|
testId: l,
|
|
3290
3290
|
onScroll: St,
|
|
3291
3291
|
background: R,
|
|
@@ -3317,21 +3317,21 @@ const ni = 1e4, yi = () => {
|
|
|
3317
3317
|
/* @__PURE__ */ Q("div", { className: "aqvs-live-region", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-aqvs-live-region": "", children: rr })
|
|
3318
3318
|
] }) : $t;
|
|
3319
3319
|
}, li = Rr(ci), Tr = 262144, ln = 3, ui = 32768, un = 128, dn = 128, fn = 128, hn = 128, Or = 10, di = (t, e) => Math.max(1, Math.floor((t ?? ui) / Math.max(1, e))), fi = (t, e, r, n, i) => {
|
|
3320
|
-
let s = 0,
|
|
3321
|
-
for (; l < r && s < t &&
|
|
3322
|
-
s += e(l),
|
|
3323
|
-
return Math.max(1,
|
|
3320
|
+
let s = 0, a = 0, l = Math.max(0, Math.min(n, r - 1));
|
|
3321
|
+
for (; l < r && s < t && a < Hr; )
|
|
3322
|
+
s += e(l), a += 1, l += 1;
|
|
3323
|
+
return Math.max(1, a + 2 * i + 2);
|
|
3324
3324
|
}, Ir = (t, e, r) => {
|
|
3325
3325
|
if (!(Number.isInteger(t) && t >= 0 && t <= Tr))
|
|
3326
3326
|
throw new RangeError(
|
|
3327
3327
|
`[VirtualGrid] ${e === "row" ? "getRowHeight" : "getColWidth"}(${r}) returned ${t} — must be an integer in [0, ${Tr}] (0 = hidden). Oversized tracks would pierce the browser layout-coordinate wall (see the design plan §3.1/§6).`
|
|
3328
3328
|
);
|
|
3329
3329
|
return t;
|
|
3330
|
-
}, hi = (t, e, r, n, i, s,
|
|
3331
|
-
const f = Sn(t, e, r, n, i, s,
|
|
3330
|
+
}, hi = (t, e, r, n, i, s, a, l) => {
|
|
3331
|
+
const f = Sn(t, e, r, n, i, s, a);
|
|
3332
3332
|
if (n === 0)
|
|
3333
3333
|
return { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0 };
|
|
3334
|
-
const
|
|
3334
|
+
const x = oe(f.renderingStartIndex, 0, n - 1), { cumulative: v, currentValue: R } = s.prefixSum(x, { materializeOption: { materialize: !1 } }), T = v - R, S = Number.isFinite(T) && Math.abs(T - l) > wn ? T : l;
|
|
3335
3335
|
return {
|
|
3336
3336
|
renderingColStart: f.renderingStartIndex,
|
|
3337
3337
|
renderingColEnd: f.renderingEndIndex,
|
|
@@ -3340,44 +3340,44 @@ const ni = 1e4, yi = () => {
|
|
|
3340
3340
|
colAnchor: S
|
|
3341
3341
|
};
|
|
3342
3342
|
}, mn = [], mi = (t, e, r, n, i) => {
|
|
3343
|
-
const s = [],
|
|
3343
|
+
const s = [], a = [];
|
|
3344
3344
|
if (e < t)
|
|
3345
|
-
return { columns: s, widthUpdates:
|
|
3345
|
+
return { columns: s, widthUpdates: a, truncated: 0 };
|
|
3346
3346
|
const l = n.prefixSum(t, { materializeOption: { materialize: !1 } });
|
|
3347
|
-
let f = l.cumulative - l.currentValue,
|
|
3347
|
+
let f = l.cumulative - l.currentValue, x = 0, v = t;
|
|
3348
3348
|
for (; v <= e; ) {
|
|
3349
3349
|
if (s.length >= i)
|
|
3350
|
-
return { columns: s, widthUpdates:
|
|
3350
|
+
return { columns: s, widthUpdates: a, truncated: e - v + 1 };
|
|
3351
3351
|
const R = r(v), T = n.get(v);
|
|
3352
|
-
if (R !== T &&
|
|
3353
|
-
s.push({ col: v, left: f, width: R }), f += T,
|
|
3352
|
+
if (R !== T && a.push({ index: v, value: R }), R > 0) {
|
|
3353
|
+
s.push({ col: v, left: f, width: R }), f += T, x = 0, v += 1;
|
|
3354
3354
|
continue;
|
|
3355
3355
|
}
|
|
3356
|
-
if (f += T,
|
|
3356
|
+
if (f += T, x += 1, v += 1, x > pr) {
|
|
3357
3357
|
const S = n.findIndexAtOrAfter(f + 0.5, { materializeOption: { materialize: !1 } });
|
|
3358
3358
|
if (S.index === -1 || S.index <= v || !Number.isSafeInteger(S.index))
|
|
3359
3359
|
break;
|
|
3360
3360
|
const N = n.prefixSum(S.index, { materializeOption: { materialize: !1 } });
|
|
3361
|
-
f = N.cumulative - N.currentValue, v = S.index,
|
|
3361
|
+
f = N.cumulative - N.currentValue, v = S.index, x = 0;
|
|
3362
3362
|
}
|
|
3363
3363
|
}
|
|
3364
|
-
return { columns: s, widthUpdates:
|
|
3364
|
+
return { columns: s, widthUpdates: a, truncated: 0 };
|
|
3365
3365
|
}, pi = (t, e, r) => {
|
|
3366
3366
|
const n = [], i = [];
|
|
3367
3367
|
let s = 0;
|
|
3368
|
-
for (let
|
|
3369
|
-
const l = e(
|
|
3370
|
-
l !== f && i.push({ index:
|
|
3368
|
+
for (let a = 0; a < t; a += 1) {
|
|
3369
|
+
const l = e(a), f = r.get(a);
|
|
3370
|
+
l !== f && i.push({ index: a, value: l }), l > 0 && n.push({ col: a, left: s, width: l }), s += f;
|
|
3371
3371
|
}
|
|
3372
3372
|
return { columns: n, widthUpdates: i, width: s };
|
|
3373
3373
|
}, gi = (t, e, r, n) => {
|
|
3374
3374
|
const i = [], s = [];
|
|
3375
|
-
let
|
|
3375
|
+
let a = 0;
|
|
3376
3376
|
for (let l = t - e; l < t; l += 1) {
|
|
3377
|
-
const f = r(l),
|
|
3378
|
-
f !==
|
|
3377
|
+
const f = r(l), x = n.get(l);
|
|
3378
|
+
f !== x && s.push({ index: l, value: f }), f > 0 && i.push({ col: l, left: a, width: f }), a += x;
|
|
3379
3379
|
}
|
|
3380
|
-
return { columns: i, widthUpdates: s, width:
|
|
3380
|
+
return { columns: i, widthUpdates: s, width: a };
|
|
3381
3381
|
}, yr = (t, e, r) => Math.min(t, Math.max(0, r - e)), xi = { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0, key: "0:0:0" }, bi = ({
|
|
3382
3382
|
rowCount: t,
|
|
3383
3383
|
colCount: e,
|
|
@@ -3385,10 +3385,10 @@ const ni = 1e4, yi = () => {
|
|
|
3385
3385
|
getColWidth: n,
|
|
3386
3386
|
getCell: i,
|
|
3387
3387
|
getCellKey: s,
|
|
3388
|
-
children:
|
|
3388
|
+
children: a,
|
|
3389
3389
|
getCellProps: l,
|
|
3390
3390
|
getRowProps: f,
|
|
3391
|
-
contentProps:
|
|
3391
|
+
contentProps: x,
|
|
3392
3392
|
background: v,
|
|
3393
3393
|
contentInsets: R,
|
|
3394
3394
|
onRowFocus: T,
|
|
@@ -3396,8 +3396,8 @@ const ni = 1e4, yi = () => {
|
|
|
3396
3396
|
frozenLeadingRows: N = 0,
|
|
3397
3397
|
frozenTrailingCols: ee = 0,
|
|
3398
3398
|
frozenTrailingRows: F = 0,
|
|
3399
|
-
horizontalKeyInputs:
|
|
3400
|
-
horizontalKeyStep:
|
|
3399
|
+
horizontalKeyInputs: Ie,
|
|
3400
|
+
horizontalKeyStep: ye,
|
|
3401
3401
|
onScroll: A,
|
|
3402
3402
|
onRangeChange: $,
|
|
3403
3403
|
onRenderTruncated: ie,
|
|
@@ -3410,7 +3410,7 @@ const ni = 1e4, yi = () => {
|
|
|
3410
3410
|
behaviorOptions: ae,
|
|
3411
3411
|
scrollBarOptions: ce,
|
|
3412
3412
|
liveRegion: k,
|
|
3413
|
-
className:
|
|
3413
|
+
className: Te,
|
|
3414
3414
|
testId: I
|
|
3415
3415
|
}, le) => {
|
|
3416
3416
|
const ue = d(null), Ye = d(null), _ = d(r);
|
|
@@ -3418,12 +3418,12 @@ const ni = 1e4, yi = () => {
|
|
|
3418
3418
|
const Xe = d(n);
|
|
3419
3419
|
Xe.current = n;
|
|
3420
3420
|
const ut = ae?.resetOnGetColWidthChange === !0, Ge = ae?.resetOnGetItemHeightChange === !0 ? r : null, at = ut ? n : null, Pe = w(
|
|
3421
|
-
(
|
|
3421
|
+
(o) => Ir(_.current(o), "row", o),
|
|
3422
3422
|
[Ge]
|
|
3423
3423
|
), qe = w(
|
|
3424
|
-
(
|
|
3424
|
+
(o) => Ir(Xe.current(o), "col", o),
|
|
3425
3425
|
[at]
|
|
3426
|
-
), be = ae?.defaultColWidth, fe =
|
|
3426
|
+
), be = ae?.defaultColWidth, fe = Me(() => {
|
|
3427
3427
|
if (be !== void 0 && !(Number.isInteger(be) && be >= 0 && be <= Tr))
|
|
3428
3428
|
throw new RangeError(`[VirtualGrid] behaviorOptions.defaultColWidth must be an integer in [0, ${Tr}], received ${be}.`);
|
|
3429
3429
|
return { resetOnValueFnChange: ut, baseValue: be };
|
|
@@ -3439,48 +3439,48 @@ const ni = 1e4, yi = () => {
|
|
|
3439
3439
|
const Z = Math.min(N, t);
|
|
3440
3440
|
if (!(Number.isInteger(F) && F >= 0 && F <= hn))
|
|
3441
3441
|
throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${hn}], received ${F}.`);
|
|
3442
|
-
const We = Math.min(F, t - Z), y = Math.max(0, t - Z - We), vt = d(!1), et = d(0), xt = d(0), [ct, Tt] = Oe(0), { frozenRows: h, frozenHeight: H } =
|
|
3442
|
+
const We = Math.min(F, t - Z), y = Math.max(0, t - Z - We), vt = d(!1), et = d(0), xt = d(0), [ct, Tt] = Oe(0), { frozenRows: h, frozenHeight: H } = Me(() => {
|
|
3443
3443
|
if (Z === 0)
|
|
3444
3444
|
return { frozenRows: [], frozenHeight: 0 };
|
|
3445
|
-
const
|
|
3446
|
-
let
|
|
3445
|
+
const o = [];
|
|
3446
|
+
let g = 0;
|
|
3447
3447
|
for (let M = 0; M < Z; M += 1) {
|
|
3448
3448
|
const X = Pe(M);
|
|
3449
|
-
X > 0 &&
|
|
3449
|
+
X > 0 && o.push({ row: M, top: g, height: X }), g += X;
|
|
3450
3450
|
}
|
|
3451
|
-
return { frozenRows:
|
|
3451
|
+
return { frozenRows: o, frozenHeight: g };
|
|
3452
3452
|
}, [Z, ct, Pe]);
|
|
3453
3453
|
et.current = H;
|
|
3454
|
-
const [se, ne] = Oe(0), { trailingRows: he, trailingHeight: xe } =
|
|
3454
|
+
const [se, ne] = Oe(0), { trailingRows: he, trailingHeight: xe } = Me(() => {
|
|
3455
3455
|
if (We === 0)
|
|
3456
3456
|
return { trailingRows: [], trailingHeight: 0 };
|
|
3457
|
-
const
|
|
3458
|
-
let
|
|
3457
|
+
const o = [];
|
|
3458
|
+
let g = 0;
|
|
3459
3459
|
for (let M = t - We; M < t; M += 1) {
|
|
3460
3460
|
const X = Pe(M);
|
|
3461
|
-
X > 0 &&
|
|
3461
|
+
X > 0 && o.push({ row: M, top: g, height: X }), g += X;
|
|
3462
3462
|
}
|
|
3463
|
-
return { trailingRows:
|
|
3463
|
+
return { trailingRows: o, trailingHeight: g };
|
|
3464
3464
|
}, [We, t, se, Pe]);
|
|
3465
3465
|
xt.current = xe;
|
|
3466
|
-
const ve = w((
|
|
3467
|
-
|
|
3468
|
-
const _e = T !== void 0, me =
|
|
3466
|
+
const ve = w((o) => Pe(o + Z), [Pe, Z]), Re = d(T);
|
|
3467
|
+
Re.current = T;
|
|
3468
|
+
const _e = T !== void 0, me = Me(() => _e ? (o) => Re.current?.(o + Z) : void 0, [Z, _e]), dt = H, ft = xe, [Ee, Be] = Oe(Z), tt = d(null), it = d(!1);
|
|
3469
3469
|
if (Ee !== Z) {
|
|
3470
3470
|
Be(Z), it.current = !0;
|
|
3471
|
-
const
|
|
3472
|
-
tt.current =
|
|
3471
|
+
const o = ue.current?.getScrollAnchor() ?? null;
|
|
3472
|
+
tt.current = o === null ? null : { row: o.index + Ee, offsetPx: o.offsetPx };
|
|
3473
3473
|
}
|
|
3474
|
-
const pe = d(0),
|
|
3474
|
+
const pe = d(0), we = d(0), wt = d(!1), [p, P] = Oe(xi), Ae = d(p);
|
|
3475
3475
|
Ae.current = p;
|
|
3476
3476
|
const lt = d(0), [$e, Rt] = Oe(() => Ve.getTotal() ?? 0), Fe = d($e);
|
|
3477
3477
|
Fe.current = $e;
|
|
3478
|
-
const ht = w((
|
|
3479
|
-
typeof
|
|
3478
|
+
const ht = w((o) => {
|
|
3479
|
+
typeof o == "number" && Number.isFinite(o) && (Fe.current = o, Rt(o));
|
|
3480
3480
|
}, []);
|
|
3481
3481
|
Qe(() => {
|
|
3482
|
-
const
|
|
3483
|
-
typeof
|
|
3482
|
+
const o = Ve.getTotal();
|
|
3483
|
+
typeof o == "number" && Number.isFinite(o) && o !== Fe.current && ht(o);
|
|
3484
3484
|
});
|
|
3485
3485
|
const ke = ce?.width ?? 12, Bt = B === void 0 ? null : { width: Math.max(0, Math.round(B.width) - ke), height: Math.max(0, Math.round(B.height) - ke) }, [Ut, Vt] = Oe({ width: 0, height: 0 }), Ne = Bt ?? Ut, zt = d(Ne);
|
|
3486
3486
|
zt.current = Ne;
|
|
@@ -3490,29 +3490,29 @@ const ni = 1e4, yi = () => {
|
|
|
3490
3490
|
Qe(() => {
|
|
3491
3491
|
if (De)
|
|
3492
3492
|
return;
|
|
3493
|
-
const
|
|
3494
|
-
if (
|
|
3493
|
+
const o = Ye.current;
|
|
3494
|
+
if (o === null)
|
|
3495
3495
|
return;
|
|
3496
|
-
const
|
|
3497
|
-
const X = Math.max(0, Math.round(
|
|
3496
|
+
const g = () => {
|
|
3497
|
+
const X = Math.max(0, Math.round(o.clientWidth) - ke), de = Math.max(0, Math.round(o.clientHeight) - ke);
|
|
3498
3498
|
Vt((rt) => rt.width === X && rt.height === de ? rt : { width: X, height: de });
|
|
3499
3499
|
};
|
|
3500
|
-
|
|
3501
|
-
const M = new ResizeObserver(
|
|
3502
|
-
return M.observe(
|
|
3500
|
+
g();
|
|
3501
|
+
const M = new ResizeObserver(g);
|
|
3502
|
+
return M.observe(o), () => M.disconnect();
|
|
3503
3503
|
}, [ke, De]);
|
|
3504
3504
|
const Pt = w(() => {
|
|
3505
|
-
const
|
|
3506
|
-
|
|
3505
|
+
const o = Ye.current;
|
|
3506
|
+
o !== null && o.style.setProperty("--aqvs-grid-hx-residual", `${lt.current - pe.current}px`);
|
|
3507
3507
|
}, []), At = w(() => Math.max(0, zt.current.width - Ke.current - D.current), []), kt = w(() => Math.max(0, Fe.current - Ke.current - D.current - At()), [At]), st = w(() => {
|
|
3508
|
-
const
|
|
3509
|
-
if (re > 0 && (
|
|
3508
|
+
const o = At(), g = hi(Ke.current + pe.current, o, K, e, qe, Ve, Fe.current, Ae.current.colAnchor);
|
|
3509
|
+
if (re > 0 && (g.renderingColStart = Math.max(g.renderingColStart, re), g.visibleColStart = Math.max(g.visibleColStart, re)), ge > 0) {
|
|
3510
3510
|
const X = e - ge - 1;
|
|
3511
|
-
|
|
3511
|
+
g.renderingColEnd = Math.min(g.renderingColEnd, X), g.visibleColEnd = Math.min(g.visibleColEnd, X);
|
|
3512
3512
|
}
|
|
3513
|
-
(re > 0 || ge > 0) && (
|
|
3514
|
-
const M = `${
|
|
3515
|
-
M !== Ae.current.key && P({ ...
|
|
3513
|
+
(re > 0 || ge > 0) && (o <= 0 || g.renderingColStart > g.renderingColEnd) && (g.renderingColStart = e, g.renderingColEnd = e - 1, g.visibleColStart = e, g.visibleColEnd = e - 1);
|
|
3514
|
+
const M = `${g.renderingColStart}:${g.renderingColEnd}:${g.colAnchor}`;
|
|
3515
|
+
M !== Ae.current.key && P({ ...g, key: M });
|
|
3516
3516
|
}, [K, e, qe, Ve, re, ge, At]), [u, E] = Oe(0), O = d(null), te = w(() => {
|
|
3517
3517
|
O.current === null && (O.current = requestAnimationFrame(() => {
|
|
3518
3518
|
O.current = null, E(pe.current);
|
|
@@ -3532,37 +3532,37 @@ const ni = 1e4, yi = () => {
|
|
|
3532
3532
|
St.current = ie;
|
|
3533
3533
|
const He = d(null), [Dt, bt] = Oe(null), [Lt, Ht] = Oe(Ne.height);
|
|
3534
3534
|
Lt !== Ne.height && (Ht(Ne.height), bt(null));
|
|
3535
|
-
const Gt = z === void 0 || t === 0 ? 0 : oe(Math.trunc(z.row), 0, t - 1), Ot =
|
|
3536
|
-
const
|
|
3537
|
-
return fi(Math.max(0, Ne.height - et.current - xt.current), Pe, t,
|
|
3535
|
+
const Gt = z === void 0 || t === 0 ? 0 : oe(Math.trunc(z.row), 0, t - 1), Ot = Me(() => {
|
|
3536
|
+
const o = He.current?.renderingStartIndex ?? Gt;
|
|
3537
|
+
return fi(Math.max(0, Ne.height - et.current - xt.current), Pe, t, o, C);
|
|
3538
3538
|
}, [Ne.height, Pe, t, Gt, C, dt, ft]), sr = Dt ?? Ot, Kt = w(() => {
|
|
3539
|
-
const
|
|
3540
|
-
if (
|
|
3539
|
+
const o = He.current;
|
|
3540
|
+
if (o === null)
|
|
3541
3541
|
return null;
|
|
3542
|
-
const
|
|
3542
|
+
const g = Ae.current;
|
|
3543
3543
|
return {
|
|
3544
|
-
renderingRowStart:
|
|
3545
|
-
renderingRowEnd:
|
|
3546
|
-
visibleRowStart:
|
|
3547
|
-
visibleRowEnd:
|
|
3548
|
-
renderingColStart:
|
|
3549
|
-
renderingColEnd:
|
|
3550
|
-
visibleColStart:
|
|
3551
|
-
visibleColEnd:
|
|
3544
|
+
renderingRowStart: o.renderingStartIndex,
|
|
3545
|
+
renderingRowEnd: o.renderingEndIndex,
|
|
3546
|
+
visibleRowStart: o.visibleStartIndex,
|
|
3547
|
+
visibleRowEnd: o.visibleEndIndex,
|
|
3548
|
+
renderingColStart: g.renderingColStart,
|
|
3549
|
+
renderingColEnd: g.renderingColEnd,
|
|
3550
|
+
visibleColStart: g.visibleColStart,
|
|
3551
|
+
visibleColEnd: g.visibleColEnd,
|
|
3552
3552
|
scrollX: pe.current,
|
|
3553
|
-
scrollY:
|
|
3553
|
+
scrollY: we.current,
|
|
3554
3554
|
totalWidth: Fe.current,
|
|
3555
3555
|
// 帯高は鮮度加算 (格納はスクロール木のみ — 帯行リサイズ後も総高が正しい。R1 是正。
|
|
3556
3556
|
// 3.5.0: 末尾帯高 H_T も同じ鮮度規律で加算)
|
|
3557
|
-
totalHeight:
|
|
3557
|
+
totalHeight: o.totalHeight + et.current + xt.current
|
|
3558
3558
|
};
|
|
3559
3559
|
}, []), jt = w(() => {
|
|
3560
|
-
const
|
|
3561
|
-
|
|
3560
|
+
const o = Kt();
|
|
3561
|
+
o !== null && je.current?.(o);
|
|
3562
3562
|
}, [Kt]), gr = w(
|
|
3563
|
-
(
|
|
3564
|
-
const
|
|
3565
|
-
return M !== pe.current && (pe.current = M, Pt(), st(), te(), Ce.current?.({ x: M, y:
|
|
3563
|
+
(o) => {
|
|
3564
|
+
const g = kt(), M = oe(o, 0, g);
|
|
3565
|
+
return M !== pe.current && (pe.current = M, Pt(), st(), te(), Ce.current?.({ x: M, y: we.current })), M;
|
|
3566
3566
|
},
|
|
3567
3567
|
[Pt, st, te, kt]
|
|
3568
3568
|
), Mt = d(gr);
|
|
@@ -3572,81 +3572,87 @@ const ni = 1e4, yi = () => {
|
|
|
3572
3572
|
He.current !== null && jt();
|
|
3573
3573
|
}, [H, xe, jt]);
|
|
3574
3574
|
const Nt = d(null), Xt = w(
|
|
3575
|
-
(
|
|
3576
|
-
const
|
|
3577
|
-
return (
|
|
3575
|
+
(o) => {
|
|
3576
|
+
const g = oe(o.col, 0, Math.max(0, e - 1)), M = Ve.prefixSum(g, { materializeOption: { materialize: !1 } }), X = M.cumulative - M.currentValue, de = M.currentValue, rt = At();
|
|
3577
|
+
return (o.alignX === "end" ? X + de - Ke.current - rt : o.alignX === "center" ? X + de / 2 - Ke.current - rt / 2 : X - Ke.current) + o.offsetX;
|
|
3578
3578
|
},
|
|
3579
3579
|
[Ve, e, At]
|
|
3580
3580
|
), qt = d(null), Zt = w(() => {
|
|
3581
|
-
const
|
|
3582
|
-
qt.current = null, !(
|
|
3583
|
-
}, [Ve, ht]), rr = d({ count: 0, warned: !1 }), { frozenColumns: Qt, frozenWidth: It } =
|
|
3581
|
+
const o = qt.current;
|
|
3582
|
+
qt.current = null, !(o === null || o.length === 0) && (ht(Ve.updates(o)), Je((g) => g + 1));
|
|
3583
|
+
}, [Ve, ht]), rr = d({ count: 0, warned: !1 }), { frozenColumns: Qt, frozenWidth: It } = Me(() => {
|
|
3584
3584
|
if (re === 0)
|
|
3585
3585
|
return rr.current.count = 0, rr.current.warned = !1, { frozenColumns: mn, frozenWidth: 0 };
|
|
3586
|
-
const { columns:
|
|
3587
|
-
if (
|
|
3586
|
+
const { columns: o, widthUpdates: g, width: M } = pi(re, qe, Ve);
|
|
3587
|
+
if (g.length > 0) {
|
|
3588
3588
|
const X = rr.current;
|
|
3589
3589
|
X.count >= Or ? X.warned || (X.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the frozen band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
|
|
3590
3590
|
frozenCols: re,
|
|
3591
|
-
pendingUpdates:
|
|
3592
|
-
})) : (X.count += 1, qt.current = [...qt.current ?? [], ...
|
|
3591
|
+
pendingUpdates: g.length
|
|
3592
|
+
})) : (X.count += 1, qt.current = [...qt.current ?? [], ...g], Promise.resolve().then(Zt));
|
|
3593
3593
|
} else
|
|
3594
3594
|
rr.current.count = 0, rr.current.warned = !1;
|
|
3595
|
-
return { frozenColumns:
|
|
3595
|
+
return { frozenColumns: o, frozenWidth: M };
|
|
3596
3596
|
}, [re, j, qe, Ve, Zt]);
|
|
3597
3597
|
Ke.current = It, Qe(() => {
|
|
3598
3598
|
re > 0 ? Ye.current?.style.setProperty("--aqvs-grid-frozen-width", `${It}px`) : Ye.current?.style.removeProperty("--aqvs-grid-frozen-width");
|
|
3599
3599
|
}, [It, re]);
|
|
3600
|
-
const Ct = d({ count: 0, warned: !1 }), { trailingColumns: _t, trailingWidth: mt } =
|
|
3600
|
+
const Ct = d({ count: 0, warned: !1 }), { trailingColumns: _t, trailingWidth: mt } = Me(() => {
|
|
3601
3601
|
if (ge === 0)
|
|
3602
3602
|
return Ct.current.count = 0, Ct.current.warned = !1, { trailingColumns: mn, trailingWidth: 0 };
|
|
3603
|
-
const { columns:
|
|
3604
|
-
if (
|
|
3603
|
+
const { columns: o, widthUpdates: g, width: M } = gi(e, ge, qe, Ve);
|
|
3604
|
+
if (g.length > 0) {
|
|
3605
3605
|
const X = Ct.current;
|
|
3606
3606
|
X.count >= Or ? X.warned || (X.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the trailing band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
|
|
3607
3607
|
trailingCols: ge,
|
|
3608
|
-
pendingUpdates:
|
|
3609
|
-
})) : (X.count += 1, qt.current = [...qt.current ?? [], ...
|
|
3608
|
+
pendingUpdates: g.length
|
|
3609
|
+
})) : (X.count += 1, qt.current = [...qt.current ?? [], ...g], Promise.resolve().then(Zt));
|
|
3610
3610
|
} else
|
|
3611
3611
|
Ct.current.count = 0, Ct.current.warned = !1;
|
|
3612
|
-
return { trailingColumns:
|
|
3612
|
+
return { trailingColumns: o, trailingWidth: M };
|
|
3613
3613
|
}, [ge, e, j, qe, Ve, Zt]);
|
|
3614
3614
|
D.current = mt, Qe(() => {
|
|
3615
3615
|
ge > 0 ? Ye.current?.style.setProperty("--aqvs-grid-trailing-width", `${mt}px`) : Ye.current?.style.removeProperty("--aqvs-grid-trailing-width");
|
|
3616
3616
|
}, [mt, ge]);
|
|
3617
|
-
const Er =
|
|
3617
|
+
const Er = Me(() => ({ ...ce, tapScrollCircleOptions: { ...ce?.tapScrollCircleOptions, enabled: !1 } }), [ce]), $t = ce?.tapScrollCircleOptions, c = typeof $t?.maxSpeedMultiplier == "number", b = Me(
|
|
3618
3618
|
() => ({
|
|
3619
3619
|
...$t,
|
|
3620
3620
|
offsetX: $t?.offsetX === void 0 ? sn : $t.offsetX,
|
|
3621
3621
|
offsetY: $t?.offsetY === void 0 ? sn : $t.offsetY
|
|
3622
3622
|
}),
|
|
3623
3623
|
[$t]
|
|
3624
|
-
), m =
|
|
3624
|
+
), m = Me(() => Fr(b, Math.max(0, e - re - ge)), [b, e, re, ge]), W = Me(() => Fr(b, y), [b, y]), U = m.enabled, G = Math.max(m.maxVisualDistance, 1), J = {
|
|
3625
3625
|
viewportSize: Math.max(0, Ne.width - It - mt),
|
|
3626
3626
|
minSpeedMultiplier: m.minSpeedMultiplier,
|
|
3627
3627
|
maxSpeedMultiplier: m.maxSpeedMultiplier,
|
|
3628
3628
|
hasCustomMaxSpeedMultiplier: c,
|
|
3629
3629
|
curve: m.maxSpeedCurve
|
|
3630
|
-
},
|
|
3630
|
+
}, Se = {
|
|
3631
3631
|
viewportSize: Math.max(0, Ne.height - H - xe),
|
|
3632
3632
|
minSpeedMultiplier: W.minSpeedMultiplier,
|
|
3633
3633
|
maxSpeedMultiplier: W.maxSpeedMultiplier,
|
|
3634
3634
|
hasCustomMaxSpeedMultiplier: c,
|
|
3635
3635
|
curve: W.maxSpeedCurve
|
|
3636
|
-
}, Ue = w(() => pe.current, []), Le = w(() =>
|
|
3637
|
-
const
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
const
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
const
|
|
3644
|
-
return
|
|
3636
|
+
}, Ue = w(() => pe.current, []), Le = w(() => {
|
|
3637
|
+
const o = ue.current;
|
|
3638
|
+
if (o === null)
|
|
3639
|
+
return we.current;
|
|
3640
|
+
const g = o.getScrollPosition();
|
|
3641
|
+
return g < 0 ? we.current : g;
|
|
3642
|
+
}, []), ze = w(() => {
|
|
3643
|
+
const o = ue.current;
|
|
3644
|
+
return o === null ? 0 : Math.max(0, Math.max(0, o.getContentSize()) - Math.max(0, o.getViewportSize()));
|
|
3645
|
+
}, []), pt = w((o) => {
|
|
3646
|
+
const g = ue.current;
|
|
3647
|
+
if (g === null)
|
|
3648
|
+
return we.current;
|
|
3649
|
+
const M = g.scrollBy(o);
|
|
3650
|
+
return we.current = M, M;
|
|
3645
3651
|
}, []), ot = kt() > 0 || ze() > 0, gt = `${$e}:${It}:${mt}:${Ne.width}:${p.key}`, nr = `${t}:${Dt ?? -1}:${H}:${xe}:${Ne.height}`, { isTapActive: or, handleTapCircleDragChange: Mn, tapCircleHandleRef: In } = ii({
|
|
3646
3652
|
enabled: U && ot,
|
|
3647
3653
|
maxDistance: G,
|
|
3648
3654
|
xSpeedParams: J,
|
|
3649
|
-
ySpeedParams:
|
|
3655
|
+
ySpeedParams: Se,
|
|
3650
3656
|
applyHxRef: Mt,
|
|
3651
3657
|
getHx: Ue,
|
|
3652
3658
|
getMaxHx: kt,
|
|
@@ -3656,54 +3662,54 @@ const ni = 1e4, yi = () => {
|
|
|
3656
3662
|
pendingColAnchorRef: Nt,
|
|
3657
3663
|
xExtentFreshness: gt,
|
|
3658
3664
|
yExtentFreshness: nr
|
|
3659
|
-
}), yn =
|
|
3665
|
+
}), yn = Me(() => oe((or ? 1 : 0.8) * m.opacity, 0, 1), [or, m.opacity]);
|
|
3660
3666
|
Qe(() => {
|
|
3661
|
-
const
|
|
3662
|
-
|
|
3667
|
+
const o = Nt.current;
|
|
3668
|
+
o === null ? Mt.current(pe.current) : Mt.current(Xt(o)), st();
|
|
3663
3669
|
}, [Ne.width, $e, j, It, mt, st, Xt]);
|
|
3664
3670
|
const $r = d(!1);
|
|
3665
3671
|
Qe(() => {
|
|
3666
3672
|
if ($r.current || z === void 0 || e === 0)
|
|
3667
3673
|
return;
|
|
3668
3674
|
$r.current = !0;
|
|
3669
|
-
const
|
|
3670
|
-
if (
|
|
3675
|
+
const o = oe(Math.trunc(z.col), 0, e - 1);
|
|
3676
|
+
if (o < re || o >= e - ge)
|
|
3671
3677
|
return;
|
|
3672
|
-
const
|
|
3673
|
-
Nt.current =
|
|
3678
|
+
const g = { col: o, alignX: "start", offsetX: Math.max(0, z.offsetX) };
|
|
3679
|
+
Nt.current = g, Mt.current(Xt(g));
|
|
3674
3680
|
}, [z, e, Xt, re, ge]);
|
|
3675
|
-
const Tn = w((
|
|
3676
|
-
|
|
3681
|
+
const Tn = w((o) => {
|
|
3682
|
+
we.current = o, wt.current = !0, Ce.current?.({ x: pe.current, y: o });
|
|
3677
3683
|
}, []), Yr = w(
|
|
3678
|
-
(
|
|
3684
|
+
(o) => {
|
|
3679
3685
|
if (y === 0 || vt.current)
|
|
3680
|
-
He.current = { renderingStartIndex: t, renderingEndIndex: t - 1, visibleStartIndex: t, visibleEndIndex: t - 1, scrollPosition: 0, totalHeight: y === 0 ? 0 :
|
|
3686
|
+
He.current = { renderingStartIndex: t, renderingEndIndex: t - 1, visibleStartIndex: t, visibleEndIndex: t - 1, scrollPosition: 0, totalHeight: y === 0 ? 0 : o.totalHeight }, we.current = 0;
|
|
3681
3687
|
else {
|
|
3682
|
-
const
|
|
3688
|
+
const g = Z;
|
|
3683
3689
|
He.current = {
|
|
3684
|
-
renderingStartIndex:
|
|
3685
|
-
renderingEndIndex:
|
|
3686
|
-
visibleStartIndex:
|
|
3687
|
-
visibleEndIndex:
|
|
3688
|
-
scrollPosition:
|
|
3689
|
-
totalHeight:
|
|
3690
|
-
},
|
|
3690
|
+
renderingStartIndex: o.renderingStartIndex + g,
|
|
3691
|
+
renderingEndIndex: o.renderingEndIndex + g,
|
|
3692
|
+
visibleStartIndex: o.visibleStartIndex + g,
|
|
3693
|
+
visibleEndIndex: o.visibleEndIndex + g,
|
|
3694
|
+
scrollPosition: o.scrollPosition,
|
|
3695
|
+
totalHeight: o.totalHeight
|
|
3696
|
+
}, we.current = o.scrollPosition;
|
|
3691
3697
|
}
|
|
3692
|
-
bt((
|
|
3693
|
-
const M = Math.max(1,
|
|
3694
|
-
return M ===
|
|
3698
|
+
bt((g) => {
|
|
3699
|
+
const M = Math.max(1, o.renderingEndIndex - o.renderingStartIndex + 1);
|
|
3700
|
+
return M === g ? g : M;
|
|
3695
3701
|
}), jt();
|
|
3696
3702
|
},
|
|
3697
3703
|
[jt, Z, y, t]
|
|
3698
|
-
), Wr = w((
|
|
3699
|
-
Nt.current = null, Mt.current(pe.current +
|
|
3700
|
-
}, []), Br = di(Y, sr + h.length + he.length), zr = d({ count: 0, warned: !1 }), { placedColumns: xr, truncatedCols: br } =
|
|
3701
|
-
const
|
|
3702
|
-
if (e === 0 ||
|
|
3704
|
+
), Wr = w((o) => {
|
|
3705
|
+
Nt.current = null, Mt.current(pe.current + o);
|
|
3706
|
+
}, []), Br = di(Y, sr + h.length + he.length), zr = d({ count: 0, warned: !1 }), { placedColumns: xr, truncatedCols: br } = Me(() => {
|
|
3707
|
+
const o = Math.max(0, Ne.width - It - mt);
|
|
3708
|
+
if (e === 0 || o <= 0)
|
|
3703
3709
|
return { placedColumns: [], truncatedCols: 0 };
|
|
3704
3710
|
if (p.renderingColStart > p.renderingColEnd)
|
|
3705
3711
|
return { placedColumns: [], truncatedCols: 0 };
|
|
3706
|
-
const
|
|
3712
|
+
const g = Math.max(1, Br - Qt.length - _t.length), { columns: M, widthUpdates: X, truncated: de } = mi(oe(p.renderingColStart, 0, e - 1), oe(p.renderingColEnd, 0, e - 1), qe, Ve, g);
|
|
3707
3713
|
if (X.length > 0) {
|
|
3708
3714
|
const rt = zr.current;
|
|
3709
3715
|
rt.count >= Or ? rt.warned || (rt.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values; width self-heal is suspended until a converged (zero-deviation) pass re-arms it (unstable accessor — the accessor must be index-stable while the ordering is unchanged).", {
|
|
@@ -3716,44 +3722,44 @@ const ni = 1e4, yi = () => {
|
|
|
3716
3722
|
}, [p, e, Ne.width, It, mt, Qt.length, _t.length, j, qe, Ve, Br, Zt]), Ur = d("");
|
|
3717
3723
|
q(() => {
|
|
3718
3724
|
if (br > 0) {
|
|
3719
|
-
const
|
|
3720
|
-
|
|
3725
|
+
const o = `${p.key}:${br}`;
|
|
3726
|
+
o !== Ur.current && (Ur.current = o, St.current?.({ renderedCells: (xr.length + Qt.length + _t.length) * (sr + h.length + he.length), droppedCols: br }));
|
|
3721
3727
|
}
|
|
3722
3728
|
}, [br, p.key, xr.length, Qt.length, _t.length, sr, h.length, he.length]);
|
|
3723
3729
|
const Gr = p.colAnchor, Nr = w(
|
|
3724
|
-
(
|
|
3725
|
-
const
|
|
3726
|
-
const Ft = l?.(
|
|
3727
|
-
return /* @__PURE__ */ Cr("div", { ...Ft, key: s ? s(
|
|
3730
|
+
(o) => {
|
|
3731
|
+
const g = f?.(o), M = Pe(o) === 0, X = M ? null : xr.map(({ col: de, left: rt, width: cr }) => {
|
|
3732
|
+
const Ft = l?.(o, de), dr = { ...Ft?.style, left: rt - Gr, width: cr };
|
|
3733
|
+
return /* @__PURE__ */ Cr("div", { ...Ft, key: s ? s(o, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, a(i(o, de), o, de));
|
|
3728
3734
|
});
|
|
3729
|
-
return re === 0 && ge === 0 ? /* @__PURE__ */ Q("div", { ...
|
|
3735
|
+
return re === 0 && ge === 0 ? /* @__PURE__ */ Q("div", { ...g, className: Et("aqvs-grid-row", g?.className), style: g?.style, children: X }) : /* @__PURE__ */ Wt("div", { ...g, "data-aqvs-frozen-row": re > 0 ? "" : void 0, className: Et("aqvs-grid-row aqvs-grid-row-frozen-host", g?.className), style: g?.style, children: [
|
|
3730
3736
|
M ? null : Qt.map(({ col: de, left: rt, width: cr }) => {
|
|
3731
|
-
const Ft = l?.(
|
|
3732
|
-
return /* @__PURE__ */ Cr("div", { ...Ft, "data-aqvs-frozen-cell": "", key: s ? s(
|
|
3737
|
+
const Ft = l?.(o, de), dr = { ...Ft?.style, left: rt, width: cr };
|
|
3738
|
+
return /* @__PURE__ */ Cr("div", { ...Ft, "data-aqvs-frozen-cell": "", key: s ? s(o, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, a(i(o, de), o, de));
|
|
3733
3739
|
}),
|
|
3734
3740
|
M ? null : /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-scroll", children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-scroll-inner", children: X }) }),
|
|
3735
3741
|
M || ge === 0 ? null : /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-trailing-inner", children: _t.map(({ col: de, left: rt, width: cr }) => {
|
|
3736
|
-
const Ft = l?.(
|
|
3737
|
-
return /* @__PURE__ */ Cr("div", { ...Ft, "data-aqvs-trailing-cell": "", key: s ? s(
|
|
3742
|
+
const Ft = l?.(o, de), dr = { ...Ft?.style, left: rt, width: cr };
|
|
3743
|
+
return /* @__PURE__ */ Cr("div", { ...Ft, "data-aqvs-trailing-cell": "", key: s ? s(o, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, a(i(o, de), o, de));
|
|
3738
3744
|
}) }) })
|
|
3739
3745
|
] });
|
|
3740
3746
|
},
|
|
3741
|
-
[xr, Qt, _t, re, ge, Gr, f, l, s, i,
|
|
3747
|
+
[xr, Qt, _t, re, ge, Gr, f, l, s, i, a, Pe]
|
|
3742
3748
|
), [Rn, Pn] = Oe(""), ar = d(null), Kr = d(k);
|
|
3743
3749
|
Kr.current = k;
|
|
3744
3750
|
const vr = w(() => {
|
|
3745
|
-
const
|
|
3746
|
-
if (
|
|
3751
|
+
const o = Kr.current;
|
|
3752
|
+
if (o === void 0)
|
|
3747
3753
|
return;
|
|
3748
|
-
const
|
|
3749
|
-
Number.isFinite(
|
|
3754
|
+
const g = o.debounceMs ?? 400;
|
|
3755
|
+
Number.isFinite(g) && g >= 0 && (ar.current !== null && window.clearTimeout(ar.current), ar.current = window.setTimeout(() => {
|
|
3750
3756
|
ar.current = null;
|
|
3751
3757
|
const M = Kt();
|
|
3752
3758
|
M !== null && Pn((X) => {
|
|
3753
|
-
const de =
|
|
3759
|
+
const de = o.buildMessage(M);
|
|
3754
3760
|
return de === X ? X : de;
|
|
3755
3761
|
});
|
|
3756
|
-
},
|
|
3762
|
+
}, g));
|
|
3757
3763
|
}, [Kt]), wr = k?.debounceMs ?? 400, jr = Number.isFinite(wr) && wr >= 0, Zr = k !== void 0;
|
|
3758
3764
|
q(() => {
|
|
3759
3765
|
Zr && !jr && V.warn(`[VirtualGrid] liveRegion.debounceMs must be a finite number >= 0, received ${wr}. Announcements are disabled.`);
|
|
@@ -3766,67 +3772,67 @@ const ni = 1e4, yi = () => {
|
|
|
3766
3772
|
vr();
|
|
3767
3773
|
}, [p, vr]);
|
|
3768
3774
|
const En = w(
|
|
3769
|
-
(
|
|
3770
|
-
Yr(
|
|
3775
|
+
(o) => {
|
|
3776
|
+
Yr(o), vr();
|
|
3771
3777
|
},
|
|
3772
3778
|
[Yr, vr]
|
|
3773
3779
|
);
|
|
3774
3780
|
return Pr(
|
|
3775
3781
|
le,
|
|
3776
3782
|
() => ({
|
|
3777
|
-
scrollTo: (
|
|
3778
|
-
const
|
|
3779
|
-
let M =
|
|
3780
|
-
|
|
3783
|
+
scrollTo: (o) => {
|
|
3784
|
+
const g = ue.current;
|
|
3785
|
+
let M = we.current;
|
|
3786
|
+
o.y !== void 0 && g !== null && (g.scrollTo(o.y), M = g.getScrollPosition(), we.current = M);
|
|
3781
3787
|
let X = pe.current;
|
|
3782
|
-
return
|
|
3788
|
+
return o.x !== void 0 && (Nt.current = null, X = Mt.current(o.x)), { x: X, y: M };
|
|
3783
3789
|
},
|
|
3784
|
-
scrollBy: (
|
|
3785
|
-
const
|
|
3786
|
-
let M =
|
|
3787
|
-
|
|
3790
|
+
scrollBy: (o) => {
|
|
3791
|
+
const g = ue.current;
|
|
3792
|
+
let M = we.current;
|
|
3793
|
+
o.y !== void 0 && o.y !== 0 && g !== null && (M = g.scrollBy(o.y), we.current = M);
|
|
3788
3794
|
let X = pe.current;
|
|
3789
|
-
return
|
|
3795
|
+
return o.x !== void 0 && o.x !== 0 && (Nt.current = null, X = Mt.current(pe.current + o.x)), { x: X, y: M };
|
|
3790
3796
|
},
|
|
3791
|
-
scrollToCell: (
|
|
3797
|
+
scrollToCell: (o, g, M) => {
|
|
3792
3798
|
const X = ue.current;
|
|
3793
3799
|
if (X !== null && t > 0) {
|
|
3794
|
-
const de = oe(Math.trunc(
|
|
3800
|
+
const de = oe(Math.trunc(o), 0, t - 1);
|
|
3795
3801
|
de >= Z && de < t - We && X.scrollToIndex(de - Z, { align: M?.alignY ?? "top", offset: M?.offsetY });
|
|
3796
3802
|
}
|
|
3797
3803
|
if (e > 0) {
|
|
3798
|
-
const de = oe(Math.trunc(
|
|
3804
|
+
const de = oe(Math.trunc(g), 0, e - 1);
|
|
3799
3805
|
if (de >= re && de < e - ge) {
|
|
3800
3806
|
const rt = { col: de, alignX: M?.alignX ?? "start", offsetX: M?.offsetX ?? 0 };
|
|
3801
3807
|
Nt.current = rt, Mt.current(Xt(rt));
|
|
3802
3808
|
}
|
|
3803
3809
|
}
|
|
3804
3810
|
},
|
|
3805
|
-
getScrollPosition: () => wt.current || ue.current !== null ? { x: pe.current, y: ue.current?.getScrollPosition() ??
|
|
3811
|
+
getScrollPosition: () => wt.current || ue.current !== null ? { x: pe.current, y: ue.current?.getScrollPosition() ?? we.current } : { x: -1, y: -1 },
|
|
3806
3812
|
getScrollAnchor: () => {
|
|
3807
3813
|
if (t === 0 || e === 0)
|
|
3808
3814
|
return null;
|
|
3809
|
-
const
|
|
3810
|
-
if (
|
|
3815
|
+
const o = ue.current?.getScrollAnchor() ?? null;
|
|
3816
|
+
if (o === null)
|
|
3811
3817
|
return null;
|
|
3812
|
-
const
|
|
3818
|
+
const g = Ke.current + pe.current, M = Ve.findIndexAtOrAfter(g, { materializeOption: { materialize: !1 } });
|
|
3813
3819
|
if (M.index === -1)
|
|
3814
|
-
return { row:
|
|
3815
|
-
if (M.cumulative ===
|
|
3816
|
-
return { row:
|
|
3820
|
+
return { row: o.index + Z, col: e - 1, offsetX: 0, offsetY: o.offsetPx };
|
|
3821
|
+
if (M.cumulative === g)
|
|
3822
|
+
return { row: o.index + Z, col: oe(M.index + 1, 0, e - 1), offsetX: 0, offsetY: o.offsetPx };
|
|
3817
3823
|
const X = (M.cumulative ?? 0) - (M.currentValue ?? 0);
|
|
3818
|
-
return { row:
|
|
3824
|
+
return { row: o.index + Z, col: M.index, offsetX: Math.max(0, g - X), offsetY: o.offsetPx };
|
|
3819
3825
|
},
|
|
3820
3826
|
getViewportSize: () => ({ width: zt.current.width, height: zt.current.height }),
|
|
3821
3827
|
// 縦はインセット込みの行側 getContentSize を単一情報源にする (range.totalHeight は木総高のみ)。
|
|
3822
3828
|
// 3.5.0: height = H_F + 埋め込み + H_T
|
|
3823
3829
|
getContentSize: () => ({ width: Fe.current, height: ue.current === null ? 0 : et.current + xt.current + Math.max(0, ue.current.getContentSize()) }),
|
|
3824
3830
|
getRange: Kt,
|
|
3825
|
-
updateRowSize: (
|
|
3826
|
-
Ir(
|
|
3831
|
+
updateRowSize: (o, g) => {
|
|
3832
|
+
Ir(g, "row", o), Math.trunc(o) < Z ? Tt((M) => M + 1) : We > 0 && Math.trunc(o) >= t - We ? ne((M) => M + 1) : ue.current?.updateItemSize(Math.trunc(o) - Z, g);
|
|
3827
3833
|
},
|
|
3828
|
-
updateColSize: (
|
|
3829
|
-
Ir(
|
|
3834
|
+
updateColSize: (o, g) => {
|
|
3835
|
+
Ir(g, "col", o), ht(Ve.update(oe(Math.trunc(o), 0, Math.max(0, e - 1)), g)), Je((M) => M + 1);
|
|
3830
3836
|
},
|
|
3831
3837
|
getFrozenSize: () => ({
|
|
3832
3838
|
cols: re,
|
|
@@ -3841,26 +3847,26 @@ const ni = 1e4, yi = () => {
|
|
|
3841
3847
|
trailingVisibleWidth: yr(D.current, Ke.current, zt.current.width),
|
|
3842
3848
|
trailingVisibleHeight: yr(xt.current, et.current, zt.current.height)
|
|
3843
3849
|
}),
|
|
3844
|
-
applyWheel: (
|
|
3845
|
-
focusRowAtIndex: (
|
|
3846
|
-
const M = Math.trunc(
|
|
3847
|
-
M < Z ? Ye.current?.querySelector(`[data-aqvs-frozen-band-row="${M}"]`)?.focus() : We > 0 && M >= t - We ? Ye.current?.querySelector(`[data-aqvs-trailing-band-row="${M}"]`)?.focus() : ue.current?.focusItemAtIndex(M - Z,
|
|
3850
|
+
applyWheel: (o) => ue.current?.applyWheel(o) ?? !1,
|
|
3851
|
+
focusRowAtIndex: (o, g) => {
|
|
3852
|
+
const M = Math.trunc(o);
|
|
3853
|
+
M < Z ? Ye.current?.querySelector(`[data-aqvs-frozen-band-row="${M}"]`)?.focus() : We > 0 && M >= t - We ? Ye.current?.querySelector(`[data-aqvs-trailing-band-row="${M}"]`)?.focus() : ue.current?.focusItemAtIndex(M - Z, g);
|
|
3848
3854
|
}
|
|
3849
3855
|
}),
|
|
3850
3856
|
[t, e, Ve, Kt, ht, Xt, re, Z, ge, We]
|
|
3851
|
-
), /* @__PURE__ */ Wt("div", { ref: Ye, className: Et("aqvs-grid", Z > 0 ? "aqvs-grid-has-frozen-rows" : "", We > 0 ? "aqvs-grid-has-trailing-rows" : "",
|
|
3857
|
+
), /* @__PURE__ */ Wt("div", { ref: Ye, className: Et("aqvs-grid", Z > 0 ? "aqvs-grid-has-frozen-rows" : "", We > 0 ? "aqvs-grid-has-trailing-rows" : "", Te), "data-testid": I, children: [
|
|
3852
3858
|
Z > 0 ? (
|
|
3853
3859
|
// 凍結行帯 (行凍結設計 §4-2): グリッド所有の帯外バンド — 行本体は renderRow を
|
|
3854
3860
|
// そのまま再利用する (F > 0 の凍結セル / クリップ / hx 残差 var は継承で無償追随
|
|
3855
3861
|
// = 4 象限コーナーの成立点)。top は木絶対プレフィックス、高さ 0 行は DOM 非生成
|
|
3856
|
-
/* @__PURE__ */ Q("div", { className: "aqvs-grid-frozen-rows", style: { height: H }, "data-testid": I ? `${I}-frozen-rows` : void 0, children: h.map(({ row:
|
|
3862
|
+
/* @__PURE__ */ Q("div", { className: "aqvs-grid-frozen-rows", style: { height: H }, "data-testid": I ? `${I}-frozen-rows` : void 0, children: h.map(({ row: o, top: g, height: M }) => (
|
|
3857
3863
|
// 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README
|
|
3858
3864
|
// 「Composite widget roles」) の所有物で、パッケージが既定 role を課すと衝突する。
|
|
3859
3865
|
// フォーカス結線は focusRowAtIndex ↔ onRowFocus 往復のバンド版そのもの。右インセット
|
|
3860
3866
|
// (right: scrollBarWidth + overflow クリップ) は縦バーコーナーの予約 — ペインの
|
|
3861
3867
|
// クリップ箱 (root − バー幅) と帯のクリップ箱を一致させる (R1 是正)。
|
|
3862
3868
|
// biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (上記)
|
|
3863
|
-
/* @__PURE__ */ Q("div", { "data-aqvs-frozen-band-row":
|
|
3869
|
+
/* @__PURE__ */ Q("div", { "data-aqvs-frozen-band-row": o, className: "aqvs-grid-frozen-band-row", style: { top: g, height: M, right: ke }, tabIndex: -1, onFocus: () => T?.(o), children: Nr(o) }, o)
|
|
3864
3870
|
)) })
|
|
3865
3871
|
) : null,
|
|
3866
3872
|
/* @__PURE__ */ Q("div", { className: "aqvs-grid-main", "data-testid": I ? `${I}-main` : void 0, children: /* @__PURE__ */ Q(
|
|
@@ -3868,20 +3874,20 @@ const ni = 1e4, yi = () => {
|
|
|
3868
3874
|
{
|
|
3869
3875
|
ref: ue,
|
|
3870
3876
|
itemCount: tr ? 0 : y,
|
|
3871
|
-
getItem: (
|
|
3872
|
-
getItemKey: (
|
|
3877
|
+
getItem: (o) => o + Z,
|
|
3878
|
+
getItemKey: (o) => o + Z,
|
|
3873
3879
|
getItemHeight: ve,
|
|
3874
3880
|
overscanCount: C,
|
|
3875
3881
|
viewportSize: Ne.height > 0 ? Math.max(0, Ne.height - H - xe) : void 0,
|
|
3876
3882
|
callbackThrottleMs: L,
|
|
3877
3883
|
behaviorOptions: ae,
|
|
3878
3884
|
scrollBarOptions: Er,
|
|
3879
|
-
contentProps:
|
|
3885
|
+
contentProps: x,
|
|
3880
3886
|
background: v,
|
|
3881
3887
|
contentInsets: R,
|
|
3882
3888
|
onItemFocus: me,
|
|
3883
|
-
horizontalKeyInputs:
|
|
3884
|
-
horizontalKeyStep:
|
|
3889
|
+
horizontalKeyInputs: Ie,
|
|
3890
|
+
horizontalKeyStep: ye,
|
|
3885
3891
|
initialScrollAnchor: (
|
|
3886
3892
|
// トグル済みなら視点保存 (捕捉アンカー) のみ — 捕捉 null は undefined (先頭)
|
|
3887
3893
|
// へ落とし、消費済みマウント props の蘇りを断つ (R2 是正)。未トグルのみ
|
|
@@ -3904,11 +3910,11 @@ const ni = 1e4, yi = () => {
|
|
|
3904
3910
|
// inner はインライン木高 H_T の bottom 定着 — 帯上端 = extent − H_T_vis が全構成で
|
|
3905
3911
|
// 成立し、重複縮退では帯の**末尾**行が可視に残る。行本体は renderRow 逐語再利用
|
|
3906
3912
|
// (先頭列 / 末尾列の帯構造を継承し 4 象限コーナー全種が無償で成立)
|
|
3907
|
-
/* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows", style: { height: yr(xe, H, Ne.height) }, "data-testid": I ? `${I}-trailing-rows` : void 0, children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: xe }, children: he.map(({ row:
|
|
3913
|
+
/* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows", style: { height: yr(xe, H, Ne.height) }, "data-testid": I ? `${I}-trailing-rows` : void 0, children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: xe }, children: he.map(({ row: o, top: g, height: M }) => (
|
|
3908
3914
|
// 帯行は帯ローカル top + right: scrollBarWidth (縦バーコーナーの予約 — 先頭帯行と
|
|
3909
3915
|
// 同文) + tabIndex −1 + onFocus フル行 index (focusRowAtIndex ↔ onRowFocus 往復)。
|
|
3910
3916
|
// biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (先頭帯行と同文)
|
|
3911
|
-
/* @__PURE__ */ Q("div", { "data-aqvs-trailing-band-row":
|
|
3917
|
+
/* @__PURE__ */ Q("div", { "data-aqvs-trailing-band-row": o, className: "aqvs-grid-trailing-band-row", style: { top: g, height: M, right: ke }, tabIndex: -1, onFocus: () => T?.(o), children: Nr(o) }, o)
|
|
3912
3918
|
)) }) })
|
|
3913
3919
|
) : null,
|
|
3914
3920
|
/* @__PURE__ */ Q("div", { className: "aqvs-grid-hbar-strip", style: { height: ke, paddingRight: ge > 0 ? ke + yr(mt, It, Ne.width) : ke }, "data-testid": I ? `${I}-hbar` : void 0, children: /* @__PURE__ */ Q(
|
|
@@ -3920,7 +3926,7 @@ const ni = 1e4, yi = () => {
|
|
|
3920
3926
|
scrollPosition: u,
|
|
3921
3927
|
itemCount: Math.max(0, e - re - ge),
|
|
3922
3928
|
tapScrollCircleOptions: ce?.tapScrollCircleOptions,
|
|
3923
|
-
onScroll: (
|
|
3929
|
+
onScroll: (o, g) => (Nt.current = null, Mt.current(typeof o == "function" ? o(g ?? pe.current) : o)),
|
|
3924
3930
|
scrollBarWidth: ke
|
|
3925
3931
|
}
|
|
3926
3932
|
) }),
|