@flatbiz/antd 3.1.1 → 3.1.3

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
@@ -2,7 +2,7 @@
2
2
  /// <reference types="scheduler" />
3
3
 
4
4
  import { API, ModelType } from '@dimjs/model';
5
- import { ButtonProps, CascaderProps, DrawerProps, DropdownProps, FormInstance, FormItemProps, InputNumberProps, InputProps, ModalProps, PopconfirmProps, RadioGroupProps, RowProps, SelectProps, SpaceProps, TableProps, TimePickerProps, TimeRangePickerProps, TreeProps, TreeSelectProps, UploadProps } from 'antd';
5
+ import { ButtonProps, CascaderProps, DrawerProps, DropdownProps, FormInstance, FormItemProps, InputNumberProps, InputProps, ModalProps, PopconfirmProps, RadioGroupProps, RowProps, SelectProps, SpaceProps, SwitchProps, TableProps, TimePickerProps, TimeRangePickerProps, TooltipProps, TreeProps, TreeSelectProps, UploadProps } from 'antd';
6
6
  import { CheckboxGroupProps } from 'antd/lib/checkbox';
7
7
  import { ConfigProviderProps } from 'antd/lib/config-provider';
8
8
  import { PickerDateProps, RangePickerDateProps } from 'antd/lib/date-picker/generatePicker';
@@ -937,6 +937,8 @@ export declare type FormItemHorizontalUnionProps = {
937
937
  }[];
938
938
  gap?: number;
939
939
  flexLayoutStyle?: CSSProperties;
940
+ hidden?: boolean;
941
+ required?: boolean;
940
942
  };
941
943
  export declare type FormItemCardProps = {
942
944
  title?: string | ReactElement;
@@ -1219,31 +1221,53 @@ export declare type RelationProps = {
1219
1221
  /** 缩进宽度,配合【RelationGroup】使用 */
1220
1222
  indentWidth?: number;
1221
1223
  /** 连接线上Tag文案 */
1222
- tagText: string;
1224
+ tagName?: string;
1223
1225
  /** 连接线上Tag颜色 */
1224
1226
  tagColor?: string;
1225
1227
  /** 连接线上Tag宽度 */
1226
1228
  tagWidth?: number;
1227
1229
  /** 连接线上Tag点击事件 */
1228
- onTagClick?: (tagText: string) => void;
1230
+ onTagClick?: (tagName?: string) => void;
1229
1231
  /**连接线颜色 */
1230
1232
  lineColor?: string;
1231
- children: ReactElement | null | Array<ReactElement | null>;
1233
+ solt1: () => ReactElement;
1234
+ solt2?: () => ReactElement | null;
1232
1235
  className?: string;
1236
+ onlyOne?: boolean;
1237
+ onlyNoMainOne?: boolean;
1238
+ label?: string;
1233
1239
  };
1234
- export declare const Relation: (props: RelationProps) => JSX.Element;
1235
- export declare type RelationGroupProps = {
1236
- children: ReactElement | null | Array<ReactElement | null>;
1240
+ export declare type RelationTreeProps = {
1237
1241
  className?: string;
1238
- style?: CSSProperties;
1242
+ dataSource?: TRelationTreeData;
1243
+ children: (data: TRelationTreeCustomData, operate: TRelationTreeOperate, extraData?: TPlainObject) => ReactElement;
1244
+ onChange?: (dataSource?: TRelationTreeData) => void;
1245
+ relationProps?: Pick<RelationProps, "tagLineWidth" | "indentWidth" | "tagColor" | "tagWidth" | "lineColor">;
1246
+ onTagClick?: (uid: string, extraData?: TPlainObject) => void;
1239
1247
  };
1240
- export declare const RelationGroup: (props: RelationGroupProps) => JSX.Element;
1241
- export declare type RelationItemProps = {
1242
- children: ReactElement | null | Array<ReactElement | null>;
1243
- className?: string;
1244
- style?: CSSProperties;
1248
+ export declare type TRelationTreeCustomData = TPlainObject & {
1249
+ uid: string;
1250
+ };
1251
+ export declare type TRelationTreeRelationItem = {
1252
+ uid: string;
1253
+ customData?: TRelationTreeCustomData;
1254
+ children?: TRelationTreeData[];
1255
+ extraData?: TPlainObject;
1245
1256
  };
1246
- export declare const RelationItem: (props: RelationItemProps) => JSX.Element;
1257
+ export declare type TRelationTreeData = {
1258
+ uid: string;
1259
+ tagName: string;
1260
+ label?: string;
1261
+ relationList: TRelationTreeRelationItem[];
1262
+ extraData?: TPlainObject;
1263
+ };
1264
+ export declare type TRelationTreeOperate = {
1265
+ add: (soruceData: TRelationTreeCustomData, initialData: TRelationTreeRelationItem) => void;
1266
+ addChildren: (soruceData: TRelationTreeCustomData, initialData: TRelationTreeData) => void;
1267
+ remove: (uid: string) => void;
1268
+ onChange: (name: string, value: any) => void;
1269
+ };
1270
+ export declare const RelationTree: (props: RelationTreeProps) => JSX.Element;
1247
1271
  export declare type SimpleLayoutProps = {
1248
1272
  className?: string;
1249
1273
  style?: CSSProperties;
@@ -1290,6 +1314,29 @@ export interface SmsCountDownProps {
1290
1314
  className?: string;
1291
1315
  }
1292
1316
  export declare const SmsCountDown: FC<SmsCountDownProps>;
1317
+ export declare type SwitchWrapperValue = string | number | boolean;
1318
+ export declare type SwitchWrapperProps = Omit<SwitchProps, "checked" | "defaultChecked" | "onChange"> & {
1319
+ value?: SwitchWrapperValue;
1320
+ checkedValue: SwitchWrapperValue;
1321
+ unCheckedValue: SwitchWrapperValue;
1322
+ onChange?: (value: SwitchWrapperValue) => void;
1323
+ tooltipProps?: Omit<TooltipProps, "title">;
1324
+ tooltipTitle?: string | ((value?: SwitchWrapperValue) => string | undefined);
1325
+ };
1326
+ /**
1327
+ * 解决Switch 和 Form.Item 使用只能接收boolean的限制
1328
+ * ```
1329
+ * 1. value 为状态值,不局限于boolean,可以为 [string | number | boolean]
1330
+ * 2. checkedValue 选中值
1331
+ * 3. unCheckedValue 未选中值
1332
+ * 4. 与 Form.Item 组合使用最佳
1333
+ * <Form.Item name="fieldName" >
1334
+ * <SwitchWrapper checkedValue={2} unCheckedValue={1} />
1335
+ * </Form.Item>
1336
+ * 5. 可设置tooltip效果数据显示
1337
+ * ```
1338
+ */
1339
+ export declare const SwitchWrapper: (props: SwitchWrapperProps) => JSX.Element;
1293
1340
  export declare type TTagItem = {
1294
1341
  label: string;
1295
1342
  value: string | number | boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/antd",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "flat-biz oss ui components",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -34,7 +34,6 @@
34
34
  "@flatbiz/utils": ">=3.0.15",
35
35
  "@wove/react": ">=1.2.22",
36
36
  "antd": ">=4.22.2",
37
- "dequal": ">=2.0.3",
38
37
  "moment": ">=2.29.4",
39
38
  "react": ">=18.2.0",
40
39
  "react-dom": ">=18.2.0"
@@ -45,7 +44,7 @@
45
44
  "@dimjs/model": "^1.1.8",
46
45
  "@dimjs/model-react": "^1.1.8",
47
46
  "@dimjs/utils": "^1.2.23",
48
- "@flatbiz/utils": "^3.0.16",
47
+ "@flatbiz/utils": "^3.1.3",
49
48
  "@wove/react": "^1.2.21",
50
49
  "antd": "4.22.2",
51
50
  "dequal": "^2.0.3",
@@ -53,5 +52,5 @@
53
52
  "react": "18.2.0",
54
53
  "react-dom": "18.2.0"
55
54
  },
56
- "gitHead": "4378d433b73ee28fd7cb4c64bed8571f993eb5a9"
55
+ "gitHead": "693ba32a0a7ef4021c089b486d0efec1e3772e81"
57
56
  }