lu-lowcode-package-form 0.10.78 → 0.10.79
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
@@ -8,7 +8,7 @@ import { createPromiseWrapper } from "../../../utils"
|
|
8
8
|
import { useCreation } from 'ahooks';
|
9
9
|
|
10
10
|
|
11
|
-
const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsValue, shouldUpdateKey, value, type, defaultValue, onChange, option_label, option_value, option_search, options, request, requestParams, callError, subRequest, sub_option_label = "label", mode = "single", sub_option_value = "id", rightIconRender, rightIcon, rightIconClick, recordFieldsChange, getAllWithIds, ...props }, ref) => {
|
11
|
+
const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsValue, shouldUpdateKey, value, type, defaultValue, onChange, option_label, option_value, option_search, options, request, requestParams, callError, subRequest, sub_option_label = "label", mode = "single", sub_option_value = "id", rightIconRender, rightIcon, rightIconClick, recordFieldsChange, getAllWithIds,removeLastFieldsValues, ...props }, ref) => {
|
12
12
|
const [nOptions, setNOptions] = React.useState([])
|
13
13
|
const [fetching, setFetching] = useState(false);
|
14
14
|
|
@@ -221,7 +221,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
|
|
221
221
|
|
222
222
|
</OriginalSelect>
|
223
223
|
{!props?.disabled && rightIcon}
|
224
|
-
{!props?.disabled && typeof rightIconRender === 'function' && rightIconRender({ value, onChange, form, fieldName, recordFieldsChange,getAllWithIds })}
|
224
|
+
{!props?.disabled && typeof rightIconRender === 'function' && rightIconRender({ value, onChange, form, fieldName, recordFieldsChange,getAllWithIds ,removeLastFieldsValues})}
|
225
225
|
</BaseWrapper>
|
226
226
|
) : (<>
|
227
227
|
<OriginalSelect
|
@@ -240,7 +240,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
|
|
240
240
|
|
241
241
|
</OriginalSelect>
|
242
242
|
{!props?.disabled && rightIcon}
|
243
|
-
{!props?.disabled && typeof rightIconRender === 'function' && rightIconRender({ value, onChange, form, fieldName, recordFieldsChange,getAllWithIds })}
|
243
|
+
{!props?.disabled && typeof rightIconRender === 'function' && rightIconRender({ value, onChange, form, fieldName, recordFieldsChange,getAllWithIds,removeLastFieldsValues })}
|
244
244
|
</>
|
245
245
|
)
|
246
246
|
|
@@ -33,7 +33,7 @@ const TableCol = ({ children, width, hidden, ...props }) => {
|
|
33
33
|
</div>
|
34
34
|
}
|
35
35
|
|
36
|
-
const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow, form, fieldName, initializeFormRender, recordFieldsChange, getTableWithIds, mode, isAllowCopy=false, isAllowAdd=true, ...props }) => {
|
36
|
+
const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow, form, fieldName, initializeFormRender, recordFieldsChange, getTableWithIds,removeLastFieldsValues, mode, isAllowCopy=false, isAllowAdd=true, ...props }) => {
|
37
37
|
useEffect(() => {
|
38
38
|
// console.log("Table form reload", form)
|
39
39
|
}, [form])
|
@@ -171,6 +171,7 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
|
|
171
171
|
initializeFormRender,
|
172
172
|
recordFieldsChange,
|
173
173
|
getAllWithIds: getAllWithIds,
|
174
|
+
removeLastFieldsValues
|
174
175
|
})}
|
175
176
|
</Form.Item>
|
176
177
|
}}
|
@@ -560,7 +560,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
560
560
|
|
561
561
|
let childComponent
|
562
562
|
if (isTable || isLayoutComponent) {
|
563
|
-
childComponent = React.cloneElement(child, { onTableAddRow: handleTableAddRow, getTableWithIds, onTableRemoveRow: handleTableRemoveRow, form: form, fieldName: identifier, onCustomChange, initializeFormRender, mode, recordFieldsChange })
|
563
|
+
childComponent = React.cloneElement(child, { onTableAddRow: handleTableAddRow, getTableWithIds, onTableRemoveRow: handleTableRemoveRow,removeLastFieldsValues, form: form, fieldName: identifier, onCustomChange, initializeFormRender, mode, recordFieldsChange })
|
564
564
|
}
|
565
565
|
else if (componentName === "Field.WithSingleSelect" || componentName === "Field.WithMultipleSelect" || componentName === "Show.WithTable") {
|
566
566
|
childComponent = <Form.Item
|
@@ -594,7 +594,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
594
594
|
{({ getFieldsValue }) => {
|
595
595
|
const fieldsValue = getFieldsValue();
|
596
596
|
let element = React.cloneElement(child, {
|
597
|
-
onTableAddRow: handleTableAddRow, onTableRemoveRow: handleTableRemoveRow, form: form, fieldName: identifier, onCustomChange, fieldsValue, initializeFormRender, recordFieldsChange,
|
597
|
+
onTableAddRow: handleTableAddRow, onTableRemoveRow: handleTableRemoveRow,removeLastFieldsValues, form: form, fieldName: identifier, onCustomChange, fieldsValue, initializeFormRender, recordFieldsChange,
|
598
598
|
shouldUpdateKey: shouldUpdateKey.current[identifier],
|
599
599
|
})
|
600
600
|
return componentName === "show.WithTable" ? <>{element}</> : <Form.Item
|
@@ -615,7 +615,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
615
615
|
name={identifier}
|
616
616
|
rules={rules}
|
617
617
|
>
|
618
|
-
{React.cloneElement(child, { form: form, fieldName: identifier, onCustomChange, initializeFormRender, recordFieldsChange })}
|
618
|
+
{React.cloneElement(child, { form: form, fieldName: identifier, onCustomChange, initializeFormRender, recordFieldsChange,removeLastFieldsValues })}
|
619
619
|
</Form.Item>
|
620
620
|
}
|
621
621
|
return (
|