@getlupa/client 0.7.0-alpha-24 → 0.8.0-alpha-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/cjs/ProductListEntry.vue.d.ts +1 -0
- package/dist/cjs/SearchBoxEntry.vue.d.ts +1 -0
- package/dist/cjs/SearchResultsEntry.vue.d.ts +1 -0
- package/dist/cjs/components/product-list/ProductList.vue.d.ts +1 -0
- package/dist/cjs/index.d.ts +10 -7
- package/dist/cjs/index.min.js +115 -27
- package/dist/es/ProductListEntry.vue.d.ts +1 -0
- package/dist/es/SearchBoxEntry.vue.d.ts +1 -0
- package/dist/es/SearchResultsEntry.vue.d.ts +1 -0
- package/dist/es/components/product-list/ProductList.vue.d.ts +1 -0
- package/dist/es/index.d.ts +10 -7
- package/dist/es/index.min.js +115 -27
- package/dist/iife/ProductListEntry.vue.d.ts +1 -0
- package/dist/iife/SearchBoxEntry.vue.d.ts +1 -0
- package/dist/iife/SearchResultsEntry.vue.d.ts +1 -0
- package/dist/iife/components/product-list/ProductList.vue.d.ts +1 -0
- package/dist/iife/index.d.ts +10 -7
- package/dist/iife/index.min.js +1 -1
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -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;
|
package/dist/cjs/index.min.js
CHANGED
|
@@ -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", {
|
|
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;
|
|
@@ -21041,6 +21049,11 @@ let SearchResultsEntry = class SearchResultsEntry extends Vue$1 {
|
|
|
21041
21049
|
const options = cloneDeep(this.searchResultsOptions);
|
|
21042
21050
|
return merge(DEFAULT_OPTIONS_RESULTS, options);
|
|
21043
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
|
+
}
|
|
21044
21057
|
};
|
|
21045
21058
|
__decorate([
|
|
21046
21059
|
Prop()
|
|
@@ -21064,6 +21077,7 @@ var __vue_render__$3 = function () {
|
|
|
21064
21077
|
var _h = _vm.$createElement;
|
|
21065
21078
|
var _c = _vm._self._c || _h;
|
|
21066
21079
|
return _c("SearchResults", {
|
|
21080
|
+
ref: "searchResults",
|
|
21067
21081
|
attrs: { options: _vm.fullSearchResultsOptions },
|
|
21068
21082
|
})
|
|
21069
21083
|
};
|
|
@@ -21175,6 +21189,11 @@ let ProductList = class ProductList extends Vue$1 {
|
|
|
21175
21189
|
get componentOptions() {
|
|
21176
21190
|
return Object.assign(Object.assign({}, this.options), { filters: Object.assign(Object.assign({}, this.options.filters), { categories: this.options.categories }) });
|
|
21177
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
|
+
}
|
|
21178
21197
|
};
|
|
21179
21198
|
__decorate([
|
|
21180
21199
|
Prop()
|
|
@@ -21204,6 +21223,7 @@ var __vue_render__$1 = function () {
|
|
|
21204
21223
|
_c(
|
|
21205
21224
|
"SearchResults",
|
|
21206
21225
|
{
|
|
21226
|
+
ref: "searchResults",
|
|
21207
21227
|
attrs: {
|
|
21208
21228
|
options: _vm.componentOptions,
|
|
21209
21229
|
"initial-filters": _vm.options.initialFilters,
|
|
@@ -21253,6 +21273,11 @@ let ProductListEntry = class ProductListEntry extends Vue$1 {
|
|
|
21253
21273
|
get fullProductListOptions() {
|
|
21254
21274
|
return cloneDeep(this.productListOptions);
|
|
21255
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
|
+
}
|
|
21256
21281
|
};
|
|
21257
21282
|
__decorate([
|
|
21258
21283
|
Prop()
|
|
@@ -21275,7 +21300,10 @@ var __vue_render__ = function () {
|
|
|
21275
21300
|
var _vm = this;
|
|
21276
21301
|
var _h = _vm.$createElement;
|
|
21277
21302
|
var _c = _vm._self._c || _h;
|
|
21278
|
-
return _c("ProductList", {
|
|
21303
|
+
return _c("ProductList", {
|
|
21304
|
+
ref: "productList",
|
|
21305
|
+
attrs: { options: _vm.productListOptions },
|
|
21306
|
+
})
|
|
21279
21307
|
};
|
|
21280
21308
|
var __vue_staticRenderFns__ = [];
|
|
21281
21309
|
__vue_render__._withStripped = true;
|
|
@@ -22213,7 +22241,7 @@ let ParamsModule = class ParamsModule extends VuexModule {
|
|
|
22213
22241
|
goToResults({ searchText, facet, }) {
|
|
22214
22242
|
var _a;
|
|
22215
22243
|
if (!this.searchResultsLink ||
|
|
22216
|
-
this.searchResultsLink
|
|
22244
|
+
linksMatch(this.searchResultsLink, window.location.pathname)) {
|
|
22217
22245
|
const facetParam = facet ? [getFacetParam(facet.key, [facet.title])] : [];
|
|
22218
22246
|
this.context.dispatch("appendParams", {
|
|
22219
22247
|
params: [
|
|
@@ -22444,57 +22472,117 @@ const app = {
|
|
|
22444
22472
|
const tracking = (options) => {
|
|
22445
22473
|
initTracking(options);
|
|
22446
22474
|
};
|
|
22447
|
-
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
|
+
}
|
|
22448
22487
|
Vue$1.use(Vuex);
|
|
22449
|
-
|
|
22488
|
+
const SearchBoxEntryComponent = Vue$1.component("SearchBoxEntry", __vue_component__$R);
|
|
22489
|
+
const instance = new SearchBoxEntryComponent({
|
|
22450
22490
|
el: options.inputSelector,
|
|
22451
|
-
|
|
22452
|
-
render: (h) => h(__vue_component__$R, { props: { searchBoxOptions: options } }),
|
|
22491
|
+
propsData: { searchBoxOptions: options },
|
|
22453
22492
|
store,
|
|
22454
22493
|
});
|
|
22494
|
+
app.box[options.inputSelector] = instance;
|
|
22455
22495
|
};
|
|
22456
|
-
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
|
+
}
|
|
22457
22508
|
Vue$1.use(Vuex);
|
|
22458
|
-
|
|
22509
|
+
const SearchResultsEntryComponent = Vue$1.component("SearchResultsEntry", __vue_component__$3);
|
|
22510
|
+
const instance = new SearchResultsEntryComponent({
|
|
22459
22511
|
el: options.containerSelector,
|
|
22460
|
-
|
|
22461
|
-
render: (h) => h(__vue_component__$3, { props: { searchResultsOptions: options } }),
|
|
22512
|
+
propsData: { searchResultsOptions: options },
|
|
22462
22513
|
store,
|
|
22463
22514
|
});
|
|
22515
|
+
app.results[options.containerSelector] = instance;
|
|
22464
22516
|
};
|
|
22465
|
-
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
|
+
}
|
|
22466
22529
|
Vue$1.use(Vuex);
|
|
22467
|
-
|
|
22530
|
+
const ProductListEntryComponent = Vue$1.component("ProductListEntry", __vue_component__);
|
|
22531
|
+
const instance = new ProductListEntryComponent({
|
|
22468
22532
|
el: options.containerSelector,
|
|
22469
|
-
|
|
22470
|
-
render: (h) => h(__vue_component__, { props: { productListOptions: options } }),
|
|
22533
|
+
propsData: { productListOptions: options },
|
|
22471
22534
|
store,
|
|
22472
22535
|
});
|
|
22536
|
+
app.productList[options.containerSelector] = instance;
|
|
22473
22537
|
};
|
|
22474
|
-
const clearSearchBox = () => {
|
|
22475
|
-
var _a;
|
|
22538
|
+
const clearSearchBox = (selector) => {
|
|
22476
22539
|
try {
|
|
22477
|
-
(
|
|
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 = {};
|
|
22478
22550
|
}
|
|
22479
|
-
catch (
|
|
22551
|
+
catch (_a) {
|
|
22480
22552
|
// do nothing, already destroyed;
|
|
22481
22553
|
}
|
|
22482
22554
|
};
|
|
22483
|
-
const clearSearchResults = () => {
|
|
22484
|
-
var _a;
|
|
22555
|
+
const clearSearchResults = (selector) => {
|
|
22485
22556
|
try {
|
|
22486
|
-
(
|
|
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 = {};
|
|
22487
22567
|
}
|
|
22488
|
-
catch (
|
|
22568
|
+
catch (_a) {
|
|
22489
22569
|
// do nothing, already destroyed;
|
|
22490
22570
|
}
|
|
22491
22571
|
};
|
|
22492
|
-
const clearProductList = () => {
|
|
22493
|
-
var _a;
|
|
22572
|
+
const clearProductList = (selector) => {
|
|
22494
22573
|
try {
|
|
22495
|
-
(
|
|
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 = {};
|
|
22496
22584
|
}
|
|
22497
|
-
catch (
|
|
22585
|
+
catch (_a) {
|
|
22498
22586
|
// do nothing, already destroyed;
|
|
22499
22587
|
}
|
|
22500
22588
|
};
|
package/dist/es/index.d.ts
CHANGED
|
@@ -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;
|
package/dist/es/index.min.js
CHANGED
|
@@ -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", {
|
|
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;
|
|
@@ -21037,6 +21045,11 @@ let SearchResultsEntry = class SearchResultsEntry extends Vue$1 {
|
|
|
21037
21045
|
const options = cloneDeep(this.searchResultsOptions);
|
|
21038
21046
|
return merge(DEFAULT_OPTIONS_RESULTS, options);
|
|
21039
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
|
+
}
|
|
21040
21053
|
};
|
|
21041
21054
|
__decorate([
|
|
21042
21055
|
Prop()
|
|
@@ -21060,6 +21073,7 @@ var __vue_render__$3 = function () {
|
|
|
21060
21073
|
var _h = _vm.$createElement;
|
|
21061
21074
|
var _c = _vm._self._c || _h;
|
|
21062
21075
|
return _c("SearchResults", {
|
|
21076
|
+
ref: "searchResults",
|
|
21063
21077
|
attrs: { options: _vm.fullSearchResultsOptions },
|
|
21064
21078
|
})
|
|
21065
21079
|
};
|
|
@@ -21171,6 +21185,11 @@ let ProductList = class ProductList extends Vue$1 {
|
|
|
21171
21185
|
get componentOptions() {
|
|
21172
21186
|
return Object.assign(Object.assign({}, this.options), { filters: Object.assign(Object.assign({}, this.options.filters), { categories: this.options.categories }) });
|
|
21173
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
|
+
}
|
|
21174
21193
|
};
|
|
21175
21194
|
__decorate([
|
|
21176
21195
|
Prop()
|
|
@@ -21200,6 +21219,7 @@ var __vue_render__$1 = function () {
|
|
|
21200
21219
|
_c(
|
|
21201
21220
|
"SearchResults",
|
|
21202
21221
|
{
|
|
21222
|
+
ref: "searchResults",
|
|
21203
21223
|
attrs: {
|
|
21204
21224
|
options: _vm.componentOptions,
|
|
21205
21225
|
"initial-filters": _vm.options.initialFilters,
|
|
@@ -21249,6 +21269,11 @@ let ProductListEntry = class ProductListEntry extends Vue$1 {
|
|
|
21249
21269
|
get fullProductListOptions() {
|
|
21250
21270
|
return cloneDeep(this.productListOptions);
|
|
21251
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
|
+
}
|
|
21252
21277
|
};
|
|
21253
21278
|
__decorate([
|
|
21254
21279
|
Prop()
|
|
@@ -21271,7 +21296,10 @@ var __vue_render__ = function () {
|
|
|
21271
21296
|
var _vm = this;
|
|
21272
21297
|
var _h = _vm.$createElement;
|
|
21273
21298
|
var _c = _vm._self._c || _h;
|
|
21274
|
-
return _c("ProductList", {
|
|
21299
|
+
return _c("ProductList", {
|
|
21300
|
+
ref: "productList",
|
|
21301
|
+
attrs: { options: _vm.productListOptions },
|
|
21302
|
+
})
|
|
21275
21303
|
};
|
|
21276
21304
|
var __vue_staticRenderFns__ = [];
|
|
21277
21305
|
__vue_render__._withStripped = true;
|
|
@@ -22209,7 +22237,7 @@ let ParamsModule = class ParamsModule extends VuexModule {
|
|
|
22209
22237
|
goToResults({ searchText, facet, }) {
|
|
22210
22238
|
var _a;
|
|
22211
22239
|
if (!this.searchResultsLink ||
|
|
22212
|
-
this.searchResultsLink
|
|
22240
|
+
linksMatch(this.searchResultsLink, window.location.pathname)) {
|
|
22213
22241
|
const facetParam = facet ? [getFacetParam(facet.key, [facet.title])] : [];
|
|
22214
22242
|
this.context.dispatch("appendParams", {
|
|
22215
22243
|
params: [
|
|
@@ -22440,57 +22468,117 @@ const app = {
|
|
|
22440
22468
|
const tracking = (options) => {
|
|
22441
22469
|
initTracking(options);
|
|
22442
22470
|
};
|
|
22443
|
-
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
|
+
}
|
|
22444
22483
|
Vue$1.use(Vuex);
|
|
22445
|
-
|
|
22484
|
+
const SearchBoxEntryComponent = Vue$1.component("SearchBoxEntry", __vue_component__$R);
|
|
22485
|
+
const instance = new SearchBoxEntryComponent({
|
|
22446
22486
|
el: options.inputSelector,
|
|
22447
|
-
|
|
22448
|
-
render: (h) => h(__vue_component__$R, { props: { searchBoxOptions: options } }),
|
|
22487
|
+
propsData: { searchBoxOptions: options },
|
|
22449
22488
|
store,
|
|
22450
22489
|
});
|
|
22490
|
+
app.box[options.inputSelector] = instance;
|
|
22451
22491
|
};
|
|
22452
|
-
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
|
+
}
|
|
22453
22504
|
Vue$1.use(Vuex);
|
|
22454
|
-
|
|
22505
|
+
const SearchResultsEntryComponent = Vue$1.component("SearchResultsEntry", __vue_component__$3);
|
|
22506
|
+
const instance = new SearchResultsEntryComponent({
|
|
22455
22507
|
el: options.containerSelector,
|
|
22456
|
-
|
|
22457
|
-
render: (h) => h(__vue_component__$3, { props: { searchResultsOptions: options } }),
|
|
22508
|
+
propsData: { searchResultsOptions: options },
|
|
22458
22509
|
store,
|
|
22459
22510
|
});
|
|
22511
|
+
app.results[options.containerSelector] = instance;
|
|
22460
22512
|
};
|
|
22461
|
-
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
|
+
}
|
|
22462
22525
|
Vue$1.use(Vuex);
|
|
22463
|
-
|
|
22526
|
+
const ProductListEntryComponent = Vue$1.component("ProductListEntry", __vue_component__);
|
|
22527
|
+
const instance = new ProductListEntryComponent({
|
|
22464
22528
|
el: options.containerSelector,
|
|
22465
|
-
|
|
22466
|
-
render: (h) => h(__vue_component__, { props: { productListOptions: options } }),
|
|
22529
|
+
propsData: { productListOptions: options },
|
|
22467
22530
|
store,
|
|
22468
22531
|
});
|
|
22532
|
+
app.productList[options.containerSelector] = instance;
|
|
22469
22533
|
};
|
|
22470
|
-
const clearSearchBox = () => {
|
|
22471
|
-
var _a;
|
|
22534
|
+
const clearSearchBox = (selector) => {
|
|
22472
22535
|
try {
|
|
22473
|
-
(
|
|
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 = {};
|
|
22474
22546
|
}
|
|
22475
|
-
catch (
|
|
22547
|
+
catch (_a) {
|
|
22476
22548
|
// do nothing, already destroyed;
|
|
22477
22549
|
}
|
|
22478
22550
|
};
|
|
22479
|
-
const clearSearchResults = () => {
|
|
22480
|
-
var _a;
|
|
22551
|
+
const clearSearchResults = (selector) => {
|
|
22481
22552
|
try {
|
|
22482
|
-
(
|
|
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 = {};
|
|
22483
22563
|
}
|
|
22484
|
-
catch (
|
|
22564
|
+
catch (_a) {
|
|
22485
22565
|
// do nothing, already destroyed;
|
|
22486
22566
|
}
|
|
22487
22567
|
};
|
|
22488
|
-
const clearProductList = () => {
|
|
22489
|
-
var _a;
|
|
22568
|
+
const clearProductList = (selector) => {
|
|
22490
22569
|
try {
|
|
22491
|
-
(
|
|
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 = {};
|
|
22492
22580
|
}
|
|
22493
|
-
catch (
|
|
22581
|
+
catch (_a) {
|
|
22494
22582
|
// do nothing, already destroyed;
|
|
22495
22583
|
}
|
|
22496
22584
|
};
|
package/dist/iife/index.d.ts
CHANGED
|
@@ -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;
|