@kne/form-info 0.1.0-alpha.2 → 0.1.0
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/README.md +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +8 -4
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -4
package/dist/index.modern.js
CHANGED
|
@@ -3778,7 +3778,7 @@ const FormModal = p => {
|
|
|
3778
3778
|
|
|
3779
3779
|
const _excluded$1 = ["className", "stepsClassName", "autoStep", "onComplete", "children"];
|
|
3780
3780
|
const FormSteps = p => {
|
|
3781
|
-
var _stepProps$items$curr, _stepProps$items$curr2;
|
|
3781
|
+
var _stepProps$items$curr, _stepProps$items$curr2, _stepCacheRef$current, _stepProps$items$curr3;
|
|
3782
3782
|
const _Object$assign = Object.assign({}, {
|
|
3783
3783
|
autoStep: true,
|
|
3784
3784
|
defaultCurrent: 0,
|
|
@@ -3799,7 +3799,9 @@ const FormSteps = p => {
|
|
|
3799
3799
|
});
|
|
3800
3800
|
const stepCacheRef = useRef([]);
|
|
3801
3801
|
const isLastStep = currentStep === stepProps.items.length - 1;
|
|
3802
|
-
const currentFormProps = Object.assign({}, (_stepProps$items$curr = stepProps.items[currentStep]) == null ? void 0 : _stepProps$items$curr.formProps
|
|
3802
|
+
const currentFormProps = Object.assign({}, (_stepProps$items$curr = stepProps.items[currentStep]) == null ? void 0 : _stepProps$items$curr.formProps, {
|
|
3803
|
+
data: Object.assign({}, (_stepProps$items$curr2 = stepProps.items[currentStep]) == null || (_stepProps$items$curr2 = _stepProps$items$curr2.formProps) == null ? void 0 : _stepProps$items$curr2.data, (_stepCacheRef$current = stepCacheRef.current[currentStep]) == null ? void 0 : _stepCacheRef$current.formData)
|
|
3804
|
+
});
|
|
3803
3805
|
const inner = /*#__PURE__*/React.createElement(Flex, {
|
|
3804
3806
|
className: className,
|
|
3805
3807
|
vertical: stepProps.direction !== 'vertical',
|
|
@@ -3810,8 +3812,8 @@ const FormSteps = p => {
|
|
|
3810
3812
|
current: currentStep
|
|
3811
3813
|
})), /*#__PURE__*/React.createElement("div", {
|
|
3812
3814
|
className: style['steps-form-inner']
|
|
3813
|
-
}, (_stepProps$items$
|
|
3814
|
-
return /*#__PURE__*/React.createElement(Form, Object.assign({}, currentFormProps, {
|
|
3815
|
+
}, (_stepProps$items$curr3 = stepProps.items[currentStep]) == null ? void 0 : _stepProps$items$curr3.children));
|
|
3816
|
+
return /*#__PURE__*/React.createElement(Form, _extends({}, Object.assign({}, currentFormProps, {
|
|
3815
3817
|
onSubmit: async (data, ...args) => {
|
|
3816
3818
|
if (!stepCacheRef.current[currentStep]) {
|
|
3817
3819
|
stepCacheRef.current[currentStep] = {};
|
|
@@ -3834,6 +3836,8 @@ const FormSteps = p => {
|
|
|
3834
3836
|
}
|
|
3835
3837
|
return res;
|
|
3836
3838
|
}
|
|
3839
|
+
}), {
|
|
3840
|
+
key: currentStep
|
|
3837
3841
|
}), typeof children === 'function' ? children({
|
|
3838
3842
|
children: inner,
|
|
3839
3843
|
isLastStep,
|