Variant ui layout changes.

This commit is contained in:
2026-01-23 03:15:45 +01:00
parent 95fa29a6b3
commit 1b135b33aa
3 changed files with 134 additions and 42 deletions
@@ -53,7 +53,6 @@
<span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span> <span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span>
</template> </template>
</v-textarea> </v-textarea>
</v-col> </v-col>
<v-col cols="5" style="padding: 5px;"> <v-col cols="5" style="padding: 5px;">
+1 -5
View File
@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import {useLabelEditorStore} from "~/store/labelEditorStore"; import {useLabelEditorStore} from "~/store/labelEditorStore";
import {originToString} from "~/types/origin";
let store = useLabelEditorStore(); let store = useLabelEditorStore();
</script> </script>
@@ -24,16 +23,13 @@
<v-divider/> <v-divider/>
<v-card-text <v-card-text
v-for="(variant, index) in store.article.variants" v-for="(variant) in store.article.variants"
:key="variant.id" :key="variant.id"
> >
<VariantRow <VariantRow
v-bind:variant="variant" v-bind:variant="variant"
v-bind:variant-index="index"
/> />
<v-divider/>
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-container> </v-container>
</template> </template>
+107 -10
View File
@@ -1,13 +1,92 @@
<script setup lang="ts"> <script setup lang="ts">
import type {Variant} from "~/types/variant"; import type {Variant} from "~/types/variant";
import {useLabelEditorStore} from "~/store/labelEditorStore";
import type {Ref} from "vue";
let store = useLabelEditorStore();
const props = defineProps({ const props = defineProps({
variant: {type: Object as PropType<Variant>, required: true}, variant: {type: Object as PropType<Variant>, required: true},
variantIndex: {type: Number, required: true},
}); });
let edit: Ref<boolean> = ref<boolean>(false);
</script> </script>
<template> <template>
<v-card>
<v-card-title>
<v-row>
{{ variant.name }}
<v-spacer />
<v-divider vertical/>
<v-btn
:flat="true"
size="small"
:disabled="!edit"
>
<v-icon>mdi-delete-empty</v-icon>
<v-tooltip
activator="parent"
location="bottom"
>
Löschen
</v-tooltip>
</v-btn>
<v-divider vertical/>
<v-btn
:flat="true"
size="small"
:disabled="!edit"
>
<v-icon>mdi-cancel</v-icon>
<v-tooltip
activator="parent"
location="bottom"
>
Abbrechen
</v-tooltip>
</v-btn>
<v-btn
:flat="true"
size="small"
:disabled="!edit"
>
<v-icon>mdi-content-save</v-icon>
<v-tooltip
activator="parent"
location="bottom"
>
Speichern
</v-tooltip>
</v-btn>
<v-divider vertical/>
<v-btn
:flat="true"
size="small"
>
<v-icon>mdi-pencil</v-icon>
<v-tooltip
activator="parent"
location="bottom"
>
Bearbeiten
</v-tooltip>
</v-btn>
</v-row>
</v-card-title>
<v-divider/>
<v-card-text>
<v-row <v-row
align="start" align="start"
> >
@@ -29,23 +108,41 @@
</v-col> </v-col>
<v-col cols="5"> <v-col cols="5">
<v-text-field <v-textarea
v-model="variant.description" :model-value="variant.description"
label="Bezeichnung" :tile=true
label="Beschreibung"
counter
:persistentCounter=true
rows="6"
no-resize
:readonly="true" :readonly="true"
hide-details >
/> <template v-slot:counter="{ counter }">
<span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span>
</template>
</v-textarea>
</v-col> </v-col>
<v-col cols="5"> <v-col cols="5">
<v-text-field <v-textarea
v-model="variant.ingredients" :model-value="variant.ingredients"
:tile=true
label="Zutaten" label="Zutaten"
counter
:persistentCounter=true
rows="6"
no-resize
:readonly="true" :readonly="true"
hide-details >
/> <template v-slot:counter="{ counter }">
<span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span>
</template>
</v-textarea>
</v-col> </v-col>
</v-row> </v-row>
</v-card-text>
</v-card>
</template> </template>
<style scoped> <style scoped>