@jnrs/vue-core 1.1.3 → 1.1.4
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 +77 -106
- 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-pLO4r50y.js → index-BEHnZZvl.js} +33 -27
- package/dist/index.js +1 -1
- package/dist/lib/guards.d.ts +4 -0
- package/dist/piniaStore/base/auth.d.ts +81 -21
- package/dist/piniaStore/base/menu.d.ts +9 -0
- package/dist/piniaStore/base/system.d.ts +29 -21
- package/dist/piniaStore/index.js +2 -2
- package/dist/system-C18uA6p7.js +76 -0
- package/dist/vueRouter/types.d.ts +1 -0
- package/package.json +7 -3
- package/dist/system-DSegwP0Z.js +0 -1644
|
@@ -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;
|
|
@@ -78,6 +81,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
78
81
|
global?: boolean | undefined;
|
|
79
82
|
fullPathTitle?: string | undefined;
|
|
80
83
|
todoCount?: number | undefined;
|
|
84
|
+
permissions?: [] | undefined;
|
|
81
85
|
};
|
|
82
86
|
path: string;
|
|
83
87
|
name?: string | undefined;
|
|
@@ -96,6 +100,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
96
100
|
global?: boolean | undefined;
|
|
97
101
|
fullPathTitle?: string | undefined;
|
|
98
102
|
todoCount?: number | undefined;
|
|
103
|
+
permissions?: [] | undefined;
|
|
99
104
|
};
|
|
100
105
|
path: string;
|
|
101
106
|
name?: string | undefined;
|
|
@@ -115,6 +120,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
115
120
|
global?: boolean | undefined;
|
|
116
121
|
fullPathTitle?: string | undefined;
|
|
117
122
|
todoCount?: number | undefined;
|
|
123
|
+
permissions?: [] | undefined;
|
|
118
124
|
};
|
|
119
125
|
path: string;
|
|
120
126
|
name?: string | undefined;
|
|
@@ -136,6 +142,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
136
142
|
global?: boolean | undefined;
|
|
137
143
|
fullPathTitle?: string | undefined;
|
|
138
144
|
todoCount?: number | undefined;
|
|
145
|
+
permissions?: [] | undefined;
|
|
139
146
|
};
|
|
140
147
|
path: string;
|
|
141
148
|
name?: string | undefined;
|
|
@@ -154,6 +161,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
154
161
|
global?: boolean | undefined;
|
|
155
162
|
fullPathTitle?: string | undefined;
|
|
156
163
|
todoCount?: number | undefined;
|
|
164
|
+
permissions?: [] | undefined;
|
|
157
165
|
};
|
|
158
166
|
path: string;
|
|
159
167
|
name?: string | undefined;
|
|
@@ -173,6 +181,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
173
181
|
global?: boolean | undefined;
|
|
174
182
|
fullPathTitle?: string | undefined;
|
|
175
183
|
todoCount?: number | undefined;
|
|
184
|
+
permissions?: [] | undefined;
|
|
176
185
|
};
|
|
177
186
|
path: string;
|
|
178
187
|
name?: string | undefined;
|
|
@@ -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
|
-
customColor
|
|
5
|
+
customColor: 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
|
-
customColor
|
|
20
|
+
customColor: string;
|
|
22
21
|
}, Theme | {
|
|
23
|
-
locale:
|
|
22
|
+
locale: Locale;
|
|
24
23
|
mode: ThemeMode;
|
|
25
|
-
customColor
|
|
24
|
+
customColor: 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
|
+
setCustomColor: (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
|
-
customColor
|
|
38
|
+
customColor: string;
|
|
37
39
|
}, Theme | {
|
|
38
|
-
locale:
|
|
40
|
+
locale: Locale;
|
|
39
41
|
mode: ThemeMode;
|
|
40
|
-
customColor
|
|
42
|
+
customColor: 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
|
+
setCustomColor: (value: unknown) => void;
|
|
52
|
+
}, "computedThemeMode">, Pick<{
|
|
48
53
|
theme: import('vue').Ref<{
|
|
49
|
-
locale:
|
|
54
|
+
locale: Locale;
|
|
50
55
|
mode: ThemeMode;
|
|
51
|
-
customColor
|
|
56
|
+
customColor: string;
|
|
52
57
|
}, Theme | {
|
|
53
|
-
locale:
|
|
58
|
+
locale: Locale;
|
|
54
59
|
mode: ThemeMode;
|
|
55
|
-
customColor
|
|
60
|
+
customColor: 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
|
+
setCustomColor: (value: unknown) => void;
|
|
70
|
+
}, "toggleCollapse" | "toggleFullScreen" | "setLocale" | "setMode" | "setCustomColor">>;
|
|
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-C18uA6p7.js";
|
|
3
|
+
import { u, a } from "../index-BEHnZZvl.js";
|
|
4
4
|
export {
|
|
5
5
|
u as useAuthStore,
|
|
6
6
|
a as useMenuStore,
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jnrs/vue-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "巨能前端工程化开发,Vue 专用核心功能包。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jnrs",
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"./components": {
|
|
40
40
|
"import": "./dist/components/index.js",
|
|
41
41
|
"types": "./dist/components/index.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./composables": {
|
|
44
|
+
"import": "./dist/composables/index.js",
|
|
45
|
+
"types": "./dist/composables/index.d.ts"
|
|
42
46
|
}
|
|
43
47
|
},
|
|
44
48
|
"peerDependencies": {
|
|
@@ -48,8 +52,8 @@
|
|
|
48
52
|
"pinia-plugin-persistedstate": "^4.7.1",
|
|
49
53
|
"vue": "^3.5.22",
|
|
50
54
|
"vue-router": "^4.5.1",
|
|
51
|
-
"@jnrs/
|
|
52
|
-
"@jnrs/
|
|
55
|
+
"@jnrs/shared": "1.1.4",
|
|
56
|
+
"@jnrs/core": "1.1.3"
|
|
53
57
|
},
|
|
54
58
|
"devDependencies": {
|
|
55
59
|
"@vitejs/plugin-vue": "^6.0.1",
|