@propeller-commerce/propeller-v2-vue-ui 0.3.14
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/CHANGELOG.md +549 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +178 -0
- package/README.md +282 -0
- package/STYLING.md +119 -0
- package/dist/ProductVideos.vue_vue_type_script_setup_true_lang-BSXOpWBD.js +1706 -0
- package/dist/ProductVideos.vue_vue_type_script_setup_true_lang-BSXOpWBD.js.map +1 -0
- package/dist/ProductVideos.vue_vue_type_script_setup_true_lang-cfRT3L_k.cjs +1705 -0
- package/dist/ProductVideos.vue_vue_type_script_setup_true_lang-cfRT3L_k.cjs.map +1 -0
- package/dist/__mocks__/decorators.d.ts +17 -0
- package/dist/__mocks__/fixtures.d.ts +43 -0
- package/dist/__mocks__/mockServices.d.ts +7 -0
- package/dist/components/AccountIconAndMenu.vue.d.ts +152 -0
- package/dist/components/ActionCode.vue.d.ts +29 -0
- package/dist/components/AddToCart.vue.d.ts +122 -0
- package/dist/components/AddToFavorite.vue.d.ts +19 -0
- package/dist/components/AddressCard.vue.d.ts +169 -0
- package/dist/components/AddressSelector.vue.d.ts +30 -0
- package/dist/components/Breadcrumbs.vue.d.ts +69 -0
- package/dist/components/CartBonusItems.vue.d.ts +21 -0
- package/dist/components/CartCarriers.vue.d.ts +24 -0
- package/dist/components/CartIconAndSidebar.vue.d.ts +104 -0
- package/dist/components/CartItem.vue.d.ts +178 -0
- package/dist/components/CartOverview.vue.d.ts +41 -0
- package/dist/components/CartPaymethods.vue.d.ts +23 -0
- package/dist/components/CartSummary.vue.d.ts +58 -0
- package/dist/components/CategoryDescription.vue.d.ts +29 -0
- package/dist/components/CategoryShortDescription.vue.d.ts +18 -0
- package/dist/components/ClusterCard.vue.d.ts +251 -0
- package/dist/components/ClusterConfigurator.vue.d.ts +41 -0
- package/dist/components/ClusterInfo.vue.d.ts +73 -0
- package/dist/components/ClusterJsonLd.vue.d.ts +10 -0
- package/dist/components/ClusterOptions.vue.d.ts +44 -0
- package/dist/components/CompanySwitcher.vue.d.ts +18 -0
- package/dist/components/DeliveryDate.vue.d.ts +27 -0
- package/dist/components/FavoriteListDetails.vue.d.ts +94 -0
- package/dist/components/FavoriteListItem.vue.d.ts +141 -0
- package/dist/components/FavoriteLists.vue.d.ts +73 -0
- package/dist/components/ForgotPassword.vue.d.ts +35 -0
- package/dist/components/GridFilters.vue.d.ts +64 -0
- package/dist/components/GridPagination.vue.d.ts +34 -0
- package/dist/components/GridTitle.vue.d.ts +22 -0
- package/dist/components/GridToolbar.vue.d.ts +117 -0
- package/dist/components/ItemListJsonLd.vue.d.ts +10 -0
- package/dist/components/ItemStock.vue.d.ts +31 -0
- package/dist/components/ItemsOverview.vue.d.ts +40 -0
- package/dist/components/LoginForm.vue.d.ts +139 -0
- package/dist/components/Menu.vue.d.ts +73 -0
- package/dist/components/OrderActions.vue.d.ts +25 -0
- package/dist/components/OrderBonusItems.vue.d.ts +19 -0
- package/dist/components/OrderItemCard.vue.d.ts +47 -0
- package/dist/components/OrderList.vue.d.ts +66 -0
- package/dist/components/OrderShipments.vue.d.ts +11 -0
- package/dist/components/OrderSummary.vue.d.ts +49 -0
- package/dist/components/OrderTotals.vue.d.ts +34 -0
- package/dist/components/PriceToggle.vue.d.ts +24 -0
- package/dist/components/ProductBulkPrices.vue.d.ts +35 -0
- package/dist/components/ProductBundles.vue.d.ts +88 -0
- package/dist/components/ProductCard.vue.d.ts +332 -0
- package/dist/components/ProductDescription.vue.d.ts +30 -0
- package/dist/components/ProductDownloads.vue.d.ts +22 -0
- package/dist/components/ProductGallery.vue.d.ts +25 -0
- package/dist/components/ProductGrid.vue.d.ts +290 -0
- package/dist/components/ProductInfo.vue.d.ts +179 -0
- package/dist/components/ProductJsonLd.vue.d.ts +10 -0
- package/dist/components/ProductPrice.vue.d.ts +42 -0
- package/dist/components/ProductShortDescription.vue.d.ts +18 -0
- package/dist/components/ProductSlider.vue.d.ts +176 -0
- package/dist/components/ProductSpecifications.vue.d.ts +37 -0
- package/dist/components/ProductTabs.vue.d.ts +83 -0
- package/dist/components/ProductVideos.vue.d.ts +22 -0
- package/dist/components/PropellerProvider.vue.d.ts +40 -0
- package/dist/components/PurchaseAuthorizationConfigurator.vue.d.ts +44 -0
- package/dist/components/PurchaseAuthorizationRequests.vue.d.ts +50 -0
- package/dist/components/QuoteActions.vue.d.ts +22 -0
- package/dist/components/RegisterForm.vue.d.ts +87 -0
- package/dist/components/SearchBar.vue.d.ts +71 -0
- package/dist/components/UserDetails.vue.d.ts +44 -0
- package/dist/components/defaults/DefaultProductBadges.vue.d.ts +3 -0
- package/dist/components/defaults/DefaultProductImage.vue.d.ts +3 -0
- package/dist/components/defaults/DefaultProductSurcharges.vue.d.ts +3 -0
- package/dist/composables/shared/usePagination.d.ts +19 -0
- package/dist/composables/shared/useServiceFetch.d.ts +9 -0
- package/dist/composables/shared/useUserIdentity.d.ts +13 -0
- package/dist/composables/shared/utils/cartInit.d.ts +18 -0
- package/dist/composables/shared/utils/fetchActiveCart.d.ts +10 -0
- package/dist/composables/shared/utils/mergeAnonymousCart.d.ts +12 -0
- package/dist/composables/vue/useAddress.d.ts +50 -0
- package/dist/composables/vue/useAuth.d.ts +80 -0
- package/dist/composables/vue/useCart.d.ts +64 -0
- package/dist/composables/vue/useCheckout.d.ts +41 -0
- package/dist/composables/vue/useClusterConfigurator.d.ts +26 -0
- package/dist/composables/vue/useCompany.d.ts +31 -0
- package/dist/composables/vue/useFavorites.d.ts +39 -0
- package/dist/composables/vue/useInfraProps.d.ts +27 -0
- package/dist/composables/vue/useMenu.d.ts +24 -0
- package/dist/composables/vue/useOrders.d.ts +64 -0
- package/dist/composables/vue/useProductBundles.d.ts +37 -0
- package/dist/composables/vue/useProductInfo.d.ts +33 -0
- package/dist/composables/vue/useProductSearch.d.ts +49 -0
- package/dist/composables/vue/useProductSlider.d.ts +31 -0
- package/dist/composables/vue/useProductSpecs.d.ts +24 -0
- package/dist/composables/vue/usePurchaseAuthorization.d.ts +102 -0
- package/dist/composables/vue/useResolvedProps.d.ts +42 -0
- package/dist/composables/vue/useServices.d.ts +13 -0
- package/dist/context/ProductGridContext.d.ts +59 -0
- package/dist/context/PropellerContext.d.ts +51 -0
- package/dist/index-BN8nyGRL.js +518 -0
- package/dist/index-BN8nyGRL.js.map +1 -0
- package/dist/index-CrrZsxTR.cjs +517 -0
- package/dist/index-CrrZsxTR.cjs.map +1 -0
- package/dist/index.cjs +20086 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.js +20088 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +67 -0
- package/dist/pure.cjs +16 -0
- package/dist/pure.cjs.map +1 -0
- package/dist/pure.d.ts +37 -0
- package/dist/pure.js +16 -0
- package/dist/pure.js.map +1 -0
- package/dist/shared.cjs +50 -0
- package/dist/shared.cjs.map +1 -0
- package/dist/shared.d.ts +14 -0
- package/dist/shared.js +50 -0
- package/dist/shared.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +91 -0
|
@@ -0,0 +1,1706 @@
|
|
|
1
|
+
import { inject, reactive, defineComponent, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createElementVNode, Fragment, renderList, createTextVNode, computed, createBlock, resolveDynamicComponent, ref, watch } from "vue";
|
|
2
|
+
import { i as deriveUserMode, I as isContentHidden, y as getLabel, n as formatPrice, z as getLanguageString, v as getCountryName } from "./index-BN8nyGRL.js";
|
|
3
|
+
import { YesNo, OrderDiscountType } from "@propeller-commerce/propeller-sdk-v2";
|
|
4
|
+
const PropellerDepsKey = /* @__PURE__ */ Symbol("propeller-deps");
|
|
5
|
+
const propellerVue = {
|
|
6
|
+
install(app, options) {
|
|
7
|
+
if (!options || !options.graphqlClient || !options.services) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
"[propeller-v2-vue-ui] propellerVue plugin requires { graphqlClient, services, currency, configuration }. Build services once via `createServices(graphqlClient)` and pass both in."
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
app.provide(PropellerDepsKey, {
|
|
13
|
+
graphqlClient: options.graphqlClient,
|
|
14
|
+
services: options.services,
|
|
15
|
+
currency: options.currency ?? "€",
|
|
16
|
+
configuration: options.configuration
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function usePropellerDeps() {
|
|
21
|
+
const deps = inject(PropellerDepsKey, null);
|
|
22
|
+
if (!deps) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
"[propeller-v2-vue-ui] usePropellerDeps() called without the plugin. Add `app.use(propellerVue, { graphqlClient, services, currency, configuration })` at startup."
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return deps;
|
|
28
|
+
}
|
|
29
|
+
function tryUsePropellerDeps() {
|
|
30
|
+
return inject(PropellerDepsKey, null);
|
|
31
|
+
}
|
|
32
|
+
const PropellerScopeKey = /* @__PURE__ */ Symbol("propeller-scope");
|
|
33
|
+
function buildInfra(deps, scope) {
|
|
34
|
+
return {
|
|
35
|
+
...deps,
|
|
36
|
+
get user() {
|
|
37
|
+
return scope.user;
|
|
38
|
+
},
|
|
39
|
+
get companyId() {
|
|
40
|
+
return scope.companyId;
|
|
41
|
+
},
|
|
42
|
+
get language() {
|
|
43
|
+
return scope.language;
|
|
44
|
+
},
|
|
45
|
+
get includeTax() {
|
|
46
|
+
return scope.includeTax;
|
|
47
|
+
},
|
|
48
|
+
get portalMode() {
|
|
49
|
+
return scope.portalMode;
|
|
50
|
+
},
|
|
51
|
+
get shopMode() {
|
|
52
|
+
return scope.shopMode;
|
|
53
|
+
},
|
|
54
|
+
get userMode() {
|
|
55
|
+
return deriveUserMode(scope.user, scope.shopMode ?? "hybrid");
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function usePropellerContext() {
|
|
60
|
+
const deps = tryUsePropellerDeps();
|
|
61
|
+
const scope = inject(PropellerScopeKey, null);
|
|
62
|
+
if (!deps || !scope) return null;
|
|
63
|
+
return buildInfra(deps, scope);
|
|
64
|
+
}
|
|
65
|
+
function useRequiredPropellerContext() {
|
|
66
|
+
const deps = usePropellerDeps();
|
|
67
|
+
const scope = inject(PropellerScopeKey, null);
|
|
68
|
+
if (!scope) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
"[propeller-v2-vue-ui] useRequiredPropellerContext() called outside a <PropellerProvider>. Wrap your routed tree with <PropellerProvider :user :companyId :language :includeTax :portalMode>."
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return buildInfra(deps, scope);
|
|
74
|
+
}
|
|
75
|
+
function useUserMode() {
|
|
76
|
+
const scope = inject(PropellerScopeKey, null);
|
|
77
|
+
if (!scope) return "anonymous";
|
|
78
|
+
return deriveUserMode(scope.user, scope.shopMode ?? "hybrid");
|
|
79
|
+
}
|
|
80
|
+
const INFRA_KEYS = [
|
|
81
|
+
"graphqlClient",
|
|
82
|
+
"services",
|
|
83
|
+
"user",
|
|
84
|
+
"companyId",
|
|
85
|
+
"language",
|
|
86
|
+
"includeTax",
|
|
87
|
+
"currency",
|
|
88
|
+
"configuration",
|
|
89
|
+
"portalMode"
|
|
90
|
+
];
|
|
91
|
+
function useInfraProps(props) {
|
|
92
|
+
const ctx = usePropellerContext();
|
|
93
|
+
const merged = {};
|
|
94
|
+
for (const key of Object.keys(props)) {
|
|
95
|
+
if (INFRA_KEYS.includes(key)) continue;
|
|
96
|
+
Object.defineProperty(merged, key, {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
configurable: true,
|
|
99
|
+
get() {
|
|
100
|
+
return props[key];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
for (const key of INFRA_KEYS) {
|
|
105
|
+
Object.defineProperty(merged, key, {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
configurable: true,
|
|
108
|
+
get() {
|
|
109
|
+
const explicit = props[key];
|
|
110
|
+
if (explicit !== void 0 && explicit !== null) return explicit;
|
|
111
|
+
return ctx ? ctx[key] : void 0;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return reactive(merged);
|
|
116
|
+
}
|
|
117
|
+
const _hoisted_1$b = ["data-hidden"];
|
|
118
|
+
const _hoisted_2$9 = {
|
|
119
|
+
key: 0,
|
|
120
|
+
class: "propeller-product-price__login-prompt text-sm text-muted-foreground italic"
|
|
121
|
+
};
|
|
122
|
+
const _hoisted_3$8 = {
|
|
123
|
+
key: 1,
|
|
124
|
+
class: "propeller-product-price__content flex flex-col gap-0.5"
|
|
125
|
+
};
|
|
126
|
+
const _hoisted_4$7 = { class: "propeller-product-price__primary flex items-baseline gap-2" };
|
|
127
|
+
const _hoisted_5$7 = { class: "propeller-product-price__tax-label text-sm text-muted-foreground" };
|
|
128
|
+
const _hoisted_6$6 = {
|
|
129
|
+
key: 0,
|
|
130
|
+
class: "propeller-product-price__secondary text-sm text-muted-foreground flex items-baseline gap-1"
|
|
131
|
+
};
|
|
132
|
+
const _hoisted_7$6 = { class: "propeller-product-price-secondary__amount" };
|
|
133
|
+
const _hoisted_8$6 = { class: "propeller-product-price-secondary__tax-label" };
|
|
134
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
135
|
+
__name: "ProductPrice",
|
|
136
|
+
props: {
|
|
137
|
+
price: {},
|
|
138
|
+
currency: {},
|
|
139
|
+
portalMode: {},
|
|
140
|
+
user: {},
|
|
141
|
+
includeTax: { type: Boolean },
|
|
142
|
+
taxZone: {},
|
|
143
|
+
options: {},
|
|
144
|
+
selectedOptionProducts: {},
|
|
145
|
+
labels: {},
|
|
146
|
+
priceSize: {},
|
|
147
|
+
className: {}
|
|
148
|
+
},
|
|
149
|
+
setup(__props) {
|
|
150
|
+
const props = __props;
|
|
151
|
+
function isHidden() {
|
|
152
|
+
return isContentHidden(props.portalMode, props.user);
|
|
153
|
+
}
|
|
154
|
+
function formatPrice$1(value) {
|
|
155
|
+
return formatPrice(value, { symbol: props.currency || "€" });
|
|
156
|
+
}
|
|
157
|
+
function getOptionsTotal(useNet) {
|
|
158
|
+
const options = props.options || [];
|
|
159
|
+
const selected = props.selectedOptionProducts || [];
|
|
160
|
+
let total = 0;
|
|
161
|
+
options.forEach((option) => {
|
|
162
|
+
if (option.hidden === YesNo.Y) return;
|
|
163
|
+
const selectedProduct = selected.find(
|
|
164
|
+
(p) => (option.products || []).some(
|
|
165
|
+
(op) => op.productId === p.productId
|
|
166
|
+
)
|
|
167
|
+
);
|
|
168
|
+
if (selectedProduct) {
|
|
169
|
+
total += useNet ? selectedProduct.price?.net || 0 : selectedProduct.price?.gross || 0;
|
|
170
|
+
} else if (option.isRequired === YesNo.Y && option.defaultProduct) {
|
|
171
|
+
const defaultId = option.defaultProduct.productId;
|
|
172
|
+
const fullDefault = (option.products || []).find(
|
|
173
|
+
(p) => p.productId === defaultId
|
|
174
|
+
) || option.defaultProduct;
|
|
175
|
+
total += useNet ? fullDefault.price?.net || 0 : fullDefault.price?.gross || 0;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return total;
|
|
179
|
+
}
|
|
180
|
+
function getLeadingPrice() {
|
|
181
|
+
const price = props.price;
|
|
182
|
+
if (!price) return "";
|
|
183
|
+
const useNet = !!props.includeTax;
|
|
184
|
+
const base = useNet ? price.net : price.gross;
|
|
185
|
+
if (base === null || base === void 0) return "";
|
|
186
|
+
return formatPrice$1(base + getOptionsTotal(useNet));
|
|
187
|
+
}
|
|
188
|
+
function getSecondaryPrice() {
|
|
189
|
+
const price = props.price;
|
|
190
|
+
if (!price) return "";
|
|
191
|
+
const useNet = !props.includeTax;
|
|
192
|
+
const base = useNet ? price.net : price.gross;
|
|
193
|
+
if (base === null || base === void 0) return "";
|
|
194
|
+
return formatPrice$1(base + getOptionsTotal(useNet));
|
|
195
|
+
}
|
|
196
|
+
function getTaxLabel() {
|
|
197
|
+
return props.includeTax ? getLabel$1("inclTax", "incl. VAT") : getLabel$1("exclTax", "excl. VAT");
|
|
198
|
+
}
|
|
199
|
+
function getSecondaryTaxLabel() {
|
|
200
|
+
return props.includeTax ? getLabel$1("exclTax", "excl. VAT") : getLabel$1("inclTax", "incl. VAT");
|
|
201
|
+
}
|
|
202
|
+
function getLabel$1(key, fallback) {
|
|
203
|
+
return getLabel(props.labels, key, fallback);
|
|
204
|
+
}
|
|
205
|
+
return (_ctx, _cache) => {
|
|
206
|
+
return openBlock(), createElementBlock("div", {
|
|
207
|
+
class: normalizeClass(`propeller-product-price ${__props.className || ""}`),
|
|
208
|
+
"data-hidden": isHidden() ? "true" : "false"
|
|
209
|
+
}, [
|
|
210
|
+
isHidden() ? (openBlock(), createElementBlock("p", _hoisted_2$9, toDisplayString(getLabel$1("loginToSeePrices", "Log in to see prices")), 1)) : createCommentVNode("", true),
|
|
211
|
+
!isHidden() && !!getLeadingPrice() ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
|
|
212
|
+
createElementVNode("div", _hoisted_4$7, [
|
|
213
|
+
createElementVNode("span", {
|
|
214
|
+
class: normalizeClass(`propeller-product-price__amount ${__props.priceSize || "text-3xl"} font-bold text-foreground`)
|
|
215
|
+
}, toDisplayString(getLeadingPrice()), 3),
|
|
216
|
+
createElementVNode("span", _hoisted_5$7, toDisplayString(getTaxLabel()), 1)
|
|
217
|
+
]),
|
|
218
|
+
!!getSecondaryPrice() ? (openBlock(), createElementBlock("div", _hoisted_6$6, [
|
|
219
|
+
createElementVNode("span", _hoisted_7$6, toDisplayString(getSecondaryPrice()), 1),
|
|
220
|
+
createElementVNode("span", _hoisted_8$6, toDisplayString(getSecondaryTaxLabel()), 1)
|
|
221
|
+
])) : createCommentVNode("", true)
|
|
222
|
+
])) : createCommentVNode("", true)
|
|
223
|
+
], 10, _hoisted_1$b);
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
const _hoisted_1$a = ["aria-label"];
|
|
228
|
+
const _hoisted_2$8 = { class: "propeller-breadcrumbs__list flex flex-wrap items-center text-sm text-muted-foreground" };
|
|
229
|
+
const _hoisted_3$7 = {
|
|
230
|
+
key: 0,
|
|
231
|
+
class: "propeller-breadcrumbs__item flex items-center",
|
|
232
|
+
"data-home": "true"
|
|
233
|
+
};
|
|
234
|
+
const _hoisted_4$6 = ["href"];
|
|
235
|
+
const _hoisted_5$6 = ["data-current"];
|
|
236
|
+
const _hoisted_6$5 = {
|
|
237
|
+
key: 0,
|
|
238
|
+
"aria-hidden": "true",
|
|
239
|
+
class: "propeller-breadcrumbs__separator mx-2 select-none text-muted-foreground/40"
|
|
240
|
+
};
|
|
241
|
+
const _hoisted_7$5 = {
|
|
242
|
+
key: 1,
|
|
243
|
+
"aria-current": "page",
|
|
244
|
+
class: "propeller-breadcrumbs__link propeller-breadcrumbs__link--current text-foreground"
|
|
245
|
+
};
|
|
246
|
+
const _hoisted_8$5 = ["href"];
|
|
247
|
+
const _hoisted_9$4 = {
|
|
248
|
+
key: 1,
|
|
249
|
+
class: "propeller-breadcrumbs__item flex items-center",
|
|
250
|
+
"data-current": "true"
|
|
251
|
+
};
|
|
252
|
+
const _hoisted_10$4 = {
|
|
253
|
+
"aria-hidden": "true",
|
|
254
|
+
class: "propeller-breadcrumbs__separator mx-2 select-none text-muted-foreground/40"
|
|
255
|
+
};
|
|
256
|
+
const _hoisted_11$4 = ["href"];
|
|
257
|
+
const _hoisted_12$3 = {
|
|
258
|
+
key: 1,
|
|
259
|
+
"aria-current": "page",
|
|
260
|
+
class: "propeller-breadcrumbs__link propeller-breadcrumbs__link--current text-foreground"
|
|
261
|
+
};
|
|
262
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
263
|
+
__name: "Breadcrumbs",
|
|
264
|
+
props: {
|
|
265
|
+
categoryPath: {},
|
|
266
|
+
showCurrent: { type: Boolean, default: true },
|
|
267
|
+
currentCategory: {},
|
|
268
|
+
currentLabel: {},
|
|
269
|
+
currentUrl: {},
|
|
270
|
+
showHome: { type: Boolean, default: true },
|
|
271
|
+
homeUrl: {},
|
|
272
|
+
language: {},
|
|
273
|
+
getUrl: {},
|
|
274
|
+
labels: {},
|
|
275
|
+
className: {},
|
|
276
|
+
configuration: {}
|
|
277
|
+
},
|
|
278
|
+
setup(__props) {
|
|
279
|
+
const props = __props;
|
|
280
|
+
function getItems() {
|
|
281
|
+
const path = props.categoryPath || [];
|
|
282
|
+
const baseId = props.configuration?.baseCategoryId;
|
|
283
|
+
const filtered = baseId ? path.filter((cat) => cat.categoryId !== baseId) : path;
|
|
284
|
+
const current = props.currentCategory;
|
|
285
|
+
if (current) {
|
|
286
|
+
const last = filtered[filtered.length - 1];
|
|
287
|
+
if (!last || last.categoryId !== current.categoryId) {
|
|
288
|
+
return [...filtered, current];
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return filtered;
|
|
292
|
+
}
|
|
293
|
+
function getDisplayItems() {
|
|
294
|
+
const items = getItems();
|
|
295
|
+
if (props.showCurrent === false && items.length > 0) {
|
|
296
|
+
return items.slice(0, items.length - 1);
|
|
297
|
+
}
|
|
298
|
+
return items;
|
|
299
|
+
}
|
|
300
|
+
function getCategoryName(cat) {
|
|
301
|
+
return getLanguageString(cat.name, props.language || "NL", "");
|
|
302
|
+
}
|
|
303
|
+
function getCategoryUrl(cat, index) {
|
|
304
|
+
if (props.getUrl) {
|
|
305
|
+
return props.getUrl(cat, index);
|
|
306
|
+
}
|
|
307
|
+
const urls = props.configuration?.urls;
|
|
308
|
+
if (urls && typeof urls.getCategoryUrl === "function") {
|
|
309
|
+
return urls.getCategoryUrl(cat, props.language);
|
|
310
|
+
}
|
|
311
|
+
const slug = getLanguageString(cat.slug, props.language || "NL", "");
|
|
312
|
+
return `/category/${cat.categoryId}/${slug}`;
|
|
313
|
+
}
|
|
314
|
+
function isCurrentItem(index) {
|
|
315
|
+
if (props.showCurrent === false) return false;
|
|
316
|
+
if (props.currentLabel) return false;
|
|
317
|
+
return index === getDisplayItems().length - 1;
|
|
318
|
+
}
|
|
319
|
+
function showSeparatorBefore(index) {
|
|
320
|
+
return props.showHome !== false || index > 0;
|
|
321
|
+
}
|
|
322
|
+
function getLabel$1(key, fallback) {
|
|
323
|
+
return getLabel(props.labels, key, fallback);
|
|
324
|
+
}
|
|
325
|
+
return (_ctx, _cache) => {
|
|
326
|
+
return openBlock(), createElementBlock("nav", {
|
|
327
|
+
"aria-label": getLabel$1("breadcrumbAriaLabel", "Breadcrumb"),
|
|
328
|
+
class: normalizeClass(`propeller-breadcrumbs ${__props.className || ""}`)
|
|
329
|
+
}, [
|
|
330
|
+
createElementVNode("ol", _hoisted_2$8, [
|
|
331
|
+
__props.showHome !== false ? (openBlock(), createElementBlock("li", _hoisted_3$7, [
|
|
332
|
+
createElementVNode("a", {
|
|
333
|
+
class: "propeller-breadcrumbs__link hover:text-foreground transition-colors",
|
|
334
|
+
href: __props.homeUrl || "/"
|
|
335
|
+
}, toDisplayString(getLabel$1("home", "Home")), 9, _hoisted_4$6)
|
|
336
|
+
])) : createCommentVNode("", true),
|
|
337
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getDisplayItems(), (cat, index) => {
|
|
338
|
+
return openBlock(), createElementBlock("li", {
|
|
339
|
+
key: cat.categoryId || index,
|
|
340
|
+
class: "propeller-breadcrumbs__item flex items-center",
|
|
341
|
+
"data-current": isCurrentItem(index) ? "true" : "false"
|
|
342
|
+
}, [
|
|
343
|
+
showSeparatorBefore(index) ? (openBlock(), createElementBlock("span", _hoisted_6$5, toDisplayString(getLabel$1("separator", "/")), 1)) : createCommentVNode("", true),
|
|
344
|
+
isCurrentItem(index) ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(getCategoryName(cat)), 1)) : (openBlock(), createElementBlock("a", {
|
|
345
|
+
key: 2,
|
|
346
|
+
class: "propeller-breadcrumbs__link hover:text-foreground transition-colors",
|
|
347
|
+
href: getCategoryUrl(cat, index)
|
|
348
|
+
}, toDisplayString(getCategoryName(cat)), 9, _hoisted_8$5))
|
|
349
|
+
], 8, _hoisted_5$6);
|
|
350
|
+
}), 128)),
|
|
351
|
+
!!__props.currentLabel ? (openBlock(), createElementBlock("li", _hoisted_9$4, [
|
|
352
|
+
createElementVNode("span", _hoisted_10$4, toDisplayString(getLabel$1("separator", "/")), 1),
|
|
353
|
+
!!__props.currentUrl ? (openBlock(), createElementBlock("a", {
|
|
354
|
+
key: 0,
|
|
355
|
+
"aria-current": "page",
|
|
356
|
+
class: "propeller-breadcrumbs__link propeller-breadcrumbs__link--current text-foreground",
|
|
357
|
+
href: __props.currentUrl
|
|
358
|
+
}, toDisplayString(__props.currentLabel), 9, _hoisted_11$4)) : createCommentVNode("", true),
|
|
359
|
+
!__props.currentUrl ? (openBlock(), createElementBlock("span", _hoisted_12$3, toDisplayString(__props.currentLabel), 1)) : createCommentVNode("", true)
|
|
360
|
+
])) : createCommentVNode("", true)
|
|
361
|
+
])
|
|
362
|
+
], 10, _hoisted_1$a);
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
const _hoisted_1$9 = ["data-available", "data-stock"];
|
|
367
|
+
const _hoisted_2$7 = {
|
|
368
|
+
key: 0,
|
|
369
|
+
class: "propeller-item-stock__count opacity-70"
|
|
370
|
+
};
|
|
371
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
372
|
+
__name: "ItemStock",
|
|
373
|
+
props: {
|
|
374
|
+
inventory: {},
|
|
375
|
+
showAvailability: { type: Boolean, default: true },
|
|
376
|
+
showStock: { type: Boolean, default: true },
|
|
377
|
+
labels: {},
|
|
378
|
+
className: {}
|
|
379
|
+
},
|
|
380
|
+
setup(__props) {
|
|
381
|
+
const props = __props;
|
|
382
|
+
function getLabel$1(key, fallback) {
|
|
383
|
+
return getLabel(props.labels, key, fallback);
|
|
384
|
+
}
|
|
385
|
+
function getTotalQuantity() {
|
|
386
|
+
const qty = props.inventory?.totalQuantity;
|
|
387
|
+
return qty !== void 0 && qty !== null ? qty : -1;
|
|
388
|
+
}
|
|
389
|
+
function isAvailable() {
|
|
390
|
+
return getTotalQuantity() > 0;
|
|
391
|
+
}
|
|
392
|
+
function getStockStatusLabel() {
|
|
393
|
+
const qty = getTotalQuantity();
|
|
394
|
+
if (qty < 0) return "";
|
|
395
|
+
if (qty === 0) return getLabel$1("outOfStock", "Out of stock");
|
|
396
|
+
if (qty <= 5) return getLabel$1("lowStock", "Low stock");
|
|
397
|
+
return getLabel$1("inStock", "In stock");
|
|
398
|
+
}
|
|
399
|
+
function getStockStatusClass() {
|
|
400
|
+
const qty = getTotalQuantity();
|
|
401
|
+
if (qty <= 0) return "text-destructive bg-destructive/10 border-destructive";
|
|
402
|
+
if (qty <= 5) return "text-warning bg-warning/10 border-warning";
|
|
403
|
+
return "text-success bg-success/10 border-success";
|
|
404
|
+
}
|
|
405
|
+
function getStockStatusData() {
|
|
406
|
+
const qty = getTotalQuantity();
|
|
407
|
+
if (qty <= 0) return "out";
|
|
408
|
+
if (qty <= 5) return "low";
|
|
409
|
+
return "in";
|
|
410
|
+
}
|
|
411
|
+
function getAvailabilityLabel() {
|
|
412
|
+
return isAvailable() ? getLabel$1("available", "Available") : getLabel$1("notAvailable", "Not available");
|
|
413
|
+
}
|
|
414
|
+
function getAvailabilityClass() {
|
|
415
|
+
return isAvailable() ? "text-success bg-success/10 border-success" : "text-destructive bg-destructive/10 border-destructive";
|
|
416
|
+
}
|
|
417
|
+
function getAvailabilityDotClass() {
|
|
418
|
+
return isAvailable() ? "bg-success" : "bg-destructive";
|
|
419
|
+
}
|
|
420
|
+
function hasInventory() {
|
|
421
|
+
return !!props.inventory && getTotalQuantity() >= 0;
|
|
422
|
+
}
|
|
423
|
+
return (_ctx, _cache) => {
|
|
424
|
+
return hasInventory() ? (openBlock(), createElementBlock("div", {
|
|
425
|
+
key: 0,
|
|
426
|
+
class: normalizeClass(`propeller-item-stock flex flex-wrap items-center gap-1.5 ${__props.className || ""}`),
|
|
427
|
+
"data-available": isAvailable() ? "true" : "false",
|
|
428
|
+
"data-stock": getStockStatusData()
|
|
429
|
+
}, [
|
|
430
|
+
__props.showAvailability !== false ? (openBlock(), createElementBlock("span", {
|
|
431
|
+
key: 0,
|
|
432
|
+
class: normalizeClass(`propeller-item-stock__availability inline-flex items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-medium ${getAvailabilityClass()}`)
|
|
433
|
+
}, [
|
|
434
|
+
createElementVNode("span", {
|
|
435
|
+
class: normalizeClass(`propeller-item-stock__availability-dot h-1.5 w-1.5 flex-shrink-0 rounded-full ${getAvailabilityDotClass()}`)
|
|
436
|
+
}, null, 2),
|
|
437
|
+
createTextVNode(toDisplayString(getAvailabilityLabel()), 1)
|
|
438
|
+
], 2)) : createCommentVNode("", true),
|
|
439
|
+
__props.showStock !== false && !!getStockStatusLabel() ? (openBlock(), createElementBlock("span", {
|
|
440
|
+
key: 1,
|
|
441
|
+
class: normalizeClass(`propeller-item-stock__status inline-flex items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-medium ${getStockStatusClass()}`)
|
|
442
|
+
}, [
|
|
443
|
+
createTextVNode(toDisplayString(getStockStatusLabel()) + " ", 1),
|
|
444
|
+
getTotalQuantity() > 0 ? (openBlock(), createElementBlock("span", _hoisted_2$7, " (" + toDisplayString(getTotalQuantity()) + toDisplayString(getLabel$1("pieces", "pcs")) + ") ", 1)) : createCommentVNode("", true)
|
|
445
|
+
], 2)) : createCommentVNode("", true)
|
|
446
|
+
], 10, _hoisted_1$9)) : createCommentVNode("", true);
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
const _hoisted_1$8 = ["innerHTML"];
|
|
451
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
452
|
+
__name: "CategoryShortDescription",
|
|
453
|
+
props: {
|
|
454
|
+
language: {},
|
|
455
|
+
category: {},
|
|
456
|
+
className: {}
|
|
457
|
+
},
|
|
458
|
+
setup(__props) {
|
|
459
|
+
const props = __props;
|
|
460
|
+
const infra = useInfraProps(props);
|
|
461
|
+
const html = computed(() => {
|
|
462
|
+
return getLanguageString(props.category?.shortDescription, infra.language || "NL", "");
|
|
463
|
+
});
|
|
464
|
+
return (_ctx, _cache) => {
|
|
465
|
+
return !!html.value ? (openBlock(), createElementBlock("div", {
|
|
466
|
+
key: 0,
|
|
467
|
+
class: normalizeClass(`propeller-category-short-description mb-6 ${__props.className || ""}`)
|
|
468
|
+
}, [
|
|
469
|
+
createElementVNode("div", {
|
|
470
|
+
class: "propeller-category-short-description__content prose prose-slate max-w-none text-muted-foreground",
|
|
471
|
+
innerHTML: html.value
|
|
472
|
+
}, null, 8, _hoisted_1$8)
|
|
473
|
+
], 2)) : createCommentVNode("", true);
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
const _hoisted_1$7 = { class: "propeller-grid-title__row flex items-baseline gap-3 mb-3" };
|
|
478
|
+
const _hoisted_2$6 = {
|
|
479
|
+
key: 0,
|
|
480
|
+
class: "propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight"
|
|
481
|
+
};
|
|
482
|
+
const _hoisted_3$6 = {
|
|
483
|
+
key: 1,
|
|
484
|
+
class: "propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight"
|
|
485
|
+
};
|
|
486
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
487
|
+
__name: "GridTitle",
|
|
488
|
+
props: {
|
|
489
|
+
title: {},
|
|
490
|
+
language: {},
|
|
491
|
+
headingLevel: {},
|
|
492
|
+
className: {}
|
|
493
|
+
},
|
|
494
|
+
setup(__props) {
|
|
495
|
+
return (_ctx, _cache) => {
|
|
496
|
+
return openBlock(), createElementBlock("div", {
|
|
497
|
+
class: normalizeClass(`propeller-grid-title mb-8 ${__props.className || ""}`)
|
|
498
|
+
}, [
|
|
499
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
500
|
+
__props.headingLevel === "h2" ? (openBlock(), createElementBlock("h2", _hoisted_2$6, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
501
|
+
__props.headingLevel !== "h2" ? (openBlock(), createElementBlock("h1", _hoisted_3$6, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
502
|
+
])
|
|
503
|
+
], 2);
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
const _hoisted_1$6 = { class: "propeller-order-item-card" };
|
|
508
|
+
const _hoisted_2$5 = ["data-child"];
|
|
509
|
+
const _hoisted_3$5 = { class: "flex items-center gap-4" };
|
|
510
|
+
const _hoisted_4$5 = {
|
|
511
|
+
key: 0,
|
|
512
|
+
class: "propeller-order-item-card__media relative w-16 h-16 flex-shrink-0 rounded overflow-hidden"
|
|
513
|
+
};
|
|
514
|
+
const _hoisted_5$5 = ["src", "alt"];
|
|
515
|
+
const _hoisted_6$4 = {
|
|
516
|
+
key: 1,
|
|
517
|
+
class: "propeller-order-item-card__image-placeholder w-16 h-16 bg-surface-hover rounded flex items-center justify-center text-foreground-subtle text-xs"
|
|
518
|
+
};
|
|
519
|
+
const _hoisted_7$4 = ["href"];
|
|
520
|
+
const _hoisted_8$4 = {
|
|
521
|
+
key: 2,
|
|
522
|
+
class: "propeller-order-item-card__sku text-sm text-muted-foreground mt-1"
|
|
523
|
+
};
|
|
524
|
+
const _hoisted_9$3 = {
|
|
525
|
+
key: 3,
|
|
526
|
+
class: "propeller-order-item-card__notes text-sm text-foreground-subtle mt-1 italic"
|
|
527
|
+
};
|
|
528
|
+
const _hoisted_10$3 = { key: 1 };
|
|
529
|
+
const _hoisted_11$3 = { class: "propeller-order-item-card__cell propeller-order-item-card__cell--product px-6 py-2 pl-28" };
|
|
530
|
+
const _hoisted_12$2 = { class: "propeller-order-item-card__child-title text-sm text-muted-foreground" };
|
|
531
|
+
const _hoisted_13$2 = {
|
|
532
|
+
key: 0,
|
|
533
|
+
class: "propeller-order-item-card__cell propeller-order-item-card__cell--quantity px-6 py-2 text-center text-sm text-muted-foreground"
|
|
534
|
+
};
|
|
535
|
+
const _hoisted_14$2 = {
|
|
536
|
+
key: 1,
|
|
537
|
+
class: "propeller-order-item-card__cell propeller-order-item-card__cell--discount px-6 py-2 text-right text-sm text-muted-foreground"
|
|
538
|
+
};
|
|
539
|
+
const _hoisted_15$2 = {
|
|
540
|
+
key: 2,
|
|
541
|
+
class: "propeller-order-item-card__cell propeller-order-item-card__cell--price px-6 py-2 text-right whitespace-nowrap text-sm text-muted-foreground"
|
|
542
|
+
};
|
|
543
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
544
|
+
__name: "OrderItemCard",
|
|
545
|
+
props: {
|
|
546
|
+
orderItem: {},
|
|
547
|
+
currency: {},
|
|
548
|
+
childItems: {},
|
|
549
|
+
titleLinkable: { type: Boolean, default: true },
|
|
550
|
+
showImage: { type: Boolean, default: true },
|
|
551
|
+
showStockComponent: { type: Boolean, default: false },
|
|
552
|
+
showSku: { type: Boolean, default: true },
|
|
553
|
+
showQuantity: { type: Boolean, default: true },
|
|
554
|
+
showPrice: { type: Boolean, default: true },
|
|
555
|
+
showDiscount: { type: Boolean, default: false },
|
|
556
|
+
showItemNotes: { type: Boolean, default: false },
|
|
557
|
+
isChildItem: { type: Boolean, default: false },
|
|
558
|
+
formatPrice: {},
|
|
559
|
+
labels: {},
|
|
560
|
+
priceComponent: {},
|
|
561
|
+
stockComponent: {}
|
|
562
|
+
},
|
|
563
|
+
setup(__props) {
|
|
564
|
+
const props = __props;
|
|
565
|
+
const PriceImpl = computed(() => props.priceComponent ?? _sfc_main$b);
|
|
566
|
+
const StockImpl = computed(() => props.stockComponent ?? _sfc_main$9);
|
|
567
|
+
const titleLinkable = computed(() => {
|
|
568
|
+
return props.titleLinkable !== void 0 ? props.titleLinkable : true;
|
|
569
|
+
});
|
|
570
|
+
const showImage = computed(() => {
|
|
571
|
+
if (props.isChildItem) return false;
|
|
572
|
+
return props.showImage !== void 0 ? props.showImage : true;
|
|
573
|
+
});
|
|
574
|
+
const showSku = computed(() => {
|
|
575
|
+
if (props.isChildItem) return false;
|
|
576
|
+
return props.showSku !== void 0 ? props.showSku : true;
|
|
577
|
+
});
|
|
578
|
+
const showQuantity = computed(() => {
|
|
579
|
+
return props.showQuantity !== void 0 ? props.showQuantity : true;
|
|
580
|
+
});
|
|
581
|
+
const showPrice = computed(() => {
|
|
582
|
+
return props.showPrice !== void 0 ? props.showPrice : true;
|
|
583
|
+
});
|
|
584
|
+
const showDiscount = computed(() => {
|
|
585
|
+
return props.showDiscount !== void 0 ? props.showDiscount : false;
|
|
586
|
+
});
|
|
587
|
+
const showStockComponent = computed(() => {
|
|
588
|
+
return props.showStockComponent !== void 0 ? props.showStockComponent : false;
|
|
589
|
+
});
|
|
590
|
+
const showItemNotes = computed(() => {
|
|
591
|
+
return props.showItemNotes !== void 0 ? props.showItemNotes : false;
|
|
592
|
+
});
|
|
593
|
+
const isChildItem = computed(() => {
|
|
594
|
+
return props.isChildItem || false;
|
|
595
|
+
});
|
|
596
|
+
const productName = computed(() => {
|
|
597
|
+
const item = props.orderItem;
|
|
598
|
+
return item?.product?.names?.[0]?.value || item?.name || "Unknown Product";
|
|
599
|
+
});
|
|
600
|
+
const productSku = computed(() => {
|
|
601
|
+
return props.orderItem?.product?.sku || props.orderItem?.sku || "";
|
|
602
|
+
});
|
|
603
|
+
const productImage = computed(() => {
|
|
604
|
+
return props.orderItem?.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "";
|
|
605
|
+
});
|
|
606
|
+
const productId = computed(() => {
|
|
607
|
+
return props.orderItem?.product?.productId;
|
|
608
|
+
});
|
|
609
|
+
const productSlug = computed(() => {
|
|
610
|
+
return props.orderItem?.product?.slugs?.[0]?.value || "";
|
|
611
|
+
});
|
|
612
|
+
const clusterUrl = computed(() => {
|
|
613
|
+
const cluster = props.orderItem?.product?.cluster;
|
|
614
|
+
if (!cluster) return "";
|
|
615
|
+
const id = cluster.clusterId ?? cluster.urlId;
|
|
616
|
+
const slug = cluster.slugs?.[0]?.value || cluster.slug?.[0]?.value || "";
|
|
617
|
+
if (!id || !slug) return "";
|
|
618
|
+
return "/cluster/" + id + "/" + slug;
|
|
619
|
+
});
|
|
620
|
+
const productUrl = computed(() => {
|
|
621
|
+
if (clusterUrl.value) return clusterUrl.value;
|
|
622
|
+
if (productId.value && productSlug.value) {
|
|
623
|
+
return "/product/" + productId.value + "/" + productSlug.value;
|
|
624
|
+
}
|
|
625
|
+
return "";
|
|
626
|
+
});
|
|
627
|
+
const quantity = computed(() => {
|
|
628
|
+
return props.orderItem?.quantity || 0;
|
|
629
|
+
});
|
|
630
|
+
computed(() => {
|
|
631
|
+
return props.orderItem?.price || 0;
|
|
632
|
+
});
|
|
633
|
+
const priceTotal = computed(() => {
|
|
634
|
+
return props.orderItem?.priceTotal || 0;
|
|
635
|
+
});
|
|
636
|
+
const discount = computed(() => {
|
|
637
|
+
return props.orderItem?.discount || 0;
|
|
638
|
+
});
|
|
639
|
+
const originalPrice = computed(() => {
|
|
640
|
+
return props.orderItem?.originalPrice || 0;
|
|
641
|
+
});
|
|
642
|
+
const discountPercentage = computed(() => {
|
|
643
|
+
if (originalPrice.value > 0 && discount.value > 0) {
|
|
644
|
+
return discount.value / originalPrice.value * 100;
|
|
645
|
+
}
|
|
646
|
+
return 0;
|
|
647
|
+
});
|
|
648
|
+
const notes = computed(() => {
|
|
649
|
+
return props.orderItem?.notes || "";
|
|
650
|
+
});
|
|
651
|
+
const hasChildren = computed(() => {
|
|
652
|
+
return (props.childItems || []).length > 0;
|
|
653
|
+
});
|
|
654
|
+
function getLabel$1(key, fallback) {
|
|
655
|
+
return getLabel(props.labels, key, fallback);
|
|
656
|
+
}
|
|
657
|
+
function formatItemPrice(price2) {
|
|
658
|
+
if (props.formatPrice) {
|
|
659
|
+
return props.formatPrice(price2);
|
|
660
|
+
}
|
|
661
|
+
if (!price2 && price2 !== 0) return "-";
|
|
662
|
+
return formatPrice(price2, { symbol: props.currency ?? "€" });
|
|
663
|
+
}
|
|
664
|
+
function formatDiscountDisplay() {
|
|
665
|
+
const discountStr = formatItemPrice(discount.value);
|
|
666
|
+
if (discountPercentage.value > 0) {
|
|
667
|
+
return discountStr + " (" + discountPercentage.value.toFixed(2).replace(".", ",") + "%)";
|
|
668
|
+
}
|
|
669
|
+
return discountStr;
|
|
670
|
+
}
|
|
671
|
+
return (_ctx, _cache) => {
|
|
672
|
+
return openBlock(), createElementBlock("tbody", _hoisted_1$6, [
|
|
673
|
+
createElementVNode("tr", {
|
|
674
|
+
class: normalizeClass(`propeller-order-item-card__row ${isChildItem.value ? "border-0" : "hover:bg-surface-hover transition"}`),
|
|
675
|
+
"data-child": isChildItem.value ? "true" : "false"
|
|
676
|
+
}, [
|
|
677
|
+
createElementVNode("td", {
|
|
678
|
+
class: normalizeClass(`propeller-order-item-card__cell propeller-order-item-card__cell--product ${isChildItem.value ? "px-6 py-2 pl-28" : "px-6 py-4"}`)
|
|
679
|
+
}, [
|
|
680
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
681
|
+
showImage.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
682
|
+
productImage.value ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
|
|
683
|
+
createElementVNode("img", {
|
|
684
|
+
class: "propeller-order-item-card__image object-cover w-full h-full",
|
|
685
|
+
src: productImage.value,
|
|
686
|
+
alt: productName.value
|
|
687
|
+
}, null, 8, _hoisted_5$5)
|
|
688
|
+
])) : createCommentVNode("", true),
|
|
689
|
+
!productImage.value ? (openBlock(), createElementBlock("div", _hoisted_6$4, toDisplayString(getLabel$1("noImage", "No Img")), 1)) : createCommentVNode("", true)
|
|
690
|
+
], 64)) : createCommentVNode("", true),
|
|
691
|
+
createElementVNode("div", null, [
|
|
692
|
+
titleLinkable.value && productUrl.value && !isChildItem.value ? (openBlock(), createElementBlock("a", {
|
|
693
|
+
key: 0,
|
|
694
|
+
class: "propeller-order-item-card__title font-medium text-foreground hover:text-primary hover:underline",
|
|
695
|
+
href: productUrl.value
|
|
696
|
+
}, toDisplayString(productName.value), 9, _hoisted_7$4)) : createCommentVNode("", true),
|
|
697
|
+
!titleLinkable.value || !productUrl.value || isChildItem.value ? (openBlock(), createElementBlock("span", {
|
|
698
|
+
key: 1,
|
|
699
|
+
class: normalizeClass(`propeller-order-item-card__title ${isChildItem.value ? "text-sm text-muted-foreground" : "font-medium"}`)
|
|
700
|
+
}, toDisplayString(productName.value), 3)) : createCommentVNode("", true),
|
|
701
|
+
showSku.value && productSku.value ? (openBlock(), createElementBlock("p", _hoisted_8$4, " SKU: " + toDisplayString(productSku.value), 1)) : createCommentVNode("", true),
|
|
702
|
+
showItemNotes.value && notes.value ? (openBlock(), createElementBlock("p", _hoisted_9$3, toDisplayString(notes.value), 1)) : createCommentVNode("", true),
|
|
703
|
+
showStockComponent.value !== false && __props.orderItem?.product?.inventory ? (openBlock(), createBlock(resolveDynamicComponent(StockImpl.value), {
|
|
704
|
+
key: 4,
|
|
705
|
+
inventory: __props.orderItem.product.inventory,
|
|
706
|
+
"show-stock": true,
|
|
707
|
+
"show-availability": true,
|
|
708
|
+
labels: __props.labels
|
|
709
|
+
}, null, 8, ["inventory", "labels"])) : createCommentVNode("", true)
|
|
710
|
+
])
|
|
711
|
+
])
|
|
712
|
+
], 2),
|
|
713
|
+
showQuantity.value ? (openBlock(), createElementBlock("td", {
|
|
714
|
+
key: 0,
|
|
715
|
+
class: normalizeClass(
|
|
716
|
+
isChildItem.value ? "propeller-order-item-card__cell propeller-order-item-card__cell--quantity px-6 py-2 text-center text-sm text-muted-foreground" : "propeller-order-item-card__cell propeller-order-item-card__cell--quantity px-6 py-4 text-center"
|
|
717
|
+
)
|
|
718
|
+
}, toDisplayString(quantity.value), 3)) : createCommentVNode("", true),
|
|
719
|
+
showDiscount.value ? (openBlock(), createElementBlock("td", {
|
|
720
|
+
key: 1,
|
|
721
|
+
class: normalizeClass(
|
|
722
|
+
isChildItem.value ? "propeller-order-item-card__cell propeller-order-item-card__cell--discount px-6 py-2 text-right text-sm text-muted-foreground" : "propeller-order-item-card__cell propeller-order-item-card__cell--discount px-6 py-4 text-right whitespace-nowrap text-orange-600"
|
|
723
|
+
)
|
|
724
|
+
}, [
|
|
725
|
+
discount.value > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
726
|
+
createTextVNode(toDisplayString(formatDiscountDisplay()), 1)
|
|
727
|
+
], 64)) : createCommentVNode("", true)
|
|
728
|
+
], 2)) : createCommentVNode("", true),
|
|
729
|
+
showPrice.value ? (openBlock(), createElementBlock("td", {
|
|
730
|
+
key: 2,
|
|
731
|
+
class: normalizeClass(
|
|
732
|
+
isChildItem.value ? "propeller-order-item-card__cell propeller-order-item-card__cell--price px-6 py-2 text-right whitespace-nowrap text-sm text-muted-foreground" : "propeller-order-item-card__cell propeller-order-item-card__cell--price px-6 py-4 text-right whitespace-nowrap"
|
|
733
|
+
)
|
|
734
|
+
}, [
|
|
735
|
+
props.priceComponent ? (openBlock(), createBlock(resolveDynamicComponent(PriceImpl.value), {
|
|
736
|
+
key: 0,
|
|
737
|
+
price: __props.orderItem?.product?.price,
|
|
738
|
+
currency: __props.currency,
|
|
739
|
+
labels: __props.labels
|
|
740
|
+
}, null, 8, ["price", "currency", "labels"])) : (openBlock(), createElementBlock("span", _hoisted_10$3, toDisplayString(formatItemPrice(priceTotal.value)), 1))
|
|
741
|
+
], 2)) : createCommentVNode("", true)
|
|
742
|
+
], 10, _hoisted_2$5),
|
|
743
|
+
hasChildren.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.childItems || [], (child, index) => {
|
|
744
|
+
return openBlock(), createElementBlock("tr", {
|
|
745
|
+
key: child.id || child.uuid,
|
|
746
|
+
class: "propeller-order-item-card__child-row border-0",
|
|
747
|
+
"data-child": "true"
|
|
748
|
+
}, [
|
|
749
|
+
createElementVNode("td", _hoisted_11$3, [
|
|
750
|
+
createElementVNode("span", _hoisted_12$2, toDisplayString(child.product?.names?.[0]?.value || child.name || "Unknown"), 1)
|
|
751
|
+
]),
|
|
752
|
+
showQuantity.value ? (openBlock(), createElementBlock("td", _hoisted_13$2, toDisplayString(child.quantity || 0), 1)) : createCommentVNode("", true),
|
|
753
|
+
showDiscount.value ? (openBlock(), createElementBlock("td", _hoisted_14$2)) : createCommentVNode("", true),
|
|
754
|
+
showPrice.value ? (openBlock(), createElementBlock("td", _hoisted_15$2, toDisplayString(formatItemPrice(child.priceTotal || 0)), 1)) : createCommentVNode("", true)
|
|
755
|
+
]);
|
|
756
|
+
}), 128)) : createCommentVNode("", true)
|
|
757
|
+
]);
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
const _hoisted_1$5 = {
|
|
762
|
+
key: 0,
|
|
763
|
+
class: "propeller-order-summary__title text-xl font-bold mb-4"
|
|
764
|
+
};
|
|
765
|
+
const _hoisted_2$4 = { class: "propeller-order-summary__meta grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 pb-5 border-b border-border mb-5" };
|
|
766
|
+
const _hoisted_3$4 = {
|
|
767
|
+
key: 0,
|
|
768
|
+
class: "propeller-order-summary__meta-item",
|
|
769
|
+
"data-meta": "order-number"
|
|
770
|
+
};
|
|
771
|
+
const _hoisted_4$4 = { class: "propeller-order-summary__meta-label text-sm text-muted-foreground mb-1" };
|
|
772
|
+
const _hoisted_5$4 = { class: "propeller-order-summary__meta-value font-semibold" };
|
|
773
|
+
const _hoisted_6$3 = {
|
|
774
|
+
key: 1,
|
|
775
|
+
class: "propeller-order-summary__meta-item",
|
|
776
|
+
"data-meta": "order-date"
|
|
777
|
+
};
|
|
778
|
+
const _hoisted_7$3 = { class: "propeller-order-summary__meta-label text-sm text-muted-foreground mb-1" };
|
|
779
|
+
const _hoisted_8$3 = { class: "propeller-order-summary__meta-value font-semibold" };
|
|
780
|
+
const _hoisted_9$2 = {
|
|
781
|
+
key: 2,
|
|
782
|
+
class: "propeller-order-summary__meta-item",
|
|
783
|
+
"data-meta": "status"
|
|
784
|
+
};
|
|
785
|
+
const _hoisted_10$2 = { class: "propeller-order-summary__meta-label text-sm text-muted-foreground mb-1" };
|
|
786
|
+
const _hoisted_11$2 = { class: "propeller-order-summary__status inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-secondary/10 text-secondary" };
|
|
787
|
+
const _hoisted_12$1 = {
|
|
788
|
+
key: 3,
|
|
789
|
+
class: "propeller-order-summary__meta-item",
|
|
790
|
+
"data-meta": "total"
|
|
791
|
+
};
|
|
792
|
+
const _hoisted_13$1 = { class: "propeller-order-summary__meta-label text-sm text-muted-foreground mb-1" };
|
|
793
|
+
const _hoisted_14$1 = { class: "propeller-order-summary__total font-bold text-lg" };
|
|
794
|
+
const _hoisted_15$1 = { class: "propeller-order-summary__addresses grid grid-cols-1 md:grid-cols-2 gap-6 pb-5" };
|
|
795
|
+
const _hoisted_16$1 = {
|
|
796
|
+
key: 0,
|
|
797
|
+
class: "propeller-order-summary__address space-y-2",
|
|
798
|
+
"data-address": "invoice"
|
|
799
|
+
};
|
|
800
|
+
const _hoisted_17$1 = { class: "propeller-order-summary__address-title text-sm font-semibold text-muted-foreground uppercase tracking-wide" };
|
|
801
|
+
const _hoisted_18$1 = {
|
|
802
|
+
key: 0,
|
|
803
|
+
class: "text-sm space-y-1"
|
|
804
|
+
};
|
|
805
|
+
const _hoisted_19$1 = {
|
|
806
|
+
key: 0,
|
|
807
|
+
class: "font-medium"
|
|
808
|
+
};
|
|
809
|
+
const _hoisted_20$1 = { key: 1 };
|
|
810
|
+
const _hoisted_21$1 = {
|
|
811
|
+
key: 2,
|
|
812
|
+
class: "propeller-order-summary__address-email text-muted-foreground"
|
|
813
|
+
};
|
|
814
|
+
const _hoisted_22$1 = {
|
|
815
|
+
key: 1,
|
|
816
|
+
class: "propeller-order-summary__address space-y-2",
|
|
817
|
+
"data-address": "delivery"
|
|
818
|
+
};
|
|
819
|
+
const _hoisted_23$1 = { class: "propeller-order-summary__address-title text-sm font-semibold text-muted-foreground uppercase tracking-wide" };
|
|
820
|
+
const _hoisted_24$1 = {
|
|
821
|
+
key: 0,
|
|
822
|
+
class: "text-sm space-y-1"
|
|
823
|
+
};
|
|
824
|
+
const _hoisted_25$1 = {
|
|
825
|
+
key: 0,
|
|
826
|
+
class: "font-medium"
|
|
827
|
+
};
|
|
828
|
+
const _hoisted_26$1 = { key: 1 };
|
|
829
|
+
const _hoisted_27$1 = {
|
|
830
|
+
key: 2,
|
|
831
|
+
class: "propeller-order-summary__address-email text-muted-foreground"
|
|
832
|
+
};
|
|
833
|
+
const _hoisted_28 = {
|
|
834
|
+
key: 1,
|
|
835
|
+
class: "propeller-order-summary__info-panel bg-surface-hover p-4 rounded-[var(--radius-control)] border border-border space-y-2 text-sm"
|
|
836
|
+
};
|
|
837
|
+
const _hoisted_29 = {
|
|
838
|
+
key: 0,
|
|
839
|
+
class: "flex justify-between"
|
|
840
|
+
};
|
|
841
|
+
const _hoisted_30 = { class: "font-medium" };
|
|
842
|
+
const _hoisted_31 = {
|
|
843
|
+
key: 1,
|
|
844
|
+
class: "flex justify-between"
|
|
845
|
+
};
|
|
846
|
+
const _hoisted_32 = { class: "font-medium" };
|
|
847
|
+
const _hoisted_33 = {
|
|
848
|
+
key: 2,
|
|
849
|
+
class: "flex justify-between"
|
|
850
|
+
};
|
|
851
|
+
const _hoisted_34 = { class: "font-medium" };
|
|
852
|
+
const _hoisted_35 = {
|
|
853
|
+
key: 2,
|
|
854
|
+
class: "propeller-order-summary__remarks-panel bg-surface-hover p-4 rounded-[var(--radius-control)] border border-border space-y-2 text-sm mt-4"
|
|
855
|
+
};
|
|
856
|
+
const _hoisted_36 = {
|
|
857
|
+
key: 0,
|
|
858
|
+
class: "flex justify-between"
|
|
859
|
+
};
|
|
860
|
+
const _hoisted_37 = { class: "font-medium" };
|
|
861
|
+
const _hoisted_38 = {
|
|
862
|
+
key: 1,
|
|
863
|
+
class: "flex justify-between"
|
|
864
|
+
};
|
|
865
|
+
const _hoisted_39 = { class: "font-medium" };
|
|
866
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
867
|
+
__name: "OrderSummary",
|
|
868
|
+
props: {
|
|
869
|
+
order: {},
|
|
870
|
+
currency: {},
|
|
871
|
+
orderSummaryContainerClass: {},
|
|
872
|
+
title: {},
|
|
873
|
+
showOrderNumber: { type: Boolean, default: true },
|
|
874
|
+
showOrderDate: { type: Boolean, default: true },
|
|
875
|
+
showOrderStatus: { type: Boolean, default: true },
|
|
876
|
+
showOrderTotal: { type: Boolean, default: true },
|
|
877
|
+
formatPrice: {},
|
|
878
|
+
showInvoiceAddress: { type: Boolean, default: true },
|
|
879
|
+
showDeliveryAddress: { type: Boolean, default: true },
|
|
880
|
+
showDeliveryInfo: { type: Boolean, default: true },
|
|
881
|
+
showRemarks: { type: Boolean, default: true },
|
|
882
|
+
formatDate: {},
|
|
883
|
+
labels: {},
|
|
884
|
+
countries: {}
|
|
885
|
+
},
|
|
886
|
+
setup(__props) {
|
|
887
|
+
const props = __props;
|
|
888
|
+
const infra = useInfraProps(props);
|
|
889
|
+
const containerClass = computed(() => {
|
|
890
|
+
return props.orderSummaryContainerClass || "order-summary";
|
|
891
|
+
});
|
|
892
|
+
const showOrderNumber = computed(() => {
|
|
893
|
+
return props.showOrderNumber !== void 0 ? props.showOrderNumber : true;
|
|
894
|
+
});
|
|
895
|
+
const showOrderDate = computed(() => {
|
|
896
|
+
return props.showOrderDate !== void 0 ? props.showOrderDate : true;
|
|
897
|
+
});
|
|
898
|
+
const showOrderStatus = computed(() => {
|
|
899
|
+
return props.showOrderStatus !== void 0 ? props.showOrderStatus : true;
|
|
900
|
+
});
|
|
901
|
+
const showInvoiceAddress = computed(() => {
|
|
902
|
+
return props.showInvoiceAddress !== void 0 ? props.showInvoiceAddress : true;
|
|
903
|
+
});
|
|
904
|
+
const showDeliveryAddress = computed(() => {
|
|
905
|
+
return props.showDeliveryAddress !== void 0 ? props.showDeliveryAddress : true;
|
|
906
|
+
});
|
|
907
|
+
const showOrderTotal = computed(() => {
|
|
908
|
+
return props.showOrderTotal !== void 0 ? props.showOrderTotal : true;
|
|
909
|
+
});
|
|
910
|
+
const showDeliveryInfo = computed(() => {
|
|
911
|
+
return props.showDeliveryInfo !== void 0 ? props.showDeliveryInfo : true;
|
|
912
|
+
});
|
|
913
|
+
const showRemarks = computed(() => {
|
|
914
|
+
return props.showRemarks !== void 0 ? props.showRemarks : true;
|
|
915
|
+
});
|
|
916
|
+
const orderReference = computed(() => {
|
|
917
|
+
return props.order?.reference || "";
|
|
918
|
+
});
|
|
919
|
+
const orderRemarks = computed(() => {
|
|
920
|
+
return props.order?.remarks || "";
|
|
921
|
+
});
|
|
922
|
+
const orderNumber = computed(() => {
|
|
923
|
+
return props.order?.id || "";
|
|
924
|
+
});
|
|
925
|
+
const orderDate = computed(() => {
|
|
926
|
+
return props.order?.createdAt || "";
|
|
927
|
+
});
|
|
928
|
+
const orderStatus = computed(() => {
|
|
929
|
+
return props.order?.status || "";
|
|
930
|
+
});
|
|
931
|
+
const orderTotal = computed(() => {
|
|
932
|
+
return Number(props.order?.total?.net || 0);
|
|
933
|
+
});
|
|
934
|
+
const invoiceAddress = computed(() => {
|
|
935
|
+
const addresses = props.order?.addresses || [];
|
|
936
|
+
return addresses.find((a) => a.type === "invoice") || null;
|
|
937
|
+
});
|
|
938
|
+
const deliveryAddress = computed(() => {
|
|
939
|
+
const addresses = props.order?.addresses || [];
|
|
940
|
+
return addresses.find((a) => a.type === "delivery") || null;
|
|
941
|
+
});
|
|
942
|
+
const paymentMethod = computed(() => {
|
|
943
|
+
return props.order?.paymentData?.method || "";
|
|
944
|
+
});
|
|
945
|
+
const carrierName = computed(() => {
|
|
946
|
+
return props.order?.postageData?.carrier || "";
|
|
947
|
+
});
|
|
948
|
+
const requestDate = computed(() => {
|
|
949
|
+
const date = props.order?.postageData?.requestDate;
|
|
950
|
+
if (!date) return "";
|
|
951
|
+
if (props.formatDate) {
|
|
952
|
+
return props.formatDate(date);
|
|
953
|
+
}
|
|
954
|
+
try {
|
|
955
|
+
return new Date(date).toLocaleDateString("en-US");
|
|
956
|
+
} catch {
|
|
957
|
+
return date;
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
function formatItemPrice(price) {
|
|
961
|
+
if (props.formatPrice) {
|
|
962
|
+
return props.formatPrice(price);
|
|
963
|
+
}
|
|
964
|
+
return formatPrice(price || 0, { symbol: infra.currency ?? "€" });
|
|
965
|
+
}
|
|
966
|
+
function getLabel$1(key, fallback) {
|
|
967
|
+
return getLabel(props.labels, key, fallback);
|
|
968
|
+
}
|
|
969
|
+
function getCountryName$1(code) {
|
|
970
|
+
return getCountryName(code, props.countries);
|
|
971
|
+
}
|
|
972
|
+
function formatOrderDate(dateString) {
|
|
973
|
+
if (props.formatDate) {
|
|
974
|
+
return props.formatDate(dateString);
|
|
975
|
+
}
|
|
976
|
+
try {
|
|
977
|
+
return new Date(dateString).toLocaleDateString("en-US");
|
|
978
|
+
} catch {
|
|
979
|
+
return dateString;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
return (_ctx, _cache) => {
|
|
983
|
+
return openBlock(), createElementBlock("div", {
|
|
984
|
+
class: normalizeClass(`propeller-order-summary ${containerClass.value}`)
|
|
985
|
+
}, [
|
|
986
|
+
__props.title ? (openBlock(), createElementBlock("h2", _hoisted_1$5, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
987
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
988
|
+
showOrderNumber.value && orderNumber.value ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
|
|
989
|
+
createElementVNode("p", _hoisted_4$4, toDisplayString(getLabel$1("orderNumber", "Order Number")), 1),
|
|
990
|
+
createElementVNode("p", _hoisted_5$4, toDisplayString(orderNumber.value), 1)
|
|
991
|
+
])) : createCommentVNode("", true),
|
|
992
|
+
showOrderDate.value && orderDate.value ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
|
|
993
|
+
createElementVNode("p", _hoisted_7$3, toDisplayString(getLabel$1("orderDate", "Order Date")), 1),
|
|
994
|
+
createElementVNode("p", _hoisted_8$3, toDisplayString(formatOrderDate(orderDate.value)), 1)
|
|
995
|
+
])) : createCommentVNode("", true),
|
|
996
|
+
showOrderStatus.value && orderStatus.value ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
|
|
997
|
+
createElementVNode("p", _hoisted_10$2, toDisplayString(getLabel$1("status", "Status")), 1),
|
|
998
|
+
createElementVNode("span", _hoisted_11$2, toDisplayString(orderStatus.value), 1)
|
|
999
|
+
])) : createCommentVNode("", true),
|
|
1000
|
+
showOrderTotal.value ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
|
|
1001
|
+
createElementVNode("p", _hoisted_13$1, toDisplayString(getLabel$1("total", "Total")), 1),
|
|
1002
|
+
createElementVNode("p", _hoisted_14$1, toDisplayString(formatItemPrice(orderTotal.value)), 1)
|
|
1003
|
+
])) : createCommentVNode("", true)
|
|
1004
|
+
]),
|
|
1005
|
+
createElementVNode("div", _hoisted_15$1, [
|
|
1006
|
+
showInvoiceAddress.value ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
|
|
1007
|
+
createElementVNode("h3", _hoisted_17$1, toDisplayString(getLabel$1("invoiceAddress", "Invoice Address")), 1),
|
|
1008
|
+
invoiceAddress.value && invoiceAddress.value.street ? (openBlock(), createElementBlock("div", _hoisted_18$1, [
|
|
1009
|
+
invoiceAddress.value.company ? (openBlock(), createElementBlock("p", _hoisted_19$1, toDisplayString(invoiceAddress.value.company), 1)) : createCommentVNode("", true),
|
|
1010
|
+
createElementVNode("p", null, toDisplayString([
|
|
1011
|
+
invoiceAddress.value.firstName,
|
|
1012
|
+
invoiceAddress.value.middleName,
|
|
1013
|
+
invoiceAddress.value.lastName
|
|
1014
|
+
].filter(Boolean).join(" ")), 1),
|
|
1015
|
+
createElementVNode("p", null, toDisplayString([
|
|
1016
|
+
invoiceAddress.value.street,
|
|
1017
|
+
invoiceAddress.value.number,
|
|
1018
|
+
invoiceAddress.value.numberExtension
|
|
1019
|
+
].filter(Boolean).join(" ")), 1),
|
|
1020
|
+
createElementVNode("p", null, toDisplayString([invoiceAddress.value.postalCode, invoiceAddress.value.city].filter(Boolean).join(" ")), 1),
|
|
1021
|
+
invoiceAddress.value.country ? (openBlock(), createElementBlock("p", _hoisted_20$1, toDisplayString(getCountryName$1(invoiceAddress.value.country)), 1)) : createCommentVNode("", true),
|
|
1022
|
+
invoiceAddress.value.email ? (openBlock(), createElementBlock("p", _hoisted_21$1, toDisplayString(invoiceAddress.value.email), 1)) : createCommentVNode("", true)
|
|
1023
|
+
])) : createCommentVNode("", true)
|
|
1024
|
+
])) : createCommentVNode("", true),
|
|
1025
|
+
showDeliveryAddress.value ? (openBlock(), createElementBlock("div", _hoisted_22$1, [
|
|
1026
|
+
createElementVNode("h3", _hoisted_23$1, toDisplayString(getLabel$1("deliveryAddress", "Delivery Address")), 1),
|
|
1027
|
+
deliveryAddress.value && deliveryAddress.value.street ? (openBlock(), createElementBlock("div", _hoisted_24$1, [
|
|
1028
|
+
deliveryAddress.value.company ? (openBlock(), createElementBlock("p", _hoisted_25$1, toDisplayString(deliveryAddress.value.company), 1)) : createCommentVNode("", true),
|
|
1029
|
+
createElementVNode("p", null, toDisplayString([
|
|
1030
|
+
deliveryAddress.value.firstName,
|
|
1031
|
+
deliveryAddress.value.middleName,
|
|
1032
|
+
deliveryAddress.value.lastName
|
|
1033
|
+
].filter(Boolean).join(" ")), 1),
|
|
1034
|
+
createElementVNode("p", null, toDisplayString([
|
|
1035
|
+
deliveryAddress.value.street,
|
|
1036
|
+
deliveryAddress.value.number,
|
|
1037
|
+
deliveryAddress.value.numberExtension
|
|
1038
|
+
].filter(Boolean).join(" ")), 1),
|
|
1039
|
+
createElementVNode("p", null, toDisplayString([deliveryAddress.value.postalCode, deliveryAddress.value.city].filter(Boolean).join(" ")), 1),
|
|
1040
|
+
deliveryAddress.value.country ? (openBlock(), createElementBlock("p", _hoisted_26$1, toDisplayString(getCountryName$1(deliveryAddress.value.country)), 1)) : createCommentVNode("", true),
|
|
1041
|
+
deliveryAddress.value.email ? (openBlock(), createElementBlock("p", _hoisted_27$1, toDisplayString(deliveryAddress.value.email), 1)) : createCommentVNode("", true)
|
|
1042
|
+
])) : createCommentVNode("", true)
|
|
1043
|
+
])) : createCommentVNode("", true)
|
|
1044
|
+
]),
|
|
1045
|
+
showDeliveryInfo.value && (paymentMethod.value || carrierName.value || requestDate.value) ? (openBlock(), createElementBlock("div", _hoisted_28, [
|
|
1046
|
+
paymentMethod.value ? (openBlock(), createElementBlock("div", _hoisted_29, [
|
|
1047
|
+
createElementVNode("span", _hoisted_30, toDisplayString(getLabel$1("payment", "Payment:")), 1),
|
|
1048
|
+
createElementVNode("span", null, toDisplayString(paymentMethod.value), 1)
|
|
1049
|
+
])) : createCommentVNode("", true),
|
|
1050
|
+
carrierName.value ? (openBlock(), createElementBlock("div", _hoisted_31, [
|
|
1051
|
+
createElementVNode("span", _hoisted_32, toDisplayString(getLabel$1("carrier", "Carrier:")), 1),
|
|
1052
|
+
createElementVNode("span", null, toDisplayString(carrierName.value), 1)
|
|
1053
|
+
])) : createCommentVNode("", true),
|
|
1054
|
+
requestDate.value ? (openBlock(), createElementBlock("div", _hoisted_33, [
|
|
1055
|
+
createElementVNode("span", _hoisted_34, toDisplayString(getLabel$1("deliveryDate", "Delivery Date:")), 1),
|
|
1056
|
+
createElementVNode("span", null, toDisplayString(requestDate.value), 1)
|
|
1057
|
+
])) : createCommentVNode("", true)
|
|
1058
|
+
])) : createCommentVNode("", true),
|
|
1059
|
+
showRemarks.value && (orderReference.value || orderRemarks.value) ? (openBlock(), createElementBlock("div", _hoisted_35, [
|
|
1060
|
+
orderReference.value ? (openBlock(), createElementBlock("div", _hoisted_36, [
|
|
1061
|
+
createElementVNode("span", _hoisted_37, toDisplayString(getLabel$1("reference", "Reference:")), 1),
|
|
1062
|
+
createElementVNode("span", null, toDisplayString(orderReference.value), 1)
|
|
1063
|
+
])) : createCommentVNode("", true),
|
|
1064
|
+
orderRemarks.value ? (openBlock(), createElementBlock("div", _hoisted_38, [
|
|
1065
|
+
createElementVNode("span", _hoisted_39, toDisplayString(getLabel$1("remarks", "Remarks:")), 1),
|
|
1066
|
+
createElementVNode("span", null, toDisplayString(orderRemarks.value), 1)
|
|
1067
|
+
])) : createCommentVNode("", true)
|
|
1068
|
+
])) : createCommentVNode("", true)
|
|
1069
|
+
], 2);
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
});
|
|
1073
|
+
const _hoisted_1$4 = { class: "propeller-order-totals w-full md:w-80 bg-card p-6 rounded-[var(--radius-container)] shadow space-y-3" };
|
|
1074
|
+
const _hoisted_2$3 = {
|
|
1075
|
+
key: 0,
|
|
1076
|
+
class: "propeller-order-totals__row flex justify-between text-muted-foreground",
|
|
1077
|
+
"data-row": "subtotal"
|
|
1078
|
+
};
|
|
1079
|
+
const _hoisted_3$3 = { class: "propeller-order-totals__label" };
|
|
1080
|
+
const _hoisted_4$3 = { class: "propeller-order-totals__value" };
|
|
1081
|
+
const _hoisted_5$3 = {
|
|
1082
|
+
class: "propeller-order-totals__row flex justify-between text-secondary",
|
|
1083
|
+
"data-row": "discount"
|
|
1084
|
+
};
|
|
1085
|
+
const _hoisted_6$2 = { class: "propeller-order-totals__label" };
|
|
1086
|
+
const _hoisted_7$2 = { class: "propeller-order-totals__value" };
|
|
1087
|
+
const _hoisted_8$2 = {
|
|
1088
|
+
class: "propeller-order-totals__row flex justify-between text-muted-foreground border-t pt-2 border-dashed",
|
|
1089
|
+
"data-row": "subtotal-with-discount"
|
|
1090
|
+
};
|
|
1091
|
+
const _hoisted_9$1 = { class: "propeller-order-totals__label" };
|
|
1092
|
+
const _hoisted_10$1 = { class: "propeller-order-totals__value" };
|
|
1093
|
+
const _hoisted_11$1 = {
|
|
1094
|
+
key: 2,
|
|
1095
|
+
class: "propeller-order-totals__row flex justify-between text-muted-foreground",
|
|
1096
|
+
"data-row": "transaction-costs"
|
|
1097
|
+
};
|
|
1098
|
+
const _hoisted_12 = { class: "propeller-order-totals__label" };
|
|
1099
|
+
const _hoisted_13 = { class: "propeller-order-totals__value" };
|
|
1100
|
+
const _hoisted_14 = {
|
|
1101
|
+
key: 3,
|
|
1102
|
+
class: "propeller-order-totals__row flex justify-between text-muted-foreground",
|
|
1103
|
+
"data-row": "shipping-costs"
|
|
1104
|
+
};
|
|
1105
|
+
const _hoisted_15 = { class: "propeller-order-totals__label" };
|
|
1106
|
+
const _hoisted_16 = { class: "propeller-order-totals__value" };
|
|
1107
|
+
const _hoisted_17 = {
|
|
1108
|
+
key: 4,
|
|
1109
|
+
class: "propeller-order-totals__row flex justify-between text-muted-foreground pt-2 border-t",
|
|
1110
|
+
"data-row": "total-excl-vat"
|
|
1111
|
+
};
|
|
1112
|
+
const _hoisted_18 = { class: "propeller-order-totals__label" };
|
|
1113
|
+
const _hoisted_19 = { class: "propeller-order-totals__value" };
|
|
1114
|
+
const _hoisted_20 = { class: "propeller-order-totals__label" };
|
|
1115
|
+
const _hoisted_21 = { class: "propeller-order-totals__value" };
|
|
1116
|
+
const _hoisted_22 = {
|
|
1117
|
+
key: 6,
|
|
1118
|
+
class: "propeller-order-totals__row flex justify-between text-muted-foreground text-sm",
|
|
1119
|
+
"data-row": "total-vat"
|
|
1120
|
+
};
|
|
1121
|
+
const _hoisted_23 = { class: "propeller-order-totals__label" };
|
|
1122
|
+
const _hoisted_24 = { class: "propeller-order-totals__value" };
|
|
1123
|
+
const _hoisted_25 = {
|
|
1124
|
+
class: "propeller-order-totals__row propeller-order-totals__row--total flex justify-between text-xl font-bold pt-4 border-t text-foreground mt-2",
|
|
1125
|
+
"data-row": "total"
|
|
1126
|
+
};
|
|
1127
|
+
const _hoisted_26 = { class: "propeller-order-totals__label" };
|
|
1128
|
+
const _hoisted_27 = { class: "propeller-order-totals__value" };
|
|
1129
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1130
|
+
__name: "OrderTotals",
|
|
1131
|
+
props: {
|
|
1132
|
+
order: {},
|
|
1133
|
+
currency: {},
|
|
1134
|
+
title: {},
|
|
1135
|
+
labels: {},
|
|
1136
|
+
showSubtotal: { type: Boolean, default: true },
|
|
1137
|
+
showDiscount: { type: Boolean, default: true },
|
|
1138
|
+
showShippingCosts: { type: Boolean, default: true },
|
|
1139
|
+
showVATs: { type: Boolean, default: true },
|
|
1140
|
+
showTotalExclVat: { type: Boolean, default: true },
|
|
1141
|
+
showTotalVat: { type: Boolean, default: true },
|
|
1142
|
+
formatPrice: {}
|
|
1143
|
+
},
|
|
1144
|
+
setup(__props) {
|
|
1145
|
+
const props = __props;
|
|
1146
|
+
const infra = useInfraProps(props);
|
|
1147
|
+
computed(() => {
|
|
1148
|
+
return props.title || "Order summary";
|
|
1149
|
+
});
|
|
1150
|
+
const showSubtotal = computed(() => {
|
|
1151
|
+
return props.showSubtotal !== void 0 ? props.showSubtotal : true;
|
|
1152
|
+
});
|
|
1153
|
+
const showDiscount = computed(() => {
|
|
1154
|
+
return props.showDiscount !== void 0 ? props.showDiscount : true;
|
|
1155
|
+
});
|
|
1156
|
+
const showShippingCosts = computed(() => {
|
|
1157
|
+
return props.showShippingCosts !== void 0 ? props.showShippingCosts : true;
|
|
1158
|
+
});
|
|
1159
|
+
const showVATs = computed(() => {
|
|
1160
|
+
return props.showVATs !== void 0 ? props.showVATs : true;
|
|
1161
|
+
});
|
|
1162
|
+
const showTotalExclVat = computed(() => {
|
|
1163
|
+
return props.showTotalExclVat !== void 0 ? props.showTotalExclVat : true;
|
|
1164
|
+
});
|
|
1165
|
+
const showTotalVat = computed(() => {
|
|
1166
|
+
return props.showTotalVat !== void 0 ? props.showTotalVat : true;
|
|
1167
|
+
});
|
|
1168
|
+
const subtotal = computed(() => {
|
|
1169
|
+
return props.order?.total?.gross || 0;
|
|
1170
|
+
});
|
|
1171
|
+
const hasDiscount = computed(() => {
|
|
1172
|
+
const total = props.order?.total;
|
|
1173
|
+
return total?.discountType && total.discountType !== OrderDiscountType.N && total.discountValue > 0;
|
|
1174
|
+
});
|
|
1175
|
+
const discountDisplay = computed(() => {
|
|
1176
|
+
const total = props.order?.total;
|
|
1177
|
+
if (!total) return "";
|
|
1178
|
+
if (total.discountType === OrderDiscountType.A) {
|
|
1179
|
+
return "-" + formatItemPrice(total.discountValue);
|
|
1180
|
+
}
|
|
1181
|
+
if (total.discountType === OrderDiscountType.P) {
|
|
1182
|
+
return "- " + total.discountValue + "%";
|
|
1183
|
+
}
|
|
1184
|
+
return "-" + formatItemPrice(total.discountValue);
|
|
1185
|
+
});
|
|
1186
|
+
const subtotalWithDiscount = computed(() => {
|
|
1187
|
+
const total = props.order?.total;
|
|
1188
|
+
return (total?.gross || 0) - (total?.discountValue || 0);
|
|
1189
|
+
});
|
|
1190
|
+
const hasTransactionCosts = computed(() => {
|
|
1191
|
+
return props.order?.paymentData?.gross > 0;
|
|
1192
|
+
});
|
|
1193
|
+
const transactionCosts = computed(() => {
|
|
1194
|
+
return Number(props.order?.paymentData?.gross || 0);
|
|
1195
|
+
});
|
|
1196
|
+
const hasShippingCosts = computed(() => {
|
|
1197
|
+
return props.order?.postageData?.gross > 0;
|
|
1198
|
+
});
|
|
1199
|
+
const shippingCosts = computed(() => {
|
|
1200
|
+
return Number(props.order?.postageData?.gross || 0);
|
|
1201
|
+
});
|
|
1202
|
+
const totalExclVat = computed(() => {
|
|
1203
|
+
return props.order?.total?.gross || 0;
|
|
1204
|
+
});
|
|
1205
|
+
const taxPercentages = computed(() => {
|
|
1206
|
+
const taxes = props.order?.total?.taxPercentages || [];
|
|
1207
|
+
return taxes.filter((tax) => tax.percentage > 0 && tax.total > 0);
|
|
1208
|
+
});
|
|
1209
|
+
const totalInclVat = computed(() => {
|
|
1210
|
+
return props.order?.total?.net || 0;
|
|
1211
|
+
});
|
|
1212
|
+
const totalVat = computed(() => {
|
|
1213
|
+
let sum = 0;
|
|
1214
|
+
const taxes = taxPercentages.value;
|
|
1215
|
+
for (let i = 0; i < taxes.length; i++) {
|
|
1216
|
+
sum += Number(taxes[i].total || 0);
|
|
1217
|
+
}
|
|
1218
|
+
return sum;
|
|
1219
|
+
});
|
|
1220
|
+
function getLabel$1(key, fallback) {
|
|
1221
|
+
return getLabel(props.labels, key, fallback);
|
|
1222
|
+
}
|
|
1223
|
+
function formatItemPrice(price) {
|
|
1224
|
+
if (props.formatPrice) {
|
|
1225
|
+
return props.formatPrice(price);
|
|
1226
|
+
}
|
|
1227
|
+
return formatPrice(price || 0, { symbol: infra.currency ?? "€" });
|
|
1228
|
+
}
|
|
1229
|
+
return (_ctx, _cache) => {
|
|
1230
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
1231
|
+
showSubtotal.value ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
1232
|
+
createElementVNode("span", _hoisted_3$3, toDisplayString(getLabel$1("subtotal", "Subtotal:")), 1),
|
|
1233
|
+
createElementVNode("span", _hoisted_4$3, toDisplayString(formatItemPrice(subtotal.value)), 1)
|
|
1234
|
+
])) : createCommentVNode("", true),
|
|
1235
|
+
showDiscount.value && hasDiscount.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1236
|
+
createElementVNode("div", _hoisted_5$3, [
|
|
1237
|
+
createElementVNode("span", _hoisted_6$2, toDisplayString(getLabel$1("discount", "Discount:")), 1),
|
|
1238
|
+
createElementVNode("span", _hoisted_7$2, toDisplayString(discountDisplay.value), 1)
|
|
1239
|
+
]),
|
|
1240
|
+
createElementVNode("div", _hoisted_8$2, [
|
|
1241
|
+
createElementVNode("span", _hoisted_9$1, toDisplayString(getLabel$1("subtotalWithDiscount", "Subtotal with discount:")), 1),
|
|
1242
|
+
createElementVNode("span", _hoisted_10$1, toDisplayString(formatItemPrice(subtotalWithDiscount.value)), 1)
|
|
1243
|
+
])
|
|
1244
|
+
], 64)) : createCommentVNode("", true),
|
|
1245
|
+
hasTransactionCosts.value ? (openBlock(), createElementBlock("div", _hoisted_11$1, [
|
|
1246
|
+
createElementVNode("span", _hoisted_12, toDisplayString(getLabel$1("transactionCosts", "Transaction costs:")), 1),
|
|
1247
|
+
createElementVNode("span", _hoisted_13, toDisplayString(formatItemPrice(transactionCosts.value)), 1)
|
|
1248
|
+
])) : createCommentVNode("", true),
|
|
1249
|
+
showShippingCosts.value && hasShippingCosts.value ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
1250
|
+
createElementVNode("span", _hoisted_15, toDisplayString(getLabel$1("shippingCosts", "Shipping costs:")), 1),
|
|
1251
|
+
createElementVNode("span", _hoisted_16, toDisplayString(formatItemPrice(shippingCosts.value)), 1)
|
|
1252
|
+
])) : createCommentVNode("", true),
|
|
1253
|
+
showTotalExclVat.value ? (openBlock(), createElementBlock("div", _hoisted_17, [
|
|
1254
|
+
createElementVNode("span", _hoisted_18, toDisplayString(getLabel$1("totalExclVat", "Total excl. VAT:")), 1),
|
|
1255
|
+
createElementVNode("span", _hoisted_19, toDisplayString(formatItemPrice(totalExclVat.value)), 1)
|
|
1256
|
+
])) : createCommentVNode("", true),
|
|
1257
|
+
showVATs.value && taxPercentages.value.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 5 }, renderList(taxPercentages.value, (tax, index) => {
|
|
1258
|
+
return openBlock(), createElementBlock("div", {
|
|
1259
|
+
key: index,
|
|
1260
|
+
class: "propeller-order-totals__row flex justify-between text-muted-foreground text-sm",
|
|
1261
|
+
"data-row": "vat-line"
|
|
1262
|
+
}, [
|
|
1263
|
+
createElementVNode("span", _hoisted_20, toDisplayString(tax.percentage) + "% " + toDisplayString(getLabel$1("vat", "VAT")) + ":", 1),
|
|
1264
|
+
createElementVNode("span", _hoisted_21, toDisplayString(formatItemPrice(Number(tax.total))), 1)
|
|
1265
|
+
]);
|
|
1266
|
+
}), 128)) : createCommentVNode("", true),
|
|
1267
|
+
showTotalVat.value ? (openBlock(), createElementBlock("div", _hoisted_22, [
|
|
1268
|
+
createElementVNode("span", _hoisted_23, toDisplayString(getLabel$1("totalVat", "Total VAT:")), 1),
|
|
1269
|
+
createElementVNode("span", _hoisted_24, toDisplayString(formatItemPrice(totalVat.value)), 1)
|
|
1270
|
+
])) : createCommentVNode("", true),
|
|
1271
|
+
createElementVNode("div", _hoisted_25, [
|
|
1272
|
+
createElementVNode("span", _hoisted_26, toDisplayString(getLabel$1("total", "Total:")), 1),
|
|
1273
|
+
createElementVNode("span", _hoisted_27, toDisplayString(formatItemPrice(totalInclVat.value)), 1)
|
|
1274
|
+
])
|
|
1275
|
+
]);
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
});
|
|
1279
|
+
const _hoisted_1$3 = ["data-include-tax"];
|
|
1280
|
+
const _hoisted_2$2 = {
|
|
1281
|
+
key: 0,
|
|
1282
|
+
class: "propeller-product-bulk-prices__title text-base font-semibold text-foreground mb-3"
|
|
1283
|
+
};
|
|
1284
|
+
const _hoisted_3$2 = { class: "propeller-product-bulk-prices__table-wrapper overflow-hidden rounded-[var(--radius-container)] border border-border" };
|
|
1285
|
+
const _hoisted_4$2 = { class: "propeller-product-bulk-prices__table w-full text-sm" };
|
|
1286
|
+
const _hoisted_5$2 = { class: "propeller-product-bulk-prices__thead bg-surface-hover/50" };
|
|
1287
|
+
const _hoisted_6$1 = { class: "propeller-product-bulk-prices__th propeller-product-bulk-prices__th--quantity px-4 py-2 text-left font-medium text-muted-foreground" };
|
|
1288
|
+
const _hoisted_7$1 = { class: "propeller-product-bulk-prices__th propeller-product-bulk-prices__th--price px-4 py-2 text-right font-medium text-muted-foreground" };
|
|
1289
|
+
const _hoisted_8$1 = { class: "propeller-product-bulk-prices__tax-label font-normal text-xs" };
|
|
1290
|
+
const _hoisted_9 = { class: "propeller-product-bulk-prices__tbody divide-y divide-border" };
|
|
1291
|
+
const _hoisted_10 = { class: "propeller-product-bulk-prices__cell propeller-product-bulk-prices__cell--quantity px-4 py-2 text-foreground font-medium" };
|
|
1292
|
+
const _hoisted_11 = { class: "propeller-product-bulk-prices__cell propeller-product-bulk-prices__cell--price px-4 py-2 text-right text-foreground font-semibold" };
|
|
1293
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1294
|
+
__name: "ProductBulkPrices",
|
|
1295
|
+
props: {
|
|
1296
|
+
bulkPrices: {},
|
|
1297
|
+
currency: {},
|
|
1298
|
+
includeTax: { type: Boolean },
|
|
1299
|
+
portalMode: {},
|
|
1300
|
+
user: {},
|
|
1301
|
+
taxZone: {},
|
|
1302
|
+
labels: {},
|
|
1303
|
+
className: {}
|
|
1304
|
+
},
|
|
1305
|
+
setup(__props) {
|
|
1306
|
+
const props = __props;
|
|
1307
|
+
function isHidden() {
|
|
1308
|
+
return props.portalMode === "semi-closed" && !props.user;
|
|
1309
|
+
}
|
|
1310
|
+
function getIncludeTax() {
|
|
1311
|
+
return props.includeTax !== void 0 ? !!props.includeTax : false;
|
|
1312
|
+
}
|
|
1313
|
+
function getTierQuantity(tier) {
|
|
1314
|
+
const discount = tier.discount;
|
|
1315
|
+
return discount?.quantityFrom ?? tier.quantity ?? null;
|
|
1316
|
+
}
|
|
1317
|
+
function getBulkPrices() {
|
|
1318
|
+
const rawAll = props.bulkPrices || [];
|
|
1319
|
+
const all = rawAll.filter((tier) => {
|
|
1320
|
+
const t = tier;
|
|
1321
|
+
const priceType = t.type ?? t.discount?.type;
|
|
1322
|
+
const discountType = t.discountType ?? t.discount?.discountType;
|
|
1323
|
+
return !(priceType === "PRICESHEET" && discountType === "LIST_PRICE_MIN");
|
|
1324
|
+
});
|
|
1325
|
+
if (all.length === 0) return [];
|
|
1326
|
+
const now = /* @__PURE__ */ new Date();
|
|
1327
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1328
|
+
for (const tier of all) {
|
|
1329
|
+
const qty = getTierQuantity(tier);
|
|
1330
|
+
if (qty === null) continue;
|
|
1331
|
+
const list = groups.get(qty) || [];
|
|
1332
|
+
list.push(tier);
|
|
1333
|
+
groups.set(qty, list);
|
|
1334
|
+
}
|
|
1335
|
+
const filtered = [];
|
|
1336
|
+
for (const [, prices] of groups) {
|
|
1337
|
+
const validDated = [];
|
|
1338
|
+
const nullDated = [];
|
|
1339
|
+
for (const tier of prices) {
|
|
1340
|
+
const discount = tier.discount;
|
|
1341
|
+
if (!discount) {
|
|
1342
|
+
filtered.push(tier);
|
|
1343
|
+
continue;
|
|
1344
|
+
}
|
|
1345
|
+
const validFrom = discount.validFrom ?? null;
|
|
1346
|
+
const validTo = discount.validTo ?? null;
|
|
1347
|
+
if (validFrom === null && validTo === null) {
|
|
1348
|
+
nullDated.push(tier);
|
|
1349
|
+
continue;
|
|
1350
|
+
}
|
|
1351
|
+
let isValid = true;
|
|
1352
|
+
if (validFrom !== null && now < new Date(validFrom)) isValid = false;
|
|
1353
|
+
if (isValid && validTo !== null && now > new Date(validTo))
|
|
1354
|
+
isValid = false;
|
|
1355
|
+
if (isValid) validDated.push(tier);
|
|
1356
|
+
}
|
|
1357
|
+
if (validDated.length > 0) filtered.push(validDated[0]);
|
|
1358
|
+
else if (nullDated.length > 0) filtered.push(nullDated[0]);
|
|
1359
|
+
}
|
|
1360
|
+
filtered.sort(
|
|
1361
|
+
(a, b) => (getTierQuantity(a) ?? 0) - (getTierQuantity(b) ?? 0)
|
|
1362
|
+
);
|
|
1363
|
+
if (filtered.length === 1 && getTierQuantity(filtered[0]) === 1) return [];
|
|
1364
|
+
return filtered;
|
|
1365
|
+
}
|
|
1366
|
+
function hasItems() {
|
|
1367
|
+
return getBulkPrices().length > 0;
|
|
1368
|
+
}
|
|
1369
|
+
function getPrice(tier) {
|
|
1370
|
+
const useTax = getIncludeTax();
|
|
1371
|
+
const value = useTax ? tier.net : tier.gross;
|
|
1372
|
+
if (value === null || value === void 0) return "";
|
|
1373
|
+
return formatPrice(Number(value), { symbol: props.currency ?? "€" });
|
|
1374
|
+
}
|
|
1375
|
+
function getQuantityLabel(tier, index) {
|
|
1376
|
+
const prices = getBulkPrices();
|
|
1377
|
+
const discount = tier.discount;
|
|
1378
|
+
const qty = discount?.quantityFrom || tier.quantity || 1;
|
|
1379
|
+
const nextTier = prices[index + 1];
|
|
1380
|
+
const nextDiscount = nextTier?.discount;
|
|
1381
|
+
const nextQty = nextDiscount?.quantityFrom || nextTier?.quantity;
|
|
1382
|
+
if (nextQty) {
|
|
1383
|
+
return `${qty}–${nextQty - 1}`;
|
|
1384
|
+
}
|
|
1385
|
+
return `${qty}+`;
|
|
1386
|
+
}
|
|
1387
|
+
function getLabel$1(key, fallback) {
|
|
1388
|
+
return getLabel(props.labels, key, fallback);
|
|
1389
|
+
}
|
|
1390
|
+
return (_ctx, _cache) => {
|
|
1391
|
+
return !isHidden() && hasItems() ? (openBlock(), createElementBlock("div", {
|
|
1392
|
+
key: 0,
|
|
1393
|
+
class: normalizeClass(`propeller-product-bulk-prices ${__props.className || ""}`),
|
|
1394
|
+
"data-include-tax": getIncludeTax() ? "true" : "false"
|
|
1395
|
+
}, [
|
|
1396
|
+
getLabel$1("title", "Volume pricing") ? (openBlock(), createElementBlock("h3", _hoisted_2$2, toDisplayString(getLabel$1("title", "Volume pricing")), 1)) : createCommentVNode("", true),
|
|
1397
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
1398
|
+
createElementVNode("table", _hoisted_4$2, [
|
|
1399
|
+
createElementVNode("thead", _hoisted_5$2, [
|
|
1400
|
+
createElementVNode("tr", null, [
|
|
1401
|
+
createElementVNode("th", _hoisted_6$1, toDisplayString(getLabel$1("quantityFrom", "Qty from")), 1),
|
|
1402
|
+
createElementVNode("th", _hoisted_7$1, [
|
|
1403
|
+
createTextVNode(toDisplayString(getLabel$1("price", "Price")), 1),
|
|
1404
|
+
createElementVNode("span", _hoisted_8$1, [
|
|
1405
|
+
_cache[0] || (_cache[0] = createTextVNode(" ( ", -1)),
|
|
1406
|
+
getIncludeTax() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1407
|
+
createTextVNode(toDisplayString(getLabel$1("inclTax", "incl. VAT")), 1)
|
|
1408
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1409
|
+
createTextVNode(toDisplayString(getLabel$1("exclTax", "excl. VAT")), 1)
|
|
1410
|
+
], 64)),
|
|
1411
|
+
_cache[1] || (_cache[1] = createTextVNode(" ) ", -1))
|
|
1412
|
+
])
|
|
1413
|
+
])
|
|
1414
|
+
])
|
|
1415
|
+
]),
|
|
1416
|
+
createElementVNode("tbody", _hoisted_9, [
|
|
1417
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getBulkPrices(), (tier, index) => {
|
|
1418
|
+
return openBlock(), createElementBlock("tr", {
|
|
1419
|
+
key: index,
|
|
1420
|
+
class: "propeller-product-bulk-prices__row bg-card hover:bg-surface-hover/20 transition-colors"
|
|
1421
|
+
}, [
|
|
1422
|
+
createElementVNode("td", _hoisted_10, toDisplayString(getQuantityLabel(tier, index)), 1),
|
|
1423
|
+
createElementVNode("td", _hoisted_11, toDisplayString(getPrice(tier)), 1)
|
|
1424
|
+
]);
|
|
1425
|
+
}), 128))
|
|
1426
|
+
])
|
|
1427
|
+
])
|
|
1428
|
+
])
|
|
1429
|
+
], 10, _hoisted_1$3)) : createCommentVNode("", true);
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
});
|
|
1433
|
+
const _hoisted_1$2 = {
|
|
1434
|
+
key: 0,
|
|
1435
|
+
class: "propeller-product-downloads__title text-base font-semibold text-foreground mb-3"
|
|
1436
|
+
};
|
|
1437
|
+
const _hoisted_2$1 = {
|
|
1438
|
+
key: 1,
|
|
1439
|
+
class: "propeller-product-downloads__list space-y-2"
|
|
1440
|
+
};
|
|
1441
|
+
const _hoisted_3$1 = ["href"];
|
|
1442
|
+
const _hoisted_4$1 = { class: "flex-1 min-w-0 truncate" };
|
|
1443
|
+
const _hoisted_5$1 = {
|
|
1444
|
+
key: 2,
|
|
1445
|
+
class: "propeller-product-downloads__empty text-sm text-muted-foreground"
|
|
1446
|
+
};
|
|
1447
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1448
|
+
__name: "ProductDownloads",
|
|
1449
|
+
props: {
|
|
1450
|
+
downloads: {},
|
|
1451
|
+
language: {},
|
|
1452
|
+
labels: {},
|
|
1453
|
+
className: {}
|
|
1454
|
+
},
|
|
1455
|
+
setup(__props) {
|
|
1456
|
+
const props = __props;
|
|
1457
|
+
function hasItems() {
|
|
1458
|
+
const d = props.downloads;
|
|
1459
|
+
return !!d?.items && d.items.length > 0;
|
|
1460
|
+
}
|
|
1461
|
+
function getDownloadItems() {
|
|
1462
|
+
const d = props.downloads;
|
|
1463
|
+
return d?.items || [];
|
|
1464
|
+
}
|
|
1465
|
+
function getDocumentUrl(doc) {
|
|
1466
|
+
const lang = props.language || "NL";
|
|
1467
|
+
const docs = doc.documents || [];
|
|
1468
|
+
const match = docs.find((d) => d.language === lang);
|
|
1469
|
+
return match?.originalUrl || docs?.[0]?.originalUrl || "";
|
|
1470
|
+
}
|
|
1471
|
+
function getDocumentName(doc) {
|
|
1472
|
+
return getLanguageString(doc.alt, props.language || "NL", "Download");
|
|
1473
|
+
}
|
|
1474
|
+
function getLabel$1(key, fallback) {
|
|
1475
|
+
return getLabel(props.labels, key, fallback);
|
|
1476
|
+
}
|
|
1477
|
+
return (_ctx, _cache) => {
|
|
1478
|
+
return openBlock(), createElementBlock("div", {
|
|
1479
|
+
class: normalizeClass(`propeller-product-downloads ${__props.className || ""}`)
|
|
1480
|
+
}, [
|
|
1481
|
+
hasItems() ? (openBlock(), createElementBlock("h3", _hoisted_1$2, toDisplayString(getLabel$1("title", "Downloads")), 1)) : createCommentVNode("", true),
|
|
1482
|
+
hasItems() ? (openBlock(), createElementBlock("ul", _hoisted_2$1, [
|
|
1483
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getDownloadItems(), (doc, index) => {
|
|
1484
|
+
return openBlock(), createElementBlock("li", {
|
|
1485
|
+
key: index,
|
|
1486
|
+
class: "propeller-product-downloads__item"
|
|
1487
|
+
}, [
|
|
1488
|
+
!!getDocumentUrl(doc) ? (openBlock(), createElementBlock("a", {
|
|
1489
|
+
key: 0,
|
|
1490
|
+
target: "_blank",
|
|
1491
|
+
class: "propeller-product-downloads__link flex items-center gap-3 rounded-[var(--radius-container)] border border-border bg-card px-4 py-3 text-sm text-foreground hover:bg-surface-hover/30 hover:border-primary/40 transition-colors group",
|
|
1492
|
+
href: getDocumentUrl(doc),
|
|
1493
|
+
download: true
|
|
1494
|
+
}, [
|
|
1495
|
+
_cache[0] || (_cache[0] = createElementVNode("svg", {
|
|
1496
|
+
fill: "none",
|
|
1497
|
+
stroke: "currentColor",
|
|
1498
|
+
viewBox: "0 0 24 24",
|
|
1499
|
+
class: "h-5 w-5 flex-shrink-0 text-muted-foreground group-hover:text-primary transition-colors"
|
|
1500
|
+
}, [
|
|
1501
|
+
createElementVNode("path", {
|
|
1502
|
+
strokeLinecap: "round",
|
|
1503
|
+
strokeLinejoin: "round",
|
|
1504
|
+
d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",
|
|
1505
|
+
strokeWidth: 1.5
|
|
1506
|
+
})
|
|
1507
|
+
], -1)),
|
|
1508
|
+
createElementVNode("span", _hoisted_4$1, toDisplayString(getDocumentName(doc)), 1),
|
|
1509
|
+
_cache[1] || (_cache[1] = createElementVNode("svg", {
|
|
1510
|
+
fill: "none",
|
|
1511
|
+
stroke: "currentColor",
|
|
1512
|
+
viewBox: "0 0 24 24",
|
|
1513
|
+
class: "h-4 w-4 flex-shrink-0 text-muted-foreground group-hover:text-primary transition-colors"
|
|
1514
|
+
}, [
|
|
1515
|
+
createElementVNode("path", {
|
|
1516
|
+
strokeLinecap: "round",
|
|
1517
|
+
strokeLinejoin: "round",
|
|
1518
|
+
d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",
|
|
1519
|
+
strokeWidth: 2
|
|
1520
|
+
})
|
|
1521
|
+
], -1))
|
|
1522
|
+
], 8, _hoisted_3$1)) : createCommentVNode("", true)
|
|
1523
|
+
]);
|
|
1524
|
+
}), 128))
|
|
1525
|
+
])) : createCommentVNode("", true),
|
|
1526
|
+
!hasItems() ? (openBlock(), createElementBlock("p", _hoisted_5$1, toDisplayString(getLabel$1("empty", "No downloads")), 1)) : createCommentVNode("", true)
|
|
1527
|
+
], 2);
|
|
1528
|
+
};
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
const _hoisted_1$1 = ["innerHTML"];
|
|
1532
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1533
|
+
__name: "ProductShortDescription",
|
|
1534
|
+
props: {
|
|
1535
|
+
product: {},
|
|
1536
|
+
language: {},
|
|
1537
|
+
className: {}
|
|
1538
|
+
},
|
|
1539
|
+
setup(__props) {
|
|
1540
|
+
const props = __props;
|
|
1541
|
+
const infra = useInfraProps(props);
|
|
1542
|
+
const html = ref("");
|
|
1543
|
+
watch(
|
|
1544
|
+
() => [props.product, infra.language],
|
|
1545
|
+
() => {
|
|
1546
|
+
html.value = getShortDescription();
|
|
1547
|
+
},
|
|
1548
|
+
{ immediate: true }
|
|
1549
|
+
);
|
|
1550
|
+
function getShortDescription() {
|
|
1551
|
+
const product = props.product;
|
|
1552
|
+
if (!product?.shortDescriptions) return "";
|
|
1553
|
+
return getLanguageString(product.shortDescriptions, infra.language || "NL", "");
|
|
1554
|
+
}
|
|
1555
|
+
return (_ctx, _cache) => {
|
|
1556
|
+
return !!html.value ? (openBlock(), createElementBlock("div", {
|
|
1557
|
+
key: 0,
|
|
1558
|
+
innerHTML: html.value,
|
|
1559
|
+
class: normalizeClass(`propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${__props.className || ""}`)
|
|
1560
|
+
}, null, 10, _hoisted_1$1)) : createCommentVNode("", true);
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
const _hoisted_1 = {
|
|
1565
|
+
key: 0,
|
|
1566
|
+
class: "propeller-product-videos__title text-base font-semibold text-foreground mb-3"
|
|
1567
|
+
};
|
|
1568
|
+
const _hoisted_2 = {
|
|
1569
|
+
key: 1,
|
|
1570
|
+
class: "propeller-product-videos__list space-y-4"
|
|
1571
|
+
};
|
|
1572
|
+
const _hoisted_3 = ["data-embedded"];
|
|
1573
|
+
const _hoisted_4 = {
|
|
1574
|
+
key: 0,
|
|
1575
|
+
class: "propeller-product-videos__embed relative w-full",
|
|
1576
|
+
style: {
|
|
1577
|
+
paddingBottom: "56.25%"
|
|
1578
|
+
}
|
|
1579
|
+
};
|
|
1580
|
+
const _hoisted_5 = ["src", "title"];
|
|
1581
|
+
const _hoisted_6 = {
|
|
1582
|
+
key: 1,
|
|
1583
|
+
preload: "metadata",
|
|
1584
|
+
class: "propeller-product-videos__video w-full",
|
|
1585
|
+
controls: true
|
|
1586
|
+
};
|
|
1587
|
+
const _hoisted_7 = ["src"];
|
|
1588
|
+
const _hoisted_8 = {
|
|
1589
|
+
key: 2,
|
|
1590
|
+
class: "propeller-product-videos__empty text-sm text-muted-foreground"
|
|
1591
|
+
};
|
|
1592
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1593
|
+
__name: "ProductVideos",
|
|
1594
|
+
props: {
|
|
1595
|
+
videos: {},
|
|
1596
|
+
language: {},
|
|
1597
|
+
labels: {},
|
|
1598
|
+
className: {}
|
|
1599
|
+
},
|
|
1600
|
+
setup(__props) {
|
|
1601
|
+
const props = __props;
|
|
1602
|
+
function hasItems() {
|
|
1603
|
+
const v = props.videos;
|
|
1604
|
+
return !!v?.items && v.items.length > 0;
|
|
1605
|
+
}
|
|
1606
|
+
function getVideoItems() {
|
|
1607
|
+
const v = props.videos;
|
|
1608
|
+
return v?.items || [];
|
|
1609
|
+
}
|
|
1610
|
+
function getVideoUri(video) {
|
|
1611
|
+
const lang = props.language || "NL";
|
|
1612
|
+
const vids = video.videos || [];
|
|
1613
|
+
const match = vids.find((v) => v.language === lang);
|
|
1614
|
+
return match?.uri || vids?.[0]?.uri || "";
|
|
1615
|
+
}
|
|
1616
|
+
function getVideoTitle(video) {
|
|
1617
|
+
return getLanguageString(video.alt, props.language || "NL", "Video");
|
|
1618
|
+
}
|
|
1619
|
+
function isEmbeddable(uri) {
|
|
1620
|
+
return uri.includes("youtube.com") || uri.includes("youtu.be") || uri.includes("vimeo.com");
|
|
1621
|
+
}
|
|
1622
|
+
function getEmbedUrl(uri) {
|
|
1623
|
+
if (uri.includes("youtube.com/embed/") || uri.includes("player.vimeo.com/video/")) {
|
|
1624
|
+
return uri;
|
|
1625
|
+
}
|
|
1626
|
+
if (uri.includes("youtube.com/watch")) {
|
|
1627
|
+
const url = new URL(uri);
|
|
1628
|
+
const videoId = url.searchParams.get("v") || "";
|
|
1629
|
+
return `https://www.youtube.com/embed/${videoId}`;
|
|
1630
|
+
}
|
|
1631
|
+
if (uri.includes("youtu.be/")) {
|
|
1632
|
+
const videoId = uri.split("youtu.be/")[1]?.split("?")[0] || "";
|
|
1633
|
+
return `https://www.youtube.com/embed/${videoId}`;
|
|
1634
|
+
}
|
|
1635
|
+
if (uri.includes("vimeo.com/")) {
|
|
1636
|
+
const parts = uri.split("vimeo.com/")[1]?.split("?")[0]?.split("/") || [];
|
|
1637
|
+
const videoId = parts[0] || "";
|
|
1638
|
+
const hash = parts[1] || "";
|
|
1639
|
+
return hash ? `https://player.vimeo.com/video/${videoId}?h=${hash}` : `https://player.vimeo.com/video/${videoId}`;
|
|
1640
|
+
}
|
|
1641
|
+
return uri;
|
|
1642
|
+
}
|
|
1643
|
+
function getLabel$1(key, fallback) {
|
|
1644
|
+
return getLabel(props.labels, key, fallback);
|
|
1645
|
+
}
|
|
1646
|
+
return (_ctx, _cache) => {
|
|
1647
|
+
return openBlock(), createElementBlock("div", {
|
|
1648
|
+
class: normalizeClass(`propeller-product-videos ${__props.className || ""}`)
|
|
1649
|
+
}, [
|
|
1650
|
+
hasItems() ? (openBlock(), createElementBlock("h3", _hoisted_1, toDisplayString(getLabel$1("title", "Videos")), 1)) : createCommentVNode("", true),
|
|
1651
|
+
hasItems() ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
1652
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getVideoItems(), (video, index) => {
|
|
1653
|
+
return openBlock(), createElementBlock("div", {
|
|
1654
|
+
key: index,
|
|
1655
|
+
class: "propeller-product-videos__item rounded-[var(--radius-container)] overflow-hidden border border-border bg-black",
|
|
1656
|
+
"data-embedded": !!getVideoUri(video) && isEmbeddable(getVideoUri(video)) ? "true" : "false"
|
|
1657
|
+
}, [
|
|
1658
|
+
!!getVideoUri(video) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1659
|
+
isEmbeddable(getVideoUri(video)) ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
1660
|
+
createElementVNode("iframe", {
|
|
1661
|
+
loading: "lazy",
|
|
1662
|
+
allow: "\n accelerometer;\n autoplay;\n clipboard-write;\n encrypted-media;\n gyroscope;\n picture-in-picture;\n ",
|
|
1663
|
+
class: "propeller-product-videos__iframe absolute inset-0 w-full h-full",
|
|
1664
|
+
src: getEmbedUrl(getVideoUri(video)),
|
|
1665
|
+
title: getVideoTitle(video),
|
|
1666
|
+
allowFullScreen: true
|
|
1667
|
+
}, null, 8, _hoisted_5)
|
|
1668
|
+
])) : createCommentVNode("", true),
|
|
1669
|
+
!isEmbeddable(getVideoUri(video)) ? (openBlock(), createElementBlock("video", _hoisted_6, [
|
|
1670
|
+
createElementVNode("source", {
|
|
1671
|
+
src: getVideoUri(video)
|
|
1672
|
+
}, null, 8, _hoisted_7)
|
|
1673
|
+
])) : createCommentVNode("", true)
|
|
1674
|
+
], 64)) : createCommentVNode("", true)
|
|
1675
|
+
], 8, _hoisted_3);
|
|
1676
|
+
}), 128))
|
|
1677
|
+
])) : createCommentVNode("", true),
|
|
1678
|
+
!hasItems() ? (openBlock(), createElementBlock("p", _hoisted_8, toDisplayString(getLabel$1("empty", "No videos")), 1)) : createCommentVNode("", true)
|
|
1679
|
+
], 2);
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
export {
|
|
1684
|
+
PropellerDepsKey as P,
|
|
1685
|
+
_sfc_main$a as _,
|
|
1686
|
+
PropellerScopeKey as a,
|
|
1687
|
+
_sfc_main$8 as b,
|
|
1688
|
+
_sfc_main$7 as c,
|
|
1689
|
+
_sfc_main$9 as d,
|
|
1690
|
+
_sfc_main$6 as e,
|
|
1691
|
+
_sfc_main$5 as f,
|
|
1692
|
+
_sfc_main$4 as g,
|
|
1693
|
+
_sfc_main$3 as h,
|
|
1694
|
+
_sfc_main$2 as i,
|
|
1695
|
+
_sfc_main$b as j,
|
|
1696
|
+
_sfc_main$1 as k,
|
|
1697
|
+
_sfc_main as l,
|
|
1698
|
+
usePropellerContext as m,
|
|
1699
|
+
usePropellerDeps as n,
|
|
1700
|
+
useRequiredPropellerContext as o,
|
|
1701
|
+
propellerVue as p,
|
|
1702
|
+
useUserMode as q,
|
|
1703
|
+
tryUsePropellerDeps as t,
|
|
1704
|
+
useInfraProps as u
|
|
1705
|
+
};
|
|
1706
|
+
//# sourceMappingURL=ProductVideos.vue_vue_type_script_setup_true_lang-BSXOpWBD.js.map
|