@aiquants/virtualscroll 3.9.0 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/VirtualScroll.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +298 -297
- package/package.json +1 -1
- package/src/VirtualScroll.tsx +13 -4
package/dist/index.js
CHANGED
|
@@ -381,7 +381,7 @@ const Cn = (t) => typeof t.setPointerCapture == "function" && typeof t.releasePo
|
|
|
381
381
|
const P = g.distance, W = P === 0 ? 0 : Y * g.offsetX / P, ce = P === 0 ? 0 : Y * g.offsetY / P;
|
|
382
382
|
te = `translate(${W}px, ${ce}px)`;
|
|
383
383
|
} else u === "x" ? te = `translateX(${Y}px)` : te = `translateY(${Y}px)`;
|
|
384
|
-
const
|
|
384
|
+
const J = o ?? oi, xe = {
|
|
385
385
|
dragState: g,
|
|
386
386
|
normalizedDistance: G,
|
|
387
387
|
sizeScale: ie,
|
|
@@ -407,7 +407,7 @@ const Cn = (t) => typeof t.setPointerCapture == "function" && typeof t.releasePo
|
|
|
407
407
|
onPointerCancel: O,
|
|
408
408
|
onLostPointerCapture: D,
|
|
409
409
|
role: "presentation",
|
|
410
|
-
children:
|
|
410
|
+
children: J(xe)
|
|
411
411
|
}
|
|
412
412
|
);
|
|
413
413
|
})
|
|
@@ -546,7 +546,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
546
546
|
startClientY: 0,
|
|
547
547
|
scale: 1,
|
|
548
548
|
captureTarget: null
|
|
549
|
-
}),
|
|
549
|
+
}), J = f({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), xe = f(r), rt = f(n), P = f(hn), W = f(null), ce = f(null), Ye = f(null), le = f(0), Fe = f(0), bt = Ie(() => en(A, H), [H, A]), de = Ie(() => mi(d), [d]), je = Ie(() => An(C, j), [C, j]), ye = d ? [je.scrollLeft, je.scrollRight] : [je.scrollUp, je.scrollDown], {
|
|
550
550
|
enabled: nt,
|
|
551
551
|
size: ct,
|
|
552
552
|
offsetX: ke,
|
|
@@ -570,7 +570,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
570
570
|
effectiveTrackLength: 0,
|
|
571
571
|
onScroll: n,
|
|
572
572
|
scrollPosition: r
|
|
573
|
-
}), { mainSizeKey: Ke, crossSizeKey: X, thumbTranslateFunction: Be, selectDelta: N, getPointerCoordinate: Ee, arrowIcons: Mt, directionClass: L, orientation:
|
|
573
|
+
}), { mainSizeKey: Ke, crossSizeKey: X, thumbTranslateFunction: Be, selectDelta: N, getPointerCoordinate: Ee, arrowIcons: Mt, directionClass: L, orientation: Tt } = de, mt = Math.max(We, 1), Lt = e / t, m = Math.max(e - M * 2, 0), ae = Lt * m, fe = Math.min(Math.max(fn, ae || 0), m || fn), Z = Math.max(t - e, 0), Q = Math.max(m - fe, 0), we = Z <= 0 || Q <= 0 ? 0 : ne(r / Z * Q, 0, Q), He = we + fe / 2, { ratio: $e, attach: be } = Nn("[ScrollBar] the thumb"), Ue = $e === null ? we : En(we, $e, "none"), Ge = t > e || ee, pt = Ge && o;
|
|
574
574
|
tt(() => {
|
|
575
575
|
re.current = {
|
|
576
576
|
viewportSize: e,
|
|
@@ -581,7 +581,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
581
581
|
tapCircleMinSpeedMultiplier: zt,
|
|
582
582
|
tapCircleMaxSpeedCurve: oe,
|
|
583
583
|
tapScrollCircleOptions: A,
|
|
584
|
-
effectiveTrackLength:
|
|
584
|
+
effectiveTrackLength: Q,
|
|
585
585
|
onScroll: n,
|
|
586
586
|
scrollPosition: r
|
|
587
587
|
};
|
|
@@ -610,8 +610,8 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
610
610
|
}
|
|
611
611
|
if (l === 0)
|
|
612
612
|
return { nextPosition: z, actualDelta: 0, reachedBoundary: !1 };
|
|
613
|
-
const qe = Ze((Ft) => ne(Ft + l, 0, R.maxScrollPosition), z), Ne = qe - z, Rt = l < 0 && z + l <= 0, xt = l > 0 && z + l >= R.maxScrollPosition,
|
|
614
|
-
return { nextPosition: qe, actualDelta: Ne, reachedBoundary:
|
|
613
|
+
const qe = Ze((Ft) => ne(Ft + l, 0, R.maxScrollPosition), z), Ne = qe - z, Rt = l < 0 && z + l <= 0, xt = l > 0 && z + l >= R.maxScrollPosition, hr = l < 0 && (qe <= 0 || Rt && Ne === 0) || l > 0 && (qe >= R.maxScrollPosition || xt && Ne === 0);
|
|
614
|
+
return { nextPosition: qe, actualDelta: Ne, reachedBoundary: hr };
|
|
615
615
|
},
|
|
616
616
|
[Ze]
|
|
617
617
|
), ze = x(
|
|
@@ -704,10 +704,10 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
704
704
|
};
|
|
705
705
|
}, [Re, nt]);
|
|
706
706
|
const ot = (l) => {
|
|
707
|
-
if (!Ge ||
|
|
707
|
+
if (!Ge || Q <= 0 || Z <= 0)
|
|
708
708
|
return 0;
|
|
709
|
-
const R = ne(l, 0,
|
|
710
|
-
return ne(R /
|
|
709
|
+
const R = ne(l, 0, Q);
|
|
710
|
+
return ne(R / Q * Z, 0, Z);
|
|
711
711
|
}, Qe = x((l) => {
|
|
712
712
|
const { scrollBarVisible: R, effectiveTrackLength: z, maxScrollPosition: ge } = re.current;
|
|
713
713
|
if (V.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: l, trackLen: z, maxScroll: ge })), z <= 0 || ge <= 0)
|
|
@@ -757,7 +757,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
757
757
|
enableArrowButtons: o,
|
|
758
758
|
resetTapScroll: Re,
|
|
759
759
|
scrollByStep: Ut
|
|
760
|
-
}),
|
|
760
|
+
}), fr = (l) => {
|
|
761
761
|
if (!Ge)
|
|
762
762
|
return;
|
|
763
763
|
if (!i) {
|
|
@@ -788,7 +788,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
788
788
|
const R = l.currentTarget, z = R.getBoundingClientRect(), ge = Ee(l), qe = Xe(R), Ne = (ge - (d ? z.left : z.top)) / qe;
|
|
789
789
|
Re();
|
|
790
790
|
const Rt = Ne - fe / 2, xt = ot(Rt);
|
|
791
|
-
Ze(xt), Nr(R, l.pointerId),
|
|
791
|
+
Ze(xt), Nr(R, l.pointerId), J.current = {
|
|
792
792
|
pointerId: l.pointerId,
|
|
793
793
|
startThumbPosition: Rt,
|
|
794
794
|
startClientX: l.clientX,
|
|
@@ -796,9 +796,9 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
796
796
|
scale: qe
|
|
797
797
|
}, l.preventDefault(), l.stopPropagation();
|
|
798
798
|
}, dt = () => {
|
|
799
|
-
|
|
799
|
+
J.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
|
|
800
800
|
}, _t = (l) => {
|
|
801
|
-
const R =
|
|
801
|
+
const R = J.current;
|
|
802
802
|
if (R.pointerId !== l.pointerId)
|
|
803
803
|
return;
|
|
804
804
|
if (l.pointerType === "mouse" && l.buttons === 0) {
|
|
@@ -808,11 +808,11 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
808
808
|
const z = l.clientX - R.startClientX, ge = l.clientY - R.startClientY, qe = N(z, ge) / (R.scale || 1), Ne = ot(R.startThumbPosition + qe);
|
|
809
809
|
Ze(Ne), l.cancelable && l.preventDefault();
|
|
810
810
|
}, Gt = (l) => {
|
|
811
|
-
|
|
811
|
+
J.current.pointerId === l.pointerId && (ar(l.currentTarget, l.pointerId), dt(), l.preventDefault(), l.stopPropagation());
|
|
812
812
|
}, jt = (l) => {
|
|
813
|
-
|
|
813
|
+
J.current.pointerId === l.pointerId && (ar(l.currentTarget, l.pointerId), dt());
|
|
814
814
|
}, Kt = (l) => {
|
|
815
|
-
l.target === l.currentTarget &&
|
|
815
|
+
l.target === l.currentTarget && J.current.pointerId === l.pointerId && dt();
|
|
816
816
|
}, rr = Ie(() => ne((ie ? 1 : 0.8) * se, 0, 1), [ie, se]), Yt = Ie(() => {
|
|
817
817
|
const R = `calc(50% - ${ct / 2}px + ${lt}px)`;
|
|
818
818
|
return {
|
|
@@ -841,7 +841,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
841
841
|
},
|
|
842
842
|
ge
|
|
843
843
|
), Qt = $ && Ge ? {
|
|
844
|
-
orientation:
|
|
844
|
+
orientation: Tt,
|
|
845
845
|
scrollPosition: r,
|
|
846
846
|
maxScrollPosition: Z,
|
|
847
847
|
contentSize: t,
|
|
@@ -849,7 +849,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
849
849
|
thumbSize: fe,
|
|
850
850
|
thumbPosition: we,
|
|
851
851
|
thumbCenter: He,
|
|
852
|
-
trackSize:
|
|
852
|
+
trackSize: m,
|
|
853
853
|
isDragging: ee,
|
|
854
854
|
isTapScrollActive: ie,
|
|
855
855
|
visibleStartIndex: ue,
|
|
@@ -918,7 +918,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
918
918
|
transform: `${Be}(${Ue}px)`
|
|
919
919
|
},
|
|
920
920
|
"data-visible": Ge || ee ? "true" : "false",
|
|
921
|
-
onPointerDown:
|
|
921
|
+
onPointerDown: fr,
|
|
922
922
|
role: "slider",
|
|
923
923
|
"aria-orientation": d ? "horizontal" : "vertical",
|
|
924
924
|
"aria-valuenow": r,
|
|
@@ -1051,7 +1051,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1051
1051
|
visibleEndIndex: G,
|
|
1052
1052
|
renderOverlay: Y,
|
|
1053
1053
|
initialScrollPosition: te = 0,
|
|
1054
|
-
contentProps:
|
|
1054
|
+
contentProps: J,
|
|
1055
1055
|
locale: xe,
|
|
1056
1056
|
labels: rt
|
|
1057
1057
|
}, P) => {
|
|
@@ -1059,21 +1059,21 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1059
1059
|
tt(() => {
|
|
1060
1060
|
if (!le)
|
|
1061
1061
|
return;
|
|
1062
|
-
const
|
|
1063
|
-
if (!
|
|
1062
|
+
const m = Ye.current;
|
|
1063
|
+
if (!m)
|
|
1064
1064
|
return;
|
|
1065
1065
|
const ae = () => {
|
|
1066
|
-
const Z =
|
|
1066
|
+
const Z = m.offsetHeight;
|
|
1067
1067
|
if (Z > 0) {
|
|
1068
|
-
bt((
|
|
1068
|
+
bt((Q) => Q === Z ? Q : Z);
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
|
-
|
|
1071
|
+
m.offsetParent !== null && e > 0 && je.current !== "zero" && (je.current = "zero", V.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
|
|
1072
1072
|
};
|
|
1073
1073
|
if (ae(), typeof ResizeObserver != "function")
|
|
1074
1074
|
return;
|
|
1075
1075
|
const fe = new ResizeObserver(ae);
|
|
1076
|
-
return fe.observe(
|
|
1076
|
+
return fe.observe(m), () => {
|
|
1077
1077
|
fe.disconnect();
|
|
1078
1078
|
};
|
|
1079
1079
|
}, [e, le]), tt(() => {
|
|
@@ -1081,22 +1081,22 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1081
1081
|
}, [le, Fe, n]), tt(() => {
|
|
1082
1082
|
if (le)
|
|
1083
1083
|
return;
|
|
1084
|
-
const
|
|
1085
|
-
if (!
|
|
1084
|
+
const m = ce.current;
|
|
1085
|
+
if (!m)
|
|
1086
1086
|
return;
|
|
1087
1087
|
const ae = () => {
|
|
1088
|
-
const Z =
|
|
1088
|
+
const Z = m.clientHeight;
|
|
1089
1089
|
if (Z <= 0 || Math.abs(Z - de) <= 1)
|
|
1090
1090
|
return;
|
|
1091
|
-
const
|
|
1092
|
-
je.current !==
|
|
1091
|
+
const Q = `${de}/${Z}`;
|
|
1092
|
+
je.current !== Q && (je.current = Q, V.warn(
|
|
1093
1093
|
`[ScrollPane] viewportSize=${de} but the host band is ${Z}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
|
|
1094
1094
|
));
|
|
1095
1095
|
};
|
|
1096
1096
|
if (ae(), typeof ResizeObserver != "function")
|
|
1097
1097
|
return;
|
|
1098
1098
|
const fe = new ResizeObserver(ae);
|
|
1099
|
-
return fe.observe(
|
|
1099
|
+
return fe.observe(m), () => {
|
|
1100
1100
|
fe.disconnect();
|
|
1101
1101
|
};
|
|
1102
1102
|
}, [le, de]);
|
|
@@ -1138,16 +1138,16 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1138
1138
|
contentInsets: lt
|
|
1139
1139
|
}));
|
|
1140
1140
|
const ut = f({ contentSize: e, viewportSize: de }), We = Ie(() => e > de, [e, de]), me = x(
|
|
1141
|
-
(
|
|
1141
|
+
(m, ae) => {
|
|
1142
1142
|
let fe = ae ?? ut.current;
|
|
1143
1143
|
ae && !(Number.isFinite(ae.contentSize) && Number.isFinite(ae.viewportSize)) && (V.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: ae }), fe = ut.current);
|
|
1144
|
-
const { contentSize: Z, viewportSize:
|
|
1145
|
-
if (V.debug("[ScrollPane] scrollTo called", () => ({ newPosition:
|
|
1144
|
+
const { contentSize: Z, viewportSize: Q } = fe, we = Z > Q, He = W.current;
|
|
1145
|
+
if (V.debug("[ScrollPane] scrollTo called", () => ({ newPosition: m, contentSize: Z, viewportSize: Q, currentIsScrollable: we, prevPosition: He })), !we)
|
|
1146
1146
|
return W.current !== 0 && (W.current = 0, M?.(0, He)), W.current;
|
|
1147
|
-
const $e = typeof
|
|
1147
|
+
const $e = typeof m == "function" ? m(W.current) : m;
|
|
1148
1148
|
if (!Number.isFinite($e))
|
|
1149
1149
|
return V.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: $e }), W.current;
|
|
1150
|
-
const be = Math.max(Z -
|
|
1150
|
+
const be = Math.max(Z - Q, 0), Ue = ne($e, 0, be);
|
|
1151
1151
|
return W.current !== Ue && (W.current = Ue, M?.(Ue, He)), W.current;
|
|
1152
1152
|
},
|
|
1153
1153
|
[M]
|
|
@@ -1156,8 +1156,8 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1156
1156
|
zt.current = me;
|
|
1157
1157
|
}, [me]);
|
|
1158
1158
|
const se = x(() => {
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1159
|
+
const m = ct.current;
|
|
1160
|
+
m.generation += 1, m.frame !== null && cancelAnimationFrame(m.frame), m.frame = null, m.velocity = 0, m.lastTimestamp = null;
|
|
1161
1161
|
}, []), Me = f(se);
|
|
1162
1162
|
k(() => {
|
|
1163
1163
|
Me.current = se;
|
|
@@ -1165,11 +1165,11 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1165
1165
|
Me.current();
|
|
1166
1166
|
}, []);
|
|
1167
1167
|
const oe = x(
|
|
1168
|
-
(
|
|
1168
|
+
(m) => {
|
|
1169
1169
|
if (!We)
|
|
1170
1170
|
return;
|
|
1171
|
-
const { maxVelocity: ae, minVelocity: fe, deceleration: Z, startVelocityThreshold:
|
|
1172
|
-
if (Math.abs(we) <
|
|
1171
|
+
const { maxVelocity: ae, minVelocity: fe, deceleration: Z, startVelocityThreshold: Q } = ke, we = ne(m, -ae, ae);
|
|
1172
|
+
if (Math.abs(we) < Q)
|
|
1173
1173
|
return;
|
|
1174
1174
|
se(), ct.current.velocity = we, ct.current.lastTimestamp = null;
|
|
1175
1175
|
const He = ct.current.generation, $e = (be) => {
|
|
@@ -1210,17 +1210,17 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1210
1210
|
}, [oe]), tt(() => {
|
|
1211
1211
|
ut.current = { contentSize: e, viewportSize: de };
|
|
1212
1212
|
}, [e, de]), tt(() => {
|
|
1213
|
-
const
|
|
1214
|
-
if (!
|
|
1213
|
+
const m = Ye.current;
|
|
1214
|
+
if (!m) return;
|
|
1215
1215
|
const ae = () => {
|
|
1216
|
-
|
|
1216
|
+
m.scrollTop !== 0 && (V.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: m.scrollTop })), m.scrollTop = 0), m.scrollLeft !== 0 && (m.scrollLeft = 0);
|
|
1217
1217
|
};
|
|
1218
|
-
return
|
|
1218
|
+
return m.addEventListener("scroll", ae), () => m.removeEventListener("scroll", ae);
|
|
1219
1219
|
}, []), tt(() => {
|
|
1220
1220
|
if (We) {
|
|
1221
1221
|
V.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: de, scrollPosition: W.current }));
|
|
1222
|
-
const
|
|
1223
|
-
W.current >
|
|
1222
|
+
const m = ne(e - de, 0, e);
|
|
1223
|
+
W.current > m && me(m);
|
|
1224
1224
|
} else
|
|
1225
1225
|
me(0);
|
|
1226
1226
|
}, [We, me, e, de]);
|
|
@@ -1229,39 +1229,39 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1229
1229
|
Ke.current = { isScrollable: We, viewportSize: de, wheelSpeedMultiplier: j, overscrollBehavior: ee };
|
|
1230
1230
|
}, [We, de, j, ee]);
|
|
1231
1231
|
const X = x(
|
|
1232
|
-
(
|
|
1233
|
-
if (Mi(
|
|
1232
|
+
(m) => {
|
|
1233
|
+
if (Mi(m))
|
|
1234
1234
|
return !1;
|
|
1235
|
-
const { isScrollable: ae, viewportSize: fe, wheelSpeedMultiplier: Z, overscrollBehavior:
|
|
1235
|
+
const { isScrollable: ae, viewportSize: fe, wheelSpeedMultiplier: Z, overscrollBehavior: Q } = Ke.current, we = Si(m, fe);
|
|
1236
1236
|
if (we.isZoomGesture)
|
|
1237
1237
|
return !1;
|
|
1238
1238
|
if (we.isHorizontalDominant)
|
|
1239
|
-
return ye.current ? (pn(
|
|
1239
|
+
return ye.current ? (pn(m), m.preventDefault(), se(), ye.current(we.horizontalDelta), !0) : !1;
|
|
1240
1240
|
if (!ae || we.verticalDelta === 0)
|
|
1241
1241
|
return !1;
|
|
1242
1242
|
let He = we.verticalDelta;
|
|
1243
|
-
if (Z !== 1 && (He *= Z),
|
|
1243
|
+
if (Z !== 1 && (He *= Z), Q !== "contain") {
|
|
1244
1244
|
const $e = W.current, be = Math.max(ut.current.contentSize - fe, 0);
|
|
1245
1245
|
if (He > 0 && $e >= be || He < 0 && $e <= 0)
|
|
1246
1246
|
return !1;
|
|
1247
1247
|
}
|
|
1248
|
-
return pn(
|
|
1248
|
+
return pn(m), m.preventDefault(), se(), V.debug("[ScrollPane] wheel event", () => ({ deltaY: He, scrollPosition: W.current, wheelSpeedMultiplier: Z, deltaMode: m.deltaMode, scrollTop: Ye.current?.scrollTop })), me(($e) => $e + He), !0;
|
|
1249
1249
|
},
|
|
1250
1250
|
[me, se]
|
|
1251
1251
|
);
|
|
1252
1252
|
k(() => {
|
|
1253
|
-
const
|
|
1253
|
+
const m = (Z) => {
|
|
1254
1254
|
X(Z);
|
|
1255
1255
|
}, ae = () => {
|
|
1256
1256
|
se();
|
|
1257
1257
|
}, fe = ce.current;
|
|
1258
|
-
return fe && (fe.addEventListener("wheel",
|
|
1259
|
-
fe && (fe.removeEventListener("wheel",
|
|
1258
|
+
return fe && (fe.addEventListener("wheel", m, { passive: !1 }), fe.addEventListener("pointerdown", ae, { capture: !0, passive: !0 })), () => {
|
|
1259
|
+
fe && (fe.removeEventListener("wheel", m), fe.removeEventListener("pointerdown", ae, { capture: !0 }));
|
|
1260
1260
|
};
|
|
1261
1261
|
}, [X, se]), Xr(
|
|
1262
1262
|
P,
|
|
1263
1263
|
() => ({
|
|
1264
|
-
scrollTo: (
|
|
1264
|
+
scrollTo: (m, ae) => (se(), me(m, ae)),
|
|
1265
1265
|
getScrollPosition: () => W.current,
|
|
1266
1266
|
getContentSize: () => e,
|
|
1267
1267
|
getViewportSize: () => de,
|
|
@@ -1269,7 +1269,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1269
1269
|
}),
|
|
1270
1270
|
[me, e, de, se, X]
|
|
1271
1271
|
);
|
|
1272
|
-
const Be = Gn(), N =
|
|
1272
|
+
const Be = Gn(), N = J?.id ?? Be, Ee = f({
|
|
1273
1273
|
pointerType: "",
|
|
1274
1274
|
pointerId: null,
|
|
1275
1275
|
startClientY: 0,
|
|
@@ -1288,29 +1288,29 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1288
1288
|
}, [g]), k(() => {
|
|
1289
1289
|
L.current = v;
|
|
1290
1290
|
}, [v]);
|
|
1291
|
-
const
|
|
1291
|
+
const Tt = f(We);
|
|
1292
1292
|
k(() => {
|
|
1293
|
-
|
|
1293
|
+
Tt.current = We;
|
|
1294
1294
|
}, [We]);
|
|
1295
1295
|
const mt = f(ke);
|
|
1296
1296
|
k(() => {
|
|
1297
1297
|
mt.current = ke;
|
|
1298
1298
|
}, [ke]), k(() => {
|
|
1299
|
-
const
|
|
1300
|
-
if (g && We && (
|
|
1299
|
+
const m = Ee.current;
|
|
1300
|
+
if (g && We && (m.pointerId === null || Ur(m.pointerType, v)) || m.pointerId === null)
|
|
1301
1301
|
return;
|
|
1302
1302
|
const ae = Ye.current;
|
|
1303
|
-
|
|
1304
|
-
const fe =
|
|
1305
|
-
|
|
1303
|
+
m.clickResetTimer !== null && (window.clearTimeout(m.clickResetTimer), m.clickResetTimer = null);
|
|
1304
|
+
const fe = m.isDragging && m.shouldCancelNextClick, Z = m.pointerId;
|
|
1305
|
+
m.pointerId = null, m.pointerType = "", m.startClientY = 0, m.startScroll = 0, m.isDragging = !1, m.shouldCancelNextClick = fe, m.velocitySamples = [], m.scale = 1, ae !== null && ar(ae, Z);
|
|
1306
1306
|
}, [g, v, We]), k(() => {
|
|
1307
|
-
const
|
|
1308
|
-
if (!
|
|
1307
|
+
const m = Ye.current;
|
|
1308
|
+
if (!m)
|
|
1309
1309
|
return;
|
|
1310
1310
|
const ae = 6, fe = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), Z = () => {
|
|
1311
1311
|
const S = Ee.current;
|
|
1312
1312
|
S.pointerId = null, S.pointerType = "", S.startClientY = 0, S.startScroll = 0, S.isDragging = !1, S.velocitySamples = [], S.scale = 1;
|
|
1313
|
-
},
|
|
1313
|
+
}, Q = () => {
|
|
1314
1314
|
const S = Ee.current;
|
|
1315
1315
|
S.clickResetTimer !== null && (window.clearTimeout(S.clickResetTimer), S.clickResetTimer = null);
|
|
1316
1316
|
}, we = (S) => {
|
|
@@ -1323,10 +1323,10 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1323
1323
|
E.shouldCancelNextClick && (S.preventDefault(), S.stopPropagation(), E.shouldCancelNextClick = !1);
|
|
1324
1324
|
}, be = (S) => {
|
|
1325
1325
|
const E = Ee.current;
|
|
1326
|
-
E.isDragging || (E.isDragging = !0, E.shouldCancelNextClick = !0, Dn(
|
|
1327
|
-
}, Ue = (S) => S.isTrusted || S.target ===
|
|
1326
|
+
E.isDragging || (E.isDragging = !0, E.shouldCancelNextClick = !0, Dn(m, S.pointerId) || Nr(m, S.pointerId), we(S.clientY));
|
|
1327
|
+
}, Ue = (S) => S.isTrusted || S.target === m, Ge = (S) => {
|
|
1328
1328
|
const E = Ee.current;
|
|
1329
|
-
ar(
|
|
1329
|
+
ar(m, S), E.shouldCancelNextClick = !1, Q(), Z();
|
|
1330
1330
|
}, pt = (S) => {
|
|
1331
1331
|
const E = Ee.current;
|
|
1332
1332
|
if (E.pointerId !== S.pointerId)
|
|
@@ -1335,7 +1335,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1335
1335
|
Ge(S.pointerId);
|
|
1336
1336
|
return;
|
|
1337
1337
|
}
|
|
1338
|
-
if (!(Mt.current &&
|
|
1338
|
+
if (!(Mt.current && Tt.current) || !Ur(S.pointerType, L.current))
|
|
1339
1339
|
return;
|
|
1340
1340
|
if (!E.isDragging) {
|
|
1341
1341
|
const Ae = Math.abs(S.clientY - E.startClientY), Te = nt.current ? Math.abs(S.clientX - E.startClientX) : 0;
|
|
@@ -1353,7 +1353,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1353
1353
|
S.cancelable && S.preventDefault();
|
|
1354
1354
|
}, gt = () => {
|
|
1355
1355
|
const S = Ee.current;
|
|
1356
|
-
return S.pointerId !== null || !S.shouldCancelNextClick ? !1 : (
|
|
1356
|
+
return S.pointerId !== null || !S.shouldCancelNextClick ? !1 : (Q(), S.clickResetTimer = window.setTimeout(() => {
|
|
1357
1357
|
const E = Ee.current;
|
|
1358
1358
|
E.shouldCancelNextClick = !1, E.clickResetTimer = null;
|
|
1359
1359
|
}, 0), !0);
|
|
@@ -1372,23 +1372,23 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1372
1372
|
ot = -(Nt / Ut) / (E.scale || 1);
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
|
-
|
|
1375
|
+
Q(), E.shouldCancelNextClick && (E.clickResetTimer = window.setTimeout(() => {
|
|
1376
1376
|
const Xe = Ee.current;
|
|
1377
1377
|
Xe.shouldCancelNextClick = !1, Xe.clickResetTimer = null;
|
|
1378
1378
|
}, 0));
|
|
1379
1379
|
const Qe = mt.current.startVelocityThreshold;
|
|
1380
|
-
Z(), ar(
|
|
1380
|
+
Z(), ar(m, S.pointerId), Math.abs(ot) >= Qe && re.current?.(ot);
|
|
1381
1381
|
}, Ot = (S) => {
|
|
1382
1382
|
if (Ee.current.pointerId !== null) {
|
|
1383
1383
|
if (!S.isPrimary || S.pointerType !== Ee.current.pointerType)
|
|
1384
1384
|
return;
|
|
1385
1385
|
Ge(Ee.current.pointerId);
|
|
1386
1386
|
}
|
|
1387
|
-
if (Ee.current.shouldCancelNextClick && (
|
|
1387
|
+
if (Ee.current.shouldCancelNextClick && (Q(), Ee.current.shouldCancelNextClick = !1), !(Mt.current && Tt.current) || !Ur(S.pointerType, L.current) || S.button !== 0 && S.pointerType === "mouse" || S.ctrlKey || S.metaKey || S.altKey || He(S.target))
|
|
1388
1388
|
return;
|
|
1389
1389
|
window.dispatchEvent(new CustomEvent(Vr, { detail: { paneId: Be } })), Me.current?.();
|
|
1390
1390
|
const E = Ee.current;
|
|
1391
|
-
|
|
1391
|
+
Q(), E.pointerId = S.pointerId, E.pointerType = S.pointerType, E.startClientY = S.clientY, E.startClientX = S.clientX, E.lastPanClientX = S.clientX, E.startScroll = W.current, E.scale = Jr(m, "y"), E.scaleX = nt.current ? Jr(m, "x") : 1, E.isDragging = !1, E.shouldCancelNextClick = !1, E.velocitySamples = [];
|
|
1392
1392
|
}, ze = (S) => {
|
|
1393
1393
|
if (Ee.current.pointerId !== S.pointerId) {
|
|
1394
1394
|
gt();
|
|
@@ -1399,21 +1399,21 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1399
1399
|
["click", $e, !0],
|
|
1400
1400
|
["pointerdown", Ot, { passive: !1 }],
|
|
1401
1401
|
["lostpointercapture", (S) => {
|
|
1402
|
-
S.target !==
|
|
1402
|
+
S.target !== m || Ee.current.pointerId !== S.pointerId || Ge(S.pointerId);
|
|
1403
1403
|
}, void 0]
|
|
1404
1404
|
], Se = [
|
|
1405
1405
|
["pointermove", pt, { passive: !1 }],
|
|
1406
1406
|
["pointerup", Ze, void 0],
|
|
1407
1407
|
["pointercancel", ze, void 0]
|
|
1408
1408
|
];
|
|
1409
|
-
return Fr(
|
|
1410
|
-
Fr(
|
|
1409
|
+
return Fr(m, Re, "add"), Fr(window, Se, "add"), () => {
|
|
1410
|
+
Fr(m, Re, "remove"), Fr(window, Se, "remove");
|
|
1411
1411
|
const S = Ee.current;
|
|
1412
|
-
S.pointerId !== null && ar(
|
|
1412
|
+
S.pointerId !== null && ar(m, S.pointerId), Q(), Z();
|
|
1413
1413
|
};
|
|
1414
1414
|
}, [Be]);
|
|
1415
1415
|
const Lt = x(
|
|
1416
|
-
(
|
|
1416
|
+
(m) => (se(), me(m)),
|
|
1417
1417
|
[me, se]
|
|
1418
1418
|
);
|
|
1419
1419
|
return /* @__PURE__ */ Bt("div", { ref: ce, "data-testid": w, "data-self-measured": le ? "true" : void 0, className: Ct("aqvs-scroll-pane", y), style: A, children: [
|
|
@@ -1444,9 +1444,9 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1444
1444
|
// 同一条件で揃えてあるため状態としても一貫している。
|
|
1445
1445
|
// 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
|
|
1446
1446
|
// (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
|
|
1447
|
-
...g && We && v.some((
|
|
1447
|
+
...g && We && v.some((m) => m === "touch" || m === "pen") ? { touchAction: "none" } : {}
|
|
1448
1448
|
},
|
|
1449
|
-
...
|
|
1449
|
+
...J,
|
|
1450
1450
|
id: N,
|
|
1451
1451
|
children: [
|
|
1452
1452
|
H,
|
|
@@ -1534,7 +1534,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
)
|
|
1536
1536
|
] });
|
|
1537
|
-
},
|
|
1537
|
+
}, vr = 100, Ri = (t) => {
|
|
1538
1538
|
if (!Number.isFinite(t))
|
|
1539
1539
|
return 0n;
|
|
1540
1540
|
const e = Math.trunc(t);
|
|
@@ -1543,7 +1543,7 @@ const ne = (t, e, r) => Math.max(e, Math.min(r, t)), Jr = (t, e) => {
|
|
|
1543
1543
|
if (!Number.isFinite(t))
|
|
1544
1544
|
throw new Error(`valueFn returned a non-finite value at index ${e}: ${t}`);
|
|
1545
1545
|
return t;
|
|
1546
|
-
},
|
|
1546
|
+
}, wr = (t) => {
|
|
1547
1547
|
if (t <= 0 || !Number.isFinite(t))
|
|
1548
1548
|
return 0;
|
|
1549
1549
|
const e = Math.trunc(t);
|
|
@@ -1622,18 +1622,18 @@ class tr {
|
|
|
1622
1622
|
throw new RangeError(`[FenwickMapTree] options.baseValue must be a finite number >= 0, received ${u}.`);
|
|
1623
1623
|
if (i > 0 && u !== void 0) {
|
|
1624
1624
|
if (s = u, n?.materialize) {
|
|
1625
|
-
const d = n?.sampleRange ?? { from: 0, to: Math.min(
|
|
1625
|
+
const d = n?.sampleRange ?? { from: 0, to: Math.min(vr - 1, i - 1) };
|
|
1626
1626
|
let g = Math.max(0, Math.trunc(d.from)), v = Math.min(Math.trunc(d.to), i - 1);
|
|
1627
|
-
g > v && (g = 0, v = Math.min(
|
|
1627
|
+
g > v && (g = 0, v = Math.min(vr - 1, i - 1)), o = { from: g, values: tr._collectValidatedValues(r, g, v) };
|
|
1628
1628
|
}
|
|
1629
1629
|
} else if (i > 0) {
|
|
1630
1630
|
const d = n?.sampleRange ?? {
|
|
1631
1631
|
from: 0,
|
|
1632
|
-
to: Math.min(
|
|
1632
|
+
to: Math.min(vr - 1, i - 1)
|
|
1633
1633
|
};
|
|
1634
1634
|
let g = Math.max(0, Math.trunc(d.from)), v = Math.min(Math.trunc(d.to), i - 1);
|
|
1635
|
-
if (g > v && (g = 0, v = Math.min(
|
|
1636
|
-
s = tr._sampleBaseValueStrided(r, i,
|
|
1635
|
+
if (g > v && (g = 0, v = Math.min(vr - 1, i - 1)), i > vr)
|
|
1636
|
+
s = tr._sampleBaseValueStrided(r, i, vr), n?.materialize && (o = { from: g, values: tr._collectValidatedValues(r, g, v) });
|
|
1637
1637
|
else {
|
|
1638
1638
|
const M = tr._collectValidatedValues(r, g, v);
|
|
1639
1639
|
s = tr._modeOrMedian([...M]), n?.materialize && (o = { from: g, values: M });
|
|
@@ -1799,7 +1799,7 @@ class tr {
|
|
|
1799
1799
|
let n = e + 1;
|
|
1800
1800
|
for (; n <= this.size; ) {
|
|
1801
1801
|
this.tree.set(n, (this.tree.get(n) ?? 0) + r);
|
|
1802
|
-
const i =
|
|
1802
|
+
const i = wr(n);
|
|
1803
1803
|
if (i === 0)
|
|
1804
1804
|
break;
|
|
1805
1805
|
n += i;
|
|
@@ -1843,7 +1843,7 @@ class tr {
|
|
|
1843
1843
|
let e = 0, r = this.size;
|
|
1844
1844
|
for (; r > 0; ) {
|
|
1845
1845
|
e += this.tree.get(r) ?? 0;
|
|
1846
|
-
const n =
|
|
1846
|
+
const n = wr(r);
|
|
1847
1847
|
if (n === 0)
|
|
1848
1848
|
break;
|
|
1849
1849
|
r -= n;
|
|
@@ -2022,7 +2022,7 @@ class tr {
|
|
|
2022
2022
|
for (; o > 0; ) {
|
|
2023
2023
|
const d = this.tree.get(o) ?? 0;
|
|
2024
2024
|
s += d;
|
|
2025
|
-
const g =
|
|
2025
|
+
const g = wr(o);
|
|
2026
2026
|
if (g === 0)
|
|
2027
2027
|
break;
|
|
2028
2028
|
o -= g;
|
|
@@ -2085,7 +2085,7 @@ class tr {
|
|
|
2085
2085
|
let s = n + 1;
|
|
2086
2086
|
for (; s <= this.size; ) {
|
|
2087
2087
|
r.set(s, (r.get(s) ?? 0) + i);
|
|
2088
|
-
const o =
|
|
2088
|
+
const o = wr(s);
|
|
2089
2089
|
if (o === 0)
|
|
2090
2090
|
break;
|
|
2091
2091
|
s += o;
|
|
@@ -2202,14 +2202,14 @@ class tr {
|
|
|
2202
2202
|
_propagateDeltaToGrownNodes(e, r, n, i) {
|
|
2203
2203
|
let s = e + 1;
|
|
2204
2204
|
for (; s <= n; ) {
|
|
2205
|
-
const o =
|
|
2205
|
+
const o = wr(s);
|
|
2206
2206
|
if (o === 0)
|
|
2207
2207
|
break;
|
|
2208
2208
|
s += o;
|
|
2209
2209
|
}
|
|
2210
2210
|
for (; s <= i; ) {
|
|
2211
2211
|
this.tree.set(s, (this.tree.get(s) ?? 0) + r);
|
|
2212
|
-
const o =
|
|
2212
|
+
const o = wr(s);
|
|
2213
2213
|
if (o === 0)
|
|
2214
2214
|
break;
|
|
2215
2215
|
s += o;
|
|
@@ -2440,9 +2440,9 @@ const Ni = 1e4, Ji = () => {
|
|
|
2440
2440
|
const Y = C.residual;
|
|
2441
2441
|
if (Y === 0)
|
|
2442
2442
|
return { actualDelta: 0, atBoundary: !1 };
|
|
2443
|
-
const te = O(),
|
|
2443
|
+
const te = O(), J = I(Y), xe = J - te;
|
|
2444
2444
|
C.residual -= xe;
|
|
2445
|
-
const rt = Y < 0 && te + Y <= 0, P = Y > 0 && te + Y >= G, W = Y < 0 && (
|
|
2445
|
+
const rt = Y < 0 && te + Y <= 0, P = Y > 0 && te + Y >= G, W = Y < 0 && (J <= 0 || rt && xe === 0) || Y > 0 && (J >= G || P && xe === 0);
|
|
2446
2446
|
return W && (C.residual = 0), { actualDelta: xe, atBoundary: W };
|
|
2447
2447
|
}, []), y = x(
|
|
2448
2448
|
(C) => {
|
|
@@ -2458,8 +2458,8 @@ const Ni = 1e4, Ji = () => {
|
|
|
2458
2458
|
}
|
|
2459
2459
|
const ie = vi({ offsetX: ee.offsetX, offsetY: ee.offsetY, maxDistance: j.maxDistance, x: j.xSpeedParams, y: j.ySpeedParams }), G = M(d.current, ie.x, I, j.getHx, j.getMaxHx, (xe) => j.applyHxRef.current(j.getHx() + xe));
|
|
2460
2460
|
G.actualDelta !== 0 && (j.pendingColAnchorRef.current = null);
|
|
2461
|
-
const Y = M(g.current, ie.y, I, j.getVy, j.getMaxVy, j.applyVy), te = j.getMaxHx() <= 0 || G.atBoundary || ee.offsetX === 0,
|
|
2462
|
-
if (te &&
|
|
2461
|
+
const Y = M(g.current, ie.y, I, j.getVy, j.getMaxVy, j.applyVy), te = j.getMaxHx() <= 0 || G.atBoundary || ee.offsetX === 0, J = j.getMaxVy() <= 0 || Y.atBoundary || ee.offsetY === 0;
|
|
2462
|
+
if (te && J) {
|
|
2463
2463
|
v();
|
|
2464
2464
|
return;
|
|
2465
2465
|
}
|
|
@@ -2510,7 +2510,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
2510
2510
|
}, et = (t, e) => e <= 0 ? 0 : ne(t, 0, e - 1), vn = (t) => ({
|
|
2511
2511
|
top: Math.max(0, t?.top ?? 0),
|
|
2512
2512
|
bottom: Math.max(0, t?.bottom ?? 0)
|
|
2513
|
-
}), St = (t, e) => t <= e ? 0 : t - e, ur = (t, e) => t <= 0 ? 0 : t + e, Ar = 1e3, rn = 2e3, Hn = 1048576,
|
|
2513
|
+
}), St = (t, e) => t <= e ? 0 : t - e, ur = (t, e) => t <= 0 ? 0 : t + e, Ar = 1e3, rn = 2e3, Hn = 1048576, dr = 2 ** -10, wn = (t) => t === "center" ? null : t === "bottom" ? "end" : "start", Ai = (t, e, r) => t <= dr ? "start" : t >= e - dr ? "end" : r !== null && Math.abs(t - r.panePosition) <= dr ? r.edge : "none", Ci = ({ translateY: t, snapEdge: e, children: r }) => {
|
|
2514
2514
|
const { ratio: n, attach: i } = Nn("[VirtualScroll] the items wrapper"), s = n === null ? t : En(t, n, e);
|
|
2515
2515
|
return /* @__PURE__ */ K("div", { ref: i, className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${s}px)`, willChange: "transform" }, children: r });
|
|
2516
2516
|
}, Di = 40, Er = (t) => {
|
|
@@ -2539,10 +2539,10 @@ const Ni = 1e4, Ji = () => {
|
|
|
2539
2539
|
}, H = (O) => {
|
|
2540
2540
|
let D = 0, I = O, ie = O, G = 0n, Y = 0;
|
|
2541
2541
|
for (; I < d && D < e; ) {
|
|
2542
|
-
const te = Number(I),
|
|
2543
|
-
if (D +=
|
|
2542
|
+
const te = Number(I), J = i(te);
|
|
2543
|
+
if (D += J, ie = I, I += 1n, G += 1n, !Number.isFinite(J) || J < 0)
|
|
2544
2544
|
break;
|
|
2545
|
-
if (
|
|
2545
|
+
if (J === 0) {
|
|
2546
2546
|
if (Y += 1, Y > Ar) {
|
|
2547
2547
|
const xe = A(ie);
|
|
2548
2548
|
if (xe !== null && xe > I)
|
|
@@ -2570,10 +2570,10 @@ const Ni = 1e4, Ji = () => {
|
|
|
2570
2570
|
const te = Number(O);
|
|
2571
2571
|
if (!Number.isSafeInteger(te))
|
|
2572
2572
|
break;
|
|
2573
|
-
const { cumulative:
|
|
2574
|
-
if (!Number.isFinite(
|
|
2573
|
+
const { cumulative: J } = s.prefixSum(te, { materializeOption: { materialize: !1 } });
|
|
2574
|
+
if (!Number.isFinite(J))
|
|
2575
2575
|
break;
|
|
2576
|
-
const { index: xe } = s.findIndexAtOrAfter(
|
|
2576
|
+
const { index: xe } = s.findIndexAtOrAfter(J - 0.5, { materializeOption: { materialize: !1 } }), rt = xe === -1 ? -1n : Er(xe);
|
|
2577
2577
|
if (rt >= 0n && rt < O)
|
|
2578
2578
|
O = rt + 1n, I = 0;
|
|
2579
2579
|
else if (rt === O && O >= 1n && i(Number(O - 1n)) > 0)
|
|
@@ -2619,10 +2619,10 @@ const Ni = 1e4, Ji = () => {
|
|
|
2619
2619
|
break;
|
|
2620
2620
|
if (Y === 0) {
|
|
2621
2621
|
if (G++, G > Ar) {
|
|
2622
|
-
const { cumulative: te } = s.prefixSum(I - 1, { materializeOption: { materialize: !1 } }), { index:
|
|
2623
|
-
if (
|
|
2624
|
-
I =
|
|
2625
|
-
else if (
|
|
2622
|
+
const { cumulative: te } = s.prefixSum(I - 1, { materializeOption: { materialize: !1 } }), { index: J } = Number.isFinite(te) ? s.findIndexAtOrAfter(te + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2623
|
+
if (J > I)
|
|
2624
|
+
I = J, G = 0;
|
|
2625
|
+
else if (J === I && i(I) > 0)
|
|
2626
2626
|
G = 0;
|
|
2627
2627
|
else
|
|
2628
2628
|
break;
|
|
@@ -2760,9 +2760,9 @@ const Ni = 1e4, Ji = () => {
|
|
|
2760
2760
|
liveRegion: G,
|
|
2761
2761
|
locale: Y,
|
|
2762
2762
|
labels: te
|
|
2763
|
-
},
|
|
2763
|
+
}, J) => {
|
|
2764
2764
|
const { width: xe, enableThumbDrag: rt, enableTrackClick: P, enableArrowButtons: W, enableArrowButtonTabStops: ce, enableScrollToTopBottomButtons: Ye, renderThumbOverlay: le, tapScrollCircleOptions: Fe } = C ?? {}, bt = Ie(() => An(Y, te), [Y, te]), { enablePointerDrag: de, pointerDragInputs: je, enableKeyboardNavigation: ye = !0, enableEscapeRowReturn: nt = !1, wheelSpeedMultiplier: ct, inertiaOptions: ke, overscrollBehavior: lt, clipItemHeight: ut = !1, resetOnGetItemHeightChange: We = !1 } = j ?? {}, [me, zt] = De(0), se = i ?? me, Me = x((c) => {
|
|
2765
|
-
zt((
|
|
2765
|
+
zt((h) => h === c ? h : c);
|
|
2766
2766
|
}, []), oe = f(null), re = f({
|
|
2767
2767
|
renderingStartIndex: 0,
|
|
2768
2768
|
renderingEndIndex: 0,
|
|
@@ -2779,7 +2779,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
2779
2779
|
We && (Ke.current = null);
|
|
2780
2780
|
}, [We, n]);
|
|
2781
2781
|
const N = Ie(() => vn(ue), [ue]), [Ee] = De(() => {
|
|
2782
|
-
const
|
|
2782
|
+
const h = H?.index ?? w, b = typeof h == "number" && Number.isFinite(h) ? Math.max(0, Math.trunc(h)) : 0;
|
|
2783
2783
|
return { from: Math.max(0, b - 50), to: b + 50 };
|
|
2784
2784
|
}), Mt = Ie(
|
|
2785
2785
|
// 目的: Fenwick Tree のオプション設定
|
|
@@ -2792,27 +2792,28 @@ const Ni = 1e4, Ji = () => {
|
|
|
2792
2792
|
materialize: !0
|
|
2793
2793
|
}),
|
|
2794
2794
|
[We, Ee]
|
|
2795
|
-
), L = kn(t, n, Mt), [
|
|
2796
|
-
let c = 0,
|
|
2795
|
+
), L = kn(t, n, Mt), [Tt] = De(() => {
|
|
2796
|
+
let c = 0, h = 0;
|
|
2797
2797
|
if (H && t > 0) {
|
|
2798
2798
|
const b = ne(Math.trunc(H.index), 0, t - 1), q = Math.max(0, H.offsetPx ?? 0), _ = ne(b - s * 2, 0, t - 1), B = ne(b + s * 2, 0, t - 1), U = b > 0 || q > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: _, to: B }] } } : void 0, { cumulative: ve, total: Oe, currentValue: _e } = L.prefixSum(b, U), Pe = Math.max(ve - _e + q, 0);
|
|
2799
|
-
c = ur(Pe, N.top),
|
|
2799
|
+
c = ur(Pe, N.top), h = Oe ?? L.getTotal();
|
|
2800
2800
|
} else if (typeof w == "number") {
|
|
2801
2801
|
const b = ne(w, 0, t - 1), q = ne(b - s * 2, 0, t - 1), _ = ne(b + s * 2, 0, t - 1), B = w > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: q, to: _ }] } } : void 0, { cumulative: U, total: ve, currentValue: Oe } = L.prefixSum(w, B), _e = Math.max(U - Oe, 0);
|
|
2802
|
-
c = ur(_e, N.top),
|
|
2803
|
-
} else typeof A == "number" && (c = ur(Math.max(A, 0), N.top)),
|
|
2804
|
-
return { position: c, total:
|
|
2805
|
-
}), [mt, Lt] = De(
|
|
2806
|
-
|
|
2802
|
+
c = ur(_e, N.top), h = ve ?? L.getTotal();
|
|
2803
|
+
} else typeof A == "number" && (c = ur(Math.max(A, 0), N.top)), h = L.getTotal();
|
|
2804
|
+
return { position: c, total: h };
|
|
2805
|
+
}), [mt, Lt] = De(Tt.position), [m, ae] = De(Tt.total), [fe, Z] = De(() => H && t > 0 || typeof w == "number" || Tt.position <= dr ? { edge: "start", panePosition: Tt.position } : null), Q = f(fe), we = x((c) => {
|
|
2806
|
+
const h = Q.current;
|
|
2807
|
+
h === c || h !== null && c !== null && h.edge === c.edge && h.panePosition === c.panePosition || (Q.current = c, Z(c));
|
|
2807
2808
|
}, []), He = x(
|
|
2808
|
-
(c,
|
|
2809
|
-
const b =
|
|
2810
|
-
b === null || Math.abs(b.panePosition - c) >
|
|
2809
|
+
(c, h) => {
|
|
2810
|
+
const b = Q.current;
|
|
2811
|
+
b === null || Math.abs(b.panePosition - c) > dr || we({ edge: b.edge, panePosition: h });
|
|
2811
2812
|
},
|
|
2812
2813
|
[we]
|
|
2813
2814
|
), $e = x(() => {
|
|
2814
|
-
|
|
2815
|
-
}, [we]), be = f(
|
|
2815
|
+
Q.current !== null && we(null);
|
|
2816
|
+
}, [we]), be = f(Tt.position), Ue = f(N.top), Ge = f(d ?? void 0), pt = f(g ?? void 0), gt = f(v), Ze = f(ee), Ot = (D?.length ?? 0) > 0, ze = !!ee;
|
|
2816
2817
|
k(() => {
|
|
2817
2818
|
Ot && (ye || V.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), ze || V.warn("[VirtualScroll] horizontalKeyInputs is set but onWheelHorizontal is missing; horizontal keyboard scrolling is disabled because the package does not own the horizontal axis."), Number.isFinite(I) && I > 0 || V.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${I}. Horizontal arrow keys are left untouched.`));
|
|
2818
2819
|
}, [Ot, ze, ye, I]);
|
|
@@ -2830,11 +2831,11 @@ const Ni = 1e4, Ji = () => {
|
|
|
2830
2831
|
}
|
|
2831
2832
|
},
|
|
2832
2833
|
[ye]
|
|
2833
|
-
), Ce = x((c, { position:
|
|
2834
|
-
c(
|
|
2835
|
-
}, []), Vt = Sn(Ge, $, Ce),
|
|
2836
|
-
c(
|
|
2837
|
-
}, []), cr = Sn(pt, $,
|
|
2834
|
+
), Ce = x((c, { position: h, totalHeight: b }) => {
|
|
2835
|
+
c(h, b);
|
|
2836
|
+
}, []), Vt = Sn(Ge, $, Ce), fr = x((c, h) => {
|
|
2837
|
+
c(h);
|
|
2838
|
+
}, []), cr = Sn(pt, $, fr), dt = f(N.top);
|
|
2838
2839
|
dt.current = N.top;
|
|
2839
2840
|
const _t = f(Vt);
|
|
2840
2841
|
_t.current = Vt, k(() => (X.current = !1, () => {
|
|
@@ -2843,19 +2844,19 @@ const Ni = 1e4, Ji = () => {
|
|
|
2843
2844
|
ye || (pe.current.clear(), Re.current = null, Se.current = null);
|
|
2844
2845
|
}, [ye]);
|
|
2845
2846
|
const Gt = x(
|
|
2846
|
-
(c,
|
|
2847
|
-
if (!
|
|
2847
|
+
(c, h) => {
|
|
2848
|
+
if (!h) {
|
|
2848
2849
|
pe.current.delete(c);
|
|
2849
2850
|
return;
|
|
2850
2851
|
}
|
|
2851
|
-
ye && (pe.current.set(c,
|
|
2852
|
+
ye && (pe.current.set(c, h), Re.current === c && (Re.current = null, Se.current = c, qt(h)));
|
|
2852
2853
|
},
|
|
2853
2854
|
[ye, qt]
|
|
2854
2855
|
), jt = 0.01, Kt = f({
|
|
2855
2856
|
rafId: null,
|
|
2856
2857
|
loopActive: !1,
|
|
2857
2858
|
idleFrames: 0,
|
|
2858
|
-
lastRenderedPosition:
|
|
2859
|
+
lastRenderedPosition: Tt.position
|
|
2859
2860
|
}), rr = x(() => {
|
|
2860
2861
|
const c = Kt.current;
|
|
2861
2862
|
c.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(c.rafId), c.rafId = null, c.loopActive = !1, c.idleFrames = 0;
|
|
@@ -2870,8 +2871,8 @@ const Ni = 1e4, Ji = () => {
|
|
|
2870
2871
|
}), Zt = x(() => {
|
|
2871
2872
|
const c = Kt.current;
|
|
2872
2873
|
c.rafId = null;
|
|
2873
|
-
const
|
|
2874
|
-
if (Lt((B) => Math.abs(B -
|
|
2874
|
+
const h = be.current, b = St(h, dt.current), q = L.getTotal();
|
|
2875
|
+
if (Lt((B) => Math.abs(B - h) < jt ? B : h), Math.abs(c.lastRenderedPosition - h) >= jt ? (_t.current({ position: b, totalHeight: q }), c.lastRenderedPosition = h, c.idleFrames = 0) : c.idleFrames += 1, c.idleFrames >= 2) {
|
|
2875
2876
|
rr();
|
|
2876
2877
|
return;
|
|
2877
2878
|
}
|
|
@@ -2892,8 +2893,8 @@ const Ni = 1e4, Ji = () => {
|
|
|
2892
2893
|
c.loopActive = !1;
|
|
2893
2894
|
}
|
|
2894
2895
|
}, [Zt]), l = x(
|
|
2895
|
-
(c,
|
|
2896
|
-
const b =
|
|
2896
|
+
(c, h) => {
|
|
2897
|
+
const b = h?.immediate ?? !1, q = St(c, N.top);
|
|
2897
2898
|
if (be.current = c, b) {
|
|
2898
2899
|
Kt.current.lastRenderedPosition = c, Kt.current.idleFrames = 0, Lt(c), Vt({ position: q, totalHeight: L.getTotal() });
|
|
2899
2900
|
return;
|
|
@@ -2901,22 +2902,22 @@ const Ni = 1e4, Ji = () => {
|
|
|
2901
2902
|
Qt();
|
|
2902
2903
|
},
|
|
2903
2904
|
[Qt, L, N.top, Vt]
|
|
2904
|
-
), R = x((c,
|
|
2905
|
+
), R = x((c, h = 0) => {
|
|
2905
2906
|
const b = oe.current;
|
|
2906
2907
|
if (!b)
|
|
2907
2908
|
return c;
|
|
2908
2909
|
const q = b.getScrollPosition();
|
|
2909
2910
|
Te.current += 1;
|
|
2910
|
-
const _ = b.getContentSize() +
|
|
2911
|
+
const _ = b.getContentSize() + h, B = b.getViewportSize(), U = b.scrollTo(c, { contentSize: _, viewportSize: B });
|
|
2911
2912
|
return U === q && (Te.current = Math.max(0, Te.current - 1)), Math.abs(U - c) > 0.5 && (Ve.current = !0), U;
|
|
2912
|
-
}, []), z = x((c,
|
|
2913
|
+
}, []), z = x((c, h) => {
|
|
2913
2914
|
const b = oe.current;
|
|
2914
2915
|
if (b === null) {
|
|
2915
|
-
|
|
2916
|
+
h();
|
|
2916
2917
|
return;
|
|
2917
2918
|
}
|
|
2918
2919
|
const q = b.getScrollPosition();
|
|
2919
|
-
|
|
2920
|
+
h();
|
|
2920
2921
|
const _ = gt.current;
|
|
2921
2922
|
if (_ === void 0)
|
|
2922
2923
|
return;
|
|
@@ -2926,57 +2927,57 @@ const Ni = 1e4, Ji = () => {
|
|
|
2926
2927
|
k(() => {
|
|
2927
2928
|
if (!ge.current)
|
|
2928
2929
|
if (ge.current = !0, H == null && typeof w != "number" && typeof A == "number") {
|
|
2929
|
-
const c = ur(Math.max(A, 0), N.top),
|
|
2930
|
-
l(c, { immediate: !0 }),
|
|
2930
|
+
const c = ur(Math.max(A, 0), N.top), h = Math.abs(c - be.current) > 0.5;
|
|
2931
|
+
l(c, { immediate: !0 }), h && oe.current?.scrollTo(c);
|
|
2931
2932
|
} else
|
|
2932
2933
|
l(be.current, { immediate: !0 });
|
|
2933
2934
|
}, [H, w, A, N.top, l]), k(() => {
|
|
2934
2935
|
const c = L.getTotal();
|
|
2935
|
-
if (
|
|
2936
|
+
if (m !== c) {
|
|
2936
2937
|
ae(c);
|
|
2937
2938
|
return;
|
|
2938
2939
|
}
|
|
2939
2940
|
if (Ve.current) {
|
|
2940
2941
|
Ve.current = !1;
|
|
2941
|
-
const
|
|
2942
|
-
|
|
2942
|
+
const h = oe.current;
|
|
2943
|
+
h && Math.abs(h.getScrollPosition() - be.current) > 0.5 && z("re-issue", () => {
|
|
2943
2944
|
const b = R(be.current);
|
|
2944
2945
|
Ve.current = !1, l(b, { immediate: !0 });
|
|
2945
2946
|
});
|
|
2946
2947
|
}
|
|
2947
|
-
}, [L,
|
|
2948
|
+
}, [L, m, t, z, R, l]), k(() => {
|
|
2948
2949
|
if (Ke.current !== null) {
|
|
2949
|
-
const { index: c, align:
|
|
2950
|
+
const { index: c, align: h, offset: b } = Ke.current, q = et(c, t), { cumulative: _, currentValue: B } = L.prefixSum(q, { materializeOption: { materialize: !1 } });
|
|
2950
2951
|
if (_ !== void 0 && B !== void 0) {
|
|
2951
2952
|
const U = Math.max(_ - B, 0);
|
|
2952
2953
|
let ve = U;
|
|
2953
|
-
|
|
2954
|
-
const Oe = Math.max(0,
|
|
2955
|
-
Math.abs(_e - be.current) >
|
|
2954
|
+
h === "bottom" ? ve = _ - se : h === "center" && (ve = U + B / 2 - se / 2), b && (ve -= b), ve = Math.max(0, ve);
|
|
2955
|
+
const Oe = Math.max(0, m + N.top + N.bottom - se), _e = Math.min(ur(ve, N.top), Oe);
|
|
2956
|
+
Math.abs(_e - be.current) > dr && (V.debug("[VirtualScroll] Drift correction", {
|
|
2956
2957
|
from: be.current,
|
|
2957
2958
|
to: _e,
|
|
2958
2959
|
targetIndex: q
|
|
2959
2960
|
}), z("drift", () => {
|
|
2960
2961
|
Te.current === 0 && (Te.current += 1), oe.current?.scrollTo(_e), l(_e, { immediate: !0 });
|
|
2961
|
-
const Pe = wn(
|
|
2962
|
+
const Pe = wn(h);
|
|
2962
2963
|
we(Pe === null ? null : { edge: Pe, panePosition: _e });
|
|
2963
2964
|
}));
|
|
2964
2965
|
}
|
|
2965
2966
|
}
|
|
2966
2967
|
Nt.current = !1;
|
|
2967
|
-
}, [
|
|
2968
|
+
}, [m, L, t, N.top, z, we, l, se, N.bottom]), k(() => {
|
|
2968
2969
|
const c = Ue.current;
|
|
2969
2970
|
if (c === N.top || (Ue.current = N.top, Ke.current))
|
|
2970
2971
|
return;
|
|
2971
|
-
const
|
|
2972
|
+
const h = St(be.current, c), b = ur(h, N.top);
|
|
2972
2973
|
be.current = b, oe.current?.scrollTo(b), l(b, { immediate: !0 });
|
|
2973
2974
|
}, [N.top, l]);
|
|
2974
2975
|
const qe = x(
|
|
2975
|
-
(c,
|
|
2976
|
+
(c, h) => {
|
|
2976
2977
|
if (t === 0)
|
|
2977
2978
|
return;
|
|
2978
|
-
const b = et(c, t), q = L.get(b), _ =
|
|
2979
|
-
B !== void 0 && ae(B), V.debug("[VirtualScroll] Updated item size manually", { index: b, size:
|
|
2979
|
+
const b = et(c, t), q = L.get(b), _ = h - q, B = L.update(b, h);
|
|
2980
|
+
B !== void 0 && ae(B), V.debug("[VirtualScroll] Updated item size manually", { index: b, size: h, total: B });
|
|
2980
2981
|
let U = Ke.current ? Ke.current.index : null;
|
|
2981
2982
|
if (U === null) {
|
|
2982
2983
|
const ve = be.current, Oe = vn(ue).top, _e = St(ve, Oe), { index: Pe, cumulative: ht } = L.findIndexAtOrAfter(_e, { materializeOption: { materialize: !1 } });
|
|
@@ -2991,7 +2992,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
2991
2992
|
},
|
|
2992
2993
|
[L, t, z, He, R, l, ue]
|
|
2993
2994
|
), Ne = x(
|
|
2994
|
-
(c,
|
|
2995
|
+
(c, h) => {
|
|
2995
2996
|
if (!oe.current || t === 0)
|
|
2996
2997
|
return;
|
|
2997
2998
|
const b = et(c, t), q = et(b - s * 2, t), _ = et(b + s * 2, t), { cumulative: B, total: U, currentValue: ve } = L.prefixSum(b, { materializeOption: { materialize: !0, ranges: [{ from: q, to: _ }] } });
|
|
@@ -2999,16 +3000,16 @@ const Ni = 1e4, Ji = () => {
|
|
|
2999
3000
|
return;
|
|
3000
3001
|
const Oe = Math.max(B - ve, 0);
|
|
3001
3002
|
let _e = Oe;
|
|
3002
|
-
|
|
3003
|
+
h?.align === "bottom" ? _e = B - se : h?.align === "center" && (_e = Oe + ve / 2 - se / 2), h?.offset && (_e -= h.offset), _e = Math.max(0, _e);
|
|
3003
3004
|
const Pe = ur(_e, N.top), ht = oe.current?.getContentSize() ?? U + N.top + N.bottom, it = Math.max(0, ht - se), Je = Math.min(Pe, it);
|
|
3004
3005
|
Ke.current = {
|
|
3005
3006
|
index: b,
|
|
3006
|
-
align:
|
|
3007
|
-
offset:
|
|
3007
|
+
align: h?.align,
|
|
3008
|
+
offset: h?.offset
|
|
3008
3009
|
};
|
|
3009
|
-
const $t = wn(
|
|
3010
|
+
const $t = wn(h?.align);
|
|
3010
3011
|
we($t === null ? null : { edge: $t, panePosition: Je });
|
|
3011
|
-
const sr = oe.current?.getScrollPosition() ?? -1, Dr = Math.abs(sr - Je) >
|
|
3012
|
+
const sr = oe.current?.getScrollPosition() ?? -1, Dr = Math.abs(sr - Je) > dr;
|
|
3012
3013
|
Ae.current = !1, Te.current = 0, Dr && (Ae.current = !0, Te.current += 1, oe.current?.scrollTo(Je)), ae(U), l(Je, { immediate: !0 }), V.debug("[VirtualScroll] Setting scroll position to:", Je, { original: Pe, max: it });
|
|
3013
3014
|
},
|
|
3014
3015
|
[L, s, t, N.top, N.bottom, se, we, l]
|
|
@@ -3021,36 +3022,36 @@ const Ni = 1e4, Ji = () => {
|
|
|
3021
3022
|
(c) => {
|
|
3022
3023
|
if (!oe.current || t === 0)
|
|
3023
3024
|
return;
|
|
3024
|
-
const
|
|
3025
|
+
const h = L.getTotal(), b = ne(Math.floor(c), 0, h), { index: q, cumulative: _, currentValue: B } = L.findIndexAtOrAfter(b, { materializeOption: { materialize: !1 } }), ve = (_ ?? 0) - (B ?? 0) - b;
|
|
3025
3026
|
Ne(q, { offset: ve });
|
|
3026
3027
|
},
|
|
3027
3028
|
[L, t, Ne]
|
|
3028
|
-
),
|
|
3029
|
+
), hr = x(() => {
|
|
3029
3030
|
if (t === 0)
|
|
3030
3031
|
return null;
|
|
3031
|
-
const c = St(be.current, N.top), { index:
|
|
3032
|
-
if (
|
|
3032
|
+
const c = St(be.current, N.top), { index: h, cumulative: b, currentValue: q } = L.findIndexAtOrAfter(c, { materializeOption: { materialize: !1 } });
|
|
3033
|
+
if (h === -1)
|
|
3033
3034
|
return { index: t - 1, offsetPx: 0 };
|
|
3034
3035
|
if (b === c)
|
|
3035
|
-
return { index: ne(
|
|
3036
|
+
return { index: ne(h + 1, 0, t - 1), offsetPx: 0 };
|
|
3036
3037
|
const _ = (b ?? 0) - (q ?? 0);
|
|
3037
|
-
return { index:
|
|
3038
|
+
return { index: h, offsetPx: Math.max(0, c - _) };
|
|
3038
3039
|
}, [L, t, N.top]), Ft = x(
|
|
3039
3040
|
(c) => {
|
|
3040
|
-
const
|
|
3041
|
+
const h = St(be.current, N.top), b = typeof c == "function" ? c(h) : c;
|
|
3041
3042
|
xt(b);
|
|
3042
3043
|
const q = oe.current?.getScrollPosition(), _ = typeof q == "number" ? q : be.current;
|
|
3043
3044
|
return l(_), St(_, dt.current);
|
|
3044
3045
|
},
|
|
3045
3046
|
[N.top, xt, l]
|
|
3046
3047
|
), kt = x((c) => {
|
|
3047
|
-
const
|
|
3048
|
-
if (!
|
|
3048
|
+
const h = oe.current;
|
|
3049
|
+
if (!h)
|
|
3049
3050
|
return St(be.current, dt.current);
|
|
3050
|
-
const b =
|
|
3051
|
+
const b = h.scrollTo((q) => q + c);
|
|
3051
3052
|
return St(b, dt.current);
|
|
3052
3053
|
}, []), Jt = x((c) => oe.current?.applyWheel(c) ?? !1, []), Cr = x(
|
|
3053
|
-
(c,
|
|
3054
|
+
(c, h) => {
|
|
3054
3055
|
V.debug("[VirtualScroll] Scroll position changed:", c);
|
|
3055
3056
|
const b = Ae.current;
|
|
3056
3057
|
b && (Ae.current = !1);
|
|
@@ -3060,8 +3061,8 @@ const Ni = 1e4, Ji = () => {
|
|
|
3060
3061
|
if (b || q || _ || (Ke.current = null, $e()), l(c), Ye) {
|
|
3061
3062
|
if (b || q)
|
|
3062
3063
|
return;
|
|
3063
|
-
const B = c -
|
|
3064
|
-
if (V.debug("[VirtualScroll] Scroll diff:", B, "New:", c, "Prev:",
|
|
3064
|
+
const B = c - h;
|
|
3065
|
+
if (V.debug("[VirtualScroll] Scroll diff:", B, "New:", c, "Prev:", h), Math.abs(B) > 1) {
|
|
3065
3066
|
const U = B > 0 ? "down" : "up";
|
|
3066
3067
|
E(U), Qe(!0), V.debug("[VirtualScroll] Showing scroll buttons. Direction:", U), Xe.current && clearTimeout(Xe.current), Xe.current = setTimeout(() => {
|
|
3067
3068
|
Qe(!1), V.debug("[VirtualScroll] Hiding scroll buttons");
|
|
@@ -3070,21 +3071,21 @@ const Ni = 1e4, Ji = () => {
|
|
|
3070
3071
|
}
|
|
3071
3072
|
},
|
|
3072
3073
|
[l, $e, Ye, t]
|
|
3073
|
-
), ft = Ie(() => St(mt, N.top), [N.top, mt]),
|
|
3074
|
-
const c = L.getTotal(),
|
|
3074
|
+
), ft = Ie(() => St(mt, N.top), [N.top, mt]), It = Ie(() => {
|
|
3075
|
+
const c = L.getTotal(), h = $n(ft, se, s, t, n, L, c);
|
|
3075
3076
|
return V.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
3076
|
-
...
|
|
3077
|
+
...h,
|
|
3077
3078
|
scrollPosition: ft,
|
|
3078
3079
|
renderingContentSize: c,
|
|
3079
3080
|
overscanCount: s,
|
|
3080
3081
|
viewportSize: se
|
|
3081
|
-
})),
|
|
3082
|
-
}, [ft, se, s, t, n, L]), { renderingStartIndex: Pt, renderingEndIndex: vt, visibleStartIndex:
|
|
3083
|
-
(c,
|
|
3082
|
+
})), h;
|
|
3083
|
+
}, [ft, se, s, t, n, L]), { renderingStartIndex: Pt, renderingEndIndex: vt, visibleStartIndex: yt, visibleEndIndex: Dt } = It, wt = x(
|
|
3084
|
+
(c, h) => {
|
|
3084
3085
|
if (!ye || t === 0)
|
|
3085
3086
|
return;
|
|
3086
3087
|
const b = et(c, t);
|
|
3087
|
-
if (!(
|
|
3088
|
+
if (!(h?.ensureVisible ?? !0)) {
|
|
3088
3089
|
const it = pe.current.get(b);
|
|
3089
3090
|
it && (Re.current = null, Se.current = b, qt(it));
|
|
3090
3091
|
return;
|
|
@@ -3105,7 +3106,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3105
3106
|
},
|
|
3106
3107
|
[ye, t, L, N.top, Ne, qt, se]
|
|
3107
3108
|
), Et = x(
|
|
3108
|
-
(c,
|
|
3109
|
+
(c, h) => {
|
|
3109
3110
|
if (!(!ye || c.defaultPrevented) && !(c.altKey || c.metaKey || c.ctrlKey) && c.target === c.currentTarget && !c.currentTarget.isContentEditable) {
|
|
3110
3111
|
if (c.key === "ArrowLeft" || c.key === "ArrowRight") {
|
|
3111
3112
|
const b = Ze.current;
|
|
@@ -3115,24 +3116,24 @@ const Ni = 1e4, Ji = () => {
|
|
|
3115
3116
|
return;
|
|
3116
3117
|
}
|
|
3117
3118
|
if (c.key === "ArrowDown") {
|
|
3118
|
-
|
|
3119
|
+
h < t - 1 && (c.preventDefault(), wt(h + 1));
|
|
3119
3120
|
return;
|
|
3120
3121
|
}
|
|
3121
3122
|
if (c.key === "ArrowUp") {
|
|
3122
|
-
|
|
3123
|
+
h > 0 && (c.preventDefault(), wt(h - 1));
|
|
3123
3124
|
return;
|
|
3124
3125
|
}
|
|
3125
3126
|
if (c.key === "PageDown") {
|
|
3126
|
-
if (
|
|
3127
|
+
if (h < t - 1) {
|
|
3127
3128
|
c.preventDefault();
|
|
3128
|
-
const { visibleStartIndex: b, visibleEndIndex: q } = re.current, _ = Math.max(q - b + 1, 1), B = Math.max(_, 1), U = et(Math.min(
|
|
3129
|
+
const { visibleStartIndex: b, visibleEndIndex: q } = re.current, _ = Math.max(q - b + 1, 1), B = Math.max(_, 1), U = et(Math.min(h + B, t - 1), t);
|
|
3129
3130
|
wt(U);
|
|
3130
3131
|
}
|
|
3131
3132
|
return;
|
|
3132
3133
|
}
|
|
3133
|
-
if (c.key === "PageUp" &&
|
|
3134
|
+
if (c.key === "PageUp" && h > 0) {
|
|
3134
3135
|
c.preventDefault();
|
|
3135
|
-
const { visibleStartIndex: b, visibleEndIndex: q } = re.current, _ = Math.max(q - b + 1, 1), B = Math.max(_, 1), U = et(
|
|
3136
|
+
const { visibleStartIndex: b, visibleEndIndex: q } = re.current, _ = Math.max(q - b + 1, 1), B = Math.max(_, 1), U = et(h - B, t);
|
|
3136
3137
|
wt(U);
|
|
3137
3138
|
}
|
|
3138
3139
|
}
|
|
@@ -3146,43 +3147,43 @@ const Ni = 1e4, Ji = () => {
|
|
|
3146
3147
|
* @param event - Keyboard event (bubble phase on the row wrapper) / 行ラッパー bubble フェーズのキーイベント
|
|
3147
3148
|
* @param index - Row index / 行インデックス
|
|
3148
3149
|
*/
|
|
3149
|
-
(c,
|
|
3150
|
+
(c, h) => {
|
|
3150
3151
|
if (c.key !== "Escape" || c.defaultPrevented || c.nativeEvent.isComposing || c.target === c.currentTarget)
|
|
3151
3152
|
return;
|
|
3152
3153
|
const b = c.target;
|
|
3153
|
-
b instanceof HTMLInputElement || b instanceof HTMLTextAreaElement || b instanceof HTMLSelectElement || b.isContentEditable || (c.preventDefault(), wt(
|
|
3154
|
+
b instanceof HTMLInputElement || b instanceof HTMLTextAreaElement || b instanceof HTMLSelectElement || b.isContentEditable || (c.preventDefault(), wt(h));
|
|
3154
3155
|
},
|
|
3155
3156
|
[wt]
|
|
3156
3157
|
), er = x(
|
|
3157
3158
|
(c) => {
|
|
3158
3159
|
if (!ye)
|
|
3159
3160
|
return;
|
|
3160
|
-
const
|
|
3161
|
-
Re.current = null, Se.current =
|
|
3161
|
+
const h = et(c, t);
|
|
3162
|
+
Re.current = null, Se.current = h, Le?.(h);
|
|
3162
3163
|
},
|
|
3163
3164
|
[ye, t, Le]
|
|
3164
3165
|
);
|
|
3165
3166
|
k(() => {
|
|
3166
|
-
const c = oe.current?.getScrollPosition() ?? 0,
|
|
3167
|
+
const c = oe.current?.getScrollPosition() ?? 0, h = be.current, b = St(h, N.top);
|
|
3167
3168
|
V.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
3168
3169
|
renderingStartIndex: Pt,
|
|
3169
3170
|
renderingEndIndex: vt,
|
|
3170
|
-
visibleStartIndex:
|
|
3171
|
+
visibleStartIndex: yt,
|
|
3171
3172
|
visibleEndIndex: Dt,
|
|
3172
3173
|
scrollPositionState: mt,
|
|
3173
|
-
paneScrollPosition:
|
|
3174
|
+
paneScrollPosition: h,
|
|
3174
3175
|
logicalScrollPosition: b,
|
|
3175
|
-
contentSize:
|
|
3176
|
+
contentSize: m,
|
|
3176
3177
|
scrollPaneScrollPosition: c
|
|
3177
3178
|
})), cr({
|
|
3178
3179
|
renderingStartIndex: Pt,
|
|
3179
3180
|
renderingEndIndex: vt,
|
|
3180
|
-
visibleStartIndex:
|
|
3181
|
+
visibleStartIndex: yt,
|
|
3181
3182
|
visibleEndIndex: Dt,
|
|
3182
3183
|
scrollPosition: b,
|
|
3183
|
-
totalHeight:
|
|
3184
|
+
totalHeight: m
|
|
3184
3185
|
});
|
|
3185
|
-
}, [
|
|
3186
|
+
}, [m, vt, Pt, N.top, cr, mt, Dt, yt]);
|
|
3186
3187
|
const At = x(() => {
|
|
3187
3188
|
if (!Ye)
|
|
3188
3189
|
return null;
|
|
@@ -3210,19 +3211,19 @@ const Ni = 1e4, Ji = () => {
|
|
|
3210
3211
|
children: bt.scrollToBottom
|
|
3211
3212
|
}
|
|
3212
3213
|
) }) });
|
|
3213
|
-
}, [Ye, ot, S, Ne, t, bt]), Sr = f(0), { visibleItems: Ht, renderAnchor:
|
|
3214
|
+
}, [Ye, ot, S, Ne, t, bt]), Sr = f(0), { visibleItems: Ht, renderAnchor: mr } = Ie(() => {
|
|
3214
3215
|
if (t === 0)
|
|
3215
3216
|
return {
|
|
3216
3217
|
visibleItems: /* @__PURE__ */ K("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ K("div", { className: "aqvs-no-items-text", children: bt.noItems }) }),
|
|
3217
3218
|
renderAnchor: 0
|
|
3218
3219
|
};
|
|
3219
|
-
const c = et(Pt, t),
|
|
3220
|
+
const c = et(Pt, t), h = et(vt, t), { cumulative: b, currentValue: q } = L.prefixSum(c, { materializeOption: { materialize: !1 } }), _ = b - q;
|
|
3220
3221
|
Number.isFinite(_) && Math.abs(_ - Sr.current) > Hn && (Sr.current = _);
|
|
3221
3222
|
const B = Sr.current, U = [], ve = [];
|
|
3222
3223
|
let Oe = 0, _e = _;
|
|
3223
|
-
for (let Pe = c; Pe <=
|
|
3224
|
+
for (let Pe = c; Pe <= h; Pe++) {
|
|
3224
3225
|
if (ve.length >= rn) {
|
|
3225
|
-
V.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: rn, safeRenderingStartIndex: c, safeRenderingEndIndex:
|
|
3226
|
+
V.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: rn, safeRenderingStartIndex: c, safeRenderingEndIndex: h });
|
|
3226
3227
|
break;
|
|
3227
3228
|
}
|
|
3228
3229
|
const ht = n(Pe), it = L.get(Pe), Je = ht - it;
|
|
@@ -3253,7 +3254,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3253
3254
|
return;
|
|
3254
3255
|
let Pe = 0;
|
|
3255
3256
|
for (const Je of U)
|
|
3256
|
-
if (Je.index <
|
|
3257
|
+
if (Je.index < yt) {
|
|
3257
3258
|
const $t = L.get(Je.index);
|
|
3258
3259
|
Pe += Je.value - $t;
|
|
3259
3260
|
}
|
|
@@ -3274,7 +3275,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3274
3275
|
He,
|
|
3275
3276
|
M,
|
|
3276
3277
|
ut,
|
|
3277
|
-
|
|
3278
|
+
m,
|
|
3278
3279
|
ye,
|
|
3279
3280
|
t,
|
|
3280
3281
|
L,
|
|
@@ -3291,10 +3292,10 @@ const Ni = 1e4, Ji = () => {
|
|
|
3291
3292
|
Pt,
|
|
3292
3293
|
bt,
|
|
3293
3294
|
l,
|
|
3294
|
-
|
|
3295
|
-
]),
|
|
3295
|
+
yt
|
|
3296
|
+
]), pr = x(
|
|
3296
3297
|
(c) => {
|
|
3297
|
-
const
|
|
3298
|
+
const h = ($ ?? 0) > 0, b = Math.abs(c - mt), q = h && b > 0.5 ? mt : c, _ = St(q, N.top);
|
|
3298
3299
|
if (V.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
3299
3300
|
currentScrollPosition: c,
|
|
3300
3301
|
effectiveScrollPosition: _,
|
|
@@ -3307,13 +3308,13 @@ const Ni = 1e4, Ji = () => {
|
|
|
3307
3308
|
rawEffectiveScrollPosition: q
|
|
3308
3309
|
})), t === 0)
|
|
3309
3310
|
return Ht;
|
|
3310
|
-
const B = N.top +
|
|
3311
|
+
const B = N.top + mr - q, U = L.getTotal(), ve = Ai(q, U + N.top + N.bottom - se, fe), Oe = N.bottom > 0 ? /* @__PURE__ */ K(
|
|
3311
3312
|
"div",
|
|
3312
3313
|
{
|
|
3313
3314
|
className: "aqvs-bottom-inset",
|
|
3314
3315
|
style: {
|
|
3315
3316
|
// ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
|
|
3316
|
-
top: U -
|
|
3317
|
+
top: U - mr,
|
|
3317
3318
|
height: N.bottom
|
|
3318
3319
|
}
|
|
3319
3320
|
},
|
|
@@ -3330,20 +3331,20 @@ const Ni = 1e4, Ji = () => {
|
|
|
3330
3331
|
Oe
|
|
3331
3332
|
] });
|
|
3332
3333
|
},
|
|
3333
|
-
[fe, $, t, L, ft,
|
|
3334
|
+
[fe, $, t, L, ft, mr, vt, Pt, N, mt, se, Ht]
|
|
3334
3335
|
), at = Ie(
|
|
3335
3336
|
() => ({
|
|
3336
|
-
renderingStartIndex:
|
|
3337
|
-
renderingEndIndex:
|
|
3338
|
-
visibleStartIndex:
|
|
3339
|
-
visibleEndIndex:
|
|
3337
|
+
renderingStartIndex: It.renderingStartIndex,
|
|
3338
|
+
renderingEndIndex: It.renderingEndIndex,
|
|
3339
|
+
visibleStartIndex: It.visibleStartIndex,
|
|
3340
|
+
visibleEndIndex: It.visibleEndIndex,
|
|
3340
3341
|
scrollPosition: ft,
|
|
3341
3342
|
totalHeight: L.getTotal()
|
|
3342
3343
|
// contentSize (State) ではなく最新値を反映
|
|
3343
3344
|
}),
|
|
3344
3345
|
// contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
|
|
3345
3346
|
// (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
|
|
3346
|
-
[
|
|
3347
|
+
[It, ft, L, m]
|
|
3347
3348
|
);
|
|
3348
3349
|
k(() => {
|
|
3349
3350
|
re.current = at;
|
|
@@ -3352,24 +3353,24 @@ const Ni = 1e4, Ji = () => {
|
|
|
3352
3353
|
tt(() => {
|
|
3353
3354
|
Ir.current = G;
|
|
3354
3355
|
}, [G]);
|
|
3355
|
-
const ir = G?.debounceMs ?? 400,
|
|
3356
|
+
const ir = G?.debounceMs ?? 400, gr = Number.isFinite(ir) && ir >= 0, lr = G !== void 0;
|
|
3356
3357
|
k(() => {
|
|
3357
|
-
lr && !
|
|
3358
|
-
}, [lr,
|
|
3359
|
-
if (!(lr &&
|
|
3358
|
+
lr && !gr && V.warn(`[VirtualScroll] liveRegion.debounceMs must be a finite number >= 0, received ${ir}. Announcements are disabled.`);
|
|
3359
|
+
}, [lr, gr, ir]), k(() => {
|
|
3360
|
+
if (!(lr && gr)) {
|
|
3360
3361
|
Tr("");
|
|
3361
3362
|
return;
|
|
3362
3363
|
}
|
|
3363
3364
|
const c = setTimeout(() => {
|
|
3364
|
-
const
|
|
3365
|
-
if (!
|
|
3365
|
+
const h = Ir.current?.format;
|
|
3366
|
+
if (!h)
|
|
3366
3367
|
return;
|
|
3367
|
-
const b =
|
|
3368
|
+
const b = h({ visibleStartIndex: yt, visibleEndIndex: Dt, itemCount: t });
|
|
3368
3369
|
Tr(b);
|
|
3369
3370
|
}, ir);
|
|
3370
3371
|
return () => clearTimeout(c);
|
|
3371
|
-
}, [lr,
|
|
3372
|
-
|
|
3372
|
+
}, [lr, gr, ir, yt, Dt, t]), Xr(
|
|
3373
|
+
J,
|
|
3373
3374
|
() => ({
|
|
3374
3375
|
getScrollPosition: () => {
|
|
3375
3376
|
const c = oe.current?.getScrollPosition();
|
|
@@ -3385,10 +3386,10 @@ const Ni = 1e4, Ji = () => {
|
|
|
3385
3386
|
getFenwickSize: () => L.getSize(),
|
|
3386
3387
|
focusItemAtIndex: wt,
|
|
3387
3388
|
getRange: () => re.current,
|
|
3388
|
-
getScrollAnchor:
|
|
3389
|
+
getScrollAnchor: hr,
|
|
3389
3390
|
updateItemSize: qe
|
|
3390
3391
|
}),
|
|
3391
|
-
[Ft, kt, Jt, Ne, L, wt,
|
|
3392
|
+
[Ft, kt, Jt, Ne, L, wt, hr, qe]
|
|
3392
3393
|
);
|
|
3393
3394
|
const qr = L.getTotal() + N.top + N.bottom, yr = /* @__PURE__ */ K(
|
|
3394
3395
|
yi,
|
|
@@ -3418,13 +3419,13 @@ const Ni = 1e4, Ji = () => {
|
|
|
3418
3419
|
onPanHorizontal: O,
|
|
3419
3420
|
contentInsets: N,
|
|
3420
3421
|
contentProps: ie,
|
|
3421
|
-
visibleStartIndex:
|
|
3422
|
+
visibleStartIndex: yt,
|
|
3422
3423
|
visibleEndIndex: Dt,
|
|
3423
3424
|
renderOverlay: At,
|
|
3424
|
-
initialScrollPosition:
|
|
3425
|
+
initialScrollPosition: Tt.position,
|
|
3425
3426
|
locale: Y,
|
|
3426
3427
|
labels: te,
|
|
3427
|
-
children:
|
|
3428
|
+
children: pr
|
|
3428
3429
|
}
|
|
3429
3430
|
);
|
|
3430
3431
|
return lr ? /* @__PURE__ */ Bt(nn, { children: [
|
|
@@ -3525,7 +3526,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3525
3526
|
viewportSize: G,
|
|
3526
3527
|
__maxRenderedCells: Y,
|
|
3527
3528
|
behaviorOptions: te,
|
|
3528
|
-
scrollBarOptions:
|
|
3529
|
+
scrollBarOptions: J,
|
|
3529
3530
|
liveRegion: xe,
|
|
3530
3531
|
locale: rt,
|
|
3531
3532
|
labels: P,
|
|
@@ -3558,7 +3559,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3558
3559
|
const X = Math.min(A, t);
|
|
3559
3560
|
if (!(Number.isInteger($) && $ >= 0 && $ <= Rn))
|
|
3560
3561
|
throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${Rn}], received ${$}.`);
|
|
3561
|
-
const Be = Math.min($, t - X), N = Math.max(0, t - X - Be), Ee = f(!1), Mt = f(0), L = f(0), [
|
|
3562
|
+
const Be = Math.min($, t - X), N = Math.max(0, t - X - Be), Ee = f(!1), Mt = f(0), L = f(0), [Tt, mt] = De(0), { frozenRows: Lt, frozenHeight: m } = Ie(() => {
|
|
3562
3563
|
if (X === 0)
|
|
3563
3564
|
return { frozenRows: [], frozenHeight: 0 };
|
|
3564
3565
|
const a = [];
|
|
@@ -3568,9 +3569,9 @@ const Ni = 1e4, Ji = () => {
|
|
|
3568
3569
|
F > 0 && a.push({ row: T, top: p, height: F }), p += F;
|
|
3569
3570
|
}
|
|
3570
3571
|
return { frozenRows: a, frozenHeight: p };
|
|
3571
|
-
}, [X,
|
|
3572
|
-
Mt.current =
|
|
3573
|
-
const [ae, fe] = De(0), { trailingRows: Z, trailingHeight:
|
|
3572
|
+
}, [X, Tt, ke]);
|
|
3573
|
+
Mt.current = m;
|
|
3574
|
+
const [ae, fe] = De(0), { trailingRows: Z, trailingHeight: Q } = Ie(() => {
|
|
3574
3575
|
if (Be === 0)
|
|
3575
3576
|
return { trailingRows: [], trailingHeight: 0 };
|
|
3576
3577
|
const a = [];
|
|
@@ -3581,10 +3582,10 @@ const Ni = 1e4, Ji = () => {
|
|
|
3581
3582
|
}
|
|
3582
3583
|
return { trailingRows: a, trailingHeight: p };
|
|
3583
3584
|
}, [Be, t, ae, ke]);
|
|
3584
|
-
L.current =
|
|
3585
|
+
L.current = Q;
|
|
3585
3586
|
const we = x((a) => ke(a + X), [ke, X]), He = f(y);
|
|
3586
3587
|
He.current = y;
|
|
3587
|
-
const $e = y !== void 0, be = Ie(() => $e ? (a) => He.current?.(a + X) : void 0, [X, $e]), Ue =
|
|
3588
|
+
const $e = y !== void 0, be = Ie(() => $e ? (a) => He.current?.(a + X) : void 0, [X, $e]), Ue = m, Ge = Q, [pt, gt] = De(X), Ze = f(null), Ot = f(!1);
|
|
3588
3589
|
if (pt !== X) {
|
|
3589
3590
|
gt(X), Ot.current = !0;
|
|
3590
3591
|
const a = le.current?.getScrollAnchor() ?? null;
|
|
@@ -3601,10 +3602,10 @@ const Ni = 1e4, Ji = () => {
|
|
|
3601
3602
|
const a = me.getTotal();
|
|
3602
3603
|
typeof a == "number" && Number.isFinite(a) && a !== Ae.current && Te(a);
|
|
3603
3604
|
});
|
|
3604
|
-
const Ve =
|
|
3605
|
+
const Ve = J?.width ?? 12, Nt = G === void 0 ? null : { width: Math.max(0, Math.round(G.width) - Ve), height: Math.max(0, Math.round(G.height) - Ve) }, [Ut, qt] = De({ width: 0, height: 0 }), Ce = Nt ?? Ut, Vt = f(Ce);
|
|
3605
3606
|
Vt.current = Ce;
|
|
3606
|
-
const
|
|
3607
|
-
Ee.current =
|
|
3607
|
+
const fr = Ce.height > 0 && Ce.height - m - Q <= 0;
|
|
3608
|
+
Ee.current = fr;
|
|
3608
3609
|
const cr = Nt !== null;
|
|
3609
3610
|
tt(() => {
|
|
3610
3611
|
if (cr)
|
|
@@ -3651,10 +3652,10 @@ const Ni = 1e4, Ji = () => {
|
|
|
3651
3652
|
R.current = ee;
|
|
3652
3653
|
const z = f(null), [ge, qe] = De(null), [Ne, Rt] = De(Ce.height);
|
|
3653
3654
|
Ne !== Ce.height && (Rt(Ce.height), qe(null));
|
|
3654
|
-
const xt = D === void 0 || t === 0 ? 0 : ne(Math.trunc(D.row), 0, t - 1),
|
|
3655
|
+
const xt = D === void 0 || t === 0 ? 0 : ne(Math.trunc(D.row), 0, t - 1), hr = Ie(() => {
|
|
3655
3656
|
const a = z.current?.renderingStartIndex ?? xt;
|
|
3656
3657
|
return $i(Math.max(0, Ce.height - Mt.current - L.current), ke, t, a, I);
|
|
3657
|
-
}, [Ce.height, ke, t, xt, I, Ue, Ge]), Ft = ge ??
|
|
3658
|
+
}, [Ce.height, ke, t, xt, I, Ue, Ge]), Ft = ge ?? hr, kt = x(() => {
|
|
3658
3659
|
const a = z.current;
|
|
3659
3660
|
if (a === null)
|
|
3660
3661
|
return null;
|
|
@@ -3689,14 +3690,14 @@ const Ni = 1e4, Ji = () => {
|
|
|
3689
3690
|
ot.current = Se.colAnchor, dt(), Jt();
|
|
3690
3691
|
}, [Se, dt, Jt]), tt(() => {
|
|
3691
3692
|
z.current !== null && Jt();
|
|
3692
|
-
}, [
|
|
3693
|
-
const
|
|
3693
|
+
}, [m, Q, Jt]);
|
|
3694
|
+
const It = f(null), Pt = x(
|
|
3694
3695
|
(a) => {
|
|
3695
3696
|
const p = ne(a.col, 0, Math.max(0, e - 1)), T = me.prefixSum(p, { materializeOption: { materialize: !1 } }), F = T.cumulative - T.currentValue, he = T.currentValue, st = _t();
|
|
3696
3697
|
return (a.alignX === "end" ? F + he - oe.current - st : a.alignX === "center" ? F + he / 2 - oe.current - st / 2 : F - oe.current) + a.offsetX;
|
|
3697
3698
|
},
|
|
3698
3699
|
[me, e, _t]
|
|
3699
|
-
), vt = f(null),
|
|
3700
|
+
), vt = f(null), yt = x(() => {
|
|
3700
3701
|
const a = vt.current;
|
|
3701
3702
|
vt.current = null, !(a === null || a.length === 0) && (Te(me.updates(a)), se((p) => p + 1));
|
|
3702
3703
|
}, [me, Te]), Dt = f({ count: 0, warned: !1 }), { frozenColumns: wt, frozenWidth: Et } = Ie(() => {
|
|
@@ -3708,11 +3709,11 @@ const Ni = 1e4, Ji = () => {
|
|
|
3708
3709
|
F.count >= Kr ? F.warned || (F.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the frozen band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
|
|
3709
3710
|
frozenCols: Me,
|
|
3710
3711
|
pendingUpdates: p.length
|
|
3711
|
-
})) : (F.count += 1, vt.current = [...vt.current ?? [], ...p], Promise.resolve().then(
|
|
3712
|
+
})) : (F.count += 1, vt.current = [...vt.current ?? [], ...p], Promise.resolve().then(yt));
|
|
3712
3713
|
} else
|
|
3713
3714
|
Dt.current.count = 0, Dt.current.warned = !1;
|
|
3714
3715
|
return { frozenColumns: a, frozenWidth: T };
|
|
3715
|
-
}, [Me, zt, lt, me,
|
|
3716
|
+
}, [Me, zt, lt, me, yt]);
|
|
3716
3717
|
oe.current = Et, tt(() => {
|
|
3717
3718
|
Me > 0 ? Fe.current?.style.setProperty("--aqvs-grid-frozen-width", `${Et}px`) : Fe.current?.style.removeProperty("--aqvs-grid-frozen-width");
|
|
3718
3719
|
}, [Et, Me]);
|
|
@@ -3725,32 +3726,32 @@ const Ni = 1e4, Ji = () => {
|
|
|
3725
3726
|
F.count >= Kr ? F.warned || (F.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the trailing band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
|
|
3726
3727
|
trailingCols: re,
|
|
3727
3728
|
pendingUpdates: p.length
|
|
3728
|
-
})) : (F.count += 1, vt.current = [...vt.current ?? [], ...p], Promise.resolve().then(
|
|
3729
|
+
})) : (F.count += 1, vt.current = [...vt.current ?? [], ...p], Promise.resolve().then(yt));
|
|
3729
3730
|
} else
|
|
3730
3731
|
nr.current.count = 0, nr.current.warned = !1;
|
|
3731
3732
|
return { trailingColumns: a, trailingWidth: T };
|
|
3732
|
-
}, [re, e, zt, lt, me,
|
|
3733
|
+
}, [re, e, zt, lt, me, yt]);
|
|
3733
3734
|
Ke.current = At, tt(() => {
|
|
3734
3735
|
re > 0 ? Fe.current?.style.setProperty("--aqvs-grid-trailing-width", `${At}px`) : Fe.current?.style.removeProperty("--aqvs-grid-trailing-width");
|
|
3735
3736
|
}, [At, re]);
|
|
3736
|
-
const Sr = Ie(() => ({ ...
|
|
3737
|
+
const Sr = Ie(() => ({ ...J, tapScrollCircleOptions: { ...J?.tapScrollCircleOptions, enabled: !1 } }), [J]), Ht = J?.tapScrollCircleOptions, mr = typeof Ht?.maxSpeedMultiplier == "number", pr = Ie(
|
|
3737
3738
|
() => ({
|
|
3738
3739
|
...Ht,
|
|
3739
3740
|
offsetX: Ht?.offsetX === void 0 ? bn : Ht.offsetX,
|
|
3740
3741
|
offsetY: Ht?.offsetY === void 0 ? bn : Ht.offsetY
|
|
3741
3742
|
}),
|
|
3742
3743
|
[Ht]
|
|
3743
|
-
), at = Ie(() => en(
|
|
3744
|
+
), at = Ie(() => en(pr, Math.max(0, e - Me - re)), [pr, e, Me, re]), Mr = Ie(() => en(pr, N), [pr, N]), Tr = at.enabled, Ir = Math.max(at.maxVisualDistance, 1), ir = {
|
|
3744
3745
|
viewportSize: Math.max(0, Ce.width - Et - At),
|
|
3745
3746
|
minSpeedMultiplier: at.minSpeedMultiplier,
|
|
3746
3747
|
maxSpeedMultiplier: at.maxSpeedMultiplier,
|
|
3747
|
-
hasCustomMaxSpeedMultiplier:
|
|
3748
|
+
hasCustomMaxSpeedMultiplier: mr,
|
|
3748
3749
|
curve: at.maxSpeedCurve
|
|
3749
|
-
},
|
|
3750
|
-
viewportSize: Math.max(0, Ce.height -
|
|
3750
|
+
}, gr = {
|
|
3751
|
+
viewportSize: Math.max(0, Ce.height - m - Q),
|
|
3751
3752
|
minSpeedMultiplier: Mr.minSpeedMultiplier,
|
|
3752
3753
|
maxSpeedMultiplier: Mr.maxSpeedMultiplier,
|
|
3753
|
-
hasCustomMaxSpeedMultiplier:
|
|
3754
|
+
hasCustomMaxSpeedMultiplier: mr,
|
|
3754
3755
|
curve: Mr.maxSpeedCurve
|
|
3755
3756
|
}, lr = x(() => ze.current, []), qr = x(() => {
|
|
3756
3757
|
const a = le.current;
|
|
@@ -3767,23 +3768,23 @@ const Ni = 1e4, Ji = () => {
|
|
|
3767
3768
|
return pe.current;
|
|
3768
3769
|
const T = p.scrollBy(a);
|
|
3769
3770
|
return pe.current = T, T;
|
|
3770
|
-
}, []),
|
|
3771
|
-
enabled: Tr &&
|
|
3771
|
+
}, []), h = Gt() > 0 || yr() > 0, b = `${Qe}:${Et}:${At}:${Ce.width}:${Se.key}`, q = `${t}:${ge ?? -1}:${m}:${Q}:${Ce.height}`, { isTapActive: _, handleTapCircleDragChange: B, tapCircleHandleRef: U } = Vi({
|
|
3772
|
+
enabled: Tr && h,
|
|
3772
3773
|
maxDistance: Ir,
|
|
3773
3774
|
xSpeedParams: ir,
|
|
3774
|
-
ySpeedParams:
|
|
3775
|
+
ySpeedParams: gr,
|
|
3775
3776
|
applyHxRef: ft,
|
|
3776
3777
|
getHx: lr,
|
|
3777
3778
|
getMaxHx: Gt,
|
|
3778
3779
|
applyVy: c,
|
|
3779
3780
|
getVy: qr,
|
|
3780
3781
|
getMaxVy: yr,
|
|
3781
|
-
pendingColAnchorRef:
|
|
3782
|
+
pendingColAnchorRef: It,
|
|
3782
3783
|
xExtentFreshness: b,
|
|
3783
3784
|
yExtentFreshness: q
|
|
3784
3785
|
}), ve = Ie(() => ne((_ ? 1 : 0.8) * at.opacity, 0, 1), [_, at.opacity]);
|
|
3785
3786
|
tt(() => {
|
|
3786
|
-
const a =
|
|
3787
|
+
const a = It.current;
|
|
3787
3788
|
a === null ? ft.current(ze.current) : ft.current(Pt(a)), jt();
|
|
3788
3789
|
}, [Ce.width, Qe, zt, Et, At, jt, Pt]);
|
|
3789
3790
|
const Oe = f(!1);
|
|
@@ -3795,7 +3796,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3795
3796
|
if (a < Me || a >= e - re)
|
|
3796
3797
|
return;
|
|
3797
3798
|
const p = { col: a, alignX: "start", offsetX: Math.max(0, D.offsetX) };
|
|
3798
|
-
|
|
3799
|
+
It.current = p, ft.current(Pt(p));
|
|
3799
3800
|
}, [D, e, Pt, Me, re]);
|
|
3800
3801
|
const _e = x((a) => {
|
|
3801
3802
|
pe.current = a, Re.current = !0, Qt.current?.({ x: ze.current, y: a });
|
|
@@ -3821,7 +3822,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3821
3822
|
},
|
|
3822
3823
|
[Jt, X, N, t]
|
|
3823
3824
|
), ht = x((a) => {
|
|
3824
|
-
|
|
3825
|
+
It.current = null, ft.current(ze.current + a);
|
|
3825
3826
|
}, []), it = Hi(Y, Ft + Lt.length + Z.length), Je = f({ count: 0, warned: !1 }), { placedColumns: $t, truncatedCols: sr } = Ie(() => {
|
|
3826
3827
|
const a = Math.max(0, Ce.width - Et - At);
|
|
3827
3828
|
if (e === 0 || a <= 0)
|
|
@@ -3834,11 +3835,11 @@ const Ni = 1e4, Ji = () => {
|
|
|
3834
3835
|
st.count >= Kr ? st.warned || (st.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values; width self-heal is suspended until a converged (zero-deviation) pass re-arms it (unstable accessor — the accessor must be index-stable while the ordering is unchanged).", {
|
|
3835
3836
|
window: Se.key,
|
|
3836
3837
|
pendingUpdates: F.length
|
|
3837
|
-
})) : (st.count += 1, vt.current = [...vt.current ?? [], ...F], Promise.resolve().then(
|
|
3838
|
+
})) : (st.count += 1, vt.current = [...vt.current ?? [], ...F], Promise.resolve().then(yt));
|
|
3838
3839
|
} else
|
|
3839
3840
|
Je.current.count = 0, Je.current.warned = !1;
|
|
3840
3841
|
return { placedColumns: T, truncatedCols: he };
|
|
3841
|
-
}, [Se, e, Ce.width, Et, At, wt.length, er.length, zt, lt, me, it,
|
|
3842
|
+
}, [Se, e, Ce.width, Et, At, wt.length, er.length, zt, lt, me, it, yt]), Dr = f("");
|
|
3842
3843
|
k(() => {
|
|
3843
3844
|
if (sr > 0) {
|
|
3844
3845
|
const a = `${Se.key}:${sr}`;
|
|
@@ -3847,32 +3848,32 @@ const Ni = 1e4, Ji = () => {
|
|
|
3847
3848
|
}, [sr, Se.key, $t.length, wt.length, er.length, Ft, Lt.length, Z.length]);
|
|
3848
3849
|
const on = Se.colAnchor, Yr = x(
|
|
3849
3850
|
(a) => {
|
|
3850
|
-
const p = d?.(a), T = ke(a) === 0, F = T ? null : $t.map(({ col: he, left: st, width:
|
|
3851
|
-
const Xt = u?.(a, he), Rr = { ...Xt?.style, left: st - on, width:
|
|
3851
|
+
const p = d?.(a), T = ke(a) === 0, F = T ? null : $t.map(({ col: he, left: st, width: xr }) => {
|
|
3852
|
+
const Xt = u?.(a, he), Rr = { ...Xt?.style, left: st - on, width: xr };
|
|
3852
3853
|
return /* @__PURE__ */ Wr("div", { ...Xt, key: s ? s(a, he) : he, className: Ct("aqvs-grid-cell", Xt?.className), style: Rr }, o(i(a, he), a, he));
|
|
3853
3854
|
});
|
|
3854
3855
|
return Me === 0 && re === 0 ? /* @__PURE__ */ K("div", { ...p, className: Ct("aqvs-grid-row", p?.className), style: p?.style, children: F }) : /* @__PURE__ */ Bt("div", { ...p, "data-aqvs-frozen-row": Me > 0 ? "" : void 0, className: Ct("aqvs-grid-row aqvs-grid-row-frozen-host", p?.className), style: p?.style, children: [
|
|
3855
|
-
T ? null : wt.map(({ col: he, left: st, width:
|
|
3856
|
-
const Xt = u?.(a, he), Rr = { ...Xt?.style, left: st, width:
|
|
3856
|
+
T ? null : wt.map(({ col: he, left: st, width: xr }) => {
|
|
3857
|
+
const Xt = u?.(a, he), Rr = { ...Xt?.style, left: st, width: xr };
|
|
3857
3858
|
return /* @__PURE__ */ Wr("div", { ...Xt, "data-aqvs-frozen-cell": "", key: s ? s(a, he) : he, className: Ct("aqvs-grid-cell", Xt?.className), style: Rr }, o(i(a, he), a, he));
|
|
3858
3859
|
}),
|
|
3859
3860
|
T ? null : /* @__PURE__ */ K("div", { className: "aqvs-grid-row-scroll", children: /* @__PURE__ */ K("div", { className: "aqvs-grid-row-scroll-inner", children: F }) }),
|
|
3860
|
-
T || re === 0 ? null : /* @__PURE__ */ K("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ K("div", { className: "aqvs-grid-row-trailing-inner", children: er.map(({ col: he, left: st, width:
|
|
3861
|
-
const Xt = u?.(a, he), Rr = { ...Xt?.style, left: st, width:
|
|
3861
|
+
T || re === 0 ? null : /* @__PURE__ */ K("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ K("div", { className: "aqvs-grid-row-trailing-inner", children: er.map(({ col: he, left: st, width: xr }) => {
|
|
3862
|
+
const Xt = u?.(a, he), Rr = { ...Xt?.style, left: st, width: xr };
|
|
3862
3863
|
return /* @__PURE__ */ Wr("div", { ...Xt, "data-aqvs-trailing-cell": "", key: s ? s(a, he) : he, className: Ct("aqvs-grid-cell", Xt?.className), style: Rr }, o(i(a, he), a, he));
|
|
3863
3864
|
}) }) })
|
|
3864
3865
|
] });
|
|
3865
3866
|
},
|
|
3866
3867
|
[$t, wt, er, Me, re, on, d, u, s, i, o, ke]
|
|
3867
|
-
), [Xn, qn] = De(""),
|
|
3868
|
+
), [Xn, qn] = De(""), br = f(null), an = f(xe);
|
|
3868
3869
|
an.current = xe;
|
|
3869
3870
|
const Lr = x(() => {
|
|
3870
3871
|
const a = an.current;
|
|
3871
3872
|
if (a === void 0)
|
|
3872
3873
|
return;
|
|
3873
3874
|
const p = a.debounceMs ?? 400;
|
|
3874
|
-
Number.isFinite(p) && p >= 0 && (
|
|
3875
|
-
|
|
3875
|
+
Number.isFinite(p) && p >= 0 && (br.current !== null && window.clearTimeout(br.current), br.current = window.setTimeout(() => {
|
|
3876
|
+
br.current = null;
|
|
3876
3877
|
const T = kt();
|
|
3877
3878
|
T !== null && qn((F) => {
|
|
3878
3879
|
const he = a.buildMessage(T);
|
|
@@ -3884,7 +3885,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3884
3885
|
ln && !cn && V.warn(`[VirtualGrid] liveRegion.debounceMs must be a finite number >= 0, received ${Or}. Announcements are disabled.`);
|
|
3885
3886
|
}, [ln, cn, Or]), k(
|
|
3886
3887
|
() => () => {
|
|
3887
|
-
|
|
3888
|
+
br.current !== null && window.clearTimeout(br.current);
|
|
3888
3889
|
},
|
|
3889
3890
|
[]
|
|
3890
3891
|
), k(() => {
|
|
@@ -3904,14 +3905,14 @@ const Ni = 1e4, Ji = () => {
|
|
|
3904
3905
|
let T = pe.current;
|
|
3905
3906
|
a.y !== void 0 && p !== null && (p.scrollTo(a.y), T = p.getScrollPosition(), pe.current = T);
|
|
3906
3907
|
let F = ze.current;
|
|
3907
|
-
return a.x !== void 0 && (
|
|
3908
|
+
return a.x !== void 0 && (It.current = null, F = ft.current(a.x)), { x: F, y: T };
|
|
3908
3909
|
},
|
|
3909
3910
|
scrollBy: (a) => {
|
|
3910
3911
|
const p = le.current;
|
|
3911
3912
|
let T = pe.current;
|
|
3912
3913
|
a.y !== void 0 && a.y !== 0 && p !== null && (T = p.scrollBy(a.y), pe.current = T);
|
|
3913
3914
|
let F = ze.current;
|
|
3914
|
-
return a.x !== void 0 && a.x !== 0 && (
|
|
3915
|
+
return a.x !== void 0 && a.x !== 0 && (It.current = null, F = ft.current(ze.current + a.x)), { x: F, y: T };
|
|
3915
3916
|
},
|
|
3916
3917
|
scrollToCell: (a, p, T) => {
|
|
3917
3918
|
const F = le.current;
|
|
@@ -3923,7 +3924,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3923
3924
|
const he = ne(Math.trunc(p), 0, e - 1);
|
|
3924
3925
|
if (he >= Me && he < e - re) {
|
|
3925
3926
|
const st = { col: he, alignX: T?.alignX ?? "start", offsetX: T?.offsetX ?? 0 };
|
|
3926
|
-
|
|
3927
|
+
It.current = st, ft.current(Pt(st));
|
|
3927
3928
|
}
|
|
3928
3929
|
}
|
|
3929
3930
|
},
|
|
@@ -3978,7 +3979,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
3978
3979
|
// 凍結行帯 (行凍結設計 §4-2): グリッド所有の帯外バンド — 行本体は renderRow を
|
|
3979
3980
|
// そのまま再利用する (F > 0 の凍結セル / クリップ / hx 残差 var は継承で無償追随
|
|
3980
3981
|
// = 4 象限コーナーの成立点)。top は木絶対プレフィックス、高さ 0 行は DOM 非生成
|
|
3981
|
-
/* @__PURE__ */ K("div", { className: "aqvs-grid-frozen-rows", style: { height:
|
|
3982
|
+
/* @__PURE__ */ K("div", { className: "aqvs-grid-frozen-rows", style: { height: m }, "data-testid": ce ? `${ce}-frozen-rows` : void 0, children: Lt.map(({ row: a, top: p, height: T }) => (
|
|
3982
3983
|
// 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README
|
|
3983
3984
|
// 「Composite widget roles」) の所有物で、パッケージが既定 role を課すと衝突する。
|
|
3984
3985
|
// フォーカス結線は focusRowAtIndex ↔ onRowFocus 往復のバンド版そのもの。右インセット
|
|
@@ -3992,12 +3993,12 @@ const Ni = 1e4, Ji = () => {
|
|
|
3992
3993
|
Fi,
|
|
3993
3994
|
{
|
|
3994
3995
|
ref: le,
|
|
3995
|
-
itemCount:
|
|
3996
|
+
itemCount: fr ? 0 : N,
|
|
3996
3997
|
getItem: (a) => a + X,
|
|
3997
3998
|
getItemKey: (a) => a + X,
|
|
3998
3999
|
getItemHeight: we,
|
|
3999
4000
|
overscanCount: I,
|
|
4000
|
-
viewportSize: Ce.height > 0 ? Math.max(0, Ce.height -
|
|
4001
|
+
viewportSize: Ce.height > 0 ? Math.max(0, Ce.height - m - Q) : void 0,
|
|
4001
4002
|
callbackThrottleMs: O,
|
|
4002
4003
|
behaviorOptions: te,
|
|
4003
4004
|
scrollBarOptions: Sr,
|
|
@@ -4031,7 +4032,7 @@ const Ni = 1e4, Ji = () => {
|
|
|
4031
4032
|
// inner はインライン木高 H_T の bottom 定着 — 帯上端 = extent − H_T_vis が全構成で
|
|
4032
4033
|
// 成立し、重複縮退では帯の**末尾**行が可視に残る。行本体は renderRow 逐語再利用
|
|
4033
4034
|
// (先頭列 / 末尾列の帯構造を継承し 4 象限コーナー全種が無償で成立)
|
|
4034
|
-
/* @__PURE__ */ K("div", { className: "aqvs-grid-trailing-rows", style: { height: Hr(
|
|
4035
|
+
/* @__PURE__ */ K("div", { className: "aqvs-grid-trailing-rows", style: { height: Hr(Q, m, Ce.height) }, "data-testid": ce ? `${ce}-trailing-rows` : void 0, children: /* @__PURE__ */ K("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: Q }, children: Z.map(({ row: a, top: p, height: T }) => (
|
|
4035
4036
|
// 帯行は帯ローカル top + right: scrollBarWidth (縦バーコーナーの予約 — 先頭帯行と
|
|
4036
4037
|
// 同文) + tabIndex −1 + onFocus フル行 index (focusRowAtIndex ↔ onRowFocus 往復)。
|
|
4037
4038
|
// biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (先頭帯行と同文)
|
|
@@ -4046,18 +4047,18 @@ const Ni = 1e4, Ji = () => {
|
|
|
4046
4047
|
viewportSize: Math.max(0, Ce.width - Et - At),
|
|
4047
4048
|
scrollPosition: Kt,
|
|
4048
4049
|
itemCount: Math.max(0, e - Me - re),
|
|
4049
|
-
tapScrollCircleOptions:
|
|
4050
|
-
onScroll: (a, p) => (
|
|
4051
|
-
enableThumbDrag:
|
|
4052
|
-
enableTrackClick:
|
|
4053
|
-
enableArrowButtons:
|
|
4054
|
-
enableArrowButtonTabStops:
|
|
4050
|
+
tapScrollCircleOptions: J?.tapScrollCircleOptions,
|
|
4051
|
+
onScroll: (a, p) => (It.current = null, ft.current(typeof a == "function" ? a(p ?? ze.current) : a)),
|
|
4052
|
+
enableThumbDrag: J?.enableThumbDrag,
|
|
4053
|
+
enableTrackClick: J?.enableTrackClick,
|
|
4054
|
+
enableArrowButtons: J?.enableArrowButtons,
|
|
4055
|
+
enableArrowButtonTabStops: J?.enableArrowButtonTabStops,
|
|
4055
4056
|
scrollBarWidth: Ve,
|
|
4056
4057
|
locale: rt,
|
|
4057
4058
|
labels: P
|
|
4058
4059
|
}
|
|
4059
4060
|
) }),
|
|
4060
|
-
Tr &&
|
|
4061
|
+
Tr && h && // 統合 2 軸タップサークルの 3 アーム配置則: (C) 可視上限
|
|
4061
4062
|
// `100% − (sbw + size)` / (R) 到達性 `100% − sbw + off` / (Q) 遠象限床
|
|
4062
4063
|
// `75% − size/2`。全アームが root 寸・sbw・size・オフセットのみに依存 —
|
|
4063
4064
|
// 帯幅非依存 (凍結トグル不変)。wrapper は純配置で transition を持たない
|