@getlupa/client 1.22.0 → 1.22.3

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.
@@ -19175,6 +19175,18 @@ var __async = (__this, __arguments, generator) => {
19175
19175
  params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
19176
19176
  searchString.value = url.search;
19177
19177
  };
19178
+ const getPageUrlWithNewParams = ({
19179
+ params: newParams,
19180
+ paramsToRemove,
19181
+ encode: encode2 = true,
19182
+ searchResultsLink: searchResultsLink2
19183
+ }) => {
19184
+ const url = getPageUrl(searchResultsLink2);
19185
+ paramsToRemove = getRemovableParams(url, optionsStore.getQueryParamName, paramsToRemove);
19186
+ removeParams(url, paramsToRemove);
19187
+ newParams.forEach((p2) => appendParam(url, p2, encode2));
19188
+ return url.search;
19189
+ };
19178
19190
  const removeParameters = ({
19179
19191
  paramsToRemove,
19180
19192
  save = true
@@ -19312,6 +19324,7 @@ var __async = (__this, __arguments, generator) => {
19312
19324
  sortParams,
19313
19325
  lastChangedParams,
19314
19326
  skipFacetReload,
19327
+ getPageUrlWithNewParams,
19315
19328
  add,
19316
19329
  removeAllFilters,
19317
19330
  removeParameters,
@@ -19786,7 +19799,7 @@ var __async = (__this, __arguments, generator) => {
19786
19799
  };
19787
19800
  const _hoisted_2$W = { class: "lupa-dialog-content" };
19788
19801
  const _hoisted_3$E = { class: "lupa-listening-text" };
19789
- const _hoisted_4$v = { class: "lupa-mic-button-wrapper" };
19802
+ const _hoisted_4$u = { class: "lupa-mic-button-wrapper" };
19790
19803
  const _hoisted_5$l = ["aria-label"];
19791
19804
  const _sfc_main$1z = /* @__PURE__ */ defineComponent({
19792
19805
  __name: "VoiceSearchDialog",
@@ -19900,7 +19913,7 @@ var __async = (__this, __arguments, generator) => {
19900
19913
  }),
19901
19914
  createBaseVNode("div", _hoisted_2$W, [
19902
19915
  createBaseVNode("p", _hoisted_3$E, toDisplayString(description.value), 1),
19903
- createBaseVNode("div", _hoisted_4$v, [
19916
+ createBaseVNode("div", _hoisted_4$u, [
19904
19917
  createBaseVNode("button", {
19905
19918
  class: normalizeClass(["lupa-mic-button", { recording: unref(isRecording) }]),
19906
19919
  onClick: handleRecordingButtonClick,
@@ -19925,7 +19938,7 @@ var __async = (__this, __arguments, generator) => {
19925
19938
  const _hoisted_1$1k = { id: "lupa-search-box-input-container" };
19926
19939
  const _hoisted_2$V = { class: "lupa-input-clear" };
19927
19940
  const _hoisted_3$D = { id: "lupa-search-box-input" };
19928
- const _hoisted_4$u = ["value"];
19941
+ const _hoisted_4$t = ["value"];
19929
19942
  const _hoisted_5$k = ["aria-label", "placeholder"];
19930
19943
  const _hoisted_6$8 = {
19931
19944
  key: 0,
@@ -20078,7 +20091,7 @@ var __async = (__this, __arguments, generator) => {
20078
20091
  "aria-hidden": "true",
20079
20092
  value: showHint.value ? suggestedValue.value.item.suggestion : "",
20080
20093
  disabled: ""
20081
- }, null, 8, _hoisted_4$u),
20094
+ }, null, 8, _hoisted_4$t),
20082
20095
  withDirectives(createBaseVNode("input", mergeProps({
20083
20096
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
20084
20097
  }, inputAttributes.value, {
@@ -20328,7 +20341,7 @@ var __async = (__this, __arguments, generator) => {
20328
20341
  class: "lupa-suggestion-facet",
20329
20342
  "data-cy": "lupa-suggestion-facet"
20330
20343
  };
20331
- const _hoisted_4$t = {
20344
+ const _hoisted_4$s = {
20332
20345
  class: "lupa-suggestion-facet-label",
20333
20346
  "data-cy": "lupa-suggestion-facet-label"
20334
20347
  };
@@ -20375,7 +20388,7 @@ var __async = (__this, __arguments, generator) => {
20375
20388
  innerHTML: _ctx.suggestion.displayHighlight
20376
20389
  }, null, 8, _hoisted_1$1g)) : (openBlock(), createElementBlock("div", _hoisted_2$T, toDisplayString(_ctx.suggestion.display), 1)),
20377
20390
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$C, [
20378
- createBaseVNode("span", _hoisted_4$t, toDisplayString(facetLabel.value), 1),
20391
+ createBaseVNode("span", _hoisted_4$s, toDisplayString(facetLabel.value), 1),
20379
20392
  createBaseVNode("span", _hoisted_5$j, toDisplayString(_ctx.suggestion.facet.title), 1)
20380
20393
  ])) : createCommentVNode("", true)
20381
20394
  ]);
@@ -30115,7 +30128,7 @@ and ensure you are accounting for this risk.
30115
30128
  const _hoisted_1$1a = ["innerHTML"];
30116
30129
  const _hoisted_2$P = { key: 0 };
30117
30130
  const _hoisted_3$B = { key: 1 };
30118
- const _hoisted_4$s = { class: "lupa-search-box-custom-label" };
30131
+ const _hoisted_4$r = { class: "lupa-search-box-custom-label" };
30119
30132
  const _hoisted_5$i = { class: "lupa-search-box-custom-text" };
30120
30133
  const _sfc_main$1k = /* @__PURE__ */ defineComponent({
30121
30134
  __name: "SearchBoxProductCustom",
@@ -30148,7 +30161,7 @@ and ensure you are accounting for this risk.
30148
30161
  class: [className.value, "lupa-search-box-product-custom"]
30149
30162
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {})), [
30150
30163
  !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$B, [
30151
- createBaseVNode("div", _hoisted_4$s, toDisplayString(label.value), 1),
30164
+ createBaseVNode("div", _hoisted_4$r, toDisplayString(label.value), 1),
30152
30165
  createBaseVNode("div", _hoisted_5$i, toDisplayString(text.value), 1)
30153
30166
  ]))
30154
30167
  ], 16));
@@ -30499,7 +30512,7 @@ and ensure you are accounting for this risk.
30499
30512
  const _hoisted_1$18 = { class: "lupa-search-box-add-to-cart-wrapper" };
30500
30513
  const _hoisted_2$O = { class: "lupa-search-box-product-addtocart" };
30501
30514
  const _hoisted_3$A = ["disabled"];
30502
- const _hoisted_4$r = ["href"];
30515
+ const _hoisted_4$q = ["href"];
30503
30516
  const _hoisted_5$h = ["disabled"];
30504
30517
  const _sfc_main$1i = /* @__PURE__ */ defineComponent({
30505
30518
  __name: "SearchBoxProductAddToCart",
@@ -30555,7 +30568,7 @@ and ensure you are accounting for this risk.
30555
30568
  "data-cy": "lupa-add-to-cart",
30556
30569
  disabled: !inStockValue.value || loading.value
30557
30570
  }, _ctx.dynamicAttributes, { onClick: handleClick }), [
30558
- createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$r)
30571
+ createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$q)
30559
30572
  ], 16, _hoisted_3$A)) : (openBlock(), createElementBlock("button", mergeProps({
30560
30573
  key: 1,
30561
30574
  onClick: withModifiers(handleClick, ["stop", "prevent"]),
@@ -30675,7 +30688,7 @@ and ensure you are accounting for this risk.
30675
30688
  const _hoisted_1$16 = { class: "lupa-badge-title" };
30676
30689
  const _hoisted_2$N = ["src"];
30677
30690
  const _hoisted_3$z = { key: 1 };
30678
- const _hoisted_4$q = {
30691
+ const _hoisted_4$p = {
30679
30692
  key: 0,
30680
30693
  class: "lupa-badge-full-text"
30681
30694
  };
@@ -30719,7 +30732,7 @@ and ensure you are accounting for this risk.
30719
30732
  }, null, 8, _hoisted_2$N)) : createCommentVNode("", true),
30720
30733
  hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$z, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
30721
30734
  ]),
30722
- hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$q, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
30735
+ hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
30723
30736
  ], 6);
30724
30737
  };
30725
30738
  }
@@ -31687,7 +31700,7 @@ and ensure you are accounting for this risk.
31687
31700
  key: 0,
31688
31701
  class: "lupa-panel-title lupa-panel-title-top-results"
31689
31702
  };
31690
- const _hoisted_4$p = {
31703
+ const _hoisted_4$o = {
31691
31704
  key: 1,
31692
31705
  class: "lupa-panel-title"
31693
31706
  };
@@ -31733,6 +31746,7 @@ and ensure you are accounting for this risk.
31733
31746
  const searchBoxStore = useSearchBoxStore();
31734
31747
  const { suggestionResults, hasAnyResults, panelItemCounts } = storeToRefs(searchBoxStore);
31735
31748
  const emit2 = __emit;
31749
+ const isSearchEmpty = computed(() => !props.inputValue || props.inputValue.length < 1);
31736
31750
  const displayResults = computed(() => {
31737
31751
  var _a25;
31738
31752
  return ((_a25 = props.inputValue) == null ? void 0 : _a25.length) >= props.options.minInputLength;
@@ -31743,6 +31757,12 @@ and ensure you are accounting for this risk.
31743
31757
  return Boolean(props.options.history) && ((_a25 = props.inputValue) == null ? void 0 : _a25.length) < 1 && props.options.minInputLength > 0;
31744
31758
  }
31745
31759
  );
31760
+ const displayShowMoreResultsButton = computed(() => {
31761
+ if (isSearchEmpty.value && props.options.hideMoreResultsButtonOnEmptyQuery) {
31762
+ return false;
31763
+ }
31764
+ return hasAnyResults.value || !props.options.hideMoreResultsButtonOnNoResults;
31765
+ });
31746
31766
  const displayPanels = computed(
31747
31767
  () => props.isSearchContainer ? panels.value.filter((p2) => p2.type === SearchBoxPanelType.SUGGESTION) : panels.value
31748
31768
  );
@@ -31883,7 +31903,7 @@ and ensure you are accounting for this risk.
31883
31903
  "data-cy": "lupa-panel-" + panel.type + "-index"
31884
31904
  }, [
31885
31905
  ((_a25 = panel.labels) == null ? void 0 : _a25.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$x, toDisplayString((_b25 = panel.labels) == null ? void 0 : _b25.topResultsTitle), 1)) : createCommentVNode("", true),
31886
- ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$p, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
31906
+ ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
31887
31907
  panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
31888
31908
  key: 2,
31889
31909
  panel,
@@ -31912,7 +31932,7 @@ and ensure you are accounting for this risk.
31912
31932
  key: 1,
31913
31933
  labels: labels.value
31914
31934
  }, null, 8, ["labels"])) : createCommentVNode("", true),
31915
- unref(hasAnyResults) || !_ctx.options.hideMoreResultsButtonOnNoResults ? (openBlock(), createBlock(_sfc_main$1x, {
31935
+ displayShowMoreResultsButton.value ? (openBlock(), createBlock(_sfc_main$1x, {
31916
31936
  key: 2,
31917
31937
  labels: labels.value,
31918
31938
  options: _ctx.options,
@@ -31996,6 +32016,7 @@ and ensure you are accounting for this risk.
31996
32016
  "debounce",
31997
32017
  "showTotalCount",
31998
32018
  "hideMoreResultsButtonOnNoResults",
32019
+ "hideMoreResultsButtonOnEmptyQuery",
31999
32020
  "showNoResultsPanel",
32000
32021
  "expandOnSinglePanel",
32001
32022
  "showMoreResultsButton"
@@ -32381,7 +32402,7 @@ and ensure you are accounting for this risk.
32381
32402
  key: 1,
32382
32403
  "data-cy": "did-you-mean-label"
32383
32404
  };
32384
- const _hoisted_4$o = { key: 1 };
32405
+ const _hoisted_4$n = { key: 1 };
32385
32406
  const _sfc_main$12 = /* @__PURE__ */ defineComponent({
32386
32407
  __name: "SearchResultsDidYouMean",
32387
32408
  props: {
@@ -32432,7 +32453,7 @@ and ensure you are accounting for this risk.
32432
32453
  class: "lupa-did-you-mean lupa-highlighted-search-text",
32433
32454
  "data-cy": "did-you-mean-value",
32434
32455
  onClick: _cache[0] || (_cache[0] = ($event) => goToResults({ searchText: didYouMeanValue.value }))
32435
- }, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$o, toDisplayString(label) + " ", 1))
32456
+ }, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$n, toDisplayString(label) + " ", 1))
32436
32457
  ]);
32437
32458
  }), 128))
32438
32459
  ])) : createCommentVNode("", true)
@@ -32482,7 +32503,7 @@ and ensure you are accounting for this risk.
32482
32503
  key: 1,
32483
32504
  class: "lupa-results-total-count"
32484
32505
  };
32485
- const _hoisted_4$n = { class: "lupa-results-total-count-number" };
32506
+ const _hoisted_4$m = { class: "lupa-results-total-count-number" };
32486
32507
  const _hoisted_5$f = ["innerHTML"];
32487
32508
  const _sfc_main$10 = /* @__PURE__ */ defineComponent({
32488
32509
  __name: "SearchResultsTitle",
@@ -32532,7 +32553,7 @@ and ensure you are accounting for this risk.
32532
32553
  queryText.value && !searchResultsTitleTemplate.value ? (openBlock(), createElementBlock("span", _hoisted_2$G, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
32533
32554
  showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$v, [
32534
32555
  createTextVNode("(" + toDisplayString(searchResultsCountLabel.value), 1),
32535
- createBaseVNode("span", _hoisted_4$n, toDisplayString(unref(totalItems)), 1),
32556
+ createBaseVNode("span", _hoisted_4$m, toDisplayString(unref(totalItems)), 1),
32536
32557
  _cache[0] || (_cache[0] = createTextVNode(")"))
32537
32558
  ])) : createCommentVNode("", true)
32538
32559
  ])) : createCommentVNode("", true),
@@ -32614,7 +32635,7 @@ and ensure you are accounting for this risk.
32614
32635
  key: 0,
32615
32636
  class: "filter-values"
32616
32637
  };
32617
- const _hoisted_4$m = { class: "lupa-current-filter-list" };
32638
+ const _hoisted_4$l = { class: "lupa-current-filter-list" };
32618
32639
  const _sfc_main$_ = /* @__PURE__ */ defineComponent({
32619
32640
  __name: "CurrentFilters",
32620
32641
  props: {
@@ -32706,7 +32727,7 @@ and ensure you are accounting for this risk.
32706
32727
  }, null, 2)) : createCommentVNode("", true)
32707
32728
  ]),
32708
32729
  !_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$u, [
32709
- createBaseVNode("div", _hoisted_4$m, [
32730
+ createBaseVNode("div", _hoisted_4$l, [
32710
32731
  (openBlock(true), createElementBlock(Fragment, null, renderList(currentDisplayFilters.value, (filter) => {
32711
32732
  return openBlock(), createBlock(_sfc_main$$, {
32712
32733
  key: filter.key + "_" + filter.value,
@@ -32775,7 +32796,7 @@ and ensure you are accounting for this risk.
32775
32796
  };
32776
32797
  const _hoisted_2$D = { class: "lupa-category-back" };
32777
32798
  const _hoisted_3$t = ["href"];
32778
- const _hoisted_4$l = ["href"];
32799
+ const _hoisted_4$k = ["href"];
32779
32800
  const _hoisted_5$e = { class: "lupa-child-category-list" };
32780
32801
  const _sfc_main$Y = /* @__PURE__ */ defineComponent({
32781
32802
  __name: "CategoryFilter",
@@ -32882,7 +32903,7 @@ and ensure you are accounting for this risk.
32882
32903
  href: parentUrlLink.value,
32883
32904
  class: normalizeClass({ "lupa-title-category": !hasBackButton.value }),
32884
32905
  onClick: handleNavigationParent
32885
- }, toDisplayString(parentTitle.value), 11, _hoisted_4$l)
32906
+ }, toDisplayString(parentTitle.value), 11, _hoisted_4$k)
32886
32907
  ], 2),
32887
32908
  createBaseVNode("div", _hoisted_5$e, [
32888
32909
  (openBlock(true), createElementBlock(Fragment, null, renderList(categoryChildren.value, (child) => {
@@ -32903,7 +32924,7 @@ and ensure you are accounting for this risk.
32903
32924
  };
32904
32925
  const _hoisted_2$C = ["placeholder"];
32905
32926
  const _hoisted_3$s = { class: "lupa-terms-list" };
32906
- const _hoisted_4$k = ["onClick"];
32927
+ const _hoisted_4$j = ["onClick"];
32907
32928
  const _hoisted_5$d = { class: "lupa-term-checkbox-wrapper" };
32908
32929
  const _hoisted_6$7 = { class: "lupa-term-label" };
32909
32930
  const _hoisted_7$4 = {
@@ -33035,7 +33056,7 @@ and ensure you are accounting for this risk.
33035
33056
  createBaseVNode("span", _hoisted_6$7, toDisplayString(getItemLabel(item)), 1),
33036
33057
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_7$4, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
33037
33058
  ], 2)
33038
- ], 10, _hoisted_4$k);
33059
+ ], 10, _hoisted_4$j);
33039
33060
  }), 128))
33040
33061
  ]),
33041
33062
  displayShowMore.value ? (openBlock(), createElementBlock("div", {
@@ -33943,6 +33964,18 @@ and ensure you are accounting for this risk.
33943
33964
  m.render = function(e2, t, r, i, n, o) {
33944
33965
  return openBlock(), createElementBlock("div", mergeProps(e2.sliderProps, { ref: "slider" }), null, 16);
33945
33966
  }, m.__file = "src/Slider.vue";
33967
+ const roundToMaxDecimals = (value, maxPrecision = 0.1) => {
33968
+ if (value === void 0 || value === null || Number.isNaN(value)) return "";
33969
+ const log = Math.log10(maxPrecision);
33970
+ const decimals = log < 0 ? Math.round(-log) : 0;
33971
+ const factor = Math.pow(10, decimals);
33972
+ const rounded = Math.round((value + Number.EPSILON) * factor) / factor;
33973
+ let out = rounded.toFixed(decimals);
33974
+ if (Number.isInteger(value)) {
33975
+ out = Math.trunc(value).toString();
33976
+ }
33977
+ return out;
33978
+ };
33946
33979
  const _hoisted_1$P = { class: "lupa-search-result-facet-stats-values" };
33947
33980
  const _hoisted_2$B = {
33948
33981
  key: 0,
@@ -33952,7 +33985,7 @@ and ensure you are accounting for this risk.
33952
33985
  key: 1,
33953
33986
  class: "lupa-stats-facet-summary-input"
33954
33987
  };
33955
- const _hoisted_4$j = { class: "lupa-stats-from" };
33988
+ const _hoisted_4$i = { class: "lupa-stats-from" };
33956
33989
  const _hoisted_5$c = {
33957
33990
  key: 0,
33958
33991
  class: "lupa-stats-range-label"
@@ -34091,7 +34124,7 @@ and ensure you are accounting for this risk.
34091
34124
  const originalSliderRange = computed(() => {
34092
34125
  return innerSliderRange.value.length === 2 && (currentFilters.value.gte || currentFilters.value.lte) ? [
34093
34126
  Math.max(+currentFilters.value.gte, facetValue.value.min),
34094
- Math.min(+currentFilters.value.lte, facetValue.value.max)
34127
+ Math.min(+(currentFilters.value.lt || currentFilters.value.lte), facetValue.value.max)
34095
34128
  ] : [facetValue.value.min, facetValue.value.max];
34096
34129
  });
34097
34130
  const fromValue = computed({
@@ -34147,6 +34180,7 @@ and ensure you are accounting for this risk.
34147
34180
  }
34148
34181
  );
34149
34182
  const statsSummary = computed(() => {
34183
+ var _a25, _b25;
34150
34184
  const [min, max] = originalSliderRange.value;
34151
34185
  if (isPrice.value) {
34152
34186
  return formatPriceSummary(
@@ -34157,10 +34191,12 @@ and ensure you are accounting for this risk.
34157
34191
  multiCurrency.value
34158
34192
  );
34159
34193
  }
34194
+ const minValue = roundToMaxDecimals(min, (_a25 = customInterval.value) != null ? _a25 : 0.1);
34195
+ const maxValue = roundToMaxDecimals(max, (_b25 = customInterval.value) != null ? _b25 : 0.1);
34160
34196
  if (unit.value) {
34161
- return `${min} ${unit.value} – ${max} ${unit.value}`;
34197
+ return `${minValue} ${unit.value} – ${maxValue} ${unit.value}`;
34162
34198
  }
34163
- return formatRange({ gte: min, lte: max });
34199
+ return formatRange({ gte: minValue, lte: maxValue });
34164
34200
  });
34165
34201
  function handleInputChange() {
34166
34202
  if (innerSliderRange.value.length < 2) return;
@@ -34190,7 +34226,7 @@ and ensure you are accounting for this risk.
34190
34226
  return (_ctx, _cache) => {
34191
34227
  return openBlock(), createElementBlock("div", _hoisted_1$P, [
34192
34228
  !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$B, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$r, [
34193
- createBaseVNode("div", _hoisted_4$j, [
34229
+ createBaseVNode("div", _hoisted_4$i, [
34194
34230
  rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_5$c, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
34195
34231
  withDirectives(createBaseVNode("input", {
34196
34232
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
@@ -34259,7 +34295,7 @@ and ensure you are accounting for this risk.
34259
34295
  key: 0,
34260
34296
  class: "lupa-term-count"
34261
34297
  };
34262
- const _hoisted_4$i = {
34298
+ const _hoisted_4$h = {
34263
34299
  key: 0,
34264
34300
  class: "lupa-facet-level"
34265
34301
  };
@@ -34329,7 +34365,7 @@ and ensure you are accounting for this risk.
34329
34365
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_3$q, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
34330
34366
  ], 2)
34331
34367
  ]),
34332
- showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, [
34368
+ showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$h, [
34333
34369
  (openBlock(true), createElementBlock(Fragment, null, renderList(treeItem.value.children, (itemChild) => {
34334
34370
  return openBlock(), createBlock(_component_HierarchyFacetLevel, {
34335
34371
  key: itemChild.title,
@@ -34877,7 +34913,7 @@ and ensure you are accounting for this risk.
34877
34913
  };
34878
34914
  const _hoisted_2$w = { class: "lupa-mobile-sidebar-content" };
34879
34915
  const _hoisted_3$o = { class: "lupa-sidebar-top" };
34880
- const _hoisted_4$h = { class: "lupa-sidebar-title" };
34916
+ const _hoisted_4$g = { class: "lupa-sidebar-title" };
34881
34917
  const _hoisted_5$b = {
34882
34918
  key: 0,
34883
34919
  class: "lupa-sidebar-filter-count"
@@ -34922,7 +34958,7 @@ and ensure you are accounting for this risk.
34922
34958
  }),
34923
34959
  createBaseVNode("div", _hoisted_2$w, [
34924
34960
  createBaseVNode("div", _hoisted_3$o, [
34925
- createBaseVNode("div", _hoisted_4$h, [
34961
+ createBaseVNode("div", _hoisted_4$g, [
34926
34962
  createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
34927
34963
  isFilterCountVisible.value ? (openBlock(), createElementBlock("span", _hoisted_5$b, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
34928
34964
  ]),
@@ -34949,7 +34985,7 @@ and ensure you are accounting for this risk.
34949
34985
  key: 1,
34950
34986
  class: "lupa-search-results-breadcrumb-text"
34951
34987
  };
34952
- const _hoisted_4$g = { key: 2 };
34988
+ const _hoisted_4$f = { key: 2 };
34953
34989
  const _sfc_main$N = /* @__PURE__ */ defineComponent({
34954
34990
  __name: "SearchResultsBreadcrumbs",
34955
34991
  props: {
@@ -34991,7 +35027,7 @@ and ensure you are accounting for this risk.
34991
35027
  return handleNavigation(e2, (_a26 = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a26 : "");
34992
35028
  }
34993
35029
  }, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$v)) : (openBlock(), createElementBlock("span", _hoisted_3$n, toDisplayString(getLabel(breadcrumb.label)), 1)),
34994
- index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$g, toDisplayString((_a25 = breadcrumb.separator) != null ? _a25 : "/"), 1)) : createCommentVNode("", true)
35030
+ index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$f, toDisplayString((_a25 = breadcrumb.separator) != null ? _a25 : "/"), 1)) : createCommentVNode("", true)
34995
35031
  ]);
34996
35032
  }), 128))
34997
35033
  ]);
@@ -35153,8 +35189,7 @@ and ensure you are accounting for this risk.
35153
35189
  key: 0,
35154
35190
  class: "lupa-page-number-separator"
35155
35191
  };
35156
- const _hoisted_3$m = ["onClick"];
35157
- const _hoisted_4$f = {
35192
+ const _hoisted_3$m = {
35158
35193
  key: 0,
35159
35194
  class: "lupa-page-number-separator"
35160
35195
  };
@@ -35221,7 +35256,24 @@ and ensure you are accounting for this risk.
35221
35256
  timeout: (_f = (_e = searchResultOptions.value.scrollToResults) == null ? void 0 : _e.timeout) != null ? _f : 500
35222
35257
  };
35223
35258
  });
35224
- const handlePageChange = (page) => {
35259
+ const tagName = computed(() => {
35260
+ return props.options.renderAsLinks ? "a" : "div";
35261
+ });
35262
+ const getPageUrlWithNewParams = (page) => {
35263
+ return paramStore.getPageUrlWithNewParams({
35264
+ params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.PAGE), value: page.toString() }]
35265
+ });
35266
+ };
35267
+ const getHref = (page) => {
35268
+ if (props.options.renderAsLinks) {
35269
+ return getPageUrlWithNewParams(page);
35270
+ }
35271
+ return null;
35272
+ };
35273
+ const handlePageChange = (e2, page) => {
35274
+ if (e2 && props.options.renderAsLinks) {
35275
+ e2.preventDefault();
35276
+ }
35225
35277
  if (page > 0) {
35226
35278
  paramStore.appendParams({
35227
35279
  params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.PAGE), value: page.toString() }]
@@ -35235,46 +35287,78 @@ and ensure you are accounting for this risk.
35235
35287
  }
35236
35288
  };
35237
35289
  return (_ctx, _cache) => {
35290
+ var _a25;
35238
35291
  return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$D, [
35239
- showBack.value ? (openBlock(), createElementBlock("div", {
35292
+ showBack.value ? (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
35240
35293
  key: 0,
35241
35294
  class: normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
35242
- onClick: _cache[0] || (_cache[0] = () => handlePageChange(_ctx.options.selectedPage - 1))
35243
- }, toDisplayString(firstPageLabel.value), 3)) : createCommentVNode("", true),
35295
+ href: getHref(_ctx.options.selectedPage - 1),
35296
+ onClick: _cache[0] || (_cache[0] = (e2) => handlePageChange(e2, _ctx.options.selectedPage - 1))
35297
+ }, {
35298
+ default: withCtx(() => [
35299
+ createTextVNode(toDisplayString(firstPageLabel.value), 1)
35300
+ ]),
35301
+ _: 1
35302
+ }, 8, ["class", "href"])) : createCommentVNode("", true),
35244
35303
  showFirstPage.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
35245
- createBaseVNode("div", {
35304
+ (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
35305
+ href: getHref(1),
35246
35306
  class: "lupa-page-number lupa-page-number-first",
35247
- onClick: _cache[1] || (_cache[1] = () => handlePageChange(1))
35248
- }, " 1 "),
35307
+ onClick: _cache[1] || (_cache[1] = (e2) => handlePageChange(e2, 1))
35308
+ }, {
35309
+ default: withCtx(() => _cache[4] || (_cache[4] = [
35310
+ createTextVNode(" 1 ")
35311
+ ])),
35312
+ _: 1,
35313
+ __: [4]
35314
+ }, 8, ["href"])),
35249
35315
  showFirstPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_2$u, "...")) : createCommentVNode("", true)
35250
35316
  ], 64)) : createCommentVNode("", true),
35251
35317
  (openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (page) => {
35252
- return openBlock(), createElementBlock("div", {
35318
+ return openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
35253
35319
  key: page,
35254
- onClick: () => handlePageChange(page),
35320
+ href: getHref(page),
35321
+ onClick: (e2) => handlePageChange(e2, page),
35255
35322
  class: normalizeClass([
35256
35323
  "lupa-page-number",
35257
35324
  page === _ctx.options.selectedPage ? "lupa-page-number-selected" : ""
35258
35325
  ]),
35259
35326
  "data-cy": "lupa-page-number"
35260
- }, toDisplayString(page), 11, _hoisted_3$m);
35327
+ }, {
35328
+ default: withCtx(() => [
35329
+ createTextVNode(toDisplayString(page), 1)
35330
+ ]),
35331
+ _: 2
35332
+ }, 1032, ["href", "onClick", "class"]);
35261
35333
  }), 128)),
35262
35334
  showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
35263
- showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$f, "...")) : createCommentVNode("", true),
35264
- createBaseVNode("div", {
35335
+ showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_3$m, "...")) : createCommentVNode("", true),
35336
+ (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
35337
+ href: getHref((_a25 = lastPage.value) != null ? _a25 : 1),
35265
35338
  class: "lupa-page-number lupa-page-number-last",
35266
- onClick: _cache[2] || (_cache[2] = () => {
35267
- var _a25;
35268
- return handlePageChange((_a25 = lastPage.value) != null ? _a25 : 1);
35339
+ onClick: _cache[2] || (_cache[2] = (e2) => {
35340
+ var _a26;
35341
+ return handlePageChange(e2, (_a26 = lastPage.value) != null ? _a26 : 1);
35269
35342
  })
35270
- }, toDisplayString(lastPage.value), 1)
35343
+ }, {
35344
+ default: withCtx(() => [
35345
+ createTextVNode(toDisplayString(lastPage.value), 1)
35346
+ ]),
35347
+ _: 1
35348
+ }, 8, ["href"]))
35271
35349
  ], 64)) : createCommentVNode("", true),
35272
- _ctx.options.selectedPage < _ctx.options.count ? (openBlock(), createElementBlock("div", {
35350
+ _ctx.options.selectedPage < _ctx.options.count ? (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
35273
35351
  key: 3,
35274
35352
  class: normalizeClass(lastPageLabel.value === ">" ? "lupa-page-arrow" : "lupa-show-more"),
35353
+ href: getHref(_ctx.options.selectedPage + 1),
35275
35354
  "data-cy": "lupa-show-more",
35276
- onClick: _cache[3] || (_cache[3] = () => handlePageChange(_ctx.options.selectedPage + 1))
35277
- }, toDisplayString(lastPageLabel.value), 3)) : createCommentVNode("", true)
35355
+ onClick: _cache[3] || (_cache[3] = (e2) => handlePageChange(e2, _ctx.options.selectedPage + 1))
35356
+ }, {
35357
+ default: withCtx(() => [
35358
+ createTextVNode(toDisplayString(lastPageLabel.value), 1)
35359
+ ]),
35360
+ _: 1
35361
+ }, 8, ["class", "href"])) : createCommentVNode("", true)
35278
35362
  ])) : createCommentVNode("", true);
35279
35363
  };
35280
35364
  }
@@ -35508,6 +35592,7 @@ and ensure you are accounting for this risk.
35508
35592
  }
35509
35593
  });
35510
35594
  const paginationOptions = computed(() => {
35595
+ var _a25;
35511
35596
  const pageSelect = optionsValue.value.pagination.pageSelection;
35512
35597
  return {
35513
35598
  pageSize: {
@@ -35518,7 +35603,8 @@ and ensure you are accounting for this risk.
35518
35603
  count: getPageCount(searchResult.value.total, limit.value),
35519
35604
  selectedPage: page.value,
35520
35605
  display: pageSelect.display,
35521
- displayMobile: pageSelect.displayMobile
35606
+ displayMobile: pageSelect.displayMobile,
35607
+ renderAsLinks: (_a25 = pageSelect.renderAsLinks) != null ? _a25 : false
35522
35608
  },
35523
35609
  labels: optionsValue.value.labels
35524
35610
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.22.0",
3
+ "version": "1.22.3",
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.22.0",
23
+ "@getlupa/vue": "0.22.3",
24
24
  "@rushstack/eslint-patch": "^1.12.0",
25
25
  "@tsconfig/node18": "^18.2.4",
26
26
  "@types/jsdom": "^21.1.7",