convert search component to typescript

This commit is contained in:
Peter Clement 2025-05-07 14:05:28 +01:00
parent 5f51e50b7d
commit 3816a345f4
1 changed files with 8 additions and 8 deletions

View File

@ -1,20 +1,20 @@
<script> <script lang="ts">
import Field from "./Field.svelte" import Field from "./Field.svelte"
import Search from "./Core/Search.svelte" import Search from "./Core/Search.svelte"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
export let value = null export let value: string | undefined = undefined
export let label = null export let label: string | undefined = undefined
export let labelPosition = "above" export let labelPosition: "above" | "below" = "above"
export let placeholder = null export let placeholder: string | undefined = undefined
export let disabled = false export let disabled = false
export let updateOnChange = true export let updateOnChange = true
export let quiet = false export let quiet = false
export let inputRef = undefined export let inputRef: HTMLInputElement | undefined = undefined
export let helpText = null export let helpText: string | undefined = undefined
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
const onChange = e => { const onChange = (e: CustomEvent<string>) => {
value = e.detail value = e.detail
dispatch("change", e.detail) dispatch("change", e.detail)
} }