@propeller-commerce/propeller-v2-react-ui 0.15.11 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +107 -0
- package/README.md +17 -5
- package/dist/index.cjs +149 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +78 -5
- package/dist/index.d.ts +78 -5
- package/dist/index.js +149 -114
- package/dist/index.js.map +1 -1
- package/dist/pure.cjs +24 -19
- package/dist/pure.cjs.map +1 -1
- package/dist/pure.d.cts +10 -0
- package/dist/pure.d.ts +10 -0
- package/dist/pure.js +25 -20
- package/dist/pure.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,6 +5,8 @@ import * as React6 from 'react';
|
|
|
5
5
|
import { createContext, useState, useRef, useMemo, useCallback, useContext, useEffect } from 'react';
|
|
6
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { ProductStatus, ProductSortField, SortOrder, PurchaseRole, CrossupsellType, CartStatus, CartAddressType, Gender, YesNo, AddressType, MagicTokenService, PaymentStatuses, OrderSearchFields, OrderItemClass, ProductSearchableField, machineService, AttributeType, OrderSortField, OrderType, OrderDiscountType, BundleCondition } from '@propeller-commerce/propeller-sdk-v2';
|
|
8
|
+
import { clsx } from 'clsx';
|
|
9
|
+
import { twMerge } from 'tailwind-merge';
|
|
8
10
|
import { User } from 'lucide-react';
|
|
9
11
|
|
|
10
12
|
// src/index.ts
|
|
@@ -718,7 +720,8 @@ function useCart(options) {
|
|
|
718
720
|
const { graphqlClient, user, companyId, configuration, onCartCreated } = options;
|
|
719
721
|
const language = options.language || configuration?.language || "NL";
|
|
720
722
|
const [cart, setCart] = useState(null);
|
|
721
|
-
const [
|
|
723
|
+
const [createdCartId, setCreatedCartId] = useState("");
|
|
724
|
+
const cartId = options.cartId || createdCartId;
|
|
722
725
|
const [loading, setLoading] = useState(false);
|
|
723
726
|
const [error, setError] = useState(null);
|
|
724
727
|
const notesTimers = useRef({});
|
|
@@ -754,13 +757,13 @@ function useCart(options) {
|
|
|
754
757
|
imageVariantFilters: configuration?.imageVariantFiltersSmall,
|
|
755
758
|
onCartCreated: (c) => {
|
|
756
759
|
setCart(c);
|
|
757
|
-
|
|
760
|
+
setCreatedCartId(c.cartId);
|
|
758
761
|
onCartCreated?.(c);
|
|
759
762
|
}
|
|
760
763
|
};
|
|
761
764
|
const resolved = await initCart(config);
|
|
762
765
|
setCart(resolved);
|
|
763
|
-
|
|
766
|
+
setCreatedCartId(resolved.cartId);
|
|
764
767
|
return resolved;
|
|
765
768
|
}, [graphqlClient, user, companyId, language, configuration, onCartCreated]);
|
|
766
769
|
const addItem = useCallback(async (opts) => {
|
|
@@ -775,7 +778,7 @@ function useCart(options) {
|
|
|
775
778
|
if (opts.onAddToCart) {
|
|
776
779
|
const resultCart2 = opts.onAddToCart(opts.product, opts.cluster?.clusterId, opts.quantity, childItemInputs, opts.notes, opts.price);
|
|
777
780
|
setCart(resultCart2);
|
|
778
|
-
|
|
781
|
+
setCreatedCartId(resultCart2.cartId);
|
|
779
782
|
const addedItem2 = resultCart2.items?.find((i) => i.productId === opts.product.productId) ?? null;
|
|
780
783
|
opts.afterAddToCart?.(resultCart2, addedItem2);
|
|
781
784
|
return ok({ cart: resultCart2, item: addedItem2 });
|
|
@@ -796,7 +799,7 @@ function useCart(options) {
|
|
|
796
799
|
imageVariantFilters: configuration?.imageVariantFiltersSmall
|
|
797
800
|
});
|
|
798
801
|
setCart(resultCart);
|
|
799
|
-
|
|
802
|
+
setCreatedCartId(resultCart.cartId);
|
|
800
803
|
const addedItem = resultCart.items?.find((i) => i.productId === opts.product.productId) ?? null;
|
|
801
804
|
opts.afterAddToCart?.(resultCart, addedItem);
|
|
802
805
|
return ok({ cart: resultCart, item: addedItem });
|
|
@@ -1389,7 +1392,7 @@ function useFavorites(options) {
|
|
|
1389
1392
|
if (onEdit) {
|
|
1390
1393
|
onEdit(listId, data);
|
|
1391
1394
|
cancelEdit();
|
|
1392
|
-
onListChanged?.();
|
|
1395
|
+
onListChanged?.({ action: "updated", listId, ...data });
|
|
1393
1396
|
return;
|
|
1394
1397
|
}
|
|
1395
1398
|
setSaving(true);
|
|
@@ -1404,7 +1407,7 @@ function useFavorites(options) {
|
|
|
1404
1407
|
const updated = await service.updateFavoriteList(listId, { name: data.name, isDefault: data.isDefault });
|
|
1405
1408
|
setLists((prev) => prev.map((l) => String(l.id) === listId ? updated : l));
|
|
1406
1409
|
cancelEdit();
|
|
1407
|
-
onListChanged?.();
|
|
1410
|
+
onListChanged?.({ action: "updated", listId, name: data.name, isDefault: data.isDefault });
|
|
1408
1411
|
} catch (e) {
|
|
1409
1412
|
setError(e instanceof Error ? e.message : "Failed to update list");
|
|
1410
1413
|
} finally {
|
|
@@ -1421,7 +1424,7 @@ function useFavorites(options) {
|
|
|
1421
1424
|
if (onDelete) {
|
|
1422
1425
|
onDelete(listId);
|
|
1423
1426
|
setListToDelete(null);
|
|
1424
|
-
onListChanged?.();
|
|
1427
|
+
onListChanged?.({ action: "deleted", listId, name: list.name });
|
|
1425
1428
|
return;
|
|
1426
1429
|
}
|
|
1427
1430
|
setSaving(true);
|
|
@@ -1430,7 +1433,7 @@ function useFavorites(options) {
|
|
|
1430
1433
|
try {
|
|
1431
1434
|
const service = createServices(graphqlClient).favoriteList;
|
|
1432
1435
|
await service.deleteFavoriteList(listId);
|
|
1433
|
-
onListChanged?.();
|
|
1436
|
+
onListChanged?.({ action: "deleted", listId, name: list.name });
|
|
1434
1437
|
} catch (e) {
|
|
1435
1438
|
setError(e instanceof Error ? e.message : "Failed to delete list");
|
|
1436
1439
|
setLists((prev) => [...prev, list]);
|
|
@@ -1443,7 +1446,7 @@ function useFavorites(options) {
|
|
|
1443
1446
|
const data = { name, isDefault };
|
|
1444
1447
|
if (onCreate) {
|
|
1445
1448
|
onCreate(data);
|
|
1446
|
-
onListChanged?.();
|
|
1449
|
+
onListChanged?.({ action: "created", name, isDefault });
|
|
1447
1450
|
return;
|
|
1448
1451
|
}
|
|
1449
1452
|
setSaving(true);
|
|
@@ -1460,7 +1463,7 @@ function useFavorites(options) {
|
|
|
1460
1463
|
if (isCustomer(user)) createInput.customerId = user.customerId;
|
|
1461
1464
|
const created = await service.createFavoriteList(createInput);
|
|
1462
1465
|
setLists((prev) => [...prev, created]);
|
|
1463
|
-
onListChanged?.();
|
|
1466
|
+
onListChanged?.({ action: "created", listId: created?.id, name, isDefault });
|
|
1464
1467
|
} catch (e) {
|
|
1465
1468
|
setError(e instanceof Error ? e.message : "Failed to create list");
|
|
1466
1469
|
} finally {
|
|
@@ -2182,6 +2185,15 @@ function useProductInfo(options) {
|
|
|
2182
2185
|
clusterImageUrl
|
|
2183
2186
|
};
|
|
2184
2187
|
}
|
|
2188
|
+
|
|
2189
|
+
// src/composables/shared/utils/listingUserId.ts
|
|
2190
|
+
function resolveListingUserId(user, configuration) {
|
|
2191
|
+
if (user && "contactId" in user) return user.contactId;
|
|
2192
|
+
if (user && "customerId" in user) return user.customerId;
|
|
2193
|
+
return configuration?.anonymousUserId;
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
// src/composables/react/useProductSearch.ts
|
|
2185
2197
|
var inflightFetches2 = /* @__PURE__ */ new Set();
|
|
2186
2198
|
function buildAttributeInput(names) {
|
|
2187
2199
|
if (!names || names.length === 0) return void 0;
|
|
@@ -2286,7 +2298,7 @@ function useProductSearch(options) {
|
|
|
2286
2298
|
] : [];
|
|
2287
2299
|
const priceFilter = options.priceFilterMin !== void 0 || options.priceFilterMax !== void 0 ? { from: options.priceFilterMin ?? 0, to: options.priceFilterMax ?? 999999 } : void 0;
|
|
2288
2300
|
const inventoryFilter = buildInventoryFilter(options.availability, options.minStock);
|
|
2289
|
-
const userId = options.user
|
|
2301
|
+
const userId = resolveListingUserId(options.user, configuration);
|
|
2290
2302
|
const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
|
|
2291
2303
|
const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
|
|
2292
2304
|
const orderlistScope = options.orderlistIds && options.orderlistIds.length > 0 ? {
|
|
@@ -2423,7 +2435,7 @@ function useProductSearch(options) {
|
|
|
2423
2435
|
applyOrderlists: options.applyOrderlists !== false,
|
|
2424
2436
|
orderlistIds: options.orderlistIds
|
|
2425
2437
|
} : { applyOrderlists: false };
|
|
2426
|
-
const userId = options.user
|
|
2438
|
+
const userId = resolveListingUserId(options.user, configuration);
|
|
2427
2439
|
const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
|
|
2428
2440
|
const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
|
|
2429
2441
|
const inventoryFilter = buildInventoryFilter(options.availability, options.minStock);
|
|
@@ -2589,7 +2601,7 @@ function useQuickOrder(options) {
|
|
|
2589
2601
|
try {
|
|
2590
2602
|
const service = createServices(graphqlClient).category;
|
|
2591
2603
|
const orderlistScope = orderlistIds && orderlistIds.length > 0 ? { applyOrderlists: applyOrderlists !== false, orderlistIds } : { applyOrderlists: false };
|
|
2592
|
-
const userId = user
|
|
2604
|
+
const userId = resolveListingUserId(user, configuration);
|
|
2593
2605
|
const contactId = user && "contactId" in user ? user.contactId : void 0;
|
|
2594
2606
|
const customerId = user && "customerId" in user ? user.customerId : void 0;
|
|
2595
2607
|
const input = {
|
|
@@ -2731,7 +2743,7 @@ function useSpareParts(options) {
|
|
|
2731
2743
|
[isControlled, options.parts, internalParts]
|
|
2732
2744
|
);
|
|
2733
2745
|
const isLoading = !isControlled && internalLoading;
|
|
2734
|
-
const userId = options.user
|
|
2746
|
+
const userId = resolveListingUserId(options.user, options.configuration);
|
|
2735
2747
|
const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
|
|
2736
2748
|
const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
|
|
2737
2749
|
const userKey = `${contactId ?? ""}:${customerId ?? ""}`;
|
|
@@ -3034,9 +3046,7 @@ function useProductSlider(options) {
|
|
|
3034
3046
|
}
|
|
3035
3047
|
}
|
|
3036
3048
|
function resolveUserId() {
|
|
3037
|
-
|
|
3038
|
-
if (options.user && "customerId" in options.user) return options.user.customerId;
|
|
3039
|
-
return void 0;
|
|
3049
|
+
return resolveListingUserId(options.user, options.configuration);
|
|
3040
3050
|
}
|
|
3041
3051
|
const fetchCrossupsells = useCallback(async (input) => {
|
|
3042
3052
|
setLoading(true);
|
|
@@ -4023,6 +4033,9 @@ LoginFormExport.RegisterLink = LoginFormRegisterLink;
|
|
|
4023
4033
|
LoginFormExport.GuestCheckoutButton = LoginFormGuestCheckoutButton;
|
|
4024
4034
|
LoginFormExport.ErrorMessage = LoginFormErrorMessage;
|
|
4025
4035
|
var LoginForm_default = LoginFormExport;
|
|
4036
|
+
function cn(...inputs) {
|
|
4037
|
+
return twMerge(clsx(inputs));
|
|
4038
|
+
}
|
|
4026
4039
|
function AccountIconAndMenu(rawProps) {
|
|
4027
4040
|
const props = useInfraProps(rawProps);
|
|
4028
4041
|
const LoginFormImpl = props.loginFormComponent ?? LoginForm_default;
|
|
@@ -4171,7 +4184,7 @@ function AccountIconAndMenu(rawProps) {
|
|
|
4171
4184
|
onClick: (event) => handleIconClick(),
|
|
4172
4185
|
"aria-label": getLabel(props.labels, "accountLabel", "Account"),
|
|
4173
4186
|
"data-open": menuOpen ? "true" : "false",
|
|
4174
|
-
className: `propeller-account-menu__trigger inline-flex items-center gap-2 px-3 py-2 rounded-control text-sm font-medium transition-colors text-white hover:bg-white/10${props.iconClassName ? " " + props.iconClassName : ""}
|
|
4187
|
+
className: cn(`propeller-account-menu__trigger inline-flex items-center gap-2 px-3 py-2 rounded-control text-sm font-medium transition-colors text-white hover:bg-white/10${props.iconClassName ? " " + props.iconClassName : ""}`),
|
|
4175
4188
|
children: [
|
|
4176
4189
|
/* @__PURE__ */ jsx(
|
|
4177
4190
|
"svg",
|
|
@@ -4199,7 +4212,7 @@ function AccountIconAndMenu(rawProps) {
|
|
|
4199
4212
|
menuOpen ? /* @__PURE__ */ jsxs(
|
|
4200
4213
|
"div",
|
|
4201
4214
|
{
|
|
4202
|
-
className: `propeller-account-menu__popover absolute right-0 mt-2 w-80 bg-popover text-foreground rounded-container shadow-lg border border-border py-4 px-5 z-50${props.menuClassName ? " " + props.menuClassName : ""}
|
|
4215
|
+
className: cn(`propeller-account-menu__popover absolute right-0 mt-2 w-80 bg-popover text-foreground rounded-container shadow-lg border border-border py-4 px-5 z-50${props.menuClassName ? " " + props.menuClassName : ""}`),
|
|
4203
4216
|
children: [
|
|
4204
4217
|
!!props.user ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4205
4218
|
/* @__PURE__ */ jsxs("div", { className: "propeller-account-menu__user pb-3 mb-3 border-b border-border", children: [
|
|
@@ -4560,7 +4573,7 @@ function AddToCart(rawProps) {
|
|
|
4560
4573
|
return /* @__PURE__ */ jsxs(
|
|
4561
4574
|
"div",
|
|
4562
4575
|
{
|
|
4563
|
-
className: `propeller-add-to-cart ${props.className || ""}
|
|
4576
|
+
className: cn(`propeller-add-to-cart ${props.className || ""}`),
|
|
4564
4577
|
"data-loading": loading ? "true" : "false",
|
|
4565
4578
|
children: [
|
|
4566
4579
|
/* @__PURE__ */ jsxs("div", { className: "propeller-add-to-cart__controls flex flex-wrap items-center gap-2 w-full md:flex-nowrap", children: [
|
|
@@ -4930,7 +4943,14 @@ function AddToFavorite(rawProps) {
|
|
|
4930
4943
|
setMemberListIds(newMemberIds);
|
|
4931
4944
|
setSelectedListId("");
|
|
4932
4945
|
setIsOpen(false);
|
|
4933
|
-
if (props.onFavoriteChanged)
|
|
4946
|
+
if (props.onFavoriteChanged) {
|
|
4947
|
+
props.onFavoriteChanged({
|
|
4948
|
+
action: "added",
|
|
4949
|
+
listId: selectedListId,
|
|
4950
|
+
productId: props.productId,
|
|
4951
|
+
clusterId: props.clusterId
|
|
4952
|
+
});
|
|
4953
|
+
}
|
|
4934
4954
|
} catch (error) {
|
|
4935
4955
|
console.error("Error adding to favorite list:", error);
|
|
4936
4956
|
} finally {
|
|
@@ -4947,7 +4967,14 @@ function AddToFavorite(rawProps) {
|
|
|
4947
4967
|
setMemberListIds(newMemberIds);
|
|
4948
4968
|
setSelectedListId("");
|
|
4949
4969
|
setIsOpen(false);
|
|
4950
|
-
if (props.onFavoriteChanged)
|
|
4970
|
+
if (props.onFavoriteChanged) {
|
|
4971
|
+
props.onFavoriteChanged({
|
|
4972
|
+
action: "removed",
|
|
4973
|
+
listId,
|
|
4974
|
+
productId: props.productId,
|
|
4975
|
+
clusterId: props.clusterId
|
|
4976
|
+
});
|
|
4977
|
+
}
|
|
4951
4978
|
} catch (error) {
|
|
4952
4979
|
console.error("Error removing from favorite list:", error);
|
|
4953
4980
|
} finally {
|
|
@@ -4987,7 +5014,7 @@ function AddToFavorite(rawProps) {
|
|
|
4987
5014
|
type: "button",
|
|
4988
5015
|
onClick: (event) => toggleModal(),
|
|
4989
5016
|
title: isFavorited() ? getLabel(props.labels, "removeFromFavorites", "Remove from favorites") : getLabel(props.labels, "addToFavorites", "Add to favorites"),
|
|
4990
|
-
className: `propeller-add-to-favorite__btn inline-flex items-center justify-center rounded-control border p-2.5 transition-colors ${isFavorited() ? "border-primary/30 bg-primary/5 text-primary hover:bg-primary/10" : "border-border bg-card text-foreground-subtle hover:text-primary hover:border-primary/30 hover:bg-primary/5"} ${props.className || ""}
|
|
5017
|
+
className: cn(`propeller-add-to-favorite__btn inline-flex items-center justify-center rounded-control border p-2.5 transition-colors ${isFavorited() ? "border-primary/30 bg-primary/5 text-primary hover:bg-primary/10" : "border-border bg-card text-foreground-subtle hover:text-primary hover:border-primary/30 hover:bg-primary/5"} ${props.className || ""}`),
|
|
4991
5018
|
children: [
|
|
4992
5019
|
isFavorited() ? /* @__PURE__ */ jsx(
|
|
4993
5020
|
"svg",
|
|
@@ -6136,7 +6163,7 @@ function AddressSelector(props) {
|
|
|
6136
6163
|
setIsLoading(false);
|
|
6137
6164
|
}
|
|
6138
6165
|
}
|
|
6139
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-address-selector ${props.className || ""}
|
|
6166
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-address-selector ${props.className || ""}`), children: [
|
|
6140
6167
|
/* @__PURE__ */ jsxs(
|
|
6141
6168
|
"button",
|
|
6142
6169
|
{
|
|
@@ -6279,7 +6306,7 @@ function Breadcrumbs(props) {
|
|
|
6279
6306
|
return index === displayItems.length - 1;
|
|
6280
6307
|
}
|
|
6281
6308
|
const showSeparatorBefore = (index) => props.showHome !== false || index > 0;
|
|
6282
|
-
return /* @__PURE__ */ jsx("nav", { "aria-label": getLabel(props.labels, "breadcrumbAriaLabel", "Breadcrumb"), className: `propeller-breadcrumbs ${props.className || ""}
|
|
6309
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": getLabel(props.labels, "breadcrumbAriaLabel", "Breadcrumb"), className: cn(`propeller-breadcrumbs ${props.className || ""}`), children: /* @__PURE__ */ jsxs("ol", { className: "propeller-breadcrumbs__list flex flex-wrap items-center text-sm text-muted-foreground", children: [
|
|
6283
6310
|
props.showHome !== false ? /* @__PURE__ */ jsx("li", { className: "propeller-breadcrumbs__item flex items-center", "data-home": "true", children: /* @__PURE__ */ jsx(
|
|
6284
6311
|
"a",
|
|
6285
6312
|
{
|
|
@@ -6357,7 +6384,7 @@ function CartBonusItems(rawProps) {
|
|
|
6357
6384
|
const money = (value) => formatPrice(value, { symbol: currency });
|
|
6358
6385
|
const productName = (item) => getLocalizedValue(item.product?.names, props.language, "Product");
|
|
6359
6386
|
const productImage = (item) => item.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "";
|
|
6360
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-cart-bonus-items ${props.className || "mt-2"}
|
|
6387
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-cart-bonus-items ${props.className || "mt-2"}`), children: [
|
|
6361
6388
|
/* @__PURE__ */ jsx("h2", { className: "propeller-cart-bonus-items__title text-lg font-semibold mb-3", children: getLabel(props.labels, "title", "Bonus items") }),
|
|
6362
6389
|
/* @__PURE__ */ jsx("div", { className: "propeller-cart-bonus-items__list space-y-4", children: items.map((item) => {
|
|
6363
6390
|
const img = productImage(item);
|
|
@@ -6504,7 +6531,7 @@ function ItemStock(props) {
|
|
|
6504
6531
|
return /* @__PURE__ */ jsx(Fragment, { children: hasInventory() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
6505
6532
|
"div",
|
|
6506
6533
|
{
|
|
6507
|
-
className: `propeller-item-stock flex flex-wrap items-center gap-1.5 ${props.className || ""}
|
|
6534
|
+
className: cn(`propeller-item-stock flex flex-wrap items-center gap-1.5 ${props.className || ""}`),
|
|
6508
6535
|
"data-available": isAvailable() ? "true" : "false",
|
|
6509
6536
|
"data-stock": getStockStatusData(),
|
|
6510
6537
|
children: [
|
|
@@ -6833,7 +6860,7 @@ function CartItem(rawProps) {
|
|
|
6833
6860
|
return /* @__PURE__ */ jsx(CartItemContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
6834
6861
|
"div",
|
|
6835
6862
|
{
|
|
6836
|
-
className: `propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? "" : "bg-card p-4 rounded-container shadow-sm border border-border"} ${props.className || ""}
|
|
6863
|
+
className: cn(`propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? "" : "bg-card p-4 rounded-container shadow-sm border border-border"} ${props.className || ""}`),
|
|
6837
6864
|
"data-bundle": isBundleItem() ? "true" : "false",
|
|
6838
6865
|
"data-loading": loading ? "true" : "false",
|
|
6839
6866
|
children: rawProps.children
|
|
@@ -6843,7 +6870,7 @@ function CartItem(rawProps) {
|
|
|
6843
6870
|
return /* @__PURE__ */ jsx(CartItemContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
|
|
6844
6871
|
"div",
|
|
6845
6872
|
{
|
|
6846
|
-
className: `propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? "" : "bg-card p-4 rounded-container shadow-sm border border-border"} ${props.className || ""}
|
|
6873
|
+
className: cn(`propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? "" : "bg-card p-4 rounded-container shadow-sm border border-border"} ${props.className || ""}`),
|
|
6847
6874
|
"data-bundle": isBundleItem() ? "true" : "false",
|
|
6848
6875
|
"data-loading": loading ? "true" : "false",
|
|
6849
6876
|
children: [
|
|
@@ -7315,7 +7342,7 @@ function CartIconAndSidebar(rawProps) {
|
|
|
7315
7342
|
type: "button",
|
|
7316
7343
|
onClick: () => handleIconClick(),
|
|
7317
7344
|
"aria-label": getLabel(props.labels, "cartIconLabel", "Shopping cart"),
|
|
7318
|
-
className: `propeller-cart-icon__trigger relative inline-flex items-center justify-center p-2 rounded-control transition-colors text-foreground${props.iconClassName ? " " + props.iconClassName : ""}
|
|
7345
|
+
className: cn(`propeller-cart-icon__trigger relative inline-flex items-center justify-center p-2 rounded-control transition-colors text-foreground${props.iconClassName ? " " + props.iconClassName : ""}`),
|
|
7319
7346
|
children: [
|
|
7320
7347
|
/* @__PURE__ */ jsx(
|
|
7321
7348
|
"svg",
|
|
@@ -7367,7 +7394,7 @@ function CartIconAndSidebar(rawProps) {
|
|
|
7367
7394
|
"aria-modal": "true",
|
|
7368
7395
|
"aria-label": sidebarTitle,
|
|
7369
7396
|
"data-open": sidebarOpen ? "true" : "false",
|
|
7370
|
-
className: `propeller-cart-icon__sidebar fixed inset-y-0 right-0 z-[70] w-full max-w-md bg-card shadow-2xl transform transition-transform duration-300 ease-in-out border-l border-border${sidebarOpen ? " translate-x-0" : " translate-x-full"}${props.sidebarClassName ? " " + props.sidebarClassName : ""}
|
|
7397
|
+
className: cn(`propeller-cart-icon__sidebar fixed inset-y-0 right-0 z-[70] w-full max-w-md bg-card shadow-2xl transform transition-transform duration-300 ease-in-out border-l border-border${sidebarOpen ? " translate-x-0" : " translate-x-full"}${props.sidebarClassName ? " " + props.sidebarClassName : ""}`),
|
|
7371
7398
|
children: /* @__PURE__ */ jsx("div", { className: "flex flex-col h-full", children: isMounted ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7372
7399
|
/* @__PURE__ */ jsxs("div", { className: "propeller-cart-icon__sidebar-header flex items-center justify-between px-5 py-4 border-b border-border", children: [
|
|
7373
7400
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -7999,7 +8026,7 @@ function CategoryDescription(props) {
|
|
|
7999
8026
|
return /* @__PURE__ */ jsx(Fragment, { children: !!html ? /* @__PURE__ */ jsxs(
|
|
8000
8027
|
"div",
|
|
8001
8028
|
{
|
|
8002
|
-
className: `propeller-category-description mb-6 ${props.className || ""}
|
|
8029
|
+
className: cn(`propeller-category-description mb-6 ${props.className || ""}`),
|
|
8003
8030
|
"data-expanded": expanded ? "true" : "false",
|
|
8004
8031
|
"data-truncatable": shouldTruncate ? "true" : "false",
|
|
8005
8032
|
children: [
|
|
@@ -8029,7 +8056,7 @@ function CategoryShortDescription(props) {
|
|
|
8029
8056
|
(d) => d.language === props.language
|
|
8030
8057
|
);
|
|
8031
8058
|
const html = match?.value || "";
|
|
8032
|
-
return /* @__PURE__ */ jsx(Fragment, { children: !!html ? /* @__PURE__ */ jsx("div", { className: `propeller-category-short-description mb-6 ${props.className || ""}
|
|
8059
|
+
return /* @__PURE__ */ jsx(Fragment, { children: !!html ? /* @__PURE__ */ jsx("div", { className: cn(`propeller-category-short-description mb-6 ${props.className || ""}`), children: /* @__PURE__ */ jsx(
|
|
8033
8060
|
"div",
|
|
8034
8061
|
{
|
|
8035
8062
|
className: "propeller-category-short-description__content prose prose-slate max-w-none text-muted-foreground",
|
|
@@ -8164,7 +8191,7 @@ function ClusterCard(rawProps) {
|
|
|
8164
8191
|
return /* @__PURE__ */ jsx(ClusterCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
8165
8192
|
"div",
|
|
8166
8193
|
{
|
|
8167
|
-
className: `propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className ?? ""}
|
|
8194
|
+
className: cn(`propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className ?? ""}`),
|
|
8168
8195
|
"data-cluster-id": cluster.clusterId,
|
|
8169
8196
|
"data-layout": isRow ? "row" : "grid",
|
|
8170
8197
|
children: rawProps.children
|
|
@@ -8174,7 +8201,7 @@ function ClusterCard(rawProps) {
|
|
|
8174
8201
|
return /* @__PURE__ */ jsx(ClusterCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
|
|
8175
8202
|
"div",
|
|
8176
8203
|
{
|
|
8177
|
-
className: `propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}
|
|
8204
|
+
className: cn(`propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`),
|
|
8178
8205
|
"data-layout": isRow ? "row" : "grid",
|
|
8179
8206
|
children: [
|
|
8180
8207
|
props.showImage !== false ? /* @__PURE__ */ jsx(ClusterCardImage, {}) : null,
|
|
@@ -8466,7 +8493,7 @@ function MachineCard(props) {
|
|
|
8466
8493
|
return /* @__PURE__ */ jsx(
|
|
8467
8494
|
"div",
|
|
8468
8495
|
{
|
|
8469
|
-
className: `propeller-machine-card group relative flex h-full flex-col overflow-hidden rounded-lg border border-border bg-background ${props.className ?? ""}
|
|
8496
|
+
className: cn(`propeller-machine-card group relative flex h-full flex-col overflow-hidden rounded-lg border border-border bg-background ${props.className ?? ""}`),
|
|
8470
8497
|
children: /* @__PURE__ */ jsxs(
|
|
8471
8498
|
"a",
|
|
8472
8499
|
{
|
|
@@ -8527,7 +8554,7 @@ function LoginToOrderButton(props) {
|
|
|
8527
8554
|
"button",
|
|
8528
8555
|
{
|
|
8529
8556
|
type: "button",
|
|
8530
|
-
className: `propeller-login-to-order inline-flex items-center justify-center gap-2 h-10 px-4 w-full rounded-control bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity ${props.className || ""}
|
|
8557
|
+
className: cn(`propeller-login-to-order inline-flex items-center justify-center gap-2 h-10 px-4 w-full rounded-control bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity ${props.className || ""}`),
|
|
8531
8558
|
onClick: () => {
|
|
8532
8559
|
if (props.onLoginClick) props.onLoginClick();
|
|
8533
8560
|
},
|
|
@@ -8588,7 +8615,7 @@ function ProductPriceDisplay(props) {
|
|
|
8588
8615
|
function getSecondaryTaxLabel() {
|
|
8589
8616
|
return props.includeTax ? getLabel(props.labels, "exclTax", "excl. VAT") : getLabel(props.labels, "inclTax", "incl. VAT");
|
|
8590
8617
|
}
|
|
8591
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-product-price ${props.className || ""}
|
|
8618
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-price ${props.className || ""}`), "data-hidden": isHidden2() ? "true" : "false", children: [
|
|
8592
8619
|
isHidden2() && props.showLoginPrompt !== false ? /* @__PURE__ */ jsx("p", { className: "propeller-product-price__login-prompt text-sm text-muted-foreground italic", children: getLabel(props.labels, "loginToSeePrices", "Log in to see prices") }) : null,
|
|
8593
8620
|
!isHidden2() && !!getLeadingPrice() ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-price__content flex flex-col gap-0.5", children: [
|
|
8594
8621
|
/* @__PURE__ */ jsxs("div", { className: "propeller-product-price__primary flex items-baseline gap-2", children: [
|
|
@@ -8735,7 +8762,7 @@ function ProductCardRoot(rawProps) {
|
|
|
8735
8762
|
return /* @__PURE__ */ jsx(ProductCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
8736
8763
|
"div",
|
|
8737
8764
|
{
|
|
8738
|
-
className: `propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}
|
|
8765
|
+
className: cn(`propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`),
|
|
8739
8766
|
"data-layout": isRow ? "row" : "grid",
|
|
8740
8767
|
children: rawProps.children
|
|
8741
8768
|
}
|
|
@@ -8744,7 +8771,7 @@ function ProductCardRoot(rawProps) {
|
|
|
8744
8771
|
return /* @__PURE__ */ jsx(ProductCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
|
|
8745
8772
|
"div",
|
|
8746
8773
|
{
|
|
8747
|
-
className: `propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}
|
|
8774
|
+
className: cn(`propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`),
|
|
8748
8775
|
"data-layout": isRow ? "row" : "grid",
|
|
8749
8776
|
children: [
|
|
8750
8777
|
props.showImage !== false ? /* @__PURE__ */ jsx(ProductCardImage, {}) : null,
|
|
@@ -9191,7 +9218,7 @@ function ProductGrid(rawProps) {
|
|
|
9191
9218
|
return /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: gridConfig, children: /* @__PURE__ */ jsx(ProductGridSearchContext.Provider, { value: compoundCtx, children: /* @__PURE__ */ jsx(
|
|
9192
9219
|
"div",
|
|
9193
9220
|
{
|
|
9194
|
-
className: `propeller-product-grid w-full ${props.className || ""}
|
|
9221
|
+
className: cn(`propeller-product-grid w-full ${props.className || ""}`),
|
|
9195
9222
|
"data-loading": getIsLoading() ? "true" : "false",
|
|
9196
9223
|
"data-mode": "compound",
|
|
9197
9224
|
children: rawProps.children
|
|
@@ -9201,7 +9228,7 @@ function ProductGrid(rawProps) {
|
|
|
9201
9228
|
return /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: gridConfig, children: /* @__PURE__ */ jsxs(
|
|
9202
9229
|
"div",
|
|
9203
9230
|
{
|
|
9204
|
-
className: `propeller-product-grid w-full ${props.className || ""}
|
|
9231
|
+
className: cn(`propeller-product-grid w-full ${props.className || ""}`),
|
|
9205
9232
|
"data-loading": getIsLoading() ? "true" : "false",
|
|
9206
9233
|
children: [
|
|
9207
9234
|
getIsLoading() ? /* @__PURE__ */ jsx("div", { className: `propeller-product-grid__skeleton-grid ${getGridColsClass()}`, children: getSkeletonItems()?.map((_, idx) => /* @__PURE__ */ jsxs(
|
|
@@ -9304,7 +9331,7 @@ function ProductGridItems(props) {
|
|
|
9304
9331
|
const gridClass = cols === 1 ? "flex flex-col gap-4" : cols === 2 ? "grid grid-cols-2 gap-3 sm:gap-6 auto-rows-fr" : cols === 4 ? "grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-6 auto-rows-fr" : cols === 5 ? "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 sm:gap-6 auto-rows-fr" : cols === 6 ? "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 sm:gap-6 auto-rows-fr" : "grid grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-6 auto-rows-fr";
|
|
9305
9332
|
if (isLoading) {
|
|
9306
9333
|
const skeletonCount = cols === 2 ? 4 : cols === 4 ? 8 : cols === 5 ? 10 : cols === 6 ? 12 : 6;
|
|
9307
|
-
return /* @__PURE__ */ jsx("div", { className: `propeller-product-grid__skeleton-grid ${gridClass} ${props.className ?? ""}
|
|
9334
|
+
return /* @__PURE__ */ jsx("div", { className: cn(`propeller-product-grid__skeleton-grid ${gridClass} ${props.className ?? ""}`), children: Array.from({ length: skeletonCount }).map((_, idx) => /* @__PURE__ */ jsxs(
|
|
9308
9335
|
"div",
|
|
9309
9336
|
{
|
|
9310
9337
|
className: "propeller-product-grid__skeleton-card flex flex-col overflow-hidden rounded-container border border-border bg-card shadow-sm",
|
|
@@ -9326,7 +9353,7 @@ function ProductGridItems(props) {
|
|
|
9326
9353
|
/* @__PURE__ */ jsx("p", { className: "propeller-product-grid__empty-message mt-1 text-sm text-muted-foreground", children: getLabel(props.labels, "noProductsHelp", "Try adjusting your filters or search term.") })
|
|
9327
9354
|
] }) });
|
|
9328
9355
|
}
|
|
9329
|
-
return /* @__PURE__ */ jsx("div", { className: `propeller-product-grid__grid ${gridClass} ${props.className ?? ""}
|
|
9356
|
+
return /* @__PURE__ */ jsx("div", { className: cn(`propeller-product-grid__grid ${gridClass} ${props.className ?? ""}`), children: items.map((item, idx) => {
|
|
9330
9357
|
const isCluster = "clusterId" in item && !!item.clusterId;
|
|
9331
9358
|
const key = item.productId || item.clusterId || idx;
|
|
9332
9359
|
return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
@@ -9587,7 +9614,7 @@ function GridFilters(rawProps) {
|
|
|
9587
9614
|
return /* @__PURE__ */ jsxs(
|
|
9588
9615
|
"div",
|
|
9589
9616
|
{
|
|
9590
|
-
className: `propeller-grid-filters space-y-4 ${props.isMobile ? "pb-8" : "sticky top-24"} ${isPending ? "opacity-50 pointer-events-none" : ""} ${props.className || ""}
|
|
9617
|
+
className: cn(`propeller-grid-filters space-y-4 ${props.isMobile ? "pb-8" : "sticky top-24"} ${isPending ? "opacity-50 pointer-events-none" : ""} ${props.className || ""}`),
|
|
9591
9618
|
"data-mobile": props.isMobile ? "true" : "false",
|
|
9592
9619
|
"data-pending": isPending ? "true" : "false",
|
|
9593
9620
|
children: [
|
|
@@ -10011,7 +10038,7 @@ function GridToolbar(rawProps) {
|
|
|
10011
10038
|
return /* @__PURE__ */ jsxs(
|
|
10012
10039
|
"div",
|
|
10013
10040
|
{
|
|
10014
|
-
className: `propeller-grid-toolbar ${props.className || ""}
|
|
10041
|
+
className: cn(`propeller-grid-toolbar ${props.className || ""}`),
|
|
10015
10042
|
"data-view-mode": currentViewMode,
|
|
10016
10043
|
children: [
|
|
10017
10044
|
/* @__PURE__ */ jsxs("div", { className: "propeller-grid-toolbar__bar flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-4", children: [
|
|
@@ -10250,7 +10277,7 @@ function GridPagination(props) {
|
|
|
10250
10277
|
return /* @__PURE__ */ jsx(
|
|
10251
10278
|
"div",
|
|
10252
10279
|
{
|
|
10253
|
-
className: `propeller-grid-pagination ${props.className || ""}
|
|
10280
|
+
className: cn(`propeller-grid-pagination ${props.className || ""}`),
|
|
10254
10281
|
"data-variant": variant,
|
|
10255
10282
|
children: showPagination ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10256
10283
|
variant === "compact" ? /* @__PURE__ */ jsxs("div", { className: "propeller-grid-pagination__compact flex justify-center items-center gap-2", children: [
|
|
@@ -10628,7 +10655,7 @@ function ClusterConfigurator(props) {
|
|
|
10628
10655
|
initFromProduct(props.defaultProduct);
|
|
10629
10656
|
}
|
|
10630
10657
|
}, []);
|
|
10631
|
-
return /* @__PURE__ */ jsx("div", { className: `propeller-cluster-configurator ${props.className || ""}
|
|
10658
|
+
return /* @__PURE__ */ jsx("div", { className: cn(`propeller-cluster-configurator ${props.className || ""}`), children: !!props.config?.settings?.length ? /* @__PURE__ */ jsx("div", { className: "propeller-cluster-configurator__content flex flex-col gap-6", children: settingsWithValues?.map((setting) => /* @__PURE__ */ jsxs(
|
|
10632
10659
|
"div",
|
|
10633
10660
|
{
|
|
10634
10661
|
className: "propeller-cluster-configurator__group",
|
|
@@ -10777,7 +10804,7 @@ function ClusterInfo(rawProps) {
|
|
|
10777
10804
|
props.onClusterLoaded(fetchedCluster);
|
|
10778
10805
|
}
|
|
10779
10806
|
}, [fetchedCluster]);
|
|
10780
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-cluster-info ${props.className || ""}
|
|
10807
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-cluster-info ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
|
|
10781
10808
|
loading && !props.cluster ? /* @__PURE__ */ jsxs("div", { className: "propeller-cluster-info__skeleton animate-pulse space-y-3", children: [
|
|
10782
10809
|
/* @__PURE__ */ jsx("div", { className: "propeller-cluster-info__skeleton-line h-4 bg-surface-hover rounded w-1/4" }),
|
|
10783
10810
|
/* @__PURE__ */ jsx("div", { className: "propeller-cluster-info__skeleton-line h-8 bg-surface-hover rounded w-3/4" })
|
|
@@ -10795,8 +10822,8 @@ var ClusterInfo_default = ClusterInfo;
|
|
|
10795
10822
|
function formatPrice9(price, currency) {
|
|
10796
10823
|
return formatPrice(price, { symbol: currency });
|
|
10797
10824
|
}
|
|
10798
|
-
function getProductName2(product) {
|
|
10799
|
-
return product.names
|
|
10825
|
+
function getProductName2(product, language) {
|
|
10826
|
+
return getLocalizedValue(product.names, language, `Product ${product.productId}`);
|
|
10800
10827
|
}
|
|
10801
10828
|
function getProductImageUrl4(product) {
|
|
10802
10829
|
const media = product.media;
|
|
@@ -10806,9 +10833,11 @@ function getProductImageUrl4(product) {
|
|
|
10806
10833
|
}
|
|
10807
10834
|
return "";
|
|
10808
10835
|
}
|
|
10809
|
-
function ClusterOptions(
|
|
10836
|
+
function ClusterOptions(rawProps) {
|
|
10837
|
+
const props = useInfraProps(rawProps);
|
|
10810
10838
|
const [selectedProductIds, setSelectedProductIds] = useState({});
|
|
10811
10839
|
function getOptionsForRender() {
|
|
10840
|
+
const language = props.language;
|
|
10812
10841
|
const options = props.options || [];
|
|
10813
10842
|
const sel = selectedProductIds;
|
|
10814
10843
|
const hidePrices = isContentHidden(props.portalMode, props.user);
|
|
@@ -10818,7 +10847,7 @@ function ClusterOptions(props) {
|
|
|
10818
10847
|
const products = (option.products || []).map((p) => ({
|
|
10819
10848
|
productId: p.productId,
|
|
10820
10849
|
productIdStr: p.productId.toString(),
|
|
10821
|
-
label: hidePrices ? getProductName2(p) : `${getProductName2(p)} \u2014 ${formatPrice9(p.price?.gross || 0, props.currency ?? "\u20AC")}`
|
|
10850
|
+
label: hidePrices ? getProductName2(p, language) : `${getProductName2(p, language)} \u2014 ${formatPrice9(p.price?.gross || 0, props.currency ?? "\u20AC")}`
|
|
10822
10851
|
}));
|
|
10823
10852
|
let previewImageUrl = "";
|
|
10824
10853
|
let previewName = "";
|
|
@@ -10829,7 +10858,7 @@ function ClusterOptions(props) {
|
|
|
10829
10858
|
);
|
|
10830
10859
|
if (selectedProduct) {
|
|
10831
10860
|
previewImageUrl = getProductImageUrl4(selectedProduct);
|
|
10832
|
-
previewName = getProductName2(selectedProduct);
|
|
10861
|
+
previewName = getProductName2(selectedProduct, language);
|
|
10833
10862
|
previewPrice = hidePrices ? "" : formatPrice9(selectedProduct.price?.gross || 0, props.currency ?? "\u20AC");
|
|
10834
10863
|
}
|
|
10835
10864
|
}
|
|
@@ -10837,7 +10866,7 @@ function ClusterOptions(props) {
|
|
|
10837
10866
|
return {
|
|
10838
10867
|
id: option.id,
|
|
10839
10868
|
idStr,
|
|
10840
|
-
name: option.names
|
|
10869
|
+
name: getLocalizedValue(option.names, language, `Option ${option.id}`),
|
|
10841
10870
|
isRequired,
|
|
10842
10871
|
selectedProductId,
|
|
10843
10872
|
hasSelection: !!selectedProductId,
|
|
@@ -10866,7 +10895,7 @@ function ClusterOptions(props) {
|
|
|
10866
10895
|
}
|
|
10867
10896
|
}
|
|
10868
10897
|
const renderedOptions = getOptionsForRender();
|
|
10869
|
-
return /* @__PURE__ */ jsx("div", { className: `propeller-cluster-options ${props.className || ""}
|
|
10898
|
+
return /* @__PURE__ */ jsx("div", { className: cn(`propeller-cluster-options ${props.className || ""}`), children: renderedOptions.length > 0 ? /* @__PURE__ */ jsx("div", { className: "propeller-cluster-options__content flex flex-col gap-6", children: renderedOptions.map((option) => /* @__PURE__ */ jsxs(
|
|
10870
10899
|
"div",
|
|
10871
10900
|
{
|
|
10872
10901
|
className: "propeller-cluster-options__group",
|
|
@@ -11305,7 +11334,8 @@ function FavoriteListItem(rawProps) {
|
|
|
11305
11334
|
const isProduct = "productId" in props.item;
|
|
11306
11335
|
const product = props.item;
|
|
11307
11336
|
const cluster = props.item;
|
|
11308
|
-
const
|
|
11337
|
+
const nameLanguage = props.language;
|
|
11338
|
+
const name = isProduct ? getLocalizedValue(product?.names, nameLanguage, "Product") : getLocalizedValue(cluster?.names, nameLanguage, "") || getLocalizedValue(cluster?.defaultProduct?.names, nameLanguage, "Cluster");
|
|
11309
11339
|
const sku = isProduct ? product?.sku || "" : cluster?.sku || cluster?.defaultProduct?.sku || "";
|
|
11310
11340
|
const imageUrl = isProduct ? product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "" : cluster?.defaultProduct?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "";
|
|
11311
11341
|
const itemUrl = isProduct ? props.configuration?.urls?.getProductUrl?.(props.item) || "" : props.configuration?.urls?.getClusterUrl?.(props.item) || "";
|
|
@@ -11358,7 +11388,7 @@ function FavoriteListItem(rawProps) {
|
|
|
11358
11388
|
{
|
|
11359
11389
|
onClick: (e) => handleItemClick(e),
|
|
11360
11390
|
"data-type": isProduct ? "product" : "cluster",
|
|
11361
|
-
className: `propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ""}
|
|
11391
|
+
className: cn(`propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ""}`),
|
|
11362
11392
|
children: rawProps.children
|
|
11363
11393
|
}
|
|
11364
11394
|
) });
|
|
@@ -11368,7 +11398,7 @@ function FavoriteListItem(rawProps) {
|
|
|
11368
11398
|
{
|
|
11369
11399
|
onClick: (e) => handleItemClick(e),
|
|
11370
11400
|
"data-type": isProduct ? "product" : "cluster",
|
|
11371
|
-
className: `propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ""}
|
|
11401
|
+
className: cn(`propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ""}`),
|
|
11372
11402
|
children: [
|
|
11373
11403
|
/* @__PURE__ */ jsx(FavoriteListItemImage, {}),
|
|
11374
11404
|
/* @__PURE__ */ jsxs("div", { className: "propeller-favorite-list-item__body flex flex-col gap-0.5 min-w-0 flex-1", children: [
|
|
@@ -11739,9 +11769,10 @@ function FavoriteListDetails(rawProps) {
|
|
|
11739
11769
|
}
|
|
11740
11770
|
}
|
|
11741
11771
|
function getSearchItemName(item) {
|
|
11742
|
-
|
|
11772
|
+
const language = props.language;
|
|
11773
|
+
if ("productId" in item) return getLocalizedValue(item.names, language, "Product");
|
|
11743
11774
|
const cluster = item;
|
|
11744
|
-
return cluster.names
|
|
11775
|
+
return getLocalizedValue(cluster.names, language, "") || getLocalizedValue(cluster.defaultProduct?.names, language, "Cluster");
|
|
11745
11776
|
}
|
|
11746
11777
|
function getSearchItemSku(item) {
|
|
11747
11778
|
if ("productId" in item) return item.sku || "";
|
|
@@ -11881,7 +11912,7 @@ function FavoriteListDetails(rawProps) {
|
|
|
11881
11912
|
fetchList();
|
|
11882
11913
|
}
|
|
11883
11914
|
}, [props.favoriteListId]);
|
|
11884
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-favorite-list-details ${props.className || ""}
|
|
11915
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-favorite-list-details ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
|
|
11885
11916
|
loading ? /* @__PURE__ */ jsx("div", { className: "propeller-favorite-list-details__skeleton space-y-4", children: [1, 2, 3]?.map((i) => /* @__PURE__ */ jsxs(
|
|
11886
11917
|
"div",
|
|
11887
11918
|
{
|
|
@@ -11984,7 +12015,7 @@ function FavoriteListDetails(rawProps) {
|
|
|
11984
12015
|
type: "button",
|
|
11985
12016
|
className: "propeller-favorite-list-details__add-btn inline-flex items-center justify-center rounded-control bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground transition-colors hover:bg-secondary/90",
|
|
11986
12017
|
onClick: () => setShowAddModal(true),
|
|
11987
|
-
children: getLabel(props.labels, "addProductDirectly", "Add product
|
|
12018
|
+
children: getLabel(props.labels, "addProductDirectly", "Add product to favorite list")
|
|
11988
12019
|
}
|
|
11989
12020
|
) }),
|
|
11990
12021
|
allItems.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "propeller-favorite-list-details__empty border border-border rounded-container p-12 text-center space-y-4", children: [
|
|
@@ -12326,7 +12357,7 @@ function FavoriteLists(rawProps) {
|
|
|
12326
12357
|
setNewSetAsDefault(false);
|
|
12327
12358
|
closeCreateModal();
|
|
12328
12359
|
}
|
|
12329
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-favorite-lists ${props.className || ""}
|
|
12360
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-favorite-lists ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
|
|
12330
12361
|
props.allowFavoriteListCreate !== false && !loading && displayedLists.length > 0 ? /* @__PURE__ */ jsx("div", { className: "propeller-favorite-lists__toolbar flex justify-end mb-4", children: /* @__PURE__ */ jsxs(
|
|
12331
12362
|
"button",
|
|
12332
12363
|
{
|
|
@@ -12849,7 +12880,7 @@ function ForgotPassword(rawProps) {
|
|
|
12849
12880
|
}
|
|
12850
12881
|
var ForgotPassword_default = ForgotPassword;
|
|
12851
12882
|
function GridTitle(props) {
|
|
12852
|
-
return /* @__PURE__ */ jsx("div", { className: `propeller-grid-title mb-8 ${props.className || ""}
|
|
12883
|
+
return /* @__PURE__ */ jsx("div", { className: cn(`propeller-grid-title mb-8 ${props.className || ""}`), children: /* @__PURE__ */ jsxs("div", { className: "propeller-grid-title__row flex items-baseline gap-3 mb-3", children: [
|
|
12853
12884
|
props.headingLevel === "h2" ? /* @__PURE__ */ jsx("h2", { className: "propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight", children: props.title }) : null,
|
|
12854
12885
|
props.headingLevel !== "h2" ? /* @__PURE__ */ jsx("h1", { className: "propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight", children: props.title }) : null
|
|
12855
12886
|
] }) });
|
|
@@ -12860,8 +12891,8 @@ function GridTitleWithProvider(rawProps) {
|
|
|
12860
12891
|
return /* @__PURE__ */ jsx(GridTitle_default, { ...props });
|
|
12861
12892
|
}
|
|
12862
12893
|
var GridTitleWithProvider_default = GridTitleWithProvider;
|
|
12863
|
-
function getItemName(item) {
|
|
12864
|
-
return item.product?.names
|
|
12894
|
+
function getItemName(item, language) {
|
|
12895
|
+
return getLocalizedValue(item.product?.names, language, "Product");
|
|
12865
12896
|
}
|
|
12866
12897
|
function getItemImageUrl(item) {
|
|
12867
12898
|
const url = item.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url;
|
|
@@ -12882,6 +12913,7 @@ function getBundleNonLeaders(item) {
|
|
|
12882
12913
|
}
|
|
12883
12914
|
function ItemsOverview(rawProps) {
|
|
12884
12915
|
const props = useInfraProps(rawProps);
|
|
12916
|
+
const language = props.language;
|
|
12885
12917
|
const useTax = !!props.includeTax;
|
|
12886
12918
|
const containerClass = props.itemsOverviewContainerClass || "cart-items-overview";
|
|
12887
12919
|
const itemNameClickable = props.itemNameClickable !== void 0 ? props.itemNameClickable : true;
|
|
@@ -12943,7 +12975,7 @@ function ItemsOverview(rawProps) {
|
|
|
12943
12975
|
{
|
|
12944
12976
|
className: "propeller-items-overview__item-image w-full h-full object-contain p-1.5",
|
|
12945
12977
|
src: getItemImageUrl(item),
|
|
12946
|
-
alt: getItemName(item)
|
|
12978
|
+
alt: getItemName(item, language)
|
|
12947
12979
|
}
|
|
12948
12980
|
) : /* @__PURE__ */ jsx(
|
|
12949
12981
|
"svg",
|
|
@@ -12971,7 +13003,7 @@ function ItemsOverview(rawProps) {
|
|
|
12971
13003
|
] }),
|
|
12972
13004
|
/* @__PURE__ */ jsxs("div", { className: "propeller-items-overview__item-bundle mt-1.5 space-y-1 border-l-2 border-secondary/10 pl-2", children: [
|
|
12973
13005
|
leader ? /* @__PURE__ */ jsxs("div", { className: "propeller-items-overview__item-bundle-leader flex justify-between items-center text-xs", children: [
|
|
12974
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: leader.product.names
|
|
13006
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: getLocalizedValue(leader.product.names, language, "Product") }),
|
|
12975
13007
|
money(bundlePrice(leader.price)) ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground whitespace-nowrap ml-2", children: money(bundlePrice(leader.price)) }) : null
|
|
12976
13008
|
] }) : null,
|
|
12977
13009
|
getBundleNonLeaders(item).map((bundleItem, idx) => /* @__PURE__ */ jsxs(
|
|
@@ -12979,7 +13011,7 @@ function ItemsOverview(rawProps) {
|
|
|
12979
13011
|
{
|
|
12980
13012
|
className: "propeller-items-overview__item-bundle-item flex justify-between items-center text-xs text-muted-foreground",
|
|
12981
13013
|
children: [
|
|
12982
|
-
/* @__PURE__ */ jsx("span", { className: "line-clamp-1", children: bundleItem.product?.names
|
|
13014
|
+
/* @__PURE__ */ jsx("span", { className: "line-clamp-1", children: getLocalizedValue(bundleItem.product?.names, language, "Product") }),
|
|
12983
13015
|
money(bundlePrice(bundleItem.price)) ? /* @__PURE__ */ jsx("span", { className: "text-foreground-subtle whitespace-nowrap ml-2", children: money(bundlePrice(bundleItem.price)) }) : null
|
|
12984
13016
|
]
|
|
12985
13017
|
},
|
|
@@ -13000,9 +13032,9 @@ function ItemsOverview(rawProps) {
|
|
|
13000
13032
|
{
|
|
13001
13033
|
className: "propeller-items-overview__item-title font-medium text-sm leading-tight cursor-pointer hover:text-secondary transition-colors line-clamp-2",
|
|
13002
13034
|
onClick: () => handleItemNameClick(item),
|
|
13003
|
-
children: getItemName(item)
|
|
13035
|
+
children: getItemName(item, language)
|
|
13004
13036
|
}
|
|
13005
|
-
) : /* @__PURE__ */ jsx("p", { className: "propeller-items-overview__item-title font-medium text-sm leading-tight line-clamp-2", children: getItemName(item) }),
|
|
13037
|
+
) : /* @__PURE__ */ jsx("p", { className: "propeller-items-overview__item-title font-medium text-sm leading-tight line-clamp-2", children: getItemName(item, language) }),
|
|
13006
13038
|
showPrice ? /* @__PURE__ */ jsx("span", { className: "propeller-items-overview__item-price font-semibold text-sm text-foreground whitespace-nowrap", children: formatItemPrice(lineTotal(item)) }) : null
|
|
13007
13039
|
] }),
|
|
13008
13040
|
showSku && itemSku ? /* @__PURE__ */ jsxs("p", { className: "propeller-items-overview__item-sku text-xs text-muted-foreground mt-0.5", children: [
|
|
@@ -13018,7 +13050,7 @@ function ItemsOverview(rawProps) {
|
|
|
13018
13050
|
{
|
|
13019
13051
|
className: "propeller-items-overview__item-option flex justify-between items-center text-xs text-muted-foreground",
|
|
13020
13052
|
children: [
|
|
13021
|
-
/* @__PURE__ */ jsx("span", { className: "line-clamp-1", children: child.product?.names
|
|
13053
|
+
/* @__PURE__ */ jsx("span", { className: "line-clamp-1", children: getLocalizedValue(child.product?.names, language, "Option") }),
|
|
13022
13054
|
/* @__PURE__ */ jsx("span", { className: "text-foreground-subtle whitespace-nowrap ml-2", children: formatItemPrice(lineTotal(child)) })
|
|
13023
13055
|
]
|
|
13024
13056
|
},
|
|
@@ -13255,7 +13287,7 @@ function Menu(rawProps) {
|
|
|
13255
13287
|
return /* @__PURE__ */ jsx(
|
|
13256
13288
|
"div",
|
|
13257
13289
|
{
|
|
13258
|
-
className: `propeller-menu ${props.className || ""}
|
|
13290
|
+
className: cn(`propeller-menu ${props.className || ""}`),
|
|
13259
13291
|
"data-variant": props.menuStyle || "custom",
|
|
13260
13292
|
"data-loading": isLoading ? "true" : "false",
|
|
13261
13293
|
children: customMenu
|
|
@@ -13265,7 +13297,7 @@ function Menu(rawProps) {
|
|
|
13265
13297
|
return /* @__PURE__ */ jsxs(
|
|
13266
13298
|
"div",
|
|
13267
13299
|
{
|
|
13268
|
-
className: `propeller-menu ${props.className || ""}
|
|
13300
|
+
className: cn(`propeller-menu ${props.className || ""}`),
|
|
13269
13301
|
"data-variant": getMenuStyle(),
|
|
13270
13302
|
"data-loading": isLoading ? "true" : "false",
|
|
13271
13303
|
children: [
|
|
@@ -13411,7 +13443,7 @@ function OrderActions(rawProps) {
|
|
|
13411
13443
|
// (the bug screenshot showed "Order / confirmation / (PDF)" on three lines).
|
|
13412
13444
|
// `whitespace-nowrap` on the buttons is the belt-and-braces guarantee that
|
|
13413
13445
|
// text never wraps even in narrow containers without flex sizing.
|
|
13414
|
-
/* @__PURE__ */ jsxs("div", { className: `propeller-order-actions flex-shrink-0 ${props.className || ""}
|
|
13446
|
+
/* @__PURE__ */ jsxs("div", { className: cn(`propeller-order-actions flex-shrink-0 ${props.className || ""}`), children: [
|
|
13415
13447
|
/* @__PURE__ */ jsxs("div", { className: "propeller-order-actions__actions flex flex-row items-center gap-3 flex-shrink-0", children: [
|
|
13416
13448
|
/* @__PURE__ */ jsxs(
|
|
13417
13449
|
"button",
|
|
@@ -13496,22 +13528,22 @@ function OrderActions(rawProps) {
|
|
|
13496
13528
|
);
|
|
13497
13529
|
}
|
|
13498
13530
|
var OrderActions_default = OrderActions;
|
|
13499
|
-
function getProductName3(orderItem) {
|
|
13500
|
-
return orderItem?.product?.names
|
|
13531
|
+
function getProductName3(orderItem, language) {
|
|
13532
|
+
return getLocalizedValue(orderItem?.product?.names, language, "") || orderItem?.name || "Unknown Product";
|
|
13501
13533
|
}
|
|
13502
|
-
function getClusterUrl(orderItem) {
|
|
13534
|
+
function getClusterUrl(orderItem, language) {
|
|
13503
13535
|
const cluster = orderItem?.product?.cluster;
|
|
13504
13536
|
if (!cluster) return "";
|
|
13505
13537
|
const id = cluster.clusterId;
|
|
13506
|
-
const slug = cluster.slugs
|
|
13538
|
+
const slug = getLocalizedValue(cluster.slugs, language, "");
|
|
13507
13539
|
if (!id || !slug) return "";
|
|
13508
13540
|
return `/cluster/${id}/${slug}`;
|
|
13509
13541
|
}
|
|
13510
|
-
function getProductUrl(orderItem) {
|
|
13511
|
-
const cu = getClusterUrl(orderItem);
|
|
13542
|
+
function getProductUrl(orderItem, language) {
|
|
13543
|
+
const cu = getClusterUrl(orderItem, language);
|
|
13512
13544
|
if (cu) return cu;
|
|
13513
13545
|
const id = orderItem?.product?.productId;
|
|
13514
|
-
const slug = orderItem?.product?.slugs
|
|
13546
|
+
const slug = getLocalizedValue(orderItem?.product?.slugs, language, "");
|
|
13515
13547
|
if (id && slug) return `/product/${id}/${slug}`;
|
|
13516
13548
|
return "";
|
|
13517
13549
|
}
|
|
@@ -13526,10 +13558,10 @@ function OrderItemCard(props) {
|
|
|
13526
13558
|
const showDiscount = props.showDiscount !== void 0 ? props.showDiscount : false;
|
|
13527
13559
|
const showStockComponent = props.showStockComponent !== void 0 ? props.showStockComponent : false;
|
|
13528
13560
|
const showItemNotes = props.showItemNotes !== void 0 ? props.showItemNotes : false;
|
|
13529
|
-
const productName = getProductName3(item);
|
|
13561
|
+
const productName = getProductName3(item, props.language);
|
|
13530
13562
|
const productSku = item?.product?.sku || item?.sku || "";
|
|
13531
13563
|
const productImage = item?.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "";
|
|
13532
|
-
const productUrl = getProductUrl(item);
|
|
13564
|
+
const productUrl = getProductUrl(item, props.language);
|
|
13533
13565
|
const quantity = item?.quantity || 0;
|
|
13534
13566
|
const priceTotal = item?.priceTotal || 0;
|
|
13535
13567
|
const discount = item?.discount || 0;
|
|
@@ -13644,7 +13676,7 @@ function OrderItemCard(props) {
|
|
|
13644
13676
|
className: "propeller-order-item-card__child-row border-0",
|
|
13645
13677
|
"data-child": "true",
|
|
13646
13678
|
children: [
|
|
13647
|
-
/* @__PURE__ */ jsx("td", { className: "propeller-order-item-card__cell propeller-order-item-card__cell--product px-6 py-2 pl-28", children: /* @__PURE__ */ jsx("span", { className: "propeller-order-item-card__child-title text-sm text-muted-foreground", children: child.product?.names
|
|
13679
|
+
/* @__PURE__ */ jsx("td", { className: "propeller-order-item-card__cell propeller-order-item-card__cell--product px-6 py-2 pl-28", children: /* @__PURE__ */ jsx("span", { className: "propeller-order-item-card__child-title text-sm text-muted-foreground", children: getLocalizedValue(child.product?.names, props.language, "") || child.name || "Unknown" }) }),
|
|
13648
13680
|
showQuantity ? /* @__PURE__ */ jsx("td", { className: "propeller-order-item-card__cell propeller-order-item-card__cell--quantity px-6 py-2 text-center text-sm text-muted-foreground", children: child.quantity || 0 }) : null,
|
|
13649
13681
|
showDiscount ? /* @__PURE__ */ jsx("td", { className: "propeller-order-item-card__cell propeller-order-item-card__cell--discount px-6 py-2 text-right text-sm text-muted-foreground" }) : null,
|
|
13650
13682
|
showPrice ? /* @__PURE__ */ jsx("td", { className: "propeller-order-item-card__cell propeller-order-item-card__cell--price px-6 py-2 text-right whitespace-nowrap text-sm text-muted-foreground", children: formatItemPrice(child.priceTotal || 0) }) : null
|
|
@@ -13661,14 +13693,15 @@ function OrderBonusItems(rawProps) {
|
|
|
13661
13693
|
const bonusItems = getNettedBonusItems(allItems);
|
|
13662
13694
|
if (bonusItems.length === 0) return null;
|
|
13663
13695
|
const OrderItemCardImpl = props.orderItemCardComponent ?? OrderItemCard_default;
|
|
13664
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-order-bonus-items ${props.className || "mb-8"}
|
|
13696
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-order-bonus-items ${props.className || "mb-8"}`), children: [
|
|
13665
13697
|
/* @__PURE__ */ jsx("h3", { className: "propeller-order-bonus-items__title text-lg font-bold mb-3 text-foreground", children: getLabel(props.labels, "title", "Bonus items") }),
|
|
13666
13698
|
/* @__PURE__ */ jsx("div", { className: "propeller-order-bonus-items__table bg-card rounded-container shadow overflow-hidden", children: /* @__PURE__ */ jsx("table", { className: "w-full", children: bonusItems.map((item) => /* @__PURE__ */ jsx(
|
|
13667
13699
|
OrderItemCardImpl,
|
|
13668
13700
|
{
|
|
13669
13701
|
orderItem: item,
|
|
13670
13702
|
titleLinkable: false,
|
|
13671
|
-
currency: props.currency
|
|
13703
|
+
currency: props.currency,
|
|
13704
|
+
language: props.language
|
|
13672
13705
|
},
|
|
13673
13706
|
item.id
|
|
13674
13707
|
)) }) })
|
|
@@ -13750,7 +13783,7 @@ function OrderList(rawProps) {
|
|
|
13750
13783
|
}
|
|
13751
13784
|
return fields;
|
|
13752
13785
|
}
|
|
13753
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-order-list ${props.className || ""}
|
|
13786
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-order-list ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
|
|
13754
13787
|
props.enableSearch && searchFields().length > 0 ? /* @__PURE__ */ jsxs("div", { className: "propeller-order-list__filters mb-6 bg-card p-4 rounded-container shadow space-y-4", children: [
|
|
13755
13788
|
searchFields().includes("term") ? /* @__PURE__ */ jsxs("div", { className: "propeller-order-list__search-field w-full", children: [
|
|
13756
13789
|
/* @__PURE__ */ jsx("label", { className: "propeller-order-list__filter-label block text-sm font-medium text-muted-foreground capitalize mb-1", children: getColumnLabel("term") }),
|
|
@@ -14340,6 +14373,7 @@ function QuickOrderInner(props) {
|
|
|
14340
14373
|
target: "_blank",
|
|
14341
14374
|
rel: "noopener nofollow",
|
|
14342
14375
|
className: "text-primary hover:underline text-sm inline-block mb-4",
|
|
14376
|
+
onClick: () => props.onTemplateDownload?.(),
|
|
14343
14377
|
children: L("downloadTemplate", "Download XLSX template")
|
|
14344
14378
|
}
|
|
14345
14379
|
) : null,
|
|
@@ -14503,7 +14537,7 @@ function OrderShipments(props) {
|
|
|
14503
14537
|
const code = tat.code || "";
|
|
14504
14538
|
return `${baseUrl}${code}`;
|
|
14505
14539
|
}
|
|
14506
|
-
return /* @__PURE__ */ jsxs("div", { className: `order-shipments ${props.className || ""}
|
|
14540
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`order-shipments ${props.className || ""}`), children: [
|
|
14507
14541
|
shipments.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
14508
14542
|
/* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold", children: getLabel(props.labels, "title", "Shipping details") }),
|
|
14509
14543
|
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto rounded-lg border border-border bg-card shadow-sm", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
|
|
@@ -14904,7 +14938,7 @@ function PriceToggle(props) {
|
|
|
14904
14938
|
return /* @__PURE__ */ jsxs(
|
|
14905
14939
|
"div",
|
|
14906
14940
|
{
|
|
14907
|
-
className: `propeller-price-toggle flex items-center gap-2 ${props.className || ""}
|
|
14941
|
+
className: cn(`propeller-price-toggle flex items-center gap-2 ${props.className || ""}`),
|
|
14908
14942
|
"data-state": isOn ? "on" : "off",
|
|
14909
14943
|
children: [
|
|
14910
14944
|
/* @__PURE__ */ jsx("span", { className: "propeller-price-toggle__label hidden sm:inline text-xs", children: label }),
|
|
@@ -14996,7 +15030,7 @@ function ProductBulkPrices(props) {
|
|
|
14996
15030
|
return /* @__PURE__ */ jsx(Fragment, { children: !isHidden2 && hasItems ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
14997
15031
|
"div",
|
|
14998
15032
|
{
|
|
14999
|
-
className: `propeller-product-bulk-prices ${props.className || ""}
|
|
15033
|
+
className: cn(`propeller-product-bulk-prices ${props.className || ""}`),
|
|
15000
15034
|
"data-include-tax": includeTax ? "true" : "false",
|
|
15001
15035
|
children: [
|
|
15002
15036
|
getLabel(props.labels, "title", "Volume pricing") ? /* @__PURE__ */ jsx("h3", { className: "propeller-product-bulk-prices__title text-base font-semibold text-foreground mb-3", children: getLabel(props.labels, "title", "Volume pricing") }) : null,
|
|
@@ -15039,11 +15073,12 @@ function getItemPrice(item, includeTax) {
|
|
|
15039
15073
|
function getProductImage(product) {
|
|
15040
15074
|
return product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "";
|
|
15041
15075
|
}
|
|
15042
|
-
function getProductName4(product) {
|
|
15043
|
-
return product?.names
|
|
15076
|
+
function getProductName4(product, language) {
|
|
15077
|
+
return getLocalizedValue(product?.names, language, "");
|
|
15044
15078
|
}
|
|
15045
15079
|
function ProductBundles(rawProps) {
|
|
15046
15080
|
const props = useInfraProps(rawProps);
|
|
15081
|
+
const language = props.language;
|
|
15047
15082
|
const currencySymbol = props.currency ?? "\u20AC";
|
|
15048
15083
|
const money = (value) => formatPrice(value, { symbol: currencySymbol });
|
|
15049
15084
|
const [isMounted, setIsMounted] = useState(false);
|
|
@@ -15142,7 +15177,7 @@ function ProductBundles(rawProps) {
|
|
|
15142
15177
|
useEffect(() => {
|
|
15143
15178
|
fetchBundles(props.productId);
|
|
15144
15179
|
}, [props.productId]);
|
|
15145
|
-
return /* @__PURE__ */ jsx(Fragment, { children: isMounted && !isLoading && bundles.length > 0 ? /* @__PURE__ */ jsxs("div", { className: `propeller-product-bundles ${props.className || "mb-12"}
|
|
15180
|
+
return /* @__PURE__ */ jsx(Fragment, { children: isMounted && !isLoading && bundles.length > 0 ? /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-bundles ${props.className || "mb-12"}`), children: [
|
|
15146
15181
|
bundles.map((bundle, bundleIdx) => {
|
|
15147
15182
|
const bundlePrice = getBundlePrice(bundle, includeTax);
|
|
15148
15183
|
const originalPrice = getOriginalPrice(bundle, includeTax);
|
|
@@ -15182,10 +15217,10 @@ function ProductBundles(rawProps) {
|
|
|
15182
15217
|
{
|
|
15183
15218
|
className: "propeller-product-bundles__item-image w-full h-full object-contain p-2",
|
|
15184
15219
|
src: getProductImage(item.product),
|
|
15185
|
-
alt: getProductName4(item.product)
|
|
15220
|
+
alt: getProductName4(item.product, language)
|
|
15186
15221
|
}
|
|
15187
15222
|
) : null }),
|
|
15188
|
-
/* @__PURE__ */ jsx("div", { className: "propeller-product-bundles__item-name text-sm font-medium text-muted-foreground leading-tight mb-1", children: getProductName4(item.product) || "Product " + item.productId }),
|
|
15223
|
+
/* @__PURE__ */ jsx("div", { className: "propeller-product-bundles__item-name text-sm font-medium text-muted-foreground leading-tight mb-1", children: getProductName4(item.product, language) || "Product " + item.productId }),
|
|
15189
15224
|
!hidePrices && item.price ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-bundles__item-price text-sm font-semibold text-foreground", children: [
|
|
15190
15225
|
money(getItemPrice(item, includeTax)),
|
|
15191
15226
|
/* @__PURE__ */ jsx("span", { className: "text-xs font-normal text-muted-foreground ml-1", children: includeTax ? getLabel(props.labels, "inclTax", "incl. VAT") : getLabel(props.labels, "exclTax", "excl. VAT") })
|
|
@@ -15385,7 +15420,7 @@ function ProductBundles(rawProps) {
|
|
|
15385
15420
|
{
|
|
15386
15421
|
className: "propeller-product-bundles__modal-child flex justify-between items-center text-xs text-muted-foreground",
|
|
15387
15422
|
children: [
|
|
15388
|
-
/* @__PURE__ */ jsx("span", { className: "line-clamp-1", children: getProductName4(item.product) || "Product" }),
|
|
15423
|
+
/* @__PURE__ */ jsx("span", { className: "line-clamp-1", children: getProductName4(item.product, language) || "Product" }),
|
|
15389
15424
|
!hidePrices && item.price ? /* @__PURE__ */ jsx("span", { className: "text-foreground-subtle whitespace-nowrap ml-2", children: money(getItemPrice(item, includeTax)) }) : null
|
|
15390
15425
|
]
|
|
15391
15426
|
},
|
|
@@ -15441,7 +15476,7 @@ function ProductDescription(props) {
|
|
|
15441
15476
|
return /* @__PURE__ */ jsx(Fragment, { children: !!html ? /* @__PURE__ */ jsxs(
|
|
15442
15477
|
"div",
|
|
15443
15478
|
{
|
|
15444
|
-
className: `propeller-product-description ${props.className || ""}
|
|
15479
|
+
className: cn(`propeller-product-description ${props.className || ""}`),
|
|
15445
15480
|
"data-expanded": expanded ? "true" : "false",
|
|
15446
15481
|
"data-truncatable": shouldTruncate ? "true" : "false",
|
|
15447
15482
|
children: [
|
|
@@ -15480,7 +15515,7 @@ function ProductDownloads(props) {
|
|
|
15480
15515
|
const match = alts.find((a) => a.language === lang);
|
|
15481
15516
|
return match?.value || alts?.[0]?.value || "Download";
|
|
15482
15517
|
}
|
|
15483
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-product-downloads ${props.className || ""}
|
|
15518
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-downloads ${props.className || ""}`), children: [
|
|
15484
15519
|
hasItems ? /* @__PURE__ */ jsx("h3", { className: "propeller-product-downloads__title text-base font-semibold text-foreground mb-3", children: getLabel(props.labels, "title", "Downloads") }) : null,
|
|
15485
15520
|
hasItems ? /* @__PURE__ */ jsx("ul", { className: "propeller-product-downloads__list space-y-2", children: items.map((doc, index) => /* @__PURE__ */ jsx("li", { className: "propeller-product-downloads__item", children: !!getDocumentUrl(doc) ? /* @__PURE__ */ jsxs(
|
|
15486
15521
|
"a",
|
|
@@ -15551,7 +15586,7 @@ function ProductGallery(props) {
|
|
|
15551
15586
|
if (images.length === 0) return;
|
|
15552
15587
|
setSelectedIndex((idx) => (idx + 1) % images.length);
|
|
15553
15588
|
}
|
|
15554
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-product-gallery ${props.className || ""}
|
|
15589
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-gallery ${props.className || ""}`), children: [
|
|
15555
15590
|
/* @__PURE__ */ jsxs("div", { className: "propeller-product-gallery__stage relative aspect-square bg-card overflow-hidden", children: [
|
|
15556
15591
|
images.length === 0 ? /* @__PURE__ */ jsx("div", { className: "propeller-product-gallery__empty flex h-full w-full items-center justify-center bg-surface-hover", children: /* @__PURE__ */ jsx(
|
|
15557
15592
|
"svg",
|
|
@@ -15886,13 +15921,13 @@ function ProductInfo(rawProps) {
|
|
|
15886
15921
|
}
|
|
15887
15922
|
};
|
|
15888
15923
|
if (rawProps.children !== void 0) {
|
|
15889
|
-
return /* @__PURE__ */ jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxs("div", { className: `propeller-product-info ${props.className || ""}
|
|
15924
|
+
return /* @__PURE__ */ jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), children: [
|
|
15890
15925
|
props.beforeContent ? props.beforeContent(product) : null,
|
|
15891
15926
|
rawProps.children,
|
|
15892
15927
|
props.afterContent ? props.afterContent(product) : null
|
|
15893
15928
|
] }) }) });
|
|
15894
15929
|
}
|
|
15895
|
-
return /* @__PURE__ */ jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxs("div", { className: `propeller-product-info ${props.className || ""}
|
|
15930
|
+
return /* @__PURE__ */ jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), children: [
|
|
15896
15931
|
props.beforeContent ? props.beforeContent(product) : null,
|
|
15897
15932
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
15898
15933
|
/* @__PURE__ */ jsxs("div", { className: "propeller-product-info__media relative", children: [
|
|
@@ -15914,7 +15949,7 @@ function ProductInfo(rawProps) {
|
|
|
15914
15949
|
props.afterContent ? props.afterContent(product) : null
|
|
15915
15950
|
] }) }) });
|
|
15916
15951
|
}
|
|
15917
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-product-info ${props.className || ""}
|
|
15952
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
|
|
15918
15953
|
loading && !props.product ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-info__skeleton animate-pulse space-y-3", children: [
|
|
15919
15954
|
/* @__PURE__ */ jsx("div", { className: "propeller-product-info__skeleton-line h-4 bg-surface-hover rounded w-1/4" }),
|
|
15920
15955
|
/* @__PURE__ */ jsx("div", { className: "propeller-product-info__skeleton-line h-8 bg-surface-hover rounded w-3/4" })
|
|
@@ -16190,7 +16225,7 @@ function ProductShortDescription(props) {
|
|
|
16190
16225
|
"div",
|
|
16191
16226
|
{
|
|
16192
16227
|
dangerouslySetInnerHTML: { __html: html },
|
|
16193
|
-
className: `propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ""}`
|
|
16228
|
+
className: cn(`propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ""}`)
|
|
16194
16229
|
}
|
|
16195
16230
|
) : null });
|
|
16196
16231
|
}
|
|
@@ -16357,7 +16392,7 @@ function ProductSlider(rawProps) {
|
|
|
16357
16392
|
}, [sliderId, items().length]);
|
|
16358
16393
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16359
16394
|
" ",
|
|
16360
|
-
!(isCrossUpsellMode() && !isLoading && items().length === 0) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: `propeller-product-slider ${props.containerClassName || "mb-12"}
|
|
16395
|
+
!(isCrossUpsellMode() && !isLoading && items().length === 0) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-slider ${props.containerClassName || "mb-12"}`), "data-loading": isLoading ? "true" : "false", children: [
|
|
16361
16396
|
sliderTitle() || items().length > 0 ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-slider__header flex items-center justify-between mb-6", children: [
|
|
16362
16397
|
sliderTitle() ? /* @__PURE__ */ jsx("h2", { className: "propeller-product-slider__title text-2xl font-bold", children: sliderTitle() }) : null,
|
|
16363
16398
|
items().length > desktopCount() ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-slider__nav flex gap-2", children: [
|
|
@@ -16545,7 +16580,7 @@ function ProductSpecifications(rawProps) {
|
|
|
16545
16580
|
return /* @__PURE__ */ jsx(Fragment, { children: !loading && (hasPublicAttributes() || props.packageDescription || hasSlotContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
16546
16581
|
"div",
|
|
16547
16582
|
{
|
|
16548
|
-
className: `propeller-product-specifications ${props.className || ""}
|
|
16583
|
+
className: cn(`propeller-product-specifications ${props.className || ""}`),
|
|
16549
16584
|
"data-layout": props.layout === "list" ? "list" : "table",
|
|
16550
16585
|
"data-grouped": props.grouping ? "true" : "false",
|
|
16551
16586
|
children: [
|
|
@@ -16626,7 +16661,7 @@ function ProductVideos(props) {
|
|
|
16626
16661
|
}
|
|
16627
16662
|
return uri;
|
|
16628
16663
|
}
|
|
16629
|
-
return /* @__PURE__ */ jsxs("div", { className: `propeller-product-videos ${props.className || ""}
|
|
16664
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-videos ${props.className || ""}`), children: [
|
|
16630
16665
|
hasItems ? /* @__PURE__ */ jsx("h3", { className: "propeller-product-videos__title text-base font-semibold text-foreground mb-3", children: getLabel(props.labels, "title", "Videos") }) : null,
|
|
16631
16666
|
hasItems ? /* @__PURE__ */ jsx("div", { className: "propeller-product-videos__list space-y-4", children: items.map((video, index) => /* @__PURE__ */ jsx(
|
|
16632
16667
|
"div",
|
|
@@ -16724,7 +16759,7 @@ function ProductTabs(rawProps) {
|
|
|
16724
16759
|
return /* @__PURE__ */ jsx(Fragment, { children: props.product ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
16725
16760
|
"div",
|
|
16726
16761
|
{
|
|
16727
|
-
className: `propeller-product-tabs ${props.className || ""}
|
|
16762
|
+
className: cn(`propeller-product-tabs ${props.className || ""}`),
|
|
16728
16763
|
"data-active-tab": activeTab,
|
|
16729
16764
|
children: [
|
|
16730
16765
|
/* @__PURE__ */ jsxs("div", { className: "propeller-product-tabs__desktop hidden md:block", children: [
|
|
@@ -17030,7 +17065,7 @@ function PurchaseAuthorizationConfigurator(rawProps) {
|
|
|
17030
17065
|
onPurchaseAuthorizationDelete: props.onPurchaseAuthorizationDelete,
|
|
17031
17066
|
afterPurchaseAuthorizationDelete: props.afterPurchaseAuthorizationDelete
|
|
17032
17067
|
});
|
|
17033
|
-
return /* @__PURE__ */ jsx("div", { className: `propeller-purchase-authorization-configurator ${props.className || ""}
|
|
17068
|
+
return /* @__PURE__ */ jsx("div", { className: cn(`propeller-purchase-authorization-configurator ${props.className || ""}`), children: isAuthManager ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17034
17069
|
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
17035
17070
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
17036
17071
|
/* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold", children: getLabel(props.labels, "title", "Purchase Authorization Settings") }),
|
|
@@ -17397,7 +17432,7 @@ function PurchaseAuthorizationRequests(rawProps) {
|
|
|
17397
17432
|
if (fromBundle) return fromBundle;
|
|
17398
17433
|
return item?.product?.sku || "";
|
|
17399
17434
|
}
|
|
17400
|
-
return /* @__PURE__ */ jsx("div", { className: `propeller-purchase-authorization-requests ${props.className || ""}
|
|
17435
|
+
return /* @__PURE__ */ jsx("div", { className: cn(`propeller-purchase-authorization-requests ${props.className || ""}`), children: isAuthManager ? /* @__PURE__ */ jsxs("div", { className: "propeller-purchase-authorization-requests__content space-y-4", children: [
|
|
17401
17436
|
!props.hideTitle ? /* @__PURE__ */ jsx("h2", { className: "propeller-purchase-authorization-requests__title text-xl font-semibold", children: getLabel(props.labels, "title", "Authorization Requests") }) : null,
|
|
17402
17437
|
loading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx("div", { className: "w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin" }) }) : null,
|
|
17403
17438
|
!loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -18600,7 +18635,7 @@ function mapToSearchBarResult(item, language) {
|
|
|
18600
18635
|
const isCluster = "clusterId" in item;
|
|
18601
18636
|
const displayItem = isCluster ? item.defaultProduct : item;
|
|
18602
18637
|
const id = isCluster ? item.clusterId : item.productId;
|
|
18603
|
-
const slug = item.slugs
|
|
18638
|
+
const slug = getLocalizedValue(item.slugs, language, "");
|
|
18604
18639
|
const url = isCluster ? "/cluster/" + id + "/" + slug : "/product/" + id + "/" + slug;
|
|
18605
18640
|
const priceNet = displayItem?.price?.net || 0;
|
|
18606
18641
|
const priceGross = displayItem?.price?.gross || 0;
|
|
@@ -18717,7 +18752,7 @@ function SearchBar(rawProps) {
|
|
|
18717
18752
|
{
|
|
18718
18753
|
ref: containerRef,
|
|
18719
18754
|
"data-search-bar": true,
|
|
18720
|
-
className: `propeller-search-bar ${props.containerClassName || "relative flex-1 max-w-2xl mx-8"}
|
|
18755
|
+
className: cn(`propeller-search-bar ${props.containerClassName || "relative flex-1 max-w-2xl mx-8"}`),
|
|
18721
18756
|
"data-open": showDropdown ? "true" : "false",
|
|
18722
18757
|
children: [
|
|
18723
18758
|
/* @__PURE__ */ jsx("form", { className: "propeller-search-bar__form", onSubmit: (e) => handleSubmit(e), children: /* @__PURE__ */ jsxs("div", { className: "propeller-search-bar__input-wrapper relative", children: [
|