@done-coding/admin-core 0.3.0 → 0.4.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/es/bridge/index.mjs +87 -47
- package/es/components/app-layout/AppBody.vue.mjs +7 -0
- package/es/components/app-layout/AppBody.vue2.mjs +89 -0
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +7 -0
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +58 -0
- package/es/components/app-layout/AppFooter.vue.mjs +7 -0
- package/es/components/app-layout/AppFooter.vue2.mjs +17 -0
- package/es/components/app-layout/AppHeader.vue.mjs +7 -0
- package/es/components/app-layout/AppHeader.vue2.mjs +99 -0
- package/es/components/app-layout/AppLayout.vue.mjs +7 -0
- package/es/components/app-layout/AppLayout.vue2.mjs +130 -0
- package/es/components/app-layout/AppPage.vue.mjs +7 -0
- package/es/components/app-layout/AppPage.vue2.mjs +39 -0
- package/es/components/app-layout/AppSidebar.vue.mjs +7 -0
- package/es/components/app-layout/AppSidebar.vue2.mjs +97 -0
- package/es/components/app-layout/index.mjs +32 -0
- package/es/components/display/ActionBtnGroup.vue.mjs +61 -0
- package/es/components/display/ActionBtnGroup.vue2.mjs +4 -0
- package/es/components/display/HeightProvider.vue.mjs +26 -26
- package/es/components/display/TabsHeader.vue.mjs +7 -0
- package/es/components/display/TabsHeader.vue2.mjs +76 -0
- package/es/components/display/TabsMain.vue.mjs +100 -5
- package/es/components/display/TabsMain.vue2.mjs +2 -95
- package/es/components/display/TabsNaturalFlow.vue.mjs +17 -0
- package/es/components/display/TabsNaturalFlow.vue2.mjs +4 -0
- package/es/components/display/TabsRefineFlow.vue.mjs +62 -0
- package/es/components/display/TabsRefineFlow.vue2.mjs +4 -0
- package/es/components/display/index.mjs +10 -8
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +107 -63
- package/es/components/form/form-search-utils.mjs +25 -0
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +82 -76
- package/es/components/misc/ActionBtn.vue.mjs +84 -65
- package/es/components/misc/ActionConfirm.vue.mjs +1 -1
- package/es/components/misc/ActionConfirm.vue2.mjs +77 -71
- package/es/components/misc/SelectModule.vue.mjs +55 -0
- package/es/components/misc/SelectModule.vue2.mjs +4 -0
- package/es/components/modal/ConfirmModal.vue.mjs +1 -1
- package/es/components/modal/ConfirmModal.vue2.mjs +13 -12
- package/es/components/modal/modal-shelf-hierarchy.mjs +4 -6
- package/es/components/table/TableMain.vue.mjs +3 -3
- package/es/components/table/TableMain.vue2.mjs +103 -102
- package/es/components/table/ToolbarButtons.vue.mjs +10 -40
- package/es/hooks/use-breakpoint.mjs +40 -0
- package/es/hooks/use-channel-viewport-height.mjs +18 -0
- package/es/index.mjs +165 -128
- package/es/inject/key.mjs +18 -8
- package/es/router/guard/index.mjs +31 -0
- package/es/router/guard/login.mjs +4 -0
- package/es/router/guard/permission.mjs +4 -0
- package/es/store/app.mjs +103 -0
- package/es/store/router-permission.mjs +65 -0
- package/es/store/user.mjs +52 -52
- package/es/style.css +1 -1
- package/package.json +3 -2
- package/types/bridge/index.d.ts +193 -89
- package/types/components/app-layout/AppBody.vue.d.ts +45 -0
- package/types/components/app-layout/AppBreadcrumb.vue.d.ts +25 -0
- package/types/components/app-layout/AppFooter.vue.d.ts +2 -0
- package/types/components/app-layout/AppHeader.vue.d.ts +55 -0
- package/types/components/app-layout/AppLayout.vue.d.ts +76 -0
- package/types/components/app-layout/AppPage.vue.d.ts +54 -0
- package/types/components/app-layout/AppSidebar.vue.d.ts +51 -0
- package/types/components/app-layout/index.d.ts +27 -0
- package/types/components/app-layout/types.d.ts +43 -0
- package/types/components/display/ActionBtnGroup.vue.d.ts +16 -0
- package/types/components/display/HeightProvider.vue.d.ts +10 -6
- package/types/components/display/TabsHeader.vue.d.ts +42 -0
- package/types/components/display/TabsMain.vue.d.ts +49 -7
- package/types/components/display/TabsNaturalFlow.vue.d.ts +16 -0
- package/types/components/display/TabsRefineFlow.vue.d.ts +53 -0
- package/types/components/display/index.d.ts +16 -13
- package/types/components/display/types.d.ts +85 -29
- package/types/components/form/form-search-utils.d.ts +24 -0
- package/types/components/form/types.d.ts +7 -1
- package/types/components/list-page/types.d.ts +1 -1
- package/types/components/misc/ActionBtn.vue.d.ts +17 -23
- package/types/components/misc/ActionConfirm.vue.d.ts +56 -27
- package/types/components/misc/SelectModule.vue.d.ts +2 -0
- package/types/components/misc/index.d.ts +11 -1
- package/types/components/misc/types.d.ts +35 -26
- package/types/components/modal/ConfirmModal.vue.d.ts +17 -0
- package/types/components/modal/modal-shelf-hierarchy.d.ts +1 -1
- package/types/components/table/types.d.ts +14 -12
- package/types/helpers/index.d.ts +10 -3
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/use-breakpoint.d.ts +4 -0
- package/types/hooks/use-channel-viewport-height.d.ts +28 -0
- package/types/index.d.ts +4 -1
- package/types/inject/key.d.ts +35 -10
- package/types/router/guard/index.d.ts +21 -0
- package/types/router/guard/login.d.ts +5 -0
- package/types/router/guard/permission.d.ts +5 -0
- package/types/router/guard/types.d.ts +15 -0
- package/types/router/index.d.ts +1 -0
- package/types/store/app.d.ts +149 -0
- package/types/store/index.d.ts +2 -0
- package/types/store/router-permission.d.ts +80 -0
- package/types/store/user.d.ts +11 -9
- /package/es/{helpers → bridge}/route.mjs +0 -0
- /package/es/{helpers → bridge}/state.mjs +0 -0
- /package/es/{helpers → bridge}/storage.mjs +0 -0
- /package/types/{helpers → bridge}/route.d.ts +0 -0
- /package/types/{helpers → bridge}/state.d.ts +0 -0
- /package/types/{helpers → bridge}/storage.d.ts +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ElTooltip as T, ElIcon as H } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/tooltip/style/css";
|
|
4
|
+
import "element-plus/es/components/icon/style/css";
|
|
5
|
+
import { defineComponent as P, useCssVars as w, unref as o, inject as A, computed as e, ref as b, toRefs as F, openBlock as f, createElementBlock as I, normalizeStyle as g, createVNode as a, withCtx as p, renderSlot as v, createElementVNode as h, createBlock as L, createCommentVNode as V } from "vue";
|
|
6
|
+
import N from "../menu/MenuTree.vue.mjs";
|
|
7
|
+
import y from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import { ArrowRightBold as R } from "@element-plus/icons-vue";
|
|
9
|
+
import { APP_LAYOUT_APP_STORE_KEY as M } from "../../inject/key.mjs";
|
|
10
|
+
const O = { class: "app-sidebar-shim" }, J = /* @__PURE__ */ P({
|
|
11
|
+
__name: "AppSidebar",
|
|
12
|
+
props: {
|
|
13
|
+
show: { type: Boolean },
|
|
14
|
+
aboveHeader: { type: Boolean, default: !1 },
|
|
15
|
+
menus: {},
|
|
16
|
+
menuFlatList: {}
|
|
17
|
+
},
|
|
18
|
+
setup(s) {
|
|
19
|
+
w((c) => ({
|
|
20
|
+
ce9ef212: o(E),
|
|
21
|
+
v309db2c2: o(x),
|
|
22
|
+
v2189b8a1: o(_),
|
|
23
|
+
v65908f82: o(l).bodyColor,
|
|
24
|
+
v42a24063: o(l).primaryColor
|
|
25
|
+
}));
|
|
26
|
+
const C = s, r = A(M), m = e(() => r.sidebarStyle), d = b(0), u = b(0), S = e(() => parseFloat(m.value.paddingTop) || 0), x = e(
|
|
27
|
+
() => `${Math.max(S.value, d.value)}px`
|
|
28
|
+
), _ = e(() => `${u.value}px`), E = e(() => C.aboveHeader ? 2 : 0), n = e(() => r.sidebarIsCollapse), $ = e(() => ({
|
|
29
|
+
transform: `rotate(${n.value ? 0 : 180}deg)`
|
|
30
|
+
})), { theme: l } = F(r);
|
|
31
|
+
return (c, t) => {
|
|
32
|
+
const k = H, B = T;
|
|
33
|
+
return f(), I("div", {
|
|
34
|
+
class: "app-sidebar",
|
|
35
|
+
style: g(o(m))
|
|
36
|
+
}, [
|
|
37
|
+
a(o(y), {
|
|
38
|
+
class: "app-sidebar-top",
|
|
39
|
+
onHeightChange: t[0] || (t[0] = (i) => d.value = i)
|
|
40
|
+
}, {
|
|
41
|
+
default: p(() => [
|
|
42
|
+
v(c.$slots, "top", {}, void 0, !0)
|
|
43
|
+
]),
|
|
44
|
+
_: 3
|
|
45
|
+
}),
|
|
46
|
+
h("div", O, [
|
|
47
|
+
a(o(N), {
|
|
48
|
+
collapse: o(n),
|
|
49
|
+
menus: s.menus,
|
|
50
|
+
style: { height: "100%" },
|
|
51
|
+
"background-color": o(l).bodyColor,
|
|
52
|
+
"text-color": o(l).baseColor,
|
|
53
|
+
"active-text-color": o(l).primaryColor,
|
|
54
|
+
menuFlatList: s.menuFlatList,
|
|
55
|
+
routerMode: ""
|
|
56
|
+
}, null, 8, ["collapse", "menus", "background-color", "text-color", "active-text-color", "menuFlatList"])
|
|
57
|
+
]),
|
|
58
|
+
a(o(y), {
|
|
59
|
+
class: "app-sidebar-bottom",
|
|
60
|
+
onHeightChange: t[1] || (t[1] = (i) => u.value = i)
|
|
61
|
+
}, {
|
|
62
|
+
default: p(() => [
|
|
63
|
+
v(c.$slots, "bottom", {}, void 0, !0)
|
|
64
|
+
]),
|
|
65
|
+
_: 3
|
|
66
|
+
}),
|
|
67
|
+
s.show ? (f(), L(B, {
|
|
68
|
+
key: 0,
|
|
69
|
+
content: o(n) ? "展开" : "收起",
|
|
70
|
+
placement: "right",
|
|
71
|
+
"show-after": 200
|
|
72
|
+
}, {
|
|
73
|
+
default: p(() => [
|
|
74
|
+
h("div", {
|
|
75
|
+
class: "app-sidebar-toggle",
|
|
76
|
+
onClick: t[2] || (t[2] = (i) => o(r).changeSidebarCollapseStatus(!o(n)))
|
|
77
|
+
}, [
|
|
78
|
+
a(k, null, {
|
|
79
|
+
default: p(() => [
|
|
80
|
+
a(o(R), {
|
|
81
|
+
class: "app-sidebar-toggle-icon",
|
|
82
|
+
style: g(o($))
|
|
83
|
+
}, null, 8, ["style"])
|
|
84
|
+
]),
|
|
85
|
+
_: 1
|
|
86
|
+
})
|
|
87
|
+
])
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["content"])) : V("", !0)
|
|
91
|
+
], 4);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
export {
|
|
96
|
+
J as default
|
|
97
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import t from "./AppLayout.vue.mjs";
|
|
2
|
+
import m from "./AppHeader.vue.mjs";
|
|
3
|
+
import e from "./AppSidebar.vue.mjs";
|
|
4
|
+
import a from "./AppBody.vue.mjs";
|
|
5
|
+
import i from "./AppBreadcrumb.vue.mjs";
|
|
6
|
+
import n from "./AppFooter.vue.mjs";
|
|
7
|
+
import f from "./AppPage.vue.mjs";
|
|
8
|
+
const c = {
|
|
9
|
+
AppLayout: t,
|
|
10
|
+
AppHeader: m,
|
|
11
|
+
AppSidebar: e,
|
|
12
|
+
AppBody: a,
|
|
13
|
+
AppBreadcrumb: i,
|
|
14
|
+
AppFooter: n,
|
|
15
|
+
AppPage: f
|
|
16
|
+
}, B = {
|
|
17
|
+
install(o) {
|
|
18
|
+
Object.entries(c).forEach(([p, r]) => {
|
|
19
|
+
o.component(p, r);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
a as AppBody,
|
|
25
|
+
i as AppBreadcrumb,
|
|
26
|
+
n as AppFooter,
|
|
27
|
+
m as AppHeader,
|
|
28
|
+
t as AppLayout,
|
|
29
|
+
f as AppPage,
|
|
30
|
+
e as AppSidebar,
|
|
31
|
+
B as appLayoutInstall
|
|
32
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { defineComponent as z, toRefs as C, computed as S, openBlock as r, createElementBlock as c, Fragment as s, renderList as h, createBlock as a, resolveDynamicComponent as i, unref as n, mergeProps as m, withCtx as d, createTextVNode as _, toDisplayString as k } from "vue";
|
|
2
|
+
import { ElButton as A } from "element-plus";
|
|
3
|
+
import P from "../misc/ActionBtn.vue.mjs";
|
|
4
|
+
const F = /* @__PURE__ */ z({
|
|
5
|
+
__name: "ActionBtnGroup",
|
|
6
|
+
props: {
|
|
7
|
+
configs: {},
|
|
8
|
+
ctx: {},
|
|
9
|
+
defaultSize: {}
|
|
10
|
+
},
|
|
11
|
+
setup(y) {
|
|
12
|
+
const x = y, { configs: v, ctx: l, defaultSize: u } = C(x), B = P, g = S(
|
|
13
|
+
() => (v.value ?? []).filter(
|
|
14
|
+
(o) => {
|
|
15
|
+
var t;
|
|
16
|
+
return ((t = o.show) == null ? void 0 : t.call(o, l.value)) ?? !0;
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
), f = (o) => {
|
|
20
|
+
const t = o ?? {};
|
|
21
|
+
return u.value === void 0 ? t : { size: u.value, ...t };
|
|
22
|
+
};
|
|
23
|
+
return (o, t) => (r(!0), c(s, null, h(g.value, (e) => {
|
|
24
|
+
var p;
|
|
25
|
+
return r(), c(s, {
|
|
26
|
+
key: e.key
|
|
27
|
+
}, [
|
|
28
|
+
e.actionBtnProps ? (r(), a(i(n(B)), m({
|
|
29
|
+
key: 0,
|
|
30
|
+
ref_for: !0
|
|
31
|
+
}, f(e.actionBtnProps(n(l)))), {
|
|
32
|
+
default: d(() => [
|
|
33
|
+
e.render ? (r(), a(i(e.render), {
|
|
34
|
+
key: 0,
|
|
35
|
+
ctx: n(l)
|
|
36
|
+
}, null, 8, ["ctx"])) : (r(), c(s, { key: 1 }, [
|
|
37
|
+
_(k(e.label), 1)
|
|
38
|
+
], 64))
|
|
39
|
+
]),
|
|
40
|
+
_: 2
|
|
41
|
+
}, 1040)) : (r(), a(n(A), m({
|
|
42
|
+
key: 1,
|
|
43
|
+
ref_for: !0
|
|
44
|
+
}, f((p = e.props) == null ? void 0 : p.call(e, n(l)))), {
|
|
45
|
+
default: d(() => [
|
|
46
|
+
e.render ? (r(), a(i(e.render), {
|
|
47
|
+
key: 0,
|
|
48
|
+
ctx: n(l)
|
|
49
|
+
}, null, 8, ["ctx"])) : (r(), c(s, { key: 1 }, [
|
|
50
|
+
_(k(e.label), 1)
|
|
51
|
+
], 64))
|
|
52
|
+
]),
|
|
53
|
+
_: 2
|
|
54
|
+
}, 1040))
|
|
55
|
+
], 64);
|
|
56
|
+
}), 128));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
export {
|
|
60
|
+
F as default
|
|
61
|
+
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const S = /* @__PURE__ */ f({
|
|
1
|
+
import { defineComponent as p, ref as u, computed as a, watch as d, openBlock as i, createElementBlock as g, Fragment as f, createBlock as H, withCtx as v, renderSlot as n, createCommentVNode as w, normalizeProps as C, guardReactiveProps as _, unref as k } from "vue";
|
|
2
|
+
import P from "./WatchSize.vue.mjs";
|
|
3
|
+
const S = /* @__PURE__ */ p({
|
|
5
4
|
__name: "HeightProvider",
|
|
6
5
|
props: {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
viewportHeight: {},
|
|
7
|
+
minHeight: { default: 0 }
|
|
9
8
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
emits: ["childViewportHeightChange"],
|
|
10
|
+
setup(s, { emit: l }) {
|
|
11
|
+
const t = s, h = l, o = u(0), r = a(
|
|
12
|
+
() => Math.max(t.viewportHeight - o.value, t.minHeight)
|
|
13
|
+
), m = (e) => {
|
|
14
|
+
o.value = e;
|
|
15
|
+
}, c = a(
|
|
16
|
+
() => ({
|
|
17
|
+
viewportHeight: r.value
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
return d(r, (e) => h("childViewportHeightChange", e), {
|
|
21
|
+
immediate: !0
|
|
22
|
+
}), (e, $) => (i(), g(f, null, [
|
|
23
|
+
e.$slots.header ? (i(), H(P, {
|
|
19
24
|
key: 0,
|
|
20
|
-
|
|
21
|
-
onHeightChange: s[0] || (s[0] = (u) => l.value = u)
|
|
25
|
+
onHeightChange: m
|
|
22
26
|
}, {
|
|
23
|
-
default:
|
|
24
|
-
|
|
27
|
+
default: v(() => [
|
|
28
|
+
n(e.$slots, "header")
|
|
25
29
|
]),
|
|
26
30
|
_: 3
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
c(n.$slots, "default", { height: e(t) })
|
|
32
|
-
], 4)
|
|
33
|
-
], 4));
|
|
31
|
+
})) : w("", !0),
|
|
32
|
+
n(e.$slots, "default", C(_(k(c))))
|
|
33
|
+
], 64));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
export {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent as $, toRefs as z, useModel as K, ref as T, computed as n, onMounted as g, onBeforeUnmount as B, watch as R, openBlock as i, createElementBlock as r, normalizeClass as b, unref as o, Fragment as S, renderList as D, renderSlot as H, createTextVNode as I, toDisplayString as N, normalizeStyle as V, createCommentVNode as F, mergeModels as U, nextTick as W } from "vue";
|
|
2
|
+
const X = ["onClick"], q = /* @__PURE__ */ $({
|
|
3
|
+
__name: "TabsHeader",
|
|
4
|
+
props: /* @__PURE__ */ U({
|
|
5
|
+
tabs: {},
|
|
6
|
+
level: { default: 1 },
|
|
7
|
+
variant: {}
|
|
8
|
+
}, {
|
|
9
|
+
activeKey: {},
|
|
10
|
+
activeKeyModifiers: {}
|
|
11
|
+
}),
|
|
12
|
+
emits: ["update:activeKey"],
|
|
13
|
+
setup(v) {
|
|
14
|
+
const d = v, { tabs: k, level: h, variant: M } = z(d), s = K(v, "activeKey"), l = /* @__PURE__ */ new Map(), m = T(0), f = n(
|
|
15
|
+
() => Math.min(Math.max(Math.floor(h.value), 1), 4)
|
|
16
|
+
), w = n(() => `tabs-main-bar--l${f.value}`), C = {
|
|
17
|
+
1: "card",
|
|
18
|
+
2: "indicator",
|
|
19
|
+
3: "indicator-compact",
|
|
20
|
+
4: "plain"
|
|
21
|
+
}, c = n(
|
|
22
|
+
() => M.value ?? C[f.value]
|
|
23
|
+
), x = n(
|
|
24
|
+
() => `tabs-main-bar--variant-${c.value}`
|
|
25
|
+
), _ = n(
|
|
26
|
+
() => c.value === "indicator" || c.value === "indicator-compact"
|
|
27
|
+
), E = n(() => {
|
|
28
|
+
const [, t] = [m.value, s.value], a = t ? l.get(t) : void 0;
|
|
29
|
+
return a ? {
|
|
30
|
+
width: `${a.offsetWidth}px`,
|
|
31
|
+
transform: `translateX(${a.offsetLeft}px)`
|
|
32
|
+
} : { width: "0px" };
|
|
33
|
+
}), L = (t, a) => {
|
|
34
|
+
a instanceof HTMLElement ? l.set(t, a) : l.delete(t);
|
|
35
|
+
}, u = () => {
|
|
36
|
+
W(() => {
|
|
37
|
+
m.value++;
|
|
38
|
+
});
|
|
39
|
+
}, p = () => u();
|
|
40
|
+
return g(() => {
|
|
41
|
+
u(), window.addEventListener("resize", p);
|
|
42
|
+
}), B(() => {
|
|
43
|
+
window.removeEventListener("resize", p);
|
|
44
|
+
}), R(
|
|
45
|
+
() => d.tabs,
|
|
46
|
+
() => u(),
|
|
47
|
+
{ flush: "post" }
|
|
48
|
+
), (t, a) => (i(), r("div", {
|
|
49
|
+
class: b(["tabs-main-bar", [o(w), o(x)]])
|
|
50
|
+
}, [
|
|
51
|
+
(i(!0), r(S, null, D(o(k), (e) => (i(), r("button", {
|
|
52
|
+
key: e.key,
|
|
53
|
+
ref_for: !0,
|
|
54
|
+
ref: (y) => L(e.key, y),
|
|
55
|
+
type: "button",
|
|
56
|
+
class: b(["tabs-main-bar-item", { "tabs-main-bar-item_active": e.key === s.value }]),
|
|
57
|
+
onClick: (y) => s.value = e.key
|
|
58
|
+
}, [
|
|
59
|
+
H(t.$slots, e.key, {
|
|
60
|
+
tab: e,
|
|
61
|
+
active: e.key === s.value
|
|
62
|
+
}, () => [
|
|
63
|
+
I(N(e.title), 1)
|
|
64
|
+
], !0)
|
|
65
|
+
], 10, X))), 128)),
|
|
66
|
+
o(_) ? (i(), r("div", {
|
|
67
|
+
key: 0,
|
|
68
|
+
class: "tabs-main-bar-indicator",
|
|
69
|
+
style: V(o(E))
|
|
70
|
+
}, null, 4)) : F("", !0)
|
|
71
|
+
], 2));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
q as default
|
|
76
|
+
};
|
|
@@ -1,7 +1,102 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as m, inject as R, toRefs as T, useModel as A, useSlots as N, ref as P, computed as f, h as $, provide as q, watch as x, openBlock as i, createBlock as l, resolveDynamicComponent as E, unref as r, mergeProps as I, withCtx as s, KeepAlive as U, createCommentVNode as j, createVNode as z, createSlots as D, renderList as F, renderSlot as G, normalizeProps as J, guardReactiveProps as O, mergeModels as Q } from "vue";
|
|
2
|
+
import W from "./TabsRefineFlow.vue.mjs";
|
|
3
|
+
import X from "./TabsNaturalFlow.vue.mjs";
|
|
4
|
+
import Y from "./TabsHeader.vue.mjs";
|
|
5
|
+
import { TABS_MAIN_VISUAL_LEVEL as h } from "../../inject/key.mjs";
|
|
6
|
+
const oe = /* @__PURE__ */ m({
|
|
7
|
+
__name: "TabsMain",
|
|
8
|
+
props: /* @__PURE__ */ Q({
|
|
9
|
+
tabs: {},
|
|
10
|
+
viewportHeight: {},
|
|
11
|
+
minHeight: { default: 100 },
|
|
12
|
+
channel: {},
|
|
13
|
+
parentChannel: {},
|
|
14
|
+
padding: {},
|
|
15
|
+
refine: { type: Boolean, default: !0 },
|
|
16
|
+
refineReduceHeight: { default: 0 },
|
|
17
|
+
variant: {}
|
|
18
|
+
}, {
|
|
19
|
+
modelValue: {},
|
|
20
|
+
modelModifiers: {}
|
|
21
|
+
}),
|
|
22
|
+
emits: ["update:modelValue"],
|
|
23
|
+
setup(u) {
|
|
24
|
+
const o = u, p = R(h, 0) + 1, {
|
|
25
|
+
viewportHeight: g,
|
|
26
|
+
minHeight: y,
|
|
27
|
+
channel: H,
|
|
28
|
+
parentChannel: w,
|
|
29
|
+
padding: b,
|
|
30
|
+
refine: v,
|
|
31
|
+
refineReduceHeight: k,
|
|
32
|
+
variant: V,
|
|
33
|
+
tabs: d
|
|
34
|
+
} = T(o), a = A(u, "modelValue"), _ = N(), c = P(void 0), C = f(
|
|
35
|
+
() => v.value ? W : X
|
|
36
|
+
), L = f(
|
|
37
|
+
() => v.value ? {
|
|
38
|
+
viewportHeight: g.value,
|
|
39
|
+
minHeight: y.value,
|
|
40
|
+
channel: H.value,
|
|
41
|
+
parentChannel: w.value,
|
|
42
|
+
padding: b.value,
|
|
43
|
+
refineReduceHeight: k.value
|
|
44
|
+
} : {}
|
|
45
|
+
), K = (e) => o.tabs.find((n) => n.key === e), M = (e) => {
|
|
46
|
+
c.value = e;
|
|
47
|
+
}, S = m({
|
|
48
|
+
name: "TabsMainPane",
|
|
49
|
+
props: {
|
|
50
|
+
paneKey: { type: String, required: !0 },
|
|
51
|
+
viewportHeight: { type: Number, required: !1 }
|
|
52
|
+
},
|
|
53
|
+
setup(e) {
|
|
54
|
+
return () => {
|
|
55
|
+
const n = _[e.paneKey], t = K(e.paneKey);
|
|
56
|
+
return n ? n({
|
|
57
|
+
tab: t,
|
|
58
|
+
active: !0,
|
|
59
|
+
viewportHeight: e.viewportHeight
|
|
60
|
+
}) : t != null && t.component ? $(t.component) : null;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return q(h, p), x(
|
|
65
|
+
[a, () => o.tabs],
|
|
66
|
+
() => {
|
|
67
|
+
!(!!a.value && o.tabs.some((n) => n.key === a.value)) && o.tabs.length && (a.value = o.tabs[0].key);
|
|
68
|
+
},
|
|
69
|
+
{ immediate: !0 }
|
|
70
|
+
), (e, n) => (i(), l(E(r(C)), I(r(L), { onViewportHeightChange: M }), {
|
|
71
|
+
header: s(() => [
|
|
72
|
+
z(Y, {
|
|
73
|
+
"active-key": a.value,
|
|
74
|
+
"onUpdate:activeKey": n[0] || (n[0] = (t) => a.value = t),
|
|
75
|
+
tabs: r(d),
|
|
76
|
+
level: p,
|
|
77
|
+
variant: r(V)
|
|
78
|
+
}, D({ _: 2 }, [
|
|
79
|
+
F(r(d), (t) => ({
|
|
80
|
+
name: t.key,
|
|
81
|
+
fn: s((B) => [
|
|
82
|
+
G(e.$slots, `header-${t.key}`, J(O(B)))
|
|
83
|
+
])
|
|
84
|
+
}))
|
|
85
|
+
]), 1032, ["active-key", "tabs", "variant"])
|
|
86
|
+
]),
|
|
87
|
+
default: s(() => [
|
|
88
|
+
(i(), l(U, null, [
|
|
89
|
+
a.value ? (i(), l(r(S), {
|
|
90
|
+
key: a.value,
|
|
91
|
+
"pane-key": a.value,
|
|
92
|
+
"viewport-height": r(c)
|
|
93
|
+
}, null, 8, ["pane-key", "viewport-height"])) : j("", !0)
|
|
94
|
+
], 1024))
|
|
95
|
+
]),
|
|
96
|
+
_: 3
|
|
97
|
+
}, 16));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
5
100
|
export {
|
|
6
|
-
|
|
101
|
+
oe as default
|
|
7
102
|
};
|
|
@@ -1,97 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import G from "./HeightProvider.vue.mjs";
|
|
3
|
-
import { FULLSCREEN_HEIGHT_CHANNEL as P } from "../../inject/key.mjs";
|
|
4
|
-
const W = { class: "tabs-main-bar" }, X = ["onClick"], Q = /* @__PURE__ */ y({
|
|
5
|
-
__name: "TabsMain",
|
|
6
|
-
props: /* @__PURE__ */ q({
|
|
7
|
-
tabs: {},
|
|
8
|
-
channel: { default: P },
|
|
9
|
-
height: {}
|
|
10
|
-
}, {
|
|
11
|
-
modelValue: {},
|
|
12
|
-
modelModifiers: {}
|
|
13
|
-
}),
|
|
14
|
-
emits: ["update:modelValue"],
|
|
15
|
-
setup(d) {
|
|
16
|
-
const o = d, s = T(d, "modelValue"), E = x(), w = (e) => o.tabs.find((t) => t.key === e), m = (e) => !!e && o.tabs.some((t) => t.key === e), r = v(() => m(s.value) ? s.value : o.tabs.length ? o.tabs[0].key : void 0);
|
|
17
|
-
b(
|
|
18
|
-
[s, () => o.tabs],
|
|
19
|
-
() => {
|
|
20
|
-
!m(s.value) && o.tabs.length && (s.value = o.tabs[0].key);
|
|
21
|
-
},
|
|
22
|
-
{ immediate: !0 }
|
|
23
|
-
);
|
|
24
|
-
const M = y({
|
|
25
|
-
name: "TabsMainPane",
|
|
26
|
-
props: { paneKey: { type: String, required: !0 } },
|
|
27
|
-
setup(e) {
|
|
28
|
-
return () => {
|
|
29
|
-
const t = E[e.paneKey], n = w(e.paneKey);
|
|
30
|
-
return t ? t({ tab: n, active: !0 }) : n != null && n.component ? K(n.component) : null;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}), i = /* @__PURE__ */ new Map(), C = (e, t) => {
|
|
34
|
-
t instanceof HTMLElement ? i.set(e, t) : i.delete(e);
|
|
35
|
-
}, f = S(0), L = v(() => {
|
|
36
|
-
const [, e] = [f.value, r.value], t = e ? i.get(e) : void 0;
|
|
37
|
-
return t ? {
|
|
38
|
-
width: `${t.offsetWidth}px`,
|
|
39
|
-
transform: `translateX(${t.offsetLeft}px)`
|
|
40
|
-
} : { width: "0px" };
|
|
41
|
-
}), c = () => {
|
|
42
|
-
D(() => {
|
|
43
|
-
f.value++;
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
b(
|
|
47
|
-
() => o.tabs,
|
|
48
|
-
() => c(),
|
|
49
|
-
{ flush: "post" }
|
|
50
|
-
);
|
|
51
|
-
const p = () => c();
|
|
52
|
-
return V(() => {
|
|
53
|
-
c(), window.addEventListener("resize", p);
|
|
54
|
-
}), N(() => {
|
|
55
|
-
window.removeEventListener("resize", p);
|
|
56
|
-
}), (e, t) => (l(), u(G, {
|
|
57
|
-
height: o.height,
|
|
58
|
-
channel: o.channel
|
|
59
|
-
}, {
|
|
60
|
-
header: k(() => [
|
|
61
|
-
_("div", W, [
|
|
62
|
-
(l(!0), g(B, null, H(o.tabs, (n) => (l(), g("button", {
|
|
63
|
-
key: n.key,
|
|
64
|
-
ref_for: !0,
|
|
65
|
-
ref: (h) => C(n.key, h),
|
|
66
|
-
type: "button",
|
|
67
|
-
class: F(["tabs-main-bar-item", { "tabs-main-bar-item_active": n.key === a(r) }]),
|
|
68
|
-
onClick: (h) => s.value = n.key
|
|
69
|
-
}, [
|
|
70
|
-
R(e.$slots, `header-${n.key}`, {
|
|
71
|
-
tab: n,
|
|
72
|
-
active: n.key === a(r)
|
|
73
|
-
}, () => [
|
|
74
|
-
A(I(n.title), 1)
|
|
75
|
-
], !0)
|
|
76
|
-
], 10, X))), 128)),
|
|
77
|
-
_("div", {
|
|
78
|
-
class: "tabs-main-bar-indicator",
|
|
79
|
-
style: U(a(L))
|
|
80
|
-
}, null, 4)
|
|
81
|
-
])
|
|
82
|
-
]),
|
|
83
|
-
default: k(() => [
|
|
84
|
-
(l(), u($, null, [
|
|
85
|
-
a(r) ? (l(), u(a(M), {
|
|
86
|
-
key: a(r),
|
|
87
|
-
"pane-key": a(r)
|
|
88
|
-
}, null, 8, ["pane-key"])) : z("", !0)
|
|
89
|
-
], 1024))
|
|
90
|
-
]),
|
|
91
|
-
_: 3
|
|
92
|
-
}, 8, ["height", "channel"]));
|
|
93
|
-
}
|
|
94
|
-
});
|
|
1
|
+
import f from "./TabsMain.vue.mjs";
|
|
95
2
|
export {
|
|
96
|
-
|
|
3
|
+
f as default
|
|
97
4
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent as s, onMounted as a, openBlock as r, createElementBlock as i, renderSlot as t } from "vue";
|
|
2
|
+
const l = { class: "tabs-natural-flow" }, p = /* @__PURE__ */ s({
|
|
3
|
+
__name: "TabsNaturalFlow",
|
|
4
|
+
emits: ["viewportHeightChange"],
|
|
5
|
+
setup(c, { emit: o }) {
|
|
6
|
+
const n = o;
|
|
7
|
+
return a(() => {
|
|
8
|
+
n("viewportHeightChange", void 0);
|
|
9
|
+
}), (e, d) => (r(), i("div", l, [
|
|
10
|
+
t(e.$slots, "header"),
|
|
11
|
+
t(e.$slots, "default")
|
|
12
|
+
]));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
p as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { defineComponent as w, ref as C, computed as n, provide as b, watch as y, openBlock as S, createBlock as V, unref as l, createSlots as $, withCtx as h, createElementVNode as x, normalizeStyle as _, renderSlot as d } from "vue";
|
|
2
|
+
import k from "./HeightProvider.vue.mjs";
|
|
3
|
+
import { useChannelViewportHeight as L } from "../../hooks/use-channel-viewport-height.mjs";
|
|
4
|
+
const M = /* @__PURE__ */ w({
|
|
5
|
+
__name: "TabsRefineFlow",
|
|
6
|
+
props: {
|
|
7
|
+
viewportHeight: {},
|
|
8
|
+
minHeight: {},
|
|
9
|
+
channel: {},
|
|
10
|
+
parentChannel: {},
|
|
11
|
+
padding: { default: () => [10, 10, 0, 10] },
|
|
12
|
+
refineReduceHeight: { default: 0 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["viewportHeightChange"],
|
|
15
|
+
setup(i, { emit: p }) {
|
|
16
|
+
const e = i, c = p, o = e.channel ? Symbol.for(e.channel) : void 0, { viewportHeightFinal: s, parentLevel: a } = L(e), r = C(0), g = n(() => e.padding[0] + e.padding[2]), m = n(() => ({
|
|
17
|
+
padding: e.padding.map((t) => `${t}px`).join(" "),
|
|
18
|
+
boxSizing: "border-box"
|
|
19
|
+
})), v = n(
|
|
20
|
+
() => Math.max(
|
|
21
|
+
s.value - g.value - e.refineReduceHeight,
|
|
22
|
+
0
|
|
23
|
+
)
|
|
24
|
+
), u = n(
|
|
25
|
+
() => a.value > 0 ? a.value : 1
|
|
26
|
+
), f = n(() => u.value + 1), H = (t) => {
|
|
27
|
+
r.value = t, c("viewportHeightChange", t);
|
|
28
|
+
};
|
|
29
|
+
return o && b(o, {
|
|
30
|
+
viewportHeight: n(() => r.value),
|
|
31
|
+
level: f.value
|
|
32
|
+
}), y(
|
|
33
|
+
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
34
|
+
() => e.channel,
|
|
35
|
+
() => console.error("[TabsMain] channel 不支持响应式变更,当前值已忽略。")
|
|
36
|
+
), (t, R) => (S(), V(k, {
|
|
37
|
+
viewportHeight: l(v),
|
|
38
|
+
minHeight: i.minHeight,
|
|
39
|
+
onChildViewportHeightChange: H
|
|
40
|
+
}, $({
|
|
41
|
+
default: h(() => [
|
|
42
|
+
x("div", {
|
|
43
|
+
style: _(l(m))
|
|
44
|
+
}, [
|
|
45
|
+
d(t.$slots, "default")
|
|
46
|
+
], 4)
|
|
47
|
+
]),
|
|
48
|
+
_: 2
|
|
49
|
+
}, [
|
|
50
|
+
t.$slots.header ? {
|
|
51
|
+
name: "header",
|
|
52
|
+
fn: h(() => [
|
|
53
|
+
d(t.$slots, "header")
|
|
54
|
+
]),
|
|
55
|
+
key: "0"
|
|
56
|
+
} : void 0
|
|
57
|
+
]), 1032, ["viewportHeight", "minHeight"]));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
export {
|
|
61
|
+
M as default
|
|
62
|
+
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from "./WatchSize.vue.mjs";
|
|
2
2
|
import a from "./TabsMain.vue.mjs";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import r from "./HeightProvider.vue.mjs";
|
|
4
|
+
import s from "./ActionBtnGroup.vue.mjs";
|
|
5
|
+
const c = { WatchSize: n, TabsMain: a, HeightProvider: r, ActionBtnGroup: s }, _ = {
|
|
5
6
|
install(o) {
|
|
6
|
-
Object.entries(
|
|
7
|
-
o.component(
|
|
7
|
+
Object.entries(c).forEach(([i, t]) => {
|
|
8
|
+
o.component(i, t);
|
|
8
9
|
});
|
|
9
10
|
}
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
s as ActionBtnGroup,
|
|
14
|
+
r as HeightProvider,
|
|
13
15
|
a as TabsMain,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
n as WatchSize,
|
|
17
|
+
_ as displayInstall
|
|
16
18
|
};
|