zy-react-library 1.0.25 → 1.0.27

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.
@@ -11,9 +11,9 @@ export interface CustomRenderProps {
11
11
  /** 表单当前值 */
12
12
  formValues: FormValues;
13
13
  /** 字段值 */
14
- value: any;
14
+ value?: any;
15
15
  /** 值变化回调 */
16
- onChange: (value: any) => void;
16
+ onChange?: (value: any) => void;
17
17
  /** 其他属性 */
18
18
  [key: string]: any;
19
19
  }
@@ -297,38 +297,40 @@ const FormItemsRenderer = ({
297
297
  return (
298
298
  option.customizeRender
299
299
  ? (renderFormControl(option))
300
- : (
301
- <Col key={option.name || index} span={itemSpan} style={style}>
302
- <Form.Item
303
- noStyle
304
- shouldUpdate={option.shouldUpdate ?? option?.componentProps?.shouldUpdate}
305
- dependencies={option.dependencies || option?.componentProps?.dependencies}
306
- >
307
- {() => {
308
- // 支持动态计算 hidden
309
- const hidden = typeof option.hidden === "function"
310
- ? option.hidden(getFormValues())
311
- : (option.hidden ?? false);
312
-
313
- if (hidden)
314
- return null;
315
-
316
- return (
317
- <Form.Item
318
- name={option.name}
319
- label={renderLabel(option)}
320
- rules={getRules(option)}
321
- labelCol={itemLabelCol}
322
- wrapperCol={itemWrapperCol}
323
- {...getFormItemProps(option)}
324
- >
325
- {renderFormControl(option)}
326
- </Form.Item>
327
- );
328
- }}
329
- </Form.Item>
330
- </Col>
331
- )
300
+ : (() => {
301
+ // 支持动态计算 hidden
302
+ const hidden = typeof option.hidden === "function"
303
+ ? option.hidden(getFormValues())
304
+ : (option.hidden ?? false);
305
+
306
+ if (hidden)
307
+ return null;
308
+
309
+ return (
310
+ <Col key={option.name || index} span={itemSpan} style={style}>
311
+ <Form.Item
312
+ noStyle
313
+ shouldUpdate={option.shouldUpdate ?? option?.componentProps?.shouldUpdate}
314
+ dependencies={option.dependencies || option?.componentProps?.dependencies}
315
+ >
316
+ {() => {
317
+ return (
318
+ <Form.Item
319
+ name={option.name}
320
+ label={renderLabel(option)}
321
+ rules={getRules(option)}
322
+ labelCol={itemLabelCol}
323
+ wrapperCol={itemWrapperCol}
324
+ {...getFormItemProps(option)}
325
+ >
326
+ {renderFormControl(option)}
327
+ </Form.Item>
328
+ );
329
+ }}
330
+ </Form.Item>
331
+ </Col>
332
+ );
333
+ })()
332
334
  );
333
335
  }
334
336
 
@@ -75,7 +75,7 @@ const ImportFile = (props) => {
75
75
  >
76
76
  {children && typeof children === "function" ? children({ form }) : children}
77
77
  <Form.Item label="附件" name="file" rules={[{ required: true, message: "附件不能为空" }]}>
78
- <Upload accept=".xls,.xlsx" />
78
+ <Upload accept=".xls,.xlsx" listType="text" />
79
79
  </Form.Item>
80
80
  </Form>
81
81
  </Modal>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.25",
4
+ "version": "1.0.27",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",