@jnrs/vue-core 1.1.3 → 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/README.md +4 -0
- package/dist/components/index.js +79 -108
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +124 -0
- package/dist/composables/useAsyncTableHeight.d.ts +15 -0
- package/dist/constants/themeOptions.d.ts +48 -0
- 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/lib/guards.d.ts +4 -0
- 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 +123 -26
- package/dist/piniaStore/base/menu.d.ts +13 -1
- package/dist/piniaStore/base/system.d.ts +29 -21
- package/dist/piniaStore/index.js +2 -2
- package/dist/system-KZETuQYC.js +91 -0
- package/dist/vueRouter/index.js +1 -1
- package/dist/vueRouter/types.d.ts +1 -0
- package/package.json +12 -3
- package/dist/index-pLO4r50y.js +0 -94
- package/dist/system-DSegwP0Z.js +0 -1644
|
@@ -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,38 +1,135 @@
|
|
|
1
|
-
import { Dict, User } from '@jnrs/shared';
|
|
2
|
-
interface Auth {
|
|
3
|
-
token: string;
|
|
4
|
-
userInfo: User;
|
|
5
|
-
dict: Dict;
|
|
6
|
-
}
|
|
1
|
+
import { Dict, User, Role } from '@jnrs/shared';
|
|
7
2
|
/**
|
|
8
3
|
* useAuthStore 权限仓库
|
|
9
|
-
* @returns hasAuthenticated
|
|
10
|
-
* @returns token
|
|
4
|
+
* @returns hasAuthenticated 是否已身份验证
|
|
5
|
+
* @returns token 身份验证凭证
|
|
11
6
|
* @returns userInfo 用户信息
|
|
12
7
|
* @returns dict 字典
|
|
8
|
+
* @returns role 角色权限
|
|
13
9
|
* @methods asyncSetAuth 设置权限信息
|
|
14
10
|
* @methods clearAuth 清除权限信息
|
|
15
11
|
*/
|
|
16
12
|
export declare const useAuthStore: import('pinia').StoreDefinition<"@jnrs/vue-core/pinia:auth", Pick<{
|
|
17
13
|
hasAuthenticated: import('vue').Ref<boolean, boolean>;
|
|
18
|
-
token: import('vue').Ref<string |
|
|
19
|
-
userInfo: import('vue').Ref<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
token: import('vue').Ref<string | null, string | null>;
|
|
15
|
+
userInfo: import('vue').Ref<{
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
role: number;
|
|
20
|
+
permissions?: string[] | undefined;
|
|
21
|
+
jobTitle?: number | undefined;
|
|
22
|
+
workNo?: string | undefined;
|
|
23
|
+
workgroup?: string | undefined;
|
|
24
|
+
avatarFileName?: string | undefined;
|
|
25
|
+
} | null, User | {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
id: number;
|
|
28
|
+
name: string;
|
|
29
|
+
role: number;
|
|
30
|
+
permissions?: string[] | undefined;
|
|
31
|
+
jobTitle?: number | undefined;
|
|
32
|
+
workNo?: string | undefined;
|
|
33
|
+
workgroup?: string | undefined;
|
|
34
|
+
avatarFileName?: string | undefined;
|
|
35
|
+
} | null>;
|
|
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
|
+
}[]>;
|
|
48
|
+
setUserInfo: (d: User) => void;
|
|
49
|
+
setToken: (d: string) => void;
|
|
50
|
+
setDict: (d: Dict) => void;
|
|
51
|
+
setRole: (d: Role[]) => void;
|
|
52
|
+
clearAuth: () => void;
|
|
53
|
+
}, "role" | "hasAuthenticated" | "token" | "userInfo" | "dict">, Pick<{
|
|
24
54
|
hasAuthenticated: import('vue').Ref<boolean, boolean>;
|
|
25
|
-
token: import('vue').Ref<string |
|
|
26
|
-
userInfo: import('vue').Ref<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
55
|
+
token: import('vue').Ref<string | null, string | null>;
|
|
56
|
+
userInfo: import('vue').Ref<{
|
|
57
|
+
[x: string]: unknown;
|
|
58
|
+
id: number;
|
|
59
|
+
name: string;
|
|
60
|
+
role: number;
|
|
61
|
+
permissions?: string[] | undefined;
|
|
62
|
+
jobTitle?: number | undefined;
|
|
63
|
+
workNo?: string | undefined;
|
|
64
|
+
workgroup?: string | undefined;
|
|
65
|
+
avatarFileName?: string | undefined;
|
|
66
|
+
} | null, User | {
|
|
67
|
+
[x: string]: unknown;
|
|
68
|
+
id: number;
|
|
69
|
+
name: string;
|
|
70
|
+
role: number;
|
|
71
|
+
permissions?: string[] | undefined;
|
|
72
|
+
jobTitle?: number | undefined;
|
|
73
|
+
workNo?: string | undefined;
|
|
74
|
+
workgroup?: string | undefined;
|
|
75
|
+
avatarFileName?: string | undefined;
|
|
76
|
+
} | null>;
|
|
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
|
+
}[]>;
|
|
89
|
+
setUserInfo: (d: User) => void;
|
|
90
|
+
setToken: (d: string) => void;
|
|
91
|
+
setDict: (d: Dict) => void;
|
|
92
|
+
setRole: (d: Role[]) => void;
|
|
93
|
+
clearAuth: () => void;
|
|
30
94
|
}, never>, Pick<{
|
|
31
95
|
hasAuthenticated: import('vue').Ref<boolean, boolean>;
|
|
32
|
-
token: import('vue').Ref<string |
|
|
33
|
-
userInfo: import('vue').Ref<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
96
|
+
token: import('vue').Ref<string | null, string | null>;
|
|
97
|
+
userInfo: import('vue').Ref<{
|
|
98
|
+
[x: string]: unknown;
|
|
99
|
+
id: number;
|
|
100
|
+
name: string;
|
|
101
|
+
role: number;
|
|
102
|
+
permissions?: string[] | undefined;
|
|
103
|
+
jobTitle?: number | undefined;
|
|
104
|
+
workNo?: string | undefined;
|
|
105
|
+
workgroup?: string | undefined;
|
|
106
|
+
avatarFileName?: string | undefined;
|
|
107
|
+
} | null, User | {
|
|
108
|
+
[x: string]: unknown;
|
|
109
|
+
id: number;
|
|
110
|
+
name: string;
|
|
111
|
+
role: number;
|
|
112
|
+
permissions?: string[] | undefined;
|
|
113
|
+
jobTitle?: number | undefined;
|
|
114
|
+
workNo?: string | undefined;
|
|
115
|
+
workgroup?: string | undefined;
|
|
116
|
+
avatarFileName?: string | undefined;
|
|
117
|
+
} | null>;
|
|
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
|
+
}[]>;
|
|
130
|
+
setUserInfo: (d: User) => void;
|
|
131
|
+
setToken: (d: string) => void;
|
|
132
|
+
setDict: (d: Dict) => void;
|
|
133
|
+
setRole: (d: Role[]) => void;
|
|
134
|
+
clearAuth: () => void;
|
|
135
|
+
}, "setUserInfo" | "setToken" | "setDict" | "setRole" | "clearAuth">>;
|
|
@@ -20,6 +20,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
20
20
|
global?: boolean | undefined;
|
|
21
21
|
fullPathTitle?: string | undefined;
|
|
22
22
|
todoCount?: number | undefined;
|
|
23
|
+
permissions?: [] | undefined;
|
|
23
24
|
};
|
|
24
25
|
path: string;
|
|
25
26
|
name?: string | undefined;
|
|
@@ -38,6 +39,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
38
39
|
global?: boolean | undefined;
|
|
39
40
|
fullPathTitle?: string | undefined;
|
|
40
41
|
todoCount?: number | undefined;
|
|
42
|
+
permissions?: [] | undefined;
|
|
41
43
|
};
|
|
42
44
|
path: string;
|
|
43
45
|
name?: string | undefined;
|
|
@@ -57,6 +59,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
57
59
|
global?: boolean | undefined;
|
|
58
60
|
fullPathTitle?: string | undefined;
|
|
59
61
|
todoCount?: number | undefined;
|
|
62
|
+
permissions?: [] | undefined;
|
|
60
63
|
};
|
|
61
64
|
path: string;
|
|
62
65
|
name?: string | undefined;
|
|
@@ -64,6 +67,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
64
67
|
redirect?: string | undefined;
|
|
65
68
|
children?: /*elided*/ any[] | undefined;
|
|
66
69
|
}[]>;
|
|
70
|
+
clearMenu: () => void;
|
|
67
71
|
}, "hasFetchedAsyncMenus" | "menus">, Pick<{
|
|
68
72
|
hasFetchedAsyncMenus: import('vue').Ref<boolean, boolean>;
|
|
69
73
|
menus: import('vue').Ref<{
|
|
@@ -78,6 +82,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
78
82
|
global?: boolean | undefined;
|
|
79
83
|
fullPathTitle?: string | undefined;
|
|
80
84
|
todoCount?: number | undefined;
|
|
85
|
+
permissions?: [] | undefined;
|
|
81
86
|
};
|
|
82
87
|
path: string;
|
|
83
88
|
name?: string | undefined;
|
|
@@ -96,6 +101,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
96
101
|
global?: boolean | undefined;
|
|
97
102
|
fullPathTitle?: string | undefined;
|
|
98
103
|
todoCount?: number | undefined;
|
|
104
|
+
permissions?: [] | undefined;
|
|
99
105
|
};
|
|
100
106
|
path: string;
|
|
101
107
|
name?: string | undefined;
|
|
@@ -115,6 +121,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
115
121
|
global?: boolean | undefined;
|
|
116
122
|
fullPathTitle?: string | undefined;
|
|
117
123
|
todoCount?: number | undefined;
|
|
124
|
+
permissions?: [] | undefined;
|
|
118
125
|
};
|
|
119
126
|
path: string;
|
|
120
127
|
name?: string | undefined;
|
|
@@ -122,6 +129,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
122
129
|
redirect?: string | undefined;
|
|
123
130
|
children?: /*elided*/ any[] | undefined;
|
|
124
131
|
}[]>;
|
|
132
|
+
clearMenu: () => void;
|
|
125
133
|
}, never>, Pick<{
|
|
126
134
|
hasFetchedAsyncMenus: import('vue').Ref<boolean, boolean>;
|
|
127
135
|
menus: import('vue').Ref<{
|
|
@@ -136,6 +144,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
136
144
|
global?: boolean | undefined;
|
|
137
145
|
fullPathTitle?: string | undefined;
|
|
138
146
|
todoCount?: number | undefined;
|
|
147
|
+
permissions?: [] | undefined;
|
|
139
148
|
};
|
|
140
149
|
path: string;
|
|
141
150
|
name?: string | undefined;
|
|
@@ -154,6 +163,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
154
163
|
global?: boolean | undefined;
|
|
155
164
|
fullPathTitle?: string | undefined;
|
|
156
165
|
todoCount?: number | undefined;
|
|
166
|
+
permissions?: [] | undefined;
|
|
157
167
|
};
|
|
158
168
|
path: string;
|
|
159
169
|
name?: string | undefined;
|
|
@@ -173,6 +183,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
173
183
|
global?: boolean | undefined;
|
|
174
184
|
fullPathTitle?: string | undefined;
|
|
175
185
|
todoCount?: number | undefined;
|
|
186
|
+
permissions?: [] | undefined;
|
|
176
187
|
};
|
|
177
188
|
path: string;
|
|
178
189
|
name?: string | undefined;
|
|
@@ -180,4 +191,5 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
180
191
|
redirect?: string | undefined;
|
|
181
192
|
children?: /*elided*/ any[] | undefined;
|
|
182
193
|
}[]>;
|
|
183
|
-
|
|
194
|
+
clearMenu: () => void;
|
|
195
|
+
}, "asyncSetMenus" | "clearMenu">>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
type ThemeMode = 'light' | 'dark' | 'auto';
|
|
1
|
+
import { Locale, ThemeMode } from '@jnrs/shared';
|
|
3
2
|
type Theme = {
|
|
4
|
-
locale:
|
|
3
|
+
locale: Locale;
|
|
5
4
|
mode: ThemeMode;
|
|
6
|
-
|
|
5
|
+
primaryColor: string;
|
|
7
6
|
};
|
|
8
7
|
/**
|
|
9
8
|
* useSystemStore 系统仓库
|
|
@@ -16,48 +15,57 @@ type Theme = {
|
|
|
16
15
|
*/
|
|
17
16
|
export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-core/pinia:system", Pick<{
|
|
18
17
|
theme: import('vue').Ref<{
|
|
19
|
-
locale:
|
|
18
|
+
locale: Locale;
|
|
20
19
|
mode: ThemeMode;
|
|
21
|
-
|
|
20
|
+
primaryColor: string;
|
|
22
21
|
}, Theme | {
|
|
23
|
-
locale:
|
|
22
|
+
locale: Locale;
|
|
24
23
|
mode: ThemeMode;
|
|
25
|
-
|
|
24
|
+
primaryColor: string;
|
|
26
25
|
}>;
|
|
26
|
+
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
|
27
27
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
28
28
|
documentFullscreen: import('vue').Ref<boolean, boolean>;
|
|
29
29
|
toggleCollapse: () => boolean;
|
|
30
30
|
toggleFullScreen: () => Promise<void>;
|
|
31
|
-
|
|
31
|
+
setLocale: (value: unknown) => void;
|
|
32
|
+
setMode: (value: unknown) => void;
|
|
33
|
+
setPrimaryColor: (value: unknown) => void;
|
|
32
34
|
}, "theme" | "menuCollapse" | "documentFullscreen">, Pick<{
|
|
33
35
|
theme: import('vue').Ref<{
|
|
34
|
-
locale:
|
|
36
|
+
locale: Locale;
|
|
35
37
|
mode: ThemeMode;
|
|
36
|
-
|
|
38
|
+
primaryColor: string;
|
|
37
39
|
}, Theme | {
|
|
38
|
-
locale:
|
|
40
|
+
locale: Locale;
|
|
39
41
|
mode: ThemeMode;
|
|
40
|
-
|
|
42
|
+
primaryColor: string;
|
|
41
43
|
}>;
|
|
44
|
+
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
|
42
45
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
43
46
|
documentFullscreen: import('vue').Ref<boolean, boolean>;
|
|
44
47
|
toggleCollapse: () => boolean;
|
|
45
48
|
toggleFullScreen: () => Promise<void>;
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
setLocale: (value: unknown) => void;
|
|
50
|
+
setMode: (value: unknown) => void;
|
|
51
|
+
setPrimaryColor: (value: unknown) => void;
|
|
52
|
+
}, "computedThemeMode">, Pick<{
|
|
48
53
|
theme: import('vue').Ref<{
|
|
49
|
-
locale:
|
|
54
|
+
locale: Locale;
|
|
50
55
|
mode: ThemeMode;
|
|
51
|
-
|
|
56
|
+
primaryColor: string;
|
|
52
57
|
}, Theme | {
|
|
53
|
-
locale:
|
|
58
|
+
locale: Locale;
|
|
54
59
|
mode: ThemeMode;
|
|
55
|
-
|
|
60
|
+
primaryColor: string;
|
|
56
61
|
}>;
|
|
62
|
+
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
|
57
63
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
58
64
|
documentFullscreen: import('vue').Ref<boolean, boolean>;
|
|
59
65
|
toggleCollapse: () => boolean;
|
|
60
66
|
toggleFullScreen: () => Promise<void>;
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
setLocale: (value: unknown) => void;
|
|
68
|
+
setMode: (value: unknown) => void;
|
|
69
|
+
setPrimaryColor: (value: unknown) => void;
|
|
70
|
+
}, "toggleCollapse" | "toggleFullScreen" | "setLocale" | "setMode" | "setPrimaryColor">>;
|
|
63
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"
|
|
@@ -39,6 +43,10 @@
|
|
|
39
43
|
"./components": {
|
|
40
44
|
"import": "./dist/components/index.js",
|
|
41
45
|
"types": "./dist/components/index.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./composables": {
|
|
48
|
+
"import": "./dist/composables/index.js",
|
|
49
|
+
"types": "./dist/composables/index.d.ts"
|
|
42
50
|
}
|
|
43
51
|
},
|
|
44
52
|
"peerDependencies": {
|
|
@@ -48,8 +56,9 @@
|
|
|
48
56
|
"pinia-plugin-persistedstate": "^4.7.1",
|
|
49
57
|
"vue": "^3.5.22",
|
|
50
58
|
"vue-router": "^4.5.1",
|
|
51
|
-
"
|
|
52
|
-
"@jnrs/shared": "1.1.
|
|
59
|
+
"vue-i18n": "^9.14.5",
|
|
60
|
+
"@jnrs/shared": "1.1.5",
|
|
61
|
+
"@jnrs/core": "1.1.5"
|
|
53
62
|
},
|
|
54
63
|
"devDependencies": {
|
|
55
64
|
"@vitejs/plugin-vue": "^6.0.1",
|
package/dist/index-pLO4r50y.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import "pinia-plugin-persistedstate";
|
|
2
|
-
import { u as m } from "./system-DSegwP0Z.js";
|
|
3
|
-
import { ref as i } from "vue";
|
|
4
|
-
import { defineStore as l } from "pinia";
|
|
5
|
-
import { a as p } from "./index-DEkMXVh9.js";
|
|
6
|
-
const y = l(
|
|
7
|
-
"@jnrs/vue-core/pinia:auth",
|
|
8
|
-
() => {
|
|
9
|
-
const e = i(!1), n = i(), u = i(), o = i();
|
|
10
|
-
return {
|
|
11
|
-
hasAuthenticated: e,
|
|
12
|
-
token: n,
|
|
13
|
-
userInfo: u,
|
|
14
|
-
dict: o,
|
|
15
|
-
asyncSetAuth: async (c) => {
|
|
16
|
-
e.value = !0, c.token && (n.value = c.token), c.userInfo && (u.value = c.userInfo), c.dict && (o.value = c.dict);
|
|
17
|
-
},
|
|
18
|
-
asyncClearAuth: async () => {
|
|
19
|
-
e.value = !1, n.value = void 0, u.value = void 0, o.value = void 0;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
persist: {
|
|
25
|
-
pick: ["hasAuthenticated", "token", "userInfo", "dict"]
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
), t = [];
|
|
29
|
-
for (let e = 0; e < 256; ++e)
|
|
30
|
-
t.push((e + 256).toString(16).slice(1));
|
|
31
|
-
function v(e, n = 0) {
|
|
32
|
-
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();
|
|
33
|
-
}
|
|
34
|
-
let a;
|
|
35
|
-
const h = new Uint8Array(16);
|
|
36
|
-
function f() {
|
|
37
|
-
if (!a) {
|
|
38
|
-
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
39
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
40
|
-
a = crypto.getRandomValues.bind(crypto);
|
|
41
|
-
}
|
|
42
|
-
return a(h);
|
|
43
|
-
}
|
|
44
|
-
const g = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), d = { randomUUID: g };
|
|
45
|
-
function b(e, n, u) {
|
|
46
|
-
e = e || {};
|
|
47
|
-
const o = e.random ?? e.rng?.() ?? f();
|
|
48
|
-
if (o.length < 16)
|
|
49
|
-
throw new Error("Random bytes length must be >= 16");
|
|
50
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, v(o);
|
|
51
|
-
}
|
|
52
|
-
function S(e, n, u) {
|
|
53
|
-
return d.randomUUID && !e ? d.randomUUID() : b(e);
|
|
54
|
-
}
|
|
55
|
-
const U = l(
|
|
56
|
-
"@jnrs/vue-core/pinia:menu",
|
|
57
|
-
() => {
|
|
58
|
-
const e = i(!1), n = i([]), u = async (s) => {
|
|
59
|
-
if (e.value)
|
|
60
|
-
return n.value;
|
|
61
|
-
o(s), n.value = s, e.value = !0;
|
|
62
|
-
try {
|
|
63
|
-
await p(n.value);
|
|
64
|
-
} catch (r) {
|
|
65
|
-
throw r;
|
|
66
|
-
}
|
|
67
|
-
return n.value;
|
|
68
|
-
}, o = (s) => {
|
|
69
|
-
for (const r of s)
|
|
70
|
-
r.meta.uuid = S(), r.children && o(r.children);
|
|
71
|
-
};
|
|
72
|
-
return { hasFetchedAsyncMenus: e, menus: n, asyncSetMenus: u };
|
|
73
|
-
}
|
|
74
|
-
// {
|
|
75
|
-
// persist: {
|
|
76
|
-
// pick: ['menus']
|
|
77
|
-
// }
|
|
78
|
-
// }
|
|
79
|
-
);
|
|
80
|
-
console.log(
|
|
81
|
-
"%c✨ 欢迎使用 @jnrs/vue-core/pinia",
|
|
82
|
-
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
83
|
-
);
|
|
84
|
-
const k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
85
|
-
__proto__: null,
|
|
86
|
-
useAuthStore: y,
|
|
87
|
-
useMenuStore: U,
|
|
88
|
-
useSystemStore: m
|
|
89
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
90
|
-
export {
|
|
91
|
-
U as a,
|
|
92
|
-
k as i,
|
|
93
|
-
y as u
|
|
94
|
-
};
|