@propeller-commerce/propeller-v2-vue-ui 0.3.33 → 0.3.34

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,7 +1,7 @@
1
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
- 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
- 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";
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-BGWkb9cO.js";
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-BGWkb9cO.js";
5
5
  import { provide, inject, ref, unref, computed, watch, markRaw, defineComponent, reactive, renderSlot, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, Fragment, createTextVNode, onMounted, onUnmounted, withModifiers, renderList, normalizeClass, createBlock, resolveDynamicComponent, withCtx, normalizeStyle, createVNode, createStaticVNode, withKeys, mergeProps, nextTick, createSlots, normalizeProps, guardReactiveProps } from "vue";
6
6
  import { YesNo, AddressType, CartService, CartStatus, CartAddressType, Gender, PurchaseRole, CrossupsellType, PaymentStatuses, OrderSearchFields, OrderItemClass, ProductSortField, ProductSearchableField, ProductStatus, SortOrder, AttributeType, OrderSortField, OrderType, BundleCondition } from "@propeller-commerce/propeller-sdk-v2";
7
7
  const ProductGridInjectionKey = /* @__PURE__ */ Symbol("propeller-product-grid");
@@ -6926,6 +6926,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
6926
6926
  cartPageButton: { type: Boolean, default: true },
6927
6927
  onCartPageButtonClick: {},
6928
6928
  labels: {},
6929
+ cartItemLabels: {},
6929
6930
  user: {},
6930
6931
  companyId: {},
6931
6932
  onRequestQuoteClick: {},
@@ -7170,6 +7171,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
7170
7171
  language: __props.language,
7171
7172
  configuration: __props.configuration,
7172
7173
  companyId: __props.companyId,
7174
+ labels: __props.cartItemLabels,
7173
7175
  cardFrame: false,
7174
7176
  showDelete: false,
7175
7177
  readOnlyQuantity: true,
@@ -7207,7 +7209,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
7207
7209
  }, toDisplayString(name), 9, _hoisted_27$f)) : createCommentVNode("", true)
7208
7210
  ]),
7209
7211
  _: 1
7210
- }, 40, ["cartItem", "cartId", "graphqlClient", "user", "language", "configuration", "companyId", "onTitleClick", "includeTax"]);
7212
+ }, 40, ["cartItem", "cartId", "graphqlClient", "user", "language", "configuration", "companyId", "labels", "onTitleClick", "includeTax"]);
7211
7213
  }), 128)) : createCommentVNode("", true),
7212
7214
  (openBlock(), createBlock(resolveDynamicComponent(CartBonusItemsImpl.value), {
7213
7215
  cart: __props.cart,
@@ -7402,11 +7404,11 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
7402
7404
  const requestDate = computed(() => {
7403
7405
  const date = props.cart?.postageData?.requestDate;
7404
7406
  if (!date) return "";
7405
- try {
7406
- return new Date(date).toLocaleDateString();
7407
- } catch {
7408
- return date;
7409
- }
7407
+ const d = new Date(date);
7408
+ if (isNaN(d.getTime())) return date;
7409
+ const day = String(d.getDate()).padStart(2, "0");
7410
+ const month = String(d.getMonth() + 1).padStart(2, "0");
7411
+ return `${day}-${month}-${d.getFullYear()}`;
7410
7412
  });
7411
7413
  const isPurchaseDisabled = computed(() => {
7412
7414
  if (showTermsAndConditions.value && !termsAccepted.value) return true;
@@ -7593,7 +7595,8 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
7593
7595
  showPaymethodLogo: { type: Boolean, default: true },
7594
7596
  onPaymethodSelect: {},
7595
7597
  formatPrice: {},
7596
- labels: {}
7598
+ labels: {},
7599
+ paymethodLabels: {}
7597
7600
  },
7598
7601
  setup(__props) {
7599
7602
  const props = __props;
@@ -7636,6 +7639,10 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
7636
7639
  },
7637
7640
  { immediate: true }
7638
7641
  );
7642
+ function methodName(method) {
7643
+ const code = (method.code || "").toLowerCase();
7644
+ return props.paymethodLabels?.[code] || method.name || method.code || "";
7645
+ }
7639
7646
  function isOnAccountMethod(method) {
7640
7647
  const code = (method.code || "").toLowerCase();
7641
7648
  return code === "on_account" || code === "onaccount" || code === "on-account";
@@ -7675,10 +7682,10 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
7675
7682
  createElementVNode("img", {
7676
7683
  class: "propeller-cart-paymethods__method-logo max-h-10 max-w-[80%] w-auto object-contain",
7677
7684
  src: getLogoUrl(method),
7678
- alt: method.name || method.code
7685
+ alt: methodName(method)
7679
7686
  }, null, 8, _hoisted_5$x)
7680
7687
  ])) : createCommentVNode("", true),
7681
- createElementVNode("span", _hoisted_6$w, toDisplayString(method.name || method.code), 1)
7688
+ createElementVNode("span", _hoisted_6$w, toDisplayString(methodName(method)), 1)
7682
7689
  ], 10, _hoisted_2$C);
7683
7690
  }), 128))
7684
7691
  ])) : createCommentVNode("", true),
@@ -11344,10 +11351,11 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
11344
11351
  if (props.formatDate) return props.formatDate(dateString);
11345
11352
  if (!dateString) return "-";
11346
11353
  const d = new Date(dateString);
11354
+ if (isNaN(d.getTime())) return dateString;
11347
11355
  const day = String(d.getDate()).padStart(2, "0");
11348
11356
  const month = String(d.getMonth() + 1).padStart(2, "0");
11349
11357
  const year = d.getFullYear();
11350
- return `${day}/${month}/${year}`;
11358
+ return `${day}-${month}-${year}`;
11351
11359
  }
11352
11360
  function getProductCount(list) {
11353
11361
  const products = list.products;
@@ -13888,7 +13896,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
13888
13896
  function formatDate(dateString) {
13889
13897
  if (props.formatDate) return props.formatDate(dateString);
13890
13898
  if (!dateString) return "-";
13891
- return new Date(dateString).toLocaleDateString();
13899
+ const d = new Date(dateString);
13900
+ if (isNaN(d.getTime())) return dateString;
13901
+ const day = String(d.getDate()).padStart(2, "0");
13902
+ const month = String(d.getMonth() + 1).padStart(2, "0");
13903
+ return `${day}-${month}-${d.getFullYear()}`;
13892
13904
  }
13893
13905
  function formatPrice$1(price) {
13894
13906
  if (props.formatPrice) return props.formatPrice(price);
@@ -14391,7 +14403,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
14391
14403
  function formatDate(dateStr) {
14392
14404
  if (!dateStr) return "-";
14393
14405
  const d = new Date(dateStr);
14394
- return `${d.getDate()}.${d.getMonth() + 1}.${d.getFullYear()}`;
14406
+ if (isNaN(d.getTime())) return dateStr;
14407
+ const day = String(d.getDate()).padStart(2, "0");
14408
+ const month = String(d.getMonth() + 1).padStart(2, "0");
14409
+ return `${day}-${month}-${d.getFullYear()}`;
14395
14410
  }
14396
14411
  function getOrderItemForShipmentItem(shipmentItem) {
14397
14412
  if (!props.order?.items || !shipmentItem.orderItemId) return null;
@@ -14616,16 +14631,19 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
14616
14631
  props: {
14617
14632
  label: {},
14618
14633
  labels: {},
14634
+ value: { type: Boolean },
14619
14635
  initialState: { type: Boolean },
14620
14636
  inclExclVatSwitched: { type: Function },
14621
14637
  className: {}
14622
14638
  },
14623
14639
  setup(__props) {
14624
14640
  const props = __props;
14625
- const isOn = ref(props.initialState ?? true);
14641
+ const isControlled = computed(() => props.value !== void 0);
14642
+ const internal = ref(props.initialState ?? true);
14643
+ const isOn = computed(() => isControlled.value ? !!props.value : internal.value);
14626
14644
  onMounted(() => {
14627
- if (typeof window !== "undefined") {
14628
- isOn.value = props.initialState ?? true;
14645
+ if (!isControlled.value && typeof window !== "undefined") {
14646
+ internal.value = props.initialState ?? true;
14629
14647
  }
14630
14648
  });
14631
14649
  function getLabel$1() {
@@ -14636,7 +14654,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
14636
14654
  }
14637
14655
  function handleToggle() {
14638
14656
  const newValue = !isOn.value;
14639
- isOn.value = newValue;
14657
+ if (!isControlled.value) {
14658
+ internal.value = newValue;
14659
+ }
14640
14660
  if (props.inclExclVatSwitched) {
14641
14661
  props.inclExclVatSwitched(newValue);
14642
14662
  }
@@ -18456,7 +18476,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
18456
18476
  if (props.formatDate) return props.formatDate(dateStr);
18457
18477
  if (!dateStr) return "-";
18458
18478
  const d = new Date(dateStr);
18459
- return `${d.getDate()}.${d.getMonth() + 1}.${d.getFullYear()}`;
18479
+ if (isNaN(d.getTime())) return dateStr;
18480
+ const day = String(d.getDate()).padStart(2, "0");
18481
+ const month = String(d.getMonth() + 1).padStart(2, "0");
18482
+ return `${day}-${month}-${d.getFullYear()}`;
18460
18483
  }
18461
18484
  function formatPrice$1(price) {
18462
18485
  if (props.formatPrice) return props.formatPrice(price);