@go-wind/admin-react 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +74 -2
- package/dist/access/access-control.d.ts +39 -0
- package/dist/access/field-permission.d.ts +11 -0
- package/dist/access/index.d.ts +4 -0
- package/dist/access/use-access.d.ts +50 -0
- package/dist/admin-react.css +2 -0
- package/dist/admin-react.js +36561 -0
- package/dist/admin-react.js.map +1 -0
- package/dist/auth-gateway.d.ts +54 -0
- package/dist/components/ListTable/ResizableHeaderCell.d.ts +31 -0
- package/dist/components/ListTable/TableSkeleton.d.ts +25 -0
- package/dist/components/ListTable/index.d.ts +20 -0
- package/dist/components/Loading/index.d.ts +22 -0
- package/dist/constants.d.ts +30 -0
- package/dist/env.d.ts +5 -0
- package/dist/hooks/useClipboard.d.ts +3 -0
- package/dist/hooks/useEcharts.d.ts +10 -0
- package/dist/hooks/useKeyStroke.d.ts +13 -0
- package/dist/hooks/usePageFullscreen.d.ts +9 -0
- package/dist/hooks/useProTableScrollY.d.ts +22 -0
- package/dist/hooks/useTime.d.ts +6 -0
- package/dist/hooks/useTitle.d.ts +1 -0
- package/dist/hooks/useTokenRefresh.d.ts +26 -0
- package/dist/hooks/useWatermark.d.ts +20 -0
- package/dist/i18n/components/LocaleSwitcher/index.d.ts +1 -0
- package/dist/i18n/components/index.d.ts +1 -0
- package/dist/i18n/config/i18n.d.ts +18 -0
- package/dist/i18n/hooks/index.d.ts +2 -0
- package/dist/i18n/hooks/useI18n.d.ts +96 -0
- package/dist/i18n/hooks/useLocaleSync.d.ts +4 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/utils/detector.d.ts +26 -0
- package/dist/i18n/utils/formatter.d.ts +38 -0
- package/dist/i18n/utils/index.d.ts +3 -0
- package/dist/i18n/utils/sync.d.ts +27 -0
- package/dist/index.d.ts +41 -0
- package/dist/locales/en-US/index.d.ts +2 -0
- package/dist/locales/index.d.ts +10 -0
- package/dist/locales/zh-CN/index.d.ts +2 -0
- package/dist/nprogress-CwfUlis6.js +159 -0
- package/dist/nprogress-CwfUlis6.js.map +1 -0
- package/dist/preferences/components/PreferencesPanel/AppearancePanel.d.ts +3 -0
- package/dist/preferences/components/PreferencesPanel/GeneralPanel.d.ts +3 -0
- package/dist/preferences/components/PreferencesPanel/LayoutPanel.d.ts +3 -0
- package/dist/preferences/components/PreferencesPanel/ShortcutKeyPanel.d.ts +3 -0
- package/dist/preferences/components/PreferencesPanel/index.d.ts +8 -0
- package/dist/preferences/components/ThemeProvider/index.d.ts +9 -0
- package/dist/preferences/components/index.d.ts +2 -0
- package/dist/preferences/config/constants.d.ts +24 -0
- package/dist/preferences/config/darkTheme.d.ts +32 -0
- package/dist/preferences/config/default.d.ts +3 -0
- package/dist/preferences/config/index.d.ts +4 -0
- package/dist/preferences/config/lightTheme.d.ts +33 -0
- package/dist/preferences/hooks/index.d.ts +3 -0
- package/dist/preferences/hooks/useLocale.d.ts +23 -0
- package/dist/preferences/hooks/usePreferences.d.ts +31 -0
- package/dist/preferences/hooks/useThemeConfig.d.ts +2 -0
- package/dist/preferences/index.d.ts +5 -0
- package/dist/preferences/store/index.d.ts +24 -0
- package/dist/preferences/theme-transition.d.ts +17 -0
- package/dist/preferences/types/app.d.ts +238 -0
- package/dist/preferences/types/index.d.ts +4 -0
- package/dist/preferences/types/layout.d.ts +78 -0
- package/dist/preferences/types/preferences-root.d.ts +48 -0
- package/dist/preferences/types/theme.d.ts +29 -0
- package/dist/preferences/utils/diff.d.ts +7 -0
- package/dist/preferences/utils/merge.d.ts +9 -0
- package/dist/query-client.d.ts +9 -0
- package/dist/rolldown-runtime-BbCBk-LD.js +19 -0
- package/dist/router/factory.d.ts +7 -0
- package/dist/router/generators/generate-menus.d.ts +13 -0
- package/dist/router/generators/generate-routes-backend.d.ts +12 -0
- package/dist/router/generators/generate-routes-frontend.d.ts +17 -0
- package/dist/router/generators/index.d.ts +3 -0
- package/dist/router/index.d.ts +5 -0
- package/dist/router/routes-context.d.ts +8 -0
- package/dist/router/types/index.d.ts +207 -0
- package/dist/router/utils/index.d.ts +8 -0
- package/dist/router/utils/inject-redirect.d.ts +6 -0
- package/dist/router/utils/lazy.d.ts +11 -0
- package/dist/router/utils/loader.d.ts +14 -0
- package/dist/router/utils/menu.d.ts +5 -0
- package/dist/router/utils/merge-route-modules.d.ts +23 -0
- package/dist/router/utils/reset-routes.d.ts +18 -0
- package/dist/router/utils/sort-routes.d.ts +5 -0
- package/dist/router/utils/transform-meta-to-handle.d.ts +11 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/storage.class.d.ts +125 -0
- package/dist/storage/storage.types.d.ts +199 -0
- package/dist/stores/auth.d.ts +56 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/user.d.ts +32 -0
- package/dist/transport/rest/captcha-headers.d.ts +2 -0
- package/dist/transport/rest/index.d.ts +8 -0
- package/dist/transport/rest/modules/downloader.d.ts +9 -0
- package/dist/transport/rest/modules/interceptor.d.ts +9 -0
- package/dist/transport/rest/modules/uploader.d.ts +10 -0
- package/dist/transport/rest/pagination.d.ts +73 -0
- package/dist/transport/rest/preset-interceptors.d.ts +25 -0
- package/dist/transport/rest/request-api.d.ts +6 -0
- package/dist/transport/rest/request-client.d.ts +87 -0
- package/dist/transport/rest/types.d.ts +38 -0
- package/dist/transport/rest/utils.d.ts +16 -0
- package/dist/transport/sse/event.d.ts +44 -0
- package/dist/transport/sse/index.d.ts +5 -0
- package/dist/transport/sse/sse_client.d.ts +76 -0
- package/dist/transport/sse/types.d.ts +27 -0
- package/dist/types.d.ts +44 -0
- package/dist/utils/color.d.ts +27 -0
- package/dist/utils/date.d.ts +5 -0
- package/dist/utils/diff.d.ts +6 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/inference.d.ts +111 -0
- package/dist/utils/merge.d.ts +17 -0
- package/dist/utils/nprogress.d.ts +11 -0
- package/dist/utils/tree.d.ts +27 -0
- package/dist/utils/url.d.ts +11 -0
- package/dist/utils/utils.d.ts +37 -0
- package/package.json +77 -3
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import type { BuiltinThemeType, ThemeModeType } from "./theme";
|
|
2
|
+
import type { AccessModeType, AuthPageLayoutType, BreadcrumbStyleType, ContentCompactType, LayoutHeaderModeType, LayoutType, LoginExpiredModeType, NavigationStyleType, PageTransitionType, PreferencesButtonPositionType, SupportedLanguagesType, TabsStyleType } from "./layout";
|
|
3
|
+
/**
|
|
4
|
+
* 应用偏好设置
|
|
5
|
+
*/
|
|
6
|
+
export interface AppPreferences {
|
|
7
|
+
/** 权限模式 */
|
|
8
|
+
accessMode: AccessModeType;
|
|
9
|
+
/** 登录注册页面布局 */
|
|
10
|
+
authPageLayout: AuthPageLayoutType;
|
|
11
|
+
/** 检查更新轮询时间 */
|
|
12
|
+
checkUpdatesInterval: number;
|
|
13
|
+
/** 是否开启灰色模式 */
|
|
14
|
+
colorGrayMode: boolean;
|
|
15
|
+
/** 是否开启色弱模式 */
|
|
16
|
+
colorWeakMode: boolean;
|
|
17
|
+
/** 是否开启紧凑模式 */
|
|
18
|
+
compact: boolean;
|
|
19
|
+
/** 是否开启内容紧凑模式 */
|
|
20
|
+
contentCompact: ContentCompactType;
|
|
21
|
+
defaultAvatar: string;
|
|
22
|
+
dynamicTitle: boolean;
|
|
23
|
+
/** 是否开启检查更新 */
|
|
24
|
+
enableCheckUpdates: boolean;
|
|
25
|
+
/** 是否显示偏好设置 */
|
|
26
|
+
enablePreferences: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @zh_CN 是否开启refreshToken
|
|
29
|
+
*/
|
|
30
|
+
enableRefreshToken: boolean;
|
|
31
|
+
/** 是否启用多租户 */
|
|
32
|
+
enableTenant: boolean;
|
|
33
|
+
/** 是否移动端 */
|
|
34
|
+
isMobile: boolean;
|
|
35
|
+
/** 布局方式 */
|
|
36
|
+
layout: LayoutType;
|
|
37
|
+
/** 支持的语言 */
|
|
38
|
+
locale: SupportedLanguagesType;
|
|
39
|
+
/** 登录过期模式 */
|
|
40
|
+
loginExpiredMode: LoginExpiredModeType;
|
|
41
|
+
/** 应用名 */
|
|
42
|
+
name: string;
|
|
43
|
+
/** 应用版本 */
|
|
44
|
+
version: string;
|
|
45
|
+
/** 偏好设置按钮位置 */
|
|
46
|
+
preferencesButtonPosition: PreferencesButtonPositionType;
|
|
47
|
+
/**
|
|
48
|
+
* @zh_CN 是否开启水印
|
|
49
|
+
*/
|
|
50
|
+
watermark: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 面包屑偏好设置
|
|
54
|
+
*/
|
|
55
|
+
export interface BreadcrumbPreferences {
|
|
56
|
+
/** 面包屑是否启用 */
|
|
57
|
+
enable: boolean;
|
|
58
|
+
/** 面包屑是否只有一个时隐藏 */
|
|
59
|
+
hideOnlyOne: boolean;
|
|
60
|
+
/** 面包屑首页图标是否可见 */
|
|
61
|
+
showHome: boolean;
|
|
62
|
+
/** 面包屑图标是否可见 */
|
|
63
|
+
showIcon: boolean;
|
|
64
|
+
/** 面包屑风格 */
|
|
65
|
+
styleType: BreadcrumbStyleType;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* 版权偏好设置
|
|
69
|
+
*/
|
|
70
|
+
export interface CopyrightPreferences {
|
|
71
|
+
/** 版权公司名 */
|
|
72
|
+
companyName: string;
|
|
73
|
+
/** 版权公司名链接 */
|
|
74
|
+
companySiteLink: string;
|
|
75
|
+
/** 版权日期 */
|
|
76
|
+
date: string;
|
|
77
|
+
/** 版权是否可见 */
|
|
78
|
+
enable: boolean;
|
|
79
|
+
/** 备案号 */
|
|
80
|
+
icp: string;
|
|
81
|
+
/** 备案号链接 */
|
|
82
|
+
icpLink: string;
|
|
83
|
+
/** 设置面板是否显示*/
|
|
84
|
+
settingShow?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 顶栏偏好设置
|
|
88
|
+
*/
|
|
89
|
+
export interface HeaderPreferences {
|
|
90
|
+
/** 顶栏是否启用 */
|
|
91
|
+
enable: boolean;
|
|
92
|
+
/** 顶栏是否隐藏,css-隐藏 */
|
|
93
|
+
hidden: boolean;
|
|
94
|
+
/** header显示模式 */
|
|
95
|
+
mode: LayoutHeaderModeType;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 底栏偏好设置
|
|
99
|
+
*/
|
|
100
|
+
export interface FooterPreferences {
|
|
101
|
+
/** 底栏是否可见 */
|
|
102
|
+
enable: boolean;
|
|
103
|
+
/** 底栏是否固定 */
|
|
104
|
+
fixed: boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* logo偏好设置
|
|
108
|
+
*/
|
|
109
|
+
export interface LogoPreferences {
|
|
110
|
+
/** logo是否可见 */
|
|
111
|
+
enable: boolean;
|
|
112
|
+
/** logo地址 */
|
|
113
|
+
source: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* 导航偏好设置
|
|
117
|
+
*/
|
|
118
|
+
export interface NavigationPreferences {
|
|
119
|
+
/** 导航菜单手风琴模式 */
|
|
120
|
+
accordion: boolean;
|
|
121
|
+
/** 导航菜单是否切割,只在 layout=mixed-nav 生效 */
|
|
122
|
+
split: boolean;
|
|
123
|
+
/** 导航菜单风格 */
|
|
124
|
+
styleType: NavigationStyleType;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 侧边栏偏好设置
|
|
128
|
+
*/
|
|
129
|
+
export interface SidebarPreferences {
|
|
130
|
+
/** 侧边栏是否折叠 */
|
|
131
|
+
collapsed: boolean;
|
|
132
|
+
/** 侧边栏折叠时,是否显示title */
|
|
133
|
+
collapsedShowTitle: boolean;
|
|
134
|
+
/** 侧边栏是否可见 */
|
|
135
|
+
enable: boolean;
|
|
136
|
+
/** 菜单自动展开状态 */
|
|
137
|
+
expandOnHover: boolean;
|
|
138
|
+
/** 侧边栏扩展区域是否折叠 */
|
|
139
|
+
extraCollapse: boolean;
|
|
140
|
+
/** 侧边栏是否隐藏 - css */
|
|
141
|
+
hidden: boolean;
|
|
142
|
+
/** 侧边栏宽度 */
|
|
143
|
+
width: number;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* 快捷键偏好设置
|
|
147
|
+
*/
|
|
148
|
+
export interface ShortcutKeyPreferences {
|
|
149
|
+
/** 是否启用快捷键-全局 */
|
|
150
|
+
enable: boolean;
|
|
151
|
+
/** 是否启用全局锁屏快捷键 */
|
|
152
|
+
globalLockScreen: boolean;
|
|
153
|
+
/** 是否启用全局注销快捷键 */
|
|
154
|
+
globalLogout: boolean;
|
|
155
|
+
/** 是否启用全局偏好设置快捷键 */
|
|
156
|
+
globalPreferences: boolean;
|
|
157
|
+
/** 是否启用全局搜索快捷键 */
|
|
158
|
+
globalSearch: boolean;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 标签栏偏好设置
|
|
162
|
+
*/
|
|
163
|
+
export interface TabbarPreferences {
|
|
164
|
+
/** 是否开启多标签页拖拽 */
|
|
165
|
+
draggable: boolean;
|
|
166
|
+
/** 是否开启多标签页 */
|
|
167
|
+
enable: boolean;
|
|
168
|
+
/** 标签页高度 */
|
|
169
|
+
height: number;
|
|
170
|
+
/** 开启标签页缓存功能 */
|
|
171
|
+
keepAlive: boolean;
|
|
172
|
+
/** 是否持久化标签 */
|
|
173
|
+
persist: boolean;
|
|
174
|
+
/** 是否开启多标签页图标 */
|
|
175
|
+
showIcon: boolean;
|
|
176
|
+
/** 显示最大化按钮 */
|
|
177
|
+
showMaximize: boolean;
|
|
178
|
+
/** 显示更多按钮 */
|
|
179
|
+
showMore: boolean;
|
|
180
|
+
/** 标签页风格 */
|
|
181
|
+
styleType: TabsStyleType;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* 主题偏好设置
|
|
185
|
+
*/
|
|
186
|
+
export interface ThemePreferences {
|
|
187
|
+
/** 内置主题名 */
|
|
188
|
+
builtinType: BuiltinThemeType;
|
|
189
|
+
/** 错误色 */
|
|
190
|
+
colorDestructive: string;
|
|
191
|
+
/** 主题色 */
|
|
192
|
+
colorPrimary: string;
|
|
193
|
+
/** 成功色 */
|
|
194
|
+
colorSuccess: string;
|
|
195
|
+
/** 警告色 */
|
|
196
|
+
colorWarning: string;
|
|
197
|
+
/** 当前主题 */
|
|
198
|
+
mode: ThemeModeType;
|
|
199
|
+
/** 圆角 */
|
|
200
|
+
radius: string;
|
|
201
|
+
/** 是否开启半深色header(只在theme='light'时生效) */
|
|
202
|
+
semiDarkHeader: boolean;
|
|
203
|
+
/** 是否开启半深色菜单(只在theme='light'时生效) */
|
|
204
|
+
semiDarkSidebar: boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* 页面切换动画偏好设置
|
|
208
|
+
*/
|
|
209
|
+
export interface TransitionPreferences {
|
|
210
|
+
/** 页面切换动画是否启用 */
|
|
211
|
+
enable: boolean;
|
|
212
|
+
loading: boolean;
|
|
213
|
+
/** 页面切换动画 */
|
|
214
|
+
name: PageTransitionType | string;
|
|
215
|
+
/** 是否开启页面加载进度动画 */
|
|
216
|
+
progress: boolean;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* 小部件偏好设置
|
|
220
|
+
*/
|
|
221
|
+
export interface WidgetPreferences {
|
|
222
|
+
/** 是否启用全屏部件 */
|
|
223
|
+
fullscreen: boolean;
|
|
224
|
+
/** 是否启用全局搜索部件 */
|
|
225
|
+
globalSearch: boolean;
|
|
226
|
+
/** 是否启用语言切换部件 */
|
|
227
|
+
languageToggle: boolean;
|
|
228
|
+
/** 是否开启锁屏功能 */
|
|
229
|
+
lockScreen: boolean;
|
|
230
|
+
/** 是否显示通知部件 */
|
|
231
|
+
notification: boolean;
|
|
232
|
+
/** 显示刷新按钮 */
|
|
233
|
+
refresh: boolean;
|
|
234
|
+
/** 是否显示侧边栏显示/隐藏部件 */
|
|
235
|
+
sidebarToggle: boolean;
|
|
236
|
+
/** 是否显示主题切换部件 */
|
|
237
|
+
themeToggle: boolean;
|
|
238
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 登录过期模式
|
|
3
|
+
* modal 弹窗模式
|
|
4
|
+
* page 页面模式
|
|
5
|
+
*/
|
|
6
|
+
export type LoginExpiredModeType = "modal" | "page";
|
|
7
|
+
/**
|
|
8
|
+
* 权限模式
|
|
9
|
+
* backend 后端权限模式
|
|
10
|
+
* frontend 前端权限模式
|
|
11
|
+
*/
|
|
12
|
+
export type AccessModeType = "backend" | "frontend";
|
|
13
|
+
/**
|
|
14
|
+
* 支持的语言类型
|
|
15
|
+
* 与应用使用的语言值保持一致
|
|
16
|
+
*/
|
|
17
|
+
export type SupportedLanguagesType = "zh-CN" | "en-US";
|
|
18
|
+
/**
|
|
19
|
+
* 布局方式
|
|
20
|
+
* sidebar-nav 侧边菜单布局
|
|
21
|
+
* header-nav 顶部菜单布局
|
|
22
|
+
* mixed-nav 侧边&顶部菜单布局
|
|
23
|
+
* sidebar-mixed-nav 侧边混合菜单布局
|
|
24
|
+
* full-content 全屏内容布局
|
|
25
|
+
*/
|
|
26
|
+
export type LayoutType = "full-content" | "header-nav" | "mixed-nav" | "sidebar-mixed-nav" | "sidebar-nav";
|
|
27
|
+
/**
|
|
28
|
+
* 偏好设置按钮位置
|
|
29
|
+
* fixed 固定在右侧
|
|
30
|
+
* header 顶栏
|
|
31
|
+
* auto 自动
|
|
32
|
+
*/
|
|
33
|
+
export type PreferencesButtonPositionType = "auto" | "fixed" | "header";
|
|
34
|
+
/**
|
|
35
|
+
* 内容区域宽度
|
|
36
|
+
* compact 紧凑宽度
|
|
37
|
+
* wide 宽屏
|
|
38
|
+
*/
|
|
39
|
+
export type ContentCompactType = "compact" | "wide";
|
|
40
|
+
/**
|
|
41
|
+
* 布局头部模式
|
|
42
|
+
* auto 自动隐藏
|
|
43
|
+
* auto-scroll 滚动时自动隐藏
|
|
44
|
+
* fixed 固定在顶部
|
|
45
|
+
* static 随内容滚动
|
|
46
|
+
*/
|
|
47
|
+
export type LayoutHeaderModeType = "auto" | "auto-scroll" | "fixed" | "static";
|
|
48
|
+
/**
|
|
49
|
+
* 导航风格
|
|
50
|
+
* plain 朴素
|
|
51
|
+
* rounded 圆润
|
|
52
|
+
*/
|
|
53
|
+
export type NavigationStyleType = "plain" | "rounded";
|
|
54
|
+
/**
|
|
55
|
+
* 标签栏风格
|
|
56
|
+
* brisk 轻快
|
|
57
|
+
* card 卡片
|
|
58
|
+
* chrome 谷歌
|
|
59
|
+
* plain 朴素
|
|
60
|
+
*/
|
|
61
|
+
export type TabsStyleType = "brisk" | "card" | "chrome" | "plain";
|
|
62
|
+
/**
|
|
63
|
+
* 页面切换动画
|
|
64
|
+
*/
|
|
65
|
+
export type PageTransitionType = "fade" | "fade-down" | "fade-slide" | "fade-up";
|
|
66
|
+
/**
|
|
67
|
+
* 页面切换动画
|
|
68
|
+
* panel-center 居中布局
|
|
69
|
+
* panel-left 居左布局
|
|
70
|
+
* panel-right 居右布局
|
|
71
|
+
*/
|
|
72
|
+
export type AuthPageLayoutType = "panel-center" | "panel-left" | "panel-right";
|
|
73
|
+
/**
|
|
74
|
+
* 面包屑样式
|
|
75
|
+
* background 背景
|
|
76
|
+
* normal 默认
|
|
77
|
+
*/
|
|
78
|
+
export type BreadcrumbStyleType = 'background' | 'normal';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AppPreferences, BreadcrumbPreferences, CopyrightPreferences, FooterPreferences, HeaderPreferences, LogoPreferences, NavigationPreferences, ShortcutKeyPreferences, SidebarPreferences, TabbarPreferences, ThemePreferences, TransitionPreferences, WidgetPreferences } from "./app";
|
|
2
|
+
/**
|
|
3
|
+
* 偏好设置总接口
|
|
4
|
+
*/
|
|
5
|
+
export interface Preferences {
|
|
6
|
+
/** 全局配置 */
|
|
7
|
+
app: AppPreferences;
|
|
8
|
+
/** 顶栏配置 */
|
|
9
|
+
breadcrumb: BreadcrumbPreferences;
|
|
10
|
+
/** 版权配置 */
|
|
11
|
+
copyright: CopyrightPreferences;
|
|
12
|
+
/** 底栏配置 */
|
|
13
|
+
footer: FooterPreferences;
|
|
14
|
+
/** 面包屑配置 */
|
|
15
|
+
header: HeaderPreferences;
|
|
16
|
+
/** logo配置 */
|
|
17
|
+
logo: LogoPreferences;
|
|
18
|
+
/** 导航配置 */
|
|
19
|
+
navigation: NavigationPreferences;
|
|
20
|
+
/** 快捷键配置 */
|
|
21
|
+
shortcutKeys: ShortcutKeyPreferences;
|
|
22
|
+
/** 侧边栏配置 */
|
|
23
|
+
sidebar: SidebarPreferences;
|
|
24
|
+
/** 标签页配置 */
|
|
25
|
+
tabbar: TabbarPreferences;
|
|
26
|
+
/** 主题配置 */
|
|
27
|
+
theme: ThemePreferences;
|
|
28
|
+
/** 动画配置 */
|
|
29
|
+
transition: TransitionPreferences;
|
|
30
|
+
/** 功能配置 */
|
|
31
|
+
widget: WidgetPreferences;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 偏好设置接口
|
|
35
|
+
*/
|
|
36
|
+
export type PreferencesKeys = keyof Preferences;
|
|
37
|
+
export type DeepPartial<T> = {
|
|
38
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* 偏好设置初始化参数
|
|
42
|
+
*/
|
|
43
|
+
export interface InitialOptions {
|
|
44
|
+
/** 命名空间 */
|
|
45
|
+
namespace: string;
|
|
46
|
+
/** 覆盖默认偏好设置 */
|
|
47
|
+
overrides?: DeepPartial<Preferences>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 主题模式
|
|
3
|
+
* auto 自动
|
|
4
|
+
* dark 暗色
|
|
5
|
+
* light 亮色
|
|
6
|
+
*/
|
|
7
|
+
export type ThemeModeType = "auto" | "dark" | "light";
|
|
8
|
+
/**
|
|
9
|
+
* 内置主题名称
|
|
10
|
+
* custom 自定义
|
|
11
|
+
* deep-blue 深蓝
|
|
12
|
+
* deep-green 深绿
|
|
13
|
+
* default 默认
|
|
14
|
+
* gray 灰色
|
|
15
|
+
* green 绿色
|
|
16
|
+
* neutral 中性色
|
|
17
|
+
* orange 橙色
|
|
18
|
+
* pink 粉色
|
|
19
|
+
* red 红色
|
|
20
|
+
* rose 玫红色
|
|
21
|
+
* sky-blue 天蓝色
|
|
22
|
+
* slate 石板灰色
|
|
23
|
+
* stone 石灰色
|
|
24
|
+
* violet 紫罗兰色
|
|
25
|
+
* yellow 黄色
|
|
26
|
+
* zinc 锌色
|
|
27
|
+
* (Record<never, never> & string) 自定义主题
|
|
28
|
+
*/
|
|
29
|
+
export type BuiltinThemeType = "custom" | "deep-blue" | "deep-green" | "default" | "gray" | "green" | "neutral" | "orange" | "pink" | "red" | "rose" | "sky-blue" | "slate" | "stone" | "violet" | "yellow" | "zinc" | (Record<never, never> & string);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DeepPartial } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* 深度比较 initial 与 current,产出「与出厂默认的增量」对象(只含被改过的叶子值)。
|
|
4
|
+
* 与 vben 的 diffPreference 同语义:复制偏好设置时导出的是增量 overrides,
|
|
5
|
+
* 不是全量快照(对齐 framework/effects/layouts/widgets/preferences/preferences-drawer.vue 的 handleCopy)。
|
|
6
|
+
*/
|
|
7
|
+
export declare function diffDeep<T extends object>(initial: T, current: DeepPartial<T>): DeepPartial<T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DeepPartial } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* 深度合并对象
|
|
4
|
+
*/
|
|
5
|
+
export declare function mergeDeep<T extends object>(target: T, source: DeepPartial<T>): T;
|
|
6
|
+
/**
|
|
7
|
+
* 判断是否为普通对象
|
|
8
|
+
*/
|
|
9
|
+
export declare function isPlainObject(value: any): value is Record<string, any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
export declare const queryClient: QueryClient;
|
|
3
|
+
/**
|
|
4
|
+
* 宿主在 bootstrap 阶段调整 query 行为。
|
|
5
|
+
* @param options.isDev 开发环境姿态:任何查询错误重试 3 次(默认仅网络错误重试 1 次)
|
|
6
|
+
*/
|
|
7
|
+
export declare function configureQueryClient(options?: {
|
|
8
|
+
isDev?: boolean;
|
|
9
|
+
}): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, c = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, l = (e, t, n) => (c(e, t, "default"), n && c(n, t, "default")), u = (n, r, o) => (o = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : o, n));
|
|
19
|
+
export { u as i, s as n, l as r, o as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createBrowserRouter } from 'react-router-dom';
|
|
2
|
+
import type { GenerateMenuAndRoutesOptions, AppRouteObject } from './types';
|
|
3
|
+
import type { AccessModeType } from '../preferences';
|
|
4
|
+
export declare const createAccessibleRouter: (mode: AccessModeType, options: GenerateMenuAndRoutesOptions) => Promise<{
|
|
5
|
+
router: ReturnType<typeof createBrowserRouter>;
|
|
6
|
+
routes: AppRouteObject[];
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AppMenu, AppRouteObject } from "../../router/types";
|
|
2
|
+
/**
|
|
3
|
+
* 根据路由配置生成菜单列表
|
|
4
|
+
* @param routes - 路由配置数组(AppRouteObject[],含 meta)
|
|
5
|
+
* @param getAllRoutes - 获取完整路由树的函数(用于解析动态路径)
|
|
6
|
+
* @returns 菜单树数组(AppMenu[]),可直接传给 ProLayout
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateMenus(routes: AppRouteObject[], getAllRoutes: () => AppRouteObject[]): Promise<AppMenu[]>;
|
|
9
|
+
/**
|
|
10
|
+
* 工具:判断菜单是否应该显示(权限 + 配置)
|
|
11
|
+
* 可用于二次过滤
|
|
12
|
+
*/
|
|
13
|
+
export declare const shouldShowMenu: (menu: AppMenu, permissions: string[]) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AppRouteObject, GenerateRoutesOptions } from "../../router/types";
|
|
2
|
+
/**
|
|
3
|
+
* 动态生成路由 - 后端方式(React 版本)
|
|
4
|
+
* @param options - 配置选项
|
|
5
|
+
* @returns 转换后的路由树(AppRouteObject[]),可直接传入 createBrowserRouter
|
|
6
|
+
*/
|
|
7
|
+
export declare function generateRoutesByBackend(options: GenerateRoutesOptions): Promise<AppRouteObject[]>;
|
|
8
|
+
/**
|
|
9
|
+
* 标准化视图路径(适配 React 目录结构)
|
|
10
|
+
* @param path - 后端返回的组件路径,如 "./views/system/user" 或 "/views/dashboard"
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeViewPath(path: string): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { AppRouteObject } from "../../router/types";
|
|
3
|
+
/**
|
|
4
|
+
* 动态生成路由 - 前端权限过滤方式
|
|
5
|
+
* @param routes - 静态路由表(AppRouteObject[],含 meta)
|
|
6
|
+
* @param permissions - 用户权限码列表
|
|
7
|
+
* @param forbiddenElement - 无权限时渲染的元素(<Forbidden />)
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateRoutesByFrontend(routes: AppRouteObject[], permissions: string[], forbiddenElement?: ReactNode): Promise<AppRouteObject[]>;
|
|
10
|
+
/**
|
|
11
|
+
* 判断路由是否有权限访问
|
|
12
|
+
* @param route - 路由对象
|
|
13
|
+
* @param permissions - 用户权限码列表
|
|
14
|
+
* @returns 是否允许访问
|
|
15
|
+
*/
|
|
16
|
+
declare function hasPermission(route: AppRouteObject, permissions: string[]): boolean;
|
|
17
|
+
export { hasPermission };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AppRouteObject } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* 当前实际挂载的路由树(createAccessibleRouter 的产物):
|
|
4
|
+
* 后端模式=后端下发路由;前端模式=权限过滤后的静态路由。
|
|
5
|
+
* 侧栏等消费方必须镜像此树保证"菜单即路由"——后端模式下若回退静态全量表,
|
|
6
|
+
* 会出现未授权菜单可见、点击 404 的越权观感。
|
|
7
|
+
*/
|
|
8
|
+
export declare const AccessibleRoutesContext: import("react").Context<AppRouteObject[] | null>;
|