@jnrs/vue-core 1.1.4 → 1.1.5
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/components/index.js +46 -46
- package/dist/constants/themeOptions.d.ts +12 -12
- package/dist/index-CfK0PRAy.js +106 -0
- package/dist/{index-DEkMXVh9.js → index-Ci9uljtG.js} +3 -9
- package/dist/index.js +2 -2
- package/dist/locales/en.d.ts +31 -0
- package/dist/locales/i18next.d.ts +1 -0
- package/dist/locales/index.d.ts +3 -0
- package/dist/locales/index.js +63 -0
- package/dist/locales/zhCn.d.ts +31 -0
- package/dist/piniaStore/base/auth.d.ts +46 -9
- package/dist/piniaStore/base/menu.d.ts +4 -1
- package/dist/piniaStore/base/system.d.ts +11 -11
- package/dist/piniaStore/index.js +2 -2
- package/dist/system-KZETuQYC.js +91 -0
- package/dist/vueRouter/index.js +1 -1
- package/package.json +8 -3
- package/dist/index-BEHnZZvl.js +0 -100
- package/dist/system-C18uA6p7.js +0 -76
package/dist/components/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".globalSetting_item[data-v-
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { ElDrawer as k, ElRadioGroup as
|
|
4
|
-
import { u as E, L as
|
|
5
|
-
const N = { class: "globalSetting_item" },
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".globalSetting_item[data-v-b0382b1b]{margin-bottom:20px}.globalSetting_header{margin-bottom:0;padding-bottom:20px}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { defineComponent as O, ref as y, createBlock as d, openBlock as n, unref as l, withCtx as r, createElementVNode as u, createVNode as _, toDisplayString as s, createElementBlock as c, Fragment as S, renderList as b, createTextVNode as f } from "vue";
|
|
3
|
+
import { ElDrawer as k, ElRadioGroup as C, ElRadio as V } from "element-plus";
|
|
4
|
+
import { u as E, L as G, M as $, C as L } from "../system-KZETuQYC.js";
|
|
5
|
+
const N = { class: "globalSetting_item" }, j = { class: "globalSetting_item" }, w = { class: "globalSetting_item" }, I = /* @__PURE__ */ O({
|
|
6
6
|
__name: "GlobalSetting",
|
|
7
|
-
setup(
|
|
8
|
-
const { theme: o, setLocale:
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
} }), (
|
|
7
|
+
setup(m, { expose: i }) {
|
|
8
|
+
const { theme: o, setLocale: v, setMode: g, setPrimaryColor: h } = E(), p = y(!1);
|
|
9
|
+
return i({ handleShow: () => {
|
|
10
|
+
p.value = !0;
|
|
11
|
+
} }), (a, t) => (n(), d(l(k), {
|
|
12
12
|
"header-class": "globalSetting_header",
|
|
13
|
-
modelValue:
|
|
14
|
-
"onUpdate:modelValue": t[3] || (t[3] = (e) =>
|
|
15
|
-
title: "
|
|
13
|
+
modelValue: p.value,
|
|
14
|
+
"onUpdate:modelValue": t[3] || (t[3] = (e) => p.value = e),
|
|
15
|
+
title: a.$t("@jnrs/vue-core.components.GlobalSetting.title")
|
|
16
16
|
}, {
|
|
17
|
-
default:
|
|
17
|
+
default: r(() => [
|
|
18
18
|
u("div", N, [
|
|
19
|
-
|
|
20
|
-
_(l(
|
|
19
|
+
u("h4", null, s(a.$t("@jnrs/vue-core.components.GlobalSetting.language")), 1),
|
|
20
|
+
_(l(C), {
|
|
21
21
|
modelValue: l(o).locale,
|
|
22
22
|
"onUpdate:modelValue": t[0] || (t[0] = (e) => l(o).locale = e),
|
|
23
|
-
onChange: l(
|
|
23
|
+
onChange: l(v)
|
|
24
24
|
}, {
|
|
25
|
-
default:
|
|
26
|
-
(
|
|
25
|
+
default: r(() => [
|
|
26
|
+
(n(!0), c(S, null, b(l(G), (e) => (n(), d(l(V), {
|
|
27
27
|
key: e.value,
|
|
28
28
|
value: e.value
|
|
29
29
|
}, {
|
|
30
|
-
default:
|
|
31
|
-
|
|
30
|
+
default: r(() => [
|
|
31
|
+
f(s(a.$t(e.label)), 1)
|
|
32
32
|
]),
|
|
33
33
|
_: 2
|
|
34
34
|
}, 1032, ["value"]))), 128))
|
|
@@ -36,20 +36,20 @@ const N = { class: "globalSetting_item" }, w = { class: "globalSetting_item" },
|
|
|
36
36
|
_: 1
|
|
37
37
|
}, 8, ["modelValue", "onChange"])
|
|
38
38
|
]),
|
|
39
|
-
u("div",
|
|
40
|
-
|
|
41
|
-
_(l(
|
|
39
|
+
u("div", j, [
|
|
40
|
+
u("h4", null, s(a.$t("@jnrs/vue-core.components.GlobalSetting.theme")), 1),
|
|
41
|
+
_(l(C), {
|
|
42
42
|
modelValue: l(o).mode,
|
|
43
43
|
"onUpdate:modelValue": t[1] || (t[1] = (e) => l(o).mode = e),
|
|
44
|
-
onChange: l(
|
|
44
|
+
onChange: l(g)
|
|
45
45
|
}, {
|
|
46
|
-
default:
|
|
47
|
-
(
|
|
46
|
+
default: r(() => [
|
|
47
|
+
(n(!0), c(S, null, b(l($), (e) => (n(), d(l(V), {
|
|
48
48
|
key: e.value,
|
|
49
49
|
value: e.value
|
|
50
50
|
}, {
|
|
51
|
-
default:
|
|
52
|
-
|
|
51
|
+
default: r(() => [
|
|
52
|
+
f(s(a.$t(e.label)), 1)
|
|
53
53
|
]),
|
|
54
54
|
_: 2
|
|
55
55
|
}, 1032, ["value"]))), 128))
|
|
@@ -57,20 +57,20 @@ const N = { class: "globalSetting_item" }, w = { class: "globalSetting_item" },
|
|
|
57
57
|
_: 1
|
|
58
58
|
}, 8, ["modelValue", "onChange"])
|
|
59
59
|
]),
|
|
60
|
-
u("div",
|
|
61
|
-
|
|
62
|
-
_(l(
|
|
63
|
-
modelValue: l(o).
|
|
64
|
-
"onUpdate:modelValue": t[2] || (t[2] = (e) => l(o).
|
|
65
|
-
onChange: l(
|
|
60
|
+
u("div", w, [
|
|
61
|
+
u("h4", null, s(a.$t("@jnrs/vue-core.components.GlobalSetting.primaryColor")), 1),
|
|
62
|
+
_(l(C), {
|
|
63
|
+
modelValue: l(o).primaryColor,
|
|
64
|
+
"onUpdate:modelValue": t[2] || (t[2] = (e) => l(o).primaryColor = e),
|
|
65
|
+
onChange: l(h)
|
|
66
66
|
}, {
|
|
67
|
-
default:
|
|
68
|
-
(
|
|
67
|
+
default: r(() => [
|
|
68
|
+
(n(!0), c(S, null, b(l(L), (e) => (n(), d(l(V), {
|
|
69
69
|
key: e.value,
|
|
70
70
|
value: e.value
|
|
71
71
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
|
|
72
|
+
default: r(() => [
|
|
73
|
+
f(s(a.$t(e.label)), 1)
|
|
74
74
|
]),
|
|
75
75
|
_: 2
|
|
76
76
|
}, 1032, ["value"]))), 128))
|
|
@@ -80,14 +80,14 @@ const N = { class: "globalSetting_item" }, w = { class: "globalSetting_item" },
|
|
|
80
80
|
])
|
|
81
81
|
]),
|
|
82
82
|
_: 1
|
|
83
|
-
}, 8, ["modelValue"]));
|
|
83
|
+
}, 8, ["modelValue", "title"]));
|
|
84
84
|
}
|
|
85
|
-
}),
|
|
86
|
-
const o =
|
|
87
|
-
for (const [
|
|
88
|
-
o[
|
|
85
|
+
}), P = (m, i) => {
|
|
86
|
+
const o = m.__vccOpts || m;
|
|
87
|
+
for (const [v, g] of i)
|
|
88
|
+
o[v] = g;
|
|
89
89
|
return o;
|
|
90
|
-
},
|
|
90
|
+
}, M = /* @__PURE__ */ P(I, [["__scopeId", "data-v-b0382b1b"]]);
|
|
91
91
|
export {
|
|
92
|
-
|
|
92
|
+
M as GlobalSetting
|
|
93
93
|
};
|
|
@@ -3,46 +3,46 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const LOCALE_OPTIONS: readonly [{
|
|
5
5
|
readonly value: "zhCn";
|
|
6
|
-
readonly label: "
|
|
6
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.languageOptions.zhCn";
|
|
7
7
|
}, {
|
|
8
8
|
readonly value: "en";
|
|
9
|
-
readonly label: "
|
|
9
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.languageOptions.en";
|
|
10
10
|
}];
|
|
11
11
|
/**
|
|
12
12
|
* 主题模式选项
|
|
13
13
|
*/
|
|
14
14
|
export declare const MODE_OPTIONS: readonly [{
|
|
15
15
|
readonly value: "auto";
|
|
16
|
-
readonly label: "
|
|
16
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.auto";
|
|
17
17
|
}, {
|
|
18
18
|
readonly value: "light";
|
|
19
|
-
readonly label: "
|
|
19
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.light";
|
|
20
20
|
}, {
|
|
21
21
|
readonly value: "dark";
|
|
22
|
-
readonly label: "
|
|
22
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.dark";
|
|
23
23
|
}];
|
|
24
24
|
/**
|
|
25
25
|
* 强调色选项
|
|
26
26
|
*/
|
|
27
27
|
export declare const COLOR_OPTIONS: readonly [{
|
|
28
28
|
readonly value: "oklch(0.6 0.19 41)";
|
|
29
|
-
readonly label: "
|
|
29
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.jnrs";
|
|
30
30
|
}, {
|
|
31
31
|
readonly value: "oklch(0.51 0.21 264)";
|
|
32
|
-
readonly label: "
|
|
32
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.azure";
|
|
33
33
|
}, {
|
|
34
34
|
readonly value: "oklch(0.90 0.16 98)";
|
|
35
|
-
readonly label: "
|
|
35
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.moonYellow";
|
|
36
36
|
}, {
|
|
37
37
|
readonly value: "oklch(0.63 0.25 27)";
|
|
38
|
-
readonly label: "
|
|
38
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.jdRed";
|
|
39
39
|
}, {
|
|
40
40
|
readonly value: "oklch(0.65 0.24 33)";
|
|
41
|
-
readonly label: "
|
|
41
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.taobaoRed";
|
|
42
42
|
}, {
|
|
43
43
|
readonly value: "oklch(0.61 0.20 261)";
|
|
44
|
-
readonly label: "
|
|
44
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.dingtalkBlue";
|
|
45
45
|
}, {
|
|
46
46
|
readonly value: "oklch(0.70 0.12 152)";
|
|
47
|
-
readonly label: "
|
|
47
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.wechatGreen";
|
|
48
48
|
}];
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import "pinia-plugin-persistedstate";
|
|
2
|
+
import { u as p } from "./system-KZETuQYC.js";
|
|
3
|
+
import { ref as c } from "vue";
|
|
4
|
+
import { defineStore as m } from "pinia";
|
|
5
|
+
import { a as v } from "./index-Ci9uljtG.js";
|
|
6
|
+
const y = m(
|
|
7
|
+
"@jnrs/vue-core/pinia:auth",
|
|
8
|
+
() => {
|
|
9
|
+
const e = c(!1), t = c(null), u = c(null), o = c([]), l = c([]);
|
|
10
|
+
return {
|
|
11
|
+
hasAuthenticated: e,
|
|
12
|
+
token: t,
|
|
13
|
+
userInfo: u,
|
|
14
|
+
dict: o,
|
|
15
|
+
role: l,
|
|
16
|
+
setUserInfo: (r) => {
|
|
17
|
+
u.value = r;
|
|
18
|
+
},
|
|
19
|
+
setToken: (r) => {
|
|
20
|
+
t.value = r, e.value = !0;
|
|
21
|
+
},
|
|
22
|
+
setDict: (r) => {
|
|
23
|
+
o.value = r;
|
|
24
|
+
},
|
|
25
|
+
setRole: (r) => {
|
|
26
|
+
l.value = r;
|
|
27
|
+
},
|
|
28
|
+
clearAuth: () => {
|
|
29
|
+
t.value = null, u.value = null, o.value = [], l.value = [], e.value = !1;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
persist: {
|
|
35
|
+
pick: ["hasAuthenticated", "token", "userInfo", "dict"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
), n = [];
|
|
39
|
+
for (let e = 0; e < 256; ++e)
|
|
40
|
+
n.push((e + 256).toString(16).slice(1));
|
|
41
|
+
function h(e, t = 0) {
|
|
42
|
+
return (n[e[t + 0]] + n[e[t + 1]] + n[e[t + 2]] + n[e[t + 3]] + "-" + n[e[t + 4]] + n[e[t + 5]] + "-" + n[e[t + 6]] + n[e[t + 7]] + "-" + n[e[t + 8]] + n[e[t + 9]] + "-" + n[e[t + 10]] + n[e[t + 11]] + n[e[t + 12]] + n[e[t + 13]] + n[e[t + 14]] + n[e[t + 15]]).toLowerCase();
|
|
43
|
+
}
|
|
44
|
+
let i;
|
|
45
|
+
const g = new Uint8Array(16);
|
|
46
|
+
function f() {
|
|
47
|
+
if (!i) {
|
|
48
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
49
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
50
|
+
i = crypto.getRandomValues.bind(crypto);
|
|
51
|
+
}
|
|
52
|
+
return i(g);
|
|
53
|
+
}
|
|
54
|
+
const b = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), d = { randomUUID: b };
|
|
55
|
+
function U(e, t, u) {
|
|
56
|
+
e = e || {};
|
|
57
|
+
const o = e.random ?? e.rng?.() ?? f();
|
|
58
|
+
if (o.length < 16)
|
|
59
|
+
throw new Error("Random bytes length must be >= 16");
|
|
60
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, h(o);
|
|
61
|
+
}
|
|
62
|
+
function x(e, t, u) {
|
|
63
|
+
return d.randomUUID && !e ? d.randomUUID() : U(e);
|
|
64
|
+
}
|
|
65
|
+
const S = m(
|
|
66
|
+
"@jnrs/vue-core/pinia:menu",
|
|
67
|
+
() => {
|
|
68
|
+
const e = c(!1), t = c([]), u = async (a) => {
|
|
69
|
+
if (e.value)
|
|
70
|
+
return t.value;
|
|
71
|
+
o(a), t.value = a, e.value = !0;
|
|
72
|
+
try {
|
|
73
|
+
await v(t.value);
|
|
74
|
+
} catch (s) {
|
|
75
|
+
throw s;
|
|
76
|
+
}
|
|
77
|
+
return t.value;
|
|
78
|
+
}, o = (a) => {
|
|
79
|
+
for (const s of a)
|
|
80
|
+
s.meta.uuid = x(), s.children && o(s.children);
|
|
81
|
+
};
|
|
82
|
+
return { hasFetchedAsyncMenus: e, menus: t, asyncSetMenus: u, clearMenu: () => {
|
|
83
|
+
e.value = !1, t.value = [];
|
|
84
|
+
} };
|
|
85
|
+
}
|
|
86
|
+
// {
|
|
87
|
+
// persist: {
|
|
88
|
+
// pick: ['menus']
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
);
|
|
92
|
+
console.log(
|
|
93
|
+
"%c✨ 欢迎使用 @jnrs/vue-core/pinia",
|
|
94
|
+
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
95
|
+
);
|
|
96
|
+
const _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
97
|
+
__proto__: null,
|
|
98
|
+
useAuthStore: y,
|
|
99
|
+
useMenuStore: S,
|
|
100
|
+
useSystemStore: p
|
|
101
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
102
|
+
export {
|
|
103
|
+
S as a,
|
|
104
|
+
_ as i,
|
|
105
|
+
y as u
|
|
106
|
+
};
|
|
@@ -4,24 +4,18 @@ const h = {
|
|
|
4
4
|
routes: []
|
|
5
5
|
};
|
|
6
6
|
let n, s, i, m;
|
|
7
|
-
const f = ({
|
|
8
|
-
options: o,
|
|
9
|
-
fileModules: t,
|
|
10
|
-
layoutName: e,
|
|
11
|
-
globalComponent: a,
|
|
12
|
-
handleBeforeEach: r
|
|
13
|
-
}) => (s = t, e && (i = e), a && (m = a), n = d({ ...h, ...o }), n.beforeEach(
|
|
7
|
+
const f = ({ options: o, fileModules: t, layoutName: e, globalComponent: a, handleBeforeEach: r }) => (s = t, e && (i = e), a && (m = a), n = d({ ...h, ...o }), n.beforeEach(
|
|
14
8
|
async (c, u) => r?.(c, u)
|
|
15
9
|
), n), g = async (o, t = "push") => {
|
|
16
10
|
try {
|
|
17
11
|
return await n[t](o);
|
|
18
12
|
} catch (e) {
|
|
19
|
-
console.warn(`router.${t} 失败`, {
|
|
13
|
+
n[t]({ name: "404" }), console.warn(`router.${t} 失败`, {
|
|
20
14
|
code: "ROUTER_NOT_MATCH",
|
|
21
15
|
message: "未匹配到有效路由",
|
|
22
16
|
error: o || e,
|
|
23
17
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
24
|
-
})
|
|
18
|
+
});
|
|
25
19
|
}
|
|
26
20
|
}, _ = (o) => s[`/src/views${o}.vue`], l = async (o, t) => {
|
|
27
21
|
for (const e of o) {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as r } from "./index-
|
|
2
|
-
import { i } from "./index-
|
|
1
|
+
import { c as r } from "./index-Ci9uljtG.js";
|
|
2
|
+
import { i } from "./index-CfK0PRAy.js";
|
|
3
3
|
console.log(
|
|
4
4
|
"%c✨ 欢迎使用 @jnrs/vue-core",
|
|
5
5
|
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'@jnrs/vue-core': {
|
|
3
|
+
components: {
|
|
4
|
+
GlobalSetting: {
|
|
5
|
+
title: string;
|
|
6
|
+
language: string;
|
|
7
|
+
languageOptions: {
|
|
8
|
+
zhCn: string;
|
|
9
|
+
en: string;
|
|
10
|
+
};
|
|
11
|
+
theme: string;
|
|
12
|
+
themeOptions: {
|
|
13
|
+
light: string;
|
|
14
|
+
dark: string;
|
|
15
|
+
auto: string;
|
|
16
|
+
};
|
|
17
|
+
primaryColor: string;
|
|
18
|
+
primaryColorOptions: {
|
|
19
|
+
jnrs: string;
|
|
20
|
+
azure: string;
|
|
21
|
+
moonYellow: string;
|
|
22
|
+
jdRed: string;
|
|
23
|
+
taobaoRed: string;
|
|
24
|
+
dingtalkBlue: string;
|
|
25
|
+
wechatGreen: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
"@jnrs/vue-core": {
|
|
3
|
+
components: {
|
|
4
|
+
GlobalSetting: {
|
|
5
|
+
title: "全局偏好设置",
|
|
6
|
+
language: "语言",
|
|
7
|
+
languageOptions: {
|
|
8
|
+
zhCn: "简体中文",
|
|
9
|
+
en: "English"
|
|
10
|
+
},
|
|
11
|
+
theme: "主题",
|
|
12
|
+
themeOptions: {
|
|
13
|
+
light: "浅色",
|
|
14
|
+
dark: "深色",
|
|
15
|
+
auto: "跟随系统"
|
|
16
|
+
},
|
|
17
|
+
primaryColor: "强调色",
|
|
18
|
+
primaryColorOptions: {
|
|
19
|
+
jnrs: "JNRS",
|
|
20
|
+
azure: "蔚蓝",
|
|
21
|
+
moonYellow: "月黄",
|
|
22
|
+
jdRed: "京东红",
|
|
23
|
+
taobaoRed: "淘宝红",
|
|
24
|
+
dingtalkBlue: "钉钉蓝",
|
|
25
|
+
wechatGreen: "微信绿"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, o = {
|
|
31
|
+
"@jnrs/vue-core": {
|
|
32
|
+
components: {
|
|
33
|
+
GlobalSetting: {
|
|
34
|
+
title: "Global Preferences",
|
|
35
|
+
language: "Language",
|
|
36
|
+
languageOptions: {
|
|
37
|
+
zhCn: "简体中文",
|
|
38
|
+
en: "English"
|
|
39
|
+
},
|
|
40
|
+
theme: "Theme",
|
|
41
|
+
themeOptions: {
|
|
42
|
+
light: "Light",
|
|
43
|
+
dark: "Dark",
|
|
44
|
+
auto: "Follow System"
|
|
45
|
+
},
|
|
46
|
+
primaryColor: "Primary Color",
|
|
47
|
+
primaryColorOptions: {
|
|
48
|
+
jnrs: "JNRS",
|
|
49
|
+
azure: "Azure",
|
|
50
|
+
moonYellow: "Moon Yellow",
|
|
51
|
+
jdRed: "JD Red",
|
|
52
|
+
taobaoRed: "Taobao Red",
|
|
53
|
+
dingtalkBlue: "DingTalk Blue",
|
|
54
|
+
wechatGreen: "WeChat Green"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
o as en,
|
|
62
|
+
e as zhCn
|
|
63
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'@jnrs/vue-core': {
|
|
3
|
+
components: {
|
|
4
|
+
GlobalSetting: {
|
|
5
|
+
title: string;
|
|
6
|
+
language: string;
|
|
7
|
+
languageOptions: {
|
|
8
|
+
zhCn: string;
|
|
9
|
+
en: string;
|
|
10
|
+
};
|
|
11
|
+
theme: string;
|
|
12
|
+
themeOptions: {
|
|
13
|
+
light: string;
|
|
14
|
+
dark: string;
|
|
15
|
+
auto: string;
|
|
16
|
+
};
|
|
17
|
+
primaryColor: string;
|
|
18
|
+
primaryColorOptions: {
|
|
19
|
+
jnrs: string;
|
|
20
|
+
azure: string;
|
|
21
|
+
moonYellow: string;
|
|
22
|
+
jdRed: string;
|
|
23
|
+
taobaoRed: string;
|
|
24
|
+
dingtalkBlue: string;
|
|
25
|
+
wechatGreen: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Dict, User } from '@jnrs/shared';
|
|
1
|
+
import { Dict, User, Role } from '@jnrs/shared';
|
|
2
2
|
/**
|
|
3
3
|
* useAuthStore 权限仓库
|
|
4
4
|
* @returns hasAuthenticated 是否已身份验证
|
|
5
5
|
* @returns token 身份验证凭证
|
|
6
6
|
* @returns userInfo 用户信息
|
|
7
7
|
* @returns dict 字典
|
|
8
|
+
* @returns role 角色权限
|
|
8
9
|
* @methods asyncSetAuth 设置权限信息
|
|
9
10
|
* @methods clearAuth 清除权限信息
|
|
10
11
|
*/
|
|
@@ -32,12 +33,24 @@ export declare const useAuthStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
32
33
|
workgroup?: string | undefined;
|
|
33
34
|
avatarFileName?: string | undefined;
|
|
34
35
|
} | null>;
|
|
35
|
-
dict: import('vue').Ref<
|
|
36
|
+
dict: import('vue').Ref<[] | Dict, [] | Dict>;
|
|
37
|
+
role: import('vue').Ref<{
|
|
38
|
+
[x: string]: unknown;
|
|
39
|
+
label: string;
|
|
40
|
+
value: string | number;
|
|
41
|
+
permissions?: string[] | undefined;
|
|
42
|
+
}[], Role[] | {
|
|
43
|
+
[x: string]: unknown;
|
|
44
|
+
label: string;
|
|
45
|
+
value: string | number;
|
|
46
|
+
permissions?: string[] | undefined;
|
|
47
|
+
}[]>;
|
|
36
48
|
setUserInfo: (d: User) => void;
|
|
37
49
|
setToken: (d: string) => void;
|
|
38
50
|
setDict: (d: Dict) => void;
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
setRole: (d: Role[]) => void;
|
|
52
|
+
clearAuth: () => void;
|
|
53
|
+
}, "role" | "hasAuthenticated" | "token" | "userInfo" | "dict">, Pick<{
|
|
41
54
|
hasAuthenticated: import('vue').Ref<boolean, boolean>;
|
|
42
55
|
token: import('vue').Ref<string | null, string | null>;
|
|
43
56
|
userInfo: import('vue').Ref<{
|
|
@@ -61,11 +74,23 @@ export declare const useAuthStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
61
74
|
workgroup?: string | undefined;
|
|
62
75
|
avatarFileName?: string | undefined;
|
|
63
76
|
} | null>;
|
|
64
|
-
dict: import('vue').Ref<
|
|
77
|
+
dict: import('vue').Ref<[] | Dict, [] | Dict>;
|
|
78
|
+
role: import('vue').Ref<{
|
|
79
|
+
[x: string]: unknown;
|
|
80
|
+
label: string;
|
|
81
|
+
value: string | number;
|
|
82
|
+
permissions?: string[] | undefined;
|
|
83
|
+
}[], Role[] | {
|
|
84
|
+
[x: string]: unknown;
|
|
85
|
+
label: string;
|
|
86
|
+
value: string | number;
|
|
87
|
+
permissions?: string[] | undefined;
|
|
88
|
+
}[]>;
|
|
65
89
|
setUserInfo: (d: User) => void;
|
|
66
90
|
setToken: (d: string) => void;
|
|
67
91
|
setDict: (d: Dict) => void;
|
|
68
|
-
|
|
92
|
+
setRole: (d: Role[]) => void;
|
|
93
|
+
clearAuth: () => void;
|
|
69
94
|
}, never>, Pick<{
|
|
70
95
|
hasAuthenticated: import('vue').Ref<boolean, boolean>;
|
|
71
96
|
token: import('vue').Ref<string | null, string | null>;
|
|
@@ -90,9 +115,21 @@ export declare const useAuthStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
90
115
|
workgroup?: string | undefined;
|
|
91
116
|
avatarFileName?: string | undefined;
|
|
92
117
|
} | null>;
|
|
93
|
-
dict: import('vue').Ref<
|
|
118
|
+
dict: import('vue').Ref<[] | Dict, [] | Dict>;
|
|
119
|
+
role: import('vue').Ref<{
|
|
120
|
+
[x: string]: unknown;
|
|
121
|
+
label: string;
|
|
122
|
+
value: string | number;
|
|
123
|
+
permissions?: string[] | undefined;
|
|
124
|
+
}[], Role[] | {
|
|
125
|
+
[x: string]: unknown;
|
|
126
|
+
label: string;
|
|
127
|
+
value: string | number;
|
|
128
|
+
permissions?: string[] | undefined;
|
|
129
|
+
}[]>;
|
|
94
130
|
setUserInfo: (d: User) => void;
|
|
95
131
|
setToken: (d: string) => void;
|
|
96
132
|
setDict: (d: Dict) => void;
|
|
97
|
-
|
|
98
|
-
|
|
133
|
+
setRole: (d: Role[]) => void;
|
|
134
|
+
clearAuth: () => void;
|
|
135
|
+
}, "setUserInfo" | "setToken" | "setDict" | "setRole" | "clearAuth">>;
|
|
@@ -67,6 +67,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
67
67
|
redirect?: string | undefined;
|
|
68
68
|
children?: /*elided*/ any[] | undefined;
|
|
69
69
|
}[]>;
|
|
70
|
+
clearMenu: () => void;
|
|
70
71
|
}, "hasFetchedAsyncMenus" | "menus">, Pick<{
|
|
71
72
|
hasFetchedAsyncMenus: import('vue').Ref<boolean, boolean>;
|
|
72
73
|
menus: import('vue').Ref<{
|
|
@@ -128,6 +129,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
128
129
|
redirect?: string | undefined;
|
|
129
130
|
children?: /*elided*/ any[] | undefined;
|
|
130
131
|
}[]>;
|
|
132
|
+
clearMenu: () => void;
|
|
131
133
|
}, never>, Pick<{
|
|
132
134
|
hasFetchedAsyncMenus: import('vue').Ref<boolean, boolean>;
|
|
133
135
|
menus: import('vue').Ref<{
|
|
@@ -189,4 +191,5 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
189
191
|
redirect?: string | undefined;
|
|
190
192
|
children?: /*elided*/ any[] | undefined;
|
|
191
193
|
}[]>;
|
|
192
|
-
|
|
194
|
+
clearMenu: () => void;
|
|
195
|
+
}, "asyncSetMenus" | "clearMenu">>;
|
|
@@ -2,7 +2,7 @@ import { Locale, ThemeMode } from '@jnrs/shared';
|
|
|
2
2
|
type Theme = {
|
|
3
3
|
locale: Locale;
|
|
4
4
|
mode: ThemeMode;
|
|
5
|
-
|
|
5
|
+
primaryColor: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* useSystemStore 系统仓库
|
|
@@ -17,11 +17,11 @@ export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-
|
|
|
17
17
|
theme: import('vue').Ref<{
|
|
18
18
|
locale: Locale;
|
|
19
19
|
mode: ThemeMode;
|
|
20
|
-
|
|
20
|
+
primaryColor: string;
|
|
21
21
|
}, Theme | {
|
|
22
22
|
locale: Locale;
|
|
23
23
|
mode: ThemeMode;
|
|
24
|
-
|
|
24
|
+
primaryColor: string;
|
|
25
25
|
}>;
|
|
26
26
|
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
|
27
27
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
@@ -30,16 +30,16 @@ export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-
|
|
|
30
30
|
toggleFullScreen: () => Promise<void>;
|
|
31
31
|
setLocale: (value: unknown) => void;
|
|
32
32
|
setMode: (value: unknown) => void;
|
|
33
|
-
|
|
33
|
+
setPrimaryColor: (value: unknown) => void;
|
|
34
34
|
}, "theme" | "menuCollapse" | "documentFullscreen">, Pick<{
|
|
35
35
|
theme: import('vue').Ref<{
|
|
36
36
|
locale: Locale;
|
|
37
37
|
mode: ThemeMode;
|
|
38
|
-
|
|
38
|
+
primaryColor: string;
|
|
39
39
|
}, Theme | {
|
|
40
40
|
locale: Locale;
|
|
41
41
|
mode: ThemeMode;
|
|
42
|
-
|
|
42
|
+
primaryColor: string;
|
|
43
43
|
}>;
|
|
44
44
|
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
|
45
45
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
@@ -48,16 +48,16 @@ export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-
|
|
|
48
48
|
toggleFullScreen: () => Promise<void>;
|
|
49
49
|
setLocale: (value: unknown) => void;
|
|
50
50
|
setMode: (value: unknown) => void;
|
|
51
|
-
|
|
51
|
+
setPrimaryColor: (value: unknown) => void;
|
|
52
52
|
}, "computedThemeMode">, Pick<{
|
|
53
53
|
theme: import('vue').Ref<{
|
|
54
54
|
locale: Locale;
|
|
55
55
|
mode: ThemeMode;
|
|
56
|
-
|
|
56
|
+
primaryColor: string;
|
|
57
57
|
}, Theme | {
|
|
58
58
|
locale: Locale;
|
|
59
59
|
mode: ThemeMode;
|
|
60
|
-
|
|
60
|
+
primaryColor: string;
|
|
61
61
|
}>;
|
|
62
62
|
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
|
63
63
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
@@ -66,6 +66,6 @@ export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-
|
|
|
66
66
|
toggleFullScreen: () => Promise<void>;
|
|
67
67
|
setLocale: (value: unknown) => void;
|
|
68
68
|
setMode: (value: unknown) => void;
|
|
69
|
-
|
|
70
|
-
}, "toggleCollapse" | "toggleFullScreen" | "setLocale" | "setMode" | "
|
|
69
|
+
setPrimaryColor: (value: unknown) => void;
|
|
70
|
+
}, "toggleCollapse" | "toggleFullScreen" | "setLocale" | "setMode" | "setPrimaryColor">>;
|
|
71
71
|
export {};
|
package/dist/piniaStore/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "pinia-plugin-persistedstate";
|
|
2
|
-
import { u as t } from "../system-
|
|
3
|
-
import { u, a } from "../index-
|
|
2
|
+
import { u as t } from "../system-KZETuQYC.js";
|
|
3
|
+
import { u, a } from "../index-CfK0PRAy.js";
|
|
4
4
|
export {
|
|
5
5
|
u as useAuthStore,
|
|
6
6
|
a as useMenuStore,
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ref as r, computed as v, watch as d } from "vue";
|
|
2
|
+
import { defineStore as g } from "pinia";
|
|
3
|
+
import { Fullscreen as h } from "@jnrs/shared";
|
|
4
|
+
import { usePreferredDark as b } from "@vueuse/core";
|
|
5
|
+
const O = [
|
|
6
|
+
{ value: "zhCn", label: "@jnrs/vue-core.components.GlobalSetting.languageOptions.zhCn" },
|
|
7
|
+
{ value: "en", label: "@jnrs/vue-core.components.GlobalSetting.languageOptions.en" }
|
|
8
|
+
], y = [
|
|
9
|
+
{ value: "auto", label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.auto" },
|
|
10
|
+
{ value: "light", label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.light" },
|
|
11
|
+
{ value: "dark", label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.dark" }
|
|
12
|
+
], C = [
|
|
13
|
+
{ value: "oklch(0.6 0.19 41)", label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.jnrs" },
|
|
14
|
+
{
|
|
15
|
+
value: "oklch(0.51 0.21 264)",
|
|
16
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.azure"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "oklch(0.90 0.16 98)",
|
|
20
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.moonYellow"
|
|
21
|
+
},
|
|
22
|
+
{ value: "oklch(0.63 0.25 27)", label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.jdRed" },
|
|
23
|
+
{
|
|
24
|
+
value: "oklch(0.65 0.24 33)",
|
|
25
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.taobaoRed"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: "oklch(0.61 0.20 261)",
|
|
29
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.dingtalkBlue"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: "oklch(0.70 0.12 152)",
|
|
33
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.wechatGreen"
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
function f(e) {
|
|
37
|
+
return e === "zhCn" || e === "en";
|
|
38
|
+
}
|
|
39
|
+
function S(e) {
|
|
40
|
+
return e === "light" || e === "dark" || e === "auto";
|
|
41
|
+
}
|
|
42
|
+
function j(e) {
|
|
43
|
+
return typeof e == "string" && e.trim() !== "";
|
|
44
|
+
}
|
|
45
|
+
const z = g(
|
|
46
|
+
"@jnrs/vue-core/pinia:system",
|
|
47
|
+
() => {
|
|
48
|
+
const e = r(!1), c = () => e.value = !e.value, n = new h(), a = r(!1), u = async () => {
|
|
49
|
+
await n.toggle(), a.value = n.isFullscreen();
|
|
50
|
+
}, l = r({
|
|
51
|
+
locale: O[0].value,
|
|
52
|
+
mode: y[0].value,
|
|
53
|
+
primaryColor: C[0].value
|
|
54
|
+
}), m = v(() => l.value.mode === "auto" ? s.value ? "dark" : "light" : l.value.mode), s = b();
|
|
55
|
+
return d(
|
|
56
|
+
[() => l.value.mode, s, () => l.value.primaryColor],
|
|
57
|
+
([o, p, i]) => {
|
|
58
|
+
const t = document.documentElement;
|
|
59
|
+
t.classList.remove("light", "dark"), o === "auto" ? t.classList.add(p ? "dark" : "light") : t.classList.add(o), i ? t.style.setProperty("--jnrs-color-primary", i) : t.style.removeProperty("--jnrs-color-primary");
|
|
60
|
+
},
|
|
61
|
+
{ immediate: !0 }
|
|
62
|
+
), {
|
|
63
|
+
theme: l,
|
|
64
|
+
computedThemeMode: m,
|
|
65
|
+
menuCollapse: e,
|
|
66
|
+
documentFullscreen: a,
|
|
67
|
+
toggleCollapse: c,
|
|
68
|
+
toggleFullScreen: u,
|
|
69
|
+
setLocale: (o) => {
|
|
70
|
+
f(o) && (l.value.locale = o);
|
|
71
|
+
},
|
|
72
|
+
setMode: (o) => {
|
|
73
|
+
S(o) && (l.value.mode = o);
|
|
74
|
+
},
|
|
75
|
+
setPrimaryColor: (o) => {
|
|
76
|
+
j(o) && (l.value.primaryColor = o);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
persist: {
|
|
82
|
+
pick: ["theme", "menuCollapse"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
export {
|
|
87
|
+
C,
|
|
88
|
+
O as L,
|
|
89
|
+
y as M,
|
|
90
|
+
z as u
|
|
91
|
+
};
|
package/dist/vueRouter/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jnrs/vue-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "巨能前端工程化开发,Vue 专用核心功能包。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jnrs",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"import": "./dist/index.js",
|
|
29
29
|
"types": "./dist/index.d.ts"
|
|
30
30
|
},
|
|
31
|
+
"./locales": {
|
|
32
|
+
"import": "./dist/locales/index.js",
|
|
33
|
+
"types": "./dist/locales/index.d.ts"
|
|
34
|
+
},
|
|
31
35
|
"./router": {
|
|
32
36
|
"import": "./dist/vueRouter/index.js",
|
|
33
37
|
"types": "./dist/vueRouter/index.d.ts"
|
|
@@ -52,8 +56,9 @@
|
|
|
52
56
|
"pinia-plugin-persistedstate": "^4.7.1",
|
|
53
57
|
"vue": "^3.5.22",
|
|
54
58
|
"vue-router": "^4.5.1",
|
|
55
|
-
"
|
|
56
|
-
"@jnrs/
|
|
59
|
+
"vue-i18n": "^9.14.5",
|
|
60
|
+
"@jnrs/shared": "1.1.5",
|
|
61
|
+
"@jnrs/core": "1.1.5"
|
|
57
62
|
},
|
|
58
63
|
"devDependencies": {
|
|
59
64
|
"@vitejs/plugin-vue": "^6.0.1",
|
package/dist/index-BEHnZZvl.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import "pinia-plugin-persistedstate";
|
|
2
|
-
import { u as m } from "./system-C18uA6p7.js";
|
|
3
|
-
import { ref as s } from "vue";
|
|
4
|
-
import { defineStore as d } from "pinia";
|
|
5
|
-
import { a as p } from "./index-DEkMXVh9.js";
|
|
6
|
-
const y = d(
|
|
7
|
-
"@jnrs/vue-core/pinia:auth",
|
|
8
|
-
() => {
|
|
9
|
-
const e = s(!1), n = s(null), u = s(null), o = s(null);
|
|
10
|
-
return {
|
|
11
|
-
hasAuthenticated: e,
|
|
12
|
-
token: n,
|
|
13
|
-
userInfo: u,
|
|
14
|
-
dict: o,
|
|
15
|
-
setUserInfo: (a) => {
|
|
16
|
-
u.value = a;
|
|
17
|
-
},
|
|
18
|
-
setToken: (a) => {
|
|
19
|
-
n.value = a, e.value = !0;
|
|
20
|
-
},
|
|
21
|
-
setDict: (a) => {
|
|
22
|
-
o.value = a;
|
|
23
|
-
},
|
|
24
|
-
asyncClearAuth: async () => {
|
|
25
|
-
n.value = null, u.value = null, o.value = null, e.value = !1;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
persist: {
|
|
31
|
-
pick: ["hasAuthenticated", "token", "userInfo", "dict"]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
), t = [];
|
|
35
|
-
for (let e = 0; e < 256; ++e)
|
|
36
|
-
t.push((e + 256).toString(16).slice(1));
|
|
37
|
-
function v(e, n = 0) {
|
|
38
|
-
return (t[e[n + 0]] + t[e[n + 1]] + t[e[n + 2]] + t[e[n + 3]] + "-" + t[e[n + 4]] + t[e[n + 5]] + "-" + t[e[n + 6]] + t[e[n + 7]] + "-" + t[e[n + 8]] + t[e[n + 9]] + "-" + t[e[n + 10]] + t[e[n + 11]] + t[e[n + 12]] + t[e[n + 13]] + t[e[n + 14]] + t[e[n + 15]]).toLowerCase();
|
|
39
|
-
}
|
|
40
|
-
let i;
|
|
41
|
-
const h = new Uint8Array(16);
|
|
42
|
-
function g() {
|
|
43
|
-
if (!i) {
|
|
44
|
-
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
45
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
46
|
-
i = crypto.getRandomValues.bind(crypto);
|
|
47
|
-
}
|
|
48
|
-
return i(h);
|
|
49
|
-
}
|
|
50
|
-
const f = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), l = { randomUUID: f };
|
|
51
|
-
function b(e, n, u) {
|
|
52
|
-
e = e || {};
|
|
53
|
-
const o = e.random ?? e.rng?.() ?? g();
|
|
54
|
-
if (o.length < 16)
|
|
55
|
-
throw new Error("Random bytes length must be >= 16");
|
|
56
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, v(o);
|
|
57
|
-
}
|
|
58
|
-
function U(e, n, u) {
|
|
59
|
-
return l.randomUUID && !e ? l.randomUUID() : b(e);
|
|
60
|
-
}
|
|
61
|
-
const x = d(
|
|
62
|
-
"@jnrs/vue-core/pinia:menu",
|
|
63
|
-
() => {
|
|
64
|
-
const e = s(!1), n = s([]), u = async (c) => {
|
|
65
|
-
if (e.value)
|
|
66
|
-
return n.value;
|
|
67
|
-
o(c), n.value = c, e.value = !0;
|
|
68
|
-
try {
|
|
69
|
-
await p(n.value);
|
|
70
|
-
} catch (r) {
|
|
71
|
-
throw r;
|
|
72
|
-
}
|
|
73
|
-
return n.value;
|
|
74
|
-
}, o = (c) => {
|
|
75
|
-
for (const r of c)
|
|
76
|
-
r.meta.uuid = U(), r.children && o(r.children);
|
|
77
|
-
};
|
|
78
|
-
return { hasFetchedAsyncMenus: e, menus: n, asyncSetMenus: u };
|
|
79
|
-
}
|
|
80
|
-
// {
|
|
81
|
-
// persist: {
|
|
82
|
-
// pick: ['menus']
|
|
83
|
-
// }
|
|
84
|
-
// }
|
|
85
|
-
);
|
|
86
|
-
console.log(
|
|
87
|
-
"%c✨ 欢迎使用 @jnrs/vue-core/pinia",
|
|
88
|
-
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
89
|
-
);
|
|
90
|
-
const R = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
91
|
-
__proto__: null,
|
|
92
|
-
useAuthStore: y,
|
|
93
|
-
useMenuStore: x,
|
|
94
|
-
useSystemStore: m
|
|
95
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
96
|
-
export {
|
|
97
|
-
x as a,
|
|
98
|
-
R as i,
|
|
99
|
-
y as u
|
|
100
|
-
};
|
package/dist/system-C18uA6p7.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ref as a, computed as v, watch as h } from "vue";
|
|
2
|
-
import { defineStore as f } from "pinia";
|
|
3
|
-
import { Fullscreen as p } from "@jnrs/shared";
|
|
4
|
-
import { usePreferredDark as k } from "@vueuse/core";
|
|
5
|
-
const C = [
|
|
6
|
-
{ value: "zhCn", label: "中文" },
|
|
7
|
-
{ value: "en", label: "English" }
|
|
8
|
-
], g = [
|
|
9
|
-
{ value: "auto", label: "跟随系统" },
|
|
10
|
-
{ value: "light", label: "浅色" },
|
|
11
|
-
{ value: "dark", label: "深色" }
|
|
12
|
-
], b = [
|
|
13
|
-
{ value: "oklch(0.6 0.19 41)", label: "JNRS" },
|
|
14
|
-
{ value: "oklch(0.51 0.21 264)", label: "蔚蓝" },
|
|
15
|
-
{ value: "oklch(0.90 0.16 98)", label: "月黄" },
|
|
16
|
-
{ value: "oklch(0.63 0.25 27)", label: "京东红" },
|
|
17
|
-
{ value: "oklch(0.65 0.24 33)", label: "淘宝红" },
|
|
18
|
-
{ value: "oklch(0.61 0.20 261)", label: "钉钉蓝" },
|
|
19
|
-
{ value: "oklch(0.70 0.12 152)", label: "微信绿" }
|
|
20
|
-
];
|
|
21
|
-
function y(e) {
|
|
22
|
-
return e === "zhCn" || e === "en";
|
|
23
|
-
}
|
|
24
|
-
function L(e) {
|
|
25
|
-
return e === "light" || e === "dark" || e === "auto";
|
|
26
|
-
}
|
|
27
|
-
function O(e) {
|
|
28
|
-
return typeof e == "string" && e.trim() !== "";
|
|
29
|
-
}
|
|
30
|
-
const j = f(
|
|
31
|
-
"@jnrs/vue-core/pinia:system",
|
|
32
|
-
() => {
|
|
33
|
-
const e = a(!1), n = () => e.value = !e.value, s = new p(), r = a(!1), i = async () => {
|
|
34
|
-
await s.toggle(), r.value = s.isFullscreen();
|
|
35
|
-
}, o = a({
|
|
36
|
-
locale: C[0].value,
|
|
37
|
-
mode: g[0].value,
|
|
38
|
-
customColor: b[0].value
|
|
39
|
-
}), m = v(() => o.value.mode === "auto" ? u.value ? "dark" : "light" : o.value.mode), u = k();
|
|
40
|
-
return h(
|
|
41
|
-
[() => o.value.mode, u, () => o.value.customColor],
|
|
42
|
-
([l, d, c]) => {
|
|
43
|
-
const t = document.documentElement;
|
|
44
|
-
t.classList.remove("light", "dark"), l === "auto" ? t.classList.add(d ? "dark" : "light") : t.classList.add(l), c ? t.style.setProperty("--jnrs-color-primary", c) : t.style.removeProperty("--jnrs-color-primary");
|
|
45
|
-
},
|
|
46
|
-
{ immediate: !0 }
|
|
47
|
-
), {
|
|
48
|
-
theme: o,
|
|
49
|
-
computedThemeMode: m,
|
|
50
|
-
menuCollapse: e,
|
|
51
|
-
documentFullscreen: r,
|
|
52
|
-
toggleCollapse: n,
|
|
53
|
-
toggleFullScreen: i,
|
|
54
|
-
setLocale: (l) => {
|
|
55
|
-
y(l) && (o.value.locale = l);
|
|
56
|
-
},
|
|
57
|
-
setMode: (l) => {
|
|
58
|
-
L(l) && (o.value.mode = l);
|
|
59
|
-
},
|
|
60
|
-
setCustomColor: (l) => {
|
|
61
|
-
O(l) && (o.value.customColor = l);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
persist: {
|
|
67
|
-
pick: ["theme", "menuCollapse"]
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
export {
|
|
72
|
-
b as C,
|
|
73
|
-
C as L,
|
|
74
|
-
g as M,
|
|
75
|
-
j as u
|
|
76
|
-
};
|