@getlupa/vue 0.16.1 → 0.16.2

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.
@@ -18055,10 +18055,11 @@ const _hoisted_1$A = {
18055
18055
  const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
18056
18056
  __name: "SearchResultsMobileToggle",
18057
18057
  props: {
18058
- label: {},
18058
+ labels: {},
18059
18059
  showFilterCount: { type: Boolean }
18060
18060
  },
18061
18061
  setup(__props) {
18062
+ const props = __props;
18062
18063
  const searchResultStore = useSearchResultStore();
18063
18064
  const optionsStore = useOptionsStore();
18064
18065
  const { currentFilterCount, isMobileSidebarVisible } = storeToRefs(searchResultStore);
@@ -18070,6 +18071,18 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
18070
18071
  }
18071
18072
  );
18072
18073
  const isSidebarVisible = vue.computed(() => isMobileSidebarVisible.value);
18074
+ const defaultLabel = vue.computed(() => props.labels.mobileFilterButton);
18075
+ const activeLabel = vue.computed(() => props.labels.mobileFilterButtonActive);
18076
+ const openLabel = vue.computed(() => props.labels.mobileFilterButtonOpen);
18077
+ const label = vue.computed(() => {
18078
+ if (isSidebarVisible.value) {
18079
+ return openLabel.value;
18080
+ }
18081
+ if (hasActiveFilters.value) {
18082
+ return activeLabel.value;
18083
+ }
18084
+ return defaultLabel.value;
18085
+ });
18073
18086
  const handleMobileToggle = () => {
18074
18087
  searchResultStore.setSidebarState({
18075
18088
  visible: !isSidebarVisible.value,
@@ -18086,7 +18099,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
18086
18099
  }]),
18087
18100
  onClick: handleMobileToggle
18088
18101
  }, [
18089
- vue.createTextVNode(vue.toDisplayString(_ctx.label) + " ", 1),
18102
+ vue.createTextVNode(vue.toDisplayString(label.value) + " ", 1),
18090
18103
  _ctx.showFilterCount && vue.unref(currentFilterCount) > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$A, vue.toDisplayString(vue.unref(currentFilterCount)), 1)) : vue.createCommentVNode("", true)
18091
18104
  ], 2);
18092
18105
  };
@@ -18533,9 +18546,9 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
18533
18546
  vue.createElementVNode("div", _hoisted_6$5, [
18534
18547
  toolbarRightLabel.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$3, vue.toDisplayString(toolbarRightLabel.value), 1)) : vue.createCommentVNode("", true),
18535
18548
  vue.createVNode(_sfc_main$G, {
18536
- label: optionsValue.value.labels.mobileFilterButton,
18549
+ labels: optionsValue.value.labels,
18537
18550
  "show-filter-count": showMobileFilterCount.value
18538
- }, null, 8, ["label", "show-filter-count"]),
18551
+ }, null, 8, ["labels", "show-filter-count"]),
18539
18552
  paginationDisplay.value.pageSize ? (vue.openBlock(), vue.createBlock(_sfc_main$D, {
18540
18553
  key: 1,
18541
18554
  options: paginationOptions.value.pageSize,
@@ -18053,10 +18053,11 @@ const _hoisted_1$A = {
18053
18053
  const _sfc_main$G = /* @__PURE__ */ defineComponent({
18054
18054
  __name: "SearchResultsMobileToggle",
18055
18055
  props: {
18056
- label: {},
18056
+ labels: {},
18057
18057
  showFilterCount: { type: Boolean }
18058
18058
  },
18059
18059
  setup(__props) {
18060
+ const props = __props;
18060
18061
  const searchResultStore = useSearchResultStore();
18061
18062
  const optionsStore = useOptionsStore();
18062
18063
  const { currentFilterCount, isMobileSidebarVisible } = storeToRefs(searchResultStore);
@@ -18068,6 +18069,18 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
18068
18069
  }
18069
18070
  );
18070
18071
  const isSidebarVisible = computed(() => isMobileSidebarVisible.value);
18072
+ const defaultLabel = computed(() => props.labels.mobileFilterButton);
18073
+ const activeLabel = computed(() => props.labels.mobileFilterButtonActive);
18074
+ const openLabel = computed(() => props.labels.mobileFilterButtonOpen);
18075
+ const label = computed(() => {
18076
+ if (isSidebarVisible.value) {
18077
+ return openLabel.value;
18078
+ }
18079
+ if (hasActiveFilters.value) {
18080
+ return activeLabel.value;
18081
+ }
18082
+ return defaultLabel.value;
18083
+ });
18071
18084
  const handleMobileToggle = () => {
18072
18085
  searchResultStore.setSidebarState({
18073
18086
  visible: !isSidebarVisible.value,
@@ -18084,7 +18097,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
18084
18097
  }]),
18085
18098
  onClick: handleMobileToggle
18086
18099
  }, [
18087
- createTextVNode(toDisplayString(_ctx.label) + " ", 1),
18100
+ createTextVNode(toDisplayString(label.value) + " ", 1),
18088
18101
  _ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$A, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
18089
18102
  ], 2);
18090
18103
  };
@@ -18531,9 +18544,9 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
18531
18544
  createElementVNode("div", _hoisted_6$5, [
18532
18545
  toolbarRightLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7$3, toDisplayString(toolbarRightLabel.value), 1)) : createCommentVNode("", true),
18533
18546
  createVNode(_sfc_main$G, {
18534
- label: optionsValue.value.labels.mobileFilterButton,
18547
+ labels: optionsValue.value.labels,
18535
18548
  "show-filter-count": showMobileFilterCount.value
18536
- }, null, 8, ["label", "show-filter-count"]),
18549
+ }, null, 8, ["labels", "show-filter-count"]),
18537
18550
  paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$D, {
18538
18551
  key: 1,
18539
18552
  options: paginationOptions.value.pageSize,
@@ -1,7 +1,8 @@
1
1
  import type { PropType as __PropType } from 'vue';
2
+ import { SearchResultsOptionLabels } from '../../../types/search-results/SearchResultsOptions';
2
3
  declare const _sfc_main: import("vue").DefineComponent<{
3
- label: {
4
- type: __PropType<string>;
4
+ labels: {
5
+ type: __PropType<SearchResultsOptionLabels>;
5
6
  required: true;
6
7
  };
7
8
  showFilterCount: {
@@ -9,8 +10,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
9
10
  required: true;
10
11
  };
11
12
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
- label: {
13
- type: __PropType<string>;
13
+ labels: {
14
+ type: __PropType<SearchResultsOptionLabels>;
14
15
  required: true;
15
16
  };
16
17
  showFilterCount: {
@@ -74,6 +74,8 @@ export type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchRe
74
74
  itemCount: string;
75
75
  emptyResults: string;
76
76
  mobileFilterButton: string;
77
+ mobileFilterButtonActive: string;
78
+ mobileFilterButtonOpen: string;
77
79
  mobileFilterCloseButton: string;
78
80
  htmlTitleTemplate: string;
79
81
  outOfStock?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/vue",
3
- "version": "0.16.1",
3
+ "version": "0.16.2",
4
4
  "main": "dist/lupaSearch.mjs",
5
5
  "module": "dist/lupaSearch.mjs",
6
6
  "types": "dist/src/index.d.ts",