@getlupa/client 0.5.1-alpha-16 → 0.5.1-alpha-17
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/cjs/index.min.js +8 -2
- package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/es/index.min.js +8 -2
- package/dist/es/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.min.js
CHANGED
|
@@ -23737,7 +23737,8 @@ var SearchBox = /*#__PURE__*/function (_Vue) {
|
|
|
23737
23737
|
|
|
23738
23738
|
var el = document.getElementById("lupa-search-box");
|
|
23739
23739
|
var elementClass = (_b = (_a = e.target) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : "";
|
|
23740
|
-
var
|
|
23740
|
+
var hasLupaClass = typeof elementClass.includes == "function" && elementClass.includes("lupa-search-box");
|
|
23741
|
+
var isOutsideElement = el && !el.contains(e.target) && !hasLupaClass;
|
|
23741
23742
|
|
|
23742
23743
|
if (!isOutsideElement) {
|
|
23743
23744
|
return;
|
|
@@ -24011,7 +24012,7 @@ __vue_render__$Q._withStripped = true;
|
|
|
24011
24012
|
|
|
24012
24013
|
var __vue_inject_styles__$Q = function __vue_inject_styles__(inject) {
|
|
24013
24014
|
if (!inject) return;
|
|
24014
|
-
inject("data-v-
|
|
24015
|
+
inject("data-v-73ed57d5_0", {
|
|
24015
24016
|
source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n",
|
|
24016
24017
|
map: undefined,
|
|
24017
24018
|
media: undefined
|
|
@@ -34788,6 +34789,11 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
34788
34789
|
var query = Object.assign(Object.assign(Object.assign({}, publicQuery), context), {
|
|
34789
34790
|
limit: limit
|
|
34790
34791
|
});
|
|
34792
|
+
|
|
34793
|
+
if (!query.searchText && this.options.disallowEmptyQuery) {
|
|
34794
|
+
return;
|
|
34795
|
+
}
|
|
34796
|
+
|
|
34791
34797
|
getLupaSdk.query(this.options.queryKey, query, this.options.options).then(function (res) {
|
|
34792
34798
|
var _a, _b;
|
|
34793
34799
|
|
|
@@ -8,6 +8,7 @@ export declare type SearchResultsOptions = SearchResultsProductOptions & SearchR
|
|
|
8
8
|
breadcrumbs: SearchResultsBreadcrumb[];
|
|
9
9
|
classMap?: Record<string, string>;
|
|
10
10
|
noResultsQueryFlag?: string;
|
|
11
|
+
disallowEmptyQuery?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare type SearchTitlePosition = "page-top" | "search-results-top";
|
|
13
14
|
export declare type SearchResultsDidYouMeanLabels = {
|
package/dist/es/index.min.js
CHANGED
|
@@ -23733,7 +23733,8 @@ var SearchBox = /*#__PURE__*/function (_Vue) {
|
|
|
23733
23733
|
|
|
23734
23734
|
var el = document.getElementById("lupa-search-box");
|
|
23735
23735
|
var elementClass = (_b = (_a = e.target) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : "";
|
|
23736
|
-
var
|
|
23736
|
+
var hasLupaClass = typeof elementClass.includes == "function" && elementClass.includes("lupa-search-box");
|
|
23737
|
+
var isOutsideElement = el && !el.contains(e.target) && !hasLupaClass;
|
|
23737
23738
|
|
|
23738
23739
|
if (!isOutsideElement) {
|
|
23739
23740
|
return;
|
|
@@ -24007,7 +24008,7 @@ __vue_render__$Q._withStripped = true;
|
|
|
24007
24008
|
|
|
24008
24009
|
var __vue_inject_styles__$Q = function __vue_inject_styles__(inject) {
|
|
24009
24010
|
if (!inject) return;
|
|
24010
|
-
inject("data-v-
|
|
24011
|
+
inject("data-v-73ed57d5_0", {
|
|
24011
24012
|
source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n",
|
|
24012
24013
|
map: undefined,
|
|
24013
24014
|
media: undefined
|
|
@@ -34784,6 +34785,11 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
34784
34785
|
var query = Object.assign(Object.assign(Object.assign({}, publicQuery), context), {
|
|
34785
34786
|
limit: limit
|
|
34786
34787
|
});
|
|
34788
|
+
|
|
34789
|
+
if (!query.searchText && this.options.disallowEmptyQuery) {
|
|
34790
|
+
return;
|
|
34791
|
+
}
|
|
34792
|
+
|
|
34787
34793
|
getLupaSdk.query(this.options.queryKey, query, this.options.options).then(function (res) {
|
|
34788
34794
|
var _a, _b;
|
|
34789
34795
|
|
|
@@ -8,6 +8,7 @@ export declare type SearchResultsOptions = SearchResultsProductOptions & SearchR
|
|
|
8
8
|
breadcrumbs: SearchResultsBreadcrumb[];
|
|
9
9
|
classMap?: Record<string, string>;
|
|
10
10
|
noResultsQueryFlag?: string;
|
|
11
|
+
disallowEmptyQuery?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare type SearchTitlePosition = "page-top" | "search-results-top";
|
|
13
14
|
export declare type SearchResultsDidYouMeanLabels = {
|