1
0
Fork 0
mirror of synced 2024-07-07 23:35:49 +12:00
budibase/packages/builder/src/components/common/ValuesList.svelte

28 lines
496 B
Svelte
Raw Normal View History

2019-07-13 21:35:57 +12:00
<script>
2020-02-03 22:50:30 +13:00
import { join } from "lodash/fp"
import { TextArea, Label } from "@budibase/bbui"
2019-07-13 21:35:57 +12:00
2020-02-03 22:50:30 +13:00
export let values
export let label
2019-07-13 21:35:57 +12:00
2020-02-03 22:50:30 +13:00
const inputChanged = ev => {
2019-07-13 21:35:57 +12:00
try {
2020-02-03 22:50:30 +13:00
values = ev.target.value.split("\n")
} catch (_) {
values = []
2019-07-13 21:35:57 +12:00
}
2020-02-03 22:50:30 +13:00
}
2019-07-13 21:35:57 +12:00
2020-02-03 22:50:30 +13:00
$: valuesText = join("\n")(values)
2019-07-13 21:35:57 +12:00
</script>
<div class="container">
<TextArea {label} value={valuesText} thin on:change={inputChanged} />
2019-07-13 21:35:57 +12:00
</div>
<style>
.container :global(textarea) {
min-height: 100px;
2020-02-03 22:50:30 +13:00
}
</style>