@duxweb/dvha-pro 1.0.47 → 1.0.48
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/cjs/component.cjs +1 -1
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/langs/en-US.json.cjs +1 -1
- package/dist/cjs/langs/zh-CN.json.cjs +1 -1
- package/dist/cjs/pages/authLayout.cjs +1 -1
- package/dist/cjs/pages/layout/page.cjs +1 -1
- package/dist/cjs/pages/layout/tab.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/dark.cjs +1 -0
- package/dist/cjs/pages/menu/menuApp.cjs +1 -0
- package/dist/cjs/pages/menu/menuMain.cjs +1 -0
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/menu/notice.cjs +1 -0
- package/dist/cjs/theme/uno.css.cjs +20 -4
- package/dist/esm/component.js +1 -1
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/index.js +84 -78
- package/dist/esm/langs/en-US.json.js +1 -1
- package/dist/esm/langs/zh-CN.json.js +2 -2
- package/dist/esm/pages/authLayout.js +20 -17
- package/dist/esm/pages/layout/page.js +1 -1
- package/dist/esm/pages/layout/tab.js +2 -2
- package/dist/esm/pages/menu/avatar.js +83 -71
- package/dist/esm/pages/menu/button.js +12 -13
- package/dist/esm/pages/menu/dark.js +54 -0
- package/dist/esm/pages/menu/menuApp.js +207 -0
- package/dist/esm/pages/menu/{main.js → menuMain.js} +46 -41
- package/dist/esm/pages/menu/mobile.js +16 -13
- package/dist/esm/pages/menu/notice.js +205 -0
- package/dist/esm/theme/uno.css.js +20 -4
- package/dist/types/main.d.ts +12 -0
- package/dist/types/pages/menu/avatar.d.ts +18 -0
- package/dist/types/pages/menu/button.d.ts +9 -9
- package/dist/types/pages/menu/dark.d.ts +2 -0
- package/dist/types/pages/menu/index.d.ts +4 -1
- package/dist/types/pages/menu/{main.d.ts → menuApp.d.ts} +1 -1
- package/dist/types/pages/menu/menuMain.d.ts +22 -0
- package/dist/types/pages/menu/notice.d.ts +14 -0
- package/package.json +3 -3
- package/dist/cjs/pages/menu/main.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import "@
|
|
1
|
+
import { defineComponent as m, createVNode as o } from "vue";
|
|
2
|
+
import { useManage as i } from "@duxweb/dvha-core";
|
|
3
|
+
import { OverlaysProvider as p } from "@overlastic/vue";
|
|
4
4
|
import "naive-ui";
|
|
5
5
|
import "vue-router";
|
|
6
6
|
import "clsx";
|
|
@@ -21,11 +21,12 @@ import "vue-cropper";
|
|
|
21
21
|
import "jinrishici";
|
|
22
22
|
import "lodash-es";
|
|
23
23
|
import "vue-draggable-plus";
|
|
24
|
-
import { DuxGlobalLayout as
|
|
25
|
-
import { DuxLayoutPage as
|
|
26
|
-
import { DuxMenuCmd as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
24
|
+
import { DuxGlobalLayout as l } from "./layout/global.js";
|
|
25
|
+
import { DuxLayoutPage as e } from "./layout/page.js";
|
|
26
|
+
import { DuxMenuCmd as n } from "./menu/cmd.js";
|
|
27
|
+
import { DuxMenuApp as u } from "./menu/menuApp.js";
|
|
28
|
+
import { DuxMenuMain as a } from "./menu/menuMain.js";
|
|
29
|
+
import { DuxMobileMenu as f } from "./menu/mobile.js";
|
|
29
30
|
import "./page404.js";
|
|
30
31
|
import "short-unique-id";
|
|
31
32
|
import "aieditor";
|
|
@@ -40,24 +41,26 @@ import "../components/posterEditor/elements/index.js";
|
|
|
40
41
|
import "fabric";
|
|
41
42
|
import "dayjs";
|
|
42
43
|
import "@tanstack/vue-query";
|
|
43
|
-
import { useUI as
|
|
44
|
-
const
|
|
44
|
+
import { useUI as s } from "../hooks/ui.js";
|
|
45
|
+
const mo = /* @__PURE__ */ m({
|
|
45
46
|
name: "DuxAuthLayout",
|
|
46
47
|
setup() {
|
|
47
48
|
const {
|
|
48
49
|
menuCollapsed: r
|
|
49
|
-
} =
|
|
50
|
-
return () => o(
|
|
51
|
-
default: () => [o(
|
|
50
|
+
} = s(), t = i();
|
|
51
|
+
return () => o(l, null, {
|
|
52
|
+
default: () => [o(p, null, {
|
|
52
53
|
default: () => [o("div", {
|
|
53
54
|
class: "h-screen w-screen flex relative"
|
|
54
|
-
}, [o("div", {
|
|
55
|
-
class: ["flex-none transition-all", "hidden lg:block
|
|
56
|
-
}, [o(
|
|
55
|
+
}, [t.config.theme?.layout === "menu" && o("div", {
|
|
56
|
+
class: ["flex-none transition-all", "hidden lg:block", r.value ? "w-120px" : "w-200px"]
|
|
57
|
+
}, [o(a, null, null)]), (!t.config.theme?.layout || t.config.theme?.layout === "app") && o("div", {
|
|
58
|
+
class: ["flex-none transition-all", "hidden lg:block"]
|
|
59
|
+
}, [o(u, null, null)]), o(e, null, null)]), o(n, null, null), o(f, null, null)]
|
|
57
60
|
})]
|
|
58
61
|
});
|
|
59
62
|
}
|
|
60
63
|
});
|
|
61
64
|
export {
|
|
62
|
-
|
|
65
|
+
mo as DuxAuthLayout
|
|
63
66
|
};
|
|
@@ -101,7 +101,7 @@ const It = /* @__PURE__ */ l({
|
|
|
101
101
|
}, [m.title]), t("div", null, [t(x, {
|
|
102
102
|
collapsed: !0
|
|
103
103
|
}, null)])]), t("div", {
|
|
104
|
-
class: "flex-1 py-2"
|
|
104
|
+
class: "flex-1 py-2 min-w-0"
|
|
105
105
|
}, [t(g, null, null)])]), t("div", {
|
|
106
106
|
class: "flex-1 min-h-0 mr-2 ml-2 mb-2 lg:ml-0"
|
|
107
107
|
}, [t(c, null, null)])]);
|
|
@@ -61,7 +61,7 @@ const I = /* @__PURE__ */ f({
|
|
|
61
61
|
class: "app-page-tabs",
|
|
62
62
|
barWidth: 100
|
|
63
63
|
}, r.value), {
|
|
64
|
-
default: () =>
|
|
64
|
+
default: () => p?.value?.map((e) => t(N, {
|
|
65
65
|
key: e.path,
|
|
66
66
|
name: e.path || ""
|
|
67
67
|
}, {
|
|
@@ -80,7 +80,7 @@ const I = /* @__PURE__ */ f({
|
|
|
80
80
|
}, [t("div", {
|
|
81
81
|
class: "i-tabler:x size-4"
|
|
82
82
|
}, null)])])])]
|
|
83
|
-
}))
|
|
83
|
+
}))
|
|
84
84
|
}), t(O, {
|
|
85
85
|
trigger: "manual",
|
|
86
86
|
x: l.x,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as L, computed as b, createVNode as e } from "vue";
|
|
2
|
+
import { useI18n as f, useManage as S, useLogout as A, useTheme as R, useGetAuth as I } from "@duxweb/dvha-core";
|
|
3
3
|
import { NDropdown as B } from "naive-ui";
|
|
4
4
|
import { useRouter as N } from "vue-router";
|
|
5
5
|
import "clsx";
|
|
6
|
-
import { DuxAvatar as
|
|
6
|
+
import { DuxAvatar as g } from "../../components/widget/avatar.js";
|
|
7
7
|
import "vue-echarts";
|
|
8
8
|
import "@overlastic/vue";
|
|
9
9
|
import "dayjs";
|
|
@@ -51,7 +51,7 @@ import "unocss/preset-wind4";
|
|
|
51
51
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
52
52
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
53
53
|
import "vee-validate";
|
|
54
|
-
import
|
|
54
|
+
import j from "./button.js";
|
|
55
55
|
import "vue-command-palette";
|
|
56
56
|
import "../page404.js";
|
|
57
57
|
import "short-unique-id";
|
|
@@ -62,77 +62,85 @@ import "@vue-flow/background";
|
|
|
62
62
|
import "@iconify-json/tabler/icons.json";
|
|
63
63
|
import "../../components/posterEditor/elements/index.js";
|
|
64
64
|
import "fabric";
|
|
65
|
-
const Ke = /* @__PURE__ */
|
|
65
|
+
const Ke = /* @__PURE__ */ L({
|
|
66
66
|
name: "DuxMenuAvatar",
|
|
67
67
|
props: {
|
|
68
68
|
collapsed: {
|
|
69
69
|
type: Boolean,
|
|
70
70
|
default: !1
|
|
71
|
+
},
|
|
72
|
+
btnClass: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ""
|
|
75
|
+
},
|
|
76
|
+
btnLabelClass: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: ""
|
|
71
79
|
}
|
|
72
80
|
},
|
|
73
|
-
setup(
|
|
81
|
+
setup(s) {
|
|
74
82
|
const {
|
|
75
|
-
t
|
|
76
|
-
} =
|
|
77
|
-
config:
|
|
78
|
-
getRoutePath:
|
|
79
|
-
} =
|
|
80
|
-
mutate:
|
|
81
|
-
} =
|
|
82
|
-
mode:
|
|
83
|
-
primaryColors:
|
|
83
|
+
t: o
|
|
84
|
+
} = f(), m = f(), v = N(), {
|
|
85
|
+
config: y,
|
|
86
|
+
getRoutePath: h
|
|
87
|
+
} = S(), {
|
|
88
|
+
mutate: x
|
|
89
|
+
} = A(), {
|
|
90
|
+
mode: p,
|
|
91
|
+
primaryColors: k,
|
|
84
92
|
neutralColors: C,
|
|
85
|
-
colorMapping:
|
|
86
|
-
setColor:
|
|
87
|
-
setMode:
|
|
88
|
-
} =
|
|
93
|
+
colorMapping: c,
|
|
94
|
+
setColor: d,
|
|
95
|
+
setMode: w
|
|
96
|
+
} = R(), l = (t, r) => e("div", {
|
|
89
97
|
class: "flex gap-2 items-center w-30"
|
|
90
98
|
}, [e("div", {
|
|
91
99
|
class: "flex-1 min-w-0"
|
|
92
|
-
}, [
|
|
100
|
+
}, [t]), e("div", null, [r && e("div", {
|
|
93
101
|
class: "i-tabler:check"
|
|
94
|
-
}, null)])]),
|
|
95
|
-
class: `${
|
|
96
|
-
}, null),
|
|
97
|
-
const
|
|
98
|
-
label:
|
|
102
|
+
}, null)])]), i = (t) => e("div", {
|
|
103
|
+
class: `${t} size-4`
|
|
104
|
+
}, null), M = b(() => {
|
|
105
|
+
const t = y.userMenus?.map((r) => ({
|
|
106
|
+
label: o(r.label || "", {}, r.label),
|
|
99
107
|
key: r.key,
|
|
100
|
-
icon: () =>
|
|
108
|
+
icon: () => i(r.icon),
|
|
101
109
|
path: r.path
|
|
102
110
|
}));
|
|
103
|
-
return
|
|
111
|
+
return t?.length > 0 ? [...t, {
|
|
104
112
|
type: "divider"
|
|
105
113
|
}] : [];
|
|
106
|
-
}),
|
|
114
|
+
}), a = I(), z = b(() => [{
|
|
107
115
|
key: "header",
|
|
108
116
|
type: "render",
|
|
109
117
|
render: () => e("div", {
|
|
110
118
|
class: "flex gap-2 px-3 pb-1 pt-1 items-center "
|
|
111
|
-
}, [e(
|
|
119
|
+
}, [e(g, {
|
|
112
120
|
round: !0,
|
|
113
121
|
size: 28,
|
|
114
|
-
src:
|
|
122
|
+
src: a.info?.avatar
|
|
115
123
|
}, null), e("div", {
|
|
116
124
|
class: "flex flex-col"
|
|
117
125
|
}, [e("div", {
|
|
118
126
|
class: "text-sm font-medium"
|
|
119
|
-
}, [
|
|
127
|
+
}, [a.info?.nickname]), e("div", {
|
|
120
128
|
class: "text-xs text-muted"
|
|
121
|
-
}, [
|
|
129
|
+
}, [a.info?.username])])])
|
|
122
130
|
}, {
|
|
123
131
|
type: "divider"
|
|
124
|
-
}, ...
|
|
125
|
-
label:
|
|
132
|
+
}, ...M.value, {
|
|
133
|
+
label: o("components.menu.language"),
|
|
126
134
|
key: "locale",
|
|
127
|
-
icon: () =>
|
|
128
|
-
children: [...(
|
|
129
|
-
label: () => l(
|
|
130
|
-
key: `locale.${
|
|
135
|
+
icon: () => i("i-tabler:language"),
|
|
136
|
+
children: [...(m.getLocales() || []).map((t) => ({
|
|
137
|
+
label: () => l(o(`locale.${t}`), m.getLocale() === t),
|
|
138
|
+
key: `locale.${t}`
|
|
131
139
|
}))]
|
|
132
140
|
}, {
|
|
133
|
-
label:
|
|
141
|
+
label: o("components.menu.color"),
|
|
134
142
|
key: "color",
|
|
135
|
-
icon: () =>
|
|
143
|
+
icon: () => i("i-tabler:palette"),
|
|
136
144
|
children: [{
|
|
137
145
|
label: () => e("div", {
|
|
138
146
|
class: "flex gap-2 items-center w-30"
|
|
@@ -141,18 +149,18 @@ const Ke = /* @__PURE__ */ A({
|
|
|
141
149
|
style: {
|
|
142
150
|
backgroundColor: "rgb(var(--ui-color-primary))"
|
|
143
151
|
}
|
|
144
|
-
}, null), e("div", null, [
|
|
152
|
+
}, null), e("div", null, [o("components.menu.primaryColor")])]),
|
|
145
153
|
key: "color.primary",
|
|
146
|
-
children:
|
|
154
|
+
children: k.value?.map((t) => ({
|
|
147
155
|
label: () => l(e("div", {
|
|
148
156
|
class: "flex gap-2 items-center"
|
|
149
157
|
}, [e("div", {
|
|
150
158
|
class: "size-2 rounded-full",
|
|
151
159
|
style: {
|
|
152
|
-
backgroundColor: `rgb(var(--base-color-${
|
|
160
|
+
backgroundColor: `rgb(var(--base-color-${t}-500))`
|
|
153
161
|
}
|
|
154
|
-
}, null), e("div", null, [
|
|
155
|
-
key: `color.primary.${
|
|
162
|
+
}, null), e("div", null, [t])]), c.value.primary === t),
|
|
163
|
+
key: `color.primary.${t}`
|
|
156
164
|
}))
|
|
157
165
|
}, {
|
|
158
166
|
label: () => e("div", {
|
|
@@ -162,63 +170,63 @@ const Ke = /* @__PURE__ */ A({
|
|
|
162
170
|
style: {
|
|
163
171
|
backgroundColor: "rgb(var(--ui-color-gray-600))"
|
|
164
172
|
}
|
|
165
|
-
}, null), e("div", null, [
|
|
173
|
+
}, null), e("div", null, [o("components.menu.neutralColor")])]),
|
|
166
174
|
key: "color.neutral",
|
|
167
|
-
children: C.value?.map((
|
|
175
|
+
children: C.value?.map((t) => ({
|
|
168
176
|
label: () => l(e("div", {
|
|
169
177
|
class: "flex gap-2 items-center"
|
|
170
178
|
}, [e("div", {
|
|
171
179
|
class: "size-2 rounded-full",
|
|
172
180
|
style: {
|
|
173
|
-
backgroundColor: `rgb(var(--base-color-${
|
|
181
|
+
backgroundColor: `rgb(var(--base-color-${t}-600))`
|
|
174
182
|
}
|
|
175
|
-
}, null), e("div", null, [
|
|
176
|
-
key: `color.neutral.${
|
|
183
|
+
}, null), e("div", null, [t])]), c.value.gray === t),
|
|
184
|
+
key: `color.neutral.${t}`
|
|
177
185
|
}))
|
|
178
186
|
}]
|
|
179
187
|
}, {
|
|
180
|
-
label:
|
|
188
|
+
label: o("components.menu.theme"),
|
|
181
189
|
key: "theme",
|
|
182
|
-
icon: () =>
|
|
190
|
+
icon: () => i("i-tabler:brightness-half"),
|
|
183
191
|
children: [{
|
|
184
|
-
label: () => l(
|
|
192
|
+
label: () => l(o("components.menu.followSystem"), p.value === "auto"),
|
|
185
193
|
key: "theme.auto"
|
|
186
194
|
}, {
|
|
187
|
-
label: () => l(
|
|
195
|
+
label: () => l(o("components.menu.lightMode"), p.value === "light"),
|
|
188
196
|
key: "theme.light"
|
|
189
197
|
}, {
|
|
190
|
-
label: () => l(
|
|
198
|
+
label: () => l(o("components.menu.darkMode"), p.value === "dark"),
|
|
191
199
|
key: "theme.dark"
|
|
192
200
|
}]
|
|
193
201
|
}, {
|
|
194
202
|
type: "divider"
|
|
195
203
|
}, {
|
|
196
|
-
label:
|
|
204
|
+
label: o("components.menu.logout"),
|
|
197
205
|
key: "logout",
|
|
198
|
-
icon: () =>
|
|
206
|
+
icon: () => i("i-tabler:logout")
|
|
199
207
|
}]);
|
|
200
|
-
function $(
|
|
201
|
-
const
|
|
208
|
+
function $(t, r) {
|
|
209
|
+
const u = t.lastIndexOf("."), [D, n] = u === -1 ? [t, ""] : [t.substring(0, u), t.substring(u + 1)];
|
|
202
210
|
switch (D) {
|
|
203
211
|
case "locale":
|
|
204
|
-
|
|
212
|
+
m.changeLocale(n);
|
|
205
213
|
break;
|
|
206
214
|
case "color.primary":
|
|
207
|
-
|
|
215
|
+
d("primary", n);
|
|
208
216
|
break;
|
|
209
217
|
case "color.neutral":
|
|
210
|
-
|
|
218
|
+
d("gray", n);
|
|
211
219
|
break;
|
|
212
220
|
case "theme":
|
|
213
|
-
|
|
221
|
+
w(n);
|
|
214
222
|
break;
|
|
215
223
|
case "logout":
|
|
216
|
-
|
|
224
|
+
x();
|
|
217
225
|
break;
|
|
218
226
|
default:
|
|
219
227
|
if (!r?.path)
|
|
220
228
|
return;
|
|
221
|
-
|
|
229
|
+
v.push(h(r.path));
|
|
222
230
|
}
|
|
223
231
|
}
|
|
224
232
|
return () => e(B, {
|
|
@@ -228,22 +236,26 @@ const Ke = /* @__PURE__ */ A({
|
|
|
228
236
|
onSelect: $,
|
|
229
237
|
width: 200
|
|
230
238
|
}, {
|
|
231
|
-
default: () => [e(
|
|
232
|
-
|
|
239
|
+
default: () => [e(j, {
|
|
240
|
+
class: s.btnClass,
|
|
241
|
+
labelClass: s.btnLabelClass,
|
|
242
|
+
collapsed: s.collapsed
|
|
233
243
|
}, {
|
|
234
|
-
icon: () => e(
|
|
244
|
+
icon: () => e(g, {
|
|
235
245
|
class: "group-hover:shadow-lg",
|
|
236
246
|
round: !0,
|
|
237
247
|
size: 28,
|
|
238
|
-
src:
|
|
248
|
+
src: a.info?.avatar
|
|
239
249
|
}, null),
|
|
240
250
|
default: () => e("div", {
|
|
251
|
+
class: "flex justify-between"
|
|
252
|
+
}, [e("div", {
|
|
241
253
|
class: "flex flex-col"
|
|
242
254
|
}, [e("div", {
|
|
243
255
|
class: "text-sm font-medium"
|
|
244
|
-
}, [
|
|
256
|
+
}, [a.info?.nickname]), e("div", {
|
|
245
257
|
class: "text-xs text-muted"
|
|
246
|
-
}, [
|
|
258
|
+
}, [a.info?.username])])])
|
|
247
259
|
})]
|
|
248
260
|
});
|
|
249
261
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, createVNode as i } from "vue";
|
|
2
2
|
import "@duxweb/dvha-core";
|
|
3
3
|
import "naive-ui";
|
|
4
4
|
import "vue-router";
|
|
@@ -60,13 +60,17 @@ import "fabric";
|
|
|
60
60
|
import "dayjs";
|
|
61
61
|
import "@tanstack/vue-query";
|
|
62
62
|
import { useUI as m } from "../../hooks/ui.js";
|
|
63
|
-
const
|
|
63
|
+
const dt = /* @__PURE__ */ p({
|
|
64
64
|
name: "DuxMenuButton",
|
|
65
65
|
props: {
|
|
66
66
|
class: {
|
|
67
67
|
type: String,
|
|
68
68
|
default: ""
|
|
69
69
|
},
|
|
70
|
+
labelClass: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: ""
|
|
73
|
+
},
|
|
70
74
|
onClick: {
|
|
71
75
|
type: Function,
|
|
72
76
|
default: () => {
|
|
@@ -75,29 +79,24 @@ const vt = /* @__PURE__ */ e({
|
|
|
75
79
|
collapsed: {
|
|
76
80
|
type: Boolean,
|
|
77
81
|
default: !0
|
|
78
|
-
},
|
|
79
|
-
inverted: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
default: !1
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
setup(t, {
|
|
85
85
|
slots: o
|
|
86
86
|
}) {
|
|
87
87
|
const {
|
|
88
|
-
menuCollapsed: r
|
|
89
|
-
menuMobileCollapsed: i
|
|
88
|
+
menuCollapsed: r
|
|
90
89
|
} = m();
|
|
91
|
-
return () =>
|
|
90
|
+
return () => i("div", {
|
|
92
91
|
onClick: () => {
|
|
93
92
|
t.onClick?.();
|
|
94
93
|
},
|
|
95
|
-
class: ["flex items-center gap-1 justify-center py-1 px-2 cursor-pointer gap-2
|
|
96
|
-
}, [o.icon?.(), t.collapsed === !1 && !r.value &&
|
|
97
|
-
class: ["overflow-hidden ease-in-out whitespace-nowrap text-left min-w-0 flex-1", t.
|
|
94
|
+
class: ["flex items-center gap-1 justify-center py-1 px-2 cursor-pointer gap-2 flex-1 w-full", t.class]
|
|
95
|
+
}, [o.icon?.(), t.collapsed === !1 && !r.value && i("div", {
|
|
96
|
+
class: ["overflow-hidden ease-in-out whitespace-nowrap text-left min-w-0 flex-1", t.labelClass]
|
|
98
97
|
}, [o.default?.()])]);
|
|
99
98
|
}
|
|
100
99
|
});
|
|
101
100
|
export {
|
|
102
|
-
|
|
101
|
+
dt as default
|
|
103
102
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as i, computed as u, createVNode as e } from "vue";
|
|
2
|
+
import { useI18n as s, useTheme as m } from "@duxweb/dvha-core";
|
|
3
|
+
import { NTooltip as c, NButton as d } from "naive-ui";
|
|
4
|
+
const f = /* @__PURE__ */ i({
|
|
5
|
+
name: "DuxMenuDark",
|
|
6
|
+
setup() {
|
|
7
|
+
const {
|
|
8
|
+
t
|
|
9
|
+
} = s(), {
|
|
10
|
+
mode: l,
|
|
11
|
+
setMode: a
|
|
12
|
+
} = m(), o = u(() => {
|
|
13
|
+
const n = {
|
|
14
|
+
auto: {
|
|
15
|
+
icon: "i-tabler:device-desktop",
|
|
16
|
+
label: t("components.menu.followSystem", "Follow System"),
|
|
17
|
+
nextMode: "light"
|
|
18
|
+
},
|
|
19
|
+
light: {
|
|
20
|
+
icon: "i-tabler:sun",
|
|
21
|
+
label: t("components.menu.lightMode", "Light"),
|
|
22
|
+
nextMode: "dark"
|
|
23
|
+
},
|
|
24
|
+
dark: {
|
|
25
|
+
icon: "i-tabler:moon",
|
|
26
|
+
label: t("components.menu.darkMode", "Dark"),
|
|
27
|
+
nextMode: "auto"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return n[l.value] || n.auto;
|
|
31
|
+
}), r = () => {
|
|
32
|
+
a(o.value.nextMode);
|
|
33
|
+
};
|
|
34
|
+
return () => e(c, {
|
|
35
|
+
trigger: "hover",
|
|
36
|
+
placement: "right"
|
|
37
|
+
}, {
|
|
38
|
+
default: () => o.value.label,
|
|
39
|
+
trigger: () => e(d, {
|
|
40
|
+
quaternary: !0,
|
|
41
|
+
onClick: r
|
|
42
|
+
}, {
|
|
43
|
+
icon: () => e("div", {
|
|
44
|
+
class: "transition-all text-muted p-2 hover:text-white"
|
|
45
|
+
}, [e("div", {
|
|
46
|
+
class: `${o.value.icon} size-5`
|
|
47
|
+
}, null)])
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
f as default
|
|
54
|
+
};
|