ywana-core8 0.0.716 → 0.0.718
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 +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +2 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +2 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/incubator/wizard.js +1 -1
- package/src/incubator/wizard.test.js +5 -1
package/package.json
CHANGED
package/src/incubator/wizard.js
CHANGED
@@ -50,7 +50,7 @@ export const Wizard = (props) => {
|
|
50
50
|
})
|
51
51
|
}
|
52
52
|
|
53
|
-
const currentStep = React.cloneElement(steps[current], { ref: stepRef, onChange: validate })
|
53
|
+
const currentStep = React.cloneElement(steps[current], { ref: stepRef, onChange: validate, next: next })
|
54
54
|
const nextButton = current < steps.length - 1 ? <Button label="Siguiente" action={next} raised disabled={!valid}/> : <Button label="Finish" action={finish} disabled={!valid}/>
|
55
55
|
const prevButton = current > 0 ? <Button label="Atrás" action={prev} /> : null
|
56
56
|
|
@@ -7,12 +7,16 @@ export const Step1 = forwardRef((props, ref) => {
|
|
7
7
|
|
8
8
|
const wizardContext = React.useContext(WizardContext)
|
9
9
|
const { form } = wizardContext
|
10
|
-
const { onChange } = props
|
10
|
+
const { next, onChange } = props
|
11
11
|
|
12
12
|
useEffect(() => {
|
13
13
|
onChange(form, isValid(form))
|
14
14
|
}, [form])
|
15
15
|
|
16
|
+
useEffect(() => {
|
17
|
+
if (form.name && form.name === "ok" && next) next()
|
18
|
+
}, [form])
|
19
|
+
|
16
20
|
function changeForm(id, value) {
|
17
21
|
wizardContext.setForm({ ...form, [id]: value })
|
18
22
|
}
|