@aiquants/virtualscroll 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +7 -3
- package/dist/ScrollPane.d.cts +15 -0
- package/dist/ScrollPane.d.ts +15 -0
- package/dist/ScrollPane.d.ts.map +1 -1
- package/dist/VirtualScroll.d.cts +5 -0
- package/dist/VirtualScroll.d.ts +5 -0
- package/dist/VirtualScroll.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1255 -1249
- package/package.json +1 -1
- package/src/ScrollPane.tsx +44 -9
- package/src/VirtualScroll.tsx +7 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { twMerge as
|
|
1
|
+
import { jsx as de, jsxs as Mt, Fragment as dr } from "react/jsx-runtime";
|
|
2
|
+
import xr, { memo as Sr, forwardRef as Zt, useState as rt, useRef as g, useCallback as I, useImperativeHandle as Jt, useMemo as Fe, useLayoutEffect as nt, useEffect as q, useId as Ir } from "react";
|
|
3
|
+
import { twMerge as Et } from "tailwind-merge";
|
|
4
4
|
class T {
|
|
5
5
|
level;
|
|
6
6
|
prefix;
|
|
@@ -146,17 +146,17 @@ class T {
|
|
|
146
146
|
this.level <= 3 && this.impl.error(...this.formatMessage(T.resolveLazy(e)), ...t.map(T.resolveLazy));
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const rr = {
|
|
150
150
|
active: !1,
|
|
151
151
|
offsetX: 0,
|
|
152
152
|
offsetY: 0,
|
|
153
153
|
distance: 0,
|
|
154
154
|
direction: 0,
|
|
155
155
|
pointerId: null
|
|
156
|
-
},
|
|
156
|
+
}, $t = 6, vr = 8, wr = ({ dragState: r, normalizedDistance: e }) => {
|
|
157
157
|
const t = 1 + e * 0.18, n = 0.16 + e * 0.24, i = 0.38 + e * 0.28, s = r.active ? "80ms ease-out" : "220ms ease";
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ Mt(dr, { children: [
|
|
159
|
+
/* @__PURE__ */ de(
|
|
160
160
|
"div",
|
|
161
161
|
{
|
|
162
162
|
className: "aqvs-tap-scroll-circle-visual-outer",
|
|
@@ -168,7 +168,7 @@ const tr = {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
),
|
|
171
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ de(
|
|
172
172
|
"div",
|
|
173
173
|
{
|
|
174
174
|
className: "aqvs-tap-scroll-circle-inner",
|
|
@@ -181,154 +181,154 @@ const tr = {
|
|
|
181
181
|
}
|
|
182
182
|
)
|
|
183
183
|
] });
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
const [
|
|
187
|
-
(
|
|
188
|
-
b(
|
|
184
|
+
}, fr = Sr(
|
|
185
|
+
Zt(({ onDragChange: r, className: e, maxVisualDistance: t = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a }, c) => {
|
|
186
|
+
const [f, b] = rt(rr), S = g(null), w = g(null), V = g({ x: 0, y: 0 }), h = g(null), C = g(0), G = I(
|
|
187
|
+
(v) => {
|
|
188
|
+
b(v), r(v);
|
|
189
189
|
},
|
|
190
190
|
[r]
|
|
191
|
-
),
|
|
192
|
-
(
|
|
193
|
-
const { x:
|
|
194
|
-
let
|
|
195
|
-
const
|
|
196
|
-
Ce === 0 ?
|
|
197
|
-
active:
|
|
198
|
-
offsetX:
|
|
199
|
-
offsetY:
|
|
200
|
-
distance:
|
|
201
|
-
direction:
|
|
202
|
-
pointerId:
|
|
191
|
+
), H = I(
|
|
192
|
+
(v, U, ge = !1) => {
|
|
193
|
+
const { x: qe, y: ee } = V.current, X = v - qe, Xe = U - ee, $e = Math.abs(Xe), Ce = $e < $t ? 0 : Xe < 0 ? -1 : 1, ze = C.current;
|
|
194
|
+
let je = Ce;
|
|
195
|
+
const Ge = $t + vr;
|
|
196
|
+
Ce === 0 ? ze !== 0 && $e < Ge ? je = ze : (je = 0, ge || (C.current = 0)) : Ce !== ze && ze !== 0 && $e < Ge ? je = ze : C.current = Ce, G({
|
|
197
|
+
active: ge || $e >= $t,
|
|
198
|
+
offsetX: X,
|
|
199
|
+
offsetY: Xe,
|
|
200
|
+
distance: $e,
|
|
201
|
+
direction: je,
|
|
202
|
+
pointerId: S.current
|
|
203
203
|
});
|
|
204
204
|
},
|
|
205
|
-
[
|
|
206
|
-
),
|
|
207
|
-
if (
|
|
205
|
+
[G]
|
|
206
|
+
), pe = I((v) => {
|
|
207
|
+
if (v === null)
|
|
208
208
|
return;
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
}, []),
|
|
212
|
-
(
|
|
213
|
-
|
|
209
|
+
const U = h.current;
|
|
210
|
+
U?.hasPointerCapture(v) && U.releasePointerCapture(v);
|
|
211
|
+
}, []), me = I(
|
|
212
|
+
(v = !1) => {
|
|
213
|
+
v && pe(S.current), S.current = null, w.current = null, C.current = 0, G(rr);
|
|
214
214
|
},
|
|
215
|
-
[
|
|
216
|
-
),
|
|
217
|
-
(
|
|
218
|
-
if (
|
|
219
|
-
w.current = { pointerId:
|
|
215
|
+
[G, pe]
|
|
216
|
+
), oe = I(
|
|
217
|
+
(v) => {
|
|
218
|
+
if (S.current !== null && S.current !== v.pointerId) {
|
|
219
|
+
w.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY }, v.preventDefault(), v.stopPropagation();
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
|
|
222
|
+
v.preventDefault(), v.stopPropagation();
|
|
223
|
+
const U = h.current ?? v.currentTarget, { left: ge, top: qe, width: ee, height: X } = U.getBoundingClientRect();
|
|
224
|
+
V.current = { x: ge + ee / 2, y: qe + X / 2 }, S.current = v.pointerId;
|
|
225
225
|
try {
|
|
226
|
-
|
|
226
|
+
U.setPointerCapture(v.pointerId);
|
|
227
227
|
} catch {
|
|
228
228
|
}
|
|
229
|
-
|
|
229
|
+
H(v.clientX, v.clientY, !0);
|
|
230
230
|
},
|
|
231
|
-
[
|
|
232
|
-
),
|
|
233
|
-
(
|
|
234
|
-
if (
|
|
235
|
-
w.current !== null && w.current.pointerId ===
|
|
231
|
+
[H]
|
|
232
|
+
), ce = I(
|
|
233
|
+
(v) => {
|
|
234
|
+
if (S.current !== v.pointerId) {
|
|
235
|
+
w.current !== null && w.current.pointerId === v.pointerId && (w.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY });
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
v.preventDefault(), H(v.clientX, v.clientY);
|
|
239
239
|
},
|
|
240
|
-
[
|
|
241
|
-
),
|
|
242
|
-
(
|
|
243
|
-
if (
|
|
244
|
-
w.current !== null && w.current.pointerId ===
|
|
240
|
+
[H]
|
|
241
|
+
), he = I(
|
|
242
|
+
(v) => {
|
|
243
|
+
if (S.current !== v.pointerId) {
|
|
244
|
+
w.current !== null && w.current.pointerId === v.pointerId && (w.current = null);
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
if (w.current = null,
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
let
|
|
253
|
-
if (
|
|
247
|
+
v.preventDefault(), v.stopPropagation();
|
|
248
|
+
const U = w.current;
|
|
249
|
+
if (w.current = null, U !== null) {
|
|
250
|
+
pe(v.pointerId);
|
|
251
|
+
const ge = h.current;
|
|
252
|
+
let qe = !0;
|
|
253
|
+
if (ge !== null && typeof ge.setPointerCapture == "function")
|
|
254
254
|
try {
|
|
255
|
-
|
|
256
|
-
} catch (
|
|
257
|
-
(typeof
|
|
255
|
+
ge.setPointerCapture(U.pointerId);
|
|
256
|
+
} catch (ee) {
|
|
257
|
+
(typeof ee == "object" && ee !== null && "name" in ee ? ee.name : void 0) === "NotFoundError" && (qe = !1);
|
|
258
258
|
}
|
|
259
|
-
if (
|
|
260
|
-
|
|
259
|
+
if (qe) {
|
|
260
|
+
S.current = U.pointerId, H(U.clientX, U.clientY, !0);
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
me(!0);
|
|
265
265
|
},
|
|
266
|
-
[
|
|
267
|
-
), P =
|
|
268
|
-
(
|
|
269
|
-
|
|
266
|
+
[me, pe, H]
|
|
267
|
+
), P = I(
|
|
268
|
+
(v) => {
|
|
269
|
+
v.target === v.currentTarget && S.current === v.pointerId && me(!1);
|
|
270
270
|
},
|
|
271
|
-
[
|
|
271
|
+
[me]
|
|
272
272
|
);
|
|
273
|
-
|
|
273
|
+
Jt(
|
|
274
274
|
c,
|
|
275
275
|
() => ({
|
|
276
276
|
reset: () => {
|
|
277
|
-
|
|
277
|
+
me(!0);
|
|
278
278
|
},
|
|
279
279
|
getElement: () => h.current
|
|
280
280
|
}),
|
|
281
|
-
[
|
|
281
|
+
[me]
|
|
282
282
|
);
|
|
283
|
-
const _ = Math.min(Math.max(s, 0), 1), M = n / 64,
|
|
284
|
-
dragState:
|
|
285
|
-
normalizedDistance:
|
|
283
|
+
const _ = Math.min(Math.max(s, 0), 1), M = n / 64, Z = Math.min(f.distance, t) / t, Q = f.direction * Z * 10 * M, W = a ?? wr, Ie = {
|
|
284
|
+
dragState: f,
|
|
285
|
+
normalizedDistance: Z,
|
|
286
286
|
sizeScale: M,
|
|
287
287
|
size: n,
|
|
288
288
|
opacity: _
|
|
289
|
-
},
|
|
289
|
+
}, z = {
|
|
290
290
|
...i,
|
|
291
291
|
width: n,
|
|
292
292
|
height: n,
|
|
293
|
-
transform: `translateY(${
|
|
293
|
+
transform: `translateY(${Q}px)`
|
|
294
294
|
};
|
|
295
|
-
return
|
|
295
|
+
return z.opacity = _, /* @__PURE__ */ de(
|
|
296
296
|
"div",
|
|
297
297
|
{
|
|
298
298
|
ref: h,
|
|
299
299
|
"data-testid": "virtual-scroll-tap-circle",
|
|
300
|
-
className:
|
|
301
|
-
style:
|
|
300
|
+
className: Et("aqvs-tap-scroll-circle", e),
|
|
301
|
+
style: z,
|
|
302
302
|
tabIndex: -1,
|
|
303
|
-
onPointerDown:
|
|
304
|
-
onPointerMove:
|
|
305
|
-
onPointerUp:
|
|
306
|
-
onPointerCancel:
|
|
303
|
+
onPointerDown: oe,
|
|
304
|
+
onPointerMove: ce,
|
|
305
|
+
onPointerUp: he,
|
|
306
|
+
onPointerCancel: he,
|
|
307
307
|
onLostPointerCapture: P,
|
|
308
308
|
role: "presentation",
|
|
309
|
-
children:
|
|
309
|
+
children: W(Ie)
|
|
310
310
|
}
|
|
311
311
|
);
|
|
312
312
|
})
|
|
313
313
|
);
|
|
314
|
-
|
|
315
|
-
const
|
|
314
|
+
fr.displayName = "TapScrollCircle";
|
|
315
|
+
const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scroll-cancel", nr = 20, Tr = 250, Pr = 60, Mr = 20, yr = 20, pr = {
|
|
316
316
|
/** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
|
|
317
317
|
maxDistance: 240,
|
|
318
318
|
/** 最小速度倍率 (ビューポート比)。 */
|
|
319
319
|
minSpeedMultiplier: 0.2
|
|
320
|
-
},
|
|
320
|
+
}, Rr = pr.maxDistance, ir = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Wt = 2.2, Er = 8, Nr = 120, Vr = 1 / 10, dt = {
|
|
321
321
|
enabled: !0,
|
|
322
322
|
size: 40,
|
|
323
323
|
offsetX: -80,
|
|
324
324
|
offsetY: 0,
|
|
325
325
|
className: void 0,
|
|
326
|
-
maxVisualDistance:
|
|
327
|
-
minSpeedMultiplier:
|
|
326
|
+
maxVisualDistance: Rr,
|
|
327
|
+
minSpeedMultiplier: pr.minSpeedMultiplier,
|
|
328
328
|
opacity: 0.9,
|
|
329
329
|
renderVisual: void 0,
|
|
330
330
|
maxSpeedCurve: void 0
|
|
331
|
-
},
|
|
331
|
+
}, Cr = (r) => r ? {
|
|
332
332
|
mainSizeKey: "width",
|
|
333
333
|
crossSizeKey: "height",
|
|
334
334
|
positionKey: "left",
|
|
@@ -348,70 +348,70 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
348
348
|
arrowIcons: ["▲", "▼"],
|
|
349
349
|
directionClass: "aqvs-scrollbar-vertical",
|
|
350
350
|
orientation: "vertical"
|
|
351
|
-
},
|
|
352
|
-
const t = r?.maxSpeedMultiplier, n = typeof t == "number" ? t :
|
|
351
|
+
}, zr = (r, e) => {
|
|
352
|
+
const t = r?.maxSpeedMultiplier, n = typeof t == "number" ? t : _r(e);
|
|
353
353
|
return {
|
|
354
|
-
enabled: r?.enabled ??
|
|
355
|
-
size: r?.size ??
|
|
356
|
-
offsetX: r?.offsetX ??
|
|
357
|
-
offsetY: r?.offsetY ??
|
|
358
|
-
className: r?.className ??
|
|
359
|
-
maxVisualDistance: r?.maxVisualDistance ??
|
|
354
|
+
enabled: r?.enabled ?? dt.enabled,
|
|
355
|
+
size: r?.size ?? dt.size,
|
|
356
|
+
offsetX: r?.offsetX ?? dt.offsetX,
|
|
357
|
+
offsetY: r?.offsetY ?? dt.offsetY,
|
|
358
|
+
className: r?.className ?? dt.className,
|
|
359
|
+
maxVisualDistance: r?.maxVisualDistance ?? dt.maxVisualDistance,
|
|
360
360
|
maxSpeedMultiplier: n,
|
|
361
|
-
minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ??
|
|
362
|
-
opacity:
|
|
363
|
-
renderVisual: r?.renderVisual ??
|
|
364
|
-
maxSpeedCurve: r?.maxSpeedCurve ??
|
|
361
|
+
minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ?? dt.minSpeedMultiplier, 0),
|
|
362
|
+
opacity: le(r?.opacity ?? dt.opacity, 0, 1),
|
|
363
|
+
renderVisual: r?.renderVisual ?? dt.renderVisual,
|
|
364
|
+
maxSpeedCurve: r?.maxSpeedCurve ?? dt.maxSpeedCurve
|
|
365
365
|
};
|
|
366
|
-
},
|
|
367
|
-
const i = g(null), s = g(null), a = g(null), c =
|
|
366
|
+
}, Dr = ({ isDragging: r, isThumbHovered: e, enableThumbDrag: t }) => Fe(() => t ? r ? "dragging" : e ? "hover" : "idle" : "disabled", [t, r, e]), Ar = ({ canUseArrowButtons: r, enableArrowButtons: e, resetTapScroll: t, scrollByStep: n }) => {
|
|
367
|
+
const i = g(null), s = g(null), a = g(null), c = I(() => {
|
|
368
368
|
i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), a.current !== null && (window.removeEventListener("pointerup", a.current), window.removeEventListener("pointercancel", a.current), window.removeEventListener("blur", a.current), a.current = null);
|
|
369
|
-
}, []),
|
|
369
|
+
}, []), f = I(() => {
|
|
370
370
|
c();
|
|
371
|
-
}, [c]), b =
|
|
372
|
-
(w) => (
|
|
371
|
+
}, [c]), b = I(
|
|
372
|
+
(w) => (V) => {
|
|
373
373
|
if (!r)
|
|
374
374
|
return;
|
|
375
|
-
|
|
375
|
+
V.cancelable && V.preventDefault(), V.stopPropagation(), t(), c(), n(w), s.current = window.setTimeout(() => {
|
|
376
376
|
i.current = window.setInterval(() => {
|
|
377
377
|
n(w);
|
|
378
|
-
},
|
|
379
|
-
},
|
|
378
|
+
}, Pr);
|
|
379
|
+
}, Tr);
|
|
380
380
|
const h = () => c();
|
|
381
381
|
a.current = h, window.addEventListener("pointerup", h), window.addEventListener("pointercancel", h), window.addEventListener("blur", h);
|
|
382
382
|
},
|
|
383
383
|
[r, c, t, n]
|
|
384
|
-
),
|
|
385
|
-
(w) => (
|
|
386
|
-
e && (
|
|
384
|
+
), S = I(
|
|
385
|
+
(w) => (V) => {
|
|
386
|
+
e && (V.key === "Enter" || V.key === " " || V.key === "Spacebar") && (V.preventDefault(), n(w));
|
|
387
387
|
},
|
|
388
388
|
[e, n]
|
|
389
389
|
);
|
|
390
|
-
return
|
|
390
|
+
return q(() => {
|
|
391
391
|
r || c();
|
|
392
|
-
}, [r, c]),
|
|
392
|
+
}, [r, c]), q(() => () => {
|
|
393
393
|
c();
|
|
394
|
-
}, [c]), { handleArrowPointerDown: b, handleArrowPointerUp:
|
|
395
|
-
},
|
|
396
|
-
const c = Math.max(
|
|
397
|
-
let
|
|
394
|
+
}, [c]), { handleArrowPointerDown: b, handleArrowPointerUp: f, handleArrowKeyDown: S };
|
|
395
|
+
}, Lr = 700, St = (r, e) => typeof r == "number" && Number.isFinite(r) ? r : e, Or = ({ distance: r, maxDistance: e, viewportSize: t, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
|
|
396
|
+
const c = Math.max(St(r, 0), 0), f = St(e, 0), b = f > 0 ? Math.min(c, f) / f : 1, S = Math.max(St(t, 0), 0), w = Math.max(St(n, 0), 0), V = Math.max(St(i, 0), 0), h = Math.max(S * w, 40), C = s ? h : 1200, G = Math.max(S * V, C), H = a ? Math.max(St(a.exponentialScale, V), 0) : 0, pe = a ? Math.min(G, Math.max(S * H, h)) : G, me = Math.max(pe, h);
|
|
397
|
+
let oe = b ** 1.1;
|
|
398
398
|
if (a) {
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
|
|
399
|
+
const he = Math.min(Math.max(St(a.exponentialSteepness, 0), 0), Lr);
|
|
400
|
+
if (he === 0)
|
|
401
|
+
oe = b;
|
|
402
402
|
else {
|
|
403
|
-
const P = Math.expm1(
|
|
404
|
-
|
|
403
|
+
const P = Math.expm1(he) || 1;
|
|
404
|
+
oe = Math.min(Math.max(Math.expm1(he * b) / P, 0), 1);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
const
|
|
408
|
-
return h + (
|
|
409
|
-
},
|
|
407
|
+
const ce = Math.min(Math.max(St(a?.easedOffset, 0), 0), 1);
|
|
408
|
+
return h + (me - h) * (ce + (1 - ce) * oe);
|
|
409
|
+
}, _r = (r) => {
|
|
410
410
|
if (!r || r <= 0)
|
|
411
|
-
return
|
|
412
|
-
const e = Math.max(1, r), t = Math.log10(e), n =
|
|
413
|
-
return
|
|
414
|
-
},
|
|
411
|
+
return Wt;
|
|
412
|
+
const e = Math.max(1, r), t = Math.log10(e), n = Wt + t * Er;
|
|
413
|
+
return le(n, Wt, Nr);
|
|
414
|
+
}, kr = ({
|
|
415
415
|
contentSize: r,
|
|
416
416
|
viewportSize: e,
|
|
417
417
|
scrollPosition: t,
|
|
@@ -420,247 +420,247 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
420
420
|
enableTrackClick: s = !0,
|
|
421
421
|
enableArrowButtons: a = !0,
|
|
422
422
|
horizontal: c = !1,
|
|
423
|
-
scrollBarWidth:
|
|
423
|
+
scrollBarWidth: f = 12,
|
|
424
424
|
className: b,
|
|
425
|
-
ariaControls:
|
|
425
|
+
ariaControls: S,
|
|
426
426
|
tapScrollCircleOptions: w,
|
|
427
|
-
itemCount:
|
|
427
|
+
itemCount: V,
|
|
428
428
|
renderThumbOverlay: h,
|
|
429
|
-
visibleStartIndex:
|
|
430
|
-
visibleEndIndex:
|
|
429
|
+
visibleStartIndex: C,
|
|
430
|
+
visibleEndIndex: G
|
|
431
431
|
}) => {
|
|
432
|
-
const [
|
|
432
|
+
const [H, pe] = rt(!1), [me, oe] = rt(!1), [ce, he] = rt(!1), P = g(null), _ = g({
|
|
433
433
|
pointerId: null,
|
|
434
434
|
startThumbPosition: 0,
|
|
435
435
|
startClientX: 0,
|
|
436
436
|
startClientY: 0,
|
|
437
437
|
scale: 1,
|
|
438
438
|
captureTarget: null
|
|
439
|
-
}), M = g({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }),
|
|
440
|
-
enabled:
|
|
441
|
-
size:
|
|
442
|
-
offsetX:
|
|
439
|
+
}), M = g({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), Z = g(t), Q = g(n), W = g(ir), Ie = g(null), z = g(null), v = g(null), U = g(0), ge = g(0), qe = Fe(() => zr(w, V), [V, w]), ee = Fe(() => Cr(c), [c]), {
|
|
440
|
+
enabled: X,
|
|
441
|
+
size: Xe,
|
|
442
|
+
offsetX: $e,
|
|
443
443
|
offsetY: Ce,
|
|
444
|
-
className:
|
|
445
|
-
maxVisualDistance:
|
|
446
|
-
maxSpeedMultiplier:
|
|
447
|
-
minSpeedMultiplier:
|
|
448
|
-
opacity:
|
|
449
|
-
renderVisual:
|
|
450
|
-
maxSpeedCurve:
|
|
451
|
-
} =
|
|
444
|
+
className: ze,
|
|
445
|
+
maxVisualDistance: je,
|
|
446
|
+
maxSpeedMultiplier: Ge,
|
|
447
|
+
minSpeedMultiplier: K,
|
|
448
|
+
opacity: Ae,
|
|
449
|
+
renderVisual: ue,
|
|
450
|
+
maxSpeedCurve: be
|
|
451
|
+
} = qe, Te = g({
|
|
452
452
|
viewportSize: e,
|
|
453
453
|
maxScrollPosition: Math.max(r - e, 0),
|
|
454
454
|
scrollBarVisible: r > e,
|
|
455
|
-
effectiveTapMaxDistance: Math.max(
|
|
456
|
-
tapCircleMaxSpeedMultiplier:
|
|
457
|
-
tapCircleMinSpeedMultiplier:
|
|
458
|
-
tapCircleMaxSpeedCurve:
|
|
455
|
+
effectiveTapMaxDistance: Math.max(je, 1),
|
|
456
|
+
tapCircleMaxSpeedMultiplier: Ge,
|
|
457
|
+
tapCircleMinSpeedMultiplier: K,
|
|
458
|
+
tapCircleMaxSpeedCurve: be,
|
|
459
459
|
tapScrollCircleOptions: w,
|
|
460
460
|
effectiveTrackLength: 0,
|
|
461
461
|
onScroll: n,
|
|
462
462
|
scrollPosition: t
|
|
463
|
-
}), { mainSizeKey:
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
}), { mainSizeKey: et, crossSizeKey: mt, positionKey: N, selectDelta: it, getPointerCoordinate: vt, arrowLabels: E, arrowIcons: J, directionClass: Ze, orientation: ht } = ee, Le = Math.max(je, 1), st = e / r, ie = Math.max(e - f * 2, 0), p = st * ie, F = Math.min(Math.max(nr, p || 0), ie || nr), B = r - e, Y = Math.max(ie - F, 0), te = B <= 0 || Y <= 0 ? 0 : le(t / B * Y, 0, Y), Me = te + F / 2, j = r > e || H, re = j && a;
|
|
464
|
+
nt(() => {
|
|
465
|
+
Te.current = {
|
|
466
466
|
viewportSize: e,
|
|
467
|
-
maxScrollPosition:
|
|
468
|
-
scrollBarVisible:
|
|
469
|
-
effectiveTapMaxDistance:
|
|
470
|
-
tapCircleMaxSpeedMultiplier:
|
|
471
|
-
tapCircleMinSpeedMultiplier:
|
|
472
|
-
tapCircleMaxSpeedCurve:
|
|
467
|
+
maxScrollPosition: B,
|
|
468
|
+
scrollBarVisible: j,
|
|
469
|
+
effectiveTapMaxDistance: Le,
|
|
470
|
+
tapCircleMaxSpeedMultiplier: Ge,
|
|
471
|
+
tapCircleMinSpeedMultiplier: K,
|
|
472
|
+
tapCircleMaxSpeedCurve: be,
|
|
473
473
|
tapScrollCircleOptions: w,
|
|
474
|
-
effectiveTrackLength:
|
|
474
|
+
effectiveTrackLength: Y,
|
|
475
475
|
onScroll: n,
|
|
476
476
|
scrollPosition: t
|
|
477
477
|
};
|
|
478
|
-
}),
|
|
479
|
-
|
|
480
|
-
}, [t]),
|
|
481
|
-
|
|
482
|
-
}, [n]),
|
|
483
|
-
i ||
|
|
478
|
+
}), nt(() => {
|
|
479
|
+
Z.current = t;
|
|
480
|
+
}, [t]), nt(() => {
|
|
481
|
+
Q.current = n;
|
|
482
|
+
}, [n]), q(() => {
|
|
483
|
+
i || oe(!1);
|
|
484
484
|
}, [i]);
|
|
485
|
-
const
|
|
486
|
-
const
|
|
487
|
-
if (
|
|
488
|
-
const
|
|
489
|
-
if (typeof
|
|
490
|
-
return
|
|
485
|
+
const De = Dr({ isDragging: H, isThumbHovered: me, enableThumbDrag: i }), ne = I((l, x) => {
|
|
486
|
+
const R = Te.current, D = x ?? Z.current;
|
|
487
|
+
if (Q.current) {
|
|
488
|
+
const Ee = Q.current(l, D);
|
|
489
|
+
if (typeof Ee == "number" && Number.isFinite(Ee))
|
|
490
|
+
return Z.current = Ee, Ee;
|
|
491
491
|
}
|
|
492
|
-
const
|
|
493
|
-
return
|
|
494
|
-
}, []),
|
|
492
|
+
const $ = typeof l == "function" ? l(D) : l, ye = Math.max(R.maxScrollPosition, 0), Re = R.scrollBarVisible ? le($, 0, ye) : 0;
|
|
493
|
+
return Z.current = Re, Re;
|
|
494
|
+
}, []), Je = I(
|
|
495
495
|
(l) => {
|
|
496
|
-
const x =
|
|
496
|
+
const x = Te.current, R = Z.current;
|
|
497
497
|
if (!x.scrollBarVisible || x.maxScrollPosition <= 0) {
|
|
498
|
-
const
|
|
499
|
-
return { nextPosition:
|
|
498
|
+
const Ye = ne(0, R), xt = Ye - R;
|
|
499
|
+
return { nextPosition: Ye, actualDelta: xt, reachedBoundary: !0 };
|
|
500
500
|
}
|
|
501
501
|
if (l === 0)
|
|
502
|
-
return { nextPosition:
|
|
503
|
-
const
|
|
504
|
-
return { nextPosition:
|
|
502
|
+
return { nextPosition: R, actualDelta: 0, reachedBoundary: !1 };
|
|
503
|
+
const $ = ne((Ye) => le(Ye + l, 0, x.maxScrollPosition), R), ye = $ - R, Re = l < 0 && R + l <= 0, Ee = l > 0 && R + l >= x.maxScrollPosition, lt = l < 0 && ($ <= 0 || Re && ye === 0) || l > 0 && ($ >= x.maxScrollPosition || Ee && ye === 0);
|
|
504
|
+
return { nextPosition: $, actualDelta: ye, reachedBoundary: lt };
|
|
505
505
|
},
|
|
506
|
-
[
|
|
507
|
-
),
|
|
506
|
+
[ne]
|
|
507
|
+
), Oe = I(
|
|
508
508
|
(l, x) => {
|
|
509
509
|
l.current += x;
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
const D =
|
|
510
|
+
const R = Math.max(Te.current.maxScrollPosition, 0);
|
|
511
|
+
R > 0 && (l.current = le(l.current, -R, R));
|
|
512
|
+
const D = Je(l.current);
|
|
513
513
|
return l.current -= D.actualDelta, D.reachedBoundary && (l.current = 0), D;
|
|
514
514
|
},
|
|
515
|
-
[
|
|
516
|
-
),
|
|
517
|
-
|
|
518
|
-
}, []),
|
|
519
|
-
|
|
520
|
-
}, [
|
|
515
|
+
[Je]
|
|
516
|
+
), ae = I(() => {
|
|
517
|
+
z.current !== null && (window.cancelAnimationFrame(z.current), z.current = null), v.current = null, U.current = 0, ge.current = 0;
|
|
518
|
+
}, []), ve = I(() => {
|
|
519
|
+
W.current = { ...ir }, he(!1), Ie.current?.reset(), ae();
|
|
520
|
+
}, [ae]), We = I(
|
|
521
521
|
(l) => {
|
|
522
|
-
const x =
|
|
522
|
+
const x = W.current, R = Te.current;
|
|
523
523
|
if (!x.active || x.direction === 0) {
|
|
524
|
-
|
|
524
|
+
ae();
|
|
525
525
|
return;
|
|
526
526
|
}
|
|
527
|
-
if (!
|
|
528
|
-
|
|
527
|
+
if (!R.scrollBarVisible || R.maxScrollPosition <= 0) {
|
|
528
|
+
ae();
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
const D =
|
|
532
|
-
if (
|
|
533
|
-
|
|
531
|
+
const D = v.current ?? l, $ = Math.max((l - D) / 1e3, 0), ye = Math.min($, Vr);
|
|
532
|
+
if (v.current = l, ye <= 0) {
|
|
533
|
+
z.current = window.requestAnimationFrame(We);
|
|
534
534
|
return;
|
|
535
535
|
}
|
|
536
|
-
const
|
|
536
|
+
const Re = Or({
|
|
537
537
|
distance: x.distance,
|
|
538
|
-
maxDistance:
|
|
539
|
-
viewportSize:
|
|
540
|
-
minSpeedMultiplier:
|
|
541
|
-
maxSpeedMultiplier:
|
|
542
|
-
hasCustomMaxSpeedMultiplier: typeof
|
|
543
|
-
curve:
|
|
538
|
+
maxDistance: R.effectiveTapMaxDistance,
|
|
539
|
+
viewportSize: R.viewportSize,
|
|
540
|
+
minSpeedMultiplier: R.tapCircleMinSpeedMultiplier,
|
|
541
|
+
maxSpeedMultiplier: R.tapCircleMaxSpeedMultiplier,
|
|
542
|
+
hasCustomMaxSpeedMultiplier: typeof R.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
|
|
543
|
+
curve: R.tapCircleMaxSpeedCurve
|
|
544
544
|
});
|
|
545
|
-
|
|
546
|
-
const { reachedBoundary:
|
|
547
|
-
if (
|
|
548
|
-
|
|
545
|
+
ge.current !== x.direction && (ge.current = x.direction, U.current = 0);
|
|
546
|
+
const { reachedBoundary: Ee } = Oe(U, x.direction * Re * ye);
|
|
547
|
+
if (Ee) {
|
|
548
|
+
ae();
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
-
|
|
551
|
+
z.current = window.requestAnimationFrame(We);
|
|
552
552
|
},
|
|
553
|
-
[
|
|
554
|
-
),
|
|
555
|
-
|
|
556
|
-
}, [
|
|
557
|
-
|
|
558
|
-
const l =
|
|
559
|
-
!l.active || l.direction === 0 ||
|
|
560
|
-
}, [r, e,
|
|
561
|
-
|
|
562
|
-
}, [
|
|
563
|
-
const
|
|
553
|
+
[Oe, ae]
|
|
554
|
+
), Ve = I(() => {
|
|
555
|
+
z.current === null && (v.current = null, U.current = 0, z.current = window.requestAnimationFrame(We));
|
|
556
|
+
}, [We]);
|
|
557
|
+
q(() => {
|
|
558
|
+
const l = W.current;
|
|
559
|
+
!l.active || l.direction === 0 || Ve();
|
|
560
|
+
}, [r, e, Ve]), q(() => () => {
|
|
561
|
+
ae();
|
|
562
|
+
}, [ae]);
|
|
563
|
+
const ft = I(
|
|
564
564
|
(l) => {
|
|
565
|
-
|
|
565
|
+
W.current = l, he(l.active), l.active && l.direction !== 0 ? Ve() : ae();
|
|
566
566
|
},
|
|
567
|
-
[
|
|
567
|
+
[Ve, ae]
|
|
568
568
|
);
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}, [
|
|
569
|
+
q(() => {
|
|
570
|
+
X || ve();
|
|
571
|
+
}, [ve, X]), q(() => {
|
|
572
572
|
const l = (x) => {
|
|
573
573
|
const D = x.detail?.paneId;
|
|
574
|
-
D &&
|
|
574
|
+
D && S && D !== S || ve();
|
|
575
575
|
};
|
|
576
|
-
return window.addEventListener(
|
|
577
|
-
window.removeEventListener(
|
|
576
|
+
return window.addEventListener(Gt, l), () => {
|
|
577
|
+
window.removeEventListener(Gt, l);
|
|
578
578
|
};
|
|
579
|
-
}, [
|
|
580
|
-
if (!
|
|
579
|
+
}, [S, ve]), q(() => {
|
|
580
|
+
if (!X)
|
|
581
581
|
return;
|
|
582
582
|
const l = (x) => {
|
|
583
|
-
if (!
|
|
583
|
+
if (!W.current.active || W.current.pointerId === x.pointerId)
|
|
584
584
|
return;
|
|
585
|
-
const
|
|
586
|
-
if (!(
|
|
587
|
-
|
|
585
|
+
const R = x.target;
|
|
586
|
+
if (!(R instanceof Node)) {
|
|
587
|
+
ve();
|
|
588
588
|
return;
|
|
589
589
|
}
|
|
590
|
-
|
|
590
|
+
Ie.current?.getElement()?.contains(R) || ve();
|
|
591
591
|
};
|
|
592
592
|
return document.addEventListener("pointerdown", l, !0), () => {
|
|
593
593
|
document.removeEventListener("pointerdown", l, !0);
|
|
594
594
|
};
|
|
595
|
-
}, [
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
595
|
+
}, [ve, X]);
|
|
596
|
+
const Qe = (l) => {
|
|
597
|
+
if (!j || Y <= 0 || B <= 0)
|
|
598
598
|
return 0;
|
|
599
|
-
const x =
|
|
600
|
-
return
|
|
601
|
-
},
|
|
602
|
-
const { scrollBarVisible: x, effectiveTrackLength:
|
|
603
|
-
if (T.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: l, trackLen:
|
|
599
|
+
const x = le(l, 0, Y);
|
|
600
|
+
return le(x / Y * B, 0, B);
|
|
601
|
+
}, ot = I((l) => {
|
|
602
|
+
const { scrollBarVisible: x, effectiveTrackLength: R, maxScrollPosition: D } = Te.current;
|
|
603
|
+
if (T.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: l, trackLen: R, maxScroll: D })), R <= 0 || D <= 0)
|
|
604
604
|
return null;
|
|
605
|
-
const
|
|
606
|
-
return
|
|
607
|
-
}, []),
|
|
605
|
+
const $ = le(l, 0, R);
|
|
606
|
+
return le($ / R * D, 0, D);
|
|
607
|
+
}, []), d = I(
|
|
608
608
|
(l) => {
|
|
609
|
-
const x = l.getBoundingClientRect(),
|
|
610
|
-
const
|
|
611
|
-
return Number.isFinite(
|
|
612
|
-
},
|
|
613
|
-
return
|
|
609
|
+
const x = l.getBoundingClientRect(), R = c ? x.width : x.height, D = (lt) => {
|
|
610
|
+
const Ye = Number.parseFloat(lt);
|
|
611
|
+
return Number.isFinite(Ye) ? Ye : 0;
|
|
612
|
+
}, $ = window.getComputedStyle(l), ye = D(c ? $.width : $.height), Re = ye > 0 ? ye + D(c ? $.paddingLeft : $.paddingTop) + D(c ? $.paddingRight : $.paddingBottom) + D(c ? $.borderLeftWidth : $.borderTopWidth) + D(c ? $.borderRightWidth : $.borderBottomWidth) : 0, Ee = Re > 0 ? Re : c ? l.offsetWidth : l.offsetHeight;
|
|
613
|
+
return Ee <= 0 || R <= 0 ? 1 : R / Ee;
|
|
614
614
|
},
|
|
615
615
|
[c]
|
|
616
|
-
),
|
|
616
|
+
), y = I(
|
|
617
617
|
(l) => {
|
|
618
618
|
const x = _.current;
|
|
619
619
|
if (x.pointerId !== l.pointerId)
|
|
620
620
|
return;
|
|
621
|
-
const
|
|
621
|
+
const R = l.clientX - x.startClientX, D = l.clientY - x.startClientY, $ = it(R, D) / (x.scale || 1);
|
|
622
622
|
T.debug("[ScrollBar] handleThumbPointerMove", () => ({
|
|
623
|
-
delta:
|
|
623
|
+
delta: $,
|
|
624
624
|
startThumbPosition: x.startThumbPosition,
|
|
625
625
|
clientY: l.clientY,
|
|
626
626
|
startClientY: x.startClientY,
|
|
627
|
-
metrics:
|
|
627
|
+
metrics: Te.current
|
|
628
628
|
}));
|
|
629
|
-
const
|
|
630
|
-
|
|
629
|
+
const ye = ot(x.startThumbPosition + $);
|
|
630
|
+
ye !== null && ne(ye), l.cancelable && l.preventDefault();
|
|
631
631
|
},
|
|
632
|
-
[
|
|
633
|
-
),
|
|
632
|
+
[it, ot, ne]
|
|
633
|
+
), xe = I(
|
|
634
634
|
(l) => {
|
|
635
635
|
const x = _.current;
|
|
636
636
|
if (x.pointerId !== l.pointerId)
|
|
637
637
|
return;
|
|
638
|
-
document.removeEventListener("pointermove",
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
638
|
+
document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", xe), document.removeEventListener("pointercancel", xe);
|
|
639
|
+
const R = x.captureTarget;
|
|
640
|
+
if (R?.hasPointerCapture?.(l.pointerId) && R.releasePointerCapture(l.pointerId), _.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, pe(!1), P.current) {
|
|
641
641
|
const D = P.current.getBoundingClientRect();
|
|
642
|
-
l.clientX >= D.left && l.clientX <= D.right && l.clientY >= D.top && l.clientY <= D.bottom ||
|
|
642
|
+
l.clientX >= D.left && l.clientX <= D.right && l.clientY >= D.top && l.clientY <= D.bottom || oe(!1);
|
|
643
643
|
} else
|
|
644
|
-
|
|
644
|
+
oe(!1);
|
|
645
645
|
},
|
|
646
|
-
[
|
|
646
|
+
[y]
|
|
647
647
|
);
|
|
648
|
-
|
|
649
|
-
document.removeEventListener("pointermove",
|
|
650
|
-
}, [
|
|
651
|
-
const
|
|
648
|
+
q(() => () => {
|
|
649
|
+
document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", xe), document.removeEventListener("pointercancel", xe);
|
|
650
|
+
}, [y, xe]);
|
|
651
|
+
const tt = g(0), _e = g(0), ct = I(
|
|
652
652
|
(l) => {
|
|
653
|
-
const x = Math.max(Math.round(
|
|
654
|
-
|
|
653
|
+
const x = Math.max(Math.round(Te.current.viewportSize / yr), Mr);
|
|
654
|
+
_e.current !== l && (_e.current = l, tt.current = 0), Oe(tt, l * x);
|
|
655
655
|
},
|
|
656
|
-
[
|
|
657
|
-
), { handleArrowPointerDown:
|
|
658
|
-
canUseArrowButtons:
|
|
656
|
+
[Oe]
|
|
657
|
+
), { handleArrowPointerDown: ut, handleArrowPointerUp: at, handleArrowKeyDown: gt } = Ar({
|
|
658
|
+
canUseArrowButtons: re,
|
|
659
659
|
enableArrowButtons: a,
|
|
660
|
-
resetTapScroll:
|
|
661
|
-
scrollByStep:
|
|
662
|
-
}),
|
|
663
|
-
if (!
|
|
660
|
+
resetTapScroll: ve,
|
|
661
|
+
scrollByStep: ct
|
|
662
|
+
}), pt = (l) => {
|
|
663
|
+
if (!j)
|
|
664
664
|
return;
|
|
665
665
|
if (!i) {
|
|
666
666
|
l.preventDefault(), l.stopPropagation();
|
|
@@ -668,8 +668,8 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
668
668
|
}
|
|
669
669
|
if (l.pointerType === "mouse" && l.button !== 0 || l.ctrlKey)
|
|
670
670
|
return;
|
|
671
|
-
|
|
672
|
-
const x = l.currentTarget,
|
|
671
|
+
ve();
|
|
672
|
+
const x = l.currentTarget, R = d(x);
|
|
673
673
|
let D = null;
|
|
674
674
|
if (x.setPointerCapture)
|
|
675
675
|
try {
|
|
@@ -679,14 +679,14 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
679
679
|
}
|
|
680
680
|
_.current = {
|
|
681
681
|
pointerId: l.pointerId,
|
|
682
|
-
startThumbPosition:
|
|
682
|
+
startThumbPosition: te,
|
|
683
683
|
startClientX: l.clientX,
|
|
684
684
|
startClientY: l.clientY,
|
|
685
|
-
scale:
|
|
685
|
+
scale: R,
|
|
686
686
|
captureTarget: D
|
|
687
|
-
}, document.addEventListener("pointermove",
|
|
688
|
-
},
|
|
689
|
-
if (!
|
|
687
|
+
}, document.addEventListener("pointermove", y), document.addEventListener("pointerup", xe), document.addEventListener("pointercancel", xe), pe(!0), oe(!0), l.preventDefault(), l.stopPropagation();
|
|
688
|
+
}, yt = (l) => {
|
|
689
|
+
if (!j)
|
|
690
690
|
return;
|
|
691
691
|
if (!s) {
|
|
692
692
|
l.preventDefault(), l.stopPropagation();
|
|
@@ -694,168 +694,168 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
694
694
|
}
|
|
695
695
|
if (l.pointerType === "mouse" && l.button !== 0 || l.ctrlKey)
|
|
696
696
|
return;
|
|
697
|
-
const x = l.currentTarget,
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
697
|
+
const x = l.currentTarget, R = x.getBoundingClientRect(), D = vt(l), $ = d(x), ye = (D - (c ? R.left : R.top)) / $;
|
|
698
|
+
ve();
|
|
699
|
+
const Re = ye - F / 2, Ee = Qe(Re);
|
|
700
|
+
if (ne(Ee), x.setPointerCapture)
|
|
701
701
|
try {
|
|
702
702
|
x.setPointerCapture(l.pointerId);
|
|
703
703
|
} catch {
|
|
704
704
|
}
|
|
705
705
|
M.current = {
|
|
706
706
|
pointerId: l.pointerId,
|
|
707
|
-
startThumbPosition:
|
|
707
|
+
startThumbPosition: Re,
|
|
708
708
|
startClientX: l.clientX,
|
|
709
709
|
startClientY: l.clientY,
|
|
710
|
-
scale:
|
|
710
|
+
scale: $
|
|
711
711
|
}, l.preventDefault(), l.stopPropagation();
|
|
712
|
-
},
|
|
712
|
+
}, wt = () => {
|
|
713
713
|
M.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
|
|
714
|
-
},
|
|
714
|
+
}, Nt = (l) => {
|
|
715
715
|
const x = M.current;
|
|
716
716
|
if (x.pointerId !== l.pointerId)
|
|
717
717
|
return;
|
|
718
718
|
if (l.pointerType === "mouse" && l.buttons === 0) {
|
|
719
|
-
|
|
719
|
+
wt();
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
},
|
|
722
|
+
const R = l.clientX - x.startClientX, D = l.clientY - x.startClientY, $ = it(R, D) / (x.scale || 1), ye = Qe(x.startThumbPosition + $);
|
|
723
|
+
ne(ye), l.cancelable && l.preventDefault();
|
|
724
|
+
}, At = (l) => {
|
|
725
725
|
if (M.current.pointerId !== l.pointerId)
|
|
726
726
|
return;
|
|
727
727
|
const x = l.currentTarget;
|
|
728
|
-
x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId),
|
|
729
|
-
},
|
|
728
|
+
x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId), wt(), l.preventDefault(), l.stopPropagation();
|
|
729
|
+
}, we = (l) => {
|
|
730
730
|
if (M.current.pointerId !== l.pointerId)
|
|
731
731
|
return;
|
|
732
732
|
const x = l.currentTarget;
|
|
733
|
-
x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId),
|
|
734
|
-
},
|
|
735
|
-
l.target === l.currentTarget && M.current.pointerId === l.pointerId &&
|
|
736
|
-
},
|
|
737
|
-
const x = `calc(50% - ${
|
|
733
|
+
x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId), wt();
|
|
734
|
+
}, bt = (l) => {
|
|
735
|
+
l.target === l.currentTarget && M.current.pointerId === l.pointerId && wt();
|
|
736
|
+
}, Lt = Fe(() => le((ce ? 1 : 0.8) * Ae, 0, 1), [ce, Ae]), Ot = Fe(() => {
|
|
737
|
+
const x = `calc(50% - ${Xe / 2}px + ${Ce}px)`;
|
|
738
738
|
return {
|
|
739
|
-
left:
|
|
739
|
+
left: $e,
|
|
740
740
|
top: x
|
|
741
741
|
};
|
|
742
|
-
}, [
|
|
742
|
+
}, [$e, Ce, Xe]), Ue = (l, x, R, D) => /* @__PURE__ */ de(
|
|
743
743
|
"button",
|
|
744
744
|
{
|
|
745
745
|
type: "button",
|
|
746
746
|
tabIndex: 0,
|
|
747
747
|
className: "aqvs-scrollbar-arrow-button",
|
|
748
748
|
style: {
|
|
749
|
-
[
|
|
750
|
-
[
|
|
749
|
+
[et]: f,
|
|
750
|
+
[mt]: f
|
|
751
751
|
},
|
|
752
752
|
"aria-label": x,
|
|
753
|
-
onPointerDown:
|
|
754
|
-
onPointerUp:
|
|
755
|
-
onPointerLeave:
|
|
756
|
-
onPointerCancel:
|
|
757
|
-
onKeyDown:
|
|
753
|
+
onPointerDown: ut(l),
|
|
754
|
+
onPointerUp: at,
|
|
755
|
+
onPointerLeave: at,
|
|
756
|
+
onPointerCancel: at,
|
|
757
|
+
onKeyDown: gt(l),
|
|
758
758
|
"aria-disabled": !a,
|
|
759
|
-
disabled: !
|
|
760
|
-
children: /* @__PURE__ */
|
|
759
|
+
disabled: !re,
|
|
760
|
+
children: /* @__PURE__ */ de("span", { "aria-hidden": "true", children: R })
|
|
761
761
|
},
|
|
762
762
|
D
|
|
763
|
-
),
|
|
764
|
-
orientation:
|
|
763
|
+
), Vt = h && j ? {
|
|
764
|
+
orientation: ht,
|
|
765
765
|
scrollPosition: t,
|
|
766
|
-
maxScrollPosition:
|
|
766
|
+
maxScrollPosition: B,
|
|
767
767
|
contentSize: r,
|
|
768
768
|
viewportSize: e,
|
|
769
|
-
thumbSize:
|
|
770
|
-
thumbPosition:
|
|
771
|
-
thumbCenter:
|
|
772
|
-
trackSize:
|
|
773
|
-
isDragging:
|
|
774
|
-
isTapScrollActive:
|
|
775
|
-
visibleStartIndex:
|
|
776
|
-
visibleEndIndex:
|
|
769
|
+
thumbSize: F,
|
|
770
|
+
thumbPosition: te,
|
|
771
|
+
thumbCenter: Me,
|
|
772
|
+
trackSize: ie,
|
|
773
|
+
isDragging: H,
|
|
774
|
+
isTapScrollActive: ce,
|
|
775
|
+
visibleStartIndex: C,
|
|
776
|
+
visibleEndIndex: G
|
|
777
777
|
} : null;
|
|
778
|
-
return /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ Mt(
|
|
779
779
|
"div",
|
|
780
780
|
{
|
|
781
|
-
className:
|
|
781
|
+
className: Et("aqvs-scrollbar", Ze, b),
|
|
782
782
|
style: {
|
|
783
|
-
[
|
|
784
|
-
[
|
|
783
|
+
[et]: e,
|
|
784
|
+
[mt]: f
|
|
785
785
|
},
|
|
786
|
-
"data-visible":
|
|
786
|
+
"data-visible": j ? "true" : "false",
|
|
787
787
|
role: "scrollbar",
|
|
788
788
|
tabIndex: -1,
|
|
789
|
-
"aria-controls":
|
|
789
|
+
"aria-controls": S,
|
|
790
790
|
"aria-valuenow": t,
|
|
791
791
|
"aria-valuemin": 0,
|
|
792
|
-
"aria-valuemax":
|
|
792
|
+
"aria-valuemax": B,
|
|
793
793
|
"aria-orientation": c ? "horizontal" : "vertical",
|
|
794
794
|
children: [
|
|
795
|
-
!c &&
|
|
796
|
-
|
|
795
|
+
!c && j && X && /* @__PURE__ */ de(
|
|
796
|
+
fr,
|
|
797
797
|
{
|
|
798
|
-
ref:
|
|
799
|
-
className:
|
|
800
|
-
size:
|
|
801
|
-
maxVisualDistance:
|
|
802
|
-
style:
|
|
803
|
-
opacity:
|
|
804
|
-
renderVisual:
|
|
805
|
-
onDragChange:
|
|
798
|
+
ref: Ie,
|
|
799
|
+
className: Et("aqvs-scrollbar-tap-circle-wrapper", ze),
|
|
800
|
+
size: Xe,
|
|
801
|
+
maxVisualDistance: Le,
|
|
802
|
+
style: Ot,
|
|
803
|
+
opacity: Lt,
|
|
804
|
+
renderVisual: ue,
|
|
805
|
+
onDragChange: ft
|
|
806
806
|
},
|
|
807
807
|
"tap-circle"
|
|
808
808
|
),
|
|
809
|
-
|
|
810
|
-
/* @__PURE__ */
|
|
809
|
+
Ue(-1, E[0], J[0], "arrow-start"),
|
|
810
|
+
/* @__PURE__ */ Mt(
|
|
811
811
|
"div",
|
|
812
812
|
{
|
|
813
813
|
className: "aqvs-scrollbar-track",
|
|
814
814
|
style: {
|
|
815
|
-
borderRadius:
|
|
815
|
+
borderRadius: f / 2
|
|
816
816
|
},
|
|
817
|
-
onPointerDown:
|
|
818
|
-
onPointerMove:
|
|
819
|
-
onPointerUp:
|
|
820
|
-
onPointerCancel:
|
|
821
|
-
onLostPointerCapture:
|
|
817
|
+
onPointerDown: yt,
|
|
818
|
+
onPointerMove: Nt,
|
|
819
|
+
onPointerUp: At,
|
|
820
|
+
onPointerCancel: we,
|
|
821
|
+
onLostPointerCapture: bt,
|
|
822
822
|
"aria-disabled": !s,
|
|
823
823
|
children: [
|
|
824
|
-
|
|
825
|
-
/* @__PURE__ */
|
|
824
|
+
Vt && /* @__PURE__ */ de("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: h?.(Vt) }, "overlay"),
|
|
825
|
+
/* @__PURE__ */ de(
|
|
826
826
|
"div",
|
|
827
827
|
{
|
|
828
828
|
className: "aqvs-scrollbar-thumb-wrapper",
|
|
829
829
|
style: {
|
|
830
|
-
[
|
|
831
|
-
[
|
|
830
|
+
[et]: F,
|
|
831
|
+
[N]: te,
|
|
832
832
|
...c ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
|
|
833
833
|
},
|
|
834
|
-
"data-visible":
|
|
835
|
-
onPointerDown:
|
|
834
|
+
"data-visible": j || H ? "true" : "false",
|
|
835
|
+
onPointerDown: pt,
|
|
836
836
|
role: "slider",
|
|
837
837
|
"aria-orientation": c ? "horizontal" : "vertical",
|
|
838
838
|
"aria-valuenow": t,
|
|
839
839
|
"aria-valuemin": 0,
|
|
840
|
-
"aria-valuemax":
|
|
840
|
+
"aria-valuemax": B,
|
|
841
841
|
"aria-disabled": !i,
|
|
842
842
|
tabIndex: -1,
|
|
843
|
-
children: /* @__PURE__ */
|
|
843
|
+
children: /* @__PURE__ */ de(
|
|
844
844
|
"div",
|
|
845
845
|
{
|
|
846
846
|
ref: P,
|
|
847
|
-
className:
|
|
847
|
+
className: Et("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
|
|
848
848
|
"data-testid": "aqvs-scrollbar-thumb",
|
|
849
|
-
"data-thumb-state":
|
|
849
|
+
"data-thumb-state": De,
|
|
850
850
|
style: {
|
|
851
|
-
borderRadius:
|
|
851
|
+
borderRadius: f - 1,
|
|
852
852
|
cursor: i ? "pointer" : "default"
|
|
853
853
|
},
|
|
854
854
|
onMouseEnter: () => {
|
|
855
|
-
i &&
|
|
855
|
+
i && oe(!0);
|
|
856
856
|
},
|
|
857
857
|
onMouseLeave: () => {
|
|
858
|
-
i &&
|
|
858
|
+
i && oe(!1);
|
|
859
859
|
}
|
|
860
860
|
},
|
|
861
861
|
"thumb"
|
|
@@ -867,11 +867,11 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
867
867
|
},
|
|
868
868
|
"track"
|
|
869
869
|
),
|
|
870
|
-
|
|
870
|
+
Ue(1, E[1], J[1], "arrow-end")
|
|
871
871
|
]
|
|
872
872
|
}
|
|
873
873
|
);
|
|
874
|
-
},
|
|
874
|
+
}, Fr = 16, sr = (r, e, t) => e === 1 ? r * Fr : e === 2 ? r * t : r, Yr = (r, e) => {
|
|
875
875
|
const t = r.shiftKey && r.deltaX === 0, n = t ? r.deltaY : r.deltaX, i = t ? 0 : r.deltaY, s = n !== 0 && Math.abs(n) >= Math.abs(i);
|
|
876
876
|
return {
|
|
877
877
|
// ❗ ズームでもデルタは潰さない。ここは**事実だけ**を報告し、「横取りしない」という
|
|
@@ -880,21 +880,21 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
880
880
|
// どのテストも検出できなくなる (変異解析で実証済み)。
|
|
881
881
|
isZoomGesture: r.ctrlKey,
|
|
882
882
|
isHorizontalDominant: s,
|
|
883
|
-
horizontalDelta:
|
|
884
|
-
verticalDelta:
|
|
883
|
+
horizontalDelta: sr(n, r.deltaMode, e),
|
|
884
|
+
verticalDelta: sr(i, r.deltaMode, e)
|
|
885
885
|
};
|
|
886
|
-
},
|
|
887
|
-
|
|
888
|
-
},
|
|
886
|
+
}, mr = /* @__PURE__ */ new WeakSet(), or = (r) => {
|
|
887
|
+
mr.add(r);
|
|
888
|
+
}, Br = (r) => mr.has(r), Hr = ["mouse", "pen", "touch"], Ut = (r, e) => !(r === "mouse" || r === "pen" || r === "touch") || e.includes(r), qr = (r) => r === "mouse" || r === "pen", zt = {
|
|
889
889
|
maxVelocity: 6,
|
|
890
890
|
minVelocity: 0.02,
|
|
891
891
|
deceleration: 25e-4,
|
|
892
892
|
velocitySampleWindow: 90,
|
|
893
893
|
startVelocityThreshold: 0.04
|
|
894
|
-
},
|
|
894
|
+
}, kt = (r, e, t) => {
|
|
895
895
|
for (const [n, i, s] of e)
|
|
896
896
|
t === "add" ? r.addEventListener(n, i, s) : r.removeEventListener(n, i, s);
|
|
897
|
-
},
|
|
897
|
+
}, Xr = Zt(
|
|
898
898
|
({
|
|
899
899
|
children: r,
|
|
900
900
|
contentSize: e,
|
|
@@ -904,233 +904,238 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
904
904
|
enableThumbDrag: s = !0,
|
|
905
905
|
enableTrackClick: a = !0,
|
|
906
906
|
enableArrowButtons: c = !0,
|
|
907
|
-
enablePointerDrag:
|
|
908
|
-
pointerDragInputs: b =
|
|
909
|
-
onScroll:
|
|
907
|
+
enablePointerDrag: f = !0,
|
|
908
|
+
pointerDragInputs: b = Hr,
|
|
909
|
+
onScroll: S,
|
|
910
910
|
className: w,
|
|
911
|
-
testId:
|
|
911
|
+
testId: V,
|
|
912
912
|
style: h,
|
|
913
|
-
background:
|
|
914
|
-
tapScrollCircleOptions:
|
|
915
|
-
inertiaOptions:
|
|
916
|
-
itemCount:
|
|
917
|
-
renderThumbOverlay:
|
|
918
|
-
wheelSpeedMultiplier:
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
913
|
+
background: C,
|
|
914
|
+
tapScrollCircleOptions: G,
|
|
915
|
+
inertiaOptions: H,
|
|
916
|
+
itemCount: pe,
|
|
917
|
+
renderThumbOverlay: me,
|
|
918
|
+
wheelSpeedMultiplier: oe = 1,
|
|
919
|
+
overscrollBehavior: ce = "auto",
|
|
920
|
+
onWheelHorizontal: he,
|
|
921
|
+
contentInsets: P,
|
|
922
|
+
visibleStartIndex: _,
|
|
923
|
+
visibleEndIndex: M,
|
|
924
|
+
renderOverlay: Z,
|
|
925
|
+
initialScrollPosition: Q = 0,
|
|
926
|
+
contentProps: W
|
|
927
|
+
}, Ie) => {
|
|
928
|
+
const z = g(Number.isFinite(Q) ? Math.max(0, Q) : 0), v = g(null), U = g(null), ge = t === void 0, [qe, ee] = rt(0), X = t ?? qe, Xe = g(null);
|
|
929
|
+
nt(() => {
|
|
930
|
+
if (!ge)
|
|
930
931
|
return;
|
|
931
|
-
const
|
|
932
|
-
if (!
|
|
932
|
+
const p = U.current;
|
|
933
|
+
if (!p)
|
|
933
934
|
return;
|
|
934
|
-
const
|
|
935
|
-
const
|
|
936
|
-
if (
|
|
937
|
-
|
|
935
|
+
const F = () => {
|
|
936
|
+
const Y = p.offsetHeight;
|
|
937
|
+
if (Y > 0) {
|
|
938
|
+
ee((te) => te === Y ? te : Y);
|
|
938
939
|
return;
|
|
939
940
|
}
|
|
940
|
-
|
|
941
|
+
p.offsetParent !== null && e > 0 && Xe.current !== "zero" && (Xe.current = "zero", T.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."));
|
|
941
942
|
};
|
|
942
|
-
if (
|
|
943
|
+
if (F(), typeof ResizeObserver != "function")
|
|
943
944
|
return;
|
|
944
|
-
const
|
|
945
|
-
return
|
|
946
|
-
|
|
945
|
+
const B = new ResizeObserver(F);
|
|
946
|
+
return B.observe(p), () => {
|
|
947
|
+
B.disconnect();
|
|
947
948
|
};
|
|
948
|
-
}, [e,
|
|
949
|
-
|
|
950
|
-
}, [
|
|
951
|
-
if (
|
|
949
|
+
}, [e, ge]), nt(() => {
|
|
950
|
+
ge && n?.(qe);
|
|
951
|
+
}, [ge, qe, n]), nt(() => {
|
|
952
|
+
if (ge)
|
|
952
953
|
return;
|
|
953
|
-
const
|
|
954
|
-
if (!
|
|
954
|
+
const p = v.current;
|
|
955
|
+
if (!p)
|
|
955
956
|
return;
|
|
956
|
-
const
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
957
|
+
const F = () => {
|
|
958
|
+
const Y = p.clientHeight;
|
|
959
|
+
if (Y <= 0 || Math.abs(Y - X) <= 1)
|
|
959
960
|
return;
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
`[ScrollPane] viewportSize=${
|
|
961
|
+
const te = `${X}/${Y}`;
|
|
962
|
+
Xe.current !== te && (Xe.current = te, T.warn(
|
|
963
|
+
`[ScrollPane] viewportSize=${X} but the host band is ${Y}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.`
|
|
963
964
|
));
|
|
964
965
|
};
|
|
965
|
-
if (
|
|
966
|
+
if (F(), typeof ResizeObserver != "function")
|
|
966
967
|
return;
|
|
967
|
-
const
|
|
968
|
-
return
|
|
969
|
-
|
|
968
|
+
const B = new ResizeObserver(F);
|
|
969
|
+
return B.observe(p), () => {
|
|
970
|
+
B.disconnect();
|
|
970
971
|
};
|
|
971
|
-
}, [
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
}, [
|
|
976
|
-
const
|
|
972
|
+
}, [ge, X]);
|
|
973
|
+
const $e = g(he);
|
|
974
|
+
q(() => {
|
|
975
|
+
$e.current = he;
|
|
976
|
+
}, [he]);
|
|
977
|
+
const Ce = g({
|
|
977
978
|
frame: null,
|
|
978
979
|
velocity: 0,
|
|
979
980
|
lastTimestamp: null,
|
|
980
981
|
generation: 0
|
|
981
|
-
}),
|
|
982
|
+
}), ze = Fe(
|
|
982
983
|
() => ({
|
|
983
|
-
maxVelocity:
|
|
984
|
-
minVelocity:
|
|
985
|
-
deceleration:
|
|
986
|
-
velocitySampleWindow:
|
|
987
|
-
startVelocityThreshold:
|
|
984
|
+
maxVelocity: H?.maxVelocity ?? zt.maxVelocity,
|
|
985
|
+
minVelocity: H?.minVelocity ?? zt.minVelocity,
|
|
986
|
+
deceleration: H?.deceleration ?? zt.deceleration,
|
|
987
|
+
velocitySampleWindow: H?.velocitySampleWindow ?? zt.velocitySampleWindow,
|
|
988
|
+
startVelocityThreshold: H?.startVelocityThreshold ?? zt.startVelocityThreshold
|
|
988
989
|
}),
|
|
989
|
-
[
|
|
990
|
-
),
|
|
991
|
-
top: Math.max(0,
|
|
992
|
-
bottom: Math.max(0,
|
|
993
|
-
}), [
|
|
990
|
+
[H]
|
|
991
|
+
), je = Fe(() => ({
|
|
992
|
+
top: Math.max(0, P?.top ?? 0),
|
|
993
|
+
bottom: Math.max(0, P?.bottom ?? 0)
|
|
994
|
+
}), [P]);
|
|
994
995
|
T.debug("[ScrollPane] ScrollPane rendered", () => ({
|
|
995
996
|
contentSize: e,
|
|
996
|
-
viewportSize:
|
|
997
|
+
viewportSize: X,
|
|
997
998
|
scrollBarWidth: i,
|
|
998
999
|
className: w,
|
|
999
1000
|
style: h,
|
|
1000
|
-
tapScrollCircleOptions:
|
|
1001
|
-
inertiaOptions:
|
|
1002
|
-
enablePointerDrag:
|
|
1003
|
-
contentInsets:
|
|
1001
|
+
tapScrollCircleOptions: G,
|
|
1002
|
+
inertiaOptions: H,
|
|
1003
|
+
enablePointerDrag: f,
|
|
1004
|
+
contentInsets: je
|
|
1004
1005
|
}));
|
|
1005
|
-
const
|
|
1006
|
-
(
|
|
1007
|
-
let
|
|
1008
|
-
|
|
1009
|
-
const { contentSize:
|
|
1010
|
-
if (T.debug("[ScrollPane] scrollTo called", () => ({ newPosition:
|
|
1011
|
-
return
|
|
1012
|
-
const
|
|
1013
|
-
if (!Number.isFinite(
|
|
1014
|
-
return T.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition:
|
|
1015
|
-
const
|
|
1016
|
-
return
|
|
1006
|
+
const Ge = g({ contentSize: e, viewportSize: X }), K = Fe(() => e > X, [e, X]), Ae = I(
|
|
1007
|
+
(p, F) => {
|
|
1008
|
+
let B = F ?? Ge.current;
|
|
1009
|
+
F && !(Number.isFinite(F.contentSize) && Number.isFinite(F.viewportSize)) && (T.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: F }), B = Ge.current);
|
|
1010
|
+
const { contentSize: Y, viewportSize: te } = B, Me = Y > te, j = z.current;
|
|
1011
|
+
if (T.debug("[ScrollPane] scrollTo called", () => ({ newPosition: p, contentSize: Y, viewportSize: te, currentIsScrollable: Me, prevPosition: j })), !Me)
|
|
1012
|
+
return z.current !== 0 && (z.current = 0, S?.(0, j)), z.current;
|
|
1013
|
+
const re = typeof p == "function" ? p(z.current) : p;
|
|
1014
|
+
if (!Number.isFinite(re))
|
|
1015
|
+
return T.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: re }), z.current;
|
|
1016
|
+
const De = Math.max(Y - te, 0), ne = le(re, 0, De);
|
|
1017
|
+
return z.current !== ne && (z.current = ne, S?.(ne, j)), z.current;
|
|
1017
1018
|
},
|
|
1018
|
-
[
|
|
1019
|
-
),
|
|
1020
|
-
|
|
1021
|
-
|
|
1019
|
+
[S]
|
|
1020
|
+
), ue = g(Ae);
|
|
1021
|
+
q(() => {
|
|
1022
|
+
ue.current = Ae;
|
|
1022
1023
|
}, [Ae]);
|
|
1023
|
-
const
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
}, []),
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
}, [
|
|
1030
|
-
|
|
1024
|
+
const be = I(() => {
|
|
1025
|
+
const p = Ce.current;
|
|
1026
|
+
p.generation += 1, p.frame !== null && cancelAnimationFrame(p.frame), p.frame = null, p.velocity = 0, p.lastTimestamp = null;
|
|
1027
|
+
}, []), Te = g(be);
|
|
1028
|
+
q(() => {
|
|
1029
|
+
Te.current = be;
|
|
1030
|
+
}, [be]), q(() => () => {
|
|
1031
|
+
Te.current();
|
|
1031
1032
|
}, []);
|
|
1032
|
-
const
|
|
1033
|
-
(
|
|
1034
|
-
if (!
|
|
1033
|
+
const et = I(
|
|
1034
|
+
(p) => {
|
|
1035
|
+
if (!K)
|
|
1035
1036
|
return;
|
|
1036
|
-
const { maxVelocity:
|
|
1037
|
-
if (Math.abs(
|
|
1037
|
+
const { maxVelocity: F, minVelocity: B, deceleration: Y, startVelocityThreshold: te } = ze, Me = le(p, -F, F);
|
|
1038
|
+
if (Math.abs(Me) < te)
|
|
1038
1039
|
return;
|
|
1039
|
-
|
|
1040
|
-
const
|
|
1041
|
-
const
|
|
1042
|
-
if (
|
|
1040
|
+
be(), Ce.current.velocity = Me, Ce.current.lastTimestamp = null;
|
|
1041
|
+
const j = Ce.current.generation, re = (De) => {
|
|
1042
|
+
const ne = Ce.current;
|
|
1043
|
+
if (ne.generation !== j)
|
|
1043
1044
|
return;
|
|
1044
|
-
if (
|
|
1045
|
-
|
|
1045
|
+
if (ne.lastTimestamp === null) {
|
|
1046
|
+
ne.lastTimestamp = De, ne.frame = requestAnimationFrame(re);
|
|
1046
1047
|
return;
|
|
1047
1048
|
}
|
|
1048
|
-
const
|
|
1049
|
-
if (
|
|
1050
|
-
|
|
1049
|
+
const Je = De - ne.lastTimestamp;
|
|
1050
|
+
if (ne.lastTimestamp = De, Je <= 0) {
|
|
1051
|
+
ne.frame = requestAnimationFrame(re);
|
|
1051
1052
|
return;
|
|
1052
1053
|
}
|
|
1053
|
-
const
|
|
1054
|
-
let
|
|
1055
|
-
const
|
|
1056
|
-
|
|
1057
|
-
const
|
|
1058
|
-
if (
|
|
1054
|
+
const Oe = ne.velocity;
|
|
1055
|
+
let ae = Oe;
|
|
1056
|
+
const ve = Y * Je;
|
|
1057
|
+
Oe > 0 ? ae = Math.max(0, Oe - ve) : Oe < 0 && (ae = Math.min(0, Oe + ve));
|
|
1058
|
+
const Ve = (Oe + ae) / 2 * Je, ft = z.current;
|
|
1059
|
+
if (Ve !== 0 && ue.current((tt) => tt + Ve), Ce.current.generation !== j)
|
|
1059
1060
|
return;
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1063
|
-
if (Math.abs(
|
|
1064
|
-
|
|
1061
|
+
const Qe = z.current, { contentSize: ot, viewportSize: d } = Ge.current, y = Math.max(ot - d, 0);
|
|
1062
|
+
ne.velocity = ae;
|
|
1063
|
+
const xe = Qe === ft || Qe <= 0 && ae <= 0 || Qe >= y && ae >= 0;
|
|
1064
|
+
if (Math.abs(ae) < B || xe) {
|
|
1065
|
+
be();
|
|
1065
1066
|
return;
|
|
1066
1067
|
}
|
|
1067
|
-
|
|
1068
|
+
ne.frame = requestAnimationFrame(re);
|
|
1068
1069
|
};
|
|
1069
|
-
|
|
1070
|
+
Ce.current.frame = requestAnimationFrame(re);
|
|
1070
1071
|
},
|
|
1071
|
-
[
|
|
1072
|
-
),
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
}, [
|
|
1076
|
-
|
|
1077
|
-
}, [e,
|
|
1078
|
-
const
|
|
1079
|
-
if (!
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1072
|
+
[K, ze, be]
|
|
1073
|
+
), mt = g(et);
|
|
1074
|
+
q(() => {
|
|
1075
|
+
mt.current = et;
|
|
1076
|
+
}, [et]), nt(() => {
|
|
1077
|
+
Ge.current = { contentSize: e, viewportSize: X };
|
|
1078
|
+
}, [e, X]), nt(() => {
|
|
1079
|
+
const p = U.current;
|
|
1080
|
+
if (!p) return;
|
|
1081
|
+
const F = () => {
|
|
1082
|
+
p.scrollTop !== 0 && (T.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: p.scrollTop })), p.scrollTop = 0), p.scrollLeft !== 0 && (p.scrollLeft = 0);
|
|
1082
1083
|
};
|
|
1083
|
-
return
|
|
1084
|
-
}, []),
|
|
1085
|
-
if (
|
|
1086
|
-
T.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize:
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1084
|
+
return p.addEventListener("scroll", F), () => p.removeEventListener("scroll", F);
|
|
1085
|
+
}, []), nt(() => {
|
|
1086
|
+
if (K) {
|
|
1087
|
+
T.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: X, scrollPosition: z.current }));
|
|
1088
|
+
const p = le(e - X, 0, e);
|
|
1089
|
+
z.current > p && Ae(p);
|
|
1089
1090
|
} else
|
|
1090
1091
|
Ae(0);
|
|
1091
|
-
}, [
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
}, [
|
|
1096
|
-
const
|
|
1097
|
-
(
|
|
1098
|
-
if (
|
|
1092
|
+
}, [K, Ae, e, X]);
|
|
1093
|
+
const N = g({ isScrollable: K, viewportSize: X, wheelSpeedMultiplier: oe, overscrollBehavior: ce });
|
|
1094
|
+
nt(() => {
|
|
1095
|
+
N.current = { isScrollable: K, viewportSize: X, wheelSpeedMultiplier: oe, overscrollBehavior: ce };
|
|
1096
|
+
}, [K, X, oe, ce]);
|
|
1097
|
+
const it = I(
|
|
1098
|
+
(p) => {
|
|
1099
|
+
if (Br(p))
|
|
1099
1100
|
return !1;
|
|
1100
|
-
const { isScrollable:
|
|
1101
|
-
if (
|
|
1101
|
+
const { isScrollable: F, viewportSize: B, wheelSpeedMultiplier: Y, overscrollBehavior: te } = N.current, Me = Yr(p, B);
|
|
1102
|
+
if (Me.isZoomGesture)
|
|
1102
1103
|
return !1;
|
|
1103
|
-
if (
|
|
1104
|
-
return
|
|
1105
|
-
if (!
|
|
1104
|
+
if (Me.isHorizontalDominant)
|
|
1105
|
+
return $e.current ? (or(p), p.preventDefault(), be(), $e.current(Me.horizontalDelta), !0) : !1;
|
|
1106
|
+
if (!F || Me.verticalDelta === 0)
|
|
1106
1107
|
return !1;
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1108
|
+
let j = Me.verticalDelta;
|
|
1109
|
+
if (Y !== 1 && (j *= Y), te !== "contain") {
|
|
1110
|
+
const re = z.current, De = Math.max(Ge.current.contentSize - B, 0);
|
|
1111
|
+
if (j > 0 && re >= De || j < 0 && re <= 0)
|
|
1112
|
+
return !1;
|
|
1113
|
+
}
|
|
1114
|
+
return or(p), p.preventDefault(), be(), T.debug("[ScrollPane] wheel event", () => ({ deltaY: j, scrollPosition: z.current, wheelSpeedMultiplier: Y, deltaMode: p.deltaMode, scrollTop: U.current?.scrollTop })), Ae((re) => re + j), !0;
|
|
1110
1115
|
},
|
|
1111
|
-
[Ae,
|
|
1116
|
+
[Ae, be]
|
|
1112
1117
|
);
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
},
|
|
1117
|
-
|
|
1118
|
-
},
|
|
1119
|
-
return
|
|
1120
|
-
|
|
1118
|
+
q(() => {
|
|
1119
|
+
const p = (Y) => {
|
|
1120
|
+
it(Y);
|
|
1121
|
+
}, F = () => {
|
|
1122
|
+
be();
|
|
1123
|
+
}, B = v.current;
|
|
1124
|
+
return B && (B.addEventListener("wheel", p, { passive: !1 }), B.addEventListener("pointerdown", F, { capture: !0, passive: !0 })), () => {
|
|
1125
|
+
B && (B.removeEventListener("wheel", p), B.removeEventListener("pointerdown", F, { capture: !0 }));
|
|
1121
1126
|
};
|
|
1122
|
-
}, [
|
|
1123
|
-
|
|
1127
|
+
}, [it, be]), Jt(
|
|
1128
|
+
Ie,
|
|
1124
1129
|
() => ({
|
|
1125
|
-
scrollTo: (
|
|
1126
|
-
getScrollPosition: () =>
|
|
1130
|
+
scrollTo: (p, F) => (be(), Ae(p, F)),
|
|
1131
|
+
getScrollPosition: () => z.current,
|
|
1127
1132
|
getContentSize: () => e,
|
|
1128
|
-
getViewportSize: () =>
|
|
1129
|
-
applyWheel:
|
|
1133
|
+
getViewportSize: () => X,
|
|
1134
|
+
applyWheel: it
|
|
1130
1135
|
}),
|
|
1131
|
-
[Ae, e,
|
|
1136
|
+
[Ae, e, X, be, it]
|
|
1132
1137
|
);
|
|
1133
|
-
const
|
|
1138
|
+
const vt = Ir(), E = W?.id ?? vt, J = g({
|
|
1134
1139
|
pointerType: "",
|
|
1135
1140
|
pointerId: null,
|
|
1136
1141
|
startClientY: 0,
|
|
@@ -1139,151 +1144,151 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
1139
1144
|
shouldCancelNextClick: !1,
|
|
1140
1145
|
clickResetTimer: null,
|
|
1141
1146
|
velocitySamples: []
|
|
1142
|
-
}),
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
}, [
|
|
1146
|
-
|
|
1147
|
+
}), Ze = g(f), ht = g(b);
|
|
1148
|
+
q(() => {
|
|
1149
|
+
Ze.current = f;
|
|
1150
|
+
}, [f]), q(() => {
|
|
1151
|
+
ht.current = b;
|
|
1147
1152
|
}, [b]);
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
}, [
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
}, [
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1153
|
+
const Le = g(K);
|
|
1154
|
+
q(() => {
|
|
1155
|
+
Le.current = K;
|
|
1156
|
+
}, [K]);
|
|
1157
|
+
const st = g(ze);
|
|
1158
|
+
q(() => {
|
|
1159
|
+
st.current = ze;
|
|
1160
|
+
}, [ze]), q(() => {
|
|
1161
|
+
const p = J.current;
|
|
1162
|
+
if (f && K && (p.pointerId === null || Ut(p.pointerType, b)) || p.pointerId === null)
|
|
1158
1163
|
return;
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
}, [
|
|
1164
|
-
const
|
|
1165
|
-
if (!
|
|
1164
|
+
const F = U.current;
|
|
1165
|
+
p.clickResetTimer !== null && (window.clearTimeout(p.clickResetTimer), p.clickResetTimer = null);
|
|
1166
|
+
const B = p.isDragging && p.shouldCancelNextClick, Y = p.pointerId;
|
|
1167
|
+
p.pointerId = null, p.pointerType = "", p.startClientY = 0, p.startScroll = 0, p.isDragging = !1, p.shouldCancelNextClick = B, p.velocitySamples = [], F?.hasPointerCapture(Y) && F.releasePointerCapture(Y);
|
|
1168
|
+
}, [f, b, K]), q(() => {
|
|
1169
|
+
const p = U.current;
|
|
1170
|
+
if (!p)
|
|
1166
1171
|
return;
|
|
1167
|
-
const
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1170
|
-
},
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1173
|
-
},
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
},
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1181
|
-
},
|
|
1182
|
-
const
|
|
1183
|
-
if (!
|
|
1184
|
-
if (
|
|
1172
|
+
const F = 6, B = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), Y = () => {
|
|
1173
|
+
const d = J.current;
|
|
1174
|
+
d.pointerId = null, d.pointerType = "", d.startClientY = 0, d.startScroll = 0, d.isDragging = !1, d.velocitySamples = [];
|
|
1175
|
+
}, te = () => {
|
|
1176
|
+
const d = J.current;
|
|
1177
|
+
d.clickResetTimer !== null && (window.clearTimeout(d.clickResetTimer), d.clickResetTimer = null);
|
|
1178
|
+
}, Me = (d) => {
|
|
1179
|
+
const y = J.current, xe = B();
|
|
1180
|
+
y.velocitySamples.push({ clientY: d, time: xe });
|
|
1181
|
+
const tt = st.current.velocitySampleWindow;
|
|
1182
|
+
y.velocitySamples = y.velocitySamples.filter((_e) => xe - _e.time <= tt);
|
|
1183
|
+
}, j = (d) => d instanceof HTMLElement && d.closest("[data-scrollpane-ignore-drag='true']") !== null, re = (d) => {
|
|
1184
|
+
const y = J.current;
|
|
1185
|
+
y.shouldCancelNextClick && (d.preventDefault(), d.stopPropagation(), y.shouldCancelNextClick = !1);
|
|
1186
|
+
}, De = (d) => {
|
|
1187
|
+
const y = J.current;
|
|
1188
|
+
if (!y.isDragging) {
|
|
1189
|
+
if (y.isDragging = !0, y.shouldCancelNextClick = !0, !p.hasPointerCapture(d.pointerId))
|
|
1185
1190
|
try {
|
|
1186
|
-
|
|
1191
|
+
p.setPointerCapture(d.pointerId);
|
|
1187
1192
|
} catch {
|
|
1188
1193
|
}
|
|
1189
|
-
|
|
1194
|
+
Me(d.clientY);
|
|
1190
1195
|
}
|
|
1191
|
-
},
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
},
|
|
1195
|
-
const
|
|
1196
|
-
if (
|
|
1196
|
+
}, ne = (d) => d.isTrusted || d.target === p, Je = (d) => {
|
|
1197
|
+
const y = J.current;
|
|
1198
|
+
p.hasPointerCapture(d) && p.releasePointerCapture(d), y.shouldCancelNextClick = !1, te(), Y();
|
|
1199
|
+
}, Oe = (d) => {
|
|
1200
|
+
const y = J.current;
|
|
1201
|
+
if (y.pointerId !== d.pointerId)
|
|
1197
1202
|
return;
|
|
1198
|
-
if (
|
|
1199
|
-
|
|
1203
|
+
if (d.buttons === 0 && qr(d.pointerType)) {
|
|
1204
|
+
Je(d.pointerId);
|
|
1200
1205
|
return;
|
|
1201
1206
|
}
|
|
1202
|
-
if (!(
|
|
1207
|
+
if (!(Ze.current && Le.current) || !Ut(d.pointerType, ht.current) || !y.isDragging && (Math.abs(d.clientY - y.startClientY) < F || (De(d), !y.isDragging)))
|
|
1203
1208
|
return;
|
|
1204
|
-
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1207
|
-
},
|
|
1208
|
-
const
|
|
1209
|
-
return
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1209
|
+
Me(d.clientY);
|
|
1210
|
+
const xe = d.clientY - y.startClientY, tt = y.startScroll - xe;
|
|
1211
|
+
ue.current(tt), d.cancelable && d.preventDefault();
|
|
1212
|
+
}, ae = () => {
|
|
1213
|
+
const d = J.current;
|
|
1214
|
+
return d.pointerId !== null || !d.shouldCancelNextClick ? !1 : (te(), d.clickResetTimer = window.setTimeout(() => {
|
|
1215
|
+
const y = J.current;
|
|
1216
|
+
y.shouldCancelNextClick = !1, y.clickResetTimer = null;
|
|
1212
1217
|
}, 0), !0);
|
|
1213
|
-
},
|
|
1214
|
-
const
|
|
1215
|
-
if (
|
|
1216
|
-
|
|
1218
|
+
}, ve = (d) => {
|
|
1219
|
+
const y = J.current;
|
|
1220
|
+
if (y.pointerId !== d.pointerId) {
|
|
1221
|
+
ae();
|
|
1217
1222
|
return;
|
|
1218
1223
|
}
|
|
1219
|
-
|
|
1220
|
-
let
|
|
1221
|
-
if (
|
|
1222
|
-
const
|
|
1223
|
-
if (
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1224
|
+
y.isDragging && y.shouldCancelNextClick && d.cancelable && (d.preventDefault(), d.stopPropagation()), y.isDragging && Me(d.clientY);
|
|
1225
|
+
let xe = 0;
|
|
1226
|
+
if (y.isDragging && y.velocitySamples.length >= 2) {
|
|
1227
|
+
const _e = y.velocitySamples, ct = st.current.velocitySampleWindow, ut = _e[_e.length - 1], at = _e.find((gt) => ut.time - gt.time <= ct) ?? _e[0];
|
|
1228
|
+
if (ut && at && ut.time !== at.time) {
|
|
1229
|
+
const gt = ut.clientY - at.clientY, pt = ut.time - at.time;
|
|
1230
|
+
xe = -(gt / pt);
|
|
1226
1231
|
}
|
|
1227
1232
|
}
|
|
1228
|
-
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1233
|
+
te(), y.shouldCancelNextClick && (y.clickResetTimer = window.setTimeout(() => {
|
|
1234
|
+
const _e = J.current;
|
|
1235
|
+
_e.shouldCancelNextClick = !1, _e.clickResetTimer = null;
|
|
1231
1236
|
}, 0));
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
},
|
|
1235
|
-
if (
|
|
1236
|
-
if (!
|
|
1237
|
+
const tt = st.current.startVelocityThreshold;
|
|
1238
|
+
Y(), p.hasPointerCapture(d.pointerId) && p.releasePointerCapture(d.pointerId), Math.abs(xe) >= tt && mt.current?.(xe);
|
|
1239
|
+
}, We = (d) => {
|
|
1240
|
+
if (J.current.pointerId !== null) {
|
|
1241
|
+
if (!d.isPrimary || d.pointerType !== J.current.pointerType)
|
|
1237
1242
|
return;
|
|
1238
|
-
|
|
1243
|
+
Je(J.current.pointerId);
|
|
1239
1244
|
}
|
|
1240
|
-
if (
|
|
1245
|
+
if (J.current.shouldCancelNextClick && (te(), J.current.shouldCancelNextClick = !1), !(Ze.current && Le.current) || !Ut(d.pointerType, ht.current) || d.button !== 0 && d.pointerType === "mouse" || d.ctrlKey || d.metaKey || d.altKey || j(d.target))
|
|
1241
1246
|
return;
|
|
1242
|
-
window.dispatchEvent(new CustomEvent(
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1245
|
-
},
|
|
1246
|
-
if (
|
|
1247
|
-
|
|
1247
|
+
window.dispatchEvent(new CustomEvent(Gt, { detail: { paneId: vt } })), Te.current?.();
|
|
1248
|
+
const y = J.current;
|
|
1249
|
+
te(), y.pointerId = d.pointerId, y.pointerType = d.pointerType, y.startClientY = d.clientY, y.startScroll = z.current, y.isDragging = !1, y.shouldCancelNextClick = !1, y.velocitySamples = [];
|
|
1250
|
+
}, Ve = (d) => {
|
|
1251
|
+
if (J.current.pointerId !== d.pointerId) {
|
|
1252
|
+
ae();
|
|
1248
1253
|
return;
|
|
1249
1254
|
}
|
|
1250
|
-
|
|
1251
|
-
},
|
|
1252
|
-
["click",
|
|
1253
|
-
["pointerdown",
|
|
1254
|
-
["lostpointercapture", (
|
|
1255
|
-
|
|
1255
|
+
ne(d) && Je(d.pointerId);
|
|
1256
|
+
}, Qe = [
|
|
1257
|
+
["click", re, !0],
|
|
1258
|
+
["pointerdown", We, { passive: !1 }],
|
|
1259
|
+
["lostpointercapture", (d) => {
|
|
1260
|
+
d.target !== p || J.current.pointerId !== d.pointerId || Je(d.pointerId);
|
|
1256
1261
|
}, void 0]
|
|
1257
|
-
],
|
|
1258
|
-
["pointermove",
|
|
1259
|
-
["pointerup",
|
|
1260
|
-
["pointercancel",
|
|
1262
|
+
], ot = [
|
|
1263
|
+
["pointermove", Oe, { passive: !1 }],
|
|
1264
|
+
["pointerup", ve, void 0],
|
|
1265
|
+
["pointercancel", Ve, void 0]
|
|
1261
1266
|
];
|
|
1262
|
-
return
|
|
1263
|
-
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1267
|
+
return kt(p, Qe, "add"), kt(window, ot, "add"), () => {
|
|
1268
|
+
kt(p, Qe, "remove"), kt(window, ot, "remove");
|
|
1269
|
+
const d = J.current;
|
|
1270
|
+
d.pointerId !== null && p.hasPointerCapture(d.pointerId) && p.releasePointerCapture(d.pointerId), te(), Y();
|
|
1266
1271
|
};
|
|
1267
|
-
}, [
|
|
1268
|
-
const
|
|
1269
|
-
(
|
|
1270
|
-
[Ae,
|
|
1272
|
+
}, [vt]);
|
|
1273
|
+
const ie = I(
|
|
1274
|
+
(p) => (be(), Ae(p)),
|
|
1275
|
+
[Ae, be]
|
|
1271
1276
|
);
|
|
1272
|
-
return /* @__PURE__ */
|
|
1273
|
-
/* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ Mt("div", { ref: v, "data-testid": V, "data-self-measured": ge ? "true" : void 0, className: Et("aqvs-scroll-pane", w), style: h, children: [
|
|
1278
|
+
/* @__PURE__ */ Mt(
|
|
1274
1279
|
"div",
|
|
1275
1280
|
{
|
|
1276
|
-
ref:
|
|
1277
|
-
className:
|
|
1281
|
+
ref: U,
|
|
1282
|
+
className: Et("aqvs-scroll-pane-content"),
|
|
1278
1283
|
"data-testid": "aqvs-scroll-pane-content",
|
|
1279
1284
|
style: {
|
|
1280
1285
|
// ❗ 自己計測モードでは高さを書かない。CSS の `height: 100%` (= ルートの確定高さ) が
|
|
1281
1286
|
// レイアウトを所有することで、「計測した値を書き戻して自分のサイズを変える」
|
|
1282
1287
|
// フィードバックループが構造的に起こらず、初回 paint の時点でも帯は実寸で正しい
|
|
1283
1288
|
// (数値の反映だけが 1 コミット遅れる)。明示モードは従来どおり px を書く。
|
|
1284
|
-
height:
|
|
1285
|
-
paddingTop:
|
|
1286
|
-
paddingBottom:
|
|
1289
|
+
height: ge ? void 0 : X,
|
|
1290
|
+
paddingTop: je.top,
|
|
1291
|
+
paddingBottom: je.bottom,
|
|
1287
1292
|
// スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
|
|
1288
1293
|
// 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
|
|
1289
1294
|
// 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
|
|
@@ -1297,43 +1302,43 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
1297
1302
|
// 同一条件で揃えてあるため状態としても一貫している。
|
|
1298
1303
|
// 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
|
|
1299
1304
|
// (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
|
|
1300
|
-
...
|
|
1305
|
+
...f && K && b.some((p) => p === "touch" || p === "pen") ? { touchAction: "none" } : {}
|
|
1301
1306
|
},
|
|
1302
|
-
...
|
|
1303
|
-
id:
|
|
1307
|
+
...W,
|
|
1308
|
+
id: E,
|
|
1304
1309
|
children: [
|
|
1305
|
-
|
|
1306
|
-
r(
|
|
1310
|
+
C,
|
|
1311
|
+
r(z.current)
|
|
1307
1312
|
]
|
|
1308
1313
|
}
|
|
1309
1314
|
),
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
|
|
1315
|
+
/* @__PURE__ */ de(
|
|
1316
|
+
kr,
|
|
1312
1317
|
{
|
|
1313
1318
|
contentSize: e,
|
|
1314
|
-
viewportSize:
|
|
1315
|
-
scrollPosition:
|
|
1316
|
-
onScroll:
|
|
1319
|
+
viewportSize: X,
|
|
1320
|
+
scrollPosition: z.current,
|
|
1321
|
+
onScroll: ie,
|
|
1317
1322
|
enableThumbDrag: s,
|
|
1318
1323
|
enableTrackClick: a,
|
|
1319
1324
|
enableArrowButtons: c,
|
|
1320
1325
|
scrollBarWidth: i,
|
|
1321
|
-
ariaControls:
|
|
1322
|
-
tapScrollCircleOptions:
|
|
1323
|
-
itemCount:
|
|
1324
|
-
renderThumbOverlay:
|
|
1325
|
-
visibleStartIndex:
|
|
1326
|
-
visibleEndIndex:
|
|
1326
|
+
ariaControls: E,
|
|
1327
|
+
tapScrollCircleOptions: G,
|
|
1328
|
+
itemCount: pe,
|
|
1329
|
+
renderThumbOverlay: me,
|
|
1330
|
+
visibleStartIndex: _,
|
|
1331
|
+
visibleEndIndex: M
|
|
1327
1332
|
},
|
|
1328
1333
|
"scrollbar"
|
|
1329
1334
|
),
|
|
1330
|
-
|
|
1335
|
+
Z?.()
|
|
1331
1336
|
] });
|
|
1332
1337
|
}
|
|
1333
|
-
),
|
|
1334
|
-
const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), c = r.direction * e * 26 * t,
|
|
1335
|
-
return /* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */
|
|
1338
|
+
), ar = (r, e, t) => Math.min(Math.max(r, e), t), ln = ({ dragState: r, normalizedDistance: e, sizeScale: t, size: n }) => {
|
|
1339
|
+
const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), c = r.direction * e * 26 * t, f = 0.8 + e * 0.18, b = 3 * t, S = 6 * t, w = 22 * t, V = Math.abs(c) + S, h = c > 0 ? b : -Math.abs(c) - b, C = Math.max(2.5, 3 * t), G = ar(r.offsetX, -i, i), H = ar(r.offsetY, -i, i), pe = i * 0.35, me = G / i * pe, oe = H / i * pe, ce = me * 0.45, he = oe * 0.45, P = Math.max(w * 0.38, 6), _ = 0.65 + e * 0.2, M = r.active;
|
|
1340
|
+
return /* @__PURE__ */ Mt(dr, { children: [
|
|
1341
|
+
/* @__PURE__ */ de(
|
|
1337
1342
|
"div",
|
|
1338
1343
|
{
|
|
1339
1344
|
className: "aqvs-tap-scroll-circle-gradient",
|
|
@@ -1343,39 +1348,39 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
1343
1348
|
}
|
|
1344
1349
|
}
|
|
1345
1350
|
),
|
|
1346
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ de(
|
|
1347
1352
|
"div",
|
|
1348
1353
|
{
|
|
1349
1354
|
className: "aqvs-sample-visual-pupil",
|
|
1350
1355
|
style: {
|
|
1351
1356
|
width: w,
|
|
1352
1357
|
height: w,
|
|
1353
|
-
transform: `translate(calc(-50% + ${
|
|
1358
|
+
transform: `translate(calc(-50% + ${me}px), calc(-50% + ${oe}px)) scale(${a}, ${f * s})`,
|
|
1354
1359
|
transition: M ? "70ms transform ease-out" : "200ms ease transform"
|
|
1355
1360
|
}
|
|
1356
1361
|
}
|
|
1357
1362
|
),
|
|
1358
|
-
/* @__PURE__ */
|
|
1363
|
+
/* @__PURE__ */ de(
|
|
1359
1364
|
"div",
|
|
1360
1365
|
{
|
|
1361
1366
|
className: "aqvs-sample-visual-highlight",
|
|
1362
1367
|
style: {
|
|
1363
1368
|
width: P,
|
|
1364
1369
|
height: P,
|
|
1365
|
-
transform: `translate(calc(-50% + ${
|
|
1370
|
+
transform: `translate(calc(-50% + ${ce}px), calc(-50% + ${he}px)) scale(${a}, ${s})`,
|
|
1366
1371
|
opacity: _,
|
|
1367
1372
|
boxShadow: "0 0 8px rgba(255,255,255,0.45)",
|
|
1368
1373
|
transition: M ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
|
|
1369
1374
|
}
|
|
1370
1375
|
}
|
|
1371
1376
|
),
|
|
1372
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ de(
|
|
1373
1378
|
"div",
|
|
1374
1379
|
{
|
|
1375
1380
|
className: "aqvs-sample-visual-rod",
|
|
1376
1381
|
style: {
|
|
1377
|
-
width:
|
|
1378
|
-
height:
|
|
1382
|
+
width: C,
|
|
1383
|
+
height: V,
|
|
1379
1384
|
transform: `translate(-50%, ${h}px)`,
|
|
1380
1385
|
opacity: e,
|
|
1381
1386
|
transition: M ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
|
|
@@ -1383,16 +1388,16 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
1383
1388
|
}
|
|
1384
1389
|
)
|
|
1385
1390
|
] });
|
|
1386
|
-
},
|
|
1391
|
+
}, Ft = 100, $r = (r) => {
|
|
1387
1392
|
if (!Number.isFinite(r))
|
|
1388
1393
|
return 0n;
|
|
1389
1394
|
const e = Math.trunc(r);
|
|
1390
1395
|
return e <= 0 ? 0n : BigInt(e);
|
|
1391
|
-
},
|
|
1396
|
+
}, Kt = (r, e) => {
|
|
1392
1397
|
if (!Number.isFinite(r))
|
|
1393
1398
|
throw new Error(`valueFn returned a non-finite value at index ${e}: ${r}`);
|
|
1394
1399
|
return r;
|
|
1395
|
-
},
|
|
1400
|
+
}, Rt = (r) => {
|
|
1396
1401
|
if (r <= 0 || !Number.isFinite(r))
|
|
1397
1402
|
return 0;
|
|
1398
1403
|
const e = Math.trunc(r);
|
|
@@ -1401,7 +1406,7 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
|
|
|
1401
1406
|
const t = BigInt(e) & -BigInt(e);
|
|
1402
1407
|
return Number(t);
|
|
1403
1408
|
};
|
|
1404
|
-
class
|
|
1409
|
+
class It {
|
|
1405
1410
|
/**
|
|
1406
1411
|
* @private
|
|
1407
1412
|
* @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
|
|
@@ -1469,23 +1474,23 @@ class St {
|
|
|
1469
1474
|
if (i > 0) {
|
|
1470
1475
|
const c = n?.sampleRange ?? {
|
|
1471
1476
|
from: 0,
|
|
1472
|
-
to: Math.min(
|
|
1477
|
+
to: Math.min(Ft - 1, i - 1)
|
|
1473
1478
|
};
|
|
1474
|
-
let
|
|
1475
|
-
if (
|
|
1476
|
-
s =
|
|
1479
|
+
let f = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), i - 1);
|
|
1480
|
+
if (f > b && (f = 0, b = Math.min(Ft - 1, i - 1)), i > Ft)
|
|
1481
|
+
s = It._sampleBaseValueStrided(t, i, Ft), n?.materialize && (a = { from: f, values: It._collectValidatedValues(t, f, b) });
|
|
1477
1482
|
else {
|
|
1478
|
-
const
|
|
1479
|
-
s =
|
|
1483
|
+
const S = It._collectValidatedValues(t, f, b);
|
|
1484
|
+
s = It._modeOrMedian([...S]), n?.materialize && (a = { from: f, values: S });
|
|
1480
1485
|
}
|
|
1481
1486
|
}
|
|
1482
1487
|
if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = t, this.baseValue = s, a)
|
|
1483
1488
|
for (let c = 0; c < a.values.length; c++) {
|
|
1484
|
-
const
|
|
1485
|
-
if (
|
|
1489
|
+
const f = a.from + c;
|
|
1490
|
+
if (f >= this.size)
|
|
1486
1491
|
break;
|
|
1487
1492
|
const b = a.values[c] - this.baseValue;
|
|
1488
|
-
b !== 0 && (this.deltas.set(
|
|
1493
|
+
b !== 0 && (this.deltas.set(f, b), this._updateTree(f, b));
|
|
1489
1494
|
}
|
|
1490
1495
|
this.total = this.getTotal();
|
|
1491
1496
|
}
|
|
@@ -1516,7 +1521,7 @@ class St {
|
|
|
1516
1521
|
static _collectValidatedValues(e, t, n) {
|
|
1517
1522
|
const i = [];
|
|
1518
1523
|
for (let s = t; s <= n; s++)
|
|
1519
|
-
i.push(
|
|
1524
|
+
i.push(Kt(e(s), s));
|
|
1520
1525
|
return i;
|
|
1521
1526
|
}
|
|
1522
1527
|
/**
|
|
@@ -1542,9 +1547,9 @@ class St {
|
|
|
1542
1547
|
}
|
|
1543
1548
|
if (s > e.length * 0.2) {
|
|
1544
1549
|
const a = [];
|
|
1545
|
-
for (const [
|
|
1546
|
-
b === s && a.push(
|
|
1547
|
-
const c = a.reduce((
|
|
1550
|
+
for (const [f, b] of i.entries())
|
|
1551
|
+
b === s && a.push(f);
|
|
1552
|
+
const c = a.reduce((f, b) => f + b, 0);
|
|
1548
1553
|
n = Math.floor(c / a.length);
|
|
1549
1554
|
}
|
|
1550
1555
|
return n;
|
|
@@ -1566,8 +1571,8 @@ class St {
|
|
|
1566
1571
|
i % 2 === 0 && (i += 1);
|
|
1567
1572
|
const s = [];
|
|
1568
1573
|
for (let a = 0; a < t && s.length < n; a += i)
|
|
1569
|
-
s.push(
|
|
1570
|
-
return
|
|
1574
|
+
s.push(Kt(e(a), a));
|
|
1575
|
+
return It._modeOrMedian(s);
|
|
1571
1576
|
}
|
|
1572
1577
|
/**
|
|
1573
1578
|
* @method update
|
|
@@ -1639,7 +1644,7 @@ class St {
|
|
|
1639
1644
|
let n = e + 1;
|
|
1640
1645
|
for (; n <= this.size; ) {
|
|
1641
1646
|
this.tree.set(n, (this.tree.get(n) ?? 0) + t);
|
|
1642
|
-
const i =
|
|
1647
|
+
const i = Rt(n);
|
|
1643
1648
|
if (i === 0)
|
|
1644
1649
|
break;
|
|
1645
1650
|
n += i;
|
|
@@ -1665,8 +1670,8 @@ class St {
|
|
|
1665
1670
|
throw new Error(`Value must be a finite number: ${s}`);
|
|
1666
1671
|
if (s < 0)
|
|
1667
1672
|
throw new Error("Value cannot be negative.");
|
|
1668
|
-
const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = a + this.baseValue,
|
|
1669
|
-
|
|
1673
|
+
const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = a + this.baseValue, f = s - c;
|
|
1674
|
+
f !== 0 && t.push({ index: i, change: f }), n.set(i, a + f);
|
|
1670
1675
|
}
|
|
1671
1676
|
return t;
|
|
1672
1677
|
}
|
|
@@ -1683,7 +1688,7 @@ class St {
|
|
|
1683
1688
|
let e = 0, t = this.size;
|
|
1684
1689
|
for (; t > 0; ) {
|
|
1685
1690
|
e += this.tree.get(t) ?? 0;
|
|
1686
|
-
const n =
|
|
1691
|
+
const n = Rt(t);
|
|
1687
1692
|
if (n === 0)
|
|
1688
1693
|
break;
|
|
1689
1694
|
t -= n;
|
|
@@ -1700,7 +1705,7 @@ class St {
|
|
|
1700
1705
|
*/
|
|
1701
1706
|
_materialize(e, t = !0) {
|
|
1702
1707
|
if (this.valueFn) {
|
|
1703
|
-
const n = this.deltas.get(e) ?? 0, s =
|
|
1708
|
+
const n = this.deltas.get(e) ?? 0, s = Kt(this.valueFn(e), e) - this.baseValue;
|
|
1704
1709
|
if (s !== n && (s === 0 ? this.deltas.delete(e) : this.deltas.set(e, s), t)) {
|
|
1705
1710
|
const a = s - n;
|
|
1706
1711
|
this._updateTree(e, a);
|
|
@@ -1722,9 +1727,9 @@ class St {
|
|
|
1722
1727
|
const i = e.ranges;
|
|
1723
1728
|
if (i && i.length > 0) {
|
|
1724
1729
|
for (const c of i) {
|
|
1725
|
-
const
|
|
1726
|
-
for (let
|
|
1727
|
-
this._materialize(
|
|
1730
|
+
const f = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), this.size - 1);
|
|
1731
|
+
for (let S = f; S <= b; S++)
|
|
1732
|
+
this._materialize(S);
|
|
1728
1733
|
}
|
|
1729
1734
|
if (t === void 0)
|
|
1730
1735
|
return;
|
|
@@ -1790,8 +1795,8 @@ class St {
|
|
|
1790
1795
|
for (; s > 0; s >>= 1) {
|
|
1791
1796
|
const a = n + s;
|
|
1792
1797
|
if (a <= this.size) {
|
|
1793
|
-
const
|
|
1794
|
-
(t ? i +
|
|
1798
|
+
const f = (this.tree.get(a) ?? 0) + this.baseValue * s;
|
|
1799
|
+
(t ? i + f < e : i + f <= e) && (n = a, i += f);
|
|
1795
1800
|
}
|
|
1796
1801
|
}
|
|
1797
1802
|
return t ? n : n - 1;
|
|
@@ -1804,17 +1809,17 @@ class St {
|
|
|
1804
1809
|
_findIndexLarge(e, t, n) {
|
|
1805
1810
|
if (this.size === 0)
|
|
1806
1811
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1807
|
-
const i =
|
|
1812
|
+
const i = $r(this.size);
|
|
1808
1813
|
if (i === 0n)
|
|
1809
1814
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1810
1815
|
this._materializeRanges(t.materializeOption);
|
|
1811
1816
|
const s = t.materializeOption?.materialize === !0;
|
|
1812
1817
|
for (; ; ) {
|
|
1813
|
-
let a = 0n, c = i - 1n,
|
|
1818
|
+
let a = 0n, c = i - 1n, f, b, S = this.total;
|
|
1814
1819
|
for (; a <= c; ) {
|
|
1815
|
-
const h = a + c >> 1n,
|
|
1816
|
-
if (
|
|
1817
|
-
if (
|
|
1820
|
+
const h = a + c >> 1n, C = Number(h), G = this.prefixSum(C);
|
|
1821
|
+
if (S = G.total, n ? G.cumulative >= e : G.cumulative <= e)
|
|
1822
|
+
if (f = h, b = G, n) {
|
|
1818
1823
|
if (h === 0n)
|
|
1819
1824
|
break;
|
|
1820
1825
|
c = h - 1n;
|
|
@@ -1828,15 +1833,15 @@ class St {
|
|
|
1828
1833
|
c = h - 1n;
|
|
1829
1834
|
}
|
|
1830
1835
|
}
|
|
1831
|
-
const w = b,
|
|
1832
|
-
if (s &&
|
|
1833
|
-
const h = this.deltas.get(
|
|
1834
|
-
if (this._materialize(
|
|
1836
|
+
const w = b, V = f !== void 0 ? Number(f) : -1;
|
|
1837
|
+
if (s && V >= 0) {
|
|
1838
|
+
const h = this.deltas.get(V) ?? 0;
|
|
1839
|
+
if (this._materialize(V), (this.deltas.get(V) ?? 0) !== h)
|
|
1835
1840
|
continue;
|
|
1836
1841
|
}
|
|
1837
1842
|
return {
|
|
1838
|
-
index:
|
|
1839
|
-
total:
|
|
1843
|
+
index: V,
|
|
1844
|
+
total: S,
|
|
1840
1845
|
cumulative: w?.cumulative,
|
|
1841
1846
|
currentValue: w?.currentValue,
|
|
1842
1847
|
safeIndex: w?.safeIndex
|
|
@@ -1856,13 +1861,13 @@ class St {
|
|
|
1856
1861
|
return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
|
|
1857
1862
|
if (this.size === 0)
|
|
1858
1863
|
return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
|
|
1859
|
-
const n =
|
|
1864
|
+
const n = le(Math.trunc(e), 0, this.size - 1), i = t?.materializeOption;
|
|
1860
1865
|
this._materializeRanges(i, n, !0);
|
|
1861
1866
|
let s = 0, a = n + 1;
|
|
1862
1867
|
for (; a > 0; ) {
|
|
1863
|
-
const
|
|
1864
|
-
s +=
|
|
1865
|
-
const b =
|
|
1868
|
+
const f = this.tree.get(a) ?? 0;
|
|
1869
|
+
s += f;
|
|
1870
|
+
const b = Rt(a);
|
|
1866
1871
|
if (b === 0)
|
|
1867
1872
|
break;
|
|
1868
1873
|
a -= b;
|
|
@@ -1925,7 +1930,7 @@ class St {
|
|
|
1925
1930
|
let s = n + 1;
|
|
1926
1931
|
for (; s <= this.size; ) {
|
|
1927
1932
|
t.set(s, (t.get(s) ?? 0) + i);
|
|
1928
|
-
const a =
|
|
1933
|
+
const a = Rt(s);
|
|
1929
1934
|
if (a === 0)
|
|
1930
1935
|
break;
|
|
1931
1936
|
s += a;
|
|
@@ -2042,14 +2047,14 @@ class St {
|
|
|
2042
2047
|
_propagateDeltaToGrownNodes(e, t, n, i) {
|
|
2043
2048
|
let s = e + 1;
|
|
2044
2049
|
for (; s <= n; ) {
|
|
2045
|
-
const a =
|
|
2050
|
+
const a = Rt(s);
|
|
2046
2051
|
if (a === 0)
|
|
2047
2052
|
break;
|
|
2048
2053
|
s += a;
|
|
2049
2054
|
}
|
|
2050
2055
|
for (; s <= i; ) {
|
|
2051
2056
|
this.tree.set(s, (this.tree.get(s) ?? 0) + t);
|
|
2052
|
-
const a =
|
|
2057
|
+
const a = Rt(s);
|
|
2053
2058
|
if (a === 0)
|
|
2054
2059
|
break;
|
|
2055
2060
|
s += a;
|
|
@@ -2065,7 +2070,7 @@ class St {
|
|
|
2065
2070
|
*/
|
|
2066
2071
|
_growSize(e, t) {
|
|
2067
2072
|
if (this.size = t, this.deltas.size > 0) {
|
|
2068
|
-
const n =
|
|
2073
|
+
const n = It._minCoveredLowBound(e, t);
|
|
2069
2074
|
if (e - n < this.deltas.size)
|
|
2070
2075
|
for (let s = n; s < e; s++) {
|
|
2071
2076
|
const a = this.deltas.get(s);
|
|
@@ -2143,20 +2148,20 @@ class St {
|
|
|
2143
2148
|
return this._findIndex(e, t ?? {}, !1);
|
|
2144
2149
|
}
|
|
2145
2150
|
}
|
|
2146
|
-
const
|
|
2151
|
+
const Wr = (r, e) => {
|
|
2147
2152
|
const t = r?.sampleRange, n = e?.sampleRange;
|
|
2148
2153
|
return t === n ? !1 : t && n ? t.from !== n.from || t.to !== n.to : !0;
|
|
2149
|
-
},
|
|
2154
|
+
}, Ur = (r, e, t) => {
|
|
2150
2155
|
const n = Number.isFinite(r) && r > 0 ? Math.trunc(r) : 0, i = g(null), s = g({ size: n, valueOrFn: e, options: t });
|
|
2151
|
-
i.current === null && (i.current = new
|
|
2152
|
-
const a = i.current, c = s.current,
|
|
2153
|
-
if (b ||
|
|
2154
|
-
const
|
|
2155
|
-
|
|
2156
|
-
} else
|
|
2156
|
+
i.current === null && (i.current = new It(n, e, t));
|
|
2157
|
+
const a = i.current, c = s.current, f = c.size !== n, b = c.valueOrFn !== e, S = Wr(c.options, t), w = c.size === 0 && n > 0 && (!i.current || i.current.base === 0);
|
|
2158
|
+
if (b || S) {
|
|
2159
|
+
const V = t?.resetOnValueFnChange ?? !0;
|
|
2160
|
+
S || b && V || w ? (t?.debug && T.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: S }), a.reset(n, e, t)) : (f && (t?.debug && T.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: n }), a.changeSize(n)), t?.debug && T.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: t };
|
|
2161
|
+
} else f && (t?.debug && T.debug("[useFenwickMapTree] resize", { from: c.size, to: n }), w ? a.reset(n, e, t) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: t });
|
|
2157
2162
|
return a;
|
|
2158
2163
|
};
|
|
2159
|
-
class
|
|
2164
|
+
class Kr {
|
|
2160
2165
|
key;
|
|
2161
2166
|
value;
|
|
2162
2167
|
prev = null;
|
|
@@ -2165,7 +2170,7 @@ class Ur {
|
|
|
2165
2170
|
this.key = e, this.value = t;
|
|
2166
2171
|
}
|
|
2167
2172
|
}
|
|
2168
|
-
class
|
|
2173
|
+
class jt {
|
|
2169
2174
|
head = null;
|
|
2170
2175
|
tail = null;
|
|
2171
2176
|
/**
|
|
@@ -2206,58 +2211,58 @@ class Kt {
|
|
|
2206
2211
|
this.remove(e), this.addToTail(e);
|
|
2207
2212
|
}
|
|
2208
2213
|
}
|
|
2209
|
-
function
|
|
2210
|
-
const e = g(/* @__PURE__ */ new Map()), t = g(new
|
|
2211
|
-
|
|
2214
|
+
function jr(r) {
|
|
2215
|
+
const e = g(/* @__PURE__ */ new Map()), t = g(new jt()), n = Math.floor(r), i = g(n);
|
|
2216
|
+
q(() => {
|
|
2212
2217
|
if (i.current = n, Number.isNaN(n) || n < 0) {
|
|
2213
|
-
T.warn(`useLruCache: invalid capacity ${r}; the cache will not store any entries.`), e.current.clear(), t.current = new
|
|
2218
|
+
T.warn(`useLruCache: invalid capacity ${r}; the cache will not store any entries.`), e.current.clear(), t.current = new jt();
|
|
2214
2219
|
return;
|
|
2215
2220
|
}
|
|
2216
2221
|
if (Number.isFinite(n))
|
|
2217
2222
|
for (; e.current.size > n; ) {
|
|
2218
|
-
const
|
|
2219
|
-
if (
|
|
2220
|
-
e.current.delete(
|
|
2223
|
+
const S = t.current.removeHead();
|
|
2224
|
+
if (S)
|
|
2225
|
+
e.current.delete(S.key);
|
|
2221
2226
|
else
|
|
2222
2227
|
break;
|
|
2223
2228
|
}
|
|
2224
2229
|
}, [r, n]);
|
|
2225
|
-
const s =
|
|
2226
|
-
const w = e.current.get(
|
|
2230
|
+
const s = I((S) => {
|
|
2231
|
+
const w = e.current.get(S);
|
|
2227
2232
|
if (w)
|
|
2228
2233
|
return t.current.moveToTail(w), w.value;
|
|
2229
|
-
}, []), a =
|
|
2230
|
-
const
|
|
2231
|
-
if (Number.isNaN(
|
|
2234
|
+
}, []), a = I((S, w) => {
|
|
2235
|
+
const V = i.current;
|
|
2236
|
+
if (Number.isNaN(V) || V <= 0)
|
|
2232
2237
|
return;
|
|
2233
|
-
let h = e.current.get(
|
|
2238
|
+
let h = e.current.get(S);
|
|
2234
2239
|
if (h)
|
|
2235
2240
|
h.value = w, t.current.moveToTail(h);
|
|
2236
2241
|
else {
|
|
2237
|
-
if (e.current.size >=
|
|
2238
|
-
const
|
|
2239
|
-
|
|
2242
|
+
if (e.current.size >= V) {
|
|
2243
|
+
const C = t.current.removeHead();
|
|
2244
|
+
C && e.current.delete(C.key);
|
|
2240
2245
|
}
|
|
2241
|
-
h = new
|
|
2246
|
+
h = new Kr(S, w), e.current.set(S, h), t.current.addToTail(h);
|
|
2242
2247
|
}
|
|
2243
|
-
}, []), c =
|
|
2244
|
-
const w = e.current.get(
|
|
2245
|
-
w && (t.current.remove(w), e.current.delete(
|
|
2246
|
-
}, []), b =
|
|
2247
|
-
e.current.clear(), t.current = new
|
|
2248
|
+
}, []), c = I((S) => e.current.has(S), []), f = I((S) => {
|
|
2249
|
+
const w = e.current.get(S);
|
|
2250
|
+
w && (t.current.remove(w), e.current.delete(S));
|
|
2251
|
+
}, []), b = I(() => {
|
|
2252
|
+
e.current.clear(), t.current = new jt();
|
|
2248
2253
|
}, []);
|
|
2249
|
-
return
|
|
2254
|
+
return Fe(() => ({ get: s, set: a, has: c, remove: f, clear: b }), [s, a, c, f, b]);
|
|
2250
2255
|
}
|
|
2251
|
-
const
|
|
2252
|
-
const { get: r, set: e, has: t, clear: n } =
|
|
2253
|
-
return
|
|
2254
|
-
},
|
|
2256
|
+
const Gr = 1e4, cn = () => {
|
|
2257
|
+
const { get: r, set: e, has: t, clear: n } = jr(Gr);
|
|
2258
|
+
return Fe(() => ({ get: r, set: e, has: t, clear: n }), [r, e, t, n]);
|
|
2259
|
+
}, un = (r, e) => {
|
|
2255
2260
|
const t = g(e), n = g(r);
|
|
2256
|
-
|
|
2261
|
+
nt(() => {
|
|
2257
2262
|
t.current = e, n.current = r;
|
|
2258
2263
|
}, [e, r]);
|
|
2259
2264
|
const i = g(/* @__PURE__ */ new WeakMap());
|
|
2260
|
-
return
|
|
2265
|
+
return I((s) => {
|
|
2261
2266
|
if (!s || i.current.has(s))
|
|
2262
2267
|
return;
|
|
2263
2268
|
const a = (c) => {
|
|
@@ -2267,10 +2272,10 @@ const jr = 1e4, ln = () => {
|
|
|
2267
2272
|
i.current.get(s) === a && (s.removeEventListener("wheel", a), i.current.delete(s));
|
|
2268
2273
|
};
|
|
2269
2274
|
}, []);
|
|
2270
|
-
},
|
|
2275
|
+
}, Pe = (r, e) => e <= 0 ? 0 : le(r, 0, e - 1), lr = (r) => ({
|
|
2271
2276
|
top: Math.max(0, r?.top ?? 0),
|
|
2272
2277
|
bottom: Math.max(0, r?.bottom ?? 0)
|
|
2273
|
-
}),
|
|
2278
|
+
}), Ke = (r, e) => r <= e ? 0 : r - e, Pt = (r, e) => r <= 0 ? 0 : r + e, Yt = 1e3, cr = 2e3, Zr = 1048576, Jr = 40, Qr = (r) => {
|
|
2274
2279
|
const e = r.ownerDocument.defaultView?.getSelection();
|
|
2275
2280
|
if (!e || e.isCollapsed || e.rangeCount === 0)
|
|
2276
2281
|
return !1;
|
|
@@ -2278,70 +2283,70 @@ const jr = 1e4, ln = () => {
|
|
|
2278
2283
|
if (e.getRangeAt(t).intersectsNode(r))
|
|
2279
2284
|
return !0;
|
|
2280
2285
|
return !1;
|
|
2281
|
-
},
|
|
2286
|
+
}, Dt = (r) => {
|
|
2282
2287
|
if (!Number.isFinite(r)) return 0n;
|
|
2283
2288
|
const e = Math.trunc(r);
|
|
2284
2289
|
return e <= 0 ? 0n : BigInt(e);
|
|
2285
|
-
},
|
|
2286
|
-
const
|
|
2287
|
-
if (
|
|
2290
|
+
}, en = (r, e, t, n, i, s, a, c) => {
|
|
2291
|
+
const f = Dt(n);
|
|
2292
|
+
if (f === 0n)
|
|
2288
2293
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2289
|
-
const b = (P) => P < 0n ? 0n : P >=
|
|
2294
|
+
const b = (P) => P < 0n ? 0n : P >= f ? f - 1n : P, S = { materializeOption: { materialize: !1 } }, { index: w, cumulative: V } = s.findIndexAtOrAfter(r, S);
|
|
2290
2295
|
let h;
|
|
2291
|
-
w === -1 ? h =
|
|
2292
|
-
const
|
|
2296
|
+
w === -1 ? h = f - 1n : (V === r ? h = Dt(w + 1) : h = Dt(w), h >= f && (h = f - 1n)), r <= 0 && (h = 0n), c && r >= a && (h = f - 1n);
|
|
2297
|
+
const C = (P) => {
|
|
2293
2298
|
const _ = Number(P);
|
|
2294
2299
|
if (!Number.isSafeInteger(_))
|
|
2295
2300
|
return null;
|
|
2296
2301
|
const { cumulative: M } = s.prefixSum(_, { materializeOption: { materialize: !1 } });
|
|
2297
2302
|
if (!Number.isFinite(M))
|
|
2298
2303
|
return null;
|
|
2299
|
-
const { index:
|
|
2300
|
-
if (
|
|
2304
|
+
const { index: Z } = s.findIndexAtOrAfter(M + 0.5, { materializeOption: { materialize: !1 } });
|
|
2305
|
+
if (Z === -1)
|
|
2301
2306
|
return null;
|
|
2302
|
-
const
|
|
2303
|
-
return
|
|
2304
|
-
},
|
|
2305
|
-
let _ = 0, M = P,
|
|
2306
|
-
for (; M <
|
|
2307
|
-
const
|
|
2308
|
-
if (_ +=
|
|
2307
|
+
const Q = Dt(Z);
|
|
2308
|
+
return Q > P ? Q : null;
|
|
2309
|
+
}, G = (P) => {
|
|
2310
|
+
let _ = 0, M = P, Z = P, Q = 0n, W = 0;
|
|
2311
|
+
for (; M < f && _ < e; ) {
|
|
2312
|
+
const Ie = Number(M), z = i(Ie);
|
|
2313
|
+
if (_ += z, Z = M, M += 1n, Q += 1n, !Number.isFinite(z) || z < 0)
|
|
2309
2314
|
break;
|
|
2310
|
-
if (
|
|
2311
|
-
if (
|
|
2312
|
-
const
|
|
2313
|
-
if (
|
|
2314
|
-
M =
|
|
2315
|
-
else if (
|
|
2316
|
-
|
|
2315
|
+
if (z === 0) {
|
|
2316
|
+
if (W += 1, W > Yt) {
|
|
2317
|
+
const v = C(Z);
|
|
2318
|
+
if (v !== null && v > M)
|
|
2319
|
+
M = v, W = 0;
|
|
2320
|
+
else if (v !== null && v === M && i(Number(M)) > 0)
|
|
2321
|
+
W = 0;
|
|
2317
2322
|
else
|
|
2318
2323
|
break;
|
|
2319
2324
|
}
|
|
2320
2325
|
} else
|
|
2321
|
-
|
|
2326
|
+
W = 0;
|
|
2322
2327
|
}
|
|
2323
|
-
return
|
|
2328
|
+
return Q === 0n && (Z = P), { height: _, end: Z };
|
|
2324
2329
|
};
|
|
2325
|
-
let { height:
|
|
2326
|
-
if (
|
|
2327
|
-
let P = h, _ =
|
|
2330
|
+
let { height: H, end: pe } = G(h);
|
|
2331
|
+
if (H < e && h > 0n) {
|
|
2332
|
+
let P = h, _ = H, M = 0;
|
|
2328
2333
|
for (; P > 0n && _ < e; ) {
|
|
2329
2334
|
P -= 1n;
|
|
2330
|
-
const
|
|
2331
|
-
if (_ +=
|
|
2335
|
+
const Q = Number(P), W = i(Q);
|
|
2336
|
+
if (_ += W, !Number.isFinite(W) || W < 0)
|
|
2332
2337
|
break;
|
|
2333
|
-
if (
|
|
2334
|
-
if (M += 1, M >
|
|
2335
|
-
const
|
|
2336
|
-
if (!Number.isSafeInteger(
|
|
2338
|
+
if (W === 0) {
|
|
2339
|
+
if (M += 1, M > Yt) {
|
|
2340
|
+
const Ie = Number(P);
|
|
2341
|
+
if (!Number.isSafeInteger(Ie))
|
|
2337
2342
|
break;
|
|
2338
|
-
const { cumulative:
|
|
2339
|
-
if (!Number.isFinite(
|
|
2343
|
+
const { cumulative: z } = s.prefixSum(Ie, { materializeOption: { materialize: !1 } });
|
|
2344
|
+
if (!Number.isFinite(z))
|
|
2340
2345
|
break;
|
|
2341
|
-
const { index:
|
|
2342
|
-
if (
|
|
2343
|
-
P =
|
|
2344
|
-
else if (
|
|
2346
|
+
const { index: v } = s.findIndexAtOrAfter(z - 0.5, { materializeOption: { materialize: !1 } }), U = v === -1 ? -1n : Dt(v);
|
|
2347
|
+
if (U >= 0n && U < P)
|
|
2348
|
+
P = U + 1n, M = 0;
|
|
2349
|
+
else if (U === P && P >= 1n && i(Number(P - 1n)) > 0)
|
|
2345
2350
|
M = 0;
|
|
2346
2351
|
else
|
|
2347
2352
|
break;
|
|
@@ -2350,70 +2355,70 @@ const jr = 1e4, ln = () => {
|
|
|
2350
2355
|
M = 0;
|
|
2351
2356
|
}
|
|
2352
2357
|
h = b(P);
|
|
2353
|
-
const
|
|
2354
|
-
|
|
2358
|
+
const Z = G(h);
|
|
2359
|
+
H = Z.height, pe = Z.end;
|
|
2355
2360
|
}
|
|
2356
|
-
const
|
|
2361
|
+
const me = b(h), oe = b(pe), ce = b(me - BigInt(Math.max(0, t))), he = b(oe + BigInt(Math.max(0, t)));
|
|
2357
2362
|
return {
|
|
2358
|
-
renderingStartIndex:
|
|
2359
|
-
renderingEndIndex:
|
|
2360
|
-
visibleStartIndex:
|
|
2361
|
-
visibleEndIndex:
|
|
2363
|
+
renderingStartIndex: Pe(Number(ce), n),
|
|
2364
|
+
renderingEndIndex: Pe(Number(he), n),
|
|
2365
|
+
visibleStartIndex: Pe(Number(me), n),
|
|
2366
|
+
visibleEndIndex: Pe(Number(oe), n)
|
|
2362
2367
|
};
|
|
2363
|
-
},
|
|
2368
|
+
}, tn = (r, e, t, n, i, s, a) => {
|
|
2364
2369
|
if (n === 0)
|
|
2365
2370
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2366
|
-
const c = Number.isFinite(a),
|
|
2371
|
+
const c = Number.isFinite(a), f = c ? Math.min(Math.max(0, r), a) : Math.max(0, r);
|
|
2367
2372
|
if (n >= Number.MAX_SAFE_INTEGER)
|
|
2368
|
-
return
|
|
2369
|
-
const { index: b, cumulative:
|
|
2370
|
-
let h =
|
|
2371
|
-
if (b !== -1 &&
|
|
2372
|
-
h =
|
|
2373
|
-
else if (h === b &&
|
|
2374
|
-
|
|
2373
|
+
return en(f, e, t, n, i, s, a, c);
|
|
2374
|
+
const { index: b, cumulative: S, currentValue: w } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), V = b === -1 ? e <= 0 || (S ?? 0) < f + (w ?? 0) ? n - 1 : 0 : b;
|
|
2375
|
+
let h = Pe(V, n), C = 0;
|
|
2376
|
+
if (b !== -1 && S === f)
|
|
2377
|
+
h = Pe(b + 1, n), C = 0;
|
|
2378
|
+
else if (h === b && S !== void 0 && w !== void 0)
|
|
2379
|
+
C = S - w - f;
|
|
2375
2380
|
else {
|
|
2376
2381
|
const { cumulative: P, currentValue: _ } = s.prefixSum(h, { materializeOption: { materialize: !1 } });
|
|
2377
|
-
|
|
2382
|
+
C = (P ?? 0) - (_ ?? 0) - f;
|
|
2378
2383
|
}
|
|
2379
|
-
const
|
|
2380
|
-
let M = P,
|
|
2381
|
-
for (; M < n &&
|
|
2382
|
-
const
|
|
2383
|
-
if (
|
|
2384
|
+
const G = C, H = (P, _) => {
|
|
2385
|
+
let M = P, Z = _, Q = 0;
|
|
2386
|
+
for (; M < n && Z < e; ) {
|
|
2387
|
+
const W = i(M);
|
|
2388
|
+
if (Z += W, M++, !Number.isFinite(W) || W < 0)
|
|
2384
2389
|
break;
|
|
2385
|
-
if (
|
|
2386
|
-
if (
|
|
2387
|
-
const { cumulative:
|
|
2388
|
-
if (
|
|
2389
|
-
M =
|
|
2390
|
-
else if (
|
|
2391
|
-
|
|
2390
|
+
if (W === 0) {
|
|
2391
|
+
if (Q++, Q > Yt) {
|
|
2392
|
+
const { cumulative: Ie } = s.prefixSum(M - 1, { materializeOption: { materialize: !1 } }), { index: z } = Number.isFinite(Ie) ? s.findIndexAtOrAfter(Ie + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2393
|
+
if (z > M)
|
|
2394
|
+
M = z, Q = 0;
|
|
2395
|
+
else if (z === M && i(M) > 0)
|
|
2396
|
+
Q = 0;
|
|
2392
2397
|
else
|
|
2393
2398
|
break;
|
|
2394
2399
|
}
|
|
2395
2400
|
} else
|
|
2396
|
-
|
|
2401
|
+
Q = 0;
|
|
2397
2402
|
}
|
|
2398
|
-
return { cursor: M, height:
|
|
2399
|
-
},
|
|
2400
|
-
let
|
|
2401
|
-
if (
|
|
2402
|
-
let P =
|
|
2403
|
+
return { cursor: M, height: Z };
|
|
2404
|
+
}, pe = H(h, C);
|
|
2405
|
+
let me = pe.cursor;
|
|
2406
|
+
if (C = pe.height, C < e && h > 0) {
|
|
2407
|
+
let P = C + Math.abs(Math.min(0, G)), _ = h - 1, M = 0;
|
|
2403
2408
|
for (; _ >= 0 && P < e; ) {
|
|
2404
|
-
const
|
|
2405
|
-
if (P +=
|
|
2409
|
+
const Q = i(_);
|
|
2410
|
+
if (P += Q, !Number.isFinite(Q) || Q < 0) {
|
|
2406
2411
|
_--;
|
|
2407
2412
|
break;
|
|
2408
2413
|
}
|
|
2409
|
-
if (
|
|
2410
|
-
if (M++, M >
|
|
2411
|
-
const { cumulative:
|
|
2412
|
-
if (
|
|
2413
|
-
_ =
|
|
2414
|
+
if (Q === 0) {
|
|
2415
|
+
if (M++, M > Yt) {
|
|
2416
|
+
const { cumulative: W } = s.prefixSum(_, { materializeOption: { materialize: !1 } }), { index: Ie } = Number.isFinite(W) ? s.findIndexAtOrAfter(W - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2417
|
+
if (Ie !== -1 && Ie < _) {
|
|
2418
|
+
_ = Ie, M = 0;
|
|
2414
2419
|
continue;
|
|
2415
2420
|
}
|
|
2416
|
-
if (
|
|
2421
|
+
if (Ie === _ && _ >= 1 && i(_ - 1) > 0)
|
|
2417
2422
|
M = 0;
|
|
2418
2423
|
else {
|
|
2419
2424
|
_--;
|
|
@@ -2424,15 +2429,15 @@ const jr = 1e4, ln = () => {
|
|
|
2424
2429
|
M = 0;
|
|
2425
2430
|
_--;
|
|
2426
2431
|
}
|
|
2427
|
-
h =
|
|
2428
|
-
const
|
|
2429
|
-
|
|
2432
|
+
h = Pe(_ + 1, n);
|
|
2433
|
+
const Z = H(h, 0);
|
|
2434
|
+
me = Z.cursor, C = Z.height;
|
|
2430
2435
|
}
|
|
2431
|
-
const
|
|
2432
|
-
return { renderingStartIndex:
|
|
2433
|
-
},
|
|
2436
|
+
const oe = Pe(h - t, n), ce = Pe(Math.max(me - 1, h), n), he = Pe(ce + t, n);
|
|
2437
|
+
return { renderingStartIndex: oe, renderingEndIndex: he, visibleStartIndex: h, visibleEndIndex: ce };
|
|
2438
|
+
}, ur = (r, e, t) => {
|
|
2434
2439
|
const n = Math.max(0, e ?? 0), i = g({ last: 0, id: null, arg: null }).current;
|
|
2435
|
-
return
|
|
2440
|
+
return q(
|
|
2436
2441
|
() => () => {
|
|
2437
2442
|
if (i.id !== null && (cancelAnimationFrame(i.id), i.id = null), i.arg !== null && r.current) {
|
|
2438
2443
|
try {
|
|
@@ -2444,13 +2449,13 @@ const jr = 1e4, ln = () => {
|
|
|
2444
2449
|
}
|
|
2445
2450
|
},
|
|
2446
2451
|
[i, r, t]
|
|
2447
|
-
),
|
|
2452
|
+
), I(
|
|
2448
2453
|
(s) => {
|
|
2449
2454
|
if (i.arg = s, i.id !== null) return;
|
|
2450
2455
|
const a = (c) => {
|
|
2451
2456
|
if (i.id = null, i.arg === null) return;
|
|
2452
|
-
const
|
|
2453
|
-
if (n === 0 || i.last === 0 ||
|
|
2457
|
+
const f = c - i.last;
|
|
2458
|
+
if (n === 0 || i.last === 0 || f >= n) {
|
|
2454
2459
|
if (r.current)
|
|
2455
2460
|
try {
|
|
2456
2461
|
t(r.current, i.arg);
|
|
@@ -2465,14 +2470,14 @@ const jr = 1e4, ln = () => {
|
|
|
2465
2470
|
},
|
|
2466
2471
|
[n, t, r, i]
|
|
2467
2472
|
);
|
|
2468
|
-
},
|
|
2469
|
-
const
|
|
2470
|
-
|
|
2473
|
+
}, rn = xr.memo(({ index: r, top: e, height: t, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: c, onFocus: f, registerItemRef: b }) => {
|
|
2474
|
+
const S = I((C) => b(r, C), [r, b]), w = I((C) => c(C, r), [r, c]), V = I(() => f(r), [r, f]), h = I((C) => {
|
|
2475
|
+
C.currentTarget.focus({ preventScroll: !0 });
|
|
2471
2476
|
}, []);
|
|
2472
|
-
return /* @__PURE__ */
|
|
2477
|
+
return /* @__PURE__ */ de(
|
|
2473
2478
|
"div",
|
|
2474
2479
|
{
|
|
2475
|
-
ref:
|
|
2480
|
+
ref: S,
|
|
2476
2481
|
"data-index": r,
|
|
2477
2482
|
"data-virtualscroll-item": "true",
|
|
2478
2483
|
className: "aqvs-item-container",
|
|
@@ -2484,11 +2489,11 @@ const jr = 1e4, ln = () => {
|
|
|
2484
2489
|
tabIndex: a ? -1 : void 0,
|
|
2485
2490
|
onPointerDown: a ? h : void 0,
|
|
2486
2491
|
onKeyDownCapture: a ? w : void 0,
|
|
2487
|
-
onFocusCapture: a ?
|
|
2492
|
+
onFocusCapture: a ? V : void 0,
|
|
2488
2493
|
children: i(n, r)
|
|
2489
2494
|
}
|
|
2490
2495
|
);
|
|
2491
|
-
}),
|
|
2496
|
+
}), nn = ({
|
|
2492
2497
|
itemCount: r,
|
|
2493
2498
|
getItem: e,
|
|
2494
2499
|
getItemKey: t,
|
|
@@ -2497,625 +2502,626 @@ const jr = 1e4, ln = () => {
|
|
|
2497
2502
|
overscanCount: s = 15,
|
|
2498
2503
|
className: a,
|
|
2499
2504
|
testId: c,
|
|
2500
|
-
onScroll:
|
|
2505
|
+
onScroll: f,
|
|
2501
2506
|
onRangeChange: b,
|
|
2502
|
-
children:
|
|
2507
|
+
children: S,
|
|
2503
2508
|
background: w,
|
|
2504
|
-
initialScrollIndex:
|
|
2509
|
+
initialScrollIndex: V,
|
|
2505
2510
|
initialScrollOffset: h,
|
|
2506
|
-
initialScrollAnchor:
|
|
2507
|
-
callbackThrottleMs:
|
|
2508
|
-
contentInsets:
|
|
2509
|
-
onItemFocus:
|
|
2510
|
-
scrollBarOptions:
|
|
2511
|
-
behaviorOptions:
|
|
2512
|
-
onWheelHorizontal:
|
|
2513
|
-
horizontalKeyInputs:
|
|
2514
|
-
horizontalKeyStep: P =
|
|
2511
|
+
initialScrollAnchor: C,
|
|
2512
|
+
callbackThrottleMs: G = 5,
|
|
2513
|
+
contentInsets: H,
|
|
2514
|
+
onItemFocus: pe,
|
|
2515
|
+
scrollBarOptions: me,
|
|
2516
|
+
behaviorOptions: oe,
|
|
2517
|
+
onWheelHorizontal: ce,
|
|
2518
|
+
horizontalKeyInputs: he,
|
|
2519
|
+
horizontalKeyStep: P = Jr,
|
|
2515
2520
|
contentProps: _
|
|
2516
2521
|
}, M) => {
|
|
2517
|
-
const { width:
|
|
2518
|
-
|
|
2519
|
-
}, []),
|
|
2522
|
+
const { width: Z, enableThumbDrag: Q, enableTrackClick: W, enableArrowButtons: Ie, enableScrollToTopBottomButtons: z, renderThumbOverlay: v, tapScrollCircleOptions: U } = me ?? {}, { enablePointerDrag: ge, pointerDragInputs: qe, enableKeyboardNavigation: ee = !0, wheelSpeedMultiplier: X, inertiaOptions: Xe, overscrollBehavior: $e, clipItemHeight: Ce = !1, resetOnGetItemHeightChange: ze = !1 } = oe ?? {}, [je, Ge] = rt(0), K = i ?? je, Ae = I((o) => {
|
|
2523
|
+
Ge((u) => u === o ? u : o);
|
|
2524
|
+
}, []), ue = g(null), be = g({
|
|
2520
2525
|
renderingStartIndex: 0,
|
|
2521
2526
|
renderingEndIndex: 0,
|
|
2522
2527
|
visibleStartIndex: 0,
|
|
2523
2528
|
visibleEndIndex: 0,
|
|
2524
2529
|
scrollPosition: 0,
|
|
2525
2530
|
totalHeight: 0
|
|
2526
|
-
}),
|
|
2527
|
-
|
|
2528
|
-
if (
|
|
2529
|
-
|
|
2531
|
+
}), Te = g(C && r > 0 ? { index: le(Math.trunc(C.index), 0, r - 1), align: "top", offset: -Math.max(0, C.offsetPx ?? 0) } : null), et = g(!1), mt = g(!0);
|
|
2532
|
+
q(() => {
|
|
2533
|
+
if (mt.current) {
|
|
2534
|
+
mt.current = !1;
|
|
2530
2535
|
return;
|
|
2531
2536
|
}
|
|
2532
|
-
|
|
2533
|
-
}, [
|
|
2534
|
-
const
|
|
2535
|
-
const u =
|
|
2537
|
+
ze && (Te.current = null);
|
|
2538
|
+
}, [ze, n]);
|
|
2539
|
+
const N = Fe(() => lr(H), [H]), [it] = rt(() => {
|
|
2540
|
+
const u = C?.index ?? V, m = typeof u == "number" && Number.isFinite(u) ? Math.max(0, Math.trunc(u)) : 0;
|
|
2536
2541
|
return { from: Math.max(0, m - 50), to: m + 50 };
|
|
2537
|
-
}),
|
|
2542
|
+
}), vt = Fe(
|
|
2538
2543
|
// 目的: Fenwick Tree のオプション設定
|
|
2539
2544
|
// 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
|
|
2540
2545
|
// itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
|
|
2541
2546
|
// この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
|
|
2542
2547
|
() => ({
|
|
2543
|
-
sampleRange:
|
|
2544
|
-
resetOnValueFnChange:
|
|
2548
|
+
sampleRange: it,
|
|
2549
|
+
resetOnValueFnChange: ze,
|
|
2545
2550
|
materialize: !0
|
|
2546
2551
|
}),
|
|
2547
|
-
[
|
|
2548
|
-
),
|
|
2552
|
+
[ze, it]
|
|
2553
|
+
), E = Ur(r, n, vt), [J] = rt(() => {
|
|
2549
2554
|
let o = 0, u = 0;
|
|
2550
|
-
if (
|
|
2551
|
-
const m =
|
|
2552
|
-
o =
|
|
2553
|
-
} else if (typeof
|
|
2554
|
-
const m =
|
|
2555
|
-
o =
|
|
2556
|
-
} else typeof h == "number" && (o =
|
|
2555
|
+
if (C && r > 0) {
|
|
2556
|
+
const m = le(Math.trunc(C.index), 0, r - 1), A = Math.max(0, C.offsetPx ?? 0), L = le(m - s * 2, 0, r - 1), O = le(m + s * 2, 0, r - 1), k = m > 0 || A > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: L, to: O }] } } : void 0, { cumulative: se, total: Ne, currentValue: Se } = E.prefixSum(m, k), fe = Math.max(se - Se + A, 0);
|
|
2557
|
+
o = Pt(fe, N.top), u = Ne ?? E.getTotal();
|
|
2558
|
+
} else if (typeof V == "number") {
|
|
2559
|
+
const m = le(V, 0, r - 1), A = le(m - s * 2, 0, r - 1), L = le(m + s * 2, 0, r - 1), O = V > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: A, to: L }] } } : void 0, { cumulative: k, total: se, currentValue: Ne } = E.prefixSum(V, O), Se = Math.max(k - Ne, 0);
|
|
2560
|
+
o = Pt(Se, N.top), u = se ?? E.getTotal();
|
|
2561
|
+
} else typeof h == "number" && (o = Pt(Math.max(h, 0), N.top)), u = E.getTotal();
|
|
2557
2562
|
return { position: o, total: u };
|
|
2558
|
-
}), [
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
}, [
|
|
2562
|
-
const
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
}, [b,
|
|
2566
|
-
const
|
|
2563
|
+
}), [Ze, ht] = rt(J.position), [Le, st] = rt(J.total), ie = g(J.position), p = g(N.top), F = g(f ?? void 0), B = g(b ?? void 0), Y = g(ce), te = (he?.length ?? 0) > 0, Me = !!ce;
|
|
2564
|
+
q(() => {
|
|
2565
|
+
te && (ee || T.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), Me || T.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 || T.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${P}. Horizontal arrow keys are left untouched.`));
|
|
2566
|
+
}, [te, Me, ee, P]);
|
|
2567
|
+
const j = g(/* @__PURE__ */ new Map()), re = g(null), De = g(null), [ne, Je] = rt(null), [Oe, ae] = rt(!1), ve = g(null), We = g(!1), Ve = g(0), ft = g(!1), Qe = g(!1), ot = g(r);
|
|
2568
|
+
ot.current !== r && (ot.current = r, Qe.current = !0), nt(() => {
|
|
2569
|
+
F.current = f ?? void 0, B.current = b ?? void 0, Y.current = ce;
|
|
2570
|
+
}, [b, f, ce]);
|
|
2571
|
+
const d = I(
|
|
2567
2572
|
(o) => {
|
|
2568
|
-
if (
|
|
2573
|
+
if (ee && o && typeof o.focus == "function")
|
|
2569
2574
|
try {
|
|
2570
2575
|
o.focus({ preventScroll: !0 });
|
|
2571
2576
|
} catch {
|
|
2572
2577
|
o.focus();
|
|
2573
2578
|
}
|
|
2574
2579
|
},
|
|
2575
|
-
[
|
|
2576
|
-
),
|
|
2580
|
+
[ee]
|
|
2581
|
+
), y = I((o, { position: u, totalHeight: m }) => {
|
|
2577
2582
|
o(u, m);
|
|
2578
|
-
}, []),
|
|
2583
|
+
}, []), xe = ur(F, G, y), tt = I((o, u) => {
|
|
2579
2584
|
o(u);
|
|
2580
|
-
}, []),
|
|
2581
|
-
|
|
2582
|
-
const
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
}), []),
|
|
2586
|
-
|
|
2587
|
-
}, [
|
|
2588
|
-
const
|
|
2585
|
+
}, []), _e = ur(B, G, tt), ct = g(N.top);
|
|
2586
|
+
ct.current = N.top;
|
|
2587
|
+
const ut = g(xe);
|
|
2588
|
+
ut.current = xe, q(() => (et.current = !1, () => {
|
|
2589
|
+
et.current = !0, ve.current && (clearTimeout(ve.current), ve.current = null);
|
|
2590
|
+
}), []), q(() => {
|
|
2591
|
+
ee || (j.current.clear(), re.current = null, De.current = null);
|
|
2592
|
+
}, [ee]);
|
|
2593
|
+
const at = I(
|
|
2589
2594
|
(o, u) => {
|
|
2590
2595
|
if (!u) {
|
|
2591
|
-
|
|
2596
|
+
j.current.delete(o);
|
|
2592
2597
|
return;
|
|
2593
2598
|
}
|
|
2594
|
-
|
|
2599
|
+
ee && (j.current.set(o, u), re.current === o && (re.current = null, De.current = o, d(u)));
|
|
2595
2600
|
},
|
|
2596
|
-
[
|
|
2597
|
-
),
|
|
2601
|
+
[ee, d]
|
|
2602
|
+
), gt = 0.01, pt = g({
|
|
2598
2603
|
rafId: null,
|
|
2599
2604
|
loopActive: !1,
|
|
2600
2605
|
idleFrames: 0,
|
|
2601
|
-
lastRenderedPosition:
|
|
2602
|
-
}),
|
|
2603
|
-
const o =
|
|
2606
|
+
lastRenderedPosition: J.position
|
|
2607
|
+
}), yt = I(() => {
|
|
2608
|
+
const o = pt.current;
|
|
2604
2609
|
o.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(o.rafId), o.rafId = null, o.loopActive = !1, o.idleFrames = 0;
|
|
2605
2610
|
}, []);
|
|
2606
|
-
|
|
2611
|
+
q(
|
|
2607
2612
|
() => () => {
|
|
2608
|
-
|
|
2613
|
+
yt();
|
|
2609
2614
|
},
|
|
2610
|
-
[
|
|
2615
|
+
[yt]
|
|
2611
2616
|
);
|
|
2612
|
-
const
|
|
2613
|
-
}),
|
|
2614
|
-
const o =
|
|
2617
|
+
const wt = g(() => {
|
|
2618
|
+
}), Nt = I(() => {
|
|
2619
|
+
const o = pt.current;
|
|
2615
2620
|
o.rafId = null;
|
|
2616
|
-
const u =
|
|
2617
|
-
if (
|
|
2618
|
-
|
|
2621
|
+
const u = ie.current, m = Ke(u, ct.current), A = E.getTotal();
|
|
2622
|
+
if (ht((O) => Math.abs(O - u) < gt ? O : u), Math.abs(o.lastRenderedPosition - u) >= gt ? (ut.current({ position: m, totalHeight: A }), o.lastRenderedPosition = u, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
|
|
2623
|
+
yt();
|
|
2619
2624
|
return;
|
|
2620
2625
|
}
|
|
2621
2626
|
if (typeof requestAnimationFrame == "function") {
|
|
2622
|
-
o.rafId = requestAnimationFrame((O) =>
|
|
2627
|
+
o.rafId = requestAnimationFrame((O) => wt.current(O));
|
|
2623
2628
|
return;
|
|
2624
2629
|
}
|
|
2625
2630
|
o.loopActive = !1;
|
|
2626
|
-
}, [
|
|
2627
|
-
|
|
2628
|
-
const At =
|
|
2629
|
-
const o =
|
|
2631
|
+
}, [E, yt]);
|
|
2632
|
+
wt.current = Nt;
|
|
2633
|
+
const At = I(() => {
|
|
2634
|
+
const o = pt.current;
|
|
2630
2635
|
if (o.idleFrames = 0, !o.loopActive) {
|
|
2631
2636
|
if (o.loopActive = !0, typeof requestAnimationFrame == "function") {
|
|
2632
|
-
o.rafId = requestAnimationFrame(
|
|
2637
|
+
o.rafId = requestAnimationFrame(Nt);
|
|
2633
2638
|
return;
|
|
2634
2639
|
}
|
|
2635
2640
|
o.loopActive = !1;
|
|
2636
2641
|
}
|
|
2637
|
-
}, [
|
|
2642
|
+
}, [Nt]), we = I(
|
|
2638
2643
|
(o, u) => {
|
|
2639
|
-
const m = u?.immediate ?? !1, A =
|
|
2640
|
-
if (
|
|
2641
|
-
|
|
2644
|
+
const m = u?.immediate ?? !1, A = Ke(o, N.top);
|
|
2645
|
+
if (ie.current = o, m) {
|
|
2646
|
+
pt.current.lastRenderedPosition = o, pt.current.idleFrames = 0, ht(o), xe({ position: A, totalHeight: E.getTotal() });
|
|
2642
2647
|
return;
|
|
2643
2648
|
}
|
|
2644
2649
|
At();
|
|
2645
2650
|
},
|
|
2646
|
-
[At,
|
|
2647
|
-
),
|
|
2648
|
-
const m =
|
|
2651
|
+
[At, E, N.top, xe]
|
|
2652
|
+
), bt = I((o, u = 0) => {
|
|
2653
|
+
const m = ue.current;
|
|
2649
2654
|
if (!m)
|
|
2650
2655
|
return o;
|
|
2651
2656
|
const A = m.getScrollPosition();
|
|
2652
|
-
|
|
2653
|
-
const L = m.getContentSize() + u, O = m.getViewportSize(),
|
|
2654
|
-
return
|
|
2657
|
+
Ve.current += 1;
|
|
2658
|
+
const L = m.getContentSize() + u, O = m.getViewportSize(), k = m.scrollTo(o, { contentSize: L, viewportSize: O });
|
|
2659
|
+
return k === A && (Ve.current = Math.max(0, Ve.current - 1)), Math.abs(k - o) > 0.5 && (ft.current = !0), k;
|
|
2655
2660
|
}, []), Lt = g(!1);
|
|
2656
|
-
|
|
2661
|
+
q(() => {
|
|
2657
2662
|
if (!Lt.current)
|
|
2658
|
-
if (Lt.current = !0,
|
|
2659
|
-
const o =
|
|
2660
|
-
|
|
2663
|
+
if (Lt.current = !0, C == null && typeof V != "number" && typeof h == "number") {
|
|
2664
|
+
const o = Pt(Math.max(h, 0), N.top), u = Math.abs(o - ie.current) > 0.5;
|
|
2665
|
+
we(o, { immediate: !0 }), u && ue.current?.scrollTo(o);
|
|
2661
2666
|
} else
|
|
2662
|
-
|
|
2663
|
-
}, [
|
|
2664
|
-
const o =
|
|
2665
|
-
if (
|
|
2666
|
-
|
|
2667
|
+
we(ie.current, { immediate: !0 });
|
|
2668
|
+
}, [C, V, h, N.top, we]), q(() => {
|
|
2669
|
+
const o = E.getTotal();
|
|
2670
|
+
if (Le !== o) {
|
|
2671
|
+
st(o);
|
|
2667
2672
|
return;
|
|
2668
2673
|
}
|
|
2669
|
-
if (
|
|
2670
|
-
|
|
2671
|
-
const u =
|
|
2672
|
-
if (u && Math.abs(u.getScrollPosition() -
|
|
2673
|
-
const m =
|
|
2674
|
-
|
|
2674
|
+
if (ft.current) {
|
|
2675
|
+
ft.current = !1;
|
|
2676
|
+
const u = ue.current;
|
|
2677
|
+
if (u && Math.abs(u.getScrollPosition() - ie.current) > 0.5) {
|
|
2678
|
+
const m = bt(ie.current);
|
|
2679
|
+
ft.current = !1, we(m, { immediate: !0 });
|
|
2675
2680
|
}
|
|
2676
2681
|
}
|
|
2677
|
-
}, [
|
|
2678
|
-
if (
|
|
2679
|
-
const { index: o, align: u, offset: m } =
|
|
2682
|
+
}, [E, Le, r, bt, we]), q(() => {
|
|
2683
|
+
if (Te.current !== null) {
|
|
2684
|
+
const { index: o, align: u, offset: m } = Te.current, A = Pe(o, r), { cumulative: L, currentValue: O } = E.prefixSum(A, { materializeOption: { materialize: !1 } });
|
|
2680
2685
|
if (L !== void 0 && O !== void 0) {
|
|
2681
|
-
const
|
|
2682
|
-
let
|
|
2683
|
-
u === "bottom" ?
|
|
2684
|
-
const
|
|
2685
|
-
Math.abs(
|
|
2686
|
-
from:
|
|
2687
|
-
to:
|
|
2686
|
+
const k = Math.max(L - O, 0);
|
|
2687
|
+
let se = k;
|
|
2688
|
+
u === "bottom" ? se = L - K : u === "center" && (se = k + O / 2 - K / 2), m && (se -= m), se = Math.max(0, se);
|
|
2689
|
+
const Ne = Math.max(0, Le + N.top + N.bottom - K), Se = Math.min(Pt(se, N.top), Ne);
|
|
2690
|
+
Math.abs(Se - ie.current) > 1 && (T.debug("[VirtualScroll] Drift correction", {
|
|
2691
|
+
from: ie.current,
|
|
2692
|
+
to: Se,
|
|
2688
2693
|
targetIndex: A
|
|
2689
|
-
}),
|
|
2694
|
+
}), Ve.current === 0 && (Ve.current += 1), ue.current?.scrollTo(Se), we(Se, { immediate: !0 }));
|
|
2690
2695
|
}
|
|
2691
2696
|
}
|
|
2692
|
-
|
|
2693
|
-
}, [
|
|
2694
|
-
const o =
|
|
2695
|
-
if (o ===
|
|
2697
|
+
Qe.current = !1;
|
|
2698
|
+
}, [Le, E, r, N.top, we, K, N.bottom]), q(() => {
|
|
2699
|
+
const o = p.current;
|
|
2700
|
+
if (o === N.top || (p.current = N.top, Te.current))
|
|
2696
2701
|
return;
|
|
2697
|
-
const u =
|
|
2698
|
-
|
|
2699
|
-
}, [
|
|
2700
|
-
const Ot =
|
|
2702
|
+
const u = Ke(ie.current, o), m = Pt(u, N.top);
|
|
2703
|
+
ie.current = m, ue.current?.scrollTo(m), we(m, { immediate: !0 });
|
|
2704
|
+
}, [N.top, we]);
|
|
2705
|
+
const Ot = I(
|
|
2701
2706
|
(o, u) => {
|
|
2702
2707
|
if (r === 0)
|
|
2703
2708
|
return;
|
|
2704
|
-
const m =
|
|
2705
|
-
O !== void 0 &&
|
|
2706
|
-
let
|
|
2707
|
-
if (
|
|
2708
|
-
const
|
|
2709
|
-
|
|
2709
|
+
const m = Pe(o, r), A = E.get(m), L = u - A, O = E.update(m, u);
|
|
2710
|
+
O !== void 0 && st(O), T.debug("[VirtualScroll] Updated item size manually", { index: m, size: u, total: O });
|
|
2711
|
+
let k = Te.current ? Te.current.index : null;
|
|
2712
|
+
if (k === null) {
|
|
2713
|
+
const se = ie.current, Ne = lr(H).top, Se = Ke(se, Ne), { index: fe, cumulative: Be } = E.findIndexAtOrAfter(Se, { materializeOption: { materialize: !1 } });
|
|
2714
|
+
k = Be !== void 0 && Be === Se ? fe + 1 : fe;
|
|
2710
2715
|
}
|
|
2711
|
-
if (
|
|
2712
|
-
const
|
|
2713
|
-
|
|
2716
|
+
if (k !== -1 && m < k && L !== 0) {
|
|
2717
|
+
const se = ie.current, Ne = se + L;
|
|
2718
|
+
bt(Ne, L), we(Ne, { immediate: !0 }), T.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: se, to: Ne, causedByIndex: m, delta: L, activeVisibleStartIndex: k });
|
|
2714
2719
|
}
|
|
2715
2720
|
},
|
|
2716
|
-
[
|
|
2717
|
-
),
|
|
2721
|
+
[E, r, bt, we, H]
|
|
2722
|
+
), Ue = I(
|
|
2718
2723
|
(o, u) => {
|
|
2719
|
-
if (!
|
|
2724
|
+
if (!ue.current || r === 0)
|
|
2720
2725
|
return;
|
|
2721
|
-
const m =
|
|
2722
|
-
if (T.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", O, "Total height:",
|
|
2726
|
+
const m = Pe(o, r), A = Pe(m - s * 2, r), L = Pe(m + s * 2, r), { cumulative: O, total: k, currentValue: se } = E.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: A, to: L }] } });
|
|
2727
|
+
if (T.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", O, "Total height:", k, "ItemHeight:", se, "safeIndexFrom:", A, "safeIndexTo:", L), !k)
|
|
2723
2728
|
return;
|
|
2724
|
-
const
|
|
2725
|
-
let
|
|
2726
|
-
u?.align === "bottom" ?
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2729
|
+
const Ne = Math.max(O - se, 0);
|
|
2730
|
+
let Se = Ne;
|
|
2731
|
+
u?.align === "bottom" ? Se = O - K : u?.align === "center" && (Se = Ne + se / 2 - K / 2), u?.offset && (Se -= u.offset), Se = Math.max(0, Se);
|
|
2732
|
+
const fe = Pt(Se, N.top), Be = ue.current?.getContentSize() ?? k + N.top + N.bottom, ke = Math.max(0, Be - K), He = Math.min(fe, ke);
|
|
2733
|
+
Te.current = {
|
|
2729
2734
|
index: m,
|
|
2730
2735
|
align: u?.align,
|
|
2731
2736
|
offset: u?.offset
|
|
2732
2737
|
};
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2738
|
+
const Ct = ue.current?.getScrollPosition() ?? -1, Xt = Math.abs(Ct - He) > 0.5;
|
|
2739
|
+
We.current = !1, Ve.current = 0, Xt && (We.current = !0, Ve.current += 1, ue.current?.scrollTo(He)), st(k), we(He, { immediate: !0 }), T.debug("[VirtualScroll] Setting scroll position to:", He, { original: fe, max: ke });
|
|
2735
2740
|
},
|
|
2736
|
-
[
|
|
2737
|
-
),
|
|
2738
|
-
|
|
2739
|
-
const o =
|
|
2740
|
-
!o || r === 0 || (
|
|
2741
|
-
}, [r,
|
|
2742
|
-
const
|
|
2741
|
+
[E, s, r, N.top, N.bottom, K, we]
|
|
2742
|
+
), Vt = g(C && r === 0 ? C : null);
|
|
2743
|
+
q(() => {
|
|
2744
|
+
const o = Vt.current;
|
|
2745
|
+
!o || r === 0 || (Vt.current = null, Ue(le(Math.trunc(o.index), 0, r - 1), { align: "top", offset: -Math.max(0, o.offsetPx ?? 0) }));
|
|
2746
|
+
}, [r, Ue]);
|
|
2747
|
+
const l = I(
|
|
2743
2748
|
(o) => {
|
|
2744
|
-
if (!
|
|
2749
|
+
if (!ue.current || r === 0)
|
|
2745
2750
|
return;
|
|
2746
|
-
const u =
|
|
2747
|
-
|
|
2751
|
+
const u = E.getTotal(), m = le(Math.floor(o), 0, u), { index: A, cumulative: L, currentValue: O } = E.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), se = (L ?? 0) - (O ?? 0) - m;
|
|
2752
|
+
Ue(A, { offset: se });
|
|
2748
2753
|
},
|
|
2749
|
-
[
|
|
2750
|
-
),
|
|
2754
|
+
[E, r, Ue]
|
|
2755
|
+
), x = I(() => {
|
|
2751
2756
|
if (r === 0)
|
|
2752
2757
|
return null;
|
|
2753
|
-
const o =
|
|
2758
|
+
const o = Ke(ie.current, N.top), { index: u, cumulative: m, currentValue: A } = E.findIndexAtOrAfter(o, { materializeOption: { materialize: !1 } });
|
|
2754
2759
|
if (u === -1)
|
|
2755
2760
|
return { index: r - 1, offsetPx: 0 };
|
|
2756
2761
|
if (m === o)
|
|
2757
|
-
return { index:
|
|
2762
|
+
return { index: le(u + 1, 0, r - 1), offsetPx: 0 };
|
|
2758
2763
|
const L = (m ?? 0) - (A ?? 0);
|
|
2759
2764
|
return { index: u, offsetPx: Math.max(0, o - L) };
|
|
2760
|
-
}, [
|
|
2765
|
+
}, [E, r, N.top]), R = I(
|
|
2761
2766
|
(o) => {
|
|
2762
|
-
const u =
|
|
2763
|
-
|
|
2764
|
-
const A =
|
|
2765
|
-
return
|
|
2767
|
+
const u = Ke(ie.current, N.top), m = typeof o == "function" ? o(u) : o;
|
|
2768
|
+
l(m);
|
|
2769
|
+
const A = ue.current?.getScrollPosition(), L = typeof A == "number" ? A : ie.current;
|
|
2770
|
+
return we(L), Ke(L, ct.current);
|
|
2766
2771
|
},
|
|
2767
|
-
[
|
|
2768
|
-
),
|
|
2769
|
-
const u =
|
|
2772
|
+
[N.top, l, we]
|
|
2773
|
+
), D = I((o) => {
|
|
2774
|
+
const u = ue.current;
|
|
2770
2775
|
if (!u)
|
|
2771
|
-
return
|
|
2776
|
+
return Ke(ie.current, ct.current);
|
|
2772
2777
|
const m = u.scrollTo((A) => A + o);
|
|
2773
|
-
return
|
|
2774
|
-
}, []),
|
|
2778
|
+
return Ke(m, ct.current);
|
|
2779
|
+
}, []), $ = I((o) => ue.current?.applyWheel(o) ?? !1, []), ye = I(
|
|
2775
2780
|
(o, u) => {
|
|
2776
2781
|
T.debug("[VirtualScroll] Scroll position changed:", o);
|
|
2777
|
-
const m =
|
|
2778
|
-
m && (
|
|
2779
|
-
const A =
|
|
2780
|
-
A && (
|
|
2781
|
-
const L =
|
|
2782
|
-
if (m || A || L || (
|
|
2782
|
+
const m = We.current;
|
|
2783
|
+
m && (We.current = !1);
|
|
2784
|
+
const A = Ve.current > 0;
|
|
2785
|
+
A && (Ve.current = 0);
|
|
2786
|
+
const L = Qe.current && ot.current === r;
|
|
2787
|
+
if (m || A || L || (Te.current = null), we(o), z) {
|
|
2783
2788
|
if (m || A)
|
|
2784
2789
|
return;
|
|
2785
2790
|
const O = o - u;
|
|
2786
2791
|
if (T.debug("[VirtualScroll] Scroll diff:", O, "New:", o, "Prev:", u), Math.abs(O) > 1) {
|
|
2787
|
-
const
|
|
2788
|
-
|
|
2789
|
-
|
|
2792
|
+
const k = O > 0 ? "down" : "up";
|
|
2793
|
+
Je(k), ae(!0), T.debug("[VirtualScroll] Showing scroll buttons. Direction:", k), ve.current && clearTimeout(ve.current), ve.current = setTimeout(() => {
|
|
2794
|
+
ae(!1), T.debug("[VirtualScroll] Hiding scroll buttons");
|
|
2790
2795
|
}, 2e3);
|
|
2791
2796
|
}
|
|
2792
2797
|
}
|
|
2793
2798
|
},
|
|
2794
|
-
[
|
|
2795
|
-
),
|
|
2796
|
-
const o =
|
|
2799
|
+
[we, z, r]
|
|
2800
|
+
), Re = Fe(() => Ke(Ze, N.top), [N.top, Ze]), Ee = Fe(() => {
|
|
2801
|
+
const o = E.getTotal(), u = tn(Re, K, s, r, n, E, o);
|
|
2797
2802
|
return T.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
2798
2803
|
...u,
|
|
2799
|
-
scrollPosition:
|
|
2804
|
+
scrollPosition: Re,
|
|
2800
2805
|
renderingContentSize: o,
|
|
2801
2806
|
overscanCount: s,
|
|
2802
|
-
viewportSize:
|
|
2807
|
+
viewportSize: K
|
|
2803
2808
|
})), u;
|
|
2804
|
-
}, [
|
|
2809
|
+
}, [Re, K, s, r, n, E]), { renderingStartIndex: lt, renderingEndIndex: Ye, visibleStartIndex: xt, visibleEndIndex: _t } = Ee, Tt = I(
|
|
2805
2810
|
(o, u) => {
|
|
2806
|
-
if (!
|
|
2811
|
+
if (!ee || r === 0)
|
|
2807
2812
|
return;
|
|
2808
|
-
const m =
|
|
2813
|
+
const m = Pe(o, r);
|
|
2809
2814
|
if (!(u?.ensureVisible ?? !0)) {
|
|
2810
|
-
const
|
|
2811
|
-
|
|
2815
|
+
const ke = j.current.get(m);
|
|
2816
|
+
ke && (re.current = null, De.current = m, d(ke));
|
|
2812
2817
|
return;
|
|
2813
2818
|
}
|
|
2814
|
-
const L =
|
|
2815
|
-
if (
|
|
2816
|
-
|
|
2817
|
-
const
|
|
2818
|
-
|
|
2819
|
+
const L = E.prefixSum(m, { materializeOption: { materialize: !1 } }), O = L.currentValue, k = Math.max(L.cumulative - O, 0), se = k + O, Ne = Ke(ie.current, N.top), Se = Ne + K;
|
|
2820
|
+
if (k < Ne || se > Se) {
|
|
2821
|
+
Ue(m);
|
|
2822
|
+
const ke = j.current.get(m);
|
|
2823
|
+
ke ? (re.current = null, De.current = m, d(ke)) : re.current = m;
|
|
2819
2824
|
return;
|
|
2820
2825
|
}
|
|
2821
|
-
const
|
|
2822
|
-
if (
|
|
2823
|
-
|
|
2826
|
+
const Be = j.current.get(m);
|
|
2827
|
+
if (Be) {
|
|
2828
|
+
re.current = null, De.current = m, d(Be);
|
|
2824
2829
|
return;
|
|
2825
2830
|
}
|
|
2826
|
-
|
|
2831
|
+
re.current = m;
|
|
2827
2832
|
},
|
|
2828
|
-
[
|
|
2829
|
-
),
|
|
2833
|
+
[ee, r, E, N.top, Ue, d, K]
|
|
2834
|
+
), Qt = I(
|
|
2830
2835
|
(o, u) => {
|
|
2831
|
-
if (!(!
|
|
2836
|
+
if (!(!ee || o.defaultPrevented) && !(o.altKey || o.metaKey || o.ctrlKey) && o.target === o.currentTarget && !o.currentTarget.isContentEditable) {
|
|
2832
2837
|
if (o.key === "ArrowLeft" || o.key === "ArrowRight") {
|
|
2833
|
-
const m =
|
|
2838
|
+
const m = Y.current;
|
|
2834
2839
|
if (!m)
|
|
2835
2840
|
return;
|
|
2836
2841
|
const A = o.shiftKey ? "shift-arrow" : "arrow";
|
|
2837
|
-
if (!
|
|
2842
|
+
if (!he?.includes(A) || o.shiftKey && Qr(o.currentTarget) || !(Number.isFinite(P) && P > 0))
|
|
2838
2843
|
return;
|
|
2839
2844
|
o.preventDefault(), m(o.key === "ArrowLeft" ? -P : P);
|
|
2840
2845
|
return;
|
|
2841
2846
|
}
|
|
2842
2847
|
if (o.key === "ArrowDown") {
|
|
2843
|
-
u < r - 1 && (o.preventDefault(),
|
|
2848
|
+
u < r - 1 && (o.preventDefault(), Tt(u + 1));
|
|
2844
2849
|
return;
|
|
2845
2850
|
}
|
|
2846
2851
|
if (o.key === "ArrowUp") {
|
|
2847
|
-
u > 0 && (o.preventDefault(),
|
|
2852
|
+
u > 0 && (o.preventDefault(), Tt(u - 1));
|
|
2848
2853
|
return;
|
|
2849
2854
|
}
|
|
2850
2855
|
if (o.key === "PageDown") {
|
|
2851
2856
|
if (u < r - 1) {
|
|
2852
2857
|
o.preventDefault();
|
|
2853
|
-
const { visibleStartIndex: m, visibleEndIndex: A } =
|
|
2854
|
-
|
|
2858
|
+
const { visibleStartIndex: m, visibleEndIndex: A } = be.current, L = Math.max(A - m + 1, 1), O = Math.max(L, 1), k = Pe(Math.min(u + O, r - 1), r);
|
|
2859
|
+
Tt(k);
|
|
2855
2860
|
}
|
|
2856
2861
|
return;
|
|
2857
2862
|
}
|
|
2858
2863
|
if (o.key === "PageUp" && u > 0) {
|
|
2859
2864
|
o.preventDefault();
|
|
2860
|
-
const { visibleStartIndex: m, visibleEndIndex: A } =
|
|
2861
|
-
|
|
2865
|
+
const { visibleStartIndex: m, visibleEndIndex: A } = be.current, L = Math.max(A - m + 1, 1), O = Math.max(L, 1), k = Pe(u - O, r);
|
|
2866
|
+
Tt(k);
|
|
2862
2867
|
}
|
|
2863
2868
|
}
|
|
2864
2869
|
},
|
|
2865
|
-
[
|
|
2866
|
-
),
|
|
2870
|
+
[ee, r, Tt, he, P]
|
|
2871
|
+
), er = I(
|
|
2867
2872
|
(o) => {
|
|
2868
|
-
if (!
|
|
2873
|
+
if (!ee)
|
|
2869
2874
|
return;
|
|
2870
|
-
const u =
|
|
2871
|
-
|
|
2875
|
+
const u = Pe(o, r);
|
|
2876
|
+
re.current = null, De.current = u, pe?.(u);
|
|
2872
2877
|
},
|
|
2873
|
-
[
|
|
2878
|
+
[ee, r, pe]
|
|
2874
2879
|
);
|
|
2875
|
-
|
|
2876
|
-
const o =
|
|
2880
|
+
q(() => {
|
|
2881
|
+
const o = ue.current?.getScrollPosition() ?? 0, u = ie.current, m = Ke(u, N.top);
|
|
2877
2882
|
T.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
2878
|
-
renderingStartIndex:
|
|
2879
|
-
renderingEndIndex:
|
|
2880
|
-
visibleStartIndex:
|
|
2881
|
-
visibleEndIndex:
|
|
2882
|
-
scrollPositionState:
|
|
2883
|
+
renderingStartIndex: lt,
|
|
2884
|
+
renderingEndIndex: Ye,
|
|
2885
|
+
visibleStartIndex: xt,
|
|
2886
|
+
visibleEndIndex: _t,
|
|
2887
|
+
scrollPositionState: Ze,
|
|
2883
2888
|
paneScrollPosition: u,
|
|
2884
2889
|
logicalScrollPosition: m,
|
|
2885
|
-
contentSize:
|
|
2890
|
+
contentSize: Le,
|
|
2886
2891
|
scrollPaneScrollPosition: o
|
|
2887
|
-
})),
|
|
2888
|
-
renderingStartIndex:
|
|
2889
|
-
renderingEndIndex:
|
|
2890
|
-
visibleStartIndex:
|
|
2891
|
-
visibleEndIndex:
|
|
2892
|
+
})), _e({
|
|
2893
|
+
renderingStartIndex: lt,
|
|
2894
|
+
renderingEndIndex: Ye,
|
|
2895
|
+
visibleStartIndex: xt,
|
|
2896
|
+
visibleEndIndex: _t,
|
|
2892
2897
|
scrollPosition: m,
|
|
2893
|
-
totalHeight:
|
|
2898
|
+
totalHeight: Le
|
|
2894
2899
|
});
|
|
2895
|
-
}, [
|
|
2896
|
-
const
|
|
2897
|
-
if (!
|
|
2900
|
+
}, [Le, Ye, lt, N.top, _e, Ze, _t, xt]);
|
|
2901
|
+
const hr = I(() => {
|
|
2902
|
+
if (!z)
|
|
2898
2903
|
return null;
|
|
2899
|
-
const o =
|
|
2900
|
-
return /* @__PURE__ */
|
|
2904
|
+
const o = Oe && ne !== null;
|
|
2905
|
+
return /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": o, inert: !o, children: ne === "up" ? /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ de(
|
|
2901
2906
|
"button",
|
|
2902
2907
|
{
|
|
2903
2908
|
type: "button",
|
|
2904
2909
|
className: "aqvs-scroll-to-edge-button",
|
|
2905
2910
|
tabIndex: o ? 0 : -1,
|
|
2906
2911
|
onClick: (m) => {
|
|
2907
|
-
m.stopPropagation(),
|
|
2912
|
+
m.stopPropagation(), We.current = !0, Ue(0), ae(!1);
|
|
2908
2913
|
},
|
|
2909
2914
|
children: "Top"
|
|
2910
2915
|
}
|
|
2911
|
-
) }) : /* @__PURE__ */
|
|
2916
|
+
) }) : /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ de(
|
|
2912
2917
|
"button",
|
|
2913
2918
|
{
|
|
2914
2919
|
type: "button",
|
|
2915
2920
|
className: "aqvs-scroll-to-edge-button",
|
|
2916
2921
|
tabIndex: o ? 0 : -1,
|
|
2917
2922
|
onClick: (m) => {
|
|
2918
|
-
m.stopPropagation(),
|
|
2923
|
+
m.stopPropagation(), We.current = !0, Ue(r - 1), ae(!1);
|
|
2919
2924
|
},
|
|
2920
2925
|
children: "Bottom"
|
|
2921
2926
|
}
|
|
2922
2927
|
) }) });
|
|
2923
|
-
}, [
|
|
2928
|
+
}, [z, Oe, ne, Ue, r]), Bt = g(0), { visibleItems: Ht, renderAnchor: qt } = Fe(() => {
|
|
2924
2929
|
if (r === 0)
|
|
2925
2930
|
return {
|
|
2926
|
-
visibleItems: /* @__PURE__ */
|
|
2931
|
+
visibleItems: /* @__PURE__ */ de("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ de("div", { className: "aqvs-no-items-text", children: "No items" }) }),
|
|
2927
2932
|
renderAnchor: 0
|
|
2928
2933
|
};
|
|
2929
|
-
const o =
|
|
2930
|
-
Number.isFinite(L) && Math.abs(L -
|
|
2931
|
-
const O =
|
|
2932
|
-
let
|
|
2933
|
-
for (let
|
|
2934
|
-
if (
|
|
2935
|
-
T.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap:
|
|
2934
|
+
const o = Pe(lt, r), u = Pe(Ye, r), { cumulative: m, currentValue: A } = E.prefixSum(o, { materializeOption: { materialize: !1 } }), L = m - A;
|
|
2935
|
+
Number.isFinite(L) && Math.abs(L - Bt.current) > Zr && (Bt.current = L);
|
|
2936
|
+
const O = Bt.current, k = [], se = [];
|
|
2937
|
+
let Ne = 0, Se = L;
|
|
2938
|
+
for (let fe = o; fe <= u; fe++) {
|
|
2939
|
+
if (se.length >= cr) {
|
|
2940
|
+
T.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: cr, safeRenderingStartIndex: o, safeRenderingEndIndex: u });
|
|
2936
2941
|
break;
|
|
2937
2942
|
}
|
|
2938
|
-
const
|
|
2939
|
-
|
|
2940
|
-
const
|
|
2941
|
-
|
|
2942
|
-
/* @__PURE__ */
|
|
2943
|
-
|
|
2943
|
+
const Be = n(fe), ke = E.get(fe), He = Be - ke;
|
|
2944
|
+
He !== 0 && k.push({ index: fe, value: Be });
|
|
2945
|
+
const Ct = Se + Ne, Xt = t ? t(fe) : fe;
|
|
2946
|
+
se.push(
|
|
2947
|
+
/* @__PURE__ */ de(
|
|
2948
|
+
rn,
|
|
2944
2949
|
{
|
|
2945
|
-
index:
|
|
2946
|
-
top:
|
|
2947
|
-
height:
|
|
2948
|
-
item: e(
|
|
2949
|
-
clipItemHeight:
|
|
2950
|
-
enableKeyboardNavigation:
|
|
2951
|
-
onKeyDown:
|
|
2952
|
-
onFocus:
|
|
2953
|
-
registerItemRef:
|
|
2954
|
-
children:
|
|
2950
|
+
index: fe,
|
|
2951
|
+
top: Ct - O,
|
|
2952
|
+
height: Be,
|
|
2953
|
+
item: e(fe),
|
|
2954
|
+
clipItemHeight: Ce,
|
|
2955
|
+
enableKeyboardNavigation: ee,
|
|
2956
|
+
onKeyDown: Qt,
|
|
2957
|
+
onFocus: er,
|
|
2958
|
+
registerItemRef: at,
|
|
2959
|
+
children: S
|
|
2955
2960
|
},
|
|
2956
|
-
|
|
2961
|
+
Xt
|
|
2957
2962
|
)
|
|
2958
|
-
),
|
|
2963
|
+
), Ne += He, Se += ke;
|
|
2959
2964
|
}
|
|
2960
|
-
return
|
|
2961
|
-
if (
|
|
2965
|
+
return k.length > 0 && Promise.resolve().then(() => {
|
|
2966
|
+
if (et.current)
|
|
2962
2967
|
return;
|
|
2963
|
-
let
|
|
2964
|
-
for (const
|
|
2965
|
-
if (
|
|
2966
|
-
const
|
|
2967
|
-
|
|
2968
|
+
let fe = 0;
|
|
2969
|
+
for (const He of k)
|
|
2970
|
+
if (He.index < xt) {
|
|
2971
|
+
const Ct = E.get(He.index);
|
|
2972
|
+
fe += He.value - Ct;
|
|
2968
2973
|
}
|
|
2969
|
-
const
|
|
2970
|
-
if (
|
|
2974
|
+
const Be = E.updates(k);
|
|
2975
|
+
if (et.current || typeof Be != "number")
|
|
2971
2976
|
return;
|
|
2972
|
-
|
|
2973
|
-
const
|
|
2974
|
-
if (
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2977
|
-
} else
|
|
2978
|
-
}), { visibleItems:
|
|
2977
|
+
st(Be), T.debug("[VirtualScroll] Updated heights for items", k, "New total height:", Be);
|
|
2978
|
+
const ke = ue.current?.getScrollPosition() ?? ie.current;
|
|
2979
|
+
if (fe !== 0) {
|
|
2980
|
+
const He = ke + fe;
|
|
2981
|
+
bt(He, fe), we(He, { immediate: !0 }), T.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: ke, to: He, shiftAmount: fe });
|
|
2982
|
+
} else ke !== ie.current && we(ke);
|
|
2983
|
+
}), { visibleItems: se, renderAnchor: O };
|
|
2979
2984
|
}, [
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2985
|
+
S,
|
|
2986
|
+
Ce,
|
|
2987
|
+
Le,
|
|
2988
|
+
ee,
|
|
2984
2989
|
r,
|
|
2985
|
-
|
|
2990
|
+
E,
|
|
2986
2991
|
e,
|
|
2987
2992
|
t,
|
|
2988
2993
|
n,
|
|
2994
|
+
er,
|
|
2989
2995
|
Qt,
|
|
2990
|
-
|
|
2991
|
-
xt,
|
|
2992
|
-
mt,
|
|
2996
|
+
bt,
|
|
2993
2997
|
at,
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
+
Ye,
|
|
2999
|
+
lt,
|
|
3000
|
+
we,
|
|
3001
|
+
xt
|
|
3002
|
+
]), gr = I(
|
|
2998
3003
|
(o) => {
|
|
2999
|
-
const u = (
|
|
3004
|
+
const u = (G ?? 0) > 0, m = Math.abs(o - Ze), A = u && m > 0.5 ? Ze : o, L = Ke(A, N.top);
|
|
3000
3005
|
if (T.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
3001
3006
|
currentScrollPosition: o,
|
|
3002
3007
|
effectiveScrollPosition: L,
|
|
3003
|
-
renderingStartIndex:
|
|
3004
|
-
renderingEndIndex:
|
|
3008
|
+
renderingStartIndex: lt,
|
|
3009
|
+
renderingEndIndex: Ye,
|
|
3005
3010
|
itemCount: r,
|
|
3006
|
-
viewportSize:
|
|
3007
|
-
callbackThrottleMs:
|
|
3011
|
+
viewportSize: K,
|
|
3012
|
+
callbackThrottleMs: G,
|
|
3008
3013
|
diff: m,
|
|
3009
3014
|
rawEffectiveScrollPosition: A
|
|
3010
3015
|
})), r === 0)
|
|
3011
|
-
return
|
|
3012
|
-
const O =
|
|
3016
|
+
return Ht;
|
|
3017
|
+
const O = N.top + qt - A, k = N.bottom > 0 ? /* @__PURE__ */ de(
|
|
3013
3018
|
"div",
|
|
3014
3019
|
{
|
|
3015
3020
|
className: "aqvs-bottom-inset",
|
|
3016
3021
|
style: {
|
|
3017
3022
|
// ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
|
|
3018
|
-
top:
|
|
3019
|
-
height:
|
|
3023
|
+
top: E.getTotal() - qt,
|
|
3024
|
+
height: N.bottom
|
|
3020
3025
|
}
|
|
3021
3026
|
},
|
|
3022
3027
|
"virtualscroll-bottom-inset"
|
|
3023
3028
|
) : null;
|
|
3024
3029
|
return T.debug("[VirtualScroll] Rendering items", () => ({
|
|
3025
3030
|
containerTop: O,
|
|
3026
|
-
logicalScrollPosition:
|
|
3027
|
-
resolvedInsets:
|
|
3031
|
+
logicalScrollPosition: Re,
|
|
3032
|
+
resolvedInsets: N,
|
|
3028
3033
|
effectiveScrollPosition: L
|
|
3029
|
-
})), /* @__PURE__ */
|
|
3030
|
-
|
|
3031
|
-
|
|
3034
|
+
})), /* @__PURE__ */ Mt("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${O}px)`, willChange: "transform" }, children: [
|
|
3035
|
+
Ht,
|
|
3036
|
+
k
|
|
3032
3037
|
] });
|
|
3033
3038
|
},
|
|
3034
|
-
[
|
|
3035
|
-
),
|
|
3039
|
+
[G, r, E, Re, qt, Ye, lt, N, Ze, K, Ht]
|
|
3040
|
+
), tr = Fe(
|
|
3036
3041
|
() => ({
|
|
3037
|
-
renderingStartIndex:
|
|
3038
|
-
renderingEndIndex:
|
|
3039
|
-
visibleStartIndex:
|
|
3040
|
-
visibleEndIndex:
|
|
3041
|
-
scrollPosition:
|
|
3042
|
-
totalHeight:
|
|
3042
|
+
renderingStartIndex: Ee.renderingStartIndex,
|
|
3043
|
+
renderingEndIndex: Ee.renderingEndIndex,
|
|
3044
|
+
visibleStartIndex: Ee.visibleStartIndex,
|
|
3045
|
+
visibleEndIndex: Ee.visibleEndIndex,
|
|
3046
|
+
scrollPosition: Re,
|
|
3047
|
+
totalHeight: E.getTotal()
|
|
3043
3048
|
// contentSize (State) ではなく最新値を反映
|
|
3044
3049
|
}),
|
|
3045
3050
|
// contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
|
|
3046
3051
|
// (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
|
|
3047
|
-
[
|
|
3052
|
+
[Ee, Re, E, Le]
|
|
3048
3053
|
);
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
}, [
|
|
3054
|
+
q(() => {
|
|
3055
|
+
be.current = tr;
|
|
3056
|
+
}, [tr]), Jt(
|
|
3052
3057
|
M,
|
|
3053
3058
|
() => ({
|
|
3054
3059
|
getScrollPosition: () => {
|
|
3055
|
-
const o =
|
|
3056
|
-
return typeof o == "number" ?
|
|
3060
|
+
const o = ue.current?.getScrollPosition();
|
|
3061
|
+
return typeof o == "number" ? Ke(o, ct.current) : -1;
|
|
3057
3062
|
},
|
|
3058
|
-
getContentSize: () =>
|
|
3059
|
-
getViewportSize: () =>
|
|
3060
|
-
scrollTo:
|
|
3061
|
-
scrollBy:
|
|
3062
|
-
applyWheel:
|
|
3063
|
-
scrollToIndex:
|
|
3064
|
-
getFenwickTreeTotalHeight: () =>
|
|
3065
|
-
getFenwickSize: () =>
|
|
3066
|
-
focusItemAtIndex:
|
|
3067
|
-
getRange: () =>
|
|
3068
|
-
getScrollAnchor:
|
|
3063
|
+
getContentSize: () => ue.current?.getContentSize() ?? -1,
|
|
3064
|
+
getViewportSize: () => ue.current?.getViewportSize() ?? -1,
|
|
3065
|
+
scrollTo: R,
|
|
3066
|
+
scrollBy: D,
|
|
3067
|
+
applyWheel: $,
|
|
3068
|
+
scrollToIndex: Ue,
|
|
3069
|
+
getFenwickTreeTotalHeight: () => E.getTotal(),
|
|
3070
|
+
getFenwickSize: () => E.getSize(),
|
|
3071
|
+
focusItemAtIndex: Tt,
|
|
3072
|
+
getRange: () => be.current,
|
|
3073
|
+
getScrollAnchor: x,
|
|
3069
3074
|
updateItemSize: Ot
|
|
3070
3075
|
}),
|
|
3071
|
-
[
|
|
3076
|
+
[R, D, $, Ue, E, Tt, x, Ot]
|
|
3072
3077
|
);
|
|
3073
|
-
const
|
|
3074
|
-
return /* @__PURE__ */
|
|
3075
|
-
|
|
3078
|
+
const br = E.getTotal() + N.top + N.bottom;
|
|
3079
|
+
return /* @__PURE__ */ de(
|
|
3080
|
+
Xr,
|
|
3076
3081
|
{
|
|
3077
|
-
ref:
|
|
3078
|
-
contentSize:
|
|
3082
|
+
ref: ue,
|
|
3083
|
+
contentSize: br,
|
|
3079
3084
|
viewportSize: i,
|
|
3080
3085
|
onViewportSizeChange: Ae,
|
|
3081
3086
|
className: a,
|
|
3082
3087
|
testId: c,
|
|
3083
|
-
onScroll:
|
|
3088
|
+
onScroll: ye,
|
|
3084
3089
|
background: w,
|
|
3085
|
-
tapScrollCircleOptions:
|
|
3086
|
-
inertiaOptions:
|
|
3090
|
+
tapScrollCircleOptions: U,
|
|
3091
|
+
inertiaOptions: Xe,
|
|
3092
|
+
overscrollBehavior: $e,
|
|
3087
3093
|
itemCount: r,
|
|
3088
|
-
scrollBarWidth:
|
|
3089
|
-
enableThumbDrag:
|
|
3090
|
-
enableTrackClick:
|
|
3091
|
-
enableArrowButtons:
|
|
3092
|
-
enablePointerDrag:
|
|
3093
|
-
pointerDragInputs:
|
|
3094
|
-
renderThumbOverlay:
|
|
3095
|
-
wheelSpeedMultiplier:
|
|
3096
|
-
onWheelHorizontal:
|
|
3097
|
-
contentInsets:
|
|
3094
|
+
scrollBarWidth: Z,
|
|
3095
|
+
enableThumbDrag: Q,
|
|
3096
|
+
enableTrackClick: W,
|
|
3097
|
+
enableArrowButtons: Ie,
|
|
3098
|
+
enablePointerDrag: ge,
|
|
3099
|
+
pointerDragInputs: qe,
|
|
3100
|
+
renderThumbOverlay: v,
|
|
3101
|
+
wheelSpeedMultiplier: X,
|
|
3102
|
+
onWheelHorizontal: ce,
|
|
3103
|
+
contentInsets: N,
|
|
3098
3104
|
contentProps: _,
|
|
3099
|
-
visibleStartIndex:
|
|
3100
|
-
visibleEndIndex:
|
|
3101
|
-
renderOverlay:
|
|
3102
|
-
initialScrollPosition:
|
|
3103
|
-
children:
|
|
3105
|
+
visibleStartIndex: xt,
|
|
3106
|
+
visibleEndIndex: _t,
|
|
3107
|
+
renderOverlay: hr,
|
|
3108
|
+
initialScrollPosition: J.position,
|
|
3109
|
+
children: gr
|
|
3104
3110
|
}
|
|
3105
3111
|
);
|
|
3106
|
-
},
|
|
3112
|
+
}, dn = Zt(nn);
|
|
3107
3113
|
export {
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3114
|
+
It as FenwickMapTree,
|
|
3115
|
+
kr as ScrollBar,
|
|
3116
|
+
Xr as ScrollPane,
|
|
3117
|
+
pr as TAP_SCROLL_SPEED_DEFAULTS,
|
|
3118
|
+
dn as VirtualScroll,
|
|
3119
|
+
_r as computeAutoTapScrollMaxSpeedMultiplier,
|
|
3120
|
+
Or as computeTapScrollSpeed,
|
|
3121
|
+
le as minmax,
|
|
3122
|
+
ln as tapScrollCircleSampleVisual,
|
|
3123
|
+
Ur as useFenwickMapTree,
|
|
3124
|
+
cn as useHeightCache,
|
|
3125
|
+
jr as useLruCache,
|
|
3126
|
+
un as useWheelBridge
|
|
3121
3127
|
};
|