@cloudtower/eagle 0.31.7 → 0.31.8
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/dist/cjs/core/TableForm/Columns/AffixColumn.js +1 -1
- package/dist/cjs/core/TableForm/Columns/CheckboxColumn.js +1 -1
- package/dist/cjs/core/TableForm/Columns/InputColumn.js +1 -0
- package/dist/cjs/core/TableForm/TableFormHeaderCell.js +40 -20
- package/dist/cjs/core/TableForm/index.js +4 -11
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +3570 -3557
- package/dist/esm/core/TableForm/Columns/AffixColumn.js +1 -1
- package/dist/esm/core/TableForm/Columns/CheckboxColumn.js +1 -1
- package/dist/esm/core/TableForm/Columns/InputColumn.js +1 -0
- package/dist/esm/core/TableForm/TableFormHeaderCell.js +37 -17
- package/dist/esm/core/TableForm/index.js +5 -12
- package/dist/esm/stats1.html +1 -1
- package/dist/src/core/TableForm/types.d.ts +92 -1
- package/dist/src/core/Tooltip/EllipsisTooltipContent.d.ts +4 -0
- package/dist/src/core/Tooltip/tooltip.type.d.ts +22 -0
- package/dist/src/core/Tooltip/tooltip.widget.d.ts +5 -0
- package/dist/stories/docs/core/EllipsisTooltipContent.stories.d.ts +24 -0
- package/dist/stories/docs/core/TableForm.stories.d.ts +45 -13
- package/dist/style.css +3612 -3603
- package/package.json +4 -4
|
@@ -21,13 +21,42 @@ export type CustomizedColumnRenderProps = {
|
|
|
21
21
|
error?: boolean;
|
|
22
22
|
};
|
|
23
23
|
export type TableFormColumn = {
|
|
24
|
+
/**
|
|
25
|
+
* 列类型,指定后会使用 ColumnBodyImpls 枚举渲染单元格,否则使用 render 函数渲染
|
|
26
|
+
* @enum {number}
|
|
27
|
+
*/
|
|
24
28
|
type?: keyof typeof ColumnBodyImpls;
|
|
25
|
-
|
|
29
|
+
/**
|
|
30
|
+
* 列标题
|
|
31
|
+
*/
|
|
32
|
+
title?: string | React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* 列唯一标识
|
|
35
|
+
*/
|
|
26
36
|
key: string;
|
|
37
|
+
/**
|
|
38
|
+
* 列副标题,只在 `disableBatchFilling` 为 `false`,且 `type` 为 'text' 时生效
|
|
39
|
+
*/
|
|
27
40
|
subTitle?: string;
|
|
41
|
+
/**
|
|
42
|
+
* 列副标题颜色
|
|
43
|
+
*/
|
|
28
44
|
subTitleColor?: "" | "primary" | "success" | "warning" | "danger";
|
|
45
|
+
/**
|
|
46
|
+
* 列副标题渲染函数,优先级高于 `subTitle`,即使 `disableBatchFilling` 为 `true` 也会生效
|
|
47
|
+
*/
|
|
48
|
+
subTitleRender?: (props: CustomizedColumnRenderProps) => React.ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* 列单元格图标
|
|
51
|
+
*/
|
|
29
52
|
bodyIcon?: any;
|
|
53
|
+
/**
|
|
54
|
+
* 列单元格错误图标
|
|
55
|
+
*/
|
|
30
56
|
bodyErrorIcon?: any;
|
|
57
|
+
/**
|
|
58
|
+
* 列宽度
|
|
59
|
+
*/
|
|
31
60
|
width?: number | string;
|
|
32
61
|
displayText?: string;
|
|
33
62
|
defaultValue?: any;
|
|
@@ -37,9 +66,21 @@ export type TableFormColumn = {
|
|
|
37
66
|
disablePrefix?: boolean;
|
|
38
67
|
disableSuffix?: boolean;
|
|
39
68
|
customData?: any;
|
|
69
|
+
/**
|
|
70
|
+
* 列对齐方式
|
|
71
|
+
*/
|
|
40
72
|
align?: "left" | "right" | "center";
|
|
73
|
+
/**
|
|
74
|
+
* 列行描述渲染函数
|
|
75
|
+
*/
|
|
41
76
|
renderDescription?: (props: RenderRowDescriptionProps) => React.ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* 列单元格渲染函数
|
|
79
|
+
*/
|
|
42
80
|
render?: (props: CustomizedColumnRenderProps) => React.ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* 列验证函数
|
|
83
|
+
*/
|
|
43
84
|
validator?: (params: {
|
|
44
85
|
value: any;
|
|
45
86
|
rowIndex?: number;
|
|
@@ -124,28 +165,62 @@ export type TableFormErrorsType = (string | {
|
|
|
124
165
|
[columnKey: string]: string | null;
|
|
125
166
|
} | null)[];
|
|
126
167
|
export type TableFormProps = {
|
|
168
|
+
/**
|
|
169
|
+
* 表格默认数据
|
|
170
|
+
*/
|
|
127
171
|
defaultData?: DataType[];
|
|
172
|
+
/**
|
|
173
|
+
* 表格列配置
|
|
174
|
+
*/
|
|
128
175
|
columns: TableFormColumn[];
|
|
176
|
+
/**
|
|
177
|
+
* 表格是否禁用单元格默认控件
|
|
178
|
+
*/
|
|
129
179
|
disabled?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* 表格行添加配置
|
|
182
|
+
*/
|
|
130
183
|
rowAddConfig?: RowAddConfigurations;
|
|
131
184
|
/**
|
|
132
185
|
* @deprecated use "row" configuration instead
|
|
133
186
|
*/
|
|
134
187
|
deleteConfig?: DeletableConfigurations;
|
|
188
|
+
/**
|
|
189
|
+
* 表格大小
|
|
190
|
+
*/
|
|
135
191
|
size?: "default" | "large" | "small";
|
|
136
192
|
/**
|
|
137
193
|
* @deprecated use "row" configuration instead
|
|
138
194
|
*/
|
|
139
195
|
draggable?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* 表格是否禁用批量填充
|
|
198
|
+
*/
|
|
140
199
|
disableBatchFilling?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* 表格类名
|
|
202
|
+
*/
|
|
141
203
|
className?: string;
|
|
142
204
|
/**
|
|
143
205
|
* @deprecated use "row" configuration instead
|
|
144
206
|
*/
|
|
145
207
|
rowSplitType?: TableFormRowSplitType;
|
|
208
|
+
/**
|
|
209
|
+
* 表格验证触发类型,使用 ValidateTriggerType 枚举
|
|
210
|
+
* @enum {number}
|
|
211
|
+
*/
|
|
146
212
|
validateTriggerType?: ValidateTriggerType;
|
|
213
|
+
/**
|
|
214
|
+
* 表格最大高度
|
|
215
|
+
*/
|
|
147
216
|
maxHeight?: number | string;
|
|
217
|
+
/**
|
|
218
|
+
* 表格行配置
|
|
219
|
+
*/
|
|
148
220
|
row?: TableFormRowConfiguration;
|
|
221
|
+
/**
|
|
222
|
+
* 表格行错误信息
|
|
223
|
+
*/
|
|
149
224
|
errors?: TableFormErrorsType;
|
|
150
225
|
/**
|
|
151
226
|
* @deprecated use "row" configuration instead
|
|
@@ -155,10 +230,26 @@ export type TableFormProps = {
|
|
|
155
230
|
* @deprecated use "row" configuration instead
|
|
156
231
|
*/
|
|
157
232
|
rowValidator?: (rowIndex: number, rowData: DataType) => string | undefined;
|
|
233
|
+
/**
|
|
234
|
+
* 表格头部数据变化的回调
|
|
235
|
+
*/
|
|
158
236
|
onHeaderChange?: (data: any[], columnKey: string) => void;
|
|
237
|
+
/**
|
|
238
|
+
* 表格头部数据失去焦点时的回调
|
|
239
|
+
*/
|
|
159
240
|
onHeaderBlur?: (data: any[]) => void;
|
|
241
|
+
/**
|
|
242
|
+
* 表格行数据变化的回调
|
|
243
|
+
*/
|
|
160
244
|
onBodyChange?: (value: DataType[], rowIndex?: number, columnKey?: string) => void;
|
|
245
|
+
/**
|
|
246
|
+
* 表格行数据失去焦点时的回调
|
|
247
|
+
*/
|
|
161
248
|
onBodyBlur?: (value: DataType, rowIndex?: number, columnKey?: string) => void;
|
|
249
|
+
/**
|
|
250
|
+
* 是否隐藏空表格
|
|
251
|
+
*/
|
|
252
|
+
hideEmptyTable?: boolean;
|
|
162
253
|
};
|
|
163
254
|
export type TableFormHandle = {
|
|
164
255
|
setData: (data: DataType[]) => void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LinariaClassName } from "@linaria/core";
|
|
1
3
|
import { TooltipProps as AntdTooltipProps } from "antd/lib/tooltip";
|
|
2
4
|
export type TooltipProps = AntdTooltipProps & {
|
|
3
5
|
/**
|
|
@@ -5,3 +7,23 @@ export type TooltipProps = AntdTooltipProps & {
|
|
|
5
7
|
*/
|
|
6
8
|
followMouse?: boolean;
|
|
7
9
|
};
|
|
10
|
+
export type EllipsisContentType = {
|
|
11
|
+
/**
|
|
12
|
+
* tooltip content 内容
|
|
13
|
+
*/
|
|
14
|
+
tooltip: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* 内容区的最大高度
|
|
17
|
+
*
|
|
18
|
+
* e.g. 文本限制行数 = 行数 * line-height
|
|
19
|
+
*/
|
|
20
|
+
maxHeight?: number;
|
|
21
|
+
/**
|
|
22
|
+
* 自定义样式类名
|
|
23
|
+
*/
|
|
24
|
+
contentWrapperClassName?: LinariaClassName;
|
|
25
|
+
/**
|
|
26
|
+
* 多行溢出省略提示
|
|
27
|
+
*/
|
|
28
|
+
ellipsisTips?: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import EllipsisTooltipContent from "../../../src/core/Tooltip/EllipsisTooltipContent";
|
|
2
|
+
import { StoryObj } from "@storybook/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* * Tooltip content 组件
|
|
6
|
+
* * 搭配 Tooltip 与 OverflowTooltip 使用
|
|
7
|
+
* * 使用时,Tooltip 与 OverflowTooltip 需要配合 destroyTooltipOnHide 为 true 使用
|
|
8
|
+
* * 自定义 props 已在表格进行说明
|
|
9
|
+
*/
|
|
10
|
+
declare const meta: {
|
|
11
|
+
component: ({ tooltip, maxHeight, contentWrapperClassName, ellipsisTips, }: import("../../../src/core/Tooltip").EllipsisContentType) => React.JSX.Element;
|
|
12
|
+
title: "Core/EllipsisTooltipContent | Tooltip content 过长省略";
|
|
13
|
+
parameters: {
|
|
14
|
+
design: {
|
|
15
|
+
type: string;
|
|
16
|
+
url: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof EllipsisTooltipContent>;
|
|
22
|
+
export declare const ellipsisTooltipsContentInTooltip: Story;
|
|
23
|
+
export declare const ellipsisTooltipsContentInOverflowTooltip: Story;
|
|
24
|
+
export declare const ellipsisTooltipsReactNodeContentInTooltip: Story;
|
|
@@ -1,17 +1,49 @@
|
|
|
1
|
+
import { TableFormHandle, TableFormProps } from "../../../src/core/TableForm/types";
|
|
1
2
|
import React from "react";
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
parameters: {
|
|
10
|
-
design: {
|
|
11
|
-
type: string;
|
|
12
|
-
url: string;
|
|
13
|
-
};
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: React.ForwardRefExoticComponent<TableFormProps & React.RefAttributes<TableFormHandle>>;
|
|
5
|
+
title: "Core/TableForm | 表格表单";
|
|
6
|
+
parameters: {
|
|
7
|
+
design: {
|
|
8
|
+
type: string;
|
|
9
|
+
url: string;
|
|
14
10
|
};
|
|
15
11
|
};
|
|
16
12
|
};
|
|
17
|
-
export default
|
|
13
|
+
export default meta;
|
|
14
|
+
export declare const BatchInput: {
|
|
15
|
+
render: () => React.JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export declare const DynamicRows: {
|
|
18
|
+
render: () => React.JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
export declare const Draggable: {
|
|
21
|
+
render: () => React.JSX.Element;
|
|
22
|
+
};
|
|
23
|
+
export declare const NormalValidate: {
|
|
24
|
+
render: () => React.JSX.Element;
|
|
25
|
+
};
|
|
26
|
+
export declare const LazyValidate: {
|
|
27
|
+
render: () => React.JSX.Element;
|
|
28
|
+
};
|
|
29
|
+
export declare const AggressiveValidate: {
|
|
30
|
+
render: () => React.JSX.Element;
|
|
31
|
+
};
|
|
32
|
+
export declare const RowConfig: {
|
|
33
|
+
render: () => React.JSX.Element;
|
|
34
|
+
};
|
|
35
|
+
export declare const ErrorsConfig: {
|
|
36
|
+
render: () => React.JSX.Element;
|
|
37
|
+
};
|
|
38
|
+
export declare const ErrorsConfigWithAsyncErr: {
|
|
39
|
+
render: () => React.JSX.Element;
|
|
40
|
+
};
|
|
41
|
+
export declare const ShowTableFormWhenNoData: {
|
|
42
|
+
render: () => React.JSX.Element;
|
|
43
|
+
};
|
|
44
|
+
export declare const HideTableFormWhenNoData: {
|
|
45
|
+
render: () => React.JSX.Element;
|
|
46
|
+
};
|
|
47
|
+
export declare const TitleAndSubTitle: {
|
|
48
|
+
render: () => React.JSX.Element;
|
|
49
|
+
};
|