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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.716",
3
+ "version": "0.0.718",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -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
  }