y-design-ssr 1.1.9 → 1.1.11
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 +132 -126
- package/libs/index.umd.js +1 -1
- package/package.json +1 -1
package/libs/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as L, reactive as F, getCurrentInstance as le, provide as _t, isVNode as Se, inject as zt, onUnmounted as we, computed as B, defineComponent as z, createVNode as f, watch as j, onMounted as
|
|
1
|
+
import { ref as L, reactive as F, getCurrentInstance as le, provide as _t, isVNode as Se, inject as zt, onUnmounted as we, computed as B, defineComponent as z, createVNode as f, watch as j, onMounted as Z, nextTick as ie, onBeforeUnmount as xe, onBeforeUpdate as st, onUpdated as yn, createTextVNode as bn, Fragment as He, createApp as Ce, h as Ve, Transition as We, withDirectives as te, vShow as ye, Teleport as ct, vModelText as Ot, mergeProps as Ie, vModelDynamic as Sn, resolveDirective as gt, watchEffect as wn, unref as pt } from "vue";
|
|
2
2
|
const xn = {
|
|
3
3
|
"pull-refresh": {
|
|
4
4
|
pulling: "下拉刷新...",
|
|
@@ -231,13 +231,13 @@ const R = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, bt = (
|
|
|
231
231
|
if (!e.lazy)
|
|
232
232
|
return;
|
|
233
233
|
const $ = i.size + i.space, _ = r.length * $;
|
|
234
|
-
let W = -(m.offset +
|
|
234
|
+
let W = -(m.offset + V.offset) - m.cloneNodeCount * $;
|
|
235
235
|
W < 0 && (W += _);
|
|
236
|
-
const
|
|
236
|
+
const G = W + m.viewportSize;
|
|
237
237
|
for (let X = 0; X < r.length; X++)
|
|
238
238
|
if (!s.list[X]) {
|
|
239
239
|
const J = $ * X, re = J + i.size;
|
|
240
|
-
(J >= W && J <
|
|
240
|
+
(J >= W && J < G || re > W && re < G || J < W && re > G) && (s.list[X] = !0);
|
|
241
241
|
}
|
|
242
242
|
}, s = F({
|
|
243
243
|
list: c()
|
|
@@ -265,17 +265,17 @@ const R = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, bt = (
|
|
|
265
265
|
} = g.value.getBoundingClientRect();
|
|
266
266
|
e.vertical ? d(e.itemSize, _) : d(e.itemSize, $), l.value = l.value >= r.length ? r.length - 1 : l.value, l.value < 0 && (l.value = 0), u(l.value), w(), D();
|
|
267
267
|
};
|
|
268
|
-
|
|
268
|
+
Z(() => {
|
|
269
269
|
if (ie(S).catch(() => {
|
|
270
270
|
}), e.touchable && g.value) {
|
|
271
271
|
const $ = g.value;
|
|
272
|
-
$.addEventListener("touchstart", U, !1), $.addEventListener("mousedown", U, !1), $.addEventListener("touchmove",
|
|
272
|
+
$.addEventListener("touchstart", U, !1), $.addEventListener("mousedown", U, !1), $.addEventListener("touchmove", q, !1), $.addEventListener("mousemove", q, !1), $.addEventListener("touchend", I, !1), $.addEventListener("mouseup", I, !1), $.addEventListener("mouseleave", I, !1), $.addEventListener("touchcancel", I, !1);
|
|
273
273
|
}
|
|
274
274
|
window.addEventListener("resize", S, !1), window.addEventListener("orientationchange", S, !1);
|
|
275
275
|
}), xe(() => {
|
|
276
|
-
if (
|
|
276
|
+
if (P(), e.touchable && g.value) {
|
|
277
277
|
const $ = g.value;
|
|
278
|
-
$.removeEventListener("touchstart", U, !1), $.removeEventListener("mousedown", U, !1), $.removeEventListener("mousemove",
|
|
278
|
+
$.removeEventListener("touchstart", U, !1), $.removeEventListener("mousedown", U, !1), $.removeEventListener("mousemove", q, !1), $.removeEventListener("touchmove", q, !1), $.removeEventListener("mouseup", I, !1), $.removeEventListener("touchend", I, !1), $.removeEventListener("mouseleave", I, !1), $.removeEventListener("touchcancel", I, !1);
|
|
279
279
|
}
|
|
280
280
|
window.removeEventListener("resize", S, !1), window.removeEventListener("orientationchange", S, !1);
|
|
281
281
|
});
|
|
@@ -301,8 +301,8 @@ const R = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, bt = (
|
|
|
301
301
|
}, y = () => {
|
|
302
302
|
u(l.value), o("afterChange", l.value);
|
|
303
303
|
}, C = ($) => (r.length + $) % r.length, b = ($, _ = !0) => {
|
|
304
|
-
l.value = C($), u($), h(), o("change", l.value), _ ? (
|
|
305
|
-
|
|
304
|
+
l.value = C($), u($), h(), o("change", l.value), _ ? (V.transitionEnabled = !0, x.value && x.value.addEventListener("transitionend", () => {
|
|
305
|
+
V.transitionEnabled = !1, y();
|
|
306
306
|
}, {
|
|
307
307
|
once: !0
|
|
308
308
|
})) : y();
|
|
@@ -312,13 +312,13 @@ const R = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, bt = (
|
|
|
312
312
|
b(l.value + 1, $);
|
|
313
313
|
};
|
|
314
314
|
let E = null;
|
|
315
|
-
const
|
|
315
|
+
const P = () => {
|
|
316
316
|
e.autoplayTime && E && clearInterval(E);
|
|
317
317
|
}, D = () => {
|
|
318
318
|
e.autoplayTime && r.length > 1 && (E && clearInterval(E), E = setInterval(() => {
|
|
319
319
|
N();
|
|
320
320
|
}, Number(e.autoplayTime)));
|
|
321
|
-
},
|
|
321
|
+
}, V = F({
|
|
322
322
|
// 拖拽中
|
|
323
323
|
isDragging: !1,
|
|
324
324
|
// 是否首次拖动
|
|
@@ -336,38 +336,38 @@ const R = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, bt = (
|
|
|
336
336
|
// 当前次拖拽不满足翻页条件
|
|
337
337
|
isDissatisfy: !1
|
|
338
338
|
}), U = ($) => {
|
|
339
|
-
if (
|
|
339
|
+
if (V.transitionEnabled)
|
|
340
340
|
return;
|
|
341
341
|
let _ = 0, W = 0;
|
|
342
|
-
"touches" in $ ? (_ = $.touches[0].clientX, W = $.touches[0].clientY) : (_ = $.clientX, W = $.clientY),
|
|
343
|
-
},
|
|
344
|
-
if (!
|
|
342
|
+
"touches" in $ ? (_ = $.touches[0].clientX, W = $.touches[0].clientY) : (_ = $.clientX, W = $.clientY), V.startX = _, V.startY = W, V.isDragging = !0, V.isFirstTouch = !0, V.startTime = /* @__PURE__ */ new Date(), P();
|
|
343
|
+
}, q = ($) => {
|
|
344
|
+
if (!V.isDragging)
|
|
345
345
|
return;
|
|
346
346
|
let _ = 0, W = 0;
|
|
347
347
|
"touches" in $ ? (_ = $.touches[0].clientX, W = $.touches[0].clientY) : (_ = $.clientX, W = $.clientY);
|
|
348
|
-
const
|
|
349
|
-
if (
|
|
350
|
-
|
|
348
|
+
const G = _ - V.startX, X = W - V.startY;
|
|
349
|
+
if (V.isFirstTouch && (V.isFirstTouch = !1, Math.abs(G) < Math.abs(X) !== e.vertical)) {
|
|
350
|
+
V.isDragging = !1;
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
|
-
$.preventDefault(),
|
|
354
|
-
percent:
|
|
355
|
-
offset:
|
|
356
|
-
}),
|
|
357
|
-
},
|
|
358
|
-
if (!
|
|
353
|
+
$.preventDefault(), V.offset = e.vertical ? X : G, h(), o("dragging", {
|
|
354
|
+
percent: V.offset / (i.size + i.space),
|
|
355
|
+
offset: V.offset
|
|
356
|
+
}), V.isDissatisfy = !1;
|
|
357
|
+
}, I = () => {
|
|
358
|
+
if (!V.isDragging)
|
|
359
359
|
return;
|
|
360
|
-
|
|
361
|
-
const _ = (/* @__PURE__ */ new Date()).getTime() -
|
|
362
|
-
H() && (Math.abs(
|
|
360
|
+
V.isDragging = !1;
|
|
361
|
+
const _ = (/* @__PURE__ */ new Date()).getTime() - V.startTime.getTime();
|
|
362
|
+
H() && (Math.abs(V.offset) > A.value || Math.abs(V.offset) / _ > 0.5) ? (V.offset > 0 ? T() : N(), V.offset = 0, V.isDissatisfy = !1) : (V.offset = 0, V.isDissatisfy = !0), D();
|
|
363
363
|
}, A = B(() => bt(e.minSwipeDistance, i.size + i.space)), H = () => {
|
|
364
364
|
if (v.value)
|
|
365
365
|
return !0;
|
|
366
|
-
const $ =
|
|
366
|
+
const $ = V.offset > 0 ? l.value - 1 : l.value + 1;
|
|
367
367
|
return $ >= 0 && $ < r.length;
|
|
368
368
|
}, ue = B(() => {
|
|
369
|
-
const $ =
|
|
370
|
-
return e.vertical ? (_.transform = `translate3d(0, ${$}px, 0)`, _.transitionDuration =
|
|
369
|
+
const $ = V.isDragging && !e.isFollowHand ? m.offset : m.offset + V.offset, _ = {};
|
|
370
|
+
return e.vertical ? (_.transform = `translate3d(0, ${$}px, 0)`, _.transitionDuration = V.transitionEnabled || V.isDissatisfy ? `${e.duration}ms` : "0ms") : (_.transform = `translate3d(${$}px, 0, 0)`, _.transitionDuration = V.transitionEnabled || V.isDissatisfy ? `${e.duration}ms` : "0ms"), V.isDragging && (_.transition = "none"), e.vertical && (_.flexDirection = "column"), e.autoHeight && (_.display = "block", _.whiteSpace = "nowrap"), _;
|
|
371
371
|
}), Q = B(() => ["y-swipe__dots", `y-swipe__dots--${e.dotsPosition || (e.vertical ? Je.left : Je.bottom)}`]);
|
|
372
372
|
n({
|
|
373
373
|
moveTo: b,
|
|
@@ -408,17 +408,17 @@ const R = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, bt = (
|
|
|
408
408
|
ref: x
|
|
409
409
|
}, [Array(m.cloneNodeCount).fill("").map((_, W) => {
|
|
410
410
|
var J, re, $e;
|
|
411
|
-
const
|
|
411
|
+
const G = C(W - m.cloneNodeCount), X = ($e = (J = r[G]) == null ? void 0 : (re = J.slots).default) == null ? void 0 : $e.call(re);
|
|
412
412
|
return X ? f(Le, {
|
|
413
413
|
clonenNode: X,
|
|
414
|
-
index:
|
|
414
|
+
index: G
|
|
415
415
|
}, null) : null;
|
|
416
416
|
}), ($ = t.default) == null ? void 0 : $.call(t), Array(m.cloneNodeCount).fill("").map((_, W) => {
|
|
417
417
|
var J, re, $e;
|
|
418
|
-
const
|
|
418
|
+
const G = C(W), X = ($e = (J = r[G]) == null ? void 0 : (re = J.slots).default) == null ? void 0 : $e.call(re);
|
|
419
419
|
return X ? f(Le, {
|
|
420
420
|
clonenNode: X,
|
|
421
|
-
index:
|
|
421
|
+
index: G
|
|
422
422
|
}, null) : null;
|
|
423
423
|
})]), t.dots ? t.dots() : oe()]);
|
|
424
424
|
};
|
|
@@ -607,11 +607,11 @@ var et = {}, Mn = {
|
|
|
607
607
|
N = N > 1 ? 1 : N, C = h(N), b = u.startX + (u.x - u.startX) * C, T = u.startY + (u.y - u.startY) * C, u.method.call(u.scrollable, b, T), (b !== u.x || T !== u.y) && n.requestAnimationFrame(k.bind(n, u));
|
|
608
608
|
}
|
|
609
609
|
function v(u, y, C) {
|
|
610
|
-
var b, T, N, E,
|
|
610
|
+
var b, T, N, E, P = m();
|
|
611
611
|
u === a.body ? (b = n, T = n.scrollX || n.pageXOffset, N = n.scrollY || n.pageYOffset, E = i.scroll) : (b = u, T = u.scrollLeft, N = u.scrollTop, E = c), k({
|
|
612
612
|
scrollable: b,
|
|
613
613
|
method: E,
|
|
614
|
-
startTime:
|
|
614
|
+
startTime: P,
|
|
615
615
|
startX: T,
|
|
616
616
|
startY: N,
|
|
617
617
|
x: y,
|
|
@@ -735,29 +735,29 @@ const [tt, je] = O("tabs"), ft = tt, An = /* @__PURE__ */ z({
|
|
|
735
735
|
}) {
|
|
736
736
|
const {
|
|
737
737
|
initProvide: a
|
|
738
|
-
} = fe(ft), r = L(!1), l = F([]), i = L(), m = B(() => l.length > e.titleScrollThreshold), g = (E) => l.findIndex((
|
|
738
|
+
} = fe(ft), r = L(!1), l = F([]), i = L(), m = B(() => l.length > e.titleScrollThreshold), g = (E) => l.findIndex((P) => (P.$props ? P.$props.name : "") === E), x = L(e.initName ? g(e.initName) : e.initIndex), c = (E) => {
|
|
739
739
|
x.value = E;
|
|
740
|
-
const
|
|
741
|
-
|
|
740
|
+
const P = i.value;
|
|
741
|
+
P && (P == null || P.moveTo(E, e.changeWithAnimation));
|
|
742
742
|
};
|
|
743
743
|
n({
|
|
744
744
|
scrollToByIndex: (E) => {
|
|
745
745
|
c(E);
|
|
746
746
|
},
|
|
747
747
|
scrollToByName: (E) => {
|
|
748
|
-
const
|
|
749
|
-
c(
|
|
748
|
+
const P = g(E);
|
|
749
|
+
c(P);
|
|
750
750
|
}
|
|
751
751
|
});
|
|
752
|
-
const w = L([]), d = L(), p = (E) => (
|
|
753
|
-
w.value[E] =
|
|
752
|
+
const w = L([]), d = L(), p = (E) => (P) => {
|
|
753
|
+
w.value[E] = P;
|
|
754
754
|
}, S = (E) => {
|
|
755
755
|
const {
|
|
756
|
-
title:
|
|
756
|
+
title: P,
|
|
757
757
|
name: D,
|
|
758
|
-
disabled:
|
|
758
|
+
disabled: V
|
|
759
759
|
} = l[E].$props || {};
|
|
760
|
-
x.value !== E && (o(
|
|
760
|
+
x.value !== E && (o(V ? "disabledClick" : "click", E, P, D), !V && c(E));
|
|
761
761
|
}, k = async () => {
|
|
762
762
|
await ie(() => {
|
|
763
763
|
if (!m.value || !d.value)
|
|
@@ -765,7 +765,7 @@ const [tt, je] = O("tabs"), ft = tt, An = /* @__PURE__ */ z({
|
|
|
765
765
|
const E = d.value;
|
|
766
766
|
if (!E || !w.value[x.value])
|
|
767
767
|
return;
|
|
768
|
-
const
|
|
768
|
+
const P = w.value[x.value].$el, D = P.offsetLeft - (E.offsetWidth - P.offsetWidth) / 2;
|
|
769
769
|
E.scrollTo({
|
|
770
770
|
left: D,
|
|
771
771
|
behavior: "smooth"
|
|
@@ -782,21 +782,21 @@ const [tt, je] = O("tabs"), ft = tt, An = /* @__PURE__ */ z({
|
|
|
782
782
|
await ie(() => {
|
|
783
783
|
if (!w.value || w.value.length === 0)
|
|
784
784
|
return;
|
|
785
|
-
const E = x.value >= w.value.length ? 0 : x.value,
|
|
785
|
+
const E = x.value >= w.value.length ? 0 : x.value, P = w.value[E].$el, D = P.offsetLeft + P.offsetWidth / 2;
|
|
786
786
|
v.transform = `translateX(${D}px) translateX(-50%)`, r.value && (v.transition = `all ${e.duration}ms ease-out`), r.value = !0;
|
|
787
787
|
});
|
|
788
788
|
}, y = (E) => {
|
|
789
789
|
const {
|
|
790
|
-
title:
|
|
790
|
+
title: P,
|
|
791
791
|
name: D
|
|
792
792
|
} = l[E].$props || {};
|
|
793
|
-
o("change", E,
|
|
793
|
+
o("change", E, P, D), x.value = E;
|
|
794
794
|
}, C = (E) => {
|
|
795
795
|
const {
|
|
796
|
-
title:
|
|
796
|
+
title: P,
|
|
797
797
|
name: D
|
|
798
798
|
} = l[E].$props || {};
|
|
799
|
-
o("afterChange", E,
|
|
799
|
+
o("afterChange", E, P, D), x.value = E;
|
|
800
800
|
}, b = F({
|
|
801
801
|
children: l,
|
|
802
802
|
activeIndex: x,
|
|
@@ -804,7 +804,7 @@ const [tt, je] = O("tabs"), ft = tt, An = /* @__PURE__ */ z({
|
|
|
804
804
|
});
|
|
805
805
|
a(b);
|
|
806
806
|
const T = (E) => N(E) && /^\d+(\.\d+)?$/.test(E) ? `${E}px` : E, N = (E) => Object.prototype.toString.call(E) === "[object String]";
|
|
807
|
-
return
|
|
807
|
+
return Z(async () => {
|
|
808
808
|
et.polyfill(), await u();
|
|
809
809
|
}), j(() => x.value, async () => {
|
|
810
810
|
await u(), await k();
|
|
@@ -826,10 +826,10 @@ const [tt, je] = O("tabs"), ft = tt, An = /* @__PURE__ */ z({
|
|
|
826
826
|
[e.size]: e.size,
|
|
827
827
|
[e.align]: e.align
|
|
828
828
|
})
|
|
829
|
-
}, [l.length > 0 && l.map((
|
|
830
|
-
title:
|
|
831
|
-
disabled:
|
|
832
|
-
"title-slot":
|
|
829
|
+
}, [l.length > 0 && l.map((P, D) => f(wt, {
|
|
830
|
+
title: P.title,
|
|
831
|
+
disabled: P.disabled,
|
|
832
|
+
"title-slot": P.$slots.title,
|
|
833
833
|
key: D,
|
|
834
834
|
ref: p(D),
|
|
835
835
|
active: x.value === D,
|
|
@@ -926,7 +926,7 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
926
926
|
isVertical: m,
|
|
927
927
|
isHorizontal: g
|
|
928
928
|
};
|
|
929
|
-
}, [qn,
|
|
929
|
+
}, [qn, K] = O("slider"), Gn = /* @__PURE__ */ z({
|
|
930
930
|
name: qn,
|
|
931
931
|
props: {
|
|
932
932
|
modelValue: {
|
|
@@ -992,8 +992,8 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
992
992
|
min: T,
|
|
993
993
|
max: N,
|
|
994
994
|
step: E
|
|
995
|
-
} = e,
|
|
996
|
-
return Math.round(
|
|
995
|
+
} = e, P = Math.max(T, Math.min(b, N));
|
|
996
|
+
return Math.round(P / E) * E;
|
|
997
997
|
}, x = (b) => {
|
|
998
998
|
if (b.stopPropagation(), e.disabled)
|
|
999
999
|
return;
|
|
@@ -1002,13 +1002,13 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
1002
1002
|
modelValue: N
|
|
1003
1003
|
} = e, {
|
|
1004
1004
|
left: E,
|
|
1005
|
-
width:
|
|
1006
|
-
} = n.value.getBoundingClientRect(), D = b.clientX - E,
|
|
1005
|
+
width: P
|
|
1006
|
+
} = n.value.getBoundingClientRect(), D = b.clientX - E, V = Math.floor(T + D / P * S.value);
|
|
1007
1007
|
if (m.value) {
|
|
1008
|
-
const U = N[0],
|
|
1009
|
-
|
|
1008
|
+
const U = N[0], q = N[1], I = (U + q) / 2;
|
|
1009
|
+
V <= I ? s([V, q]) : s([U, V]);
|
|
1010
1010
|
} else
|
|
1011
|
-
s(
|
|
1011
|
+
s(V);
|
|
1012
1012
|
}, c = (b) => b[0] > b[1] ? [b[1], b[0]] : b, h = (b, T) => JSON.stringify(b) === JSON.stringify(T), s = (b, T) => {
|
|
1013
1013
|
let N = 0;
|
|
1014
1014
|
m.value ? N = c(b).map(g) : N = g(b), t("update:modelValue", N), typeof T > "u" && !h(a.value, r.value) && t("change", N);
|
|
@@ -1036,19 +1036,19 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
1036
1036
|
i.move(b), l.value === "startMove" && t("drag-start"), l.value = "moving";
|
|
1037
1037
|
const {
|
|
1038
1038
|
width: N
|
|
1039
|
-
} = n.value.getBoundingClientRect(), E = i.deltaX.value,
|
|
1040
|
-
Array.isArray(a.value) && Array.isArray(r.value) ? T === "left" ? r.value[0] = a.value[0] +
|
|
1039
|
+
} = n.value.getBoundingClientRect(), E = i.deltaX.value, P = Math.floor(E / N * S.value);
|
|
1040
|
+
Array.isArray(a.value) && Array.isArray(r.value) ? T === "left" ? r.value[0] = a.value[0] + P : r.value[1] = a.value[1] + P : r.value = a.value + P, s(r.value, !0);
|
|
1041
1041
|
}, u = () => {
|
|
1042
1042
|
e.disabled || (l.value === "moving" && (s(r.value), t("drag-end")), l.value = "endMove");
|
|
1043
1043
|
}, y = (b) => {
|
|
1044
|
-
let T = "", N = {}, E = 0,
|
|
1044
|
+
let T = "", N = {}, E = 0, P = K("button-wrapper");
|
|
1045
1045
|
return b === 0 ? (T = "left", N = {
|
|
1046
1046
|
left: d.value,
|
|
1047
1047
|
backgroundColor: Array.isArray(e.buttonBgColor) ? e.buttonBgColor[0] : e.buttonBgColor
|
|
1048
|
-
}, E = e.modelValue[b],
|
|
1048
|
+
}, E = e.modelValue[b], P = K("button-wrapper", "left")) : b === 1 ? (T = "right", E = e.modelValue[b], N = {
|
|
1049
1049
|
left: `${parseInt(w.value) + parseInt(d.value)}%`,
|
|
1050
1050
|
backgroundColor: Array.isArray(e.buttonBgColor) ? e.buttonBgColor[1] : e.buttonBgColor
|
|
1051
|
-
},
|
|
1051
|
+
}, P = K("button-wrapper", "right")) : (E = e.modelValue, N = {
|
|
1052
1052
|
left: w.value,
|
|
1053
1053
|
backgroundColor: e.buttonBgColor
|
|
1054
1054
|
}), f("div", {
|
|
@@ -1056,7 +1056,7 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
1056
1056
|
"aria-valuemin": e.min,
|
|
1057
1057
|
"aria-valuemax": e.max,
|
|
1058
1058
|
"aria-valuenow": E,
|
|
1059
|
-
class:
|
|
1059
|
+
class: P,
|
|
1060
1060
|
onTouchstart: k,
|
|
1061
1061
|
onTouchmove: (D) => v(D, T),
|
|
1062
1062
|
onTouchend: u,
|
|
@@ -1065,7 +1065,7 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
1065
1065
|
transition: l.value === "moving" ? "none" : `${e.transitionTime}ms ease-in-out`
|
|
1066
1066
|
}
|
|
1067
1067
|
}, [o.button ? o.button() : f("div", {
|
|
1068
|
-
class:
|
|
1068
|
+
class: K("inner-button"),
|
|
1069
1069
|
style: N
|
|
1070
1070
|
}, null)]);
|
|
1071
1071
|
}, C = B(() => Array((e.max - e.min) / e.step).fill({}).map((T, N) => ({
|
|
@@ -1074,15 +1074,15 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
1074
1074
|
return () => {
|
|
1075
1075
|
var b;
|
|
1076
1076
|
return f("div", {
|
|
1077
|
-
class:
|
|
1077
|
+
class: K()
|
|
1078
1078
|
}, [o.iconLeft && f("div", {
|
|
1079
|
-
class:
|
|
1079
|
+
class: K("icon", {
|
|
1080
1080
|
left: !0
|
|
1081
1081
|
})
|
|
1082
1082
|
}, [o.iconLeft()]), f("div", {
|
|
1083
1083
|
role: "presentation",
|
|
1084
1084
|
ref: n,
|
|
1085
|
-
class:
|
|
1085
|
+
class: K("wrapper-main", {
|
|
1086
1086
|
disabled: e.disabled
|
|
1087
1087
|
}),
|
|
1088
1088
|
style: {
|
|
@@ -1091,16 +1091,16 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
1091
1091
|
},
|
|
1092
1092
|
onClick: x
|
|
1093
1093
|
}, [e.step !== 1 && f("div", {
|
|
1094
|
-
class:
|
|
1094
|
+
class: K("dots")
|
|
1095
1095
|
}, [C.value.map((T) => f("div", {
|
|
1096
|
-
class:
|
|
1096
|
+
class: K("dot"),
|
|
1097
1097
|
style: {
|
|
1098
1098
|
left: T.position,
|
|
1099
1099
|
background: e.gapColor,
|
|
1100
1100
|
width: R(e.gapWidth)
|
|
1101
1101
|
}
|
|
1102
1102
|
}, null))]), e.showTooltip && f("div", {
|
|
1103
|
-
class:
|
|
1103
|
+
class: K("tooltip", {
|
|
1104
1104
|
wrapper: o.toolTip
|
|
1105
1105
|
}),
|
|
1106
1106
|
style: p.value
|
|
@@ -1111,9 +1111,9 @@ const [Fn] = O("tab"), Hn = /* @__PURE__ */ z({
|
|
|
1111
1111
|
background: e.activeColor,
|
|
1112
1112
|
transition: l.value === "moving" ? "none" : `${e.transitionTime}ms ease-in-out`
|
|
1113
1113
|
},
|
|
1114
|
-
class:
|
|
1114
|
+
class: K("inner")
|
|
1115
1115
|
}, null), m.value ? [y(0), y(1)] : y()]), o.iconRight && f("div", {
|
|
1116
|
-
class:
|
|
1116
|
+
class: K("icon", {
|
|
1117
1117
|
right: !0
|
|
1118
1118
|
})
|
|
1119
1119
|
}, [o.iconRight()])]);
|
|
@@ -1319,14 +1319,14 @@ const Kn = M(Gn), [Zn, ge] = O("loading"), Qn = {
|
|
|
1319
1319
|
}) {
|
|
1320
1320
|
const a = L(0), r = L(!1), l = L("normal"), i = L(), m = L(), g = L(), x = L([]), c = L(0), h = L(0), s = L([]), w = B(() => $n(e.height) ? `${e.height}px` : e.height), d = B(() => s.value.length ? s.value[s.value.length - 1].bottom : 0), p = B(() => {
|
|
1321
1321
|
if (e.virtual) {
|
|
1322
|
-
const
|
|
1323
|
-
return u.value.slice(
|
|
1322
|
+
const I = c.value - S.value, A = h.value + k.value;
|
|
1323
|
+
return u.value.slice(I, A);
|
|
1324
1324
|
}
|
|
1325
1325
|
return u.value;
|
|
1326
|
-
}), S = B(() => Math.min(c.value, e.bufferScale * v.value)), k = B(() => Math.min(e.dataSource.length - h.value, e.bufferScale * v.value)), v = B(() => Math.ceil(a.value / parseInt(String(e.itemHeight)))), u = B(() => e.dataSource.map((
|
|
1327
|
-
l.value !== "loading" && (l.value = "loading", o("load", (
|
|
1326
|
+
}), S = B(() => Math.min(c.value, e.bufferScale * v.value)), k = B(() => Math.min(e.dataSource.length - h.value, e.bufferScale * v.value)), v = B(() => Math.ceil(a.value / parseInt(String(e.itemHeight)))), u = B(() => e.dataSource.map((I, A) => (I[e.keyName] = A, I))), y = () => r.value ? document.documentElement.scrollTop || document.body.scrollTop : i.value.scrollTop, C = () => r.value ? document.documentElement.scrollHeight : i.value.scrollHeight, b = () => {
|
|
1327
|
+
l.value !== "loading" && (l.value = "loading", o("load", (I) => {
|
|
1328
1328
|
if (l.value === "loading")
|
|
1329
|
-
switch (
|
|
1329
|
+
switch (I) {
|
|
1330
1330
|
case "error":
|
|
1331
1331
|
l.value = "error";
|
|
1332
1332
|
break;
|
|
@@ -1340,7 +1340,7 @@ const Kn = M(Gn), [Zn, ge] = O("loading"), Qn = {
|
|
|
1340
1340
|
}, T = () => {
|
|
1341
1341
|
l.value === "normal" && C() - y() - a.value <= e.loadOffset && b();
|
|
1342
1342
|
}, N = () => {
|
|
1343
|
-
s.value = u.value.map((
|
|
1343
|
+
s.value = u.value.map((I, A) => {
|
|
1344
1344
|
const H = parseInt(String(e.itemHeight));
|
|
1345
1345
|
return {
|
|
1346
1346
|
index: A,
|
|
@@ -1351,26 +1351,26 @@ const Kn = M(Gn), [Zn, ge] = O("loading"), Qn = {
|
|
|
1351
1351
|
});
|
|
1352
1352
|
}, E = () => {
|
|
1353
1353
|
N();
|
|
1354
|
-
for (let
|
|
1355
|
-
s.value[
|
|
1356
|
-
},
|
|
1357
|
-
let H = 0, ue =
|
|
1354
|
+
for (let I = 1; I < s.value.length; I++)
|
|
1355
|
+
s.value[I].top = s.value[I - 1].bottom, s.value[I].bottom = s.value[I].top + s.value[I].height;
|
|
1356
|
+
}, P = (I, A) => {
|
|
1357
|
+
let H = 0, ue = I.length - 1, Q = -1;
|
|
1358
1358
|
for (; H <= ue; ) {
|
|
1359
|
-
const ae = Math.floor((H + ue) / 2), oe =
|
|
1359
|
+
const ae = Math.floor((H + ue) / 2), oe = I[ae].bottom;
|
|
1360
1360
|
if (oe === A)
|
|
1361
1361
|
return ae + 1;
|
|
1362
1362
|
oe < A ? H = ae + 1 : oe > A && ((Q === -1 || Q > ae) && (Q = ae), ue = ae - 1);
|
|
1363
1363
|
}
|
|
1364
1364
|
return Q;
|
|
1365
|
-
}, D = (
|
|
1365
|
+
}, D = (I) => P(s.value, I), V = () => {
|
|
1366
1366
|
if (T(), e.virtual) {
|
|
1367
|
-
const
|
|
1368
|
-
U(
|
|
1367
|
+
const I = y();
|
|
1368
|
+
U(I);
|
|
1369
1369
|
}
|
|
1370
|
-
}, U = (
|
|
1370
|
+
}, U = (I) => {
|
|
1371
1371
|
if (!m.value)
|
|
1372
1372
|
return;
|
|
1373
|
-
const A =
|
|
1373
|
+
const A = I || 0;
|
|
1374
1374
|
if (e.dynamicItemHeight) {
|
|
1375
1375
|
c.value = D(A), h.value = c.value + v.value;
|
|
1376
1376
|
const H = s.value[c.value - S.value].top ? s.value[c.value - S.value].top : 0;
|
|
@@ -1380,11 +1380,11 @@ const Kn = M(Gn), [Zn, ge] = O("loading"), Qn = {
|
|
|
1380
1380
|
const H = c.value * parseInt(String(e.itemHeight)) - S.value * parseInt(String(e.itemHeight));
|
|
1381
1381
|
m.value.style.transform = `translate3d(0, ${H}px, 0)`;
|
|
1382
1382
|
}
|
|
1383
|
-
},
|
|
1383
|
+
}, q = () => {
|
|
1384
1384
|
if (!m.value || !g.value)
|
|
1385
1385
|
return;
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1386
|
+
const I = m.value.children;
|
|
1387
|
+
I && I.length > 0 && [...I].forEach((A) => {
|
|
1388
1388
|
if (A instanceof HTMLDivElement) {
|
|
1389
1389
|
const H = A.getBoundingClientRect(), {
|
|
1390
1390
|
height: ue
|
|
@@ -1401,17 +1401,17 @@ const Kn = M(Gn), [Zn, ge] = O("loading"), Qn = {
|
|
|
1401
1401
|
...e,
|
|
1402
1402
|
checkIsScrollToBottom: T,
|
|
1403
1403
|
loadData: b
|
|
1404
|
-
}),
|
|
1405
|
-
e.height !== "auto" ? (r.value = !1, a.value = i.value.clientHeight) : e.height === "auto" && (r.value = !0, a.value = document.documentElement.clientHeight, document.addEventListener("scroll",
|
|
1404
|
+
}), Z(() => {
|
|
1405
|
+
e.height !== "auto" ? (r.value = !1, a.value = i.value.clientHeight) : e.height === "auto" && (r.value = !0, a.value = document.documentElement.clientHeight, document.addEventListener("scroll", V)), e.virtual && (N(), U()), e.immediateCheck && T();
|
|
1406
1406
|
}), yn(async () => {
|
|
1407
|
-
var
|
|
1407
|
+
var I, A;
|
|
1408
1408
|
if (e.virtual && e.dynamicItemHeight) {
|
|
1409
|
-
if (await ie(), !((A = (
|
|
1409
|
+
if (await ie(), !((A = (I = m.value) == null ? void 0 : I.children) != null && A.length))
|
|
1410
1410
|
return;
|
|
1411
|
-
|
|
1411
|
+
q();
|
|
1412
1412
|
}
|
|
1413
1413
|
}), we(() => {
|
|
1414
|
-
r.value && document.removeEventListener("scroll",
|
|
1414
|
+
r.value && document.removeEventListener("scroll", V);
|
|
1415
1415
|
}), () => f("div", {
|
|
1416
1416
|
ref: i,
|
|
1417
1417
|
class: `${se()} ${e.virtual ? se({
|
|
@@ -1420,7 +1420,7 @@ const Kn = M(Gn), [Zn, ge] = O("loading"), Qn = {
|
|
|
1420
1420
|
style: {
|
|
1421
1421
|
height: w.value
|
|
1422
1422
|
},
|
|
1423
|
-
onScroll:
|
|
1423
|
+
onScroll: V
|
|
1424
1424
|
}, [e.virtual && f("div", {
|
|
1425
1425
|
ref: g,
|
|
1426
1426
|
class: se("phantom"),
|
|
@@ -1430,14 +1430,14 @@ const Kn = M(Gn), [Zn, ge] = O("loading"), Qn = {
|
|
|
1430
1430
|
}, null), f("div", {
|
|
1431
1431
|
ref: m,
|
|
1432
1432
|
class: se("content")
|
|
1433
|
-
}, [p.value.map((
|
|
1433
|
+
}, [p.value.map((I) => {
|
|
1434
1434
|
var A;
|
|
1435
1435
|
return f("div", {
|
|
1436
1436
|
ref: x,
|
|
1437
1437
|
class: se("item"),
|
|
1438
|
-
"data-index":
|
|
1438
|
+
"data-index": I._index
|
|
1439
1439
|
}, [(A = t.default) == null ? void 0 : A.call(t, {
|
|
1440
|
-
item:
|
|
1440
|
+
item: I
|
|
1441
1441
|
})]);
|
|
1442
1442
|
})]), l.value === "loading" && f("div", {
|
|
1443
1443
|
class: se({
|
|
@@ -1923,7 +1923,7 @@ const hl = M(pl), yl = (e, t, o, n) => {
|
|
|
1923
1923
|
}, S = (v) => {
|
|
1924
1924
|
c.value === Y.LOOSING ? (g.value = e.statusHeight, x.value = kt, c.value = Y.LOADING, o("load", s, v)) : c.value === Y.PULLING && (g.value = 0, c.value = Y.DEFUALT);
|
|
1925
1925
|
};
|
|
1926
|
-
|
|
1926
|
+
Z(() => {
|
|
1927
1927
|
const v = a == null ? void 0 : a.vnode.el;
|
|
1928
1928
|
v == null || v.addEventListener("touchstart", d, {
|
|
1929
1929
|
passive: !1
|
|
@@ -2510,7 +2510,7 @@ const Ul = M(jl), [ql, de] = O("progress"), Gl = /* @__PURE__ */ z({
|
|
|
2510
2510
|
oldPercent: 0,
|
|
2511
2511
|
timer: 0
|
|
2512
2512
|
});
|
|
2513
|
-
|
|
2513
|
+
Z(() => {
|
|
2514
2514
|
m(), e.animation && i(), window.addEventListener("resize", m);
|
|
2515
2515
|
}), st(() => {
|
|
2516
2516
|
a.value = [];
|
|
@@ -2680,7 +2680,7 @@ const Kl = M(Gl), [Zl, ze, Ql] = O("toast"), Jl = {
|
|
|
2680
2680
|
o.visible = !1, clearTimeout(a);
|
|
2681
2681
|
}, Number(e.duration));
|
|
2682
2682
|
};
|
|
2683
|
-
return
|
|
2683
|
+
return Z(() => {
|
|
2684
2684
|
o.visible = !0, n();
|
|
2685
2685
|
}), () => {
|
|
2686
2686
|
const {
|
|
@@ -2778,7 +2778,7 @@ const ia = /* @__PURE__ */ z({
|
|
|
2778
2778
|
slots: t
|
|
2779
2779
|
}) {
|
|
2780
2780
|
const o = L("");
|
|
2781
|
-
|
|
2781
|
+
Z(() => {
|
|
2782
2782
|
o.value = `mask${Nt}`, Nt += 1, n(e.modelValue, !0);
|
|
2783
2783
|
}), we(() => {
|
|
2784
2784
|
const l = ee.findIndex((i) => i._id === o.value);
|
|
@@ -3481,7 +3481,7 @@ const wa = M(Sa), [xa, Ca] = O("input"), $a = 13, ka = /* @__PURE__ */ z({
|
|
|
3481
3481
|
}, c = (s) => {
|
|
3482
3482
|
s.keyCode === $a && (n != null && n.getProp("enterable") || s.preventDefault(), e.type === "search" && (o == null ? void 0 : o.vnode.el).blur()), t("keypress", s);
|
|
3483
3483
|
};
|
|
3484
|
-
|
|
3484
|
+
Z(() => {
|
|
3485
3485
|
l(e.showWordLimit), r(e.maxLength);
|
|
3486
3486
|
}), xe(() => {
|
|
3487
3487
|
a && a.remove(), a = null;
|
|
@@ -3560,7 +3560,7 @@ const Ta = M(ka), at = 1e3, ot = 60 * at, rt = 60 * ot, It = 24 * rt, [Ea] = O("
|
|
|
3560
3560
|
expose: n
|
|
3561
3561
|
}) {
|
|
3562
3562
|
const a = L(), r = L(!1), l = L(Number(e.time)), i = L(0), m = B(() => p(l.value));
|
|
3563
|
-
|
|
3563
|
+
Z(() => {
|
|
3564
3564
|
e.autoStart && g();
|
|
3565
3565
|
});
|
|
3566
3566
|
const g = () => {
|
|
@@ -3694,6 +3694,10 @@ const [Va, ne] = O("dialog"), Ia = {
|
|
|
3694
3694
|
duration: {
|
|
3695
3695
|
type: Number,
|
|
3696
3696
|
default: 300
|
|
3697
|
+
},
|
|
3698
|
+
onClickMask: {
|
|
3699
|
+
type: Function,
|
|
3700
|
+
default: null
|
|
3697
3701
|
}
|
|
3698
3702
|
}, sn = /* @__PURE__ */ z({
|
|
3699
3703
|
name: Va,
|
|
@@ -3759,16 +3763,18 @@ const [Va, ne] = O("dialog"), Ia = {
|
|
|
3759
3763
|
imgSrc: b,
|
|
3760
3764
|
circleImg: T,
|
|
3761
3765
|
teleport: N,
|
|
3762
|
-
duration: E
|
|
3766
|
+
duration: E,
|
|
3767
|
+
onClickMask: P
|
|
3763
3768
|
} = e;
|
|
3764
3769
|
return f(vt, Ie({
|
|
3765
3770
|
modelValue: c.value,
|
|
3766
|
-
"onUpdate:modelValue": (
|
|
3771
|
+
"onUpdate:modelValue": (D) => c.value = D,
|
|
3767
3772
|
customClass: ne(),
|
|
3768
3773
|
customStyle: {
|
|
3769
3774
|
width: R(h)
|
|
3770
3775
|
}
|
|
3771
3776
|
}, {
|
|
3777
|
+
onClickMask: P,
|
|
3772
3778
|
"onUpdate:modelValue": a
|
|
3773
3779
|
}, {
|
|
3774
3780
|
isCloseOnClickMask: S,
|
|
@@ -3776,8 +3782,8 @@ const [Va, ne] = O("dialog"), Ia = {
|
|
|
3776
3782
|
duration: E
|
|
3777
3783
|
}), {
|
|
3778
3784
|
default: () => {
|
|
3779
|
-
var
|
|
3780
|
-
return [((
|
|
3785
|
+
var D, V, U, q;
|
|
3786
|
+
return [((D = o.img) == null ? void 0 : D.call(o)) || b && f("div", {
|
|
3781
3787
|
class: ne("img", {
|
|
3782
3788
|
circle: T
|
|
3783
3789
|
}),
|
|
@@ -3796,9 +3802,9 @@ const [Va, ne] = O("dialog"), Ia = {
|
|
|
3796
3802
|
class: ne("container")
|
|
3797
3803
|
}, [f("div", {
|
|
3798
3804
|
style: {
|
|
3799
|
-
height: T ? x(R(h), 4, (
|
|
3805
|
+
height: T ? x(R(h), 4, (I) => I + 20) : "24px"
|
|
3800
3806
|
}
|
|
3801
|
-
}, null), ((
|
|
3807
|
+
}, null), ((V = o.title) == null ? void 0 : V.call(o)) || f("div", {
|
|
3802
3808
|
class: ne("title"),
|
|
3803
3809
|
style: {
|
|
3804
3810
|
textAlign: w
|
|
@@ -3810,7 +3816,7 @@ const [Va, ne] = O("dialog"), Ia = {
|
|
|
3810
3816
|
style: {
|
|
3811
3817
|
textAlign: p
|
|
3812
3818
|
}
|
|
3813
|
-
}, [((
|
|
3819
|
+
}, [((U = o.default) == null ? void 0 : U.call(o)) || d]), ((q = o.footer) == null ? void 0 : q.call(o)) || f("div", {
|
|
3814
3820
|
class: ne("footer"),
|
|
3815
3821
|
style: {
|
|
3816
3822
|
paddingTop: v || y ? "20px" : "0px"
|
|
@@ -3999,7 +4005,7 @@ const Oa = M(sn), dn = {
|
|
|
3999
4005
|
};
|
|
4000
4006
|
return j(() => e.position, () => {
|
|
4001
4007
|
g(), x();
|
|
4002
|
-
}), j([() => n.value, () => e.modelValue, () => e.reference], x),
|
|
4008
|
+
}), j([() => n.value, () => e.modelValue, () => e.reference], x), Z(() => {
|
|
4003
4009
|
var c;
|
|
4004
4010
|
g(), x(), e.manual || ((c = e.reference) == null || c.addEventListener("click", m), document.addEventListener("touchstart", i), document.addEventListener("mousedown", i));
|
|
4005
4011
|
}), xe(() => {
|
|
@@ -4067,7 +4073,7 @@ const [Aa] = O("tooltip"), Ra = /* @__PURE__ */ z({
|
|
|
4067
4073
|
const r = (l = o == null ? void 0 : o.proxy) == null ? void 0 : l.$el;
|
|
4068
4074
|
return r == null ? void 0 : r.nextElementSibling;
|
|
4069
4075
|
};
|
|
4070
|
-
return
|
|
4076
|
+
return Z(() => {
|
|
4071
4077
|
n.value = a();
|
|
4072
4078
|
}), st(() => {
|
|
4073
4079
|
ie(() => {
|
|
@@ -4349,7 +4355,7 @@ const Ua = M(ja), [mn, De] = O("dropdown"), vn = mn, qa = {
|
|
|
4349
4355
|
return N && !N.contains(y.target);
|
|
4350
4356
|
}) && e.isCloseOnClickOutside && S();
|
|
4351
4357
|
};
|
|
4352
|
-
|
|
4358
|
+
Z(() => {
|
|
4353
4359
|
var y;
|
|
4354
4360
|
a.value && (w.value = s(a.value)), (y = w.value) == null || y.addEventListener("scroll", p, {
|
|
4355
4361
|
passive: !0
|