@flatbiz/antd 4.4.6 → 4.4.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/esm/button-operate/index.js +1 -1
- package/esm/button-operate/index.js.map +1 -1
- package/esm/button-wrapper/index.js.map +1 -1
- package/esm/card-layout/index.js.map +1 -1
- package/esm/date-range-picker-wrapper-form-item/index.js +1 -1
- package/esm/date-range-picker-wrapper-form-item/index.js.map +1 -1
- package/esm/dialog-alert/index.js +1 -1
- package/esm/dialog-alert/index.js.map +1 -1
- package/esm/dialog-confirm/index.js +1 -1
- package/esm/dialog-confirm/index.js.map +1 -1
- package/esm/dialog-modal/index.js +1 -1
- package/esm/dialog-modal/index.js.map +1 -1
- package/esm/drag-editable-table/index.js +1 -1
- package/esm/drag-editable-table/index.js.map +1 -1
- package/esm/dropdown-menu-wrapper/index.js +1 -1
- package/esm/dropdown-menu-wrapper/index.js.map +1 -1
- package/esm/easy-form/index.css +1 -0
- package/esm/easy-form/index.js +7 -0
- package/esm/easy-form/index.js.map +1 -0
- package/esm/easy-table/index.js.map +1 -1
- package/esm/editable-table/index.js +1 -1
- package/esm/editable-table/index.js.map +1 -1
- package/esm/form-item-wrapper/index.js +1 -1
- package/esm/form-item-wrapper/index.js.map +1 -1
- package/esm/form-wrapper/index.css +0 -0
- package/esm/form-wrapper/index.js +5 -0
- package/esm/form-wrapper/index.js.map +1 -0
- package/esm/index.js +4 -2
- package/esm/search-form/index.js +2 -1
- package/esm/search-form/index.js.map +1 -1
- package/esm/table-cell-render/index.js +1 -1
- package/esm/table-cell-render/index.js.map +1 -1
- package/esm/tree-wrapper/index.js +1 -1
- package/esm/tree-wrapper/index.js.map +1 -1
- package/index.d.ts +117 -23
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { API, ModelType } from '@dimjs/model';
|
|
6
6
|
import { DateFormatType, TAny, TNoopDefine, TPlainObject } from '@flatbiz/utils';
|
|
7
7
|
import { IAllProps } from '@tinymce/tinymce-react';
|
|
8
|
-
import { AlertProps, ButtonProps, CardProps, CascaderProps, CheckboxProps, CollapseProps, ColorPickerProps, DrawerProps, DropdownProps, FormInstance, FormItemProps, FormListFieldData, FormListOperation, InputNumberProps, InputProps, MentionProps, ModalProps, PaginationProps, PopconfirmProps, PopoverProps, RadioGroupProps, RowProps, SelectProps, SpaceProps, SwitchProps, TableProps, TabsProps, TagProps, TimePickerProps, TimeRangePickerProps, TooltipProps, TreeProps, TreeSelectProps, UploadProps } from 'antd';
|
|
8
|
+
import { AlertProps, ButtonProps, CardProps, CascaderProps, CheckboxProps, CollapseProps, ColorPickerProps, DrawerProps, DropdownProps, FormInstance, FormItemProps, FormListFieldData, FormListOperation, FormProps, InputNumberProps, InputProps, MentionProps, ModalProps, PaginationProps, PopconfirmProps, PopoverProps, RadioGroupProps, RowProps, SelectProps, SpaceProps, SwitchProps, TableProps, TabsProps, TagProps, TimePickerProps, TimeRangePickerProps, TooltipProps, TreeProps, TreeSelectProps, UploadProps } from 'antd';
|
|
9
9
|
import { ConfigProviderProps } from 'antd/es/config-provider';
|
|
10
10
|
import { PickerDateProps, RangePickerDateProps } from 'antd/es/date-picker/generatePicker';
|
|
11
11
|
import { FormListProps } from 'antd/es/form';
|
|
@@ -353,15 +353,17 @@ export declare const BoxGrid: {
|
|
|
353
353
|
Col: import("react").FC<BoxColProps & ICommonReact>;
|
|
354
354
|
};
|
|
355
355
|
export type ButtonWrapperProps = Omit<ButtonProps, "onClick"> & {
|
|
356
|
+
/** 当返回 Promise 时,按钮自动loading */
|
|
356
357
|
onClick?: (e: React.MouseEvent<HTMLElement>) => Promise<TAny> | void;
|
|
358
|
+
/** 重复点击间隙,单位毫秒 默认值:500 */
|
|
357
359
|
debounceDuration?: number;
|
|
360
|
+
/** 基于GLOBAL中elemAclLimits按钮权限列表,控制按钮显示、隐藏 */
|
|
358
361
|
permission?: string;
|
|
362
|
+
/** 是否隐藏按钮 */
|
|
359
363
|
hidden?: boolean;
|
|
360
364
|
/** loading 显示位置,默认值:left */
|
|
361
365
|
loadingPosition?: "left" | "center";
|
|
362
|
-
/**
|
|
363
|
-
* 移除间隙,一般用于 type=link 类型下
|
|
364
|
-
*/
|
|
366
|
+
/** 移除按钮内边距,一般用于 type=link 类型下 */
|
|
365
367
|
removeGap?: boolean;
|
|
366
368
|
};
|
|
367
369
|
/**
|
|
@@ -372,7 +374,7 @@ export type ButtonWrapperProps = Omit<ButtonProps, "onClick"> & {
|
|
|
372
374
|
* @returns
|
|
373
375
|
*/
|
|
374
376
|
export declare const ButtonWrapper: (props: ButtonWrapperProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
375
|
-
export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContainer" | "open" | "open" | "okButtonProps" | "cancelButtonProps"> & {
|
|
377
|
+
export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContainer" | "open" | "open" | "okButtonProps" | "cancelButtonProps" | "footer"> & {
|
|
376
378
|
onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
|
|
377
379
|
onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
|
|
378
380
|
content: string | ReactElement | ((form: FormInstance, operate: {
|
|
@@ -392,6 +394,8 @@ export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContai
|
|
|
392
394
|
*/
|
|
393
395
|
bodyHeightPercent?: number;
|
|
394
396
|
titleExtra?: ReactElement;
|
|
397
|
+
/** null则隐藏footer */
|
|
398
|
+
footer?: null | ReactElement | ReactElement[];
|
|
395
399
|
};
|
|
396
400
|
/**
|
|
397
401
|
* 居中弹框
|
|
@@ -444,15 +448,14 @@ export interface DropdownMenuWrapperProps extends Omit<DropdownProps, "menu"> {
|
|
|
444
448
|
*/
|
|
445
449
|
export declare const DropdownMenuWrapper: (props: DropdownMenuWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
446
450
|
export interface ButtonOperateItem extends ButtonWrapperProps {
|
|
447
|
-
hidden?: boolean;
|
|
448
451
|
/** hover 提示文字,isFold=true无效 */
|
|
449
452
|
hoverTips?: string | React.ReactElement;
|
|
450
453
|
/** hover 提示类型 默认:'tooltip' */
|
|
451
454
|
tipsType?: "popover" | "tooltip";
|
|
455
|
+
/** 按钮文案 */
|
|
452
456
|
text?: string | ReactElement;
|
|
457
|
+
/** 自定义按钮颜色 */
|
|
453
458
|
color?: string;
|
|
454
|
-
onClick?: (event: React.MouseEvent<HTMLElement>) => void | Promise<void>;
|
|
455
|
-
permission?: string;
|
|
456
459
|
/** 是否需要二次弹框确认 */
|
|
457
460
|
needConfirm?: boolean;
|
|
458
461
|
/** 二次弹框确认文案 */
|
|
@@ -463,6 +466,8 @@ export interface ButtonOperateItem extends ButtonWrapperProps {
|
|
|
463
466
|
confirmModalProps?: DialogModalProps;
|
|
464
467
|
}
|
|
465
468
|
export interface ButtonOperateProps {
|
|
469
|
+
className?: string;
|
|
470
|
+
style?: CSSProperties;
|
|
466
471
|
/**
|
|
467
472
|
* 如果数组中元素为ReactElement类型
|
|
468
473
|
* 1. 一般为antd Button组件,如果组件存在属性hidden=true,则会隐藏
|
|
@@ -471,14 +476,16 @@ export interface ButtonOperateProps {
|
|
|
471
476
|
* 3. 不支持fold效果
|
|
472
477
|
*/
|
|
473
478
|
operateList: Array<ButtonOperateItem | null | ReactElement>;
|
|
479
|
+
/** 是否换行,默认true */
|
|
474
480
|
wrap?: boolean;
|
|
481
|
+
/** 隐藏图标Icon */
|
|
475
482
|
foldIcon?: ReactElement;
|
|
476
|
-
|
|
483
|
+
/** 按钮之间是否添加分隔符 */
|
|
477
484
|
split?: boolean;
|
|
485
|
+
/** 多个按钮的包装组件Space属性 */
|
|
478
486
|
spaceProps?: SpaceProps;
|
|
479
487
|
/** 间距,默认:10;split=true配置下无效(可通过spaceProps设置间距) */
|
|
480
488
|
gap?: number;
|
|
481
|
-
style?: CSSProperties;
|
|
482
489
|
/** 折叠合拢属性 */
|
|
483
490
|
dropdownMenuProps?: Omit<DropdownMenuWrapperProps, "menuList">;
|
|
484
491
|
}
|
|
@@ -495,7 +502,9 @@ export declare const ButtonOperateItemContent: (props: Pick<ButtonOperateItem, "
|
|
|
495
502
|
*/
|
|
496
503
|
export declare const ButtonOperate: FC<ButtonOperateProps>;
|
|
497
504
|
export type CardLayoutProps = {
|
|
505
|
+
/** 描述 */
|
|
498
506
|
desc?: string | string[] | ReactElement | ReactElement[];
|
|
507
|
+
/** 标题 */
|
|
499
508
|
title?: string | ReactElement;
|
|
500
509
|
/**
|
|
501
510
|
* layoutType 布局类型
|
|
@@ -529,9 +538,9 @@ export type CardLayoutProps = {
|
|
|
529
538
|
size?: "default" | "small";
|
|
530
539
|
onClick?: (event: any) => void;
|
|
531
540
|
hidden?: boolean;
|
|
541
|
+
children?: ReactNode;
|
|
532
542
|
className?: string;
|
|
533
543
|
style?: CSSProperties;
|
|
534
|
-
children?: ReactNode;
|
|
535
544
|
};
|
|
536
545
|
/**
|
|
537
546
|
* 卡片结构布局,替代 SimpleLayout 组件
|
|
@@ -889,14 +898,36 @@ export interface FormItemWrapperProps extends FormItemProps {
|
|
|
889
898
|
* 如果设置 normalize 属性,outputNormalize将失效
|
|
890
899
|
*/
|
|
891
900
|
outputNormalize?: (value?: TAny) => TAny;
|
|
892
|
-
/**
|
|
901
|
+
/** 是否清除 Form.Item */
|
|
893
902
|
isClear?: boolean;
|
|
903
|
+
/**
|
|
904
|
+
* label宽度
|
|
905
|
+
* ```
|
|
906
|
+
* 1. 如果想控制Form下所有label,可使用FormWrapper组件 替换 Form组件,在FormWrapper上设置属性
|
|
907
|
+
* ```
|
|
908
|
+
*/
|
|
909
|
+
labelWidth?: "auto" | "70" | "80" | "90" | "100" | "110" | "120" | "130" | "140" | "150" | "160" | "170" | "180" | "190" | "200";
|
|
910
|
+
/**
|
|
911
|
+
* labelItem 竖直布局
|
|
912
|
+
* ```
|
|
913
|
+
* 1. 如果想控制Form下所有labelItem,可使用FormWrapper组件 替换 Form组件,在FormWrapper上设置属性
|
|
914
|
+
* ```
|
|
915
|
+
*/
|
|
916
|
+
labelItemVertical?: true;
|
|
917
|
+
/**
|
|
918
|
+
* label 对齐方式
|
|
919
|
+
* ```
|
|
920
|
+
* 1. 如果想控制Form下所有labelAlign,可使用FormWrapper组件 替换 Form组件,在FormWrapper上设置属性
|
|
921
|
+
* ```
|
|
922
|
+
*/
|
|
923
|
+
labelAlign?: "left" | "right";
|
|
894
924
|
}
|
|
895
925
|
/**
|
|
896
926
|
* 对 Form.Item 包装处理
|
|
897
927
|
* ```
|
|
898
928
|
* 1. 为 children 增加 before、after
|
|
899
929
|
* 2. 对输入、输出数据进行序列化处理
|
|
930
|
+
* 3. 内置布局样式使用 preDefinedClassName.formItem
|
|
900
931
|
* ```
|
|
901
932
|
*/
|
|
902
933
|
export declare const FormItemWrapper: (props: FormItemWrapperProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1828,6 +1859,55 @@ export declare const dynamicNode: {
|
|
|
1828
1859
|
};
|
|
1829
1860
|
remove: (elementId?: string) => void;
|
|
1830
1861
|
};
|
|
1862
|
+
export type FormWrapperProps<Values = any> = FormProps<Values> & {
|
|
1863
|
+
children: ReactNode;
|
|
1864
|
+
/** label宽度,Form内部所有FormItem label都生效 */
|
|
1865
|
+
labelWidth?: "auto" | "70" | "80" | "90" | "100" | "110" | "120" | "130" | "140" | "150" | "160" | "170" | "180" | "190" | "200";
|
|
1866
|
+
/** labelItem 竖直布局 */
|
|
1867
|
+
labelItemVertical?: true;
|
|
1868
|
+
/** label 对齐方式 */
|
|
1869
|
+
labelAlign?: "left" | "right";
|
|
1870
|
+
/** formItem之间竖直间距,默认值:24 */
|
|
1871
|
+
formItemGap?: "15" | "8" | "5" | "0";
|
|
1872
|
+
};
|
|
1873
|
+
/**
|
|
1874
|
+
* Form 包装组件,添加对formItem的布局控制
|
|
1875
|
+
* ```
|
|
1876
|
+
* 1. 内置布局样式使用 preDefinedClassName.form
|
|
1877
|
+
* ```
|
|
1878
|
+
*/
|
|
1879
|
+
export declare const FormWrapper: (props: FormWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
1880
|
+
export type EasyFormProps = Omit<FormWrapperProps, "children"> & {
|
|
1881
|
+
children: ReactElement | ReactElement[];
|
|
1882
|
+
/** 一行显示几列,定义FormItem网格占比 */
|
|
1883
|
+
column?: 1 | 2 | 3 | 4;
|
|
1884
|
+
};
|
|
1885
|
+
/**
|
|
1886
|
+
* 简单Form布局,可自定义网格布局
|
|
1887
|
+
* ```
|
|
1888
|
+
* 1. EasyForm 子节点包含 hidden = true 会被忽略
|
|
1889
|
+
* 2. 通过 column 可修改一行显示几列FormItem
|
|
1890
|
+
* 3. demo:https://fex.qa.tcshuke.com/docs/admin/main/form/label
|
|
1891
|
+
* <EasyForm column={3}>
|
|
1892
|
+
<Form.Item name="field1" label="条件1">
|
|
1893
|
+
<Input placeholder="请输入" allowClear={true} />
|
|
1894
|
+
</Form.Item>
|
|
1895
|
+
<Form.Item name="field2" label="条件2">
|
|
1896
|
+
<Input placeholder="请输入" allowClear={true} />
|
|
1897
|
+
</Form.Item>
|
|
1898
|
+
<!-- !!!可通过使用 FormGrid.Col 包裹元素来自定义网格占比 !!! -->
|
|
1899
|
+
<FormGrid.Col span={24}>
|
|
1900
|
+
<Form.Item name="field5" label="条件5">
|
|
1901
|
+
<Input placeholder="请输入" allowClear={true} />
|
|
1902
|
+
</Form.Item>
|
|
1903
|
+
</FormGrid.Col>
|
|
1904
|
+
<Form.Item name="field6" label="条件6">
|
|
1905
|
+
<Input placeholder="请输入" allowClear={true} />
|
|
1906
|
+
</Form.Item>
|
|
1907
|
+
</EasyForm>
|
|
1908
|
+
* ```
|
|
1909
|
+
*/
|
|
1910
|
+
export declare const EasyForm: (props: EasyFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
1831
1911
|
export type TEasyTableTableColumn<T> = ColumnsType<T>[0] & {
|
|
1832
1912
|
/**
|
|
1833
1913
|
* @description 请使用 tipsWrapperProps 属性配置
|
|
@@ -1858,8 +1938,9 @@ export type EasyTableRefApi = {
|
|
|
1858
1938
|
onRequest: (params?: TPlainObject) => void;
|
|
1859
1939
|
/** 获取请求参数 */
|
|
1860
1940
|
getRequestParams: () => TPlainObject;
|
|
1861
|
-
/**
|
|
1941
|
+
/** 清除查询条件 */
|
|
1862
1942
|
clearQueryCondition: (values?: TPlainObject) => Promise<void>;
|
|
1943
|
+
/** 搜素表单实例 */
|
|
1863
1944
|
form: FormInstance;
|
|
1864
1945
|
/** 重置请求 */
|
|
1865
1946
|
onResetRequest: (params?: TPlainObject) => void;
|
|
@@ -1879,7 +1960,6 @@ export type EasyTableServiceConfig = {
|
|
|
1879
1960
|
requestParamsAdapter?: (params: TPlainObject) => TPlainObject;
|
|
1880
1961
|
/**
|
|
1881
1962
|
* 接口相应数据处理
|
|
1882
|
-
* @param params
|
|
1883
1963
|
* ```
|
|
1884
1964
|
* 返回数据为对象,包含两个字段
|
|
1885
1965
|
* 1. 表格列表数据 - Array
|
|
@@ -1959,6 +2039,7 @@ export type EasyTableProps = {
|
|
|
1959
2039
|
};
|
|
1960
2040
|
/** 初始化是否请求,默认值:true */
|
|
1961
2041
|
initRequest?: boolean;
|
|
2042
|
+
/** 表格数据变更回调 */
|
|
1962
2043
|
onDataSourceChange?: (dataSource: TAny) => void;
|
|
1963
2044
|
/** 如果自定义查询按钮,可设置 Form onFinish */
|
|
1964
2045
|
onFormFinish?: (values?: TPlainObject) => void;
|
|
@@ -1977,11 +2058,7 @@ export type EasyTableProps = {
|
|
|
1977
2058
|
* 查询条件展开、收起,被收起key数组;数组内容为EasyTable.Filter 子节点key值
|
|
1978
2059
|
*/
|
|
1979
2060
|
foldKeys?: string[];
|
|
1980
|
-
/**
|
|
1981
|
-
* 自定义处理服务异常
|
|
1982
|
-
* @param error
|
|
1983
|
-
* @returns
|
|
1984
|
-
*/
|
|
2061
|
+
/** 自定义处理服务异常 */
|
|
1985
2062
|
onRequestErrorHandle?: (error: any) => void;
|
|
1986
2063
|
/**
|
|
1987
2064
|
* 是否inline模式
|
|
@@ -2035,9 +2112,9 @@ export type EasyTableFilterProps = {
|
|
|
2035
2112
|
formGridSize?: FormRowProps["gridSize"];
|
|
2036
2113
|
formClassName?: string;
|
|
2037
2114
|
formStyle?: CSSProperties;
|
|
2038
|
-
/** filter Form 外层
|
|
2115
|
+
/** filter Form 外层 BlockLayout style */
|
|
2039
2116
|
filterWrapperStyle?: CSSProperties;
|
|
2040
|
-
/** filter Form 外层
|
|
2117
|
+
/** filter Form 外层 BlockLayout className */
|
|
2041
2118
|
filterWrapperClassName?: string;
|
|
2042
2119
|
/**
|
|
2043
2120
|
* 自定义 filterOperate.rightList 后 默认【查询、重置】按钮处理逻辑
|
|
@@ -2070,12 +2147,16 @@ export type EasyTableTableProps<T> = Omit<TableProps<TAny>, "dataSource" | "load
|
|
|
2070
2147
|
columns: TEasyTableTableColumn<T>[];
|
|
2071
2148
|
/**
|
|
2072
2149
|
* 数据加载与表格初始化渲染 是否同步
|
|
2150
|
+
* @version 4.4.6
|
|
2073
2151
|
* ```
|
|
2074
2152
|
* 1. true:获取数据后再初始化渲染表格(可用于实现表格中defaultXxxx相关功能的使用)
|
|
2075
2153
|
* ```
|
|
2076
2154
|
*/
|
|
2077
2155
|
isSync?: boolean;
|
|
2078
|
-
/**
|
|
2156
|
+
/**
|
|
2157
|
+
* 空效果显示尺寸,默认值:small
|
|
2158
|
+
* @version 4.4.6
|
|
2159
|
+
*/
|
|
2079
2160
|
emptyShowSize?: "small" | "large";
|
|
2080
2161
|
};
|
|
2081
2162
|
/**
|
|
@@ -3280,6 +3361,16 @@ export type SearchFormProps = {
|
|
|
3280
3361
|
formGridSize?: FormRowProps["gridSize"];
|
|
3281
3362
|
formClassName?: string;
|
|
3282
3363
|
formStyle?: CSSProperties;
|
|
3364
|
+
/** form 初始值 */
|
|
3365
|
+
formInitialValues?: TPlainObject;
|
|
3366
|
+
/** label宽度,Form内部所有FormItem label都生效 */
|
|
3367
|
+
formLabelWidth?: FormWrapperProps["labelWidth"];
|
|
3368
|
+
/** labelItem 竖直布局 */
|
|
3369
|
+
formLabelItemVertical?: FormWrapperProps["labelItemVertical"];
|
|
3370
|
+
/** label 对齐方式 */
|
|
3371
|
+
formLabelAlign?: FormWrapperProps["labelAlign"];
|
|
3372
|
+
/** formItem之间竖直间距,默认值:24 */
|
|
3373
|
+
formFormItemGap?: FormWrapperProps["formItemGap"];
|
|
3283
3374
|
/**
|
|
3284
3375
|
* 自定义 searchOperate.rightList 后 默认【查询、重置】按钮处理逻辑
|
|
3285
3376
|
* 1. cover:覆盖内部查询重置按钮(默认值)
|
|
@@ -3291,8 +3382,10 @@ export type SearchFormProps = {
|
|
|
3291
3382
|
rightOperateAreaAppendType?: "cover" | "beforeAppend" | "afterAppend";
|
|
3292
3383
|
/** 默认重启按钮触发请求,默认值:true */
|
|
3293
3384
|
defaultResetButtonTriggerRequest?: boolean;
|
|
3385
|
+
/**
|
|
3386
|
+
* 展开、收起key值列表(内容当前组件子组件key值)
|
|
3387
|
+
*/
|
|
3294
3388
|
foldKeys?: string[];
|
|
3295
|
-
formInitialValues?: TPlainObject;
|
|
3296
3389
|
/**
|
|
3297
3390
|
* 按钮提交事件
|
|
3298
3391
|
* 如果需要自定义回车提交事件,需要自定义提交按钮
|
|
@@ -3311,6 +3404,7 @@ export type SearchFormProps = {
|
|
|
3311
3404
|
cacheSwitch?: boolean;
|
|
3312
3405
|
/** 初始化是否请求,默认值:true */
|
|
3313
3406
|
initRequest?: boolean;
|
|
3407
|
+
form?: FormInstance;
|
|
3314
3408
|
};
|
|
3315
3409
|
export type SearchFormRefApi = {
|
|
3316
3410
|
onQuery: (values?: TPlainObject) => void;
|