Improvements to NumericListInterval Form.

This commit is contained in:
Mateus Machado Luna 2019-10-23 12:35:06 -03:00
parent 47a3563439
commit 11b281d7e2
1 changed files with 12 additions and 4 deletions

View File

@ -31,19 +31,21 @@
:key="index"> :key="index">
<b-field> <b-field>
<b-input <b-input
expanded="true" expanded
:placeholder="$i18n.get('label')" :placeholder="$i18n.get('label')"
@input="onUpdate(interval)" @input="onUpdate(interval)"
v-model="interval.label" /> v-model="interval.label" />
</b-field> </b-field>
<b-field> <b-field>
<b-input <b-input
expanded
type="number" type="number"
step="0.01" step="0.01"
:placeholder="$i18n.get('info_initial_value')" :placeholder="$i18n.get('info_initial_value')"
@input="onUpdate(interval, true)" @input="onUpdate(interval, true)"
v-model="interval.from" /> v-model="interval.from" />
<b-input <b-input
expanded
type="number" type="number"
step="0.01" step="0.01"
:placeholder="$i18n.get('info_final_value')" :placeholder="$i18n.get('info_final_value')"
@ -105,10 +107,10 @@
interval.to == "" || interval.from == "" || interval.to == "" || interval.from == "" ||
Number(interval.to) < Number(interval.from)) Number(interval.to) < Number(interval.from))
) { ) {
if (this.isValid) {
this.isValid = false; this.isValid = false;
if (interval.to != '' && interval.from != '' && interval.to != null && interval.from != null)
this.showErrorMessage() this.showErrorMessage()
}
} else { } else {
this.isValid = true; this.isValid = true;
this.$emit('input', { this.$emit('input', {
@ -181,6 +183,12 @@
} }
.field.has-addons { .field.has-addons {
margin-bottom: 0.125rem; margin-bottom: 0.125rem;
width: 100%;
display: flex;
flex-wrap: wrap;
&>.control {
flex-basis: 50%;
}
} }
} }