2021-04-20 21:06:27 +02:00
|
|
|
<script>
|
|
|
|
import Field from "./Field.svelte"
|
|
|
|
import DatePicker from "./Core/DatePicker.svelte"
|
2021-10-19 15:04:12 +02:00
|
|
|
import { createEventDispatcher } from "svelte"
|
2021-04-20 21:06:27 +02:00
|
|
|
|
|
|
|
export let value = null
|
|
|
|
export let label = null
|
|
|
|
export let labelPosition = "above"
|
|
|
|
export let disabled = false
|
|
|
|
export let error = null
|
|
|
|
export let enableTime = true
|
2022-02-08 17:15:08 +01:00
|
|
|
export let timeOnly = false
|
2021-04-20 21:06:27 +02:00
|
|
|
export let placeholder = null
|
2021-09-17 15:06:53 +02:00
|
|
|
export let appendTo = undefined
|
2021-10-19 15:04:12 +02:00
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
|
|
|
|
const onChange = e => {
|
|
|
|
value = e.detail
|
|
|
|
dispatch("change", e.detail)
|
|
|
|
}
|
2021-04-20 21:06:27 +02:00
|
|
|
</script>
|
|
|
|
|
2021-04-29 16:24:59 +02:00
|
|
|
<Field {label} {labelPosition} {error}>
|
2021-04-20 21:06:27 +02:00
|
|
|
<DatePicker
|
|
|
|
{error}
|
|
|
|
{disabled}
|
|
|
|
{value}
|
|
|
|
{placeholder}
|
|
|
|
{enableTime}
|
2022-02-08 17:15:08 +01:00
|
|
|
{timeOnly}
|
2021-09-03 12:50:09 +02:00
|
|
|
{appendTo}
|
2021-10-19 15:04:12 +02:00
|
|
|
on:change={onChange}
|
2021-05-04 12:04:42 +02:00
|
|
|
/>
|
2021-04-20 21:06:27 +02:00
|
|
|
</Field>
|