@flatbiz/antd 4.0.19 → 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;
@@ -1507,27 +1567,22 @@ export type SwitchWrapperProps = Omit<SwitchProps, "checked" | "defaultChecked"
1507
1567
  * ```
1508
1568
  */
1509
1569
  export declare const SwitchWrapper: (props: SwitchWrapperProps) => JSX.Element;
1510
- export type TagWrapperValue = string | number | boolean;
1511
- export type TagWrapperDataItem = {
1570
+ export type TagListSelectValue = string | number | boolean;
1571
+ export type TagListSelectDataItem = {
1512
1572
  label: string;
1513
- value: TagWrapperValue;
1573
+ value: TagListSelectValue;
1514
1574
  color?: string;
1515
1575
  };
1516
- export type TagWrapperColorItem = {
1517
- label: string;
1518
- value: TagWrapperValue;
1519
- };
1520
- export type TagWrapperProps = {
1521
- dataList: TagWrapperDataItem[];
1522
- /**
1523
- * 颜色配置数据,value为code、label为色值,例如:{ 1:'red', 2: 'blue'}
1524
- */
1576
+ export type TagListSelectProps = {
1577
+ dataList: TagListSelectDataItem[];
1578
+ /** 颜色配置数据,例如:{ 1:'red', 2: 'blue'} key值与 dataList中value相同 */
1525
1579
  colorMap?: Record<string, string>;
1526
- value?: TagWrapperValue;
1580
+ value?: TagListSelectValue;
1581
+ /** 是否强制匹配,默认值false */
1527
1582
  forceMatch?: boolean;
1528
1583
  };
1529
1584
  /**
1530
- * 通过配置显示Tag效果
1585
+ * 在列表数据中通过value匹配数据,以Tag形式展示
1531
1586
  * @param props
1532
1587
  * @returns
1533
1588
  * ```
@@ -1537,7 +1592,7 @@ export type TagWrapperProps = {
1537
1592
  * 2. value 与 dataList中label、value任一相等,都可匹配
1538
1593
  *
1539
1594
  * 用法1:
1540
- * <TagWrapper
1595
+ * <TagListSelect
1541
1596
  * dataList=[{ label: '启用', value: 1 }]
1542
1597
  * colorMap={{ 1:'red', 2: 'blue'}}
1543
1598
  * value={1} />
@@ -1545,14 +1600,14 @@ export type TagWrapperProps = {
1545
1600
  * <Tag color={'red'}>启用</Tag>
1546
1601
  *
1547
1602
  * 用法2
1548
- * <TagWrapper
1603
+ * <TagListSelect
1549
1604
  * dataList=[{ label: '启用', value: 1. color: 'red' }]
1550
1605
  * value="启用" />
1551
1606
  * =>
1552
1607
  * <Tag color={'red'}>启用</Tag>
1553
1608
  * ```
1554
1609
  */
1555
- export declare const TagWrapper: FC<TagWrapperProps>;
1610
+ export declare const TagListSelect: FC<TagListSelectProps>;
1556
1611
  export type TableColumnIconRenderProps = {
1557
1612
  /** 额外内容 */
1558
1613
  extra: ReactElement;
@@ -1623,7 +1678,7 @@ export declare const tableCellRender: {
1623
1678
  * tableCellRender.selectorCell([{ label: '已开启', value: 1 }], { 1: '#108ee9' })
1624
1679
  * ```
1625
1680
  */
1626
- 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;
1627
1682
  /**
1628
1683
  * 单元格对象数据处理,支持多级处理
1629
1684
  * ```
@@ -1662,6 +1717,23 @@ export type TabsWrapperProps = TabsProps & {
1662
1717
  * ```
1663
1718
  */
1664
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>;
1665
1737
  export type TimePickerWrapperProps = Omit<TimePickerProps, "value" | "onChange" | "format"> & {
1666
1738
  value?: string;
1667
1739
  onChange?: (value?: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/antd",
3
- "version": "4.0.19",
3
+ "version": "4.0.20",
4
4
  "description": "flat-biz oss ui components",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",