y-design-ssr 1.1.1 → 1.1.3
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/button/index.css +1 -1
- package/libs/button/index.umd.js +2 -2
- package/libs/cell/index.css +1 -1
- package/libs/cell/index.umd.js +2 -2
- package/libs/checkbox/index.css +1 -1
- package/libs/checkbox/index.umd.js +2 -2
- package/libs/checkboxGroup/index.css +1 -1
- package/libs/checkboxGroup/index.umd.js +2 -2
- package/libs/col/index.css +1 -1
- package/libs/col/index.umd.js +2 -2
- package/libs/countDown/index.css +1 -1
- package/libs/countDown/index.umd.js +2 -2
- package/libs/dialog/index.css +1 -1
- package/libs/dialog/index.umd.js +2 -2
- package/libs/dropdown/index.css +1 -1
- package/libs/dropdown/index.umd.js +2 -2
- package/libs/dropdownItem/index.css +1 -1
- package/libs/dropdownItem/index.umd.js +2 -2
- package/libs/empty/index.css +1 -1
- package/libs/empty/index.umd.js +2 -2
- package/libs/form/index.css +1 -1
- package/libs/form/index.umd.js +2 -2
- package/libs/formItem/index.css +1 -1
- package/libs/formItem/index.umd.js +2 -2
- package/libs/icon/index.css +1 -1
- package/libs/icon/index.umd.js +2 -2
- package/libs/index.css +1 -1
- package/libs/index.mjs +127 -125
- package/libs/index.umd.js +2 -2
- package/libs/input/index.css +1 -1
- package/libs/input/index.umd.js +2 -2
- package/libs/layout/index.css +1 -1
- package/libs/layout/index.umd.js +1 -1
- package/libs/list/index.css +1 -1
- package/libs/list/index.umd.js +2 -2
- package/libs/loading/index.css +1 -1
- package/libs/loading/index.umd.js +2 -2
- package/libs/mask/index.css +1 -1
- package/libs/mask/index.umd.js +2 -2
- package/libs/pagination/index.css +1 -1
- package/libs/pagination/index.umd.js +2 -2
- package/libs/popup/index.css +1 -1
- package/libs/popup/index.umd.js +2 -2
- package/libs/progress/index.css +1 -1
- package/libs/progress/index.umd.js +2 -2
- package/libs/pullRefresh/index.css +1 -1
- package/libs/pullRefresh/index.umd.js +2 -2
- package/libs/row/index.css +1 -1
- package/libs/row/index.umd.js +2 -2
- package/libs/slider/index.css +1 -1
- package/libs/slider/index.umd.js +2 -2
- package/libs/stepper/index.css +1 -1
- package/libs/stepper/index.umd.js +2 -2
- package/libs/style/index.css +1 -1
- package/libs/style/index.umd.js +1 -1
- package/libs/swipe/index.css +1 -1
- package/libs/swipe/index.mjs +92 -90
- package/libs/swipe/index.umd.js +2 -2
- package/libs/swipeItem/index.css +1 -1
- package/libs/swipeItem/index.umd.js +1 -1
- package/libs/switch/index.css +1 -1
- package/libs/switch/index.umd.js +1 -1
- package/libs/tabs/index.css +1 -1
- package/libs/tabs/index.mjs +122 -120
- package/libs/tabs/index.umd.js +2 -2
- package/libs/toast/index.css +1 -1
- package/libs/toast/index.umd.js +2 -2
- package/libs/tooltip/index.css +1 -1
- package/libs/tooltip/index.umd.js +2 -2
- package/package.json +1 -1
package/libs/tabs/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref as z, reactive as N, getCurrentInstance as le, provide as Se, isVNode as
|
|
2
|
-
const V = (e, n) => n ? typeof n == "string" ? ` ${e}--${n}` : Array.isArray(n) ? n.reduce((
|
|
3
|
-
(
|
|
1
|
+
import { ref as z, reactive as N, getCurrentInstance as le, provide as Se, isVNode as oe, inject as pe, onUnmounted as Ne, computed as C, defineComponent as H, createVNode as b, watch as Z, onMounted as re, nextTick as ee, onBeforeUnmount as Ce, onBeforeUpdate as Te } from "vue";
|
|
2
|
+
const V = (e, n) => n ? typeof n == "string" ? ` ${e}--${n}` : Array.isArray(n) ? n.reduce((a, l) => a + V(e, l), "") : Object.keys(n).reduce(
|
|
3
|
+
(a, l) => a + (n[l] ? V(e, l) : ""),
|
|
4
4
|
""
|
|
5
|
-
) : "", ze = (e) => (n,
|
|
6
|
-
let l = n, v =
|
|
5
|
+
) : "", ze = (e) => (n, a) => {
|
|
6
|
+
let l = n, v = a;
|
|
7
7
|
return l && typeof l != "string" && (v = l, l = ""), l = l ? `${e}__${l}` : e, `${l}${V(l, v)}`;
|
|
8
8
|
}, Ee = () => (e, n) => n ? `${V(`y-${e}`, n)}` : `y-${e}`, Le = {
|
|
9
9
|
"pull-refresh": {
|
|
@@ -27,40 +27,40 @@ const U = (e) => {
|
|
|
27
27
|
};
|
|
28
28
|
var te = /* @__PURE__ */ ((e) => (e.left = "left", e.top = "top", e.bottom = "bottom", e.right = "right", e))(te || {}), W = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e))(W || {});
|
|
29
29
|
const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%") ? n * Number(e.replace(/%/g, "")) / 100 : Number(e), $e = (e) => {
|
|
30
|
-
const n = [],
|
|
30
|
+
const n = [], a = (l) => {
|
|
31
31
|
Array.isArray(l) && l.forEach((v) => {
|
|
32
32
|
var u;
|
|
33
|
-
|
|
33
|
+
oe(v) && (n.push(v), (u = v.component) != null && u.subTree && a(v.component.subTree.children), v.children && a(v.children));
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
return
|
|
36
|
+
return a(e), n;
|
|
37
37
|
}, xe = (e, n) => {
|
|
38
|
-
const
|
|
39
|
-
e.sort((l, v) =>
|
|
38
|
+
const a = $e(n.subTree.children);
|
|
39
|
+
e.sort((l, v) => a.indexOf(l.vnode) - a.indexOf(v.vnode));
|
|
40
40
|
}, ce = (e) => {
|
|
41
|
-
const n = le(),
|
|
41
|
+
const n = le(), a = N([]);
|
|
42
42
|
return {
|
|
43
|
-
children:
|
|
43
|
+
children: a,
|
|
44
44
|
initProvide: (v) => {
|
|
45
45
|
Se(e, {
|
|
46
|
-
addChild: (
|
|
47
|
-
|
|
46
|
+
addChild: (r) => {
|
|
47
|
+
r.proxy && (a.push(r), n && xe(a, n));
|
|
48
48
|
},
|
|
49
|
-
removeChild: (
|
|
50
|
-
const f =
|
|
51
|
-
|
|
49
|
+
removeChild: (r) => {
|
|
50
|
+
const f = a.indexOf(r);
|
|
51
|
+
a.splice(f, 1);
|
|
52
52
|
},
|
|
53
|
-
children:
|
|
53
|
+
children: a,
|
|
54
54
|
...v
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
}, ue = (e) => {
|
|
59
|
-
const n = pe(e, null),
|
|
60
|
-
if (n &&
|
|
59
|
+
const n = pe(e, null), a = le();
|
|
60
|
+
if (n && a) {
|
|
61
61
|
const { children: l, addChild: v, removeChild: u } = n;
|
|
62
|
-
return v(
|
|
63
|
-
index: C(() => l.indexOf(
|
|
62
|
+
return v(a), Ne(() => u(a)), {
|
|
63
|
+
index: C(() => l.indexOf(a)),
|
|
64
64
|
parent: n
|
|
65
65
|
};
|
|
66
66
|
}
|
|
@@ -68,8 +68,8 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
68
68
|
parent: null,
|
|
69
69
|
index: z(-1)
|
|
70
70
|
};
|
|
71
|
-
}, [
|
|
72
|
-
name:
|
|
71
|
+
}, [De, Ie] = U("swipe-item"), K = /* @__PURE__ */ H({
|
|
72
|
+
name: De,
|
|
73
73
|
props: {
|
|
74
74
|
clonenNode: {
|
|
75
75
|
type: Object,
|
|
@@ -83,34 +83,34 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
83
83
|
setup(e, {
|
|
84
84
|
slots: n
|
|
85
85
|
}) {
|
|
86
|
-
const
|
|
86
|
+
const a = le(), {
|
|
87
87
|
parent: l
|
|
88
88
|
} = ue(de);
|
|
89
|
-
!e.clonenNode &&
|
|
90
|
-
const v = C(() => e.clonenNode ? e.index : l == null ? void 0 : l.children.findIndex((c) => c.proxy === (
|
|
89
|
+
!e.clonenNode && a && (l == null || l.children.push(a));
|
|
90
|
+
const v = C(() => e.clonenNode ? e.index : l == null ? void 0 : l.children.findIndex((c) => c.proxy === (a == null ? void 0 : a.proxy))), u = C(() => {
|
|
91
91
|
const c = `${(l == null ? void 0 : l.itemDetail.size) || 0}px`;
|
|
92
|
-
let
|
|
92
|
+
let r = "auto";
|
|
93
93
|
const f = `${(l == null ? void 0 : l.itemDetail.space) || 0}px`;
|
|
94
|
-
return l != null && l.props.autoHeight && (l == null ? void 0 : l.activeIndex) !== v.value && (
|
|
94
|
+
return l != null && l.props.autoHeight && (l == null ? void 0 : l.activeIndex) !== v.value && (r = "0"), l != null && l.props.vertical ? {
|
|
95
95
|
height: c,
|
|
96
|
-
width:
|
|
96
|
+
width: r,
|
|
97
97
|
marginBottom: f
|
|
98
98
|
} : {
|
|
99
99
|
width: c,
|
|
100
|
-
height:
|
|
100
|
+
height: r,
|
|
101
101
|
marginRight: f
|
|
102
102
|
};
|
|
103
103
|
});
|
|
104
104
|
return () => {
|
|
105
|
-
var
|
|
106
|
-
const c = ((
|
|
105
|
+
var r, f;
|
|
106
|
+
const c = ((r = l == null ? void 0 : l.itemShowedList) == null ? void 0 : r.list[v.value || 0]) || !1;
|
|
107
107
|
return b("div", {
|
|
108
|
-
class:
|
|
108
|
+
class: Ie(),
|
|
109
109
|
style: u.value
|
|
110
110
|
}, [c ? e.clonenNode || ((f = n.default) == null ? void 0 : f.call(n)) : null]);
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
}),
|
|
113
|
+
}), Be = {
|
|
114
114
|
autoplayTime: {
|
|
115
115
|
type: Number,
|
|
116
116
|
default: 0
|
|
@@ -180,15 +180,15 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
180
180
|
components: {
|
|
181
181
|
YSwipeItem: K
|
|
182
182
|
},
|
|
183
|
-
props:
|
|
183
|
+
props: Be,
|
|
184
184
|
setup(e, {
|
|
185
185
|
slots: n,
|
|
186
|
-
emit:
|
|
186
|
+
emit: a,
|
|
187
187
|
expose: l
|
|
188
188
|
}) {
|
|
189
189
|
const {
|
|
190
190
|
initProvide: v
|
|
191
|
-
} = ce(de), u = N([]), c = z(Number(e.initIndex)),
|
|
191
|
+
} = ce(de), u = N([]), c = z(Number(e.initIndex)), r = N({
|
|
192
192
|
// 元素尺寸
|
|
193
193
|
size: 0,
|
|
194
194
|
// 间距
|
|
@@ -202,37 +202,37 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
202
202
|
viewportSize: 0,
|
|
203
203
|
// 重复节点个数
|
|
204
204
|
cloneNodeCount: 0
|
|
205
|
-
}), T = z(), g = z(),
|
|
206
|
-
const t = u.length,
|
|
205
|
+
}), T = z(), g = z(), I = () => {
|
|
206
|
+
const t = u.length, s = [];
|
|
207
207
|
for (let m = 0; m < t; m++)
|
|
208
|
-
|
|
209
|
-
return
|
|
208
|
+
s.push(!e.lazy);
|
|
209
|
+
return s;
|
|
210
210
|
}, R = () => {
|
|
211
211
|
if (!e.lazy)
|
|
212
212
|
return;
|
|
213
|
-
const t =
|
|
214
|
-
let m = -(f.offset +
|
|
215
|
-
m < 0 && (m +=
|
|
213
|
+
const t = r.size + r.space, s = u.length * t;
|
|
214
|
+
let m = -(f.offset + o.offset) - f.cloneNodeCount * t;
|
|
215
|
+
m < 0 && (m += s);
|
|
216
216
|
const w = m + f.viewportSize;
|
|
217
217
|
for (let y = 0; y < u.length; y++)
|
|
218
218
|
if (!k.list[y]) {
|
|
219
|
-
const p = t * y, E = p +
|
|
219
|
+
const p = t * y, E = p + r.size;
|
|
220
220
|
(p >= m && p < w || E > m && E < w || p < m && E > w) && (k.list[y] = !0);
|
|
221
221
|
}
|
|
222
222
|
}, k = N({
|
|
223
|
-
list:
|
|
223
|
+
list: I()
|
|
224
224
|
}), S = () => {
|
|
225
|
-
k.list =
|
|
225
|
+
k.list = I(), R();
|
|
226
226
|
};
|
|
227
227
|
Z(() => [...u], S);
|
|
228
|
-
const
|
|
229
|
-
t ?
|
|
228
|
+
const B = (t, s) => {
|
|
229
|
+
t ? r.size = ie(t, s) : r.size = s, r.space = Number(e.itemSpace) || 0, r.isFillViewport = r.size >= s, f.viewportSize = s, f.cloneNodeCount = G();
|
|
230
230
|
}, G = () => {
|
|
231
231
|
if (x.value) {
|
|
232
|
-
const t =
|
|
232
|
+
const t = r.size + r.space;
|
|
233
233
|
if (t === 0)
|
|
234
234
|
return 0;
|
|
235
|
-
const
|
|
235
|
+
const s = f.viewportSize * 2 - t, m = Math.ceil(s / t);
|
|
236
236
|
return Math.min(m, u.length - 1);
|
|
237
237
|
}
|
|
238
238
|
return 0;
|
|
@@ -241,9 +241,9 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
241
241
|
return;
|
|
242
242
|
const {
|
|
243
243
|
width: t,
|
|
244
|
-
height:
|
|
244
|
+
height: s
|
|
245
245
|
} = T.value.getBoundingClientRect();
|
|
246
|
-
e.vertical ?
|
|
246
|
+
e.vertical ? B(e.itemSize, s) : B(e.itemSize, t), c.value = c.value >= u.length ? u.length - 1 : c.value, c.value < 0 && (c.value = 0), D(c.value), S(), h();
|
|
247
247
|
};
|
|
248
248
|
re(() => {
|
|
249
249
|
if (ee(L).catch(() => {
|
|
@@ -266,23 +266,23 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
266
266
|
t = 0;
|
|
267
267
|
break;
|
|
268
268
|
case W.center:
|
|
269
|
-
t = (f.viewportSize -
|
|
269
|
+
t = (f.viewportSize - r.size) / 2;
|
|
270
270
|
break;
|
|
271
271
|
case W.end:
|
|
272
|
-
t = f.viewportSize -
|
|
272
|
+
t = f.viewportSize - r.size;
|
|
273
273
|
break;
|
|
274
274
|
default:
|
|
275
275
|
t = 0;
|
|
276
276
|
}
|
|
277
277
|
return t;
|
|
278
|
-
}), x = C(() => e.loop && u.length > 1),
|
|
279
|
-
const
|
|
280
|
-
x.value ? f.offset = -
|
|
278
|
+
}), x = C(() => e.loop && u.length > 1), D = (t) => {
|
|
279
|
+
const s = r.size + r.space;
|
|
280
|
+
x.value ? f.offset = -s * (t + f.cloneNodeCount) + j.value : (f.offset = -s * t + j.value, e.align !== "center" && (t === 0 && (f.offset = 0), t === u.length - 1 && (f.offset = -s * t + f.viewportSize - r.size)));
|
|
281
281
|
}, F = () => {
|
|
282
|
-
|
|
283
|
-
}, _ = (t) => (u.length + t) % u.length, A = (t,
|
|
284
|
-
c.value = _(t),
|
|
285
|
-
|
|
282
|
+
D(c.value), a("afterChange", c.value);
|
|
283
|
+
}, _ = (t) => (u.length + t) % u.length, A = (t, s = !0) => {
|
|
284
|
+
c.value = _(t), D(t), R(), a("change", c.value), s ? (o.transitionEnabled = !0, g.value && g.value.addEventListener("transitionend", () => {
|
|
285
|
+
o.transitionEnabled = !1, F();
|
|
286
286
|
}, {
|
|
287
287
|
once: !0
|
|
288
288
|
})) : F();
|
|
@@ -298,7 +298,7 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
298
298
|
e.autoplayTime && u.length > 1 && (i && clearInterval(i), i = setInterval(() => {
|
|
299
299
|
O();
|
|
300
300
|
}, Number(e.autoplayTime)));
|
|
301
|
-
},
|
|
301
|
+
}, o = N({
|
|
302
302
|
// 拖拽中
|
|
303
303
|
isDragging: !1,
|
|
304
304
|
// 是否首次拖动
|
|
@@ -312,40 +312,42 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
312
312
|
// 开始拖动时间
|
|
313
313
|
startTime: /* @__PURE__ */ new Date(),
|
|
314
314
|
// 是否在执行动画
|
|
315
|
-
transitionEnabled: !1
|
|
315
|
+
transitionEnabled: !1,
|
|
316
|
+
// 当前次拖拽不满足翻页条件
|
|
317
|
+
isDissatisfy: !1
|
|
316
318
|
}), M = (t) => {
|
|
317
|
-
if (
|
|
319
|
+
if (o.transitionEnabled)
|
|
318
320
|
return;
|
|
319
|
-
let
|
|
320
|
-
"touches" in t ? (
|
|
321
|
+
let s = 0, m = 0;
|
|
322
|
+
"touches" in t ? (s = t.touches[0].clientX, m = t.touches[0].clientY) : (s = t.clientX, m = t.clientY), o.startX = s, o.startY = m, o.isDragging = !0, o.isFirstTouch = !0, o.startTime = /* @__PURE__ */ new Date(), d();
|
|
321
323
|
}, P = (t) => {
|
|
322
|
-
if (!
|
|
324
|
+
if (!o.isDragging)
|
|
323
325
|
return;
|
|
324
|
-
let
|
|
325
|
-
"touches" in t ? (
|
|
326
|
-
const w =
|
|
327
|
-
if (
|
|
328
|
-
|
|
326
|
+
let s = 0, m = 0;
|
|
327
|
+
"touches" in t ? (s = t.touches[0].clientX, m = t.touches[0].clientY) : (s = t.clientX, m = t.clientY);
|
|
328
|
+
const w = s - o.startX, y = m - o.startY;
|
|
329
|
+
if (o.isFirstTouch && (o.isFirstTouch = !1, Math.abs(w) < Math.abs(y) !== e.vertical)) {
|
|
330
|
+
o.isDragging = !1;
|
|
329
331
|
return;
|
|
330
332
|
}
|
|
331
|
-
t.preventDefault(),
|
|
332
|
-
percent:
|
|
333
|
-
offset:
|
|
334
|
-
});
|
|
333
|
+
t.preventDefault(), o.offset = e.vertical ? y : w, R(), a("dragging", {
|
|
334
|
+
percent: o.offset / (r.size + r.space),
|
|
335
|
+
offset: o.offset
|
|
336
|
+
}), o.isDissatisfy = !1;
|
|
335
337
|
}, $ = () => {
|
|
336
|
-
if (!
|
|
338
|
+
if (!o.isDragging)
|
|
337
339
|
return;
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
he() && (Math.abs(
|
|
341
|
-
}, me = C(() => ie(e.minSwipeDistance,
|
|
340
|
+
o.isDragging = !1;
|
|
341
|
+
const s = (/* @__PURE__ */ new Date()).getTime() - o.startTime.getTime();
|
|
342
|
+
he() && (Math.abs(o.offset) > me.value || Math.abs(o.offset) / s > 0.5) ? (o.offset > 0 ? Y() : O(), o.offset = 0, o.isDissatisfy = !1) : (o.offset = 0, o.isDissatisfy = !0), h();
|
|
343
|
+
}, me = C(() => ie(e.minSwipeDistance, r.size + r.space)), he = () => {
|
|
342
344
|
if (x.value)
|
|
343
345
|
return !0;
|
|
344
|
-
const t =
|
|
346
|
+
const t = o.offset > 0 ? c.value - 1 : c.value + 1;
|
|
345
347
|
return t >= 0 && t < u.length;
|
|
346
348
|
}, ge = C(() => {
|
|
347
|
-
const t =
|
|
348
|
-
return e.vertical ? (
|
|
349
|
+
const t = o.isDragging && !e.isFollowHand ? f.offset : f.offset + o.offset, s = {};
|
|
350
|
+
return e.vertical ? (s.transform = `translate3d(0, ${t}px, 0)`, s.transitionDuration = o.transitionEnabled ? `${e.duration}ms` : "0ms") : (s.transform = `translate3d(${t}px, 0, 0)`, s.transitionDuration = o.transitionEnabled || o.isDissatisfy ? `${e.duration}ms` : "0ms"), o.isDragging && (s.transition = "none"), e.vertical && (s.flexDirection = "column"), e.autoHeight && (s.display = "block", s.whiteSpace = "nowrap"), s;
|
|
349
351
|
}), ye = C(() => ["y-swipe__dots", `y-swipe__dots--${e.dotsPosition || (e.vertical ? te.left : te.bottom)}`]);
|
|
350
352
|
l({
|
|
351
353
|
moveTo: A,
|
|
@@ -357,22 +359,22 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
357
359
|
children: u,
|
|
358
360
|
activeIndex: c,
|
|
359
361
|
props: e,
|
|
360
|
-
itemDetail:
|
|
362
|
+
itemDetail: r,
|
|
361
363
|
itemShowedList: k
|
|
362
364
|
});
|
|
363
365
|
v(be);
|
|
364
366
|
const we = () => e.dots ? b("div", {
|
|
365
367
|
class: ye.value
|
|
366
|
-
}, [u.map((t,
|
|
368
|
+
}, [u.map((t, s) => {
|
|
367
369
|
const m = q("dot", {
|
|
368
|
-
active:
|
|
370
|
+
active: s === c.value
|
|
369
371
|
});
|
|
370
372
|
return b("div", {
|
|
371
373
|
class: m,
|
|
372
374
|
style: {
|
|
373
375
|
backgroundColor: e.dotsColor
|
|
374
376
|
},
|
|
375
|
-
key:
|
|
377
|
+
key: s
|
|
376
378
|
}, null);
|
|
377
379
|
})]) : null;
|
|
378
380
|
return () => {
|
|
@@ -384,14 +386,14 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
384
386
|
class: q("track"),
|
|
385
387
|
style: ge.value,
|
|
386
388
|
ref: g
|
|
387
|
-
}, [Array(f.cloneNodeCount).fill("").map((
|
|
389
|
+
}, [Array(f.cloneNodeCount).fill("").map((s, m) => {
|
|
388
390
|
var p, E, X;
|
|
389
391
|
const w = _(m - f.cloneNodeCount), y = (X = (p = u[w]) == null ? void 0 : (E = p.slots).default) == null ? void 0 : X.call(E);
|
|
390
392
|
return y ? b(K, {
|
|
391
393
|
clonenNode: y,
|
|
392
394
|
index: w
|
|
393
395
|
}, null) : null;
|
|
394
|
-
}), (t = n.default) == null ? void 0 : t.call(n), Array(f.cloneNodeCount).fill("").map((
|
|
396
|
+
}), (t = n.default) == null ? void 0 : t.call(n), Array(f.cloneNodeCount).fill("").map((s, m) => {
|
|
395
397
|
var p, E, X;
|
|
396
398
|
const w = _(m), y = (X = (p = u[w]) == null ? void 0 : (E = p.slots).default) == null ? void 0 : X.call(E);
|
|
397
399
|
return y ? b(K, {
|
|
@@ -401,7 +403,7 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
401
403
|
})]), n.dots ? n.dots() : we()]);
|
|
402
404
|
};
|
|
403
405
|
}
|
|
404
|
-
}), [_e,
|
|
406
|
+
}), [_e, se] = U("tabs-title"), ae = /* @__PURE__ */ H({
|
|
405
407
|
name: _e,
|
|
406
408
|
props: {
|
|
407
409
|
active: {
|
|
@@ -428,12 +430,12 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
428
430
|
setup(e) {
|
|
429
431
|
const {
|
|
430
432
|
parent: n
|
|
431
|
-
} = ue(ve),
|
|
433
|
+
} = ue(ve), a = C(() => [{
|
|
432
434
|
"y-el--clickable": !e.disabled
|
|
433
|
-
},
|
|
435
|
+
}, se({
|
|
434
436
|
scrollable: e.scrollable,
|
|
435
437
|
disabled: e.disabled
|
|
436
|
-
}),
|
|
438
|
+
}), se(`${(n == null ? void 0 : n.props.size) || "middle"}`, {
|
|
437
439
|
active: e.active
|
|
438
440
|
}), n == null ? void 0 : n.props.titleClass, e.active ? n == null ? void 0 : n.props.titleActiveClass : ""]), l = C(() => ({
|
|
439
441
|
...n == null ? void 0 : n.props.titleStyle,
|
|
@@ -447,7 +449,7 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
447
449
|
titleSlot: u
|
|
448
450
|
} = e;
|
|
449
451
|
return b("div", {
|
|
450
|
-
class:
|
|
452
|
+
class: a.value,
|
|
451
453
|
title: v,
|
|
452
454
|
style: l.value,
|
|
453
455
|
role: "presentation"
|
|
@@ -522,49 +524,49 @@ const ie = (e, n) => typeof e == "string" && e.includes("%") && e.includes("%")
|
|
|
522
524
|
}
|
|
523
525
|
};
|
|
524
526
|
function Ye(e) {
|
|
525
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
527
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !oe(e);
|
|
526
528
|
}
|
|
527
529
|
const [ne, Q] = U("tabs"), ve = ne, Oe = /* @__PURE__ */ H({
|
|
528
530
|
name: ne,
|
|
529
531
|
components: {
|
|
530
|
-
YTabTitle:
|
|
532
|
+
YTabTitle: ae
|
|
531
533
|
},
|
|
532
534
|
props: Ae,
|
|
533
535
|
setup(e, {
|
|
534
536
|
slots: n,
|
|
535
|
-
emit:
|
|
537
|
+
emit: a,
|
|
536
538
|
expose: l
|
|
537
539
|
}) {
|
|
538
540
|
const {
|
|
539
541
|
initProvide: v
|
|
540
|
-
} = ce(ve), u = z(!1), c = N([]),
|
|
542
|
+
} = ce(ve), u = z(!1), c = N([]), r = z(), f = C(() => c.length > e.titleScrollThreshold), T = (i) => c.findIndex((d) => (d.$props ? d.$props.name : "") === i), g = z(e.initName ? T(e.initName) : e.initIndex), I = (i) => {
|
|
541
543
|
g.value = i;
|
|
542
|
-
const d =
|
|
544
|
+
const d = r.value;
|
|
543
545
|
d && (d == null || d.moveTo(i, e.changeWithAnimation));
|
|
544
546
|
};
|
|
545
547
|
l({
|
|
546
548
|
scrollToByIndex: (i) => {
|
|
547
|
-
|
|
549
|
+
I(i);
|
|
548
550
|
},
|
|
549
551
|
scrollToByName: (i) => {
|
|
550
552
|
const d = T(i);
|
|
551
|
-
|
|
553
|
+
I(d);
|
|
552
554
|
}
|
|
553
555
|
});
|
|
554
|
-
const S = z([]),
|
|
556
|
+
const S = z([]), B = z(), G = (i) => (d) => {
|
|
555
557
|
S.value[i] = d;
|
|
556
558
|
}, L = (i) => {
|
|
557
559
|
const {
|
|
558
560
|
title: d,
|
|
559
561
|
name: h,
|
|
560
|
-
disabled:
|
|
562
|
+
disabled: o
|
|
561
563
|
} = c[i].$props || {};
|
|
562
|
-
g.value !== i && (o
|
|
564
|
+
g.value !== i && (a(o ? "disabledClick" : "click", i, d, h), !o && I(i));
|
|
563
565
|
}, j = async () => {
|
|
564
566
|
await ee(() => {
|
|
565
|
-
if (!f.value || !
|
|
567
|
+
if (!f.value || !B.value)
|
|
566
568
|
return;
|
|
567
|
-
const i =
|
|
569
|
+
const i = B.value;
|
|
568
570
|
if (!i || !S.value[g.value])
|
|
569
571
|
return;
|
|
570
572
|
const d = S.value[g.value].$el, h = d.offsetLeft - (i.offsetWidth - d.offsetWidth) / 2 - i.scrollLeft;
|
|
@@ -580,7 +582,7 @@ const [ne, Q] = U("tabs"), ve = ne, Oe = /* @__PURE__ */ H({
|
|
|
580
582
|
const x = N({
|
|
581
583
|
transform: "translateX(50%)",
|
|
582
584
|
transition: "all 0ms ease-out"
|
|
583
|
-
}),
|
|
585
|
+
}), D = async () => {
|
|
584
586
|
await ee(() => {
|
|
585
587
|
if (!S.value || S.value.length === 0)
|
|
586
588
|
return;
|
|
@@ -592,13 +594,13 @@ const [ne, Q] = U("tabs"), ve = ne, Oe = /* @__PURE__ */ H({
|
|
|
592
594
|
title: d,
|
|
593
595
|
name: h
|
|
594
596
|
} = c[i].$props || {};
|
|
595
|
-
|
|
597
|
+
a("change", i, d, h), g.value = i;
|
|
596
598
|
}, _ = (i) => {
|
|
597
599
|
const {
|
|
598
600
|
title: d,
|
|
599
601
|
name: h
|
|
600
602
|
} = c[i].$props || {};
|
|
601
|
-
|
|
603
|
+
a("afterChange", i, d, h), g.value = i;
|
|
602
604
|
}, A = N({
|
|
603
605
|
children: c,
|
|
604
606
|
activeIndex: g,
|
|
@@ -607,14 +609,14 @@ const [ne, Q] = U("tabs"), ve = ne, Oe = /* @__PURE__ */ H({
|
|
|
607
609
|
v(A);
|
|
608
610
|
const Y = (i) => O(i) && /^\d+(\.\d+)?$/.test(i) ? `${i}px` : i, O = (i) => Object.prototype.toString.call(i) === "[object String]";
|
|
609
611
|
return re(async () => {
|
|
610
|
-
await
|
|
612
|
+
await D();
|
|
611
613
|
}), Z(() => g.value, async () => {
|
|
612
|
-
await
|
|
614
|
+
await D(), await j();
|
|
613
615
|
}), Z(() => {
|
|
614
616
|
var i;
|
|
615
617
|
return (i = n.default) == null ? void 0 : i.length;
|
|
616
618
|
}, async () => {
|
|
617
|
-
await
|
|
619
|
+
await D();
|
|
618
620
|
}), () => {
|
|
619
621
|
let i;
|
|
620
622
|
return b("div", {
|
|
@@ -622,13 +624,13 @@ const [ne, Q] = U("tabs"), ve = ne, Oe = /* @__PURE__ */ H({
|
|
|
622
624
|
}, [b("div", {
|
|
623
625
|
class: Q("list")
|
|
624
626
|
}, [b("div", {
|
|
625
|
-
ref:
|
|
627
|
+
ref: B,
|
|
626
628
|
class: Q("list-child-wrapper", {
|
|
627
629
|
scrollable: f.value,
|
|
628
630
|
[e.size]: e.size,
|
|
629
631
|
[e.align]: e.align
|
|
630
632
|
})
|
|
631
|
-
}, [c.length > 0 && c.map((d, h) => b(
|
|
633
|
+
}, [c.length > 0 && c.map((d, h) => b(ae, {
|
|
632
634
|
title: d.title,
|
|
633
635
|
disabled: d.disabled,
|
|
634
636
|
"title-slot": d.$slots.title,
|
|
@@ -646,7 +648,7 @@ const [ne, Q] = U("tabs"), ve = ne, Oe = /* @__PURE__ */ H({
|
|
|
646
648
|
backgroundColor: e.lineColor
|
|
647
649
|
}
|
|
648
650
|
}, null)])]), n.default ? b(ke, {
|
|
649
|
-
ref:
|
|
651
|
+
ref: r,
|
|
650
652
|
dots: !1,
|
|
651
653
|
loop: !1,
|
|
652
654
|
initIndex: g.value,
|
|
@@ -664,9 +666,9 @@ const [ne, Q] = U("tabs"), ve = ne, Oe = /* @__PURE__ */ H({
|
|
|
664
666
|
});
|
|
665
667
|
function Xe(e) {
|
|
666
668
|
const n = e;
|
|
667
|
-
return n.install = (
|
|
669
|
+
return n.install = (a) => {
|
|
668
670
|
const { name: l } = e;
|
|
669
|
-
l &&
|
|
671
|
+
l && a.component(l, e);
|
|
670
672
|
}, n;
|
|
671
673
|
}
|
|
672
674
|
const je = Xe(Oe);
|