budibase/packages/bbui/src/Form/TextArea.svelte

30 lines
680 B
Svelte
Raw Normal View History

2021-03-31 11:59:07 +02:00
<script>
import Field from "./Field.svelte"
import TextArea from "./Core/TextArea.svelte"
2021-03-31 11:59:07 +02:00
import { createEventDispatcher } from "svelte"
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
export let error = null
export let getCaretPosition = null
2021-03-31 11:59:07 +02:00
const dispatch = createEventDispatcher()
const onChange = e => {
value = e.detail
dispatch("change", e.detail)
2021-03-31 11:59:07 +02:00
}
</script>
<Field {label} {labelPosition} {disabled} {error}>
<TextArea
bind:getCaretPosition
{error}
{disabled}
{value}
{placeholder}
on:change={onChange} />
</Field>