@metron-labs/quote-react 0.1.48 → 0.1.49

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.
@@ -248,6 +248,12 @@ export default function BasketStage({ cart, onUpdateQty, onUpdateSellUnits, onRe
248
248
  const total = subtotal == null ? null : subtotal * (1 + VAT_RATE);
249
249
  const unpriced = pricedItems.filter(({ pricing }) => pricing.lineTotal == null).length;
250
250
  const resolvingCount = Object.keys(resolvingConversionInputs).length;
251
+ const waitingForConversions = !!onResolveConversions && items.some((item) => {
252
+ if (item.productId === "-" || getPricingBreakdown(item).requiredSellUnits != null)
253
+ return false;
254
+ const input = conversionInputKey(item);
255
+ return resolvedConversionInputs.current.get(item.lineId) !== input || resolvingConversionInputs[item.lineId] === input;
256
+ });
251
257
  // Once per visit to the basket, with the figures it opened with.
252
258
  const openedWith = useRef({ items: pricedItems.length, ...(total == null ? {} : { total: Math.round(total * 100) / 100 }) });
253
259
  useEffect(() => {
@@ -267,7 +273,7 @@ export default function BasketStage({ cart, onUpdateQty, onUpdateSellUnits, onRe
267
273
  ? "Review the items you've added before exporting them for review."
268
274
  : qzaBasketLayout
269
275
  ? "Check your items and quantities below, and we'll do our best to beat list prices."
270
- : "Review your quantities and order summary before you buy." })] })] }), _jsx("div", { className: "quick-order-panel", style: { paddingTop: 16 }, children: items.length === 0 ? (_jsxs("div", { className: "quick-order-history-empty", children: [_jsx("div", { className: "basket-empty-icon", "aria-hidden": "true", children: "\uD83D\uDCCB" }), _jsx("p", { children: "Your selection is empty." }), _jsx("p", { className: "basket-empty-hint", children: "Go back to your results and add quoted items." }), _jsx("div", { className: "btn-row", style: { marginTop: 20, justifyContent: "center" }, children: _jsx("button", { className: "cta-btn", style: { width: "auto", maxWidth: 280 }, onClick: onBack, "aria-label": "Back to results", children: _jsx("span", { children: "Back to Results" }) }) })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "basket-layout", children: [_jsxs("div", { className: "basket-main", children: [_jsx("div", { className: "basket-list", "aria-label": internal ? "Selection items" : qzaBasketLayout ? "Quote request items" : "Basket items", children: pagedItems.map(({ item, pricing }) => {
276
+ : "Review your quantities and order summary before you buy." })] })] }), _jsx("div", { className: "quick-order-panel", style: { paddingTop: 16 }, children: waitingForConversions ? (_jsxs("div", { className: "basket-resolving", role: "status", "aria-label": "Calculating order quantities", children: [_jsx("span", { className: "basket-resolving-wheel", "aria-hidden": "true" }), _jsx("span", { children: "Calculating your quantities\u2026" })] })) : items.length === 0 ? (_jsxs("div", { className: "quick-order-history-empty", children: [_jsx("div", { className: "basket-empty-icon", "aria-hidden": "true", children: "\uD83D\uDCCB" }), _jsx("p", { children: "Your selection is empty." }), _jsx("p", { className: "basket-empty-hint", children: "Go back to your results and add quoted items." }), _jsx("div", { className: "btn-row", style: { marginTop: 20, justifyContent: "center" }, children: _jsx("button", { className: "cta-btn", style: { width: "auto", maxWidth: 280 }, onClick: onBack, "aria-label": "Back to results", children: _jsx("span", { children: "Back to Results" }) }) })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "basket-layout", children: [_jsxs("div", { className: "basket-main", children: [_jsx("div", { className: "basket-list", "aria-label": internal ? "Selection items" : qzaBasketLayout ? "Quote request items" : "Basket items", children: pagedItems.map(({ item, pricing }) => {
271
277
  const requestedQtyValue = qtyDrafts[item.lineId] ?? String(pricing.requestedAmount);
272
278
  const requestedLocked = pricing.requestedUnit === pricing.sellUnit || pricing.costingMode === "review";
273
279
  const rawDiffersFromOrder = pricing.requiredSellUnits == null || pricing.requestedAmount !== pricing.requiredSellUnits || pricing.requestedUnit !== pricing.sellUnit;