@hsu-react/ui 2.0.0 → 2.0.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/es/layout/Breadcrumb/index.d.ts +1 -1
- package/es/layout/Header/index.d.ts +1 -1
- package/es/layout/Menu/index.d.ts +1 -1
- package/es/layout/index.d.ts +11 -0
- package/es/layout/index.js +8 -0
- package/lib/layout/Breadcrumb/index.d.ts +1 -1
- package/lib/layout/Header/index.d.ts +1 -1
- package/lib/layout/Menu/index.d.ts +1 -1
- package/lib/layout/index.d.ts +11 -0
- package/lib/layout/index.js +7 -0
- package/package.json +1 -1
- package/src/layout/Breadcrumb/index.tsx +1 -1
- package/src/layout/Header/index.md +15 -0
- package/src/layout/Header/index.tsx +1 -1
- package/src/layout/Menu/index.tsx +1 -1
- package/src/layout/index.ts +12 -0
|
@@ -18,7 +18,7 @@ export interface AccountAction {
|
|
|
18
18
|
/** 危险动作(退出登录之类),悬浮态用红色区分 */
|
|
19
19
|
danger?: boolean;
|
|
20
20
|
}
|
|
21
|
-
interface HeaderProps {
|
|
21
|
+
export interface HeaderProps {
|
|
22
22
|
router: Parameters<typeof Breadcrumb>[0]["router"];
|
|
23
23
|
collapsed: boolean;
|
|
24
24
|
onToggleCollapsed: () => void;
|
|
@@ -16,7 +16,7 @@ export type MenuType = ItemType & {
|
|
|
16
16
|
renderLabel?: (label: string) => ReactNode;
|
|
17
17
|
parent?: MenuType;
|
|
18
18
|
};
|
|
19
|
-
interface MenuProps extends AntdMenuProps {
|
|
19
|
+
export interface MenuProps extends AntdMenuProps {
|
|
20
20
|
router: RouteType[];
|
|
21
21
|
collapsed?: boolean;
|
|
22
22
|
menuItems?: MenuType[];
|
package/es/layout/index.d.ts
CHANGED
|
@@ -18,6 +18,17 @@ import Theme from "./Theme";
|
|
|
18
18
|
import I18nStore from "./I18n/I18nStore";
|
|
19
19
|
import ThemeStore from "./Theme/ThemeStore";
|
|
20
20
|
export type { RouteType, MetaType } from "./types";
|
|
21
|
+
/**
|
|
22
|
+
* 各组件的公开类型。第一个真实消费方(vita-admin-starter)一上来就需要 `AccountAction`
|
|
23
|
+
* 与 `MenuType` —— 前者用来声明账号菜单,后者用来存 mixed 布局回传的子项。它们原本只在
|
|
24
|
+
* 各自模块里导出,消费方只能写 `@hsu-react/ui/es/layout/Header` 这种深路径,等于把内部
|
|
25
|
+
* 目录结构变成公开契约。统一从这里出。
|
|
26
|
+
*/
|
|
27
|
+
export type { AccountAction, HeaderProps } from "./Header";
|
|
28
|
+
export type { MenuType, MenuProps } from "./Menu";
|
|
29
|
+
export type { TabType, NavTabBarProps } from "./NavTabBar";
|
|
30
|
+
export type { BreadcrumbType, BreadcrumbProps } from "./Breadcrumb";
|
|
31
|
+
export type { InternationalizationProps } from "./I18n";
|
|
21
32
|
export type { ThemeProps } from "./Theme";
|
|
22
33
|
export { default as useSetTabTitle, NavTabBarTitleContent } from "./_hooks/useSetTabTitle";
|
|
23
34
|
export { default as useReload, ReloadContent } from "./_hooks/useReload";
|
package/es/layout/index.js
CHANGED
|
@@ -17,6 +17,14 @@ import NavTabBar from "./NavTabBar";
|
|
|
17
17
|
import Theme from "./Theme";
|
|
18
18
|
import I18nStore from "./I18n/I18nStore";
|
|
19
19
|
import ThemeStore from "./Theme/ThemeStore";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 各组件的公开类型。第一个真实消费方(vita-admin-starter)一上来就需要 `AccountAction`
|
|
23
|
+
* 与 `MenuType` —— 前者用来声明账号菜单,后者用来存 mixed 布局回传的子项。它们原本只在
|
|
24
|
+
* 各自模块里导出,消费方只能写 `@hsu-react/ui/es/layout/Header` 这种深路径,等于把内部
|
|
25
|
+
* 目录结构变成公开契约。统一从这里出。
|
|
26
|
+
*/
|
|
27
|
+
|
|
20
28
|
export { default as useSetTabTitle, NavTabBarTitleContent } from "./_hooks/useSetTabTitle";
|
|
21
29
|
export { default as useReload, ReloadContent } from "./_hooks/useReload";
|
|
22
30
|
export { default as useDropTab, NavTabBarContent } from "./_hooks/useDropTab";
|
|
@@ -18,7 +18,7 @@ export interface AccountAction {
|
|
|
18
18
|
/** 危险动作(退出登录之类),悬浮态用红色区分 */
|
|
19
19
|
danger?: boolean;
|
|
20
20
|
}
|
|
21
|
-
interface HeaderProps {
|
|
21
|
+
export interface HeaderProps {
|
|
22
22
|
router: Parameters<typeof Breadcrumb>[0]["router"];
|
|
23
23
|
collapsed: boolean;
|
|
24
24
|
onToggleCollapsed: () => void;
|
|
@@ -16,7 +16,7 @@ export type MenuType = ItemType & {
|
|
|
16
16
|
renderLabel?: (label: string) => ReactNode;
|
|
17
17
|
parent?: MenuType;
|
|
18
18
|
};
|
|
19
|
-
interface MenuProps extends AntdMenuProps {
|
|
19
|
+
export interface MenuProps extends AntdMenuProps {
|
|
20
20
|
router: RouteType[];
|
|
21
21
|
collapsed?: boolean;
|
|
22
22
|
menuItems?: MenuType[];
|
package/lib/layout/index.d.ts
CHANGED
|
@@ -18,6 +18,17 @@ import Theme from "./Theme";
|
|
|
18
18
|
import I18nStore from "./I18n/I18nStore";
|
|
19
19
|
import ThemeStore from "./Theme/ThemeStore";
|
|
20
20
|
export type { RouteType, MetaType } from "./types";
|
|
21
|
+
/**
|
|
22
|
+
* 各组件的公开类型。第一个真实消费方(vita-admin-starter)一上来就需要 `AccountAction`
|
|
23
|
+
* 与 `MenuType` —— 前者用来声明账号菜单,后者用来存 mixed 布局回传的子项。它们原本只在
|
|
24
|
+
* 各自模块里导出,消费方只能写 `@hsu-react/ui/es/layout/Header` 这种深路径,等于把内部
|
|
25
|
+
* 目录结构变成公开契约。统一从这里出。
|
|
26
|
+
*/
|
|
27
|
+
export type { AccountAction, HeaderProps } from "./Header";
|
|
28
|
+
export type { MenuType, MenuProps } from "./Menu";
|
|
29
|
+
export type { TabType, NavTabBarProps } from "./NavTabBar";
|
|
30
|
+
export type { BreadcrumbType, BreadcrumbProps } from "./Breadcrumb";
|
|
31
|
+
export type { InternationalizationProps } from "./I18n";
|
|
21
32
|
export type { ThemeProps } from "./Theme";
|
|
22
33
|
export { default as useSetTabTitle, NavTabBarTitleContent } from "./_hooks/useSetTabTitle";
|
|
23
34
|
export { default as useReload, ReloadContent } from "./_hooks/useReload";
|
package/lib/layout/index.js
CHANGED
|
@@ -66,6 +66,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
66
66
|
* 只负责外观三态(light / dark / 跟随系统)与侧栏导航的专属配色。
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* 各组件的公开类型。第一个真实消费方(vita-admin-starter)一上来就需要 `AccountAction`
|
|
71
|
+
* 与 `MenuType` —— 前者用来声明账号菜单,后者用来存 mixed 布局回传的子项。它们原本只在
|
|
72
|
+
* 各自模块里导出,消费方只能写 `@hsu-react/ui/es/layout/Header` 这种深路径,等于把内部
|
|
73
|
+
* 目录结构变成公开契约。统一从这里出。
|
|
74
|
+
*/
|
|
75
|
+
|
|
69
76
|
/**
|
|
70
77
|
* 显式标注这个命名空间的类型,而不是让 TS 去推断。
|
|
71
78
|
*
|
package/package.json
CHANGED
|
@@ -79,6 +79,21 @@ import Layout from "@hsu-react/ui/es/layout";
|
|
|
79
79
|
|
|
80
80
|
顺序上,`ConfigProvider` 在最外层(它提供令牌与 antd 主题),`Layout.Theme` 在内层(它只管外观三态与侧栏配色,不重复做全局主题)。
|
|
81
81
|
|
|
82
|
+
## 类型
|
|
83
|
+
|
|
84
|
+
组件用到的公开类型都从 `@hsu-react/ui/es/layout` 出,不要深路径引到各组件目录里去:
|
|
85
|
+
|
|
86
|
+
```ts | pure
|
|
87
|
+
import type {
|
|
88
|
+
RouteType, MetaType, // 路由与其附加信息
|
|
89
|
+
AccountAction, HeaderProps, // 顶栏
|
|
90
|
+
MenuType, MenuProps, // 菜单
|
|
91
|
+
TabType, NavTabBarProps, // 页签栏
|
|
92
|
+
BreadcrumbType, BreadcrumbProps,
|
|
93
|
+
InternationalizationProps, ThemeProps,
|
|
94
|
+
} from "@hsu-react/ui/es/layout";
|
|
95
|
+
```
|
|
96
|
+
|
|
82
97
|
## 样式
|
|
83
98
|
|
|
84
99
|
顶栏的样式是**跟着组件发的**,引入组件即可,不需要在应用里另外准备一份全局 CSS。
|
package/src/layout/index.ts
CHANGED
|
@@ -20,6 +20,18 @@ import I18nStore from "./I18n/I18nStore";
|
|
|
20
20
|
import ThemeStore from "./Theme/ThemeStore";
|
|
21
21
|
|
|
22
22
|
export type { RouteType, MetaType } from "./types";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 各组件的公开类型。第一个真实消费方(vita-admin-starter)一上来就需要 `AccountAction`
|
|
26
|
+
* 与 `MenuType` —— 前者用来声明账号菜单,后者用来存 mixed 布局回传的子项。它们原本只在
|
|
27
|
+
* 各自模块里导出,消费方只能写 `@hsu-react/ui/es/layout/Header` 这种深路径,等于把内部
|
|
28
|
+
* 目录结构变成公开契约。统一从这里出。
|
|
29
|
+
*/
|
|
30
|
+
export type { AccountAction, HeaderProps } from "./Header";
|
|
31
|
+
export type { MenuType, MenuProps } from "./Menu";
|
|
32
|
+
export type { TabType, NavTabBarProps } from "./NavTabBar";
|
|
33
|
+
export type { BreadcrumbType, BreadcrumbProps } from "./Breadcrumb";
|
|
34
|
+
export type { InternationalizationProps } from "./I18n";
|
|
23
35
|
export type { ThemeProps } from "./Theme";
|
|
24
36
|
|
|
25
37
|
export { default as useSetTabTitle, NavTabBarTitleContent } from "./_hooks/useSetTabTitle";
|