@flatbiz/antd 4.0.5 → 4.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/cjs/index.css +59 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/index.d.ts +90 -21
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -45,9 +45,10 @@ export interface ButtonOperateProps {
|
|
|
45
45
|
}
|
|
46
46
|
export declare const ButtonOperate: FC<ButtonOperateProps>;
|
|
47
47
|
export type ButtonWrapperProps = Omit<ButtonProps, "onClick" | "loading"> & {
|
|
48
|
-
onClick
|
|
48
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => Promise<void> | void;
|
|
49
49
|
debounceDuration?: number;
|
|
50
50
|
permission?: string;
|
|
51
|
+
hidden?: boolean;
|
|
51
52
|
};
|
|
52
53
|
/**
|
|
53
54
|
* antd Button包装组件
|
|
@@ -254,25 +255,23 @@ export type DateRangePickerWrapperFormItemProps = Omit<FormItemProps, "name"> &
|
|
|
254
255
|
* ```
|
|
255
256
|
*/
|
|
256
257
|
export declare const DateRangePickerWrapperFormItem: (props: DateRangePickerWrapperFormItemProps) => JSX.Element;
|
|
257
|
-
export type
|
|
258
|
-
okText?: string | ReactElement;
|
|
259
|
-
cancelText?: string | ReactElement;
|
|
258
|
+
export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContainer" | "open" | "open" | "okButtonProps" | "cancelButtonProps"> & {
|
|
260
259
|
onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
|
|
261
260
|
onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
|
|
262
261
|
content: string | ReactElement | ((form: FormInstance, operate: {
|
|
263
262
|
onClose: TNoopDefine;
|
|
264
263
|
}) => ReactElement);
|
|
265
264
|
configProviderProps?: ConfigProviderWrapperProps;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
okHidden?: boolean;
|
|
266
|
+
cancelHidden?: boolean;
|
|
267
|
+
okButtonProps?: Omit<ButtonProps, "hidden" | "children" | "onClick">;
|
|
268
|
+
cancelButtonProps?: Omit<ButtonProps, "hidden" | "children" | "onClick">;
|
|
270
269
|
};
|
|
271
270
|
/**
|
|
272
271
|
* 函数式调用弹框;初始化后,内容无法更新
|
|
273
272
|
*```
|
|
274
273
|
* 1. 基础使用方式
|
|
275
|
-
*
|
|
274
|
+
* dialogModal.open({
|
|
276
275
|
* title: '我是弹框',
|
|
277
276
|
* content: <div>我是内容</div>,
|
|
278
277
|
* });
|
|
@@ -280,7 +279,7 @@ export type DialogDrawerProps = Omit<DrawerProps, "onOk" | "onCancel" | "getCont
|
|
|
280
279
|
* ```
|
|
281
280
|
* ***************************
|
|
282
281
|
* 2. 结合内置form使用,可在onOK、onCancel获取form对象
|
|
283
|
-
*
|
|
282
|
+
* dialogModal.open({
|
|
284
283
|
* title: '我是弹框',
|
|
285
284
|
* content: (form, operate) => {
|
|
286
285
|
* return (
|
|
@@ -296,28 +295,54 @@ export type DialogDrawerProps = Omit<DrawerProps, "onOk" | "onCancel" | "getCont
|
|
|
296
295
|
* return Promise.resolve();
|
|
297
296
|
* },
|
|
298
297
|
* });
|
|
299
|
-
* 注意:
|
|
300
|
-
* 1. 设置operateRender后,需要自定义操作按钮,onOk、onCancel、okText、cancelText、okButtonExtraProps、cancelButtonExtraProps配置失效
|
|
301
298
|
* ```
|
|
302
299
|
*/
|
|
303
|
-
export declare const
|
|
304
|
-
open: (props:
|
|
300
|
+
export declare const dialogModal: {
|
|
301
|
+
open: (props: DialogModalProps) => {
|
|
302
|
+
close: () => void;
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* ```
|
|
306
|
+
* 1. 关闭最新弹框,如果有多个弹框只能关闭最后一个
|
|
307
|
+
* 2. 多个弹框主动关闭,只能使用 dialogModal.open()返回值中的close
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
close: () => void;
|
|
311
|
+
};
|
|
312
|
+
export type DialogAlertProps = Omit<DialogModalProps, "onOk"> & {
|
|
313
|
+
onOk?: (e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
|
|
314
|
+
};
|
|
315
|
+
export declare const dialogAlert: {
|
|
316
|
+
open: (props: DialogAlertProps) => {
|
|
305
317
|
close: () => void;
|
|
306
318
|
};
|
|
307
319
|
};
|
|
308
|
-
export
|
|
320
|
+
export declare const dialogConfirm: {
|
|
321
|
+
open: (props: DialogModalProps) => {
|
|
322
|
+
close: () => void;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
export type DialogDrawerProps = Omit<DrawerProps, "onOk" | "onCancel" | "getContainer" | "open" | "open" | "footer"> & {
|
|
326
|
+
okText?: string | ReactElement;
|
|
327
|
+
cancelText?: string | ReactElement;
|
|
309
328
|
onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
|
|
310
329
|
onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
|
|
311
330
|
content: string | ReactElement | ((form: FormInstance, operate: {
|
|
312
331
|
onClose: TNoopDefine;
|
|
313
332
|
}) => ReactElement);
|
|
314
333
|
configProviderProps?: ConfigProviderWrapperProps;
|
|
334
|
+
okButtonExtraProps?: Omit<ButtonProps, "onClick" | "children" | "loading" | "hidden">;
|
|
335
|
+
cancelButtonExtraProps?: Omit<ButtonProps, "onClick" | "children" | "hidden">;
|
|
336
|
+
operatePosition?: "header" | "footer";
|
|
337
|
+
operateRender?: (form: FormInstance) => ReactElement;
|
|
338
|
+
okHidden?: boolean;
|
|
339
|
+
cancelHidden?: boolean;
|
|
315
340
|
};
|
|
316
341
|
/**
|
|
317
342
|
* 函数式调用弹框;初始化后,内容无法更新
|
|
318
343
|
*```
|
|
319
344
|
* 1. 基础使用方式
|
|
320
|
-
*
|
|
345
|
+
* dialogDrawer.open({
|
|
321
346
|
* title: '我是弹框',
|
|
322
347
|
* content: <div>我是内容</div>,
|
|
323
348
|
* });
|
|
@@ -325,7 +350,7 @@ export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContai
|
|
|
325
350
|
* ```
|
|
326
351
|
* ***************************
|
|
327
352
|
* 2. 结合内置form使用,可在onOK、onCancel获取form对象
|
|
328
|
-
*
|
|
353
|
+
* dialogDrawer.open({
|
|
329
354
|
* title: '我是弹框',
|
|
330
355
|
* content: (form, operate) => {
|
|
331
356
|
* return (
|
|
@@ -341,12 +366,37 @@ export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContai
|
|
|
341
366
|
* return Promise.resolve();
|
|
342
367
|
* },
|
|
343
368
|
* });
|
|
369
|
+
* 注意:
|
|
370
|
+
* 1. 设置operateRender后,需要自定义操作按钮,onOk、onCancel、okText、cancelText、okButtonExtraProps、cancelButtonExtraProps配置失效
|
|
344
371
|
* ```
|
|
345
372
|
*/
|
|
346
|
-
export declare const
|
|
347
|
-
open: (props:
|
|
373
|
+
export declare const dialogDrawer: {
|
|
374
|
+
open: (props: DialogDrawerProps) => {
|
|
348
375
|
close: () => void;
|
|
349
376
|
};
|
|
377
|
+
/**
|
|
378
|
+
* ```
|
|
379
|
+
* 1. 关闭最新弹框,如果有多个弹框只能关闭最后一个
|
|
380
|
+
* 2. 多个弹框主动关闭,只能使用 dialogDrawer.open()返回值中的close
|
|
381
|
+
* ```
|
|
382
|
+
*/
|
|
383
|
+
close: () => void;
|
|
384
|
+
};
|
|
385
|
+
export type DialogLoadingProps = {
|
|
386
|
+
className?: string;
|
|
387
|
+
message?: string;
|
|
388
|
+
};
|
|
389
|
+
export declare const dialogLoading: {
|
|
390
|
+
open: (props?: DialogLoadingProps) => {
|
|
391
|
+
close: () => void;
|
|
392
|
+
};
|
|
393
|
+
/**
|
|
394
|
+
* ```
|
|
395
|
+
* 1. 关闭最新弹框,如果有多个弹框只能关闭最后一个
|
|
396
|
+
* 2. 多个弹框主动关闭,只能使用 dialogModal.open()返回值中的close
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
close: () => void;
|
|
350
400
|
};
|
|
351
401
|
export interface DrawerStateType {
|
|
352
402
|
title: string;
|
|
@@ -1321,7 +1371,25 @@ export type TagWrapperProps = {
|
|
|
1321
1371
|
* ```
|
|
1322
1372
|
*/
|
|
1323
1373
|
export declare const TagWrapper: FC<TagWrapperProps>;
|
|
1374
|
+
export type TableColumnIconRenderProps = {
|
|
1375
|
+
/** 额外内容 */
|
|
1376
|
+
extra: ReactElement;
|
|
1377
|
+
onClick?: (e: any) => void;
|
|
1378
|
+
showData?: boolean;
|
|
1379
|
+
showMaxNumber?: number;
|
|
1380
|
+
extraPosition?: "before" | "after";
|
|
1381
|
+
};
|
|
1324
1382
|
export declare const tableCellRender: {
|
|
1383
|
+
/**
|
|
1384
|
+
* 表格单元格 拼接额外内容渲染
|
|
1385
|
+
* ```
|
|
1386
|
+
* 1. extra 额外内容
|
|
1387
|
+
* 2. showData 是否显示数据,默认值:true
|
|
1388
|
+
* 3. onClick 点击事件,showData != false 有效
|
|
1389
|
+
* 4. showMaxNumber 显示最大长度,作用于原单元格字符串数据
|
|
1390
|
+
* ```
|
|
1391
|
+
*/
|
|
1392
|
+
extraContentRender: (options: TableColumnIconRenderProps) => (value?: TAny) => JSX.Element;
|
|
1325
1393
|
/**
|
|
1326
1394
|
* table 索引展示,如果存在pageSize、pageNo参数可分页展示索引,否则每页都从1开始
|
|
1327
1395
|
*/
|
|
@@ -1357,9 +1425,10 @@ export declare const tableCellRender: {
|
|
|
1357
1425
|
*/
|
|
1358
1426
|
operateCell: (options: (item: TAny) => ButtonOperateProps) => (_value: string | number, record: any) => JSX.Element;
|
|
1359
1427
|
/**
|
|
1360
|
-
* 实现字段超出隐藏,默认长度
|
|
1428
|
+
* 实现字段超出隐藏,默认长度10个字符
|
|
1361
1429
|
* ```
|
|
1362
|
-
* showMaxNumber:
|
|
1430
|
+
* 1. showMaxNumber: 显示最大长度
|
|
1431
|
+
* 2. 会讲字符转出字节进行计算显示
|
|
1363
1432
|
* ```
|
|
1364
1433
|
*/
|
|
1365
1434
|
tooltipCell: (showMaxNumber?: number, defaultValue?: string) => (value: string | number) => string | number | JSX.Element | undefined;
|