From 9262ace19ad0484723e1d4412eb6b7790e7e3994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esbj=C3=B6rn=20Stenberg?= Date: Tue, 19 Nov 2024 23:40:51 +0100 Subject: [PATCH] Fixed Svelte 5 breaking changes; form inside form --- src/lib/components/Pagination.svelte | 6 +- .../components/forms/FormSubmitButton.svelte | 2 + src/routes/(app)/admin/links/+page.svelte | 66 ++++---- src/routes/(app)/events/EventEditor.svelte | 118 ++++++++------- src/routes/(app)/events/[slug]/+page.svelte | 141 +++++++++--------- 5 files changed, 172 insertions(+), 161 deletions(-) diff --git a/src/lib/components/Pagination.svelte b/src/lib/components/Pagination.svelte index e2a7f1be4..3a9e4104d 100644 --- a/src/lib/components/Pagination.svelte +++ b/src/lib/components/Pagination.svelte @@ -12,10 +12,10 @@ e.g. `?page=1`, `?page=2`, etc. The page number is stored in the URL query. import { twMerge } from "tailwind-merge"; let { - class: clazz, + class: clazz = "", count, - getPageName = (n: number): string => (n + 1).toString(), - getPageNumber = (n: string): number => +n - 1, + getPageName = (n) => (n + 1).toString(), + getPageNumber = (n) => n - 1, fieldName = "page", showPrev = true, showNext = true, diff --git a/src/lib/components/forms/FormSubmitButton.svelte b/src/lib/components/forms/FormSubmitButton.svelte index 8ea1b05f8..7b7a3ddd3 100644 --- a/src/lib/components/forms/FormSubmitButton.svelte +++ b/src/lib/components/forms/FormSubmitButton.svelte @@ -10,12 +10,14 @@ export let superform: SuperForm; let clazz: string | undefined = undefined; export { clazz as class }; + export let form: string | undefined = undefined; const { delayed } = superform; diff --git a/src/routes/(app)/admin/links/+page.svelte b/src/routes/(app)/admin/links/+page.svelte index 5ee3a5e7f..dc57ddb2b 100644 --- a/src/routes/(app)/admin/links/+page.svelte +++ b/src/routes/(app)/admin/links/+page.svelte @@ -176,7 +176,8 @@ -
+ +
- - - -
-
@@ -266,7 +238,7 @@ {/if} {/each} - @@ -334,6 +306,38 @@ + + + + + + + + + + + + + +
+