@aiquants/virtualscroll 1.22.1 → 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/ScrollPane.d.cts +24 -0
- package/dist/ScrollPane.d.ts +24 -0
- package/dist/ScrollPane.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 +1323 -1319
- package/dist/styles/virtualscroll.standalone.css +1 -1
- package/package.json +1 -1
- package/src/ScrollPane.tsx +30 -2
- package/src/VirtualScroll.tsx +27 -0
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 [
|
|
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: Tt ||
|
|
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
|
-
),
|
|
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: Tt +
|
|
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
|
-
), pt =
|
|
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
|
-
|
|
251
|
-
const Tt =
|
|
252
|
-
let
|
|
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
253
|
if (Tt !== null && typeof Tt.setPointerCapture == "function")
|
|
254
254
|
try {
|
|
255
|
-
Tt.setPointerCapture(
|
|
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
|
-
[
|
|
267
|
-
), D =
|
|
268
|
-
(
|
|
269
|
-
|
|
266
|
+
[rt, ut, Z]
|
|
267
|
+
), D = S(
|
|
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
|
|
284
|
-
dragState:
|
|
285
|
-
normalizedDistance:
|
|
286
|
-
sizeScale:
|
|
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
|
+
dragState: d,
|
|
285
|
+
normalizedDistance: X,
|
|
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:
|
|
303
|
+
onPointerDown: nt,
|
|
304
304
|
onPointerMove: pt,
|
|
305
|
-
onPointerUp:
|
|
306
|
-
onPointerCancel:
|
|
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,319 +348,319 @@ const xt = (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),
|
|
369
|
-
}, []),
|
|
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
|
+
}, []), 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 pt = Math.min(Math.max(
|
|
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
|
-
scrollBarWidth:
|
|
424
|
-
className:
|
|
425
|
-
ariaControls:
|
|
426
|
-
tapScrollCircleOptions:
|
|
423
|
+
scrollBarWidth: d = 12,
|
|
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
|
-
}),
|
|
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
|
-
}, []),
|
|
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
495
|
(o) => {
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
498
|
-
const
|
|
499
|
-
return { nextPosition:
|
|
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
501
|
if (o === 0)
|
|
502
|
-
return { nextPosition:
|
|
503
|
-
const
|
|
504
|
-
return { nextPosition:
|
|
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
|
-
(o,
|
|
509
|
-
o.current +=
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
const L =
|
|
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
513
|
return o.current -= L.actualDelta, L.reachedBoundary && (o.current = 0), L;
|
|
514
514
|
},
|
|
515
|
-
[
|
|
516
|
-
), at =
|
|
517
|
-
|
|
518
|
-
}, []),
|
|
519
|
-
|
|
520
|
-
}, [at]),
|
|
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
521
|
(o) => {
|
|
522
|
-
const
|
|
523
|
-
if (!
|
|
522
|
+
const g = N.current, M = _t.current;
|
|
523
|
+
if (!g.active || g.direction === 0) {
|
|
524
524
|
at();
|
|
525
525
|
return;
|
|
526
526
|
}
|
|
527
|
-
if (!
|
|
527
|
+
if (!M.scrollBarVisible || M.maxScrollPosition <= 0) {
|
|
528
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
|
-
Tt.current !==
|
|
546
|
-
const { reachedBoundary:
|
|
547
|
-
if (
|
|
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
548
|
at();
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
-
|
|
551
|
+
K.current = window.requestAnimationFrame(wt);
|
|
552
552
|
},
|
|
553
|
-
[
|
|
554
|
-
),
|
|
555
|
-
|
|
556
|
-
}, [
|
|
557
|
-
|
|
558
|
-
const o =
|
|
559
|
-
!o.active || o.direction === 0 ||
|
|
560
|
-
}, [n, t,
|
|
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
561
|
at();
|
|
562
562
|
}, [at]);
|
|
563
|
-
const
|
|
563
|
+
const Ht = S(
|
|
564
564
|
(o) => {
|
|
565
|
-
|
|
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 o = (
|
|
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 o = (
|
|
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
592
|
return document.addEventListener("pointerdown", o, !0), () => {
|
|
593
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: o, trackLen:
|
|
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
|
-
}, []),
|
|
605
|
+
const H = vt(o, 0, M);
|
|
606
|
+
return vt(H / M * L, 0, L);
|
|
607
|
+
}, []), ce = S(
|
|
608
608
|
(o) => {
|
|
609
|
-
const
|
|
610
|
-
const
|
|
611
|
-
return Number.isFinite(
|
|
612
|
-
},
|
|
613
|
-
return
|
|
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
|
-
),
|
|
616
|
+
), ue = S(
|
|
617
617
|
(o) => {
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
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:
|
|
623
|
+
delta: H,
|
|
624
|
+
startThumbPosition: g.startThumbPosition,
|
|
625
625
|
clientY: o.clientY,
|
|
626
|
-
startClientY:
|
|
627
|
-
metrics:
|
|
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
|
-
),
|
|
632
|
+
[p, te, Vt]
|
|
633
|
+
), tt = S(
|
|
634
634
|
(o) => {
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
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
|
-
o.clientX >= L.left && o.clientX <= L.right && o.clientY >= L.top && o.clientY <= L.bottom ||
|
|
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
|
|
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
652
|
(o) => {
|
|
653
|
-
const
|
|
654
|
-
Se.current !== o && (Se.current = 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();
|
|
@@ -668,25 +668,25 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
668
668
|
}
|
|
669
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
|
-
|
|
680
|
+
k.current = {
|
|
681
681
|
pointerId: o.pointerId,
|
|
682
682
|
startThumbPosition: qt,
|
|
683
683
|
startClientX: o.clientX,
|
|
684
684
|
startClientY: o.clientY,
|
|
685
|
-
scale:
|
|
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();
|
|
@@ -694,166 +694,166 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
694
694
|
}
|
|
695
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
706
|
pointerId: o.pointerId,
|
|
707
|
-
startThumbPosition:
|
|
707
|
+
startThumbPosition: l,
|
|
708
708
|
startClientX: o.clientX,
|
|
709
709
|
startClientY: o.clientY,
|
|
710
|
-
scale:
|
|
710
|
+
scale: H
|
|
711
711
|
}, o.preventDefault(), o.stopPropagation();
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
},
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
712
|
+
}, jt = () => {
|
|
713
|
+
P.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
|
|
714
|
+
}, ne = (o) => {
|
|
715
|
+
const g = P.current;
|
|
716
|
+
if (g.pointerId !== o.pointerId)
|
|
717
717
|
return;
|
|
718
718
|
if (o.pointerType === "mouse" && o.buttons === 0) {
|
|
719
|
-
|
|
719
|
+
jt();
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
},
|
|
725
|
-
if (
|
|
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 (
|
|
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
|
-
o.target === o.currentTarget &&
|
|
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:
|
|
769
|
+
thumbSize: ht,
|
|
770
770
|
thumbPosition: qt,
|
|
771
771
|
thumbCenter: le,
|
|
772
|
-
trackSize:
|
|
773
|
-
isDragging:
|
|
772
|
+
trackSize: Mt,
|
|
773
|
+
isDragging: Z,
|
|
774
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
|
-
borderRadius:
|
|
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
|
-
[
|
|
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
|
-
borderRadius:
|
|
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 xt = (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,45 +886,46 @@ const xt = (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:
|
|
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:
|
|
900
|
-
renderThumbOverlay:
|
|
901
|
-
wheelSpeedMultiplier:
|
|
902
|
-
onWheelHorizontal:
|
|
898
|
+
inertiaOptions: B,
|
|
899
|
+
itemCount: Z,
|
|
900
|
+
renderThumbOverlay: ut,
|
|
901
|
+
wheelSpeedMultiplier: rt = 1,
|
|
902
|
+
onWheelHorizontal: nt,
|
|
903
903
|
contentInsets: pt,
|
|
904
|
-
visibleStartIndex:
|
|
904
|
+
visibleStartIndex: Pt,
|
|
905
905
|
visibleEndIndex: D,
|
|
906
|
-
renderOverlay:
|
|
907
|
-
initialScrollPosition:
|
|
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
|
-
),
|
|
927
|
+
[B]
|
|
928
|
+
), Yt = Lt(() => ({
|
|
928
929
|
top: Math.max(0, pt?.top ?? 0),
|
|
929
930
|
bottom: Math.max(0, pt?.bottom ?? 0)
|
|
930
931
|
}), [pt]);
|
|
@@ -932,134 +933,134 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
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
|
-
),
|
|
957
|
-
|
|
958
|
-
|
|
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
|
-
const
|
|
970
|
-
(
|
|
971
|
-
if (!
|
|
970
|
+
const y = S(
|
|
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
|
-
}, [
|
|
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,147 +1069,147 @@ const xt = (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
|
-
|
|
1076
|
-
}, [
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
}, [
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}, [
|
|
1085
|
-
const
|
|
1086
|
-
if (c &&
|
|
1072
|
+
}), Bt = I(c), _t = I(d);
|
|
1073
|
+
q(() => {
|
|
1074
|
+
Bt.current = c;
|
|
1075
|
+
}, [c]), q(() => {
|
|
1076
|
+
_t.current = d;
|
|
1077
|
+
}, [d]);
|
|
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,
|
|
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
|
|
1104
|
-
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
},
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
},
|
|
1111
|
-
const
|
|
1112
|
-
if (!
|
|
1113
|
-
if (
|
|
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;
|
|
1113
|
+
if (!w.isDragging) {
|
|
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
|
|
1122
|
-
|
|
1123
|
-
},
|
|
1124
|
-
const
|
|
1125
|
-
if (
|
|
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
|
-
|
|
1136
|
-
},
|
|
1137
|
-
const
|
|
1138
|
-
return
|
|
1139
|
-
const
|
|
1140
|
-
|
|
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;
|
|
1141
|
+
w.shouldCancelNextClick = !1, w.clickResetTimer = null;
|
|
1141
1142
|
}, 0), !0);
|
|
1142
|
-
},
|
|
1143
|
-
const
|
|
1144
|
-
if (
|
|
1145
|
-
|
|
1143
|
+
}, qt = (f) => {
|
|
1144
|
+
const w = j.current;
|
|
1145
|
+
if (w.pointerId !== f.pointerId) {
|
|
1146
|
+
Q();
|
|
1146
1147
|
return;
|
|
1147
1148
|
}
|
|
1148
|
-
|
|
1149
|
-
let
|
|
1150
|
-
if (
|
|
1151
|
-
const
|
|
1152
|
-
if (Ht &&
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1149
|
+
w.isDragging && w.shouldCancelNextClick && f.cancelable && (f.preventDefault(), f.stopPropagation()), w.isDragging && ct(f.clientY);
|
|
1150
|
+
let at = 0;
|
|
1151
|
+
if (w.isDragging && w.velocitySamples.length >= 2) {
|
|
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 (
|
|
1165
|
-
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)
|
|
1166
1167
|
return;
|
|
1167
|
-
|
|
1168
|
+
ht(j.current.pointerId);
|
|
1168
1169
|
}
|
|
1169
|
-
if (
|
|
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))
|
|
1170
1171
|
return;
|
|
1171
|
-
window.dispatchEvent(new CustomEvent(
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
},
|
|
1175
|
-
if (
|
|
1176
|
-
|
|
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();
|
|
1177
1178
|
return;
|
|
1178
1179
|
}
|
|
1179
|
-
|
|
1180
|
-
},
|
|
1181
|
-
["click",
|
|
1182
|
-
["pointerdown",
|
|
1183
|
-
["lostpointercapture", (
|
|
1184
|
-
|
|
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);
|
|
1185
1186
|
}, void 0]
|
|
1186
|
-
],
|
|
1187
|
-
["pointermove",
|
|
1188
|
-
["pointerup",
|
|
1189
|
-
["pointercancel",
|
|
1187
|
+
], Vt = [
|
|
1188
|
+
["pointermove", st, { passive: !1 }],
|
|
1189
|
+
["pointerup", qt, void 0],
|
|
1190
|
+
["pointercancel", Nt, void 0]
|
|
1190
1191
|
];
|
|
1191
|
-
return
|
|
1192
|
-
|
|
1193
|
-
const
|
|
1194
|
-
|
|
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();
|
|
1195
1196
|
};
|
|
1196
|
-
}, [
|
|
1197
|
-
const
|
|
1198
|
-
(
|
|
1199
|
-
[
|
|
1197
|
+
}, [ae]);
|
|
1198
|
+
const dt = S(
|
|
1199
|
+
(p) => (W(), F(p)),
|
|
1200
|
+
[F, W]
|
|
1200
1201
|
);
|
|
1201
|
-
return /* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ he("div", { ref: lt, "data-testid": v, className: pe("aqvs-scroll-pane", x), style: E, children: [
|
|
1203
|
+
/* @__PURE__ */ he(
|
|
1203
1204
|
"div",
|
|
1204
1205
|
{
|
|
1205
|
-
ref:
|
|
1206
|
-
className:
|
|
1206
|
+
ref: K,
|
|
1207
|
+
className: pe("aqvs-scroll-pane-content"),
|
|
1207
1208
|
"data-testid": "aqvs-scroll-pane-content",
|
|
1208
1209
|
style: {
|
|
1209
1210
|
height: e,
|
|
1210
|
-
paddingTop:
|
|
1211
|
-
paddingBottom:
|
|
1211
|
+
paddingTop: Yt.top,
|
|
1212
|
+
paddingBottom: Yt.bottom,
|
|
1212
1213
|
// スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
|
|
1213
1214
|
// 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
|
|
1214
1215
|
// 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
|
|
@@ -1222,101 +1223,102 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
1222
1223
|
// 同一条件で揃えてあるため状態としても一貫している。
|
|
1223
1224
|
// 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
|
|
1224
1225
|
// (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
|
|
1225
|
-
...c &&
|
|
1226
|
+
...c && J && d.some((p) => p === "touch" || p === "pen") ? { touchAction: "none" } : {}
|
|
1226
1227
|
},
|
|
1227
|
-
|
|
1228
|
+
...X,
|
|
1229
|
+
id: A,
|
|
1228
1230
|
children: [
|
|
1229
|
-
|
|
1231
|
+
m,
|
|
1230
1232
|
n(N.current)
|
|
1231
1233
|
]
|
|
1232
1234
|
}
|
|
1233
1235
|
),
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
|
|
1236
|
+
/* @__PURE__ */ ot(
|
|
1237
|
+
Ir,
|
|
1236
1238
|
{
|
|
1237
1239
|
contentSize: t,
|
|
1238
1240
|
viewportSize: e,
|
|
1239
1241
|
scrollPosition: N.current,
|
|
1240
|
-
onScroll:
|
|
1242
|
+
onScroll: dt,
|
|
1241
1243
|
enableThumbDrag: i,
|
|
1242
1244
|
enableTrackClick: s,
|
|
1243
|
-
enableArrowButtons:
|
|
1245
|
+
enableArrowButtons: a,
|
|
1244
1246
|
scrollBarWidth: r,
|
|
1245
|
-
ariaControls:
|
|
1247
|
+
ariaControls: A,
|
|
1246
1248
|
tapScrollCircleOptions: _,
|
|
1247
|
-
itemCount:
|
|
1248
|
-
renderThumbOverlay:
|
|
1249
|
-
visibleStartIndex:
|
|
1249
|
+
itemCount: Z,
|
|
1250
|
+
renderThumbOverlay: ut,
|
|
1251
|
+
visibleStartIndex: Pt,
|
|
1250
1252
|
visibleEndIndex: D
|
|
1251
1253
|
},
|
|
1252
1254
|
"scrollbar"
|
|
1253
1255
|
),
|
|
1254
|
-
|
|
1256
|
+
k?.()
|
|
1255
1257
|
] });
|
|
1256
1258
|
}
|
|
1257
|
-
),
|
|
1258
|
-
const i = Math.max(r / 2, 1), s = 1 + t * 0.65,
|
|
1259
|
-
return /* @__PURE__ */
|
|
1260
|
-
/* @__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(
|
|
1261
1263
|
"div",
|
|
1262
1264
|
{
|
|
1263
1265
|
className: "aqvs-tap-scroll-circle-gradient",
|
|
1264
1266
|
style: {
|
|
1265
|
-
transform: `scale(${
|
|
1266
|
-
transition:
|
|
1267
|
+
transform: `scale(${a}, ${s})`,
|
|
1268
|
+
transition: P ? "40ms transform ease-out" : "200ms ease transform"
|
|
1267
1269
|
}
|
|
1268
1270
|
}
|
|
1269
1271
|
),
|
|
1270
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ ot(
|
|
1271
1273
|
"div",
|
|
1272
1274
|
{
|
|
1273
1275
|
className: "aqvs-sample-visual-pupil",
|
|
1274
1276
|
style: {
|
|
1275
|
-
width:
|
|
1276
|
-
height:
|
|
1277
|
-
transform: `translate(calc(-50% + ${
|
|
1278
|
-
transition:
|
|
1277
|
+
width: v,
|
|
1278
|
+
height: v,
|
|
1279
|
+
transform: `translate(calc(-50% + ${rt}px), calc(-50% + ${nt}px)) scale(${a}, ${d * s})`,
|
|
1280
|
+
transition: P ? "70ms transform ease-out" : "200ms ease transform"
|
|
1279
1281
|
}
|
|
1280
1282
|
}
|
|
1281
1283
|
),
|
|
1282
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ ot(
|
|
1283
1285
|
"div",
|
|
1284
1286
|
{
|
|
1285
1287
|
className: "aqvs-sample-visual-highlight",
|
|
1286
1288
|
style: {
|
|
1287
1289
|
width: D,
|
|
1288
1290
|
height: D,
|
|
1289
|
-
transform: `translate(calc(-50% + ${pt}px), calc(-50% + ${
|
|
1290
|
-
opacity:
|
|
1291
|
+
transform: `translate(calc(-50% + ${pt}px), calc(-50% + ${Pt}px)) scale(${a}, ${s})`,
|
|
1292
|
+
opacity: k,
|
|
1291
1293
|
boxShadow: "0 0 8px rgba(255,255,255,0.45)",
|
|
1292
|
-
transition:
|
|
1294
|
+
transition: P ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
|
|
1293
1295
|
}
|
|
1294
1296
|
}
|
|
1295
1297
|
),
|
|
1296
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ ot(
|
|
1297
1299
|
"div",
|
|
1298
1300
|
{
|
|
1299
1301
|
className: "aqvs-sample-visual-rod",
|
|
1300
1302
|
style: {
|
|
1301
1303
|
width: _,
|
|
1302
1304
|
height: E,
|
|
1303
|
-
transform: `translate(-50%, ${
|
|
1305
|
+
transform: `translate(-50%, ${m}px)`,
|
|
1304
1306
|
opacity: t,
|
|
1305
|
-
transition:
|
|
1307
|
+
transition: P ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
|
|
1306
1308
|
}
|
|
1307
1309
|
}
|
|
1308
1310
|
)
|
|
1309
1311
|
] });
|
|
1310
|
-
},
|
|
1312
|
+
}, Ve = 100, Pr = (n) => {
|
|
1311
1313
|
if (!Number.isFinite(n))
|
|
1312
1314
|
return 0n;
|
|
1313
1315
|
const t = Math.trunc(n);
|
|
1314
1316
|
return t <= 0 ? 0n : BigInt(t);
|
|
1315
|
-
},
|
|
1317
|
+
}, Fe = (n, t) => {
|
|
1316
1318
|
if (!Number.isFinite(n))
|
|
1317
1319
|
throw new Error(`valueFn returned a non-finite value at index ${t}: ${n}`);
|
|
1318
1320
|
return n;
|
|
1319
|
-
},
|
|
1321
|
+
}, xe = (n) => {
|
|
1320
1322
|
if (n <= 0 || !Number.isFinite(n))
|
|
1321
1323
|
return 0;
|
|
1322
1324
|
const t = Math.trunc(n);
|
|
@@ -1325,7 +1327,7 @@ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
|
|
|
1325
1327
|
const e = BigInt(t) & -BigInt(t);
|
|
1326
1328
|
return Number(e);
|
|
1327
1329
|
};
|
|
1328
|
-
class
|
|
1330
|
+
class me {
|
|
1329
1331
|
/**
|
|
1330
1332
|
* @private
|
|
1331
1333
|
* @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
|
|
@@ -1389,27 +1391,27 @@ class ae {
|
|
|
1389
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;
|
|
1390
1392
|
return;
|
|
1391
1393
|
}
|
|
1392
|
-
let s = 0,
|
|
1394
|
+
let s = 0, a;
|
|
1393
1395
|
if (i > 0) {
|
|
1394
1396
|
const c = r?.sampleRange ?? {
|
|
1395
1397
|
from: 0,
|
|
1396
|
-
to: Math.min(
|
|
1398
|
+
to: Math.min(Ve - 1, i - 1)
|
|
1397
1399
|
};
|
|
1398
|
-
let
|
|
1399
|
-
if (
|
|
1400
|
-
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) });
|
|
1401
1403
|
else {
|
|
1402
|
-
const
|
|
1403
|
-
s =
|
|
1404
|
+
const x = me._collectValidatedValues(e, d, b);
|
|
1405
|
+
s = me._modeOrMedian([...x]), r?.materialize && (a = { from: d, values: x });
|
|
1404
1406
|
}
|
|
1405
1407
|
}
|
|
1406
|
-
if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s,
|
|
1407
|
-
for (let c = 0; c <
|
|
1408
|
-
const
|
|
1409
|
-
if (
|
|
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;
|
|
1411
|
+
if (d >= this.size)
|
|
1410
1412
|
break;
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1413
|
+
const b = a.values[c] - this.baseValue;
|
|
1414
|
+
b !== 0 && (this.deltas.set(d, b), this._updateTree(d, b));
|
|
1413
1415
|
}
|
|
1414
1416
|
this.total = this.getTotal();
|
|
1415
1417
|
}
|
|
@@ -1440,7 +1442,7 @@ class ae {
|
|
|
1440
1442
|
static _collectValidatedValues(t, e, r) {
|
|
1441
1443
|
const i = [];
|
|
1442
1444
|
for (let s = e; s <= r; s++)
|
|
1443
|
-
i.push(
|
|
1445
|
+
i.push(Fe(t(s), s));
|
|
1444
1446
|
return i;
|
|
1445
1447
|
}
|
|
1446
1448
|
/**
|
|
@@ -1454,22 +1456,22 @@ class ae {
|
|
|
1454
1456
|
static _modeOrMedian(t) {
|
|
1455
1457
|
if (t.length === 0)
|
|
1456
1458
|
return 0;
|
|
1457
|
-
t.sort((
|
|
1459
|
+
t.sort((a, c) => a - c);
|
|
1458
1460
|
const e = Math.floor(t.length / 2);
|
|
1459
1461
|
let r;
|
|
1460
1462
|
t.length % 2 === 0 ? r = Math.floor((t[e - 1] + t[e]) / 2) : r = t[e];
|
|
1461
1463
|
const i = /* @__PURE__ */ new Map();
|
|
1462
1464
|
let s = 0;
|
|
1463
|
-
for (const
|
|
1464
|
-
const c = (i.get(
|
|
1465
|
-
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);
|
|
1466
1468
|
}
|
|
1467
1469
|
if (s > t.length * 0.2) {
|
|
1468
|
-
const
|
|
1469
|
-
for (const [
|
|
1470
|
-
|
|
1471
|
-
const c =
|
|
1472
|
-
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);
|
|
1473
1475
|
}
|
|
1474
1476
|
return r;
|
|
1475
1477
|
}
|
|
@@ -1489,9 +1491,9 @@ class ae {
|
|
|
1489
1491
|
let i = Math.max(1, Math.ceil(e / r));
|
|
1490
1492
|
i % 2 === 0 && (i += 1);
|
|
1491
1493
|
const s = [];
|
|
1492
|
-
for (let
|
|
1493
|
-
s.push(
|
|
1494
|
-
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);
|
|
1495
1497
|
}
|
|
1496
1498
|
/**
|
|
1497
1499
|
* @method update
|
|
@@ -1538,14 +1540,14 @@ class ae {
|
|
|
1538
1540
|
throw new Error(`Index must be an integer: ${r}`);
|
|
1539
1541
|
if (!Number.isFinite(i))
|
|
1540
1542
|
throw new Error(`Change must be a finite number: ${i}`);
|
|
1541
|
-
const
|
|
1542
|
-
if (
|
|
1543
|
-
throw new Error(`Change would make the value at index ${r} negative: ${
|
|
1544
|
-
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);
|
|
1545
1547
|
}
|
|
1546
1548
|
for (const { index: r, change: i } of t) {
|
|
1547
|
-
const
|
|
1548
|
-
|
|
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);
|
|
1549
1551
|
}
|
|
1550
1552
|
return this.total;
|
|
1551
1553
|
}
|
|
@@ -1563,7 +1565,7 @@ class ae {
|
|
|
1563
1565
|
let r = t + 1;
|
|
1564
1566
|
for (; r <= this.size; ) {
|
|
1565
1567
|
this.tree.set(r, (this.tree.get(r) ?? 0) + e);
|
|
1566
|
-
const i =
|
|
1568
|
+
const i = xe(r);
|
|
1567
1569
|
if (i === 0)
|
|
1568
1570
|
break;
|
|
1569
1571
|
r += i;
|
|
@@ -1589,8 +1591,8 @@ class ae {
|
|
|
1589
1591
|
throw new Error(`Value must be a finite number: ${s}`);
|
|
1590
1592
|
if (s < 0)
|
|
1591
1593
|
throw new Error("Value cannot be negative.");
|
|
1592
|
-
const
|
|
1593
|
-
|
|
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);
|
|
1594
1596
|
}
|
|
1595
1597
|
return e;
|
|
1596
1598
|
}
|
|
@@ -1607,7 +1609,7 @@ class ae {
|
|
|
1607
1609
|
let t = 0, e = this.size;
|
|
1608
1610
|
for (; e > 0; ) {
|
|
1609
1611
|
t += this.tree.get(e) ?? 0;
|
|
1610
|
-
const r =
|
|
1612
|
+
const r = xe(e);
|
|
1611
1613
|
if (r === 0)
|
|
1612
1614
|
break;
|
|
1613
1615
|
e -= r;
|
|
@@ -1624,10 +1626,10 @@ class ae {
|
|
|
1624
1626
|
*/
|
|
1625
1627
|
_materialize(t, e = !0) {
|
|
1626
1628
|
if (this.valueFn) {
|
|
1627
|
-
const r = this.deltas.get(t) ?? 0, s =
|
|
1629
|
+
const r = this.deltas.get(t) ?? 0, s = Fe(this.valueFn(t), t) - this.baseValue;
|
|
1628
1630
|
if (s !== r && (s === 0 ? this.deltas.delete(t) : this.deltas.set(t, s), e)) {
|
|
1629
|
-
const
|
|
1630
|
-
this._updateTree(t,
|
|
1631
|
+
const a = s - r;
|
|
1632
|
+
this._updateTree(t, a);
|
|
1631
1633
|
}
|
|
1632
1634
|
}
|
|
1633
1635
|
}
|
|
@@ -1646,9 +1648,9 @@ class ae {
|
|
|
1646
1648
|
const i = t.ranges;
|
|
1647
1649
|
if (i && i.length > 0) {
|
|
1648
1650
|
for (const c of i) {
|
|
1649
|
-
const
|
|
1650
|
-
for (let
|
|
1651
|
-
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);
|
|
1652
1654
|
}
|
|
1653
1655
|
if (e === void 0)
|
|
1654
1656
|
return;
|
|
@@ -1656,8 +1658,8 @@ class ae {
|
|
|
1656
1658
|
this._materialize(e);
|
|
1657
1659
|
return;
|
|
1658
1660
|
}
|
|
1659
|
-
const s = i[0].from,
|
|
1660
|
-
e >= s && e <=
|
|
1661
|
+
const s = i[0].from, a = i[i.length - 1].to;
|
|
1662
|
+
e >= s && e <= a && this._materialize(e);
|
|
1661
1663
|
return;
|
|
1662
1664
|
}
|
|
1663
1665
|
e !== void 0 && this._materialize(e);
|
|
@@ -1689,13 +1691,13 @@ class ae {
|
|
|
1689
1691
|
if (this._materialize(s), (this.deltas.get(s) ?? 0) === c)
|
|
1690
1692
|
break;
|
|
1691
1693
|
}
|
|
1692
|
-
const
|
|
1694
|
+
const a = this.prefixSum(s);
|
|
1693
1695
|
return {
|
|
1694
1696
|
index: s,
|
|
1695
|
-
total: this.total ??
|
|
1696
|
-
cumulative:
|
|
1697
|
-
currentValue:
|
|
1698
|
-
safeIndex:
|
|
1697
|
+
total: this.total ?? a.total,
|
|
1698
|
+
cumulative: a.cumulative,
|
|
1699
|
+
currentValue: a.currentValue,
|
|
1700
|
+
safeIndex: a.safeIndex
|
|
1699
1701
|
};
|
|
1700
1702
|
}
|
|
1701
1703
|
/**
|
|
@@ -1712,10 +1714,10 @@ class ae {
|
|
|
1712
1714
|
for (; s << 1 <= this.size; )
|
|
1713
1715
|
s <<= 1;
|
|
1714
1716
|
for (; s > 0; s >>= 1) {
|
|
1715
|
-
const
|
|
1716
|
-
if (
|
|
1717
|
-
const
|
|
1718
|
-
(e ? i +
|
|
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);
|
|
1719
1721
|
}
|
|
1720
1722
|
}
|
|
1721
1723
|
return e ? r : r - 1;
|
|
@@ -1728,42 +1730,42 @@ class ae {
|
|
|
1728
1730
|
_findIndexLarge(t, e, r) {
|
|
1729
1731
|
if (this.size === 0)
|
|
1730
1732
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1731
|
-
const i =
|
|
1733
|
+
const i = Pr(this.size);
|
|
1732
1734
|
if (i === 0n)
|
|
1733
1735
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1734
1736
|
this._materializeRanges(e.materializeOption);
|
|
1735
1737
|
const s = e.materializeOption?.materialize === !0;
|
|
1736
1738
|
for (; ; ) {
|
|
1737
|
-
let
|
|
1738
|
-
for (;
|
|
1739
|
-
const
|
|
1740
|
-
if (
|
|
1741
|
-
if (
|
|
1742
|
-
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)
|
|
1743
1745
|
break;
|
|
1744
|
-
c =
|
|
1746
|
+
c = m - 1n;
|
|
1745
1747
|
} else
|
|
1746
|
-
|
|
1748
|
+
a = m + 1n;
|
|
1747
1749
|
else if (r)
|
|
1748
|
-
|
|
1750
|
+
a = m + 1n;
|
|
1749
1751
|
else {
|
|
1750
|
-
if (
|
|
1752
|
+
if (m === 0n)
|
|
1751
1753
|
break;
|
|
1752
|
-
c =
|
|
1754
|
+
c = m - 1n;
|
|
1753
1755
|
}
|
|
1754
1756
|
}
|
|
1755
|
-
const
|
|
1757
|
+
const v = b, E = d !== void 0 ? Number(d) : -1;
|
|
1756
1758
|
if (s && E >= 0) {
|
|
1757
|
-
const
|
|
1758
|
-
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)
|
|
1759
1761
|
continue;
|
|
1760
1762
|
}
|
|
1761
1763
|
return {
|
|
1762
1764
|
index: E,
|
|
1763
|
-
total:
|
|
1764
|
-
cumulative:
|
|
1765
|
-
currentValue:
|
|
1766
|
-
safeIndex:
|
|
1765
|
+
total: x,
|
|
1766
|
+
cumulative: v?.cumulative,
|
|
1767
|
+
currentValue: v?.currentValue,
|
|
1768
|
+
safeIndex: v?.safeIndex
|
|
1767
1769
|
};
|
|
1768
1770
|
}
|
|
1769
1771
|
}
|
|
@@ -1780,16 +1782,16 @@ class ae {
|
|
|
1780
1782
|
return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
|
|
1781
1783
|
if (this.size === 0)
|
|
1782
1784
|
return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
|
|
1783
|
-
const r =
|
|
1785
|
+
const r = vt(Math.trunc(t), 0, this.size - 1), i = e?.materializeOption;
|
|
1784
1786
|
this._materializeRanges(i, r, !0);
|
|
1785
|
-
let s = 0,
|
|
1786
|
-
for (;
|
|
1787
|
-
const
|
|
1788
|
-
s +=
|
|
1789
|
-
const
|
|
1790
|
-
if (
|
|
1787
|
+
let s = 0, a = r + 1;
|
|
1788
|
+
for (; a > 0; ) {
|
|
1789
|
+
const d = this.tree.get(a) ?? 0;
|
|
1790
|
+
s += d;
|
|
1791
|
+
const b = xe(a);
|
|
1792
|
+
if (b === 0)
|
|
1791
1793
|
break;
|
|
1792
|
-
|
|
1794
|
+
a -= b;
|
|
1793
1795
|
}
|
|
1794
1796
|
const c = i?.materialize ? this.get(r) : (this.deltas.get(r) || 0) + this.baseValue;
|
|
1795
1797
|
return { cumulative: s + this.baseValue * (r + 1), total: this.total, currentValue: c, safeIndex: r };
|
|
@@ -1849,10 +1851,10 @@ class ae {
|
|
|
1849
1851
|
let s = r + 1;
|
|
1850
1852
|
for (; s <= this.size; ) {
|
|
1851
1853
|
e.set(s, (e.get(s) ?? 0) + i);
|
|
1852
|
-
const
|
|
1853
|
-
if (
|
|
1854
|
+
const a = xe(s);
|
|
1855
|
+
if (a === 0)
|
|
1854
1856
|
break;
|
|
1855
|
-
s +=
|
|
1857
|
+
s += a;
|
|
1856
1858
|
}
|
|
1857
1859
|
}
|
|
1858
1860
|
this.tree = e, this.total = this._computeTreeTotal();
|
|
@@ -1966,17 +1968,17 @@ class ae {
|
|
|
1966
1968
|
_propagateDeltaToGrownNodes(t, e, r, i) {
|
|
1967
1969
|
let s = t + 1;
|
|
1968
1970
|
for (; s <= r; ) {
|
|
1969
|
-
const
|
|
1970
|
-
if (
|
|
1971
|
+
const a = xe(s);
|
|
1972
|
+
if (a === 0)
|
|
1971
1973
|
break;
|
|
1972
|
-
s +=
|
|
1974
|
+
s += a;
|
|
1973
1975
|
}
|
|
1974
1976
|
for (; s <= i; ) {
|
|
1975
1977
|
this.tree.set(s, (this.tree.get(s) ?? 0) + e);
|
|
1976
|
-
const
|
|
1977
|
-
if (
|
|
1978
|
+
const a = xe(s);
|
|
1979
|
+
if (a === 0)
|
|
1978
1980
|
break;
|
|
1979
|
-
s +=
|
|
1981
|
+
s += a;
|
|
1980
1982
|
}
|
|
1981
1983
|
}
|
|
1982
1984
|
/**
|
|
@@ -1989,15 +1991,15 @@ class ae {
|
|
|
1989
1991
|
*/
|
|
1990
1992
|
_growSize(t, e) {
|
|
1991
1993
|
if (this.size = e, this.deltas.size > 0) {
|
|
1992
|
-
const r =
|
|
1994
|
+
const r = me._minCoveredLowBound(t, e);
|
|
1993
1995
|
if (t - r < this.deltas.size)
|
|
1994
1996
|
for (let s = r; s < t; s++) {
|
|
1995
|
-
const
|
|
1996
|
-
|
|
1997
|
+
const a = this.deltas.get(s);
|
|
1998
|
+
a === void 0 || a === 0 || this._propagateDeltaToGrownNodes(s, a, t, e);
|
|
1997
1999
|
}
|
|
1998
2000
|
else
|
|
1999
|
-
for (const [s,
|
|
2000
|
-
|
|
2001
|
+
for (const [s, a] of this.deltas.entries())
|
|
2002
|
+
a === 0 || s < r || this._propagateDeltaToGrownNodes(s, a, t, e);
|
|
2001
2003
|
}
|
|
2002
2004
|
this.total = this._computeTreeTotal();
|
|
2003
2005
|
}
|
|
@@ -2067,20 +2069,20 @@ class ae {
|
|
|
2067
2069
|
return this._findIndex(t, e ?? {}, !1);
|
|
2068
2070
|
}
|
|
2069
2071
|
}
|
|
2070
|
-
const
|
|
2072
|
+
const Mr = (n, t) => {
|
|
2071
2073
|
const e = n?.sampleRange, r = t?.sampleRange;
|
|
2072
2074
|
return e === r ? !1 : e && r ? e.from !== r.from || e.to !== r.to : !0;
|
|
2073
|
-
},
|
|
2074
|
-
const r = Number.isFinite(n) && n > 0 ? Math.trunc(n) : 0, i =
|
|
2075
|
-
i.current === null && (i.current = new
|
|
2076
|
-
const
|
|
2077
|
-
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) {
|
|
2078
2080
|
const E = e?.resetOnValueFnChange ?? !0;
|
|
2079
|
-
|
|
2080
|
-
} else
|
|
2081
|
-
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;
|
|
2082
2084
|
};
|
|
2083
|
-
class
|
|
2085
|
+
class wr {
|
|
2084
2086
|
key;
|
|
2085
2087
|
value;
|
|
2086
2088
|
prev = null;
|
|
@@ -2089,7 +2091,7 @@ class yr {
|
|
|
2089
2091
|
this.key = t, this.value = e;
|
|
2090
2092
|
}
|
|
2091
2093
|
}
|
|
2092
|
-
class
|
|
2094
|
+
class ze {
|
|
2093
2095
|
head = null;
|
|
2094
2096
|
tail = null;
|
|
2095
2097
|
/**
|
|
@@ -2130,242 +2132,242 @@ class Fe {
|
|
|
2130
2132
|
this.remove(t), this.addToTail(t);
|
|
2131
2133
|
}
|
|
2132
2134
|
}
|
|
2133
|
-
function
|
|
2134
|
-
const t =
|
|
2135
|
-
|
|
2135
|
+
function Rr(n) {
|
|
2136
|
+
const t = I(/* @__PURE__ */ new Map()), e = I(new ze()), r = Math.floor(n), i = I(r);
|
|
2137
|
+
q(() => {
|
|
2136
2138
|
if (i.current = r, Number.isNaN(r) || r < 0) {
|
|
2137
|
-
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();
|
|
2138
2140
|
return;
|
|
2139
2141
|
}
|
|
2140
2142
|
if (Number.isFinite(r))
|
|
2141
2143
|
for (; t.current.size > r; ) {
|
|
2142
|
-
const
|
|
2143
|
-
if (
|
|
2144
|
-
t.current.delete(
|
|
2144
|
+
const x = e.current.removeHead();
|
|
2145
|
+
if (x)
|
|
2146
|
+
t.current.delete(x.key);
|
|
2145
2147
|
else
|
|
2146
2148
|
break;
|
|
2147
2149
|
}
|
|
2148
2150
|
}, [n, r]);
|
|
2149
|
-
const s =
|
|
2150
|
-
const
|
|
2151
|
-
if (
|
|
2152
|
-
return e.current.moveToTail(
|
|
2153
|
-
}, []),
|
|
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) => {
|
|
2154
2156
|
const E = i.current;
|
|
2155
2157
|
if (Number.isNaN(E) || E <= 0)
|
|
2156
2158
|
return;
|
|
2157
|
-
let
|
|
2158
|
-
if (
|
|
2159
|
-
|
|
2159
|
+
let m = t.current.get(x);
|
|
2160
|
+
if (m)
|
|
2161
|
+
m.value = v, e.current.moveToTail(m);
|
|
2160
2162
|
else {
|
|
2161
2163
|
if (t.current.size >= E) {
|
|
2162
2164
|
const _ = e.current.removeHead();
|
|
2163
2165
|
_ && t.current.delete(_.key);
|
|
2164
2166
|
}
|
|
2165
|
-
|
|
2167
|
+
m = new wr(x, v), t.current.set(x, m), e.current.addToTail(m);
|
|
2166
2168
|
}
|
|
2167
|
-
}, []), c =
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2170
|
-
}, []),
|
|
2171
|
-
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();
|
|
2172
2174
|
}, []);
|
|
2173
|
-
return
|
|
2175
|
+
return Lt(() => ({ get: s, set: a, has: c, remove: d, clear: b }), [s, a, c, d, b]);
|
|
2174
2176
|
}
|
|
2175
|
-
const
|
|
2176
|
-
const { get: n, set: t, has: e, clear: r } =
|
|
2177
|
-
return
|
|
2178
|
-
},
|
|
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) => ({
|
|
2179
2181
|
top: Math.max(0, n?.top ?? 0),
|
|
2180
2182
|
bottom: Math.max(0, n?.bottom ?? 0)
|
|
2181
|
-
}),
|
|
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) => {
|
|
2182
2184
|
if (!Number.isFinite(n)) return 0n;
|
|
2183
2185
|
const t = Math.trunc(n);
|
|
2184
2186
|
return t <= 0 ? 0n : BigInt(t);
|
|
2185
|
-
},
|
|
2186
|
-
const
|
|
2187
|
-
if (
|
|
2187
|
+
}, Nr = (n, t, e, r, i, s, a, c) => {
|
|
2188
|
+
const d = ye(r);
|
|
2189
|
+
if (d === 0n)
|
|
2188
2190
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2189
|
-
const
|
|
2190
|
-
let
|
|
2191
|
-
|
|
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);
|
|
2192
2194
|
const _ = (D) => {
|
|
2193
|
-
const
|
|
2194
|
-
if (!Number.isSafeInteger(
|
|
2195
|
+
const k = Number(D);
|
|
2196
|
+
if (!Number.isSafeInteger(k))
|
|
2195
2197
|
return null;
|
|
2196
|
-
const { cumulative:
|
|
2197
|
-
if (!Number.isFinite(
|
|
2198
|
+
const { cumulative: P } = s.prefixSum(k, { materializeOption: { materialize: !1 } });
|
|
2199
|
+
if (!Number.isFinite(P))
|
|
2198
2200
|
return null;
|
|
2199
|
-
const { index:
|
|
2200
|
-
if (
|
|
2201
|
+
const { index: X } = s.findIndexAtOrAfter(P + 0.5, { materializeOption: { materialize: !1 } });
|
|
2202
|
+
if (X === -1)
|
|
2201
2203
|
return null;
|
|
2202
|
-
const
|
|
2203
|
-
return
|
|
2204
|
-
},
|
|
2205
|
-
let
|
|
2206
|
-
for (;
|
|
2207
|
-
const
|
|
2208
|
-
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)
|
|
2209
2211
|
break;
|
|
2210
|
-
if (
|
|
2211
|
-
if (
|
|
2212
|
-
const
|
|
2213
|
-
if (
|
|
2214
|
-
|
|
2215
|
-
else if (
|
|
2216
|
-
|
|
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;
|
|
2217
2219
|
else
|
|
2218
2220
|
break;
|
|
2219
2221
|
}
|
|
2220
2222
|
} else
|
|
2221
|
-
|
|
2223
|
+
N = 0;
|
|
2222
2224
|
}
|
|
2223
|
-
return
|
|
2225
|
+
return $ === 0n && (X = D), { height: k, end: X };
|
|
2224
2226
|
};
|
|
2225
|
-
let { height:
|
|
2226
|
-
if (
|
|
2227
|
-
let D =
|
|
2228
|
-
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; ) {
|
|
2229
2231
|
D -= 1n;
|
|
2230
|
-
const
|
|
2231
|
-
if (
|
|
2232
|
+
const $ = Number(D), N = i($);
|
|
2233
|
+
if (k += N, !Number.isFinite(N) || N < 0)
|
|
2232
2234
|
break;
|
|
2233
|
-
if (
|
|
2234
|
-
if (
|
|
2235
|
-
const
|
|
2236
|
-
if (!Number.isSafeInteger(
|
|
2235
|
+
if (N === 0) {
|
|
2236
|
+
if (P += 1, P > Ae) {
|
|
2237
|
+
const lt = Number(D);
|
|
2238
|
+
if (!Number.isSafeInteger(lt))
|
|
2237
2239
|
break;
|
|
2238
|
-
const { cumulative:
|
|
2239
|
-
if (!Number.isFinite(
|
|
2240
|
+
const { cumulative: K } = s.prefixSum(lt, { materializeOption: { materialize: !1 } });
|
|
2241
|
+
if (!Number.isFinite(K))
|
|
2240
2242
|
break;
|
|
2241
|
-
const { index:
|
|
2242
|
-
if (
|
|
2243
|
-
D =
|
|
2244
|
-
else if (
|
|
2245
|
-
|
|
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)
|
|
2247
|
+
P = 0;
|
|
2246
2248
|
else
|
|
2247
2249
|
break;
|
|
2248
2250
|
}
|
|
2249
2251
|
} else
|
|
2250
|
-
|
|
2252
|
+
P = 0;
|
|
2251
2253
|
}
|
|
2252
|
-
|
|
2253
|
-
const
|
|
2254
|
-
|
|
2254
|
+
m = b(D);
|
|
2255
|
+
const X = B(m);
|
|
2256
|
+
Z = X.height, ut = X.end;
|
|
2255
2257
|
}
|
|
2256
|
-
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)));
|
|
2257
2259
|
return {
|
|
2258
|
-
renderingStartIndex:
|
|
2259
|
-
renderingEndIndex:
|
|
2260
|
-
visibleStartIndex:
|
|
2261
|
-
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)
|
|
2262
2264
|
};
|
|
2263
|
-
},
|
|
2265
|
+
}, Vr = (n, t, e, r, i, s, a) => {
|
|
2264
2266
|
if (r === 0)
|
|
2265
2267
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2266
|
-
const c = Number.isFinite(
|
|
2268
|
+
const c = Number.isFinite(a), d = c ? Math.min(Math.max(0, n), a) : Math.max(0, n);
|
|
2267
2269
|
if (r >= Number.MAX_SAFE_INTEGER)
|
|
2268
|
-
return
|
|
2269
|
-
const { index:
|
|
2270
|
-
let
|
|
2271
|
-
if (
|
|
2272
|
-
|
|
2273
|
-
else if (
|
|
2274
|
-
_ =
|
|
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;
|
|
2275
2277
|
else {
|
|
2276
|
-
const { cumulative: D, currentValue:
|
|
2277
|
-
_ = (D ?? 0) - (
|
|
2278
|
+
const { cumulative: D, currentValue: k } = s.prefixSum(m, { materializeOption: { materialize: !1 } });
|
|
2279
|
+
_ = (D ?? 0) - (k ?? 0) - d;
|
|
2278
2280
|
}
|
|
2279
|
-
const
|
|
2280
|
-
let
|
|
2281
|
-
for (;
|
|
2282
|
-
const
|
|
2283
|
-
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)
|
|
2284
2286
|
break;
|
|
2285
|
-
if (
|
|
2286
|
-
if (
|
|
2287
|
-
const { cumulative:
|
|
2288
|
-
if (
|
|
2289
|
-
|
|
2290
|
-
else if (
|
|
2291
|
-
|
|
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;
|
|
2292
2294
|
else
|
|
2293
2295
|
break;
|
|
2294
2296
|
}
|
|
2295
2297
|
} else
|
|
2296
|
-
|
|
2298
|
+
$ = 0;
|
|
2297
2299
|
}
|
|
2298
|
-
return { cursor:
|
|
2299
|
-
},
|
|
2300
|
-
let
|
|
2301
|
-
if (_ =
|
|
2302
|
-
let D = _ + Math.abs(Math.min(0,
|
|
2303
|
-
for (;
|
|
2304
|
-
const
|
|
2305
|
-
if (D +=
|
|
2306
|
-
|
|
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--;
|
|
2307
2309
|
break;
|
|
2308
2310
|
}
|
|
2309
|
-
if (
|
|
2310
|
-
if (
|
|
2311
|
-
const { cumulative:
|
|
2312
|
-
if (
|
|
2313
|
-
|
|
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;
|
|
2314
2316
|
continue;
|
|
2315
2317
|
}
|
|
2316
|
-
if (
|
|
2317
|
-
|
|
2318
|
+
if (lt === k && k >= 1 && i(k - 1) > 0)
|
|
2319
|
+
P = 0;
|
|
2318
2320
|
else {
|
|
2319
|
-
|
|
2321
|
+
k--;
|
|
2320
2322
|
break;
|
|
2321
2323
|
}
|
|
2322
2324
|
}
|
|
2323
2325
|
} else
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
+
P = 0;
|
|
2327
|
+
k--;
|
|
2326
2328
|
}
|
|
2327
|
-
|
|
2328
|
-
const
|
|
2329
|
-
|
|
2329
|
+
m = It(k + 1, r);
|
|
2330
|
+
const X = Z(m, 0);
|
|
2331
|
+
rt = X.cursor, _ = X.height;
|
|
2330
2332
|
}
|
|
2331
|
-
const
|
|
2332
|
-
return { renderingStartIndex:
|
|
2333
|
-
},
|
|
2334
|
-
const r = Math.max(0, t ?? 0), i =
|
|
2335
|
-
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(
|
|
2336
2338
|
() => () => {
|
|
2337
2339
|
i.id !== null && (cancelAnimationFrame(i.id), i.id = null);
|
|
2338
2340
|
},
|
|
2339
2341
|
[i]
|
|
2340
|
-
),
|
|
2342
|
+
), S(
|
|
2341
2343
|
(s) => {
|
|
2342
2344
|
if (i.arg = s, i.id !== null) return;
|
|
2343
|
-
const
|
|
2345
|
+
const a = (c) => {
|
|
2344
2346
|
if (i.id = null, i.arg === null) return;
|
|
2345
|
-
const
|
|
2346
|
-
if (r === 0 || i.last === 0 ||
|
|
2347
|
+
const d = c - i.last;
|
|
2348
|
+
if (r === 0 || i.last === 0 || d >= r) {
|
|
2347
2349
|
if (n.current)
|
|
2348
2350
|
try {
|
|
2349
2351
|
e(n.current, i.arg);
|
|
2350
|
-
} catch (
|
|
2351
|
-
console.error("[useThrottledInvoker] Error invoking callback",
|
|
2352
|
+
} catch (b) {
|
|
2353
|
+
console.error("[useThrottledInvoker] Error invoking callback", b);
|
|
2352
2354
|
}
|
|
2353
2355
|
i.arg = null, i.last = c;
|
|
2354
2356
|
}
|
|
2355
|
-
i.arg !== null && (i.id = requestAnimationFrame(
|
|
2357
|
+
i.arg !== null && (i.id = requestAnimationFrame(a));
|
|
2356
2358
|
};
|
|
2357
|
-
i.id = requestAnimationFrame(
|
|
2359
|
+
i.id = requestAnimationFrame(a);
|
|
2358
2360
|
},
|
|
2359
2361
|
[r, e, n, i]
|
|
2360
2362
|
);
|
|
2361
|
-
},
|
|
2362
|
-
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((_) => {
|
|
2363
2365
|
_.currentTarget.focus({ preventScroll: !0 });
|
|
2364
2366
|
}, []);
|
|
2365
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ ot(
|
|
2366
2368
|
"div",
|
|
2367
2369
|
{
|
|
2368
|
-
ref:
|
|
2370
|
+
ref: x,
|
|
2369
2371
|
"data-index": n,
|
|
2370
2372
|
"data-virtualscroll-item": "true",
|
|
2371
2373
|
className: "aqvs-item-container",
|
|
@@ -2374,580 +2376,582 @@ const Rr = 1e4, Or = () => {
|
|
|
2374
2376
|
height: e,
|
|
2375
2377
|
overflow: s ? "hidden" : void 0
|
|
2376
2378
|
},
|
|
2377
|
-
tabIndex:
|
|
2378
|
-
onPointerDown:
|
|
2379
|
-
onKeyDownCapture:
|
|
2380
|
-
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,
|
|
2381
2383
|
children: i(r, n)
|
|
2382
2384
|
}
|
|
2383
2385
|
);
|
|
2384
|
-
}),
|
|
2386
|
+
}), Dr = ({
|
|
2385
2387
|
itemCount: n,
|
|
2386
2388
|
getItem: t,
|
|
2387
2389
|
getItemKey: e,
|
|
2388
2390
|
getItemHeight: r,
|
|
2389
2391
|
viewportSize: i,
|
|
2390
2392
|
overscanCount: s = 15,
|
|
2391
|
-
className:
|
|
2393
|
+
className: a,
|
|
2392
2394
|
testId: c,
|
|
2393
|
-
onScroll:
|
|
2394
|
-
onRangeChange:
|
|
2395
|
-
children:
|
|
2396
|
-
background:
|
|
2395
|
+
onScroll: d,
|
|
2396
|
+
onRangeChange: b,
|
|
2397
|
+
children: x,
|
|
2398
|
+
background: v,
|
|
2397
2399
|
initialScrollIndex: E,
|
|
2398
|
-
initialScrollOffset:
|
|
2400
|
+
initialScrollOffset: m,
|
|
2399
2401
|
callbackThrottleMs: _ = 5,
|
|
2400
|
-
contentInsets:
|
|
2401
|
-
onItemFocus:
|
|
2402
|
-
scrollBarOptions:
|
|
2403
|
-
behaviorOptions:
|
|
2404
|
-
onWheelHorizontal:
|
|
2405
|
-
|
|
2406
|
-
|
|
2402
|
+
contentInsets: B,
|
|
2403
|
+
onItemFocus: Z,
|
|
2404
|
+
scrollBarOptions: ut,
|
|
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({
|
|
2407
2410
|
renderingStartIndex: 0,
|
|
2408
2411
|
renderingEndIndex: 0,
|
|
2409
2412
|
visibleStartIndex: 0,
|
|
2410
2413
|
visibleEndIndex: 0,
|
|
2411
2414
|
scrollPosition: 0,
|
|
2412
2415
|
totalHeight: 0
|
|
2413
|
-
}),
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
}, [
|
|
2417
|
-
const
|
|
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(() => {
|
|
2418
2421
|
const u = typeof E == "number" && Number.isFinite(E) ? Math.max(0, Math.trunc(E)) : 0;
|
|
2419
2422
|
return { from: Math.max(0, u - 50), to: u + 50 };
|
|
2420
|
-
}),
|
|
2423
|
+
}), ae = Lt(
|
|
2421
2424
|
// 目的: Fenwick Tree のオプション設定
|
|
2422
2425
|
// 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
|
|
2423
2426
|
// itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
|
|
2424
2427
|
// この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
|
|
2425
2428
|
() => ({
|
|
2426
|
-
sampleRange:
|
|
2427
|
-
resetOnValueFnChange:
|
|
2429
|
+
sampleRange: Kt,
|
|
2430
|
+
resetOnValueFnChange: J,
|
|
2428
2431
|
materialize: !0
|
|
2429
2432
|
}),
|
|
2430
|
-
[
|
|
2431
|
-
),
|
|
2432
|
-
let
|
|
2433
|
+
[J, Kt]
|
|
2434
|
+
), A = yr(n, r, ae), [j] = Jt(() => {
|
|
2435
|
+
let l = 0, u = 0;
|
|
2433
2436
|
if (typeof E == "number") {
|
|
2434
|
-
const
|
|
2435
|
-
|
|
2436
|
-
} else typeof
|
|
2437
|
-
return { position:
|
|
2438
|
-
}), [Bt,
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
}, [
|
|
2442
|
-
const
|
|
2443
|
-
(
|
|
2444
|
-
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")
|
|
2445
2448
|
try {
|
|
2446
|
-
|
|
2449
|
+
l.focus({ preventScroll: !0 });
|
|
2447
2450
|
} catch {
|
|
2448
|
-
|
|
2451
|
+
l.focus();
|
|
2449
2452
|
}
|
|
2450
2453
|
},
|
|
2451
|
-
[
|
|
2452
|
-
),
|
|
2453
|
-
|
|
2454
|
-
}, []),
|
|
2455
|
-
|
|
2456
|
-
}, []),
|
|
2457
|
-
|
|
2458
|
-
const
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
}), []),
|
|
2462
|
-
|
|
2463
|
-
}, [
|
|
2464
|
-
const
|
|
2465
|
-
(
|
|
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) => {
|
|
2466
2469
|
if (!u) {
|
|
2467
|
-
|
|
2470
|
+
z.current.delete(l);
|
|
2468
2471
|
return;
|
|
2469
2472
|
}
|
|
2470
|
-
|
|
2473
|
+
V && (z.current.set(l, u), et.current === l && (et.current = null, ct.current = l, $t(u)));
|
|
2471
2474
|
},
|
|
2472
|
-
[
|
|
2473
|
-
),
|
|
2475
|
+
[V, $t]
|
|
2476
|
+
), Qt = 0.01, Ht = I({
|
|
2474
2477
|
rafId: null,
|
|
2475
2478
|
loopActive: !1,
|
|
2476
2479
|
idleFrames: 0,
|
|
2477
|
-
lastRenderedPosition:
|
|
2478
|
-
}),
|
|
2479
|
-
const
|
|
2480
|
-
|
|
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;
|
|
2481
2484
|
}, []);
|
|
2482
|
-
|
|
2485
|
+
q(
|
|
2483
2486
|
() => () => {
|
|
2484
|
-
|
|
2487
|
+
Ut();
|
|
2485
2488
|
},
|
|
2486
|
-
[
|
|
2489
|
+
[Ut]
|
|
2487
2490
|
);
|
|
2488
|
-
const
|
|
2489
|
-
}),
|
|
2490
|
-
const
|
|
2491
|
-
|
|
2492
|
-
const u =
|
|
2493
|
-
if (
|
|
2494
|
-
|
|
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();
|
|
2495
2498
|
return;
|
|
2496
2499
|
}
|
|
2497
2500
|
if (typeof requestAnimationFrame == "function") {
|
|
2498
|
-
|
|
2501
|
+
l.rafId = requestAnimationFrame((Y) => te.current(Y));
|
|
2499
2502
|
return;
|
|
2500
2503
|
}
|
|
2501
|
-
|
|
2502
|
-
}, [
|
|
2503
|
-
|
|
2504
|
-
const
|
|
2505
|
-
const
|
|
2506
|
-
if (
|
|
2507
|
-
if (
|
|
2508
|
-
|
|
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);
|
|
2509
2512
|
return;
|
|
2510
2513
|
}
|
|
2511
|
-
|
|
2514
|
+
l.loopActive = !1;
|
|
2512
2515
|
}
|
|
2513
|
-
}, [
|
|
2514
|
-
(
|
|
2515
|
-
const
|
|
2516
|
-
if (
|
|
2517
|
-
|
|
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() });
|
|
2518
2521
|
return;
|
|
2519
2522
|
}
|
|
2520
|
-
|
|
2523
|
+
ue();
|
|
2521
2524
|
},
|
|
2522
|
-
[
|
|
2523
|
-
),
|
|
2524
|
-
const u =
|
|
2525
|
+
[ue, A, y.top, Vt]
|
|
2526
|
+
), ee = S((l) => {
|
|
2527
|
+
const u = F.current;
|
|
2525
2528
|
if (!u)
|
|
2526
|
-
return
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2529
|
-
const
|
|
2530
|
-
return
|
|
2531
|
-
}, []),
|
|
2532
|
-
|
|
2533
|
-
if (!
|
|
2534
|
-
if (
|
|
2535
|
-
const
|
|
2536
|
-
|
|
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);
|
|
2537
2540
|
} else
|
|
2538
|
-
|
|
2539
|
-
}, [
|
|
2540
|
-
const
|
|
2541
|
-
if (
|
|
2542
|
-
|
|
2541
|
+
tt(dt.current, { immediate: !0 });
|
|
2542
|
+
}, [m, y.top, tt]), q(() => {
|
|
2543
|
+
const l = A.getTotal();
|
|
2544
|
+
if (Et !== l) {
|
|
2545
|
+
Xt(l);
|
|
2543
2546
|
return;
|
|
2544
2547
|
}
|
|
2545
|
-
if (
|
|
2546
|
-
|
|
2547
|
-
const u =
|
|
2548
|
-
if (u && Math.abs(u.getScrollPosition() -
|
|
2549
|
-
const
|
|
2550
|
-
|
|
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 });
|
|
2551
2554
|
}
|
|
2552
2555
|
}
|
|
2553
|
-
}, [
|
|
2554
|
-
if (
|
|
2555
|
-
const { index:
|
|
2556
|
-
if (
|
|
2557
|
-
const
|
|
2558
|
-
let
|
|
2559
|
-
u === "bottom" ?
|
|
2560
|
-
const
|
|
2561
|
-
Math.abs(
|
|
2562
|
-
from:
|
|
2563
|
-
to:
|
|
2564
|
-
targetIndex:
|
|
2565
|
-
}),
|
|
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 }));
|
|
2566
2569
|
}
|
|
2567
2570
|
}
|
|
2568
|
-
|
|
2569
|
-
}, [
|
|
2570
|
-
const
|
|
2571
|
-
if (
|
|
2572
|
-
const u =
|
|
2573
|
-
|
|
2574
|
-
}, [
|
|
2575
|
-
const
|
|
2576
|
-
(
|
|
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) => {
|
|
2577
2580
|
if (n === 0)
|
|
2578
2581
|
return;
|
|
2579
|
-
const
|
|
2580
|
-
|
|
2581
|
-
let
|
|
2582
|
-
if (
|
|
2583
|
-
const
|
|
2584
|
-
|
|
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;
|
|
2585
2588
|
}
|
|
2586
|
-
if (
|
|
2587
|
-
const
|
|
2588
|
-
|
|
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 });
|
|
2589
2592
|
}
|
|
2590
2593
|
},
|
|
2591
|
-
[
|
|
2592
|
-
),
|
|
2593
|
-
(
|
|
2594
|
-
if (!
|
|
2594
|
+
[A, n, ee, tt, B]
|
|
2595
|
+
), Wt = S(
|
|
2596
|
+
(l, u) => {
|
|
2597
|
+
if (!F.current || n === 0)
|
|
2595
2598
|
return;
|
|
2596
|
-
const
|
|
2597
|
-
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)
|
|
2598
2601
|
return;
|
|
2599
|
-
const
|
|
2600
|
-
let
|
|
2601
|
-
u?.align === "bottom" ?
|
|
2602
|
-
const
|
|
2603
|
-
|
|
2604
|
-
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,
|
|
2605
2608
|
align: u?.align,
|
|
2606
2609
|
offset: u?.offset
|
|
2607
2610
|
};
|
|
2608
|
-
const
|
|
2609
|
-
|
|
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 });
|
|
2610
2613
|
},
|
|
2611
|
-
[
|
|
2612
|
-
),
|
|
2613
|
-
(
|
|
2614
|
-
if (!
|
|
2614
|
+
[A, s, n, y.top, y.bottom, i, tt]
|
|
2615
|
+
), ge = S(
|
|
2616
|
+
(l) => {
|
|
2617
|
+
if (!F.current || n === 0)
|
|
2615
2618
|
return;
|
|
2616
|
-
const u =
|
|
2617
|
-
|
|
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 });
|
|
2618
2621
|
},
|
|
2619
|
-
[
|
|
2620
|
-
),
|
|
2621
|
-
(
|
|
2622
|
-
const u =
|
|
2623
|
-
|
|
2624
|
-
const
|
|
2625
|
-
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;
|
|
2626
2629
|
},
|
|
2627
|
-
[
|
|
2628
|
-
),
|
|
2629
|
-
(
|
|
2630
|
-
C.debug("[VirtualScroll] Scroll position changed:",
|
|
2631
|
-
const
|
|
2632
|
-
|
|
2633
|
-
const
|
|
2634
|
-
if (
|
|
2635
|
-
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)
|
|
2636
2639
|
return;
|
|
2637
|
-
const
|
|
2638
|
-
if (C.debug("[VirtualScroll] Scroll diff:",
|
|
2639
|
-
const
|
|
2640
|
-
|
|
2641
|
-
|
|
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");
|
|
2642
2645
|
}, 2e3);
|
|
2643
2646
|
}
|
|
2644
2647
|
}
|
|
2645
2648
|
},
|
|
2646
|
-
[
|
|
2647
|
-
),
|
|
2648
|
-
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);
|
|
2649
2652
|
return C.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
2650
2653
|
...u,
|
|
2651
|
-
scrollPosition:
|
|
2652
|
-
renderingContentSize:
|
|
2654
|
+
scrollPosition: re,
|
|
2655
|
+
renderingContentSize: l,
|
|
2653
2656
|
overscanCount: s,
|
|
2654
2657
|
viewportSize: i
|
|
2655
2658
|
})), u;
|
|
2656
|
-
}, [
|
|
2657
|
-
(
|
|
2658
|
-
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)
|
|
2659
2662
|
return;
|
|
2660
|
-
const
|
|
2663
|
+
const h = It(l, n);
|
|
2661
2664
|
if (!(u?.ensureVisible ?? !0)) {
|
|
2662
|
-
const
|
|
2663
|
-
|
|
2665
|
+
const Dt = z.current.get(h);
|
|
2666
|
+
Dt && (et.current = null, ct.current = h, $t(Dt));
|
|
2664
2667
|
return;
|
|
2665
2668
|
}
|
|
2666
|
-
const
|
|
2667
|
-
if (
|
|
2668
|
-
|
|
2669
|
-
const
|
|
2670
|
-
|
|
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;
|
|
2671
2674
|
return;
|
|
2672
2675
|
}
|
|
2673
|
-
const
|
|
2674
|
-
if (
|
|
2675
|
-
|
|
2676
|
+
const Ft = z.current.get(h);
|
|
2677
|
+
if (Ft) {
|
|
2678
|
+
et.current = null, ct.current = h, $t(Ft);
|
|
2676
2679
|
return;
|
|
2677
2680
|
}
|
|
2678
|
-
|
|
2681
|
+
et.current = h;
|
|
2679
2682
|
},
|
|
2680
|
-
[
|
|
2681
|
-
),
|
|
2682
|
-
(
|
|
2683
|
-
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)
|
|
2684
2687
|
return;
|
|
2685
|
-
const
|
|
2686
|
-
if (
|
|
2687
|
-
const
|
|
2688
|
-
if (
|
|
2688
|
+
const h = l.target;
|
|
2689
|
+
if (h) {
|
|
2690
|
+
const R = h.tagName;
|
|
2691
|
+
if (R === "INPUT" || R === "TEXTAREA" || R === "SELECT" || h.isContentEditable)
|
|
2689
2692
|
return;
|
|
2690
2693
|
}
|
|
2691
|
-
if (
|
|
2692
|
-
u < n - 1 && (
|
|
2694
|
+
if (l.key === "ArrowDown") {
|
|
2695
|
+
u < n - 1 && (l.preventDefault(), se(u + 1));
|
|
2693
2696
|
return;
|
|
2694
2697
|
}
|
|
2695
|
-
if (
|
|
2696
|
-
u > 0 && (
|
|
2698
|
+
if (l.key === "ArrowUp") {
|
|
2699
|
+
u > 0 && (l.preventDefault(), se(u - 1));
|
|
2697
2700
|
return;
|
|
2698
2701
|
}
|
|
2699
|
-
if (
|
|
2702
|
+
if (l.key === "PageDown") {
|
|
2700
2703
|
if (u < n - 1) {
|
|
2701
|
-
|
|
2702
|
-
const { visibleStartIndex:
|
|
2703
|
-
|
|
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);
|
|
2704
2707
|
}
|
|
2705
2708
|
return;
|
|
2706
2709
|
}
|
|
2707
|
-
if (
|
|
2708
|
-
|
|
2709
|
-
const { visibleStartIndex:
|
|
2710
|
-
|
|
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);
|
|
2711
2714
|
}
|
|
2712
2715
|
},
|
|
2713
|
-
[
|
|
2714
|
-
),
|
|
2715
|
-
(
|
|
2716
|
-
if (!
|
|
2716
|
+
[V, n, se]
|
|
2717
|
+
), ve = S(
|
|
2718
|
+
(l) => {
|
|
2719
|
+
if (!V)
|
|
2717
2720
|
return;
|
|
2718
|
-
const u =
|
|
2719
|
-
|
|
2721
|
+
const u = It(l, n);
|
|
2722
|
+
et.current = null, ct.current = u, Z?.(u);
|
|
2720
2723
|
},
|
|
2721
|
-
[
|
|
2724
|
+
[V, n, Z]
|
|
2722
2725
|
);
|
|
2723
|
-
|
|
2724
|
-
const
|
|
2726
|
+
q(() => {
|
|
2727
|
+
const l = F.current?.getScrollPosition() ?? 0, u = dt.current, h = oe(u, y.top);
|
|
2725
2728
|
C.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
2726
|
-
renderingStartIndex:
|
|
2727
|
-
renderingEndIndex:
|
|
2728
|
-
visibleStartIndex:
|
|
2729
|
-
visibleEndIndex:
|
|
2729
|
+
renderingStartIndex: ne,
|
|
2730
|
+
renderingEndIndex: ie,
|
|
2731
|
+
visibleStartIndex: de,
|
|
2732
|
+
visibleEndIndex: be,
|
|
2730
2733
|
scrollPositionState: Bt,
|
|
2731
2734
|
paneScrollPosition: u,
|
|
2732
|
-
logicalScrollPosition:
|
|
2733
|
-
contentSize:
|
|
2734
|
-
scrollPaneScrollPosition:
|
|
2735
|
-
})),
|
|
2736
|
-
renderingStartIndex:
|
|
2737
|
-
renderingEndIndex:
|
|
2738
|
-
visibleStartIndex:
|
|
2739
|
-
visibleEndIndex:
|
|
2740
|
-
scrollPosition:
|
|
2741
|
-
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
|
|
2742
2745
|
});
|
|
2743
|
-
}, [
|
|
2744
|
-
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(
|
|
2745
2748
|
"button",
|
|
2746
2749
|
{
|
|
2747
2750
|
type: "button",
|
|
2748
2751
|
className: "aqvs-scroll-to-edge-button",
|
|
2749
|
-
onClick: (
|
|
2750
|
-
|
|
2752
|
+
onClick: (h) => {
|
|
2753
|
+
h.stopPropagation(), st.current = !0, Wt(0), it(!1);
|
|
2751
2754
|
},
|
|
2752
2755
|
children: "Top"
|
|
2753
2756
|
}
|
|
2754
|
-
) }) : /* @__PURE__ */
|
|
2757
|
+
) }) : /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ ot(
|
|
2755
2758
|
"button",
|
|
2756
2759
|
{
|
|
2757
2760
|
type: "button",
|
|
2758
2761
|
className: "aqvs-scroll-to-edge-button",
|
|
2759
|
-
onClick: (
|
|
2760
|
-
|
|
2762
|
+
onClick: (h) => {
|
|
2763
|
+
h.stopPropagation(), st.current = !0, Wt(n - 1), it(!1);
|
|
2761
2764
|
},
|
|
2762
2765
|
children: "Bottom"
|
|
2763
2766
|
}
|
|
2764
|
-
) }) }) : null, [
|
|
2767
|
+
) }) }) : null, [$, Mt, kt, Wt, n]), o = I(0), { visibleItems: g, renderAnchor: M } = Lt(() => {
|
|
2765
2768
|
if (n === 0)
|
|
2766
2769
|
return {
|
|
2767
|
-
visibleItems: /* @__PURE__ */
|
|
2770
|
+
visibleItems: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-text", children: "No items" }) }),
|
|
2768
2771
|
renderAnchor: 0
|
|
2769
2772
|
};
|
|
2770
|
-
const
|
|
2771
|
-
Number.isFinite(
|
|
2772
|
-
const
|
|
2773
|
-
let
|
|
2774
|
-
for (let
|
|
2775
|
-
if (
|
|
2776
|
-
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 });
|
|
2777
2780
|
break;
|
|
2778
2781
|
}
|
|
2779
|
-
const
|
|
2780
|
-
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2783
|
-
/* @__PURE__ */
|
|
2784
|
-
|
|
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,
|
|
2785
2788
|
{
|
|
2786
|
-
index:
|
|
2787
|
-
top:
|
|
2788
|
-
height:
|
|
2789
|
-
item: t(
|
|
2790
|
-
clipItemHeight:
|
|
2791
|
-
enableKeyboardNavigation:
|
|
2792
|
-
onKeyDown:
|
|
2793
|
-
onFocus:
|
|
2794
|
-
registerItemRef:
|
|
2795
|
-
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
|
|
2796
2799
|
},
|
|
2797
|
-
|
|
2800
|
+
Le
|
|
2798
2801
|
)
|
|
2799
|
-
),
|
|
2802
|
+
), Rt += zt, bt += Dt;
|
|
2800
2803
|
}
|
|
2801
|
-
return
|
|
2802
|
-
if (
|
|
2804
|
+
return U.length > 0 && Promise.resolve().then(() => {
|
|
2805
|
+
if (At.current)
|
|
2803
2806
|
return;
|
|
2804
|
-
let
|
|
2805
|
-
for (const
|
|
2806
|
-
if (
|
|
2807
|
-
const
|
|
2808
|
-
|
|
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;
|
|
2809
2812
|
}
|
|
2810
|
-
const
|
|
2811
|
-
if (
|
|
2813
|
+
const Ft = A.updates(U);
|
|
2814
|
+
if (At.current || typeof Ft != "number")
|
|
2812
2815
|
return;
|
|
2813
|
-
|
|
2814
|
-
const
|
|
2815
|
-
if (
|
|
2816
|
-
const
|
|
2817
|
-
zt
|
|
2818
|
-
} else
|
|
2819
|
-
}), { 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 };
|
|
2820
2823
|
}, [
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2824
|
+
x,
|
|
2825
|
+
yt,
|
|
2826
|
+
Et,
|
|
2827
|
+
V,
|
|
2825
2828
|
n,
|
|
2826
|
-
|
|
2829
|
+
A,
|
|
2827
2830
|
t,
|
|
2828
2831
|
e,
|
|
2829
2832
|
r,
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
zt,
|
|
2833
|
-
_t,
|
|
2833
|
+
ve,
|
|
2834
|
+
Ce,
|
|
2834
2835
|
ee,
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
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);
|
|
2841
2844
|
if (C.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
2842
|
-
currentScrollPosition:
|
|
2843
|
-
effectiveScrollPosition:
|
|
2844
|
-
renderingStartIndex:
|
|
2845
|
-
renderingEndIndex:
|
|
2845
|
+
currentScrollPosition: l,
|
|
2846
|
+
effectiveScrollPosition: O,
|
|
2847
|
+
renderingStartIndex: ne,
|
|
2848
|
+
renderingEndIndex: ie,
|
|
2846
2849
|
itemCount: n,
|
|
2847
2850
|
viewportSize: i,
|
|
2848
2851
|
callbackThrottleMs: _,
|
|
2849
|
-
diff:
|
|
2850
|
-
rawEffectiveScrollPosition:
|
|
2852
|
+
diff: h,
|
|
2853
|
+
rawEffectiveScrollPosition: R
|
|
2851
2854
|
})), n === 0)
|
|
2852
|
-
return
|
|
2853
|
-
const
|
|
2855
|
+
return g;
|
|
2856
|
+
const Y = y.top + M - R, U = y.bottom > 0 ? /* @__PURE__ */ ot(
|
|
2854
2857
|
"div",
|
|
2855
2858
|
{
|
|
2856
2859
|
className: "aqvs-bottom-inset",
|
|
2857
2860
|
style: {
|
|
2858
2861
|
// ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
|
|
2859
|
-
top:
|
|
2860
|
-
height:
|
|
2862
|
+
top: A.getTotal() - M,
|
|
2863
|
+
height: y.bottom
|
|
2861
2864
|
}
|
|
2862
2865
|
},
|
|
2863
2866
|
"virtualscroll-bottom-inset"
|
|
2864
2867
|
) : null;
|
|
2865
2868
|
return C.debug("[VirtualScroll] Rendering items", () => ({
|
|
2866
|
-
containerTop:
|
|
2867
|
-
logicalScrollPosition:
|
|
2868
|
-
resolvedInsets:
|
|
2869
|
-
effectiveScrollPosition:
|
|
2870
|
-
})), /* @__PURE__ */
|
|
2871
|
-
|
|
2872
|
-
|
|
2869
|
+
containerTop: Y,
|
|
2870
|
+
logicalScrollPosition: re,
|
|
2871
|
+
resolvedInsets: y,
|
|
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
|
|
2873
2876
|
] });
|
|
2874
2877
|
},
|
|
2875
|
-
[_, n,
|
|
2876
|
-
),
|
|
2878
|
+
[_, n, A, re, M, ie, ne, y, Bt, i, g]
|
|
2879
|
+
), H = Lt(
|
|
2877
2880
|
() => ({
|
|
2878
|
-
renderingStartIndex:
|
|
2879
|
-
renderingEndIndex:
|
|
2880
|
-
visibleStartIndex:
|
|
2881
|
-
visibleEndIndex:
|
|
2882
|
-
scrollPosition:
|
|
2883
|
-
totalHeight:
|
|
2881
|
+
renderingStartIndex: jt.renderingStartIndex,
|
|
2882
|
+
renderingEndIndex: jt.renderingEndIndex,
|
|
2883
|
+
visibleStartIndex: jt.visibleStartIndex,
|
|
2884
|
+
visibleEndIndex: jt.visibleEndIndex,
|
|
2885
|
+
scrollPosition: re,
|
|
2886
|
+
totalHeight: A.getTotal()
|
|
2884
2887
|
// contentSize (State) ではなく最新値を反映
|
|
2885
2888
|
}),
|
|
2886
2889
|
// contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
|
|
2887
2890
|
// (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
|
|
2888
|
-
[
|
|
2891
|
+
[jt, re, A, Et]
|
|
2889
2892
|
);
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
}, [
|
|
2893
|
-
|
|
2893
|
+
q(() => {
|
|
2894
|
+
Ct.current = H;
|
|
2895
|
+
}, [H]), qe(
|
|
2896
|
+
Pt,
|
|
2894
2897
|
() => ({
|
|
2895
|
-
getScrollPosition: () =>
|
|
2896
|
-
getContentSize: () =>
|
|
2897
|
-
getViewportSize: () =>
|
|
2898
|
-
scrollTo:
|
|
2899
|
-
scrollToIndex:
|
|
2900
|
-
getFenwickTreeTotalHeight: () =>
|
|
2901
|
-
getFenwickSize: () =>
|
|
2902
|
-
focusItemAtIndex:
|
|
2903
|
-
getRange: () =>
|
|
2904
|
-
updateItemSize:
|
|
2898
|
+
getScrollPosition: () => F.current?.getScrollPosition() ?? -1,
|
|
2899
|
+
getContentSize: () => F.current?.getContentSize() ?? -1,
|
|
2900
|
+
getViewportSize: () => F.current?.getViewportSize() ?? -1,
|
|
2901
|
+
scrollTo: Re,
|
|
2902
|
+
scrollToIndex: Wt,
|
|
2903
|
+
getFenwickTreeTotalHeight: () => A.getTotal(),
|
|
2904
|
+
getFenwickSize: () => A.getSize(),
|
|
2905
|
+
focusItemAtIndex: se,
|
|
2906
|
+
getRange: () => Ct.current,
|
|
2907
|
+
updateItemSize: we
|
|
2905
2908
|
}),
|
|
2906
|
-
[
|
|
2909
|
+
[Re, Wt, A, se, we]
|
|
2907
2910
|
);
|
|
2908
|
-
const
|
|
2909
|
-
return /* @__PURE__ */
|
|
2910
|
-
|
|
2911
|
+
const St = A.getTotal() + y.top + y.bottom;
|
|
2912
|
+
return /* @__PURE__ */ ot(
|
|
2913
|
+
vr,
|
|
2911
2914
|
{
|
|
2912
|
-
ref:
|
|
2913
|
-
contentSize:
|
|
2915
|
+
ref: F,
|
|
2916
|
+
contentSize: St,
|
|
2914
2917
|
viewportSize: i,
|
|
2915
|
-
className:
|
|
2918
|
+
className: a,
|
|
2916
2919
|
testId: c,
|
|
2917
|
-
onScroll:
|
|
2918
|
-
background:
|
|
2919
|
-
tapScrollCircleOptions:
|
|
2920
|
-
inertiaOptions:
|
|
2920
|
+
onScroll: De,
|
|
2921
|
+
background: v,
|
|
2922
|
+
tapScrollCircleOptions: lt,
|
|
2923
|
+
inertiaOptions: Yt,
|
|
2921
2924
|
itemCount: n,
|
|
2922
|
-
scrollBarWidth:
|
|
2923
|
-
enableThumbDrag:
|
|
2924
|
-
enableTrackClick:
|
|
2925
|
-
enableArrowButtons:
|
|
2926
|
-
enablePointerDrag:
|
|
2927
|
-
pointerDragInputs:
|
|
2925
|
+
scrollBarWidth: D,
|
|
2926
|
+
enableThumbDrag: k,
|
|
2927
|
+
enableTrackClick: P,
|
|
2928
|
+
enableArrowButtons: X,
|
|
2929
|
+
enablePointerDrag: K,
|
|
2930
|
+
pointerDragInputs: T,
|
|
2928
2931
|
renderThumbOverlay: N,
|
|
2929
|
-
wheelSpeedMultiplier:
|
|
2930
|
-
onWheelHorizontal:
|
|
2931
|
-
contentInsets:
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2932
|
+
wheelSpeedMultiplier: Tt,
|
|
2933
|
+
onWheelHorizontal: nt,
|
|
2934
|
+
contentInsets: y,
|
|
2935
|
+
contentProps: pt,
|
|
2936
|
+
visibleStartIndex: de,
|
|
2937
|
+
visibleEndIndex: be,
|
|
2938
|
+
renderOverlay: Ee,
|
|
2939
|
+
initialScrollPosition: j.position,
|
|
2940
|
+
children: L
|
|
2937
2941
|
}
|
|
2938
2942
|
);
|
|
2939
|
-
},
|
|
2943
|
+
}, zr = Be(Dr);
|
|
2940
2944
|
export {
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
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
|
|
2953
2957
|
};
|