delta-comic-core 0.0.10 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.css +1 -1
- package/dist/bundle.js +570 -430
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.umd.cjs +2 -2
- package/dist/bundle.umd.cjs.map +1 -1
- package/dist/components/list.vue.d.ts +1 -0
- package/dist/depends/index.d.ts +11 -1
- package/dist/index.d.ts +1 -2
- package/dist/pack.tgz +0 -0
- package/dist/plugin/define.d.ts +12 -6
- package/dist/struct/item.d.ts +3 -0
- package/dist/utils/message.d.ts +13 -1
- package/package.json +1 -1
- package/dist/utils/delay.d.ts +0 -1
package/dist/bundle.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, customRef, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, hasInjectionContext, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeUnmount, onBeforeUpdate, onDeactivated, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReactive, shallowReadonly, shallowRef, toDisplayString, toRef, toValue, unref, useCssVars, useModel, useTemplateRef, vShow, watch, watchEffect, withCtx, withDirectives, withModifiers } from "vue";
|
|
1
|
+
import { Fragment, Teleport, Transition, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, customRef, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, hasInjectionContext, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeUnmount, onBeforeUpdate, onDeactivated, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReactive, shallowReadonly, shallowRef, toDisplayString, toRef, toValue, unref, useCssVars, useModel, useTemplateRef, vShow, watch, watchEffect, withCtx, withDirectives, withModifiers } from "vue";
|
|
2
2
|
import { onBeforeRouteLeave, useRoute, useRouter } from "vue-router";
|
|
3
|
-
import { NButton, NEmpty, NIcon, NImage, NResult, NVirtualList } from "naive-ui";
|
|
4
|
-
import { showImagePreview } from "vant";
|
|
3
|
+
import { NButton, NEmpty, NIcon, NImage, NProgress, NResult, NVirtualList } from "naive-ui";
|
|
4
|
+
import { Icon, Loading, showImagePreview } from "vant";
|
|
5
5
|
import { defineStore } from "pinia";
|
|
6
6
|
import axios, { getAdapter, isAxiosError, isCancel } from "axios";
|
|
7
|
+
import { delay, isError, isUndefined } from "es-toolkit";
|
|
7
8
|
import { AnimatePresence, motion } from "motion-v";
|
|
8
9
|
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (e, n) => () => (n || e((n = { exports: {} }).exports, n), n.exports), __export = (e) => {
|
|
9
10
|
let n = {};
|
|
@@ -91,8 +92,8 @@ var isWindow = (e) => e === window, makeDOMRect = (e, n) => ({
|
|
|
91
92
|
function useParent(e) {
|
|
92
93
|
let n = inject(e, null);
|
|
93
94
|
if (n) {
|
|
94
|
-
let e = getCurrentInstance(), { link: r, unlink:
|
|
95
|
-
return r(e), onUnmounted(() =>
|
|
95
|
+
let e = getCurrentInstance(), { link: r, unlink: i, internalChildren: o } = n;
|
|
96
|
+
return r(e), onUnmounted(() => i(e)), {
|
|
96
97
|
parent: n,
|
|
97
98
|
index: computed(() => o.indexOf(e))
|
|
98
99
|
};
|
|
@@ -452,7 +453,7 @@ var [name$14, bem$14] = createNamespace("badge"), Badge = withInstall(defineComp
|
|
|
452
453
|
if (n.content) return !0;
|
|
453
454
|
let { content: r, showZero: i } = e;
|
|
454
455
|
return isDef$1(r) && r !== "" && (i || r !== 0 && r !== "0");
|
|
455
|
-
},
|
|
456
|
+
}, i = () => {
|
|
456
457
|
let { dot: i, max: a, content: o } = e;
|
|
457
458
|
if (!i && r()) return n.content ? n.content() : isDef$1(a) && isNumeric(o) && +o > +a ? `${a}+` : o;
|
|
458
459
|
}, o = (e) => e.startsWith("-") ? e.replace("-", "") : `-${e}`, s = computed(() => {
|
|
@@ -469,7 +470,7 @@ var [name$14, bem$14] = createNamespace("badge"), Badge = withInstall(defineComp
|
|
|
469
470
|
fixed: !!n.default
|
|
470
471
|
}]),
|
|
471
472
|
style: s.value
|
|
472
|
-
}, [
|
|
473
|
+
}, [i()]);
|
|
473
474
|
};
|
|
474
475
|
return () => {
|
|
475
476
|
if (n.default) {
|
|
@@ -535,7 +536,7 @@ defineComponent({
|
|
|
535
536
|
}, { default: () => [n.default?.call(n)] });
|
|
536
537
|
}
|
|
537
538
|
});
|
|
538
|
-
var [name$12, bem$12] = createNamespace("icon"), isImage = (e) => e?.includes("/"), Icon = withInstall(defineComponent({
|
|
539
|
+
var [name$12, bem$12] = createNamespace("icon"), isImage = (e) => e?.includes("/"), Icon$1 = withInstall(defineComponent({
|
|
539
540
|
name: name$12,
|
|
540
541
|
props: {
|
|
541
542
|
dot: Boolean,
|
|
@@ -548,19 +549,19 @@ var [name$12, bem$12] = createNamespace("icon"), isImage = (e) => e?.includes("/
|
|
|
548
549
|
classPrefix: String
|
|
549
550
|
},
|
|
550
551
|
setup(e, { slots: n }) {
|
|
551
|
-
let r = inject(CONFIG_PROVIDER_KEY, null),
|
|
552
|
+
let r = inject(CONFIG_PROVIDER_KEY, null), i = computed(() => e.classPrefix || r?.iconPrefix || bem$12());
|
|
552
553
|
return () => {
|
|
553
|
-
let { tag: r, dot:
|
|
554
|
+
let { tag: r, dot: a, name: o, size: s, badge: c, color: l } = e, u = isImage(o);
|
|
554
555
|
return createVNode(Badge, mergeProps({
|
|
555
|
-
dot:
|
|
556
|
+
dot: a,
|
|
556
557
|
tag: r,
|
|
557
|
-
class: [
|
|
558
|
+
class: [i.value, u ? "" : `${i.value}-${o}`],
|
|
558
559
|
style: {
|
|
559
560
|
color: l,
|
|
560
561
|
fontSize: addUnit(s)
|
|
561
562
|
},
|
|
562
563
|
content: c
|
|
563
|
-
}, e.badgeProps), { default: () => [n.default?.call(n),
|
|
564
|
+
}, e.badgeProps), { default: () => [n.default?.call(n), u && createVNode("img", {
|
|
564
565
|
class: bem$12("image"),
|
|
565
566
|
src: o
|
|
566
567
|
}, null)] });
|
|
@@ -574,7 +575,7 @@ var [name$12, bem$12] = createNamespace("icon"), isImage = (e) => e?.includes("/
|
|
|
574
575
|
cy: "50",
|
|
575
576
|
r: "20",
|
|
576
577
|
fill: "none"
|
|
577
|
-
}, null)]), Loading = withInstall(defineComponent({
|
|
578
|
+
}, null)]), Loading$1 = withInstall(defineComponent({
|
|
578
579
|
name: name$11,
|
|
579
580
|
props: {
|
|
580
581
|
size: numericProp,
|
|
@@ -585,7 +586,7 @@ var [name$12, bem$12] = createNamespace("icon"), isImage = (e) => e?.includes("/
|
|
|
585
586
|
textColor: String
|
|
586
587
|
},
|
|
587
588
|
setup(e, { slots: n }) {
|
|
588
|
-
let r = computed(() => extend({ color: e.color }, getSizeStyle(e.size))),
|
|
589
|
+
let r = computed(() => extend({ color: e.color }, getSizeStyle(e.size))), i = () => {
|
|
589
590
|
let i = e.type === "spinner" ? SpinIcon : CircularIcon;
|
|
590
591
|
return createVNode("span", {
|
|
591
592
|
class: bem$11("spinner", e.type),
|
|
@@ -606,7 +607,7 @@ var [name$12, bem$12] = createNamespace("icon"), isImage = (e) => e?.includes("/
|
|
|
606
607
|
class: bem$11([n, { vertical: r }]),
|
|
607
608
|
"aria-live": "polite",
|
|
608
609
|
"aria-busy": !0
|
|
609
|
-
}, [
|
|
610
|
+
}, [i(), o()]);
|
|
610
611
|
};
|
|
611
612
|
}
|
|
612
613
|
})), popupSharedProps = {
|
|
@@ -734,49 +735,49 @@ var useScopeId = () => {
|
|
|
734
735
|
"clickOverlay",
|
|
735
736
|
"clickCloseIcon"
|
|
736
737
|
],
|
|
737
|
-
setup(
|
|
738
|
-
let l,
|
|
738
|
+
setup(i, { emit: o, attrs: s, slots: c }) {
|
|
739
|
+
let l, u, f = ref(), p = ref(), m = useLazyRender(() => i.show || !i.lazyRender), h = computed(() => {
|
|
739
740
|
let e = { zIndex: f.value };
|
|
740
|
-
if (isDef$1(
|
|
741
|
-
let n =
|
|
742
|
-
e[n] = `${
|
|
741
|
+
if (isDef$1(i.duration)) {
|
|
742
|
+
let n = i.position === "center" ? "animationDuration" : "transitionDuration";
|
|
743
|
+
e[n] = `${i.duration}s`;
|
|
743
744
|
}
|
|
744
745
|
return e;
|
|
745
746
|
}), g = () => {
|
|
746
|
-
l || (l = !0, f.value =
|
|
747
|
+
l || (l = !0, f.value = i.zIndex === void 0 ? useGlobalZIndex() : +i.zIndex, o("open"));
|
|
747
748
|
}, v = () => {
|
|
748
|
-
l && callInterceptor(
|
|
749
|
+
l && callInterceptor(i.beforeClose, { done() {
|
|
749
750
|
l = !1, o("close"), o("update:show", !1);
|
|
750
751
|
} });
|
|
751
752
|
}, y = (e) => {
|
|
752
|
-
o("clickOverlay", e),
|
|
753
|
+
o("clickOverlay", e), i.closeOnClickOverlay && v();
|
|
753
754
|
}, b = () => {
|
|
754
|
-
if (
|
|
755
|
-
show:
|
|
756
|
-
class:
|
|
755
|
+
if (i.overlay) return createVNode(Overlay, mergeProps(extend({
|
|
756
|
+
show: i.show,
|
|
757
|
+
class: i.overlayClass,
|
|
757
758
|
zIndex: f.value,
|
|
758
|
-
duration:
|
|
759
|
-
customStyle:
|
|
760
|
-
role:
|
|
761
|
-
tabindex:
|
|
762
|
-
},
|
|
759
|
+
duration: i.duration,
|
|
760
|
+
customStyle: i.overlayStyle,
|
|
761
|
+
role: i.closeOnClickOverlay ? "button" : void 0,
|
|
762
|
+
tabindex: i.closeOnClickOverlay ? 0 : void 0
|
|
763
|
+
}, i.overlayProps), useScopeId(), { onClick: y }), { default: c["overlay-content"] });
|
|
763
764
|
}, S = (e) => {
|
|
764
765
|
o("clickCloseIcon", e), v();
|
|
765
766
|
}, C = () => {
|
|
766
|
-
if (
|
|
767
|
+
if (i.closeable) return createVNode(Icon$1, {
|
|
767
768
|
role: "button",
|
|
768
769
|
tabindex: 0,
|
|
769
|
-
name:
|
|
770
|
-
class: [bem$9("close-icon",
|
|
771
|
-
classPrefix:
|
|
770
|
+
name: i.closeIcon,
|
|
771
|
+
class: [bem$9("close-icon", i.closeIconPosition), HAPTICS_FEEDBACK],
|
|
772
|
+
classPrefix: i.iconPrefix,
|
|
772
773
|
onClick: S
|
|
773
774
|
}, null);
|
|
774
|
-
},
|
|
775
|
-
|
|
775
|
+
}, w, O = () => {
|
|
776
|
+
w && clearTimeout(w), w = setTimeout(() => {
|
|
776
777
|
o("opened");
|
|
777
778
|
});
|
|
778
|
-
}, k = () => o("closed"),
|
|
779
|
-
let { destroyOnClose: e, round: n, position: r, safeAreaInsetTop:
|
|
779
|
+
}, k = () => o("closed"), A = (e) => o("keydown", e), M = m(() => {
|
|
780
|
+
let { destroyOnClose: e, round: n, position: r, safeAreaInsetTop: a, safeAreaInsetBottom: o, show: l } = i;
|
|
780
781
|
if (!(!l && e)) return withDirectives(createVNode("div", mergeProps({
|
|
781
782
|
ref: p,
|
|
782
783
|
style: h.value,
|
|
@@ -786,34 +787,34 @@ var useScopeId = () => {
|
|
|
786
787
|
round: n,
|
|
787
788
|
[r]: r
|
|
788
789
|
}), {
|
|
789
|
-
"van-safe-area-top":
|
|
790
|
+
"van-safe-area-top": a,
|
|
790
791
|
"van-safe-area-bottom": o
|
|
791
792
|
}],
|
|
792
|
-
onKeydown:
|
|
793
|
+
onKeydown: A
|
|
793
794
|
}, s, useScopeId()), [c.default?.call(c), C()]), [[vShow, l]]);
|
|
794
|
-
}),
|
|
795
|
-
let { position: e, transition: n, transitionAppear:
|
|
795
|
+
}), z = () => {
|
|
796
|
+
let { position: e, transition: n, transitionAppear: a } = i, o = e === "center" ? "van-fade" : `van-popup-slide-${e}`;
|
|
796
797
|
return createVNode(Transition, {
|
|
797
798
|
name: n || o,
|
|
798
|
-
appear:
|
|
799
|
+
appear: a,
|
|
799
800
|
onAfterEnter: O,
|
|
800
801
|
onAfterLeave: k
|
|
801
802
|
}, { default: M });
|
|
802
803
|
};
|
|
803
|
-
return watch(() =>
|
|
804
|
+
return watch(() => i.show, (e) => {
|
|
804
805
|
e && !l && (g(), s.tabindex === 0 && nextTick(() => {
|
|
805
806
|
var e;
|
|
806
807
|
(e = p.value) == null || e.focus();
|
|
807
808
|
})), !e && l && (l = !1, o("close"));
|
|
808
|
-
}), useExpose({ popupRef: p }), useLockScroll(p, () =>
|
|
809
|
-
|
|
809
|
+
}), useExpose({ popupRef: p }), useLockScroll(p, () => i.show && i.lockScroll), useEventListener("popstate", () => {
|
|
810
|
+
i.closeOnPopstate && (v(), u = !1);
|
|
810
811
|
}), onMounted(() => {
|
|
811
|
-
|
|
812
|
+
i.show && g();
|
|
812
813
|
}), onActivated(() => {
|
|
813
|
-
|
|
814
|
+
u &&= (o("update:show", !0), !1);
|
|
814
815
|
}), onDeactivated(() => {
|
|
815
|
-
|
|
816
|
-
}), provide(POPUP_TOGGLE_KEY, () =>
|
|
816
|
+
i.show && i.teleport && (v(), u = !0);
|
|
817
|
+
}), provide(POPUP_TOGGLE_KEY, () => i.show), () => i.teleport ? createVNode(Teleport, { to: i.teleport }, { default: () => [b(), z()] }) : createVNode(Fragment, null, [b(), z()]);
|
|
817
818
|
}
|
|
818
819
|
})), useSyncPropRef = (e, n) => {
|
|
819
820
|
let r = ref(e());
|
|
@@ -926,12 +927,12 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
926
927
|
},
|
|
927
928
|
emits: ["scroll", "change"],
|
|
928
929
|
setup(e, { emit: n, slots: r }) {
|
|
929
|
-
let
|
|
930
|
+
let i = ref(), o = useScrollParent(i), s = reactive({
|
|
930
931
|
fixed: !1,
|
|
931
932
|
width: 0,
|
|
932
933
|
height: 0,
|
|
933
934
|
transform: 0
|
|
934
|
-
}), c = ref(!1), l = computed(() => unitToPx(e.position === "top" ? e.offsetTop : e.offsetBottom)),
|
|
935
|
+
}), c = ref(!1), l = computed(() => unitToPx(e.position === "top" ? e.offsetTop : e.offsetBottom)), u = computed(() => {
|
|
935
936
|
if (c.value) return;
|
|
936
937
|
let { fixed: e, height: n, width: r } = s;
|
|
937
938
|
if (e) return {
|
|
@@ -950,32 +951,32 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
950
951
|
scrollTop: e,
|
|
951
952
|
isFixed: s.fixed
|
|
952
953
|
}), m = () => {
|
|
953
|
-
if (!
|
|
954
|
-
let { container: n, position: r } = e,
|
|
955
|
-
if (s.width =
|
|
954
|
+
if (!i.value || isHidden(i)) return;
|
|
955
|
+
let { container: n, position: r } = e, a = useRect(i), o = getScrollTop(window);
|
|
956
|
+
if (s.width = a.width, s.height = a.height, r === "top") if (n) {
|
|
956
957
|
let e = useRect(n), r = e.bottom - l.value - s.height;
|
|
957
|
-
s.fixed = l.value >
|
|
958
|
-
} else s.fixed = l.value >
|
|
958
|
+
s.fixed = l.value > a.top && e.bottom > 0, s.transform = r < 0 ? r : 0;
|
|
959
|
+
} else s.fixed = l.value > a.top;
|
|
959
960
|
else {
|
|
960
961
|
let { clientHeight: e } = document.documentElement;
|
|
961
962
|
if (n) {
|
|
962
|
-
let r = useRect(n),
|
|
963
|
-
s.fixed = e - l.value <
|
|
964
|
-
} else s.fixed = e - l.value <
|
|
963
|
+
let r = useRect(n), i = e - r.top - l.value - s.height;
|
|
964
|
+
s.fixed = e - l.value < a.bottom && e > r.top, s.transform = i < 0 ? -i : 0;
|
|
965
|
+
} else s.fixed = e - l.value < a.bottom;
|
|
965
966
|
}
|
|
966
967
|
p(o);
|
|
967
968
|
};
|
|
968
969
|
return watch(() => s.fixed, (e) => n("change", e)), useEventListener("scroll", m, {
|
|
969
970
|
target: o,
|
|
970
971
|
passive: !0
|
|
971
|
-
}), useVisibilityChange(
|
|
972
|
-
!
|
|
973
|
-
let e = useRect(
|
|
972
|
+
}), useVisibilityChange(i, m), watch([windowWidth, windowHeight], () => {
|
|
973
|
+
!i.value || isHidden(i) || !s.fixed || (c.value = !0, nextTick(() => {
|
|
974
|
+
let e = useRect(i);
|
|
974
975
|
s.width = e.width, s.height = e.height, c.value = !1;
|
|
975
976
|
}));
|
|
976
977
|
}), () => createVNode("div", {
|
|
977
|
-
ref:
|
|
978
|
-
style:
|
|
978
|
+
ref: i,
|
|
979
|
+
style: u.value
|
|
979
980
|
}, [createVNode("div", {
|
|
980
981
|
class: bem$8({ fixed: s.fixed && !c.value }),
|
|
981
982
|
style: f.value
|
|
@@ -1003,14 +1004,14 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1003
1004
|
"dragEnd"
|
|
1004
1005
|
],
|
|
1005
1006
|
setup(e, { emit: n, slots: r }) {
|
|
1006
|
-
let
|
|
1007
|
+
let i = ref(), o = ref(), s = reactive({
|
|
1007
1008
|
rect: null,
|
|
1008
1009
|
width: 0,
|
|
1009
1010
|
height: 0,
|
|
1010
1011
|
offset: 0,
|
|
1011
1012
|
active: 0,
|
|
1012
1013
|
swiping: !1
|
|
1013
|
-
}), c = !1, l = useTouch(), { children:
|
|
1014
|
+
}), c = !1, l = useTouch(), { children: u, linkChildren: f } = useChildren(SWIPE_KEY), p = computed(() => u.length), m = computed(() => s[e.vertical ? "height" : "width"]), h = computed(() => e.vertical ? l.deltaY.value : l.deltaX.value), g = computed(() => s.rect ? (e.vertical ? s.rect.height : s.rect.width) - m.value * p.value : 0), v = computed(() => m.value ? Math.ceil(Math.abs(g.value) / m.value) : p.value), y = computed(() => p.value * m.value), b = computed(() => (s.active + p.value) % p.value), S = computed(() => {
|
|
1014
1015
|
let n = e.vertical ? "vertical" : "horizontal";
|
|
1015
1016
|
return l.direction.value === n;
|
|
1016
1017
|
}), C = computed(() => {
|
|
@@ -1026,67 +1027,67 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1026
1027
|
}), w = (n) => {
|
|
1027
1028
|
let { active: r } = s;
|
|
1028
1029
|
return n ? e.loop ? clamp$3(r + n, -1, p.value) : clamp$3(r + n, 0, v.value) : r;
|
|
1029
|
-
},
|
|
1030
|
+
}, E = (n, r = 0) => {
|
|
1030
1031
|
let i = n * m.value;
|
|
1031
1032
|
e.loop || (i = Math.min(i, -g.value));
|
|
1032
1033
|
let a = r - i;
|
|
1033
1034
|
return e.loop || (a = clamp$3(a, g.value, 0)), a;
|
|
1034
1035
|
}, O = ({ pace: r = 0, offset: i = 0, emitChange: a }) => {
|
|
1035
1036
|
if (p.value <= 1) return;
|
|
1036
|
-
let { active: o } = s, c = w(r), l =
|
|
1037
|
+
let { active: o } = s, c = w(r), l = E(c, i);
|
|
1037
1038
|
if (e.loop) {
|
|
1038
|
-
if (
|
|
1039
|
+
if (u[0] && l !== g.value) {
|
|
1039
1040
|
let e = l < g.value;
|
|
1040
|
-
|
|
1041
|
+
u[0].setOffset(e ? y.value : 0);
|
|
1041
1042
|
}
|
|
1042
|
-
if (
|
|
1043
|
+
if (u[p.value - 1] && l !== 0) {
|
|
1043
1044
|
let e = l > 0;
|
|
1044
|
-
|
|
1045
|
+
u[p.value - 1].setOffset(e ? -y.value : 0);
|
|
1045
1046
|
}
|
|
1046
1047
|
}
|
|
1047
1048
|
s.active = c, s.offset = l, a && c !== o && n("change", b.value);
|
|
1048
1049
|
}, k = () => {
|
|
1049
1050
|
s.swiping = !0, s.active <= -1 ? O({ pace: p.value }) : s.active >= p.value && O({ pace: -p.value });
|
|
1050
|
-
},
|
|
1051
|
+
}, A = () => {
|
|
1051
1052
|
k(), l.reset(), doubleRaf(() => {
|
|
1052
1053
|
s.swiping = !1, O({
|
|
1053
1054
|
pace: -1,
|
|
1054
1055
|
emitChange: !0
|
|
1055
1056
|
});
|
|
1056
1057
|
});
|
|
1057
|
-
},
|
|
1058
|
+
}, z = () => {
|
|
1058
1059
|
k(), l.reset(), doubleRaf(() => {
|
|
1059
1060
|
s.swiping = !1, O({
|
|
1060
1061
|
pace: 1,
|
|
1061
1062
|
emitChange: !0
|
|
1062
1063
|
});
|
|
1063
1064
|
});
|
|
1064
|
-
},
|
|
1065
|
-
|
|
1066
|
-
|
|
1065
|
+
}, V, H = () => clearTimeout(V), W = () => {
|
|
1066
|
+
H(), +e.autoplay > 0 && p.value > 1 && (V = setTimeout(() => {
|
|
1067
|
+
z(), W();
|
|
1067
1068
|
}, +e.autoplay));
|
|
1068
|
-
},
|
|
1069
|
-
if (!
|
|
1069
|
+
}, K = (n = +e.initialSwipe) => {
|
|
1070
|
+
if (!i.value) return;
|
|
1070
1071
|
let r = () => {
|
|
1071
|
-
if (!isHidden(
|
|
1072
|
+
if (!isHidden(i)) {
|
|
1072
1073
|
let n = {
|
|
1073
|
-
width:
|
|
1074
|
-
height:
|
|
1074
|
+
width: i.value.offsetWidth,
|
|
1075
|
+
height: i.value.offsetHeight
|
|
1075
1076
|
};
|
|
1076
1077
|
s.rect = n, s.width = +(e.width ?? n.width), s.height = +(e.height ?? n.height);
|
|
1077
1078
|
}
|
|
1078
|
-
p.value && (n = Math.min(p.value - 1, n), n === -1 && (n = p.value - 1)), s.active = n, s.swiping = !0, s.offset =
|
|
1079
|
+
p.value && (n = Math.min(p.value - 1, n), n === -1 && (n = p.value - 1)), s.active = n, s.swiping = !0, s.offset = E(n), u.forEach((e) => {
|
|
1079
1080
|
e.setOffset(0);
|
|
1080
|
-
}),
|
|
1081
|
+
}), W();
|
|
1081
1082
|
};
|
|
1082
|
-
isHidden(
|
|
1083
|
-
},
|
|
1084
|
-
!e.touchable || n.touches.length > 1 || (l.start(n), c = !1,
|
|
1085
|
-
},
|
|
1083
|
+
isHidden(i) ? nextTick().then(r) : r();
|
|
1084
|
+
}, J = () => K(s.active), Sl, Cl = (n) => {
|
|
1085
|
+
!e.touchable || n.touches.length > 1 || (l.start(n), c = !1, Sl = Date.now(), H(), k());
|
|
1086
|
+
}, wl = (r) => {
|
|
1086
1087
|
e.touchable && s.swiping && (l.move(r), S.value && (!e.loop && (s.active === 0 && h.value > 0 || s.active === p.value - 1 && h.value < 0) || (preventDefault(r, e.stopPropagation), O({ offset: h.value }), c ||= (n("dragStart", { index: b.value }), !0))));
|
|
1087
|
-
},
|
|
1088
|
+
}, Tl = () => {
|
|
1088
1089
|
if (!e.touchable || !s.swiping) return;
|
|
1089
|
-
let r = Date.now() -
|
|
1090
|
+
let r = Date.now() - Sl, i = h.value / r;
|
|
1090
1091
|
if ((Math.abs(i) > .25 || Math.abs(h.value) > m.value / 2) && S.value) {
|
|
1091
1092
|
let n = e.vertical ? l.offsetY.value : l.offsetX.value, r = 0;
|
|
1092
1093
|
r = e.loop ? n > 0 ? h.value > 0 ? -1 : 1 : 0 : -Math[h.value > 0 ? "ceil" : "floor"](h.value / m.value), O({
|
|
@@ -1094,8 +1095,8 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1094
1095
|
emitChange: !0
|
|
1095
1096
|
});
|
|
1096
1097
|
} else h.value && O({ pace: 0 });
|
|
1097
|
-
c = !1, s.swiping = !1, n("dragEnd", { index: b.value }),
|
|
1098
|
-
},
|
|
1098
|
+
c = !1, s.swiping = !1, n("dragEnd", { index: b.value }), W();
|
|
1099
|
+
}, El = (n, r = {}) => {
|
|
1099
1100
|
k(), l.reset(), doubleRaf(() => {
|
|
1100
1101
|
let i;
|
|
1101
1102
|
i = e.loop && n === p.value ? s.active === 0 ? 0 : n : n % p.value, r.immediate ? doubleRaf(() => {
|
|
@@ -1105,48 +1106,48 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1105
1106
|
emitChange: !0
|
|
1106
1107
|
});
|
|
1107
1108
|
});
|
|
1108
|
-
},
|
|
1109
|
+
}, Dl = (n, r) => {
|
|
1109
1110
|
let i = r === b.value;
|
|
1110
1111
|
return createVNode("i", {
|
|
1111
1112
|
style: i ? { backgroundColor: e.indicatorColor } : void 0,
|
|
1112
1113
|
class: bem$7("indicator", { active: i })
|
|
1113
1114
|
}, null);
|
|
1114
|
-
},
|
|
1115
|
+
}, Ol = () => {
|
|
1115
1116
|
if (r.indicator) return r.indicator({
|
|
1116
1117
|
active: b.value,
|
|
1117
1118
|
total: p.value
|
|
1118
1119
|
});
|
|
1119
|
-
if (e.showIndicators && p.value > 1) return createVNode("div", { class: bem$7("indicators", { vertical: e.vertical }) }, [Array(p.value).fill("").map(
|
|
1120
|
+
if (e.showIndicators && p.value > 1) return createVNode("div", { class: bem$7("indicators", { vertical: e.vertical }) }, [Array(p.value).fill("").map(Dl)]);
|
|
1120
1121
|
};
|
|
1121
1122
|
return useExpose({
|
|
1122
|
-
prev:
|
|
1123
|
-
next:
|
|
1123
|
+
prev: A,
|
|
1124
|
+
next: z,
|
|
1124
1125
|
state: s,
|
|
1125
|
-
resize:
|
|
1126
|
-
swipeTo:
|
|
1126
|
+
resize: J,
|
|
1127
|
+
swipeTo: El
|
|
1127
1128
|
}), f({
|
|
1128
1129
|
size: m,
|
|
1129
1130
|
props: e,
|
|
1130
1131
|
count: p,
|
|
1131
1132
|
activeIndicator: b
|
|
1132
|
-
}), watch(() => e.initialSwipe, (e) =>
|
|
1133
|
+
}), watch(() => e.initialSwipe, (e) => K(+e)), watch(p, () => K(s.active)), watch(() => e.autoplay, W), watch([
|
|
1133
1134
|
windowWidth,
|
|
1134
1135
|
windowHeight,
|
|
1135
1136
|
() => e.width,
|
|
1136
1137
|
() => e.height
|
|
1137
|
-
],
|
|
1138
|
-
e === "visible" ?
|
|
1139
|
-
}), onMounted(
|
|
1140
|
-
ref:
|
|
1138
|
+
], J), watch(usePageVisibility(), (e) => {
|
|
1139
|
+
e === "visible" ? W() : H();
|
|
1140
|
+
}), onMounted(K), onActivated(() => K(s.active)), onPopupReopen(() => K(s.active)), onDeactivated(H), onBeforeUnmount(H), useEventListener("touchmove", wl, { target: o }), () => createVNode("div", {
|
|
1141
|
+
ref: i,
|
|
1141
1142
|
class: bem$7()
|
|
1142
1143
|
}, [createVNode("div", {
|
|
1143
1144
|
ref: o,
|
|
1144
1145
|
style: C.value,
|
|
1145
1146
|
class: bem$7("track", { vertical: e.vertical }),
|
|
1146
|
-
onTouchstartPassive:
|
|
1147
|
-
onTouchend:
|
|
1148
|
-
onTouchcancel:
|
|
1149
|
-
}, [r.default?.call(r)]),
|
|
1147
|
+
onTouchstartPassive: Cl,
|
|
1148
|
+
onTouchend: Tl,
|
|
1149
|
+
onTouchcancel: Tl
|
|
1150
|
+
}, [r.default?.call(r)]), Ol()]);
|
|
1150
1151
|
}
|
|
1151
1152
|
})), [name$6, bem$6] = createNamespace("tabs"), stdin_default$5 = defineComponent({
|
|
1152
1153
|
name: name$6,
|
|
@@ -1214,18 +1215,18 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1214
1215
|
"update:active"
|
|
1215
1216
|
],
|
|
1216
1217
|
setup(e, { emit: n, slots: r }) {
|
|
1217
|
-
let
|
|
1218
|
+
let i, o, s, c, l, u = ref(), f = ref(), p = ref(), m = ref(), h = useId(), g = useScrollParent(u), [v, y] = useRefs(), { children: b, linkChildren: S } = useChildren(TABS_KEY), C = reactive({
|
|
1218
1219
|
inited: !1,
|
|
1219
1220
|
position: "",
|
|
1220
1221
|
lineStyle: {},
|
|
1221
1222
|
currentIndex: -1
|
|
1222
|
-
}), w = computed(() => b.length > +e.swipeThreshold || !e.ellipsis || e.shrink),
|
|
1223
|
+
}), w = computed(() => b.length > +e.swipeThreshold || !e.ellipsis || e.shrink), E = computed(() => ({
|
|
1223
1224
|
borderColor: e.color,
|
|
1224
1225
|
background: e.background
|
|
1225
1226
|
})), O = (e, n) => e.name ?? n, k = computed(() => {
|
|
1226
1227
|
let e = b[C.currentIndex];
|
|
1227
1228
|
if (e) return O(e, C.currentIndex);
|
|
1228
|
-
}),
|
|
1229
|
+
}), A = computed(() => unitToPx(e.offsetTop)), M = computed(() => e.sticky ? A.value + i : 0), z = (n) => {
|
|
1229
1230
|
let r = f.value, i = v.value;
|
|
1230
1231
|
if (!w.value || !r || !i || !i[C.currentIndex]) return;
|
|
1231
1232
|
let a = i[C.currentIndex].$el, o = a.offsetLeft - (r.offsetWidth - a.offsetWidth) / 2;
|
|
@@ -1234,7 +1235,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1234
1235
|
let n = C.inited;
|
|
1235
1236
|
nextTick(() => {
|
|
1236
1237
|
let r = v.value;
|
|
1237
|
-
if (!r || !r[C.currentIndex] || e.type !== "line" || isHidden(
|
|
1238
|
+
if (!r || !r[C.currentIndex] || e.type !== "line" || isHidden(u.value)) return;
|
|
1238
1239
|
let i = r[C.currentIndex].$el, { lineWidth: a, lineHeight: o } = e, s = i.offsetLeft + i.offsetWidth / 2, c = {
|
|
1239
1240
|
width: addUnit(a),
|
|
1240
1241
|
backgroundColor: e.color,
|
|
@@ -1246,21 +1247,21 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1246
1247
|
}
|
|
1247
1248
|
C.lineStyle = c;
|
|
1248
1249
|
});
|
|
1249
|
-
},
|
|
1250
|
+
}, xl = (e) => {
|
|
1250
1251
|
let n = e < C.currentIndex ? -1 : 1;
|
|
1251
1252
|
for (; e >= 0 && e < b.length;) {
|
|
1252
1253
|
if (!b[e].disabled) return e;
|
|
1253
1254
|
e += n;
|
|
1254
1255
|
}
|
|
1255
|
-
},
|
|
1256
|
-
let a =
|
|
1256
|
+
}, V = (r, i) => {
|
|
1257
|
+
let a = xl(r);
|
|
1257
1258
|
if (!isDef$1(a)) return;
|
|
1258
1259
|
let o = b[a], c = O(o, a), l = C.currentIndex !== null;
|
|
1259
|
-
C.currentIndex !== a && (C.currentIndex = a, i || z(), B()), c !== e.active && (n("update:active", c), l && n("change", c, o.title)), s && !e.scrollspy && setRootScrollTop(Math.ceil(getElementTop(
|
|
1260
|
-
},
|
|
1260
|
+
C.currentIndex !== a && (C.currentIndex = a, i || z(), B()), c !== e.active && (n("update:active", c), l && n("change", c, o.title)), s && !e.scrollspy && setRootScrollTop(Math.ceil(getElementTop(u.value) - A.value));
|
|
1261
|
+
}, H = (e, n) => {
|
|
1261
1262
|
let r = b.findIndex((n, r) => O(n, r) === e);
|
|
1262
|
-
|
|
1263
|
-
},
|
|
1263
|
+
V(r === -1 ? 0 : r, n);
|
|
1264
|
+
}, W = (n = !1) => {
|
|
1264
1265
|
if (e.scrollspy) {
|
|
1265
1266
|
let r = b[C.currentIndex].$el;
|
|
1266
1267
|
if (r && g.value) {
|
|
@@ -1270,12 +1271,12 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1270
1271
|
});
|
|
1271
1272
|
}
|
|
1272
1273
|
}
|
|
1273
|
-
},
|
|
1274
|
+
}, K = (r, i, a) => {
|
|
1274
1275
|
let { title: o, disabled: s } = b[i], c = O(b[i], i);
|
|
1275
1276
|
s || (callInterceptor(e.beforeChange, {
|
|
1276
1277
|
args: [c],
|
|
1277
1278
|
done: () => {
|
|
1278
|
-
|
|
1279
|
+
V(i), W();
|
|
1279
1280
|
}
|
|
1280
1281
|
}), route(r)), n("clickTab", {
|
|
1281
1282
|
name: c,
|
|
@@ -1283,26 +1284,26 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1283
1284
|
event: a,
|
|
1284
1285
|
disabled: s
|
|
1285
1286
|
});
|
|
1286
|
-
},
|
|
1287
|
+
}, J = (e) => {
|
|
1287
1288
|
s = e.isFixed, n("scroll", e);
|
|
1288
|
-
},
|
|
1289
|
+
}, Sl = (e) => {
|
|
1289
1290
|
nextTick(() => {
|
|
1290
|
-
|
|
1291
|
+
H(e), W(!0);
|
|
1291
1292
|
});
|
|
1292
|
-
},
|
|
1293
|
+
}, Cl = () => {
|
|
1293
1294
|
for (let e = 0; e < b.length; e++) {
|
|
1294
1295
|
let { top: n } = useRect(b[e].$el);
|
|
1295
1296
|
if (n > M.value) return e === 0 ? 0 : e - 1;
|
|
1296
1297
|
}
|
|
1297
1298
|
return b.length - 1;
|
|
1298
|
-
},
|
|
1299
|
-
e.scrollspy && !o &&
|
|
1300
|
-
},
|
|
1299
|
+
}, wl = () => {
|
|
1300
|
+
e.scrollspy && !o && V(Cl());
|
|
1301
|
+
}, Tl = () => {
|
|
1301
1302
|
if (e.type === "line" && b.length) return createVNode("div", {
|
|
1302
1303
|
class: bem$5("line"),
|
|
1303
1304
|
style: C.lineStyle
|
|
1304
1305
|
}, null);
|
|
1305
|
-
},
|
|
1306
|
+
}, El = () => {
|
|
1306
1307
|
let { type: n, border: i, sticky: a } = e, o = [createVNode("div", {
|
|
1307
1308
|
ref: a ? void 0 : p,
|
|
1308
1309
|
class: [bem$5("wrap"), { [BORDER_TOP_BOTTOM]: n === "line" && i }]
|
|
@@ -1313,16 +1314,16 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1313
1314
|
shrink: e.shrink,
|
|
1314
1315
|
complete: w.value
|
|
1315
1316
|
}]),
|
|
1316
|
-
style:
|
|
1317
|
+
style: E.value,
|
|
1317
1318
|
"aria-orientation": "horizontal"
|
|
1318
1319
|
}, [
|
|
1319
1320
|
r["nav-left"]?.call(r),
|
|
1320
|
-
b.map((e) => e.renderTitle(
|
|
1321
|
-
|
|
1321
|
+
b.map((e) => e.renderTitle(K)),
|
|
1322
|
+
Tl(),
|
|
1322
1323
|
r["nav-right"]?.call(r)
|
|
1323
1324
|
])]), r["nav-bottom"]?.call(r)];
|
|
1324
1325
|
return a ? createVNode("div", { ref: p }, [o]) : o;
|
|
1325
|
-
},
|
|
1326
|
+
}, Dl = () => {
|
|
1326
1327
|
B(), nextTick(() => {
|
|
1327
1328
|
var e;
|
|
1328
1329
|
z(!0), (e = m.value?.swipeRef.value) == null || e.resize();
|
|
@@ -1333,20 +1334,20 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1333
1334
|
e.duration,
|
|
1334
1335
|
e.lineWidth,
|
|
1335
1336
|
e.lineHeight
|
|
1336
|
-
], B), watch(windowWidth,
|
|
1337
|
-
e !== k.value &&
|
|
1337
|
+
], B), watch(windowWidth, Dl), watch(() => e.active, (e) => {
|
|
1338
|
+
e !== k.value && H(e);
|
|
1338
1339
|
}), watch(() => b.length, () => {
|
|
1339
|
-
C.inited && (
|
|
1340
|
+
C.inited && (H(e.active), B(), nextTick(() => {
|
|
1340
1341
|
z(!0);
|
|
1341
1342
|
}));
|
|
1342
1343
|
}), useExpose({
|
|
1343
|
-
resize:
|
|
1344
|
-
scrollTo:
|
|
1344
|
+
resize: Dl,
|
|
1345
|
+
scrollTo: Sl
|
|
1345
1346
|
}), onActivated(B), onPopupReopen(B), onMountedOrActivated(() => {
|
|
1346
|
-
|
|
1347
|
-
C.inited = !0, p.value && (
|
|
1347
|
+
H(e.active, !0), nextTick(() => {
|
|
1348
|
+
C.inited = !0, p.value && (i = useRect(p.value).height), z(!0);
|
|
1348
1349
|
});
|
|
1349
|
-
}), useVisibilityChange(
|
|
1350
|
+
}), useVisibilityChange(u, B), useEventListener("scroll", wl, {
|
|
1350
1351
|
target: g,
|
|
1351
1352
|
passive: !0
|
|
1352
1353
|
}), S({
|
|
@@ -1359,13 +1360,13 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1359
1360
|
setTitleRefs: y,
|
|
1360
1361
|
scrollIntoView: z
|
|
1361
1362
|
}), () => createVNode("div", {
|
|
1362
|
-
ref:
|
|
1363
|
+
ref: u,
|
|
1363
1364
|
class: bem$5([e.type])
|
|
1364
1365
|
}, [e.showHeader ? e.sticky ? createVNode(Sticky, {
|
|
1365
|
-
container:
|
|
1366
|
-
offsetTop:
|
|
1367
|
-
onScroll:
|
|
1368
|
-
}, { default: () => [
|
|
1366
|
+
container: u.value,
|
|
1367
|
+
offsetTop: A.value,
|
|
1368
|
+
onScroll: J
|
|
1369
|
+
}, { default: () => [El()] }) : El() : null, createVNode(stdin_default$5, {
|
|
1369
1370
|
ref: m,
|
|
1370
1371
|
count: b.length,
|
|
1371
1372
|
inited: C.inited,
|
|
@@ -1374,7 +1375,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1374
1375
|
swipeable: e.swipeable,
|
|
1375
1376
|
lazyRender: e.lazyRender,
|
|
1376
1377
|
currentIndex: C.currentIndex,
|
|
1377
|
-
onChange:
|
|
1378
|
+
onChange: V
|
|
1378
1379
|
}, { default: () => [r.default?.call(r)] })]);
|
|
1379
1380
|
}
|
|
1380
1381
|
}), TAB_STATUS_KEY = Symbol(), ALL_TAB_STATUS_KEY = Symbol(), useAllTabStatus = () => inject(ALL_TAB_STATUS_KEY, null), useProvideTabStatus = (e) => {
|
|
@@ -1404,7 +1405,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1404
1405
|
i && r === "card" && (n.borderColor = i, a || (o ? n.backgroundColor = i : n.color = i));
|
|
1405
1406
|
let l = o ? s : c;
|
|
1406
1407
|
return l && (n.color = l), n;
|
|
1407
|
-
}),
|
|
1408
|
+
}), i = () => {
|
|
1408
1409
|
let r = createVNode("span", { class: bem$4("text", { ellipsis: !e.scrollable }) }, [n.title ? n.title() : e.title]);
|
|
1409
1410
|
return e.dot || isDef$1(e.badge) && e.badge !== "" ? createVNode(Badge, {
|
|
1410
1411
|
dot: e.dot,
|
|
@@ -1427,12 +1428,12 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1427
1428
|
"aria-disabled": e.disabled || void 0,
|
|
1428
1429
|
"aria-controls": e.controls,
|
|
1429
1430
|
"data-allow-mismatch": "attribute"
|
|
1430
|
-
}, [
|
|
1431
|
+
}, [i()]);
|
|
1431
1432
|
}
|
|
1432
1433
|
}), [name$3, bem$3] = createNamespace("swipe-item"), SwipeItem = withInstall(defineComponent({
|
|
1433
1434
|
name: name$3,
|
|
1434
1435
|
setup(e, { slots: n }) {
|
|
1435
|
-
let r,
|
|
1436
|
+
let r, i = reactive({
|
|
1436
1437
|
offset: 0,
|
|
1437
1438
|
inited: !1,
|
|
1438
1439
|
mounted: !1
|
|
@@ -1443,20 +1444,20 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1443
1444
|
}
|
|
1444
1445
|
let c = computed(() => {
|
|
1445
1446
|
let e = {}, { vertical: n } = o.props;
|
|
1446
|
-
return o.size.value && (e[n ? "height" : "width"] = `${o.size.value}px`),
|
|
1447
|
+
return o.size.value && (e[n ? "height" : "width"] = `${o.size.value}px`), i.offset && (e.transform = `translate${n ? "Y" : "X"}(${i.offset}px)`), e;
|
|
1447
1448
|
}), l = computed(() => {
|
|
1448
1449
|
let { loop: e, lazyRender: n } = o.props;
|
|
1449
1450
|
if (!n || r) return !0;
|
|
1450
|
-
if (!
|
|
1451
|
-
let
|
|
1452
|
-
return r = s.value ===
|
|
1451
|
+
if (!i.mounted) return !1;
|
|
1452
|
+
let a = o.activeIndicator.value, c = o.count.value - 1, l = a === 0 && e ? c : a - 1, u = a === c && e ? 0 : a + 1;
|
|
1453
|
+
return r = s.value === a || s.value === l || s.value === u, r;
|
|
1453
1454
|
});
|
|
1454
1455
|
return onMounted(() => {
|
|
1455
1456
|
nextTick(() => {
|
|
1456
|
-
|
|
1457
|
+
i.mounted = !0;
|
|
1457
1458
|
});
|
|
1458
1459
|
}), useExpose({ setOffset: (e) => {
|
|
1459
|
-
|
|
1460
|
+
i.offset = e;
|
|
1460
1461
|
} }), () => createVNode("div", {
|
|
1461
1462
|
class: bem$3(),
|
|
1462
1463
|
style: c.value
|
|
@@ -1475,29 +1476,29 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1475
1476
|
showZeroBadge: truthProp
|
|
1476
1477
|
}),
|
|
1477
1478
|
setup(e, { slots: n }) {
|
|
1478
|
-
let r = useId(),
|
|
1479
|
+
let r = useId(), i = ref(!1), o = getCurrentInstance(), { parent: s, index: c } = useParent(TABS_KEY);
|
|
1479
1480
|
if (!s) {
|
|
1480
1481
|
process.env.NODE_ENV !== "production" && console.error("[Vant] <Tab> must be a child component of <Tabs>.");
|
|
1481
1482
|
return;
|
|
1482
1483
|
}
|
|
1483
|
-
let l = () => e.name ?? c.value,
|
|
1484
|
-
|
|
1484
|
+
let l = () => e.name ?? c.value, u = () => {
|
|
1485
|
+
i.value = !0, s.props.lazyRender && nextTick(() => {
|
|
1485
1486
|
s.onRendered(l(), e.title);
|
|
1486
1487
|
});
|
|
1487
1488
|
}, f = computed(() => {
|
|
1488
1489
|
let e = l() === s.currentName.value;
|
|
1489
|
-
return e && !
|
|
1490
|
-
}),
|
|
1490
|
+
return e && !i.value && u(), e;
|
|
1491
|
+
}), p = ref(""), h = ref("");
|
|
1491
1492
|
watchEffect(() => {
|
|
1492
1493
|
let { titleClass: n, titleStyle: r } = e;
|
|
1493
|
-
|
|
1494
|
+
p.value = n ? normalizeClass$1(n) : "", h.value = r && typeof r != "string" ? stringifyStyle(normalizeStyle$1(r)) : r;
|
|
1494
1495
|
});
|
|
1495
1496
|
let g = (i) => createVNode(TabTitle, mergeProps({
|
|
1496
1497
|
key: r,
|
|
1497
1498
|
id: `${s.id}-${c.value}`,
|
|
1498
1499
|
ref: s.setTitleRefs(c.value),
|
|
1499
1500
|
style: h.value,
|
|
1500
|
-
class:
|
|
1501
|
+
class: p.value,
|
|
1501
1502
|
isActive: f.value,
|
|
1502
1503
|
controls: r,
|
|
1503
1504
|
scrollable: s.scrollable.value,
|
|
@@ -1525,10 +1526,10 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1525
1526
|
id: r,
|
|
1526
1527
|
renderTitle: g
|
|
1527
1528
|
}), () => {
|
|
1528
|
-
let e = `${s.id}-${c.value}`, { animated:
|
|
1529
|
-
if (!n.default && !
|
|
1529
|
+
let e = `${s.id}-${c.value}`, { animated: a, swipeable: o, scrollspy: l, lazyRender: u } = s.props;
|
|
1530
|
+
if (!n.default && !a) return;
|
|
1530
1531
|
let p = l || f.value;
|
|
1531
|
-
if (
|
|
1532
|
+
if (a || o) return createVNode(SwipeItem, {
|
|
1532
1533
|
id: r,
|
|
1533
1534
|
role: "tabpanel",
|
|
1534
1535
|
class: bem$2("panel-wrapper", { inactive: v.value }),
|
|
@@ -1537,7 +1538,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1537
1538
|
"aria-labelledby": e,
|
|
1538
1539
|
"data-allow-mismatch": "attribute"
|
|
1539
1540
|
}, { default: () => [createVNode("div", { class: bem$2("panel") }, [n.default?.call(n)])] });
|
|
1540
|
-
let m =
|
|
1541
|
+
let m = i.value || l || !u ? n.default?.call(n) : null;
|
|
1541
1542
|
return withDirectives(createVNode("div", {
|
|
1542
1543
|
id: r,
|
|
1543
1544
|
role: "tabpanel",
|
|
@@ -1560,16 +1561,16 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1560
1561
|
props: floatingPanelProps,
|
|
1561
1562
|
emits: ["heightChange", "update:height"],
|
|
1562
1563
|
setup(e, { emit: n, slots: r }) {
|
|
1563
|
-
let
|
|
1564
|
+
let i = .2, o = ref(), s = ref(), c = useSyncPropRef(() => +e.height, (e) => n("update:height", e)), l = computed(() => ({
|
|
1564
1565
|
min: e.anchors[0] ?? 100,
|
|
1565
1566
|
max: e.anchors[e.anchors.length - 1] ?? Math.round(windowHeight.value * .6)
|
|
1566
|
-
})),
|
|
1567
|
+
})), u = computed(() => e.anchors.length >= 2 ? e.anchors : [l.value.min, l.value.max]), f = ref(!1), p = computed(() => ({
|
|
1567
1568
|
height: addUnit(l.value.max),
|
|
1568
1569
|
transform: `translateY(calc(100% + ${addUnit(-c.value)}))`,
|
|
1569
1570
|
transition: f.value ? "none" : `transform ${e.duration}s cubic-bezier(0.18, 0.89, 0.32, 1.28)`
|
|
1570
1571
|
})), m = (e) => {
|
|
1571
|
-
let n = Math.abs(e), { min: r, max:
|
|
1572
|
-
return n >
|
|
1572
|
+
let n = Math.abs(e), { min: r, max: a } = l.value;
|
|
1573
|
+
return n > a ? -(a + (n - a) * i) : n < r ? -(r - (r - n) * i) : e;
|
|
1573
1574
|
}, h, g = -1, v = useTouch(), y = (e) => {
|
|
1574
1575
|
v.start(e), f.value = !0, h = -c.value, g = -1;
|
|
1575
1576
|
}, b = (n) => {
|
|
@@ -1583,10 +1584,10 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1583
1584
|
}
|
|
1584
1585
|
c.value = -m(v.deltaY.value + h);
|
|
1585
1586
|
}, S = () => {
|
|
1586
|
-
g = -1, f.value = !1, c.value = closest(
|
|
1587
|
+
g = -1, f.value = !1, c.value = closest(u.value, c.value), c.value !== -h && n("heightChange", { height: c.value });
|
|
1587
1588
|
};
|
|
1588
1589
|
watch(l, () => {
|
|
1589
|
-
c.value = closest(
|
|
1590
|
+
c.value = closest(u.value, c.value);
|
|
1590
1591
|
}, { immediate: !0 }), useLockScroll(o, () => e.lockScroll || f.value), useEventListener("touchmove", b, { target: o });
|
|
1591
1592
|
let C = () => r.header ? r.header() : createVNode("div", { class: bem$1("header") }, [createVNode("div", { class: bem$1("header-bar") }, null)]);
|
|
1592
1593
|
return () => createVNode("div", {
|
|
@@ -1629,7 +1630,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1629
1630
|
status: "normal",
|
|
1630
1631
|
distance: 0,
|
|
1631
1632
|
duration: 0
|
|
1632
|
-
}), l = useTouch(),
|
|
1633
|
+
}), l = useTouch(), u = () => {
|
|
1633
1634
|
if (e.headHeight !== DEFAULT_HEAD_HEIGHT) return { height: `${e.headHeight}px` };
|
|
1634
1635
|
}, f = () => c.status !== "loading" && c.status !== "success" && !e.disabled, p = (n) => {
|
|
1635
1636
|
let r = +(e.pullDistance || e.headHeight);
|
|
@@ -1647,7 +1648,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1647
1648
|
let { status: e, distance: n } = c;
|
|
1648
1649
|
if (r[e]) return r[e]({ distance: n });
|
|
1649
1650
|
let i = [];
|
|
1650
|
-
return TEXT_STATUS.includes(e) && i.push(createVNode("div", { class: bem("text") }, [h()])), e === "loading" && i.push(createVNode(Loading, { class: bem("loading") }, { default: h })), i;
|
|
1651
|
+
return TEXT_STATUS.includes(e) && i.push(createVNode("div", { class: bem("text") }, [h()])), e === "loading" && i.push(createVNode(Loading$1, { class: bem("loading") }, { default: h })), i;
|
|
1651
1652
|
}, v = () => {
|
|
1652
1653
|
c.status = "success", setTimeout(() => {
|
|
1653
1654
|
m(0);
|
|
@@ -1684,7 +1685,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1684
1685
|
onTouchcancel: C
|
|
1685
1686
|
}, [createVNode("div", {
|
|
1686
1687
|
class: bem("head"),
|
|
1687
|
-
style:
|
|
1688
|
+
style: u()
|
|
1688
1689
|
}, [g()]), r.default?.call(r)])]);
|
|
1689
1690
|
};
|
|
1690
1691
|
}
|
|
@@ -1714,17 +1715,17 @@ function isDeepKey(e) {
|
|
|
1714
1715
|
function toKey(e) {
|
|
1715
1716
|
return typeof e == "string" || typeof e == "symbol" ? e : Object.is(e?.valueOf?.(), -0) ? "-0" : String(e);
|
|
1716
1717
|
}
|
|
1717
|
-
function toString
|
|
1718
|
+
function toString(e) {
|
|
1718
1719
|
if (e == null) return "";
|
|
1719
1720
|
if (typeof e == "string") return e;
|
|
1720
|
-
if (Array.isArray(e)) return e.map(toString
|
|
1721
|
+
if (Array.isArray(e)) return e.map(toString).join(",");
|
|
1721
1722
|
let n = String(e);
|
|
1722
1723
|
return n === "0" && Object.is(Number(e), -0) ? "-0" : n;
|
|
1723
1724
|
}
|
|
1724
1725
|
function toPath(e) {
|
|
1725
1726
|
if (Array.isArray(e)) return e.map(toKey);
|
|
1726
1727
|
if (typeof e == "symbol") return [e];
|
|
1727
|
-
e = toString
|
|
1728
|
+
e = toString(e);
|
|
1728
1729
|
let n = [], r = e.length;
|
|
1729
1730
|
if (r === 0) return n;
|
|
1730
1731
|
let i = 0, a = "", o = "", s = !1;
|
|
@@ -2184,7 +2185,7 @@ function isEmpty(e) {
|
|
|
2184
2185
|
}
|
|
2185
2186
|
return !0;
|
|
2186
2187
|
}
|
|
2187
|
-
function isError(e) {
|
|
2188
|
+
function isError$1(e) {
|
|
2188
2189
|
return getTag(e) === "[object Error]";
|
|
2189
2190
|
}
|
|
2190
2191
|
var loading_default = /* @__PURE__ */ ((e, n) => {
|
|
@@ -2205,7 +2206,7 @@ var loading_default = /* @__PURE__ */ ((e, n) => {
|
|
|
2205
2206
|
useCssVars((e) => ({ v4790b4ce: r.value }));
|
|
2206
2207
|
let n = e, r = computed(() => isNumber(n.size) ? `${n.size}px` : n.size);
|
|
2207
2208
|
return (e, r) => {
|
|
2208
|
-
let i = Loading;
|
|
2209
|
+
let i = Loading$1;
|
|
2209
2210
|
return openBlock(), createBlock(i, normalizeProps(guardReactiveProps(n)), {
|
|
2210
2211
|
default: withCtx(() => [renderSlot(e.$slots, "default", {}, void 0, !0)]),
|
|
2211
2212
|
_: 3
|
|
@@ -2237,7 +2238,7 @@ var localProvidedStateMap = /* @__PURE__ */ new WeakMap(), injectLocal = (...e)
|
|
|
2237
2238
|
return r && localProvidedStateMap.has(r) && n in localProvidedStateMap.get(r) ? localProvidedStateMap.get(r)[n] : inject(...e);
|
|
2238
2239
|
}, isClient = typeof window < "u" && typeof document < "u";
|
|
2239
2240
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
2240
|
-
var notNullish = (e) => e != null, toString = Object.prototype.toString, isObject = (e) => toString.call(e) === "[object Object]", noop = () => {};
|
|
2241
|
+
var notNullish = (e) => e != null, toString$1 = Object.prototype.toString, isObject = (e) => toString$1.call(e) === "[object Object]", noop = () => {};
|
|
2241
2242
|
function toRef$1(...e) {
|
|
2242
2243
|
if (e.length !== 1) return toRef(...e);
|
|
2243
2244
|
let n = e[0];
|
|
@@ -2435,9 +2436,9 @@ function watchOnce(e, n, r) {
|
|
|
2435
2436
|
});
|
|
2436
2437
|
}
|
|
2437
2438
|
function computedAsync(e, n, r) {
|
|
2438
|
-
let
|
|
2439
|
-
|
|
2440
|
-
let { lazy: o = !1, flush: s = "sync", evaluating: c = void 0, shallow: l = !0, onError: u = globalThis.reportError ?? noop } =
|
|
2439
|
+
let i;
|
|
2440
|
+
i = isRef(r) ? { evaluating: r } : r || {};
|
|
2441
|
+
let { lazy: o = !1, flush: s = "sync", evaluating: c = void 0, shallow: l = !0, onError: u = globalThis.reportError ?? noop } = i, d = shallowRef(!o), f = l ? shallowRef(n) : ref(n), p = 0;
|
|
2441
2442
|
return watchEffect(async (n) => {
|
|
2442
2443
|
if (!d.value) return;
|
|
2443
2444
|
p++;
|
|
@@ -2468,7 +2469,7 @@ function unrefElement(e) {
|
|
|
2468
2469
|
function useEventListener$1(...e) {
|
|
2469
2470
|
let n = [], r = () => {
|
|
2470
2471
|
n.forEach((e) => e()), n.length = 0;
|
|
2471
|
-
},
|
|
2472
|
+
}, i = (e, n, r, i) => (e.addEventListener(n, r, i), () => e.removeEventListener(n, r, i)), o = computed(() => {
|
|
2472
2473
|
let n = toArray(toValue(e[0])).filter((e) => e != null);
|
|
2473
2474
|
return n.every((e) => typeof e != "string") ? n : void 0;
|
|
2474
2475
|
}), s = watchImmediate(() => [
|
|
@@ -2476,10 +2477,10 @@ function useEventListener$1(...e) {
|
|
|
2476
2477
|
toArray(toValue(o.value ? e[1] : e[0])),
|
|
2477
2478
|
toArray(unref(o.value ? e[2] : e[1])),
|
|
2478
2479
|
toValue(o.value ? e[3] : e[2])
|
|
2479
|
-
], ([e,
|
|
2480
|
-
if (r(), !e?.length || !
|
|
2480
|
+
], ([e, a, o, s]) => {
|
|
2481
|
+
if (r(), !e?.length || !a?.length || !o?.length) return;
|
|
2481
2482
|
let c = isObject(s) ? { ...s } : s;
|
|
2482
|
-
n.push(...e.flatMap((e) =>
|
|
2483
|
+
n.push(...e.flatMap((e) => a.flatMap((n) => o.map((r) => i(e, n, r, c)))));
|
|
2483
2484
|
}, { flush: "post" });
|
|
2484
2485
|
return tryOnScopeDispose(r), () => {
|
|
2485
2486
|
s(), r();
|
|
@@ -2497,7 +2498,7 @@ function useSupported(e) {
|
|
|
2497
2498
|
return computed(() => (n.value, !!e()));
|
|
2498
2499
|
}
|
|
2499
2500
|
function useMutationObserver(e, n, r = {}) {
|
|
2500
|
-
let { window:
|
|
2501
|
+
let { window: i = defaultWindow,...o } = r, s, c = /* @__PURE__ */ useSupported(() => i && "MutationObserver" in i), l = () => {
|
|
2501
2502
|
s &&= (s.disconnect(), void 0);
|
|
2502
2503
|
}, u = watch(computed(() => {
|
|
2503
2504
|
let n = toArray(toValue(e)).map(unrefElement).filter(notNullish);
|
|
@@ -2518,7 +2519,7 @@ function useMutationObserver(e, n, r = {}) {
|
|
|
2518
2519
|
}
|
|
2519
2520
|
var DEFAULT_DELAY = 500, DEFAULT_THRESHOLD = 10;
|
|
2520
2521
|
function onLongPress(e, n, r) {
|
|
2521
|
-
var
|
|
2522
|
+
var i, o;
|
|
2522
2523
|
let s = computed(() => unrefElement(e)), c, l, u, d = !1;
|
|
2523
2524
|
function f() {
|
|
2524
2525
|
c &&= (clearTimeout(c), void 0), l = void 0, u = void 0, d = !1;
|
|
@@ -2556,7 +2557,7 @@ function onLongPress(e, n, r) {
|
|
|
2556
2557
|
Math.sqrt(o * o + c * c) >= (r?.distanceThreshold ?? DEFAULT_THRESHOLD) && f();
|
|
2557
2558
|
}
|
|
2558
2559
|
let v = {
|
|
2559
|
-
capture: r == null || (
|
|
2560
|
+
capture: r == null || (i = r.modifiers) == null ? void 0 : i.capture,
|
|
2560
2561
|
once: r == null || (o = r.modifiers) == null ? void 0 : o.once
|
|
2561
2562
|
}, y = [
|
|
2562
2563
|
useEventListener$1(s, "pointerdown", h, v),
|
|
@@ -2572,12 +2573,12 @@ function useSSRWidth() {
|
|
|
2572
2573
|
return typeof e == "number" ? e : void 0;
|
|
2573
2574
|
}
|
|
2574
2575
|
function useMediaQuery(e, n = {}) {
|
|
2575
|
-
let { window: r = defaultWindow, ssrWidth:
|
|
2576
|
+
let { window: r = defaultWindow, ssrWidth: i = /* @__PURE__ */ useSSRWidth() } = n, o = /* @__PURE__ */ useSupported(() => r && "matchMedia" in r && typeof r.matchMedia == "function"), s = shallowRef(typeof i == "number"), c = shallowRef(), l = shallowRef(!1);
|
|
2576
2577
|
return watchEffect(() => {
|
|
2577
2578
|
if (s.value) {
|
|
2578
2579
|
s.value = !o.value, l.value = toValue(e).split(",").some((e) => {
|
|
2579
|
-
let n = e.includes("not all"), r = e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),
|
|
2580
|
-
return r && o && (o =
|
|
2580
|
+
let n = e.includes("not all"), r = e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), a = e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), o = !!(r || a);
|
|
2581
|
+
return r && o && (o = i >= pxValue(r[1])), a && o && (o = i <= pxValue(a[1])), n ? !o : o;
|
|
2581
2582
|
});
|
|
2582
2583
|
return;
|
|
2583
2584
|
}
|
|
@@ -2633,29 +2634,29 @@ var StorageSerializers = {
|
|
|
2633
2634
|
write: (e) => e.toISOString()
|
|
2634
2635
|
}
|
|
2635
2636
|
}, customStorageEventName = "vueuse-storage";
|
|
2636
|
-
function useStorage(e, n, r,
|
|
2637
|
+
function useStorage(e, n, r, i = {}) {
|
|
2637
2638
|
let { flush: o = "pre", deep: s = !0, listenToStorageChanges: c = !0, writeDefaults: l = !0, mergeDefaults: u = !1, shallow: d, window: f = defaultWindow, eventFilter: p, onError: m = (e) => {
|
|
2638
2639
|
console.error(e);
|
|
2639
|
-
}, initOnMounted: h } =
|
|
2640
|
+
}, initOnMounted: h } = i, g = (d ? shallowRef : ref)(typeof n == "function" ? n() : n), v = computed(() => toValue(e));
|
|
2640
2641
|
if (!r) try {
|
|
2641
2642
|
r = getSSRHandler("getDefaultStorage", () => defaultWindow?.localStorage)();
|
|
2642
2643
|
} catch (e) {
|
|
2643
2644
|
m(e);
|
|
2644
2645
|
}
|
|
2645
2646
|
if (!r) return g;
|
|
2646
|
-
let y = toValue(n), b = guessSerializerType(y), S =
|
|
2647
|
+
let y = toValue(n), b = guessSerializerType(y), S = i.serializer ?? StorageSerializers[b], { pause: C, resume: w } = pausableWatch(g, (e) => k(e), {
|
|
2647
2648
|
flush: o,
|
|
2648
2649
|
deep: s,
|
|
2649
2650
|
eventFilter: p
|
|
2650
2651
|
});
|
|
2651
2652
|
watch(v, () => j(), { flush: o });
|
|
2652
|
-
let
|
|
2653
|
+
let E = !1;
|
|
2653
2654
|
f && c && (r instanceof Storage ? useEventListener$1(f, "storage", (e) => {
|
|
2654
|
-
h && !
|
|
2655
|
+
h && !E || j(e);
|
|
2655
2656
|
}, { passive: !0 }) : useEventListener$1(f, customStorageEventName, (e) => {
|
|
2656
|
-
h && !
|
|
2657
|
+
h && !E || M(e);
|
|
2657
2658
|
})), h ? tryOnMounted(() => {
|
|
2658
|
-
|
|
2659
|
+
E = !0, j();
|
|
2659
2660
|
}) : j();
|
|
2660
2661
|
function O(e, n) {
|
|
2661
2662
|
if (f) {
|
|
@@ -2717,13 +2718,13 @@ function useStorage(e, n, r, a = {}) {
|
|
|
2717
2718
|
return g;
|
|
2718
2719
|
}
|
|
2719
2720
|
function useResizeObserver(e, n, r = {}) {
|
|
2720
|
-
let { window:
|
|
2721
|
+
let { window: i = defaultWindow,...o } = r, s, c = /* @__PURE__ */ useSupported(() => i && "ResizeObserver" in i), l = () => {
|
|
2721
2722
|
s &&= (s.disconnect(), void 0);
|
|
2722
2723
|
}, u = watch(computed(() => {
|
|
2723
2724
|
let n = toValue(e);
|
|
2724
2725
|
return Array.isArray(n) ? n.map((e) => unrefElement(e)) : [unrefElement(n)];
|
|
2725
2726
|
}), (e) => {
|
|
2726
|
-
if (l(), c.value &&
|
|
2727
|
+
if (l(), c.value && i) {
|
|
2727
2728
|
s = new ResizeObserver(n);
|
|
2728
2729
|
for (let n of e) n && s.observe(n, o);
|
|
2729
2730
|
}
|
|
@@ -2740,7 +2741,7 @@ function useResizeObserver(e, n, r = {}) {
|
|
|
2740
2741
|
}
|
|
2741
2742
|
var ARRIVED_STATE_THRESHOLD_PIXELS = 1;
|
|
2742
2743
|
function useScroll(e, n = {}) {
|
|
2743
|
-
let { throttle: r = 0, idle:
|
|
2744
|
+
let { throttle: r = 0, idle: i = 200, onStop: o = noop, onScroll: s = noop, offset: c = {
|
|
2744
2745
|
left: 0,
|
|
2745
2746
|
right: 0,
|
|
2746
2747
|
top: 0,
|
|
@@ -2790,7 +2791,7 @@ function useScroll(e, n = {}) {
|
|
|
2790
2791
|
bottom: !1
|
|
2791
2792
|
}), E = (e) => {
|
|
2792
2793
|
S.value && (S.value = !1, w.left = !1, w.right = !1, w.top = !1, w.bottom = !1, o(e));
|
|
2793
|
-
}, D = useDebounceFn(E, r +
|
|
2794
|
+
}, D = useDebounceFn(E, r + i), O = (e) => {
|
|
2794
2795
|
var n;
|
|
2795
2796
|
if (!f) return;
|
|
2796
2797
|
let r = (e == null || (n = e.document) == null ? void 0 : n.documentElement) || e?.documentElement || unrefElement(e), { display: i, flexDirection: a, direction: o } = getComputedStyle(r), s = o === "rtl" ? -1 : 1, l = r.scrollLeft;
|
|
@@ -2868,8 +2869,8 @@ var floatPopup_default = /* @__PURE__ */ defineComponent({
|
|
|
2868
2869
|
] },
|
|
2869
2870
|
overlay: { type: Boolean }
|
|
2870
2871
|
},
|
|
2871
|
-
setup(e, { expose:
|
|
2872
|
-
let
|
|
2872
|
+
setup(e, { expose: i }) {
|
|
2873
|
+
let c = useRouter(), u = e, f = shallowRef(!1), { height: p } = useWindowSize(), m = computed(() => isArray(u.anchors) ? u.anchors : u.anchors === "high" ? [
|
|
2873
2874
|
0,
|
|
2874
2875
|
Math.round(.4 * p.value),
|
|
2875
2876
|
Math.round(.7 * p.value),
|
|
@@ -2881,8 +2882,8 @@ var floatPopup_default = /* @__PURE__ */ defineComponent({
|
|
|
2881
2882
|
Math.round(.9 * p.value)
|
|
2882
2883
|
]), h = shallowRef(0), [g, v] = useZIndex(() => h.value > 0), y = noop$1;
|
|
2883
2884
|
return watch(f, () => {
|
|
2884
|
-
f.value ? y =
|
|
2885
|
-
}), onBeforeRouteLeave(y),
|
|
2885
|
+
f.value ? y = c.beforeEach(() => v.value ? f.value = !1 : void 0) : y();
|
|
2886
|
+
}), onBeforeRouteLeave(y), i({
|
|
2886
2887
|
show(e = 2) {
|
|
2887
2888
|
h.value = m.value[e], f.value = !0;
|
|
2888
2889
|
},
|
|
@@ -2891,22 +2892,22 @@ var floatPopup_default = /* @__PURE__ */ defineComponent({
|
|
|
2891
2892
|
},
|
|
2892
2893
|
isShowing: shallowReadonly(f),
|
|
2893
2894
|
height: shallowReadonly(h)
|
|
2894
|
-
}), (i,
|
|
2895
|
-
let
|
|
2896
|
-
return openBlock(), createBlock(Teleport, { to: "#popups" }, [e.overlay ? (openBlock(), createBlock(
|
|
2895
|
+
}), (i, a) => {
|
|
2896
|
+
let c = Overlay, u = FloatingPanel;
|
|
2897
|
+
return openBlock(), createBlock(Teleport, { to: "#popups" }, [e.overlay ? (openBlock(), createBlock(c, {
|
|
2897
2898
|
key: 0,
|
|
2898
2899
|
zIndex: unref(g),
|
|
2899
2900
|
show: f.value,
|
|
2900
|
-
onClick:
|
|
2901
|
+
onClick: a[0] ||= (e) => f.value = !1
|
|
2901
2902
|
}, null, 8, ["zIndex", "show"])) : createCommentVNode("", !0), createVNode(Transition, {
|
|
2902
|
-
onAfterLeave:
|
|
2903
|
+
onAfterLeave: a[3] ||= (e) => h.value = 0,
|
|
2903
2904
|
name: "van-slide-up"
|
|
2904
2905
|
}, {
|
|
2905
|
-
default: withCtx(() => [withDirectives(createVNode(
|
|
2906
|
-
onHeightChange:
|
|
2906
|
+
default: withCtx(() => [withDirectives(createVNode(u, {
|
|
2907
|
+
onHeightChange: a[1] ||= ({ height: e }) => e <= 0 && (f.value = !1),
|
|
2907
2908
|
anchors: m.value,
|
|
2908
2909
|
height: h.value,
|
|
2909
|
-
"onUpdate:height":
|
|
2910
|
+
"onUpdate:height": a[2] ||= (e) => h.value = e,
|
|
2910
2911
|
"content-draggable": !1,
|
|
2911
2912
|
"lock-scroll": e.lockScroll,
|
|
2912
2913
|
style: normalizeStyle([e.style, { zIndex: unref(g) }]),
|
|
@@ -2933,7 +2934,7 @@ var floatPopup_default = /* @__PURE__ */ defineComponent({
|
|
|
2933
2934
|
}
|
|
2934
2935
|
}), image_exports = /* @__PURE__ */ __export({ showImagePreview: () => showImagePreview$1 });
|
|
2935
2936
|
const showImagePreview$1 = (e, n = {}) => {
|
|
2936
|
-
let r = shallowRef(!0), [, ,
|
|
2937
|
+
let r = shallowRef(!0), [, , i] = useZIndex(r), o = showImagePreview({
|
|
2937
2938
|
images: e,
|
|
2938
2939
|
...n,
|
|
2939
2940
|
overlayClass: "!z-2147483646",
|
|
@@ -2945,7 +2946,7 @@ const showImagePreview$1 = (e, n = {}) => {
|
|
|
2945
2946
|
teleport: "#popups"
|
|
2946
2947
|
}), s = window.$router.beforeEach(() => r.value = !1);
|
|
2947
2948
|
return watchOnce(r, () => {
|
|
2948
|
-
s(),
|
|
2949
|
+
s(), i(), o.show = !1;
|
|
2949
2950
|
}), {
|
|
2950
2951
|
isShowing: computed(() => o.show),
|
|
2951
2952
|
close: () => {
|
|
@@ -2995,34 +2996,34 @@ var image_default = /* @__PURE__ */ defineComponent({
|
|
|
2995
2996
|
"click",
|
|
2996
2997
|
"error"
|
|
2997
2998
|
],
|
|
2998
|
-
setup(n, { expose: r, emit:
|
|
2999
|
-
let
|
|
2999
|
+
setup(n, { expose: r, emit: i }) {
|
|
3000
|
+
let u = n, f = computedAsync(async () => {
|
|
3000
3001
|
try {
|
|
3001
|
-
return
|
|
3002
|
+
return u.src ? isString(u.src) ? u.src : await u.src.getUrl() : "";
|
|
3002
3003
|
} catch (e) {
|
|
3003
3004
|
console.error(e);
|
|
3004
3005
|
}
|
|
3005
3006
|
return "";
|
|
3006
|
-
}, ""), p =
|
|
3007
|
-
if (m++, m >
|
|
3007
|
+
}, ""), p = i, m = 0, h = async () => {
|
|
3008
|
+
if (m++, m > u.retryMax) return v.error.add(f.value), p("error");
|
|
3008
3009
|
y.value = !1, await nextTick(), y.value = !0;
|
|
3009
3010
|
}, g = useTemp().$apply("imageState", () => ({
|
|
3010
3011
|
loaded: /* @__PURE__ */ new Set(),
|
|
3011
3012
|
error: /* @__PURE__ */ new Set()
|
|
3012
|
-
})), v =
|
|
3013
|
+
})), v = u.useList ?? g, y = shallowRef(!0), b = () => {
|
|
3013
3014
|
m = 0, h();
|
|
3014
3015
|
};
|
|
3015
3016
|
watch(f, b);
|
|
3016
3017
|
let S = computed(() => v.loaded.has(f.value)), C = computedAsync(async () => {
|
|
3017
3018
|
try {
|
|
3018
|
-
return
|
|
3019
|
+
return u.fallback ? isString(u.fallback) ? u.fallback : await u.fallback.getUrl() : "";
|
|
3019
3020
|
} catch (e) {
|
|
3020
3021
|
console.error(e);
|
|
3021
3022
|
}
|
|
3022
3023
|
return "";
|
|
3023
|
-
}, ""),
|
|
3024
|
-
p("click"),
|
|
3025
|
-
},
|
|
3024
|
+
}, ""), w = (e) => {
|
|
3025
|
+
p("click"), u.previewable && (e.stopPropagation(), showImagePreview$1([f.value], { closeable: !0 }));
|
|
3026
|
+
}, k = (...e) => {
|
|
3026
3027
|
p("load", ...e), v.loaded.add(f.value);
|
|
3027
3028
|
}, j = useTemplateRef("img");
|
|
3028
3029
|
return r({
|
|
@@ -3030,12 +3031,12 @@ var image_default = /* @__PURE__ */ defineComponent({
|
|
|
3030
3031
|
imageEl: computed(() => j.value?.imageRef),
|
|
3031
3032
|
imageIns: j
|
|
3032
3033
|
}), (r, i) => {
|
|
3033
|
-
let
|
|
3034
|
+
let a = NImage, m = Icon$1;
|
|
3034
3035
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3035
|
-
y.value ? withDirectives((openBlock(), createBlock(
|
|
3036
|
+
y.value ? withDirectives((openBlock(), createBlock(a, mergeProps({
|
|
3036
3037
|
key: 0,
|
|
3037
3038
|
onError: h
|
|
3038
|
-
},
|
|
3039
|
+
}, u, {
|
|
3039
3040
|
"object-fit": n.fit,
|
|
3040
3041
|
"preview-disabled": "",
|
|
3041
3042
|
alt: n.alt,
|
|
@@ -3044,16 +3045,16 @@ var image_default = /* @__PURE__ */ defineComponent({
|
|
|
3044
3045
|
"img-props": {
|
|
3045
3046
|
...n.imgProp ?? {},
|
|
3046
3047
|
class: "w-full",
|
|
3047
|
-
fetchpriority:
|
|
3048
|
+
fetchpriority: u.fetchpriority
|
|
3048
3049
|
},
|
|
3049
3050
|
class: [
|
|
3050
3051
|
{ "!rounded-full": !!n.round },
|
|
3051
3052
|
n.inline ? "inline-flex" : "flex",
|
|
3052
|
-
|
|
3053
|
+
u.class
|
|
3053
3054
|
],
|
|
3054
3055
|
style: n.style,
|
|
3055
|
-
onLoad:
|
|
3056
|
-
onClick:
|
|
3056
|
+
onLoad: k,
|
|
3057
|
+
onClick: w,
|
|
3057
3058
|
src: unref(f)
|
|
3058
3059
|
}), null, 16, [
|
|
3059
3060
|
"object-fit",
|
|
@@ -3068,27 +3069,27 @@ var image_default = /* @__PURE__ */ defineComponent({
|
|
|
3068
3069
|
class: normalizeClass(["justify-center items-center", [
|
|
3069
3070
|
{ "!rounded-full": !!n.round },
|
|
3070
3071
|
n.inline ? "inline-flex" : "flex",
|
|
3071
|
-
|
|
3072
|
+
u.class
|
|
3072
3073
|
]]),
|
|
3073
3074
|
style: normalizeStyle(n.style),
|
|
3074
3075
|
onClick: i[0] ||= (e) => p("click")
|
|
3075
3076
|
}, [r.$slots.loading ? renderSlot(r.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(loading_default, { key: 1 }))], 6)) : createCommentVNode("", !0),
|
|
3076
|
-
unref(v).error.has(unref(f)) && !n.hideError ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [n.fallback ? (openBlock(), createBlock(
|
|
3077
|
+
unref(v).error.has(unref(f)) && !n.hideError ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [n.fallback ? (openBlock(), createBlock(a, mergeProps({
|
|
3077
3078
|
key: 0,
|
|
3078
3079
|
onError: h
|
|
3079
|
-
},
|
|
3080
|
+
}, u, {
|
|
3080
3081
|
"object-fit": n.fit,
|
|
3081
3082
|
"preview-disabled": "",
|
|
3082
3083
|
alt: n.alt,
|
|
3083
3084
|
"img-props": {
|
|
3084
3085
|
...n.imgProp ?? {},
|
|
3085
3086
|
class: "w-full",
|
|
3086
|
-
fetchpriority:
|
|
3087
|
+
fetchpriority: u.fetchpriority
|
|
3087
3088
|
},
|
|
3088
3089
|
class: [
|
|
3089
3090
|
{ "!rounded-full": !!n.round },
|
|
3090
3091
|
n.inline ? "inline-flex" : "flex",
|
|
3091
|
-
|
|
3092
|
+
u.class
|
|
3092
3093
|
],
|
|
3093
3094
|
style: n.style,
|
|
3094
3095
|
src: unref(C)
|
|
@@ -3104,7 +3105,7 @@ var image_default = /* @__PURE__ */ defineComponent({
|
|
|
3104
3105
|
class: normalizeClass(["justify-center items-center flex-col", [
|
|
3105
3106
|
{ "!rounded-full": !!n.round },
|
|
3106
3107
|
n.inline ? "inline-flex" : "flex",
|
|
3107
|
-
|
|
3108
|
+
u.class
|
|
3108
3109
|
]]),
|
|
3109
3110
|
onClick: i[1] ||= withModifiers(() => {
|
|
3110
3111
|
unref(v).error.delete(unref(f)), b();
|
|
@@ -3174,9 +3175,7 @@ var SharedFunction = class {
|
|
|
3174
3175
|
...i
|
|
3175
3176
|
};
|
|
3176
3177
|
}
|
|
3177
|
-
},
|
|
3178
|
-
const delay = (e) => new Promise((n) => setTimeout(n, e));
|
|
3179
|
-
var request_exports = /* @__PURE__ */ __export({
|
|
3178
|
+
}, request_exports = /* @__PURE__ */ __export({
|
|
3180
3179
|
SmartAbortController: () => SmartAbortController,
|
|
3181
3180
|
createAxios: () => createAxios,
|
|
3182
3181
|
requestErrorResult: () => requestErrorResult,
|
|
@@ -3307,7 +3306,7 @@ var data_exports = /* @__PURE__ */ __export({
|
|
|
3307
3306
|
let n = await e;
|
|
3308
3307
|
this.data.value = this.processor(n), this.isLoading.value = !1, this.isError.value = !1, this.isEmpty.value = isEmpty(n), this.emitter.emit("success", this.data.value);
|
|
3309
3308
|
} catch (e) {
|
|
3310
|
-
this.data.value = void 0, this.isError.value = !0, this.errorCause.value = isError(e) ? e : Error(String(e)), console.error("Non-throw Error [PromiseContent]", e), this.emitter.emit("error", e);
|
|
3309
|
+
this.data.value = void 0, this.isError.value = !0, this.errorCause.value = isError$1(e) ? e : Error(String(e)), console.error("Non-throw Error [PromiseContent]", e), this.emitter.emit("error", e);
|
|
3311
3310
|
}
|
|
3312
3311
|
this.emitter.emit("finial", void 0);
|
|
3313
3312
|
}
|
|
@@ -3473,18 +3472,30 @@ const callbackToPromise = (e) => {
|
|
|
3473
3472
|
let { resolve: n, promise: r } = Promise.withResolvers();
|
|
3474
3473
|
return e(n), r;
|
|
3475
3474
|
};
|
|
3476
|
-
var _hoisted_1$
|
|
3475
|
+
var _hoisted_1$4 = {
|
|
3477
3476
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3478
3477
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
3479
3478
|
viewBox: "0 0 1024 1024"
|
|
3480
3479
|
}, ReloadOutlined_default = defineComponent({
|
|
3481
3480
|
name: "ReloadOutlined",
|
|
3482
3481
|
render: function(e, n) {
|
|
3483
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
3482
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, n[0] ||= [createElementVNode("path", {
|
|
3484
3483
|
d: "M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92C290 92 102.3 279.5 102 511.5C101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1c1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 0 0-10.1 4.8c-1.8 5-3.8 10-5.9 14.9c-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 0 1 655.9 829c-42.3 17.9-87.4 27-133.8 27c-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 0 1 279 755.2a342.16 342.16 0 0 1-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4c31.6-31.6 68.4-56.4 109.3-73.8c42.3-17.9 87.4-27 133.8-27c46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 0 1 109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z",
|
|
3485
3484
|
fill: "currentColor"
|
|
3486
3485
|
}, null, -1)]);
|
|
3487
3486
|
}
|
|
3487
|
+
}), _hoisted_1$3 = {
|
|
3488
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3489
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
3490
|
+
viewBox: "0 0 24 24"
|
|
3491
|
+
}, FileDownloadRound_default = defineComponent({
|
|
3492
|
+
name: "FileDownloadRound",
|
|
3493
|
+
render: function(e, n) {
|
|
3494
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$3, n[0] ||= [createElementVNode("path", {
|
|
3495
|
+
d: "M16.59 9H15V4c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v5H7.41c-.89 0-1.34 1.08-.71 1.71l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.63-.63.19-1.71-.7-1.71zM5 19c0 .55.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1z",
|
|
3496
|
+
fill: "currentColor"
|
|
3497
|
+
}, null, -1)]);
|
|
3498
|
+
}
|
|
3488
3499
|
}), _hoisted_1$2 = {
|
|
3489
3500
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3490
3501
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
@@ -3546,27 +3557,27 @@ var _hoisted_1$3 = {
|
|
|
3546
3557
|
},
|
|
3547
3558
|
emits: ["retry", "resetRetry"],
|
|
3548
3559
|
setup(e, { expose: n }) {
|
|
3549
|
-
let
|
|
3550
|
-
isLoading:
|
|
3551
|
-
isError:
|
|
3552
|
-
errorCause:
|
|
3553
|
-
isEmpty:
|
|
3554
|
-
data:
|
|
3555
|
-
isNoResult:
|
|
3556
|
-
} : PromiseContent.isPromiseContent(
|
|
3557
|
-
isLoading:
|
|
3558
|
-
isError:
|
|
3559
|
-
errorCause:
|
|
3560
|
-
isEmpty:
|
|
3561
|
-
data:
|
|
3562
|
-
isNoResult:
|
|
3560
|
+
let i = e, f = computed(() => Stream.isStream(i.source) ? {
|
|
3561
|
+
isLoading: i.source.isRequesting.value,
|
|
3562
|
+
isError: i.source.error.value,
|
|
3563
|
+
errorCause: i.source.error.value?.message,
|
|
3564
|
+
isEmpty: i.source.isEmpty.value,
|
|
3565
|
+
data: i.source.data.value,
|
|
3566
|
+
isNoResult: i.source.isNoData.value
|
|
3567
|
+
} : PromiseContent.isPromiseContent(i.source) ? {
|
|
3568
|
+
isLoading: i.source.isLoading.value,
|
|
3569
|
+
isError: i.source.isError.value,
|
|
3570
|
+
errorCause: i.source.errorCause.value?.message,
|
|
3571
|
+
isEmpty: i.source.isEmpty.value,
|
|
3572
|
+
data: i.source.data.value,
|
|
3573
|
+
isNoResult: i.source.isEmpty.value
|
|
3563
3574
|
} : {
|
|
3564
3575
|
isLoading: !1,
|
|
3565
3576
|
isError: !1,
|
|
3566
3577
|
errorCause: void 0,
|
|
3567
|
-
isEmpty: isEmpty(
|
|
3568
|
-
data:
|
|
3569
|
-
isNoResult: isEmpty(
|
|
3578
|
+
isEmpty: isEmpty(i.source),
|
|
3579
|
+
data: i.source,
|
|
3580
|
+
isNoResult: isEmpty(i.source)
|
|
3570
3581
|
}), p = {
|
|
3571
3582
|
isLoadingNoData: {
|
|
3572
3583
|
opacity: 1,
|
|
@@ -3585,7 +3596,7 @@ var _hoisted_1$3 = {
|
|
|
3585
3596
|
opacity: 1,
|
|
3586
3597
|
translateY: "-50%",
|
|
3587
3598
|
width: "70%",
|
|
3588
|
-
minHeight:
|
|
3599
|
+
minHeight: i.retriable ? "22rem" : "20rem",
|
|
3589
3600
|
paddingBlock: "2px",
|
|
3590
3601
|
paddingInline: "2px",
|
|
3591
3602
|
left: "50%",
|
|
@@ -3646,11 +3657,11 @@ var _hoisted_1$3 = {
|
|
|
3646
3657
|
backgroundColor: "var(--p-color)",
|
|
3647
3658
|
borderRadius: "4px"
|
|
3648
3659
|
}
|
|
3649
|
-
}, m = computed(() => !
|
|
3650
|
-
return n({ cont: h }), (n,
|
|
3651
|
-
let g = Loading, v = NEmpty, y = NButton, b = NIcon, S = NResult, C = AnimatePresence;
|
|
3660
|
+
}, m = computed(() => !i.hideLoading && f.value.isLoading ? f.value.isEmpty ? "isLoadingNoData" : "isLoadingData" : !i.hideError && f.value.isError ? f.value.isEmpty ? "isErrorNoData" : "isErrorData" : !i.hideEmpty && f.value.isNoResult ? "isEmpty" : "done"), h = useTemplateRef("cont");
|
|
3661
|
+
return n({ cont: h }), (n, a) => {
|
|
3662
|
+
let g = Loading$1, v = NEmpty, y = NButton, b = NIcon, S = NResult, C = AnimatePresence;
|
|
3652
3663
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [createElementVNode("div", {
|
|
3653
|
-
class: normalizeClass(["relative size-full", [
|
|
3664
|
+
class: normalizeClass(["relative size-full", [i.class]]),
|
|
3654
3665
|
ref_key: "cont",
|
|
3655
3666
|
ref: h
|
|
3656
3667
|
}, [f.value.isEmpty ? createCommentVNode("", !0) : renderSlot(n.$slots, "default", {
|
|
@@ -3678,7 +3689,7 @@ var _hoisted_1$3 = {
|
|
|
3678
3689
|
size: "10px",
|
|
3679
3690
|
color: "white"
|
|
3680
3691
|
}, {
|
|
3681
|
-
default: withCtx(() => [...
|
|
3692
|
+
default: withCtx(() => [...a[2] ||= [createTextVNode("加载中", -1)]]),
|
|
3682
3693
|
_: 1
|
|
3683
3694
|
})) : m.value === "isEmpty" ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(v, {
|
|
3684
3695
|
description: "无结果",
|
|
@@ -3693,10 +3704,10 @@ var _hoisted_1$3 = {
|
|
|
3693
3704
|
}, {
|
|
3694
3705
|
footer: withCtx(() => [e.retriable ? (openBlock(), createBlock(y, {
|
|
3695
3706
|
key: 0,
|
|
3696
|
-
onClick:
|
|
3707
|
+
onClick: a[0] ||= (e) => n.$emit("resetRetry"),
|
|
3697
3708
|
type: "primary"
|
|
3698
3709
|
}, {
|
|
3699
|
-
default: withCtx(() => [...
|
|
3710
|
+
default: withCtx(() => [...a[3] ||= [createTextVNode("重试", -1)]]),
|
|
3700
3711
|
_: 1
|
|
3701
3712
|
})) : createCommentVNode("", !0)]),
|
|
3702
3713
|
icon: withCtx(() => [createVNode(b, {
|
|
@@ -3719,12 +3730,12 @@ var _hoisted_1$3 = {
|
|
|
3719
3730
|
default: withCtx(() => [createVNode(unref(WifiTetheringErrorRound_default))]),
|
|
3720
3731
|
_: 1
|
|
3721
3732
|
}),
|
|
3722
|
-
createElementVNode("div", _hoisted_5, [
|
|
3733
|
+
createElementVNode("div", _hoisted_5, [a[4] ||= createElementVNode("div", { class: "text-sm" }, "网络错误", -1), createElementVNode("div", _hoisted_6, toDisplayString(f.value.errorCause ?? "未知原因"), 1)]),
|
|
3723
3734
|
createVNode(y, {
|
|
3724
3735
|
circle: "",
|
|
3725
3736
|
type: "error",
|
|
3726
3737
|
size: "large",
|
|
3727
|
-
onClick:
|
|
3738
|
+
onClick: a[1] ||= (e) => n.$emit("retry")
|
|
3728
3739
|
}, {
|
|
3729
3740
|
icon: withCtx(() => [createVNode(b, { color: "white" }, {
|
|
3730
3741
|
default: withCtx(() => [createVNode(unref(ReloadOutlined_default))]),
|
|
@@ -3757,6 +3768,7 @@ var _hoisted_1$3 = {
|
|
|
3757
3768
|
goBottom: { type: Boolean },
|
|
3758
3769
|
itemResizable: { type: Boolean },
|
|
3759
3770
|
dataProcessor: {},
|
|
3771
|
+
unReloadable: { type: Boolean },
|
|
3760
3772
|
style: { type: [
|
|
3761
3773
|
Boolean,
|
|
3762
3774
|
null,
|
|
@@ -3772,38 +3784,38 @@ var _hoisted_1$3 = {
|
|
|
3772
3784
|
"retry"
|
|
3773
3785
|
],
|
|
3774
3786
|
setup(e, { expose: n, emit: r }) {
|
|
3775
|
-
let
|
|
3776
|
-
...Stream.isStream(
|
|
3777
|
-
data: c(
|
|
3778
|
-
isDone:
|
|
3779
|
-
isRequesting:
|
|
3780
|
-
isError: !!
|
|
3781
|
-
length: c(
|
|
3782
|
-
isEmpty:
|
|
3783
|
-
source:
|
|
3784
|
-
} : isArray(
|
|
3785
|
-
data: c(
|
|
3787
|
+
let i = e, s = r, c = (e) => i.dataProcessor?.(e) ?? e, l = computed(() => ({
|
|
3788
|
+
...Stream.isStream(i.source) ? {
|
|
3789
|
+
data: c(i.source.data.value),
|
|
3790
|
+
isDone: i.source.isDone.value,
|
|
3791
|
+
isRequesting: i.source.isRequesting.value,
|
|
3792
|
+
isError: !!i.source.error.value,
|
|
3793
|
+
length: c(i.source.data.value).length,
|
|
3794
|
+
isEmpty: i.source.isEmpty.value,
|
|
3795
|
+
source: i.source
|
|
3796
|
+
} : isArray(i.source) ? {
|
|
3797
|
+
data: c(i.source),
|
|
3786
3798
|
isDone: !0,
|
|
3787
3799
|
isRequesting: !1,
|
|
3788
3800
|
isError: !1,
|
|
3789
|
-
length: c(
|
|
3790
|
-
isEmpty: isEmpty(
|
|
3791
|
-
source:
|
|
3801
|
+
length: c(i.source).length,
|
|
3802
|
+
isEmpty: isEmpty(i.source),
|
|
3803
|
+
source: i.source
|
|
3792
3804
|
} : {
|
|
3793
|
-
data: c(
|
|
3794
|
-
isDone:
|
|
3795
|
-
isRequesting:
|
|
3796
|
-
isError:
|
|
3797
|
-
length: c(
|
|
3798
|
-
isEmpty:
|
|
3799
|
-
source:
|
|
3805
|
+
data: c(i.source.data.data.value ?? []),
|
|
3806
|
+
isDone: i.source.isEnd,
|
|
3807
|
+
isRequesting: i.source.data.isLoading.value,
|
|
3808
|
+
isError: i.source.data.isError.value,
|
|
3809
|
+
length: c(i.source.data.data.value ?? []).length,
|
|
3810
|
+
isEmpty: i.source.data.isEmpty.value,
|
|
3811
|
+
source: i.source.data
|
|
3800
3812
|
},
|
|
3801
|
-
next: () => Stream.isStream(
|
|
3802
|
-
retry: () => Stream.isStream(
|
|
3803
|
-
reset: () => Stream.isStream(
|
|
3813
|
+
next: () => Stream.isStream(i.source) ? i.source.next() : callbackToPromise((e) => s("next", e)),
|
|
3814
|
+
retry: () => Stream.isStream(i.source) ? i.source.retry() : callbackToPromise((e) => s("retry", e)),
|
|
3815
|
+
reset: () => Stream.isStream(i.source) ? i.source.reset() : s("reset")
|
|
3804
3816
|
}));
|
|
3805
3817
|
watch(() => l.value.data, () => {
|
|
3806
|
-
|
|
3818
|
+
i.goBottom && u.value?.scrollTo({
|
|
3807
3819
|
position: "bottom",
|
|
3808
3820
|
behavior: "instant"
|
|
3809
3821
|
});
|
|
@@ -3812,28 +3824,28 @@ var _hoisted_1$3 = {
|
|
|
3812
3824
|
deep: !0,
|
|
3813
3825
|
immediate: !0
|
|
3814
3826
|
}), watch(l, (e) => {
|
|
3815
|
-
e.isRequesting || ceil(window.innerHeight /
|
|
3827
|
+
e.isRequesting || ceil(window.innerHeight / i.itemHeight) + 2 > e.length && !e.isDone && (e.isError ? e.retry() : e.next());
|
|
3816
3828
|
}, { immediate: !0 });
|
|
3817
|
-
let
|
|
3818
|
-
let e =
|
|
3829
|
+
let u = useTemplateRef("vList"), { y: f } = useScroll(() => u.value?.getScrollContainer()), p = debounce(async () => {
|
|
3830
|
+
let e = u.value?.virtualListInstRef?.itemsElRef?.querySelector(" .v-vl-visible-items");
|
|
3819
3831
|
if (!e) return;
|
|
3820
|
-
let { itemHeight: n } =
|
|
3821
|
-
r && !s && !
|
|
3832
|
+
let { itemHeight: n } = i, { data: r, isDone: a, isError: o, isRequesting: s, retry: c, next: d, length: p } = l.value;
|
|
3833
|
+
r && !s && !a && n * (p - 2) < f.value + (e?.children?.length ?? window.innerHeight / n) * n && (o ? c() : d());
|
|
3822
3834
|
}, 200), m = shallowRef(!1), h = shallowRef(!1), g = async () => {
|
|
3823
|
-
await l.value.
|
|
3835
|
+
l.value.reset(), console.log("reset done"), await l.value.next(), h.value = !1;
|
|
3824
3836
|
};
|
|
3825
3837
|
return n({
|
|
3826
3838
|
scrollTop: f,
|
|
3827
|
-
listInstance:
|
|
3839
|
+
listInstance: u
|
|
3828
3840
|
}), (n, r) => {
|
|
3829
|
-
let
|
|
3841
|
+
let a = NVirtualList, s = PullRefresh;
|
|
3830
3842
|
return openBlock(), createBlock(s, {
|
|
3831
3843
|
modelValue: h.value,
|
|
3832
|
-
"onUpdate:modelValue": r[
|
|
3833
|
-
class: normalizeClass(["relative",
|
|
3844
|
+
"onUpdate:modelValue": r[1] ||= (e) => h.value = e,
|
|
3845
|
+
class: normalizeClass(["relative", i.class]),
|
|
3834
3846
|
onRefresh: g,
|
|
3835
|
-
disabled: (unref(Stream).isStream(e.source) ? !1 : unref(isArray)(e.source) ? !0 : e.source.reloadable ?? !0) || l.value.isError || l.value.isRequesting || !!unref(f) && !m.value,
|
|
3836
|
-
onChange: r[
|
|
3847
|
+
disabled: e.unReloadable || (unref(Stream).isStream(e.source) ? !1 : unref(isArray)(e.source) ? !0 : e.source.reloadable ?? !0) || l.value.isError || l.value.isRequesting || !!unref(f) && !m.value,
|
|
3848
|
+
onChange: r[2] ||= ({ distance: e }) => m.value = !!e,
|
|
3837
3849
|
style: normalizeStyle(e.style)
|
|
3838
3850
|
}, {
|
|
3839
3851
|
default: withCtx(() => [createVNode(content_default, {
|
|
@@ -3842,18 +3854,19 @@ var _hoisted_1$3 = {
|
|
|
3842
3854
|
"class-loading": "mt-2 !h-[24px]",
|
|
3843
3855
|
"class-empty": "!h-full",
|
|
3844
3856
|
"class-error": "!h-full",
|
|
3845
|
-
|
|
3846
|
-
"hide-loading": m.value && l.value.isRequesting
|
|
3857
|
+
onResetRetry: g,
|
|
3858
|
+
"hide-loading": m.value && l.value.isRequesting,
|
|
3859
|
+
onRetry: r[0] ||= (e) => l.value.retry()
|
|
3847
3860
|
}, {
|
|
3848
3861
|
default: withCtx(() => [createVNode(var_default, { value: l.value.data }, {
|
|
3849
|
-
default: withCtx(({ value: r }) => [createVNode(
|
|
3862
|
+
default: withCtx(({ value: r }) => [createVNode(a, mergeProps(e.listProp ?? {}, {
|
|
3850
3863
|
"item-resizable": e.itemResizable,
|
|
3851
3864
|
"item-size": e.itemHeight,
|
|
3852
3865
|
onScroll: unref(p),
|
|
3853
3866
|
class: ["overflow-x-hidden h-full", [m.value ? "overflow-y-hidden" : "overflow-y-auto"]],
|
|
3854
3867
|
items: r,
|
|
3855
3868
|
ref_key: "vList",
|
|
3856
|
-
ref:
|
|
3869
|
+
ref: u
|
|
3857
3870
|
}), {
|
|
3858
3871
|
default: withCtx(({ item: i }) => [renderSlot(n.$slots, "default", {
|
|
3859
3872
|
height: e.itemHeight,
|
|
@@ -3931,7 +3944,7 @@ var _hoisted_1$3 = {
|
|
|
3931
3944
|
}),
|
|
3932
3945
|
emits: /* @__PURE__ */ mergeModels(["closed"], ["update:show"]),
|
|
3933
3946
|
setup(e, { expose: n }) {
|
|
3934
|
-
let r = useRouter(),
|
|
3947
|
+
let r = useRouter(), i = e, c = useModel(e, "show"), l = shallowRef(c.value), [u, d] = useZIndex(computed(() => i.useTrulyShow ? l.value : c.value)), f = noop$1;
|
|
3935
3948
|
return watch(c, (e) => {
|
|
3936
3949
|
e ? f = r.beforeEach(() => {
|
|
3937
3950
|
if (console.log("popup:\n", "isLast:", d.value, "show:", c.value), d.value) return c.value ? c.value = !1 : void 0;
|
|
@@ -3940,8 +3953,8 @@ var _hoisted_1$3 = {
|
|
|
3940
3953
|
zIndex: u,
|
|
3941
3954
|
trulyShow: l
|
|
3942
3955
|
}), (n, r) => {
|
|
3943
|
-
let
|
|
3944
|
-
return openBlock(), createBlock(
|
|
3956
|
+
let a = Popup;
|
|
3957
|
+
return openBlock(), createBlock(a, mergeProps(i, {
|
|
3945
3958
|
show: c.value,
|
|
3946
3959
|
"onUpdate:show": r[0] ||= (e) => c.value = e,
|
|
3947
3960
|
"z-index": unref(u),
|
|
@@ -3970,42 +3983,42 @@ var _hoisted_1$3 = {
|
|
|
3970
3983
|
routerBase: {}
|
|
3971
3984
|
},
|
|
3972
3985
|
setup(n) {
|
|
3973
|
-
let r = n, i = useRoute(),
|
|
3986
|
+
let r = n, i = useRoute(), a = ref(decodeURI(i.path.replaceAll(r.routerBase + "/", "").split("/")[0])), s = useRouter(), l = useTemplateRef("tab"), u = async (e) => {
|
|
3974
3987
|
let n = "?", i = r.items.find((n) => n.name == e);
|
|
3975
3988
|
for (let e in i.queries ?? {}) if (Object.prototype.hasOwnProperty.call(i.queries ?? {}, e)) {
|
|
3976
3989
|
let r = (i.queries ?? {})[e];
|
|
3977
3990
|
n += `${e}=${r}&`;
|
|
3978
3991
|
}
|
|
3979
|
-
return n = n.replace(/&$/, ""), await
|
|
3992
|
+
return n = n.replace(/&$/, ""), await s.force.replace(`${r.routerBase}/${e.split("/").map(encodeURI).join("/")}${n}`), !0;
|
|
3980
3993
|
};
|
|
3981
3994
|
watch(() => r.items, (e) => {
|
|
3982
|
-
e.find((e) => e.name.startsWith(
|
|
3995
|
+
e.find((e) => e.name.startsWith(a.value)) || console.log(a.value, e);
|
|
3983
3996
|
});
|
|
3984
|
-
let d =
|
|
3997
|
+
let d = s.afterEach((e) => {
|
|
3985
3998
|
if (e.path.startsWith(r.routerBase)) {
|
|
3986
3999
|
let n = e.path.replaceAll(r.routerBase + "/", "").split("/")[0];
|
|
3987
|
-
n !==
|
|
4000
|
+
n !== a.value && (a.value = n);
|
|
3988
4001
|
}
|
|
3989
4002
|
});
|
|
3990
4003
|
return onUnmounted(() => {
|
|
3991
4004
|
d();
|
|
3992
4005
|
}), (r, i) => {
|
|
3993
|
-
let
|
|
4006
|
+
let s = Tab, d = Tabs;
|
|
3994
4007
|
return openBlock(), createBlock(d, {
|
|
3995
4008
|
ref_key: "tab",
|
|
3996
4009
|
ref: l,
|
|
3997
4010
|
shrink: "",
|
|
3998
|
-
active:
|
|
3999
|
-
"onUpdate:active": i[0] ||= (e) =>
|
|
4011
|
+
active: a.value,
|
|
4012
|
+
"onUpdate:active": i[0] ||= (e) => a.value = e,
|
|
4000
4013
|
beforeChange: u,
|
|
4001
4014
|
class: "w-full"
|
|
4002
4015
|
}, {
|
|
4003
4016
|
"nav-left": withCtx(() => [renderSlot(r.$slots, "left")]),
|
|
4004
4017
|
"nav-right": withCtx(() => [renderSlot(r.$slots, "right")]),
|
|
4005
4018
|
"nav-bottom": withCtx(() => [renderSlot(r.$slots, "bottom")]),
|
|
4006
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(n.items, (e) => (openBlock(), createBlock(
|
|
4019
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(n.items, (e) => (openBlock(), createBlock(s, {
|
|
4007
4020
|
title: e.title,
|
|
4008
|
-
onClick: (n) =>
|
|
4021
|
+
onClick: (n) => a.value = e.name,
|
|
4009
4022
|
name: e.name
|
|
4010
4023
|
}, null, 8, [
|
|
4011
4024
|
"title",
|
|
@@ -4023,23 +4036,23 @@ var _hoisted_1$3 = {
|
|
|
4023
4036
|
ellipsis: {}
|
|
4024
4037
|
},
|
|
4025
4038
|
setup(n) {
|
|
4026
|
-
let r = n,
|
|
4039
|
+
let r = n, i = computed(() => r.text.replace(/(http(s?):\/\/)?([\w-]+\.)+(\.?[a-z]+)+(:\d+)?(\/[\w-.\/?%&=]*)?/gi, (e) => `\u1145[[${e}]]\u1145`).split("ᅅ").filter(Boolean).map((e) => /\[\[[^\[\]]+\]\]/g.test(e) ? {
|
|
4027
4040
|
value: e.substring(2, e.length - 2),
|
|
4028
4041
|
mode: "link"
|
|
4029
4042
|
} : {
|
|
4030
4043
|
value: e,
|
|
4031
4044
|
mode: "text"
|
|
4032
4045
|
}));
|
|
4033
|
-
return (r,
|
|
4034
|
-
let
|
|
4046
|
+
return (r, a) => {
|
|
4047
|
+
let l = NButton;
|
|
4035
4048
|
return openBlock(), createElementBlock("div", {
|
|
4036
4049
|
class: normalizeClass([[unref(isNumber)(n.ellipsis) && "overflow-ellipsis overflow-hidden"], "whitespace-pre-wrap text-(--van-text-color)"]),
|
|
4037
4050
|
style: normalizeStyle([unref(isNumber)(n.ellipsis) && `line-break: anywhere;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: ${n.ellipsis};`])
|
|
4038
|
-
}, [renderSlot(r.$slots, "default"), (openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
4051
|
+
}, [renderSlot(r.$slots, "default"), (openBlock(!0), createElementBlock(Fragment, null, renderList(i.value, (n) => (openBlock(), createElementBlock(Fragment, null, [n.mode === "link" ? (openBlock(), createBlock(l, {
|
|
4039
4052
|
key: 0,
|
|
4040
4053
|
tag: "a",
|
|
4041
4054
|
class: "underline",
|
|
4042
|
-
onClick:
|
|
4055
|
+
onClick: a[0] ||= withModifiers(() => {}, ["stop"]),
|
|
4043
4056
|
text: "",
|
|
4044
4057
|
type: "primary",
|
|
4045
4058
|
target: "_blank",
|
|
@@ -4071,23 +4084,23 @@ var _hoisted_1$3 = {
|
|
|
4071
4084
|
"longClick"
|
|
4072
4085
|
], ["update:modelValue"]),
|
|
4073
4086
|
setup(e, { emit: n }) {
|
|
4074
|
-
let r = e, i = n,
|
|
4075
|
-
watch(
|
|
4076
|
-
let
|
|
4077
|
-
i("click", !
|
|
4078
|
-
},
|
|
4079
|
-
return onLongPress(
|
|
4087
|
+
let r = e, i = n, a = useModel(e, "modelValue");
|
|
4088
|
+
watch(a, (e) => i("change", e));
|
|
4089
|
+
let s = () => {
|
|
4090
|
+
i("click", !a.value), r.disChanged || (a.value = !a.value);
|
|
4091
|
+
}, u = useTemplateRef("htmlRefHook");
|
|
4092
|
+
return onLongPress(u, () => {
|
|
4080
4093
|
i("longClick");
|
|
4081
4094
|
}, { modifiers: { prevent: !0 } }), (n, r) => {
|
|
4082
4095
|
let i = NIcon;
|
|
4083
4096
|
return openBlock(), createElementBlock("div", {
|
|
4084
4097
|
class: normalizeClass(["flex items-center justify-center **:!transition-colors", [e.rowMode || "flex-col", e.padding && "px-4"]]),
|
|
4085
|
-
onClick: withModifiers(
|
|
4098
|
+
onClick: withModifiers(s, ["stop"]),
|
|
4086
4099
|
ref_key: "htmlRefHook",
|
|
4087
|
-
ref:
|
|
4100
|
+
ref: u
|
|
4088
4101
|
}, [createVNode(i, {
|
|
4089
4102
|
size: e.size,
|
|
4090
|
-
color:
|
|
4103
|
+
color: a.value ? "var(--p-color)" : "var(--van-gray-7)"
|
|
4091
4104
|
}, {
|
|
4092
4105
|
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(e.icon)))]),
|
|
4093
4106
|
_: 1
|
|
@@ -4135,7 +4148,7 @@ function x(e) {
|
|
|
4135
4148
|
function q(...e) {
|
|
4136
4149
|
let n = [], r = () => {
|
|
4137
4150
|
n.forEach((e) => e()), n.length = 0;
|
|
4138
|
-
},
|
|
4151
|
+
}, i = (e, n, r, i) => (e.addEventListener(n, r, i), () => e.removeEventListener(n, r, i)), o = computed(() => {
|
|
4139
4152
|
let n = R(toValue(e[0])).filter((e) => e != null);
|
|
4140
4153
|
return n.every((e) => typeof e != "string") ? n : void 0;
|
|
4141
4154
|
}), s = ge(() => [
|
|
@@ -4143,10 +4156,10 @@ function q(...e) {
|
|
|
4143
4156
|
R(toValue(o.value ? e[1] : e[0])),
|
|
4144
4157
|
R(unref(o.value ? e[2] : e[1])),
|
|
4145
4158
|
toValue(o.value ? e[3] : e[2])
|
|
4146
|
-
], ([e,
|
|
4147
|
-
if (r(), !(e != null && e.length) || !(
|
|
4159
|
+
], ([e, a, o, s]) => {
|
|
4160
|
+
if (r(), !(e != null && e.length) || !(a != null && a.length) || !(o != null && o.length)) return;
|
|
4148
4161
|
let c = he(s) ? T({}, s) : s;
|
|
4149
|
-
n.push(...e.flatMap((e) =>
|
|
4162
|
+
n.push(...e.flatMap((e) => a.flatMap((n) => o.map((r) => i(e, n, r, c)))));
|
|
4150
4163
|
}, { flush: "post" });
|
|
4151
4164
|
return F(r), () => {
|
|
4152
4165
|
s(), r();
|
|
@@ -4165,7 +4178,7 @@ function X(e) {
|
|
|
4165
4178
|
return computed(() => (n.value, !!e()));
|
|
4166
4179
|
}
|
|
4167
4180
|
function we(e, n, r = {}) {
|
|
4168
|
-
let
|
|
4181
|
+
let i = r, { window: o = $ } = i, s = L(i, ["window"]), c, l = /* @__PURE__ */ X(() => o && "MutationObserver" in o), u = () => {
|
|
4169
4182
|
c &&= (c.disconnect(), void 0);
|
|
4170
4183
|
}, d = computed(() => {
|
|
4171
4184
|
let n = R(toValue(e)).map(x).filter(pe);
|
|
@@ -4185,7 +4198,7 @@ function we(e, n, r = {}) {
|
|
|
4185
4198
|
};
|
|
4186
4199
|
}
|
|
4187
4200
|
function Y(e, n, r = {}) {
|
|
4188
|
-
let
|
|
4201
|
+
let i = r, { window: o = $ } = i, s = L(i, ["window"]), c, l = /* @__PURE__ */ X(() => o && "ResizeObserver" in o), u = () => {
|
|
4189
4202
|
c &&= (c.disconnect(), void 0);
|
|
4190
4203
|
}, d = watch(computed(() => {
|
|
4191
4204
|
let n = toValue(e);
|
|
@@ -4241,9 +4254,9 @@ function ye(e, n = {
|
|
|
4241
4254
|
width: 0,
|
|
4242
4255
|
height: 0
|
|
4243
4256
|
}, r = {}) {
|
|
4244
|
-
let { window:
|
|
4257
|
+
let { window: i = $, box: o = "content-box" } = r, s = computed(() => (x(e)?.namespaceURI)?.includes("svg")), c = shallowRef(n.width), l = shallowRef(n.height), { stop: u } = Y(e, ([n]) => {
|
|
4245
4258
|
let r = o === "border-box" ? n.borderBoxSize : o === "content-box" ? n.contentBoxSize : n.devicePixelContentBoxSize;
|
|
4246
|
-
if (
|
|
4259
|
+
if (i && s.value) {
|
|
4247
4260
|
let n = x(e);
|
|
4248
4261
|
if (n) {
|
|
4249
4262
|
let e = n.getBoundingClientRect();
|
|
@@ -4296,59 +4309,59 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4296
4309
|
}
|
|
4297
4310
|
},
|
|
4298
4311
|
setup(n, { expose: r }) {
|
|
4299
|
-
let
|
|
4312
|
+
let i = n, o = ref(), { width: s } = ye(o), { top: l } = xe(o);
|
|
4300
4313
|
onMounted(() => {
|
|
4301
|
-
|
|
4314
|
+
s.value === 0 && (s.value = Number.parseInt(window.getComputedStyle(o.value).width));
|
|
4302
4315
|
});
|
|
4303
4316
|
function u(e) {
|
|
4304
4317
|
return Object.prototype.toString.call(e) === "[object Number]";
|
|
4305
4318
|
}
|
|
4306
4319
|
let d = computed(() => {
|
|
4307
|
-
if (!
|
|
4308
|
-
let e =
|
|
4309
|
-
if (e >=
|
|
4310
|
-
let n = Math.floor(e /
|
|
4311
|
-
return
|
|
4320
|
+
if (!s.value) return 0;
|
|
4321
|
+
let e = s.value;
|
|
4322
|
+
if (e >= i.itemMinWidth * 2) {
|
|
4323
|
+
let n = Math.floor(e / i.itemMinWidth);
|
|
4324
|
+
return i.maxColumnCount && n > i.maxColumnCount ? i.maxColumnCount : n;
|
|
4312
4325
|
}
|
|
4313
|
-
return
|
|
4326
|
+
return i.minColumnCount;
|
|
4314
4327
|
}), f = ref(Array(d.value).fill(0)), p = computed(() => {
|
|
4315
|
-
if (!
|
|
4316
|
-
let e = (d.value - 1) *
|
|
4317
|
-
return Math.ceil((
|
|
4328
|
+
if (!s.value || d.value <= 0) return 0;
|
|
4329
|
+
let e = (d.value - 1) * i.gap;
|
|
4330
|
+
return Math.ceil((s.value - e) / d.value);
|
|
4318
4331
|
}), m = shallowRef([]);
|
|
4319
4332
|
r({ withItemSpaces: (e) => {
|
|
4320
4333
|
e(readonly(m).value);
|
|
4321
4334
|
} }), watchEffect(() => {
|
|
4322
|
-
let e =
|
|
4335
|
+
let e = i.items.length;
|
|
4323
4336
|
if (!d.value || !e) {
|
|
4324
4337
|
m.value = [];
|
|
4325
4338
|
return;
|
|
4326
4339
|
}
|
|
4327
|
-
let n = Array(e), r = 0,
|
|
4328
|
-
|
|
4340
|
+
let n = Array(e), r = 0, a = i.enableCache && m.value.length && e > m.value.length;
|
|
4341
|
+
a ? r = m.value.length : f.value = Array(d.value).fill(0);
|
|
4329
4342
|
for (let o = 0; o < e; o++) {
|
|
4330
|
-
if (
|
|
4343
|
+
if (a && o < r) {
|
|
4331
4344
|
n[o] = m.value[o];
|
|
4332
4345
|
continue;
|
|
4333
4346
|
}
|
|
4334
|
-
let e = g(), s =
|
|
4347
|
+
let e = g(), s = i.calcItemHeight(i.items[o], p.value), c = f.value[e], l = (p.value + i.gap) * e, u = {
|
|
4335
4348
|
index: o,
|
|
4336
|
-
item:
|
|
4349
|
+
item: i.items[o],
|
|
4337
4350
|
column: e,
|
|
4338
4351
|
top: c,
|
|
4339
4352
|
left: l,
|
|
4340
4353
|
bottom: c + s,
|
|
4341
4354
|
height: s
|
|
4342
4355
|
};
|
|
4343
|
-
f.value[e] += s +
|
|
4356
|
+
f.value[e] += s + i.gap, n[o] = u;
|
|
4344
4357
|
}
|
|
4345
4358
|
m.value = n;
|
|
4346
4359
|
});
|
|
4347
4360
|
let h = computed(() => {
|
|
4348
4361
|
let e = m.value.length;
|
|
4349
4362
|
if (!e) return [];
|
|
4350
|
-
if (!
|
|
4351
|
-
let n = o.value.parentElement.offsetTop, r = -l.value + n, [
|
|
4363
|
+
if (!i.virtual) return m.value;
|
|
4364
|
+
let n = o.value.parentElement.offsetTop, r = -l.value + n, [a, s] = i.preloadScreenCount, c = o.value.parentElement.clientHeight, u = r - a * c, d = r + (s + 1) * c, f = [];
|
|
4352
4365
|
for (let n = 0; n < e; n++) {
|
|
4353
4366
|
let e = m.value[n], r = e.top, i = e.bottom;
|
|
4354
4367
|
(r >= u && r <= d || i >= u && i <= d || r < u && i > d) && f.push(e);
|
|
@@ -4406,27 +4419,27 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4406
4419
|
"col"
|
|
4407
4420
|
],
|
|
4408
4421
|
setup(e, { expose: n, emit: r }) {
|
|
4409
|
-
let
|
|
4410
|
-
...Stream.isStream(
|
|
4411
|
-
data: l(
|
|
4412
|
-
isDone:
|
|
4413
|
-
isRequesting:
|
|
4414
|
-
isError: !!
|
|
4415
|
-
length: l(
|
|
4416
|
-
isEmpty:
|
|
4417
|
-
source:
|
|
4422
|
+
let i = e, c = r, l = (e) => i.dataProcessor?.(e) ?? e, u = computed(() => isArray(i.col) ? i.col : [i.col, i.col]), f = computed(() => ({
|
|
4423
|
+
...Stream.isStream(i.source) ? {
|
|
4424
|
+
data: l(i.source.data.value),
|
|
4425
|
+
isDone: i.source.isDone.value,
|
|
4426
|
+
isRequesting: i.source.isRequesting.value,
|
|
4427
|
+
isError: !!i.source.error.value,
|
|
4428
|
+
length: l(i.source.data.value).length,
|
|
4429
|
+
isEmpty: i.source.isEmpty.value,
|
|
4430
|
+
source: i.source
|
|
4418
4431
|
} : {
|
|
4419
|
-
data: l(
|
|
4420
|
-
isDone:
|
|
4421
|
-
isRequesting:
|
|
4422
|
-
isError:
|
|
4423
|
-
length: l(
|
|
4424
|
-
isEmpty:
|
|
4425
|
-
source:
|
|
4432
|
+
data: l(i.source.data.data.value ?? []),
|
|
4433
|
+
isDone: i.source.isEnd,
|
|
4434
|
+
isRequesting: i.source.data.isLoading.value,
|
|
4435
|
+
isError: i.source.data.isError.value,
|
|
4436
|
+
length: l(i.source.data.data.value ?? []).length,
|
|
4437
|
+
isEmpty: i.source.data.isEmpty.value,
|
|
4438
|
+
source: i.source.data
|
|
4426
4439
|
},
|
|
4427
|
-
next: () => Stream.isStream(
|
|
4428
|
-
retry: () => Stream.isStream(
|
|
4429
|
-
reset: () => Stream.isStream(
|
|
4440
|
+
next: () => Stream.isStream(i.source) ? i.source.next() : callbackToPromise((e) => c("next", e)),
|
|
4441
|
+
retry: () => Stream.isStream(i.source) ? i.source.retry() : callbackToPromise((e) => c("retry", e)),
|
|
4442
|
+
reset: () => Stream.isStream(i.source) ? i.source.reset() : c("reset")
|
|
4430
4443
|
})), p = shallowRef(!1), m = shallowRef(!1), h = async () => {
|
|
4431
4444
|
f.value.reset(), console.log("reset done"), await f.value.next(), m.value = !1;
|
|
4432
4445
|
}, g = useTemplateRef("content"), v = computed(() => g.value?.cont), { y } = useScroll(v);
|
|
@@ -4437,31 +4450,31 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4437
4450
|
if (!o) return;
|
|
4438
4451
|
let s = o.scrollHeight, c = o.scrollTop, l = o.clientHeight;
|
|
4439
4452
|
s - c - l <= 100 && (n ? i() : a());
|
|
4440
|
-
}, { target: v }), watch(() =>
|
|
4453
|
+
}, { target: v }), watch(() => i.source, () => {
|
|
4441
4454
|
let { isError: e, retry: n, next: r, isEmpty: i } = f.value;
|
|
4442
4455
|
i && (e ? n() : r());
|
|
4443
4456
|
}, {
|
|
4444
4457
|
deep: 1,
|
|
4445
4458
|
immediate: !0
|
|
4446
4459
|
});
|
|
4447
|
-
let b = useTemplateRef("waterfallEl"), S = useTemp().$apply("waterfall", () => ({ top: 0 })), C = S.top++, w = useTemp().$applyRaw(`waterfall:${C}`, () => shallowReactive(/* @__PURE__ */ new Map())),
|
|
4448
|
-
for (let e of
|
|
4460
|
+
let b = useTemplateRef("waterfallEl"), S = useTemp().$apply("waterfall", () => ({ top: 0 })), C = S.top++, w = useTemp().$applyRaw(`waterfall:${C}`, () => shallowReactive(/* @__PURE__ */ new Map())), E = [], k = new MutationObserver(([e]) => {
|
|
4461
|
+
for (let e of E) e();
|
|
4449
4462
|
if (!(e.target instanceof HTMLDivElement) || !f.value.data) return;
|
|
4450
4463
|
let n = [...e.target.children];
|
|
4451
4464
|
for (let e of n) {
|
|
4452
|
-
let n = Number(e.dataset.index), r = f.value.data[n],
|
|
4465
|
+
let n = Number(e.dataset.index), r = f.value.data[n], a = () => {
|
|
4453
4466
|
let n = e.firstElementChild?.getBoundingClientRect();
|
|
4454
|
-
w.set(r, n?.height ??
|
|
4455
|
-
},
|
|
4456
|
-
|
|
4467
|
+
w.set(r, n?.height ?? i.minHeight);
|
|
4468
|
+
}, o = useResizeObserver(e.firstElementChild, a);
|
|
4469
|
+
a(), E.push(() => o.stop());
|
|
4457
4470
|
}
|
|
4458
4471
|
});
|
|
4459
4472
|
watch(b, (e) => {
|
|
4460
|
-
if (!e) return
|
|
4461
|
-
|
|
4473
|
+
if (!e) return k.disconnect();
|
|
4474
|
+
k.observe(e.$el, { childList: !0 });
|
|
4462
4475
|
}), onUnmounted(() => {
|
|
4463
|
-
|
|
4464
|
-
for (let e of
|
|
4476
|
+
k.disconnect();
|
|
4477
|
+
for (let e of E) e();
|
|
4465
4478
|
});
|
|
4466
4479
|
let j = shallowRef(!0);
|
|
4467
4480
|
return n({
|
|
@@ -4471,15 +4484,15 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4471
4484
|
j.value = !1, w.clear(), await nextTick(), j.value = !0;
|
|
4472
4485
|
}
|
|
4473
4486
|
}), (n, r) => {
|
|
4474
|
-
let
|
|
4475
|
-
return j.value ? (openBlock(), createBlock(
|
|
4487
|
+
let a = PullRefresh;
|
|
4488
|
+
return j.value ? (openBlock(), createBlock(a, {
|
|
4476
4489
|
key: 0,
|
|
4477
4490
|
modelValue: m.value,
|
|
4478
|
-
"onUpdate:modelValue": r[
|
|
4479
|
-
class: normalizeClass(["relative h-full",
|
|
4491
|
+
"onUpdate:modelValue": r[1] ||= (e) => m.value = e,
|
|
4492
|
+
class: normalizeClass(["relative h-full", i.class]),
|
|
4480
4493
|
disabled: e.unReloadable || f.value.isRequesting || !!unref(y) && !p.value,
|
|
4481
4494
|
onRefresh: h,
|
|
4482
|
-
onChange: r[
|
|
4495
|
+
onChange: r[2] ||= ({ distance: e }) => p.value = !!e,
|
|
4483
4496
|
style: normalizeStyle(e.style)
|
|
4484
4497
|
}, {
|
|
4485
4498
|
default: withCtx(() => [createVNode(content_default, {
|
|
@@ -4489,7 +4502,7 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4489
4502
|
"class-empty": "!h-full",
|
|
4490
4503
|
"class-error": "!h-full",
|
|
4491
4504
|
class: "h-full overflow-auto w-full",
|
|
4492
|
-
onRetry:
|
|
4505
|
+
onRetry: r[0] ||= (e) => f.value.retry(),
|
|
4493
4506
|
onResetRetry: h,
|
|
4494
4507
|
"hide-loading": p.value && f.value.isRequesting,
|
|
4495
4508
|
ref_key: "content",
|
|
@@ -4504,8 +4517,8 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4504
4517
|
ref: b,
|
|
4505
4518
|
"calc-item-height": (n) => unref(w).get(n) ?? e.minHeight,
|
|
4506
4519
|
class: "waterfall",
|
|
4507
|
-
"min-column-count":
|
|
4508
|
-
"max-column-count":
|
|
4520
|
+
"min-column-count": u.value[0],
|
|
4521
|
+
"max-column-count": u.value[1]
|
|
4509
4522
|
}, {
|
|
4510
4523
|
default: withCtx(({ item: r, index: i }) => [renderSlot(n.$slots, "default", {
|
|
4511
4524
|
item: r,
|
|
@@ -4980,6 +4993,12 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4980
4993
|
super(e), this.name = e.name, this.index = e.index, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta;
|
|
4981
4994
|
}
|
|
4982
4995
|
}, item_exports = /* @__PURE__ */ __export({ Item: () => Item }), Item = class extends Struct {
|
|
4996
|
+
static itemTranslator = shallowReactive(/* @__PURE__ */ new Map());
|
|
4997
|
+
static create(e) {
|
|
4998
|
+
let n = this.itemTranslator.get(ContentPage.toContentTypeString(e.contentType));
|
|
4999
|
+
if (!n) throw Error(`can not found itemTranslator contentType:"${ContentPage.toContentTypeString(e.contentType)}"`);
|
|
5000
|
+
return n(e);
|
|
5001
|
+
}
|
|
4983
5002
|
static authorIcon = shallowReactive(/* @__PURE__ */ new Map());
|
|
4984
5003
|
static getAuthorIcon(e, n) {
|
|
4985
5004
|
return this.authorIcon.get(`${e}:${n}`);
|
|
@@ -5088,11 +5107,15 @@ const createDateString = (e = (0, import_dayjs_min.default)()) => {
|
|
|
5088
5107
|
};
|
|
5089
5108
|
var message_exports = /* @__PURE__ */ __export({
|
|
5090
5109
|
createDialog: () => createDialog,
|
|
5110
|
+
createDownloadMessage: () => createDownloadMessage,
|
|
5091
5111
|
createLoadingMessage: () => createLoadingMessage
|
|
5092
5112
|
});
|
|
5113
|
+
function _isSlot(e) {
|
|
5114
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !isVNode(e);
|
|
5115
|
+
}
|
|
5093
5116
|
const createLoadingMessage = (e = "加载中", n = window.$message) => {
|
|
5094
|
-
let r = computed(() => isRef(e) ? e.value : isFunction(e) ? e() : e),
|
|
5095
|
-
|
|
5117
|
+
let r = computed(() => isRef(e) ? e.value : isFunction(e) ? e() : e), i = n.loading(r.value, { duration: 0 }), o = watch(r, (e) => {
|
|
5118
|
+
i.content = e;
|
|
5096
5119
|
}), s = !1;
|
|
5097
5120
|
async function c(e, n = !0, r, i) {
|
|
5098
5121
|
try {
|
|
@@ -5106,21 +5129,21 @@ const createLoadingMessage = (e = "加载中", n = window.$message) => {
|
|
|
5106
5129
|
let l = {
|
|
5107
5130
|
bind: c,
|
|
5108
5131
|
async success(e = "成功!", n = 500) {
|
|
5109
|
-
o(), !(s || !
|
|
5132
|
+
o(), !(s || !i) && (s = !0, i.type = "success", i.content = e, await delay(n), i.destroy());
|
|
5110
5133
|
},
|
|
5111
5134
|
async fail(e = "失败!", n = 500) {
|
|
5112
|
-
o(), !(s || !
|
|
5135
|
+
o(), !(s || !i) && (s = !0, i.type = "error", i.content = e, await delay(n), i.destroy());
|
|
5113
5136
|
},
|
|
5114
5137
|
async info(e, n = 500) {
|
|
5115
|
-
o(), !(s || !
|
|
5138
|
+
o(), !(s || !i) && (s = !0, i.type = "info", i.content = e, await delay(n), i.destroy());
|
|
5116
5139
|
},
|
|
5117
5140
|
destroy() {
|
|
5118
|
-
o(), !(s || !
|
|
5141
|
+
o(), !(s || !i) && (s = !0, i.destroy());
|
|
5119
5142
|
},
|
|
5120
5143
|
[Symbol.dispose]() {
|
|
5121
5144
|
this.destroy();
|
|
5122
5145
|
},
|
|
5123
|
-
instance:
|
|
5146
|
+
instance: i
|
|
5124
5147
|
};
|
|
5125
5148
|
return l;
|
|
5126
5149
|
}, createDialog = (e) => {
|
|
@@ -5173,6 +5196,128 @@ const createLoadingMessage = (e = "加载中", n = window.$message) => {
|
|
|
5173
5196
|
});
|
|
5174
5197
|
return console.log("[createDialog] after const dialog"), i.ins = m, i;
|
|
5175
5198
|
};
|
|
5199
|
+
var allDownloadMessagesIsMinsize = reactive([]);
|
|
5200
|
+
const createDownloadMessage = async (e, n) => {
|
|
5201
|
+
let o = allDownloadMessagesIsMinsize.length;
|
|
5202
|
+
allDownloadMessagesIsMinsize[o] = !1;
|
|
5203
|
+
let s = reactive([]), c = ref(!1), l = watch(c, (e) => {
|
|
5204
|
+
e ? allDownloadMessagesIsMinsize[o] = !0 : allDownloadMessagesIsMinsize[o] = !1;
|
|
5205
|
+
}, { immediate: !0 }), u = computed(() => allDownloadMessagesIsMinsize.slice(0, o).filter((e) => e).length), f = window.$message.create(e, {
|
|
5206
|
+
render: (e) => {
|
|
5207
|
+
let n;
|
|
5208
|
+
return createVNode(motion.div, {
|
|
5209
|
+
drag: "y",
|
|
5210
|
+
dragConstraints: {
|
|
5211
|
+
top: 0,
|
|
5212
|
+
right: 0,
|
|
5213
|
+
bottom: 0,
|
|
5214
|
+
left: 0
|
|
5215
|
+
},
|
|
5216
|
+
dragTransition: {
|
|
5217
|
+
bounceStiffness: 500,
|
|
5218
|
+
bounceDamping: 15
|
|
5219
|
+
},
|
|
5220
|
+
variants: {
|
|
5221
|
+
minsize: {
|
|
5222
|
+
borderRadius: "100%",
|
|
5223
|
+
width: "30px",
|
|
5224
|
+
height: "30px",
|
|
5225
|
+
paddingInline: "2px",
|
|
5226
|
+
paddingBlock: "2px",
|
|
5227
|
+
position: "fixed",
|
|
5228
|
+
left: `${u.value * 40 + 8}px`,
|
|
5229
|
+
top: "calc(var(--safe-area-inset-top) + 4px)"
|
|
5230
|
+
},
|
|
5231
|
+
maxsize: {
|
|
5232
|
+
borderRadius: "8px",
|
|
5233
|
+
width: "90vw",
|
|
5234
|
+
paddingInline: "8px",
|
|
5235
|
+
paddingBlock: "12px",
|
|
5236
|
+
height: "fit-content"
|
|
5237
|
+
}
|
|
5238
|
+
},
|
|
5239
|
+
onDragEnd: (e, { offset: n }) => n.y < -30 && (c.value = !0),
|
|
5240
|
+
animate: c.value ? "minsize" : "maxsize",
|
|
5241
|
+
class: "bg-(--n-color) overflow-hidden",
|
|
5242
|
+
style: { boxShadow: "var(--n-box-shadow)" }
|
|
5243
|
+
}, { default: () => [createVNode(Transition, { name: "van-fade" }, { default: () => [c.value ? createVNode("div", {
|
|
5244
|
+
class: "size-full relative",
|
|
5245
|
+
onClick: () => c.value = !1
|
|
5246
|
+
}, [createVNode(Loading, {
|
|
5247
|
+
class: "absolute top-0 left-0 size-full",
|
|
5248
|
+
color: "var(--p-color)"
|
|
5249
|
+
}, null), createVNode(NIcon, {
|
|
5250
|
+
class: "!absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ",
|
|
5251
|
+
size: "18px",
|
|
5252
|
+
color: "var(--p-color)"
|
|
5253
|
+
}, { default: () => [s.some((e) => e.state == "error") ? createVNode(Icon, { name: "cross" }, null) : createVNode(FileDownloadRound_default, null, null)] })]) : createVNode("div", { class: "w-full relative" }, [
|
|
5254
|
+
createVNode("div", { class: "font-semibold text-base" }, [e.content]),
|
|
5255
|
+
createVNode(TransitionGroup, {
|
|
5256
|
+
name: "list",
|
|
5257
|
+
tag: "ul",
|
|
5258
|
+
class: "!w-full h-fit !ml-1"
|
|
5259
|
+
}, _isSlot(n = s.map((e, n) => {
|
|
5260
|
+
let i;
|
|
5261
|
+
return createVNode("div", {
|
|
5262
|
+
class: "w=full py-1 van-hairline--bottom",
|
|
5263
|
+
key: n
|
|
5264
|
+
}, [
|
|
5265
|
+
createVNode("span", { class: "font-semibold text-sm" }, [e.title]),
|
|
5266
|
+
createVNode("div", { class: "w-full h-fit relative" }, [createVNode(NProgress, {
|
|
5267
|
+
percentage: isNumber(e.progress) ? e.progress : 100,
|
|
5268
|
+
indicatorPlacement: "inside",
|
|
5269
|
+
processing: isUndefined(e.state),
|
|
5270
|
+
type: "line",
|
|
5271
|
+
showIndicator: !1,
|
|
5272
|
+
"show-indicator": !1,
|
|
5273
|
+
class: ["**:in-[.n-progress-graph-line-fill]:!hidden transition-all", e.state == "error" && e.retry ? "!w-[80%]" : "!w-[95%]"],
|
|
5274
|
+
height: 7,
|
|
5275
|
+
status: e.state
|
|
5276
|
+
}, null), createVNode(Transition, { name: "van-slide-right" }, _isSlot(i = withDirectives(createVNode(NButton, {
|
|
5277
|
+
tertiary: !0,
|
|
5278
|
+
circle: !0,
|
|
5279
|
+
onClick: e.retry,
|
|
5280
|
+
class: "!absolute right-[4%] w-[18%] top-1/2 -translate-y-1/2"
|
|
5281
|
+
}, { icon: () => createVNode(NIcon, null, { default: () => [createVNode(ReloadOutlined_default, null, null)] }) }), [[vShow, e.state == "error" && e.retry]])) ? i : { default: () => [i] })]),
|
|
5282
|
+
createVNode("div", { class: "text-xs text-(--van-text-color-2) !h-[1rem]" }, [e.state == "error" && `${e.error.name}: ${e.error.message}` || e.description || "..."])
|
|
5283
|
+
]);
|
|
5284
|
+
})) ? n : { default: () => [n] }),
|
|
5285
|
+
createVNode("div", { class: "rounded-lg w-10 bg-(--nui-divider-color) h-1 absolute -bottom-2 left-1/2 -translate-x-1/2" }, null)
|
|
5286
|
+
])] })] });
|
|
5287
|
+
},
|
|
5288
|
+
duration: 0
|
|
5289
|
+
}), p = (e, n, r) => {
|
|
5290
|
+
let i = Promise.withResolvers(), a = ref(), o = reactive({
|
|
5291
|
+
description: "",
|
|
5292
|
+
retryable: !1,
|
|
5293
|
+
...n
|
|
5294
|
+
}), c = /* @__PURE__ */ Error(), l = s.length, u = watch([o, a], ([, n]) => {
|
|
5295
|
+
s[l] = {
|
|
5296
|
+
title: e,
|
|
5297
|
+
state: n,
|
|
5298
|
+
error: c,
|
|
5299
|
+
retry: o.retryable ? d : void 0,
|
|
5300
|
+
...o
|
|
5301
|
+
};
|
|
5302
|
+
}, { immediate: !0 }), d = async () => {
|
|
5303
|
+
for (let e in a.value = void 0, o.description = "", o.retryable = !1, n) Object.hasOwn(n, e) && (o[e] = n[e]);
|
|
5304
|
+
try {
|
|
5305
|
+
let e = await r(o);
|
|
5306
|
+
a.value = "success", await nextTick(), u.stop(), i.resolve(e);
|
|
5307
|
+
} catch (e) {
|
|
5308
|
+
c = isError(e) ? e : Error(toString(e)), a.value = "error", await nextTick(), o.retryable || (u.stop(), i.reject(e));
|
|
5309
|
+
}
|
|
5310
|
+
};
|
|
5311
|
+
return d(), i.promise.finally(() => {}), i.promise;
|
|
5312
|
+
}, m = n({
|
|
5313
|
+
createProgress: (e, n) => p(e, { progress: 0 }, n),
|
|
5314
|
+
createLoading: (e, n) => p(e, {}, n)
|
|
5315
|
+
});
|
|
5316
|
+
await until(() => s.every((e) => !isUndefined(e.state))).toBeTruthy(), c.value = !1, await nextTick(), l.stop(), await until(c).toBeTruthy(), f.destroy(), allDownloadMessagesIsMinsize[o] = void 0;
|
|
5317
|
+
let h = s.find((e) => e.state == "error");
|
|
5318
|
+
if (console.log("[maybeError]", h, s), h) throw h.error;
|
|
5319
|
+
return await m;
|
|
5320
|
+
};
|
|
5176
5321
|
var ConfigPointer = class {
|
|
5177
5322
|
constructor(e, n) {
|
|
5178
5323
|
this.pluginName = e, this.config = n, this.key = Symbol.for(`config:${e}`);
|
|
@@ -5220,12 +5365,12 @@ const appConfig = new ConfigPointer("core", {
|
|
|
5220
5365
|
let r = n.get(e.key);
|
|
5221
5366
|
if (!r) throw Error(`not found config by plugin "${e.pluginName}"`);
|
|
5222
5367
|
return r.value;
|
|
5223
|
-
}, "load"),
|
|
5224
|
-
if (!s(appConfig)) return
|
|
5368
|
+
}, "load"), i = usePreferredDark(), o = computed(() => {
|
|
5369
|
+
if (!s(appConfig)) return i.value;
|
|
5225
5370
|
switch (r(appConfig).value.darkMode) {
|
|
5226
5371
|
case "light": return !1;
|
|
5227
5372
|
case "dark": return !0;
|
|
5228
|
-
case "system": return
|
|
5373
|
+
case "system": return i.value;
|
|
5229
5374
|
default: return !1;
|
|
5230
5375
|
}
|
|
5231
5376
|
}), s = e.action((e) => n.has(e.key), "isExistConfig");
|
|
@@ -5247,12 +5392,7 @@ const appConfig = new ConfigPointer("core", {
|
|
|
5247
5392
|
else var n = e;
|
|
5248
5393
|
console.log("[definePlugin] new plugin defining...", n);
|
|
5249
5394
|
let { name: r, content: i, image: a, search: o, user: s, subscribe: c } = n;
|
|
5250
|
-
if (i) {
|
|
5251
|
-
for (let [e, n] of Object.entries(i.layout ?? {})) ContentPage.setViewLayout(e, n);
|
|
5252
|
-
for (let [e, n] of Object.entries(i.itemCard ?? {})) ContentPage.setItemCard(e, n);
|
|
5253
|
-
for (let [e, n] of Object.entries(i.contentPage ?? {})) ContentPage.setContentPage(e, n);
|
|
5254
|
-
for (let [e, n] of Object.entries(i.commentRow ?? {})) Comment.setCommentRow(e, n);
|
|
5255
|
-
}
|
|
5395
|
+
if (i) for (let [e, { commentRow: n, contentPage: r, itemCard: a, layout: o, itemTranslator: s }] of Object.entries(i)) o && ContentPage.setViewLayout(e, o), a && ContentPage.setItemCard(e, a), r && ContentPage.setContentPage(e, r), n && Comment.setCommentRow(e, n), s && Item.itemTranslator.set(e, s);
|
|
5256
5396
|
if (a) {
|
|
5257
5397
|
if (a.forks) for (let [e, n] of Object.entries(a.forks)) Image$1.setFork(r, e, n);
|
|
5258
5398
|
if (a.process) for (let [e, n] of Object.entries(a.process)) Image$1.setProcess(r, e, n);
|
|
@@ -5289,7 +5429,7 @@ const appConfig = new ConfigPointer("core", {
|
|
|
5289
5429
|
};
|
|
5290
5430
|
let Utils;
|
|
5291
5431
|
(function(e) {
|
|
5292
|
-
e.data = data_exports, e.
|
|
5432
|
+
e.data = data_exports, e.eventBus = eventBus_exports, e.image = image_exports, e.layout = layout_exports, e.request = request_exports, e.translate = translate_exports, e.message = message_exports;
|
|
5293
5433
|
})(Utils ||= {});
|
|
5294
5434
|
const Store = {
|
|
5295
5435
|
useTemp,
|