@propeller-commerce/propeller-v2-react-ui 0.4.24 → 0.4.26
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 +58 -0
- package/dist/index.cjs +152 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +152 -82
- package/dist/index.js.map +1 -1
- package/dist/pure.cjs +4 -2
- package/dist/pure.cjs.map +1 -1
- package/dist/pure.d.cts +13 -0
- package/dist/pure.d.ts +13 -0
- package/dist/pure.js +4 -2
- package/dist/pure.js.map +1 -1
- package/package.json +1 -1
package/dist/pure.d.cts
CHANGED
|
@@ -315,6 +315,19 @@ interface OrderSummaryProps {
|
|
|
315
315
|
formatDate?: (dateString: string) => string;
|
|
316
316
|
/** Labels for the component */
|
|
317
317
|
labels?: Record<string, string>;
|
|
318
|
+
/**
|
|
319
|
+
* Localized order/quote status labels, keyed by the raw backend status
|
|
320
|
+
* (e.g. `{ NEW: 'Nieuw', REQUEST: 'Aangevraagd' }`). Unknown → raw value.
|
|
321
|
+
*/
|
|
322
|
+
statusLabels?: Record<string, string>;
|
|
323
|
+
/**
|
|
324
|
+
* Localized payment-method names, keyed by the raw method value LOWER-CASED
|
|
325
|
+
* (e.g. `{ rekening: 'Op rekening', account: 'Op rekening' }`). The backend
|
|
326
|
+
* sends different raw values on the order vs quote path (REKENING / ACCOUNT),
|
|
327
|
+
* so mapping both here makes the same method render identically. Unknown →
|
|
328
|
+
* raw value.
|
|
329
|
+
*/
|
|
330
|
+
paymethodLabels?: Record<string, string>;
|
|
318
331
|
/** List of countries for resolving codes to names [{code: 'NL', name: 'Netherlands'}, ...] */
|
|
319
332
|
countries?: {
|
|
320
333
|
code: string;
|
package/dist/pure.d.ts
CHANGED
|
@@ -315,6 +315,19 @@ interface OrderSummaryProps {
|
|
|
315
315
|
formatDate?: (dateString: string) => string;
|
|
316
316
|
/** Labels for the component */
|
|
317
317
|
labels?: Record<string, string>;
|
|
318
|
+
/**
|
|
319
|
+
* Localized order/quote status labels, keyed by the raw backend status
|
|
320
|
+
* (e.g. `{ NEW: 'Nieuw', REQUEST: 'Aangevraagd' }`). Unknown → raw value.
|
|
321
|
+
*/
|
|
322
|
+
statusLabels?: Record<string, string>;
|
|
323
|
+
/**
|
|
324
|
+
* Localized payment-method names, keyed by the raw method value LOWER-CASED
|
|
325
|
+
* (e.g. `{ rekening: 'Op rekening', account: 'Op rekening' }`). The backend
|
|
326
|
+
* sends different raw values on the order vs quote path (REKENING / ACCOUNT),
|
|
327
|
+
* so mapping both here makes the same method render identically. Unknown →
|
|
328
|
+
* raw value.
|
|
329
|
+
*/
|
|
330
|
+
paymethodLabels?: Record<string, string>;
|
|
318
331
|
/** List of countries for resolving codes to names [{code: 'NL', name: 'Netherlands'}, ...] */
|
|
319
332
|
countries?: {
|
|
320
333
|
code: string;
|
package/dist/pure.js
CHANGED
|
@@ -411,11 +411,13 @@ function OrderSummary(props) {
|
|
|
411
411
|
const showRemarks = props.showRemarks !== void 0 ? props.showRemarks : true;
|
|
412
412
|
const orderNumber = order?.id || "";
|
|
413
413
|
const orderDate = order?.createdAt || "";
|
|
414
|
-
const
|
|
414
|
+
const rawStatus = order?.status || "";
|
|
415
|
+
const orderStatus = rawStatus ? props.statusLabels?.[rawStatus] || rawStatus : "";
|
|
415
416
|
const orderTotal = Number(order?.total?.net || 0);
|
|
416
417
|
const orderReference = order?.reference || "";
|
|
417
418
|
const orderRemarks = order?.remarks || "";
|
|
418
|
-
const
|
|
419
|
+
const rawPaymentMethod = order?.paymentData?.method || "";
|
|
420
|
+
const paymentMethod = rawPaymentMethod ? props.paymethodLabels?.[rawPaymentMethod.toLowerCase()] || rawPaymentMethod : "";
|
|
419
421
|
const carrierName = order?.postageData?.carrier || "";
|
|
420
422
|
const addresses = order?.addresses || [];
|
|
421
423
|
const invoiceAddress = addresses.find((a) => a.type === "invoice") || null;
|