@propeller-commerce/propeller-v2-react-ui 0.4.22 → 0.4.23
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 +25 -0
- package/dist/index.cjs +29 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +29 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,31 @@ 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.23] - 2026-07-17
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- `SearchBar`: the autosuggest dropdown hardcoded `price.gross` (excl. VAT) and
|
|
16
|
+
ignored the Incl./Excl. toggle, under-quoting every product, and showed no
|
|
17
|
+
tax label. It now carries both net/gross, picks the leading price from
|
|
18
|
+
`includeTax` (resolved from `<PropellerProvider>`), and renders an
|
|
19
|
+
`incl./excl.` label — consistent with `ProductPrice`/PLP/PDP. New optional
|
|
20
|
+
props: `includeTax`, `priceLabels` (keys `inclTax`/`exclTax`).
|
|
21
|
+
- `CartIconAndSidebar`: the header mini-cart rendered line items excl. VAT
|
|
22
|
+
(`includeTax={false}`) while the total used `totalNet` (incl. VAT) and bonus
|
|
23
|
+
items were pinned incl. — the lines never reconciled with the total and none
|
|
24
|
+
followed the toggle. All three now share one `useTax` basis (from
|
|
25
|
+
`includeTax`), so lines, total, and bonus items agree and respect the toggle.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- `DeliveryDate`: weekday/month names in the quick-pick tiles now resolve via
|
|
30
|
+
`labels` (keys `day_0`…`day_6`, `month_0`…`month_11`; English fallback) so
|
|
31
|
+
they localize with the active locale instead of hardcoded English. New
|
|
32
|
+
optional `language` prop (resolved from `<PropellerProvider>`) sets the
|
|
33
|
+
native date-input's `lang`, localizing the browser calendar chrome
|
|
34
|
+
(month name, weekday headers, Today/Clear).
|
|
35
|
+
|
|
11
36
|
## [0.4.22] - 2026-07-17
|
|
12
37
|
|
|
13
38
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -6725,8 +6725,9 @@ function CartIconAndSidebar(rawProps) {
|
|
|
6725
6725
|
(sum, item) => sum + item.quantity,
|
|
6726
6726
|
0
|
|
6727
6727
|
);
|
|
6728
|
-
const
|
|
6729
|
-
const
|
|
6728
|
+
const useTax = !!props.includeTax;
|
|
6729
|
+
const totalRaw = useTax ? props.cart?.total?.totalNet : props.cart?.total?.totalGross;
|
|
6730
|
+
const totalPrice = totalRaw === void 0 || totalRaw === null ? money(0) : money(totalRaw);
|
|
6730
6731
|
const sidebarTitle = props.cartSidebarTitle || props.labels?.["cartSidebarTitle"] || "Shopping cart";
|
|
6731
6732
|
const purchaserPAC = findPurchaserPAC(props.user, props.companyId);
|
|
6732
6733
|
const totalGross = props.cart?.total?.totalGross ?? 0;
|
|
@@ -6936,7 +6937,7 @@ function CartIconAndSidebar(rawProps) {
|
|
|
6936
6937
|
showCartItemNotesField: false,
|
|
6937
6938
|
showCrossupsells: false,
|
|
6938
6939
|
showStockComponent: false,
|
|
6939
|
-
includeTax:
|
|
6940
|
+
includeTax: useTax,
|
|
6940
6941
|
className: "propeller-cart-icon__item",
|
|
6941
6942
|
children: [
|
|
6942
6943
|
/* @__PURE__ */ jsxRuntime.jsx(CartItem_default.Image, { className: "w-20 h-20 flex-shrink-0 bg-surface-hover rounded-control overflow-hidden border border-border-subtle" }),
|
|
@@ -6957,7 +6958,7 @@ function CartIconAndSidebar(rawProps) {
|
|
|
6957
6958
|
},
|
|
6958
6959
|
item.itemId
|
|
6959
6960
|
)) }),
|
|
6960
|
-
/* @__PURE__ */ jsxRuntime.jsx(CartBonusItemsImpl, { cart: props.cart, includeTax:
|
|
6961
|
+
/* @__PURE__ */ jsxRuntime.jsx(CartBonusItemsImpl, { cart: props.cart, includeTax: useTax, className: "mt-4" })
|
|
6961
6962
|
] }),
|
|
6962
6963
|
" ",
|
|
6963
6964
|
items.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-cart-icon__sidebar-footer px-5 py-4 border-t border-border space-y-3 bg-surface-hover", children: [
|
|
@@ -8400,7 +8401,8 @@ function computeUpcomingDates(count, skipWeekends) {
|
|
|
8400
8401
|
}
|
|
8401
8402
|
return days;
|
|
8402
8403
|
}
|
|
8403
|
-
function DeliveryDate(
|
|
8404
|
+
function DeliveryDate(rawProps) {
|
|
8405
|
+
const props = useInfraProps(rawProps);
|
|
8404
8406
|
const [selectedDate, setSelectedDate] = React6.useState("");
|
|
8405
8407
|
const [modalOpen, setModalOpen] = React6.useState(false);
|
|
8406
8408
|
const [customDateValue, setCustomDateValue] = React6.useState("");
|
|
@@ -8421,7 +8423,9 @@ function DeliveryDate(props) {
|
|
|
8421
8423
|
if (!isoDate) return "";
|
|
8422
8424
|
const date = new Date(isoDate);
|
|
8423
8425
|
if (isNaN(date.getTime())) return "";
|
|
8424
|
-
|
|
8426
|
+
const weekday = propellerV2CoreUi.getLabel(props.labels, `day_${date.getDay()}`, WEEKDAYS[date.getDay()]);
|
|
8427
|
+
const month = propellerV2CoreUi.getLabel(props.labels, `month_${date.getMonth()}`, MONTHS[date.getMonth()]);
|
|
8428
|
+
return `${weekday}, ${month} ${date.getDate()}`;
|
|
8425
8429
|
}
|
|
8426
8430
|
function handleSelect(isoDate) {
|
|
8427
8431
|
setSelectedDate(isoDate);
|
|
@@ -8535,6 +8539,7 @@ function DeliveryDate(props) {
|
|
|
8535
8539
|
"input",
|
|
8536
8540
|
{
|
|
8537
8541
|
type: "date",
|
|
8542
|
+
lang: props.language ? props.language.toLowerCase() : void 0,
|
|
8538
8543
|
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"}`,
|
|
8539
8544
|
min: minDate,
|
|
8540
8545
|
value: customDateValue,
|
|
@@ -17147,11 +17152,17 @@ function mapToSearchBarResult(item) {
|
|
|
17147
17152
|
const id = isCluster ? item.clusterId : item.productId;
|
|
17148
17153
|
const slug = item.slugs?.[0]?.value || "";
|
|
17149
17154
|
const url = isCluster ? "/cluster/" + id + "/" + slug : "/product/" + id + "/" + slug;
|
|
17155
|
+
const priceNet = displayItem?.price?.net || 0;
|
|
17156
|
+
const priceGross = displayItem?.price?.gross || 0;
|
|
17150
17157
|
return {
|
|
17151
17158
|
id,
|
|
17152
17159
|
name: item.names?.[0]?.value || "Product",
|
|
17153
17160
|
sku: item.sku || displayItem?.sku || "",
|
|
17154
|
-
price
|
|
17161
|
+
// `price` stays the gross value for back-compat; the row picks net/gross
|
|
17162
|
+
// from the two explicit fields below per the toggle.
|
|
17163
|
+
price: priceGross,
|
|
17164
|
+
priceNet,
|
|
17165
|
+
priceGross,
|
|
17155
17166
|
imageUrl: displayItem?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "",
|
|
17156
17167
|
url,
|
|
17157
17168
|
isCluster
|
|
@@ -17180,6 +17191,13 @@ function SearchBar(rawProps) {
|
|
|
17180
17191
|
}
|
|
17181
17192
|
return propellerV2CoreUi.formatPrice(price || 0, { symbol: props.currency ?? "\u20AC" });
|
|
17182
17193
|
}
|
|
17194
|
+
const useTax = !!props.includeTax;
|
|
17195
|
+
function leadingPrice(result) {
|
|
17196
|
+
return useTax ? result.priceNet ?? result.price ?? 0 : result.priceGross ?? result.price ?? 0;
|
|
17197
|
+
}
|
|
17198
|
+
function priceTaxLabel() {
|
|
17199
|
+
return useTax ? propellerV2CoreUi.getLabel(props.priceLabels, "inclTax", "incl. VAT") : propellerV2CoreUi.getLabel(props.priceLabels, "exclTax", "excl. VAT");
|
|
17200
|
+
}
|
|
17183
17201
|
function noImageUrl() {
|
|
17184
17202
|
return props.noImageUrl || "";
|
|
17185
17203
|
}
|
|
@@ -17298,7 +17316,10 @@ function SearchBar(rawProps) {
|
|
|
17298
17316
|
result.sku
|
|
17299
17317
|
] }) : null
|
|
17300
17318
|
] }),
|
|
17301
|
-
result.price !== void 0 && result.price !== null ? /* @__PURE__ */ jsxRuntime.
|
|
17319
|
+
result.price !== void 0 && result.price !== null ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-search-bar__result-price text-sm font-semibold text-foreground flex-shrink-0 text-right", children: [
|
|
17320
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-search-bar__result-price-value", children: formatItemPrice(leadingPrice(result)) }),
|
|
17321
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-search-bar__result-price-label block text-xs font-normal text-muted-foreground", children: priceTaxLabel() })
|
|
17322
|
+
] }) : null
|
|
17302
17323
|
]
|
|
17303
17324
|
},
|
|
17304
17325
|
result.id + "-" + index
|