@getlupa/client 1.17.0 → 1.17.1

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.
@@ -7836,7 +7836,7 @@ var __async = (__this, __arguments, generator) => {
7836
7836
  }
7837
7837
  return (_b = value.toFixed(2)) == null ? void 0 : _b.replace(".", separator);
7838
7838
  };
7839
- const formatPrice = (price, currency = "€", separator = ",") => {
7839
+ const formatPrice = (price, currency = "€", separator = ",", currencyTemplate = "") => {
7840
7840
  if (price !== 0 && !price) {
7841
7841
  return "";
7842
7842
  }
@@ -7844,16 +7844,24 @@ var __async = (__this, __arguments, generator) => {
7844
7844
  if (!amount) {
7845
7845
  return "";
7846
7846
  }
7847
+ if (currencyTemplate) {
7848
+ return addParamsToLabel(currencyTemplate, amount);
7849
+ }
7847
7850
  return `${amount} ${currency}`;
7848
7851
  };
7849
- const formatPriceSummary = ([min, max], currency, separator = ",") => {
7852
+ const formatPriceSummary = ([min, max], currency, separator = ",", currencyTemplate = "") => {
7850
7853
  if (min !== void 0 && max !== void 0) {
7851
- return `${formatPrice(min, currency, separator)} - ${formatPrice(max, currency, separator)}`;
7854
+ return `${formatPrice(min, currency, separator, currencyTemplate)} - ${formatPrice(
7855
+ max,
7856
+ currency,
7857
+ separator,
7858
+ currencyTemplate
7859
+ )}`;
7852
7860
  }
7853
7861
  if (min !== void 0) {
7854
- return `> ${formatPrice(min, currency, separator)}`;
7862
+ return `> ${formatPrice(min, currency, separator, currencyTemplate)}`;
7855
7863
  }
7856
- return `< ${formatPrice(max, currency, separator)}`;
7864
+ return `< ${formatPrice(max, currency, separator, currencyTemplate)}`;
7857
7865
  };
7858
7866
  const formatRange = (filter2) => {
7859
7867
  var _a, _b;
@@ -7883,7 +7891,12 @@ var __async = (__this, __arguments, generator) => {
7883
7891
  return [
7884
7892
  {
7885
7893
  key,
7886
- value: formatPriceSummary([gt, lt], price.currency, price.separator),
7894
+ value: formatPriceSummary(
7895
+ [gt, lt],
7896
+ price.currency,
7897
+ price.separator,
7898
+ price.currencyTemplate
7899
+ ),
7887
7900
  type: "range"
7888
7901
  }
7889
7902
  ];
@@ -14489,6 +14502,7 @@ var __async = (__this, __arguments, generator) => {
14489
14502
  },
14490
14503
  emits: ["go-to-results"],
14491
14504
  setup(__props, { emit: emit2 }) {
14505
+ const props = __props;
14492
14506
  const historyStore = useHistoryStore();
14493
14507
  const searchBoxStore = useSearchBoxStore();
14494
14508
  const { highlightedIndex } = storeToRefs(searchBoxStore);
@@ -14504,6 +14518,14 @@ var __async = (__this, __arguments, generator) => {
14504
14518
  onBeforeMount(() => {
14505
14519
  window.removeEventListener("keydown", handleKeyDown);
14506
14520
  });
14521
+ const historyLimit = computed(() => {
14522
+ var _a;
14523
+ return (_a = props.options.historyLimit) != null ? _a : 5;
14524
+ });
14525
+ const limitedHistory = computed(() => {
14526
+ var _a;
14527
+ return ((_a = history.value) != null ? _a : []).slice(0, historyLimit.value);
14528
+ });
14507
14529
  const remove2 = ({ item }) => {
14508
14530
  historyStore.remove({ item });
14509
14531
  };
@@ -14524,7 +14546,7 @@ var __async = (__this, __arguments, generator) => {
14524
14546
  };
14525
14547
  return (_ctx, _cache) => {
14526
14548
  return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1g, [
14527
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(history), (item, index) => {
14549
+ (openBlock(true), createElementBlock(Fragment, null, renderList(limitedHistory.value, (item, index) => {
14528
14550
  return openBlock(), createBlock(_sfc_main$1t, {
14529
14551
  key: item,
14530
14552
  item,
@@ -24081,11 +24103,12 @@ and ensure you are accounting for this risk.
24081
24103
  setup(__props) {
24082
24104
  const props = __props;
24083
24105
  const price = computed(() => {
24084
- var _a, _b;
24106
+ var _a, _b, _c;
24085
24107
  return formatPrice(
24086
24108
  props.item[props.options.key],
24087
24109
  (_a = props.labels) == null ? void 0 : _a.currency,
24088
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
24110
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
24111
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
24089
24112
  );
24090
24113
  });
24091
24114
  return (_ctx, _cache) => {
@@ -24108,11 +24131,12 @@ and ensure you are accounting for this risk.
24108
24131
  return props.options.className;
24109
24132
  });
24110
24133
  const price = computed(() => {
24111
- var _a, _b;
24134
+ var _a, _b, _c;
24112
24135
  return formatPrice(
24113
24136
  props.item[props.options.key],
24114
24137
  (_a = props.labels) == null ? void 0 : _a.currency,
24115
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
24138
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
24139
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
24116
24140
  );
24117
24141
  });
24118
24142
  return (_ctx, _cache) => {
@@ -24276,12 +24300,17 @@ and ensure you are accounting for this risk.
24276
24300
  var _a, _b, _c;
24277
24301
  return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.priceSeparator) != null ? _c : "";
24278
24302
  });
24303
+ const currencyTemplate = computed(() => {
24304
+ var _a, _b, _c;
24305
+ return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currencyTemplate) != null ? _c : "";
24306
+ });
24279
24307
  const labeledFilters = computed(
24280
24308
  () => getLabeledFilters(
24281
24309
  unfoldFilters(filters.value, {
24282
24310
  keys: priceKeys.value,
24283
24311
  currency: currency.value,
24284
- separator: priceSeparator.value
24312
+ separator: priceSeparator.value,
24313
+ currencyTemplate: currencyTemplate.value
24285
24314
  }),
24286
24315
  facets2.value
24287
24316
  )
@@ -24829,11 +24858,12 @@ and ensure you are accounting for this risk.
24829
24858
  return 0;
24830
24859
  });
24831
24860
  const discountStringValue = computed(() => {
24832
- var _a, _b, _c, _d;
24861
+ var _a, _b, _c, _d, _e, _f;
24833
24862
  return props.badge.discountType === "percentage" ? discountValue.value.toFixed(0) : formatPrice(
24834
24863
  discountValue.value,
24835
24864
  (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currency,
24836
- (_d = (_c = searchResultOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.priceSeparator
24865
+ (_d = (_c = searchResultOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.priceSeparator,
24866
+ (_f = (_e = searchResultOptions.value) == null ? void 0 : _e.labels) == null ? void 0 : _f.currencyTemplate
24837
24867
  );
24838
24868
  });
24839
24869
  const hasDiscount = computed(() => {
@@ -27854,6 +27884,10 @@ and ensure you are accounting for this risk.
27854
27884
  var _a;
27855
27885
  return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currency;
27856
27886
  });
27887
+ const currencyTemplate = computed(() => {
27888
+ var _a;
27889
+ return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currencyTemplate;
27890
+ });
27857
27891
  const priceKeys = computed(() => {
27858
27892
  var _a, _b;
27859
27893
  return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
@@ -27936,7 +27970,7 @@ and ensure you are accounting for this risk.
27936
27970
  });
27937
27971
  const statsSummary = computed(() => {
27938
27972
  const [min, max] = sliderRange.value;
27939
- return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value) : formatRange({ gte: min, lte: max });
27973
+ return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value, currencyTemplate.value) : formatRange({ gte: min, lte: max });
27940
27974
  });
27941
27975
  const separator = computed(() => {
27942
27976
  var _a, _b, _c;
@@ -29589,11 +29623,12 @@ and ensure you are accounting for this risk.
29589
29623
  setup(__props) {
29590
29624
  const props = __props;
29591
29625
  const price = computed(() => {
29592
- var _a, _b;
29626
+ var _a, _b, _c;
29593
29627
  return formatPrice(
29594
29628
  props.item[props.options.key],
29595
29629
  (_a = props.labels) == null ? void 0 : _a.currency,
29596
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
29630
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
29631
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
29597
29632
  );
29598
29633
  });
29599
29634
  return (_ctx, _cache) => {
@@ -29614,11 +29649,12 @@ and ensure you are accounting for this risk.
29614
29649
  return props.options.className;
29615
29650
  });
29616
29651
  const price = computed(() => {
29617
- var _a, _b;
29652
+ var _a, _b, _c;
29618
29653
  return formatPrice(
29619
29654
  props.item[props.options.key],
29620
29655
  (_a = props.labels) == null ? void 0 : _a.currency,
29621
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
29656
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
29657
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
29622
29658
  );
29623
29659
  });
29624
29660
  return (_ctx, _cache) => {
@@ -7836,7 +7836,7 @@ const getAmount = (price, separator = ".") => {
7836
7836
  }
7837
7837
  return (_b = value.toFixed(2)) == null ? void 0 : _b.replace(".", separator);
7838
7838
  };
7839
- const formatPrice = (price, currency = "€", separator = ",") => {
7839
+ const formatPrice = (price, currency = "€", separator = ",", currencyTemplate = "") => {
7840
7840
  if (price !== 0 && !price) {
7841
7841
  return "";
7842
7842
  }
@@ -7844,16 +7844,24 @@ const formatPrice = (price, currency = "€", separator = ",") => {
7844
7844
  if (!amount) {
7845
7845
  return "";
7846
7846
  }
7847
+ if (currencyTemplate) {
7848
+ return addParamsToLabel(currencyTemplate, amount);
7849
+ }
7847
7850
  return `${amount} ${currency}`;
7848
7851
  };
7849
- const formatPriceSummary = ([min, max], currency, separator = ",") => {
7852
+ const formatPriceSummary = ([min, max], currency, separator = ",", currencyTemplate = "") => {
7850
7853
  if (min !== void 0 && max !== void 0) {
7851
- return `${formatPrice(min, currency, separator)} - ${formatPrice(max, currency, separator)}`;
7854
+ return `${formatPrice(min, currency, separator, currencyTemplate)} - ${formatPrice(
7855
+ max,
7856
+ currency,
7857
+ separator,
7858
+ currencyTemplate
7859
+ )}`;
7852
7860
  }
7853
7861
  if (min !== void 0) {
7854
- return `> ${formatPrice(min, currency, separator)}`;
7862
+ return `> ${formatPrice(min, currency, separator, currencyTemplate)}`;
7855
7863
  }
7856
- return `< ${formatPrice(max, currency, separator)}`;
7864
+ return `< ${formatPrice(max, currency, separator, currencyTemplate)}`;
7857
7865
  };
7858
7866
  const formatRange = (filter2) => {
7859
7867
  var _a, _b;
@@ -7883,7 +7891,12 @@ const unfoldRangeFilter = (key, filter2, price = {}) => {
7883
7891
  return [
7884
7892
  {
7885
7893
  key,
7886
- value: formatPriceSummary([gt, lt], price.currency, price.separator),
7894
+ value: formatPriceSummary(
7895
+ [gt, lt],
7896
+ price.currency,
7897
+ price.separator,
7898
+ price.currencyTemplate
7899
+ ),
7887
7900
  type: "range"
7888
7901
  }
7889
7902
  ];
@@ -14489,6 +14502,7 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
14489
14502
  },
14490
14503
  emits: ["go-to-results"],
14491
14504
  setup(__props, { emit: emit2 }) {
14505
+ const props = __props;
14492
14506
  const historyStore = useHistoryStore();
14493
14507
  const searchBoxStore = useSearchBoxStore();
14494
14508
  const { highlightedIndex } = storeToRefs(searchBoxStore);
@@ -14504,6 +14518,14 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
14504
14518
  onBeforeMount(() => {
14505
14519
  window.removeEventListener("keydown", handleKeyDown);
14506
14520
  });
14521
+ const historyLimit = computed(() => {
14522
+ var _a;
14523
+ return (_a = props.options.historyLimit) != null ? _a : 5;
14524
+ });
14525
+ const limitedHistory = computed(() => {
14526
+ var _a;
14527
+ return ((_a = history.value) != null ? _a : []).slice(0, historyLimit.value);
14528
+ });
14507
14529
  const remove2 = ({ item }) => {
14508
14530
  historyStore.remove({ item });
14509
14531
  };
@@ -14524,7 +14546,7 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
14524
14546
  };
14525
14547
  return (_ctx, _cache) => {
14526
14548
  return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1g, [
14527
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(history), (item, index) => {
14549
+ (openBlock(true), createElementBlock(Fragment, null, renderList(limitedHistory.value, (item, index) => {
14528
14550
  return openBlock(), createBlock(_sfc_main$1t, {
14529
14551
  key: item,
14530
14552
  item,
@@ -24081,11 +24103,12 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
24081
24103
  setup(__props) {
24082
24104
  const props = __props;
24083
24105
  const price = computed(() => {
24084
- var _a, _b;
24106
+ var _a, _b, _c;
24085
24107
  return formatPrice(
24086
24108
  props.item[props.options.key],
24087
24109
  (_a = props.labels) == null ? void 0 : _a.currency,
24088
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
24110
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
24111
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
24089
24112
  );
24090
24113
  });
24091
24114
  return (_ctx, _cache) => {
@@ -24108,11 +24131,12 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
24108
24131
  return props.options.className;
24109
24132
  });
24110
24133
  const price = computed(() => {
24111
- var _a, _b;
24134
+ var _a, _b, _c;
24112
24135
  return formatPrice(
24113
24136
  props.item[props.options.key],
24114
24137
  (_a = props.labels) == null ? void 0 : _a.currency,
24115
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
24138
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
24139
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
24116
24140
  );
24117
24141
  });
24118
24142
  return (_ctx, _cache) => {
@@ -24276,12 +24300,17 @@ const useSearchResultStore = defineStore("searchResult", () => {
24276
24300
  var _a, _b, _c;
24277
24301
  return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.priceSeparator) != null ? _c : "";
24278
24302
  });
24303
+ const currencyTemplate = computed(() => {
24304
+ var _a, _b, _c;
24305
+ return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currencyTemplate) != null ? _c : "";
24306
+ });
24279
24307
  const labeledFilters = computed(
24280
24308
  () => getLabeledFilters(
24281
24309
  unfoldFilters(filters.value, {
24282
24310
  keys: priceKeys.value,
24283
24311
  currency: currency.value,
24284
- separator: priceSeparator.value
24312
+ separator: priceSeparator.value,
24313
+ currencyTemplate: currencyTemplate.value
24285
24314
  }),
24286
24315
  facets2.value
24287
24316
  )
@@ -24829,11 +24858,12 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
24829
24858
  return 0;
24830
24859
  });
24831
24860
  const discountStringValue = computed(() => {
24832
- var _a, _b, _c, _d;
24861
+ var _a, _b, _c, _d, _e, _f;
24833
24862
  return props.badge.discountType === "percentage" ? discountValue.value.toFixed(0) : formatPrice(
24834
24863
  discountValue.value,
24835
24864
  (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currency,
24836
- (_d = (_c = searchResultOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.priceSeparator
24865
+ (_d = (_c = searchResultOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.priceSeparator,
24866
+ (_f = (_e = searchResultOptions.value) == null ? void 0 : _e.labels) == null ? void 0 : _f.currencyTemplate
24837
24867
  );
24838
24868
  });
24839
24869
  const hasDiscount = computed(() => {
@@ -27854,6 +27884,10 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
27854
27884
  var _a;
27855
27885
  return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currency;
27856
27886
  });
27887
+ const currencyTemplate = computed(() => {
27888
+ var _a;
27889
+ return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currencyTemplate;
27890
+ });
27857
27891
  const priceKeys = computed(() => {
27858
27892
  var _a, _b;
27859
27893
  return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
@@ -27936,7 +27970,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
27936
27970
  });
27937
27971
  const statsSummary = computed(() => {
27938
27972
  const [min, max] = sliderRange.value;
27939
- return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value) : formatRange({ gte: min, lte: max });
27973
+ return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value, currencyTemplate.value) : formatRange({ gte: min, lte: max });
27940
27974
  });
27941
27975
  const separator = computed(() => {
27942
27976
  var _a, _b, _c;
@@ -29589,11 +29623,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
29589
29623
  setup(__props) {
29590
29624
  const props = __props;
29591
29625
  const price = computed(() => {
29592
- var _a, _b;
29626
+ var _a, _b, _c;
29593
29627
  return formatPrice(
29594
29628
  props.item[props.options.key],
29595
29629
  (_a = props.labels) == null ? void 0 : _a.currency,
29596
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
29630
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
29631
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
29597
29632
  );
29598
29633
  });
29599
29634
  return (_ctx, _cache) => {
@@ -29614,11 +29649,12 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
29614
29649
  return props.options.className;
29615
29650
  });
29616
29651
  const price = computed(() => {
29617
- var _a, _b;
29652
+ var _a, _b, _c;
29618
29653
  return formatPrice(
29619
29654
  props.item[props.options.key],
29620
29655
  (_a = props.labels) == null ? void 0 : _a.currency,
29621
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
29656
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
29657
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
29622
29658
  );
29623
29659
  });
29624
29660
  return (_ctx, _cache) => {
@@ -7834,7 +7834,7 @@ const getAmount = (price, separator = ".") => {
7834
7834
  }
7835
7835
  return (_b = value.toFixed(2)) == null ? void 0 : _b.replace(".", separator);
7836
7836
  };
7837
- const formatPrice = (price, currency = "€", separator = ",") => {
7837
+ const formatPrice = (price, currency = "€", separator = ",", currencyTemplate = "") => {
7838
7838
  if (price !== 0 && !price) {
7839
7839
  return "";
7840
7840
  }
@@ -7842,16 +7842,24 @@ const formatPrice = (price, currency = "€", separator = ",") => {
7842
7842
  if (!amount) {
7843
7843
  return "";
7844
7844
  }
7845
+ if (currencyTemplate) {
7846
+ return addParamsToLabel(currencyTemplate, amount);
7847
+ }
7845
7848
  return `${amount} ${currency}`;
7846
7849
  };
7847
- const formatPriceSummary = ([min, max], currency, separator = ",") => {
7850
+ const formatPriceSummary = ([min, max], currency, separator = ",", currencyTemplate = "") => {
7848
7851
  if (min !== void 0 && max !== void 0) {
7849
- return `${formatPrice(min, currency, separator)} - ${formatPrice(max, currency, separator)}`;
7852
+ return `${formatPrice(min, currency, separator, currencyTemplate)} - ${formatPrice(
7853
+ max,
7854
+ currency,
7855
+ separator,
7856
+ currencyTemplate
7857
+ )}`;
7850
7858
  }
7851
7859
  if (min !== void 0) {
7852
- return `> ${formatPrice(min, currency, separator)}`;
7860
+ return `> ${formatPrice(min, currency, separator, currencyTemplate)}`;
7853
7861
  }
7854
- return `< ${formatPrice(max, currency, separator)}`;
7862
+ return `< ${formatPrice(max, currency, separator, currencyTemplate)}`;
7855
7863
  };
7856
7864
  const formatRange = (filter2) => {
7857
7865
  var _a, _b;
@@ -7881,7 +7889,12 @@ const unfoldRangeFilter = (key, filter2, price = {}) => {
7881
7889
  return [
7882
7890
  {
7883
7891
  key,
7884
- value: formatPriceSummary([gt, lt], price.currency, price.separator),
7892
+ value: formatPriceSummary(
7893
+ [gt, lt],
7894
+ price.currency,
7895
+ price.separator,
7896
+ price.currencyTemplate
7897
+ ),
7885
7898
  type: "range"
7886
7899
  }
7887
7900
  ];
@@ -14487,6 +14500,7 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
14487
14500
  },
14488
14501
  emits: ["go-to-results"],
14489
14502
  setup(__props, { emit: emit2 }) {
14503
+ const props = __props;
14490
14504
  const historyStore = useHistoryStore();
14491
14505
  const searchBoxStore = useSearchBoxStore();
14492
14506
  const { highlightedIndex } = storeToRefs(searchBoxStore);
@@ -14502,6 +14516,14 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
14502
14516
  onBeforeMount(() => {
14503
14517
  window.removeEventListener("keydown", handleKeyDown);
14504
14518
  });
14519
+ const historyLimit = computed(() => {
14520
+ var _a;
14521
+ return (_a = props.options.historyLimit) != null ? _a : 5;
14522
+ });
14523
+ const limitedHistory = computed(() => {
14524
+ var _a;
14525
+ return ((_a = history.value) != null ? _a : []).slice(0, historyLimit.value);
14526
+ });
14505
14527
  const remove2 = ({ item }) => {
14506
14528
  historyStore.remove({ item });
14507
14529
  };
@@ -14522,7 +14544,7 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
14522
14544
  };
14523
14545
  return (_ctx, _cache) => {
14524
14546
  return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1g, [
14525
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(history), (item, index) => {
14547
+ (openBlock(true), createElementBlock(Fragment, null, renderList(limitedHistory.value, (item, index) => {
14526
14548
  return openBlock(), createBlock(_sfc_main$1t, {
14527
14549
  key: item,
14528
14550
  item,
@@ -24079,11 +24101,12 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
24079
24101
  setup(__props) {
24080
24102
  const props = __props;
24081
24103
  const price = computed(() => {
24082
- var _a, _b;
24104
+ var _a, _b, _c;
24083
24105
  return formatPrice(
24084
24106
  props.item[props.options.key],
24085
24107
  (_a = props.labels) == null ? void 0 : _a.currency,
24086
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
24108
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
24109
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
24087
24110
  );
24088
24111
  });
24089
24112
  return (_ctx, _cache) => {
@@ -24106,11 +24129,12 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
24106
24129
  return props.options.className;
24107
24130
  });
24108
24131
  const price = computed(() => {
24109
- var _a, _b;
24132
+ var _a, _b, _c;
24110
24133
  return formatPrice(
24111
24134
  props.item[props.options.key],
24112
24135
  (_a = props.labels) == null ? void 0 : _a.currency,
24113
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
24136
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
24137
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
24114
24138
  );
24115
24139
  });
24116
24140
  return (_ctx, _cache) => {
@@ -24274,12 +24298,17 @@ const useSearchResultStore = defineStore("searchResult", () => {
24274
24298
  var _a, _b, _c;
24275
24299
  return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.priceSeparator) != null ? _c : "";
24276
24300
  });
24301
+ const currencyTemplate = computed(() => {
24302
+ var _a, _b, _c;
24303
+ return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currencyTemplate) != null ? _c : "";
24304
+ });
24277
24305
  const labeledFilters = computed(
24278
24306
  () => getLabeledFilters(
24279
24307
  unfoldFilters(filters.value, {
24280
24308
  keys: priceKeys.value,
24281
24309
  currency: currency.value,
24282
- separator: priceSeparator.value
24310
+ separator: priceSeparator.value,
24311
+ currencyTemplate: currencyTemplate.value
24283
24312
  }),
24284
24313
  facets2.value
24285
24314
  )
@@ -24827,11 +24856,12 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
24827
24856
  return 0;
24828
24857
  });
24829
24858
  const discountStringValue = computed(() => {
24830
- var _a, _b, _c, _d;
24859
+ var _a, _b, _c, _d, _e, _f;
24831
24860
  return props.badge.discountType === "percentage" ? discountValue.value.toFixed(0) : formatPrice(
24832
24861
  discountValue.value,
24833
24862
  (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currency,
24834
- (_d = (_c = searchResultOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.priceSeparator
24863
+ (_d = (_c = searchResultOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.priceSeparator,
24864
+ (_f = (_e = searchResultOptions.value) == null ? void 0 : _e.labels) == null ? void 0 : _f.currencyTemplate
24835
24865
  );
24836
24866
  });
24837
24867
  const hasDiscount = computed(() => {
@@ -27852,6 +27882,10 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
27852
27882
  var _a;
27853
27883
  return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currency;
27854
27884
  });
27885
+ const currencyTemplate = computed(() => {
27886
+ var _a;
27887
+ return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currencyTemplate;
27888
+ });
27855
27889
  const priceKeys = computed(() => {
27856
27890
  var _a, _b;
27857
27891
  return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
@@ -27934,7 +27968,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
27934
27968
  });
27935
27969
  const statsSummary = computed(() => {
27936
27970
  const [min, max] = sliderRange.value;
27937
- return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value) : formatRange({ gte: min, lte: max });
27971
+ return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value, currencyTemplate.value) : formatRange({ gte: min, lte: max });
27938
27972
  });
27939
27973
  const separator = computed(() => {
27940
27974
  var _a, _b, _c;
@@ -29587,11 +29621,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
29587
29621
  setup(__props) {
29588
29622
  const props = __props;
29589
29623
  const price = computed(() => {
29590
- var _a, _b;
29624
+ var _a, _b, _c;
29591
29625
  return formatPrice(
29592
29626
  props.item[props.options.key],
29593
29627
  (_a = props.labels) == null ? void 0 : _a.currency,
29594
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
29628
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
29629
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
29595
29630
  );
29596
29631
  });
29597
29632
  return (_ctx, _cache) => {
@@ -29612,11 +29647,12 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
29612
29647
  return props.options.className;
29613
29648
  });
29614
29649
  const price = computed(() => {
29615
- var _a, _b;
29650
+ var _a, _b, _c;
29616
29651
  return formatPrice(
29617
29652
  props.item[props.options.key],
29618
29653
  (_a = props.labels) == null ? void 0 : _a.currency,
29619
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
29654
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
29655
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
29620
29656
  );
29621
29657
  });
29622
29658
  return (_ctx, _cache) => {
@@ -7838,7 +7838,7 @@ var __async = (__this, __arguments, generator) => {
7838
7838
  }
7839
7839
  return (_b = value.toFixed(2)) == null ? void 0 : _b.replace(".", separator);
7840
7840
  };
7841
- const formatPrice = (price, currency = "€", separator = ",") => {
7841
+ const formatPrice = (price, currency = "€", separator = ",", currencyTemplate = "") => {
7842
7842
  if (price !== 0 && !price) {
7843
7843
  return "";
7844
7844
  }
@@ -7846,16 +7846,24 @@ var __async = (__this, __arguments, generator) => {
7846
7846
  if (!amount) {
7847
7847
  return "";
7848
7848
  }
7849
+ if (currencyTemplate) {
7850
+ return addParamsToLabel(currencyTemplate, amount);
7851
+ }
7849
7852
  return `${amount} ${currency}`;
7850
7853
  };
7851
- const formatPriceSummary = ([min, max], currency, separator = ",") => {
7854
+ const formatPriceSummary = ([min, max], currency, separator = ",", currencyTemplate = "") => {
7852
7855
  if (min !== void 0 && max !== void 0) {
7853
- return `${formatPrice(min, currency, separator)} - ${formatPrice(max, currency, separator)}`;
7856
+ return `${formatPrice(min, currency, separator, currencyTemplate)} - ${formatPrice(
7857
+ max,
7858
+ currency,
7859
+ separator,
7860
+ currencyTemplate
7861
+ )}`;
7854
7862
  }
7855
7863
  if (min !== void 0) {
7856
- return `> ${formatPrice(min, currency, separator)}`;
7864
+ return `> ${formatPrice(min, currency, separator, currencyTemplate)}`;
7857
7865
  }
7858
- return `< ${formatPrice(max, currency, separator)}`;
7866
+ return `< ${formatPrice(max, currency, separator, currencyTemplate)}`;
7859
7867
  };
7860
7868
  const formatRange = (filter2) => {
7861
7869
  var _a, _b;
@@ -7885,7 +7893,12 @@ var __async = (__this, __arguments, generator) => {
7885
7893
  return [
7886
7894
  {
7887
7895
  key,
7888
- value: formatPriceSummary([gt, lt], price.currency, price.separator),
7896
+ value: formatPriceSummary(
7897
+ [gt, lt],
7898
+ price.currency,
7899
+ price.separator,
7900
+ price.currencyTemplate
7901
+ ),
7889
7902
  type: "range"
7890
7903
  }
7891
7904
  ];
@@ -14491,6 +14504,7 @@ var __async = (__this, __arguments, generator) => {
14491
14504
  },
14492
14505
  emits: ["go-to-results"],
14493
14506
  setup(__props, { emit: emit2 }) {
14507
+ const props = __props;
14494
14508
  const historyStore = useHistoryStore();
14495
14509
  const searchBoxStore = useSearchBoxStore();
14496
14510
  const { highlightedIndex } = storeToRefs(searchBoxStore);
@@ -14506,6 +14520,14 @@ var __async = (__this, __arguments, generator) => {
14506
14520
  onBeforeMount(() => {
14507
14521
  window.removeEventListener("keydown", handleKeyDown);
14508
14522
  });
14523
+ const historyLimit = computed(() => {
14524
+ var _a;
14525
+ return (_a = props.options.historyLimit) != null ? _a : 5;
14526
+ });
14527
+ const limitedHistory = computed(() => {
14528
+ var _a;
14529
+ return ((_a = history.value) != null ? _a : []).slice(0, historyLimit.value);
14530
+ });
14509
14531
  const remove2 = ({ item }) => {
14510
14532
  historyStore.remove({ item });
14511
14533
  };
@@ -14526,7 +14548,7 @@ var __async = (__this, __arguments, generator) => {
14526
14548
  };
14527
14549
  return (_ctx, _cache) => {
14528
14550
  return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1g, [
14529
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(history), (item, index) => {
14551
+ (openBlock(true), createElementBlock(Fragment, null, renderList(limitedHistory.value, (item, index) => {
14530
14552
  return openBlock(), createBlock(_sfc_main$1t, {
14531
14553
  key: item,
14532
14554
  item,
@@ -24083,11 +24105,12 @@ and ensure you are accounting for this risk.
24083
24105
  setup(__props) {
24084
24106
  const props = __props;
24085
24107
  const price = computed(() => {
24086
- var _a, _b;
24108
+ var _a, _b, _c;
24087
24109
  return formatPrice(
24088
24110
  props.item[props.options.key],
24089
24111
  (_a = props.labels) == null ? void 0 : _a.currency,
24090
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
24112
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
24113
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
24091
24114
  );
24092
24115
  });
24093
24116
  return (_ctx, _cache) => {
@@ -24110,11 +24133,12 @@ and ensure you are accounting for this risk.
24110
24133
  return props.options.className;
24111
24134
  });
24112
24135
  const price = computed(() => {
24113
- var _a, _b;
24136
+ var _a, _b, _c;
24114
24137
  return formatPrice(
24115
24138
  props.item[props.options.key],
24116
24139
  (_a = props.labels) == null ? void 0 : _a.currency,
24117
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
24140
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
24141
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
24118
24142
  );
24119
24143
  });
24120
24144
  return (_ctx, _cache) => {
@@ -24278,12 +24302,17 @@ and ensure you are accounting for this risk.
24278
24302
  var _a, _b, _c;
24279
24303
  return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.priceSeparator) != null ? _c : "";
24280
24304
  });
24305
+ const currencyTemplate = computed(() => {
24306
+ var _a, _b, _c;
24307
+ return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currencyTemplate) != null ? _c : "";
24308
+ });
24281
24309
  const labeledFilters = computed(
24282
24310
  () => getLabeledFilters(
24283
24311
  unfoldFilters(filters.value, {
24284
24312
  keys: priceKeys.value,
24285
24313
  currency: currency.value,
24286
- separator: priceSeparator.value
24314
+ separator: priceSeparator.value,
24315
+ currencyTemplate: currencyTemplate.value
24287
24316
  }),
24288
24317
  facets2.value
24289
24318
  )
@@ -24831,11 +24860,12 @@ and ensure you are accounting for this risk.
24831
24860
  return 0;
24832
24861
  });
24833
24862
  const discountStringValue = computed(() => {
24834
- var _a, _b, _c, _d;
24863
+ var _a, _b, _c, _d, _e, _f;
24835
24864
  return props.badge.discountType === "percentage" ? discountValue.value.toFixed(0) : formatPrice(
24836
24865
  discountValue.value,
24837
24866
  (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currency,
24838
- (_d = (_c = searchResultOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.priceSeparator
24867
+ (_d = (_c = searchResultOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.priceSeparator,
24868
+ (_f = (_e = searchResultOptions.value) == null ? void 0 : _e.labels) == null ? void 0 : _f.currencyTemplate
24839
24869
  );
24840
24870
  });
24841
24871
  const hasDiscount = computed(() => {
@@ -27856,6 +27886,10 @@ and ensure you are accounting for this risk.
27856
27886
  var _a;
27857
27887
  return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currency;
27858
27888
  });
27889
+ const currencyTemplate = computed(() => {
27890
+ var _a;
27891
+ return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currencyTemplate;
27892
+ });
27859
27893
  const priceKeys = computed(() => {
27860
27894
  var _a, _b;
27861
27895
  return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
@@ -27938,7 +27972,7 @@ and ensure you are accounting for this risk.
27938
27972
  });
27939
27973
  const statsSummary = computed(() => {
27940
27974
  const [min, max] = sliderRange.value;
27941
- return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value) : formatRange({ gte: min, lte: max });
27975
+ return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value, currencyTemplate.value) : formatRange({ gte: min, lte: max });
27942
27976
  });
27943
27977
  const separator = computed(() => {
27944
27978
  var _a, _b, _c;
@@ -29591,11 +29625,12 @@ and ensure you are accounting for this risk.
29591
29625
  setup(__props) {
29592
29626
  const props = __props;
29593
29627
  const price = computed(() => {
29594
- var _a, _b;
29628
+ var _a, _b, _c;
29595
29629
  return formatPrice(
29596
29630
  props.item[props.options.key],
29597
29631
  (_a = props.labels) == null ? void 0 : _a.currency,
29598
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
29632
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
29633
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
29599
29634
  );
29600
29635
  });
29601
29636
  return (_ctx, _cache) => {
@@ -29616,11 +29651,12 @@ and ensure you are accounting for this risk.
29616
29651
  return props.options.className;
29617
29652
  });
29618
29653
  const price = computed(() => {
29619
- var _a, _b;
29654
+ var _a, _b, _c;
29620
29655
  return formatPrice(
29621
29656
  props.item[props.options.key],
29622
29657
  (_a = props.labels) == null ? void 0 : _a.currency,
29623
- (_b = props.labels) == null ? void 0 : _b.priceSeparator
29658
+ (_b = props.labels) == null ? void 0 : _b.priceSeparator,
29659
+ (_c = props.labels) == null ? void 0 : _c.currencyTemplate
29624
29660
  );
29625
29661
  });
29626
29662
  return (_ctx, _cache) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
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.17.0",
23
+ "@getlupa/vue": "0.17.1",
24
24
  "@rushstack/eslint-patch": "^1.3.2",
25
25
  "@tsconfig/node18": "^2.0.1",
26
26
  "@types/jsdom": "^21.1.1",