zy-react-library 1.0.49 → 1.0.51

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.
@@ -4,26 +4,12 @@ import type { NamePath } from "rc-field-form/lib/interface";
4
4
  import type { FC, ReactNode } from "react";
5
5
  import type { FORM_ITEM_RENDER_ENUM } from "../../enum/formItemRender";
6
6
 
7
- /**
8
- * 自定义渲染组件的属性
9
- */
10
- export interface CustomRenderProps {
11
- /** 表单当前值 */
12
- formValues: FormValues;
13
- /** 字段值 */
14
- value?: any;
15
- /** 值变化回调 */
16
- onChange?: (value: any) => void;
17
- /** 其他属性 */
18
- [key: string]: any;
19
- }
20
-
21
7
  /**
22
8
  * 表单项渲染类型
23
9
  */
24
10
  export type FormItemRenderType
25
11
  = | (typeof FORM_ITEM_RENDER_ENUM)[keyof typeof FORM_ITEM_RENDER_ENUM]
26
- | ((props: CustomRenderProps) => ReactNode);
12
+ | ReactNode;
27
13
 
28
14
  /**
29
15
  * 选项项数据类型
@@ -245,15 +245,7 @@ const FormItemsRenderer = ({
245
245
  return null;
246
246
 
247
247
  default:
248
- // 支持传入自定义组件
249
- if (typeof render === "function" || typeof render === "object") {
250
- const CustomComponent = render;
251
- if (typeof render === "function")
252
- return <CustomComponent {...componentProps} formValues={getFormValues()} />;
253
- if (typeof render === "object")
254
- return <CustomComponent {...componentProps} />;
255
- }
256
- return <Input placeholder={placeholder} {...componentProps} />;
248
+ return render;
257
249
  }
258
250
  };
259
251
 
@@ -11,7 +11,6 @@ function SelectCreate(props) {
11
11
  label = "",
12
12
  maxCount = 1,
13
13
  onDelete,
14
- formValues,
15
14
  ...restProps
16
15
  } = props;
17
16
 
@@ -20,7 +20,6 @@ const Upload = (props) => {
20
20
  tipContent,
21
21
  uploadButtonText: externalUploadButtonText,
22
22
  fileType: externalFileType,
23
- formValues,
24
23
  ...restProps
25
24
  } = props;
26
25
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.49",
4
+ "version": "1.0.51",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",