@react-antd-module/runtime 0.1.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.
Files changed (176) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -0
  3. package/dist/api/home.d.ts +10 -0
  4. package/dist/api/notifications/index.d.ts +2 -0
  5. package/dist/api/system/menu/index.d.ts +6 -0
  6. package/dist/api/system/menu/types.d.ts +19 -0
  7. package/dist/api/system/role/index.d.ts +10 -0
  8. package/dist/api/system/role/types.d.ts +9 -0
  9. package/dist/api/user/index.d.ts +16 -0
  10. package/dist/api/user/types.d.ts +26 -0
  11. package/dist/components/access-control/index.d.ts +15 -0
  12. package/dist/components/basic-button/index.d.ts +7 -0
  13. package/dist/components/basic-content/index.d.ts +7 -0
  14. package/dist/components/basic-form/form-items/form-avatar-item.d.ts +6 -0
  15. package/dist/components/basic-form/form-items/form-tree-item.d.ts +13 -0
  16. package/dist/components/basic-form/form-items/index.d.ts +2 -0
  17. package/dist/components/basic-form/index.d.ts +1 -0
  18. package/dist/components/basic-table/constants.d.ts +1 -0
  19. package/dist/components/basic-table/index.d.ts +12 -0
  20. package/dist/components/basic-table/styles.d.ts +6 -0
  21. package/dist/components/exception-page/index.d.ts +3 -0
  22. package/dist/components/fullscreen-button/index.d.ts +17 -0
  23. package/dist/components/global-spin/index.d.ts +6 -0
  24. package/dist/components/iframe/index.d.ts +1 -0
  25. package/dist/components/jss-theme-provider/index.d.ts +26 -0
  26. package/dist/components/not-found/index.d.ts +6 -0
  27. package/dist/components/page-error/index.d.ts +2 -0
  28. package/dist/components/scrollbar/index.d.ts +7 -0
  29. package/dist/components/unknown-component/index.d.ts +6 -0
  30. package/dist/constants/options.d.ts +9 -0
  31. package/dist/constants/regular-expressions.d.ts +22 -0
  32. package/dist/constants/rules.d.ts +80 -0
  33. package/dist/hooks/use-access/constants.d.ts +24 -0
  34. package/dist/hooks/use-access/index.d.ts +9 -0
  35. package/dist/hooks/use-css-var/index.d.ts +17 -0
  36. package/dist/hooks/use-current-route/index.d.ts +6 -0
  37. package/dist/hooks/use-device-type/index.d.ts +9 -0
  38. package/dist/hooks/use-language/index.d.ts +5 -0
  39. package/dist/hooks/use-layout-menu/index.d.ts +6 -0
  40. package/dist/hooks/use-layout-style/index.d.ts +19 -0
  41. package/dist/hooks/use-preferences/index.d.ts +61 -0
  42. package/dist/icons/index.d.ts +3 -0
  43. package/dist/icons/local-icons.d.ts +17 -0
  44. package/dist/icons/menu-icons.d.ts +4 -0
  45. package/dist/icons/ri.d.ts +14 -0
  46. package/dist/icons/types.d.ts +9 -0
  47. package/dist/index.d.ts +41 -0
  48. package/dist/layout/constants.d.ts +50 -0
  49. package/dist/layout/container-layout/index.d.ts +11 -0
  50. package/dist/layout/hooks/index.d.ts +1 -0
  51. package/dist/layout/hooks/use-layout.d.ts +20 -0
  52. package/dist/layout/keep-alive-layer/index.d.ts +15 -0
  53. package/dist/layout/layout-content/index.d.ts +3 -0
  54. package/dist/layout/layout-effects/index.d.ts +9 -0
  55. package/dist/layout/layout-footer/index.d.ts +5 -0
  56. package/dist/layout/layout-header/components/fullscreen-button.d.ts +2 -0
  57. package/dist/layout/layout-header/components/language-button.d.ts +2 -0
  58. package/dist/layout/layout-header/components/theme-button.d.ts +9 -0
  59. package/dist/layout/layout-header/components/user-menu.d.ts +2 -0
  60. package/dist/layout/layout-header/index.d.ts +5 -0
  61. package/dist/layout/layout-menu/index.d.ts +17 -0
  62. package/dist/layout/layout-menu/style.d.ts +6 -0
  63. package/dist/layout/layout-menu/types.d.ts +26 -0
  64. package/dist/layout/layout-menu/use-menu.d.ts +7 -0
  65. package/dist/layout/layout-menu/utils.d.ts +49 -0
  66. package/dist/layout/layout-mixed-sidebar/first-column-menu.d.ts +9 -0
  67. package/dist/layout/layout-mixed-sidebar/index.d.ts +14 -0
  68. package/dist/layout/layout-mobile-menu/index.d.ts +1 -0
  69. package/dist/layout/layout-root/index.d.ts +5 -0
  70. package/dist/layout/layout-sidebar/index.d.ts +5 -0
  71. package/dist/layout/layout-tabbar/components/draggable-tab-bar.d.ts +16 -0
  72. package/dist/layout/layout-tabbar/components/tab-maximize.d.ts +10 -0
  73. package/dist/layout/layout-tabbar/components/tab-options.d.ts +17 -0
  74. package/dist/layout/layout-tabbar/hooks/use-dropdown-menu.d.ts +26 -0
  75. package/dist/layout/layout-tabbar/index.d.ts +5 -0
  76. package/dist/layout/layout-tabbar/style.d.ts +6 -0
  77. package/dist/layout/parent-layout/index.d.ts +1 -0
  78. package/dist/layout/widgets/breadcrumb-views/index.d.ts +1 -0
  79. package/dist/layout/widgets/global-search/components/search-footer.d.ts +5 -0
  80. package/dist/layout/widgets/global-search/components/search-panel.d.ts +11 -0
  81. package/dist/layout/widgets/global-search/index.d.ts +1 -0
  82. package/dist/layout/widgets/logo/index.d.ts +9 -0
  83. package/dist/layout/widgets/notification/index.d.ts +19 -0
  84. package/dist/layout/widgets/notification/notification-container.d.ts +2 -0
  85. package/dist/layout/widgets/notification/types.d.ts +7 -0
  86. package/dist/layout/widgets/preferences/blocks/animation/index.d.ts +1 -0
  87. package/dist/layout/widgets/preferences/blocks/footer/index.d.ts +1 -0
  88. package/dist/layout/widgets/preferences/blocks/general/index.d.ts +1 -0
  89. package/dist/layout/widgets/preferences/blocks/general/utils.d.ts +1 -0
  90. package/dist/layout/widgets/preferences/blocks/index.d.ts +7 -0
  91. package/dist/layout/widgets/preferences/blocks/layout/constants.d.ts +4 -0
  92. package/dist/layout/widgets/preferences/blocks/layout/index.d.ts +1 -0
  93. package/dist/layout/widgets/preferences/blocks/sidebar/index.d.ts +1 -0
  94. package/dist/layout/widgets/preferences/blocks/tabbar/index.d.ts +1 -0
  95. package/dist/layout/widgets/preferences/blocks/theme/builtin.d.ts +1 -0
  96. package/dist/layout/widgets/preferences/blocks/theme/index.d.ts +2 -0
  97. package/dist/layout/widgets/preferences/blocks/theme/theme.d.ts +1 -0
  98. package/dist/layout/widgets/preferences/index.d.ts +2 -0
  99. package/dist/layout/widgets/preferences/number-input-spinner.d.ts +10 -0
  100. package/dist/layout/widgets/preferences/select-item.d.ts +9 -0
  101. package/dist/layout/widgets/preferences/switch-item.d.ts +8 -0
  102. package/dist/layout/widgets/preferences/text-input.d.ts +8 -0
  103. package/dist/layout/widgets/sider-trigger/index.d.ts +5 -0
  104. package/dist/locales/helper.d.ts +15 -0
  105. package/dist/locales/index.d.ts +18 -0
  106. package/dist/locales/t.d.ts +10 -0
  107. package/dist/module-loader/define-module.d.ts +11 -0
  108. package/dist/module-loader/index.d.ts +20 -0
  109. package/dist/module-loader/keep-alive.d.ts +18 -0
  110. package/dist/module-loader/semver.d.ts +8 -0
  111. package/dist/module-loader/slots.d.ts +9 -0
  112. package/dist/module-loader/types.d.ts +81 -0
  113. package/dist/pages/login/components/code-login.d.ts +7 -0
  114. package/dist/pages/login/components/forgot-password.d.ts +6 -0
  115. package/dist/pages/login/components/password-login.d.ts +1 -0
  116. package/dist/pages/login/components/register-password.d.ts +8 -0
  117. package/dist/pages/login/constants.d.ts +6 -0
  118. package/dist/pages/login/form-mode-context.d.ts +5 -0
  119. package/dist/pages/login/index.d.ts +1 -0
  120. package/dist/plugins/hide-loading.d.ts +1 -0
  121. package/dist/plugins/loading.d.ts +7 -0
  122. package/dist/router/constants.d.ts +1 -0
  123. package/dist/router/extra-info/index.d.ts +1 -0
  124. package/dist/router/extra-info/route-path.d.ts +12 -0
  125. package/dist/router/guard/auth-guard.d.ts +21 -0
  126. package/dist/router/guard/index.d.ts +1 -0
  127. package/dist/router/guard/utils.d.ts +2 -0
  128. package/dist/router/index.d.ts +12 -0
  129. package/dist/router/routes/config.d.ts +7 -0
  130. package/dist/router/routes/core/auth.d.ts +3 -0
  131. package/dist/router/routes/core/exception.d.ts +12 -0
  132. package/dist/router/routes/core/fallback.d.ts +3 -0
  133. package/dist/router/routes/core/index.d.ts +2 -0
  134. package/dist/router/routes/index.d.ts +114 -0
  135. package/dist/router/types.d.ts +79 -0
  136. package/dist/router/utils/add-route-id-by-path.d.ts +81 -0
  137. package/dist/router/utils/ascending.d.ts +95 -0
  138. package/dist/router/utils/flatten-routes.d.ts +5 -0
  139. package/dist/router/utils/generate-menu-items-from-routes.d.ts +10 -0
  140. package/dist/router/utils/generate-routes-from-backend.d.ts +79 -0
  141. package/dist/router/utils/generate-routes-from-frontend.d.ts +5 -0
  142. package/dist/router/utils/merge-route-modules.d.ts +2 -0
  143. package/dist/router/utils/remove-trailing-slash.d.ts +10 -0
  144. package/dist/router/utils/resolve-layout.d.ts +21 -0
  145. package/dist/runtime.js +9179 -0
  146. package/dist/store/access.d.ts +14 -0
  147. package/dist/store/auth.d.ts +20 -0
  148. package/dist/store/global.d.ts +12 -0
  149. package/dist/store/preferences/index.d.ts +80 -0
  150. package/dist/store/preferences/types.d.ts +254 -0
  151. package/dist/store/tabs.d.ts +343 -0
  152. package/dist/store/user.d.ts +7 -0
  153. package/dist/types/app-info.d.ts +18 -0
  154. package/dist/utils/cn/index.d.ts +2 -0
  155. package/dist/utils/dom/index.d.ts +14 -0
  156. package/dist/utils/get-all-expanded-keys/index.d.ts +1 -0
  157. package/dist/utils/get-app-info/index.d.ts +13 -0
  158. package/dist/utils/get-app-namespace/index.d.ts +1 -0
  159. package/dist/utils/iframe-guard.d.ts +18 -0
  160. package/dist/utils/is/index.d.ts +56 -0
  161. package/dist/utils/is-dark-theme/index.d.ts +7 -0
  162. package/dist/utils/is-light-theme/index.d.ts +7 -0
  163. package/dist/utils/is-windows-os/index.d.ts +6 -0
  164. package/dist/utils/progress/index.d.ts +3 -0
  165. package/dist/utils/remember-route/index.d.ts +1 -0
  166. package/dist/utils/request/constants.d.ts +4 -0
  167. package/dist/utils/request/error-response.d.ts +12 -0
  168. package/dist/utils/request/global-progress.d.ts +21 -0
  169. package/dist/utils/request/go-login.d.ts +6 -0
  170. package/dist/utils/request/index.d.ts +1 -0
  171. package/dist/utils/request/refresh.d.ts +11 -0
  172. package/dist/utils/request/scoped.d.ts +17 -0
  173. package/dist/utils/static-antd/index.d.ts +12 -0
  174. package/dist/utils/toggle-html-class/index.d.ts +9 -0
  175. package/dist/utils/tree/index.d.ts +35 -0
  176. package/package.json +60 -0
@@ -0,0 +1,61 @@
1
+ /**
2
+ * 包装下用户偏好设置的参数,不需要存储在 localStorage 中,但是为了方便使用的变量可以在这里出现。
3
+ *
4
+ * @returns 返回包含用户偏好设置的对象,包括主题、是否为默认设置、是否为深色主题、是否为浅色主题
5
+ */
6
+ export declare function usePreferences(): {
7
+ isDefault: boolean;
8
+ isDark: boolean;
9
+ isLight: boolean;
10
+ theme: import("../../store/preferences/types").ThemeType;
11
+ colorBlindMode: boolean;
12
+ colorGrayMode: boolean;
13
+ themeRadius: number;
14
+ themeColorPrimary: string;
15
+ builtinTheme: import("../../store/preferences/types").BuiltinThemeType;
16
+ tabbarStyleType: import("../../store/preferences/types").TabsStyleType;
17
+ tabbarEnable: boolean;
18
+ tabbarShowIcon: boolean;
19
+ tabbarPersist: boolean;
20
+ tabbarDraggable: boolean;
21
+ tabbarShowMore: boolean;
22
+ tabbarShowMaximize: boolean;
23
+ transitionProgress: boolean;
24
+ transitionLoading: boolean;
25
+ transitionEnable: boolean;
26
+ transitionName: string;
27
+ navigationStyle: import("../../store/preferences/types").NavigationType;
28
+ watermark: boolean;
29
+ watermarkContent: string;
30
+ enableBackTopButton: boolean;
31
+ pageLayout: import("../../store/preferences/types").PageLayoutType;
32
+ enableFrontendAceess: boolean;
33
+ enableBackendAccess: boolean;
34
+ language: import("../../locales").LanguageType;
35
+ enableDynamicTitle: boolean;
36
+ enableCheckUpdates: boolean;
37
+ checkUpdatesInterval: number;
38
+ sidebarEnable?: boolean;
39
+ sidebarWidth: number;
40
+ sideCollapsedWidth: number;
41
+ sidebarCollapsed: boolean;
42
+ sidebarCollapseShowTitle: boolean;
43
+ sidebarExtraCollapsedWidth: number;
44
+ firstColumnWidthInTwoColumnNavigation: number;
45
+ sidebarTheme: import("antd").MenuProps["theme"];
46
+ accordion: boolean;
47
+ enableFooter: boolean;
48
+ fixedFooter: boolean;
49
+ companyName: string;
50
+ companyWebsite: string;
51
+ copyrightDate: string;
52
+ ICPNumber: string;
53
+ ICPLink: string;
54
+ reset: () => void;
55
+ changeSiteTheme: (theme: import("../../store/preferences/types").ThemeType) => void;
56
+ changeLanguage: (language: import("../../locales").LanguageType) => void;
57
+ setPreferences: {
58
+ <T>(key: string, value: T): void;
59
+ <T extends Partial<import("../../store/preferences/types").PreferencesState>>(preferences: T): void;
60
+ };
61
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./local-icons";
2
+ export * from "./menu-icons";
3
+ export * from "./ri";
@@ -0,0 +1,17 @@
1
+ import type { IconComponent } from "./types";
2
+ /**
3
+ * 本地 SVG 图标集(构建期由 unplugin-icons 内联,P3.1 起包装导出,
4
+ * 避免 `~icons/*` 虚拟模块泄漏进包声明)。
5
+ */
6
+ export declare const EmbeddedIcon: IconComponent;
7
+ export declare const ExternalIcon: IconComponent;
8
+ export declare const LayoutCenterIcon: IconComponent;
9
+ export declare const LayoutLeftIcon: IconComponent;
10
+ export declare const LayoutRightIcon: IconComponent;
11
+ export declare const MixedNavigationIcon: IconComponent;
12
+ export declare const OutsidePageIcon: IconComponent;
13
+ export declare const ProfileCardIcon: IconComponent;
14
+ export declare const ServerErrorIcon: IconComponent;
15
+ export declare const SideNavigationIcon: IconComponent;
16
+ export declare const TopNavigationIcon: IconComponent;
17
+ export declare const TwoColumnNavigationIcon: IconComponent;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Icons used in the menu.
3
+ */
4
+ export declare const menuIcons: Record<string, any>;
@@ -0,0 +1,14 @@
1
+ import type { IconComponent } from "./types";
2
+ /**
3
+ * Remix Icon 常用子集(构建期由 unplugin-icons 内联,P3.1 起包装导出,
4
+ * 避免 `~icons/*` 虚拟模块泄漏进包声明)。
5
+ */
6
+ export declare const RiAccountCircleLine: IconComponent;
7
+ export declare const RiContrastFill: IconComponent;
8
+ export declare const RiFullscreenExitLine: IconComponent;
9
+ export declare const RiFullscreenLine: IconComponent;
10
+ export declare const RiMailCheckLine: IconComponent;
11
+ export declare const RiMoonIcon: IconComponent;
12
+ export declare const RiReactjsLine: IconComponent;
13
+ export declare const RiSunIcon: IconComponent;
14
+ export declare const RiUserSettingsLine: IconComponent;
@@ -0,0 +1,9 @@
1
+ import type { ComponentType, SVGProps } from "react";
2
+ /**
3
+ * 图标组件统一形状(P3.1)。
4
+ *
5
+ * 图标在构建期由 unplugin-icons 内联为组件;运行时出口不直接
6
+ * re-export `~icons/*` 虚拟模块的 default,而是以本类型注解包装,
7
+ * 使 d.ts 声明自足、不泄漏虚拟模块说明符。
8
+ */
9
+ export type IconComponent = ComponentType<SVGProps<SVGSVGElement>>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * `@react-antd-module/runtime` 主入口。
3
+ *
4
+ * 这是模块工程**唯一**应该 import 的框架入口(设计文档 D3 / §4.3)。
5
+ * 出口已于 P3.1 依据 P1 的实际用量冻结(tests/runtime-exports.test.ts
6
+ * 即冻结契约):components/basic-*、api、hooks、store、icons、
7
+ * utils/tree、constants/options、路由与模块类型。
8
+ *
9
+ * 注意:antd、react、react-router、@tanstack/react-query 等共享依赖
10
+ * 由宿主的 importmap 提供,模块应直接 import 它们,不要从 runtime 转出。
11
+ */
12
+ import "./styles/index.css";
13
+ export * from "./api/home";
14
+ export * from "./api/system/menu";
15
+ export * from "./api/system/role";
16
+ export * from "./api/user";
17
+ export { AccessControl } from "./components/access-control";
18
+ export { BasicButton } from "./components/basic-button";
19
+ export { BasicContent } from "./components/basic-content";
20
+ export * from "./components/basic-form";
21
+ export { BasicTable } from "./components/basic-table";
22
+ export type { BasicTableProps } from "./components/basic-table";
23
+ export { Iframe } from "./components/iframe";
24
+ export * from "./constants/options";
25
+ export * from "./hooks/use-access";
26
+ export { usePreferences } from "./hooks/use-preferences";
27
+ export * from "./icons";
28
+ export { LayoutEffects } from "./layout/layout-effects";
29
+ export { setupI18n } from "./locales";
30
+ export { getModule, getModules, getRegisteredApiPrefix, getRegisteredStore, getRoutes, loadAll, unloadModule, } from "./module-loader";
31
+ export { defineModule } from "./module-loader/define-module";
32
+ export { useSlotNodes } from "./module-loader/slots";
33
+ export type { ModuleConfig, ModuleContext, ModuleDefinition, ModuleI18n, ModuleLifecycle, } from "./module-loader/types";
34
+ export type { Manifest, ManifestModuleEntry, ModuleInstance, } from "./module-loader/types";
35
+ export type { AppRouteRecordRaw, RouteMeta } from "./router/types";
36
+ export { useAuthStore } from "./store/auth";
37
+ export { useUserStore } from "./store/user";
38
+ export type { AppInfo } from "./types/app-info";
39
+ export { getAllExpandedKeys } from "./utils/get-all-expanded-keys";
40
+ export { getAppInfo } from "./utils/get-app-info";
41
+ export * from "./utils/tree";
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Layout Header Height
3
+ */
4
+ export declare const headerHeight = 48;
5
+ /**
6
+ * Layout Footer Height
7
+ */
8
+ export declare const footerHeight = 40;
9
+ /**
10
+ * Sidebar Title Height
11
+ */
12
+ export declare const sidebarTitleHeight = 52;
13
+ /**
14
+ * Sider Trigger Height
15
+ */
16
+ export declare const siderTriggerHeight = 40;
17
+ /**
18
+ * Tabbar Height Height
19
+ */
20
+ export declare const tabbarHeight = 35;
21
+ /**
22
+ * @zh 默认命名空间
23
+ * @en Default namespace
24
+ */
25
+ export declare const DEFAULT_NAMESPACE = "react-antd-admin";
26
+ /**
27
+ * @zh 主内容区域的元素 ID
28
+ * @en Main content element ID
29
+ */
30
+ export declare const ELEMENT_ID_MAIN_CONTENT = "__react-antd-admin_main_content";
31
+ /**
32
+ * @zh layout content 组件的高度
33
+ * @en Height of the layout content component
34
+ */
35
+ export declare const CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT = "--react-antd-admin-content-height";
36
+ /**
37
+ * @zh layout content 组件的宽度
38
+ * @en Width of the layout content component
39
+ */
40
+ export declare const CSS_VARIABLE_LAYOUT_CONTENT_WIDTH = "--react-antd-admin-content-width";
41
+ /**
42
+ * @zh layout header 组件的高度
43
+ * @en Height of the layout header component
44
+ */
45
+ export declare const CSS_VARIABLE_LAYOUT_HEADER_HEIGHT = "--react-antd-admin-header-height";
46
+ /**
47
+ * @zh layout footer 组件的高度
48
+ * @en Height of the layout footer component
49
+ */
50
+ export declare const CSS_VARIABLE_LAYOUT_FOOTER_HEIGHT = "--react-antd-admin-footer-height";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Please do not use this component through lazy, otherwise the switching routing page will flash.
3
+ * 请不要通过 lazy 使用这个组件,否则切换路由页面会发生闪动。
4
+ *
5
+ * NO:
6
+ * const ContainerLayout = lazy(() => import("./index"));
7
+ *
8
+ * YES:
9
+ * import ContainerLayout from "./index";
10
+ */
11
+ export default function ContainerLayout(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./use-layout";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 获取当前页面的布局类型信息
3
+ *
4
+ * @returns 返回包含当前布局类型信息的对象,包含:
5
+ * - currentLayout: 当前导航类型
6
+ * - isSideNav: 是否为侧边导航
7
+ * - isTopNav: 是否为顶部导航
8
+ * - isMixedNav: 是否为混合导航
9
+ * - isTwoColumnNav: 是否为双列导航
10
+ */
11
+ export declare function useLayout(): {
12
+ currentLayout: import("../../store/preferences/types").NavigationType;
13
+ isSideNav: boolean;
14
+ isTopNav: boolean;
15
+ isMixedNav: boolean;
16
+ isTwoColumnNav: boolean;
17
+ sidebarWidth: number;
18
+ sideCollapsedWidth: number;
19
+ firstColumnWidthInTwoColumnNavigation: number;
20
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * KeepAlive 固定层(P2.1)。
3
+ *
4
+ * 设计要点(设计文档 §4.4 / B13 / R9):
5
+ * - 从 `ContainerLayout → LayoutContent` 上移为 shell 固定层组件,缓存逻辑不再耦合
6
+ * 某个具体布局组件;后续布局去中心化(handle.layout)不会影响缓存是否生效。
7
+ * - `exclude` 改由 module-loader 汇总各模块 `handle.keepAlive` 计算
8
+ * (`getKeepAliveExcludeKeys`),而非 access store 的 flatRouteList。
9
+ * - 只包裹「页面 outlet」本身:顶部 chrome(header / sidebar / tabbar)在 KeepAlive
10
+ * 之外渲染,因此整站 chrome 不进入缓存,避免切回路由时 chrome 状态错位。
11
+ *
12
+ * 注意:这里刻意不把 KeepAlive 直接包在 LayoutRoot 的 <Outlet/> 外层,否则会把
13
+ * chrome 一起缓存,违背「整站 chrome 不消失 / 状态不错位」的约束。
14
+ */
15
+ export default function KeepAliveLayer(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export interface LayoutContentProps {
2
+ }
3
+ export default function LayoutContent(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 全局副作用(不含路由守卫):动态标题、暗色主题 html.dark、NProgress 收尾。
3
+ *
4
+ * 偏差 4(layout e2e H4 暴露):这些 effect 原先只存在于 LayoutRoot,而
5
+ * LayoutRoot 同时携带 AuthGuard——宿主(shell)为免登录能力绕开 LayoutRoot
6
+ * 后,副作用一并丢失:主题切换只改 store、html.dark 永不生效。抽取为本组件
7
+ * 供两条链路共用:App 链 = LayoutRoot 内部使用;宿主链 = 根路由直接挂载。
8
+ */
9
+ export declare function LayoutEffects(): null;
@@ -0,0 +1,5 @@
1
+ interface LayoutFooterProps {
2
+ className?: string;
3
+ }
4
+ export default function LayoutFooter({ className }: LayoutFooterProps): import("#node_modules/@types/react").JSX.Element | null;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { FullscreenButtonProps } from "../../../components/fullscreen-button/index";
2
+ export declare function FullscreenButton({ target, ...restProps }: FullscreenButtonProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { ButtonProps } from "antd";
2
+ export declare function LanguageButton({ ...restProps }: ButtonProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ButtonProps } from "antd";
2
+ /**
3
+ * @zh 主题切换组件
4
+ * 允许用户通过按钮切换网站的亮色和暗色主题
5
+ *
6
+ * @en Theme Button Component
7
+ * Allows users to toggle between light and dark themes of the website via a button
8
+ */
9
+ export declare function ThemeButton({ ...restProps }: ButtonProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { ButtonProps } from "antd";
2
+ export declare function UserMenu({ ...restProps }: ButtonProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface LayoutHeaderProps {
2
+ className?: string;
3
+ children?: React.ReactNode;
4
+ }
5
+ export default function LayoutHeader({ className, children }: LayoutHeaderProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { MenuProps } from "antd";
2
+ import type { MenuItemType } from "./types";
3
+ interface LayoutMenuProps {
4
+ mode?: MenuProps["mode"];
5
+ /**
6
+ * 控制是否自动展开当前路由对应的菜单项
7
+ *
8
+ * Why?
9
+ * 注意:当菜单模式为顶部导航模式,菜单 mode 为 horizontal,初次进入页面时,菜单不应自动展开,可以指定 autoExpandCurrentMenu 为 false 关闭自动展开功能
10
+ * @see https://github.com/user-attachments/assets/705ae01d-db7f-4f42-b4dd-66adba0dd68f
11
+ */
12
+ autoExpandCurrentMenu?: boolean;
13
+ menus?: MenuItemType[];
14
+ handleMenuSelect?: (key: string, mode: MenuProps["mode"]) => void;
15
+ }
16
+ export default function LayoutMenu({ mode, autoExpandCurrentMenu, handleMenuSelect, menus, }: LayoutMenuProps): import("#node_modules/@types/react").JSX.Element;
17
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 显式标注返回的 classes 形状(P3.5 / TS2883):
3
+ * 推断类型会引用 jss 的 Classes(非直接依赖,声明不可移植),
4
+ * 这里用结构化等价类型 Record<C, string> 替代,声明产物零额外依赖。
5
+ */
6
+ export declare const useStyles: (data?: any) => Record<"menuBackgroundColor", string>;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 菜单项目类型
3
+ */
4
+ export interface MenuItemType {
5
+ /**
6
+ * 菜单路径,item 的唯一标志
7
+ */
8
+ key: string;
9
+ /**
10
+ * 菜单项标题
11
+ */
12
+ label: React.ReactNode;
13
+ /**
14
+ * 子菜单的菜单项
15
+ */
16
+ children?: MenuItemType[];
17
+ /**
18
+ * 菜单图标
19
+ */
20
+ icon?: React.ReactNode;
21
+ /**
22
+ * 是否禁用菜单
23
+ * @default false
24
+ */
25
+ disabled?: boolean;
26
+ }
@@ -0,0 +1,7 @@
1
+ import type { MenuProps } from "antd";
2
+ export declare function useMenu(): {
3
+ handleMenuSelect: (key: string, mode: MenuProps["mode"]) => void;
4
+ sideNavMenuKeyInSplitMode: string;
5
+ topNavItems: import("./types").MenuItemType[];
6
+ sideNavItems: import("./types").MenuItemType[];
7
+ };
@@ -0,0 +1,49 @@
1
+ import type { MenuItemType } from "./types";
2
+ /**
3
+ * 将菜单树中的所有 label 转换为国际化文本
4
+ * @param menus 原始菜单数组
5
+ * @param t Translation 函数
6
+ * @returns 转换后的菜单数组
7
+ */
8
+ export declare function translateMenus(menus: MenuItemType[], t: (key: string) => string): MenuItemType[];
9
+ /**
10
+ * 通过路径查找菜单
11
+ *
12
+ * @param list 菜单列表
13
+ * @param path 菜单路径
14
+ * @returns 找到的菜单对象,未找到则返回 null
15
+ */
16
+ export declare function findMenuByPath(list: MenuItemType[], path?: string): MenuItemType | null;
17
+ /**
18
+ * 通过路径查找根菜单
19
+ *
20
+ * @param menus 菜单列表
21
+ * @param path 菜单路径,可选
22
+ * @returns 包含查找到的菜单、根菜单和根菜单路径的对象
23
+ */
24
+ export declare function findRootMenuByPath(menus: MenuItemType[], path?: string): {
25
+ findMenu: MenuItemType | null;
26
+ rootMenu: MenuItemType | null;
27
+ rootMenuPath: string | null;
28
+ };
29
+ /**
30
+ * 递归查找第一个子菜单路径下的最深层级的第一个菜单项
31
+ *
32
+ * @param splitSideNavItems 菜单列表
33
+ * @returns 找到的最深层级的第一个菜单项
34
+ */
35
+ export declare function findDeepestFirstItem(splitSideNavItems: MenuItemType[]): MenuItemType | null;
36
+ /**
37
+ * 获取菜单项中所有键及其对应的层级
38
+ *
39
+ * @param menuItems1 菜单项数组
40
+ * @returns 一个对象,键为菜单项的 key,值为菜单项的层级
41
+ */
42
+ export declare function getLevelKeys(menuItems1: MenuItemType[]): Record<string, number>;
43
+ /**
44
+ * 获取菜单项的父级键
45
+ *
46
+ * @param menuItems 菜单项数组
47
+ * @returns 返回记录每个菜单项键对应的父级键数组的对象
48
+ */
49
+ export declare function getParentKeys(menuItems: MenuItemType[]): Record<string, string[]>;
@@ -0,0 +1,9 @@
1
+ import type { MenuProps } from "antd";
2
+ import type { MenuItemType } from "../layout-menu/types";
3
+ interface FirstColumnMenuProps {
4
+ menus?: MenuItemType[];
5
+ sideNavMenuKeyInSplitMode?: string;
6
+ handleMenuSelect?: (key: string, mode: MenuProps["mode"]) => void;
7
+ }
8
+ export default function FirstColumnMenu({ handleMenuSelect, menus, sideNavMenuKeyInSplitMode, }: FirstColumnMenuProps): import("#node_modules/@types/react").JSX.Element;
9
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { MenuProps } from "antd";
2
+ import type { MenuItemType } from "../layout-menu/types";
3
+ interface LayoutMixedSidebarProps {
4
+ computedSidebarWidth?: number;
5
+ topNavItems?: MenuItemType[];
6
+ sideNavItems?: MenuItemType[];
7
+ sideNavMenuKeyInSplitMode?: string;
8
+ handleMenuSelect?: (key: string, mode: MenuProps["mode"]) => void;
9
+ }
10
+ /**
11
+ * 双列布局侧边栏
12
+ */
13
+ export default function LayoutMixedSidebar({ computedSidebarWidth, sideNavItems, topNavItems, handleMenuSelect, sideNavMenuKeyInSplitMode, }: LayoutMixedSidebarProps): import("#node_modules/@types/react").JSX.Element;
14
+ export {};
@@ -0,0 +1 @@
1
+ export default function LayoutMobileMenu(): import("#node_modules/@types/react").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @zh 根布局组件
3
+ * @en Root layout component
4
+ */
5
+ export default function LayoutRoot(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface LayoutSidebarProps {
2
+ children?: React.ReactNode;
3
+ computedSidebarWidth: number;
4
+ }
5
+ export default function LayoutSidebar({ children, computedSidebarWidth }: LayoutSidebarProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import type { MenuProps, TabsProps } from "antd";
2
+ import type { TabItemProps } from "../../../store/tabs";
3
+ interface DraggableTabPaneProps extends React.HTMLAttributes<HTMLElement> {
4
+ "data-node-key": string;
5
+ "children": React.ReactElement;
6
+ }
7
+ export declare function DraggableTabNode({ className, children, ...props }: DraggableTabPaneProps): import("#node_modules/@types/react").ReactElement<unknown, string | import("#node_modules/@types/react").JSXElementConstructor<any>>;
8
+ interface DraggableTabBarProps {
9
+ tabBarProps: Parameters<Required<TabsProps>["renderTabBar"]>[0];
10
+ DefaultTabBar: Parameters<Required<TabsProps>["renderTabBar"]>[1];
11
+ tabItems: TabItemProps[];
12
+ items: (tabKey: string) => MenuProps["items"];
13
+ onClickMenu: (menuKey: string, nodeKey: string) => void;
14
+ }
15
+ export declare function DraggableTabBar({ tabBarProps, DefaultTabBar, tabItems, items, onClickMenu }: DraggableTabBarProps): import("#node_modules/@types/react").JSX.Element;
16
+ export {};
@@ -0,0 +1,10 @@
1
+ interface TabMaximizeProps {
2
+ className?: string;
3
+ }
4
+ /**
5
+ * 切换标签页最大化 / 最小化
6
+ *
7
+ * @returns 返回标签页最大化 / 最小化的按钮组件
8
+ */
9
+ export declare function TabMaximize({ className }: TabMaximizeProps): import("#node_modules/@types/react").JSX.Element;
10
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * TabOptions组件的属性接口
3
+ * @interface TabOptionsProps
4
+ * @property {string} activeKey - 当前激活的标签页的key
5
+ */
6
+ interface TabOptionsProps {
7
+ activeKey: string;
8
+ className?: string;
9
+ }
10
+ /**
11
+ * TabOptions组件
12
+ * 用于显示标签页的操作选项下拉菜单
13
+ * @param {TabOptionsProps} props - 组件属性
14
+ * @returns {JSX.Element} TabOptions组件
15
+ */
16
+ export declare function TabOptions({ activeKey, className }: TabOptionsProps): import("#node_modules/@types/react").JSX.Element;
17
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { MenuProps } from "antd";
2
+ /**
3
+ * 标签页操作的键值对象
4
+ * @readonly
5
+ * @enum {string}
6
+ * @property {string} REFRESH - 重新加载当前标签页
7
+ * @property {string} CLOSE - 关闭当前标签页
8
+ * @property {string} CLOSE_RIGHT - 关闭右侧标签页
9
+ * @property {string} CLOSE_LEFT - 关闭左侧标签页
10
+ * @property {string} CLOSE_OTHERS - 关闭其他标签页
11
+ * @property {string} CLOSE_ALL - 关闭所有标签页
12
+ */
13
+ export declare const TabActionKeys: {
14
+ readonly REFRESH: "refresh";
15
+ readonly CLOSE: "close";
16
+ readonly CLOSE_RIGHT: "closeRight";
17
+ readonly CLOSE_LEFT: "closeLeft";
18
+ readonly CLOSE_OTHERS: "closeOthers";
19
+ readonly CLOSE_ALL: "closeAll";
20
+ };
21
+ export type TabActionKey = typeof TabActionKeys[keyof typeof TabActionKeys];
22
+ /**
23
+ * 自定义钩子,用于处理标签页的下拉菜单
24
+ * @returns {[Function, Function]} 返回一个元组,包含菜单项生成函数和菜单点击处理函数
25
+ */
26
+ export declare function useDropdownMenu(): readonly [(tabKey: string) => MenuProps["items"], (menuKey: string, nodeKey: string) => void];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * LayoutTabbar 组件
3
+ * 用于渲染和管理应用程序的标签页导航
4
+ */
5
+ export default function LayoutTabbar(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 显式标注返回的 classes 形状(P3.5 / TS2883):
3
+ * 推断类型会引用 jss 的 Classes(非直接依赖,声明不可移植),
4
+ * 这里用结构化等价类型 Record<C, string> 替代,声明产物零额外依赖。
5
+ */
6
+ export declare const useStyles: (data?: any) => Record<"tabsContainer" | "resetTabs" | "brisk" | "plain" | "chrome" | "card", string>;
@@ -0,0 +1 @@
1
+ export default function ParentLayout(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function BreadcrumbViews(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface SearchFooterProps {
2
+ searchItems: number;
3
+ }
4
+ export declare function SearchFooter({ searchItems }: SearchFooterProps): import("#node_modules/@types/react").JSX.Element;
5
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { MenuItemType } from "../../../layout-menu/types";
2
+ interface SearchPanelProps {
3
+ menuItem: MenuItemType;
4
+ setActiveKey: (activeKey: string) => void;
5
+ enter: (isLink?: boolean) => void;
6
+ removeHistoryItem: (key: string) => void;
7
+ active: boolean;
8
+ showCloseButton: boolean;
9
+ }
10
+ export declare function SearchPanel({ menuItem, active, enter, setActiveKey, showCloseButton, removeHistoryItem }: SearchPanelProps): import("#node_modules/@types/react").JSX.Element;
11
+ export {};
@@ -0,0 +1 @@
1
+ export declare function GlobalSearch(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export interface LogoProps {
2
+ sidebarCollapsed: boolean;
3
+ className?: string;
4
+ }
5
+ /**
6
+ * @zh 高度 48px
7
+ * @en The height is 48px
8
+ */
9
+ export declare function Logo({ sidebarCollapsed, className }: LogoProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import type { ButtonProps } from "antd";
2
+ import type { NotificationItem } from "./types";
3
+ type NotificationEventType = "viewAll" | "makeAll" | "clear" | "read";
4
+ interface Props extends ButtonProps {
5
+ /**
6
+ * 显示圆点
7
+ */
8
+ onEventChange?: (event: NotificationEventType, item?: NotificationItem) => void;
9
+ /**
10
+ * 显示圆点
11
+ */
12
+ dot?: boolean;
13
+ /**
14
+ * 消息列表
15
+ */
16
+ notifications?: NotificationItem[];
17
+ }
18
+ export declare const NotificationPopup: React.FC<Props>;
19
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { ButtonProps } from "antd";
2
+ export declare function NotificationContainer({ ...restProps }: ButtonProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export interface NotificationItem {
2
+ avatar: string;
3
+ date: string;
4
+ isRead?: boolean;
5
+ message: string;
6
+ title: string;
7
+ }
@@ -0,0 +1 @@
1
+ export declare function Animation(): import("#node_modules/@types/react").JSX.Element;