@cloudtower/eagle 490.0.5 → 490.0.6
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 +34 -0
- package/dist/cjs/core/Cascader/cascader.widget.js +12 -12
- package/dist/cjs/core/SearchInput/SearchInput.hook.js +124 -0
- package/dist/cjs/core/SearchInput/SearchInput.js +253 -0
- package/dist/cjs/core/SearchInput/SearchInput.style.js +13 -0
- package/dist/cjs/core/index.js +6 -6
- package/dist/cjs/index.js +172 -172
- package/dist/cjs/legacy-antd.js +89 -89
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +3304 -3281
- package/dist/esm/core/Cascader/cascader.widget.js +1 -1
- package/dist/esm/core/SearchInput/SearchInput.hook.js +117 -0
- package/dist/esm/core/SearchInput/SearchInput.js +247 -0
- package/dist/esm/core/SearchInput/SearchInput.style.js +7 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/legacy-antd.js +1 -1
- package/dist/esm/stats1.html +1 -1
- package/dist/linaria.merged.scss +4417 -4388
- package/dist/src/core/Cascader/cascader.type.d.ts +1 -1
- package/dist/src/core/ImmersiveDialog/type.d.ts +127 -19
- package/dist/src/core/MediumDialog/MediumDialog.type.d.ts +49 -1
- package/dist/src/core/SearchInput/SearchInput.d.ts +2 -0
- package/dist/src/core/SearchInput/SearchInput.hook.d.ts +9 -0
- package/dist/src/core/SearchInput/SearchInput.style.d.ts +5 -0
- package/dist/src/core/SearchInput/{searchInput.type.d.ts → SearchInput.type.d.ts} +18 -2
- package/dist/src/core/SearchInput/__test__/SearchInput.hook.test.d.ts +1 -0
- package/dist/src/core/SearchInput/index.d.ts +2 -4
- package/dist/src/core/SmallDialog/SmallDialog.type.d.ts +150 -21
- package/dist/src/core/TableForm/types.d.ts +216 -68
- package/dist/src/core/WizardDialog/type.d.ts +147 -13
- package/dist/src/core/index.d.ts +0 -1
- package/dist/src/coreX/Dialogs/DeleteDialog/DeleteDialog.type.d.ts +100 -9
- package/dist/src/coreX/Dialogs/RejectDialog/RejectDialog.type.d.ts +126 -19
- package/dist/stories/docs/core/ImmersiveDialog.stories.d.ts +76 -8
- package/dist/stories/docs/core/MediumDialog.stories.d.ts +42 -8
- package/dist/stories/docs/core/SearchInput.stories.d.ts +6 -1
- package/dist/stories/docs/core/SmallDialog.stories.d.ts +86 -7
- package/dist/stories/docs/core/TableForm.stories.d.ts +40 -26
- package/dist/stories/docs/core/WizardDialog.stories.d.ts +65 -6
- package/dist/stories/docs/coreX/Dialogs/DeleteDialog.stories.d.ts +20 -19
- package/dist/stories/docs/coreX/Dialogs/RejectDialog.stories.d.ts +24 -23
- package/dist/style.css +3304 -3281
- package/docs/core/ImmersiveDialog/guide.md +298 -0
- package/docs/core/LegacyModal/migrate-guide.md +422 -0
- package/docs/core/MediumDialog/guide.md +263 -0
- package/docs/core/SmallDialog/guide.md +224 -0
- package/docs/core/TableForm/guide.md +195 -0
- package/docs/core/WizardDialog/guide.md +322 -0
- package/docs/coreX/DeleteDialog/guide.md +161 -0
- package/docs/coreX/RejectDialog/guide.md +185 -0
- package/docs/llms.txt +169 -0
- package/package.json +6 -5
- package/dist/cjs/core/SearchInput/index.js +0 -164
- package/dist/esm/core/SearchInput/index.js +0 -157
|
@@ -1,25 +1,116 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* DeleteDialog 是一个预设了删除确认样式的对话框组件,基于 SmallDialog 封装。
|
|
4
|
+
* 确认按钮默认使用危险(红色)样式,适用于需要用户二次确认的删除操作。
|
|
5
|
+
* 支持异步删除(confirmLoading)和错误信息展示。
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import React from "react";
|
|
10
|
+
* import { DeleteDialog, Button } from "@cloudtower/eagle";
|
|
11
|
+
* import { usePushModal } from "@cloudtower/eagle";
|
|
12
|
+
*
|
|
13
|
+
* const App = () => {
|
|
14
|
+
* const pushModal = usePushModal();
|
|
15
|
+
* return (
|
|
16
|
+
* <Button
|
|
17
|
+
* danger
|
|
18
|
+
* onClick={() =>
|
|
19
|
+
* pushModal({
|
|
20
|
+
* component: () => (
|
|
21
|
+
* <DeleteDialog
|
|
22
|
+
* title="删除虚拟机"
|
|
23
|
+
* description="确定要删除虚拟机 vm-prod-01 吗?"
|
|
24
|
+
* secondaryDesc="删除后数据将无法恢复。"
|
|
25
|
+
* onOk={(popModal) => {
|
|
26
|
+
* console.log("confirmed");
|
|
27
|
+
* popModal();
|
|
28
|
+
* }}
|
|
29
|
+
* />
|
|
30
|
+
* ),
|
|
31
|
+
* props: {},
|
|
32
|
+
* })
|
|
33
|
+
* }
|
|
34
|
+
* >
|
|
35
|
+
* 删除
|
|
36
|
+
* </Button>
|
|
37
|
+
* );
|
|
38
|
+
* };
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // 异步删除 + 错误处理
|
|
44
|
+
* import React, { useState } from "react";
|
|
45
|
+
* import { DeleteDialog } from "@cloudtower/eagle";
|
|
46
|
+
*
|
|
47
|
+
* const AsyncDeleteDialog = () => {
|
|
48
|
+
* const [loading, setLoading] = useState(false);
|
|
49
|
+
* const [error, setError] = useState<string>();
|
|
50
|
+
*
|
|
51
|
+
* return (
|
|
52
|
+
* <DeleteDialog
|
|
53
|
+
* title="删除集群"
|
|
54
|
+
* description="确定要删除集群 cluster-01 吗?"
|
|
55
|
+
* confirmLoading={loading}
|
|
56
|
+
* error={error}
|
|
57
|
+
* onOk={async () => {
|
|
58
|
+
* setLoading(true);
|
|
59
|
+
* setError(undefined);
|
|
60
|
+
* try {
|
|
61
|
+
* await deleteCluster("cluster-01");
|
|
62
|
+
* } catch {
|
|
63
|
+
* setError("删除失败,请重试");
|
|
64
|
+
* } finally {
|
|
65
|
+
* setLoading(false);
|
|
66
|
+
* }
|
|
67
|
+
* }}
|
|
68
|
+
* />
|
|
69
|
+
* );
|
|
70
|
+
* };
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @see SmallDialog 底层对话框组件,DeleteDialog 基于其封装
|
|
74
|
+
* @see RejectDialog 操作被拒绝/不可执行时的反馈对话框
|
|
75
|
+
*/
|
|
2
76
|
export interface DeleteDialogProps {
|
|
3
77
|
/** 弹窗标题 */
|
|
4
78
|
title: React.ReactNode;
|
|
5
|
-
/**
|
|
79
|
+
/** 主要描述文本,说明删除操作的影响 */
|
|
6
80
|
description?: React.ReactNode;
|
|
7
|
-
/**
|
|
81
|
+
/** 辅助说明文本,显示在 description 下方,使用次要颜色 */
|
|
8
82
|
secondaryDesc?: React.ReactNode;
|
|
9
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* 取消按钮文案
|
|
85
|
+
* @default "取消"(i18n: common.cancel)
|
|
86
|
+
*/
|
|
10
87
|
cancelText?: string;
|
|
11
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* 确认按钮文案
|
|
90
|
+
* @default "删除"(i18n: common.delete)
|
|
91
|
+
*/
|
|
12
92
|
okText?: string;
|
|
13
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* 点击确认按钮回调。参数 popModal 用于关闭弹窗。
|
|
95
|
+
* 异步场景下可配合 confirmLoading 使用,操作完成后手动调用 popModal() 关闭。
|
|
96
|
+
*/
|
|
14
97
|
onOk?: (popModal: () => void) => void;
|
|
15
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* 点击取消按钮或关闭弹窗回调。参数 popModal 用于关闭弹窗。
|
|
100
|
+
*/
|
|
16
101
|
onCancel?: (popModal: () => void) => void;
|
|
17
102
|
/** 自定义类名 */
|
|
18
103
|
className?: string;
|
|
19
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* 确认按钮加载状态。设为 true 后按钮显示 loading 且不可点击。
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
20
108
|
confirmLoading?: boolean;
|
|
21
|
-
/** 展示在 modal footer
|
|
109
|
+
/** 展示在 modal footer 的错误文案,用于显示删除操作失败信息 */
|
|
22
110
|
error?: React.ReactNode;
|
|
23
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* 是否展示 modal footer 的错误图标
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
24
115
|
showFooterErrorIcon?: boolean;
|
|
25
116
|
}
|
|
@@ -1,74 +1,181 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ButtonProps } from "../../../core/Button";
|
|
3
|
+
/** 拒绝原因,字符串类型 */
|
|
3
4
|
export type RejectReason = string;
|
|
5
|
+
/** 多个对象的拒绝原因映射,key 为对象名称,value 为原因列表 */
|
|
4
6
|
export type RejectContent = Record<string, RejectReason[]>;
|
|
7
|
+
/**
|
|
8
|
+
* RejectDialog 的类型枚举,决定对话框的展示模式
|
|
9
|
+
*/
|
|
5
10
|
export declare enum RejectDialogType {
|
|
11
|
+
/** 单个对象被拒绝,展示拒绝原因列表 */
|
|
6
12
|
Single = "RejectSingle",
|
|
13
|
+
/** 批量操作中全部对象被拒绝,展示每个对象的拒绝原因 */
|
|
7
14
|
All = "RejectAll",
|
|
15
|
+
/** 批量操作中部分对象被拒绝,可选择继续操作未被拒绝的部分 */
|
|
8
16
|
Part = "RejectPart",
|
|
17
|
+
/** 自定义内容模式,完全自定义对话框内容 */
|
|
9
18
|
Custom = "RejectCustom"
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* RejectDialog 基础属性,所有类型共享
|
|
22
|
+
*/
|
|
11
23
|
interface BaseRejectDialogProps {
|
|
12
24
|
/** 弹窗标题 */
|
|
13
25
|
title: React.ReactNode;
|
|
14
|
-
/**
|
|
26
|
+
/** 在描述文本之前的自定义内容区域,用于展示背景信息 */
|
|
15
27
|
beforeDescription?: React.ReactNode;
|
|
16
|
-
/**
|
|
28
|
+
/** 补充描述文本,显示在 beforeDescription 之后、拒绝内容之前 */
|
|
17
29
|
description?: React.ReactNode;
|
|
18
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* 取消按钮文案
|
|
32
|
+
* @default "取消"(i18n: common.cancel)
|
|
33
|
+
*/
|
|
19
34
|
cancelText?: string;
|
|
20
|
-
/**
|
|
35
|
+
/** 点击取消按钮或关闭弹窗回调。参数 popModal 用于关闭弹窗。 */
|
|
21
36
|
onCancel?: (popModal: () => void) => void;
|
|
22
|
-
/**
|
|
37
|
+
/** 确认按钮的额外属性,可用于覆盖按钮样式(如 danger: false) */
|
|
23
38
|
okButtonProps?: ButtonProps;
|
|
24
|
-
/**
|
|
39
|
+
/** 弹窗宽度,覆盖 SmallDialog 默认的 492px */
|
|
25
40
|
width?: number;
|
|
26
41
|
/** 自定义类名 */
|
|
27
42
|
className?: string;
|
|
28
|
-
/** 自定义footer类名 */
|
|
43
|
+
/** 自定义 footer 类名 */
|
|
29
44
|
footerClassName?: string;
|
|
30
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* 单个对象拒绝模式。
|
|
48
|
+
* 展示一个对象被拒绝的原因,支持单条文本或多条原因列表。
|
|
49
|
+
*/
|
|
31
50
|
interface SingleRejectDialogProps extends BaseRejectDialogProps {
|
|
32
51
|
type: RejectDialogType.Single;
|
|
33
|
-
/**
|
|
52
|
+
/** 拒绝原因。单条原因传字符串,多条原因传字符串数组。 */
|
|
34
53
|
content: string | string[];
|
|
35
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* 列表类型,仅当 content 为数组时生效
|
|
56
|
+
* - "ordered": 有序编号列表
|
|
57
|
+
* - "unordered": 无序圆点列表
|
|
58
|
+
* - "resource": 资源列表样式(带背景色和可选图标)
|
|
59
|
+
* @default "ordered"
|
|
60
|
+
*/
|
|
36
61
|
listType?: "ordered" | "unordered" | "resource";
|
|
37
|
-
/**
|
|
62
|
+
/** 灰色的进一步描述,显示在拒绝原因上方 */
|
|
38
63
|
secondaryDesc?: React.ReactNode;
|
|
39
|
-
/**
|
|
64
|
+
/** 资源图标,仅当 listType 为 "resource" 时显示在每项前面 */
|
|
40
65
|
resourceIcon?: React.ReactNode;
|
|
41
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* 批量全部拒绝模式。
|
|
69
|
+
* 所有选中对象均被拒绝,展示每个对象名称及其拒绝原因。
|
|
70
|
+
* 该模式不显示确认按钮,仅提供关闭操作。
|
|
71
|
+
*/
|
|
42
72
|
interface MultiAllRejectDialogProps extends BaseRejectDialogProps {
|
|
43
73
|
type: RejectDialogType.All;
|
|
44
74
|
/** 灰色的进一步描述 */
|
|
45
75
|
secondaryDesc?: React.ReactNode;
|
|
46
|
-
/** 多个对象的拒绝原因,格式为 { [对象名]:
|
|
76
|
+
/** 多个对象的拒绝原因,格式为 { [对象名]: [原因1, 原因2, ...] } */
|
|
47
77
|
content: RejectContent;
|
|
48
|
-
/**
|
|
78
|
+
/** 资源图标,显示在每个对象名称前面 */
|
|
49
79
|
resourceIcon?: React.ReactNode;
|
|
50
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* 批量部分拒绝模式。
|
|
83
|
+
* 部分选中对象被拒绝,用户可选择继续操作未被拒绝的对象。
|
|
84
|
+
* 该模式显示确认按钮(默认 danger 样式),点击后执行部分操作。
|
|
85
|
+
*/
|
|
51
86
|
interface MultiPartialRejectDialogProps extends BaseRejectDialogProps {
|
|
52
87
|
type: RejectDialogType.Part;
|
|
53
88
|
/** 灰色的进一步描述 */
|
|
54
89
|
secondaryDesc?: React.ReactNode;
|
|
55
|
-
/** 多个对象的拒绝原因,格式为 { [对象名]:
|
|
90
|
+
/** 多个对象的拒绝原因,格式为 { [对象名]: [原因1, 原因2, ...] } */
|
|
56
91
|
content: Record<string, string[]>;
|
|
57
|
-
/**
|
|
92
|
+
/** 资源图标,显示在每个对象名称前面 */
|
|
58
93
|
resourceIcon?: React.ReactNode;
|
|
59
|
-
/**
|
|
94
|
+
/** 部分拒绝时的额外说明,展示在分割线下方,说明将跳过被拒绝的对象 */
|
|
60
95
|
partialDescription: React.ReactNode;
|
|
61
|
-
/**
|
|
96
|
+
/** 确认按钮文案,如"部分升级" */
|
|
62
97
|
okText?: string;
|
|
63
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* 点击确认按钮回调。参数 popModal 用于关闭弹窗。
|
|
100
|
+
* 仅在 Part 模式下有效。
|
|
101
|
+
*/
|
|
64
102
|
onOk?: (popModal: () => void) => void;
|
|
65
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* 自定义内容模式。
|
|
106
|
+
* 完全自定义对话框内容,适用于标准模式无法满足的特殊拒绝场景。
|
|
107
|
+
* 该模式不显示确认按钮。
|
|
108
|
+
*/
|
|
66
109
|
interface CustomRejectDialogProps extends BaseRejectDialogProps {
|
|
67
110
|
type: RejectDialogType.Custom;
|
|
68
|
-
/**
|
|
111
|
+
/** 自定义内容区域,替代标准的拒绝原因列表 */
|
|
69
112
|
customContent: React.ReactNode;
|
|
70
113
|
/** 确认按钮文案 */
|
|
71
114
|
okText?: string;
|
|
72
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* RejectDialog 是操作拒绝反馈对话框,基于 SmallDialog 封装。
|
|
118
|
+
* 用于告知用户某个操作无法执行及其原因,支持四种模式:
|
|
119
|
+
* - Single: 单个对象被拒绝
|
|
120
|
+
* - All: 批量操作全部被拒绝
|
|
121
|
+
* - Part: 批量操作部分被拒绝(可继续操作未被拒绝的部分)
|
|
122
|
+
* - Custom: 自定义内容
|
|
123
|
+
*
|
|
124
|
+
* 通过 type 属性(RejectDialogType 枚举)区分不同模式,使用 TypeScript 可辨识联合类型。
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```tsx
|
|
128
|
+
* // 单个对象拒绝
|
|
129
|
+
* import React from "react";
|
|
130
|
+
* import { RejectDialog, RejectDialogType, Button } from "@cloudtower/eagle";
|
|
131
|
+
* import { usePushModal } from "@cloudtower/eagle";
|
|
132
|
+
*
|
|
133
|
+
* const App = () => {
|
|
134
|
+
* const pushModal = usePushModal();
|
|
135
|
+
* return (
|
|
136
|
+
* <Button
|
|
137
|
+
* onClick={() =>
|
|
138
|
+
* pushModal({
|
|
139
|
+
* component: () => (
|
|
140
|
+
* <RejectDialog
|
|
141
|
+
* type={RejectDialogType.Single}
|
|
142
|
+
* title="无法删除虚拟机"
|
|
143
|
+
* content="虚拟机正在运行中,请先关机再执行删除操作"
|
|
144
|
+
* description="请解决以上问题后重试"
|
|
145
|
+
* />
|
|
146
|
+
* ),
|
|
147
|
+
* props: {},
|
|
148
|
+
* })
|
|
149
|
+
* }
|
|
150
|
+
* >
|
|
151
|
+
* 删除虚拟机
|
|
152
|
+
* </Button>
|
|
153
|
+
* );
|
|
154
|
+
* };
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```tsx
|
|
159
|
+
* // 批量部分拒绝
|
|
160
|
+
* import React from "react";
|
|
161
|
+
* import { RejectDialog, RejectDialogType } from "@cloudtower/eagle";
|
|
162
|
+
*
|
|
163
|
+
* <RejectDialog
|
|
164
|
+
* type={RejectDialogType.Part}
|
|
165
|
+
* title="升级虚拟机工具"
|
|
166
|
+
* description="选中的 3 个虚拟机中,有 1 个可以升级。"
|
|
167
|
+
* content={{ vm1: ["无需升级"], vm2: ["未安装虚拟机工具"] }}
|
|
168
|
+
* partialDescription="2 个虚拟机无法升级,继续操作将跳过这些虚拟机。"
|
|
169
|
+
* okText="部分升级"
|
|
170
|
+
* onOk={(popModal) => {
|
|
171
|
+
* console.log("执行部分升级");
|
|
172
|
+
* popModal();
|
|
173
|
+
* }}
|
|
174
|
+
* />
|
|
175
|
+
* ```
|
|
176
|
+
*
|
|
177
|
+
* @see SmallDialog 底层对话框组件
|
|
178
|
+
* @see DeleteDialog 删除确认对话框,用于需要用户确认的删除操作
|
|
179
|
+
*/
|
|
73
180
|
export type RejectDialogProps = SingleRejectDialogProps | MultiAllRejectDialogProps | MultiPartialRejectDialogProps | CustomRejectDialogProps;
|
|
74
181
|
export {};
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
import { ImmersiveDialog } from "../../../src/core/ImmersiveDialog";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const
|
|
3
|
+
/**
|
|
4
|
+
* 居中内容
|
|
5
|
+
*/
|
|
6
|
+
export declare const CenterImmersiveDialog: {
|
|
7
|
+
(): React.JSX.Element;
|
|
8
|
+
storyName: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* 全宽内容
|
|
12
|
+
*/
|
|
13
|
+
export declare const FullContentImmersiveDialog: {
|
|
14
|
+
(): React.JSX.Element;
|
|
15
|
+
storyName: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 可滚动内容
|
|
19
|
+
*/
|
|
20
|
+
export declare const ScrollableImmersiveDialog: {
|
|
21
|
+
(): React.JSX.Element;
|
|
22
|
+
storyName: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* ImmersiveDialog 组件
|
|
26
|
+
*
|
|
27
|
+
* 全屏沉浸式对话框,适用于需要大面积操作空间的复杂表单和详情编辑。多步骤向导请使用 WizardDialog。
|
|
28
|
+
*
|
|
29
|
+
* ### 特性
|
|
30
|
+
* - 全屏展示,占满视口(留 10px 边距)
|
|
31
|
+
* - 支持三栏布局:左侧导航(192px)+ 中间内容(648px)+ 右侧辅助信息(192px)
|
|
32
|
+
* - `isContentFull` 模式隐藏左右面板,内容区占满宽度
|
|
33
|
+
* - 底部操作栏支持 `footerLeftAction` 自定义左侧区域
|
|
34
|
+
* - 内置初始化加载和错误重试状态
|
|
35
|
+
*/
|
|
36
|
+
declare const meta: {
|
|
7
37
|
title: "Core/ImmersiveDialog | 全屏弹窗";
|
|
8
38
|
component: typeof ImmersiveDialog;
|
|
9
39
|
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
|
|
@@ -95,17 +125,55 @@ declare const story: {
|
|
|
95
125
|
initializingError?: React.ReactNode;
|
|
96
126
|
children?: React.ReactNode;
|
|
97
127
|
}>) => React.JSX.Element)[];
|
|
128
|
+
parameters: {
|
|
129
|
+
docs: {
|
|
130
|
+
description: {
|
|
131
|
+
component: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
98
135
|
};
|
|
99
|
-
export default
|
|
136
|
+
export default meta;
|
|
100
137
|
/**
|
|
101
138
|
* 带错误信息的对话框
|
|
102
139
|
*/
|
|
103
|
-
export declare const WithError:
|
|
140
|
+
export declare const WithError: {
|
|
141
|
+
(): React.JSX.Element;
|
|
142
|
+
storyName: string;
|
|
143
|
+
};
|
|
104
144
|
/**
|
|
105
145
|
* 初始化状态
|
|
106
146
|
*/
|
|
107
|
-
export declare const Initializing:
|
|
147
|
+
export declare const Initializing: {
|
|
148
|
+
(): React.JSX.Element;
|
|
149
|
+
storyName: string;
|
|
150
|
+
};
|
|
108
151
|
/**
|
|
109
152
|
* 不展示 footer
|
|
110
153
|
*/
|
|
111
|
-
export declare const NoFooter:
|
|
154
|
+
export declare const NoFooter: {
|
|
155
|
+
(): React.JSX.Element;
|
|
156
|
+
storyName: string;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* 三栏布局
|
|
160
|
+
*
|
|
161
|
+
* 演示 ImmersiveDialog 的核心三栏布局特性:左侧导航菜单 + 中间详情内容 + 右侧属性面板。
|
|
162
|
+
* 适合资源详情查看、配置编辑等非向导场景。
|
|
163
|
+
* 如需多步骤向导流程,请使用 WizardDialog。
|
|
164
|
+
*/
|
|
165
|
+
export declare const TwoPanelLayout: {
|
|
166
|
+
(): React.JSX.Element;
|
|
167
|
+
storyName: string;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* 底部左侧操作区域
|
|
171
|
+
*
|
|
172
|
+
* 演示通过 `footerLeftAction` 在底部左侧放置辅助操作按钮。
|
|
173
|
+
* 此处展示"重置为默认值"按钮的典型用法。
|
|
174
|
+
* 如需"上一步"按钮等向导场景,请使用 WizardDialog。
|
|
175
|
+
*/
|
|
176
|
+
export declare const FooterLeftAction: {
|
|
177
|
+
(): React.JSX.Element;
|
|
178
|
+
storyName: string;
|
|
179
|
+
};
|
|
@@ -20,32 +20,66 @@ export default meta;
|
|
|
20
20
|
/**
|
|
21
21
|
* 基础用法
|
|
22
22
|
*/
|
|
23
|
-
export declare const Basic:
|
|
23
|
+
export declare const Basic: {
|
|
24
|
+
(): React.JSX.Element;
|
|
25
|
+
storyName: string;
|
|
26
|
+
};
|
|
24
27
|
/**
|
|
25
28
|
* 表单配置对话框
|
|
26
29
|
*/
|
|
27
|
-
export declare const FormConfiguration:
|
|
30
|
+
export declare const FormConfiguration: {
|
|
31
|
+
(): React.JSX.Element;
|
|
32
|
+
storyName: string;
|
|
33
|
+
};
|
|
28
34
|
/**
|
|
29
35
|
* 数据展示对话框
|
|
30
36
|
*/
|
|
31
|
-
export declare const DataDisplay:
|
|
37
|
+
export declare const DataDisplay: {
|
|
38
|
+
(): React.JSX.Element;
|
|
39
|
+
storyName: string;
|
|
40
|
+
};
|
|
32
41
|
/**
|
|
33
42
|
* 带错误信息的对话框
|
|
34
43
|
*/
|
|
35
|
-
export declare const WithError:
|
|
44
|
+
export declare const WithError: {
|
|
45
|
+
(): React.JSX.Element;
|
|
46
|
+
storyName: string;
|
|
47
|
+
};
|
|
36
48
|
/**
|
|
37
49
|
* 长内容对话框
|
|
38
50
|
*/
|
|
39
|
-
export declare const LongContent:
|
|
51
|
+
export declare const LongContent: {
|
|
52
|
+
(): React.JSX.Element;
|
|
53
|
+
storyName: string;
|
|
54
|
+
};
|
|
40
55
|
/**
|
|
41
56
|
* 初始化状态
|
|
42
57
|
*/
|
|
43
|
-
export declare const Initializing:
|
|
58
|
+
export declare const Initializing: {
|
|
59
|
+
(): React.JSX.Element;
|
|
60
|
+
storyName: string;
|
|
61
|
+
};
|
|
44
62
|
/**
|
|
45
63
|
* 内容占满视窗
|
|
46
64
|
*/
|
|
47
|
-
export declare const ContentFull:
|
|
65
|
+
export declare const ContentFull: {
|
|
66
|
+
(): React.JSX.Element;
|
|
67
|
+
storyName: string;
|
|
68
|
+
};
|
|
48
69
|
/**
|
|
49
70
|
* 不展示 footer
|
|
50
71
|
*/
|
|
51
|
-
export declare const NoFooter:
|
|
72
|
+
export declare const NoFooter: {
|
|
73
|
+
(): React.JSX.Element;
|
|
74
|
+
storyName: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* SmallDialog 与 MediumDialog 的选型对比,帮助开发者在两者间做出正确选择。
|
|
78
|
+
*
|
|
79
|
+
* - **SmallDialog (492px)**:适合简单确认、删除提示、信息提示等简短交互
|
|
80
|
+
* - **MediumDialog (720px)**:适合表单填写、数据展示、多字段配置等需要更多空间的场景
|
|
81
|
+
*/
|
|
82
|
+
export declare const SizeComparison: {
|
|
83
|
+
(): React.JSX.Element;
|
|
84
|
+
storyName: string;
|
|
85
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import SearchInput from "../../../src/core/SearchInput";
|
|
1
|
+
import { SearchInput } from "../../../src/core/SearchInput";
|
|
2
2
|
import type { StoryObj } from "@storybook/react";
|
|
3
3
|
/**
|
|
4
4
|
* * tower legacy 组件, 带 debounce 的搜索框
|
|
@@ -45,3 +45,8 @@ export declare const withTotal: Story;
|
|
|
45
45
|
* 展示如何使用 current prop 控制搜索项目的当前索引
|
|
46
46
|
*/
|
|
47
47
|
export declare const ExternallyControlled: Story;
|
|
48
|
+
/**
|
|
49
|
+
* 带最近搜索的示例
|
|
50
|
+
* 展示如何使用 enableRecentSearch prop 启用最近搜索功能
|
|
51
|
+
*/
|
|
52
|
+
export declare const withRecentSearch: Story;
|
|
@@ -17,29 +17,108 @@ declare const meta: CoreMeta<typeof SmallDialog>;
|
|
|
17
17
|
export default meta;
|
|
18
18
|
/**
|
|
19
19
|
* 基础用法
|
|
20
|
+
*
|
|
21
|
+
* 演示最基本的 SmallDialog 用法:通过 `usePushModal` 打开弹窗,
|
|
22
|
+
* 在 `onOk`/`onCancel` 回调中调用 `popModal()` 关闭弹窗。
|
|
20
23
|
*/
|
|
21
|
-
export declare const Basic:
|
|
24
|
+
export declare const Basic: {
|
|
25
|
+
(): React.JSX.Element;
|
|
26
|
+
storyName: string;
|
|
27
|
+
};
|
|
22
28
|
/**
|
|
23
29
|
* 确认删除对话框
|
|
30
|
+
*
|
|
31
|
+
* 演示危险操作确认场景:通过 `okButtonProps={{ danger: true }}` 将确认按钮标红,
|
|
32
|
+
* 自定义 `okText` 和 `cancelText` 按钮文案。
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* 确认删除
|
|
36
|
+
*
|
|
37
|
+
* 演示用 SmallDialog 原始 API 实现删除确认弹窗。
|
|
38
|
+
* 生产环境中推荐直接使用 DeleteDialog,它已内置 danger 按钮和删除语义。
|
|
24
39
|
*/
|
|
25
|
-
export declare const DeleteConfirmation:
|
|
40
|
+
export declare const DeleteConfirmation: {
|
|
41
|
+
(): React.JSX.Element;
|
|
42
|
+
storyName: string;
|
|
43
|
+
};
|
|
26
44
|
/**
|
|
27
45
|
* 只有取消按钮
|
|
46
|
+
*
|
|
47
|
+
* 通过 `showOk={false}` 隐藏确认按钮,仅展示关闭按钮。
|
|
48
|
+
* 适用于纯信息提示场景。取消按钮样式自动从 `quiet` 变为 `ordinary`。
|
|
28
49
|
*/
|
|
29
|
-
export declare const CancelOnly:
|
|
50
|
+
export declare const CancelOnly: {
|
|
51
|
+
(): React.JSX.Element;
|
|
52
|
+
storyName: string;
|
|
53
|
+
};
|
|
30
54
|
/**
|
|
31
55
|
* 带错误信息的对话框
|
|
56
|
+
*
|
|
57
|
+
* 演示 `error` 属性:在 footer 区域显示错误文案(最多 3 行,超出后 tooltip 展示)。
|
|
58
|
+
* 首次点击"提交"模拟验证失败并显示错误,再次点击成功关闭。
|
|
32
59
|
*/
|
|
33
|
-
export declare const WithError:
|
|
60
|
+
export declare const WithError: {
|
|
61
|
+
(): React.JSX.Element;
|
|
62
|
+
storyName: string;
|
|
63
|
+
};
|
|
34
64
|
/**
|
|
35
65
|
* 长内容对话框
|
|
66
|
+
*
|
|
67
|
+
* 演示内容溢出时的滚动行为。包含长标题截断和长内容滚动两种场景。
|
|
36
68
|
*/
|
|
37
|
-
export declare const LongContent:
|
|
69
|
+
export declare const LongContent: {
|
|
70
|
+
(): React.JSX.Element;
|
|
71
|
+
storyName: string;
|
|
72
|
+
};
|
|
38
73
|
/**
|
|
39
74
|
* 初始化状态
|
|
75
|
+
*
|
|
76
|
+
* 演示 `initializing`、`initializingError` 属性的三种场景:
|
|
77
|
+
* 持续加载(骨架屏)、加载成功、加载失败后重试。
|
|
40
78
|
*/
|
|
41
|
-
export declare const Initializing:
|
|
79
|
+
export declare const Initializing: {
|
|
80
|
+
(): React.JSX.Element;
|
|
81
|
+
storyName: string;
|
|
82
|
+
};
|
|
42
83
|
/**
|
|
43
84
|
* 不展示 footer
|
|
85
|
+
*
|
|
86
|
+
* 通过 `hideFooter` 隐藏底部按钮区域,适用于纯展示内容的场景。
|
|
87
|
+
* 用户仍可通过右上角关闭按钮或遮罩层关闭弹窗。
|
|
88
|
+
*/
|
|
89
|
+
export declare const NoFooter: {
|
|
90
|
+
(): React.JSX.Element;
|
|
91
|
+
storyName: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* 自定义标题渲染
|
|
95
|
+
*
|
|
96
|
+
* 通过 `TitleRender` 属性完全接管标题区域的渲染逻辑。
|
|
97
|
+
* 默认标题使用 `Typo.Display.d2_bold_title` 样式,
|
|
98
|
+
* 自定义时可添加图标、状态标签等额外元素。
|
|
99
|
+
*/
|
|
100
|
+
export declare const CustomTitle: {
|
|
101
|
+
(): React.JSX.Element;
|
|
102
|
+
storyName: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* 异步提交
|
|
106
|
+
*
|
|
107
|
+
* 演示 `confirmLoading` + `onOk` 异步提交的完整流程,
|
|
108
|
+
* 这是最常见的业务模式:点击确认后显示 loading 状态,
|
|
109
|
+
* 异步操作完成后关闭弹窗,失败时展示错误信息并保持弹窗打开。
|
|
110
|
+
*/
|
|
111
|
+
export declare const AsyncSubmit: {
|
|
112
|
+
(): React.JSX.Element;
|
|
113
|
+
storyName: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* 自定义按钮样式
|
|
117
|
+
*
|
|
118
|
+
* 通过 `okButtonProps` 和 `cancelButtonProps` 自定义确认和取消按钮的样式,
|
|
119
|
+
* 包括 `danger`、`disabled`、`type` 等属性。属性会透传给 Button 组件。
|
|
44
120
|
*/
|
|
45
|
-
export declare const
|
|
121
|
+
export declare const ButtonCustomization: {
|
|
122
|
+
(): React.JSX.Element;
|
|
123
|
+
storyName: string;
|
|
124
|
+
};
|