@pdanpdan/virtual-scroll 0.4.0 → 0.6.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 +172 -324
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +836 -376
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1334 -741
- package/dist/index.mjs.map +1 -1
- package/dist/virtual-scroll.css +1 -1
- package/package.json +8 -2
- package/src/components/VirtualScroll.test.ts +1921 -325
- package/src/components/VirtualScroll.vue +829 -386
- package/src/components/VirtualScrollbar.test.ts +174 -0
- package/src/components/VirtualScrollbar.vue +102 -0
- package/src/composables/useVirtualScroll.test.ts +1506 -228
- package/src/composables/useVirtualScroll.ts +869 -517
- package/src/composables/useVirtualScrollbar.test.ts +526 -0
- package/src/composables/useVirtualScrollbar.ts +244 -0
- package/src/index.ts +9 -0
- package/src/types.ts +353 -110
- package/src/utils/fenwick-tree.test.ts +39 -39
- package/src/utils/scroll.test.ts +181 -101
- package/src/utils/scroll.ts +43 -5
- package/src/utils/virtual-scroll-logic.test.ts +673 -323
- package/src/utils/virtual-scroll-logic.ts +759 -430
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, nextTick, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, reactive, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useSlots, watch, withCtx } from "vue";
|
|
1
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, onUnmounted, openBlock, reactive, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRefs, toValue, unref, useId, useSlots, watch, withCtx } from "vue";
|
|
2
|
+
const DEFAULT_ITEM_SIZE = 40, DEFAULT_COLUMN_WIDTH = 100, DEFAULT_BUFFER = 5, EMPTY_SCROLL_DETAILS = {
|
|
3
|
+
items: [],
|
|
4
|
+
currentIndex: 0,
|
|
5
|
+
currentColIndex: 0,
|
|
6
|
+
currentEndIndex: 0,
|
|
7
|
+
currentEndColIndex: 0,
|
|
8
|
+
scrollOffset: {
|
|
9
|
+
x: 0,
|
|
10
|
+
y: 0
|
|
11
|
+
},
|
|
12
|
+
displayScrollOffset: {
|
|
13
|
+
x: 0,
|
|
14
|
+
y: 0
|
|
15
|
+
},
|
|
16
|
+
viewportSize: {
|
|
17
|
+
width: 0,
|
|
18
|
+
height: 0
|
|
19
|
+
},
|
|
20
|
+
displayViewportSize: {
|
|
21
|
+
width: 0,
|
|
22
|
+
height: 0
|
|
23
|
+
},
|
|
24
|
+
totalSize: {
|
|
25
|
+
width: 0,
|
|
26
|
+
height: 0
|
|
27
|
+
},
|
|
28
|
+
isScrolling: !1,
|
|
29
|
+
isProgrammaticScroll: !1,
|
|
30
|
+
range: {
|
|
31
|
+
start: 0,
|
|
32
|
+
end: 0
|
|
33
|
+
},
|
|
34
|
+
columnRange: {
|
|
35
|
+
start: 0,
|
|
36
|
+
end: 0,
|
|
37
|
+
padStart: 0,
|
|
38
|
+
padEnd: 0
|
|
39
|
+
}
|
|
40
|
+
};
|
|
2
41
|
var FenwickTree = class {
|
|
3
42
|
tree;
|
|
4
43
|
values;
|
|
@@ -56,20 +95,24 @@ var FenwickTree = class {
|
|
|
56
95
|
e > 0 ? n.set(this.values.subarray(0, Math.min(t - e, this.values.length)), e) : n.set(this.values.subarray(-e)), this.values = n, this.rebuild();
|
|
57
96
|
}
|
|
58
97
|
};
|
|
98
|
+
const BROWSER_MAX_SIZE = 1e7;
|
|
59
99
|
function isWindow(e) {
|
|
60
|
-
return e === null || typeof window < "u" && e === window;
|
|
100
|
+
return e === null || e === document.documentElement || typeof window < "u" && e === window;
|
|
61
101
|
}
|
|
62
102
|
function isBody(e) {
|
|
63
|
-
return
|
|
103
|
+
return typeof e == "object" && !!e && "tagName" in e && e.tagName === "BODY";
|
|
64
104
|
}
|
|
65
105
|
function isWindowLike(e) {
|
|
66
106
|
return isWindow(e) || isBody(e);
|
|
67
107
|
}
|
|
68
108
|
function isElement(e) {
|
|
69
|
-
return
|
|
109
|
+
return e != null && "getBoundingClientRect" in e;
|
|
70
110
|
}
|
|
71
111
|
function isScrollableElement(e) {
|
|
72
|
-
return
|
|
112
|
+
return e != null && "scrollLeft" in e;
|
|
113
|
+
}
|
|
114
|
+
function scrollTo(e, t) {
|
|
115
|
+
isWindow(e) ? window.scrollTo(t) : e != null && isScrollableElement(e) && (typeof e.scrollTo == "function" ? e.scrollTo(t) : (t.left !== void 0 && (e.scrollLeft = t.left), t.top !== void 0 && (e.scrollTop = t.top)));
|
|
73
116
|
}
|
|
74
117
|
function isScrollToIndexOptions(e) {
|
|
75
118
|
return typeof e == "object" && !!e && ("align" in e || "behavior" in e || "isCorrection" in e);
|
|
@@ -80,653 +123,827 @@ function getPaddingX(e, t) {
|
|
|
80
123
|
function getPaddingY(e, t) {
|
|
81
124
|
return typeof e == "object" && e ? e.y || 0 : (t === "vertical" || t === "both") && e || 0;
|
|
82
125
|
}
|
|
83
|
-
function
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
else if (E === "center") A = n - (c - M) / 2;
|
|
100
|
-
else if (E === "end") A = n - (c - M);
|
|
101
|
-
else if (!(M <= c - e ? n >= g + e - .5 && n + M <= g + c + .5 : n <= g + e + .5 && n + M >= g + c - .5)) {
|
|
102
|
-
let t = n - e, r = n - (c - M);
|
|
103
|
-
M <= c - e ? n < g + e ? (A = t, P = "start") : (A = r, P = "end") : Math.abs(t - g) < Math.abs(r - g) ? (A = t, P = "start") : (A = r, P = "end");
|
|
104
|
-
}
|
|
126
|
+
function calculateGenericRange({ scrollPos: e, containerSize: t, count: n, bufferBefore: r, bufferAfter: i, gap: a, fixedSize: o, findLowerBound: s, query: c }) {
|
|
127
|
+
let l = 0, u = n, d = e + t;
|
|
128
|
+
if (o !== null) {
|
|
129
|
+
let t = o + a;
|
|
130
|
+
l = Math.floor(e / t), u = Math.ceil(d / t);
|
|
131
|
+
} else l = s(e), u = s(d), u < n && c(u) < d && u++;
|
|
132
|
+
return {
|
|
133
|
+
start: Math.max(0, l - r),
|
|
134
|
+
end: Math.min(n, u + i)
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function findNextStickyIndex(e, t) {
|
|
138
|
+
let n = 0, r = e.length - 1, i;
|
|
139
|
+
for (; n <= r;) {
|
|
140
|
+
let a = n + r >>> 1;
|
|
141
|
+
e[a] > t ? (i = e[a], r = a - 1) : n = a + 1;
|
|
105
142
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
t !== void 0 && (e = o === "horizontal" ? p === null ? v(t) - f : p : m === null ? x(t) - f : m);
|
|
115
|
-
}
|
|
116
|
-
let t = 0;
|
|
117
|
-
if (n >= a && a > 0 ? (t = l, j = 0) : o === "horizontal" ? (t = p === null ? b(n) : n * (p + f), j = p === null ? v(n) - f : p) : (t = S(n), j = x(n) - f), T === "start") k = t - e;
|
|
118
|
-
else if (T === "center") k = t - (s - j) / 2;
|
|
119
|
-
else if (T === "end") k = t - (s - j);
|
|
120
|
-
else if (!(j <= s - e ? t >= h + e - .5 && t + j <= h + s + .5 : t <= h + e + .5 && t + j >= h + s - .5)) {
|
|
121
|
-
let n = t - e, r = t - (s - j);
|
|
122
|
-
j <= s - e ? t < h + e ? (k = n, N = "start") : (k = r, N = "end") : Math.abs(n - h) < Math.abs(r - h) ? (k = n, N = "start") : (k = r, N = "end");
|
|
123
|
-
}
|
|
143
|
+
return i;
|
|
144
|
+
}
|
|
145
|
+
function findPrevStickyIndex(e, t) {
|
|
146
|
+
let n = 0, r = e.length - 1, i;
|
|
147
|
+
for (; n <= r;) {
|
|
148
|
+
let a = n + r >>> 1;
|
|
149
|
+
e[a] < t ? (i = e[a], n = a + 1) : r = a - 1;
|
|
124
150
|
}
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
151
|
+
return i;
|
|
152
|
+
}
|
|
153
|
+
function calculateAxisAlignment({ align: e, targetPos: t, itemSize: n, scrollPos: r, viewSize: i, stickyOffsetStart: a, stickyOffsetEnd: o }) {
|
|
154
|
+
let s = t - a, c = t - (i - o - n);
|
|
155
|
+
return e === "start" ? {
|
|
156
|
+
target: s,
|
|
157
|
+
effectiveAlign: "start"
|
|
158
|
+
} : e === "center" ? {
|
|
159
|
+
target: t - a - (i - a - o - n) / 2,
|
|
160
|
+
effectiveAlign: "center"
|
|
161
|
+
} : e === "end" ? {
|
|
162
|
+
target: c,
|
|
163
|
+
effectiveAlign: "end"
|
|
164
|
+
} : isItemVisible(t, n, r, i, a, o) ? {
|
|
165
|
+
target: r,
|
|
166
|
+
effectiveAlign: "auto"
|
|
167
|
+
} : n <= i - a - o ? t < r + a ? {
|
|
168
|
+
target: s,
|
|
169
|
+
effectiveAlign: "start"
|
|
170
|
+
} : {
|
|
171
|
+
target: c,
|
|
172
|
+
effectiveAlign: "end"
|
|
173
|
+
} : Math.abs(s - r) < Math.abs(c - r) ? {
|
|
174
|
+
target: s,
|
|
175
|
+
effectiveAlign: "start"
|
|
176
|
+
} : {
|
|
177
|
+
target: c,
|
|
178
|
+
effectiveAlign: "end"
|
|
132
179
|
};
|
|
133
180
|
}
|
|
134
|
-
function
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
else if (d !== null) _ = Math.floor(n / (d + u)), v = Math.ceil((n + i) / (d + u));
|
|
143
|
-
else {
|
|
144
|
-
_ = p(n);
|
|
145
|
-
let e = n + i;
|
|
146
|
-
v = p(e), v < o && h(v) < e && v++;
|
|
181
|
+
function calculateAxisSize(e, t, n, r) {
|
|
182
|
+
return e <= 0 ? 0 : t === null ? Math.max(0, r(e) - n) : Math.max(0, e * (t + n) - n);
|
|
183
|
+
}
|
|
184
|
+
function calculateAxisTarget({ index: e, align: t, viewSize: n, scrollPos: r, fixedSize: i, gap: a, query: o, getSize: s, stickyIndices: c, stickyStart: l, stickyEnd: u = 0 }) {
|
|
185
|
+
let d = l;
|
|
186
|
+
if (c && c.length > 0) {
|
|
187
|
+
let t = findPrevStickyIndex(c, e);
|
|
188
|
+
t !== void 0 && (d += calculateAxisSize(1, i, 0, () => s(t)));
|
|
147
189
|
}
|
|
190
|
+
let f = i === null ? o(e) : e * (i + a), p = i === null ? s(e) - a : i, { target: m, effectiveAlign: h } = calculateAxisAlignment({
|
|
191
|
+
align: t,
|
|
192
|
+
targetPos: f,
|
|
193
|
+
itemSize: p,
|
|
194
|
+
scrollPos: r,
|
|
195
|
+
viewSize: n,
|
|
196
|
+
stickyOffsetStart: d,
|
|
197
|
+
stickyOffsetEnd: u
|
|
198
|
+
});
|
|
148
199
|
return {
|
|
149
|
-
|
|
150
|
-
|
|
200
|
+
target: m,
|
|
201
|
+
itemSize: p,
|
|
202
|
+
effectiveAlign: h
|
|
151
203
|
};
|
|
152
204
|
}
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
|
|
205
|
+
function calculateAxisSticky(e, t, n, r, i, a) {
|
|
206
|
+
if (e <= t) return {
|
|
207
|
+
isActive: !1,
|
|
208
|
+
offset: 0
|
|
209
|
+
};
|
|
210
|
+
let o = findNextStickyIndex(i, r);
|
|
211
|
+
if (o === void 0) return {
|
|
212
|
+
isActive: !0,
|
|
213
|
+
offset: 0
|
|
214
|
+
};
|
|
215
|
+
let s = a(o);
|
|
216
|
+
return e >= s ? {
|
|
217
|
+
isActive: !1,
|
|
218
|
+
offset: 0
|
|
219
|
+
} : {
|
|
220
|
+
isActive: !0,
|
|
221
|
+
offset: Math.max(0, Math.min(n, s - e)) - n
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function isItemVisible(e, t, n, r, i = 0, a = 0) {
|
|
225
|
+
let o = n + i, s = n + r - a;
|
|
226
|
+
return t <= r - i - a ? e >= o - .5 && e + t <= s + .5 : e <= o + .5 && e + t >= s - .5;
|
|
227
|
+
}
|
|
228
|
+
function displayToVirtual(e, t, n) {
|
|
229
|
+
return (e - t) * n;
|
|
230
|
+
}
|
|
231
|
+
function virtualToDisplay(e, t, n) {
|
|
232
|
+
return e / n + t;
|
|
233
|
+
}
|
|
234
|
+
function calculateScrollTarget({ rowIndex: e, colIndex: t, options: n, direction: r, viewportWidth: i, viewportHeight: a, totalWidth: o, totalHeight: s, gap: c, columnGap: l, fixedSize: u, fixedWidth: d, relativeScrollX: f, relativeScrollY: p, getItemSizeY: m, getItemSizeX: h, getItemQueryY: g, getItemQueryX: _, getColumnSize: v, getColumnQuery: y, scaleX: b, scaleY: x, hostOffsetX: S, hostOffsetY: C, stickyIndices: w, stickyStartX: T = 0, stickyStartY: E = 0, stickyEndX: D = 0, stickyEndY: ee = 0, flowPaddingStartX: O = 0, flowPaddingStartY: k = 0, paddingStartX: A = 0, paddingStartY: j = 0, paddingEndX: M = 0, paddingEndY: N = 0 }) {
|
|
235
|
+
let P;
|
|
236
|
+
P = isScrollToIndexOptions(n) ? n.align : n;
|
|
237
|
+
let F = (P && typeof P == "object" ? P.x : P) || "auto", ne = (P && typeof P == "object" ? P.y : P) || "auto", re = f, ie = p, ae = 0, oe = 0, se = "auto", ce = "auto", L = b === 1 ? o : BROWSER_MAX_SIZE, le = x === 1 ? s : BROWSER_MAX_SIZE, R = Math.max(0, S + L - i), z = Math.max(0, C + le - a), B = (R - S) * b, V = (z - C) * x, de = O + T + A, fe = k + E + j;
|
|
238
|
+
if (e != null) {
|
|
239
|
+
let t = calculateAxisTarget({
|
|
240
|
+
index: e,
|
|
241
|
+
align: ne,
|
|
242
|
+
viewSize: a,
|
|
243
|
+
scrollPos: p,
|
|
244
|
+
fixedSize: u,
|
|
245
|
+
gap: c,
|
|
246
|
+
query: g,
|
|
247
|
+
getSize: m,
|
|
248
|
+
stickyIndices: w,
|
|
249
|
+
stickyStart: E + j,
|
|
250
|
+
stickyEnd: ee + N
|
|
251
|
+
});
|
|
252
|
+
ie = t.target + fe, oe = t.itemSize, ce = t.effectiveAlign;
|
|
253
|
+
}
|
|
254
|
+
if (t != null) {
|
|
255
|
+
let e = r === "both", n = calculateAxisTarget({
|
|
256
|
+
index: t,
|
|
257
|
+
align: F,
|
|
258
|
+
viewSize: i,
|
|
259
|
+
scrollPos: f,
|
|
260
|
+
fixedSize: e ? d : u,
|
|
261
|
+
gap: e || r === "horizontal" ? l : c,
|
|
262
|
+
query: e ? y : _,
|
|
263
|
+
getSize: e ? v : h,
|
|
264
|
+
stickyIndices: w,
|
|
265
|
+
stickyStart: T + A,
|
|
266
|
+
stickyEnd: D + M
|
|
267
|
+
});
|
|
268
|
+
re = n.target + de, ae = n.itemSize, se = n.effectiveAlign;
|
|
269
|
+
}
|
|
270
|
+
return re = Math.max(0, Math.min(re, B)), ie = Math.max(0, Math.min(ie, V)), {
|
|
271
|
+
targetX: re,
|
|
272
|
+
targetY: ie,
|
|
273
|
+
itemWidth: ae,
|
|
274
|
+
itemHeight: oe,
|
|
275
|
+
effectiveAlignX: se,
|
|
276
|
+
effectiveAlignY: ce
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function calculateRange({ direction: e, relativeScrollX: t, relativeScrollY: n, usableWidth: r, usableHeight: i, itemsLength: a, bufferBefore: o, bufferAfter: s, gap: c, columnGap: l, fixedSize: u, findLowerBoundY: d, findLowerBoundX: f, queryY: p, queryX: m }) {
|
|
280
|
+
let h = e === "vertical" || e === "both";
|
|
281
|
+
return calculateGenericRange({
|
|
282
|
+
scrollPos: h ? n : t,
|
|
283
|
+
containerSize: h ? i : r,
|
|
284
|
+
count: a,
|
|
285
|
+
bufferBefore: o,
|
|
286
|
+
bufferAfter: s,
|
|
287
|
+
gap: h ? c : l,
|
|
288
|
+
fixedSize: u,
|
|
289
|
+
findLowerBound: h ? d : f,
|
|
290
|
+
query: h ? p : m
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
function calculateColumnRange({ columnCount: e, relativeScrollX: t, usableWidth: n, colBuffer: r, fixedWidth: i, columnGap: a, findLowerBound: o, query: s, totalColsQuery: c }) {
|
|
294
|
+
if (!e) return {
|
|
156
295
|
start: 0,
|
|
157
296
|
end: 0,
|
|
158
297
|
padStart: 0,
|
|
159
298
|
padEnd: 0
|
|
160
299
|
};
|
|
161
|
-
let
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
300
|
+
let { start: l, end: u } = calculateGenericRange({
|
|
301
|
+
scrollPos: t,
|
|
302
|
+
containerSize: n,
|
|
303
|
+
count: e,
|
|
304
|
+
bufferBefore: r,
|
|
305
|
+
bufferAfter: r,
|
|
306
|
+
gap: a,
|
|
307
|
+
fixedSize: i,
|
|
308
|
+
findLowerBound: o,
|
|
309
|
+
query: s
|
|
310
|
+
}), d = l, f = u, p = i === null ? s(d) : d * (i + a), m = i === null ? Math.max(0, c() - a) : e * (i + a) - a, h = i === null ? s(f) - (f > 0 ? a : 0) : f * (i + a) - (f > 0 ? a : 0);
|
|
170
311
|
return {
|
|
171
|
-
start:
|
|
172
|
-
end:
|
|
173
|
-
padStart:
|
|
174
|
-
padEnd: Math.max(0,
|
|
312
|
+
start: d,
|
|
313
|
+
end: f,
|
|
314
|
+
padStart: p,
|
|
315
|
+
padEnd: Math.max(0, m - h)
|
|
175
316
|
};
|
|
176
317
|
}
|
|
177
|
-
function calculateStickyItem(e) {
|
|
178
|
-
let
|
|
318
|
+
function calculateStickyItem({ index: e, isSticky: t, direction: n, relativeScrollX: r, relativeScrollY: i, originalX: a, originalY: o, width: s, height: c, stickyIndices: l, fixedSize: u, gap: d, columnGap: f, getItemQueryY: p, getItemQueryX: m }) {
|
|
319
|
+
let h = !1, g = !1, _ = {
|
|
179
320
|
x: 0,
|
|
180
321
|
y: 0
|
|
181
322
|
};
|
|
182
|
-
if (!
|
|
183
|
-
|
|
184
|
-
|
|
323
|
+
if (!t) return {
|
|
324
|
+
isStickyActiveX: h,
|
|
325
|
+
isStickyActiveY: g,
|
|
326
|
+
isStickyActive: !1,
|
|
327
|
+
stickyOffset: _
|
|
185
328
|
};
|
|
186
|
-
if (
|
|
187
|
-
let
|
|
188
|
-
|
|
189
|
-
let i = n + r >>> 1;
|
|
190
|
-
u[i] > t ? (e = u[i], r = i - 1) : n = i + 1;
|
|
191
|
-
}
|
|
192
|
-
if (e !== void 0) {
|
|
193
|
-
let t = d === null ? h(e) : e * (d + p);
|
|
194
|
-
a >= t ? _ = !1 : (_ = !0, v.y = Math.max(0, Math.min(l, t - a)) - l);
|
|
195
|
-
} else _ = !0;
|
|
329
|
+
if (n === "vertical" || n === "both") {
|
|
330
|
+
let t = calculateAxisSticky(i, o, c, e, l, (e) => u === null ? p(e) : e * (u + d));
|
|
331
|
+
g = t.isActive, _.y = t.offset;
|
|
196
332
|
}
|
|
197
|
-
if (
|
|
198
|
-
let
|
|
199
|
-
|
|
200
|
-
let r = n + a >>> 1;
|
|
201
|
-
u[r] > t ? (e = u[r], a = r - 1) : n = r + 1;
|
|
202
|
-
}
|
|
203
|
-
if (e !== void 0) {
|
|
204
|
-
let t = r === "horizontal" ? d === null ? g(e) : e * (d + m) : f === null ? g(e) : e * (f + m);
|
|
205
|
-
i >= t ? _ = !1 : (_ = !0, v.x = Math.max(0, Math.min(c, t - i)) - c);
|
|
206
|
-
} else _ = !0;
|
|
333
|
+
if (n === "horizontal") {
|
|
334
|
+
let t = calculateAxisSticky(r, a, s, e, l, (e) => u === null ? m(e) : e * (u + f));
|
|
335
|
+
t.isActive && (h = !0, _.x = t.offset);
|
|
207
336
|
}
|
|
208
337
|
return {
|
|
209
|
-
|
|
210
|
-
|
|
338
|
+
isStickyActiveX: h,
|
|
339
|
+
isStickyActiveY: g,
|
|
340
|
+
isStickyActive: h || g,
|
|
341
|
+
stickyOffset: _
|
|
211
342
|
};
|
|
212
343
|
}
|
|
213
|
-
function calculateItemPosition(e) {
|
|
214
|
-
let
|
|
215
|
-
return
|
|
344
|
+
function calculateItemPosition({ index: e, direction: t, fixedSize: n, gap: r, columnGap: i, usableWidth: a, usableHeight: o, totalWidth: s, queryY: c, queryX: l, getSizeY: u, getSizeX: d, columnRange: f }) {
|
|
345
|
+
let p = 0, m = 0, h = 0, g = 0;
|
|
346
|
+
return t === "horizontal" ? (p = n === null ? l(e) : e * (n + i), h = n === null ? d(e) - i : n, g = o) : t === "both" && f ? (m = n === null ? c(e) : e * (n + r), g = n === null ? u(e) - r : n, p = f.padStart, h = Math.max(0, s - f.padStart - f.padEnd)) : (m = n === null ? c(e) : e * (n + r), g = n === null ? u(e) - r : n, h = t === "both" ? s : a), {
|
|
216
347
|
height: g,
|
|
217
348
|
width: h,
|
|
218
349
|
x: p,
|
|
219
350
|
y: m
|
|
220
351
|
};
|
|
221
352
|
}
|
|
222
|
-
function calculateItemStyle(e) {
|
|
223
|
-
let
|
|
224
|
-
|
|
353
|
+
function calculateItemStyle({ item: e, direction: t, itemSize: n, containerTag: r, paddingStartX: i, paddingStartY: a, isHydrated: o, isRtl: s }) {
|
|
354
|
+
let c = t === "vertical", l = t === "horizontal", u = t === "both", d = n == null || n === 0, f = { blockSize: l ? "100%" : d ? "auto" : `${e.size.height}px` };
|
|
355
|
+
if (c && r === "table" ? f.minInlineSize = "100%" : f.inlineSize = c ? "100%" : d ? "auto" : `${e.size.width}px`, d && (c || (f.minInlineSize = "1px"), l || (f.minBlockSize = "1px")), o) {
|
|
356
|
+
let t = e.isStickyActiveY ?? (e.isStickyActive && (c || u)), n = e.isStickyActiveX ?? (e.isStickyActive && l), r = s ? -(n ? e.stickyOffset.x : e.offset.x) : n ? e.stickyOffset.x : e.offset.x, o = t ? e.stickyOffset.y : e.offset.y;
|
|
357
|
+
e.isStickyActive || e.isStickyActiveX || e.isStickyActiveY ? (f.insetBlockStart = t ? `${a}px` : "auto", f.insetInlineStart = n ? `${i}px` : "auto", f.transform = `translate(${r}px, ${o}px)`) : f.transform = `translate(${r}px, ${e.offset.y}px)`;
|
|
358
|
+
}
|
|
359
|
+
return f;
|
|
225
360
|
}
|
|
226
|
-
function calculateTotalSize(e) {
|
|
227
|
-
let
|
|
228
|
-
return
|
|
229
|
-
width:
|
|
230
|
-
height:
|
|
361
|
+
function calculateTotalSize({ direction: e, itemsLength: t, columnCount: n, fixedSize: r, fixedWidth: i, gap: a, columnGap: o, usableWidth: s, usableHeight: c, queryY: l, queryX: u, queryColumn: d }) {
|
|
362
|
+
let f = e === "both", p = e === "horizontal", m = 0, h = 0;
|
|
363
|
+
return f ? (m = calculateAxisSize(n, i, o, d), h = calculateAxisSize(t, r, a, l)) : p ? (m = calculateAxisSize(t, r, o, u), h = c) : (m = s, h = calculateAxisSize(t, r, a, l)), {
|
|
364
|
+
width: f ? Math.max(m, s) : m,
|
|
365
|
+
height: f ? Math.max(h, c) : h
|
|
231
366
|
};
|
|
232
367
|
}
|
|
233
|
-
const DEFAULT_ITEM_SIZE = 40, DEFAULT_COLUMN_WIDTH = 100, DEFAULT_BUFFER = 5;
|
|
234
368
|
function useVirtualScroll(e) {
|
|
235
|
-
let n =
|
|
369
|
+
let n = computed(() => toValue(e)), r = ref(0), i = ref(0), a = ref(!1), o = ref(!1), c = ref(!1), l = ref(!1), d = ref(!1), f = ref(0), p = ref(0), g = reactive({
|
|
236
370
|
x: 0,
|
|
237
371
|
y: 0
|
|
238
|
-
}),
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
372
|
+
}), y = reactive({
|
|
373
|
+
x: 0,
|
|
374
|
+
y: 0
|
|
375
|
+
}), b, x = ref(!1), S = ref(0), C = ref(0), T = null, E = () => {
|
|
376
|
+
if (typeof window > "u") return;
|
|
377
|
+
let e = n.value.container || n.value.hostRef || window, t = isElement(e) ? e : document.documentElement;
|
|
378
|
+
(!T || !("direction" in T)) && (T = window.getComputedStyle(t));
|
|
379
|
+
let r = T.direction === "rtl";
|
|
380
|
+
d.value !== r && (d.value = r);
|
|
381
|
+
}, D = new FenwickTree(n.value.items?.length || 0), O = new FenwickTree(n.value.items?.length || 0), k = new FenwickTree(n.value.columnCount || 0), A = ref(0), j = new Uint8Array(), M = new Uint8Array(), P = new Uint8Array(), F = ref(null), ce = ref(!1), L = [], R = computed(() => [
|
|
382
|
+
"vertical",
|
|
383
|
+
"horizontal",
|
|
384
|
+
"both"
|
|
385
|
+
].includes(n.value.direction) ? n.value.direction : "vertical"), z = computed(() => n.value.itemSize === void 0 || n.value.itemSize === null || n.value.itemSize === 0), ue = computed(() => n.value.columnWidth === void 0 || n.value.columnWidth === null || n.value.columnWidth === 0), B = computed(() => typeof n.value.itemSize == "number" && n.value.itemSize > 0 ? n.value.itemSize : null), V = computed(() => typeof n.value.columnWidth == "number" && n.value.columnWidth > 0 ? n.value.columnWidth : null), _e = computed(() => n.value.defaultItemSize || B.value || 40), ye = computed(() => [...n.value.stickyIndices || []].sort((e, t) => e - t)), be = computed(() => new Set(ye.value)), xe = computed(() => getPaddingX(n.value.scrollPaddingStart, n.value.direction)), Se = computed(() => getPaddingX(n.value.scrollPaddingEnd, n.value.direction)), Ce = computed(() => getPaddingY(n.value.scrollPaddingStart, n.value.direction)), we = computed(() => getPaddingY(n.value.scrollPaddingEnd, n.value.direction)), U = computed(() => getPaddingX(n.value.stickyStart, n.value.direction)), Te = computed(() => getPaddingX(n.value.stickyEnd, n.value.direction)), W = computed(() => getPaddingY(n.value.stickyStart, n.value.direction)), Ee = computed(() => getPaddingY(n.value.stickyEnd, n.value.direction)), G = computed(() => getPaddingX(n.value.flowPaddingStart, n.value.direction)), K = computed(() => getPaddingX(n.value.flowPaddingEnd, n.value.direction)), q = computed(() => getPaddingY(n.value.flowPaddingStart, n.value.direction)), De = computed(() => getPaddingY(n.value.flowPaddingEnd, n.value.direction)), Oe = computed(() => f.value - (R.value === "vertical" ? 0 : U.value + Te.value)), ke = computed(() => p.value - (R.value === "horizontal" ? 0 : W.value + Ee.value)), Ae = computed(() => {
|
|
386
|
+
if (A.value, !o.value && n.value.ssrRange && !l.value) {
|
|
387
|
+
let { start: e = 0, end: t = 0, colStart: r = 0, colEnd: i = 0 } = n.value.ssrRange, a = n.value.columnCount || 0, o = n.value.gap || 0, s = n.value.columnGap || 0, c = 0, l = 0;
|
|
388
|
+
if (R.value === "both") {
|
|
389
|
+
if (a > 0) {
|
|
390
|
+
let e = i || a, t = k.query(e) - k.query(r);
|
|
391
|
+
c = Math.max(0, t - (e > r ? s : 0));
|
|
256
392
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
queryY: (e) => b.query(e),
|
|
272
|
-
queryX: (e) => y.query(e),
|
|
273
|
-
queryColumn: (e) => x.query(e)
|
|
274
|
-
}).width;
|
|
275
|
-
}), Y = computed(() => {
|
|
276
|
-
if (C.value, !a.value && e.value.ssrRange && !l.value) {
|
|
277
|
-
let { start: t, end: n } = e.value.ssrRange;
|
|
278
|
-
if (e.value.direction === "vertical" || e.value.direction === "both") {
|
|
279
|
-
if (z.value !== null) {
|
|
280
|
-
let r = n - t;
|
|
281
|
-
return Math.max(0, r * (z.value + (e.value.gap || 0)) - (r > 0 && e.value.gap || 0));
|
|
393
|
+
if (B.value !== null) {
|
|
394
|
+
let n = t - e;
|
|
395
|
+
l = Math.max(0, n * (B.value + o) - (n > 0 ? o : 0));
|
|
396
|
+
} else {
|
|
397
|
+
let n = O.query(t) - O.query(e);
|
|
398
|
+
l = Math.max(0, n - (t > e ? o : 0));
|
|
399
|
+
}
|
|
400
|
+
} else if (R.value === "horizontal") {
|
|
401
|
+
if (B.value !== null) {
|
|
402
|
+
let n = t - e;
|
|
403
|
+
c = Math.max(0, n * (B.value + s) - (n > 0 ? s : 0));
|
|
404
|
+
} else {
|
|
405
|
+
let n = D.query(t) - D.query(e);
|
|
406
|
+
c = Math.max(0, n - (t > e ? s : 0));
|
|
282
407
|
}
|
|
283
|
-
|
|
284
|
-
|
|
408
|
+
l = ke.value;
|
|
409
|
+
} else if (c = Oe.value, B.value !== null) {
|
|
410
|
+
let n = t - e;
|
|
411
|
+
l = Math.max(0, n * (B.value + o) - (n > 0 ? o : 0));
|
|
412
|
+
} else {
|
|
413
|
+
let n = O.query(t) - O.query(e);
|
|
414
|
+
l = Math.max(0, n - (t > e ? o : 0));
|
|
285
415
|
}
|
|
416
|
+
return {
|
|
417
|
+
width: Math.max(c, Oe.value),
|
|
418
|
+
height: Math.max(l, ke.value)
|
|
419
|
+
};
|
|
286
420
|
}
|
|
287
421
|
return calculateTotalSize({
|
|
288
|
-
direction:
|
|
289
|
-
itemsLength:
|
|
290
|
-
columnCount:
|
|
291
|
-
fixedSize:
|
|
292
|
-
fixedWidth:
|
|
293
|
-
gap:
|
|
294
|
-
columnGap:
|
|
295
|
-
usableWidth:
|
|
296
|
-
usableHeight:
|
|
297
|
-
queryY: (e) =>
|
|
298
|
-
queryX: (e) =>
|
|
299
|
-
queryColumn: (e) =>
|
|
300
|
-
})
|
|
301
|
-
}),
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}), Z = computed(() => {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
422
|
+
direction: R.value,
|
|
423
|
+
itemsLength: n.value.items.length,
|
|
424
|
+
columnCount: n.value.columnCount || 0,
|
|
425
|
+
fixedSize: B.value,
|
|
426
|
+
fixedWidth: V.value,
|
|
427
|
+
gap: n.value.gap || 0,
|
|
428
|
+
columnGap: n.value.columnGap || 0,
|
|
429
|
+
usableWidth: Oe.value,
|
|
430
|
+
usableHeight: ke.value,
|
|
431
|
+
queryY: (e) => O.query(e),
|
|
432
|
+
queryX: (e) => D.query(e),
|
|
433
|
+
queryColumn: (e) => k.query(e)
|
|
434
|
+
});
|
|
435
|
+
}), je = computed(() => isWindowLike(n.value.container)), Me = computed(() => Ae.value.width + xe.value + Se.value), Ne = computed(() => Ae.value.height + Ce.value + we.value), J = computed(() => G.value + U.value + Te.value + K.value + Me.value), Y = computed(() => q.value + W.value + Ee.value + De.value + Ne.value), X = reactive({
|
|
436
|
+
x: computed(() => Math.max(0, g.x - (G.value + U.value))),
|
|
437
|
+
y: computed(() => Math.max(0, g.y - (q.value + W.value)))
|
|
438
|
+
}), Pe = computed(() => je.value ? J.value : Math.min(J.value, BROWSER_MAX_SIZE)), Fe = computed(() => je.value ? Y.value : Math.min(Y.value, BROWSER_MAX_SIZE)), Ie = computed(() => je.value ? Me.value : Math.max(0, Pe.value - (G.value + U.value + Te.value + K.value))), Le = computed(() => je.value ? Ne.value : Math.max(0, Fe.value - (q.value + W.value + Ee.value + De.value))), Z = computed(() => {
|
|
439
|
+
if (je.value || J.value <= 1e7) return 1;
|
|
440
|
+
let e = J.value - f.value, t = Pe.value - f.value;
|
|
441
|
+
return t > 0 ? e / t : 1;
|
|
442
|
+
}), Q = computed(() => {
|
|
443
|
+
if (je.value || Y.value <= 1e7) return 1;
|
|
444
|
+
let e = Y.value - p.value, t = Fe.value - p.value;
|
|
445
|
+
return t > 0 ? e / t : 1;
|
|
446
|
+
}), Re = computed(() => {
|
|
447
|
+
if (R.value === "vertical") return 0;
|
|
448
|
+
let e = G.value + U.value + xe.value;
|
|
449
|
+
return S.value - e;
|
|
450
|
+
}), ze = computed(() => {
|
|
451
|
+
if (R.value === "horizontal") return 0;
|
|
452
|
+
let e = q.value + W.value + Ce.value;
|
|
453
|
+
return C.value - e;
|
|
454
|
+
}), Be = (e) => {
|
|
455
|
+
A.value;
|
|
456
|
+
let t = n.value.columnGap || 0, r = n.value.columnWidth;
|
|
457
|
+
if (typeof r == "number" && r > 0) return r;
|
|
458
|
+
if (Array.isArray(r) && r.length > 0) {
|
|
459
|
+
let t = r[e % r.length];
|
|
460
|
+
return t != null && t > 0 ? t : n.value.defaultColumnWidth || 100;
|
|
314
461
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
462
|
+
if (typeof r == "function") return r(e);
|
|
463
|
+
let i = k.get(e);
|
|
464
|
+
return i > 0 ? i - t : n.value.defaultColumnWidth || 100;
|
|
465
|
+
}, Ve = (e) => {
|
|
466
|
+
if (A.value, R.value === "horizontal") return ke.value;
|
|
467
|
+
let t = n.value.gap || 0, r = n.value.itemSize;
|
|
468
|
+
if (typeof r == "number" && r > 0) return r;
|
|
469
|
+
if (typeof r == "function") {
|
|
470
|
+
let t = n.value.items[e];
|
|
471
|
+
return t === void 0 ? n.value.defaultItemSize || 40 : r(t, e);
|
|
472
|
+
}
|
|
473
|
+
let i = O.get(e);
|
|
474
|
+
return i > 0 ? i - t : n.value.defaultItemSize || 40;
|
|
475
|
+
};
|
|
476
|
+
function He(e, t, a) {
|
|
477
|
+
let o = typeof a == "object" && a && "isCorrection" in a ? a.isCorrection : !1, s = n.value.container || window, { targetX: c, targetY: l, effectiveAlignX: u, effectiveAlignY: m } = calculateScrollTarget({
|
|
478
|
+
rowIndex: e,
|
|
479
|
+
colIndex: t,
|
|
320
480
|
options: a,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
usableWidth: K.value,
|
|
325
|
-
usableHeight: q.value,
|
|
481
|
+
direction: R.value,
|
|
482
|
+
viewportWidth: f.value,
|
|
483
|
+
viewportHeight: p.value,
|
|
326
484
|
totalWidth: J.value,
|
|
327
485
|
totalHeight: Y.value,
|
|
328
|
-
gap:
|
|
329
|
-
columnGap:
|
|
330
|
-
fixedSize:
|
|
331
|
-
fixedWidth:
|
|
332
|
-
relativeScrollX:
|
|
333
|
-
relativeScrollY:
|
|
334
|
-
getItemSizeY: (e) =>
|
|
335
|
-
getItemSizeX: (e) =>
|
|
336
|
-
getItemQueryY: (e) =>
|
|
337
|
-
getItemQueryX: (e) =>
|
|
338
|
-
getColumnSize: (e) =>
|
|
339
|
-
getColumnQuery: (e) =>
|
|
340
|
-
|
|
486
|
+
gap: n.value.gap || 0,
|
|
487
|
+
columnGap: n.value.columnGap || 0,
|
|
488
|
+
fixedSize: B.value,
|
|
489
|
+
fixedWidth: V.value,
|
|
490
|
+
relativeScrollX: Re.value,
|
|
491
|
+
relativeScrollY: ze.value,
|
|
492
|
+
getItemSizeY: (e) => O.get(e),
|
|
493
|
+
getItemSizeX: (e) => D.get(e),
|
|
494
|
+
getItemQueryY: (e) => O.query(e),
|
|
495
|
+
getItemQueryX: (e) => D.query(e),
|
|
496
|
+
getColumnSize: (e) => k.get(e),
|
|
497
|
+
getColumnQuery: (e) => k.query(e),
|
|
498
|
+
scaleX: Z.value,
|
|
499
|
+
scaleY: Q.value,
|
|
500
|
+
hostOffsetX: X.x,
|
|
501
|
+
hostOffsetY: X.y,
|
|
502
|
+
stickyIndices: ye.value,
|
|
503
|
+
stickyStartX: U.value,
|
|
504
|
+
stickyStartY: W.value,
|
|
505
|
+
stickyEndX: Te.value,
|
|
506
|
+
stickyEndY: Ee.value,
|
|
507
|
+
flowPaddingStartX: G.value,
|
|
508
|
+
flowPaddingStartY: q.value,
|
|
509
|
+
paddingStartX: xe.value,
|
|
510
|
+
paddingStartY: Ce.value,
|
|
511
|
+
paddingEndX: Se.value,
|
|
512
|
+
paddingEndY: we.value
|
|
341
513
|
});
|
|
342
514
|
if (!o) {
|
|
343
|
-
let
|
|
344
|
-
|
|
345
|
-
rowIndex:
|
|
346
|
-
colIndex:
|
|
515
|
+
let n = isScrollToIndexOptions(a) ? a.behavior : void 0;
|
|
516
|
+
F.value = {
|
|
517
|
+
rowIndex: e,
|
|
518
|
+
colIndex: t,
|
|
347
519
|
options: {
|
|
348
520
|
align: {
|
|
349
|
-
x:
|
|
350
|
-
y:
|
|
521
|
+
x: u,
|
|
522
|
+
y: m
|
|
351
523
|
},
|
|
352
|
-
...
|
|
524
|
+
...n == null ? {} : { behavior: n }
|
|
353
525
|
}
|
|
354
526
|
};
|
|
355
527
|
}
|
|
356
|
-
let
|
|
357
|
-
isScrollToIndexOptions(a) && (
|
|
358
|
-
let
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
528
|
+
let h = virtualToDisplay(c, X.x, Z.value), g = virtualToDisplay(l, X.y, Q.value), _ = d.value ? -h : h, v = g, y;
|
|
529
|
+
isScrollToIndexOptions(a) && (y = a.behavior);
|
|
530
|
+
let b = o ? "auto" : y || "smooth";
|
|
531
|
+
x.value = !0;
|
|
532
|
+
let w = { behavior: b };
|
|
533
|
+
if (t != null && (w.left = d.value ? _ : Math.max(0, _)), e != null && (w.top = Math.max(0, v)), scrollTo(s, w), (b === "auto" || b === void 0) && (t != null && (r.value = d.value ? _ : Math.max(0, _), S.value = c), e != null && (i.value = Math.max(0, v), C.value = l), F.value)) {
|
|
534
|
+
let e = F.value.options;
|
|
535
|
+
isScrollToIndexOptions(e) ? e.behavior = "auto" : F.value.options = {
|
|
536
|
+
align: e,
|
|
537
|
+
behavior: "auto"
|
|
538
|
+
};
|
|
367
539
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
let o =
|
|
371
|
-
|
|
372
|
-
let s = e
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
t != null && (e.left = p), i != null && (e.top = m), typeof o.scrollTo == "function" ? o.scrollTo(e) : (e.left !== void 0 && (o.scrollLeft = e.left), e.top !== void 0 && (o.scrollTop = e.top));
|
|
540
|
+
}
|
|
541
|
+
let Ue = (e, t, a) => {
|
|
542
|
+
let o = n.value.container || window;
|
|
543
|
+
x.value = !0, F.value = null;
|
|
544
|
+
let s = e == null ? null : Math.max(0, Math.min(e, J.value - f.value)), c = t == null ? null : Math.max(0, Math.min(t, Y.value - p.value));
|
|
545
|
+
s !== null && (S.value = s), c !== null && (C.value = c);
|
|
546
|
+
let l = typeof window < "u" && o === window ? window.scrollX : o.scrollLeft, u = typeof window < "u" && o === window ? window.scrollY : o.scrollTop, m = s === null ? null : virtualToDisplay(s, X.x, Z.value), h = c === null ? null : virtualToDisplay(c, X.y, Q.value), g = m === null ? l : d.value ? -m : m, _ = h === null ? u : h, v = { behavior: a?.behavior || "auto" };
|
|
547
|
+
e != null && (v.left = g), t != null && (v.top = _), scrollTo(o, v), (a?.behavior === "auto" || a?.behavior === void 0) && (e != null && (r.value = g), t != null && (i.value = _));
|
|
548
|
+
}, We = (e, t) => {
|
|
549
|
+
if (D.resize(e), O.resize(e), k.resize(t), M.length !== e) {
|
|
550
|
+
let t = new Uint8Array(e);
|
|
551
|
+
t.set(M.subarray(0, Math.min(e, M.length))), M = t;
|
|
381
552
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
if (y.resize(n), b.resize(n), x.resize(r), E.length !== n) {
|
|
386
|
-
let e = new Uint8Array(n);
|
|
387
|
-
e.set(E.subarray(0, Math.min(n, E.length))), E = e;
|
|
553
|
+
if (P.length !== e) {
|
|
554
|
+
let t = new Uint8Array(e);
|
|
555
|
+
t.set(P.subarray(0, Math.min(e, P.length))), P = t;
|
|
388
556
|
}
|
|
389
|
-
if (
|
|
390
|
-
let e = new Uint8Array(
|
|
391
|
-
e.set(
|
|
557
|
+
if (j.length !== t) {
|
|
558
|
+
let e = new Uint8Array(t);
|
|
559
|
+
e.set(j.subarray(0, Math.min(t, j.length))), j = e;
|
|
392
560
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
561
|
+
}, $ = () => {
|
|
562
|
+
let e = n.value.items.length, t = n.value.columnCount || 0, r = n.value.gap || 0, i = n.value.columnGap || 0, a = n.value.columnWidth, o = !1, s = !1;
|
|
563
|
+
if (t > 0) for (let e = 0; e < t; e++) {
|
|
564
|
+
let t = k.get(e), r = j[e] === 1;
|
|
565
|
+
if (!ue.value || !r && t === 0) {
|
|
566
|
+
let r = 0;
|
|
567
|
+
r = typeof a == "number" && a > 0 ? a : Array.isArray(a) && a.length > 0 ? a[e % a.length] || n.value.defaultColumnWidth || 100 : typeof a == "function" ? a(e) : n.value.defaultColumnWidth || 100;
|
|
568
|
+
let s = r + i;
|
|
569
|
+
Math.abs(t - s) > .5 ? (k.set(e, s), j[e] = ue.value ? 0 : 1, o = !0) : ue.value || (j[e] = 1);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
for (let t = 0; t < e; t++) {
|
|
573
|
+
let e = n.value.items[t], a = D.get(t), o = O.get(t), c = M[t] === 1, l = P[t] === 1;
|
|
574
|
+
if (R.value === "horizontal") {
|
|
575
|
+
if (!z.value || !c && a === 0) {
|
|
576
|
+
let r = (typeof n.value.itemSize == "function" ? n.value.itemSize(e, t) : _e.value) + i;
|
|
577
|
+
Math.abs(a - r) > .5 ? (D.set(t, r), M[t] = z.value ? 0 : 1, s = !0) : z.value || (M[t] = 1);
|
|
578
|
+
}
|
|
579
|
+
} else a !== 0 && (D.set(t, 0), M[t] = 0, s = !0);
|
|
580
|
+
if (R.value !== "horizontal") {
|
|
581
|
+
if (!z.value || !l && o === 0) {
|
|
582
|
+
let i = (typeof n.value.itemSize == "function" ? n.value.itemSize(e, t) : _e.value) + r;
|
|
583
|
+
Math.abs(o - i) > .5 ? (O.set(t, i), P[t] = z.value ? 0 : 1, s = !0) : z.value || (P[t] = 1);
|
|
584
|
+
}
|
|
585
|
+
} else o !== 0 && (O.set(t, 0), P[t] = 0, s = !0);
|
|
396
586
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
587
|
+
o && k.rebuild(), s && (D.rebuild(), O.rebuild());
|
|
588
|
+
}, Ge = () => {
|
|
589
|
+
let e = n.value.items, t = e.length;
|
|
590
|
+
We(t, n.value.columnCount || 0);
|
|
591
|
+
let r = 0;
|
|
592
|
+
if (n.value.restoreScrollOnPrepend && L.length > 0 && t > L.length) {
|
|
593
|
+
let n = L[0];
|
|
594
|
+
if (n !== void 0) {
|
|
595
|
+
for (let i = 1; i <= t - L.length; i++) if (e[i] === n) {
|
|
596
|
+
r = i;
|
|
403
597
|
break;
|
|
404
598
|
}
|
|
405
599
|
}
|
|
406
600
|
}
|
|
407
|
-
if (
|
|
408
|
-
|
|
409
|
-
let
|
|
410
|
-
|
|
411
|
-
let o =
|
|
412
|
-
for (let
|
|
413
|
-
let r = typeof
|
|
414
|
-
|
|
601
|
+
if (r > 0) {
|
|
602
|
+
D.shift(r), O.shift(r), F.value && F.value.rowIndex !== null && F.value.rowIndex !== void 0 && (F.value.rowIndex += r);
|
|
603
|
+
let i = new Uint8Array(t), a = new Uint8Array(t);
|
|
604
|
+
i.set(M.subarray(0, Math.min(t - r, M.length)), r), a.set(P.subarray(0, Math.min(t - r, P.length)), r), M = i, P = a;
|
|
605
|
+
let o = n.value.gap || 0, s = n.value.columnGap || 0, c = 0, l = 0;
|
|
606
|
+
for (let t = 0; t < r; t++) {
|
|
607
|
+
let r = typeof n.value.itemSize == "function" ? n.value.itemSize(e[t], t) : _e.value;
|
|
608
|
+
R.value === "horizontal" ? c += r + s : l += r + o;
|
|
415
609
|
}
|
|
416
|
-
(
|
|
417
|
-
|
|
610
|
+
(c > 0 || l > 0) && nextTick(() => {
|
|
611
|
+
Ue(c > 0 ? Re.value + c : null, l > 0 ? ze.value + l : null, {
|
|
612
|
+
behavior: "auto",
|
|
613
|
+
isCorrection: !0
|
|
614
|
+
});
|
|
418
615
|
});
|
|
419
616
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
617
|
+
$(), L = [...e], ce.value = !0, A.value++;
|
|
618
|
+
}, Ke = () => {
|
|
619
|
+
if (typeof window > "u") return;
|
|
620
|
+
let e = n.value.container || window, t = (t) => {
|
|
621
|
+
let n = t.getBoundingClientRect();
|
|
622
|
+
if (e === window) return {
|
|
623
|
+
x: d.value ? document.documentElement.clientWidth - n.right - window.scrollX : n.left + window.scrollX,
|
|
624
|
+
y: n.top + window.scrollY
|
|
625
|
+
};
|
|
626
|
+
if (e === t) return {
|
|
627
|
+
x: 0,
|
|
628
|
+
y: 0
|
|
629
|
+
};
|
|
630
|
+
if (isElement(e)) {
|
|
631
|
+
let t = e.getBoundingClientRect();
|
|
632
|
+
return {
|
|
633
|
+
x: d.value ? t.right - n.right - e.scrollLeft : n.left - t.left + e.scrollLeft,
|
|
634
|
+
y: n.top - t.top + e.scrollTop
|
|
635
|
+
};
|
|
430
636
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
Math.abs(r - i) > .5 ? (y.set(t, i), E[t] = R.value ? 0 : 1, s = !0) : R.value || (E[t] = 1);
|
|
440
|
-
}
|
|
441
|
-
} else r !== 0 && (y.set(t, 0), E[t] = 0, s = !0);
|
|
442
|
-
if (c || u) {
|
|
443
|
-
if (!R.value || !f && i === 0) {
|
|
444
|
-
let r = (typeof e.value.itemSize == "function" ? e.value.itemSize(n, t) : V.value) + a;
|
|
445
|
-
Math.abs(i - r) > .5 ? (b.set(t, r), D[t] = R.value ? 0 : 1, s = !0) : R.value || (D[t] = 1);
|
|
446
|
-
}
|
|
447
|
-
} else i !== 0 && (b.set(t, 0), D[t] = 0, s = !0);
|
|
637
|
+
return {
|
|
638
|
+
x: 0,
|
|
639
|
+
y: 0
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
if (n.value.hostElement) {
|
|
643
|
+
let e = t(n.value.hostElement);
|
|
644
|
+
(Math.abs(g.x - e.x) > .1 || Math.abs(g.y - e.y) > .1) && (g.x = e.x, g.y = e.y);
|
|
448
645
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
let t = e.value.hostElement.getBoundingClientRect(), n = e.value.container || window, r = 0, i = 0;
|
|
453
|
-
if (n === window) r = t.left + window.scrollX, i = t.top + window.scrollY;
|
|
454
|
-
else if (n === e.value.hostElement) r = 0, i = 0;
|
|
455
|
-
else if (isElement(n)) {
|
|
456
|
-
let e = n.getBoundingClientRect();
|
|
457
|
-
r = t.left - e.left + n.scrollLeft, i = t.top - e.top + n.scrollTop;
|
|
458
|
-
}
|
|
459
|
-
(Math.abs(g.x - r) > .1 || Math.abs(g.y - i) > .1) && (g.x = r, g.y = i);
|
|
646
|
+
if (n.value.hostRef) {
|
|
647
|
+
let e = t(n.value.hostRef);
|
|
648
|
+
(Math.abs(y.x - e.x) > .1 || Math.abs(y.y - e.y) > .1) && (y.x = e.x, y.y = e.y);
|
|
460
649
|
}
|
|
461
650
|
};
|
|
462
651
|
watch([
|
|
463
|
-
() =>
|
|
464
|
-
() =>
|
|
465
|
-
() =>
|
|
466
|
-
() =>
|
|
467
|
-
() =>
|
|
468
|
-
() =>
|
|
469
|
-
() =>
|
|
470
|
-
() =>
|
|
471
|
-
() =>
|
|
472
|
-
() =>
|
|
473
|
-
],
|
|
474
|
-
|
|
652
|
+
() => n.value.items,
|
|
653
|
+
() => n.value.items.length,
|
|
654
|
+
() => n.value.direction,
|
|
655
|
+
() => n.value.columnCount,
|
|
656
|
+
() => n.value.columnWidth,
|
|
657
|
+
() => n.value.itemSize,
|
|
658
|
+
() => n.value.gap,
|
|
659
|
+
() => n.value.columnGap,
|
|
660
|
+
() => n.value.defaultItemSize,
|
|
661
|
+
() => n.value.defaultColumnWidth
|
|
662
|
+
], Ge, { immediate: !0 }), watch(() => [n.value.container, n.value.hostElement], () => {
|
|
663
|
+
Ke();
|
|
664
|
+
}), watch(d, (e, t) => {
|
|
665
|
+
if (t === void 0 || e === t || !l.value) return;
|
|
666
|
+
if (R.value === "vertical") {
|
|
667
|
+
Ke();
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
let n = displayToVirtual(t ? Math.abs(r.value) : r.value, g.x, Z.value);
|
|
671
|
+
Ke(), Ue(n, null, { behavior: "auto" });
|
|
672
|
+
}, { flush: "sync" }), watch([Z, Q], () => {
|
|
673
|
+
!l.value || a.value || x.value || Ue(S.value, C.value, { behavior: "auto" });
|
|
674
|
+
}), watch([() => n.value.items.length, () => n.value.columnCount], ([e, t], [n, r]) => {
|
|
675
|
+
nextTick(() => {
|
|
676
|
+
let i = Math.max(0, J.value - f.value), a = Math.max(0, Y.value - p.value);
|
|
677
|
+
S.value > i || C.value > a ? Ue(Math.min(S.value, i), Math.min(C.value, a), { behavior: "auto" }) : (e !== n && Q.value !== 1 || t !== r && Z.value !== 1) && Ue(S.value, C.value, { behavior: "auto" }), Ke();
|
|
678
|
+
});
|
|
475
679
|
});
|
|
476
|
-
let
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
680
|
+
let qe = (e) => {
|
|
681
|
+
let t = n.value.gap || 0, r = n.value.columnGap || 0, i = B.value;
|
|
682
|
+
if (R.value === "horizontal") {
|
|
683
|
+
let t = (i || 0) + r;
|
|
684
|
+
return i !== null && t > 0 ? Math.floor(e / t) : D.findLowerBound(e);
|
|
685
|
+
}
|
|
686
|
+
let a = (i || 0) + t;
|
|
687
|
+
return i !== null && a > 0 ? Math.floor(e / a) : O.findLowerBound(e);
|
|
688
|
+
}, Je = (e) => R.value === "both" ? k.findLowerBound(e) : R.value === "horizontal" ? qe(e) : 0, Ye = computed(() => {
|
|
689
|
+
if (A.value, (!o.value || c.value) && n.value.ssrRange) return {
|
|
690
|
+
start: n.value.ssrRange.start,
|
|
691
|
+
end: n.value.ssrRange.end
|
|
480
692
|
};
|
|
481
|
-
let
|
|
693
|
+
let e = n.value.ssrRange && !a.value ? 0 : n.value.bufferBefore ?? 5, t = n.value.bufferAfter ?? 5;
|
|
482
694
|
return calculateRange({
|
|
483
|
-
direction:
|
|
484
|
-
relativeScrollX:
|
|
485
|
-
relativeScrollY:
|
|
486
|
-
usableWidth:
|
|
487
|
-
usableHeight:
|
|
488
|
-
itemsLength:
|
|
489
|
-
bufferBefore:
|
|
490
|
-
bufferAfter:
|
|
491
|
-
gap:
|
|
492
|
-
columnGap:
|
|
493
|
-
fixedSize:
|
|
494
|
-
findLowerBoundY: (e) =>
|
|
495
|
-
findLowerBoundX: (e) =>
|
|
496
|
-
queryY: (e) =>
|
|
497
|
-
queryX: (e) =>
|
|
695
|
+
direction: R.value,
|
|
696
|
+
relativeScrollX: Re.value,
|
|
697
|
+
relativeScrollY: ze.value,
|
|
698
|
+
usableWidth: Oe.value,
|
|
699
|
+
usableHeight: ke.value,
|
|
700
|
+
itemsLength: n.value.items.length,
|
|
701
|
+
bufferBefore: e,
|
|
702
|
+
bufferAfter: t,
|
|
703
|
+
gap: n.value.gap || 0,
|
|
704
|
+
columnGap: n.value.columnGap || 0,
|
|
705
|
+
fixedSize: B.value,
|
|
706
|
+
findLowerBoundY: (e) => O.findLowerBound(e),
|
|
707
|
+
findLowerBoundX: (e) => D.findLowerBound(e),
|
|
708
|
+
queryY: (e) => O.query(e),
|
|
709
|
+
queryX: (e) => D.query(e)
|
|
498
710
|
});
|
|
499
|
-
}),
|
|
500
|
-
|
|
501
|
-
let
|
|
502
|
-
return
|
|
503
|
-
}),
|
|
504
|
-
|
|
505
|
-
let
|
|
506
|
-
|
|
507
|
-
if (a.value || !e.value.ssrRange) {
|
|
508
|
-
let e = fe.value, r, i = 0, a = c.length - 1;
|
|
509
|
-
for (; i <= a;) {
|
|
510
|
-
let t = i + a >>> 1;
|
|
511
|
-
c[t] < e ? (r = c[t], i = t + 1) : a = t - 1;
|
|
512
|
-
}
|
|
513
|
-
r !== void 0 && u.add(r);
|
|
514
|
-
let o = 0, s = c.length - 1, l = -1;
|
|
515
|
-
for (; o <= s;) {
|
|
516
|
-
let e = o + s >>> 1;
|
|
517
|
-
c[e] >= t ? (l = e, s = e - 1) : o = e + 1;
|
|
518
|
-
}
|
|
519
|
-
if (l !== -1) for (let e = l; e < c.length; e++) {
|
|
520
|
-
let t = c[e];
|
|
521
|
-
if (t >= n) break;
|
|
522
|
-
u.add(t);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
let d = Array.from(u).sort((e, t) => e - t), f = e.value.ssrRange?.start || 0, p = e.value.ssrRange?.colStart || 0, m = 0, h = 0;
|
|
526
|
-
!a.value && e.value.ssrRange && (h = e.value.direction === "vertical" || e.value.direction === "both" ? i === null ? b.query(f) : f * (i + o) : 0, e.value.direction === "horizontal" ? m = i === null ? y.query(p) : p * (i + s) : e.value.direction === "both" && (m = x.query(p)));
|
|
527
|
-
let g = new Map($.map((e) => [e.index, e]));
|
|
528
|
-
for (let t of d) {
|
|
529
|
-
let n = e.value.items[t];
|
|
530
|
-
if (n === void 0) continue;
|
|
531
|
-
let { x: i, y: a, width: o, height: s } = calculateItemPosition({
|
|
532
|
-
index: t,
|
|
533
|
-
direction: e.value.direction || "vertical",
|
|
534
|
-
fixedSize: z.value,
|
|
535
|
-
gap: e.value.gap || 0,
|
|
536
|
-
columnGap: e.value.columnGap || 0,
|
|
537
|
-
usableWidth: K.value,
|
|
538
|
-
usableHeight: q.value,
|
|
539
|
-
totalWidth: J.value,
|
|
540
|
-
queryY: (e) => b.query(e),
|
|
541
|
-
queryX: (e) => y.query(e),
|
|
542
|
-
getSizeY: (e) => b.get(e),
|
|
543
|
-
getSizeX: (e) => y.get(e)
|
|
544
|
-
}), u = l.has(t), d = i, f = a, { isStickyActive: p, stickyOffset: _ } = calculateStickyItem({
|
|
545
|
-
index: t,
|
|
546
|
-
isSticky: u,
|
|
547
|
-
direction: e.value.direction || "vertical",
|
|
548
|
-
relativeScrollX: X.value,
|
|
549
|
-
relativeScrollY: Z.value,
|
|
550
|
-
originalX: d,
|
|
551
|
-
originalY: f,
|
|
552
|
-
width: o,
|
|
553
|
-
height: s,
|
|
554
|
-
stickyIndices: c,
|
|
555
|
-
fixedSize: z.value,
|
|
556
|
-
fixedWidth: B.value,
|
|
557
|
-
gap: e.value.gap || 0,
|
|
558
|
-
columnGap: e.value.columnGap || 0,
|
|
559
|
-
getItemQueryY: (e) => b.query(e),
|
|
560
|
-
getItemQueryX: (e) => y.query(e)
|
|
561
|
-
}), v = d - m, x = f - h, S = g.get(t);
|
|
562
|
-
S && S.item === n && S.offset.x === v && S.offset.y === x && S.size.width === o && S.size.height === s && S.isSticky === u && S.isStickyActive === p && S.stickyOffset.x === _.x && S.stickyOffset.y === _.y ? r.push(S) : r.push({
|
|
563
|
-
item: n,
|
|
564
|
-
index: t,
|
|
565
|
-
offset: {
|
|
566
|
-
x: v,
|
|
567
|
-
y: x
|
|
568
|
-
},
|
|
569
|
-
size: {
|
|
570
|
-
width: o,
|
|
571
|
-
height: s
|
|
572
|
-
},
|
|
573
|
-
originalX: d,
|
|
574
|
-
originalY: f,
|
|
575
|
-
isSticky: u,
|
|
576
|
-
isStickyActive: p,
|
|
577
|
-
stickyOffset: _
|
|
578
|
-
});
|
|
579
|
-
}
|
|
580
|
-
return $ = r, r;
|
|
581
|
-
}), me = computed(() => {
|
|
582
|
-
C.value;
|
|
583
|
-
let t = e.value.columnCount || 0;
|
|
584
|
-
if (!t) return {
|
|
711
|
+
}), Xe = computed(() => {
|
|
712
|
+
A.value;
|
|
713
|
+
let e = Re.value + U.value, t = ze.value + W.value;
|
|
714
|
+
return qe(R.value === "horizontal" ? e : t);
|
|
715
|
+
}), Ze = computed(() => {
|
|
716
|
+
A.value;
|
|
717
|
+
let e = n.value.columnCount || 0;
|
|
718
|
+
if (!e) return {
|
|
585
719
|
start: 0,
|
|
586
720
|
end: 0,
|
|
587
721
|
padStart: 0,
|
|
588
722
|
padEnd: 0
|
|
589
723
|
};
|
|
590
|
-
if ((!
|
|
591
|
-
let { colStart:
|
|
724
|
+
if ((!o.value || c.value) && n.value.ssrRange) {
|
|
725
|
+
let { colStart: t = 0, colEnd: r = 0 } = n.value.ssrRange, i = Math.max(0, t), a = Math.min(e, r || e), o = n.value.columnGap || 0, s = V.value === null ? k.query(i) : i * (V.value + o), c = V.value === null ? Math.max(0, k.query(e) - o) : e * (V.value + o) - o, l = V.value === null ? k.query(a) - (a > 0 ? o : 0) : a * (V.value + o) - (a > 0 ? o : 0);
|
|
592
726
|
return {
|
|
593
|
-
start:
|
|
594
|
-
end:
|
|
595
|
-
padStart:
|
|
596
|
-
padEnd: 0
|
|
727
|
+
start: i,
|
|
728
|
+
end: a,
|
|
729
|
+
padStart: s,
|
|
730
|
+
padEnd: Math.max(0, c - l)
|
|
597
731
|
};
|
|
598
732
|
}
|
|
599
|
-
let
|
|
733
|
+
let t = n.value.ssrRange && !a.value ? 0 : 2;
|
|
600
734
|
return calculateColumnRange({
|
|
601
|
-
columnCount:
|
|
602
|
-
relativeScrollX:
|
|
603
|
-
usableWidth:
|
|
604
|
-
colBuffer:
|
|
605
|
-
fixedWidth:
|
|
606
|
-
columnGap:
|
|
607
|
-
findLowerBound: (e) =>
|
|
608
|
-
query: (e) =>
|
|
609
|
-
totalColsQuery: () =>
|
|
735
|
+
columnCount: e,
|
|
736
|
+
relativeScrollX: Re.value,
|
|
737
|
+
usableWidth: Oe.value,
|
|
738
|
+
colBuffer: t,
|
|
739
|
+
fixedWidth: V.value,
|
|
740
|
+
columnGap: n.value.columnGap || 0,
|
|
741
|
+
findLowerBound: (e) => k.findLowerBound(e),
|
|
742
|
+
query: (e) => k.query(e),
|
|
743
|
+
totalColsQuery: () => k.query(e)
|
|
610
744
|
});
|
|
611
|
-
}),
|
|
612
|
-
|
|
613
|
-
let t =
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
745
|
+
}), Qe = [], $e = computed(() => {
|
|
746
|
+
A.value;
|
|
747
|
+
let { start: e, end: t } = Ye.value, r = [], i = B.value, a = n.value.gap || 0, s = n.value.columnGap || 0, c = ye.value, l = be.value, u = [];
|
|
748
|
+
if (o.value || !n.value.ssrRange) {
|
|
749
|
+
let t = Xe.value, n = findPrevStickyIndex(c, t);
|
|
750
|
+
n !== void 0 && n < e && u.push(n);
|
|
751
|
+
}
|
|
752
|
+
for (let n = e; n < t; n++) u.push(n);
|
|
753
|
+
let d = n.value.ssrRange?.start || 0, f = n.value.ssrRange?.colStart || 0, p = 0, m = 0;
|
|
754
|
+
!o.value && n.value.ssrRange && (m = R.value === "horizontal" ? 0 : i === null ? O.query(d) : d * (i + a), R.value === "horizontal" ? p = i === null ? D.query(f) : f * (i + s) : R.value === "both" && (p = k.query(f)));
|
|
755
|
+
let h = new Map(Qe.map((e) => [e.index, e])), g = -1, _ = 0, v = -1, y = 0, b = (e) => e === g + 1 ? (_ += D.get(g), g = e, _) : (_ = D.query(e), g = e, _), x = (e) => e === v + 1 ? (y += O.get(v), v = e, y) : (y = O.query(e), v = e, y), w = G.value + U.value + xe.value, T = q.value + W.value + Ce.value, E = G.value + U.value, ee = q.value + W.value, j = Ze.value;
|
|
756
|
+
for (let e of u) {
|
|
757
|
+
let t = n.value.items[e];
|
|
758
|
+
if (t === void 0) continue;
|
|
759
|
+
let { x: i, y: a, width: s, height: u } = calculateItemPosition({
|
|
760
|
+
index: e,
|
|
761
|
+
direction: R.value,
|
|
762
|
+
fixedSize: B.value,
|
|
763
|
+
gap: n.value.gap || 0,
|
|
764
|
+
columnGap: n.value.columnGap || 0,
|
|
765
|
+
usableWidth: Oe.value,
|
|
766
|
+
usableHeight: ke.value,
|
|
767
|
+
totalWidth: Ae.value.width,
|
|
768
|
+
queryY: x,
|
|
769
|
+
queryX: b,
|
|
770
|
+
getSizeY: (e) => O.get(e),
|
|
771
|
+
getSizeX: (e) => D.get(e),
|
|
772
|
+
columnRange: j
|
|
773
|
+
}), d = l.has(e), f = i, g = a, { isStickyActive: _, isStickyActiveX: v, isStickyActiveY: y, stickyOffset: k } = calculateStickyItem({
|
|
774
|
+
index: e,
|
|
775
|
+
isSticky: d,
|
|
776
|
+
direction: R.value,
|
|
777
|
+
relativeScrollX: Re.value,
|
|
778
|
+
relativeScrollY: ze.value,
|
|
779
|
+
originalX: f,
|
|
780
|
+
originalY: g,
|
|
781
|
+
width: s,
|
|
782
|
+
height: u,
|
|
783
|
+
stickyIndices: c,
|
|
784
|
+
fixedSize: B.value,
|
|
785
|
+
fixedWidth: V.value,
|
|
786
|
+
gap: n.value.gap || 0,
|
|
787
|
+
columnGap: n.value.columnGap || 0,
|
|
788
|
+
getItemQueryY: x,
|
|
789
|
+
getItemQueryX: b
|
|
790
|
+
}), A = o.value ? S.value / Z.value + (i + w - S.value) - E : i - p, M = o.value ? C.value / Q.value + (a + T - C.value) - ee : a - m, N = h.get(e);
|
|
791
|
+
N && N.item === t && N.offset.x === A && N.offset.y === M && N.size.width === s && N.size.height === u && N.isSticky === d && N.isStickyActive === _ && N.isStickyActiveX === v && N.isStickyActiveY === y && N.stickyOffset.x === k.x && N.stickyOffset.y === k.y ? r.push(N) : r.push({
|
|
792
|
+
item: t,
|
|
793
|
+
index: e,
|
|
794
|
+
offset: {
|
|
795
|
+
x: A,
|
|
796
|
+
y: M
|
|
797
|
+
},
|
|
798
|
+
size: {
|
|
799
|
+
width: s,
|
|
800
|
+
height: u
|
|
801
|
+
},
|
|
802
|
+
originalX: f,
|
|
803
|
+
originalY: g,
|
|
804
|
+
isSticky: d,
|
|
805
|
+
isStickyActive: _,
|
|
806
|
+
isStickyActiveX: v,
|
|
807
|
+
isStickyActiveY: y,
|
|
808
|
+
stickyOffset: k
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
return Qe = r, r;
|
|
812
|
+
}), et = computed(() => {
|
|
813
|
+
A.value;
|
|
814
|
+
let e = Re.value + U.value, t = ze.value + W.value, n = Re.value + (f.value - Te.value) - 1, o = ze.value + (p.value - Ee.value) - 1, s = Je(e), c = qe(t), l = qe(R.value === "horizontal" ? n : o), u = Je(n);
|
|
815
|
+
return {
|
|
816
|
+
items: $e.value,
|
|
817
|
+
currentIndex: c,
|
|
818
|
+
currentColIndex: s,
|
|
819
|
+
currentEndIndex: l,
|
|
820
|
+
currentEndColIndex: u,
|
|
618
821
|
scrollOffset: {
|
|
619
|
-
x:
|
|
620
|
-
y:
|
|
822
|
+
x: S.value,
|
|
823
|
+
y: C.value
|
|
824
|
+
},
|
|
825
|
+
displayScrollOffset: {
|
|
826
|
+
x: d.value ? Math.abs(r.value + y.x) : Math.max(0, r.value - y.x),
|
|
827
|
+
y: Math.max(0, i.value - y.y)
|
|
621
828
|
},
|
|
622
829
|
viewportSize: {
|
|
623
|
-
width:
|
|
830
|
+
width: f.value,
|
|
831
|
+
height: p.value
|
|
832
|
+
},
|
|
833
|
+
displayViewportSize: {
|
|
834
|
+
width: f.value,
|
|
624
835
|
height: p.value
|
|
625
836
|
},
|
|
626
837
|
totalSize: {
|
|
627
838
|
width: J.value,
|
|
628
839
|
height: Y.value
|
|
629
840
|
},
|
|
630
|
-
isScrolling:
|
|
631
|
-
isProgrammaticScroll:
|
|
632
|
-
range:
|
|
633
|
-
columnRange:
|
|
841
|
+
isScrolling: a.value,
|
|
842
|
+
isProgrammaticScroll: x.value,
|
|
843
|
+
range: Ye.value,
|
|
844
|
+
columnRange: Ze.value
|
|
634
845
|
};
|
|
635
|
-
}),
|
|
636
|
-
|
|
637
|
-
},
|
|
846
|
+
}), tt = () => {
|
|
847
|
+
x.value = !1, F.value = null;
|
|
848
|
+
}, nt = (e) => {
|
|
638
849
|
let t = e.target;
|
|
639
|
-
typeof window > "u" || (t === window || t === document ? (
|
|
640
|
-
|
|
850
|
+
typeof window > "u" || (E(), t === window || t === document ? (r.value = window.scrollX, i.value = window.scrollY, f.value = document.documentElement.clientWidth, p.value = document.documentElement.clientHeight) : isScrollableElement(t) && (r.value = t.scrollLeft, i.value = t.scrollTop, f.value = t.clientWidth, p.value = t.clientHeight), S.value = displayToVirtual(d.value ? Math.abs(r.value) : r.value, X.x, Z.value), C.value = displayToVirtual(i.value, X.y, Q.value), a.value ||= (x.value || (F.value = null), !0), clearTimeout(b), b = setTimeout(() => {
|
|
851
|
+
a.value = !1, x.value = !1;
|
|
641
852
|
}, 250));
|
|
642
|
-
},
|
|
643
|
-
let
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
853
|
+
}, rt = (e) => {
|
|
854
|
+
let t = !1, r = 0, i = 0, a = n.value.gap || 0, o = n.value.columnGap || 0, s = Re.value, c = ze.value, l = qe(R.value === "horizontal" ? s : c), u = Je(s), d = R.value === "horizontal", f = R.value === "both", p = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), h = (e, i) => {
|
|
855
|
+
if (e >= 0 && e < (n.value.columnCount || 0) && !m.has(e)) {
|
|
856
|
+
m.add(e);
|
|
857
|
+
let n = k.get(e), a = i + o;
|
|
858
|
+
if (!j[e] || Math.abs(n - a) > .1) {
|
|
859
|
+
let i = a - n;
|
|
860
|
+
Math.abs(i) > .1 && (k.update(e, i), t = !0, e < u && (r += i)), j[e] = 1;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
for (let { index: s, inlineSize: c, blockSize: u, element: m } of e) {
|
|
865
|
+
if (c <= 0 && u <= 0) continue;
|
|
866
|
+
let e = z.value || typeof n.value.itemSize == "function";
|
|
867
|
+
if (s >= 0 && !p.has(s) && e && u > 0) {
|
|
868
|
+
if (p.add(s), d && c > 0) {
|
|
869
|
+
let e = D.get(s), n = c + o;
|
|
870
|
+
if (!M[s] || Math.abs(n - e) > .1) {
|
|
871
|
+
let i = n - e;
|
|
872
|
+
D.update(s, i), M[s] = 1, t = !0, s < l && (r += i);
|
|
653
873
|
}
|
|
654
874
|
}
|
|
655
|
-
if (
|
|
656
|
-
let e =
|
|
657
|
-
if (!
|
|
658
|
-
let r =
|
|
659
|
-
|
|
875
|
+
if (!d) {
|
|
876
|
+
let e = O.get(s), n = u + a;
|
|
877
|
+
if (!P[s] || Math.abs(n - e) > .1) {
|
|
878
|
+
let r = n - e;
|
|
879
|
+
O.update(s, r), P[s] = 1, t = !0, s < l && (i += r);
|
|
660
880
|
}
|
|
661
881
|
}
|
|
662
882
|
}
|
|
663
|
-
let
|
|
664
|
-
if (
|
|
665
|
-
let
|
|
666
|
-
if (
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
let e = x.get(i), t = c + o;
|
|
671
|
-
if (!T[i] || Math.abs(e - t) > .1) {
|
|
672
|
-
let a = t - e;
|
|
673
|
-
Math.abs(a) > .1 && (x.update(i, a), n = !0, i < u && (r += a)), T[i] = 1;
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
} else {
|
|
677
|
-
let t = _.dataset.colIndex === void 0 ? Array.from(_.querySelectorAll("[data-col-index]")) : [_];
|
|
678
|
-
for (let i of t) {
|
|
679
|
-
let t = Number.parseInt(i.dataset.colIndex, 10);
|
|
680
|
-
if (t >= 0 && t < (e.value.columnCount || 0) && !h.has(t)) {
|
|
681
|
-
h.add(t);
|
|
682
|
-
let e = i.getBoundingClientRect().width, a = x.get(t), s = e + o;
|
|
683
|
-
if (!T[t] || Math.abs(a - s) > .1) {
|
|
684
|
-
let e = s - a;
|
|
685
|
-
Math.abs(e) > .1 && (x.update(t, e), n = !0, t < u && (r += e)), T[t] = 1;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
}
|
|
883
|
+
let g = ue.value || typeof n.value.columnWidth == "function";
|
|
884
|
+
if (f && m && n.value.columnCount && g && (c > 0 || m.dataset.colIndex === void 0)) {
|
|
885
|
+
let e = m.dataset.colIndex;
|
|
886
|
+
if (e != null) h(Number.parseInt(e, 10), c);
|
|
887
|
+
else {
|
|
888
|
+
let e = Array.from(m.querySelectorAll("[data-col-index]"));
|
|
889
|
+
for (let t of e) h(Number.parseInt(t.dataset.colIndex, 10), t.getBoundingClientRect().width);
|
|
689
890
|
}
|
|
690
891
|
}
|
|
691
892
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
893
|
+
if (t && (A.value++, !(F.value !== null || x.value) && (r !== 0 || i !== 0))) {
|
|
894
|
+
let e = G.value + U.value + xe.value, t = q.value + W.value + Ce.value;
|
|
895
|
+
Ue(r === 0 ? null : s + r + e, i === 0 ? null : c + i + t, { behavior: "auto" });
|
|
896
|
+
}
|
|
897
|
+
}, it = (e, t, n, r) => {
|
|
898
|
+
rt([{
|
|
695
899
|
index: e,
|
|
696
900
|
inlineSize: t,
|
|
697
901
|
blockSize: n,
|
|
698
902
|
element: r
|
|
699
903
|
}]);
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
904
|
+
};
|
|
905
|
+
function at() {
|
|
906
|
+
if (F.value && !c.value) {
|
|
907
|
+
let { rowIndex: e, colIndex: t, options: r } = F.value;
|
|
908
|
+
if (isScrollToIndexOptions(r) && r.behavior === "smooth" && a.value) return;
|
|
909
|
+
let i = n.value.container || window, o = typeof window < "u" && i === window ? window.scrollX : i.scrollLeft, s = typeof window < "u" && i === window ? window.scrollY : i.scrollTop, c = d.value ? Math.abs(o) : o, l = s, u = displayToVirtual(c, 0, Z.value), m = displayToVirtual(l, 0, Q.value), { targetX: h, targetY: g } = calculateScrollTarget({
|
|
910
|
+
rowIndex: e,
|
|
911
|
+
colIndex: t,
|
|
707
912
|
options: r,
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
913
|
+
direction: R.value,
|
|
914
|
+
viewportWidth: f.value,
|
|
915
|
+
viewportHeight: p.value,
|
|
916
|
+
totalWidth: Me.value,
|
|
917
|
+
totalHeight: Ne.value,
|
|
918
|
+
gap: n.value.gap || 0,
|
|
919
|
+
columnGap: n.value.columnGap || 0,
|
|
920
|
+
fixedSize: B.value,
|
|
921
|
+
fixedWidth: V.value,
|
|
922
|
+
relativeScrollX: u,
|
|
923
|
+
relativeScrollY: m,
|
|
924
|
+
getItemSizeY: (e) => O.get(e),
|
|
925
|
+
getItemSizeX: (e) => D.get(e),
|
|
926
|
+
getItemQueryY: (e) => O.query(e),
|
|
927
|
+
getItemQueryX: (e) => D.query(e),
|
|
928
|
+
getColumnSize: (e) => k.get(e),
|
|
929
|
+
getColumnQuery: (e) => k.query(e),
|
|
930
|
+
scaleX: Z.value,
|
|
931
|
+
scaleY: Q.value,
|
|
932
|
+
hostOffsetX: X.x,
|
|
933
|
+
hostOffsetY: X.y,
|
|
934
|
+
stickyIndices: ye.value,
|
|
935
|
+
stickyStartX: U.value,
|
|
936
|
+
stickyStartY: W.value,
|
|
937
|
+
stickyEndX: Te.value,
|
|
938
|
+
stickyEndY: Ee.value,
|
|
939
|
+
flowPaddingStartX: G.value,
|
|
940
|
+
flowPaddingStartY: q.value,
|
|
941
|
+
paddingStartX: xe.value,
|
|
942
|
+
paddingStartY: Ce.value,
|
|
943
|
+
paddingEndX: Se.value,
|
|
944
|
+
paddingEndY: we.value
|
|
945
|
+
}), _ = t == null || Math.abs(u - h) < 2, v = e == null || Math.abs(m - g) < 2, y = t == null || t === void 0 || j[t] === 1, b = e == null || e === void 0 || P[e] === 1;
|
|
946
|
+
_ && v ? y && b && !a.value && !x.value && (F.value = null) : He(e, t, isScrollToIndexOptions(r) ? {
|
|
730
947
|
...r,
|
|
731
948
|
isCorrection: !0
|
|
732
949
|
} : {
|
|
@@ -734,89 +951,214 @@ function useVirtualScroll(e) {
|
|
|
734
951
|
isCorrection: !0
|
|
735
952
|
});
|
|
736
953
|
}
|
|
737
|
-
}
|
|
954
|
+
}
|
|
738
955
|
watch([
|
|
739
|
-
|
|
740
|
-
|
|
956
|
+
A,
|
|
957
|
+
f,
|
|
741
958
|
p
|
|
742
|
-
],
|
|
743
|
-
e ||
|
|
959
|
+
], at), watch(a, (e) => {
|
|
960
|
+
e || at();
|
|
744
961
|
});
|
|
745
|
-
let
|
|
746
|
-
if (
|
|
747
|
-
let t = e === window ? document :
|
|
748
|
-
if (
|
|
749
|
-
|
|
962
|
+
let ot = null, st = null, ct, lt = (e) => {
|
|
963
|
+
if (typeof window > "u") return;
|
|
964
|
+
let t = e || window, n = t === window || isElement(t) && t === document.documentElement ? document : t;
|
|
965
|
+
if (n.addEventListener("scroll", nt, { passive: !0 }), T = null, E(), isElement(t) && (st = new MutationObserver(() => E()), st.observe(t, {
|
|
966
|
+
attributes: !0,
|
|
967
|
+
attributeFilter: ["dir", "style"]
|
|
968
|
+
})), ct = setInterval(E, 1e3), t === window) {
|
|
969
|
+
f.value = document.documentElement.clientWidth, p.value = document.documentElement.clientHeight, r.value = window.scrollX, i.value = window.scrollY;
|
|
750
970
|
let e = () => {
|
|
751
|
-
|
|
971
|
+
E(), f.value = document.documentElement.clientWidth, p.value = document.documentElement.clientHeight, Ke();
|
|
752
972
|
};
|
|
753
973
|
return window.addEventListener("resize", e), () => {
|
|
754
|
-
|
|
974
|
+
n.removeEventListener("scroll", nt), window.removeEventListener("resize", e), st?.disconnect(), clearInterval(ct), T = null;
|
|
755
975
|
};
|
|
756
|
-
} else return
|
|
757
|
-
|
|
758
|
-
}),
|
|
759
|
-
|
|
976
|
+
} else return f.value = t.clientWidth, p.value = t.clientHeight, r.value = t.scrollLeft, i.value = t.scrollTop, ot = new ResizeObserver(() => {
|
|
977
|
+
E(), f.value = t.clientWidth, p.value = t.clientHeight, Ke();
|
|
978
|
+
}), ot.observe(t), () => {
|
|
979
|
+
n.removeEventListener("scroll", nt), ot?.disconnect(), st?.disconnect(), clearInterval(ct), T = null;
|
|
760
980
|
};
|
|
761
|
-
},
|
|
981
|
+
}, ut;
|
|
762
982
|
return getCurrentInstance() && (onMounted(() => {
|
|
763
|
-
l.value = !0, watch(() =>
|
|
764
|
-
|
|
765
|
-
}, { immediate: !0 }),
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
983
|
+
l.value = !0, E(), watch(() => n.value.container, (e) => {
|
|
984
|
+
ut?.(), ut = lt(e || null);
|
|
985
|
+
}, { immediate: !0 }), Ke(), nextTick(() => {
|
|
986
|
+
if (Ke(), n.value.ssrRange || n.value.initialScrollIndex !== void 0) {
|
|
987
|
+
let e = n.value.initialScrollIndex === void 0 ? n.value.ssrRange?.start : n.value.initialScrollIndex, t = n.value.initialScrollAlign || "start";
|
|
988
|
+
e != null && He(e, n.value.ssrRange?.colStart, {
|
|
989
|
+
align: t,
|
|
990
|
+
behavior: "auto"
|
|
991
|
+
}), o.value = !0, c.value = !0, nextTick(() => {
|
|
992
|
+
c.value = !1;
|
|
993
|
+
});
|
|
994
|
+
} else o.value = !0;
|
|
995
|
+
});
|
|
775
996
|
}), onUnmounted(() => {
|
|
776
|
-
|
|
997
|
+
ut?.();
|
|
777
998
|
})), {
|
|
778
|
-
renderedItems:
|
|
999
|
+
renderedItems: $e,
|
|
779
1000
|
totalWidth: J,
|
|
780
1001
|
totalHeight: Y,
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
1002
|
+
renderedWidth: Pe,
|
|
1003
|
+
renderedHeight: Fe,
|
|
1004
|
+
scrollDetails: et,
|
|
1005
|
+
getRowHeight: Ve,
|
|
1006
|
+
getColumnWidth: Be,
|
|
1007
|
+
getRowOffset: (e) => q.value + W.value + Ce.value + O.query(e),
|
|
1008
|
+
getColumnOffset: (e) => G.value + U.value + xe.value + k.query(e),
|
|
1009
|
+
getItemOffset: (e) => R.value === "horizontal" ? G.value + U.value + xe.value + D.query(e) : q.value + W.value + Ce.value + O.query(e),
|
|
1010
|
+
getItemSize: (e) => {
|
|
1011
|
+
if (R.value === "horizontal") return Math.max(0, D.get(e) - (n.value.columnGap || 0));
|
|
1012
|
+
let t = n.value.itemSize;
|
|
1013
|
+
if (typeof t == "number" && t > 0) return t;
|
|
1014
|
+
if (typeof t == "function") {
|
|
1015
|
+
let r = n.value.items[e];
|
|
1016
|
+
return r === void 0 ? n.value.defaultItemSize || 40 : t(r, e);
|
|
1017
|
+
}
|
|
1018
|
+
return Math.max(0, O.get(e) - (n.value.gap || 0));
|
|
1019
|
+
},
|
|
1020
|
+
scrollToIndex: He,
|
|
1021
|
+
scrollToOffset: Ue,
|
|
1022
|
+
stopProgrammaticScroll: tt,
|
|
1023
|
+
updateItemSize: it,
|
|
1024
|
+
updateItemSizes: rt,
|
|
1025
|
+
updateHostOffset: Ke,
|
|
1026
|
+
updateDirection: E,
|
|
1027
|
+
columnRange: Ze,
|
|
790
1028
|
refresh: () => {
|
|
791
|
-
|
|
1029
|
+
D.resize(0), O.resize(0), k.resize(0), j.fill(0), M.fill(0), P.fill(0), Ge();
|
|
792
1030
|
},
|
|
793
|
-
isHydrated:
|
|
1031
|
+
isHydrated: o,
|
|
1032
|
+
isWindowContainer: je,
|
|
1033
|
+
isRtl: d,
|
|
1034
|
+
scaleX: Z,
|
|
1035
|
+
scaleY: Q,
|
|
1036
|
+
componentOffset: X,
|
|
1037
|
+
renderedVirtualWidth: Ie,
|
|
1038
|
+
renderedVirtualHeight: Le
|
|
794
1039
|
};
|
|
795
1040
|
}
|
|
796
|
-
|
|
1041
|
+
function useVirtualScrollbar(e) {
|
|
1042
|
+
let n = computed(() => toValue(e.axis)), r = computed(() => toValue(e.totalSize)), i = computed(() => toValue(e.position)), a = computed(() => toValue(e.viewportSize)), o = computed(() => toValue(e.containerId)), c = computed(() => !!toValue(e.isRtl)), l = computed(() => n.value === "horizontal"), u = computed(() => r.value <= 0 ? 0 : Math.min(1, a.value / r.value)), d = computed(() => {
|
|
1043
|
+
let e = r.value - a.value;
|
|
1044
|
+
return e <= 0 ? 0 : Math.max(0, Math.min(1, i.value / e));
|
|
1045
|
+
}), f = computed(() => {
|
|
1046
|
+
let e = a.value > 0 ? 32 / a.value : .1;
|
|
1047
|
+
return Math.max(Math.min(e, .1), u.value) * 100;
|
|
1048
|
+
}), p = computed(() => d.value * (100 - f.value)), m = computed(() => l.value ? {
|
|
1049
|
+
inlineSize: `${f.value}%`,
|
|
1050
|
+
insetInlineStart: `${p.value}%`
|
|
1051
|
+
} : {
|
|
1052
|
+
blockSize: `${f.value}%`,
|
|
1053
|
+
insetBlockStart: `${p.value}%`
|
|
1054
|
+
}), g = computed(() => {
|
|
1055
|
+
let e = a.value, t = "var(--vs-scrollbar-has-cross-gap, var(--vsi-scrollbar-has-cross-gap, 0)) * var(--vs-scrollbar-cross-gap, var(--vsi-scrollbar-size, 8px))";
|
|
1056
|
+
return l.value ? { inlineSize: `calc(${Math.max(0, e - 4)}px - ${t})` } : { blockSize: `calc(${Math.max(0, e - 4)}px - ${t})` };
|
|
1057
|
+
}), _ = ref(!1), y = 0, b = 0;
|
|
1058
|
+
function x(t) {
|
|
1059
|
+
let n = t.currentTarget;
|
|
1060
|
+
if (t.target !== n) return;
|
|
1061
|
+
let i = n.getBoundingClientRect(), o = l.value ? i.width : i.height, s = 0;
|
|
1062
|
+
s = l.value ? c.value ? i.right - t.clientX : t.clientX - i.left : t.clientY - i.top;
|
|
1063
|
+
let u = f.value / 100 * o, d = (s - u / 2) / (o - u), p = r.value - a.value, m = d * p;
|
|
1064
|
+
m > p - 1 && (m = p), e.scrollToOffset(Math.max(0, Math.min(p, m)));
|
|
1065
|
+
}
|
|
1066
|
+
function S(e) {
|
|
1067
|
+
_.value = !0, y = l.value ? c.value ? -e.clientX : e.clientX : e.clientY, b = i.value, e.currentTarget.setPointerCapture(e.pointerId), e.preventDefault(), e.stopPropagation();
|
|
1068
|
+
}
|
|
1069
|
+
function C(t) {
|
|
1070
|
+
if (!_.value) return;
|
|
1071
|
+
let n = t.currentTarget.parentElement;
|
|
1072
|
+
if (!n) return;
|
|
1073
|
+
let i = (l.value ? c.value ? -t.clientX : t.clientX : t.clientY) - y, o = n.getBoundingClientRect(), s = l.value ? o.width : o.height, u = s - f.value / 100 * s;
|
|
1074
|
+
if (u <= 0) return;
|
|
1075
|
+
let d = r.value - a.value, p = b + i / u * d;
|
|
1076
|
+
p > d - 1 && (p = d), e.scrollToOffset(Math.max(0, Math.min(d, p)));
|
|
1077
|
+
}
|
|
1078
|
+
function T(e) {
|
|
1079
|
+
_.value && (_.value = !1, e.currentTarget.releasePointerCapture(e.pointerId));
|
|
1080
|
+
}
|
|
1081
|
+
return getCurrentInstance() && onUnmounted(() => {
|
|
1082
|
+
_.value = !1;
|
|
1083
|
+
}), {
|
|
1084
|
+
viewportPercent: u,
|
|
1085
|
+
positionPercent: d,
|
|
1086
|
+
thumbSizePercent: f,
|
|
1087
|
+
thumbPositionPercent: p,
|
|
1088
|
+
trackStyle: g,
|
|
1089
|
+
thumbStyle: m,
|
|
1090
|
+
trackProps: computed(() => ({
|
|
1091
|
+
class: ["virtual-scrollbar-track", `virtual-scrollbar-track--${l.value ? "horizontal" : "vertical"}`],
|
|
1092
|
+
style: g.value,
|
|
1093
|
+
role: "scrollbar",
|
|
1094
|
+
"aria-orientation": n.value,
|
|
1095
|
+
"aria-valuenow": Math.round(i.value),
|
|
1096
|
+
"aria-valuemin": 0,
|
|
1097
|
+
"aria-valuemax": Math.round(r.value - a.value),
|
|
1098
|
+
"aria-controls": o.value,
|
|
1099
|
+
tabindex: -1,
|
|
1100
|
+
onMousedown: x
|
|
1101
|
+
})),
|
|
1102
|
+
thumbProps: computed(() => ({
|
|
1103
|
+
class: [
|
|
1104
|
+
"virtual-scrollbar-thumb",
|
|
1105
|
+
`virtual-scrollbar-thumb--${l.value ? "horizontal" : "vertical"}`,
|
|
1106
|
+
{ "virtual-scrollbar-thumb--active": _.value }
|
|
1107
|
+
],
|
|
1108
|
+
style: m.value,
|
|
1109
|
+
onPointerdown: S,
|
|
1110
|
+
onPointermove: C,
|
|
1111
|
+
onPointerup: T,
|
|
1112
|
+
onPointercancel: T
|
|
1113
|
+
})),
|
|
1114
|
+
isDragging: _
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
var VirtualScrollbar_default = /* @__PURE__ */ defineComponent({
|
|
1118
|
+
__name: "VirtualScrollbar",
|
|
1119
|
+
props: {
|
|
1120
|
+
axis: { default: "vertical" },
|
|
1121
|
+
totalSize: {},
|
|
1122
|
+
position: {},
|
|
1123
|
+
viewportSize: {},
|
|
1124
|
+
scrollToOffset: {},
|
|
1125
|
+
containerId: {},
|
|
1126
|
+
isRtl: {
|
|
1127
|
+
type: Boolean,
|
|
1128
|
+
default: !1
|
|
1129
|
+
}
|
|
1130
|
+
},
|
|
1131
|
+
emits: ["scrollToOffset"],
|
|
1132
|
+
setup(e, { emit: t }) {
|
|
1133
|
+
let n = e, r = t, { trackProps: o, thumbProps: s } = useVirtualScrollbar({
|
|
1134
|
+
axis: () => n.axis,
|
|
1135
|
+
totalSize: () => n.totalSize,
|
|
1136
|
+
position: () => n.position,
|
|
1137
|
+
viewportSize: () => n.viewportSize,
|
|
1138
|
+
containerId: () => n.containerId,
|
|
1139
|
+
isRtl: () => n.isRtl,
|
|
1140
|
+
scrollToOffset: (e) => {
|
|
1141
|
+
n.scrollToOffset?.(e), r("scrollToOffset", e);
|
|
1142
|
+
}
|
|
1143
|
+
});
|
|
1144
|
+
return (e, t) => (openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(o))), [createElementVNode("div", normalizeProps(guardReactiveProps(unref(s))), null, 16)], 16));
|
|
1145
|
+
}
|
|
1146
|
+
}), _hoisted_1 = {
|
|
1147
|
+
key: 0,
|
|
1148
|
+
class: "virtual-scroll-scrollbar-container"
|
|
1149
|
+
}, _hoisted_2 = {
|
|
797
1150
|
key: 0,
|
|
798
1151
|
class: "virtual-scroll-debug-info"
|
|
799
|
-
}, VirtualScroll_default = /* @__PURE__ */ ((e, t) => {
|
|
1152
|
+
}, FRICTION = .95, MIN_VELOCITY = .1, VirtualScroll_default = /* @__PURE__ */ ((e, t) => {
|
|
800
1153
|
let n = e.__vccOpts || e;
|
|
801
1154
|
for (let [e, r] of t) n[e] = r;
|
|
802
1155
|
return n;
|
|
803
1156
|
})(/* @__PURE__ */ defineComponent({
|
|
804
1157
|
__name: "VirtualScroll",
|
|
805
1158
|
props: {
|
|
806
|
-
items: {},
|
|
807
|
-
itemSize: {},
|
|
808
|
-
direction: { default: "vertical" },
|
|
809
|
-
bufferBefore: { default: 5 },
|
|
810
|
-
bufferAfter: { default: 5 },
|
|
811
|
-
container: {},
|
|
812
|
-
ssrRange: {},
|
|
813
|
-
columnCount: { default: 0 },
|
|
814
|
-
columnWidth: {},
|
|
815
1159
|
containerTag: { default: "div" },
|
|
816
1160
|
wrapperTag: { default: "div" },
|
|
817
1161
|
itemTag: { default: "div" },
|
|
818
|
-
scrollPaddingStart: { default: 0 },
|
|
819
|
-
scrollPaddingEnd: { default: 0 },
|
|
820
1162
|
stickyHeader: {
|
|
821
1163
|
type: Boolean,
|
|
822
1164
|
default: !1
|
|
@@ -825,6 +1167,21 @@ var _hoisted_1 = {
|
|
|
825
1167
|
type: Boolean,
|
|
826
1168
|
default: !1
|
|
827
1169
|
},
|
|
1170
|
+
virtualScrollbar: {
|
|
1171
|
+
type: Boolean,
|
|
1172
|
+
default: !1
|
|
1173
|
+
},
|
|
1174
|
+
items: {},
|
|
1175
|
+
itemSize: {},
|
|
1176
|
+
direction: { default: "vertical" },
|
|
1177
|
+
bufferBefore: { default: 5 },
|
|
1178
|
+
bufferAfter: { default: 5 },
|
|
1179
|
+
container: {},
|
|
1180
|
+
ssrRange: {},
|
|
1181
|
+
columnCount: { default: 0 },
|
|
1182
|
+
columnWidth: {},
|
|
1183
|
+
scrollPaddingStart: { default: 0 },
|
|
1184
|
+
scrollPaddingEnd: { default: 0 },
|
|
828
1185
|
gap: { default: 0 },
|
|
829
1186
|
columnGap: { default: 0 },
|
|
830
1187
|
stickyIndices: { default: () => [] },
|
|
@@ -851,74 +1208,115 @@ var _hoisted_1 = {
|
|
|
851
1208
|
"load",
|
|
852
1209
|
"visibleRangeChange"
|
|
853
1210
|
],
|
|
854
|
-
setup(o, { expose: s, emit:
|
|
855
|
-
let
|
|
856
|
-
let e =
|
|
857
|
-
return e ===
|
|
858
|
-
}),
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1211
|
+
setup(o, { expose: s, emit: c }) {
|
|
1212
|
+
let _ = o, w = c, k = useSlots(), A = ref(null), j = ref(null), M = ref(null), N = ref(null), te = /* @__PURE__ */ new Map(), P = useId(), F = computed(() => `vs-container-${P}`), ne = ref(0), re = ref(0), ie = computed(() => _.container === void 0 ? A.value : _.container), ae = computed(() => {
|
|
1213
|
+
let e = ie.value;
|
|
1214
|
+
return e === A.value || typeof window < "u" && (e === window || e === null);
|
|
1215
|
+
}), I = computed(() => (_.items.length, {
|
|
1216
|
+
items: _.items,
|
|
1217
|
+
itemSize: _.itemSize,
|
|
1218
|
+
direction: _.direction,
|
|
1219
|
+
bufferBefore: _.bufferBefore,
|
|
1220
|
+
bufferAfter: _.bufferAfter,
|
|
1221
|
+
container: ie.value,
|
|
1222
|
+
hostElement: j.value,
|
|
1223
|
+
hostRef: A.value,
|
|
1224
|
+
ssrRange: _.ssrRange,
|
|
1225
|
+
columnCount: _.columnCount,
|
|
1226
|
+
columnWidth: _.columnWidth,
|
|
1227
|
+
scrollPaddingStart: {
|
|
1228
|
+
x: getPaddingX(_.scrollPaddingStart, _.direction),
|
|
1229
|
+
y: getPaddingY(_.scrollPaddingStart, _.direction)
|
|
1230
|
+
},
|
|
1231
|
+
scrollPaddingEnd: {
|
|
1232
|
+
x: getPaddingX(_.scrollPaddingEnd, _.direction),
|
|
1233
|
+
y: getPaddingY(_.scrollPaddingEnd, _.direction)
|
|
1234
|
+
},
|
|
1235
|
+
flowPaddingStart: {
|
|
1236
|
+
x: 0,
|
|
1237
|
+
y: _.stickyHeader ? 0 : ne.value
|
|
1238
|
+
},
|
|
1239
|
+
flowPaddingEnd: {
|
|
1240
|
+
x: 0,
|
|
1241
|
+
y: _.stickyFooter ? 0 : re.value
|
|
1242
|
+
},
|
|
1243
|
+
stickyStart: {
|
|
1244
|
+
x: 0,
|
|
1245
|
+
y: _.stickyHeader && ae.value ? ne.value : 0
|
|
1246
|
+
},
|
|
1247
|
+
stickyEnd: {
|
|
1248
|
+
x: 0,
|
|
1249
|
+
y: _.stickyFooter && ae.value ? re.value : 0
|
|
1250
|
+
},
|
|
1251
|
+
gap: _.gap,
|
|
1252
|
+
columnGap: _.columnGap,
|
|
1253
|
+
stickyIndices: _.stickyIndices,
|
|
1254
|
+
loadDistance: _.loadDistance,
|
|
1255
|
+
loading: _.loading,
|
|
1256
|
+
restoreScrollOnPrepend: _.restoreScrollOnPrepend,
|
|
1257
|
+
initialScrollIndex: _.initialScrollIndex,
|
|
1258
|
+
initialScrollAlign: _.initialScrollAlign,
|
|
1259
|
+
defaultItemSize: _.defaultItemSize,
|
|
1260
|
+
defaultColumnWidth: _.defaultColumnWidth,
|
|
1261
|
+
debug: _.debug
|
|
1262
|
+
})), { isHydrated: ce, isRtl: L, columnRange: le, renderedItems: R, scrollDetails: z, renderedHeight: ue, renderedWidth: B, getColumnWidth: V, getRowHeight: fe, scrollToIndex: H, scrollToOffset: pe, updateHostOffset: me, updateItemSizes: he, updateDirection: ge, getItemOffset: ve, getRowOffset: Te, getColumnOffset: W, getItemSize: Ee, refresh: G, stopProgrammaticScroll: K, scaleX: q, scaleY: De, isWindowContainer: Oe, componentOffset: ke, renderedVirtualWidth: Ae, renderedVirtualHeight: je } = useVirtualScroll(I), Me = computed(() => q.value !== 1 || De.value !== 1), Ne = computed(() => Oe.value ? !1 : _.virtualScrollbar === !0 || q.value !== 1 || De.value !== 1);
|
|
1263
|
+
function J(e) {
|
|
1264
|
+
let { displayViewportSize: t } = z.value;
|
|
1265
|
+
e >= ue.value - t.height - .5 ? pe(null, Infinity) : pe(null, displayToVirtual(e, ke.y, De.value));
|
|
1266
|
+
}
|
|
1267
|
+
function Y(e) {
|
|
1268
|
+
let { displayViewportSize: t } = z.value;
|
|
1269
|
+
e >= B.value - t.width - .5 ? pe(Infinity, null) : pe(displayToVirtual(e, ke.x, q.value), null);
|
|
1270
|
+
}
|
|
1271
|
+
let X = useVirtualScrollbar({
|
|
1272
|
+
axis: "vertical",
|
|
1273
|
+
totalSize: ue,
|
|
1274
|
+
position: computed(() => z.value.displayScrollOffset.y),
|
|
1275
|
+
viewportSize: computed(() => z.value.displayViewportSize.height),
|
|
1276
|
+
scrollToOffset: J,
|
|
1277
|
+
containerId: F,
|
|
1278
|
+
isRtl: L
|
|
1279
|
+
}), Pe = useVirtualScrollbar({
|
|
1280
|
+
axis: "horizontal",
|
|
1281
|
+
totalSize: B,
|
|
1282
|
+
position: computed(() => z.value.displayScrollOffset.x),
|
|
1283
|
+
viewportSize: computed(() => z.value.displayViewportSize.width),
|
|
1284
|
+
scrollToOffset: Y,
|
|
1285
|
+
containerId: F,
|
|
1286
|
+
isRtl: L
|
|
1287
|
+
}), Fe = computed(() => _.direction === "both" ? {
|
|
1288
|
+
...le.value,
|
|
1289
|
+
padStart: 0,
|
|
1290
|
+
padEnd: 0
|
|
1291
|
+
} : le.value);
|
|
1292
|
+
function Ie() {
|
|
1293
|
+
G(), ge(), nextTick(() => {
|
|
896
1294
|
let e = [];
|
|
897
|
-
for (let [t, n] of
|
|
1295
|
+
for (let [t, n] of te.entries()) n && e.push({
|
|
898
1296
|
index: t,
|
|
899
1297
|
inlineSize: n.offsetWidth,
|
|
900
1298
|
blockSize: n.offsetHeight,
|
|
901
1299
|
element: n
|
|
902
1300
|
});
|
|
903
|
-
e.length > 0 &&
|
|
1301
|
+
e.length > 0 && he(e);
|
|
904
1302
|
});
|
|
905
1303
|
}
|
|
906
|
-
watch(
|
|
907
|
-
|
|
1304
|
+
watch(z, (e, t) => {
|
|
1305
|
+
!ce.value || !e || (w("scroll", e), (!t || !t.range || !t.columnRange || e.range.start !== t.range.start || e.range.end !== t.range.end || e.columnRange.start !== t.columnRange.start || e.columnRange.end !== t.columnRange.end) && w("visibleRangeChange", {
|
|
908
1306
|
start: e.range.start,
|
|
909
1307
|
end: e.range.end,
|
|
910
1308
|
colStart: e.columnRange.start,
|
|
911
1309
|
colEnd: e.columnRange.end
|
|
912
|
-
}), !
|
|
913
|
-
}), watch(
|
|
914
|
-
e &&
|
|
915
|
-
start:
|
|
916
|
-
end:
|
|
917
|
-
colStart:
|
|
918
|
-
colEnd:
|
|
1310
|
+
}), !_.loading && (_.direction !== "horizontal" && e.totalSize && e.totalSize.height - (e.scrollOffset.y + e.viewportSize.height) <= _.loadDistance && w("load", "vertical"), _.direction !== "vertical" && e.totalSize && e.totalSize.width - (e.scrollOffset.x + e.viewportSize.width) <= _.loadDistance && w("load", "horizontal")));
|
|
1311
|
+
}), watch(ce, (e) => {
|
|
1312
|
+
e && z.value?.range && z.value?.columnRange && w("visibleRangeChange", {
|
|
1313
|
+
start: z.value.range.start,
|
|
1314
|
+
end: z.value.range.end,
|
|
1315
|
+
colStart: z.value.columnRange.start,
|
|
1316
|
+
colEnd: z.value.columnRange.end
|
|
919
1317
|
});
|
|
920
1318
|
}, { once: !0 });
|
|
921
|
-
let
|
|
1319
|
+
let Le = typeof window > "u" ? null : new ResizeObserver(me), Z = typeof window > "u" ? null : new ResizeObserver((e) => {
|
|
922
1320
|
let t = [];
|
|
923
1321
|
for (let n of e) {
|
|
924
1322
|
let e = n.target, r = Number(e.dataset.index), i = e.dataset.colIndex, a = n.contentRect.width, o = n.contentRect.height;
|
|
@@ -934,67 +1332,228 @@ var _hoisted_1 = {
|
|
|
934
1332
|
element: e
|
|
935
1333
|
});
|
|
936
1334
|
}
|
|
937
|
-
t.length > 0 &&
|
|
938
|
-
}),
|
|
939
|
-
|
|
1335
|
+
t.length > 0 && he(t);
|
|
1336
|
+
}), Q = typeof window > "u" ? null : new ResizeObserver(() => {
|
|
1337
|
+
ne.value = M.value?.offsetHeight || 0, re.value = N.value?.offsetHeight || 0, me();
|
|
940
1338
|
});
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1339
|
+
function Re(e, t) {
|
|
1340
|
+
watch(e, (e, n) => {
|
|
1341
|
+
n && Q?.unobserve(n), e ? Q?.observe(e) : t.value = 0;
|
|
1342
|
+
}, { immediate: !0 });
|
|
1343
|
+
}
|
|
1344
|
+
Re(M, ne), Re(N, re), onMounted(() => {
|
|
1345
|
+
A.value && Le?.observe(A.value);
|
|
1346
|
+
for (let e of te.values()) Z?.observe(e), _.direction === "both" && e.querySelectorAll("[data-col-index]").forEach((e) => Z?.observe(e));
|
|
1347
|
+
}), watch([A, j], ([e], [t]) => {
|
|
1348
|
+
t && Le?.unobserve(t), e && Le?.observe(e);
|
|
1349
|
+
}), watch([A, Me], ([e, t], [n, r]) => {
|
|
1350
|
+
let i = e !== n || t !== r;
|
|
1351
|
+
n && i && n.removeEventListener("wheel", Ze), e && i && e.addEventListener("wheel", Ze, { passive: !t });
|
|
1352
|
+
}, { immediate: !0 });
|
|
1353
|
+
function ze(e, t) {
|
|
1354
|
+
if (e) te.set(t, e), Z?.observe(e), _.direction === "both" && e.querySelectorAll("[data-col-index]").forEach((e) => Z?.observe(e));
|
|
953
1355
|
else {
|
|
954
|
-
let e =
|
|
955
|
-
e && (
|
|
1356
|
+
let e = te.get(t);
|
|
1357
|
+
e && (Z?.unobserve(e), _.direction === "both" && e.querySelectorAll("[data-col-index]").forEach((e) => Z?.unobserve(e)), te.delete(t));
|
|
956
1358
|
}
|
|
957
1359
|
}
|
|
958
|
-
|
|
959
|
-
|
|
1360
|
+
let Be = ref(!1), Ve = {
|
|
1361
|
+
x: 0,
|
|
1362
|
+
y: 0
|
|
1363
|
+
}, He = {
|
|
1364
|
+
x: 0,
|
|
1365
|
+
y: 0
|
|
1366
|
+
}, Ue = {
|
|
1367
|
+
x: 0,
|
|
1368
|
+
y: 0
|
|
1369
|
+
}, We = 0, $ = {
|
|
1370
|
+
x: 0,
|
|
1371
|
+
y: 0
|
|
1372
|
+
}, Ge = null;
|
|
1373
|
+
function Ke() {
|
|
1374
|
+
let e = () => {
|
|
1375
|
+
$.x *= FRICTION, $.y *= FRICTION;
|
|
1376
|
+
let t = z.value.scrollOffset.x, n = z.value.scrollOffset.y;
|
|
1377
|
+
pe(t + $.x * 16, n + $.y * 16, { behavior: "auto" }), Math.abs($.x) > MIN_VELOCITY || Math.abs($.y) > MIN_VELOCITY ? Ge = requestAnimationFrame(e) : qe();
|
|
1378
|
+
};
|
|
1379
|
+
Ge = requestAnimationFrame(e);
|
|
1380
|
+
}
|
|
1381
|
+
function qe() {
|
|
1382
|
+
Ge !== null && (cancelAnimationFrame(Ge), Ge = null), $ = {
|
|
1383
|
+
x: 0,
|
|
1384
|
+
y: 0
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
function Je(e) {
|
|
1388
|
+
K(), qe(), Me.value && (e.pointerType === "mouse" && e.button !== 0 || (Be.value = !0, Ve = {
|
|
1389
|
+
x: e.clientX,
|
|
1390
|
+
y: e.clientY
|
|
1391
|
+
}, Ue = {
|
|
1392
|
+
x: e.clientX,
|
|
1393
|
+
y: e.clientY
|
|
1394
|
+
}, We = performance.now(), He = {
|
|
1395
|
+
x: z.value.scrollOffset.x,
|
|
1396
|
+
y: z.value.scrollOffset.y
|
|
1397
|
+
}, e.currentTarget.setPointerCapture(e.pointerId)));
|
|
1398
|
+
}
|
|
1399
|
+
function Ye(e) {
|
|
1400
|
+
if (!Be.value) return;
|
|
1401
|
+
let t = performance.now(), n = t - We;
|
|
1402
|
+
if (n > 0) {
|
|
1403
|
+
let t = (Ue.x - e.clientX) / n, r = (Ue.y - e.clientY) / n;
|
|
1404
|
+
$.x = $.x * .2 + t * .8, $.y = $.y * .2 + r * .8;
|
|
1405
|
+
}
|
|
1406
|
+
Ue = {
|
|
1407
|
+
x: e.clientX,
|
|
1408
|
+
y: e.clientY
|
|
1409
|
+
}, We = t;
|
|
1410
|
+
let r = Ve.x - e.clientX, i = Ve.y - e.clientY;
|
|
1411
|
+
requestAnimationFrame(() => {
|
|
1412
|
+
pe(He.x + r, He.y + i, { behavior: "auto" });
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
function Xe(e) {
|
|
1416
|
+
Be.value && (Be.value = !1, e.currentTarget.releasePointerCapture(e.pointerId), (Math.abs($.x) > MIN_VELOCITY || Math.abs($.y) > MIN_VELOCITY) && (Math.abs($.x) > 4 * Math.abs($.y) ? $.y = 0 : Math.abs($.y) > 4 * Math.abs($.x) && ($.x = 0), Ke()));
|
|
1417
|
+
}
|
|
1418
|
+
function Ze(e) {
|
|
1419
|
+
let { scrollOffset: t } = z.value;
|
|
1420
|
+
if (K(), Me.value) {
|
|
1421
|
+
e.preventDefault();
|
|
1422
|
+
let n = e.deltaX, r = e.deltaY;
|
|
1423
|
+
e.shiftKey && n === 0 && (n = r, r = 0), pe(t.x + n, t.y + r, { behavior: "auto" });
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
function Qe(e) {
|
|
1427
|
+
let { viewportSize: t, scrollOffset: n } = z.value, r = _.direction !== "vertical", i = _.direction !== "horizontal", a = I.value.stickyStart, o = I.value.stickyEnd;
|
|
960
1428
|
switch (e.key) {
|
|
961
1429
|
case "Home":
|
|
962
|
-
e.preventDefault(),
|
|
1430
|
+
e.preventDefault(), K(), H(0, 0, {
|
|
1431
|
+
behavior: Math.max(n.x, n.y) > 10 * (_.direction === "horizontal" ? t.width : t.height) ? "auto" : "smooth",
|
|
1432
|
+
align: "start"
|
|
1433
|
+
});
|
|
963
1434
|
break;
|
|
964
1435
|
case "End": {
|
|
965
|
-
e.preventDefault(),
|
|
966
|
-
let
|
|
967
|
-
|
|
1436
|
+
e.preventDefault(), K();
|
|
1437
|
+
let r = _.items.length - 1, i = (_.columnCount || 0) > 0 ? _.columnCount - 1 : 0, { totalSize: a } = z.value, o = Math.max(a.width - n.x - t.width, a.height - n.y - t.height) > 10 * (_.direction === "horizontal" ? t.width : t.height) ? "auto" : "smooth";
|
|
1438
|
+
_.direction === "both" ? H(r, i, {
|
|
1439
|
+
behavior: o,
|
|
1440
|
+
align: "end"
|
|
1441
|
+
}) : H(_.direction === "vertical" ? r : 0, _.direction === "horizontal" ? r : 0, {
|
|
1442
|
+
behavior: o,
|
|
1443
|
+
align: "end"
|
|
1444
|
+
});
|
|
968
1445
|
break;
|
|
969
1446
|
}
|
|
970
|
-
case "ArrowUp":
|
|
971
|
-
e.preventDefault(),
|
|
1447
|
+
case "ArrowUp": {
|
|
1448
|
+
if (e.preventDefault(), K(), !i) return;
|
|
1449
|
+
let { currentIndex: t, scrollOffset: n } = z.value, r = n.y + a.y + I.value.scrollPaddingStart.y;
|
|
1450
|
+
Te(t) < r - 1 ? H(t, null, { align: "start" }) : t > 0 && H(t - 1, null, { align: "start" });
|
|
972
1451
|
break;
|
|
973
|
-
|
|
974
|
-
|
|
1452
|
+
}
|
|
1453
|
+
case "ArrowDown": {
|
|
1454
|
+
if (e.preventDefault(), K(), !i) return;
|
|
1455
|
+
let { currentEndIndex: r } = z.value, a = n.y + t.height - (o.y + I.value.scrollPaddingEnd.y);
|
|
1456
|
+
Te(r) + fe(r) > a + 1 ? H(r, null, { align: "end" }) : r < _.items.length - 1 && H(r + 1, null, { align: "end" });
|
|
975
1457
|
break;
|
|
976
|
-
|
|
977
|
-
|
|
1458
|
+
}
|
|
1459
|
+
case "ArrowLeft": {
|
|
1460
|
+
if (e.preventDefault(), K(), !r) return;
|
|
1461
|
+
let { currentColIndex: i, currentEndColIndex: s } = z.value;
|
|
1462
|
+
if (L.value) {
|
|
1463
|
+
let e = n.x + t.width - (o.x + I.value.scrollPaddingEnd.x);
|
|
1464
|
+
(_.columnCount ? W(s) + V(s) : ve(s) + Ee(s)) > e + 1 ? H(null, s, { align: "end" }) : s < (_.columnCount ? _.columnCount - 1 : _.items.length - 1) && H(null, s + 1, { align: "end" });
|
|
1465
|
+
} else {
|
|
1466
|
+
let e = n.x + a.x + I.value.scrollPaddingStart.x;
|
|
1467
|
+
(_.columnCount ? W(i) : ve(i)) < e - 1 ? H(null, i, { align: "start" }) : i > 0 && H(null, i - 1, { align: "start" });
|
|
1468
|
+
}
|
|
978
1469
|
break;
|
|
979
|
-
|
|
980
|
-
|
|
1470
|
+
}
|
|
1471
|
+
case "ArrowRight": {
|
|
1472
|
+
if (e.preventDefault(), K(), !r) return;
|
|
1473
|
+
let { currentColIndex: i, currentEndColIndex: s } = z.value;
|
|
1474
|
+
if (L.value) {
|
|
1475
|
+
let e = n.x + a.x + I.value.scrollPaddingStart.x;
|
|
1476
|
+
(_.columnCount ? W(i) : ve(i)) < e - 1 ? H(null, i, { align: "start" }) : i > 0 && H(null, i - 1, { align: "start" });
|
|
1477
|
+
} else {
|
|
1478
|
+
let e = n.x + t.width - (o.x + I.value.scrollPaddingEnd.x);
|
|
1479
|
+
(_.columnCount ? W(s) + V(s) : ve(s) + Ee(s)) > e + 1 ? H(null, s, { align: "end" }) : s < (_.columnCount ? _.columnCount - 1 : _.items.length - 1) && H(null, s + 1, { align: "end" });
|
|
1480
|
+
}
|
|
981
1481
|
break;
|
|
1482
|
+
}
|
|
982
1483
|
case "PageUp":
|
|
983
|
-
e.preventDefault(),
|
|
1484
|
+
e.preventDefault(), K(), pe(!i && r ? n.x - t.width : null, i ? n.y - t.height : null);
|
|
984
1485
|
break;
|
|
985
1486
|
case "PageDown":
|
|
986
|
-
e.preventDefault(),
|
|
1487
|
+
e.preventDefault(), K(), pe(!i && r ? n.x + t.width : null, i ? n.y + t.height : null);
|
|
987
1488
|
break;
|
|
988
1489
|
}
|
|
989
1490
|
}
|
|
990
1491
|
onUnmounted(() => {
|
|
991
|
-
|
|
1492
|
+
Le?.disconnect(), Z?.disconnect(), Q?.disconnect();
|
|
992
1493
|
});
|
|
993
|
-
let
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1494
|
+
let $e = computed(() => {
|
|
1495
|
+
let e = { ..._.direction === "vertical" ? {} : { whiteSpace: "nowrap" } };
|
|
1496
|
+
return (Ne.value || !Oe.value) && (e.overflow = "auto"), Me.value && (e.touchAction = "none"), Oe.value ? e : _.containerTag === "table" ? {
|
|
1497
|
+
...e,
|
|
1498
|
+
display: "block",
|
|
1499
|
+
minInlineSize: _.direction === "vertical" ? "100%" : "auto"
|
|
1500
|
+
} : e;
|
|
1501
|
+
}), et = computed(() => {
|
|
1502
|
+
if (_.direction === "horizontal") return null;
|
|
1503
|
+
let { displayViewportSize: e, displayScrollOffset: t } = z.value;
|
|
1504
|
+
if (ue.value <= e.height) return null;
|
|
1505
|
+
let n = {
|
|
1506
|
+
axis: "vertical",
|
|
1507
|
+
totalSize: ue.value,
|
|
1508
|
+
position: t.y,
|
|
1509
|
+
viewportSize: e.height,
|
|
1510
|
+
scrollToOffset: J,
|
|
1511
|
+
containerId: F.value,
|
|
1512
|
+
isRtl: L.value
|
|
1513
|
+
};
|
|
1514
|
+
return {
|
|
1515
|
+
axis: "vertical",
|
|
1516
|
+
positionPercent: X.positionPercent.value,
|
|
1517
|
+
viewportPercent: X.viewportPercent.value,
|
|
1518
|
+
thumbSizePercent: X.thumbSizePercent.value,
|
|
1519
|
+
thumbPositionPercent: X.thumbPositionPercent.value,
|
|
1520
|
+
trackProps: X.trackProps.value,
|
|
1521
|
+
thumbProps: X.thumbProps.value,
|
|
1522
|
+
scrollbarProps: n,
|
|
1523
|
+
isDragging: X.isDragging.value
|
|
1524
|
+
};
|
|
1525
|
+
}), tt = computed(() => {
|
|
1526
|
+
if (_.direction === "vertical") return null;
|
|
1527
|
+
let { displayViewportSize: e, displayScrollOffset: t } = z.value;
|
|
1528
|
+
if (B.value <= e.width) return null;
|
|
1529
|
+
let n = {
|
|
1530
|
+
axis: "horizontal",
|
|
1531
|
+
totalSize: B.value,
|
|
1532
|
+
position: t.x,
|
|
1533
|
+
viewportSize: e.width,
|
|
1534
|
+
scrollToOffset: Y,
|
|
1535
|
+
containerId: F.value,
|
|
1536
|
+
isRtl: L.value
|
|
1537
|
+
};
|
|
1538
|
+
return {
|
|
1539
|
+
axis: "horizontal",
|
|
1540
|
+
positionPercent: Pe.positionPercent.value,
|
|
1541
|
+
viewportPercent: Pe.viewportPercent.value,
|
|
1542
|
+
thumbSizePercent: Pe.thumbSizePercent.value,
|
|
1543
|
+
thumbPositionPercent: Pe.thumbPositionPercent.value,
|
|
1544
|
+
trackProps: Pe.trackProps.value,
|
|
1545
|
+
thumbProps: Pe.thumbProps.value,
|
|
1546
|
+
scrollbarProps: n,
|
|
1547
|
+
isDragging: Pe.isDragging.value
|
|
1548
|
+
};
|
|
1549
|
+
}), nt = computed(() => {
|
|
1550
|
+
let e = _.direction === "horizontal", t = _.direction === "vertical", n = _.direction === "both", r = {
|
|
1551
|
+
inlineSize: t ? "100%" : `${Ae.value}px`,
|
|
1552
|
+
blockSize: e ? "100%" : `${je.value}px`
|
|
1553
|
+
};
|
|
1554
|
+
return ce.value || (r.display = "flex", r.flexDirection = e ? "row" : "column", (e || n) && _.columnGap && (r.columnGap = `${_.columnGap}px`), (t || n) && _.gap && (r.rowGap = `${_.gap}px`)), r;
|
|
1555
|
+
}), rt = computed(() => {
|
|
1556
|
+
let e = _.direction === "horizontal";
|
|
998
1557
|
return {
|
|
999
1558
|
display: e ? "inline-block" : "block",
|
|
1000
1559
|
...e ? {
|
|
@@ -1002,50 +1561,81 @@ var _hoisted_1 = {
|
|
|
1002
1561
|
verticalAlign: "top"
|
|
1003
1562
|
} : { inlineSize: "100%" }
|
|
1004
1563
|
};
|
|
1005
|
-
}),
|
|
1006
|
-
inlineSize:
|
|
1007
|
-
blockSize:
|
|
1564
|
+
}), it = computed(() => ({
|
|
1565
|
+
inlineSize: _.direction === "vertical" ? "1px" : `${Ae.value}px`,
|
|
1566
|
+
blockSize: _.direction === "horizontal" ? "1px" : `${je.value}px`
|
|
1008
1567
|
}));
|
|
1009
|
-
function
|
|
1010
|
-
|
|
1011
|
-
containerTag:
|
|
1012
|
-
direction:
|
|
1013
|
-
isHydrated:
|
|
1568
|
+
function at(e) {
|
|
1569
|
+
let t = calculateItemStyle({
|
|
1570
|
+
containerTag: _.containerTag || "div",
|
|
1571
|
+
direction: _.direction,
|
|
1572
|
+
isHydrated: ce.value,
|
|
1014
1573
|
item: e,
|
|
1015
|
-
itemSize:
|
|
1016
|
-
paddingStartX:
|
|
1017
|
-
paddingStartY:
|
|
1574
|
+
itemSize: _.itemSize,
|
|
1575
|
+
paddingStartX: I.value.scrollPaddingStart.x,
|
|
1576
|
+
paddingStartY: I.value.scrollPaddingStart.y,
|
|
1577
|
+
isRtl: L.value
|
|
1018
1578
|
});
|
|
1579
|
+
return !ce.value && _.direction === "both" && (t.display = "flex", _.columnGap && (t.columnGap = `${_.columnGap}px`)), t;
|
|
1019
1580
|
}
|
|
1020
|
-
let
|
|
1581
|
+
let ot = computed(() => _.debug), st = computed(() => _.containerTag === "table"), ct = computed(() => st.value ? "thead" : "div"), lt = computed(() => st.value ? "tfoot" : "div");
|
|
1021
1582
|
return s({
|
|
1022
|
-
|
|
1023
|
-
|
|
1583
|
+
...toRefs(_),
|
|
1584
|
+
scrollDetails: z,
|
|
1585
|
+
columnRange: le,
|
|
1024
1586
|
getColumnWidth: V,
|
|
1587
|
+
getRowHeight: fe,
|
|
1588
|
+
getRowOffset: Te,
|
|
1589
|
+
getColumnOffset: W,
|
|
1590
|
+
getItemOffset: ve,
|
|
1591
|
+
getItemSize: Ee,
|
|
1025
1592
|
scrollToIndex: H,
|
|
1026
|
-
scrollToOffset:
|
|
1027
|
-
refresh:
|
|
1028
|
-
stopProgrammaticScroll:
|
|
1593
|
+
scrollToOffset: pe,
|
|
1594
|
+
refresh: Ie,
|
|
1595
|
+
stopProgrammaticScroll: () => {
|
|
1596
|
+
K(), qe();
|
|
1597
|
+
},
|
|
1598
|
+
updateDirection: ge,
|
|
1599
|
+
isRtl: L,
|
|
1600
|
+
isHydrated: ce,
|
|
1601
|
+
scaleX: q,
|
|
1602
|
+
scaleY: De,
|
|
1603
|
+
renderedWidth: B,
|
|
1604
|
+
renderedHeight: ue,
|
|
1605
|
+
componentOffset: ke,
|
|
1606
|
+
scrollbarPropsVertical: et,
|
|
1607
|
+
scrollbarPropsHorizontal: tt
|
|
1029
1608
|
}), (t, s) => (openBlock(), createBlock(resolveDynamicComponent(o.containerTag), {
|
|
1609
|
+
id: F.value,
|
|
1030
1610
|
ref_key: "hostRef",
|
|
1031
|
-
ref:
|
|
1611
|
+
ref: A,
|
|
1032
1612
|
class: normalizeClass(["virtual-scroll-container", [`virtual-scroll--${o.direction}`, {
|
|
1033
|
-
"virtual-scroll--hydrated": unref(
|
|
1034
|
-
"virtual-scroll--window":
|
|
1035
|
-
"virtual-scroll--table":
|
|
1613
|
+
"virtual-scroll--hydrated": unref(ce),
|
|
1614
|
+
"virtual-scroll--window": unref(Oe),
|
|
1615
|
+
"virtual-scroll--table": st.value,
|
|
1616
|
+
"virtual-scroll--hide-scrollbar": Ne.value
|
|
1036
1617
|
}]]),
|
|
1037
|
-
style: normalizeStyle(
|
|
1618
|
+
style: normalizeStyle($e.value),
|
|
1038
1619
|
tabindex: "0",
|
|
1039
|
-
onKeydown:
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1620
|
+
onKeydown: Qe,
|
|
1621
|
+
onPointerdown: Je,
|
|
1622
|
+
onPointermove: Ye,
|
|
1623
|
+
onPointerup: Xe,
|
|
1624
|
+
onPointercancel: Xe
|
|
1043
1625
|
}, {
|
|
1044
1626
|
default: withCtx(() => [
|
|
1045
|
-
|
|
1046
|
-
|
|
1627
|
+
Ne.value ? (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
1628
|
+
class: "virtual-scroll-scrollbar-viewport",
|
|
1629
|
+
style: normalizeStyle({
|
|
1630
|
+
inlineSize: `${unref(z).displayViewportSize.width}px`,
|
|
1631
|
+
blockSize: `${unref(z).displayViewportSize.height}px`,
|
|
1632
|
+
"--vsi-scrollbar-has-cross-gap": o.direction === "both" ? 1 : 0
|
|
1633
|
+
})
|
|
1634
|
+
}, [k.scrollbar && et.value ? renderSlot(t.$slots, "scrollbar", normalizeProps(mergeProps({ key: 0 }, et.value)), void 0, !0) : et.value ? (openBlock(), createBlock(VirtualScrollbar_default, normalizeProps(mergeProps({ key: 1 }, et.value.scrollbarProps)), null, 16)) : createCommentVNode("", !0), k.scrollbar && tt.value ? renderSlot(t.$slots, "scrollbar", normalizeProps(mergeProps({ key: 2 }, tt.value)), void 0, !0) : tt.value ? (openBlock(), createBlock(VirtualScrollbar_default, normalizeProps(mergeProps({ key: 3 }, tt.value.scrollbarProps)), null, 16)) : createCommentVNode("", !0)], 4)])) : createCommentVNode("", !0),
|
|
1635
|
+
k.header ? (openBlock(), createBlock(resolveDynamicComponent(ct.value), {
|
|
1636
|
+
key: 1,
|
|
1047
1637
|
ref_key: "headerRef",
|
|
1048
|
-
ref:
|
|
1638
|
+
ref: M,
|
|
1049
1639
|
class: normalizeClass(["virtual-scroll-header", { "virtual-scroll--sticky": o.stickyHeader }])
|
|
1050
1640
|
}, {
|
|
1051
1641
|
default: withCtx(() => [renderSlot(t.$slots, "header", {}, void 0, !0)]),
|
|
@@ -1053,14 +1643,14 @@ var _hoisted_1 = {
|
|
|
1053
1643
|
}, 8, ["class"])) : createCommentVNode("", !0),
|
|
1054
1644
|
(openBlock(), createBlock(resolveDynamicComponent(o.wrapperTag), {
|
|
1055
1645
|
ref_key: "wrapperRef",
|
|
1056
|
-
ref:
|
|
1646
|
+
ref: j,
|
|
1057
1647
|
class: "virtual-scroll-wrapper",
|
|
1058
|
-
style: normalizeStyle(
|
|
1648
|
+
style: normalizeStyle(nt.value)
|
|
1059
1649
|
}, {
|
|
1060
|
-
default: withCtx(() => [
|
|
1650
|
+
default: withCtx(() => [st.value ? (openBlock(), createBlock(resolveDynamicComponent(o.itemTag), {
|
|
1061
1651
|
key: 0,
|
|
1062
1652
|
class: "virtual-scroll-spacer",
|
|
1063
|
-
style: normalizeStyle(
|
|
1653
|
+
style: normalizeStyle(it.value)
|
|
1064
1654
|
}, {
|
|
1065
1655
|
default: withCtx(() => [...s[0] ||= [createElementVNode("td", { style: {
|
|
1066
1656
|
padding: "0",
|
|
@@ -1068,25 +1658,30 @@ var _hoisted_1 = {
|
|
|
1068
1658
|
"block-size": "inherit"
|
|
1069
1659
|
} }, null, -1)]]),
|
|
1070
1660
|
_: 1
|
|
1071
|
-
}, 8, ["style"])) : createCommentVNode("", !0), (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1661
|
+
}, 8, ["style"])) : createCommentVNode("", !0), (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(R), (e) => (openBlock(), createBlock(resolveDynamicComponent(o.itemTag), {
|
|
1072
1662
|
key: e.index,
|
|
1073
1663
|
ref_for: !0,
|
|
1074
|
-
ref: (t) =>
|
|
1664
|
+
ref: (t) => ze(t, e.index),
|
|
1075
1665
|
"data-index": e.index,
|
|
1076
1666
|
class: normalizeClass(["virtual-scroll-item", {
|
|
1077
1667
|
"virtual-scroll--sticky": e.isStickyActive,
|
|
1078
|
-
"virtual-scroll--debug":
|
|
1668
|
+
"virtual-scroll--debug": ot.value
|
|
1079
1669
|
}]),
|
|
1080
|
-
style: normalizeStyle(
|
|
1670
|
+
style: normalizeStyle(at(e))
|
|
1081
1671
|
}, {
|
|
1082
1672
|
default: withCtx(() => [renderSlot(t.$slots, "item", {
|
|
1083
1673
|
item: e.item,
|
|
1084
1674
|
index: e.index,
|
|
1085
|
-
columnRange:
|
|
1675
|
+
columnRange: Fe.value,
|
|
1086
1676
|
getColumnWidth: unref(V),
|
|
1677
|
+
gap: _.gap,
|
|
1678
|
+
columnGap: _.columnGap,
|
|
1087
1679
|
isSticky: e.isSticky,
|
|
1088
|
-
isStickyActive: e.isStickyActive
|
|
1089
|
-
|
|
1680
|
+
isStickyActive: e.isStickyActive,
|
|
1681
|
+
isStickyActiveX: e.isStickyActiveX,
|
|
1682
|
+
isStickyActiveY: e.isStickyActiveY,
|
|
1683
|
+
offset: e.offset
|
|
1684
|
+
}, void 0, !0), ot.value ? (openBlock(), createElementBlock("div", _hoisted_2, " #" + toDisplayString(e.index) + " (" + toDisplayString(Math.round(e.offset.x)) + ", " + toDisplayString(Math.round(e.offset.y)) + ") ", 1)) : createCommentVNode("", !0)]),
|
|
1090
1685
|
_: 2
|
|
1091
1686
|
}, 1032, [
|
|
1092
1687
|
"data-index",
|
|
@@ -1095,15 +1690,15 @@ var _hoisted_1 = {
|
|
|
1095
1690
|
]))), 128))]),
|
|
1096
1691
|
_: 3
|
|
1097
1692
|
}, 8, ["style"])),
|
|
1098
|
-
o.loading &&
|
|
1099
|
-
key:
|
|
1693
|
+
o.loading && k.loading ? (openBlock(), createElementBlock("div", {
|
|
1694
|
+
key: 2,
|
|
1100
1695
|
class: "virtual-scroll-loading",
|
|
1101
|
-
style: normalizeStyle(
|
|
1696
|
+
style: normalizeStyle(rt.value)
|
|
1102
1697
|
}, [renderSlot(t.$slots, "loading", {}, void 0, !0)], 4)) : createCommentVNode("", !0),
|
|
1103
|
-
|
|
1104
|
-
key:
|
|
1698
|
+
k.footer ? (openBlock(), createBlock(resolveDynamicComponent(lt.value), {
|
|
1699
|
+
key: 3,
|
|
1105
1700
|
ref_key: "footerRef",
|
|
1106
|
-
ref:
|
|
1701
|
+
ref: N,
|
|
1107
1702
|
class: normalizeClass(["virtual-scroll-footer", { "virtual-scroll--sticky": o.stickyFooter }])
|
|
1108
1703
|
}, {
|
|
1109
1704
|
default: withCtx(() => [renderSlot(t.$slots, "footer", {}, void 0, !0)]),
|
|
@@ -1112,14 +1707,12 @@ var _hoisted_1 = {
|
|
|
1112
1707
|
]),
|
|
1113
1708
|
_: 3
|
|
1114
1709
|
}, 40, [
|
|
1710
|
+
"id",
|
|
1115
1711
|
"class",
|
|
1116
|
-
"style"
|
|
1117
|
-
"onWheelPassive",
|
|
1118
|
-
"onPointerdownPassive",
|
|
1119
|
-
"onTouchstartPassive"
|
|
1712
|
+
"style"
|
|
1120
1713
|
]));
|
|
1121
1714
|
}
|
|
1122
|
-
}), [["__scopeId", "data-v-
|
|
1123
|
-
export { DEFAULT_BUFFER, DEFAULT_COLUMN_WIDTH, DEFAULT_ITEM_SIZE, FenwickTree, VirtualScroll_default as VirtualScroll, calculateColumnRange, calculateItemPosition, calculateItemStyle, calculateRange, calculateScrollTarget, calculateStickyItem, calculateTotalSize, getPaddingX, getPaddingY, isBody, isElement, isScrollToIndexOptions, isScrollableElement, isWindow, isWindowLike, useVirtualScroll };
|
|
1715
|
+
}), [["__scopeId", "data-v-408dd72c"]]);
|
|
1716
|
+
export { BROWSER_MAX_SIZE, DEFAULT_BUFFER, DEFAULT_COLUMN_WIDTH, DEFAULT_ITEM_SIZE, EMPTY_SCROLL_DETAILS, FenwickTree, VirtualScroll_default as VirtualScroll, VirtualScrollbar_default as VirtualScrollbar, calculateColumnRange, calculateItemPosition, calculateItemStyle, calculateRange, calculateScrollTarget, calculateStickyItem, calculateTotalSize, displayToVirtual, findPrevStickyIndex, getPaddingX, getPaddingY, isBody, isElement, isItemVisible, isScrollToIndexOptions, isScrollableElement, isWindow, isWindowLike, scrollTo, useVirtualScroll, useVirtualScrollbar, virtualToDisplay };
|
|
1124
1717
|
|
|
1125
1718
|
//# sourceMappingURL=index.mjs.map
|