@shopbite-de/storefront 1.31.3 → 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/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/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 +3 -0
- 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/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
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Schemas } from "#shopware";
|
|
3
3
|
import Breadcrumb from "~/components/Category/Breadcrumb.vue";
|
|
4
|
-
import
|
|
4
|
+
import MenuBonCard from "~/components/Menu/BonCard.vue";
|
|
5
5
|
|
|
6
6
|
// A menu category lists up to 100 products; hydrating every card up front
|
|
7
7
|
// costs ~1 s of main-thread time on phones (#314).
|
|
8
|
-
const
|
|
8
|
+
const MenuBonCardWhenVisible = hydrateWhenVisible(MenuBonCard);
|
|
9
|
+
|
|
10
|
+
// Menu of #441: word-list index, section title, bon cards with quick add.
|
|
11
|
+
const { menuView } = useThemePreset();
|
|
9
12
|
|
|
10
13
|
const props = defineProps<{
|
|
11
14
|
id: string;
|
|
@@ -46,6 +49,9 @@ const quickView = useProductQuickView(elements);
|
|
|
46
49
|
// Derived from the listing data instead of snapshotted at setup time, which
|
|
47
50
|
// would be a hydration mismatch (#239); see useSortingSelection.
|
|
48
51
|
const { currentSorting } = useSortingSelection(currentSortingOrder);
|
|
52
|
+
const presetSortingOptions = computed(() =>
|
|
53
|
+
toSortingOptions(sortingOrders.value),
|
|
54
|
+
);
|
|
49
55
|
|
|
50
56
|
const propertyFilters = computed<Schemas["PropertyGroup"][]>(
|
|
51
57
|
() =>
|
|
@@ -113,8 +119,8 @@ const moreThanOneFilterAndOption = computed<boolean>(
|
|
|
113
119
|
() => propertyFilters.value.length > 0,
|
|
114
120
|
);
|
|
115
121
|
|
|
116
|
-
// The
|
|
117
|
-
//
|
|
122
|
+
// The filter sheet is created on first use; mounting it with the page
|
|
123
|
+
// forced a layout of the whole listing (#314).
|
|
118
124
|
const filterDrawerMounted = ref(false);
|
|
119
125
|
const filterDrawerOpen = ref(false);
|
|
120
126
|
|
|
@@ -128,142 +134,106 @@ async function openFilterDrawer() {
|
|
|
128
134
|
</script>
|
|
129
135
|
|
|
130
136
|
<template>
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
v-if="selectedPropertyFilters.length"
|
|
165
|
-
:label="String(selectedPropertyFilters.length)"
|
|
166
|
-
size="sm"
|
|
167
|
-
color="neutral"
|
|
168
|
-
variant="solid"
|
|
169
|
-
class="ml-1"
|
|
170
|
-
/>
|
|
171
|
-
</UButton>
|
|
172
|
-
<LazyUDrawer
|
|
173
|
-
v-if="filterDrawerMounted"
|
|
174
|
-
v-model:open="filterDrawerOpen"
|
|
175
|
-
title="Filter"
|
|
176
|
-
direction="right"
|
|
177
|
-
>
|
|
178
|
-
<template #body>
|
|
179
|
-
<div class="flex flex-col gap-4">
|
|
180
|
-
<CategoryFilterGroup
|
|
181
|
-
v-for="filter in propertyFilters"
|
|
182
|
-
:key="filter.id"
|
|
183
|
-
v-model="selectedPropertyFilters"
|
|
184
|
-
:filter="filter"
|
|
185
|
-
/>
|
|
186
|
-
<UButton
|
|
187
|
-
label="Zurücksetzen"
|
|
188
|
-
variant="outline"
|
|
189
|
-
block
|
|
190
|
-
@click="resetFilters"
|
|
191
|
-
/>
|
|
192
|
-
</div>
|
|
193
|
-
</template>
|
|
194
|
-
</LazyUDrawer>
|
|
195
|
-
</template>
|
|
196
|
-
</div>
|
|
197
|
-
|
|
198
|
-
<div
|
|
199
|
-
v-if="showSkeleton"
|
|
200
|
-
class="grid grid-cols-1 gap-4"
|
|
201
|
-
aria-busy="true"
|
|
202
|
-
aria-label="Produkte werden geladen"
|
|
137
|
+
<div
|
|
138
|
+
class="mx-auto grid w-full max-w-(--sb-container) gap-x-12 px-4 pt-4 pb-16 font-body text-sb-ink sm:px-6 lg:grid-cols-[200px_minmax(0,1fr)_340px] lg:px-8 lg:pt-8"
|
|
139
|
+
>
|
|
140
|
+
<aside
|
|
141
|
+
class="hidden lg:sticky lg:top-24 lg:block lg:max-h-[calc(100vh-7rem)] lg:self-start lg:overflow-y-auto"
|
|
142
|
+
>
|
|
143
|
+
<MenuCategoryIndex />
|
|
144
|
+
</aside>
|
|
145
|
+
|
|
146
|
+
<div class="min-w-0">
|
|
147
|
+
<Breadcrumb :category-id="category?.id" />
|
|
148
|
+
<MenuSectionHeader
|
|
149
|
+
v-if="category"
|
|
150
|
+
:category="category"
|
|
151
|
+
:count="elements.length"
|
|
152
|
+
/>
|
|
153
|
+
<MenuOrderMode class="mb-4 lg:hidden" />
|
|
154
|
+
<CategorySearchInput class="mb-4" />
|
|
155
|
+
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
|
|
156
|
+
<SbSelect
|
|
157
|
+
v-model="currentSorting"
|
|
158
|
+
label="Sortierung"
|
|
159
|
+
placeholder="Bitte wählen"
|
|
160
|
+
:options="presetSortingOptions"
|
|
161
|
+
class="max-w-72"
|
|
162
|
+
/>
|
|
163
|
+
<template v-if="moreThanOneFilterAndOption">
|
|
164
|
+
<!-- The right column holds the cart, so the filters live in a
|
|
165
|
+
sheet on every screen size. -->
|
|
166
|
+
<SbButton
|
|
167
|
+
:variant="selectedPropertyFilters.length ? 'primary' : 'secondary'"
|
|
168
|
+
aria-haspopup="dialog"
|
|
169
|
+
@click="openFilterDrawer"
|
|
203
170
|
>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
171
|
+
Filter
|
|
172
|
+
<span v-if="selectedPropertyFilters.length" class="tabular-nums"
|
|
173
|
+
>({{ selectedPropertyFilters.length }}
|
|
174
|
+
<span class="sr-only">aktiv</span>)</span
|
|
175
|
+
>
|
|
176
|
+
</SbButton>
|
|
177
|
+
<SbSheet
|
|
178
|
+
v-if="filterDrawerMounted"
|
|
179
|
+
v-model:open="filterDrawerOpen"
|
|
180
|
+
title="Filter"
|
|
211
181
|
>
|
|
212
|
-
<ProductCardWhenVisible
|
|
213
|
-
v-for="product in elements"
|
|
214
|
-
:key="product.id"
|
|
215
|
-
:product="product"
|
|
216
|
-
:with-favorite-button="true"
|
|
217
|
-
:selectable="true"
|
|
218
|
-
:href="productDeepLink(product, category?.seoUrl)"
|
|
219
|
-
@select="quickView.show"
|
|
220
|
-
/>
|
|
221
|
-
</div>
|
|
222
|
-
<LazyProductQuickView
|
|
223
|
-
v-if="quickView.mounted.value"
|
|
224
|
-
v-model:open="quickView.open.value"
|
|
225
|
-
:product="quickView.product.value"
|
|
226
|
-
/>
|
|
227
|
-
</div>
|
|
228
|
-
</UPageBody>
|
|
229
|
-
|
|
230
|
-
<template #right>
|
|
231
|
-
<UPageAside>
|
|
232
|
-
<ClientOnly v-if="moreThanOneFilterAndOption">
|
|
233
182
|
<div class="flex flex-col gap-4">
|
|
234
|
-
<h2 class="text-3xl md:text-4xl mb-3 pb-2">Filter</h2>
|
|
235
183
|
<CategoryFilterGroup
|
|
236
184
|
v-for="filter in propertyFilters"
|
|
237
185
|
:key="filter.id"
|
|
238
186
|
v-model="selectedPropertyFilters"
|
|
239
187
|
:filter="filter"
|
|
240
188
|
/>
|
|
241
|
-
<UButton
|
|
242
|
-
label="Zurücksetzen"
|
|
243
|
-
variant="outline"
|
|
244
|
-
block
|
|
245
|
-
@click="resetFilters"
|
|
246
|
-
/>
|
|
247
189
|
</div>
|
|
248
|
-
<template #
|
|
249
|
-
<div class="flex
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
</div>
|
|
257
|
-
<div class="flex flex-col gap-2">
|
|
258
|
-
<USkeleton class="h-8 w-48" />
|
|
259
|
-
<USkeleton class="h-4 w-36" />
|
|
260
|
-
<USkeleton class="h-4 w-32" />
|
|
261
|
-
</div>
|
|
190
|
+
<template #footer>
|
|
191
|
+
<div class="flex gap-3">
|
|
192
|
+
<SbButton variant="secondary" block @click="resetFilters"
|
|
193
|
+
>Zurücksetzen</SbButton
|
|
194
|
+
>
|
|
195
|
+
<SbButton block @click="filterDrawerOpen = false"
|
|
196
|
+
>{{ elements.length }} Gerichte zeigen</SbButton
|
|
197
|
+
>
|
|
262
198
|
</div>
|
|
263
199
|
</template>
|
|
264
|
-
</
|
|
265
|
-
</
|
|
266
|
-
</
|
|
267
|
-
|
|
268
|
-
|
|
200
|
+
</SbSheet>
|
|
201
|
+
</template>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<div
|
|
205
|
+
v-if="showSkeleton"
|
|
206
|
+
class="grid grid-cols-1 gap-3"
|
|
207
|
+
aria-busy="true"
|
|
208
|
+
aria-label="Gerichte werden geladen"
|
|
209
|
+
>
|
|
210
|
+
<LazyProductCardSkeleton v-for="i in 6" :key="i" />
|
|
211
|
+
</div>
|
|
212
|
+
<div
|
|
213
|
+
v-else
|
|
214
|
+
class="grid grid-cols-1 gap-3 transition-opacity duration-200"
|
|
215
|
+
:class="{ 'pointer-events-none opacity-40': loading }"
|
|
216
|
+
>
|
|
217
|
+
<MenuBonCardWhenVisible
|
|
218
|
+
v-for="product in elements"
|
|
219
|
+
:key="product.id"
|
|
220
|
+
:product="product"
|
|
221
|
+
:photo="menuView === 'bonPhoto'"
|
|
222
|
+
:href="productDeepLink(product, category?.seoUrl)"
|
|
223
|
+
@select="quickView.show"
|
|
224
|
+
/>
|
|
225
|
+
</div>
|
|
226
|
+
<LazyProductQuickView
|
|
227
|
+
v-if="quickView.mounted.value"
|
|
228
|
+
v-model:open="quickView.open.value"
|
|
229
|
+
:product="quickView.product.value"
|
|
230
|
+
/>
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
<aside
|
|
234
|
+
class="hidden lg:sticky lg:top-24 lg:block lg:max-h-[calc(100vh-7rem)] lg:self-start lg:overflow-y-auto"
|
|
235
|
+
>
|
|
236
|
+
<MenuCartPanel />
|
|
237
|
+
</aside>
|
|
238
|
+
</div>
|
|
269
239
|
</template>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/** Search from the menu page; results open on /suche. */
|
|
2
3
|
const router = useRouter();
|
|
3
4
|
|
|
4
5
|
const query = ref("");
|
|
6
|
+
const id = useId();
|
|
5
7
|
|
|
6
8
|
function submit() {
|
|
7
9
|
const term = query.value.trim();
|
|
@@ -11,23 +13,24 @@ function submit() {
|
|
|
11
13
|
</script>
|
|
12
14
|
|
|
13
15
|
<template>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
<form role="search" class="flex gap-2 font-body" @submit.prevent="submit">
|
|
17
|
+
<label :for="id" class="sr-only">Speisekarte durchsuchen</label>
|
|
18
|
+
<SbInput
|
|
19
|
+
:id="id"
|
|
20
|
+
v-model="query"
|
|
21
|
+
name="search"
|
|
22
|
+
type="search"
|
|
23
|
+
enterkeyhint="search"
|
|
24
|
+
placeholder="Gericht oder Zutat suchen"
|
|
25
|
+
class="flex-1"
|
|
26
|
+
/>
|
|
27
|
+
<SbIconButton
|
|
28
|
+
label="Suchen"
|
|
29
|
+
type="submit"
|
|
30
|
+
variant="tint"
|
|
31
|
+
class="size-[50px]"
|
|
32
|
+
>
|
|
33
|
+
<SbIcon name="search" />
|
|
34
|
+
</SbIconButton>
|
|
35
|
+
</form>
|
|
33
36
|
</template>
|
|
@@ -61,10 +61,6 @@ const isValid = computed<boolean>(() => {
|
|
|
61
61
|
return validate(selected.value) === null;
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
const deliveryTimeInfo = computed(() => {
|
|
65
|
-
return "Geschätzte Lieferzeit beträgt " + deliveryTime.value + " min.";
|
|
66
|
-
});
|
|
67
|
-
|
|
68
64
|
watch(
|
|
69
65
|
isValid,
|
|
70
66
|
(v) => {
|
|
@@ -136,83 +132,65 @@ function handleTimeInput(event: Event): void {
|
|
|
136
132
|
selected.value = value;
|
|
137
133
|
emit("update:modelValue", value || null);
|
|
138
134
|
}
|
|
135
|
+
|
|
136
|
+
// Presets: the base components and plain text instead of badges (#443).
|
|
139
137
|
</script>
|
|
140
138
|
|
|
141
139
|
<template>
|
|
142
|
-
<div
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
]"
|
|
158
|
-
/>
|
|
159
|
-
</div>
|
|
160
|
-
<div
|
|
161
|
-
v-else-if="isOpeningHoursLoaded && isClosedHoliday(now) === false"
|
|
162
|
-
class="flex flex-col gap-2 mt-4"
|
|
163
|
-
>
|
|
164
|
-
<div class="flex flex-row items-center justify-between gap-4">
|
|
165
|
-
<label for="delivery-time" class="flex-1">
|
|
166
|
-
Wunschlieferung- oder Abholzeit ab:
|
|
167
|
-
</label>
|
|
168
|
-
<client-only>
|
|
169
|
-
<UInput
|
|
170
|
-
id="delivery-time"
|
|
171
|
-
type="time"
|
|
172
|
-
:min="minTime ?? undefined"
|
|
173
|
-
:max="maxTime ?? undefined"
|
|
174
|
-
:disabled="isClosedToday || isClosedHoliday(now) === true"
|
|
175
|
-
:model-value="selected"
|
|
176
|
-
step="300"
|
|
177
|
-
@input="handleTimeInput"
|
|
178
|
-
/>
|
|
179
|
-
</client-only>
|
|
140
|
+
<div class="flex flex-col gap-3 font-body text-sb-ink">
|
|
141
|
+
<div
|
|
142
|
+
v-if="hasOpeningHoursFailed"
|
|
143
|
+
role="alert"
|
|
144
|
+
class="flex flex-col items-start gap-3 rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm"
|
|
145
|
+
>
|
|
146
|
+
<span>
|
|
147
|
+
<strong class="block"
|
|
148
|
+
>Öffnungszeiten konnten nicht geladen werden</strong
|
|
149
|
+
>
|
|
150
|
+
Ohne Öffnungszeiten können wir keine Lieferzeit anbieten.
|
|
151
|
+
</span>
|
|
152
|
+
<SbButton variant="secondary" @click="retryOpeningHours"
|
|
153
|
+
>Erneut versuchen</SbButton
|
|
154
|
+
>
|
|
180
155
|
</div>
|
|
181
|
-
<p
|
|
182
|
-
|
|
156
|
+
<p
|
|
157
|
+
v-else-if="isOpeningHoursLoaded && isClosedHoliday(now) === true"
|
|
158
|
+
role="status"
|
|
159
|
+
class="rounded-sb-control bg-sb-muted p-4 font-semibold"
|
|
160
|
+
>
|
|
161
|
+
Wir haben Betriebsferien und nehmen gerade keine Bestellungen an.
|
|
162
|
+
</p>
|
|
163
|
+
<template v-else-if="isOpeningHoursLoaded">
|
|
164
|
+
<SbField
|
|
165
|
+
id="delivery-time"
|
|
166
|
+
v-slot="{ id, describedBy, invalid }"
|
|
167
|
+
label="Wunschzeit für Lieferung oder Abholung, frühestens"
|
|
168
|
+
:hint="validationError ? undefined : helperText"
|
|
169
|
+
:error="validationError ?? undefined"
|
|
170
|
+
>
|
|
171
|
+
<ClientOnly>
|
|
172
|
+
<input
|
|
173
|
+
:id="id"
|
|
174
|
+
type="time"
|
|
175
|
+
:min="minTime ?? undefined"
|
|
176
|
+
:max="maxTime ?? undefined"
|
|
177
|
+
step="300"
|
|
178
|
+
:value="selected"
|
|
179
|
+
:disabled="isClosedToday"
|
|
180
|
+
:aria-describedby="describedBy"
|
|
181
|
+
:aria-invalid="invalid || undefined"
|
|
182
|
+
class="min-h-[50px] w-full max-w-48 rounded-sb-control border-[1.5px] border-sb-control bg-sb-surface px-3.5 font-body text-lg font-semibold text-sb-ink tabular-nums focus-visible:outline-3 focus-visible:outline-offset-1 focus-visible:outline-sb-focus disabled:opacity-60 aria-invalid:border-sb-danger"
|
|
183
|
+
@input="handleTimeInput"
|
|
184
|
+
/>
|
|
185
|
+
</ClientOnly>
|
|
186
|
+
</SbField>
|
|
187
|
+
<p class="text-sm text-sb-ink-muted">
|
|
188
|
+
Lieferzeit ca. {{ deliveryTime }} Minuten, zu Stoßzeiten kann es etwas
|
|
189
|
+
länger dauern.
|
|
190
|
+
</p>
|
|
191
|
+
</template>
|
|
192
|
+
<p v-else class="text-sm text-sb-ink-muted" aria-busy="true">
|
|
193
|
+
Öffnungszeiten werden geladen …
|
|
183
194
|
</p>
|
|
184
|
-
<p v-else class="text-sm text-muted">{{ helperText }}</p>
|
|
185
|
-
<UBadge
|
|
186
|
-
:label="deliveryTimeInfo"
|
|
187
|
-
icon="i-lucide-clock"
|
|
188
|
-
size="xl"
|
|
189
|
-
color="neutral"
|
|
190
|
-
variant="subtle"
|
|
191
|
-
/>
|
|
192
|
-
<UBadge
|
|
193
|
-
label="Lieferzeiten können zu Stoßzeiten variieren."
|
|
194
|
-
icon="i-lucide-info"
|
|
195
|
-
size="xl"
|
|
196
|
-
color="warning"
|
|
197
|
-
variant="subtle"
|
|
198
|
-
/>
|
|
199
|
-
</div>
|
|
200
|
-
<div v-else-if="isOpeningHoursLoaded && isClosedHoliday(now) === true">
|
|
201
|
-
<UBadge
|
|
202
|
-
variant="subtle"
|
|
203
|
-
class="w-full"
|
|
204
|
-
icon="i-lucide-info"
|
|
205
|
-
color="error"
|
|
206
|
-
label="Geschlossen wegen Betriebsferien"
|
|
207
|
-
/>
|
|
208
|
-
</div>
|
|
209
|
-
<div v-else>
|
|
210
|
-
<UBadge
|
|
211
|
-
variant="subtle"
|
|
212
|
-
class="w-full"
|
|
213
|
-
icon="i-lucide-loader"
|
|
214
|
-
color="neutral"
|
|
215
|
-
label="Lade Öffnungszeiten..."
|
|
216
|
-
/>
|
|
217
195
|
</div>
|
|
218
196
|
</template>
|
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import { TabsContent, TabsList, TabsRoot, TabsTrigger } from "reka-ui";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
label: "Daten erfassen",
|
|
7
|
-
slot: "register" as const,
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
label: "Einloggen",
|
|
11
|
-
slot: "login" as const,
|
|
12
|
-
},
|
|
13
|
-
] satisfies TabsItem[];
|
|
14
|
-
|
|
15
|
-
const toast = useToast();
|
|
4
|
+
// Reka tabs with the base forms (#443).
|
|
5
|
+
const presetTab = ref<"neu" | "kunde">("neu");
|
|
16
6
|
|
|
17
7
|
const { mergeWishlistProducts } = useWishlist();
|
|
18
8
|
|
|
19
9
|
async function handleLoginSuccess() {
|
|
20
10
|
mergeWishlistProducts();
|
|
21
|
-
toast.add({
|
|
22
|
-
title: "Wilkommen!",
|
|
23
|
-
color: "success",
|
|
24
|
-
progress: false,
|
|
25
|
-
});
|
|
26
11
|
}
|
|
27
12
|
</script>
|
|
28
13
|
|
|
29
14
|
<template>
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
15
|
+
<TabsRoot v-model="presetTab" class="flex flex-col gap-5">
|
|
16
|
+
<TabsList
|
|
17
|
+
aria-label="Kundendaten"
|
|
18
|
+
class="grid grid-cols-2 gap-1 rounded-sb-control bg-sb-muted p-1 font-body"
|
|
19
|
+
>
|
|
20
|
+
<TabsTrigger
|
|
21
|
+
value="neu"
|
|
22
|
+
class="min-h-11 rounded-[calc(var(--sb-radius-control)-3px)] px-3 text-sm font-semibold text-sb-ink-muted focus-visible:outline-3 focus-visible:outline-offset-1 focus-visible:outline-sb-focus data-[state=active]:bg-sb-ink data-[state=active]:font-bold data-[state=active]:text-sb-surface"
|
|
23
|
+
>
|
|
24
|
+
Neu hier oder als Gast
|
|
25
|
+
</TabsTrigger>
|
|
26
|
+
<TabsTrigger
|
|
27
|
+
value="kunde"
|
|
28
|
+
class="min-h-11 rounded-[calc(var(--sb-radius-control)-3px)] px-3 text-sm font-semibold text-sb-ink-muted focus-visible:outline-3 focus-visible:outline-offset-1 focus-visible:outline-sb-focus data-[state=active]:bg-sb-ink data-[state=active]:font-bold data-[state=active]:text-sb-surface"
|
|
29
|
+
>
|
|
30
|
+
Schon Kunde
|
|
31
|
+
</TabsTrigger>
|
|
32
|
+
</TabsList>
|
|
33
|
+
<TabsContent value="neu" class="focus-visible:outline-none">
|
|
34
|
+
<UserRegistrationForm @registration-success="handleLoginSuccess" />
|
|
35
|
+
</TabsContent>
|
|
36
|
+
<TabsContent value="kunde" class="focus-visible:outline-none">
|
|
37
|
+
<UserLoginForm @login-success="handleLoginSuccess" />
|
|
38
|
+
</TabsContent>
|
|
39
|
+
</TabsRoot>
|
|
41
40
|
</template>
|