lu-lowcode-package-form 0.11.22 → 0.11.23
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/dist/index.cjs.js +151 -151
- package/dist/index.es.js +6696 -6678
- package/package.json +1 -1
- package/src/components/field/table/index.jsx +12 -2
package/package.json
CHANGED
@@ -21,6 +21,14 @@ const TableAction = ({ label, subTableIndex, children, subTableHead = false, ...
|
|
21
21
|
</div>
|
22
22
|
}
|
23
23
|
|
24
|
+
const RowID = ({value,onChange,...props}) => {
|
25
|
+
useEffect(() => {
|
26
|
+
if (!value) onChange(nanoid())
|
27
|
+
}, [value])
|
28
|
+
return (
|
29
|
+
<Input {...props} value={value} onChange={onChange} hidden={true} />
|
30
|
+
)
|
31
|
+
}
|
24
32
|
|
25
33
|
const TableCol = ({ children, width, hidden, ...props }) => {
|
26
34
|
const [sWidth, setSWidth] = useState(0);
|
@@ -100,7 +108,9 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
|
|
100
108
|
</div>}
|
101
109
|
{fields.map((field, index) => (
|
102
110
|
<div key={`${tableId}.${field.key}`} className=" fflex flex-nowrap fmin-w-full ">
|
103
|
-
|
111
|
+
<Form.Item hidden={true} name={[field.name, "__id"]}>
|
112
|
+
<RowID />
|
113
|
+
</Form.Item>
|
104
114
|
{React.Children.map(children, (child, childIndex) => {
|
105
115
|
let { props } = child;
|
106
116
|
const col_id = child?.props?.componentId || child?.props?.__id || childIndex;
|
@@ -224,7 +234,7 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
|
|
224
234
|
))}
|
225
235
|
</div>
|
226
236
|
{disabled != true && readonly != true && isAllowAdd && <Button onClick={() => {
|
227
|
-
add({ key: nanoid() })
|
237
|
+
add({ key: nanoid(), })
|
228
238
|
typeof onTableAddRow === "function" && onTableAddRow(childrenIds);
|
229
239
|
}} className="fmy-2">新增一行</Button>}
|
230
240
|
</div>
|