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-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-16 17:00:10 +02:00
|
|
|
<Field {label} {labelPosition} {disabled} {error}>
|
2021-04-19 16:07:25 +02:00
|
|
|
<TextArea
|
|
|
|
bind:getCaretPosition
|
|
|
|
{error}
|
|
|
|
{disabled}
|
|
|
|
{value}
|
|
|
|
{placeholder}
|
|
|
|
on:change={onChange} />
|
2021-04-16 17:00:10 +02:00
|
|
|
</Field>
|