@revenexx/cover 0.10.1 → 0.12.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.
Files changed (115) hide show
  1. package/app/api/account.ts +4 -0
  2. package/app/assets/css/cover.css +9 -0
  3. package/app/components/RevenexxForm.vue +4 -0
  4. package/app/components/account/AccountSidebar.vue +2 -5
  5. package/app/components/account/carts/AccountCartsTable.vue +4 -2
  6. package/app/components/account/dashboard/AccountDashboardKpis.vue +74 -34
  7. package/app/components/account/dashboard/AccountDashboardQuickActions.vue +24 -6
  8. package/app/components/account/organization/AccountOrganization.vue +3 -1
  9. package/app/components/account/team/AccountTeam.vue +32 -7
  10. package/app/components/auth/AuthForgotPasswordPanel.vue +9 -4
  11. package/app/components/auth/AuthLoginPanel.vue +75 -18
  12. package/app/components/auth/AuthRegisterPanel.vue +1 -1
  13. package/app/components/cart/actions/CartSaveToListModal.vue +5 -0
  14. package/app/components/cart/item/CartItem.vue +17 -75
  15. package/app/components/cart/position/CartPosition.vue +17 -30
  16. package/app/components/cart/quote/CartQuoteRequestModal.vue +9 -1
  17. package/app/components/cart/switcher/CartSwitcher.vue +5 -2
  18. package/app/components/category/view/GridView.vue +10 -1
  19. package/app/components/category/view/ListView.vue +10 -1
  20. package/app/components/checkout/confirmation/CheckoutConfirmationActions.vue +2 -0
  21. package/app/components/checkout/onepage/CheckoutAddressSection.vue +4 -4
  22. package/app/components/checkout/onepage/CheckoutDeliverySection.vue +18 -2
  23. package/app/components/checkout/onepage/CheckoutGate.vue +2 -0
  24. package/app/components/checkout/onepage/CheckoutOnePageView.vue +1 -1
  25. package/app/components/checkout/onepage/CheckoutPaymentSection.vue +10 -0
  26. package/app/components/checkout/onepage/CheckoutSummarySection.vue +7 -1
  27. package/app/components/layout/Region.vue +13 -0
  28. package/app/components/layout/footer/Footer.vue +8 -0
  29. package/app/components/layout/header/AppBar.vue +4 -3
  30. package/app/components/layout/header/MainNav.vue +3 -3
  31. package/app/components/listing/ListingResults.vue +3 -1
  32. package/app/components/product/card/Compact.vue +10 -1
  33. package/app/components/product/detail/ProductDetailAddToCart.vue +51 -18
  34. package/app/components/product/detail/ProductDetailIdentity.vue +1 -1
  35. package/app/components/product/detail/ProductDetailPriceRequest.vue +1 -1
  36. package/app/components/product/detail/ProductDetailSaveToList.vue +10 -0
  37. package/app/composables/useAccountDashboard.ts +0 -10
  38. package/app/composables/useAccountNavigation.ts +35 -0
  39. package/app/composables/useAuthStore.ts +6 -2
  40. package/app/composables/useCategoryListing.ts +6 -0
  41. package/app/composables/useCheckoutOnePage.ts +21 -2
  42. package/app/composables/useMasterDataEditable.ts +23 -0
  43. package/app/composables/useProductCard.ts +29 -2
  44. package/app/composables/useProductListing.ts +79 -0
  45. package/app/composables/useQuantityStepper.ts +90 -0
  46. package/app/composables/useQuickActions.ts +35 -0
  47. package/app/composables/useRoleGrants.ts +32 -0
  48. package/app/composables/useSearchListing.ts +4 -0
  49. package/app/composables/useThemeEvents.ts +144 -0
  50. package/app/config/accountDashboard.ts +26 -0
  51. package/app/config/quickActions.ts +40 -5
  52. package/app/interfaces/account/dashboard.ts +2 -0
  53. package/app/interfaces/auth.ts +25 -4
  54. package/app/interfaces/quantity-stepper.ts +17 -0
  55. package/app/interfaces/shopSettings.ts +84 -0
  56. package/app/layouts/default.vue +19 -10
  57. package/app/layouts/focus.vue +28 -7
  58. package/app/middleware/checkout-guard.ts +7 -1
  59. package/app/pages/punchout/transfer.vue +22 -0
  60. package/app/plugins/theme-events.client.ts +132 -0
  61. package/app/shared/themeEvents.ts +445 -0
  62. package/i18n/locales/de/account.json +7 -0
  63. package/i18n/locales/de/auth.json +42 -2
  64. package/i18n/locales/de/cart.json +4 -2
  65. package/i18n/locales/de/checkout.json +2 -1
  66. package/i18n/locales/de/common.json +2 -0
  67. package/i18n/locales/de/cover.json +44 -0
  68. package/i18n/locales/de/editor.json +47 -1
  69. package/i18n/locales/en/account.json +7 -0
  70. package/i18n/locales/en/auth.json +42 -2
  71. package/i18n/locales/en/cart.json +4 -2
  72. package/i18n/locales/en/checkout.json +2 -1
  73. package/i18n/locales/en/common.json +2 -0
  74. package/i18n/locales/en/cover.json +44 -0
  75. package/i18n/locales/en/editor.json +47 -1
  76. package/nuxt.config.ts +15 -1
  77. package/package.json +5 -2
  78. package/server/api/account/orders/[id]/cancel.post.ts +1 -1
  79. package/server/api/account/orders/[id]/messages.get.ts +1 -1
  80. package/server/api/account/orders/[id]/messages.post.ts +1 -1
  81. package/server/api/account/orders/[id]/return.post.ts +1 -0
  82. package/server/api/account/orders/[id].get.ts +1 -1
  83. package/server/api/account/pending-approvals/index.get.ts +1 -0
  84. package/server/api/account/profile.get.ts +3 -1
  85. package/server/api/auth/login.post.ts +22 -3
  86. package/server/api/auth/magic-link.put.ts +6 -1
  87. package/server/api/auth/otp.put.ts +6 -1
  88. package/server/api/carts/[id]/activate.post.ts +8 -0
  89. package/server/api/carts/[id]/index.delete.ts +3 -0
  90. package/server/api/carts/[id]/index.put.ts +1 -0
  91. package/server/api/carts/[id]/items.post.ts +1 -0
  92. package/server/api/carts/index.post.ts +4 -0
  93. package/server/api/orders/index.post.ts +33 -0
  94. package/server/api/quick-actions.get.ts +6 -38
  95. package/server/interfaces/auth.ts +10 -1
  96. package/server/middleware/buyer-principal.ts +18 -0
  97. package/server/routes/punchout/start.get.ts +6 -15
  98. package/server/services/ApiAddressBookService.ts +43 -1
  99. package/server/services/ApiAuthService.ts +119 -22
  100. package/server/services/ApiCartService.ts +67 -32
  101. package/server/services/ApiOrganizationService.ts +7 -2
  102. package/server/services/ApiTeamService.ts +93 -21
  103. package/server/services/MockAuthService.ts +21 -2
  104. package/server/utils/buyerIdentity.ts +168 -0
  105. package/server/utils/cartOwnership.ts +67 -0
  106. package/server/utils/liveOrderLists.ts +50 -23
  107. package/server/utils/liveOrders.ts +39 -24
  108. package/server/utils/livePrices.ts +7 -15
  109. package/server/utils/masterData.ts +29 -0
  110. package/server/utils/passwordlessSignIn.ts +13 -4
  111. package/server/utils/pendingApprovals.ts +29 -7
  112. package/server/utils/procurementCheckout.ts +2 -0
  113. package/server/utils/quickActionCatalogue.ts +53 -0
  114. package/server/utils/revenexxSdk.ts +116 -2
  115. package/server/utils/shopSettings.ts +5 -0
@@ -82,38 +82,24 @@ const detailUrl = computed(() => {
82
82
 
83
83
  return localePath(categoryProductPath([categorySlug, subcategorySlug], props.item));
84
84
  });
85
- const inputValue = ref(String(props.item.quantity));
86
85
  const confirmOpen = ref(false);
87
-
88
- const parsedInputQuantity = computed(() => {
89
- const sanitized = inputValue.value.replace(/[^0-9]/g, "");
90
- return parseInt(sanitized, 10) || 0;
91
- });
92
- const quantityInvalid = computed(() => parsedInputQuantity.value < 1);
93
- const quantityExceeded = computed(() => {
94
- if (typeof maxOrderQuantity.value !== "number") {
95
- return false;
96
- }
97
-
98
- return parsedInputQuantity.value > maxOrderQuantity.value;
99
- });
100
86
  const currentCartQuantity = computed(() => props.item.quantity);
101
87
 
102
- let quantityErrorTimer: ReturnType<typeof setTimeout> | null = null;
103
- const showQuantityError = ref(false);
104
- const maxExceededAttempted = ref(false);
105
-
106
- function triggerQuantityError() {
107
- showQuantityError.value = true;
108
- if (quantityErrorTimer !== null) {
109
- clearTimeout(quantityErrorTimer);
110
- }
111
- quantityErrorTimer = setTimeout(() => {
112
- showQuantityError.value = false;
113
- maxExceededAttempted.value = false;
114
- quantityErrorTimer = null;
115
- }, 2000);
116
- }
88
+ // Mini-cart: − at 1 removes the line (the store reads 0 as remove), so the
89
+ // stepper floor is 0 here.
90
+ const {
91
+ inputValue,
92
+ notice: quantityNotice,
93
+ decrease,
94
+ increase,
95
+ onInput: onQuantityInput,
96
+ commit: commitInput,
97
+ } = useQuantityStepper({
98
+ quantity: () => props.item.quantity,
99
+ max: () => maxOrderQuantity.value,
100
+ min: 0,
101
+ apply: next => cart.updateQuantity(props.item.id, next),
102
+ });
117
103
 
118
104
  const ariaQuantityOfLabel = computed(() =>
119
105
  t("cart.item.ariaQuantityOf", { name: props.item.name, quantity: props.item.quantity }),
@@ -128,50 +114,6 @@ const ariaIncreaseQuantityLabel = computed(() =>
128
114
  t("cart.item.ariaIncreaseQuantity", { name: props.item.name }),
129
115
  );
130
116
 
131
- watch(() => props.item.quantity, (val: number) => {
132
- inputValue.value = String(val);
133
- });
134
-
135
- function applyQuantity(nextQuantity: number) {
136
- if (typeof maxOrderQuantity.value === "number" && nextQuantity > maxOrderQuantity.value) {
137
- maxExceededAttempted.value = true;
138
- triggerQuantityError();
139
- return;
140
- }
141
- cart.updateQuantity(props.item.id, nextQuantity);
142
- }
143
-
144
- function decrease() {
145
- applyQuantity(props.item.quantity - 1);
146
- }
147
-
148
- function increase() {
149
- applyQuantity(props.item.quantity + 1);
150
- }
151
-
152
- function onQuantityInput(event: Event) {
153
- const input = event.target as HTMLInputElement;
154
- const sanitized = input.value.replace(/[^0-9]/g, "");
155
- inputValue.value = sanitized;
156
- }
157
-
158
- function commitInput() {
159
- if (quantityInvalid.value || quantityExceeded.value) {
160
- triggerQuantityError();
161
- inputValue.value = String(props.item.quantity);
162
- return;
163
- }
164
-
165
- applyQuantity(parsedInputQuantity.value);
166
- }
167
-
168
- onUnmounted(() => {
169
- if (quantityErrorTimer !== null) {
170
- clearTimeout(quantityErrorTimer);
171
- quantityErrorTimer = null;
172
- }
173
- });
174
-
175
117
  onMounted(() => {
176
118
  if (!props.item.categorySlug || !props.item.subcategorySlug) {
177
119
  void loadFallbackSlugs();
@@ -259,13 +201,13 @@ onMounted(() => {
259
201
  </template>
260
202
  </div>
261
203
  <UiFeedbackErrorBoundary
262
- v-if="showQuantityError && maxExceededAttempted && maxOrderQuantity"
204
+ v-if="quantityNotice === 'max' && maxOrderQuantity"
263
205
  :title="t('product.actions.maxQuantityReachedTitle', { count: currentCartQuantity })"
264
206
  :description="t('product.actions.maxQuantityReachedDescription', { max: maxOrderQuantity })"
265
207
  :show-retry="false"
266
208
  />
267
209
  <UiFeedbackErrorBoundary
268
- v-if="showQuantityError && quantityInvalid"
210
+ v-if="quantityNotice === 'invalid'"
269
211
  :title="t('product.actions.invalidQuantityTitle')"
270
212
  :description="t('product.actions.invalidQuantityDescription')"
271
213
  :show-retry="false"
@@ -7,7 +7,6 @@ const featureOrderLists = computed(() =>
7
7
  import { categoryProductPath } from "../../../composables/useProducts";
8
8
  import type { CalculatedCartLine } from "../../../interfaces/cart-calculation";
9
9
  import type { CartItem } from "../../../interfaces/cart-item";
10
- import { CART_MAX_QUANTITY } from "../../../interfaces/cart-item";
11
10
 
12
11
  /**
13
12
  * Full cart position (Cart 2.0): selector, drag handle, article identity,
@@ -64,31 +63,19 @@ const availabilityColor = computed(() => {
64
63
  });
65
64
 
66
65
  /* ---- quantity ---------------------------------------------------- */
67
- const inputValue = ref(String(props.item.quantity));
68
- watch(() => props.item.quantity, (val) => {
69
- inputValue.value = String(val);
66
+ const {
67
+ inputValue: quantityInput,
68
+ canDecrease,
69
+ decrease,
70
+ increase,
71
+ onInput: onQuantityInput,
72
+ commit: commitQuantity,
73
+ } = useQuantityStepper({
74
+ quantity: () => props.item.quantity,
75
+ max: () => props.item.maxOrderQuantity,
76
+ apply: next => cart.updateQuantityByKey(lineKey.value, next),
70
77
  });
71
78
 
72
- function applyQuantity(next: number): void {
73
- const clamped = Math.min(Math.max(next, 1), props.item.maxOrderQuantity ?? CART_MAX_QUANTITY);
74
- cart.updateQuantityByKey(lineKey.value, clamped);
75
- inputValue.value = String(clamped);
76
- }
77
-
78
- function onQuantityInput(event: Event): void {
79
- const input = event.target as HTMLInputElement;
80
- inputValue.value = input.value.replace(/[^0-9]/g, "").slice(0, 6);
81
- }
82
-
83
- function commitInput(): void {
84
- const parsed = parseInt(inputValue.value, 10);
85
- if (!parsed || parsed < 1) {
86
- inputValue.value = String(props.item.quantity);
87
- return;
88
- }
89
- applyQuantity(parsed);
90
- }
91
-
92
79
  // A position nobody can order reads as a warning, and one missing a cost centre
93
80
  // too: both are things the buyer has to act on before the cart will go through.
94
81
  // Everything else is a note.
@@ -293,20 +280,20 @@ const hintColor = (type: string) =>
293
280
  variant="soft"
294
281
  size="xs"
295
282
  tabindex="0"
296
- :disabled="item.quantity <= 1"
283
+ :disabled="!canDecrease"
297
284
  :aria-label="t('cart.item.ariaDecreaseQuantity', { name: item.name })"
298
- @click="applyQuantity(item.quantity - 1)"
285
+ @click="decrease"
299
286
  />
300
287
  <input
301
- v-model="inputValue"
288
+ v-model="quantityInput"
302
289
  type="text"
303
290
  inputmode="numeric"
304
291
  :aria-label="t('cart.item.ariaInputQuantity', { name: item.name })"
305
292
  class="w-14 text-center text-sm border border-(--ui-border) rounded px-1 py-0.5
306
293
  bg-transparent focus:outline-none focus:ring-1 focus:ring-(--ui-primary)"
307
294
  @input="onQuantityInput"
308
- @keydown.enter.prevent="commitInput"
309
- @blur="commitInput"
295
+ @keydown.enter.prevent="commitQuantity"
296
+ @blur="commitQuantity"
310
297
  >
311
298
  <UButton
312
299
  :icon="icon('plus')"
@@ -315,7 +302,7 @@ const hintColor = (type: string) =>
315
302
  size="xs"
316
303
  tabindex="0"
317
304
  :aria-label="t('cart.item.ariaIncreaseQuantity', { name: item.name })"
318
- @click="applyQuantity(item.quantity + 1)"
305
+ @click="increase"
319
306
  />
320
307
  </div>
321
308
  <span
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { cartEcommerce } from "../../../shared/themeEvents";
3
+
2
4
  /**
3
5
  * Send the cart in as a quotation request (RX-783).
4
6
  *
@@ -23,6 +25,7 @@ const validityDays = computed(() => quoteTermsForRequest.value?.defaultValidityD
23
25
  const localePath = useLocalePath();
24
26
  const toast = useToast();
25
27
  const cart = useCartStore();
28
+ const themeEvents = useThemeEvents();
26
29
  const { request, submitting } = useQuoteRequest();
27
30
  const { data: profile, status: profileStatus } = useCheckoutProfileSource();
28
31
 
@@ -45,8 +48,10 @@ const canSubmit = computed(() => Boolean(shippingAddressId.value && billingAddre
45
48
 
46
49
  async function submit(): Promise<void> {
47
50
  try {
51
+ // What goes into the quote, read before the cart is handed over below.
52
+ const quoted = cart.items.filter(i => !i.requisitionId);
48
53
  const result = await request({
49
- items: cart.items.filter(i => !i.requisitionId).map(i => ({
54
+ items: quoted.map(i => ({
50
55
  id: String(i.id),
51
56
  sku: i.sku,
52
57
  name: i.name,
@@ -59,6 +64,9 @@ async function submit(): Promise<void> {
59
64
  ...(note.value.trim() ? { note: note.value.trim() } : {}),
60
65
  ...(props.reason ? { reason: props.reason } : {}),
61
66
  });
67
+ if (quoted.length) {
68
+ themeEvents.emit("request_quote", { ecommerce: cartEcommerce(quoted) });
69
+ }
62
70
  // The server handed the cart over to the quote; the local copy follows.
63
71
  cart.clearCart();
64
72
  open.value = false;
@@ -5,15 +5,18 @@ import type { DropdownMenuItem } from "@nuxt/ui";
5
5
  /**
6
6
  * Cart switcher for the cart page (multiple-carts feature): pick the
7
7
  * active cart, create a new one, rename or delete the current one.
8
- * Renders nothing while the org flag is off.
8
+ * Renders nothing while the org flag is off, and on a punchout visit: the
9
+ * visit works in the one cart its procurement system receives (RAD-109), and
10
+ * the BFF refuses switching or deleting it with 409 `punchout_cart_fixed`.
9
11
  */
10
12
  const { icon } = useIcons();
11
13
  const { t } = useI18n();
12
14
  const toast = useToast();
13
15
  const cart = useCartStore();
14
16
  const { settings } = useB2BContext();
17
+ const { isPunchout } = usePunchoutVisit();
15
18
 
16
- const enabled = computed(() => settings.value?.cart.multipleCarts === true);
19
+ const enabled = computed(() => settings.value?.cart.multipleCarts === true && !isPunchout.value);
17
20
 
18
21
  const createOpen = ref(false);
19
22
  const renameOpen = ref(false);
@@ -7,6 +7,10 @@ const props = withDefaults(defineProps<{
7
7
  showOrderIcon?: boolean;
8
8
  /** Look of the order button when the product can't be bought. */
9
9
  disabledOrderStyle?: "default" | "muted";
10
+ /** The list this card is shown in, reported when it is opened. */
11
+ listId?: string;
12
+ /** 1-based position in that list. */
13
+ listPosition?: number;
10
14
  }>(), {
11
15
  showOrderIcon: true,
12
16
  disabledOrderStyle: "default",
@@ -14,7 +18,10 @@ const props = withDefaults(defineProps<{
14
18
 
15
19
  const { t } = useI18n();
16
20
  const { icon } = useIcons();
17
- const { url } = useProductCard(() => props.product);
21
+ const { url, select } = useProductCard(
22
+ () => props.product,
23
+ () => ({ listId: props.listId, position: props.listPosition }),
24
+ );
18
25
  const { isOutOfStock, hasPrice, addToCart } = useProductCardActions(() => props.product);
19
26
 
20
27
  const orderDisabled = computed(() => isOutOfStock.value || !hasPrice.value);
@@ -40,6 +47,7 @@ const orderButtonClass = computed(() => {
40
47
  <template #header>
41
48
  <NuxtLink
42
49
  :to="url"
50
+ @click="select"
43
51
  :aria-label="`View ${product.name}`"
44
52
  tabindex="0"
45
53
  class="block focus-visible:outline-none focus-visible:ring-2
@@ -57,6 +65,7 @@ const orderButtonClass = computed(() => {
57
65
  <div class="flex flex-col gap-2">
58
66
  <NuxtLink
59
67
  :to="url"
68
+ @click="select"
60
69
  tabindex="0"
61
70
  class="text-m font-medium text-highlighted leading-snug
62
71
  hover:text-(--ui-primary) transition-colors"
@@ -3,10 +3,17 @@ import type { ProductList } from "../../../interfaces/product-list";
3
3
 
4
4
  const props = defineProps<{
5
5
  product: ProductList;
6
+ /** The list this card is shown in, reported when it is opened. */
7
+ listId?: string;
8
+ /** 1-based position in that list. */
9
+ listPosition?: number;
6
10
  }>();
7
11
 
8
12
  const { t } = useI18n();
9
- const { url } = useProductCard(() => props.product);
13
+ const { url, select } = useProductCard(
14
+ () => props.product,
15
+ () => ({ listId: props.listId, position: props.listPosition }),
16
+ );
10
17
  const { isOutOfStock, hasPrice, addToCart } = useProductCardActions(() => props.product);
11
18
  </script>
12
19
 
@@ -18,6 +25,7 @@ const { isOutOfStock, hasPrice, addToCart } = useProductCardActions(() => props.
18
25
  <div class="flex flex-row items-center gap-4 p-4">
19
26
  <NuxtLink
20
27
  :to="url"
28
+ @click="select"
21
29
  :aria-label="`View ${product.name}`"
22
30
  tabindex="0"
23
31
  class="shrink-0 focus-visible:outline-none focus-visible:ring-2
@@ -34,6 +42,7 @@ const { isOutOfStock, hasPrice, addToCart } = useProductCardActions(() => props.
34
42
  <div class="flex-1 min-w-0 flex flex-col gap-1">
35
43
  <NuxtLink
36
44
  :to="url"
45
+ @click="select"
37
46
  tabindex="0"
38
47
  class="text-base font-medium text-highlighted leading-snug
39
48
  hover:text-(--ui-primary) transition-colors truncate"
@@ -34,6 +34,7 @@ function continueShopping() {
34
34
  <UButton
35
35
  color="primary"
36
36
  size="lg"
37
+ class="min-h-11 lg:min-h-0"
37
38
  tabindex="0"
38
39
  :label="t('confirmation.continueShopping')"
39
40
  :trailing-icon="icon('arrow-right')"
@@ -44,6 +45,7 @@ function continueShopping() {
44
45
  color="neutral"
45
46
  variant="outline"
46
47
  size="lg"
48
+ class="min-h-11 lg:min-h-0"
47
49
  tabindex="0"
48
50
  :label="type === 'requisition' ? t('confirmation.viewRequisition') : t('confirmation.viewOrder')"
49
51
  :to="detailLink"
@@ -34,12 +34,12 @@ function changeBilling() {
34
34
  <!-- Shipping + billing side by side -->
35
35
  <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
36
36
  <!-- Shipping address -->
37
- <div class="space-y-2">
37
+ <div class="flex flex-col gap-2">
38
38
  <p class="text-sm font-medium text-muted">
39
39
  {{ t('onepage.address.shipping') }}
40
40
  </p>
41
41
  <div
42
- class="flex items-start justify-between gap-4 p-4 rounded-lg h-full
42
+ class="flex-1 flex items-start justify-between gap-4 p-4 rounded-lg
43
43
  border border-(--ui-border) bg-(--ui-bg-elevated)"
44
44
  >
45
45
  <!-- Loading skeleton -->
@@ -92,12 +92,12 @@ function changeBilling() {
92
92
  </div>
93
93
 
94
94
  <!-- Billing address -->
95
- <div class="space-y-2">
95
+ <div class="flex flex-col gap-2">
96
96
  <p class="text-sm font-medium text-muted">
97
97
  {{ t('onepage.address.billing') }}
98
98
  </p>
99
99
  <div
100
- class="flex items-start justify-between gap-4 p-4 rounded-lg h-full
100
+ class="flex-1 flex items-start justify-between gap-4 p-4 rounded-lg
101
101
  border border-(--ui-border) bg-(--ui-bg-elevated)"
102
102
  >
103
103
  <!-- Loading skeleton -->
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import CheckoutSectionTitle from "./CheckoutSectionTitle.vue";
3
3
 
4
- import type { DeliveryOption } from "../../../interfaces/delivery";
4
+ import type { DeliveryMethod, DeliveryOption } from "../../../interfaces/delivery";
5
+ import { cartEcommerce } from "../../../shared/themeEvents";
5
6
 
6
7
  const { icon } = useIcons();
7
8
  const { t, locale } = useI18n();
@@ -11,6 +12,21 @@ const partialShipmentAllowed = computed(() => (orders.value?.partialShipment ??
11
12
  const { form, profile, profileLoading, fieldErrors, validateField } = useCheckoutOnePage();
12
13
  const { formatCurrency } = useCartSummaryFormatting();
13
14
  const cartStore = useCartStore();
15
+ const themeEvents = useThemeEvents();
16
+
17
+ /**
18
+ * The buyer chose how it is delivered. Reported as `add_shipping_info` on the
19
+ * buyer's own choice only — never for the default the section preselects.
20
+ */
21
+ function selectDelivery(method: DeliveryMethod): void {
22
+ const changed = form.value.deliveryMethod !== method;
23
+ form.value.deliveryMethod = method;
24
+ if (changed && cartStore.items.length) {
25
+ themeEvents.emit("add_shipping_info", {
26
+ ecommerce: cartEcommerce(cartStore.items, { shipping_tier: String(method).slice(0, 64) }),
27
+ });
28
+ }
29
+ }
14
30
 
15
31
  // "How can THIS order ship?" — the BFF resolves it (live: shipping app
16
32
  // incl. matrix pricing/free-above/country restrictions; mock: the demo
@@ -144,7 +160,7 @@ watch([deliveryOptions, () => form.value.deliveryMethod], ([options, selected])
144
160
  ? 'border-(--ui-primary) bg-primary/5 ring-1 ring-(--ui-primary)'
145
161
  : 'border-(--ui-border) hover:border-(--ui-border-accented)'"
146
162
  :aria-pressed="form.deliveryMethod === option.method"
147
- @click="form.deliveryMethod = option.method"
163
+ @click="selectDelivery(option.method)"
148
164
  >
149
165
  <div class="flex items-start justify-between gap-3">
150
166
  <div class="min-w-0">
@@ -47,6 +47,7 @@ const { b2b: guestB2b, b2c: guestB2c } = useGuestOrdering();
47
47
  color="neutral"
48
48
  variant="outline"
49
49
  block
50
+ class="min-h-11 lg:min-h-0"
50
51
  tabindex="0"
51
52
  :icon="icon('company')"
52
53
  :label="t('onepage.gate.guestBusiness')"
@@ -57,6 +58,7 @@ const { b2b: guestB2b, b2c: guestB2c } = useGuestOrdering();
57
58
  color="neutral"
58
59
  variant="outline"
59
60
  block
61
+ class="min-h-11 lg:min-h-0"
60
62
  tabindex="0"
61
63
  :icon="icon('user')"
62
64
  :label="t('onepage.gate.guestPrivate')"
@@ -54,7 +54,7 @@ async function onSignedIn(): Promise<void> {
54
54
  </h1>
55
55
  </div>
56
56
 
57
- <div class="grid lg:grid-cols-[1fr_360px] xl:grid-cols-[1fr_420px] gap-8 items-start">
57
+ <div class="grid grid-cols-1 lg:grid-cols-[1fr_360px] xl:grid-cols-[1fr_420px] gap-8 items-start">
58
58
  <!-- Left: form sections -->
59
59
  <div class="space-y-6">
60
60
  <CheckoutGuestDetailsSection v-if="isGuest" />
@@ -2,6 +2,7 @@
2
2
  import CheckoutSectionTitle from "./CheckoutSectionTitle.vue";
3
3
 
4
4
  import type { PaymentMethod, PaymentOption } from "../../../interfaces/payment";
5
+ import { cartEcommerce } from "../../../shared/themeEvents";
5
6
 
6
7
  const { icon } = useIcons();
7
8
  const { t, locale } = useI18n();
@@ -85,7 +86,16 @@ const costCenterOptions = computed(() =>
85
86
  })) ?? [],
86
87
  );
87
88
 
89
+ const themeEvents = useThemeEvents();
90
+
88
91
  function selectMethod(method: PaymentMethod) {
92
+ // `add_payment_info` on the buyer's own choice — not for the default the
93
+ // section reconciles to on its own (the watch above).
94
+ if (form.value.paymentMethod !== method && cartStore.items.length) {
95
+ themeEvents.emit("add_payment_info", {
96
+ ecommerce: cartEcommerce(cartStore.items, { payment_type: String(method).slice(0, 64) }),
97
+ });
98
+ }
89
99
  form.value.paymentMethod = method;
90
100
  if (method !== "po_number") {
91
101
  form.value.poNumber = "";
@@ -153,8 +153,12 @@ async function handlePlaceOrder() {
153
153
  v-model="form.promoCode"
154
154
  :placeholder="t('onepage.summary.promoCodePlaceholder')"
155
155
  class="flex-1"
156
+ :ui="{ base: 'min-h-11 lg:min-h-0' }"
156
157
  />
157
- <UButton variant="outline">
158
+ <UButton
159
+ variant="outline"
160
+ class="min-h-11 lg:min-h-0"
161
+ >
158
162
  {{ t('onepage.summary.applyPromo') }}
159
163
  </UButton>
160
164
  </div>
@@ -189,6 +193,7 @@ async function handlePlaceOrder() {
189
193
  <!-- Place order / submit requisition -->
190
194
  <UButton
191
195
  block
196
+ class="min-h-11 lg:min-h-0"
192
197
  :disabled="isRequester ? submitting : !canSubmit"
193
198
  :loading="submitting"
194
199
  @click="handlePlaceOrder"
@@ -199,6 +204,7 @@ async function handlePlaceOrder() {
199
204
  <!-- Back to cart -->
200
205
  <UButton
201
206
  block
207
+ class="min-h-11 lg:min-h-0"
202
208
  variant="ghost"
203
209
  color="neutral"
204
210
  :to="to('/cart')"
@@ -0,0 +1,13 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * A named layout extension point (`header`, `footer`). The design system
4
+ * renders its default content — the slot — unchanged; a theme layer overrides
5
+ * this component (same path) to add tenant-authored content before or after
6
+ * it, or to replace it (ADR-0111).
7
+ */
8
+ defineProps<{ name: string }>();
9
+ </script>
10
+
11
+ <template>
12
+ <slot />
13
+ </template>
@@ -143,6 +143,14 @@ const year = new Date().getFullYear();
143
143
  >
144
144
  {{ t(link.label) }}
145
145
  </NuxtLink>
146
+ <!-- Reopens the cookie choice (Consent Manager). Renders nothing in
147
+ the editor, where no banner is shown either. -->
148
+ <ConsentPreferencesLink
149
+ class="text-xs text-dimmed dark:text-white/70 cursor-pointer
150
+ hover:text-default dark:hover:text-white transition-colors"
151
+ >
152
+ {{ t('footer.cookieSettings') }}
153
+ </ConsentPreferencesLink>
146
154
  </nav>
147
155
 
148
156
  <!-- Social icons -->
@@ -9,11 +9,12 @@ const { t } = useI18n();
9
9
  const localePath = useLocalePath();
10
10
  const isMenuOpen = ref(false);
11
11
 
12
- // Symmetric grid: flexible side columns keep the wide search column truly
13
- // centered in the header, independent of logo/action widths.
12
+ // Symmetric flexible side columns keep the search truly centered in the
13
+ // header; their max-content minimum means the logo and actions (labels at xl)
14
+ // can never be squeezed — the search column gives way first on tablet.
14
15
  const headerUi = {
15
16
  container: [
16
- "grid grid-cols-[1fr_minmax(0,46rem)_1fr] items-center gap-4 lg:gap-6",
17
+ "grid grid-cols-[minmax(max-content,1fr)_minmax(0,46rem)_minmax(max-content,1fr)] items-center gap-4 lg:gap-6",
17
18
  "h-(--ui-header-height)",
18
19
  "px-4 sm:px-6 lg:px-8",
19
20
  "max-w-(--ui-container) mx-auto w-full",
@@ -100,11 +100,11 @@ function isActive(to: string): boolean {
100
100
  >
101
101
  <div
102
102
  class="px-4 sm:px-6 lg:px-8 max-w-(--ui-container) mx-auto w-full
103
- py-3 flex items-center gap-8"
103
+ py-3 flex items-center gap-4 lg:gap-8"
104
104
  >
105
105
  <ul
106
106
  role="list"
107
- class="flex-1 flex items-center gap-6 lg:gap-8"
107
+ class="flex-1 flex items-center gap-4 lg:gap-8"
108
108
  >
109
109
  <!--
110
110
  A panel item's trigger is a button, not a link: its job is the
@@ -147,7 +147,7 @@ function isActive(to: string): boolean {
147
147
  </ul>
148
148
  <ul
149
149
  role="list"
150
- class="hidden md:flex items-center gap-6"
150
+ class="hidden md:flex items-center gap-4 lg:gap-6"
151
151
  >
152
152
  <li
153
153
  v-for="item in mainNavigationSecondary"
@@ -68,9 +68,11 @@ const cardProps = computed(() => viewMode.value === "list"
68
68
  >
69
69
  <component
70
70
  :is="productComponent"
71
- v-for="product in listing.products.value"
71
+ v-for="(product, index) in listing.products.value"
72
72
  :key="product.id"
73
73
  :product="product"
74
+ :list-id="listing.listId?.()"
75
+ :list-position="(listing.page.value - 1) * listing.perPage + index + 1"
74
76
  v-bind="cardProps"
75
77
  />
76
78
  </div>
@@ -23,6 +23,10 @@ const props = withDefaults(defineProps<{
23
23
  * no stock; `info` always links to the detail page.
24
24
  */
25
25
  action?: "order" | "info";
26
+ /** The list this card is shown in, reported when it is opened. */
27
+ listId?: string;
28
+ /** 1-based position in that list. */
29
+ listPosition?: number;
26
30
  }>(), {
27
31
  action: "order",
28
32
  });
@@ -34,7 +38,10 @@ const { public: { locale } } = useRuntimeConfig();
34
38
  const { taxIncludedPrices } = useShopSettings();
35
39
  const currency = useDisplayCurrency();
36
40
 
37
- const { url } = useProductCard(() => props.product);
41
+ const { url, select } = useProductCard(
42
+ () => props.product,
43
+ () => ({ listId: props.listId, position: props.listPosition }),
44
+ );
38
45
  const { isOutOfStock, hasPrice, addToCart } = useProductCardActions(() => props.product);
39
46
 
40
47
  const canOrder = computed(() =>
@@ -63,6 +70,7 @@ function formatPrice(price: number): string {
63
70
  <div class="group flex h-full flex-col rounded-lg border border-(--ui-border) p-3 transition-colors hover:border-primary/60">
64
71
  <NuxtLink
65
72
  :to="url"
73
+ @click="select"
66
74
  tabindex="-1"
67
75
  aria-hidden="true"
68
76
  class="block"
@@ -84,6 +92,7 @@ function formatPrice(price: number): string {
84
92
 
85
93
  <NuxtLink
86
94
  :to="url"
95
+ @click="select"
87
96
  class="mt-2 block text-sm leading-snug line-clamp-2 text-highlighted group-hover:text-primary"
88
97
  >
89
98
  {{ props.product.name }}