@revenexx/cover 0.2.30 → 0.2.32
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/app/components/account/governance/AccountRequisitionDetail.vue +3 -6
- package/app/components/account/orderlists/AccountOrderListDetail.vue +3 -6
- package/app/components/account/orders/AccountOrderDetail.vue +3 -6
- package/app/components/cart/drawer/CartDrawer.vue +1 -1
- package/app/components/cart/item/CartItem.vue +6 -9
- package/app/components/cart/position/CartPosition.vue +3 -5
- package/app/components/cart/recommend/CartRecommendCard.vue +3 -7
- package/app/components/checkout/confirmation/CheckoutConfirmationOrderRecap.vue +3 -6
- package/app/components/checkout/onepage/CheckoutDeliverySection.vue +19 -5
- package/app/components/checkout/onepage/CheckoutPaymentSection.vue +11 -5
- package/package.json +1 -1
|
@@ -16,7 +16,6 @@ const { to } = useAppUrl();
|
|
|
16
16
|
const toast = useToast();
|
|
17
17
|
const cart = useCartStore();
|
|
18
18
|
const { role, costCenterById } = useB2BContext();
|
|
19
|
-
const { getImage } = useProductImage();
|
|
20
19
|
const { formatCurrency } = useCartSummaryFormatting();
|
|
21
20
|
|
|
22
21
|
const { data: requisition, status, error } = useFetch<Requisition>(
|
|
@@ -184,12 +183,10 @@ async function loadIntoCart(): Promise<void> {
|
|
|
184
183
|
class="w-14 h-14 shrink-0 flex items-center justify-center rounded-lg
|
|
185
184
|
bg-elevated/60 ring-1 ring-(--ui-border) p-1.5"
|
|
186
185
|
>
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
:src="getImage(item.image)"
|
|
186
|
+
<ProductMediaImage
|
|
187
|
+
:src="item.image ?? ''"
|
|
190
188
|
:alt="item.name"
|
|
191
|
-
|
|
192
|
-
>
|
|
189
|
+
/>
|
|
193
190
|
</span>
|
|
194
191
|
<div class="min-w-0 flex-1">
|
|
195
192
|
<p class="text-sm font-medium text-highlighted truncate">
|
|
@@ -16,7 +16,6 @@ const toast = useToast();
|
|
|
16
16
|
const cart = useCartStore();
|
|
17
17
|
const authStore = useAuthStore();
|
|
18
18
|
const localePath = useLocalePath();
|
|
19
|
-
const { getImage } = useProductImage();
|
|
20
19
|
const { formatCurrency } = useCartSummaryFormatting();
|
|
21
20
|
|
|
22
21
|
const { data: list, status, error, refresh } = useFetch<OrderList>(
|
|
@@ -233,12 +232,10 @@ async function addToCart(): Promise<void> {
|
|
|
233
232
|
class="w-14 h-14 shrink-0 flex items-center justify-center rounded-lg
|
|
234
233
|
bg-elevated/60 ring-1 ring-(--ui-border) p-1.5"
|
|
235
234
|
>
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
:src="getImage(position.image)"
|
|
235
|
+
<ProductMediaImage
|
|
236
|
+
:src="position.image ?? ''"
|
|
239
237
|
:alt="position.name"
|
|
240
|
-
|
|
241
|
-
>
|
|
238
|
+
/>
|
|
242
239
|
</span>
|
|
243
240
|
<div class="min-w-0 flex-1">
|
|
244
241
|
<p class="text-sm font-medium text-highlighted truncate">
|
|
@@ -17,7 +17,6 @@ const { t, d } = useI18n();
|
|
|
17
17
|
const { to } = useAppUrl();
|
|
18
18
|
const toast = useToast();
|
|
19
19
|
const cart = useCartStore();
|
|
20
|
-
const { getImage } = useProductImage();
|
|
21
20
|
const { formatCurrency } = useCartSummaryFormatting();
|
|
22
21
|
|
|
23
22
|
const { data: order, status, error, refresh } = useFetch<AccountOrder>(
|
|
@@ -353,12 +352,10 @@ async function submitReturn(): Promise<void> {
|
|
|
353
352
|
class="w-14 h-14 shrink-0 flex items-center justify-center rounded-lg
|
|
354
353
|
bg-elevated/60 ring-1 ring-(--ui-border) p-1.5"
|
|
355
354
|
>
|
|
356
|
-
<
|
|
357
|
-
|
|
358
|
-
:src="getImage(position.image)"
|
|
355
|
+
<ProductMediaImage
|
|
356
|
+
:src="position.image ?? ''"
|
|
359
357
|
:alt="position.name"
|
|
360
|
-
|
|
361
|
-
>
|
|
358
|
+
/>
|
|
362
359
|
</span>
|
|
363
360
|
<div class="min-w-0 flex-1">
|
|
364
361
|
<p class="text-sm font-medium text-highlighted truncate">
|
|
@@ -12,7 +12,6 @@ const props = defineProps<{
|
|
|
12
12
|
showTaxIncludedPrice?: boolean;
|
|
13
13
|
}>();
|
|
14
14
|
|
|
15
|
-
const { getImage } = useProductImage();
|
|
16
15
|
const cart = useCartStore();
|
|
17
16
|
const { t } = useI18n();
|
|
18
17
|
const { public: { locale } } = useRuntimeConfig();
|
|
@@ -186,21 +185,19 @@ onMounted(() => {
|
|
|
186
185
|
class="contents"
|
|
187
186
|
:aria-label="item.name"
|
|
188
187
|
>
|
|
189
|
-
<
|
|
190
|
-
:src="
|
|
188
|
+
<ProductMediaImage
|
|
189
|
+
:src="item.image"
|
|
191
190
|
:alt="item.name"
|
|
192
|
-
|
|
193
|
-
>
|
|
191
|
+
/>
|
|
194
192
|
</NuxtLink>
|
|
195
193
|
<div
|
|
196
194
|
v-else
|
|
197
195
|
class="contents"
|
|
198
196
|
>
|
|
199
|
-
<
|
|
200
|
-
:src="
|
|
197
|
+
<ProductMediaImage
|
|
198
|
+
:src="item.image"
|
|
201
199
|
:alt="item.name"
|
|
202
|
-
|
|
203
|
-
>
|
|
200
|
+
/>
|
|
204
201
|
</div>
|
|
205
202
|
</div>
|
|
206
203
|
<div class="flex flex-col gap-0.5 flex-1">
|
|
@@ -24,7 +24,6 @@ const props = defineProps<{
|
|
|
24
24
|
|
|
25
25
|
const { icon } = useIcons();
|
|
26
26
|
const { t } = useI18n();
|
|
27
|
-
const { getImage } = useProductImage();
|
|
28
27
|
const localePath = useLocalePath();
|
|
29
28
|
const cart = useCartStore();
|
|
30
29
|
const selection = useCartSelection();
|
|
@@ -146,11 +145,10 @@ const hintColor = (type: string) =>
|
|
|
146
145
|
:aria-label="item.name"
|
|
147
146
|
:tabindex="detailUrl ? 0 : -1"
|
|
148
147
|
>
|
|
149
|
-
<
|
|
150
|
-
:src="
|
|
148
|
+
<ProductMediaImage
|
|
149
|
+
:src="item.image"
|
|
151
150
|
:alt="item.name"
|
|
152
|
-
|
|
153
|
-
>
|
|
151
|
+
/>
|
|
154
152
|
</NuxtLink>
|
|
155
153
|
|
|
156
154
|
<!-- Identity -->
|
|
@@ -13,7 +13,6 @@ const emit = defineEmits<{
|
|
|
13
13
|
|
|
14
14
|
const { icon } = useIcons();
|
|
15
15
|
const { t } = useI18n();
|
|
16
|
-
const { getImage } = useProductImage();
|
|
17
16
|
const { formatCurrency } = useCartSummaryFormatting();
|
|
18
17
|
</script>
|
|
19
18
|
|
|
@@ -25,13 +24,10 @@ const { formatCurrency } = useCartSummaryFormatting();
|
|
|
25
24
|
<span
|
|
26
25
|
class="h-24 flex items-center justify-center rounded-lg bg-elevated/60 p-2 mb-2"
|
|
27
26
|
>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
:src="getImage(image)"
|
|
27
|
+
<ProductMediaImage
|
|
28
|
+
:src="image ?? ''"
|
|
31
29
|
:alt="name"
|
|
32
|
-
|
|
33
|
-
loading="lazy"
|
|
34
|
-
>
|
|
30
|
+
/>
|
|
35
31
|
</span>
|
|
36
32
|
<p class="text-xs font-medium text-highlighted line-clamp-2 min-h-8">
|
|
37
33
|
{{ name }}
|
|
@@ -10,7 +10,6 @@ defineProps<{
|
|
|
10
10
|
}>();
|
|
11
11
|
|
|
12
12
|
const { t } = useI18n();
|
|
13
|
-
const { getImage } = useProductImage();
|
|
14
13
|
const { formatCurrency } = useCartSummaryFormatting();
|
|
15
14
|
</script>
|
|
16
15
|
|
|
@@ -30,12 +29,10 @@ const { formatCurrency } = useCartSummaryFormatting();
|
|
|
30
29
|
class="size-16 shrink-0 flex items-center justify-center rounded-lg
|
|
31
30
|
bg-elevated/60 ring-1 ring-(--ui-border) p-1.5"
|
|
32
31
|
>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
:src="getImage(line.image)"
|
|
32
|
+
<ProductMediaImage
|
|
33
|
+
:src="line.image ?? ''"
|
|
36
34
|
:alt="line.name"
|
|
37
|
-
|
|
38
|
-
>
|
|
35
|
+
/>
|
|
39
36
|
</span>
|
|
40
37
|
<div class="min-w-0 flex-1">
|
|
41
38
|
<p class="text-sm font-medium text-highlighted truncate">
|
|
@@ -61,13 +61,27 @@ const deliveryOptions = computed<DeliveryOption[]>(() =>
|
|
|
61
61
|
?? (liveShipping.value ? [] : profile.value?.availableDeliveryMethods)
|
|
62
62
|
?? []);
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Keep the SELECTION inside the offered list — the order is rejected outright
|
|
66
|
+
* if it is not (`422 Delivery method 'standard' is not available for this
|
|
67
|
+
* order`), and nothing on the page reveals that the invisible form value and
|
|
68
|
+
* the visible list disagree.
|
|
69
|
+
*
|
|
70
|
+
* Watching the options alone was not enough, because the selection has a
|
|
71
|
+
* second source. `initFromProfile` seeds the form from the checkout profile,
|
|
72
|
+
* whose `defaultDeliveryMethod` is the DEMO "standard" on a tenant whose
|
|
73
|
+
* shipping app answers `zone-deutschland` — so the form could be re-seeded
|
|
74
|
+
* with a dead method after the list had already settled, and the watcher never
|
|
75
|
+
* ran again because the list itself had not changed. Both sources are watched,
|
|
76
|
+
* and `immediate` covers the third case: a list that is already complete when
|
|
77
|
+
* this section mounts (the SSR payload, or the shared `useFetch` key resolved
|
|
78
|
+
* on an earlier visit) never "changes" at all.
|
|
79
|
+
*/
|
|
80
|
+
watch([deliveryOptions, () => form.value.deliveryMethod], ([options, selected]) => {
|
|
81
|
+
if (options.length && !options.some(o => o.method === selected)) {
|
|
68
82
|
form.value.deliveryMethod = rates.value?.defaultMethod ?? options[0]!.method;
|
|
69
83
|
}
|
|
70
|
-
});
|
|
84
|
+
}, { immediate: true });
|
|
71
85
|
</script>
|
|
72
86
|
|
|
73
87
|
<template>
|
|
@@ -52,13 +52,19 @@ const paymentOptions = computed<PaymentOption[]>(() =>
|
|
|
52
52
|
?? (livePayments.value ? [] : profile.value?.availablePaymentMethods)
|
|
53
53
|
?? []);
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The same reconciliation the delivery section does, for the same reason: a
|
|
57
|
+
* selection outside the offered list is rejected by the orders app, and the
|
|
58
|
+
* profile's `defaultPaymentMethod` is demo data on a live tenant. It only
|
|
59
|
+
* escaped notice here because that demo default is "invoice", which most
|
|
60
|
+
* merchants happen to offer — the eligibility list is the authority, not the
|
|
61
|
+
* coincidence.
|
|
62
|
+
*/
|
|
63
|
+
watch([paymentOptions, () => form.value.paymentMethod], ([options, selected]) => {
|
|
64
|
+
if (options.length && !options.some(o => o.method === selected)) {
|
|
59
65
|
form.value.paymentMethod = eligible.value?.defaultMethod ?? options[0]!.method;
|
|
60
66
|
}
|
|
61
|
-
});
|
|
67
|
+
}, { immediate: true });
|
|
62
68
|
|
|
63
69
|
const formatFee = (option: PaymentOption): string | null => {
|
|
64
70
|
if (!option.fee || option.fee <= 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revenexx/cover",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.32",
|
|
4
4
|
"description": "Cover \u2014 revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|