lu-lowcode-package-form 0.10.44 → 0.10.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.10.44",
3
+ "version": "0.10.46",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@dnd-kit/core": "^6.1.0",
package/src/App.jsx CHANGED
@@ -107,7 +107,8 @@ function App() {
107
107
  // formRef?.current?.setFieldsValue({"tianchong1":{"label":"选项1","value":"1"}, })
108
108
  }
109
109
  const handleCols = () => {
110
- setCols(cols - 1)
110
+
111
+ setCols(cols == 1 ? 3 : cols - 1)
111
112
  }
112
113
 
113
114
  const [items, setItems] = useState(['Item 1', 'Item 2', 'Item 3', 'Item 4']);
@@ -260,7 +261,7 @@ function App() {
260
261
  <Field.Number label="测试规则" isRequired={true} __id="ceshi_rule1" />
261
262
  </Layout.FormRow>
262
263
  <Layout.FormRow layout={'1'}>
263
- <Field.Table label="子表格" __id="table2" >
264
+ <Field.Table label="子表格" __id="table2" isAllowCopy={true} >
264
265
  <Field.Number label="测试规则2" __id="ceshi_rule2" />
265
266
  </Field.Table>
266
267
  </Layout.FormRow>
@@ -30,7 +30,7 @@ const TableCol = ({ children, width, hidden, ...props }) => {
30
30
  </div>
31
31
  }
32
32
 
33
- const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow, form, fieldName, initializeFormRender, recordFieldsChange, mode, isAllowCopy=true, isAllowAdd=true, ...props }) => {
33
+ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow, form, fieldName, initializeFormRender, recordFieldsChange, mode, isAllowCopy=false, isAllowAdd=true, ...props }) => {
34
34
  useEffect(() => {
35
35
  // console.log("Table form reload", form)
36
36
  }, [form])
@@ -68,8 +68,9 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
68
68
  initializeDependencyMap();
69
69
  setFormContent(renderChildren());
70
70
  }, 300),
71
- []
71
+ [children, cols]
72
72
  );
73
+
73
74
 
74
75
  useEffect(() => {
75
76
  throttledInitializeFormRender();
@@ -491,6 +492,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
491
492
  }),
492
493
  cols
493
494
  );
495
+
494
496
 
495
497
  return groupedChildren.map((group, index) => (
496
498
  <Row key={`row-${index}`} gutter={[24, 24]}>