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