@propeller-commerce/propeller-v2-vue-ui 0.3.27 → 0.3.28

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { h as createServices, H as isContact, J as isCustomer, M as ok, j as err, p as getAddresses, x as getDefaultInvoiceAddress, w as getDefaultDeliveryAddress, b as attributeNameMatches, q as getAttributeDisplayName, g as collectAttributeValues, l as filterProductsBySelections, k as extractAttributeValues, y as getLabel, n as formatPrice, o as formatSurcharge, D as getProductImageUrl, E as getProductSku, v as getCountryName, B as getLocalizedValue, z as getLanguageString, s as getClusterSku, r as getClusterImageUrl, c as buildClusterJsonLd, O as safeJsonStringify, d as buildItemListJsonLd, e as buildProductJsonLd } from "./index-BN8nyGRL.js";
1
+ import { h as createServices, H as isContact, J as isCustomer, M as ok, j as err, p as getAddresses, x as getDefaultInvoiceAddress, w as getDefaultDeliveryAddress, b as attributeNameMatches, q as getAttributeDisplayName, g as collectAttributeValues, l as filterProductsBySelections, k as extractAttributeValues, y as getLabel, z as getLanguageString, n as formatPrice, o as formatSurcharge, D as getProductImageUrl, E as getProductSku, v as getCountryName, B as getLocalizedValue, s as getClusterSku, r as getClusterImageUrl, c as buildClusterJsonLd, O as safeJsonStringify, d as buildItemListJsonLd, e as buildProductJsonLd } from "./index-BN8nyGRL.js";
2
2
  import { C, a, f, i, m, t, u, A, F, G, I, K, L, N, P, Q, R, S, T } from "./index-BN8nyGRL.js";
3
3
  import { u as useInfraProps, n as usePropellerDeps, a as PropellerScopeKey, j as _sfc_main$W, d as _sfc_main$X, e as _sfc_main$Y, m as usePropellerContext, h as _sfc_main$Z, i as _sfc_main$_, l as _sfc_main$$ } from "./ProductVideos.vue_vue_type_script_setup_true_lang-BSXOpWBD.js";
4
4
  import { _, b, c, f as f2, g, k, P as P2, p, t as t2, o, q } from "./ProductVideos.vue_vue_type_script_setup_true_lang-BSXOpWBD.js";
@@ -4078,7 +4078,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
4078
4078
  toastVisible.value = false;
4079
4079
  }
4080
4080
  function getProductName() {
4081
- return props.product?.names?.[0]?.value || "Product";
4081
+ return getLanguageString(props.product?.names, props.language || "NL", "Product");
4082
4082
  }
4083
4083
  function getProductUrl() {
4084
4084
  return props.configuration?.urls?.getProductUrl(props.product, props.language) ?? "#";
@@ -4143,7 +4143,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
4143
4143
  }
4144
4144
  function getModalName() {
4145
4145
  if (addedCartItem.value) {
4146
- return addedCartItem.value.product?.names?.[0]?.value || getProductName();
4146
+ return getLanguageString(addedCartItem.value.product?.names, props.language || "NL", "") || getProductName();
4147
4147
  }
4148
4148
  return getProductName();
4149
4149
  }
@@ -4398,7 +4398,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
4398
4398
  key: idx,
4399
4399
  class: "propeller-add-to-cart__modal-child flex justify-between items-center text-xs text-muted-foreground"
4400
4400
  }, [
4401
- createElementVNode("span", _hoisted_35$c, toDisplayString(child.product?.names?.[0]?.value || "Option"), 1),
4401
+ createElementVNode("span", _hoisted_35$c, toDisplayString(unref(getLanguageString)(child.product?.names, __props.language || "NL", "Option")), 1),
4402
4402
  createElementVNode("span", _hoisted_36$c, toDisplayString(getChildItemPrice(child)), 1)
4403
4403
  ]);
4404
4404
  }), 128))
@@ -6311,7 +6311,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
6311
6311
  return getLabel(props.labels, key, fallback);
6312
6312
  }
6313
6313
  function getProductName() {
6314
- return props.cartItem.product?.names?.[0]?.value || "Product";
6314
+ return getLanguageString(props.cartItem.product?.names, props.language || "NL", "Product");
6315
6315
  }
6316
6316
  function getProductUrl() {
6317
6317
  if (props.configuration?.urls && props.cartItem.product) {
@@ -6370,7 +6370,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
6370
6370
  if (!items) return "";
6371
6371
  const leader = items.find((bi) => bi.isLeader === YesNo.Y);
6372
6372
  if (!leader) return "";
6373
- return leader.product.names?.[0]?.value || "Product";
6373
+ return getLanguageString(leader.product.names, props.language || "NL", "Product");
6374
6374
  }
6375
6375
  function getBundleLeaderPrice() {
6376
6376
  const items = props.cartItem.bundle?.items;
@@ -6387,7 +6387,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
6387
6387
  return items.filter((bi) => bi.isLeader !== YesNo.Y);
6388
6388
  }
6389
6389
  function getBundleItemName(bundleItem) {
6390
- return bundleItem.product.names?.[0]?.value || "Product";
6390
+ return getLanguageString(bundleItem.product.names, props.language || "NL", "Product");
6391
6391
  }
6392
6392
  function getBundleItemPrice(bundleItem) {
6393
6393
  const price = bundleItem.price?.net;
@@ -6459,7 +6459,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
6459
6459
  }
6460
6460
  function getCrossupsellName(item) {
6461
6461
  const product = item?.productTo || item?.clusterTo;
6462
- return product?.names?.[0]?.value || "Product";
6462
+ return getLanguageString(product?.names, props.language || "NL", "Product");
6463
6463
  }
6464
6464
  function getCrossupsellImageUrl(item) {
6465
6465
  const product = item?.productTo || item?.clusterTo;
@@ -6638,7 +6638,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
6638
6638
  key: idx,
6639
6639
  class: "propeller-cart-item__option flex flex-wrap gap-x-2 text-sm text-muted-foreground"
6640
6640
  }, [
6641
- createElementVNode("span", _hoisted_22$h, toDisplayString(child.product.names?.[0]?.value || "Option"), 1),
6641
+ createElementVNode("span", _hoisted_22$h, toDisplayString(unref(getLanguageString)(child.product.names, __props.language || "NL", "Option")), 1),
6642
6642
  _cache[10] || (_cache[10] = createElementVNode("span", { class: "text-foreground-subtle hidden sm:inline" }, "-", -1)),
6643
6643
  createElementVNode("span", _hoisted_23$h, toDisplayString(child.product.sku), 1),
6644
6644
  _cache[11] || (_cache[11] = createElementVNode("div", { class: "flex-1 border-b border-dotted border-input mx-1 mb-1" }, null, -1)),