2021-03-31 11:59:07 +02:00
|
|
|
<script>
|
2021-04-16 17:00:10 +02:00
|
|
|
import Field from "./Field.svelte"
|
|
|
|
import TextArea from "./Core/TextArea.svelte"
|
2021-03-31 11:59:07 +02:00
|
|
|
import { createEventDispatcher } from "svelte"
|
|
|
|
|
2021-04-16 17:00:10 +02:00
|
|
|
export let value = null
|
|
|
|
export let label = null
|
|
|
|
export let labelPosition = "above"
|
|
|
|
export let placeholder = null
|
2021-03-31 11:59:07 +02:00
|
|
|
export let disabled = false
|
2021-04-16 17:00:10 +02:00
|
|
|
export let error = null
|
2021-04-19 16:07:25 +02:00
|
|
|
export let getCaretPosition = null
|
2021-12-03 19:39:05 +01:00
|
|
|
export let height = null
|
2021-12-06 18:39:51 +01:00
|
|
|
export let minHeight = null
|
2021-03-31 11:59:07 +02:00
|
|
|
|
2021-04-16 17:00:10 +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-04-19 16:07:25 +02:00
|
|
|
<TextArea
|
|
|
|
bind:getCaretPosition
|
|
|
|
{error}
|
|
|
|
{disabled}
|
|
|
|
{value}
|
|
|
|
{placeholder}
|
2021-12-03 19:39:05 +01:00
|
|
|
{height}
|
2021-12-06 18:39:51 +01:00
|
|
|
{minHeight}
|
2021-05-04 12:04:42 +02:00
|
|
|
on:change={onChange}
|
|
|
|
/>
|
2021-04-16 17:00:10 +02:00
|
|
|
</Field>
|