@getlupa/vue 0.16.0 → 0.16.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.
@@ -17791,6 +17791,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
17791
17791
  }
17792
17792
  });
17793
17793
  const _hoisted_1$F = {
17794
+ key: 0,
17794
17795
  id: "lupa-search-result-filters",
17795
17796
  class: "lupa-search-result-filters"
17796
17797
  };
@@ -17815,6 +17816,10 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
17815
17816
  const showCurrentFilters = vue.computed(() => {
17816
17817
  return currentFiltersVisible.value ? Boolean(props.options.facets) : false;
17817
17818
  });
17819
+ const visible = vue.computed(() => {
17820
+ var _a;
17821
+ return (_a = props.options.visible) != null ? _a : true;
17822
+ });
17818
17823
  const filter2 = () => {
17819
17824
  emit("filter");
17820
17825
  };
@@ -17827,7 +17832,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
17827
17832
  __expose({ fetch: fetch2 });
17828
17833
  return (_ctx, _cache) => {
17829
17834
  var _a;
17830
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$F, [
17835
+ return visible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$F, [
17831
17836
  showCurrentFilters.value ? (vue.openBlock(), vue.createBlock(_sfc_main$W, {
17832
17837
  key: 0,
17833
17838
  options: _ctx.options.currentFilters,
@@ -17844,7 +17849,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
17844
17849
  options: _ctx.options.facets,
17845
17850
  onFilter: filter2
17846
17851
  }, null, 8, ["options"])) : vue.createCommentVNode("", true)
17847
- ]);
17852
+ ])) : vue.createCommentVNode("", true);
17848
17853
  };
17849
17854
  }
17850
17855
  });
@@ -17954,6 +17959,7 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
17954
17959
  return (_ctx, _cache) => {
17955
17960
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$D, [
17956
17961
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(breadcrumbsValue.value, (breadcrumb, index) => {
17962
+ var _a;
17957
17963
  return vue.openBlock(), vue.createElementBlock("span", {
17958
17964
  class: "lupa-search-results-breadcrumb",
17959
17965
  key: index
@@ -17963,11 +17969,11 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
17963
17969
  class: "lupa-search-results-breadcrumb-link",
17964
17970
  href: breadcrumb.link,
17965
17971
  onClick: (e2) => {
17966
- var _a;
17967
- return handleNavigation(e2, (_a = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a : "");
17972
+ var _a2;
17973
+ return handleNavigation(e2, (_a2 = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a2 : "");
17968
17974
  }
17969
17975
  }, vue.toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$t)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$m, vue.toDisplayString(getLabel(breadcrumb.label)), 1)),
17970
- index < breadcrumbsValue.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$f, " / ")) : vue.createCommentVNode("", true)
17976
+ index < breadcrumbsValue.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$f, vue.toDisplayString((_a = breadcrumb.separator) != null ? _a : "/"), 1)) : vue.createCommentVNode("", true)
17971
17977
  ]);
17972
17978
  }), 128))
17973
17979
  ]);
@@ -17975,6 +17981,7 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
17975
17981
  }
17976
17982
  });
17977
17983
  const _hoisted_1$C = {
17984
+ key: 0,
17978
17985
  id: "lupa-search-result-filters",
17979
17986
  class: "lupa-search-result-filters lupa-search-result-top-filters"
17980
17987
  };
@@ -17985,12 +17992,17 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
17985
17992
  },
17986
17993
  emits: ["filter"],
17987
17994
  setup(__props, { emit }) {
17995
+ const props = __props;
17988
17996
  const filter2 = () => {
17989
17997
  emit("filter");
17990
17998
  };
17999
+ const visible = vue.computed(() => {
18000
+ var _a;
18001
+ return (_a = props.options.visible) != null ? _a : true;
18002
+ });
17991
18003
  return (_ctx, _cache) => {
17992
18004
  var _a;
17993
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, [
18005
+ return visible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, [
17994
18006
  _ctx.options.facets ? (vue.openBlock(), vue.createBlock(_sfc_main$M, {
17995
18007
  key: 0,
17996
18008
  options: _ctx.options.facets,
@@ -17998,7 +18010,7 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
17998
18010
  clearable: true,
17999
18011
  onFilter: filter2
18000
18012
  }, null, 8, ["options", "facet-style"])) : vue.createCommentVNode("", true)
18001
- ]);
18013
+ ])) : vue.createCommentVNode("", true);
18002
18014
  };
18003
18015
  }
18004
18016
  });
@@ -18049,7 +18061,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
18049
18061
  setup(__props) {
18050
18062
  const searchResultStore = useSearchResultStore();
18051
18063
  const optionsStore = useOptionsStore();
18052
- const { currentFilterCount } = storeToRefs(searchResultStore);
18064
+ const { currentFilterCount, isMobileSidebarVisible } = storeToRefs(searchResultStore);
18053
18065
  const { searchResultOptions } = storeToRefs(optionsStore);
18054
18066
  const disableMobileBodyScrollLock = vue.computed(
18055
18067
  () => {
@@ -18057,9 +18069,10 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
18057
18069
  return (_c = (_b = (_a = searchResultOptions.value.filters) == null ? void 0 : _a.facets) == null ? void 0 : _b.disableMobileBodyScrollLock) != null ? _c : false;
18058
18070
  }
18059
18071
  );
18072
+ const isSidebarVisible = vue.computed(() => isMobileSidebarVisible.value);
18060
18073
  const handleMobileToggle = () => {
18061
18074
  searchResultStore.setSidebarState({
18062
- visible: true,
18075
+ visible: !isSidebarVisible.value,
18063
18076
  disableBodyScrolling: !disableMobileBodyScrollLock.value
18064
18077
  });
18065
18078
  };
@@ -18068,7 +18081,8 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
18068
18081
  return vue.openBlock(), vue.createElementBlock("div", {
18069
18082
  class: vue.normalizeClass(["lupa-mobile-toggle", {
18070
18083
  "lupa-mobile-toggle-filters-empty": vue.unref(currentFilterCount) < 1,
18071
- "lupa-mobile-toggle-has-filters": hasActiveFilters.value
18084
+ "lupa-mobile-toggle-has-filters": hasActiveFilters.value,
18085
+ "lupa-sidebar-open": isSidebarVisible.value
18072
18086
  }]),
18073
18087
  onClick: handleMobileToggle
18074
18088
  }, [
@@ -17789,6 +17789,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
17789
17789
  }
17790
17790
  });
17791
17791
  const _hoisted_1$F = {
17792
+ key: 0,
17792
17793
  id: "lupa-search-result-filters",
17793
17794
  class: "lupa-search-result-filters"
17794
17795
  };
@@ -17813,6 +17814,10 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
17813
17814
  const showCurrentFilters = computed(() => {
17814
17815
  return currentFiltersVisible.value ? Boolean(props.options.facets) : false;
17815
17816
  });
17817
+ const visible = computed(() => {
17818
+ var _a;
17819
+ return (_a = props.options.visible) != null ? _a : true;
17820
+ });
17816
17821
  const filter2 = () => {
17817
17822
  emit("filter");
17818
17823
  };
@@ -17825,7 +17830,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
17825
17830
  __expose({ fetch: fetch2 });
17826
17831
  return (_ctx, _cache) => {
17827
17832
  var _a;
17828
- return openBlock(), createElementBlock("div", _hoisted_1$F, [
17833
+ return visible.value ? (openBlock(), createElementBlock("div", _hoisted_1$F, [
17829
17834
  showCurrentFilters.value ? (openBlock(), createBlock(_sfc_main$W, {
17830
17835
  key: 0,
17831
17836
  options: _ctx.options.currentFilters,
@@ -17842,7 +17847,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
17842
17847
  options: _ctx.options.facets,
17843
17848
  onFilter: filter2
17844
17849
  }, null, 8, ["options"])) : createCommentVNode("", true)
17845
- ]);
17850
+ ])) : createCommentVNode("", true);
17846
17851
  };
17847
17852
  }
17848
17853
  });
@@ -17952,6 +17957,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
17952
17957
  return (_ctx, _cache) => {
17953
17958
  return openBlock(), createElementBlock("div", _hoisted_1$D, [
17954
17959
  (openBlock(true), createElementBlock(Fragment, null, renderList(breadcrumbsValue.value, (breadcrumb, index) => {
17960
+ var _a;
17955
17961
  return openBlock(), createElementBlock("span", {
17956
17962
  class: "lupa-search-results-breadcrumb",
17957
17963
  key: index
@@ -17961,11 +17967,11 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
17961
17967
  class: "lupa-search-results-breadcrumb-link",
17962
17968
  href: breadcrumb.link,
17963
17969
  onClick: (e2) => {
17964
- var _a;
17965
- return handleNavigation(e2, (_a = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a : "");
17970
+ var _a2;
17971
+ return handleNavigation(e2, (_a2 = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a2 : "");
17966
17972
  }
17967
17973
  }, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$t)) : (openBlock(), createElementBlock("span", _hoisted_3$m, toDisplayString(getLabel(breadcrumb.label)), 1)),
17968
- index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$f, " / ")) : createCommentVNode("", true)
17974
+ index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$f, toDisplayString((_a = breadcrumb.separator) != null ? _a : "/"), 1)) : createCommentVNode("", true)
17969
17975
  ]);
17970
17976
  }), 128))
17971
17977
  ]);
@@ -17973,6 +17979,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
17973
17979
  }
17974
17980
  });
17975
17981
  const _hoisted_1$C = {
17982
+ key: 0,
17976
17983
  id: "lupa-search-result-filters",
17977
17984
  class: "lupa-search-result-filters lupa-search-result-top-filters"
17978
17985
  };
@@ -17983,12 +17990,17 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
17983
17990
  },
17984
17991
  emits: ["filter"],
17985
17992
  setup(__props, { emit }) {
17993
+ const props = __props;
17986
17994
  const filter2 = () => {
17987
17995
  emit("filter");
17988
17996
  };
17997
+ const visible = computed(() => {
17998
+ var _a;
17999
+ return (_a = props.options.visible) != null ? _a : true;
18000
+ });
17989
18001
  return (_ctx, _cache) => {
17990
18002
  var _a;
17991
- return openBlock(), createElementBlock("div", _hoisted_1$C, [
18003
+ return visible.value ? (openBlock(), createElementBlock("div", _hoisted_1$C, [
17992
18004
  _ctx.options.facets ? (openBlock(), createBlock(_sfc_main$M, {
17993
18005
  key: 0,
17994
18006
  options: _ctx.options.facets,
@@ -17996,7 +18008,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
17996
18008
  clearable: true,
17997
18009
  onFilter: filter2
17998
18010
  }, null, 8, ["options", "facet-style"])) : createCommentVNode("", true)
17999
- ]);
18011
+ ])) : createCommentVNode("", true);
18000
18012
  };
18001
18013
  }
18002
18014
  });
@@ -18047,7 +18059,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
18047
18059
  setup(__props) {
18048
18060
  const searchResultStore = useSearchResultStore();
18049
18061
  const optionsStore = useOptionsStore();
18050
- const { currentFilterCount } = storeToRefs(searchResultStore);
18062
+ const { currentFilterCount, isMobileSidebarVisible } = storeToRefs(searchResultStore);
18051
18063
  const { searchResultOptions } = storeToRefs(optionsStore);
18052
18064
  const disableMobileBodyScrollLock = computed(
18053
18065
  () => {
@@ -18055,9 +18067,10 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
18055
18067
  return (_c = (_b = (_a = searchResultOptions.value.filters) == null ? void 0 : _a.facets) == null ? void 0 : _b.disableMobileBodyScrollLock) != null ? _c : false;
18056
18068
  }
18057
18069
  );
18070
+ const isSidebarVisible = computed(() => isMobileSidebarVisible.value);
18058
18071
  const handleMobileToggle = () => {
18059
18072
  searchResultStore.setSidebarState({
18060
- visible: true,
18073
+ visible: !isSidebarVisible.value,
18061
18074
  disableBodyScrolling: !disableMobileBodyScrollLock.value
18062
18075
  });
18063
18076
  };
@@ -18066,7 +18079,8 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
18066
18079
  return openBlock(), createElementBlock("div", {
18067
18080
  class: normalizeClass(["lupa-mobile-toggle", {
18068
18081
  "lupa-mobile-toggle-filters-empty": unref(currentFilterCount) < 1,
18069
- "lupa-mobile-toggle-has-filters": hasActiveFilters.value
18082
+ "lupa-mobile-toggle-has-filters": hasActiveFilters.value,
18083
+ "lupa-sidebar-open": isSidebarVisible.value
18070
18084
  }]),
18071
18085
  onClick: handleMobileToggle
18072
18086
  }, [
@@ -222,6 +222,7 @@ export type ResultFacetOptions = {
222
222
  facetFilterQueries?: Record<string, FacetFilterQuery>;
223
223
  };
224
224
  export type SearchResultsFilterOptions = {
225
+ visible?: boolean;
225
226
  currentFilters?: ResultCurrentFilterOptions;
226
227
  facets?: ResultFacetOptions;
227
228
  categories?: CategoryFilterOptions;
@@ -229,6 +230,7 @@ export type SearchResultsFilterOptions = {
229
230
  export type SearchResultsBreadcrumb = {
230
231
  label: string;
231
232
  link?: string;
233
+ separator?: string;
232
234
  };
233
235
  export type DynamicData = {
234
236
  enabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/vue",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "main": "dist/lupaSearch.mjs",
5
5
  "module": "dist/lupaSearch.mjs",
6
6
  "types": "dist/src/index.d.ts",