virtua 0.51.0 → 0.51.2
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 +4 -4
- package/lib/angular/index.js +215 -236
- package/lib/angular/index.js.map +1 -1
- package/lib/core/index.cjs +232 -271
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.js +272 -311
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +359 -398
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +366 -405
- package/lib/index.js.map +1 -1
- package/lib/solid/Virtualizer.d.ts +1 -1
- package/lib/solid/WindowVirtualizer.d.ts +1 -1
- package/lib/solid/index.cjs +295 -316
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +305 -326
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +185 -255
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/Virtualizer.svelte +13 -3
- package/lib/svelte/WindowVirtualizer.svelte +13 -3
- package/lib/svelte/utils.d.ts +2 -0
- package/lib/svelte/utils.js +4 -1
- package/lib/svelte/utils.js.map +1 -1
- package/lib/vue/index.cjs +338 -379
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +311 -351
- package/lib/vue/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -24,98 +24,96 @@ c = null != (l = s) ? e(r(l)) : {}, s = ((e, r, s, l) => {
|
|
|
24
24
|
|
|
25
25
|
let f = require("react/jsx-runtime"), a = require("react-dom");
|
|
26
26
|
|
|
27
|
-
var {min:
|
|
27
|
+
var u, {min: d, max: h, abs: g, floor: v} = Math, S = (e, t, n) => d(n, h(t, e)), p = e => [ ...e ].sort((e, t) => e - t), $ = setTimeout, w = clearTimeout, m = "function" == typeof queueMicrotask ? queueMicrotask : e => {
|
|
28
28
|
Promise.resolve().then(e);
|
|
29
|
-
},
|
|
29
|
+
}, _ = () => {
|
|
30
30
|
let e;
|
|
31
31
|
return [ new Promise(t => {
|
|
32
32
|
e = t;
|
|
33
33
|
}), e ];
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const C = /* @__PURE__ */ new Set, T = () => m - $, M = () => T() + b + w, E = e => n(e) - b, L = e => {
|
|
40
|
-
e && (I() && 0 !== _ || x && 1 === y ? b += e : w += e);
|
|
34
|
+
}, z = "undefined" != typeof window, b = e => e.ownerDocument, y = e => e.defaultView, I = () => (null == u && (u = /iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0),
|
|
35
|
+
u), x = e => h(e.t(), e.o()), k = ({i: e, l: t, u: n, h: o, v: r, S: i, t: s, p: l, $: c, m: f}, a = 0) => {
|
|
36
|
+
let u = !!f, v = !!a, S = 1, p = 0, $ = 0, w = 0, m = 0, _ = 0, z = 0, b = 0, y = 0, x = null, k = [ 0, v ? h(a - 1, 0) : -1 ], O = 0, R = !1;
|
|
37
|
+
const C = /* @__PURE__ */ new Set, M = () => w - $, T = () => M() + _ + m, E = e => n(e) - _, j = e => {
|
|
38
|
+
e && (I() && 0 !== b || x && 1 === y ? _ += e : m += e);
|
|
41
39
|
};
|
|
42
40
|
return {
|
|
43
41
|
_: () => {
|
|
44
42
|
C.clear();
|
|
45
43
|
},
|
|
46
|
-
I: () =>
|
|
44
|
+
I: () => S,
|
|
47
45
|
i: (t = 200) => {
|
|
48
46
|
if (!R || v) return k;
|
|
49
47
|
let n, o;
|
|
50
48
|
if (z) [n, o] = k; else {
|
|
51
|
-
let r =
|
|
52
|
-
|
|
53
|
-
x && (n =
|
|
49
|
+
let r = h(0, T()), i = r + p;
|
|
50
|
+
u || (t = h(0, t), 1 !== b && (r -= t), 2 !== b && (i += t)), [n, o] = k = e(h(0, r), h(0, i)),
|
|
51
|
+
x && (n = d(n, x[0]), o = h(o, x[1]));
|
|
54
52
|
}
|
|
55
|
-
return [
|
|
53
|
+
return [ h(n, 0), d(o, l() - 1) ];
|
|
56
54
|
},
|
|
57
55
|
k: e => t(e - $),
|
|
58
56
|
O: i,
|
|
59
57
|
u: E,
|
|
60
58
|
h: o,
|
|
61
59
|
R: l,
|
|
62
|
-
C: () =>
|
|
63
|
-
|
|
64
|
-
o: () =>
|
|
65
|
-
|
|
60
|
+
C: () => w,
|
|
61
|
+
M: () => 0 !== b,
|
|
62
|
+
o: () => p,
|
|
63
|
+
T: () => $,
|
|
66
64
|
t: s,
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
j: () => (z = m, m = 0, [ z, 2 === y ]),
|
|
66
|
+
L: (e, t) => {
|
|
69
67
|
const n = [ e, t ];
|
|
70
68
|
return C.add(n), () => {
|
|
71
69
|
C.delete(n);
|
|
72
70
|
};
|
|
73
71
|
},
|
|
74
72
|
q: (n, l) => {
|
|
75
|
-
let a,
|
|
73
|
+
let a, d, h = 0;
|
|
76
74
|
switch (n) {
|
|
77
75
|
case 1:
|
|
78
76
|
{
|
|
79
|
-
if (l ===
|
|
77
|
+
if (l === w && 0 === y) break;
|
|
80
78
|
const e = z;
|
|
81
79
|
z = 0;
|
|
82
|
-
const t = l -
|
|
83
|
-
e && n <
|
|
84
|
-
const o =
|
|
85
|
-
o >= -
|
|
80
|
+
const t = l - w, n = g(t);
|
|
81
|
+
e && n < g(e) + 1 || 0 !== y || (b = t < 0 ? 2 : 1), v && (v = !1), w = l, h = 4;
|
|
82
|
+
const o = M();
|
|
83
|
+
o >= -p && o <= s() && (h += 1, d = n > p);
|
|
86
84
|
break;
|
|
87
85
|
}
|
|
88
86
|
|
|
89
87
|
case 2:
|
|
90
|
-
|
|
88
|
+
h = 8, 0 !== b && (a = !0, h += 1), b = 0, y = 0, x = null;
|
|
91
89
|
break;
|
|
92
90
|
|
|
93
91
|
case 3:
|
|
94
92
|
{
|
|
95
93
|
const e = l.filter(([e, t]) => !i(e, t));
|
|
96
94
|
if (!e.length) break;
|
|
97
|
-
|
|
95
|
+
j(e.reduce((e, [t, n]) => {
|
|
98
96
|
let r;
|
|
99
97
|
if (2 === y) r = !0; else if (x && 1 === y) r = t < x[0]; else {
|
|
100
|
-
const e =
|
|
101
|
-
r = 1 !==
|
|
98
|
+
const e = M(), n = E(t), i = o(t);
|
|
99
|
+
r = 1 !== b && 0 === y ? n + i <= e : n < e && n + i < e + p;
|
|
102
100
|
}
|
|
103
101
|
return r && (e += n - o(t)), e;
|
|
104
102
|
}, 0));
|
|
105
103
|
for (const [t, n] of e) {
|
|
106
104
|
const e = o(t), i = r(t, n);
|
|
107
|
-
|
|
105
|
+
u && (O += i ? n : n - e);
|
|
108
106
|
}
|
|
109
|
-
|
|
107
|
+
u && p && O > p && (j(f(t(T()))), u = !1), h = 3, d = !0;
|
|
110
108
|
break;
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
case 4:
|
|
114
|
-
|
|
112
|
+
p !== l && (p || (R = d = !0), p = l, h = 3);
|
|
115
113
|
break;
|
|
116
114
|
|
|
117
115
|
case 5:
|
|
118
|
-
l[1] ? (
|
|
116
|
+
l[1] ? (j(c(l[0], !0)), y = 2, h = 1) : (c(l[0]), h = 1);
|
|
119
117
|
break;
|
|
120
118
|
|
|
121
119
|
case 6:
|
|
@@ -127,27 +125,27 @@ var {min: u, max: d, abs: h, floor: g} = Math, v = (e, t, n) => u(n, d(t, e)), p
|
|
|
127
125
|
break;
|
|
128
126
|
|
|
129
127
|
case 8:
|
|
130
|
-
x = e(l, l +
|
|
128
|
+
x = e(l, l + p), h = 1;
|
|
131
129
|
}
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
h && (S = 1 + (2147483647 & S), a && _ && (m += _, _ = 0), C.forEach(([e, t]) => {
|
|
131
|
+
h & e && t(d);
|
|
134
132
|
}));
|
|
135
133
|
}
|
|
136
134
|
};
|
|
137
|
-
},
|
|
135
|
+
}, O = (e, t, n, o = 0, r = t - 1) => {
|
|
138
136
|
let i = o;
|
|
139
137
|
for (;o <= r; ) {
|
|
140
|
-
const t =
|
|
138
|
+
const t = v((o + r) / 2);
|
|
141
139
|
e(t) <= n ? (i = t, o = t + 1) : r = t - 1;
|
|
142
140
|
}
|
|
143
|
-
return
|
|
144
|
-
},
|
|
141
|
+
return S(i, 0, t - 1);
|
|
142
|
+
}, R = (e, t, n) => {
|
|
145
143
|
const o = n ? "unshift" : "push";
|
|
146
144
|
for (let n = 0; n < t; n++) e[o](-1);
|
|
147
145
|
return e;
|
|
148
|
-
},
|
|
146
|
+
}, C = (e, t, n) => {
|
|
149
147
|
let o = n && n[1] || t || 40, r = -1, i = 0;
|
|
150
|
-
const s = n && n[0], l = s ?
|
|
148
|
+
const s = n && n[0], l = s ? R(s.slice(0, d(e, s.length)), h(0, e - s.length)) : R([], e), c = R([], e + 1), f = e => {
|
|
151
149
|
const t = l[e];
|
|
152
150
|
return -1 === t ? o : t;
|
|
153
151
|
}, a = t => {
|
|
@@ -161,22 +159,22 @@ var {min: u, max: d, abs: h, floor: g} = Math, v = (e, t, n) => u(n, d(t, e)), p
|
|
|
161
159
|
return {
|
|
162
160
|
i: (t, n) => {
|
|
163
161
|
let o, r;
|
|
164
|
-
return i =
|
|
165
|
-
r =
|
|
162
|
+
return i = d(i, e - 1), a(i) <= t ? (r = O(a, e, n, i), o = O(a, e, t, i, r)) : (o = O(a, e, t, void 0, i),
|
|
163
|
+
r = O(a, e, n, o)), i = o, [ o, r ];
|
|
166
164
|
},
|
|
167
|
-
l: t =>
|
|
165
|
+
l: t => O(a, e, t),
|
|
168
166
|
u: a,
|
|
169
167
|
h: f,
|
|
170
168
|
v: (e, t) => {
|
|
171
169
|
const n = -1 === l[e];
|
|
172
|
-
return l[e] = t, r =
|
|
170
|
+
return l[e] = t, r = d(e, r), n;
|
|
173
171
|
},
|
|
174
|
-
|
|
172
|
+
S: (e, t = -1) => l[e] === t,
|
|
175
173
|
t: () => a(e),
|
|
176
|
-
|
|
174
|
+
p: () => e,
|
|
177
175
|
$: (t, n) => {
|
|
178
176
|
const i = t - e;
|
|
179
|
-
return r = n ? -1 :
|
|
177
|
+
return r = n ? -1 : d(t - 1, r), e = t, i > 0 ? (R(c, i), R(l, i, n), o * i) : (c.splice(i),
|
|
180
178
|
(n ? l.splice(0, -i) : l.splice(i)).reduce((e, t) => e - (-1 === t ? o : t), 0));
|
|
181
179
|
},
|
|
182
180
|
m: t ? void 0 : e => {
|
|
@@ -186,15 +184,15 @@ var {min: u, max: d, abs: h, floor: g} = Math, v = (e, t, n) => u(n, d(t, e)), p
|
|
|
186
184
|
-1 !== o && (o && n.push(o), r < e && t++);
|
|
187
185
|
}), r = -1;
|
|
188
186
|
const i = p(n), s = i.length, c = s / 2 | 0, f = s % 2 == 0 ? (i[c - 1] + i[c]) / 2 : i[c], a = o;
|
|
189
|
-
return ((o = f) - a) *
|
|
187
|
+
return ((o = f) - a) * h(e - t, 0);
|
|
190
188
|
},
|
|
191
189
|
H: () => [ l.slice(), o ]
|
|
192
190
|
};
|
|
193
|
-
},
|
|
191
|
+
}, M = e => {
|
|
194
192
|
let t;
|
|
195
193
|
return {
|
|
196
194
|
W(n) {
|
|
197
|
-
(t || (t = new (
|
|
195
|
+
(t || (t = new (y(b(n)).ResizeObserver)(e))).observe(n);
|
|
198
196
|
},
|
|
199
197
|
A(e) {
|
|
200
198
|
t.unobserve(e);
|
|
@@ -203,123 +201,111 @@ var {min: u, max: d, abs: h, floor: g} = Math, v = (e, t, n) => u(n, d(t, e)), p
|
|
|
203
201
|
t && t.disconnect();
|
|
204
202
|
}
|
|
205
203
|
};
|
|
206
|
-
}, T = (e, t
|
|
207
|
-
let
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
204
|
+
}, T = (e, t, n, o, r, i, s) => {
|
|
205
|
+
let l, c, f = 0, a = !1, u = !1, d = !1, h = !1;
|
|
206
|
+
const g = Date.now, v = o ? "scrollLeft" : "scrollTop", S = o ? "left" : "top", p = e => r ? -e : e, _ = () => p(n[v]), z = (e, t) => {
|
|
207
|
+
n.scrollTo({
|
|
208
|
+
[S]: p(e),
|
|
209
|
+
behavior: t ? "smooth" : "instant"
|
|
210
|
+
});
|
|
211
|
+
}, b = () => {
|
|
212
|
+
if (a || u) return a = !1, void y();
|
|
213
|
+
d = !1, e.q(2);
|
|
214
|
+
}, y = () => {
|
|
215
|
+
w(c), c = $(b, 150);
|
|
216
|
+
}, x = () => {
|
|
217
|
+
f = g(), d && (h = !0), s && e.q(6, s()), e.q(1, _()), y();
|
|
218
|
+
}, k = t => {
|
|
219
|
+
if (a || !e.M() || t.ctrlKey) return;
|
|
220
|
+
const n = g() - f;
|
|
221
|
+
150 > n && 50 < n && (o ? t.deltaX : t.deltaY) && (a = !0);
|
|
222
|
+
}, O = () => {
|
|
223
|
+
u = !0, d = h = !1;
|
|
224
|
+
}, R = () => {
|
|
225
|
+
u = !1, I() && (d = !0);
|
|
223
226
|
};
|
|
224
|
-
return t.addEventListener("scroll",
|
|
227
|
+
return t.addEventListener("scroll", x), t.addEventListener("wheel", k, {
|
|
225
228
|
passive: !0
|
|
226
|
-
}), t.addEventListener("touchstart",
|
|
229
|
+
}), t.addEventListener("touchstart", O, {
|
|
227
230
|
passive: !0
|
|
228
|
-
}), t.addEventListener("touchend",
|
|
231
|
+
}), t.addEventListener("touchend", R, {
|
|
229
232
|
passive: !0
|
|
230
233
|
}), {
|
|
231
234
|
B: () => {
|
|
232
|
-
t.removeEventListener("scroll",
|
|
233
|
-
t.removeEventListener("touchend",
|
|
235
|
+
t.removeEventListener("scroll", x), t.removeEventListener("wheel", k), t.removeEventListener("touchstart", O),
|
|
236
|
+
t.removeEventListener("touchend", R), w(c);
|
|
234
237
|
},
|
|
235
238
|
X: () => {
|
|
236
|
-
const [t,
|
|
237
|
-
|
|
239
|
+
const [t, o] = e.j();
|
|
240
|
+
if (!t) return;
|
|
241
|
+
h && i && i(), h = !1;
|
|
242
|
+
const r = e.C() + t;
|
|
243
|
+
r <= 0 || r >= e.T() + e.t() - e.o() ? z(r) : n.scrollBy({
|
|
244
|
+
[S]: p(t),
|
|
245
|
+
behavior: "instant"
|
|
246
|
+
}), o && (l && l(), e.o() > e.t() && e.q(1, _()));
|
|
247
|
+
},
|
|
248
|
+
Y: (t, n) => {
|
|
249
|
+
let o, r, i;
|
|
250
|
+
l && l();
|
|
251
|
+
const s = l = () => {
|
|
252
|
+
o = !0, w(r), i && i();
|
|
253
|
+
}, c = () => {
|
|
254
|
+
if (!o) {
|
|
255
|
+
if (e.o() && (w(r), r = $(s, 150)), n) {
|
|
256
|
+
for (let [t, n] = e.i(0); t <= n; t++) if (e.O(t)) return;
|
|
257
|
+
s();
|
|
258
|
+
}
|
|
259
|
+
e.q(7), z(t(), n);
|
|
260
|
+
}
|
|
261
|
+
}, f = () => {
|
|
262
|
+
if (o) return;
|
|
263
|
+
let t;
|
|
264
|
+
i = e.L(2, () => {
|
|
265
|
+
t || (t = !0, m(() => {
|
|
266
|
+
t = !1, c();
|
|
267
|
+
}));
|
|
268
|
+
}), c();
|
|
269
|
+
};
|
|
270
|
+
n ? (e.q(8, t()), m(f)) : f();
|
|
238
271
|
}
|
|
239
272
|
};
|
|
240
|
-
}, E = (e, t
|
|
241
|
-
let o;
|
|
242
|
-
|
|
243
|
-
if (!await t()) return;
|
|
244
|
-
let s, l, c;
|
|
245
|
-
o && o();
|
|
246
|
-
const f = o = () => {
|
|
247
|
-
s = !0, $(l), c && c();
|
|
248
|
-
}, a = () => {
|
|
249
|
-
if (!s) {
|
|
250
|
-
if (e.o() && ($(l), l = S(f, 150)), i) {
|
|
251
|
-
for (let [t, n] = e.i(0); t <= n; t++) if (e.O(t)) return;
|
|
252
|
-
f();
|
|
253
|
-
}
|
|
254
|
-
e.q(7), n(r(), i);
|
|
255
|
-
}
|
|
256
|
-
}, u = () => {
|
|
257
|
-
if (s) return;
|
|
258
|
-
let t;
|
|
259
|
-
c = e.j(2, () => {
|
|
260
|
-
t || (t = !0, m(() => {
|
|
261
|
-
t = !1, a();
|
|
262
|
-
}));
|
|
263
|
-
}), a();
|
|
264
|
-
};
|
|
265
|
-
i ? (e.q(8, r()), m(u)) : u();
|
|
266
|
-
}, () => {
|
|
267
|
-
o && o();
|
|
268
|
-
} ];
|
|
269
|
-
}, L = (e, t) => {
|
|
270
|
-
let n, o, r = w(), i = !1;
|
|
271
|
-
const s = t ? "scrollLeft" : "scrollTop", l = t ? "left" : "top", c = t ? "overflowX" : "overflowY", [f, a] = E(e, () => r[0], (e, t) => {
|
|
272
|
-
n.scrollTo({
|
|
273
|
-
[l]: T(e, i),
|
|
274
|
-
behavior: t ? "smooth" : "instant"
|
|
275
|
-
});
|
|
276
|
-
}), u = t ? "width" : "height", d = /* @__PURE__ */ new WeakMap, h = C(t => {
|
|
273
|
+
}, E = (e, t) => {
|
|
274
|
+
let n, o, r = _();
|
|
275
|
+
const i = t ? "width" : "height", s = /* @__PURE__ */ new WeakMap, l = M(t => {
|
|
277
276
|
const o = [];
|
|
278
|
-
for (const {target: r, contentRect:
|
|
279
|
-
const e =
|
|
280
|
-
null != e && o.push([ e, i
|
|
277
|
+
for (const {target: r, contentRect: l} of t) if (r.offsetParent) if (r === n) e.q(4, l[i]); else {
|
|
278
|
+
const e = s.get(r);
|
|
279
|
+
null != e && o.push([ e, l[i] ]);
|
|
281
280
|
}
|
|
282
281
|
o.length && e.q(3, o);
|
|
283
282
|
});
|
|
284
283
|
return {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
e
|
|
290
|
-
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
const r = e.C() + t;
|
|
294
|
-
r <= 0 || r >= e.M() + e.t() - e.o() ? u.scrollTo({
|
|
295
|
-
[l]: T(r, i),
|
|
296
|
-
behavior: "instant"
|
|
297
|
-
}) : u.scrollBy({
|
|
298
|
-
[l]: T(t, i),
|
|
299
|
-
behavior: "instant"
|
|
300
|
-
}), n && a();
|
|
284
|
+
D(i, s = i.parentElement) {
|
|
285
|
+
l.W(n = s), o = T(e, s, s, t, t && "rtl" === getComputedStyle(s).direction, () => {
|
|
286
|
+
const e = t ? "overflowX" : "overflowY", n = s.style, o = n[e];
|
|
287
|
+
n[e] = "hidden", $(() => {
|
|
288
|
+
n[e] = o;
|
|
289
|
+
});
|
|
301
290
|
}), r[1](!0);
|
|
302
291
|
},
|
|
303
292
|
_() {
|
|
304
|
-
|
|
293
|
+
l.B(), o && o.B(), r[1](!1), r = _();
|
|
305
294
|
},
|
|
306
|
-
|
|
307
|
-
|
|
295
|
+
P: (e, t) => (s.set(e, t), l.W(e), () => {
|
|
296
|
+
s.delete(e), l.A(e);
|
|
308
297
|
}),
|
|
309
|
-
|
|
310
|
-
|
|
298
|
+
async J(e, t) {
|
|
299
|
+
await r[0] && o.Y(e, t);
|
|
300
|
+
},
|
|
301
|
+
V() {
|
|
311
302
|
o && o.X();
|
|
312
303
|
},
|
|
313
|
-
|
|
304
|
+
U: e.T
|
|
314
305
|
};
|
|
315
306
|
}, j = (e, t) => {
|
|
316
|
-
let n, o, r, i, s, l =
|
|
317
|
-
const
|
|
318
|
-
n.scrollTo({
|
|
319
|
-
[a]: T(e, c),
|
|
320
|
-
behavior: t ? "smooth" : "instant"
|
|
321
|
-
});
|
|
322
|
-
}), h = t ? "width" : "height", g = /* @__PURE__ */ new WeakMap, v = C(t => {
|
|
307
|
+
let n, o, r, i, s, l = _();
|
|
308
|
+
const c = t ? "width" : "height", f = /* @__PURE__ */ new WeakMap, a = M(t => {
|
|
323
309
|
const o = [];
|
|
324
310
|
for (const {target: e, contentRect: r} of t) {
|
|
325
311
|
if (e === n) {
|
|
@@ -327,75 +313,58 @@ var {min: u, max: d, abs: h, floor: g} = Math, v = (e, t, n) => u(n, d(t, e)), p
|
|
|
327
313
|
continue;
|
|
328
314
|
}
|
|
329
315
|
if (!e.offsetParent) continue;
|
|
330
|
-
const t =
|
|
331
|
-
null != t && o.push([ t, r[
|
|
316
|
+
const t = f.get(e);
|
|
317
|
+
null != t && o.push([ t, r[c] ]);
|
|
332
318
|
}
|
|
333
319
|
o.length && e.q(3, o);
|
|
334
|
-
})
|
|
335
|
-
const i = o ? "offsetLeft" : "offsetTop", s = r + (c ? t.clientWidth - e[i] - e.offsetWidth : e[i]), l = e.offsetParent;
|
|
336
|
-
return e !== n && l ? p(l, t, n, o, s) : s;
|
|
337
|
-
};
|
|
320
|
+
});
|
|
338
321
|
return {
|
|
339
|
-
|
|
340
|
-
const
|
|
341
|
-
|
|
322
|
+
D(c) {
|
|
323
|
+
const f = b(c), u = y(f), d = n = f.scrollingElement, h = t && "rtl" === getComputedStyle(d).direction, g = (e, t, n, o, r = 0) => {
|
|
324
|
+
const i = o ? "offsetLeft" : "offsetTop", s = r + (h ? t.clientWidth - e[i] - e.offsetWidth : e[i]), l = e.offsetParent;
|
|
325
|
+
return e !== n && l ? g(l, t, n, o, s) : s;
|
|
326
|
+
}, v = i = () => g(c, d, f.body, t), S = s = () => {
|
|
327
|
+
e.q(4, d[t ? "clientWidth" : "clientHeight"]);
|
|
342
328
|
};
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
},
|
|
346
|
-
const o = e.C() + t;
|
|
347
|
-
o <= 0 || o >= e.M() + e.t() - e.o() ? S.scrollTo({
|
|
348
|
-
[a]: T(o, c),
|
|
349
|
-
behavior: "instant"
|
|
350
|
-
}) : S.scrollBy({
|
|
351
|
-
[a]: T(t, c),
|
|
352
|
-
behavior: "instant"
|
|
353
|
-
}), n && d();
|
|
354
|
-
}, $), l[1](!0);
|
|
329
|
+
u.addEventListener("resize", S), a.W(d), r = () => {
|
|
330
|
+
u.removeEventListener("resize", S);
|
|
331
|
+
}, o = T(e, u, d, t, h, null, v), l[1](!0);
|
|
355
332
|
},
|
|
356
333
|
_() {
|
|
357
|
-
r && r(),
|
|
334
|
+
r && r(), a.B(), o && o.B(), l[1](!1), l = _();
|
|
358
335
|
},
|
|
359
|
-
|
|
360
|
-
|
|
336
|
+
P: (e, t) => (f.set(e, t), a.W(e), () => {
|
|
337
|
+
f.delete(e), a.A(e);
|
|
361
338
|
}),
|
|
362
|
-
|
|
363
|
-
|
|
339
|
+
async J(e, t) {
|
|
340
|
+
await l[0] && o.Y(e, t);
|
|
341
|
+
},
|
|
342
|
+
V() {
|
|
364
343
|
o && o.X();
|
|
365
344
|
},
|
|
366
|
-
|
|
345
|
+
U: () => i()
|
|
367
346
|
};
|
|
368
|
-
},
|
|
369
|
-
let n, o, r, i =
|
|
370
|
-
const
|
|
371
|
-
n.scrollTo({
|
|
372
|
-
left: T(e, s),
|
|
373
|
-
behavior: t ? "smooth" : "instant"
|
|
374
|
-
});
|
|
375
|
-
}), [f, a] = E(e, () => i[0], (e, t) => {
|
|
376
|
-
n.scrollTo({
|
|
377
|
-
top: e,
|
|
378
|
-
behavior: t ? "smooth" : "instant"
|
|
379
|
-
});
|
|
380
|
-
}), u = /* @__PURE__ */ new WeakMap, h = /* @__PURE__ */ new Set, g = /* @__PURE__ */ new Set, v = /* @__PURE__ */ new Map, p = (e, t) => `${e}-${t}`, $ = C(o => {
|
|
347
|
+
}, L = (e, t) => {
|
|
348
|
+
let n, o, r, i = _();
|
|
349
|
+
const s = /* @__PURE__ */ new WeakMap, l = /* @__PURE__ */ new Set, c = /* @__PURE__ */ new Set, f = /* @__PURE__ */ new Map, a = (e, t) => `${e}-${t}`, u = M(o => {
|
|
381
350
|
const r = /* @__PURE__ */ new Set, i = /* @__PURE__ */ new Set;
|
|
382
|
-
for (const {target:
|
|
383
|
-
t.q(4,
|
|
384
|
-
const e =
|
|
351
|
+
for (const {target: l, contentRect: {width: c, height: u}} of o) if (l.offsetParent) if (l === n) e.q(4, u),
|
|
352
|
+
t.q(4, c); else {
|
|
353
|
+
const e = s.get(l);
|
|
385
354
|
if (e) {
|
|
386
|
-
const [t, n] = e, o =
|
|
387
|
-
let
|
|
388
|
-
s ? (s[0] !==
|
|
389
|
-
|
|
355
|
+
const [t, n] = e, o = a(t, n), s = f.get(o);
|
|
356
|
+
let l, d;
|
|
357
|
+
s ? (s[0] !== u && (l = !0), s[1] !== c && (d = !0)) : l = d = !0, l && r.add(t),
|
|
358
|
+
d && i.add(n), (l || d) && f.set(o, [ u, c ]);
|
|
390
359
|
}
|
|
391
360
|
}
|
|
392
361
|
if (r.size) {
|
|
393
362
|
const t = [];
|
|
394
363
|
r.forEach(e => {
|
|
395
364
|
let n = 0;
|
|
396
|
-
|
|
397
|
-
const o =
|
|
398
|
-
o && (n =
|
|
365
|
+
c.forEach(t => {
|
|
366
|
+
const o = f.get(a(e, t));
|
|
367
|
+
o && (n = h(n, o[0]));
|
|
399
368
|
}), n && t.push([ e, n ]);
|
|
400
369
|
}), e.q(3, t);
|
|
401
370
|
}
|
|
@@ -403,83 +372,75 @@ var {min: u, max: d, abs: h, floor: g} = Math, v = (e, t, n) => u(n, d(t, e)), p
|
|
|
403
372
|
const e = [];
|
|
404
373
|
i.forEach(t => {
|
|
405
374
|
let n = 0;
|
|
406
|
-
|
|
407
|
-
const o =
|
|
408
|
-
o && (n =
|
|
375
|
+
l.forEach(e => {
|
|
376
|
+
const o = f.get(a(e, t));
|
|
377
|
+
o && (n = h(n, o[1]));
|
|
409
378
|
}), n && e.push([ t, n ]);
|
|
410
379
|
}), t.q(3, e);
|
|
411
380
|
}
|
|
412
|
-
})
|
|
413
|
-
const r = n, i = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", c = t && s;
|
|
414
|
-
return M(e, r, t, () => T(r[i], c), (n, i, s) => {
|
|
415
|
-
if (s) {
|
|
416
|
-
const e = r.style, t = e[l];
|
|
417
|
-
e[l] = "hidden", S(() => {
|
|
418
|
-
e[l] = t;
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
const f = e.C() + n;
|
|
422
|
-
f <= 0 || f >= e.M() + e.t() - e.o() ? r.scrollTo({
|
|
423
|
-
[t ? "left" : "top"]: T(f, c),
|
|
424
|
-
behavior: "instant"
|
|
425
|
-
}) : r.scrollBy({
|
|
426
|
-
[t ? "left" : "top"]: T(n, c),
|
|
427
|
-
behavior: "instant"
|
|
428
|
-
}), i && o();
|
|
429
|
-
});
|
|
430
|
-
};
|
|
381
|
+
});
|
|
431
382
|
return {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
383
|
+
D(s, l = s.parentElement) {
|
|
384
|
+
u.W(n = l);
|
|
385
|
+
const c = "rtl" === getComputedStyle(l).direction, f = e => () => {
|
|
386
|
+
const t = l.style, n = t[e];
|
|
387
|
+
t[e] = "hidden", $(() => {
|
|
388
|
+
t[e] = n;
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
o = T(e, l, l, !1, !1, f("overflowY")), r = T(t, l, l, !0, c, f("overflowX")), i[1](!0);
|
|
435
392
|
},
|
|
436
393
|
_() {
|
|
437
|
-
|
|
394
|
+
u.B(), o && o.B(), r && r.B(), i[1](!1), i = _();
|
|
438
395
|
},
|
|
439
|
-
|
|
440
|
-
|
|
396
|
+
P: (e, t, n) => (s.set(e, [ t, n ]), l.add(t), c.add(n), u.W(e), () => {
|
|
397
|
+
s.delete(e), u.A(e);
|
|
441
398
|
}),
|
|
442
|
-
|
|
443
|
-
for (const [e] of n) for (let n = 0; n < t.R(); n++)
|
|
399
|
+
F(n) {
|
|
400
|
+
for (const [e] of n) for (let n = 0; n < t.R(); n++) f.delete(a(e, n));
|
|
444
401
|
e.q(3, n);
|
|
445
402
|
},
|
|
446
|
-
|
|
447
|
-
for (const [t] of n) for (let n = 0; n < e.R(); n++)
|
|
403
|
+
G(n) {
|
|
404
|
+
for (const [t] of n) for (let n = 0; n < e.R(); n++) f.delete(a(n, t));
|
|
448
405
|
t.q(3, n);
|
|
449
406
|
},
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
407
|
+
async K(e, t) {
|
|
408
|
+
await i[0] && r.Y(e, t);
|
|
409
|
+
},
|
|
410
|
+
async N(e, t) {
|
|
411
|
+
await i[0] && o.Y(e, t);
|
|
412
|
+
},
|
|
413
|
+
V() {
|
|
453
414
|
o && o.X(), r && r.X();
|
|
454
415
|
}
|
|
455
416
|
};
|
|
456
|
-
},
|
|
457
|
-
e.
|
|
458
|
-
},
|
|
459
|
-
if (n =
|
|
417
|
+
}, q = (e, t) => {
|
|
418
|
+
e.J(() => t);
|
|
419
|
+
}, H = (e, t, n, {align: o, smooth: r, offset: i = 0} = {}) => {
|
|
420
|
+
if (n = S(n, 0, t.R() - 1), "nearest" === o) {
|
|
460
421
|
const e = t.u(n), r = t.C();
|
|
461
422
|
if (e < r) o = "start"; else {
|
|
462
423
|
if (!(e + t.h(n) > r + t.o())) return;
|
|
463
424
|
o = "end";
|
|
464
425
|
}
|
|
465
426
|
}
|
|
466
|
-
e.
|
|
467
|
-
},
|
|
468
|
-
if (Array.isArray(e)) for (const n of e)
|
|
469
|
-
},
|
|
427
|
+
e.J(() => i + e.U() + t.u(n) + ("end" === o ? t.h(n) - t.o() : "center" === o ? (t.h(n) - t.o()) / 2 : 0), r);
|
|
428
|
+
}, W = z ? s.useLayoutEffect : s.useEffect, A = "current", B = (e, t) => {
|
|
429
|
+
if (Array.isArray(e)) for (const n of e) B(n, t); else null == e || "boolean" == typeof e || t.push(e);
|
|
430
|
+
}, X = (e, t) => {
|
|
470
431
|
const n = e.key;
|
|
471
432
|
return null != n ? n : "_" + t;
|
|
472
|
-
},
|
|
433
|
+
}, Y = e => {
|
|
473
434
|
const t = (0, s.useRef)(null);
|
|
474
435
|
return t.current || (t.current = e());
|
|
475
|
-
},
|
|
436
|
+
}, D = e => {
|
|
476
437
|
const t = (0, s.useRef)(e);
|
|
477
|
-
return
|
|
478
|
-
t[
|
|
438
|
+
return W(() => {
|
|
439
|
+
t[A] = e;
|
|
479
440
|
}, [ e ]), t;
|
|
480
|
-
},
|
|
441
|
+
}, P = /*#__PURE__*/ /*#__PURE__*/ (0, s.memo)(({Z: e, ee: t, te: n, ne: o, oe: r, re: i, ie: l, se: c}) => {
|
|
481
442
|
const a = (0, s.useRef)(null);
|
|
482
|
-
|
|
443
|
+
W(() => t(a[A], n), [ n ]);
|
|
483
444
|
const u = (0, s.useMemo)(() => {
|
|
484
445
|
const e = {
|
|
485
446
|
contain: "layout style",
|
|
@@ -501,92 +462,92 @@ var {min: u, max: d, abs: h, floor: g} = Math, v = (e, t, n) => u(n, d(t, e)), p
|
|
|
501
462
|
index: n,
|
|
502
463
|
children: e
|
|
503
464
|
});
|
|
504
|
-
}),
|
|
465
|
+
}), J = (e, t) => (0, s.useMemo)(() => {
|
|
505
466
|
if ("function" == typeof e) return [ n => e(t[n], n), t.length ];
|
|
506
467
|
const n = (e => {
|
|
507
468
|
const t = [];
|
|
508
|
-
return
|
|
469
|
+
return B(e, t), t;
|
|
509
470
|
})(e);
|
|
510
471
|
return [ e => n[e], n.length ];
|
|
511
|
-
}, [ e, t ]),
|
|
512
|
-
const [
|
|
513
|
-
const e = !!i, t =
|
|
514
|
-
return [ n, t,
|
|
472
|
+
}, [ e, t ]), V = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: n, itemSize: o, shift: r, horizontal: i, keepMounted: l, cache: c, startMargin: u = 0, ssrCount: d, as: h = "div", item: g = "div", scrollRef: v, onScroll: S, onScrollEnd: $}, w) => {
|
|
473
|
+
const [_, z] = J(e, t), b = (0, s.useRef)(null), y = (0, s.useRef)(!!d), I = D(S), O = D($), [R, M, T, j] = Y(() => {
|
|
474
|
+
const e = !!i, t = C(z, o, c), n = k(t, d);
|
|
475
|
+
return [ n, t, E(n, e), e ];
|
|
515
476
|
});
|
|
516
|
-
z !==
|
|
517
|
-
const [
|
|
518
|
-
const t =
|
|
477
|
+
z !== R.R() && R.q(5, [ z, r ]), u !== R.T() && R.q(6, u);
|
|
478
|
+
const [L, B] = (0, s.useReducer)(R.I, void 0, R.I), V = R.M(), U = R.t(), F = [], G = e => {
|
|
479
|
+
const t = _(e);
|
|
519
480
|
/* @__PURE__ */ /* @__PURE__ */
|
|
520
|
-
return (0, f.jsx)(
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
},
|
|
481
|
+
return (0, f.jsx)(P, {
|
|
482
|
+
ee: T.P,
|
|
483
|
+
te: e,
|
|
484
|
+
ne: R.u(e),
|
|
485
|
+
oe: R.O(e),
|
|
486
|
+
re: g,
|
|
487
|
+
Z: t,
|
|
488
|
+
ie: j,
|
|
489
|
+
se: y[A]
|
|
490
|
+
}, X(t, e));
|
|
530
491
|
};
|
|
531
|
-
if (
|
|
532
|
-
|
|
533
|
-
e ? (0, a.flushSync)(
|
|
534
|
-
}),
|
|
535
|
-
|
|
536
|
-
}),
|
|
492
|
+
if (W(() => {
|
|
493
|
+
y[A] = !1, R.L(1, e => {
|
|
494
|
+
e ? (0, a.flushSync)(B) : B();
|
|
495
|
+
}), R.L(4, () => {
|
|
496
|
+
I.current && I.current(R.C());
|
|
497
|
+
}), R.L(8, () => {
|
|
537
498
|
O.current && O.current();
|
|
538
499
|
});
|
|
539
|
-
const e =
|
|
500
|
+
const e = b[A];
|
|
540
501
|
return v ? m(() => {
|
|
541
|
-
v.current &&
|
|
542
|
-
}) :
|
|
543
|
-
|
|
502
|
+
v.current && T.D(e, v[A]);
|
|
503
|
+
}) : T.D(e), () => {
|
|
504
|
+
R._(), T._();
|
|
544
505
|
};
|
|
545
|
-
}, []),
|
|
546
|
-
|
|
547
|
-
}, [
|
|
506
|
+
}, []), W(() => {
|
|
507
|
+
T.V();
|
|
508
|
+
}, [ L ]), (0, s.useImperativeHandle)(w, () => ({
|
|
548
509
|
get cache() {
|
|
549
|
-
return
|
|
510
|
+
return M.H();
|
|
550
511
|
},
|
|
551
512
|
get scrollOffset() {
|
|
552
|
-
return
|
|
513
|
+
return R.C();
|
|
553
514
|
},
|
|
554
515
|
get scrollSize() {
|
|
555
|
-
return
|
|
516
|
+
return x(R);
|
|
556
517
|
},
|
|
557
518
|
get viewportSize() {
|
|
558
|
-
return
|
|
519
|
+
return R.o();
|
|
559
520
|
},
|
|
560
|
-
findItemIndex:
|
|
561
|
-
getItemOffset:
|
|
562
|
-
getItemSize:
|
|
563
|
-
scrollToIndex: (e, t) =>
|
|
564
|
-
scrollTo: e =>
|
|
521
|
+
findItemIndex: R.k,
|
|
522
|
+
getItemOffset: R.u,
|
|
523
|
+
getItemSize: R.h,
|
|
524
|
+
scrollToIndex: (e, t) => H(T, R, e, t),
|
|
525
|
+
scrollTo: e => q(T, e),
|
|
565
526
|
scrollBy: e => ((e, t, n) => {
|
|
566
|
-
|
|
567
|
-
})(
|
|
527
|
+
q(e, n + t.C());
|
|
528
|
+
})(T, R, e)
|
|
568
529
|
}), []), l) {
|
|
569
530
|
const e = new Set(l);
|
|
570
|
-
for (let [t, o] =
|
|
531
|
+
for (let [t, o] = R.i(n); t <= o; t++) e.add(t);
|
|
571
532
|
p([ ...e ]).forEach(e => {
|
|
572
|
-
F.push(G(e));
|
|
533
|
+
e < z && F.push(G(e));
|
|
573
534
|
});
|
|
574
|
-
} else for (let [e, t] =
|
|
535
|
+
} else for (let [e, t] = R.i(n); e <= t; e++) F.push(G(e));
|
|
575
536
|
/* @__PURE__ */ /* @__PURE__ */
|
|
576
537
|
return (0, f.jsx)(h, {
|
|
577
|
-
ref:
|
|
538
|
+
ref: b,
|
|
578
539
|
style: {
|
|
579
540
|
contain: "size style",
|
|
580
541
|
overflowAnchor: "none",
|
|
581
542
|
flex: "none",
|
|
582
543
|
position: "relative",
|
|
583
|
-
width:
|
|
584
|
-
height:
|
|
585
|
-
pointerEvents:
|
|
544
|
+
width: j ? U : "100%",
|
|
545
|
+
height: j ? "100%" : U,
|
|
546
|
+
pointerEvents: V ? "none" : void 0
|
|
586
547
|
},
|
|
587
548
|
children: F
|
|
588
549
|
});
|
|
589
|
-
}),
|
|
550
|
+
}), U = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: n, itemSize: o, shift: r, horizontal: i, keepMounted: s, cache: l, ssrCount: c, item: a, onScroll: u, onScrollEnd: d, style: h, ...g}, v) => /* @__PURE__ */ /* @__PURE__ */ (0,
|
|
590
551
|
f.jsx)("div", {
|
|
591
552
|
...g,
|
|
592
553
|
style: {
|
|
@@ -597,7 +558,7 @@ f.jsx)("div", {
|
|
|
597
558
|
height: "100%",
|
|
598
559
|
...h
|
|
599
560
|
},
|
|
600
|
-
children: /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(
|
|
561
|
+
children: /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(V, {
|
|
601
562
|
ref: v,
|
|
602
563
|
data: t,
|
|
603
564
|
bufferSize: n,
|
|
@@ -612,26 +573,26 @@ f.jsx)("div", {
|
|
|
612
573
|
onScrollEnd: d,
|
|
613
574
|
children: e
|
|
614
575
|
})
|
|
615
|
-
})),
|
|
616
|
-
const [
|
|
617
|
-
const e = !!i, t =
|
|
576
|
+
})), F = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: n, itemSize: o, shift: r, horizontal: i, cache: l, ssrCount: c, as: u = "div", item: d = "div", onScroll: h, onScrollEnd: g}, v) => {
|
|
577
|
+
const [S, p] = J(e, t), $ = (0, s.useRef)(null), w = D(h), m = D(g), _ = (0, s.useRef)(!!c), [z, b, y, I] = Y(() => {
|
|
578
|
+
const e = !!i, t = C(p, o, l), n = k(t, c);
|
|
618
579
|
return [ n, t, j(n, e), e ];
|
|
619
580
|
});
|
|
620
|
-
|
|
621
|
-
const [
|
|
622
|
-
|
|
581
|
+
p !== z.R() && z.q(5, [ p, r ]);
|
|
582
|
+
const [x, O] = (0, s.useReducer)(z.I, void 0, z.I), R = z.M(), M = z.t(), T = [];
|
|
583
|
+
W(() => (_[A] = !1, z.L(1, e => {
|
|
623
584
|
e ? (0, a.flushSync)(O) : O();
|
|
624
|
-
}), z.
|
|
625
|
-
m.current && m.current();
|
|
626
|
-
}), z.j(8, () => {
|
|
585
|
+
}), z.L(4, () => {
|
|
627
586
|
w.current && w.current();
|
|
628
|
-
}),
|
|
629
|
-
|
|
630
|
-
}), []),
|
|
631
|
-
|
|
632
|
-
}, [
|
|
587
|
+
}), z.L(8, () => {
|
|
588
|
+
m.current && m.current();
|
|
589
|
+
}), y.D($[A]), () => {
|
|
590
|
+
z._(), y._();
|
|
591
|
+
}), []), W(() => {
|
|
592
|
+
y.V();
|
|
593
|
+
}, [ x ]), (0, s.useImperativeHandle)(v, () => ({
|
|
633
594
|
get cache() {
|
|
634
|
-
return
|
|
595
|
+
return b.H();
|
|
635
596
|
},
|
|
636
597
|
get scrollOffset() {
|
|
637
598
|
return z.C();
|
|
@@ -642,20 +603,20 @@ f.jsx)("div", {
|
|
|
642
603
|
findItemIndex: z.k,
|
|
643
604
|
getItemOffset: z.u,
|
|
644
605
|
getItemSize: z.h,
|
|
645
|
-
scrollToIndex: (e, t) =>
|
|
606
|
+
scrollToIndex: (e, t) => H(y, z, e, t)
|
|
646
607
|
}), []);
|
|
647
608
|
for (let [e, t] = z.i(n); e <= t; e++) {
|
|
648
|
-
const t =
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
},
|
|
609
|
+
const t = S(e);
|
|
610
|
+
T.push(/* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(P, {
|
|
611
|
+
ee: y.P,
|
|
612
|
+
te: e,
|
|
613
|
+
ne: z.u(e),
|
|
614
|
+
oe: z.O(e),
|
|
615
|
+
re: d,
|
|
616
|
+
Z: t,
|
|
617
|
+
ie: I,
|
|
618
|
+
se: _[A]
|
|
619
|
+
}, X(t, e)));
|
|
659
620
|
}
|
|
660
621
|
/* @__PURE__ */ /* @__PURE__ */
|
|
661
622
|
return (0, f.jsx)(u, {
|
|
@@ -665,15 +626,15 @@ f.jsx)("div", {
|
|
|
665
626
|
overflowAnchor: "none",
|
|
666
627
|
flex: "none",
|
|
667
628
|
position: "relative",
|
|
668
|
-
width:
|
|
669
|
-
height:
|
|
670
|
-
pointerEvents:
|
|
629
|
+
width: I ? M : "100%",
|
|
630
|
+
height: I ? "100%" : M,
|
|
631
|
+
pointerEvents: R ? "none" : void 0
|
|
671
632
|
},
|
|
672
|
-
children:
|
|
633
|
+
children: T
|
|
673
634
|
});
|
|
674
|
-
}),
|
|
635
|
+
}), G = (e, t) => `${e}-${t}`, K = /*#__PURE__*/ /*#__PURE__*/ (0, s.memo)(({Z: e, ee: t, le: n, ce: o, fe: r, ae: i, ue: l, de: c, oe: a, he: u}) => {
|
|
675
636
|
const d = (0, s.useRef)(null);
|
|
676
|
-
return
|
|
637
|
+
return W(() => t(d[A], n, o), [ o, n ]), /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(u, {
|
|
677
638
|
ref: d,
|
|
678
639
|
style: (0, s.useMemo)(() => ({
|
|
679
640
|
contain: "layout style",
|
|
@@ -687,118 +648,118 @@ f.jsx)("div", {
|
|
|
687
648
|
}), [ r, i, c, l, a ]),
|
|
688
649
|
children: e
|
|
689
650
|
});
|
|
690
|
-
}),
|
|
691
|
-
const [
|
|
692
|
-
const e =
|
|
693
|
-
return [ e, i,
|
|
651
|
+
}), N = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, row: t, col: n, cellHeight: o = 40, cellWidth: r = 100, bufferSize: i, ssrRowCount: l, ssrColCount: c, item: u = "div", domRef: d, onScroll: h, onScrollEnd: g, style: v, ...p}, $) => {
|
|
652
|
+
const [w, m, _] = Y(() => {
|
|
653
|
+
const e = k(C(t, o), l), i = k(C(n, r), c);
|
|
654
|
+
return [ e, i, L(e, i) ];
|
|
694
655
|
});
|
|
695
|
-
t !==
|
|
696
|
-
const [z,
|
|
697
|
-
s.useRef)(null),
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
e ? (0, a.flushSync)(
|
|
701
|
-
}),
|
|
702
|
-
e ? (0, a.flushSync)(
|
|
703
|
-
}),
|
|
704
|
-
|
|
705
|
-
}),
|
|
706
|
-
|
|
656
|
+
t !== w.R() && w.q(5, [ t ]), n !== m.R() && m.q(5, [ n ]);
|
|
657
|
+
const [z, b] = (0, s.useReducer)(w.I, void 0, w.I), [y, I] = (0, s.useReducer)(m.I, void 0, m.I), O = w.M(), R = m.M(), M = x(w), T = x(m), E = (0,
|
|
658
|
+
s.useRef)(null), j = D(h), q = D(g);
|
|
659
|
+
W(() => {
|
|
660
|
+
w.L(1, e => {
|
|
661
|
+
e ? (0, a.flushSync)(b) : b();
|
|
662
|
+
}), m.L(1, e => {
|
|
663
|
+
e ? (0, a.flushSync)(I) : I();
|
|
664
|
+
}), w.L(4, () => {
|
|
665
|
+
j.current && j.current(w.C());
|
|
666
|
+
}), w.L(8, () => {
|
|
667
|
+
q.current && q.current();
|
|
707
668
|
});
|
|
708
|
-
const e = E[
|
|
709
|
-
return
|
|
710
|
-
|
|
669
|
+
const e = E[A];
|
|
670
|
+
return _.D(e), () => {
|
|
671
|
+
w._(), m._(), _._();
|
|
711
672
|
};
|
|
712
|
-
}, []),
|
|
713
|
-
|
|
714
|
-
}, [ z,
|
|
673
|
+
}, []), W(() => {
|
|
674
|
+
_.V();
|
|
675
|
+
}, [ z, y ]), (0, s.useImperativeHandle)($, () => ({
|
|
715
676
|
get scrollTop() {
|
|
716
|
-
return
|
|
677
|
+
return w.C();
|
|
717
678
|
},
|
|
718
679
|
get scrollLeft() {
|
|
719
|
-
return
|
|
680
|
+
return m.C();
|
|
720
681
|
},
|
|
721
682
|
get scrollHeight() {
|
|
722
|
-
return
|
|
683
|
+
return x(w);
|
|
723
684
|
},
|
|
724
685
|
get scrollWidth() {
|
|
725
|
-
return
|
|
686
|
+
return x(m);
|
|
726
687
|
},
|
|
727
688
|
get viewportHeight() {
|
|
728
|
-
return
|
|
689
|
+
return w.o();
|
|
729
690
|
},
|
|
730
691
|
get viewportWidth() {
|
|
731
|
-
return
|
|
692
|
+
return m.o();
|
|
732
693
|
},
|
|
733
|
-
findRowIndex:
|
|
734
|
-
findColIndex:
|
|
735
|
-
getRowOffset:
|
|
736
|
-
getColOffset:
|
|
737
|
-
getRowSize:
|
|
738
|
-
getColSize:
|
|
694
|
+
findRowIndex: w.k,
|
|
695
|
+
findColIndex: m.k,
|
|
696
|
+
getRowOffset: w.u,
|
|
697
|
+
getColOffset: m.u,
|
|
698
|
+
getRowSize: w.h,
|
|
699
|
+
getColSize: m.h,
|
|
739
700
|
resizeCols(e) {
|
|
740
|
-
|
|
701
|
+
_.G(e);
|
|
741
702
|
},
|
|
742
703
|
resizeRows(e) {
|
|
743
|
-
|
|
704
|
+
_.F(e);
|
|
744
705
|
},
|
|
745
706
|
scrollToIndex: (e, t) => ((e, t, n, o, r) => {
|
|
746
707
|
if (null != o) {
|
|
747
|
-
const n =
|
|
748
|
-
e.
|
|
708
|
+
const n = S(o, 0, t.R() - 1);
|
|
709
|
+
e.N(() => t.u(n));
|
|
749
710
|
}
|
|
750
711
|
if (null != r) {
|
|
751
|
-
const t =
|
|
752
|
-
e.
|
|
712
|
+
const t = S(r, 0, n.R() - 1);
|
|
713
|
+
e.K(() => n.u(t));
|
|
753
714
|
}
|
|
754
|
-
})(
|
|
715
|
+
})(_, w, m, e, t),
|
|
755
716
|
scrollTo: (e, t) => ((e, t, n) => {
|
|
756
|
-
null != t && e.
|
|
757
|
-
})(
|
|
717
|
+
null != t && e.N(() => t), null != n && e.K(() => n);
|
|
718
|
+
})(_, e, t),
|
|
758
719
|
scrollBy: (e, t) => ((e, t, n, o, r) => {
|
|
759
720
|
if (null != o) {
|
|
760
721
|
const n = o + t.C();
|
|
761
|
-
e.
|
|
722
|
+
e.N(() => n);
|
|
762
723
|
}
|
|
763
724
|
if (null != r) {
|
|
764
725
|
const t = r + n.C();
|
|
765
|
-
e.
|
|
726
|
+
e.K(() => t);
|
|
766
727
|
}
|
|
767
|
-
})(
|
|
728
|
+
})(_, w, m, e, t)
|
|
768
729
|
}), []);
|
|
769
730
|
const H = (0, s.useMemo)(() => {
|
|
770
731
|
const t = /* @__PURE__ */ new Map;
|
|
771
732
|
return (n, o) => {
|
|
772
|
-
let r = t.get(
|
|
773
|
-
return r || t.set(
|
|
733
|
+
let r = t.get(G(n, o));
|
|
734
|
+
return r || t.set(G(n, o), r = e({
|
|
774
735
|
rowIndex: n,
|
|
775
736
|
colIndex: o
|
|
776
737
|
})), r;
|
|
777
738
|
};
|
|
778
|
-
}, [ e ]), [
|
|
779
|
-
for (let e =
|
|
780
|
-
f.jsx)(
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
},
|
|
739
|
+
}, [ e ]), [B, X] = w.i(i), [P, J] = m.i(i), V = [];
|
|
740
|
+
for (let e = B; e <= X; e++) for (let t = P; t <= J; t++) V.push(/* @__PURE__ */ /* @__PURE__ */ (0,
|
|
741
|
+
f.jsx)(K, {
|
|
742
|
+
ee: _.P,
|
|
743
|
+
le: e,
|
|
744
|
+
ce: t,
|
|
745
|
+
fe: w.u(e),
|
|
746
|
+
ae: m.u(t),
|
|
747
|
+
ue: w.h(e),
|
|
748
|
+
de: m.h(t),
|
|
749
|
+
oe: w.O(e) || m.O(t),
|
|
750
|
+
he: u,
|
|
751
|
+
Z: H(e, t)
|
|
752
|
+
}, G(e, t)));
|
|
792
753
|
/* @__PURE__ */ /* @__PURE__ */
|
|
793
754
|
return (0, f.jsx)("div", {
|
|
794
755
|
ref: d,
|
|
795
|
-
...
|
|
756
|
+
...p,
|
|
796
757
|
style: {
|
|
797
758
|
overflow: "auto",
|
|
798
759
|
contain: "strict",
|
|
799
760
|
width: "100%",
|
|
800
761
|
height: "100%",
|
|
801
|
-
...
|
|
762
|
+
...v
|
|
802
763
|
},
|
|
803
764
|
children: /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)("div", {
|
|
804
765
|
ref: E,
|
|
@@ -807,14 +768,14 @@ f.jsx)("div", {
|
|
|
807
768
|
overflowAnchor: "none",
|
|
808
769
|
flex: "none",
|
|
809
770
|
position: "relative",
|
|
810
|
-
width:
|
|
811
|
-
height:
|
|
812
|
-
pointerEvents: O ||
|
|
771
|
+
width: T,
|
|
772
|
+
height: M,
|
|
773
|
+
pointerEvents: O || R ? "none" : void 0
|
|
813
774
|
},
|
|
814
775
|
children: V
|
|
815
776
|
})
|
|
816
777
|
});
|
|
817
778
|
});
|
|
818
779
|
|
|
819
|
-
exports.VList =
|
|
780
|
+
exports.VList = U, exports.Virtualizer = V, exports.WindowVirtualizer = F, exports.experimental_VGrid = N;
|
|
820
781
|
//# sourceMappingURL=index.cjs.map
|