@propeller-commerce/propeller-v2-react-ui 0.4.22 → 0.4.24
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 +42 -0
- package/dist/index.cjs +65 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -2
- package/dist/index.d.ts +45 -2
- package/dist/index.js +65 -29
- package/dist/index.js.map +1 -1
- package/dist/pure.cjs +9 -10
- package/dist/pure.cjs.map +1 -1
- package/dist/pure.js +9 -10
- package/dist/pure.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3051,6 +3051,12 @@ interface CartIconAndSidebarProps {
|
|
|
3051
3051
|
* continueShopping, qty, total, checkoutButton, cartPageButton, closeLabel
|
|
3052
3052
|
*/
|
|
3053
3053
|
labels?: Record<string, string>;
|
|
3054
|
+
/**
|
|
3055
|
+
* Labels forwarded to the inner CartItem rows (e.g. `qtyPrefix`). Without
|
|
3056
|
+
* this the sidebar's line items fell back to English ("Qty:") even on a
|
|
3057
|
+
* localized page. Keys match CartItem's label map.
|
|
3058
|
+
*/
|
|
3059
|
+
cartItemLabels?: Record<string, string>;
|
|
3054
3060
|
/** Logged-in user — used to determine purchaser role and authorization limit */
|
|
3055
3061
|
user?: Contact | Customer;
|
|
3056
3062
|
/** Configuration object passed to the component */
|
|
@@ -3165,6 +3171,14 @@ interface CartPaymethodsProps {
|
|
|
3165
3171
|
currency?: string;
|
|
3166
3172
|
/** Labels for the component */
|
|
3167
3173
|
labels?: Record<string, string>;
|
|
3174
|
+
/**
|
|
3175
|
+
* Localized display names for payment methods, keyed by the method **code**
|
|
3176
|
+
* (lower-cased, e.g. `{ pickup: 'Bij afhalen', on_account: 'Op rekening' }`).
|
|
3177
|
+
* The backend `method.name` is often an un-localized English string (e.g.
|
|
3178
|
+
* "On pickup"), so this map lets the host override it per locale. Lookup
|
|
3179
|
+
* order: `paymethodLabels[code]` → `method.name` → `method.code`.
|
|
3180
|
+
*/
|
|
3181
|
+
paymethodLabels?: Record<string, string>;
|
|
3168
3182
|
}
|
|
3169
3183
|
/**
|
|
3170
3184
|
* Renders the cart's available payment methods as a selectable grid. Hides the
|
|
@@ -3738,12 +3752,20 @@ interface DeliveryDateProps {
|
|
|
3738
3752
|
containerClass?: string;
|
|
3739
3753
|
/** Pre-selected date from cart (e.g. cart.postageData.requestDate: "2026-04-17T00:00:00.000Z") */
|
|
3740
3754
|
initialDate?: string;
|
|
3755
|
+
/**
|
|
3756
|
+
* Active language/locale (e.g. `'NL'`). Sets the `lang` attribute on the
|
|
3757
|
+
* native `<input type="date">` so the browser renders its calendar chrome
|
|
3758
|
+
* (month name, weekday headers, Today/Clear) in that locale. Resolved from
|
|
3759
|
+
* `<PropellerProvider>` when omitted. The quick-pick tile text is localized
|
|
3760
|
+
* separately via `labels` (day_N / month_N keys).
|
|
3761
|
+
*/
|
|
3762
|
+
language?: string;
|
|
3741
3763
|
}
|
|
3742
3764
|
/**
|
|
3743
3765
|
* Delivery-date selector: quick-pick tiles for the next few days plus an
|
|
3744
3766
|
* optional custom date picker, with validation against a minimum date.
|
|
3745
3767
|
*/
|
|
3746
|
-
declare function DeliveryDate(
|
|
3768
|
+
declare function DeliveryDate(rawProps: DeliveryDateProps): React$1.JSX.Element;
|
|
3747
3769
|
|
|
3748
3770
|
/**
|
|
3749
3771
|
* @rsc-blocked — Client-only component: JSX event handlers (onClick/onChange/etc.).
|
|
@@ -6503,8 +6525,16 @@ interface SearchBarResult {
|
|
|
6503
6525
|
name: string;
|
|
6504
6526
|
/** SKU code */
|
|
6505
6527
|
sku?: string;
|
|
6506
|
-
/**
|
|
6528
|
+
/**
|
|
6529
|
+
* Leading price value (kept for back-compat / consumer callbacks). Populated
|
|
6530
|
+
* with the tax-inclusive (net) or exclusive (gross) amount per the active
|
|
6531
|
+
* toggle — see `priceNet`/`priceGross` for both raw values.
|
|
6532
|
+
*/
|
|
6507
6533
|
price?: number;
|
|
6534
|
+
/** Tax-inclusive price (SDK `price.net`). */
|
|
6535
|
+
priceNet?: number;
|
|
6536
|
+
/** Tax-exclusive price (SDK `price.gross`). */
|
|
6537
|
+
priceGross?: number;
|
|
6508
6538
|
/** Image URL */
|
|
6509
6539
|
imageUrl?: string;
|
|
6510
6540
|
/** URL path to navigate to */
|
|
@@ -6541,6 +6571,19 @@ interface SearchBarProps {
|
|
|
6541
6571
|
currency?: string;
|
|
6542
6572
|
/** Labels for the component */
|
|
6543
6573
|
labels?: Record<string, string>;
|
|
6574
|
+
/**
|
|
6575
|
+
* When true, the tax-inclusive (net) price leads; false shows tax-exclusive
|
|
6576
|
+
* (gross). Note the SDK mapping: `price.net` = incl. VAT, `price.gross` =
|
|
6577
|
+
* excl. VAT. Resolved from `<PropellerProvider>` when omitted; defaults to
|
|
6578
|
+
* `false` (excl.). Mirrors ProductCard/ProductPrice so the dropdown agrees
|
|
6579
|
+
* with every other price surface.
|
|
6580
|
+
*/
|
|
6581
|
+
includeTax?: boolean;
|
|
6582
|
+
/**
|
|
6583
|
+
* Labels for the incl./excl. price suffix. Keys: `inclTax`, `exclTax`.
|
|
6584
|
+
* Falls back to English 'incl. VAT' / 'excl. VAT'.
|
|
6585
|
+
*/
|
|
6586
|
+
priceLabels?: Record<string, string>;
|
|
6544
6587
|
/** Additional class name for the container */
|
|
6545
6588
|
containerClassName?: string;
|
|
6546
6589
|
/** Tax zone used for price calculation. Defaults to 'NL'. */
|
package/dist/index.d.ts
CHANGED
|
@@ -3051,6 +3051,12 @@ interface CartIconAndSidebarProps {
|
|
|
3051
3051
|
* continueShopping, qty, total, checkoutButton, cartPageButton, closeLabel
|
|
3052
3052
|
*/
|
|
3053
3053
|
labels?: Record<string, string>;
|
|
3054
|
+
/**
|
|
3055
|
+
* Labels forwarded to the inner CartItem rows (e.g. `qtyPrefix`). Without
|
|
3056
|
+
* this the sidebar's line items fell back to English ("Qty:") even on a
|
|
3057
|
+
* localized page. Keys match CartItem's label map.
|
|
3058
|
+
*/
|
|
3059
|
+
cartItemLabels?: Record<string, string>;
|
|
3054
3060
|
/** Logged-in user — used to determine purchaser role and authorization limit */
|
|
3055
3061
|
user?: Contact | Customer;
|
|
3056
3062
|
/** Configuration object passed to the component */
|
|
@@ -3165,6 +3171,14 @@ interface CartPaymethodsProps {
|
|
|
3165
3171
|
currency?: string;
|
|
3166
3172
|
/** Labels for the component */
|
|
3167
3173
|
labels?: Record<string, string>;
|
|
3174
|
+
/**
|
|
3175
|
+
* Localized display names for payment methods, keyed by the method **code**
|
|
3176
|
+
* (lower-cased, e.g. `{ pickup: 'Bij afhalen', on_account: 'Op rekening' }`).
|
|
3177
|
+
* The backend `method.name` is often an un-localized English string (e.g.
|
|
3178
|
+
* "On pickup"), so this map lets the host override it per locale. Lookup
|
|
3179
|
+
* order: `paymethodLabels[code]` → `method.name` → `method.code`.
|
|
3180
|
+
*/
|
|
3181
|
+
paymethodLabels?: Record<string, string>;
|
|
3168
3182
|
}
|
|
3169
3183
|
/**
|
|
3170
3184
|
* Renders the cart's available payment methods as a selectable grid. Hides the
|
|
@@ -3738,12 +3752,20 @@ interface DeliveryDateProps {
|
|
|
3738
3752
|
containerClass?: string;
|
|
3739
3753
|
/** Pre-selected date from cart (e.g. cart.postageData.requestDate: "2026-04-17T00:00:00.000Z") */
|
|
3740
3754
|
initialDate?: string;
|
|
3755
|
+
/**
|
|
3756
|
+
* Active language/locale (e.g. `'NL'`). Sets the `lang` attribute on the
|
|
3757
|
+
* native `<input type="date">` so the browser renders its calendar chrome
|
|
3758
|
+
* (month name, weekday headers, Today/Clear) in that locale. Resolved from
|
|
3759
|
+
* `<PropellerProvider>` when omitted. The quick-pick tile text is localized
|
|
3760
|
+
* separately via `labels` (day_N / month_N keys).
|
|
3761
|
+
*/
|
|
3762
|
+
language?: string;
|
|
3741
3763
|
}
|
|
3742
3764
|
/**
|
|
3743
3765
|
* Delivery-date selector: quick-pick tiles for the next few days plus an
|
|
3744
3766
|
* optional custom date picker, with validation against a minimum date.
|
|
3745
3767
|
*/
|
|
3746
|
-
declare function DeliveryDate(
|
|
3768
|
+
declare function DeliveryDate(rawProps: DeliveryDateProps): React$1.JSX.Element;
|
|
3747
3769
|
|
|
3748
3770
|
/**
|
|
3749
3771
|
* @rsc-blocked — Client-only component: JSX event handlers (onClick/onChange/etc.).
|
|
@@ -6503,8 +6525,16 @@ interface SearchBarResult {
|
|
|
6503
6525
|
name: string;
|
|
6504
6526
|
/** SKU code */
|
|
6505
6527
|
sku?: string;
|
|
6506
|
-
/**
|
|
6528
|
+
/**
|
|
6529
|
+
* Leading price value (kept for back-compat / consumer callbacks). Populated
|
|
6530
|
+
* with the tax-inclusive (net) or exclusive (gross) amount per the active
|
|
6531
|
+
* toggle — see `priceNet`/`priceGross` for both raw values.
|
|
6532
|
+
*/
|
|
6507
6533
|
price?: number;
|
|
6534
|
+
/** Tax-inclusive price (SDK `price.net`). */
|
|
6535
|
+
priceNet?: number;
|
|
6536
|
+
/** Tax-exclusive price (SDK `price.gross`). */
|
|
6537
|
+
priceGross?: number;
|
|
6508
6538
|
/** Image URL */
|
|
6509
6539
|
imageUrl?: string;
|
|
6510
6540
|
/** URL path to navigate to */
|
|
@@ -6541,6 +6571,19 @@ interface SearchBarProps {
|
|
|
6541
6571
|
currency?: string;
|
|
6542
6572
|
/** Labels for the component */
|
|
6543
6573
|
labels?: Record<string, string>;
|
|
6574
|
+
/**
|
|
6575
|
+
* When true, the tax-inclusive (net) price leads; false shows tax-exclusive
|
|
6576
|
+
* (gross). Note the SDK mapping: `price.net` = incl. VAT, `price.gross` =
|
|
6577
|
+
* excl. VAT. Resolved from `<PropellerProvider>` when omitted; defaults to
|
|
6578
|
+
* `false` (excl.). Mirrors ProductCard/ProductPrice so the dropdown agrees
|
|
6579
|
+
* with every other price surface.
|
|
6580
|
+
*/
|
|
6581
|
+
includeTax?: boolean;
|
|
6582
|
+
/**
|
|
6583
|
+
* Labels for the incl./excl. price suffix. Keys: `inclTax`, `exclTax`.
|
|
6584
|
+
* Falls back to English 'incl. VAT' / 'excl. VAT'.
|
|
6585
|
+
*/
|
|
6586
|
+
priceLabels?: Record<string, string>;
|
|
6544
6587
|
/** Additional class name for the container */
|
|
6545
6588
|
containerClassName?: string;
|
|
6546
6589
|
/** Tax zone used for price calculation. Defaults to 'NL'. */
|
package/dist/index.js
CHANGED
|
@@ -6705,8 +6705,9 @@ function CartIconAndSidebar(rawProps) {
|
|
|
6705
6705
|
(sum, item) => sum + item.quantity,
|
|
6706
6706
|
0
|
|
6707
6707
|
);
|
|
6708
|
-
const
|
|
6709
|
-
const
|
|
6708
|
+
const useTax = !!props.includeTax;
|
|
6709
|
+
const totalRaw = useTax ? props.cart?.total?.totalNet : props.cart?.total?.totalGross;
|
|
6710
|
+
const totalPrice = totalRaw === void 0 || totalRaw === null ? money(0) : money(totalRaw);
|
|
6710
6711
|
const sidebarTitle = props.cartSidebarTitle || props.labels?.["cartSidebarTitle"] || "Shopping cart";
|
|
6711
6712
|
const purchaserPAC = findPurchaserPAC(props.user, props.companyId);
|
|
6712
6713
|
const totalGross = props.cart?.total?.totalGross ?? 0;
|
|
@@ -6909,6 +6910,7 @@ function CartIconAndSidebar(rawProps) {
|
|
|
6909
6910
|
language: props.language,
|
|
6910
6911
|
configuration: props.configuration,
|
|
6911
6912
|
companyId: props.companyId,
|
|
6913
|
+
labels: props.cartItemLabels,
|
|
6912
6914
|
cardFrame: false,
|
|
6913
6915
|
showDelete: false,
|
|
6914
6916
|
readOnlyQuantity: true,
|
|
@@ -6916,7 +6918,7 @@ function CartIconAndSidebar(rawProps) {
|
|
|
6916
6918
|
showCartItemNotesField: false,
|
|
6917
6919
|
showCrossupsells: false,
|
|
6918
6920
|
showStockComponent: false,
|
|
6919
|
-
includeTax:
|
|
6921
|
+
includeTax: useTax,
|
|
6920
6922
|
className: "propeller-cart-icon__item",
|
|
6921
6923
|
children: [
|
|
6922
6924
|
/* @__PURE__ */ jsx(CartItem_default.Image, { className: "w-20 h-20 flex-shrink-0 bg-surface-hover rounded-control overflow-hidden border border-border-subtle" }),
|
|
@@ -6937,7 +6939,7 @@ function CartIconAndSidebar(rawProps) {
|
|
|
6937
6939
|
},
|
|
6938
6940
|
item.itemId
|
|
6939
6941
|
)) }),
|
|
6940
|
-
/* @__PURE__ */ jsx(CartBonusItemsImpl, { cart: props.cart, includeTax:
|
|
6942
|
+
/* @__PURE__ */ jsx(CartBonusItemsImpl, { cart: props.cart, includeTax: useTax, className: "mt-4" })
|
|
6941
6943
|
] }),
|
|
6942
6944
|
" ",
|
|
6943
6945
|
items.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "propeller-cart-icon__sidebar-footer px-5 py-4 border-t border-border space-y-3 bg-surface-hover", children: [
|
|
@@ -7014,11 +7016,11 @@ function CartOverview(props) {
|
|
|
7014
7016
|
function requestDate() {
|
|
7015
7017
|
const date = props.cart?.postageData?.requestDate;
|
|
7016
7018
|
if (!date) return "";
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
}
|
|
7019
|
+
const d = new Date(date);
|
|
7020
|
+
if (isNaN(d.getTime())) return date;
|
|
7021
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
7022
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
7023
|
+
return `${day}-${month}-${d.getFullYear()}`;
|
|
7022
7024
|
}
|
|
7023
7025
|
function handleTermsLinkClick(event) {
|
|
7024
7026
|
event.preventDefault();
|
|
@@ -7181,6 +7183,10 @@ function CartPaymethods(rawProps) {
|
|
|
7181
7183
|
if (props.formatPrice) return props.formatPrice(price);
|
|
7182
7184
|
return formatPrice(price || 0, { symbol: props.currency ?? "\u20AC" });
|
|
7183
7185
|
}
|
|
7186
|
+
function methodName(method) {
|
|
7187
|
+
const code = (method.code || "").toLowerCase();
|
|
7188
|
+
return props.paymethodLabels?.[code] || method.name || method.code || "";
|
|
7189
|
+
}
|
|
7184
7190
|
function handleSelect(method) {
|
|
7185
7191
|
setSelectedCode(method.code);
|
|
7186
7192
|
if (props.onPaymethodSelect) props.onPaymethodSelect(method);
|
|
@@ -7211,10 +7217,10 @@ function CartPaymethods(rawProps) {
|
|
|
7211
7217
|
{
|
|
7212
7218
|
className: "propeller-cart-paymethods__method-logo max-h-10 max-w-[80%] w-auto object-contain",
|
|
7213
7219
|
src: logoUrl,
|
|
7214
|
-
alt: method
|
|
7220
|
+
alt: methodName(method)
|
|
7215
7221
|
}
|
|
7216
7222
|
) }) : null,
|
|
7217
|
-
/* @__PURE__ */ jsx("span", { className: "propeller-cart-paymethods__method-name font-medium text-sm", children: method
|
|
7223
|
+
/* @__PURE__ */ jsx("span", { className: "propeller-cart-paymethods__method-name font-medium text-sm", children: methodName(method) })
|
|
7218
7224
|
]
|
|
7219
7225
|
},
|
|
7220
7226
|
method.code
|
|
@@ -8380,7 +8386,8 @@ function computeUpcomingDates(count, skipWeekends) {
|
|
|
8380
8386
|
}
|
|
8381
8387
|
return days;
|
|
8382
8388
|
}
|
|
8383
|
-
function DeliveryDate(
|
|
8389
|
+
function DeliveryDate(rawProps) {
|
|
8390
|
+
const props = useInfraProps(rawProps);
|
|
8384
8391
|
const [selectedDate, setSelectedDate] = useState("");
|
|
8385
8392
|
const [modalOpen, setModalOpen] = useState(false);
|
|
8386
8393
|
const [customDateValue, setCustomDateValue] = useState("");
|
|
@@ -8401,7 +8408,9 @@ function DeliveryDate(props) {
|
|
|
8401
8408
|
if (!isoDate) return "";
|
|
8402
8409
|
const date = new Date(isoDate);
|
|
8403
8410
|
if (isNaN(date.getTime())) return "";
|
|
8404
|
-
|
|
8411
|
+
const weekday = getLabel(props.labels, `day_${date.getDay()}`, WEEKDAYS[date.getDay()]);
|
|
8412
|
+
const month = getLabel(props.labels, `month_${date.getMonth()}`, MONTHS[date.getMonth()]);
|
|
8413
|
+
return `${weekday}, ${month} ${date.getDate()}`;
|
|
8405
8414
|
}
|
|
8406
8415
|
function handleSelect(isoDate) {
|
|
8407
8416
|
setSelectedDate(isoDate);
|
|
@@ -8515,6 +8524,7 @@ function DeliveryDate(props) {
|
|
|
8515
8524
|
"input",
|
|
8516
8525
|
{
|
|
8517
8526
|
type: "date",
|
|
8527
|
+
lang: props.language ? props.language.toLowerCase() : void 0,
|
|
8518
8528
|
className: `propeller-delivery-date__input w-full border rounded-control px-3 py-2 text-sm focus:outline-none focus:ring-2 ${customDateError ? "border-destructive focus:ring-destructive focus:border-destructive" : "border-input focus:ring-secondary focus:border-secondary"}`,
|
|
8519
8529
|
min: minDate,
|
|
8520
8530
|
value: customDateValue,
|
|
@@ -9667,10 +9677,11 @@ function FavoriteLists(rawProps) {
|
|
|
9667
9677
|
if (props.formatDate) return props.formatDate(dateString);
|
|
9668
9678
|
if (!dateString) return "-";
|
|
9669
9679
|
const d = new Date(dateString);
|
|
9680
|
+
if (isNaN(d.getTime())) return dateString;
|
|
9670
9681
|
const day = String(d.getDate()).padStart(2, "0");
|
|
9671
9682
|
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
9672
9683
|
const year = d.getFullYear();
|
|
9673
|
-
return `${day}
|
|
9684
|
+
return `${day}-${month}-${year}`;
|
|
9674
9685
|
}
|
|
9675
9686
|
function getProductCount(list) {
|
|
9676
9687
|
const products = list.products;
|
|
@@ -11815,7 +11826,11 @@ function OrderList(rawProps) {
|
|
|
11815
11826
|
function formatDate(dateString) {
|
|
11816
11827
|
if (props.formatDate) return props.formatDate(dateString);
|
|
11817
11828
|
if (!dateString) return "-";
|
|
11818
|
-
|
|
11829
|
+
const d = new Date(dateString);
|
|
11830
|
+
if (isNaN(d.getTime())) return dateString;
|
|
11831
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
11832
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
11833
|
+
return `${day}-${month}-${d.getFullYear()}`;
|
|
11819
11834
|
}
|
|
11820
11835
|
function formatPrice17(price) {
|
|
11821
11836
|
if (props.formatPrice) return props.formatPrice(price);
|
|
@@ -12252,7 +12267,10 @@ function OrderShipments(props) {
|
|
|
12252
12267
|
function formatDate(dateStr) {
|
|
12253
12268
|
if (!dateStr) return "-";
|
|
12254
12269
|
const d = new Date(dateStr);
|
|
12255
|
-
|
|
12270
|
+
if (isNaN(d.getTime())) return dateStr;
|
|
12271
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
12272
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
12273
|
+
return `${day}-${month}-${d.getFullYear()}`;
|
|
12256
12274
|
}
|
|
12257
12275
|
function getOrderItemForShipmentItem(shipmentItem) {
|
|
12258
12276
|
if (!props.order?.items || !shipmentItem.orderItemId) return null;
|
|
@@ -12469,15 +12487,18 @@ function OrderSummary(props) {
|
|
|
12469
12487
|
}
|
|
12470
12488
|
return formatPrice(price || 0, { symbol: props.currency ?? "\u20AC" });
|
|
12471
12489
|
}
|
|
12490
|
+
function numericDate(dateString) {
|
|
12491
|
+
const d = new Date(dateString);
|
|
12492
|
+
if (isNaN(d.getTime())) return dateString;
|
|
12493
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
12494
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
12495
|
+
return `${day}-${month}-${d.getFullYear()}`;
|
|
12496
|
+
}
|
|
12472
12497
|
function formatOrderDate(dateString) {
|
|
12473
12498
|
if (props.formatDate) {
|
|
12474
12499
|
return props.formatDate(dateString);
|
|
12475
12500
|
}
|
|
12476
|
-
|
|
12477
|
-
return new Date(dateString).toLocaleDateString("en-US");
|
|
12478
|
-
} catch {
|
|
12479
|
-
return dateString;
|
|
12480
|
-
}
|
|
12501
|
+
return numericDate(dateString);
|
|
12481
12502
|
}
|
|
12482
12503
|
const requestDateRaw = order?.postageData?.requestDate;
|
|
12483
12504
|
let requestDate = "";
|
|
@@ -12485,11 +12506,7 @@ function OrderSummary(props) {
|
|
|
12485
12506
|
if (props.formatDate) {
|
|
12486
12507
|
requestDate = props.formatDate(requestDateRaw);
|
|
12487
12508
|
} else {
|
|
12488
|
-
|
|
12489
|
-
requestDate = new Date(requestDateRaw).toLocaleDateString("en-US");
|
|
12490
|
-
} catch {
|
|
12491
|
-
requestDate = requestDateRaw;
|
|
12492
|
-
}
|
|
12509
|
+
requestDate = numericDate(requestDateRaw);
|
|
12493
12510
|
}
|
|
12494
12511
|
}
|
|
12495
12512
|
const getCountryName$1 = (code) => getCountryName(code, props.countries);
|
|
@@ -15910,7 +15927,10 @@ function PurchaseAuthorizationRequests(rawProps) {
|
|
|
15910
15927
|
if (props.formatDate) return props.formatDate(dateStr);
|
|
15911
15928
|
if (!dateStr) return "-";
|
|
15912
15929
|
const d = new Date(dateStr);
|
|
15913
|
-
|
|
15930
|
+
if (isNaN(d.getTime())) return dateStr;
|
|
15931
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
15932
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
15933
|
+
return `${day}-${month}-${d.getFullYear()}`;
|
|
15914
15934
|
}
|
|
15915
15935
|
function formatPrice17(price) {
|
|
15916
15936
|
if (props.formatPrice) return props.formatPrice(price);
|
|
@@ -17127,11 +17147,17 @@ function mapToSearchBarResult(item) {
|
|
|
17127
17147
|
const id = isCluster ? item.clusterId : item.productId;
|
|
17128
17148
|
const slug = item.slugs?.[0]?.value || "";
|
|
17129
17149
|
const url = isCluster ? "/cluster/" + id + "/" + slug : "/product/" + id + "/" + slug;
|
|
17150
|
+
const priceNet = displayItem?.price?.net || 0;
|
|
17151
|
+
const priceGross = displayItem?.price?.gross || 0;
|
|
17130
17152
|
return {
|
|
17131
17153
|
id,
|
|
17132
17154
|
name: item.names?.[0]?.value || "Product",
|
|
17133
17155
|
sku: item.sku || displayItem?.sku || "",
|
|
17134
|
-
price
|
|
17156
|
+
// `price` stays the gross value for back-compat; the row picks net/gross
|
|
17157
|
+
// from the two explicit fields below per the toggle.
|
|
17158
|
+
price: priceGross,
|
|
17159
|
+
priceNet,
|
|
17160
|
+
priceGross,
|
|
17135
17161
|
imageUrl: displayItem?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "",
|
|
17136
17162
|
url,
|
|
17137
17163
|
isCluster
|
|
@@ -17160,6 +17186,13 @@ function SearchBar(rawProps) {
|
|
|
17160
17186
|
}
|
|
17161
17187
|
return formatPrice(price || 0, { symbol: props.currency ?? "\u20AC" });
|
|
17162
17188
|
}
|
|
17189
|
+
const useTax = !!props.includeTax;
|
|
17190
|
+
function leadingPrice(result) {
|
|
17191
|
+
return useTax ? result.priceNet ?? result.price ?? 0 : result.priceGross ?? result.price ?? 0;
|
|
17192
|
+
}
|
|
17193
|
+
function priceTaxLabel() {
|
|
17194
|
+
return useTax ? getLabel(props.priceLabels, "inclTax", "incl. VAT") : getLabel(props.priceLabels, "exclTax", "excl. VAT");
|
|
17195
|
+
}
|
|
17163
17196
|
function noImageUrl() {
|
|
17164
17197
|
return props.noImageUrl || "";
|
|
17165
17198
|
}
|
|
@@ -17278,7 +17311,10 @@ function SearchBar(rawProps) {
|
|
|
17278
17311
|
result.sku
|
|
17279
17312
|
] }) : null
|
|
17280
17313
|
] }),
|
|
17281
|
-
result.price !== void 0 && result.price !== null ? /* @__PURE__ */
|
|
17314
|
+
result.price !== void 0 && result.price !== null ? /* @__PURE__ */ jsxs("div", { className: "propeller-search-bar__result-price text-sm font-semibold text-foreground flex-shrink-0 text-right", children: [
|
|
17315
|
+
/* @__PURE__ */ jsx("span", { className: "propeller-search-bar__result-price-value", children: formatItemPrice(leadingPrice(result)) }),
|
|
17316
|
+
/* @__PURE__ */ jsx("span", { className: "propeller-search-bar__result-price-label block text-xs font-normal text-muted-foreground", children: priceTaxLabel() })
|
|
17317
|
+
] }) : null
|
|
17282
17318
|
]
|
|
17283
17319
|
},
|
|
17284
17320
|
result.id + "-" + index
|