@jnrs/vue-core 1.1.4 → 1.1.6
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/README.md +4 -0
- package/dist/components/index.js +46 -46
- package/dist/constants/themeOptions.d.ts +12 -12
- package/dist/index-9Ug4oygq.js +116 -0
- package/dist/{index-DEkMXVh9.js → index-Ci9uljtG.js} +3 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3275 -4
- 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.d.ts +1 -0
- package/dist/piniaStore/index.js +6 -5
- package/dist/piniaStore/mock.d.ts +11 -0
- package/dist/request/axios.d.ts +6 -0
- package/dist/request/fetch.d.ts +0 -0
- package/dist/system-KZETuQYC.js +91 -0
- package/dist/utils/index.d.ts +0 -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
|
@@ -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<Dict |
|
|
36
|
+
dict: import('vue').Ref<Dict | undefined, Dict | undefined>;
|
|
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<Dict |
|
|
77
|
+
dict: import('vue').Ref<Dict | undefined, Dict | undefined>;
|
|
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<Dict |
|
|
118
|
+
dict: import('vue').Ref<Dict | undefined, Dict | undefined>;
|
|
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,8 +1,9 @@
|
|
|
1
1
|
import "pinia-plugin-persistedstate";
|
|
2
|
-
import {
|
|
3
|
-
import { u
|
|
2
|
+
import { a as s, b as t, u } from "../index-9Ug4oygq.js";
|
|
3
|
+
import { u as S } from "../system-KZETuQYC.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
s as useAuthStore,
|
|
6
|
+
t as useMenuStore,
|
|
7
|
+
u as useMockStore,
|
|
8
|
+
S as useSystemStore
|
|
8
9
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock仓库
|
|
3
|
+
* @returns isMock 是否使用mock数据
|
|
4
|
+
*/
|
|
5
|
+
export declare const useMockStore: import('pinia').StoreDefinition<"jnrs-app-mock", Pick<{
|
|
6
|
+
isMock: import('vue').Ref<boolean, boolean>;
|
|
7
|
+
}, "isMock">, Pick<{
|
|
8
|
+
isMock: import('vue').Ref<boolean, boolean>;
|
|
9
|
+
}, never>, Pick<{
|
|
10
|
+
isMock: import('vue').Ref<boolean, boolean>;
|
|
11
|
+
}, never>>;
|
|
File without changes
|
|
@@ -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
|
+
};
|
|
File without changes
|
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.6",
|
|
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.6",
|
|
61
|
+
"@jnrs/core": "1.1.6"
|
|
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
|
-
};
|