@getlupa/client 1.11.1 → 1.11.2

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.
@@ -7318,7 +7318,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7318
7318
  top: false,
7319
7319
  bottom: true
7320
7320
  },
7321
- sizes: [10, 20, 25, 50]
7321
+ sizes: [10, 20, 25]
7322
7322
  },
7323
7323
  pageSelection: {
7324
7324
  position: {
@@ -7644,38 +7644,39 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7644
7644
  const seed = [];
7645
7645
  return filter.terms.reduce((a, c2) => [...a, { key, value: c2, type: "hierarchy" }], seed);
7646
7646
  };
7647
- const unfoldRangeFilter = (key, filter) => {
7647
+ const unfoldRangeFilter = (key, filter, price = {}) => {
7648
+ var _a;
7648
7649
  const gt = filter.gte || filter.gt;
7649
7650
  const lt = filter.lte || filter.lt;
7650
- if (key.includes(CURRENCY_KEY_INDICATOR)) {
7651
+ if (key.includes(CURRENCY_KEY_INDICATOR) || ((_a = price == null ? void 0 : price.keys) == null ? void 0 : _a.includes(key))) {
7651
7652
  return [
7652
7653
  {
7653
7654
  key,
7654
- value: formatPriceSummary([gt, lt]),
7655
+ value: formatPriceSummary([gt, lt], price.currency, price.separator),
7655
7656
  type: "range"
7656
7657
  }
7657
7658
  ];
7658
7659
  }
7659
7660
  return [{ key, value: `${gt} - ${lt}`, type: "range" }];
7660
7661
  };
7661
- const unfoldFilter = (key, filter) => {
7662
+ const unfoldFilter = (key, filter, price = {}) => {
7662
7663
  if (Array.isArray(filter)) {
7663
7664
  return unfoldTermFilter(key, filter);
7664
7665
  }
7665
7666
  if (filter.gte) {
7666
- return unfoldRangeFilter(key, filter);
7667
+ return unfoldRangeFilter(key, filter, price);
7667
7668
  }
7668
7669
  if (filter.terms) {
7669
7670
  return unfoldHierarchyFilter(key, filter);
7670
7671
  }
7671
7672
  return [];
7672
7673
  };
7673
- const unfoldFilters = (filters) => {
7674
+ const unfoldFilters = (filters, price = {}) => {
7674
7675
  if (!filters) {
7675
7676
  return [];
7676
7677
  }
7677
7678
  const seed = [];
7678
- return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2)], seed);
7679
+ return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2, price)], seed);
7679
7680
  };
7680
7681
  const getLabeledFilters = (filters, facets) => {
7681
7682
  return filters.map((f2) => {
@@ -8448,7 +8449,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8448
8449
  };
8449
8450
  });
8450
8451
  const _hoisted_1$1e = { id: "lupa-search-box-input-container" };
8451
- const _hoisted_2$P = { class: "lupa-input-clear" };
8452
+ const _hoisted_2$Q = { class: "lupa-input-clear" };
8452
8453
  const _hoisted_3$A = { id: "lupa-search-box-input" };
8453
8454
  const _hoisted_4$s = ["value"];
8454
8455
  const _hoisted_5$h = ["aria-label", "placeholder"];
@@ -8538,7 +8539,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8538
8539
  __expose({ focus });
8539
8540
  return (_ctx, _cache) => {
8540
8541
  return openBlock(), createElementBlock("div", _hoisted_1$1e, [
8541
- createBaseVNode("div", _hoisted_2$P, [
8542
+ createBaseVNode("div", _hoisted_2$Q, [
8542
8543
  createBaseVNode("div", {
8543
8544
  class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
8544
8545
  onClick: clear2
@@ -8612,7 +8613,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8612
8613
  }
8613
8614
  });
8614
8615
  const _hoisted_1$1d = { class: "lupa-search-box-history-item" };
8615
- const _hoisted_2$O = { class: "lupa-search-box-history-item-content" };
8616
+ const _hoisted_2$P = { class: "lupa-search-box-history-item-content" };
8616
8617
  const _sfc_main$1k = /* @__PURE__ */ defineComponent({
8617
8618
  __name: "SearchBoxHistoryItem",
8618
8619
  props: {
@@ -8630,7 +8631,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8630
8631
  };
8631
8632
  return (_ctx, _cache) => {
8632
8633
  return openBlock(), createElementBlock("div", _hoisted_1$1d, [
8633
- createBaseVNode("div", _hoisted_2$O, [
8634
+ createBaseVNode("div", _hoisted_2$P, [
8634
8635
  createBaseVNode("div", {
8635
8636
  class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
8636
8637
  onClick: click2
@@ -8720,7 +8721,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8720
8721
  }
8721
8722
  });
8722
8723
  const _hoisted_1$1a = ["innerHTML"];
8723
- const _hoisted_2$N = {
8724
+ const _hoisted_2$O = {
8724
8725
  key: 1,
8725
8726
  "data-cy": "lupa-suggestion-value",
8726
8727
  class: "lupa-suggestion-value"
@@ -8774,7 +8775,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8774
8775
  class: "lupa-suggestion-value",
8775
8776
  "data-cy": "lupa-suggestion-value",
8776
8777
  innerHTML: _ctx.suggestion.displayHighlight
8777
- }, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(_ctx.suggestion.display), 1)),
8778
+ }, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$O, toDisplayString(_ctx.suggestion.display), 1)),
8778
8779
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
8779
8780
  createBaseVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
8780
8781
  createBaseVNode("span", _hoisted_5$g, toDisplayString(_ctx.suggestion.facet.title), 1)
@@ -9166,7 +9167,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9166
9167
  }
9167
9168
  });
9168
9169
  const _hoisted_1$17 = ["innerHTML"];
9169
- const _hoisted_2$M = {
9170
+ const _hoisted_2$N = {
9170
9171
  key: 1,
9171
9172
  class: "lupa-search-box-product-title"
9172
9173
  };
@@ -9190,14 +9191,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9190
9191
  key: 0,
9191
9192
  class: "lupa-search-box-product-title",
9192
9193
  innerHTML: title.value
9193
- }, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$M, [
9194
+ }, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$N, [
9194
9195
  createBaseVNode("strong", null, toDisplayString(title.value), 1)
9195
9196
  ]));
9196
9197
  };
9197
9198
  }
9198
9199
  });
9199
9200
  const _hoisted_1$16 = ["innerHTML"];
9200
- const _hoisted_2$L = {
9201
+ const _hoisted_2$M = {
9201
9202
  key: 1,
9202
9203
  class: "lupa-search-box-product-description"
9203
9204
  };
@@ -9221,7 +9222,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9221
9222
  key: 0,
9222
9223
  class: "lupa-search-box-product-description",
9223
9224
  innerHTML: description.value
9224
- }, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$L, toDisplayString(description.value), 1));
9225
+ }, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(description.value), 1));
9225
9226
  };
9226
9227
  }
9227
9228
  });
@@ -9274,7 +9275,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9274
9275
  }
9275
9276
  });
9276
9277
  const _hoisted_1$13 = ["innerHTML"];
9277
- const _hoisted_2$K = { key: 0 };
9278
+ const _hoisted_2$L = { key: 0 };
9278
9279
  const _hoisted_3$y = { key: 1 };
9279
9280
  const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
9280
9281
  const _hoisted_5$f = { class: "lupa-search-box-custom-text" };
@@ -9308,7 +9309,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9308
9309
  key: 1,
9309
9310
  class: [className.value, "lupa-search-box-product-custom"]
9310
9311
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
9311
- !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$K, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
9312
+ !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$L, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
9312
9313
  createBaseVNode("div", _hoisted_4$q, toDisplayString(label.value), 1),
9313
9314
  createBaseVNode("div", _hoisted_5$f, toDisplayString(text.value), 1)
9314
9315
  ]))
@@ -9395,13 +9396,33 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9395
9396
  const isMobileSidebarVisible = ref(false);
9396
9397
  const optionsStore = useOptionsStore();
9397
9398
  const paramsStore = useParamsStore();
9399
+ const { searchResultOptions } = storeToRefs(optionsStore);
9398
9400
  const facets = computed(() => searchResult.value.facets);
9399
9401
  const filters = computed(() => searchResult.value.filters);
9400
9402
  const currentQueryText = computed(() => searchResult.value.searchText);
9401
9403
  const totalItems = computed(() => searchResult.value.total);
9402
9404
  const hasResults = computed(() => totalItems.value > 0);
9405
+ const priceKeys = computed(() => {
9406
+ var _a, _b;
9407
+ return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
9408
+ });
9409
+ const currency = computed(() => {
9410
+ var _a, _b, _c;
9411
+ return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currency) != null ? _c : "";
9412
+ });
9413
+ const priceSeparator = computed(() => {
9414
+ var _a, _b, _c;
9415
+ return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.priceSeparator) != null ? _c : "";
9416
+ });
9403
9417
  const labeledFilters = computed(
9404
- () => getLabeledFilters(unfoldFilters(filters.value), facets.value)
9418
+ () => getLabeledFilters(
9419
+ unfoldFilters(filters.value, {
9420
+ keys: priceKeys.value,
9421
+ currency: currency.value,
9422
+ separator: priceSeparator.value
9423
+ }),
9424
+ facets.value
9425
+ )
9405
9426
  );
9406
9427
  const displayFilters = computed(() => {
9407
9428
  var _a, _b;
@@ -9536,7 +9557,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9536
9557
  };
9537
9558
  });
9538
9559
  const _hoisted_1$11 = { class: "lupa-search-box-add-to-cart-wrapper" };
9539
- const _hoisted_2$J = { class: "lupa-search-box-product-addtocart" };
9560
+ const _hoisted_2$K = { class: "lupa-search-box-product-addtocart" };
9540
9561
  const _hoisted_3$x = ["onClick", "disabled"];
9541
9562
  const _sfc_main$16 = /* @__PURE__ */ defineComponent({
9542
9563
  __name: "SearchBoxProductAddToCart",
@@ -9566,7 +9587,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9566
9587
  });
9567
9588
  return (_ctx, _cache) => {
9568
9589
  return openBlock(), createElementBlock("div", _hoisted_1$11, [
9569
- createBaseVNode("div", _hoisted_2$J, [
9590
+ createBaseVNode("div", _hoisted_2$K, [
9570
9591
  createBaseVNode("button", {
9571
9592
  onClick: withModifiers(handleClick, ["stop", "prevent"]),
9572
9593
  class: normalizeClass(loading.value ? "lupa-add-to-cart-loading" : "lupa-add-to-cart"),
@@ -9668,7 +9689,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9668
9689
  }
9669
9690
  }));
9670
9691
  const _hoisted_1$$ = { class: "lupa-badge-title" };
9671
- const _hoisted_2$I = ["src"];
9692
+ const _hoisted_2$J = ["src"];
9672
9693
  const _hoisted_3$w = { key: 1 };
9673
9694
  const _hoisted_4$p = {
9674
9695
  key: 0,
@@ -9711,7 +9732,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9711
9732
  image.value ? (openBlock(), createElementBlock("img", {
9712
9733
  key: 0,
9713
9734
  src: image.value
9714
- }, null, 8, _hoisted_2$I)) : createCommentVNode("", true),
9735
+ }, null, 8, _hoisted_2$J)) : createCommentVNode("", true),
9715
9736
  hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$w, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
9716
9737
  ]),
9717
9738
  hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
@@ -9810,7 +9831,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9810
9831
  }
9811
9832
  });
9812
9833
  const _hoisted_1$X = { class: "lupa-image-badges" };
9813
- const _hoisted_2$H = ["src"];
9834
+ const _hoisted_2$I = ["src"];
9814
9835
  const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9815
9836
  __name: "ImageBadge",
9816
9837
  props: {
@@ -9839,7 +9860,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9839
9860
  }, [
9840
9861
  createBaseVNode("img", {
9841
9862
  src: getImageUrl(item)
9842
- }, null, 8, _hoisted_2$H)
9863
+ }, null, 8, _hoisted_2$I)
9843
9864
  ]);
9844
9865
  }), 128))
9845
9866
  ]);
@@ -9931,7 +9952,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9931
9952
  }
9932
9953
  }));
9933
9954
  const _hoisted_1$V = ["href"];
9934
- const _hoisted_2$G = { class: "lupa-search-box-product-image-section" };
9955
+ const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
9935
9956
  const _hoisted_3$v = { class: "lupa-search-box-product-details-section" };
9936
9957
  const _hoisted_4$o = {
9937
9958
  key: 0,
@@ -9996,7 +10017,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9996
10017
  "data-cy": "lupa-search-box-product",
9997
10018
  onClick: handleClick
9998
10019
  }), [
9999
- createBaseVNode("div", _hoisted_2$G, [
10020
+ createBaseVNode("div", _hoisted_2$H, [
10000
10021
  (openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
10001
10022
  return openBlock(), createBlock(_sfc_main$15, {
10002
10023
  class: "lupa-search-box-product-element",
@@ -10355,7 +10376,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10355
10376
  key: 0,
10356
10377
  id: "lupa-search-box-panel"
10357
10378
  };
10358
- const _hoisted_2$F = ["data-cy"];
10379
+ const _hoisted_2$G = ["data-cy"];
10359
10380
  const _hoisted_3$u = {
10360
10381
  key: 0,
10361
10382
  class: "lupa-panel-title lupa-panel-title-top-results"
@@ -10563,7 +10584,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10563
10584
  key: "0"
10564
10585
  } : void 0
10565
10586
  ]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
10566
- ], 10, _hoisted_2$F);
10587
+ ], 10, _hoisted_2$G);
10567
10588
  }), 128))
10568
10589
  ], 4),
10569
10590
  !unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1i, {
@@ -10603,7 +10624,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10603
10624
  elements.forEach((e) => e == null ? void 0 : e.removeEventListener(BIND_EVENT, event));
10604
10625
  };
10605
10626
  const _hoisted_1$S = { id: "lupa-search-box" };
10606
- const _hoisted_2$E = { class: "lupa-search-box-wrapper" };
10627
+ const _hoisted_2$F = { class: "lupa-search-box-wrapper" };
10607
10628
  const _sfc_main$V = /* @__PURE__ */ defineComponent({
10608
10629
  __name: "SearchBox",
10609
10630
  props: {
@@ -10850,7 +10871,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10850
10871
  return (_ctx, _cache) => {
10851
10872
  var _a2;
10852
10873
  return openBlock(), createElementBlock("div", _hoisted_1$S, [
10853
- createBaseVNode("div", _hoisted_2$E, [
10874
+ createBaseVNode("div", _hoisted_2$F, [
10854
10875
  createVNode(_sfc_main$1m, {
10855
10876
  options: inputOptions.value,
10856
10877
  suggestedValue: suggestedValue.value,
@@ -10954,7 +10975,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10954
10975
  key: 0,
10955
10976
  id: "lupa-search-results-did-you-mean"
10956
10977
  };
10957
- const _hoisted_2$D = {
10978
+ const _hoisted_2$E = {
10958
10979
  key: 0,
10959
10980
  "data-cy": "suggested-search-text-label"
10960
10981
  };
@@ -10996,7 +11017,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10996
11017
  };
10997
11018
  return (_ctx, _cache) => {
10998
11019
  return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$R, [
10999
- unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$D, [
11020
+ unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$E, [
11000
11021
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
11001
11022
  return openBlock(), createElementBlock("span", { key: index }, [
11002
11023
  createBaseVNode("span", {
@@ -11025,7 +11046,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11025
11046
  key: 0,
11026
11047
  class: "lupa-search-results-summary"
11027
11048
  };
11028
- const _hoisted_2$C = ["innerHTML"];
11049
+ const _hoisted_2$D = ["innerHTML"];
11029
11050
  const _sfc_main$T = /* @__PURE__ */ defineComponent({
11030
11051
  __name: "SearchResultsSummary",
11031
11052
  props: {
@@ -11042,7 +11063,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11042
11063
  });
11043
11064
  return (_ctx, _cache) => {
11044
11065
  return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
11045
- createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$C),
11066
+ createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$D),
11046
11067
  _ctx.clearable ? (openBlock(), createElementBlock("span", {
11047
11068
  key: 0,
11048
11069
  class: "lupa-filter-clear",
@@ -11058,7 +11079,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11058
11079
  class: "lupa-result-page-title",
11059
11080
  "data-cy": "lupa-result-page-title"
11060
11081
  };
11061
- const _hoisted_2$B = { key: 0 };
11082
+ const _hoisted_2$C = { key: 0 };
11062
11083
  const _hoisted_3$s = {
11063
11084
  key: 1,
11064
11085
  class: "lupa-results-total-count"
@@ -11101,7 +11122,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11101
11122
  return openBlock(), createElementBlock("div", null, [
11102
11123
  showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$P, [
11103
11124
  createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
11104
- queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$B, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
11125
+ queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$C, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
11105
11126
  showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$s, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
11106
11127
  ])) : createCommentVNode("", true),
11107
11128
  _ctx.showSummary ? (openBlock(), createBlock(_sfc_main$T, {
@@ -11118,7 +11139,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11118
11139
  }
11119
11140
  });
11120
11141
  const _hoisted_1$O = { class: "lupa-search-result-filter-value" };
11121
- const _hoisted_2$A = {
11142
+ const _hoisted_2$B = {
11122
11143
  class: "lupa-current-filter-label",
11123
11144
  "data-cy": "lupa-current-filter-label"
11124
11145
  };
@@ -11143,14 +11164,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11143
11164
  class: "lupa-current-filter-action",
11144
11165
  onClick: handleClick
11145
11166
  }, "⨉"),
11146
- createBaseVNode("div", _hoisted_2$A, toDisplayString(_ctx.filter.label) + ": ", 1),
11167
+ createBaseVNode("div", _hoisted_2$B, toDisplayString(_ctx.filter.label) + ": ", 1),
11147
11168
  createBaseVNode("div", _hoisted_3$r, toDisplayString(_ctx.filter.value), 1)
11148
11169
  ]);
11149
11170
  };
11150
11171
  }
11151
11172
  });
11152
11173
  const _hoisted_1$N = { class: "lupa-filter-title-text" };
11153
- const _hoisted_2$z = {
11174
+ const _hoisted_2$A = {
11154
11175
  key: 0,
11155
11176
  class: "lupa-filter-count"
11156
11177
  };
@@ -11222,7 +11243,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11222
11243
  }, [
11223
11244
  createBaseVNode("div", _hoisted_1$N, [
11224
11245
  createTextVNode(toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
11225
- _ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$z, " (" + toDisplayString(unref(currentFilterCount)) + ") ", 1)) : createCommentVNode("", true)
11246
+ _ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$A, " (" + toDisplayString(unref(currentFilterCount)) + ") ", 1)) : createCommentVNode("", true)
11226
11247
  ]),
11227
11248
  _ctx.expandable ? (openBlock(), createElementBlock("div", {
11228
11249
  key: 0,
@@ -11296,7 +11317,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11296
11317
  class: "lupa-category-filter",
11297
11318
  "data-cy": "lupa-category-filter"
11298
11319
  };
11299
- const _hoisted_2$y = { class: "lupa-category-back" };
11320
+ const _hoisted_2$z = { class: "lupa-category-back" };
11300
11321
  const _hoisted_3$p = ["href"];
11301
11322
  const _hoisted_4$j = ["href"];
11302
11323
  const _hoisted_5$d = { class: "lupa-child-category-list" };
@@ -11387,7 +11408,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11387
11408
  __expose({ fetch: fetch2 });
11388
11409
  return (_ctx, _cache) => {
11389
11410
  return openBlock(), createElementBlock("div", _hoisted_1$L, [
11390
- createBaseVNode("div", _hoisted_2$y, [
11411
+ createBaseVNode("div", _hoisted_2$z, [
11391
11412
  hasBackButton.value ? (openBlock(), createElementBlock("a", {
11392
11413
  key: 0,
11393
11414
  "data-cy": "lupa-category-back",
@@ -11422,7 +11443,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11422
11443
  class: "lupa-search-result-facet-term-values",
11423
11444
  "data-cy": "lupa-search-result-facet-term-values"
11424
11445
  };
11425
- const _hoisted_2$x = ["placeholder"];
11446
+ const _hoisted_2$y = ["placeholder"];
11426
11447
  const _hoisted_3$o = { class: "lupa-terms-list" };
11427
11448
  const _hoisted_4$i = ["onClick"];
11428
11449
  const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
@@ -11510,7 +11531,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11510
11531
  "data-cy": "lupa-term-filter",
11511
11532
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
11512
11533
  placeholder: _ctx.options.labels.facetFilter
11513
- }, null, 8, _hoisted_2$x)), [
11534
+ }, null, 8, _hoisted_2$y)), [
11514
11535
  [vModelText, termFilter.value]
11515
11536
  ]) : createCommentVNode("", true),
11516
11537
  createBaseVNode("div", _hoisted_3$o, [
@@ -12522,7 +12543,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12522
12543
  return openBlock(), createElementBlock("div", mergeProps(e.sliderProps, { ref: "slider" }), null, 16);
12523
12544
  }, m.__file = "src/Slider.vue";
12524
12545
  const _hoisted_1$J = { class: "lupa-search-result-facet-stats-values" };
12525
- const _hoisted_2$w = {
12546
+ const _hoisted_2$x = {
12526
12547
  key: 0,
12527
12548
  class: "lupa-stats-facet-summary"
12528
12549
  };
@@ -12582,6 +12603,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12582
12603
  var _a;
12583
12604
  return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currency;
12584
12605
  });
12606
+ const priceKeys = computed(() => {
12607
+ var _a, _b;
12608
+ return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
12609
+ });
12585
12610
  const isSliderVisible = computed(() => {
12586
12611
  var _a, _b;
12587
12612
  return Boolean((_b = (_a = props.options.stats) == null ? void 0 : _a.slider) != null ? _b : true);
@@ -12645,8 +12670,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12645
12670
  }
12646
12671
  });
12647
12672
  const isPrice = computed(() => {
12648
- var _a;
12649
- return (_a = facetValue.value.key) == null ? void 0 : _a.includes(CURRENCY_KEY_INDICATOR);
12673
+ var _a, _b, _c;
12674
+ return ((_b = (_a = facetValue.value) == null ? void 0 : _a.key) == null ? void 0 : _b.includes(CURRENCY_KEY_INDICATOR)) || ((_c = priceKeys.value) == null ? void 0 : _c.includes(facetValue.value.key));
12650
12675
  });
12651
12676
  const facetMin = computed(() => {
12652
12677
  return Math.floor(facetValue.value.min);
@@ -12719,7 +12744,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12719
12744
  };
12720
12745
  return (_ctx, _cache) => {
12721
12746
  return openBlock(), createElementBlock("div", _hoisted_1$J, [
12722
- !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$w, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$n, [
12747
+ !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$x, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$n, [
12723
12748
  createBaseVNode("div", null, [
12724
12749
  rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$h, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
12725
12750
  createBaseVNode("div", _hoisted_5$b, [
@@ -12786,7 +12811,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12786
12811
  }
12787
12812
  });
12788
12813
  const _hoisted_1$I = { class: "lupa-term-checkbox-wrapper" };
12789
- const _hoisted_2$v = { class: "lupa-term-checkbox-label" };
12814
+ const _hoisted_2$w = { class: "lupa-term-checkbox-label" };
12790
12815
  const _hoisted_3$m = { class: "lupa-term-label" };
12791
12816
  const _hoisted_4$g = {
12792
12817
  key: 0,
@@ -12847,7 +12872,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12847
12872
  class: normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
12848
12873
  }, null, 2)
12849
12874
  ]),
12850
- createBaseVNode("div", _hoisted_2$v, [
12875
+ createBaseVNode("div", _hoisted_2$w, [
12851
12876
  createBaseVNode("span", _hoisted_3$m, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
12852
12877
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$g, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
12853
12878
  ])
@@ -12872,7 +12897,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12872
12897
  class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
12873
12898
  "data-cy": "lupa-search-result-facet-term-values"
12874
12899
  };
12875
- const _hoisted_2$u = { key: 0 };
12900
+ const _hoisted_2$v = { key: 0 };
12876
12901
  const _hoisted_3$l = ["placeholder"];
12877
12902
  const _sfc_main$K = /* @__PURE__ */ defineComponent({
12878
12903
  __name: "HierarchyFacet",
@@ -12925,7 +12950,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12925
12950
  };
12926
12951
  return (_ctx, _cache) => {
12927
12952
  return openBlock(), createElementBlock("div", _hoisted_1$H, [
12928
- isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$u, [
12953
+ isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$v, [
12929
12954
  withDirectives(createBaseVNode("input", {
12930
12955
  class: "lupa-term-filter",
12931
12956
  "data-cy": "lupa-term-filter",
@@ -12957,7 +12982,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12957
12982
  }
12958
12983
  });
12959
12984
  const _hoisted_1$G = { class: "lupa-facet-label-text" };
12960
- const _hoisted_2$t = {
12985
+ const _hoisted_2$u = {
12961
12986
  key: 0,
12962
12987
  class: "lupa-facet-content",
12963
12988
  "data-cy": "lupa-facet-content"
@@ -13086,7 +13111,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13086
13111
  class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
13087
13112
  }, null, 2)
13088
13113
  ], 2),
13089
- isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$t, [
13114
+ isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$u, [
13090
13115
  (openBlock(), createBlock(resolveDynamicComponent(facetType.value), {
13091
13116
  facet: facet.value,
13092
13117
  currentFilters: currentFilters.value[facet.value.key],
@@ -13105,7 +13130,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13105
13130
  }
13106
13131
  }));
13107
13132
  const _hoisted_1$F = { class: "lupa-search-result-facet-section" };
13108
- const _hoisted_2$s = {
13133
+ const _hoisted_2$t = {
13109
13134
  key: 0,
13110
13135
  class: "lupa-facets-title"
13111
13136
  };
@@ -13144,7 +13169,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13144
13169
  return (_ctx, _cache) => {
13145
13170
  var _a;
13146
13171
  return openBlock(), createElementBlock("div", _hoisted_1$F, [
13147
- _ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$s, toDisplayString(_ctx.options.labels.title), 1)) : createCommentVNode("", true),
13172
+ _ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$t, toDisplayString(_ctx.options.labels.title), 1)) : createCommentVNode("", true),
13148
13173
  createBaseVNode("div", {
13149
13174
  class: normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
13150
13175
  }, [
@@ -13191,6 +13216,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13191
13216
  }
13192
13217
  });
13193
13218
  const _hoisted_1$D = { class: "lupa-search-result-facets" };
13219
+ const _hoisted_2$s = { class: "lupa-facets-filter-button-wrapper" };
13194
13220
  const _sfc_main$G = /* @__PURE__ */ defineComponent({
13195
13221
  __name: "Facets",
13196
13222
  props: {
@@ -13285,11 +13311,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13285
13311
  onSelect: handleFacetSelect,
13286
13312
  onClear: clear2
13287
13313
  }, null, 8, ["options", "facets", "currentFilters", "facetStyle", "clearable"])) : createCommentVNode("", true),
13288
- showFilterButton.value ? (openBlock(), createBlock(_sfc_main$H, {
13289
- key: 1,
13290
- options: _ctx.options,
13291
- onFilter: filter
13292
- }, null, 8, ["options"])) : createCommentVNode("", true)
13314
+ createBaseVNode("div", _hoisted_2$s, [
13315
+ showFilterButton.value ? (openBlock(), createBlock(_sfc_main$H, {
13316
+ key: 0,
13317
+ options: _ctx.options,
13318
+ onFilter: filter
13319
+ }, null, 8, ["options"])) : createCommentVNode("", true)
13320
+ ])
13293
13321
  ]);
13294
13322
  };
13295
13323
  }
@@ -14309,7 +14337,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14309
14337
  item: {},
14310
14338
  options: {}
14311
14339
  },
14312
- setup(__props) {
14340
+ emits: ["productEvent"],
14341
+ setup(__props, { emit: emit2 }) {
14313
14342
  const props = __props;
14314
14343
  const text = computed(() => {
14315
14344
  return props.options.html(props.item);
@@ -14321,6 +14350,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14321
14350
  if (!props.options.action) {
14322
14351
  return;
14323
14352
  }
14353
+ if (props.options.reportEventOnClick) {
14354
+ emit2("productEvent", { type: props.options.reportEventOnClick });
14355
+ }
14324
14356
  yield props.options.action(props.item);
14325
14357
  });
14326
14358
  return (_ctx, _cache) => {
@@ -14633,7 +14665,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14633
14665
  key: element.key,
14634
14666
  labels: labels.value,
14635
14667
  inStock: isInStock.value,
14636
- link: link.value
14668
+ link: link.value,
14669
+ onProductEvent: handleProductEvent
14637
14670
  }, null, 8, ["item", "element", "labels", "inStock", "link"]);
14638
14671
  }), 128)),
14639
14672
  createVNode(_sfc_main$$, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.11.1",
3
+ "version": "1.11.2",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.3.4",
23
- "@getlupa/vue": "0.11.1",
23
+ "@getlupa/vue": "0.11.2",
24
24
  "@rushstack/eslint-patch": "^1.3.2",
25
25
  "@tsconfig/node18": "^2.0.1",
26
26
  "@types/jsdom": "^21.1.1",