@flatbiz/antd 2.3.18 → 2.3.21
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/esm/index.css +125 -6
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/index.d.ts +272 -76
- package/package.json +17 -8
package/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { API, ModelType } from '@dimjs/model';
|
|
|
5
5
|
import { ButtonProps, DrawerProps, FormItemProps, InputNumberProps, InputProps, ModalProps, RadioGroupProps, SelectProps, SpaceProps, TableProps, TreeProps, TreeSelectProps, UploadProps } from 'antd';
|
|
6
6
|
import { CheckboxGroupProps } from 'antd/lib/checkbox';
|
|
7
7
|
import { PickerDateProps, RangePickerDateProps } from 'antd/lib/date-picker/generatePicker';
|
|
8
|
-
import { FormListFieldData, FormListOperation } from 'antd/lib/form/FormList';
|
|
8
|
+
import { FormListFieldData, FormListOperation, FormListProps } from 'antd/lib/form/FormList';
|
|
9
9
|
import { TextAreaProps } from 'antd/lib/input';
|
|
10
10
|
import { ColumnsType } from 'antd/lib/table';
|
|
11
11
|
import { UploadChangeParam } from 'antd/lib/upload';
|
|
@@ -28,7 +28,7 @@ export interface ButtonOperateProps {
|
|
|
28
28
|
size?: SpaceProps["size"];
|
|
29
29
|
}
|
|
30
30
|
export declare const ButtonOperate: VFC<ButtonOperateProps>;
|
|
31
|
-
export declare type
|
|
31
|
+
export declare type DatePickerWrapperProps = {
|
|
32
32
|
value?: string;
|
|
33
33
|
onChange?: (value?: string) => void;
|
|
34
34
|
} & Omit<PickerDateProps<moment.Moment>, "value" | "onChange">;
|
|
@@ -41,8 +41,8 @@ export declare type DatePickerWraperProps = {
|
|
|
41
41
|
* 4. 其他格式化类型自定义format
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
export declare const
|
|
45
|
-
export declare type
|
|
44
|
+
export declare const DatePickerWrapper: VFC<DatePickerWrapperProps>;
|
|
45
|
+
export declare type DateRangePickerWrapperProps = {
|
|
46
46
|
value?: [
|
|
47
47
|
string,
|
|
48
48
|
string
|
|
@@ -55,13 +55,14 @@ export declare type DateRangePickerWraperProps = {
|
|
|
55
55
|
/**
|
|
56
56
|
* DatePicker.RangePicker包装组件
|
|
57
57
|
* ```
|
|
58
|
+
* TODO: 引用DatePicker.RangePicker TS有问题,待解决
|
|
58
59
|
* 1. value类型为 [string, string]
|
|
59
60
|
* 2. onChange返回类型 [string, string]
|
|
60
61
|
* 3. 默认格式化类型 YYYY-MM-DD; 当showTime===true时,默认格式化类型YYYY-MM-DD HH:mm:ss
|
|
61
62
|
* 4. 其他格式化类型自定义format
|
|
62
63
|
* ```
|
|
63
64
|
*/
|
|
64
|
-
export declare const
|
|
65
|
+
export declare const DateRangePickerWrapper: VFC<DateRangePickerWrapperProps>;
|
|
65
66
|
export interface DrawerStateType {
|
|
66
67
|
title: string;
|
|
67
68
|
/**
|
|
@@ -80,7 +81,7 @@ export interface DrawerActionsParamType {
|
|
|
80
81
|
closeDrawer: void;
|
|
81
82
|
setDrawerItemData: Record<string, any>;
|
|
82
83
|
}
|
|
83
|
-
export interface
|
|
84
|
+
export interface DrawerOperationOldProps {
|
|
84
85
|
loading?: boolean;
|
|
85
86
|
okText?: string;
|
|
86
87
|
cancelText?: string;
|
|
@@ -90,15 +91,22 @@ export interface DrawerOperationProps {
|
|
|
90
91
|
okButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
91
92
|
cancelButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
92
93
|
}
|
|
93
|
-
export declare type
|
|
94
|
+
export declare type DrawerFormOldProps = {
|
|
94
95
|
className?: string;
|
|
95
96
|
/**
|
|
96
97
|
* 整个drawer页面级的spinning <Page loading />
|
|
97
98
|
*/
|
|
98
99
|
pageLoading?: boolean;
|
|
99
|
-
operationProps?:
|
|
100
|
+
operationProps?: DrawerOperationOldProps;
|
|
100
101
|
} & DrawerProps;
|
|
101
|
-
|
|
102
|
+
/**
|
|
103
|
+
* 弹窗机制
|
|
104
|
+
* ```
|
|
105
|
+
* 1. 默认 destroyOnClose = true
|
|
106
|
+
* 2. 默认 forceRender = false
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare const DrawerWraper: FC<DrawerFormOldProps>;
|
|
102
110
|
/**
|
|
103
111
|
* drawer弹窗模型
|
|
104
112
|
* @param key 唯一值必传
|
|
@@ -110,68 +118,81 @@ export declare const DrawerWraper: FC<DrawerFormProps>;
|
|
|
110
118
|
* ```
|
|
111
119
|
*/
|
|
112
120
|
export declare const createDrawerWraperModel: (key: string) => API<ModelType<DrawerStateType, DrawerActionsParamType, any>>;
|
|
113
|
-
export
|
|
114
|
-
|
|
115
|
-
fileName: string;
|
|
116
|
-
};
|
|
117
|
-
export declare type FileUploadProps = {
|
|
118
|
-
onChange?: (value?: FileUploadItem[]) => void;
|
|
119
|
-
onUploadError?: (message?: string) => void;
|
|
120
|
-
value?: FileUploadItem[];
|
|
121
|
-
onPreview?: (item: FileUploadItem) => void;
|
|
122
|
-
onUploadChange?: (info: UploadChangeParam<UploadFile>) => void;
|
|
121
|
+
export interface DrawerStateType {
|
|
122
|
+
title: string;
|
|
123
123
|
/**
|
|
124
|
-
*
|
|
124
|
+
* 显示drawer
|
|
125
125
|
*/
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
visible: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* 用来处理form, `更新`的时候的传递当前item列表行的数据, 当`创建`的时候强制设置为 `undefined`
|
|
129
|
+
*/
|
|
130
|
+
itemData?: Record<string, any>;
|
|
131
|
+
operateType: "create" | "update" | "view" | null;
|
|
132
|
+
pageLoading?: boolean;
|
|
133
|
+
}
|
|
134
|
+
export interface DrawerActionsParamType {
|
|
135
|
+
openDrawerForm: Pick<DrawerStateType, "title" | "itemData" | "operateType" | "pageLoading">;
|
|
136
|
+
closeDrawer: void;
|
|
137
|
+
setDrawerItemData: Record<string, any>;
|
|
138
|
+
}
|
|
139
|
+
export interface DrawerOperationProps {
|
|
140
|
+
loading?: boolean;
|
|
141
|
+
okText?: string;
|
|
142
|
+
cancelText?: string;
|
|
143
|
+
onOk?: () => void;
|
|
144
|
+
onCancel?: () => void;
|
|
145
|
+
hideOkBtn?: boolean;
|
|
146
|
+
okButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
147
|
+
cancelButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
148
|
+
}
|
|
149
|
+
export declare type DrawerFormProps = {
|
|
150
|
+
className?: string;
|
|
151
|
+
/**
|
|
152
|
+
* 整个drawer页面级的spinning <Page loading />
|
|
153
|
+
*/
|
|
154
|
+
pageLoading?: boolean;
|
|
155
|
+
operationProps?: DrawerOperationProps;
|
|
156
|
+
} & DrawerProps;
|
|
131
157
|
/**
|
|
132
|
-
*
|
|
158
|
+
* 弹窗机制
|
|
133
159
|
* ```
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* {
|
|
137
|
-
* code: '0000',
|
|
138
|
-
* data: {
|
|
139
|
-
* fileKey: '预览文件对应的fileKey'
|
|
140
|
-
* }
|
|
141
|
-
* }
|
|
142
|
-
* 可通过fieldNames配置接口返回值属性名称映射
|
|
160
|
+
* 1. 默认 destroyOnClose = true
|
|
161
|
+
* 2. 默认 forceRender = false
|
|
143
162
|
* ```
|
|
163
|
+
*/
|
|
164
|
+
export declare const DrawerWrapper: FC<DrawerFormProps>;
|
|
165
|
+
/**
|
|
166
|
+
* drawer弹窗模型
|
|
167
|
+
* @param key 唯一值必传
|
|
168
|
+
* @returns
|
|
169
|
+
*
|
|
144
170
|
* ```
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* <FileUpload action={uploadUrl} onPreview={onPreviewFile}>
|
|
148
|
-
* <Button type="primary">选择文件导入</Button>
|
|
149
|
-
* </FileUpload>
|
|
150
|
-
* </Form.Item>
|
|
171
|
+
* 使用方式
|
|
172
|
+
* const [drawerState, drawerActions] = createDrawerWrapperModel('key值').useStore();
|
|
151
173
|
* ```
|
|
152
|
-
*
|
|
153
174
|
*/
|
|
154
|
-
export declare const
|
|
155
|
-
export declare type TPlainObject<T = any> = Record<string, T>;
|
|
175
|
+
export declare const createDrawerWrapperModel: (key: string) => API<ModelType<DrawerStateType, DrawerActionsParamType, any>>;
|
|
156
176
|
export declare type LabelValueItem<T extends string | number = string | number> = {
|
|
157
177
|
value: T;
|
|
158
178
|
label: string;
|
|
159
179
|
};
|
|
180
|
+
export declare type TPlainObject<T = any> = Record<string, T>;
|
|
160
181
|
export declare type SelectorServiceConfig = {
|
|
161
182
|
params?: TPlainObject;
|
|
162
183
|
requiredParamsKeys?: string[];
|
|
163
|
-
fieldNames?: {
|
|
164
|
-
label: string;
|
|
165
|
-
value: string;
|
|
166
|
-
};
|
|
167
184
|
onRequest?: (params?: any) => any;
|
|
168
185
|
/**
|
|
169
186
|
* 响应数据适配器
|
|
170
187
|
*/
|
|
171
188
|
onRequestResultAdapter?: (respData: any) => TPlainObject[];
|
|
172
189
|
};
|
|
173
|
-
export declare type SelectorWrapperProps = Omit<SelectProps, "filterOption" | "onSearch" | "loading" | "notFoundContent" | "options"> & {
|
|
190
|
+
export declare type SelectorWrapperProps = Omit<SelectProps, "filterOption" | "onSearch" | "loading" | "notFoundContent" | "options" | "fieldNames"> & {
|
|
174
191
|
modelKey: string;
|
|
192
|
+
fieldNames?: {
|
|
193
|
+
label: string;
|
|
194
|
+
value: string;
|
|
195
|
+
};
|
|
175
196
|
/**
|
|
176
197
|
* useEffect依赖性数组
|
|
177
198
|
*/
|
|
@@ -185,13 +206,14 @@ export declare type SelectorWrapperProps = Omit<SelectProps, "filterOption" | "o
|
|
|
185
206
|
* ```
|
|
186
207
|
* 1. 当设置selectorList后,serviceConfig、operateType=search、onSelectorListChange将失效
|
|
187
208
|
* 2. 不支持异步数据,异步使用serviceConfig方式
|
|
209
|
+
* 3. 如果配置fieldNames,会转换后使用
|
|
188
210
|
* ```
|
|
189
211
|
*/
|
|
190
|
-
selectorList?:
|
|
212
|
+
selectorList?: TPlainObject[];
|
|
191
213
|
/**
|
|
192
214
|
* 通过服务获取数据后回调,当设置`selectorList`后无效果
|
|
193
215
|
*/
|
|
194
|
-
onSelectorListChange?: (
|
|
216
|
+
onSelectorListChange?: (dataList: LabelValueItem[]) => void;
|
|
195
217
|
/**
|
|
196
218
|
* 添加全部选项
|
|
197
219
|
* ```
|
|
@@ -229,8 +251,12 @@ export declare type SelectorWrapperRefApi = {
|
|
|
229
251
|
* 3. operateType=search状态下,回填数据查询接口时,会在接口中默认添加id字段(id的值为回填的值)
|
|
230
252
|
* ```
|
|
231
253
|
*/
|
|
232
|
-
export declare const SelectorWrapper: import("react").ForwardRefExoticComponent<Omit<SelectProps<any, import("rc-select/lib/Select").DefaultOptionType>, "loading" | "options" | "filterOption" | "notFoundContent" | "onSearch"> & {
|
|
254
|
+
export declare const SelectorWrapper: import("react").ForwardRefExoticComponent<Omit<SelectProps<any, import("rc-select/lib/Select").DefaultOptionType>, "loading" | "options" | "filterOption" | "notFoundContent" | "onSearch" | "fieldNames"> & {
|
|
233
255
|
modelKey: string;
|
|
256
|
+
fieldNames?: {
|
|
257
|
+
label: string;
|
|
258
|
+
value: string;
|
|
259
|
+
} | undefined;
|
|
234
260
|
/**
|
|
235
261
|
* useEffect依赖性数组
|
|
236
262
|
*/
|
|
@@ -244,13 +270,14 @@ export declare const SelectorWrapper: import("react").ForwardRefExoticComponent<
|
|
|
244
270
|
* ```
|
|
245
271
|
* 1. 当设置selectorList后,serviceConfig、operateType=search、onSelectorListChange将失效
|
|
246
272
|
* 2. 不支持异步数据,异步使用serviceConfig方式
|
|
273
|
+
* 3. 如果配置fieldNames,会转换后使用
|
|
247
274
|
* ```
|
|
248
275
|
*/
|
|
249
|
-
selectorList?:
|
|
276
|
+
selectorList?: TPlainObject<any>[] | undefined;
|
|
250
277
|
/**
|
|
251
278
|
* 通过服务获取数据后回调,当设置`selectorList`后无效果
|
|
252
279
|
*/
|
|
253
|
-
onSelectorListChange?: ((
|
|
280
|
+
onSelectorListChange?: ((dataList: LabelValueItem[]) => void) | undefined;
|
|
254
281
|
/**
|
|
255
282
|
* 添加全部选项
|
|
256
283
|
* ```
|
|
@@ -270,6 +297,55 @@ export declare const SelectorWrapper: import("react").ForwardRefExoticComponent<
|
|
|
270
297
|
operateType?: "search" | "filter" | undefined;
|
|
271
298
|
searchFieldName?: string | undefined;
|
|
272
299
|
} & import("react").RefAttributes<SelectorWrapperRefApi>>;
|
|
300
|
+
export declare type UploadWrapperFileItem = {
|
|
301
|
+
uid: string;
|
|
302
|
+
name: string;
|
|
303
|
+
url: string;
|
|
304
|
+
};
|
|
305
|
+
export declare type UploadWrapperProps<T extends TPlainObject = TPlainObject> = {
|
|
306
|
+
value?: T[];
|
|
307
|
+
onChange?: (value?: T[]) => void;
|
|
308
|
+
onUploadError?: (message?: string) => void;
|
|
309
|
+
onUploadChange?: (info: UploadChangeParam<UploadFile>) => void;
|
|
310
|
+
/**
|
|
311
|
+
* 属性映射
|
|
312
|
+
*/
|
|
313
|
+
fieldNames?: {
|
|
314
|
+
uid: string;
|
|
315
|
+
name: string;
|
|
316
|
+
url: string;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* 接口响应数据适配器,如果配置了fieldNames,适配器返回值会再进过fieldNames转换
|
|
320
|
+
*/
|
|
321
|
+
onRequestResultAdapter?: (respData: any) => TPlainObject;
|
|
322
|
+
} & Omit<UploadProps, "onChange" | "fileList">;
|
|
323
|
+
/**
|
|
324
|
+
* 文件上传
|
|
325
|
+
* ```
|
|
326
|
+
* 1. 可通过配置children替换默认上传触发布局
|
|
327
|
+
* 2. 接口返回结构:
|
|
328
|
+
* formData上传接口返回值
|
|
329
|
+
* {
|
|
330
|
+
* code: '0000',
|
|
331
|
+
* data: {
|
|
332
|
+
* uid: '唯一值,可使用fileKey值'
|
|
333
|
+
* name: '文件名称'
|
|
334
|
+
* url: '预览地址'
|
|
335
|
+
* }
|
|
336
|
+
* }
|
|
337
|
+
* 可通过fieldNames配置接口返回值属性名称映射
|
|
338
|
+
* 3. 最佳使用方式,与Form结合使用
|
|
339
|
+
* <Form.Item name="attachmentList" label="附件">
|
|
340
|
+
* <UploadWrapper action={uploadUrl} onPreview={onPreviewFile} />
|
|
341
|
+
* </Form.Item>
|
|
342
|
+
* ```
|
|
343
|
+
*
|
|
344
|
+
*/
|
|
345
|
+
export declare const UploadWrapper: FC<UploadWrapperProps>;
|
|
346
|
+
export declare type EditableTableRecordType = FormListFieldData & {
|
|
347
|
+
operation: FormListOperation;
|
|
348
|
+
};
|
|
273
349
|
export declare type EditableInputConfig = {
|
|
274
350
|
type: "input";
|
|
275
351
|
editableComptProps?: InputProps;
|
|
@@ -278,17 +354,17 @@ export declare type EditableInputNumberConfig = {
|
|
|
278
354
|
type: "inputNumber";
|
|
279
355
|
editableComptProps?: InputNumberProps;
|
|
280
356
|
};
|
|
281
|
-
export declare type
|
|
357
|
+
export declare type EditableSelectWrapperConfig = {
|
|
282
358
|
type: "selectorWrapper";
|
|
283
359
|
editableComptProps: SelectorWrapperProps;
|
|
284
360
|
};
|
|
285
|
-
export declare type
|
|
286
|
-
type: "
|
|
287
|
-
editableComptProps?:
|
|
361
|
+
export declare type EditableDatePickerWrapperConfig = {
|
|
362
|
+
type: "datePickerWrapper";
|
|
363
|
+
editableComptProps?: DatePickerWrapperProps;
|
|
288
364
|
};
|
|
289
|
-
export declare type
|
|
290
|
-
type: "
|
|
291
|
-
editableComptProps?:
|
|
365
|
+
export declare type EditableDateRangePickerWrapperConfig = {
|
|
366
|
+
type: "dateRangePickerWrapper";
|
|
367
|
+
editableComptProps?: DateRangePickerWrapperProps;
|
|
292
368
|
};
|
|
293
369
|
export declare type EditableCheckboxGroupConfig = {
|
|
294
370
|
type: "checkboxGroup";
|
|
@@ -303,8 +379,8 @@ export declare type EditableTextareaConfig = {
|
|
|
303
379
|
editableComptProps: TextAreaProps;
|
|
304
380
|
};
|
|
305
381
|
export declare type EditableFileUploadConfig = {
|
|
306
|
-
type: "
|
|
307
|
-
editableComptProps:
|
|
382
|
+
type: "uploadWrapper";
|
|
383
|
+
editableComptProps: UploadWrapperProps;
|
|
308
384
|
};
|
|
309
385
|
/**
|
|
310
386
|
* 自定义编辑组件
|
|
@@ -331,7 +407,7 @@ export declare type EditableCustomConfig = {
|
|
|
331
407
|
completeName: Array<number | string>;
|
|
332
408
|
}) => ReactElement;
|
|
333
409
|
};
|
|
334
|
-
export declare type EditableTypeConfig = EditableCustomConfig | EditableInputConfig |
|
|
410
|
+
export declare type EditableTypeConfig = EditableCustomConfig | EditableInputConfig | EditableSelectWrapperConfig | EditableDatePickerWrapperConfig | EditableDateRangePickerWrapperConfig | EditableCheckboxGroupConfig | EditableTextareaConfig | EditableInputNumberConfig | EditableRadioGroupConfig | EditableFileUploadConfig;
|
|
335
411
|
export declare type FieldSingleConfig = {
|
|
336
412
|
editable?: boolean | ((data: {
|
|
337
413
|
tableRowIndex: number;
|
|
@@ -372,30 +448,48 @@ export declare type FormListConfig = {
|
|
|
372
448
|
formListItemIndex: number;
|
|
373
449
|
}) => ReactElement;
|
|
374
450
|
};
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
451
|
+
/**
|
|
452
|
+
* antd 默认render功能此处不能使用
|
|
453
|
+
*/
|
|
378
454
|
export declare type EditableTableColumn = Omit<ColumnsType["0"], "render"> & {
|
|
379
|
-
dataIndex
|
|
455
|
+
dataIndex?: string;
|
|
380
456
|
fieldConfig?: FieldSingleConfig | FormListConfig;
|
|
381
457
|
/**
|
|
382
458
|
* 配置操作功能处理后,fieldConfig配置将失效
|
|
459
|
+
* ```
|
|
460
|
+
* 1. tableRowIndex:当前row的索引值
|
|
461
|
+
* 1. name:当前row的form.item的name值
|
|
462
|
+
* ```
|
|
383
463
|
*/
|
|
384
|
-
operateRender?: (item:
|
|
464
|
+
operateRender?: (item: {
|
|
385
465
|
tableRowIndex: number;
|
|
466
|
+
name: Array<string | number>;
|
|
467
|
+
operation: FormListOperation;
|
|
386
468
|
}) => ReactElement;
|
|
387
469
|
};
|
|
388
470
|
export declare type EditableTableProps = {
|
|
389
471
|
name: string;
|
|
390
|
-
|
|
472
|
+
/**
|
|
473
|
+
* ```
|
|
474
|
+
* antd table属性
|
|
475
|
+
* 1. 新增cellVerticalAlign,单元格竖直方向对齐方式,设置table column onCell属性后失效
|
|
476
|
+
* ```
|
|
477
|
+
*/
|
|
478
|
+
tableProps?: Omit<TableProps<EditableTableRecordType>, "dataSource" | "columns" | "rowKey"> & {
|
|
479
|
+
cellVerticalAlign?: "baseline" | "middle" | "top" | "bottom";
|
|
480
|
+
};
|
|
391
481
|
columns: EditableTableColumn[];
|
|
392
|
-
onTableBeforeRender?: (
|
|
393
|
-
|
|
482
|
+
onTableBeforeRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
|
|
483
|
+
/**
|
|
484
|
+
* 设置后,将覆盖底部`新增`按钮
|
|
485
|
+
*/
|
|
486
|
+
onTableAfterRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
|
|
487
|
+
rules?: FormListProps["rules"];
|
|
394
488
|
};
|
|
395
489
|
export declare const EditableTable: (props: EditableTableProps) => JSX.Element;
|
|
396
490
|
export declare type FileImportProps = {
|
|
397
|
-
onImportFinish: (data
|
|
398
|
-
} & Omit<UploadProps, "onChange" | "
|
|
491
|
+
onImportFinish: (data?: any) => void;
|
|
492
|
+
} & Omit<UploadProps, "fileList" | "showUploadList" | "itemRender" | "listType" | "multiple" | "previewFile" | "progress" | "onChange" | "onDownload" | "onRemove" | "onPreview" | "directory" | "customRequest" | "defaultFileList" | "iconRender">;
|
|
399
493
|
/**
|
|
400
494
|
* 文件导入
|
|
401
495
|
* ```
|
|
@@ -405,6 +499,48 @@ export declare type FileImportProps = {
|
|
|
405
499
|
* ```
|
|
406
500
|
*/
|
|
407
501
|
export declare const FileImport: FC<FileImportProps>;
|
|
502
|
+
export declare type FileUploadItem = {
|
|
503
|
+
fileKey: string;
|
|
504
|
+
fileName: string;
|
|
505
|
+
};
|
|
506
|
+
export declare type FileUploadProps = {
|
|
507
|
+
onChange?: (value?: FileUploadItem[]) => void;
|
|
508
|
+
onUploadError?: (message?: string) => void;
|
|
509
|
+
value?: FileUploadItem[];
|
|
510
|
+
onPreview?: (item: FileUploadItem) => void;
|
|
511
|
+
onUploadChange?: (info: UploadChangeParam<UploadFile>) => void;
|
|
512
|
+
/**
|
|
513
|
+
* 属性映射
|
|
514
|
+
*/
|
|
515
|
+
fieldNames?: {
|
|
516
|
+
fileKey?: string;
|
|
517
|
+
fileName?: string;
|
|
518
|
+
};
|
|
519
|
+
} & Omit<UploadProps, "onChange" | "fileList" | "onPreview">;
|
|
520
|
+
/**
|
|
521
|
+
* 文件上传,结合Form使用最佳
|
|
522
|
+
* ```
|
|
523
|
+
* 接口返回结构:
|
|
524
|
+
* formData上传接口必须返回fileKey值
|
|
525
|
+
* {
|
|
526
|
+
* code: '0000',
|
|
527
|
+
* data: {
|
|
528
|
+
* fileKey: '预览文件对应的fileKey'
|
|
529
|
+
* }
|
|
530
|
+
* }
|
|
531
|
+
* 可通过fieldNames配置接口返回值属性名称映射
|
|
532
|
+
* ```
|
|
533
|
+
* ```
|
|
534
|
+
* 最佳使用方式:
|
|
535
|
+
* <Form.Item name="attachmentList" label="附件">
|
|
536
|
+
* <FileUpload action={uploadUrl} onPreview={onPreviewFile}>
|
|
537
|
+
* <Button type="primary">选择文件导入</Button>
|
|
538
|
+
* </FileUpload>
|
|
539
|
+
* </Form.Item>
|
|
540
|
+
* ```
|
|
541
|
+
*
|
|
542
|
+
*/
|
|
543
|
+
export declare const FileUpload: FC<FileUploadProps>;
|
|
408
544
|
export declare type FlexLayoutProps = {
|
|
409
545
|
className?: string;
|
|
410
546
|
fullIndex?: number | number[];
|
|
@@ -454,7 +590,7 @@ export interface ModalActionsParamType {
|
|
|
454
590
|
closeModal: void;
|
|
455
591
|
setModalItemData: Record<string, unknown>;
|
|
456
592
|
}
|
|
457
|
-
export interface
|
|
593
|
+
export interface ModalOperationOldProps {
|
|
458
594
|
loading?: boolean;
|
|
459
595
|
okText?: string;
|
|
460
596
|
cancelText?: string;
|
|
@@ -467,9 +603,16 @@ export interface ModalOperationProps {
|
|
|
467
603
|
export declare type ModalFormProps = {
|
|
468
604
|
className?: string;
|
|
469
605
|
pageLoading?: boolean;
|
|
470
|
-
operationProps?:
|
|
606
|
+
operationProps?: ModalOperationOldProps;
|
|
471
607
|
footer?: null | React.ReactNode;
|
|
472
608
|
} & Omit<ModalProps, "footer" | "onOk" | "okText" | "cancelText" | "okButtonProps" | "cancelButtonProps" | "okType" | "confirmLoading">;
|
|
609
|
+
/**
|
|
610
|
+
* 弹窗机制
|
|
611
|
+
* ```
|
|
612
|
+
* 1. 默认 destroyOnClose = true
|
|
613
|
+
* 2. 默认 forceRender = false
|
|
614
|
+
* ```
|
|
615
|
+
*/
|
|
473
616
|
export declare const ModalWraper: FC<ModalFormProps>;
|
|
474
617
|
/**
|
|
475
618
|
* modal弹窗模型
|
|
@@ -482,6 +625,59 @@ export declare const ModalWraper: FC<ModalFormProps>;
|
|
|
482
625
|
* ```
|
|
483
626
|
*/
|
|
484
627
|
export declare const createModalWraperModel: (key: string) => API<ModelType<ModalStateType, ModalActionsParamType, any>>;
|
|
628
|
+
export interface ModalStateType {
|
|
629
|
+
title?: string;
|
|
630
|
+
/**
|
|
631
|
+
* 显示modal
|
|
632
|
+
*/
|
|
633
|
+
visible: boolean;
|
|
634
|
+
/**
|
|
635
|
+
* 用来处理form, `更新`的时候的传递当前item列表行的数据, 当`创建`的时候强制设置为 `undefined`
|
|
636
|
+
*/
|
|
637
|
+
itemData?: Record<string, unknown> | null;
|
|
638
|
+
operateType: "create" | "update" | "view";
|
|
639
|
+
pageLoading?: boolean;
|
|
640
|
+
}
|
|
641
|
+
export interface ModalActionsParamType {
|
|
642
|
+
openModalForm: Pick<ModalStateType, "title" | "itemData" | "operateType" | "pageLoading">;
|
|
643
|
+
closeModal: void;
|
|
644
|
+
setModalItemData: Record<string, unknown>;
|
|
645
|
+
}
|
|
646
|
+
export interface ModalOperationProps {
|
|
647
|
+
loading?: boolean;
|
|
648
|
+
okText?: string;
|
|
649
|
+
cancelText?: string;
|
|
650
|
+
onOk?: () => void;
|
|
651
|
+
onCancel?: () => void;
|
|
652
|
+
hideOkBtn?: boolean;
|
|
653
|
+
okButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
654
|
+
cancelButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
655
|
+
}
|
|
656
|
+
export declare type ModalFormOldProps = {
|
|
657
|
+
className?: string;
|
|
658
|
+
pageLoading?: boolean;
|
|
659
|
+
operationProps?: ModalOperationProps;
|
|
660
|
+
footer?: null | React.ReactNode;
|
|
661
|
+
} & Omit<ModalProps, "footer" | "onOk" | "okText" | "cancelText" | "okButtonProps" | "cancelButtonProps" | "okType" | "confirmLoading">;
|
|
662
|
+
/**
|
|
663
|
+
* 弹窗机制
|
|
664
|
+
* ```
|
|
665
|
+
* 1. 默认 destroyOnClose = true
|
|
666
|
+
* 2. 默认 forceRender = false
|
|
667
|
+
* ```
|
|
668
|
+
*/
|
|
669
|
+
export declare const ModalWrapper: FC<ModalFormOldProps>;
|
|
670
|
+
/**
|
|
671
|
+
* modal弹窗模型
|
|
672
|
+
* @param key 唯一值必传
|
|
673
|
+
* @returns
|
|
674
|
+
*
|
|
675
|
+
* ```
|
|
676
|
+
* 使用方式
|
|
677
|
+
* const [modalState, modalActions] = createModalWrapperModel('key值').useStore();
|
|
678
|
+
* ```
|
|
679
|
+
*/
|
|
680
|
+
export declare const createModalWrapperModel: (key: string) => API<ModelType<ModalStateType, ModalActionsParamType, any>>;
|
|
485
681
|
export declare type PageFixedFooterProps = {
|
|
486
682
|
className?: string;
|
|
487
683
|
style?: CSSProperties;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flatbiz/antd",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.21",
|
|
4
4
|
"description": "flat-biz oss ui components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -25,12 +25,6 @@
|
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=13.8.0"
|
|
27
27
|
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"antd": "^4.20.0",
|
|
30
|
-
"moment": "^2.29.3",
|
|
31
|
-
"react": "^17.0.2",
|
|
32
|
-
"react-dom": "^17.0.2"
|
|
33
|
-
},
|
|
34
28
|
"peerDependencies": {
|
|
35
29
|
"@ant-design/icons": "^4.7.0",
|
|
36
30
|
"@dimjs/lang": "^1.2.9",
|
|
@@ -40,5 +34,20 @@
|
|
|
40
34
|
"@flatbiz/utils": "^2.3.15",
|
|
41
35
|
"@wove/react": "^1.2.10"
|
|
42
36
|
},
|
|
43
|
-
"
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@ant-design/icons": "^4.7.0",
|
|
39
|
+
"@dimjs/lang": "^1.2.9",
|
|
40
|
+
"@dimjs/model": "^1.1.3",
|
|
41
|
+
"@dimjs/model-react": "^1.1.4",
|
|
42
|
+
"@dimjs/utils": "^1.2.9",
|
|
43
|
+
"@flatbiz/utils": "^2.3.21",
|
|
44
|
+
"@wove/react": "^1.2.10",
|
|
45
|
+
"antd": "^4.20.0",
|
|
46
|
+
"moment": "^2.29.3",
|
|
47
|
+
"react": "^17.0.2",
|
|
48
|
+
"react-dom": "^17.0.2",
|
|
49
|
+
"react-router": "^6.3.0",
|
|
50
|
+
"react-router-dom": "^6.3.0"
|
|
51
|
+
},
|
|
52
|
+
"gitHead": "06589677717004192b67a37a1e8e0d579c71dd91"
|
|
44
53
|
}
|