@getlupa/vue 0.5.0 → 0.5.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.
@@ -3035,7 +3035,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
3035
3035
  const _hoisted_1$1b = { id: "lupa-search-box-input-container" };
3036
3036
  const _hoisted_2$O = { class: "lupa-input-clear" };
3037
3037
  const _hoisted_3$A = { id: "lupa-search-box-input" };
3038
- const _hoisted_4$r = ["value"];
3038
+ const _hoisted_4$q = ["value"];
3039
3039
  const _hoisted_5$f = ["placeholder"];
3040
3040
  const _hoisted_6$8 = {
3041
3041
  key: 0,
@@ -3130,7 +3130,7 @@ const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
3130
3130
  class: "lupa-hint",
3131
3131
  value: showHint.value ? suggestedValue.value.item.suggestion : "",
3132
3132
  disabled: ""
3133
- }, null, 8, _hoisted_4$r),
3133
+ }, null, 8, _hoisted_4$q),
3134
3134
  vue.withDirectives(vue.createElementVNode("input", vue.mergeProps({
3135
3135
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
3136
3136
  }, inputAttributes.value, {
@@ -3309,7 +3309,7 @@ const _hoisted_3$z = {
3309
3309
  class: "lupa-suggestion-facet",
3310
3310
  "data-cy": "lupa-suggestion-facet"
3311
3311
  };
3312
- const _hoisted_4$q = {
3312
+ const _hoisted_4$p = {
3313
3313
  class: "lupa-suggestion-facet-label",
3314
3314
  "data-cy": "lupa-suggestion-facet-label"
3315
3315
  };
@@ -3355,7 +3355,7 @@ const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
3355
3355
  innerHTML: _ctx.suggestion.displayHighlight
3356
3356
  }, null, 8, _hoisted_1$17)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$M, vue.toDisplayString(_ctx.suggestion.display), 1)),
3357
3357
  _ctx.suggestion.facet ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$z, [
3358
- vue.createElementVNode("span", _hoisted_4$q, vue.toDisplayString(facetLabel.value), 1),
3358
+ vue.createElementVNode("span", _hoisted_4$p, vue.toDisplayString(facetLabel.value), 1),
3359
3359
  vue.createElementVNode("span", _hoisted_5$e, vue.toDisplayString(_ctx.suggestion.facet.title), 1)
3360
3360
  ])) : vue.createCommentVNode("", true)
3361
3361
  ]);
@@ -3757,7 +3757,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
3757
3757
  const _hoisted_1$10 = ["innerHTML"];
3758
3758
  const _hoisted_2$J = { key: 0 };
3759
3759
  const _hoisted_3$y = { key: 1 };
3760
- const _hoisted_4$p = { class: "lupa-search-box-custom-label" };
3760
+ const _hoisted_4$o = { class: "lupa-search-box-custom-label" };
3761
3761
  const _hoisted_5$d = { class: "lupa-search-box-custom-text" };
3762
3762
  const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
3763
3763
  __name: "SearchBoxProductCustom",
@@ -3790,7 +3790,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
3790
3790
  class: [className.value, "lupa-search-box-product-custom"]
3791
3791
  }, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
3792
3792
  !label.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$J, vue.toDisplayString(text.value), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$y, [
3793
- vue.createElementVNode("div", _hoisted_4$p, vue.toDisplayString(label.value), 1),
3793
+ vue.createElementVNode("div", _hoisted_4$o, vue.toDisplayString(label.value), 1),
3794
3794
  vue.createElementVNode("div", _hoisted_5$d, vue.toDisplayString(text.value), 1)
3795
3795
  ]))
3796
3796
  ], 16));
@@ -4186,7 +4186,7 @@ const useTrackingStore = defineStore("tracking", () => {
4186
4186
  const _hoisted_1$Z = ["href"];
4187
4187
  const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
4188
4188
  const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
4189
- const _hoisted_4$o = {
4189
+ const _hoisted_4$n = {
4190
4190
  key: 0,
4191
4191
  class: "lupa-search-box-product-add-to-cart-section"
4192
4192
  };
@@ -4307,7 +4307,7 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
4307
4307
  }, null, 8, ["item", "element", "labels", "link"]);
4308
4308
  }), 128))
4309
4309
  ]),
4310
- addToCartElement.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$o, [
4310
+ addToCartElement.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$n, [
4311
4311
  vue.createVNode(_sfc_main$12, {
4312
4312
  class: "lupa-search-box-product-element",
4313
4313
  item: _ctx.item,
@@ -4442,12 +4442,8 @@ const _hoisted_1$X = {
4442
4442
  key: 0,
4443
4443
  id: "lupa-search-box-panel"
4444
4444
  };
4445
- const _hoisted_2$G = {
4446
- class: "lupa-main-panel",
4447
- "data-cy": "lupa-main-panel"
4448
- };
4449
- const _hoisted_3$v = ["data-cy"];
4450
- const _hoisted_4$n = {
4445
+ const _hoisted_2$G = ["data-cy"];
4446
+ const _hoisted_3$v = {
4451
4447
  key: 1,
4452
4448
  id: "lupa-search-box-panel"
4453
4449
  };
@@ -4484,7 +4480,7 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4484
4480
  const panels = vue.computed(() => props.options.panels);
4485
4481
  const sdkOptions = vue.computed(() => props.options.options);
4486
4482
  const searchBoxStore = useSearchBoxStore();
4487
- const { suggestionResults, hasAnyResults } = storeToRefs(searchBoxStore);
4483
+ const { suggestionResults, hasAnyResults, panelItemCounts } = storeToRefs(searchBoxStore);
4488
4484
  const displayResults = vue.computed(
4489
4485
  () => {
4490
4486
  var _a, _b;
@@ -4565,6 +4561,12 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4565
4561
  `${window.innerHeight - panel.getBoundingClientRect().y - 10}px`
4566
4562
  );
4567
4563
  };
4564
+ const numberOfVisiblePanels = vue.computed(() => {
4565
+ return panelItemCounts.value.filter((v) => v.count > 0).length;
4566
+ });
4567
+ const expandOnSinglePanel = vue.computed(() => {
4568
+ return numberOfVisiblePanels.value === 1 && props.options.expandOnSinglePanel;
4569
+ });
4568
4570
  return (_ctx, _cache) => {
4569
4571
  var _a;
4570
4572
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -4572,7 +4574,11 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4572
4574
  ref: panelContainer
4573
4575
  }, [
4574
4576
  displayResults.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$X, [
4575
- vue.createElementVNode("div", _hoisted_2$G, [
4577
+ vue.createElementVNode("div", {
4578
+ class: "lupa-main-panel",
4579
+ style: vue.normalizeStyle(expandOnSinglePanel.value ? { display: "block" } : {}),
4580
+ "data-cy": "lupa-main-panel"
4581
+ }, [
4576
4582
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayPanels.value, (panel, index) => {
4577
4583
  return vue.openBlock(), vue.createElementBlock("div", {
4578
4584
  key: index,
@@ -4601,9 +4607,9 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4601
4607
  key: "0"
4602
4608
  } : void 0
4603
4609
  ]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : vue.createCommentVNode("", true)
4604
- ], 10, _hoisted_3$v);
4610
+ ], 10, _hoisted_2$G);
4605
4611
  }), 128))
4606
- ]),
4612
+ ], 4),
4607
4613
  !vue.unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (vue.openBlock(), vue.createBlock(_sfc_main$1f, {
4608
4614
  key: 0,
4609
4615
  labels: labels.value
@@ -4614,7 +4620,7 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4614
4620
  showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
4615
4621
  onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
4616
4622
  }, null, 8, ["labels", "showTotalCount"])) : vue.createCommentVNode("", true)
4617
- ])) : displayHistory.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$n, [
4623
+ ])) : displayHistory.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$v, [
4618
4624
  vue.createVNode(_sfc_main$1g, {
4619
4625
  options: _ctx.options.history,
4620
4626
  history: history.value,
@@ -4683,7 +4689,8 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
4683
4689
  "debounce",
4684
4690
  "showTotalCount",
4685
4691
  "hideMoreResultsButtonOnNoResults",
4686
- "showNoResultsPanel"
4692
+ "showNoResultsPanel",
4693
+ "expandOnSinglePanel"
4687
4694
  ])
4688
4695
  );
4689
4696
  const searchTriggers = vue.computed(() => {
@@ -9368,8 +9375,14 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
9368
9375
  const isTitleResultTopPosition = vue.computed(() => {
9369
9376
  return props.options.searchTitlePosition === "search-results-top";
9370
9377
  });
9378
+ const handlePopState = () => {
9379
+ var _a;
9380
+ const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url);
9381
+ paramStore.add(parseParams(searchParams));
9382
+ };
9371
9383
  vue.onMounted(() => {
9372
9384
  var _a, _b;
9385
+ window.addEventListener("popstate", handlePopState);
9373
9386
  window.addEventListener("resize", handleResize);
9374
9387
  if (props.initialData) {
9375
9388
  searchResultStore.add(__spreadValues({}, props.initialData));
@@ -9380,6 +9393,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
9380
9393
  });
9381
9394
  vue.onBeforeUnmount(() => {
9382
9395
  window.removeEventListener("resize", handleResize);
9396
+ window.removeEventListener("popstate", handlePopState);
9383
9397
  });
9384
9398
  const trackItemListView = (title, items = []) => {
9385
9399
  trackingStore.trackEvent({
@@ -37,7 +37,7 @@ var __async = (__this, __arguments, generator) => {
37
37
  step((generator = generator.apply(__this, __arguments)).next());
38
38
  });
39
39
  };
40
- import { toRaw, isRef, isReactive, toRef, effectScope, ref, markRaw, hasInjectionContext, inject, getCurrentInstance, watch, reactive, nextTick, computed, unref, getCurrentScope, onScopeDispose, toRefs, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, withDirectives, mergeProps, vModelText, toDisplayString, createCommentVNode, onMounted, onBeforeMount, Fragment, renderList, createBlock, toHandlers, withModifiers, resolveDynamicComponent, createVNode, renderSlot, createSlots, withCtx, normalizeProps, guardReactiveProps, onBeforeUnmount, createTextVNode, onUnmounted, resolveComponent, vModelSelect, normalizeStyle, h as h$1, provide, cloneVNode } from "vue";
40
+ import { toRaw, isRef, isReactive, toRef, effectScope, ref, markRaw, hasInjectionContext, inject, getCurrentInstance, watch, reactive, nextTick, computed, unref, getCurrentScope, onScopeDispose, toRefs, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, withDirectives, mergeProps, vModelText, toDisplayString, createCommentVNode, onMounted, onBeforeMount, Fragment, renderList, createBlock, toHandlers, withModifiers, resolveDynamicComponent, createVNode, renderSlot, createSlots, withCtx, normalizeProps, guardReactiveProps, onBeforeUnmount, normalizeStyle, createTextVNode, onUnmounted, resolveComponent, vModelSelect, h as h$1, provide, cloneVNode } from "vue";
41
41
  var isVue2 = false;
42
42
  function set(target, key, val) {
43
43
  if (Array.isArray(target)) {
@@ -3033,7 +3033,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
3033
3033
  const _hoisted_1$1b = { id: "lupa-search-box-input-container" };
3034
3034
  const _hoisted_2$O = { class: "lupa-input-clear" };
3035
3035
  const _hoisted_3$A = { id: "lupa-search-box-input" };
3036
- const _hoisted_4$r = ["value"];
3036
+ const _hoisted_4$q = ["value"];
3037
3037
  const _hoisted_5$f = ["placeholder"];
3038
3038
  const _hoisted_6$8 = {
3039
3039
  key: 0,
@@ -3128,7 +3128,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
3128
3128
  class: "lupa-hint",
3129
3129
  value: showHint.value ? suggestedValue.value.item.suggestion : "",
3130
3130
  disabled: ""
3131
- }, null, 8, _hoisted_4$r),
3131
+ }, null, 8, _hoisted_4$q),
3132
3132
  withDirectives(createElementVNode("input", mergeProps({
3133
3133
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
3134
3134
  }, inputAttributes.value, {
@@ -3307,7 +3307,7 @@ const _hoisted_3$z = {
3307
3307
  class: "lupa-suggestion-facet",
3308
3308
  "data-cy": "lupa-suggestion-facet"
3309
3309
  };
3310
- const _hoisted_4$q = {
3310
+ const _hoisted_4$p = {
3311
3311
  class: "lupa-suggestion-facet-label",
3312
3312
  "data-cy": "lupa-suggestion-facet-label"
3313
3313
  };
@@ -3353,7 +3353,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
3353
3353
  innerHTML: _ctx.suggestion.displayHighlight
3354
3354
  }, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(_ctx.suggestion.display), 1)),
3355
3355
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
3356
- createElementVNode("span", _hoisted_4$q, toDisplayString(facetLabel.value), 1),
3356
+ createElementVNode("span", _hoisted_4$p, toDisplayString(facetLabel.value), 1),
3357
3357
  createElementVNode("span", _hoisted_5$e, toDisplayString(_ctx.suggestion.facet.title), 1)
3358
3358
  ])) : createCommentVNode("", true)
3359
3359
  ]);
@@ -3755,7 +3755,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
3755
3755
  const _hoisted_1$10 = ["innerHTML"];
3756
3756
  const _hoisted_2$J = { key: 0 };
3757
3757
  const _hoisted_3$y = { key: 1 };
3758
- const _hoisted_4$p = { class: "lupa-search-box-custom-label" };
3758
+ const _hoisted_4$o = { class: "lupa-search-box-custom-label" };
3759
3759
  const _hoisted_5$d = { class: "lupa-search-box-custom-text" };
3760
3760
  const _sfc_main$15 = /* @__PURE__ */ defineComponent({
3761
3761
  __name: "SearchBoxProductCustom",
@@ -3788,7 +3788,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
3788
3788
  class: [className.value, "lupa-search-box-product-custom"]
3789
3789
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
3790
3790
  !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$J, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
3791
- createElementVNode("div", _hoisted_4$p, toDisplayString(label.value), 1),
3791
+ createElementVNode("div", _hoisted_4$o, toDisplayString(label.value), 1),
3792
3792
  createElementVNode("div", _hoisted_5$d, toDisplayString(text.value), 1)
3793
3793
  ]))
3794
3794
  ], 16));
@@ -4184,7 +4184,7 @@ const useTrackingStore = defineStore("tracking", () => {
4184
4184
  const _hoisted_1$Z = ["href"];
4185
4185
  const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
4186
4186
  const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
4187
- const _hoisted_4$o = {
4187
+ const _hoisted_4$n = {
4188
4188
  key: 0,
4189
4189
  class: "lupa-search-box-product-add-to-cart-section"
4190
4190
  };
@@ -4305,7 +4305,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
4305
4305
  }, null, 8, ["item", "element", "labels", "link"]);
4306
4306
  }), 128))
4307
4307
  ]),
4308
- addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$o, [
4308
+ addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$n, [
4309
4309
  createVNode(_sfc_main$12, {
4310
4310
  class: "lupa-search-box-product-element",
4311
4311
  item: _ctx.item,
@@ -4440,12 +4440,8 @@ const _hoisted_1$X = {
4440
4440
  key: 0,
4441
4441
  id: "lupa-search-box-panel"
4442
4442
  };
4443
- const _hoisted_2$G = {
4444
- class: "lupa-main-panel",
4445
- "data-cy": "lupa-main-panel"
4446
- };
4447
- const _hoisted_3$v = ["data-cy"];
4448
- const _hoisted_4$n = {
4443
+ const _hoisted_2$G = ["data-cy"];
4444
+ const _hoisted_3$v = {
4449
4445
  key: 1,
4450
4446
  id: "lupa-search-box-panel"
4451
4447
  };
@@ -4482,7 +4478,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
4482
4478
  const panels = computed(() => props.options.panels);
4483
4479
  const sdkOptions = computed(() => props.options.options);
4484
4480
  const searchBoxStore = useSearchBoxStore();
4485
- const { suggestionResults, hasAnyResults } = storeToRefs(searchBoxStore);
4481
+ const { suggestionResults, hasAnyResults, panelItemCounts } = storeToRefs(searchBoxStore);
4486
4482
  const displayResults = computed(
4487
4483
  () => {
4488
4484
  var _a, _b;
@@ -4563,6 +4559,12 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
4563
4559
  `${window.innerHeight - panel.getBoundingClientRect().y - 10}px`
4564
4560
  );
4565
4561
  };
4562
+ const numberOfVisiblePanels = computed(() => {
4563
+ return panelItemCounts.value.filter((v) => v.count > 0).length;
4564
+ });
4565
+ const expandOnSinglePanel = computed(() => {
4566
+ return numberOfVisiblePanels.value === 1 && props.options.expandOnSinglePanel;
4567
+ });
4566
4568
  return (_ctx, _cache) => {
4567
4569
  var _a;
4568
4570
  return openBlock(), createElementBlock("div", {
@@ -4570,7 +4572,11 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
4570
4572
  ref: panelContainer
4571
4573
  }, [
4572
4574
  displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$X, [
4573
- createElementVNode("div", _hoisted_2$G, [
4575
+ createElementVNode("div", {
4576
+ class: "lupa-main-panel",
4577
+ style: normalizeStyle(expandOnSinglePanel.value ? { display: "block" } : {}),
4578
+ "data-cy": "lupa-main-panel"
4579
+ }, [
4574
4580
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
4575
4581
  return openBlock(), createElementBlock("div", {
4576
4582
  key: index,
@@ -4599,9 +4605,9 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
4599
4605
  key: "0"
4600
4606
  } : void 0
4601
4607
  ]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
4602
- ], 10, _hoisted_3$v);
4608
+ ], 10, _hoisted_2$G);
4603
4609
  }), 128))
4604
- ]),
4610
+ ], 4),
4605
4611
  !unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1f, {
4606
4612
  key: 0,
4607
4613
  labels: labels.value
@@ -4612,7 +4618,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
4612
4618
  showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
4613
4619
  onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
4614
4620
  }, null, 8, ["labels", "showTotalCount"])) : createCommentVNode("", true)
4615
- ])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_4$n, [
4621
+ ])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
4616
4622
  createVNode(_sfc_main$1g, {
4617
4623
  options: _ctx.options.history,
4618
4624
  history: history.value,
@@ -4681,7 +4687,8 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
4681
4687
  "debounce",
4682
4688
  "showTotalCount",
4683
4689
  "hideMoreResultsButtonOnNoResults",
4684
- "showNoResultsPanel"
4690
+ "showNoResultsPanel",
4691
+ "expandOnSinglePanel"
4685
4692
  ])
4686
4693
  );
4687
4694
  const searchTriggers = computed(() => {
@@ -9366,8 +9373,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
9366
9373
  const isTitleResultTopPosition = computed(() => {
9367
9374
  return props.options.searchTitlePosition === "search-results-top";
9368
9375
  });
9376
+ const handlePopState = () => {
9377
+ var _a;
9378
+ const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url);
9379
+ paramStore.add(parseParams(searchParams));
9380
+ };
9369
9381
  onMounted(() => {
9370
9382
  var _a, _b;
9383
+ window.addEventListener("popstate", handlePopState);
9371
9384
  window.addEventListener("resize", handleResize);
9372
9385
  if (props.initialData) {
9373
9386
  searchResultStore.add(__spreadValues({}, props.initialData));
@@ -9378,6 +9391,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
9378
9391
  });
9379
9392
  onBeforeUnmount(() => {
9380
9393
  window.removeEventListener("resize", handleResize);
9394
+ window.removeEventListener("popstate", handlePopState);
9381
9395
  });
9382
9396
  const trackItemListView = (title, items = []) => {
9383
9397
  trackingStore.trackEvent({
@@ -52,4 +52,5 @@ export type SearchBoxPanelOptions = SearchBoxInputOptions & {
52
52
  showTotalCount?: boolean;
53
53
  showNoResultsPanel?: boolean;
54
54
  hideMoreResultsButtonOnNoResults?: boolean;
55
+ expandOnSinglePanel?: boolean;
55
56
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/vue",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/lupaSearch.mjs",
6
6
  "types": "dist/src/index.d.ts",