@done-coding/admin-core 0.10.0 → 0.11.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.
Files changed (46) hide show
  1. package/es/bridge/config-hook.mjs +32 -26
  2. package/es/bridge/index.mjs +129 -83
  3. package/es/bridge/theme/index.mjs +103 -0
  4. package/es/bridge/theme/persist.mjs +14 -0
  5. package/es/bridge/theme/system-dark.mjs +11 -0
  6. package/es/components/app-layout/AppAside.vue.mjs +7 -0
  7. package/es/components/app-layout/AppAside.vue2.mjs +22 -0
  8. package/es/components/app-layout/AppFooter.vue.mjs +2 -2
  9. package/es/components/app-layout/AppHeader.vue.mjs +2 -2
  10. package/es/components/app-layout/AppHeader.vue2.mjs +35 -41
  11. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  12. package/es/components/app-layout/AppLayout.vue2.mjs +106 -88
  13. package/es/components/app-layout/AppShell.vue.mjs +60 -0
  14. package/es/components/app-layout/AppShell.vue2.mjs +4 -0
  15. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  16. package/es/components/app-layout/AppSidebar.vue2.mjs +44 -47
  17. package/es/components/app-layout/AppTheme.vue.mjs +2 -2
  18. package/es/components/app-layout/AppTheme.vue2.mjs +55 -25
  19. package/es/components/app-layout/viewport.mjs +5 -0
  20. package/es/components/form/FormItemNestForm.vue.mjs +1 -1
  21. package/es/components/form/FormItemNestFormList.vue.mjs +1 -1
  22. package/es/components/form/FormSearch.vue.mjs +2 -2
  23. package/es/components/form/FormSearch.vue2.mjs +1 -1
  24. package/es/hooks/use-admin-theme-apply.mjs +16 -15
  25. package/es/hooks/use-admin-viewport-apply.mjs +29 -17
  26. package/es/index.mjs +182 -175
  27. package/es/store/app.mjs +133 -77
  28. package/es/style.css +1 -1
  29. package/package.json +2 -2
  30. package/types/bridge/config-hook.d.ts +10 -2
  31. package/types/bridge/index.d.ts +105 -5
  32. package/types/bridge/theme/index.d.ts +10 -0
  33. package/types/bridge/theme/persist.d.ts +23 -0
  34. package/types/bridge/theme/system-dark.d.ts +14 -0
  35. package/types/bridge/theme/types.d.ts +258 -0
  36. package/types/components/app-layout/AppAside.vue.d.ts +21 -0
  37. package/types/components/app-layout/AppLayout.vue.d.ts +2 -7
  38. package/types/components/app-layout/AppShell.vue.d.ts +27 -0
  39. package/types/components/app-layout/index.d.ts +4 -1
  40. package/types/components/app-layout/types.d.ts +117 -1
  41. package/types/components/app-layout/viewport.d.ts +30 -0
  42. package/types/hooks/use-admin-viewport-apply.d.ts +6 -1
  43. package/types/store/app.d.ts +24 -83
  44. package/types/types/route.d.ts +2 -0
  45. package/es/bridge/theme.mjs +0 -65
  46. package/types/bridge/theme.d.ts +0 -85
@@ -1,9 +1,8 @@
1
- import { defineComponent as S, useCssVars as k, inject as h, computed as r, watch as w, nextTick as A, openBlock as a, createElementBlock as n, normalizeStyle as E, createElementVNode as c, renderSlot as v, normalizeClass as _, Fragment as B, renderList as I, createBlock as f, unref as $, withCtx as b, resolveDynamicComponent as L, createCommentVNode as y, toDisplayString as T, createVNode as V } from "vue";
2
- import { useRouter as x } from "vue-router";
3
- import { ElIcon as Y } from "element-plus";
4
- import D from "./AppTheme.vue.mjs";
5
- import { APP_LAYOUT_APP_STORE_KEY as N, APP_LAYOUT_BRIDGE_KEY as O } from "../../inject/key.mjs";
6
- const R = { class: "app-header-shim" }, q = ["name", "onClick"], z = { class: "app-header-userInfo" }, J = /* @__PURE__ */ S({
1
+ import { defineComponent as k, useCssVars as g, inject as d, computed as a, watch as P, nextTick as E, openBlock as r, createElementBlock as s, normalizeStyle as A, createElementVNode as i, renderSlot as p, normalizeClass as m, Fragment as B, renderList as $, createBlock as h, unref as w, withCtx as I, resolveDynamicComponent as L, createCommentVNode as v, toDisplayString as x } from "vue";
2
+ import { useRouter as T } from "vue-router";
3
+ import { ElIcon as V } from "element-plus";
4
+ import { APP_LAYOUT_APP_STORE_KEY as Y, APP_LAYOUT_BRIDGE_KEY as b } from "../../inject/key.mjs";
5
+ const D = { class: "app-header-shim" }, O = ["name", "onClick"], R = { class: "app-header-right" }, U = /* @__PURE__ */ k({
7
6
  __name: "AppHeader",
8
7
  props: {
9
8
  show: { type: Boolean },
@@ -12,30 +11,26 @@ const R = { class: "app-header-shim" }, q = ["name", "onClick"], z = { class: "a
12
11
  activeModuleMenu: {},
13
12
  menuFlatList: {}
14
13
  },
15
- setup(u) {
16
- k((t) => ({
17
- ae6f6fe0: l.value.left,
18
- v4782742c: l.value.top,
19
- v70971b33: l.value.right,
20
- fcf1a792: p.value.baseColor,
21
- d3910988: p.value.primaryColor
14
+ setup(c) {
15
+ g((t) => ({
16
+ v1eee7516: y.value.primaryColor
22
17
  }));
23
- const s = u, d = h(N), C = h(O), p = r(() => C.themeColors.value), g = r(() => d.headerStyle), l = r(() => d.viewportPadding), M = x(), m = `app-header-module_${Math.random().toString(36).substring(2)}`, P = r(() => s.menus), i = r({
18
+ const n = c, _ = d(Y), f = d(b), y = a(() => f.themeColors.value), C = a(() => _.headerStyle), M = T(), u = `app-header-module_${Math.random().toString(36).substring(2)}`, S = a(() => n.menus), l = a({
24
19
  get() {
25
20
  var t;
26
- return (t = s.activeModuleMenu) == null ? void 0 : t.path;
21
+ return (t = n.activeModuleMenu) == null ? void 0 : t.path;
27
22
  },
28
23
  set(t) {
29
24
  var o, e;
30
- ((e = (o = s.activeMenu) == null ? void 0 : o.parentPathList) == null ? void 0 : e[0]) !== t && M.push(t);
25
+ ((e = (o = n.activeMenu) == null ? void 0 : o.parentPathList) == null ? void 0 : e[0]) !== t && M.push(t);
31
26
  }
32
27
  });
33
- return w(
34
- i,
28
+ return P(
29
+ l,
35
30
  (t) => {
36
- t && A(() => {
31
+ t && E(() => {
37
32
  var o, e;
38
- (e = (o = document.querySelector(`.${m}`)) == null ? void 0 : o.querySelector(`[name="${t}"]`)) == null || e.scrollIntoView({
33
+ (e = (o = document.querySelector(`.${u}`)) == null ? void 0 : o.querySelector(`[name="${t}"]`)) == null || e.scrollIntoView({
39
34
  behavior: "smooth"
40
35
  });
41
36
  });
@@ -43,45 +38,44 @@ const R = { class: "app-header-shim" }, q = ["name", "onClick"], z = { class: "a
43
38
  {
44
39
  immediate: !0
45
40
  }
46
- ), (t, o) => (a(), n("div", {
41
+ ), (t, o) => (r(), s("div", {
47
42
  class: "app-header",
48
- style: E(g.value)
43
+ style: A(C.value)
49
44
  }, [
50
- c("div", R, [
51
- v(t.$slots, "left", {}, void 0, !0),
52
- P.value ? (a(), n("div", {
45
+ i("div", D, [
46
+ p(t.$slots, "left", {}, void 0, !0),
47
+ S.value ? (r(), s("div", {
53
48
  key: 0,
54
- class: _(["app-header-module", m])
49
+ class: m(["app-header-module", u])
55
50
  }, [
56
- (a(!0), n(B, null, I(u.menus, (e) => (a(), n("div", {
51
+ (r(!0), s(B, null, $(c.menus, (e) => (r(), s("div", {
57
52
  key: e.path,
58
53
  name: e.path,
59
- class: _([
54
+ class: m([
60
55
  "app-header-module-item",
61
- i.value === e.path ? "app-header-module-item_active" : ""
56
+ l.value === e.path ? "app-header-module-item_active" : ""
62
57
  ]),
63
- onClick: (F) => i.value = e.path
58
+ onClick: (q) => l.value = e.path
64
59
  }, [
65
- e.menuIcon ? (a(), f($(Y), {
60
+ e.menuIcon ? (r(), h(w(V), {
66
61
  key: 0,
67
62
  class: "app-header-module-item__icon"
68
63
  }, {
69
- default: b(() => [
70
- (a(), f(L(e.menuIcon)))
64
+ default: I(() => [
65
+ (r(), h(L(e.menuIcon)))
71
66
  ]),
72
67
  _: 2
73
- }, 1024)) : y("", !0),
74
- c("span", null, T(e.title), 1)
75
- ], 10, q))), 128))
76
- ])) : y("", !0),
77
- c("div", z, [
78
- V(D),
79
- v(t.$slots, "right", {}, void 0, !0)
68
+ }, 1024)) : v("", !0),
69
+ i("span", null, x(e.title), 1)
70
+ ], 10, O))), 128))
71
+ ])) : v("", !0),
72
+ i("div", R, [
73
+ p(t.$slots, "right", {}, void 0, !0)
80
74
  ])
81
75
  ])
82
76
  ], 4));
83
77
  }
84
78
  });
85
79
  export {
86
- J as default
80
+ U as default
87
81
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppLayout.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7aeee1b9"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-646eac1d"]]);
5
5
  export {
6
- r as default
6
+ m as default
7
7
  };
@@ -1,17 +1,15 @@
1
- import { defineComponent as P, provide as p, computed as n, watch as c, openBlock as F, createElementBlock as T, normalizeClass as R, createVNode as r, unref as a, withCtx as o, renderSlot as u } from "vue";
2
- import { ElWatermark as B } from "element-plus";
3
- import { useRoute as E, useRouter as H } from "vue-router";
4
- import y from "./AppBody.vue.mjs";
5
- import C from "./AppHeader.vue.mjs";
6
- import k from "./AppFooter.vue.mjs";
7
- import O from "./AppSidebar.vue.mjs";
8
- import I from "../modal/ModalShelf.vue.mjs";
9
- import { APP_LAYOUT_BRIDGE_KEY as Y, APP_LAYOUT_APP_STORE_KEY as $, APP_LAYOUT_USER_STORE_KEY as D } from "../../inject/key.mjs";
10
- import { useAdminThemeApply as K } from "../../hooks/use-admin-theme-apply.mjs";
11
- import { useAdminViewportApply as U } from "../../hooks/use-admin-viewport-apply.mjs";
12
- import { flatRouteMetaResolveRaw as V } from "../../utils/router.mjs";
13
- import { useMenusDataDispatch as z } from "../../hooks/menus-dispatch.mjs";
14
- const re = /* @__PURE__ */ P({
1
+ import { defineComponent as F, provide as m, computed as r, markRaw as H, watch as v, openBlock as s, createElementBlock as f, normalizeClass as O, createVNode as p, unref as a, withCtx as n, createBlock as g, resolveDynamicComponent as S, createSlots as I, normalizeStyle as Y, createCommentVNode as x, renderList as G, renderSlot as $ } from "vue";
2
+ import { ElWatermark as D } from "element-plus";
3
+ import { useRoute as N, useRouter as U } from "vue-router";
4
+ import z from "./AppBody.vue.mjs";
5
+ import K from "./AppShell.vue.mjs";
6
+ import V from "../modal/ModalShelf.vue.mjs";
7
+ import { APP_LAYOUT_BRIDGE_KEY as W, APP_LAYOUT_APP_STORE_KEY as j, APP_LAYOUT_USER_STORE_KEY as q } from "../../inject/key.mjs";
8
+ import { useAdminThemeApply as J } from "../../hooks/use-admin-theme-apply.mjs";
9
+ import { useAdminViewportApply as Q } from "../../hooks/use-admin-viewport-apply.mjs";
10
+ import { flatRouteMetaResolveRaw as X } from "../../utils/router.mjs";
11
+ import { useMenusDataDispatch as Z } from "../../hooks/menus-dispatch.mjs";
12
+ const me = /* @__PURE__ */ F({
15
13
  __name: "AppLayout",
16
14
  props: {
17
15
  adminBridge: {},
@@ -20,101 +18,121 @@ const re = /* @__PURE__ */ P({
20
18
  watermarkContent: {},
21
19
  sidebarAboveHeader: { type: Boolean, default: !1 }
22
20
  },
23
- setup(m) {
24
- const t = m, f = {
21
+ setup(u) {
22
+ const e = u, _ = {
25
23
  color: "rgba(0,0,0,0.08)",
26
24
  fontSize: 12
27
25
  };
28
- p(Y, t.adminBridge), p($, t.appStore), p(D, t.userStore), K({
29
- getThemeConfig: () => t.adminBridge.APP_THEME_CONFIG,
30
- getThemeIsDark: () => t.adminBridge.themeIsDark.value
31
- }), U({
32
- getViewportConfig: () => t.adminBridge.APP_LAYOUT_VIEWPORT_CONFIG
26
+ m(W, e.adminBridge), m(j, e.appStore), m(q, e.userStore), J({
27
+ getThemeConfig: () => e.adminBridge.APP_THEME_CONFIG,
28
+ getThemeIsDark: () => e.adminBridge.themeIsDark.value
29
+ }), Q({
30
+ getViewportConfig: () => e.adminBridge.APP_LAYOUT_VIEWPORT_CONFIG,
31
+ getGapConfig: () => e.adminBridge.APP_LAYOUT_GAP_CONFIG
33
32
  });
34
- const d = n(() => t.adminBridge.generateRouteMetaRawTree(
35
- t.adminBridge.getRoutes(),
33
+ const d = r(() => e.adminBridge.generateRouteMetaRawTree(
34
+ e.adminBridge.getRoutes(),
36
35
  {
37
36
  parentPath: "",
38
- filterFn: (e, s, w) => e.checkPermission ? e.menuShow && t.userStore.havePermissionByKey(e.permissionKey) : e.menuShow && (!w || s),
39
- sortFn: (e, s) => e.menuSort - s.menuSort
37
+ filterFn: (t, i, o) => t.checkPermission ? t.menuShow && e.userStore.havePermissionByKey(t.permissionKey) : t.menuShow && (!o || i),
38
+ sortFn: (t, i) => t.menuSort - i.menuSort
40
39
  }
41
- )), i = n(() => V(d.value)), {
42
- sidebarMenus: l,
43
- headerMenus: h,
44
- activeMenu: v,
45
- activeModuleMenu: g,
46
- needRedirectToFirstChildMenu: S
47
- } = z({
40
+ )), l = r(() => X(d.value)), {
41
+ sidebarMenus: c,
42
+ headerMenus: A,
43
+ activeMenu: M,
44
+ activeModuleMenu: w,
45
+ needRedirectToFirstChildMenu: y
46
+ } = Z({
48
47
  getMenus: () => d.value,
49
- getMenuFlatList: () => i.value,
50
- getExtractLevel1ToHeader: () => t.appStore.extractLevel1ToHeader
51
- }), _ = n(() => t.userStore.isLogin), A = n(() => t.appStore.showHeader), M = n(() => t.appStore.showSidebar);
52
- c(
53
- () => l.value.length,
54
- (e) => {
55
- t.appStore.changeSidebarHasMenusStatus(!!e);
48
+ getMenuFlatList: () => l.value,
49
+ // 分流意图**纯归布局**(preset.layout.extractLevel1ToHeader,经 themeLayout 暴露):
50
+ // true 1 级路由模块提取到 header(headerMenus 才有内容)、sidebar 显模块下子菜单;
51
+ // 缺省 false → 经典布局(全菜单在 sidebar、headerMenus 空)。appStore 不再持此意图。
52
+ getExtractLevel1ToHeader: () => e.adminBridge.themeLayout.value.extractLevel1ToHeader
53
+ }), b = H(K), L = r(
54
+ () => e.adminBridge.themeLayout.value.shell ?? b
55
+ ), P = [
56
+ "brand",
57
+ "userEntry",
58
+ "settings",
59
+ "themeSwitcher",
60
+ "aside"
61
+ ], B = r(() => e.userStore.isLogin), h = r(() => e.appStore.showHeader), C = r(() => e.appStore.showSidebar), T = r(() => ({
62
+ position: "fixed",
63
+ top: "0",
64
+ left: "0",
65
+ right: "0",
66
+ height: `calc(${e.appStore.headerStyle.top} + ${e.appStore.headerStyle.height})`,
67
+ background: e.adminBridge.themeColors.value.bodyColor,
68
+ zIndex: 1,
69
+ pointerEvents: "none"
70
+ })), E = r(() => e.appStore.showAside);
71
+ v(
72
+ () => c.value.length,
73
+ (t) => {
74
+ e.appStore.changeSidebarHasMenusStatus(!!t);
56
75
  },
57
76
  {
58
77
  immediate: !0
59
78
  }
60
79
  );
61
- const L = E(), b = H();
62
- return c(
63
- S,
64
- (e) => {
65
- e && (console.log(`${L.path}需要重定向到${e.path}`), b.replace(e.path));
80
+ const R = N(), k = U();
81
+ return v(
82
+ y,
83
+ (t) => {
84
+ t && (console.log(`${R.path}需要重定向到${t.path}`), k.replace(t.path));
66
85
  },
67
86
  {
68
87
  immediate: !0
69
88
  }
70
- ), (e, s) => (F(), T("div", {
71
- class: R(["app-layout", {
72
- "app-layout_noLogin": !_.value
89
+ ), (t, i) => (s(), f("div", {
90
+ class: O(["app-layout", {
91
+ "app-layout_noLogin": !B.value
73
92
  }])
74
93
  }, [
75
- r(a(B), {
76
- content: m.watermarkContent,
77
- font: f,
94
+ p(a(D), {
95
+ content: u.watermarkContent,
96
+ font: _,
78
97
  zIndex: 1e4
79
98
  }, {
80
- default: o(() => [
81
- r(a(I), { level: "app" }, {
82
- default: o(() => [
83
- r(y, { menuFlatList: i.value }, {
84
- footer: o(() => [
85
- r(k)
99
+ default: n(() => [
100
+ p(a(V), { level: "app" }, {
101
+ default: n(() => [
102
+ (s(), g(S(L.value), {
103
+ menus: d.value,
104
+ menuFlatList: l.value,
105
+ sidebarMenus: a(c),
106
+ headerMenus: a(A),
107
+ activeMenu: a(M),
108
+ activeModuleMenu: a(w),
109
+ showHeader: h.value,
110
+ showSidebar: C.value,
111
+ showAside: E.value,
112
+ sidebarAboveHeader: u.sidebarAboveHeader
113
+ }, I({
114
+ default: n(({ Footer: o }) => [
115
+ p(z, { menuFlatList: l.value }, {
116
+ footer: n(() => [
117
+ (s(), g(S(o)))
118
+ ]),
119
+ _: 2
120
+ }, 1032, ["menuFlatList"]),
121
+ h.value ? (s(), f("div", {
122
+ key: 0,
123
+ class: "app-header-gap-cover",
124
+ style: Y(T.value)
125
+ }, null, 4)) : x("", !0)
86
126
  ]),
87
- _: 1
88
- }, 8, ["menuFlatList"]),
89
- r(O, {
90
- show: M.value,
91
- aboveHeader: m.sidebarAboveHeader,
92
- menus: a(l),
93
- menuFlatList: i.value
94
- }, {
95
- top: o(() => [
96
- u(e.$slots, "sidebar-top", {}, void 0, !0)
97
- ]),
98
- bottom: o(() => [
99
- u(e.$slots, "sidebar-bottom", {}, void 0, !0)
100
- ]),
101
- _: 3
102
- }, 8, ["show", "aboveHeader", "menus", "menuFlatList"]),
103
- r(C, {
104
- show: A.value,
105
- menus: a(h),
106
- activeMenu: a(v),
107
- activeModuleMenu: a(g),
108
- menuFlatList: i.value
109
- }, {
110
- left: o(() => [
111
- u(e.$slots, "header-left", {}, void 0, !0)
112
- ]),
113
- right: o(() => [
114
- u(e.$slots, "header-right", {}, void 0, !0)
115
- ]),
116
- _: 3
117
- }, 8, ["show", "menus", "activeMenu", "activeModuleMenu", "menuFlatList"])
127
+ _: 2
128
+ }, [
129
+ G(P, (o) => ({
130
+ name: o,
131
+ fn: n(() => [
132
+ $(t.$slots, o, {}, void 0, !0)
133
+ ])
134
+ }))
135
+ ]), 1032, ["menus", "menuFlatList", "sidebarMenus", "headerMenus", "activeMenu", "activeModuleMenu", "showHeader", "showSidebar", "showAside", "sidebarAboveHeader"]))
118
136
  ]),
119
137
  _: 3
120
138
  })
@@ -125,5 +143,5 @@ const re = /* @__PURE__ */ P({
125
143
  }
126
144
  });
127
145
  export {
128
- re as default
146
+ me as default
129
147
  };
@@ -0,0 +1,60 @@
1
+ import { defineComponent as i, openBlock as u, createElementBlock as r, Fragment as l, renderSlot as o, createVNode as a, withCtx as s } from "vue";
2
+ import d from "./AppSidebar.vue.mjs";
3
+ import m from "./AppAside.vue.mjs";
4
+ import h from "./AppHeader.vue.mjs";
5
+ import M from "./AppFooter.vue.mjs";
6
+ import n from "./AppTheme.vue.mjs";
7
+ const F = /* @__PURE__ */ i({
8
+ __name: "AppShell",
9
+ props: {
10
+ menus: {},
11
+ menuFlatList: {},
12
+ sidebarMenus: {},
13
+ headerMenus: {},
14
+ activeMenu: {},
15
+ activeModuleMenu: {},
16
+ showHeader: { type: Boolean },
17
+ showSidebar: { type: Boolean },
18
+ showAside: { type: Boolean },
19
+ sidebarAboveHeader: { type: Boolean }
20
+ },
21
+ setup(e) {
22
+ return (t, w) => (u(), r(l, null, [
23
+ o(t.$slots, "default", { Footer: M }),
24
+ a(d, {
25
+ show: e.showSidebar,
26
+ aboveHeader: e.sidebarAboveHeader,
27
+ menus: e.sidebarMenus,
28
+ menuFlatList: e.menuFlatList
29
+ }, null, 8, ["show", "aboveHeader", "menus", "menuFlatList"]),
30
+ a(m, { show: e.showAside }, {
31
+ default: s(() => [
32
+ o(t.$slots, "aside")
33
+ ]),
34
+ _: 3
35
+ }, 8, ["show"]),
36
+ a(h, {
37
+ show: e.showHeader,
38
+ menus: e.headerMenus,
39
+ activeMenu: e.activeMenu,
40
+ activeModuleMenu: e.activeModuleMenu,
41
+ menuFlatList: e.menuFlatList
42
+ }, {
43
+ left: s(() => [
44
+ o(t.$slots, "brand")
45
+ ]),
46
+ right: s(() => [
47
+ o(t.$slots, "themeSwitcher", { Default: n }, () => [
48
+ a(n)
49
+ ]),
50
+ o(t.$slots, "userEntry"),
51
+ o(t.$slots, "settings")
52
+ ]),
53
+ _: 3
54
+ }, 8, ["show", "menus", "activeMenu", "activeModuleMenu", "menuFlatList"])
55
+ ], 64));
56
+ }
57
+ });
58
+ export {
59
+ F as default
60
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./AppShell.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppSidebar.vue2.mjs";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-2499f12e"]]);
4
+ const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-1dee248d"]]);
5
5
  export {
6
- e as default
6
+ a as default
7
7
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as w, useCssVars as A, inject as f, computed as e, ref as b, openBlock as g, createElementBlock as T, normalizeStyle as h, createVNode as l, unref as o, withCtx as u, renderSlot as C, createElementVNode as y, createBlock as H, createCommentVNode as L } from "vue";
2
- import F from "../menu/MenuTree.vue.mjs";
3
- import S from "../display/WatchSize.vue.mjs";
4
- import { ElTooltip as I, ElIcon as V } from "element-plus";
5
- import { ArrowRightBold as Y } from "@element-plus/icons-vue";
6
- import { APP_LAYOUT_APP_STORE_KEY as N, APP_LAYOUT_BRIDGE_KEY as O } from "../../inject/key.mjs";
7
- const R = { class: "app-sidebar-shim" }, G = /* @__PURE__ */ w({
1
+ import { defineComponent as k, useCssVars as A, inject as v, computed as e, ref as b, openBlock as f, createElementBlock as T, normalizeStyle as g, createVNode as a, unref as o, withCtx as i, renderSlot as h, createElementVNode as C, createBlock as H, createCommentVNode as L } from "vue";
2
+ import w from "../menu/MenuTree.vue.mjs";
3
+ import y from "../display/WatchSize.vue.mjs";
4
+ import { ElTooltip as F, ElIcon as I } from "element-plus";
5
+ import { ArrowRightBold as V } from "@element-plus/icons-vue";
6
+ import { APP_LAYOUT_APP_STORE_KEY as Y, APP_LAYOUT_BRIDGE_KEY as N } from "../../inject/key.mjs";
7
+ const O = { class: "app-sidebar-shim" }, D = /* @__PURE__ */ k({
8
8
  __name: "AppSidebar",
9
9
  props: {
10
10
  show: { type: Boolean },
@@ -13,71 +13,68 @@ const R = { class: "app-sidebar-shim" }, G = /* @__PURE__ */ w({
13
13
  menuFlatList: {}
14
14
  },
15
15
  setup(s) {
16
- A((c) => ({
17
- f2149ac0: d.value.left,
18
- v6fb5779c: d.value.top,
19
- e0532af8: d.value.bottom,
20
- v36eef49e: E.value,
21
- v7a209d86: _.value,
22
- v0a70f74c: B.value,
23
- v1ffafb76: a.value.bodyColor,
24
- v738d1dcc: a.value.primaryColor
16
+ A((d) => ({
17
+ v368510bd: E.value,
18
+ v7b09fce5: _.value,
19
+ v1098f49b: B.value,
20
+ cc02eed6: l.value.bodyColor,
21
+ v56d0884d: l.value.primaryColor
25
22
  }));
26
- const x = s, r = f(N), p = e(() => r.sidebarStyle), d = e(() => r.viewportPadding), m = b(0), v = b(0), P = e(() => parseFloat(p.value.paddingTop) || 0), _ = e(
27
- () => `${Math.max(P.value, m.value)}px`
28
- ), B = e(() => `${v.value}px`), E = e(() => x.aboveHeader ? 2 : 0), n = e(() => r.sidebarIsCollapse), $ = e(() => ({
29
- transform: `rotate(${n.value ? 0 : 180}deg)`
30
- })), k = f(O), a = e(() => k.themeColors.value);
31
- return (c, t) => (g(), T("div", {
23
+ const S = s, u = v(Y), c = e(() => u.sidebarStyle), p = b(0), m = b(0), x = e(() => parseFloat(String(c.value.paddingTop ?? "")) || 0), _ = e(
24
+ () => `${Math.max(x.value, p.value)}px`
25
+ ), B = e(() => `${m.value}px`), E = e(() => S.aboveHeader ? 2 : 0), r = e(() => u.sidebarIsCollapse), P = e(() => ({
26
+ transform: `rotate(${r.value ? 0 : 180}deg)`
27
+ })), $ = v(N), l = e(() => $.themeColors.value);
28
+ return (d, t) => (f(), T("div", {
32
29
  class: "app-sidebar",
33
- style: h(p.value)
30
+ style: g(c.value)
34
31
  }, [
35
- l(o(S), {
32
+ a(o(y), {
36
33
  class: "app-sidebar-top",
37
- onHeightChange: t[0] || (t[0] = (i) => m.value = i)
34
+ onHeightChange: t[0] || (t[0] = (n) => p.value = n)
38
35
  }, {
39
- default: u(() => [
40
- C(c.$slots, "top", {}, void 0, !0)
36
+ default: i(() => [
37
+ h(d.$slots, "top", {}, void 0, !0)
41
38
  ]),
42
39
  _: 3
43
40
  }),
44
- y("div", R, [
45
- l(o(F), {
46
- collapse: n.value,
41
+ C("div", O, [
42
+ a(o(w), {
43
+ collapse: r.value,
47
44
  menus: s.menus,
48
45
  style: { height: "100%" },
49
- "background-color": a.value.bodyColor,
50
- "text-color": a.value.baseColor,
51
- "active-text-color": a.value.primaryColor,
46
+ "background-color": l.value.bodyColor,
47
+ "text-color": l.value.baseColor,
48
+ "active-text-color": l.value.primaryColor,
52
49
  menuFlatList: s.menuFlatList,
53
50
  routerMode: ""
54
51
  }, null, 8, ["collapse", "menus", "background-color", "text-color", "active-text-color", "menuFlatList"])
55
52
  ]),
56
- l(o(S), {
53
+ a(o(y), {
57
54
  class: "app-sidebar-bottom",
58
- onHeightChange: t[1] || (t[1] = (i) => v.value = i)
55
+ onHeightChange: t[1] || (t[1] = (n) => m.value = n)
59
56
  }, {
60
- default: u(() => [
61
- C(c.$slots, "bottom", {}, void 0, !0)
57
+ default: i(() => [
58
+ h(d.$slots, "bottom", {}, void 0, !0)
62
59
  ]),
63
60
  _: 3
64
61
  }),
65
- s.show ? (g(), H(o(I), {
62
+ s.show ? (f(), H(o(F), {
66
63
  key: 0,
67
- content: n.value ? "展开" : "收起",
64
+ content: r.value ? "展开" : "收起",
68
65
  placement: "right",
69
66
  "show-after": 200
70
67
  }, {
71
- default: u(() => [
72
- y("div", {
68
+ default: i(() => [
69
+ C("div", {
73
70
  class: "app-sidebar-toggle",
74
- onClick: t[2] || (t[2] = (i) => o(r).changeSidebarCollapseStatus(!n.value))
71
+ onClick: t[2] || (t[2] = (n) => o(u).changeSidebarCollapseStatus(!r.value))
75
72
  }, [
76
- l(o(V), null, {
77
- default: u(() => [
78
- l(o(Y), {
73
+ a(o(I), null, {
74
+ default: i(() => [
75
+ a(o(V), {
79
76
  class: "app-sidebar-toggle-icon",
80
- style: h($.value)
77
+ style: g(P.value)
81
78
  }, null, 8, ["style"])
82
79
  ]),
83
80
  _: 1
@@ -90,5 +87,5 @@ const R = { class: "app-sidebar-shim" }, G = /* @__PURE__ */ w({
90
87
  }
91
88
  });
92
89
  export {
93
- G as default
90
+ D as default
94
91
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppTheme.vue2.mjs";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-1f068b22"]]);
4
+ const r = /* @__PURE__ */ p(o, [["__scopeId", "data-v-89d81e34"]]);
5
5
  export {
6
- e as default
6
+ r as default
7
7
  };