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

35 lines
757 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
export let height = null
2021-12-06 18:39:51 +01:00
export let minHeight = 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} {error}>
<TextArea
bind:getCaretPosition
{error}
{disabled}
{value}
{placeholder}
{height}
2021-12-06 18:39:51 +01:00
{minHeight}
on:change={onChange}
/>
</Field>