y-design-ssr 1.1.10 → 1.1.12
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/libs/dialog/index.d.ts +9 -0
- package/libs/dialog/index.mjs +117 -111
- package/libs/dialog/index.umd.js +2 -2
- package/libs/dialog/src/dialog.d.ts +14 -1
- package/libs/index.mjs +160 -150
- package/libs/index.umd.js +1 -1
- package/libs/list/index.mjs +56 -52
- package/libs/list/index.umd.js +1 -1
- package/libs/swipe/index.mjs +105 -105
- package/libs/swipe/index.umd.js +2 -2
- package/libs/tabs/index.mjs +157 -157
- package/libs/tabs/index.umd.js +1 -1
- package/package.json +1 -1
package/libs/tabs/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as X, reactive as D, getCurrentInstance as oe, provide as Se, isVNode as
|
|
1
|
+
import { ref as X, reactive as D, getCurrentInstance as oe, provide as Se, isVNode as ae, inject as Te, onUnmounted as Ne, computed as x, defineComponent as U, createVNode as N, watch as Z, onMounted as ce, nextTick as ee, onBeforeUnmount as Ce, onBeforeUpdate as Ee } from "vue";
|
|
2
2
|
const H = (e, o) => o ? typeof o == "string" ? ` ${e}--${o}` : Array.isArray(o) ? o.reduce((i, t) => i + H(e, t), "") : Object.keys(o).reduce(
|
|
3
3
|
(i, t) => i + (o[t] ? H(e, t) : ""),
|
|
4
4
|
""
|
|
@@ -30,7 +30,7 @@ const se = (e, o) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
30
30
|
const o = [], i = (t) => {
|
|
31
31
|
Array.isArray(t) && t.forEach((m) => {
|
|
32
32
|
var u;
|
|
33
|
-
|
|
33
|
+
ae(m) && (o.push(m), (u = m.component) != null && u.subTree && i(m.component.subTree.children), m.children && i(m.children));
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
return i(e), o;
|
|
@@ -43,11 +43,11 @@ const se = (e, o) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
43
43
|
children: i,
|
|
44
44
|
initProvide: (m) => {
|
|
45
45
|
Se(e, {
|
|
46
|
-
addChild: (
|
|
47
|
-
|
|
46
|
+
addChild: (a) => {
|
|
47
|
+
a.proxy && (i.push(a), o && $e(i, o));
|
|
48
48
|
},
|
|
49
|
-
removeChild: (
|
|
50
|
-
const d = i.indexOf(
|
|
49
|
+
removeChild: (a) => {
|
|
50
|
+
const d = i.indexOf(a);
|
|
51
51
|
i.splice(d, 1);
|
|
52
52
|
},
|
|
53
53
|
children: i,
|
|
@@ -89,22 +89,22 @@ const se = (e, o) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
89
89
|
!e.clonenNode && i && (t == null || t.children.push(i));
|
|
90
90
|
const m = x(() => e.clonenNode ? e.index : t == null ? void 0 : t.children.findIndex((f) => f.proxy === (i == null ? void 0 : i.proxy))), u = x(() => {
|
|
91
91
|
const f = `${(t == null ? void 0 : t.itemDetail.size) || 0}px`;
|
|
92
|
-
let
|
|
92
|
+
let a = "auto";
|
|
93
93
|
const d = `${(t == null ? void 0 : t.itemDetail.space) || 0}px`;
|
|
94
|
-
return t != null && t.props.autoHeight && (t == null ? void 0 : t.activeIndex) !== m.value && (
|
|
94
|
+
return t != null && t.props.autoHeight && (t == null ? void 0 : t.activeIndex) !== m.value && (a = "0"), t != null && t.props.vertical ? {
|
|
95
95
|
height: f,
|
|
96
|
-
width:
|
|
96
|
+
width: a,
|
|
97
97
|
marginBottom: d
|
|
98
98
|
} : {
|
|
99
99
|
width: f,
|
|
100
|
-
height:
|
|
100
|
+
height: a,
|
|
101
101
|
marginRight: d
|
|
102
102
|
};
|
|
103
103
|
});
|
|
104
104
|
return () => {
|
|
105
|
-
var
|
|
106
|
-
const f = ((
|
|
107
|
-
return
|
|
105
|
+
var a, d;
|
|
106
|
+
const f = ((a = t == null ? void 0 : t.itemShowedList) == null ? void 0 : a.list[m.value || 0]) || !1;
|
|
107
|
+
return N("div", {
|
|
108
108
|
class: xe(),
|
|
109
109
|
style: u.value
|
|
110
110
|
}, [f ? e.clonenNode || ((d = o.default) == null ? void 0 : d.call(o)) : null]);
|
|
@@ -188,7 +188,7 @@ const se = (e, o) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
188
188
|
}) {
|
|
189
189
|
const {
|
|
190
190
|
initProvide: m
|
|
191
|
-
} = ue(me), u = D([]), f = X(Number(e.initIndex)),
|
|
191
|
+
} = ue(me), u = D([]), f = X(Number(e.initIndex)), a = D({
|
|
192
192
|
// 元素尺寸
|
|
193
193
|
size: 0,
|
|
194
194
|
// 间距
|
|
@@ -202,59 +202,59 @@ const se = (e, o) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
202
202
|
viewportSize: 0,
|
|
203
203
|
// 重复节点个数
|
|
204
204
|
cloneNodeCount: 0
|
|
205
|
-
}),
|
|
206
|
-
const n = u.length,
|
|
207
|
-
for (let
|
|
208
|
-
|
|
209
|
-
return
|
|
205
|
+
}), L = X(), p = X(), O = () => {
|
|
206
|
+
const n = u.length, r = [];
|
|
207
|
+
for (let h = 0; h < n; h++)
|
|
208
|
+
r.push(!e.lazy);
|
|
209
|
+
return r;
|
|
210
210
|
}, M = () => {
|
|
211
211
|
if (!e.lazy)
|
|
212
212
|
return;
|
|
213
|
-
const n =
|
|
214
|
-
let
|
|
215
|
-
|
|
216
|
-
const B =
|
|
217
|
-
for (let
|
|
218
|
-
if (!I.list[
|
|
219
|
-
const $ = n *
|
|
220
|
-
($ >=
|
|
213
|
+
const n = a.size + a.space, r = u.length * n;
|
|
214
|
+
let h = -(d.offset + c.offset) - d.cloneNodeCount * n;
|
|
215
|
+
h < 0 && (h += r);
|
|
216
|
+
const B = h + d.viewportSize;
|
|
217
|
+
for (let T = 0; T < u.length; T++)
|
|
218
|
+
if (!I.list[T]) {
|
|
219
|
+
const $ = n * T, k = $ + a.size;
|
|
220
|
+
($ >= h && $ < B || k > h && k < B || $ < h && k > B) && (I.list[T] = !0);
|
|
221
221
|
}
|
|
222
222
|
}, I = D({
|
|
223
223
|
list: O()
|
|
224
|
-
}),
|
|
224
|
+
}), w = () => {
|
|
225
225
|
I.list = O(), M();
|
|
226
226
|
};
|
|
227
|
-
Z(() => [...u],
|
|
228
|
-
const _ = (n,
|
|
229
|
-
n ?
|
|
227
|
+
Z(() => [...u], w);
|
|
228
|
+
const _ = (n, r) => {
|
|
229
|
+
n ? a.size = se(n, r) : a.size = r, a.space = Number(e.itemSpace) || 0, a.isFillViewport = a.size >= r, d.viewportSize = r, d.cloneNodeCount = P();
|
|
230
230
|
}, P = () => {
|
|
231
231
|
if (z.value) {
|
|
232
|
-
const n =
|
|
232
|
+
const n = a.size + a.space;
|
|
233
233
|
if (n === 0)
|
|
234
234
|
return 0;
|
|
235
|
-
const
|
|
236
|
-
return Math.min(
|
|
235
|
+
const r = d.viewportSize * 2 - n, h = Math.ceil(r / n);
|
|
236
|
+
return Math.min(h, u.length - 1);
|
|
237
237
|
}
|
|
238
238
|
return 0;
|
|
239
239
|
}, Y = () => {
|
|
240
|
-
if (!
|
|
240
|
+
if (!L.value)
|
|
241
241
|
return;
|
|
242
242
|
const {
|
|
243
243
|
width: n,
|
|
244
|
-
height:
|
|
245
|
-
} =
|
|
246
|
-
e.vertical ? _(e.itemSize,
|
|
244
|
+
height: r
|
|
245
|
+
} = L.value.getBoundingClientRect();
|
|
246
|
+
e.vertical ? _(e.itemSize, r) : _(e.itemSize, n), f.value = f.value >= u.length ? u.length - 1 : f.value, f.value < 0 && (f.value = 0), l(f.value), w(), b();
|
|
247
247
|
};
|
|
248
248
|
ce(() => {
|
|
249
249
|
if (ee(Y).catch(() => {
|
|
250
|
-
}), e.touchable &&
|
|
251
|
-
const n =
|
|
250
|
+
}), e.touchable && L.value) {
|
|
251
|
+
const n = L.value;
|
|
252
252
|
n.addEventListener("touchstart", A, !1), n.addEventListener("mousedown", A, !1), n.addEventListener("touchmove", W, !1), n.addEventListener("mousemove", W, !1), n.addEventListener("touchend", R, !1), n.addEventListener("mouseup", R, !1), n.addEventListener("mouseleave", R, !1), n.addEventListener("touchcancel", R, !1);
|
|
253
253
|
}
|
|
254
254
|
window.addEventListener("resize", Y, !1), window.addEventListener("orientationchange", Y, !1);
|
|
255
255
|
}), Ce(() => {
|
|
256
|
-
if (v(), e.touchable &&
|
|
257
|
-
const n =
|
|
256
|
+
if (v(), e.touchable && L.value) {
|
|
257
|
+
const n = L.value;
|
|
258
258
|
n.removeEventListener("touchstart", A, !1), n.removeEventListener("mousedown", A, !1), n.removeEventListener("mousemove", W, !1), n.removeEventListener("touchmove", W, !1), n.removeEventListener("mouseup", R, !1), n.removeEventListener("touchend", R, !1), n.removeEventListener("mouseleave", R, !1), n.removeEventListener("touchcancel", R, !1);
|
|
259
259
|
}
|
|
260
260
|
window.removeEventListener("resize", Y, !1), window.removeEventListener("orientationchange", Y, !1);
|
|
@@ -266,37 +266,37 @@ const se = (e, o) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
266
266
|
n = 0;
|
|
267
267
|
break;
|
|
268
268
|
case F.center:
|
|
269
|
-
n = (d.viewportSize -
|
|
269
|
+
n = (d.viewportSize - a.size) / 2;
|
|
270
270
|
break;
|
|
271
271
|
case F.end:
|
|
272
|
-
n = d.viewportSize -
|
|
272
|
+
n = d.viewportSize - a.size;
|
|
273
273
|
break;
|
|
274
274
|
default:
|
|
275
275
|
n = 0;
|
|
276
276
|
}
|
|
277
277
|
return n;
|
|
278
278
|
}), z = x(() => e.loop && u.length > 1), l = (n) => {
|
|
279
|
-
const
|
|
280
|
-
z.value ? d.offset = -
|
|
281
|
-
},
|
|
279
|
+
const r = a.size + a.space;
|
|
280
|
+
z.value ? d.offset = -r * (n + d.cloneNodeCount) + j.value : (d.offset = -r * n + j.value, e.align !== "center" && (n === 0 && (d.offset = 0), n === u.length - 1 && (d.offset = -r * n + d.viewportSize - a.size)));
|
|
281
|
+
}, g = () => {
|
|
282
282
|
l(f.value), i("afterChange", f.value);
|
|
283
|
-
}, y = (n) => (u.length + n) % u.length,
|
|
284
|
-
f.value = y(n), l(n), M(), i("change", f.value),
|
|
285
|
-
c.transitionEnabled = !1,
|
|
283
|
+
}, y = (n) => (u.length + n) % u.length, C = (n, r = !0) => {
|
|
284
|
+
f.value = y(n), l(n), M(), i("change", f.value), r ? (c.transitionEnabled = !0, p.value && p.value.addEventListener("transitionend", () => {
|
|
285
|
+
c.transitionEnabled = !1, g();
|
|
286
286
|
}, {
|
|
287
287
|
once: !0
|
|
288
|
-
})) :
|
|
289
|
-
},
|
|
290
|
-
|
|
291
|
-
},
|
|
292
|
-
|
|
288
|
+
})) : g();
|
|
289
|
+
}, E = (n = !0) => {
|
|
290
|
+
C(f.value - 1, n);
|
|
291
|
+
}, S = (n = !0) => {
|
|
292
|
+
C(f.value + 1, n);
|
|
293
293
|
};
|
|
294
294
|
let s = null;
|
|
295
295
|
const v = () => {
|
|
296
296
|
e.autoplayTime && s && clearInterval(s);
|
|
297
297
|
}, b = () => {
|
|
298
298
|
e.autoplayTime && u.length > 1 && (s && clearInterval(s), s = setInterval(() => {
|
|
299
|
-
|
|
299
|
+
S();
|
|
300
300
|
}, Number(e.autoplayTime)));
|
|
301
301
|
}, c = D({
|
|
302
302
|
// 拖拽中
|
|
@@ -316,94 +316,94 @@ const se = (e, o) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
316
316
|
// 当前次拖拽不满足翻页条件
|
|
317
317
|
isDissatisfy: !1
|
|
318
318
|
}), A = (n) => {
|
|
319
|
-
if (
|
|
319
|
+
if (c.transitionEnabled)
|
|
320
320
|
return;
|
|
321
|
-
let
|
|
322
|
-
"touches" in n ? (
|
|
321
|
+
let r = 0, h = 0;
|
|
322
|
+
"touches" in n ? (r = n.touches[0].clientX, h = n.touches[0].clientY) : (r = n.clientX, h = n.clientY), c.startX = r, c.startY = h, c.isDragging = !0, c.isFirstTouch = !0, c.startTime = /* @__PURE__ */ new Date(), v();
|
|
323
323
|
}, W = (n) => {
|
|
324
|
-
if (!
|
|
324
|
+
if (!c.isDragging)
|
|
325
325
|
return;
|
|
326
|
-
let
|
|
327
|
-
"touches" in n ? (
|
|
328
|
-
const B =
|
|
329
|
-
if (c.isFirstTouch && (c.isFirstTouch = !1, Math.abs(B) < Math.abs(
|
|
326
|
+
let r = 0, h = 0;
|
|
327
|
+
"touches" in n ? (r = n.touches[0].clientX, h = n.touches[0].clientY) : (r = n.clientX, h = n.clientY);
|
|
328
|
+
const B = r - c.startX, T = h - c.startY;
|
|
329
|
+
if (c.isFirstTouch && (c.isFirstTouch = !1, Math.abs(B) < Math.abs(T) !== e.vertical)) {
|
|
330
330
|
c.isDragging = !1;
|
|
331
331
|
return;
|
|
332
332
|
}
|
|
333
|
-
n.preventDefault(), c.offset = e.vertical ?
|
|
334
|
-
percent: c.offset / (
|
|
333
|
+
n.preventDefault(), c.offset = e.vertical ? T : B, M(), i("dragging", {
|
|
334
|
+
percent: c.offset / (a.size + a.space),
|
|
335
335
|
offset: c.offset
|
|
336
336
|
}), c.isDissatisfy = !1;
|
|
337
337
|
}, R = () => {
|
|
338
|
-
if (!
|
|
338
|
+
if (!c.isDragging)
|
|
339
339
|
return;
|
|
340
340
|
c.isDragging = !1;
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
},
|
|
341
|
+
const r = (/* @__PURE__ */ new Date()).getTime() - c.startTime.getTime();
|
|
342
|
+
he() && (Math.abs(c.offset) > ge.value || Math.abs(c.offset) / r > 0.5) ? (c.offset > 0 ? E() : S(), c.offset = 0, c.isDissatisfy = !1) : (c.offset = 0, c.isDissatisfy = !0), b();
|
|
343
|
+
}, ge = x(() => se(e.minSwipeDistance, a.size + a.space)), he = () => {
|
|
344
344
|
if (z.value)
|
|
345
345
|
return !0;
|
|
346
346
|
const n = c.offset > 0 ? f.value - 1 : f.value + 1;
|
|
347
347
|
return n >= 0 && n < u.length;
|
|
348
348
|
}, ye = x(() => {
|
|
349
|
-
const n = c.isDragging && !e.isFollowHand ? d.offset : d.offset + c.offset,
|
|
350
|
-
return e.vertical ? (
|
|
349
|
+
const n = c.isDragging && !e.isFollowHand ? d.offset : d.offset + c.offset, r = {};
|
|
350
|
+
return e.vertical ? (r.transform = `translate3d(0, ${n}px, 0)`, r.transitionDuration = c.transitionEnabled || c.isDissatisfy ? `${e.duration}ms` : "0ms") : (r.transform = `translate3d(${n}px, 0, 0)`, r.transitionDuration = c.transitionEnabled || c.isDissatisfy ? `${e.duration}ms` : "0ms"), c.isDragging && (r.transition = "none"), e.vertical && (r.flexDirection = "column"), e.autoHeight && (r.display = "block", r.whiteSpace = "nowrap"), r;
|
|
351
351
|
}), pe = x(() => ["y-swipe__dots", `y-swipe__dots--${e.dotsPosition || (e.vertical ? te.left : te.bottom)}`]);
|
|
352
352
|
t({
|
|
353
|
-
moveTo:
|
|
354
|
-
next:
|
|
355
|
-
prev:
|
|
353
|
+
moveTo: C,
|
|
354
|
+
next: S,
|
|
355
|
+
prev: E,
|
|
356
356
|
resize: Y
|
|
357
357
|
});
|
|
358
358
|
const be = D({
|
|
359
359
|
children: u,
|
|
360
360
|
activeIndex: f,
|
|
361
361
|
props: e,
|
|
362
|
-
itemDetail:
|
|
362
|
+
itemDetail: a,
|
|
363
363
|
itemShowedList: I
|
|
364
364
|
});
|
|
365
365
|
m(be);
|
|
366
|
-
const we = () => e.dots ?
|
|
366
|
+
const we = () => e.dots ? N("div", {
|
|
367
367
|
class: pe.value
|
|
368
|
-
}, [u.map((n,
|
|
369
|
-
const
|
|
370
|
-
active:
|
|
368
|
+
}, [u.map((n, r) => {
|
|
369
|
+
const h = q("dot", {
|
|
370
|
+
active: r === f.value
|
|
371
371
|
});
|
|
372
|
-
return
|
|
373
|
-
class:
|
|
372
|
+
return N("div", {
|
|
373
|
+
class: h,
|
|
374
374
|
style: {
|
|
375
375
|
backgroundColor: e.dotsColor
|
|
376
376
|
},
|
|
377
|
-
key:
|
|
377
|
+
key: r
|
|
378
378
|
}, null);
|
|
379
379
|
})]) : null;
|
|
380
380
|
return () => {
|
|
381
381
|
var n;
|
|
382
|
-
return
|
|
382
|
+
return N("div", {
|
|
383
383
|
class: q(),
|
|
384
|
-
ref:
|
|
385
|
-
}, [
|
|
384
|
+
ref: L
|
|
385
|
+
}, [N("div", {
|
|
386
386
|
class: q("track"),
|
|
387
387
|
style: ye.value,
|
|
388
388
|
ref: p
|
|
389
|
-
}, [Array(d.cloneNodeCount).fill("").map((
|
|
389
|
+
}, [Array(d.cloneNodeCount).fill("").map((r, h) => {
|
|
390
390
|
var $, k, V;
|
|
391
|
-
const B = y(
|
|
392
|
-
return
|
|
393
|
-
clonenNode:
|
|
391
|
+
const B = y(h - d.cloneNodeCount), T = (V = ($ = u[B]) == null ? void 0 : (k = $.slots).default) == null ? void 0 : V.call(k);
|
|
392
|
+
return T ? N(K, {
|
|
393
|
+
clonenNode: T,
|
|
394
394
|
index: B
|
|
395
395
|
}, null) : null;
|
|
396
|
-
}), (n = o.default) == null ? void 0 : n.call(o), Array(d.cloneNodeCount).fill("").map((
|
|
396
|
+
}), (n = o.default) == null ? void 0 : n.call(o), Array(d.cloneNodeCount).fill("").map((r, h) => {
|
|
397
397
|
var $, k, V;
|
|
398
|
-
const B = y(
|
|
399
|
-
return
|
|
400
|
-
clonenNode:
|
|
398
|
+
const B = y(h), T = (V = ($ = u[B]) == null ? void 0 : (k = $.slots).default) == null ? void 0 : V.call(k);
|
|
399
|
+
return T ? N(K, {
|
|
400
|
+
clonenNode: T,
|
|
401
401
|
index: B
|
|
402
402
|
}, null) : null;
|
|
403
403
|
})]), o.dots ? o.dots() : we()]);
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
}), [Oe, ie] = G("tabs-title"),
|
|
406
|
+
}), [Oe, ie] = G("tabs-title"), re = /* @__PURE__ */ U({
|
|
407
407
|
name: Oe,
|
|
408
408
|
props: {
|
|
409
409
|
active: {
|
|
@@ -448,7 +448,7 @@ const se = (e, o) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
448
448
|
title: m,
|
|
449
449
|
titleSlot: u
|
|
450
450
|
} = e;
|
|
451
|
-
return
|
|
451
|
+
return N("div", {
|
|
452
452
|
class: i.value,
|
|
453
453
|
title: m,
|
|
454
454
|
style: t.value,
|
|
@@ -537,19 +537,19 @@ var ne = {}, ke = {
|
|
|
537
537
|
var t = window, m = document;
|
|
538
538
|
if ("scrollBehavior" in m.documentElement.style && t.__forceSmoothScrollPolyfill__ !== !0)
|
|
539
539
|
return;
|
|
540
|
-
var u = t.HTMLElement || t.Element, f = 468,
|
|
540
|
+
var u = t.HTMLElement || t.Element, f = 468, a = {
|
|
541
541
|
scroll: t.scroll || t.scrollTo,
|
|
542
542
|
scrollBy: t.scrollBy,
|
|
543
543
|
elementScroll: u.prototype.scroll || O,
|
|
544
544
|
scrollIntoView: u.prototype.scrollIntoView
|
|
545
545
|
}, d = t.performance && t.performance.now ? t.performance.now.bind(t.performance) : Date.now;
|
|
546
|
-
function
|
|
547
|
-
var
|
|
548
|
-
return new RegExp(
|
|
546
|
+
function L(l) {
|
|
547
|
+
var g = ["MSIE ", "Trident/", "Edge/"];
|
|
548
|
+
return new RegExp(g.join("|")).test(l);
|
|
549
549
|
}
|
|
550
|
-
var p =
|
|
551
|
-
function O(l,
|
|
552
|
-
this.scrollLeft = l, this.scrollTop =
|
|
550
|
+
var p = L(t.navigator.userAgent) ? 1 : 0;
|
|
551
|
+
function O(l, g) {
|
|
552
|
+
this.scrollLeft = l, this.scrollTop = g;
|
|
553
553
|
}
|
|
554
554
|
function M(l) {
|
|
555
555
|
return 0.5 * (1 - Math.cos(Math.PI * l));
|
|
@@ -563,19 +563,19 @@ var ne = {}, ke = {
|
|
|
563
563
|
"behavior member of ScrollOptions " + l.behavior + " is not a valid value for enumeration ScrollBehavior."
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
if (
|
|
566
|
+
function w(l, g) {
|
|
567
|
+
if (g === "Y")
|
|
568
568
|
return l.clientHeight + p < l.scrollHeight;
|
|
569
|
-
if (
|
|
569
|
+
if (g === "X")
|
|
570
570
|
return l.clientWidth + p < l.scrollWidth;
|
|
571
571
|
}
|
|
572
|
-
function _(l,
|
|
573
|
-
var y = t.getComputedStyle(l, null)["overflow" +
|
|
572
|
+
function _(l, g) {
|
|
573
|
+
var y = t.getComputedStyle(l, null)["overflow" + g];
|
|
574
574
|
return y === "auto" || y === "scroll";
|
|
575
575
|
}
|
|
576
576
|
function P(l) {
|
|
577
|
-
var
|
|
578
|
-
return
|
|
577
|
+
var g = w(l, "Y") && _(l, "Y"), y = w(l, "X") && _(l, "X");
|
|
578
|
+
return g || y;
|
|
579
579
|
}
|
|
580
580
|
function Y(l) {
|
|
581
581
|
for (; l !== m.body && P(l) === !1; )
|
|
@@ -583,25 +583,25 @@ var ne = {}, ke = {
|
|
|
583
583
|
return l;
|
|
584
584
|
}
|
|
585
585
|
function j(l) {
|
|
586
|
-
var
|
|
587
|
-
|
|
586
|
+
var g = d(), y, C, E, S = (g - l.startTime) / f;
|
|
587
|
+
S = S > 1 ? 1 : S, y = M(S), C = l.startX + (l.x - l.startX) * y, E = l.startY + (l.y - l.startY) * y, l.method.call(l.scrollable, C, E), (C !== l.x || E !== l.y) && t.requestAnimationFrame(j.bind(t, l));
|
|
588
588
|
}
|
|
589
|
-
function z(l,
|
|
590
|
-
var
|
|
591
|
-
l === m.body ? (
|
|
592
|
-
scrollable:
|
|
589
|
+
function z(l, g, y) {
|
|
590
|
+
var C, E, S, s, v = d();
|
|
591
|
+
l === m.body ? (C = t, E = t.scrollX || t.pageXOffset, S = t.scrollY || t.pageYOffset, s = a.scroll) : (C = l, E = l.scrollLeft, S = l.scrollTop, s = O), j({
|
|
592
|
+
scrollable: C,
|
|
593
593
|
method: s,
|
|
594
594
|
startTime: v,
|
|
595
|
-
startX:
|
|
596
|
-
startY:
|
|
597
|
-
x:
|
|
595
|
+
startX: E,
|
|
596
|
+
startY: S,
|
|
597
|
+
x: g,
|
|
598
598
|
y
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
t.scroll = t.scrollTo = function() {
|
|
602
602
|
if (arguments[0] !== void 0) {
|
|
603
603
|
if (I(arguments[0]) === !0) {
|
|
604
|
-
|
|
604
|
+
a.scroll.call(
|
|
605
605
|
t,
|
|
606
606
|
arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] != "object" ? arguments[0] : t.scrollX || t.pageXOffset,
|
|
607
607
|
// use top prop, second argument if present or fallback to scrollY
|
|
@@ -619,7 +619,7 @@ var ne = {}, ke = {
|
|
|
619
619
|
}, t.scrollBy = function() {
|
|
620
620
|
if (arguments[0] !== void 0) {
|
|
621
621
|
if (I(arguments[0])) {
|
|
622
|
-
|
|
622
|
+
a.scrollBy.call(
|
|
623
623
|
t,
|
|
624
624
|
arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] != "object" ? arguments[0] : 0,
|
|
625
625
|
arguments[0].top !== void 0 ? arguments[0].top : arguments[1] !== void 0 ? arguments[1] : 0
|
|
@@ -638,7 +638,7 @@ var ne = {}, ke = {
|
|
|
638
638
|
if (I(arguments[0]) === !0) {
|
|
639
639
|
if (typeof arguments[0] == "number" && arguments[1] === void 0)
|
|
640
640
|
throw new SyntaxError("Value could not be converted");
|
|
641
|
-
|
|
641
|
+
a.elementScroll.call(
|
|
642
642
|
this,
|
|
643
643
|
// use left prop, first number argument or fallback to scrollLeft
|
|
644
644
|
arguments[0].left !== void 0 ? ~~arguments[0].left : typeof arguments[0] != "object" ? ~~arguments[0] : this.scrollLeft,
|
|
@@ -647,18 +647,18 @@ var ne = {}, ke = {
|
|
|
647
647
|
);
|
|
648
648
|
return;
|
|
649
649
|
}
|
|
650
|
-
var l = arguments[0].left,
|
|
650
|
+
var l = arguments[0].left, g = arguments[0].top;
|
|
651
651
|
z.call(
|
|
652
652
|
this,
|
|
653
653
|
this,
|
|
654
654
|
typeof l > "u" ? this.scrollLeft : ~~l,
|
|
655
|
-
typeof
|
|
655
|
+
typeof g > "u" ? this.scrollTop : ~~g
|
|
656
656
|
);
|
|
657
657
|
}
|
|
658
658
|
}, u.prototype.scrollBy = function() {
|
|
659
659
|
if (arguments[0] !== void 0) {
|
|
660
660
|
if (I(arguments[0]) === !0) {
|
|
661
|
-
|
|
661
|
+
a.elementScroll.call(
|
|
662
662
|
this,
|
|
663
663
|
arguments[0].left !== void 0 ? ~~arguments[0].left + this.scrollLeft : ~~arguments[0] + this.scrollLeft,
|
|
664
664
|
arguments[0].top !== void 0 ? ~~arguments[0].top + this.scrollTop : ~~arguments[1] + this.scrollTop
|
|
@@ -673,21 +673,21 @@ var ne = {}, ke = {
|
|
|
673
673
|
}
|
|
674
674
|
}, u.prototype.scrollIntoView = function() {
|
|
675
675
|
if (I(arguments[0]) === !0) {
|
|
676
|
-
|
|
676
|
+
a.scrollIntoView.call(
|
|
677
677
|
this,
|
|
678
678
|
arguments[0] === void 0 ? !0 : arguments[0]
|
|
679
679
|
);
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
|
-
var l = Y(this),
|
|
682
|
+
var l = Y(this), g = l.getBoundingClientRect(), y = this.getBoundingClientRect();
|
|
683
683
|
l !== m.body ? (z.call(
|
|
684
684
|
this,
|
|
685
685
|
l,
|
|
686
|
-
l.scrollLeft + y.left -
|
|
687
|
-
l.scrollTop + y.top -
|
|
686
|
+
l.scrollLeft + y.left - g.left,
|
|
687
|
+
l.scrollTop + y.top - g.top
|
|
688
688
|
), t.getComputedStyle(l).position !== "fixed" && t.scrollBy({
|
|
689
|
-
left:
|
|
690
|
-
top:
|
|
689
|
+
left: g.left,
|
|
690
|
+
top: g.top,
|
|
691
691
|
behavior: "smooth"
|
|
692
692
|
})) : t.scrollBy({
|
|
693
693
|
left: y.left,
|
|
@@ -700,12 +700,12 @@ var ne = {}, ke = {
|
|
|
700
700
|
})();
|
|
701
701
|
})(ke);
|
|
702
702
|
function Re(e) {
|
|
703
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
703
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ae(e);
|
|
704
704
|
}
|
|
705
705
|
const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
706
706
|
name: le,
|
|
707
707
|
components: {
|
|
708
|
-
YTabTitle:
|
|
708
|
+
YTabTitle: re
|
|
709
709
|
},
|
|
710
710
|
props: _e,
|
|
711
711
|
setup(e, {
|
|
@@ -715,9 +715,9 @@ const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
|
715
715
|
}) {
|
|
716
716
|
const {
|
|
717
717
|
initProvide: m
|
|
718
|
-
} = ue(ve), u = X(!1), f = D([]),
|
|
718
|
+
} = ue(ve), u = X(!1), f = D([]), a = X(), d = x(() => f.length > e.titleScrollThreshold), L = (s) => f.findIndex((v) => (v.$props ? v.$props.name : "") === s), p = X(e.initName ? L(e.initName) : e.initIndex), O = (s) => {
|
|
719
719
|
p.value = s;
|
|
720
|
-
const v =
|
|
720
|
+
const v = a.value;
|
|
721
721
|
v && (v == null || v.moveTo(s, e.changeWithAnimation));
|
|
722
722
|
};
|
|
723
723
|
t({
|
|
@@ -725,12 +725,12 @@ const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
|
725
725
|
O(s);
|
|
726
726
|
},
|
|
727
727
|
scrollToByName: (s) => {
|
|
728
|
-
const v =
|
|
728
|
+
const v = L(s);
|
|
729
729
|
O(v);
|
|
730
730
|
}
|
|
731
731
|
});
|
|
732
|
-
const
|
|
733
|
-
|
|
732
|
+
const w = X([]), _ = X(), P = (s) => (v) => {
|
|
733
|
+
w.value[s] = v;
|
|
734
734
|
}, Y = (s) => {
|
|
735
735
|
const {
|
|
736
736
|
title: v,
|
|
@@ -743,9 +743,9 @@ const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
|
743
743
|
if (!d.value || !_.value)
|
|
744
744
|
return;
|
|
745
745
|
const s = _.value;
|
|
746
|
-
if (!s || !
|
|
746
|
+
if (!s || !w.value[p.value])
|
|
747
747
|
return;
|
|
748
|
-
const v =
|
|
748
|
+
const v = w.value[p.value].$el, b = v.offsetLeft - (s.offsetWidth - v.offsetWidth) / 2;
|
|
749
749
|
s.scrollTo({
|
|
750
750
|
left: b,
|
|
751
751
|
behavior: "smooth"
|
|
@@ -753,19 +753,19 @@ const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
|
753
753
|
});
|
|
754
754
|
};
|
|
755
755
|
Ee(() => {
|
|
756
|
-
|
|
756
|
+
w.value = [];
|
|
757
757
|
});
|
|
758
758
|
const z = D({
|
|
759
759
|
transform: "translateX(50%)",
|
|
760
760
|
transition: "all 0ms ease-out"
|
|
761
761
|
}), l = async () => {
|
|
762
762
|
await ee(() => {
|
|
763
|
-
if (!
|
|
763
|
+
if (!w.value || w.value.length === 0)
|
|
764
764
|
return;
|
|
765
|
-
const s = p.value >=
|
|
765
|
+
const s = p.value >= w.value.length ? 0 : p.value, v = w.value[s].$el, b = v.offsetLeft + v.offsetWidth / 2;
|
|
766
766
|
z.transform = `translateX(${b}px) translateX(-50%)`, u.value && (z.transition = `all ${e.duration}ms ease-out`), u.value = !0;
|
|
767
767
|
});
|
|
768
|
-
},
|
|
768
|
+
}, g = (s) => {
|
|
769
769
|
const {
|
|
770
770
|
title: v,
|
|
771
771
|
name: b
|
|
@@ -777,13 +777,13 @@ const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
|
777
777
|
name: b
|
|
778
778
|
} = f[s].$props || {};
|
|
779
779
|
i("afterChange", s, v, b), p.value = s;
|
|
780
|
-
},
|
|
780
|
+
}, C = D({
|
|
781
781
|
children: f,
|
|
782
782
|
activeIndex: p,
|
|
783
783
|
props: e
|
|
784
784
|
});
|
|
785
|
-
m(
|
|
786
|
-
const
|
|
785
|
+
m(C);
|
|
786
|
+
const E = (s) => S(s) && /^\d+(\.\d+)?$/.test(s) ? `${s}px` : s, S = (s) => Object.prototype.toString.call(s) === "[object String]";
|
|
787
787
|
return ce(async () => {
|
|
788
788
|
ne.polyfill(), await l();
|
|
789
789
|
}), Z(() => p.value, async () => {
|
|
@@ -795,18 +795,18 @@ const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
|
795
795
|
await l();
|
|
796
796
|
}), () => {
|
|
797
797
|
let s;
|
|
798
|
-
return
|
|
798
|
+
return N("div", {
|
|
799
799
|
class: le
|
|
800
|
-
}, [
|
|
800
|
+
}, [N("div", {
|
|
801
801
|
class: Q("list")
|
|
802
|
-
}, [
|
|
802
|
+
}, [N("div", {
|
|
803
803
|
ref: _,
|
|
804
804
|
class: Q("list-child-wrapper", {
|
|
805
805
|
scrollable: d.value,
|
|
806
806
|
[e.size]: e.size,
|
|
807
807
|
[e.align]: e.align
|
|
808
808
|
})
|
|
809
|
-
}, [f.length > 0 && f.map((v, b) =>
|
|
809
|
+
}, [f.length > 0 && f.map((v, b) => N(re, {
|
|
810
810
|
title: v.title,
|
|
811
811
|
disabled: v.disabled,
|
|
812
812
|
"title-slot": v.$slots.title,
|
|
@@ -815,16 +815,16 @@ const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
|
815
815
|
active: p.value === b,
|
|
816
816
|
scrollable: d.value,
|
|
817
817
|
onClick: () => Y(b)
|
|
818
|
-
}, null)),
|
|
818
|
+
}, null)), N("div", {
|
|
819
819
|
class: Q("line"),
|
|
820
820
|
style: {
|
|
821
821
|
...z,
|
|
822
|
-
width:
|
|
823
|
-
height:
|
|
822
|
+
width: E(e.lineWidth),
|
|
823
|
+
height: E(e.lineHeight),
|
|
824
824
|
backgroundColor: e.lineColor
|
|
825
825
|
}
|
|
826
|
-
}, null)])]), o.default ?
|
|
827
|
-
ref:
|
|
826
|
+
}, null)])]), o.default ? N(Xe, {
|
|
827
|
+
ref: a,
|
|
828
828
|
dots: !1,
|
|
829
829
|
loop: !1,
|
|
830
830
|
initIndex: p.value,
|
|
@@ -832,7 +832,7 @@ const [le, Q] = G("tabs"), ve = le, je = /* @__PURE__ */ U({
|
|
|
832
832
|
touchable: e.touchable,
|
|
833
833
|
duration: e.duration,
|
|
834
834
|
"is-follow-hand": e.changeWithAnimation,
|
|
835
|
-
onChange:
|
|
835
|
+
onChange: g,
|
|
836
836
|
onAfterChange: y
|
|
837
837
|
}, Re(s = o.default()) ? s : {
|
|
838
838
|
default: () => [s]
|