@flatbiz/antd 4.0.18 → 4.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -518,6 +518,18 @@ export interface DropdownMenuWrapperProps extends Omit<DropdownProps, "menu"> {
518
518
  export declare const DropdownMenuWrapper: (props: DropdownMenuWrapperProps) => JSX.Element;
519
519
  export type EasyTableServiceConfig = {
520
520
  onRequest: (params?: TPlainObject) => Promise<TPlainObject>;
521
+ requestParamsAdapter?: (params: TPlainObject) => TPlainObject;
522
+ /**
523
+ * 接口相应数据处理
524
+ * @param params
525
+ * ```
526
+ * 返回数据为对象,包含两个字段
527
+ * 1. 表格列表数据-Array
528
+ * 2. 表格条数总数-Number
529
+ * 其中 字段key 命名会通过 fieldNames 进行转义
530
+ * ```
531
+ */
532
+ requestResultAdapter?: (params: TAny) => TPlainObject;
521
533
  };
522
534
  export type EasyTableRefApi = {
523
535
  onRequest: (params?: TPlainObject) => void;
@@ -670,6 +682,45 @@ export type EasyTableTableProps = Omit<TableProps<TAny>, "dataSource" | "loading
670
682
  * ```
671
683
  */
672
684
  export declare const EasyTableTable: (props: EasyTableTableProps) => JSX.Element;
685
+ export interface EditableFieldProps {
686
+ editRender: ReactElement | ((data: {
687
+ value?: TAny;
688
+ onChange?: (data?: TAny) => void;
689
+ }) => ReactElement);
690
+ viewRender?: (value?: TAny) => ReactNode;
691
+ value?: TAny;
692
+ onChange?: (data?: TAny) => void;
693
+ placeholderValue?: string;
694
+ className?: string;
695
+ /** edit 区域是否铺满,editableIcon=false 无效 */
696
+ isEditFull?: boolean;
697
+ /** 是否可编辑 */
698
+ editable?: boolean;
699
+ /** 是否显示编辑操作icon,默认值:true */
700
+ editableIcon?: boolean;
701
+ }
702
+ /**
703
+ * 可编辑字段组件
704
+ * @param props
705
+ * @returns
706
+ * ```
707
+ * 字段渲染有两种状态
708
+ * 1. 只读:如果value类型为复杂格式,必须要通过【viewRender】来进行处理操作,转成简单数据类型
709
+ * 2. 编辑:FormItem value的格式要求必须满足编辑组件入参value要求
710
+ * ```
711
+ */
712
+ export declare const EditableField: (props: EditableFieldProps) => any;
713
+ export interface EditableFieldProviderProps {
714
+ children: ReactElement;
715
+ editable?: boolean;
716
+ editableIcon?: boolean;
717
+ }
718
+ /**
719
+ * EditableField组件
720
+ * @param props
721
+ * @returns
722
+ */
723
+ export declare const EditableFieldProvider: (props: EditableFieldProviderProps) => JSX.Element;
673
724
  export type SelectorWrapperValue = string | number | Array<string | number> | TPlainObject<string | number> | Array<TPlainObject<string | number>>;
674
725
  export type SelectorServiceConfig = {
675
726
  params?: TPlainObject;
@@ -1059,6 +1110,15 @@ export declare const FormItemGroup: {
1059
1110
  HorizontalUnion: (props: FormItemHorizontalUnionProps) => JSX.Element;
1060
1111
  Card: import("react").FC<FormItemCardProps>;
1061
1112
  };
1113
+ export interface FormItemWrapperProps extends FormItemProps {
1114
+ wrapper?: (children: ReactNode) => ReactElement;
1115
+ }
1116
+ /**
1117
+ * 对 Form.Item 的 children 增加 before、after
1118
+ * @param props
1119
+ * @returns
1120
+ */
1121
+ export declare const FormItemWrapper: (props: FormItemWrapperProps) => JSX.Element;
1062
1122
  export type GapProps = {
1063
1123
  height?: number;
1064
1124
  width?: number;
@@ -1151,6 +1211,31 @@ export type LabelValueLayoutProps = {
1151
1211
  bordered?: boolean;
1152
1212
  };
1153
1213
  export declare const LabelValueLayout: (props: LabelValueLayoutProps) => JSX.Element;
1214
+ export type onClick = (e?: React.MouseEvent<HTMLElement>) => void;
1215
+ export interface ModalActionProps {
1216
+ children: ReactElement | ((data: {
1217
+ onClose: () => void;
1218
+ open: boolean;
1219
+ }) => ReactElement);
1220
+ action?: (ReactElement & {
1221
+ onClick?: onClick;
1222
+ }) | ((data: {
1223
+ onClick: onClick;
1224
+ onClose: () => void;
1225
+ open: boolean;
1226
+ }) => ReactElement);
1227
+ }
1228
+ /**
1229
+ * 弹框 触发器
1230
+ * ```
1231
+ * <ModalAction action={<Button type="primary">打开</Button>}>
1232
+ * {({ onClose }) => (
1233
+ * <Modal onOk={onClose}>xxx</Modal>
1234
+ * )}
1235
+ * </ModalAction>
1236
+ * ```
1237
+ */
1238
+ export declare const ModalAction: (props: ModalActionProps) => JSX.Element;
1154
1239
  export interface ModalStateType {
1155
1240
  title?: string;
1156
1241
  /**
@@ -1482,27 +1567,22 @@ export type SwitchWrapperProps = Omit<SwitchProps, "checked" | "defaultChecked"
1482
1567
  * ```
1483
1568
  */
1484
1569
  export declare const SwitchWrapper: (props: SwitchWrapperProps) => JSX.Element;
1485
- export type TagWrapperValue = string | number | boolean;
1486
- export type TagWrapperDataItem = {
1570
+ export type TagListSelectValue = string | number | boolean;
1571
+ export type TagListSelectDataItem = {
1487
1572
  label: string;
1488
- value: TagWrapperValue;
1573
+ value: TagListSelectValue;
1489
1574
  color?: string;
1490
1575
  };
1491
- export type TagWrapperColorItem = {
1492
- label: string;
1493
- value: TagWrapperValue;
1494
- };
1495
- export type TagWrapperProps = {
1496
- dataList: TagWrapperDataItem[];
1497
- /**
1498
- * 颜色配置数据,value为code、label为色值,例如:{ 1:'red', 2: 'blue'}
1499
- */
1576
+ export type TagListSelectProps = {
1577
+ dataList: TagListSelectDataItem[];
1578
+ /** 颜色配置数据,例如:{ 1:'red', 2: 'blue'} key值与 dataList中value相同 */
1500
1579
  colorMap?: Record<string, string>;
1501
- value?: TagWrapperValue;
1580
+ value?: TagListSelectValue;
1581
+ /** 是否强制匹配,默认值false */
1502
1582
  forceMatch?: boolean;
1503
1583
  };
1504
1584
  /**
1505
- * 通过配置显示Tag效果
1585
+ * 在列表数据中通过value匹配数据,以Tag形式展示
1506
1586
  * @param props
1507
1587
  * @returns
1508
1588
  * ```
@@ -1512,7 +1592,7 @@ export type TagWrapperProps = {
1512
1592
  * 2. value 与 dataList中label、value任一相等,都可匹配
1513
1593
  *
1514
1594
  * 用法1:
1515
- * <TagWrapper
1595
+ * <TagListSelect
1516
1596
  * dataList=[{ label: '启用', value: 1 }]
1517
1597
  * colorMap={{ 1:'red', 2: 'blue'}}
1518
1598
  * value={1} />
@@ -1520,14 +1600,14 @@ export type TagWrapperProps = {
1520
1600
  * <Tag color={'red'}>启用</Tag>
1521
1601
  *
1522
1602
  * 用法2
1523
- * <TagWrapper
1603
+ * <TagListSelect
1524
1604
  * dataList=[{ label: '启用', value: 1. color: 'red' }]
1525
1605
  * value="启用" />
1526
1606
  * =>
1527
1607
  * <Tag color={'red'}>启用</Tag>
1528
1608
  * ```
1529
1609
  */
1530
- export declare const TagWrapper: FC<TagWrapperProps>;
1610
+ export declare const TagListSelect: FC<TagListSelectProps>;
1531
1611
  export type TableColumnIconRenderProps = {
1532
1612
  /** 额外内容 */
1533
1613
  extra: ReactElement;
@@ -1598,7 +1678,7 @@ export declare const tableCellRender: {
1598
1678
  * tableCellRender.selectorCell([{ label: '已开启', value: 1 }], { 1: '#108ee9' })
1599
1679
  * ```
1600
1680
  */
1601
- selectorCell: (selectorList: TagWrapperProps["dataList"], colorMap?: TagWrapperProps["colorMap"]) => (value: string | number) => JSX.Element;
1681
+ selectorCell: (selectorList: TagListSelectProps["dataList"], colorMap?: TagListSelectProps["colorMap"]) => (value: string | number) => JSX.Element;
1602
1682
  /**
1603
1683
  * 单元格对象数据处理,支持多级处理
1604
1684
  * ```
@@ -1637,6 +1717,23 @@ export type TabsWrapperProps = TabsProps & {
1637
1717
  * ```
1638
1718
  */
1639
1719
  export declare const TabsWrapper: (props: TabsWrapperProps) => JSX.Element;
1720
+ export type TagGroupDataItem = {
1721
+ label: string;
1722
+ value: string | number;
1723
+ color?: string;
1724
+ };
1725
+ export type TagGroupProps = {
1726
+ dataList: TagGroupDataItem[];
1727
+ /**
1728
+ * 颜色配置数据,例如:{ 1:'red', 2: 'blue'} key值与 dataList中value相同
1729
+ */
1730
+ colorMap?: Record<string, string>;
1731
+ spaceProps?: SpaceProps;
1732
+ };
1733
+ /**
1734
+ * Tag 列表显示
1735
+ */
1736
+ export declare const TagGroup: FC<TagGroupProps>;
1640
1737
  export type TimePickerWrapperProps = Omit<TimePickerProps, "value" | "onChange" | "format"> & {
1641
1738
  value?: string;
1642
1739
  onChange?: (value?: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/antd",
3
- "version": "4.0.18",
3
+ "version": "4.0.20",
4
4
  "description": "flat-biz oss ui components",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",