@getlupa/client 1.18.0 → 1.18.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.
@@ -14004,9 +14004,16 @@ var __async = (__this, __arguments, generator) => {
14004
14004
  value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
14005
14005
  })
14006
14006
  ] : [];
14007
+ const limitParam = params.value[QUERY_PARAMS_PARSED.LIMIT] ? [
14008
+ {
14009
+ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.LIMIT),
14010
+ value: limit.value.toString()
14011
+ }
14012
+ ] : [];
14007
14013
  appendParams({
14008
14014
  params: [
14009
14015
  { name: optionsStore.getQueryParamName(QUERY_PARAMS$1.QUERY), value: searchText },
14016
+ ...limitParam,
14010
14017
  ...facetParam
14011
14018
  ],
14012
14019
  paramsToRemove: "all",
@@ -31205,13 +31212,15 @@ and ensure you are accounting for this risk.
31205
31212
  options: {}
31206
31213
  },
31207
31214
  setup(__props) {
31215
+ const props = __props;
31208
31216
  const searchResultStore = useSearchResultStore();
31209
31217
  const paramsStore = useParamsStore();
31210
31218
  const optionsStore = useOptionsStore();
31211
31219
  const { searchResult, relatedQueriesResult } = storeToRefs(searchResultStore);
31212
31220
  const relatedQueries2 = computed(() => {
31213
- var _a, _b;
31214
- return (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
31221
+ var _a, _b, _c, _d;
31222
+ const allQueries = (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
31223
+ return ((_d = (_c = props.options) == null ? void 0 : _c.source) == null ? void 0 : _d.count) ? allQueries.slice(0, props.options.source.count) : allQueries;
31215
31224
  });
31216
31225
  const currentSearchText = computed(() => {
31217
31226
  var _a, _b;
@@ -31396,7 +31405,7 @@ and ensure you are accounting for this risk.
31396
31405
  return Boolean(((_a = props.options.relatedQueries) == null ? void 0 : _a.source) && relatedQueriesApiEnabled.value === false);
31397
31406
  });
31398
31407
  const showApiRelatedQueries = computed(() => {
31399
- return Boolean(relatedQueriesApiEnabled.value === true);
31408
+ return Boolean(relatedQueriesApiEnabled.value === true) && Boolean(props.options.relatedQueries);
31400
31409
  });
31401
31410
  const getProductKeyAction = (index, product) => {
31402
31411
  return getProductKey(`${index}`, product, props.options.idKey);
@@ -14004,9 +14004,16 @@ const useParamsStore = defineStore("params", () => {
14004
14004
  value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
14005
14005
  })
14006
14006
  ] : [];
14007
+ const limitParam = params.value[QUERY_PARAMS_PARSED.LIMIT] ? [
14008
+ {
14009
+ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.LIMIT),
14010
+ value: limit.value.toString()
14011
+ }
14012
+ ] : [];
14007
14013
  appendParams({
14008
14014
  params: [
14009
14015
  { name: optionsStore.getQueryParamName(QUERY_PARAMS$1.QUERY), value: searchText },
14016
+ ...limitParam,
14010
14017
  ...facetParam
14011
14018
  ],
14012
14019
  paramsToRemove: "all",
@@ -31205,13 +31212,15 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
31205
31212
  options: {}
31206
31213
  },
31207
31214
  setup(__props) {
31215
+ const props = __props;
31208
31216
  const searchResultStore = useSearchResultStore();
31209
31217
  const paramsStore = useParamsStore();
31210
31218
  const optionsStore = useOptionsStore();
31211
31219
  const { searchResult, relatedQueriesResult } = storeToRefs(searchResultStore);
31212
31220
  const relatedQueries2 = computed(() => {
31213
- var _a, _b;
31214
- return (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
31221
+ var _a, _b, _c, _d;
31222
+ const allQueries = (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
31223
+ return ((_d = (_c = props.options) == null ? void 0 : _c.source) == null ? void 0 : _d.count) ? allQueries.slice(0, props.options.source.count) : allQueries;
31215
31224
  });
31216
31225
  const currentSearchText = computed(() => {
31217
31226
  var _a, _b;
@@ -31396,7 +31405,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
31396
31405
  return Boolean(((_a = props.options.relatedQueries) == null ? void 0 : _a.source) && relatedQueriesApiEnabled.value === false);
31397
31406
  });
31398
31407
  const showApiRelatedQueries = computed(() => {
31399
- return Boolean(relatedQueriesApiEnabled.value === true);
31408
+ return Boolean(relatedQueriesApiEnabled.value === true) && Boolean(props.options.relatedQueries);
31400
31409
  });
31401
31410
  const getProductKeyAction = (index, product) => {
31402
31411
  return getProductKey(`${index}`, product, props.options.idKey);
@@ -14002,9 +14002,16 @@ const useParamsStore = defineStore("params", () => {
14002
14002
  value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
14003
14003
  })
14004
14004
  ] : [];
14005
+ const limitParam = params.value[QUERY_PARAMS_PARSED.LIMIT] ? [
14006
+ {
14007
+ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.LIMIT),
14008
+ value: limit.value.toString()
14009
+ }
14010
+ ] : [];
14005
14011
  appendParams({
14006
14012
  params: [
14007
14013
  { name: optionsStore.getQueryParamName(QUERY_PARAMS$1.QUERY), value: searchText },
14014
+ ...limitParam,
14008
14015
  ...facetParam
14009
14016
  ],
14010
14017
  paramsToRemove: "all",
@@ -31203,13 +31210,15 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
31203
31210
  options: {}
31204
31211
  },
31205
31212
  setup(__props) {
31213
+ const props = __props;
31206
31214
  const searchResultStore = useSearchResultStore();
31207
31215
  const paramsStore = useParamsStore();
31208
31216
  const optionsStore = useOptionsStore();
31209
31217
  const { searchResult, relatedQueriesResult } = storeToRefs(searchResultStore);
31210
31218
  const relatedQueries2 = computed(() => {
31211
- var _a, _b;
31212
- return (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
31219
+ var _a, _b, _c, _d;
31220
+ const allQueries = (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
31221
+ return ((_d = (_c = props.options) == null ? void 0 : _c.source) == null ? void 0 : _d.count) ? allQueries.slice(0, props.options.source.count) : allQueries;
31213
31222
  });
31214
31223
  const currentSearchText = computed(() => {
31215
31224
  var _a, _b;
@@ -31394,7 +31403,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
31394
31403
  return Boolean(((_a = props.options.relatedQueries) == null ? void 0 : _a.source) && relatedQueriesApiEnabled.value === false);
31395
31404
  });
31396
31405
  const showApiRelatedQueries = computed(() => {
31397
- return Boolean(relatedQueriesApiEnabled.value === true);
31406
+ return Boolean(relatedQueriesApiEnabled.value === true) && Boolean(props.options.relatedQueries);
31398
31407
  });
31399
31408
  const getProductKeyAction = (index, product) => {
31400
31409
  return getProductKey(`${index}`, product, props.options.idKey);
@@ -14006,9 +14006,16 @@ var __async = (__this, __arguments, generator) => {
14006
14006
  value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
14007
14007
  })
14008
14008
  ] : [];
14009
+ const limitParam = params.value[QUERY_PARAMS_PARSED.LIMIT] ? [
14010
+ {
14011
+ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.LIMIT),
14012
+ value: limit.value.toString()
14013
+ }
14014
+ ] : [];
14009
14015
  appendParams({
14010
14016
  params: [
14011
14017
  { name: optionsStore.getQueryParamName(QUERY_PARAMS$1.QUERY), value: searchText },
14018
+ ...limitParam,
14012
14019
  ...facetParam
14013
14020
  ],
14014
14021
  paramsToRemove: "all",
@@ -31207,13 +31214,15 @@ and ensure you are accounting for this risk.
31207
31214
  options: {}
31208
31215
  },
31209
31216
  setup(__props) {
31217
+ const props = __props;
31210
31218
  const searchResultStore = useSearchResultStore();
31211
31219
  const paramsStore = useParamsStore();
31212
31220
  const optionsStore = useOptionsStore();
31213
31221
  const { searchResult, relatedQueriesResult } = storeToRefs(searchResultStore);
31214
31222
  const relatedQueries2 = computed(() => {
31215
- var _a, _b;
31216
- return (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
31223
+ var _a, _b, _c, _d;
31224
+ const allQueries = (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
31225
+ return ((_d = (_c = props.options) == null ? void 0 : _c.source) == null ? void 0 : _d.count) ? allQueries.slice(0, props.options.source.count) : allQueries;
31217
31226
  });
31218
31227
  const currentSearchText = computed(() => {
31219
31228
  var _a, _b;
@@ -31398,7 +31407,7 @@ and ensure you are accounting for this risk.
31398
31407
  return Boolean(((_a = props.options.relatedQueries) == null ? void 0 : _a.source) && relatedQueriesApiEnabled.value === false);
31399
31408
  });
31400
31409
  const showApiRelatedQueries = computed(() => {
31401
- return Boolean(relatedQueriesApiEnabled.value === true);
31410
+ return Boolean(relatedQueriesApiEnabled.value === true) && Boolean(props.options.relatedQueries);
31402
31411
  });
31403
31412
  const getProductKeyAction = (index, product) => {
31404
31413
  return getProductKey(`${index}`, product, props.options.idKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.3.4",
23
- "@getlupa/vue": "0.18.0",
23
+ "@getlupa/vue": "0.18.1",
24
24
  "@rushstack/eslint-patch": "^1.3.2",
25
25
  "@tsconfig/node18": "^2.0.1",
26
26
  "@types/jsdom": "^21.1.1",