@glhrmoura/vue-virtualize 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -9
- package/dist/components/VirtualGrid.vue.d.ts +10 -4
- package/dist/components/VirtualList.vue.d.ts +9 -2
- package/dist/components/VirtualTable.vue.d.ts +9 -2
- package/dist/composables/useVirtualGrid.d.ts +5 -1
- package/dist/composables/useVirtualList.d.ts +6 -1
- package/dist/composables/useVirtualTable.d.ts +11 -2
- package/dist/composables/useVirtualizer.d.ts +6 -1
- package/dist/core/measurements.d.ts +1 -0
- package/dist/core/types.d.ts +5 -0
- package/dist/core/virtualizer.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +661 -502
- package/dist/index.mjs.map +1 -1
- package/dist/utils/dom.d.ts +4 -0
- package/dist/utils/layout.d.ts +1 -0
- package/package.json +2 -6
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { shallowRef as
|
|
2
|
-
function
|
|
1
|
+
import { shallowRef as _e, ref as W, toValue as l, watch as Ee, onBeforeUnmount as Ce, computed as C, defineComponent as ge, openBlock as V, createBlock as le, resolveDynamicComponent as ae, normalizeStyle as B, withCtx as ce, renderSlot as U, createElementBlock as K, Fragment as te, renderList as ne, unref as j, mergeProps as we, createElementVNode as Me, toDisplayString as Oe, createTextVNode as Xe } from "vue";
|
|
2
|
+
function he(e) {
|
|
3
3
|
return !Number.isFinite(e) || e < 0 ? 0 : e;
|
|
4
4
|
}
|
|
5
|
-
class
|
|
5
|
+
class Ye {
|
|
6
6
|
sizes = /* @__PURE__ */ new Map();
|
|
7
7
|
divergent = !1;
|
|
8
8
|
get(t) {
|
|
@@ -29,46 +29,56 @@ class Re {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
shift(t) {
|
|
33
|
+
if (!t) return;
|
|
34
|
+
const i = /* @__PURE__ */ new Map();
|
|
35
|
+
for (const [n, r] of this.sizes) {
|
|
36
|
+
const s = n + t;
|
|
37
|
+
s >= 0 && i.set(s, r);
|
|
38
|
+
}
|
|
39
|
+
this.sizes.clear();
|
|
40
|
+
for (const [n, r] of i) this.sizes.set(n, r);
|
|
41
|
+
}
|
|
32
42
|
}
|
|
33
|
-
function
|
|
43
|
+
function Te(e, t, i) {
|
|
34
44
|
return Math.min(i, Math.max(t, e));
|
|
35
45
|
}
|
|
36
|
-
const
|
|
37
|
-
function
|
|
46
|
+
const qe = 16777216;
|
|
47
|
+
function J(e, t, i) {
|
|
38
48
|
const n = Math.max(0, t - Math.max(0, i));
|
|
39
|
-
return
|
|
49
|
+
return Te(Number.isFinite(e) ? e : 0, 0, n);
|
|
40
50
|
}
|
|
41
|
-
function
|
|
42
|
-
const i = Math.max(0, Number.isFinite(e) ? e : 0), n = Math.min(i,
|
|
51
|
+
function H(e, t) {
|
|
52
|
+
const i = Math.max(0, Number.isFinite(e) ? e : 0), n = Math.min(i, qe);
|
|
43
53
|
return t === void 0 || !Number.isFinite(t) || t <= 0 ? n : Math.min(n, t);
|
|
44
54
|
}
|
|
45
|
-
function
|
|
55
|
+
function Ue(e, t, i, n) {
|
|
46
56
|
const r = Math.max(0, t - Math.max(0, n)), s = Math.max(0, i - Math.max(0, n));
|
|
47
|
-
return r <= 0 ? 0 : s <= 0 || s >= r ?
|
|
57
|
+
return r <= 0 ? 0 : s <= 0 || s >= r ? J(e, t, n) : Math.max(0, e) / s * r;
|
|
48
58
|
}
|
|
49
|
-
function
|
|
59
|
+
function Ze(e, t, i, n) {
|
|
50
60
|
const r = Math.max(0, t - Math.max(0, n)), s = Math.max(0, i - Math.max(0, n));
|
|
51
|
-
return s <= 0 ? 0 : r <= 0 || s >= r ?
|
|
61
|
+
return s <= 0 ? 0 : r <= 0 || s >= r ? J(e, t, n) : J(e, t, n) / r * s;
|
|
52
62
|
}
|
|
53
|
-
function
|
|
63
|
+
function Je(e, t, i) {
|
|
54
64
|
if (e <= 0) return 0;
|
|
55
65
|
let n = 0, r = e - 1, s = e - 1;
|
|
56
66
|
for (; n <= r; ) {
|
|
57
|
-
const
|
|
58
|
-
i(
|
|
67
|
+
const d = n + r >>> 1;
|
|
68
|
+
i(d) > t ? (s = d, r = d - 1) : n = d + 1;
|
|
59
69
|
}
|
|
60
70
|
return s;
|
|
61
71
|
}
|
|
62
|
-
function
|
|
72
|
+
function Qe(e, t, i) {
|
|
63
73
|
if (e <= 0) return 0;
|
|
64
74
|
let n = 0, r = e - 1, s = 0;
|
|
65
75
|
for (; n <= r; ) {
|
|
66
|
-
const
|
|
67
|
-
i(
|
|
76
|
+
const d = n + r >>> 1;
|
|
77
|
+
i(d) < t ? (s = d, n = d + 1) : r = d - 1;
|
|
68
78
|
}
|
|
69
79
|
return s;
|
|
70
80
|
}
|
|
71
|
-
function
|
|
81
|
+
function et(e) {
|
|
72
82
|
const t = e.start + e.size;
|
|
73
83
|
let i = e.align;
|
|
74
84
|
if (i === "auto") {
|
|
@@ -78,7 +88,7 @@ function Ve(e) {
|
|
|
78
88
|
}
|
|
79
89
|
return i === "center" ? e.start - (e.viewport - e.size) / 2 : i === "end" ? t - e.viewport : e.start;
|
|
80
90
|
}
|
|
81
|
-
class
|
|
91
|
+
class tt {
|
|
82
92
|
count = 0;
|
|
83
93
|
estimateSize = () => 0;
|
|
84
94
|
overscan = 0;
|
|
@@ -90,14 +100,14 @@ class Ae {
|
|
|
90
100
|
viewportSize = 0;
|
|
91
101
|
scrollOffset = 0;
|
|
92
102
|
getItemKey = (t) => t;
|
|
93
|
-
measurements = new
|
|
103
|
+
measurements = new Ye();
|
|
94
104
|
built = 0;
|
|
95
105
|
offsets = [];
|
|
96
106
|
laneCursor = [];
|
|
97
107
|
laneEnd = [];
|
|
98
108
|
setOptions(t) {
|
|
99
|
-
const i = Math.max(1, Math.floor(t.lanes ?? 1)), n = t.gap ?? 0, r = t.paddingStart ?? 0, s = t.paddingEnd ?? 0,
|
|
100
|
-
this.count =
|
|
109
|
+
const i = Math.max(1, Math.floor(t.lanes ?? 1)), n = t.gap ?? 0, r = t.paddingStart ?? 0, s = t.paddingEnd ?? 0, d = Math.max(0, Math.floor(t.count)), I = t.itemSize === void 0 || t.itemSize === null ? null : he(t.itemSize), O = this.itemSize, p = i !== this.lanes || n !== this.gap || r !== this.paddingStart || s !== this.paddingEnd || t.estimateSize !== this.estimateSize || I !== this.itemSize;
|
|
110
|
+
this.count = d, this.lanes = i, this.gap = n, this.paddingStart = r, this.paddingEnd = s, this.overscan = Math.max(0, Math.floor(t.overscan ?? 0)), this.estimateSize = t.estimateSize, this.itemSize = I, this.getItemKey = t.getItemKey ?? ((c) => c), t.viewportSize !== void 0 && (this.viewportSize = Math.max(0, t.viewportSize)), I !== O && this.measurements.clear(), this.measurements.trim(this.count, this.itemSize), (p || this.built > this.count) && this.resetGeometry();
|
|
101
111
|
}
|
|
102
112
|
setScrollOffset(t) {
|
|
103
113
|
this.scrollOffset = Number.isFinite(t) ? t : 0;
|
|
@@ -110,7 +120,7 @@ class Ae {
|
|
|
110
120
|
}
|
|
111
121
|
measure(t, i) {
|
|
112
122
|
if (t < 0 || t >= this.count) return !1;
|
|
113
|
-
const n =
|
|
123
|
+
const n = he(i), r = this.measurements.get(t);
|
|
114
124
|
if (r !== void 0 && Math.abs(r - n) < 0.5) return !1;
|
|
115
125
|
const s = this.getItemSize(t);
|
|
116
126
|
return this.measurements.set(t, n, this.itemSize), Math.abs(s - n) < 0.5 ? !1 : (this.resetGeometry(), !0);
|
|
@@ -118,9 +128,12 @@ class Ae {
|
|
|
118
128
|
clearMeasurements() {
|
|
119
129
|
this.measurements.clear(), this.resetGeometry();
|
|
120
130
|
}
|
|
131
|
+
shiftMeasurements(t) {
|
|
132
|
+
t && (this.measurements.shift(t), this.resetGeometry());
|
|
133
|
+
}
|
|
121
134
|
getItemSize(t) {
|
|
122
135
|
const i = this.measurements.get(t);
|
|
123
|
-
return i !== void 0 ? i : this.itemSize !== null ? this.itemSize :
|
|
136
|
+
return i !== void 0 ? i : this.itemSize !== null ? this.itemSize : he(this.estimateSize(t));
|
|
124
137
|
}
|
|
125
138
|
getItemOffset(t) {
|
|
126
139
|
if (t <= 0 || this.count <= 0) return this.paddingStart;
|
|
@@ -137,8 +150,8 @@ class Ae {
|
|
|
137
150
|
let i = this.paddingStart;
|
|
138
151
|
const n = this.itemSize ?? 0;
|
|
139
152
|
for (let r = 0; r < this.lanes && r < this.count; r += 1) {
|
|
140
|
-
const s = this.laneLength(r),
|
|
141
|
-
|
|
153
|
+
const s = this.laneLength(r), d = this.paddingStart + s * n + Math.max(0, s - 1) * this.gap;
|
|
154
|
+
d > i && (i = d);
|
|
142
155
|
}
|
|
143
156
|
return i + this.paddingEnd;
|
|
144
157
|
}
|
|
@@ -152,26 +165,26 @@ class Ae {
|
|
|
152
165
|
}
|
|
153
166
|
getVirtualItems() {
|
|
154
167
|
if (this.count <= 0 || this.viewportSize <= 0) return [];
|
|
155
|
-
const t =
|
|
168
|
+
const t = J(this.scrollOffset, this.getTotalSize(), this.viewportSize), i = t + this.viewportSize, n = [];
|
|
156
169
|
for (let r = 0; r < this.lanes; r += 1) {
|
|
157
170
|
const s = this.laneLength(r);
|
|
158
171
|
if (s <= 0) continue;
|
|
159
|
-
const
|
|
160
|
-
const
|
|
161
|
-
return this.getItemOffset(
|
|
162
|
-
}),
|
|
172
|
+
const d = Je(s, t, (c) => {
|
|
173
|
+
const g = this.ordinalIndex(r, c);
|
|
174
|
+
return this.getItemOffset(g) + this.getItemSize(g);
|
|
175
|
+
}), I = Qe(
|
|
163
176
|
s,
|
|
164
177
|
i,
|
|
165
|
-
(
|
|
166
|
-
),
|
|
167
|
-
for (let
|
|
168
|
-
const
|
|
178
|
+
(c) => this.getItemOffset(this.ordinalIndex(r, c))
|
|
179
|
+
), O = Math.max(0, Math.min(d, I) - this.overscan), p = Math.min(s - 1, Math.max(d, I) + this.overscan);
|
|
180
|
+
for (let c = O; c <= p; c += 1) {
|
|
181
|
+
const g = this.ordinalIndex(r, c), k = this.getItemOffset(g), A = this.getItemSize(g);
|
|
169
182
|
n.push({
|
|
170
|
-
index:
|
|
171
|
-
key: this.getItemKey(
|
|
172
|
-
start:
|
|
173
|
-
size:
|
|
174
|
-
end:
|
|
183
|
+
index: g,
|
|
184
|
+
key: this.getItemKey(g),
|
|
185
|
+
start: k,
|
|
186
|
+
size: A,
|
|
187
|
+
end: k + A,
|
|
175
188
|
lane: r
|
|
176
189
|
});
|
|
177
190
|
}
|
|
@@ -180,14 +193,14 @@ class Ae {
|
|
|
180
193
|
}
|
|
181
194
|
getOffsetForIndex(t, i = "auto") {
|
|
182
195
|
if (this.count <= 0) return 0;
|
|
183
|
-
const n =
|
|
196
|
+
const n = Te(t, 0, this.count - 1), r = this.getItemOffset(n), s = this.getItemSize(n), d = et({
|
|
184
197
|
start: r,
|
|
185
198
|
size: s,
|
|
186
199
|
viewport: this.viewportSize,
|
|
187
200
|
current: this.scrollOffset,
|
|
188
201
|
align: i
|
|
189
202
|
});
|
|
190
|
-
return
|
|
203
|
+
return J(d, this.getTotalSize(), this.viewportSize);
|
|
191
204
|
}
|
|
192
205
|
usesFixedPath() {
|
|
193
206
|
return this.itemSize !== null && !this.measurements.hasDivergent;
|
|
@@ -215,10 +228,10 @@ class Ae {
|
|
|
215
228
|
function Z() {
|
|
216
229
|
return typeof window < "u" && typeof document < "u";
|
|
217
230
|
}
|
|
218
|
-
function
|
|
231
|
+
function ke(e) {
|
|
219
232
|
return typeof Element > "u" ? null : e instanceof Element ? e : null;
|
|
220
233
|
}
|
|
221
|
-
function
|
|
234
|
+
function nt(e, t, i, n) {
|
|
222
235
|
if (n === "smooth" && typeof e.scrollTo == "function") {
|
|
223
236
|
e.scrollTo({
|
|
224
237
|
top: i ? e.scrollTop : t,
|
|
@@ -229,22 +242,45 @@ function Fe(e, t, i, n) {
|
|
|
229
242
|
}
|
|
230
243
|
i ? e.scrollLeft = t : e.scrollTop = t;
|
|
231
244
|
}
|
|
232
|
-
function
|
|
245
|
+
function it(e, t, i) {
|
|
246
|
+
if (!(typeof window > "u")) {
|
|
247
|
+
if (i === "smooth") {
|
|
248
|
+
window.scrollTo({
|
|
249
|
+
top: t ? window.scrollY : e,
|
|
250
|
+
left: t ? e : window.scrollX,
|
|
251
|
+
behavior: i
|
|
252
|
+
});
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
t ? window.scrollTo(e, window.scrollY) : window.scrollTo(window.scrollX, e);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function Ie(e, t) {
|
|
233
259
|
return t ? e.scrollLeft : e.scrollTop;
|
|
234
260
|
}
|
|
235
|
-
function
|
|
261
|
+
function rt(e) {
|
|
262
|
+
return typeof window > "u" ? 0 : e ? window.scrollX : window.scrollY;
|
|
263
|
+
}
|
|
264
|
+
function st(e, t) {
|
|
236
265
|
return t ? e.clientWidth : e.clientHeight;
|
|
237
266
|
}
|
|
238
|
-
function
|
|
267
|
+
function ot(e) {
|
|
268
|
+
return typeof window > "u" ? 0 : e ? window.innerWidth : window.innerHeight;
|
|
269
|
+
}
|
|
270
|
+
function lt(e, t) {
|
|
239
271
|
return t ? e.scrollWidth : e.scrollHeight;
|
|
240
272
|
}
|
|
241
|
-
function
|
|
273
|
+
function at(e, t) {
|
|
274
|
+
const i = e.getBoundingClientRect();
|
|
275
|
+
return typeof window > "u" ? t ? i.left : i.top : t ? i.left + window.scrollX : i.top + window.scrollY;
|
|
276
|
+
}
|
|
277
|
+
function ct(e) {
|
|
242
278
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(e) : setTimeout(e, 0);
|
|
243
279
|
}
|
|
244
|
-
function
|
|
280
|
+
function ut(e) {
|
|
245
281
|
e && (typeof cancelAnimationFrame == "function" ? cancelAnimationFrame(e) : clearTimeout(e));
|
|
246
282
|
}
|
|
247
|
-
function
|
|
283
|
+
function dt(e, t) {
|
|
248
284
|
if (e.length !== t.length) return !1;
|
|
249
285
|
for (let i = 0; i < e.length; i += 1) {
|
|
250
286
|
const n = e[i], r = t[i];
|
|
@@ -253,179 +289,232 @@ function Ge(e, t) {
|
|
|
253
289
|
}
|
|
254
290
|
return !0;
|
|
255
291
|
}
|
|
256
|
-
function
|
|
257
|
-
const t = new
|
|
258
|
-
let
|
|
259
|
-
const
|
|
260
|
-
function
|
|
261
|
-
const
|
|
262
|
-
return typeof HTMLElement > "u" ? null :
|
|
292
|
+
function me(e) {
|
|
293
|
+
const t = new tt(), i = _e([]), n = W(0), r = W(0), s = W(0), d = W(!1), I = (o) => e.estimateSize(o);
|
|
294
|
+
let O = null, p = !1, c = null, g = null, k = 0, A = 0, f = 0, b = l(e.revision), S = l(e.count), v = e.getItemKey?.(0) ?? 0, z = !1, h = "";
|
|
295
|
+
const T = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), G = [];
|
|
296
|
+
function D() {
|
|
297
|
+
const o = l(e.container);
|
|
298
|
+
return typeof HTMLElement > "u" ? null : o instanceof HTMLElement ? o : null;
|
|
263
299
|
}
|
|
264
|
-
function
|
|
265
|
-
return
|
|
300
|
+
function $() {
|
|
301
|
+
return l(e.horizontal) ?? !1;
|
|
266
302
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
269
|
-
return a ? m() ? a.width : a.height : 0;
|
|
303
|
+
function u() {
|
|
304
|
+
return l(e.windowScroll) ?? !1;
|
|
270
305
|
}
|
|
271
|
-
function
|
|
272
|
-
return
|
|
306
|
+
function R() {
|
|
307
|
+
return l(e.reverse) ?? !1;
|
|
273
308
|
}
|
|
274
|
-
function
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
);
|
|
309
|
+
function y() {
|
|
310
|
+
const o = l(e.initialRect);
|
|
311
|
+
return o ? $() ? o.width : o.height : 0;
|
|
312
|
+
}
|
|
313
|
+
function L() {
|
|
314
|
+
const o = D(), a = l(e.scrollMargin) ?? 0;
|
|
315
|
+
return !o || !Z() ? a : at(o, $()) + a;
|
|
316
|
+
}
|
|
317
|
+
function ee(o, a) {
|
|
318
|
+
return u() || !o ? H(a) : H(a, lt(o, $()));
|
|
319
|
+
}
|
|
320
|
+
function $e(o) {
|
|
321
|
+
return u() ? Math.max(0, rt($()) - L()) : o ? Ie(o, $()) : 0;
|
|
322
|
+
}
|
|
323
|
+
function ve(o) {
|
|
324
|
+
return u() ? ot($()) : o ? st(o, $()) : 0;
|
|
325
|
+
}
|
|
326
|
+
function Ae(o, a, m) {
|
|
327
|
+
if (u()) {
|
|
328
|
+
it(a + L(), $(), m);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
o && nt(o, a, $(), m);
|
|
281
332
|
}
|
|
282
|
-
function
|
|
283
|
-
|
|
333
|
+
function ue(o, a, m) {
|
|
334
|
+
return Ue(
|
|
335
|
+
$e(o),
|
|
284
336
|
a,
|
|
285
|
-
|
|
286
|
-
m
|
|
287
|
-
O
|
|
337
|
+
ee(o, a),
|
|
338
|
+
m
|
|
288
339
|
);
|
|
289
340
|
}
|
|
290
|
-
function
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
341
|
+
function P(o, a, m, w, x) {
|
|
342
|
+
Ae(
|
|
343
|
+
o,
|
|
344
|
+
Ze(a, m, ee(o, m), w),
|
|
345
|
+
x
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
function Fe() {
|
|
349
|
+
const o = e.onVisibleRangeChange;
|
|
350
|
+
if (!o) return;
|
|
351
|
+
const a = i.value, m = l(e.count), w = a.length ? {
|
|
352
|
+
startIndex: a[0]?.index ?? 0,
|
|
353
|
+
endIndex: a[a.length - 1]?.index ?? -1,
|
|
354
|
+
count: m
|
|
355
|
+
} : { startIndex: 0, endIndex: -1, count: m }, x = `${w.startIndex}:${w.endIndex}:${w.count}`;
|
|
356
|
+
x !== h && (h = x, o(w));
|
|
357
|
+
}
|
|
358
|
+
function F() {
|
|
359
|
+
const o = l(e.revision);
|
|
360
|
+
Object.is(o, b) || (b = o, t.clearMeasurements());
|
|
361
|
+
const a = l(e.count), m = e.getItemKey?.(0) ?? 0, w = R() && S > 0 && a > S && m !== v, x = R() && S > 0 && a > S && m === v, E = w || x ? a - S : 0, _ = R() && t.getViewportSize() > 0 && t.getScrollOffset() + t.getViewportSize() >= t.getTotalSize() - 64;
|
|
362
|
+
w && E > 0 && t.shiftMeasurements(E);
|
|
363
|
+
const X = D(), xe = ve(X), He = l(e.viewportInset) ?? 0, Y = Math.max(0, (xe > 0 ? xe : y()) - He), De = l(e.itemSize);
|
|
364
|
+
if (t.setOptions({
|
|
365
|
+
count: a,
|
|
366
|
+
estimateSize: I,
|
|
367
|
+
overscan: (l(e.overscan) ?? 8) + f,
|
|
368
|
+
gap: l(e.gap) ?? 0,
|
|
369
|
+
paddingStart: l(e.paddingStart) ?? 0,
|
|
370
|
+
paddingEnd: l(e.paddingEnd) ?? 0,
|
|
371
|
+
lanes: l(e.lanes) ?? 1,
|
|
372
|
+
itemSize: De ?? null,
|
|
303
373
|
getItemKey: e.getItemKey,
|
|
304
|
-
viewportSize:
|
|
305
|
-
})
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
|
|
374
|
+
viewportSize: Y
|
|
375
|
+
}), w && E > 0) {
|
|
376
|
+
let re = 0;
|
|
377
|
+
const Pe = l(e.gap) ?? 0;
|
|
378
|
+
for (let se = 0; se < E; se += 1)
|
|
379
|
+
re += t.getItemSize(se), se < E - 1 && (re += Pe);
|
|
380
|
+
re > 0 && t.setScrollOffset(t.getScrollOffset() + re);
|
|
381
|
+
}
|
|
382
|
+
const N = t.getTotalSize(), q = Math.max(0, N - Y);
|
|
383
|
+
R() && !z && N > 0 && Y > 0 ? (z = !0, t.setScrollOffset(q), P(X, q, N, Y, "auto")) : x && _ || t.getScrollOffset() > q ? (t.setScrollOffset(q), P(X, q, N, Y, "auto")) : w && E > 0 && P(X, t.getScrollOffset(), N, Y, "auto"), S = a, v = m;
|
|
384
|
+
const pe = t.getVirtualItems();
|
|
385
|
+
dt(i.value, pe) || (i.value = pe), n.value !== N && (n.value = N);
|
|
386
|
+
const fe = t.getScrollOffset();
|
|
387
|
+
r.value !== fe && (r.value = fe);
|
|
388
|
+
const be = X && !u() ? fe - Ie(X, $()) : 0;
|
|
389
|
+
s.value !== be && (s.value = be), Fe();
|
|
390
|
+
}
|
|
391
|
+
function Ke() {
|
|
392
|
+
d.value = !1, f = 0;
|
|
393
|
+
for (const [o, a] of T)
|
|
394
|
+
G.push({ element: o, index: a });
|
|
395
|
+
ze(), F(), e.onScrollEnd?.();
|
|
314
396
|
}
|
|
315
|
-
function
|
|
316
|
-
|
|
317
|
-
for (const [a, c] of d)
|
|
318
|
-
l.push({ element: a, index: c });
|
|
319
|
-
se(), y();
|
|
397
|
+
function Le() {
|
|
398
|
+
d.value = !0, !(typeof window > "u") && (window.clearTimeout(A), A = window.setTimeout(Ke, 120));
|
|
320
399
|
}
|
|
321
|
-
function
|
|
322
|
-
|
|
400
|
+
function ie() {
|
|
401
|
+
const o = D();
|
|
402
|
+
if (!u() && !o) return;
|
|
403
|
+
Le();
|
|
404
|
+
const a = t.getViewportSize(), m = t.getTotalSize(), w = ue(o, m, a), x = t.getScrollOffset(), E = Math.max(1, l(e.itemSize) ?? 48);
|
|
405
|
+
f = Math.min(24, Math.ceil(Math.abs(w - x) / E)), t.setScrollOffset(w), F();
|
|
323
406
|
}
|
|
324
|
-
function
|
|
325
|
-
|
|
326
|
-
if (!a) return;
|
|
327
|
-
V();
|
|
328
|
-
const c = t.getViewportSize(), g = t.getTotalSize(), M = _(a, g, c), O = t.getScrollOffset(), C = Math.max(1, o(e.itemSize) ?? 48);
|
|
329
|
-
k = Math.min(24, Math.ceil(Math.abs(M - O) / C)), t.setScrollOffset(M), y();
|
|
407
|
+
function de() {
|
|
408
|
+
O && (O.removeEventListener("scroll", ie), O = null), p && typeof window < "u" && (window.removeEventListener("scroll", ie), window.removeEventListener("resize", F), p = !1), c?.disconnect(), c = null;
|
|
330
409
|
}
|
|
331
|
-
function
|
|
332
|
-
const
|
|
333
|
-
if (
|
|
334
|
-
|
|
335
|
-
|
|
410
|
+
function Be() {
|
|
411
|
+
const o = D();
|
|
412
|
+
if (u()) {
|
|
413
|
+
if (p && O === o || (de(), O = o, !Z())) return;
|
|
414
|
+
p = !0;
|
|
415
|
+
const x = t.getViewportSize(), E = t.getTotalSize();
|
|
416
|
+
t.getScrollOffset() > 0 ? P(o, t.getScrollOffset(), E, x, "auto") : t.setScrollOffset(ue(o, E, x)), window.addEventListener("scroll", ie, { passive: !0 }), window.addEventListener("resize", F), o && typeof ResizeObserver < "u" && (c = new ResizeObserver(() => F()), c.observe(o));
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if (o === O && !p || (de(), O = o, !o || !Z())) return;
|
|
420
|
+
const m = t.getViewportSize(), w = t.getTotalSize();
|
|
421
|
+
t.getScrollOffset() > 0 ? P(o, t.getScrollOffset(), w, m, "auto") : t.setScrollOffset(ue(o, w, m)), o.addEventListener("scroll", ie, { passive: !0 }), typeof ResizeObserver < "u" && (c = new ResizeObserver(() => F()), c.observe(o));
|
|
336
422
|
}
|
|
337
|
-
function
|
|
338
|
-
return !Z() || typeof ResizeObserver > "u" ? null : (
|
|
339
|
-
const
|
|
340
|
-
let
|
|
341
|
-
if (!
|
|
342
|
-
for (const
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
const
|
|
346
|
-
|
|
423
|
+
function je() {
|
|
424
|
+
return !Z() || typeof ResizeObserver > "u" ? null : (g || (g = new ResizeObserver((o) => {
|
|
425
|
+
const a = $();
|
|
426
|
+
let m = !1;
|
|
427
|
+
if (!d.value) {
|
|
428
|
+
for (const w of o) {
|
|
429
|
+
const x = T.get(w.target);
|
|
430
|
+
if (x === void 0) continue;
|
|
431
|
+
const E = w.borderBoxSize?.[0], _ = Math.round(
|
|
432
|
+
a ? E?.inlineSize ?? w.contentRect.width : E?.blockSize ?? w.contentRect.height
|
|
347
433
|
);
|
|
348
|
-
|
|
434
|
+
_ > 0 && t.measure(x, _) && (m = !0);
|
|
349
435
|
}
|
|
350
|
-
|
|
436
|
+
m && F();
|
|
351
437
|
}
|
|
352
|
-
})),
|
|
438
|
+
})), g);
|
|
353
439
|
}
|
|
354
|
-
function
|
|
355
|
-
if (
|
|
356
|
-
const
|
|
357
|
-
let
|
|
358
|
-
for (const
|
|
359
|
-
if (!
|
|
360
|
-
const
|
|
361
|
-
|
|
440
|
+
function ze() {
|
|
441
|
+
if (k = 0, d.value) return;
|
|
442
|
+
const o = G.splice(0, G.length), a = $();
|
|
443
|
+
let m = !1;
|
|
444
|
+
for (const w of o) {
|
|
445
|
+
if (!w.element.isConnected) continue;
|
|
446
|
+
const x = w.element.getBoundingClientRect(), E = Math.round(a ? x.width : x.height);
|
|
447
|
+
E > 0 && t.measure(w.index, E) && (m = !0);
|
|
362
448
|
}
|
|
363
|
-
|
|
449
|
+
m && F();
|
|
364
450
|
}
|
|
365
|
-
function
|
|
366
|
-
const
|
|
367
|
-
|
|
451
|
+
function Ge(o, a) {
|
|
452
|
+
const m = ke(o), w = je(), x = M.get(a);
|
|
453
|
+
x && x !== m && (w?.unobserve(x), T.delete(x), M.delete(a)), m && (M.set(a, m), T.set(m, a), w?.observe(m), G.push({ element: m, index: a }), !(d.value || k) && (k = ct(ze)));
|
|
368
454
|
}
|
|
369
|
-
function
|
|
370
|
-
const
|
|
371
|
-
t.setScrollOffset(
|
|
455
|
+
function ye(o, a = "auto") {
|
|
456
|
+
const m = D(), w = ve(m), x = w > 0 ? w : t.getViewportSize(), E = t.getTotalSize(), _ = J(o, E, x);
|
|
457
|
+
t.setScrollOffset(_), P(m, _, E, x, a), F();
|
|
372
458
|
}
|
|
373
|
-
function
|
|
374
|
-
const
|
|
375
|
-
|
|
459
|
+
function We(o, a) {
|
|
460
|
+
const m = t.getOffsetForIndex(o, a?.align ?? "auto");
|
|
461
|
+
ye(m, a?.behavior ?? "auto");
|
|
376
462
|
}
|
|
377
|
-
function
|
|
378
|
-
t.measure(
|
|
463
|
+
function Ne(o, a) {
|
|
464
|
+
t.measure(o, a) && F();
|
|
379
465
|
}
|
|
380
|
-
return
|
|
466
|
+
return F(), Ee(
|
|
381
467
|
() => [
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
468
|
+
l(e.count),
|
|
469
|
+
l(e.overscan),
|
|
470
|
+
l(e.gap),
|
|
471
|
+
l(e.paddingStart),
|
|
472
|
+
l(e.paddingEnd),
|
|
473
|
+
l(e.lanes),
|
|
474
|
+
l(e.horizontal),
|
|
475
|
+
l(e.itemSize),
|
|
476
|
+
l(e.viewportInset),
|
|
477
|
+
l(e.revision),
|
|
478
|
+
l(e.container),
|
|
479
|
+
l(e.windowScroll),
|
|
480
|
+
l(e.scrollMargin),
|
|
481
|
+
l(e.reverse),
|
|
482
|
+
l(e.initialRect)?.width,
|
|
483
|
+
l(e.initialRect)?.height
|
|
395
484
|
],
|
|
396
485
|
() => {
|
|
397
|
-
|
|
486
|
+
Be(), F();
|
|
398
487
|
},
|
|
399
488
|
{ flush: "post" }
|
|
400
|
-
),
|
|
401
|
-
|
|
489
|
+
), Ce(() => {
|
|
490
|
+
de(), g?.disconnect(), ut(k), typeof window < "u" && window.clearTimeout(A), T.clear(), M.clear(), G.length = 0;
|
|
402
491
|
}), {
|
|
403
|
-
virtualItems:
|
|
404
|
-
totalSize:
|
|
405
|
-
scrollOffset:
|
|
406
|
-
scrollAdjust:
|
|
407
|
-
isScrolling:
|
|
408
|
-
scrollToIndex:
|
|
409
|
-
scrollToOffset:
|
|
410
|
-
measure:
|
|
411
|
-
measureElement:
|
|
492
|
+
virtualItems: C(() => i.value),
|
|
493
|
+
totalSize: C(() => n.value),
|
|
494
|
+
scrollOffset: C(() => r.value),
|
|
495
|
+
scrollAdjust: C(() => s.value),
|
|
496
|
+
isScrolling: C(() => d.value),
|
|
497
|
+
scrollToIndex: We,
|
|
498
|
+
scrollToOffset: ye,
|
|
499
|
+
measure: Ne,
|
|
500
|
+
measureElement: Ge
|
|
412
501
|
};
|
|
413
502
|
}
|
|
414
|
-
function
|
|
503
|
+
function ft(e, t, i) {
|
|
415
504
|
return typeof e == "function" ? e(t, i) : typeof e == "number" ? e : 48;
|
|
416
505
|
}
|
|
417
|
-
function
|
|
418
|
-
const t =
|
|
419
|
-
count: () =>
|
|
506
|
+
function Ve(e) {
|
|
507
|
+
const t = me({
|
|
508
|
+
count: () => l(e.items).length,
|
|
420
509
|
estimateSize: (n) => {
|
|
421
|
-
const r =
|
|
422
|
-
return
|
|
510
|
+
const r = l(e.items);
|
|
511
|
+
return ft(e.estimateSize, n, r[n]);
|
|
423
512
|
},
|
|
424
513
|
getItemKey: (n) => {
|
|
425
|
-
const s =
|
|
514
|
+
const s = l(e.items)[n];
|
|
426
515
|
return e.getItemKey?.(s, n) ?? n;
|
|
427
516
|
},
|
|
428
|
-
itemSize: () => e.itemSize !== void 0 ?
|
|
517
|
+
itemSize: () => e.itemSize !== void 0 ? l(e.itemSize) : typeof e.estimateSize == "number" ? e.estimateSize : void 0,
|
|
429
518
|
container: e.container,
|
|
430
519
|
horizontal: e.horizontal,
|
|
431
520
|
overscan: e.overscan,
|
|
@@ -434,11 +523,16 @@ function ye(e) {
|
|
|
434
523
|
paddingEnd: e.paddingEnd,
|
|
435
524
|
initialRect: e.initialRect,
|
|
436
525
|
viewportInset: e.viewportInset,
|
|
437
|
-
revision: e.revision
|
|
526
|
+
revision: e.revision,
|
|
527
|
+
windowScroll: e.windowScroll,
|
|
528
|
+
scrollMargin: e.scrollMargin,
|
|
529
|
+
reverse: e.reverse,
|
|
530
|
+
onVisibleRangeChange: e.onVisibleRangeChange,
|
|
531
|
+
onScrollEnd: e.onScrollEnd
|
|
438
532
|
});
|
|
439
533
|
return {
|
|
440
|
-
virtualItems:
|
|
441
|
-
const n =
|
|
534
|
+
virtualItems: C(() => {
|
|
535
|
+
const n = l(e.items);
|
|
442
536
|
return t.virtualItems.value.map((r) => {
|
|
443
537
|
const s = n[r.index];
|
|
444
538
|
return {
|
|
@@ -458,104 +552,110 @@ function ye(e) {
|
|
|
458
552
|
measureElement: t.measureElement
|
|
459
553
|
};
|
|
460
554
|
}
|
|
461
|
-
function
|
|
555
|
+
function Re(e, t, i) {
|
|
462
556
|
return typeof e == "function" ? e(t) : typeof e == "number" ? e : i;
|
|
463
557
|
}
|
|
464
|
-
function
|
|
465
|
-
const t =
|
|
558
|
+
function ht(e) {
|
|
559
|
+
const t = C(() => Math.max(1, Math.floor(l(e.columnCount) || 1))), i = C(() => Math.ceil(l(e.items).length / t.value)), n = /* @__PURE__ */ new Map(), r = me({
|
|
466
560
|
count: () => i.value,
|
|
467
|
-
estimateSize: (f) =>
|
|
561
|
+
estimateSize: (f) => Re(l(e.estimateRowSize), f, 48),
|
|
468
562
|
itemSize: () => {
|
|
469
|
-
const f =
|
|
563
|
+
const f = l(e.estimateRowSize);
|
|
470
564
|
return typeof f == "number" ? f : void 0;
|
|
471
565
|
},
|
|
472
|
-
overscan: () =>
|
|
473
|
-
gap: () =>
|
|
566
|
+
overscan: () => l(e.overscanRows) ?? l(e.overscan) ?? 2,
|
|
567
|
+
gap: () => l(e.rowGap) ?? 0,
|
|
474
568
|
horizontal: !1,
|
|
475
569
|
container: e.container,
|
|
476
570
|
initialRect: e.initialRect,
|
|
477
|
-
revision: e.revision
|
|
478
|
-
|
|
571
|
+
revision: e.revision,
|
|
572
|
+
windowScroll: e.windowScroll,
|
|
573
|
+
scrollMargin: e.scrollMargin,
|
|
574
|
+
onVisibleRangeChange: e.onVisibleRangeChange,
|
|
575
|
+
onScrollEnd: e.onScrollEnd
|
|
576
|
+
}), s = me({
|
|
479
577
|
count: () => t.value,
|
|
480
|
-
estimateSize: (f) =>
|
|
578
|
+
estimateSize: (f) => Re(l(e.estimateColumnSize), f, 160),
|
|
481
579
|
itemSize: () => {
|
|
482
|
-
const f =
|
|
580
|
+
const f = l(e.estimateColumnSize);
|
|
483
581
|
return typeof f == "number" ? f : void 0;
|
|
484
582
|
},
|
|
485
|
-
overscan: () =>
|
|
486
|
-
gap: () =>
|
|
583
|
+
overscan: () => l(e.overscanColumns) ?? l(e.overscan) ?? 1,
|
|
584
|
+
gap: () => l(e.columnGap) ?? 0,
|
|
487
585
|
horizontal: !0,
|
|
488
586
|
container: e.container,
|
|
489
587
|
initialRect: e.initialRect,
|
|
490
|
-
revision: e.revision
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
588
|
+
revision: e.revision,
|
|
589
|
+
windowScroll: e.windowScroll,
|
|
590
|
+
scrollMargin: e.scrollMargin
|
|
591
|
+
}), d = C(() => {
|
|
592
|
+
const f = l(e.items), b = t.value, S = [];
|
|
593
|
+
for (const v of r.virtualItems.value)
|
|
494
594
|
for (const z of s.virtualItems.value) {
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
index:
|
|
500
|
-
key: e.getItemKey?.(
|
|
501
|
-
item:
|
|
502
|
-
row:
|
|
595
|
+
const h = v.index * b + z.index;
|
|
596
|
+
if (h >= f.length) continue;
|
|
597
|
+
const T = f[h];
|
|
598
|
+
S.push({
|
|
599
|
+
index: h,
|
|
600
|
+
key: e.getItemKey?.(T, h) ?? h,
|
|
601
|
+
item: T,
|
|
602
|
+
row: v,
|
|
503
603
|
column: z
|
|
504
604
|
});
|
|
505
605
|
}
|
|
506
|
-
return
|
|
606
|
+
return S;
|
|
507
607
|
});
|
|
508
|
-
function
|
|
509
|
-
const
|
|
510
|
-
if (!
|
|
511
|
-
const
|
|
512
|
-
r.scrollToIndex(Math.floor(
|
|
608
|
+
function I(f, b) {
|
|
609
|
+
const S = l(e.items);
|
|
610
|
+
if (!S.length) return;
|
|
611
|
+
const v = Math.min(Math.max(f, 0), S.length - 1), z = t.value;
|
|
612
|
+
r.scrollToIndex(Math.floor(v / z), b), s.scrollToIndex(v % z, b);
|
|
513
613
|
}
|
|
514
|
-
function
|
|
515
|
-
f.top !== void 0 && r.scrollToOffset(f.top,
|
|
614
|
+
function O(f, b = "auto") {
|
|
615
|
+
f.top !== void 0 && r.scrollToOffset(f.top, b), f.left !== void 0 && s.scrollToOffset(f.left, b);
|
|
516
616
|
}
|
|
517
|
-
function
|
|
518
|
-
const
|
|
519
|
-
|
|
617
|
+
function p(f, b) {
|
|
618
|
+
const S = Math.max(n.get(f) ?? 0, b);
|
|
619
|
+
S <= 0 || S === n.get(f) || (n.set(f, S), r.measure(f, S));
|
|
520
620
|
}
|
|
521
|
-
let
|
|
522
|
-
const
|
|
523
|
-
function
|
|
524
|
-
return !Z() || typeof ResizeObserver > "u" ? null : (
|
|
525
|
-
for (const
|
|
526
|
-
const
|
|
527
|
-
if (
|
|
528
|
-
const z =
|
|
529
|
-
z > 0 &&
|
|
621
|
+
let c = null;
|
|
622
|
+
const g = /* @__PURE__ */ new Map();
|
|
623
|
+
function k() {
|
|
624
|
+
return !Z() || typeof ResizeObserver > "u" ? null : (c || (c = new ResizeObserver((f) => {
|
|
625
|
+
for (const b of f) {
|
|
626
|
+
const S = g.get(b.target);
|
|
627
|
+
if (S === void 0) continue;
|
|
628
|
+
const z = b.borderBoxSize?.[0]?.blockSize ?? b.contentRect.height;
|
|
629
|
+
z > 0 && p(S, z);
|
|
530
630
|
}
|
|
531
|
-
})),
|
|
631
|
+
})), c);
|
|
532
632
|
}
|
|
533
|
-
function
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
|
|
537
|
-
const z =
|
|
538
|
-
z > 0 &&
|
|
633
|
+
function A(f, b) {
|
|
634
|
+
const S = ke(f), v = k();
|
|
635
|
+
if (!S) return;
|
|
636
|
+
g.set(S, b), v?.observe(S);
|
|
637
|
+
const z = S.getBoundingClientRect().height;
|
|
638
|
+
z > 0 && p(b, z);
|
|
539
639
|
}
|
|
540
|
-
return
|
|
541
|
-
|
|
640
|
+
return Ce(() => {
|
|
641
|
+
c?.disconnect(), g.clear();
|
|
542
642
|
}), {
|
|
543
643
|
virtualRows: r.virtualItems,
|
|
544
644
|
virtualColumns: s.virtualItems,
|
|
545
|
-
virtualCells:
|
|
645
|
+
virtualCells: d,
|
|
546
646
|
totalHeight: r.totalSize,
|
|
547
647
|
totalWidth: s.totalSize,
|
|
548
648
|
scrollAdjustX: s.scrollAdjust,
|
|
549
649
|
scrollAdjustY: r.scrollAdjust,
|
|
550
|
-
scrollToIndex:
|
|
551
|
-
scrollToOffset:
|
|
552
|
-
measureRow:
|
|
553
|
-
measureRowElement:
|
|
650
|
+
scrollToIndex: I,
|
|
651
|
+
scrollToOffset: O,
|
|
652
|
+
measureRow: p,
|
|
653
|
+
measureRowElement: A,
|
|
554
654
|
measureColumn: s.measure
|
|
555
655
|
};
|
|
556
656
|
}
|
|
557
|
-
function
|
|
558
|
-
const t =
|
|
657
|
+
function mt(e) {
|
|
658
|
+
const t = Ve({
|
|
559
659
|
items: e.rows,
|
|
560
660
|
estimateSize: e.estimateRowSize,
|
|
561
661
|
container: e.container,
|
|
@@ -564,25 +664,49 @@ function He(e) {
|
|
|
564
664
|
initialRect: e.initialRect,
|
|
565
665
|
viewportInset: e.viewportInset,
|
|
566
666
|
revision: e.revision,
|
|
567
|
-
itemSize: e.itemSize
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
667
|
+
itemSize: e.itemSize,
|
|
668
|
+
windowScroll: e.windowScroll,
|
|
669
|
+
scrollMargin: e.scrollMargin,
|
|
670
|
+
reverse: e.reverse,
|
|
671
|
+
onVisibleRangeChange: e.onVisibleRangeChange,
|
|
672
|
+
onScrollEnd: e.onScrollEnd
|
|
673
|
+
}), i = C(() => {
|
|
674
|
+
const s = l(e.columns);
|
|
675
|
+
let d = 0;
|
|
676
|
+
const I = s.map((c) => {
|
|
677
|
+
const g = c.width ?? c.minWidth ?? 160, k = {
|
|
678
|
+
...c,
|
|
679
|
+
start: d,
|
|
680
|
+
size: g,
|
|
681
|
+
end: d + g,
|
|
682
|
+
pinOffset: 0,
|
|
683
|
+
stickyStyle: {}
|
|
577
684
|
};
|
|
578
|
-
return
|
|
685
|
+
return d += g, k;
|
|
579
686
|
});
|
|
580
|
-
|
|
687
|
+
let O = 0;
|
|
688
|
+
for (const c of I)
|
|
689
|
+
c.pin === "start" && (c.pinOffset = O, c.stickyStyle = {
|
|
690
|
+
position: "sticky",
|
|
691
|
+
left: `${O}px`,
|
|
692
|
+
zIndex: 2
|
|
693
|
+
}, O += c.size);
|
|
694
|
+
let p = 0;
|
|
695
|
+
for (let c = I.length - 1; c >= 0; c -= 1) {
|
|
696
|
+
const g = I[c];
|
|
697
|
+
!g || g.pin !== "end" || (g.pinOffset = p, g.stickyStyle = {
|
|
698
|
+
position: "sticky",
|
|
699
|
+
right: `${p}px`,
|
|
700
|
+
zIndex: 2
|
|
701
|
+
}, p += g.size);
|
|
702
|
+
}
|
|
703
|
+
return I;
|
|
704
|
+
}), n = C(() => {
|
|
581
705
|
const s = i.value;
|
|
582
706
|
return s.length ? s[s.length - 1]?.end ?? 0 : 0;
|
|
583
707
|
});
|
|
584
708
|
return {
|
|
585
|
-
virtualRows:
|
|
709
|
+
virtualRows: C(() => t.virtualItems.value),
|
|
586
710
|
columns: i,
|
|
587
711
|
totalHeight: t.totalSize,
|
|
588
712
|
totalWidth: n,
|
|
@@ -595,11 +719,11 @@ function He(e) {
|
|
|
595
719
|
measureElement: t.measureElement
|
|
596
720
|
};
|
|
597
721
|
}
|
|
598
|
-
function
|
|
722
|
+
function oe(e) {
|
|
599
723
|
if (typeof e == "number" && Number.isFinite(e)) return `${e}px`;
|
|
600
724
|
if (typeof e == "string" && e.trim()) return e;
|
|
601
725
|
}
|
|
602
|
-
function
|
|
726
|
+
function Q(e) {
|
|
603
727
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
604
728
|
if (typeof e != "string") return 0;
|
|
605
729
|
const t = /^(-?\d+(?:\.\d+)?)px$/.exec(e.trim());
|
|
@@ -607,24 +731,29 @@ function W(e) {
|
|
|
607
731
|
const i = Number(t[1]);
|
|
608
732
|
return Number.isFinite(i) ? i : 0;
|
|
609
733
|
}
|
|
610
|
-
function
|
|
611
|
-
return {
|
|
734
|
+
function Se(e) {
|
|
735
|
+
return e.windowScroll ? {
|
|
736
|
+
position: "relative",
|
|
737
|
+
width: oe(e.width) ?? "100%",
|
|
738
|
+
height: oe(e.height),
|
|
739
|
+
overflowAnchor: "none"
|
|
740
|
+
} : {
|
|
612
741
|
overflow: "auto",
|
|
613
742
|
position: "relative",
|
|
614
|
-
height:
|
|
615
|
-
width:
|
|
743
|
+
height: oe(e.height) ?? (e.horizontal ? "100%" : void 0),
|
|
744
|
+
width: oe(e.width) ?? (e.horizontal ? void 0 : "100%"),
|
|
616
745
|
overflowAnchor: "none"
|
|
617
746
|
};
|
|
618
747
|
}
|
|
619
|
-
function
|
|
620
|
-
const i =
|
|
748
|
+
function gt(e, t) {
|
|
749
|
+
const i = H(e);
|
|
621
750
|
return {
|
|
622
751
|
position: "relative",
|
|
623
752
|
width: t ? `${i}px` : "100%",
|
|
624
753
|
height: t ? "100%" : `${i}px`
|
|
625
754
|
};
|
|
626
755
|
}
|
|
627
|
-
function
|
|
756
|
+
function wt(e, t, i) {
|
|
628
757
|
return {
|
|
629
758
|
position: "absolute",
|
|
630
759
|
top: 0,
|
|
@@ -637,7 +766,7 @@ function _e(e, t, i) {
|
|
|
637
766
|
overflow: "hidden"
|
|
638
767
|
};
|
|
639
768
|
}
|
|
640
|
-
const
|
|
769
|
+
const yt = /* @__PURE__ */ ge({
|
|
641
770
|
__name: "VirtualList",
|
|
642
771
|
props: {
|
|
643
772
|
items: {},
|
|
@@ -653,88 +782,98 @@ const Ye = /* @__PURE__ */ ie({
|
|
|
653
782
|
tag: { default: "div" },
|
|
654
783
|
itemTag: { default: "div" },
|
|
655
784
|
itemAttrs: {},
|
|
656
|
-
revision: {}
|
|
785
|
+
revision: {},
|
|
786
|
+
windowScroll: { type: Boolean, default: !1 },
|
|
787
|
+
scrollMargin: { default: 0 },
|
|
788
|
+
reverse: { type: Boolean, default: !1 }
|
|
657
789
|
},
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
790
|
+
emits: ["visibleRangeChange", "scrollEnd"],
|
|
791
|
+
setup(e, { expose: t, emit: i }) {
|
|
792
|
+
const n = e, r = i, s = W(null), { virtualItems: d, totalSize: I, scrollAdjust: O, scrollToIndex: p, scrollToOffset: c, measure: g, measureElement: k } = Ve({
|
|
793
|
+
items: () => n.items,
|
|
794
|
+
estimateSize: (v, z) => {
|
|
795
|
+
const h = n.estimateSize;
|
|
796
|
+
return typeof h == "number" ? h : h(v, z);
|
|
664
797
|
},
|
|
665
|
-
itemSize: () => typeof
|
|
666
|
-
container:
|
|
667
|
-
horizontal: () =>
|
|
668
|
-
overscan: () =>
|
|
669
|
-
gap: () =>
|
|
670
|
-
paddingStart: () =>
|
|
671
|
-
paddingEnd: () =>
|
|
672
|
-
getItemKey: (
|
|
798
|
+
itemSize: () => typeof n.estimateSize == "number" ? n.estimateSize : void 0,
|
|
799
|
+
container: s,
|
|
800
|
+
horizontal: () => n.horizontal,
|
|
801
|
+
overscan: () => n.overscan,
|
|
802
|
+
gap: () => n.gap,
|
|
803
|
+
paddingStart: () => n.paddingStart,
|
|
804
|
+
paddingEnd: () => n.paddingEnd,
|
|
805
|
+
getItemKey: (v, z) => n.getItemKey?.(v, z) ?? z,
|
|
673
806
|
initialRect: () => ({
|
|
674
|
-
width:
|
|
675
|
-
height:
|
|
807
|
+
width: Q(n.width),
|
|
808
|
+
height: Q(n.height)
|
|
676
809
|
}),
|
|
677
|
-
revision: () =>
|
|
678
|
-
|
|
679
|
-
() =>
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
810
|
+
revision: () => n.revision,
|
|
811
|
+
windowScroll: () => n.windowScroll,
|
|
812
|
+
scrollMargin: () => n.scrollMargin,
|
|
813
|
+
reverse: () => n.reverse,
|
|
814
|
+
onVisibleRangeChange: (v) => r("visibleRangeChange", v),
|
|
815
|
+
onScrollEnd: () => r("scrollEnd")
|
|
816
|
+
}), A = C(
|
|
817
|
+
() => Se({
|
|
818
|
+
height: n.height,
|
|
819
|
+
width: n.width,
|
|
820
|
+
horizontal: n.horizontal,
|
|
821
|
+
windowScroll: n.windowScroll
|
|
683
822
|
})
|
|
684
|
-
),
|
|
685
|
-
function
|
|
686
|
-
return
|
|
823
|
+
), f = C(() => gt(I.value, n.horizontal));
|
|
824
|
+
function b(v, z) {
|
|
825
|
+
return wt(v, n.horizontal, z);
|
|
687
826
|
}
|
|
688
|
-
function
|
|
689
|
-
return (
|
|
690
|
-
|
|
827
|
+
function S(v) {
|
|
828
|
+
return (z) => {
|
|
829
|
+
k(z, v);
|
|
691
830
|
};
|
|
692
831
|
}
|
|
693
832
|
return t({
|
|
694
833
|
scrollToIndex: p,
|
|
695
|
-
scrollToOffset:
|
|
696
|
-
measure:
|
|
697
|
-
}), (
|
|
834
|
+
scrollToOffset: c,
|
|
835
|
+
measure: g
|
|
836
|
+
}), (v, z) => (V(), le(ae(e.tag), {
|
|
698
837
|
ref_key: "container",
|
|
699
|
-
ref:
|
|
838
|
+
ref: s,
|
|
700
839
|
"data-virtual-container": "",
|
|
701
840
|
role: "list",
|
|
702
|
-
style:
|
|
841
|
+
style: B(A.value)
|
|
703
842
|
}, {
|
|
704
|
-
default:
|
|
705
|
-
e.items.length ? (
|
|
843
|
+
default: ce(() => [
|
|
844
|
+
e.items.length ? (V(), K("div", {
|
|
706
845
|
key: 1,
|
|
707
846
|
"data-virtual-spacer": "",
|
|
708
|
-
style:
|
|
847
|
+
style: B(f.value)
|
|
709
848
|
}, [
|
|
710
|
-
(
|
|
711
|
-
key:
|
|
849
|
+
(V(!0), K(te, null, ne(j(d), (h) => (V(), le(ae(e.itemTag), we({
|
|
850
|
+
key: h.key,
|
|
712
851
|
ref_for: !0,
|
|
713
|
-
ref:
|
|
852
|
+
ref: S(h.index),
|
|
714
853
|
role: "listitem",
|
|
715
|
-
"data-index":
|
|
716
|
-
"data-key": String(
|
|
854
|
+
"data-index": h.index,
|
|
855
|
+
"data-key": String(h.key),
|
|
717
856
|
"aria-setsize": e.items.length,
|
|
718
|
-
"aria-posinset":
|
|
719
|
-
style:
|
|
857
|
+
"aria-posinset": h.index + 1,
|
|
858
|
+
style: b(h.start - j(O), h.size)
|
|
720
859
|
}, { ref_for: !0 }, e.itemAttrs), {
|
|
721
|
-
default:
|
|
722
|
-
|
|
723
|
-
item:
|
|
724
|
-
index:
|
|
725
|
-
start:
|
|
726
|
-
size:
|
|
727
|
-
end:
|
|
860
|
+
default: ce(() => [
|
|
861
|
+
U(v.$slots, "default", {
|
|
862
|
+
item: h.item,
|
|
863
|
+
index: h.index,
|
|
864
|
+
start: h.start,
|
|
865
|
+
size: h.size,
|
|
866
|
+
end: h.end
|
|
728
867
|
})
|
|
729
868
|
]),
|
|
730
869
|
_: 2
|
|
731
870
|
}, 1040, ["data-index", "data-key", "aria-setsize", "aria-posinset", "style"]))), 128))
|
|
732
|
-
], 4)) :
|
|
871
|
+
], 4)) : U(v.$slots, "empty", {}, void 0, void 0, 0)
|
|
733
872
|
]),
|
|
734
873
|
_: 3
|
|
735
874
|
}, 8, ["style"]));
|
|
736
875
|
}
|
|
737
|
-
}),
|
|
876
|
+
}), St = ["data-index", "data-key"], xt = /* @__PURE__ */ ge({
|
|
738
877
|
__name: "VirtualGrid",
|
|
739
878
|
props: {
|
|
740
879
|
items: {},
|
|
@@ -751,106 +890,114 @@ const Ye = /* @__PURE__ */ ie({
|
|
|
751
890
|
getItemKey: {},
|
|
752
891
|
tag: { default: "div" },
|
|
753
892
|
itemAttrs: {},
|
|
754
|
-
revision: {}
|
|
893
|
+
revision: {},
|
|
894
|
+
windowScroll: { type: Boolean, default: !1 },
|
|
895
|
+
scrollMargin: { default: 0 }
|
|
755
896
|
},
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
897
|
+
emits: ["visibleRangeChange", "scrollEnd"],
|
|
898
|
+
setup(e, { expose: t, emit: i }) {
|
|
899
|
+
const n = e, r = i, s = W(null), {
|
|
900
|
+
virtualCells: d,
|
|
901
|
+
totalWidth: I,
|
|
902
|
+
totalHeight: O,
|
|
761
903
|
scrollAdjustX: p,
|
|
762
|
-
scrollAdjustY:
|
|
763
|
-
scrollToIndex:
|
|
764
|
-
scrollToOffset:
|
|
765
|
-
measureRow:
|
|
766
|
-
measureRowElement:
|
|
767
|
-
} =
|
|
768
|
-
items: () =>
|
|
769
|
-
columnCount: () =>
|
|
770
|
-
estimateRowSize: () =>
|
|
771
|
-
estimateColumnSize: () =>
|
|
772
|
-
container:
|
|
773
|
-
overscan: () =>
|
|
774
|
-
overscanRows: () =>
|
|
775
|
-
overscanColumns: () =>
|
|
776
|
-
rowGap: () =>
|
|
777
|
-
columnGap: () =>
|
|
778
|
-
getItemKey: (
|
|
904
|
+
scrollAdjustY: c,
|
|
905
|
+
scrollToIndex: g,
|
|
906
|
+
scrollToOffset: k,
|
|
907
|
+
measureRow: A,
|
|
908
|
+
measureRowElement: f
|
|
909
|
+
} = ht({
|
|
910
|
+
items: () => n.items,
|
|
911
|
+
columnCount: () => n.columnCount,
|
|
912
|
+
estimateRowSize: () => n.estimateRowSize,
|
|
913
|
+
estimateColumnSize: () => n.estimateColumnSize,
|
|
914
|
+
container: s,
|
|
915
|
+
overscan: () => n.overscan,
|
|
916
|
+
overscanRows: () => n.overscanRows,
|
|
917
|
+
overscanColumns: () => n.overscanColumns,
|
|
918
|
+
rowGap: () => n.rowGap,
|
|
919
|
+
columnGap: () => n.columnGap,
|
|
920
|
+
getItemKey: (h, T) => n.getItemKey?.(h, T) ?? T,
|
|
779
921
|
initialRect: () => ({
|
|
780
|
-
width:
|
|
781
|
-
height:
|
|
922
|
+
width: Q(n.width),
|
|
923
|
+
height: Q(n.height)
|
|
782
924
|
}),
|
|
783
|
-
revision: () =>
|
|
784
|
-
|
|
785
|
-
() =>
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
925
|
+
revision: () => n.revision,
|
|
926
|
+
windowScroll: () => n.windowScroll,
|
|
927
|
+
scrollMargin: () => n.scrollMargin,
|
|
928
|
+
onVisibleRangeChange: (h) => r("visibleRangeChange", h),
|
|
929
|
+
onScrollEnd: () => r("scrollEnd")
|
|
930
|
+
}), b = C(
|
|
931
|
+
() => Se({
|
|
932
|
+
height: n.height,
|
|
933
|
+
width: n.width,
|
|
934
|
+
horizontal: !1,
|
|
935
|
+
windowScroll: n.windowScroll
|
|
789
936
|
})
|
|
790
|
-
),
|
|
937
|
+
), S = C(() => ({
|
|
791
938
|
position: "relative",
|
|
792
|
-
width: `${
|
|
793
|
-
height: `${
|
|
939
|
+
width: `${H(I.value)}px`,
|
|
940
|
+
height: `${H(O.value)}px`
|
|
794
941
|
}));
|
|
795
|
-
function
|
|
796
|
-
return (
|
|
797
|
-
|
|
942
|
+
function v(h) {
|
|
943
|
+
return (T) => {
|
|
944
|
+
f(T, h);
|
|
798
945
|
};
|
|
799
946
|
}
|
|
800
|
-
function h
|
|
947
|
+
function z(h, T, M, G) {
|
|
801
948
|
return {
|
|
802
949
|
position: "absolute",
|
|
803
950
|
top: 0,
|
|
804
951
|
left: 0,
|
|
805
|
-
width: `${
|
|
806
|
-
height: `${
|
|
807
|
-
transform: `translate(${
|
|
952
|
+
width: `${T}px`,
|
|
953
|
+
height: `${G}px`,
|
|
954
|
+
transform: `translate(${h}px, ${M}px)`,
|
|
808
955
|
contain: "layout style",
|
|
809
956
|
boxSizing: "border-box",
|
|
810
957
|
overflow: "hidden"
|
|
811
958
|
};
|
|
812
959
|
}
|
|
813
960
|
return t({
|
|
814
|
-
scrollToIndex:
|
|
815
|
-
scrollToOffset:
|
|
816
|
-
measureRow:
|
|
817
|
-
}), (
|
|
961
|
+
scrollToIndex: g,
|
|
962
|
+
scrollToOffset: k,
|
|
963
|
+
measureRow: A
|
|
964
|
+
}), (h, T) => (V(), le(ae(e.tag), {
|
|
818
965
|
ref_key: "container",
|
|
819
|
-
ref:
|
|
966
|
+
ref: s,
|
|
820
967
|
"data-virtual-container": "",
|
|
821
968
|
role: "grid",
|
|
822
|
-
style:
|
|
969
|
+
style: B(b.value)
|
|
823
970
|
}, {
|
|
824
|
-
default:
|
|
825
|
-
e.items.length ? (
|
|
971
|
+
default: ce(() => [
|
|
972
|
+
e.items.length ? (V(), K("div", {
|
|
826
973
|
key: 1,
|
|
827
974
|
"data-virtual-spacer": "",
|
|
828
|
-
style:
|
|
975
|
+
style: B(S.value)
|
|
829
976
|
}, [
|
|
830
|
-
(
|
|
831
|
-
key:
|
|
977
|
+
(V(!0), K(te, null, ne(j(d), (M) => (V(), K("div", we({
|
|
978
|
+
key: M.key,
|
|
832
979
|
ref_for: !0,
|
|
833
|
-
ref:
|
|
980
|
+
ref: v(M.row.index),
|
|
834
981
|
role: "gridcell",
|
|
835
|
-
"data-index":
|
|
836
|
-
"data-key": String(
|
|
837
|
-
style:
|
|
982
|
+
"data-index": M.index,
|
|
983
|
+
"data-key": String(M.key),
|
|
984
|
+
style: z(M.column.start - j(p), M.column.size, M.row.start - j(c), M.row.size)
|
|
838
985
|
}, { ref_for: !0 }, e.itemAttrs), [
|
|
839
|
-
|
|
840
|
-
item:
|
|
841
|
-
index:
|
|
842
|
-
rowIndex:
|
|
843
|
-
columnIndex:
|
|
844
|
-
row:
|
|
845
|
-
column:
|
|
986
|
+
U(h.$slots, "default", {
|
|
987
|
+
item: M.item,
|
|
988
|
+
index: M.index,
|
|
989
|
+
rowIndex: M.row.index,
|
|
990
|
+
columnIndex: M.column.index,
|
|
991
|
+
row: M.row,
|
|
992
|
+
column: M.column
|
|
846
993
|
})
|
|
847
|
-
], 16,
|
|
848
|
-
], 4)) :
|
|
994
|
+
], 16, St))), 128))
|
|
995
|
+
], 4)) : U(h.$slots, "empty", {}, void 0, void 0, 0)
|
|
849
996
|
]),
|
|
850
997
|
_: 3
|
|
851
998
|
}, 8, ["style"]));
|
|
852
999
|
}
|
|
853
|
-
}),
|
|
1000
|
+
}), vt = ["data-index", "data-key", "aria-rowindex"], pt = /* @__PURE__ */ ge({
|
|
854
1001
|
__name: "VirtualTable",
|
|
855
1002
|
props: {
|
|
856
1003
|
rows: {},
|
|
@@ -863,154 +1010,166 @@ const Ye = /* @__PURE__ */ ie({
|
|
|
863
1010
|
stickyHeader: { type: Boolean, default: !0 },
|
|
864
1011
|
tag: { default: "div" },
|
|
865
1012
|
rowAttrs: {},
|
|
866
|
-
revision: {}
|
|
1013
|
+
revision: {},
|
|
1014
|
+
windowScroll: { type: Boolean, default: !1 },
|
|
1015
|
+
scrollMargin: { default: 0 },
|
|
1016
|
+
reverse: { type: Boolean, default: !1 }
|
|
867
1017
|
},
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1018
|
+
emits: ["visibleRangeChange", "scrollEnd"],
|
|
1019
|
+
setup(e, { expose: t, emit: i }) {
|
|
1020
|
+
const n = e, r = i, s = W(null), d = W(null), I = W(0), {
|
|
1021
|
+
virtualRows: O,
|
|
871
1022
|
columns: p,
|
|
872
|
-
totalWidth:
|
|
873
|
-
totalHeight:
|
|
874
|
-
scrollAdjust:
|
|
875
|
-
scrollToIndex:
|
|
876
|
-
scrollToOffset:
|
|
877
|
-
measure:
|
|
878
|
-
measureElement:
|
|
879
|
-
} =
|
|
880
|
-
rows: () =>
|
|
881
|
-
columns: () =>
|
|
882
|
-
estimateRowSize: (
|
|
883
|
-
const
|
|
884
|
-
return typeof
|
|
1023
|
+
totalWidth: c,
|
|
1024
|
+
totalHeight: g,
|
|
1025
|
+
scrollAdjust: k,
|
|
1026
|
+
scrollToIndex: A,
|
|
1027
|
+
scrollToOffset: f,
|
|
1028
|
+
measure: b,
|
|
1029
|
+
measureElement: S
|
|
1030
|
+
} = mt({
|
|
1031
|
+
rows: () => n.rows,
|
|
1032
|
+
columns: () => n.columns,
|
|
1033
|
+
estimateRowSize: (u, R) => {
|
|
1034
|
+
const y = n.estimateRowSize;
|
|
1035
|
+
return typeof y == "number" ? y : y(u, R);
|
|
885
1036
|
},
|
|
886
|
-
container:
|
|
887
|
-
overscan: () =>
|
|
888
|
-
getRowKey: (
|
|
1037
|
+
container: s,
|
|
1038
|
+
overscan: () => n.overscan,
|
|
1039
|
+
getRowKey: (u, R) => n.getRowKey?.(u, R) ?? R,
|
|
889
1040
|
initialRect: () => ({
|
|
890
|
-
width:
|
|
891
|
-
height:
|
|
1041
|
+
width: Q(n.width),
|
|
1042
|
+
height: Q(n.height)
|
|
892
1043
|
}),
|
|
893
|
-
viewportInset:
|
|
894
|
-
revision: () =>
|
|
895
|
-
itemSize: () => typeof
|
|
1044
|
+
viewportInset: I,
|
|
1045
|
+
revision: () => n.revision,
|
|
1046
|
+
itemSize: () => typeof n.estimateRowSize == "number" ? n.estimateRowSize : void 0,
|
|
1047
|
+
windowScroll: () => n.windowScroll,
|
|
1048
|
+
scrollMargin: () => n.scrollMargin,
|
|
1049
|
+
reverse: () => n.reverse,
|
|
1050
|
+
onVisibleRangeChange: (u) => r("visibleRangeChange", u),
|
|
1051
|
+
onScrollEnd: () => r("scrollEnd")
|
|
896
1052
|
});
|
|
897
|
-
|
|
898
|
-
if (
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
},
|
|
902
|
-
|
|
1053
|
+
Ee(d, (u, R, y) => {
|
|
1054
|
+
if (R === u && !u || !u || !Z() || typeof ResizeObserver > "u") return;
|
|
1055
|
+
const L = () => {
|
|
1056
|
+
I.value = u.getBoundingClientRect().height;
|
|
1057
|
+
}, ee = new ResizeObserver(L);
|
|
1058
|
+
ee.observe(u), L(), y(() => ee.disconnect());
|
|
903
1059
|
});
|
|
904
|
-
const
|
|
905
|
-
() =>
|
|
906
|
-
height:
|
|
907
|
-
width:
|
|
908
|
-
horizontal: !1
|
|
1060
|
+
const v = C(
|
|
1061
|
+
() => Se({
|
|
1062
|
+
height: n.height,
|
|
1063
|
+
width: n.width,
|
|
1064
|
+
horizontal: !1,
|
|
1065
|
+
windowScroll: n.windowScroll
|
|
909
1066
|
})
|
|
910
|
-
),
|
|
911
|
-
minWidth: `${
|
|
912
|
-
})),
|
|
913
|
-
position:
|
|
914
|
-
top:
|
|
915
|
-
zIndex:
|
|
1067
|
+
), z = C(() => ({
|
|
1068
|
+
minWidth: `${c.value}px`
|
|
1069
|
+
})), h = C(() => ({
|
|
1070
|
+
position: n.stickyHeader ? "sticky" : "relative",
|
|
1071
|
+
top: n.stickyHeader ? "0px" : void 0,
|
|
1072
|
+
zIndex: 3,
|
|
916
1073
|
display: "flex",
|
|
917
|
-
width: `${
|
|
918
|
-
})),
|
|
1074
|
+
width: `${c.value}px`
|
|
1075
|
+
})), T = C(() => ({
|
|
919
1076
|
position: "relative",
|
|
920
|
-
height: `${
|
|
921
|
-
width: `${
|
|
1077
|
+
height: `${H(g.value)}px`,
|
|
1078
|
+
width: `${H(c.value)}px`
|
|
922
1079
|
}));
|
|
923
|
-
function
|
|
1080
|
+
function M(u) {
|
|
924
1081
|
return {
|
|
925
|
-
width: `${
|
|
926
|
-
minWidth: `${
|
|
1082
|
+
width: `${u.size}px`,
|
|
1083
|
+
minWidth: `${u.size}px`,
|
|
927
1084
|
flex: "0 0 auto",
|
|
928
|
-
textAlign:
|
|
1085
|
+
textAlign: u.align ?? "left",
|
|
1086
|
+
...u.stickyStyle,
|
|
1087
|
+
zIndex: u.pin ? n.stickyHeader ? 4 : 2 : u.stickyStyle.zIndex
|
|
929
1088
|
};
|
|
930
1089
|
}
|
|
931
|
-
function
|
|
1090
|
+
function G(u, R) {
|
|
932
1091
|
return {
|
|
933
1092
|
position: "absolute",
|
|
934
1093
|
top: 0,
|
|
935
1094
|
left: 0,
|
|
936
1095
|
width: "100%",
|
|
937
|
-
height: `${
|
|
1096
|
+
height: `${R}px`,
|
|
938
1097
|
display: "flex",
|
|
939
|
-
transform: `translateY(${
|
|
1098
|
+
transform: `translateY(${u}px)`,
|
|
940
1099
|
contain: "layout style",
|
|
941
1100
|
boxSizing: "border-box",
|
|
942
1101
|
overflow: "hidden"
|
|
943
1102
|
};
|
|
944
1103
|
}
|
|
945
|
-
function
|
|
946
|
-
return (
|
|
947
|
-
|
|
1104
|
+
function D(u) {
|
|
1105
|
+
return (R) => {
|
|
1106
|
+
S(R, u);
|
|
948
1107
|
};
|
|
949
1108
|
}
|
|
950
|
-
function
|
|
951
|
-
return
|
|
1109
|
+
function $(u, R, y) {
|
|
1110
|
+
return R.accessor ? R.accessor(u, y) : u && typeof u == "object" && R.id in u ? u[R.id] : "";
|
|
952
1111
|
}
|
|
953
1112
|
return t({
|
|
954
|
-
scrollToIndex:
|
|
955
|
-
scrollToOffset:
|
|
956
|
-
measure:
|
|
957
|
-
}), (
|
|
1113
|
+
scrollToIndex: A,
|
|
1114
|
+
scrollToOffset: f,
|
|
1115
|
+
measure: b
|
|
1116
|
+
}), (u, R) => (V(), le(ae(e.tag), {
|
|
958
1117
|
ref_key: "container",
|
|
959
|
-
ref:
|
|
1118
|
+
ref: s,
|
|
960
1119
|
"data-virtual-container": "",
|
|
961
1120
|
role: "table",
|
|
962
|
-
style:
|
|
1121
|
+
style: B(v.value)
|
|
963
1122
|
}, {
|
|
964
|
-
default:
|
|
965
|
-
|
|
966
|
-
style:
|
|
1123
|
+
default: ce(() => [
|
|
1124
|
+
Me("div", {
|
|
1125
|
+
style: B(z.value)
|
|
967
1126
|
}, [
|
|
968
|
-
|
|
1127
|
+
Me("div", {
|
|
969
1128
|
ref_key: "header",
|
|
970
|
-
ref:
|
|
1129
|
+
ref: d,
|
|
971
1130
|
role: "row",
|
|
972
|
-
style:
|
|
1131
|
+
style: B(h.value)
|
|
973
1132
|
}, [
|
|
974
|
-
|
|
975
|
-
(
|
|
976
|
-
key:
|
|
1133
|
+
U(u.$slots, "header", { columns: j(p) }, () => [
|
|
1134
|
+
(V(!0), K(te, null, ne(j(p), (y) => (V(), K("div", {
|
|
1135
|
+
key: y.id,
|
|
977
1136
|
role: "columnheader",
|
|
978
|
-
style:
|
|
979
|
-
},
|
|
1137
|
+
style: B(M(y))
|
|
1138
|
+
}, Oe(y.header), 5))), 128))
|
|
980
1139
|
])
|
|
981
1140
|
], 4),
|
|
982
|
-
e.rows.length ? (
|
|
1141
|
+
e.rows.length ? (V(), K("div", {
|
|
983
1142
|
key: 1,
|
|
984
1143
|
"data-virtual-spacer": "",
|
|
985
1144
|
role: "rowgroup",
|
|
986
|
-
style:
|
|
1145
|
+
style: B(T.value)
|
|
987
1146
|
}, [
|
|
988
|
-
(
|
|
989
|
-
key:
|
|
1147
|
+
(V(!0), K(te, null, ne(j(O), (y) => (V(), K("div", we({
|
|
1148
|
+
key: y.key,
|
|
990
1149
|
ref_for: !0,
|
|
991
|
-
ref:
|
|
1150
|
+
ref: D(y.index),
|
|
992
1151
|
role: "row",
|
|
993
|
-
"data-index":
|
|
994
|
-
"data-key": String(
|
|
995
|
-
"aria-rowindex":
|
|
996
|
-
style:
|
|
1152
|
+
"data-index": y.index,
|
|
1153
|
+
"data-key": String(y.key),
|
|
1154
|
+
"aria-rowindex": y.index + 1,
|
|
1155
|
+
style: G(y.start - j(k), y.size)
|
|
997
1156
|
}, { ref_for: !0 }, e.rowAttrs), [
|
|
998
|
-
(
|
|
999
|
-
key:
|
|
1157
|
+
(V(!0), K(te, null, ne(j(p), (L) => (V(), K("div", {
|
|
1158
|
+
key: L.id,
|
|
1000
1159
|
role: "cell",
|
|
1001
|
-
style:
|
|
1160
|
+
style: B(M(L))
|
|
1002
1161
|
}, [
|
|
1003
|
-
|
|
1004
|
-
row:
|
|
1005
|
-
column:
|
|
1006
|
-
rowIndex:
|
|
1007
|
-
value:
|
|
1162
|
+
U(u.$slots, "cell", {
|
|
1163
|
+
row: y.item,
|
|
1164
|
+
column: L,
|
|
1165
|
+
rowIndex: y.index,
|
|
1166
|
+
value: $(y.item, L, y.index)
|
|
1008
1167
|
}, () => [
|
|
1009
|
-
Oe(
|
|
1168
|
+
Xe(Oe($(y.item, L, y.index)), 1)
|
|
1010
1169
|
])
|
|
1011
1170
|
], 4))), 128))
|
|
1012
|
-
], 16,
|
|
1013
|
-
], 4)) :
|
|
1171
|
+
], 16, vt))), 128))
|
|
1172
|
+
], 4)) : U(u.$slots, "empty", {}, void 0, void 0, 0)
|
|
1014
1173
|
], 4)
|
|
1015
1174
|
]),
|
|
1016
1175
|
_: 3
|
|
@@ -1018,20 +1177,20 @@ const Ye = /* @__PURE__ */ ie({
|
|
|
1018
1177
|
}
|
|
1019
1178
|
});
|
|
1020
1179
|
export {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1180
|
+
Ye as MeasurementCache,
|
|
1181
|
+
xt as VirtualGrid,
|
|
1182
|
+
yt as VirtualList,
|
|
1183
|
+
pt as VirtualTable,
|
|
1184
|
+
tt as Virtualizer,
|
|
1185
|
+
J as clampScrollOffset,
|
|
1186
|
+
Ue as mapDomOffsetToVirtual,
|
|
1187
|
+
Ze as mapVirtualOffsetToDom,
|
|
1188
|
+
he as normalizeSize,
|
|
1189
|
+
et as resolveScrollOffset,
|
|
1190
|
+
H as scrollContentSize,
|
|
1191
|
+
ht as useVirtualGrid,
|
|
1192
|
+
Ve as useVirtualList,
|
|
1193
|
+
mt as useVirtualTable,
|
|
1194
|
+
me as useVirtualizer
|
|
1036
1195
|
};
|
|
1037
1196
|
//# sourceMappingURL=index.mjs.map
|