@done-coding/admin-core 0.8.2 → 0.9.0
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/es/bridge/config-hook.mjs +37 -0
- package/es/bridge/index.mjs +157 -62
- package/es/bridge/plugin.mjs +29 -0
- package/es/bridge/theme.mjs +62 -0
- package/es/components/app-layout/AppBody.vue.mjs +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +47 -49
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
- package/es/components/app-layout/AppFooter.vue.mjs +2 -2
- package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
- package/es/components/app-layout/AppTheme.vue.mjs +7 -0
- package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +36 -36
- package/es/components/display/ActionConfirm.vue2.mjs +16 -16
- package/es/components/display/HeightProvider.vue.mjs +10 -10
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +34 -34
- package/es/components/display/TabsMain.vue.mjs +40 -39
- package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
- package/es/components/form/FormItem.vue.mjs +1 -1
- package/es/components/form/FormItem.vue2.mjs +75 -81
- package/es/components/form/FormMain.vue.mjs +81 -88
- package/es/components/form/FormRadioGroup.vue.mjs +42 -49
- package/es/components/form/FormSearch.vue.mjs +1 -1
- package/es/components/form/FormSearch.vue2.mjs +116 -123
- package/es/components/form/FormSelect.vue.mjs +34 -40
- package/es/components/form/FormSubmitBtn.vue.mjs +24 -35
- package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue2.mjs +75 -55
- package/es/components/form/FormTree.vue.mjs +16 -21
- package/es/components/form/FormVerifyCode.vue.mjs +37 -43
- package/es/components/form/FormVerifyImage.vue.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
- package/es/components/form/use-form-submit.mjs +21 -0
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +134 -139
- package/es/components/menu/MenuItemSub.vue.mjs +41 -48
- package/es/components/menu/MenuTree.vue.mjs +58 -65
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
- package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
- package/es/components/modal/ConfirmModal.vue.mjs +3 -3
- package/es/components/modal/ConfirmModal.vue2.mjs +93 -100
- package/es/components/modal/DetailModal.vue.mjs +38 -41
- package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
- package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
- package/es/components/panel/PanelMain.vue.mjs +2 -2
- package/es/components/panel/PanelMain.vue2.mjs +67 -74
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +221 -229
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +115 -126
- package/es/hooks/use-admin-theme-apply.mjs +84 -0
- package/es/hooks/use-admin-viewport-apply.mjs +27 -0
- package/es/index.mjs +125 -117
- package/es/inject/key.mjs +7 -4
- package/es/store/app.mjs +75 -84
- package/es/style.css +1 -1
- package/es/utils/theme-scale.mjs +37 -0
- package/package.json +2 -4
- package/types/bridge/config-hook.d.ts +91 -0
- package/types/bridge/index.d.ts +110 -10
- package/types/bridge/plugin.d.ts +39 -0
- package/types/bridge/theme.d.ts +66 -0
- package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
- package/types/components/app-layout/types.d.ts +1 -1
- package/types/components/form/FormItem.vue.d.ts +12 -12
- package/types/components/form/FormSubmitPanel.vue.d.ts +4 -0
- package/types/components/form/FormTree.vue.d.ts +50 -50
- package/types/components/form/types.d.ts +17 -0
- package/types/components/form/use-form-submit.d.ts +25 -0
- package/types/components/menu/MenuTree.vue.d.ts +10 -10
- package/types/components/modal/ModalShelf.vue.d.ts +1 -1
- package/types/components/table/TableMain.vue.d.ts +1 -1
- package/types/hooks/activated.d.ts +2 -2
- package/types/hooks/feel-size.d.ts +1 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +5 -5
- package/types/hooks/use-admin-theme-apply.d.ts +17 -0
- package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
- package/types/hooks/use-breakpoint.d.ts +1 -1
- package/types/inject/key.d.ts +18 -0
- package/types/store/app.d.ts +138 -59
- package/types/store/user.d.ts +3 -3
- package/types/utils/index.d.ts +1 -0
- package/types/utils/theme-scale.d.ts +35 -0
package/types/inject/key.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InjectionKey } from 'vue';
|
|
2
|
+
import { AdminBridge } from '../bridge';
|
|
2
3
|
import { ModalLevel, ShelfController } from '../components/modal';
|
|
3
4
|
import { AppLayoutAppStoreSlice, AppLayoutUserStoreSlice, AppLayoutBridgeSlice } from '../components/app-layout';
|
|
4
5
|
/**
|
|
@@ -52,3 +53,20 @@ export declare const APP_LAYOUT_USER_STORE_KEY: InjectionKey<AppLayoutUserStoreS
|
|
|
52
53
|
* Symbol.for 保证跨包同一性(同 APP_LAYOUT_APP_STORE_KEY / APP_LAYOUT_USER_STORE_KEY)。
|
|
53
54
|
*/
|
|
54
55
|
export declare const APP_LAYOUT_BRIDGE_KEY: InjectionKey<AppLayoutBridgeSlice>;
|
|
56
|
+
/**
|
|
57
|
+
* 整 admin bridge app 级注入 key(#插件系统一期挂载)。
|
|
58
|
+
* ---
|
|
59
|
+
* `bridge.install(app)`(即 `app.use(bridge)`)经 `app.provide(ADMIN_BRIDGE_KEY, bridge)`
|
|
60
|
+
* 把**整个 bridge 实例**注入应用级 provide 链;任意后代组件经 `inject(ADMIN_BRIDGE_KEY)`
|
|
61
|
+
* 取整 bridge(含 7 响应式只读配置视图 + `update` + 全部 auth/api/派生方法)。
|
|
62
|
+
* ---
|
|
63
|
+
* **opt-in**:仅当 app 显式 `app.use(bridge)` 时注入;未 use 则 `inject(ADMIN_BRIDGE_KEY)`
|
|
64
|
+
* 返回 `undefined`(不报错)。
|
|
65
|
+
* ---
|
|
66
|
+
* **区别于 `APP_LAYOUT_BRIDGE_KEY`**:后者是 AppLayout 族**组件级**窄切片(`AppLayoutBridgeSlice`
|
|
67
|
+
* Pick 子集,由 AppLayout 从 `props.adminBridge` 接收后 provide,供 layout 子组件 inject),
|
|
68
|
+
* 两 KEY 各管各、并存——本 KEY 注入的是 app 级**整 bridge**,非 layout 窄切片。
|
|
69
|
+
* ---
|
|
70
|
+
* Symbol.for 保证跨包/跨 chunk/跨 ESM 实例唯一(同 APP_LAYOUT_BRIDGE_KEY,规则 8)。
|
|
71
|
+
*/
|
|
72
|
+
export declare const ADMIN_BRIDGE_KEY: InjectionKey<AdminBridge>;
|
package/types/store/app.d.ts
CHANGED
|
@@ -9,139 +9,218 @@ import { AdminBridge } from '../bridge';
|
|
|
9
9
|
* #C 期:删第 3 泛型 RefreshTokenParams 透传(bridge 签名已删第 3 泛型)。
|
|
10
10
|
*/
|
|
11
11
|
export interface CreateAppStoreDeps<UserInfo = unknown, LoginParams = unknown> {
|
|
12
|
-
/** app 侧 admin bridge 单例(注入而非 core 持单例,守规则 8;layout/theme
|
|
12
|
+
/** app 侧 admin bridge 单例(注入而非 core 持单例,守规则 8;layout/theme 配置全经此读) */
|
|
13
13
|
bridge: AdminBridge<UserInfo, LoginParams>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* app store 工厂下沉 core。
|
|
17
17
|
*
|
|
18
|
-
* 返回 `defineStore("APP", setup
|
|
19
|
-
*
|
|
20
|
-
* 原 `packages/app/src/store/app.ts` 全部运行时行为(layout/theme/persist/
|
|
21
|
-
* watch isDarkTheme DOM class 切换),[MUST NOT] 重构 / 精简 / 调整顺序。
|
|
18
|
+
* 返回 `defineStore("APP", setup)` 结果(store id 保持 `"APP"`;core 工厂无状态,
|
|
19
|
+
* store 实例由 app 侧 pinia 管理,规则 8)。
|
|
22
20
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* `
|
|
26
|
-
*
|
|
21
|
+
* 主题架构反转(不再 1:1 镜像原 app store dark 状态机):dark/风格切换真相全移交
|
|
22
|
+
* bridge(`bridge.themeIsDark` / `bridge.theme.setStyle/setDark`)——
|
|
23
|
+
* - `isDarkTheme` 改读 `bridge.themeIsDark`(store 不再持 ref 真相);
|
|
24
|
+
* - `changeIsDarkTheme` 转发 `bridge.theme.setDark`(旧消费方兼容兜底);
|
|
25
|
+
* - 退役 store `watch isDarkTheme → className`(由挂值 composable toggle `.dark`);
|
|
26
|
+
* - 退役 store dark 持久化(`pick:["isDarkTheme"]`)——bridge 持久化 `{themeStyle,themeIsDark}`。
|
|
27
|
+
* layout/route/sidebar 等非主题运行时行为保持不变。
|
|
27
28
|
*
|
|
28
29
|
* @example
|
|
29
30
|
* export const useAppStore = createAppStore({ bridge: appAdminBridge });
|
|
30
31
|
*/
|
|
31
32
|
export declare function createAppStore<UserInfo = unknown, LoginParams = unknown>(deps: CreateAppStoreDeps<UserInfo, LoginParams>): import('pinia').StoreDefinition<"APP", Pick<{
|
|
32
|
-
name:
|
|
33
|
-
isDarkTheme:
|
|
34
|
-
theme:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
name: import('vue').ComputedRef<string>;
|
|
34
|
+
isDarkTheme: import('vue').ComputedRef<boolean>;
|
|
35
|
+
theme: import('vue').ComputedRef<{
|
|
36
|
+
readonly bodyColor: string;
|
|
37
|
+
readonly baseColor: string;
|
|
38
|
+
readonly primaryColor: string;
|
|
39
|
+
readonly successColor: string;
|
|
40
|
+
readonly warningColor: string;
|
|
41
|
+
readonly dangerColor: string;
|
|
42
|
+
readonly errorColor: string;
|
|
43
|
+
readonly infoColor: string;
|
|
44
|
+
readonly radius?: string | undefined;
|
|
45
|
+
readonly borderColor?: string | undefined;
|
|
46
|
+
readonly shadow?: string | undefined;
|
|
47
|
+
readonly borderWidth?: string | undefined;
|
|
48
|
+
readonly accent?: string | undefined;
|
|
49
|
+
readonly glow?: string | undefined;
|
|
50
|
+
readonly blur?: string | undefined;
|
|
51
|
+
readonly focusRing?: string | undefined;
|
|
52
|
+
readonly surface?: string | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
extractLevel1ToHeader: import('vue').Ref<boolean, boolean>;
|
|
55
|
+
showHeader: import('vue').ComputedRef<boolean>;
|
|
56
|
+
showFooter: import('vue').ComputedRef<boolean>;
|
|
57
|
+
showSidebar: import('vue').ComputedRef<boolean>;
|
|
58
|
+
showBreadcrumb: import('vue').ComputedRef<boolean>;
|
|
59
|
+
keepAlive: import('vue').ComputedRef<boolean | undefined>;
|
|
60
|
+
headerStyle: import('vue').ComputedRef<{
|
|
42
61
|
height: string;
|
|
43
62
|
backgroundColor: string;
|
|
44
63
|
color: string;
|
|
45
64
|
}>;
|
|
46
|
-
footerStyle:
|
|
65
|
+
footerStyle: import('vue').ComputedRef<{
|
|
47
66
|
height: string;
|
|
48
67
|
backgroundColor: string;
|
|
49
68
|
}>;
|
|
50
|
-
sidebarStyle:
|
|
69
|
+
sidebarStyle: import('vue').ComputedRef<{
|
|
51
70
|
width: string;
|
|
52
71
|
paddingTop: string;
|
|
53
72
|
backgroundColor: string;
|
|
54
73
|
color: string;
|
|
55
74
|
}>;
|
|
56
|
-
bodyStyle:
|
|
75
|
+
bodyStyle: import('vue').ComputedRef<{
|
|
57
76
|
paddingLeft: string;
|
|
58
77
|
paddingTop: string;
|
|
78
|
+
paddingRight: string;
|
|
79
|
+
paddingBottom: string;
|
|
59
80
|
backgroundColor: string;
|
|
60
81
|
}>;
|
|
61
|
-
bodyShimPadding:
|
|
62
|
-
bodyShimStyle:
|
|
82
|
+
bodyShimPadding: import('vue').ComputedRef<number>;
|
|
83
|
+
bodyShimStyle: import('vue').ComputedRef<{
|
|
63
84
|
minHeight: string;
|
|
64
85
|
padding: string;
|
|
65
86
|
}>;
|
|
66
|
-
|
|
87
|
+
viewportPadding: import('vue').ComputedRef<{
|
|
88
|
+
top: string;
|
|
89
|
+
right: string;
|
|
90
|
+
bottom: string;
|
|
91
|
+
left: string;
|
|
92
|
+
}>;
|
|
93
|
+
sidebarIsCollapse: import('vue').ComputedRef<boolean>;
|
|
67
94
|
changeSidebarCollapseStatus: (status: boolean) => void;
|
|
68
95
|
changeSidebarHasMenusStatus: (status: boolean) => void;
|
|
69
96
|
changeIsDarkTheme: (status: boolean) => void;
|
|
70
|
-
}, "
|
|
71
|
-
name:
|
|
72
|
-
isDarkTheme:
|
|
73
|
-
theme:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
}, "extractLevel1ToHeader">, Pick<{
|
|
98
|
+
name: import('vue').ComputedRef<string>;
|
|
99
|
+
isDarkTheme: import('vue').ComputedRef<boolean>;
|
|
100
|
+
theme: import('vue').ComputedRef<{
|
|
101
|
+
readonly bodyColor: string;
|
|
102
|
+
readonly baseColor: string;
|
|
103
|
+
readonly primaryColor: string;
|
|
104
|
+
readonly successColor: string;
|
|
105
|
+
readonly warningColor: string;
|
|
106
|
+
readonly dangerColor: string;
|
|
107
|
+
readonly errorColor: string;
|
|
108
|
+
readonly infoColor: string;
|
|
109
|
+
readonly radius?: string | undefined;
|
|
110
|
+
readonly borderColor?: string | undefined;
|
|
111
|
+
readonly shadow?: string | undefined;
|
|
112
|
+
readonly borderWidth?: string | undefined;
|
|
113
|
+
readonly accent?: string | undefined;
|
|
114
|
+
readonly glow?: string | undefined;
|
|
115
|
+
readonly blur?: string | undefined;
|
|
116
|
+
readonly focusRing?: string | undefined;
|
|
117
|
+
readonly surface?: string | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
extractLevel1ToHeader: import('vue').Ref<boolean, boolean>;
|
|
120
|
+
showHeader: import('vue').ComputedRef<boolean>;
|
|
121
|
+
showFooter: import('vue').ComputedRef<boolean>;
|
|
122
|
+
showSidebar: import('vue').ComputedRef<boolean>;
|
|
123
|
+
showBreadcrumb: import('vue').ComputedRef<boolean>;
|
|
124
|
+
keepAlive: import('vue').ComputedRef<boolean | undefined>;
|
|
125
|
+
headerStyle: import('vue').ComputedRef<{
|
|
81
126
|
height: string;
|
|
82
127
|
backgroundColor: string;
|
|
83
128
|
color: string;
|
|
84
129
|
}>;
|
|
85
|
-
footerStyle:
|
|
130
|
+
footerStyle: import('vue').ComputedRef<{
|
|
86
131
|
height: string;
|
|
87
132
|
backgroundColor: string;
|
|
88
133
|
}>;
|
|
89
|
-
sidebarStyle:
|
|
134
|
+
sidebarStyle: import('vue').ComputedRef<{
|
|
90
135
|
width: string;
|
|
91
136
|
paddingTop: string;
|
|
92
137
|
backgroundColor: string;
|
|
93
138
|
color: string;
|
|
94
139
|
}>;
|
|
95
|
-
bodyStyle:
|
|
140
|
+
bodyStyle: import('vue').ComputedRef<{
|
|
96
141
|
paddingLeft: string;
|
|
97
142
|
paddingTop: string;
|
|
143
|
+
paddingRight: string;
|
|
144
|
+
paddingBottom: string;
|
|
98
145
|
backgroundColor: string;
|
|
99
146
|
}>;
|
|
100
|
-
bodyShimPadding:
|
|
101
|
-
bodyShimStyle:
|
|
147
|
+
bodyShimPadding: import('vue').ComputedRef<number>;
|
|
148
|
+
bodyShimStyle: import('vue').ComputedRef<{
|
|
102
149
|
minHeight: string;
|
|
103
150
|
padding: string;
|
|
104
151
|
}>;
|
|
105
|
-
|
|
152
|
+
viewportPadding: import('vue').ComputedRef<{
|
|
153
|
+
top: string;
|
|
154
|
+
right: string;
|
|
155
|
+
bottom: string;
|
|
156
|
+
left: string;
|
|
157
|
+
}>;
|
|
158
|
+
sidebarIsCollapse: import('vue').ComputedRef<boolean>;
|
|
106
159
|
changeSidebarCollapseStatus: (status: boolean) => void;
|
|
107
160
|
changeSidebarHasMenusStatus: (status: boolean) => void;
|
|
108
161
|
changeIsDarkTheme: (status: boolean) => void;
|
|
109
|
-
}, "
|
|
110
|
-
name:
|
|
111
|
-
isDarkTheme:
|
|
112
|
-
theme:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
162
|
+
}, "name" | "theme" | "showHeader" | "keepAlive" | "bodyShimPadding" | "isDarkTheme" | "showFooter" | "showSidebar" | "showBreadcrumb" | "headerStyle" | "footerStyle" | "sidebarStyle" | "bodyStyle" | "bodyShimStyle" | "viewportPadding" | "sidebarIsCollapse">, Pick<{
|
|
163
|
+
name: import('vue').ComputedRef<string>;
|
|
164
|
+
isDarkTheme: import('vue').ComputedRef<boolean>;
|
|
165
|
+
theme: import('vue').ComputedRef<{
|
|
166
|
+
readonly bodyColor: string;
|
|
167
|
+
readonly baseColor: string;
|
|
168
|
+
readonly primaryColor: string;
|
|
169
|
+
readonly successColor: string;
|
|
170
|
+
readonly warningColor: string;
|
|
171
|
+
readonly dangerColor: string;
|
|
172
|
+
readonly errorColor: string;
|
|
173
|
+
readonly infoColor: string;
|
|
174
|
+
readonly radius?: string | undefined;
|
|
175
|
+
readonly borderColor?: string | undefined;
|
|
176
|
+
readonly shadow?: string | undefined;
|
|
177
|
+
readonly borderWidth?: string | undefined;
|
|
178
|
+
readonly accent?: string | undefined;
|
|
179
|
+
readonly glow?: string | undefined;
|
|
180
|
+
readonly blur?: string | undefined;
|
|
181
|
+
readonly focusRing?: string | undefined;
|
|
182
|
+
readonly surface?: string | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
extractLevel1ToHeader: import('vue').Ref<boolean, boolean>;
|
|
185
|
+
showHeader: import('vue').ComputedRef<boolean>;
|
|
186
|
+
showFooter: import('vue').ComputedRef<boolean>;
|
|
187
|
+
showSidebar: import('vue').ComputedRef<boolean>;
|
|
188
|
+
showBreadcrumb: import('vue').ComputedRef<boolean>;
|
|
189
|
+
keepAlive: import('vue').ComputedRef<boolean | undefined>;
|
|
190
|
+
headerStyle: import('vue').ComputedRef<{
|
|
120
191
|
height: string;
|
|
121
192
|
backgroundColor: string;
|
|
122
193
|
color: string;
|
|
123
194
|
}>;
|
|
124
|
-
footerStyle:
|
|
195
|
+
footerStyle: import('vue').ComputedRef<{
|
|
125
196
|
height: string;
|
|
126
197
|
backgroundColor: string;
|
|
127
198
|
}>;
|
|
128
|
-
sidebarStyle:
|
|
199
|
+
sidebarStyle: import('vue').ComputedRef<{
|
|
129
200
|
width: string;
|
|
130
201
|
paddingTop: string;
|
|
131
202
|
backgroundColor: string;
|
|
132
203
|
color: string;
|
|
133
204
|
}>;
|
|
134
|
-
bodyStyle:
|
|
205
|
+
bodyStyle: import('vue').ComputedRef<{
|
|
135
206
|
paddingLeft: string;
|
|
136
207
|
paddingTop: string;
|
|
208
|
+
paddingRight: string;
|
|
209
|
+
paddingBottom: string;
|
|
137
210
|
backgroundColor: string;
|
|
138
211
|
}>;
|
|
139
|
-
bodyShimPadding:
|
|
140
|
-
bodyShimStyle:
|
|
212
|
+
bodyShimPadding: import('vue').ComputedRef<number>;
|
|
213
|
+
bodyShimStyle: import('vue').ComputedRef<{
|
|
141
214
|
minHeight: string;
|
|
142
215
|
padding: string;
|
|
143
216
|
}>;
|
|
144
|
-
|
|
217
|
+
viewportPadding: import('vue').ComputedRef<{
|
|
218
|
+
top: string;
|
|
219
|
+
right: string;
|
|
220
|
+
bottom: string;
|
|
221
|
+
left: string;
|
|
222
|
+
}>;
|
|
223
|
+
sidebarIsCollapse: import('vue').ComputedRef<boolean>;
|
|
145
224
|
changeSidebarCollapseStatus: (status: boolean) => void;
|
|
146
225
|
changeSidebarHasMenusStatus: (status: boolean) => void;
|
|
147
226
|
changeIsDarkTheme: (status: boolean) => void;
|
package/types/store/user.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface CreateUserStoreDeps<UserInfo, LoginParams = unknown> {
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function createUserStore<UserInfo, LoginParams = unknown>(deps: CreateUserStoreDeps<UserInfo, LoginParams>): import('pinia').StoreDefinition<"USER", Pick<{
|
|
32
32
|
userInfo: ComputedRef<UserInfo>;
|
|
33
|
-
token: ComputedRef<string
|
|
33
|
+
token: ComputedRef<string>;
|
|
34
34
|
isLogin: ComputedRef<boolean>;
|
|
35
35
|
login: (params: LoginParams) => Promise<void>;
|
|
36
36
|
logout: () => Promise<void>;
|
|
@@ -40,7 +40,7 @@ export declare function createUserStore<UserInfo, LoginParams = unknown>(deps: C
|
|
|
40
40
|
havePermissionByKey: (key?: RoutePermission["key"]) => boolean;
|
|
41
41
|
}, never>, Pick<{
|
|
42
42
|
userInfo: ComputedRef<UserInfo>;
|
|
43
|
-
token: ComputedRef<string
|
|
43
|
+
token: ComputedRef<string>;
|
|
44
44
|
isLogin: ComputedRef<boolean>;
|
|
45
45
|
login: (params: LoginParams) => Promise<void>;
|
|
46
46
|
logout: () => Promise<void>;
|
|
@@ -50,7 +50,7 @@ export declare function createUserStore<UserInfo, LoginParams = unknown>(deps: C
|
|
|
50
50
|
havePermissionByKey: (key?: RoutePermission["key"]) => boolean;
|
|
51
51
|
}, "userInfo" | "token" | "isLogin">, Pick<{
|
|
52
52
|
userInfo: ComputedRef<UserInfo>;
|
|
53
|
-
token: ComputedRef<string
|
|
53
|
+
token: ComputedRef<string>;
|
|
54
54
|
isLogin: ComputedRef<boolean>;
|
|
55
55
|
login: (params: LoginParams) => Promise<void>;
|
|
56
56
|
logout: () => Promise<void>;
|
package/types/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 主题色阶派生(模式感知,复刻 Element Plus 的 SCSS `mix` 算法)。
|
|
3
|
+
*
|
|
4
|
+
* core 挂值时对 6 个语义色(primary/success/warning/danger/info + error)
|
|
5
|
+
* 由基色派生 EP 7 档(base 自身 + light-3/5/7/8/9 + dark-2),亮/暗模式各用
|
|
6
|
+
* 不同的混入色,使派生结果与 EP 原生色阶一致。
|
|
7
|
+
*/
|
|
8
|
+
/** 主题明暗模式(决定色阶向哪一端混合) */
|
|
9
|
+
export type ThemeScaleMode = "light" | "dark";
|
|
10
|
+
/** 一个语义色的 EP 7 档色阶(key 与 `--el-color-*-light-#` / `-dark-2` 对齐) */
|
|
11
|
+
export interface ThemeColorScale {
|
|
12
|
+
/** 基色自身 */
|
|
13
|
+
base: string;
|
|
14
|
+
"light-3": string;
|
|
15
|
+
"light-5": string;
|
|
16
|
+
"light-7": string;
|
|
17
|
+
"light-8": string;
|
|
18
|
+
"light-9": string;
|
|
19
|
+
"dark-2": string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 混色:`c1` 占 `w1`、`c2` 占 `1-w1`,各通道线性混合后四舍五入
|
|
23
|
+
* (复刻 EP/SCSS `mix(c1, c2, w1)` 语义,w1 为 c1 的权重 [0,1])。
|
|
24
|
+
* 任一入参非 hex(如 `var(...)` / `rgba(...)`)→ 返回 `c2` 兜底,不崩。
|
|
25
|
+
*/
|
|
26
|
+
export declare const themeScaleMix: (c1: string, c2: string, w1: number) => string;
|
|
27
|
+
/**
|
|
28
|
+
* 按 EP 算法 + 模式感知派生一个语义色的 7 档色阶。
|
|
29
|
+
*
|
|
30
|
+
* - light:`light-i = mix(#fff, base, i*10%)`,`dark-2 = mix(#000, base, 20%)`
|
|
31
|
+
* - dark: `light-i = mix(#141414, base, i*10%)`,`dark-2 = mix(#fff, base, 20%)`
|
|
32
|
+
*
|
|
33
|
+
* `base` 非 hex 时各档兜底返回 `base` 原值(保持可挂载、不崩)。
|
|
34
|
+
*/
|
|
35
|
+
export declare const themeScaleDerive: (base: string, mode: ThemeScaleMode) => ThemeColorScale;
|