1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00

fix: Nuxt3 upgrades UI fixes & improvements (#5589)

This commit is contained in:
Arsène Reymond 2025-06-28 15:59:58 +02:00 committed by GitHub
parent 2fb5dac966
commit 084f99b0de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 137 additions and 133 deletions

View file

@ -74,6 +74,7 @@
:size="$vuetify.display.xs ? 'small' : undefined"
:color="btn.color"
variant="elevated"
:icon="$vuetify.display.xs"
@click="emitHandler(btn.event)"
>
<v-icon :left="!$vuetify.display.xs">

View file

@ -10,7 +10,7 @@
v-for="category in items.slice(0, limit)"
:key="category.name"
label
class="ma-1"
class="mr-1 mt-1"
color="accent"
variant="flat"
:size="small ? 'small' : 'default'"

View file

@ -17,7 +17,7 @@
id="arrow-search"
v-model="search.query.value"
autofocus
variant="solo-filled"
variant="solo"
flat
autocomplete="off"
bg-color="primary-lighten-1"

View file

@ -1,7 +1,7 @@
<template>
<v-container
fluid
class="pa-0"
class="px-0"
>
<div class="search-container pb-8">
<form

View file

@ -1,5 +1,5 @@
<template>
<div class="ma-0 pa-0 text-subtitle-1 dense-markdown ingredient-item">
<div class="text-subtitle-1 dense-markdown ingredient-item">
<SafeMarkdown
v-if="parsedIng.quantity"
class="d-inline"

View file

@ -28,6 +28,7 @@
</template>
<v-list-item
density="compact"
class="pa-0"
@click.stop="toggleChecked(index)"
>
<template #prepend>

View file

@ -59,7 +59,7 @@
<v-app-bar
color="transparent"
flat
class="mt-n1 rounded align-center px-4 position-relative w-100 left-0 top-0"
class="mt-n1 rounded align-center position-relative w-100 left-0 top-0"
>
<v-icon
size="large"

View file

@ -9,9 +9,9 @@
closable-chips
item-title="name"
multiple
variant="underlined"
:variant="variant"
:prepend-inner-icon="icon"
:append-icon="$globals.icons.create"
:append-icon="showAdd ? $globals.icons.create : undefined"
return-object
auto-select-first
class="pa-0"
@ -93,6 +93,10 @@ export default defineNuxtComponent({
type: Boolean,
default: true,
},
variant: {
type: String as () => "filled" | "underlined" | "outlined" | "plain" | "solo" | "solo-inverted" | "solo-filled",
default: "outlined",
},
},
emits: ["update:modelValue"],

View file

@ -1,6 +1,6 @@
<template>
<div>
<v-container v-show="!isCookMode" key="recipe-page" class="pt-0" :class="{ 'pa-0': $vuetify.display.smAndDown.value }">
<v-container v-show="!isCookMode" key="recipe-page" class="px-0" :class="{ 'pa-0': $vuetify.display.smAndDown.value }">
<v-card :flat="$vuetify.display.smAndDown.value" class="d-print-none">
<RecipePageHeader
:recipe="recipe"
@ -87,11 +87,10 @@
/>
<RecipePrintContainer :recipe="recipe" :scale="scale" />
</v-container>
<!-- Cook mode displayes two columns with ingredients and instructions side by side, each being scrolled individually, allowing to view both at the same timer -->
<!-- Cook mode displayes two columns with ingredients and instructions side by side, each being scrolled individually, allowing to view both at the same time -->
<v-sheet
v-show="isCookMode && !hasLinkedIngredients"
key="cookmode"
:style="{ height: $vuetify.display.smAndUp ? 'calc(100vh - 48px)' : '' }"
>
<!-- the calc is to account for the toolbar a more dynamic solution could be needed -->
<v-row style="height: 100%" no-gutters class="overflow-hidden">
@ -107,7 +106,12 @@
/>
<v-divider />
</v-col>
<v-col class="overflow-y-auto py-2" style="height: 100%" cols="12" sm="7">
<v-col class="overflow-y-auto"
:class="$vuetify.display.smAndDown.value ? 'py-2': 'py-6'"
style="height: 100%" cols="12" sm="7">
<h2 class="text-h5 px-4 font-weight-medium opacity-80">
{{ $t('recipe.instructions') }}
</h2>
<RecipePageInstructions
v-model="recipe.recipeInstructions"
v-model:assets="recipe.assets"

View file

@ -1,31 +1,28 @@
<template>
<div class="d-flex justify-start align-top py-2">
<div class="d-flex justify-start align-top flex-wrap">
<RecipeImageUploadBtn
class="my-1"
class="my-2"
:slug="recipe.slug"
@upload="uploadImage"
@refresh="imageKey++"
/>
<RecipeSettingsMenu
v-model="recipe.settings"
class="my-1 mx-1"
class="my-2 mx-1"
:is-owner="recipe.userId == user.id"
@upload="uploadImage"
/>
<v-spacer />
<v-container
class="py-0"
style="width: 40%;"
>
<v-select
v-model="recipe.userId"
class="my-2"
max-width="300"
:items="allUsers"
item-title="fullName"
item-value="id"
:item-props="itemsProps"
:label="$t('general.owner')"
hide-details
:disabled="!canEditOwner"
variant="underlined"
variant="outlined"
density="compact"
>
<template #prepend>
<UserAvatar
@ -34,17 +31,7 @@
/>
</template>
</v-select>
<v-card-text
v-if="ownerHousehold"
class="pa-0 d-flex"
style="align-items: flex-end;"
>
<v-spacer />
<v-icon>{{ $globals.icons.household }}</v-icon>
<span class="pl-1">{{ ownerHousehold.name }}</span>
</v-card-text>
</v-container>
</div>
</div>
</template>
<script setup lang="ts">
@ -71,13 +58,15 @@ const canEditOwner = computed(() => {
const { store: allUsers } = useUserStore();
const { store: households } = useHouseholdStore();
const ownerHousehold = computed(() => {
const owner = allUsers.value.find(u => u.id === recipe.value.userId);
if (!owner) {
return null;
}
return households.value.find(h => h.id === owner.householdId);
});
function itemsProps(item: any) {
const owner = allUsers.value.find(u => u.id === item.id);
return {
value: item.id,
title: item.fullName,
subtitle: owner ? households.value.find(h => h.id === owner.householdId)?.name || "" : "",
};
}
async function uploadImage(fileObject: File) {
if (!recipe.value || !recipe.value.slug) {

View file

@ -11,15 +11,17 @@
class="d-flex flex-column justify-center align-center"
>
<v-card-text class="w-100">
<v-card-title class="text-h5 font-weight-regular pa-0 d-flex flex-column align-center justify-center opacity-80">
<div class="d-flex flex-column align-center">
<v-card-title class="text-h5 font-weight-regular pa-0 text-wrap text-center opacity-80">
{{ recipe.name }}
<RecipeRating
</v-card-title>
<RecipeRating
:key="recipe.slug"
:value="recipe.rating"
:recipe-id="recipe.id"
:slug="recipe.slug"
/>
</v-card-title>
</div>
<v-divider class="my-2" />
<SafeMarkdown :source="recipe.description" class="my-3" />
<v-divider v-if="recipe.description" />
@ -52,7 +54,7 @@
</v-col>
</v-row>
</div>
<div class="mx-6">
<div v-if="recipe.prepTime || recipe.totalTime || recipe.performTime" class="mx-6">
<RecipeTimeCard
container-class="d-flex flex-wrap justify-center"
:prep-time="recipe.prepTime"

View file

@ -15,12 +15,13 @@
v-for="(tool, index) in recipe.tools"
:key="index"
density="compact"
class="px-1"
>
<template #prepend>
<v-checkbox
v-model="recipeTools[index].onHand"
hide-details
class="pt-0 my-auto py-auto"
class="pt-0 py-auto"
color="secondary"
density="compact"
@change="updateTool(index)"

View file

@ -60,7 +60,7 @@
{{ $t('tool.required-tools') }}
</v-card-title>
<v-divider class="mx-2" />
<v-card-text class="pt-0">
<v-card-text>
<RecipeOrganizerSelector
v-model="recipe.tools"
selector-type="tools"

View file

@ -141,6 +141,9 @@ export default defineNuxtComponent({
</script>
<style scoped>
.text-center {
font-size: smaller;
}
.time-card-flex {
width: fit-content;
}