@aiquants/virtualscroll 3.7.0 → 3.7.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 +25 -0
- package/README.md +19 -0
- package/dist/ScrollBar.d.ts.map +1 -1
- package/dist/ScrollPane.d.ts.map +1 -1
- package/dist/TapScrollCircle.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1302 -1332
- package/dist/pointerCapture.d.cts +68 -0
- package/dist/pointerCapture.d.ts +69 -0
- package/dist/pointerCapture.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/ScrollBar.tsx +20 -34
- package/src/ScrollPane.tsx +45 -18
- package/src/TapScrollCircle.tsx +35 -25
- package/src/pointerCapture.ts +89 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as U, jsxs as qt, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { twMerge as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as U, jsxs as qt, Fragment as Gr } from "react/jsx-runtime";
|
|
2
|
+
import kn, { memo as Hn, forwardRef as Cr, useState as _e, useRef as d, useCallback as w, useImperativeHandle as Ar, useMemo as Me, useLayoutEffect as Je, useEffect as X, useId as $n, createElement as Or } from "react";
|
|
3
|
+
import { twMerge as Nt } from "tailwind-merge";
|
|
4
|
+
const Mn = ["en", "ja"], Xr = ["scrollUp", "scrollDown", "scrollLeft", "scrollRight", "scrollToTop", "scrollToBottom", "noItems"], Xn = Object.freeze({
|
|
5
5
|
en: Object.freeze({
|
|
6
6
|
scrollUp: "Scroll up",
|
|
7
7
|
scrollDown: "Scroll down",
|
|
@@ -20,33 +20,33 @@ const wn = ["en", "ja"], Hr = ["scrollUp", "scrollDown", "scrollLeft", "scrollRi
|
|
|
20
20
|
scrollToBottom: "末尾へ",
|
|
21
21
|
noItems: "項目がありません"
|
|
22
22
|
})
|
|
23
|
-
}),
|
|
23
|
+
}), qn = (t) => Mn.includes(t), qr = (t) => typeof t == "string" ? JSON.stringify(t) : t === null ? "null" : typeof t, Yn = (t) => {
|
|
24
24
|
if (t === void 0)
|
|
25
25
|
return "en";
|
|
26
|
-
if (
|
|
26
|
+
if (qn(t))
|
|
27
27
|
return t;
|
|
28
|
-
const e =
|
|
29
|
-
throw new RangeError(`[virtualscroll] locale must be one of ${e}; got ${
|
|
30
|
-
},
|
|
31
|
-
const r =
|
|
28
|
+
const e = Mn.map((r) => JSON.stringify(r)).join(", ");
|
|
29
|
+
throw new RangeError(`[virtualscroll] locale must be one of ${e}; got ${qr(t)}`);
|
|
30
|
+
}, Bn = (t) => Xr.includes(t), In = (t, e) => {
|
|
31
|
+
const r = Xn[Yn(t)];
|
|
32
32
|
if (e === void 0)
|
|
33
33
|
return r;
|
|
34
34
|
if (e === null || typeof e != "object")
|
|
35
|
-
throw new RangeError(`[virtualscroll] labels must be an object; got ${
|
|
35
|
+
throw new RangeError(`[virtualscroll] labels must be an object; got ${qr(e)}`);
|
|
36
36
|
const n = Object.getPrototypeOf(e);
|
|
37
37
|
if (n !== Object.prototype && n !== null)
|
|
38
38
|
throw new RangeError(`[virtualscroll] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(e) ? "an array" : "an object with a non-plain prototype"}`);
|
|
39
39
|
const i = new Set(Object.keys(e));
|
|
40
40
|
for (const o of i)
|
|
41
|
-
if (
|
|
42
|
-
throw new RangeError(`[virtualscroll] labels.${o} is not a known label key; expected one of ${
|
|
41
|
+
if (!Bn(o))
|
|
42
|
+
throw new RangeError(`[virtualscroll] labels.${o} is not a known label key; expected one of ${Xr.join(", ")}`);
|
|
43
43
|
const s = { ...r };
|
|
44
|
-
for (const o of
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
if (typeof
|
|
48
|
-
throw new RangeError(`[virtualscroll] labels.${o} must be a non-blank string; got ${
|
|
49
|
-
s[o] =
|
|
44
|
+
for (const o of Xr) {
|
|
45
|
+
const l = i.has(o) ? e[o] : void 0;
|
|
46
|
+
if (l !== void 0) {
|
|
47
|
+
if (typeof l != "string" || l.trim() === "")
|
|
48
|
+
throw new RangeError(`[virtualscroll] labels.${o} must be a non-blank string; got ${qr(l)}`);
|
|
49
|
+
s[o] = l;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return Object.freeze(s);
|
|
@@ -196,16 +196,26 @@ class A {
|
|
|
196
196
|
this.level <= 3 && this.impl.error(...this.formatMessage(A.resolveLazy(e)), ...r.map(A.resolveLazy));
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
const
|
|
199
|
+
const yn = (t) => typeof t.setPointerCapture == "function" && typeof t.releasePointerCapture == "function" && typeof t.hasPointerCapture == "function", Tn = (t, e) => yn(t) && t.hasPointerCapture(e), wr = (t, e) => {
|
|
200
|
+
if (!yn(t))
|
|
201
|
+
return "unsupported";
|
|
202
|
+
try {
|
|
203
|
+
return t.setPointerCapture(e), "captured";
|
|
204
|
+
} catch (r) {
|
|
205
|
+
return (typeof r == "object" && r !== null && "name" in r ? r.name : void 0) === "NotFoundError" ? "inactive-pointer" : "rejected";
|
|
206
|
+
}
|
|
207
|
+
}, sr = (t, e) => {
|
|
208
|
+
Tn(t, e) && t.releasePointerCapture(e);
|
|
209
|
+
}, on = {
|
|
200
210
|
active: !1,
|
|
201
211
|
offsetX: 0,
|
|
202
212
|
offsetY: 0,
|
|
203
213
|
distance: 0,
|
|
204
214
|
direction: 0,
|
|
205
215
|
pointerId: null
|
|
206
|
-
},
|
|
216
|
+
}, Pr = 6, Wn = 8, Un = ({ dragState: t, normalizedDistance: e }) => {
|
|
207
217
|
const r = 1 + e * 0.18, n = 0.16 + e * 0.24, i = 0.38 + e * 0.28, s = t.active ? "80ms ease-out" : "220ms ease";
|
|
208
|
-
return /* @__PURE__ */ qt(
|
|
218
|
+
return /* @__PURE__ */ qt(Gr, { children: [
|
|
209
219
|
/* @__PURE__ */ U(
|
|
210
220
|
"div",
|
|
211
221
|
{
|
|
@@ -231,44 +241,44 @@ const nn = {
|
|
|
231
241
|
}
|
|
232
242
|
)
|
|
233
243
|
] });
|
|
234
|
-
},
|
|
235
|
-
Cr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: o, axis:
|
|
236
|
-
const [g,
|
|
244
|
+
}, jr = Hn(
|
|
245
|
+
Cr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: o, axis: l = "y" }, f) => {
|
|
246
|
+
const [g, x] = _e(on), R = d(null), T = d(null), S = d({ x: 0, y: 0 }), N = d(null), j = d(0), F = w(
|
|
237
247
|
(y) => {
|
|
238
|
-
|
|
248
|
+
x(y), t(y);
|
|
239
249
|
},
|
|
240
250
|
[t]
|
|
241
251
|
), Te = w(
|
|
242
|
-
(y,
|
|
243
|
-
const { x:
|
|
244
|
-
let
|
|
245
|
-
if (
|
|
246
|
-
|
|
252
|
+
(y, re, ne = !1) => {
|
|
253
|
+
const { x: Xe, y: de } = S.current, Ue = y - Xe, xe = re - de;
|
|
254
|
+
let te, Qe;
|
|
255
|
+
if (l === "xy")
|
|
256
|
+
te = Math.hypot(Ue, xe), Qe = te < Pr ? 0 : 1;
|
|
247
257
|
else {
|
|
248
|
-
const qe =
|
|
249
|
-
|
|
258
|
+
const qe = l === "x" ? Ue : xe;
|
|
259
|
+
te = Math.abs(qe), Qe = te < Pr ? 0 : qe < 0 ? -1 : 1;
|
|
250
260
|
}
|
|
251
|
-
const at =
|
|
261
|
+
const at = j.current;
|
|
252
262
|
let et = Qe;
|
|
253
|
-
const wt =
|
|
254
|
-
Qe === 0 ? at !== 0 &&
|
|
255
|
-
active: ne ||
|
|
256
|
-
offsetX:
|
|
263
|
+
const wt = Pr + Wn;
|
|
264
|
+
Qe === 0 ? at !== 0 && te < wt ? et = at : (et = 0, ne || (j.current = 0)) : Qe !== at && at !== 0 && te < wt ? et = at : j.current = Qe, F({
|
|
265
|
+
active: ne || te >= Pr,
|
|
266
|
+
offsetX: Ue,
|
|
257
267
|
offsetY: xe,
|
|
258
|
-
distance:
|
|
268
|
+
distance: te,
|
|
259
269
|
direction: et,
|
|
260
270
|
pointerId: R.current
|
|
261
271
|
});
|
|
262
272
|
},
|
|
263
|
-
[F,
|
|
273
|
+
[F, l]
|
|
264
274
|
), ze = w((y) => {
|
|
265
275
|
if (y === null)
|
|
266
276
|
return;
|
|
267
|
-
const
|
|
268
|
-
|
|
277
|
+
const re = N.current;
|
|
278
|
+
re !== null && sr(re, y);
|
|
269
279
|
}, []), D = w(
|
|
270
280
|
(y = !1) => {
|
|
271
|
-
y && ze(R.current), R.current = null, T.current = null,
|
|
281
|
+
y && ze(R.current), R.current = null, T.current = null, j.current = 0, F(on);
|
|
272
282
|
},
|
|
273
283
|
[F, ze]
|
|
274
284
|
), k = w(
|
|
@@ -278,13 +288,8 @@ const nn = {
|
|
|
278
288
|
return;
|
|
279
289
|
}
|
|
280
290
|
y.preventDefault(), y.stopPropagation();
|
|
281
|
-
const
|
|
282
|
-
S.current = { x: ne +
|
|
283
|
-
try {
|
|
284
|
-
se.setPointerCapture(y.pointerId);
|
|
285
|
-
} catch {
|
|
286
|
-
}
|
|
287
|
-
Te(y.clientX, y.clientY, !0);
|
|
291
|
+
const re = N.current ?? y.currentTarget, { left: ne, top: Xe, width: de, height: Ue } = re.getBoundingClientRect();
|
|
292
|
+
S.current = { x: ne + de / 2, y: Xe + Ue / 2 }, R.current = y.pointerId, wr(re, y.pointerId), Te(y.clientX, y.clientY, !0);
|
|
288
293
|
},
|
|
289
294
|
[Te]
|
|
290
295
|
), ce = w(
|
|
@@ -303,102 +308,95 @@ const nn = {
|
|
|
303
308
|
return;
|
|
304
309
|
}
|
|
305
310
|
y.preventDefault(), y.stopPropagation();
|
|
306
|
-
const
|
|
307
|
-
if (T.current = null,
|
|
311
|
+
const re = T.current;
|
|
312
|
+
if (T.current = null, re !== null) {
|
|
308
313
|
ze(y.pointerId);
|
|
309
|
-
const ne =
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
try {
|
|
313
|
-
ne.setPointerCapture(se.pointerId);
|
|
314
|
-
} catch (te) {
|
|
315
|
-
(typeof te == "object" && te !== null && "name" in te ? te.name : void 0) === "NotFoundError" && (Le = !1);
|
|
316
|
-
}
|
|
317
|
-
if (Le) {
|
|
318
|
-
R.current = se.pointerId, Te(se.clientX, se.clientY, !0);
|
|
314
|
+
const ne = N.current;
|
|
315
|
+
if (ne === null || wr(ne, re.pointerId) !== "inactive-pointer") {
|
|
316
|
+
R.current = re.pointerId, Te(re.clientX, re.clientY, !0);
|
|
319
317
|
return;
|
|
320
318
|
}
|
|
321
319
|
}
|
|
322
320
|
D(!0);
|
|
323
321
|
},
|
|
324
322
|
[D, ze, Te]
|
|
325
|
-
),
|
|
323
|
+
), P = w(
|
|
326
324
|
(y) => {
|
|
327
325
|
y.target === y.currentTarget && R.current === y.pointerId && D(!1);
|
|
328
326
|
},
|
|
329
327
|
[D]
|
|
330
328
|
);
|
|
331
|
-
|
|
329
|
+
Ar(
|
|
332
330
|
f,
|
|
333
331
|
() => ({
|
|
334
332
|
reset: () => {
|
|
335
333
|
D(!0);
|
|
336
334
|
},
|
|
337
|
-
getElement: () =>
|
|
335
|
+
getElement: () => N.current
|
|
338
336
|
}),
|
|
339
337
|
[D]
|
|
340
338
|
);
|
|
341
|
-
const
|
|
342
|
-
let
|
|
343
|
-
if (
|
|
344
|
-
const y = g.distance,
|
|
345
|
-
|
|
346
|
-
} else
|
|
347
|
-
const
|
|
339
|
+
const C = Math.min(Math.max(s, 0), 1), K = n / 64, B = Math.min(g.distance, r) / r, H = g.direction * B * 10 * K;
|
|
340
|
+
let J;
|
|
341
|
+
if (l === "xy") {
|
|
342
|
+
const y = g.distance, re = y === 0 ? 0 : H * g.offsetX / y, ne = y === 0 ? 0 : H * g.offsetY / y;
|
|
343
|
+
J = `translate(${re}px, ${ne}px)`;
|
|
344
|
+
} else l === "x" ? J = `translateX(${H}px)` : J = `translateY(${H}px)`;
|
|
345
|
+
const ie = o ?? Un, ge = {
|
|
348
346
|
dragState: g,
|
|
349
347
|
normalizedDistance: B,
|
|
350
|
-
sizeScale:
|
|
348
|
+
sizeScale: K,
|
|
351
349
|
size: n,
|
|
352
|
-
opacity:
|
|
353
|
-
},
|
|
350
|
+
opacity: C
|
|
351
|
+
}, $e = {
|
|
354
352
|
...i,
|
|
355
353
|
width: n,
|
|
356
354
|
height: n,
|
|
357
|
-
transform:
|
|
355
|
+
transform: J
|
|
358
356
|
};
|
|
359
|
-
return
|
|
357
|
+
return $e.opacity = C, /* @__PURE__ */ U(
|
|
360
358
|
"div",
|
|
361
359
|
{
|
|
362
|
-
ref:
|
|
360
|
+
ref: N,
|
|
363
361
|
"data-testid": "virtual-scroll-tap-circle",
|
|
364
|
-
className:
|
|
365
|
-
style:
|
|
362
|
+
className: Nt("aqvs-tap-scroll-circle", e),
|
|
363
|
+
style: $e,
|
|
366
364
|
tabIndex: -1,
|
|
367
365
|
onPointerDown: k,
|
|
368
366
|
onPointerMove: ce,
|
|
369
367
|
onPointerUp: L,
|
|
370
368
|
onPointerCancel: L,
|
|
371
|
-
onLostPointerCapture:
|
|
369
|
+
onLostPointerCapture: P,
|
|
372
370
|
role: "presentation",
|
|
373
|
-
children:
|
|
371
|
+
children: ie(ge)
|
|
374
372
|
}
|
|
375
373
|
);
|
|
376
374
|
})
|
|
377
375
|
);
|
|
378
|
-
|
|
379
|
-
const
|
|
380
|
-
const r = e === "x", n = t.getBoundingClientRect(), i = r ? n.width : n.height, s = (
|
|
381
|
-
const R = Number.parseFloat(
|
|
376
|
+
jr.displayName = "TapScrollCircle";
|
|
377
|
+
const ee = (t, e, r) => Math.max(e, Math.min(r, t)), Yr = (t, e) => {
|
|
378
|
+
const r = e === "x", n = t.getBoundingClientRect(), i = r ? n.width : n.height, s = (x) => {
|
|
379
|
+
const R = Number.parseFloat(x);
|
|
382
380
|
return Number.isFinite(R) ? R : 0;
|
|
383
|
-
}, o = window.getComputedStyle(t),
|
|
381
|
+
}, o = window.getComputedStyle(t), l = s(r ? o.width : o.height), f = l > 0 ? l + s(r ? o.paddingLeft : o.paddingTop) + s(r ? o.paddingRight : o.paddingBottom) + s(r ? o.borderLeftWidth : o.borderTopWidth) + s(r ? o.borderRightWidth : o.borderBottomWidth) : 0, g = f > 0 ? f : r ? t.offsetWidth : t.offsetHeight;
|
|
384
382
|
return g <= 0 || i <= 0 ? 1 : i / g;
|
|
385
|
-
},
|
|
383
|
+
}, Sr = "virtualscroll:tap-scroll-cancel", an = 20, Gn = 250, jn = 60, Kn = 20, Zn = 20, Rn = {
|
|
386
384
|
/** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
|
|
387
385
|
maxDistance: 240,
|
|
388
386
|
/** 最小速度倍率 (ビューポート比)。 */
|
|
389
387
|
minSpeedMultiplier: 0.2
|
|
390
|
-
},
|
|
388
|
+
}, Jn = Rn.maxDistance, cn = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, _r = 2.2, Qn = 8, ei = 120, Pn = 1 / 10, Xt = {
|
|
391
389
|
enabled: !0,
|
|
392
390
|
size: 40,
|
|
393
391
|
offsetX: -80,
|
|
394
392
|
offsetY: 0,
|
|
395
393
|
className: void 0,
|
|
396
|
-
maxVisualDistance:
|
|
397
|
-
minSpeedMultiplier:
|
|
394
|
+
maxVisualDistance: Jn,
|
|
395
|
+
minSpeedMultiplier: Rn.minSpeedMultiplier,
|
|
398
396
|
opacity: 0.9,
|
|
399
397
|
renderVisual: void 0,
|
|
400
398
|
maxSpeedCurve: void 0
|
|
401
|
-
},
|
|
399
|
+
}, ti = (t) => t ? {
|
|
402
400
|
mainSizeKey: "width",
|
|
403
401
|
crossSizeKey: "height",
|
|
404
402
|
positionKey: "left",
|
|
@@ -416,8 +414,8 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
416
414
|
arrowIcons: ["▲", "▼"],
|
|
417
415
|
directionClass: "aqvs-scrollbar-vertical",
|
|
418
416
|
orientation: "vertical"
|
|
419
|
-
},
|
|
420
|
-
const r = t?.maxSpeedMultiplier, n = typeof r == "number" ? r :
|
|
417
|
+
}, Br = (t, e) => {
|
|
418
|
+
const r = t?.maxSpeedMultiplier, n = typeof r == "number" ? r : si(e);
|
|
421
419
|
return {
|
|
422
420
|
enabled: t?.enabled ?? Xt.enabled,
|
|
423
421
|
size: t?.size ?? Xt.size,
|
|
@@ -427,44 +425,44 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
427
425
|
maxVisualDistance: t?.maxVisualDistance ?? Xt.maxVisualDistance,
|
|
428
426
|
maxSpeedMultiplier: n,
|
|
429
427
|
minSpeedMultiplier: Math.max(t?.minSpeedMultiplier ?? Xt.minSpeedMultiplier, 0),
|
|
430
|
-
opacity:
|
|
428
|
+
opacity: ee(t?.opacity ?? Xt.opacity, 0, 1),
|
|
431
429
|
renderVisual: t?.renderVisual ?? Xt.renderVisual,
|
|
432
430
|
maxSpeedCurve: t?.maxSpeedCurve ?? Xt.maxSpeedCurve
|
|
433
431
|
};
|
|
434
|
-
},
|
|
435
|
-
const i = d(null), s = d(null), o = d(null),
|
|
432
|
+
}, ri = ({ isDragging: t, isThumbHovered: e, enableThumbDrag: r }) => Me(() => r ? t ? "dragging" : e ? "hover" : "idle" : "disabled", [r, t, e]), ni = ({ canUseArrowButtons: t, enableArrowButtons: e, resetTapScroll: r, scrollByStep: n }) => {
|
|
433
|
+
const i = d(null), s = d(null), o = d(null), l = w(() => {
|
|
436
434
|
i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), o.current !== null && (window.removeEventListener("pointerup", o.current), window.removeEventListener("pointercancel", o.current), window.removeEventListener("blur", o.current), o.current = null);
|
|
437
435
|
}, []), f = w(() => {
|
|
438
|
-
|
|
439
|
-
}, [
|
|
436
|
+
l();
|
|
437
|
+
}, [l]), g = w(
|
|
440
438
|
(R) => (T) => {
|
|
441
439
|
if (!t)
|
|
442
440
|
return;
|
|
443
|
-
T.cancelable && T.preventDefault(), T.stopPropagation(), r(),
|
|
441
|
+
T.cancelable && T.preventDefault(), T.stopPropagation(), r(), l(), n(R), s.current = window.setTimeout(() => {
|
|
444
442
|
i.current = window.setInterval(() => {
|
|
445
443
|
n(R);
|
|
446
|
-
},
|
|
447
|
-
},
|
|
448
|
-
const S = () =>
|
|
444
|
+
}, jn);
|
|
445
|
+
}, Gn);
|
|
446
|
+
const S = () => l();
|
|
449
447
|
o.current = S, window.addEventListener("pointerup", S), window.addEventListener("pointercancel", S), window.addEventListener("blur", S);
|
|
450
448
|
},
|
|
451
|
-
[t,
|
|
452
|
-
),
|
|
449
|
+
[t, l, r, n]
|
|
450
|
+
), x = w(
|
|
453
451
|
(R) => (T) => {
|
|
454
452
|
e && (T.key === "Enter" || T.key === " " || T.key === "Spacebar") && (T.preventDefault(), n(R));
|
|
455
453
|
},
|
|
456
454
|
[e, n]
|
|
457
455
|
);
|
|
458
456
|
return X(() => {
|
|
459
|
-
t ||
|
|
460
|
-
}, [t,
|
|
461
|
-
|
|
462
|
-
}, [
|
|
463
|
-
},
|
|
464
|
-
const
|
|
457
|
+
t || l();
|
|
458
|
+
}, [t, l]), X(() => () => {
|
|
459
|
+
l();
|
|
460
|
+
}, [l]), { handleArrowPointerDown: g, handleArrowPointerUp: f, handleArrowKeyDown: x };
|
|
461
|
+
}, ii = 700, ir = (t, e) => typeof t == "number" && Number.isFinite(t) ? t : e, Wr = ({ distance: t, maxDistance: e, viewportSize: r, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: o }) => {
|
|
462
|
+
const l = Math.max(ir(t, 0), 0), f = ir(e, 0), g = f > 0 ? Math.min(l, f) / f : 1, x = Math.max(ir(r, 0), 0), R = Math.max(ir(n, 0), 0), T = Math.max(ir(i, 0), 0), S = Math.max(x * R, 40), N = s ? S : 1200, j = Math.max(x * T, N), F = o ? Math.max(ir(o.exponentialScale, T), 0) : 0, Te = o ? Math.min(j, Math.max(x * F, S)) : j, ze = Math.max(Te, S);
|
|
465
463
|
let D = g ** 1.1;
|
|
466
464
|
if (o) {
|
|
467
|
-
const ce = Math.min(Math.max(ir(o.exponentialSteepness, 0), 0),
|
|
465
|
+
const ce = Math.min(Math.max(ir(o.exponentialSteepness, 0), 0), ii);
|
|
468
466
|
if (ce === 0)
|
|
469
467
|
D = g;
|
|
470
468
|
else {
|
|
@@ -474,12 +472,12 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
474
472
|
}
|
|
475
473
|
const k = Math.min(Math.max(ir(o?.easedOffset, 0), 0), 1);
|
|
476
474
|
return S + (ze - S) * (k + (1 - k) * D);
|
|
477
|
-
},
|
|
475
|
+
}, si = (t) => {
|
|
478
476
|
if (!t || t <= 0)
|
|
479
|
-
return
|
|
480
|
-
const e = Math.max(1, t), r = Math.log10(e), n =
|
|
481
|
-
return
|
|
482
|
-
},
|
|
477
|
+
return _r;
|
|
478
|
+
const e = Math.max(1, t), r = Math.log10(e), n = _r + r * Qn;
|
|
479
|
+
return ee(n, _r, ei);
|
|
480
|
+
}, En = ({
|
|
483
481
|
contentSize: t,
|
|
484
482
|
viewportSize: e,
|
|
485
483
|
scrollPosition: r,
|
|
@@ -487,240 +485,237 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
487
485
|
enableThumbDrag: i = !0,
|
|
488
486
|
enableTrackClick: s = !0,
|
|
489
487
|
enableArrowButtons: o = !0,
|
|
490
|
-
horizontal:
|
|
488
|
+
horizontal: l = !1,
|
|
491
489
|
enableHorizontalTapCircle: f = !1,
|
|
492
490
|
stretchMainSize: g = !1,
|
|
493
|
-
scrollBarWidth:
|
|
491
|
+
scrollBarWidth: x = 12,
|
|
494
492
|
className: R,
|
|
495
493
|
ariaControls: T,
|
|
496
494
|
tapScrollCircleOptions: S,
|
|
497
|
-
itemCount:
|
|
498
|
-
renderThumbOverlay:
|
|
495
|
+
itemCount: N,
|
|
496
|
+
renderThumbOverlay: j,
|
|
499
497
|
visibleStartIndex: F,
|
|
500
498
|
visibleEndIndex: Te,
|
|
501
499
|
locale: ze,
|
|
502
500
|
labels: D
|
|
503
501
|
}) => {
|
|
504
|
-
const [k, ce] =
|
|
502
|
+
const [k, ce] = _e(!1), [L, P] = _e(!1), [C, K] = _e(!1), B = d(null), H = d({
|
|
505
503
|
pointerId: null,
|
|
506
504
|
startThumbPosition: 0,
|
|
507
505
|
startClientX: 0,
|
|
508
506
|
startClientY: 0,
|
|
509
507
|
scale: 1,
|
|
510
508
|
captureTarget: null
|
|
511
|
-
}),
|
|
509
|
+
}), J = d({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), ie = d(r), ge = d(n), $e = d(cn), y = d(null), re = d(null), ne = d(null), Xe = d(0), de = d(0), Ue = Me(() => Br(S, N), [N, S]), xe = Me(() => ti(l), [l]), te = Me(() => In(ze, D), [ze, D]), Qe = l ? [te.scrollLeft, te.scrollRight] : [te.scrollUp, te.scrollDown], {
|
|
512
510
|
enabled: at,
|
|
513
511
|
size: et,
|
|
514
512
|
offsetX: wt,
|
|
515
513
|
offsetY: qe,
|
|
516
|
-
className:
|
|
517
|
-
maxVisualDistance:
|
|
518
|
-
maxSpeedMultiplier:
|
|
519
|
-
minSpeedMultiplier:
|
|
520
|
-
opacity:
|
|
514
|
+
className: Ye,
|
|
515
|
+
maxVisualDistance: Ne,
|
|
516
|
+
maxSpeedMultiplier: ct,
|
|
517
|
+
minSpeedMultiplier: Q,
|
|
518
|
+
opacity: Le,
|
|
521
519
|
renderVisual: Re,
|
|
522
|
-
maxSpeedCurve:
|
|
523
|
-
} =
|
|
520
|
+
maxSpeedCurve: le
|
|
521
|
+
} = Ue, be = d({
|
|
524
522
|
viewportSize: e,
|
|
525
523
|
maxScrollPosition: Math.max(t - e, 0),
|
|
526
524
|
scrollBarVisible: t > e,
|
|
527
|
-
effectiveTapMaxDistance: Math.max(
|
|
528
|
-
tapCircleMaxSpeedMultiplier:
|
|
529
|
-
tapCircleMinSpeedMultiplier:
|
|
530
|
-
tapCircleMaxSpeedCurve:
|
|
525
|
+
effectiveTapMaxDistance: Math.max(Ne, 1),
|
|
526
|
+
tapCircleMaxSpeedMultiplier: ct,
|
|
527
|
+
tapCircleMinSpeedMultiplier: Q,
|
|
528
|
+
tapCircleMaxSpeedCurve: le,
|
|
531
529
|
tapScrollCircleOptions: S,
|
|
532
530
|
effectiveTrackLength: 0,
|
|
533
531
|
onScroll: n,
|
|
534
532
|
scrollPosition: r
|
|
535
|
-
}), { mainSizeKey: fe, crossSizeKey: xt, positionKey: M, selectDelta:
|
|
533
|
+
}), { mainSizeKey: fe, crossSizeKey: xt, positionKey: M, selectDelta: Fe, getPointerCoordinate: he, arrowIcons: _, directionClass: dt, orientation: tt } = xe, Vt = Math.max(Ne, 1), St = e / t, b = Math.max(e - x * 2, 0), V = St * b, ue = Math.min(Math.max(an, V || 0), b || an), Z = Math.max(t - e, 0), se = Math.max(b - ue, 0), me = Z <= 0 || se <= 0 ? 0 : ee(r / Z * se, 0, se), Ge = me + ue / 2, ve = t > e || k, Be = ve && o;
|
|
536
534
|
Je(() => {
|
|
537
535
|
be.current = {
|
|
538
536
|
viewportSize: e,
|
|
539
|
-
maxScrollPosition:
|
|
537
|
+
maxScrollPosition: Z,
|
|
540
538
|
scrollBarVisible: ve,
|
|
541
|
-
effectiveTapMaxDistance:
|
|
542
|
-
tapCircleMaxSpeedMultiplier:
|
|
543
|
-
tapCircleMinSpeedMultiplier:
|
|
544
|
-
tapCircleMaxSpeedCurve:
|
|
539
|
+
effectiveTapMaxDistance: Vt,
|
|
540
|
+
tapCircleMaxSpeedMultiplier: ct,
|
|
541
|
+
tapCircleMinSpeedMultiplier: Q,
|
|
542
|
+
tapCircleMaxSpeedCurve: le,
|
|
545
543
|
tapScrollCircleOptions: S,
|
|
546
|
-
effectiveTrackLength:
|
|
544
|
+
effectiveTrackLength: se,
|
|
547
545
|
onScroll: n,
|
|
548
546
|
scrollPosition: r
|
|
549
547
|
};
|
|
550
548
|
}), Je(() => {
|
|
551
|
-
|
|
549
|
+
ie.current = r;
|
|
552
550
|
}, [r]), Je(() => {
|
|
553
551
|
ge.current = n;
|
|
554
552
|
}, [n]), X(() => {
|
|
555
|
-
i ||
|
|
553
|
+
i || P(!1);
|
|
556
554
|
}, [i]);
|
|
557
|
-
const Ie =
|
|
558
|
-
const
|
|
555
|
+
const Ie = ri({ isDragging: k, isThumbHovered: L, enableThumbDrag: i }), Oe = w((u, E) => {
|
|
556
|
+
const O = be.current, oe = E ?? ie.current;
|
|
559
557
|
if (ge.current) {
|
|
560
|
-
const Ke = ge.current(u,
|
|
558
|
+
const Ke = ge.current(u, oe);
|
|
561
559
|
if (typeof Ke == "number" && Number.isFinite(Ke))
|
|
562
|
-
return
|
|
560
|
+
return ie.current = Ke, Ke;
|
|
563
561
|
}
|
|
564
|
-
const
|
|
565
|
-
return
|
|
562
|
+
const He = typeof u == "function" ? u(oe) : u, je = Math.max(O.maxScrollPosition, 0), pt = O.scrollBarVisible ? ee(He, 0, je) : 0;
|
|
563
|
+
return ie.current = pt, pt;
|
|
566
564
|
}, []), mt = w(
|
|
567
565
|
(u) => {
|
|
568
|
-
const
|
|
569
|
-
if (!
|
|
570
|
-
const yt =
|
|
566
|
+
const E = be.current, O = ie.current;
|
|
567
|
+
if (!E.scrollBarVisible || E.maxScrollPosition <= 0) {
|
|
568
|
+
const yt = Oe(0, O), _t = yt - O;
|
|
571
569
|
return { nextPosition: yt, actualDelta: _t, reachedBoundary: !0 };
|
|
572
570
|
}
|
|
573
571
|
if (u === 0)
|
|
574
|
-
return { nextPosition:
|
|
575
|
-
const
|
|
576
|
-
return { nextPosition:
|
|
572
|
+
return { nextPosition: O, actualDelta: 0, reachedBoundary: !1 };
|
|
573
|
+
const He = Oe((yt) => ee(yt + u, 0, E.maxScrollPosition), O), je = He - O, pt = u < 0 && O + u <= 0, Ke = u > 0 && O + u >= E.maxScrollPosition, Ot = u < 0 && (He <= 0 || pt && je === 0) || u > 0 && (He >= E.maxScrollPosition || Ke && je === 0);
|
|
574
|
+
return { nextPosition: He, actualDelta: je, reachedBoundary: Ot };
|
|
577
575
|
},
|
|
578
|
-
[
|
|
576
|
+
[Oe]
|
|
579
577
|
), rt = w(
|
|
580
|
-
(u,
|
|
581
|
-
u.current +=
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
const
|
|
585
|
-
return u.current -=
|
|
578
|
+
(u, E) => {
|
|
579
|
+
u.current += E;
|
|
580
|
+
const O = Math.max(be.current.maxScrollPosition, 0);
|
|
581
|
+
O > 0 && (u.current = ee(u.current, -O, O));
|
|
582
|
+
const oe = mt(u.current);
|
|
583
|
+
return u.current -= oe.actualDelta, oe.reachedBoundary && (u.current = 0), oe;
|
|
586
584
|
},
|
|
587
585
|
[mt]
|
|
588
586
|
), nt = w(() => {
|
|
589
|
-
|
|
590
|
-
}, []),
|
|
591
|
-
|
|
592
|
-
}, [nt]),
|
|
587
|
+
re.current !== null && (window.cancelAnimationFrame(re.current), re.current = null), ne.current = null, Xe.current = 0, de.current = 0;
|
|
588
|
+
}, []), ke = w(() => {
|
|
589
|
+
$e.current = { ...cn }, K(!1), y.current?.reset(), nt();
|
|
590
|
+
}, [nt]), lt = w(
|
|
593
591
|
(u) => {
|
|
594
|
-
const
|
|
595
|
-
if (!
|
|
592
|
+
const E = $e.current, O = be.current;
|
|
593
|
+
if (!E.active || E.direction === 0) {
|
|
596
594
|
nt();
|
|
597
595
|
return;
|
|
598
596
|
}
|
|
599
|
-
if (!
|
|
597
|
+
if (!O.scrollBarVisible || O.maxScrollPosition <= 0) {
|
|
600
598
|
nt();
|
|
601
599
|
return;
|
|
602
600
|
}
|
|
603
|
-
const
|
|
601
|
+
const oe = ne.current ?? u, He = Math.max((u - oe) / 1e3, 0), je = Math.min(He, Pn);
|
|
604
602
|
if (ne.current = u, je <= 0) {
|
|
605
|
-
|
|
603
|
+
re.current = window.requestAnimationFrame(lt);
|
|
606
604
|
return;
|
|
607
605
|
}
|
|
608
|
-
const pt =
|
|
609
|
-
distance:
|
|
610
|
-
maxDistance:
|
|
611
|
-
viewportSize:
|
|
612
|
-
minSpeedMultiplier:
|
|
613
|
-
maxSpeedMultiplier:
|
|
614
|
-
hasCustomMaxSpeedMultiplier: typeof
|
|
615
|
-
curve:
|
|
606
|
+
const pt = Wr({
|
|
607
|
+
distance: E.distance,
|
|
608
|
+
maxDistance: O.effectiveTapMaxDistance,
|
|
609
|
+
viewportSize: O.viewportSize,
|
|
610
|
+
minSpeedMultiplier: O.tapCircleMinSpeedMultiplier,
|
|
611
|
+
maxSpeedMultiplier: O.tapCircleMaxSpeedMultiplier,
|
|
612
|
+
hasCustomMaxSpeedMultiplier: typeof O.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
|
|
613
|
+
curve: O.tapCircleMaxSpeedCurve
|
|
616
614
|
});
|
|
617
|
-
|
|
618
|
-
const { reachedBoundary: Ke } = rt(
|
|
615
|
+
de.current !== E.direction && (de.current = E.direction, Xe.current = 0);
|
|
616
|
+
const { reachedBoundary: Ke } = rt(Xe, E.direction * pt * je);
|
|
619
617
|
if (Ke) {
|
|
620
618
|
nt();
|
|
621
619
|
return;
|
|
622
620
|
}
|
|
623
|
-
|
|
621
|
+
re.current = window.requestAnimationFrame(lt);
|
|
624
622
|
},
|
|
625
623
|
[rt, nt]
|
|
626
624
|
), we = w(() => {
|
|
627
|
-
|
|
628
|
-
}, [
|
|
625
|
+
re.current === null && (ne.current = null, Xe.current = 0, re.current = window.requestAnimationFrame(lt));
|
|
626
|
+
}, [lt]);
|
|
629
627
|
X(() => {
|
|
630
|
-
const u =
|
|
628
|
+
const u = $e.current;
|
|
631
629
|
!u.active || u.direction === 0 || we();
|
|
632
630
|
}, [t, e, we]), X(() => () => {
|
|
633
631
|
nt();
|
|
634
632
|
}, [nt]);
|
|
635
633
|
const pe = w(
|
|
636
634
|
(u) => {
|
|
637
|
-
|
|
635
|
+
$e.current = u, K(u.active), u.active && u.direction !== 0 ? we() : nt();
|
|
638
636
|
},
|
|
639
637
|
[we, nt]
|
|
640
638
|
);
|
|
641
639
|
X(() => {
|
|
642
|
-
at ||
|
|
643
|
-
}, [
|
|
644
|
-
const u = (
|
|
645
|
-
const
|
|
646
|
-
|
|
640
|
+
at || ke();
|
|
641
|
+
}, [ke, at]), X(() => {
|
|
642
|
+
const u = (E) => {
|
|
643
|
+
const oe = E.detail?.paneId;
|
|
644
|
+
oe && T && oe !== T || ke();
|
|
647
645
|
};
|
|
648
|
-
return window.addEventListener(
|
|
649
|
-
window.removeEventListener(
|
|
646
|
+
return window.addEventListener(Sr, u), () => {
|
|
647
|
+
window.removeEventListener(Sr, u);
|
|
650
648
|
};
|
|
651
|
-
}, [T,
|
|
649
|
+
}, [T, ke]), X(() => {
|
|
652
650
|
if (!at)
|
|
653
651
|
return;
|
|
654
|
-
const u = (
|
|
655
|
-
if (
|
|
652
|
+
const u = (E) => {
|
|
653
|
+
if (!$e.current.active || $e.current.pointerId === E.pointerId)
|
|
656
654
|
return;
|
|
657
|
-
const
|
|
658
|
-
if (!(
|
|
659
|
-
|
|
655
|
+
const O = E.target;
|
|
656
|
+
if (!(O instanceof Node)) {
|
|
657
|
+
ke();
|
|
660
658
|
return;
|
|
661
659
|
}
|
|
662
|
-
y.current?.getElement()?.contains(
|
|
660
|
+
y.current?.getElement()?.contains(O) || ke();
|
|
663
661
|
};
|
|
664
662
|
return document.addEventListener("pointerdown", u, !0), () => {
|
|
665
663
|
document.removeEventListener("pointerdown", u, !0);
|
|
666
664
|
};
|
|
667
|
-
}, [
|
|
665
|
+
}, [ke, at]);
|
|
668
666
|
const Mt = (u) => {
|
|
669
|
-
if (!ve ||
|
|
667
|
+
if (!ve || se <= 0 || Z <= 0)
|
|
670
668
|
return 0;
|
|
671
|
-
const
|
|
672
|
-
return
|
|
669
|
+
const E = ee(u, 0, se);
|
|
670
|
+
return ee(E / se * Z, 0, Z);
|
|
673
671
|
}, m = w((u) => {
|
|
674
|
-
const { scrollBarVisible:
|
|
675
|
-
if (A.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: u, trackLen:
|
|
672
|
+
const { scrollBarVisible: E, effectiveTrackLength: O, maxScrollPosition: oe } = be.current;
|
|
673
|
+
if (A.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: u, trackLen: O, maxScroll: oe })), O <= 0 || oe <= 0)
|
|
676
674
|
return null;
|
|
677
|
-
const
|
|
678
|
-
return
|
|
679
|
-
}, []), z = w((u) =>
|
|
675
|
+
const He = ee(u, 0, O);
|
|
676
|
+
return ee(He / O * oe, 0, oe);
|
|
677
|
+
}, []), z = w((u) => Yr(u, l ? "x" : "y"), [l]), Pe = w(
|
|
680
678
|
(u) => {
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
679
|
+
const E = H.current;
|
|
680
|
+
if (E.pointerId !== u.pointerId)
|
|
683
681
|
return;
|
|
684
|
-
const
|
|
682
|
+
const O = u.clientX - E.startClientX, oe = u.clientY - E.startClientY, He = Fe(O, oe) / (E.scale || 1);
|
|
685
683
|
A.debug("[ScrollBar] handleThumbPointerMove", () => ({
|
|
686
|
-
delta:
|
|
687
|
-
startThumbPosition:
|
|
684
|
+
delta: He,
|
|
685
|
+
startThumbPosition: E.startThumbPosition,
|
|
688
686
|
clientY: u.clientY,
|
|
689
|
-
startClientY:
|
|
687
|
+
startClientY: E.startClientY,
|
|
690
688
|
metrics: be.current
|
|
691
689
|
}));
|
|
692
|
-
const je = m(
|
|
693
|
-
je !== null &&
|
|
690
|
+
const je = m(E.startThumbPosition + He);
|
|
691
|
+
je !== null && Oe(je), u.cancelable && u.preventDefault();
|
|
694
692
|
},
|
|
695
|
-
[
|
|
693
|
+
[Fe, m, Oe]
|
|
696
694
|
), it = w(
|
|
697
695
|
(u) => {
|
|
698
|
-
const
|
|
699
|
-
if (
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
u.clientX >= j.left && u.clientX <= j.right && u.clientY >= j.top && u.clientY <= j.bottom || E(!1);
|
|
706
|
-
} else
|
|
707
|
-
E(!1);
|
|
696
|
+
const E = H.current;
|
|
697
|
+
if (E.pointerId === u.pointerId)
|
|
698
|
+
if (document.removeEventListener("pointermove", Pe), document.removeEventListener("pointerup", it), document.removeEventListener("pointercancel", it), E.captureTarget !== null && sr(E.captureTarget, u.pointerId), H.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ce(!1), B.current) {
|
|
699
|
+
const O = B.current.getBoundingClientRect();
|
|
700
|
+
u.clientX >= O.left && u.clientX <= O.right && u.clientY >= O.top && u.clientY <= O.bottom || P(!1);
|
|
701
|
+
} else
|
|
702
|
+
P(!1);
|
|
708
703
|
},
|
|
709
704
|
[Pe]
|
|
710
705
|
);
|
|
711
706
|
X(() => () => {
|
|
712
707
|
document.removeEventListener("pointermove", Pe), document.removeEventListener("pointerup", it), document.removeEventListener("pointercancel", it);
|
|
713
708
|
}, [Pe, it]);
|
|
714
|
-
const
|
|
709
|
+
const Ve = d(0), Pt = d(0), st = w(
|
|
715
710
|
(u) => {
|
|
716
|
-
const
|
|
717
|
-
Pt.current !== u && (Pt.current = u,
|
|
711
|
+
const E = Math.max(Math.round(be.current.viewportSize / Zn), Kn);
|
|
712
|
+
Pt.current !== u && (Pt.current = u, Ve.current = 0), rt(Ve, u * E);
|
|
718
713
|
},
|
|
719
714
|
[rt]
|
|
720
|
-
), { handleArrowPointerDown: ut, handleArrowPointerUp:
|
|
721
|
-
canUseArrowButtons:
|
|
715
|
+
), { handleArrowPointerDown: ut, handleArrowPointerUp: Ce, handleArrowKeyDown: Yt } = ni({
|
|
716
|
+
canUseArrowButtons: Be,
|
|
722
717
|
enableArrowButtons: o,
|
|
723
|
-
resetTapScroll:
|
|
718
|
+
resetTapScroll: ke,
|
|
724
719
|
scrollByStep: st
|
|
725
720
|
}), lr = (u) => {
|
|
726
721
|
if (!ve)
|
|
@@ -731,23 +726,16 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
731
726
|
}
|
|
732
727
|
if (u.pointerType === "mouse" && u.button !== 0 || u.ctrlKey)
|
|
733
728
|
return;
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
let j = null;
|
|
737
|
-
if (P.setPointerCapture)
|
|
738
|
-
try {
|
|
739
|
-
P.setPointerCapture(u.pointerId), j = P;
|
|
740
|
-
} catch {
|
|
741
|
-
j = null;
|
|
742
|
-
}
|
|
729
|
+
ke();
|
|
730
|
+
const E = u.currentTarget, O = z(E), oe = wr(E, u.pointerId) === "captured" ? E : null;
|
|
743
731
|
H.current = {
|
|
744
732
|
pointerId: u.pointerId,
|
|
745
733
|
startThumbPosition: me,
|
|
746
734
|
startClientX: u.clientX,
|
|
747
735
|
startClientY: u.clientY,
|
|
748
|
-
scale:
|
|
749
|
-
captureTarget:
|
|
750
|
-
}, document.addEventListener("pointermove", Pe), document.addEventListener("pointerup", it), document.addEventListener("pointercancel", it), ce(!0),
|
|
736
|
+
scale: O,
|
|
737
|
+
captureTarget: oe
|
|
738
|
+
}, document.addEventListener("pointermove", Pe), document.addEventListener("pointerup", it), document.addEventListener("pointercancel", it), ce(!0), P(!0), u.preventDefault(), u.stopPropagation();
|
|
751
739
|
}, Bt = (u) => {
|
|
752
740
|
if (!ve)
|
|
753
741
|
return;
|
|
@@ -757,96 +745,85 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
757
745
|
}
|
|
758
746
|
if (u.pointerType === "mouse" && u.button !== 0 || u.ctrlKey)
|
|
759
747
|
return;
|
|
760
|
-
const
|
|
761
|
-
|
|
762
|
-
const pt = je -
|
|
763
|
-
|
|
764
|
-
try {
|
|
765
|
-
P.setPointerCapture(u.pointerId);
|
|
766
|
-
} catch {
|
|
767
|
-
}
|
|
768
|
-
Q.current = {
|
|
748
|
+
const E = u.currentTarget, O = E.getBoundingClientRect(), oe = he(u), He = z(E), je = (oe - (l ? O.left : O.top)) / He;
|
|
749
|
+
ke();
|
|
750
|
+
const pt = je - ue / 2, Ke = Mt(pt);
|
|
751
|
+
Oe(Ke), wr(E, u.pointerId), J.current = {
|
|
769
752
|
pointerId: u.pointerId,
|
|
770
753
|
startThumbPosition: pt,
|
|
771
754
|
startClientX: u.clientX,
|
|
772
755
|
startClientY: u.clientY,
|
|
773
|
-
scale:
|
|
756
|
+
scale: He
|
|
774
757
|
}, u.preventDefault(), u.stopPropagation();
|
|
775
758
|
}, Se = () => {
|
|
776
|
-
|
|
759
|
+
J.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
|
|
777
760
|
}, Lt = (u) => {
|
|
778
|
-
const
|
|
779
|
-
if (
|
|
761
|
+
const E = J.current;
|
|
762
|
+
if (E.pointerId !== u.pointerId)
|
|
780
763
|
return;
|
|
781
764
|
if (u.pointerType === "mouse" && u.buttons === 0) {
|
|
782
765
|
Se();
|
|
783
766
|
return;
|
|
784
767
|
}
|
|
785
|
-
const
|
|
786
|
-
|
|
768
|
+
const O = u.clientX - E.startClientX, oe = u.clientY - E.startClientY, He = Fe(O, oe) / (E.scale || 1), je = Mt(E.startThumbPosition + He);
|
|
769
|
+
Oe(je), u.cancelable && u.preventDefault();
|
|
787
770
|
}, Zt = (u) => {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
P.hasPointerCapture?.(u.pointerId) && P.releasePointerCapture(u.pointerId), Se(), u.preventDefault(), u.stopPropagation();
|
|
792
|
-
}, sr = (u) => {
|
|
793
|
-
if (Q.current.pointerId !== u.pointerId)
|
|
794
|
-
return;
|
|
795
|
-
const P = u.currentTarget;
|
|
796
|
-
P.hasPointerCapture?.(u.pointerId) && P.releasePointerCapture(u.pointerId), Se();
|
|
771
|
+
J.current.pointerId === u.pointerId && (sr(u.currentTarget, u.pointerId), Se(), u.preventDefault(), u.stopPropagation());
|
|
772
|
+
}, or = (u) => {
|
|
773
|
+
J.current.pointerId === u.pointerId && (sr(u.currentTarget, u.pointerId), Se());
|
|
797
774
|
}, Ee = (u) => {
|
|
798
|
-
u.target === u.currentTarget &&
|
|
799
|
-
}, It = Me(() =>
|
|
800
|
-
const
|
|
775
|
+
u.target === u.currentTarget && J.current.pointerId === u.pointerId && Se();
|
|
776
|
+
}, It = Me(() => ee((C ? 1 : 0.8) * Le, 0, 1), [C, Le]), Wt = Me(() => {
|
|
777
|
+
const E = `calc(50% - ${et / 2}px + ${qe}px)`;
|
|
801
778
|
return {
|
|
802
779
|
left: wt,
|
|
803
|
-
top:
|
|
780
|
+
top: E
|
|
804
781
|
};
|
|
805
|
-
}, [wt, qe, et]), Ht = (u,
|
|
782
|
+
}, [wt, qe, et]), Ht = (u, E, O, oe) => /* @__PURE__ */ U(
|
|
806
783
|
"button",
|
|
807
784
|
{
|
|
808
785
|
type: "button",
|
|
809
786
|
tabIndex: 0,
|
|
810
787
|
className: "aqvs-scrollbar-arrow-button",
|
|
811
788
|
style: {
|
|
812
|
-
[fe]:
|
|
813
|
-
[xt]:
|
|
789
|
+
[fe]: x,
|
|
790
|
+
[xt]: x
|
|
814
791
|
},
|
|
815
|
-
"aria-label":
|
|
792
|
+
"aria-label": E,
|
|
816
793
|
onPointerDown: ut(u),
|
|
817
|
-
onPointerUp:
|
|
818
|
-
onPointerLeave:
|
|
819
|
-
onPointerCancel:
|
|
794
|
+
onPointerUp: Ce,
|
|
795
|
+
onPointerLeave: Ce,
|
|
796
|
+
onPointerCancel: Ce,
|
|
820
797
|
onKeyDown: Yt(u),
|
|
821
798
|
"aria-disabled": !o,
|
|
822
|
-
disabled: !
|
|
823
|
-
children: /* @__PURE__ */ U("span", { "aria-hidden": "true", children:
|
|
799
|
+
disabled: !Be,
|
|
800
|
+
children: /* @__PURE__ */ U("span", { "aria-hidden": "true", children: O })
|
|
824
801
|
},
|
|
825
|
-
|
|
826
|
-
), bt =
|
|
802
|
+
oe
|
|
803
|
+
), bt = j && ve ? {
|
|
827
804
|
orientation: tt,
|
|
828
805
|
scrollPosition: r,
|
|
829
|
-
maxScrollPosition:
|
|
806
|
+
maxScrollPosition: Z,
|
|
830
807
|
contentSize: t,
|
|
831
808
|
viewportSize: e,
|
|
832
|
-
thumbSize:
|
|
809
|
+
thumbSize: ue,
|
|
833
810
|
thumbPosition: me,
|
|
834
811
|
thumbCenter: Ge,
|
|
835
|
-
trackSize:
|
|
812
|
+
trackSize: b,
|
|
836
813
|
isDragging: k,
|
|
837
|
-
isTapScrollActive:
|
|
814
|
+
isTapScrollActive: C,
|
|
838
815
|
visibleStartIndex: F,
|
|
839
816
|
visibleEndIndex: Te
|
|
840
817
|
} : null;
|
|
841
818
|
return /* @__PURE__ */ qt(
|
|
842
819
|
"div",
|
|
843
820
|
{
|
|
844
|
-
className:
|
|
821
|
+
className: Nt("aqvs-scrollbar", dt, R),
|
|
845
822
|
style: {
|
|
846
823
|
// 自己計測ペインの縦バーはインライン主軸寸を書かない (ラチェット遮断 — ペイン仕様 §2.5)。
|
|
847
824
|
// 横バーは stretch が主軸を寸法決めできないため常に書く
|
|
848
|
-
...g && !
|
|
849
|
-
[xt]:
|
|
825
|
+
...g && !l ? {} : { [fe]: e },
|
|
826
|
+
[xt]: x
|
|
850
827
|
},
|
|
851
828
|
"data-visible": ve ? "true" : "false",
|
|
852
829
|
role: "scrollbar",
|
|
@@ -854,17 +831,17 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
854
831
|
"aria-controls": T,
|
|
855
832
|
"aria-valuenow": r,
|
|
856
833
|
"aria-valuemin": 0,
|
|
857
|
-
"aria-valuemax":
|
|
858
|
-
"aria-orientation":
|
|
834
|
+
"aria-valuemax": Z,
|
|
835
|
+
"aria-orientation": l ? "horizontal" : "vertical",
|
|
859
836
|
children: [
|
|
860
|
-
(!
|
|
861
|
-
|
|
837
|
+
(!l || f) && ve && at && /* @__PURE__ */ U(
|
|
838
|
+
jr,
|
|
862
839
|
{
|
|
863
|
-
axis:
|
|
840
|
+
axis: l ? "x" : "y",
|
|
864
841
|
ref: y,
|
|
865
|
-
className:
|
|
842
|
+
className: Nt("aqvs-scrollbar-tap-circle-wrapper", Ye),
|
|
866
843
|
size: et,
|
|
867
|
-
maxVisualDistance:
|
|
844
|
+
maxVisualDistance: Vt,
|
|
868
845
|
style: Wt,
|
|
869
846
|
opacity: It,
|
|
870
847
|
renderVisual: Re,
|
|
@@ -872,56 +849,56 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
872
849
|
},
|
|
873
850
|
"tap-circle"
|
|
874
851
|
),
|
|
875
|
-
Ht(-1, Qe[0],
|
|
852
|
+
Ht(-1, Qe[0], _[0], "arrow-start"),
|
|
876
853
|
/* @__PURE__ */ qt(
|
|
877
854
|
"div",
|
|
878
855
|
{
|
|
879
856
|
className: "aqvs-scrollbar-track",
|
|
880
857
|
style: {
|
|
881
|
-
borderRadius:
|
|
858
|
+
borderRadius: x / 2
|
|
882
859
|
},
|
|
883
860
|
onPointerDown: Bt,
|
|
884
861
|
onPointerMove: Lt,
|
|
885
862
|
onPointerUp: Zt,
|
|
886
|
-
onPointerCancel:
|
|
863
|
+
onPointerCancel: or,
|
|
887
864
|
onLostPointerCapture: Ee,
|
|
888
865
|
"aria-disabled": !s,
|
|
889
866
|
children: [
|
|
890
|
-
bt && /* @__PURE__ */ U("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children:
|
|
867
|
+
bt && /* @__PURE__ */ U("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: j?.(bt) }, "overlay"),
|
|
891
868
|
/* @__PURE__ */ U(
|
|
892
869
|
"div",
|
|
893
870
|
{
|
|
894
871
|
className: "aqvs-scrollbar-thumb-wrapper",
|
|
895
872
|
style: {
|
|
896
|
-
[fe]:
|
|
873
|
+
[fe]: ue,
|
|
897
874
|
[M]: me,
|
|
898
|
-
...
|
|
875
|
+
...l ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
|
|
899
876
|
},
|
|
900
877
|
"data-visible": ve || k ? "true" : "false",
|
|
901
878
|
onPointerDown: lr,
|
|
902
879
|
role: "slider",
|
|
903
|
-
"aria-orientation":
|
|
880
|
+
"aria-orientation": l ? "horizontal" : "vertical",
|
|
904
881
|
"aria-valuenow": r,
|
|
905
882
|
"aria-valuemin": 0,
|
|
906
|
-
"aria-valuemax":
|
|
883
|
+
"aria-valuemax": Z,
|
|
907
884
|
"aria-disabled": !i,
|
|
908
885
|
tabIndex: -1,
|
|
909
886
|
children: /* @__PURE__ */ U(
|
|
910
887
|
"div",
|
|
911
888
|
{
|
|
912
889
|
ref: B,
|
|
913
|
-
className:
|
|
890
|
+
className: Nt("aqvs-scrollbar-thumb", l ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
|
|
914
891
|
"data-testid": "aqvs-scrollbar-thumb",
|
|
915
892
|
"data-thumb-state": Ie,
|
|
916
893
|
style: {
|
|
917
|
-
borderRadius:
|
|
894
|
+
borderRadius: x - 1,
|
|
918
895
|
cursor: i ? "pointer" : "default"
|
|
919
896
|
},
|
|
920
897
|
onMouseEnter: () => {
|
|
921
|
-
i &&
|
|
898
|
+
i && P(!0);
|
|
922
899
|
},
|
|
923
900
|
onMouseLeave: () => {
|
|
924
|
-
i &&
|
|
901
|
+
i && P(!1);
|
|
925
902
|
}
|
|
926
903
|
},
|
|
927
904
|
"thumb"
|
|
@@ -933,24 +910,24 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
933
910
|
},
|
|
934
911
|
"track"
|
|
935
912
|
),
|
|
936
|
-
Ht(1, Qe[1],
|
|
913
|
+
Ht(1, Qe[1], _[1], "arrow-end")
|
|
937
914
|
]
|
|
938
915
|
}
|
|
939
916
|
);
|
|
940
|
-
},
|
|
941
|
-
const s = Number.isFinite(t) ? t : 0, o = Number.isFinite(e) ? e : 0,
|
|
942
|
-
if (
|
|
917
|
+
}, oi = ({ offsetX: t, offsetY: e, maxDistance: r, x: n, y: i }) => {
|
|
918
|
+
const s = Number.isFinite(t) ? t : 0, o = Number.isFinite(e) ? e : 0, l = Math.hypot(s, o);
|
|
919
|
+
if (l === 0)
|
|
943
920
|
return { x: 0, y: 0 };
|
|
944
|
-
const f =
|
|
945
|
-
distance:
|
|
921
|
+
const f = Wr({
|
|
922
|
+
distance: l,
|
|
946
923
|
maxDistance: r,
|
|
947
924
|
viewportSize: n.viewportSize,
|
|
948
925
|
minSpeedMultiplier: n.minSpeedMultiplier,
|
|
949
926
|
maxSpeedMultiplier: n.maxSpeedMultiplier,
|
|
950
927
|
hasCustomMaxSpeedMultiplier: n.hasCustomMaxSpeedMultiplier,
|
|
951
928
|
curve: n.curve
|
|
952
|
-
}), g =
|
|
953
|
-
distance:
|
|
929
|
+
}), g = Wr({
|
|
930
|
+
distance: l,
|
|
954
931
|
maxDistance: r,
|
|
955
932
|
viewportSize: i.viewportSize,
|
|
956
933
|
minSpeedMultiplier: i.minSpeedMultiplier,
|
|
@@ -958,8 +935,8 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
958
935
|
hasCustomMaxSpeedMultiplier: i.hasCustomMaxSpeedMultiplier,
|
|
959
936
|
curve: i.curve
|
|
960
937
|
});
|
|
961
|
-
return { x: f * s /
|
|
962
|
-
},
|
|
938
|
+
return { x: f * s / l, y: g * o / l };
|
|
939
|
+
}, Oi = (t) => {
|
|
963
940
|
const { quantum: e, resetOnDirectionChange: r = !0 } = t;
|
|
964
941
|
if (!(Number.isFinite(e) && e > 0))
|
|
965
942
|
throw new TypeError(`[createResidualQuantizer] quantum must be a finite positive number, received ${e}`);
|
|
@@ -977,7 +954,7 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
977
954
|
n = 0;
|
|
978
955
|
}
|
|
979
956
|
};
|
|
980
|
-
},
|
|
957
|
+
}, ai = 16, ln = (t, e, r) => e === 1 ? t * ai : e === 2 ? t * r : t, ci = (t, e) => {
|
|
981
958
|
const r = t.shiftKey && t.deltaX === 0, n = r ? t.deltaY : t.deltaX, i = r ? 0 : t.deltaY, s = n !== 0 && Math.abs(n) >= Math.abs(i);
|
|
982
959
|
return {
|
|
983
960
|
// ❗ ズームでもデルタは潰さない。ここは**事実だけ**を報告し、「横取りしない」という
|
|
@@ -986,21 +963,21 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
986
963
|
// どのテストも検出できなくなる (変異解析で実証済み)。
|
|
987
964
|
isZoomGesture: t.ctrlKey,
|
|
988
965
|
isHorizontalDominant: s,
|
|
989
|
-
horizontalDelta:
|
|
990
|
-
verticalDelta:
|
|
966
|
+
horizontalDelta: ln(n, t.deltaMode, e),
|
|
967
|
+
verticalDelta: ln(i, t.deltaMode, e)
|
|
991
968
|
};
|
|
992
|
-
},
|
|
993
|
-
|
|
994
|
-
},
|
|
969
|
+
}, zn = /* @__PURE__ */ new WeakSet(), un = (t) => {
|
|
970
|
+
zn.add(t);
|
|
971
|
+
}, li = (t) => zn.has(t), ui = ["mouse", "pen", "touch"], Fr = (t, e) => !(t === "mouse" || t === "pen" || t === "touch") || e.includes(t), di = (t) => t === "mouse" || t === "pen", br = {
|
|
995
972
|
maxVelocity: 6,
|
|
996
973
|
minVelocity: 0.02,
|
|
997
974
|
deceleration: 25e-4,
|
|
998
975
|
velocitySampleWindow: 90,
|
|
999
976
|
startVelocityThreshold: 0.04
|
|
1000
|
-
},
|
|
977
|
+
}, Er = (t, e, r) => {
|
|
1001
978
|
for (const [n, i, s] of e)
|
|
1002
979
|
r === "add" ? t.addEventListener(n, i, s) : t.removeEventListener(n, i, s);
|
|
1003
|
-
},
|
|
980
|
+
}, fi = Cr(
|
|
1004
981
|
({
|
|
1005
982
|
children: t,
|
|
1006
983
|
contentSize: e,
|
|
@@ -1009,15 +986,15 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1009
986
|
scrollBarWidth: i = 12,
|
|
1010
987
|
enableThumbDrag: s = !0,
|
|
1011
988
|
enableTrackClick: o = !0,
|
|
1012
|
-
enableArrowButtons:
|
|
989
|
+
enableArrowButtons: l = !0,
|
|
1013
990
|
enablePointerDrag: f = !0,
|
|
1014
|
-
pointerDragInputs: g =
|
|
1015
|
-
onScroll:
|
|
991
|
+
pointerDragInputs: g = ui,
|
|
992
|
+
onScroll: x,
|
|
1016
993
|
className: R,
|
|
1017
994
|
testId: T,
|
|
1018
995
|
style: S,
|
|
1019
|
-
background:
|
|
1020
|
-
tapScrollCircleOptions:
|
|
996
|
+
background: N,
|
|
997
|
+
tapScrollCircleOptions: j,
|
|
1021
998
|
inertiaOptions: F,
|
|
1022
999
|
itemCount: Te,
|
|
1023
1000
|
renderThumbOverlay: ze,
|
|
@@ -1025,60 +1002,60 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1025
1002
|
overscrollBehavior: k = "auto",
|
|
1026
1003
|
onWheelHorizontal: ce,
|
|
1027
1004
|
onPanHorizontal: L,
|
|
1028
|
-
contentInsets:
|
|
1029
|
-
visibleStartIndex:
|
|
1030
|
-
visibleEndIndex:
|
|
1005
|
+
contentInsets: P,
|
|
1006
|
+
visibleStartIndex: C,
|
|
1007
|
+
visibleEndIndex: K,
|
|
1031
1008
|
renderOverlay: B,
|
|
1032
1009
|
initialScrollPosition: H = 0,
|
|
1033
|
-
contentProps:
|
|
1034
|
-
locale:
|
|
1010
|
+
contentProps: J,
|
|
1011
|
+
locale: ie,
|
|
1035
1012
|
labels: ge
|
|
1036
|
-
},
|
|
1037
|
-
const y = d(Number.isFinite(H) ? Math.max(0, H) : 0),
|
|
1013
|
+
}, $e) => {
|
|
1014
|
+
const y = d(Number.isFinite(H) ? Math.max(0, H) : 0), re = d(null), ne = d(null), Xe = r === void 0, [de, Ue] = _e(0), xe = r ?? de, te = d(null);
|
|
1038
1015
|
Je(() => {
|
|
1039
|
-
if (!
|
|
1016
|
+
if (!Xe)
|
|
1040
1017
|
return;
|
|
1041
|
-
const
|
|
1042
|
-
if (!
|
|
1018
|
+
const b = ne.current;
|
|
1019
|
+
if (!b)
|
|
1043
1020
|
return;
|
|
1044
|
-
const
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
|
|
1021
|
+
const V = () => {
|
|
1022
|
+
const Z = b.offsetHeight;
|
|
1023
|
+
if (Z > 0) {
|
|
1024
|
+
Ue((se) => se === Z ? se : Z);
|
|
1048
1025
|
return;
|
|
1049
1026
|
}
|
|
1050
|
-
|
|
1027
|
+
b.offsetParent !== null && e > 0 && te.current !== "zero" && (te.current = "zero", A.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
|
|
1051
1028
|
};
|
|
1052
|
-
if (
|
|
1029
|
+
if (V(), typeof ResizeObserver != "function")
|
|
1053
1030
|
return;
|
|
1054
|
-
const
|
|
1055
|
-
return
|
|
1056
|
-
|
|
1031
|
+
const ue = new ResizeObserver(V);
|
|
1032
|
+
return ue.observe(b), () => {
|
|
1033
|
+
ue.disconnect();
|
|
1057
1034
|
};
|
|
1058
|
-
}, [e,
|
|
1059
|
-
|
|
1060
|
-
}, [
|
|
1061
|
-
if (
|
|
1035
|
+
}, [e, Xe]), Je(() => {
|
|
1036
|
+
Xe && n?.(de);
|
|
1037
|
+
}, [Xe, de, n]), Je(() => {
|
|
1038
|
+
if (Xe)
|
|
1062
1039
|
return;
|
|
1063
|
-
const
|
|
1064
|
-
if (!
|
|
1040
|
+
const b = re.current;
|
|
1041
|
+
if (!b)
|
|
1065
1042
|
return;
|
|
1066
|
-
const
|
|
1067
|
-
const
|
|
1068
|
-
if (
|
|
1043
|
+
const V = () => {
|
|
1044
|
+
const Z = b.clientHeight;
|
|
1045
|
+
if (Z <= 0 || Math.abs(Z - xe) <= 1)
|
|
1069
1046
|
return;
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1072
|
-
`[ScrollPane] viewportSize=${xe} but the host band is ${
|
|
1047
|
+
const se = `${xe}/${Z}`;
|
|
1048
|
+
te.current !== se && (te.current = se, A.warn(
|
|
1049
|
+
`[ScrollPane] viewportSize=${xe} but the host band is ${Z}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
|
|
1073
1050
|
));
|
|
1074
1051
|
};
|
|
1075
|
-
if (
|
|
1052
|
+
if (V(), typeof ResizeObserver != "function")
|
|
1076
1053
|
return;
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1079
|
-
|
|
1054
|
+
const ue = new ResizeObserver(V);
|
|
1055
|
+
return ue.observe(b), () => {
|
|
1056
|
+
ue.disconnect();
|
|
1080
1057
|
};
|
|
1081
|
-
}, [
|
|
1058
|
+
}, [Xe, xe]);
|
|
1082
1059
|
const Qe = d(ce);
|
|
1083
1060
|
X(() => {
|
|
1084
1061
|
Qe.current = ce;
|
|
@@ -1094,161 +1071,161 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1094
1071
|
generation: 0
|
|
1095
1072
|
}), wt = Me(
|
|
1096
1073
|
() => ({
|
|
1097
|
-
maxVelocity: F?.maxVelocity ??
|
|
1098
|
-
minVelocity: F?.minVelocity ??
|
|
1099
|
-
deceleration: F?.deceleration ??
|
|
1100
|
-
velocitySampleWindow: F?.velocitySampleWindow ??
|
|
1101
|
-
startVelocityThreshold: F?.startVelocityThreshold ??
|
|
1074
|
+
maxVelocity: F?.maxVelocity ?? br.maxVelocity,
|
|
1075
|
+
minVelocity: F?.minVelocity ?? br.minVelocity,
|
|
1076
|
+
deceleration: F?.deceleration ?? br.deceleration,
|
|
1077
|
+
velocitySampleWindow: F?.velocitySampleWindow ?? br.velocitySampleWindow,
|
|
1078
|
+
startVelocityThreshold: F?.startVelocityThreshold ?? br.startVelocityThreshold
|
|
1102
1079
|
}),
|
|
1103
1080
|
[F]
|
|
1104
1081
|
), qe = Me(() => ({
|
|
1105
|
-
top: Math.max(0,
|
|
1106
|
-
bottom: Math.max(0,
|
|
1107
|
-
}), [
|
|
1082
|
+
top: Math.max(0, P?.top ?? 0),
|
|
1083
|
+
bottom: Math.max(0, P?.bottom ?? 0)
|
|
1084
|
+
}), [P]);
|
|
1108
1085
|
A.debug("[ScrollPane] ScrollPane rendered", () => ({
|
|
1109
1086
|
contentSize: e,
|
|
1110
1087
|
viewportSize: xe,
|
|
1111
1088
|
scrollBarWidth: i,
|
|
1112
1089
|
className: R,
|
|
1113
1090
|
style: S,
|
|
1114
|
-
tapScrollCircleOptions:
|
|
1091
|
+
tapScrollCircleOptions: j,
|
|
1115
1092
|
inertiaOptions: F,
|
|
1116
1093
|
enablePointerDrag: f,
|
|
1117
1094
|
contentInsets: qe
|
|
1118
1095
|
}));
|
|
1119
|
-
const
|
|
1120
|
-
(
|
|
1121
|
-
let
|
|
1122
|
-
|
|
1123
|
-
const { contentSize:
|
|
1124
|
-
if (A.debug("[ScrollPane] scrollTo called", () => ({ newPosition:
|
|
1125
|
-
return y.current !== 0 && (y.current = 0,
|
|
1126
|
-
const ve = typeof
|
|
1096
|
+
const Ye = d({ contentSize: e, viewportSize: xe }), Ne = Me(() => e > xe, [e, xe]), ct = w(
|
|
1097
|
+
(b, V) => {
|
|
1098
|
+
let ue = V ?? Ye.current;
|
|
1099
|
+
V && !(Number.isFinite(V.contentSize) && Number.isFinite(V.viewportSize)) && (A.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: V }), ue = Ye.current);
|
|
1100
|
+
const { contentSize: Z, viewportSize: se } = ue, me = Z > se, Ge = y.current;
|
|
1101
|
+
if (A.debug("[ScrollPane] scrollTo called", () => ({ newPosition: b, contentSize: Z, viewportSize: se, currentIsScrollable: me, prevPosition: Ge })), !me)
|
|
1102
|
+
return y.current !== 0 && (y.current = 0, x?.(0, Ge)), y.current;
|
|
1103
|
+
const ve = typeof b == "function" ? b(y.current) : b;
|
|
1127
1104
|
if (!Number.isFinite(ve))
|
|
1128
1105
|
return A.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: ve }), y.current;
|
|
1129
|
-
const
|
|
1130
|
-
return y.current !== Ie && (y.current = Ie,
|
|
1106
|
+
const Be = Math.max(Z - se, 0), Ie = ee(ve, 0, Be);
|
|
1107
|
+
return y.current !== Ie && (y.current = Ie, x?.(Ie, Ge)), y.current;
|
|
1131
1108
|
},
|
|
1132
|
-
[
|
|
1133
|
-
),
|
|
1109
|
+
[x]
|
|
1110
|
+
), Q = d(ct);
|
|
1134
1111
|
X(() => {
|
|
1135
|
-
|
|
1136
|
-
}, [
|
|
1137
|
-
const
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1140
|
-
}, []), Re = d(
|
|
1112
|
+
Q.current = ct;
|
|
1113
|
+
}, [ct]);
|
|
1114
|
+
const Le = w(() => {
|
|
1115
|
+
const b = et.current;
|
|
1116
|
+
b.generation += 1, b.frame !== null && cancelAnimationFrame(b.frame), b.frame = null, b.velocity = 0, b.lastTimestamp = null;
|
|
1117
|
+
}, []), Re = d(Le);
|
|
1141
1118
|
X(() => {
|
|
1142
|
-
Re.current =
|
|
1143
|
-
}, [
|
|
1119
|
+
Re.current = Le;
|
|
1120
|
+
}, [Le]), X(() => () => {
|
|
1144
1121
|
Re.current();
|
|
1145
1122
|
}, []);
|
|
1146
|
-
const
|
|
1147
|
-
(
|
|
1148
|
-
if (!
|
|
1123
|
+
const le = w(
|
|
1124
|
+
(b) => {
|
|
1125
|
+
if (!Ne)
|
|
1149
1126
|
return;
|
|
1150
|
-
const { maxVelocity:
|
|
1151
|
-
if (Math.abs(me) <
|
|
1127
|
+
const { maxVelocity: V, minVelocity: ue, deceleration: Z, startVelocityThreshold: se } = wt, me = ee(b, -V, V);
|
|
1128
|
+
if (Math.abs(me) < se)
|
|
1152
1129
|
return;
|
|
1153
|
-
|
|
1154
|
-
const Ge = et.current.generation, ve = (
|
|
1130
|
+
Le(), et.current.velocity = me, et.current.lastTimestamp = null;
|
|
1131
|
+
const Ge = et.current.generation, ve = (Be) => {
|
|
1155
1132
|
const Ie = et.current;
|
|
1156
1133
|
if (Ie.generation !== Ge)
|
|
1157
1134
|
return;
|
|
1158
1135
|
if (Ie.lastTimestamp === null) {
|
|
1159
|
-
Ie.lastTimestamp =
|
|
1136
|
+
Ie.lastTimestamp = Be, Ie.frame = requestAnimationFrame(ve);
|
|
1160
1137
|
return;
|
|
1161
1138
|
}
|
|
1162
|
-
const
|
|
1163
|
-
if (Ie.lastTimestamp =
|
|
1139
|
+
const Oe = Be - Ie.lastTimestamp;
|
|
1140
|
+
if (Ie.lastTimestamp = Be, Oe <= 0) {
|
|
1164
1141
|
Ie.frame = requestAnimationFrame(ve);
|
|
1165
1142
|
return;
|
|
1166
1143
|
}
|
|
1167
1144
|
const mt = Ie.velocity;
|
|
1168
1145
|
let rt = mt;
|
|
1169
|
-
const nt =
|
|
1146
|
+
const nt = Z * Oe;
|
|
1170
1147
|
mt > 0 ? rt = Math.max(0, mt - nt) : mt < 0 && (rt = Math.min(0, mt + nt));
|
|
1171
|
-
const
|
|
1172
|
-
if (
|
|
1148
|
+
const lt = (mt + rt) / 2 * Oe, we = y.current;
|
|
1149
|
+
if (lt !== 0 && Q.current((it) => it + lt), et.current.generation !== Ge)
|
|
1173
1150
|
return;
|
|
1174
|
-
const pe = y.current, { contentSize: Mt, viewportSize: m } =
|
|
1151
|
+
const pe = y.current, { contentSize: Mt, viewportSize: m } = Ye.current, z = Math.max(Mt - m, 0);
|
|
1175
1152
|
Ie.velocity = rt;
|
|
1176
1153
|
const Pe = pe === we || pe <= 0 && rt <= 0 || pe >= z && rt >= 0;
|
|
1177
|
-
if (Math.abs(rt) <
|
|
1178
|
-
|
|
1154
|
+
if (Math.abs(rt) < ue || Pe) {
|
|
1155
|
+
Le();
|
|
1179
1156
|
return;
|
|
1180
1157
|
}
|
|
1181
1158
|
Ie.frame = requestAnimationFrame(ve);
|
|
1182
1159
|
};
|
|
1183
1160
|
et.current.frame = requestAnimationFrame(ve);
|
|
1184
1161
|
},
|
|
1185
|
-
[
|
|
1186
|
-
), be = d(
|
|
1162
|
+
[Ne, wt, Le]
|
|
1163
|
+
), be = d(le);
|
|
1187
1164
|
X(() => {
|
|
1188
|
-
be.current =
|
|
1189
|
-
}, [
|
|
1190
|
-
|
|
1165
|
+
be.current = le;
|
|
1166
|
+
}, [le]), Je(() => {
|
|
1167
|
+
Ye.current = { contentSize: e, viewportSize: xe };
|
|
1191
1168
|
}, [e, xe]), Je(() => {
|
|
1192
|
-
const
|
|
1193
|
-
if (!
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1169
|
+
const b = ne.current;
|
|
1170
|
+
if (!b) return;
|
|
1171
|
+
const V = () => {
|
|
1172
|
+
b.scrollTop !== 0 && (A.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: b.scrollTop })), b.scrollTop = 0), b.scrollLeft !== 0 && (b.scrollLeft = 0);
|
|
1196
1173
|
};
|
|
1197
|
-
return
|
|
1174
|
+
return b.addEventListener("scroll", V), () => b.removeEventListener("scroll", V);
|
|
1198
1175
|
}, []), Je(() => {
|
|
1199
|
-
if (
|
|
1176
|
+
if (Ne) {
|
|
1200
1177
|
A.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: xe, scrollPosition: y.current }));
|
|
1201
|
-
const
|
|
1202
|
-
y.current >
|
|
1178
|
+
const b = ee(e - xe, 0, e);
|
|
1179
|
+
y.current > b && ct(b);
|
|
1203
1180
|
} else
|
|
1204
|
-
|
|
1205
|
-
}, [
|
|
1206
|
-
const fe = d({ isScrollable:
|
|
1181
|
+
ct(0);
|
|
1182
|
+
}, [Ne, ct, e, xe]);
|
|
1183
|
+
const fe = d({ isScrollable: Ne, viewportSize: xe, wheelSpeedMultiplier: D, overscrollBehavior: k });
|
|
1207
1184
|
Je(() => {
|
|
1208
|
-
fe.current = { isScrollable:
|
|
1209
|
-
}, [
|
|
1185
|
+
fe.current = { isScrollable: Ne, viewportSize: xe, wheelSpeedMultiplier: D, overscrollBehavior: k };
|
|
1186
|
+
}, [Ne, xe, D, k]);
|
|
1210
1187
|
const xt = w(
|
|
1211
|
-
(
|
|
1212
|
-
if (
|
|
1188
|
+
(b) => {
|
|
1189
|
+
if (li(b))
|
|
1213
1190
|
return !1;
|
|
1214
|
-
const { isScrollable:
|
|
1191
|
+
const { isScrollable: V, viewportSize: ue, wheelSpeedMultiplier: Z, overscrollBehavior: se } = fe.current, me = ci(b, ue);
|
|
1215
1192
|
if (me.isZoomGesture)
|
|
1216
1193
|
return !1;
|
|
1217
1194
|
if (me.isHorizontalDominant)
|
|
1218
|
-
return Qe.current ? (
|
|
1219
|
-
if (!
|
|
1195
|
+
return Qe.current ? (un(b), b.preventDefault(), Le(), Qe.current(me.horizontalDelta), !0) : !1;
|
|
1196
|
+
if (!V || me.verticalDelta === 0)
|
|
1220
1197
|
return !1;
|
|
1221
1198
|
let Ge = me.verticalDelta;
|
|
1222
|
-
if (
|
|
1223
|
-
const ve = y.current,
|
|
1224
|
-
if (Ge > 0 && ve >=
|
|
1199
|
+
if (Z !== 1 && (Ge *= Z), se !== "contain") {
|
|
1200
|
+
const ve = y.current, Be = Math.max(Ye.current.contentSize - ue, 0);
|
|
1201
|
+
if (Ge > 0 && ve >= Be || Ge < 0 && ve <= 0)
|
|
1225
1202
|
return !1;
|
|
1226
1203
|
}
|
|
1227
|
-
return
|
|
1204
|
+
return un(b), b.preventDefault(), Le(), A.debug("[ScrollPane] wheel event", () => ({ deltaY: Ge, scrollPosition: y.current, wheelSpeedMultiplier: Z, deltaMode: b.deltaMode, scrollTop: ne.current?.scrollTop })), ct((ve) => ve + Ge), !0;
|
|
1228
1205
|
},
|
|
1229
|
-
[
|
|
1206
|
+
[ct, Le]
|
|
1230
1207
|
);
|
|
1231
1208
|
X(() => {
|
|
1232
|
-
const
|
|
1233
|
-
xt(
|
|
1234
|
-
},
|
|
1235
|
-
|
|
1236
|
-
},
|
|
1237
|
-
return
|
|
1238
|
-
|
|
1209
|
+
const b = (Z) => {
|
|
1210
|
+
xt(Z);
|
|
1211
|
+
}, V = () => {
|
|
1212
|
+
Le();
|
|
1213
|
+
}, ue = re.current;
|
|
1214
|
+
return ue && (ue.addEventListener("wheel", b, { passive: !1 }), ue.addEventListener("pointerdown", V, { capture: !0, passive: !0 })), () => {
|
|
1215
|
+
ue && (ue.removeEventListener("wheel", b), ue.removeEventListener("pointerdown", V, { capture: !0 }));
|
|
1239
1216
|
};
|
|
1240
|
-
}, [xt,
|
|
1241
|
-
|
|
1217
|
+
}, [xt, Le]), Ar(
|
|
1218
|
+
$e,
|
|
1242
1219
|
() => ({
|
|
1243
|
-
scrollTo: (
|
|
1220
|
+
scrollTo: (b, V) => (Le(), ct(b, V)),
|
|
1244
1221
|
getScrollPosition: () => y.current,
|
|
1245
1222
|
getContentSize: () => e,
|
|
1246
1223
|
getViewportSize: () => xe,
|
|
1247
1224
|
applyWheel: xt
|
|
1248
1225
|
}),
|
|
1249
|
-
[
|
|
1226
|
+
[ct, e, xe, Le, xt]
|
|
1250
1227
|
);
|
|
1251
|
-
const M =
|
|
1228
|
+
const M = $n(), Fe = J?.id ?? M, he = d({
|
|
1252
1229
|
pointerType: "",
|
|
1253
1230
|
pointerId: null,
|
|
1254
1231
|
startClientY: 0,
|
|
@@ -1261,85 +1238,78 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1261
1238
|
velocitySamples: [],
|
|
1262
1239
|
scale: 1,
|
|
1263
1240
|
scaleX: 1
|
|
1264
|
-
}),
|
|
1241
|
+
}), _ = d(f), dt = d(g);
|
|
1265
1242
|
X(() => {
|
|
1266
|
-
|
|
1243
|
+
_.current = f;
|
|
1267
1244
|
}, [f]), X(() => {
|
|
1268
1245
|
dt.current = g;
|
|
1269
1246
|
}, [g]);
|
|
1270
|
-
const tt = d(
|
|
1247
|
+
const tt = d(Ne);
|
|
1271
1248
|
X(() => {
|
|
1272
|
-
tt.current =
|
|
1273
|
-
}, [
|
|
1274
|
-
const
|
|
1249
|
+
tt.current = Ne;
|
|
1250
|
+
}, [Ne]);
|
|
1251
|
+
const Vt = d(wt);
|
|
1275
1252
|
X(() => {
|
|
1276
|
-
|
|
1253
|
+
Vt.current = wt;
|
|
1277
1254
|
}, [wt]), X(() => {
|
|
1278
|
-
const
|
|
1279
|
-
if (f &&
|
|
1255
|
+
const b = he.current;
|
|
1256
|
+
if (f && Ne && (b.pointerId === null || Fr(b.pointerType, g)) || b.pointerId === null)
|
|
1280
1257
|
return;
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1285
|
-
}, [f, g,
|
|
1286
|
-
const
|
|
1287
|
-
if (!
|
|
1258
|
+
const V = ne.current;
|
|
1259
|
+
b.clickResetTimer !== null && (window.clearTimeout(b.clickResetTimer), b.clickResetTimer = null);
|
|
1260
|
+
const ue = b.isDragging && b.shouldCancelNextClick, Z = b.pointerId;
|
|
1261
|
+
b.pointerId = null, b.pointerType = "", b.startClientY = 0, b.startScroll = 0, b.isDragging = !1, b.shouldCancelNextClick = ue, b.velocitySamples = [], b.scale = 1, V !== null && sr(V, Z);
|
|
1262
|
+
}, [f, g, Ne]), X(() => {
|
|
1263
|
+
const b = ne.current;
|
|
1264
|
+
if (!b)
|
|
1288
1265
|
return;
|
|
1289
|
-
const
|
|
1266
|
+
const V = 6, ue = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), Z = () => {
|
|
1290
1267
|
const m = he.current;
|
|
1291
1268
|
m.pointerId = null, m.pointerType = "", m.startClientY = 0, m.startScroll = 0, m.isDragging = !1, m.velocitySamples = [], m.scale = 1;
|
|
1292
|
-
},
|
|
1269
|
+
}, se = () => {
|
|
1293
1270
|
const m = he.current;
|
|
1294
1271
|
m.clickResetTimer !== null && (window.clearTimeout(m.clickResetTimer), m.clickResetTimer = null);
|
|
1295
1272
|
}, me = (m) => {
|
|
1296
|
-
const z = he.current, Pe =
|
|
1273
|
+
const z = he.current, Pe = ue();
|
|
1297
1274
|
z.velocitySamples.push({ clientY: m, time: Pe });
|
|
1298
|
-
const it =
|
|
1299
|
-
z.velocitySamples = z.velocitySamples.filter((
|
|
1275
|
+
const it = Vt.current.velocitySampleWindow;
|
|
1276
|
+
z.velocitySamples = z.velocitySamples.filter((Ve) => Pe - Ve.time <= it);
|
|
1300
1277
|
}, Ge = (m) => m instanceof HTMLElement && m.closest("[data-scrollpane-ignore-drag='true']") !== null, ve = (m) => {
|
|
1301
1278
|
const z = he.current;
|
|
1302
1279
|
z.shouldCancelNextClick && (m.preventDefault(), m.stopPropagation(), z.shouldCancelNextClick = !1);
|
|
1303
|
-
},
|
|
1280
|
+
}, Be = (m) => {
|
|
1304
1281
|
const z = he.current;
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
try {
|
|
1308
|
-
x.setPointerCapture(m.pointerId);
|
|
1309
|
-
} catch {
|
|
1310
|
-
}
|
|
1311
|
-
me(m.clientY);
|
|
1312
|
-
}
|
|
1313
|
-
}, Ie = (m) => m.isTrusted || m.target === x, _e = (m) => {
|
|
1282
|
+
z.isDragging || (z.isDragging = !0, z.shouldCancelNextClick = !0, Tn(b, m.pointerId) || wr(b, m.pointerId), me(m.clientY));
|
|
1283
|
+
}, Ie = (m) => m.isTrusted || m.target === b, Oe = (m) => {
|
|
1314
1284
|
const z = he.current;
|
|
1315
|
-
|
|
1285
|
+
sr(b, m), z.shouldCancelNextClick = !1, se(), Z();
|
|
1316
1286
|
}, mt = (m) => {
|
|
1317
1287
|
const z = he.current;
|
|
1318
1288
|
if (z.pointerId !== m.pointerId)
|
|
1319
1289
|
return;
|
|
1320
|
-
if (m.buttons === 0 &&
|
|
1321
|
-
|
|
1290
|
+
if (m.buttons === 0 && di(m.pointerType)) {
|
|
1291
|
+
Oe(m.pointerId);
|
|
1322
1292
|
return;
|
|
1323
1293
|
}
|
|
1324
|
-
if (!(
|
|
1294
|
+
if (!(_.current && tt.current) || !Fr(m.pointerType, dt.current))
|
|
1325
1295
|
return;
|
|
1326
1296
|
if (!z.isDragging) {
|
|
1327
1297
|
const Pt = Math.abs(m.clientY - z.startClientY), st = at.current ? Math.abs(m.clientX - z.startClientX) : 0;
|
|
1328
|
-
if (Math.max(Pt, st) <
|
|
1298
|
+
if (Math.max(Pt, st) < V || (Be(m), !z.isDragging))
|
|
1329
1299
|
return;
|
|
1330
1300
|
}
|
|
1331
1301
|
me(m.clientY);
|
|
1332
1302
|
const Pe = (m.clientY - z.startClientY) / (z.scale || 1), it = z.startScroll - Pe;
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
if (
|
|
1303
|
+
Q.current(it);
|
|
1304
|
+
const Ve = at.current;
|
|
1305
|
+
if (Ve) {
|
|
1336
1306
|
const Pt = m.clientX - z.lastPanClientX;
|
|
1337
|
-
z.lastPanClientX = m.clientX, Pt !== 0 &&
|
|
1307
|
+
z.lastPanClientX = m.clientX, Pt !== 0 && Ve(-Pt / (z.scaleX || 1));
|
|
1338
1308
|
}
|
|
1339
1309
|
m.cancelable && m.preventDefault();
|
|
1340
1310
|
}, rt = () => {
|
|
1341
1311
|
const m = he.current;
|
|
1342
|
-
return m.pointerId !== null || !m.shouldCancelNextClick ? !1 : (
|
|
1312
|
+
return m.pointerId !== null || !m.shouldCancelNextClick ? !1 : (se(), m.clickResetTimer = window.setTimeout(() => {
|
|
1343
1313
|
const z = he.current;
|
|
1344
1314
|
z.shouldCancelNextClick = !1, z.clickResetTimer = null;
|
|
1345
1315
|
}, 0), !0);
|
|
@@ -1352,69 +1322,69 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1352
1322
|
z.isDragging && z.shouldCancelNextClick && m.cancelable && (m.preventDefault(), m.stopPropagation()), z.isDragging && me(m.clientY);
|
|
1353
1323
|
let Pe = 0;
|
|
1354
1324
|
if (z.isDragging && z.velocitySamples.length >= 2) {
|
|
1355
|
-
const
|
|
1325
|
+
const Ve = z.velocitySamples, Pt = Vt.current.velocitySampleWindow, st = Ve[Ve.length - 1], ut = Ve.find((Ce) => st.time - Ce.time <= Pt) ?? Ve[0];
|
|
1356
1326
|
if (st && ut && st.time !== ut.time) {
|
|
1357
|
-
const
|
|
1358
|
-
Pe = -(
|
|
1327
|
+
const Ce = st.clientY - ut.clientY, Yt = st.time - ut.time;
|
|
1328
|
+
Pe = -(Ce / Yt) / (z.scale || 1);
|
|
1359
1329
|
}
|
|
1360
1330
|
}
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1331
|
+
se(), z.shouldCancelNextClick && (z.clickResetTimer = window.setTimeout(() => {
|
|
1332
|
+
const Ve = he.current;
|
|
1333
|
+
Ve.shouldCancelNextClick = !1, Ve.clickResetTimer = null;
|
|
1364
1334
|
}, 0));
|
|
1365
|
-
const it =
|
|
1366
|
-
|
|
1367
|
-
},
|
|
1335
|
+
const it = Vt.current.startVelocityThreshold;
|
|
1336
|
+
Z(), sr(b, m.pointerId), Math.abs(Pe) >= it && be.current?.(Pe);
|
|
1337
|
+
}, ke = (m) => {
|
|
1368
1338
|
if (he.current.pointerId !== null) {
|
|
1369
1339
|
if (!m.isPrimary || m.pointerType !== he.current.pointerType)
|
|
1370
1340
|
return;
|
|
1371
|
-
|
|
1341
|
+
Oe(he.current.pointerId);
|
|
1372
1342
|
}
|
|
1373
|
-
if (he.current.shouldCancelNextClick && (
|
|
1343
|
+
if (he.current.shouldCancelNextClick && (se(), he.current.shouldCancelNextClick = !1), !(_.current && tt.current) || !Fr(m.pointerType, dt.current) || m.button !== 0 && m.pointerType === "mouse" || m.ctrlKey || m.metaKey || m.altKey || Ge(m.target))
|
|
1374
1344
|
return;
|
|
1375
|
-
window.dispatchEvent(new CustomEvent(
|
|
1345
|
+
window.dispatchEvent(new CustomEvent(Sr, { detail: { paneId: M } })), Re.current?.();
|
|
1376
1346
|
const z = he.current;
|
|
1377
|
-
|
|
1378
|
-
},
|
|
1347
|
+
se(), z.pointerId = m.pointerId, z.pointerType = m.pointerType, z.startClientY = m.clientY, z.startClientX = m.clientX, z.lastPanClientX = m.clientX, z.startScroll = y.current, z.scale = Yr(b, "y"), z.scaleX = at.current ? Yr(b, "x") : 1, z.isDragging = !1, z.shouldCancelNextClick = !1, z.velocitySamples = [];
|
|
1348
|
+
}, lt = (m) => {
|
|
1379
1349
|
if (he.current.pointerId !== m.pointerId) {
|
|
1380
1350
|
rt();
|
|
1381
1351
|
return;
|
|
1382
1352
|
}
|
|
1383
|
-
Ie(m) &&
|
|
1353
|
+
Ie(m) && Oe(m.pointerId);
|
|
1384
1354
|
}, pe = [
|
|
1385
1355
|
["click", ve, !0],
|
|
1386
|
-
["pointerdown",
|
|
1356
|
+
["pointerdown", ke, { passive: !1 }],
|
|
1387
1357
|
["lostpointercapture", (m) => {
|
|
1388
|
-
m.target !==
|
|
1358
|
+
m.target !== b || he.current.pointerId !== m.pointerId || Oe(m.pointerId);
|
|
1389
1359
|
}, void 0]
|
|
1390
1360
|
], Mt = [
|
|
1391
1361
|
["pointermove", mt, { passive: !1 }],
|
|
1392
1362
|
["pointerup", nt, void 0],
|
|
1393
|
-
["pointercancel",
|
|
1363
|
+
["pointercancel", lt, void 0]
|
|
1394
1364
|
];
|
|
1395
|
-
return
|
|
1396
|
-
|
|
1365
|
+
return Er(b, pe, "add"), Er(window, Mt, "add"), () => {
|
|
1366
|
+
Er(b, pe, "remove"), Er(window, Mt, "remove");
|
|
1397
1367
|
const m = he.current;
|
|
1398
|
-
m.pointerId !== null &&
|
|
1368
|
+
m.pointerId !== null && sr(b, m.pointerId), se(), Z();
|
|
1399
1369
|
};
|
|
1400
1370
|
}, [M]);
|
|
1401
1371
|
const St = w(
|
|
1402
|
-
(
|
|
1403
|
-
[
|
|
1372
|
+
(b) => (Le(), ct(b)),
|
|
1373
|
+
[ct, Le]
|
|
1404
1374
|
);
|
|
1405
|
-
return /* @__PURE__ */ qt("div", { ref:
|
|
1375
|
+
return /* @__PURE__ */ qt("div", { ref: re, "data-testid": T, "data-self-measured": Xe ? "true" : void 0, className: Nt("aqvs-scroll-pane", R), style: S, children: [
|
|
1406
1376
|
/* @__PURE__ */ qt(
|
|
1407
1377
|
"div",
|
|
1408
1378
|
{
|
|
1409
1379
|
ref: ne,
|
|
1410
|
-
className:
|
|
1380
|
+
className: Nt("aqvs-scroll-pane-content"),
|
|
1411
1381
|
"data-testid": "aqvs-scroll-pane-content",
|
|
1412
1382
|
style: {
|
|
1413
1383
|
// ❗ 自己計測モードでは高さを書かない。CSS の `height: 100%` (= ルートの確定高さ) が
|
|
1414
1384
|
// レイアウトを所有することで、「計測した値を書き戻して自分のサイズを変える」
|
|
1415
1385
|
// フィードバックループが構造的に起こらず、初回 paint の時点でも帯は実寸で正しい
|
|
1416
1386
|
// (数値の反映だけが 1 コミット遅れる)。明示モードは従来どおり px を書く。
|
|
1417
|
-
height:
|
|
1387
|
+
height: Xe ? void 0 : xe,
|
|
1418
1388
|
paddingTop: qe.top,
|
|
1419
1389
|
paddingBottom: qe.bottom,
|
|
1420
1390
|
// スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
|
|
@@ -1430,35 +1400,35 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1430
1400
|
// 同一条件で揃えてあるため状態としても一貫している。
|
|
1431
1401
|
// 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
|
|
1432
1402
|
// (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
|
|
1433
|
-
...f &&
|
|
1403
|
+
...f && Ne && g.some((b) => b === "touch" || b === "pen") ? { touchAction: "none" } : {}
|
|
1434
1404
|
},
|
|
1435
|
-
...
|
|
1436
|
-
id:
|
|
1405
|
+
...J,
|
|
1406
|
+
id: Fe,
|
|
1437
1407
|
children: [
|
|
1438
|
-
|
|
1408
|
+
N,
|
|
1439
1409
|
t(y.current)
|
|
1440
1410
|
]
|
|
1441
1411
|
}
|
|
1442
1412
|
),
|
|
1443
1413
|
/* @__PURE__ */ U(
|
|
1444
|
-
|
|
1414
|
+
En,
|
|
1445
1415
|
{
|
|
1446
1416
|
contentSize: e,
|
|
1447
1417
|
viewportSize: xe,
|
|
1448
|
-
stretchMainSize:
|
|
1418
|
+
stretchMainSize: Xe,
|
|
1449
1419
|
scrollPosition: y.current,
|
|
1450
1420
|
onScroll: St,
|
|
1451
1421
|
enableThumbDrag: s,
|
|
1452
1422
|
enableTrackClick: o,
|
|
1453
|
-
enableArrowButtons:
|
|
1423
|
+
enableArrowButtons: l,
|
|
1454
1424
|
scrollBarWidth: i,
|
|
1455
|
-
ariaControls:
|
|
1456
|
-
tapScrollCircleOptions:
|
|
1425
|
+
ariaControls: Fe,
|
|
1426
|
+
tapScrollCircleOptions: j,
|
|
1457
1427
|
itemCount: Te,
|
|
1458
1428
|
renderThumbOverlay: ze,
|
|
1459
|
-
visibleStartIndex:
|
|
1460
|
-
visibleEndIndex:
|
|
1461
|
-
locale:
|
|
1429
|
+
visibleStartIndex: C,
|
|
1430
|
+
visibleEndIndex: K,
|
|
1431
|
+
locale: ie,
|
|
1462
1432
|
labels: ge
|
|
1463
1433
|
},
|
|
1464
1434
|
"scrollbar"
|
|
@@ -1466,16 +1436,16 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1466
1436
|
B?.()
|
|
1467
1437
|
] });
|
|
1468
1438
|
}
|
|
1469
|
-
),
|
|
1470
|
-
const i = Math.max(n / 2, 1), s = 1 + e * 0.65, o = Math.max(0.65, 1 - e * 0.25),
|
|
1471
|
-
return /* @__PURE__ */ qt(
|
|
1439
|
+
), dn = (t, e, r) => Math.min(Math.max(t, e), r), _i = ({ dragState: t, normalizedDistance: e, sizeScale: r, size: n }) => {
|
|
1440
|
+
const i = Math.max(n / 2, 1), s = 1 + e * 0.65, o = Math.max(0.65, 1 - e * 0.25), l = t.direction * e * 26 * r, f = 0.8 + e * 0.18, g = 3 * r, x = 6 * r, R = 22 * r, T = Math.abs(l) + x, S = l > 0 ? g : -Math.abs(l) - g, N = Math.max(2.5, 3 * r), j = dn(t.offsetX, -i, i), F = dn(t.offsetY, -i, i), Te = i * 0.35, ze = j / i * Te, D = F / i * Te, k = ze * 0.45, ce = D * 0.45, L = Math.max(R * 0.38, 6), P = 0.65 + e * 0.2, C = t.active;
|
|
1441
|
+
return /* @__PURE__ */ qt(Gr, { children: [
|
|
1472
1442
|
/* @__PURE__ */ U(
|
|
1473
1443
|
"div",
|
|
1474
1444
|
{
|
|
1475
1445
|
className: "aqvs-tap-scroll-circle-gradient",
|
|
1476
1446
|
style: {
|
|
1477
1447
|
transform: `scale(${o}, ${s})`,
|
|
1478
|
-
transition:
|
|
1448
|
+
transition: C ? "40ms transform ease-out" : "200ms ease transform"
|
|
1479
1449
|
}
|
|
1480
1450
|
}
|
|
1481
1451
|
),
|
|
@@ -1487,7 +1457,7 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1487
1457
|
width: R,
|
|
1488
1458
|
height: R,
|
|
1489
1459
|
transform: `translate(calc(-50% + ${ze}px), calc(-50% + ${D}px)) scale(${o}, ${f * s})`,
|
|
1490
|
-
transition:
|
|
1460
|
+
transition: C ? "70ms transform ease-out" : "200ms ease transform"
|
|
1491
1461
|
}
|
|
1492
1462
|
}
|
|
1493
1463
|
),
|
|
@@ -1499,9 +1469,9 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1499
1469
|
width: L,
|
|
1500
1470
|
height: L,
|
|
1501
1471
|
transform: `translate(calc(-50% + ${k}px), calc(-50% + ${ce}px)) scale(${o}, ${s})`,
|
|
1502
|
-
opacity:
|
|
1472
|
+
opacity: P,
|
|
1503
1473
|
boxShadow: "0 0 8px rgba(255,255,255,0.45)",
|
|
1504
|
-
transition:
|
|
1474
|
+
transition: C ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
|
|
1505
1475
|
}
|
|
1506
1476
|
}
|
|
1507
1477
|
),
|
|
@@ -1510,25 +1480,25 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
|
|
|
1510
1480
|
{
|
|
1511
1481
|
className: "aqvs-sample-visual-rod",
|
|
1512
1482
|
style: {
|
|
1513
|
-
width:
|
|
1483
|
+
width: N,
|
|
1514
1484
|
height: T,
|
|
1515
1485
|
transform: `translate(-50%, ${S}px)`,
|
|
1516
1486
|
opacity: e,
|
|
1517
|
-
transition:
|
|
1487
|
+
transition: C ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
|
|
1518
1488
|
}
|
|
1519
1489
|
}
|
|
1520
1490
|
)
|
|
1521
1491
|
] });
|
|
1522
|
-
},
|
|
1492
|
+
}, fr = 100, hi = (t) => {
|
|
1523
1493
|
if (!Number.isFinite(t))
|
|
1524
1494
|
return 0n;
|
|
1525
1495
|
const e = Math.trunc(t);
|
|
1526
1496
|
return e <= 0 ? 0n : BigInt(e);
|
|
1527
|
-
},
|
|
1497
|
+
}, kr = (t, e) => {
|
|
1528
1498
|
if (!Number.isFinite(t))
|
|
1529
1499
|
throw new Error(`valueFn returned a non-finite value at index ${e}: ${t}`);
|
|
1530
1500
|
return t;
|
|
1531
|
-
},
|
|
1501
|
+
}, hr = (t) => {
|
|
1532
1502
|
if (t <= 0 || !Number.isFinite(t))
|
|
1533
1503
|
return 0;
|
|
1534
1504
|
const e = Math.trunc(t);
|
|
@@ -1602,25 +1572,25 @@ class Kt {
|
|
|
1602
1572
|
return;
|
|
1603
1573
|
}
|
|
1604
1574
|
let s = 0, o;
|
|
1605
|
-
const
|
|
1606
|
-
if (
|
|
1607
|
-
throw new RangeError(`[FenwickMapTree] options.baseValue must be a finite number >= 0, received ${
|
|
1608
|
-
if (i > 0 &&
|
|
1609
|
-
if (s =
|
|
1610
|
-
const f = n?.sampleRange ?? { from: 0, to: Math.min(
|
|
1611
|
-
let g = Math.max(0, Math.trunc(f.from)),
|
|
1612
|
-
g >
|
|
1575
|
+
const l = n?.baseValue;
|
|
1576
|
+
if (l !== void 0 && !(Number.isFinite(l) && l >= 0))
|
|
1577
|
+
throw new RangeError(`[FenwickMapTree] options.baseValue must be a finite number >= 0, received ${l}.`);
|
|
1578
|
+
if (i > 0 && l !== void 0) {
|
|
1579
|
+
if (s = l, n?.materialize) {
|
|
1580
|
+
const f = n?.sampleRange ?? { from: 0, to: Math.min(fr - 1, i - 1) };
|
|
1581
|
+
let g = Math.max(0, Math.trunc(f.from)), x = Math.min(Math.trunc(f.to), i - 1);
|
|
1582
|
+
g > x && (g = 0, x = Math.min(fr - 1, i - 1)), o = { from: g, values: Kt._collectValidatedValues(r, g, x) };
|
|
1613
1583
|
}
|
|
1614
1584
|
} else if (i > 0) {
|
|
1615
1585
|
const f = n?.sampleRange ?? {
|
|
1616
1586
|
from: 0,
|
|
1617
|
-
to: Math.min(
|
|
1587
|
+
to: Math.min(fr - 1, i - 1)
|
|
1618
1588
|
};
|
|
1619
|
-
let g = Math.max(0, Math.trunc(f.from)),
|
|
1620
|
-
if (g >
|
|
1621
|
-
s = Kt._sampleBaseValueStrided(r, i,
|
|
1589
|
+
let g = Math.max(0, Math.trunc(f.from)), x = Math.min(Math.trunc(f.to), i - 1);
|
|
1590
|
+
if (g > x && (g = 0, x = Math.min(fr - 1, i - 1)), i > fr)
|
|
1591
|
+
s = Kt._sampleBaseValueStrided(r, i, fr), n?.materialize && (o = { from: g, values: Kt._collectValidatedValues(r, g, x) });
|
|
1622
1592
|
else {
|
|
1623
|
-
const R = Kt._collectValidatedValues(r, g,
|
|
1593
|
+
const R = Kt._collectValidatedValues(r, g, x);
|
|
1624
1594
|
s = Kt._modeOrMedian([...R]), n?.materialize && (o = { from: g, values: R });
|
|
1625
1595
|
}
|
|
1626
1596
|
}
|
|
@@ -1629,8 +1599,8 @@ class Kt {
|
|
|
1629
1599
|
const g = o.from + f;
|
|
1630
1600
|
if (g >= this.size)
|
|
1631
1601
|
break;
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1602
|
+
const x = o.values[f] - this.baseValue;
|
|
1603
|
+
x !== 0 && (this.deltas.set(g, x), this._updateTree(g, x));
|
|
1634
1604
|
}
|
|
1635
1605
|
this.total = this.getTotal();
|
|
1636
1606
|
}
|
|
@@ -1661,7 +1631,7 @@ class Kt {
|
|
|
1661
1631
|
static _collectValidatedValues(e, r, n) {
|
|
1662
1632
|
const i = [];
|
|
1663
1633
|
for (let s = r; s <= n; s++)
|
|
1664
|
-
i.push(
|
|
1634
|
+
i.push(kr(e(s), s));
|
|
1665
1635
|
return i;
|
|
1666
1636
|
}
|
|
1667
1637
|
/**
|
|
@@ -1675,22 +1645,22 @@ class Kt {
|
|
|
1675
1645
|
static _modeOrMedian(e) {
|
|
1676
1646
|
if (e.length === 0)
|
|
1677
1647
|
return 0;
|
|
1678
|
-
e.sort((o,
|
|
1648
|
+
e.sort((o, l) => o - l);
|
|
1679
1649
|
const r = Math.floor(e.length / 2);
|
|
1680
1650
|
let n;
|
|
1681
1651
|
e.length % 2 === 0 ? n = Math.floor((e[r - 1] + e[r]) / 2) : n = e[r];
|
|
1682
1652
|
const i = /* @__PURE__ */ new Map();
|
|
1683
1653
|
let s = 0;
|
|
1684
1654
|
for (const o of e) {
|
|
1685
|
-
const
|
|
1686
|
-
i.set(o,
|
|
1655
|
+
const l = (i.get(o) ?? 0) + 1;
|
|
1656
|
+
i.set(o, l), l > s && (s = l);
|
|
1687
1657
|
}
|
|
1688
1658
|
if (s > e.length * 0.2) {
|
|
1689
1659
|
const o = [];
|
|
1690
1660
|
for (const [f, g] of i.entries())
|
|
1691
1661
|
g === s && o.push(f);
|
|
1692
|
-
const
|
|
1693
|
-
n = Math.floor(
|
|
1662
|
+
const l = o.reduce((f, g) => f + g, 0);
|
|
1663
|
+
n = Math.floor(l / o.length);
|
|
1694
1664
|
}
|
|
1695
1665
|
return n;
|
|
1696
1666
|
}
|
|
@@ -1711,7 +1681,7 @@ class Kt {
|
|
|
1711
1681
|
i % 2 === 0 && (i += 1);
|
|
1712
1682
|
const s = [];
|
|
1713
1683
|
for (let o = 0; o < r && s.length < n; o += i)
|
|
1714
|
-
s.push(
|
|
1684
|
+
s.push(kr(e(o), o));
|
|
1715
1685
|
return Kt._modeOrMedian(s);
|
|
1716
1686
|
}
|
|
1717
1687
|
/**
|
|
@@ -1784,7 +1754,7 @@ class Kt {
|
|
|
1784
1754
|
let n = e + 1;
|
|
1785
1755
|
for (; n <= this.size; ) {
|
|
1786
1756
|
this.tree.set(n, (this.tree.get(n) ?? 0) + r);
|
|
1787
|
-
const i =
|
|
1757
|
+
const i = hr(n);
|
|
1788
1758
|
if (i === 0)
|
|
1789
1759
|
break;
|
|
1790
1760
|
n += i;
|
|
@@ -1810,7 +1780,7 @@ class Kt {
|
|
|
1810
1780
|
throw new Error(`Value must be a finite number: ${s}`);
|
|
1811
1781
|
if (s < 0)
|
|
1812
1782
|
throw new Error("Value cannot be negative.");
|
|
1813
|
-
const o = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0,
|
|
1783
|
+
const o = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, l = o + this.baseValue, f = s - l;
|
|
1814
1784
|
f !== 0 && r.push({ index: i, change: f }), n.set(i, o + f);
|
|
1815
1785
|
}
|
|
1816
1786
|
return r;
|
|
@@ -1828,7 +1798,7 @@ class Kt {
|
|
|
1828
1798
|
let e = 0, r = this.size;
|
|
1829
1799
|
for (; r > 0; ) {
|
|
1830
1800
|
e += this.tree.get(r) ?? 0;
|
|
1831
|
-
const n =
|
|
1801
|
+
const n = hr(r);
|
|
1832
1802
|
if (n === 0)
|
|
1833
1803
|
break;
|
|
1834
1804
|
r -= n;
|
|
@@ -1845,7 +1815,7 @@ class Kt {
|
|
|
1845
1815
|
*/
|
|
1846
1816
|
_materialize(e, r = !0) {
|
|
1847
1817
|
if (this.valueFn) {
|
|
1848
|
-
const n = this.deltas.get(e) ?? 0, s =
|
|
1818
|
+
const n = this.deltas.get(e) ?? 0, s = kr(this.valueFn(e), e) - this.baseValue;
|
|
1849
1819
|
if (s !== n && (s === 0 ? this.deltas.delete(e) : this.deltas.set(e, s), r)) {
|
|
1850
1820
|
const o = s - n;
|
|
1851
1821
|
this._updateTree(e, o);
|
|
@@ -1866,10 +1836,10 @@ class Kt {
|
|
|
1866
1836
|
return;
|
|
1867
1837
|
const i = e.ranges;
|
|
1868
1838
|
if (i && i.length > 0) {
|
|
1869
|
-
for (const
|
|
1870
|
-
const f = Math.max(0, Math.trunc(
|
|
1871
|
-
for (let
|
|
1872
|
-
this._materialize(
|
|
1839
|
+
for (const l of i) {
|
|
1840
|
+
const f = Math.max(0, Math.trunc(l.from)), g = Math.min(Math.trunc(l.to), this.size - 1);
|
|
1841
|
+
for (let x = f; x <= g; x++)
|
|
1842
|
+
this._materialize(x);
|
|
1873
1843
|
}
|
|
1874
1844
|
if (r === void 0)
|
|
1875
1845
|
return;
|
|
@@ -1906,8 +1876,8 @@ class Kt {
|
|
|
1906
1876
|
return { index: -1, total: this.total ?? this.getTotal(), cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1907
1877
|
if (!i)
|
|
1908
1878
|
break;
|
|
1909
|
-
const
|
|
1910
|
-
if (this._materialize(s), (this.deltas.get(s) ?? 0) ===
|
|
1879
|
+
const l = this.deltas.get(s) ?? 0;
|
|
1880
|
+
if (this._materialize(s), (this.deltas.get(s) ?? 0) === l)
|
|
1911
1881
|
break;
|
|
1912
1882
|
}
|
|
1913
1883
|
const o = this.prefixSum(s);
|
|
@@ -1949,20 +1919,20 @@ class Kt {
|
|
|
1949
1919
|
_findIndexLarge(e, r, n) {
|
|
1950
1920
|
if (this.size === 0)
|
|
1951
1921
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1952
|
-
const i =
|
|
1922
|
+
const i = hi(this.size);
|
|
1953
1923
|
if (i === 0n)
|
|
1954
1924
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1955
1925
|
this._materializeRanges(r.materializeOption);
|
|
1956
1926
|
const s = r.materializeOption?.materialize === !0;
|
|
1957
1927
|
for (; ; ) {
|
|
1958
|
-
let o = 0n,
|
|
1959
|
-
for (; o <=
|
|
1960
|
-
const S = o +
|
|
1961
|
-
if (
|
|
1962
|
-
if (f = S, g =
|
|
1928
|
+
let o = 0n, l = i - 1n, f, g, x = this.total;
|
|
1929
|
+
for (; o <= l; ) {
|
|
1930
|
+
const S = o + l >> 1n, N = Number(S), j = this.prefixSum(N);
|
|
1931
|
+
if (x = j.total, n ? j.cumulative >= e : j.cumulative <= e)
|
|
1932
|
+
if (f = S, g = j, n) {
|
|
1963
1933
|
if (S === 0n)
|
|
1964
1934
|
break;
|
|
1965
|
-
|
|
1935
|
+
l = S - 1n;
|
|
1966
1936
|
} else
|
|
1967
1937
|
o = S + 1n;
|
|
1968
1938
|
else if (n)
|
|
@@ -1970,7 +1940,7 @@ class Kt {
|
|
|
1970
1940
|
else {
|
|
1971
1941
|
if (S === 0n)
|
|
1972
1942
|
break;
|
|
1973
|
-
|
|
1943
|
+
l = S - 1n;
|
|
1974
1944
|
}
|
|
1975
1945
|
}
|
|
1976
1946
|
const R = g, T = f !== void 0 ? Number(f) : -1;
|
|
@@ -1981,7 +1951,7 @@ class Kt {
|
|
|
1981
1951
|
}
|
|
1982
1952
|
return {
|
|
1983
1953
|
index: T,
|
|
1984
|
-
total:
|
|
1954
|
+
total: x,
|
|
1985
1955
|
cumulative: R?.cumulative,
|
|
1986
1956
|
currentValue: R?.currentValue,
|
|
1987
1957
|
safeIndex: R?.safeIndex
|
|
@@ -2001,19 +1971,19 @@ class Kt {
|
|
|
2001
1971
|
return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
|
|
2002
1972
|
if (this.size === 0)
|
|
2003
1973
|
return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
|
|
2004
|
-
const n =
|
|
1974
|
+
const n = ee(Math.trunc(e), 0, this.size - 1), i = r?.materializeOption;
|
|
2005
1975
|
this._materializeRanges(i, n, !0);
|
|
2006
1976
|
let s = 0, o = n + 1;
|
|
2007
1977
|
for (; o > 0; ) {
|
|
2008
1978
|
const f = this.tree.get(o) ?? 0;
|
|
2009
1979
|
s += f;
|
|
2010
|
-
const g =
|
|
1980
|
+
const g = hr(o);
|
|
2011
1981
|
if (g === 0)
|
|
2012
1982
|
break;
|
|
2013
1983
|
o -= g;
|
|
2014
1984
|
}
|
|
2015
|
-
const
|
|
2016
|
-
return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue:
|
|
1985
|
+
const l = i?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
|
|
1986
|
+
return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue: l, safeIndex: n };
|
|
2017
1987
|
}
|
|
2018
1988
|
/**
|
|
2019
1989
|
* @method get
|
|
@@ -2070,7 +2040,7 @@ class Kt {
|
|
|
2070
2040
|
let s = n + 1;
|
|
2071
2041
|
for (; s <= this.size; ) {
|
|
2072
2042
|
r.set(s, (r.get(s) ?? 0) + i);
|
|
2073
|
-
const o =
|
|
2043
|
+
const o = hr(s);
|
|
2074
2044
|
if (o === 0)
|
|
2075
2045
|
break;
|
|
2076
2046
|
s += o;
|
|
@@ -2187,14 +2157,14 @@ class Kt {
|
|
|
2187
2157
|
_propagateDeltaToGrownNodes(e, r, n, i) {
|
|
2188
2158
|
let s = e + 1;
|
|
2189
2159
|
for (; s <= n; ) {
|
|
2190
|
-
const o =
|
|
2160
|
+
const o = hr(s);
|
|
2191
2161
|
if (o === 0)
|
|
2192
2162
|
break;
|
|
2193
2163
|
s += o;
|
|
2194
2164
|
}
|
|
2195
2165
|
for (; s <= i; ) {
|
|
2196
2166
|
this.tree.set(s, (this.tree.get(s) ?? 0) + r);
|
|
2197
|
-
const o =
|
|
2167
|
+
const o = hr(s);
|
|
2198
2168
|
if (o === 0)
|
|
2199
2169
|
break;
|
|
2200
2170
|
s += o;
|
|
@@ -2288,20 +2258,20 @@ class Kt {
|
|
|
2288
2258
|
return this._findIndex(e, r ?? {}, !1);
|
|
2289
2259
|
}
|
|
2290
2260
|
}
|
|
2291
|
-
const
|
|
2261
|
+
const mi = (t, e) => {
|
|
2292
2262
|
const r = t?.sampleRange, n = e?.sampleRange;
|
|
2293
2263
|
return r === n ? !1 : r && n ? r.from !== n.from || r.to !== n.to : !0;
|
|
2294
|
-
},
|
|
2264
|
+
}, Nn = (t, e, r) => {
|
|
2295
2265
|
const n = Number.isFinite(t) && t > 0 ? Math.trunc(t) : 0, i = d(null), s = d({ size: n, valueOrFn: e, options: r });
|
|
2296
2266
|
i.current === null && (i.current = new Kt(n, e, r));
|
|
2297
|
-
const o = i.current,
|
|
2298
|
-
if (g ||
|
|
2267
|
+
const o = i.current, l = s.current, f = l.size !== n, g = l.valueOrFn !== e, x = mi(l.options, r) || l.options?.baseValue !== r?.baseValue, R = l.size === 0 && n > 0 && (!i.current || i.current.base === 0);
|
|
2268
|
+
if (g || x) {
|
|
2299
2269
|
const T = r?.resetOnValueFnChange ?? !0;
|
|
2300
|
-
|
|
2301
|
-
} else f && (r?.debug && A.debug("[useFenwickMapTree] resize", { from:
|
|
2270
|
+
x || g && T || R ? (r?.debug && A.debug("[useFenwickMapTree] reset", { valueOrFnChanged: g, optionsChanged: x }), o.reset(n, e, r)) : (f && (r?.debug && A.debug("[useFenwickMapTree] resize (with valueFn change)", { from: l.size, to: n }), o.changeSize(n)), r?.debug && A.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: g }), o.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: r };
|
|
2271
|
+
} else f && (r?.debug && A.debug("[useFenwickMapTree] resize", { from: l.size, to: n }), R ? o.reset(n, e, r) : o.changeSize(n), s.current = { size: n, valueOrFn: e, options: r });
|
|
2302
2272
|
return o;
|
|
2303
2273
|
};
|
|
2304
|
-
class
|
|
2274
|
+
class pi {
|
|
2305
2275
|
key;
|
|
2306
2276
|
value;
|
|
2307
2277
|
prev = null;
|
|
@@ -2310,7 +2280,7 @@ class di {
|
|
|
2310
2280
|
this.key = e, this.value = r;
|
|
2311
2281
|
}
|
|
2312
2282
|
}
|
|
2313
|
-
class
|
|
2283
|
+
class Hr {
|
|
2314
2284
|
head = null;
|
|
2315
2285
|
tail = null;
|
|
2316
2286
|
/**
|
|
@@ -2351,52 +2321,52 @@ class Fr {
|
|
|
2351
2321
|
this.remove(e), this.addToTail(e);
|
|
2352
2322
|
}
|
|
2353
2323
|
}
|
|
2354
|
-
function
|
|
2355
|
-
const e = d(/* @__PURE__ */ new Map()), r = d(new
|
|
2324
|
+
function gi(t) {
|
|
2325
|
+
const e = d(/* @__PURE__ */ new Map()), r = d(new Hr()), n = Math.floor(t), i = d(n);
|
|
2356
2326
|
X(() => {
|
|
2357
2327
|
if (i.current = n, Number.isNaN(n) || n < 0) {
|
|
2358
|
-
A.warn(`useLruCache: invalid capacity ${t}; the cache will not store any entries.`), e.current.clear(), r.current = new
|
|
2328
|
+
A.warn(`useLruCache: invalid capacity ${t}; the cache will not store any entries.`), e.current.clear(), r.current = new Hr();
|
|
2359
2329
|
return;
|
|
2360
2330
|
}
|
|
2361
2331
|
if (Number.isFinite(n))
|
|
2362
2332
|
for (; e.current.size > n; ) {
|
|
2363
|
-
const
|
|
2364
|
-
if (
|
|
2365
|
-
e.current.delete(
|
|
2333
|
+
const x = r.current.removeHead();
|
|
2334
|
+
if (x)
|
|
2335
|
+
e.current.delete(x.key);
|
|
2366
2336
|
else
|
|
2367
2337
|
break;
|
|
2368
2338
|
}
|
|
2369
2339
|
}, [t, n]);
|
|
2370
|
-
const s = w((
|
|
2371
|
-
const R = e.current.get(
|
|
2340
|
+
const s = w((x) => {
|
|
2341
|
+
const R = e.current.get(x);
|
|
2372
2342
|
if (R)
|
|
2373
2343
|
return r.current.moveToTail(R), R.value;
|
|
2374
|
-
}, []), o = w((
|
|
2344
|
+
}, []), o = w((x, R) => {
|
|
2375
2345
|
const T = i.current;
|
|
2376
2346
|
if (Number.isNaN(T) || T <= 0)
|
|
2377
2347
|
return;
|
|
2378
|
-
let S = e.current.get(
|
|
2348
|
+
let S = e.current.get(x);
|
|
2379
2349
|
if (S)
|
|
2380
2350
|
S.value = R, r.current.moveToTail(S);
|
|
2381
2351
|
else {
|
|
2382
2352
|
if (e.current.size >= T) {
|
|
2383
|
-
const
|
|
2384
|
-
|
|
2353
|
+
const N = r.current.removeHead();
|
|
2354
|
+
N && e.current.delete(N.key);
|
|
2385
2355
|
}
|
|
2386
|
-
S = new
|
|
2356
|
+
S = new pi(x, R), e.current.set(x, S), r.current.addToTail(S);
|
|
2387
2357
|
}
|
|
2388
|
-
}, []),
|
|
2389
|
-
const R = e.current.get(
|
|
2390
|
-
R && (r.current.remove(R), e.current.delete(
|
|
2358
|
+
}, []), l = w((x) => e.current.has(x), []), f = w((x) => {
|
|
2359
|
+
const R = e.current.get(x);
|
|
2360
|
+
R && (r.current.remove(R), e.current.delete(x));
|
|
2391
2361
|
}, []), g = w(() => {
|
|
2392
|
-
e.current.clear(), r.current = new
|
|
2362
|
+
e.current.clear(), r.current = new Hr();
|
|
2393
2363
|
}, []);
|
|
2394
|
-
return Me(() => ({ get: s, set: o, has:
|
|
2364
|
+
return Me(() => ({ get: s, set: o, has: l, remove: f, clear: g }), [s, o, l, f, g]);
|
|
2395
2365
|
}
|
|
2396
|
-
const
|
|
2397
|
-
const { get: t, set: e, has: r, clear: n } =
|
|
2366
|
+
const xi = 1e4, Fi = () => {
|
|
2367
|
+
const { get: t, set: e, has: r, clear: n } = gi(xi);
|
|
2398
2368
|
return Me(() => ({ get: t, set: e, has: r, clear: n }), [t, e, r, n]);
|
|
2399
|
-
},
|
|
2369
|
+
}, ki = (t, e) => {
|
|
2400
2370
|
const r = d(e), n = d(t);
|
|
2401
2371
|
Je(() => {
|
|
2402
2372
|
r.current = e, n.current = t;
|
|
@@ -2405,73 +2375,73 @@ const hi = 1e4, Di = () => {
|
|
|
2405
2375
|
return w((s) => {
|
|
2406
2376
|
if (!s || i.current.has(s))
|
|
2407
2377
|
return;
|
|
2408
|
-
const o = (
|
|
2409
|
-
r.current?.enableBridge !== !1 && n.current.current?.applyWheel(
|
|
2378
|
+
const o = (l) => {
|
|
2379
|
+
r.current?.enableBridge !== !1 && n.current.current?.applyWheel(l);
|
|
2410
2380
|
};
|
|
2411
2381
|
return s.addEventListener("wheel", o, { passive: !1 }), i.current.set(s, o), () => {
|
|
2412
2382
|
i.current.get(s) === o && (s.removeEventListener("wheel", o), i.current.delete(s));
|
|
2413
2383
|
};
|
|
2414
2384
|
}, []);
|
|
2415
|
-
},
|
|
2385
|
+
}, fn = -200, hn = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, bi = (t) => {
|
|
2416
2386
|
const e = d(t);
|
|
2417
2387
|
e.current = t;
|
|
2418
|
-
const r = d(
|
|
2419
|
-
o.current !== null && (window.cancelAnimationFrame(o.current), o.current = null),
|
|
2420
|
-
}, []), R = w((D, k, ce, L,
|
|
2421
|
-
const
|
|
2422
|
-
|
|
2423
|
-
const B = Math.max(
|
|
2424
|
-
B > 0 && (D.residual =
|
|
2388
|
+
const r = d(hn), n = d(null), [i, s] = _e(!1), o = d(null), l = d(null), f = d({ residual: 0, direction: 0 }), g = d({ residual: 0, direction: 0 }), x = w(() => {
|
|
2389
|
+
o.current !== null && (window.cancelAnimationFrame(o.current), o.current = null), l.current = null, f.current = { residual: 0, direction: 0 }, g.current = { residual: 0, direction: 0 };
|
|
2390
|
+
}, []), R = w((D, k, ce, L, P, C) => {
|
|
2391
|
+
const K = k > 0 ? 1 : k < 0 ? -1 : 0;
|
|
2392
|
+
K !== 0 && K !== D.direction && (D.direction = K, D.residual = 0), D.residual += k * ce;
|
|
2393
|
+
const B = Math.max(P(), 0);
|
|
2394
|
+
B > 0 && (D.residual = ee(D.residual, -B, B));
|
|
2425
2395
|
const H = D.residual;
|
|
2426
2396
|
if (H === 0)
|
|
2427
2397
|
return { actualDelta: 0, atBoundary: !1 };
|
|
2428
|
-
const
|
|
2398
|
+
const J = L(), ie = C(H), ge = ie - J;
|
|
2429
2399
|
D.residual -= ge;
|
|
2430
|
-
const
|
|
2431
|
-
return
|
|
2400
|
+
const $e = H < 0 && J + H <= 0, y = H > 0 && J + H >= B, re = H < 0 && (ie <= 0 || $e && ge === 0) || H > 0 && (ie >= B || y && ge === 0);
|
|
2401
|
+
return re && (D.residual = 0), { actualDelta: ge, atBoundary: re };
|
|
2432
2402
|
}, []), T = w(
|
|
2433
2403
|
(D) => {
|
|
2434
2404
|
const k = e.current, ce = r.current;
|
|
2435
2405
|
if (!ce.active || ce.direction === 0) {
|
|
2436
|
-
|
|
2406
|
+
x();
|
|
2437
2407
|
return;
|
|
2438
2408
|
}
|
|
2439
|
-
const L =
|
|
2440
|
-
if (
|
|
2409
|
+
const L = l.current ?? D, P = Math.max((D - L) / 1e3, 0), C = Math.min(P, Pn);
|
|
2410
|
+
if (l.current = D, C <= 0) {
|
|
2441
2411
|
o.current = window.requestAnimationFrame(T);
|
|
2442
2412
|
return;
|
|
2443
2413
|
}
|
|
2444
|
-
const
|
|
2414
|
+
const K = oi({ offsetX: ce.offsetX, offsetY: ce.offsetY, maxDistance: k.maxDistance, x: k.xSpeedParams, y: k.ySpeedParams }), B = R(f.current, K.x, C, k.getHx, k.getMaxHx, (ge) => k.applyHxRef.current(k.getHx() + ge));
|
|
2445
2415
|
B.actualDelta !== 0 && (k.pendingColAnchorRef.current = null);
|
|
2446
|
-
const H = R(g.current,
|
|
2447
|
-
if (
|
|
2448
|
-
|
|
2416
|
+
const H = R(g.current, K.y, C, k.getVy, k.getMaxVy, k.applyVy), J = k.getMaxHx() <= 0 || B.atBoundary || ce.offsetX === 0, ie = k.getMaxVy() <= 0 || H.atBoundary || ce.offsetY === 0;
|
|
2417
|
+
if (J && ie) {
|
|
2418
|
+
x();
|
|
2449
2419
|
return;
|
|
2450
2420
|
}
|
|
2451
2421
|
o.current = window.requestAnimationFrame(T);
|
|
2452
2422
|
},
|
|
2453
|
-
[
|
|
2423
|
+
[x, R]
|
|
2454
2424
|
), S = w(() => {
|
|
2455
|
-
o.current === null && (
|
|
2456
|
-
}, [T]),
|
|
2457
|
-
r.current = { ...
|
|
2458
|
-
}, [
|
|
2425
|
+
o.current === null && (l.current = null, f.current = { residual: 0, direction: 0 }, g.current = { residual: 0, direction: 0 }, o.current = window.requestAnimationFrame(T));
|
|
2426
|
+
}, [T]), N = w(() => {
|
|
2427
|
+
r.current = { ...hn }, s(!1), n.current?.reset(), x();
|
|
2428
|
+
}, [x]), j = w(
|
|
2459
2429
|
(D) => {
|
|
2460
|
-
r.current = D, s(D.active), D.active && D.direction !== 0 ? S() :
|
|
2430
|
+
r.current = D, s(D.active), D.active && D.direction !== 0 ? S() : x();
|
|
2461
2431
|
},
|
|
2462
|
-
[S,
|
|
2432
|
+
[S, x]
|
|
2463
2433
|
), { enabled: F, xExtentFreshness: Te, yExtentFreshness: ze } = t;
|
|
2464
2434
|
return X(() => {
|
|
2465
2435
|
const D = r.current;
|
|
2466
2436
|
!D.active || D.direction === 0 || S();
|
|
2467
2437
|
}, [Te, ze, S]), X(() => {
|
|
2468
2438
|
const D = () => {
|
|
2469
|
-
|
|
2439
|
+
N();
|
|
2470
2440
|
};
|
|
2471
|
-
return window.addEventListener(
|
|
2472
|
-
window.removeEventListener(
|
|
2441
|
+
return window.addEventListener(Sr, D), () => {
|
|
2442
|
+
window.removeEventListener(Sr, D);
|
|
2473
2443
|
};
|
|
2474
|
-
}, [
|
|
2444
|
+
}, [N]), X(() => {
|
|
2475
2445
|
if (!F)
|
|
2476
2446
|
return;
|
|
2477
2447
|
const D = (k) => {
|
|
@@ -2479,57 +2449,57 @@ const hi = 1e4, Di = () => {
|
|
|
2479
2449
|
return;
|
|
2480
2450
|
const ce = k.target;
|
|
2481
2451
|
if (!(ce instanceof Node)) {
|
|
2482
|
-
|
|
2452
|
+
N();
|
|
2483
2453
|
return;
|
|
2484
2454
|
}
|
|
2485
|
-
n.current?.getElement()?.contains(ce) ||
|
|
2455
|
+
n.current?.getElement()?.contains(ce) || N();
|
|
2486
2456
|
};
|
|
2487
2457
|
return document.addEventListener("pointerdown", D, !0), () => {
|
|
2488
2458
|
document.removeEventListener("pointerdown", D, !0);
|
|
2489
2459
|
};
|
|
2490
|
-
}, [F,
|
|
2491
|
-
F ||
|
|
2492
|
-
}, [F,
|
|
2493
|
-
|
|
2494
|
-
}, [
|
|
2495
|
-
}, Ze = (t, e) => e <= 0 ? 0 :
|
|
2460
|
+
}, [F, N]), X(() => {
|
|
2461
|
+
F || N();
|
|
2462
|
+
}, [F, N]), X(() => () => {
|
|
2463
|
+
x();
|
|
2464
|
+
}, [x]), { isTapActive: i, handleTapCircleDragChange: j, tapCircleHandleRef: n };
|
|
2465
|
+
}, Ze = (t, e) => e <= 0 ? 0 : ee(t, 0, e - 1), mn = (t) => ({
|
|
2496
2466
|
top: Math.max(0, t?.top ?? 0),
|
|
2497
2467
|
bottom: Math.max(0, t?.bottom ?? 0)
|
|
2498
|
-
}), Rt = (t, e) => t <= e ? 0 : t - e,
|
|
2468
|
+
}), Rt = (t, e) => t <= e ? 0 : t - e, cr = (t, e) => t <= 0 ? 0 : t + e, Mr = 1e3, Ur = 2e3, Vn = 1048576, vi = 40, vr = (t) => {
|
|
2499
2469
|
if (!Number.isFinite(t)) return 0n;
|
|
2500
2470
|
const e = Math.trunc(t);
|
|
2501
2471
|
return e <= 0 ? 0n : BigInt(e);
|
|
2502
|
-
},
|
|
2503
|
-
const f =
|
|
2472
|
+
}, wi = (t, e, r, n, i, s, o, l) => {
|
|
2473
|
+
const f = vr(n);
|
|
2504
2474
|
if (f === 0n)
|
|
2505
2475
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2506
|
-
const g = (L) => L < 0n ? 0n : L >= f ? f - 1n : L,
|
|
2476
|
+
const g = (L) => L < 0n ? 0n : L >= f ? f - 1n : L, x = { materializeOption: { materialize: !1 } }, { index: R, cumulative: T } = s.findIndexAtOrAfter(t, x);
|
|
2507
2477
|
let S;
|
|
2508
|
-
R === -1 ? S = f - 1n : (T === t ? S =
|
|
2509
|
-
const
|
|
2510
|
-
const
|
|
2511
|
-
if (!Number.isSafeInteger(
|
|
2478
|
+
R === -1 ? S = f - 1n : (T === t ? S = vr(R + 1) : S = vr(R), S >= f && (S = f - 1n)), t <= 0 && (S = 0n), l && t >= o && (S = f - 1n);
|
|
2479
|
+
const N = (L) => {
|
|
2480
|
+
const P = Number(L);
|
|
2481
|
+
if (!Number.isSafeInteger(P))
|
|
2512
2482
|
return null;
|
|
2513
|
-
const { cumulative:
|
|
2514
|
-
if (!Number.isFinite(
|
|
2483
|
+
const { cumulative: C } = s.prefixSum(P, { materializeOption: { materialize: !1 } });
|
|
2484
|
+
if (!Number.isFinite(C))
|
|
2515
2485
|
return null;
|
|
2516
|
-
const { index:
|
|
2517
|
-
if (
|
|
2486
|
+
const { index: K } = s.findIndexAtOrAfter(C + 0.5, { materializeOption: { materialize: !1 } });
|
|
2487
|
+
if (K === -1)
|
|
2518
2488
|
return null;
|
|
2519
|
-
const B =
|
|
2489
|
+
const B = vr(K);
|
|
2520
2490
|
return B > L ? B : null;
|
|
2521
|
-
},
|
|
2522
|
-
let
|
|
2523
|
-
for (;
|
|
2524
|
-
const
|
|
2525
|
-
if (
|
|
2491
|
+
}, j = (L) => {
|
|
2492
|
+
let P = 0, C = L, K = L, B = 0n, H = 0;
|
|
2493
|
+
for (; C < f && P < e; ) {
|
|
2494
|
+
const J = Number(C), ie = i(J);
|
|
2495
|
+
if (P += ie, K = C, C += 1n, B += 1n, !Number.isFinite(ie) || ie < 0)
|
|
2526
2496
|
break;
|
|
2527
|
-
if (
|
|
2528
|
-
if (H += 1, H >
|
|
2529
|
-
const ge =
|
|
2530
|
-
if (ge !== null && ge >
|
|
2531
|
-
|
|
2532
|
-
else if (ge !== null && ge ===
|
|
2497
|
+
if (ie === 0) {
|
|
2498
|
+
if (H += 1, H > Mr) {
|
|
2499
|
+
const ge = N(K);
|
|
2500
|
+
if (ge !== null && ge > C)
|
|
2501
|
+
C = ge, H = 0;
|
|
2502
|
+
else if (ge !== null && ge === C && i(Number(C)) > 0)
|
|
2533
2503
|
H = 0;
|
|
2534
2504
|
else
|
|
2535
2505
|
break;
|
|
@@ -2537,38 +2507,38 @@ const hi = 1e4, Di = () => {
|
|
|
2537
2507
|
} else
|
|
2538
2508
|
H = 0;
|
|
2539
2509
|
}
|
|
2540
|
-
return B === 0n && (
|
|
2510
|
+
return B === 0n && (K = L), { height: P, end: K };
|
|
2541
2511
|
};
|
|
2542
|
-
let { height: F, end: Te } =
|
|
2512
|
+
let { height: F, end: Te } = j(S);
|
|
2543
2513
|
if (F < e && S > 0n) {
|
|
2544
|
-
let L = S,
|
|
2545
|
-
for (; L > 0n &&
|
|
2514
|
+
let L = S, P = F, C = 0;
|
|
2515
|
+
for (; L > 0n && P < e; ) {
|
|
2546
2516
|
L -= 1n;
|
|
2547
2517
|
const B = Number(L), H = i(B);
|
|
2548
|
-
if (
|
|
2518
|
+
if (P += H, !Number.isFinite(H) || H < 0)
|
|
2549
2519
|
break;
|
|
2550
2520
|
if (H === 0) {
|
|
2551
|
-
if (
|
|
2552
|
-
const
|
|
2553
|
-
if (!Number.isSafeInteger(
|
|
2521
|
+
if (C += 1, C > Mr) {
|
|
2522
|
+
const J = Number(L);
|
|
2523
|
+
if (!Number.isSafeInteger(J))
|
|
2554
2524
|
break;
|
|
2555
|
-
const { cumulative:
|
|
2556
|
-
if (!Number.isFinite(
|
|
2525
|
+
const { cumulative: ie } = s.prefixSum(J, { materializeOption: { materialize: !1 } });
|
|
2526
|
+
if (!Number.isFinite(ie))
|
|
2557
2527
|
break;
|
|
2558
|
-
const { index: ge } = s.findIndexAtOrAfter(
|
|
2559
|
-
if (
|
|
2560
|
-
L =
|
|
2561
|
-
else if (
|
|
2562
|
-
|
|
2528
|
+
const { index: ge } = s.findIndexAtOrAfter(ie - 0.5, { materializeOption: { materialize: !1 } }), $e = ge === -1 ? -1n : vr(ge);
|
|
2529
|
+
if ($e >= 0n && $e < L)
|
|
2530
|
+
L = $e + 1n, C = 0;
|
|
2531
|
+
else if ($e === L && L >= 1n && i(Number(L - 1n)) > 0)
|
|
2532
|
+
C = 0;
|
|
2563
2533
|
else
|
|
2564
2534
|
break;
|
|
2565
2535
|
}
|
|
2566
2536
|
} else
|
|
2567
|
-
|
|
2537
|
+
C = 0;
|
|
2568
2538
|
}
|
|
2569
2539
|
S = g(L);
|
|
2570
|
-
const
|
|
2571
|
-
F =
|
|
2540
|
+
const K = j(S);
|
|
2541
|
+
F = K.height, Te = K.end;
|
|
2572
2542
|
}
|
|
2573
2543
|
const ze = g(S), D = g(Te), k = g(ze - BigInt(Math.max(0, r))), ce = g(D + BigInt(Math.max(0, r)));
|
|
2574
2544
|
return {
|
|
@@ -2577,34 +2547,34 @@ const hi = 1e4, Di = () => {
|
|
|
2577
2547
|
visibleStartIndex: Ze(Number(ze), n),
|
|
2578
2548
|
visibleEndIndex: Ze(Number(D), n)
|
|
2579
2549
|
};
|
|
2580
|
-
},
|
|
2550
|
+
}, Cn = (t, e, r, n, i, s, o) => {
|
|
2581
2551
|
if (n === 0)
|
|
2582
2552
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2583
|
-
const
|
|
2553
|
+
const l = Number.isFinite(o), f = l ? Math.min(Math.max(0, t), o) : Math.max(0, t);
|
|
2584
2554
|
if (n >= Number.MAX_SAFE_INTEGER)
|
|
2585
|
-
return
|
|
2586
|
-
const { index: g, cumulative:
|
|
2587
|
-
let S = Ze(T, n),
|
|
2588
|
-
if (g !== -1 &&
|
|
2589
|
-
S = Ze(g + 1, n),
|
|
2590
|
-
else if (S === g &&
|
|
2591
|
-
|
|
2555
|
+
return wi(f, e, r, n, i, s, o, l);
|
|
2556
|
+
const { index: g, cumulative: x, currentValue: R } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), T = g === -1 ? e <= 0 || (x ?? 0) < f + (R ?? 0) ? n - 1 : 0 : g;
|
|
2557
|
+
let S = Ze(T, n), N = 0;
|
|
2558
|
+
if (g !== -1 && x === f)
|
|
2559
|
+
S = Ze(g + 1, n), N = 0;
|
|
2560
|
+
else if (S === g && x !== void 0 && R !== void 0)
|
|
2561
|
+
N = x - R - f;
|
|
2592
2562
|
else {
|
|
2593
|
-
const { cumulative: L, currentValue:
|
|
2594
|
-
|
|
2595
|
-
}
|
|
2596
|
-
const
|
|
2597
|
-
let
|
|
2598
|
-
for (;
|
|
2599
|
-
const H = i(
|
|
2600
|
-
if (
|
|
2563
|
+
const { cumulative: L, currentValue: P } = s.prefixSum(S, { materializeOption: { materialize: !1 } });
|
|
2564
|
+
N = (L ?? 0) - (P ?? 0) - f;
|
|
2565
|
+
}
|
|
2566
|
+
const j = N, F = (L, P) => {
|
|
2567
|
+
let C = L, K = P, B = 0;
|
|
2568
|
+
for (; C < n && K < e; ) {
|
|
2569
|
+
const H = i(C);
|
|
2570
|
+
if (K += H, C++, !Number.isFinite(H) || H < 0)
|
|
2601
2571
|
break;
|
|
2602
2572
|
if (H === 0) {
|
|
2603
|
-
if (B++, B >
|
|
2604
|
-
const { cumulative:
|
|
2605
|
-
if (
|
|
2606
|
-
|
|
2607
|
-
else if (
|
|
2573
|
+
if (B++, B > Mr) {
|
|
2574
|
+
const { cumulative: J } = s.prefixSum(C - 1, { materializeOption: { materialize: !1 } }), { index: ie } = Number.isFinite(J) ? s.findIndexAtOrAfter(J + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2575
|
+
if (ie > C)
|
|
2576
|
+
C = ie, B = 0;
|
|
2577
|
+
else if (ie === C && i(C) > 0)
|
|
2608
2578
|
B = 0;
|
|
2609
2579
|
else
|
|
2610
2580
|
break;
|
|
@@ -2612,42 +2582,42 @@ const hi = 1e4, Di = () => {
|
|
|
2612
2582
|
} else
|
|
2613
2583
|
B = 0;
|
|
2614
2584
|
}
|
|
2615
|
-
return { cursor:
|
|
2616
|
-
}, Te = F(S,
|
|
2585
|
+
return { cursor: C, height: K };
|
|
2586
|
+
}, Te = F(S, N);
|
|
2617
2587
|
let ze = Te.cursor;
|
|
2618
|
-
if (
|
|
2619
|
-
let L =
|
|
2620
|
-
for (;
|
|
2621
|
-
const B = i(
|
|
2588
|
+
if (N = Te.height, N < e && S > 0) {
|
|
2589
|
+
let L = N + Math.abs(Math.min(0, j)), P = S - 1, C = 0;
|
|
2590
|
+
for (; P >= 0 && L < e; ) {
|
|
2591
|
+
const B = i(P);
|
|
2622
2592
|
if (L += B, !Number.isFinite(B) || B < 0) {
|
|
2623
|
-
|
|
2593
|
+
P--;
|
|
2624
2594
|
break;
|
|
2625
2595
|
}
|
|
2626
2596
|
if (B === 0) {
|
|
2627
|
-
if (
|
|
2628
|
-
const { cumulative: H } = s.prefixSum(
|
|
2629
|
-
if (
|
|
2630
|
-
|
|
2597
|
+
if (C++, C > Mr) {
|
|
2598
|
+
const { cumulative: H } = s.prefixSum(P, { materializeOption: { materialize: !1 } }), { index: J } = Number.isFinite(H) ? s.findIndexAtOrAfter(H - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2599
|
+
if (J !== -1 && J < P) {
|
|
2600
|
+
P = J, C = 0;
|
|
2631
2601
|
continue;
|
|
2632
2602
|
}
|
|
2633
|
-
if (
|
|
2634
|
-
|
|
2603
|
+
if (J === P && P >= 1 && i(P - 1) > 0)
|
|
2604
|
+
C = 0;
|
|
2635
2605
|
else {
|
|
2636
|
-
|
|
2606
|
+
P--;
|
|
2637
2607
|
break;
|
|
2638
2608
|
}
|
|
2639
2609
|
}
|
|
2640
2610
|
} else
|
|
2641
|
-
|
|
2642
|
-
|
|
2611
|
+
C = 0;
|
|
2612
|
+
P--;
|
|
2643
2613
|
}
|
|
2644
|
-
S = Ze(
|
|
2645
|
-
const
|
|
2646
|
-
ze =
|
|
2614
|
+
S = Ze(P + 1, n);
|
|
2615
|
+
const K = F(S, 0);
|
|
2616
|
+
ze = K.cursor, N = K.height;
|
|
2647
2617
|
}
|
|
2648
2618
|
const D = Ze(S - r, n), k = Ze(Math.max(ze - 1, S), n), ce = Ze(k + r, n);
|
|
2649
2619
|
return { renderingStartIndex: D, renderingEndIndex: ce, visibleStartIndex: S, visibleEndIndex: k };
|
|
2650
|
-
},
|
|
2620
|
+
}, pn = (t, e, r) => {
|
|
2651
2621
|
const n = Math.max(0, e ?? 0), i = d({ last: 0, id: null, arg: null }).current;
|
|
2652
2622
|
return X(
|
|
2653
2623
|
() => () => {
|
|
@@ -2664,9 +2634,9 @@ const hi = 1e4, Di = () => {
|
|
|
2664
2634
|
), w(
|
|
2665
2635
|
(s) => {
|
|
2666
2636
|
if (i.arg = s, i.id !== null) return;
|
|
2667
|
-
const o = (
|
|
2637
|
+
const o = (l) => {
|
|
2668
2638
|
if (i.id = null, i.arg === null) return;
|
|
2669
|
-
const f =
|
|
2639
|
+
const f = l - i.last;
|
|
2670
2640
|
if (n === 0 || i.last === 0 || f >= n) {
|
|
2671
2641
|
if (t.current)
|
|
2672
2642
|
try {
|
|
@@ -2674,7 +2644,7 @@ const hi = 1e4, Di = () => {
|
|
|
2674
2644
|
} catch (g) {
|
|
2675
2645
|
console.error("[useThrottledInvoker] Error invoking callback", g);
|
|
2676
2646
|
}
|
|
2677
|
-
i.arg = null, i.last =
|
|
2647
|
+
i.arg = null, i.last = l;
|
|
2678
2648
|
}
|
|
2679
2649
|
i.arg !== null && (i.id = requestAnimationFrame(o));
|
|
2680
2650
|
};
|
|
@@ -2682,8 +2652,8 @@ const hi = 1e4, Di = () => {
|
|
|
2682
2652
|
},
|
|
2683
2653
|
[n, r, t, i]
|
|
2684
2654
|
);
|
|
2685
|
-
},
|
|
2686
|
-
const R = w((F) =>
|
|
2655
|
+
}, Si = kn.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: o, onKeyDown: l, onEscapeKeyDown: f, onFocus: g, registerItemRef: x }) => {
|
|
2656
|
+
const R = w((F) => x(t, F), [t, x]), T = w((F) => l(F, t), [t, l]), S = w((F) => f?.(F, t), [t, f]), N = w(() => g(t), [t, g]), j = w((F) => {
|
|
2687
2657
|
F.currentTarget.focus({ preventScroll: !0 });
|
|
2688
2658
|
}, []);
|
|
2689
2659
|
return (
|
|
@@ -2704,15 +2674,15 @@ const hi = 1e4, Di = () => {
|
|
|
2704
2674
|
overflow: s ? "hidden" : void 0
|
|
2705
2675
|
},
|
|
2706
2676
|
tabIndex: o ? -1 : void 0,
|
|
2707
|
-
onPointerDown: o ?
|
|
2677
|
+
onPointerDown: o ? j : void 0,
|
|
2708
2678
|
onKeyDownCapture: o ? T : void 0,
|
|
2709
2679
|
onKeyDown: o && f ? S : void 0,
|
|
2710
|
-
onFocusCapture: o ?
|
|
2680
|
+
onFocusCapture: o ? N : void 0,
|
|
2711
2681
|
children: i(n, t)
|
|
2712
2682
|
}
|
|
2713
2683
|
)
|
|
2714
2684
|
);
|
|
2715
|
-
}),
|
|
2685
|
+
}), Mi = ({
|
|
2716
2686
|
itemCount: t,
|
|
2717
2687
|
getItem: e,
|
|
2718
2688
|
getItemKey: r,
|
|
@@ -2720,15 +2690,15 @@ const hi = 1e4, Di = () => {
|
|
|
2720
2690
|
viewportSize: i,
|
|
2721
2691
|
overscanCount: s = 15,
|
|
2722
2692
|
className: o,
|
|
2723
|
-
testId:
|
|
2693
|
+
testId: l,
|
|
2724
2694
|
onScroll: f,
|
|
2725
2695
|
onRangeChange: g,
|
|
2726
|
-
children:
|
|
2696
|
+
children: x,
|
|
2727
2697
|
background: R,
|
|
2728
2698
|
initialScrollIndex: T,
|
|
2729
2699
|
initialScrollOffset: S,
|
|
2730
|
-
initialScrollAnchor:
|
|
2731
|
-
callbackThrottleMs:
|
|
2700
|
+
initialScrollAnchor: N,
|
|
2701
|
+
callbackThrottleMs: j = 5,
|
|
2732
2702
|
contentInsets: F,
|
|
2733
2703
|
onItemFocus: Te,
|
|
2734
2704
|
scrollBarOptions: ze,
|
|
@@ -2736,31 +2706,31 @@ const hi = 1e4, Di = () => {
|
|
|
2736
2706
|
onWheelHorizontal: k,
|
|
2737
2707
|
onPanHorizontal: ce,
|
|
2738
2708
|
horizontalKeyInputs: L,
|
|
2739
|
-
horizontalKeyStep:
|
|
2740
|
-
contentProps:
|
|
2741
|
-
liveRegion:
|
|
2709
|
+
horizontalKeyStep: P = vi,
|
|
2710
|
+
contentProps: C,
|
|
2711
|
+
liveRegion: K,
|
|
2742
2712
|
locale: B,
|
|
2743
2713
|
labels: H
|
|
2744
|
-
},
|
|
2745
|
-
const { width:
|
|
2746
|
-
|
|
2747
|
-
}, []), Re = d(null),
|
|
2714
|
+
}, J) => {
|
|
2715
|
+
const { width: ie, enableThumbDrag: ge, enableTrackClick: $e, enableArrowButtons: y, enableScrollToTopBottomButtons: re, renderThumbOverlay: ne, tapScrollCircleOptions: Xe } = ze ?? {}, de = Me(() => In(B, H), [B, H]), { enablePointerDrag: Ue, pointerDragInputs: xe, enableKeyboardNavigation: te = !0, enableEscapeRowReturn: Qe = !1, wheelSpeedMultiplier: at, inertiaOptions: et, overscrollBehavior: wt, clipItemHeight: qe = !1, resetOnGetItemHeightChange: Ye = !1 } = D ?? {}, [Ne, ct] = _e(0), Q = i ?? Ne, Le = w((c) => {
|
|
2716
|
+
ct((h) => h === c ? h : c);
|
|
2717
|
+
}, []), Re = d(null), le = d({
|
|
2748
2718
|
renderingStartIndex: 0,
|
|
2749
2719
|
renderingEndIndex: 0,
|
|
2750
2720
|
visibleStartIndex: 0,
|
|
2751
2721
|
visibleEndIndex: 0,
|
|
2752
2722
|
scrollPosition: 0,
|
|
2753
2723
|
totalHeight: 0
|
|
2754
|
-
}), be = d(
|
|
2724
|
+
}), be = d(N && t > 0 ? { index: ee(Math.trunc(N.index), 0, t - 1), align: "top", offset: -Math.max(0, N.offsetPx ?? 0) } : null), fe = d(!1), xt = d(!0);
|
|
2755
2725
|
X(() => {
|
|
2756
2726
|
if (xt.current) {
|
|
2757
2727
|
xt.current = !1;
|
|
2758
2728
|
return;
|
|
2759
2729
|
}
|
|
2760
|
-
|
|
2761
|
-
}, [
|
|
2762
|
-
const M = Me(() =>
|
|
2763
|
-
const h =
|
|
2730
|
+
Ye && (be.current = null);
|
|
2731
|
+
}, [Ye, n]);
|
|
2732
|
+
const M = Me(() => mn(F), [F]), [Fe] = _e(() => {
|
|
2733
|
+
const h = N?.index ?? T, v = typeof h == "number" && Number.isFinite(h) ? Math.max(0, Math.trunc(h)) : 0;
|
|
2764
2734
|
return { from: Math.max(0, v - 50), to: v + 50 };
|
|
2765
2735
|
}), he = Me(
|
|
2766
2736
|
// 目的: Fenwick Tree のオプション設定
|
|
@@ -2768,68 +2738,68 @@ const hi = 1e4, Di = () => {
|
|
|
2768
2738
|
// itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
|
|
2769
2739
|
// この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
|
|
2770
2740
|
() => ({
|
|
2771
|
-
sampleRange:
|
|
2772
|
-
resetOnValueFnChange:
|
|
2741
|
+
sampleRange: Fe,
|
|
2742
|
+
resetOnValueFnChange: Ye,
|
|
2773
2743
|
materialize: !0
|
|
2774
2744
|
}),
|
|
2775
|
-
[
|
|
2776
|
-
),
|
|
2777
|
-
let
|
|
2778
|
-
if (
|
|
2779
|
-
const v =
|
|
2780
|
-
|
|
2745
|
+
[Ye, Fe]
|
|
2746
|
+
), _ = Nn(t, n, he), [dt] = _e(() => {
|
|
2747
|
+
let c = 0, h = 0;
|
|
2748
|
+
if (N && t > 0) {
|
|
2749
|
+
const v = ee(Math.trunc(N.index), 0, t - 1), q = Math.max(0, N.offsetPx ?? 0), Y = ee(v - s * 2, 0, t - 1), W = ee(v + s * 2, 0, t - 1), G = v > 0 || q > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: Y, to: W }] } } : void 0, { cumulative: ye, total: We, currentValue: Ae } = _.prefixSum(v, G), De = Math.max(ye - Ae + q, 0);
|
|
2750
|
+
c = cr(De, M.top), h = We ?? _.getTotal();
|
|
2781
2751
|
} else if (typeof T == "number") {
|
|
2782
|
-
const v =
|
|
2783
|
-
|
|
2784
|
-
} else typeof S == "number" && (
|
|
2785
|
-
return { position:
|
|
2786
|
-
}), [tt,
|
|
2752
|
+
const v = ee(T, 0, t - 1), q = ee(v - s * 2, 0, t - 1), Y = ee(v + s * 2, 0, t - 1), W = T > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: q, to: Y }] } } : void 0, { cumulative: G, total: ye, currentValue: We } = _.prefixSum(T, W), Ae = Math.max(G - We, 0);
|
|
2753
|
+
c = cr(Ae, M.top), h = ye ?? _.getTotal();
|
|
2754
|
+
} else typeof S == "number" && (c = cr(Math.max(S, 0), M.top)), h = _.getTotal();
|
|
2755
|
+
return { position: c, total: h };
|
|
2756
|
+
}), [tt, Vt] = _e(dt.position), [St, b] = _e(dt.total), V = d(dt.position), ue = d(M.top), Z = d(f ?? void 0), se = d(g ?? void 0), me = d(k), Ge = (L?.length ?? 0) > 0, ve = !!k;
|
|
2787
2757
|
X(() => {
|
|
2788
|
-
Ge && (
|
|
2789
|
-
}, [Ge, ve,
|
|
2790
|
-
const
|
|
2758
|
+
Ge && (te || A.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), ve || A.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(P) && P > 0 || A.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${P}. Horizontal arrow keys are left untouched.`));
|
|
2759
|
+
}, [Ge, ve, te, P]);
|
|
2760
|
+
const Be = d(/* @__PURE__ */ new Map()), Ie = d(null), Oe = d(null), [mt, rt] = _e(null), [nt, ke] = _e(!1), lt = d(null), we = d(!1), pe = d(0), Mt = d(!1), m = d(!1), z = d(t);
|
|
2791
2761
|
z.current !== t && (z.current = t, m.current = !0), Je(() => {
|
|
2792
|
-
|
|
2762
|
+
Z.current = f ?? void 0, se.current = g ?? void 0, me.current = k;
|
|
2793
2763
|
}, [g, f, k]);
|
|
2794
2764
|
const Pe = w(
|
|
2795
|
-
(
|
|
2796
|
-
if (
|
|
2765
|
+
(c) => {
|
|
2766
|
+
if (te && c && typeof c.focus == "function")
|
|
2797
2767
|
try {
|
|
2798
|
-
|
|
2768
|
+
c.focus({ preventScroll: !0 });
|
|
2799
2769
|
} catch {
|
|
2800
|
-
|
|
2770
|
+
c.focus();
|
|
2801
2771
|
}
|
|
2802
2772
|
},
|
|
2803
|
-
[
|
|
2804
|
-
), it = w((
|
|
2805
|
-
|
|
2806
|
-
}, []),
|
|
2807
|
-
|
|
2808
|
-
}, []), st =
|
|
2773
|
+
[te]
|
|
2774
|
+
), it = w((c, { position: h, totalHeight: v }) => {
|
|
2775
|
+
c(h, v);
|
|
2776
|
+
}, []), Ve = pn(Z, j, it), Pt = w((c, h) => {
|
|
2777
|
+
c(h);
|
|
2778
|
+
}, []), st = pn(se, j, Pt), ut = d(M.top);
|
|
2809
2779
|
ut.current = M.top;
|
|
2810
|
-
const
|
|
2811
|
-
|
|
2812
|
-
fe.current = !0,
|
|
2780
|
+
const Ce = d(Ve);
|
|
2781
|
+
Ce.current = Ve, X(() => (fe.current = !1, () => {
|
|
2782
|
+
fe.current = !0, lt.current && (clearTimeout(lt.current), lt.current = null);
|
|
2813
2783
|
}), []), X(() => {
|
|
2814
|
-
|
|
2815
|
-
}, [
|
|
2784
|
+
te || (Be.current.clear(), Ie.current = null, Oe.current = null);
|
|
2785
|
+
}, [te]);
|
|
2816
2786
|
const Yt = w(
|
|
2817
|
-
(
|
|
2787
|
+
(c, h) => {
|
|
2818
2788
|
if (!h) {
|
|
2819
|
-
|
|
2789
|
+
Be.current.delete(c);
|
|
2820
2790
|
return;
|
|
2821
2791
|
}
|
|
2822
|
-
|
|
2792
|
+
te && (Be.current.set(c, h), Ie.current === c && (Ie.current = null, Oe.current = c, Pe(h)));
|
|
2823
2793
|
},
|
|
2824
|
-
[
|
|
2794
|
+
[te, Pe]
|
|
2825
2795
|
), lr = 0.01, Bt = d({
|
|
2826
2796
|
rafId: null,
|
|
2827
2797
|
loopActive: !1,
|
|
2828
2798
|
idleFrames: 0,
|
|
2829
2799
|
lastRenderedPosition: dt.position
|
|
2830
2800
|
}), Se = w(() => {
|
|
2831
|
-
const
|
|
2832
|
-
|
|
2801
|
+
const c = Bt.current;
|
|
2802
|
+
c.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(c.rafId), c.rafId = null, c.loopActive = !1, c.idleFrames = 0;
|
|
2833
2803
|
}, []);
|
|
2834
2804
|
X(
|
|
2835
2805
|
() => () => {
|
|
@@ -2839,255 +2809,255 @@ const hi = 1e4, Di = () => {
|
|
|
2839
2809
|
);
|
|
2840
2810
|
const Lt = d(() => {
|
|
2841
2811
|
}), Zt = w(() => {
|
|
2842
|
-
const
|
|
2843
|
-
|
|
2844
|
-
const h =
|
|
2845
|
-
if (
|
|
2812
|
+
const c = Bt.current;
|
|
2813
|
+
c.rafId = null;
|
|
2814
|
+
const h = V.current, v = Rt(h, ut.current), q = _.getTotal();
|
|
2815
|
+
if (Vt((W) => Math.abs(W - h) < lr ? W : h), Math.abs(c.lastRenderedPosition - h) >= lr ? (Ce.current({ position: v, totalHeight: q }), c.lastRenderedPosition = h, c.idleFrames = 0) : c.idleFrames += 1, c.idleFrames >= 2) {
|
|
2846
2816
|
Se();
|
|
2847
2817
|
return;
|
|
2848
2818
|
}
|
|
2849
2819
|
if (typeof requestAnimationFrame == "function") {
|
|
2850
|
-
|
|
2820
|
+
c.rafId = requestAnimationFrame((W) => Lt.current(W));
|
|
2851
2821
|
return;
|
|
2852
2822
|
}
|
|
2853
|
-
|
|
2854
|
-
}, [
|
|
2823
|
+
c.loopActive = !1;
|
|
2824
|
+
}, [_, Se]);
|
|
2855
2825
|
Lt.current = Zt;
|
|
2856
|
-
const
|
|
2857
|
-
const
|
|
2858
|
-
if (
|
|
2859
|
-
if (
|
|
2860
|
-
|
|
2826
|
+
const or = w(() => {
|
|
2827
|
+
const c = Bt.current;
|
|
2828
|
+
if (c.idleFrames = 0, !c.loopActive) {
|
|
2829
|
+
if (c.loopActive = !0, typeof requestAnimationFrame == "function") {
|
|
2830
|
+
c.rafId = requestAnimationFrame(Zt);
|
|
2861
2831
|
return;
|
|
2862
2832
|
}
|
|
2863
|
-
|
|
2833
|
+
c.loopActive = !1;
|
|
2864
2834
|
}
|
|
2865
2835
|
}, [Zt]), Ee = w(
|
|
2866
|
-
(
|
|
2867
|
-
const v = h?.immediate ?? !1, q = Rt(
|
|
2868
|
-
if (
|
|
2869
|
-
Bt.current.lastRenderedPosition =
|
|
2836
|
+
(c, h) => {
|
|
2837
|
+
const v = h?.immediate ?? !1, q = Rt(c, M.top);
|
|
2838
|
+
if (V.current = c, v) {
|
|
2839
|
+
Bt.current.lastRenderedPosition = c, Bt.current.idleFrames = 0, Vt(c), Ve({ position: q, totalHeight: _.getTotal() });
|
|
2870
2840
|
return;
|
|
2871
2841
|
}
|
|
2872
|
-
|
|
2842
|
+
or();
|
|
2873
2843
|
},
|
|
2874
|
-
[
|
|
2875
|
-
), It = w((
|
|
2844
|
+
[or, _, M.top, Ve]
|
|
2845
|
+
), It = w((c, h = 0) => {
|
|
2876
2846
|
const v = Re.current;
|
|
2877
2847
|
if (!v)
|
|
2878
|
-
return
|
|
2848
|
+
return c;
|
|
2879
2849
|
const q = v.getScrollPosition();
|
|
2880
2850
|
pe.current += 1;
|
|
2881
|
-
const Y = v.getContentSize() + h, W = v.getViewportSize(),
|
|
2882
|
-
return
|
|
2851
|
+
const Y = v.getContentSize() + h, W = v.getViewportSize(), G = v.scrollTo(c, { contentSize: Y, viewportSize: W });
|
|
2852
|
+
return G === q && (pe.current = Math.max(0, pe.current - 1)), Math.abs(G - c) > 0.5 && (Mt.current = !0), G;
|
|
2883
2853
|
}, []), Wt = d(!1);
|
|
2884
2854
|
X(() => {
|
|
2885
2855
|
if (!Wt.current)
|
|
2886
|
-
if (Wt.current = !0,
|
|
2887
|
-
const
|
|
2888
|
-
Ee(
|
|
2856
|
+
if (Wt.current = !0, N == null && typeof T != "number" && typeof S == "number") {
|
|
2857
|
+
const c = cr(Math.max(S, 0), M.top), h = Math.abs(c - V.current) > 0.5;
|
|
2858
|
+
Ee(c, { immediate: !0 }), h && Re.current?.scrollTo(c);
|
|
2889
2859
|
} else
|
|
2890
|
-
Ee(
|
|
2891
|
-
}, [
|
|
2892
|
-
const
|
|
2893
|
-
if (St !==
|
|
2894
|
-
|
|
2860
|
+
Ee(V.current, { immediate: !0 });
|
|
2861
|
+
}, [N, T, S, M.top, Ee]), X(() => {
|
|
2862
|
+
const c = _.getTotal();
|
|
2863
|
+
if (St !== c) {
|
|
2864
|
+
b(c);
|
|
2895
2865
|
return;
|
|
2896
2866
|
}
|
|
2897
2867
|
if (Mt.current) {
|
|
2898
2868
|
Mt.current = !1;
|
|
2899
2869
|
const h = Re.current;
|
|
2900
|
-
if (h && Math.abs(h.getScrollPosition() -
|
|
2901
|
-
const v = It(
|
|
2870
|
+
if (h && Math.abs(h.getScrollPosition() - V.current) > 0.5) {
|
|
2871
|
+
const v = It(V.current);
|
|
2902
2872
|
Mt.current = !1, Ee(v, { immediate: !0 });
|
|
2903
2873
|
}
|
|
2904
2874
|
}
|
|
2905
|
-
}, [
|
|
2875
|
+
}, [_, St, t, It, Ee]), X(() => {
|
|
2906
2876
|
if (be.current !== null) {
|
|
2907
|
-
const { index:
|
|
2877
|
+
const { index: c, align: h, offset: v } = be.current, q = Ze(c, t), { cumulative: Y, currentValue: W } = _.prefixSum(q, { materializeOption: { materialize: !1 } });
|
|
2908
2878
|
if (Y !== void 0 && W !== void 0) {
|
|
2909
|
-
const
|
|
2910
|
-
let ye =
|
|
2911
|
-
h === "bottom" ? ye = Y -
|
|
2912
|
-
const
|
|
2913
|
-
Math.abs(Ae -
|
|
2914
|
-
from:
|
|
2879
|
+
const G = Math.max(Y - W, 0);
|
|
2880
|
+
let ye = G;
|
|
2881
|
+
h === "bottom" ? ye = Y - Q : h === "center" && (ye = G + W / 2 - Q / 2), v && (ye -= v), ye = Math.max(0, ye);
|
|
2882
|
+
const We = Math.max(0, St + M.top + M.bottom - Q), Ae = Math.min(cr(ye, M.top), We);
|
|
2883
|
+
Math.abs(Ae - V.current) > 1 && (A.debug("[VirtualScroll] Drift correction", {
|
|
2884
|
+
from: V.current,
|
|
2915
2885
|
to: Ae,
|
|
2916
2886
|
targetIndex: q
|
|
2917
2887
|
}), pe.current === 0 && (pe.current += 1), Re.current?.scrollTo(Ae), Ee(Ae, { immediate: !0 }));
|
|
2918
2888
|
}
|
|
2919
2889
|
}
|
|
2920
2890
|
m.current = !1;
|
|
2921
|
-
}, [St,
|
|
2922
|
-
const
|
|
2923
|
-
if (
|
|
2891
|
+
}, [St, _, t, M.top, Ee, Q, M.bottom]), X(() => {
|
|
2892
|
+
const c = ue.current;
|
|
2893
|
+
if (c === M.top || (ue.current = M.top, be.current))
|
|
2924
2894
|
return;
|
|
2925
|
-
const h = Rt(
|
|
2926
|
-
|
|
2895
|
+
const h = Rt(V.current, c), v = cr(h, M.top);
|
|
2896
|
+
V.current = v, Re.current?.scrollTo(v), Ee(v, { immediate: !0 });
|
|
2927
2897
|
}, [M.top, Ee]);
|
|
2928
2898
|
const Ht = w(
|
|
2929
|
-
(
|
|
2899
|
+
(c, h) => {
|
|
2930
2900
|
if (t === 0)
|
|
2931
2901
|
return;
|
|
2932
|
-
const v = Ze(
|
|
2933
|
-
W !== void 0 &&
|
|
2934
|
-
let
|
|
2935
|
-
if (
|
|
2936
|
-
const ye =
|
|
2937
|
-
|
|
2902
|
+
const v = Ze(c, t), q = _.get(v), Y = h - q, W = _.update(v, h);
|
|
2903
|
+
W !== void 0 && b(W), A.debug("[VirtualScroll] Updated item size manually", { index: v, size: h, total: W });
|
|
2904
|
+
let G = be.current ? be.current.index : null;
|
|
2905
|
+
if (G === null) {
|
|
2906
|
+
const ye = V.current, We = mn(F).top, Ae = Rt(ye, We), { index: De, cumulative: ft } = _.findIndexAtOrAfter(Ae, { materializeOption: { materialize: !1 } });
|
|
2907
|
+
G = ft !== void 0 && ft === Ae ? De + 1 : De;
|
|
2938
2908
|
}
|
|
2939
|
-
if (
|
|
2940
|
-
const ye =
|
|
2941
|
-
It(
|
|
2909
|
+
if (G !== -1 && v < G && Y !== 0) {
|
|
2910
|
+
const ye = V.current, We = ye + Y;
|
|
2911
|
+
It(We, Y), Ee(We, { immediate: !0 }), A.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: ye, to: We, causedByIndex: v, delta: Y, activeVisibleStartIndex: G });
|
|
2942
2912
|
}
|
|
2943
2913
|
},
|
|
2944
|
-
[
|
|
2914
|
+
[_, t, It, Ee, F]
|
|
2945
2915
|
), bt = w(
|
|
2946
|
-
(
|
|
2916
|
+
(c, h) => {
|
|
2947
2917
|
if (!Re.current || t === 0)
|
|
2948
2918
|
return;
|
|
2949
|
-
const v = Ze(
|
|
2950
|
-
if (A.debug("[VirtualScroll] Scrolling to index:", v, "ItemBottom:", W, "Total height:",
|
|
2919
|
+
const v = Ze(c, t), q = Ze(v - s * 2, t), Y = Ze(v + s * 2, t), { cumulative: W, total: G, currentValue: ye } = _.prefixSum(v, { materializeOption: { materialize: !0, ranges: [{ from: q, to: Y }] } });
|
|
2920
|
+
if (A.debug("[VirtualScroll] Scrolling to index:", v, "ItemBottom:", W, "Total height:", G, "ItemHeight:", ye, "safeIndexFrom:", q, "safeIndexTo:", Y), !G)
|
|
2951
2921
|
return;
|
|
2952
|
-
const
|
|
2953
|
-
let Ae =
|
|
2954
|
-
h?.align === "bottom" ? Ae = W -
|
|
2955
|
-
const De =
|
|
2922
|
+
const We = Math.max(W - ye, 0);
|
|
2923
|
+
let Ae = We;
|
|
2924
|
+
h?.align === "bottom" ? Ae = W - Q : h?.align === "center" && (Ae = We + ye / 2 - Q / 2), h?.offset && (Ae -= h.offset), Ae = Math.max(0, Ae);
|
|
2925
|
+
const De = cr(Ae, M.top), ft = Re.current?.getContentSize() ?? G + M.top + M.bottom, ht = Math.max(0, ft - Q), gt = Math.min(De, ht);
|
|
2956
2926
|
be.current = {
|
|
2957
2927
|
index: v,
|
|
2958
2928
|
align: h?.align,
|
|
2959
2929
|
offset: h?.offset
|
|
2960
2930
|
};
|
|
2961
|
-
const nr = Re.current?.getScrollPosition() ?? -1,
|
|
2962
|
-
we.current = !1, pe.current = 0,
|
|
2931
|
+
const nr = Re.current?.getScrollPosition() ?? -1, gr = Math.abs(nr - gt) > 0.5;
|
|
2932
|
+
we.current = !1, pe.current = 0, gr && (we.current = !0, pe.current += 1, Re.current?.scrollTo(gt)), b(G), Ee(gt, { immediate: !0 }), A.debug("[VirtualScroll] Setting scroll position to:", gt, { original: De, max: ht });
|
|
2963
2933
|
},
|
|
2964
|
-
[
|
|
2965
|
-
), u = d(
|
|
2934
|
+
[_, s, t, M.top, M.bottom, Q, Ee]
|
|
2935
|
+
), u = d(N && t === 0 ? N : null);
|
|
2966
2936
|
X(() => {
|
|
2967
|
-
const
|
|
2968
|
-
!
|
|
2937
|
+
const c = u.current;
|
|
2938
|
+
!c || t === 0 || (u.current = null, bt(ee(Math.trunc(c.index), 0, t - 1), { align: "top", offset: -Math.max(0, c.offsetPx ?? 0) }));
|
|
2969
2939
|
}, [t, bt]);
|
|
2970
|
-
const
|
|
2971
|
-
(
|
|
2940
|
+
const E = w(
|
|
2941
|
+
(c) => {
|
|
2972
2942
|
if (!Re.current || t === 0)
|
|
2973
2943
|
return;
|
|
2974
|
-
const h =
|
|
2944
|
+
const h = _.getTotal(), v = ee(Math.floor(c), 0, h), { index: q, cumulative: Y, currentValue: W } = _.findIndexAtOrAfter(v, { materializeOption: { materialize: !1 } }), ye = (Y ?? 0) - (W ?? 0) - v;
|
|
2975
2945
|
bt(q, { offset: ye });
|
|
2976
2946
|
},
|
|
2977
|
-
[
|
|
2978
|
-
),
|
|
2947
|
+
[_, t, bt]
|
|
2948
|
+
), O = w(() => {
|
|
2979
2949
|
if (t === 0)
|
|
2980
2950
|
return null;
|
|
2981
|
-
const
|
|
2951
|
+
const c = Rt(V.current, M.top), { index: h, cumulative: v, currentValue: q } = _.findIndexAtOrAfter(c, { materializeOption: { materialize: !1 } });
|
|
2982
2952
|
if (h === -1)
|
|
2983
2953
|
return { index: t - 1, offsetPx: 0 };
|
|
2984
|
-
if (v ===
|
|
2985
|
-
return { index:
|
|
2954
|
+
if (v === c)
|
|
2955
|
+
return { index: ee(h + 1, 0, t - 1), offsetPx: 0 };
|
|
2986
2956
|
const Y = (v ?? 0) - (q ?? 0);
|
|
2987
|
-
return { index: h, offsetPx: Math.max(0,
|
|
2988
|
-
}, [
|
|
2989
|
-
(
|
|
2990
|
-
const h = Rt(
|
|
2991
|
-
|
|
2992
|
-
const q = Re.current?.getScrollPosition(), Y = typeof q == "number" ? q :
|
|
2957
|
+
return { index: h, offsetPx: Math.max(0, c - Y) };
|
|
2958
|
+
}, [_, t, M.top]), oe = w(
|
|
2959
|
+
(c) => {
|
|
2960
|
+
const h = Rt(V.current, M.top), v = typeof c == "function" ? c(h) : c;
|
|
2961
|
+
E(v);
|
|
2962
|
+
const q = Re.current?.getScrollPosition(), Y = typeof q == "number" ? q : V.current;
|
|
2993
2963
|
return Ee(Y), Rt(Y, ut.current);
|
|
2994
2964
|
},
|
|
2995
|
-
[M.top,
|
|
2996
|
-
),
|
|
2965
|
+
[M.top, E, Ee]
|
|
2966
|
+
), He = w((c) => {
|
|
2997
2967
|
const h = Re.current;
|
|
2998
2968
|
if (!h)
|
|
2999
|
-
return Rt(
|
|
3000
|
-
const v = h.scrollTo((q) => q +
|
|
2969
|
+
return Rt(V.current, ut.current);
|
|
2970
|
+
const v = h.scrollTo((q) => q + c);
|
|
3001
2971
|
return Rt(v, ut.current);
|
|
3002
|
-
}, []), je = w((
|
|
3003
|
-
(
|
|
3004
|
-
A.debug("[VirtualScroll] Scroll position changed:",
|
|
2972
|
+
}, []), je = w((c) => Re.current?.applyWheel(c) ?? !1, []), pt = w(
|
|
2973
|
+
(c, h) => {
|
|
2974
|
+
A.debug("[VirtualScroll] Scroll position changed:", c);
|
|
3005
2975
|
const v = we.current;
|
|
3006
2976
|
v && (we.current = !1);
|
|
3007
2977
|
const q = pe.current > 0;
|
|
3008
2978
|
q && (pe.current = 0);
|
|
3009
2979
|
const Y = m.current && z.current === t;
|
|
3010
|
-
if (v || q || Y || (be.current = null), Ee(
|
|
2980
|
+
if (v || q || Y || (be.current = null), Ee(c), re) {
|
|
3011
2981
|
if (v || q)
|
|
3012
2982
|
return;
|
|
3013
|
-
const W =
|
|
3014
|
-
if (A.debug("[VirtualScroll] Scroll diff:", W, "New:",
|
|
3015
|
-
const
|
|
3016
|
-
rt(
|
|
3017
|
-
|
|
2983
|
+
const W = c - h;
|
|
2984
|
+
if (A.debug("[VirtualScroll] Scroll diff:", W, "New:", c, "Prev:", h), Math.abs(W) > 1) {
|
|
2985
|
+
const G = W > 0 ? "down" : "up";
|
|
2986
|
+
rt(G), ke(!0), A.debug("[VirtualScroll] Showing scroll buttons. Direction:", G), lt.current && clearTimeout(lt.current), lt.current = setTimeout(() => {
|
|
2987
|
+
ke(!1), A.debug("[VirtualScroll] Hiding scroll buttons");
|
|
3018
2988
|
}, 2e3);
|
|
3019
2989
|
}
|
|
3020
2990
|
}
|
|
3021
2991
|
},
|
|
3022
|
-
[Ee,
|
|
2992
|
+
[Ee, re, t]
|
|
3023
2993
|
), Ke = Me(() => Rt(tt, M.top), [M.top, tt]), Ot = Me(() => {
|
|
3024
|
-
const
|
|
2994
|
+
const c = _.getTotal(), h = Cn(Ke, Q, s, t, n, _, c);
|
|
3025
2995
|
return A.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
3026
2996
|
...h,
|
|
3027
2997
|
scrollPosition: Ke,
|
|
3028
|
-
renderingContentSize:
|
|
2998
|
+
renderingContentSize: c,
|
|
3029
2999
|
overscanCount: s,
|
|
3030
|
-
viewportSize:
|
|
3000
|
+
viewportSize: Q
|
|
3031
3001
|
})), h;
|
|
3032
|
-
}, [Ke,
|
|
3033
|
-
(
|
|
3034
|
-
if (!
|
|
3002
|
+
}, [Ke, Q, s, t, n, _]), { renderingStartIndex: yt, renderingEndIndex: _t, visibleStartIndex: Ft, visibleEndIndex: Jt } = Ot, Et = w(
|
|
3003
|
+
(c, h) => {
|
|
3004
|
+
if (!te || t === 0)
|
|
3035
3005
|
return;
|
|
3036
|
-
const v = Ze(
|
|
3006
|
+
const v = Ze(c, t);
|
|
3037
3007
|
if (!(h?.ensureVisible ?? !0)) {
|
|
3038
|
-
const ht =
|
|
3039
|
-
ht && (Ie.current = null,
|
|
3008
|
+
const ht = Be.current.get(v);
|
|
3009
|
+
ht && (Ie.current = null, Oe.current = v, Pe(ht));
|
|
3040
3010
|
return;
|
|
3041
3011
|
}
|
|
3042
|
-
const Y =
|
|
3043
|
-
if (
|
|
3012
|
+
const Y = _.prefixSum(v, { materializeOption: { materialize: !1 } }), W = Y.currentValue, G = Math.max(Y.cumulative - W, 0), ye = G + W, We = Rt(V.current, M.top), Ae = We + Q;
|
|
3013
|
+
if (G < We || ye > Ae) {
|
|
3044
3014
|
bt(v);
|
|
3045
|
-
const ht =
|
|
3046
|
-
ht ? (Ie.current = null,
|
|
3015
|
+
const ht = Be.current.get(v);
|
|
3016
|
+
ht ? (Ie.current = null, Oe.current = v, Pe(ht)) : Ie.current = v;
|
|
3047
3017
|
return;
|
|
3048
3018
|
}
|
|
3049
|
-
const ft =
|
|
3019
|
+
const ft = Be.current.get(v);
|
|
3050
3020
|
if (ft) {
|
|
3051
|
-
Ie.current = null,
|
|
3021
|
+
Ie.current = null, Oe.current = v, Pe(ft);
|
|
3052
3022
|
return;
|
|
3053
3023
|
}
|
|
3054
3024
|
Ie.current = v;
|
|
3055
3025
|
},
|
|
3056
|
-
[
|
|
3026
|
+
[te, t, _, M.top, bt, Pe, Q]
|
|
3057
3027
|
), Ut = w(
|
|
3058
|
-
(
|
|
3059
|
-
if (!(!
|
|
3060
|
-
if (
|
|
3028
|
+
(c, h) => {
|
|
3029
|
+
if (!(!te || c.defaultPrevented) && !(c.altKey || c.metaKey || c.ctrlKey) && c.target === c.currentTarget && !c.currentTarget.isContentEditable) {
|
|
3030
|
+
if (c.key === "ArrowLeft" || c.key === "ArrowRight") {
|
|
3061
3031
|
const v = me.current;
|
|
3062
|
-
if (!v ||
|
|
3032
|
+
if (!v || c.shiftKey || !L?.includes("arrow") || !(Number.isFinite(P) && P > 0))
|
|
3063
3033
|
return;
|
|
3064
|
-
|
|
3034
|
+
c.preventDefault(), v(c.key === "ArrowLeft" ? -P : P);
|
|
3065
3035
|
return;
|
|
3066
3036
|
}
|
|
3067
|
-
if (
|
|
3068
|
-
h < t - 1 && (
|
|
3037
|
+
if (c.key === "ArrowDown") {
|
|
3038
|
+
h < t - 1 && (c.preventDefault(), Et(h + 1));
|
|
3069
3039
|
return;
|
|
3070
3040
|
}
|
|
3071
|
-
if (
|
|
3072
|
-
h > 0 && (
|
|
3041
|
+
if (c.key === "ArrowUp") {
|
|
3042
|
+
h > 0 && (c.preventDefault(), Et(h - 1));
|
|
3073
3043
|
return;
|
|
3074
3044
|
}
|
|
3075
|
-
if (
|
|
3045
|
+
if (c.key === "PageDown") {
|
|
3076
3046
|
if (h < t - 1) {
|
|
3077
|
-
|
|
3078
|
-
const { visibleStartIndex: v, visibleEndIndex: q } =
|
|
3079
|
-
Et(
|
|
3047
|
+
c.preventDefault();
|
|
3048
|
+
const { visibleStartIndex: v, visibleEndIndex: q } = le.current, Y = Math.max(q - v + 1, 1), W = Math.max(Y, 1), G = Ze(Math.min(h + W, t - 1), t);
|
|
3049
|
+
Et(G);
|
|
3080
3050
|
}
|
|
3081
3051
|
return;
|
|
3082
3052
|
}
|
|
3083
|
-
if (
|
|
3084
|
-
|
|
3085
|
-
const { visibleStartIndex: v, visibleEndIndex: q } =
|
|
3086
|
-
Et(
|
|
3053
|
+
if (c.key === "PageUp" && h > 0) {
|
|
3054
|
+
c.preventDefault();
|
|
3055
|
+
const { visibleStartIndex: v, visibleEndIndex: q } = le.current, Y = Math.max(q - v + 1, 1), W = Math.max(Y, 1), G = Ze(h - W, t);
|
|
3056
|
+
Et(G);
|
|
3087
3057
|
}
|
|
3088
3058
|
}
|
|
3089
3059
|
},
|
|
3090
|
-
[
|
|
3060
|
+
[te, t, Et, L, P]
|
|
3091
3061
|
), Gt = w(
|
|
3092
3062
|
/**
|
|
3093
3063
|
* Returns focus from an element inside the row back to the row wrapper on Escape.
|
|
@@ -3096,24 +3066,24 @@ const hi = 1e4, Di = () => {
|
|
|
3096
3066
|
* @param event - Keyboard event (bubble phase on the row wrapper) / 行ラッパー bubble フェーズのキーイベント
|
|
3097
3067
|
* @param index - Row index / 行インデックス
|
|
3098
3068
|
*/
|
|
3099
|
-
(
|
|
3100
|
-
if (
|
|
3069
|
+
(c, h) => {
|
|
3070
|
+
if (c.key !== "Escape" || c.defaultPrevented || c.nativeEvent.isComposing || c.target === c.currentTarget)
|
|
3101
3071
|
return;
|
|
3102
|
-
const v =
|
|
3103
|
-
v instanceof HTMLInputElement || v instanceof HTMLTextAreaElement || v instanceof HTMLSelectElement || v.isContentEditable || (
|
|
3072
|
+
const v = c.target;
|
|
3073
|
+
v instanceof HTMLInputElement || v instanceof HTMLTextAreaElement || v instanceof HTMLSelectElement || v.isContentEditable || (c.preventDefault(), Et(h));
|
|
3104
3074
|
},
|
|
3105
3075
|
[Et]
|
|
3106
|
-
),
|
|
3107
|
-
(
|
|
3108
|
-
if (!
|
|
3076
|
+
), mr = w(
|
|
3077
|
+
(c) => {
|
|
3078
|
+
if (!te)
|
|
3109
3079
|
return;
|
|
3110
|
-
const h = Ze(
|
|
3111
|
-
Ie.current = null,
|
|
3080
|
+
const h = Ze(c, t);
|
|
3081
|
+
Ie.current = null, Oe.current = h, Te?.(h);
|
|
3112
3082
|
},
|
|
3113
|
-
[
|
|
3083
|
+
[te, t, Te]
|
|
3114
3084
|
);
|
|
3115
3085
|
X(() => {
|
|
3116
|
-
const
|
|
3086
|
+
const c = Re.current?.getScrollPosition() ?? 0, h = V.current, v = Rt(h, M.top);
|
|
3117
3087
|
A.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
3118
3088
|
renderingStartIndex: yt,
|
|
3119
3089
|
renderingEndIndex: _t,
|
|
@@ -3123,7 +3093,7 @@ const hi = 1e4, Di = () => {
|
|
|
3123
3093
|
paneScrollPosition: h,
|
|
3124
3094
|
logicalScrollPosition: v,
|
|
3125
3095
|
contentSize: St,
|
|
3126
|
-
scrollPaneScrollPosition:
|
|
3096
|
+
scrollPaneScrollPosition: c
|
|
3127
3097
|
})), st({
|
|
3128
3098
|
renderingStartIndex: yt,
|
|
3129
3099
|
renderingEndIndex: _t,
|
|
@@ -3133,101 +3103,101 @@ const hi = 1e4, Di = () => {
|
|
|
3133
3103
|
totalHeight: St
|
|
3134
3104
|
});
|
|
3135
3105
|
}, [St, _t, yt, M.top, st, tt, Jt, Ft]);
|
|
3136
|
-
const
|
|
3137
|
-
if (!
|
|
3106
|
+
const Ct = w(() => {
|
|
3107
|
+
if (!re)
|
|
3138
3108
|
return null;
|
|
3139
|
-
const
|
|
3140
|
-
return /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible":
|
|
3109
|
+
const c = nt && mt !== null;
|
|
3110
|
+
return /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": c, inert: !c, children: mt === "up" ? /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ U(
|
|
3141
3111
|
"button",
|
|
3142
3112
|
{
|
|
3143
3113
|
type: "button",
|
|
3144
3114
|
className: "aqvs-scroll-to-edge-button",
|
|
3145
|
-
tabIndex:
|
|
3115
|
+
tabIndex: c ? 0 : -1,
|
|
3146
3116
|
onClick: (v) => {
|
|
3147
|
-
v.stopPropagation(), we.current = !0, bt(0),
|
|
3117
|
+
v.stopPropagation(), we.current = !0, bt(0), ke(!1);
|
|
3148
3118
|
},
|
|
3149
|
-
children:
|
|
3119
|
+
children: de.scrollToTop
|
|
3150
3120
|
}
|
|
3151
3121
|
) }) : /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ U(
|
|
3152
3122
|
"button",
|
|
3153
3123
|
{
|
|
3154
3124
|
type: "button",
|
|
3155
3125
|
className: "aqvs-scroll-to-edge-button",
|
|
3156
|
-
tabIndex:
|
|
3126
|
+
tabIndex: c ? 0 : -1,
|
|
3157
3127
|
onClick: (v) => {
|
|
3158
|
-
v.stopPropagation(), we.current = !0, bt(t - 1),
|
|
3128
|
+
v.stopPropagation(), we.current = !0, bt(t - 1), ke(!1);
|
|
3159
3129
|
},
|
|
3160
|
-
children:
|
|
3130
|
+
children: de.scrollToBottom
|
|
3161
3131
|
}
|
|
3162
3132
|
) }) });
|
|
3163
|
-
}, [
|
|
3133
|
+
}, [re, nt, mt, bt, t, de]), At = d(0), { visibleItems: $t, renderAnchor: Dt } = Me(() => {
|
|
3164
3134
|
if (t === 0)
|
|
3165
3135
|
return {
|
|
3166
|
-
visibleItems: /* @__PURE__ */ U("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ U("div", { className: "aqvs-no-items-text", children:
|
|
3136
|
+
visibleItems: /* @__PURE__ */ U("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ U("div", { className: "aqvs-no-items-text", children: de.noItems }) }),
|
|
3167
3137
|
renderAnchor: 0
|
|
3168
3138
|
};
|
|
3169
|
-
const
|
|
3170
|
-
Number.isFinite(Y) && Math.abs(Y - At.current) >
|
|
3171
|
-
const W = At.current,
|
|
3172
|
-
let
|
|
3173
|
-
for (let De =
|
|
3174
|
-
if (ye.length >=
|
|
3175
|
-
A.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap:
|
|
3139
|
+
const c = Ze(yt, t), h = Ze(_t, t), { cumulative: v, currentValue: q } = _.prefixSum(c, { materializeOption: { materialize: !1 } }), Y = v - q;
|
|
3140
|
+
Number.isFinite(Y) && Math.abs(Y - At.current) > Vn && (At.current = Y);
|
|
3141
|
+
const W = At.current, G = [], ye = [];
|
|
3142
|
+
let We = 0, Ae = Y;
|
|
3143
|
+
for (let De = c; De <= h; De++) {
|
|
3144
|
+
if (ye.length >= Ur) {
|
|
3145
|
+
A.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Ur, safeRenderingStartIndex: c, safeRenderingEndIndex: h });
|
|
3176
3146
|
break;
|
|
3177
3147
|
}
|
|
3178
|
-
const ft = n(De), ht =
|
|
3179
|
-
gt !== 0 &&
|
|
3180
|
-
const nr = Ae +
|
|
3148
|
+
const ft = n(De), ht = _.get(De), gt = ft - ht;
|
|
3149
|
+
gt !== 0 && G.push({ index: De, value: ft });
|
|
3150
|
+
const nr = Ae + We, gr = r ? r(De) : De;
|
|
3181
3151
|
ye.push(
|
|
3182
3152
|
/* @__PURE__ */ U(
|
|
3183
|
-
|
|
3153
|
+
Si,
|
|
3184
3154
|
{
|
|
3185
3155
|
index: De,
|
|
3186
3156
|
top: nr - W,
|
|
3187
3157
|
height: ft,
|
|
3188
3158
|
item: e(De),
|
|
3189
3159
|
clipItemHeight: qe,
|
|
3190
|
-
enableKeyboardNavigation:
|
|
3160
|
+
enableKeyboardNavigation: te,
|
|
3191
3161
|
onKeyDown: Ut,
|
|
3192
3162
|
onEscapeKeyDown: Qe ? Gt : void 0,
|
|
3193
|
-
onFocus:
|
|
3163
|
+
onFocus: mr,
|
|
3194
3164
|
registerItemRef: Yt,
|
|
3195
|
-
children:
|
|
3165
|
+
children: x
|
|
3196
3166
|
},
|
|
3197
|
-
|
|
3167
|
+
gr
|
|
3198
3168
|
)
|
|
3199
|
-
),
|
|
3169
|
+
), We += gt, Ae += ht;
|
|
3200
3170
|
}
|
|
3201
|
-
return
|
|
3171
|
+
return G.length > 0 && Promise.resolve().then(() => {
|
|
3202
3172
|
if (fe.current)
|
|
3203
3173
|
return;
|
|
3204
3174
|
let De = 0;
|
|
3205
|
-
for (const gt of
|
|
3175
|
+
for (const gt of G)
|
|
3206
3176
|
if (gt.index < Ft) {
|
|
3207
|
-
const nr =
|
|
3177
|
+
const nr = _.get(gt.index);
|
|
3208
3178
|
De += gt.value - nr;
|
|
3209
3179
|
}
|
|
3210
|
-
const ft =
|
|
3180
|
+
const ft = _.updates(G);
|
|
3211
3181
|
if (fe.current || typeof ft != "number")
|
|
3212
3182
|
return;
|
|
3213
|
-
|
|
3214
|
-
const ht = Re.current?.getScrollPosition() ??
|
|
3183
|
+
b(ft), A.debug("[VirtualScroll] Updated heights for items", G, "New total height:", ft);
|
|
3184
|
+
const ht = Re.current?.getScrollPosition() ?? V.current;
|
|
3215
3185
|
if (De !== 0) {
|
|
3216
3186
|
const gt = ht + De;
|
|
3217
3187
|
It(gt, De), Ee(gt, { immediate: !0 }), A.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: ht, to: gt, shiftAmount: De });
|
|
3218
|
-
} else ht !==
|
|
3188
|
+
} else ht !== V.current && Ee(ht);
|
|
3219
3189
|
}), { visibleItems: ye, renderAnchor: W };
|
|
3220
3190
|
}, [
|
|
3221
|
-
|
|
3191
|
+
x,
|
|
3222
3192
|
qe,
|
|
3223
3193
|
St,
|
|
3224
|
-
|
|
3194
|
+
te,
|
|
3225
3195
|
t,
|
|
3226
|
-
|
|
3196
|
+
_,
|
|
3227
3197
|
e,
|
|
3228
3198
|
r,
|
|
3229
3199
|
n,
|
|
3230
|
-
|
|
3200
|
+
mr,
|
|
3231
3201
|
Ut,
|
|
3232
3202
|
Qe,
|
|
3233
3203
|
Gt,
|
|
@@ -3235,31 +3205,31 @@ const hi = 1e4, Di = () => {
|
|
|
3235
3205
|
Yt,
|
|
3236
3206
|
_t,
|
|
3237
3207
|
yt,
|
|
3238
|
-
|
|
3208
|
+
de,
|
|
3239
3209
|
Ee,
|
|
3240
3210
|
Ft
|
|
3241
3211
|
]), Qt = w(
|
|
3242
|
-
(
|
|
3243
|
-
const h = (
|
|
3212
|
+
(c) => {
|
|
3213
|
+
const h = (j ?? 0) > 0, v = Math.abs(c - tt), q = h && v > 0.5 ? tt : c, Y = Rt(q, M.top);
|
|
3244
3214
|
if (A.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
3245
|
-
currentScrollPosition:
|
|
3215
|
+
currentScrollPosition: c,
|
|
3246
3216
|
effectiveScrollPosition: Y,
|
|
3247
3217
|
renderingStartIndex: yt,
|
|
3248
3218
|
renderingEndIndex: _t,
|
|
3249
3219
|
itemCount: t,
|
|
3250
|
-
viewportSize:
|
|
3251
|
-
callbackThrottleMs:
|
|
3220
|
+
viewportSize: Q,
|
|
3221
|
+
callbackThrottleMs: j,
|
|
3252
3222
|
diff: v,
|
|
3253
3223
|
rawEffectiveScrollPosition: q
|
|
3254
3224
|
})), t === 0)
|
|
3255
3225
|
return $t;
|
|
3256
|
-
const W = M.top + Dt - q,
|
|
3226
|
+
const W = M.top + Dt - q, G = M.bottom > 0 ? /* @__PURE__ */ U(
|
|
3257
3227
|
"div",
|
|
3258
3228
|
{
|
|
3259
3229
|
className: "aqvs-bottom-inset",
|
|
3260
3230
|
style: {
|
|
3261
3231
|
// ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
|
|
3262
|
-
top:
|
|
3232
|
+
top: _.getTotal() - Dt,
|
|
3263
3233
|
height: M.bottom
|
|
3264
3234
|
}
|
|
3265
3235
|
},
|
|
@@ -3272,10 +3242,10 @@ const hi = 1e4, Di = () => {
|
|
|
3272
3242
|
effectiveScrollPosition: Y
|
|
3273
3243
|
})), /* @__PURE__ */ qt("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${W}px)`, willChange: "transform" }, children: [
|
|
3274
3244
|
$t,
|
|
3275
|
-
|
|
3245
|
+
G
|
|
3276
3246
|
] });
|
|
3277
3247
|
},
|
|
3278
|
-
[
|
|
3248
|
+
[j, t, _, Ke, Dt, _t, yt, M, tt, Q, $t]
|
|
3279
3249
|
), er = Me(
|
|
3280
3250
|
() => ({
|
|
3281
3251
|
renderingStartIndex: Ot.renderingStartIndex,
|
|
@@ -3283,114 +3253,114 @@ const hi = 1e4, Di = () => {
|
|
|
3283
3253
|
visibleStartIndex: Ot.visibleStartIndex,
|
|
3284
3254
|
visibleEndIndex: Ot.visibleEndIndex,
|
|
3285
3255
|
scrollPosition: Ke,
|
|
3286
|
-
totalHeight:
|
|
3256
|
+
totalHeight: _.getTotal()
|
|
3287
3257
|
// contentSize (State) ではなく最新値を反映
|
|
3288
3258
|
}),
|
|
3289
3259
|
// contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
|
|
3290
3260
|
// (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
|
|
3291
|
-
[Ot, Ke,
|
|
3261
|
+
[Ot, Ke, _, St]
|
|
3292
3262
|
);
|
|
3293
3263
|
X(() => {
|
|
3294
|
-
|
|
3264
|
+
le.current = er;
|
|
3295
3265
|
}, [er]);
|
|
3296
|
-
const [tr, Tt] =
|
|
3266
|
+
const [tr, Tt] = _e(""), rr = d(K);
|
|
3297
3267
|
Je(() => {
|
|
3298
|
-
rr.current =
|
|
3299
|
-
}, [
|
|
3300
|
-
const zt =
|
|
3268
|
+
rr.current = K;
|
|
3269
|
+
}, [K]);
|
|
3270
|
+
const zt = K?.debounceMs ?? 400, vt = Number.isFinite(zt) && zt >= 0, ar = K !== void 0;
|
|
3301
3271
|
X(() => {
|
|
3302
|
-
|
|
3303
|
-
}, [
|
|
3304
|
-
if (!(
|
|
3272
|
+
ar && !vt && A.warn(`[VirtualScroll] liveRegion.debounceMs must be a finite number >= 0, received ${zt}. Announcements are disabled.`);
|
|
3273
|
+
}, [ar, vt, zt]), X(() => {
|
|
3274
|
+
if (!(ar && vt)) {
|
|
3305
3275
|
Tt("");
|
|
3306
3276
|
return;
|
|
3307
3277
|
}
|
|
3308
|
-
const
|
|
3278
|
+
const c = setTimeout(() => {
|
|
3309
3279
|
const h = rr.current?.format;
|
|
3310
3280
|
if (!h)
|
|
3311
3281
|
return;
|
|
3312
3282
|
const v = h({ visibleStartIndex: Ft, visibleEndIndex: Jt, itemCount: t });
|
|
3313
3283
|
Tt(v);
|
|
3314
3284
|
}, zt);
|
|
3315
|
-
return () => clearTimeout(
|
|
3316
|
-
}, [
|
|
3317
|
-
|
|
3285
|
+
return () => clearTimeout(c);
|
|
3286
|
+
}, [ar, vt, zt, Ft, Jt, t]), Ar(
|
|
3287
|
+
J,
|
|
3318
3288
|
() => ({
|
|
3319
3289
|
getScrollPosition: () => {
|
|
3320
|
-
const
|
|
3321
|
-
return typeof
|
|
3290
|
+
const c = Re.current?.getScrollPosition();
|
|
3291
|
+
return typeof c == "number" ? Rt(c, ut.current) : -1;
|
|
3322
3292
|
},
|
|
3323
3293
|
getContentSize: () => Re.current?.getContentSize() ?? -1,
|
|
3324
3294
|
getViewportSize: () => Re.current?.getViewportSize() ?? -1,
|
|
3325
|
-
scrollTo:
|
|
3326
|
-
scrollBy:
|
|
3295
|
+
scrollTo: oe,
|
|
3296
|
+
scrollBy: He,
|
|
3327
3297
|
applyWheel: je,
|
|
3328
3298
|
scrollToIndex: bt,
|
|
3329
|
-
getFenwickTreeTotalHeight: () =>
|
|
3330
|
-
getFenwickSize: () =>
|
|
3299
|
+
getFenwickTreeTotalHeight: () => _.getTotal(),
|
|
3300
|
+
getFenwickSize: () => _.getSize(),
|
|
3331
3301
|
focusItemAtIndex: Et,
|
|
3332
|
-
getRange: () =>
|
|
3333
|
-
getScrollAnchor:
|
|
3302
|
+
getRange: () => le.current,
|
|
3303
|
+
getScrollAnchor: O,
|
|
3334
3304
|
updateItemSize: Ht
|
|
3335
3305
|
}),
|
|
3336
|
-
[
|
|
3306
|
+
[oe, He, je, bt, _, Et, O, Ht]
|
|
3337
3307
|
);
|
|
3338
|
-
const jt =
|
|
3339
|
-
|
|
3308
|
+
const jt = _.getTotal() + M.top + M.bottom, pr = /* @__PURE__ */ U(
|
|
3309
|
+
fi,
|
|
3340
3310
|
{
|
|
3341
3311
|
ref: Re,
|
|
3342
3312
|
contentSize: jt,
|
|
3343
3313
|
viewportSize: i,
|
|
3344
|
-
onViewportSizeChange:
|
|
3314
|
+
onViewportSizeChange: Le,
|
|
3345
3315
|
className: o,
|
|
3346
|
-
testId:
|
|
3316
|
+
testId: l,
|
|
3347
3317
|
onScroll: pt,
|
|
3348
3318
|
background: R,
|
|
3349
|
-
tapScrollCircleOptions:
|
|
3319
|
+
tapScrollCircleOptions: Xe,
|
|
3350
3320
|
inertiaOptions: et,
|
|
3351
3321
|
overscrollBehavior: wt,
|
|
3352
3322
|
itemCount: t,
|
|
3353
|
-
scrollBarWidth:
|
|
3323
|
+
scrollBarWidth: ie,
|
|
3354
3324
|
enableThumbDrag: ge,
|
|
3355
|
-
enableTrackClick:
|
|
3325
|
+
enableTrackClick: $e,
|
|
3356
3326
|
enableArrowButtons: y,
|
|
3357
|
-
enablePointerDrag:
|
|
3327
|
+
enablePointerDrag: Ue,
|
|
3358
3328
|
pointerDragInputs: xe,
|
|
3359
3329
|
renderThumbOverlay: ne,
|
|
3360
3330
|
wheelSpeedMultiplier: at,
|
|
3361
3331
|
onWheelHorizontal: k,
|
|
3362
3332
|
onPanHorizontal: ce,
|
|
3363
3333
|
contentInsets: M,
|
|
3364
|
-
contentProps:
|
|
3334
|
+
contentProps: C,
|
|
3365
3335
|
visibleStartIndex: Ft,
|
|
3366
3336
|
visibleEndIndex: Jt,
|
|
3367
|
-
renderOverlay:
|
|
3337
|
+
renderOverlay: Ct,
|
|
3368
3338
|
initialScrollPosition: dt.position,
|
|
3369
3339
|
locale: B,
|
|
3370
3340
|
labels: H,
|
|
3371
3341
|
children: Qt
|
|
3372
3342
|
}
|
|
3373
3343
|
);
|
|
3374
|
-
return
|
|
3375
|
-
|
|
3344
|
+
return ar ? /* @__PURE__ */ qt(Gr, { children: [
|
|
3345
|
+
pr,
|
|
3376
3346
|
/* @__PURE__ */ U("div", { className: "aqvs-live-region", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-aqvs-live-region": "", children: tr })
|
|
3377
|
-
] }) :
|
|
3378
|
-
},
|
|
3379
|
-
let s = 0, o = 0,
|
|
3380
|
-
for (;
|
|
3381
|
-
s += e(
|
|
3347
|
+
] }) : pr;
|
|
3348
|
+
}, Ii = Cr(Mi), Vr = 262144, gn = 3, yi = 32768, xn = 128, bn = 128, vn = 128, wn = 128, $r = 10, Ti = (t, e) => Math.max(1, Math.floor((t ?? yi) / Math.max(1, e))), Ri = (t, e, r, n, i) => {
|
|
3349
|
+
let s = 0, o = 0, l = Math.max(0, Math.min(n, r - 1));
|
|
3350
|
+
for (; l < r && s < t && o < Ur; )
|
|
3351
|
+
s += e(l), o += 1, l += 1;
|
|
3382
3352
|
return Math.max(1, o + 2 * i + 2);
|
|
3383
|
-
},
|
|
3384
|
-
if (!(Number.isInteger(t) && t >= 0 && t <=
|
|
3353
|
+
}, zr = (t, e, r) => {
|
|
3354
|
+
if (!(Number.isInteger(t) && t >= 0 && t <= Vr))
|
|
3385
3355
|
throw new RangeError(
|
|
3386
|
-
`[VirtualGrid] ${e === "row" ? "getRowHeight" : "getColWidth"}(${r}) returned ${t} — must be an integer in [0, ${
|
|
3356
|
+
`[VirtualGrid] ${e === "row" ? "getRowHeight" : "getColWidth"}(${r}) returned ${t} — must be an integer in [0, ${Vr}] (0 = hidden). Oversized tracks would pierce the browser layout-coordinate wall (see the design plan §3.1/§6).`
|
|
3387
3357
|
);
|
|
3388
3358
|
return t;
|
|
3389
|
-
},
|
|
3390
|
-
const f =
|
|
3359
|
+
}, Pi = (t, e, r, n, i, s, o, l) => {
|
|
3360
|
+
const f = Cn(t, e, r, n, i, s, o);
|
|
3391
3361
|
if (n === 0)
|
|
3392
3362
|
return { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0 };
|
|
3393
|
-
const g =
|
|
3363
|
+
const g = ee(f.renderingStartIndex, 0, n - 1), { cumulative: x, currentValue: R } = s.prefixSum(g, { materializeOption: { materialize: !1 } }), T = x - R, S = Number.isFinite(T) && Math.abs(T - l) > Vn ? T : l;
|
|
3394
3364
|
return {
|
|
3395
3365
|
renderingColStart: f.renderingStartIndex,
|
|
3396
3366
|
renderingColEnd: f.renderingEndIndex,
|
|
@@ -3398,46 +3368,46 @@ const hi = 1e4, Di = () => {
|
|
|
3398
3368
|
visibleColEnd: f.visibleEndIndex,
|
|
3399
3369
|
colAnchor: S
|
|
3400
3370
|
};
|
|
3401
|
-
},
|
|
3371
|
+
}, Sn = [], Ei = (t, e, r, n, i) => {
|
|
3402
3372
|
const s = [], o = [];
|
|
3403
3373
|
if (e < t)
|
|
3404
3374
|
return { columns: s, widthUpdates: o, truncated: 0 };
|
|
3405
|
-
const
|
|
3406
|
-
let f =
|
|
3407
|
-
for (;
|
|
3375
|
+
const l = n.prefixSum(t, { materializeOption: { materialize: !1 } });
|
|
3376
|
+
let f = l.cumulative - l.currentValue, g = 0, x = t;
|
|
3377
|
+
for (; x <= e; ) {
|
|
3408
3378
|
if (s.length >= i)
|
|
3409
|
-
return { columns: s, widthUpdates: o, truncated: e -
|
|
3410
|
-
const R = r(
|
|
3411
|
-
if (R !== T && o.push({ index:
|
|
3412
|
-
s.push({ col:
|
|
3379
|
+
return { columns: s, widthUpdates: o, truncated: e - x + 1 };
|
|
3380
|
+
const R = r(x), T = n.get(x);
|
|
3381
|
+
if (R !== T && o.push({ index: x, value: R }), R > 0) {
|
|
3382
|
+
s.push({ col: x, left: f, width: R }), f += T, g = 0, x += 1;
|
|
3413
3383
|
continue;
|
|
3414
3384
|
}
|
|
3415
|
-
if (f += T, g += 1,
|
|
3385
|
+
if (f += T, g += 1, x += 1, g > Mr) {
|
|
3416
3386
|
const S = n.findIndexAtOrAfter(f + 0.5, { materializeOption: { materialize: !1 } });
|
|
3417
|
-
if (S.index === -1 || S.index <=
|
|
3387
|
+
if (S.index === -1 || S.index <= x || !Number.isSafeInteger(S.index))
|
|
3418
3388
|
break;
|
|
3419
|
-
const
|
|
3420
|
-
f =
|
|
3389
|
+
const N = n.prefixSum(S.index, { materializeOption: { materialize: !1 } });
|
|
3390
|
+
f = N.cumulative - N.currentValue, x = S.index, g = 0;
|
|
3421
3391
|
}
|
|
3422
3392
|
}
|
|
3423
3393
|
return { columns: s, widthUpdates: o, truncated: 0 };
|
|
3424
|
-
},
|
|
3394
|
+
}, zi = (t, e, r) => {
|
|
3425
3395
|
const n = [], i = [];
|
|
3426
3396
|
let s = 0;
|
|
3427
3397
|
for (let o = 0; o < t; o += 1) {
|
|
3428
|
-
const
|
|
3429
|
-
|
|
3398
|
+
const l = e(o), f = r.get(o);
|
|
3399
|
+
l !== f && i.push({ index: o, value: l }), l > 0 && n.push({ col: o, left: s, width: l }), s += f;
|
|
3430
3400
|
}
|
|
3431
3401
|
return { columns: n, widthUpdates: i, width: s };
|
|
3432
|
-
},
|
|
3402
|
+
}, Ni = (t, e, r, n) => {
|
|
3433
3403
|
const i = [], s = [];
|
|
3434
3404
|
let o = 0;
|
|
3435
|
-
for (let
|
|
3436
|
-
const f = r(
|
|
3437
|
-
f !== g && s.push({ index:
|
|
3405
|
+
for (let l = t - e; l < t; l += 1) {
|
|
3406
|
+
const f = r(l), g = n.get(l);
|
|
3407
|
+
f !== g && s.push({ index: l, value: f }), f > 0 && i.push({ col: l, left: o, width: f }), o += g;
|
|
3438
3408
|
}
|
|
3439
3409
|
return { columns: i, widthUpdates: s, width: o };
|
|
3440
|
-
},
|
|
3410
|
+
}, Nr = (t, e, r) => Math.min(t, Math.max(0, r - e)), Vi = { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0, key: "0:0:0" }, Ci = ({
|
|
3441
3411
|
rowCount: t,
|
|
3442
3412
|
colCount: e,
|
|
3443
3413
|
getRowHeight: r,
|
|
@@ -3445,15 +3415,15 @@ const hi = 1e4, Di = () => {
|
|
|
3445
3415
|
getCell: i,
|
|
3446
3416
|
getCellKey: s,
|
|
3447
3417
|
children: o,
|
|
3448
|
-
getCellProps:
|
|
3418
|
+
getCellProps: l,
|
|
3449
3419
|
getRowProps: f,
|
|
3450
3420
|
contentProps: g,
|
|
3451
|
-
background:
|
|
3421
|
+
background: x,
|
|
3452
3422
|
contentInsets: R,
|
|
3453
3423
|
onRowFocus: T,
|
|
3454
3424
|
frozenLeadingCols: S = 0,
|
|
3455
|
-
frozenLeadingRows:
|
|
3456
|
-
frozenTrailingCols:
|
|
3425
|
+
frozenLeadingRows: N = 0,
|
|
3426
|
+
frozenTrailingCols: j = 0,
|
|
3457
3427
|
frozenTrailingRows: F = 0,
|
|
3458
3428
|
horizontalKeyInputs: Te,
|
|
3459
3429
|
horizontalKeyStep: ze,
|
|
@@ -3461,46 +3431,46 @@ const hi = 1e4, Di = () => {
|
|
|
3461
3431
|
onRangeChange: k,
|
|
3462
3432
|
onRenderTruncated: ce,
|
|
3463
3433
|
callbackThrottleMs: L,
|
|
3464
|
-
initialScrollAnchor:
|
|
3465
|
-
overscanRows:
|
|
3466
|
-
overscanCols:
|
|
3434
|
+
initialScrollAnchor: P,
|
|
3435
|
+
overscanRows: C = gn,
|
|
3436
|
+
overscanCols: K = gn,
|
|
3467
3437
|
viewportSize: B,
|
|
3468
3438
|
__maxRenderedCells: H,
|
|
3469
|
-
behaviorOptions:
|
|
3470
|
-
scrollBarOptions:
|
|
3439
|
+
behaviorOptions: J,
|
|
3440
|
+
scrollBarOptions: ie,
|
|
3471
3441
|
liveRegion: ge,
|
|
3472
|
-
locale:
|
|
3442
|
+
locale: $e,
|
|
3473
3443
|
labels: y,
|
|
3474
|
-
className:
|
|
3444
|
+
className: re,
|
|
3475
3445
|
testId: ne
|
|
3476
|
-
},
|
|
3477
|
-
const
|
|
3446
|
+
}, Xe) => {
|
|
3447
|
+
const de = d(null), Ue = d(null), xe = d(r);
|
|
3478
3448
|
xe.current = r;
|
|
3479
|
-
const
|
|
3480
|
-
|
|
3481
|
-
const Qe =
|
|
3482
|
-
(a) =>
|
|
3449
|
+
const te = d(n);
|
|
3450
|
+
te.current = n;
|
|
3451
|
+
const Qe = J?.resetOnGetColWidthChange === !0, et = J?.resetOnGetItemHeightChange === !0 ? r : null, wt = Qe ? n : null, qe = w(
|
|
3452
|
+
(a) => zr(xe.current(a), "row", a),
|
|
3483
3453
|
[et]
|
|
3484
|
-
),
|
|
3485
|
-
(a) =>
|
|
3454
|
+
), Ye = w(
|
|
3455
|
+
(a) => zr(te.current(a), "col", a),
|
|
3486
3456
|
[wt]
|
|
3487
|
-
),
|
|
3488
|
-
if (
|
|
3489
|
-
throw new RangeError(`[VirtualGrid] behaviorOptions.defaultColWidth must be an integer in [0, ${
|
|
3490
|
-
return { resetOnValueFnChange: Qe, baseValue:
|
|
3491
|
-
}, [Qe,
|
|
3492
|
-
if (!(Number.isInteger(S) && S >= 0 && S <=
|
|
3493
|
-
throw new RangeError(`[VirtualGrid] frozenLeadingCols must be an integer in [0, ${
|
|
3494
|
-
const
|
|
3495
|
-
if (!(Number.isInteger(
|
|
3496
|
-
throw new RangeError(`[VirtualGrid] frozenTrailingCols must be an integer in [0, ${
|
|
3497
|
-
const fe = Math.min(
|
|
3498
|
-
if (!(Number.isInteger(
|
|
3499
|
-
throw new RangeError(`[VirtualGrid] frozenLeadingRows must be an integer in [0, ${
|
|
3500
|
-
const M = Math.min(
|
|
3501
|
-
if (!(Number.isInteger(F) && F >= 0 && F <=
|
|
3502
|
-
throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${
|
|
3503
|
-
const
|
|
3457
|
+
), Ne = J?.defaultColWidth, ct = Me(() => {
|
|
3458
|
+
if (Ne !== void 0 && !(Number.isInteger(Ne) && Ne >= 0 && Ne <= Vr))
|
|
3459
|
+
throw new RangeError(`[VirtualGrid] behaviorOptions.defaultColWidth must be an integer in [0, ${Vr}], received ${Ne}.`);
|
|
3460
|
+
return { resetOnValueFnChange: Qe, baseValue: Ne };
|
|
3461
|
+
}, [Qe, Ne]), Q = Nn(e, Ye, ct), [Le, Re] = _e(0);
|
|
3462
|
+
if (!(Number.isInteger(S) && S >= 0 && S <= xn))
|
|
3463
|
+
throw new RangeError(`[VirtualGrid] frozenLeadingCols must be an integer in [0, ${xn}], received ${S}.`);
|
|
3464
|
+
const le = Math.min(S, e), be = d(0);
|
|
3465
|
+
if (!(Number.isInteger(j) && j >= 0 && j <= vn))
|
|
3466
|
+
throw new RangeError(`[VirtualGrid] frozenTrailingCols must be an integer in [0, ${vn}], received ${j}.`);
|
|
3467
|
+
const fe = Math.min(j, e - le), xt = d(0);
|
|
3468
|
+
if (!(Number.isInteger(N) && N >= 0 && N <= bn))
|
|
3469
|
+
throw new RangeError(`[VirtualGrid] frozenLeadingRows must be an integer in [0, ${bn}], received ${N}.`);
|
|
3470
|
+
const M = Math.min(N, t);
|
|
3471
|
+
if (!(Number.isInteger(F) && F >= 0 && F <= wn))
|
|
3472
|
+
throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${wn}], received ${F}.`);
|
|
3473
|
+
const Fe = Math.min(F, t - M), he = Math.max(0, t - M - Fe), _ = d(!1), dt = d(0), tt = d(0), [Vt, St] = _e(0), { frozenRows: b, frozenHeight: V } = Me(() => {
|
|
3504
3474
|
if (M === 0)
|
|
3505
3475
|
return { frozenRows: [], frozenHeight: 0 };
|
|
3506
3476
|
const a = [];
|
|
@@ -3510,93 +3480,93 @@ const hi = 1e4, Di = () => {
|
|
|
3510
3480
|
$ > 0 && a.push({ row: I, top: p, height: $ }), p += $;
|
|
3511
3481
|
}
|
|
3512
3482
|
return { frozenRows: a, frozenHeight: p };
|
|
3513
|
-
}, [M,
|
|
3514
|
-
dt.current =
|
|
3515
|
-
const [
|
|
3516
|
-
if (
|
|
3483
|
+
}, [M, Vt, qe]);
|
|
3484
|
+
dt.current = V;
|
|
3485
|
+
const [ue, Z] = _e(0), { trailingRows: se, trailingHeight: me } = Me(() => {
|
|
3486
|
+
if (Fe === 0)
|
|
3517
3487
|
return { trailingRows: [], trailingHeight: 0 };
|
|
3518
3488
|
const a = [];
|
|
3519
3489
|
let p = 0;
|
|
3520
|
-
for (let I = t -
|
|
3490
|
+
for (let I = t - Fe; I < t; I += 1) {
|
|
3521
3491
|
const $ = qe(I);
|
|
3522
3492
|
$ > 0 && a.push({ row: I, top: p, height: $ }), p += $;
|
|
3523
3493
|
}
|
|
3524
3494
|
return { trailingRows: a, trailingHeight: p };
|
|
3525
|
-
}, [
|
|
3495
|
+
}, [Fe, t, ue, qe]);
|
|
3526
3496
|
tt.current = me;
|
|
3527
3497
|
const Ge = w((a) => qe(a + M), [qe, M]), ve = d(T);
|
|
3528
3498
|
ve.current = T;
|
|
3529
|
-
const
|
|
3499
|
+
const Be = T !== void 0, Ie = Me(() => Be ? (a) => ve.current?.(a + M) : void 0, [M, Be]), Oe = V, mt = me, [rt, nt] = _e(M), ke = d(null), lt = d(!1);
|
|
3530
3500
|
if (rt !== M) {
|
|
3531
|
-
nt(M),
|
|
3532
|
-
const a =
|
|
3533
|
-
|
|
3501
|
+
nt(M), lt.current = !0;
|
|
3502
|
+
const a = de.current?.getScrollAnchor() ?? null;
|
|
3503
|
+
ke.current = a === null ? null : { row: a.index + rt, offsetPx: a.offsetPx };
|
|
3534
3504
|
}
|
|
3535
|
-
const we = d(0), pe = d(0), Mt = d(!1), [m, z] =
|
|
3505
|
+
const we = d(0), pe = d(0), Mt = d(!1), [m, z] = _e(Vi), Pe = d(m);
|
|
3536
3506
|
Pe.current = m;
|
|
3537
|
-
const it = d(0), [
|
|
3538
|
-
st.current =
|
|
3507
|
+
const it = d(0), [Ve, Pt] = _e(() => Q.getTotal() ?? 0), st = d(Ve);
|
|
3508
|
+
st.current = Ve;
|
|
3539
3509
|
const ut = w((a) => {
|
|
3540
3510
|
typeof a == "number" && Number.isFinite(a) && (st.current = a, Pt(a));
|
|
3541
3511
|
}, []);
|
|
3542
3512
|
Je(() => {
|
|
3543
|
-
const a =
|
|
3513
|
+
const a = Q.getTotal();
|
|
3544
3514
|
typeof a == "number" && Number.isFinite(a) && a !== st.current && ut(a);
|
|
3545
3515
|
});
|
|
3546
|
-
const
|
|
3516
|
+
const Ce = ie?.width ?? 12, Yt = B === void 0 ? null : { width: Math.max(0, Math.round(B.width) - Ce), height: Math.max(0, Math.round(B.height) - Ce) }, [lr, Bt] = _e({ width: 0, height: 0 }), Se = Yt ?? lr, Lt = d(Se);
|
|
3547
3517
|
Lt.current = Se;
|
|
3548
|
-
const Zt = Se.height > 0 && Se.height -
|
|
3549
|
-
|
|
3550
|
-
const
|
|
3518
|
+
const Zt = Se.height > 0 && Se.height - V - me <= 0;
|
|
3519
|
+
_.current = Zt;
|
|
3520
|
+
const or = Yt !== null;
|
|
3551
3521
|
Je(() => {
|
|
3552
|
-
if (
|
|
3522
|
+
if (or)
|
|
3553
3523
|
return;
|
|
3554
|
-
const a =
|
|
3524
|
+
const a = Ue.current;
|
|
3555
3525
|
if (a === null)
|
|
3556
3526
|
return;
|
|
3557
3527
|
const p = () => {
|
|
3558
|
-
const $ = Math.max(0, Math.round(a.clientWidth) -
|
|
3559
|
-
Bt((ot) => ot.width === $ && ot.height ===
|
|
3528
|
+
const $ = Math.max(0, Math.round(a.clientWidth) - Ce), ae = Math.max(0, Math.round(a.clientHeight) - Ce);
|
|
3529
|
+
Bt((ot) => ot.width === $ && ot.height === ae ? ot : { width: $, height: ae });
|
|
3560
3530
|
};
|
|
3561
3531
|
p();
|
|
3562
3532
|
const I = new ResizeObserver(p);
|
|
3563
3533
|
return I.observe(a), () => I.disconnect();
|
|
3564
|
-
}, [
|
|
3534
|
+
}, [Ce, or]);
|
|
3565
3535
|
const Ee = w(() => {
|
|
3566
|
-
const a =
|
|
3536
|
+
const a = Ue.current;
|
|
3567
3537
|
a !== null && a.style.setProperty("--aqvs-grid-hx-residual", `${it.current - we.current}px`);
|
|
3568
3538
|
}, []), It = w(() => Math.max(0, Lt.current.width - be.current - xt.current), []), Wt = w(() => Math.max(0, st.current - be.current - xt.current - It()), [It]), Ht = w(() => {
|
|
3569
|
-
const a = It(), p =
|
|
3570
|
-
if (
|
|
3539
|
+
const a = It(), p = Pi(be.current + we.current, a, K, e, Ye, Q, st.current, Pe.current.colAnchor);
|
|
3540
|
+
if (le > 0 && (p.renderingColStart = Math.max(p.renderingColStart, le), p.visibleColStart = Math.max(p.visibleColStart, le)), fe > 0) {
|
|
3571
3541
|
const $ = e - fe - 1;
|
|
3572
3542
|
p.renderingColEnd = Math.min(p.renderingColEnd, $), p.visibleColEnd = Math.min(p.visibleColEnd, $);
|
|
3573
3543
|
}
|
|
3574
|
-
(
|
|
3544
|
+
(le > 0 || fe > 0) && (a <= 0 || p.renderingColStart > p.renderingColEnd) && (p.renderingColStart = e, p.renderingColEnd = e - 1, p.visibleColStart = e, p.visibleColEnd = e - 1);
|
|
3575
3545
|
const I = `${p.renderingColStart}:${p.renderingColEnd}:${p.colAnchor}`;
|
|
3576
3546
|
I !== Pe.current.key && z({ ...p, key: I });
|
|
3577
|
-
}, [
|
|
3578
|
-
|
|
3579
|
-
|
|
3547
|
+
}, [K, e, Ye, Q, le, fe, It]), [bt, u] = _e(0), E = d(null), O = w(() => {
|
|
3548
|
+
E.current === null && (E.current = requestAnimationFrame(() => {
|
|
3549
|
+
E.current = null, u(we.current);
|
|
3580
3550
|
}));
|
|
3581
3551
|
}, []);
|
|
3582
3552
|
X(
|
|
3583
3553
|
() => () => {
|
|
3584
|
-
|
|
3554
|
+
E.current !== null && cancelAnimationFrame(E.current);
|
|
3585
3555
|
},
|
|
3586
3556
|
[]
|
|
3587
3557
|
);
|
|
3588
|
-
const
|
|
3589
|
-
|
|
3590
|
-
const
|
|
3591
|
-
|
|
3558
|
+
const oe = d(D);
|
|
3559
|
+
oe.current = D;
|
|
3560
|
+
const He = d(k);
|
|
3561
|
+
He.current = k;
|
|
3592
3562
|
const je = d(ce);
|
|
3593
3563
|
je.current = ce;
|
|
3594
|
-
const pt = d(null), [Ke, Ot] =
|
|
3564
|
+
const pt = d(null), [Ke, Ot] = _e(null), [yt, _t] = _e(Se.height);
|
|
3595
3565
|
yt !== Se.height && (_t(Se.height), Ot(null));
|
|
3596
|
-
const Ft =
|
|
3566
|
+
const Ft = P === void 0 || t === 0 ? 0 : ee(Math.trunc(P.row), 0, t - 1), Jt = Me(() => {
|
|
3597
3567
|
const a = pt.current?.renderingStartIndex ?? Ft;
|
|
3598
|
-
return
|
|
3599
|
-
}, [Se.height, qe, t, Ft,
|
|
3568
|
+
return Ri(Math.max(0, Se.height - dt.current - tt.current), qe, t, a, C);
|
|
3569
|
+
}, [Se.height, qe, t, Ft, C, Oe, mt]), Et = Ke ?? Jt, Ut = w(() => {
|
|
3600
3570
|
const a = pt.current;
|
|
3601
3571
|
if (a === null)
|
|
3602
3572
|
return null;
|
|
@@ -3619,131 +3589,131 @@ const hi = 1e4, Di = () => {
|
|
|
3619
3589
|
};
|
|
3620
3590
|
}, []), Gt = w(() => {
|
|
3621
3591
|
const a = Ut();
|
|
3622
|
-
a !== null &&
|
|
3623
|
-
}, [Ut]),
|
|
3592
|
+
a !== null && He.current?.(a);
|
|
3593
|
+
}, [Ut]), mr = w(
|
|
3624
3594
|
(a) => {
|
|
3625
|
-
const p = Wt(), I =
|
|
3626
|
-
return I !== we.current && (we.current = I, Ee(), Ht(),
|
|
3595
|
+
const p = Wt(), I = ee(a, 0, p);
|
|
3596
|
+
return I !== we.current && (we.current = I, Ee(), Ht(), O(), oe.current?.({ x: I, y: pe.current })), I;
|
|
3627
3597
|
},
|
|
3628
|
-
[Ee, Ht,
|
|
3629
|
-
),
|
|
3630
|
-
|
|
3598
|
+
[Ee, Ht, O, Wt]
|
|
3599
|
+
), Ct = d(mr);
|
|
3600
|
+
Ct.current = mr, Je(() => {
|
|
3631
3601
|
it.current = m.colAnchor, Ee(), Gt();
|
|
3632
3602
|
}, [m, Ee, Gt]), Je(() => {
|
|
3633
3603
|
pt.current !== null && Gt();
|
|
3634
|
-
}, [
|
|
3604
|
+
}, [V, me, Gt]);
|
|
3635
3605
|
const At = d(null), $t = w(
|
|
3636
3606
|
(a) => {
|
|
3637
|
-
const p =
|
|
3638
|
-
return (a.alignX === "end" ? $ +
|
|
3607
|
+
const p = ee(a.col, 0, Math.max(0, e - 1)), I = Q.prefixSum(p, { materializeOption: { materialize: !1 } }), $ = I.cumulative - I.currentValue, ae = I.currentValue, ot = It();
|
|
3608
|
+
return (a.alignX === "end" ? $ + ae - be.current - ot : a.alignX === "center" ? $ + ae / 2 - be.current - ot / 2 : $ - be.current) + a.offsetX;
|
|
3639
3609
|
},
|
|
3640
|
-
[
|
|
3610
|
+
[Q, e, It]
|
|
3641
3611
|
), Dt = d(null), Qt = w(() => {
|
|
3642
3612
|
const a = Dt.current;
|
|
3643
|
-
Dt.current = null, !(a === null || a.length === 0) && (ut(
|
|
3644
|
-
}, [
|
|
3645
|
-
if (
|
|
3646
|
-
return er.current.count = 0, er.current.warned = !1, { frozenColumns:
|
|
3647
|
-
const { columns: a, widthUpdates: p, width: I } =
|
|
3613
|
+
Dt.current = null, !(a === null || a.length === 0) && (ut(Q.updates(a)), Re((p) => p + 1));
|
|
3614
|
+
}, [Q, ut]), er = d({ count: 0, warned: !1 }), { frozenColumns: tr, frozenWidth: Tt } = Me(() => {
|
|
3615
|
+
if (le === 0)
|
|
3616
|
+
return er.current.count = 0, er.current.warned = !1, { frozenColumns: Sn, frozenWidth: 0 };
|
|
3617
|
+
const { columns: a, widthUpdates: p, width: I } = zi(le, Ye, Q);
|
|
3648
3618
|
if (p.length > 0) {
|
|
3649
3619
|
const $ = er.current;
|
|
3650
|
-
$.count >=
|
|
3651
|
-
frozenCols:
|
|
3620
|
+
$.count >= $r ? $.warned || ($.warned = !0, A.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).", {
|
|
3621
|
+
frozenCols: le,
|
|
3652
3622
|
pendingUpdates: p.length
|
|
3653
3623
|
})) : ($.count += 1, Dt.current = [...Dt.current ?? [], ...p], Promise.resolve().then(Qt));
|
|
3654
3624
|
} else
|
|
3655
3625
|
er.current.count = 0, er.current.warned = !1;
|
|
3656
3626
|
return { frozenColumns: a, frozenWidth: I };
|
|
3657
|
-
}, [
|
|
3627
|
+
}, [le, Le, Ye, Q, Qt]);
|
|
3658
3628
|
be.current = Tt, Je(() => {
|
|
3659
|
-
|
|
3660
|
-
}, [Tt,
|
|
3629
|
+
le > 0 ? Ue.current?.style.setProperty("--aqvs-grid-frozen-width", `${Tt}px`) : Ue.current?.style.removeProperty("--aqvs-grid-frozen-width");
|
|
3630
|
+
}, [Tt, le]);
|
|
3661
3631
|
const rr = d({ count: 0, warned: !1 }), { trailingColumns: zt, trailingWidth: vt } = Me(() => {
|
|
3662
3632
|
if (fe === 0)
|
|
3663
|
-
return rr.current.count = 0, rr.current.warned = !1, { trailingColumns:
|
|
3664
|
-
const { columns: a, widthUpdates: p, width: I } =
|
|
3633
|
+
return rr.current.count = 0, rr.current.warned = !1, { trailingColumns: Sn, trailingWidth: 0 };
|
|
3634
|
+
const { columns: a, widthUpdates: p, width: I } = Ni(e, fe, Ye, Q);
|
|
3665
3635
|
if (p.length > 0) {
|
|
3666
3636
|
const $ = rr.current;
|
|
3667
|
-
$.count >=
|
|
3637
|
+
$.count >= $r ? $.warned || ($.warned = !0, A.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).", {
|
|
3668
3638
|
trailingCols: fe,
|
|
3669
3639
|
pendingUpdates: p.length
|
|
3670
3640
|
})) : ($.count += 1, Dt.current = [...Dt.current ?? [], ...p], Promise.resolve().then(Qt));
|
|
3671
3641
|
} else
|
|
3672
3642
|
rr.current.count = 0, rr.current.warned = !1;
|
|
3673
3643
|
return { trailingColumns: a, trailingWidth: I };
|
|
3674
|
-
}, [fe, e,
|
|
3644
|
+
}, [fe, e, Le, Ye, Q, Qt]);
|
|
3675
3645
|
xt.current = vt, Je(() => {
|
|
3676
|
-
fe > 0 ?
|
|
3646
|
+
fe > 0 ? Ue.current?.style.setProperty("--aqvs-grid-trailing-width", `${vt}px`) : Ue.current?.style.removeProperty("--aqvs-grid-trailing-width");
|
|
3677
3647
|
}, [vt, fe]);
|
|
3678
|
-
const
|
|
3648
|
+
const ar = Me(() => ({ ...ie, tapScrollCircleOptions: { ...ie?.tapScrollCircleOptions, enabled: !1 } }), [ie]), jt = ie?.tapScrollCircleOptions, pr = typeof jt?.maxSpeedMultiplier == "number", c = Me(
|
|
3679
3649
|
() => ({
|
|
3680
3650
|
...jt,
|
|
3681
|
-
offsetX: jt?.offsetX === void 0 ?
|
|
3682
|
-
offsetY: jt?.offsetY === void 0 ?
|
|
3651
|
+
offsetX: jt?.offsetX === void 0 ? fn : jt.offsetX,
|
|
3652
|
+
offsetY: jt?.offsetY === void 0 ? fn : jt.offsetY
|
|
3683
3653
|
}),
|
|
3684
3654
|
[jt]
|
|
3685
|
-
), h = Me(() =>
|
|
3655
|
+
), h = Me(() => Br(c, Math.max(0, e - le - fe)), [c, e, le, fe]), v = Me(() => Br(c, he), [c, he]), q = h.enabled, Y = Math.max(h.maxVisualDistance, 1), W = {
|
|
3686
3656
|
viewportSize: Math.max(0, Se.width - Tt - vt),
|
|
3687
3657
|
minSpeedMultiplier: h.minSpeedMultiplier,
|
|
3688
3658
|
maxSpeedMultiplier: h.maxSpeedMultiplier,
|
|
3689
|
-
hasCustomMaxSpeedMultiplier:
|
|
3659
|
+
hasCustomMaxSpeedMultiplier: pr,
|
|
3690
3660
|
curve: h.maxSpeedCurve
|
|
3691
|
-
},
|
|
3692
|
-
viewportSize: Math.max(0, Se.height -
|
|
3661
|
+
}, G = {
|
|
3662
|
+
viewportSize: Math.max(0, Se.height - V - me),
|
|
3693
3663
|
minSpeedMultiplier: v.minSpeedMultiplier,
|
|
3694
3664
|
maxSpeedMultiplier: v.maxSpeedMultiplier,
|
|
3695
|
-
hasCustomMaxSpeedMultiplier:
|
|
3665
|
+
hasCustomMaxSpeedMultiplier: pr,
|
|
3696
3666
|
curve: v.maxSpeedCurve
|
|
3697
|
-
}, ye = w(() => we.current, []),
|
|
3698
|
-
const a =
|
|
3667
|
+
}, ye = w(() => we.current, []), We = w(() => {
|
|
3668
|
+
const a = de.current;
|
|
3699
3669
|
if (a === null)
|
|
3700
3670
|
return pe.current;
|
|
3701
3671
|
const p = a.getScrollPosition();
|
|
3702
3672
|
return p < 0 ? pe.current : p;
|
|
3703
3673
|
}, []), Ae = w(() => {
|
|
3704
|
-
const a =
|
|
3674
|
+
const a = de.current;
|
|
3705
3675
|
return a === null ? 0 : Math.max(0, Math.max(0, a.getContentSize()) - Math.max(0, a.getViewportSize()));
|
|
3706
3676
|
}, []), De = w((a) => {
|
|
3707
|
-
const p =
|
|
3677
|
+
const p = de.current;
|
|
3708
3678
|
if (p === null)
|
|
3709
3679
|
return pe.current;
|
|
3710
3680
|
const I = p.scrollBy(a);
|
|
3711
3681
|
return pe.current = I, I;
|
|
3712
|
-
}, []), ft = Wt() > 0 || Ae() > 0, ht = `${
|
|
3682
|
+
}, []), ft = Wt() > 0 || Ae() > 0, ht = `${Ve}:${Tt}:${vt}:${Se.width}:${m.key}`, gt = `${t}:${Ke ?? -1}:${V}:${me}:${Se.height}`, { isTapActive: nr, handleTapCircleDragChange: gr, tapCircleHandleRef: An } = bi({
|
|
3713
3683
|
enabled: q && ft,
|
|
3714
3684
|
maxDistance: Y,
|
|
3715
3685
|
xSpeedParams: W,
|
|
3716
|
-
ySpeedParams:
|
|
3717
|
-
applyHxRef:
|
|
3686
|
+
ySpeedParams: G,
|
|
3687
|
+
applyHxRef: Ct,
|
|
3718
3688
|
getHx: ye,
|
|
3719
3689
|
getMaxHx: Wt,
|
|
3720
3690
|
applyVy: De,
|
|
3721
|
-
getVy:
|
|
3691
|
+
getVy: We,
|
|
3722
3692
|
getMaxVy: Ae,
|
|
3723
3693
|
pendingColAnchorRef: At,
|
|
3724
3694
|
xExtentFreshness: ht,
|
|
3725
3695
|
yExtentFreshness: gt
|
|
3726
|
-
}),
|
|
3696
|
+
}), Dn = Me(() => ee((nr ? 1 : 0.8) * h.opacity, 0, 1), [nr, h.opacity]);
|
|
3727
3697
|
Je(() => {
|
|
3728
3698
|
const a = At.current;
|
|
3729
|
-
a === null ?
|
|
3730
|
-
}, [Se.width,
|
|
3731
|
-
const
|
|
3699
|
+
a === null ? Ct.current(we.current) : Ct.current($t(a)), Ht();
|
|
3700
|
+
}, [Se.width, Ve, Le, Tt, vt, Ht, $t]);
|
|
3701
|
+
const Kr = d(!1);
|
|
3732
3702
|
Je(() => {
|
|
3733
|
-
if (
|
|
3703
|
+
if (Kr.current || P === void 0 || e === 0)
|
|
3734
3704
|
return;
|
|
3735
|
-
|
|
3736
|
-
const a =
|
|
3737
|
-
if (a <
|
|
3705
|
+
Kr.current = !0;
|
|
3706
|
+
const a = ee(Math.trunc(P.col), 0, e - 1);
|
|
3707
|
+
if (a < le || a >= e - fe)
|
|
3738
3708
|
return;
|
|
3739
|
-
const p = { col: a, alignX: "start", offsetX: Math.max(0,
|
|
3740
|
-
At.current = p,
|
|
3741
|
-
}, [
|
|
3742
|
-
const
|
|
3743
|
-
pe.current = a, Mt.current = !0,
|
|
3744
|
-
}, []),
|
|
3709
|
+
const p = { col: a, alignX: "start", offsetX: Math.max(0, P.offsetX) };
|
|
3710
|
+
At.current = p, Ct.current($t(p));
|
|
3711
|
+
}, [P, e, $t, le, fe]);
|
|
3712
|
+
const Ln = w((a) => {
|
|
3713
|
+
pe.current = a, Mt.current = !0, oe.current?.({ x: we.current, y: a });
|
|
3714
|
+
}, []), Zr = w(
|
|
3745
3715
|
(a) => {
|
|
3746
|
-
if (he === 0 ||
|
|
3716
|
+
if (he === 0 || _.current)
|
|
3747
3717
|
pt.current = { renderingStartIndex: t, renderingEndIndex: t - 1, visibleStartIndex: t, visibleEndIndex: t - 1, scrollPosition: 0, totalHeight: he === 0 ? 0 : a.totalHeight }, pe.current = 0;
|
|
3748
3718
|
else {
|
|
3749
3719
|
const p = M;
|
|
@@ -3762,189 +3732,189 @@ const hi = 1e4, Di = () => {
|
|
|
3762
3732
|
}), Gt();
|
|
3763
3733
|
},
|
|
3764
3734
|
[Gt, M, he, t]
|
|
3765
|
-
),
|
|
3766
|
-
At.current = null,
|
|
3767
|
-
}, []),
|
|
3735
|
+
), Jr = w((a) => {
|
|
3736
|
+
At.current = null, Ct.current(we.current + a);
|
|
3737
|
+
}, []), Qr = Ti(H, Et + b.length + se.length), Dr = d({ count: 0, warned: !1 }), { placedColumns: Ir, truncatedCols: yr } = Me(() => {
|
|
3768
3738
|
const a = Math.max(0, Se.width - Tt - vt);
|
|
3769
3739
|
if (e === 0 || a <= 0)
|
|
3770
3740
|
return { placedColumns: [], truncatedCols: 0 };
|
|
3771
3741
|
if (m.renderingColStart > m.renderingColEnd)
|
|
3772
3742
|
return { placedColumns: [], truncatedCols: 0 };
|
|
3773
|
-
const p = Math.max(1,
|
|
3743
|
+
const p = Math.max(1, Qr - tr.length - zt.length), { columns: I, widthUpdates: $, truncated: ae } = Ei(ee(m.renderingColStart, 0, e - 1), ee(m.renderingColEnd, 0, e - 1), Ye, Q, p);
|
|
3774
3744
|
if ($.length > 0) {
|
|
3775
|
-
const ot =
|
|
3776
|
-
ot.count >=
|
|
3745
|
+
const ot = Dr.current;
|
|
3746
|
+
ot.count >= $r ? ot.warned || (ot.warned = !0, A.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).", {
|
|
3777
3747
|
window: m.key,
|
|
3778
3748
|
pendingUpdates: $.length
|
|
3779
3749
|
})) : (ot.count += 1, Dt.current = [...Dt.current ?? [], ...$], Promise.resolve().then(Qt));
|
|
3780
3750
|
} else
|
|
3781
|
-
|
|
3782
|
-
return { placedColumns: I, truncatedCols:
|
|
3783
|
-
}, [m, e, Se.width, Tt, vt, tr.length, zt.length,
|
|
3751
|
+
Dr.current.count = 0, Dr.current.warned = !1;
|
|
3752
|
+
return { placedColumns: I, truncatedCols: ae };
|
|
3753
|
+
}, [m, e, Se.width, Tt, vt, tr.length, zt.length, Le, Ye, Q, Qr, Qt]), en = d("");
|
|
3784
3754
|
X(() => {
|
|
3785
|
-
if (
|
|
3786
|
-
const a = `${m.key}:${
|
|
3787
|
-
a !==
|
|
3755
|
+
if (yr > 0) {
|
|
3756
|
+
const a = `${m.key}:${yr}`;
|
|
3757
|
+
a !== en.current && (en.current = a, je.current?.({ renderedCells: (Ir.length + tr.length + zt.length) * (Et + b.length + se.length), droppedCols: yr }));
|
|
3788
3758
|
}
|
|
3789
|
-
}, [
|
|
3790
|
-
const
|
|
3759
|
+
}, [yr, m.key, Ir.length, tr.length, zt.length, Et, b.length, se.length]);
|
|
3760
|
+
const tn = m.colAnchor, Lr = w(
|
|
3791
3761
|
(a) => {
|
|
3792
|
-
const p = f?.(a), I = qe(a) === 0, $ = I ? null :
|
|
3793
|
-
const kt =
|
|
3794
|
-
return /* @__PURE__ */
|
|
3762
|
+
const p = f?.(a), I = qe(a) === 0, $ = I ? null : Ir.map(({ col: ae, left: ot, width: dr }) => {
|
|
3763
|
+
const kt = l?.(a, ae), xr = { ...kt?.style, left: ot - tn, width: dr };
|
|
3764
|
+
return /* @__PURE__ */ Or("div", { ...kt, key: s ? s(a, ae) : ae, className: Nt("aqvs-grid-cell", kt?.className), style: xr }, o(i(a, ae), a, ae));
|
|
3795
3765
|
});
|
|
3796
|
-
return
|
|
3797
|
-
I ? null : tr.map(({ col:
|
|
3798
|
-
const kt =
|
|
3799
|
-
return /* @__PURE__ */
|
|
3766
|
+
return le === 0 && fe === 0 ? /* @__PURE__ */ U("div", { ...p, className: Nt("aqvs-grid-row", p?.className), style: p?.style, children: $ }) : /* @__PURE__ */ qt("div", { ...p, "data-aqvs-frozen-row": le > 0 ? "" : void 0, className: Nt("aqvs-grid-row aqvs-grid-row-frozen-host", p?.className), style: p?.style, children: [
|
|
3767
|
+
I ? null : tr.map(({ col: ae, left: ot, width: dr }) => {
|
|
3768
|
+
const kt = l?.(a, ae), xr = { ...kt?.style, left: ot, width: dr };
|
|
3769
|
+
return /* @__PURE__ */ Or("div", { ...kt, "data-aqvs-frozen-cell": "", key: s ? s(a, ae) : ae, className: Nt("aqvs-grid-cell", kt?.className), style: xr }, o(i(a, ae), a, ae));
|
|
3800
3770
|
}),
|
|
3801
3771
|
I ? null : /* @__PURE__ */ U("div", { className: "aqvs-grid-row-scroll", children: /* @__PURE__ */ U("div", { className: "aqvs-grid-row-scroll-inner", children: $ }) }),
|
|
3802
|
-
I || fe === 0 ? null : /* @__PURE__ */ U("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ U("div", { className: "aqvs-grid-row-trailing-inner", children: zt.map(({ col:
|
|
3803
|
-
const kt =
|
|
3804
|
-
return /* @__PURE__ */
|
|
3772
|
+
I || fe === 0 ? null : /* @__PURE__ */ U("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ U("div", { className: "aqvs-grid-row-trailing-inner", children: zt.map(({ col: ae, left: ot, width: dr }) => {
|
|
3773
|
+
const kt = l?.(a, ae), xr = { ...kt?.style, left: ot, width: dr };
|
|
3774
|
+
return /* @__PURE__ */ Or("div", { ...kt, "data-aqvs-trailing-cell": "", key: s ? s(a, ae) : ae, className: Nt("aqvs-grid-cell", kt?.className), style: xr }, o(i(a, ae), a, ae));
|
|
3805
3775
|
}) }) })
|
|
3806
3776
|
] });
|
|
3807
3777
|
},
|
|
3808
|
-
[
|
|
3809
|
-
), [
|
|
3810
|
-
|
|
3811
|
-
const
|
|
3812
|
-
const a =
|
|
3778
|
+
[Ir, tr, zt, le, fe, tn, f, l, s, i, o, qe]
|
|
3779
|
+
), [On, _n] = _e(""), ur = d(null), rn = d(ge);
|
|
3780
|
+
rn.current = ge;
|
|
3781
|
+
const Tr = w(() => {
|
|
3782
|
+
const a = rn.current;
|
|
3813
3783
|
if (a === void 0)
|
|
3814
3784
|
return;
|
|
3815
3785
|
const p = a.debounceMs ?? 400;
|
|
3816
|
-
Number.isFinite(p) && p >= 0 && (
|
|
3817
|
-
|
|
3786
|
+
Number.isFinite(p) && p >= 0 && (ur.current !== null && window.clearTimeout(ur.current), ur.current = window.setTimeout(() => {
|
|
3787
|
+
ur.current = null;
|
|
3818
3788
|
const I = Ut();
|
|
3819
|
-
I !== null &&
|
|
3820
|
-
const
|
|
3821
|
-
return
|
|
3789
|
+
I !== null && _n(($) => {
|
|
3790
|
+
const ae = a.buildMessage(I);
|
|
3791
|
+
return ae === $ ? $ : ae;
|
|
3822
3792
|
});
|
|
3823
3793
|
}, p));
|
|
3824
|
-
}, [Ut]),
|
|
3794
|
+
}, [Ut]), Rr = ge?.debounceMs ?? 400, nn = Number.isFinite(Rr) && Rr >= 0, sn = ge !== void 0;
|
|
3825
3795
|
X(() => {
|
|
3826
|
-
|
|
3827
|
-
}, [
|
|
3796
|
+
sn && !nn && A.warn(`[VirtualGrid] liveRegion.debounceMs must be a finite number >= 0, received ${Rr}. Announcements are disabled.`);
|
|
3797
|
+
}, [sn, nn, Rr]), X(
|
|
3828
3798
|
() => () => {
|
|
3829
|
-
|
|
3799
|
+
ur.current !== null && window.clearTimeout(ur.current);
|
|
3830
3800
|
},
|
|
3831
3801
|
[]
|
|
3832
3802
|
), X(() => {
|
|
3833
|
-
|
|
3834
|
-
}, [m,
|
|
3835
|
-
const
|
|
3803
|
+
Tr();
|
|
3804
|
+
}, [m, Tr]);
|
|
3805
|
+
const Fn = w(
|
|
3836
3806
|
(a) => {
|
|
3837
|
-
|
|
3807
|
+
Zr(a), Tr();
|
|
3838
3808
|
},
|
|
3839
|
-
[
|
|
3809
|
+
[Zr, Tr]
|
|
3840
3810
|
);
|
|
3841
|
-
return
|
|
3842
|
-
|
|
3811
|
+
return Ar(
|
|
3812
|
+
Xe,
|
|
3843
3813
|
() => ({
|
|
3844
3814
|
scrollTo: (a) => {
|
|
3845
|
-
const p =
|
|
3815
|
+
const p = de.current;
|
|
3846
3816
|
let I = pe.current;
|
|
3847
3817
|
a.y !== void 0 && p !== null && (p.scrollTo(a.y), I = p.getScrollPosition(), pe.current = I);
|
|
3848
3818
|
let $ = we.current;
|
|
3849
|
-
return a.x !== void 0 && (At.current = null, $ =
|
|
3819
|
+
return a.x !== void 0 && (At.current = null, $ = Ct.current(a.x)), { x: $, y: I };
|
|
3850
3820
|
},
|
|
3851
3821
|
scrollBy: (a) => {
|
|
3852
|
-
const p =
|
|
3822
|
+
const p = de.current;
|
|
3853
3823
|
let I = pe.current;
|
|
3854
3824
|
a.y !== void 0 && a.y !== 0 && p !== null && (I = p.scrollBy(a.y), pe.current = I);
|
|
3855
3825
|
let $ = we.current;
|
|
3856
|
-
return a.x !== void 0 && a.x !== 0 && (At.current = null, $ =
|
|
3826
|
+
return a.x !== void 0 && a.x !== 0 && (At.current = null, $ = Ct.current(we.current + a.x)), { x: $, y: I };
|
|
3857
3827
|
},
|
|
3858
3828
|
scrollToCell: (a, p, I) => {
|
|
3859
|
-
const $ =
|
|
3829
|
+
const $ = de.current;
|
|
3860
3830
|
if ($ !== null && t > 0) {
|
|
3861
|
-
const
|
|
3862
|
-
|
|
3831
|
+
const ae = ee(Math.trunc(a), 0, t - 1);
|
|
3832
|
+
ae >= M && ae < t - Fe && $.scrollToIndex(ae - M, { align: I?.alignY ?? "top", offset: I?.offsetY });
|
|
3863
3833
|
}
|
|
3864
3834
|
if (e > 0) {
|
|
3865
|
-
const
|
|
3866
|
-
if (
|
|
3867
|
-
const ot = { col:
|
|
3868
|
-
At.current = ot,
|
|
3835
|
+
const ae = ee(Math.trunc(p), 0, e - 1);
|
|
3836
|
+
if (ae >= le && ae < e - fe) {
|
|
3837
|
+
const ot = { col: ae, alignX: I?.alignX ?? "start", offsetX: I?.offsetX ?? 0 };
|
|
3838
|
+
At.current = ot, Ct.current($t(ot));
|
|
3869
3839
|
}
|
|
3870
3840
|
}
|
|
3871
3841
|
},
|
|
3872
|
-
getScrollPosition: () => Mt.current ||
|
|
3842
|
+
getScrollPosition: () => Mt.current || de.current !== null ? { x: we.current, y: de.current?.getScrollPosition() ?? pe.current } : { x: -1, y: -1 },
|
|
3873
3843
|
getScrollAnchor: () => {
|
|
3874
3844
|
if (t === 0 || e === 0)
|
|
3875
3845
|
return null;
|
|
3876
|
-
const a =
|
|
3846
|
+
const a = de.current?.getScrollAnchor() ?? null;
|
|
3877
3847
|
if (a === null)
|
|
3878
3848
|
return null;
|
|
3879
|
-
const p = be.current + we.current, I =
|
|
3849
|
+
const p = be.current + we.current, I = Q.findIndexAtOrAfter(p, { materializeOption: { materialize: !1 } });
|
|
3880
3850
|
if (I.index === -1)
|
|
3881
3851
|
return { row: a.index + M, col: e - 1, offsetX: 0, offsetY: a.offsetPx };
|
|
3882
3852
|
if (I.cumulative === p)
|
|
3883
|
-
return { row: a.index + M, col:
|
|
3853
|
+
return { row: a.index + M, col: ee(I.index + 1, 0, e - 1), offsetX: 0, offsetY: a.offsetPx };
|
|
3884
3854
|
const $ = (I.cumulative ?? 0) - (I.currentValue ?? 0);
|
|
3885
3855
|
return { row: a.index + M, col: I.index, offsetX: Math.max(0, p - $), offsetY: a.offsetPx };
|
|
3886
3856
|
},
|
|
3887
3857
|
getViewportSize: () => ({ width: Lt.current.width, height: Lt.current.height }),
|
|
3888
3858
|
// 縦はインセット込みの行側 getContentSize を単一情報源にする (range.totalHeight は木総高のみ)。
|
|
3889
3859
|
// 3.5.0: height = H_F + 埋め込み + H_T
|
|
3890
|
-
getContentSize: () => ({ width: st.current, height:
|
|
3860
|
+
getContentSize: () => ({ width: st.current, height: de.current === null ? 0 : dt.current + tt.current + Math.max(0, de.current.getContentSize()) }),
|
|
3891
3861
|
getRange: Ut,
|
|
3892
3862
|
updateRowSize: (a, p) => {
|
|
3893
|
-
|
|
3863
|
+
zr(p, "row", a), Math.trunc(a) < M ? St((I) => I + 1) : Fe > 0 && Math.trunc(a) >= t - Fe ? Z((I) => I + 1) : de.current?.updateItemSize(Math.trunc(a) - M, p);
|
|
3894
3864
|
},
|
|
3895
3865
|
updateColSize: (a, p) => {
|
|
3896
|
-
|
|
3866
|
+
zr(p, "col", a), ut(Q.update(ee(Math.trunc(a), 0, Math.max(0, e - 1)), p)), Re((I) => I + 1);
|
|
3897
3867
|
},
|
|
3898
3868
|
getFrozenSize: () => ({
|
|
3899
|
-
cols:
|
|
3869
|
+
cols: le,
|
|
3900
3870
|
width: be.current,
|
|
3901
3871
|
rows: M,
|
|
3902
3872
|
height: dt.current,
|
|
3903
3873
|
trailingCols: fe,
|
|
3904
|
-
trailingRows:
|
|
3874
|
+
trailingRows: Fe,
|
|
3905
3875
|
trailingWidth: xt.current,
|
|
3906
3876
|
trailingHeight: tt.current,
|
|
3907
3877
|
// vis は単一 JS 源ヘルパーの呼び出しのみ (式の再導出禁止 — 3.5.0 プラン §2.1-4)
|
|
3908
|
-
trailingVisibleWidth:
|
|
3909
|
-
trailingVisibleHeight:
|
|
3878
|
+
trailingVisibleWidth: Nr(xt.current, be.current, Lt.current.width),
|
|
3879
|
+
trailingVisibleHeight: Nr(tt.current, dt.current, Lt.current.height)
|
|
3910
3880
|
}),
|
|
3911
|
-
applyWheel: (a) =>
|
|
3881
|
+
applyWheel: (a) => de.current?.applyWheel(a) ?? !1,
|
|
3912
3882
|
focusRowAtIndex: (a, p) => {
|
|
3913
3883
|
const I = Math.trunc(a);
|
|
3914
|
-
I < M ?
|
|
3884
|
+
I < M ? Ue.current?.querySelector(`[data-aqvs-frozen-band-row="${I}"]`)?.focus() : Fe > 0 && I >= t - Fe ? Ue.current?.querySelector(`[data-aqvs-trailing-band-row="${I}"]`)?.focus() : de.current?.focusItemAtIndex(I - M, p);
|
|
3915
3885
|
}
|
|
3916
3886
|
}),
|
|
3917
|
-
[t, e,
|
|
3918
|
-
), /* @__PURE__ */ qt("div", { ref:
|
|
3887
|
+
[t, e, Q, Ut, ut, $t, le, M, fe, Fe]
|
|
3888
|
+
), /* @__PURE__ */ qt("div", { ref: Ue, className: Nt("aqvs-grid", M > 0 ? "aqvs-grid-has-frozen-rows" : "", Fe > 0 ? "aqvs-grid-has-trailing-rows" : "", re), "data-testid": ne, children: [
|
|
3919
3889
|
M > 0 ? (
|
|
3920
3890
|
// 凍結行帯 (行凍結設計 §4-2): グリッド所有の帯外バンド — 行本体は renderRow を
|
|
3921
3891
|
// そのまま再利用する (F > 0 の凍結セル / クリップ / hx 残差 var は継承で無償追随
|
|
3922
3892
|
// = 4 象限コーナーの成立点)。top は木絶対プレフィックス、高さ 0 行は DOM 非生成
|
|
3923
|
-
/* @__PURE__ */ U("div", { className: "aqvs-grid-frozen-rows", style: { height:
|
|
3893
|
+
/* @__PURE__ */ U("div", { className: "aqvs-grid-frozen-rows", style: { height: V }, "data-testid": ne ? `${ne}-frozen-rows` : void 0, children: b.map(({ row: a, top: p, height: I }) => (
|
|
3924
3894
|
// 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README
|
|
3925
3895
|
// 「Composite widget roles」) の所有物で、パッケージが既定 role を課すと衝突する。
|
|
3926
3896
|
// フォーカス結線は focusRowAtIndex ↔ onRowFocus 往復のバンド版そのもの。右インセット
|
|
3927
3897
|
// (right: scrollBarWidth + overflow クリップ) は縦バーコーナーの予約 — ペインの
|
|
3928
3898
|
// クリップ箱 (root − バー幅) と帯のクリップ箱を一致させる (R1 是正)。
|
|
3929
3899
|
// biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (上記)
|
|
3930
|
-
/* @__PURE__ */ U("div", { "data-aqvs-frozen-band-row": a, className: "aqvs-grid-frozen-band-row", style: { top: p, height: I, right:
|
|
3900
|
+
/* @__PURE__ */ U("div", { "data-aqvs-frozen-band-row": a, className: "aqvs-grid-frozen-band-row", style: { top: p, height: I, right: Ce }, tabIndex: -1, onFocus: () => T?.(a), children: Lr(a) }, a)
|
|
3931
3901
|
)) })
|
|
3932
3902
|
) : null,
|
|
3933
3903
|
/* @__PURE__ */ U("div", { className: "aqvs-grid-main", "data-testid": ne ? `${ne}-main` : void 0, children: /* @__PURE__ */ U(
|
|
3934
|
-
|
|
3904
|
+
Ii,
|
|
3935
3905
|
{
|
|
3936
|
-
ref:
|
|
3906
|
+
ref: de,
|
|
3937
3907
|
itemCount: Zt ? 0 : he,
|
|
3938
3908
|
getItem: (a) => a + M,
|
|
3939
3909
|
getItemKey: (a) => a + M,
|
|
3940
3910
|
getItemHeight: Ge,
|
|
3941
|
-
overscanCount:
|
|
3942
|
-
viewportSize: Se.height > 0 ? Math.max(0, Se.height -
|
|
3911
|
+
overscanCount: C,
|
|
3912
|
+
viewportSize: Se.height > 0 ? Math.max(0, Se.height - V - me) : void 0,
|
|
3943
3913
|
callbackThrottleMs: L,
|
|
3944
|
-
behaviorOptions:
|
|
3945
|
-
scrollBarOptions:
|
|
3914
|
+
behaviorOptions: J,
|
|
3915
|
+
scrollBarOptions: ar,
|
|
3946
3916
|
contentProps: g,
|
|
3947
|
-
background:
|
|
3917
|
+
background: x,
|
|
3948
3918
|
contentInsets: R,
|
|
3949
3919
|
onItemFocus: Ie,
|
|
3950
3920
|
horizontalKeyInputs: Te,
|
|
@@ -3953,45 +3923,45 @@ const hi = 1e4, Di = () => {
|
|
|
3953
3923
|
// トグル済みなら視点保存 (捕捉アンカー) のみ — 捕捉 null は undefined (先頭)
|
|
3954
3924
|
// へ落とし、消費済みマウント props の蘇りを断つ (R2 是正)。未トグルのみ
|
|
3955
3925
|
// マウント props の凍結行 no-op 付き −R 変換 (列の §8 no-op と同文)
|
|
3956
|
-
|
|
3926
|
+
lt.current ? ke.current !== null && ke.current.row >= M && he > 0 ? { index: ke.current.row - M, offsetPx: ke.current.offsetPx } : void 0 : P !== void 0 && he > 0 && Math.trunc(P.row) >= M && Math.trunc(P.row) < t - Fe ? { index: Math.trunc(P.row) - M, offsetPx: P.offsetY } : void 0
|
|
3957
3927
|
),
|
|
3958
|
-
onScroll:
|
|
3959
|
-
onRangeChange:
|
|
3960
|
-
onWheelHorizontal:
|
|
3961
|
-
onPanHorizontal:
|
|
3962
|
-
locale:
|
|
3928
|
+
onScroll: Ln,
|
|
3929
|
+
onRangeChange: Fn,
|
|
3930
|
+
onWheelHorizontal: Jr,
|
|
3931
|
+
onPanHorizontal: Jr,
|
|
3932
|
+
locale: $e,
|
|
3963
3933
|
labels: y,
|
|
3964
3934
|
testId: ne ? `${ne}-rows` : void 0,
|
|
3965
|
-
children:
|
|
3935
|
+
children: Lr
|
|
3966
3936
|
},
|
|
3967
3937
|
M
|
|
3968
3938
|
) }),
|
|
3969
|
-
|
|
3939
|
+
Fe > 0 ? (
|
|
3970
3940
|
// 末尾行帯 (3.5.0 プラン §6.1-17): .aqvs-grid-main の**後**・hbar の**前**の兄弟
|
|
3971
3941
|
// (AT には「最終行が最後」の DOM 順正しさ。縦バーは帯の上で自然に終端)。帯クリップ高は
|
|
3972
3942
|
// インライン H_T_vis (単一 JS 源 — 帯寸の CSS 変数は幅 2 つのみで高さ変数は導入しない)、
|
|
3973
3943
|
// inner はインライン木高 H_T の bottom 定着 — 帯上端 = extent − H_T_vis が全構成で
|
|
3974
3944
|
// 成立し、重複縮退では帯の**末尾**行が可視に残る。行本体は renderRow 逐語再利用
|
|
3975
3945
|
// (先頭列 / 末尾列の帯構造を継承し 4 象限コーナー全種が無償で成立)
|
|
3976
|
-
/* @__PURE__ */ U("div", { className: "aqvs-grid-trailing-rows", style: { height:
|
|
3946
|
+
/* @__PURE__ */ U("div", { className: "aqvs-grid-trailing-rows", style: { height: Nr(me, V, Se.height) }, "data-testid": ne ? `${ne}-trailing-rows` : void 0, children: /* @__PURE__ */ U("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: me }, children: se.map(({ row: a, top: p, height: I }) => (
|
|
3977
3947
|
// 帯行は帯ローカル top + right: scrollBarWidth (縦バーコーナーの予約 — 先頭帯行と
|
|
3978
3948
|
// 同文) + tabIndex −1 + onFocus フル行 index (focusRowAtIndex ↔ onRowFocus 往復)。
|
|
3979
3949
|
// biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (先頭帯行と同文)
|
|
3980
|
-
/* @__PURE__ */ U("div", { "data-aqvs-trailing-band-row": a, className: "aqvs-grid-trailing-band-row", style: { top: p, height: I, right:
|
|
3950
|
+
/* @__PURE__ */ U("div", { "data-aqvs-trailing-band-row": a, className: "aqvs-grid-trailing-band-row", style: { top: p, height: I, right: Ce }, tabIndex: -1, onFocus: () => T?.(a), children: Lr(a) }, a)
|
|
3981
3951
|
)) }) })
|
|
3982
3952
|
) : null,
|
|
3983
|
-
/* @__PURE__ */ U("div", { className: "aqvs-grid-hbar-strip", style: { height:
|
|
3984
|
-
|
|
3953
|
+
/* @__PURE__ */ U("div", { className: "aqvs-grid-hbar-strip", style: { height: Ce, paddingRight: fe > 0 ? Ce + Nr(vt, Tt, Se.width) : Ce }, "data-testid": ne ? `${ne}-hbar` : void 0, children: /* @__PURE__ */ U(
|
|
3954
|
+
En,
|
|
3985
3955
|
{
|
|
3986
3956
|
horizontal: !0,
|
|
3987
|
-
contentSize: Math.max(0,
|
|
3957
|
+
contentSize: Math.max(0, Ve - Tt - vt),
|
|
3988
3958
|
viewportSize: Math.max(0, Se.width - Tt - vt),
|
|
3989
3959
|
scrollPosition: bt,
|
|
3990
|
-
itemCount: Math.max(0, e -
|
|
3991
|
-
tapScrollCircleOptions:
|
|
3992
|
-
onScroll: (a, p) => (At.current = null,
|
|
3993
|
-
scrollBarWidth:
|
|
3994
|
-
locale:
|
|
3960
|
+
itemCount: Math.max(0, e - le - fe),
|
|
3961
|
+
tapScrollCircleOptions: ie?.tapScrollCircleOptions,
|
|
3962
|
+
onScroll: (a, p) => (At.current = null, Ct.current(typeof a == "function" ? a(p ?? we.current) : a)),
|
|
3963
|
+
scrollBarWidth: Ce,
|
|
3964
|
+
locale: $e,
|
|
3995
3965
|
labels: y
|
|
3996
3966
|
}
|
|
3997
3967
|
) }),
|
|
@@ -4007,53 +3977,53 @@ const hi = 1e4, Di = () => {
|
|
|
4007
3977
|
className: "aqvs-grid-tap-circle-wrapper",
|
|
4008
3978
|
"data-aqvs-grid-tap-circle": "",
|
|
4009
3979
|
style: {
|
|
4010
|
-
left: `min(calc(100% - ${
|
|
4011
|
-
top: `min(calc(100% - ${
|
|
3980
|
+
left: `min(calc(100% - ${Ce + h.size}px), max(calc(100% - ${Ce}px + ${h.offsetX}px), calc(75% - ${h.size / 2}px)))`,
|
|
3981
|
+
top: `min(calc(100% - ${Ce + h.size}px), max(calc(100% - ${Ce}px + ${h.offsetY}px), calc(75% - ${h.size / 2}px)))`
|
|
4012
3982
|
},
|
|
4013
3983
|
children: /* @__PURE__ */ U(
|
|
4014
|
-
|
|
3984
|
+
jr,
|
|
4015
3985
|
{
|
|
4016
3986
|
axis: "xy",
|
|
4017
|
-
ref:
|
|
4018
|
-
className:
|
|
3987
|
+
ref: An,
|
|
3988
|
+
className: Nt("aqvs-grid-tap-circle", h.className),
|
|
4019
3989
|
size: h.size,
|
|
4020
3990
|
maxVisualDistance: Y,
|
|
4021
|
-
opacity:
|
|
3991
|
+
opacity: Dn,
|
|
4022
3992
|
renderVisual: h.renderVisual,
|
|
4023
|
-
onDragChange:
|
|
3993
|
+
onDragChange: gr
|
|
4024
3994
|
}
|
|
4025
3995
|
)
|
|
4026
3996
|
}
|
|
4027
3997
|
),
|
|
4028
|
-
ge !== void 0 ? /* @__PURE__ */ U("div", { className: "aqvs-grid-live-region", "aria-live": "polite", "data-testid": ne ? `${ne}-live` : void 0, children:
|
|
3998
|
+
ge !== void 0 ? /* @__PURE__ */ U("div", { className: "aqvs-grid-live-region", "aria-live": "polite", "data-testid": ne ? `${ne}-live` : void 0, children: On }) : null
|
|
4029
3999
|
] });
|
|
4030
|
-
},
|
|
4000
|
+
}, Hi = Cr(Ci);
|
|
4031
4001
|
export {
|
|
4032
4002
|
Kt as FenwickMapTree,
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4003
|
+
xn as MAX_FROZEN_LEADING_COLS,
|
|
4004
|
+
bn as MAX_FROZEN_LEADING_ROWS,
|
|
4005
|
+
vn as MAX_FROZEN_TRAILING_COLS,
|
|
4006
|
+
wn as MAX_FROZEN_TRAILING_ROWS,
|
|
4007
|
+
yi as MAX_RENDERED_CELLS,
|
|
4008
|
+
Vr as MAX_TRACK_SIZE,
|
|
4009
|
+
En as ScrollBar,
|
|
4010
|
+
fi as ScrollPane,
|
|
4011
|
+
Rn as TAP_SCROLL_SPEED_DEFAULTS,
|
|
4012
|
+
Xn as VIRTUAL_SCROLL_LABEL_CATALOGS,
|
|
4013
|
+
Xr as VIRTUAL_SCROLL_LABEL_KEYS,
|
|
4014
|
+
Mn as VIRTUAL_SCROLL_LOCALES,
|
|
4015
|
+
Hi as VirtualGrid,
|
|
4016
|
+
Ii as VirtualScroll,
|
|
4017
|
+
si as computeAutoTapScrollMaxSpeedMultiplier,
|
|
4018
|
+
Wr as computeTapScrollSpeed,
|
|
4019
|
+
oi as computeTapScrollVelocity,
|
|
4020
|
+
Oi as createResidualQuantizer,
|
|
4021
|
+
ee as minmax,
|
|
4022
|
+
In as resolveVirtualScrollLabels,
|
|
4023
|
+
Yn as resolveVirtualScrollLocale,
|
|
4024
|
+
_i as tapScrollCircleSampleVisual,
|
|
4025
|
+
Nn as useFenwickMapTree,
|
|
4026
|
+
Fi as useHeightCache,
|
|
4027
|
+
gi as useLruCache,
|
|
4028
|
+
ki as useWheelBridge
|
|
4059
4029
|
};
|