From ebfc18c284dc40c29a1d6cfa9542cc61dde9844a Mon Sep 17 00:00:00 2001 From: Ben Ramey Date: Tue, 30 Apr 2024 20:26:54 -0500 Subject: [PATCH] More good things --- src/OAP/Oap.Theme.Svelte/index.html | 1 + .../src/OapApplicationForm.svelte | 23 +- .../src/components/Form.svelte | 8 +- .../components/OapApplicationFormStep.svelte | 7 +- .../Oap.Theme.Svelte/src/lib/stores/step.ts | 4 + src/OAP/Oap.Theme.Svelte/src/main.ts | 2 + .../Views/Content-OapApplicationForm.cshtml | 7 +- src/OAP/Oap.Theme/wwwroot/.vite/manifest.json | 4 +- src/OAP/Oap.Theme/wwwroot/index-CFylyzUG.js | 5510 +++++++++++++++++ ...{index-ClWnXPkW.css => index-CRTzDW6u.css} | 6 + src/OAP/Oap.Theme/wwwroot/index-DmYf-7v-.js | 3494 ----------- src/OAP/Oap.Theme/wwwroot/index.html | 29 +- 12 files changed, 5570 insertions(+), 3525 deletions(-) create mode 100644 src/OAP/Oap.Theme.Svelte/src/lib/stores/step.ts create mode 100644 src/OAP/Oap.Theme/wwwroot/index-CFylyzUG.js rename src/OAP/Oap.Theme/wwwroot/{index-ClWnXPkW.css => index-CRTzDW6u.css} (98%) delete mode 100644 src/OAP/Oap.Theme/wwwroot/index-DmYf-7v-.js diff --git a/src/OAP/Oap.Theme.Svelte/index.html b/src/OAP/Oap.Theme.Svelte/index.html index 8c4957b..b754e27 100644 --- a/src/OAP/Oap.Theme.Svelte/index.html +++ b/src/OAP/Oap.Theme.Svelte/index.html @@ -9,6 +9,7 @@
+
import { Client, setContextClient, queryStore } from "@urql/svelte"; - import OapApplicationFormStep from "./components/OapApplicationFormStep.svelte"; import { graphql } from "./gql"; + import OapApplicationFormStep from "./components/OapApplicationFormStep.svelte"; + import step from "./lib/stores/step"; + export let antiForgeryToken: string | null; export let contentItemId: string; export let client: Client; @@ -30,6 +32,10 @@ contentItemId, }, }); + + function handleSubmit(event: SubmitEvent) { + step.update(x => x + 1); + } {#if $content.fetching} @@ -48,13 +54,14 @@ {oapApplicationForm.displayText} {/if} - {#if oapApplicationForm?.list} - {#each oapApplicationForm.list.contentItems ?? [] as contentItem} - {#if contentItem?.__typename === "OapApplicationFormStep"} - - {/if} - {/each} - {/if} + {#each oapApplicationForm?.list?.contentItems ?? [] as contentItem, index} + {#if contentItem?.__typename === "OapApplicationFormStep" && $step === index} + + {/if} + {/each} {/each}
{/if} diff --git a/src/OAP/Oap.Theme.Svelte/src/components/Form.svelte b/src/OAP/Oap.Theme.Svelte/src/components/Form.svelte index 3a93983..f195a77 100644 --- a/src/OAP/Oap.Theme.Svelte/src/components/Form.svelte +++ b/src/OAP/Oap.Theme.Svelte/src/components/Form.svelte @@ -1,4 +1,5 @@ - - - -
+ + + + Overseas Auto Protection - Svelte + + + + +
-
+
+
+
- +