2021-04-20 15:24:14 +02:00
|
|
|
<script>
|
|
|
|
import Field from "./Field.svelte"
|
|
|
|
import Search from "./Core/Search.svelte"
|
|
|
|
import { createEventDispatcher } from "svelte"
|
|
|
|
|
|
|
|
export let value = null
|
|
|
|
export let label = null
|
|
|
|
export let labelPosition = "above"
|
|
|
|
export let placeholder = null
|
|
|
|
export let disabled = false
|
2021-05-18 09:37:07 +02:00
|
|
|
export let updateOnChange = true
|
2021-12-08 19:51:24 +01:00
|
|
|
export let quiet = false
|
2021-04-20 15:24:14 +02:00
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
const onChange = e => {
|
|
|
|
value = e.detail
|
|
|
|
dispatch("change", e.detail)
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-04-29 16:24:59 +02:00
|
|
|
<Field {label} {labelPosition}>
|
2021-04-20 15:24:14 +02:00
|
|
|
<Search
|
2021-05-18 09:37:07 +02:00
|
|
|
{updateOnChange}
|
2021-04-20 15:24:14 +02:00
|
|
|
{disabled}
|
|
|
|
{value}
|
|
|
|
{placeholder}
|
2021-12-08 19:51:24 +01:00
|
|
|
{quiet}
|
2021-04-20 15:24:14 +02:00
|
|
|
on:change={onChange}
|
|
|
|
on:click
|
2021-05-04 12:04:42 +02:00
|
|
|
on:input
|
2021-05-18 09:37:07 +02:00
|
|
|
on:focus
|
|
|
|
on:blur
|
2021-05-04 12:04:42 +02:00
|
|
|
/>
|
2021-04-20 15:24:14 +02:00
|
|
|
</Field>
|