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