@kne/form-info 0.1.1 → 0.1.2
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/en-US.d.ts +9 -0
- package/dist/index.d.ts +153 -0
- package/dist/package-manifest.json +443 -0
- package/dist/zh-CN.d.ts +9 -0
- package/package.json +5 -2
package/dist/en-US.d.ts
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { ReactNode, ComponentType, FC } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface FormInfoProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
column?: number | object;
|
|
6
|
+
list?: ReactNode[];
|
|
7
|
+
gap?: number;
|
|
8
|
+
title?: string | ReactNode;
|
|
9
|
+
subtitle?: string | ReactNode;
|
|
10
|
+
extra?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface FormModalProps {
|
|
14
|
+
open?: boolean;
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
onCancel?: () => void;
|
|
17
|
+
formProps?: {
|
|
18
|
+
onSubmit?: (data: any, context: any, ...args: any[]) => Promise<any> | any;
|
|
19
|
+
data?: any;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
autoClose?: boolean;
|
|
23
|
+
okType?: string;
|
|
24
|
+
okButtonProps?: object;
|
|
25
|
+
okText?: string | ReactNode;
|
|
26
|
+
onOk?: () => void | Promise<any>;
|
|
27
|
+
cancelButtonProps?: object;
|
|
28
|
+
cancelText?: string | ReactNode;
|
|
29
|
+
footer?: ReactNode | (({ defaultFooter, props }: any) => ReactNode);
|
|
30
|
+
renderModal?: (props: any) => ReactNode;
|
|
31
|
+
modalRender?: ({ formChildren, defaultChildren, props }: any) => ReactNode;
|
|
32
|
+
width?: string | number;
|
|
33
|
+
centered?: boolean;
|
|
34
|
+
closable?: boolean;
|
|
35
|
+
maskClosable?: boolean;
|
|
36
|
+
destroyOnClose?: boolean;
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface StepItem {
|
|
41
|
+
title: string | ReactNode;
|
|
42
|
+
formProps?: {
|
|
43
|
+
onSubmit?: (data: any, context: any, ...args: any[]) => Promise<any> | any;
|
|
44
|
+
data?: any;
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
};
|
|
47
|
+
children?: ReactNode | (({ children, isLastStep, currentStep, onStepChange, getStepCache }: any) => ReactNode);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface FormStepsProps {
|
|
51
|
+
items: StepItem[];
|
|
52
|
+
current?: number;
|
|
53
|
+
defaultCurrent?: number;
|
|
54
|
+
autoStep?: boolean;
|
|
55
|
+
direction?: string;
|
|
56
|
+
orientation?: string;
|
|
57
|
+
onChange?: (current: number) => void;
|
|
58
|
+
onComplete?: (data: any[]) => void;
|
|
59
|
+
stepsClassName?: string;
|
|
60
|
+
className?: string;
|
|
61
|
+
children?: ReactNode | ((props: any) => ReactNode);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface FormStepsModalProps {
|
|
65
|
+
items: StepItem[];
|
|
66
|
+
modalProps?: {
|
|
67
|
+
open?: boolean;
|
|
68
|
+
title?: ReactNode;
|
|
69
|
+
onCancel?: () => void;
|
|
70
|
+
autoClose?: boolean;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
};
|
|
73
|
+
completeText?: string | ReactNode;
|
|
74
|
+
nextText?: string | ReactNode;
|
|
75
|
+
autoStep?: boolean;
|
|
76
|
+
onComplete?: (data: any[]) => void;
|
|
77
|
+
className?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ListProps {
|
|
81
|
+
className?: string;
|
|
82
|
+
itemClassName?: string;
|
|
83
|
+
removeIcon?: ReactNode;
|
|
84
|
+
removeText?: string | ReactNode;
|
|
85
|
+
addText?: string | ReactNode;
|
|
86
|
+
addIcon?: ReactNode;
|
|
87
|
+
important?: boolean;
|
|
88
|
+
title?: string | ReactNode;
|
|
89
|
+
name: string;
|
|
90
|
+
list?: ReactNode[];
|
|
91
|
+
empty?: ReactNode;
|
|
92
|
+
itemTitle?: ({ index }: { index: number }) => string;
|
|
93
|
+
block?: boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface TableListProps {
|
|
97
|
+
className?: string;
|
|
98
|
+
addIcon?: ReactNode;
|
|
99
|
+
addText?: string | ReactNode;
|
|
100
|
+
removeIcon?: ReactNode;
|
|
101
|
+
removeText?: string | ReactNode;
|
|
102
|
+
title?: string | ReactNode;
|
|
103
|
+
name: string;
|
|
104
|
+
list?: ReactNode[];
|
|
105
|
+
empty?: ReactNode;
|
|
106
|
+
itemTitle?: ({ index }: { index: number }) => string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface MultiFieldProps {
|
|
110
|
+
className?: string;
|
|
111
|
+
addText?: string | ((label: string) => string);
|
|
112
|
+
addIcon?: ReactNode;
|
|
113
|
+
removeIcon?: ReactNode;
|
|
114
|
+
removeText?: string | ((label: string) => string) | null;
|
|
115
|
+
empty?: ReactNode;
|
|
116
|
+
name: string;
|
|
117
|
+
label: string;
|
|
118
|
+
field: ComponentType<any>;
|
|
119
|
+
block?: boolean;
|
|
120
|
+
rule?: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface FormProps {
|
|
124
|
+
className?: string;
|
|
125
|
+
type?: string;
|
|
126
|
+
children?: ReactNode;
|
|
127
|
+
onSubmit?: (data: any, ...args: any[]) => Promise<any> | any;
|
|
128
|
+
[key: string]: any;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// 组件类型声明
|
|
132
|
+
export declare const FormInfo: FC<FormInfoProps>;
|
|
133
|
+
export declare const FormModal: FC<FormModalProps>;
|
|
134
|
+
export declare const FormSteps: FC<FormStepsProps>;
|
|
135
|
+
export declare const FormStepsModal: FC<FormStepsModalProps>;
|
|
136
|
+
export declare const List: FC<ListProps>;
|
|
137
|
+
export declare const SubList: FC<ListProps>;
|
|
138
|
+
export declare const TableList: FC<TableListProps>;
|
|
139
|
+
export declare const MultiField: FC<MultiFieldProps>;
|
|
140
|
+
export declare const Form: FC<FormProps>;
|
|
141
|
+
|
|
142
|
+
// 默认导出
|
|
143
|
+
export default FormInfo;
|
|
144
|
+
|
|
145
|
+
// 国际化相关
|
|
146
|
+
export interface LocaleType {
|
|
147
|
+
submit: string;
|
|
148
|
+
cancel: string;
|
|
149
|
+
complete: string;
|
|
150
|
+
next: string;
|
|
151
|
+
addText: string;
|
|
152
|
+
deleteText: string;
|
|
153
|
+
}
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "构建一个更加美观的form表单组件包",
|
|
3
|
+
"modules": {
|
|
4
|
+
"FormInfo": {
|
|
5
|
+
"description": "表单信息展示组件,支持多列布局和灵活的字段排列",
|
|
6
|
+
"type": "ReactNode",
|
|
7
|
+
"props": {
|
|
8
|
+
"className": {
|
|
9
|
+
"description": "组件的CSS类名",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"column": {
|
|
13
|
+
"description": "列数配置,支持数字或对象形式",
|
|
14
|
+
"type": "number|object"
|
|
15
|
+
},
|
|
16
|
+
"list": {
|
|
17
|
+
"description": "表单字段列表",
|
|
18
|
+
"type": "ReactNode[]"
|
|
19
|
+
},
|
|
20
|
+
"gap": {
|
|
21
|
+
"description": "字段之间的间距",
|
|
22
|
+
"type": "number"
|
|
23
|
+
},
|
|
24
|
+
"title": {
|
|
25
|
+
"description": "表单标题",
|
|
26
|
+
"type": "string|ReactNode"
|
|
27
|
+
},
|
|
28
|
+
"subtitle": {
|
|
29
|
+
"description": "表单副标题",
|
|
30
|
+
"type": "string|ReactNode"
|
|
31
|
+
},
|
|
32
|
+
"extra": {
|
|
33
|
+
"description": "额外的操作区域",
|
|
34
|
+
"type": "ReactNode"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"FormModal": {
|
|
39
|
+
"description": "模态框表单组件,在弹窗中展示和提交表单",
|
|
40
|
+
"type": "ReactNode",
|
|
41
|
+
"props": {
|
|
42
|
+
"open": {
|
|
43
|
+
"description": "是否打开模态框",
|
|
44
|
+
"type": "boolean"
|
|
45
|
+
},
|
|
46
|
+
"title": {
|
|
47
|
+
"description": "模态框标题",
|
|
48
|
+
"type": "ReactNode"
|
|
49
|
+
},
|
|
50
|
+
"onCancel": {
|
|
51
|
+
"description": "取消回调函数",
|
|
52
|
+
"type": "function"
|
|
53
|
+
},
|
|
54
|
+
"formProps": {
|
|
55
|
+
"description": "表单属性配置",
|
|
56
|
+
"type": "object"
|
|
57
|
+
},
|
|
58
|
+
"autoClose": {
|
|
59
|
+
"description": "提交后是否自动关闭模态框",
|
|
60
|
+
"type": "boolean"
|
|
61
|
+
},
|
|
62
|
+
"okType": {
|
|
63
|
+
"description": "确认按钮类型",
|
|
64
|
+
"type": "string"
|
|
65
|
+
},
|
|
66
|
+
"okButtonProps": {
|
|
67
|
+
"description": "确认按钮属性",
|
|
68
|
+
"type": "object"
|
|
69
|
+
},
|
|
70
|
+
"okText": {
|
|
71
|
+
"description": "确认按钮文本",
|
|
72
|
+
"type": "string|ReactNode"
|
|
73
|
+
},
|
|
74
|
+
"onOk": {
|
|
75
|
+
"description": "确认按钮点击回调",
|
|
76
|
+
"type": "function"
|
|
77
|
+
},
|
|
78
|
+
"cancelButtonProps": {
|
|
79
|
+
"description": "取消按钮属性",
|
|
80
|
+
"type": "object"
|
|
81
|
+
},
|
|
82
|
+
"cancelText": {
|
|
83
|
+
"description": "取消按钮文本",
|
|
84
|
+
"type": "string|ReactNode"
|
|
85
|
+
},
|
|
86
|
+
"footer": {
|
|
87
|
+
"description": "底部内容,支持函数或节点",
|
|
88
|
+
"type": "ReactNode|function"
|
|
89
|
+
},
|
|
90
|
+
"renderModal": {
|
|
91
|
+
"description": "自定义模态框渲染函数",
|
|
92
|
+
"type": "function"
|
|
93
|
+
},
|
|
94
|
+
"modalRender": {
|
|
95
|
+
"description": "模态框内容渲染函数",
|
|
96
|
+
"type": "function"
|
|
97
|
+
},
|
|
98
|
+
"width": {
|
|
99
|
+
"description": "模态框宽度",
|
|
100
|
+
"type": "string|number"
|
|
101
|
+
},
|
|
102
|
+
"centered": {
|
|
103
|
+
"description": "是否垂直居中显示",
|
|
104
|
+
"type": "boolean"
|
|
105
|
+
},
|
|
106
|
+
"closable": {
|
|
107
|
+
"description": "是否显示关闭按钮",
|
|
108
|
+
"type": "boolean"
|
|
109
|
+
},
|
|
110
|
+
"maskClosable": {
|
|
111
|
+
"description": "点击蒙层是否关闭模态框",
|
|
112
|
+
"type": "boolean"
|
|
113
|
+
},
|
|
114
|
+
"destroyOnClose": {
|
|
115
|
+
"description": "关闭时是否销毁子元素",
|
|
116
|
+
"type": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"className": {
|
|
119
|
+
"description": "组件的CSS类名",
|
|
120
|
+
"type": "string"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"FormSteps": {
|
|
125
|
+
"description": "分步表单组件,支持多步骤表单填写",
|
|
126
|
+
"type": "ReactNode",
|
|
127
|
+
"props": {
|
|
128
|
+
"items": {
|
|
129
|
+
"description": "步骤配置数组,包含每个步骤的表单配置",
|
|
130
|
+
"type": "object[]"
|
|
131
|
+
},
|
|
132
|
+
"current": {
|
|
133
|
+
"description": "当前步骤索引(受控)",
|
|
134
|
+
"type": "number"
|
|
135
|
+
},
|
|
136
|
+
"defaultCurrent": {
|
|
137
|
+
"description": "默认当前步骤索引(非受控)",
|
|
138
|
+
"type": "number"
|
|
139
|
+
},
|
|
140
|
+
"autoStep": {
|
|
141
|
+
"description": "是否自动切换到下一步",
|
|
142
|
+
"type": "boolean"
|
|
143
|
+
},
|
|
144
|
+
"direction": {
|
|
145
|
+
"description": "步骤条方向",
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
"orientation": {
|
|
149
|
+
"description": "步骤条朝向",
|
|
150
|
+
"type": "string"
|
|
151
|
+
},
|
|
152
|
+
"onChange": {
|
|
153
|
+
"description": "步骤切换回调函数",
|
|
154
|
+
"type": "function"
|
|
155
|
+
},
|
|
156
|
+
"onComplete": {
|
|
157
|
+
"description": "完成所有步骤的回调函数",
|
|
158
|
+
"type": "function"
|
|
159
|
+
},
|
|
160
|
+
"stepsClassName": {
|
|
161
|
+
"description": "步骤条的CSS类名",
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"className": {
|
|
165
|
+
"description": "组件的CSS类名",
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"children": {
|
|
169
|
+
"description": "自定义内容渲染函数或节点",
|
|
170
|
+
"type": "ReactNode|function"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"FormStepsModal": {
|
|
175
|
+
"description": "分步模态框表单组件,在模态框中展示分步表单",
|
|
176
|
+
"type": "ReactNode",
|
|
177
|
+
"props": {
|
|
178
|
+
"items": {
|
|
179
|
+
"description": "步骤配置数组",
|
|
180
|
+
"type": "object[]"
|
|
181
|
+
},
|
|
182
|
+
"modalProps": {
|
|
183
|
+
"description": "模态框属性配置",
|
|
184
|
+
"type": "object"
|
|
185
|
+
},
|
|
186
|
+
"completeText": {
|
|
187
|
+
"description": "完成按钮文本",
|
|
188
|
+
"type": "string|ReactNode"
|
|
189
|
+
},
|
|
190
|
+
"nextText": {
|
|
191
|
+
"description": "下一步按钮文本",
|
|
192
|
+
"type": "string|ReactNode"
|
|
193
|
+
},
|
|
194
|
+
"autoStep": {
|
|
195
|
+
"description": "是否自动切换步骤",
|
|
196
|
+
"type": "boolean"
|
|
197
|
+
},
|
|
198
|
+
"onComplete": {
|
|
199
|
+
"description": "完成所有步骤的回调函数",
|
|
200
|
+
"type": "function"
|
|
201
|
+
},
|
|
202
|
+
"className": {
|
|
203
|
+
"description": "组件的CSS类名",
|
|
204
|
+
"type": "string"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"List": {
|
|
209
|
+
"description": "列表表单组件,支持动态添加和删除表单项",
|
|
210
|
+
"type": "ReactNode",
|
|
211
|
+
"props": {
|
|
212
|
+
"className": {
|
|
213
|
+
"description": "组件的CSS类名",
|
|
214
|
+
"type": "string"
|
|
215
|
+
},
|
|
216
|
+
"itemClassName": {
|
|
217
|
+
"description": "列表项的CSS类名",
|
|
218
|
+
"type": "string"
|
|
219
|
+
},
|
|
220
|
+
"removeIcon": {
|
|
221
|
+
"description": "删除按钮图标",
|
|
222
|
+
"type": "ReactNode"
|
|
223
|
+
},
|
|
224
|
+
"removeText": {
|
|
225
|
+
"description": "删除按钮文本",
|
|
226
|
+
"type": "string|ReactNode"
|
|
227
|
+
},
|
|
228
|
+
"addText": {
|
|
229
|
+
"description": "添加按钮文本",
|
|
230
|
+
"type": "string|ReactNode"
|
|
231
|
+
},
|
|
232
|
+
"addIcon": {
|
|
233
|
+
"description": "添加按钮图标",
|
|
234
|
+
"type": "ReactNode"
|
|
235
|
+
},
|
|
236
|
+
"important": {
|
|
237
|
+
"description": "是否为重要模式",
|
|
238
|
+
"type": "boolean"
|
|
239
|
+
},
|
|
240
|
+
"title": {
|
|
241
|
+
"description": "列表标题",
|
|
242
|
+
"type": "string|ReactNode"
|
|
243
|
+
},
|
|
244
|
+
"name": {
|
|
245
|
+
"description": "表单字段名称",
|
|
246
|
+
"type": "string"
|
|
247
|
+
},
|
|
248
|
+
"list": {
|
|
249
|
+
"description": "初始列表数据",
|
|
250
|
+
"type": "ReactNode[]"
|
|
251
|
+
},
|
|
252
|
+
"empty": {
|
|
253
|
+
"description": "空状态展示内容",
|
|
254
|
+
"type": "ReactNode"
|
|
255
|
+
},
|
|
256
|
+
"itemTitle": {
|
|
257
|
+
"description": "列表项标题生成函数",
|
|
258
|
+
"type": "function"
|
|
259
|
+
},
|
|
260
|
+
"block": {
|
|
261
|
+
"description": "是否为块级布局",
|
|
262
|
+
"type": "boolean"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"SubList": {
|
|
267
|
+
"description": "子列表表单组件,与List功能相同",
|
|
268
|
+
"type": "ReactNode",
|
|
269
|
+
"props": {
|
|
270
|
+
"className": {
|
|
271
|
+
"description": "组件的CSS类名",
|
|
272
|
+
"type": "string"
|
|
273
|
+
},
|
|
274
|
+
"itemClassName": {
|
|
275
|
+
"description": "列表项的CSS类名",
|
|
276
|
+
"type": "string"
|
|
277
|
+
},
|
|
278
|
+
"removeIcon": {
|
|
279
|
+
"description": "删除按钮图标",
|
|
280
|
+
"type": "ReactNode"
|
|
281
|
+
},
|
|
282
|
+
"removeText": {
|
|
283
|
+
"description": "删除按钮文本",
|
|
284
|
+
"type": "string|ReactNode"
|
|
285
|
+
},
|
|
286
|
+
"addText": {
|
|
287
|
+
"description": "添加按钮文本",
|
|
288
|
+
"type": "string|ReactNode"
|
|
289
|
+
},
|
|
290
|
+
"addIcon": {
|
|
291
|
+
"description": "添加按钮图标",
|
|
292
|
+
"type": "ReactNode"
|
|
293
|
+
},
|
|
294
|
+
"important": {
|
|
295
|
+
"description": "是否为重要模式",
|
|
296
|
+
"type": "boolean"
|
|
297
|
+
},
|
|
298
|
+
"title": {
|
|
299
|
+
"description": "列表标题",
|
|
300
|
+
"type": "string|ReactNode"
|
|
301
|
+
},
|
|
302
|
+
"name": {
|
|
303
|
+
"description": "表单字段名称",
|
|
304
|
+
"type": "string"
|
|
305
|
+
},
|
|
306
|
+
"list": {
|
|
307
|
+
"description": "初始列表数据",
|
|
308
|
+
"type": "ReactNode[]"
|
|
309
|
+
},
|
|
310
|
+
"empty": {
|
|
311
|
+
"description": "空状态展示内容",
|
|
312
|
+
"type": "ReactNode"
|
|
313
|
+
},
|
|
314
|
+
"itemTitle": {
|
|
315
|
+
"description": "列表项标题生成函数",
|
|
316
|
+
"type": "function"
|
|
317
|
+
},
|
|
318
|
+
"block": {
|
|
319
|
+
"description": "是否为块级布局",
|
|
320
|
+
"type": "boolean"
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"TableList": {
|
|
325
|
+
"description": "表格列表表单组件,以表格形式展示动态表单项",
|
|
326
|
+
"type": "ReactNode",
|
|
327
|
+
"props": {
|
|
328
|
+
"className": {
|
|
329
|
+
"description": "组件的CSS类名",
|
|
330
|
+
"type": "string"
|
|
331
|
+
},
|
|
332
|
+
"addIcon": {
|
|
333
|
+
"description": "添加按钮图标",
|
|
334
|
+
"type": "ReactNode"
|
|
335
|
+
},
|
|
336
|
+
"addText": {
|
|
337
|
+
"description": "添加按钮文本",
|
|
338
|
+
"type": "string|ReactNode"
|
|
339
|
+
},
|
|
340
|
+
"removeIcon": {
|
|
341
|
+
"description": "删除按钮图标",
|
|
342
|
+
"type": "ReactNode"
|
|
343
|
+
},
|
|
344
|
+
"removeText": {
|
|
345
|
+
"description": "删除按钮文本",
|
|
346
|
+
"type": "string|ReactNode"
|
|
347
|
+
},
|
|
348
|
+
"title": {
|
|
349
|
+
"description": "表格标题",
|
|
350
|
+
"type": "string|ReactNode"
|
|
351
|
+
},
|
|
352
|
+
"name": {
|
|
353
|
+
"description": "表单字段名称",
|
|
354
|
+
"type": "string"
|
|
355
|
+
},
|
|
356
|
+
"list": {
|
|
357
|
+
"description": "初始列表数据",
|
|
358
|
+
"type": "ReactNode[]"
|
|
359
|
+
},
|
|
360
|
+
"empty": {
|
|
361
|
+
"description": "空状态展示内容",
|
|
362
|
+
"type": "ReactNode"
|
|
363
|
+
},
|
|
364
|
+
"itemTitle": {
|
|
365
|
+
"description": "列表项标题生成函数",
|
|
366
|
+
"type": "function"
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"MultiField": {
|
|
371
|
+
"description": "多字段组件,支持动态添加和删除相同类型的字段组",
|
|
372
|
+
"type": "ReactNode",
|
|
373
|
+
"props": {
|
|
374
|
+
"className": {
|
|
375
|
+
"description": "组件的CSS类名",
|
|
376
|
+
"type": "string"
|
|
377
|
+
},
|
|
378
|
+
"addText": {
|
|
379
|
+
"description": "添加按钮文本,支持函数或字符串",
|
|
380
|
+
"type": "string|function"
|
|
381
|
+
},
|
|
382
|
+
"addIcon": {
|
|
383
|
+
"description": "添加按钮图标",
|
|
384
|
+
"type": "ReactNode"
|
|
385
|
+
},
|
|
386
|
+
"removeIcon": {
|
|
387
|
+
"description": "删除按钮图标",
|
|
388
|
+
"type": "ReactNode"
|
|
389
|
+
},
|
|
390
|
+
"removeText": {
|
|
391
|
+
"description": "删除按钮文本,支持函数或字符串",
|
|
392
|
+
"type": "string|function|null"
|
|
393
|
+
},
|
|
394
|
+
"empty": {
|
|
395
|
+
"description": "空状态展示内容",
|
|
396
|
+
"type": "ReactNode"
|
|
397
|
+
},
|
|
398
|
+
"name": {
|
|
399
|
+
"description": "表单字段名称",
|
|
400
|
+
"type": "string"
|
|
401
|
+
},
|
|
402
|
+
"label": {
|
|
403
|
+
"description": "字段标签",
|
|
404
|
+
"type": "string"
|
|
405
|
+
},
|
|
406
|
+
"field": {
|
|
407
|
+
"description": "字段组件",
|
|
408
|
+
"type": "ReactNode"
|
|
409
|
+
},
|
|
410
|
+
"block": {
|
|
411
|
+
"description": "是否为块级布局",
|
|
412
|
+
"type": "boolean"
|
|
413
|
+
},
|
|
414
|
+
"rule": {
|
|
415
|
+
"description": "验证规则",
|
|
416
|
+
"type": "string"
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
"Form": {
|
|
421
|
+
"description": "基础表单组件,提供表单容器和基础功能",
|
|
422
|
+
"type": "ReactNode",
|
|
423
|
+
"props": {
|
|
424
|
+
"className": {
|
|
425
|
+
"description": "组件的CSS类名",
|
|
426
|
+
"type": "string"
|
|
427
|
+
},
|
|
428
|
+
"type": {
|
|
429
|
+
"description": "表单类型",
|
|
430
|
+
"type": "string"
|
|
431
|
+
},
|
|
432
|
+
"children": {
|
|
433
|
+
"description": "表单子元素",
|
|
434
|
+
"type": "ReactNode"
|
|
435
|
+
},
|
|
436
|
+
"onSubmit": {
|
|
437
|
+
"description": "表单提交回调函数",
|
|
438
|
+
"type": "function"
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
package/dist/zh-CN.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kne/form-info",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "构建一个更加美观的form表单组件",
|
|
5
5
|
"syntax": {
|
|
6
6
|
"esmodules": true
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.modern.js",
|
|
10
10
|
"source": "src/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
11
12
|
"scripts": {
|
|
12
13
|
"init": "husky && npm run init-example",
|
|
13
14
|
"start": "run-p start:lib start:md start:example",
|
|
@@ -17,7 +18,9 @@
|
|
|
17
18
|
"start:md": "npx @kne/md-doc --watch",
|
|
18
19
|
"build:locale": "microbundle src/locale/*.js -o dist/locale --no-compress --format modern,cjs ",
|
|
19
20
|
"build:lib-main": "microbundle --no-compress --format modern,cjs --jsxImportSource react --jsx React.createElement --jsxFragment React.Fragment",
|
|
20
|
-
"build:
|
|
21
|
+
"build:types": "cp src/index.d.ts dist/",
|
|
22
|
+
"build:package-manifest": "cp src/package-manifest.json dist/",
|
|
23
|
+
"build:lib": "run-s build:locale build:lib-main build:types build:package-manifest",
|
|
21
24
|
"start:lib": "microbundle watch --no-compress --format modern,cjs --jsxImportSource react --jsx React.createElement --jsxFragment React.Fragment",
|
|
22
25
|
"build:example": "cd example && npm run build",
|
|
23
26
|
"start:example": "cd example && npm run start",
|