2019-07-13 21:35:57 +12:00
|
|
|
<script>
|
2020-02-03 22:50:30 +13:00
|
|
|
export let value
|
|
|
|
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
|
|
|
value = Number(ev.target.value)
|
|
|
|
} catch (_) {
|
|
|
|
value = null
|
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
|
|
|
let numberText = value === null || value === undefined ? "" : value.toString()
|
2019-07-13 21:35:57 +12:00
|
|
|
</script>
|
|
|
|
|
2019-08-07 20:03:49 +12:00
|
|
|
<div class="uk-margin">
|
2020-02-03 22:50:30 +13:00
|
|
|
<label class="uk-form-label">{label}</label>
|
|
|
|
<div class="uk-form-controls">
|
2020-04-21 03:17:11 +12:00
|
|
|
<input class="budibase__input" type="number" {value} on:change={inputChanged} />
|
2020-02-03 22:50:30 +13:00
|
|
|
</div>
|
2019-07-13 21:35:57 +12:00
|
|
|
</div>
|