@getlupa/client 0.7.0-alpha-23 → 0.8.0-alpha-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.
@@ -3,4 +3,5 @@ import { ProductListOptions } from "./types/product-list/ProductListOptions";
3
3
  export default class ProductListEntry extends Vue {
4
4
  productListOptions: ProductListOptions;
5
5
  get fullProductListOptions(): ProductListOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import Vue from "vue";
3
3
  export default class SearchBoxEntry extends Vue {
4
4
  searchBoxOptions: SearchBoxOptions;
5
5
  get fullSearchBoxOptions(): SearchBoxOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import { SearchResultsOptions } from "./types/search-results/SearchResultsOption
3
3
  export default class SearchResultsEntry extends Vue {
4
4
  searchResultsOptions: SearchResultsOptions;
5
5
  get fullSearchResultsOptions(): SearchResultsOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import { ProductListOptions } from "@/types/product-list/ProductListOptions";
3
3
  export default class ProductList extends Vue {
4
4
  options: ProductListOptions;
5
5
  get componentOptions(): ProductListOptions;
6
+ fetch(): void;
6
7
  }
@@ -8,14 +8,17 @@ import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
9
  import { BadgeGenerateOptions, BadgeGenerateSeed, BadgeOptions, BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
10
10
  import { SearchResultsSortOptions, SortOptions } from "./types/search-results/SearchResultsSort";
11
+ declare type MountOptions = {
12
+ fetch: boolean;
13
+ };
11
14
  declare const lupaSearch: {
12
- searchBox: (options: SearchBoxOptions) => void;
13
- searchResults: (options: SearchResultsOptions) => void;
15
+ searchBox: (options: SearchBoxOptions, mountOptions?: MountOptions | undefined) => void;
16
+ searchResults: (options: SearchResultsOptions, mountOptions?: MountOptions | undefined) => void;
14
17
  tracking: (options: TrackingOptions) => void;
15
- productList: (options: ProductListOptions) => void;
16
- clearSearchBox: () => void;
17
- clearSearchResults: () => void;
18
- clearProductList: () => void;
18
+ productList: (options: ProductListOptions, mountOptions?: MountOptions | undefined) => void;
19
+ clearSearchBox: (selector?: string | undefined) => void;
20
+ clearSearchResults: (selector?: string | undefined) => void;
21
+ clearProductList: (selector?: string | undefined) => void;
19
22
  };
20
- export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, };
23
+ export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, };
21
24
  export default lupaSearch;
@@ -13899,6 +13899,11 @@ let SearchBoxEntry = class SearchBoxEntry extends Vue$1 {
13899
13899
  const options = cloneDeep(this.searchBoxOptions);
13900
13900
  return merge(DEFAULT_SEARCH_BOX_OPTIONS, options);
13901
13901
  }
13902
+ fetch() {
13903
+ var _a;
13904
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13905
+ (_a = this.$refs.searchBox) === null || _a === void 0 ? void 0 : _a.handleCurrentValueSearch();
13906
+ }
13902
13907
  };
13903
13908
  __decorate([
13904
13909
  Prop()
@@ -13921,7 +13926,10 @@ var __vue_render__$R = function () {
13921
13926
  var _vm = this;
13922
13927
  var _h = _vm.$createElement;
13923
13928
  var _c = _vm._self._c || _h;
13924
- return _c("SearchBox", { attrs: { options: _vm.fullSearchBoxOptions } })
13929
+ return _c("SearchBox", {
13930
+ ref: "searchBox",
13931
+ attrs: { options: _vm.fullSearchBoxOptions },
13932
+ })
13925
13933
  };
13926
13934
  var __vue_staticRenderFns__$R = [];
13927
13935
  __vue_render__$R._withStripped = true;
@@ -17044,7 +17052,11 @@ var __vue_render__$x = function () {
17044
17052
  })
17045
17053
  }),
17046
17054
  _vm._v(" "),
17047
- _c("SearchResultGeneratedBadges", { attrs: { options: _vm.options } }),
17055
+ _vm.position === "card"
17056
+ ? _c("SearchResultGeneratedBadges", {
17057
+ attrs: { options: _vm.options },
17058
+ })
17059
+ : _vm._e(),
17048
17060
  ],
17049
17061
  2
17050
17062
  ),
@@ -21037,6 +21049,11 @@ let SearchResultsEntry = class SearchResultsEntry extends Vue$1 {
21037
21049
  const options = cloneDeep(this.searchResultsOptions);
21038
21050
  return merge(DEFAULT_OPTIONS_RESULTS, options);
21039
21051
  }
21052
+ fetch() {
21053
+ var _a;
21054
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21055
+ (_a = this.$refs.searchResults) === null || _a === void 0 ? void 0 : _a.handleMounted();
21056
+ }
21040
21057
  };
21041
21058
  __decorate([
21042
21059
  Prop()
@@ -21060,6 +21077,7 @@ var __vue_render__$3 = function () {
21060
21077
  var _h = _vm.$createElement;
21061
21078
  var _c = _vm._self._c || _h;
21062
21079
  return _c("SearchResults", {
21080
+ ref: "searchResults",
21063
21081
  attrs: { options: _vm.fullSearchResultsOptions },
21064
21082
  })
21065
21083
  };
@@ -21171,6 +21189,11 @@ let ProductList = class ProductList extends Vue$1 {
21171
21189
  get componentOptions() {
21172
21190
  return Object.assign(Object.assign({}, this.options), { filters: Object.assign(Object.assign({}, this.options.filters), { categories: this.options.categories }) });
21173
21191
  }
21192
+ fetch() {
21193
+ var _a;
21194
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21195
+ (_a = this.$refs.searchResults) === null || _a === void 0 ? void 0 : _a.handleMounted();
21196
+ }
21174
21197
  };
21175
21198
  __decorate([
21176
21199
  Prop()
@@ -21200,6 +21223,7 @@ var __vue_render__$1 = function () {
21200
21223
  _c(
21201
21224
  "SearchResults",
21202
21225
  {
21226
+ ref: "searchResults",
21203
21227
  attrs: {
21204
21228
  options: _vm.componentOptions,
21205
21229
  "initial-filters": _vm.options.initialFilters,
@@ -21249,6 +21273,11 @@ let ProductListEntry = class ProductListEntry extends Vue$1 {
21249
21273
  get fullProductListOptions() {
21250
21274
  return cloneDeep(this.productListOptions);
21251
21275
  }
21276
+ fetch() {
21277
+ var _a;
21278
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21279
+ (_a = this.$refs.productList) === null || _a === void 0 ? void 0 : _a.fetch();
21280
+ }
21252
21281
  };
21253
21282
  __decorate([
21254
21283
  Prop()
@@ -21271,7 +21300,10 @@ var __vue_render__ = function () {
21271
21300
  var _vm = this;
21272
21301
  var _h = _vm.$createElement;
21273
21302
  var _c = _vm._self._c || _h;
21274
- return _c("ProductList", { attrs: { options: _vm.productListOptions } })
21303
+ return _c("ProductList", {
21304
+ ref: "productList",
21305
+ attrs: { options: _vm.productListOptions },
21306
+ })
21275
21307
  };
21276
21308
  var __vue_staticRenderFns__ = [];
21277
21309
  __vue_render__._withStripped = true;
@@ -22440,57 +22472,117 @@ const app = {
22440
22472
  const tracking = (options) => {
22441
22473
  initTracking(options);
22442
22474
  };
22443
- const searchBox = (options) => {
22475
+ const searchBox = (options, mountOptions) => {
22476
+ const existingInstance = app.box[options.inputSelector];
22477
+ if (existingInstance) {
22478
+ existingInstance.searchBoxOptions = options;
22479
+ if (mountOptions === null || mountOptions === void 0 ? void 0 : mountOptions.fetch) {
22480
+ setTimeout(() => {
22481
+ var _a;
22482
+ (_a = existingInstance.fetch) === null || _a === void 0 ? void 0 : _a.call(existingInstance);
22483
+ });
22484
+ }
22485
+ return;
22486
+ }
22444
22487
  Vue$1.use(Vuex);
22445
- app.box = new Vue$1({
22488
+ const SearchBoxEntryComponent = Vue$1.component("SearchBoxEntry", __vue_component__$R);
22489
+ const instance = new SearchBoxEntryComponent({
22446
22490
  el: options.inputSelector,
22447
- components: { SearchBoxEntry: __vue_component__$R },
22448
- render: (h) => h(__vue_component__$R, { props: { searchBoxOptions: options } }),
22491
+ propsData: { searchBoxOptions: options },
22449
22492
  store,
22450
22493
  });
22494
+ app.box[options.inputSelector] = instance;
22451
22495
  };
22452
- const searchResults = (options) => {
22496
+ const searchResults = (options, mountOptions) => {
22497
+ const existingInstance = app.results[options.containerSelector];
22498
+ if (existingInstance) {
22499
+ existingInstance.searchResultsOptions = options;
22500
+ if (mountOptions === null || mountOptions === void 0 ? void 0 : mountOptions.fetch) {
22501
+ setTimeout(() => {
22502
+ var _a;
22503
+ (_a = existingInstance.fetch) === null || _a === void 0 ? void 0 : _a.call(existingInstance);
22504
+ });
22505
+ }
22506
+ return;
22507
+ }
22453
22508
  Vue$1.use(Vuex);
22454
- app.results = new Vue$1({
22509
+ const SearchResultsEntryComponent = Vue$1.component("SearchResultsEntry", __vue_component__$3);
22510
+ const instance = new SearchResultsEntryComponent({
22455
22511
  el: options.containerSelector,
22456
- components: { SearchResultsEntry: __vue_component__$3 },
22457
- render: (h) => h(__vue_component__$3, { props: { searchResultsOptions: options } }),
22512
+ propsData: { searchResultsOptions: options },
22458
22513
  store,
22459
22514
  });
22515
+ app.results[options.containerSelector] = instance;
22460
22516
  };
22461
- const productList = (options) => {
22517
+ const productList = (options, mountOptions) => {
22518
+ const existingInstance = app.productList[options.containerSelector];
22519
+ if (existingInstance) {
22520
+ existingInstance.productListOptions = options;
22521
+ if (mountOptions === null || mountOptions === void 0 ? void 0 : mountOptions.fetch) {
22522
+ setTimeout(() => {
22523
+ var _a;
22524
+ (_a = existingInstance.fetch) === null || _a === void 0 ? void 0 : _a.call(existingInstance);
22525
+ });
22526
+ }
22527
+ return;
22528
+ }
22462
22529
  Vue$1.use(Vuex);
22463
- app.productList = new Vue$1({
22530
+ const ProductListEntryComponent = Vue$1.component("ProductListEntry", __vue_component__);
22531
+ const instance = new ProductListEntryComponent({
22464
22532
  el: options.containerSelector,
22465
- components: { ProductListEntry: __vue_component__ },
22466
- render: (h) => h(__vue_component__, { props: { productListOptions: options } }),
22533
+ propsData: { productListOptions: options },
22467
22534
  store,
22468
22535
  });
22536
+ app.productList[options.containerSelector] = instance;
22469
22537
  };
22470
- const clearSearchBox = () => {
22471
- var _a;
22538
+ const clearSearchBox = (selector) => {
22472
22539
  try {
22473
- (_a = app.box) === null || _a === void 0 ? void 0 : _a.$destroy();
22540
+ if (selector) {
22541
+ const instance = app.box[selector];
22542
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22543
+ return;
22544
+ }
22545
+ for (const key in app.box) {
22546
+ const instance = app.box[key];
22547
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22548
+ }
22549
+ app.box = {};
22474
22550
  }
22475
- catch (_b) {
22551
+ catch (_a) {
22476
22552
  // do nothing, already destroyed;
22477
22553
  }
22478
22554
  };
22479
- const clearSearchResults = () => {
22480
- var _a;
22555
+ const clearSearchResults = (selector) => {
22481
22556
  try {
22482
- (_a = app.results) === null || _a === void 0 ? void 0 : _a.$destroy();
22557
+ if (selector) {
22558
+ const instance = app.box[selector];
22559
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22560
+ return;
22561
+ }
22562
+ for (const key in app.results) {
22563
+ const instance = app.results[key];
22564
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22565
+ }
22566
+ app.results = {};
22483
22567
  }
22484
- catch (_b) {
22568
+ catch (_a) {
22485
22569
  // do nothing, already destroyed;
22486
22570
  }
22487
22571
  };
22488
- const clearProductList = () => {
22489
- var _a;
22572
+ const clearProductList = (selector) => {
22490
22573
  try {
22491
- (_a = app.productList) === null || _a === void 0 ? void 0 : _a.$destroy();
22574
+ if (selector) {
22575
+ const instance = app.box[selector];
22576
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22577
+ return;
22578
+ }
22579
+ for (const key in app.productList) {
22580
+ const instance = app.productList[key];
22581
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22582
+ }
22583
+ app.productList = {};
22492
22584
  }
22493
- catch (_b) {
22585
+ catch (_a) {
22494
22586
  // do nothing, already destroyed;
22495
22587
  }
22496
22588
  };
@@ -3,4 +3,5 @@ import { ProductListOptions } from "./types/product-list/ProductListOptions";
3
3
  export default class ProductListEntry extends Vue {
4
4
  productListOptions: ProductListOptions;
5
5
  get fullProductListOptions(): ProductListOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import Vue from "vue";
3
3
  export default class SearchBoxEntry extends Vue {
4
4
  searchBoxOptions: SearchBoxOptions;
5
5
  get fullSearchBoxOptions(): SearchBoxOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import { SearchResultsOptions } from "./types/search-results/SearchResultsOption
3
3
  export default class SearchResultsEntry extends Vue {
4
4
  searchResultsOptions: SearchResultsOptions;
5
5
  get fullSearchResultsOptions(): SearchResultsOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import { ProductListOptions } from "@/types/product-list/ProductListOptions";
3
3
  export default class ProductList extends Vue {
4
4
  options: ProductListOptions;
5
5
  get componentOptions(): ProductListOptions;
6
+ fetch(): void;
6
7
  }
@@ -8,14 +8,17 @@ import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
9
  import { BadgeGenerateOptions, BadgeGenerateSeed, BadgeOptions, BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
10
10
  import { SearchResultsSortOptions, SortOptions } from "./types/search-results/SearchResultsSort";
11
+ declare type MountOptions = {
12
+ fetch: boolean;
13
+ };
11
14
  declare const lupaSearch: {
12
- searchBox: (options: SearchBoxOptions) => void;
13
- searchResults: (options: SearchResultsOptions) => void;
15
+ searchBox: (options: SearchBoxOptions, mountOptions?: MountOptions | undefined) => void;
16
+ searchResults: (options: SearchResultsOptions, mountOptions?: MountOptions | undefined) => void;
14
17
  tracking: (options: TrackingOptions) => void;
15
- productList: (options: ProductListOptions) => void;
16
- clearSearchBox: () => void;
17
- clearSearchResults: () => void;
18
- clearProductList: () => void;
18
+ productList: (options: ProductListOptions, mountOptions?: MountOptions | undefined) => void;
19
+ clearSearchBox: (selector?: string | undefined) => void;
20
+ clearSearchResults: (selector?: string | undefined) => void;
21
+ clearProductList: (selector?: string | undefined) => void;
19
22
  };
20
- export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, };
23
+ export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, };
21
24
  export default lupaSearch;
@@ -13895,6 +13895,11 @@ let SearchBoxEntry = class SearchBoxEntry extends Vue$1 {
13895
13895
  const options = cloneDeep(this.searchBoxOptions);
13896
13896
  return merge(DEFAULT_SEARCH_BOX_OPTIONS, options);
13897
13897
  }
13898
+ fetch() {
13899
+ var _a;
13900
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13901
+ (_a = this.$refs.searchBox) === null || _a === void 0 ? void 0 : _a.handleCurrentValueSearch();
13902
+ }
13898
13903
  };
13899
13904
  __decorate([
13900
13905
  Prop()
@@ -13917,7 +13922,10 @@ var __vue_render__$R = function () {
13917
13922
  var _vm = this;
13918
13923
  var _h = _vm.$createElement;
13919
13924
  var _c = _vm._self._c || _h;
13920
- return _c("SearchBox", { attrs: { options: _vm.fullSearchBoxOptions } })
13925
+ return _c("SearchBox", {
13926
+ ref: "searchBox",
13927
+ attrs: { options: _vm.fullSearchBoxOptions },
13928
+ })
13921
13929
  };
13922
13930
  var __vue_staticRenderFns__$R = [];
13923
13931
  __vue_render__$R._withStripped = true;
@@ -17040,7 +17048,11 @@ var __vue_render__$x = function () {
17040
17048
  })
17041
17049
  }),
17042
17050
  _vm._v(" "),
17043
- _c("SearchResultGeneratedBadges", { attrs: { options: _vm.options } }),
17051
+ _vm.position === "card"
17052
+ ? _c("SearchResultGeneratedBadges", {
17053
+ attrs: { options: _vm.options },
17054
+ })
17055
+ : _vm._e(),
17044
17056
  ],
17045
17057
  2
17046
17058
  ),
@@ -21033,6 +21045,11 @@ let SearchResultsEntry = class SearchResultsEntry extends Vue$1 {
21033
21045
  const options = cloneDeep(this.searchResultsOptions);
21034
21046
  return merge(DEFAULT_OPTIONS_RESULTS, options);
21035
21047
  }
21048
+ fetch() {
21049
+ var _a;
21050
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21051
+ (_a = this.$refs.searchResults) === null || _a === void 0 ? void 0 : _a.handleMounted();
21052
+ }
21036
21053
  };
21037
21054
  __decorate([
21038
21055
  Prop()
@@ -21056,6 +21073,7 @@ var __vue_render__$3 = function () {
21056
21073
  var _h = _vm.$createElement;
21057
21074
  var _c = _vm._self._c || _h;
21058
21075
  return _c("SearchResults", {
21076
+ ref: "searchResults",
21059
21077
  attrs: { options: _vm.fullSearchResultsOptions },
21060
21078
  })
21061
21079
  };
@@ -21167,6 +21185,11 @@ let ProductList = class ProductList extends Vue$1 {
21167
21185
  get componentOptions() {
21168
21186
  return Object.assign(Object.assign({}, this.options), { filters: Object.assign(Object.assign({}, this.options.filters), { categories: this.options.categories }) });
21169
21187
  }
21188
+ fetch() {
21189
+ var _a;
21190
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21191
+ (_a = this.$refs.searchResults) === null || _a === void 0 ? void 0 : _a.handleMounted();
21192
+ }
21170
21193
  };
21171
21194
  __decorate([
21172
21195
  Prop()
@@ -21196,6 +21219,7 @@ var __vue_render__$1 = function () {
21196
21219
  _c(
21197
21220
  "SearchResults",
21198
21221
  {
21222
+ ref: "searchResults",
21199
21223
  attrs: {
21200
21224
  options: _vm.componentOptions,
21201
21225
  "initial-filters": _vm.options.initialFilters,
@@ -21245,6 +21269,11 @@ let ProductListEntry = class ProductListEntry extends Vue$1 {
21245
21269
  get fullProductListOptions() {
21246
21270
  return cloneDeep(this.productListOptions);
21247
21271
  }
21272
+ fetch() {
21273
+ var _a;
21274
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21275
+ (_a = this.$refs.productList) === null || _a === void 0 ? void 0 : _a.fetch();
21276
+ }
21248
21277
  };
21249
21278
  __decorate([
21250
21279
  Prop()
@@ -21267,7 +21296,10 @@ var __vue_render__ = function () {
21267
21296
  var _vm = this;
21268
21297
  var _h = _vm.$createElement;
21269
21298
  var _c = _vm._self._c || _h;
21270
- return _c("ProductList", { attrs: { options: _vm.productListOptions } })
21299
+ return _c("ProductList", {
21300
+ ref: "productList",
21301
+ attrs: { options: _vm.productListOptions },
21302
+ })
21271
21303
  };
21272
21304
  var __vue_staticRenderFns__ = [];
21273
21305
  __vue_render__._withStripped = true;
@@ -22436,57 +22468,117 @@ const app = {
22436
22468
  const tracking = (options) => {
22437
22469
  initTracking(options);
22438
22470
  };
22439
- const searchBox = (options) => {
22471
+ const searchBox = (options, mountOptions) => {
22472
+ const existingInstance = app.box[options.inputSelector];
22473
+ if (existingInstance) {
22474
+ existingInstance.searchBoxOptions = options;
22475
+ if (mountOptions === null || mountOptions === void 0 ? void 0 : mountOptions.fetch) {
22476
+ setTimeout(() => {
22477
+ var _a;
22478
+ (_a = existingInstance.fetch) === null || _a === void 0 ? void 0 : _a.call(existingInstance);
22479
+ });
22480
+ }
22481
+ return;
22482
+ }
22440
22483
  Vue$1.use(Vuex);
22441
- app.box = new Vue$1({
22484
+ const SearchBoxEntryComponent = Vue$1.component("SearchBoxEntry", __vue_component__$R);
22485
+ const instance = new SearchBoxEntryComponent({
22442
22486
  el: options.inputSelector,
22443
- components: { SearchBoxEntry: __vue_component__$R },
22444
- render: (h) => h(__vue_component__$R, { props: { searchBoxOptions: options } }),
22487
+ propsData: { searchBoxOptions: options },
22445
22488
  store,
22446
22489
  });
22490
+ app.box[options.inputSelector] = instance;
22447
22491
  };
22448
- const searchResults = (options) => {
22492
+ const searchResults = (options, mountOptions) => {
22493
+ const existingInstance = app.results[options.containerSelector];
22494
+ if (existingInstance) {
22495
+ existingInstance.searchResultsOptions = options;
22496
+ if (mountOptions === null || mountOptions === void 0 ? void 0 : mountOptions.fetch) {
22497
+ setTimeout(() => {
22498
+ var _a;
22499
+ (_a = existingInstance.fetch) === null || _a === void 0 ? void 0 : _a.call(existingInstance);
22500
+ });
22501
+ }
22502
+ return;
22503
+ }
22449
22504
  Vue$1.use(Vuex);
22450
- app.results = new Vue$1({
22505
+ const SearchResultsEntryComponent = Vue$1.component("SearchResultsEntry", __vue_component__$3);
22506
+ const instance = new SearchResultsEntryComponent({
22451
22507
  el: options.containerSelector,
22452
- components: { SearchResultsEntry: __vue_component__$3 },
22453
- render: (h) => h(__vue_component__$3, { props: { searchResultsOptions: options } }),
22508
+ propsData: { searchResultsOptions: options },
22454
22509
  store,
22455
22510
  });
22511
+ app.results[options.containerSelector] = instance;
22456
22512
  };
22457
- const productList = (options) => {
22513
+ const productList = (options, mountOptions) => {
22514
+ const existingInstance = app.productList[options.containerSelector];
22515
+ if (existingInstance) {
22516
+ existingInstance.productListOptions = options;
22517
+ if (mountOptions === null || mountOptions === void 0 ? void 0 : mountOptions.fetch) {
22518
+ setTimeout(() => {
22519
+ var _a;
22520
+ (_a = existingInstance.fetch) === null || _a === void 0 ? void 0 : _a.call(existingInstance);
22521
+ });
22522
+ }
22523
+ return;
22524
+ }
22458
22525
  Vue$1.use(Vuex);
22459
- app.productList = new Vue$1({
22526
+ const ProductListEntryComponent = Vue$1.component("ProductListEntry", __vue_component__);
22527
+ const instance = new ProductListEntryComponent({
22460
22528
  el: options.containerSelector,
22461
- components: { ProductListEntry: __vue_component__ },
22462
- render: (h) => h(__vue_component__, { props: { productListOptions: options } }),
22529
+ propsData: { productListOptions: options },
22463
22530
  store,
22464
22531
  });
22532
+ app.productList[options.containerSelector] = instance;
22465
22533
  };
22466
- const clearSearchBox = () => {
22467
- var _a;
22534
+ const clearSearchBox = (selector) => {
22468
22535
  try {
22469
- (_a = app.box) === null || _a === void 0 ? void 0 : _a.$destroy();
22536
+ if (selector) {
22537
+ const instance = app.box[selector];
22538
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22539
+ return;
22540
+ }
22541
+ for (const key in app.box) {
22542
+ const instance = app.box[key];
22543
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22544
+ }
22545
+ app.box = {};
22470
22546
  }
22471
- catch (_b) {
22547
+ catch (_a) {
22472
22548
  // do nothing, already destroyed;
22473
22549
  }
22474
22550
  };
22475
- const clearSearchResults = () => {
22476
- var _a;
22551
+ const clearSearchResults = (selector) => {
22477
22552
  try {
22478
- (_a = app.results) === null || _a === void 0 ? void 0 : _a.$destroy();
22553
+ if (selector) {
22554
+ const instance = app.box[selector];
22555
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22556
+ return;
22557
+ }
22558
+ for (const key in app.results) {
22559
+ const instance = app.results[key];
22560
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22561
+ }
22562
+ app.results = {};
22479
22563
  }
22480
- catch (_b) {
22564
+ catch (_a) {
22481
22565
  // do nothing, already destroyed;
22482
22566
  }
22483
22567
  };
22484
- const clearProductList = () => {
22485
- var _a;
22568
+ const clearProductList = (selector) => {
22486
22569
  try {
22487
- (_a = app.productList) === null || _a === void 0 ? void 0 : _a.$destroy();
22570
+ if (selector) {
22571
+ const instance = app.box[selector];
22572
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22573
+ return;
22574
+ }
22575
+ for (const key in app.productList) {
22576
+ const instance = app.productList[key];
22577
+ instance === null || instance === void 0 ? void 0 : instance.$destroy();
22578
+ }
22579
+ app.productList = {};
22488
22580
  }
22489
- catch (_b) {
22581
+ catch (_a) {
22490
22582
  // do nothing, already destroyed;
22491
22583
  }
22492
22584
  };
@@ -3,4 +3,5 @@ import { ProductListOptions } from "./types/product-list/ProductListOptions";
3
3
  export default class ProductListEntry extends Vue {
4
4
  productListOptions: ProductListOptions;
5
5
  get fullProductListOptions(): ProductListOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import Vue from "vue";
3
3
  export default class SearchBoxEntry extends Vue {
4
4
  searchBoxOptions: SearchBoxOptions;
5
5
  get fullSearchBoxOptions(): SearchBoxOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import { SearchResultsOptions } from "./types/search-results/SearchResultsOption
3
3
  export default class SearchResultsEntry extends Vue {
4
4
  searchResultsOptions: SearchResultsOptions;
5
5
  get fullSearchResultsOptions(): SearchResultsOptions;
6
+ fetch(): void;
6
7
  }
@@ -3,4 +3,5 @@ import { ProductListOptions } from "@/types/product-list/ProductListOptions";
3
3
  export default class ProductList extends Vue {
4
4
  options: ProductListOptions;
5
5
  get componentOptions(): ProductListOptions;
6
+ fetch(): void;
6
7
  }
@@ -8,14 +8,17 @@ import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
9
  import { BadgeGenerateOptions, BadgeGenerateSeed, BadgeOptions, BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
10
10
  import { SearchResultsSortOptions, SortOptions } from "./types/search-results/SearchResultsSort";
11
+ declare type MountOptions = {
12
+ fetch: boolean;
13
+ };
11
14
  declare const lupaSearch: {
12
- searchBox: (options: SearchBoxOptions) => void;
13
- searchResults: (options: SearchResultsOptions) => void;
15
+ searchBox: (options: SearchBoxOptions, mountOptions?: MountOptions | undefined) => void;
16
+ searchResults: (options: SearchResultsOptions, mountOptions?: MountOptions | undefined) => void;
14
17
  tracking: (options: TrackingOptions) => void;
15
- productList: (options: ProductListOptions) => void;
16
- clearSearchBox: () => void;
17
- clearSearchResults: () => void;
18
- clearProductList: () => void;
18
+ productList: (options: ProductListOptions, mountOptions?: MountOptions | undefined) => void;
19
+ clearSearchBox: (selector?: string | undefined) => void;
20
+ clearSearchResults: (selector?: string | undefined) => void;
21
+ clearProductList: (selector?: string | undefined) => void;
19
22
  };
20
- export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, };
23
+ export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, };
21
24
  export default lupaSearch;