@aiquants/virtualscroll 1.18.2 → 1.18.3
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/README.md +30 -16
- package/dist/ScrollBar.d.cts +100 -0
- package/dist/ScrollBar.d.ts.map +1 -0
- package/dist/ScrollPane.d.cts +93 -0
- package/dist/ScrollPane.d.ts.map +1 -0
- package/dist/TapScrollCircle.d.cts +62 -0
- package/dist/TapScrollCircle.d.ts.map +1 -0
- package/dist/VirtualScroll.d.cts +155 -0
- package/dist/{src/VirtualScroll.d.ts → VirtualScroll.d.ts} +46 -3
- package/dist/VirtualScroll.d.ts.map +1 -0
- package/dist/cli.js +97 -24
- package/dist/cli.server.d.cts +13 -0
- package/dist/cli.server.d.ts +14 -0
- package/dist/cli.server.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/{src/index.d.ts → index.d.cts} +9 -10
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1862 -1352
- package/dist/{src/logger.d.ts → logger.d.cts} +48 -1
- package/dist/logger.d.ts +146 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/tapScrollCircleSampleVisual.d.cts +2 -0
- package/dist/tapScrollCircleSampleVisual.d.ts.map +1 -0
- package/dist/{src/useFenwickMapTree.d.ts → useFenwickMapTree.d.cts} +138 -16
- package/dist/useFenwickMapTree.d.ts +451 -0
- package/dist/useFenwickMapTree.d.ts.map +1 -0
- package/dist/useHeightCache.d.cts +15 -0
- package/dist/useHeightCache.d.ts.map +1 -0
- package/dist/{src/useLruCache.d.ts → useLruCache.d.cts} +8 -2
- package/dist/useLruCache.d.ts +24 -0
- package/dist/useLruCache.d.ts.map +1 -0
- package/dist/{src/utils.d.ts → utils.d.cts} +3 -1
- package/dist/utils.d.ts +15 -0
- package/dist/{src/utils.d.ts.map → utils.d.ts.map} +1 -1
- package/package.json +12 -6
- package/dist/src/ScrollBar.d.ts.map +0 -1
- package/dist/src/ScrollPane.d.ts.map +0 -1
- package/dist/src/TapScrollCircle.d.ts.map +0 -1
- package/dist/src/VirtualScroll.d.ts.map +0 -1
- package/dist/src/cli.server.d.ts +0 -2
- package/dist/src/cli.server.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/logger.d.ts.map +0 -1
- package/dist/src/tapScrollCircleSampleVisual.d.ts.map +0 -1
- package/dist/src/useFenwickMapTree.d.ts.map +0 -1
- package/dist/src/useHeightCache.d.ts.map +0 -1
- package/dist/src/useLruCache.d.ts.map +0 -1
- package/dist/virtualscroll.css +0 -1
- package/dist/vite.config.d.ts +0 -3
- package/dist/vite.config.d.ts.map +0 -1
- /package/dist/{src/ScrollBar.d.ts → ScrollBar.d.ts} +0 -0
- /package/dist/{src/ScrollPane.d.ts → ScrollPane.d.ts} +0 -0
- /package/dist/{src/TapScrollCircle.d.ts → TapScrollCircle.d.ts} +0 -0
- /package/dist/{src/tapScrollCircleSampleVisual.d.ts → tapScrollCircleSampleVisual.d.ts} +0 -0
- /package/dist/{src/useHeightCache.d.ts → useHeightCache.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { twMerge as
|
|
4
|
-
class
|
|
1
|
+
import { jsx as et, jsxs as le, Fragment as Ke } from "react/jsx-runtime";
|
|
2
|
+
import Qe, { memo as tr, forwardRef as Fe, useState as Ut, useRef as b, useCallback as y, useImperativeHandle as ke, useMemo as yt, useLayoutEffect as pe, useEffect as X, useId as er } from "react";
|
|
3
|
+
import { twMerge as ae } from "tailwind-merge";
|
|
4
|
+
class V {
|
|
5
5
|
level;
|
|
6
6
|
prefix;
|
|
7
7
|
impl;
|
|
@@ -14,7 +14,7 @@ class _ {
|
|
|
14
14
|
constructor(t = 2, e = "[virtualscroll]", r = console) {
|
|
15
15
|
this.level = t, this.prefix = e, this.impl = r;
|
|
16
16
|
}
|
|
17
|
-
static instance = new
|
|
17
|
+
static instance = new V(2, "[virtualscroll]");
|
|
18
18
|
/**
|
|
19
19
|
* @method setLevel
|
|
20
20
|
* @description Updates the current log level for the static instance.
|
|
@@ -22,7 +22,7 @@ class _ {
|
|
|
22
22
|
* @param {LogLevel} level - The new log level.
|
|
23
23
|
*/
|
|
24
24
|
static setLevel(t) {
|
|
25
|
-
|
|
25
|
+
V.instance.setLevel(t);
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* @method setLevel
|
|
@@ -40,7 +40,7 @@ class _ {
|
|
|
40
40
|
* @param {ILogger} impl - The new logger implementation.
|
|
41
41
|
*/
|
|
42
42
|
static setImplementation(t) {
|
|
43
|
-
|
|
43
|
+
V.instance.setImplementation(t);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* @method setImplementation
|
|
@@ -58,7 +58,7 @@ class _ {
|
|
|
58
58
|
* @param {string} prefix - The new prefix.
|
|
59
59
|
*/
|
|
60
60
|
static setPrefix(t) {
|
|
61
|
-
|
|
61
|
+
V.instance.setPrefix(t);
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* @method setPrefix
|
|
@@ -69,45 +69,94 @@ class _ {
|
|
|
69
69
|
setPrefix(t) {
|
|
70
70
|
this.prefix = t;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* @method isEnabled
|
|
74
|
+
* @description Returns whether the given level would be emitted at the current level (static instance).
|
|
75
|
+
* @description 指定したレベルが現在のログレベルで出力されるかどうかを返します(静的インスタンス)。
|
|
76
|
+
* @param {LogLevel} level - The level to query. / 問い合わせるレベル。
|
|
77
|
+
* @returns {boolean} True if a message at `level` would be emitted. / `level` のメッセージが出力されるなら true。
|
|
78
|
+
*/
|
|
79
|
+
static isEnabled(t) {
|
|
80
|
+
return V.instance.isEnabled(t);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @method isEnabled
|
|
84
|
+
* @description Returns whether the given level would be emitted at the current level.
|
|
85
|
+
* @description 指定したレベルが現在のログレベルで出力されるかどうかを返します。
|
|
86
|
+
*
|
|
87
|
+
* ホットパスで呼び出し側が引数(オブジェクト生成・DOM 読み取り等)を組み立てる前に
|
|
88
|
+
* ガードするために使う。抑制時は引数評価を丸ごと省ける。
|
|
89
|
+
*
|
|
90
|
+
* @param {LogLevel} level - The level to query. / 問い合わせるレベル。
|
|
91
|
+
* @returns {boolean} True if a message at `level` would be emitted. / `level` のメッセージが出力されるなら true。
|
|
92
|
+
*/
|
|
93
|
+
isEnabled(t) {
|
|
94
|
+
return this.level <= t;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Resolves a possibly-lazy log argument.
|
|
98
|
+
* If the argument is a function it is treated as a thunk and invoked only when the
|
|
99
|
+
* level is enabled; if the invocation throws (class constructors cannot be called
|
|
100
|
+
* without `new`, or the thunk itself fails), the original function value is
|
|
101
|
+
* returned as-is so the log call never crashes the caller and still emits something.
|
|
102
|
+
* To log a function as a value, wrap it as `() => fn`.
|
|
103
|
+
* 遅延評価される可能性のあるログ引数を解決する処理。
|
|
104
|
+
*
|
|
105
|
+
* 関数が渡された場合はサンク (thunk) とみなし、レベルが有効なとき「だけ」呼び出す。
|
|
106
|
+
* これにより呼び出し側は `logger.debug(() => ({ ...expensive }))` のように書け、
|
|
107
|
+
* レベル抑制時にはオブジェクト生成や DOM 読み取りを回避できる。
|
|
108
|
+
* 呼び出しが throw した場合 (class は `new` なしで呼べず TypeError、または thunk 自体の失敗) は、
|
|
109
|
+
* ログ呼び出しが呼び出し元をクラッシュさせないよう元の関数値をそのまま返す (握り潰さず出力は残る)。
|
|
110
|
+
* 関数を値としてログしたい場合は `() => fn` とラップする。非関数値はそのまま素通しするため後方互換。
|
|
111
|
+
*/
|
|
112
|
+
static resolveLazy(t) {
|
|
113
|
+
if (typeof t != "function")
|
|
114
|
+
return t;
|
|
115
|
+
try {
|
|
116
|
+
return t();
|
|
117
|
+
} catch {
|
|
118
|
+
return t;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
72
121
|
formatMessage(t) {
|
|
73
122
|
return typeof t == "string" ? [`${this.prefix} ${t}`] : [this.prefix, t];
|
|
74
123
|
}
|
|
75
124
|
static debug(t, ...e) {
|
|
76
|
-
|
|
125
|
+
V.instance.debug(t, ...e);
|
|
77
126
|
}
|
|
78
127
|
debug(t, ...e) {
|
|
79
|
-
this.level <= 0 && this.impl.debug(...this.formatMessage(t), ...e);
|
|
128
|
+
this.level <= 0 && this.impl.debug(...this.formatMessage(V.resolveLazy(t)), ...e.map(V.resolveLazy));
|
|
80
129
|
}
|
|
81
130
|
static info(t, ...e) {
|
|
82
|
-
|
|
131
|
+
V.instance.info(t, ...e);
|
|
83
132
|
}
|
|
84
133
|
info(t, ...e) {
|
|
85
|
-
this.level <= 1 && this.impl.info(...this.formatMessage(t), ...e);
|
|
134
|
+
this.level <= 1 && this.impl.info(...this.formatMessage(V.resolveLazy(t)), ...e.map(V.resolveLazy));
|
|
86
135
|
}
|
|
87
136
|
static warn(t, ...e) {
|
|
88
|
-
|
|
137
|
+
V.instance.warn(t, ...e);
|
|
89
138
|
}
|
|
90
139
|
warn(t, ...e) {
|
|
91
|
-
this.level <= 2 && this.impl.warn(...this.formatMessage(t), ...e);
|
|
140
|
+
this.level <= 2 && this.impl.warn(...this.formatMessage(V.resolveLazy(t)), ...e.map(V.resolveLazy));
|
|
92
141
|
}
|
|
93
142
|
static error(t, ...e) {
|
|
94
|
-
|
|
143
|
+
V.instance.error(t, ...e);
|
|
95
144
|
}
|
|
96
145
|
error(t, ...e) {
|
|
97
|
-
this.level <= 3 && this.impl.error(...this.formatMessage(t), ...e);
|
|
146
|
+
this.level <= 3 && this.impl.error(...this.formatMessage(V.resolveLazy(t)), ...e.map(V.resolveLazy));
|
|
98
147
|
}
|
|
99
148
|
}
|
|
100
|
-
const
|
|
149
|
+
const Ye = {
|
|
101
150
|
active: !1,
|
|
102
151
|
offsetX: 0,
|
|
103
152
|
offsetY: 0,
|
|
104
153
|
distance: 0,
|
|
105
154
|
direction: 0,
|
|
106
155
|
pointerId: null
|
|
107
|
-
},
|
|
108
|
-
const e = 1 + t * 0.18, r = 0.16 + t * 0.24,
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
156
|
+
}, Ae = 6, rr = 8, nr = ({ dragState: i, normalizedDistance: t }) => {
|
|
157
|
+
const e = 1 + t * 0.18, r = 0.16 + t * 0.24, n = 0.38 + t * 0.28, s = i.active ? "80ms ease-out" : "220ms ease";
|
|
158
|
+
return /* @__PURE__ */ le(Ke, { children: [
|
|
159
|
+
/* @__PURE__ */ et(
|
|
111
160
|
"div",
|
|
112
161
|
{
|
|
113
162
|
className: "aqvs-tap-scroll-circle-visual-outer",
|
|
@@ -115,126 +164,166 @@ const Ve = {
|
|
|
115
164
|
background: "linear-gradient(140deg, rgba(255,255,255,0.62), rgba(72,72,72,0.48))",
|
|
116
165
|
boxShadow: `0 0 0 1px rgba(255,255,255,0.28), 0 10px 22px rgba(0,0,0,${r})`,
|
|
117
166
|
transform: `scale(${e})`,
|
|
118
|
-
transition: `${
|
|
167
|
+
transition: `${s}, ${i.active ? "80ms" : "260ms"} box-shadow ease`
|
|
119
168
|
}
|
|
120
169
|
}
|
|
121
170
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ et(
|
|
123
172
|
"div",
|
|
124
173
|
{
|
|
125
174
|
className: "aqvs-tap-scroll-circle-inner",
|
|
126
175
|
style: {
|
|
127
176
|
background: "linear-gradient(140deg, rgba(255,255,255,0.72), rgba(28,28,28,0.58))",
|
|
128
177
|
boxShadow: "inset 0 4px 10px rgba(0,0,0,0.24), inset 0 0 2px rgba(255,255,255,0.55)",
|
|
129
|
-
opacity:
|
|
130
|
-
transition:
|
|
178
|
+
opacity: n,
|
|
179
|
+
transition: i.active ? "120ms opacity ease-out" : "220ms opacity ease"
|
|
131
180
|
}
|
|
132
181
|
}
|
|
133
182
|
)
|
|
134
183
|
] });
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
const [f,
|
|
138
|
-
(
|
|
139
|
-
|
|
184
|
+
}, We = tr(
|
|
185
|
+
Fe(({ onDragChange: i, className: t, maxVisualDistance: e = 160, size: r = 40, style: n, opacity: s = 1, renderVisual: l }, u) => {
|
|
186
|
+
const [f, I] = Ut(Ye), v = b(null), T = b(null), D = b({ x: 0, y: 0 }), p = b(null), z = b(0), rt = y(
|
|
187
|
+
(S) => {
|
|
188
|
+
I(S), i(S);
|
|
140
189
|
},
|
|
141
|
-
[
|
|
142
|
-
),
|
|
143
|
-
(
|
|
144
|
-
const { x:
|
|
145
|
-
let
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
active:
|
|
149
|
-
offsetX:
|
|
150
|
-
offsetY:
|
|
151
|
-
distance:
|
|
152
|
-
direction:
|
|
153
|
-
pointerId:
|
|
190
|
+
[i]
|
|
191
|
+
), W = y(
|
|
192
|
+
(S, U, j = !1) => {
|
|
193
|
+
const { x: k, y: G } = D.current, st = S - k, Mt = U - G, R = Math.abs(Mt), Dt = R < Ae ? 0 : Mt < 0 ? -1 : 1, Vt = z.current;
|
|
194
|
+
let x = Dt;
|
|
195
|
+
const Rt = Ae + rr;
|
|
196
|
+
Dt === 0 ? Vt !== 0 && R < Rt ? x = Vt : (x = 0, j || (z.current = 0)) : Dt !== Vt && Vt !== 0 && R < Rt ? x = Vt : z.current = Dt, rt({
|
|
197
|
+
active: j || R >= Ae,
|
|
198
|
+
offsetX: st,
|
|
199
|
+
offsetY: Mt,
|
|
200
|
+
distance: R,
|
|
201
|
+
direction: x,
|
|
202
|
+
pointerId: v.current
|
|
154
203
|
});
|
|
155
204
|
},
|
|
156
|
-
[
|
|
157
|
-
),
|
|
158
|
-
if (
|
|
205
|
+
[rt]
|
|
206
|
+
), ot = y((S) => {
|
|
207
|
+
if (S === null)
|
|
159
208
|
return;
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
}, []),
|
|
163
|
-
(
|
|
164
|
-
|
|
209
|
+
const U = p.current;
|
|
210
|
+
U?.hasPointerCapture(S) && U.releasePointerCapture(S);
|
|
211
|
+
}, []), nt = y(
|
|
212
|
+
(S = !1) => {
|
|
213
|
+
S && ot(v.current), v.current = null, T.current = null, z.current = 0, rt(Ye);
|
|
165
214
|
},
|
|
166
|
-
[
|
|
167
|
-
),
|
|
168
|
-
(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
215
|
+
[rt, ot]
|
|
216
|
+
), ft = y(
|
|
217
|
+
(S) => {
|
|
218
|
+
if (v.current !== null && v.current !== S.pointerId) {
|
|
219
|
+
T.current = { pointerId: S.pointerId, clientX: S.clientX, clientY: S.clientY }, S.preventDefault(), S.stopPropagation();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
S.preventDefault(), S.stopPropagation();
|
|
223
|
+
const U = p.current ?? S.currentTarget, { left: j, top: k, width: G, height: st } = U.getBoundingClientRect();
|
|
224
|
+
D.current = { x: j + G / 2, y: k + st / 2 }, v.current = S.pointerId;
|
|
225
|
+
try {
|
|
226
|
+
U.setPointerCapture(S.pointerId);
|
|
227
|
+
} catch {
|
|
228
|
+
}
|
|
229
|
+
W(S.clientX, S.clientY, !0);
|
|
230
|
+
},
|
|
231
|
+
[W]
|
|
232
|
+
), St = y(
|
|
233
|
+
(S) => {
|
|
234
|
+
if (v.current !== S.pointerId) {
|
|
235
|
+
T.current !== null && T.current.pointerId === S.pointerId && (T.current = { pointerId: S.pointerId, clientX: S.clientX, clientY: S.clientY });
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
S.preventDefault(), W(S.clientX, S.clientY);
|
|
172
239
|
},
|
|
173
|
-
[
|
|
174
|
-
),
|
|
175
|
-
(
|
|
176
|
-
|
|
240
|
+
[W]
|
|
241
|
+
), wt = y(
|
|
242
|
+
(S) => {
|
|
243
|
+
if (v.current !== S.pointerId) {
|
|
244
|
+
T.current !== null && T.current.pointerId === S.pointerId && (T.current = null);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
S.preventDefault(), S.stopPropagation();
|
|
248
|
+
const U = T.current;
|
|
249
|
+
if (T.current = null, U !== null) {
|
|
250
|
+
ot(S.pointerId);
|
|
251
|
+
const j = p.current;
|
|
252
|
+
let k = !0;
|
|
253
|
+
if (j !== null && typeof j.setPointerCapture == "function")
|
|
254
|
+
try {
|
|
255
|
+
j.setPointerCapture(U.pointerId);
|
|
256
|
+
} catch (G) {
|
|
257
|
+
(typeof G == "object" && G !== null && "name" in G ? G.name : void 0) === "NotFoundError" && (k = !1);
|
|
258
|
+
}
|
|
259
|
+
if (k) {
|
|
260
|
+
v.current = U.pointerId, W(U.clientX, U.clientY, !0);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
nt(!0);
|
|
177
265
|
},
|
|
178
|
-
[
|
|
179
|
-
),
|
|
180
|
-
(
|
|
181
|
-
|
|
266
|
+
[nt, ot, W]
|
|
267
|
+
), L = y(
|
|
268
|
+
(S) => {
|
|
269
|
+
v.current === S.pointerId && nt(!1);
|
|
182
270
|
},
|
|
183
|
-
[
|
|
271
|
+
[nt]
|
|
184
272
|
);
|
|
185
|
-
|
|
186
|
-
|
|
273
|
+
ke(
|
|
274
|
+
u,
|
|
187
275
|
() => ({
|
|
188
276
|
reset: () => {
|
|
189
|
-
|
|
277
|
+
nt(!0);
|
|
190
278
|
},
|
|
191
|
-
getElement: () =>
|
|
279
|
+
getElement: () => p.current
|
|
192
280
|
}),
|
|
193
|
-
[
|
|
281
|
+
[nt]
|
|
194
282
|
);
|
|
195
|
-
const
|
|
283
|
+
const F = Math.min(Math.max(s, 0), 1), h = r / 64, $ = Math.min(f.distance, e) / e, q = f.direction * $ * 10 * h, H = l ?? nr, O = {
|
|
196
284
|
dragState: f,
|
|
197
|
-
normalizedDistance:
|
|
198
|
-
sizeScale:
|
|
285
|
+
normalizedDistance: $,
|
|
286
|
+
sizeScale: h,
|
|
199
287
|
size: r,
|
|
200
|
-
opacity:
|
|
201
|
-
},
|
|
202
|
-
...
|
|
288
|
+
opacity: F
|
|
289
|
+
}, K = {
|
|
290
|
+
...n,
|
|
203
291
|
width: r,
|
|
204
292
|
height: r,
|
|
205
|
-
transform: `translateY(${
|
|
293
|
+
transform: `translateY(${q}px)`
|
|
206
294
|
};
|
|
207
|
-
return
|
|
295
|
+
return K.opacity = F, /* @__PURE__ */ et(
|
|
208
296
|
"div",
|
|
209
297
|
{
|
|
210
|
-
ref:
|
|
298
|
+
ref: p,
|
|
211
299
|
"data-testid": "virtual-scroll-tap-circle",
|
|
212
|
-
className:
|
|
213
|
-
style:
|
|
300
|
+
className: ae("aqvs-tap-scroll-circle", t),
|
|
301
|
+
style: K,
|
|
214
302
|
tabIndex: -1,
|
|
215
|
-
onPointerDown:
|
|
216
|
-
onPointerMove:
|
|
217
|
-
onPointerUp:
|
|
218
|
-
onPointerCancel:
|
|
303
|
+
onPointerDown: ft,
|
|
304
|
+
onPointerMove: St,
|
|
305
|
+
onPointerUp: wt,
|
|
306
|
+
onPointerCancel: wt,
|
|
307
|
+
onLostPointerCapture: L,
|
|
219
308
|
role: "presentation",
|
|
220
|
-
children:
|
|
309
|
+
children: H(O)
|
|
221
310
|
}
|
|
222
311
|
);
|
|
223
312
|
})
|
|
224
313
|
);
|
|
225
|
-
|
|
226
|
-
const
|
|
314
|
+
We.displayName = "TapScrollCircle";
|
|
315
|
+
const mt = (i, t, e) => Math.max(t, Math.min(e, i)), Oe = "virtualscroll:tap-scroll-cancel", Be = 20, ir = 250, or = 60, sr = 20, ar = 20, lr = 240, qe = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, De = 2.2, cr = 8, ur = 120, dr = 1 / 10, $t = {
|
|
227
316
|
enabled: !0,
|
|
228
317
|
size: 40,
|
|
229
318
|
offsetX: -80,
|
|
230
319
|
offsetY: 0,
|
|
231
320
|
className: void 0,
|
|
232
|
-
maxVisualDistance:
|
|
321
|
+
maxVisualDistance: lr,
|
|
233
322
|
minSpeedMultiplier: 0.2,
|
|
234
323
|
opacity: 0.9,
|
|
235
324
|
renderVisual: void 0,
|
|
236
325
|
maxSpeedCurve: void 0
|
|
237
|
-
},
|
|
326
|
+
}, fr = (i) => i ? {
|
|
238
327
|
mainSizeKey: "width",
|
|
239
328
|
crossSizeKey: "height",
|
|
240
329
|
positionKey: "left",
|
|
@@ -254,421 +343,493 @@ const xt = (n, t, e) => Math.min(e, Math.max(t, n)), Me = "virtualscroll:tap-scr
|
|
|
254
343
|
arrowIcons: ["▲", "▼"],
|
|
255
344
|
directionClass: "aqvs-scrollbar-vertical",
|
|
256
345
|
orientation: "vertical"
|
|
257
|
-
},
|
|
258
|
-
const e =
|
|
346
|
+
}, mr = (i, t) => {
|
|
347
|
+
const e = i?.maxSpeedMultiplier, r = typeof e == "number" ? e : gr(t);
|
|
259
348
|
return {
|
|
260
|
-
enabled:
|
|
261
|
-
size:
|
|
262
|
-
offsetX:
|
|
263
|
-
offsetY:
|
|
264
|
-
className:
|
|
265
|
-
maxVisualDistance:
|
|
349
|
+
enabled: i?.enabled ?? $t.enabled,
|
|
350
|
+
size: i?.size ?? $t.size,
|
|
351
|
+
offsetX: i?.offsetX ?? $t.offsetX,
|
|
352
|
+
offsetY: i?.offsetY ?? $t.offsetY,
|
|
353
|
+
className: i?.className ?? $t.className,
|
|
354
|
+
maxVisualDistance: i?.maxVisualDistance ?? $t.maxVisualDistance,
|
|
266
355
|
maxSpeedMultiplier: r,
|
|
267
|
-
minSpeedMultiplier: Math.max(
|
|
268
|
-
opacity:
|
|
269
|
-
renderVisual:
|
|
270
|
-
maxSpeedCurve:
|
|
356
|
+
minSpeedMultiplier: Math.max(i?.minSpeedMultiplier ?? $t.minSpeedMultiplier, 0),
|
|
357
|
+
opacity: mt(i?.opacity ?? $t.opacity, 0, 1),
|
|
358
|
+
renderVisual: i?.renderVisual ?? $t.renderVisual,
|
|
359
|
+
maxSpeedCurve: i?.maxSpeedCurve ?? $t.maxSpeedCurve
|
|
271
360
|
};
|
|
272
|
-
},
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
}, []),
|
|
276
|
-
|
|
277
|
-
}, [
|
|
278
|
-
(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
361
|
+
}, pr = ({ isDragging: i, isThumbHovered: t, enableThumbDrag: e }) => yt(() => e ? i ? "dragging" : t ? "hover" : "idle" : "disabled", [e, i, t]), hr = ({ canUseArrowButtons: i, enableArrowButtons: t, resetTapScroll: e, scrollByStep: r }) => {
|
|
362
|
+
const n = b(null), s = b(null), l = b(null), u = y(() => {
|
|
363
|
+
n.current !== null && (window.clearInterval(n.current), n.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);
|
|
364
|
+
}, []), f = y(() => {
|
|
365
|
+
u();
|
|
366
|
+
}, [u]), I = y(
|
|
367
|
+
(T) => (D) => {
|
|
368
|
+
if (!i)
|
|
369
|
+
return;
|
|
370
|
+
D.cancelable && D.preventDefault(), D.stopPropagation(), e(), u(), r(T), s.current = window.setTimeout(() => {
|
|
371
|
+
n.current = window.setInterval(() => {
|
|
372
|
+
r(T);
|
|
373
|
+
}, or);
|
|
374
|
+
}, ir);
|
|
375
|
+
const p = () => u();
|
|
376
|
+
l.current = p, window.addEventListener("pointerup", p), window.addEventListener("pointercancel", p), window.addEventListener("blur", p);
|
|
284
377
|
},
|
|
285
|
-
[
|
|
286
|
-
),
|
|
287
|
-
(
|
|
288
|
-
t && (
|
|
378
|
+
[i, u, e, r]
|
|
379
|
+
), v = y(
|
|
380
|
+
(T) => (D) => {
|
|
381
|
+
t && (D.key === "Enter" || D.key === " " || D.key === "Spacebar") && (D.preventDefault(), r(T));
|
|
289
382
|
},
|
|
290
383
|
[t, r]
|
|
291
384
|
);
|
|
292
|
-
return
|
|
293
|
-
|
|
294
|
-
}, [
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
385
|
+
return X(() => {
|
|
386
|
+
i || u();
|
|
387
|
+
}, [i, u]), X(() => () => {
|
|
388
|
+
u();
|
|
389
|
+
}, [u]), { handleArrowPointerDown: I, handleArrowPointerUp: f, handleArrowKeyDown: v };
|
|
390
|
+
}, gr = (i) => {
|
|
391
|
+
if (!i || i <= 0)
|
|
392
|
+
return De;
|
|
393
|
+
const t = Math.max(1, i), e = Math.log10(t), r = De + e * cr;
|
|
394
|
+
return mt(r, De, ur);
|
|
395
|
+
}, br = ({
|
|
396
|
+
contentSize: i,
|
|
302
397
|
viewportSize: t,
|
|
303
398
|
scrollPosition: e,
|
|
304
399
|
onScroll: r,
|
|
305
|
-
enableThumbDrag:
|
|
306
|
-
enableTrackClick:
|
|
307
|
-
enableArrowButtons:
|
|
308
|
-
horizontal:
|
|
400
|
+
enableThumbDrag: n = !0,
|
|
401
|
+
enableTrackClick: s = !0,
|
|
402
|
+
enableArrowButtons: l = !0,
|
|
403
|
+
horizontal: u = !1,
|
|
309
404
|
scrollBarWidth: f = 12,
|
|
310
|
-
className:
|
|
311
|
-
ariaControls:
|
|
312
|
-
tapScrollCircleOptions:
|
|
313
|
-
itemCount:
|
|
314
|
-
renderThumbOverlay:
|
|
315
|
-
visibleStartIndex:
|
|
316
|
-
visibleEndIndex:
|
|
405
|
+
className: I,
|
|
406
|
+
ariaControls: v,
|
|
407
|
+
tapScrollCircleOptions: T,
|
|
408
|
+
itemCount: D,
|
|
409
|
+
renderThumbOverlay: p,
|
|
410
|
+
visibleStartIndex: z,
|
|
411
|
+
visibleEndIndex: rt
|
|
317
412
|
}) => {
|
|
318
|
-
const [
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
413
|
+
const [W, ot] = Ut(!1), [nt, ft] = Ut(!1), [St, wt] = Ut(!1), L = b(null), F = b({
|
|
414
|
+
pointerId: null,
|
|
415
|
+
startThumbPosition: 0,
|
|
416
|
+
startClientX: 0,
|
|
417
|
+
startClientY: 0,
|
|
418
|
+
scale: 1,
|
|
419
|
+
captureTarget: null
|
|
420
|
+
}), h = b({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), $ = b(e), q = b(r), H = b(qe), O = b(null), K = b(null), S = b(null), U = b(0), j = b(0), k = yt(() => mr(T, D), [D, T]), G = yt(() => fr(u), [u]), {
|
|
421
|
+
enabled: st,
|
|
422
|
+
size: Mt,
|
|
423
|
+
offsetX: R,
|
|
424
|
+
offsetY: Dt,
|
|
425
|
+
className: Vt,
|
|
426
|
+
maxVisualDistance: x,
|
|
427
|
+
maxSpeedMultiplier: Rt,
|
|
428
|
+
minSpeedMultiplier: At,
|
|
429
|
+
opacity: qt,
|
|
430
|
+
renderVisual: M,
|
|
431
|
+
maxSpeedCurve: Y
|
|
432
|
+
} = k, C = b({
|
|
331
433
|
viewportSize: t,
|
|
332
|
-
maxScrollPosition: Math.max(
|
|
333
|
-
scrollBarVisible:
|
|
334
|
-
effectiveTapMaxDistance: Math.max(
|
|
335
|
-
tapCircleMaxSpeedMultiplier:
|
|
336
|
-
tapCircleMinSpeedMultiplier:
|
|
337
|
-
tapCircleMaxSpeedCurve:
|
|
338
|
-
tapScrollCircleOptions:
|
|
434
|
+
maxScrollPosition: Math.max(i - t, 0),
|
|
435
|
+
scrollBarVisible: i > t,
|
|
436
|
+
effectiveTapMaxDistance: Math.max(x, 1),
|
|
437
|
+
tapCircleMaxSpeedMultiplier: Rt,
|
|
438
|
+
tapCircleMinSpeedMultiplier: At,
|
|
439
|
+
tapCircleMaxSpeedCurve: Y,
|
|
440
|
+
tapScrollCircleOptions: T,
|
|
339
441
|
effectiveTrackLength: 0,
|
|
340
442
|
onScroll: r,
|
|
341
443
|
scrollPosition: e
|
|
342
|
-
}), { mainSizeKey:
|
|
343
|
-
|
|
344
|
-
|
|
444
|
+
}), { mainSizeKey: ct, crossSizeKey: at, positionKey: pt, selectDelta: ht, getPointerCoordinate: J, arrowLabels: Ct, arrowIcons: ut, directionClass: Kt, orientation: Lt } = G, xt = Math.max(x, 1), _t = t / i, Ot = Math.max(t - f * 2, 0), It = _t * Ot, Et = Math.min(Math.max(Be, It || 0), Ot || Be), m = i - t, E = Math.max(Ot - Et, 0), lt = m <= 0 || E <= 0 ? 0 : mt(e / m * E, 0, E), zt = lt + Et / 2, Z = i > t || W, re = Z && l;
|
|
445
|
+
pe(() => {
|
|
446
|
+
C.current = {
|
|
345
447
|
viewportSize: t,
|
|
346
|
-
maxScrollPosition:
|
|
347
|
-
scrollBarVisible:
|
|
348
|
-
effectiveTapMaxDistance:
|
|
349
|
-
tapCircleMaxSpeedMultiplier:
|
|
350
|
-
tapCircleMinSpeedMultiplier:
|
|
351
|
-
tapCircleMaxSpeedCurve:
|
|
352
|
-
tapScrollCircleOptions:
|
|
353
|
-
effectiveTrackLength:
|
|
448
|
+
maxScrollPosition: m,
|
|
449
|
+
scrollBarVisible: Z,
|
|
450
|
+
effectiveTapMaxDistance: xt,
|
|
451
|
+
tapCircleMaxSpeedMultiplier: Rt,
|
|
452
|
+
tapCircleMinSpeedMultiplier: At,
|
|
453
|
+
tapCircleMaxSpeedCurve: Y,
|
|
454
|
+
tapScrollCircleOptions: T,
|
|
455
|
+
effectiveTrackLength: E,
|
|
354
456
|
onScroll: r,
|
|
355
457
|
scrollPosition: e
|
|
356
458
|
};
|
|
357
|
-
}),
|
|
358
|
-
|
|
359
|
-
}, [e]),
|
|
360
|
-
|
|
361
|
-
}, [r]),
|
|
362
|
-
|
|
363
|
-
}, [
|
|
364
|
-
const
|
|
365
|
-
const
|
|
366
|
-
if (
|
|
367
|
-
const
|
|
368
|
-
if (typeof
|
|
369
|
-
return
|
|
459
|
+
}), pe(() => {
|
|
460
|
+
$.current = e;
|
|
461
|
+
}, [e]), pe(() => {
|
|
462
|
+
q.current = r;
|
|
463
|
+
}, [r]), X(() => {
|
|
464
|
+
n || ft(!1);
|
|
465
|
+
}, [n]);
|
|
466
|
+
const Ht = pr({ isDragging: W, isThumbHovered: nt, enableThumbDrag: n }), Nt = y((a, g) => {
|
|
467
|
+
const w = C.current, o = g ?? $.current;
|
|
468
|
+
if (q.current) {
|
|
469
|
+
const N = q.current(a, o);
|
|
470
|
+
if (typeof N == "number" && Number.isFinite(N))
|
|
471
|
+
return $.current = N, N;
|
|
370
472
|
}
|
|
371
|
-
const
|
|
372
|
-
return
|
|
373
|
-
}, []),
|
|
374
|
-
(
|
|
375
|
-
const
|
|
376
|
-
if (!
|
|
377
|
-
const
|
|
378
|
-
return { nextPosition:
|
|
473
|
+
const c = typeof a == "function" ? a(o) : a, d = Math.max(w.maxScrollPosition, 0), P = w.scrollBarVisible ? mt(c, 0, d) : 0;
|
|
474
|
+
return $.current = P, P;
|
|
475
|
+
}, []), Wt = y(
|
|
476
|
+
(a) => {
|
|
477
|
+
const g = C.current, w = $.current;
|
|
478
|
+
if (!g.scrollBarVisible || g.maxScrollPosition <= 0) {
|
|
479
|
+
const A = Nt(0, w), B = A - w;
|
|
480
|
+
return { nextPosition: A, actualDelta: B, reachedBoundary: !0 };
|
|
379
481
|
}
|
|
380
|
-
if (
|
|
381
|
-
return { nextPosition:
|
|
382
|
-
const
|
|
383
|
-
return { nextPosition:
|
|
482
|
+
if (a === 0)
|
|
483
|
+
return { nextPosition: w, actualDelta: 0, reachedBoundary: !1 };
|
|
484
|
+
const c = Nt((A) => mt(A + a, 0, g.maxScrollPosition), w), d = c - w, P = a < 0 && w + a <= 0, N = a > 0 && w + a >= g.maxScrollPosition, _ = a < 0 && (c <= 0 || P && d === 0) || a > 0 && (c >= g.maxScrollPosition || N && d === 0);
|
|
485
|
+
return { nextPosition: c, actualDelta: d, reachedBoundary: _ };
|
|
384
486
|
},
|
|
385
|
-
[
|
|
386
|
-
),
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
487
|
+
[Nt]
|
|
488
|
+
), jt = y(
|
|
489
|
+
(a, g) => {
|
|
490
|
+
a.current += g;
|
|
491
|
+
const w = Math.max(C.current.maxScrollPosition, 0);
|
|
492
|
+
w > 0 && (a.current = mt(a.current, -w, w));
|
|
493
|
+
const o = Wt(a.current);
|
|
494
|
+
return a.current -= o.actualDelta, o.reachedBoundary && (a.current = 0), o;
|
|
495
|
+
},
|
|
496
|
+
[Wt]
|
|
497
|
+
), Ft = y(() => {
|
|
498
|
+
K.current !== null && (window.cancelAnimationFrame(K.current), K.current = null), S.current = null, U.current = 0, j.current = 0;
|
|
499
|
+
}, []), Pt = y(() => {
|
|
500
|
+
H.current = { ...qe }, wt(!1), O.current?.reset(), Ft();
|
|
501
|
+
}, [Ft]), Gt = y(
|
|
502
|
+
(a) => {
|
|
503
|
+
const g = H.current, w = C.current;
|
|
504
|
+
if (!g.active || g.direction === 0) {
|
|
505
|
+
Ft();
|
|
395
506
|
return;
|
|
396
507
|
}
|
|
397
|
-
if (!
|
|
398
|
-
|
|
508
|
+
if (!w.scrollBarVisible || w.maxScrollPosition <= 0) {
|
|
509
|
+
Ft();
|
|
399
510
|
return;
|
|
400
511
|
}
|
|
401
|
-
const
|
|
402
|
-
if (
|
|
403
|
-
|
|
512
|
+
const o = S.current ?? a, c = Math.max((a - o) / 1e3, 0), d = Math.min(c, dr);
|
|
513
|
+
if (S.current = a, d <= 0) {
|
|
514
|
+
K.current = window.requestAnimationFrame(Gt);
|
|
404
515
|
return;
|
|
405
516
|
}
|
|
406
|
-
const
|
|
407
|
-
let
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
410
|
-
const
|
|
411
|
-
|
|
517
|
+
const P = Math.min(g.distance, w.effectiveTapMaxDistance) / w.effectiveTapMaxDistance, N = P ** 1.1, _ = typeof w.tapScrollCircleOptions?.maxSpeedMultiplier == "number", A = Math.max(w.viewportSize * w.tapCircleMinSpeedMultiplier, 40), B = _ ? A : 1200;
|
|
518
|
+
let tt = Math.max(w.viewportSize * w.tapCircleMaxSpeedMultiplier, B);
|
|
519
|
+
const Q = w.tapCircleMaxSpeedCurve;
|
|
520
|
+
if (Q) {
|
|
521
|
+
const we = Math.max(Q.exponentialSteepness, 0), je = Math.max(Q.exponentialScale ?? w.tapCircleMaxSpeedMultiplier, 0), Ge = we === 0 ? P : Math.expm1(we * P), ze = we === 0 ? 1 : Math.expm1(we) || 1, Ze = ze === 0 ? P : Math.min(Math.max(Ge / ze, 0), 1), Je = w.viewportSize * je * Ze;
|
|
522
|
+
tt = Math.min(tt, Math.max(Je, A));
|
|
412
523
|
}
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
524
|
+
const vt = Math.max(tt, A), bt = Math.max(Q?.easedOffset ?? 0, 0), Tt = Math.min(1, N + bt), se = A + (vt - A) * Tt;
|
|
525
|
+
j.current !== g.direction && (j.current = g.direction, U.current = 0);
|
|
526
|
+
const { reachedBoundary: ve } = jt(U, g.direction * se * d);
|
|
527
|
+
if (ve) {
|
|
528
|
+
Ft();
|
|
416
529
|
return;
|
|
417
530
|
}
|
|
418
|
-
|
|
531
|
+
K.current = window.requestAnimationFrame(Gt);
|
|
419
532
|
},
|
|
420
|
-
[
|
|
421
|
-
),
|
|
422
|
-
|
|
423
|
-
}, [
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}, [
|
|
427
|
-
const
|
|
428
|
-
(
|
|
429
|
-
|
|
533
|
+
[jt, Ft]
|
|
534
|
+
), he = y(() => {
|
|
535
|
+
K.current === null && (S.current = null, U.current = 0, K.current = window.requestAnimationFrame(Gt));
|
|
536
|
+
}, [Gt]);
|
|
537
|
+
X(() => () => {
|
|
538
|
+
Ft();
|
|
539
|
+
}, [Ft]);
|
|
540
|
+
const ge = y(
|
|
541
|
+
(a) => {
|
|
542
|
+
H.current = a, wt(a.active), a.active && a.direction !== 0 ? he() : Ft();
|
|
430
543
|
},
|
|
431
|
-
[
|
|
544
|
+
[he, Ft]
|
|
432
545
|
);
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
}, [
|
|
436
|
-
const
|
|
437
|
-
const
|
|
438
|
-
|
|
546
|
+
X(() => {
|
|
547
|
+
st || Pt();
|
|
548
|
+
}, [Pt, st]), X(() => {
|
|
549
|
+
const a = (g) => {
|
|
550
|
+
const o = g.detail?.paneId;
|
|
551
|
+
o && v && o !== v || Pt();
|
|
439
552
|
};
|
|
440
|
-
return window.addEventListener(
|
|
441
|
-
window.removeEventListener(
|
|
553
|
+
return window.addEventListener(Oe, a), () => {
|
|
554
|
+
window.removeEventListener(Oe, a);
|
|
442
555
|
};
|
|
443
|
-
}, [
|
|
444
|
-
if (!
|
|
556
|
+
}, [v, Pt]), X(() => {
|
|
557
|
+
if (!st)
|
|
445
558
|
return;
|
|
446
|
-
const
|
|
447
|
-
if (!
|
|
559
|
+
const a = (g) => {
|
|
560
|
+
if (!H.current.active || H.current.pointerId === g.pointerId)
|
|
448
561
|
return;
|
|
449
|
-
const
|
|
450
|
-
if (!(
|
|
451
|
-
|
|
562
|
+
const w = g.target;
|
|
563
|
+
if (!(w instanceof Node)) {
|
|
564
|
+
Pt();
|
|
452
565
|
return;
|
|
453
566
|
}
|
|
454
|
-
|
|
567
|
+
O.current?.getElement()?.contains(w) || Pt();
|
|
455
568
|
};
|
|
456
|
-
return document.addEventListener("pointerdown",
|
|
457
|
-
document.removeEventListener("pointerdown",
|
|
569
|
+
return document.addEventListener("pointerdown", a, !0), () => {
|
|
570
|
+
document.removeEventListener("pointerdown", a, !0);
|
|
458
571
|
};
|
|
459
|
-
}, [
|
|
460
|
-
const
|
|
461
|
-
if (!
|
|
572
|
+
}, [Pt, st]);
|
|
573
|
+
const be = (a) => {
|
|
574
|
+
if (!Z || E <= 0 || m <= 0)
|
|
462
575
|
return 0;
|
|
463
|
-
const
|
|
464
|
-
return
|
|
465
|
-
},
|
|
466
|
-
const { scrollBarVisible:
|
|
467
|
-
if (
|
|
576
|
+
const g = mt(a, 0, E);
|
|
577
|
+
return mt(g / E * m, 0, m);
|
|
578
|
+
}, it = y((a) => {
|
|
579
|
+
const { scrollBarVisible: g, effectiveTrackLength: w, maxScrollPosition: o } = C.current;
|
|
580
|
+
if (V.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: a, trackLen: w, maxScroll: o })), w <= 0 || o <= 0)
|
|
468
581
|
return null;
|
|
469
|
-
const
|
|
470
|
-
return
|
|
471
|
-
}, []),
|
|
472
|
-
(
|
|
473
|
-
const w =
|
|
474
|
-
|
|
475
|
-
return;
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
delta: s,
|
|
479
|
-
startThumbPosition: w.startThumbPosition,
|
|
480
|
-
clientY: o.clientY,
|
|
481
|
-
startClientY: w.startClientY,
|
|
482
|
-
metrics: b.current
|
|
483
|
-
});
|
|
484
|
-
const a = ce(w.startThumbPosition + s);
|
|
485
|
-
a !== null && wt(a), o.cancelable && o.preventDefault();
|
|
582
|
+
const c = mt(a, 0, w);
|
|
583
|
+
return mt(c / w * o, 0, o);
|
|
584
|
+
}, []), Zt = y(
|
|
585
|
+
(a) => {
|
|
586
|
+
const g = a.getBoundingClientRect(), w = u ? g.width : g.height, o = (_) => {
|
|
587
|
+
const A = Number.parseFloat(_);
|
|
588
|
+
return Number.isFinite(A) ? A : 0;
|
|
589
|
+
}, c = window.getComputedStyle(a), d = o(u ? c.width : c.height), P = d > 0 ? d + o(u ? c.paddingLeft : c.paddingTop) + o(u ? c.paddingRight : c.paddingBottom) + o(u ? c.borderLeftWidth : c.borderTopWidth) + o(u ? c.borderRightWidth : c.borderBottomWidth) : 0, N = P > 0 ? P : u ? a.offsetWidth : a.offsetHeight;
|
|
590
|
+
return N <= 0 || w <= 0 ? 1 : w / N;
|
|
486
591
|
},
|
|
487
|
-
[
|
|
488
|
-
),
|
|
489
|
-
(
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
592
|
+
[u]
|
|
593
|
+
), ne = y(
|
|
594
|
+
(a) => {
|
|
595
|
+
const g = F.current;
|
|
596
|
+
if (g.pointerId !== a.pointerId)
|
|
597
|
+
return;
|
|
598
|
+
const w = a.clientX - g.startClientX, o = a.clientY - g.startClientY, c = ht(w, o) / (g.scale || 1);
|
|
599
|
+
V.debug("[ScrollBar] handleThumbPointerMove", () => ({
|
|
600
|
+
delta: c,
|
|
601
|
+
startThumbPosition: g.startThumbPosition,
|
|
602
|
+
clientY: a.clientY,
|
|
603
|
+
startClientY: g.startClientY,
|
|
604
|
+
metrics: C.current
|
|
605
|
+
}));
|
|
606
|
+
const d = it(g.startThumbPosition + c);
|
|
607
|
+
d !== null && Nt(d), a.cancelable && a.preventDefault();
|
|
496
608
|
},
|
|
497
|
-
[Nt]
|
|
498
|
-
),
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
canUseArrowButtons: Zt,
|
|
503
|
-
enableArrowButtons: c,
|
|
504
|
-
resetTapScroll: Rt,
|
|
505
|
-
scrollByStep: me
|
|
506
|
-
}), Ut = (o) => {
|
|
507
|
-
if (H) {
|
|
508
|
-
if (!i) {
|
|
509
|
-
o.preventDefault(), o.stopPropagation();
|
|
609
|
+
[ht, it, Nt]
|
|
610
|
+
), Xt = y(
|
|
611
|
+
(a) => {
|
|
612
|
+
const g = F.current;
|
|
613
|
+
if (g.pointerId !== a.pointerId)
|
|
510
614
|
return;
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
615
|
+
document.removeEventListener("pointermove", ne), document.removeEventListener("pointerup", Xt), document.removeEventListener("pointercancel", Xt);
|
|
616
|
+
const w = g.captureTarget;
|
|
617
|
+
if (w?.hasPointerCapture?.(a.pointerId) && w.releasePointerCapture(a.pointerId), F.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ot(!1), L.current) {
|
|
618
|
+
const o = L.current.getBoundingClientRect();
|
|
619
|
+
a.clientX >= o.left && a.clientX <= o.right && a.clientY >= o.top && a.clientY <= o.bottom || ft(!1);
|
|
620
|
+
} else
|
|
621
|
+
ft(!1);
|
|
622
|
+
},
|
|
623
|
+
[ne]
|
|
624
|
+
);
|
|
625
|
+
X(() => () => {
|
|
626
|
+
document.removeEventListener("pointermove", ne), document.removeEventListener("pointerup", Xt), document.removeEventListener("pointercancel", Xt);
|
|
627
|
+
}, [ne, Xt]);
|
|
628
|
+
const kt = b(0), xe = b(0), Me = y(
|
|
629
|
+
(a) => {
|
|
630
|
+
const g = Math.max(Math.round(C.current.viewportSize / ar), sr);
|
|
631
|
+
xe.current !== a && (xe.current = a, kt.current = 0), jt(kt, a * g);
|
|
632
|
+
},
|
|
633
|
+
[jt]
|
|
634
|
+
), { handleArrowPointerDown: Ne, handleArrowPointerUp: Yt, handleArrowKeyDown: ie } = hr({
|
|
635
|
+
canUseArrowButtons: re,
|
|
636
|
+
enableArrowButtons: l,
|
|
637
|
+
resetTapScroll: Pt,
|
|
638
|
+
scrollByStep: Me
|
|
639
|
+
}), Jt = (a) => {
|
|
640
|
+
if (!Z)
|
|
641
|
+
return;
|
|
642
|
+
if (!n) {
|
|
643
|
+
a.preventDefault(), a.stopPropagation();
|
|
644
|
+
return;
|
|
518
645
|
}
|
|
519
|
-
|
|
520
|
-
if (!H)
|
|
646
|
+
if (a.pointerType === "mouse" && a.button !== 0 || a.ctrlKey)
|
|
521
647
|
return;
|
|
522
|
-
|
|
523
|
-
|
|
648
|
+
Pt();
|
|
649
|
+
const g = a.currentTarget, w = Zt(g);
|
|
650
|
+
let o = null;
|
|
651
|
+
if (g.setPointerCapture)
|
|
652
|
+
try {
|
|
653
|
+
g.setPointerCapture(a.pointerId), o = g;
|
|
654
|
+
} catch {
|
|
655
|
+
o = null;
|
|
656
|
+
}
|
|
657
|
+
F.current = {
|
|
658
|
+
pointerId: a.pointerId,
|
|
659
|
+
startThumbPosition: lt,
|
|
660
|
+
startClientX: a.clientX,
|
|
661
|
+
startClientY: a.clientY,
|
|
662
|
+
scale: w,
|
|
663
|
+
captureTarget: o
|
|
664
|
+
}, document.addEventListener("pointermove", ne), document.addEventListener("pointerup", Xt), document.addEventListener("pointercancel", Xt), ot(!0), ft(!0), a.preventDefault(), a.stopPropagation();
|
|
665
|
+
}, Qt = (a) => {
|
|
666
|
+
if (!Z)
|
|
667
|
+
return;
|
|
668
|
+
if (!s) {
|
|
669
|
+
a.preventDefault(), a.stopPropagation();
|
|
524
670
|
return;
|
|
525
671
|
}
|
|
526
|
-
if (
|
|
672
|
+
if (a.pointerType === "mouse" && a.button !== 0 || a.ctrlKey)
|
|
673
|
+
return;
|
|
674
|
+
const g = a.currentTarget, w = g.getBoundingClientRect(), o = J(a), c = Zt(g), d = (o - (u ? w.left : w.top)) / c;
|
|
675
|
+
Pt();
|
|
676
|
+
const P = d - Et / 2, N = be(P);
|
|
677
|
+
if (Nt(N), g.setPointerCapture)
|
|
678
|
+
try {
|
|
679
|
+
g.setPointerCapture(a.pointerId);
|
|
680
|
+
} catch {
|
|
681
|
+
}
|
|
682
|
+
h.current = {
|
|
683
|
+
pointerId: a.pointerId,
|
|
684
|
+
startThumbPosition: P,
|
|
685
|
+
startClientX: a.clientX,
|
|
686
|
+
startClientY: a.clientY,
|
|
687
|
+
scale: c
|
|
688
|
+
}, a.preventDefault(), a.stopPropagation();
|
|
689
|
+
}, Bt = () => {
|
|
690
|
+
h.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
|
|
691
|
+
}, ce = (a) => {
|
|
692
|
+
const g = h.current;
|
|
693
|
+
if (g.pointerId !== a.pointerId)
|
|
527
694
|
return;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
const a = s - at / 2, u = le(a);
|
|
531
|
-
wt(u), w.setPointerCapture && w.setPointerCapture(o.pointerId), E.current = {
|
|
532
|
-
pointerId: o.pointerId,
|
|
533
|
-
startThumbPosition: a,
|
|
534
|
-
startClientX: o.clientX,
|
|
535
|
-
startClientY: o.clientY
|
|
536
|
-
}, o.preventDefault(), o.stopPropagation();
|
|
537
|
-
}, Yt = (o) => {
|
|
538
|
-
const w = E.current;
|
|
539
|
-
if (w.pointerId !== o.pointerId)
|
|
695
|
+
if (a.pointerType === "mouse" && a.buttons === 0) {
|
|
696
|
+
Bt();
|
|
540
697
|
return;
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
698
|
+
}
|
|
699
|
+
const w = a.clientX - g.startClientX, o = a.clientY - g.startClientY, c = ht(w, o) / (g.scale || 1), d = be(g.startThumbPosition + c);
|
|
700
|
+
Nt(d), a.cancelable && a.preventDefault();
|
|
701
|
+
}, te = (a) => {
|
|
702
|
+
if (h.current.pointerId !== a.pointerId)
|
|
545
703
|
return;
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
},
|
|
549
|
-
if (
|
|
704
|
+
const g = a.currentTarget;
|
|
705
|
+
g.hasPointerCapture?.(a.pointerId) && g.releasePointerCapture(a.pointerId), Bt(), a.preventDefault(), a.stopPropagation();
|
|
706
|
+
}, Pe = (a) => {
|
|
707
|
+
if (h.current.pointerId !== a.pointerId)
|
|
550
708
|
return;
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
},
|
|
554
|
-
|
|
709
|
+
const g = a.currentTarget;
|
|
710
|
+
g.hasPointerCapture?.(a.pointerId) && g.releasePointerCapture(a.pointerId), Bt();
|
|
711
|
+
}, ye = (a) => {
|
|
712
|
+
h.current.pointerId === a.pointerId && Bt();
|
|
713
|
+
}, Ve = yt(() => mt((St ? 1 : 0.8) * qt, 0, 1), [St, qt]), Ie = yt(() => {
|
|
714
|
+
const g = `calc(50% - ${Mt / 2}px + ${Dt}px)`;
|
|
555
715
|
return {
|
|
556
|
-
left:
|
|
557
|
-
top:
|
|
716
|
+
left: R,
|
|
717
|
+
top: g
|
|
558
718
|
};
|
|
559
|
-
}, [
|
|
719
|
+
}, [R, Dt, Mt]), ue = (a, g, w, o) => /* @__PURE__ */ et(
|
|
560
720
|
"button",
|
|
561
721
|
{
|
|
562
722
|
type: "button",
|
|
563
|
-
tabIndex:
|
|
723
|
+
tabIndex: 0,
|
|
564
724
|
className: "aqvs-scrollbar-arrow-button",
|
|
565
725
|
style: {
|
|
566
|
-
[
|
|
567
|
-
[
|
|
726
|
+
[ct]: f,
|
|
727
|
+
[at]: f
|
|
568
728
|
},
|
|
569
|
-
"aria-label":
|
|
570
|
-
onPointerDown:
|
|
571
|
-
onPointerUp:
|
|
572
|
-
onPointerLeave:
|
|
573
|
-
onPointerCancel:
|
|
574
|
-
onKeyDown:
|
|
575
|
-
"aria-disabled": !
|
|
576
|
-
disabled: !
|
|
577
|
-
children: /* @__PURE__ */
|
|
729
|
+
"aria-label": g,
|
|
730
|
+
onPointerDown: Ne(a),
|
|
731
|
+
onPointerUp: Yt,
|
|
732
|
+
onPointerLeave: Yt,
|
|
733
|
+
onPointerCancel: Yt,
|
|
734
|
+
onKeyDown: ie(a),
|
|
735
|
+
"aria-disabled": !l,
|
|
736
|
+
disabled: !re,
|
|
737
|
+
children: /* @__PURE__ */ et("span", { "aria-hidden": "true", children: w })
|
|
578
738
|
},
|
|
579
|
-
|
|
580
|
-
),
|
|
581
|
-
orientation:
|
|
739
|
+
o
|
|
740
|
+
), de = p && Z ? {
|
|
741
|
+
orientation: Lt,
|
|
582
742
|
scrollPosition: e,
|
|
583
|
-
maxScrollPosition:
|
|
584
|
-
contentSize:
|
|
743
|
+
maxScrollPosition: m,
|
|
744
|
+
contentSize: i,
|
|
585
745
|
viewportSize: t,
|
|
586
|
-
thumbSize:
|
|
587
|
-
thumbPosition:
|
|
588
|
-
thumbCenter:
|
|
589
|
-
trackSize:
|
|
590
|
-
isDragging:
|
|
591
|
-
isTapScrollActive:
|
|
592
|
-
visibleStartIndex:
|
|
593
|
-
visibleEndIndex:
|
|
746
|
+
thumbSize: Et,
|
|
747
|
+
thumbPosition: lt,
|
|
748
|
+
thumbCenter: zt,
|
|
749
|
+
trackSize: Ot,
|
|
750
|
+
isDragging: W,
|
|
751
|
+
isTapScrollActive: St,
|
|
752
|
+
visibleStartIndex: z,
|
|
753
|
+
visibleEndIndex: rt
|
|
594
754
|
} : null;
|
|
595
|
-
return /* @__PURE__ */
|
|
755
|
+
return /* @__PURE__ */ le(
|
|
596
756
|
"div",
|
|
597
757
|
{
|
|
598
|
-
className:
|
|
758
|
+
className: ae("aqvs-scrollbar", Kt, !Z && "pointer-events-none opacity-0", I),
|
|
599
759
|
style: {
|
|
600
|
-
[
|
|
601
|
-
[
|
|
760
|
+
[ct]: t,
|
|
761
|
+
[at]: f
|
|
602
762
|
},
|
|
603
763
|
role: "scrollbar",
|
|
604
764
|
tabIndex: -1,
|
|
605
|
-
"aria-controls":
|
|
765
|
+
"aria-controls": v,
|
|
606
766
|
"aria-valuenow": e,
|
|
607
767
|
"aria-valuemin": 0,
|
|
608
|
-
"aria-valuemax":
|
|
609
|
-
"aria-orientation":
|
|
768
|
+
"aria-valuemax": m,
|
|
769
|
+
"aria-orientation": u ? "horizontal" : "vertical",
|
|
610
770
|
children: [
|
|
611
|
-
!
|
|
612
|
-
|
|
771
|
+
!u && Z && st && /* @__PURE__ */ et(
|
|
772
|
+
We,
|
|
613
773
|
{
|
|
614
|
-
ref:
|
|
615
|
-
className:
|
|
616
|
-
size:
|
|
617
|
-
maxVisualDistance:
|
|
618
|
-
style:
|
|
619
|
-
opacity:
|
|
620
|
-
renderVisual:
|
|
621
|
-
onDragChange:
|
|
774
|
+
ref: O,
|
|
775
|
+
className: ae("aqvs-scrollbar-tap-circle-wrapper", Vt),
|
|
776
|
+
size: Mt,
|
|
777
|
+
maxVisualDistance: xt,
|
|
778
|
+
style: Ie,
|
|
779
|
+
opacity: Ve,
|
|
780
|
+
renderVisual: M,
|
|
781
|
+
onDragChange: ge
|
|
622
782
|
},
|
|
623
783
|
"tap-circle"
|
|
624
784
|
),
|
|
625
|
-
|
|
626
|
-
/* @__PURE__ */
|
|
785
|
+
ue(-1, Ct[0], ut[0], "arrow-start"),
|
|
786
|
+
/* @__PURE__ */ le(
|
|
627
787
|
"div",
|
|
628
788
|
{
|
|
629
789
|
className: "aqvs-scrollbar-track",
|
|
630
790
|
style: {
|
|
631
791
|
borderRadius: f / 2
|
|
632
792
|
},
|
|
633
|
-
onPointerDown:
|
|
634
|
-
onPointerMove:
|
|
635
|
-
onPointerUp:
|
|
636
|
-
onPointerCancel:
|
|
637
|
-
|
|
793
|
+
onPointerDown: Qt,
|
|
794
|
+
onPointerMove: ce,
|
|
795
|
+
onPointerUp: te,
|
|
796
|
+
onPointerCancel: Pe,
|
|
797
|
+
onLostPointerCapture: ye,
|
|
798
|
+
"aria-disabled": !s,
|
|
638
799
|
children: [
|
|
639
|
-
|
|
640
|
-
/* @__PURE__ */
|
|
800
|
+
de && /* @__PURE__ */ et("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: p?.(de) }, "overlay"),
|
|
801
|
+
/* @__PURE__ */ et(
|
|
641
802
|
"div",
|
|
642
803
|
{
|
|
643
|
-
className:
|
|
804
|
+
className: ae("aqvs-scrollbar-thumb-wrapper", !(Z || W) && "pointer-events-none opacity-0"),
|
|
644
805
|
style: {
|
|
645
|
-
[
|
|
646
|
-
[
|
|
647
|
-
...
|
|
806
|
+
[ct]: Et,
|
|
807
|
+
[pt]: lt,
|
|
808
|
+
...u ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
|
|
648
809
|
},
|
|
649
|
-
onPointerDown:
|
|
810
|
+
onPointerDown: Jt,
|
|
650
811
|
role: "slider",
|
|
651
|
-
"aria-orientation":
|
|
812
|
+
"aria-orientation": u ? "horizontal" : "vertical",
|
|
652
813
|
"aria-valuenow": e,
|
|
653
814
|
"aria-valuemin": 0,
|
|
654
|
-
"aria-valuemax":
|
|
655
|
-
"aria-disabled": !
|
|
815
|
+
"aria-valuemax": m,
|
|
816
|
+
"aria-disabled": !n,
|
|
656
817
|
tabIndex: -1,
|
|
657
|
-
children: /* @__PURE__ */
|
|
818
|
+
children: /* @__PURE__ */ et(
|
|
658
819
|
"div",
|
|
659
820
|
{
|
|
660
|
-
ref:
|
|
661
|
-
className:
|
|
662
|
-
"data-thumb-state":
|
|
821
|
+
ref: L,
|
|
822
|
+
className: ae("aqvs-scrollbar-thumb", u ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
|
|
823
|
+
"data-thumb-state": Ht,
|
|
663
824
|
style: {
|
|
664
825
|
borderRadius: f - 1,
|
|
665
|
-
cursor:
|
|
826
|
+
cursor: n ? "pointer" : "default"
|
|
666
827
|
},
|
|
667
828
|
onMouseEnter: () => {
|
|
668
|
-
|
|
829
|
+
n && ft(!0);
|
|
669
830
|
},
|
|
670
831
|
onMouseLeave: () => {
|
|
671
|
-
|
|
832
|
+
n && ft(!1);
|
|
672
833
|
}
|
|
673
834
|
},
|
|
674
835
|
"thumb"
|
|
@@ -680,186 +841,195 @@ const xt = (n, t, e) => Math.min(e, Math.max(t, n)), Me = "virtualscroll:tap-scr
|
|
|
680
841
|
},
|
|
681
842
|
"track"
|
|
682
843
|
),
|
|
683
|
-
|
|
844
|
+
ue(1, Ct[1], ut[1], "arrow-end")
|
|
684
845
|
]
|
|
685
846
|
}
|
|
686
847
|
);
|
|
687
|
-
},
|
|
848
|
+
}, Te = {
|
|
688
849
|
maxVelocity: 6,
|
|
689
850
|
minVelocity: 0.02,
|
|
690
851
|
deceleration: 25e-4,
|
|
691
852
|
velocitySampleWindow: 90,
|
|
692
853
|
startVelocityThreshold: 0.04
|
|
693
|
-
},
|
|
694
|
-
for (const [r,
|
|
695
|
-
e === "add" ?
|
|
696
|
-
},
|
|
854
|
+
}, Re = (i, t, e) => {
|
|
855
|
+
for (const [r, n, s] of t)
|
|
856
|
+
e === "add" ? i.addEventListener(r, n, s) : i.removeEventListener(r, n, s);
|
|
857
|
+
}, xr = Fe(
|
|
697
858
|
({
|
|
698
|
-
children:
|
|
859
|
+
children: i,
|
|
699
860
|
contentSize: t,
|
|
700
861
|
viewportSize: e,
|
|
701
862
|
scrollBarWidth: r = 12,
|
|
702
|
-
enableThumbDrag:
|
|
703
|
-
enableTrackClick:
|
|
704
|
-
enableArrowButtons:
|
|
705
|
-
enablePointerDrag:
|
|
863
|
+
enableThumbDrag: n = !0,
|
|
864
|
+
enableTrackClick: s = !0,
|
|
865
|
+
enableArrowButtons: l = !0,
|
|
866
|
+
enablePointerDrag: u = !0,
|
|
706
867
|
onScroll: f,
|
|
707
|
-
className:
|
|
708
|
-
style:
|
|
709
|
-
background:
|
|
710
|
-
tapScrollCircleOptions:
|
|
711
|
-
inertiaOptions:
|
|
712
|
-
itemCount:
|
|
713
|
-
renderThumbOverlay:
|
|
714
|
-
wheelSpeedMultiplier:
|
|
715
|
-
onWheelHorizontal:
|
|
716
|
-
contentInsets:
|
|
717
|
-
visibleStartIndex:
|
|
718
|
-
visibleEndIndex:
|
|
719
|
-
renderOverlay:
|
|
720
|
-
initialScrollPosition:
|
|
721
|
-
},
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}, [
|
|
726
|
-
const
|
|
868
|
+
className: I,
|
|
869
|
+
style: v,
|
|
870
|
+
background: T,
|
|
871
|
+
tapScrollCircleOptions: D,
|
|
872
|
+
inertiaOptions: p,
|
|
873
|
+
itemCount: z,
|
|
874
|
+
renderThumbOverlay: rt,
|
|
875
|
+
wheelSpeedMultiplier: W = 1,
|
|
876
|
+
onWheelHorizontal: ot,
|
|
877
|
+
contentInsets: nt,
|
|
878
|
+
visibleStartIndex: ft,
|
|
879
|
+
visibleEndIndex: St,
|
|
880
|
+
renderOverlay: wt,
|
|
881
|
+
initialScrollPosition: L = 0
|
|
882
|
+
}, F) => {
|
|
883
|
+
const h = b(Number.isFinite(L) ? Math.max(0, L) : 0), $ = b(null), q = b(null), H = b(ot);
|
|
884
|
+
X(() => {
|
|
885
|
+
H.current = ot;
|
|
886
|
+
}, [ot]);
|
|
887
|
+
const O = b({
|
|
727
888
|
frame: null,
|
|
728
889
|
velocity: 0,
|
|
729
|
-
lastTimestamp: null
|
|
730
|
-
|
|
890
|
+
lastTimestamp: null,
|
|
891
|
+
generation: 0
|
|
892
|
+
}), K = yt(
|
|
731
893
|
() => ({
|
|
732
|
-
maxVelocity:
|
|
733
|
-
minVelocity:
|
|
734
|
-
deceleration:
|
|
735
|
-
velocitySampleWindow:
|
|
736
|
-
startVelocityThreshold:
|
|
894
|
+
maxVelocity: p?.maxVelocity ?? Te.maxVelocity,
|
|
895
|
+
minVelocity: p?.minVelocity ?? Te.minVelocity,
|
|
896
|
+
deceleration: p?.deceleration ?? Te.deceleration,
|
|
897
|
+
velocitySampleWindow: p?.velocitySampleWindow ?? Te.velocitySampleWindow,
|
|
898
|
+
startVelocityThreshold: p?.startVelocityThreshold ?? Te.startVelocityThreshold
|
|
737
899
|
}),
|
|
738
|
-
[
|
|
739
|
-
),
|
|
740
|
-
top: Math.max(0,
|
|
741
|
-
bottom: Math.max(0,
|
|
742
|
-
}), [
|
|
743
|
-
|
|
900
|
+
[p]
|
|
901
|
+
), S = yt(() => ({
|
|
902
|
+
top: Math.max(0, nt?.top ?? 0),
|
|
903
|
+
bottom: Math.max(0, nt?.bottom ?? 0)
|
|
904
|
+
}), [nt]);
|
|
905
|
+
V.debug("[ScrollPane] ScrollPane rendered", () => ({
|
|
744
906
|
contentSize: t,
|
|
745
907
|
viewportSize: e,
|
|
746
908
|
scrollBarWidth: r,
|
|
747
|
-
className:
|
|
748
|
-
style:
|
|
749
|
-
tapScrollCircleOptions:
|
|
750
|
-
inertiaOptions:
|
|
751
|
-
enablePointerDrag:
|
|
752
|
-
contentInsets:
|
|
753
|
-
});
|
|
754
|
-
const
|
|
755
|
-
|
|
756
|
-
const
|
|
757
|
-
(
|
|
758
|
-
const { contentSize:
|
|
759
|
-
if (
|
|
760
|
-
return
|
|
761
|
-
const
|
|
762
|
-
|
|
909
|
+
className: I,
|
|
910
|
+
style: v,
|
|
911
|
+
tapScrollCircleOptions: D,
|
|
912
|
+
inertiaOptions: p,
|
|
913
|
+
enablePointerDrag: u,
|
|
914
|
+
contentInsets: S
|
|
915
|
+
}));
|
|
916
|
+
const U = b({ contentSize: t, viewportSize: e });
|
|
917
|
+
U.current = { contentSize: t, viewportSize: e };
|
|
918
|
+
const j = yt(() => t > e, [t, e]), k = y(
|
|
919
|
+
(M) => {
|
|
920
|
+
const { contentSize: Y, viewportSize: C } = U.current, ct = Y > C, at = h.current;
|
|
921
|
+
if (V.debug("[ScrollPane] scrollTo called", () => ({ newPosition: M, contentSize: Y, viewportSize: C, currentIsScrollable: ct, prevPosition: at })), !ct)
|
|
922
|
+
return h.current !== 0 && (h.current = 0, f?.(0, at)), h.current;
|
|
923
|
+
const pt = typeof M == "function" ? M(h.current) : M;
|
|
924
|
+
if (!Number.isFinite(pt))
|
|
925
|
+
return V.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: pt }), h.current;
|
|
926
|
+
const ht = Math.max(Y - C, 0), J = mt(pt, 0, ht);
|
|
927
|
+
return h.current !== J && (h.current = J, f?.(J, at)), h.current;
|
|
763
928
|
},
|
|
764
929
|
[f]
|
|
765
|
-
), G =
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
}, []),
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}, [G])
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
930
|
+
), G = y(() => {
|
|
931
|
+
const M = O.current;
|
|
932
|
+
M.generation += 1, M.frame !== null && cancelAnimationFrame(M.frame), M.frame = null, M.velocity = 0, M.lastTimestamp = null;
|
|
933
|
+
}, []), st = b(G);
|
|
934
|
+
X(() => {
|
|
935
|
+
st.current = G;
|
|
936
|
+
}, [G]), X(() => () => {
|
|
937
|
+
st.current();
|
|
938
|
+
}, []);
|
|
939
|
+
const Mt = y(
|
|
940
|
+
(M) => {
|
|
941
|
+
if (!j)
|
|
775
942
|
return;
|
|
776
|
-
const { maxVelocity:
|
|
777
|
-
if (Math.abs(
|
|
943
|
+
const { maxVelocity: Y, minVelocity: C, deceleration: ct, startVelocityThreshold: at } = K, pt = mt(M, -Y, Y);
|
|
944
|
+
if (Math.abs(pt) < at)
|
|
778
945
|
return;
|
|
779
|
-
G(),
|
|
780
|
-
const
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
|
|
946
|
+
G(), O.current.velocity = pt, O.current.lastTimestamp = null;
|
|
947
|
+
const ht = O.current.generation, J = (Ct) => {
|
|
948
|
+
const ut = O.current;
|
|
949
|
+
if (ut.generation !== ht)
|
|
950
|
+
return;
|
|
951
|
+
if (ut.lastTimestamp === null) {
|
|
952
|
+
ut.lastTimestamp = Ct, ut.frame = requestAnimationFrame(J);
|
|
784
953
|
return;
|
|
785
954
|
}
|
|
786
|
-
const
|
|
787
|
-
if (
|
|
788
|
-
|
|
955
|
+
const Kt = Ct - ut.lastTimestamp;
|
|
956
|
+
if (ut.lastTimestamp = Ct, Kt <= 0) {
|
|
957
|
+
ut.frame = requestAnimationFrame(J);
|
|
789
958
|
return;
|
|
790
959
|
}
|
|
791
|
-
const
|
|
792
|
-
let
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
960
|
+
const Lt = ut.velocity;
|
|
961
|
+
let xt = Lt;
|
|
962
|
+
const _t = ct * Kt;
|
|
963
|
+
Lt > 0 ? xt = Math.max(0, Lt - _t) : Lt < 0 && (xt = Math.min(0, Lt + _t));
|
|
964
|
+
const It = (Lt + xt) / 2 * Kt, Et = h.current;
|
|
965
|
+
if (It !== 0 && k((re) => re + It), O.current.generation !== ht)
|
|
966
|
+
return;
|
|
967
|
+
const m = h.current, { contentSize: E, viewportSize: lt } = U.current, zt = Math.max(E - lt, 0);
|
|
968
|
+
ut.velocity = xt;
|
|
969
|
+
const Z = m === Et || m <= 0 && xt <= 0 || m >= zt && xt >= 0;
|
|
970
|
+
if (Math.abs(xt) < C || Z) {
|
|
801
971
|
G();
|
|
802
972
|
return;
|
|
803
973
|
}
|
|
804
|
-
|
|
974
|
+
ut.frame = requestAnimationFrame(J);
|
|
805
975
|
};
|
|
806
|
-
|
|
976
|
+
O.current.frame = requestAnimationFrame(J);
|
|
807
977
|
},
|
|
808
|
-
[
|
|
809
|
-
),
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}, [
|
|
813
|
-
|
|
814
|
-
}, [t, e]),
|
|
815
|
-
const
|
|
816
|
-
if (!
|
|
817
|
-
const
|
|
818
|
-
|
|
978
|
+
[j, K, k, G]
|
|
979
|
+
), R = b(Mt);
|
|
980
|
+
X(() => {
|
|
981
|
+
R.current = Mt;
|
|
982
|
+
}, [Mt]), pe(() => {
|
|
983
|
+
U.current = { contentSize: t, viewportSize: e };
|
|
984
|
+
}, [t, e]), pe(() => {
|
|
985
|
+
const M = q.current;
|
|
986
|
+
if (!M) return;
|
|
987
|
+
const Y = () => {
|
|
988
|
+
M.scrollTop !== 0 && (V.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: M.scrollTop })), M.scrollTop = 0), M.scrollLeft !== 0 && (M.scrollLeft = 0);
|
|
819
989
|
};
|
|
820
|
-
return
|
|
821
|
-
}, []),
|
|
822
|
-
if (
|
|
823
|
-
|
|
824
|
-
const
|
|
825
|
-
|
|
990
|
+
return M.addEventListener("scroll", Y), () => M.removeEventListener("scroll", Y);
|
|
991
|
+
}, []), pe(() => {
|
|
992
|
+
if (j) {
|
|
993
|
+
V.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: t, viewportSize: e, scrollPosition: h.current }));
|
|
994
|
+
const M = mt(t - e, 0, t);
|
|
995
|
+
h.current > M && k(M);
|
|
826
996
|
} else
|
|
827
|
-
|
|
828
|
-
}, [
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
const
|
|
832
|
-
if (
|
|
833
|
-
|
|
834
|
-
let J =
|
|
835
|
-
|
|
997
|
+
k(0);
|
|
998
|
+
}, [j, k, t, e]), X(() => {
|
|
999
|
+
const M = (C) => {
|
|
1000
|
+
if (H.current && !C.ctrlKey) {
|
|
1001
|
+
const at = C.shiftKey && C.deltaX === 0, pt = at ? C.deltaY : C.deltaX, ht = at ? 0 : C.deltaY;
|
|
1002
|
+
if (pt !== 0 && Math.abs(pt) >= Math.abs(ht)) {
|
|
1003
|
+
C.preventDefault(), G();
|
|
1004
|
+
let J = pt;
|
|
1005
|
+
C.deltaMode === 1 ? J *= 16 : C.deltaMode === 2 && (J *= e), H.current(J);
|
|
836
1006
|
return;
|
|
837
1007
|
}
|
|
838
1008
|
}
|
|
839
|
-
if (!
|
|
1009
|
+
if (!j || C.ctrlKey || C.deltaY === 0)
|
|
840
1010
|
return;
|
|
841
|
-
|
|
842
|
-
let
|
|
843
|
-
|
|
844
|
-
},
|
|
845
|
-
return
|
|
846
|
-
|
|
1011
|
+
C.preventDefault(), G();
|
|
1012
|
+
let ct = C.deltaY;
|
|
1013
|
+
C.deltaMode === 1 ? ct *= 16 : C.deltaMode === 2 && (ct *= e), W !== 1 && (ct *= W), V.debug("[ScrollPane] wheel event", () => ({ deltaY: ct, scrollPosition: h.current, wheelSpeedMultiplier: W, deltaMode: C.deltaMode, scrollTop: q.current?.scrollTop })), k((at) => at + ct);
|
|
1014
|
+
}, Y = $.current;
|
|
1015
|
+
return Y && Y.addEventListener("wheel", M, { passive: !1 }), () => {
|
|
1016
|
+
Y && Y.removeEventListener("wheel", M);
|
|
847
1017
|
};
|
|
848
|
-
}, [
|
|
849
|
-
|
|
1018
|
+
}, [j, k, G, e, W]), ke(
|
|
1019
|
+
F,
|
|
850
1020
|
() => ({
|
|
851
|
-
scrollTo: (
|
|
852
|
-
getScrollPosition: () =>
|
|
1021
|
+
scrollTo: (M) => (G(), k(M)),
|
|
1022
|
+
getScrollPosition: () => h.current,
|
|
853
1023
|
getContentSize: () => t,
|
|
854
1024
|
getViewportSize: () => e
|
|
855
1025
|
}),
|
|
856
|
-
[
|
|
1026
|
+
[k, t, e, G]
|
|
857
1027
|
);
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}, [
|
|
862
|
-
const
|
|
1028
|
+
const Dt = b(k);
|
|
1029
|
+
X(() => {
|
|
1030
|
+
Dt.current = k;
|
|
1031
|
+
}, [k]);
|
|
1032
|
+
const Vt = er(), x = b({
|
|
863
1033
|
pointerId: null,
|
|
864
1034
|
startClientY: 0,
|
|
865
1035
|
startScroll: 0,
|
|
@@ -867,201 +1037,225 @@ const xt = (n, t, e) => Math.min(e, Math.max(t, n)), Me = "virtualscroll:tap-scr
|
|
|
867
1037
|
shouldCancelNextClick: !1,
|
|
868
1038
|
clickResetTimer: null,
|
|
869
1039
|
velocitySamples: []
|
|
870
|
-
}),
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}, [
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
}, [
|
|
878
|
-
const
|
|
879
|
-
return
|
|
880
|
-
|
|
881
|
-
}, [
|
|
882
|
-
if (
|
|
1040
|
+
}), Rt = b(u);
|
|
1041
|
+
X(() => {
|
|
1042
|
+
Rt.current = u;
|
|
1043
|
+
}, [u]);
|
|
1044
|
+
const At = b(j);
|
|
1045
|
+
X(() => {
|
|
1046
|
+
At.current = j;
|
|
1047
|
+
}, [j]);
|
|
1048
|
+
const qt = b(K);
|
|
1049
|
+
return X(() => {
|
|
1050
|
+
qt.current = K;
|
|
1051
|
+
}, [K]), X(() => {
|
|
1052
|
+
if (u)
|
|
883
1053
|
return;
|
|
884
|
-
const
|
|
885
|
-
|
|
886
|
-
}, [
|
|
887
|
-
const
|
|
888
|
-
if (!
|
|
1054
|
+
const M = q.current, Y = x.current;
|
|
1055
|
+
Y.pointerId !== null && M?.hasPointerCapture(Y.pointerId) && M.releasePointerCapture(Y.pointerId), Y.clickResetTimer !== null && (window.clearTimeout(Y.clickResetTimer), Y.clickResetTimer = null), Y.pointerId = null, Y.startClientY = 0, Y.startScroll = 0, Y.isDragging = !1, Y.shouldCancelNextClick = !1, Y.velocitySamples = [];
|
|
1056
|
+
}, [u]), X(() => {
|
|
1057
|
+
const M = q.current;
|
|
1058
|
+
if (!M)
|
|
889
1059
|
return;
|
|
890
|
-
const
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
},
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
},
|
|
897
|
-
const
|
|
898
|
-
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
},
|
|
902
|
-
const
|
|
903
|
-
|
|
904
|
-
},
|
|
905
|
-
const
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1060
|
+
const Y = 6, C = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), ct = () => {
|
|
1061
|
+
const m = x.current;
|
|
1062
|
+
m.pointerId = null, m.startClientY = 0, m.startScroll = 0, m.isDragging = !1, m.velocitySamples = [];
|
|
1063
|
+
}, at = () => {
|
|
1064
|
+
const m = x.current;
|
|
1065
|
+
m.clickResetTimer !== null && (window.clearTimeout(m.clickResetTimer), m.clickResetTimer = null);
|
|
1066
|
+
}, pt = (m) => {
|
|
1067
|
+
const E = x.current, lt = C();
|
|
1068
|
+
E.velocitySamples.push({ clientY: m, time: lt });
|
|
1069
|
+
const zt = qt.current.velocitySampleWindow;
|
|
1070
|
+
E.velocitySamples = E.velocitySamples.filter((Z) => lt - Z.time <= zt);
|
|
1071
|
+
}, ht = (m) => m instanceof HTMLElement && m.closest("[data-scrollpane-ignore-drag='true']") !== null, J = (m) => {
|
|
1072
|
+
const E = x.current;
|
|
1073
|
+
E.shouldCancelNextClick && (m.preventDefault(), m.stopPropagation(), E.shouldCancelNextClick = !1);
|
|
1074
|
+
}, Ct = (m) => {
|
|
1075
|
+
const E = x.current;
|
|
1076
|
+
if (!E.isDragging) {
|
|
1077
|
+
if (E.isDragging = !0, E.shouldCancelNextClick = !0, !M.hasPointerCapture(m.pointerId))
|
|
1078
|
+
try {
|
|
1079
|
+
M.setPointerCapture(m.pointerId);
|
|
1080
|
+
} catch {
|
|
1081
|
+
}
|
|
1082
|
+
pt(m.clientY);
|
|
1083
|
+
}
|
|
1084
|
+
}, ut = (m) => {
|
|
1085
|
+
const E = x.current;
|
|
1086
|
+
M.hasPointerCapture(m) && M.releasePointerCapture(m), E.shouldCancelNextClick = !1, at(), ct();
|
|
1087
|
+
}, Kt = (m) => {
|
|
1088
|
+
const E = x.current;
|
|
1089
|
+
if (E.pointerId !== m.pointerId)
|
|
910
1090
|
return;
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
kt.current(Lt), p.cancelable && p.preventDefault();
|
|
914
|
-
}, yt = (p) => {
|
|
915
|
-
const y = rt.current;
|
|
916
|
-
if (y.pointerId !== p.pointerId)
|
|
1091
|
+
if (m.buttons === 0) {
|
|
1092
|
+
ut(m.pointerId);
|
|
917
1093
|
return;
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1094
|
+
}
|
|
1095
|
+
if (!(Rt.current && At.current) || !E.isDragging && (Math.abs(m.clientY - E.startClientY) < Y || (Ct(m), !E.isDragging)))
|
|
1096
|
+
return;
|
|
1097
|
+
pt(m.clientY);
|
|
1098
|
+
const lt = m.clientY - E.startClientY, zt = E.startScroll - lt;
|
|
1099
|
+
Dt.current(zt), m.cancelable && m.preventDefault();
|
|
1100
|
+
}, Lt = (m) => {
|
|
1101
|
+
const E = x.current;
|
|
1102
|
+
if (E.pointerId !== m.pointerId)
|
|
1103
|
+
return;
|
|
1104
|
+
E.isDragging && E.shouldCancelNextClick && m.cancelable && (m.preventDefault(), m.stopPropagation()), E.isDragging && pt(m.clientY);
|
|
1105
|
+
let lt = 0;
|
|
1106
|
+
if (E.isDragging && E.velocitySamples.length >= 2) {
|
|
1107
|
+
const Z = E.velocitySamples, re = qt.current.velocitySampleWindow, Ht = Z[Z.length - 1], Nt = Z.find((Wt) => Ht.time - Wt.time <= re) ?? Z[0];
|
|
1108
|
+
if (Ht && Nt && Ht.time !== Nt.time) {
|
|
1109
|
+
const Wt = Ht.clientY - Nt.clientY, jt = Ht.time - Nt.time;
|
|
1110
|
+
lt = -(Wt / jt);
|
|
925
1111
|
}
|
|
926
1112
|
}
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
|
|
1113
|
+
at(), E.shouldCancelNextClick && (E.clickResetTimer = window.setTimeout(() => {
|
|
1114
|
+
const Z = x.current;
|
|
1115
|
+
Z.shouldCancelNextClick = !1, Z.clickResetTimer = null;
|
|
930
1116
|
}, 0));
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
},
|
|
934
|
-
if (!(
|
|
1117
|
+
const zt = qt.current.startVelocityThreshold;
|
|
1118
|
+
ct(), M.hasPointerCapture(m.pointerId) && M.releasePointerCapture(m.pointerId), Math.abs(lt) >= zt && R.current?.(lt);
|
|
1119
|
+
}, xt = (m) => {
|
|
1120
|
+
if (x.current.pointerId !== null || !(Rt.current && At.current) || m.button !== 0 && m.pointerType === "mouse" || m.ctrlKey || m.metaKey || m.altKey || ht(m.target))
|
|
935
1121
|
return;
|
|
936
|
-
window.dispatchEvent(new CustomEvent(
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
},
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
}, _t = [
|
|
1122
|
+
window.dispatchEvent(new CustomEvent(Oe, { detail: { paneId: Vt } })), st.current?.();
|
|
1123
|
+
const E = x.current;
|
|
1124
|
+
at(), E.pointerId = m.pointerId, E.startClientY = m.clientY, E.startScroll = h.current, E.isDragging = !1, E.shouldCancelNextClick = !1, E.velocitySamples = [];
|
|
1125
|
+
}, _t = (m) => {
|
|
1126
|
+
x.current.pointerId === m.pointerId && ut(m.pointerId);
|
|
1127
|
+
}, It = [
|
|
943
1128
|
["click", J, !0],
|
|
944
|
-
["pointerdown",
|
|
945
|
-
["
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
],
|
|
949
|
-
["pointermove",
|
|
950
|
-
["pointerup",
|
|
951
|
-
["pointercancel",
|
|
1129
|
+
["pointerdown", xt, { passive: !1 }],
|
|
1130
|
+
["lostpointercapture", (m) => {
|
|
1131
|
+
x.current.pointerId === m.pointerId && ut(m.pointerId);
|
|
1132
|
+
}, void 0]
|
|
1133
|
+
], Et = [
|
|
1134
|
+
["pointermove", Kt, { passive: !1 }],
|
|
1135
|
+
["pointerup", Lt, void 0],
|
|
1136
|
+
["pointercancel", _t, void 0]
|
|
952
1137
|
];
|
|
953
|
-
return
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
|
|
1138
|
+
return Re(M, It, "add"), Re(window, Et, "add"), () => {
|
|
1139
|
+
Re(M, It, "remove"), Re(window, Et, "remove");
|
|
1140
|
+
const m = x.current;
|
|
1141
|
+
m.pointerId !== null && M.hasPointerCapture(m.pointerId) && M.releasePointerCapture(m.pointerId), at(), ct();
|
|
957
1142
|
};
|
|
958
|
-
}, [
|
|
959
|
-
/* @__PURE__ */
|
|
1143
|
+
}, [Vt]), /* @__PURE__ */ le("div", { ref: $, className: ae("aqvs-scroll-pane", I), style: v, children: [
|
|
1144
|
+
/* @__PURE__ */ le(
|
|
960
1145
|
"div",
|
|
961
1146
|
{
|
|
962
|
-
ref:
|
|
963
|
-
className:
|
|
1147
|
+
ref: q,
|
|
1148
|
+
className: ae("aqvs-scroll-pane-content"),
|
|
964
1149
|
style: {
|
|
965
1150
|
height: e,
|
|
966
|
-
paddingTop:
|
|
967
|
-
paddingBottom:
|
|
968
|
-
|
|
1151
|
+
paddingTop: S.top,
|
|
1152
|
+
paddingBottom: S.bottom,
|
|
1153
|
+
// スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
|
|
1154
|
+
// 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ
|
|
1155
|
+
...u && j ? { touchAction: "none" } : {}
|
|
969
1156
|
},
|
|
970
|
-
id:
|
|
1157
|
+
id: Vt,
|
|
971
1158
|
children: [
|
|
972
|
-
|
|
973
|
-
|
|
1159
|
+
T,
|
|
1160
|
+
i(h.current)
|
|
974
1161
|
]
|
|
975
1162
|
}
|
|
976
1163
|
),
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
|
|
1164
|
+
/* @__PURE__ */ et(
|
|
1165
|
+
br,
|
|
979
1166
|
{
|
|
980
1167
|
contentSize: t,
|
|
981
1168
|
viewportSize: e,
|
|
982
|
-
scrollPosition:
|
|
983
|
-
onScroll:
|
|
984
|
-
enableThumbDrag:
|
|
985
|
-
enableTrackClick:
|
|
986
|
-
enableArrowButtons:
|
|
1169
|
+
scrollPosition: h.current,
|
|
1170
|
+
onScroll: k,
|
|
1171
|
+
enableThumbDrag: n,
|
|
1172
|
+
enableTrackClick: s,
|
|
1173
|
+
enableArrowButtons: l,
|
|
987
1174
|
scrollBarWidth: r,
|
|
988
|
-
ariaControls:
|
|
989
|
-
tapScrollCircleOptions:
|
|
990
|
-
itemCount:
|
|
991
|
-
renderThumbOverlay:
|
|
992
|
-
visibleStartIndex:
|
|
993
|
-
visibleEndIndex:
|
|
1175
|
+
ariaControls: Vt,
|
|
1176
|
+
tapScrollCircleOptions: D,
|
|
1177
|
+
itemCount: z,
|
|
1178
|
+
renderThumbOverlay: rt,
|
|
1179
|
+
visibleStartIndex: ft,
|
|
1180
|
+
visibleEndIndex: St
|
|
994
1181
|
},
|
|
995
1182
|
"scrollbar"
|
|
996
1183
|
),
|
|
997
|
-
|
|
1184
|
+
wt?.()
|
|
998
1185
|
] });
|
|
999
1186
|
}
|
|
1000
|
-
),
|
|
1001
|
-
const
|
|
1002
|
-
return /* @__PURE__ */
|
|
1003
|
-
/* @__PURE__ */
|
|
1187
|
+
), He = (i, t, e) => Math.min(Math.max(i, t), e), Dr = ({ dragState: i, normalizedDistance: t, sizeScale: e, size: r }) => {
|
|
1188
|
+
const n = Math.max(r / 2, 1), s = 1 + t * 0.65, l = Math.max(0.65, 1 - t * 0.25), u = i.direction * t * 26 * e, f = 0.8 + t * 0.18, I = 3 * e, v = 6 * e, T = 22 * e, D = Math.abs(u) + v, p = u > 0 ? I : -Math.abs(u) - I, z = Math.max(2.5, 3 * e), rt = He(i.offsetX, -n, n), W = He(i.offsetY, -n, n), ot = n * 0.35, nt = rt / n * ot, ft = W / n * ot, St = nt * 0.45, wt = ft * 0.45, L = Math.max(T * 0.38, 6), F = 0.65 + t * 0.2, h = i.active;
|
|
1189
|
+
return /* @__PURE__ */ le(Ke, { children: [
|
|
1190
|
+
/* @__PURE__ */ et(
|
|
1004
1191
|
"div",
|
|
1005
1192
|
{
|
|
1006
1193
|
className: "aqvs-tap-scroll-circle-gradient",
|
|
1007
1194
|
style: {
|
|
1008
|
-
transform: `scale(${
|
|
1009
|
-
transition:
|
|
1195
|
+
transform: `scale(${l}, ${s})`,
|
|
1196
|
+
transition: h ? "40ms transform ease-out" : "200ms ease transform"
|
|
1010
1197
|
}
|
|
1011
1198
|
}
|
|
1012
1199
|
),
|
|
1013
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ et(
|
|
1014
1201
|
"div",
|
|
1015
1202
|
{
|
|
1016
1203
|
className: "aqvs-sample-visual-rod",
|
|
1017
1204
|
style: {
|
|
1018
|
-
width:
|
|
1019
|
-
height:
|
|
1020
|
-
transform: `translate(calc(-50% + ${
|
|
1021
|
-
transition:
|
|
1205
|
+
width: T,
|
|
1206
|
+
height: T,
|
|
1207
|
+
transform: `translate(calc(-50% + ${nt}px), calc(-50% + ${ft}px)) scale(${l}, ${f * s})`,
|
|
1208
|
+
transition: h ? "70ms transform ease-out" : "200ms ease transform"
|
|
1022
1209
|
}
|
|
1023
1210
|
}
|
|
1024
1211
|
),
|
|
1025
|
-
/* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ et(
|
|
1026
1213
|
"div",
|
|
1027
1214
|
{
|
|
1028
1215
|
className: "aqvs-sample-visual-pupil",
|
|
1029
1216
|
style: {
|
|
1030
|
-
width:
|
|
1031
|
-
height:
|
|
1032
|
-
transform: `translate(calc(-50% + ${
|
|
1033
|
-
opacity:
|
|
1217
|
+
width: L,
|
|
1218
|
+
height: L,
|
|
1219
|
+
transform: `translate(calc(-50% + ${St}px), calc(-50% + ${wt}px)) scale(${l}, ${s})`,
|
|
1220
|
+
opacity: F,
|
|
1034
1221
|
boxShadow: "0 0 8px rgba(255,255,255,0.45)",
|
|
1035
|
-
transition:
|
|
1222
|
+
transition: h ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
|
|
1036
1223
|
}
|
|
1037
1224
|
}
|
|
1038
1225
|
),
|
|
1039
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ et(
|
|
1040
1227
|
"div",
|
|
1041
1228
|
{
|
|
1042
1229
|
className: "aqvs-sample-visual-highlight",
|
|
1043
1230
|
style: {
|
|
1044
|
-
width:
|
|
1045
|
-
height:
|
|
1046
|
-
transform: `translate(-50%, ${
|
|
1231
|
+
width: z,
|
|
1232
|
+
height: D,
|
|
1233
|
+
transform: `translate(-50%, ${p}px)`,
|
|
1047
1234
|
opacity: t,
|
|
1048
|
-
transition:
|
|
1235
|
+
transition: h ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
|
|
1049
1236
|
}
|
|
1050
1237
|
}
|
|
1051
1238
|
)
|
|
1052
1239
|
] });
|
|
1053
|
-
},
|
|
1054
|
-
if (!Number.isFinite(
|
|
1240
|
+
}, Ce = 100, Ir = (i) => {
|
|
1241
|
+
if (!Number.isFinite(i))
|
|
1055
1242
|
return 0n;
|
|
1056
|
-
const t = Math.trunc(
|
|
1243
|
+
const t = Math.trunc(i);
|
|
1057
1244
|
return t <= 0 ? 0n : BigInt(t);
|
|
1058
|
-
},
|
|
1059
|
-
if (
|
|
1245
|
+
}, Le = (i, t) => {
|
|
1246
|
+
if (!Number.isFinite(i))
|
|
1247
|
+
throw new Error(`valueFn returned a non-finite value at index ${t}: ${i}`);
|
|
1248
|
+
return i;
|
|
1249
|
+
}, fe = (i) => {
|
|
1250
|
+
if (i <= 0 || !Number.isFinite(i))
|
|
1060
1251
|
return 0;
|
|
1061
|
-
const t = Math.trunc(
|
|
1252
|
+
const t = Math.trunc(i);
|
|
1253
|
+
if (t <= 2147483647)
|
|
1254
|
+
return t & -t;
|
|
1255
|
+
const e = BigInt(t) & -BigInt(t);
|
|
1062
1256
|
return Number(e);
|
|
1063
1257
|
};
|
|
1064
|
-
class
|
|
1258
|
+
class oe {
|
|
1065
1259
|
/**
|
|
1066
1260
|
* @private
|
|
1067
1261
|
* @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
|
|
@@ -1106,32 +1300,48 @@ class cr {
|
|
|
1106
1300
|
}
|
|
1107
1301
|
/**
|
|
1108
1302
|
* @method reset
|
|
1109
|
-
* @description Resets the Fenwick Tree with a new size and initial values.
|
|
1110
|
-
*
|
|
1303
|
+
* @description Resets the Fenwick Tree with a new size and initial values. The size is
|
|
1304
|
+
* normalized on entry (non-finite/negative sizes collapse to 0, fractions are truncated).
|
|
1305
|
+
* When `valueOrFn` is a function, all sampling/materialization values are computed and
|
|
1306
|
+
* validated (finite-only) before the tree state is mutated, so a `valueFn` returning
|
|
1307
|
+
* NaN/Infinity throws while leaving the previous tree state intact instead of a half-built one.
|
|
1308
|
+
* @description Fenwick Tree を新しいサイズと初期値でリセット。size は入口で正規化する
|
|
1309
|
+
* (非有限/負は 0 に縮退、小数は切り捨て)。`valueOrFn` が関数の場合、サンプリング/具現化の値は
|
|
1310
|
+
* 木の状態を変異させる前に計算・検証 (有限数のみ) するため、NaN/Infinity を返す `valueFn` は
|
|
1311
|
+
* throw しつつ木を半構築で残さず直前の状態を無傷に保つ方針。
|
|
1111
1312
|
* @param {number} size - The total number of items.
|
|
1112
1313
|
* @param {number | ((index: number) => number)} valueOrFn - The value for all elements, or a function to generate values.
|
|
1113
1314
|
* @param {{ sampleRange?: { from: number; to: number }, materialize?: boolean }} [options] - Optional settings for initialization.
|
|
1114
1315
|
*/
|
|
1115
1316
|
reset(t, e, r) {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1317
|
+
const n = Number.isFinite(t) && t > 0 ? Math.trunc(t) : 0;
|
|
1318
|
+
if (typeof e != "function") {
|
|
1319
|
+
this.size = n, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.valueFn = void 0, this.baseValue = e, this.total = this.baseValue * this.size;
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
let s = 0, l;
|
|
1323
|
+
if (n > 0) {
|
|
1324
|
+
const u = r?.sampleRange ?? {
|
|
1325
|
+
from: 0,
|
|
1326
|
+
to: Math.min(Ce - 1, n - 1)
|
|
1327
|
+
};
|
|
1328
|
+
let f = Math.max(0, Math.trunc(u.from)), I = Math.min(Math.trunc(u.to), n - 1);
|
|
1329
|
+
if (f > I && (f = 0, I = Math.min(Ce - 1, n - 1)), n > Ce)
|
|
1330
|
+
s = oe._sampleBaseValueStrided(e, n, Ce), r?.materialize && (l = { from: f, values: oe._collectValidatedValues(e, f, I) });
|
|
1331
|
+
else {
|
|
1332
|
+
const v = oe._collectValidatedValues(e, f, I);
|
|
1333
|
+
s = oe._modeOrMedian([...v]), r?.materialize && (l = { from: f, values: v });
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
if (this.size = n, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s, l)
|
|
1337
|
+
for (let u = 0; u < l.values.length; u++) {
|
|
1338
|
+
const f = l.from + u;
|
|
1339
|
+
if (f >= this.size)
|
|
1340
|
+
break;
|
|
1341
|
+
const I = l.values[u] - this.baseValue;
|
|
1342
|
+
I !== 0 && (this.deltas.set(f, I), this._updateTree(f, I));
|
|
1343
|
+
}
|
|
1344
|
+
this.total = this.getTotal();
|
|
1135
1345
|
}
|
|
1136
1346
|
/**
|
|
1137
1347
|
* @method setValueFn
|
|
@@ -1145,44 +1355,73 @@ class cr {
|
|
|
1145
1355
|
this.reset(this.size, t);
|
|
1146
1356
|
return;
|
|
1147
1357
|
}
|
|
1148
|
-
typeof t == "function" ? this.valueFn = t : (this.valueFn = void 0, this.baseValue = t);
|
|
1358
|
+
typeof t == "function" ? this.valueFn = t : (this.valueFn = void 0, this.baseValue = t, this.total = this._computeTreeTotal());
|
|
1149
1359
|
}
|
|
1150
1360
|
/**
|
|
1151
1361
|
* @private
|
|
1152
|
-
* @method
|
|
1153
|
-
* @description
|
|
1154
|
-
* @description `valueFn`
|
|
1362
|
+
* @method _collectValidatedValues
|
|
1363
|
+
* @description Evaluates `valueFn` over the inclusive `[from, to]` range and returns the values, throwing on any non-finite result. Validation happens here, before any tree mutation, so a poisoned `valueFn` can never leave the tree half-built.
|
|
1364
|
+
* @description `valueFn` を閉区間 `[from, to]` で評価して値配列を返す。非有限値は throw で拒否。検証を木の変異前 (このメソッド内) で行うことで、汚染された `valueFn` が木を半構築のまま残す事態の防止。
|
|
1365
|
+
* @param {(index: number) => number} valueFn - The value-generating function to evaluate.
|
|
1155
1366
|
* @param {number} from - The starting index of the range (inclusive).
|
|
1156
1367
|
* @param {number} to - The ending index of the range (inclusive).
|
|
1157
|
-
* @returns {
|
|
1368
|
+
* @returns {number[]} The validated (finite-only) values in index order.
|
|
1369
|
+
*/
|
|
1370
|
+
static _collectValidatedValues(t, e, r) {
|
|
1371
|
+
const n = [];
|
|
1372
|
+
for (let s = e; s <= r; s++)
|
|
1373
|
+
n.push(Le(t(s), s));
|
|
1374
|
+
return n;
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* @private
|
|
1378
|
+
* @method _modeOrMedian
|
|
1379
|
+
* @description Reduces a sample of generated values to a single representative height: the mode when it is frequent enough to be trustworthy, otherwise the median. A value is only accepted as the mode when its frequency exceeds 20% of the sample; this prevents periodic or near-uniform data (where sampling bias can make an arbitrary value momentarily frequent) from picking an unrepresentative base. Multiple co-modes are averaged.
|
|
1380
|
+
* @description サンプル値を 1 つの代表的な高さへ縮約する。信頼できるほど頻出する場合は最頻値を、そうでなければ中央値を返す。最頻値はサンプルの 20% を超える頻度のときのみ採用し、周期的/ほぼ一様なデータ (サンプリング偏りで任意の値が一時的に頻出しうる) が非代表値を選ぶのを防ぐ。同率最頻値が複数ある場合は平均する。
|
|
1381
|
+
* @param {number[]} values - The sampled values (mutated in place by sorting).
|
|
1382
|
+
* @returns {number} The representative base value.
|
|
1158
1383
|
*/
|
|
1159
|
-
|
|
1160
|
-
if (
|
|
1161
|
-
return
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
r.length % 2 === 0 ? c = Math.floor((r[l - 1] + r[l]) / 2) : c = r[l];
|
|
1172
|
-
const d = /* @__PURE__ */ new Map();
|
|
1173
|
-
let f = 0;
|
|
1174
|
-
for (const h of r) {
|
|
1175
|
-
const m = (d.get(h) ?? 0) + 1;
|
|
1176
|
-
d.set(h, m), m > f && (f = m);
|
|
1384
|
+
static _modeOrMedian(t) {
|
|
1385
|
+
if (t.length === 0)
|
|
1386
|
+
return 0;
|
|
1387
|
+
t.sort((l, u) => l - u);
|
|
1388
|
+
const e = Math.floor(t.length / 2);
|
|
1389
|
+
let r;
|
|
1390
|
+
t.length % 2 === 0 ? r = Math.floor((t[e - 1] + t[e]) / 2) : r = t[e];
|
|
1391
|
+
const n = /* @__PURE__ */ new Map();
|
|
1392
|
+
let s = 0;
|
|
1393
|
+
for (const l of t) {
|
|
1394
|
+
const u = (n.get(l) ?? 0) + 1;
|
|
1395
|
+
n.set(l, u), u > s && (s = u);
|
|
1177
1396
|
}
|
|
1178
|
-
if (
|
|
1179
|
-
const
|
|
1180
|
-
for (const [
|
|
1181
|
-
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1397
|
+
if (s > t.length * 0.2) {
|
|
1398
|
+
const l = [];
|
|
1399
|
+
for (const [f, I] of n.entries())
|
|
1400
|
+
I === s && l.push(f);
|
|
1401
|
+
const u = l.reduce((f, I) => f + I, 0);
|
|
1402
|
+
r = Math.floor(u / l.length);
|
|
1184
1403
|
}
|
|
1185
|
-
return
|
|
1404
|
+
return r;
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* @private
|
|
1408
|
+
* @method _sampleBaseValueStrided
|
|
1409
|
+
* @description Estimates `baseValue` by evaluating `valueFn` at up to `sampleCount` points spread across the entire `[0, size-1]` range, then reducing them via `_modeOrMedian`. Spanning the whole list (rather than a fixed head window) makes the majority height win even when the first items are atypical (hero/heading rows). The stride uses `ceil(size / sampleCount)` so the samples always span the whole range — `floor` would collapse to stride 1 for `sampleCount < size < 2 * sampleCount` and only ever look at the head. The stride is also forced odd to avoid aliasing against common even-period layouts (e.g. alternating or 20-row cycles), which a stride that shares a factor with the period would otherwise collapse into a single residue. For a uniform list every sample is identical, so the estimate is unchanged. Non-finite sample values throw before any state is touched.
|
|
1410
|
+
* @description `valueFn` を `[0, size-1]` 全域に散らした最大 `sampleCount` 点で評価し、`_modeOrMedian` で縮約して `baseValue` を推定する。先頭固定ウィンドウではなくリスト全体を跨ぐことで、先頭が非典型 (ヒーロー/見出し行) でも多数派の高さが選ばれる。ストライドは `ceil(size / sampleCount)` を用いて常に全域を跨がせる (`floor` だと `sampleCount < size < 2 * sampleCount` で stride=1 に潰れ先頭しか見ない盲点が生じる)。さらに奇数へ強制し、周期と公約数を持つストライドがサンプルを 1 剰余類へ潰してしまう周期レイアウト (交互・20行周期など) とのエイリアシングを避ける。一様リストでは全サンプルが同一なので推定値は不変。非有限のサンプル値は状態を変異させる前に throw で拒否。
|
|
1411
|
+
* @param {(index: number) => number} valueFn - The value-generating function to sample.
|
|
1412
|
+
* @param {number} size - The total number of items the tree will manage.
|
|
1413
|
+
* @param {number} sampleCount - Maximum number of points to evaluate.
|
|
1414
|
+
* @returns {number} The estimated base value.
|
|
1415
|
+
*/
|
|
1416
|
+
static _sampleBaseValueStrided(t, e, r) {
|
|
1417
|
+
if (e <= 0)
|
|
1418
|
+
return 0;
|
|
1419
|
+
let n = Math.max(1, Math.ceil(e / r));
|
|
1420
|
+
n % 2 === 0 && (n += 1);
|
|
1421
|
+
const s = [];
|
|
1422
|
+
for (let l = 0; l < e && s.length < r; l += n)
|
|
1423
|
+
s.push(Le(t(l), l));
|
|
1424
|
+
return oe._modeOrMedian(s);
|
|
1186
1425
|
}
|
|
1187
1426
|
/**
|
|
1188
1427
|
* @method update
|
|
@@ -1206,8 +1445,8 @@ class cr {
|
|
|
1206
1445
|
}
|
|
1207
1446
|
/**
|
|
1208
1447
|
* @method updateDelta
|
|
1209
|
-
* @description Updates the delta at a given index and propagates the change through the tree.
|
|
1210
|
-
* @description
|
|
1448
|
+
* @description Updates the delta at a given index and propagates the change through the tree. A change that would make the effective value (`baseValue` + delta) negative is rejected with an error, mirroring the negative-value rejection of `update`/`updates`.
|
|
1449
|
+
* @description 指定されたインデックスのデルタを更新し、変更をツリーに伝播させる。適用後の実効値 (`baseValue` + delta) が負になる変更は `update`/`updates` の負値拒否と対称に throw で拒否する方針。
|
|
1211
1450
|
* @param {number} index - The 0-based index to update.
|
|
1212
1451
|
* @param {number} change - The value to add to the delta at the given index.
|
|
1213
1452
|
*/
|
|
@@ -1216,16 +1455,27 @@ class cr {
|
|
|
1216
1455
|
}
|
|
1217
1456
|
/**
|
|
1218
1457
|
* @method updateDeltas
|
|
1219
|
-
* @description Updates the deltas at given indices and propagates the changes through the tree.
|
|
1220
|
-
* @description
|
|
1458
|
+
* @description Updates the deltas at given indices and propagates the changes through the tree. All entries are validated up front (atomicity): out-of-range or non-integer indices, non-finite changes, and changes whose resulting effective value (`baseValue` + delta) would turn negative are rejected with an error before anything is applied. Negative effective values would break the monotonic prefix sums that `_descend`/`_findIndexLarge` rely on.
|
|
1459
|
+
* @description 指定されたインデックスのデルタを更新し、変更をツリーに伝播させる。全件を先に検証してから適用する (アトミック性): 範囲外/非整数の index、非有限の change、適用後の実効値 (`baseValue` + delta) が負になる変更はいずれも適用前に throw で拒否。負の実効値は `_descend`/`_findIndexLarge` が前提とする累積和の単調性を破壊するため。
|
|
1221
1460
|
* @param {DeltaUpdate[]} updates - An array of updates, each with an index and the change to apply.
|
|
1222
1461
|
*/
|
|
1223
1462
|
updateDeltas(t) {
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1463
|
+
const e = /* @__PURE__ */ new Map();
|
|
1464
|
+
for (const { index: r, change: n } of t) {
|
|
1465
|
+
if (r < 0 || r >= this.size)
|
|
1466
|
+
throw new Error(`Index ${r} out of bounds`);
|
|
1467
|
+
if (!Number.isInteger(r))
|
|
1468
|
+
throw new Error(`Index must be an integer: ${r}`);
|
|
1469
|
+
if (!Number.isFinite(n))
|
|
1470
|
+
throw new Error(`Change must be a finite number: ${n}`);
|
|
1471
|
+
const l = (e.get(r) ?? this.deltas.get(r) ?? 0) + n;
|
|
1472
|
+
if (l + this.baseValue < -1e-9)
|
|
1473
|
+
throw new Error(`Change would make the value at index ${r} negative: ${l + this.baseValue}`);
|
|
1474
|
+
e.set(r, l);
|
|
1475
|
+
}
|
|
1476
|
+
for (const { index: r, change: n } of t) {
|
|
1477
|
+
const l = (this.deltas.get(r) ?? 0) + n;
|
|
1478
|
+
l === 0 ? this.deltas.delete(r) : this.deltas.set(r, l), this._updateTree(r, n);
|
|
1229
1479
|
}
|
|
1230
1480
|
return this.total;
|
|
1231
1481
|
}
|
|
@@ -1243,10 +1493,10 @@ class cr {
|
|
|
1243
1493
|
let r = t + 1;
|
|
1244
1494
|
for (; r <= this.size; ) {
|
|
1245
1495
|
this.tree.set(r, (this.tree.get(r) ?? 0) + e);
|
|
1246
|
-
const
|
|
1247
|
-
if (
|
|
1496
|
+
const n = fe(r);
|
|
1497
|
+
if (n === 0)
|
|
1248
1498
|
break;
|
|
1249
|
-
r +=
|
|
1499
|
+
r += n;
|
|
1250
1500
|
}
|
|
1251
1501
|
this.total !== void 0 && (this.total += e);
|
|
1252
1502
|
}
|
|
@@ -1259,14 +1509,18 @@ class cr {
|
|
|
1259
1509
|
* @returns {DeltaUpdate[]} Sanitized delta updates ready to apply.
|
|
1260
1510
|
*/
|
|
1261
1511
|
_buildDeltaUpdates(t) {
|
|
1262
|
-
const e = [];
|
|
1263
|
-
for (const { index:
|
|
1264
|
-
if (
|
|
1265
|
-
throw new Error(`Index ${
|
|
1266
|
-
if (
|
|
1512
|
+
const e = [], r = /* @__PURE__ */ new Map();
|
|
1513
|
+
for (const { index: n, value: s } of t) {
|
|
1514
|
+
if (n < 0 || n >= this.size)
|
|
1515
|
+
throw new Error(`Index ${n} out of bounds`);
|
|
1516
|
+
if (!Number.isInteger(n))
|
|
1517
|
+
throw new Error(`Index must be an integer: ${n}`);
|
|
1518
|
+
if (!Number.isFinite(s))
|
|
1519
|
+
throw new Error(`Value must be a finite number: ${s}`);
|
|
1520
|
+
if (s < 0)
|
|
1267
1521
|
throw new Error("Value cannot be negative.");
|
|
1268
|
-
const l =
|
|
1269
|
-
|
|
1522
|
+
const l = r.has(n) ? r.get(n) ?? 0 : this.deltas.get(n) ?? 0, u = l + this.baseValue, f = s - u;
|
|
1523
|
+
f !== 0 && e.push({ index: n, change: f }), r.set(n, l + f);
|
|
1270
1524
|
}
|
|
1271
1525
|
return e;
|
|
1272
1526
|
}
|
|
@@ -1283,7 +1537,7 @@ class cr {
|
|
|
1283
1537
|
let t = 0, e = this.size;
|
|
1284
1538
|
for (; e > 0; ) {
|
|
1285
1539
|
t += this.tree.get(e) ?? 0;
|
|
1286
|
-
const r =
|
|
1540
|
+
const r = fe(e);
|
|
1287
1541
|
if (r === 0)
|
|
1288
1542
|
break;
|
|
1289
1543
|
e -= r;
|
|
@@ -1293,17 +1547,17 @@ class cr {
|
|
|
1293
1547
|
/**
|
|
1294
1548
|
* @private
|
|
1295
1549
|
* @method _materialize
|
|
1296
|
-
* @description Materializes the value at a specific index if it hasn't been already.
|
|
1297
|
-
* @description
|
|
1550
|
+
* @description Materializes the value at a specific index if it hasn't been already. A non-finite `valueFn` result throws before any mutation, symmetric with the update-path validation, so the tree is never poisoned.
|
|
1551
|
+
* @description 特定のインデックスの値がまだ具現化されていない場合に具現化する。`valueFn` の非有限な返値は変異前に throw で拒否 (update 系の検証と対称) し、木を汚染させない方針。
|
|
1298
1552
|
* @param {number} index - The 0-based index to materialize.
|
|
1299
1553
|
* @param {boolean} [updateTree=true] - Whether to update the Fenwick tree after materialization.
|
|
1300
1554
|
*/
|
|
1301
1555
|
_materialize(t, e = !0) {
|
|
1302
1556
|
if (this.valueFn) {
|
|
1303
|
-
const r = this.deltas.get(t) ?? 0,
|
|
1304
|
-
if (
|
|
1305
|
-
const
|
|
1306
|
-
this._updateTree(t,
|
|
1557
|
+
const r = this.deltas.get(t) ?? 0, s = Le(this.valueFn(t), t) - this.baseValue;
|
|
1558
|
+
if (s !== r && (s === 0 ? this.deltas.delete(t) : this.deltas.set(t, s), e)) {
|
|
1559
|
+
const l = s - r;
|
|
1560
|
+
this._updateTree(t, l);
|
|
1307
1561
|
}
|
|
1308
1562
|
}
|
|
1309
1563
|
}
|
|
@@ -1319,12 +1573,12 @@ class cr {
|
|
|
1319
1573
|
_materializeRanges(t, e, r = !1) {
|
|
1320
1574
|
if (!(t?.materialize && this.valueFn))
|
|
1321
1575
|
return;
|
|
1322
|
-
const
|
|
1323
|
-
if (
|
|
1324
|
-
for (const
|
|
1325
|
-
const f =
|
|
1326
|
-
for (let
|
|
1327
|
-
this._materialize(
|
|
1576
|
+
const n = t.ranges;
|
|
1577
|
+
if (n && n.length > 0) {
|
|
1578
|
+
for (const u of n) {
|
|
1579
|
+
const f = Math.max(0, Math.trunc(u.from)), I = Math.min(Math.trunc(u.to), this.size - 1);
|
|
1580
|
+
for (let v = f; v <= I; v++)
|
|
1581
|
+
this._materialize(v);
|
|
1328
1582
|
}
|
|
1329
1583
|
if (e === void 0)
|
|
1330
1584
|
return;
|
|
@@ -1332,8 +1586,8 @@ class cr {
|
|
|
1332
1586
|
this._materialize(e);
|
|
1333
1587
|
return;
|
|
1334
1588
|
}
|
|
1335
|
-
const
|
|
1336
|
-
e >=
|
|
1589
|
+
const s = n[0].from, l = n[n.length - 1].to;
|
|
1590
|
+
e >= s && e <= l && this._materialize(e);
|
|
1337
1591
|
return;
|
|
1338
1592
|
}
|
|
1339
1593
|
e !== void 0 && this._materialize(e);
|
|
@@ -1349,32 +1603,53 @@ class cr {
|
|
|
1349
1603
|
* @returns {{ index: number; total: number | undefined; cumulative: number | undefined; currentValue: number | undefined; safeIndex: number | undefined }} Binary search result.
|
|
1350
1604
|
*/
|
|
1351
1605
|
_findIndex(t, e = {}, r) {
|
|
1352
|
-
if (this.size
|
|
1606
|
+
if (this.size >= 1073741824)
|
|
1353
1607
|
return this._findIndexLarge(t, e, r);
|
|
1354
1608
|
if (this.size === 0)
|
|
1355
1609
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
for (;
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1610
|
+
this._materializeRanges(e.materializeOption);
|
|
1611
|
+
const n = e.materializeOption?.materialize === !0;
|
|
1612
|
+
let s;
|
|
1613
|
+
for (; ; ) {
|
|
1614
|
+
if (s = this._descend(t, r), s < 0 || s >= this.size)
|
|
1615
|
+
return { index: -1, total: this.total ?? this.getTotal(), cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1616
|
+
if (!n)
|
|
1617
|
+
break;
|
|
1618
|
+
const u = this.deltas.get(s) ?? 0;
|
|
1619
|
+
if (this._materialize(s), (this.deltas.get(s) ?? 0) === u)
|
|
1620
|
+
break;
|
|
1365
1621
|
}
|
|
1366
|
-
const
|
|
1367
|
-
if (d < 0 || d >= this.size)
|
|
1368
|
-
return { index: -1, total: this.total ?? this.getTotal(), cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1369
|
-
const f = this.prefixSum(d, e);
|
|
1622
|
+
const l = this.prefixSum(s);
|
|
1370
1623
|
return {
|
|
1371
|
-
index:
|
|
1372
|
-
total: this.total ??
|
|
1373
|
-
cumulative:
|
|
1374
|
-
currentValue:
|
|
1375
|
-
safeIndex:
|
|
1624
|
+
index: s,
|
|
1625
|
+
total: this.total ?? l.total,
|
|
1626
|
+
cumulative: l.cumulative,
|
|
1627
|
+
currentValue: l.currentValue,
|
|
1628
|
+
safeIndex: l.safeIndex
|
|
1376
1629
|
};
|
|
1377
1630
|
}
|
|
1631
|
+
/**
|
|
1632
|
+
* @private
|
|
1633
|
+
* @method _descend
|
|
1634
|
+
* @description Performs a single bitwise descent over the current tree state, returning the candidate index for the boundary condition without mutating the tree.
|
|
1635
|
+
* @description 現在の木の状態に対してビット降下を 1 回実行し、木を変異させずに境界条件の候補インデックスを返す。
|
|
1636
|
+
* @param {number} target - Target cumulative value.
|
|
1637
|
+
* @param {boolean} chooseLowerBound - When true, finds the smallest index meeting or exceeding the target; otherwise finds the largest index not exceeding it.
|
|
1638
|
+
* @returns {number} The candidate index (may be out of range when no index satisfies the condition).
|
|
1639
|
+
*/
|
|
1640
|
+
_descend(t, e) {
|
|
1641
|
+
let r = 0, n = 0, s = 1;
|
|
1642
|
+
for (; s << 1 <= this.size; )
|
|
1643
|
+
s <<= 1;
|
|
1644
|
+
for (; s > 0; s >>= 1) {
|
|
1645
|
+
const l = r + s;
|
|
1646
|
+
if (l <= this.size) {
|
|
1647
|
+
const f = (this.tree.get(l) ?? 0) + this.baseValue * s;
|
|
1648
|
+
(e ? n + f < t : n + f <= t) && (r = l, n += f);
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
return e ? r : r - 1;
|
|
1652
|
+
}
|
|
1378
1653
|
/**
|
|
1379
1654
|
* Executes a binary search using bigint arithmetic for extremely large sizes.
|
|
1380
1655
|
*
|
|
@@ -1383,35 +1658,44 @@ class cr {
|
|
|
1383
1658
|
_findIndexLarge(t, e, r) {
|
|
1384
1659
|
if (this.size === 0)
|
|
1385
1660
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1386
|
-
const
|
|
1387
|
-
if (
|
|
1661
|
+
const n = Ir(this.size);
|
|
1662
|
+
if (n === 0n)
|
|
1388
1663
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1664
|
+
this._materializeRanges(e.materializeOption);
|
|
1665
|
+
const s = e.materializeOption?.materialize === !0;
|
|
1666
|
+
for (; ; ) {
|
|
1667
|
+
let l = 0n, u = n - 1n, f, I, v = this.total;
|
|
1668
|
+
for (; l <= u; ) {
|
|
1669
|
+
const p = l + u >> 1n, z = Number(p), rt = this.prefixSum(z);
|
|
1670
|
+
if (v = rt.total, r ? rt.cumulative >= t : rt.cumulative <= t)
|
|
1671
|
+
if (f = p, I = rt, r) {
|
|
1672
|
+
if (p === 0n)
|
|
1673
|
+
break;
|
|
1674
|
+
u = p - 1n;
|
|
1675
|
+
} else
|
|
1676
|
+
l = p + 1n;
|
|
1677
|
+
else if (r)
|
|
1678
|
+
l = p + 1n;
|
|
1679
|
+
else {
|
|
1680
|
+
if (p === 0n)
|
|
1395
1681
|
break;
|
|
1396
|
-
|
|
1397
|
-
}
|
|
1398
|
-
l = x + 1n;
|
|
1399
|
-
else if (r)
|
|
1400
|
-
l = x + 1n;
|
|
1401
|
-
else {
|
|
1402
|
-
if (x === 0n)
|
|
1403
|
-
break;
|
|
1404
|
-
c = x - 1n;
|
|
1682
|
+
u = p - 1n;
|
|
1683
|
+
}
|
|
1405
1684
|
}
|
|
1685
|
+
const T = I, D = f !== void 0 ? Number(f) : -1;
|
|
1686
|
+
if (s && D >= 0) {
|
|
1687
|
+
const p = this.deltas.get(D) ?? 0;
|
|
1688
|
+
if (this._materialize(D), (this.deltas.get(D) ?? 0) !== p)
|
|
1689
|
+
continue;
|
|
1690
|
+
}
|
|
1691
|
+
return {
|
|
1692
|
+
index: D,
|
|
1693
|
+
total: v,
|
|
1694
|
+
cumulative: T?.cumulative,
|
|
1695
|
+
currentValue: T?.currentValue,
|
|
1696
|
+
safeIndex: T?.safeIndex
|
|
1697
|
+
};
|
|
1406
1698
|
}
|
|
1407
|
-
const g = f ?? h;
|
|
1408
|
-
return {
|
|
1409
|
-
index: d !== void 0 ? Number(d) : -1,
|
|
1410
|
-
total: m,
|
|
1411
|
-
cumulative: g?.cumulative,
|
|
1412
|
-
currentValue: g?.currentValue,
|
|
1413
|
-
safeIndex: g?.safeIndex
|
|
1414
|
-
};
|
|
1415
1699
|
}
|
|
1416
1700
|
/**
|
|
1417
1701
|
* @method prefixSum
|
|
@@ -1422,21 +1706,23 @@ class cr {
|
|
|
1422
1706
|
* @returns {{ cumulative: number; total: number | undefined; currentValue: number; safeIndex: number }} The cumulative sum of values from index 0 to the given index, the total sum, and the value at the given index.
|
|
1423
1707
|
*/
|
|
1424
1708
|
prefixSum(t, e) {
|
|
1425
|
-
if (t < 0)
|
|
1709
|
+
if (t < 0 || Number.isNaN(t))
|
|
1426
1710
|
return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1711
|
+
if (this.size === 0)
|
|
1712
|
+
return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
|
|
1713
|
+
const r = mt(Math.trunc(t), 0, this.size - 1), n = e?.materializeOption;
|
|
1714
|
+
this._materializeRanges(n, r, !0);
|
|
1715
|
+
let s = 0, l = r + 1;
|
|
1716
|
+
for (; l > 0; ) {
|
|
1717
|
+
const f = this.tree.get(l) ?? 0;
|
|
1718
|
+
s += f;
|
|
1719
|
+
const I = fe(l);
|
|
1720
|
+
if (I === 0)
|
|
1435
1721
|
break;
|
|
1436
|
-
|
|
1722
|
+
l -= I;
|
|
1437
1723
|
}
|
|
1438
|
-
const
|
|
1439
|
-
return { cumulative:
|
|
1724
|
+
const u = n?.materialize ? this.get(r) : (this.deltas.get(r) || 0) + this.baseValue;
|
|
1725
|
+
return { cumulative: s + this.baseValue * (r + 1), total: this.total, currentValue: u, safeIndex: r };
|
|
1440
1726
|
}
|
|
1441
1727
|
/**
|
|
1442
1728
|
* @method get
|
|
@@ -1447,7 +1733,9 @@ class cr {
|
|
|
1447
1733
|
* @returns {number} The value at the given index.
|
|
1448
1734
|
*/
|
|
1449
1735
|
get(t, e) {
|
|
1450
|
-
if (
|
|
1736
|
+
if (this.size === 0)
|
|
1737
|
+
return 0;
|
|
1738
|
+
if (!Number.isInteger(t) || t < 0 || t >= this.size)
|
|
1451
1739
|
throw new Error("Index out of bounds");
|
|
1452
1740
|
const r = e?.materializeOption;
|
|
1453
1741
|
return this._materializeRanges(r, t), (this.deltas.get(t) ?? 0) + this.baseValue;
|
|
@@ -1467,7 +1755,7 @@ class cr {
|
|
|
1467
1755
|
else {
|
|
1468
1756
|
this.total = this._computeTreeTotal();
|
|
1469
1757
|
const r = this.prefixSum(this.getSize() - 1);
|
|
1470
|
-
r.cumulative !== r.total &&
|
|
1758
|
+
r.cumulative !== r.total && V.error("Inconsistent Fenwick Tree state");
|
|
1471
1759
|
}
|
|
1472
1760
|
return this.total;
|
|
1473
1761
|
}
|
|
@@ -1481,20 +1769,20 @@ class cr {
|
|
|
1481
1769
|
rebuildTree(t) {
|
|
1482
1770
|
if (t?.materialize && this.valueFn) {
|
|
1483
1771
|
const r = this.valueFn;
|
|
1484
|
-
this.reset(this.size, (
|
|
1772
|
+
this.reset(this.size, (n) => r(n), { materialize: !0 });
|
|
1485
1773
|
return;
|
|
1486
1774
|
}
|
|
1487
1775
|
const e = /* @__PURE__ */ new Map();
|
|
1488
|
-
for (const [r,
|
|
1489
|
-
if (
|
|
1776
|
+
for (const [r, n] of this.deltas.entries()) {
|
|
1777
|
+
if (n === 0)
|
|
1490
1778
|
continue;
|
|
1491
|
-
let
|
|
1492
|
-
for (;
|
|
1493
|
-
e.set(
|
|
1494
|
-
const
|
|
1495
|
-
if (
|
|
1779
|
+
let s = r + 1;
|
|
1780
|
+
for (; s <= this.size; ) {
|
|
1781
|
+
e.set(s, (e.get(s) ?? 0) + n);
|
|
1782
|
+
const l = fe(s);
|
|
1783
|
+
if (l === 0)
|
|
1496
1784
|
break;
|
|
1497
|
-
|
|
1785
|
+
s += l;
|
|
1498
1786
|
}
|
|
1499
1787
|
}
|
|
1500
1788
|
this.tree = e, this.total = this._computeTreeTotal();
|
|
@@ -1515,20 +1803,110 @@ class cr {
|
|
|
1515
1803
|
}
|
|
1516
1804
|
/**
|
|
1517
1805
|
* @method changeSize
|
|
1518
|
-
* @description Changes the size of the Fenwick Tree.
|
|
1519
|
-
*
|
|
1806
|
+
* @description Changes the size of the Fenwick Tree. Only tail growth/shrink is modelled: this
|
|
1807
|
+
* method receives a size delta, not an index mapping, so it assumes items are appended to or
|
|
1808
|
+
* removed from the tail. Existing rows keep their index-to-height association. It therefore
|
|
1809
|
+
* cannot represent a middle insertion/deletion — after such a structural change the index↔height
|
|
1810
|
+
* mapping is no longer preserved and the tree's deltas would apply to the wrong rows. Consumers
|
|
1811
|
+
* that insert or remove items in the middle must instead reset the tree (see
|
|
1812
|
+
* `useFenwickMapTree`'s `resetOnValueFnChange`, surfaced as `resetOnGetItemHeightChange` in
|
|
1813
|
+
* VirtualScroll) or remount the component with a new `key`.
|
|
1814
|
+
* @description Fenwick Tree のサイズを変更する。モデル化するのは末尾の伸長/縮小のみ: 本メソッドは
|
|
1815
|
+
* サイズ差分のみを受け取りインデックスの対応表は受け取らないため、要素は末尾に追加/末尾から削除
|
|
1816
|
+
* されると仮定する。既存行は index↔高さ の対応を保つ。したがって中間挿入/削除は表現できず、その
|
|
1817
|
+
* ような構造変更の後は index↔高さ の対応が保存されず、木の delta が誤った行へ適用されてしまう。
|
|
1818
|
+
* 中間で要素を挿入/削除する消費側は、代わりに木をリセットするか (`useFenwickMapTree` の
|
|
1819
|
+
* `resetOnValueFnChange`。VirtualScroll では `resetOnGetItemHeightChange` として公開) 、新しい
|
|
1820
|
+
* `key` でコンポーネントを再マウントすること。
|
|
1821
|
+
* @remarks Validation: a non-finite `newSize` (NaN/Infinity) throws because it would poison
|
|
1822
|
+
* `size`/`total` irrecoverably. Fractional sizes are truncated and negative sizes collapse to 0,
|
|
1823
|
+
* matching the normalization rule of `reset`.
|
|
1824
|
+
* @remarks 検証: 非有限の `newSize` (NaN/Infinity) は `size`/`total` を復旧不能に汚染するため
|
|
1825
|
+
* throw。小数は切り捨て、負値は 0 に縮退 (`reset` の正規化規則と同一)。
|
|
1520
1826
|
* @param {number} newSize - The new size of the tree.
|
|
1521
1827
|
*/
|
|
1522
1828
|
changeSize(t) {
|
|
1523
|
-
|
|
1524
|
-
|
|
1829
|
+
if (!Number.isFinite(t))
|
|
1830
|
+
throw new Error(`Size must be a finite number: ${t}`);
|
|
1831
|
+
const e = Math.max(0, Math.trunc(t)), r = this.size;
|
|
1832
|
+
if (e === r)
|
|
1525
1833
|
return;
|
|
1526
|
-
if (
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1834
|
+
if (e > r)
|
|
1835
|
+
this._growSize(r, e);
|
|
1836
|
+
else {
|
|
1837
|
+
for (const s of this.deltas.keys())
|
|
1838
|
+
s >= e && this.deltas.delete(s);
|
|
1839
|
+
this.size = e, this.rebuildTree();
|
|
1840
|
+
}
|
|
1841
|
+
const n = this.prefixSum(this.getSize() - 1);
|
|
1842
|
+
n.cumulative !== n.total && V.error("Inconsistent Fenwick Tree state");
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* @private
|
|
1846
|
+
* @method _minCoveredLowBound
|
|
1847
|
+
* @description Computes `min(t - lowestSetBit(t))` over the newly-activated node range `t in (oldSize, newSize]`. Any delta whose 1-based tree index is at or below this bound cannot be covered by any newly-activated node and can be skipped during an incremental grow.
|
|
1848
|
+
* @description 新規有効化ノード範囲 `t in (oldSize, newSize]` にわたる `min(t - lowestSetBit(t))` を算出する。1 始まりの木インデックスがこの下限以下の delta はどの新規ノードにも覆われないため、増分伸長時にスキップできる。
|
|
1849
|
+
* @param {number} oldSize - The previous size (exclusive lower bound of the new node range).
|
|
1850
|
+
* @param {number} newSize - The new size (inclusive upper bound of the new node range).
|
|
1851
|
+
* @returns {number} The minimum left boundary `t - lowestSetBit(t)` of the newly-activated nodes.
|
|
1852
|
+
*/
|
|
1853
|
+
static _minCoveredLowBound(t, e) {
|
|
1854
|
+
let r = 1;
|
|
1855
|
+
for (; ; ) {
|
|
1856
|
+
const n = r * 2;
|
|
1857
|
+
if (Math.floor(e / n) * n <= t)
|
|
1858
|
+
break;
|
|
1859
|
+
r = n;
|
|
1860
|
+
}
|
|
1861
|
+
return r * Math.floor(t / r);
|
|
1862
|
+
}
|
|
1863
|
+
/**
|
|
1864
|
+
* @private
|
|
1865
|
+
* @method _propagateDeltaToGrownNodes
|
|
1866
|
+
* @description Propagates a single delta into the tree nodes newly activated by a tail growth, i.e. parent-chain nodes in `(oldSize, newSize]`.
|
|
1867
|
+
* @description 末尾伸長で新規有効化されたノード ((oldSize, newSize] にある親チェーンノード) へ単一 delta を伝播する。
|
|
1868
|
+
* @param {number} index - The 0-based delta index.
|
|
1869
|
+
* @param {number} delta - The delta value to propagate.
|
|
1870
|
+
* @param {number} oldSize - The previous size.
|
|
1871
|
+
* @param {number} newSize - The new (larger) size.
|
|
1872
|
+
*/
|
|
1873
|
+
_propagateDeltaToGrownNodes(t, e, r, n) {
|
|
1874
|
+
let s = t + 1;
|
|
1875
|
+
for (; s <= r; ) {
|
|
1876
|
+
const l = fe(s);
|
|
1877
|
+
if (l === 0)
|
|
1878
|
+
break;
|
|
1879
|
+
s += l;
|
|
1880
|
+
}
|
|
1881
|
+
for (; s <= n; ) {
|
|
1882
|
+
this.tree.set(s, (this.tree.get(s) ?? 0) + e);
|
|
1883
|
+
const l = fe(s);
|
|
1884
|
+
if (l === 0)
|
|
1885
|
+
break;
|
|
1886
|
+
s += l;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* @private
|
|
1891
|
+
* @method _growSize
|
|
1892
|
+
* @description Extends the tree to a larger size incrementally, propagating existing deltas into newly-activated higher-order tree nodes only. Candidate deltas are narrowed via `_minCoveredLowBound`, so a typical `+1` tail append costs amortized O(log n) instead of O(D log n) (D = number of materialized deltas).
|
|
1893
|
+
* @description ツリーを末尾方向に増分的に拡張する。既存 delta を新たに有効化された上位ノードにのみ伝播する。候補 delta は `_minCoveredLowBound` で絞り込むため、通常の +1 末尾追記は O(D log n) (D = 具現化済み delta 数) ではなく償却 O(log n) で済む。
|
|
1894
|
+
* @param {number} oldSize - The previous size.
|
|
1895
|
+
* @param {number} newSize - The new (larger) size.
|
|
1896
|
+
*/
|
|
1897
|
+
_growSize(t, e) {
|
|
1898
|
+
if (this.size = e, this.deltas.size > 0) {
|
|
1899
|
+
const r = oe._minCoveredLowBound(t, e);
|
|
1900
|
+
if (t - r < this.deltas.size)
|
|
1901
|
+
for (let s = r; s < t; s++) {
|
|
1902
|
+
const l = this.deltas.get(s);
|
|
1903
|
+
l === void 0 || l === 0 || this._propagateDeltaToGrownNodes(s, l, t, e);
|
|
1904
|
+
}
|
|
1905
|
+
else
|
|
1906
|
+
for (const [s, l] of this.deltas.entries())
|
|
1907
|
+
l === 0 || s < r || this._propagateDeltaToGrownNodes(s, l, t, e);
|
|
1908
|
+
}
|
|
1909
|
+
this.total = this._computeTreeTotal();
|
|
1532
1910
|
}
|
|
1533
1911
|
/**
|
|
1534
1912
|
* @method getSize
|
|
@@ -1568,17 +1946,20 @@ class cr {
|
|
|
1568
1946
|
return this._findIndex(t, e ?? {}, !1);
|
|
1569
1947
|
}
|
|
1570
1948
|
}
|
|
1571
|
-
const
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1949
|
+
const vr = (i, t) => {
|
|
1950
|
+
const e = i?.sampleRange, r = t?.sampleRange;
|
|
1951
|
+
return e === r ? !1 : e && r ? e.from !== r.from || e.to !== r.to : !0;
|
|
1952
|
+
}, Tr = (i, t, e) => {
|
|
1953
|
+
const r = Number.isFinite(i) && i > 0 ? Math.trunc(i) : 0, n = b(null), s = b({ size: r, valueOrFn: t, options: e });
|
|
1954
|
+
n.current === null && (n.current = new oe(r, t, e));
|
|
1955
|
+
const l = n.current, u = s.current, f = u.size !== r, I = u.valueOrFn !== t, v = vr(u.options, e), T = u.size === 0 && r > 0;
|
|
1956
|
+
if (I || v) {
|
|
1957
|
+
const D = e?.resetOnValueFnChange ?? !0;
|
|
1958
|
+
v || I && D || T ? (e?.debug && V.debug("[useFenwickMapTree] reset", { valueOrFnChanged: I, optionsChanged: v }), l.reset(r, t, e)) : (f && (e?.debug && V.debug("[useFenwickMapTree] resize (with valueFn change)", { from: u.size, to: r }), l.changeSize(r)), e?.debug && V.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: I }), l.setValueFn(t, { reset: !1 })), s.current = { size: r, valueOrFn: t, options: e };
|
|
1959
|
+
} else f && (e?.debug && V.debug("[useFenwickMapTree] resize", { from: u.size, to: r }), T ? l.reset(r, t, e) : l.changeSize(r), s.current = { size: r, valueOrFn: t, options: e });
|
|
1960
|
+
return l;
|
|
1580
1961
|
};
|
|
1581
|
-
class
|
|
1962
|
+
class Sr {
|
|
1582
1963
|
key;
|
|
1583
1964
|
value;
|
|
1584
1965
|
prev = null;
|
|
@@ -1587,7 +1968,7 @@ class dr {
|
|
|
1587
1968
|
this.key = t, this.value = e;
|
|
1588
1969
|
}
|
|
1589
1970
|
}
|
|
1590
|
-
class
|
|
1971
|
+
class _e {
|
|
1591
1972
|
head = null;
|
|
1592
1973
|
tail = null;
|
|
1593
1974
|
/**
|
|
@@ -1628,689 +2009,818 @@ class De {
|
|
|
1628
2009
|
this.remove(t), this.addToTail(t);
|
|
1629
2010
|
}
|
|
1630
2011
|
}
|
|
1631
|
-
function
|
|
1632
|
-
const t =
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
t.current.delete(m.key);
|
|
1638
|
-
else
|
|
1639
|
-
break;
|
|
2012
|
+
function Mr(i) {
|
|
2013
|
+
const t = b(/* @__PURE__ */ new Map()), e = b(new _e()), r = Math.floor(i), n = b(r);
|
|
2014
|
+
X(() => {
|
|
2015
|
+
if (n.current = r, Number.isNaN(r) || r < 0) {
|
|
2016
|
+
V.warn(`useLruCache: invalid capacity ${i}; the cache will not store any entries.`), t.current.clear(), e.current = new _e();
|
|
2017
|
+
return;
|
|
1640
2018
|
}
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
if (n <= 0)
|
|
1649
|
-
return;
|
|
1650
|
-
let N = t.current.get(m);
|
|
1651
|
-
if (N)
|
|
1652
|
-
N.value = g, e.current.moveToTail(N);
|
|
1653
|
-
else {
|
|
1654
|
-
if (t.current.size >= n) {
|
|
1655
|
-
const x = e.current.removeHead();
|
|
1656
|
-
x && t.current.delete(x.key);
|
|
1657
|
-
}
|
|
1658
|
-
N = new dr(m, g), t.current.set(m, N), e.current.addToTail(N);
|
|
2019
|
+
if (Number.isFinite(r))
|
|
2020
|
+
for (; t.current.size > r; ) {
|
|
2021
|
+
const v = e.current.removeHead();
|
|
2022
|
+
if (v)
|
|
2023
|
+
t.current.delete(v.key);
|
|
2024
|
+
else
|
|
2025
|
+
break;
|
|
1659
2026
|
}
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
}, []),
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
2027
|
+
}, [i, r]);
|
|
2028
|
+
const s = y((v) => {
|
|
2029
|
+
const T = t.current.get(v);
|
|
2030
|
+
if (T)
|
|
2031
|
+
return e.current.moveToTail(T), T.value;
|
|
2032
|
+
}, []), l = y((v, T) => {
|
|
2033
|
+
const D = n.current;
|
|
2034
|
+
if (Number.isNaN(D) || D <= 0)
|
|
2035
|
+
return;
|
|
2036
|
+
let p = t.current.get(v);
|
|
2037
|
+
if (p)
|
|
2038
|
+
p.value = T, e.current.moveToTail(p);
|
|
2039
|
+
else {
|
|
2040
|
+
if (t.current.size >= D) {
|
|
2041
|
+
const z = e.current.removeHead();
|
|
2042
|
+
z && t.current.delete(z.key);
|
|
2043
|
+
}
|
|
2044
|
+
p = new Sr(v, T), t.current.set(v, p), e.current.addToTail(p);
|
|
2045
|
+
}
|
|
2046
|
+
}, []), u = y((v) => t.current.has(v), []), f = y((v) => {
|
|
2047
|
+
const T = t.current.get(v);
|
|
2048
|
+
T && (e.current.remove(T), t.current.delete(v));
|
|
2049
|
+
}, []), I = y(() => {
|
|
2050
|
+
t.current.clear(), e.current = new _e();
|
|
2051
|
+
}, []);
|
|
2052
|
+
return yt(() => ({ get: s, set: l, has: u, remove: f, clear: I }), [s, l, u, f, I]);
|
|
1669
2053
|
}
|
|
1670
|
-
const
|
|
1671
|
-
const { get:
|
|
1672
|
-
return { get:
|
|
1673
|
-
},
|
|
1674
|
-
top: Math.max(0,
|
|
1675
|
-
bottom: Math.max(0,
|
|
1676
|
-
}),
|
|
1677
|
-
if (!Number.isFinite(
|
|
1678
|
-
const t = Math.trunc(
|
|
2054
|
+
const Pr = 1e4, Lr = () => {
|
|
2055
|
+
const { get: i, set: t, has: e, clear: r } = Mr(Pr);
|
|
2056
|
+
return yt(() => ({ get: i, set: t, has: e, clear: r }), [i, t, e, r]);
|
|
2057
|
+
}, dt = (i, t) => t <= 0 ? 0 : mt(i, 0, t - 1), Xe = (i) => ({
|
|
2058
|
+
top: Math.max(0, i?.top ?? 0),
|
|
2059
|
+
bottom: Math.max(0, i?.bottom ?? 0)
|
|
2060
|
+
}), ee = (i, t) => i <= t ? 0 : i - t, me = (i, t) => i <= 0 ? t : i + t, Ee = 1e3, $e = 2e3, yr = 1048576, Se = (i) => {
|
|
2061
|
+
if (!Number.isFinite(i)) return 0n;
|
|
2062
|
+
const t = Math.trunc(i);
|
|
1679
2063
|
return t <= 0 ? 0n : BigInt(t);
|
|
1680
|
-
},
|
|
2064
|
+
}, wr = (i, t, e, r, n, s, l, u) => {
|
|
1681
2065
|
const f = Se(r);
|
|
1682
2066
|
if (f === 0n)
|
|
1683
2067
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
1684
|
-
const
|
|
1685
|
-
let
|
|
1686
|
-
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
2068
|
+
const I = (L) => L < 0n ? 0n : L >= f ? f - 1n : L, v = { materializeOption: { materialize: !1 } }, { index: T, cumulative: D } = s.findIndexAtOrAfter(i, v);
|
|
2069
|
+
let p;
|
|
2070
|
+
T === -1 ? p = f - 1n : (D === i ? p = Se(T + 1) : p = Se(T), p >= f && (p = f - 1n)), i <= 0 && (p = 0n), u && i >= l && (p = f - 1n);
|
|
2071
|
+
const z = (L) => {
|
|
2072
|
+
const F = Number(L);
|
|
2073
|
+
if (!Number.isSafeInteger(F))
|
|
2074
|
+
return null;
|
|
2075
|
+
const { cumulative: h } = s.prefixSum(F, { materializeOption: { materialize: !1 } });
|
|
2076
|
+
if (!Number.isFinite(h))
|
|
2077
|
+
return null;
|
|
2078
|
+
const { index: $ } = s.findIndexAtOrAfter(h + 0.5, { materializeOption: { materialize: !1 } });
|
|
2079
|
+
if ($ === -1)
|
|
2080
|
+
return null;
|
|
2081
|
+
const q = Se($);
|
|
2082
|
+
return q > L ? q : null;
|
|
2083
|
+
}, rt = (L) => {
|
|
2084
|
+
let F = 0, h = L, $ = L, q = 0n, H = 0;
|
|
2085
|
+
for (; h < f && F < t; ) {
|
|
2086
|
+
const O = Number(h), K = n(O);
|
|
2087
|
+
if (F += K, $ = h, h += 1n, q += 1n, !Number.isFinite(K) || K < 0)
|
|
1692
2088
|
break;
|
|
2089
|
+
if (K === 0) {
|
|
2090
|
+
if (H += 1, H > Ee) {
|
|
2091
|
+
const S = z($);
|
|
2092
|
+
if (S !== null && S > h)
|
|
2093
|
+
h = S, H = 0;
|
|
2094
|
+
else if (S !== null && S === h && n(Number(h)) > 0)
|
|
2095
|
+
H = 0;
|
|
2096
|
+
else
|
|
2097
|
+
break;
|
|
2098
|
+
}
|
|
2099
|
+
} else
|
|
2100
|
+
H = 0;
|
|
1693
2101
|
}
|
|
1694
|
-
return
|
|
2102
|
+
return q === 0n && ($ = L), { height: F, end: $ };
|
|
1695
2103
|
};
|
|
1696
|
-
let { height:
|
|
1697
|
-
if (
|
|
1698
|
-
let L =
|
|
1699
|
-
for (; L > 0n &&
|
|
2104
|
+
let { height: W, end: ot } = rt(p);
|
|
2105
|
+
if (W < t && p > 0n) {
|
|
2106
|
+
let L = p, F = W, h = 0;
|
|
2107
|
+
for (; L > 0n && F < t; ) {
|
|
1700
2108
|
L -= 1n;
|
|
1701
|
-
const
|
|
1702
|
-
if (
|
|
2109
|
+
const q = Number(L), H = n(q);
|
|
2110
|
+
if (F += H, !Number.isFinite(H) || H < 0)
|
|
1703
2111
|
break;
|
|
2112
|
+
if (H === 0) {
|
|
2113
|
+
if (h += 1, h > Ee) {
|
|
2114
|
+
const O = Number(L);
|
|
2115
|
+
if (!Number.isSafeInteger(O))
|
|
2116
|
+
break;
|
|
2117
|
+
const { cumulative: K } = s.prefixSum(O, { materializeOption: { materialize: !1 } });
|
|
2118
|
+
if (!Number.isFinite(K))
|
|
2119
|
+
break;
|
|
2120
|
+
const { index: S } = s.findIndexAtOrAfter(K - 0.5, { materializeOption: { materialize: !1 } }), U = S === -1 ? -1n : Se(S);
|
|
2121
|
+
if (U >= 0n && U < L)
|
|
2122
|
+
L = U + 1n, h = 0;
|
|
2123
|
+
else if (U === L && L >= 1n && n(Number(L - 1n)) > 0)
|
|
2124
|
+
h = 0;
|
|
2125
|
+
else
|
|
2126
|
+
break;
|
|
2127
|
+
}
|
|
2128
|
+
} else
|
|
2129
|
+
h = 0;
|
|
1704
2130
|
}
|
|
1705
|
-
|
|
1706
|
-
const
|
|
1707
|
-
|
|
2131
|
+
p = I(L);
|
|
2132
|
+
const $ = rt(p);
|
|
2133
|
+
W = $.height, ot = $.end;
|
|
1708
2134
|
}
|
|
1709
|
-
const
|
|
2135
|
+
const nt = I(p), ft = I(ot), St = I(nt - BigInt(Math.max(0, e))), wt = I(ft + BigInt(Math.max(0, e)));
|
|
1710
2136
|
return {
|
|
1711
|
-
renderingStartIndex:
|
|
1712
|
-
renderingEndIndex:
|
|
1713
|
-
visibleStartIndex:
|
|
1714
|
-
visibleEndIndex:
|
|
2137
|
+
renderingStartIndex: dt(Number(St), r),
|
|
2138
|
+
renderingEndIndex: dt(Number(wt), r),
|
|
2139
|
+
visibleStartIndex: dt(Number(nt), r),
|
|
2140
|
+
visibleEndIndex: dt(Number(ft), r)
|
|
1715
2141
|
};
|
|
1716
|
-
},
|
|
2142
|
+
}, Rr = (i, t, e, r, n, s, l) => {
|
|
1717
2143
|
if (r === 0)
|
|
1718
2144
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
1719
|
-
const
|
|
2145
|
+
const u = Number.isFinite(l), f = u ? Math.min(Math.max(0, i), l) : Math.max(0, i);
|
|
1720
2146
|
if (r >= Number.MAX_SAFE_INTEGER)
|
|
1721
|
-
return
|
|
1722
|
-
const { index:
|
|
1723
|
-
let
|
|
1724
|
-
if (
|
|
1725
|
-
|
|
1726
|
-
else if (
|
|
1727
|
-
|
|
2147
|
+
return wr(f, t, e, r, n, s, l, u);
|
|
2148
|
+
const { index: I, cumulative: v, currentValue: T } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), D = I === -1 ? t <= 0 || (v ?? 0) < f + (T ?? 0) ? r - 1 : 0 : I;
|
|
2149
|
+
let p = dt(D, r), z = 0;
|
|
2150
|
+
if (I !== -1 && v === f)
|
|
2151
|
+
p = dt(I + 1, r), z = 0;
|
|
2152
|
+
else if (p === I && v !== void 0 && T !== void 0)
|
|
2153
|
+
z = v - T - f;
|
|
1728
2154
|
else {
|
|
1729
|
-
const { cumulative:
|
|
1730
|
-
|
|
2155
|
+
const { cumulative: L, currentValue: F } = s.prefixSum(p, { materializeOption: { materialize: !1 } });
|
|
2156
|
+
z = (L ?? 0) - (F ?? 0) - f;
|
|
1731
2157
|
}
|
|
1732
|
-
const
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
2158
|
+
const rt = z, W = (L, F) => {
|
|
2159
|
+
let h = L, $ = F, q = 0;
|
|
2160
|
+
for (; h < r && $ < t; ) {
|
|
2161
|
+
const H = n(h);
|
|
2162
|
+
if ($ += H, h++, !Number.isFinite(H) || H < 0)
|
|
2163
|
+
break;
|
|
2164
|
+
if (H === 0) {
|
|
2165
|
+
if (q++, q > Ee) {
|
|
2166
|
+
const { cumulative: O } = s.prefixSum(h - 1, { materializeOption: { materialize: !1 } }), { index: K } = Number.isFinite(O) ? s.findIndexAtOrAfter(O + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2167
|
+
if (K > h)
|
|
2168
|
+
h = K, q = 0;
|
|
2169
|
+
else if (K === h && n(h) > 0)
|
|
2170
|
+
q = 0;
|
|
2171
|
+
else
|
|
2172
|
+
break;
|
|
2173
|
+
}
|
|
2174
|
+
} else
|
|
2175
|
+
q = 0;
|
|
2176
|
+
}
|
|
2177
|
+
return { cursor: h, height: $ };
|
|
2178
|
+
}, ot = W(p, z);
|
|
2179
|
+
let nt = ot.cursor;
|
|
2180
|
+
if (z = ot.height, z < t && p > 0) {
|
|
2181
|
+
let L = z + Math.abs(Math.min(0, rt)), F = p - 1, h = 0;
|
|
2182
|
+
for (; F >= 0 && L < t; ) {
|
|
2183
|
+
const q = n(F);
|
|
2184
|
+
if (L += q, !Number.isFinite(q) || q < 0) {
|
|
2185
|
+
F--;
|
|
2186
|
+
break;
|
|
2187
|
+
}
|
|
2188
|
+
if (q === 0) {
|
|
2189
|
+
if (h++, h > Ee) {
|
|
2190
|
+
const { cumulative: H } = s.prefixSum(F, { materializeOption: { materialize: !1 } }), { index: O } = Number.isFinite(H) ? s.findIndexAtOrAfter(H - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2191
|
+
if (O !== -1 && O < F) {
|
|
2192
|
+
F = O, h = 0;
|
|
2193
|
+
continue;
|
|
2194
|
+
}
|
|
2195
|
+
if (O === F && F >= 1 && n(F - 1) > 0)
|
|
2196
|
+
h = 0;
|
|
2197
|
+
else {
|
|
2198
|
+
F--;
|
|
2199
|
+
break;
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
} else
|
|
2203
|
+
h = 0;
|
|
2204
|
+
F--;
|
|
2205
|
+
}
|
|
2206
|
+
p = dt(F + 1, r);
|
|
2207
|
+
const $ = W(p, 0);
|
|
2208
|
+
nt = $.cursor, z = $.height;
|
|
1742
2209
|
}
|
|
1743
|
-
const
|
|
1744
|
-
return { renderingStartIndex:
|
|
1745
|
-
},
|
|
1746
|
-
const r = Math.max(0, t ?? 0),
|
|
1747
|
-
return
|
|
2210
|
+
const ft = dt(p - e, r), St = dt(Math.max(nt - 1, p), r), wt = dt(St + e, r);
|
|
2211
|
+
return { renderingStartIndex: ft, renderingEndIndex: wt, visibleStartIndex: p, visibleEndIndex: St };
|
|
2212
|
+
}, Ue = (i, t, e) => {
|
|
2213
|
+
const r = Math.max(0, t ?? 0), n = b({ last: 0, id: null, arg: null }).current;
|
|
2214
|
+
return X(
|
|
1748
2215
|
() => () => {
|
|
1749
|
-
|
|
2216
|
+
n.id !== null && (cancelAnimationFrame(n.id), n.id = null);
|
|
1750
2217
|
},
|
|
1751
|
-
[
|
|
1752
|
-
),
|
|
1753
|
-
(
|
|
1754
|
-
if (
|
|
1755
|
-
const
|
|
1756
|
-
if (
|
|
1757
|
-
const f =
|
|
1758
|
-
if (r === 0 ||
|
|
1759
|
-
if (
|
|
2218
|
+
[n]
|
|
2219
|
+
), y(
|
|
2220
|
+
(s) => {
|
|
2221
|
+
if (n.arg = s, n.id !== null) return;
|
|
2222
|
+
const l = (u) => {
|
|
2223
|
+
if (n.id = null, n.arg === null) return;
|
|
2224
|
+
const f = u - n.last;
|
|
2225
|
+
if (r === 0 || n.last === 0 || f >= r) {
|
|
2226
|
+
if (i.current)
|
|
1760
2227
|
try {
|
|
1761
|
-
e(
|
|
1762
|
-
} catch (
|
|
1763
|
-
console.error("[useThrottledInvoker] Error invoking callback",
|
|
2228
|
+
e(i.current, n.arg);
|
|
2229
|
+
} catch (I) {
|
|
2230
|
+
console.error("[useThrottledInvoker] Error invoking callback", I);
|
|
1764
2231
|
}
|
|
1765
|
-
|
|
2232
|
+
n.arg = null, n.last = u;
|
|
1766
2233
|
}
|
|
1767
|
-
|
|
2234
|
+
n.arg !== null && (n.id = requestAnimationFrame(l));
|
|
1768
2235
|
};
|
|
1769
|
-
|
|
2236
|
+
n.id = requestAnimationFrame(l);
|
|
1770
2237
|
},
|
|
1771
|
-
[r, e,
|
|
2238
|
+
[r, e, i, n]
|
|
1772
2239
|
);
|
|
1773
|
-
},
|
|
1774
|
-
const
|
|
1775
|
-
|
|
2240
|
+
}, Cr = Qe.memo(({ index: i, top: t, height: e, item: r, children: n, clipItemHeight: s, enableKeyboardNavigation: l, onKeyDown: u, onFocus: f, registerItemRef: I }) => {
|
|
2241
|
+
const v = y((z) => I(i, z), [i, I]), T = y((z) => u(z, i), [i, u]), D = y(() => f(i), [i, f]), p = y((z) => {
|
|
2242
|
+
z.currentTarget.focus({ preventScroll: !0 });
|
|
1776
2243
|
}, []);
|
|
1777
|
-
return /* @__PURE__ */
|
|
2244
|
+
return /* @__PURE__ */ et(
|
|
1778
2245
|
"div",
|
|
1779
2246
|
{
|
|
1780
|
-
ref:
|
|
1781
|
-
"data-index":
|
|
2247
|
+
ref: v,
|
|
2248
|
+
"data-index": i,
|
|
1782
2249
|
"data-virtualscroll-item": "true",
|
|
1783
2250
|
className: "aqvs-item-container",
|
|
1784
2251
|
style: {
|
|
1785
2252
|
top: t,
|
|
1786
2253
|
height: e,
|
|
1787
|
-
overflow:
|
|
2254
|
+
overflow: s ? "hidden" : void 0
|
|
1788
2255
|
},
|
|
1789
|
-
tabIndex:
|
|
1790
|
-
onPointerDown:
|
|
1791
|
-
onKeyDownCapture:
|
|
1792
|
-
onFocusCapture:
|
|
1793
|
-
children:
|
|
2256
|
+
tabIndex: l ? -1 : void 0,
|
|
2257
|
+
onPointerDown: l ? p : void 0,
|
|
2258
|
+
onKeyDownCapture: l ? T : void 0,
|
|
2259
|
+
onFocusCapture: l ? D : void 0,
|
|
2260
|
+
children: n(r, i)
|
|
1794
2261
|
}
|
|
1795
2262
|
);
|
|
1796
|
-
}),
|
|
1797
|
-
itemCount:
|
|
2263
|
+
}), Er = ({
|
|
2264
|
+
itemCount: i,
|
|
1798
2265
|
getItem: t,
|
|
1799
2266
|
getItemKey: e,
|
|
1800
2267
|
getItemHeight: r,
|
|
1801
|
-
viewportSize:
|
|
1802
|
-
overscanCount:
|
|
1803
|
-
className:
|
|
1804
|
-
onScroll:
|
|
2268
|
+
viewportSize: n,
|
|
2269
|
+
overscanCount: s = 15,
|
|
2270
|
+
className: l,
|
|
2271
|
+
onScroll: u,
|
|
1805
2272
|
onRangeChange: f,
|
|
1806
|
-
children:
|
|
1807
|
-
background:
|
|
1808
|
-
initialScrollIndex:
|
|
1809
|
-
initialScrollOffset:
|
|
1810
|
-
callbackThrottleMs:
|
|
1811
|
-
contentInsets:
|
|
1812
|
-
onItemFocus:
|
|
1813
|
-
scrollBarOptions:
|
|
1814
|
-
behaviorOptions:
|
|
1815
|
-
onWheelHorizontal:
|
|
1816
|
-
},
|
|
1817
|
-
const { width:
|
|
2273
|
+
children: I,
|
|
2274
|
+
background: v,
|
|
2275
|
+
initialScrollIndex: T,
|
|
2276
|
+
initialScrollOffset: D,
|
|
2277
|
+
callbackThrottleMs: p = 5,
|
|
2278
|
+
contentInsets: z,
|
|
2279
|
+
onItemFocus: rt,
|
|
2280
|
+
scrollBarOptions: W,
|
|
2281
|
+
behaviorOptions: ot,
|
|
2282
|
+
onWheelHorizontal: nt
|
|
2283
|
+
}, ft) => {
|
|
2284
|
+
const { width: St, enableThumbDrag: wt, enableTrackClick: L, enableArrowButtons: F, enableScrollToTopBottomButtons: h, renderThumbOverlay: $, tapScrollCircleOptions: q } = W ?? {}, { enablePointerDrag: H, enableKeyboardNavigation: O = !0, wheelSpeedMultiplier: K, inertiaOptions: S, clipItemHeight: U = !1, resetOnGetItemHeightChange: j = !1 } = ot ?? {}, k = b(null), G = b({
|
|
1818
2285
|
renderingStartIndex: 0,
|
|
1819
2286
|
renderingEndIndex: 0,
|
|
1820
2287
|
visibleStartIndex: 0,
|
|
1821
2288
|
visibleEndIndex: 0,
|
|
1822
2289
|
scrollPosition: 0,
|
|
1823
2290
|
totalHeight: 0
|
|
1824
|
-
}),
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
}, [
|
|
1828
|
-
const
|
|
2291
|
+
}), st = b(null), Mt = b(!1);
|
|
2292
|
+
X(() => {
|
|
2293
|
+
j && (st.current = null);
|
|
2294
|
+
}, [j, r]);
|
|
2295
|
+
const R = yt(() => Xe(z), [z]), [Dt] = Ut(() => {
|
|
2296
|
+
const c = typeof T == "number" && Number.isFinite(T) ? Math.max(0, Math.trunc(T)) : 0;
|
|
2297
|
+
return { from: Math.max(0, c - 50), to: c + 50 };
|
|
2298
|
+
}), Vt = yt(
|
|
1829
2299
|
// 目的: Fenwick Tree のオプション設定
|
|
1830
|
-
// 依存関係: resetOnGetItemHeightChange
|
|
2300
|
+
// 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
|
|
2301
|
+
// itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
|
|
2302
|
+
// この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
|
|
1831
2303
|
() => ({
|
|
1832
|
-
sampleRange:
|
|
1833
|
-
resetOnValueFnChange:
|
|
2304
|
+
sampleRange: Dt,
|
|
2305
|
+
resetOnValueFnChange: j,
|
|
1834
2306
|
materialize: !0
|
|
1835
2307
|
}),
|
|
1836
|
-
[
|
|
1837
|
-
),
|
|
1838
|
-
let
|
|
1839
|
-
if (typeof
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1842
|
-
} else typeof
|
|
1843
|
-
return { position:
|
|
1844
|
-
}), [
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
}, [f,
|
|
1848
|
-
const
|
|
1849
|
-
(
|
|
1850
|
-
if (
|
|
2308
|
+
[j, Dt]
|
|
2309
|
+
), x = Tr(i, r, Vt), [Rt] = Ut(() => {
|
|
2310
|
+
let o = R.top, c = 0;
|
|
2311
|
+
if (typeof T == "number") {
|
|
2312
|
+
const d = mt(T, 0, i - 1), P = mt(d - s * 2, 0, i - 1), N = mt(d + s * 2, 0, i - 1), _ = T > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: P, to: N }] } } : void 0, { cumulative: A, total: B, currentValue: gt } = x.prefixSum(T, _), tt = Math.max(A - gt, 0);
|
|
2313
|
+
o = me(tt, R.top), c = B ?? x.getTotal();
|
|
2314
|
+
} else typeof D == "number" && (o = me(Math.max(D, 0), R.top)), c = x.getTotal();
|
|
2315
|
+
return { position: o, total: c };
|
|
2316
|
+
}), [At, qt] = Ut(Rt.position), [M, Y] = Ut(Rt.total), C = b(Rt.position), ct = b(R.top), at = b(u ?? void 0), pt = b(f ?? void 0), ht = b(/* @__PURE__ */ new Map()), J = b(null), Ct = b(null), [ut, Kt] = Ut(null), [Lt, xt] = Ut(!1), _t = b(null), Ot = b(!1), It = b(0), Et = b(!1), m = b(!1), E = b(i);
|
|
2317
|
+
E.current !== i && (E.current = i, m.current = !0), X(() => {
|
|
2318
|
+
at.current = u ?? void 0, pt.current = f ?? void 0;
|
|
2319
|
+
}, [f, u]);
|
|
2320
|
+
const lt = y(
|
|
2321
|
+
(o) => {
|
|
2322
|
+
if (O && o && typeof o.focus == "function")
|
|
1851
2323
|
try {
|
|
1852
|
-
|
|
2324
|
+
o.focus({ preventScroll: !0 });
|
|
1853
2325
|
} catch {
|
|
1854
|
-
|
|
2326
|
+
o.focus();
|
|
1855
2327
|
}
|
|
1856
2328
|
},
|
|
1857
|
-
[
|
|
1858
|
-
),
|
|
1859
|
-
|
|
1860
|
-
}, []),
|
|
1861
|
-
|
|
1862
|
-
}, []),
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
}, [
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
2329
|
+
[O]
|
|
2330
|
+
), zt = y((o, { position: c, totalHeight: d }) => {
|
|
2331
|
+
o(c, d);
|
|
2332
|
+
}, []), Z = Ue(at, p, zt), re = y((o, c) => {
|
|
2333
|
+
o(c);
|
|
2334
|
+
}, []), Ht = Ue(pt, p, re), Nt = b(R.top);
|
|
2335
|
+
Nt.current = R.top;
|
|
2336
|
+
const Wt = b(Z);
|
|
2337
|
+
Wt.current = Z, X(() => (Mt.current = !1, () => {
|
|
2338
|
+
Mt.current = !0, _t.current && (clearTimeout(_t.current), _t.current = null);
|
|
2339
|
+
}), []), X(() => {
|
|
2340
|
+
O || (ht.current.clear(), J.current = null, Ct.current = null);
|
|
2341
|
+
}, [O]);
|
|
2342
|
+
const jt = y(
|
|
2343
|
+
(o, c) => {
|
|
2344
|
+
if (!c) {
|
|
2345
|
+
ht.current.delete(o);
|
|
1872
2346
|
return;
|
|
1873
2347
|
}
|
|
1874
|
-
|
|
2348
|
+
O && (ht.current.set(o, c), J.current === o && (J.current = null, Ct.current = o, lt(c)));
|
|
1875
2349
|
},
|
|
1876
|
-
[
|
|
1877
|
-
),
|
|
2350
|
+
[O, lt]
|
|
2351
|
+
), Ft = 0.01, Pt = b({
|
|
1878
2352
|
rafId: null,
|
|
1879
2353
|
loopActive: !1,
|
|
1880
2354
|
idleFrames: 0,
|
|
1881
|
-
lastRenderedPosition:
|
|
1882
|
-
}),
|
|
1883
|
-
const
|
|
1884
|
-
|
|
2355
|
+
lastRenderedPosition: Rt.position
|
|
2356
|
+
}), Gt = y(() => {
|
|
2357
|
+
const o = Pt.current;
|
|
2358
|
+
o.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(o.rafId), o.rafId = null, o.loopActive = !1, o.idleFrames = 0;
|
|
1885
2359
|
}, []);
|
|
1886
|
-
|
|
2360
|
+
X(
|
|
1887
2361
|
() => () => {
|
|
1888
|
-
|
|
2362
|
+
Gt();
|
|
1889
2363
|
},
|
|
1890
|
-
[
|
|
2364
|
+
[Gt]
|
|
1891
2365
|
);
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
2366
|
+
const he = b(() => {
|
|
2367
|
+
}), ge = y(() => {
|
|
2368
|
+
const o = Pt.current;
|
|
2369
|
+
o.rafId = null;
|
|
2370
|
+
const c = C.current, d = ee(c, Nt.current), P = x.getTotal();
|
|
2371
|
+
if (qt((_) => Math.abs(_ - c) < Ft ? _ : c), Math.abs(o.lastRenderedPosition - c) >= Ft ? (Wt.current({ position: d, totalHeight: P }), o.lastRenderedPosition = c, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
|
|
2372
|
+
Gt();
|
|
1898
2373
|
return;
|
|
1899
2374
|
}
|
|
1900
2375
|
if (typeof requestAnimationFrame == "function") {
|
|
1901
|
-
|
|
2376
|
+
o.rafId = requestAnimationFrame((_) => he.current(_));
|
|
1902
2377
|
return;
|
|
1903
2378
|
}
|
|
1904
|
-
|
|
1905
|
-
}, [
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
2379
|
+
o.loopActive = !1;
|
|
2380
|
+
}, [x, Gt]);
|
|
2381
|
+
he.current = ge;
|
|
2382
|
+
const be = y(() => {
|
|
2383
|
+
const o = Pt.current;
|
|
2384
|
+
if (o.idleFrames = 0, !o.loopActive) {
|
|
2385
|
+
if (o.loopActive = !0, typeof requestAnimationFrame == "function") {
|
|
2386
|
+
o.rafId = requestAnimationFrame(ge);
|
|
1910
2387
|
return;
|
|
1911
2388
|
}
|
|
1912
|
-
|
|
2389
|
+
o.loopActive = !1;
|
|
1913
2390
|
}
|
|
1914
|
-
}, [
|
|
1915
|
-
(
|
|
1916
|
-
const
|
|
1917
|
-
if (
|
|
1918
|
-
|
|
2391
|
+
}, [ge]), it = y(
|
|
2392
|
+
(o, c) => {
|
|
2393
|
+
const d = c?.immediate ?? !1, P = ee(o, R.top);
|
|
2394
|
+
if (C.current = o, d) {
|
|
2395
|
+
Pt.current.lastRenderedPosition = o, Pt.current.idleFrames = 0, qt(o), Z({ position: P, totalHeight: x.getTotal() });
|
|
1919
2396
|
return;
|
|
1920
2397
|
}
|
|
1921
|
-
|
|
2398
|
+
be();
|
|
1922
2399
|
},
|
|
1923
|
-
[
|
|
1924
|
-
),
|
|
1925
|
-
|
|
1926
|
-
if (!
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
2400
|
+
[be, x, R.top, Z]
|
|
2401
|
+
), Zt = y((o) => {
|
|
2402
|
+
const c = k.current;
|
|
2403
|
+
if (!c)
|
|
2404
|
+
return o;
|
|
2405
|
+
const d = c.getScrollPosition();
|
|
2406
|
+
It.current += 1;
|
|
2407
|
+
const P = c.scrollTo(o);
|
|
2408
|
+
return P === d && (It.current = Math.max(0, It.current - 1)), Math.abs(P - o) > 0.5 && (Et.current = !0), P;
|
|
2409
|
+
}, []), ne = b(!1);
|
|
2410
|
+
X(() => {
|
|
2411
|
+
if (!ne.current)
|
|
2412
|
+
if (ne.current = !0, typeof D == "number") {
|
|
2413
|
+
const o = me(Math.max(D, 0), R.top), c = Math.abs(o - C.current) > 0.5;
|
|
2414
|
+
it(o, { immediate: !0 }), c && k.current?.scrollTo(o);
|
|
1930
2415
|
} else
|
|
1931
|
-
|
|
1932
|
-
}, [
|
|
1933
|
-
const
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
2416
|
+
it(C.current, { immediate: !0 });
|
|
2417
|
+
}, [D, R.top, it]), X(() => {
|
|
2418
|
+
const o = x.getTotal();
|
|
2419
|
+
if (M !== o) {
|
|
2420
|
+
Y(o);
|
|
2421
|
+
return;
|
|
2422
|
+
}
|
|
2423
|
+
if (Et.current) {
|
|
2424
|
+
Et.current = !1;
|
|
2425
|
+
const c = k.current;
|
|
2426
|
+
if (c && Math.abs(c.getScrollPosition() - C.current) > 0.5) {
|
|
2427
|
+
const d = Zt(C.current);
|
|
2428
|
+
Et.current = !1, it(d, { immediate: !0 });
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
}, [x, M, i, Zt, it]), X(() => {
|
|
2432
|
+
if (st.current !== null) {
|
|
2433
|
+
const { index: o, align: c, offset: d } = st.current, P = dt(o, i), { cumulative: N, currentValue: _ } = x.prefixSum(P, { materializeOption: { materialize: !1 } });
|
|
2434
|
+
if (N !== void 0 && _ !== void 0) {
|
|
2435
|
+
const A = Math.max(N - _, 0);
|
|
2436
|
+
let B = A;
|
|
2437
|
+
c === "bottom" ? B = N - n : c === "center" && (B = A + _ / 2 - n / 2), d && (B -= d), B = Math.max(0, B);
|
|
2438
|
+
const gt = Math.max(0, M + R.top + R.bottom - n), tt = Math.min(me(B, R.top), gt);
|
|
2439
|
+
Math.abs(tt - C.current) > 1 && (V.debug("[VirtualScroll] Drift correction", {
|
|
2440
|
+
from: C.current,
|
|
2441
|
+
to: tt,
|
|
2442
|
+
targetIndex: P
|
|
2443
|
+
}), It.current === 0 && (It.current += 1), k.current?.scrollTo(tt), it(tt, { immediate: !0 }));
|
|
1948
2444
|
}
|
|
1949
2445
|
}
|
|
1950
|
-
|
|
1951
|
-
}, [
|
|
1952
|
-
const
|
|
1953
|
-
if (
|
|
1954
|
-
const
|
|
1955
|
-
|
|
1956
|
-
}, [
|
|
1957
|
-
const
|
|
1958
|
-
(
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2446
|
+
m.current = !1;
|
|
2447
|
+
}, [M, x, i, R.top, it, n, R.bottom]), X(() => {
|
|
2448
|
+
const o = ct.current;
|
|
2449
|
+
if (o === R.top) return;
|
|
2450
|
+
const c = ee(C.current, o), d = me(c, R.top);
|
|
2451
|
+
ct.current = R.top, C.current = d, k.current?.scrollTo(d), it(d, { immediate: !0 });
|
|
2452
|
+
}, [R.top, it]);
|
|
2453
|
+
const Xt = y(
|
|
2454
|
+
(o, c) => {
|
|
2455
|
+
if (i === 0)
|
|
2456
|
+
return;
|
|
2457
|
+
const d = dt(o, i), P = x.get(d), N = c - P, _ = x.update(d, c);
|
|
2458
|
+
_ !== void 0 && Y(_), V.debug("[VirtualScroll] Updated item size manually", { index: d, size: c, total: _ });
|
|
2459
|
+
let A = st.current ? st.current.index : null;
|
|
2460
|
+
if (A === null) {
|
|
2461
|
+
const B = C.current, gt = Xe(z).top, tt = ee(B, gt), { index: Q, cumulative: vt } = x.findIndexAtOrAfter(tt, { materializeOption: { materialize: !1 } });
|
|
2462
|
+
A = vt !== void 0 && vt === tt ? Q + 1 : Q;
|
|
1965
2463
|
}
|
|
1966
|
-
if (
|
|
1967
|
-
const
|
|
1968
|
-
|
|
2464
|
+
if (A !== -1 && d < A && N !== 0) {
|
|
2465
|
+
const B = C.current, gt = B + N;
|
|
2466
|
+
Zt(gt), it(gt, { immediate: !0 }), V.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: B, to: gt, causedByIndex: d, delta: N, activeVisibleStartIndex: A });
|
|
1969
2467
|
}
|
|
1970
2468
|
},
|
|
1971
|
-
[
|
|
1972
|
-
),
|
|
1973
|
-
(
|
|
1974
|
-
if (!
|
|
2469
|
+
[x, i, Zt, it, z]
|
|
2470
|
+
), kt = y(
|
|
2471
|
+
(o, c) => {
|
|
2472
|
+
if (!k.current || i === 0)
|
|
1975
2473
|
return;
|
|
1976
|
-
const
|
|
1977
|
-
if (
|
|
2474
|
+
const d = dt(o, i), P = dt(d - s * 2, i), N = dt(d + s * 2, i), { cumulative: _, total: A, currentValue: B } = x.prefixSum(d, { materializeOption: { materialize: !0, ranges: [{ from: P, to: N }] } });
|
|
2475
|
+
if (V.debug("[VirtualScroll] Scrolling to index:", d, "ItemBottom:", _, "Total height:", A, "ItemHeight:", B, "safeIndexFrom:", P, "safeIndexTo:", N), !A)
|
|
1978
2476
|
return;
|
|
1979
|
-
const
|
|
1980
|
-
let
|
|
1981
|
-
|
|
1982
|
-
const
|
|
1983
|
-
|
|
1984
|
-
index:
|
|
1985
|
-
align:
|
|
1986
|
-
offset:
|
|
2477
|
+
const gt = Math.max(_ - B, 0);
|
|
2478
|
+
let tt = gt;
|
|
2479
|
+
c?.align === "bottom" ? tt = _ - n : c?.align === "center" && (tt = gt + B / 2 - n / 2), c?.offset && (tt -= c.offset), tt = Math.max(0, tt);
|
|
2480
|
+
const Q = me(tt, R.top), vt = k.current?.getContentSize() ?? A + R.top + R.bottom, bt = Math.max(0, vt - n), Tt = Math.min(Q, bt);
|
|
2481
|
+
st.current = {
|
|
2482
|
+
index: d,
|
|
2483
|
+
align: c?.align,
|
|
2484
|
+
offset: c?.offset
|
|
1987
2485
|
};
|
|
1988
|
-
const
|
|
1989
|
-
|
|
2486
|
+
const se = k.current?.getScrollPosition() ?? -1, ve = Math.abs(se - Tt) > 0.5;
|
|
2487
|
+
Ot.current = !1, It.current = 0, ve && (Ot.current = !0, It.current += 1, k.current?.scrollTo(Tt)), Y(A), it(Tt, { immediate: !0 }), V.debug("[VirtualScroll] Setting scroll position to:", Tt, { original: Q, max: bt });
|
|
1990
2488
|
},
|
|
1991
|
-
[
|
|
1992
|
-
),
|
|
1993
|
-
(
|
|
1994
|
-
if (!
|
|
2489
|
+
[x, s, i, R.top, R.bottom, n, it]
|
|
2490
|
+
), xe = y(
|
|
2491
|
+
(o) => {
|
|
2492
|
+
if (!k.current || i === 0)
|
|
1995
2493
|
return;
|
|
1996
|
-
const
|
|
1997
|
-
|
|
2494
|
+
const c = x.getTotal(), d = mt(Math.floor(o), 0, c), { index: P, cumulative: N, currentValue: _ } = x.findIndexAtOrAfter(d, { materializeOption: { materialize: !1 } }), B = (N ?? 0) - (_ ?? 0) - d;
|
|
2495
|
+
kt(P, { offset: B });
|
|
1998
2496
|
},
|
|
1999
|
-
[
|
|
2000
|
-
),
|
|
2001
|
-
(
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2004
|
-
const
|
|
2005
|
-
return
|
|
2497
|
+
[x, i, kt]
|
|
2498
|
+
), Me = y(
|
|
2499
|
+
(o) => {
|
|
2500
|
+
const c = ee(C.current, R.top), d = typeof o == "function" ? o(c) : o;
|
|
2501
|
+
xe(d);
|
|
2502
|
+
const P = k.current?.getScrollPosition(), N = typeof P == "number" ? P : C.current;
|
|
2503
|
+
return it(N), N;
|
|
2006
2504
|
},
|
|
2007
|
-
[
|
|
2008
|
-
),
|
|
2009
|
-
(
|
|
2010
|
-
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2013
|
-
const
|
|
2014
|
-
if (
|
|
2015
|
-
if (
|
|
2505
|
+
[R.top, xe, it]
|
|
2506
|
+
), Ne = y(
|
|
2507
|
+
(o, c) => {
|
|
2508
|
+
V.debug("[VirtualScroll] Scroll position changed:", o);
|
|
2509
|
+
const d = Ot.current;
|
|
2510
|
+
d && (Ot.current = !1);
|
|
2511
|
+
const P = It.current > 0;
|
|
2512
|
+
if (P && (It.current = 0), d || P || m.current || (st.current = null), it(o), h) {
|
|
2513
|
+
if (d || P)
|
|
2016
2514
|
return;
|
|
2017
|
-
const
|
|
2018
|
-
if (
|
|
2019
|
-
const
|
|
2020
|
-
|
|
2021
|
-
|
|
2515
|
+
const N = o - c;
|
|
2516
|
+
if (V.debug("[VirtualScroll] Scroll diff:", N, "New:", o, "Prev:", c), Math.abs(N) > 1) {
|
|
2517
|
+
const _ = N > 0 ? "down" : "up";
|
|
2518
|
+
Kt(_), xt(!0), V.debug("[VirtualScroll] Showing scroll buttons. Direction:", _), _t.current && clearTimeout(_t.current), _t.current = setTimeout(() => {
|
|
2519
|
+
xt(!1), V.debug("[VirtualScroll] Hiding scroll buttons");
|
|
2022
2520
|
}, 2e3);
|
|
2023
2521
|
}
|
|
2024
2522
|
}
|
|
2025
2523
|
},
|
|
2026
|
-
[
|
|
2027
|
-
),
|
|
2028
|
-
const
|
|
2029
|
-
return
|
|
2030
|
-
...
|
|
2031
|
-
scrollPosition:
|
|
2032
|
-
renderingContentSize:
|
|
2033
|
-
overscanCount:
|
|
2034
|
-
viewportSize:
|
|
2035
|
-
}),
|
|
2036
|
-
}, [
|
|
2037
|
-
(
|
|
2038
|
-
if (!
|
|
2524
|
+
[it, h]
|
|
2525
|
+
), Yt = yt(() => ee(At, R.top), [R.top, At]), ie = yt(() => {
|
|
2526
|
+
const o = x.getTotal(), c = Rr(Yt, n, s, i, r, x, o);
|
|
2527
|
+
return V.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
2528
|
+
...c,
|
|
2529
|
+
scrollPosition: Yt,
|
|
2530
|
+
renderingContentSize: o,
|
|
2531
|
+
overscanCount: s,
|
|
2532
|
+
viewportSize: n
|
|
2533
|
+
})), c;
|
|
2534
|
+
}, [Yt, n, s, i, r, x]), { renderingStartIndex: Jt, renderingEndIndex: Qt, visibleStartIndex: Bt, visibleEndIndex: ce } = ie, te = y(
|
|
2535
|
+
(o, c) => {
|
|
2536
|
+
if (!O || i === 0)
|
|
2039
2537
|
return;
|
|
2040
|
-
const
|
|
2041
|
-
if (!(
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2538
|
+
const d = dt(o, i);
|
|
2539
|
+
if (!(c?.ensureVisible ?? !0)) {
|
|
2540
|
+
const bt = ht.current.get(d);
|
|
2541
|
+
bt && (J.current = null, Ct.current = d, lt(bt));
|
|
2044
2542
|
return;
|
|
2045
2543
|
}
|
|
2046
|
-
const
|
|
2047
|
-
if (
|
|
2048
|
-
|
|
2544
|
+
const N = x.prefixSum(d, { materializeOption: { materialize: !1 } }), _ = N.currentValue, A = Math.max(N.cumulative - _, 0), B = A + _, gt = ee(C.current, R.top), tt = gt + n;
|
|
2545
|
+
if (A < gt || B > tt) {
|
|
2546
|
+
kt(d);
|
|
2547
|
+
const bt = ht.current.get(d);
|
|
2548
|
+
bt ? (J.current = null, Ct.current = d, lt(bt)) : J.current = d;
|
|
2049
2549
|
return;
|
|
2050
2550
|
}
|
|
2051
|
-
const vt =
|
|
2551
|
+
const vt = ht.current.get(d);
|
|
2052
2552
|
if (vt) {
|
|
2053
|
-
|
|
2553
|
+
J.current = null, Ct.current = d, lt(vt);
|
|
2054
2554
|
return;
|
|
2055
2555
|
}
|
|
2056
|
-
|
|
2556
|
+
J.current = d;
|
|
2057
2557
|
},
|
|
2058
|
-
[
|
|
2059
|
-
),
|
|
2060
|
-
(
|
|
2061
|
-
if (!
|
|
2558
|
+
[O, i, x, R.top, kt, lt, n]
|
|
2559
|
+
), Pe = y(
|
|
2560
|
+
(o, c) => {
|
|
2561
|
+
if (!O || o.defaultPrevented || o.altKey || o.metaKey || o.ctrlKey)
|
|
2062
2562
|
return;
|
|
2063
|
-
const
|
|
2064
|
-
if (
|
|
2065
|
-
const
|
|
2066
|
-
if (
|
|
2563
|
+
const d = o.target;
|
|
2564
|
+
if (d) {
|
|
2565
|
+
const P = d.tagName;
|
|
2566
|
+
if (P === "INPUT" || P === "TEXTAREA" || P === "SELECT" || d.isContentEditable)
|
|
2067
2567
|
return;
|
|
2068
2568
|
}
|
|
2069
|
-
if (
|
|
2070
|
-
|
|
2569
|
+
if (o.key === "ArrowDown") {
|
|
2570
|
+
c < i - 1 && (o.preventDefault(), te(c + 1));
|
|
2071
2571
|
return;
|
|
2072
2572
|
}
|
|
2073
|
-
if (
|
|
2074
|
-
|
|
2573
|
+
if (o.key === "ArrowUp") {
|
|
2574
|
+
c > 0 && (o.preventDefault(), te(c - 1));
|
|
2075
2575
|
return;
|
|
2076
2576
|
}
|
|
2077
|
-
if (
|
|
2078
|
-
if (
|
|
2079
|
-
|
|
2080
|
-
const
|
|
2081
|
-
|
|
2577
|
+
if (o.key === "PageDown") {
|
|
2578
|
+
if (c < i - 1) {
|
|
2579
|
+
o.preventDefault();
|
|
2580
|
+
const { visibleStartIndex: P, visibleEndIndex: N } = G.current, _ = Math.max(N - P + 1, 1), A = Math.max(_, 1), B = dt(Math.min(c + A, i - 1), i);
|
|
2581
|
+
te(B);
|
|
2082
2582
|
}
|
|
2083
2583
|
return;
|
|
2084
2584
|
}
|
|
2085
|
-
if (
|
|
2086
|
-
|
|
2087
|
-
const
|
|
2088
|
-
|
|
2585
|
+
if (o.key === "PageUp" && c > 0) {
|
|
2586
|
+
o.preventDefault();
|
|
2587
|
+
const { visibleStartIndex: P, visibleEndIndex: N } = G.current, _ = Math.max(N - P + 1, 1), A = Math.max(_, 1), B = dt(c - A, i);
|
|
2588
|
+
te(B);
|
|
2089
2589
|
}
|
|
2090
2590
|
},
|
|
2091
|
-
[
|
|
2092
|
-
),
|
|
2093
|
-
(
|
|
2094
|
-
if (!
|
|
2591
|
+
[O, i, te]
|
|
2592
|
+
), ye = y(
|
|
2593
|
+
(o) => {
|
|
2594
|
+
if (!O)
|
|
2095
2595
|
return;
|
|
2096
|
-
const
|
|
2097
|
-
|
|
2596
|
+
const c = dt(o, i);
|
|
2597
|
+
J.current = null, Ct.current = c, rt?.(c);
|
|
2098
2598
|
},
|
|
2099
|
-
[
|
|
2599
|
+
[O, i, rt]
|
|
2100
2600
|
);
|
|
2101
|
-
|
|
2102
|
-
const
|
|
2103
|
-
|
|
2104
|
-
renderingStartIndex:
|
|
2105
|
-
renderingEndIndex:
|
|
2106
|
-
visibleStartIndex:
|
|
2107
|
-
visibleEndIndex:
|
|
2108
|
-
scrollPositionState:
|
|
2109
|
-
paneScrollPosition:
|
|
2110
|
-
logicalScrollPosition:
|
|
2111
|
-
contentSize:
|
|
2112
|
-
scrollPaneScrollPosition:
|
|
2113
|
-
}),
|
|
2114
|
-
renderingStartIndex:
|
|
2115
|
-
renderingEndIndex:
|
|
2116
|
-
visibleStartIndex:
|
|
2117
|
-
visibleEndIndex:
|
|
2118
|
-
scrollPosition:
|
|
2119
|
-
totalHeight:
|
|
2601
|
+
X(() => {
|
|
2602
|
+
const o = k.current?.getScrollPosition() ?? 0, c = C.current, d = ee(c, R.top);
|
|
2603
|
+
V.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
2604
|
+
renderingStartIndex: Jt,
|
|
2605
|
+
renderingEndIndex: Qt,
|
|
2606
|
+
visibleStartIndex: Bt,
|
|
2607
|
+
visibleEndIndex: ce,
|
|
2608
|
+
scrollPositionState: At,
|
|
2609
|
+
paneScrollPosition: c,
|
|
2610
|
+
logicalScrollPosition: d,
|
|
2611
|
+
contentSize: M,
|
|
2612
|
+
scrollPaneScrollPosition: o
|
|
2613
|
+
})), Ht({
|
|
2614
|
+
renderingStartIndex: Jt,
|
|
2615
|
+
renderingEndIndex: Qt,
|
|
2616
|
+
visibleStartIndex: Bt,
|
|
2617
|
+
visibleEndIndex: ce,
|
|
2618
|
+
scrollPosition: d,
|
|
2619
|
+
totalHeight: M
|
|
2120
2620
|
});
|
|
2121
|
-
}, [
|
|
2122
|
-
const
|
|
2621
|
+
}, [M, Qt, Jt, R.top, Ht, At, ce, Bt]);
|
|
2622
|
+
const Ve = y(() => h ? /* @__PURE__ */ et("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": Lt && ut !== null, children: ut === "up" ? /* @__PURE__ */ et("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ et(
|
|
2123
2623
|
"button",
|
|
2124
2624
|
{
|
|
2125
2625
|
type: "button",
|
|
2126
2626
|
className: "aqvs-scroll-to-edge-button",
|
|
2127
|
-
onClick: (
|
|
2128
|
-
|
|
2627
|
+
onClick: (d) => {
|
|
2628
|
+
d.stopPropagation(), Ot.current = !0, kt(0), xt(!1);
|
|
2129
2629
|
},
|
|
2130
2630
|
children: "Top"
|
|
2131
2631
|
}
|
|
2132
|
-
) }) : /* @__PURE__ */
|
|
2632
|
+
) }) : /* @__PURE__ */ et("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ et(
|
|
2133
2633
|
"button",
|
|
2134
2634
|
{
|
|
2135
2635
|
type: "button",
|
|
2136
2636
|
className: "aqvs-scroll-to-edge-button",
|
|
2137
|
-
onClick: (
|
|
2138
|
-
|
|
2637
|
+
onClick: (d) => {
|
|
2638
|
+
d.stopPropagation(), Ot.current = !0, kt(i - 1), xt(!1);
|
|
2139
2639
|
},
|
|
2140
2640
|
children: "Bottom"
|
|
2141
2641
|
}
|
|
2142
|
-
) }) }) : null, [
|
|
2143
|
-
if (
|
|
2642
|
+
) }) }) : null, [h, Lt, ut, kt, i]), Ie = b(0), { visibleItems: ue, renderAnchor: de } = yt(() => {
|
|
2643
|
+
if (i === 0)
|
|
2144
2644
|
return {
|
|
2145
|
-
visibleItems: /* @__PURE__ */
|
|
2146
|
-
|
|
2645
|
+
visibleItems: /* @__PURE__ */ et("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ et("div", { className: "aqvs-no-items-text", children: "No items" }) }),
|
|
2646
|
+
renderAnchor: 0
|
|
2147
2647
|
};
|
|
2148
|
-
const
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2648
|
+
const o = dt(Jt, i), c = dt(Qt, i), { cumulative: d, currentValue: P } = x.prefixSum(o, { materializeOption: { materialize: !1 } }), N = d - P;
|
|
2649
|
+
Number.isFinite(N) && Math.abs(N - Ie.current) > yr && (Ie.current = N);
|
|
2650
|
+
const _ = Ie.current, A = [], B = [];
|
|
2651
|
+
let gt = 0, tt = N;
|
|
2652
|
+
for (let Q = o; Q <= c; Q++) {
|
|
2653
|
+
if (B.length >= $e) {
|
|
2654
|
+
V.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: $e, safeRenderingStartIndex: o, safeRenderingEndIndex: c });
|
|
2655
|
+
break;
|
|
2656
|
+
}
|
|
2657
|
+
const vt = r(Q), bt = x.get(Q), Tt = vt - bt;
|
|
2658
|
+
Tt !== 0 && A.push({ index: Q, value: vt });
|
|
2659
|
+
const se = tt + gt, ve = e ? e(Q) : Q;
|
|
2660
|
+
B.push(
|
|
2661
|
+
/* @__PURE__ */ et(
|
|
2662
|
+
Cr,
|
|
2157
2663
|
{
|
|
2158
|
-
index:
|
|
2159
|
-
top:
|
|
2160
|
-
height:
|
|
2161
|
-
item: t(
|
|
2162
|
-
clipItemHeight:
|
|
2163
|
-
enableKeyboardNavigation:
|
|
2164
|
-
onKeyDown:
|
|
2165
|
-
onFocus:
|
|
2166
|
-
registerItemRef:
|
|
2167
|
-
children:
|
|
2664
|
+
index: Q,
|
|
2665
|
+
top: se - _,
|
|
2666
|
+
height: vt,
|
|
2667
|
+
item: t(Q),
|
|
2668
|
+
clipItemHeight: U,
|
|
2669
|
+
enableKeyboardNavigation: O,
|
|
2670
|
+
onKeyDown: Pe,
|
|
2671
|
+
onFocus: ye,
|
|
2672
|
+
registerItemRef: jt,
|
|
2673
|
+
children: I
|
|
2168
2674
|
},
|
|
2169
|
-
|
|
2675
|
+
ve
|
|
2170
2676
|
)
|
|
2171
|
-
),
|
|
2677
|
+
), gt += Tt, tt += bt;
|
|
2172
2678
|
}
|
|
2173
|
-
return
|
|
2174
|
-
if (
|
|
2679
|
+
return A.length > 0 && Promise.resolve().then(() => {
|
|
2680
|
+
if (Mt.current)
|
|
2175
2681
|
return;
|
|
2176
|
-
let
|
|
2177
|
-
for (const
|
|
2178
|
-
if (
|
|
2179
|
-
const
|
|
2180
|
-
|
|
2682
|
+
let Q = 0;
|
|
2683
|
+
for (const Tt of A)
|
|
2684
|
+
if (Tt.index < Bt) {
|
|
2685
|
+
const se = x.get(Tt.index);
|
|
2686
|
+
Q += Tt.value - se;
|
|
2181
2687
|
}
|
|
2182
|
-
const
|
|
2183
|
-
if (
|
|
2688
|
+
const vt = x.updates(A);
|
|
2689
|
+
if (Mt.current || typeof vt != "number")
|
|
2184
2690
|
return;
|
|
2185
|
-
|
|
2186
|
-
const
|
|
2187
|
-
if (
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2190
|
-
} else
|
|
2191
|
-
}), { visibleItems:
|
|
2691
|
+
Y(vt), V.debug("[VirtualScroll] Updated heights for items", A, "New total height:", vt);
|
|
2692
|
+
const bt = k.current?.getScrollPosition() ?? C.current;
|
|
2693
|
+
if (Q !== 0) {
|
|
2694
|
+
const Tt = bt + Q;
|
|
2695
|
+
Zt(Tt), it(Tt, { immediate: !0 }), V.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: bt, to: Tt, shiftAmount: Q });
|
|
2696
|
+
} else bt !== C.current && it(bt);
|
|
2697
|
+
}), { visibleItems: B, renderAnchor: _ };
|
|
2192
2698
|
}, [
|
|
2193
|
-
h,
|
|
2194
|
-
Dt,
|
|
2195
2699
|
I,
|
|
2196
|
-
|
|
2197
|
-
|
|
2700
|
+
U,
|
|
2701
|
+
M,
|
|
2702
|
+
O,
|
|
2703
|
+
i,
|
|
2704
|
+
x,
|
|
2198
2705
|
t,
|
|
2199
2706
|
e,
|
|
2200
2707
|
r,
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
]),
|
|
2210
|
-
(
|
|
2211
|
-
const
|
|
2212
|
-
if (
|
|
2213
|
-
currentScrollPosition:
|
|
2214
|
-
effectiveScrollPosition:
|
|
2215
|
-
renderingStartIndex:
|
|
2216
|
-
renderingEndIndex:
|
|
2217
|
-
itemCount:
|
|
2218
|
-
viewportSize:
|
|
2219
|
-
callbackThrottleMs:
|
|
2220
|
-
diff:
|
|
2221
|
-
rawEffectiveScrollPosition:
|
|
2222
|
-
}),
|
|
2223
|
-
return
|
|
2224
|
-
const
|
|
2708
|
+
ye,
|
|
2709
|
+
Pe,
|
|
2710
|
+
Zt,
|
|
2711
|
+
jt,
|
|
2712
|
+
Qt,
|
|
2713
|
+
Jt,
|
|
2714
|
+
it,
|
|
2715
|
+
Bt
|
|
2716
|
+
]), a = y(
|
|
2717
|
+
(o) => {
|
|
2718
|
+
const c = (p ?? 0) > 0, d = Math.abs(o - At), P = c && d > 0.5 ? At : o, N = ee(P, R.top);
|
|
2719
|
+
if (V.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
2720
|
+
currentScrollPosition: o,
|
|
2721
|
+
effectiveScrollPosition: N,
|
|
2722
|
+
renderingStartIndex: Jt,
|
|
2723
|
+
renderingEndIndex: Qt,
|
|
2724
|
+
itemCount: i,
|
|
2725
|
+
viewportSize: n,
|
|
2726
|
+
callbackThrottleMs: p,
|
|
2727
|
+
diff: d,
|
|
2728
|
+
rawEffectiveScrollPosition: P
|
|
2729
|
+
})), i === 0)
|
|
2730
|
+
return ue;
|
|
2731
|
+
const _ = R.top + de - P, A = R.bottom > 0 ? /* @__PURE__ */ et(
|
|
2225
2732
|
"div",
|
|
2226
2733
|
{
|
|
2227
2734
|
className: "aqvs-bottom-inset",
|
|
2228
2735
|
style: {
|
|
2229
|
-
|
|
2230
|
-
|
|
2736
|
+
// ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
|
|
2737
|
+
top: x.getTotal() - de,
|
|
2738
|
+
height: R.bottom
|
|
2231
2739
|
}
|
|
2232
2740
|
},
|
|
2233
2741
|
"virtualscroll-bottom-inset"
|
|
2234
2742
|
) : null;
|
|
2235
|
-
return
|
|
2236
|
-
containerTop:
|
|
2237
|
-
logicalScrollPosition:
|
|
2238
|
-
resolvedInsets:
|
|
2239
|
-
effectiveScrollPosition:
|
|
2240
|
-
}), /* @__PURE__ */
|
|
2241
|
-
|
|
2242
|
-
|
|
2743
|
+
return V.debug("[VirtualScroll] Rendering items", () => ({
|
|
2744
|
+
containerTop: _,
|
|
2745
|
+
logicalScrollPosition: Yt,
|
|
2746
|
+
resolvedInsets: R,
|
|
2747
|
+
effectiveScrollPosition: N
|
|
2748
|
+
})), /* @__PURE__ */ le("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${_}px)`, willChange: "transform" }, children: [
|
|
2749
|
+
ue,
|
|
2750
|
+
A
|
|
2243
2751
|
] });
|
|
2244
2752
|
},
|
|
2245
|
-
[
|
|
2246
|
-
),
|
|
2753
|
+
[p, i, x, Yt, de, Qt, Jt, R, At, n, ue]
|
|
2754
|
+
), g = yt(
|
|
2247
2755
|
() => ({
|
|
2248
|
-
renderingStartIndex:
|
|
2249
|
-
renderingEndIndex:
|
|
2250
|
-
visibleStartIndex:
|
|
2251
|
-
visibleEndIndex:
|
|
2252
|
-
scrollPosition:
|
|
2253
|
-
totalHeight:
|
|
2756
|
+
renderingStartIndex: ie.renderingStartIndex,
|
|
2757
|
+
renderingEndIndex: ie.renderingEndIndex,
|
|
2758
|
+
visibleStartIndex: ie.visibleStartIndex,
|
|
2759
|
+
visibleEndIndex: ie.visibleEndIndex,
|
|
2760
|
+
scrollPosition: Yt,
|
|
2761
|
+
totalHeight: x.getTotal()
|
|
2254
2762
|
// contentSize (State) ではなく最新値を反映
|
|
2255
2763
|
}),
|
|
2256
|
-
|
|
2764
|
+
// contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
|
|
2765
|
+
// (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
|
|
2766
|
+
[ie, Yt, x, M]
|
|
2257
2767
|
);
|
|
2258
|
-
|
|
2259
|
-
G.current =
|
|
2260
|
-
}, [
|
|
2261
|
-
|
|
2768
|
+
X(() => {
|
|
2769
|
+
G.current = g;
|
|
2770
|
+
}, [g]), ke(
|
|
2771
|
+
ft,
|
|
2262
2772
|
() => ({
|
|
2263
|
-
getScrollPosition: () =>
|
|
2264
|
-
getContentSize: () =>
|
|
2265
|
-
getViewportSize: () =>
|
|
2266
|
-
scrollTo:
|
|
2267
|
-
scrollToIndex:
|
|
2268
|
-
getFenwickTreeTotalHeight: () =>
|
|
2269
|
-
getFenwickSize: () =>
|
|
2270
|
-
focusItemAtIndex:
|
|
2773
|
+
getScrollPosition: () => k.current?.getScrollPosition() ?? -1,
|
|
2774
|
+
getContentSize: () => k.current?.getContentSize() ?? -1,
|
|
2775
|
+
getViewportSize: () => k.current?.getViewportSize() ?? -1,
|
|
2776
|
+
scrollTo: Me,
|
|
2777
|
+
scrollToIndex: kt,
|
|
2778
|
+
getFenwickTreeTotalHeight: () => x.getTotal(),
|
|
2779
|
+
getFenwickSize: () => x.getSize(),
|
|
2780
|
+
focusItemAtIndex: te,
|
|
2271
2781
|
getRange: () => G.current,
|
|
2272
|
-
updateItemSize:
|
|
2782
|
+
updateItemSize: Xt
|
|
2273
2783
|
}),
|
|
2274
|
-
[
|
|
2784
|
+
[Me, kt, x, te, Xt]
|
|
2275
2785
|
);
|
|
2276
|
-
const
|
|
2277
|
-
return /* @__PURE__ */
|
|
2278
|
-
|
|
2786
|
+
const w = x.getTotal() + R.top + R.bottom;
|
|
2787
|
+
return /* @__PURE__ */ et(
|
|
2788
|
+
xr,
|
|
2279
2789
|
{
|
|
2280
|
-
ref:
|
|
2281
|
-
contentSize:
|
|
2282
|
-
viewportSize:
|
|
2283
|
-
className:
|
|
2284
|
-
onScroll:
|
|
2285
|
-
background:
|
|
2286
|
-
tapScrollCircleOptions:
|
|
2287
|
-
inertiaOptions:
|
|
2288
|
-
itemCount:
|
|
2289
|
-
scrollBarWidth:
|
|
2290
|
-
enableThumbDrag:
|
|
2291
|
-
enableTrackClick:
|
|
2292
|
-
enableArrowButtons:
|
|
2293
|
-
enablePointerDrag:
|
|
2294
|
-
renderThumbOverlay:
|
|
2295
|
-
wheelSpeedMultiplier:
|
|
2296
|
-
onWheelHorizontal:
|
|
2297
|
-
contentInsets:
|
|
2298
|
-
visibleStartIndex:
|
|
2299
|
-
visibleEndIndex:
|
|
2300
|
-
renderOverlay:
|
|
2301
|
-
initialScrollPosition:
|
|
2302
|
-
children:
|
|
2790
|
+
ref: k,
|
|
2791
|
+
contentSize: w,
|
|
2792
|
+
viewportSize: n,
|
|
2793
|
+
className: l,
|
|
2794
|
+
onScroll: Ne,
|
|
2795
|
+
background: v,
|
|
2796
|
+
tapScrollCircleOptions: q,
|
|
2797
|
+
inertiaOptions: S,
|
|
2798
|
+
itemCount: i,
|
|
2799
|
+
scrollBarWidth: St,
|
|
2800
|
+
enableThumbDrag: wt,
|
|
2801
|
+
enableTrackClick: L,
|
|
2802
|
+
enableArrowButtons: F,
|
|
2803
|
+
enablePointerDrag: H,
|
|
2804
|
+
renderThumbOverlay: $,
|
|
2805
|
+
wheelSpeedMultiplier: K,
|
|
2806
|
+
onWheelHorizontal: nt,
|
|
2807
|
+
contentInsets: R,
|
|
2808
|
+
visibleStartIndex: Bt,
|
|
2809
|
+
visibleEndIndex: ce,
|
|
2810
|
+
renderOverlay: Ve,
|
|
2811
|
+
initialScrollPosition: Rt.position,
|
|
2812
|
+
children: a
|
|
2303
2813
|
}
|
|
2304
2814
|
);
|
|
2305
|
-
},
|
|
2815
|
+
}, _r = Fe(Er);
|
|
2306
2816
|
export {
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2817
|
+
oe as FenwickMapTree,
|
|
2818
|
+
br as ScrollBar,
|
|
2819
|
+
xr as ScrollPane,
|
|
2820
|
+
_r as VirtualScroll,
|
|
2821
|
+
mt as minmax,
|
|
2822
|
+
Dr as tapScrollCircleSampleVisual,
|
|
2823
|
+
Tr as useFenwickMapTree,
|
|
2824
|
+
Lr as useHeightCache,
|
|
2825
|
+
Mr as useLruCache
|
|
2316
2826
|
};
|