@spacego/fe-components 0.0.1-alpha.1
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 +37 -0
- package/lib/assets/svg/chrome-bg-after.svg.js +4 -0
- package/lib/assets/svg/chrome-bg-before.svg.js +4 -0
- package/lib/assets/svg/icon-arrows-right.svg.js +4 -0
- package/lib/assets/svg/icon-bell.svg.js +4 -0
- package/lib/assets/svg/icon-custom.svg.js +4 -0
- package/lib/assets/svg/icon-sun-moon.svg.js +4 -0
- package/lib/assets/svg/icon-system.svg.js +4 -0
- package/lib/assets/svg/login-view.svg.js +4 -0
- package/lib/config/constants.js +10 -0
- package/lib/config/theme.js +8 -0
- package/lib/fe-layouts/auth-layout/index.js +95 -0
- package/lib/fe-layouts/basics-layout/components/basics-layout/header.js +102 -0
- package/lib/fe-layouts/basics-layout/components/basics-layout/setting-custom-color.js +34 -0
- package/lib/fe-layouts/basics-layout/components/basics-layout/setting-drawer.js +118 -0
- package/lib/fe-layouts/basics-layout/components/basics-layout/sidebar.js +60 -0
- package/lib/fe-layouts/basics-layout/components/basics-layout/tabs.js +60 -0
- package/lib/fe-layouts/basics-layout/components/utils/index.js +72 -0
- package/lib/fe-layouts/basics-layout/index.js +98 -0
- package/lib/fe-layouts/blank-layout/index.js +8 -0
- package/lib/fe-layouts/context/context.js +6 -0
- package/lib/fe-layouts/context/global-context.provider.js +53 -0
- package/lib/fe-layouts/layout.js +49 -0
- package/lib/hooks/use-auth.hook.js +23 -0
- package/lib/index.css +1 -0
- package/lib/index.js +48 -0
- package/lib/router/index.js +43 -0
- package/lib/router/permission.js +43 -0
- package/lib/router/routes.js +57 -0
- package/lib/router/utils.js +105 -0
- package/lib/store/modules/layout-config.store.js +217 -0
- package/lib/store/modules/theme.store.js +60 -0
- package/lib/types/config/constants.d.ts +9 -0
- package/lib/types/config/index.d.ts +2 -0
- package/lib/types/config/theme.d.ts +7 -0
- package/lib/types/fe-layouts/auth-layout/index.d.ts +1 -0
- package/lib/types/fe-layouts/basics-layout/components/basics-layout/header.d.ts +7 -0
- package/lib/types/fe-layouts/basics-layout/components/basics-layout/setting-custom-color.d.ts +3 -0
- package/lib/types/fe-layouts/basics-layout/components/basics-layout/setting-drawer.d.ts +6 -0
- package/lib/types/fe-layouts/basics-layout/components/basics-layout/sidebar.d.ts +11 -0
- package/lib/types/fe-layouts/basics-layout/components/basics-layout/tabs.d.ts +9 -0
- package/lib/types/fe-layouts/basics-layout/components/utils/index.d.ts +41 -0
- package/lib/types/fe-layouts/basics-layout/index.d.ts +1 -0
- package/lib/types/fe-layouts/blank-layout/index.d.ts +1 -0
- package/lib/types/fe-layouts/context/context.d.ts +7 -0
- package/lib/types/fe-layouts/context/global-context.provider.d.ts +2 -0
- package/lib/types/fe-layouts/context/index.d.ts +3 -0
- package/lib/types/fe-layouts/index.d.ts +6 -0
- package/lib/types/fe-layouts/layout.d.ts +7 -0
- package/lib/types/hooks/index.d.ts +1 -0
- package/lib/types/hooks/use-auth.hook.d.ts +8 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/router/index.d.ts +40 -0
- package/lib/types/router/permission.d.ts +23 -0
- package/lib/types/router/routes.d.ts +11 -0
- package/lib/types/router/utils.d.ts +56 -0
- package/lib/types/store/index.d.ts +2 -0
- package/lib/types/store/modules/layout-config.store.d.ts +612 -0
- package/lib/types/store/modules/theme.store.d.ts +186 -0
- package/lib/types/utils/icon.d.ts +14 -0
- package/lib/types/utils/index.d.ts +2 -0
- package/lib/types/utils/theme.d.ts +43 -0
- package/lib/utils/icon.js +13 -0
- package/lib/utils/theme.js +100 -0
- package/package.json +60 -0
- package/src/assets/styles/animate.css +62 -0
- package/src/assets/styles/index.css +49 -0
- package/src/assets/svg/chrome-bg-after.svg +1 -0
- package/src/assets/svg/chrome-bg-before.svg +1 -0
- package/src/assets/svg/icon-arrows-right.svg +1 -0
- package/src/assets/svg/icon-bell.svg +1 -0
- package/src/assets/svg/icon-custom.svg +1 -0
- package/src/assets/svg/icon-sun-moon.svg +1 -0
- package/src/assets/svg/icon-system.svg +1 -0
- package/src/assets/svg/loading.svg +13 -0
- package/src/assets/svg/login-view.svg +193 -0
- package/src/config/constants.ts +19 -0
- package/src/config/index.ts +2 -0
- package/src/config/theme.ts +20 -0
- package/src/fe-layouts/auth-layout/index.scss +34 -0
- package/src/fe-layouts/auth-layout/index.tsx +121 -0
- package/src/fe-layouts/basics-layout/components/basics-layout/header.tsx +148 -0
- package/src/fe-layouts/basics-layout/components/basics-layout/setting-custom-color.tsx +52 -0
- package/src/fe-layouts/basics-layout/components/basics-layout/setting-drawer.tsx +165 -0
- package/src/fe-layouts/basics-layout/components/basics-layout/sidebar.tsx +88 -0
- package/src/fe-layouts/basics-layout/components/basics-layout/tabs.tsx +94 -0
- package/src/fe-layouts/basics-layout/components/utils/index.ts +142 -0
- package/src/fe-layouts/basics-layout/index.scss +110 -0
- package/src/fe-layouts/basics-layout/index.tsx +207 -0
- package/src/fe-layouts/blank-layout/index.tsx +12 -0
- package/src/fe-layouts/context/context.ts +11 -0
- package/src/fe-layouts/context/global-context.d.ts +241 -0
- package/src/fe-layouts/context/global-context.provider.tsx +81 -0
- package/src/fe-layouts/context/index.ts +10 -0
- package/src/fe-layouts/index.ts +13 -0
- package/src/fe-layouts/layout.tsx +74 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-auth.hook.ts +54 -0
- package/src/index.ts +21 -0
- package/src/router/index.ts +110 -0
- package/src/router/permission.tsx +134 -0
- package/src/router/routes.tsx +94 -0
- package/src/router/utils.ts +283 -0
- package/src/store/index.ts +9 -0
- package/src/store/modules/layout-config.store.ts +343 -0
- package/src/store/modules/theme.store.ts +99 -0
- package/src/typings/index.d.ts +59 -0
- package/src/typings/shims-axios.d.ts +38 -0
- package/src/utils/icon.tsx +32 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/theme.ts +219 -0
- package/tsconfig.json +28 -0
- package/vite.config.ts +85 -0
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { TUpdateStore } from '../../typings';
|
|
3
|
+
export interface TabItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
path: string;
|
|
7
|
+
closable?: boolean;
|
|
8
|
+
}
|
|
9
|
+
type State = {
|
|
10
|
+
/** Tabs 配置 */
|
|
11
|
+
tabsAttribute: {
|
|
12
|
+
/** 已打开的页面标签列表 */
|
|
13
|
+
tabsList: TabItem[];
|
|
14
|
+
/** 当前激活的标签页 key */
|
|
15
|
+
tabsActiveKey: string;
|
|
16
|
+
};
|
|
17
|
+
/** Loading 配置 */
|
|
18
|
+
loadingConfig: {
|
|
19
|
+
show: boolean;
|
|
20
|
+
limit: number;
|
|
21
|
+
timer: number | null;
|
|
22
|
+
};
|
|
23
|
+
/** 侧边栏折叠状态 */
|
|
24
|
+
sidebarCollapsed: boolean;
|
|
25
|
+
};
|
|
26
|
+
type Update = TUpdateStore<State>;
|
|
27
|
+
type Actions = {
|
|
28
|
+
SET_STATE: (data: Update) => void;
|
|
29
|
+
/** 添加标签页 */
|
|
30
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
31
|
+
/** 移除标签页 */
|
|
32
|
+
REMOVE_TAB: (key: string) => void;
|
|
33
|
+
/** 设置当前激活的标签页 */
|
|
34
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
35
|
+
/** 清空所有标签页 */
|
|
36
|
+
CLEAR_TABS: () => void;
|
|
37
|
+
/** 设置loading配置 */
|
|
38
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
39
|
+
/** 取消loading */
|
|
40
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
41
|
+
/** 清除loading定时器 */
|
|
42
|
+
CLEAR_LOADING_TIMER: () => void;
|
|
43
|
+
/** 设置侧边栏折叠状态 */
|
|
44
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
45
|
+
/** 切换侧边栏折叠状态 */
|
|
46
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
47
|
+
/** 重置 */
|
|
48
|
+
RESET: () => void;
|
|
49
|
+
/** 设置通知的reactNode */
|
|
50
|
+
SET_NOTICE_RENDER: (render: React.ReactNode) => void;
|
|
51
|
+
};
|
|
52
|
+
type LayoutConfigStore = State & Actions;
|
|
53
|
+
export declare const useLayoutConfigStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
54
|
+
SET_STATE: (data: Update) => unknown;
|
|
55
|
+
/**
|
|
56
|
+
* 添加标签页
|
|
57
|
+
*/
|
|
58
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
59
|
+
/**
|
|
60
|
+
* 移除标签页
|
|
61
|
+
*/
|
|
62
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
63
|
+
/**
|
|
64
|
+
* 设置当前激活的标签页
|
|
65
|
+
*/
|
|
66
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
67
|
+
/**
|
|
68
|
+
* 清空所有标签页
|
|
69
|
+
*/
|
|
70
|
+
CLEAR_TABS: () => void;
|
|
71
|
+
/**
|
|
72
|
+
* 设置loading配置
|
|
73
|
+
*/
|
|
74
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
75
|
+
/**
|
|
76
|
+
* 取消loading
|
|
77
|
+
*/
|
|
78
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
79
|
+
/**
|
|
80
|
+
* 清除loading定时器
|
|
81
|
+
*/
|
|
82
|
+
CLEAR_LOADING_TIMER(): void;
|
|
83
|
+
/**
|
|
84
|
+
* 设置侧边栏折叠状态
|
|
85
|
+
*/
|
|
86
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
87
|
+
/**
|
|
88
|
+
* 切换侧边栏折叠状态
|
|
89
|
+
*/
|
|
90
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
91
|
+
/**
|
|
92
|
+
* 重置
|
|
93
|
+
*/
|
|
94
|
+
RESET: () => void;
|
|
95
|
+
}>, "setState" | "persist"> & {
|
|
96
|
+
setState(partial: (Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
97
|
+
SET_STATE: (data: Update) => unknown;
|
|
98
|
+
/**
|
|
99
|
+
* 添加标签页
|
|
100
|
+
*/
|
|
101
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
102
|
+
/**
|
|
103
|
+
* 移除标签页
|
|
104
|
+
*/
|
|
105
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
106
|
+
/**
|
|
107
|
+
* 设置当前激活的标签页
|
|
108
|
+
*/
|
|
109
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
110
|
+
/**
|
|
111
|
+
* 清空所有标签页
|
|
112
|
+
*/
|
|
113
|
+
CLEAR_TABS: () => void;
|
|
114
|
+
/**
|
|
115
|
+
* 设置loading配置
|
|
116
|
+
*/
|
|
117
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
118
|
+
/**
|
|
119
|
+
* 取消loading
|
|
120
|
+
*/
|
|
121
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
122
|
+
/**
|
|
123
|
+
* 清除loading定时器
|
|
124
|
+
*/
|
|
125
|
+
CLEAR_LOADING_TIMER(): void;
|
|
126
|
+
/**
|
|
127
|
+
* 设置侧边栏折叠状态
|
|
128
|
+
*/
|
|
129
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
130
|
+
/**
|
|
131
|
+
* 切换侧边栏折叠状态
|
|
132
|
+
*/
|
|
133
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
134
|
+
/**
|
|
135
|
+
* 重置
|
|
136
|
+
*/
|
|
137
|
+
RESET: () => void;
|
|
138
|
+
}) | Partial<Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
139
|
+
SET_STATE: (data: Update) => unknown;
|
|
140
|
+
/**
|
|
141
|
+
* 添加标签页
|
|
142
|
+
*/
|
|
143
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
144
|
+
/**
|
|
145
|
+
* 移除标签页
|
|
146
|
+
*/
|
|
147
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
148
|
+
/**
|
|
149
|
+
* 设置当前激活的标签页
|
|
150
|
+
*/
|
|
151
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
152
|
+
/**
|
|
153
|
+
* 清空所有标签页
|
|
154
|
+
*/
|
|
155
|
+
CLEAR_TABS: () => void;
|
|
156
|
+
/**
|
|
157
|
+
* 设置loading配置
|
|
158
|
+
*/
|
|
159
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
160
|
+
/**
|
|
161
|
+
* 取消loading
|
|
162
|
+
*/
|
|
163
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
164
|
+
/**
|
|
165
|
+
* 清除loading定时器
|
|
166
|
+
*/
|
|
167
|
+
CLEAR_LOADING_TIMER(): void;
|
|
168
|
+
/**
|
|
169
|
+
* 设置侧边栏折叠状态
|
|
170
|
+
*/
|
|
171
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
172
|
+
/**
|
|
173
|
+
* 切换侧边栏折叠状态
|
|
174
|
+
*/
|
|
175
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
176
|
+
/**
|
|
177
|
+
* 重置
|
|
178
|
+
*/
|
|
179
|
+
RESET: () => void;
|
|
180
|
+
}> | ((state: Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
181
|
+
SET_STATE: (data: Update) => unknown;
|
|
182
|
+
/**
|
|
183
|
+
* 添加标签页
|
|
184
|
+
*/
|
|
185
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
186
|
+
/**
|
|
187
|
+
* 移除标签页
|
|
188
|
+
*/
|
|
189
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
190
|
+
/**
|
|
191
|
+
* 设置当前激活的标签页
|
|
192
|
+
*/
|
|
193
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
194
|
+
/**
|
|
195
|
+
* 清空所有标签页
|
|
196
|
+
*/
|
|
197
|
+
CLEAR_TABS: () => void;
|
|
198
|
+
/**
|
|
199
|
+
* 设置loading配置
|
|
200
|
+
*/
|
|
201
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
202
|
+
/**
|
|
203
|
+
* 取消loading
|
|
204
|
+
*/
|
|
205
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
206
|
+
/**
|
|
207
|
+
* 清除loading定时器
|
|
208
|
+
*/
|
|
209
|
+
CLEAR_LOADING_TIMER(): void;
|
|
210
|
+
/**
|
|
211
|
+
* 设置侧边栏折叠状态
|
|
212
|
+
*/
|
|
213
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
214
|
+
/**
|
|
215
|
+
* 切换侧边栏折叠状态
|
|
216
|
+
*/
|
|
217
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
218
|
+
/**
|
|
219
|
+
* 重置
|
|
220
|
+
*/
|
|
221
|
+
RESET: () => void;
|
|
222
|
+
}) => (Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
223
|
+
SET_STATE: (data: Update) => unknown;
|
|
224
|
+
/**
|
|
225
|
+
* 添加标签页
|
|
226
|
+
*/
|
|
227
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
228
|
+
/**
|
|
229
|
+
* 移除标签页
|
|
230
|
+
*/
|
|
231
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
232
|
+
/**
|
|
233
|
+
* 设置当前激活的标签页
|
|
234
|
+
*/
|
|
235
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
236
|
+
/**
|
|
237
|
+
* 清空所有标签页
|
|
238
|
+
*/
|
|
239
|
+
CLEAR_TABS: () => void;
|
|
240
|
+
/**
|
|
241
|
+
* 设置loading配置
|
|
242
|
+
*/
|
|
243
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
244
|
+
/**
|
|
245
|
+
* 取消loading
|
|
246
|
+
*/
|
|
247
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
248
|
+
/**
|
|
249
|
+
* 清除loading定时器
|
|
250
|
+
*/
|
|
251
|
+
CLEAR_LOADING_TIMER(): void;
|
|
252
|
+
/**
|
|
253
|
+
* 设置侧边栏折叠状态
|
|
254
|
+
*/
|
|
255
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
256
|
+
/**
|
|
257
|
+
* 切换侧边栏折叠状态
|
|
258
|
+
*/
|
|
259
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
260
|
+
/**
|
|
261
|
+
* 重置
|
|
262
|
+
*/
|
|
263
|
+
RESET: () => void;
|
|
264
|
+
}) | Partial<Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
265
|
+
SET_STATE: (data: Update) => unknown;
|
|
266
|
+
/**
|
|
267
|
+
* 添加标签页
|
|
268
|
+
*/
|
|
269
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
270
|
+
/**
|
|
271
|
+
* 移除标签页
|
|
272
|
+
*/
|
|
273
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
274
|
+
/**
|
|
275
|
+
* 设置当前激活的标签页
|
|
276
|
+
*/
|
|
277
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
278
|
+
/**
|
|
279
|
+
* 清空所有标签页
|
|
280
|
+
*/
|
|
281
|
+
CLEAR_TABS: () => void;
|
|
282
|
+
/**
|
|
283
|
+
* 设置loading配置
|
|
284
|
+
*/
|
|
285
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
286
|
+
/**
|
|
287
|
+
* 取消loading
|
|
288
|
+
*/
|
|
289
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
290
|
+
/**
|
|
291
|
+
* 清除loading定时器
|
|
292
|
+
*/
|
|
293
|
+
CLEAR_LOADING_TIMER(): void;
|
|
294
|
+
/**
|
|
295
|
+
* 设置侧边栏折叠状态
|
|
296
|
+
*/
|
|
297
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
298
|
+
/**
|
|
299
|
+
* 切换侧边栏折叠状态
|
|
300
|
+
*/
|
|
301
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
302
|
+
/**
|
|
303
|
+
* 重置
|
|
304
|
+
*/
|
|
305
|
+
RESET: () => void;
|
|
306
|
+
}>), replace?: false | undefined): unknown;
|
|
307
|
+
setState(state: (Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
308
|
+
SET_STATE: (data: Update) => unknown;
|
|
309
|
+
/**
|
|
310
|
+
* 添加标签页
|
|
311
|
+
*/
|
|
312
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
313
|
+
/**
|
|
314
|
+
* 移除标签页
|
|
315
|
+
*/
|
|
316
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
317
|
+
/**
|
|
318
|
+
* 设置当前激活的标签页
|
|
319
|
+
*/
|
|
320
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
321
|
+
/**
|
|
322
|
+
* 清空所有标签页
|
|
323
|
+
*/
|
|
324
|
+
CLEAR_TABS: () => void;
|
|
325
|
+
/**
|
|
326
|
+
* 设置loading配置
|
|
327
|
+
*/
|
|
328
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
329
|
+
/**
|
|
330
|
+
* 取消loading
|
|
331
|
+
*/
|
|
332
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
333
|
+
/**
|
|
334
|
+
* 清除loading定时器
|
|
335
|
+
*/
|
|
336
|
+
CLEAR_LOADING_TIMER(): void;
|
|
337
|
+
/**
|
|
338
|
+
* 设置侧边栏折叠状态
|
|
339
|
+
*/
|
|
340
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
341
|
+
/**
|
|
342
|
+
* 切换侧边栏折叠状态
|
|
343
|
+
*/
|
|
344
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
345
|
+
/**
|
|
346
|
+
* 重置
|
|
347
|
+
*/
|
|
348
|
+
RESET: () => void;
|
|
349
|
+
}) | ((state: Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
350
|
+
SET_STATE: (data: Update) => unknown;
|
|
351
|
+
/**
|
|
352
|
+
* 添加标签页
|
|
353
|
+
*/
|
|
354
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
355
|
+
/**
|
|
356
|
+
* 移除标签页
|
|
357
|
+
*/
|
|
358
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
359
|
+
/**
|
|
360
|
+
* 设置当前激活的标签页
|
|
361
|
+
*/
|
|
362
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
363
|
+
/**
|
|
364
|
+
* 清空所有标签页
|
|
365
|
+
*/
|
|
366
|
+
CLEAR_TABS: () => void;
|
|
367
|
+
/**
|
|
368
|
+
* 设置loading配置
|
|
369
|
+
*/
|
|
370
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
371
|
+
/**
|
|
372
|
+
* 取消loading
|
|
373
|
+
*/
|
|
374
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
375
|
+
/**
|
|
376
|
+
* 清除loading定时器
|
|
377
|
+
*/
|
|
378
|
+
CLEAR_LOADING_TIMER(): void;
|
|
379
|
+
/**
|
|
380
|
+
* 设置侧边栏折叠状态
|
|
381
|
+
*/
|
|
382
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
383
|
+
/**
|
|
384
|
+
* 切换侧边栏折叠状态
|
|
385
|
+
*/
|
|
386
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
387
|
+
/**
|
|
388
|
+
* 重置
|
|
389
|
+
*/
|
|
390
|
+
RESET: () => void;
|
|
391
|
+
}) => Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
392
|
+
SET_STATE: (data: Update) => unknown;
|
|
393
|
+
/**
|
|
394
|
+
* 添加标签页
|
|
395
|
+
*/
|
|
396
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
397
|
+
/**
|
|
398
|
+
* 移除标签页
|
|
399
|
+
*/
|
|
400
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
401
|
+
/**
|
|
402
|
+
* 设置当前激活的标签页
|
|
403
|
+
*/
|
|
404
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
405
|
+
/**
|
|
406
|
+
* 清空所有标签页
|
|
407
|
+
*/
|
|
408
|
+
CLEAR_TABS: () => void;
|
|
409
|
+
/**
|
|
410
|
+
* 设置loading配置
|
|
411
|
+
*/
|
|
412
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
413
|
+
/**
|
|
414
|
+
* 取消loading
|
|
415
|
+
*/
|
|
416
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
417
|
+
/**
|
|
418
|
+
* 清除loading定时器
|
|
419
|
+
*/
|
|
420
|
+
CLEAR_LOADING_TIMER(): void;
|
|
421
|
+
/**
|
|
422
|
+
* 设置侧边栏折叠状态
|
|
423
|
+
*/
|
|
424
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
425
|
+
/**
|
|
426
|
+
* 切换侧边栏折叠状态
|
|
427
|
+
*/
|
|
428
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
429
|
+
/**
|
|
430
|
+
* 重置
|
|
431
|
+
*/
|
|
432
|
+
RESET: () => void;
|
|
433
|
+
}), replace: true): unknown;
|
|
434
|
+
persist: {
|
|
435
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
436
|
+
SET_STATE: (data: Update) => unknown;
|
|
437
|
+
/**
|
|
438
|
+
* 添加标签页
|
|
439
|
+
*/
|
|
440
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
441
|
+
/**
|
|
442
|
+
* 移除标签页
|
|
443
|
+
*/
|
|
444
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
445
|
+
/**
|
|
446
|
+
* 设置当前激活的标签页
|
|
447
|
+
*/
|
|
448
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
449
|
+
/**
|
|
450
|
+
* 清空所有标签页
|
|
451
|
+
*/
|
|
452
|
+
CLEAR_TABS: () => void;
|
|
453
|
+
/**
|
|
454
|
+
* 设置loading配置
|
|
455
|
+
*/
|
|
456
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
457
|
+
/**
|
|
458
|
+
* 取消loading
|
|
459
|
+
*/
|
|
460
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
461
|
+
/**
|
|
462
|
+
* 清除loading定时器
|
|
463
|
+
*/
|
|
464
|
+
CLEAR_LOADING_TIMER(): void;
|
|
465
|
+
/**
|
|
466
|
+
* 设置侧边栏折叠状态
|
|
467
|
+
*/
|
|
468
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
469
|
+
/**
|
|
470
|
+
* 切换侧边栏折叠状态
|
|
471
|
+
*/
|
|
472
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
473
|
+
/**
|
|
474
|
+
* 重置
|
|
475
|
+
*/
|
|
476
|
+
RESET: () => void;
|
|
477
|
+
}, unknown, unknown>>) => void;
|
|
478
|
+
clearStorage: () => void;
|
|
479
|
+
rehydrate: () => Promise<void> | void;
|
|
480
|
+
hasHydrated: () => boolean;
|
|
481
|
+
onHydrate: (fn: (state: Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
482
|
+
SET_STATE: (data: Update) => unknown;
|
|
483
|
+
/**
|
|
484
|
+
* 添加标签页
|
|
485
|
+
*/
|
|
486
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
487
|
+
/**
|
|
488
|
+
* 移除标签页
|
|
489
|
+
*/
|
|
490
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
491
|
+
/**
|
|
492
|
+
* 设置当前激活的标签页
|
|
493
|
+
*/
|
|
494
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
495
|
+
/**
|
|
496
|
+
* 清空所有标签页
|
|
497
|
+
*/
|
|
498
|
+
CLEAR_TABS: () => void;
|
|
499
|
+
/**
|
|
500
|
+
* 设置loading配置
|
|
501
|
+
*/
|
|
502
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
503
|
+
/**
|
|
504
|
+
* 取消loading
|
|
505
|
+
*/
|
|
506
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
507
|
+
/**
|
|
508
|
+
* 清除loading定时器
|
|
509
|
+
*/
|
|
510
|
+
CLEAR_LOADING_TIMER(): void;
|
|
511
|
+
/**
|
|
512
|
+
* 设置侧边栏折叠状态
|
|
513
|
+
*/
|
|
514
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
515
|
+
/**
|
|
516
|
+
* 切换侧边栏折叠状态
|
|
517
|
+
*/
|
|
518
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
519
|
+
/**
|
|
520
|
+
* 重置
|
|
521
|
+
*/
|
|
522
|
+
RESET: () => void;
|
|
523
|
+
}) => void) => () => void;
|
|
524
|
+
onFinishHydration: (fn: (state: Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
525
|
+
SET_STATE: (data: Update) => unknown;
|
|
526
|
+
/**
|
|
527
|
+
* 添加标签页
|
|
528
|
+
*/
|
|
529
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
530
|
+
/**
|
|
531
|
+
* 移除标签页
|
|
532
|
+
*/
|
|
533
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
534
|
+
/**
|
|
535
|
+
* 设置当前激活的标签页
|
|
536
|
+
*/
|
|
537
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
538
|
+
/**
|
|
539
|
+
* 清空所有标签页
|
|
540
|
+
*/
|
|
541
|
+
CLEAR_TABS: () => void;
|
|
542
|
+
/**
|
|
543
|
+
* 设置loading配置
|
|
544
|
+
*/
|
|
545
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
546
|
+
/**
|
|
547
|
+
* 取消loading
|
|
548
|
+
*/
|
|
549
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
550
|
+
/**
|
|
551
|
+
* 清除loading定时器
|
|
552
|
+
*/
|
|
553
|
+
CLEAR_LOADING_TIMER(): void;
|
|
554
|
+
/**
|
|
555
|
+
* 设置侧边栏折叠状态
|
|
556
|
+
*/
|
|
557
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
558
|
+
/**
|
|
559
|
+
* 切换侧边栏折叠状态
|
|
560
|
+
*/
|
|
561
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
562
|
+
/**
|
|
563
|
+
* 重置
|
|
564
|
+
*/
|
|
565
|
+
RESET: () => void;
|
|
566
|
+
}) => void) => () => void;
|
|
567
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<Omit<LayoutConfigStore, "SET_STATE" | "ADD_TAB" | "REMOVE_TAB" | "SET_ACTIVE_TAB_KEY" | "CLEAR_TABS" | "SET_LOADING" | "HIDE_LOADING" | "CLEAR_LOADING_TIMER" | "SET_SIDEBAR_COLLAPSED" | "TOGGLE_SIDEBAR_COLLAPSED" | "RESET"> & {
|
|
568
|
+
SET_STATE: (data: Update) => unknown;
|
|
569
|
+
/**
|
|
570
|
+
* 添加标签页
|
|
571
|
+
*/
|
|
572
|
+
ADD_TAB: (tab: TabItem) => void;
|
|
573
|
+
/**
|
|
574
|
+
* 移除标签页
|
|
575
|
+
*/
|
|
576
|
+
REMOVE_TAB: (key: string) => TabItem;
|
|
577
|
+
/**
|
|
578
|
+
* 设置当前激活的标签页
|
|
579
|
+
*/
|
|
580
|
+
SET_ACTIVE_TAB_KEY: (key: string) => void;
|
|
581
|
+
/**
|
|
582
|
+
* 清空所有标签页
|
|
583
|
+
*/
|
|
584
|
+
CLEAR_TABS: () => void;
|
|
585
|
+
/**
|
|
586
|
+
* 设置loading配置
|
|
587
|
+
*/
|
|
588
|
+
SET_LOADING: (config?: AxiosRequestConfig) => void;
|
|
589
|
+
/**
|
|
590
|
+
* 取消loading
|
|
591
|
+
*/
|
|
592
|
+
HIDE_LOADING: (config?: AxiosRequestConfig) => void;
|
|
593
|
+
/**
|
|
594
|
+
* 清除loading定时器
|
|
595
|
+
*/
|
|
596
|
+
CLEAR_LOADING_TIMER(): void;
|
|
597
|
+
/**
|
|
598
|
+
* 设置侧边栏折叠状态
|
|
599
|
+
*/
|
|
600
|
+
SET_SIDEBAR_COLLAPSED: (collapsed: boolean) => void;
|
|
601
|
+
/**
|
|
602
|
+
* 切换侧边栏折叠状态
|
|
603
|
+
*/
|
|
604
|
+
TOGGLE_SIDEBAR_COLLAPSED: () => void;
|
|
605
|
+
/**
|
|
606
|
+
* 重置
|
|
607
|
+
*/
|
|
608
|
+
RESET: () => void;
|
|
609
|
+
}, unknown, unknown>>;
|
|
610
|
+
};
|
|
611
|
+
}>;
|
|
612
|
+
export {};
|