@propeller-commerce/propeller-v2-vue-ui 0.3.14 → 0.3.15

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,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.3.15] - 2026-06-11
12
+
13
+ ### Fixed
14
+
15
+ - **VAT toggle (incl./excl. tax) had no effect on catalog cards.** `ProductGrid`,
16
+ `ProductCard` and `ClusterCard` ignored the `<PropellerProvider>` `includeTax`
17
+ flag, so prices stayed gross (excl. VAT) regardless of the toggle. Two stacked
18
+ causes:
19
+ - **Vue Boolean-prop coercion** — an absent `includeTax?: boolean` prop is cast
20
+ to `false` (never `undefined`), so `useInfraProps`' "explicit prop wins"
21
+ precedence treated the coerced `false` as an override and never consulted the
22
+ provider. The grid now resolves `includeTax` from the provider context
23
+ directly (`usePropellerContext()`), treating only an explicit `true` as a host
24
+ opt-in, and passes the resolved value down to every card.
25
+ - **`inject()` inside a `computed`** — `ProductCard` / `ClusterCard` resolved
26
+ props via `computed(() => useResolvedProps(...))`, where `inject()` returns a
27
+ null context (it is setup-only). Infra is now resolved once at setup via
28
+ `useInfraProps(props)`, so the reactive provider value (the VAT toggle) is
29
+ honoured. Same class of bug as the 0.3.1 provider fix.
30
+
31
+ Brings the Vue cards to parity with `propeller-v2-react-ui`, whose `ProductCard`
32
+ already resolves `includeTax` from infra. Standalone `ProductPrice` /
33
+ `ProductBulkPrices` / `ProductInfo` keep the React contract (the consumer passes
34
+ `includeTax`); the propeller-vue PDP / cluster views were updated accordingly.
35
+
11
36
  ## [0.3.14] - 2026-06-09
12
37
 
13
38
  ### Fixed
@@ -90,8 +90,6 @@ export interface ClusterCardProps {
90
90
  }
91
91
  interface ClusterCardState {
92
92
  isFavorite: boolean;
93
- includeTax: boolean;
94
- priceListener: any;
95
93
  isRow: () => boolean;
96
94
  getClusterName: () => string;
97
95
  getClusterSku: () => string;
@@ -171,8 +171,6 @@ export interface ProductCardProps {
171
171
  }
172
172
  interface ProductCardState {
173
173
  isFavorite: boolean;
174
- includeTax: boolean;
175
- priceListener: any;
176
174
  getProductName: () => string;
177
175
  getProductSku: () => string;
178
176
  getProductImageUrl: () => string;
package/dist/index.cjs CHANGED
@@ -8154,6 +8154,9 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8154
8154
  setup(__props) {
8155
8155
  const props = __props;
8156
8156
  const RESOLVE_SPEC = {
8157
+ // NOTE: includeTax is resolved separately (see `infra`/`resolvedIncludeTax`
8158
+ // below) because the infra fallback must read injected context at setup —
8159
+ // useResolvedProps runs inside a `computed` here, where inject() returns null.
8157
8160
  priceComponent: { grid: "priceComponent" },
8158
8161
  stockComponent: { grid: "stockComponent" },
8159
8162
  imageComponent: { grid: "imageComponent" },
@@ -8161,14 +8164,16 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8161
8164
  favoriteComponent: { grid: "favoriteComponent" }
8162
8165
  };
8163
8166
  const resolved = vue.computed(() => useResolvedProps(props, RESOLVE_SPEC));
8167
+ const infra = ProductVideos_vue_vue_type_script_setup_true_lang.useInfraProps(props);
8168
+ const resolvedIncludeTax = vue.computed(
8169
+ () => props.includeTax === true ? true : !!infra.includeTax
8170
+ );
8164
8171
  const PriceImpl = vue.computed(() => resolved.value.priceComponent ?? ProductVideos_vue_vue_type_script_setup_true_lang._sfc_main$9);
8165
8172
  const StockImpl = vue.computed(() => resolved.value.stockComponent ?? ProductVideos_vue_vue_type_script_setup_true_lang._sfc_main$3);
8166
8173
  const ImageImpl = vue.computed(() => resolved.value.imageComponent ?? _sfc_main$D);
8167
8174
  const BadgesImpl = vue.computed(() => resolved.value.badgesComponent ?? _sfc_main$C);
8168
8175
  const FavoriteImpl = vue.computed(() => resolved.value.favoriteComponent ?? _sfc_main$P);
8169
8176
  const isFavorite = vue.ref(false);
8170
- const includeTax = vue.ref(false);
8171
- vue.ref(null);
8172
8177
  function isRow() {
8173
8178
  return props.columns === 1;
8174
8179
  }
@@ -8215,7 +8220,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8215
8220
  function getClusterPrice() {
8216
8221
  if (!props.showPrice) return "";
8217
8222
  const priceObj = props.cluster?.defaultProduct?.price;
8218
- const useTax = props.includeTax !== void 0 ? !!props.includeTax : includeTax.value;
8223
+ const useTax = resolvedIncludeTax.value;
8219
8224
  const value = useTax ? priceObj?.net : priceObj?.gross;
8220
8225
  if (!value && value !== 0) return "";
8221
8226
  return index.formatPrice(Number(value), { symbol: props.currency ?? "€" });
@@ -8449,14 +8454,14 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8449
8454
  key: 1,
8450
8455
  cluster: __props.cluster,
8451
8456
  price: __props.cluster.defaultProduct?.price,
8452
- includeTax: props.includeTax !== void 0 ? !!props.includeTax : includeTax.value,
8457
+ includeTax: resolvedIncludeTax.value,
8453
8458
  currency: __props.currency,
8454
8459
  labels: __props.labels
8455
8460
  }, () => [
8456
8461
  props.priceComponent ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(PriceImpl.value), {
8457
8462
  key: 0,
8458
8463
  price: __props.cluster.defaultProduct?.price,
8459
- "include-tax": includeTax.value,
8464
+ "include-tax": resolvedIncludeTax.value,
8460
8465
  currency: __props.currency,
8461
8466
  labels: __props.labels
8462
8467
  }, null, 8, ["price", "include-tax", "currency", "labels"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_16$i, vue.toDisplayString(getClusterPrice()), 1))
@@ -8552,7 +8557,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8552
8557
  key: 6,
8553
8558
  cluster: __props.cluster,
8554
8559
  price: __props.cluster.defaultProduct?.price,
8555
- includeTax: props.includeTax !== void 0 ? !!props.includeTax : includeTax.value,
8560
+ includeTax: resolvedIncludeTax.value,
8556
8561
  currency: __props.currency,
8557
8562
  labels: __props.labels
8558
8563
  }, () => [
@@ -8560,7 +8565,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8560
8565
  props.priceComponent ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(PriceImpl.value), {
8561
8566
  key: 0,
8562
8567
  price: __props.cluster.defaultProduct?.price,
8563
- "include-tax": includeTax.value,
8568
+ "include-tax": resolvedIncludeTax.value,
8564
8569
  currency: __props.currency,
8565
8570
  labels: __props.labels
8566
8571
  }, null, 8, ["price", "include-tax", "currency", "labels"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_26$b, vue.toDisplayString(getClusterPrice()), 1))
@@ -15008,6 +15013,9 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
15008
15013
  setup(__props) {
15009
15014
  const props = __props;
15010
15015
  const RESOLVE_SPEC = {
15016
+ // NOTE: includeTax is resolved separately (see `infra`/`resolvedIncludeTax`
15017
+ // below) because the infra fallback must read injected context at setup —
15018
+ // useResolvedProps runs inside a `computed` here, where inject() returns null.
15011
15019
  priceComponent: { grid: "priceComponent" },
15012
15020
  stockComponent: { grid: "stockComponent" },
15013
15021
  addToCartComponent: { grid: "addToCartComponent" },
@@ -15016,6 +15024,10 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
15016
15024
  favoriteComponent: { grid: "favoriteComponent" }
15017
15025
  };
15018
15026
  const resolved = vue.computed(() => useResolvedProps(props, RESOLVE_SPEC));
15027
+ const infra = ProductVideos_vue_vue_type_script_setup_true_lang.useInfraProps(props);
15028
+ const resolvedIncludeTax = vue.computed(
15029
+ () => props.includeTax === true ? true : !!infra.includeTax
15030
+ );
15019
15031
  const PriceImpl = vue.computed(() => resolved.value.priceComponent ?? ProductVideos_vue_vue_type_script_setup_true_lang._sfc_main$9);
15020
15032
  const StockImpl = vue.computed(() => resolved.value.stockComponent ?? ProductVideos_vue_vue_type_script_setup_true_lang._sfc_main$3);
15021
15033
  const AddToCartImpl = vue.computed(() => resolved.value.addToCartComponent ?? _sfc_main$Q);
@@ -15023,8 +15035,6 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
15023
15035
  const BadgesImpl = vue.computed(() => resolved.value.badgesComponent ?? _sfc_main$C);
15024
15036
  const FavoriteImpl = vue.computed(() => resolved.value.favoriteComponent ?? _sfc_main$P);
15025
15037
  const isFavorite = vue.ref(false);
15026
- const includeTax = vue.ref(false);
15027
- vue.ref(null);
15028
15038
  function isRow() {
15029
15039
  return props.columns === 1;
15030
15040
  }
@@ -15290,7 +15300,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
15290
15300
  key: 1,
15291
15301
  product: __props.product,
15292
15302
  price: __props.product.price,
15293
- includeTax: props.includeTax !== void 0 ? !!props.includeTax : includeTax.value,
15303
+ includeTax: resolvedIncludeTax.value,
15294
15304
  currency: __props.currency,
15295
15305
  labels: props.priceLabels
15296
15306
  }, () => [
@@ -15298,13 +15308,13 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
15298
15308
  props.priceComponent ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(PriceImpl.value), {
15299
15309
  key: 0,
15300
15310
  price: __props.product.price,
15301
- "include-tax": props.includeTax !== void 0 ? !!props.includeTax : includeTax.value,
15311
+ "include-tax": resolvedIncludeTax.value,
15302
15312
  currency: __props.currency,
15303
15313
  labels: props.priceLabels
15304
15314
  }, null, 8, ["price", "include-tax", "currency", "labels"])) : (vue.openBlock(), vue.createBlock(ProductVideos_vue_vue_type_script_setup_true_lang._sfc_main$9, {
15305
15315
  key: 1,
15306
15316
  price: __props.product.price,
15307
- includeTax: props.includeTax !== void 0 ? !!props.includeTax : includeTax.value,
15317
+ includeTax: resolvedIncludeTax.value,
15308
15318
  priceSize: "text-sm",
15309
15319
  labels: props.priceLabels
15310
15320
  }, null, 8, ["price", "includeTax", "labels"]))
@@ -15430,7 +15440,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
15430
15440
  key: 6,
15431
15441
  product: __props.product,
15432
15442
  price: __props.product.price,
15433
- includeTax: props.includeTax !== void 0 ? !!props.includeTax : includeTax.value,
15443
+ includeTax: resolvedIncludeTax.value,
15434
15444
  currency: __props.currency,
15435
15445
  labels: props.priceLabels
15436
15446
  }, () => [
@@ -15438,13 +15448,13 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
15438
15448
  props.priceComponent ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(PriceImpl.value), {
15439
15449
  key: 0,
15440
15450
  price: __props.product.price,
15441
- "include-tax": props.includeTax !== void 0 ? !!props.includeTax : includeTax.value,
15451
+ "include-tax": resolvedIncludeTax.value,
15442
15452
  currency: __props.currency,
15443
15453
  labels: props.priceLabels
15444
15454
  }, null, 8, ["price", "include-tax", "currency", "labels"])) : (vue.openBlock(), vue.createBlock(ProductVideos_vue_vue_type_script_setup_true_lang._sfc_main$9, {
15445
15455
  key: 1,
15446
15456
  price: __props.product.price,
15447
- includeTax: props.includeTax !== void 0 ? !!props.includeTax : includeTax.value,
15457
+ includeTax: resolvedIncludeTax.value,
15448
15458
  priceSize: "text-base sm:text-lg",
15449
15459
  labels: props.priceLabels
15450
15460
  }, null, 8, ["price", "includeTax", "labels"]))
@@ -15864,6 +15874,10 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
15864
15874
  setup(__props) {
15865
15875
  const props = __props;
15866
15876
  const infra = ProductVideos_vue_vue_type_script_setup_true_lang.useInfraProps(props);
15877
+ const ctxForTax = ProductVideos_vue_vue_type_script_setup_true_lang.usePropellerContext();
15878
+ const resolvedIncludeTax = vue.computed(
15879
+ () => props.includeTax === true ? true : !!(ctxForTax ? ctxForTax.includeTax : false)
15880
+ );
15867
15881
  const ProductCardImpl = vue.computed(
15868
15882
  () => props.productCardComponent ?? _sfc_main$e
15869
15883
  );
@@ -16052,7 +16066,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
16052
16066
  columns: props.columns || 3,
16053
16067
  cluster: item,
16054
16068
  configuration: vue.unref(infra).configuration,
16055
- includeTax: vue.unref(infra).includeTax,
16069
+ includeTax: resolvedIncludeTax.value,
16056
16070
  showPrice: props.showPrice,
16057
16071
  language: vue.unref(infra).language || "NL",
16058
16072
  showStock: props.showStock,
@@ -16080,7 +16094,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
16080
16094
  graphqlClient: vue.unref(infra).graphqlClient,
16081
16095
  user: vue.unref(infra).user || null,
16082
16096
  configuration: vue.unref(infra).configuration,
16083
- includeTax: vue.unref(infra).includeTax,
16097
+ includeTax: resolvedIncludeTax.value,
16084
16098
  cartId: props.cartId,
16085
16099
  createCart: props.createCart,
16086
16100
  onCartCreated: props.onCartCreated,