@getlupa/client 0.8.0-alpha-1 → 0.8.0-alpha-4

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.
@@ -20695,6 +20695,10 @@ __vue_render__$5._withStripped = true;
20695
20695
  undefined
20696
20696
  );
20697
20697
 
20698
+ const setDocumentTitle = (template, textToInsert = "") => {
20699
+ document.title = addParamsToLabel(template, textToInsert);
20700
+ };
20701
+
20698
20702
  const searchResult$1 = namespace("searchResult");
20699
20703
  const params$1 = namespace("params");
20700
20704
  const options$1 = namespace("options");
@@ -20742,6 +20746,9 @@ let SearchResults = class SearchResults extends Vue$1 {
20742
20746
  }
20743
20747
  handleMounted() {
20744
20748
  this.handleResize();
20749
+ if (this.isProductList) {
20750
+ setDocumentTitle(this.options.labels.htmlTitleTemplate, "");
20751
+ }
20745
20752
  const params = new URLSearchParams(window.location.search);
20746
20753
  this.handleUrlChange(params);
20747
20754
  this.addParams(parseParams(params));
@@ -21945,10 +21952,6 @@ HistoryModule = __decorate([
21945
21952
  ], HistoryModule);
21946
21953
  var history = HistoryModule;
21947
21954
 
21948
- const setDocumentTitle = (template, textToInsert = "") => {
21949
- document.title = addParamsToLabel(template, textToInsert);
21950
- };
21951
-
21952
21955
  let SearchResultModule = class SearchResultModule extends VuexModule {
21953
21956
  constructor() {
21954
21957
  super(...arguments);
@@ -22241,7 +22244,7 @@ let ParamsModule = class ParamsModule extends VuexModule {
22241
22244
  goToResults({ searchText, facet, }) {
22242
22245
  var _a;
22243
22246
  if (!this.searchResultsLink ||
22244
- this.searchResultsLink === window.location.pathname) {
22247
+ linksMatch(this.searchResultsLink, window.location.pathname)) {
22245
22248
  const facetParam = facet ? [getFacetParam(facet.key, [facet.title])] : [];
22246
22249
  this.context.dispatch("appendParams", {
22247
22250
  params: [
@@ -22472,7 +22475,7 @@ const app = {
22472
22475
  const tracking = (options) => {
22473
22476
  initTracking(options);
22474
22477
  };
22475
- const searchBox = (options, mountOptions) => {
22478
+ const applySearchBox = (options, mountOptions) => {
22476
22479
  const existingInstance = app.box[options.inputSelector];
22477
22480
  if (existingInstance) {
22478
22481
  existingInstance.searchBoxOptions = options;
@@ -22493,6 +22496,15 @@ const searchBox = (options, mountOptions) => {
22493
22496
  });
22494
22497
  app.box[options.inputSelector] = instance;
22495
22498
  };
22499
+ const searchBox = (options, mountOptions) => {
22500
+ var _a;
22501
+ // Support for multiple search box selectors separated by a comma
22502
+ // Quite often multiple search boxes are required, since mobile and desktop has different inputs in html layout
22503
+ const inputs = (_a = options.inputSelector) === null || _a === void 0 ? void 0 : _a.split(",");
22504
+ for (const input of inputs) {
22505
+ applySearchBox(Object.assign(Object.assign({}, options), { inputSelector: input.trim() }), mountOptions);
22506
+ }
22507
+ };
22496
22508
  const searchResults = (options, mountOptions) => {
22497
22509
  const existingInstance = app.results[options.containerSelector];
22498
22510
  if (existingInstance) {
@@ -20691,6 +20691,10 @@ __vue_render__$5._withStripped = true;
20691
20691
  undefined
20692
20692
  );
20693
20693
 
20694
+ const setDocumentTitle = (template, textToInsert = "") => {
20695
+ document.title = addParamsToLabel(template, textToInsert);
20696
+ };
20697
+
20694
20698
  const searchResult$1 = namespace("searchResult");
20695
20699
  const params$1 = namespace("params");
20696
20700
  const options$1 = namespace("options");
@@ -20738,6 +20742,9 @@ let SearchResults = class SearchResults extends Vue$1 {
20738
20742
  }
20739
20743
  handleMounted() {
20740
20744
  this.handleResize();
20745
+ if (this.isProductList) {
20746
+ setDocumentTitle(this.options.labels.htmlTitleTemplate, "");
20747
+ }
20741
20748
  const params = new URLSearchParams(window.location.search);
20742
20749
  this.handleUrlChange(params);
20743
20750
  this.addParams(parseParams(params));
@@ -21941,10 +21948,6 @@ HistoryModule = __decorate([
21941
21948
  ], HistoryModule);
21942
21949
  var history = HistoryModule;
21943
21950
 
21944
- const setDocumentTitle = (template, textToInsert = "") => {
21945
- document.title = addParamsToLabel(template, textToInsert);
21946
- };
21947
-
21948
21951
  let SearchResultModule = class SearchResultModule extends VuexModule {
21949
21952
  constructor() {
21950
21953
  super(...arguments);
@@ -22237,7 +22240,7 @@ let ParamsModule = class ParamsModule extends VuexModule {
22237
22240
  goToResults({ searchText, facet, }) {
22238
22241
  var _a;
22239
22242
  if (!this.searchResultsLink ||
22240
- this.searchResultsLink === window.location.pathname) {
22243
+ linksMatch(this.searchResultsLink, window.location.pathname)) {
22241
22244
  const facetParam = facet ? [getFacetParam(facet.key, [facet.title])] : [];
22242
22245
  this.context.dispatch("appendParams", {
22243
22246
  params: [
@@ -22468,7 +22471,7 @@ const app = {
22468
22471
  const tracking = (options) => {
22469
22472
  initTracking(options);
22470
22473
  };
22471
- const searchBox = (options, mountOptions) => {
22474
+ const applySearchBox = (options, mountOptions) => {
22472
22475
  const existingInstance = app.box[options.inputSelector];
22473
22476
  if (existingInstance) {
22474
22477
  existingInstance.searchBoxOptions = options;
@@ -22489,6 +22492,15 @@ const searchBox = (options, mountOptions) => {
22489
22492
  });
22490
22493
  app.box[options.inputSelector] = instance;
22491
22494
  };
22495
+ const searchBox = (options, mountOptions) => {
22496
+ var _a;
22497
+ // Support for multiple search box selectors separated by a comma
22498
+ // Quite often multiple search boxes are required, since mobile and desktop has different inputs in html layout
22499
+ const inputs = (_a = options.inputSelector) === null || _a === void 0 ? void 0 : _a.split(",");
22500
+ for (const input of inputs) {
22501
+ applySearchBox(Object.assign(Object.assign({}, options), { inputSelector: input.trim() }), mountOptions);
22502
+ }
22503
+ };
22492
22504
  const searchResults = (options, mountOptions) => {
22493
22505
  const existingInstance = app.results[options.containerSelector];
22494
22506
  if (existingInstance) {