@flatbiz/antd 4.4.13 → 4.4.15

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 (42) hide show
  1. package/esm/date-range-picker-wrapper-form-item/index.js +2 -1
  2. package/esm/date-range-picker-wrapper-form-item/index.js.map +1 -1
  3. package/esm/dialog-confirm/index.js +1 -1
  4. package/esm/dialog-confirm/index.js.map +1 -1
  5. package/esm/dialog-drawer/index.js +1 -1
  6. package/esm/dialog-drawer/index.js.map +1 -1
  7. package/esm/dialog-drawer-content/index.js.map +1 -1
  8. package/esm/dialog-modal/index.js +1 -1
  9. package/esm/dialog-modal/index.js.map +1 -1
  10. package/esm/drag-form-list/index.css +1 -1
  11. package/esm/drag-form-list/index.js +4 -1
  12. package/esm/drag-form-list/index.js.map +1 -1
  13. package/esm/easy-form/index.js +2 -1
  14. package/esm/easy-form/index.js.map +1 -1
  15. package/esm/easy-table/index.js +5 -2
  16. package/esm/easy-table/index.js.map +1 -1
  17. package/esm/fba-app/index.js +1 -1
  18. package/esm/fba-app/index.js.map +1 -1
  19. package/esm/file-export/index.js +1 -1
  20. package/esm/file-export/index.js.map +1 -1
  21. package/esm/file-import/index.js.map +1 -1
  22. package/esm/form-item-group/index.js.map +1 -1
  23. package/esm/form-item-text/index.js +2 -1
  24. package/esm/form-item-text/index.js.map +1 -1
  25. package/esm/form-item-wrapper/index.css +1 -0
  26. package/esm/form-item-wrapper/index.js +2 -1
  27. package/esm/form-item-wrapper/index.js.map +1 -1
  28. package/esm/form-list-wrapper/index.css +1 -1
  29. package/esm/form-list-wrapper/index.js +4 -1
  30. package/esm/form-list-wrapper/index.js.map +1 -1
  31. package/esm/form-wrapper/index.css +1 -0
  32. package/esm/form-wrapper/index.js +2 -1
  33. package/esm/form-wrapper/index.js.map +1 -1
  34. package/esm/index.js +5 -4
  35. package/esm/modal-action/index.js.map +1 -1
  36. package/esm/pre-defined-class-name/index.js +1 -1
  37. package/esm/pre-defined-class-name/index.js.map +1 -1
  38. package/esm/rich-text-editor/index.js +1 -1
  39. package/esm/rich-text-editor/index.js.map +1 -1
  40. package/esm/upload-wrapper/index.js.map +1 -1
  41. package/index.d.ts +278 -115
  42. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -418,6 +418,14 @@ export type ButtonWrapperProps = Omit<ButtonProps, "onClick"> & {
418
418
  */
419
419
  export declare const ButtonWrapper: (props: ButtonWrapperProps) => import("react/jsx-runtime").JSX.Element | null;
420
420
  export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContainer" | "open" | "open" | "okButtonProps" | "cancelButtonProps" | "footer"> & {
421
+ /**
422
+ * 内置尺寸,根据比例固定高度、宽度,默认:middle
423
+ * ```
424
+ * 1. 如果自定义了width、styles.body.height属性,size中的height、width将对应失效
425
+ * 2. 可传 null 值,取消内置尺寸
426
+ * ```
427
+ */
428
+ size?: "small" | "middle" | "large" | null;
421
429
  onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
422
430
  onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
423
431
  content: string | ReactElement | ((form: FormInstance, operate: {
@@ -430,6 +438,7 @@ export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContai
430
438
  cancelButtonProps?: Omit<ButtonWrapperProps, "hidden" | "children" | "onClick">;
431
439
  /**
432
440
  * 设置modal body height 为当前窗口height的百分比,例如:30
441
+ * @deprecated 已失效,可通过size属性设置
433
442
  * ```
434
443
  * 1. 最大值:80
435
444
  * 1. 设置bodyStyle.height 后,bodyHeightPercent失效
@@ -450,6 +459,7 @@ export type DialogModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContai
450
459
  * 3. 需要修改默认主题风格的场景,请使用
451
460
  * const { appDialogModal } = FbaApp.useDialogModal();
452
461
  * appDialogModal.open({})
462
+ * 4. 配置size属性可使用预设的弹窗尺寸
453
463
  * ```
454
464
  */
455
465
  export declare const dialogModal: {
@@ -943,7 +953,45 @@ export type DateRangePickerWrapperProps = Omit<RangePickerDateProps<TAny>, "valu
943
953
  * ```
944
954
  */
945
955
  export declare const DateRangePickerWrapper: (props: DateRangePickerWrapperProps) => import("react/jsx-runtime").JSX.Element;
946
- export interface FormItemWrapperProps extends FormItemProps {
956
+ export type TFormLayoutPreClassNameProps = {
957
+ /**
958
+ * label宽度,Form内部所有FormItem label都生效
959
+ * ```
960
+ * 1. 可设置数值
961
+ * 2. 可设置`auto`自适应
962
+ * ```
963
+ */
964
+ labelWidth?: "auto" | "70" | "80" | "90" | "100" | "110" | "120" | "130" | "140" | "150" | "160" | "170" | "180" | "190" | "200";
965
+ /** labelItem 竖直布局 */
966
+ labelItemVertical?: boolean;
967
+ /** label 对齐方式 */
968
+ labelAlign?: "left" | "right";
969
+ /** formItem之间竖直间距,默认值:24 */
970
+ formItemGap?: "15" | "8" | "5" | "0";
971
+ /**
972
+ * className 中可能会包含 preDefinedClassName.form.xx,优先级大于 labelWidth、labelItemVertical、labelAlign、formItemGap
973
+ */
974
+ className?: string;
975
+ };
976
+ export type TFormItemLayoutPreClassNameProps = {
977
+ /**
978
+ * label宽度,Form内部所有FormItem label都生效
979
+ * ```
980
+ * 1. 可设置数值
981
+ * 2. 可设置`auto`自适应
982
+ * ```
983
+ */
984
+ labelWidth?: "auto" | "70" | "80" | "90" | "100" | "110" | "120" | "130" | "140" | "150" | "160" | "170" | "180" | "190" | "200";
985
+ /** labelItem 竖直布局 */
986
+ labelItemVertical?: boolean;
987
+ /** label 对齐方式 */
988
+ labelAlign?: "left" | "right";
989
+ /**
990
+ * className 中可能会包含 preDefinedClassName.formItem.xx,优先级大于 labelWidth、labelItemVertical、labelAlign
991
+ */
992
+ className?: string;
993
+ };
994
+ export type FormItemWrapperProps = FormItemProps & TFormItemLayoutPreClassNameProps & {
947
995
  wrapper?: (children: ReactNode) => ReactElement;
948
996
  /** 设置wrapper后,before、after失效 */
949
997
  before?: ReactNode;
@@ -958,28 +1006,6 @@ export interface FormItemWrapperProps extends FormItemProps {
958
1006
  outputNormalize?: (value?: TAny) => TAny;
959
1007
  /** 是否清除 Form.Item */
960
1008
  isClear?: boolean;
961
- /**
962
- * label宽度
963
- * ```
964
- * 1. 如果想控制Form下所有label,可使用FormWrapper组件 替换 Form组件,在FormWrapper上设置属性
965
- * 2. 可设置`auto`自适应
966
- * ```
967
- */
968
- labelWidth?: "auto" | "70" | "80" | "90" | "100" | "110" | "120" | "130" | "140" | "150" | "160" | "170" | "180" | "190" | "200";
969
- /**
970
- * labelItem 竖直布局
971
- * ```
972
- * 1. 如果想控制Form下所有labelItem,可使用FormWrapper组件 替换 Form组件,在FormWrapper上设置属性
973
- * ```
974
- */
975
- labelItemVertical?: boolean;
976
- /**
977
- * label 对齐方式
978
- * ```
979
- * 1. 如果想控制Form下所有labelAlign,可使用FormWrapper组件 替换 Form组件,在FormWrapper上设置属性
980
- * ```
981
- */
982
- labelAlign?: "left" | "right";
983
1009
  /**
984
1010
  * 栅格占位格数,最大值:24
985
1011
  * ```
@@ -987,7 +1013,7 @@ export interface FormItemWrapperProps extends FormItemProps {
987
1013
  * ```
988
1014
  */
989
1015
  span?: number;
990
- }
1016
+ };
991
1017
  /**
992
1018
  * 对 Form.Item 包装处理
993
1019
  * ```
@@ -1119,7 +1145,8 @@ export type DialogDrawerContentProps = {
1119
1145
  /**
1120
1146
  * 当dialogDrawer底部操作按钮在业务content内部时,使用
1121
1147
  * ```
1122
- * 1. 设置 footer 后,okHidden、cancelHidden、okButtonExtraProps、cancelButtonExtraProps、okText、cancelText、onOk、onCancel全部失效
1148
+ * 1. 只能与 dialogDrawer 配合使用;与 FbaApp.useDialogDrawer 配合使用无效
1149
+ * 2. 设置 footer 后,okHidden、cancelHidden、okButtonExtraProps、cancelButtonExtraProps、okText、cancelText、onOk、onCancel全部失效
1123
1150
  * ```
1124
1151
  */
1125
1152
  export declare const DialogDrawerContent: (props: DialogDrawerContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1454,6 +1481,7 @@ export type UploadWrapperProps<T extends TPlainObject = TPlainObject> = {
1454
1481
  /**
1455
1482
  * 文件上传
1456
1483
  * ```
1484
+ * demo: https://fex.qa.tcshuke.com/docs/admin/main/file/upload
1457
1485
  * 1. 可通过配置children替换默认上传触发布局
1458
1486
  * 2. 接口返回结构:
1459
1487
  * formData上传接口返回值
@@ -1471,6 +1499,14 @@ export type UploadWrapperProps<T extends TPlainObject = TPlainObject> = {
1471
1499
  * <Form.Item name="attachmentList" label="附件">
1472
1500
  * <UploadWrapper action={uploadUrl} />
1473
1501
  * </Form.Item>
1502
+ *
1503
+ * 5. 回填数据结构
1504
+ * [{
1505
+ * uid: '唯一值',
1506
+ * name(非必填): 'image.png',
1507
+ * url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
1508
+ * }]
1509
+ * 其中 uid、name、url 可为其他命名,通过 fieldNames 进行映射即可
1474
1510
  * ```
1475
1511
  *
1476
1512
  */
@@ -1753,6 +1789,35 @@ export declare const DragEditableTable: import("react").ForwardRefExoticComponen
1753
1789
  overIndex: number;
1754
1790
  }) => void) | undefined;
1755
1791
  } & import("react").RefAttributes<EditableTableRefApi>>;
1792
+ export type FormItemHorizontalUnionProps = {
1793
+ className?: string;
1794
+ style?: CSSProperties;
1795
+ label?: string | ReactElement;
1796
+ /** 水平布局元素 */
1797
+ groupConfigList: {
1798
+ hidden?: boolean;
1799
+ before?: ReactElement | string;
1800
+ /**
1801
+ * 设置宽度
1802
+ * ```
1803
+ * 1. 自适应可设置:auto
1804
+ * 2. 可设置具体数值
1805
+ * 3. 不设置会在铺满flex剩余空间
1806
+ * 4. 多个未设置会等分铺满剩余空间
1807
+ * ```
1808
+ */
1809
+ width?: number | string;
1810
+ mainItem: ReactElement;
1811
+ after?: ReactElement | string;
1812
+ }[];
1813
+ /** 水平布局原始之间的间距 */
1814
+ gap?: number;
1815
+ flexLayoutStyle?: CSSProperties;
1816
+ flexLayoutClassName?: string;
1817
+ hidden?: boolean;
1818
+ required?: boolean;
1819
+ colon?: boolean;
1820
+ };
1756
1821
  export type DragFormListContentProps = {
1757
1822
  /** Form.List item fieldData */
1758
1823
  formListFieldData: FormListFieldData;
@@ -1820,12 +1885,26 @@ export type DragFormListProps = {
1820
1885
  children: ReactElement;
1821
1886
  }) => ReactElement;
1822
1887
  rules?: FormListProps["rules"];
1888
+ /**
1889
+ * 设置FormList字段标题&必填标志
1890
+ * ```
1891
+ * demo: http://dev.flatjs.com:6007/pages/flat/oss-demo/main/form/list?env=me
1892
+ * 1. 会根据数组顺序进行渲染
1893
+ * ```
1894
+ */
1895
+ formListItemTitleList?: {
1896
+ title: string;
1897
+ required?: boolean;
1898
+ width?: number;
1899
+ }[];
1900
+ /** formListItemTitle HorizontalUnionProps 配置 */
1901
+ formListItemTitleHorizontalUnionProps?: Omit<FormItemHorizontalUnionProps, "groupConfigList">;
1823
1902
  };
1824
1903
  /**
1825
1904
  * 可拖拽FormList
1826
1905
  * ```
1906
+ * Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list
1827
1907
  * 1. FormList数组中必须要有唯一值字段,默认值字段名称uid,可通过uidFieldName自定义设置
1828
- * 2. Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list
1829
1908
  * ```
1830
1909
  */
1831
1910
  export declare const DragFormList: (props: DragFormListProps) => import("react/jsx-runtime").JSX.Element;
@@ -1928,22 +2007,8 @@ export declare const dynamicNode: {
1928
2007
  };
1929
2008
  remove: (elementId?: string) => void;
1930
2009
  };
1931
- export type FormWrapperProps<Values = any> = FormProps<Values> & {
2010
+ export type FormWrapperProps<Values = any> = TFormLayoutPreClassNameProps & FormProps<Values> & {
1932
2011
  children: ReactNode;
1933
- /**
1934
- * label宽度,Form内部所有FormItem label都生效
1935
- * ```
1936
- * 1. 可设置数值
1937
- * 2. 可设置`auto`自适应
1938
- * ```
1939
- */
1940
- labelWidth?: "auto" | "70" | "80" | "90" | "100" | "110" | "120" | "130" | "140" | "150" | "160" | "170" | "180" | "190" | "200";
1941
- /** labelItem 竖直布局 */
1942
- labelItemVertical?: boolean;
1943
- /** label 对齐方式 */
1944
- labelAlign?: "left" | "right";
1945
- /** formItem之间竖直间距,默认值:24 */
1946
- formItemGap?: "15" | "8" | "5" | "0";
1947
2012
  };
1948
2013
  /**
1949
2014
  * Form 包装组件,添加对formItem的布局控制
@@ -1989,12 +2054,14 @@ export type EasyFormProps = Omit<FormWrapperProps, "children"> & {
1989
2054
  /** 网格间距 */
1990
2055
  gridGutter?: BoxRowProps["gutter"];
1991
2056
  children: ReactNode;
2057
+ /** 是否为纯净模式,对EasyForm的子节点不做任何包装处理 */
2058
+ isPure?: boolean;
1992
2059
  };
1993
2060
  /**
1994
2061
  * 简单Form布局,可自定义网格布局
1995
2062
  * ```
1996
2063
  * 1. demo:https://fex.qa.tcshuke.com/docs/admin/main/form/grid
1997
- * 2. EasyForm可嵌套使用,嵌套内部的<EasyForm />节点Form属性失效,例如属性form、initialValues等都失效
2064
+ * 2. EasyForm可嵌套使用,嵌套内部的<EasyForm />节点Form相关属性失效,例如属性form、initialValues等都失效
1998
2065
  * 3. 布局网格以当前节点的宽度来计算的,不是屏幕宽度
1999
2066
  * 4. EasyForm 子节点包含 hidden = true 会被忽略
2000
2067
  * 5. 通过 column 可定义一行显示几列FormItem
@@ -2006,17 +2073,14 @@ export type EasyFormProps = Omit<FormWrapperProps, "children"> & {
2006
2073
 
2007
2074
  * 例如
2008
2075
  * <EasyForm column={3}>
2009
- * <Form.Item name="field1" label="条件1">
2010
- * <Input placeholder="请输入" allowClear={true} />
2011
- * </Form.Item>
2012
- * <Form.Item name="field2" label="条件2">
2076
+ * <FormItemWrapper name="field1" label="条件1">
2013
2077
  * <Input placeholder="请输入" allowClear={true} />
2014
- * </Form.Item>
2078
+ * </FormItemWrapper>
2015
2079
  * <!-- !!自定义栅格占位格数第一种方式:可通过使用 BoxGrid.Col 包裹元素来自定义网格占比 -->
2016
2080
  * <BoxGrid.Col span={24}>
2017
- * <Form.Item name="field5" label="条件5">
2081
+ * <FormItemWrapper name="field5" label="条件5">
2018
2082
  * <Input placeholder="请输入" allowClear={true} />
2019
- * </Form.Item>
2083
+ * </FormItemWrapper>
2020
2084
  * </BoxGrid.Col>
2021
2085
  * <!-- !!自定义栅格占位格数第二种方式:如果为FormItemWrapper组件,可设置span属性 -->
2022
2086
  * <FormItemWrapper name="field6" label="条件6" span={24}>
@@ -2228,7 +2292,13 @@ export type EasyTableFilterProps = {
2228
2292
  * small = { xs: 24, sm: 8, md: 8, lg: 6, xl: 6, xxl: 6 };
2229
2293
  */
2230
2294
  formGridSize?: FormRowProps["gridSize"];
2295
+ /**
2296
+ * @deprecated已过期,使用 easyFormProps.className 配置
2297
+ */
2231
2298
  formClassName?: string;
2299
+ /**
2300
+ * @deprecated已过期,使用 easyFormProps.style 配置
2301
+ */
2232
2302
  formStyle?: CSSProperties;
2233
2303
  /** filter Form 外层 BlockLayout style */
2234
2304
  filterWrapperStyle?: CSSProperties;
@@ -2245,6 +2315,7 @@ export type EasyTableFilterProps = {
2245
2315
  rightOperateAreaAppendType?: "cover" | "beforeAppend" | "afterAppend";
2246
2316
  /** 默认重启按钮触发请求,默认值:true */
2247
2317
  defaultResetButtonTriggerRequest?: boolean;
2318
+ easyFormProps?: Omit<EasyFormProps, "isPure" | "column" | "forceColumn" | "width" | "gridGutter" | "children">;
2248
2319
  };
2249
2320
  export type EasyTableTableProps<T> = Omit<TableProps<TAny>, "dataSource" | "loading" | "rowKey" | "columns"> & {
2250
2321
  children?: ReactElement | ReactElement[];
@@ -2280,6 +2351,8 @@ export type EasyTableTableProps<T> = Omit<TableProps<TAny>, "dataSource" | "load
2280
2351
  /**
2281
2352
  * 对 查询条件+表格数据 进行深度封装,内置数据交互处理
2282
2353
  * ```
2354
+ * Demo https://fex.qa.tcshuke.com/docs/admin/main/crud/easy-table
2355
+ *
2283
2356
  * 1. 废弃modelKey参数
2284
2357
  * 2. 如果需要在路由跳转回退中缓存查询条件,设置cacheSwitch=true
2285
2358
  * 3. 需要获取查询条件、主动发起请求等可通过ref、useEasyTable操作
@@ -2289,41 +2362,38 @@ export type EasyTableTableProps<T> = Omit<TableProps<TAny>, "dataSource" | "load
2289
2362
  * 7. filterFixed=true,设置查询条件固定,不随滚动条滚动
2290
2363
  * 8. paginationFixed=true,可设置分页条件在底部固定,不随滚动条滚动
2291
2364
  * 9. foldKeys=string[],查询条件展开、收起,被收起数组内容为EasyTable.Filter 子节点key值
2292
- * 10. windows环境下,会在EasyTable.Table外部包装一下 TableScrollbar,提示高windows下table左右滚动体验
2293
- *
2294
- * Demo https://fex.qa.tcshuke.com/docs/admin/main/crud/easy-table
2365
+ * 10. windows环境下,会在EasyTable.Table外部包装一下 TableScrollbar,提高windows下table左右滚动体验
2295
2366
  * ```
2296
2367
  */
2297
2368
  export declare const EasyTable: import("react").ForwardRefExoticComponent<EasyTableProps & import("react").RefAttributes<EasyTableRefApi>> & {
2298
2369
  /**
2299
2370
  * 过滤条件
2300
- * @param props
2301
- * @returns
2302
- *
2303
2371
  *```
2304
- *1. 用法1
2372
+ * 1. 用法1
2305
2373
  * -- 默认网格布局 规则:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
2306
2374
  * <EasyTable.Filter>
2307
- * <Form.Item name="field1" label="条件1">xxx</Form.Item>
2375
+ * <FormItemWrapper name="field1" label="条件1">xxx</FormItemWrapper>
2308
2376
  * </EasyTable.Filter>
2309
2377
  *
2310
- * -- 自定义网格布局 使用 FormCol组件包装 Form.Item
2378
+ * -- 自定义网格布局 使用 FormCol组件包装 FormItemWrapper
2311
2379
  * <EasyTable.Filter>
2312
- * <FormCol span={12}><Form.Item name="field1" label="条件1">xxx</Form.Item></FormCol>
2380
+ * <FormCol span={12}><FormItemWrapper name="field1" label="条件1">xxx</FormItemWrapper></FormCol>
2313
2381
  * </EasyTable.Filter>
2314
2382
  *
2315
2383
  * -- children 可为 function
2316
2384
  * <EasyTable.Filter>
2317
2385
  * {(form) => {
2318
- * return <Form.Item name="field1" label="条件1">xxx</Form.Item>
2386
+ * return <FormItemWrapper name="field1" label="条件1">xxx</FormItemWrapper>
2319
2387
  * }}
2320
2388
  * </EasyTable.Filter>
2321
- *2. 用户2(自定义布局)
2322
- * EasyTable.Filter设置 isPure = true,FormItem无布局规则
2323
- *3. EasyTable.Filter中内置了 Form 标签,当children为函数时,可获取form实例
2324
- *4. 默认布局下,可通过设置 filterOperate 设置操作按钮
2325
- *5. Filter 子节点包含 hidden = true 会被忽略
2326
- *6. 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
2389
+ * 2. 用户2(自定义布局)
2390
+ * EasyTable.Filter设置 isPure = true,FormItem无布局规则
2391
+ * 3. EasyTable.Filter中内置了 Form 标签,当children为函数时,可获取form实例
2392
+ * 4. 默认布局下,可通过设置 filterOperate 设置操作按钮
2393
+ * 5. Filter 子节点包含 hidden = true 会被忽略
2394
+ * 6. 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
2395
+ * 7. EasyTableFilter 子节点可使用 FormItemWrapper,FormItemWrapper中可配置label宽度等
2396
+ * 8. 通过easyFormProps属性可整体控制子节点FormItem布局
2327
2397
  *```
2328
2398
  */
2329
2399
  Filter: (props: EasyTableFilterProps) => import("react/jsx-runtime").JSX.Element;
@@ -2478,6 +2548,14 @@ export type FbaAppDrawerProps = Omit<DrawerProps, "onOk" | "onCancel" | "getCont
2478
2548
  extra?: ReactNode | ((form: FormInstance) => ReactElement);
2479
2549
  };
2480
2550
  export type FbaAppModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContainer" | "okButtonProps" | "cancelButtonProps" | "footer"> & {
2551
+ /**
2552
+ * 内置尺寸,根据比例固定高度、宽度,默认:middle
2553
+ * ```
2554
+ * 1. 如果自定义了width、styles.body.height属性,size中的height、width将对应失效
2555
+ * 2. 可传 null 值,取消内置尺寸
2556
+ * ```
2557
+ */
2558
+ size?: "small" | "middle" | "large" | null;
2481
2559
  onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
2482
2560
  onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;
2483
2561
  onClose?: () => void;
@@ -2490,6 +2568,7 @@ export type FbaAppModalProps = Omit<ModalProps, "onOk" | "onCancel" | "getContai
2490
2568
  cancelButtonProps?: Omit<ButtonWrapperProps, "hidden" | "children" | "onClick">;
2491
2569
  /**
2492
2570
  * 设置modal body height 为当前窗口height的百分比,例如:30
2571
+ * @deprecated 已失效,可通过size属性设置
2493
2572
  * ```
2494
2573
  * 1. 最大值:80
2495
2574
  * 1. 设置bodyStyle.height 后,bodyHeightPercent失效
@@ -2617,6 +2696,48 @@ export declare const fbaUtils: {
2617
2696
  attachPropertiesToComponent: typeof attachPropertiesToComponent;
2618
2697
  getModelKey: () => string;
2619
2698
  };
2699
+ export type FileExportProps = {
2700
+ /** 触发节点 */
2701
+ action: (ReactElement & {
2702
+ onClick?: (e: any) => void;
2703
+ }) | ((data: {
2704
+ onClick: (e: any) => void;
2705
+ }) => ReactElement);
2706
+ /**
2707
+ * 获取文件流数据
2708
+ * ```
2709
+ * 1. fileName 文件名称
2710
+ * 2. data 文件流
2711
+ * ```
2712
+ */
2713
+ onRequest: () => Promise<{
2714
+ fileName: string;
2715
+ data: Blob;
2716
+ }>;
2717
+ /** 导出操作前 */
2718
+ onExportPre?: () => void;
2719
+ /** 导出操作后 */
2720
+ onExportNext?: () => void;
2721
+ /** 导出操作失败,隐藏默认失败效果 */
2722
+ onExportError?: (error?: any) => void;
2723
+ };
2724
+ /**
2725
+ * 文件导出
2726
+ * ```
2727
+ * demo:https://fex.qa.tcshuke.com/docs/admin/main/widget?key=file-export
2728
+ * 例如:
2729
+ <FileExport
2730
+ action={<Button>下载</Button>}
2731
+ onRequest={() => {
2732
+ return serviceHandle.fileExport('/export/file', {});
2733
+ }}
2734
+ onExportNext={() => {
2735
+ message.success('导出成功...');
2736
+ }}
2737
+ />
2738
+ * ```
2739
+ */
2740
+ export declare const FileExport: (props: FileExportProps) => import("react/jsx-runtime").JSX.Element;
2620
2741
  export type FileImportProps = {
2621
2742
  /** 上传文件接口返回处理 */
2622
2743
  onImportFinish: (data?: TAny) => void;
@@ -2628,9 +2749,19 @@ export type FileImportProps = {
2628
2749
  /**
2629
2750
  * 文件导入
2630
2751
  * ```
2631
- * 默认值:
2632
- * name: 'file',
2633
- * accept: '.xlsx,.xls',
2752
+ * demo:https://fex.qa.tcshuke.com/docs/admin/main/widget?key=file-export
2753
+ * 1. accept默认值 '.xlsx,.xls',
2754
+ * 2. formData 上传key默认值 file
2755
+ *
2756
+ * 例如:
2757
+ <FileImport
2758
+ action={'https://xxx/xxx/xx'}
2759
+ onImportFinish={(data) => {
2760
+ console.log('上传接口响应数据', data);
2761
+ }}
2762
+ >
2763
+ <Button>文件上传</Button>
2764
+ </FileImport>
2634
2765
  * ```
2635
2766
  */
2636
2767
  export declare const FileImport: {
@@ -2736,33 +2867,6 @@ export declare const FormGrid: {
2736
2867
  domTypeName: string;
2737
2868
  };
2738
2869
  };
2739
- export type FormItemHorizontalUnionProps = {
2740
- className?: string;
2741
- style?: CSSProperties;
2742
- label?: string | ReactElement;
2743
- groupConfigList: {
2744
- hidden?: boolean;
2745
- before?: ReactElement | string;
2746
- /**
2747
- * 设置宽度
2748
- * ```
2749
- * 1. 自适应可设置:auto
2750
- * 2. 可设置具体数值
2751
- * 3. 不设置会在铺满flex剩余空间
2752
- * 4. 多个未设置会等分铺满剩余空间
2753
- * ```
2754
- */
2755
- width?: number | string;
2756
- mainItem: ReactElement;
2757
- after?: ReactElement | string;
2758
- }[];
2759
- gap?: number;
2760
- flexLayoutStyle?: CSSProperties;
2761
- flexLayoutClassName?: string;
2762
- hidden?: boolean;
2763
- required?: boolean;
2764
- colon?: boolean;
2765
- };
2766
2870
  export type FormItemCardProps = {
2767
2871
  title?: string | ReactElement;
2768
2872
  children: ReactElement | ReactElement[];
@@ -2780,12 +2884,11 @@ export type FormItemHiddenProps = {
2780
2884
  export declare const FormItemHidden: (props: FormItemHiddenProps) => import("react/jsx-runtime").JSX.Element;
2781
2885
  export type FormItemTextServiceConfig = {
2782
2886
  onRequest: (params?: TAny) => Promise<TAny>;
2887
+ /** 接口参数,当params发生变化后,会主动发送查询请求 */
2783
2888
  params?: TPlainObject;
2784
2889
  /** 标记serviceConfig.params中无效参数,被设置的params key 不传入服务接口入参 */
2785
2890
  invalidParamKey?: string[];
2786
- /**
2787
- * 如果没有配置 render,返回结果会直接进行dom渲染,如果非string类型会进行JSON.stringify处理
2788
- */
2891
+ /** 如果没有配置 render,返回结果会直接进行dom渲染,如果非string类型会进行JSON.stringify处理 */
2789
2892
  onResponseAdapter?: (respData?: TAny, value?: TAny) => TAny;
2790
2893
  /** 必须参数key列表,与params配合使用 */
2791
2894
  requiredParamsKeys?: string[];
@@ -2797,6 +2900,12 @@ export type FormItemTextProps = FormItemWrapperProps & {
2797
2900
  render?: (value?: TAny) => ReactNode;
2798
2901
  /** 占位值,当 value 为 ''、undefined、null时显示 */
2799
2902
  placeholderValue?: string;
2903
+ /**
2904
+ * 发起服务调用显示数据,例如:数据为key,通过key查询text显示
2905
+ * ```
2906
+ * 1. 当serviceConfig.params发生变化后,会主动发送查询请求
2907
+ * ```
2908
+ */
2800
2909
  serviceConfig?: FormItemTextServiceConfig;
2801
2910
  };
2802
2911
  /**
@@ -2903,12 +3012,26 @@ export type FormListWrapperProps = {
2903
3012
  }) => ReactElement;
2904
3013
  /** FormList rules */
2905
3014
  rules?: FormListProps["rules"];
3015
+ /**
3016
+ * 设置FormList字段标题&必填标志
3017
+ * ```
3018
+ * demo: http://dev.flatjs.com:6007/pages/flat/oss-demo/main/form/list?env=me
3019
+ * 1. 会根据数组顺序进行渲染
3020
+ * ```
3021
+ */
3022
+ formListItemTitleList?: {
3023
+ title: string;
3024
+ required?: boolean;
3025
+ width?: number;
3026
+ }[];
3027
+ /** formListItemTitle HorizontalUnionProps 配置 */
3028
+ formListItemTitleHorizontalUnionProps?: Omit<FormItemHorizontalUnionProps, "groupConfigList">;
2906
3029
  };
2907
3030
  /**
2908
- * FormList
3031
+ * Form.List 包装组件,使用更简单
2909
3032
  * ```
3033
+ * Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list
2910
3034
  * 1. FormList数组中必须要有唯一值字段,默认值字段名称uid,可通过uidFieldName自定义设置
2911
- * 2. Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list
2912
3035
  * ```
2913
3036
  */
2914
3037
  export declare const FormListWrapper: (props: FormListWrapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -3194,16 +3317,15 @@ export type MetionEditorProps = Omit<MentionsWrapperProps, "prefix"> & {
3194
3317
  * 5. Demo: https://fex.qa.tcshuke.com/docs/admin/main/widget?key=mention-editor
3195
3318
  */
3196
3319
  export declare const MetionEditor: (props: MetionEditorProps) => import("react/jsx-runtime").JSX.Element;
3197
- export type onClick = (e?: React.MouseEvent<HTMLElement>) => void;
3198
3320
  export interface ModalActionProps {
3199
3321
  children: ReactElement | ((data: {
3200
3322
  onClose: () => void;
3201
3323
  open: boolean;
3202
3324
  }) => ReactElement);
3203
3325
  action?: (ReactElement & {
3204
- onClick?: onClick;
3326
+ onClick?: (e: any) => void;
3205
3327
  }) | ((data: {
3206
- onClick: onClick;
3328
+ onClick: (e: any) => void;
3207
3329
  onClose: () => void;
3208
3330
  open: boolean;
3209
3331
  }) => ReactElement);
@@ -3289,6 +3411,9 @@ export declare const Permission: (props: PermissionProps) => import("react/jsx-r
3289
3411
  * ```
3290
3412
  */
3291
3413
  export declare const preDefinedClassName: {
3414
+ /**
3415
+ * @deprecated,已过期,使用preDefinedClassName.getFormLayoutClassName(...)
3416
+ */
3292
3417
  form: {
3293
3418
  label_width_70: string;
3294
3419
  label_width_80: string;
@@ -3299,12 +3424,27 @@ export declare const preDefinedClassName: {
3299
3424
  label_width_130: string;
3300
3425
  label_width_140: string;
3301
3426
  label_width_150: string;
3302
- label_width_160: string;
3427
+ label_width_160: string; /**
3428
+ * 获取针对Form下全部label布局的预设className,包括
3429
+ * ```
3430
+ * 1. formLabel宽度
3431
+ * 2. formLabel对齐方式
3432
+ * 3. form label value的竖直布局
3433
+ * 4. formItem之间的间距
3434
+ * ```
3435
+ */
3303
3436
  label_width_170: string;
3304
3437
  label_width_180: string;
3305
3438
  label_width_190: string;
3306
3439
  label_width_200: string;
3307
- label_width_auto: string;
3440
+ label_width_auto: string; /**
3441
+ * 获取针对单个FormItem label布局的预设className,包括
3442
+ * ```
3443
+ * 1. formLabel宽度
3444
+ * 2. formLabel对齐方式
3445
+ * 3. form label value的竖直布局
3446
+ * ```
3447
+ */
3308
3448
  label_align_left: string;
3309
3449
  label_align_right: string;
3310
3450
  label_value_vertical: string;
@@ -3313,6 +3453,9 @@ export declare const preDefinedClassName: {
3313
3453
  formItemGap5: string;
3314
3454
  formItemGap0: string;
3315
3455
  };
3456
+ /**
3457
+ * @deprecated 已过期,使用preDefinedClassName.getFormItemLayoutClassName(...)
3458
+ */
3316
3459
  formItem: {
3317
3460
  label_width_70: string;
3318
3461
  label_width_80: string;
@@ -3333,6 +3476,25 @@ export declare const preDefinedClassName: {
3333
3476
  label_align_right: string;
3334
3477
  label_value_vertical: string;
3335
3478
  };
3479
+ /**
3480
+ * 获取针对Form下全部label布局的预设className,包括
3481
+ * ```
3482
+ * 1. formLabel宽度
3483
+ * 2. formLabel对齐方式
3484
+ * 3. form label value的竖直布局
3485
+ * 4. formItem之间的间距
3486
+ * ```
3487
+ */
3488
+ getFormLayoutClassName: (props: TFormLayoutPreClassNameProps) => string;
3489
+ /**
3490
+ * 获取针对单个FormItem label布局的预设className,包括
3491
+ * ```
3492
+ * 1. formLabel宽度
3493
+ * 2. formLabel对齐方式
3494
+ * 3. form label value的竖直布局
3495
+ * ```
3496
+ */
3497
+ getFormItemLayoutClassName: (props: TFormItemLayoutPreClassNameProps) => string;
3336
3498
  };
3337
3499
  export type RadioGroupWrapperValue = string | number | boolean;
3338
3500
  export type RadioGroupWrapperOptionItem = {
@@ -3409,10 +3571,11 @@ export type TRelationTreeOperate = {
3409
3571
  };
3410
3572
  export declare const RelationTree: (props: RelationTreeProps) => import("react/jsx-runtime").JSX.Element;
3411
3573
  export interface RichTextEditorProps extends Omit<IAllProps, "onChange" | "init"> {
3574
+ /** 设置高度,默认:500 */
3575
+ height?: number;
3412
3576
  onChange?: (data?: string) => void;
3413
3577
  /** 上传图片服务 */
3414
3578
  onUploadImage?: (file: File) => Promise<string>;
3415
- className?: string;
3416
3579
  /** 图片点击预览 */
3417
3580
  imgPreview?: boolean;
3418
3581
  init?: IAllProps["init"] & {
@@ -3445,22 +3608,22 @@ export interface RichTextEditorProps extends Omit<IAllProps, "onChange" | "init"
3445
3608
  };
3446
3609
  /** 点击全屏按钮回调 */
3447
3610
  onFullScreenChange?: (state?: boolean) => void;
3611
+ className?: string;
3448
3612
  }
3449
3613
  /**
3450
3614
  * 富文本编辑器,配置参考tinymce https://www.tiny.cloud/docs/tinymce/6
3451
3615
  * @param props
3452
3616
  * @returns
3453
3617
  * ```
3454
- * 1. 修改高度 init={{ height: 300 }}
3455
- * 2. 如果需要粘贴上传图片服务,需要提供 onUploadImage 上传图片接口
3456
- * 3. 获取富文本实例,通过onInit(_, editor)函数获取
3457
- * 4. 预览富文本数据,使用 RichTextViewer 组件
3458
- * 5. 添加其他插件使用方式,配置 init.plugins_append、init.toolbar_append
3618
+ * 1. 如果需要粘贴上传图片服务,需要提供 onUploadImage 上传图片接口
3619
+ * 2. 获取富文本实例,通过onInit(_, editor)函数获取
3620
+ * 3. 预览富文本数据,使用 RichTextViewer 组件
3621
+ * 4. 添加其他插件使用方式,配置 init.plugins_append、init.toolbar_append
3459
3622
  * <RichTextEditor init={{ plugins_append: 'codesample', toolbar_append: 'codesample' }} />
3460
- * 6. 可通过设置 init.plugins、init.toolbar 完全自定义插件、工具栏
3461
- * 7. 其他插件
3623
+ * 5. 可通过设置 init.plugins、init.toolbar 完全自定义插件、工具栏
3624
+ * 6. 其他插件
3462
3625
  * emoticons 表情插件
3463
- * 8. 可通过设置 init.img_ratio 设置通过粘贴上传的图片压缩显示比例
3626
+ * 7. 可通过设置 init.img_ratio 设置通过粘贴上传的图片压缩显示比例
3464
3627
  * 默认比例:[{ min: 0, max: 1000, ratio: 0.5 }, { min: 1000, ratio: 0.3 }]
3465
3628
  * ```
3466
3629
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/antd",
3
- "version": "4.4.13",
3
+ "version": "4.4.15",
4
4
  "description": "flat-biz ui components",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",