@getlupa/client 1.23.0 → 1.23.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.
@@ -18526,12 +18526,15 @@ var __async = (__this, __arguments, generator) => {
18526
18526
  const FACET_PARAMS_TYPE = {
18527
18527
  TERMS: "f.",
18528
18528
  RANGE: "fr.",
18529
+ PARTIAL_RANGE: "fpr.",
18529
18530
  HIERARCHY: "fh."
18530
18531
  };
18531
18532
  const FACET_FILTER_MAP = {
18532
18533
  terms: FACET_PARAMS_TYPE.TERMS,
18533
18534
  range: FACET_PARAMS_TYPE.RANGE,
18534
- hierarchy: FACET_PARAMS_TYPE.HIERARCHY
18535
+ stats: FACET_PARAMS_TYPE.RANGE,
18536
+ hierarchy: FACET_PARAMS_TYPE.HIERARCHY,
18537
+ partialRange: FACET_PARAMS_TYPE.PARTIAL_RANGE
18535
18538
  };
18536
18539
  const FACET_KEY_SEPARATOR = ".";
18537
18540
  const FACET_RANGE_SEPARATOR = ":";
@@ -18685,7 +18688,7 @@ var __async = (__this, __arguments, generator) => {
18685
18688
  });
18686
18689
  });
18687
18690
  };
18688
- const isFacetKey = (key) => key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.TERMS) || key.startsWith(FACET_PARAMS_TYPE.HIERARCHY);
18691
+ const isFacetKey = (key) => key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.TERMS) || key.startsWith(FACET_PARAMS_TYPE.HIERARCHY) || key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE);
18689
18692
  const getMostSpecificHierarchyTerms = (terms) => {
18690
18693
  const specificTerms = [];
18691
18694
  for (const term of terms) {
@@ -18773,8 +18776,7 @@ var __async = (__this, __arguments, generator) => {
18773
18776
  if (key.startsWith(FACET_PARAMS_TYPE.TERMS)) {
18774
18777
  return (_b25 = (_a25 = searchParams.getAll(key)) == null ? void 0 : _a25.map((v) => decodeURIComponent(v))) != null ? _b25 : [];
18775
18778
  }
18776
- if (key.startsWith(FACET_PARAMS_TYPE.RANGE)) {
18777
- const isPrice = key == null ? void 0 : key.includes(CURRENCY_KEY_INDICATOR);
18779
+ if (key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE)) {
18778
18780
  const range2 = searchParams.get(key);
18779
18781
  if (!range2) {
18780
18782
  return {};
@@ -18782,7 +18784,7 @@ var __async = (__this, __arguments, generator) => {
18782
18784
  const [min, max] = range2.split(FACET_RANGE_SEPARATOR);
18783
18785
  return {
18784
18786
  gte: min || void 0,
18785
- [isPrice ? "lte" : "lt"]: max || void 0
18787
+ [key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE) ? "lt" : "lte"]: max || void 0
18786
18788
  };
18787
18789
  }
18788
18790
  if (key.startsWith(FACET_PARAMS_TYPE.HIERARCHY)) {
@@ -18984,6 +18986,7 @@ var __async = (__this, __arguments, generator) => {
18984
18986
  };
18985
18987
  const toggleRangeFilter = (appendParams, removeParameters, facetAction, getQueryParamName, currentFilters) => {
18986
18988
  var _a25, _b25;
18989
+ const baseFacetQueryParamName = facetAction.type === "partialRange" ? FACET_PARAMS_TYPE.PARTIAL_RANGE : FACET_PARAMS_TYPE.RANGE;
18987
18990
  const currentFilter = rangeFilterToString(
18988
18991
  currentFilters == null ? void 0 : currentFilters[facetAction.key],
18989
18992
  FACET_RANGE_SEPARATOR
@@ -18994,14 +18997,14 @@ var __async = (__this, __arguments, generator) => {
18994
18997
  if (!facetValue) {
18995
18998
  removeParameters({
18996
18999
  paramsToRemove: [
18997
- getFacetParam(facetAction.key, "", FACET_PARAMS_TYPE.RANGE).name,
19000
+ getFacetParam(facetAction.key, "", baseFacetQueryParamName).name,
18998
19001
  ...paramsToRemove
18999
19002
  ]
19000
19003
  });
19001
19004
  return;
19002
19005
  }
19003
19006
  appendParams({
19004
- params: [getFacetParam(facetAction.key, facetValue, FACET_PARAMS_TYPE.RANGE)],
19007
+ params: [getFacetParam(facetAction.key, facetValue, baseFacetQueryParamName)],
19005
19008
  paramsToRemove,
19006
19009
  encode: false
19007
19010
  });
@@ -32694,12 +32697,10 @@ and ensure you are accounting for this risk.
32694
32697
  setup(__props) {
32695
32698
  const optionsStore = useOptionsStore();
32696
32699
  const { searchResultOptions } = storeToRefs(optionsStore);
32697
- const units = computed(
32698
- () => {
32699
- var _a25, _b25, _c, _d, _e;
32700
- return (_e = (_d = (_c = (_b25 = (_a25 = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a25.filters) == null ? void 0 : _b25.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
32701
- }
32702
- );
32700
+ const units = computed(() => {
32701
+ var _a25, _b25, _c, _d, _e;
32702
+ return (_e = (_d = (_c = (_b25 = (_a25 = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a25.filters) == null ? void 0 : _b25.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
32703
+ });
32703
32704
  const isOpen = ref(false);
32704
32705
  const paramsStore = useParamsStore();
32705
32706
  const optionStore = useOptionsStore();
@@ -32749,7 +32750,8 @@ and ensure you are accounting for this risk.
32749
32750
  paramsStore.removeParameters({
32750
32751
  paramsToRemove: [
32751
32752
  optionStore.getQueryParamName(QUERY_PARAMS$1.PAGE),
32752
- `${FACET_PARAMS_TYPE.RANGE}${filter.key}`
32753
+ `${FACET_PARAMS_TYPE.RANGE}${filter.key}`,
32754
+ `${FACET_PARAMS_TYPE.PARTIAL_RANGE}${filter.key}`
32753
32755
  ]
32754
32756
  });
32755
32757
  break;
@@ -33048,7 +33050,7 @@ and ensure you are accounting for this risk.
33048
33050
  emit2("select", {
33049
33051
  key: facet.value.key,
33050
33052
  value,
33051
- type: facet.value.type
33053
+ type: facet.value.type === "range" ? "partialRange" : facet.value.type
33052
33054
  });
33053
33055
  };
33054
33056
  const toggleShowAll = () => {
@@ -35036,6 +35038,15 @@ and ensure you are accounting for this risk.
35036
35038
  filters.value
35037
35039
  );
35038
35040
  break;
35041
+ case "partialRange":
35042
+ toggleRangeFilter(
35043
+ paramStore.appendParams,
35044
+ paramStore.removeParameters,
35045
+ facetAction,
35046
+ optionsStore.getQueryParamName,
35047
+ filters.value
35048
+ );
35049
+ break;
35039
35050
  case "hierarchy":
35040
35051
  toggleHierarchyFilter(
35041
35052
  paramStore.appendParams,
@@ -35053,8 +35064,14 @@ and ensure you are accounting for this risk.
35053
35064
  }
35054
35065
  };
35055
35066
  const clear = (facet) => {
35056
- const param = getFacetKey(facet.key, facet.type);
35057
- paramStore.removeParameters({ paramsToRemove: [param] });
35067
+ if (facet.type === "range") {
35068
+ paramStore.removeParameters({
35069
+ paramsToRemove: [getFacetKey(facet.key, "range"), getFacetKey(facet.key, "partialRange")]
35070
+ });
35071
+ } else {
35072
+ const param = getFacetKey(facet.key, facet.type);
35073
+ paramStore.removeParameters({ paramsToRemove: [param] });
35074
+ }
35058
35075
  };
35059
35076
  const clearAll = () => {
35060
35077
  paramStore.removeAllFilters();
@@ -18526,12 +18526,15 @@ const QUERY_PARAMS_PARSED = {
18526
18526
  const FACET_PARAMS_TYPE = {
18527
18527
  TERMS: "f.",
18528
18528
  RANGE: "fr.",
18529
+ PARTIAL_RANGE: "fpr.",
18529
18530
  HIERARCHY: "fh."
18530
18531
  };
18531
18532
  const FACET_FILTER_MAP = {
18532
18533
  terms: FACET_PARAMS_TYPE.TERMS,
18533
18534
  range: FACET_PARAMS_TYPE.RANGE,
18534
- hierarchy: FACET_PARAMS_TYPE.HIERARCHY
18535
+ stats: FACET_PARAMS_TYPE.RANGE,
18536
+ hierarchy: FACET_PARAMS_TYPE.HIERARCHY,
18537
+ partialRange: FACET_PARAMS_TYPE.PARTIAL_RANGE
18535
18538
  };
18536
18539
  const FACET_KEY_SEPARATOR = ".";
18537
18540
  const FACET_RANGE_SEPARATOR = ":";
@@ -18685,7 +18688,7 @@ const getLabeledFilters = (filters, facets2, translations) => {
18685
18688
  });
18686
18689
  });
18687
18690
  };
18688
- const isFacetKey = (key) => key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.TERMS) || key.startsWith(FACET_PARAMS_TYPE.HIERARCHY);
18691
+ const isFacetKey = (key) => key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.TERMS) || key.startsWith(FACET_PARAMS_TYPE.HIERARCHY) || key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE);
18689
18692
  const getMostSpecificHierarchyTerms = (terms) => {
18690
18693
  const specificTerms = [];
18691
18694
  for (const term of terms) {
@@ -18773,8 +18776,7 @@ const parseFacetKey = (key, searchParams) => {
18773
18776
  if (key.startsWith(FACET_PARAMS_TYPE.TERMS)) {
18774
18777
  return (_b25 = (_a25 = searchParams.getAll(key)) == null ? void 0 : _a25.map((v) => decodeURIComponent(v))) != null ? _b25 : [];
18775
18778
  }
18776
- if (key.startsWith(FACET_PARAMS_TYPE.RANGE)) {
18777
- const isPrice = key == null ? void 0 : key.includes(CURRENCY_KEY_INDICATOR);
18779
+ if (key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE)) {
18778
18780
  const range2 = searchParams.get(key);
18779
18781
  if (!range2) {
18780
18782
  return {};
@@ -18782,7 +18784,7 @@ const parseFacetKey = (key, searchParams) => {
18782
18784
  const [min, max] = range2.split(FACET_RANGE_SEPARATOR);
18783
18785
  return {
18784
18786
  gte: min || void 0,
18785
- [isPrice ? "lte" : "lt"]: max || void 0
18787
+ [key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE) ? "lt" : "lte"]: max || void 0
18786
18788
  };
18787
18789
  }
18788
18790
  if (key.startsWith(FACET_PARAMS_TYPE.HIERARCHY)) {
@@ -18984,6 +18986,7 @@ const toggleHierarchyFilter = (appendParams, facetAction, getQueryParamName, cur
18984
18986
  };
18985
18987
  const toggleRangeFilter = (appendParams, removeParameters, facetAction, getQueryParamName, currentFilters) => {
18986
18988
  var _a25, _b25;
18989
+ const baseFacetQueryParamName = facetAction.type === "partialRange" ? FACET_PARAMS_TYPE.PARTIAL_RANGE : FACET_PARAMS_TYPE.RANGE;
18987
18990
  const currentFilter = rangeFilterToString(
18988
18991
  currentFilters == null ? void 0 : currentFilters[facetAction.key],
18989
18992
  FACET_RANGE_SEPARATOR
@@ -18994,14 +18997,14 @@ const toggleRangeFilter = (appendParams, removeParameters, facetAction, getQuery
18994
18997
  if (!facetValue) {
18995
18998
  removeParameters({
18996
18999
  paramsToRemove: [
18997
- getFacetParam(facetAction.key, "", FACET_PARAMS_TYPE.RANGE).name,
19000
+ getFacetParam(facetAction.key, "", baseFacetQueryParamName).name,
18998
19001
  ...paramsToRemove
18999
19002
  ]
19000
19003
  });
19001
19004
  return;
19002
19005
  }
19003
19006
  appendParams({
19004
- params: [getFacetParam(facetAction.key, facetValue, FACET_PARAMS_TYPE.RANGE)],
19007
+ params: [getFacetParam(facetAction.key, facetValue, baseFacetQueryParamName)],
19005
19008
  paramsToRemove,
19006
19009
  encode: false
19007
19010
  });
@@ -32694,12 +32697,10 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
32694
32697
  setup(__props) {
32695
32698
  const optionsStore = useOptionsStore();
32696
32699
  const { searchResultOptions } = storeToRefs(optionsStore);
32697
- const units = computed(
32698
- () => {
32699
- var _a25, _b25, _c, _d, _e;
32700
- return (_e = (_d = (_c = (_b25 = (_a25 = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a25.filters) == null ? void 0 : _b25.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
32701
- }
32702
- );
32700
+ const units = computed(() => {
32701
+ var _a25, _b25, _c, _d, _e;
32702
+ return (_e = (_d = (_c = (_b25 = (_a25 = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a25.filters) == null ? void 0 : _b25.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
32703
+ });
32703
32704
  const isOpen = ref(false);
32704
32705
  const paramsStore = useParamsStore();
32705
32706
  const optionStore = useOptionsStore();
@@ -32749,7 +32750,8 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
32749
32750
  paramsStore.removeParameters({
32750
32751
  paramsToRemove: [
32751
32752
  optionStore.getQueryParamName(QUERY_PARAMS$1.PAGE),
32752
- `${FACET_PARAMS_TYPE.RANGE}${filter.key}`
32753
+ `${FACET_PARAMS_TYPE.RANGE}${filter.key}`,
32754
+ `${FACET_PARAMS_TYPE.PARTIAL_RANGE}${filter.key}`
32753
32755
  ]
32754
32756
  });
32755
32757
  break;
@@ -33048,7 +33050,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
33048
33050
  emit2("select", {
33049
33051
  key: facet.value.key,
33050
33052
  value,
33051
- type: facet.value.type
33053
+ type: facet.value.type === "range" ? "partialRange" : facet.value.type
33052
33054
  });
33053
33055
  };
33054
33056
  const toggleShowAll = () => {
@@ -35036,6 +35038,15 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
35036
35038
  filters.value
35037
35039
  );
35038
35040
  break;
35041
+ case "partialRange":
35042
+ toggleRangeFilter(
35043
+ paramStore.appendParams,
35044
+ paramStore.removeParameters,
35045
+ facetAction,
35046
+ optionsStore.getQueryParamName,
35047
+ filters.value
35048
+ );
35049
+ break;
35039
35050
  case "hierarchy":
35040
35051
  toggleHierarchyFilter(
35041
35052
  paramStore.appendParams,
@@ -35053,8 +35064,14 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
35053
35064
  }
35054
35065
  };
35055
35066
  const clear = (facet) => {
35056
- const param = getFacetKey(facet.key, facet.type);
35057
- paramStore.removeParameters({ paramsToRemove: [param] });
35067
+ if (facet.type === "range") {
35068
+ paramStore.removeParameters({
35069
+ paramsToRemove: [getFacetKey(facet.key, "range"), getFacetKey(facet.key, "partialRange")]
35070
+ });
35071
+ } else {
35072
+ const param = getFacetKey(facet.key, facet.type);
35073
+ paramStore.removeParameters({ paramsToRemove: [param] });
35074
+ }
35058
35075
  };
35059
35076
  const clearAll = () => {
35060
35077
  paramStore.removeAllFilters();
@@ -18524,12 +18524,15 @@ const QUERY_PARAMS_PARSED = {
18524
18524
  const FACET_PARAMS_TYPE = {
18525
18525
  TERMS: "f.",
18526
18526
  RANGE: "fr.",
18527
+ PARTIAL_RANGE: "fpr.",
18527
18528
  HIERARCHY: "fh."
18528
18529
  };
18529
18530
  const FACET_FILTER_MAP = {
18530
18531
  terms: FACET_PARAMS_TYPE.TERMS,
18531
18532
  range: FACET_PARAMS_TYPE.RANGE,
18532
- hierarchy: FACET_PARAMS_TYPE.HIERARCHY
18533
+ stats: FACET_PARAMS_TYPE.RANGE,
18534
+ hierarchy: FACET_PARAMS_TYPE.HIERARCHY,
18535
+ partialRange: FACET_PARAMS_TYPE.PARTIAL_RANGE
18533
18536
  };
18534
18537
  const FACET_KEY_SEPARATOR = ".";
18535
18538
  const FACET_RANGE_SEPARATOR = ":";
@@ -18683,7 +18686,7 @@ const getLabeledFilters = (filters, facets2, translations) => {
18683
18686
  });
18684
18687
  });
18685
18688
  };
18686
- const isFacetKey = (key) => key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.TERMS) || key.startsWith(FACET_PARAMS_TYPE.HIERARCHY);
18689
+ const isFacetKey = (key) => key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.TERMS) || key.startsWith(FACET_PARAMS_TYPE.HIERARCHY) || key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE);
18687
18690
  const getMostSpecificHierarchyTerms = (terms) => {
18688
18691
  const specificTerms = [];
18689
18692
  for (const term of terms) {
@@ -18771,8 +18774,7 @@ const parseFacetKey = (key, searchParams) => {
18771
18774
  if (key.startsWith(FACET_PARAMS_TYPE.TERMS)) {
18772
18775
  return (_b25 = (_a25 = searchParams.getAll(key)) == null ? void 0 : _a25.map((v) => decodeURIComponent(v))) != null ? _b25 : [];
18773
18776
  }
18774
- if (key.startsWith(FACET_PARAMS_TYPE.RANGE)) {
18775
- const isPrice = key == null ? void 0 : key.includes(CURRENCY_KEY_INDICATOR);
18777
+ if (key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE)) {
18776
18778
  const range2 = searchParams.get(key);
18777
18779
  if (!range2) {
18778
18780
  return {};
@@ -18780,7 +18782,7 @@ const parseFacetKey = (key, searchParams) => {
18780
18782
  const [min, max] = range2.split(FACET_RANGE_SEPARATOR);
18781
18783
  return {
18782
18784
  gte: min || void 0,
18783
- [isPrice ? "lte" : "lt"]: max || void 0
18785
+ [key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE) ? "lt" : "lte"]: max || void 0
18784
18786
  };
18785
18787
  }
18786
18788
  if (key.startsWith(FACET_PARAMS_TYPE.HIERARCHY)) {
@@ -18982,6 +18984,7 @@ const toggleHierarchyFilter = (appendParams, facetAction, getQueryParamName, cur
18982
18984
  };
18983
18985
  const toggleRangeFilter = (appendParams, removeParameters, facetAction, getQueryParamName, currentFilters) => {
18984
18986
  var _a25, _b25;
18987
+ const baseFacetQueryParamName = facetAction.type === "partialRange" ? FACET_PARAMS_TYPE.PARTIAL_RANGE : FACET_PARAMS_TYPE.RANGE;
18985
18988
  const currentFilter = rangeFilterToString(
18986
18989
  currentFilters == null ? void 0 : currentFilters[facetAction.key],
18987
18990
  FACET_RANGE_SEPARATOR
@@ -18992,14 +18995,14 @@ const toggleRangeFilter = (appendParams, removeParameters, facetAction, getQuery
18992
18995
  if (!facetValue) {
18993
18996
  removeParameters({
18994
18997
  paramsToRemove: [
18995
- getFacetParam(facetAction.key, "", FACET_PARAMS_TYPE.RANGE).name,
18998
+ getFacetParam(facetAction.key, "", baseFacetQueryParamName).name,
18996
18999
  ...paramsToRemove
18997
19000
  ]
18998
19001
  });
18999
19002
  return;
19000
19003
  }
19001
19004
  appendParams({
19002
- params: [getFacetParam(facetAction.key, facetValue, FACET_PARAMS_TYPE.RANGE)],
19005
+ params: [getFacetParam(facetAction.key, facetValue, baseFacetQueryParamName)],
19003
19006
  paramsToRemove,
19004
19007
  encode: false
19005
19008
  });
@@ -32692,12 +32695,10 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
32692
32695
  setup(__props) {
32693
32696
  const optionsStore = useOptionsStore();
32694
32697
  const { searchResultOptions } = storeToRefs(optionsStore);
32695
- const units = computed(
32696
- () => {
32697
- var _a25, _b25, _c, _d, _e;
32698
- return (_e = (_d = (_c = (_b25 = (_a25 = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a25.filters) == null ? void 0 : _b25.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
32699
- }
32700
- );
32698
+ const units = computed(() => {
32699
+ var _a25, _b25, _c, _d, _e;
32700
+ return (_e = (_d = (_c = (_b25 = (_a25 = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a25.filters) == null ? void 0 : _b25.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
32701
+ });
32701
32702
  const isOpen = ref(false);
32702
32703
  const paramsStore = useParamsStore();
32703
32704
  const optionStore = useOptionsStore();
@@ -32747,7 +32748,8 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
32747
32748
  paramsStore.removeParameters({
32748
32749
  paramsToRemove: [
32749
32750
  optionStore.getQueryParamName(QUERY_PARAMS$1.PAGE),
32750
- `${FACET_PARAMS_TYPE.RANGE}${filter.key}`
32751
+ `${FACET_PARAMS_TYPE.RANGE}${filter.key}`,
32752
+ `${FACET_PARAMS_TYPE.PARTIAL_RANGE}${filter.key}`
32751
32753
  ]
32752
32754
  });
32753
32755
  break;
@@ -33046,7 +33048,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
33046
33048
  emit2("select", {
33047
33049
  key: facet.value.key,
33048
33050
  value,
33049
- type: facet.value.type
33051
+ type: facet.value.type === "range" ? "partialRange" : facet.value.type
33050
33052
  });
33051
33053
  };
33052
33054
  const toggleShowAll = () => {
@@ -35034,6 +35036,15 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
35034
35036
  filters.value
35035
35037
  );
35036
35038
  break;
35039
+ case "partialRange":
35040
+ toggleRangeFilter(
35041
+ paramStore.appendParams,
35042
+ paramStore.removeParameters,
35043
+ facetAction,
35044
+ optionsStore.getQueryParamName,
35045
+ filters.value
35046
+ );
35047
+ break;
35037
35048
  case "hierarchy":
35038
35049
  toggleHierarchyFilter(
35039
35050
  paramStore.appendParams,
@@ -35051,8 +35062,14 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
35051
35062
  }
35052
35063
  };
35053
35064
  const clear = (facet) => {
35054
- const param = getFacetKey(facet.key, facet.type);
35055
- paramStore.removeParameters({ paramsToRemove: [param] });
35065
+ if (facet.type === "range") {
35066
+ paramStore.removeParameters({
35067
+ paramsToRemove: [getFacetKey(facet.key, "range"), getFacetKey(facet.key, "partialRange")]
35068
+ });
35069
+ } else {
35070
+ const param = getFacetKey(facet.key, facet.type);
35071
+ paramStore.removeParameters({ paramsToRemove: [param] });
35072
+ }
35056
35073
  };
35057
35074
  const clearAll = () => {
35058
35075
  paramStore.removeAllFilters();
@@ -18528,12 +18528,15 @@ var __async = (__this, __arguments, generator) => {
18528
18528
  const FACET_PARAMS_TYPE = {
18529
18529
  TERMS: "f.",
18530
18530
  RANGE: "fr.",
18531
+ PARTIAL_RANGE: "fpr.",
18531
18532
  HIERARCHY: "fh."
18532
18533
  };
18533
18534
  const FACET_FILTER_MAP = {
18534
18535
  terms: FACET_PARAMS_TYPE.TERMS,
18535
18536
  range: FACET_PARAMS_TYPE.RANGE,
18536
- hierarchy: FACET_PARAMS_TYPE.HIERARCHY
18537
+ stats: FACET_PARAMS_TYPE.RANGE,
18538
+ hierarchy: FACET_PARAMS_TYPE.HIERARCHY,
18539
+ partialRange: FACET_PARAMS_TYPE.PARTIAL_RANGE
18537
18540
  };
18538
18541
  const FACET_KEY_SEPARATOR = ".";
18539
18542
  const FACET_RANGE_SEPARATOR = ":";
@@ -18687,7 +18690,7 @@ var __async = (__this, __arguments, generator) => {
18687
18690
  });
18688
18691
  });
18689
18692
  };
18690
- const isFacetKey = (key) => key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.TERMS) || key.startsWith(FACET_PARAMS_TYPE.HIERARCHY);
18693
+ const isFacetKey = (key) => key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.TERMS) || key.startsWith(FACET_PARAMS_TYPE.HIERARCHY) || key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE);
18691
18694
  const getMostSpecificHierarchyTerms = (terms) => {
18692
18695
  const specificTerms = [];
18693
18696
  for (const term of terms) {
@@ -18775,8 +18778,7 @@ var __async = (__this, __arguments, generator) => {
18775
18778
  if (key.startsWith(FACET_PARAMS_TYPE.TERMS)) {
18776
18779
  return (_b25 = (_a25 = searchParams.getAll(key)) == null ? void 0 : _a25.map((v) => decodeURIComponent(v))) != null ? _b25 : [];
18777
18780
  }
18778
- if (key.startsWith(FACET_PARAMS_TYPE.RANGE)) {
18779
- const isPrice = key == null ? void 0 : key.includes(CURRENCY_KEY_INDICATOR);
18781
+ if (key.startsWith(FACET_PARAMS_TYPE.RANGE) || key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE)) {
18780
18782
  const range2 = searchParams.get(key);
18781
18783
  if (!range2) {
18782
18784
  return {};
@@ -18784,7 +18786,7 @@ var __async = (__this, __arguments, generator) => {
18784
18786
  const [min, max] = range2.split(FACET_RANGE_SEPARATOR);
18785
18787
  return {
18786
18788
  gte: min || void 0,
18787
- [isPrice ? "lte" : "lt"]: max || void 0
18789
+ [key.startsWith(FACET_PARAMS_TYPE.PARTIAL_RANGE) ? "lt" : "lte"]: max || void 0
18788
18790
  };
18789
18791
  }
18790
18792
  if (key.startsWith(FACET_PARAMS_TYPE.HIERARCHY)) {
@@ -18986,6 +18988,7 @@ var __async = (__this, __arguments, generator) => {
18986
18988
  };
18987
18989
  const toggleRangeFilter = (appendParams, removeParameters, facetAction, getQueryParamName, currentFilters) => {
18988
18990
  var _a25, _b25;
18991
+ const baseFacetQueryParamName = facetAction.type === "partialRange" ? FACET_PARAMS_TYPE.PARTIAL_RANGE : FACET_PARAMS_TYPE.RANGE;
18989
18992
  const currentFilter = rangeFilterToString(
18990
18993
  currentFilters == null ? void 0 : currentFilters[facetAction.key],
18991
18994
  FACET_RANGE_SEPARATOR
@@ -18996,14 +18999,14 @@ var __async = (__this, __arguments, generator) => {
18996
18999
  if (!facetValue) {
18997
19000
  removeParameters({
18998
19001
  paramsToRemove: [
18999
- getFacetParam(facetAction.key, "", FACET_PARAMS_TYPE.RANGE).name,
19002
+ getFacetParam(facetAction.key, "", baseFacetQueryParamName).name,
19000
19003
  ...paramsToRemove
19001
19004
  ]
19002
19005
  });
19003
19006
  return;
19004
19007
  }
19005
19008
  appendParams({
19006
- params: [getFacetParam(facetAction.key, facetValue, FACET_PARAMS_TYPE.RANGE)],
19009
+ params: [getFacetParam(facetAction.key, facetValue, baseFacetQueryParamName)],
19007
19010
  paramsToRemove,
19008
19011
  encode: false
19009
19012
  });
@@ -32696,12 +32699,10 @@ and ensure you are accounting for this risk.
32696
32699
  setup(__props) {
32697
32700
  const optionsStore = useOptionsStore();
32698
32701
  const { searchResultOptions } = storeToRefs(optionsStore);
32699
- const units = computed(
32700
- () => {
32701
- var _a25, _b25, _c, _d, _e;
32702
- return (_e = (_d = (_c = (_b25 = (_a25 = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a25.filters) == null ? void 0 : _b25.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
32703
- }
32704
- );
32702
+ const units = computed(() => {
32703
+ var _a25, _b25, _c, _d, _e;
32704
+ return (_e = (_d = (_c = (_b25 = (_a25 = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a25.filters) == null ? void 0 : _b25.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
32705
+ });
32705
32706
  const isOpen = ref(false);
32706
32707
  const paramsStore = useParamsStore();
32707
32708
  const optionStore = useOptionsStore();
@@ -32751,7 +32752,8 @@ and ensure you are accounting for this risk.
32751
32752
  paramsStore.removeParameters({
32752
32753
  paramsToRemove: [
32753
32754
  optionStore.getQueryParamName(QUERY_PARAMS$1.PAGE),
32754
- `${FACET_PARAMS_TYPE.RANGE}${filter.key}`
32755
+ `${FACET_PARAMS_TYPE.RANGE}${filter.key}`,
32756
+ `${FACET_PARAMS_TYPE.PARTIAL_RANGE}${filter.key}`
32755
32757
  ]
32756
32758
  });
32757
32759
  break;
@@ -33050,7 +33052,7 @@ and ensure you are accounting for this risk.
33050
33052
  emit2("select", {
33051
33053
  key: facet.value.key,
33052
33054
  value,
33053
- type: facet.value.type
33055
+ type: facet.value.type === "range" ? "partialRange" : facet.value.type
33054
33056
  });
33055
33057
  };
33056
33058
  const toggleShowAll = () => {
@@ -35038,6 +35040,15 @@ and ensure you are accounting for this risk.
35038
35040
  filters.value
35039
35041
  );
35040
35042
  break;
35043
+ case "partialRange":
35044
+ toggleRangeFilter(
35045
+ paramStore.appendParams,
35046
+ paramStore.removeParameters,
35047
+ facetAction,
35048
+ optionsStore.getQueryParamName,
35049
+ filters.value
35050
+ );
35051
+ break;
35041
35052
  case "hierarchy":
35042
35053
  toggleHierarchyFilter(
35043
35054
  paramStore.appendParams,
@@ -35055,8 +35066,14 @@ and ensure you are accounting for this risk.
35055
35066
  }
35056
35067
  };
35057
35068
  const clear = (facet) => {
35058
- const param = getFacetKey(facet.key, facet.type);
35059
- paramStore.removeParameters({ paramsToRemove: [param] });
35069
+ if (facet.type === "range") {
35070
+ paramStore.removeParameters({
35071
+ paramsToRemove: [getFacetKey(facet.key, "range"), getFacetKey(facet.key, "partialRange")]
35072
+ });
35073
+ } else {
35074
+ const param = getFacetKey(facet.key, facet.type);
35075
+ paramStore.removeParameters({ paramsToRemove: [param] });
35076
+ }
35060
35077
  };
35061
35078
  const clearAll = () => {
35062
35079
  paramStore.removeAllFilters();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.23.0",
3
+ "version": "1.23.1",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/lupaSearch.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.8.1",
23
- "@getlupa/vue": "0.23.0",
23
+ "@getlupa/vue": "0.23.1",
24
24
  "@rushstack/eslint-patch": "^1.12.0",
25
25
  "@tsconfig/node18": "^18.2.4",
26
26
  "@types/jsdom": "^21.1.7",