@aiquants/virtualscroll 1.22.0 → 1.23.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 +22 -0
- package/README.md +36 -0
- package/dist/ScrollBar.d.ts.map +1 -1
- package/dist/ScrollPane.d.cts +24 -0
- package/dist/ScrollPane.d.ts +24 -0
- package/dist/ScrollPane.d.ts.map +1 -1
- package/dist/TapScrollCircle.d.ts.map +1 -1
- package/dist/VirtualScroll.d.cts +25 -0
- package/dist/VirtualScroll.d.ts +25 -0
- package/dist/VirtualScroll.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1334 -1316
- package/dist/styles/virtualscroll.standalone.css +1 -1
- package/package.json +1 -1
- package/src/ScrollBar.tsx +7 -0
- package/src/ScrollPane.tsx +164 -7
- package/src/TapScrollCircle.tsx +10 -0
- package/src/VirtualScroll.tsx +27 -0
- package/dist/_headFenwick.d.cts +0 -450
- package/dist/_headFenwick.d.ts +0 -451
- package/dist/_headFenwick.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { twMerge as
|
|
1
|
+
import { jsx as ot, jsxs as he, Fragment as Ge } from "react/jsx-runtime";
|
|
2
|
+
import Qe, { memo as tr, forwardRef as Be, useState as Jt, useRef as I, useCallback as S, useImperativeHandle as qe, useMemo as Lt, useLayoutEffect as Te, useEffect as q, useId as er } from "react";
|
|
3
|
+
import { twMerge as pe } from "tailwind-merge";
|
|
4
4
|
class C {
|
|
5
5
|
level;
|
|
6
6
|
prefix;
|
|
@@ -146,17 +146,17 @@ class C {
|
|
|
146
146
|
this.level <= 3 && this.impl.error(...this.formatMessage(C.resolveLazy(t)), ...e.map(C.resolveLazy));
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const He = {
|
|
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
|
+
}, _e = 6, rr = 8, nr = ({ dragState: n, normalizedDistance: t }) => {
|
|
157
157
|
const e = 1 + t * 0.18, r = 0.16 + t * 0.24, i = 0.38 + t * 0.28, s = n.active ? "80ms ease-out" : "220ms ease";
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ he(Ge, { children: [
|
|
159
|
+
/* @__PURE__ */ ot(
|
|
160
160
|
"div",
|
|
161
161
|
{
|
|
162
162
|
className: "aqvs-tap-scroll-circle-visual-outer",
|
|
@@ -168,7 +168,7 @@ const qe = {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
),
|
|
171
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ ot(
|
|
172
172
|
"div",
|
|
173
173
|
{
|
|
174
174
|
className: "aqvs-tap-scroll-circle-inner",
|
|
@@ -181,154 +181,154 @@ const qe = {
|
|
|
181
181
|
}
|
|
182
182
|
)
|
|
183
183
|
] });
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
const [d,
|
|
187
|
-
(
|
|
188
|
-
|
|
184
|
+
}, Ze = tr(
|
|
185
|
+
Be(({ onDragChange: n, className: t, maxVisualDistance: e = 160, size: r = 40, style: i, opacity: s = 1, renderVisual: a }, c) => {
|
|
186
|
+
const [d, b] = Jt(He), x = I(null), v = I(null), E = I({ x: 0, y: 0 }), m = I(null), _ = I(0), B = S(
|
|
187
|
+
(T) => {
|
|
188
|
+
b(T), n(T);
|
|
189
189
|
},
|
|
190
190
|
[n]
|
|
191
|
-
),
|
|
192
|
-
(
|
|
193
|
-
const { x:
|
|
194
|
-
let
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
active:
|
|
198
|
-
offsetX:
|
|
199
|
-
offsetY:
|
|
200
|
-
distance:
|
|
201
|
-
direction:
|
|
202
|
-
pointerId:
|
|
191
|
+
), Z = S(
|
|
192
|
+
(T, V, Tt = !1) => {
|
|
193
|
+
const { x: Yt, y: yt } = E.current, J = T - Yt, F = V - yt, Ct = Math.abs(F), W = Ct < _e ? 0 : F < 0 ? -1 : 1, At = _.current;
|
|
194
|
+
let y = W;
|
|
195
|
+
const Kt = _e + rr;
|
|
196
|
+
W === 0 ? At !== 0 && Ct < Kt ? y = At : (y = 0, Tt || (_.current = 0)) : W !== At && At !== 0 && Ct < Kt ? y = At : _.current = W, B({
|
|
197
|
+
active: Tt || Ct >= _e,
|
|
198
|
+
offsetX: J,
|
|
199
|
+
offsetY: F,
|
|
200
|
+
distance: Ct,
|
|
201
|
+
direction: y,
|
|
202
|
+
pointerId: x.current
|
|
203
203
|
});
|
|
204
204
|
},
|
|
205
|
-
[
|
|
206
|
-
), ut = S((
|
|
207
|
-
if (
|
|
205
|
+
[B]
|
|
206
|
+
), ut = S((T) => {
|
|
207
|
+
if (T === null)
|
|
208
208
|
return;
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
}, []),
|
|
212
|
-
(
|
|
213
|
-
|
|
209
|
+
const V = m.current;
|
|
210
|
+
V?.hasPointerCapture(T) && V.releasePointerCapture(T);
|
|
211
|
+
}, []), rt = S(
|
|
212
|
+
(T = !1) => {
|
|
213
|
+
T && ut(x.current), x.current = null, v.current = null, _.current = 0, B(He);
|
|
214
214
|
},
|
|
215
|
-
[
|
|
216
|
-
),
|
|
217
|
-
(
|
|
218
|
-
if (
|
|
219
|
-
|
|
215
|
+
[B, ut]
|
|
216
|
+
), nt = S(
|
|
217
|
+
(T) => {
|
|
218
|
+
if (x.current !== null && x.current !== T.pointerId) {
|
|
219
|
+
v.current = { pointerId: T.pointerId, clientX: T.clientX, clientY: T.clientY }, T.preventDefault(), T.stopPropagation();
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
E.current = { x:
|
|
222
|
+
T.preventDefault(), T.stopPropagation();
|
|
223
|
+
const V = m.current ?? T.currentTarget, { left: Tt, top: Yt, width: yt, height: J } = V.getBoundingClientRect();
|
|
224
|
+
E.current = { x: Tt + yt / 2, y: Yt + J / 2 }, x.current = T.pointerId;
|
|
225
225
|
try {
|
|
226
|
-
|
|
226
|
+
V.setPointerCapture(T.pointerId);
|
|
227
227
|
} catch {
|
|
228
228
|
}
|
|
229
|
-
|
|
229
|
+
Z(T.clientX, T.clientY, !0);
|
|
230
230
|
},
|
|
231
|
-
[
|
|
232
|
-
),
|
|
233
|
-
(
|
|
234
|
-
if (
|
|
235
|
-
|
|
231
|
+
[Z]
|
|
232
|
+
), pt = S(
|
|
233
|
+
(T) => {
|
|
234
|
+
if (x.current !== T.pointerId) {
|
|
235
|
+
v.current !== null && v.current.pointerId === T.pointerId && (v.current = { pointerId: T.pointerId, clientX: T.clientX, clientY: T.clientY });
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
T.preventDefault(), Z(T.clientX, T.clientY);
|
|
239
239
|
},
|
|
240
|
-
[
|
|
241
|
-
),
|
|
242
|
-
(
|
|
243
|
-
if (
|
|
244
|
-
|
|
240
|
+
[Z]
|
|
241
|
+
), Pt = S(
|
|
242
|
+
(T) => {
|
|
243
|
+
if (x.current !== T.pointerId) {
|
|
244
|
+
v.current !== null && v.current.pointerId === T.pointerId && (v.current = null);
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
ut(
|
|
251
|
-
const
|
|
252
|
-
let
|
|
253
|
-
if (
|
|
247
|
+
T.preventDefault(), T.stopPropagation();
|
|
248
|
+
const V = v.current;
|
|
249
|
+
if (v.current = null, V !== null) {
|
|
250
|
+
ut(T.pointerId);
|
|
251
|
+
const Tt = m.current;
|
|
252
|
+
let Yt = !0;
|
|
253
|
+
if (Tt !== null && typeof Tt.setPointerCapture == "function")
|
|
254
254
|
try {
|
|
255
|
-
|
|
256
|
-
} catch (
|
|
257
|
-
(typeof
|
|
255
|
+
Tt.setPointerCapture(V.pointerId);
|
|
256
|
+
} catch (yt) {
|
|
257
|
+
(typeof yt == "object" && yt !== null && "name" in yt ? yt.name : void 0) === "NotFoundError" && (Yt = !1);
|
|
258
258
|
}
|
|
259
|
-
if (
|
|
260
|
-
|
|
259
|
+
if (Yt) {
|
|
260
|
+
x.current = V.pointerId, Z(V.clientX, V.clientY, !0);
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
rt(!0);
|
|
265
265
|
},
|
|
266
|
-
[
|
|
266
|
+
[rt, ut, Z]
|
|
267
267
|
), D = S(
|
|
268
|
-
(
|
|
269
|
-
|
|
268
|
+
(T) => {
|
|
269
|
+
T.target === T.currentTarget && x.current === T.pointerId && rt(!1);
|
|
270
270
|
},
|
|
271
|
-
[
|
|
271
|
+
[rt]
|
|
272
272
|
);
|
|
273
|
-
|
|
273
|
+
qe(
|
|
274
274
|
c,
|
|
275
275
|
() => ({
|
|
276
276
|
reset: () => {
|
|
277
|
-
|
|
277
|
+
rt(!0);
|
|
278
278
|
},
|
|
279
|
-
getElement: () =>
|
|
279
|
+
getElement: () => m.current
|
|
280
280
|
}),
|
|
281
|
-
[
|
|
281
|
+
[rt]
|
|
282
282
|
);
|
|
283
|
-
const
|
|
283
|
+
const k = Math.min(Math.max(s, 0), 1), P = r / 64, X = Math.min(d.distance, e) / e, $ = d.direction * X * 10 * P, N = a ?? nr, lt = {
|
|
284
284
|
dragState: d,
|
|
285
|
-
normalizedDistance:
|
|
285
|
+
normalizedDistance: X,
|
|
286
286
|
sizeScale: P,
|
|
287
287
|
size: r,
|
|
288
|
-
opacity:
|
|
289
|
-
},
|
|
288
|
+
opacity: k
|
|
289
|
+
}, K = {
|
|
290
290
|
...i,
|
|
291
291
|
width: r,
|
|
292
292
|
height: r,
|
|
293
|
-
transform: `translateY(${
|
|
293
|
+
transform: `translateY(${$}px)`
|
|
294
294
|
};
|
|
295
|
-
return
|
|
295
|
+
return K.opacity = k, /* @__PURE__ */ ot(
|
|
296
296
|
"div",
|
|
297
297
|
{
|
|
298
|
-
ref:
|
|
298
|
+
ref: m,
|
|
299
299
|
"data-testid": "virtual-scroll-tap-circle",
|
|
300
|
-
className:
|
|
301
|
-
style:
|
|
300
|
+
className: pe("aqvs-tap-scroll-circle", t),
|
|
301
|
+
style: K,
|
|
302
302
|
tabIndex: -1,
|
|
303
|
-
onPointerDown:
|
|
304
|
-
onPointerMove:
|
|
305
|
-
onPointerUp:
|
|
306
|
-
onPointerCancel:
|
|
303
|
+
onPointerDown: nt,
|
|
304
|
+
onPointerMove: pt,
|
|
305
|
+
onPointerUp: Pt,
|
|
306
|
+
onPointerCancel: Pt,
|
|
307
307
|
onLostPointerCapture: D,
|
|
308
308
|
role: "presentation",
|
|
309
|
-
children:
|
|
309
|
+
children: N(lt)
|
|
310
310
|
}
|
|
311
311
|
);
|
|
312
312
|
})
|
|
313
313
|
);
|
|
314
|
-
|
|
315
|
-
const
|
|
314
|
+
Ze.displayName = "TapScrollCircle";
|
|
315
|
+
const vt = (n, t, e) => Math.max(t, Math.min(e, n)), Ye = "virtualscroll:tap-scroll-cancel", Xe = 20, ir = 250, sr = 60, or = 20, ar = 20, Je = {
|
|
316
316
|
/** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
|
|
317
317
|
maxDistance: 240,
|
|
318
318
|
/** 最小速度倍率 (ビューポート比)。 */
|
|
319
319
|
minSpeedMultiplier: 0.2
|
|
320
|
-
},
|
|
320
|
+
}, lr = Je.maxDistance, $e = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, ke = 2.2, cr = 8, ur = 120, dr = 1 / 10, Zt = {
|
|
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: lr,
|
|
327
|
+
minSpeedMultiplier: Je.minSpeedMultiplier,
|
|
328
328
|
opacity: 0.9,
|
|
329
329
|
renderVisual: void 0,
|
|
330
330
|
maxSpeedCurve: void 0
|
|
331
|
-
},
|
|
331
|
+
}, fr = (n) => n ? {
|
|
332
332
|
mainSizeKey: "width",
|
|
333
333
|
crossSizeKey: "height",
|
|
334
334
|
positionKey: "left",
|
|
@@ -348,512 +348,512 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
348
348
|
arrowIcons: ["▲", "▼"],
|
|
349
349
|
directionClass: "aqvs-scrollbar-vertical",
|
|
350
350
|
orientation: "vertical"
|
|
351
|
-
},
|
|
352
|
-
const e = n?.maxSpeedMultiplier, r = typeof e == "number" ? e :
|
|
351
|
+
}, mr = (n, t) => {
|
|
352
|
+
const e = n?.maxSpeedMultiplier, r = typeof e == "number" ? e : xr(t);
|
|
353
353
|
return {
|
|
354
|
-
enabled: n?.enabled ??
|
|
355
|
-
size: n?.size ??
|
|
356
|
-
offsetX: n?.offsetX ??
|
|
357
|
-
offsetY: n?.offsetY ??
|
|
358
|
-
className: n?.className ??
|
|
359
|
-
maxVisualDistance: n?.maxVisualDistance ??
|
|
354
|
+
enabled: n?.enabled ?? Zt.enabled,
|
|
355
|
+
size: n?.size ?? Zt.size,
|
|
356
|
+
offsetX: n?.offsetX ?? Zt.offsetX,
|
|
357
|
+
offsetY: n?.offsetY ?? Zt.offsetY,
|
|
358
|
+
className: n?.className ?? Zt.className,
|
|
359
|
+
maxVisualDistance: n?.maxVisualDistance ?? Zt.maxVisualDistance,
|
|
360
360
|
maxSpeedMultiplier: r,
|
|
361
|
-
minSpeedMultiplier: Math.max(n?.minSpeedMultiplier ??
|
|
362
|
-
opacity:
|
|
363
|
-
renderVisual: n?.renderVisual ??
|
|
364
|
-
maxSpeedCurve: n?.maxSpeedCurve ??
|
|
361
|
+
minSpeedMultiplier: Math.max(n?.minSpeedMultiplier ?? Zt.minSpeedMultiplier, 0),
|
|
362
|
+
opacity: vt(n?.opacity ?? Zt.opacity, 0, 1),
|
|
363
|
+
renderVisual: n?.renderVisual ?? Zt.renderVisual,
|
|
364
|
+
maxSpeedCurve: n?.maxSpeedCurve ?? Zt.maxSpeedCurve
|
|
365
365
|
};
|
|
366
|
-
},
|
|
367
|
-
const i =
|
|
368
|
-
i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null),
|
|
366
|
+
}, pr = ({ isDragging: n, isThumbHovered: t, enableThumbDrag: e }) => Lt(() => e ? n ? "dragging" : t ? "hover" : "idle" : "disabled", [e, n, t]), hr = ({ canUseArrowButtons: n, enableArrowButtons: t, resetTapScroll: e, scrollByStep: r }) => {
|
|
367
|
+
const i = I(null), s = I(null), a = I(null), c = S(() => {
|
|
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
|
}, []), d = S(() => {
|
|
370
370
|
c();
|
|
371
|
-
}, [c]),
|
|
372
|
-
(
|
|
371
|
+
}, [c]), b = S(
|
|
372
|
+
(v) => (E) => {
|
|
373
373
|
if (!n)
|
|
374
374
|
return;
|
|
375
|
-
E.cancelable && E.preventDefault(), E.stopPropagation(), e(), c(), r(
|
|
375
|
+
E.cancelable && E.preventDefault(), E.stopPropagation(), e(), c(), r(v), s.current = window.setTimeout(() => {
|
|
376
376
|
i.current = window.setInterval(() => {
|
|
377
|
-
r(
|
|
378
|
-
},
|
|
379
|
-
},
|
|
380
|
-
const
|
|
381
|
-
|
|
377
|
+
r(v);
|
|
378
|
+
}, sr);
|
|
379
|
+
}, ir);
|
|
380
|
+
const m = () => c();
|
|
381
|
+
a.current = m, window.addEventListener("pointerup", m), window.addEventListener("pointercancel", m), window.addEventListener("blur", m);
|
|
382
382
|
},
|
|
383
383
|
[n, c, e, r]
|
|
384
|
-
),
|
|
385
|
-
(
|
|
386
|
-
t && (E.key === "Enter" || E.key === " " || E.key === "Spacebar") && (E.preventDefault(), r(
|
|
384
|
+
), x = S(
|
|
385
|
+
(v) => (E) => {
|
|
386
|
+
t && (E.key === "Enter" || E.key === " " || E.key === "Spacebar") && (E.preventDefault(), r(v));
|
|
387
387
|
},
|
|
388
388
|
[t, r]
|
|
389
389
|
);
|
|
390
|
-
return
|
|
390
|
+
return q(() => {
|
|
391
391
|
n || c();
|
|
392
|
-
}, [n, c]),
|
|
392
|
+
}, [n, c]), q(() => () => {
|
|
393
393
|
c();
|
|
394
|
-
}, [c]), { handleArrowPointerDown:
|
|
395
|
-
},
|
|
396
|
-
const c = Math.max(
|
|
397
|
-
let
|
|
398
|
-
if (
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
|
|
394
|
+
}, [c]), { handleArrowPointerDown: b, handleArrowPointerUp: d, handleArrowKeyDown: x };
|
|
395
|
+
}, gr = 700, fe = (n, t) => typeof n == "number" && Number.isFinite(n) ? n : t, br = ({ distance: n, maxDistance: t, viewportSize: e, minSpeedMultiplier: r, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
|
|
396
|
+
const c = Math.max(fe(n, 0), 0), d = fe(t, 0), b = d > 0 ? Math.min(c, d) / d : 1, x = Math.max(fe(e, 0), 0), v = Math.max(fe(r, 0), 0), E = Math.max(fe(i, 0), 0), m = Math.max(x * v, 40), _ = s ? m : 1200, B = Math.max(x * E, _), Z = a ? Math.max(fe(a.exponentialScale, E), 0) : 0, ut = a ? Math.min(B, Math.max(x * Z, m)) : B, rt = Math.max(ut, m);
|
|
397
|
+
let nt = b ** 1.1;
|
|
398
|
+
if (a) {
|
|
399
|
+
const Pt = Math.min(Math.max(fe(a.exponentialSteepness, 0), 0), gr);
|
|
400
|
+
if (Pt === 0)
|
|
401
|
+
nt = b;
|
|
402
402
|
else {
|
|
403
|
-
const D = Math.expm1(
|
|
404
|
-
|
|
403
|
+
const D = Math.expm1(Pt) || 1;
|
|
404
|
+
nt = Math.min(Math.max(Math.expm1(Pt * b) / D, 0), 1);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
const
|
|
408
|
-
return
|
|
409
|
-
},
|
|
407
|
+
const pt = Math.min(Math.max(fe(a?.easedOffset, 0), 0), 1);
|
|
408
|
+
return m + (rt - m) * (pt + (1 - pt) * nt);
|
|
409
|
+
}, xr = (n) => {
|
|
410
410
|
if (!n || n <= 0)
|
|
411
|
-
return
|
|
412
|
-
const t = Math.max(1, n), e = Math.log10(t), r =
|
|
413
|
-
return
|
|
414
|
-
},
|
|
411
|
+
return ke;
|
|
412
|
+
const t = Math.max(1, n), e = Math.log10(t), r = ke + e * cr;
|
|
413
|
+
return vt(r, ke, ur);
|
|
414
|
+
}, Ir = ({
|
|
415
415
|
contentSize: n,
|
|
416
416
|
viewportSize: t,
|
|
417
417
|
scrollPosition: e,
|
|
418
418
|
onScroll: r,
|
|
419
419
|
enableThumbDrag: i = !0,
|
|
420
420
|
enableTrackClick: s = !0,
|
|
421
|
-
enableArrowButtons:
|
|
421
|
+
enableArrowButtons: a = !0,
|
|
422
422
|
horizontal: c = !1,
|
|
423
423
|
scrollBarWidth: d = 12,
|
|
424
|
-
className:
|
|
425
|
-
ariaControls:
|
|
426
|
-
tapScrollCircleOptions:
|
|
424
|
+
className: b,
|
|
425
|
+
ariaControls: x,
|
|
426
|
+
tapScrollCircleOptions: v,
|
|
427
427
|
itemCount: E,
|
|
428
|
-
renderThumbOverlay:
|
|
428
|
+
renderThumbOverlay: m,
|
|
429
429
|
visibleStartIndex: _,
|
|
430
|
-
visibleEndIndex:
|
|
430
|
+
visibleEndIndex: B
|
|
431
431
|
}) => {
|
|
432
|
-
const [
|
|
432
|
+
const [Z, ut] = Jt(!1), [rt, nt] = Jt(!1), [pt, Pt] = Jt(!1), D = I(null), k = I({
|
|
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
|
-
}), P =
|
|
440
|
-
enabled:
|
|
441
|
-
size:
|
|
442
|
-
offsetX:
|
|
443
|
-
offsetY:
|
|
444
|
-
className:
|
|
445
|
-
maxVisualDistance:
|
|
446
|
-
maxSpeedMultiplier:
|
|
447
|
-
minSpeedMultiplier:
|
|
448
|
-
opacity:
|
|
449
|
-
renderVisual:
|
|
450
|
-
maxSpeedCurve:
|
|
451
|
-
} =
|
|
439
|
+
}), P = I({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), X = I(e), $ = I(r), N = I($e), lt = I(null), K = I(null), T = I(null), V = I(0), Tt = I(0), Yt = Lt(() => mr(v, E), [E, v]), yt = Lt(() => fr(c), [c]), {
|
|
440
|
+
enabled: J,
|
|
441
|
+
size: F,
|
|
442
|
+
offsetX: Ct,
|
|
443
|
+
offsetY: W,
|
|
444
|
+
className: At,
|
|
445
|
+
maxVisualDistance: y,
|
|
446
|
+
maxSpeedMultiplier: Kt,
|
|
447
|
+
minSpeedMultiplier: ae,
|
|
448
|
+
opacity: A,
|
|
449
|
+
renderVisual: j,
|
|
450
|
+
maxSpeedCurve: Bt
|
|
451
|
+
} = Yt, _t = I({
|
|
452
452
|
viewportSize: t,
|
|
453
453
|
maxScrollPosition: Math.max(n - t, 0),
|
|
454
454
|
scrollBarVisible: n > t,
|
|
455
|
-
effectiveTapMaxDistance: Math.max(
|
|
456
|
-
tapCircleMaxSpeedMultiplier:
|
|
457
|
-
tapCircleMinSpeedMultiplier:
|
|
458
|
-
tapCircleMaxSpeedCurve:
|
|
459
|
-
tapScrollCircleOptions:
|
|
455
|
+
effectiveTapMaxDistance: Math.max(y, 1),
|
|
456
|
+
tapCircleMaxSpeedMultiplier: Kt,
|
|
457
|
+
tapCircleMinSpeedMultiplier: ae,
|
|
458
|
+
tapCircleMaxSpeedCurve: Bt,
|
|
459
|
+
tapScrollCircleOptions: v,
|
|
460
460
|
effectiveTrackLength: 0,
|
|
461
461
|
onScroll: r,
|
|
462
462
|
scrollPosition: e
|
|
463
|
-
}), { mainSizeKey:
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
}), { mainSizeKey: Et, crossSizeKey: Xt, positionKey: dt, selectDelta: p, getPointerCoordinate: ft, arrowLabels: mt, arrowIcons: z, directionClass: et, orientation: ct } = yt, kt = Math.max(y, 1), Ot = t / n, Mt = Math.max(t - d * 2, 0), it = Ot * Mt, ht = Math.min(Math.max(Xe, it || 0), Mt || Xe), st = n - t, Q = Math.max(Mt - ht, 0), qt = st <= 0 || Q <= 0 ? 0 : vt(e / st * Q, 0, Q), le = qt + ht / 2, Nt = n > t || Z, $t = Nt && a;
|
|
464
|
+
Te(() => {
|
|
465
|
+
_t.current = {
|
|
466
466
|
viewportSize: t,
|
|
467
|
-
maxScrollPosition:
|
|
468
|
-
scrollBarVisible:
|
|
469
|
-
effectiveTapMaxDistance:
|
|
470
|
-
tapCircleMaxSpeedMultiplier:
|
|
471
|
-
tapCircleMinSpeedMultiplier:
|
|
472
|
-
tapCircleMaxSpeedCurve:
|
|
473
|
-
tapScrollCircleOptions:
|
|
474
|
-
effectiveTrackLength:
|
|
467
|
+
maxScrollPosition: st,
|
|
468
|
+
scrollBarVisible: Nt,
|
|
469
|
+
effectiveTapMaxDistance: kt,
|
|
470
|
+
tapCircleMaxSpeedMultiplier: Kt,
|
|
471
|
+
tapCircleMinSpeedMultiplier: ae,
|
|
472
|
+
tapCircleMaxSpeedCurve: Bt,
|
|
473
|
+
tapScrollCircleOptions: v,
|
|
474
|
+
effectiveTrackLength: Q,
|
|
475
475
|
onScroll: r,
|
|
476
476
|
scrollPosition: e
|
|
477
477
|
};
|
|
478
|
-
}),
|
|
479
|
-
|
|
480
|
-
}, [e]),
|
|
481
|
-
|
|
482
|
-
}, [r]),
|
|
483
|
-
i ||
|
|
478
|
+
}), Te(() => {
|
|
479
|
+
X.current = e;
|
|
480
|
+
}, [e]), Te(() => {
|
|
481
|
+
$.current = r;
|
|
482
|
+
}, [r]), q(() => {
|
|
483
|
+
i || nt(!1);
|
|
484
484
|
}, [i]);
|
|
485
|
-
const
|
|
486
|
-
const
|
|
487
|
-
if (
|
|
488
|
-
const
|
|
489
|
-
if (typeof
|
|
490
|
-
return
|
|
485
|
+
const Gt = pr({ isDragging: Z, isThumbHovered: rt, enableThumbDrag: i }), Vt = S((o, g) => {
|
|
486
|
+
const M = _t.current, L = g ?? X.current;
|
|
487
|
+
if ($.current) {
|
|
488
|
+
const u = $.current(o, L);
|
|
489
|
+
if (typeof u == "number" && Number.isFinite(u))
|
|
490
|
+
return X.current = u, u;
|
|
491
491
|
}
|
|
492
|
-
const
|
|
493
|
-
return
|
|
494
|
-
}, []),
|
|
495
|
-
(
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
498
|
-
const
|
|
499
|
-
return { nextPosition:
|
|
492
|
+
const H = typeof o == "function" ? o(L) : o, St = Math.max(M.maxScrollPosition, 0), l = M.scrollBarVisible ? vt(H, 0, St) : 0;
|
|
493
|
+
return X.current = l, l;
|
|
494
|
+
}, []), f = S(
|
|
495
|
+
(o) => {
|
|
496
|
+
const g = _t.current, M = X.current;
|
|
497
|
+
if (!g.scrollBarVisible || g.maxScrollPosition <= 0) {
|
|
498
|
+
const R = Vt(0, M), O = R - M;
|
|
499
|
+
return { nextPosition: R, actualDelta: O, reachedBoundary: !0 };
|
|
500
500
|
}
|
|
501
|
-
if (
|
|
502
|
-
return { nextPosition:
|
|
503
|
-
const
|
|
504
|
-
return { nextPosition:
|
|
501
|
+
if (o === 0)
|
|
502
|
+
return { nextPosition: M, actualDelta: 0, reachedBoundary: !1 };
|
|
503
|
+
const H = Vt((R) => vt(R + o, 0, g.maxScrollPosition), M), St = H - M, l = o < 0 && M + o <= 0, u = o > 0 && M + o >= g.maxScrollPosition, h = o < 0 && (H <= 0 || l && St === 0) || o > 0 && (H >= g.maxScrollPosition || u && St === 0);
|
|
504
|
+
return { nextPosition: H, actualDelta: St, reachedBoundary: h };
|
|
505
505
|
},
|
|
506
|
-
[
|
|
507
|
-
),
|
|
508
|
-
(
|
|
509
|
-
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
const L =
|
|
513
|
-
return
|
|
506
|
+
[Vt]
|
|
507
|
+
), w = S(
|
|
508
|
+
(o, g) => {
|
|
509
|
+
o.current += g;
|
|
510
|
+
const M = Math.max(_t.current.maxScrollPosition, 0);
|
|
511
|
+
M > 0 && (o.current = vt(o.current, -M, M));
|
|
512
|
+
const L = f(o.current);
|
|
513
|
+
return o.current -= L.actualDelta, L.reachedBoundary && (o.current = 0), L;
|
|
514
514
|
},
|
|
515
|
-
[
|
|
516
|
-
),
|
|
517
|
-
|
|
518
|
-
}, []),
|
|
519
|
-
|
|
520
|
-
}, [
|
|
521
|
-
(
|
|
522
|
-
const
|
|
523
|
-
if (!
|
|
524
|
-
|
|
515
|
+
[f]
|
|
516
|
+
), at = S(() => {
|
|
517
|
+
K.current !== null && (window.cancelAnimationFrame(K.current), K.current = null), T.current = null, V.current = 0, Tt.current = 0;
|
|
518
|
+
}, []), gt = S(() => {
|
|
519
|
+
N.current = { ...$e }, Pt(!1), lt.current?.reset(), at();
|
|
520
|
+
}, [at]), wt = S(
|
|
521
|
+
(o) => {
|
|
522
|
+
const g = N.current, M = _t.current;
|
|
523
|
+
if (!g.active || g.direction === 0) {
|
|
524
|
+
at();
|
|
525
525
|
return;
|
|
526
526
|
}
|
|
527
|
-
if (!
|
|
528
|
-
|
|
527
|
+
if (!M.scrollBarVisible || M.maxScrollPosition <= 0) {
|
|
528
|
+
at();
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
const L =
|
|
532
|
-
if (
|
|
533
|
-
|
|
531
|
+
const L = T.current ?? o, H = Math.max((o - L) / 1e3, 0), St = Math.min(H, dr);
|
|
532
|
+
if (T.current = o, St <= 0) {
|
|
533
|
+
K.current = window.requestAnimationFrame(wt);
|
|
534
534
|
return;
|
|
535
535
|
}
|
|
536
|
-
const
|
|
537
|
-
distance:
|
|
538
|
-
maxDistance:
|
|
539
|
-
viewportSize:
|
|
540
|
-
minSpeedMultiplier:
|
|
541
|
-
maxSpeedMultiplier:
|
|
542
|
-
hasCustomMaxSpeedMultiplier: typeof
|
|
543
|
-
curve:
|
|
536
|
+
const l = br({
|
|
537
|
+
distance: g.distance,
|
|
538
|
+
maxDistance: M.effectiveTapMaxDistance,
|
|
539
|
+
viewportSize: M.viewportSize,
|
|
540
|
+
minSpeedMultiplier: M.tapCircleMinSpeedMultiplier,
|
|
541
|
+
maxSpeedMultiplier: M.tapCircleMaxSpeedMultiplier,
|
|
542
|
+
hasCustomMaxSpeedMultiplier: typeof M.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
|
|
543
|
+
curve: M.tapCircleMaxSpeedCurve
|
|
544
544
|
});
|
|
545
|
-
|
|
546
|
-
const { reachedBoundary:
|
|
547
|
-
if (
|
|
548
|
-
|
|
545
|
+
Tt.current !== g.direction && (Tt.current = g.direction, V.current = 0);
|
|
546
|
+
const { reachedBoundary: u } = w(V, g.direction * l * St);
|
|
547
|
+
if (u) {
|
|
548
|
+
at();
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
-
|
|
551
|
+
K.current = window.requestAnimationFrame(wt);
|
|
552
552
|
},
|
|
553
|
-
[
|
|
554
|
-
),
|
|
555
|
-
|
|
556
|
-
}, [
|
|
557
|
-
|
|
558
|
-
const
|
|
559
|
-
!
|
|
560
|
-
}, [n, t,
|
|
561
|
-
|
|
562
|
-
}, [
|
|
563
|
-
const
|
|
564
|
-
(
|
|
565
|
-
|
|
553
|
+
[w, at]
|
|
554
|
+
), Qt = S(() => {
|
|
555
|
+
K.current === null && (T.current = null, V.current = 0, K.current = window.requestAnimationFrame(wt));
|
|
556
|
+
}, [wt]);
|
|
557
|
+
q(() => {
|
|
558
|
+
const o = N.current;
|
|
559
|
+
!o.active || o.direction === 0 || Qt();
|
|
560
|
+
}, [n, t, Qt]), q(() => () => {
|
|
561
|
+
at();
|
|
562
|
+
}, [at]);
|
|
563
|
+
const Ht = S(
|
|
564
|
+
(o) => {
|
|
565
|
+
N.current = o, Pt(o.active), o.active && o.direction !== 0 ? Qt() : at();
|
|
566
566
|
},
|
|
567
|
-
[
|
|
567
|
+
[Qt, at]
|
|
568
568
|
);
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}, [
|
|
572
|
-
const
|
|
573
|
-
const L =
|
|
574
|
-
L &&
|
|
569
|
+
q(() => {
|
|
570
|
+
J || gt();
|
|
571
|
+
}, [gt, J]), q(() => {
|
|
572
|
+
const o = (g) => {
|
|
573
|
+
const L = g.detail?.paneId;
|
|
574
|
+
L && x && L !== x || gt();
|
|
575
575
|
};
|
|
576
|
-
return window.addEventListener(
|
|
577
|
-
window.removeEventListener(
|
|
576
|
+
return window.addEventListener(Ye, o), () => {
|
|
577
|
+
window.removeEventListener(Ye, o);
|
|
578
578
|
};
|
|
579
|
-
}, [
|
|
580
|
-
if (!
|
|
579
|
+
}, [x, gt]), q(() => {
|
|
580
|
+
if (!J)
|
|
581
581
|
return;
|
|
582
|
-
const
|
|
583
|
-
if (!
|
|
582
|
+
const o = (g) => {
|
|
583
|
+
if (!N.current.active || N.current.pointerId === g.pointerId)
|
|
584
584
|
return;
|
|
585
|
-
const
|
|
586
|
-
if (!(
|
|
587
|
-
|
|
585
|
+
const M = g.target;
|
|
586
|
+
if (!(M instanceof Node)) {
|
|
587
|
+
gt();
|
|
588
588
|
return;
|
|
589
589
|
}
|
|
590
|
-
|
|
590
|
+
lt.current?.getElement()?.contains(M) || gt();
|
|
591
591
|
};
|
|
592
|
-
return document.addEventListener("pointerdown",
|
|
593
|
-
document.removeEventListener("pointerdown",
|
|
592
|
+
return document.addEventListener("pointerdown", o, !0), () => {
|
|
593
|
+
document.removeEventListener("pointerdown", o, !0);
|
|
594
594
|
};
|
|
595
|
-
}, [
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
595
|
+
}, [gt, J]);
|
|
596
|
+
const Ut = (o) => {
|
|
597
|
+
if (!Nt || Q <= 0 || st <= 0)
|
|
598
598
|
return 0;
|
|
599
|
-
const
|
|
600
|
-
return
|
|
601
|
-
},
|
|
602
|
-
const { scrollBarVisible:
|
|
603
|
-
if (C.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos:
|
|
599
|
+
const g = vt(o, 0, Q);
|
|
600
|
+
return vt(g / Q * st, 0, st);
|
|
601
|
+
}, te = S((o) => {
|
|
602
|
+
const { scrollBarVisible: g, effectiveTrackLength: M, maxScrollPosition: L } = _t.current;
|
|
603
|
+
if (C.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: o, trackLen: M, maxScroll: L })), M <= 0 || L <= 0)
|
|
604
604
|
return null;
|
|
605
|
-
const
|
|
606
|
-
return
|
|
607
|
-
}, []),
|
|
608
|
-
(
|
|
609
|
-
const
|
|
610
|
-
const
|
|
611
|
-
return Number.isFinite(
|
|
612
|
-
},
|
|
613
|
-
return
|
|
605
|
+
const H = vt(o, 0, M);
|
|
606
|
+
return vt(H / M * L, 0, L);
|
|
607
|
+
}, []), ce = S(
|
|
608
|
+
(o) => {
|
|
609
|
+
const g = o.getBoundingClientRect(), M = c ? g.width : g.height, L = (h) => {
|
|
610
|
+
const R = Number.parseFloat(h);
|
|
611
|
+
return Number.isFinite(R) ? R : 0;
|
|
612
|
+
}, H = window.getComputedStyle(o), St = L(c ? H.width : H.height), l = St > 0 ? St + L(c ? H.paddingLeft : H.paddingTop) + L(c ? H.paddingRight : H.paddingBottom) + L(c ? H.borderLeftWidth : H.borderTopWidth) + L(c ? H.borderRightWidth : H.borderBottomWidth) : 0, u = l > 0 ? l : c ? o.offsetWidth : o.offsetHeight;
|
|
613
|
+
return u <= 0 || M <= 0 ? 1 : M / u;
|
|
614
614
|
},
|
|
615
615
|
[c]
|
|
616
|
-
),
|
|
617
|
-
(
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
616
|
+
), ue = S(
|
|
617
|
+
(o) => {
|
|
618
|
+
const g = k.current;
|
|
619
|
+
if (g.pointerId !== o.pointerId)
|
|
620
620
|
return;
|
|
621
|
-
const
|
|
621
|
+
const M = o.clientX - g.startClientX, L = o.clientY - g.startClientY, H = p(M, L) / (g.scale || 1);
|
|
622
622
|
C.debug("[ScrollBar] handleThumbPointerMove", () => ({
|
|
623
|
-
delta:
|
|
624
|
-
startThumbPosition:
|
|
625
|
-
clientY:
|
|
626
|
-
startClientY:
|
|
627
|
-
metrics:
|
|
623
|
+
delta: H,
|
|
624
|
+
startThumbPosition: g.startThumbPosition,
|
|
625
|
+
clientY: o.clientY,
|
|
626
|
+
startClientY: g.startClientY,
|
|
627
|
+
metrics: _t.current
|
|
628
628
|
}));
|
|
629
|
-
const
|
|
630
|
-
|
|
629
|
+
const St = te(g.startThumbPosition + H);
|
|
630
|
+
St !== null && Vt(St), o.cancelable && o.preventDefault();
|
|
631
631
|
},
|
|
632
|
-
[
|
|
633
|
-
),
|
|
634
|
-
(
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
632
|
+
[p, te, Vt]
|
|
633
|
+
), tt = S(
|
|
634
|
+
(o) => {
|
|
635
|
+
const g = k.current;
|
|
636
|
+
if (g.pointerId !== o.pointerId)
|
|
637
637
|
return;
|
|
638
|
-
document.removeEventListener("pointermove",
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
638
|
+
document.removeEventListener("pointermove", ue), document.removeEventListener("pointerup", tt), document.removeEventListener("pointercancel", tt);
|
|
639
|
+
const M = g.captureTarget;
|
|
640
|
+
if (M?.hasPointerCapture?.(o.pointerId) && M.releasePointerCapture(o.pointerId), k.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ut(!1), D.current) {
|
|
641
641
|
const L = D.current.getBoundingClientRect();
|
|
642
|
-
|
|
642
|
+
o.clientX >= L.left && o.clientX <= L.right && o.clientY >= L.top && o.clientY <= L.bottom || nt(!1);
|
|
643
643
|
} else
|
|
644
|
-
|
|
644
|
+
nt(!1);
|
|
645
645
|
},
|
|
646
|
-
[
|
|
646
|
+
[ue]
|
|
647
647
|
);
|
|
648
|
-
|
|
649
|
-
document.removeEventListener("pointermove",
|
|
650
|
-
}, [
|
|
651
|
-
const
|
|
652
|
-
(
|
|
653
|
-
const
|
|
654
|
-
|
|
648
|
+
q(() => () => {
|
|
649
|
+
document.removeEventListener("pointermove", ue), document.removeEventListener("pointerup", tt), document.removeEventListener("pointercancel", tt);
|
|
650
|
+
}, [ue, tt]);
|
|
651
|
+
const ee = I(0), Se = I(0), we = S(
|
|
652
|
+
(o) => {
|
|
653
|
+
const g = Math.max(Math.round(_t.current.viewportSize / ar), or);
|
|
654
|
+
Se.current !== o && (Se.current = o, ee.current = 0), w(ee, o * g);
|
|
655
655
|
},
|
|
656
|
-
[
|
|
657
|
-
), { handleArrowPointerDown:
|
|
658
|
-
canUseArrowButtons:
|
|
659
|
-
enableArrowButtons:
|
|
660
|
-
resetTapScroll:
|
|
661
|
-
scrollByStep:
|
|
662
|
-
}),
|
|
663
|
-
if (!
|
|
656
|
+
[w]
|
|
657
|
+
), { handleArrowPointerDown: Wt, handleArrowPointerUp: ge, handleArrowKeyDown: Re } = hr({
|
|
658
|
+
canUseArrowButtons: $t,
|
|
659
|
+
enableArrowButtons: a,
|
|
660
|
+
resetTapScroll: gt,
|
|
661
|
+
scrollByStep: we
|
|
662
|
+
}), De = (o) => {
|
|
663
|
+
if (!Nt)
|
|
664
664
|
return;
|
|
665
665
|
if (!i) {
|
|
666
|
-
|
|
666
|
+
o.preventDefault(), o.stopPropagation();
|
|
667
667
|
return;
|
|
668
668
|
}
|
|
669
|
-
if (
|
|
669
|
+
if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
|
|
670
670
|
return;
|
|
671
|
-
|
|
672
|
-
const
|
|
671
|
+
gt();
|
|
672
|
+
const g = o.currentTarget, M = ce(g);
|
|
673
673
|
let L = null;
|
|
674
|
-
if (
|
|
674
|
+
if (g.setPointerCapture)
|
|
675
675
|
try {
|
|
676
|
-
|
|
676
|
+
g.setPointerCapture(o.pointerId), L = g;
|
|
677
677
|
} catch {
|
|
678
678
|
L = null;
|
|
679
679
|
}
|
|
680
|
-
|
|
681
|
-
pointerId:
|
|
682
|
-
startThumbPosition:
|
|
683
|
-
startClientX:
|
|
684
|
-
startClientY:
|
|
685
|
-
scale:
|
|
680
|
+
k.current = {
|
|
681
|
+
pointerId: o.pointerId,
|
|
682
|
+
startThumbPosition: qt,
|
|
683
|
+
startClientX: o.clientX,
|
|
684
|
+
startClientY: o.clientY,
|
|
685
|
+
scale: M,
|
|
686
686
|
captureTarget: L
|
|
687
|
-
}, document.addEventListener("pointermove",
|
|
688
|
-
},
|
|
689
|
-
if (!
|
|
687
|
+
}, document.addEventListener("pointermove", ue), document.addEventListener("pointerup", tt), document.addEventListener("pointercancel", tt), ut(!0), nt(!0), o.preventDefault(), o.stopPropagation();
|
|
688
|
+
}, re = (o) => {
|
|
689
|
+
if (!Nt)
|
|
690
690
|
return;
|
|
691
691
|
if (!s) {
|
|
692
|
-
|
|
692
|
+
o.preventDefault(), o.stopPropagation();
|
|
693
693
|
return;
|
|
694
694
|
}
|
|
695
|
-
if (
|
|
695
|
+
if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
|
|
696
696
|
return;
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
697
|
+
const g = o.currentTarget, M = g.getBoundingClientRect(), L = ft(o), H = ce(g), St = (L - (c ? M.left : M.top)) / H;
|
|
698
|
+
gt();
|
|
699
|
+
const l = St - ht / 2, u = Ut(l);
|
|
700
|
+
if (Vt(u), g.setPointerCapture)
|
|
701
701
|
try {
|
|
702
|
-
|
|
702
|
+
g.setPointerCapture(o.pointerId);
|
|
703
703
|
} catch {
|
|
704
704
|
}
|
|
705
705
|
P.current = {
|
|
706
|
-
pointerId:
|
|
707
|
-
startThumbPosition:
|
|
708
|
-
startClientX:
|
|
709
|
-
startClientY:
|
|
710
|
-
scale:
|
|
711
|
-
},
|
|
712
|
-
},
|
|
706
|
+
pointerId: o.pointerId,
|
|
707
|
+
startThumbPosition: l,
|
|
708
|
+
startClientX: o.clientX,
|
|
709
|
+
startClientY: o.clientY,
|
|
710
|
+
scale: H
|
|
711
|
+
}, o.preventDefault(), o.stopPropagation();
|
|
712
|
+
}, jt = () => {
|
|
713
713
|
P.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
|
|
714
|
-
},
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
714
|
+
}, ne = (o) => {
|
|
715
|
+
const g = P.current;
|
|
716
|
+
if (g.pointerId !== o.pointerId)
|
|
717
717
|
return;
|
|
718
|
-
if (
|
|
719
|
-
|
|
718
|
+
if (o.pointerType === "mouse" && o.buttons === 0) {
|
|
719
|
+
jt();
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
},
|
|
725
|
-
if (P.current.pointerId !==
|
|
722
|
+
const M = o.clientX - g.startClientX, L = o.clientY - g.startClientY, H = p(M, L) / (g.scale || 1), St = Ut(g.startThumbPosition + H);
|
|
723
|
+
Vt(St), o.cancelable && o.preventDefault();
|
|
724
|
+
}, ie = (o) => {
|
|
725
|
+
if (P.current.pointerId !== o.pointerId)
|
|
726
726
|
return;
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
},
|
|
730
|
-
if (P.current.pointerId !==
|
|
727
|
+
const g = o.currentTarget;
|
|
728
|
+
g.hasPointerCapture?.(o.pointerId) && g.releasePointerCapture(o.pointerId), jt(), o.preventDefault(), o.stopPropagation();
|
|
729
|
+
}, de = (o) => {
|
|
730
|
+
if (P.current.pointerId !== o.pointerId)
|
|
731
731
|
return;
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
},
|
|
735
|
-
P.current.pointerId ===
|
|
736
|
-
},
|
|
737
|
-
const
|
|
732
|
+
const g = o.currentTarget;
|
|
733
|
+
g.hasPointerCapture?.(o.pointerId) && g.releasePointerCapture(o.pointerId), jt();
|
|
734
|
+
}, be = (o) => {
|
|
735
|
+
o.target === o.currentTarget && P.current.pointerId === o.pointerId && jt();
|
|
736
|
+
}, se = Lt(() => vt((pt ? 1 : 0.8) * A, 0, 1), [pt, A]), Ce = Lt(() => {
|
|
737
|
+
const g = `calc(50% - ${F / 2}px + ${W}px)`;
|
|
738
738
|
return {
|
|
739
|
-
left:
|
|
740
|
-
top:
|
|
739
|
+
left: Ct,
|
|
740
|
+
top: g
|
|
741
741
|
};
|
|
742
|
-
}, [
|
|
742
|
+
}, [Ct, W, F]), ve = (o, g, M, L) => /* @__PURE__ */ ot(
|
|
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]: d,
|
|
750
|
+
[Xt]: d
|
|
751
751
|
},
|
|
752
|
-
"aria-label":
|
|
753
|
-
onPointerDown:
|
|
754
|
-
onPointerUp:
|
|
755
|
-
onPointerLeave:
|
|
756
|
-
onPointerCancel:
|
|
757
|
-
onKeyDown:
|
|
758
|
-
"aria-disabled": !
|
|
759
|
-
disabled:
|
|
760
|
-
children: /* @__PURE__ */
|
|
752
|
+
"aria-label": g,
|
|
753
|
+
onPointerDown: Wt(o),
|
|
754
|
+
onPointerUp: ge,
|
|
755
|
+
onPointerLeave: ge,
|
|
756
|
+
onPointerCancel: ge,
|
|
757
|
+
onKeyDown: Re(o),
|
|
758
|
+
"aria-disabled": !a,
|
|
759
|
+
disabled: !$t,
|
|
760
|
+
children: /* @__PURE__ */ ot("span", { "aria-hidden": "true", children: M })
|
|
761
761
|
},
|
|
762
762
|
L
|
|
763
|
-
),
|
|
764
|
-
orientation:
|
|
763
|
+
), Ee = m && Nt ? {
|
|
764
|
+
orientation: ct,
|
|
765
765
|
scrollPosition: e,
|
|
766
|
-
maxScrollPosition:
|
|
766
|
+
maxScrollPosition: st,
|
|
767
767
|
contentSize: n,
|
|
768
768
|
viewportSize: t,
|
|
769
|
-
thumbSize:
|
|
770
|
-
thumbPosition:
|
|
771
|
-
thumbCenter:
|
|
772
|
-
trackSize:
|
|
773
|
-
isDragging:
|
|
774
|
-
isTapScrollActive:
|
|
769
|
+
thumbSize: ht,
|
|
770
|
+
thumbPosition: qt,
|
|
771
|
+
thumbCenter: le,
|
|
772
|
+
trackSize: Mt,
|
|
773
|
+
isDragging: Z,
|
|
774
|
+
isTapScrollActive: pt,
|
|
775
775
|
visibleStartIndex: _,
|
|
776
|
-
visibleEndIndex:
|
|
776
|
+
visibleEndIndex: B
|
|
777
777
|
} : null;
|
|
778
|
-
return /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ he(
|
|
779
779
|
"div",
|
|
780
780
|
{
|
|
781
|
-
className:
|
|
781
|
+
className: pe("aqvs-scrollbar", et, !Nt && "pointer-events-none opacity-0", b),
|
|
782
782
|
style: {
|
|
783
|
-
[
|
|
784
|
-
[
|
|
783
|
+
[Et]: t,
|
|
784
|
+
[Xt]: d
|
|
785
785
|
},
|
|
786
786
|
role: "scrollbar",
|
|
787
787
|
tabIndex: -1,
|
|
788
|
-
"aria-controls":
|
|
788
|
+
"aria-controls": x,
|
|
789
789
|
"aria-valuenow": e,
|
|
790
790
|
"aria-valuemin": 0,
|
|
791
|
-
"aria-valuemax":
|
|
791
|
+
"aria-valuemax": st,
|
|
792
792
|
"aria-orientation": c ? "horizontal" : "vertical",
|
|
793
793
|
children: [
|
|
794
|
-
!c &&
|
|
795
|
-
|
|
794
|
+
!c && Nt && J && /* @__PURE__ */ ot(
|
|
795
|
+
Ze,
|
|
796
796
|
{
|
|
797
|
-
ref:
|
|
798
|
-
className:
|
|
799
|
-
size:
|
|
800
|
-
maxVisualDistance:
|
|
801
|
-
style:
|
|
802
|
-
opacity:
|
|
803
|
-
renderVisual:
|
|
804
|
-
onDragChange:
|
|
797
|
+
ref: lt,
|
|
798
|
+
className: pe("aqvs-scrollbar-tap-circle-wrapper", At),
|
|
799
|
+
size: F,
|
|
800
|
+
maxVisualDistance: kt,
|
|
801
|
+
style: Ce,
|
|
802
|
+
opacity: se,
|
|
803
|
+
renderVisual: j,
|
|
804
|
+
onDragChange: Ht
|
|
805
805
|
},
|
|
806
806
|
"tap-circle"
|
|
807
807
|
),
|
|
808
|
-
|
|
809
|
-
/* @__PURE__ */
|
|
808
|
+
ve(-1, mt[0], z[0], "arrow-start"),
|
|
809
|
+
/* @__PURE__ */ he(
|
|
810
810
|
"div",
|
|
811
811
|
{
|
|
812
812
|
className: "aqvs-scrollbar-track",
|
|
813
813
|
style: {
|
|
814
814
|
borderRadius: d / 2
|
|
815
815
|
},
|
|
816
|
-
onPointerDown:
|
|
817
|
-
onPointerMove:
|
|
818
|
-
onPointerUp:
|
|
819
|
-
onPointerCancel:
|
|
820
|
-
onLostPointerCapture:
|
|
816
|
+
onPointerDown: re,
|
|
817
|
+
onPointerMove: ne,
|
|
818
|
+
onPointerUp: ie,
|
|
819
|
+
onPointerCancel: de,
|
|
820
|
+
onLostPointerCapture: be,
|
|
821
821
|
"aria-disabled": !s,
|
|
822
822
|
children: [
|
|
823
|
-
|
|
824
|
-
/* @__PURE__ */
|
|
823
|
+
Ee && /* @__PURE__ */ ot("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: m?.(Ee) }, "overlay"),
|
|
824
|
+
/* @__PURE__ */ ot(
|
|
825
825
|
"div",
|
|
826
826
|
{
|
|
827
|
-
className:
|
|
827
|
+
className: pe("aqvs-scrollbar-thumb-wrapper", !(Nt || Z) && "pointer-events-none opacity-0"),
|
|
828
828
|
style: {
|
|
829
|
-
[
|
|
830
|
-
[dt]:
|
|
829
|
+
[Et]: ht,
|
|
830
|
+
[dt]: qt,
|
|
831
831
|
...c ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
|
|
832
832
|
},
|
|
833
|
-
onPointerDown:
|
|
833
|
+
onPointerDown: De,
|
|
834
834
|
role: "slider",
|
|
835
835
|
"aria-orientation": c ? "horizontal" : "vertical",
|
|
836
836
|
"aria-valuenow": e,
|
|
837
837
|
"aria-valuemin": 0,
|
|
838
|
-
"aria-valuemax":
|
|
838
|
+
"aria-valuemax": st,
|
|
839
839
|
"aria-disabled": !i,
|
|
840
840
|
tabIndex: -1,
|
|
841
|
-
children: /* @__PURE__ */
|
|
841
|
+
children: /* @__PURE__ */ ot(
|
|
842
842
|
"div",
|
|
843
843
|
{
|
|
844
844
|
ref: D,
|
|
845
|
-
className:
|
|
845
|
+
className: pe("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
|
|
846
846
|
"data-testid": "aqvs-scrollbar-thumb",
|
|
847
|
-
"data-thumb-state":
|
|
847
|
+
"data-thumb-state": Gt,
|
|
848
848
|
style: {
|
|
849
849
|
borderRadius: d - 1,
|
|
850
850
|
cursor: i ? "pointer" : "default"
|
|
851
851
|
},
|
|
852
852
|
onMouseEnter: () => {
|
|
853
|
-
i &&
|
|
853
|
+
i && nt(!0);
|
|
854
854
|
},
|
|
855
855
|
onMouseLeave: () => {
|
|
856
|
-
i &&
|
|
856
|
+
i && nt(!1);
|
|
857
857
|
}
|
|
858
858
|
},
|
|
859
859
|
"thumb"
|
|
@@ -865,20 +865,20 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
865
865
|
},
|
|
866
866
|
"track"
|
|
867
867
|
),
|
|
868
|
-
|
|
868
|
+
ve(1, mt[1], z[1], "arrow-end")
|
|
869
869
|
]
|
|
870
870
|
}
|
|
871
871
|
);
|
|
872
|
-
},
|
|
872
|
+
}, Tr = ["mouse", "pen", "touch"], Oe = (n, t) => !(n === "mouse" || n === "pen" || n === "touch") || t.includes(n), Sr = (n) => n === "mouse" || n === "pen", Me = {
|
|
873
873
|
maxVelocity: 6,
|
|
874
874
|
minVelocity: 0.02,
|
|
875
875
|
deceleration: 25e-4,
|
|
876
876
|
velocitySampleWindow: 90,
|
|
877
877
|
startVelocityThreshold: 0.04
|
|
878
|
-
},
|
|
878
|
+
}, Ne = (n, t, e) => {
|
|
879
879
|
for (const [r, i, s] of t)
|
|
880
880
|
e === "add" ? n.addEventListener(r, i, s) : n.removeEventListener(r, i, s);
|
|
881
|
-
},
|
|
881
|
+
}, vr = Be(
|
|
882
882
|
({
|
|
883
883
|
children: n,
|
|
884
884
|
contentSize: t,
|
|
@@ -886,180 +886,181 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
886
886
|
scrollBarWidth: r = 12,
|
|
887
887
|
enableThumbDrag: i = !0,
|
|
888
888
|
enableTrackClick: s = !0,
|
|
889
|
-
enableArrowButtons:
|
|
889
|
+
enableArrowButtons: a = !0,
|
|
890
890
|
enablePointerDrag: c = !0,
|
|
891
|
-
pointerDragInputs: d =
|
|
892
|
-
onScroll:
|
|
893
|
-
className:
|
|
894
|
-
testId:
|
|
891
|
+
pointerDragInputs: d = Tr,
|
|
892
|
+
onScroll: b,
|
|
893
|
+
className: x,
|
|
894
|
+
testId: v,
|
|
895
895
|
style: E,
|
|
896
|
-
background:
|
|
896
|
+
background: m,
|
|
897
897
|
tapScrollCircleOptions: _,
|
|
898
|
-
inertiaOptions:
|
|
899
|
-
itemCount:
|
|
898
|
+
inertiaOptions: B,
|
|
899
|
+
itemCount: Z,
|
|
900
900
|
renderThumbOverlay: ut,
|
|
901
|
-
wheelSpeedMultiplier:
|
|
902
|
-
onWheelHorizontal:
|
|
903
|
-
contentInsets:
|
|
904
|
-
visibleStartIndex:
|
|
901
|
+
wheelSpeedMultiplier: rt = 1,
|
|
902
|
+
onWheelHorizontal: nt,
|
|
903
|
+
contentInsets: pt,
|
|
904
|
+
visibleStartIndex: Pt,
|
|
905
905
|
visibleEndIndex: D,
|
|
906
|
-
renderOverlay:
|
|
907
|
-
initialScrollPosition: P = 0
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
906
|
+
renderOverlay: k,
|
|
907
|
+
initialScrollPosition: P = 0,
|
|
908
|
+
contentProps: X
|
|
909
|
+
}, $) => {
|
|
910
|
+
const N = I(Number.isFinite(P) ? Math.max(0, P) : 0), lt = I(null), K = I(null), T = I(nt);
|
|
911
|
+
q(() => {
|
|
912
|
+
T.current = nt;
|
|
913
|
+
}, [nt]);
|
|
914
|
+
const V = I({
|
|
914
915
|
frame: null,
|
|
915
916
|
velocity: 0,
|
|
916
917
|
lastTimestamp: null,
|
|
917
918
|
generation: 0
|
|
918
|
-
}),
|
|
919
|
+
}), Tt = Lt(
|
|
919
920
|
() => ({
|
|
920
|
-
maxVelocity:
|
|
921
|
-
minVelocity:
|
|
922
|
-
deceleration:
|
|
923
|
-
velocitySampleWindow:
|
|
924
|
-
startVelocityThreshold:
|
|
921
|
+
maxVelocity: B?.maxVelocity ?? Me.maxVelocity,
|
|
922
|
+
minVelocity: B?.minVelocity ?? Me.minVelocity,
|
|
923
|
+
deceleration: B?.deceleration ?? Me.deceleration,
|
|
924
|
+
velocitySampleWindow: B?.velocitySampleWindow ?? Me.velocitySampleWindow,
|
|
925
|
+
startVelocityThreshold: B?.startVelocityThreshold ?? Me.startVelocityThreshold
|
|
925
926
|
}),
|
|
926
|
-
[
|
|
927
|
-
),
|
|
928
|
-
top: Math.max(0,
|
|
929
|
-
bottom: Math.max(0,
|
|
930
|
-
}), [
|
|
927
|
+
[B]
|
|
928
|
+
), Yt = Lt(() => ({
|
|
929
|
+
top: Math.max(0, pt?.top ?? 0),
|
|
930
|
+
bottom: Math.max(0, pt?.bottom ?? 0)
|
|
931
|
+
}), [pt]);
|
|
931
932
|
C.debug("[ScrollPane] ScrollPane rendered", () => ({
|
|
932
933
|
contentSize: t,
|
|
933
934
|
viewportSize: e,
|
|
934
935
|
scrollBarWidth: r,
|
|
935
|
-
className:
|
|
936
|
+
className: x,
|
|
936
937
|
style: E,
|
|
937
938
|
tapScrollCircleOptions: _,
|
|
938
|
-
inertiaOptions:
|
|
939
|
+
inertiaOptions: B,
|
|
939
940
|
enablePointerDrag: c,
|
|
940
|
-
contentInsets:
|
|
941
|
+
contentInsets: Yt
|
|
941
942
|
}));
|
|
942
|
-
const
|
|
943
|
-
|
|
944
|
-
const
|
|
945
|
-
(
|
|
946
|
-
const { contentSize:
|
|
947
|
-
if (C.debug("[ScrollPane] scrollTo called", () => ({ newPosition:
|
|
948
|
-
return N.current !== 0 && (N.current = 0,
|
|
949
|
-
const
|
|
950
|
-
if (!Number.isFinite(
|
|
951
|
-
return C.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition:
|
|
952
|
-
const
|
|
953
|
-
return N.current !==
|
|
943
|
+
const yt = I({ contentSize: t, viewportSize: e });
|
|
944
|
+
yt.current = { contentSize: t, viewportSize: e };
|
|
945
|
+
const J = Lt(() => t > e, [t, e]), F = S(
|
|
946
|
+
(p) => {
|
|
947
|
+
const { contentSize: ft, viewportSize: mt } = yt.current, z = ft > mt, et = N.current;
|
|
948
|
+
if (C.debug("[ScrollPane] scrollTo called", () => ({ newPosition: p, contentSize: ft, viewportSize: mt, currentIsScrollable: z, prevPosition: et })), !z)
|
|
949
|
+
return N.current !== 0 && (N.current = 0, b?.(0, et)), N.current;
|
|
950
|
+
const ct = typeof p == "function" ? p(N.current) : p;
|
|
951
|
+
if (!Number.isFinite(ct))
|
|
952
|
+
return C.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: ct }), N.current;
|
|
953
|
+
const kt = Math.max(ft - mt, 0), Ot = vt(ct, 0, kt);
|
|
954
|
+
return N.current !== Ot && (N.current = Ot, b?.(Ot, et)), N.current;
|
|
954
955
|
},
|
|
955
|
-
[
|
|
956
|
-
), Ct =
|
|
957
|
-
|
|
958
|
-
Ct.current =
|
|
959
|
-
}, [
|
|
960
|
-
const
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
}, []),
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
}, [
|
|
967
|
-
|
|
956
|
+
[b]
|
|
957
|
+
), Ct = I(F);
|
|
958
|
+
q(() => {
|
|
959
|
+
Ct.current = F;
|
|
960
|
+
}, [F]);
|
|
961
|
+
const W = S(() => {
|
|
962
|
+
const p = V.current;
|
|
963
|
+
p.generation += 1, p.frame !== null && cancelAnimationFrame(p.frame), p.frame = null, p.velocity = 0, p.lastTimestamp = null;
|
|
964
|
+
}, []), At = I(W);
|
|
965
|
+
q(() => {
|
|
966
|
+
At.current = W;
|
|
967
|
+
}, [W]), q(() => () => {
|
|
968
|
+
At.current();
|
|
968
969
|
}, []);
|
|
969
970
|
const y = S(
|
|
970
|
-
(
|
|
971
|
-
if (!
|
|
971
|
+
(p) => {
|
|
972
|
+
if (!J)
|
|
972
973
|
return;
|
|
973
|
-
const { maxVelocity:
|
|
974
|
-
if (Math.abs(
|
|
974
|
+
const { maxVelocity: ft, minVelocity: mt, deceleration: z, startVelocityThreshold: et } = Tt, ct = vt(p, -ft, ft);
|
|
975
|
+
if (Math.abs(ct) < et)
|
|
975
976
|
return;
|
|
976
|
-
|
|
977
|
-
const
|
|
978
|
-
const
|
|
979
|
-
if (
|
|
977
|
+
W(), V.current.velocity = ct, V.current.lastTimestamp = null;
|
|
978
|
+
const kt = V.current.generation, Ot = (Mt) => {
|
|
979
|
+
const it = V.current;
|
|
980
|
+
if (it.generation !== kt)
|
|
980
981
|
return;
|
|
981
|
-
if (
|
|
982
|
-
|
|
982
|
+
if (it.lastTimestamp === null) {
|
|
983
|
+
it.lastTimestamp = Mt, it.frame = requestAnimationFrame(Ot);
|
|
983
984
|
return;
|
|
984
985
|
}
|
|
985
|
-
const
|
|
986
|
-
if (
|
|
987
|
-
|
|
986
|
+
const ht = Mt - it.lastTimestamp;
|
|
987
|
+
if (it.lastTimestamp = Mt, ht <= 0) {
|
|
988
|
+
it.frame = requestAnimationFrame(Ot);
|
|
988
989
|
return;
|
|
989
990
|
}
|
|
990
|
-
const
|
|
991
|
-
let
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
const
|
|
995
|
-
if (
|
|
991
|
+
const st = it.velocity;
|
|
992
|
+
let Q = st;
|
|
993
|
+
const qt = z * ht;
|
|
994
|
+
st > 0 ? Q = Math.max(0, st - qt) : st < 0 && (Q = Math.min(0, st + qt));
|
|
995
|
+
const Nt = (st + Q) / 2 * ht, $t = N.current;
|
|
996
|
+
if (Nt !== 0 && Ct.current((gt) => gt + Nt), V.current.generation !== kt)
|
|
996
997
|
return;
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
const
|
|
1000
|
-
if (Math.abs(
|
|
1001
|
-
|
|
998
|
+
const Gt = N.current, { contentSize: Vt, viewportSize: f } = yt.current, w = Math.max(Vt - f, 0);
|
|
999
|
+
it.velocity = Q;
|
|
1000
|
+
const at = Gt === $t || Gt <= 0 && Q <= 0 || Gt >= w && Q >= 0;
|
|
1001
|
+
if (Math.abs(Q) < mt || at) {
|
|
1002
|
+
W();
|
|
1002
1003
|
return;
|
|
1003
1004
|
}
|
|
1004
|
-
|
|
1005
|
+
it.frame = requestAnimationFrame(Ot);
|
|
1005
1006
|
};
|
|
1006
|
-
|
|
1007
|
+
V.current.frame = requestAnimationFrame(Ot);
|
|
1007
1008
|
},
|
|
1008
|
-
[
|
|
1009
|
-
),
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
}, [y]),
|
|
1013
|
-
|
|
1014
|
-
}, [t, e]),
|
|
1015
|
-
const
|
|
1016
|
-
if (!
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1009
|
+
[J, Tt, W]
|
|
1010
|
+
), Kt = I(y);
|
|
1011
|
+
q(() => {
|
|
1012
|
+
Kt.current = y;
|
|
1013
|
+
}, [y]), Te(() => {
|
|
1014
|
+
yt.current = { contentSize: t, viewportSize: e };
|
|
1015
|
+
}, [t, e]), Te(() => {
|
|
1016
|
+
const p = K.current;
|
|
1017
|
+
if (!p) return;
|
|
1018
|
+
const ft = () => {
|
|
1019
|
+
p.scrollTop !== 0 && (C.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: p.scrollTop })), p.scrollTop = 0), p.scrollLeft !== 0 && (p.scrollLeft = 0);
|
|
1019
1020
|
};
|
|
1020
|
-
return
|
|
1021
|
-
}, []),
|
|
1022
|
-
if (
|
|
1021
|
+
return p.addEventListener("scroll", ft), () => p.removeEventListener("scroll", ft);
|
|
1022
|
+
}, []), Te(() => {
|
|
1023
|
+
if (J) {
|
|
1023
1024
|
C.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: t, viewportSize: e, scrollPosition: N.current }));
|
|
1024
|
-
const
|
|
1025
|
-
N.current >
|
|
1025
|
+
const p = vt(t - e, 0, t);
|
|
1026
|
+
N.current > p && F(p);
|
|
1026
1027
|
} else
|
|
1027
|
-
|
|
1028
|
-
}, [
|
|
1029
|
-
const
|
|
1030
|
-
if (
|
|
1028
|
+
F(0);
|
|
1029
|
+
}, [J, F, t, e]), q(() => {
|
|
1030
|
+
const p = (z) => {
|
|
1031
|
+
if (z.ctrlKey)
|
|
1031
1032
|
return;
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
if (
|
|
1035
|
-
|
|
1036
|
-
let
|
|
1037
|
-
|
|
1033
|
+
const et = z.shiftKey && z.deltaX === 0, ct = et ? z.deltaY : z.deltaX, kt = et ? 0 : z.deltaY;
|
|
1034
|
+
if (ct !== 0 && Math.abs(ct) >= Math.abs(kt)) {
|
|
1035
|
+
if (T.current) {
|
|
1036
|
+
z.preventDefault(), W();
|
|
1037
|
+
let it = ct;
|
|
1038
|
+
z.deltaMode === 1 ? it *= 16 : z.deltaMode === 2 && (it *= e), T.current(it);
|
|
1038
1039
|
}
|
|
1039
1040
|
return;
|
|
1040
1041
|
}
|
|
1041
|
-
if (!
|
|
1042
|
+
if (!J || z.deltaY === 0)
|
|
1042
1043
|
return;
|
|
1043
|
-
|
|
1044
|
-
let
|
|
1045
|
-
|
|
1046
|
-
},
|
|
1047
|
-
|
|
1048
|
-
},
|
|
1049
|
-
return
|
|
1050
|
-
|
|
1044
|
+
z.preventDefault(), W();
|
|
1045
|
+
let Mt = z.deltaY;
|
|
1046
|
+
z.deltaMode === 1 ? Mt *= 16 : z.deltaMode === 2 && (Mt *= e), rt !== 1 && (Mt *= rt), C.debug("[ScrollPane] wheel event", () => ({ deltaY: Mt, scrollPosition: N.current, wheelSpeedMultiplier: rt, deltaMode: z.deltaMode, scrollTop: K.current?.scrollTop })), F((it) => it + Mt);
|
|
1047
|
+
}, ft = () => {
|
|
1048
|
+
W();
|
|
1049
|
+
}, mt = lt.current;
|
|
1050
|
+
return mt && (mt.addEventListener("wheel", p, { passive: !1 }), mt.addEventListener("pointerdown", ft, { capture: !0, passive: !0 })), () => {
|
|
1051
|
+
mt && (mt.removeEventListener("wheel", p), mt.removeEventListener("pointerdown", ft, { capture: !0 }));
|
|
1051
1052
|
};
|
|
1052
|
-
}, [
|
|
1053
|
-
|
|
1053
|
+
}, [J, F, W, e, rt]), qe(
|
|
1054
|
+
$,
|
|
1054
1055
|
() => ({
|
|
1055
|
-
scrollTo: (
|
|
1056
|
+
scrollTo: (p) => (W(), F(p)),
|
|
1056
1057
|
getScrollPosition: () => N.current,
|
|
1057
1058
|
getContentSize: () => t,
|
|
1058
1059
|
getViewportSize: () => e
|
|
1059
1060
|
}),
|
|
1060
|
-
[
|
|
1061
|
+
[F, t, e, W]
|
|
1061
1062
|
);
|
|
1062
|
-
const
|
|
1063
|
+
const ae = er(), A = X?.id ?? ae, j = I({
|
|
1063
1064
|
pointerType: "",
|
|
1064
1065
|
pointerId: null,
|
|
1065
1066
|
startClientY: 0,
|
|
@@ -1068,241 +1069,256 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
1068
1069
|
shouldCancelNextClick: !1,
|
|
1069
1070
|
clickResetTimer: null,
|
|
1070
1071
|
velocitySamples: []
|
|
1071
|
-
}),
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
}, [c]),
|
|
1075
|
-
|
|
1072
|
+
}), Bt = I(c), _t = I(d);
|
|
1073
|
+
q(() => {
|
|
1074
|
+
Bt.current = c;
|
|
1075
|
+
}, [c]), q(() => {
|
|
1076
|
+
_t.current = d;
|
|
1076
1077
|
}, [d]);
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
}, [
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}, [
|
|
1085
|
-
const
|
|
1086
|
-
if (c &&
|
|
1078
|
+
const Et = I(J);
|
|
1079
|
+
q(() => {
|
|
1080
|
+
Et.current = J;
|
|
1081
|
+
}, [J]);
|
|
1082
|
+
const Xt = I(Tt);
|
|
1083
|
+
q(() => {
|
|
1084
|
+
Xt.current = Tt;
|
|
1085
|
+
}, [Tt]), q(() => {
|
|
1086
|
+
const p = j.current;
|
|
1087
|
+
if (c && J && (p.pointerId === null || Oe(p.pointerType, d)) || p.pointerId === null)
|
|
1087
1088
|
return;
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1092
|
-
}, [c, d,
|
|
1093
|
-
const
|
|
1094
|
-
if (!
|
|
1089
|
+
const ft = K.current;
|
|
1090
|
+
p.clickResetTimer !== null && (window.clearTimeout(p.clickResetTimer), p.clickResetTimer = null);
|
|
1091
|
+
const mt = p.isDragging && p.shouldCancelNextClick, z = p.pointerId;
|
|
1092
|
+
p.pointerId = null, p.pointerType = "", p.startClientY = 0, p.startScroll = 0, p.isDragging = !1, p.shouldCancelNextClick = mt, p.velocitySamples = [], ft?.hasPointerCapture(z) && ft.releasePointerCapture(z);
|
|
1093
|
+
}, [c, d, J]), q(() => {
|
|
1094
|
+
const p = K.current;
|
|
1095
|
+
if (!p)
|
|
1095
1096
|
return;
|
|
1096
|
-
const
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1099
|
-
},
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1102
|
-
},
|
|
1103
|
-
const w =
|
|
1104
|
-
w.velocitySamples.push({ clientY:
|
|
1105
|
-
const
|
|
1106
|
-
w.velocitySamples = w.velocitySamples.filter((
|
|
1107
|
-
},
|
|
1108
|
-
const w =
|
|
1109
|
-
w.shouldCancelNextClick && (
|
|
1110
|
-
},
|
|
1111
|
-
const w =
|
|
1097
|
+
const ft = 6, mt = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), z = () => {
|
|
1098
|
+
const f = j.current;
|
|
1099
|
+
f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.velocitySamples = [];
|
|
1100
|
+
}, et = () => {
|
|
1101
|
+
const f = j.current;
|
|
1102
|
+
f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
|
|
1103
|
+
}, ct = (f) => {
|
|
1104
|
+
const w = j.current, at = mt();
|
|
1105
|
+
w.velocitySamples.push({ clientY: f, time: at });
|
|
1106
|
+
const gt = Xt.current.velocitySampleWindow;
|
|
1107
|
+
w.velocitySamples = w.velocitySamples.filter((wt) => at - wt.time <= gt);
|
|
1108
|
+
}, kt = (f) => f instanceof HTMLElement && f.closest("[data-scrollpane-ignore-drag='true']") !== null, Ot = (f) => {
|
|
1109
|
+
const w = j.current;
|
|
1110
|
+
w.shouldCancelNextClick && (f.preventDefault(), f.stopPropagation(), w.shouldCancelNextClick = !1);
|
|
1111
|
+
}, Mt = (f) => {
|
|
1112
|
+
const w = j.current;
|
|
1112
1113
|
if (!w.isDragging) {
|
|
1113
|
-
if (w.isDragging = !0, w.shouldCancelNextClick = !0, !
|
|
1114
|
+
if (w.isDragging = !0, w.shouldCancelNextClick = !0, !p.hasPointerCapture(f.pointerId))
|
|
1114
1115
|
try {
|
|
1115
|
-
|
|
1116
|
+
p.setPointerCapture(f.pointerId);
|
|
1116
1117
|
} catch {
|
|
1117
1118
|
}
|
|
1118
|
-
|
|
1119
|
+
ct(f.clientY);
|
|
1119
1120
|
}
|
|
1120
|
-
},
|
|
1121
|
-
const w =
|
|
1122
|
-
|
|
1123
|
-
},
|
|
1124
|
-
const w =
|
|
1125
|
-
if (w.pointerId !==
|
|
1121
|
+
}, it = (f) => f.isTrusted || f.target === p, ht = (f) => {
|
|
1122
|
+
const w = j.current;
|
|
1123
|
+
p.hasPointerCapture(f) && p.releasePointerCapture(f), w.shouldCancelNextClick = !1, et(), z();
|
|
1124
|
+
}, st = (f) => {
|
|
1125
|
+
const w = j.current;
|
|
1126
|
+
if (w.pointerId !== f.pointerId)
|
|
1126
1127
|
return;
|
|
1127
|
-
if (
|
|
1128
|
-
|
|
1128
|
+
if (f.buttons === 0 && Sr(f.pointerType)) {
|
|
1129
|
+
ht(f.pointerId);
|
|
1129
1130
|
return;
|
|
1130
1131
|
}
|
|
1131
|
-
if (!(
|
|
1132
|
+
if (!(Bt.current && Et.current) || !Oe(f.pointerType, _t.current) || !w.isDragging && (Math.abs(f.clientY - w.startClientY) < ft || (Mt(f), !w.isDragging)))
|
|
1132
1133
|
return;
|
|
1133
|
-
|
|
1134
|
-
const
|
|
1135
|
-
Ct.current(
|
|
1136
|
-
},
|
|
1137
|
-
const
|
|
1138
|
-
return
|
|
1139
|
-
const w =
|
|
1134
|
+
ct(f.clientY);
|
|
1135
|
+
const at = f.clientY - w.startClientY, gt = w.startScroll - at;
|
|
1136
|
+
Ct.current(gt), f.cancelable && f.preventDefault();
|
|
1137
|
+
}, Q = () => {
|
|
1138
|
+
const f = j.current;
|
|
1139
|
+
return f.pointerId !== null || !f.shouldCancelNextClick ? !1 : (et(), f.clickResetTimer = window.setTimeout(() => {
|
|
1140
|
+
const w = j.current;
|
|
1140
1141
|
w.shouldCancelNextClick = !1, w.clickResetTimer = null;
|
|
1141
1142
|
}, 0), !0);
|
|
1142
|
-
},
|
|
1143
|
-
const w =
|
|
1144
|
-
if (w.pointerId !==
|
|
1145
|
-
|
|
1143
|
+
}, qt = (f) => {
|
|
1144
|
+
const w = j.current;
|
|
1145
|
+
if (w.pointerId !== f.pointerId) {
|
|
1146
|
+
Q();
|
|
1146
1147
|
return;
|
|
1147
1148
|
}
|
|
1148
|
-
w.isDragging && w.shouldCancelNextClick &&
|
|
1149
|
-
let
|
|
1149
|
+
w.isDragging && w.shouldCancelNextClick && f.cancelable && (f.preventDefault(), f.stopPropagation()), w.isDragging && ct(f.clientY);
|
|
1150
|
+
let at = 0;
|
|
1150
1151
|
if (w.isDragging && w.velocitySamples.length >= 2) {
|
|
1151
|
-
const
|
|
1152
|
-
if (
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1152
|
+
const wt = w.velocitySamples, Qt = Xt.current.velocitySampleWindow, Ht = wt[wt.length - 1], Ut = wt.find((te) => Ht.time - te.time <= Qt) ?? wt[0];
|
|
1153
|
+
if (Ht && Ut && Ht.time !== Ut.time) {
|
|
1154
|
+
const te = Ht.clientY - Ut.clientY, ce = Ht.time - Ut.time;
|
|
1155
|
+
at = -(te / ce);
|
|
1155
1156
|
}
|
|
1156
1157
|
}
|
|
1157
|
-
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1158
|
+
et(), w.shouldCancelNextClick && (w.clickResetTimer = window.setTimeout(() => {
|
|
1159
|
+
const wt = j.current;
|
|
1160
|
+
wt.shouldCancelNextClick = !1, wt.clickResetTimer = null;
|
|
1160
1161
|
}, 0));
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
},
|
|
1164
|
-
if (
|
|
1162
|
+
const gt = Xt.current.startVelocityThreshold;
|
|
1163
|
+
z(), p.hasPointerCapture(f.pointerId) && p.releasePointerCapture(f.pointerId), Math.abs(at) >= gt && Kt.current?.(at);
|
|
1164
|
+
}, le = (f) => {
|
|
1165
|
+
if (j.current.pointerId !== null) {
|
|
1166
|
+
if (!f.isPrimary || f.pointerType !== j.current.pointerType)
|
|
1167
|
+
return;
|
|
1168
|
+
ht(j.current.pointerId);
|
|
1169
|
+
}
|
|
1170
|
+
if (j.current.shouldCancelNextClick && (et(), j.current.shouldCancelNextClick = !1), !(Bt.current && Et.current) || !Oe(f.pointerType, _t.current) || f.button !== 0 && f.pointerType === "mouse" || f.ctrlKey || f.metaKey || f.altKey || kt(f.target))
|
|
1165
1171
|
return;
|
|
1166
|
-
window.dispatchEvent(new CustomEvent(
|
|
1167
|
-
const w =
|
|
1168
|
-
|
|
1169
|
-
},
|
|
1170
|
-
if (
|
|
1171
|
-
|
|
1172
|
+
window.dispatchEvent(new CustomEvent(Ye, { detail: { paneId: ae } })), At.current?.();
|
|
1173
|
+
const w = j.current;
|
|
1174
|
+
et(), w.pointerId = f.pointerId, w.pointerType = f.pointerType, w.startClientY = f.clientY, w.startScroll = N.current, w.isDragging = !1, w.shouldCancelNextClick = !1, w.velocitySamples = [];
|
|
1175
|
+
}, Nt = (f) => {
|
|
1176
|
+
if (j.current.pointerId !== f.pointerId) {
|
|
1177
|
+
Q();
|
|
1172
1178
|
return;
|
|
1173
1179
|
}
|
|
1174
|
-
|
|
1175
|
-
},
|
|
1176
|
-
["click",
|
|
1177
|
-
["pointerdown",
|
|
1178
|
-
["lostpointercapture", (
|
|
1179
|
-
|
|
1180
|
+
it(f) && ht(f.pointerId);
|
|
1181
|
+
}, Gt = [
|
|
1182
|
+
["click", Ot, !0],
|
|
1183
|
+
["pointerdown", le, { passive: !1 }],
|
|
1184
|
+
["lostpointercapture", (f) => {
|
|
1185
|
+
f.target !== p || j.current.pointerId !== f.pointerId || ht(f.pointerId);
|
|
1180
1186
|
}, void 0]
|
|
1181
|
-
],
|
|
1182
|
-
["pointermove",
|
|
1183
|
-
["pointerup",
|
|
1184
|
-
["pointercancel",
|
|
1187
|
+
], Vt = [
|
|
1188
|
+
["pointermove", st, { passive: !1 }],
|
|
1189
|
+
["pointerup", qt, void 0],
|
|
1190
|
+
["pointercancel", Nt, void 0]
|
|
1185
1191
|
];
|
|
1186
|
-
return
|
|
1187
|
-
|
|
1188
|
-
const
|
|
1189
|
-
|
|
1192
|
+
return Ne(p, Gt, "add"), Ne(window, Vt, "add"), () => {
|
|
1193
|
+
Ne(p, Gt, "remove"), Ne(window, Vt, "remove");
|
|
1194
|
+
const f = j.current;
|
|
1195
|
+
f.pointerId !== null && p.hasPointerCapture(f.pointerId) && p.releasePointerCapture(f.pointerId), et(), z();
|
|
1190
1196
|
};
|
|
1191
|
-
}, [
|
|
1192
|
-
const
|
|
1193
|
-
(
|
|
1194
|
-
[
|
|
1197
|
+
}, [ae]);
|
|
1198
|
+
const dt = S(
|
|
1199
|
+
(p) => (W(), F(p)),
|
|
1200
|
+
[F, W]
|
|
1195
1201
|
);
|
|
1196
|
-
return /* @__PURE__ */
|
|
1197
|
-
/* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ he("div", { ref: lt, "data-testid": v, className: pe("aqvs-scroll-pane", x), style: E, children: [
|
|
1203
|
+
/* @__PURE__ */ he(
|
|
1198
1204
|
"div",
|
|
1199
1205
|
{
|
|
1200
|
-
ref:
|
|
1201
|
-
className:
|
|
1206
|
+
ref: K,
|
|
1207
|
+
className: pe("aqvs-scroll-pane-content"),
|
|
1202
1208
|
"data-testid": "aqvs-scroll-pane-content",
|
|
1203
1209
|
style: {
|
|
1204
1210
|
height: e,
|
|
1205
|
-
paddingTop:
|
|
1206
|
-
paddingBottom:
|
|
1211
|
+
paddingTop: Yt.top,
|
|
1212
|
+
paddingBottom: Yt.bottom,
|
|
1207
1213
|
// スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
|
|
1208
1214
|
// 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
|
|
1209
1215
|
// 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
|
|
1210
1216
|
// touch-action はペン入力にも効くため、判定は touch と pen の論理和にする
|
|
1211
|
-
|
|
1217
|
+
//
|
|
1218
|
+
// ❗ この値はタッチ開始時にラッチされる (実測: 1ms 後に none へ変えても手遅れ)。
|
|
1219
|
+
// 中身が非同期に届くリストでは、「まだスクロール不能」な一瞬に指が着地すると
|
|
1220
|
+
// **そのジェスチャ 1 回分**はブラウザに接収されたまま戻らない。
|
|
1221
|
+
// 指を離して置き直せば次のジェスチャからは正常に効くため、損失は 1 ジェスチャに
|
|
1222
|
+
// 限られ恒久破損にはならない (実測で確認)。ドラッグ許可の判定 (isScrollable) と
|
|
1223
|
+
// 同一条件で揃えてあるため状態としても一貫している。
|
|
1224
|
+
// 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
|
|
1225
|
+
// (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
|
|
1226
|
+
...c && J && d.some((p) => p === "touch" || p === "pen") ? { touchAction: "none" } : {}
|
|
1212
1227
|
},
|
|
1213
|
-
|
|
1228
|
+
...X,
|
|
1229
|
+
id: A,
|
|
1214
1230
|
children: [
|
|
1215
|
-
|
|
1231
|
+
m,
|
|
1216
1232
|
n(N.current)
|
|
1217
1233
|
]
|
|
1218
1234
|
}
|
|
1219
1235
|
),
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
|
|
1236
|
+
/* @__PURE__ */ ot(
|
|
1237
|
+
Ir,
|
|
1222
1238
|
{
|
|
1223
1239
|
contentSize: t,
|
|
1224
1240
|
viewportSize: e,
|
|
1225
1241
|
scrollPosition: N.current,
|
|
1226
|
-
onScroll:
|
|
1242
|
+
onScroll: dt,
|
|
1227
1243
|
enableThumbDrag: i,
|
|
1228
1244
|
enableTrackClick: s,
|
|
1229
|
-
enableArrowButtons:
|
|
1245
|
+
enableArrowButtons: a,
|
|
1230
1246
|
scrollBarWidth: r,
|
|
1231
|
-
ariaControls:
|
|
1247
|
+
ariaControls: A,
|
|
1232
1248
|
tapScrollCircleOptions: _,
|
|
1233
|
-
itemCount:
|
|
1249
|
+
itemCount: Z,
|
|
1234
1250
|
renderThumbOverlay: ut,
|
|
1235
|
-
visibleStartIndex:
|
|
1251
|
+
visibleStartIndex: Pt,
|
|
1236
1252
|
visibleEndIndex: D
|
|
1237
1253
|
},
|
|
1238
1254
|
"scrollbar"
|
|
1239
1255
|
),
|
|
1240
|
-
|
|
1256
|
+
k?.()
|
|
1241
1257
|
] });
|
|
1242
1258
|
}
|
|
1243
|
-
),
|
|
1244
|
-
const i = Math.max(r / 2, 1), s = 1 + t * 0.65,
|
|
1245
|
-
return /* @__PURE__ */
|
|
1246
|
-
/* @__PURE__ */
|
|
1259
|
+
), Ue = (n, t, e) => Math.min(Math.max(n, t), e), Or = ({ dragState: n, normalizedDistance: t, sizeScale: e, size: r }) => {
|
|
1260
|
+
const i = Math.max(r / 2, 1), s = 1 + t * 0.65, a = Math.max(0.65, 1 - t * 0.25), c = n.direction * t * 26 * e, d = 0.8 + t * 0.18, b = 3 * e, x = 6 * e, v = 22 * e, E = Math.abs(c) + x, m = c > 0 ? b : -Math.abs(c) - b, _ = Math.max(2.5, 3 * e), B = Ue(n.offsetX, -i, i), Z = Ue(n.offsetY, -i, i), ut = i * 0.35, rt = B / i * ut, nt = Z / i * ut, pt = rt * 0.45, Pt = nt * 0.45, D = Math.max(v * 0.38, 6), k = 0.65 + t * 0.2, P = n.active;
|
|
1261
|
+
return /* @__PURE__ */ he(Ge, { children: [
|
|
1262
|
+
/* @__PURE__ */ ot(
|
|
1247
1263
|
"div",
|
|
1248
1264
|
{
|
|
1249
1265
|
className: "aqvs-tap-scroll-circle-gradient",
|
|
1250
1266
|
style: {
|
|
1251
|
-
transform: `scale(${
|
|
1267
|
+
transform: `scale(${a}, ${s})`,
|
|
1252
1268
|
transition: P ? "40ms transform ease-out" : "200ms ease transform"
|
|
1253
1269
|
}
|
|
1254
1270
|
}
|
|
1255
1271
|
),
|
|
1256
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ ot(
|
|
1257
1273
|
"div",
|
|
1258
1274
|
{
|
|
1259
1275
|
className: "aqvs-sample-visual-pupil",
|
|
1260
1276
|
style: {
|
|
1261
|
-
width:
|
|
1262
|
-
height:
|
|
1263
|
-
transform: `translate(calc(-50% + ${
|
|
1277
|
+
width: v,
|
|
1278
|
+
height: v,
|
|
1279
|
+
transform: `translate(calc(-50% + ${rt}px), calc(-50% + ${nt}px)) scale(${a}, ${d * s})`,
|
|
1264
1280
|
transition: P ? "70ms transform ease-out" : "200ms ease transform"
|
|
1265
1281
|
}
|
|
1266
1282
|
}
|
|
1267
1283
|
),
|
|
1268
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ ot(
|
|
1269
1285
|
"div",
|
|
1270
1286
|
{
|
|
1271
1287
|
className: "aqvs-sample-visual-highlight",
|
|
1272
1288
|
style: {
|
|
1273
1289
|
width: D,
|
|
1274
1290
|
height: D,
|
|
1275
|
-
transform: `translate(calc(-50% + ${
|
|
1276
|
-
opacity:
|
|
1291
|
+
transform: `translate(calc(-50% + ${pt}px), calc(-50% + ${Pt}px)) scale(${a}, ${s})`,
|
|
1292
|
+
opacity: k,
|
|
1277
1293
|
boxShadow: "0 0 8px rgba(255,255,255,0.45)",
|
|
1278
1294
|
transition: P ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
|
|
1279
1295
|
}
|
|
1280
1296
|
}
|
|
1281
1297
|
),
|
|
1282
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ ot(
|
|
1283
1299
|
"div",
|
|
1284
1300
|
{
|
|
1285
1301
|
className: "aqvs-sample-visual-rod",
|
|
1286
1302
|
style: {
|
|
1287
1303
|
width: _,
|
|
1288
1304
|
height: E,
|
|
1289
|
-
transform: `translate(-50%, ${
|
|
1305
|
+
transform: `translate(-50%, ${m}px)`,
|
|
1290
1306
|
opacity: t,
|
|
1291
1307
|
transition: P ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
|
|
1292
1308
|
}
|
|
1293
1309
|
}
|
|
1294
1310
|
)
|
|
1295
1311
|
] });
|
|
1296
|
-
},
|
|
1312
|
+
}, Ve = 100, Pr = (n) => {
|
|
1297
1313
|
if (!Number.isFinite(n))
|
|
1298
1314
|
return 0n;
|
|
1299
1315
|
const t = Math.trunc(n);
|
|
1300
1316
|
return t <= 0 ? 0n : BigInt(t);
|
|
1301
|
-
},
|
|
1317
|
+
}, Fe = (n, t) => {
|
|
1302
1318
|
if (!Number.isFinite(n))
|
|
1303
1319
|
throw new Error(`valueFn returned a non-finite value at index ${t}: ${n}`);
|
|
1304
1320
|
return n;
|
|
1305
|
-
},
|
|
1321
|
+
}, xe = (n) => {
|
|
1306
1322
|
if (n <= 0 || !Number.isFinite(n))
|
|
1307
1323
|
return 0;
|
|
1308
1324
|
const t = Math.trunc(n);
|
|
@@ -1311,7 +1327,7 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
1311
1327
|
const e = BigInt(t) & -BigInt(t);
|
|
1312
1328
|
return Number(e);
|
|
1313
1329
|
};
|
|
1314
|
-
class
|
|
1330
|
+
class me {
|
|
1315
1331
|
/**
|
|
1316
1332
|
* @private
|
|
1317
1333
|
* @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
|
|
@@ -1375,27 +1391,27 @@ class le {
|
|
|
1375
1391
|
this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.valueFn = void 0, this.baseValue = e, this.total = this.baseValue * this.size;
|
|
1376
1392
|
return;
|
|
1377
1393
|
}
|
|
1378
|
-
let s = 0,
|
|
1394
|
+
let s = 0, a;
|
|
1379
1395
|
if (i > 0) {
|
|
1380
1396
|
const c = r?.sampleRange ?? {
|
|
1381
1397
|
from: 0,
|
|
1382
|
-
to: Math.min(
|
|
1398
|
+
to: Math.min(Ve - 1, i - 1)
|
|
1383
1399
|
};
|
|
1384
|
-
let d = Math.max(0, Math.trunc(c.from)),
|
|
1385
|
-
if (d >
|
|
1386
|
-
s =
|
|
1400
|
+
let d = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), i - 1);
|
|
1401
|
+
if (d > b && (d = 0, b = Math.min(Ve - 1, i - 1)), i > Ve)
|
|
1402
|
+
s = me._sampleBaseValueStrided(e, i, Ve), r?.materialize && (a = { from: d, values: me._collectValidatedValues(e, d, b) });
|
|
1387
1403
|
else {
|
|
1388
|
-
const
|
|
1389
|
-
s =
|
|
1404
|
+
const x = me._collectValidatedValues(e, d, b);
|
|
1405
|
+
s = me._modeOrMedian([...x]), r?.materialize && (a = { from: d, values: x });
|
|
1390
1406
|
}
|
|
1391
1407
|
}
|
|
1392
|
-
if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s,
|
|
1393
|
-
for (let c = 0; c <
|
|
1394
|
-
const d =
|
|
1408
|
+
if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s, a)
|
|
1409
|
+
for (let c = 0; c < a.values.length; c++) {
|
|
1410
|
+
const d = a.from + c;
|
|
1395
1411
|
if (d >= this.size)
|
|
1396
1412
|
break;
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1413
|
+
const b = a.values[c] - this.baseValue;
|
|
1414
|
+
b !== 0 && (this.deltas.set(d, b), this._updateTree(d, b));
|
|
1399
1415
|
}
|
|
1400
1416
|
this.total = this.getTotal();
|
|
1401
1417
|
}
|
|
@@ -1426,7 +1442,7 @@ class le {
|
|
|
1426
1442
|
static _collectValidatedValues(t, e, r) {
|
|
1427
1443
|
const i = [];
|
|
1428
1444
|
for (let s = e; s <= r; s++)
|
|
1429
|
-
i.push(
|
|
1445
|
+
i.push(Fe(t(s), s));
|
|
1430
1446
|
return i;
|
|
1431
1447
|
}
|
|
1432
1448
|
/**
|
|
@@ -1440,22 +1456,22 @@ class le {
|
|
|
1440
1456
|
static _modeOrMedian(t) {
|
|
1441
1457
|
if (t.length === 0)
|
|
1442
1458
|
return 0;
|
|
1443
|
-
t.sort((
|
|
1459
|
+
t.sort((a, c) => a - c);
|
|
1444
1460
|
const e = Math.floor(t.length / 2);
|
|
1445
1461
|
let r;
|
|
1446
1462
|
t.length % 2 === 0 ? r = Math.floor((t[e - 1] + t[e]) / 2) : r = t[e];
|
|
1447
1463
|
const i = /* @__PURE__ */ new Map();
|
|
1448
1464
|
let s = 0;
|
|
1449
|
-
for (const
|
|
1450
|
-
const c = (i.get(
|
|
1451
|
-
i.set(
|
|
1465
|
+
for (const a of t) {
|
|
1466
|
+
const c = (i.get(a) ?? 0) + 1;
|
|
1467
|
+
i.set(a, c), c > s && (s = c);
|
|
1452
1468
|
}
|
|
1453
1469
|
if (s > t.length * 0.2) {
|
|
1454
|
-
const
|
|
1455
|
-
for (const [d,
|
|
1456
|
-
|
|
1457
|
-
const c =
|
|
1458
|
-
r = Math.floor(c /
|
|
1470
|
+
const a = [];
|
|
1471
|
+
for (const [d, b] of i.entries())
|
|
1472
|
+
b === s && a.push(d);
|
|
1473
|
+
const c = a.reduce((d, b) => d + b, 0);
|
|
1474
|
+
r = Math.floor(c / a.length);
|
|
1459
1475
|
}
|
|
1460
1476
|
return r;
|
|
1461
1477
|
}
|
|
@@ -1475,9 +1491,9 @@ class le {
|
|
|
1475
1491
|
let i = Math.max(1, Math.ceil(e / r));
|
|
1476
1492
|
i % 2 === 0 && (i += 1);
|
|
1477
1493
|
const s = [];
|
|
1478
|
-
for (let
|
|
1479
|
-
s.push(
|
|
1480
|
-
return
|
|
1494
|
+
for (let a = 0; a < e && s.length < r; a += i)
|
|
1495
|
+
s.push(Fe(t(a), a));
|
|
1496
|
+
return me._modeOrMedian(s);
|
|
1481
1497
|
}
|
|
1482
1498
|
/**
|
|
1483
1499
|
* @method update
|
|
@@ -1524,14 +1540,14 @@ class le {
|
|
|
1524
1540
|
throw new Error(`Index must be an integer: ${r}`);
|
|
1525
1541
|
if (!Number.isFinite(i))
|
|
1526
1542
|
throw new Error(`Change must be a finite number: ${i}`);
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1529
|
-
throw new Error(`Change would make the value at index ${r} negative: ${
|
|
1530
|
-
e.set(r,
|
|
1543
|
+
const a = (e.get(r) ?? this.deltas.get(r) ?? 0) + i;
|
|
1544
|
+
if (a + this.baseValue < -1e-9)
|
|
1545
|
+
throw new Error(`Change would make the value at index ${r} negative: ${a + this.baseValue}`);
|
|
1546
|
+
e.set(r, a);
|
|
1531
1547
|
}
|
|
1532
1548
|
for (const { index: r, change: i } of t) {
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1549
|
+
const a = (this.deltas.get(r) ?? 0) + i;
|
|
1550
|
+
a === 0 ? this.deltas.delete(r) : this.deltas.set(r, a), this._updateTree(r, i);
|
|
1535
1551
|
}
|
|
1536
1552
|
return this.total;
|
|
1537
1553
|
}
|
|
@@ -1549,7 +1565,7 @@ class le {
|
|
|
1549
1565
|
let r = t + 1;
|
|
1550
1566
|
for (; r <= this.size; ) {
|
|
1551
1567
|
this.tree.set(r, (this.tree.get(r) ?? 0) + e);
|
|
1552
|
-
const i =
|
|
1568
|
+
const i = xe(r);
|
|
1553
1569
|
if (i === 0)
|
|
1554
1570
|
break;
|
|
1555
1571
|
r += i;
|
|
@@ -1575,8 +1591,8 @@ class le {
|
|
|
1575
1591
|
throw new Error(`Value must be a finite number: ${s}`);
|
|
1576
1592
|
if (s < 0)
|
|
1577
1593
|
throw new Error("Value cannot be negative.");
|
|
1578
|
-
const
|
|
1579
|
-
d !== 0 && e.push({ index: i, change: d }), r.set(i,
|
|
1594
|
+
const a = r.has(i) ? r.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = a + this.baseValue, d = s - c;
|
|
1595
|
+
d !== 0 && e.push({ index: i, change: d }), r.set(i, a + d);
|
|
1580
1596
|
}
|
|
1581
1597
|
return e;
|
|
1582
1598
|
}
|
|
@@ -1593,7 +1609,7 @@ class le {
|
|
|
1593
1609
|
let t = 0, e = this.size;
|
|
1594
1610
|
for (; e > 0; ) {
|
|
1595
1611
|
t += this.tree.get(e) ?? 0;
|
|
1596
|
-
const r =
|
|
1612
|
+
const r = xe(e);
|
|
1597
1613
|
if (r === 0)
|
|
1598
1614
|
break;
|
|
1599
1615
|
e -= r;
|
|
@@ -1610,10 +1626,10 @@ class le {
|
|
|
1610
1626
|
*/
|
|
1611
1627
|
_materialize(t, e = !0) {
|
|
1612
1628
|
if (this.valueFn) {
|
|
1613
|
-
const r = this.deltas.get(t) ?? 0, s =
|
|
1629
|
+
const r = this.deltas.get(t) ?? 0, s = Fe(this.valueFn(t), t) - this.baseValue;
|
|
1614
1630
|
if (s !== r && (s === 0 ? this.deltas.delete(t) : this.deltas.set(t, s), e)) {
|
|
1615
|
-
const
|
|
1616
|
-
this._updateTree(t,
|
|
1631
|
+
const a = s - r;
|
|
1632
|
+
this._updateTree(t, a);
|
|
1617
1633
|
}
|
|
1618
1634
|
}
|
|
1619
1635
|
}
|
|
@@ -1632,9 +1648,9 @@ class le {
|
|
|
1632
1648
|
const i = t.ranges;
|
|
1633
1649
|
if (i && i.length > 0) {
|
|
1634
1650
|
for (const c of i) {
|
|
1635
|
-
const d = Math.max(0, Math.trunc(c.from)),
|
|
1636
|
-
for (let
|
|
1637
|
-
this._materialize(
|
|
1651
|
+
const d = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), this.size - 1);
|
|
1652
|
+
for (let x = d; x <= b; x++)
|
|
1653
|
+
this._materialize(x);
|
|
1638
1654
|
}
|
|
1639
1655
|
if (e === void 0)
|
|
1640
1656
|
return;
|
|
@@ -1642,8 +1658,8 @@ class le {
|
|
|
1642
1658
|
this._materialize(e);
|
|
1643
1659
|
return;
|
|
1644
1660
|
}
|
|
1645
|
-
const s = i[0].from,
|
|
1646
|
-
e >= s && e <=
|
|
1661
|
+
const s = i[0].from, a = i[i.length - 1].to;
|
|
1662
|
+
e >= s && e <= a && this._materialize(e);
|
|
1647
1663
|
return;
|
|
1648
1664
|
}
|
|
1649
1665
|
e !== void 0 && this._materialize(e);
|
|
@@ -1675,13 +1691,13 @@ class le {
|
|
|
1675
1691
|
if (this._materialize(s), (this.deltas.get(s) ?? 0) === c)
|
|
1676
1692
|
break;
|
|
1677
1693
|
}
|
|
1678
|
-
const
|
|
1694
|
+
const a = this.prefixSum(s);
|
|
1679
1695
|
return {
|
|
1680
1696
|
index: s,
|
|
1681
|
-
total: this.total ??
|
|
1682
|
-
cumulative:
|
|
1683
|
-
currentValue:
|
|
1684
|
-
safeIndex:
|
|
1697
|
+
total: this.total ?? a.total,
|
|
1698
|
+
cumulative: a.cumulative,
|
|
1699
|
+
currentValue: a.currentValue,
|
|
1700
|
+
safeIndex: a.safeIndex
|
|
1685
1701
|
};
|
|
1686
1702
|
}
|
|
1687
1703
|
/**
|
|
@@ -1698,10 +1714,10 @@ class le {
|
|
|
1698
1714
|
for (; s << 1 <= this.size; )
|
|
1699
1715
|
s <<= 1;
|
|
1700
1716
|
for (; s > 0; s >>= 1) {
|
|
1701
|
-
const
|
|
1702
|
-
if (
|
|
1703
|
-
const d = (this.tree.get(
|
|
1704
|
-
(e ? i + d < t : i + d <= t) && (r =
|
|
1717
|
+
const a = r + s;
|
|
1718
|
+
if (a <= this.size) {
|
|
1719
|
+
const d = (this.tree.get(a) ?? 0) + this.baseValue * s;
|
|
1720
|
+
(e ? i + d < t : i + d <= t) && (r = a, i += d);
|
|
1705
1721
|
}
|
|
1706
1722
|
}
|
|
1707
1723
|
return e ? r : r - 1;
|
|
@@ -1714,42 +1730,42 @@ class le {
|
|
|
1714
1730
|
_findIndexLarge(t, e, r) {
|
|
1715
1731
|
if (this.size === 0)
|
|
1716
1732
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1717
|
-
const i =
|
|
1733
|
+
const i = Pr(this.size);
|
|
1718
1734
|
if (i === 0n)
|
|
1719
1735
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1720
1736
|
this._materializeRanges(e.materializeOption);
|
|
1721
1737
|
const s = e.materializeOption?.materialize === !0;
|
|
1722
1738
|
for (; ; ) {
|
|
1723
|
-
let
|
|
1724
|
-
for (;
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1727
|
-
if (d =
|
|
1728
|
-
if (
|
|
1739
|
+
let a = 0n, c = i - 1n, d, b, x = this.total;
|
|
1740
|
+
for (; a <= c; ) {
|
|
1741
|
+
const m = a + c >> 1n, _ = Number(m), B = this.prefixSum(_);
|
|
1742
|
+
if (x = B.total, r ? B.cumulative >= t : B.cumulative <= t)
|
|
1743
|
+
if (d = m, b = B, r) {
|
|
1744
|
+
if (m === 0n)
|
|
1729
1745
|
break;
|
|
1730
|
-
c =
|
|
1746
|
+
c = m - 1n;
|
|
1731
1747
|
} else
|
|
1732
|
-
|
|
1748
|
+
a = m + 1n;
|
|
1733
1749
|
else if (r)
|
|
1734
|
-
|
|
1750
|
+
a = m + 1n;
|
|
1735
1751
|
else {
|
|
1736
|
-
if (
|
|
1752
|
+
if (m === 0n)
|
|
1737
1753
|
break;
|
|
1738
|
-
c =
|
|
1754
|
+
c = m - 1n;
|
|
1739
1755
|
}
|
|
1740
1756
|
}
|
|
1741
|
-
const
|
|
1757
|
+
const v = b, E = d !== void 0 ? Number(d) : -1;
|
|
1742
1758
|
if (s && E >= 0) {
|
|
1743
|
-
const
|
|
1744
|
-
if (this._materialize(E), (this.deltas.get(E) ?? 0) !==
|
|
1759
|
+
const m = this.deltas.get(E) ?? 0;
|
|
1760
|
+
if (this._materialize(E), (this.deltas.get(E) ?? 0) !== m)
|
|
1745
1761
|
continue;
|
|
1746
1762
|
}
|
|
1747
1763
|
return {
|
|
1748
1764
|
index: E,
|
|
1749
|
-
total:
|
|
1750
|
-
cumulative:
|
|
1751
|
-
currentValue:
|
|
1752
|
-
safeIndex:
|
|
1765
|
+
total: x,
|
|
1766
|
+
cumulative: v?.cumulative,
|
|
1767
|
+
currentValue: v?.currentValue,
|
|
1768
|
+
safeIndex: v?.safeIndex
|
|
1753
1769
|
};
|
|
1754
1770
|
}
|
|
1755
1771
|
}
|
|
@@ -1766,16 +1782,16 @@ class le {
|
|
|
1766
1782
|
return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
|
|
1767
1783
|
if (this.size === 0)
|
|
1768
1784
|
return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
|
|
1769
|
-
const r =
|
|
1785
|
+
const r = vt(Math.trunc(t), 0, this.size - 1), i = e?.materializeOption;
|
|
1770
1786
|
this._materializeRanges(i, r, !0);
|
|
1771
|
-
let s = 0,
|
|
1772
|
-
for (;
|
|
1773
|
-
const d = this.tree.get(
|
|
1787
|
+
let s = 0, a = r + 1;
|
|
1788
|
+
for (; a > 0; ) {
|
|
1789
|
+
const d = this.tree.get(a) ?? 0;
|
|
1774
1790
|
s += d;
|
|
1775
|
-
const
|
|
1776
|
-
if (
|
|
1791
|
+
const b = xe(a);
|
|
1792
|
+
if (b === 0)
|
|
1777
1793
|
break;
|
|
1778
|
-
|
|
1794
|
+
a -= b;
|
|
1779
1795
|
}
|
|
1780
1796
|
const c = i?.materialize ? this.get(r) : (this.deltas.get(r) || 0) + this.baseValue;
|
|
1781
1797
|
return { cumulative: s + this.baseValue * (r + 1), total: this.total, currentValue: c, safeIndex: r };
|
|
@@ -1835,10 +1851,10 @@ class le {
|
|
|
1835
1851
|
let s = r + 1;
|
|
1836
1852
|
for (; s <= this.size; ) {
|
|
1837
1853
|
e.set(s, (e.get(s) ?? 0) + i);
|
|
1838
|
-
const
|
|
1839
|
-
if (
|
|
1854
|
+
const a = xe(s);
|
|
1855
|
+
if (a === 0)
|
|
1840
1856
|
break;
|
|
1841
|
-
s +=
|
|
1857
|
+
s += a;
|
|
1842
1858
|
}
|
|
1843
1859
|
}
|
|
1844
1860
|
this.tree = e, this.total = this._computeTreeTotal();
|
|
@@ -1952,17 +1968,17 @@ class le {
|
|
|
1952
1968
|
_propagateDeltaToGrownNodes(t, e, r, i) {
|
|
1953
1969
|
let s = t + 1;
|
|
1954
1970
|
for (; s <= r; ) {
|
|
1955
|
-
const
|
|
1956
|
-
if (
|
|
1971
|
+
const a = xe(s);
|
|
1972
|
+
if (a === 0)
|
|
1957
1973
|
break;
|
|
1958
|
-
s +=
|
|
1974
|
+
s += a;
|
|
1959
1975
|
}
|
|
1960
1976
|
for (; s <= i; ) {
|
|
1961
1977
|
this.tree.set(s, (this.tree.get(s) ?? 0) + e);
|
|
1962
|
-
const
|
|
1963
|
-
if (
|
|
1978
|
+
const a = xe(s);
|
|
1979
|
+
if (a === 0)
|
|
1964
1980
|
break;
|
|
1965
|
-
s +=
|
|
1981
|
+
s += a;
|
|
1966
1982
|
}
|
|
1967
1983
|
}
|
|
1968
1984
|
/**
|
|
@@ -1975,15 +1991,15 @@ class le {
|
|
|
1975
1991
|
*/
|
|
1976
1992
|
_growSize(t, e) {
|
|
1977
1993
|
if (this.size = e, this.deltas.size > 0) {
|
|
1978
|
-
const r =
|
|
1994
|
+
const r = me._minCoveredLowBound(t, e);
|
|
1979
1995
|
if (t - r < this.deltas.size)
|
|
1980
1996
|
for (let s = r; s < t; s++) {
|
|
1981
|
-
const
|
|
1982
|
-
|
|
1997
|
+
const a = this.deltas.get(s);
|
|
1998
|
+
a === void 0 || a === 0 || this._propagateDeltaToGrownNodes(s, a, t, e);
|
|
1983
1999
|
}
|
|
1984
2000
|
else
|
|
1985
|
-
for (const [s,
|
|
1986
|
-
|
|
2001
|
+
for (const [s, a] of this.deltas.entries())
|
|
2002
|
+
a === 0 || s < r || this._propagateDeltaToGrownNodes(s, a, t, e);
|
|
1987
2003
|
}
|
|
1988
2004
|
this.total = this._computeTreeTotal();
|
|
1989
2005
|
}
|
|
@@ -2053,20 +2069,20 @@ class le {
|
|
|
2053
2069
|
return this._findIndex(t, e ?? {}, !1);
|
|
2054
2070
|
}
|
|
2055
2071
|
}
|
|
2056
|
-
const
|
|
2072
|
+
const Mr = (n, t) => {
|
|
2057
2073
|
const e = n?.sampleRange, r = t?.sampleRange;
|
|
2058
2074
|
return e === r ? !1 : e && r ? e.from !== r.from || e.to !== r.to : !0;
|
|
2059
|
-
},
|
|
2060
|
-
const r = Number.isFinite(n) && n > 0 ? Math.trunc(n) : 0, i =
|
|
2061
|
-
i.current === null && (i.current = new
|
|
2062
|
-
const
|
|
2063
|
-
if (
|
|
2075
|
+
}, yr = (n, t, e) => {
|
|
2076
|
+
const r = Number.isFinite(n) && n > 0 ? Math.trunc(n) : 0, i = I(null), s = I({ size: r, valueOrFn: t, options: e });
|
|
2077
|
+
i.current === null && (i.current = new me(r, t, e));
|
|
2078
|
+
const a = i.current, c = s.current, d = c.size !== r, b = c.valueOrFn !== t, x = Mr(c.options, e), v = c.size === 0 && r > 0 && (!i.current || i.current.base === 0);
|
|
2079
|
+
if (b || x) {
|
|
2064
2080
|
const E = e?.resetOnValueFnChange ?? !0;
|
|
2065
|
-
|
|
2066
|
-
} else d && (e?.debug && C.debug("[useFenwickMapTree] resize", { from: c.size, to: r }),
|
|
2067
|
-
return
|
|
2081
|
+
x || b && E || v ? (e?.debug && C.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: x }), a.reset(r, t, e)) : (d && (e?.debug && C.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: r }), a.changeSize(r)), e?.debug && C.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(t, { reset: !1 })), s.current = { size: r, valueOrFn: t, options: e };
|
|
2082
|
+
} else d && (e?.debug && C.debug("[useFenwickMapTree] resize", { from: c.size, to: r }), v ? a.reset(r, t, e) : a.changeSize(r), s.current = { size: r, valueOrFn: t, options: e });
|
|
2083
|
+
return a;
|
|
2068
2084
|
};
|
|
2069
|
-
class
|
|
2085
|
+
class wr {
|
|
2070
2086
|
key;
|
|
2071
2087
|
value;
|
|
2072
2088
|
prev = null;
|
|
@@ -2075,7 +2091,7 @@ class Pr {
|
|
|
2075
2091
|
this.key = t, this.value = e;
|
|
2076
2092
|
}
|
|
2077
2093
|
}
|
|
2078
|
-
class
|
|
2094
|
+
class ze {
|
|
2079
2095
|
head = null;
|
|
2080
2096
|
tail = null;
|
|
2081
2097
|
/**
|
|
@@ -2116,118 +2132,118 @@ class Fe {
|
|
|
2116
2132
|
this.remove(t), this.addToTail(t);
|
|
2117
2133
|
}
|
|
2118
2134
|
}
|
|
2119
|
-
function
|
|
2120
|
-
const t =
|
|
2121
|
-
|
|
2135
|
+
function Rr(n) {
|
|
2136
|
+
const t = I(/* @__PURE__ */ new Map()), e = I(new ze()), r = Math.floor(n), i = I(r);
|
|
2137
|
+
q(() => {
|
|
2122
2138
|
if (i.current = r, Number.isNaN(r) || r < 0) {
|
|
2123
|
-
C.warn(`useLruCache: invalid capacity ${n}; the cache will not store any entries.`), t.current.clear(), e.current = new
|
|
2139
|
+
C.warn(`useLruCache: invalid capacity ${n}; the cache will not store any entries.`), t.current.clear(), e.current = new ze();
|
|
2124
2140
|
return;
|
|
2125
2141
|
}
|
|
2126
2142
|
if (Number.isFinite(r))
|
|
2127
2143
|
for (; t.current.size > r; ) {
|
|
2128
|
-
const
|
|
2129
|
-
if (
|
|
2130
|
-
t.current.delete(
|
|
2144
|
+
const x = e.current.removeHead();
|
|
2145
|
+
if (x)
|
|
2146
|
+
t.current.delete(x.key);
|
|
2131
2147
|
else
|
|
2132
2148
|
break;
|
|
2133
2149
|
}
|
|
2134
2150
|
}, [n, r]);
|
|
2135
|
-
const s = S((
|
|
2136
|
-
const
|
|
2137
|
-
if (
|
|
2138
|
-
return e.current.moveToTail(
|
|
2139
|
-
}, []),
|
|
2151
|
+
const s = S((x) => {
|
|
2152
|
+
const v = t.current.get(x);
|
|
2153
|
+
if (v)
|
|
2154
|
+
return e.current.moveToTail(v), v.value;
|
|
2155
|
+
}, []), a = S((x, v) => {
|
|
2140
2156
|
const E = i.current;
|
|
2141
2157
|
if (Number.isNaN(E) || E <= 0)
|
|
2142
2158
|
return;
|
|
2143
|
-
let
|
|
2144
|
-
if (
|
|
2145
|
-
|
|
2159
|
+
let m = t.current.get(x);
|
|
2160
|
+
if (m)
|
|
2161
|
+
m.value = v, e.current.moveToTail(m);
|
|
2146
2162
|
else {
|
|
2147
2163
|
if (t.current.size >= E) {
|
|
2148
2164
|
const _ = e.current.removeHead();
|
|
2149
2165
|
_ && t.current.delete(_.key);
|
|
2150
2166
|
}
|
|
2151
|
-
|
|
2167
|
+
m = new wr(x, v), t.current.set(x, m), e.current.addToTail(m);
|
|
2152
2168
|
}
|
|
2153
|
-
}, []), c = S((
|
|
2154
|
-
const
|
|
2155
|
-
|
|
2156
|
-
}, []),
|
|
2157
|
-
t.current.clear(), e.current = new
|
|
2169
|
+
}, []), c = S((x) => t.current.has(x), []), d = S((x) => {
|
|
2170
|
+
const v = t.current.get(x);
|
|
2171
|
+
v && (e.current.remove(v), t.current.delete(x));
|
|
2172
|
+
}, []), b = S(() => {
|
|
2173
|
+
t.current.clear(), e.current = new ze();
|
|
2158
2174
|
}, []);
|
|
2159
|
-
return
|
|
2175
|
+
return Lt(() => ({ get: s, set: a, has: c, remove: d, clear: b }), [s, a, c, d, b]);
|
|
2160
2176
|
}
|
|
2161
|
-
const
|
|
2162
|
-
const { get: n, set: t, has: e, clear: r } =
|
|
2163
|
-
return
|
|
2164
|
-
},
|
|
2177
|
+
const Cr = 1e4, Fr = () => {
|
|
2178
|
+
const { get: n, set: t, has: e, clear: r } = Rr(Cr);
|
|
2179
|
+
return Lt(() => ({ get: n, set: t, has: e, clear: r }), [n, t, e, r]);
|
|
2180
|
+
}, It = (n, t) => t <= 0 ? 0 : vt(n, 0, t - 1), Ke = (n) => ({
|
|
2165
2181
|
top: Math.max(0, n?.top ?? 0),
|
|
2166
2182
|
bottom: Math.max(0, n?.bottom ?? 0)
|
|
2167
|
-
}),
|
|
2183
|
+
}), oe = (n, t) => n <= t ? 0 : n - t, Ie = (n, t) => n <= 0 ? t : n + t, Ae = 1e3, We = 2e3, Er = 1048576, ye = (n) => {
|
|
2168
2184
|
if (!Number.isFinite(n)) return 0n;
|
|
2169
2185
|
const t = Math.trunc(n);
|
|
2170
2186
|
return t <= 0 ? 0n : BigInt(t);
|
|
2171
|
-
},
|
|
2172
|
-
const d =
|
|
2187
|
+
}, Nr = (n, t, e, r, i, s, a, c) => {
|
|
2188
|
+
const d = ye(r);
|
|
2173
2189
|
if (d === 0n)
|
|
2174
2190
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2175
|
-
const
|
|
2176
|
-
let
|
|
2177
|
-
|
|
2191
|
+
const b = (D) => D < 0n ? 0n : D >= d ? d - 1n : D, x = { materializeOption: { materialize: !1 } }, { index: v, cumulative: E } = s.findIndexAtOrAfter(n, x);
|
|
2192
|
+
let m;
|
|
2193
|
+
v === -1 ? m = d - 1n : (E === n ? m = ye(v + 1) : m = ye(v), m >= d && (m = d - 1n)), n <= 0 && (m = 0n), c && n >= a && (m = d - 1n);
|
|
2178
2194
|
const _ = (D) => {
|
|
2179
|
-
const
|
|
2180
|
-
if (!Number.isSafeInteger(
|
|
2195
|
+
const k = Number(D);
|
|
2196
|
+
if (!Number.isSafeInteger(k))
|
|
2181
2197
|
return null;
|
|
2182
|
-
const { cumulative: P } = s.prefixSum(
|
|
2198
|
+
const { cumulative: P } = s.prefixSum(k, { materializeOption: { materialize: !1 } });
|
|
2183
2199
|
if (!Number.isFinite(P))
|
|
2184
2200
|
return null;
|
|
2185
|
-
const { index:
|
|
2186
|
-
if (
|
|
2201
|
+
const { index: X } = s.findIndexAtOrAfter(P + 0.5, { materializeOption: { materialize: !1 } });
|
|
2202
|
+
if (X === -1)
|
|
2187
2203
|
return null;
|
|
2188
|
-
const
|
|
2189
|
-
return
|
|
2190
|
-
},
|
|
2191
|
-
let
|
|
2192
|
-
for (; P < d &&
|
|
2193
|
-
const
|
|
2194
|
-
if (
|
|
2204
|
+
const $ = ye(X);
|
|
2205
|
+
return $ > D ? $ : null;
|
|
2206
|
+
}, B = (D) => {
|
|
2207
|
+
let k = 0, P = D, X = D, $ = 0n, N = 0;
|
|
2208
|
+
for (; P < d && k < t; ) {
|
|
2209
|
+
const lt = Number(P), K = i(lt);
|
|
2210
|
+
if (k += K, X = P, P += 1n, $ += 1n, !Number.isFinite(K) || K < 0)
|
|
2195
2211
|
break;
|
|
2196
|
-
if (
|
|
2197
|
-
if (
|
|
2198
|
-
const
|
|
2199
|
-
if (
|
|
2200
|
-
P =
|
|
2201
|
-
else if (
|
|
2202
|
-
|
|
2212
|
+
if (K === 0) {
|
|
2213
|
+
if (N += 1, N > Ae) {
|
|
2214
|
+
const T = _(X);
|
|
2215
|
+
if (T !== null && T > P)
|
|
2216
|
+
P = T, N = 0;
|
|
2217
|
+
else if (T !== null && T === P && i(Number(P)) > 0)
|
|
2218
|
+
N = 0;
|
|
2203
2219
|
else
|
|
2204
2220
|
break;
|
|
2205
2221
|
}
|
|
2206
2222
|
} else
|
|
2207
|
-
|
|
2223
|
+
N = 0;
|
|
2208
2224
|
}
|
|
2209
|
-
return
|
|
2225
|
+
return $ === 0n && (X = D), { height: k, end: X };
|
|
2210
2226
|
};
|
|
2211
|
-
let { height:
|
|
2212
|
-
if (
|
|
2213
|
-
let D =
|
|
2214
|
-
for (; D > 0n &&
|
|
2227
|
+
let { height: Z, end: ut } = B(m);
|
|
2228
|
+
if (Z < t && m > 0n) {
|
|
2229
|
+
let D = m, k = Z, P = 0;
|
|
2230
|
+
for (; D > 0n && k < t; ) {
|
|
2215
2231
|
D -= 1n;
|
|
2216
|
-
const
|
|
2217
|
-
if (
|
|
2232
|
+
const $ = Number(D), N = i($);
|
|
2233
|
+
if (k += N, !Number.isFinite(N) || N < 0)
|
|
2218
2234
|
break;
|
|
2219
|
-
if (
|
|
2220
|
-
if (P += 1, P >
|
|
2221
|
-
const
|
|
2222
|
-
if (!Number.isSafeInteger(
|
|
2235
|
+
if (N === 0) {
|
|
2236
|
+
if (P += 1, P > Ae) {
|
|
2237
|
+
const lt = Number(D);
|
|
2238
|
+
if (!Number.isSafeInteger(lt))
|
|
2223
2239
|
break;
|
|
2224
|
-
const { cumulative:
|
|
2225
|
-
if (!Number.isFinite(
|
|
2240
|
+
const { cumulative: K } = s.prefixSum(lt, { materializeOption: { materialize: !1 } });
|
|
2241
|
+
if (!Number.isFinite(K))
|
|
2226
2242
|
break;
|
|
2227
|
-
const { index:
|
|
2228
|
-
if (
|
|
2229
|
-
D =
|
|
2230
|
-
else if (
|
|
2243
|
+
const { index: T } = s.findIndexAtOrAfter(K - 0.5, { materializeOption: { materialize: !1 } }), V = T === -1 ? -1n : ye(T);
|
|
2244
|
+
if (V >= 0n && V < D)
|
|
2245
|
+
D = V + 1n, P = 0;
|
|
2246
|
+
else if (V === D && D >= 1n && i(Number(D - 1n)) > 0)
|
|
2231
2247
|
P = 0;
|
|
2232
2248
|
else
|
|
2233
2249
|
break;
|
|
@@ -2235,90 +2251,90 @@ const wr = 1e4, kr = () => {
|
|
|
2235
2251
|
} else
|
|
2236
2252
|
P = 0;
|
|
2237
2253
|
}
|
|
2238
|
-
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2254
|
+
m = b(D);
|
|
2255
|
+
const X = B(m);
|
|
2256
|
+
Z = X.height, ut = X.end;
|
|
2241
2257
|
}
|
|
2242
|
-
const
|
|
2258
|
+
const rt = b(m), nt = b(ut), pt = b(rt - BigInt(Math.max(0, e))), Pt = b(nt + BigInt(Math.max(0, e)));
|
|
2243
2259
|
return {
|
|
2244
|
-
renderingStartIndex:
|
|
2245
|
-
renderingEndIndex:
|
|
2246
|
-
visibleStartIndex:
|
|
2247
|
-
visibleEndIndex:
|
|
2260
|
+
renderingStartIndex: It(Number(pt), r),
|
|
2261
|
+
renderingEndIndex: It(Number(Pt), r),
|
|
2262
|
+
visibleStartIndex: It(Number(rt), r),
|
|
2263
|
+
visibleEndIndex: It(Number(nt), r)
|
|
2248
2264
|
};
|
|
2249
|
-
},
|
|
2265
|
+
}, Vr = (n, t, e, r, i, s, a) => {
|
|
2250
2266
|
if (r === 0)
|
|
2251
2267
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2252
|
-
const c = Number.isFinite(
|
|
2268
|
+
const c = Number.isFinite(a), d = c ? Math.min(Math.max(0, n), a) : Math.max(0, n);
|
|
2253
2269
|
if (r >= Number.MAX_SAFE_INTEGER)
|
|
2254
|
-
return
|
|
2255
|
-
const { index:
|
|
2256
|
-
let
|
|
2257
|
-
if (
|
|
2258
|
-
|
|
2259
|
-
else if (
|
|
2260
|
-
_ =
|
|
2270
|
+
return Nr(d, t, e, r, i, s, a, c);
|
|
2271
|
+
const { index: b, cumulative: x, currentValue: v } = s.findIndexAtOrAfter(d, { materializeOption: { materialize: !1 } }), E = b === -1 ? t <= 0 || (x ?? 0) < d + (v ?? 0) ? r - 1 : 0 : b;
|
|
2272
|
+
let m = It(E, r), _ = 0;
|
|
2273
|
+
if (b !== -1 && x === d)
|
|
2274
|
+
m = It(b + 1, r), _ = 0;
|
|
2275
|
+
else if (m === b && x !== void 0 && v !== void 0)
|
|
2276
|
+
_ = x - v - d;
|
|
2261
2277
|
else {
|
|
2262
|
-
const { cumulative: D, currentValue:
|
|
2263
|
-
_ = (D ?? 0) - (
|
|
2278
|
+
const { cumulative: D, currentValue: k } = s.prefixSum(m, { materializeOption: { materialize: !1 } });
|
|
2279
|
+
_ = (D ?? 0) - (k ?? 0) - d;
|
|
2264
2280
|
}
|
|
2265
|
-
const
|
|
2266
|
-
let P = D,
|
|
2267
|
-
for (; P < r &&
|
|
2268
|
-
const
|
|
2269
|
-
if (
|
|
2281
|
+
const B = _, Z = (D, k) => {
|
|
2282
|
+
let P = D, X = k, $ = 0;
|
|
2283
|
+
for (; P < r && X < t; ) {
|
|
2284
|
+
const N = i(P);
|
|
2285
|
+
if (X += N, P++, !Number.isFinite(N) || N < 0)
|
|
2270
2286
|
break;
|
|
2271
|
-
if (
|
|
2272
|
-
if (
|
|
2273
|
-
const { cumulative:
|
|
2274
|
-
if (
|
|
2275
|
-
P =
|
|
2276
|
-
else if (
|
|
2277
|
-
|
|
2287
|
+
if (N === 0) {
|
|
2288
|
+
if ($++, $ > Ae) {
|
|
2289
|
+
const { cumulative: lt } = s.prefixSum(P - 1, { materializeOption: { materialize: !1 } }), { index: K } = Number.isFinite(lt) ? s.findIndexAtOrAfter(lt + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2290
|
+
if (K > P)
|
|
2291
|
+
P = K, $ = 0;
|
|
2292
|
+
else if (K === P && i(P) > 0)
|
|
2293
|
+
$ = 0;
|
|
2278
2294
|
else
|
|
2279
2295
|
break;
|
|
2280
2296
|
}
|
|
2281
2297
|
} else
|
|
2282
|
-
|
|
2298
|
+
$ = 0;
|
|
2283
2299
|
}
|
|
2284
|
-
return { cursor: P, height:
|
|
2285
|
-
}, ut =
|
|
2286
|
-
let
|
|
2287
|
-
if (_ = ut.height, _ < t &&
|
|
2288
|
-
let D = _ + Math.abs(Math.min(0,
|
|
2289
|
-
for (;
|
|
2290
|
-
const
|
|
2291
|
-
if (D +=
|
|
2292
|
-
|
|
2300
|
+
return { cursor: P, height: X };
|
|
2301
|
+
}, ut = Z(m, _);
|
|
2302
|
+
let rt = ut.cursor;
|
|
2303
|
+
if (_ = ut.height, _ < t && m > 0) {
|
|
2304
|
+
let D = _ + Math.abs(Math.min(0, B)), k = m - 1, P = 0;
|
|
2305
|
+
for (; k >= 0 && D < t; ) {
|
|
2306
|
+
const $ = i(k);
|
|
2307
|
+
if (D += $, !Number.isFinite($) || $ < 0) {
|
|
2308
|
+
k--;
|
|
2293
2309
|
break;
|
|
2294
2310
|
}
|
|
2295
|
-
if (
|
|
2296
|
-
if (P++, P >
|
|
2297
|
-
const { cumulative:
|
|
2298
|
-
if (
|
|
2299
|
-
|
|
2311
|
+
if ($ === 0) {
|
|
2312
|
+
if (P++, P > Ae) {
|
|
2313
|
+
const { cumulative: N } = s.prefixSum(k, { materializeOption: { materialize: !1 } }), { index: lt } = Number.isFinite(N) ? s.findIndexAtOrAfter(N - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2314
|
+
if (lt !== -1 && lt < k) {
|
|
2315
|
+
k = lt, P = 0;
|
|
2300
2316
|
continue;
|
|
2301
2317
|
}
|
|
2302
|
-
if (
|
|
2318
|
+
if (lt === k && k >= 1 && i(k - 1) > 0)
|
|
2303
2319
|
P = 0;
|
|
2304
2320
|
else {
|
|
2305
|
-
|
|
2321
|
+
k--;
|
|
2306
2322
|
break;
|
|
2307
2323
|
}
|
|
2308
2324
|
}
|
|
2309
2325
|
} else
|
|
2310
2326
|
P = 0;
|
|
2311
|
-
|
|
2327
|
+
k--;
|
|
2312
2328
|
}
|
|
2313
|
-
|
|
2314
|
-
const
|
|
2315
|
-
|
|
2329
|
+
m = It(k + 1, r);
|
|
2330
|
+
const X = Z(m, 0);
|
|
2331
|
+
rt = X.cursor, _ = X.height;
|
|
2316
2332
|
}
|
|
2317
|
-
const
|
|
2318
|
-
return { renderingStartIndex:
|
|
2319
|
-
},
|
|
2320
|
-
const r = Math.max(0, t ?? 0), i =
|
|
2321
|
-
return
|
|
2333
|
+
const nt = It(m - e, r), pt = It(Math.max(rt - 1, m), r), Pt = It(pt + e, r);
|
|
2334
|
+
return { renderingStartIndex: nt, renderingEndIndex: Pt, visibleStartIndex: m, visibleEndIndex: pt };
|
|
2335
|
+
}, je = (n, t, e) => {
|
|
2336
|
+
const r = Math.max(0, t ?? 0), i = I({ last: 0, id: null, arg: null }).current;
|
|
2337
|
+
return q(
|
|
2322
2338
|
() => () => {
|
|
2323
2339
|
i.id !== null && (cancelAnimationFrame(i.id), i.id = null);
|
|
2324
2340
|
},
|
|
@@ -2326,32 +2342,32 @@ const wr = 1e4, kr = () => {
|
|
|
2326
2342
|
), S(
|
|
2327
2343
|
(s) => {
|
|
2328
2344
|
if (i.arg = s, i.id !== null) return;
|
|
2329
|
-
const
|
|
2345
|
+
const a = (c) => {
|
|
2330
2346
|
if (i.id = null, i.arg === null) return;
|
|
2331
2347
|
const d = c - i.last;
|
|
2332
2348
|
if (r === 0 || i.last === 0 || d >= r) {
|
|
2333
2349
|
if (n.current)
|
|
2334
2350
|
try {
|
|
2335
2351
|
e(n.current, i.arg);
|
|
2336
|
-
} catch (
|
|
2337
|
-
console.error("[useThrottledInvoker] Error invoking callback",
|
|
2352
|
+
} catch (b) {
|
|
2353
|
+
console.error("[useThrottledInvoker] Error invoking callback", b);
|
|
2338
2354
|
}
|
|
2339
2355
|
i.arg = null, i.last = c;
|
|
2340
2356
|
}
|
|
2341
|
-
i.arg !== null && (i.id = requestAnimationFrame(
|
|
2357
|
+
i.arg !== null && (i.id = requestAnimationFrame(a));
|
|
2342
2358
|
};
|
|
2343
|
-
i.id = requestAnimationFrame(
|
|
2359
|
+
i.id = requestAnimationFrame(a);
|
|
2344
2360
|
},
|
|
2345
2361
|
[r, e, n, i]
|
|
2346
2362
|
);
|
|
2347
|
-
},
|
|
2348
|
-
const
|
|
2363
|
+
}, Ar = Qe.memo(({ index: n, top: t, height: e, item: r, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: c, onFocus: d, registerItemRef: b }) => {
|
|
2364
|
+
const x = S((_) => b(n, _), [n, b]), v = S((_) => c(_, n), [n, c]), E = S(() => d(n), [n, d]), m = S((_) => {
|
|
2349
2365
|
_.currentTarget.focus({ preventScroll: !0 });
|
|
2350
2366
|
}, []);
|
|
2351
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ ot(
|
|
2352
2368
|
"div",
|
|
2353
2369
|
{
|
|
2354
|
-
ref:
|
|
2370
|
+
ref: x,
|
|
2355
2371
|
"data-index": n,
|
|
2356
2372
|
"data-virtualscroll-item": "true",
|
|
2357
2373
|
className: "aqvs-item-container",
|
|
@@ -2360,580 +2376,582 @@ const wr = 1e4, kr = () => {
|
|
|
2360
2376
|
height: e,
|
|
2361
2377
|
overflow: s ? "hidden" : void 0
|
|
2362
2378
|
},
|
|
2363
|
-
tabIndex:
|
|
2364
|
-
onPointerDown:
|
|
2365
|
-
onKeyDownCapture:
|
|
2366
|
-
onFocusCapture:
|
|
2379
|
+
tabIndex: a ? -1 : void 0,
|
|
2380
|
+
onPointerDown: a ? m : void 0,
|
|
2381
|
+
onKeyDownCapture: a ? v : void 0,
|
|
2382
|
+
onFocusCapture: a ? E : void 0,
|
|
2367
2383
|
children: i(r, n)
|
|
2368
2384
|
}
|
|
2369
2385
|
);
|
|
2370
|
-
}),
|
|
2386
|
+
}), Dr = ({
|
|
2371
2387
|
itemCount: n,
|
|
2372
2388
|
getItem: t,
|
|
2373
2389
|
getItemKey: e,
|
|
2374
2390
|
getItemHeight: r,
|
|
2375
2391
|
viewportSize: i,
|
|
2376
2392
|
overscanCount: s = 15,
|
|
2377
|
-
className:
|
|
2393
|
+
className: a,
|
|
2378
2394
|
testId: c,
|
|
2379
2395
|
onScroll: d,
|
|
2380
|
-
onRangeChange:
|
|
2381
|
-
children:
|
|
2382
|
-
background:
|
|
2396
|
+
onRangeChange: b,
|
|
2397
|
+
children: x,
|
|
2398
|
+
background: v,
|
|
2383
2399
|
initialScrollIndex: E,
|
|
2384
|
-
initialScrollOffset:
|
|
2400
|
+
initialScrollOffset: m,
|
|
2385
2401
|
callbackThrottleMs: _ = 5,
|
|
2386
|
-
contentInsets:
|
|
2387
|
-
onItemFocus:
|
|
2402
|
+
contentInsets: B,
|
|
2403
|
+
onItemFocus: Z,
|
|
2388
2404
|
scrollBarOptions: ut,
|
|
2389
|
-
behaviorOptions:
|
|
2390
|
-
onWheelHorizontal:
|
|
2391
|
-
|
|
2392
|
-
|
|
2405
|
+
behaviorOptions: rt,
|
|
2406
|
+
onWheelHorizontal: nt,
|
|
2407
|
+
contentProps: pt
|
|
2408
|
+
}, Pt) => {
|
|
2409
|
+
const { width: D, enableThumbDrag: k, enableTrackClick: P, enableArrowButtons: X, enableScrollToTopBottomButtons: $, renderThumbOverlay: N, tapScrollCircleOptions: lt } = ut ?? {}, { enablePointerDrag: K, pointerDragInputs: T, enableKeyboardNavigation: V = !0, wheelSpeedMultiplier: Tt, inertiaOptions: Yt, clipItemHeight: yt = !1, resetOnGetItemHeightChange: J = !1 } = rt ?? {}, F = I(null), Ct = I({
|
|
2393
2410
|
renderingStartIndex: 0,
|
|
2394
2411
|
renderingEndIndex: 0,
|
|
2395
2412
|
visibleStartIndex: 0,
|
|
2396
2413
|
visibleEndIndex: 0,
|
|
2397
2414
|
scrollPosition: 0,
|
|
2398
2415
|
totalHeight: 0
|
|
2399
|
-
}),
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
}, [
|
|
2403
|
-
const y =
|
|
2416
|
+
}), W = I(null), At = I(!1);
|
|
2417
|
+
q(() => {
|
|
2418
|
+
J && (W.current = null);
|
|
2419
|
+
}, [J, r]);
|
|
2420
|
+
const y = Lt(() => Ke(B), [B]), [Kt] = Jt(() => {
|
|
2404
2421
|
const u = typeof E == "number" && Number.isFinite(E) ? Math.max(0, Math.trunc(E)) : 0;
|
|
2405
2422
|
return { from: Math.max(0, u - 50), to: u + 50 };
|
|
2406
|
-
}),
|
|
2423
|
+
}), ae = Lt(
|
|
2407
2424
|
// 目的: Fenwick Tree のオプション設定
|
|
2408
2425
|
// 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
|
|
2409
2426
|
// itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
|
|
2410
2427
|
// この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
|
|
2411
2428
|
() => ({
|
|
2412
|
-
sampleRange:
|
|
2413
|
-
resetOnValueFnChange:
|
|
2429
|
+
sampleRange: Kt,
|
|
2430
|
+
resetOnValueFnChange: J,
|
|
2414
2431
|
materialize: !0
|
|
2415
2432
|
}),
|
|
2416
|
-
[
|
|
2417
|
-
),
|
|
2418
|
-
let
|
|
2433
|
+
[J, Kt]
|
|
2434
|
+
), A = yr(n, r, ae), [j] = Jt(() => {
|
|
2435
|
+
let l = 0, u = 0;
|
|
2419
2436
|
if (typeof E == "number") {
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2422
|
-
} else typeof
|
|
2423
|
-
return { position:
|
|
2424
|
-
}), [Bt,
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
}, [
|
|
2428
|
-
const
|
|
2429
|
-
(
|
|
2430
|
-
if (
|
|
2437
|
+
const h = vt(E, 0, n - 1), R = vt(h - s * 2, 0, n - 1), O = vt(h + s * 2, 0, n - 1), Y = E > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: R, to: O }] } } : void 0, { cumulative: U, total: G, currentValue: Rt } = A.prefixSum(E, Y), bt = Math.max(U - Rt, 0);
|
|
2438
|
+
l = Ie(bt, y.top), u = G ?? A.getTotal();
|
|
2439
|
+
} else typeof m == "number" && (l = Ie(Math.max(m, 0), y.top)), u = A.getTotal();
|
|
2440
|
+
return { position: l, total: u };
|
|
2441
|
+
}), [Bt, _t] = Jt(j.position), [Et, Xt] = Jt(j.total), dt = I(j.position), p = I(y.top), ft = I(d ?? void 0), mt = I(b ?? void 0), z = I(/* @__PURE__ */ new Map()), et = I(null), ct = I(null), [kt, Ot] = Jt(null), [Mt, it] = Jt(!1), ht = I(null), st = I(!1), Q = I(0), qt = I(!1), le = I(!1), Nt = I(n);
|
|
2442
|
+
Nt.current !== n && (Nt.current = n, le.current = !0), q(() => {
|
|
2443
|
+
ft.current = d ?? void 0, mt.current = b ?? void 0;
|
|
2444
|
+
}, [b, d]);
|
|
2445
|
+
const $t = S(
|
|
2446
|
+
(l) => {
|
|
2447
|
+
if (V && l && typeof l.focus == "function")
|
|
2431
2448
|
try {
|
|
2432
|
-
|
|
2449
|
+
l.focus({ preventScroll: !0 });
|
|
2433
2450
|
} catch {
|
|
2434
|
-
|
|
2451
|
+
l.focus();
|
|
2435
2452
|
}
|
|
2436
2453
|
},
|
|
2437
|
-
[
|
|
2438
|
-
),
|
|
2439
|
-
|
|
2440
|
-
}, []),
|
|
2441
|
-
|
|
2442
|
-
}, []),
|
|
2443
|
-
|
|
2444
|
-
const
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
}), []),
|
|
2448
|
-
|
|
2449
|
-
}, [
|
|
2450
|
-
const
|
|
2451
|
-
(
|
|
2454
|
+
[V]
|
|
2455
|
+
), Gt = S((l, { position: u, totalHeight: h }) => {
|
|
2456
|
+
l(u, h);
|
|
2457
|
+
}, []), Vt = je(ft, _, Gt), f = S((l, u) => {
|
|
2458
|
+
l(u);
|
|
2459
|
+
}, []), w = je(mt, _, f), at = I(y.top);
|
|
2460
|
+
at.current = y.top;
|
|
2461
|
+
const gt = I(Vt);
|
|
2462
|
+
gt.current = Vt, q(() => (At.current = !1, () => {
|
|
2463
|
+
At.current = !0, ht.current && (clearTimeout(ht.current), ht.current = null);
|
|
2464
|
+
}), []), q(() => {
|
|
2465
|
+
V || (z.current.clear(), et.current = null, ct.current = null);
|
|
2466
|
+
}, [V]);
|
|
2467
|
+
const wt = S(
|
|
2468
|
+
(l, u) => {
|
|
2452
2469
|
if (!u) {
|
|
2453
|
-
|
|
2470
|
+
z.current.delete(l);
|
|
2454
2471
|
return;
|
|
2455
2472
|
}
|
|
2456
|
-
|
|
2473
|
+
V && (z.current.set(l, u), et.current === l && (et.current = null, ct.current = l, $t(u)));
|
|
2457
2474
|
},
|
|
2458
|
-
[
|
|
2459
|
-
),
|
|
2475
|
+
[V, $t]
|
|
2476
|
+
), Qt = 0.01, Ht = I({
|
|
2460
2477
|
rafId: null,
|
|
2461
2478
|
loopActive: !1,
|
|
2462
2479
|
idleFrames: 0,
|
|
2463
|
-
lastRenderedPosition:
|
|
2464
|
-
}),
|
|
2465
|
-
const
|
|
2466
|
-
|
|
2480
|
+
lastRenderedPosition: j.position
|
|
2481
|
+
}), Ut = S(() => {
|
|
2482
|
+
const l = Ht.current;
|
|
2483
|
+
l.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(l.rafId), l.rafId = null, l.loopActive = !1, l.idleFrames = 0;
|
|
2467
2484
|
}, []);
|
|
2468
|
-
|
|
2485
|
+
q(
|
|
2469
2486
|
() => () => {
|
|
2470
|
-
|
|
2487
|
+
Ut();
|
|
2471
2488
|
},
|
|
2472
|
-
[
|
|
2489
|
+
[Ut]
|
|
2473
2490
|
);
|
|
2474
|
-
const
|
|
2475
|
-
}),
|
|
2476
|
-
const
|
|
2477
|
-
|
|
2478
|
-
const u =
|
|
2479
|
-
if (
|
|
2480
|
-
|
|
2491
|
+
const te = I(() => {
|
|
2492
|
+
}), ce = S(() => {
|
|
2493
|
+
const l = Ht.current;
|
|
2494
|
+
l.rafId = null;
|
|
2495
|
+
const u = dt.current, h = oe(u, at.current), R = A.getTotal();
|
|
2496
|
+
if (_t((Y) => Math.abs(Y - u) < Qt ? Y : u), Math.abs(l.lastRenderedPosition - u) >= Qt ? (gt.current({ position: h, totalHeight: R }), l.lastRenderedPosition = u, l.idleFrames = 0) : l.idleFrames += 1, l.idleFrames >= 2) {
|
|
2497
|
+
Ut();
|
|
2481
2498
|
return;
|
|
2482
2499
|
}
|
|
2483
2500
|
if (typeof requestAnimationFrame == "function") {
|
|
2484
|
-
|
|
2501
|
+
l.rafId = requestAnimationFrame((Y) => te.current(Y));
|
|
2485
2502
|
return;
|
|
2486
2503
|
}
|
|
2487
|
-
|
|
2488
|
-
}, [
|
|
2489
|
-
|
|
2490
|
-
const
|
|
2491
|
-
const
|
|
2492
|
-
if (
|
|
2493
|
-
if (
|
|
2494
|
-
|
|
2504
|
+
l.loopActive = !1;
|
|
2505
|
+
}, [A, Ut]);
|
|
2506
|
+
te.current = ce;
|
|
2507
|
+
const ue = S(() => {
|
|
2508
|
+
const l = Ht.current;
|
|
2509
|
+
if (l.idleFrames = 0, !l.loopActive) {
|
|
2510
|
+
if (l.loopActive = !0, typeof requestAnimationFrame == "function") {
|
|
2511
|
+
l.rafId = requestAnimationFrame(ce);
|
|
2495
2512
|
return;
|
|
2496
2513
|
}
|
|
2497
|
-
|
|
2514
|
+
l.loopActive = !1;
|
|
2498
2515
|
}
|
|
2499
|
-
}, [
|
|
2500
|
-
(
|
|
2501
|
-
const
|
|
2502
|
-
if (
|
|
2503
|
-
|
|
2516
|
+
}, [ce]), tt = S(
|
|
2517
|
+
(l, u) => {
|
|
2518
|
+
const h = u?.immediate ?? !1, R = oe(l, y.top);
|
|
2519
|
+
if (dt.current = l, h) {
|
|
2520
|
+
Ht.current.lastRenderedPosition = l, Ht.current.idleFrames = 0, _t(l), Vt({ position: R, totalHeight: A.getTotal() });
|
|
2504
2521
|
return;
|
|
2505
2522
|
}
|
|
2506
|
-
|
|
2523
|
+
ue();
|
|
2507
2524
|
},
|
|
2508
|
-
[
|
|
2509
|
-
),
|
|
2510
|
-
const u =
|
|
2525
|
+
[ue, A, y.top, Vt]
|
|
2526
|
+
), ee = S((l) => {
|
|
2527
|
+
const u = F.current;
|
|
2511
2528
|
if (!u)
|
|
2512
|
-
return
|
|
2513
|
-
const
|
|
2514
|
-
|
|
2515
|
-
const
|
|
2516
|
-
return
|
|
2517
|
-
}, []),
|
|
2518
|
-
|
|
2519
|
-
if (!
|
|
2520
|
-
if (
|
|
2521
|
-
const
|
|
2522
|
-
|
|
2529
|
+
return l;
|
|
2530
|
+
const h = u.getScrollPosition();
|
|
2531
|
+
Q.current += 1;
|
|
2532
|
+
const R = u.scrollTo(l);
|
|
2533
|
+
return R === h && (Q.current = Math.max(0, Q.current - 1)), Math.abs(R - l) > 0.5 && (qt.current = !0), R;
|
|
2534
|
+
}, []), Se = I(!1);
|
|
2535
|
+
q(() => {
|
|
2536
|
+
if (!Se.current)
|
|
2537
|
+
if (Se.current = !0, typeof m == "number") {
|
|
2538
|
+
const l = Ie(Math.max(m, 0), y.top), u = Math.abs(l - dt.current) > 0.5;
|
|
2539
|
+
tt(l, { immediate: !0 }), u && F.current?.scrollTo(l);
|
|
2523
2540
|
} else
|
|
2524
|
-
|
|
2525
|
-
}, [
|
|
2526
|
-
const
|
|
2527
|
-
if (
|
|
2528
|
-
|
|
2541
|
+
tt(dt.current, { immediate: !0 });
|
|
2542
|
+
}, [m, y.top, tt]), q(() => {
|
|
2543
|
+
const l = A.getTotal();
|
|
2544
|
+
if (Et !== l) {
|
|
2545
|
+
Xt(l);
|
|
2529
2546
|
return;
|
|
2530
2547
|
}
|
|
2531
|
-
if (
|
|
2532
|
-
|
|
2533
|
-
const u =
|
|
2534
|
-
if (u && Math.abs(u.getScrollPosition() -
|
|
2535
|
-
const
|
|
2536
|
-
|
|
2548
|
+
if (qt.current) {
|
|
2549
|
+
qt.current = !1;
|
|
2550
|
+
const u = F.current;
|
|
2551
|
+
if (u && Math.abs(u.getScrollPosition() - dt.current) > 0.5) {
|
|
2552
|
+
const h = ee(dt.current);
|
|
2553
|
+
qt.current = !1, tt(h, { immediate: !0 });
|
|
2537
2554
|
}
|
|
2538
2555
|
}
|
|
2539
|
-
}, [
|
|
2540
|
-
if (
|
|
2541
|
-
const { index:
|
|
2542
|
-
if (
|
|
2543
|
-
const
|
|
2544
|
-
let
|
|
2545
|
-
u === "bottom" ?
|
|
2546
|
-
const
|
|
2547
|
-
Math.abs(
|
|
2548
|
-
from:
|
|
2549
|
-
to:
|
|
2550
|
-
targetIndex:
|
|
2551
|
-
}),
|
|
2556
|
+
}, [A, Et, n, ee, tt]), q(() => {
|
|
2557
|
+
if (W.current !== null) {
|
|
2558
|
+
const { index: l, align: u, offset: h } = W.current, R = It(l, n), { cumulative: O, currentValue: Y } = A.prefixSum(R, { materializeOption: { materialize: !1 } });
|
|
2559
|
+
if (O !== void 0 && Y !== void 0) {
|
|
2560
|
+
const U = Math.max(O - Y, 0);
|
|
2561
|
+
let G = U;
|
|
2562
|
+
u === "bottom" ? G = O - i : u === "center" && (G = U + Y / 2 - i / 2), h && (G -= h), G = Math.max(0, G);
|
|
2563
|
+
const Rt = Math.max(0, Et + y.top + y.bottom - i), bt = Math.min(Ie(G, y.top), Rt);
|
|
2564
|
+
Math.abs(bt - dt.current) > 1 && (C.debug("[VirtualScroll] Drift correction", {
|
|
2565
|
+
from: dt.current,
|
|
2566
|
+
to: bt,
|
|
2567
|
+
targetIndex: R
|
|
2568
|
+
}), Q.current === 0 && (Q.current += 1), F.current?.scrollTo(bt), tt(bt, { immediate: !0 }));
|
|
2552
2569
|
}
|
|
2553
2570
|
}
|
|
2554
|
-
|
|
2555
|
-
}, [
|
|
2556
|
-
const
|
|
2557
|
-
if (
|
|
2558
|
-
const u =
|
|
2559
|
-
|
|
2560
|
-
}, [y.top,
|
|
2561
|
-
const
|
|
2562
|
-
(
|
|
2571
|
+
le.current = !1;
|
|
2572
|
+
}, [Et, A, n, y.top, tt, i, y.bottom]), q(() => {
|
|
2573
|
+
const l = p.current;
|
|
2574
|
+
if (l === y.top) return;
|
|
2575
|
+
const u = oe(dt.current, l), h = Ie(u, y.top);
|
|
2576
|
+
p.current = y.top, dt.current = h, F.current?.scrollTo(h), tt(h, { immediate: !0 });
|
|
2577
|
+
}, [y.top, tt]);
|
|
2578
|
+
const we = S(
|
|
2579
|
+
(l, u) => {
|
|
2563
2580
|
if (n === 0)
|
|
2564
2581
|
return;
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2567
|
-
let
|
|
2568
|
-
if (
|
|
2569
|
-
const
|
|
2570
|
-
|
|
2582
|
+
const h = It(l, n), R = A.get(h), O = u - R, Y = A.update(h, u);
|
|
2583
|
+
Y !== void 0 && Xt(Y), C.debug("[VirtualScroll] Updated item size manually", { index: h, size: u, total: Y });
|
|
2584
|
+
let U = W.current ? W.current.index : null;
|
|
2585
|
+
if (U === null) {
|
|
2586
|
+
const G = dt.current, Rt = Ke(B).top, bt = oe(G, Rt), { index: xt, cumulative: Ft } = A.findIndexAtOrAfter(bt, { materializeOption: { materialize: !1 } });
|
|
2587
|
+
U = Ft !== void 0 && Ft === bt ? xt + 1 : xt;
|
|
2571
2588
|
}
|
|
2572
|
-
if (
|
|
2573
|
-
const
|
|
2574
|
-
|
|
2589
|
+
if (U !== -1 && h < U && O !== 0) {
|
|
2590
|
+
const G = dt.current, Rt = G + O;
|
|
2591
|
+
ee(Rt), tt(Rt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: G, to: Rt, causedByIndex: h, delta: O, activeVisibleStartIndex: U });
|
|
2575
2592
|
}
|
|
2576
2593
|
},
|
|
2577
|
-
[
|
|
2594
|
+
[A, n, ee, tt, B]
|
|
2578
2595
|
), Wt = S(
|
|
2579
|
-
(
|
|
2580
|
-
if (!
|
|
2596
|
+
(l, u) => {
|
|
2597
|
+
if (!F.current || n === 0)
|
|
2581
2598
|
return;
|
|
2582
|
-
const
|
|
2583
|
-
if (C.debug("[VirtualScroll] Scrolling to index:",
|
|
2599
|
+
const h = It(l, n), R = It(h - s * 2, n), O = It(h + s * 2, n), { cumulative: Y, total: U, currentValue: G } = A.prefixSum(h, { materializeOption: { materialize: !0, ranges: [{ from: R, to: O }] } });
|
|
2600
|
+
if (C.debug("[VirtualScroll] Scrolling to index:", h, "ItemBottom:", Y, "Total height:", U, "ItemHeight:", G, "safeIndexFrom:", R, "safeIndexTo:", O), !U)
|
|
2584
2601
|
return;
|
|
2585
|
-
const
|
|
2586
|
-
let
|
|
2587
|
-
u?.align === "bottom" ?
|
|
2588
|
-
const
|
|
2589
|
-
|
|
2590
|
-
index:
|
|
2602
|
+
const Rt = Math.max(Y - G, 0);
|
|
2603
|
+
let bt = Rt;
|
|
2604
|
+
u?.align === "bottom" ? bt = Y - i : u?.align === "center" && (bt = Rt + G / 2 - i / 2), u?.offset && (bt -= u.offset), bt = Math.max(0, bt);
|
|
2605
|
+
const xt = Ie(bt, y.top), Ft = F.current?.getContentSize() ?? U + y.top + y.bottom, Dt = Math.max(0, Ft - i), zt = Math.min(xt, Dt);
|
|
2606
|
+
W.current = {
|
|
2607
|
+
index: h,
|
|
2591
2608
|
align: u?.align,
|
|
2592
2609
|
offset: u?.offset
|
|
2593
2610
|
};
|
|
2594
|
-
const
|
|
2595
|
-
|
|
2611
|
+
const Pe = F.current?.getScrollPosition() ?? -1, Le = Math.abs(Pe - zt) > 0.5;
|
|
2612
|
+
st.current = !1, Q.current = 0, Le && (st.current = !0, Q.current += 1, F.current?.scrollTo(zt)), Xt(U), tt(zt, { immediate: !0 }), C.debug("[VirtualScroll] Setting scroll position to:", zt, { original: xt, max: Dt });
|
|
2596
2613
|
},
|
|
2597
|
-
[
|
|
2598
|
-
),
|
|
2599
|
-
(
|
|
2600
|
-
if (!
|
|
2614
|
+
[A, s, n, y.top, y.bottom, i, tt]
|
|
2615
|
+
), ge = S(
|
|
2616
|
+
(l) => {
|
|
2617
|
+
if (!F.current || n === 0)
|
|
2601
2618
|
return;
|
|
2602
|
-
const u =
|
|
2603
|
-
Wt(
|
|
2619
|
+
const u = A.getTotal(), h = vt(Math.floor(l), 0, u), { index: R, cumulative: O, currentValue: Y } = A.findIndexAtOrAfter(h, { materializeOption: { materialize: !1 } }), G = (O ?? 0) - (Y ?? 0) - h;
|
|
2620
|
+
Wt(R, { offset: G });
|
|
2604
2621
|
},
|
|
2605
|
-
[
|
|
2606
|
-
),
|
|
2607
|
-
(
|
|
2608
|
-
const u =
|
|
2609
|
-
|
|
2610
|
-
const
|
|
2611
|
-
return
|
|
2622
|
+
[A, n, Wt]
|
|
2623
|
+
), Re = S(
|
|
2624
|
+
(l) => {
|
|
2625
|
+
const u = oe(dt.current, y.top), h = typeof l == "function" ? l(u) : l;
|
|
2626
|
+
ge(h);
|
|
2627
|
+
const R = F.current?.getScrollPosition(), O = typeof R == "number" ? R : dt.current;
|
|
2628
|
+
return tt(O), O;
|
|
2612
2629
|
},
|
|
2613
|
-
[y.top,
|
|
2614
|
-
),
|
|
2615
|
-
(
|
|
2616
|
-
C.debug("[VirtualScroll] Scroll position changed:",
|
|
2617
|
-
const
|
|
2618
|
-
|
|
2619
|
-
const
|
|
2620
|
-
if (
|
|
2621
|
-
if (
|
|
2630
|
+
[y.top, ge, tt]
|
|
2631
|
+
), De = S(
|
|
2632
|
+
(l, u) => {
|
|
2633
|
+
C.debug("[VirtualScroll] Scroll position changed:", l);
|
|
2634
|
+
const h = st.current;
|
|
2635
|
+
h && (st.current = !1);
|
|
2636
|
+
const R = Q.current > 0;
|
|
2637
|
+
if (R && (Q.current = 0), h || R || le.current || (W.current = null), tt(l), $) {
|
|
2638
|
+
if (h || R)
|
|
2622
2639
|
return;
|
|
2623
|
-
const
|
|
2624
|
-
if (C.debug("[VirtualScroll] Scroll diff:",
|
|
2625
|
-
const
|
|
2626
|
-
|
|
2627
|
-
|
|
2640
|
+
const O = l - u;
|
|
2641
|
+
if (C.debug("[VirtualScroll] Scroll diff:", O, "New:", l, "Prev:", u), Math.abs(O) > 1) {
|
|
2642
|
+
const Y = O > 0 ? "down" : "up";
|
|
2643
|
+
Ot(Y), it(!0), C.debug("[VirtualScroll] Showing scroll buttons. Direction:", Y), ht.current && clearTimeout(ht.current), ht.current = setTimeout(() => {
|
|
2644
|
+
it(!1), C.debug("[VirtualScroll] Hiding scroll buttons");
|
|
2628
2645
|
}, 2e3);
|
|
2629
2646
|
}
|
|
2630
2647
|
}
|
|
2631
2648
|
},
|
|
2632
|
-
[
|
|
2633
|
-
),
|
|
2634
|
-
const
|
|
2649
|
+
[tt, $]
|
|
2650
|
+
), re = Lt(() => oe(Bt, y.top), [y.top, Bt]), jt = Lt(() => {
|
|
2651
|
+
const l = A.getTotal(), u = Vr(re, i, s, n, r, A, l);
|
|
2635
2652
|
return C.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
2636
2653
|
...u,
|
|
2637
|
-
scrollPosition:
|
|
2638
|
-
renderingContentSize:
|
|
2654
|
+
scrollPosition: re,
|
|
2655
|
+
renderingContentSize: l,
|
|
2639
2656
|
overscanCount: s,
|
|
2640
2657
|
viewportSize: i
|
|
2641
2658
|
})), u;
|
|
2642
|
-
}, [
|
|
2643
|
-
(
|
|
2644
|
-
if (!
|
|
2659
|
+
}, [re, i, s, n, r, A]), { renderingStartIndex: ne, renderingEndIndex: ie, visibleStartIndex: de, visibleEndIndex: be } = jt, se = S(
|
|
2660
|
+
(l, u) => {
|
|
2661
|
+
if (!V || n === 0)
|
|
2645
2662
|
return;
|
|
2646
|
-
const
|
|
2663
|
+
const h = It(l, n);
|
|
2647
2664
|
if (!(u?.ensureVisible ?? !0)) {
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2665
|
+
const Dt = z.current.get(h);
|
|
2666
|
+
Dt && (et.current = null, ct.current = h, $t(Dt));
|
|
2650
2667
|
return;
|
|
2651
2668
|
}
|
|
2652
|
-
const
|
|
2653
|
-
if (
|
|
2654
|
-
Wt(
|
|
2655
|
-
const
|
|
2656
|
-
|
|
2669
|
+
const O = A.prefixSum(h, { materializeOption: { materialize: !1 } }), Y = O.currentValue, U = Math.max(O.cumulative - Y, 0), G = U + Y, Rt = oe(dt.current, y.top), bt = Rt + i;
|
|
2670
|
+
if (U < Rt || G > bt) {
|
|
2671
|
+
Wt(h);
|
|
2672
|
+
const Dt = z.current.get(h);
|
|
2673
|
+
Dt ? (et.current = null, ct.current = h, $t(Dt)) : et.current = h;
|
|
2657
2674
|
return;
|
|
2658
2675
|
}
|
|
2659
|
-
const
|
|
2660
|
-
if (
|
|
2661
|
-
|
|
2676
|
+
const Ft = z.current.get(h);
|
|
2677
|
+
if (Ft) {
|
|
2678
|
+
et.current = null, ct.current = h, $t(Ft);
|
|
2662
2679
|
return;
|
|
2663
2680
|
}
|
|
2664
|
-
|
|
2681
|
+
et.current = h;
|
|
2665
2682
|
},
|
|
2666
|
-
[
|
|
2667
|
-
),
|
|
2668
|
-
(
|
|
2669
|
-
if (!
|
|
2683
|
+
[V, n, A, y.top, Wt, $t, i]
|
|
2684
|
+
), Ce = S(
|
|
2685
|
+
(l, u) => {
|
|
2686
|
+
if (!V || l.defaultPrevented || l.altKey || l.metaKey || l.ctrlKey)
|
|
2670
2687
|
return;
|
|
2671
|
-
const
|
|
2672
|
-
if (
|
|
2673
|
-
const
|
|
2674
|
-
if (
|
|
2688
|
+
const h = l.target;
|
|
2689
|
+
if (h) {
|
|
2690
|
+
const R = h.tagName;
|
|
2691
|
+
if (R === "INPUT" || R === "TEXTAREA" || R === "SELECT" || h.isContentEditable)
|
|
2675
2692
|
return;
|
|
2676
2693
|
}
|
|
2677
|
-
if (
|
|
2678
|
-
u < n - 1 && (
|
|
2694
|
+
if (l.key === "ArrowDown") {
|
|
2695
|
+
u < n - 1 && (l.preventDefault(), se(u + 1));
|
|
2679
2696
|
return;
|
|
2680
2697
|
}
|
|
2681
|
-
if (
|
|
2682
|
-
u > 0 && (
|
|
2698
|
+
if (l.key === "ArrowUp") {
|
|
2699
|
+
u > 0 && (l.preventDefault(), se(u - 1));
|
|
2683
2700
|
return;
|
|
2684
2701
|
}
|
|
2685
|
-
if (
|
|
2702
|
+
if (l.key === "PageDown") {
|
|
2686
2703
|
if (u < n - 1) {
|
|
2687
|
-
|
|
2688
|
-
const { visibleStartIndex:
|
|
2689
|
-
|
|
2704
|
+
l.preventDefault();
|
|
2705
|
+
const { visibleStartIndex: R, visibleEndIndex: O } = Ct.current, Y = Math.max(O - R + 1, 1), U = Math.max(Y, 1), G = It(Math.min(u + U, n - 1), n);
|
|
2706
|
+
se(G);
|
|
2690
2707
|
}
|
|
2691
2708
|
return;
|
|
2692
2709
|
}
|
|
2693
|
-
if (
|
|
2694
|
-
|
|
2695
|
-
const { visibleStartIndex:
|
|
2696
|
-
|
|
2710
|
+
if (l.key === "PageUp" && u > 0) {
|
|
2711
|
+
l.preventDefault();
|
|
2712
|
+
const { visibleStartIndex: R, visibleEndIndex: O } = Ct.current, Y = Math.max(O - R + 1, 1), U = Math.max(Y, 1), G = It(u - U, n);
|
|
2713
|
+
se(G);
|
|
2697
2714
|
}
|
|
2698
2715
|
},
|
|
2699
|
-
[
|
|
2700
|
-
),
|
|
2701
|
-
(
|
|
2702
|
-
if (!
|
|
2716
|
+
[V, n, se]
|
|
2717
|
+
), ve = S(
|
|
2718
|
+
(l) => {
|
|
2719
|
+
if (!V)
|
|
2703
2720
|
return;
|
|
2704
|
-
const u =
|
|
2705
|
-
|
|
2721
|
+
const u = It(l, n);
|
|
2722
|
+
et.current = null, ct.current = u, Z?.(u);
|
|
2706
2723
|
},
|
|
2707
|
-
[
|
|
2724
|
+
[V, n, Z]
|
|
2708
2725
|
);
|
|
2709
|
-
|
|
2710
|
-
const
|
|
2726
|
+
q(() => {
|
|
2727
|
+
const l = F.current?.getScrollPosition() ?? 0, u = dt.current, h = oe(u, y.top);
|
|
2711
2728
|
C.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
2712
|
-
renderingStartIndex:
|
|
2713
|
-
renderingEndIndex:
|
|
2714
|
-
visibleStartIndex:
|
|
2715
|
-
visibleEndIndex:
|
|
2729
|
+
renderingStartIndex: ne,
|
|
2730
|
+
renderingEndIndex: ie,
|
|
2731
|
+
visibleStartIndex: de,
|
|
2732
|
+
visibleEndIndex: be,
|
|
2716
2733
|
scrollPositionState: Bt,
|
|
2717
2734
|
paneScrollPosition: u,
|
|
2718
|
-
logicalScrollPosition:
|
|
2719
|
-
contentSize:
|
|
2720
|
-
scrollPaneScrollPosition:
|
|
2721
|
-
})),
|
|
2722
|
-
renderingStartIndex:
|
|
2723
|
-
renderingEndIndex:
|
|
2724
|
-
visibleStartIndex:
|
|
2725
|
-
visibleEndIndex:
|
|
2726
|
-
scrollPosition:
|
|
2727
|
-
totalHeight:
|
|
2735
|
+
logicalScrollPosition: h,
|
|
2736
|
+
contentSize: Et,
|
|
2737
|
+
scrollPaneScrollPosition: l
|
|
2738
|
+
})), w({
|
|
2739
|
+
renderingStartIndex: ne,
|
|
2740
|
+
renderingEndIndex: ie,
|
|
2741
|
+
visibleStartIndex: de,
|
|
2742
|
+
visibleEndIndex: be,
|
|
2743
|
+
scrollPosition: h,
|
|
2744
|
+
totalHeight: Et
|
|
2728
2745
|
});
|
|
2729
|
-
}, [
|
|
2730
|
-
const
|
|
2746
|
+
}, [Et, ie, ne, y.top, w, Bt, be, de]);
|
|
2747
|
+
const Ee = S(() => $ ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": Mt && kt !== null, children: kt === "up" ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ ot(
|
|
2731
2748
|
"button",
|
|
2732
2749
|
{
|
|
2733
2750
|
type: "button",
|
|
2734
2751
|
className: "aqvs-scroll-to-edge-button",
|
|
2735
|
-
onClick: (
|
|
2736
|
-
|
|
2752
|
+
onClick: (h) => {
|
|
2753
|
+
h.stopPropagation(), st.current = !0, Wt(0), it(!1);
|
|
2737
2754
|
},
|
|
2738
2755
|
children: "Top"
|
|
2739
2756
|
}
|
|
2740
|
-
) }) : /* @__PURE__ */
|
|
2757
|
+
) }) : /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ ot(
|
|
2741
2758
|
"button",
|
|
2742
2759
|
{
|
|
2743
2760
|
type: "button",
|
|
2744
2761
|
className: "aqvs-scroll-to-edge-button",
|
|
2745
|
-
onClick: (
|
|
2746
|
-
|
|
2762
|
+
onClick: (h) => {
|
|
2763
|
+
h.stopPropagation(), st.current = !0, Wt(n - 1), it(!1);
|
|
2747
2764
|
},
|
|
2748
2765
|
children: "Bottom"
|
|
2749
2766
|
}
|
|
2750
|
-
) }) }) : null, [
|
|
2767
|
+
) }) }) : null, [$, Mt, kt, Wt, n]), o = I(0), { visibleItems: g, renderAnchor: M } = Lt(() => {
|
|
2751
2768
|
if (n === 0)
|
|
2752
2769
|
return {
|
|
2753
|
-
visibleItems: /* @__PURE__ */
|
|
2770
|
+
visibleItems: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-text", children: "No items" }) }),
|
|
2754
2771
|
renderAnchor: 0
|
|
2755
2772
|
};
|
|
2756
|
-
const
|
|
2757
|
-
Number.isFinite(
|
|
2758
|
-
const
|
|
2759
|
-
let
|
|
2760
|
-
for (let
|
|
2761
|
-
if (
|
|
2762
|
-
C.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap:
|
|
2773
|
+
const l = It(ne, n), u = It(ie, n), { cumulative: h, currentValue: R } = A.prefixSum(l, { materializeOption: { materialize: !1 } }), O = h - R;
|
|
2774
|
+
Number.isFinite(O) && Math.abs(O - o.current) > Er && (o.current = O);
|
|
2775
|
+
const Y = o.current, U = [], G = [];
|
|
2776
|
+
let Rt = 0, bt = O;
|
|
2777
|
+
for (let xt = l; xt <= u; xt++) {
|
|
2778
|
+
if (G.length >= We) {
|
|
2779
|
+
C.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: We, safeRenderingStartIndex: l, safeRenderingEndIndex: u });
|
|
2763
2780
|
break;
|
|
2764
2781
|
}
|
|
2765
|
-
const
|
|
2766
|
-
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2769
|
-
/* @__PURE__ */
|
|
2770
|
-
|
|
2782
|
+
const Ft = r(xt), Dt = A.get(xt), zt = Ft - Dt;
|
|
2783
|
+
zt !== 0 && U.push({ index: xt, value: Ft });
|
|
2784
|
+
const Pe = bt + Rt, Le = e ? e(xt) : xt;
|
|
2785
|
+
G.push(
|
|
2786
|
+
/* @__PURE__ */ ot(
|
|
2787
|
+
Ar,
|
|
2771
2788
|
{
|
|
2772
|
-
index:
|
|
2773
|
-
top:
|
|
2774
|
-
height:
|
|
2775
|
-
item: t(
|
|
2776
|
-
clipItemHeight:
|
|
2777
|
-
enableKeyboardNavigation:
|
|
2778
|
-
onKeyDown:
|
|
2779
|
-
onFocus:
|
|
2780
|
-
registerItemRef:
|
|
2781
|
-
children:
|
|
2789
|
+
index: xt,
|
|
2790
|
+
top: Pe - Y,
|
|
2791
|
+
height: Ft,
|
|
2792
|
+
item: t(xt),
|
|
2793
|
+
clipItemHeight: yt,
|
|
2794
|
+
enableKeyboardNavigation: V,
|
|
2795
|
+
onKeyDown: Ce,
|
|
2796
|
+
onFocus: ve,
|
|
2797
|
+
registerItemRef: wt,
|
|
2798
|
+
children: x
|
|
2782
2799
|
},
|
|
2783
|
-
|
|
2800
|
+
Le
|
|
2784
2801
|
)
|
|
2785
|
-
),
|
|
2802
|
+
), Rt += zt, bt += Dt;
|
|
2786
2803
|
}
|
|
2787
|
-
return
|
|
2788
|
-
if (
|
|
2804
|
+
return U.length > 0 && Promise.resolve().then(() => {
|
|
2805
|
+
if (At.current)
|
|
2789
2806
|
return;
|
|
2790
|
-
let
|
|
2791
|
-
for (const
|
|
2792
|
-
if (
|
|
2793
|
-
const
|
|
2794
|
-
|
|
2807
|
+
let xt = 0;
|
|
2808
|
+
for (const zt of U)
|
|
2809
|
+
if (zt.index < de) {
|
|
2810
|
+
const Pe = A.get(zt.index);
|
|
2811
|
+
xt += zt.value - Pe;
|
|
2795
2812
|
}
|
|
2796
|
-
const
|
|
2797
|
-
if (
|
|
2813
|
+
const Ft = A.updates(U);
|
|
2814
|
+
if (At.current || typeof Ft != "number")
|
|
2798
2815
|
return;
|
|
2799
|
-
|
|
2800
|
-
const
|
|
2801
|
-
if (
|
|
2802
|
-
const
|
|
2803
|
-
zt
|
|
2804
|
-
} else
|
|
2805
|
-
}), { visibleItems:
|
|
2816
|
+
Xt(Ft), C.debug("[VirtualScroll] Updated heights for items", U, "New total height:", Ft);
|
|
2817
|
+
const Dt = F.current?.getScrollPosition() ?? dt.current;
|
|
2818
|
+
if (xt !== 0) {
|
|
2819
|
+
const zt = Dt + xt;
|
|
2820
|
+
ee(zt), tt(zt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Dt, to: zt, shiftAmount: xt });
|
|
2821
|
+
} else Dt !== dt.current && tt(Dt);
|
|
2822
|
+
}), { visibleItems: G, renderAnchor: Y };
|
|
2806
2823
|
}, [
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2824
|
+
x,
|
|
2825
|
+
yt,
|
|
2826
|
+
Et,
|
|
2827
|
+
V,
|
|
2811
2828
|
n,
|
|
2812
|
-
|
|
2829
|
+
A,
|
|
2813
2830
|
t,
|
|
2814
2831
|
e,
|
|
2815
2832
|
r,
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
zt,
|
|
2819
|
-
vt,
|
|
2833
|
+
ve,
|
|
2834
|
+
Ce,
|
|
2820
2835
|
ee,
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2836
|
+
wt,
|
|
2837
|
+
ie,
|
|
2838
|
+
ne,
|
|
2839
|
+
tt,
|
|
2840
|
+
de
|
|
2841
|
+
]), L = S(
|
|
2842
|
+
(l) => {
|
|
2843
|
+
const u = (_ ?? 0) > 0, h = Math.abs(l - Bt), R = u && h > 0.5 ? Bt : l, O = oe(R, y.top);
|
|
2827
2844
|
if (C.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
2828
|
-
currentScrollPosition:
|
|
2829
|
-
effectiveScrollPosition:
|
|
2830
|
-
renderingStartIndex:
|
|
2831
|
-
renderingEndIndex:
|
|
2845
|
+
currentScrollPosition: l,
|
|
2846
|
+
effectiveScrollPosition: O,
|
|
2847
|
+
renderingStartIndex: ne,
|
|
2848
|
+
renderingEndIndex: ie,
|
|
2832
2849
|
itemCount: n,
|
|
2833
2850
|
viewportSize: i,
|
|
2834
2851
|
callbackThrottleMs: _,
|
|
2835
|
-
diff:
|
|
2836
|
-
rawEffectiveScrollPosition:
|
|
2852
|
+
diff: h,
|
|
2853
|
+
rawEffectiveScrollPosition: R
|
|
2837
2854
|
})), n === 0)
|
|
2838
|
-
return
|
|
2839
|
-
const
|
|
2855
|
+
return g;
|
|
2856
|
+
const Y = y.top + M - R, U = y.bottom > 0 ? /* @__PURE__ */ ot(
|
|
2840
2857
|
"div",
|
|
2841
2858
|
{
|
|
2842
2859
|
className: "aqvs-bottom-inset",
|
|
2843
2860
|
style: {
|
|
2844
2861
|
// ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
|
|
2845
|
-
top:
|
|
2862
|
+
top: A.getTotal() - M,
|
|
2846
2863
|
height: y.bottom
|
|
2847
2864
|
}
|
|
2848
2865
|
},
|
|
2849
2866
|
"virtualscroll-bottom-inset"
|
|
2850
2867
|
) : null;
|
|
2851
2868
|
return C.debug("[VirtualScroll] Rendering items", () => ({
|
|
2852
|
-
containerTop:
|
|
2853
|
-
logicalScrollPosition:
|
|
2869
|
+
containerTop: Y,
|
|
2870
|
+
logicalScrollPosition: re,
|
|
2854
2871
|
resolvedInsets: y,
|
|
2855
|
-
effectiveScrollPosition:
|
|
2856
|
-
})), /* @__PURE__ */
|
|
2857
|
-
|
|
2858
|
-
|
|
2872
|
+
effectiveScrollPosition: O
|
|
2873
|
+
})), /* @__PURE__ */ he("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${Y}px)`, willChange: "transform" }, children: [
|
|
2874
|
+
g,
|
|
2875
|
+
U
|
|
2859
2876
|
] });
|
|
2860
2877
|
},
|
|
2861
|
-
[_, n,
|
|
2862
|
-
),
|
|
2878
|
+
[_, n, A, re, M, ie, ne, y, Bt, i, g]
|
|
2879
|
+
), H = Lt(
|
|
2863
2880
|
() => ({
|
|
2864
|
-
renderingStartIndex:
|
|
2865
|
-
renderingEndIndex:
|
|
2866
|
-
visibleStartIndex:
|
|
2867
|
-
visibleEndIndex:
|
|
2868
|
-
scrollPosition:
|
|
2869
|
-
totalHeight:
|
|
2881
|
+
renderingStartIndex: jt.renderingStartIndex,
|
|
2882
|
+
renderingEndIndex: jt.renderingEndIndex,
|
|
2883
|
+
visibleStartIndex: jt.visibleStartIndex,
|
|
2884
|
+
visibleEndIndex: jt.visibleEndIndex,
|
|
2885
|
+
scrollPosition: re,
|
|
2886
|
+
totalHeight: A.getTotal()
|
|
2870
2887
|
// contentSize (State) ではなく最新値を反映
|
|
2871
2888
|
}),
|
|
2872
2889
|
// contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
|
|
2873
2890
|
// (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
|
|
2874
|
-
[
|
|
2891
|
+
[jt, re, A, Et]
|
|
2875
2892
|
);
|
|
2876
|
-
|
|
2877
|
-
Ct.current =
|
|
2878
|
-
}, [
|
|
2879
|
-
|
|
2893
|
+
q(() => {
|
|
2894
|
+
Ct.current = H;
|
|
2895
|
+
}, [H]), qe(
|
|
2896
|
+
Pt,
|
|
2880
2897
|
() => ({
|
|
2881
|
-
getScrollPosition: () =>
|
|
2882
|
-
getContentSize: () =>
|
|
2883
|
-
getViewportSize: () =>
|
|
2884
|
-
scrollTo:
|
|
2898
|
+
getScrollPosition: () => F.current?.getScrollPosition() ?? -1,
|
|
2899
|
+
getContentSize: () => F.current?.getContentSize() ?? -1,
|
|
2900
|
+
getViewportSize: () => F.current?.getViewportSize() ?? -1,
|
|
2901
|
+
scrollTo: Re,
|
|
2885
2902
|
scrollToIndex: Wt,
|
|
2886
|
-
getFenwickTreeTotalHeight: () =>
|
|
2887
|
-
getFenwickSize: () =>
|
|
2888
|
-
focusItemAtIndex:
|
|
2903
|
+
getFenwickTreeTotalHeight: () => A.getTotal(),
|
|
2904
|
+
getFenwickSize: () => A.getSize(),
|
|
2905
|
+
focusItemAtIndex: se,
|
|
2889
2906
|
getRange: () => Ct.current,
|
|
2890
|
-
updateItemSize:
|
|
2907
|
+
updateItemSize: we
|
|
2891
2908
|
}),
|
|
2892
|
-
[
|
|
2909
|
+
[Re, Wt, A, se, we]
|
|
2893
2910
|
);
|
|
2894
|
-
const
|
|
2895
|
-
return /* @__PURE__ */
|
|
2896
|
-
|
|
2911
|
+
const St = A.getTotal() + y.top + y.bottom;
|
|
2912
|
+
return /* @__PURE__ */ ot(
|
|
2913
|
+
vr,
|
|
2897
2914
|
{
|
|
2898
|
-
ref:
|
|
2899
|
-
contentSize:
|
|
2915
|
+
ref: F,
|
|
2916
|
+
contentSize: St,
|
|
2900
2917
|
viewportSize: i,
|
|
2901
|
-
className:
|
|
2918
|
+
className: a,
|
|
2902
2919
|
testId: c,
|
|
2903
|
-
onScroll:
|
|
2904
|
-
background:
|
|
2905
|
-
tapScrollCircleOptions:
|
|
2906
|
-
inertiaOptions:
|
|
2920
|
+
onScroll: De,
|
|
2921
|
+
background: v,
|
|
2922
|
+
tapScrollCircleOptions: lt,
|
|
2923
|
+
inertiaOptions: Yt,
|
|
2907
2924
|
itemCount: n,
|
|
2908
|
-
scrollBarWidth:
|
|
2909
|
-
enableThumbDrag:
|
|
2910
|
-
enableTrackClick:
|
|
2911
|
-
enableArrowButtons:
|
|
2912
|
-
enablePointerDrag:
|
|
2913
|
-
pointerDragInputs:
|
|
2925
|
+
scrollBarWidth: D,
|
|
2926
|
+
enableThumbDrag: k,
|
|
2927
|
+
enableTrackClick: P,
|
|
2928
|
+
enableArrowButtons: X,
|
|
2929
|
+
enablePointerDrag: K,
|
|
2930
|
+
pointerDragInputs: T,
|
|
2914
2931
|
renderThumbOverlay: N,
|
|
2915
|
-
wheelSpeedMultiplier:
|
|
2916
|
-
onWheelHorizontal:
|
|
2932
|
+
wheelSpeedMultiplier: Tt,
|
|
2933
|
+
onWheelHorizontal: nt,
|
|
2917
2934
|
contentInsets: y,
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2935
|
+
contentProps: pt,
|
|
2936
|
+
visibleStartIndex: de,
|
|
2937
|
+
visibleEndIndex: be,
|
|
2938
|
+
renderOverlay: Ee,
|
|
2939
|
+
initialScrollPosition: j.position,
|
|
2940
|
+
children: L
|
|
2923
2941
|
}
|
|
2924
2942
|
);
|
|
2925
|
-
},
|
|
2943
|
+
}, zr = Be(Dr);
|
|
2926
2944
|
export {
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2945
|
+
me as FenwickMapTree,
|
|
2946
|
+
Ir as ScrollBar,
|
|
2947
|
+
vr as ScrollPane,
|
|
2948
|
+
Je as TAP_SCROLL_SPEED_DEFAULTS,
|
|
2949
|
+
zr as VirtualScroll,
|
|
2950
|
+
xr as computeAutoTapScrollMaxSpeedMultiplier,
|
|
2951
|
+
br as computeTapScrollSpeed,
|
|
2952
|
+
vt as minmax,
|
|
2953
|
+
Or as tapScrollCircleSampleVisual,
|
|
2954
|
+
yr as useFenwickMapTree,
|
|
2955
|
+
Fr as useHeightCache,
|
|
2956
|
+
Rr as useLruCache
|
|
2939
2957
|
};
|