2021-03-31 11:59:07 +02:00
|
|
|
<script>
|
2021-04-16 12:05:53 +02:00
|
|
|
import Field from "./Field.svelte"
|
|
|
|
import Checkbox from "./Core/Checkbox.svelte"
|
2021-03-31 11:59:07 +02:00
|
|
|
import { createEventDispatcher } from "svelte"
|
|
|
|
|
2021-04-16 12:05:53 +02:00
|
|
|
export let value = null
|
|
|
|
export let label = null
|
|
|
|
export let labelPosition = "above"
|
|
|
|
export let text = null
|
|
|
|
export let disabled = false
|
|
|
|
export let error = null
|
2021-08-03 20:54:32 +02:00
|
|
|
export let size = "M"
|
2021-03-31 11:59:07 +02:00
|
|
|
|
2021-04-16 12:05:53 +02:00
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
const onChange = e => {
|
|
|
|
value = e.detail
|
2021-04-20 13:49:02 +02:00
|
|
|
dispatch("change", e.detail)
|
2021-03-31 11:59:07 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-04-29 16:24:59 +02:00
|
|
|
<Field {label} {labelPosition} {error}>
|
2021-08-03 20:54:32 +02:00
|
|
|
<Checkbox {error} {disabled} {text} {value} {size} on:change={onChange} />
|
2021-04-16 12:05:53 +02:00
|
|
|
</Field>
|