@getlupa/vue 0.18.0 → 0.18.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.
- package/dist/lupaSearch.js +13 -4
- package/dist/lupaSearch.mjs +13 -4
- package/package.json +1 -1
package/dist/lupaSearch.js
CHANGED
|
@@ -8710,9 +8710,16 @@ const useParamsStore = defineStore("params", () => {
|
|
|
8710
8710
|
value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
|
|
8711
8711
|
})
|
|
8712
8712
|
] : [];
|
|
8713
|
+
const limitParam = params.value[QUERY_PARAMS_PARSED.LIMIT] ? [
|
|
8714
|
+
{
|
|
8715
|
+
name: optionsStore.getQueryParamName(QUERY_PARAMS.LIMIT),
|
|
8716
|
+
value: limit.value.toString()
|
|
8717
|
+
}
|
|
8718
|
+
] : [];
|
|
8713
8719
|
appendParams({
|
|
8714
8720
|
params: [
|
|
8715
8721
|
{ name: optionsStore.getQueryParamName(QUERY_PARAMS.QUERY), value: searchText },
|
|
8722
|
+
...limitParam,
|
|
8716
8723
|
...facetParam
|
|
8717
8724
|
],
|
|
8718
8725
|
paramsToRemove: "all",
|
|
@@ -25977,13 +25984,15 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
25977
25984
|
options: {}
|
|
25978
25985
|
},
|
|
25979
25986
|
setup(__props) {
|
|
25987
|
+
const props = __props;
|
|
25980
25988
|
const searchResultStore = useSearchResultStore();
|
|
25981
25989
|
const paramsStore = useParamsStore();
|
|
25982
25990
|
const optionsStore = useOptionsStore();
|
|
25983
25991
|
const { searchResult, relatedQueriesResult } = storeToRefs(searchResultStore);
|
|
25984
25992
|
const relatedQueries2 = vue.computed(() => {
|
|
25985
|
-
var _a, _b;
|
|
25986
|
-
|
|
25993
|
+
var _a, _b, _c, _d;
|
|
25994
|
+
const allQueries = (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
|
|
25995
|
+
return ((_d = (_c = props.options) == null ? void 0 : _c.source) == null ? void 0 : _d.count) ? allQueries.slice(0, props.options.source.count) : allQueries;
|
|
25987
25996
|
});
|
|
25988
25997
|
const currentSearchText = vue.computed(() => {
|
|
25989
25998
|
var _a, _b;
|
|
@@ -26168,7 +26177,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
26168
26177
|
return Boolean(((_a = props.options.relatedQueries) == null ? void 0 : _a.source) && relatedQueriesApiEnabled.value === false);
|
|
26169
26178
|
});
|
|
26170
26179
|
const showApiRelatedQueries = vue.computed(() => {
|
|
26171
|
-
return Boolean(relatedQueriesApiEnabled.value === true);
|
|
26180
|
+
return Boolean(relatedQueriesApiEnabled.value === true) && Boolean(props.options.relatedQueries);
|
|
26172
26181
|
});
|
|
26173
26182
|
const getProductKeyAction = (index, product) => {
|
|
26174
26183
|
return getProductKey(`${index}`, product, props.options.idKey);
|
|
@@ -26532,7 +26541,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
26532
26541
|
handleResults({ queryKey: props.options.queryKey, results: res });
|
|
26533
26542
|
searchResultStore.add(requestId, __spreadValues({}, res));
|
|
26534
26543
|
searchResultStore.setRelatedQueriesApiEnabled((_a = res.hasRelatedQueries) != null ? _a : false);
|
|
26535
|
-
if (res.hasRelatedQueries) {
|
|
26544
|
+
if (res.hasRelatedQueries && Boolean(props.options.relatedQueries)) {
|
|
26536
26545
|
searchResultStore.queryRelatedQueries(
|
|
26537
26546
|
props.options.queryKey,
|
|
26538
26547
|
publicQuery,
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -8708,9 +8708,16 @@ const useParamsStore = defineStore("params", () => {
|
|
|
8708
8708
|
value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
|
|
8709
8709
|
})
|
|
8710
8710
|
] : [];
|
|
8711
|
+
const limitParam = params.value[QUERY_PARAMS_PARSED.LIMIT] ? [
|
|
8712
|
+
{
|
|
8713
|
+
name: optionsStore.getQueryParamName(QUERY_PARAMS.LIMIT),
|
|
8714
|
+
value: limit.value.toString()
|
|
8715
|
+
}
|
|
8716
|
+
] : [];
|
|
8711
8717
|
appendParams({
|
|
8712
8718
|
params: [
|
|
8713
8719
|
{ name: optionsStore.getQueryParamName(QUERY_PARAMS.QUERY), value: searchText },
|
|
8720
|
+
...limitParam,
|
|
8714
8721
|
...facetParam
|
|
8715
8722
|
],
|
|
8716
8723
|
paramsToRemove: "all",
|
|
@@ -25975,13 +25982,15 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
25975
25982
|
options: {}
|
|
25976
25983
|
},
|
|
25977
25984
|
setup(__props) {
|
|
25985
|
+
const props = __props;
|
|
25978
25986
|
const searchResultStore = useSearchResultStore();
|
|
25979
25987
|
const paramsStore = useParamsStore();
|
|
25980
25988
|
const optionsStore = useOptionsStore();
|
|
25981
25989
|
const { searchResult, relatedQueriesResult } = storeToRefs(searchResultStore);
|
|
25982
25990
|
const relatedQueries2 = computed(() => {
|
|
25983
|
-
var _a, _b;
|
|
25984
|
-
|
|
25991
|
+
var _a, _b, _c, _d;
|
|
25992
|
+
const allQueries = (_b = (_a = relatedQueriesResult.value) == null ? void 0 : _a.relatedQueries) != null ? _b : [];
|
|
25993
|
+
return ((_d = (_c = props.options) == null ? void 0 : _c.source) == null ? void 0 : _d.count) ? allQueries.slice(0, props.options.source.count) : allQueries;
|
|
25985
25994
|
});
|
|
25986
25995
|
const currentSearchText = computed(() => {
|
|
25987
25996
|
var _a, _b;
|
|
@@ -26166,7 +26175,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
26166
26175
|
return Boolean(((_a = props.options.relatedQueries) == null ? void 0 : _a.source) && relatedQueriesApiEnabled.value === false);
|
|
26167
26176
|
});
|
|
26168
26177
|
const showApiRelatedQueries = computed(() => {
|
|
26169
|
-
return Boolean(relatedQueriesApiEnabled.value === true);
|
|
26178
|
+
return Boolean(relatedQueriesApiEnabled.value === true) && Boolean(props.options.relatedQueries);
|
|
26170
26179
|
});
|
|
26171
26180
|
const getProductKeyAction = (index, product) => {
|
|
26172
26181
|
return getProductKey(`${index}`, product, props.options.idKey);
|
|
@@ -26530,7 +26539,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
26530
26539
|
handleResults({ queryKey: props.options.queryKey, results: res });
|
|
26531
26540
|
searchResultStore.add(requestId, __spreadValues({}, res));
|
|
26532
26541
|
searchResultStore.setRelatedQueriesApiEnabled((_a = res.hasRelatedQueries) != null ? _a : false);
|
|
26533
|
-
if (res.hasRelatedQueries) {
|
|
26542
|
+
if (res.hasRelatedQueries && Boolean(props.options.relatedQueries)) {
|
|
26534
26543
|
searchResultStore.queryRelatedQueries(
|
|
26535
26544
|
props.options.queryKey,
|
|
26536
26545
|
publicQuery,
|