mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
fixed number input precision
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
</v-expansion-panel-text>
|
</v-expansion-panel-text>
|
||||||
</v-expansion-panel>
|
</v-expansion-panel>
|
||||||
</v-expansion-panels>
|
</v-expansion-panels>
|
||||||
<v-number-input v-model="servings" class="mt-3" control-variant="split" :label="$t('Servings')"></v-number-input>
|
<v-number-input v-model="servings" class="mt-3" control-variant="split" :label="$t('Servings')" :precision="2"></v-number-input>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-btn class="float-right" prepend-icon="$create" color="create" @click="createShoppingListRecipe()">{{ $t('Add_to_Shopping') }}</v-btn>
|
<v-btn class="float-right" prepend-icon="$create" color="create" @click="createShoppingListRecipe()">{{ $t('Add_to_Shopping') }}</v-btn>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="4">
|
<v-col cols="12" md="4">
|
||||||
|
|
||||||
<v-number-input :label="$t('Servings')" v-model="newCookLog.servings"></v-number-input>
|
<v-number-input :label="$t('Servings')" v-model="newCookLog.servings" :precision="2"></v-number-input>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="4">
|
<v-col cols="12" md="4">
|
||||||
<v-date-input :label="$t('Date')" v-model="newCookLog.createdAt"></v-date-input>
|
<v-date-input :label="$t('Date')" v-model="newCookLog.createdAt"></v-date-input>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<v-row class="d-none d-md-flex mt-2" v-for="p in properties" dense>
|
<v-row class="d-none d-md-flex mt-2" v-for="p in properties" dense>
|
||||||
<v-col cols="0" md="5">
|
<v-col cols="0" md="5">
|
||||||
<v-number-input :step="10" v-model="p.propertyAmount" control-variant="stacked">
|
<v-number-input :step="10" v-model="p.propertyAmount" control-variant="stacked" :precision="2">
|
||||||
<template #append-inner v-if="p.propertyType">
|
<template #append-inner v-if="p.propertyType">
|
||||||
<v-chip class="me-4">{{ p.propertyType.unit }} / {{ props.amountFor }}
|
<v-chip class="me-4">{{ p.propertyType.unit }} / {{ props.amountFor }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12" md="6" v-if="showTime || step.time != 0">
|
<v-col cols="12" md="6" v-if="showTime || step.time != 0">
|
||||||
<v-number-input :label="$t('Time')" v-model="step.time" :min="0" :step="5" control-variant="split"></v-number-input>
|
<v-number-input :label="$t('Time')" v-model="step.time" :min="0" :step="5" control-variant="split" ></v-number-input>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="6" v-if="showRecipe || step.stepRecipe != null">
|
<v-col cols="12" md="6" v-if="showRecipe || step.stepRecipe != null">
|
||||||
<model-select model="Recipe" v-model="step.stepRecipe" :object="false" append-to-body></model-select>
|
<model-select model="Recipe" v-model="step.stepRecipe" :object="false" append-to-body></model-select>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<v-tabs-window-item value="properties">
|
<v-tabs-window-item value="properties">
|
||||||
<v-alert icon="$help">{{ $t('PropertiesFoodHelp') }}</v-alert>
|
<v-alert icon="$help">{{ $t('PropertiesFoodHelp') }}</v-alert>
|
||||||
<v-form :disabled="loading" class="mt-5">
|
<v-form :disabled="loading" class="mt-5">
|
||||||
<v-number-input :label="$t('Properties_Food_Amount')" v-model="editingObj.propertiesFoodAmount"></v-number-input>
|
<v-number-input :label="$t('Properties_Food_Amount')" v-model="editingObj.propertiesFoodAmount" :precision="2"></v-number-input>
|
||||||
<model-select :label="$t('Properties_Food_Unit')" v-model="editingObj.propertiesFoodUnit" model="Unit"></model-select>
|
<model-select :label="$t('Properties_Food_Unit')" v-model="editingObj.propertiesFoodUnit" model="Unit"></model-select>
|
||||||
|
|
||||||
<properties-editor v-model="editingObj.properties" :amount-for="propertiesAmountFor"></properties-editor>
|
<properties-editor v-model="editingObj.properties" :amount-for="propertiesAmountFor"></properties-editor>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
<v-card-text class="d-none d-md-block">
|
<v-card-text class="d-none d-md-block">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col md="6">
|
<v-col md="6">
|
||||||
<v-number-input :label="$t('Amount')" :step="10" v-model="uc.baseAmount" control-variant="stacked"></v-number-input>
|
<v-number-input :label="$t('Amount')" :step="10" v-model="uc.baseAmount" control-variant="stacked" :precision="3"></v-number-input>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col md="6">
|
<v-col md="6">
|
||||||
<!-- TODO fix card overflow invisible, overflow-visible class is not working -->
|
<!-- TODO fix card overflow invisible, overflow-visible class is not working -->
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col md="6">
|
<v-col md="6">
|
||||||
<v-number-input :label="$t('Amount')" :step="10" v-model="uc.convertedAmount" control-variant="stacked"></v-number-input>
|
<v-number-input :label="$t('Amount')" :step="10" v-model="uc.convertedAmount" control-variant="stacked" :precision="3"></v-number-input>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col md="6">
|
<v-col md="6">
|
||||||
<!-- TODO fix card overflow invisible, overflow-visible class is not working -->
|
<!-- TODO fix card overflow invisible, overflow-visible class is not working -->
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
</v-input>
|
</v-input>
|
||||||
|
|
||||||
<ModelSelect model="MealType" :allow-create="true" v-model="editingObj.mealType"></ModelSelect>
|
<ModelSelect model="MealType" :allow-create="true" v-model="editingObj.mealType"></ModelSelect>
|
||||||
<v-number-input control-variant="split" :min="0" v-model="editingObj.servings" :label="$t('Servings')"></v-number-input>
|
<v-number-input control-variant="split" :min="0" v-model="editingObj.servings" :label="$t('Servings')" :precision="2"></v-number-input>
|
||||||
<ModelSelect model="User" :allow-create="false" v-model="editingObj.shared" item-label="displayName" mode="tags"></ModelSelect>
|
<ModelSelect model="User" :allow-create="false" v-model="editingObj.shared" item-label="displayName" mode="tags"></ModelSelect>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="6">
|
<v-col cols="12" md="6">
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
:object-name="editingObjName()">
|
:object-name="editingObjName()">
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-form>
|
<v-form>
|
||||||
<v-number-input :step="10" v-model="editingObj.propertyAmount" control-variant="stacked">
|
<v-number-input :step="10" v-model="editingObj.propertyAmount" control-variant="stacked" :precision="2">
|
||||||
<template #append-inner v-if="editingObj.propertyType">
|
<template #append-inner v-if="editingObj.propertyType">
|
||||||
<v-chip class="me-4">{{ editingObj.propertyType.unit }}</v-chip>
|
<v-chip class="me-4">{{ editingObj.propertyType.unit }}</v-chip>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
:object-name="editingObjName()">
|
:object-name="editingObjName()">
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-form :disabled="loading">
|
<v-form :disabled="loading">
|
||||||
<v-number-input v-model="editingObj.amount" control-variant="split">
|
<v-number-input v-model="editingObj.amount" control-variant="split" :precision="2">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<v-btn icon="" @click="editingObj.amount = editingObj.amount / 2">
|
<v-btn icon="" @click="editingObj.amount = editingObj.amount / 2">
|
||||||
<v-icon icon="fa-solid fa-divide"></v-icon>
|
<v-icon icon="fa-solid fa-divide"></v-icon>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col md="6">
|
<v-col md="6">
|
||||||
<v-number-input :label="$t('Amount')" :step="10" v-model="editingObj.baseAmount" control-variant="stacked"></v-number-input>
|
<v-number-input :label="$t('Amount')" :step="10" v-model="editingObj.baseAmount" control-variant="stacked" :precision="3"></v-number-input>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col md="6">
|
<v-col md="6">
|
||||||
<!-- TODO fix card overflow invisible, overflow-visible class is not working -->
|
<!-- TODO fix card overflow invisible, overflow-visible class is not working -->
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col md="6">
|
<v-col md="6">
|
||||||
<v-number-input :label="$t('Amount')" :step="10" v-model="editingObj.convertedAmount" control-variant="stacked"></v-number-input>
|
<v-number-input :label="$t('Amount')" :step="10" v-model="editingObj.convertedAmount" control-variant="stacked" :precision="3"></v-number-input>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col md="6">
|
<v-col md="6">
|
||||||
<!-- TODO fix card overflow invisible, overflow-visible class is not working -->
|
<!-- TODO fix card overflow invisible, overflow-visible class is not working -->
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
|
|
||||||
<template v-slot:item.amount="{ item }">
|
<template v-slot:item.amount="{ item }">
|
||||||
<v-number-input :label="$t('Amount')" v-model="item.amount" inset control-variant="stacked" hide-details :min="0" density="compact"
|
<v-number-input :label="$t('Amount')" v-model="item.amount" inset control-variant="stacked" hide-details :min="0" density="compact"
|
||||||
@update:modelValue="item.changed = true"></v-number-input>
|
@update:modelValue="item.changed = true" :precision="2"></v-number-input>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:item.unit="{ item }">
|
<template v-slot:item.unit="{ item }">
|
||||||
<model-select model="Unit" v-model="item.unit" :label="$t('Unit')" density="compact" hide-details allow-create append-to-body
|
<model-select model="Unit" v-model="item.unit" :label="$t('Unit')" density="compact" hide-details allow-create append-to-body
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<v-number-input v-model="ingredient.food.propertiesFoodAmount" density="compact" hide-details @change="updateFood(ingredient)"
|
<v-number-input v-model="ingredient.food.propertiesFoodAmount" density="compact" hide-details @change="updateFood(ingredient)"
|
||||||
:loading="ingredient.loading" style="min-width: 100px" control-variant="hidden">
|
:loading="ingredient.loading" style="min-width: 100px" control-variant="hidden" :precision="2">
|
||||||
|
|
||||||
</v-number-input>
|
</v-number-input>
|
||||||
</td>
|
</td>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
:loading="ingredient.loading"></model-select>
|
:loading="ingredient.loading"></model-select>
|
||||||
</td>
|
</td>
|
||||||
<td v-for="p in ingredient.food.properties" v-bind:key="`${ingredient.food.id}_${p.propertyType.id}`">
|
<td v-for="p in ingredient.food.properties" v-bind:key="`${ingredient.food.id}_${p.propertyType.id}`">
|
||||||
<v-number-input v-model="p.propertyAmount" density="compact" hide-details v-if="p.propertyAmount != null" @change="updateFood(ingredient)"
|
<v-number-input v-model="p.propertyAmount" density="compact" hide-details v-if="p.propertyAmount != null" @change="updateFood(ingredient)" :precision="2"
|
||||||
:loading="ingredient.loading" @click:clear="deleteFoodProperty(p, ingredient)" style="min-width: 120px" control-variant="hidden" clearable>
|
:loading="ingredient.loading" @click:clear="deleteFoodProperty(p, ingredient)" style="min-width: 120px" control-variant="hidden" clearable>
|
||||||
|
|
||||||
</v-number-input>
|
</v-number-input>
|
||||||
|
|||||||
@@ -346,7 +346,7 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="6">
|
<v-col cols="12" md="6">
|
||||||
<v-text-field :label="$t('Name')" v-model="importResponse.recipe.name"></v-text-field>
|
<v-text-field :label="$t('Name')" v-model="importResponse.recipe.name"></v-text-field>
|
||||||
<v-number-input :label="$t('Servings')" v-model="importResponse.recipe.servings"></v-number-input>
|
<v-number-input :label="$t('Servings')" v-model="importResponse.recipe.servings" :precision="2"></v-number-input>
|
||||||
<v-text-field :label="$t('ServingsText')" v-model="importResponse.recipe.servingsText"></v-text-field>
|
<v-text-field :label="$t('ServingsText')" v-model="importResponse.recipe.servingsText"></v-text-field>
|
||||||
<v-textarea :label="$t('Description')" v-model="importResponse.recipe.description" clearable></v-textarea>
|
<v-textarea :label="$t('Description')" v-model="importResponse.recipe.description" clearable></v-textarea>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|||||||
Reference in New Issue
Block a user