@propeller-commerce/propeller-v2-react-ui 0.4.23 → 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 CHANGED
@@ -8,6 +8,23 @@ once it reaches 1.0. Until then (the `0.x` line) the public API may change
8
8
  between minor versions; breaking changes are called out below and in
9
9
  [MIGRATION.md](./MIGRATION.md).
10
10
 
11
+ ## [0.4.24] - 2026-07-20
12
+
13
+ ### Fixed
14
+
15
+ - **Date formatting**: `OrderList`, `OrderSummary`, `CartOverview`,
16
+ `OrderShipments`, `PurchaseAuthorizationRequests`, `FavoriteLists` rendered
17
+ dates via locale-less/`'en-US'` `toLocaleDateString` (US M/D/YYYY) or an
18
+ inconsistent `D.M.YYYY` — Dutch readers misparse M/D by months. All now use a
19
+ consistent numeric `DD-MM-YYYY` fallback (still overridable via
20
+ `props.formatDate`).
21
+ - `CartIconAndSidebar`: new `cartItemLabels` prop, forwarded to the mini-cart's
22
+ inner `CartItem` rows so the line labels (e.g. the `qtyPrefix` "Aantal:")
23
+ localize; previously they fell back to English ("Qty:").
24
+ - `CartPaymethods`: new `paymethodLabels` prop — a code→localized-name map so
25
+ the host can override un-localized backend method names (e.g. "On pickup"→
26
+ "Bij afhalen"). Lookup: `paymethodLabels[code]` → `method.name` → `method.code`.
27
+
11
28
  ## [0.4.23] - 2026-07-17
12
29
 
13
30
  ### Fixed
package/dist/index.cjs CHANGED
@@ -6930,6 +6930,7 @@ function CartIconAndSidebar(rawProps) {
6930
6930
  language: props.language,
6931
6931
  configuration: props.configuration,
6932
6932
  companyId: props.companyId,
6933
+ labels: props.cartItemLabels,
6933
6934
  cardFrame: false,
6934
6935
  showDelete: false,
6935
6936
  readOnlyQuantity: true,
@@ -7035,11 +7036,11 @@ function CartOverview(props) {
7035
7036
  function requestDate() {
7036
7037
  const date = props.cart?.postageData?.requestDate;
7037
7038
  if (!date) return "";
7038
- try {
7039
- return new Date(date).toLocaleDateString();
7040
- } catch {
7041
- return date;
7042
- }
7039
+ const d = new Date(date);
7040
+ if (isNaN(d.getTime())) return date;
7041
+ const day = String(d.getDate()).padStart(2, "0");
7042
+ const month = String(d.getMonth() + 1).padStart(2, "0");
7043
+ return `${day}-${month}-${d.getFullYear()}`;
7043
7044
  }
7044
7045
  function handleTermsLinkClick(event) {
7045
7046
  event.preventDefault();
@@ -7202,6 +7203,10 @@ function CartPaymethods(rawProps) {
7202
7203
  if (props.formatPrice) return props.formatPrice(price);
7203
7204
  return propellerV2CoreUi.formatPrice(price || 0, { symbol: props.currency ?? "\u20AC" });
7204
7205
  }
7206
+ function methodName(method) {
7207
+ const code = (method.code || "").toLowerCase();
7208
+ return props.paymethodLabels?.[code] || method.name || method.code || "";
7209
+ }
7205
7210
  function handleSelect(method) {
7206
7211
  setSelectedCode(method.code);
7207
7212
  if (props.onPaymethodSelect) props.onPaymethodSelect(method);
@@ -7232,10 +7237,10 @@ function CartPaymethods(rawProps) {
7232
7237
  {
7233
7238
  className: "propeller-cart-paymethods__method-logo max-h-10 max-w-[80%] w-auto object-contain",
7234
7239
  src: logoUrl,
7235
- alt: method.name || method.code
7240
+ alt: methodName(method)
7236
7241
  }
7237
7242
  ) }) : null,
7238
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-cart-paymethods__method-name font-medium text-sm", children: method.name || method.code })
7243
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-cart-paymethods__method-name font-medium text-sm", children: methodName(method) })
7239
7244
  ]
7240
7245
  },
7241
7246
  method.code
@@ -9692,10 +9697,11 @@ function FavoriteLists(rawProps) {
9692
9697
  if (props.formatDate) return props.formatDate(dateString);
9693
9698
  if (!dateString) return "-";
9694
9699
  const d = new Date(dateString);
9700
+ if (isNaN(d.getTime())) return dateString;
9695
9701
  const day = String(d.getDate()).padStart(2, "0");
9696
9702
  const month = String(d.getMonth() + 1).padStart(2, "0");
9697
9703
  const year = d.getFullYear();
9698
- return `${day}/${month}/${year}`;
9704
+ return `${day}-${month}-${year}`;
9699
9705
  }
9700
9706
  function getProductCount(list) {
9701
9707
  const products = list.products;
@@ -11840,7 +11846,11 @@ function OrderList(rawProps) {
11840
11846
  function formatDate(dateString) {
11841
11847
  if (props.formatDate) return props.formatDate(dateString);
11842
11848
  if (!dateString) return "-";
11843
- return new Date(dateString).toLocaleDateString();
11849
+ const d = new Date(dateString);
11850
+ if (isNaN(d.getTime())) return dateString;
11851
+ const day = String(d.getDate()).padStart(2, "0");
11852
+ const month = String(d.getMonth() + 1).padStart(2, "0");
11853
+ return `${day}-${month}-${d.getFullYear()}`;
11844
11854
  }
11845
11855
  function formatPrice17(price) {
11846
11856
  if (props.formatPrice) return props.formatPrice(price);
@@ -12277,7 +12287,10 @@ function OrderShipments(props) {
12277
12287
  function formatDate(dateStr) {
12278
12288
  if (!dateStr) return "-";
12279
12289
  const d = new Date(dateStr);
12280
- return `${d.getDate()}.${d.getMonth() + 1}.${d.getFullYear()}`;
12290
+ if (isNaN(d.getTime())) return dateStr;
12291
+ const day = String(d.getDate()).padStart(2, "0");
12292
+ const month = String(d.getMonth() + 1).padStart(2, "0");
12293
+ return `${day}-${month}-${d.getFullYear()}`;
12281
12294
  }
12282
12295
  function getOrderItemForShipmentItem(shipmentItem) {
12283
12296
  if (!props.order?.items || !shipmentItem.orderItemId) return null;
@@ -12494,15 +12507,18 @@ function OrderSummary(props) {
12494
12507
  }
12495
12508
  return propellerV2CoreUi.formatPrice(price || 0, { symbol: props.currency ?? "\u20AC" });
12496
12509
  }
12510
+ function numericDate(dateString) {
12511
+ const d = new Date(dateString);
12512
+ if (isNaN(d.getTime())) return dateString;
12513
+ const day = String(d.getDate()).padStart(2, "0");
12514
+ const month = String(d.getMonth() + 1).padStart(2, "0");
12515
+ return `${day}-${month}-${d.getFullYear()}`;
12516
+ }
12497
12517
  function formatOrderDate(dateString) {
12498
12518
  if (props.formatDate) {
12499
12519
  return props.formatDate(dateString);
12500
12520
  }
12501
- try {
12502
- return new Date(dateString).toLocaleDateString("en-US");
12503
- } catch {
12504
- return dateString;
12505
- }
12521
+ return numericDate(dateString);
12506
12522
  }
12507
12523
  const requestDateRaw = order?.postageData?.requestDate;
12508
12524
  let requestDate = "";
@@ -12510,11 +12526,7 @@ function OrderSummary(props) {
12510
12526
  if (props.formatDate) {
12511
12527
  requestDate = props.formatDate(requestDateRaw);
12512
12528
  } else {
12513
- try {
12514
- requestDate = new Date(requestDateRaw).toLocaleDateString("en-US");
12515
- } catch {
12516
- requestDate = requestDateRaw;
12517
- }
12529
+ requestDate = numericDate(requestDateRaw);
12518
12530
  }
12519
12531
  }
12520
12532
  const getCountryName = (code) => propellerV2CoreUi.getCountryName(code, props.countries);
@@ -15935,7 +15947,10 @@ function PurchaseAuthorizationRequests(rawProps) {
15935
15947
  if (props.formatDate) return props.formatDate(dateStr);
15936
15948
  if (!dateStr) return "-";
15937
15949
  const d = new Date(dateStr);
15938
- return `${d.getDate()}.${d.getMonth() + 1}.${d.getFullYear()}`;
15950
+ if (isNaN(d.getTime())) return dateStr;
15951
+ const day = String(d.getDate()).padStart(2, "0");
15952
+ const month = String(d.getMonth() + 1).padStart(2, "0");
15953
+ return `${day}-${month}-${d.getFullYear()}`;
15939
15954
  }
15940
15955
  function formatPrice17(price) {
15941
15956
  if (props.formatPrice) return props.formatPrice(price);