Form overhaul: Constant Form

This commit is contained in:
Stefan Zermatten
2023-05-16 20:30:21 +02:00
parent 0dbd5903b3
commit 53958fde92

View File

@@ -1,36 +1,32 @@
<template lang="html">
<div>
<div class="layout wrap">
<text-field
label="Name"
:value="model.name"
:error-messages="errors.name"
@change="change('name', ...arguments)"
/>
<text-field
label="Variable name"
:value="model.variableName"
style="flex-basis: 300px;"
hint="Use this name in calculations to reference this attribute"
:error-messages="errors.variableName"
@change="change('variableName', ...arguments)"
/>
</div>
<text-field
label="Value"
hint="Calculation of the constant value, use 'text' for a string value, [1,2,3] for a matrix, or 123 for a number"
:value="model.calculation"
:error-messages="errors.calculation"
@change="change('calculation', ...arguments)"
/>
<calculation-error-list :errors="clientErrors" />
<form-section
v-if="$slots.children"
name="Children"
standalone
<v-row dense>
<v-col cols="12">
<text-field
label="Variable name"
:value="model.variableName"
style="flex-basis: 300px;"
hint="Use this name in calculations to reference this attribute"
:error-messages="errors.variableName"
@change="change('variableName', ...arguments)"
/>
</v-col>
<v-col cols="12">
<text-field
label="Value"
hint="Calculation of the constant value, use 'text' for a string value, [1,2,3] for a matrix, or 123 for a number"
:value="model.calculation"
:error-messages="errors.calculation"
@change="change('calculation', ...arguments)"
/>
<calculation-error-list :errors="clientErrors" />
</v-col>
</v-row>
<form-sections
v-if="$slots.default"
>
<slot name="children" />
</form-section>
<slot />
</form-sections>
</div>
</template>