1
0
Fork 0
mirror of synced 2024-10-06 04:54:52 +13:00
budibase/packages/builder/src/components/common/ValuesList.svelte

47 lines
830 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"
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="margin">
<label class="label">{label}</label>
<textarea value={valuesText} on:change={inputChanged} />
2019-07-13 21:35:57 +12:00
</div>
<style>
.margin {
display: grid;
}
.label {
font-size: 14px;
font-weight: 500;
2020-06-26 03:02:30 +12:00
margin-bottom: 8px;
}
2020-02-03 22:50:30 +13:00
textarea {
font-size: 14px;
height: 200px;
2020-06-19 04:17:18 +12:00
width: 100%;
border-radius: 5px;
border: none;
cursor: text;
background: var(--grey-2);
padding: 12px;
2020-06-26 03:02:30 +12:00
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
2020-06-26 20:55:15 +12:00
font-family: Inter;
2020-02-03 22:50:30 +13:00
}
</style>