void;
onchange?: (e: ComboboxChangeEvent) => void;
}
@@ -54,10 +56,11 @@
matchWidth = false,
options,
required = false,
- invalidMessage,
+ invalidMessage = 'Please select an option',
label,
placeholder,
notFoundMessage = 'No results found',
+ class: classValue,
onvalidate,
onchange
}: Props = $props();
@@ -324,7 +327,7 @@
{/if}
-
+
{#if label}
@@ -335,7 +338,7 @@
{name}
{id}
value={value?.value ?? ''}
- class="hidden"
+ type="hidden"
use:validate={validateOpts}
onvalidate={(e) => {
valid = e.detail.valid;
@@ -349,11 +352,9 @@
- {#if invalidMessage}
-
-
-
- {/if}
+
+
+
{#snippet searchInputBox(caret: boolean = true)}
diff --git a/src/lib/Dateinput.svelte b/src/lib/Dateinput.svelte
index 81a22c1..69a2838 100644
--- a/src/lib/Dateinput.svelte
+++ b/src/lib/Dateinput.svelte
@@ -35,7 +35,7 @@
label,
required = false,
invalidMessage = 'Valid date is required',
- class: classList,
+ class: classValue,
format = ['year', 'month', 'day']
}: Props = $props();
@@ -200,7 +200,7 @@
};
-
+
{#if label}
@@ -213,8 +213,7 @@
'border-accent rounded-sm border bg-white px-[1.125rem] py-3.5 font-normal transition-colors',
'text-text dark:border-accent/50 dark:bg-text-800 dark:text-background dark:sm:bg-slate-800',
'ring-accent focus-within:ring-1',
- !valid && 'border-red-500!',
- classList
+ !valid && 'border-red-500!'
]}
>
import type { Snippet } from 'svelte';
- import type { MouseEventHandler } from 'svelte/elements';
+ import type { ClassValue, MouseEventHandler } from 'svelte/elements';
+
+ interface Props {
+ icon?: string;
+ iconPosition?: 'left' | 'right';
+ disabled?: boolean;
+ class?: ClassValue | null | undefined;
+ children: Snippet;
+ onclick?: MouseEventHandler
;
+ }
let {
icon,
iconPosition = 'right',
disabled = false,
+ class: classValue,
children,
onclick
- }: {
- icon?: string;
- iconPosition?: 'left' | 'right';
- disabled?: boolean;
- children: Snippet;
- onclick?: MouseEventHandler;
- } = $props();
+ }: Props = $props();
{#snippet iconSnippet()}
@@ -24,7 +28,8 @@