mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 13:05:21 +02:00
fix: Nuxt 3 Ingredient Parsing Issues and Tooltip Positions (#5829)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
eefe613aaf
commit
f9f88fb8a4
15 changed files with 91 additions and 44 deletions
|
@ -17,7 +17,7 @@
|
|||
<RecipeFavoriteBadge v-if="loggedIn" color="info" button-style :recipe-id="recipe.id!" show-always />
|
||||
<RecipeTimelineBadge v-if="loggedIn" class="ml-1" color="info" button-style :slug="recipe.slug" :recipe-name="recipe.name!" />
|
||||
<div v-if="loggedIn">
|
||||
<v-tooltip v-if="canEdit" bottom color="info">
|
||||
<v-tooltip v-if="canEdit" location="bottom" color="info">
|
||||
<template #activator="{ props }">
|
||||
<v-btn
|
||||
icon
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
>
|
||||
<template #prepend>
|
||||
<div class="ma-auto">
|
||||
<v-tooltip bottom>
|
||||
<v-tooltip location="bottom">
|
||||
<template #activator="{ props: tooltipProps }">
|
||||
<v-icon v-bind="tooltipProps">
|
||||
{{ getIconDefinition(item.icon).icon }}
|
||||
|
|
|
@ -63,6 +63,22 @@
|
|||
clearable
|
||||
@keyup.enter="handleUnitEnter"
|
||||
>
|
||||
<template #prepend>
|
||||
<v-tooltip v-if="unitError" location="bottom">
|
||||
<template #activator="{ props: unitTooltipProps }">
|
||||
<v-icon
|
||||
v-bind="unitTooltipProps"
|
||||
class="ml-2 mr-n3 opacity-100"
|
||||
color="primary"
|
||||
>
|
||||
{{ $globals.icons.alert }}
|
||||
</v-icon>
|
||||
</template>
|
||||
<span v-if="unitErrorTooltip">
|
||||
{{ unitErrorTooltip }}
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<template #no-data>
|
||||
<div class="caption text-center pb-2">
|
||||
{{ $t("recipe.press-enter-to-create") }}
|
||||
|
@ -104,6 +120,22 @@
|
|||
clearable
|
||||
@keyup.enter="handleFoodEnter"
|
||||
>
|
||||
<template #prepend>
|
||||
<v-tooltip v-if="foodError" location="bottom">
|
||||
<template #activator="{ props: foodTooltipProps }">
|
||||
<v-icon
|
||||
v-bind="foodTooltipProps"
|
||||
class="ml-2 mr-n3 opacity-100"
|
||||
color="primary"
|
||||
>
|
||||
{{ $globals.icons.alert }}
|
||||
</v-icon>
|
||||
</template>
|
||||
<span v-if="foodErrorTooltip">
|
||||
{{ foodErrorTooltip }}
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<template #no-data>
|
||||
<div class="caption text-center pb-2">
|
||||
{{ $t("recipe.press-enter-to-create") }}
|
||||
|
@ -153,7 +185,6 @@
|
|||
@toggle-original="toggleOriginalText"
|
||||
@insert-above="$emit('insert-above')"
|
||||
@insert-below="$emit('insert-below')"
|
||||
@insert-ingredient="$emit('insert-ingredient')"
|
||||
@delete="$emit('delete')"
|
||||
/>
|
||||
</div>
|
||||
|
@ -184,22 +215,33 @@ import type { RecipeIngredient } from "~/lib/api/types/recipe";
|
|||
// defineModel replaces modelValue prop
|
||||
const model = defineModel<RecipeIngredient>({ required: true });
|
||||
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
disableAmount: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
allowInsertIngredient: {
|
||||
unitError: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
unitErrorTooltip: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
foodError: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
foodErrorTooltip: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
defineEmits([
|
||||
"clickIngredientField",
|
||||
"insert-above",
|
||||
"insert-below",
|
||||
"insert-ingredient",
|
||||
"delete",
|
||||
]);
|
||||
|
||||
|
@ -228,13 +270,6 @@ const contextMenuOptions = computed(() => {
|
|||
},
|
||||
];
|
||||
|
||||
if (props.allowInsertIngredient) {
|
||||
options.push({
|
||||
text: i18n.t("recipe.insert-ingredient"),
|
||||
event: "insert-ingredient",
|
||||
});
|
||||
}
|
||||
|
||||
if (model.value.originalText) {
|
||||
options.push({
|
||||
text: i18n.t("recipe.see-original-text"),
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<div>
|
||||
<div v-if="lastMadeReady" class="d-flex justify-center flex-wrap">
|
||||
<v-row no-gutters class="d-flex flex-wrap align-center" style="font-size: larger">
|
||||
<v-tooltip bottom>
|
||||
<v-tooltip location="bottom">
|
||||
<template #activator="{ props }">
|
||||
<v-btn
|
||||
rounded
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
/>
|
||||
<div class="d-flex flex-wrap justify-center justify-sm-end mt-3">
|
||||
<v-tooltip
|
||||
top
|
||||
location="top"
|
||||
color="accent"
|
||||
>
|
||||
<template #activator="{ props }">
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<v-tooltip
|
||||
v-if="canEditScale"
|
||||
size="small"
|
||||
top
|
||||
location="top"
|
||||
color="secondary-darken-1"
|
||||
>
|
||||
<template #activator="{ props: tooltipProps }">
|
||||
|
@ -74,7 +74,7 @@
|
|||
@update:model-value="recalculateScale(parseFloat($event) || 0)"
|
||||
/>
|
||||
<v-tooltip
|
||||
end
|
||||
location="end"
|
||||
color="secondary-darken-1"
|
||||
>
|
||||
<template #activator="{ props }">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<v-tooltip
|
||||
bottom
|
||||
location="bottom"
|
||||
nudge-right="50"
|
||||
:color="buttonStyle ? 'info' : 'secondary'"
|
||||
>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
open-delay="200"
|
||||
transition="slide-x-reverse-transition"
|
||||
density="compact"
|
||||
right
|
||||
location="end"
|
||||
content-class="text-caption"
|
||||
>
|
||||
<template #activator="{ props: tooltipProps }">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<v-tooltip
|
||||
v-if="userId"
|
||||
:disabled="!user || !tooltip"
|
||||
right
|
||||
location="end"
|
||||
>
|
||||
<template #activator="{ props }">
|
||||
<v-avatar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue