@getlupa/client 0.5.1-alpha-12 → 0.5.1-alpha-15
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/components/search-box/products/SearchBoxProduct.vue.d.ts +3 -1
- package/dist/cjs/components/search-results/SearchResults.vue.d.ts +4 -0
- package/dist/cjs/index.min.js +148 -120
- package/dist/cjs/store/modules/params.d.ts +6 -1
- package/dist/cjs/utils/routing.utils.d.ts +1 -0
- package/dist/es/components/search-box/products/SearchBoxProduct.vue.d.ts +3 -1
- package/dist/es/components/search-results/SearchResults.vue.d.ts +4 -0
- package/dist/es/index.min.js +148 -120
- package/dist/es/store/modules/params.d.ts +6 -1
- package/dist/es/utils/routing.utils.d.ts +1 -0
- package/dist/iife/components/search-box/products/SearchBoxProduct.vue.d.ts +3 -1
- package/dist/iife/components/search-results/SearchResults.vue.d.ts +4 -0
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/store/modules/params.d.ts +6 -1
- package/dist/iife/utils/routing.utils.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/es/index.min.js
CHANGED
|
@@ -5487,11 +5487,11 @@ var String$2 = global$d.String;
|
|
|
5487
5487
|
var counter$1 = 0;
|
|
5488
5488
|
var queue$1 = {};
|
|
5489
5489
|
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
5490
|
-
var location
|
|
5490
|
+
var location, defer, channel, port;
|
|
5491
5491
|
|
|
5492
5492
|
try {
|
|
5493
5493
|
// Deno throws a ReferenceError on `location` access without `--location` flag
|
|
5494
|
-
location
|
|
5494
|
+
location = global$d.location;
|
|
5495
5495
|
} catch (error) {
|
|
5496
5496
|
/* empty */
|
|
5497
5497
|
}
|
|
@@ -5516,7 +5516,7 @@ var listener = function (event) {
|
|
|
5516
5516
|
|
|
5517
5517
|
var post = function (id) {
|
|
5518
5518
|
// old engines have not location.origin
|
|
5519
|
-
global$d.postMessage(String$2(id), location
|
|
5519
|
+
global$d.postMessage(String$2(id), location.protocol + '//' + location.host);
|
|
5520
5520
|
}; // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
5521
5521
|
|
|
5522
5522
|
|
|
@@ -5554,7 +5554,7 @@ if (!set$1 || !clear) {
|
|
|
5554
5554
|
channel.port1.onmessage = listener;
|
|
5555
5555
|
defer = bind$5(port.postMessage, port); // Browsers with postMessage, skip WebWorkers
|
|
5556
5556
|
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
|
5557
|
-
} else if (global$d.addEventListener && isCallable$1(global$d.postMessage) && !global$d.importScripts && location
|
|
5557
|
+
} else if (global$d.addEventListener && isCallable$1(global$d.postMessage) && !global$d.importScripts && location && location.protocol !== 'file:' && !fails$8(post)) {
|
|
5558
5558
|
defer = post;
|
|
5559
5559
|
global$d.addEventListener('message', listener, false); // IE8-
|
|
5560
5560
|
} else if (ONREADYSTATECHANGE in createElement$2('script')) {
|
|
@@ -19683,13 +19683,6 @@ var generateResultLink = function generateResultLink(link, searchText, facet) {
|
|
|
19683
19683
|
var queryParam = "?".concat(QUERY_PARAMS.QUERY, "=").concat(encodeParam(searchText));
|
|
19684
19684
|
return "".concat(link).concat(queryParam).concat(facetParam);
|
|
19685
19685
|
};
|
|
19686
|
-
var getPathName = function getPathName(resultPageLink) {
|
|
19687
|
-
var pathname = window.location.pathname;
|
|
19688
|
-
if (pathname.charAt(pathname.length - 1) === "/") pathname = pathname.substr(0, pathname.length - 1);
|
|
19689
|
-
if (resultPageLink.charAt(0) !== "/") pathname += "/";
|
|
19690
|
-
pathname += !location.pathname.includes(resultPageLink) ? resultPageLink : "";
|
|
19691
|
-
return pathname;
|
|
19692
|
-
};
|
|
19693
19686
|
var getRelativePath = function getRelativePath(link) {
|
|
19694
19687
|
try {
|
|
19695
19688
|
var url = new URL(link);
|
|
@@ -19708,8 +19701,87 @@ var linksMatch = function linksMatch(link1, link2) {
|
|
|
19708
19701
|
return link1 === link2 || getRelativePath(link1) === getRelativePath(link2);
|
|
19709
19702
|
};
|
|
19710
19703
|
|
|
19704
|
+
// `SameValue` abstract operation
|
|
19705
|
+
// https://tc39.es/ecma262/#sec-samevalue
|
|
19706
|
+
// eslint-disable-next-line es/no-object-is -- safe
|
|
19707
|
+
var sameValue$1 = Object.is || function is(x, y) {
|
|
19708
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
19709
|
+
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
19710
|
+
};
|
|
19711
|
+
|
|
19712
|
+
var call = functionCall;
|
|
19713
|
+
|
|
19714
|
+
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
19715
|
+
|
|
19716
|
+
var anObject = anObject$k;
|
|
19717
|
+
|
|
19718
|
+
var requireObjectCoercible = requireObjectCoercible$c;
|
|
19719
|
+
|
|
19720
|
+
var sameValue = sameValue$1;
|
|
19721
|
+
|
|
19722
|
+
var toString = toString$h;
|
|
19723
|
+
|
|
19724
|
+
var getMethod = getMethod$7;
|
|
19725
|
+
|
|
19726
|
+
var regExpExec = regexpExecAbstract; // @@search logic
|
|
19727
|
+
|
|
19728
|
+
|
|
19729
|
+
fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
|
|
19730
|
+
return [// `String.prototype.search` method
|
|
19731
|
+
// https://tc39.es/ecma262/#sec-string.prototype.search
|
|
19732
|
+
function search(regexp) {
|
|
19733
|
+
var O = requireObjectCoercible(this);
|
|
19734
|
+
var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
|
|
19735
|
+
return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
|
|
19736
|
+
}, // `RegExp.prototype[@@search]` method
|
|
19737
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype-@@search
|
|
19738
|
+
function (string) {
|
|
19739
|
+
var rx = anObject(this);
|
|
19740
|
+
var S = toString(string);
|
|
19741
|
+
var res = maybeCallNative(nativeSearch, rx, S);
|
|
19742
|
+
if (res.done) return res.value;
|
|
19743
|
+
var previousLastIndex = rx.lastIndex;
|
|
19744
|
+
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
19745
|
+
var result = regExpExec(rx, S);
|
|
19746
|
+
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
19747
|
+
return result === null ? -1 : result.index;
|
|
19748
|
+
}];
|
|
19749
|
+
});
|
|
19750
|
+
|
|
19751
|
+
var emitRoutingEvent = function emitRoutingEvent(url) {
|
|
19752
|
+
var event = new CustomEvent(LUPA_ROUTING_EVENT, {
|
|
19753
|
+
detail: url
|
|
19754
|
+
});
|
|
19755
|
+
window.dispatchEvent(event);
|
|
19756
|
+
};
|
|
19757
|
+
var handleRoutingEvent = function handleRoutingEvent(link, event) {
|
|
19758
|
+
var hasEventRouting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
19759
|
+
|
|
19760
|
+
if (!hasEventRouting) {
|
|
19761
|
+
return;
|
|
19762
|
+
}
|
|
19763
|
+
|
|
19764
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
19765
|
+
emitRoutingEvent(link);
|
|
19766
|
+
};
|
|
19767
|
+
var redirectToResultsPage = function redirectToResultsPage(link, searchText, facet) {
|
|
19768
|
+
var routingBehavior = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "direct-link";
|
|
19769
|
+
var url = generateResultLink(link, searchText, facet);
|
|
19770
|
+
|
|
19771
|
+
if (routingBehavior === "event") {
|
|
19772
|
+
emitRoutingEvent(url);
|
|
19773
|
+
} else {
|
|
19774
|
+
window.location.assign(url);
|
|
19775
|
+
}
|
|
19776
|
+
};
|
|
19777
|
+
var getPageUrl = function getPageUrl(pathnameOverride) {
|
|
19778
|
+
var pathname = pathnameOverride || window.location.pathname;
|
|
19779
|
+
return new URL(window.location.origin + pathname + window.location.search);
|
|
19780
|
+
};
|
|
19781
|
+
|
|
19711
19782
|
var history$3 = namespace("history");
|
|
19712
19783
|
var tracking$5 = namespace("tracking");
|
|
19784
|
+
var options$9 = namespace("options");
|
|
19713
19785
|
|
|
19714
19786
|
var SearchBoxProduct = /*#__PURE__*/function (_Vue) {
|
|
19715
19787
|
_inherits(SearchBoxProduct, _Vue);
|
|
@@ -19758,7 +19830,7 @@ var SearchBoxProduct = /*#__PURE__*/function (_Vue) {
|
|
|
19758
19830
|
}
|
|
19759
19831
|
}, {
|
|
19760
19832
|
key: "handleClick",
|
|
19761
|
-
value: function handleClick() {
|
|
19833
|
+
value: function handleClick(event) {
|
|
19762
19834
|
if (this.panelOptions.titleKey) {
|
|
19763
19835
|
this.addHistory({
|
|
19764
19836
|
item: this.item[this.panelOptions.titleKey] || ""
|
|
@@ -19781,6 +19853,12 @@ var SearchBoxProduct = /*#__PURE__*/function (_Vue) {
|
|
|
19781
19853
|
}
|
|
19782
19854
|
}
|
|
19783
19855
|
});
|
|
19856
|
+
|
|
19857
|
+
if (!this.link) {
|
|
19858
|
+
return;
|
|
19859
|
+
}
|
|
19860
|
+
|
|
19861
|
+
handleRoutingEvent(this.link, event, this.boxRoutingBehavior === "event");
|
|
19784
19862
|
}
|
|
19785
19863
|
}]);
|
|
19786
19864
|
|
|
@@ -19801,6 +19879,8 @@ __decorate([Prop({
|
|
|
19801
19879
|
default: false
|
|
19802
19880
|
})], SearchBoxProduct.prototype, "highlighted", void 0);
|
|
19803
19881
|
|
|
19882
|
+
__decorate([options$9.Getter("boxRoutingBehavior")], SearchBoxProduct.prototype, "boxRoutingBehavior", void 0);
|
|
19883
|
+
|
|
19804
19884
|
__decorate([tracking$5.Action("track")], SearchBoxProduct.prototype, "trackClick", void 0);
|
|
19805
19885
|
|
|
19806
19886
|
__decorate([history$3.Action("add")], SearchBoxProduct.prototype, "addHistory", void 0);
|
|
@@ -21736,53 +21816,6 @@ var __vue_component__$P = /*#__PURE__*/normalizeComponent({
|
|
|
21736
21816
|
staticRenderFns: __vue_staticRenderFns__$P
|
|
21737
21817
|
}, __vue_inject_styles__$P, __vue_script__$P, __vue_scope_id__$P, __vue_is_functional_template__$P, __vue_module_identifier__$P, false, undefined, undefined, undefined);
|
|
21738
21818
|
|
|
21739
|
-
// `SameValue` abstract operation
|
|
21740
|
-
// https://tc39.es/ecma262/#sec-samevalue
|
|
21741
|
-
// eslint-disable-next-line es/no-object-is -- safe
|
|
21742
|
-
var sameValue$1 = Object.is || function is(x, y) {
|
|
21743
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
21744
|
-
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
21745
|
-
};
|
|
21746
|
-
|
|
21747
|
-
var call = functionCall;
|
|
21748
|
-
|
|
21749
|
-
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
21750
|
-
|
|
21751
|
-
var anObject = anObject$k;
|
|
21752
|
-
|
|
21753
|
-
var requireObjectCoercible = requireObjectCoercible$c;
|
|
21754
|
-
|
|
21755
|
-
var sameValue = sameValue$1;
|
|
21756
|
-
|
|
21757
|
-
var toString = toString$h;
|
|
21758
|
-
|
|
21759
|
-
var getMethod = getMethod$7;
|
|
21760
|
-
|
|
21761
|
-
var regExpExec = regexpExecAbstract; // @@search logic
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
|
|
21765
|
-
return [// `String.prototype.search` method
|
|
21766
|
-
// https://tc39.es/ecma262/#sec-string.prototype.search
|
|
21767
|
-
function search(regexp) {
|
|
21768
|
-
var O = requireObjectCoercible(this);
|
|
21769
|
-
var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
|
|
21770
|
-
return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
|
|
21771
|
-
}, // `RegExp.prototype[@@search]` method
|
|
21772
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@search
|
|
21773
|
-
function (string) {
|
|
21774
|
-
var rx = anObject(this);
|
|
21775
|
-
var S = toString(string);
|
|
21776
|
-
var res = maybeCallNative(nativeSearch, rx, S);
|
|
21777
|
-
if (res.done) return res.value;
|
|
21778
|
-
var previousLastIndex = rx.lastIndex;
|
|
21779
|
-
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
21780
|
-
var result = regExpExec(rx, S);
|
|
21781
|
-
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
21782
|
-
return result === null ? -1 : result.index;
|
|
21783
|
-
}];
|
|
21784
|
-
});
|
|
21785
|
-
|
|
21786
21819
|
var DEFAULT_OPTIONS_RESULTS = {
|
|
21787
21820
|
options: {
|
|
21788
21821
|
environment: "production"
|
|
@@ -27434,33 +27467,6 @@ var __vue_component__$G = /*#__PURE__*/normalizeComponent({
|
|
|
27434
27467
|
staticRenderFns: __vue_staticRenderFns__$G
|
|
27435
27468
|
}, __vue_inject_styles__$G, __vue_script__$G, __vue_scope_id__$G, __vue_is_functional_template__$G, __vue_module_identifier__$G, false, undefined, undefined, undefined);
|
|
27436
27469
|
|
|
27437
|
-
var emitRoutingEvent = function emitRoutingEvent(url) {
|
|
27438
|
-
var event = new CustomEvent(LUPA_ROUTING_EVENT, {
|
|
27439
|
-
detail: url
|
|
27440
|
-
});
|
|
27441
|
-
window.dispatchEvent(event);
|
|
27442
|
-
};
|
|
27443
|
-
var handleRoutingEvent = function handleRoutingEvent(link, event) {
|
|
27444
|
-
var hasEventRouting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
27445
|
-
|
|
27446
|
-
if (!hasEventRouting) {
|
|
27447
|
-
return;
|
|
27448
|
-
}
|
|
27449
|
-
|
|
27450
|
-
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
27451
|
-
emitRoutingEvent(link);
|
|
27452
|
-
};
|
|
27453
|
-
var redirectToResultsPage = function redirectToResultsPage(link, searchText, facet) {
|
|
27454
|
-
var routingBehavior = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "direct-link";
|
|
27455
|
-
var url = generateResultLink(link, searchText, facet);
|
|
27456
|
-
|
|
27457
|
-
if (routingBehavior === "event") {
|
|
27458
|
-
emitRoutingEvent(url);
|
|
27459
|
-
} else {
|
|
27460
|
-
window.location.assign(url);
|
|
27461
|
-
}
|
|
27462
|
-
};
|
|
27463
|
-
|
|
27464
27470
|
var CategoryFilterItem = /*#__PURE__*/function (_Vue) {
|
|
27465
27471
|
_inherits(CategoryFilterItem, _Vue);
|
|
27466
27472
|
|
|
@@ -27842,6 +27848,7 @@ var __vue_render__$D = function __vue_render__() {
|
|
|
27842
27848
|
var _c = _vm._self._c || _h;
|
|
27843
27849
|
|
|
27844
27850
|
return _c("div", {
|
|
27851
|
+
staticClass: "lupa-search-result-filters",
|
|
27845
27852
|
attrs: {
|
|
27846
27853
|
id: "lupa-search-result-filters"
|
|
27847
27854
|
}
|
|
@@ -29868,6 +29875,7 @@ var __vue_render__$m = function __vue_render__() {
|
|
|
29868
29875
|
var _c = _vm._self._c || _h;
|
|
29869
29876
|
|
|
29870
29877
|
return _c("div", {
|
|
29878
|
+
staticClass: "lupa-search-result-product-card",
|
|
29871
29879
|
class: !_vm.isInStock ? "lupa-out-of-stock" : "",
|
|
29872
29880
|
attrs: {
|
|
29873
29881
|
id: "lupa-search-result-product-card",
|
|
@@ -30836,6 +30844,7 @@ var __vue_render__$h = function __vue_render__() {
|
|
|
30836
30844
|
var _c = _vm._self._c || _h;
|
|
30837
30845
|
|
|
30838
30846
|
return _c("div", {
|
|
30847
|
+
staticClass: "lupa-search-results-sort",
|
|
30839
30848
|
attrs: {
|
|
30840
30849
|
id: "lupa-search-results-sort"
|
|
30841
30850
|
}
|
|
@@ -31758,6 +31767,7 @@ var __vue_render__$9 = function __vue_render__() {
|
|
|
31758
31767
|
var _c = _vm._self._c || _h;
|
|
31759
31768
|
|
|
31760
31769
|
return _c("div", {
|
|
31770
|
+
staticClass: "lupa-search-result-filters",
|
|
31761
31771
|
attrs: {
|
|
31762
31772
|
id: "lupa-search-result-filters"
|
|
31763
31773
|
}
|
|
@@ -32473,30 +32483,17 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
32473
32483
|
value: function handleResults(_ref) {
|
|
32474
32484
|
var queryKey = _ref.queryKey,
|
|
32475
32485
|
results = _ref.results;
|
|
32486
|
+
|
|
32487
|
+
var _a;
|
|
32488
|
+
|
|
32476
32489
|
this.trackResults({
|
|
32477
32490
|
queryKey: queryKey,
|
|
32478
32491
|
results: results
|
|
32479
32492
|
});
|
|
32480
|
-
|
|
32481
|
-
|
|
32482
|
-
|
|
32483
|
-
|
|
32484
|
-
}
|
|
32485
|
-
|
|
32486
|
-
if (results.total < 1) {
|
|
32487
|
-
this.appendParams({
|
|
32488
|
-
params: [{
|
|
32489
|
-
name: noResultsParam,
|
|
32490
|
-
value: "true"
|
|
32491
|
-
}],
|
|
32492
|
-
save: false
|
|
32493
|
-
});
|
|
32494
|
-
} else {
|
|
32495
|
-
this.removeParams({
|
|
32496
|
-
paramsToRemove: [noResultsParam],
|
|
32497
|
-
save: false
|
|
32498
|
-
});
|
|
32499
|
-
}
|
|
32493
|
+
this.handleNoResultsFlag({
|
|
32494
|
+
resultCount: (_a = results === null || results === void 0 ? void 0 : results.total) !== null && _a !== void 0 ? _a : 0,
|
|
32495
|
+
noResultsParam: this.options.noResultsQueryFlag
|
|
32496
|
+
});
|
|
32500
32497
|
}
|
|
32501
32498
|
}, {
|
|
32502
32499
|
key: "handleResize",
|
|
@@ -32539,6 +32536,8 @@ __decorate([params$1.State("searchString")], SearchResults.prototype, "searchStr
|
|
|
32539
32536
|
|
|
32540
32537
|
__decorate([params$1.Action("setDefaultLimit")], SearchResults.prototype, "setDefaultLimit", void 0);
|
|
32541
32538
|
|
|
32539
|
+
__decorate([params$1.Action("handleNoResultsFlag")], SearchResults.prototype, "handleNoResultsFlag", void 0);
|
|
32540
|
+
|
|
32542
32541
|
__decorate([params$1.Action("add")], SearchResults.prototype, "addParams", void 0);
|
|
32543
32542
|
|
|
32544
32543
|
__decorate([params$1.Action("removeParams")], SearchResults.prototype, "removeParams", void 0);
|
|
@@ -34313,7 +34312,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
|
|
|
34313
34312
|
}, {
|
|
34314
34313
|
key: "removeAllFilters",
|
|
34315
34314
|
value: function removeAllFilters() {
|
|
34316
|
-
var url =
|
|
34315
|
+
var url = getPageUrl();
|
|
34317
34316
|
var paramsToRemove = Array.from(url.searchParams.keys()).filter(isFacetKey);
|
|
34318
34317
|
|
|
34319
34318
|
removeParams(url, paramsToRemove);
|
|
@@ -34330,7 +34329,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
|
|
|
34330
34329
|
var paramsToRemove = _ref2.paramsToRemove,
|
|
34331
34330
|
_ref2$save = _ref2.save,
|
|
34332
34331
|
save = _ref2$save === void 0 ? true : _ref2$save;
|
|
34333
|
-
var url =
|
|
34332
|
+
var url = getPageUrl();
|
|
34334
34333
|
paramsToRemove = getRemovableParams(url, paramsToRemove);
|
|
34335
34334
|
|
|
34336
34335
|
removeParams(url, paramsToRemove);
|
|
@@ -34341,11 +34340,36 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
|
|
|
34341
34340
|
searchString: url.search
|
|
34342
34341
|
} : {};
|
|
34343
34342
|
}
|
|
34343
|
+
}, {
|
|
34344
|
+
key: "handleNoResultsFlag",
|
|
34345
|
+
value: function handleNoResultsFlag(_ref3) {
|
|
34346
|
+
var resultCount = _ref3.resultCount,
|
|
34347
|
+
noResultsParam = _ref3.noResultsParam;
|
|
34348
|
+
|
|
34349
|
+
if (!noResultsParam || this.searchResultsLink && this.searchResultsLink !== window.location.pathname) {
|
|
34350
|
+
return;
|
|
34351
|
+
}
|
|
34352
|
+
|
|
34353
|
+
if (resultCount < 1) {
|
|
34354
|
+
this.context.dispatch("appendParams", {
|
|
34355
|
+
params: [{
|
|
34356
|
+
name: noResultsParam,
|
|
34357
|
+
value: "true"
|
|
34358
|
+
}],
|
|
34359
|
+
save: false
|
|
34360
|
+
});
|
|
34361
|
+
} else {
|
|
34362
|
+
this.context.dispatch("removeParams", {
|
|
34363
|
+
paramsToRemove: [noResultsParam],
|
|
34364
|
+
save: false
|
|
34365
|
+
});
|
|
34366
|
+
}
|
|
34367
|
+
}
|
|
34344
34368
|
}, {
|
|
34345
34369
|
key: "goToResults",
|
|
34346
|
-
value: function goToResults(
|
|
34347
|
-
var searchText =
|
|
34348
|
-
facet =
|
|
34370
|
+
value: function goToResults(_ref4) {
|
|
34371
|
+
var searchText = _ref4.searchText,
|
|
34372
|
+
facet = _ref4.facet;
|
|
34349
34373
|
|
|
34350
34374
|
var _a;
|
|
34351
34375
|
|
|
@@ -34356,7 +34380,8 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
|
|
|
34356
34380
|
name: QUERY_PARAMS.QUERY,
|
|
34357
34381
|
value: searchText
|
|
34358
34382
|
}].concat(facetParam),
|
|
34359
|
-
paramsToRemove: "all"
|
|
34383
|
+
paramsToRemove: "all",
|
|
34384
|
+
searchResultsLink: this.searchResultsLink
|
|
34360
34385
|
});
|
|
34361
34386
|
} else {
|
|
34362
34387
|
var routing = (_a = this.context.rootGetters["options/boxRoutingBehavior"]) !== null && _a !== void 0 ? _a : "direct-link";
|
|
@@ -34376,13 +34401,14 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
|
|
|
34376
34401
|
}
|
|
34377
34402
|
}, {
|
|
34378
34403
|
key: "appendParams",
|
|
34379
|
-
value: function appendParams(
|
|
34380
|
-
var params =
|
|
34381
|
-
paramsToRemove =
|
|
34382
|
-
|
|
34383
|
-
encode =
|
|
34384
|
-
|
|
34385
|
-
save =
|
|
34404
|
+
value: function appendParams(_ref5) {
|
|
34405
|
+
var params = _ref5.params,
|
|
34406
|
+
paramsToRemove = _ref5.paramsToRemove,
|
|
34407
|
+
_ref5$encode = _ref5.encode,
|
|
34408
|
+
encode = _ref5$encode === void 0 ? true : _ref5$encode,
|
|
34409
|
+
_ref5$save = _ref5.save,
|
|
34410
|
+
save = _ref5$save === void 0 ? true : _ref5$save,
|
|
34411
|
+
searchResultsLink = _ref5.searchResultsLink;
|
|
34386
34412
|
|
|
34387
34413
|
if (!(params === null || params === void 0 ? void 0 : params.length)) {
|
|
34388
34414
|
return {
|
|
@@ -34390,7 +34416,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
|
|
|
34390
34416
|
};
|
|
34391
34417
|
}
|
|
34392
34418
|
|
|
34393
|
-
var url =
|
|
34419
|
+
var url = getPageUrl(searchResultsLink);
|
|
34394
34420
|
paramsToRemove = getRemovableParams(url, paramsToRemove);
|
|
34395
34421
|
|
|
34396
34422
|
removeParams(url, paramsToRemove);
|
|
@@ -34449,6 +34475,8 @@ __decorate([Action({
|
|
|
34449
34475
|
commit: "save"
|
|
34450
34476
|
})], ParamsModule.prototype, "removeParams", null);
|
|
34451
34477
|
|
|
34478
|
+
__decorate([Action({})], ParamsModule.prototype, "handleNoResultsFlag", null);
|
|
34479
|
+
|
|
34452
34480
|
__decorate([Action({})], ParamsModule.prototype, "goToResults", null);
|
|
34453
34481
|
|
|
34454
34482
|
__decorate([Action({
|
|
@@ -32,11 +32,15 @@ export default class ParamsModule extends VuexModule {
|
|
|
32
32
|
params?: QueryParams;
|
|
33
33
|
searchString?: string;
|
|
34
34
|
};
|
|
35
|
+
handleNoResultsFlag({ resultCount, noResultsParam, }: {
|
|
36
|
+
resultCount: number;
|
|
37
|
+
noResultsParam?: string;
|
|
38
|
+
}): void;
|
|
35
39
|
goToResults({ searchText, facet, }: {
|
|
36
40
|
searchText: string;
|
|
37
41
|
facet?: InputSuggestionFacet;
|
|
38
42
|
}): void;
|
|
39
|
-
appendParams({ params, paramsToRemove, encode, save, }: {
|
|
43
|
+
appendParams({ params, paramsToRemove, encode, save, searchResultsLink, }: {
|
|
40
44
|
params: {
|
|
41
45
|
name: string;
|
|
42
46
|
value: string;
|
|
@@ -44,6 +48,7 @@ export default class ParamsModule extends VuexModule {
|
|
|
44
48
|
paramsToRemove?: "all" | string[];
|
|
45
49
|
encode?: boolean;
|
|
46
50
|
save?: boolean;
|
|
51
|
+
searchResultsLink?: string;
|
|
47
52
|
}): {
|
|
48
53
|
params?: QueryParams;
|
|
49
54
|
searchString?: string;
|
|
@@ -3,3 +3,4 @@ import { RoutingBehavior } from "..";
|
|
|
3
3
|
export declare const emitRoutingEvent: (url: string) => void;
|
|
4
4
|
export declare const handleRoutingEvent: (link: string, event?: Event | undefined, hasEventRouting?: boolean) => void;
|
|
5
5
|
export declare const redirectToResultsPage: (link: string, searchText: string, facet?: InputSuggestionFacet | undefined, routingBehavior?: RoutingBehavior) => void;
|
|
6
|
+
export declare const getPageUrl: (pathnameOverride?: string | undefined) => URL;
|
|
@@ -4,12 +4,14 @@ import { DocumentSearchBoxPanel } from "@/types/search-box/SearchBoxPanel";
|
|
|
4
4
|
import { SearchBoxOptionLabels } from "@/types/search-box/SearchBoxOptions";
|
|
5
5
|
import { DocumentElement } from "@/types/DocumentElement";
|
|
6
6
|
import { TrackableEventData } from "@/types/search-box/Common";
|
|
7
|
+
import { RoutingBehavior } from "@/types/search-results/RoutingBehavior";
|
|
7
8
|
export default class SearchBoxProduct extends Vue {
|
|
8
9
|
item: Document;
|
|
9
10
|
inputValue: string;
|
|
10
11
|
panelOptions: DocumentSearchBoxPanel;
|
|
11
12
|
labels?: SearchBoxOptionLabels;
|
|
12
13
|
highlighted?: boolean;
|
|
14
|
+
boxRoutingBehavior: RoutingBehavior;
|
|
13
15
|
trackClick: ({ queryKey, data, }: {
|
|
14
16
|
queryKey: string;
|
|
15
17
|
data: TrackableEventData;
|
|
@@ -21,5 +23,5 @@ export default class SearchBoxProduct extends Vue {
|
|
|
21
23
|
get imageElements(): DocumentElement[];
|
|
22
24
|
get detailElements(): DocumentElement[];
|
|
23
25
|
get id(): string;
|
|
24
|
-
handleClick(): void;
|
|
26
|
+
handleClick(event?: Event): void;
|
|
25
27
|
}
|
|
@@ -25,6 +25,10 @@ export default class SearchResults extends Vue {
|
|
|
25
25
|
setDefaultLimit: (defaultLimit: number) => {
|
|
26
26
|
defaultLimit: number;
|
|
27
27
|
};
|
|
28
|
+
handleNoResultsFlag: ({ resultCount, noResultsParam, }: {
|
|
29
|
+
resultCount: number;
|
|
30
|
+
noResultsParam?: string;
|
|
31
|
+
}) => void;
|
|
28
32
|
addParams: (params: QueryParams) => {
|
|
29
33
|
params: QueryParams;
|
|
30
34
|
};
|