@shopbite-de/storefront 1.31.3 → 2.0.1
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 +87 -0
- package/.gitignore +5 -0
- package/CLAUDE.md +27 -8
- package/app/app.vue +10 -6
- package/app/assets/css/main.css +103 -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 +24 -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/modules/theme.ts +123 -0
- package/nuxt.config.ts +30 -16
- package/package.json +6 -8
- package/playwright.config.ts +11 -0
- package/server/api/listing/[categoryId].get.ts +3 -0
- package/shared/theme/presets.ts +303 -0
- package/test/a11y/presets.test.ts +225 -0
- package/test/layer/nuxt.config.ts +8 -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/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
|
@@ -44,6 +44,17 @@ const formattedPrice = computed(() => {
|
|
|
44
44
|
: "";
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
+
// Presets: stepper that turns into a remove button at 1 (#443).
|
|
48
|
+
const options = computed(
|
|
49
|
+
() =>
|
|
50
|
+
((props.cartItem?.type === "container"
|
|
51
|
+
? props.cartItem?.children?.[0]?.payload?.options
|
|
52
|
+
: props.cartItem?.payload?.options) ?? []) as {
|
|
53
|
+
group: string;
|
|
54
|
+
option: string;
|
|
55
|
+
}[],
|
|
56
|
+
);
|
|
57
|
+
|
|
47
58
|
const handleRemoveItem = () => {
|
|
48
59
|
if (!props.cartItem) return;
|
|
49
60
|
removeLineItem(props.cartItem);
|
|
@@ -51,72 +62,46 @@ const handleRemoveItem = () => {
|
|
|
51
62
|
</script>
|
|
52
63
|
|
|
53
64
|
<template>
|
|
54
|
-
<div class="cart-item">
|
|
55
|
-
<div
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
<!-- Quantity input and delete button row -->
|
|
87
|
-
<div v-if="withQuantityInput" class="flex flex-row items-center gap-2">
|
|
88
|
-
<UInputNumber
|
|
89
|
-
v-model="quantity"
|
|
90
|
-
:min="1"
|
|
91
|
-
:max="100"
|
|
92
|
-
class="max-w-46"
|
|
93
|
-
aria-label="Menge"
|
|
94
|
-
/>
|
|
95
|
-
<UButton
|
|
96
|
-
v-if="withDeleteButton"
|
|
97
|
-
icon="i-lucide-trash"
|
|
98
|
-
variant="soft"
|
|
99
|
-
color="neutral"
|
|
100
|
-
aria-label="Artikel entfernen"
|
|
101
|
-
:disabled="isMutating"
|
|
102
|
-
@click="handleRemoveItem"
|
|
103
|
-
/>
|
|
104
|
-
</div>
|
|
105
|
-
<!-- Delete button alone if no quantity input -->
|
|
106
|
-
<UButton
|
|
65
|
+
<div class="cart-item font-body text-sb-ink">
|
|
66
|
+
<div
|
|
67
|
+
v-if="cartItem"
|
|
68
|
+
class="grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-3 gap-y-2 border-b border-sb-line py-4"
|
|
69
|
+
>
|
|
70
|
+
<h3 class="text-base font-bold">
|
|
71
|
+
<span v-if="!withQuantityInput" class="tabular-nums"
|
|
72
|
+
>{{ quantity }}×
|
|
73
|
+
</span>
|
|
74
|
+
{{ cartItem.label }}
|
|
75
|
+
</h3>
|
|
76
|
+
<span class="font-semibold tabular-nums">{{ formattedPrice }}</span>
|
|
77
|
+
<p
|
|
78
|
+
v-for="option in options"
|
|
79
|
+
:key="option.group + option.option"
|
|
80
|
+
class="col-span-full text-sm text-sb-ink-muted"
|
|
81
|
+
>
|
|
82
|
+
{{ option.group }}: {{ option.option }}
|
|
83
|
+
</p>
|
|
84
|
+
<SbStepper
|
|
85
|
+
v-if="withQuantityInput"
|
|
86
|
+
v-model="quantity"
|
|
87
|
+
class="col-span-full justify-self-start"
|
|
88
|
+
:item-name="cartItem.label ?? 'Artikel'"
|
|
89
|
+
:max="100"
|
|
90
|
+
:removable="withDeleteButton"
|
|
91
|
+
@remove="handleRemoveItem"
|
|
92
|
+
/>
|
|
93
|
+
<SbIconButton
|
|
107
94
|
v-else-if="withDeleteButton"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
color="error"
|
|
111
|
-
aria-label="Artikel entfernen"
|
|
95
|
+
class="col-span-full justify-self-start"
|
|
96
|
+
:label="`${cartItem.label} entfernen`"
|
|
112
97
|
:disabled="isMutating"
|
|
113
98
|
@click="handleRemoveItem"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<!-- Empty state -->
|
|
118
|
-
<div v-else class="text-center py-4">
|
|
119
|
-
<p class="text-muted">Warenkorb ist leer...</p>
|
|
99
|
+
>
|
|
100
|
+
<SbIcon name="trash" />
|
|
101
|
+
</SbIconButton>
|
|
120
102
|
</div>
|
|
103
|
+
<p v-else class="py-4 text-center text-sb-ink-muted">
|
|
104
|
+
Der Warenkorb ist leer.
|
|
105
|
+
</p>
|
|
121
106
|
</div>
|
|
122
107
|
</template>
|
|
@@ -21,8 +21,14 @@ const emit = defineEmits(["go-to-cart"]);
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<template>
|
|
24
|
-
<div class="flex flex-col gap-
|
|
25
|
-
<div class="flex flex-col gap-
|
|
24
|
+
<div class="flex h-full flex-col justify-between gap-5 font-body text-sb-ink">
|
|
25
|
+
<div v-if="isEmpty" class="flex flex-col items-start gap-3 py-2">
|
|
26
|
+
<p class="text-sb-ink-muted">Der Warenkorb ist noch leer.</p>
|
|
27
|
+
<SbButton variant="secondary" to="/" @click="emit('go-to-cart')"
|
|
28
|
+
>Zur Speisekarte</SbButton
|
|
29
|
+
>
|
|
30
|
+
</div>
|
|
31
|
+
<div v-else class="flex flex-col">
|
|
26
32
|
<CartItem
|
|
27
33
|
v-for="lineItem in cart?.lineItems ?? []"
|
|
28
34
|
:key="lineItem.id"
|
|
@@ -31,33 +37,40 @@ const emit = defineEmits(["go-to-cart"]);
|
|
|
31
37
|
:with-delete-button="withDeleteButton"
|
|
32
38
|
/>
|
|
33
39
|
</div>
|
|
34
|
-
<div class="flex flex-col gap-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
<div v-if="!isEmpty" class="flex flex-col gap-3">
|
|
41
|
+
<LazyCartUpsell v-if="withUpsell" />
|
|
42
|
+
<dl class="flex flex-col gap-2 text-[15px] tabular-nums">
|
|
43
|
+
<div class="flex justify-between text-sb-ink-muted">
|
|
44
|
+
<dt>Lieferung</dt>
|
|
45
|
+
<dd
|
|
46
|
+
:class="
|
|
47
|
+
shippingTotal === 0 ? 'font-semibold text-sb-primary-ink' : ''
|
|
48
|
+
"
|
|
49
|
+
>
|
|
50
|
+
{{
|
|
51
|
+
shippingTotal === 0
|
|
52
|
+
? "kostenlos"
|
|
53
|
+
: getFormattedPrice(shippingTotal)
|
|
54
|
+
}}
|
|
55
|
+
</dd>
|
|
56
|
+
</div>
|
|
57
|
+
<div
|
|
58
|
+
class="flex justify-between border-t border-sb-line pt-2.5 text-lg font-bold"
|
|
59
|
+
>
|
|
60
|
+
<dt>Gesamt</dt>
|
|
61
|
+
<dd>{{ getFormattedPrice(cart?.price.totalPrice) }}</dd>
|
|
62
|
+
</div>
|
|
63
|
+
</dl>
|
|
64
|
+
<SbButton
|
|
53
65
|
v-if="withToCartButton"
|
|
54
|
-
:disabled="isEmpty"
|
|
55
66
|
block
|
|
56
67
|
size="lg"
|
|
57
|
-
|
|
58
|
-
to="/bestellung"
|
|
68
|
+
to="/bestellung/kasse"
|
|
59
69
|
@click="emit('go-to-cart')"
|
|
60
|
-
|
|
70
|
+
>
|
|
71
|
+
Zur Kasse
|
|
72
|
+
<template #trailing><SbIcon name="chevron-right" /></template>
|
|
73
|
+
</SbButton>
|
|
61
74
|
</div>
|
|
62
75
|
</div>
|
|
63
76
|
</template>
|
|
@@ -25,82 +25,44 @@ const products = computed(() =>
|
|
|
25
25
|
|
|
26
26
|
const productName = (product: Schemas["Product"]) =>
|
|
27
27
|
product.translated?.name ?? product.name;
|
|
28
|
+
|
|
29
|
+
// Presets: compact rows that fit the narrow order card (#443).
|
|
28
30
|
</script>
|
|
29
31
|
|
|
30
32
|
<template>
|
|
31
|
-
<!-- Tinted box with offer cards, so the suggestions do not read as line items. -->
|
|
32
33
|
<section
|
|
33
34
|
v-if="products.length > 0"
|
|
34
35
|
aria-labelledby="cart-upsell-title"
|
|
35
|
-
class="flex flex-col gap-
|
|
36
|
+
class="flex flex-col gap-1 rounded-sb-card bg-sb-muted p-4 font-body text-sb-ink"
|
|
36
37
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class="flex items-center gap-1.5 font-bold text-highlighted"
|
|
41
|
-
>
|
|
42
|
-
<UIcon name="i-lucide-sparkles" class="size-4 text-primary" />
|
|
43
|
-
Dazu passt
|
|
44
|
-
</h3>
|
|
45
|
-
<p class="text-sm text-muted">
|
|
46
|
-
Mit einem Klick zur Bestellung hinzufügen.
|
|
47
|
-
</p>
|
|
48
|
-
</div>
|
|
49
|
-
<!-- One suggestion spans the full width; with more the next one peeks in. -->
|
|
50
|
-
<ul
|
|
51
|
-
class="flex snap-x snap-mandatory gap-3 overflow-x-auto [scrollbar-width:thin]"
|
|
38
|
+
<h3
|
|
39
|
+
id="cart-upsell-title"
|
|
40
|
+
class="text-xs font-bold tracking-[0.14em] text-sb-accent uppercase"
|
|
52
41
|
>
|
|
42
|
+
Dazu passt
|
|
43
|
+
</h3>
|
|
44
|
+
<ul class="flex flex-col">
|
|
53
45
|
<li
|
|
54
46
|
v-for="product in products"
|
|
55
47
|
:key="product.id"
|
|
56
|
-
class="flex
|
|
57
|
-
:class="products.length > 1 ? 'w-[85%]' : 'w-full'"
|
|
48
|
+
class="flex items-center gap-3 border-b border-sb-line py-2.5 last:border-0"
|
|
58
49
|
>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<div
|
|
71
|
-
v-else
|
|
72
|
-
class="flex size-28 shrink-0 items-center justify-center bg-gradient-to-b from-brand-100 to-brand-200 text-brand-600 sm:size-36"
|
|
73
|
-
aria-hidden="true"
|
|
50
|
+
<span class="flex min-w-0 flex-1 flex-col">
|
|
51
|
+
<span class="font-semibold">{{ productName(product) }}</span>
|
|
52
|
+
<span class="text-sm text-sb-ink-muted tabular-nums">{{
|
|
53
|
+
getFormattedPrice(product.calculatedPrice.totalPrice)
|
|
54
|
+
}}</span>
|
|
55
|
+
</span>
|
|
56
|
+
<SbIconButton
|
|
57
|
+
variant="tint"
|
|
58
|
+
:label="`${productName(product)} in den Warenkorb`"
|
|
59
|
+
:disabled="!productIsAvailable(product) || isAdding(product.id)"
|
|
60
|
+
@click="addUpsellProduct(product)"
|
|
74
61
|
>
|
|
75
|
-
<
|
|
76
|
-
</
|
|
77
|
-
<div class="flex min-w-0 flex-1 flex-col gap-0.5 p-3">
|
|
78
|
-
<span class="text-xs font-semibold text-primary">
|
|
79
|
-
#{{ product.productNumber }}
|
|
80
|
-
</span>
|
|
81
|
-
<span
|
|
82
|
-
class="line-clamp-2 text-sm font-semibold text-highlighted sm:text-base"
|
|
83
|
-
>
|
|
84
|
-
{{ productName(product) }}
|
|
85
|
-
</span>
|
|
86
|
-
<div class="mt-auto flex items-center justify-between gap-2 pt-1">
|
|
87
|
-
<span class="font-bold text-highlighted">
|
|
88
|
-
{{ getFormattedPrice(product.calculatedPrice.totalPrice) }}
|
|
89
|
-
</span>
|
|
90
|
-
<UButton
|
|
91
|
-
icon="i-lucide-plus"
|
|
92
|
-
variant="subtle"
|
|
93
|
-
class="shrink-0"
|
|
94
|
-
:aria-label="`${productName(product)} in den Warenkorb`"
|
|
95
|
-
:loading="isAdding(product.id)"
|
|
96
|
-
:disabled="!productIsAvailable(product) || isAdding(product.id)"
|
|
97
|
-
@click="addUpsellProduct(product)"
|
|
98
|
-
>
|
|
99
|
-
<span class="hidden sm:inline">Hinzufügen</span>
|
|
100
|
-
</UButton>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
62
|
+
<SbIcon name="plus" />
|
|
63
|
+
</SbIconButton>
|
|
103
64
|
</li>
|
|
104
65
|
</ul>
|
|
105
66
|
</section>
|
|
67
|
+
<!-- Tinted box with offer cards, so the suggestions do not read as line items. -->
|
|
106
68
|
</template>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Schemas } from "#shopware";
|
|
3
|
-
import type { BreadcrumbItem } from "#ui/components/Breadcrumb.vue";
|
|
4
3
|
|
|
5
4
|
const props = defineProps<{
|
|
6
5
|
categoryId: string | undefined;
|
|
@@ -38,7 +37,7 @@ const { data } = await useAsyncData(cacheKey, async () => {
|
|
|
38
37
|
return response.data;
|
|
39
38
|
});
|
|
40
39
|
|
|
41
|
-
const items = computed<
|
|
40
|
+
const items = computed<{ label?: string; to: string }[]>(() => {
|
|
42
41
|
if (!data.value) return [{ label: "Kategorie", to: "#" }];
|
|
43
42
|
return data.value?.map((item: Schemas["Breadcrumb"]) => {
|
|
44
43
|
return {
|
|
@@ -69,5 +68,32 @@ watchEffect(() => {
|
|
|
69
68
|
</script>
|
|
70
69
|
|
|
71
70
|
<template>
|
|
72
|
-
<
|
|
71
|
+
<nav aria-label="Brotkrumen" class="mb-2 font-body text-sm">
|
|
72
|
+
<ol class="flex flex-wrap items-center gap-1 text-sb-ink-muted">
|
|
73
|
+
<li
|
|
74
|
+
v-for="(item, index) in items"
|
|
75
|
+
:key="item.to"
|
|
76
|
+
class="flex items-center gap-1"
|
|
77
|
+
>
|
|
78
|
+
<SbIcon
|
|
79
|
+
v-if="index > 0"
|
|
80
|
+
name="chevron-right"
|
|
81
|
+
:size="14"
|
|
82
|
+
class="text-sb-ink-muted"
|
|
83
|
+
/>
|
|
84
|
+
<NuxtLink
|
|
85
|
+
v-if="index < items.length - 1"
|
|
86
|
+
:to="item.to"
|
|
87
|
+
class="inline-flex min-h-11 items-center font-semibold text-sb-primary-ink underline-offset-4 hover:underline focus-visible:outline-3 focus-visible:outline-sb-focus"
|
|
88
|
+
>{{ item.label }}</NuxtLink
|
|
89
|
+
>
|
|
90
|
+
<span
|
|
91
|
+
v-else
|
|
92
|
+
aria-current="page"
|
|
93
|
+
class="inline-flex min-h-11 items-center font-semibold text-sb-ink"
|
|
94
|
+
>{{ item.label }}</span
|
|
95
|
+
>
|
|
96
|
+
</li>
|
|
97
|
+
</ol>
|
|
98
|
+
</nav>
|
|
73
99
|
</template>
|
|
@@ -1,55 +1,34 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Schemas } from "#shopware";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/** One property group of the menu filter (#445), as a checkbox list. */
|
|
5
|
+
const props = defineProps<{
|
|
5
6
|
filter: Schemas["PropertyGroup"];
|
|
6
7
|
modelValue: string[];
|
|
7
8
|
}>();
|
|
8
9
|
|
|
9
|
-
defineEmits<{
|
|
10
|
+
const emit = defineEmits<{
|
|
10
11
|
"update:modelValue": [value: string[]];
|
|
11
12
|
}>();
|
|
13
|
+
|
|
14
|
+
function toggle(id: string, checked: boolean) {
|
|
15
|
+
const next = props.modelValue.filter((value) => value !== id);
|
|
16
|
+
if (checked) next.push(id);
|
|
17
|
+
emit("update:modelValue", next);
|
|
18
|
+
}
|
|
12
19
|
</script>
|
|
13
20
|
|
|
14
21
|
<template>
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}"
|
|
22
|
+
<fieldset class="flex flex-col font-body text-sb-ink">
|
|
23
|
+
<legend class="mb-1 font-bold">
|
|
24
|
+
{{ filter.translated?.name ?? filter.name }}
|
|
25
|
+
</legend>
|
|
26
|
+
<SbCheckbox
|
|
27
|
+
v-for="option in filter.options ?? []"
|
|
28
|
+
:key="option.id"
|
|
29
|
+
:model-value="modelValue.includes(option.id)"
|
|
30
|
+
:label="option.translated?.name ?? option.name ?? ''"
|
|
31
|
+
@update:model-value="(checked: boolean) => toggle(option.id, checked)"
|
|
26
32
|
/>
|
|
27
|
-
|
|
28
|
-
<template #content>
|
|
29
|
-
<UCheckboxGroup
|
|
30
|
-
:model-value="modelValue"
|
|
31
|
-
:items="filter.options"
|
|
32
|
-
value-key="id"
|
|
33
|
-
label-key="translated.name"
|
|
34
|
-
@update:model-value="$emit('update:modelValue', $event)"
|
|
35
|
-
>
|
|
36
|
-
<template
|
|
37
|
-
v-if="
|
|
38
|
-
(filter.displayType ?? filter.translated.displayType) === 'media'
|
|
39
|
-
"
|
|
40
|
-
#label="{ item }"
|
|
41
|
-
>
|
|
42
|
-
<div class="flex items-center gap-1.5">
|
|
43
|
-
<NuxtImg
|
|
44
|
-
v-if="item.media?.url"
|
|
45
|
-
:src="item.media.url"
|
|
46
|
-
:alt="item.translated.name"
|
|
47
|
-
class="h-4 w-4 object-contain"
|
|
48
|
-
/>
|
|
49
|
-
<span>{{ item.translated.name }}</span>
|
|
50
|
-
</div>
|
|
51
|
-
</template>
|
|
52
|
-
</UCheckboxGroup>
|
|
53
|
-
</template>
|
|
54
|
-
</UCollapsible>
|
|
33
|
+
</fieldset>
|
|
55
34
|
</template>
|