@shopbite-de/storefront 1.31.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yaml +54 -0
- package/.nuxtrc +1 -1
- package/CLAUDE.md +23 -8
- package/app/app.vue +10 -6
- package/app/assets/css/main.css +100 -61
- package/app/components/AddToWishlist.vue +15 -25
- package/app/components/Address/Card.vue +6 -11
- package/app/components/Address/Detail.vue +23 -23
- package/app/components/Address/Fields.vue +175 -73
- package/app/components/Address/Form.vue +107 -106
- package/app/components/Cart/Bar.vue +6 -9
- package/app/components/Cart/Item.vue +48 -63
- package/app/components/Cart/QuickView.vue +38 -25
- package/app/components/Cart/Upsell.vue +24 -62
- package/app/components/Category/Breadcrumb.vue +29 -3
- package/app/components/Category/FilterGroup.vue +20 -41
- package/app/components/Category/Listing.vue +100 -130
- package/app/components/Category/SearchInput.vue +22 -19
- package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
- package/app/components/Checkout/LoginOrRegister.vue +28 -29
- package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
- package/app/components/Checkout/Summary.vue +90 -60
- package/app/components/Checkout/VoucherInput.vue +40 -27
- package/app/components/Contact/Form.vue +164 -192
- package/app/components/DemoBanner.vue +5 -5
- package/app/components/Footer/StoreStatus.vue +2 -2
- package/app/components/Footer.vue +125 -57
- package/app/components/Header.vue +283 -18
- package/app/components/Home/Categories.vue +116 -0
- package/app/components/Home/Facts.vue +71 -0
- package/app/components/Home/Faq.vue +34 -16
- package/app/components/Home/Hero.vue +172 -0
- package/app/components/Home/Highlights.vue +29 -37
- package/app/components/Home/Restaurant.vue +102 -0
- package/app/components/Menu/BonCard.vue +180 -0
- package/app/components/Menu/CartPanel.vue +24 -0
- package/app/components/Menu/CategoryIndex.vue +54 -0
- package/app/components/Menu/OrderMode.vue +20 -0
- package/app/components/Menu/SectionHeader.vue +38 -0
- package/app/components/Navigation/MobileTop.vue +23 -15
- package/app/components/Order/Confirmation.vue +119 -0
- package/app/components/Order/Detail.vue +80 -88
- package/app/components/Product/CardSkeleton.vue +8 -12
- package/app/components/Product/Configurator.vue +8 -16
- package/app/components/Product/CrossSelling.vue +75 -83
- package/app/components/Product/DeselectIngredient.vue +17 -22
- package/app/components/Product/Detail.vue +35 -27
- package/app/components/Product/QuickView.vue +80 -51
- package/app/components/SalesChannelSwitch.vue +14 -28
- package/app/components/Sb/Button.vue +70 -0
- package/app/components/Sb/Checkbox.vue +73 -0
- package/app/components/Sb/Chip.vue +51 -0
- package/app/components/Sb/ChoiceGroup.vue +82 -0
- package/app/components/Sb/ConfirmDialog.vue +60 -0
- package/app/components/Sb/Field.vue +77 -0
- package/app/components/Sb/Icon.vue +66 -0
- package/app/components/Sb/IconButton.vue +55 -0
- package/app/components/Sb/Input.vue +23 -0
- package/app/components/Sb/SegmentedControl.vue +34 -0
- package/app/components/Sb/Select.vue +49 -0
- package/app/components/Sb/Sheet.vue +83 -0
- package/app/components/Sb/Stars.vue +60 -0
- package/app/components/Sb/StatusPill.vue +38 -0
- package/app/components/Sb/Stepper.vue +72 -0
- package/app/components/User/AccountHeader.vue +16 -0
- package/app/components/User/AuthPanel.vue +41 -0
- package/app/components/User/Detail.vue +32 -29
- package/app/components/User/LoginForm.vue +92 -98
- package/app/components/User/RegistrationForm.vue +285 -249
- package/app/components/Wishlist.vue +55 -155
- package/app/composables/useCartMutations.ts +9 -27
- package/app/composables/useCheckoutMethodGuard.ts +2 -24
- package/app/composables/useContactForm.ts +66 -0
- package/app/composables/useHomeMenuCategories.ts +41 -0
- package/app/composables/useNavigation.ts +10 -2
- package/app/composables/useOrderMode.ts +65 -0
- package/app/composables/useRegistrationForm.ts +161 -0
- package/app/composables/useRestaurantSchema.ts +1 -1
- package/app/composables/useShareLink.ts +3 -13
- package/app/composables/useSortingSelection.ts +13 -0
- package/app/composables/useThemePreset.ts +15 -0
- package/app/composables/useVoucherCode.ts +7 -16
- package/app/composables/useWishlistActions.ts +0 -51
- package/app/error.vue +31 -9
- package/app/layouts/account.vue +45 -50
- package/app/layouts/default.vue +2 -3
- package/app/layouts/listing.vue +3 -5
- package/app/pages/[...all].vue +8 -4
- package/app/pages/account/recover/password/index.vue +113 -80
- package/app/pages/anmelden.vue +11 -10
- package/app/pages/bestellung/[id]/erfolg.vue +1 -15
- package/app/pages/bestellung/[id]/fehler.vue +63 -51
- package/app/pages/bestellung/[id]/index.vue +3 -85
- package/app/pages/bestellung/kasse.vue +29 -0
- package/app/pages/bestellung.vue +8 -60
- package/app/pages/index.vue +12 -52
- package/app/pages/kontakt.vue +27 -7
- package/app/pages/konto/adressen.vue +106 -102
- package/app/pages/konto/bestellung/[id].vue +9 -43
- package/app/pages/konto/bestellungen.vue +55 -33
- package/app/pages/konto/index.vue +47 -62
- package/app/pages/konto/profil.vue +162 -100
- package/app/pages/maintenance.vue +8 -6
- package/app/pages/merkliste.vue +7 -8
- package/app/pages/passwort-vergessen.vue +92 -75
- package/app/pages/registrierung/bestaetigen.vue +20 -48
- package/app/pages/registrierung/index.vue +16 -7
- package/app/pages/suche.vue +94 -95
- package/app/plugins/theme-preset.ts +9 -0
- package/app/utils/highlight.ts +25 -0
- package/app/utils/product.ts +9 -0
- package/app/validation/registrationSchema.ts +1 -1
- package/docs/notes/2026-10-07-issue-434-property-group-projection.md +27 -0
- package/docs/notes/2026-10-07-listing-payload.md +38 -0
- package/docs/notes/2026-10-07-nuxt-4.6-inline-error-rendering.md +31 -0
- package/modules/theme.ts +115 -0
- package/nuxt.config.ts +27 -15
- package/package.json +6 -8
- package/playwright.config.ts +11 -0
- package/server/api/listing/[categoryId].get.ts +10 -11
- package/server/api/product/[productId].get.ts +4 -2
- package/server/api/product/variant.get.ts +1 -2
- package/server/api/search.get.ts +7 -12
- package/shared/theme/presets.ts +303 -0
- package/test/a11y/presets.test.ts +225 -0
- package/test/nuxt/AccountPagesPreset.test.ts +191 -0
- package/test/nuxt/AuthPagesPreset.test.ts +87 -0
- package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
- package/test/nuxt/CartItem.test.ts +18 -3
- package/test/nuxt/CartUpsell.test.ts +1 -2
- package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
- package/test/nuxt/CheckoutOnePage.test.ts +115 -0
- package/test/nuxt/CheckoutSummary.test.ts +6 -6
- package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
- package/test/nuxt/ContactFormPreset.test.ts +115 -0
- package/test/nuxt/FooterStoreStatus.test.ts +2 -2
- package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
- package/test/nuxt/HomeFaq.test.ts +3 -2
- package/test/nuxt/MenuBonCard.test.ts +122 -0
- package/test/nuxt/OrderPagesPreset.test.ts +132 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
- package/test/nuxt/ProductCrossSelling.test.ts +2 -1
- package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
- package/test/nuxt/ProductSheetPreset.test.ts +105 -0
- package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
- package/test/nuxt/RegistrationForm.test.ts +89 -270
- package/test/nuxt/SbBaseComponents.test.ts +170 -0
- package/test/nuxt/SbStars.test.ts +25 -0
- package/test/nuxt/useCartMutations.test.ts +3 -17
- package/test/nuxt/useCartUpsell.test.ts +1 -1
- package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
- package/test/nuxt/useShareLink.test.ts +1 -9
- package/test/nuxt/useWishlistActions.test.ts +3 -26
- package/test/unit/highlight.spec.ts +31 -0
- package/test/unit/product.spec.ts +12 -0
- package/test/unit/themePresets.spec.ts +61 -0
- package/app/app.config.ts +0 -19
- package/app/components/AnimatedSection.vue +0 -74
- package/app/components/BottomNavi.vue +0 -70
- package/app/components/Category/Header.vue +0 -48
- package/app/components/Checkout/PaymentMethod.vue +0 -30
- package/app/components/Checkout/ShippingMethod.vue +0 -30
- package/app/components/Cta.vue +0 -30
- package/app/components/Feature/Card.vue +0 -121
- package/app/components/Features.vue +0 -42
- package/app/components/Footer/Contact.vue +0 -82
- package/app/components/Header/Body.vue +0 -82
- package/app/components/Header/Right.vue +0 -187
- package/app/components/Header/Title.vue +0 -10
- package/app/components/Hero.vue +0 -233
- package/app/components/Home/MenuCategories.vue +0 -148
- package/app/components/ImageGallery.vue +0 -63
- package/app/components/Loading.vue +0 -29
- package/app/components/Navigation/DesktopLeft.vue +0 -39
- package/app/components/Product/Card.vue +0 -177
- package/app/components/Product/CardCompact.vue +0 -72
- package/app/components/Product/CardDietBadges.vue +0 -43
- package/app/components/Product/CardIngredients.vue +0 -35
- package/app/components/Product/CardKitchen.vue +0 -34
- package/app/components/Product/Category.vue +0 -160
- package/app/components/Product/SearchBar.vue +0 -95
- package/app/components/PublicAnnouncement.vue +0 -17
- package/app/pages/bestellung/bestaetigen.vue +0 -16
- package/app/pages/bestellung/warenkorb.vue +0 -49
- package/app/pages/bestellung/zahlung-versand.vue +0 -25
- package/test/nuxt/AddressFields.test.ts +0 -222
- package/test/nuxt/AnimatedSection.test.ts +0 -67
- package/test/nuxt/ContactForm.test.ts +0 -207
- package/test/nuxt/FooterContact.test.ts +0 -102
- package/test/nuxt/HeaderRight.test.ts +0 -142
- package/test/nuxt/Hero.test.ts +0 -126
- package/test/nuxt/HomeMenuCategories.test.ts +0 -94
- package/test/nuxt/LoginForm.test.ts +0 -159
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Schemas } from "#shopware";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Title of a menu category in the presets (#441): name in the display
|
|
6
|
+
* font, dish count, the category description as a note. Replaces the photo
|
|
7
|
+
* banner, which made the menu look like a delivery platform.
|
|
8
|
+
*/
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
category: Schemas["Category"];
|
|
11
|
+
count: number;
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const name = computed(
|
|
15
|
+
() => props.category.translated?.name ?? props.category.name ?? "",
|
|
16
|
+
);
|
|
17
|
+
const description = computed(
|
|
18
|
+
() => props.category.translated?.description ?? props.category.description,
|
|
19
|
+
);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<header class="mt-6 mb-5 flex flex-col gap-3 md:mt-10">
|
|
24
|
+
<h1
|
|
25
|
+
class="flex flex-wrap items-baseline gap-x-3.5 gap-y-1 border-b-[1.5px] border-sb-ink pb-3"
|
|
26
|
+
>
|
|
27
|
+
<span class="font-display text-4xl leading-none md:text-5xl">{{
|
|
28
|
+
name
|
|
29
|
+
}}</span>
|
|
30
|
+
<span class="font-body text-sm font-medium text-sb-ink-muted"
|
|
31
|
+
>{{ count }} {{ count === 1 ? "Gericht" : "Gerichte" }}</span
|
|
32
|
+
>
|
|
33
|
+
</h1>
|
|
34
|
+
<p v-if="description" class="font-body text-[15px] text-sb-ink">
|
|
35
|
+
{{ description }}
|
|
36
|
+
</p>
|
|
37
|
+
</header>
|
|
38
|
+
</template>
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useNavigation } from "~/composables/useNavigation";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Menu categories as a horizontally scrolling row on phones and tablets
|
|
6
|
+
* (#445); the desktop menu has the word-list index (MenuCategoryIndex).
|
|
7
|
+
*/
|
|
4
8
|
const { menuCardMenu } = useNavigation(true);
|
|
9
|
+
const route = useRoute();
|
|
10
|
+
|
|
11
|
+
const isCurrent = (to?: string) =>
|
|
12
|
+
!!to && decodeURI(route.path).toLowerCase() === decodeURI(to).toLowerCase();
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<template>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
:ui="{
|
|
13
|
-
list: 'overflow-x-auto',
|
|
14
|
-
item: 'flex-shrink-0',
|
|
15
|
-
}"
|
|
16
|
+
<nav
|
|
17
|
+
v-if="menuCardMenu.length"
|
|
18
|
+
aria-label="Kategorien der Speisekarte"
|
|
19
|
+
class="border-b border-sb-line bg-sb-bg/95 font-body backdrop-blur-sm"
|
|
16
20
|
>
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
<ul class="flex gap-1 overflow-x-auto px-4 py-2 sm:px-6">
|
|
22
|
+
<li v-for="item in menuCardMenu" :key="item.to ?? item.label">
|
|
23
|
+
<NuxtLink
|
|
24
|
+
:to="item.to"
|
|
25
|
+
:aria-current="isCurrent(item.to) ? 'page' : undefined"
|
|
26
|
+
class="flex min-h-11 items-center rounded-sb-control px-3.5 font-semibold whitespace-nowrap text-sb-ink hover:bg-sb-muted focus-visible:outline-3 focus-visible:-outline-offset-3 focus-visible:outline-sb-focus aria-[current=page]:bg-sb-ink aria-[current=page]:text-sb-bg"
|
|
27
|
+
>{{ item.label }}</NuxtLink
|
|
28
|
+
>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</nav>
|
|
24
32
|
</template>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useOrderDetails } from "@shopware/composables";
|
|
3
|
+
import { formatDate } from "~/utils/formatDate";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Order confirmation and order page of the presets (#445): what the guest
|
|
7
|
+
* sees right after ordering (`success`) and when opening the order later
|
|
8
|
+
* (`detail`). Loads the order in the browser, like the Nuxt UI pages.
|
|
9
|
+
*/
|
|
10
|
+
const props = withDefaults(
|
|
11
|
+
defineProps<{
|
|
12
|
+
orderId: string;
|
|
13
|
+
kind?: "success" | "detail";
|
|
14
|
+
}>(),
|
|
15
|
+
{ kind: "detail" },
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const { order, loadOrderDetails, status } = useOrderDetails(props.orderId);
|
|
19
|
+
const { site } = useRuntimeConfig().public;
|
|
20
|
+
|
|
21
|
+
const state = ref<"loading" | "ready" | "failed">("loading");
|
|
22
|
+
|
|
23
|
+
onMounted(async () => {
|
|
24
|
+
try {
|
|
25
|
+
await loadOrderDetails();
|
|
26
|
+
state.value = order.value ? "ready" : "failed";
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error("[order][load]", error);
|
|
29
|
+
state.value = "failed";
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<div
|
|
36
|
+
class="mx-auto flex w-full max-w-2xl flex-col gap-6 font-body text-sb-ink"
|
|
37
|
+
>
|
|
38
|
+
<header v-if="kind === 'success'" class="flex flex-col items-start gap-3">
|
|
39
|
+
<span
|
|
40
|
+
class="flex size-14 items-center justify-center rounded-full bg-sb-primary-tint text-sb-primary-ink"
|
|
41
|
+
>
|
|
42
|
+
<SbIcon name="check" :size="28" />
|
|
43
|
+
</span>
|
|
44
|
+
<h1 class="font-display text-4xl leading-tight sm:text-5xl">
|
|
45
|
+
Vielen Dank für Ihre Bestellung
|
|
46
|
+
</h1>
|
|
47
|
+
<p class="text-lg">
|
|
48
|
+
Wir haben sie erhalten und bereiten sie jetzt vor.
|
|
49
|
+
<template v-if="order?.orderNumber">
|
|
50
|
+
Ihre Bestellnummer ist
|
|
51
|
+
<strong class="tabular-nums">{{ order.orderNumber }}</strong
|
|
52
|
+
>.
|
|
53
|
+
</template>
|
|
54
|
+
</p>
|
|
55
|
+
</header>
|
|
56
|
+
<header v-else class="flex flex-col gap-1">
|
|
57
|
+
<p class="text-sm font-bold tracking-wide text-sb-accent uppercase">
|
|
58
|
+
Bestellung
|
|
59
|
+
</p>
|
|
60
|
+
<h1 class="font-display text-4xl leading-tight tabular-nums sm:text-5xl">
|
|
61
|
+
{{ order?.orderNumber ?? "Ihre Bestellung" }}
|
|
62
|
+
</h1>
|
|
63
|
+
<p v-if="order?.createdAt" class="text-sb-ink-muted">
|
|
64
|
+
{{ formatDate(order.createdAt) }}
|
|
65
|
+
</p>
|
|
66
|
+
</header>
|
|
67
|
+
|
|
68
|
+
<p v-if="state === 'loading'" role="status" class="text-sb-ink-muted">
|
|
69
|
+
Bestellung wird geladen …
|
|
70
|
+
</p>
|
|
71
|
+
<div
|
|
72
|
+
v-else-if="state === 'failed'"
|
|
73
|
+
role="alert"
|
|
74
|
+
class="flex flex-col items-start gap-4 rounded-sb-card border-[1.5px] border-sb-danger bg-sb-surface p-6"
|
|
75
|
+
>
|
|
76
|
+
<p>
|
|
77
|
+
<strong class="block"
|
|
78
|
+
>Die Bestellung konnte nicht geladen werden.</strong
|
|
79
|
+
>
|
|
80
|
+
<template v-if="kind === 'success'">
|
|
81
|
+
Ihre Bestellung ist trotzdem bei uns eingegangen.
|
|
82
|
+
</template>
|
|
83
|
+
Bitte laden Sie die Seite neu oder rufen Sie uns an.
|
|
84
|
+
</p>
|
|
85
|
+
</div>
|
|
86
|
+
<section
|
|
87
|
+
v-else-if="order"
|
|
88
|
+
aria-labelledby="bestellung-details"
|
|
89
|
+
class="rounded-sb-card border border-sb-line bg-sb-surface p-6"
|
|
90
|
+
>
|
|
91
|
+
<h2 id="bestellung-details" class="mb-4 font-display text-2xl">
|
|
92
|
+
Ihre Bestellung
|
|
93
|
+
</h2>
|
|
94
|
+
<OrderDetail :order="order" :status="status" />
|
|
95
|
+
</section>
|
|
96
|
+
|
|
97
|
+
<section
|
|
98
|
+
v-if="site.telephone"
|
|
99
|
+
aria-labelledby="bestellung-anrufen"
|
|
100
|
+
class="flex flex-col items-start gap-3 rounded-sb-card bg-sb-muted p-6 sm:flex-row sm:items-center sm:justify-between"
|
|
101
|
+
>
|
|
102
|
+
<div>
|
|
103
|
+
<h2 id="bestellung-anrufen" class="font-bold">Stimmt etwas nicht?</h2>
|
|
104
|
+
<p class="text-sb-ink-muted">
|
|
105
|
+
Rufen Sie uns gleich an, dann können wir Ihre Bestellung noch ändern.
|
|
106
|
+
</p>
|
|
107
|
+
</div>
|
|
108
|
+
<SbButton variant="secondary" :to="toTelHref(site.telephone)">
|
|
109
|
+
<SbIcon name="phone" />
|
|
110
|
+
<span class="sr-only">Anrufen:</span>
|
|
111
|
+
{{ site.telephone }}
|
|
112
|
+
</SbButton>
|
|
113
|
+
</section>
|
|
114
|
+
|
|
115
|
+
<SbButton variant="ghost" to="/" class="self-start"
|
|
116
|
+
>Zur Startseite</SbButton
|
|
117
|
+
>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
@@ -1,122 +1,114 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Schemas } from "#shopware";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Order details of the presets (#445): order facts as a description list,
|
|
6
|
+
* the dishes as receipt lines and the totals. Every state is spelled out,
|
|
7
|
+
* nothing depends on colour.
|
|
8
|
+
*/
|
|
4
9
|
const props = defineProps<{
|
|
5
10
|
order: Schemas["Order"];
|
|
6
|
-
status
|
|
11
|
+
status?: string;
|
|
7
12
|
}>();
|
|
8
13
|
|
|
9
|
-
const { order } = toRefs(props);
|
|
10
|
-
|
|
11
14
|
const { getFormattedPrice } = useCommercePrice();
|
|
12
15
|
|
|
13
|
-
const lineItems = computed(
|
|
14
|
-
|
|
15
|
-
(
|
|
16
|
-
|
|
16
|
+
const lineItems = computed(
|
|
17
|
+
() =>
|
|
18
|
+
props.order.lineItems?.filter(
|
|
19
|
+
(item: Schemas["OrderLineItem"]) => item.parentId === null,
|
|
20
|
+
) ?? [],
|
|
17
21
|
);
|
|
18
22
|
|
|
19
|
-
const
|
|
20
|
-
|
|
23
|
+
const transaction = computed(() => props.order.transactions?.at(-1));
|
|
24
|
+
const paymentState = computed(() => {
|
|
25
|
+
const state = transaction.value?.stateMachineState;
|
|
26
|
+
return state?.translated?.name ?? state?.name;
|
|
27
|
+
});
|
|
28
|
+
const paymentMethod = computed(() => {
|
|
29
|
+
const method = transaction.value?.paymentMethod;
|
|
30
|
+
return method?.translated?.distinguishableName ?? method?.distinguishableName;
|
|
31
|
+
});
|
|
32
|
+
const shippingMethod = computed(() => {
|
|
33
|
+
const method = props.order.deliveries?.[0]?.shippingMethod;
|
|
34
|
+
return method?.translated?.name ?? method?.name;
|
|
35
|
+
});
|
|
36
|
+
// The checkout stores the chosen time as "Wunschlieferzeit: …" (Summary.vue).
|
|
37
|
+
const wishedTime = computed(() =>
|
|
38
|
+
props.order.customerComment?.replace(/^Wunschlieferzeit:\s*/, "").trim(),
|
|
21
39
|
);
|
|
22
40
|
|
|
23
|
-
|
|
24
|
-
|
|
41
|
+
// Restaurants sell gross prices; net orders (B2B) list the tax on top.
|
|
42
|
+
const taxLabel = computed(() =>
|
|
43
|
+
props.order.taxStatus === "net" ? "zzgl. MwSt." : "enthaltene MwSt.",
|
|
44
|
+
);
|
|
25
45
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
case "in_progress":
|
|
40
|
-
return "info";
|
|
41
|
-
default:
|
|
42
|
-
return "neutral";
|
|
43
|
-
}
|
|
44
|
-
});
|
|
46
|
+
const facts = computed(() =>
|
|
47
|
+
[
|
|
48
|
+
{ label: "Status", value: props.status },
|
|
49
|
+
{ label: "Lieferung oder Abholung", value: shippingMethod.value },
|
|
50
|
+
{ label: "Wunschzeit", value: wishedTime.value },
|
|
51
|
+
{
|
|
52
|
+
label: "Bezahlung",
|
|
53
|
+
value: [paymentMethod.value, paymentState.value]
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
.join(", "),
|
|
56
|
+
},
|
|
57
|
+
].filter((fact) => fact.value),
|
|
58
|
+
);
|
|
45
59
|
</script>
|
|
46
60
|
|
|
47
61
|
<template>
|
|
48
|
-
<div class="flex flex-col gap-6">
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
{{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
variant="subtle"
|
|
56
|
-
color="neutral"
|
|
57
|
-
icon="i-lucide-truck"
|
|
58
|
-
>
|
|
59
|
-
{{ order.deliveries[0].shippingMethod.name }}
|
|
60
|
-
</UBadge>
|
|
61
|
-
<UBadge
|
|
62
|
-
v-if="paymentState"
|
|
63
|
-
variant="subtle"
|
|
64
|
-
:color="paymentStateColor"
|
|
65
|
-
icon="i-lucide-credit-card"
|
|
66
|
-
>
|
|
67
|
-
{{ paymentState.translated?.name ?? paymentState.name }}
|
|
68
|
-
</UBadge>
|
|
69
|
-
</div>
|
|
62
|
+
<div class="flex flex-col gap-6 font-body text-sb-ink">
|
|
63
|
+
<dl v-if="facts.length" class="grid gap-x-6 gap-y-3 sm:grid-cols-2">
|
|
64
|
+
<div v-for="fact in facts" :key="fact.label">
|
|
65
|
+
<dt class="text-sm text-sb-ink-muted">{{ fact.label }}</dt>
|
|
66
|
+
<dd class="font-semibold">{{ fact.value }}</dd>
|
|
67
|
+
</div>
|
|
68
|
+
</dl>
|
|
70
69
|
|
|
71
|
-
<ul class="flex flex-col
|
|
70
|
+
<ul class="flex flex-col border-t border-sb-line">
|
|
72
71
|
<li
|
|
73
72
|
v-for="item in lineItems"
|
|
74
73
|
:key="item.id"
|
|
75
|
-
class="
|
|
74
|
+
class="grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 border-b border-sb-line py-3"
|
|
76
75
|
>
|
|
77
|
-
<
|
|
78
|
-
class="
|
|
76
|
+
<span class="font-semibold [overflow-wrap:anywhere] hyphens-auto">
|
|
77
|
+
<span class="tabular-nums">{{ item.quantity }}×</span>
|
|
78
|
+
{{ item.label }}
|
|
79
|
+
</span>
|
|
80
|
+
<span class="font-semibold tabular-nums">{{
|
|
81
|
+
getFormattedPrice(item.totalPrice)
|
|
82
|
+
}}</span>
|
|
83
|
+
<span
|
|
84
|
+
v-if="item.payload?.productNumber"
|
|
85
|
+
class="text-sm text-sb-ink-muted"
|
|
86
|
+
>Nr. {{ item.payload.productNumber }}</span
|
|
79
87
|
>
|
|
80
|
-
{{ item.quantity }}×
|
|
81
|
-
</div>
|
|
82
|
-
<div class="flex flex-col gap-0.5 flex-1 min-w-0">
|
|
83
|
-
<p class="font-medium truncate">{{ item.label }}</p>
|
|
84
|
-
<p
|
|
85
|
-
v-if="item.payload?.productNumber"
|
|
86
|
-
class="text-xs text-muted truncate"
|
|
87
|
-
>
|
|
88
|
-
#{{ item.payload.productNumber }}
|
|
89
|
-
</p>
|
|
90
|
-
</div>
|
|
91
|
-
<p class="font-semibold shrink-0">
|
|
92
|
-
{{ getFormattedPrice(item.totalPrice) }}
|
|
93
|
-
</p>
|
|
94
88
|
</li>
|
|
95
89
|
</ul>
|
|
96
90
|
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</div>
|
|
104
|
-
<div class="flex justify-between text-muted">
|
|
105
|
-
<span>Netto</span>
|
|
106
|
-
<span>{{ getFormattedPrice(order?.amountNet) }}</span>
|
|
91
|
+
<dl class="flex flex-col gap-1.5">
|
|
92
|
+
<div class="flex justify-between gap-4 text-sb-ink-muted">
|
|
93
|
+
<dt>Lieferkosten</dt>
|
|
94
|
+
<dd class="tabular-nums">
|
|
95
|
+
{{ getFormattedPrice(order.shippingTotal) }}
|
|
96
|
+
</dd>
|
|
107
97
|
</div>
|
|
108
98
|
<div
|
|
109
|
-
v-for="tax in order
|
|
99
|
+
v-for="tax in order.price?.calculatedTaxes"
|
|
110
100
|
:key="tax.taxRate"
|
|
111
|
-
class="flex justify-between text-muted"
|
|
101
|
+
class="flex justify-between gap-4 text-sb-ink-muted"
|
|
112
102
|
>
|
|
113
|
-
<
|
|
114
|
-
<
|
|
103
|
+
<dt>{{ taxLabel }} {{ tax.taxRate }} %</dt>
|
|
104
|
+
<dd class="tabular-nums">{{ getFormattedPrice(tax.tax) }}</dd>
|
|
115
105
|
</div>
|
|
116
|
-
<div
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
<div
|
|
107
|
+
class="mt-1 flex justify-between gap-4 border-t-[1.5px] border-sb-ink pt-2 text-lg font-bold"
|
|
108
|
+
>
|
|
109
|
+
<dt>Gesamt</dt>
|
|
110
|
+
<dd class="tabular-nums">{{ getFormattedPrice(order.amountTotal) }}</dd>
|
|
119
111
|
</div>
|
|
120
|
-
</
|
|
112
|
+
</dl>
|
|
121
113
|
</div>
|
|
122
114
|
</template>
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- placeholder of a bon card while the menu loads -->
|
|
2
3
|
<div
|
|
3
|
-
class="flex
|
|
4
|
+
class="flex h-28 overflow-hidden rounded-sb-card bg-sb-surface motion-safe:animate-pulse"
|
|
5
|
+
aria-hidden="true"
|
|
4
6
|
>
|
|
5
|
-
<div class="
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<USkeleton class="h-5 w-14" />
|
|
11
|
-
</div>
|
|
12
|
-
<div class="flex gap-1.5">
|
|
13
|
-
<USkeleton class="h-6 w-24 rounded-full" />
|
|
14
|
-
<USkeleton class="h-6 w-20 rounded-full" />
|
|
15
|
-
<USkeleton class="h-6 w-16 rounded-full" />
|
|
7
|
+
<div class="w-[60px] shrink-0 bg-sb-muted sm:w-[72px]" />
|
|
8
|
+
<div class="flex flex-1 flex-col gap-2 p-4">
|
|
9
|
+
<div class="h-5 w-40 rounded bg-sb-muted" />
|
|
10
|
+
<div class="h-4 w-56 max-w-full rounded bg-sb-muted" />
|
|
11
|
+
<div class="mt-auto h-4 w-14 rounded bg-sb-muted" />
|
|
16
12
|
</div>
|
|
17
13
|
</div>
|
|
18
14
|
</template>
|
|
@@ -14,6 +14,8 @@ const { variants: selectableOptions } = useProductVariantsZwei(configurator);
|
|
|
14
14
|
|
|
15
15
|
const selectedOptions = ref<Record<string, string>>({});
|
|
16
16
|
|
|
17
|
+
// Presets show the options as a radio list, every option visible (#442).
|
|
18
|
+
|
|
17
19
|
const options = product.value.options as Schemas["PropertyGroupOption"][];
|
|
18
20
|
for (const option of options ?? []) {
|
|
19
21
|
if (option.group && option.id) {
|
|
@@ -42,23 +44,13 @@ const emit = defineEmits<{
|
|
|
42
44
|
</script>
|
|
43
45
|
<template>
|
|
44
46
|
<div class="flex flex-col gap-5">
|
|
45
|
-
<
|
|
47
|
+
<SbChoiceGroup
|
|
46
48
|
v-for="(variantGroup, propertyGroupId) in selectableOptions"
|
|
47
49
|
:key="propertyGroupId"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<USelect
|
|
54
|
-
v-model="selectedOptions[propertyGroupId]"
|
|
55
|
-
value-key="productId"
|
|
56
|
-
:items="variantGroup.options"
|
|
57
|
-
size="lg"
|
|
58
|
-
class="w-full"
|
|
59
|
-
icon="i-lucide-square-stack"
|
|
60
|
-
:aria-label="variantGroup.name"
|
|
61
|
-
/>
|
|
62
|
-
</div>
|
|
50
|
+
v-model="selectedOptions[propertyGroupId]"
|
|
51
|
+
:legend="variantGroup.name"
|
|
52
|
+
:options="variantGroup.options"
|
|
53
|
+
required
|
|
54
|
+
/>
|
|
63
55
|
</div>
|
|
64
56
|
</template>
|
|
@@ -90,6 +90,8 @@ function summary(association: AssociationItem) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const baseId = useId();
|
|
93
|
+
|
|
94
|
+
// Presets render the list with the base components (#442).
|
|
93
95
|
const groupId = (index: number) => `${baseId}-extras-${index}`;
|
|
94
96
|
|
|
95
97
|
watch(selectedExtras, () => emit("extras-selected", selectedExtras.value), {
|
|
@@ -98,96 +100,86 @@ watch(selectedExtras, () => emit("extras-selected", selectedExtras.value), {
|
|
|
98
100
|
</script>
|
|
99
101
|
|
|
100
102
|
<template>
|
|
101
|
-
<div
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<button
|
|
107
|
-
type="button"
|
|
108
|
-
class="flex items-center gap-2 py-1 text-start"
|
|
109
|
-
:aria-expanded="openGroups.includes(association.label)"
|
|
110
|
-
:aria-controls="groupId(index)"
|
|
111
|
-
@click="toggleGroup(association.label)"
|
|
103
|
+
<div>
|
|
104
|
+
<div
|
|
105
|
+
v-for="(association, index) in associations"
|
|
106
|
+
:key="association.label"
|
|
107
|
+
class="flex flex-col"
|
|
112
108
|
>
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
class="
|
|
116
|
-
:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
association.label
|
|
120
|
-
}}</span>
|
|
121
|
-
<span
|
|
122
|
-
class="ms-auto text-xs"
|
|
123
|
-
:class="
|
|
124
|
-
association.products.some(isSelected)
|
|
125
|
-
? 'font-medium text-primary'
|
|
126
|
-
: 'text-muted'
|
|
127
|
-
"
|
|
109
|
+
<button
|
|
110
|
+
type="button"
|
|
111
|
+
class="flex min-h-11 items-center gap-2 text-start font-body text-sb-ink focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus"
|
|
112
|
+
:aria-expanded="openGroups.includes(association.label)"
|
|
113
|
+
:aria-controls="groupId(index)"
|
|
114
|
+
@click="toggleGroup(association.label)"
|
|
128
115
|
>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
116
|
+
<SbIcon
|
|
117
|
+
name="chevron-down"
|
|
118
|
+
class="text-sb-ink-muted transition-transform motion-reduce:transition-none"
|
|
119
|
+
:class="{ '-rotate-90': !openGroups.includes(association.label) }"
|
|
120
|
+
/>
|
|
121
|
+
<span class="font-bold">{{ association.label }}</span>
|
|
122
|
+
<span
|
|
123
|
+
class="ms-auto rounded-full px-2.5 py-0.5 text-xs font-semibold"
|
|
124
|
+
:class="
|
|
125
|
+
association.products.some(isSelected)
|
|
126
|
+
? 'bg-sb-primary-tint text-sb-primary-ink'
|
|
127
|
+
: 'bg-sb-muted text-sb-ink-muted'
|
|
128
|
+
"
|
|
129
|
+
>
|
|
130
|
+
{{ summary(association) }}
|
|
131
|
+
</span>
|
|
132
|
+
</button>
|
|
132
133
|
|
|
133
|
-
<div
|
|
134
|
-
v-if="openGroups.includes(association.label)"
|
|
135
|
-
:id="groupId(index)"
|
|
136
|
-
class="flex flex-col gap-1 pt-2"
|
|
137
|
-
>
|
|
138
|
-
<UInput
|
|
139
|
-
v-if="association.products.length > SEARCH_THRESHOLD"
|
|
140
|
-
v-model="queries[association.label]"
|
|
141
|
-
icon="i-lucide-search"
|
|
142
|
-
:placeholder="`${association.label} durchsuchen`"
|
|
143
|
-
:aria-label="`${association.label} durchsuchen`"
|
|
144
|
-
class="mb-1 w-full"
|
|
145
|
-
/>
|
|
146
134
|
<div
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
135
|
+
v-if="openGroups.includes(association.label)"
|
|
136
|
+
:id="groupId(index)"
|
|
137
|
+
class="flex flex-col pt-1"
|
|
150
138
|
>
|
|
151
|
-
<
|
|
152
|
-
v-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
:ui="{
|
|
158
|
-
root: 'items-center rounded-none border-0 px-1 py-2.5',
|
|
159
|
-
wrapper: 'ms-3',
|
|
160
|
-
label: 'flex items-baseline justify-between gap-3 font-normal',
|
|
161
|
-
}"
|
|
162
|
-
@update:model-value="setSelected(extra, $event === true)"
|
|
139
|
+
<SbField
|
|
140
|
+
v-if="association.products.length > SEARCH_THRESHOLD"
|
|
141
|
+
v-slot="{ id }"
|
|
142
|
+
:label="`${association.label} durchsuchen`"
|
|
143
|
+
hide-label
|
|
144
|
+
class="mb-1"
|
|
163
145
|
>
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
</
|
|
146
|
+
<SbInput
|
|
147
|
+
:id="id"
|
|
148
|
+
v-model="queries[association.label]"
|
|
149
|
+
type="search"
|
|
150
|
+
:placeholder="`${association.products.length} ${association.label} durchsuchen`"
|
|
151
|
+
/>
|
|
152
|
+
</SbField>
|
|
153
|
+
<div role="group" :aria-label="association.label">
|
|
154
|
+
<SbCheckbox
|
|
155
|
+
v-for="extra in visibleProducts(association)"
|
|
156
|
+
:key="extra.value"
|
|
157
|
+
:label="extra.label"
|
|
158
|
+
:trailing="`+${extra.price}`"
|
|
159
|
+
:model-value="isSelected(extra)"
|
|
160
|
+
@update:model-value="setSelected(extra, $event)"
|
|
161
|
+
/>
|
|
162
|
+
</div>
|
|
163
|
+
<p
|
|
164
|
+
v-if="
|
|
165
|
+
queries[association.label]?.trim() &&
|
|
166
|
+
visibleProducts(association).length === 0
|
|
167
|
+
"
|
|
168
|
+
class="py-2 text-sm text-sb-ink-muted"
|
|
169
|
+
role="status"
|
|
170
|
+
>
|
|
171
|
+
Keine Treffer
|
|
172
|
+
</p>
|
|
173
|
+
<SbButton
|
|
174
|
+
v-if="hiddenCount(association) > 0"
|
|
175
|
+
variant="ghost"
|
|
176
|
+
class="self-start"
|
|
177
|
+
@click="expandedGroups = [...expandedGroups, association.label]"
|
|
178
|
+
>
|
|
179
|
+
Alle {{ association.products.length }} anzeigen
|
|
180
|
+
<template #trailing><SbIcon name="chevron-down" /></template>
|
|
181
|
+
</SbButton>
|
|
171
182
|
</div>
|
|
172
|
-
<p
|
|
173
|
-
v-if="
|
|
174
|
-
queries[association.label]?.trim() &&
|
|
175
|
-
visibleProducts(association).length === 0
|
|
176
|
-
"
|
|
177
|
-
class="py-2 text-sm text-muted"
|
|
178
|
-
>
|
|
179
|
-
Keine Treffer
|
|
180
|
-
</p>
|
|
181
|
-
<UButton
|
|
182
|
-
v-if="hiddenCount(association) > 0"
|
|
183
|
-
variant="link"
|
|
184
|
-
color="primary"
|
|
185
|
-
trailing-icon="i-lucide-chevron-down"
|
|
186
|
-
class="self-start px-1"
|
|
187
|
-
@click="expandedGroups = [...expandedGroups, association.label]"
|
|
188
|
-
>
|
|
189
|
-
Alle {{ association.products.length }} anzeigen
|
|
190
|
-
</UButton>
|
|
191
183
|
</div>
|
|
192
184
|
</div>
|
|
193
185
|
</template>
|