lu-lowcode-package-form 0.10.44 → 0.10.46
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +234 -234
- package/dist/index.es.js +17084 -17082
- package/package.json +1 -1
- package/src/App.jsx +3 -2
- package/src/components/field/table/index.jsx +1 -1
- package/src/components/form-container/index.jsx +3 -1
package/package.json
CHANGED
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
|
-
|
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=
|
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]}>
|