@flatbiz/antd 4.2.102 → 4.2.104

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.
Files changed (75) hide show
  1. package/esm/button-operate/index.js +1 -1
  2. package/esm/button-wrapper/index.js +1 -1
  3. package/esm/config-provider-wrapper/index.js +1 -1
  4. package/esm/dialog-alert/index.js +1 -1
  5. package/esm/dialog-confirm/index.js +1 -1
  6. package/esm/dialog-drawer/index.js +1 -1
  7. package/esm/dialog-drawer-content/index.js +1 -1
  8. package/esm/dialog-loading/index.js +1 -1
  9. package/esm/dialog-loading/index.js.map +1 -1
  10. package/esm/dialog-modal/index.js +1 -1
  11. package/esm/drag-editable-table/index.css +0 -0
  12. package/esm/drag-editable-table/index.js +28 -0
  13. package/esm/drag-editable-table/index.js.map +1 -0
  14. package/esm/drag-form-list/index.js +1 -1
  15. package/esm/drag-table/index.js +1 -1
  16. package/esm/drag-table/index.js.map +1 -1
  17. package/esm/drawer-wrapper/index.js +1 -1
  18. package/esm/drawer-wrapper/index.js.map +1 -1
  19. package/esm/dropdown-menu-wrapper/index.js +1 -1
  20. package/esm/easy-table/index.js +1 -1
  21. package/esm/editable-table/index.js +1 -1
  22. package/esm/fba-app/index.js +1 -1
  23. package/esm/fba-hooks/index.js +1 -1
  24. package/esm/fba-hooks/index.js.map +1 -1
  25. package/esm/file-import/index.js.map +1 -1
  26. package/esm/form-item-group/index.js +1 -1
  27. package/esm/form-list-wrapper/index.js +1 -1
  28. package/esm/index-c7967f72.js +3 -0
  29. package/esm/{index-34027e61.js.map → index-c7967f72.js.map} +1 -1
  30. package/esm/index.js +14 -10
  31. package/esm/json-editor/index.css +0 -0
  32. package/esm/json-editor/index.js +12 -0
  33. package/esm/json-editor/index.js.map +1 -0
  34. package/esm/modal-wrapper/index.js +1 -1
  35. package/esm/modal-wrapper/index.js.map +1 -1
  36. package/esm/relation-tree/index.js +1 -1
  37. package/esm/relation-tree/index.js.map +1 -1
  38. package/esm/rich-text-viewer/index.js +1 -1
  39. package/esm/roll-location-center/index.js +1 -1
  40. package/esm/roll-location-center/index.js.map +1 -1
  41. package/esm/roll-location-in-view/index.js +1 -1
  42. package/esm/roll-location-in-view/index.js.map +1 -1
  43. package/esm/search-form/index.css +0 -0
  44. package/esm/search-form/index.js +11 -0
  45. package/esm/search-form/index.js.map +1 -0
  46. package/esm/search-menu/index.js +4 -1
  47. package/esm/search-menu/index.js.map +1 -1
  48. package/esm/selector-wrapper-search/index.js +1 -1
  49. package/esm/selector-wrapper-simple/index.js +1 -1
  50. package/esm/simple-layout/index.js +1 -1
  51. package/esm/simple-layout/index.js.map +1 -1
  52. package/esm/switch-confirm-wrapper/index.js +1 -1
  53. package/esm/switch-confirm-wrapper/index.js.map +1 -1
  54. package/esm/table-cell-render/index.css +1 -1
  55. package/esm/table-cell-render/index.js +1 -1
  56. package/esm/table-cell-render/index.js.map +1 -1
  57. package/esm/table-scrollbar/index.js +1 -1
  58. package/esm/table-scrollbar/index.js.map +1 -1
  59. package/esm/tag-group/index.js +1 -1
  60. package/esm/tag-group/index.js.map +1 -1
  61. package/esm/text-css-ellipsis/index.js +1 -1
  62. package/esm/text-css-ellipsis/index.js.map +1 -1
  63. package/esm/text-overflow/index.css +1 -0
  64. package/esm/text-overflow/index.js +6 -0
  65. package/esm/text-overflow/index.js.map +1 -0
  66. package/esm/text-overflow-render/index.js +1 -1
  67. package/esm/text-overflow-render/index.js.map +1 -1
  68. package/esm/time-range-picker-wrapper-form-item/index.js +1 -1
  69. package/esm/time-range-picker-wrapper-form-item/index.js.map +1 -1
  70. package/esm/tree-wrapper/index.js +1 -1
  71. package/esm/upload-wrapper/index.js +1 -1
  72. package/esm/upload-wrapper/index.js.map +1 -1
  73. package/index.d.ts +1078 -795
  74. package/package.json +4 -3
  75. package/esm/index-34027e61.js +0 -3
package/index.d.ts CHANGED
@@ -17,6 +17,7 @@ import { UploadChangeParam } from 'antd/lib/upload';
17
17
  import { UploadFile } from 'antd/lib/upload/interface';
18
18
  import * as React from 'react';
19
19
  import { CSSProperties, DependencyList, FC, ForwardRefExoticComponent, ReactElement, ReactNode, RefAttributes } from 'react';
20
+ import { IAceEditorProps } from 'react-ace';
20
21
  import { SplitProps } from 'react-split';
21
22
  import { Editor as TinyMCEEditor } from 'tinymce';
22
23
 
@@ -97,6 +98,12 @@ export type ConfigProviderWrapperProps = Omit<ConfigProviderProps, "locale"> & {
97
98
  /** 自定义国际化数据 */
98
99
  customLocaleMessage?: Partial<TFbaLocale>;
99
100
  };
101
+ /**
102
+ * antd ConfigProvider 扩展类
103
+ * ```
104
+ * 1. 新增监听辅助行为,移除复制文本中前后空格能力
105
+ * ```
106
+ */
100
107
  export declare const ConfigProviderWrapper: (props: ConfigProviderWrapperProps) => import("react/jsx-runtime").JSX.Element;
101
108
  export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContainer" | "open" | "open" | "okButtonProps" | "cancelButtonProps"> & {
102
109
  onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
@@ -823,172 +830,6 @@ export type DragCollapseFormListProps = {
823
830
  * ```
824
831
  */
825
832
  export declare const DragCollapseFormList: (props: DragCollapseFormListProps) => import("react/jsx-runtime").JSX.Element;
826
- export type DragFormListContentProps = {
827
- /** Form.List item fieldData */
828
- formListFieldData: FormListFieldData;
829
- /**
830
- * 当前阶段 完整 formItem name
831
- * ```
832
- * 1. 获取当前输入项Item数据
833
- * form.getFieldValue(props.formStageCompleteName);
834
- * 2. 获取当前输入项Item指定字段数据
835
- * form.getFieldValue([...props.formStageCompleteName, 'key']);
836
- * ```
837
- */
838
- formStageCompleteName: (string | number)[];
839
- /**
840
- * formList上一级 formItem完整name
841
- */
842
- prevCompleteName: (string | number)[];
843
- /** Form.List 操作项 */
844
- operation: FormListOperation;
845
- /** 索引 */
846
- index: number;
847
- /** 获取当前FormList 内部 Form.Item name */
848
- getInsideFormItemName: (key: string) => Array<string | number>;
849
- /** 获取当前 FormList Item 数据 */
850
- getInsideFormItemData: () => TPlainObject;
851
- /** 唯一值字段Key */
852
- uidKey: string;
853
- };
854
- export type DragFormListProps = {
855
- className?: string;
856
- style?: CSSProperties;
857
- itemStyle?: CSSProperties;
858
- /** formList item 数据中的唯一值,默认值:uid */
859
- uidFieldName?: string;
860
- /** formList name */
861
- name: string | number | (string | number)[];
862
- /**
863
- * formList上一级 formItem完整name
864
- * ```
865
- * 1. 如果没有传 []
866
- * 2. FormList内部通过 Form.useWatch 取值需要完整 name
867
- * ```
868
- */
869
- prevCompleteName: (string | number)[];
870
- /** 拖拽回调 */
871
- onDropChange?: (items: TPlainObject[]) => void;
872
- /** 设置拖拽图标 */
873
- dragIcon?: ReactElement;
874
- /** 禁用拖拽,拖拽图标隐藏 */
875
- dragDisabled?: boolean;
876
- /** 设置item禁止拖拽 */
877
- getItemDragDisabled?: (uid: string | number, index: number) => boolean;
878
- /** 新增行默认值,自定义onTableAfterRender后失效 */
879
- getAddRowDefaultValues?: () => TPlainObject;
880
- /** 隐藏新增行按钮 */
881
- hiddenAddRowButton?: boolean;
882
- /** 自定义新增行按钮,getAddRowDefaultValues配置失效 */
883
- onCustomAddRowButton?: (operation: FormListOperation) => ReactElement;
884
- /** formListItem 内容 */
885
- children: (data: DragFormListContentProps) => ReactElement;
886
- /** 隐藏数据为空渲染 */
887
- hiddenEmptyRender?: boolean;
888
- /** formList内部渲染包装,多用于FormListWrapper嵌套布局 */
889
- formListChildrenWrapper?: (props: {
890
- children: ReactElement;
891
- }) => ReactElement;
892
- rules?: FormListProps["rules"];
893
- };
894
- /**
895
- * 可拖拽FormList
896
- * ```
897
- * 1. FormList数组中必须要有唯一值字段,默认值字段名称uid,可通过uidFieldName自定义设置
898
- * 2. Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list
899
- * ```
900
- */
901
- export declare const DragFormList: (props: DragFormListProps) => import("react/jsx-runtime").JSX.Element;
902
- export type DragTableProps = Omit<TableProps<TPlainObject>, "dataSource"> & {
903
- dragIcon?: boolean | ReactElement;
904
- /** 表格数据唯一值字段Key */
905
- uidFieldKey: string;
906
- dataSource?: TPlainObject[];
907
- /**
908
- * 拖拽结束事件
909
- * ```
910
- * dataSource: 拖拽完成后的数据源
911
- * dragData
912
- * 1. activeId 拖拽ID
913
- * 2. activeIndex 拖拽起始表格数组索引值
914
- * 3. overIndex 拖拽结束表格数组索引值
915
- * ```
916
- */
917
- onDragChange?: (dataSource: TPlainObject[], dragData: {
918
- activeId: string | number;
919
- activeIndex: number;
920
- overIndex: number;
921
- }) => void;
922
- };
923
- /**
924
- * 可拖拽表格
925
- * ```
926
- * 1. 必须设置唯一值字段 uidFieldKey
927
- * 2. 如果拖拽显示异常,请检查 uidFieldKey 是否正确
928
- * ```
929
- */
930
- export declare const DragTable: (props: DragTableProps) => import("react/jsx-runtime").JSX.Element;
931
- export interface DrawerOperationProps {
932
- loading?: boolean;
933
- okText?: string;
934
- cancelText?: string;
935
- onOk?: () => void;
936
- onCancel?: () => void;
937
- hideOkBtn?: boolean;
938
- okButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
939
- cancelButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
940
- }
941
- export type DrawerWrapperStaticMethods = {
942
- Content: typeof DrawerWrapperContent;
943
- Footer: typeof DrawerWrapperFooter;
944
- };
945
- export type DrawerWrapperProps = {
946
- className?: string;
947
- /**
948
- * 整个drawer页面级的spinning <Page loading />
949
- */
950
- pageLoading?: boolean;
951
- } & Omit<DrawerProps, "footer">;
952
- declare const DrawerWrapperContent: (props: {
953
- operationProps?: DrawerOperationProps;
954
- children?: ReactNode;
955
- }) => import("react/jsx-runtime").JSX.Element;
956
- declare const DrawerWrapperFooter: (props: any) => import("react/jsx-runtime").JSX.Element;
957
- /**
958
- * 弹窗机制
959
- * @deprecated 已过时 4.3.0版本移除;请使用 const { appDialogModal } = FbaApp.useDialogModal();
960
- * ```
961
- * 1. 默认 destroyOnClose = true
962
- * 2. 默认 forceRender = false
963
- * 3. 如果设置 forceRender = true,会导致弹框中的接口提前调用
964
- *
965
- * 注意
966
- * 1. <Drawer /> 默认关闭后状态不会自动清空, 如果希望每次打开都是新内容,请设置 destroyOnClose。
967
- * 2. <Drawer /> 和 Form 一起配合使用时,设置 destroyOnClose 也不会在 Drawer 关闭时销毁表单字段数据,需要设置 <Form preserve={false} />。
968
- *
969
- * ```
970
- */
971
- export declare const DrawerWrapper: FC<DrawerWrapperProps> & DrawerWrapperStaticMethods;
972
- export type TDynamicNodeProps = {
973
- className?: string;
974
- getContainer?: HTMLElement | (() => HTMLElement) | string;
975
- content?: ReactElement;
976
- fixed?: boolean;
977
- style?: CSSProperties;
978
- };
979
- /**
980
- * 动态添加 element 元素
981
- * ```
982
- * 1. 默认添加到 body 下
983
- * 2. 可通过 getContainer 参数设置添加位置
984
- * ```
985
- */
986
- export declare const dynamicNode: {
987
- append: (props?: TDynamicNodeProps) => {
988
- elementId: string;
989
- };
990
- remove: (elementId?: string) => void;
991
- };
992
833
  export type TipsWrapperProps = {
993
834
  gap?: number;
994
835
  className?: string;
@@ -1026,683 +867,649 @@ export type TipsWrapperProps = {
1026
867
  * ```
1027
868
  */
1028
869
  export declare const TipsWrapper: (props: TipsWrapperProps) => import("react/jsx-runtime").JSX.Element;
1029
- export type TEasyTableTableColumn<T> = ColumnsType<T>[0] & {
870
+ export type SelectorWrapperValue = string | number | Array<string | number> | TPlainObject<string | number> | Array<TPlainObject<string | number>>;
871
+ export type SelectorServiceConfig = {
872
+ params?: TPlainObject;
873
+ /** 与 params 配合使用 */
874
+ requiredParamsKeys?: string[];
875
+ onRequest?: (params?: TAny) => Promise<TAny>;
1030
876
  /**
1031
- * @description 请使用 tipsWrapperProps 属性配置
877
+ * 响应数据适配器
878
+ */
879
+ onRequestResultAdapter?: (respData: TAny) => TPlainObject[];
880
+ };
881
+ export type SelectorWrapperProps = Omit<SelectProps, "onSearch" | "notFoundContent" | "options" | "fieldNames" | "onChange" | "value" | "loading" | "mode"> & {
882
+ /** 不支持 tags 模式,tags模式请使用 SelectorWrapperSimple 组件 */
883
+ mode?: "multiple";
884
+ /** key值,相同的key 同页面可共用缓存数据 */
885
+ modelKey: string;
886
+ /**
887
+ * 参数Key映射
1032
888
  * ```
1033
- * 会在 title 之后展示一个 icon,hover 之后提示一些信息
1034
- * 1. titlestring类型有效
1035
- * 2. hoverArea 默认值:icon
889
+ * 1. 默认值:value=value、label=label、disabled=disabled
890
+ * 2. list onRequest 返回数据中列表key值,可多级取值,例如: 'a.b.c'
891
+ * 3. 配置 serviceConfig.onRequestResultAdapter后,fieldNames.list配置失效
892
+ * 4. 如果没有配置list,可说明接口返回为数组
1036
893
  * ```
1037
894
  */
1038
- tooltip?: string | {
1039
- content: string;
1040
- icon?: ReactElement;
1041
- hoverArea?: "icon" | "all";
895
+ fieldNames?: {
896
+ list?: string;
897
+ label?: string;
898
+ value?: string;
899
+ disabled?: string;
1042
900
  };
1043
- dataIndex?: keyof T | (string & {});
1044
901
  /**
1045
- * 会在 title 之后展示一个 icon
902
+ * 请求服务需求的数据
903
+ */
904
+ serviceConfig?: SelectorServiceConfig;
905
+ /**
906
+ * 同步设置选择器选项列表
1046
907
  * ```
1047
- * 1. title为string类型有效
1048
- * 2. 可为icon添加提示效果
1049
- * 3. 可为icon添加点击事件
908
+ * 1. 如果配置fieldNames,会转换后使用
909
+ * 2. 值为undefined、null不会更新,需要清空可传递空数组
1050
910
  * ```
1051
911
  */
1052
- tipsWrapperProps?: string | TipsWrapperProps;
1053
- };
1054
- export type EasyTableRefApi = {
1055
- /** 外部发起请求服务 */
1056
- onRequest: (params?: TPlainObject) => void;
1057
- /** 获取请求参数 */
1058
- getRequestParams: () => TPlainObject;
1059
- /** 清楚查询条件 */
1060
- clearQueryCondition: (values?: TPlainObject) => Promise<void>;
1061
- form: FormInstance;
1062
- /** 重置请求 */
1063
- onResetRequest: (params?: TPlainObject) => void;
1064
- /** 接口数据源 */
1065
- getDataSource: () => TAny;
1066
- /** 过滤表格数据源,不会触发 onDataSourceChange 函数 */
1067
- onFilterDataSource: (dataSource: TPlainObject[]) => void;
1068
- /** 清空表格数据 */
1069
- onClearDataSource: () => void;
1070
- /** 修改表格数据源,会触发onDataSourceChange函数 */
1071
- onUpdateDataSource: (dataList: TPlainObject[]) => void;
1072
- };
1073
- export type EasyTableServiceConfig = {
1074
- /** 接口配置 */
1075
- onRequest: (params?: TPlainObject) => Promise<TPlainObject | TPlainObject[]>;
1076
- /** 请求参数处理 */
1077
- requestParamsAdapter?: (params: TPlainObject) => TPlainObject;
912
+ selectorList?: TPlainObject[];
1078
913
  /**
1079
- * 接口相应数据处理
1080
- * @param params
914
+ * select 数据源发生变更时触发,第一次不调用
915
+ */
916
+ onSelectorListChange?: (dataList: TPlainObject[]) => void;
917
+ /** select 数据源发生变更时触发,每次都会调用 */
918
+ onSelectorListAllChange?: (dataList: TPlainObject[]) => void;
919
+ /**
920
+ * 通过服务获取数据异常回调
921
+ */
922
+ onSelectorRequestError?: (error: Error) => void;
923
+ /**
924
+ * 添加全部选项
1081
925
  * ```
1082
- * 返回数据为对象,包含两个字段
1083
- * 1. 表格列表数据 - Array
1084
- * 2. 表格条数总数 - Number
1085
- * 其中 字段key 命名会通过 fieldNames 进行转义
1086
- * 例如:
1087
- * fieldNames={{
1088
- * list: 'aList',
1089
- * total: 'aTotal',
1090
- * }}
1091
- * serviceConfig={{
1092
- * url: '/v1/board/list',
1093
- * requestResultAdapter: (respData) => {
1094
- * return {
1095
- * aList: respData.data.rows,
1096
- * aTotal: respData.page.total,
1097
- * };
1098
- * },
1099
- * }}
1100
- * ```
1101
- */
1102
- requestResultAdapter?: (params: TAny) => TPlainObject;
1103
- /**
1104
- * 动态列自定义渲染
1105
- * ```
1106
- * 1. respData: 接口返回数据
1107
- * 2. columns: Table columns配置项
1108
- * ```
1109
- *
1110
- */
1111
- dynamicColumsAdapter?: (respData?: TAny, columns?: TEasyTableTableColumn<TPlainObject>[]) => TEasyTableTableColumn<TPlainObject>[] | undefined;
1112
- };
1113
- export type EasyTableProps = {
1114
- className?: string;
1115
- style?: CSSProperties;
1116
- children: ReactElement | ReactElement[] | ((dataSource?: TAny) => ReactElement);
1117
- /**
1118
- * EasyTable唯一值,可用于缓存查询条件
1119
- * @deprecated 已过时,如果需要缓存数据请设置 cacheSwitch 参数
1120
- */
1121
- modelKey?: string;
1122
- /**
1123
- * 缓存查询条件开关,默认false
1124
- * ```
1125
- * 是否缓存表格查询条件,在路由跳转回来时,不会丢失
926
+ * 1. 默认值label="全部",value=""
927
+ * 2. 可配置label、value
1126
928
  * ```
1127
929
  */
1128
- cacheSwitch?: boolean;
1129
- /** 接口数据配置 */
1130
- serviceConfig: EasyTableServiceConfig;
1131
- /**
1132
- * 1. 查询条件Form initialValues
1133
- * 2. 接口其他参数,例如常量类型
1134
- */
1135
- initialValues?: TPlainObject;
1136
- /**
1137
- * 分页初始化参数,默认值: pageSize = 10
1138
- * @deprecated 已过时 4.3.0版本移除,使用 pageSize 赋值
1139
- */
1140
- initialPaginationParams?: {
1141
- pageSize?: number;
930
+ showAllOption?: true | {
931
+ label: string;
932
+ value: string | number;
1142
933
  };
1143
- /** 分页单页条数,默认值:10 */
1144
- pageSize?: number;
934
+ onLabelRenderAdapter?: (dataItem: TPlainObject) => string | ReactElement;
935
+ onChange?: (value?: SelectorWrapperValue, selectedList?: TPlainObject[] | TPlainObject) => void;
936
+ showIcon?: boolean;
937
+ /** select option添加图标;与showIcon组合使用 */
938
+ icon?: (data: TPlainObject, index: number) => ReactElement;
939
+ requestMessageConfig?: TRequestStatusProps["messageConfig"];
1145
940
  /**
1146
- * 字段映射,默认值:{ list:'list', total:'total', pageNo:'pageNo', pageSize:'pageSize' }
1147
- * ```
1148
- * 1. listtotal用于解析接口响应数据,可以配置多级,例如:{ list: 'data.rows', total: 'page.total' }
1149
- * 2. pageNo、pageSize用于接口分页入参Key定义,只能一级,例如:pageNo: 'page'
941
+ * value格式
942
+ *```
943
+ * 1. string number
944
+ * 2. Array<string | number>
945
+ * 3. lableInValue = true,根据fieldNames配置格式
946
+ * 4. lableInValue = true,Array<fieldNames配置>
1150
947
  * ```
1151
948
  */
1152
- fieldNames?: {
1153
- list?: string;
1154
- total?: string;
1155
- pageNo?: string;
1156
- pageSize?: string;
1157
- };
1158
- /** 初始化是否请求,默认值:true */
1159
- initRequest?: boolean;
1160
- onDataSourceChange?: (dataSource: TAny) => void;
1161
- /** 如果自定义查询按钮,可设置 Form onFinish */
1162
- onFormFinish?: (values?: TPlainObject) => void;
1163
- /** 在父节点高度下,上下铺满;默认值:true */
1164
- isFull?: boolean;
1165
- /** 查询条件固定,不随滚动条滚动 */
1166
- filterFixed?: boolean;
1167
- /** 分页区域固定,不随滚动条滚动 */
1168
- paginationFixed?: boolean;
1169
- /**
1170
- * 1. 配合paginationFixed=true一起使用有效果
1171
- * 2. 当使用Table内的pagination时,在EasyTable.Table中配置分页属性
1172
- */
1173
- pagination?: PaginationProps;
1174
- /**
1175
- * 查询条件展开、收起,被收起key数组;数组内容为EasyTable.Filter 子节点key值
1176
- */
1177
- foldKeys?: string[];
1178
- /**
1179
- * 自定义处理服务异常
1180
- * @param error
1181
- * @returns
1182
- */
1183
- onRequestErrorHandle?: (error: any) => void;
949
+ value?: SelectorWrapperValue;
1184
950
  /**
1185
- * 是否inline模式
951
+ * 使用缓存,默认值:true
1186
952
  * ```
1187
- * 1. 缩短 EasyTable.Filter 与 EasyTable.Table 之间的距离
1188
- * 2. 取消内边距
953
+ * 1. true: modelKey下使用请求参数缓存数据,如果相同modelKey、相同请求参数直接使用缓存数据
954
+ * 2. false: 每次都调用接口,不参与缓存数据、不使用缓存数据
955
+ * 3. useCache=false 在 serviceConfig.requiredParamsKeys.length > 0 有效
1189
956
  * ```
1190
957
  */
1191
- isInline?: boolean;
1192
- /** Form 实例 */
1193
- form?: FormInstance;
958
+ useCache?: boolean;
1194
959
  };
1195
- export type FormOperateColProps = {
1196
- className?: string;
1197
- leftList?: Array<ReactElement | null>;
1198
- rightList?: Array<ReactElement | null>;
1199
- justify?: RowProps["justify"];
1200
- /** 强制单独一行 */
1201
- forceAloneRow?: boolean;
1202
- hidden?: boolean;
1203
- leftSpaceProps?: SpaceProps;
1204
- rightSpaceProps?: SpaceProps;
960
+ /**
961
+ * 选择器包装组件
962
+ * ```
963
+ * 1. 不支持搜索 + 调用服务模式
964
+ * ```
965
+ */
966
+ export declare const SelectorWrapper: (props: SelectorWrapperProps) => import("react/jsx-runtime").JSX.Element;
967
+ export type SwitchWrapperValue = string | number | boolean;
968
+ export type SwitchWrapperProps = Omit<SwitchProps, "checked" | "defaultChecked" | "onChange"> & {
969
+ value?: SwitchWrapperValue;
970
+ checkedValue: SwitchWrapperValue;
971
+ unCheckedValue: SwitchWrapperValue;
972
+ onChange?: (value: SwitchWrapperValue) => void;
973
+ tooltipProps?: Omit<TooltipProps, "title">;
974
+ tooltipTitle?: string | ((value?: SwitchWrapperValue) => string | undefined);
975
+ serviceConfig?: {
976
+ onRequest: (value: SwitchWrapperValue) => TAny;
977
+ message?: {
978
+ success?: string;
979
+ defaultError?: string;
980
+ };
981
+ };
1205
982
  };
1206
- export type FormRowProps = RowProps & {
1207
- children?: ReactNode | ReactNode[];
1208
- /**
1209
- * default = { xs: 24, sm: 12, md: 8, lg: 8, xl: 8, xxl: 6 };
1210
- * small = { xs: 24, sm: 12, md: 8, lg: 6, xl: 6, xxl: 6 };
1211
- */
1212
- gridSize?: "default" | "small";
983
+ /**
984
+ * 解决Switch只能接收boolean的限制,与Form.Item结合使用最佳
985
+ * ```
986
+ * 1. value 为状态值,不局限于boolean,可以为 [string | number | boolean]
987
+ * 2. checkedValue 选中值
988
+ * 3. unCheckedValue 未选中值
989
+ * 4. 与 Form.Item 结合使用,不再需要配置 valuePropName
990
+ * <Form.Item name="fieldName">
991
+ * <SwitchWrapper checkedValue={2} unCheckedValue={1} />
992
+ * </Form.Item>
993
+ * 5. 可设置tooltip效果数据显示
994
+ * 6. 可设置 serviceConfig 配置服务调用交互
995
+ * ```
996
+ */
997
+ export declare const SwitchWrapper: (props: SwitchWrapperProps) => import("react/jsx-runtime").JSX.Element;
998
+ export type UploadWrapperFileItem = {
999
+ uid: string;
1000
+ name: string;
1001
+ url?: string;
1213
1002
  };
1214
- export type EasyTableFilterProps = {
1215
- children: ReactElement | ReactElement[] | ((form: FormInstance) => ReactElement);
1216
- /** isPure = true时无效 */
1217
- filterOperate?: (form: FormInstance) => FormOperateColProps;
1218
- /** 是否为纯净模式(查询条件布局是否自定义), */
1219
- isPure?: boolean;
1220
- /** 查询按钮配置 */
1221
- queryButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
1222
- text?: string;
1223
- };
1224
- /** 重置按钮配置 */
1225
- resetButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
1226
- text?: string;
1227
- };
1003
+ export type UploadWrapperProps<T extends TPlainObject = TPlainObject> = {
1004
+ value?: T[] | T;
1005
+ onChange?: (value?: T[]) => void;
1006
+ onUploadError?: (message?: string) => void;
1007
+ onUploadChange?: (info: UploadChangeParam<UploadFile>) => void;
1228
1008
  /**
1229
- * 网格布局设置
1230
- * default = { xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 };
1231
- * small = { xs: 24, sm: 8, md: 8, lg: 6, xl: 6, xxl: 6 };
1009
+ * 属性取值映射
1232
1010
  */
1233
- formGridSize?: FormRowProps["gridSize"];
1234
- formClassName?: string;
1235
- formStyle?: CSSProperties;
1236
- /** filter Form 外层 SimpleLayout style */
1237
- filterWrapperStyle?: CSSProperties;
1238
- /** filter Form 外层 SimpleLayout className */
1239
- filterWrapperClassName?: string;
1011
+ fieldNames?: {
1012
+ uid: string;
1013
+ name?: string;
1014
+ url?: string;
1015
+ };
1240
1016
  /**
1241
- * 自定义 filterOperate.rightList 后 默认【查询、重置】按钮处理逻辑
1242
- * 1. cover:覆盖内部查询重置按钮(默认值)
1243
- * 2. beforeAppend:添加到【查询重置】按钮前面
1244
- * 3. afterAppend:添加到【查询重置】按钮后面
1245
- *
1246
- * 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
1017
+ * 接口响应数据适配器,如果配置了fieldNames,适配器返回值会再进过fieldNames转换
1247
1018
  */
1248
- rightOperateAreaAppendType?: "cover" | "beforeAppend" | "afterAppend";
1249
- /** 默认重启按钮触发请求,默认值:true */
1250
- defaultResetButtonTriggerRequest?: boolean;
1251
- };
1252
- export type EasyTableTableProps<T> = Omit<TableProps<TAny>, "dataSource" | "loading" | "rowKey" | "columns"> & {
1253
- children?: ReactElement | ReactElement[];
1019
+ onRequestResultAdapter?: (respData: TAny) => TPlainObject;
1020
+ /** 操作触发显示文本 */
1021
+ triggerText?: string;
1022
+ /** 超过maxCount 隐藏上传入口 */
1023
+ limitHidden?: boolean;
1254
1024
  /**
1255
- * 表格行 key 的取值,
1025
+ * 自动提交,默认:true
1256
1026
  * ```
1257
- * 如果 rowKey 为string类型
1258
- * 1. 组件会判断表格列表数据第一条是否存在当前rowKey对象的数据,如果没有组件内部会动态添加唯一值
1259
- * 2. 基于上一条的逻辑,如果表格数据没有唯一值,可指定 rowKey 值为table数据中不存在的字段名,例如:rowKey="_uid"
1260
- * 3. 如果触发上述逻辑,表格数据中会多出rowKey对应的键值对数据
1027
+ * 1. 自定义beforeUpload配置后 autoSubmit 失效
1261
1028
  * ```
1262
1029
  */
1263
- rowKey: TableProps<TAny>["rowKey"];
1264
- /** table Form 外层 SimpleLayout className */
1265
- tableWrapperStyle?: CSSProperties;
1266
- /** table Form 外层 SimpleLayout className */
1267
- tableWrapperClassName?: string;
1268
- columns: TEasyTableTableColumn<T>[];
1269
- };
1030
+ autoSubmit?: boolean;
1031
+ } & Omit<UploadProps, "onChange" | "fileList">;
1270
1032
  /**
1271
- * 对 查询条件+表格数据 进行深度封装,内置数据交互处理
1033
+ * 文件上传
1272
1034
  * ```
1273
- * 1. 废弃modelKey参数
1274
- * 2. 如果需要在路由跳转回退中缓存查询条件,设置cacheSwitch=true
1275
- * 3. 需要获取查询条件、主动发起请求等可通过ref、useEasyTable操作
1276
- * 4. 可通过属性 initRequest 设置初始化是否请求数据
1277
- * 5. 可通过属性 fieldNames 来设置自定义变量,默认值为:list、total、pageNo、pageSize
1278
- * 6. isFull=true,设置【在父节点高度下,上下铺满】(默认值:true)
1279
- * 7. filterFixed=true,设置查询条件固定,不随滚动条滚动
1280
- * 8. paginationFixed=true,可设置分页条件在底部固定,不随滚动条滚动
1281
- * 9. foldKeys=string[],查询条件展开、收起,被收起数组内容为EasyTable.Filter 子节点key值
1282
- * 10. windows环境下,会在EasyTable.Table外部包装一下 TableScrollbar,提示高windows下table左右滚动体验
1035
+ * 1. 可通过配置children替换默认上传触发布局
1036
+ * 2. 接口返回结构:
1037
+ * formData上传接口返回值
1038
+ * {
1039
+ * code: '0000',
1040
+ * data: {
1041
+ * uid: '唯一值,可使用fileKey值'
1042
+ * name: '文件名称'
1043
+ * url: '预览地址'
1044
+ * }
1045
+ * }
1046
+ * 3. 如果接口返回的不是上面的字段名称,可通过fieldNames配置接口返回字段名称映射
1283
1047
  *
1284
- * Demo https://fex.qa.tcshuke.com/docs/admin/main/crud/easy-table
1048
+ * 4. 最佳使用方式,与Form结合使用
1049
+ * <Form.Item name="attachmentList" label="附件">
1050
+ * <UploadWrapper action={uploadUrl} />
1051
+ * </Form.Item>
1285
1052
  * ```
1053
+ *
1286
1054
  */
1287
- export declare const EasyTable: import("react").ForwardRefExoticComponent<EasyTableProps & import("react").RefAttributes<EasyTableRefApi>> & {
1288
- /**
1289
- * 过滤条件
1290
- * @param props
1291
- * @returns
1292
- *
1293
- *```
1294
- *1. 用法1
1295
- * -- 默认网格布局 规则:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
1296
- * <EasyTable.Filter>
1297
- * <Form.Item name="field1" label="条件1">xxx</Form.Item>
1298
- * </EasyTable.Filter>
1299
- *
1300
- * -- 自定义网格布局 使用 FormCol组件包装 Form.Item
1301
- * <EasyTable.Filter>
1302
- * <FormCol span={12}><Form.Item name="field1" label="条件1">xxx</Form.Item></FormCol>
1303
- * </EasyTable.Filter>
1304
- *
1305
- * -- children 可为 function
1306
- * <EasyTable.Filter>
1307
- * {(form) => {
1308
- * return <Form.Item name="field1" label="条件1">xxx</Form.Item>
1309
- * }}
1310
- * </EasyTable.Filter>
1311
- *2. 用户2(自定义布局)
1312
- * EasyTable.Filter设置 isPure = true,FormItem无布局规则
1313
- *3. EasyTable.Filter中内置了 Form 标签,当children为函数时,可获取form实例
1314
- *4. 默认布局下,可通过设置 filterOperate 设置操作按钮
1315
- *5. Filter 子节点包含 hidden = true 会被忽略
1316
- *6. 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
1317
- *```
1318
- */
1319
- Filter: (props: EasyTableFilterProps) => import("react/jsx-runtime").JSX.Element;
1055
+ export declare const UploadWrapper: (props: UploadWrapperProps) => import("react/jsx-runtime").JSX.Element;
1056
+ export type EditableTableName = string | number | Array<string | number>;
1057
+ export type EditableTableRecordType = FormListFieldData & {
1058
+ operation: FormListOperation;
1059
+ };
1060
+ export type EditableInputConfig = {
1061
+ type: "input";
1062
+ editableComptProps?: InputProps;
1063
+ };
1064
+ export type EditableInputNumberConfig = {
1065
+ type: "inputNumber";
1066
+ editableComptProps?: InputNumberProps;
1067
+ };
1068
+ export type EditableSelectWrapperConfig = {
1069
+ type: "selectorWrapper";
1070
+ editableComptProps: SelectorWrapperProps;
1071
+ };
1072
+ export type EditableDatePickerWrapperConfig = {
1073
+ type: "datePickerWrapper";
1074
+ editableComptProps?: DatePickerWrapperProps;
1075
+ };
1076
+ export type EditableDateRangePickerWrapperConfig = {
1077
+ type: "dateRangePickerWrapper";
1078
+ editableComptProps?: DateRangePickerWrapperProps;
1079
+ };
1080
+ export type EditableCheckboxGroupConfig = {
1081
+ type: "checkboxGroup";
1082
+ editableComptProps: CheckboxGroupProps;
1083
+ };
1084
+ export type EditableRadioGroupConfig = {
1085
+ type: "radioGroup";
1086
+ editableComptProps: RadioGroupProps;
1087
+ };
1088
+ export type EditableTextareaConfig = {
1089
+ type: "textArea";
1090
+ editableComptProps: TextAreaProps;
1091
+ };
1092
+ export type EditableFileUploadConfig = {
1093
+ type: "uploadWrapper";
1094
+ editableComptProps: UploadWrapperProps;
1095
+ };
1096
+ export type EditableSwitchWrapperConfig = {
1097
+ type: "switchWrapper";
1098
+ editableComptProps: SwitchWrapperProps;
1099
+ };
1100
+ /**
1101
+ * 自定义编辑组件
1102
+ * ```
1103
+ * 1.需要处理Form.Item
1104
+ * 2. 例如
1105
+ * editableConfig: {
1106
+ type: 'custom',
1107
+ editableComptProps: (props) => {
1108
+ return (
1109
+ <Form.Item name={props.name}>
1110
+ <Input />
1111
+ </Form.Item>
1112
+ );
1113
+ },
1114
+ },
1115
+ ```
1116
+ */
1117
+ export type EditableCustomConfig = {
1118
+ type: "custom";
1119
+ editableComptProps: (props: {
1120
+ name: Array<number | string>;
1121
+ editable?: boolean;
1122
+ completeName: Array<number | string>;
1123
+ tableRowIndex: number;
1124
+ }) => ReactElement;
1125
+ };
1126
+ export type EditableTypeConfig = EditableCustomConfig | EditableInputConfig | EditableSelectWrapperConfig | EditableDatePickerWrapperConfig | EditableDateRangePickerWrapperConfig | EditableCheckboxGroupConfig | EditableTextareaConfig | EditableInputNumberConfig | EditableRadioGroupConfig | EditableFileUploadConfig | EditableSwitchWrapperConfig;
1127
+ export type FieldSingleConfig = {
1128
+ editable?: boolean | ((data: {
1129
+ tableRowIndex: number;
1130
+ }) => boolean);
1131
+ editableConfig?: EditableTypeConfig;
1320
1132
  /**
1321
- * 表格渲染
1322
- * @param props
1323
- * ```
1324
- * 1. 继承了 TableProps 可设置antd table功能
1325
- * 2. 分页功能已内置处理,不调用 onChange
1326
- * ```
1133
+ * 当editableConfig type=custom时,此配置无效
1327
1134
  */
1328
- Table: <T extends import("@flatbiz/utils").TPlainObject>(props: EasyTableTableProps<T>) => import("react/jsx-runtime").JSX.Element;
1135
+ formItemProps?: Omit<FormItemProps, "name">;
1329
1136
  /**
1330
- * @deprecated 已过时 4.3.0版本移除,请使用 useEasyTable
1137
+ * 自定义非编辑渲染
1138
+ * 1. 当editableConfig type=custom时,此配置无效
1139
+ * 2. 只在editable=false的情况下有效
1140
+ * 3. 同级配置 editableConfigList后,同级render配置失效
1141
+ * 4. checkboxGroup、radioGroup、selectorWrapper第二次参数为options数组
1331
1142
  */
1332
- useEasyTablRef: () => {
1333
- current: EasyTableRefApi;
1334
- };
1335
- /** 在 EasyTable子组件内才可使用 */
1336
- useEasyTable: () => EasyTableRefApi;
1143
+ render?: (params?: TAny, other?: TAny) => ReactNode;
1144
+ };
1145
+ export type FormListItemMethodOperateProps = {
1146
+ tableRowIndex: number;
1147
+ add: FormListOperation["add"];
1148
+ remove: () => void;
1149
+ formListItemIndex: number;
1150
+ value: TAny;
1151
+ };
1152
+ export type FormListMethodOperateProps = {
1153
+ tableRowIndex: number;
1154
+ add: FormListOperation["add"];
1155
+ value: TAny;
1156
+ };
1157
+ export type FormListConfig = {
1158
+ editableConfigList: Array<FieldSingleConfig & {
1159
+ fieldName: string;
1160
+ }>;
1161
+ onFormListBeforeRender?: (data: FormListMethodOperateProps) => ReactElement | null;
1162
+ onFormListAfterRender?: (data: FormListMethodOperateProps) => ReactElement | null;
1163
+ onFormListItemBeforeRender?: (data: FormListItemMethodOperateProps) => ReactElement | null;
1164
+ onFormListItemAfterRender?: (data: FormListItemMethodOperateProps) => ReactElement | null;
1165
+ deleteOperateRender?: (data: {
1166
+ remove: () => void;
1167
+ formListItemIndex: number;
1168
+ }) => ReactElement;
1169
+ };
1170
+ export type fieldConfigFunctionParams = {
1171
+ tableRowIndex: number;
1172
+ name: EditableTableName;
1173
+ tableRowName: EditableTableName;
1174
+ getTableRowData: () => TPlainObject;
1337
1175
  };
1338
- export interface EditableFieldProps {
1339
- className?: string;
1340
- style?: CSSProperties;
1341
- editRender: ReactElement | ((data: {
1342
- value?: TAny;
1343
- onChange?: (data?: TAny) => void;
1344
- }) => ReactElement);
1345
- viewRender?: (value?: TAny) => ReactNode;
1346
- value?: TAny;
1347
- onChange?: (data?: TAny) => void;
1348
- placeholderValue?: string;
1349
- /** edit 区域是否铺满,showEditableIcon=false 无效 */
1350
- isEditFull?: boolean;
1351
- /** 是否可编辑 */
1352
- editable?: boolean;
1353
- /** 是否显示编辑、确认、取消操作icon,默认值:true */
1354
- showEditableIcon?: boolean;
1355
- /** 点击编辑按钮,操作前,返回reject不会开启编辑效果 */
1356
- onClickEditIconPre?: (value?: TAny) => Promise<void>;
1357
- onEditCallback?: (value?: TAny) => void;
1358
- /** 点击确定按钮,操作前,返回reject不会执行确定功能 */
1359
- onClickConfirmIconPre?: (value?: TAny, preValue?: TAny) => Promise<void>;
1360
- onConfirmCallback?: (value?: TAny, preValue?: TAny) => void;
1361
- /** 组件操作Icon配置 */
1362
- iconConfig?: {
1363
- editIcon?: (options: {
1364
- onClick: () => void;
1365
- }) => ReactElement;
1366
- confirmIcon?: (options: {
1367
- onClick: () => void;
1368
- }) => ReactElement;
1369
- cancelIcon?: (options: {
1370
- onClick: () => void;
1371
- }) => ReactElement;
1372
- };
1373
- }
1374
- /**
1375
- * 可编辑字段组件
1376
- * @param props
1377
- * @returns
1378
- * ```
1379
- * 字段渲染有两种状态
1380
- * 1. 只读:如果value类型为复杂格式,必须要通过【viewRender】来进行处理操作,转成简单数据类型
1381
- * 2. 编辑:参数value的格式要求必须满足编辑组件入参value要求
1382
- * 3. 可自定义编辑Icon、确定Icon、取消Icon
1383
- * 4. 可拦截编辑操作、确定操作
1384
- * ```
1385
- */
1386
- export declare const EditableField: (props: EditableFieldProps) => any;
1387
- export interface EditableFieldProviderProps {
1388
- children: ReactElement;
1389
- editable?: boolean;
1390
- showEditableIcon?: boolean;
1391
- }
1392
1176
  /**
1393
- * EditableFieldProvider 控制内部使有的 EditableField 状态
1394
- * @param props
1395
- * @returns
1177
+ * antd 默认render功能此处不能使用
1396
1178
  */
1397
- export declare const EditableFieldProvider: (props: EditableFieldProviderProps) => import("react/jsx-runtime").JSX.Element;
1398
- export type SelectorWrapperValue = string | number | Array<string | number> | TPlainObject<string | number> | Array<TPlainObject<string | number>>;
1399
- export type SelectorServiceConfig = {
1400
- params?: TPlainObject;
1401
- /** 与 params 配合使用 */
1402
- requiredParamsKeys?: string[];
1403
- onRequest?: (params?: TAny) => Promise<TAny>;
1179
+ export type EditableTableColumn = Omit<ColumnsType["0"], "render"> & {
1404
1180
  /**
1405
- * 响应数据适配器
1181
+ * @description 请使用 tipsWrapperProps 属性配置
1182
+ * ```
1183
+ * 会在 title 之后展示一个 icon,hover 之后提示一些信息
1184
+ * 1. title为string类型、ReactElement有效
1185
+ * 2. hoverArea 默认值:icon
1186
+ * ```
1406
1187
  */
1407
- onRequestResultAdapter?: (respData: TAny) => TPlainObject[];
1408
- };
1409
- export type SelectorWrapperProps = Omit<SelectProps, "onSearch" | "notFoundContent" | "options" | "fieldNames" | "onChange" | "value" | "loading" | "mode"> & {
1410
- /** 不支持 tags 模式,tags模式请使用 SelectorWrapperSimple 组件 */
1411
- mode?: "multiple";
1412
- /** key值,相同的key 同页面可共用缓存数据 */
1413
- modelKey: string;
1188
+ tooltip?: string | {
1189
+ content: string;
1190
+ icon?: ReactElement;
1191
+ hoverArea?: "icon" | "all";
1192
+ };
1414
1193
  /**
1415
- * 参数Key映射
1194
+ * 会在 title 之后展示一个 icon
1416
1195
  * ```
1417
- * 1. 默认值:value=value、label=label、disabled=disabled
1418
- * 2. list 为 onRequest 返回数据中列表key值,可多级取值,例如: 'a.b.c'
1419
- * 3. 配置 serviceConfig.onRequestResultAdapter后,fieldNames.list配置失效
1420
- * 4. 如果没有配置list,可说明接口返回为数组
1196
+ * 1. title为string类型有效
1197
+ * 2. 可为icon添加提示效果
1198
+ * 3. 可为icon添加点击事件
1421
1199
  * ```
1422
1200
  */
1423
- fieldNames?: {
1424
- list?: string;
1425
- label?: string;
1426
- value?: string;
1427
- disabled?: string;
1201
+ tipsWrapperProps?: string | TipsWrapperProps;
1202
+ dataIndex?: string;
1203
+ fieldConfig?: FieldSingleConfig | FormListConfig | ((data: fieldConfigFunctionParams) => FieldSingleConfig | FormListConfig);
1204
+ /** 隐藏域字段 */
1205
+ hiddenField?: {
1206
+ dataIndex: string;
1428
1207
  };
1429
1208
  /**
1430
- * 请求服务需求的数据
1209
+ * 渲染中间件,如果renderMiddleware返回值为ReactElement格式,则会终止后续逻辑,fieldConfig配置将失效
1210
+ * ```
1211
+ * 1. tableRowIndex: 当前row的索引值
1212
+ * 2. name: 当前table单元格的form.item的name值
1213
+ * 3. operation Form.List的操作函数
1214
+ * 4. 对 table children column渲染无效
1215
+ * ```
1431
1216
  */
1432
- serviceConfig?: SelectorServiceConfig;
1217
+ renderMiddleware?: (item: {
1218
+ tableRowIndex: number;
1219
+ name: EditableTableName;
1220
+ tableRowName: EditableTableName;
1221
+ operation: FormListOperation;
1222
+ index: number;
1223
+ }) => ReactElement | null;
1224
+ /** table datasource children column 自定义渲染 */
1225
+ tableChildrenColumnRender?: (value: TAny, record: TPlainObject, index: number) => ReactElement | null;
1226
+ };
1227
+ export type EditableTableProps = {
1228
+ name: EditableTableName;
1433
1229
  /**
1434
- * 同步设置选择器选项列表
1435
1230
  * ```
1436
- * 1. 如果配置fieldNames,会转换后使用
1437
- * 2. 值为undefined、null不会更新,需要清空可传递空数组
1231
+ * antd table属性
1232
+ * 1. 新增cellVerticalAlign,单元格竖直方向对齐方式,设置table column onCell属性后失效
1438
1233
  * ```
1439
1234
  */
1440
- selectorList?: TPlainObject[];
1235
+ tableProps?: Omit<TableProps<EditableTableRecordType>, "dataSource" | "columns" | "rowKey"> & {
1236
+ cellVerticalAlign?: "baseline" | "middle" | "top" | "bottom";
1237
+ };
1238
+ columns: EditableTableColumn[];
1239
+ onTableBeforeRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
1441
1240
  /**
1442
- * select 数据源发生变更时触发,第一次不调用
1241
+ * 设置后,将覆盖底部`新增`按钮
1443
1242
  */
1444
- onSelectorListChange?: (dataList: TPlainObject[]) => void;
1445
- /** select 数据源发生变更时触发,每次都会调用 */
1446
- onSelectorListAllChange?: (dataList: TPlainObject[]) => void;
1243
+ onTableAfterRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
1244
+ rules?: FormListProps["rules"];
1245
+ /** 隐藏底部`新增`按钮,设置 onTableAfterRender后 失效 */
1246
+ hiddenFooterBtn?: boolean;
1247
+ /** 新增行默认值,自定义onTableAfterRender后失效 */
1248
+ getAddRowDefaultValues?: () => TPlainObject;
1249
+ };
1250
+ export type EditableTableRefApi = {
1251
+ /** 可用于表格行选择操作时,获取操作列数据 */
1252
+ getTableItemDataByFormListItemKey: (key: number) => TPlainObject;
1253
+ };
1254
+ /**
1255
+ * 可编辑表格
1256
+ * demo:https://fex.qa.tcshuke.com/docs/admin/main/table/row-editable1
1257
+ * @param props
1258
+ * ```
1259
+ * 1. 通过 tableProps 设置Table属性,table size默认:small
1260
+ * 2. Table children column 不可编辑
1261
+ * 3. 当存在折叠children数据时,组件会在children中内置_isChildrenItem字段
1262
+ * 4. 可通过tableChildrenColumnRender自定义渲染 table children column 显示
1263
+ * 5. 设置 rowSelection 后,rowSelection.onChange 通过 ref 的 getTableItemDataByFormListItemKey获取数据
1264
+ * ```
1265
+ */
1266
+ export declare const EditableTable: import("react").ForwardRefExoticComponent<EditableTableProps & import("react").RefAttributes<EditableTableRefApi>>;
1267
+ export type DragEditableTableProps = EditableTableProps & {
1447
1268
  /**
1448
- * 通过服务获取数据异常回调
1269
+ * 拖拽图标自定义,默认使用 DragOutlined 图标
1449
1270
  */
1450
- onSelectorRequestError?: (error: Error) => void;
1271
+ dragIcon?: ReactElement;
1272
+ /** 禁用拖拽 */
1273
+ disabledDrag?: boolean;
1451
1274
  /**
1452
- * 添加全部选项
1275
+ * 表格数据唯一值字段Key
1453
1276
  * ```
1454
- * 1. 默认值label="全部",value=""
1455
- * 2. 可配置label、value
1456
1277
  * ```
1457
1278
  */
1458
- showAllOption?: true | {
1459
- label: string;
1460
- value: string | number;
1461
- };
1462
- onLabelRenderAdapter?: (dataItem: TPlainObject) => string | ReactElement;
1463
- onChange?: (value?: SelectorWrapperValue, selectedList?: TPlainObject[] | TPlainObject) => void;
1464
- showIcon?: boolean;
1465
- /** select option添加图标;与showIcon组合使用 */
1466
- icon?: (data: TPlainObject, index: number) => ReactElement;
1467
- requestMessageConfig?: TRequestStatusProps["messageConfig"];
1468
- /**
1469
- * value格式
1470
- *```
1471
- * 1. string 、number
1472
- * 2. Array<string | number>
1473
- * 3. lableInValue = true,根据fieldNames配置格式
1474
- * 4. lableInValue = true,Array<fieldNames配置>
1475
- * ```
1476
- */
1477
- value?: SelectorWrapperValue;
1279
+ uidFieldKey: string;
1478
1280
  /**
1479
- * 使用缓存,默认值:true
1281
+ * 拖拽结束事件
1480
1282
  * ```
1481
- * 1. true: 在 modelKey下使用请求参数缓存数据,如果相同modelKey、相同请求参数直接使用缓存数据
1482
- * 2. false: 每次都调用接口,不参与缓存数据、不使用缓存数据
1483
- * 3. useCache=false 在 serviceConfig.requiredParamsKeys.length > 0 有效
1283
+ * dataSource: 拖拽完成后的数据源
1284
+ * dragData
1285
+ * 1. activeId 拖拽ID
1286
+ * 2. activeIndex 拖拽起始表格数组索引值
1287
+ * 3. overIndex 拖拽结束表格数组索引值
1484
1288
  * ```
1485
1289
  */
1486
- useCache?: boolean;
1487
- };
1488
- /**
1489
- * 选择器包装组件
1490
- * ```
1491
- * 1. 不支持搜索 + 调用服务模式
1492
- * ```
1493
- */
1494
- export declare const SelectorWrapper: (props: SelectorWrapperProps) => import("react/jsx-runtime").JSX.Element;
1495
- export type SwitchWrapperValue = string | number | boolean;
1496
- export type SwitchWrapperProps = Omit<SwitchProps, "checked" | "defaultChecked" | "onChange"> & {
1497
- value?: SwitchWrapperValue;
1498
- checkedValue: SwitchWrapperValue;
1499
- unCheckedValue: SwitchWrapperValue;
1500
- onChange?: (value: SwitchWrapperValue) => void;
1501
- tooltipProps?: Omit<TooltipProps, "title">;
1502
- tooltipTitle?: string | ((value?: SwitchWrapperValue) => string | undefined);
1503
- serviceConfig?: {
1504
- onRequest: (value: SwitchWrapperValue) => TAny;
1505
- message?: {
1506
- success?: string;
1507
- defaultError?: string;
1508
- };
1509
- };
1290
+ onDragChange?: (dataSource: TPlainObject[], dragData: {
1291
+ activeId: string | number;
1292
+ activeIndex: number;
1293
+ overIndex: number;
1294
+ }) => void;
1510
1295
  };
1511
1296
  /**
1512
- * 解决Switch只能接收boolean的限制,与Form.Item结合使用最佳
1297
+ * 可拖拽编辑表格
1513
1298
  * ```
1514
- * 1. value 为状态值,不局限于boolean,可以为 [string | number | boolean]
1515
- * 2. checkedValue 选中值
1516
- * 3. unCheckedValue 未选中值
1517
- * 4. 与 Form.Item 结合使用,不再需要配置 valuePropName
1518
- * <Form.Item name="fieldName">
1519
- * <SwitchWrapper checkedValue={2} unCheckedValue={1} />
1520
- * </Form.Item>
1521
- * 5. 可设置tooltip效果数据显示
1522
- * 6. 可设置 serviceConfig 配置服务调用交互
1299
+ * 1. 表格数据必须要有唯一值字段,通过参数 uidFieldKey 告诉组件
1300
+ * 2. Table 参数 components.body.row 被组件内部使用
1523
1301
  * ```
1524
1302
  */
1525
- export declare const SwitchWrapper: (props: SwitchWrapperProps) => import("react/jsx-runtime").JSX.Element;
1526
- export type UploadWrapperFileItem = {
1527
- uid: string;
1528
- name: string;
1529
- url?: string;
1530
- };
1531
- export type UploadWrapperProps<T extends TPlainObject = TPlainObject> = {
1532
- value?: T[] | T;
1533
- onChange?: (value?: T[]) => void;
1534
- onUploadError?: (message?: string) => void;
1535
- onUploadChange?: (info: UploadChangeParam<UploadFile>) => void;
1303
+ export declare const DragEditableTable: import("react").ForwardRefExoticComponent<EditableTableProps & {
1304
+ /**
1305
+ * 拖拽图标自定义,默认使用 DragOutlined 图标
1306
+ */
1307
+ dragIcon?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
1308
+ /** 禁用拖拽 */
1309
+ disabledDrag?: boolean | undefined;
1310
+ /**
1311
+ * 表格数据唯一值字段Key
1312
+ * ```
1313
+ * ```
1314
+ */
1315
+ uidFieldKey: string;
1316
+ /**
1317
+ * 拖拽结束事件
1318
+ * ```
1319
+ * dataSource: 拖拽完成后的数据源
1320
+ * dragData
1321
+ * 1. activeId 拖拽ID
1322
+ * 2. activeIndex 拖拽起始表格数组索引值
1323
+ * 3. overIndex 拖拽结束表格数组索引值
1324
+ * ```
1325
+ */
1326
+ onDragChange?: ((dataSource: TPlainObject[], dragData: {
1327
+ activeId: string | number;
1328
+ activeIndex: number;
1329
+ overIndex: number;
1330
+ }) => void) | undefined;
1331
+ } & import("react").RefAttributes<EditableTableRefApi>>;
1332
+ export type DragFormListContentProps = {
1333
+ /** Form.List item fieldData */
1334
+ formListFieldData: FormListFieldData;
1536
1335
  /**
1537
- * 属性映射
1336
+ * 当前阶段 完整 formItem name
1337
+ * ```
1338
+ * 1. 获取当前输入项Item数据
1339
+ * form.getFieldValue(props.formStageCompleteName);
1340
+ * 2. 获取当前输入项Item指定字段数据
1341
+ * form.getFieldValue([...props.formStageCompleteName, 'key']);
1342
+ * ```
1538
1343
  */
1539
- fieldNames?: {
1540
- uid: string;
1541
- name?: string;
1542
- url?: string;
1543
- };
1344
+ formStageCompleteName: (string | number)[];
1544
1345
  /**
1545
- * 接口响应数据适配器,如果配置了fieldNames,适配器返回值会再进过fieldNames转换
1346
+ * formList上一级 formItem完整name
1546
1347
  */
1547
- onRequestResultAdapter?: (respData: TAny) => TPlainObject;
1548
- /** 操作触发显示文本 */
1549
- triggerText?: string;
1550
- /** 超过maxCount 隐藏上传入口 */
1551
- limitHidden?: boolean;
1552
- } & Omit<UploadProps, "onChange" | "fileList">;
1553
- /**
1554
- * 文件上传
1555
- * ```
1556
- * 1. 可通过配置children替换默认上传触发布局
1557
- * 2. 接口返回结构:
1558
- * formData上传接口返回值
1559
- * {
1560
- * code: '0000',
1561
- * data: {
1562
- * uid: '唯一值,可使用fileKey值'
1563
- * name: '文件名称'
1564
- * url: '预览地址'
1565
- * }
1566
- * }
1567
- * 3. 如果接口返回的不是上面的字段名称,可通过fieldNames配置接口返回字段名称映射
1568
- *
1569
- * 4. 最佳使用方式,与Form结合使用
1570
- * <Form.Item name="attachmentList" label="附件">
1571
- * <UploadWrapper action={uploadUrl} />
1572
- * </Form.Item>
1573
- * ```
1574
- *
1575
- */
1576
- export declare const UploadWrapper: (props: UploadWrapperProps) => import("react/jsx-runtime").JSX.Element;
1577
- export type EditableTableName = string | number | Array<string | number>;
1578
- export type EditableTableRecordType = FormListFieldData & {
1348
+ prevCompleteName: (string | number)[];
1349
+ /** Form.List 操作项 */
1579
1350
  operation: FormListOperation;
1351
+ /** 索引 */
1352
+ index: number;
1353
+ /** 获取当前FormList 内部 Form.Item name */
1354
+ getInsideFormItemName: (key: string) => Array<string | number>;
1355
+ /** 获取当前 FormList Item 数据 */
1356
+ getInsideFormItemData: () => TPlainObject;
1357
+ /** 唯一值字段Key */
1358
+ uidKey: string;
1580
1359
  };
1581
- export type EditableInputConfig = {
1582
- type: "input";
1583
- editableComptProps?: InputProps;
1584
- };
1585
- export type EditableInputNumberConfig = {
1586
- type: "inputNumber";
1587
- editableComptProps?: InputNumberProps;
1588
- };
1589
- export type EditableSelectWrapperConfig = {
1590
- type: "selectorWrapper";
1591
- editableComptProps: SelectorWrapperProps;
1592
- };
1593
- export type EditableDatePickerWrapperConfig = {
1594
- type: "datePickerWrapper";
1595
- editableComptProps?: DatePickerWrapperProps;
1596
- };
1597
- export type EditableDateRangePickerWrapperConfig = {
1598
- type: "dateRangePickerWrapper";
1599
- editableComptProps?: DateRangePickerWrapperProps;
1600
- };
1601
- export type EditableCheckboxGroupConfig = {
1602
- type: "checkboxGroup";
1603
- editableComptProps: CheckboxGroupProps;
1604
- };
1605
- export type EditableRadioGroupConfig = {
1606
- type: "radioGroup";
1607
- editableComptProps: RadioGroupProps;
1608
- };
1609
- export type EditableTextareaConfig = {
1610
- type: "textArea";
1611
- editableComptProps: TextAreaProps;
1612
- };
1613
- export type EditableFileUploadConfig = {
1614
- type: "uploadWrapper";
1615
- editableComptProps: UploadWrapperProps;
1616
- };
1617
- export type EditableSwitchWrapperConfig = {
1618
- type: "switchWrapper";
1619
- editableComptProps: SwitchWrapperProps;
1360
+ export type DragFormListProps = {
1361
+ className?: string;
1362
+ style?: CSSProperties;
1363
+ itemStyle?: CSSProperties;
1364
+ /** formList item 数据中的唯一值,默认值:uid */
1365
+ uidFieldName?: string;
1366
+ /** formList name */
1367
+ name: string | number | (string | number)[];
1368
+ /**
1369
+ * formList上一级 formItem完整name
1370
+ * ```
1371
+ * 1. 如果没有传 []
1372
+ * 2. FormList内部通过 Form.useWatch 取值需要完整 name
1373
+ * ```
1374
+ */
1375
+ prevCompleteName: (string | number)[];
1376
+ /** 拖拽回调 */
1377
+ onDropChange?: (items: TPlainObject[]) => void;
1378
+ /** 设置拖拽图标 */
1379
+ dragIcon?: ReactElement;
1380
+ /** 禁用拖拽,拖拽图标隐藏 */
1381
+ dragDisabled?: boolean;
1382
+ /** 设置item禁止拖拽 */
1383
+ getItemDragDisabled?: (uid: string | number, index: number) => boolean;
1384
+ /** 新增行默认值,自定义onTableAfterRender后失效 */
1385
+ getAddRowDefaultValues?: () => TPlainObject;
1386
+ /** 隐藏新增行按钮 */
1387
+ hiddenAddRowButton?: boolean;
1388
+ /** 自定义新增行按钮,getAddRowDefaultValues配置失效 */
1389
+ onCustomAddRowButton?: (operation: FormListOperation) => ReactElement;
1390
+ /** formListItem 内容 */
1391
+ children: (data: DragFormListContentProps) => ReactElement;
1392
+ /** 隐藏数据为空渲染 */
1393
+ hiddenEmptyRender?: boolean;
1394
+ /** formList内部渲染包装,多用于FormListWrapper嵌套布局 */
1395
+ formListChildrenWrapper?: (props: {
1396
+ children: ReactElement;
1397
+ }) => ReactElement;
1398
+ rules?: FormListProps["rules"];
1620
1399
  };
1621
1400
  /**
1622
- * 自定义编辑组件
1401
+ * 可拖拽FormList
1402
+ * ```
1403
+ * 1. FormList数组中必须要有唯一值字段,默认值字段名称uid,可通过uidFieldName自定义设置
1404
+ * 2. Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list
1623
1405
  * ```
1624
- * 1.需要处理Form.Item
1625
- * 2. 例如
1626
- * editableConfig: {
1627
- type: 'custom',
1628
- editableComptProps: (props) => {
1629
- return (
1630
- <Form.Item name={props.name}>
1631
- <Input />
1632
- </Form.Item>
1633
- );
1634
- },
1635
- },
1636
- ```
1637
1406
  */
1638
- export type EditableCustomConfig = {
1639
- type: "custom";
1640
- editableComptProps: (props: {
1641
- name: Array<number | string>;
1642
- editable?: boolean;
1643
- completeName: Array<number | string>;
1644
- tableRowIndex: number;
1645
- }) => ReactElement;
1646
- };
1647
- export type EditableTypeConfig = EditableCustomConfig | EditableInputConfig | EditableSelectWrapperConfig | EditableDatePickerWrapperConfig | EditableDateRangePickerWrapperConfig | EditableCheckboxGroupConfig | EditableTextareaConfig | EditableInputNumberConfig | EditableRadioGroupConfig | EditableFileUploadConfig | EditableSwitchWrapperConfig;
1648
- export type FieldSingleConfig = {
1649
- editable?: boolean | ((data: {
1650
- tableRowIndex: number;
1651
- }) => boolean);
1652
- editableConfig?: EditableTypeConfig;
1407
+ export declare const DragFormList: (props: DragFormListProps) => import("react/jsx-runtime").JSX.Element;
1408
+ export type DragTableProps = Omit<TableProps<TPlainObject>, "dataSource"> & {
1653
1409
  /**
1654
- * 当editableConfig type=custom时,此配置无效
1410
+ * ```
1411
+ * 1. 可自定义拖拽图标
1412
+ * 2. dragIcon = false,可设置表格行拖拽
1413
+ * ```
1655
1414
  */
1656
- formItemProps?: Omit<FormItemProps, "name">;
1415
+ dragIcon?: false | ReactElement;
1416
+ /** 表格数据唯一值字段Key,未填或者无法唯一,都不能拖拽能力 */
1417
+ uidFieldKey: string;
1418
+ dataSource?: TPlainObject[];
1419
+ /** 禁用拖拽 */
1420
+ disabledDrag?: boolean;
1657
1421
  /**
1658
- * 自定义非编辑渲染
1659
- * 1. 当editableConfig type=custom时,此配置无效
1660
- * 2. 只在editable=false的情况下有效
1661
- * 3. 同级配置 editableConfigList后,同级render配置失效
1662
- * 4. checkboxGroup、radioGroup、selectorWrapper第二次参数为options数组
1422
+ * 拖拽结束事件
1423
+ * ```
1424
+ * dataSource: 拖拽完成后的数据源
1425
+ * dragData
1426
+ * 1. activeId 拖拽ID
1427
+ * 2. activeIndex 拖拽起始表格数组索引值
1428
+ * 3. overIndex 拖拽结束表格数组索引值
1429
+ * ```
1663
1430
  */
1664
- render?: (params?: TAny, other?: TAny) => ReactNode;
1665
- };
1666
- export type FormListItemMethodOperateProps = {
1667
- tableRowIndex: number;
1668
- add: FormListOperation["add"];
1669
- remove: () => void;
1670
- formListItemIndex: number;
1671
- value: TAny;
1672
- };
1673
- export type FormListMethodOperateProps = {
1674
- tableRowIndex: number;
1675
- add: FormListOperation["add"];
1676
- value: TAny;
1431
+ onDragChange?: (dataSource: TPlainObject[], dragData: {
1432
+ activeId: string | number;
1433
+ activeIndex: number;
1434
+ overIndex: number;
1435
+ }) => void;
1677
1436
  };
1678
- export type FormListConfig = {
1679
- editableConfigList: Array<FieldSingleConfig & {
1680
- fieldName: string;
1681
- }>;
1682
- onFormListBeforeRender?: (data: FormListMethodOperateProps) => ReactElement | null;
1683
- onFormListAfterRender?: (data: FormListMethodOperateProps) => ReactElement | null;
1684
- onFormListItemBeforeRender?: (data: FormListItemMethodOperateProps) => ReactElement | null;
1685
- onFormListItemAfterRender?: (data: FormListItemMethodOperateProps) => ReactElement | null;
1686
- deleteOperateRender?: (data: {
1687
- remove: () => void;
1688
- formListItemIndex: number;
1689
- }) => ReactElement;
1437
+ /**
1438
+ * 可拖拽表格
1439
+ * ```
1440
+ * 1. 必须设置唯一值字段 uidFieldKey
1441
+ * 2. 如果拖拽显示异常,请检查 uidFieldKey 是否正确
1442
+ * 3. Table 参数 components.body.row 被组件内部使用
1443
+ * ```
1444
+ */
1445
+ export declare const DragTable: (props: DragTableProps) => import("react/jsx-runtime").JSX.Element;
1446
+ export interface DrawerOperationProps {
1447
+ loading?: boolean;
1448
+ okText?: string;
1449
+ cancelText?: string;
1450
+ onOk?: () => void;
1451
+ onCancel?: () => void;
1452
+ hideOkBtn?: boolean;
1453
+ okButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
1454
+ cancelButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
1455
+ }
1456
+ export type DrawerWrapperStaticMethods = {
1457
+ Content: typeof DrawerWrapperContent;
1458
+ Footer: typeof DrawerWrapperFooter;
1690
1459
  };
1691
- export type fieldConfigFunctionParams = {
1692
- tableRowIndex: number;
1693
- name: EditableTableName;
1694
- tableRowName: EditableTableName;
1695
- getTableRowData: () => TPlainObject;
1460
+ export type DrawerWrapperProps = {
1461
+ className?: string;
1462
+ /**
1463
+ * 整个drawer页面级的spinning <Page loading />
1464
+ */
1465
+ pageLoading?: boolean;
1466
+ } & Omit<DrawerProps, "footer">;
1467
+ declare const DrawerWrapperContent: (props: {
1468
+ operationProps?: DrawerOperationProps;
1469
+ children?: ReactNode;
1470
+ }) => import("react/jsx-runtime").JSX.Element;
1471
+ declare const DrawerWrapperFooter: (props: any) => import("react/jsx-runtime").JSX.Element;
1472
+ /**
1473
+ * 弹窗机制
1474
+ * @deprecated 已过时 4.3.0版本移除;请使用 const { appDialogModal } = FbaApp.useDialogModal();
1475
+ * ```
1476
+ * 1. 默认 destroyOnClose = true
1477
+ * 2. 默认 forceRender = false
1478
+ * 3. 如果设置 forceRender = true,会导致弹框中的接口提前调用
1479
+ *
1480
+ * 注意
1481
+ * 1. <Drawer /> 默认关闭后状态不会自动清空, 如果希望每次打开都是新内容,请设置 destroyOnClose。
1482
+ * 2. <Drawer /> 和 Form 一起配合使用时,设置 destroyOnClose 也不会在 Drawer 关闭时销毁表单字段数据,需要设置 <Form preserve={false} />。
1483
+ *
1484
+ * ```
1485
+ */
1486
+ export declare const DrawerWrapper: FC<DrawerWrapperProps> & DrawerWrapperStaticMethods;
1487
+ export type TDynamicNodeProps = {
1488
+ className?: string;
1489
+ getContainer?: HTMLElement | (() => HTMLElement) | string;
1490
+ content?: ReactElement;
1491
+ fixed?: boolean;
1492
+ style?: CSSProperties;
1696
1493
  };
1697
1494
  /**
1698
- * antd 默认render功能此处不能使用
1495
+ * 动态添加 element 元素
1496
+ * ```
1497
+ * 1. 默认添加到 body 下
1498
+ * 2. 可通过 getContainer 参数设置添加位置
1499
+ * ```
1699
1500
  */
1700
- export type EditableTableColumn = Omit<ColumnsType["0"], "render"> & {
1501
+ export declare const dynamicNode: {
1502
+ append: (props?: TDynamicNodeProps) => {
1503
+ elementId: string;
1504
+ };
1505
+ remove: (elementId?: string) => void;
1506
+ };
1507
+ export type TEasyTableTableColumn<T> = ColumnsType<T>[0] & {
1701
1508
  /**
1702
1509
  * @description 请使用 tipsWrapperProps 属性配置
1703
1510
  * ```
1704
1511
  * 会在 title 之后展示一个 icon,hover 之后提示一些信息
1705
- * 1. title为string类型、ReactElement有效
1512
+ * 1. title为string类型有效
1706
1513
  * 2. hoverArea 默认值:icon
1707
1514
  * ```
1708
1515
  */
@@ -1711,6 +1518,7 @@ export type EditableTableColumn = Omit<ColumnsType["0"], "render"> & {
1711
1518
  icon?: ReactElement;
1712
1519
  hoverArea?: "icon" | "all";
1713
1520
  };
1521
+ dataIndex?: keyof T | (string & {});
1714
1522
  /**
1715
1523
  * 会在 title 之后展示一个 icon
1716
1524
  * ```
@@ -1720,71 +1528,351 @@ export type EditableTableColumn = Omit<ColumnsType["0"], "render"> & {
1720
1528
  * ```
1721
1529
  */
1722
1530
  tipsWrapperProps?: string | TipsWrapperProps;
1723
- dataIndex?: string;
1724
- fieldConfig?: FieldSingleConfig | FormListConfig | ((data: fieldConfigFunctionParams) => FieldSingleConfig | FormListConfig);
1725
- /** 隐藏域字段 */
1726
- hiddenField?: {
1727
- dataIndex: string;
1531
+ };
1532
+ export type EasyTableRefApi = {
1533
+ /** 外部发起请求服务 */
1534
+ onRequest: (params?: TPlainObject) => void;
1535
+ /** 获取请求参数 */
1536
+ getRequestParams: () => TPlainObject;
1537
+ /** 清楚查询条件 */
1538
+ clearQueryCondition: (values?: TPlainObject) => Promise<void>;
1539
+ form: FormInstance;
1540
+ /** 重置请求 */
1541
+ onResetRequest: (params?: TPlainObject) => void;
1542
+ /** 接口数据源 */
1543
+ getDataSource: () => TAny;
1544
+ /** 过滤表格数据源,不会触发 onDataSourceChange 函数 */
1545
+ onFilterDataSource: (dataSource: TPlainObject[]) => void;
1546
+ /** 清空表格数据 */
1547
+ onClearDataSource: () => void;
1548
+ /** 修改表格数据源,会触发onDataSourceChange函数 */
1549
+ onUpdateDataSource: (dataList: TPlainObject[]) => void;
1550
+ };
1551
+ export type EasyTableServiceConfig = {
1552
+ /** 接口配置 */
1553
+ onRequest: (params?: TPlainObject) => Promise<TPlainObject | TPlainObject[]>;
1554
+ /** 请求参数处理 */
1555
+ requestParamsAdapter?: (params: TPlainObject) => TPlainObject;
1556
+ /**
1557
+ * 接口相应数据处理
1558
+ * @param params
1559
+ * ```
1560
+ * 返回数据为对象,包含两个字段
1561
+ * 1. 表格列表数据 - Array
1562
+ * 2. 表格条数总数 - Number
1563
+ * 其中 字段key 命名会通过 fieldNames 进行转义
1564
+ * 例如:
1565
+ * fieldNames={{
1566
+ * list: 'aList',
1567
+ * total: 'aTotal',
1568
+ * }}
1569
+ * serviceConfig={{
1570
+ * url: '/v1/board/list',
1571
+ * requestResultAdapter: (respData) => {
1572
+ * return {
1573
+ * aList: respData.data.rows,
1574
+ * aTotal: respData.page.total,
1575
+ * };
1576
+ * },
1577
+ * }}
1578
+ * ```
1579
+ */
1580
+ requestResultAdapter?: (params: TAny) => TPlainObject;
1581
+ /**
1582
+ * 动态列自定义渲染
1583
+ * ```
1584
+ * 1. respData: 接口返回数据
1585
+ * 2. columns: Table columns配置项
1586
+ * ```
1587
+ *
1588
+ */
1589
+ dynamicColumsAdapter?: (respData?: TAny, columns?: TEasyTableTableColumn<TPlainObject>[]) => TEasyTableTableColumn<TPlainObject>[] | undefined;
1590
+ };
1591
+ export type EasyTableProps = {
1592
+ className?: string;
1593
+ style?: CSSProperties;
1594
+ children: ReactElement | ReactElement[] | ((dataSource?: TAny) => ReactElement);
1595
+ /**
1596
+ * EasyTable唯一值,可用于缓存查询条件
1597
+ * @deprecated 已过时,如果需要缓存数据请设置 cacheSwitch 参数
1598
+ */
1599
+ modelKey?: string;
1600
+ /**
1601
+ * 缓存查询条件开关,默认false
1602
+ * ```
1603
+ * 是否缓存表格查询条件,在路由跳转回来时,不会丢失
1604
+ * ```
1605
+ */
1606
+ cacheSwitch?: boolean;
1607
+ /** 接口数据配置 */
1608
+ serviceConfig: EasyTableServiceConfig;
1609
+ /**
1610
+ * 1. 查询条件Form initialValues
1611
+ * 2. 接口其他参数,例如常量类型
1612
+ */
1613
+ initialValues?: TPlainObject;
1614
+ /**
1615
+ * 分页初始化参数,默认值: pageSize = 10
1616
+ * @deprecated 已过时 4.3.0版本移除,使用 pageSize 赋值
1617
+ */
1618
+ initialPaginationParams?: {
1619
+ pageSize?: number;
1728
1620
  };
1621
+ /** 分页单页条数,默认值:10 */
1622
+ pageSize?: number;
1729
1623
  /**
1730
- * 渲染中间件,如果renderMiddleware返回值为ReactElement格式,则会终止后续逻辑,fieldConfig配置将失效
1624
+ * 字段映射,默认值:{ list:'list', total:'total', pageNo:'pageNo', pageSize:'pageSize' }
1731
1625
  * ```
1732
- * 1. tableRowIndex: 当前row的索引值
1733
- * 2. name: 当前table单元格的form.item的name值
1734
- * 3. operation Form.List的操作函数
1735
- * 4. 对 table children column渲染无效
1626
+ * 1. list、total用于解析接口响应数据,可以配置多级,例如:{ list: 'data.rows', total: 'page.total' }
1627
+ * 2. pageNo、pageSize用于接口分页入参Key定义,只能一级,例如:pageNo: 'page'
1628
+ * ```
1629
+ */
1630
+ fieldNames?: {
1631
+ list?: string;
1632
+ total?: string;
1633
+ pageNo?: string;
1634
+ pageSize?: string;
1635
+ };
1636
+ /** 初始化是否请求,默认值:true */
1637
+ initRequest?: boolean;
1638
+ onDataSourceChange?: (dataSource: TAny) => void;
1639
+ /** 如果自定义查询按钮,可设置 Form onFinish */
1640
+ onFormFinish?: (values?: TPlainObject) => void;
1641
+ /** 在父节点高度下,上下铺满;默认值:true */
1642
+ isFull?: boolean;
1643
+ /** 查询条件固定,不随滚动条滚动 */
1644
+ filterFixed?: boolean;
1645
+ /** 分页区域固定,不随滚动条滚动 */
1646
+ paginationFixed?: boolean;
1647
+ /**
1648
+ * 1. 配合paginationFixed=true一起使用有效果
1649
+ * 2. 当使用Table内的pagination时,在EasyTable.Table中配置分页属性
1650
+ */
1651
+ pagination?: PaginationProps;
1652
+ /**
1653
+ * 查询条件展开、收起,被收起key数组;数组内容为EasyTable.Filter 子节点key值
1654
+ */
1655
+ foldKeys?: string[];
1656
+ /**
1657
+ * 自定义处理服务异常
1658
+ * @param error
1659
+ * @returns
1660
+ */
1661
+ onRequestErrorHandle?: (error: any) => void;
1662
+ /**
1663
+ * 是否inline模式
1664
+ * ```
1665
+ * 1. 缩短 EasyTable.Filter 与 EasyTable.Table 之间的距离
1666
+ * 2. 取消内边距
1667
+ * ```
1668
+ */
1669
+ isInline?: boolean;
1670
+ /** Form 实例 */
1671
+ form?: FormInstance;
1672
+ };
1673
+ export type FormOperateColProps = {
1674
+ className?: string;
1675
+ leftList?: Array<ReactElement | null>;
1676
+ rightList?: Array<ReactElement | null>;
1677
+ justify?: RowProps["justify"];
1678
+ /** 强制单独一行 */
1679
+ forceAloneRow?: boolean;
1680
+ hidden?: boolean;
1681
+ leftSpaceProps?: SpaceProps;
1682
+ rightSpaceProps?: SpaceProps;
1683
+ };
1684
+ export type FormRowProps = RowProps & {
1685
+ children?: ReactNode | ReactNode[];
1686
+ /**
1687
+ * default = { xs: 24, sm: 12, md: 8, lg: 8, xl: 8, xxl: 6 };
1688
+ * small = { xs: 24, sm: 12, md: 8, lg: 6, xl: 6, xxl: 6 };
1689
+ */
1690
+ gridSize?: "default" | "small";
1691
+ };
1692
+ export type EasyTableFilterProps = {
1693
+ children: ReactElement | ReactElement[] | ((form: FormInstance) => ReactElement);
1694
+ /** isPure = true时无效 */
1695
+ filterOperate?: (form: FormInstance) => FormOperateColProps;
1696
+ /** 是否为纯净模式(查询条件布局是否自定义), */
1697
+ isPure?: boolean;
1698
+ /** 查询按钮配置 */
1699
+ queryButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
1700
+ text?: string;
1701
+ };
1702
+ /** 重置按钮配置 */
1703
+ resetButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
1704
+ text?: string;
1705
+ };
1706
+ /**
1707
+ * 网格布局设置
1708
+ * default = { xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 };
1709
+ * small = { xs: 24, sm: 8, md: 8, lg: 6, xl: 6, xxl: 6 };
1710
+ */
1711
+ formGridSize?: FormRowProps["gridSize"];
1712
+ formClassName?: string;
1713
+ formStyle?: CSSProperties;
1714
+ /** filter Form 外层 SimpleLayout style */
1715
+ filterWrapperStyle?: CSSProperties;
1716
+ /** filter Form 外层 SimpleLayout className */
1717
+ filterWrapperClassName?: string;
1718
+ /**
1719
+ * 自定义 filterOperate.rightList 后 默认【查询、重置】按钮处理逻辑
1720
+ * 1. cover:覆盖内部查询重置按钮(默认值)
1721
+ * 2. beforeAppend:添加到【查询重置】按钮前面
1722
+ * 3. afterAppend:添加到【查询重置】按钮后面
1723
+ *
1724
+ * 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
1725
+ */
1726
+ rightOperateAreaAppendType?: "cover" | "beforeAppend" | "afterAppend";
1727
+ /** 默认重启按钮触发请求,默认值:true */
1728
+ defaultResetButtonTriggerRequest?: boolean;
1729
+ };
1730
+ export type EasyTableTableProps<T> = Omit<TableProps<TAny>, "dataSource" | "loading" | "rowKey" | "columns"> & {
1731
+ children?: ReactElement | ReactElement[];
1732
+ /**
1733
+ * 表格行 key 的取值,
1734
+ * ```
1735
+ * 如果 rowKey 为string类型
1736
+ * 1. 组件会判断表格列表数据第一条是否存在当前rowKey对象的数据,如果没有组件内部会动态添加唯一值
1737
+ * 2. 基于上一条的逻辑,如果表格数据没有唯一值,可指定 rowKey 值为table数据中不存在的字段名,例如:rowKey="_uid"
1738
+ * 3. 如果触发上述逻辑,表格数据中会多出rowKey对应的键值对数据
1736
1739
  * ```
1737
1740
  */
1738
- renderMiddleware?: (item: {
1739
- tableRowIndex: number;
1740
- name: EditableTableName;
1741
- tableRowName: EditableTableName;
1742
- operation: FormListOperation;
1743
- index: number;
1744
- }) => ReactElement | null;
1745
- /** table datasource children column 自定义渲染 */
1746
- tableChildrenColumnRender?: (value: TAny, record: TPlainObject, index: number) => ReactElement | null;
1741
+ rowKey: TableProps<TAny>["rowKey"];
1742
+ /** table Form 外层 SimpleLayout className */
1743
+ tableWrapperStyle?: CSSProperties;
1744
+ /** table Form 外层 SimpleLayout className */
1745
+ tableWrapperClassName?: string;
1746
+ columns: TEasyTableTableColumn<T>[];
1747
1747
  };
1748
- export type EditableTableProps = {
1749
- name: EditableTableName;
1748
+ /**
1749
+ * 对 查询条件+表格数据 进行深度封装,内置数据交互处理
1750
+ * ```
1751
+ * 1. 废弃modelKey参数
1752
+ * 2. 如果需要在路由跳转回退中缓存查询条件,设置cacheSwitch=true
1753
+ * 3. 需要获取查询条件、主动发起请求等可通过ref、useEasyTable操作
1754
+ * 4. 可通过属性 initRequest 设置初始化是否请求数据
1755
+ * 5. 可通过属性 fieldNames 来设置自定义变量,默认值为:list、total、pageNo、pageSize
1756
+ * 6. isFull=true,设置【在父节点高度下,上下铺满】(默认值:true)
1757
+ * 7. filterFixed=true,设置查询条件固定,不随滚动条滚动
1758
+ * 8. paginationFixed=true,可设置分页条件在底部固定,不随滚动条滚动
1759
+ * 9. foldKeys=string[],查询条件展开、收起,被收起数组内容为EasyTable.Filter 子节点key值
1760
+ * 10. windows环境下,会在EasyTable.Table外部包装一下 TableScrollbar,提示高windows下table左右滚动体验
1761
+ *
1762
+ * Demo https://fex.qa.tcshuke.com/docs/admin/main/crud/easy-table
1763
+ * ```
1764
+ */
1765
+ export declare const EasyTable: import("react").ForwardRefExoticComponent<EasyTableProps & import("react").RefAttributes<EasyTableRefApi>> & {
1766
+ /**
1767
+ * 过滤条件
1768
+ * @param props
1769
+ * @returns
1770
+ *
1771
+ *```
1772
+ *1. 用法1
1773
+ * -- 默认网格布局 规则:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
1774
+ * <EasyTable.Filter>
1775
+ * <Form.Item name="field1" label="条件1">xxx</Form.Item>
1776
+ * </EasyTable.Filter>
1777
+ *
1778
+ * -- 自定义网格布局 使用 FormCol组件包装 Form.Item
1779
+ * <EasyTable.Filter>
1780
+ * <FormCol span={12}><Form.Item name="field1" label="条件1">xxx</Form.Item></FormCol>
1781
+ * </EasyTable.Filter>
1782
+ *
1783
+ * -- children 可为 function
1784
+ * <EasyTable.Filter>
1785
+ * {(form) => {
1786
+ * return <Form.Item name="field1" label="条件1">xxx</Form.Item>
1787
+ * }}
1788
+ * </EasyTable.Filter>
1789
+ *2. 用户2(自定义布局)
1790
+ * EasyTable.Filter设置 isPure = true,FormItem无布局规则
1791
+ *3. EasyTable.Filter中内置了 Form 标签,当children为函数时,可获取form实例
1792
+ *4. 默认布局下,可通过设置 filterOperate 设置操作按钮
1793
+ *5. Filter 子节点包含 hidden = true 会被忽略
1794
+ *6. 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
1795
+ *```
1796
+ */
1797
+ Filter: (props: EasyTableFilterProps) => import("react/jsx-runtime").JSX.Element;
1750
1798
  /**
1799
+ * 表格渲染
1800
+ * @param props
1751
1801
  * ```
1752
- * antd table属性
1753
- * 1. 新增cellVerticalAlign,单元格竖直方向对齐方式,设置table column onCell属性后失效
1802
+ * 1. 继承了 TableProps 可设置antd table功能
1803
+ * 2. 分页功能已内置处理,不调用 onChange
1754
1804
  * ```
1755
1805
  */
1756
- tableProps?: Omit<TableProps<EditableTableRecordType>, "dataSource" | "columns" | "rowKey"> & {
1757
- cellVerticalAlign?: "baseline" | "middle" | "top" | "bottom";
1758
- };
1759
- columns: EditableTableColumn[];
1760
- onTableBeforeRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
1806
+ Table: <T extends import("@flatbiz/utils").TPlainObject>(props: EasyTableTableProps<T>) => import("react/jsx-runtime").JSX.Element;
1761
1807
  /**
1762
- * 设置后,将覆盖底部`新增`按钮
1808
+ * @deprecated 已过时 4.3.0版本移除,请使用 useEasyTable
1763
1809
  */
1764
- onTableAfterRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
1765
- rules?: FormListProps["rules"];
1766
- /** 隐藏底部`新增`按钮,设置 onTableAfterRender后 失效 */
1767
- hiddenFooterBtn?: boolean;
1768
- /** 新增行默认值,自定义onTableAfterRender后失效 */
1769
- getAddRowDefaultValues?: () => TPlainObject;
1770
- };
1771
- export type EditableTableRefApi = {
1772
- /** 可用于表格行选择操作时,获取操作列数据 */
1773
- getTableItemDataByFormListItemKey: (key: number) => TPlainObject;
1810
+ useEasyTablRef: () => {
1811
+ current: EasyTableRefApi;
1812
+ };
1813
+ /** 在 EasyTable子组件内才可使用 */
1814
+ useEasyTable: () => EasyTableRefApi;
1774
1815
  };
1816
+ export interface EditableFieldProps {
1817
+ className?: string;
1818
+ style?: CSSProperties;
1819
+ editRender: ReactElement | ((data: {
1820
+ value?: TAny;
1821
+ onChange?: (data?: TAny) => void;
1822
+ }) => ReactElement);
1823
+ viewRender?: (value?: TAny) => ReactNode;
1824
+ value?: TAny;
1825
+ onChange?: (data?: TAny) => void;
1826
+ placeholderValue?: string;
1827
+ /** edit 区域是否铺满,showEditableIcon=false 无效 */
1828
+ isEditFull?: boolean;
1829
+ /** 是否可编辑 */
1830
+ editable?: boolean;
1831
+ /** 是否显示编辑、确认、取消操作icon,默认值:true */
1832
+ showEditableIcon?: boolean;
1833
+ /** 点击编辑按钮,操作前,返回reject不会开启编辑效果 */
1834
+ onClickEditIconPre?: (value?: TAny) => Promise<void>;
1835
+ onEditCallback?: (value?: TAny) => void;
1836
+ /** 点击确定按钮,操作前,返回reject不会执行确定功能 */
1837
+ onClickConfirmIconPre?: (value?: TAny, preValue?: TAny) => Promise<void>;
1838
+ onConfirmCallback?: (value?: TAny, preValue?: TAny) => void;
1839
+ /** 组件操作Icon配置 */
1840
+ iconConfig?: {
1841
+ editIcon?: (options: {
1842
+ onClick: () => void;
1843
+ }) => ReactElement;
1844
+ confirmIcon?: (options: {
1845
+ onClick: () => void;
1846
+ }) => ReactElement;
1847
+ cancelIcon?: (options: {
1848
+ onClick: () => void;
1849
+ }) => ReactElement;
1850
+ };
1851
+ }
1775
1852
  /**
1776
- * 可编辑表格
1777
- * demo:https://fex.qa.tcshuke.com/docs/admin/main/table/row-editable1
1853
+ * 可编辑字段组件
1778
1854
  * @param props
1855
+ * @returns
1779
1856
  * ```
1780
- * 1. 通过 tableProps 设置Table属性,table size默认:small
1781
- * 2. Table children column 不可编辑
1782
- * 3. 当存在折叠children数据时,组件会在children中内置_isChildrenItem字段
1783
- * 4. 可通过tableChildrenColumnRender自定义渲染 table children column 显示
1784
- * 5. 设置 rowSelection 后,rowSelection.onChange 通过 ref 的 getTableItemDataByFormListItemKey获取数据
1857
+ * 字段渲染有两种状态
1858
+ * 1. 只读:如果value类型为复杂格式,必须要通过【viewRender】来进行处理操作,转成简单数据类型
1859
+ * 2. 编辑:参数value的格式要求必须满足编辑组件入参value要求
1860
+ * 3. 可自定义编辑Icon、确定Icon、取消Icon
1861
+ * 4. 可拦截编辑操作、确定操作
1785
1862
  * ```
1786
1863
  */
1787
- export declare const EditableTable: import("react").ForwardRefExoticComponent<EditableTableProps & import("react").RefAttributes<EditableTableRefApi>>;
1864
+ export declare const EditableField: (props: EditableFieldProps) => any;
1865
+ export interface EditableFieldProviderProps {
1866
+ children: ReactElement;
1867
+ editable?: boolean;
1868
+ showEditableIcon?: boolean;
1869
+ }
1870
+ /**
1871
+ * EditableFieldProvider 控制内部使有的 EditableField 状态
1872
+ * @param props
1873
+ * @returns
1874
+ */
1875
+ export declare const EditableFieldProvider: (props: EditableFieldProviderProps) => import("react/jsx-runtime").JSX.Element;
1788
1876
  export type EditorWrapperProps = {
1789
1877
  onChange?: (data?: string) => void;
1790
1878
  value?: string;
@@ -1953,6 +2041,10 @@ export declare const FbaApp: ((props: {
1953
2041
  };
1954
2042
  export type ShouldUpdateFunc<T> = (prev: T | undefined, next: T) => boolean;
1955
2043
  declare function usePrevious<T>(state: T, shouldUpdate?: ShouldUpdateFunc<T>): T | undefined;
2044
+ export type CopyRemoveSpaceProps = {
2045
+ /** 设置监听复制范围,如果不设置则监听全局 */
2046
+ target?: () => Element;
2047
+ };
1956
2048
  export declare const fbaHooks: {
1957
2049
  useEffectCustom: (fn: import("react").EffectCallback, deps: import("react").DependencyList) => void;
1958
2050
  useEffectCustomAsync: (fn: () => Promise<void>, deps: import("react").DependencyList) => void;
@@ -1974,6 +2066,7 @@ export declare const fbaHooks: {
1974
2066
  import("react").Dispatch<import("react").SetStateAction<S>>
1975
2067
  ];
1976
2068
  useMemoCustom: <T_1>(fn: () => T_1, deps?: import("react").DependencyList | undefined) => T_1;
2069
+ useCopyRemoveSpace: (props?: CopyRemoveSpaceProps | undefined) => void;
1977
2070
  };
1978
2071
  declare function attachPropertiesToComponent<C, P extends Record<string, unknown>>(component: C, properties: P): C & P;
1979
2072
  export declare const fbaUtils: {
@@ -1983,6 +2076,7 @@ export declare const fbaUtils: {
1983
2076
  getModelKey: () => string;
1984
2077
  };
1985
2078
  export type FileImportProps = {
2079
+ /** 上传文件接口返回处理 */
1986
2080
  onImportFinish: (data?: TAny) => void;
1987
2081
  buttonName?: string | ReactElement;
1988
2082
  children?: React.ReactNode | ((data: {
@@ -2348,6 +2442,40 @@ export type InputWrapperProps = Omit<InputProps, "defaultValue"> & {
2348
2442
  * ```
2349
2443
  */
2350
2444
  export declare const InputWrapper: (props: InputWrapperProps) => import("react/jsx-runtime").JSX.Element;
2445
+ export type JsonEditorProps = Omit<IAceEditorProps, "onLoad" | "mode" | "value" | "onChange"> & {
2446
+ /** 编辑器高度,默认值:100%,可输入值例如 300px、100% */
2447
+ height?: string;
2448
+ value?: string | TPlainObject | TPlainObject[];
2449
+ onChange?: (value?: string | TPlainObject | TPlainObject[]) => void;
2450
+ /** 配置输入自动提示关键字 */
2451
+ autoCompleterList?: {
2452
+ name: string;
2453
+ desc?: string;
2454
+ }[];
2455
+ /** 是否显示【验证数据】按钮,默认值:true */
2456
+ showVerifyBtn?: boolean;
2457
+ /**
2458
+ * 编辑器主题配置
2459
+ * ```
2460
+ * 1. 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
2461
+ * 2. 配置 theme = xxxx
2462
+ * ```
2463
+ */
2464
+ theme?: string;
2465
+ };
2466
+ /**
2467
+ * Json编辑器
2468
+ * ```
2469
+ * 1. 受控组件,需要使用value、onChange配合显示数据
2470
+ * 2. heigth 默认为100%,如果外层无高度,需要自定义设置height属性
2471
+ * 3. 通过 autoCompleterList 配置自动提示关键字
2472
+ * 4. 通过 showVerifyBtn配置是否显示【验证数据】按钮
2473
+ * 5. 通过 theme 配置编辑器主题,例如:
2474
+ * 5.1 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
2475
+ * 5.2 配置 theme = xxxx
2476
+ * ```
2477
+ */
2478
+ export declare const JsonEditor: (props: JsonEditorProps) => import("react/jsx-runtime").JSX.Element;
2351
2479
  export type LabelValueLayoutProps = {
2352
2480
  options: {
2353
2481
  label: string | ReactElement;
@@ -2743,6 +2871,98 @@ export type RuleDescribeProps = {
2743
2871
  ruleItemDescStyle?: CSSProperties;
2744
2872
  };
2745
2873
  export declare const RuleDescribe: (props: RuleDescribeProps) => import("react/jsx-runtime").JSX.Element;
2874
+ export type SearchFormProps = {
2875
+ children: ReactElement | ReactElement[] | ((form: FormInstance) => ReactElement);
2876
+ /** isPure = true时无效 */
2877
+ searchOperate?: (form: FormInstance) => FormOperateColProps;
2878
+ /** 是否为纯净模式(查询条件布局是否自定义), */
2879
+ isPure?: boolean;
2880
+ /** 查询按钮配置 */
2881
+ queryButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
2882
+ text?: string;
2883
+ };
2884
+ /** 重置按钮配置 */
2885
+ resetButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
2886
+ text?: string;
2887
+ };
2888
+ /**
2889
+ * 网格布局设置
2890
+ * default = { xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 };
2891
+ * small = { xs: 24, sm: 8, md: 8, lg: 6, xl: 6, xxl: 6 };
2892
+ */
2893
+ formGridSize?: FormRowProps["gridSize"];
2894
+ formClassName?: string;
2895
+ formStyle?: CSSProperties;
2896
+ /**
2897
+ * 自定义 searchOperate.rightList 后 默认【查询、重置】按钮处理逻辑
2898
+ * 1. cover:覆盖内部查询重置按钮(默认值)
2899
+ * 2. beforeAppend:添加到【查询重置】按钮前面
2900
+ * 3. afterAppend:添加到【查询重置】按钮后面
2901
+ *
2902
+ * 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
2903
+ */
2904
+ rightOperateAreaAppendType?: "cover" | "beforeAppend" | "afterAppend";
2905
+ /** 默认重启按钮触发请求,默认值:true */
2906
+ defaultResetButtonTriggerRequest?: boolean;
2907
+ foldKeys?: string[];
2908
+ formInitialValues?: TPlainObject;
2909
+ /**
2910
+ * 按钮提交事件
2911
+ * 如果需要自定义回车提交事件,需要自定义提交按钮
2912
+ */
2913
+ onFormFinish?: (values?: TPlainObject) => void;
2914
+ /** 重置按钮 */
2915
+ onReset?: () => void;
2916
+ /** 查询按钮 */
2917
+ onQuery?: (values: TPlainObject) => void;
2918
+ /**
2919
+ * 是否缓存查询数据,默认值:true
2920
+ * ```
2921
+ * 1. 一般首页可缓存,二级、三级等页面不能缓存
2922
+ * ```
2923
+ */
2924
+ cacheSwitch?: boolean;
2925
+ /** 初始化是否请求,默认值:true */
2926
+ initRequest?: boolean;
2927
+ };
2928
+ export type SearchFormRefApi = {
2929
+ onQuery: (values?: TPlainObject) => void;
2930
+ form: FormInstance;
2931
+ };
2932
+ /**
2933
+ * 搜索表单
2934
+ *
2935
+ *```
2936
+ * 1. 用法1
2937
+ * -- 默认网格布局 规则:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
2938
+ * <SearchForm>
2939
+ * <Form.Item name="field1" label="条件1">xxx</Form.Item>
2940
+ * </SearchForm>
2941
+ *
2942
+ * -- 自定义网格布局 使用 FormCol组件包装 Form.Item
2943
+ * <SearchForm>
2944
+ * <FormCol span={12}><Form.Item name="field1" label="条件1">xxx</Form.Item></FormCol>
2945
+ * </SearchForm>
2946
+ *
2947
+ * -- children 可为 function
2948
+ * <SearchForm>
2949
+ * {(form) => {
2950
+ * return <Form.Item name="field1" label="条件1">xxx</Form.Item>
2951
+ * }}
2952
+ * </SearchForm>
2953
+ *
2954
+ * 2. 用户2(自定义布局)
2955
+ * SearchForm设置 isPure = true,FormItem无布局规则
2956
+ * 3. SearchForm中内置了 Form 标签,当children为函数时,可获取form实例
2957
+ * 4. 默认布局下,可通过设置 searchOperate 设置操作按钮
2958
+ * 5. SearchForm 子节点包含 hidden = true 会被忽略
2959
+ * 6. 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
2960
+ * 7. 通过设置 defaultResetButtonTriggerRequest,可在右侧按钮区域新增自定义按钮
2961
+ * 8. 可设置 cacheSwitch 来控制是否缓存查询数据(一般一级页面可缓存,二级、三级等不能缓存),
2962
+ * 缓存数据存储在内存中,react路由跳转可正常读取缓存,浏览器刷新后缓存丢失
2963
+ *```
2964
+ */
2965
+ export declare const SearchForm: import("react").ForwardRefExoticComponent<SearchFormProps & import("react").RefAttributes<SearchFormRefApi>>;
2746
2966
  export interface ISearchMenuProps {
2747
2967
  /**
2748
2968
  * 如果传了value,就变成受控组件
@@ -3201,6 +3421,7 @@ export declare const tableCellRender: {
3201
3421
  * 可配置
3202
3422
  * 1. separator:是否显示千分位分隔符,默认值:false
3203
3423
  * 2. defaultValue:当值为空默认展示
3424
+ * 3. hideBgColor:隐藏背景颜色
3204
3425
  *
3205
3426
  * 例如:
3206
3427
  * fen2yuanCell()(100090) => 1000.90
@@ -3215,6 +3436,35 @@ export declare const tableCellRender: {
3215
3436
  /** 是否显示分隔符,默认值:false */
3216
3437
  separator?: boolean;
3217
3438
  defaultValue?: string | number;
3439
+ /** 隐藏背景颜色 */
3440
+ hideBgColor?: boolean;
3441
+ }) => (value?: string | number) => string | number | import("react/jsx-runtime").JSX.Element | undefined;
3442
+ /**
3443
+ * 分金额展示,入参分,显示万元(默认添加千分位)
3444
+ * ```
3445
+ * 可配置
3446
+ * 1. separator:是否显示千分位分隔符,默认值:false
3447
+ * 2. defaultValue:当值为空默认展示
3448
+ * 3. showBgColor:隐藏背景颜色
3449
+ * 4. removeTailZero:移除小数点后末尾零
3450
+ *
3451
+ * 例如:
3452
+ * fen2yuanCell()(1000900000) => 1000.90
3453
+ * fen2yuanCell({separator: true})(1000900000) => 1,000.90
3454
+ * fen2yuanCell()('abc') => abc
3455
+ * fen2yuanCell({defaultValue: '--'})('') => --
3456
+ * fen2yuanCell()('') => undefined
3457
+ * fen2yuanCell({ defaultValue: 0 })('') => 0.00
3458
+ * ```
3459
+ */
3460
+ fen2wanCell: (options?: {
3461
+ /** 是否显示分隔符,默认值:false */
3462
+ separator?: boolean;
3463
+ defaultValue?: string | number;
3464
+ /** 隐藏背景颜色,默认:false */
3465
+ showBgColor?: boolean;
3466
+ /** 移除小数点后末尾零 */
3467
+ removeTailZero?: boolean;
3218
3468
  }) => (value?: string | number) => string | number | import("react/jsx-runtime").JSX.Element | undefined;
3219
3469
  /**
3220
3470
  * 单元格徽标展示数据
@@ -3336,6 +3586,7 @@ export type CssTextEllipsisProps = {
3336
3586
  };
3337
3587
  /**
3338
3588
  * 内容超过宽度截取,并在尾部添加...,被截取的添加Tooltip显示完整数据
3589
+ * @deprecated 已过期,请使用 TextOverflow 组件
3339
3590
  * ```
3340
3591
  * 1. 如果配置 width,则使用文本长度与width进行比较
3341
3592
  * 2. 如果没有配置 width,则使用文本长度与当前节点父节点宽度进行比较
@@ -3346,6 +3597,39 @@ export type CssTextEllipsisProps = {
3346
3597
  * ```
3347
3598
  */
3348
3599
  export declare const TextCssEllipsis: (props: CssTextEllipsisProps) => import("react/jsx-runtime").JSX.Element;
3600
+ export type TextOverflowProps = {
3601
+ text: string;
3602
+ /** 最大显示宽度 */
3603
+ maxWidth?: number;
3604
+ /** 最大显示字数 */
3605
+ maxLength?: number;
3606
+ /** 隐藏tips */
3607
+ hideTips?: boolean;
3608
+ onClick?: (e: any) => void;
3609
+ };
3610
+ /**
3611
+ * 内容溢出截取,并在尾部添加...,被截取的添加Tooltip显示完整数据
3612
+ * ```
3613
+ * 控制文本显示三种方式
3614
+ * 1. 通过 maxLength 控制超长
3615
+ * 2. 通过 maxWidth 控制超长
3616
+ * 3. 与父节点宽度比较,控制超长
3617
+ *
3618
+ * 注意:
3619
+ * 1. 当前节点父节点需要添加 overflow-x: hidden;
3620
+ * 2. 如果父节点设置flex-shrink会有影响,可复写flex-shrink: initial;
3621
+ * 3. 与 Table columns render结合使用,需要配置ellipsis=true
3622
+ * 例如:<Table columns={[{
3623
+ ...
3624
+ render: (value) => {
3625
+ return <TextOverflow text={value} />;
3626
+ },
3627
+ ellipsis: true,
3628
+ }]} />
3629
+ 4. 与 Table columns render结合使用,如果Table配置了 scroll={{ x: 'max-content' }}后,TextOverflow功能失效
3630
+ * ```
3631
+ */
3632
+ export declare const TextOverflow: (props: TextOverflowProps) => import("react/jsx-runtime").JSX.Element;
3349
3633
  export type TextOverflowRenderProps = {
3350
3634
  /** width 宽度控制超长 */
3351
3635
  width?: number;
@@ -3361,6 +3645,7 @@ export type TextOverflowRenderProps = {
3361
3645
  };
3362
3646
  /**
3363
3647
  * 文本显示超出截取,被截取的添加Tooltip显示完整数据
3648
+ * @deprecated 已过期,请使用 TextOverflow 组件
3364
3649
  * ```
3365
3650
  * 控制文本显示两种方式
3366
3651
  * 1. 通过 maxLength 控制超长
@@ -3368,8 +3653,6 @@ export type TextOverflowRenderProps = {
3368
3653
  *
3369
3654
  * 3. maxLength 与 width 互斥,优先级:maxLength > width
3370
3655
  * ```
3371
- * @param props
3372
- * @returns
3373
3656
  */
3374
3657
  export declare const TextOverflowRender: (props: TextOverflowRenderProps) => import("react/jsx-runtime").JSX.Element;
3375
3658
  export type TextSymbolWrapperProps = {