vue-virtual-flow 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/README.vi.md +42 -0
- package/dist/components/VirtualCarousel.d.cts +4 -0
- package/dist/components/VirtualCarousel.d.ts +4 -0
- package/dist/types.d.cts +6 -0
- package/dist/types.d.ts +6 -0
- package/dist/vue-virtual-flow.cjs +1 -1
- package/dist/vue-virtual-flow.js +921 -869
- package/package.json +1 -1
package/dist/vue-virtual-flow.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { watch as
|
|
2
|
-
function
|
|
1
|
+
import { watch as Z, defineComponent as ge, ref as P, computed as i, nextTick as k, onMounted as pe, onUpdated as ze, onBeforeUnmount as ye, openBlock as b, createElementBlock as S, normalizeStyle as A, createElementVNode as Be, renderSlot as le, createTextVNode as ve, createCommentVNode as he, Fragment as me, renderList as Me, unref as f, normalizeClass as $e, toDisplayString as ke } from "vue";
|
|
2
|
+
function Ee(n) {
|
|
3
3
|
return typeof n == "string" || typeof n == "number" || typeof n == "symbol";
|
|
4
4
|
}
|
|
5
|
-
function Ie(n,
|
|
6
|
-
const
|
|
7
|
-
return
|
|
5
|
+
function Ie(n, _) {
|
|
6
|
+
const H = n[_];
|
|
7
|
+
return Ee(H) ? H : void 0;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function Ve(n) {
|
|
10
10
|
return Ie(n, "id") ?? Ie(n, "key");
|
|
11
11
|
}
|
|
12
12
|
function xe(n) {
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
if (typeof
|
|
16
|
-
return
|
|
13
|
+
function _(e, I) {
|
|
14
|
+
const m = n.itemKey();
|
|
15
|
+
if (typeof m == "function")
|
|
16
|
+
return m(e, I);
|
|
17
17
|
if (e !== null && typeof e == "object") {
|
|
18
|
-
if (
|
|
19
|
-
const u = Ie(e,
|
|
18
|
+
if (m !== void 0) {
|
|
19
|
+
const u = Ie(e, m);
|
|
20
20
|
if (u !== void 0) return u;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
22
|
+
const w = Ve(e);
|
|
23
|
+
if (w !== void 0) return w;
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return I;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function H() {
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return Z(
|
|
30
30
|
() => [n.itemKey(), n.items()],
|
|
31
|
-
|
|
31
|
+
H,
|
|
32
32
|
{ immediate: !0 }
|
|
33
|
-
), { getItemKey:
|
|
33
|
+
), { getItemKey: _ };
|
|
34
34
|
}
|
|
35
35
|
function we(n) {
|
|
36
36
|
return n === "fill" ? "100%" : typeof n == "number" ? `${n}px` : n;
|
|
37
37
|
}
|
|
38
38
|
function be(n) {
|
|
39
|
-
return (
|
|
40
|
-
typeof
|
|
39
|
+
return (_, H) => {
|
|
40
|
+
typeof H == "string" && (H === "fill" || H.trim().endsWith("%"));
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
const Ke = ["aria-label"],
|
|
43
|
+
const Ke = ["aria-label"], De = {
|
|
44
44
|
key: 0,
|
|
45
45
|
class: "vue-chat-virtual-scroll__loading-older",
|
|
46
46
|
role: "status",
|
|
47
47
|
"aria-live": "polite"
|
|
48
|
-
},
|
|
48
|
+
}, Ce = ["aria-posinset", "aria-setsize"], Ae = /* @__PURE__ */ ge({
|
|
49
49
|
name: "ChatVirtualScroll",
|
|
50
50
|
__name: "ChatVirtualScroll",
|
|
51
51
|
props: {
|
|
@@ -63,304 +63,304 @@ const Ke = ["aria-label"], Ce = {
|
|
|
63
63
|
loadOlderThreshold: { default: 120 }
|
|
64
64
|
},
|
|
65
65
|
emits: ["scroll", "loadOlder", "bottomChange"],
|
|
66
|
-
setup(n, { expose:
|
|
67
|
-
const e = n,
|
|
68
|
-
let
|
|
69
|
-
const
|
|
66
|
+
setup(n, { expose: _, emit: H }) {
|
|
67
|
+
const e = n, I = H, m = P(), w = P(0), u = P(0), L = P(0), N = P(!0), R = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
68
|
+
let E, M, z = -1, T = !1;
|
|
69
|
+
const $ = be(), { getItemKey: F } = xe({
|
|
70
70
|
componentName: "ChatVirtualScroll",
|
|
71
71
|
items: () => e.items,
|
|
72
72
|
itemKey: () => e.itemKey
|
|
73
|
-
}),
|
|
73
|
+
}), Y = i(
|
|
74
74
|
() => Math.max(1, e.estimatedItemSize)
|
|
75
|
-
),
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
75
|
+
), J = i(() => Math.max(0, Math.floor(e.overscan))), ae = i(() => u.value > 0 ? u.value : typeof e.height == "number" ? Math.max(0, e.height) : Y.value), V = i(() => {
|
|
76
|
+
L.value;
|
|
77
|
+
const o = new Array(e.items.length + 1), d = new Array(e.items.length);
|
|
78
|
+
o[0] = 0;
|
|
79
79
|
for (let r = 0; r < e.items.length; r += 1) {
|
|
80
|
-
const
|
|
81
|
-
|
|
80
|
+
const K = F(e.items[r], r), D = R.get(K) ?? Y.value;
|
|
81
|
+
d[r] = D, o[r + 1] = o[r] + D;
|
|
82
82
|
}
|
|
83
83
|
return {
|
|
84
|
-
offsets:
|
|
85
|
-
sizes:
|
|
86
|
-
total:
|
|
84
|
+
offsets: o,
|
|
85
|
+
sizes: d,
|
|
86
|
+
total: o[e.items.length] ?? 0
|
|
87
87
|
};
|
|
88
|
-
}),
|
|
89
|
-
const
|
|
90
|
-
return e.items.forEach((
|
|
91
|
-
|
|
92
|
-
}),
|
|
88
|
+
}), x = i(() => {
|
|
89
|
+
const o = /* @__PURE__ */ new Map();
|
|
90
|
+
return e.items.forEach((d, r) => {
|
|
91
|
+
o.set(F(d, r), r);
|
|
92
|
+
}), o;
|
|
93
93
|
});
|
|
94
|
-
function
|
|
94
|
+
function j(o) {
|
|
95
95
|
if (e.items.length === 0) return 0;
|
|
96
|
-
const
|
|
97
|
-
let r = 0,
|
|
98
|
-
for (; r <
|
|
99
|
-
const
|
|
100
|
-
|
|
96
|
+
const d = V.value.offsets;
|
|
97
|
+
let r = 0, K = e.items.length;
|
|
98
|
+
for (; r < K; ) {
|
|
99
|
+
const D = Math.floor((r + K) / 2);
|
|
100
|
+
d[D + 1] <= o ? r = D + 1 : K = D;
|
|
101
101
|
}
|
|
102
102
|
return Math.min(r, e.items.length - 1);
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const q = i(
|
|
105
105
|
() => Math.max(
|
|
106
106
|
0,
|
|
107
|
-
|
|
107
|
+
j(w.value) - J.value
|
|
108
108
|
)
|
|
109
|
-
),
|
|
109
|
+
), Q = i(() => {
|
|
110
110
|
if (e.items.length === 0) return 0;
|
|
111
|
-
const
|
|
111
|
+
const o = j(w.value + ae.value) + 1;
|
|
112
112
|
return Math.min(
|
|
113
113
|
e.items.length,
|
|
114
|
-
|
|
114
|
+
o + J.value
|
|
115
115
|
);
|
|
116
|
-
}),
|
|
117
|
-
() => e.items.slice(
|
|
118
|
-
const r =
|
|
116
|
+
}), U = i(
|
|
117
|
+
() => e.items.slice(q.value, Q.value).map((o, d) => {
|
|
118
|
+
const r = q.value + d;
|
|
119
119
|
return {
|
|
120
|
-
item:
|
|
120
|
+
item: o,
|
|
121
121
|
index: r,
|
|
122
|
-
key: F(
|
|
123
|
-
top:
|
|
122
|
+
key: F(o, r),
|
|
123
|
+
top: V.value.offsets[r]
|
|
124
124
|
};
|
|
125
125
|
})
|
|
126
|
-
),
|
|
126
|
+
), ue = i(() => ({
|
|
127
127
|
height: we(e.height)
|
|
128
128
|
}));
|
|
129
|
-
function
|
|
130
|
-
const
|
|
131
|
-
if (!
|
|
129
|
+
function O() {
|
|
130
|
+
const o = m.value;
|
|
131
|
+
if (!o) return;
|
|
132
132
|
const r = Math.max(
|
|
133
133
|
0,
|
|
134
|
-
|
|
134
|
+
V.value.total - o.scrollTop - o.clientHeight
|
|
135
135
|
) <= Math.max(0, e.bottomThreshold);
|
|
136
|
-
r !==
|
|
136
|
+
r !== N.value && (N.value = r, T && I("bottomChange", r));
|
|
137
137
|
}
|
|
138
138
|
function c() {
|
|
139
|
-
var
|
|
140
|
-
u.value = ((
|
|
141
|
-
|
|
139
|
+
var o;
|
|
140
|
+
u.value = ((o = m.value) == null ? void 0 : o.clientHeight) ?? 0, $(m.value, e.height), k(() => {
|
|
141
|
+
O(), B();
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
146
|
-
scrollTop:
|
|
147
|
-
startIndex:
|
|
148
|
-
endIndex:
|
|
149
|
-
}),
|
|
150
|
-
}
|
|
151
|
-
function
|
|
152
|
-
const
|
|
153
|
-
!T || !
|
|
154
|
-
}
|
|
155
|
-
function
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
const r = Array.isArray(
|
|
144
|
+
function g(o) {
|
|
145
|
+
w.value = o.currentTarget.scrollTop, O(), I("scroll", {
|
|
146
|
+
scrollTop: w.value,
|
|
147
|
+
startIndex: q.value,
|
|
148
|
+
endIndex: Q.value
|
|
149
|
+
}), B();
|
|
150
|
+
}
|
|
151
|
+
function B() {
|
|
152
|
+
const o = m.value;
|
|
153
|
+
!T || !o || !e.hasOlder || e.loadingOlder || z === e.items.length || o.scrollTop <= Math.max(0, e.loadOlderThreshold) && (z = e.items.length, I("loadOlder"));
|
|
154
|
+
}
|
|
155
|
+
function oe(o) {
|
|
156
|
+
const d = o.borderBoxSize;
|
|
157
|
+
if (d) {
|
|
158
|
+
const r = Array.isArray(d) ? d[0] : d;
|
|
159
159
|
if (r != null && r.blockSize) return r.blockSize;
|
|
160
160
|
}
|
|
161
|
-
return
|
|
162
|
-
}
|
|
163
|
-
function
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
for (const
|
|
167
|
-
const
|
|
168
|
-
if (t === void 0 ||
|
|
169
|
-
const l =
|
|
170
|
-
if (Math.abs(l -
|
|
171
|
-
const
|
|
172
|
-
|
|
161
|
+
return o.contentRect.height;
|
|
162
|
+
}
|
|
163
|
+
function ne(o) {
|
|
164
|
+
const d = V.value, r = N.value && e.stickToBottom;
|
|
165
|
+
let K = 0, D = !1;
|
|
166
|
+
for (const W of o) {
|
|
167
|
+
const s = W.target, t = C.get(s), a = oe(W);
|
|
168
|
+
if (t === void 0 || a <= 0) continue;
|
|
169
|
+
const l = R.get(t) ?? Y.value;
|
|
170
|
+
if (Math.abs(l - a) < 0.5) continue;
|
|
171
|
+
const y = x.value.get(t);
|
|
172
|
+
y !== void 0 && d.offsets[y + 1] <= w.value && (K += a - l), R.set(t, a), D = !0;
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
174
|
+
D && (L.value += 1, k(() => {
|
|
175
|
+
const W = m.value;
|
|
176
|
+
W && (r ? h("auto") : K !== 0 && (W.scrollTop += K, w.value = W.scrollTop, O()));
|
|
177
177
|
}));
|
|
178
178
|
}
|
|
179
|
-
function se(
|
|
180
|
-
|
|
179
|
+
function se(o, d) {
|
|
180
|
+
o instanceof HTMLElement && (C.set(o, d), M == null || M.observe(o));
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
for (const [
|
|
184
|
-
|
|
182
|
+
function X() {
|
|
183
|
+
for (const [o] of C)
|
|
184
|
+
o.isConnected || (M == null || M.unobserve(o), C.delete(o));
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const r =
|
|
186
|
+
function ie(o, d = {}) {
|
|
187
|
+
const r = m.value;
|
|
188
188
|
if (!r) return;
|
|
189
|
-
const
|
|
190
|
-
Math.max(0, Number.isFinite(
|
|
191
|
-
|
|
192
|
-
),
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
function
|
|
196
|
-
const r =
|
|
189
|
+
const K = Math.max(0, V.value.total - r.clientHeight), D = Math.min(
|
|
190
|
+
Math.max(0, Number.isFinite(o) ? o : 0),
|
|
191
|
+
K
|
|
192
|
+
), W = d.behavior ?? "auto";
|
|
193
|
+
W === "auto" && (w.value = D), r.scrollTo({ ...d, top: D, behavior: W }), k(O);
|
|
194
|
+
}
|
|
195
|
+
function ee(o, d = {}) {
|
|
196
|
+
const r = m.value;
|
|
197
197
|
if (!r || e.items.length === 0) return;
|
|
198
|
-
const
|
|
198
|
+
const K = Math.min(
|
|
199
199
|
e.items.length - 1,
|
|
200
|
-
Math.max(0, Math.floor(
|
|
201
|
-
), { align:
|
|
202
|
-
let t =
|
|
203
|
-
|
|
204
|
-
const
|
|
200
|
+
Math.max(0, Math.floor(o))
|
|
201
|
+
), { align: D = "start", ...W } = d, s = V.value.sizes[K];
|
|
202
|
+
let t = V.value.offsets[K];
|
|
203
|
+
D === "center" ? t -= (r.clientHeight - s) / 2 : D === "end" && (t -= r.clientHeight - s);
|
|
204
|
+
const a = Math.max(
|
|
205
205
|
0,
|
|
206
|
-
Math.min(t,
|
|
207
|
-
), l =
|
|
206
|
+
Math.min(t, V.value.total - r.clientHeight)
|
|
207
|
+
), l = W.behavior ?? "auto", y = Math.max(
|
|
208
208
|
r.clientHeight * 3,
|
|
209
|
-
|
|
210
|
-
),
|
|
211
|
-
|
|
212
|
-
...
|
|
213
|
-
top:
|
|
214
|
-
behavior:
|
|
215
|
-
}),
|
|
216
|
-
}
|
|
217
|
-
function
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
function
|
|
222
|
-
const
|
|
223
|
-
if (!
|
|
224
|
-
const r = Math.max(0,
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
let
|
|
228
|
-
return
|
|
229
|
-
() => e.items.map((
|
|
230
|
-
async (
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
const r =
|
|
234
|
-
(l,
|
|
209
|
+
Y.value * 10
|
|
210
|
+
), p = l === "smooth" && Math.abs(a - r.scrollTop) > y ? "auto" : l;
|
|
211
|
+
p === "auto" && (w.value = a), r.scrollTo({
|
|
212
|
+
...W,
|
|
213
|
+
top: a,
|
|
214
|
+
behavior: p
|
|
215
|
+
}), k(O);
|
|
216
|
+
}
|
|
217
|
+
function de(o = "auto") {
|
|
218
|
+
const d = m.value;
|
|
219
|
+
d && (o === "auto" && (w.value = 0), d.scrollTo({ top: 0, behavior: o }), k(O));
|
|
220
|
+
}
|
|
221
|
+
function h(o = "auto") {
|
|
222
|
+
const d = m.value;
|
|
223
|
+
if (!d) return;
|
|
224
|
+
const r = Math.max(0, V.value.total - d.clientHeight);
|
|
225
|
+
o === "auto" ? (d.scrollTop = r, w.value = r) : d.scrollTo({ top: r, behavior: o }), k(O);
|
|
226
|
+
}
|
|
227
|
+
let v = e.items.map((o, d) => F(o, d));
|
|
228
|
+
return Z(
|
|
229
|
+
() => e.items.map((o, d) => F(o, d)),
|
|
230
|
+
async (o) => {
|
|
231
|
+
const d = v;
|
|
232
|
+
v = o;
|
|
233
|
+
const r = m.value, K = (r == null ? void 0 : r.scrollTop) ?? 0, D = N.value && e.stickToBottom, W = d[0], s = W === void 0 ? 0 : o.indexOf(W), t = s > 0 ? o.slice(0, s).reduce(
|
|
234
|
+
(l, y) => l + (R.get(y) ?? Y.value),
|
|
235
235
|
0
|
|
236
|
-
) : 0,
|
|
237
|
-
for (const l of
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
) : 0, a = new Set(o);
|
|
237
|
+
for (const l of R.keys())
|
|
238
|
+
a.has(l) || R.delete(l);
|
|
239
|
+
L.value += 1, await k(), r && (t > 0 ? (r.scrollTop = K + t, w.value = r.scrollTop) : o.length > d.length && D && h("auto"), O(), B());
|
|
240
240
|
}
|
|
241
|
-
),
|
|
241
|
+
), Z(
|
|
242
242
|
() => [e.hasOlder, e.loadingOlder],
|
|
243
|
-
async ([
|
|
244
|
-
|
|
243
|
+
async ([o]) => {
|
|
244
|
+
o || (z = -1), await k(), B();
|
|
245
245
|
}
|
|
246
246
|
), pe(() => {
|
|
247
247
|
if (c(), typeof ResizeObserver < "u") {
|
|
248
|
-
|
|
249
|
-
for (const [
|
|
250
|
-
|
|
248
|
+
E = new ResizeObserver(c), M = new ResizeObserver(ne), m.value && E.observe(m.value);
|
|
249
|
+
for (const [o] of C)
|
|
250
|
+
M.observe(o);
|
|
251
251
|
}
|
|
252
|
-
|
|
253
|
-
e.initialScroll === "bottom" &&
|
|
252
|
+
k(() => {
|
|
253
|
+
e.initialScroll === "bottom" && h("auto"), T = !0, O(), B();
|
|
254
254
|
});
|
|
255
|
-
}), ze(
|
|
256
|
-
|
|
257
|
-
}),
|
|
258
|
-
isAtBottom:
|
|
259
|
-
scrollTo:
|
|
260
|
-
scrollToIndex:
|
|
261
|
-
scrollToTop:
|
|
262
|
-
scrollToBottom:
|
|
263
|
-
}), (
|
|
255
|
+
}), ze(X), ye(() => {
|
|
256
|
+
E == null || E.disconnect(), M == null || M.disconnect(), C.clear();
|
|
257
|
+
}), _({
|
|
258
|
+
isAtBottom: N,
|
|
259
|
+
scrollTo: ie,
|
|
260
|
+
scrollToIndex: ee,
|
|
261
|
+
scrollToTop: de,
|
|
262
|
+
scrollToBottom: h
|
|
263
|
+
}), (o, d) => (b(), S("div", {
|
|
264
264
|
ref_key: "viewport",
|
|
265
|
-
ref:
|
|
265
|
+
ref: m,
|
|
266
266
|
class: "vue-chat-virtual-scroll",
|
|
267
|
-
style:
|
|
267
|
+
style: A(ue.value),
|
|
268
268
|
role: "log",
|
|
269
269
|
"aria-label": n.ariaLabel,
|
|
270
270
|
"aria-live": "polite",
|
|
271
271
|
tabindex: "0",
|
|
272
|
-
onScrollPassive:
|
|
272
|
+
onScrollPassive: g
|
|
273
273
|
}, [
|
|
274
|
-
n.loadingOlder ? (
|
|
274
|
+
n.loadingOlder ? (b(), S("div", De, [
|
|
275
275
|
Be("div", null, [
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
le(o.$slots, "loadingOlder", {}, () => [
|
|
277
|
+
d[0] || (d[0] = ve("Loading older messages…", -1))
|
|
278
278
|
])
|
|
279
279
|
])
|
|
280
280
|
])) : he("", !0),
|
|
281
|
-
n.items.length ? (
|
|
281
|
+
n.items.length ? (b(), S("div", {
|
|
282
282
|
key: 1,
|
|
283
283
|
class: "vue-chat-virtual-scroll__spacer",
|
|
284
|
-
style:
|
|
284
|
+
style: A({ height: `${V.value.total}px` })
|
|
285
285
|
}, [
|
|
286
|
-
(
|
|
287
|
-
key:
|
|
286
|
+
(b(!0), S(me, null, Me(U.value, ({ item: r, index: K, key: D, top: W }) => (b(), S("div", {
|
|
287
|
+
key: D,
|
|
288
288
|
ref_for: !0,
|
|
289
|
-
ref: (
|
|
289
|
+
ref: (s) => se(s, D),
|
|
290
290
|
class: "vue-chat-virtual-scroll__item",
|
|
291
|
-
style:
|
|
291
|
+
style: A({ transform: `translateY(${W}px)` }),
|
|
292
292
|
role: "article",
|
|
293
|
-
"aria-posinset":
|
|
293
|
+
"aria-posinset": K + 1,
|
|
294
294
|
"aria-setsize": n.items.length
|
|
295
295
|
}, [
|
|
296
|
-
|
|
296
|
+
le(o.$slots, "default", {
|
|
297
297
|
item: r,
|
|
298
|
-
index:
|
|
298
|
+
index: K
|
|
299
299
|
})
|
|
300
|
-
], 12,
|
|
301
|
-
], 4)) :
|
|
300
|
+
], 12, Ce))), 128))
|
|
301
|
+
], 4)) : le(o.$slots, "empty", {}, void 0, void 0, 2)
|
|
302
302
|
], 44, Ke));
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
305
|
function He(n) {
|
|
306
|
-
const
|
|
307
|
-
() => n.refreshing() ||
|
|
306
|
+
const _ = P(), H = P(0), e = P(!1), I = P(!1), m = i(() => Math.max(1, n.threshold())), w = i(
|
|
307
|
+
() => n.refreshing() || I.value ? m.value : H.value
|
|
308
308
|
), u = i(
|
|
309
|
-
() => Math.min(1,
|
|
310
|
-
),
|
|
311
|
-
function
|
|
312
|
-
|
|
309
|
+
() => Math.min(1, H.value / m.value)
|
|
310
|
+
), L = i(() => n.refreshing() || I.value ? "Refreshing…" : u.value >= 1 ? "Release to refresh" : "Pull to refresh");
|
|
311
|
+
function N() {
|
|
312
|
+
_.value = void 0, e.value = !1, H.value = 0;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
var
|
|
316
|
-
const
|
|
317
|
-
!n.enabled() || n.refreshing() || T > 0 ||
|
|
314
|
+
function R(M) {
|
|
315
|
+
var $;
|
|
316
|
+
const z = M.currentTarget, T = (($ = n.scrollTop) == null ? void 0 : $.call(n)) ?? z.scrollTop;
|
|
317
|
+
!n.enabled() || n.refreshing() || T > 0 || M.touches.length !== 1 || (_.value = M.touches[0].clientY, e.value = !0);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function C(M) {
|
|
320
320
|
var F;
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
if ((((F = n.scrollTop) == null ? void 0 : F.call(n)) ??
|
|
324
|
-
|
|
321
|
+
if (_.value === void 0 || !e.value) return;
|
|
322
|
+
const z = M.currentTarget;
|
|
323
|
+
if ((((F = n.scrollTop) == null ? void 0 : F.call(n)) ?? z.scrollTop) > 0 || M.touches.length !== 1) {
|
|
324
|
+
N();
|
|
325
325
|
return;
|
|
326
326
|
}
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
329
|
-
|
|
327
|
+
const $ = M.touches[0].clientY - _.value;
|
|
328
|
+
if ($ <= 0) {
|
|
329
|
+
H.value = 0;
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
M.preventDefault(), H.value = Math.min($ * 0.5, m.value * 2);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
if (
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
-
|
|
334
|
+
function E() {
|
|
335
|
+
if (_.value === void 0) return;
|
|
336
|
+
const M = H.value >= m.value && n.enabled() && !n.refreshing();
|
|
337
|
+
if (_.value = void 0, e.value = !1, !M) {
|
|
338
|
+
H.value = 0;
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
|
|
342
|
-
n.refreshing() || (
|
|
341
|
+
H.value = m.value, I.value = !0, n.onRefresh(), k(() => {
|
|
342
|
+
n.refreshing() || (I.value = !1, H.value = 0);
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
|
-
return
|
|
345
|
+
return Z(
|
|
346
346
|
() => n.refreshing(),
|
|
347
|
-
(
|
|
348
|
-
|
|
347
|
+
(M, z) => {
|
|
348
|
+
M ? (I.value = !1, H.value = m.value) : z && (I.value = !1, H.value = 0);
|
|
349
349
|
}
|
|
350
350
|
), {
|
|
351
351
|
pulling: e,
|
|
352
|
-
pullDistance:
|
|
353
|
-
pullOffset:
|
|
352
|
+
pullDistance: H,
|
|
353
|
+
pullOffset: w,
|
|
354
354
|
pullProgress: u,
|
|
355
|
-
refreshMessage:
|
|
356
|
-
refreshThreshold:
|
|
357
|
-
handleTouchStart:
|
|
358
|
-
handleTouchMove:
|
|
359
|
-
handleTouchEnd:
|
|
360
|
-
handleTouchCancel:
|
|
355
|
+
refreshMessage: L,
|
|
356
|
+
refreshThreshold: m,
|
|
357
|
+
handleTouchStart: R,
|
|
358
|
+
handleTouchMove: C,
|
|
359
|
+
handleTouchEnd: E,
|
|
360
|
+
handleTouchCancel: N
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
const
|
|
363
|
+
const Re = ["aria-label"], Pe = ["aria-posinset", "aria-setsize"], Le = /* @__PURE__ */ ge({
|
|
364
364
|
name: "DynamicVirtualScroll",
|
|
365
365
|
__name: "DynamicVirtualScroll",
|
|
366
366
|
props: {
|
|
@@ -379,292 +379,292 @@ const Ae = ["aria-label"], Pe = ["aria-posinset", "aria-setsize"], Le = /* @__PU
|
|
|
379
379
|
pullRefreshThreshold: { default: 64 }
|
|
380
380
|
},
|
|
381
381
|
emits: ["scroll", "loadMore", "refresh"],
|
|
382
|
-
setup(n, { expose:
|
|
383
|
-
const e = n,
|
|
384
|
-
pulling:
|
|
385
|
-
pullDistance:
|
|
382
|
+
setup(n, { expose: _, emit: H }) {
|
|
383
|
+
const e = n, I = H, {
|
|
384
|
+
pulling: m,
|
|
385
|
+
pullDistance: w,
|
|
386
386
|
pullOffset: u,
|
|
387
|
-
pullProgress:
|
|
388
|
-
refreshMessage:
|
|
389
|
-
refreshThreshold:
|
|
390
|
-
handleTouchStart:
|
|
391
|
-
handleTouchMove:
|
|
392
|
-
handleTouchEnd:
|
|
393
|
-
handleTouchCancel:
|
|
387
|
+
pullProgress: L,
|
|
388
|
+
refreshMessage: N,
|
|
389
|
+
refreshThreshold: R,
|
|
390
|
+
handleTouchStart: C,
|
|
391
|
+
handleTouchMove: E,
|
|
392
|
+
handleTouchEnd: M,
|
|
393
|
+
handleTouchCancel: z
|
|
394
394
|
} = He({
|
|
395
395
|
enabled: () => e.pullToRefresh,
|
|
396
396
|
refreshing: () => e.refreshing,
|
|
397
397
|
threshold: () => e.pullRefreshThreshold,
|
|
398
|
-
onRefresh: () =>
|
|
399
|
-
}), T =
|
|
400
|
-
let
|
|
401
|
-
const
|
|
398
|
+
onRefresh: () => I("refresh")
|
|
399
|
+
}), T = P(), $ = P(0), F = P(0), Y = P(0), J = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map();
|
|
400
|
+
let V, x, j = -1;
|
|
401
|
+
const q = be(), { getItemKey: Q } = xe({
|
|
402
402
|
componentName: "DynamicVirtualScroll",
|
|
403
403
|
items: () => e.items,
|
|
404
404
|
itemKey: () => e.itemKey
|
|
405
|
-
}),
|
|
405
|
+
}), U = i(
|
|
406
406
|
() => Math.max(1, e.estimatedItemSize)
|
|
407
|
-
),
|
|
408
|
-
() => Math.max(1, e.loadingItemSize ??
|
|
409
|
-
),
|
|
410
|
-
|
|
411
|
-
const t = new Array(e.items.length + 1),
|
|
407
|
+
), ue = i(
|
|
408
|
+
() => Math.max(1, e.loadingItemSize ?? U.value)
|
|
409
|
+
), O = i(() => Math.max(0, Math.floor(e.overscan))), c = i(() => F.value > 0 ? F.value : typeof e.height == "number" ? Math.max(0, e.height) : U.value), g = i(() => {
|
|
410
|
+
Y.value;
|
|
411
|
+
const t = new Array(e.items.length + 1), a = new Array(e.items.length);
|
|
412
412
|
t[0] = 0;
|
|
413
413
|
for (let l = 0; l < e.items.length; l += 1) {
|
|
414
|
-
const
|
|
415
|
-
|
|
414
|
+
const y = Q(e.items[l], l), p = J.get(y) ?? U.value;
|
|
415
|
+
a[l] = p, t[l + 1] = t[l] + p;
|
|
416
416
|
}
|
|
417
417
|
return {
|
|
418
418
|
offsets: t,
|
|
419
|
-
sizes:
|
|
419
|
+
sizes: a,
|
|
420
420
|
total: t[e.items.length] ?? 0
|
|
421
421
|
};
|
|
422
|
-
}),
|
|
423
|
-
() =>
|
|
424
|
-
),
|
|
422
|
+
}), B = i(
|
|
423
|
+
() => g.value.total + (e.loading ? ue.value : 0)
|
|
424
|
+
), oe = i(() => {
|
|
425
425
|
const t = /* @__PURE__ */ new Map();
|
|
426
|
-
return e.items.forEach((
|
|
427
|
-
t.set(
|
|
426
|
+
return e.items.forEach((a, l) => {
|
|
427
|
+
t.set(Q(a, l), l);
|
|
428
428
|
}), t;
|
|
429
429
|
});
|
|
430
|
-
function
|
|
430
|
+
function ne(t) {
|
|
431
431
|
if (e.items.length === 0) return 0;
|
|
432
|
-
const
|
|
433
|
-
let l = 0,
|
|
434
|
-
for (; l <
|
|
435
|
-
const
|
|
436
|
-
|
|
432
|
+
const a = g.value.offsets;
|
|
433
|
+
let l = 0, y = e.items.length;
|
|
434
|
+
for (; l < y; ) {
|
|
435
|
+
const p = Math.floor((l + y) / 2);
|
|
436
|
+
a[p + 1] <= t ? l = p + 1 : y = p;
|
|
437
437
|
}
|
|
438
438
|
return Math.min(l, e.items.length - 1);
|
|
439
439
|
}
|
|
440
440
|
const se = i(
|
|
441
441
|
() => Math.max(
|
|
442
442
|
0,
|
|
443
|
-
|
|
443
|
+
ne($.value) - O.value
|
|
444
444
|
)
|
|
445
|
-
),
|
|
445
|
+
), X = i(() => {
|
|
446
446
|
if (e.items.length === 0) return 0;
|
|
447
|
-
const t =
|
|
447
|
+
const t = ne($.value + c.value) + 1;
|
|
448
448
|
return Math.min(
|
|
449
449
|
e.items.length,
|
|
450
|
-
t +
|
|
450
|
+
t + O.value
|
|
451
451
|
);
|
|
452
|
-
}),
|
|
453
|
-
() => e.items.slice(se.value,
|
|
454
|
-
const l = se.value +
|
|
452
|
+
}), ie = i(
|
|
453
|
+
() => e.items.slice(se.value, X.value).map((t, a) => {
|
|
454
|
+
const l = se.value + a;
|
|
455
455
|
return {
|
|
456
456
|
item: t,
|
|
457
457
|
index: l,
|
|
458
|
-
key:
|
|
459
|
-
top:
|
|
458
|
+
key: Q(t, l),
|
|
459
|
+
top: g.value.offsets[l]
|
|
460
460
|
};
|
|
461
461
|
})
|
|
462
|
-
),
|
|
462
|
+
), ee = i(() => ({
|
|
463
463
|
height: we(e.height)
|
|
464
464
|
}));
|
|
465
|
-
function
|
|
465
|
+
function de() {
|
|
466
466
|
var t;
|
|
467
|
-
F.value = ((t = T.value) == null ? void 0 : t.clientHeight) ?? 0,
|
|
467
|
+
F.value = ((t = T.value) == null ? void 0 : t.clientHeight) ?? 0, q(T.value, e.height), k(v);
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
|
|
471
|
-
scrollTop:
|
|
469
|
+
function h(t) {
|
|
470
|
+
$.value = t.currentTarget.scrollTop, I("scroll", {
|
|
471
|
+
scrollTop: $.value,
|
|
472
472
|
startIndex: se.value,
|
|
473
|
-
endIndex:
|
|
474
|
-
}),
|
|
473
|
+
endIndex: X.value
|
|
474
|
+
}), v();
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function v() {
|
|
477
477
|
const t = T.value;
|
|
478
|
-
if (!t || !e.hasMore || e.loading ||
|
|
478
|
+
if (!t || !e.hasMore || e.loading || j === e.items.length)
|
|
479
479
|
return;
|
|
480
|
-
const
|
|
481
|
-
|
|
480
|
+
const a = Math.max(0, e.loadMoreThreshold);
|
|
481
|
+
B.value - t.scrollTop - t.clientHeight <= a && (j = e.items.length, I("loadMore"));
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
486
|
-
const l = Array.isArray(
|
|
483
|
+
function o(t) {
|
|
484
|
+
const a = t.borderBoxSize;
|
|
485
|
+
if (a) {
|
|
486
|
+
const l = Array.isArray(a) ? a[0] : a;
|
|
487
487
|
if (l != null && l.blockSize) return l.blockSize;
|
|
488
488
|
}
|
|
489
489
|
return t.contentRect.height;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
const
|
|
493
|
-
let l = 0,
|
|
494
|
-
for (const
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
-
const ce =
|
|
498
|
-
if (Math.abs(ce -
|
|
499
|
-
const
|
|
500
|
-
|
|
491
|
+
function d(t) {
|
|
492
|
+
const a = g.value;
|
|
493
|
+
let l = 0, y = !1;
|
|
494
|
+
for (const p of t) {
|
|
495
|
+
const te = p.target, G = ae.get(te), re = o(p);
|
|
496
|
+
if (G === void 0 || re <= 0) continue;
|
|
497
|
+
const ce = J.get(G) ?? U.value;
|
|
498
|
+
if (Math.abs(ce - re) < 0.5) continue;
|
|
499
|
+
const fe = oe.value.get(G);
|
|
500
|
+
fe !== void 0 && a.offsets[fe + 1] <= $.value && (l += re - ce), J.set(G, re), y = !0;
|
|
501
501
|
}
|
|
502
|
-
|
|
503
|
-
const
|
|
504
|
-
|
|
502
|
+
y && (Y.value += 1, k(v), l !== 0 && k(() => {
|
|
503
|
+
const p = T.value;
|
|
504
|
+
p && (p.scrollTop += l, $.value = p.scrollTop);
|
|
505
505
|
}));
|
|
506
506
|
}
|
|
507
|
-
function r(t,
|
|
508
|
-
t instanceof HTMLElement && (
|
|
507
|
+
function r(t, a) {
|
|
508
|
+
t instanceof HTMLElement && (ae.set(t, a), x == null || x.observe(t));
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
for (const [t] of
|
|
512
|
-
t.isConnected || (
|
|
510
|
+
function K() {
|
|
511
|
+
for (const [t] of ae)
|
|
512
|
+
t.isConnected || (x == null || x.unobserve(t), ae.delete(t));
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function D(t, a = {}) {
|
|
515
515
|
const l = T.value;
|
|
516
516
|
if (!l) return;
|
|
517
|
-
const
|
|
517
|
+
const y = Math.max(0, B.value - l.clientHeight), p = Math.min(
|
|
518
518
|
Math.max(0, Number.isFinite(t) ? t : 0),
|
|
519
|
-
|
|
520
|
-
),
|
|
521
|
-
|
|
519
|
+
y
|
|
520
|
+
), te = a.behavior ?? "auto";
|
|
521
|
+
te === "auto" && ($.value = p), l.scrollTo({ ...a, top: p, behavior: te });
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function W(t, a = {}) {
|
|
524
524
|
const l = T.value;
|
|
525
525
|
if (!l || e.items.length === 0) return;
|
|
526
|
-
const
|
|
526
|
+
const y = Math.min(
|
|
527
527
|
e.items.length - 1,
|
|
528
528
|
Math.max(0, Math.floor(t))
|
|
529
|
-
), { align:
|
|
530
|
-
let
|
|
531
|
-
const
|
|
532
|
-
|
|
529
|
+
), { align: p = "start", ...te } = a;
|
|
530
|
+
let G = g.value.offsets[y];
|
|
531
|
+
const re = g.value.sizes[y];
|
|
532
|
+
p === "center" ? G -= (l.clientHeight - re) / 2 : p === "end" && (G -= l.clientHeight - re);
|
|
533
533
|
const ce = Math.max(
|
|
534
534
|
0,
|
|
535
|
-
Math.min(
|
|
536
|
-
),
|
|
535
|
+
Math.min(G, B.value - l.clientHeight)
|
|
536
|
+
), fe = te.behavior ?? "auto", Se = Math.max(
|
|
537
537
|
l.clientHeight * 3,
|
|
538
|
-
|
|
539
|
-
), Te =
|
|
540
|
-
Te === "auto" && (
|
|
541
|
-
...
|
|
538
|
+
U.value * 10
|
|
539
|
+
), Te = fe === "smooth" && Math.abs(ce - l.scrollTop) > Se ? "auto" : fe;
|
|
540
|
+
Te === "auto" && ($.value = ce), l.scrollTo({
|
|
541
|
+
...te,
|
|
542
542
|
top: ce,
|
|
543
543
|
behavior: Te
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
var
|
|
548
|
-
(
|
|
546
|
+
function s(t = "auto") {
|
|
547
|
+
var a;
|
|
548
|
+
(a = T.value) == null || a.scrollTo({ top: 0, behavior: t });
|
|
549
549
|
}
|
|
550
|
-
return
|
|
550
|
+
return Z(
|
|
551
551
|
() => e.itemKey,
|
|
552
552
|
() => {
|
|
553
|
-
|
|
553
|
+
J.clear(), Y.value += 1;
|
|
554
554
|
}
|
|
555
|
-
),
|
|
555
|
+
), Z(
|
|
556
556
|
() => e.items.length,
|
|
557
557
|
async () => {
|
|
558
558
|
const t = new Set(
|
|
559
|
-
e.items.map((
|
|
559
|
+
e.items.map((y, p) => Q(y, p))
|
|
560
560
|
);
|
|
561
|
-
for (const
|
|
562
|
-
t.has(
|
|
563
|
-
|
|
564
|
-
const
|
|
565
|
-
if (!
|
|
566
|
-
const l = Math.max(0,
|
|
567
|
-
|
|
561
|
+
for (const y of J.keys())
|
|
562
|
+
t.has(y) || J.delete(y);
|
|
563
|
+
Y.value += 1, await k();
|
|
564
|
+
const a = T.value;
|
|
565
|
+
if (!a) return;
|
|
566
|
+
const l = Math.max(0, B.value - a.clientHeight);
|
|
567
|
+
a.scrollTop > l && (a.scrollTop = l, $.value = l), v();
|
|
568
568
|
}
|
|
569
|
-
),
|
|
569
|
+
), Z(
|
|
570
570
|
() => [e.hasMore, e.loading],
|
|
571
571
|
async ([t]) => {
|
|
572
|
-
t || (
|
|
572
|
+
t || (j = -1), await k(), v();
|
|
573
573
|
}
|
|
574
574
|
), pe(() => {
|
|
575
|
-
if (
|
|
576
|
-
|
|
577
|
-
for (const [t] of
|
|
578
|
-
|
|
575
|
+
if (de(), typeof ResizeObserver < "u") {
|
|
576
|
+
V = new ResizeObserver(de), x = new ResizeObserver(d), T.value && V.observe(T.value);
|
|
577
|
+
for (const [t] of ae)
|
|
578
|
+
x.observe(t);
|
|
579
579
|
}
|
|
580
|
-
|
|
581
|
-
}), ze(
|
|
582
|
-
|
|
583
|
-
}),
|
|
584
|
-
scrollTo:
|
|
585
|
-
scrollToIndex:
|
|
586
|
-
scrollToTop:
|
|
587
|
-
}), (t,
|
|
580
|
+
k(v);
|
|
581
|
+
}), ze(K), ye(() => {
|
|
582
|
+
V == null || V.disconnect(), x == null || x.disconnect(), ae.clear();
|
|
583
|
+
}), _({
|
|
584
|
+
scrollTo: D,
|
|
585
|
+
scrollToIndex: W,
|
|
586
|
+
scrollToTop: s
|
|
587
|
+
}), (t, a) => (b(), S("div", {
|
|
588
588
|
ref_key: "viewport",
|
|
589
589
|
ref: T,
|
|
590
|
-
class: $e(["vue-dynamic-virtual-scroll", { "vue-dynamic-virtual-scroll--pulling": m
|
|
591
|
-
style:
|
|
590
|
+
class: $e(["vue-dynamic-virtual-scroll", { "vue-dynamic-virtual-scroll--pulling": f(m) }]),
|
|
591
|
+
style: A(ee.value),
|
|
592
592
|
role: "list",
|
|
593
593
|
"aria-label": n.ariaLabel,
|
|
594
594
|
tabindex: "0",
|
|
595
|
-
onScrollPassive:
|
|
596
|
-
onTouchstartPassive:
|
|
597
|
-
(...l) =>
|
|
598
|
-
onTouchmove:
|
|
599
|
-
(...l) =>
|
|
600
|
-
onTouchend:
|
|
601
|
-
(...l) =>
|
|
602
|
-
onTouchcancel:
|
|
603
|
-
(...l) =>
|
|
595
|
+
onScrollPassive: h,
|
|
596
|
+
onTouchstartPassive: a[0] || (a[0] = //@ts-ignore
|
|
597
|
+
(...l) => f(C) && f(C)(...l)),
|
|
598
|
+
onTouchmove: a[1] || (a[1] = //@ts-ignore
|
|
599
|
+
(...l) => f(E) && f(E)(...l)),
|
|
600
|
+
onTouchend: a[2] || (a[2] = //@ts-ignore
|
|
601
|
+
(...l) => f(M) && f(M)(...l)),
|
|
602
|
+
onTouchcancel: a[3] || (a[3] = //@ts-ignore
|
|
603
|
+
(...l) => f(z) && f(z)(...l))
|
|
604
604
|
}, [
|
|
605
|
-
n.pullToRefresh || n.refreshing ? (
|
|
605
|
+
n.pullToRefresh || n.refreshing ? (b(), S("div", {
|
|
606
606
|
key: 0,
|
|
607
607
|
class: "vue-dynamic-virtual-scroll__refresh",
|
|
608
|
-
style:
|
|
609
|
-
height: `${
|
|
610
|
-
transform: `translateY(${
|
|
608
|
+
style: A({
|
|
609
|
+
height: `${f(R)}px`,
|
|
610
|
+
transform: `translateY(${f(u) - f(R)}px)`
|
|
611
611
|
}),
|
|
612
612
|
role: "status",
|
|
613
613
|
"aria-live": "polite"
|
|
614
614
|
}, [
|
|
615
|
-
|
|
616
|
-
pullDistance:
|
|
617
|
-
progress:
|
|
615
|
+
le(t.$slots, "refresh", {
|
|
616
|
+
pullDistance: f(w),
|
|
617
|
+
progress: f(L),
|
|
618
618
|
refreshing: n.refreshing
|
|
619
619
|
}, () => [
|
|
620
|
-
|
|
620
|
+
ve(ke(f(N)), 1)
|
|
621
621
|
])
|
|
622
622
|
], 4)) : he("", !0),
|
|
623
|
-
n.items.length || n.loading ? (
|
|
623
|
+
n.items.length || n.loading ? (b(), S("div", {
|
|
624
624
|
key: 1,
|
|
625
625
|
class: "vue-dynamic-virtual-scroll__spacer",
|
|
626
|
-
style:
|
|
627
|
-
height: `${
|
|
628
|
-
transform: `translateY(${
|
|
626
|
+
style: A({
|
|
627
|
+
height: `${B.value}px`,
|
|
628
|
+
transform: `translateY(${f(u)}px)`
|
|
629
629
|
})
|
|
630
630
|
}, [
|
|
631
|
-
(
|
|
632
|
-
key:
|
|
631
|
+
(b(!0), S(me, null, Me(ie.value, ({ item: l, index: y, key: p, top: te }) => (b(), S("div", {
|
|
632
|
+
key: p,
|
|
633
633
|
ref_for: !0,
|
|
634
|
-
ref: (
|
|
634
|
+
ref: (G) => r(G, p),
|
|
635
635
|
class: "vue-dynamic-virtual-scroll__item",
|
|
636
|
-
style:
|
|
636
|
+
style: A({ transform: `translateY(${te}px)` }),
|
|
637
637
|
role: "listitem",
|
|
638
|
-
"aria-posinset":
|
|
638
|
+
"aria-posinset": y + 1,
|
|
639
639
|
"aria-setsize": n.items.length
|
|
640
640
|
}, [
|
|
641
|
-
|
|
641
|
+
le(t.$slots, "default", {
|
|
642
642
|
item: l,
|
|
643
|
-
index:
|
|
643
|
+
index: y
|
|
644
644
|
})
|
|
645
645
|
], 12, Pe))), 128)),
|
|
646
|
-
n.loading ? (
|
|
646
|
+
n.loading ? (b(), S("div", {
|
|
647
647
|
key: 0,
|
|
648
648
|
class: "vue-dynamic-virtual-scroll__loading",
|
|
649
|
-
style:
|
|
650
|
-
height: `${
|
|
651
|
-
transform: `translateY(${
|
|
649
|
+
style: A({
|
|
650
|
+
height: `${ue.value}px`,
|
|
651
|
+
transform: `translateY(${g.value.total}px)`
|
|
652
652
|
}),
|
|
653
653
|
role: "status",
|
|
654
654
|
"aria-live": "polite"
|
|
655
655
|
}, [
|
|
656
|
-
|
|
657
|
-
|
|
656
|
+
le(t.$slots, "loading", {}, () => [
|
|
657
|
+
a[4] || (a[4] = ve("Loading more…", -1))
|
|
658
658
|
])
|
|
659
659
|
], 4)) : he("", !0)
|
|
660
|
-
], 4)) : (
|
|
660
|
+
], 4)) : (b(), S("div", {
|
|
661
661
|
key: 2,
|
|
662
662
|
class: "vue-dynamic-virtual-scroll__empty",
|
|
663
|
-
style:
|
|
663
|
+
style: A({ transform: `translateY(${f(u)}px)` })
|
|
664
664
|
}, [
|
|
665
|
-
|
|
665
|
+
le(t.$slots, "empty")
|
|
666
666
|
], 4))
|
|
667
|
-
], 46,
|
|
667
|
+
], 46, Re));
|
|
668
668
|
}
|
|
669
669
|
}), Oe = ["aria-label"], Ne = ["aria-current", "aria-posinset", "aria-setsize"], Ye = {
|
|
670
670
|
key: 1,
|
|
@@ -684,151 +684,151 @@ const Ae = ["aria-label"], Pe = ["aria-posinset", "aria-setsize"], Le = /* @__PU
|
|
|
684
684
|
loadMoreThreshold: { default: 2 }
|
|
685
685
|
},
|
|
686
686
|
emits: ["update:activeIndex", "change", "reachStart", "reachEnd", "loadMore"],
|
|
687
|
-
setup(n, { expose:
|
|
688
|
-
const e = n,
|
|
689
|
-
let
|
|
690
|
-
const
|
|
687
|
+
setup(n, { expose: _, emit: H }) {
|
|
688
|
+
const e = n, I = H, m = P(), w = P(0), u = P(V(e.activeIndex));
|
|
689
|
+
let L, N = -1;
|
|
690
|
+
const R = be(), { getItemKey: C } = xe({
|
|
691
691
|
componentName: "ShortMediaFeed",
|
|
692
692
|
items: () => e.items,
|
|
693
693
|
itemKey: () => e.itemKey
|
|
694
|
-
}),
|
|
694
|
+
}), E = i(
|
|
695
695
|
() => Math.max(0, Math.floor(e.buffer))
|
|
696
|
-
),
|
|
696
|
+
), M = i(
|
|
697
697
|
() => Math.max(
|
|
698
698
|
0,
|
|
699
699
|
Math.floor(
|
|
700
700
|
Number.isFinite(e.loadMoreThreshold) ? e.loadMoreThreshold : 0
|
|
701
701
|
)
|
|
702
702
|
)
|
|
703
|
-
),
|
|
704
|
-
() => Math.max(0, u.value -
|
|
705
|
-
),
|
|
703
|
+
), z = i(() => w.value > 0 ? w.value : typeof e.height == "number" ? Math.max(1, e.height) : 0), T = i(
|
|
704
|
+
() => Math.max(0, u.value - E.value)
|
|
705
|
+
), $ = i(
|
|
706
706
|
() => Math.min(
|
|
707
707
|
e.items.length,
|
|
708
|
-
u.value +
|
|
708
|
+
u.value + E.value + 1
|
|
709
709
|
)
|
|
710
710
|
), F = i(
|
|
711
|
-
() => e.items.slice(T.value,
|
|
711
|
+
() => e.items.slice(T.value, $.value).map((c, g) => ({
|
|
712
712
|
item: c,
|
|
713
|
-
index: T.value +
|
|
713
|
+
index: T.value + g
|
|
714
714
|
}))
|
|
715
|
-
),
|
|
716
|
-
() => (e.items.length -
|
|
717
|
-
),
|
|
715
|
+
), Y = i(() => T.value * z.value), J = i(
|
|
716
|
+
() => (e.items.length - $.value) * z.value
|
|
717
|
+
), ae = i(() => ({
|
|
718
718
|
height: we(e.height)
|
|
719
719
|
}));
|
|
720
|
-
function
|
|
720
|
+
function V(c) {
|
|
721
721
|
return e.items.length === 0 ? 0 : Math.min(
|
|
722
722
|
e.items.length - 1,
|
|
723
723
|
Math.max(0, Math.floor(Number.isFinite(c) ? c : 0))
|
|
724
724
|
);
|
|
725
725
|
}
|
|
726
|
-
function
|
|
727
|
-
if (!e.hasMore || e.loading ||
|
|
726
|
+
function x() {
|
|
727
|
+
if (!e.hasMore || e.loading || N === e.items.length)
|
|
728
728
|
return;
|
|
729
|
-
(e.items.length === 0 ? 0 : e.items.length - 1 - u.value) <=
|
|
729
|
+
(e.items.length === 0 ? 0 : e.items.length - 1 - u.value) <= M.value && (N = e.items.length, I("loadMore"));
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
index:
|
|
735
|
-
item: e.items[
|
|
736
|
-
}),
|
|
731
|
+
function j(c) {
|
|
732
|
+
const g = V(c);
|
|
733
|
+
g === u.value || e.items.length === 0 || (u.value = g, I("update:activeIndex", g), I("change", {
|
|
734
|
+
index: g,
|
|
735
|
+
item: e.items[g]
|
|
736
|
+
}), g === 0 && I("reachStart"), g === e.items.length - 1 && I("reachEnd"), x());
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
const
|
|
740
|
-
|
|
738
|
+
function q(c, g = {}) {
|
|
739
|
+
const B = m.value;
|
|
740
|
+
B && (typeof B.scrollTo == "function" ? B.scrollTo({ ...g, top: c }) : B.scrollTop = c);
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function Q(c, g = {}) {
|
|
743
743
|
if (e.items.length === 0) return;
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
-
function
|
|
748
|
-
if (
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
}
|
|
752
|
-
function
|
|
753
|
-
let
|
|
754
|
-
c.key === "ArrowDown" || c.key === "PageDown" ?
|
|
755
|
-
}
|
|
756
|
-
function
|
|
757
|
-
var
|
|
758
|
-
const c = ((
|
|
759
|
-
|
|
760
|
-
|
|
744
|
+
const B = V(c);
|
|
745
|
+
j(B), q(B * z.value, g);
|
|
746
|
+
}
|
|
747
|
+
function U(c) {
|
|
748
|
+
if (z.value <= 0) return;
|
|
749
|
+
const g = c.currentTarget.scrollTop;
|
|
750
|
+
j(Math.round(g / z.value));
|
|
751
|
+
}
|
|
752
|
+
function ue(c) {
|
|
753
|
+
let g;
|
|
754
|
+
c.key === "ArrowDown" || c.key === "PageDown" ? g = u.value + 1 : c.key === "ArrowUp" || c.key === "PageUp" ? g = u.value - 1 : c.key === "Home" ? g = 0 : c.key === "End" && (g = e.items.length - 1), g !== void 0 && (c.preventDefault(), Q(g, { behavior: "smooth" }));
|
|
755
|
+
}
|
|
756
|
+
function O() {
|
|
757
|
+
var g;
|
|
758
|
+
const c = ((g = m.value) == null ? void 0 : g.clientHeight) ?? 0;
|
|
759
|
+
R(m.value, e.height), !(c <= 0 || c === w.value) && (w.value = c, k(() => {
|
|
760
|
+
q(u.value * c);
|
|
761
761
|
}));
|
|
762
762
|
}
|
|
763
|
-
return
|
|
763
|
+
return Z(
|
|
764
764
|
() => e.activeIndex,
|
|
765
765
|
async (c) => {
|
|
766
|
-
const
|
|
767
|
-
|
|
766
|
+
const g = V(c);
|
|
767
|
+
g !== u.value && (u.value = g, await k(), q(g * z.value), x());
|
|
768
768
|
}
|
|
769
|
-
),
|
|
769
|
+
), Z(
|
|
770
770
|
() => [
|
|
771
771
|
e.hasMore,
|
|
772
772
|
e.loading,
|
|
773
773
|
e.loadMoreThreshold
|
|
774
774
|
],
|
|
775
775
|
async ([c]) => {
|
|
776
|
-
c || (
|
|
776
|
+
c || (N = -1), await k(), x();
|
|
777
777
|
}
|
|
778
|
-
),
|
|
778
|
+
), Z(
|
|
779
779
|
() => e.items.length,
|
|
780
780
|
async () => {
|
|
781
|
-
const c =
|
|
782
|
-
e.items.length === 0 ? u.value !== 0 && (u.value = 0,
|
|
781
|
+
const c = V(u.value);
|
|
782
|
+
e.items.length === 0 ? u.value !== 0 && (u.value = 0, I("update:activeIndex", 0)) : j(c), await k(), q(c * z.value), x();
|
|
783
783
|
}
|
|
784
784
|
), pe(async () => {
|
|
785
|
-
|
|
785
|
+
O(), typeof ResizeObserver < "u" && m.value && (L = new ResizeObserver(O), L.observe(m.value)), await k(), q(u.value * z.value), x();
|
|
786
786
|
}), ye(() => {
|
|
787
|
-
|
|
788
|
-
}),
|
|
789
|
-
scrollToIndex:
|
|
790
|
-
}), (c,
|
|
787
|
+
L == null || L.disconnect();
|
|
788
|
+
}), _({
|
|
789
|
+
scrollToIndex: Q
|
|
790
|
+
}), (c, g) => (b(), S("div", {
|
|
791
791
|
ref_key: "viewport",
|
|
792
|
-
ref:
|
|
792
|
+
ref: m,
|
|
793
793
|
class: "vue-short-media-feed",
|
|
794
|
-
style:
|
|
794
|
+
style: A(ae.value),
|
|
795
795
|
role: "list",
|
|
796
796
|
"aria-orientation": "vertical",
|
|
797
797
|
"aria-label": n.ariaLabel,
|
|
798
798
|
tabindex: "0",
|
|
799
|
-
onScrollPassive:
|
|
800
|
-
onKeydown:
|
|
799
|
+
onScrollPassive: U,
|
|
800
|
+
onKeydown: ue
|
|
801
801
|
}, [
|
|
802
|
-
n.items.length ? (
|
|
803
|
-
|
|
802
|
+
n.items.length ? (b(), S(me, { key: 0 }, [
|
|
803
|
+
Y.value > 0 ? (b(), S("div", {
|
|
804
804
|
key: 0,
|
|
805
805
|
class: "vue-short-media-feed__spacer",
|
|
806
|
-
style:
|
|
806
|
+
style: A({ height: `${Y.value}px` }),
|
|
807
807
|
"aria-hidden": "true"
|
|
808
808
|
}, null, 4)) : he("", !0),
|
|
809
|
-
(
|
|
810
|
-
key:
|
|
809
|
+
(b(!0), S(me, null, Me(F.value, ({ item: B, index: oe }) => (b(), S("div", {
|
|
810
|
+
key: f(C)(B, oe),
|
|
811
811
|
class: "vue-short-media-feed__item",
|
|
812
|
-
style:
|
|
812
|
+
style: A({ height: `${z.value}px` }),
|
|
813
813
|
role: "listitem",
|
|
814
|
-
"aria-current":
|
|
815
|
-
"aria-posinset":
|
|
814
|
+
"aria-current": oe === u.value ? "true" : void 0,
|
|
815
|
+
"aria-posinset": oe + 1,
|
|
816
816
|
"aria-setsize": n.items.length
|
|
817
817
|
}, [
|
|
818
|
-
|
|
819
|
-
item:
|
|
820
|
-
index:
|
|
821
|
-
active:
|
|
818
|
+
le(c.$slots, "default", {
|
|
819
|
+
item: B,
|
|
820
|
+
index: oe,
|
|
821
|
+
active: oe === u.value
|
|
822
822
|
})
|
|
823
823
|
], 12, Ne))), 128)),
|
|
824
|
-
|
|
824
|
+
J.value > 0 ? (b(), S("div", {
|
|
825
825
|
key: 1,
|
|
826
826
|
class: "vue-short-media-feed__spacer",
|
|
827
|
-
style:
|
|
827
|
+
style: A({ height: `${J.value}px` }),
|
|
828
828
|
"aria-hidden": "true"
|
|
829
829
|
}, null, 4)) : he("", !0)
|
|
830
|
-
], 64)) : (
|
|
831
|
-
|
|
830
|
+
], 64)) : (b(), S("div", Ye, [
|
|
831
|
+
le(c.$slots, "empty")
|
|
832
832
|
]))
|
|
833
833
|
], 44, Oe));
|
|
834
834
|
}
|
|
@@ -854,225 +854,277 @@ const Ae = ["aria-label"], Pe = ["aria-posinset", "aria-setsize"], Le = /* @__PU
|
|
|
854
854
|
ariaLabel: { default: "Carousel" },
|
|
855
855
|
hasMore: { type: Boolean, default: !1 },
|
|
856
856
|
loading: { type: Boolean, default: !1 },
|
|
857
|
-
loadMoreThreshold: { default: 2 }
|
|
857
|
+
loadMoreThreshold: { default: 2 },
|
|
858
|
+
autoplay: { type: Boolean, default: !1 },
|
|
859
|
+
autoplayDelay: { default: 3e3 },
|
|
860
|
+
autoplayLoop: { type: Boolean, default: !0 },
|
|
861
|
+
pauseOnHover: { type: Boolean, default: !0 }
|
|
858
862
|
},
|
|
859
863
|
emits: ["update:activeIndex", "change", "reachStart", "reachEnd", "loadMore"],
|
|
860
|
-
setup(n, { expose:
|
|
861
|
-
const e = n,
|
|
862
|
-
let
|
|
863
|
-
const { getItemKey:
|
|
864
|
+
setup(n, { expose: _, emit: H }) {
|
|
865
|
+
const e = n, I = H, m = P(), w = P(0), u = P(0);
|
|
866
|
+
let L, N = -1, R, C;
|
|
867
|
+
const E = P(!1), { getItemKey: M } = xe({
|
|
864
868
|
componentName: "VirtualCarousel",
|
|
865
869
|
items: () => e.items,
|
|
866
870
|
itemKey: () => e.itemKey
|
|
867
|
-
}),
|
|
871
|
+
}), z = i(
|
|
868
872
|
() => Math.max(
|
|
869
873
|
1,
|
|
870
874
|
Math.floor(
|
|
871
875
|
Number.isFinite(e.slidesPerView) ? e.slidesPerView : 1
|
|
872
876
|
)
|
|
873
877
|
)
|
|
874
|
-
),
|
|
878
|
+
), T = i(
|
|
875
879
|
() => Math.max(
|
|
876
880
|
1,
|
|
877
881
|
Math.floor(
|
|
878
882
|
Number.isFinite(e.slidesToScroll) ? e.slidesToScroll : 1
|
|
879
883
|
)
|
|
880
884
|
)
|
|
881
|
-
),
|
|
885
|
+
), $ = i(
|
|
882
886
|
() => Math.max(0, Number.isFinite(e.gap) ? e.gap : 0)
|
|
883
|
-
),
|
|
887
|
+
), F = i(
|
|
884
888
|
() => Math.max(
|
|
885
889
|
0,
|
|
886
890
|
Math.floor(Number.isFinite(e.buffer) ? e.buffer : 0)
|
|
887
891
|
)
|
|
888
|
-
),
|
|
892
|
+
), Y = i(
|
|
889
893
|
() => Math.max(
|
|
890
894
|
0,
|
|
891
895
|
Math.floor(
|
|
892
896
|
Number.isFinite(e.loadMoreThreshold) ? e.loadMoreThreshold : 0
|
|
893
897
|
)
|
|
894
898
|
)
|
|
895
|
-
),
|
|
896
|
-
if (
|
|
897
|
-
const
|
|
899
|
+
), J = i(() => Number.isFinite(e.autoplayDelay) ? Math.max(1, e.autoplayDelay) : 3e3), ae = i(() => Math.max(0, w.value)), V = i(() => {
|
|
900
|
+
if (ae.value <= 0) return 0;
|
|
901
|
+
const s = (z.value - 1) * $.value;
|
|
898
902
|
return Math.max(
|
|
899
903
|
1,
|
|
900
|
-
(
|
|
904
|
+
(ae.value - s) / z.value
|
|
901
905
|
);
|
|
902
|
-
}),
|
|
906
|
+
}), x = i(() => V.value + $.value), j = i(
|
|
903
907
|
() => Math.max(
|
|
904
908
|
0,
|
|
905
|
-
e.items.length -
|
|
909
|
+
e.items.length - z.value
|
|
906
910
|
)
|
|
907
|
-
),
|
|
908
|
-
() => Math.max(0, u.value -
|
|
909
|
-
),
|
|
911
|
+
), q = i(
|
|
912
|
+
() => Math.max(0, u.value - F.value)
|
|
913
|
+
), Q = i(
|
|
910
914
|
() => Math.min(
|
|
911
915
|
e.items.length,
|
|
912
|
-
u.value +
|
|
916
|
+
u.value + z.value + F.value
|
|
913
917
|
)
|
|
914
|
-
),
|
|
915
|
-
() => e.items.slice(
|
|
916
|
-
item:
|
|
917
|
-
index:
|
|
918
|
+
), U = i(
|
|
919
|
+
() => e.items.slice(q.value, Q.value).map((s, t) => ({
|
|
920
|
+
item: s,
|
|
921
|
+
index: q.value + t
|
|
918
922
|
}))
|
|
919
|
-
),
|
|
920
|
-
() =>
|
|
921
|
-
),
|
|
923
|
+
), ue = i(() => e.items.length === 0 ? 0 : e.items.length * V.value + (e.items.length - 1) * $.value), O = i(
|
|
924
|
+
() => q.value * x.value
|
|
925
|
+
), c = i(
|
|
922
926
|
() => Math.max(
|
|
923
927
|
0,
|
|
924
|
-
|
|
928
|
+
ue.value - Q.value * x.value
|
|
925
929
|
)
|
|
926
|
-
),
|
|
930
|
+
), g = i(() => ({
|
|
927
931
|
height: we(e.height)
|
|
928
932
|
}));
|
|
929
|
-
function
|
|
933
|
+
function B(s) {
|
|
930
934
|
return Math.min(
|
|
931
|
-
|
|
932
|
-
Math.max(0, Math.floor(Number.isFinite(
|
|
935
|
+
j.value,
|
|
936
|
+
Math.max(0, Math.floor(Number.isFinite(s) ? s : 0))
|
|
933
937
|
);
|
|
934
938
|
}
|
|
935
|
-
u.value =
|
|
936
|
-
function
|
|
937
|
-
return
|
|
939
|
+
u.value = B(e.activeIndex);
|
|
940
|
+
function oe(s) {
|
|
941
|
+
return s >= u.value && s < Math.min(
|
|
938
942
|
e.items.length,
|
|
939
|
-
u.value +
|
|
943
|
+
u.value + z.value
|
|
940
944
|
);
|
|
941
945
|
}
|
|
942
|
-
function
|
|
943
|
-
if (!e.hasMore || e.loading ||
|
|
946
|
+
function ne() {
|
|
947
|
+
if (!e.hasMore || e.loading || N === e.items.length)
|
|
944
948
|
return;
|
|
945
|
-
const
|
|
949
|
+
const s = e.items.length === 0 ? -1 : Math.min(
|
|
946
950
|
e.items.length - 1,
|
|
947
|
-
u.value +
|
|
951
|
+
u.value + z.value - 1
|
|
948
952
|
);
|
|
949
|
-
e.items.length - 1 -
|
|
950
|
-
}
|
|
951
|
-
function
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
index:
|
|
955
|
-
item: e.items[
|
|
956
|
-
}),
|
|
957
|
-
}
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
}
|
|
962
|
-
function
|
|
963
|
-
if (e.items.length === 0 ||
|
|
964
|
-
const
|
|
965
|
-
|
|
966
|
-
...
|
|
967
|
-
behavior:
|
|
953
|
+
e.items.length - 1 - s <= Y.value && (N = e.items.length, I("loadMore"));
|
|
954
|
+
}
|
|
955
|
+
function se(s) {
|
|
956
|
+
const t = B(s);
|
|
957
|
+
t === u.value || e.items.length === 0 || (u.value = t, I("update:activeIndex", t), I("change", {
|
|
958
|
+
index: t,
|
|
959
|
+
item: e.items[t]
|
|
960
|
+
}), t === 0 && I("reachStart"), t === j.value && I("reachEnd"), ne(), e.autoplay && !E.value && h());
|
|
961
|
+
}
|
|
962
|
+
function X(s, t = {}) {
|
|
963
|
+
const a = m.value;
|
|
964
|
+
a && (typeof a.scrollTo == "function" ? a.scrollTo({ ...t, left: s }) : a.scrollLeft = s);
|
|
965
|
+
}
|
|
966
|
+
function ie(s, t = {}) {
|
|
967
|
+
if (e.items.length === 0 || x.value <= 0) return;
|
|
968
|
+
const a = B(s), l = Math.abs(a - u.value), y = t.behavior === "smooth" && l > F.value ? "auto" : t.behavior;
|
|
969
|
+
C = y === "smooth" ? a : void 0, se(a), X(a * x.value, {
|
|
970
|
+
...t,
|
|
971
|
+
behavior: y
|
|
968
972
|
});
|
|
969
973
|
}
|
|
970
|
-
function
|
|
971
|
-
|
|
972
|
-
u.value +
|
|
973
|
-
{ behavior:
|
|
974
|
+
function ee(s = "smooth") {
|
|
975
|
+
ie(
|
|
976
|
+
u.value + T.value,
|
|
977
|
+
{ behavior: s }
|
|
974
978
|
);
|
|
975
979
|
}
|
|
976
|
-
function
|
|
977
|
-
|
|
978
|
-
u.value -
|
|
979
|
-
{ behavior:
|
|
980
|
+
function de(s = "smooth") {
|
|
981
|
+
ie(
|
|
982
|
+
u.value - T.value,
|
|
983
|
+
{ behavior: s }
|
|
980
984
|
);
|
|
981
985
|
}
|
|
982
|
-
function
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
+
function h() {
|
|
987
|
+
v(), !(!e.autoplay || e.items.length === 0) && (R = setTimeout(() => {
|
|
988
|
+
u.value >= j.value ? e.autoplayLoop ? ie(0, { behavior: "smooth" }) : v() : ee("smooth");
|
|
989
|
+
}, J.value));
|
|
990
|
+
}
|
|
991
|
+
function v() {
|
|
992
|
+
R !== void 0 && (clearTimeout(R), R = void 0);
|
|
986
993
|
}
|
|
987
|
-
function
|
|
988
|
-
|
|
994
|
+
function o() {
|
|
995
|
+
E.value = !0, e.pauseOnHover && v();
|
|
989
996
|
}
|
|
990
|
-
function
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
997
|
+
function d() {
|
|
998
|
+
E.value = !1, e.autoplay && h();
|
|
999
|
+
}
|
|
1000
|
+
function r() {
|
|
1001
|
+
C = void 0;
|
|
1002
|
+
}
|
|
1003
|
+
function K(s) {
|
|
1004
|
+
if (x.value <= 0) return;
|
|
1005
|
+
const t = s.currentTarget.scrollLeft;
|
|
1006
|
+
if (C !== void 0) {
|
|
1007
|
+
const a = C * x.value;
|
|
1008
|
+
if (Math.abs(t - a) > 1) return;
|
|
1009
|
+
C = void 0;
|
|
1010
|
+
}
|
|
1011
|
+
se(Math.round(t / x.value));
|
|
1012
|
+
}
|
|
1013
|
+
function D(s) {
|
|
1014
|
+
s.key === "ArrowRight" || s.key === "PageDown" ? (s.preventDefault(), ee()) : s.key === "ArrowLeft" || s.key === "PageUp" ? (s.preventDefault(), de()) : s.key === "Home" ? (s.preventDefault(), ie(0, { behavior: "smooth" })) : s.key === "End" && (s.preventDefault(), ie(j.value, { behavior: "auto" }));
|
|
1015
|
+
}
|
|
1016
|
+
function W() {
|
|
1017
|
+
var t;
|
|
1018
|
+
const s = ((t = m.value) == null ? void 0 : t.clientWidth) ?? 0;
|
|
1019
|
+
s <= 0 || s === w.value || (w.value = s, k(() => {
|
|
1020
|
+
X(u.value * x.value);
|
|
995
1021
|
}));
|
|
996
1022
|
}
|
|
997
|
-
return
|
|
1023
|
+
return Z(
|
|
998
1024
|
() => e.activeIndex,
|
|
999
|
-
async (
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1025
|
+
async (s) => {
|
|
1026
|
+
const t = B(s);
|
|
1027
|
+
t !== u.value && (r(), u.value = t, await k(), X(t * x.value), ne());
|
|
1002
1028
|
}
|
|
1003
|
-
),
|
|
1029
|
+
), Z(
|
|
1004
1030
|
() => [
|
|
1005
1031
|
e.items.length,
|
|
1006
1032
|
e.slidesPerView,
|
|
1007
1033
|
e.gap
|
|
1008
1034
|
],
|
|
1009
1035
|
async () => {
|
|
1010
|
-
const
|
|
1011
|
-
e.items.length === 0 ? u.value !== 0 && (u.value = 0,
|
|
1036
|
+
const s = B(u.value);
|
|
1037
|
+
e.items.length === 0 ? u.value !== 0 && (u.value = 0, I("update:activeIndex", 0)) : se(s), await k(), X(s * x.value), ne(), e.autoplay && e.items.length > 0 && !E.value && h();
|
|
1012
1038
|
}
|
|
1013
|
-
),
|
|
1039
|
+
), Z(
|
|
1014
1040
|
() => [
|
|
1015
1041
|
e.hasMore,
|
|
1016
1042
|
e.loading,
|
|
1017
1043
|
e.loadMoreThreshold
|
|
1018
1044
|
],
|
|
1019
|
-
async ([
|
|
1020
|
-
|
|
1045
|
+
async ([s]) => {
|
|
1046
|
+
s || (N = -1), await k(), ne();
|
|
1047
|
+
}
|
|
1048
|
+
), Z(
|
|
1049
|
+
() => e.autoplay,
|
|
1050
|
+
(s) => {
|
|
1051
|
+
s && !E.value ? h() : v();
|
|
1052
|
+
}
|
|
1053
|
+
), Z(
|
|
1054
|
+
() => e.autoplayDelay,
|
|
1055
|
+
() => {
|
|
1056
|
+
e.autoplay && !E.value && h();
|
|
1057
|
+
}
|
|
1058
|
+
), Z(
|
|
1059
|
+
() => e.autoplayLoop,
|
|
1060
|
+
(s) => {
|
|
1061
|
+
!e.autoplay || E.value || (!s && u.value >= j.value ? v() : h());
|
|
1062
|
+
}
|
|
1063
|
+
), Z(
|
|
1064
|
+
() => e.pauseOnHover,
|
|
1065
|
+
(s) => {
|
|
1066
|
+
s && E.value ? v() : !s && e.autoplay && h();
|
|
1021
1067
|
}
|
|
1022
1068
|
), pe(async () => {
|
|
1023
|
-
|
|
1069
|
+
W(), typeof ResizeObserver < "u" && m.value && (L = new ResizeObserver(W), L.observe(m.value)), await k(), X(u.value * x.value), ne(), e.autoplay && h();
|
|
1024
1070
|
}), ye(() => {
|
|
1025
|
-
|
|
1026
|
-
}),
|
|
1027
|
-
next:
|
|
1028
|
-
previous:
|
|
1029
|
-
scrollToIndex:
|
|
1030
|
-
|
|
1071
|
+
L == null || L.disconnect(), v();
|
|
1072
|
+
}), _({
|
|
1073
|
+
next: ee,
|
|
1074
|
+
previous: de,
|
|
1075
|
+
scrollToIndex: ie,
|
|
1076
|
+
startAutoplay: h,
|
|
1077
|
+
stopAutoplay: v
|
|
1078
|
+
}), (s, t) => (b(), S("div", {
|
|
1031
1079
|
ref_key: "viewport",
|
|
1032
|
-
ref:
|
|
1080
|
+
ref: m,
|
|
1033
1081
|
class: "vue-virtual-carousel",
|
|
1034
|
-
style:
|
|
1082
|
+
style: A(g.value),
|
|
1035
1083
|
role: "region",
|
|
1036
1084
|
"aria-roledescription": "carousel",
|
|
1037
1085
|
"aria-label": n.ariaLabel,
|
|
1038
1086
|
tabindex: "0",
|
|
1039
|
-
onScrollPassive:
|
|
1040
|
-
|
|
1087
|
+
onScrollPassive: K,
|
|
1088
|
+
onPointerdown: r,
|
|
1089
|
+
onWheelPassive: r,
|
|
1090
|
+
onKeydown: D,
|
|
1091
|
+
onMouseenter: o,
|
|
1092
|
+
onMouseleave: d
|
|
1041
1093
|
}, [
|
|
1042
|
-
n.items.length ? (
|
|
1043
|
-
|
|
1094
|
+
n.items.length ? (b(), S("div", _e, [
|
|
1095
|
+
O.value > 0 ? (b(), S("div", {
|
|
1044
1096
|
key: 0,
|
|
1045
1097
|
class: "vue-virtual-carousel__spacer",
|
|
1046
|
-
style:
|
|
1098
|
+
style: A({ flexBasis: `${O.value}px` }),
|
|
1047
1099
|
"aria-hidden": "true"
|
|
1048
1100
|
}, null, 4)) : he("", !0),
|
|
1049
|
-
(
|
|
1050
|
-
key:
|
|
1101
|
+
(b(!0), S(me, null, Me(U.value, ({ item: a, index: l }) => (b(), S("div", {
|
|
1102
|
+
key: f(M)(a, l),
|
|
1051
1103
|
class: "vue-virtual-carousel__item",
|
|
1052
|
-
style:
|
|
1053
|
-
flexBasis: `${
|
|
1054
|
-
marginRight:
|
|
1104
|
+
style: A({
|
|
1105
|
+
flexBasis: `${V.value}px`,
|
|
1106
|
+
marginRight: l < n.items.length - 1 ? `${$.value}px` : "0px"
|
|
1055
1107
|
}),
|
|
1056
1108
|
role: "listitem",
|
|
1057
1109
|
"aria-roledescription": "slide",
|
|
1058
|
-
"aria-label": `${
|
|
1059
|
-
"aria-current":
|
|
1110
|
+
"aria-label": `${l + 1} of ${n.items.length}`,
|
|
1111
|
+
"aria-current": l === u.value ? "true" : void 0
|
|
1060
1112
|
}, [
|
|
1061
|
-
|
|
1062
|
-
item:
|
|
1063
|
-
index:
|
|
1064
|
-
active:
|
|
1065
|
-
visible:
|
|
1113
|
+
le(s.$slots, "default", {
|
|
1114
|
+
item: a,
|
|
1115
|
+
index: l,
|
|
1116
|
+
active: l === u.value,
|
|
1117
|
+
visible: oe(l)
|
|
1066
1118
|
})
|
|
1067
1119
|
], 12, Ue))), 128)),
|
|
1068
|
-
|
|
1120
|
+
c.value > 0 ? (b(), S("div", {
|
|
1069
1121
|
key: 1,
|
|
1070
1122
|
class: "vue-virtual-carousel__spacer",
|
|
1071
|
-
style:
|
|
1123
|
+
style: A({ flexBasis: `${c.value}px` }),
|
|
1072
1124
|
"aria-hidden": "true"
|
|
1073
1125
|
}, null, 4)) : he("", !0)
|
|
1074
|
-
])) : (
|
|
1075
|
-
|
|
1126
|
+
])) : (b(), S("div", je, [
|
|
1127
|
+
le(s.$slots, "empty")
|
|
1076
1128
|
]))
|
|
1077
1129
|
], 44, We));
|
|
1078
1130
|
}
|
|
@@ -1095,206 +1147,206 @@ const Ae = ["aria-label"], Pe = ["aria-posinset", "aria-setsize"], Le = /* @__PU
|
|
|
1095
1147
|
pullRefreshThreshold: { default: 64 }
|
|
1096
1148
|
},
|
|
1097
1149
|
emits: ["scroll", "loadMore", "refresh"],
|
|
1098
|
-
setup(n, { expose:
|
|
1099
|
-
const e = n,
|
|
1100
|
-
pulling:
|
|
1101
|
-
pullDistance:
|
|
1150
|
+
setup(n, { expose: _, emit: H }) {
|
|
1151
|
+
const e = n, I = H, {
|
|
1152
|
+
pulling: m,
|
|
1153
|
+
pullDistance: w,
|
|
1102
1154
|
pullOffset: u,
|
|
1103
|
-
pullProgress:
|
|
1104
|
-
refreshMessage:
|
|
1105
|
-
refreshThreshold:
|
|
1106
|
-
handleTouchStart:
|
|
1107
|
-
handleTouchMove:
|
|
1108
|
-
handleTouchEnd:
|
|
1109
|
-
handleTouchCancel:
|
|
1155
|
+
pullProgress: L,
|
|
1156
|
+
refreshMessage: N,
|
|
1157
|
+
refreshThreshold: R,
|
|
1158
|
+
handleTouchStart: C,
|
|
1159
|
+
handleTouchMove: E,
|
|
1160
|
+
handleTouchEnd: M,
|
|
1161
|
+
handleTouchCancel: z
|
|
1110
1162
|
} = He({
|
|
1111
1163
|
enabled: () => e.pullToRefresh,
|
|
1112
1164
|
refreshing: () => e.refreshing,
|
|
1113
1165
|
threshold: () => e.pullRefreshThreshold,
|
|
1114
|
-
onRefresh: () =>
|
|
1115
|
-
}), T =
|
|
1116
|
-
let
|
|
1117
|
-
const
|
|
1166
|
+
onRefresh: () => I("refresh")
|
|
1167
|
+
}), T = P(), $ = P(0), F = P(0);
|
|
1168
|
+
let Y, J = -1;
|
|
1169
|
+
const ae = be(), { getItemKey: V } = xe({
|
|
1118
1170
|
componentName: "VirtualScroll",
|
|
1119
1171
|
items: () => e.items,
|
|
1120
1172
|
itemKey: () => e.itemKey
|
|
1121
|
-
}),
|
|
1122
|
-
() => e.items.length *
|
|
1123
|
-
),
|
|
1124
|
-
() => Math.max(1, e.loadingItemSize ??
|
|
1125
|
-
),
|
|
1126
|
-
() =>
|
|
1127
|
-
),
|
|
1173
|
+
}), x = i(() => Math.max(1, e.itemSize)), j = i(() => Math.max(0, Math.floor(e.overscan))), q = i(
|
|
1174
|
+
() => e.items.length * x.value
|
|
1175
|
+
), Q = i(
|
|
1176
|
+
() => Math.max(1, e.loadingItemSize ?? x.value)
|
|
1177
|
+
), U = i(
|
|
1178
|
+
() => q.value + (e.loading ? Q.value : 0)
|
|
1179
|
+
), ue = i(() => F.value > 0 ? F.value : typeof e.height == "number" ? e.height : 0), O = i(
|
|
1128
1180
|
() => Math.max(
|
|
1129
1181
|
0,
|
|
1130
|
-
Math.floor(
|
|
1182
|
+
Math.floor($.value / x.value) - j.value
|
|
1131
1183
|
)
|
|
1132
1184
|
), c = i(() => {
|
|
1133
|
-
const
|
|
1134
|
-
(
|
|
1185
|
+
const h = Math.ceil(
|
|
1186
|
+
($.value + ue.value) / x.value
|
|
1135
1187
|
);
|
|
1136
1188
|
return Math.min(
|
|
1137
1189
|
e.items.length,
|
|
1138
|
-
|
|
1190
|
+
h + j.value
|
|
1139
1191
|
);
|
|
1140
|
-
}),
|
|
1141
|
-
() => e.items.slice(
|
|
1142
|
-
item:
|
|
1143
|
-
index:
|
|
1192
|
+
}), g = i(
|
|
1193
|
+
() => e.items.slice(O.value, c.value).map((h, v) => ({
|
|
1194
|
+
item: h,
|
|
1195
|
+
index: O.value + v
|
|
1144
1196
|
}))
|
|
1145
|
-
),
|
|
1197
|
+
), B = i(() => ({
|
|
1146
1198
|
height: we(e.height)
|
|
1147
|
-
})),
|
|
1148
|
-
transform: `translateY(${
|
|
1199
|
+
})), oe = i(() => ({
|
|
1200
|
+
transform: `translateY(${O.value * x.value}px)`
|
|
1149
1201
|
}));
|
|
1150
|
-
function
|
|
1151
|
-
var
|
|
1152
|
-
F.value = ((
|
|
1202
|
+
function ne() {
|
|
1203
|
+
var h;
|
|
1204
|
+
F.value = ((h = T.value) == null ? void 0 : h.clientHeight) ?? 0, ae(T.value, e.height), k(X);
|
|
1153
1205
|
}
|
|
1154
|
-
function se(
|
|
1155
|
-
|
|
1156
|
-
scrollTop:
|
|
1157
|
-
startIndex:
|
|
1206
|
+
function se(h) {
|
|
1207
|
+
$.value = h.currentTarget.scrollTop, I("scroll", {
|
|
1208
|
+
scrollTop: $.value,
|
|
1209
|
+
startIndex: O.value,
|
|
1158
1210
|
endIndex: c.value
|
|
1159
|
-
}),
|
|
1211
|
+
}), X();
|
|
1160
1212
|
}
|
|
1161
|
-
function
|
|
1162
|
-
const
|
|
1163
|
-
if (!
|
|
1213
|
+
function X() {
|
|
1214
|
+
const h = T.value;
|
|
1215
|
+
if (!h || !e.hasMore || e.loading || J === e.items.length)
|
|
1164
1216
|
return;
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
}
|
|
1168
|
-
function
|
|
1169
|
-
const
|
|
1170
|
-
if (!
|
|
1171
|
-
const
|
|
1172
|
-
Math.max(0, Number.isFinite(
|
|
1173
|
-
|
|
1174
|
-
),
|
|
1175
|
-
|
|
1176
|
-
}
|
|
1177
|
-
function
|
|
1178
|
-
const
|
|
1179
|
-
if (!
|
|
1180
|
-
const
|
|
1217
|
+
const v = Math.max(0, e.loadMoreThreshold);
|
|
1218
|
+
U.value - h.scrollTop - h.clientHeight <= v && (J = e.items.length, I("loadMore"));
|
|
1219
|
+
}
|
|
1220
|
+
function ie(h, v = {}) {
|
|
1221
|
+
const o = T.value;
|
|
1222
|
+
if (!o) return;
|
|
1223
|
+
const d = Math.max(0, U.value - o.clientHeight), r = Math.min(
|
|
1224
|
+
Math.max(0, Number.isFinite(h) ? h : 0),
|
|
1225
|
+
d
|
|
1226
|
+
), K = v.behavior ?? "auto";
|
|
1227
|
+
K === "auto" && ($.value = r), o.scrollTo({ ...v, top: r, behavior: K });
|
|
1228
|
+
}
|
|
1229
|
+
function ee(h, v = {}) {
|
|
1230
|
+
const o = T.value;
|
|
1231
|
+
if (!o || e.items.length === 0) return;
|
|
1232
|
+
const d = Math.min(
|
|
1181
1233
|
e.items.length - 1,
|
|
1182
|
-
Math.max(0, Math.floor(
|
|
1183
|
-
), { align: r = "start", ...
|
|
1184
|
-
let
|
|
1185
|
-
r === "center" ?
|
|
1186
|
-
...
|
|
1187
|
-
top: Math.max(0, Math.min(
|
|
1234
|
+
Math.max(0, Math.floor(h))
|
|
1235
|
+
), { align: r = "start", ...K } = v;
|
|
1236
|
+
let D = d * x.value;
|
|
1237
|
+
r === "center" ? D -= (o.clientHeight - x.value) / 2 : r === "end" && (D -= o.clientHeight - x.value), o.scrollTo({
|
|
1238
|
+
...K,
|
|
1239
|
+
top: Math.max(0, Math.min(D, U.value - o.clientHeight))
|
|
1188
1240
|
});
|
|
1189
1241
|
}
|
|
1190
|
-
function
|
|
1191
|
-
var
|
|
1192
|
-
(
|
|
1242
|
+
function de(h = "auto") {
|
|
1243
|
+
var v;
|
|
1244
|
+
(v = T.value) == null || v.scrollTo({ top: 0, behavior: h });
|
|
1193
1245
|
}
|
|
1194
|
-
return
|
|
1246
|
+
return Z(
|
|
1195
1247
|
() => [e.items.length, e.itemSize],
|
|
1196
1248
|
async () => {
|
|
1197
|
-
await
|
|
1198
|
-
const
|
|
1199
|
-
if (!
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1249
|
+
await k();
|
|
1250
|
+
const h = T.value;
|
|
1251
|
+
if (!h) return;
|
|
1252
|
+
const v = Math.max(0, U.value - h.clientHeight);
|
|
1253
|
+
h.scrollTop > v && (h.scrollTop = v, $.value = v), X();
|
|
1202
1254
|
}
|
|
1203
|
-
),
|
|
1255
|
+
), Z(
|
|
1204
1256
|
() => [e.hasMore, e.loading],
|
|
1205
|
-
async ([
|
|
1206
|
-
|
|
1257
|
+
async ([h]) => {
|
|
1258
|
+
h || (J = -1), await k(), X();
|
|
1207
1259
|
}
|
|
1208
1260
|
), pe(() => {
|
|
1209
|
-
|
|
1261
|
+
ne(), typeof ResizeObserver < "u" && T.value && (Y = new ResizeObserver(ne), Y.observe(T.value)), k(X);
|
|
1210
1262
|
}), ye(() => {
|
|
1211
|
-
|
|
1212
|
-
}),
|
|
1213
|
-
scrollTo:
|
|
1214
|
-
scrollToIndex:
|
|
1215
|
-
scrollToTop:
|
|
1216
|
-
}), (
|
|
1263
|
+
Y == null || Y.disconnect();
|
|
1264
|
+
}), _({
|
|
1265
|
+
scrollTo: ie,
|
|
1266
|
+
scrollToIndex: ee,
|
|
1267
|
+
scrollToTop: de
|
|
1268
|
+
}), (h, v) => (b(), S("div", {
|
|
1217
1269
|
ref_key: "viewport",
|
|
1218
1270
|
ref: T,
|
|
1219
|
-
class: $e(["vue-virtual-scroll", { "vue-virtual-scroll--pulling": m
|
|
1220
|
-
style:
|
|
1271
|
+
class: $e(["vue-virtual-scroll", { "vue-virtual-scroll--pulling": f(m) }]),
|
|
1272
|
+
style: A(B.value),
|
|
1221
1273
|
role: "list",
|
|
1222
1274
|
"aria-label": n.ariaLabel,
|
|
1223
1275
|
tabindex: "0",
|
|
1224
1276
|
onScrollPassive: se,
|
|
1225
|
-
onTouchstartPassive:
|
|
1226
|
-
(...
|
|
1227
|
-
onTouchmove:
|
|
1228
|
-
(...
|
|
1229
|
-
onTouchend:
|
|
1230
|
-
(...
|
|
1231
|
-
onTouchcancel:
|
|
1232
|
-
(...
|
|
1277
|
+
onTouchstartPassive: v[0] || (v[0] = //@ts-ignore
|
|
1278
|
+
(...o) => f(C) && f(C)(...o)),
|
|
1279
|
+
onTouchmove: v[1] || (v[1] = //@ts-ignore
|
|
1280
|
+
(...o) => f(E) && f(E)(...o)),
|
|
1281
|
+
onTouchend: v[2] || (v[2] = //@ts-ignore
|
|
1282
|
+
(...o) => f(M) && f(M)(...o)),
|
|
1283
|
+
onTouchcancel: v[3] || (v[3] = //@ts-ignore
|
|
1284
|
+
(...o) => f(z) && f(z)(...o))
|
|
1233
1285
|
}, [
|
|
1234
|
-
n.pullToRefresh || n.refreshing ? (
|
|
1286
|
+
n.pullToRefresh || n.refreshing ? (b(), S("div", {
|
|
1235
1287
|
key: 0,
|
|
1236
1288
|
class: "vue-virtual-scroll__refresh",
|
|
1237
|
-
style:
|
|
1238
|
-
height: `${
|
|
1239
|
-
transform: `translateY(${
|
|
1289
|
+
style: A({
|
|
1290
|
+
height: `${f(R)}px`,
|
|
1291
|
+
transform: `translateY(${f(u) - f(R)}px)`
|
|
1240
1292
|
}),
|
|
1241
1293
|
role: "status",
|
|
1242
1294
|
"aria-live": "polite"
|
|
1243
1295
|
}, [
|
|
1244
|
-
|
|
1245
|
-
pullDistance:
|
|
1246
|
-
progress:
|
|
1296
|
+
le(h.$slots, "refresh", {
|
|
1297
|
+
pullDistance: f(w),
|
|
1298
|
+
progress: f(L),
|
|
1247
1299
|
refreshing: n.refreshing
|
|
1248
1300
|
}, () => [
|
|
1249
|
-
|
|
1301
|
+
ve(ke(f(N)), 1)
|
|
1250
1302
|
])
|
|
1251
1303
|
], 4)) : he("", !0),
|
|
1252
|
-
n.items.length || n.loading ? (
|
|
1304
|
+
n.items.length || n.loading ? (b(), S("div", {
|
|
1253
1305
|
key: 1,
|
|
1254
1306
|
class: "vue-virtual-scroll__spacer",
|
|
1255
|
-
style:
|
|
1256
|
-
height: `${
|
|
1257
|
-
transform: `translateY(${
|
|
1307
|
+
style: A({
|
|
1308
|
+
height: `${U.value}px`,
|
|
1309
|
+
transform: `translateY(${f(u)}px)`
|
|
1258
1310
|
})
|
|
1259
1311
|
}, [
|
|
1260
1312
|
Be("div", {
|
|
1261
1313
|
class: "vue-virtual-scroll__content",
|
|
1262
|
-
style:
|
|
1314
|
+
style: A(oe.value)
|
|
1263
1315
|
}, [
|
|
1264
|
-
(
|
|
1265
|
-
key:
|
|
1316
|
+
(b(!0), S(me, null, Me(g.value, ({ item: o, index: d }) => (b(), S("div", {
|
|
1317
|
+
key: f(V)(o, d),
|
|
1266
1318
|
class: "vue-virtual-scroll__item",
|
|
1267
|
-
style:
|
|
1319
|
+
style: A({ height: `${x.value}px` }),
|
|
1268
1320
|
role: "listitem",
|
|
1269
|
-
"aria-posinset":
|
|
1321
|
+
"aria-posinset": d + 1,
|
|
1270
1322
|
"aria-setsize": n.items.length
|
|
1271
1323
|
}, [
|
|
1272
|
-
|
|
1273
|
-
item:
|
|
1274
|
-
index:
|
|
1324
|
+
le(h.$slots, "default", {
|
|
1325
|
+
item: o,
|
|
1326
|
+
index: d
|
|
1275
1327
|
})
|
|
1276
1328
|
], 12, Ge))), 128))
|
|
1277
1329
|
], 4),
|
|
1278
|
-
n.loading ? (
|
|
1330
|
+
n.loading ? (b(), S("div", {
|
|
1279
1331
|
key: 0,
|
|
1280
1332
|
class: "vue-virtual-scroll__loading",
|
|
1281
|
-
style:
|
|
1282
|
-
height: `${
|
|
1283
|
-
transform: `translateY(${
|
|
1333
|
+
style: A({
|
|
1334
|
+
height: `${Q.value}px`,
|
|
1335
|
+
transform: `translateY(${q.value}px)`
|
|
1284
1336
|
}),
|
|
1285
1337
|
role: "status",
|
|
1286
1338
|
"aria-live": "polite"
|
|
1287
1339
|
}, [
|
|
1288
|
-
|
|
1289
|
-
|
|
1340
|
+
le(h.$slots, "loading", {}, () => [
|
|
1341
|
+
v[4] || (v[4] = ve("Loading more…", -1))
|
|
1290
1342
|
])
|
|
1291
1343
|
], 4)) : he("", !0)
|
|
1292
|
-
], 4)) : (
|
|
1344
|
+
], 4)) : (b(), S("div", {
|
|
1293
1345
|
key: 2,
|
|
1294
1346
|
class: "vue-virtual-scroll__empty",
|
|
1295
|
-
style:
|
|
1347
|
+
style: A({ transform: `translateY(${f(u)}px)` })
|
|
1296
1348
|
}, [
|
|
1297
|
-
|
|
1349
|
+
le(h.$slots, "empty")
|
|
1298
1350
|
], 4))
|
|
1299
1351
|
], 46, qe));
|
|
1300
1352
|
}
|
|
@@ -1316,85 +1368,85 @@ const Ae = ["aria-label"], Pe = ["aria-posinset", "aria-setsize"], Le = /* @__PU
|
|
|
1316
1368
|
pullRefreshThreshold: { default: 64 }
|
|
1317
1369
|
},
|
|
1318
1370
|
emits: ["scroll", "loadMore", "refresh"],
|
|
1319
|
-
setup(n, { expose:
|
|
1320
|
-
const e = n,
|
|
1321
|
-
let
|
|
1371
|
+
setup(n, { expose: _, emit: H }) {
|
|
1372
|
+
const e = n, I = H, m = P(), w = P(0), u = P(0), L = P(0), N = P(0), R = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
1373
|
+
let E, M, z = -1;
|
|
1322
1374
|
const { getItemKey: T } = xe({
|
|
1323
1375
|
componentName: "WindowDynamicVirtualScroll",
|
|
1324
1376
|
items: () => e.items,
|
|
1325
1377
|
itemKey: () => e.itemKey
|
|
1326
1378
|
}), {
|
|
1327
|
-
pulling:
|
|
1379
|
+
pulling: $,
|
|
1328
1380
|
pullDistance: F,
|
|
1329
|
-
pullOffset:
|
|
1330
|
-
pullProgress:
|
|
1331
|
-
refreshMessage:
|
|
1332
|
-
refreshThreshold:
|
|
1333
|
-
handleTouchStart:
|
|
1334
|
-
handleTouchMove:
|
|
1335
|
-
handleTouchEnd:
|
|
1336
|
-
handleTouchCancel:
|
|
1381
|
+
pullOffset: Y,
|
|
1382
|
+
pullProgress: J,
|
|
1383
|
+
refreshMessage: ae,
|
|
1384
|
+
refreshThreshold: V,
|
|
1385
|
+
handleTouchStart: x,
|
|
1386
|
+
handleTouchMove: j,
|
|
1387
|
+
handleTouchEnd: q,
|
|
1388
|
+
handleTouchCancel: Q
|
|
1337
1389
|
} = He({
|
|
1338
1390
|
enabled: () => e.pullToRefresh,
|
|
1339
1391
|
refreshing: () => e.refreshing,
|
|
1340
1392
|
threshold: () => e.pullRefreshThreshold,
|
|
1341
|
-
onRefresh: () =>
|
|
1393
|
+
onRefresh: () => I("refresh"),
|
|
1342
1394
|
scrollTop: () => typeof window > "u" ? 0 : Math.max(0, window.scrollY)
|
|
1343
|
-
}),
|
|
1395
|
+
}), U = i(
|
|
1344
1396
|
() => Math.max(1, e.estimatedItemSize)
|
|
1345
|
-
),
|
|
1346
|
-
() => Math.max(1, e.loadingItemSize ??
|
|
1347
|
-
),
|
|
1348
|
-
|
|
1349
|
-
const t = new Array(e.items.length + 1),
|
|
1397
|
+
), ue = i(
|
|
1398
|
+
() => Math.max(1, e.loadingItemSize ?? U.value)
|
|
1399
|
+
), O = i(() => Math.max(0, Math.floor(e.overscan))), c = i(() => {
|
|
1400
|
+
N.value;
|
|
1401
|
+
const t = new Array(e.items.length + 1), a = new Array(e.items.length);
|
|
1350
1402
|
t[0] = 0;
|
|
1351
1403
|
for (let l = 0; l < e.items.length; l += 1) {
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1404
|
+
const y = T(e.items[l], l), p = R.get(y) ?? U.value;
|
|
1405
|
+
a[l] = p, t[l + 1] = t[l] + p;
|
|
1354
1406
|
}
|
|
1355
1407
|
return {
|
|
1356
1408
|
offsets: t,
|
|
1357
|
-
sizes:
|
|
1409
|
+
sizes: a,
|
|
1358
1410
|
total: t[e.items.length] ?? 0
|
|
1359
1411
|
};
|
|
1360
|
-
}),
|
|
1361
|
-
() => c.value.total + (e.loading ?
|
|
1362
|
-
),
|
|
1412
|
+
}), g = i(
|
|
1413
|
+
() => c.value.total + (e.loading ? ue.value : 0)
|
|
1414
|
+
), B = i(() => {
|
|
1363
1415
|
const t = /* @__PURE__ */ new Map();
|
|
1364
|
-
return e.items.forEach((
|
|
1365
|
-
t.set(T(
|
|
1416
|
+
return e.items.forEach((a, l) => {
|
|
1417
|
+
t.set(T(a, l), l);
|
|
1366
1418
|
}), t;
|
|
1367
|
-
}),
|
|
1368
|
-
() => Math.max(0,
|
|
1419
|
+
}), oe = i(
|
|
1420
|
+
() => Math.max(0, w.value - L.value)
|
|
1369
1421
|
);
|
|
1370
|
-
function
|
|
1422
|
+
function ne(t) {
|
|
1371
1423
|
if (e.items.length === 0) return 0;
|
|
1372
|
-
const
|
|
1373
|
-
let l = 0,
|
|
1374
|
-
for (; l <
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1424
|
+
const a = c.value.offsets;
|
|
1425
|
+
let l = 0, y = e.items.length;
|
|
1426
|
+
for (; l < y; ) {
|
|
1427
|
+
const p = Math.floor((l + y) / 2);
|
|
1428
|
+
a[p + 1] <= t ? l = p + 1 : y = p;
|
|
1377
1429
|
}
|
|
1378
1430
|
return Math.min(l, e.items.length - 1);
|
|
1379
1431
|
}
|
|
1380
1432
|
const se = i(
|
|
1381
1433
|
() => Math.max(
|
|
1382
1434
|
0,
|
|
1383
|
-
|
|
1435
|
+
ne(oe.value) - O.value
|
|
1384
1436
|
)
|
|
1385
|
-
),
|
|
1437
|
+
), X = i(() => {
|
|
1386
1438
|
if (e.items.length === 0) return 0;
|
|
1387
|
-
const t =
|
|
1388
|
-
|
|
1439
|
+
const t = w.value + u.value - L.value, a = Math.max(
|
|
1440
|
+
U.value,
|
|
1389
1441
|
t
|
|
1390
|
-
), l =
|
|
1442
|
+
), l = ne(a) + 1;
|
|
1391
1443
|
return Math.min(
|
|
1392
1444
|
e.items.length,
|
|
1393
|
-
l +
|
|
1445
|
+
l + O.value
|
|
1394
1446
|
);
|
|
1395
|
-
}),
|
|
1396
|
-
() => e.items.slice(se.value,
|
|
1397
|
-
const l = se.value +
|
|
1447
|
+
}), ie = i(
|
|
1448
|
+
() => e.items.slice(se.value, X.value).map((t, a) => {
|
|
1449
|
+
const l = se.value + a;
|
|
1398
1450
|
return {
|
|
1399
1451
|
item: t,
|
|
1400
1452
|
index: l,
|
|
@@ -1403,220 +1455,220 @@ const Ae = ["aria-label"], Pe = ["aria-posinset", "aria-setsize"], Le = /* @__PU
|
|
|
1403
1455
|
};
|
|
1404
1456
|
})
|
|
1405
1457
|
);
|
|
1406
|
-
function
|
|
1407
|
-
typeof window > "u" || (
|
|
1458
|
+
function ee() {
|
|
1459
|
+
typeof window > "u" || (w.value = Math.max(0, window.scrollY), u.value = window.innerHeight, m.value && (L.value = m.value.getBoundingClientRect().top + w.value));
|
|
1408
1460
|
}
|
|
1409
|
-
function
|
|
1410
|
-
|
|
1411
|
-
scrollTop:
|
|
1461
|
+
function de() {
|
|
1462
|
+
I("scroll", {
|
|
1463
|
+
scrollTop: oe.value,
|
|
1412
1464
|
startIndex: se.value,
|
|
1413
|
-
endIndex:
|
|
1465
|
+
endIndex: X.value
|
|
1414
1466
|
});
|
|
1415
1467
|
}
|
|
1416
|
-
function s() {
|
|
1417
|
-
le(), d(), h();
|
|
1418
|
-
}
|
|
1419
1468
|
function h() {
|
|
1420
|
-
|
|
1469
|
+
ee(), de(), v();
|
|
1470
|
+
}
|
|
1471
|
+
function v() {
|
|
1472
|
+
if (typeof window > "u" || !e.hasMore || e.loading || z === e.items.length)
|
|
1421
1473
|
return;
|
|
1422
|
-
const t = Math.max(0, e.loadMoreThreshold),
|
|
1423
|
-
|
|
1474
|
+
const t = Math.max(0, e.loadMoreThreshold), a = L.value + g.value, l = w.value + u.value;
|
|
1475
|
+
a - l <= t && (z = e.items.length, I("loadMore"));
|
|
1424
1476
|
}
|
|
1425
|
-
function
|
|
1426
|
-
const
|
|
1427
|
-
if (
|
|
1428
|
-
const l = Array.isArray(
|
|
1477
|
+
function o(t) {
|
|
1478
|
+
const a = t.borderBoxSize;
|
|
1479
|
+
if (a) {
|
|
1480
|
+
const l = Array.isArray(a) ? a[0] : a;
|
|
1429
1481
|
if (l != null && l.blockSize) return l.blockSize;
|
|
1430
1482
|
}
|
|
1431
1483
|
return t.contentRect.height;
|
|
1432
1484
|
}
|
|
1433
|
-
function
|
|
1434
|
-
const
|
|
1435
|
-
let l = 0,
|
|
1436
|
-
for (const
|
|
1437
|
-
const
|
|
1438
|
-
if (
|
|
1439
|
-
const ce =
|
|
1440
|
-
if (Math.abs(ce -
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1485
|
+
function d(t) {
|
|
1486
|
+
const a = c.value;
|
|
1487
|
+
let l = 0, y = !1;
|
|
1488
|
+
for (const p of t) {
|
|
1489
|
+
const te = p.target, G = C.get(te), re = o(p);
|
|
1490
|
+
if (G === void 0 || re <= 0) continue;
|
|
1491
|
+
const ce = R.get(G) ?? U.value;
|
|
1492
|
+
if (Math.abs(ce - re) < 0.5) continue;
|
|
1493
|
+
const fe = B.value.get(G);
|
|
1494
|
+
fe !== void 0 && a.offsets[fe + 1] <= oe.value && (l += re - ce), R.set(G, re), y = !0;
|
|
1443
1495
|
}
|
|
1444
|
-
|
|
1496
|
+
y && (N.value += 1, k(() => {
|
|
1445
1497
|
if (l !== 0 && typeof window < "u") {
|
|
1446
|
-
const
|
|
1498
|
+
const p = Math.max(
|
|
1447
1499
|
0,
|
|
1448
|
-
|
|
1500
|
+
w.value + l
|
|
1449
1501
|
);
|
|
1450
|
-
|
|
1502
|
+
w.value = p, window.scrollTo({ top: p, behavior: "auto" });
|
|
1451
1503
|
}
|
|
1452
|
-
|
|
1504
|
+
ee(), v();
|
|
1453
1505
|
}));
|
|
1454
1506
|
}
|
|
1455
|
-
function r(t,
|
|
1456
|
-
t instanceof HTMLElement && (
|
|
1507
|
+
function r(t, a) {
|
|
1508
|
+
t instanceof HTMLElement && (C.set(t, a), M == null || M.observe(t));
|
|
1457
1509
|
}
|
|
1458
|
-
function
|
|
1459
|
-
for (const [t] of
|
|
1460
|
-
t.isConnected || (
|
|
1510
|
+
function K() {
|
|
1511
|
+
for (const [t] of C)
|
|
1512
|
+
t.isConnected || (M == null || M.unobserve(t), C.delete(t));
|
|
1461
1513
|
}
|
|
1462
|
-
function
|
|
1514
|
+
function D(t, a = {}) {
|
|
1463
1515
|
if (typeof window > "u") return;
|
|
1464
|
-
|
|
1465
|
-
const l = Math.max(0,
|
|
1516
|
+
ee();
|
|
1517
|
+
const l = Math.max(0, g.value - u.value), y = Math.min(
|
|
1466
1518
|
Math.max(0, Number.isFinite(t) ? t : 0),
|
|
1467
1519
|
l
|
|
1468
|
-
),
|
|
1469
|
-
|
|
1520
|
+
), p = Math.max(0, L.value + y), te = a.behavior ?? "auto";
|
|
1521
|
+
te === "auto" && (w.value = p), window.scrollTo({ ...a, top: p, behavior: te });
|
|
1470
1522
|
}
|
|
1471
|
-
function
|
|
1523
|
+
function W(t, a = {}) {
|
|
1472
1524
|
if (typeof window > "u" || e.items.length === 0) return;
|
|
1473
|
-
|
|
1525
|
+
ee();
|
|
1474
1526
|
const l = Math.min(
|
|
1475
1527
|
e.items.length - 1,
|
|
1476
1528
|
Math.max(0, Math.floor(t))
|
|
1477
|
-
), { align:
|
|
1478
|
-
let
|
|
1479
|
-
|
|
1480
|
-
const
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
), ce = Math.max(0, Math.min(
|
|
1529
|
+
), { align: y = "start", ...p } = a, te = c.value.sizes[l];
|
|
1530
|
+
let G = L.value + c.value.offsets[l];
|
|
1531
|
+
y === "center" ? G -= (u.value - te) / 2 : y === "end" && (G -= u.value - te);
|
|
1532
|
+
const re = Math.max(
|
|
1533
|
+
L.value,
|
|
1534
|
+
L.value + g.value - u.value
|
|
1535
|
+
), ce = Math.max(0, Math.min(G, re)), fe = p.behavior ?? "auto", Se = Math.max(
|
|
1484
1536
|
u.value * 3,
|
|
1485
|
-
|
|
1486
|
-
), Te =
|
|
1487
|
-
Te === "auto" && (
|
|
1488
|
-
...
|
|
1537
|
+
U.value * 10
|
|
1538
|
+
), Te = fe === "smooth" && Math.abs(ce - w.value) > Se ? "auto" : fe;
|
|
1539
|
+
Te === "auto" && (w.value = ce), window.scrollTo({
|
|
1540
|
+
...p,
|
|
1489
1541
|
top: ce,
|
|
1490
1542
|
behavior: Te
|
|
1491
1543
|
});
|
|
1492
1544
|
}
|
|
1493
|
-
function
|
|
1494
|
-
typeof window > "u" || (
|
|
1545
|
+
function s(t = "auto") {
|
|
1546
|
+
typeof window > "u" || (ee(), window.scrollTo({ top: Math.max(0, L.value), behavior: t }));
|
|
1495
1547
|
}
|
|
1496
|
-
return
|
|
1548
|
+
return Z(
|
|
1497
1549
|
() => e.itemKey,
|
|
1498
1550
|
() => {
|
|
1499
|
-
|
|
1551
|
+
R.clear(), N.value += 1;
|
|
1500
1552
|
}
|
|
1501
|
-
),
|
|
1553
|
+
), Z(
|
|
1502
1554
|
() => e.items.length,
|
|
1503
1555
|
async () => {
|
|
1504
1556
|
const t = new Set(
|
|
1505
|
-
e.items.map((
|
|
1557
|
+
e.items.map((a, l) => T(a, l))
|
|
1506
1558
|
);
|
|
1507
|
-
for (const
|
|
1508
|
-
t.has(
|
|
1509
|
-
|
|
1559
|
+
for (const a of R.keys())
|
|
1560
|
+
t.has(a) || R.delete(a);
|
|
1561
|
+
N.value += 1, await k(), ee(), v();
|
|
1510
1562
|
}
|
|
1511
|
-
),
|
|
1563
|
+
), Z(
|
|
1512
1564
|
() => [e.hasMore, e.loading],
|
|
1513
1565
|
async ([t]) => {
|
|
1514
|
-
t || (
|
|
1566
|
+
t || (z = -1), await k(), ee(), v();
|
|
1515
1567
|
}
|
|
1516
1568
|
), pe(() => {
|
|
1517
|
-
if (
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
}),
|
|
1521
|
-
for (const [t] of
|
|
1522
|
-
|
|
1569
|
+
if (ee(), window.addEventListener("scroll", h, { passive: !0 }), window.addEventListener("resize", h, { passive: !0 }), typeof ResizeObserver < "u") {
|
|
1570
|
+
E = new ResizeObserver(() => {
|
|
1571
|
+
ee(), v();
|
|
1572
|
+
}), M = new ResizeObserver(d), m.value && E.observe(m.value);
|
|
1573
|
+
for (const [t] of C)
|
|
1574
|
+
M.observe(t);
|
|
1523
1575
|
}
|
|
1524
|
-
|
|
1525
|
-
}), ze(
|
|
1526
|
-
window.removeEventListener("scroll",
|
|
1527
|
-
}),
|
|
1528
|
-
scrollTo:
|
|
1529
|
-
scrollToIndex:
|
|
1530
|
-
scrollToTop:
|
|
1531
|
-
}), (t,
|
|
1576
|
+
k(v);
|
|
1577
|
+
}), ze(K), ye(() => {
|
|
1578
|
+
window.removeEventListener("scroll", h), window.removeEventListener("resize", h), E == null || E.disconnect(), M == null || M.disconnect(), C.clear();
|
|
1579
|
+
}), _({
|
|
1580
|
+
scrollTo: D,
|
|
1581
|
+
scrollToIndex: W,
|
|
1582
|
+
scrollToTop: s
|
|
1583
|
+
}), (t, a) => (b(), S("div", {
|
|
1532
1584
|
ref_key: "root",
|
|
1533
|
-
ref:
|
|
1534
|
-
class: $e(["vue-window-dynamic-virtual-scroll", { "vue-window-dynamic-virtual-scroll--pulling":
|
|
1585
|
+
ref: m,
|
|
1586
|
+
class: $e(["vue-window-dynamic-virtual-scroll", { "vue-window-dynamic-virtual-scroll--pulling": f($) }]),
|
|
1535
1587
|
role: "list",
|
|
1536
1588
|
"aria-label": n.ariaLabel,
|
|
1537
|
-
onTouchstartPassive:
|
|
1538
|
-
(...l) =>
|
|
1539
|
-
onTouchmove:
|
|
1540
|
-
(...l) =>
|
|
1541
|
-
onTouchend:
|
|
1542
|
-
(...l) =>
|
|
1543
|
-
onTouchcancel:
|
|
1544
|
-
(...l) =>
|
|
1589
|
+
onTouchstartPassive: a[0] || (a[0] = //@ts-ignore
|
|
1590
|
+
(...l) => f(x) && f(x)(...l)),
|
|
1591
|
+
onTouchmove: a[1] || (a[1] = //@ts-ignore
|
|
1592
|
+
(...l) => f(j) && f(j)(...l)),
|
|
1593
|
+
onTouchend: a[2] || (a[2] = //@ts-ignore
|
|
1594
|
+
(...l) => f(q) && f(q)(...l)),
|
|
1595
|
+
onTouchcancel: a[3] || (a[3] = //@ts-ignore
|
|
1596
|
+
(...l) => f(Q) && f(Q)(...l))
|
|
1545
1597
|
}, [
|
|
1546
|
-
n.pullToRefresh || n.refreshing ? (
|
|
1598
|
+
n.pullToRefresh || n.refreshing ? (b(), S("div", {
|
|
1547
1599
|
key: 0,
|
|
1548
1600
|
class: "vue-window-dynamic-virtual-scroll__refresh",
|
|
1549
|
-
style:
|
|
1550
|
-
height: `${
|
|
1551
|
-
transform: `translateY(${
|
|
1601
|
+
style: A({
|
|
1602
|
+
height: `${f(V)}px`,
|
|
1603
|
+
transform: `translateY(${f(Y) - f(V)}px)`
|
|
1552
1604
|
}),
|
|
1553
1605
|
role: "status",
|
|
1554
1606
|
"aria-live": "polite"
|
|
1555
1607
|
}, [
|
|
1556
|
-
|
|
1557
|
-
pullDistance:
|
|
1558
|
-
progress:
|
|
1608
|
+
le(t.$slots, "refresh", {
|
|
1609
|
+
pullDistance: f(F),
|
|
1610
|
+
progress: f(J),
|
|
1559
1611
|
refreshing: n.refreshing
|
|
1560
1612
|
}, () => [
|
|
1561
|
-
|
|
1613
|
+
ve(ke(f(ae)), 1)
|
|
1562
1614
|
])
|
|
1563
1615
|
], 4)) : he("", !0),
|
|
1564
|
-
n.items.length || n.loading ? (
|
|
1616
|
+
n.items.length || n.loading ? (b(), S("div", {
|
|
1565
1617
|
key: 1,
|
|
1566
1618
|
class: "vue-window-dynamic-virtual-scroll__spacer",
|
|
1567
|
-
style:
|
|
1568
|
-
height: `${
|
|
1569
|
-
transform: `translateY(${
|
|
1619
|
+
style: A({
|
|
1620
|
+
height: `${g.value}px`,
|
|
1621
|
+
transform: `translateY(${f(Y)}px)`
|
|
1570
1622
|
})
|
|
1571
1623
|
}, [
|
|
1572
|
-
(
|
|
1573
|
-
key:
|
|
1624
|
+
(b(!0), S(me, null, Me(ie.value, ({ item: l, index: y, key: p, top: te }) => (b(), S("div", {
|
|
1625
|
+
key: p,
|
|
1574
1626
|
ref_for: !0,
|
|
1575
|
-
ref: (
|
|
1627
|
+
ref: (G) => r(G, p),
|
|
1576
1628
|
class: "vue-window-dynamic-virtual-scroll__item",
|
|
1577
|
-
style:
|
|
1629
|
+
style: A({ transform: `translateY(${te}px)` }),
|
|
1578
1630
|
role: "listitem",
|
|
1579
|
-
"aria-posinset":
|
|
1631
|
+
"aria-posinset": y + 1,
|
|
1580
1632
|
"aria-setsize": n.items.length
|
|
1581
1633
|
}, [
|
|
1582
|
-
|
|
1634
|
+
le(t.$slots, "default", {
|
|
1583
1635
|
item: l,
|
|
1584
|
-
index:
|
|
1636
|
+
index: y
|
|
1585
1637
|
})
|
|
1586
1638
|
], 12, Xe))), 128)),
|
|
1587
|
-
n.loading ? (
|
|
1639
|
+
n.loading ? (b(), S("div", {
|
|
1588
1640
|
key: 0,
|
|
1589
1641
|
class: "vue-window-dynamic-virtual-scroll__loading",
|
|
1590
|
-
style:
|
|
1591
|
-
height: `${
|
|
1642
|
+
style: A({
|
|
1643
|
+
height: `${ue.value}px`,
|
|
1592
1644
|
transform: `translateY(${c.value.total}px)`
|
|
1593
1645
|
}),
|
|
1594
1646
|
role: "status",
|
|
1595
1647
|
"aria-live": "polite"
|
|
1596
1648
|
}, [
|
|
1597
|
-
|
|
1598
|
-
|
|
1649
|
+
le(t.$slots, "loading", {}, () => [
|
|
1650
|
+
a[4] || (a[4] = ve("Loading more…", -1))
|
|
1599
1651
|
])
|
|
1600
1652
|
], 4)) : he("", !0)
|
|
1601
|
-
], 4)) : (
|
|
1653
|
+
], 4)) : (b(), S("div", {
|
|
1602
1654
|
key: 2,
|
|
1603
1655
|
class: "vue-window-dynamic-virtual-scroll__empty",
|
|
1604
|
-
style:
|
|
1656
|
+
style: A({ transform: `translateY(${f(Y)}px)` })
|
|
1605
1657
|
}, [
|
|
1606
|
-
|
|
1658
|
+
le(t.$slots, "empty")
|
|
1607
1659
|
], 4))
|
|
1608
1660
|
], 42, Qe));
|
|
1609
1661
|
}
|
|
1610
1662
|
}), tt = Le, at = {
|
|
1611
1663
|
install(n) {
|
|
1612
|
-
n.component("ChatVirtualScroll",
|
|
1664
|
+
n.component("ChatVirtualScroll", Ae), n.component("DynamicVirtualScroll", Le), n.component("ShortMediaFeed", Fe), n.component("VirtualCarousel", Ze), n.component("VirtualList", tt), n.component("VirtualScroll", Je), n.component(
|
|
1613
1665
|
"WindowDynamicVirtualScroll",
|
|
1614
1666
|
et
|
|
1615
1667
|
);
|
|
1616
1668
|
}
|
|
1617
1669
|
};
|
|
1618
1670
|
export {
|
|
1619
|
-
|
|
1671
|
+
Ae as ChatVirtualScroll,
|
|
1620
1672
|
Le as DynamicVirtualScroll,
|
|
1621
1673
|
Fe as ShortMediaFeed,
|
|
1622
1674
|
Ze as VirtualCarousel,
|