|
|
|
@ -1,5 +1,6 @@ |
|
|
|
<script> |
|
|
|
import { getContext, setContext } from "svelte" |
|
|
|
import { writable } from "svelte/store" |
|
|
|
import Placeholder from "../Placeholder.svelte" |
|
|
|
|
|
|
|
export let step = 1 |
|
|
|
@ -9,7 +10,9 @@ |
|
|
|
const formContext = getContext("form") |
|
|
|
|
|
|
|
// Set form step context so fields know what step they are within |
|
|
|
setContext("form-step", step || 1) |
|
|
|
const stepStore = writable(step || 1) |
|
|
|
$: stepStore.set(step || 1) |
|
|
|
setContext("form-step", stepStore) |
|
|
|
|
|
|
|
$: formState = formContext?.formState |
|
|
|
$: currentStep = $formState?.currentStep |
|
|
|
|