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

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.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index = require("./index-CrrZsxTR.cjs");
4
- const ProductVideos_vue_vue_type_script_setup_true_lang = require("./ProductVideos.vue_vue_type_script_setup_true_lang-7UMkFuC2.cjs");
4
+ const ProductVideos_vue_vue_type_script_setup_true_lang = require("./ProductVideos.vue_vue_type_script_setup_true_lang-D198YXi0.cjs");
5
5
  const vue = require("vue");
6
6
  const propellerSdkV2 = require("@propeller-commerce/propeller-sdk-v2");
7
7
  const ProductGridInjectionKey = /* @__PURE__ */ Symbol("propeller-product-grid");
@@ -1549,7 +1549,7 @@ function useOrders(options) {
1549
1549
  const orders = vue.ref([]);
1550
1550
  const loading = vue.ref(false);
1551
1551
  const error = vue.ref(null);
1552
- const searchForm = vue.ref({});
1552
+ const searchForm = vue.ref(options.initialSearchForm ?? {});
1553
1553
  const currentOrder = vue.ref(null);
1554
1554
  const orderLoading = vue.ref(false);
1555
1555
  const termFields = options.termFields ?? [
@@ -3184,6 +3184,11 @@ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
3184
3184
  function getLabel(key, fallback) {
3185
3185
  return index.getLabel(props.labels, key, fallback);
3186
3186
  }
3187
+ const noAccountParts = vue.computed(() => {
3188
+ const tpl = getLabel("noAccount", "Don't have an account? {link}");
3189
+ const [before, after = ""] = tpl.split("{link}");
3190
+ return { before, after };
3191
+ });
3187
3192
  async function handleSubmit(e) {
3188
3193
  e.preventDefault();
3189
3194
  if (props.beforeLogin) {
@@ -3370,7 +3375,7 @@ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
3370
3375
  }, vue.toDisplayString(getLabel("forgotPassword", "Forgot Password?")), 1)
3371
3376
  ]) : vue.createCommentVNode("", true),
3372
3377
  vue.createElementVNode("div", _hoisted_20$n, [
3373
- vue.createTextVNode(vue.toDisplayString(getLabel("noAccount", "Don't have an account?")), 1),
3378
+ vue.createTextVNode(vue.toDisplayString(noAccountParts.value.before), 1),
3374
3379
  __props.displayRegisterLink !== false ? vue.renderSlot(_ctx.$slots, "registerLink", {
3375
3380
  key: 0,
3376
3381
  onClick: (e) => __props.onRegisterClick?.(e),
@@ -3383,7 +3388,8 @@ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
3383
3388
  if (__props.onRegisterClick) __props.onRegisterClick();
3384
3389
  })
3385
3390
  }, vue.toDisplayString(getLabel("registerLink", "Register")), 1)
3386
- ]) : vue.createCommentVNode("", true)
3391
+ ]) : vue.createCommentVNode("", true),
3392
+ vue.createTextVNode(vue.toDisplayString(noAccountParts.value.after), 1)
3387
3393
  ])
3388
3394
  ])) : vue.createCommentVNode("", true)
3389
3395
  ], 8, _hoisted_1$P);
@@ -3400,7 +3406,7 @@ const _hoisted_4$J = { class: "propeller-account-menu__user-label text-xs text-m
3400
3406
  const _hoisted_5$I = { class: "propeller-account-menu__user-name font-medium text-foreground truncate" };
3401
3407
  const _hoisted_6$H = { class: "propeller-account-menu__nav py-2" };
3402
3408
  const _hoisted_7$H = { class: "propeller-account-menu__list space-y-0.5" };
3403
- const _hoisted_8$D = ["onClick", "data-active"];
3409
+ const _hoisted_8$D = ["href", "onClick", "data-active"];
3404
3410
  const _hoisted_9$B = { class: "propeller-account-menu__logout-wrapper px-4 py-3 border-t border-border" };
3405
3411
  const _hoisted_10$z = ["aria-label", "data-open"];
3406
3412
  const _hoisted_11$v = {
@@ -3423,7 +3429,7 @@ const _hoisted_15$s = { class: "propeller-account-menu__user-label text-xs text-
3423
3429
  const _hoisted_16$r = { class: "propeller-account-menu__user-name font-medium text-foreground truncate" };
3424
3430
  const _hoisted_17$q = { class: "propeller-account-menu__nav" };
3425
3431
  const _hoisted_18$o = { class: "propeller-account-menu__list space-y-0.5" };
3426
- const _hoisted_19$o = ["onClick"];
3432
+ const _hoisted_19$o = ["href", "onClick"];
3427
3433
  const _hoisted_20$m = { class: "propeller-account-menu__logout-wrapper mt-3 pt-3 border-t border-border" };
3428
3434
  const _hoisted_21$k = {
3429
3435
  key: 1,
@@ -3558,6 +3564,13 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
3558
3564
  menuOpen.value = false;
3559
3565
  if (props.onMenuItemClick) props.onMenuItemClick(href);
3560
3566
  }
3567
+ function handleMenuLinkClick(event, href) {
3568
+ if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
3569
+ return;
3570
+ }
3571
+ event.preventDefault();
3572
+ handleMenuItemClick(href);
3573
+ }
3561
3574
  function handleLogoutClick() {
3562
3575
  menuOpen.value = false;
3563
3576
  if (props.onLogoutClick) props.onLogoutClick();
@@ -3599,9 +3612,9 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
3599
3612
  key: link.href,
3600
3613
  class: "propeller-account-menu__item"
3601
3614
  }, [
3602
- vue.createElementVNode("button", {
3603
- type: "button",
3604
- onClick: async (event) => handleMenuItemClick(link.href),
3615
+ vue.createElementVNode("a", {
3616
+ href: link.href,
3617
+ onClick: (event) => handleMenuLinkClick(event, link.href),
3605
3618
  "data-active": isActiveLink(link.href) ? "true" : "false",
3606
3619
  class: vue.normalizeClass(`propeller-account-menu__link flex w-full items-center gap-3 px-4 py-2.5 text-sm font-medium transition-colors ${isActiveLink(link.href) ? "bg-secondary/5 text-secondary border-l-2 border-secondary" : "text-muted-foreground hover:bg-surface-hover hover:text-foreground"}`)
3607
3620
  }, vue.toDisplayString(link.label), 11, _hoisted_8$D)
@@ -3655,10 +3668,10 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
3655
3668
  key: link.href,
3656
3669
  class: "propeller-account-menu__item"
3657
3670
  }, [
3658
- vue.createElementVNode("button", {
3659
- type: "button",
3671
+ vue.createElementVNode("a", {
3672
+ href: link.href,
3660
3673
  class: "propeller-account-menu__link flex w-full items-center gap-3 px-3 py-2 text-sm font-medium rounded-[var(--radius-control)] text-muted-foreground hover:bg-surface-hover hover:text-foreground transition-colors",
3661
- onClick: async (event) => handleMenuItemClick(link.href)
3674
+ onClick: (event) => handleMenuLinkClick(event, link.href)
3662
3675
  }, vue.toDisplayString(link.label), 9, _hoisted_19$o)
3663
3676
  ]);
3664
3677
  }), 128))
@@ -4941,6 +4954,7 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
4941
4954
  enableDelete: { type: Boolean, default: true },
4942
4955
  enableSetDefault: { type: Boolean, default: true },
4943
4956
  showDefaultBadge: { type: Boolean, default: false },
4957
+ showTypeBadge: { type: Boolean },
4944
4958
  onEdit: {},
4945
4959
  afterEdit: {},
4946
4960
  onDelete: {},
@@ -5105,7 +5119,7 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
5105
5119
  "data-type": addr.value?.type || ""
5106
5120
  }, [
5107
5121
  vue.createElementVNode("div", _hoisted_3$J, [
5108
- __props.addressType ? vue.renderSlot(_ctx.$slots, "typeBadge", {
5122
+ __props.addressType && __props.showTypeBadge !== false ? vue.renderSlot(_ctx.$slots, "typeBadge", {
5109
5123
  key: 0,
5110
5124
  address: addr.value,
5111
5125
  addressType: __props.addressType,
@@ -7418,6 +7432,11 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
7418
7432
  function getLabel(key, fallback) {
7419
7433
  return index.getLabel(props.labels, key, fallback);
7420
7434
  }
7435
+ const termsConsentParts = vue.computed(() => {
7436
+ const tpl = getLabel("termsConsent", "I agree to the {link}");
7437
+ const [before, after = ""] = tpl.split("{link}");
7438
+ return { before, after };
7439
+ });
7421
7440
  function getCountryName(code) {
7422
7441
  return index.getCountryName(code, props.countries);
7423
7442
  }
@@ -7537,12 +7556,13 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
7537
7556
  onChange: _cache[2] || (_cache[2] = async (event) => handleTermsChange(event.target.checked))
7538
7557
  }, null, 40, _hoisted_30$c),
7539
7558
  vue.createElementVNode("label", _hoisted_31$c, [
7540
- vue.createTextVNode(vue.toDisplayString(getLabel("termsPrefix", "I agree to the")), 1),
7559
+ vue.createTextVNode(vue.toDisplayString(termsConsentParts.value.before), 1),
7541
7560
  vue.createElementVNode("a", {
7542
7561
  href: "#",
7543
7562
  class: "text-primary hover:underline font-medium",
7544
7563
  onClick: _cache[3] || (_cache[3] = async (event) => handleTermsLinkClick(event))
7545
- }, vue.toDisplayString(getLabel("termsLink", "Terms and Conditions")), 1)
7564
+ }, vue.toDisplayString(getLabel("termsLink", "Terms and Conditions")), 1),
7565
+ vue.createTextVNode(vue.toDisplayString(termsConsentParts.value.after), 1)
7546
7566
  ])
7547
7567
  ])) : vue.createCommentVNode("", true),
7548
7568
  showPurchaseButton.value ? (vue.openBlock(), vue.createElementBlock("button", {
@@ -11377,6 +11397,11 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
11377
11397
  function getLabel(key, fallback) {
11378
11398
  return index.getLabel(props.labels, key, fallback);
11379
11399
  }
11400
+ const deletePromptParts = vue.computed(() => {
11401
+ const tpl = getLabel("deleteConfirm", 'Are you sure you want to delete "{name}"?');
11402
+ const [before, after = ""] = tpl.split("{name}");
11403
+ return { before, after };
11404
+ });
11380
11405
  return (_ctx, _cache) => {
11381
11406
  return vue.openBlock(), vue.createElementBlock("div", {
11382
11407
  class: vue.normalizeClass(`propeller-favorite-lists ${__props.className || ""}`),
@@ -11536,7 +11561,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
11536
11561
  y2: "12"
11537
11562
  })
11538
11563
  ], -1)),
11539
- vue.createTextVNode(vue.toDisplayString(getTotalCount(list)) + " " + vue.toDisplayString(getLabel("items", "items")), 1)
11564
+ vue.createTextVNode(vue.toDisplayString(getTotalCount(list)) + " " + vue.toDisplayString(getTotalCount(list) === 1 ? getLabel("itemSingular", "item") : getLabel("itemPlural", "items")), 1)
11540
11565
  ])) : vue.createCommentVNode("", true)
11541
11566
  ])
11542
11567
  ])) : vue.createCommentVNode("", true)
@@ -11690,9 +11715,9 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
11690
11715
  ]),
11691
11716
  vue.createElementVNode("div", _hoisted_46$7, [
11692
11717
  vue.createElementVNode("p", _hoisted_47$7, [
11693
- vue.createTextVNode(vue.toDisplayString(getLabel("deleteConfirm", "Are you sure you want to delete")), 1),
11694
- vue.createElementVNode("strong", null, '"' + vue.toDisplayString(vue.unref(listToDelete)?.name) + '"', 1),
11695
- _cache[20] || (_cache[20] = vue.createTextVNode("? ", -1))
11718
+ vue.createTextVNode(vue.toDisplayString(deletePromptParts.value.before), 1),
11719
+ vue.createElementVNode("strong", null, vue.toDisplayString(vue.unref(listToDelete)?.name), 1),
11720
+ vue.createTextVNode(vue.toDisplayString(deletePromptParts.value.after), 1)
11696
11721
  ]),
11697
11722
  vue.createElementVNode("p", _hoisted_48$7, vue.toDisplayString(getLabel("deleteWarning", "This action cannot be undone.")), 1)
11698
11723
  ]),
@@ -12478,6 +12503,8 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
12478
12503
  [propellerSdkV2.SortOrder.DESC]: "High to Low",
12479
12504
  clearAll: "Clear All",
12480
12505
  products: " Products",
12506
+ productSingular: "Product",
12507
+ productPlural: "Products",
12481
12508
  from: "from",
12482
12509
  results: "results",
12483
12510
  perPage: " per page",
@@ -12576,7 +12603,7 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
12576
12603
  }, [
12577
12604
  vue.createElementVNode("div", _hoisted_2$m, [
12578
12605
  vue.createElementVNode("div", _hoisted_3$m, [
12579
- __props.itemsFound !== void 0 && __props.itemsFound > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$j, vue.toDisplayString(__props.itemsFound) + vue.toDisplayString(getLabel("products")), 1)) : vue.createCommentVNode("", true)
12606
+ __props.itemsFound !== void 0 && __props.itemsFound > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$j, vue.toDisplayString(__props.itemsFound) + " " + vue.toDisplayString(__props.itemsFound === 1 ? getLabel("productSingular") : getLabel("productPlural")), 1)) : vue.createCommentVNode("", true)
12580
12607
  ]),
12581
12608
  vue.createElementVNode("div", _hoisted_5$j, [
12582
12609
  vue.createElementVNode("select", {
@@ -13824,6 +13851,8 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
13824
13851
  columnConfig: {},
13825
13852
  enableSearch: { type: Boolean },
13826
13853
  searchFields: {},
13854
+ initialSearchForm: {},
13855
+ onSearchApply: { type: Function },
13827
13856
  termFields: {},
13828
13857
  companyId: {},
13829
13858
  orderStatus: {},
@@ -13836,6 +13865,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
13836
13865
  formatPrice: { type: Function },
13837
13866
  formatDate: { type: Function },
13838
13867
  getStatusColor: { type: Function },
13868
+ statusLabels: {},
13839
13869
  labels: {},
13840
13870
  onCartCreated: { type: Function },
13841
13871
  afterReorder: { type: Function },
@@ -13867,7 +13897,8 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
13867
13897
  configuration: infra.configuration,
13868
13898
  channelIds: props.channelIds,
13869
13899
  onCartCreated: props.onCartCreated,
13870
- afterReorder: props.afterReorder
13900
+ afterReorder: props.afterReorder,
13901
+ initialSearchForm: props.initialSearchForm
13871
13902
  });
13872
13903
  const columns = vue.ref(
13873
13904
  props.columns || ["id", "date", "status", "total"]
@@ -13907,6 +13938,9 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
13907
13938
  if (!price) return "-";
13908
13939
  return index.formatPrice(price, { symbol: infra.currency ?? "€" });
13909
13940
  }
13941
+ function statusLabel(status) {
13942
+ return props.statusLabels?.[status] || status;
13943
+ }
13910
13944
  function getStatusColor(status) {
13911
13945
  if (props.getStatusColor) return props.getStatusColor(status);
13912
13946
  switch (status) {
@@ -14174,11 +14208,15 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
14174
14208
  class: "propeller-order-list__clear-btn inline-flex items-center px-4 py-2 border border-input text-sm font-medium rounded-[var(--radius-control)] shadow-sm text-muted-foreground bg-card hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",
14175
14209
  onClick: _cache[11] || (_cache[11] = async (event) => {
14176
14210
  vue.unref(resetSearch)();
14211
+ props.onSearchApply?.({});
14177
14212
  })
14178
14213
  }, vue.toDisplayString(getLabel("clearButton", "Clear")), 1),
14179
14214
  vue.createElementVNode("button", {
14180
14215
  class: "propeller-order-list__search-btn inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-[var(--radius-control)] shadow-sm text-primary-foreground bg-primary hover:bg-primary/80 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",
14181
- onClick: _cache[12] || (_cache[12] = async (event) => vue.unref(fetchOrders)(1))
14216
+ onClick: _cache[12] || (_cache[12] = async (event) => {
14217
+ vue.unref(fetchOrders)(1);
14218
+ props.onSearchApply?.(vue.unref(searchForm));
14219
+ })
14182
14220
  }, vue.toDisplayString(getLabel("searchButton", "Search")), 1)
14183
14221
  ])
14184
14222
  ])) : vue.createCommentVNode("", true),
@@ -14201,7 +14239,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
14201
14239
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(orders), (order, index2) => {
14202
14240
  return vue.openBlock(), vue.createElementBlock("tr", {
14203
14241
  key: order.id,
14204
- class: "propeller-order-list__row hover:bg-surface-hover",
14242
+ class: vue.normalizeClass(`propeller-order-list__row hover:bg-surface-hover ${rowsClickable.value ? "cursor-pointer" : ""}`),
14205
14243
  "data-clickable": rowsClickable.value ? "true" : "false",
14206
14244
  onClick: async (event) => rowsClickable.value && __props.onOrderClick(order.id)
14207
14245
  }, [
@@ -14221,7 +14259,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
14221
14259
  class: vue.normalizeClass(`propeller-order-list__status px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${getStatusColor(
14222
14260
  order.status
14223
14261
  )}`)
14224
- }, vue.toDisplayString(order.status), 11, _hoisted_38$6)) : vue.createCommentVNode("", true),
14262
+ }, vue.toDisplayString(statusLabel(order.status)), 11, _hoisted_38$6)) : vue.createCommentVNode("", true),
14225
14263
  col === "total" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
14226
14264
  vue.createTextVNode(vue.toDisplayString(formatPrice(order.total?.net)), 1)
14227
14265
  ], 64)) : vue.createCommentVNode("", true),
@@ -14248,7 +14286,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
14248
14286
  ], 64)) : vue.createCommentVNode("", true)
14249
14287
  ], 10, _hoisted_36$6);
14250
14288
  }), 128))
14251
- ], 8, _hoisted_35$6);
14289
+ ], 10, _hoisted_35$6);
14252
14290
  }), 128))
14253
14291
  ])
14254
14292
  ])
@@ -18740,6 +18778,11 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
18740
18778
  function getLabel(key, fallback) {
18741
18779
  return index.getLabel(props.labels, key, fallback);
18742
18780
  }
18781
+ const termsConsentParts = vue.computed(() => {
18782
+ const tpl = getLabel("termsConsent", "I agree to the {link}");
18783
+ const [before, after = ""] = tpl.split("{link}");
18784
+ return { before, after };
18785
+ });
18743
18786
  function handleTermsChange(checked) {
18744
18787
  termsAccepted.value = checked;
18745
18788
  }
@@ -18777,12 +18820,13 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
18777
18820
  onChange: _cache[0] || (_cache[0] = async (event) => handleTermsChange(event.target.checked))
18778
18821
  }, null, 40, _hoisted_4$3),
18779
18822
  vue.createElementVNode("label", _hoisted_5$3, [
18780
- vue.createTextVNode(vue.toDisplayString(getLabel("termsPrefix", "I agree to the")), 1),
18823
+ vue.createTextVNode(vue.toDisplayString(termsConsentParts.value.before), 1),
18781
18824
  vue.createElementVNode("a", {
18782
18825
  href: "#",
18783
18826
  class: "text-primary hover:underline font-medium",
18784
18827
  onClick: _cache[1] || (_cache[1] = async (event) => handleTermsLinkClick(event))
18785
- }, vue.toDisplayString(getLabel("termsLink", "Terms and Conditions")), 1)
18828
+ }, vue.toDisplayString(getLabel("termsLink", "Terms and Conditions")), 1),
18829
+ vue.createTextVNode(vue.toDisplayString(termsConsentParts.value.after), 1)
18786
18830
  ])
18787
18831
  ])) : vue.createCommentVNode("", true),
18788
18832
  vue.createElementVNode("button", {
@@ -19881,24 +19925,24 @@ const _hoisted_5$1 = {
19881
19925
  class: "propeller-search-bar__dropdown absolute top-full left-0 right-0 mt-2 bg-card rounded-[var(--radius-container)] shadow-xl border z-50 flex flex-col max-h-96"
19882
19926
  };
19883
19927
  const _hoisted_6$1 = { class: "propeller-search-bar__results flex-1 overflow-y-auto" };
19884
- const _hoisted_7$1 = ["onClick"];
19885
- const _hoisted_8$1 = {
19928
+ const _hoisted_7$1 = {
19886
19929
  key: 0,
19887
19930
  class: "propeller-search-bar__result-media relative w-16 h-16 flex-shrink-0"
19888
19931
  };
19889
- const _hoisted_9$1 = ["src", "alt"];
19890
- const _hoisted_10$1 = { class: "flex-1 min-w-0" };
19891
- const _hoisted_11$1 = { class: "propeller-search-bar__result-name font-semibold truncate" };
19892
- const _hoisted_12$1 = {
19932
+ const _hoisted_8$1 = ["src", "alt"];
19933
+ const _hoisted_9$1 = { class: "flex-1 min-w-0" };
19934
+ const _hoisted_10$1 = { class: "propeller-search-bar__result-name font-semibold truncate" };
19935
+ const _hoisted_11$1 = {
19893
19936
  key: 0,
19894
19937
  class: "propeller-search-bar__result-sku text-sm text-muted-foreground"
19895
19938
  };
19896
- const _hoisted_13$1 = {
19939
+ const _hoisted_12$1 = {
19897
19940
  key: 1,
19898
19941
  class: "propeller-search-bar__result-price text-sm font-semibold text-foreground flex-shrink-0 text-right"
19899
19942
  };
19900
- const _hoisted_14$1 = { class: "propeller-search-bar__result-price-value" };
19901
- const _hoisted_15$1 = { class: "propeller-search-bar__result-price-label block text-xs font-normal text-muted-foreground" };
19943
+ const _hoisted_13$1 = { class: "propeller-search-bar__result-price-value" };
19944
+ const _hoisted_14$1 = { class: "propeller-search-bar__result-price-label block text-xs font-normal text-muted-foreground" };
19945
+ const _hoisted_15$1 = ["href"];
19902
19946
  const _hoisted_16$1 = {
19903
19947
  key: 1,
19904
19948
  class: "propeller-search-bar__empty p-4 text-center text-muted-foreground"
@@ -19918,6 +19962,8 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
19918
19962
  onSubmit: { type: Function },
19919
19963
  onResultClick: { type: Function },
19920
19964
  onViewAllClick: { type: Function },
19965
+ getResultHref: { type: Function },
19966
+ getViewAllHref: { type: Function },
19921
19967
  formatPrice: { type: Function },
19922
19968
  labels: {},
19923
19969
  includeTax: { type: Boolean },
@@ -20071,6 +20117,21 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
20071
20117
  }
20072
20118
  showDropdown.value = false;
20073
20119
  }
20120
+ function isModifiedClick(event) {
20121
+ return event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
20122
+ }
20123
+ function handleResultAnchorClick(event, result) {
20124
+ if (props.getResultHref) {
20125
+ if (isModifiedClick(event)) return;
20126
+ event.preventDefault();
20127
+ }
20128
+ handleResultClick(result);
20129
+ }
20130
+ function handleViewAllAnchorClick(event) {
20131
+ if (isModifiedClick(event)) return;
20132
+ event.preventDefault();
20133
+ handleViewAllClick();
20134
+ }
20074
20135
  return (_ctx, _cache) => {
20075
20136
  return vue.openBlock(), vue.createElementBlock("div", {
20076
20137
  "data-search-bar": true,
@@ -20082,7 +20143,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
20082
20143
  onSubmit: _cache[1] || (_cache[1] = async (e) => handleSubmit(e))
20083
20144
  }, [
20084
20145
  vue.createElementVNode("div", _hoisted_2$1, [
20085
- _cache[4] || (_cache[4] = vue.createElementVNode("button", {
20146
+ _cache[3] || (_cache[3] = vue.createElementVNode("button", {
20086
20147
  type: "submit",
20087
20148
  class: "propeller-search-bar__submit absolute left-3 top-1/2 transform -translate-y-1/2 p-0 bg-transparent border-none cursor-pointer"
20088
20149
  }, [
@@ -20108,7 +20169,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
20108
20169
  value: searchTerm.value,
20109
20170
  onInput: _cache[0] || (_cache[0] = async (e) => handleInputChange(e.target.value))
20110
20171
  }, null, 40, _hoisted_3$1),
20111
- vue.unref(isLoading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [..._cache[3] || (_cache[3] = [
20172
+ vue.unref(isLoading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [..._cache[2] || (_cache[2] = [
20112
20173
  vue.createElementVNode("div", { class: "propeller-search-bar__spinner animate-spin rounded-full h-5 w-5 border-b-2 border-primary" }, null, -1)
20113
20174
  ])])) : vue.createCommentVNode("", true)
20114
20175
  ])
@@ -20117,34 +20178,46 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
20117
20178
  results.value.length > 0 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
20118
20179
  vue.createElementVNode("div", _hoisted_6$1, [
20119
20180
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(results.value, (result, index2) => {
20120
- return vue.openBlock(), vue.createElementBlock("div", {
20181
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.getResultHref ? "a" : "div"), {
20121
20182
  key: result.id + "-" + index2,
20183
+ href: props.getResultHref ? props.getResultHref(result) : void 0,
20122
20184
  class: "propeller-search-bar__result flex items-center gap-4 p-3 hover:bg-surface-hover cursor-pointer border-b border-border last:border-b-0",
20123
- onClick: async (event) => handleResultClick(result)
20124
- }, [
20125
- result.imageUrl || noImageUrl.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, [
20126
- vue.createElementVNode("img", {
20127
- class: "propeller-search-bar__result-image w-full h-full object-contain",
20128
- src: result.imageUrl || noImageUrl.value,
20129
- alt: result.name
20130
- }, null, 8, _hoisted_9$1)
20131
- ])) : vue.createCommentVNode("", true),
20132
- vue.createElementVNode("div", _hoisted_10$1, [
20133
- vue.createElementVNode("div", _hoisted_11$1, vue.toDisplayString(result.name), 1),
20134
- result.sku ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, "SKU: " + vue.toDisplayString(result.sku), 1)) : vue.createCommentVNode("", true)
20185
+ onClick: (event) => handleResultAnchorClick(event, result)
20186
+ }, {
20187
+ default: vue.withCtx(() => [
20188
+ result.imageUrl || noImageUrl.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$1, [
20189
+ vue.createElementVNode("img", {
20190
+ class: "propeller-search-bar__result-image w-full h-full object-contain",
20191
+ src: result.imageUrl || noImageUrl.value,
20192
+ alt: result.name
20193
+ }, null, 8, _hoisted_8$1)
20194
+ ])) : vue.createCommentVNode("", true),
20195
+ vue.createElementVNode("div", _hoisted_9$1, [
20196
+ vue.createElementVNode("div", _hoisted_10$1, vue.toDisplayString(result.name), 1),
20197
+ result.sku ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, "SKU: " + vue.toDisplayString(result.sku), 1)) : vue.createCommentVNode("", true)
20198
+ ]),
20199
+ result.price !== void 0 && result.price !== null ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, [
20200
+ vue.createElementVNode("span", _hoisted_13$1, vue.toDisplayString(formatItemPrice(leadingPrice(result))), 1),
20201
+ vue.createElementVNode("span", _hoisted_14$1, vue.toDisplayString(priceTaxLabel()), 1)
20202
+ ])) : vue.createCommentVNode("", true)
20135
20203
  ]),
20136
- result.price !== void 0 && result.price !== null ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, [
20137
- vue.createElementVNode("span", _hoisted_14$1, vue.toDisplayString(formatItemPrice(leadingPrice(result))), 1),
20138
- vue.createElementVNode("span", _hoisted_15$1, vue.toDisplayString(priceTaxLabel()), 1)
20139
- ])) : vue.createCommentVNode("", true)
20140
- ], 8, _hoisted_7$1);
20204
+ _: 2
20205
+ }, 1032, ["href", "onClick"]);
20141
20206
  }), 128))
20142
20207
  ]),
20143
- itemsFound.value > results.value.length ? (vue.openBlock(), vue.createElementBlock("div", {
20144
- key: 0,
20145
- class: "propeller-search-bar__view-all flex-shrink-0 p-3 text-center text-primary hover:bg-primary/5 cursor-pointer font-semibold border-t border-border bg-card rounded-b-[var(--radius-container)]",
20146
- onClick: _cache[2] || (_cache[2] = async (event) => handleViewAllClick())
20147
- }, vue.toDisplayString(getLabel("viewAll", "View all results")) + " (" + vue.toDisplayString(itemsFound.value) + ") ", 1)) : vue.createCommentVNode("", true)
20208
+ itemsFound.value > results.value.length ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
20209
+ props.getViewAllHref ? (vue.openBlock(), vue.createElementBlock("a", {
20210
+ key: 0,
20211
+ href: props.getViewAllHref(searchTerm.value),
20212
+ class: "propeller-search-bar__view-all block flex-shrink-0 p-3 text-center text-primary hover:bg-primary/5 cursor-pointer font-semibold border-t border-border bg-card rounded-b-[var(--radius-container)]",
20213
+ onClick: handleViewAllAnchorClick
20214
+ }, vue.toDisplayString(getLabel("viewAll", "View all results")) + " (" + vue.toDisplayString(itemsFound.value) + ") ", 9, _hoisted_15$1)) : (vue.openBlock(), vue.createElementBlock("button", {
20215
+ key: 1,
20216
+ type: "button",
20217
+ class: "propeller-search-bar__view-all block w-full flex-shrink-0 p-3 text-center text-primary hover:bg-primary/5 cursor-pointer font-semibold border-t border-border bg-card rounded-b-[var(--radius-container)]",
20218
+ onClick: handleViewAllClick
20219
+ }, vue.toDisplayString(getLabel("viewAll", "View all results")) + " (" + vue.toDisplayString(itemsFound.value) + ") ", 1))
20220
+ ], 64)) : vue.createCommentVNode("", true)
20148
20221
  ], 64)) : vue.createCommentVNode("", true),
20149
20222
  results.value.length === 0 && searchTerm.value.length >= minLength.value && !vue.unref(isLoading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$1, vue.toDisplayString(getLabel("noResults", "No products found for")) + ' "' + vue.toDisplayString(searchTerm.value) + '" ', 1)) : vue.createCommentVNode("", true)
20150
20223
  ])) : vue.createCommentVNode("", true)