@getlupa/client 0.16.0-alpha-4 → 0.16.0
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/README.md +2 -0
- package/dist/cjs/components/search-box/products/elements/SearchBoxProductCustom.vue.d.ts +1 -0
- package/dist/cjs/components/search-box/products/elements/custom/SearchBoxProductCustomHtml.vue.d.ts +1 -0
- package/dist/cjs/components/search-results/filters/SearchResultsFilters.vue.d.ts +2 -0
- package/dist/cjs/components/search-results/products/SearchResultsProducts.vue.d.ts +3 -0
- package/dist/cjs/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +1 -0
- package/dist/cjs/components/search-results/products/product-card/elements/custom/SearchResultsProductCustomHtmlElement.vue.d.ts +1 -0
- package/dist/cjs/constants/development/searchResultsDev.example.const.d.ts +5 -0
- package/dist/cjs/index.min.js +143 -50
- package/dist/cjs/types/DocumentElement.d.ts +2 -0
- package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +7 -2
- package/dist/es/components/search-box/products/elements/SearchBoxProductCustom.vue.d.ts +1 -0
- package/dist/es/components/search-box/products/elements/custom/SearchBoxProductCustomHtml.vue.d.ts +1 -0
- package/dist/es/components/search-results/filters/SearchResultsFilters.vue.d.ts +2 -0
- package/dist/es/components/search-results/products/SearchResultsProducts.vue.d.ts +3 -0
- package/dist/es/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +1 -0
- package/dist/es/components/search-results/products/product-card/elements/custom/SearchResultsProductCustomHtmlElement.vue.d.ts +1 -0
- package/dist/es/constants/development/searchResultsDev.example.const.d.ts +5 -0
- package/dist/es/index.min.js +143 -50
- package/dist/es/types/DocumentElement.d.ts +2 -0
- package/dist/es/types/search-results/SearchResultsOptions.d.ts +7 -2
- package/dist/iife/components/search-box/products/elements/SearchBoxProductCustom.vue.d.ts +1 -0
- package/dist/iife/components/search-box/products/elements/custom/SearchBoxProductCustomHtml.vue.d.ts +1 -0
- package/dist/iife/components/search-results/filters/SearchResultsFilters.vue.d.ts +2 -0
- package/dist/iife/components/search-results/products/SearchResultsProducts.vue.d.ts +3 -0
- package/dist/iife/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +1 -0
- package/dist/iife/components/search-results/products/product-card/elements/custom/SearchResultsProductCustomHtmlElement.vue.d.ts +1 -0
- package/dist/iife/constants/development/searchResultsDev.example.const.d.ts +5 -0
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/types/DocumentElement.d.ts +2 -0
- package/dist/iife/types/search-results/SearchResultsOptions.d.ts +7 -2
- package/dist/lupaContainerStyle.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/es/index.min.js
CHANGED
|
@@ -11775,6 +11775,14 @@ let SearchBoxProductCustom = class SearchBoxProductCustom extends Vue$1 {
|
|
|
11775
11775
|
var _a;
|
|
11776
11776
|
return (_a = this.options.isHtml) !== null && _a !== void 0 ? _a : false;
|
|
11777
11777
|
}
|
|
11778
|
+
handleClick() {
|
|
11779
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
11780
|
+
if (!this.options.action) {
|
|
11781
|
+
return;
|
|
11782
|
+
}
|
|
11783
|
+
yield this.options.action(this.item);
|
|
11784
|
+
});
|
|
11785
|
+
}
|
|
11778
11786
|
};
|
|
11779
11787
|
__decorate([
|
|
11780
11788
|
Prop()
|
|
@@ -11796,23 +11804,36 @@ var __vue_render__$18 = function () {
|
|
|
11796
11804
|
var _h = _vm.$createElement;
|
|
11797
11805
|
var _c = _vm._self._c || _h;
|
|
11798
11806
|
return _vm.isHtml
|
|
11799
|
-
? _c(
|
|
11800
|
-
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
:
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11807
|
+
? _c(
|
|
11808
|
+
"div",
|
|
11809
|
+
_vm._g(
|
|
11810
|
+
{
|
|
11811
|
+
class: [_vm.className, "lupa-search-box-product-custom"],
|
|
11812
|
+
domProps: { innerHTML: _vm._s(_vm.text) },
|
|
11813
|
+
},
|
|
11814
|
+
_vm.options.action ? { click: _vm.handleClick } : {}
|
|
11815
|
+
)
|
|
11816
|
+
)
|
|
11817
|
+
: _c(
|
|
11818
|
+
"div",
|
|
11819
|
+
_vm._g(
|
|
11820
|
+
{ class: [_vm.className, "lupa-search-box-product-custom"] },
|
|
11821
|
+
_vm.options.action ? { click: _vm.handleClick } : {}
|
|
11822
|
+
),
|
|
11823
|
+
[
|
|
11824
|
+
!_vm.label
|
|
11825
|
+
? _c("div", [_vm._v("\n " + _vm._s(_vm.text) + "\n ")])
|
|
11826
|
+
: _c("div", [
|
|
11827
|
+
_c("div", { staticClass: "lupa-search-box-custom-label" }, [
|
|
11828
|
+
_vm._v(_vm._s(_vm.label)),
|
|
11829
|
+
]),
|
|
11830
|
+
_vm._v(" "),
|
|
11831
|
+
_c("div", { staticClass: "lupa-search-box-custom-text" }, [
|
|
11832
|
+
_vm._v(_vm._s(_vm.text)),
|
|
11833
|
+
]),
|
|
11813
11834
|
]),
|
|
11814
|
-
|
|
11815
|
-
|
|
11835
|
+
]
|
|
11836
|
+
)
|
|
11816
11837
|
};
|
|
11817
11838
|
var __vue_staticRenderFns__$18 = [];
|
|
11818
11839
|
__vue_render__$18._withStripped = true;
|
|
@@ -11853,6 +11874,14 @@ let SearchBoxProductCustomHtml = class SearchBoxProductCustomHtml extends Vue$1
|
|
|
11853
11874
|
get className() {
|
|
11854
11875
|
return this.options.className;
|
|
11855
11876
|
}
|
|
11877
|
+
handleClick() {
|
|
11878
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
11879
|
+
if (!this.options.action) {
|
|
11880
|
+
return;
|
|
11881
|
+
}
|
|
11882
|
+
yield this.options.action(this.item);
|
|
11883
|
+
});
|
|
11884
|
+
}
|
|
11856
11885
|
};
|
|
11857
11886
|
__decorate([
|
|
11858
11887
|
Prop()
|
|
@@ -11875,10 +11904,13 @@ var __vue_render__$17 = function () {
|
|
|
11875
11904
|
var _vm = this;
|
|
11876
11905
|
var _h = _vm.$createElement;
|
|
11877
11906
|
var _c = _vm._self._c || _h;
|
|
11878
|
-
return _c(
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11907
|
+
return _c(
|
|
11908
|
+
"div",
|
|
11909
|
+
_vm._g(
|
|
11910
|
+
{ class: _vm.className, domProps: { innerHTML: _vm._s(_vm.text) } },
|
|
11911
|
+
_vm.options.action ? { click: _vm.handleClick } : {}
|
|
11912
|
+
)
|
|
11913
|
+
)
|
|
11882
11914
|
};
|
|
11883
11915
|
var __vue_staticRenderFns__$17 = [];
|
|
11884
11916
|
__vue_render__$17._withStripped = true;
|
|
@@ -33711,11 +33743,18 @@ __vue_render__$L._withStripped = true;
|
|
|
33711
33743
|
);
|
|
33712
33744
|
|
|
33713
33745
|
let SearchResultsFilters = class SearchResultsFilters extends Vue$1 {
|
|
33714
|
-
get
|
|
33746
|
+
get desktopFiltersVisible() {
|
|
33747
|
+
var _a, _b, _c;
|
|
33748
|
+
// Default is true
|
|
33749
|
+
return (_c = (_b = (_a = this.options.currentFilters) === null || _a === void 0 ? void 0 : _a.visibility) === null || _b === void 0 ? void 0 : _b.desktopSidebar) !== null && _c !== void 0 ? _c : true;
|
|
33750
|
+
}
|
|
33751
|
+
get currentFiltersVisible() {
|
|
33715
33752
|
var _a, _b;
|
|
33716
|
-
return ((_b = (_a = this.options.currentFilters) === null || _a === void 0 ? void 0 : _a.visibility) === null || _b === void 0 ? void 0 : _b.mobileSidebar)
|
|
33717
|
-
|
|
33718
|
-
|
|
33753
|
+
return (((_b = (_a = this.options.currentFilters) === null || _a === void 0 ? void 0 : _a.visibility) === null || _b === void 0 ? void 0 : _b.mobileSidebar) ||
|
|
33754
|
+
this.desktopFiltersVisible);
|
|
33755
|
+
}
|
|
33756
|
+
get showCurrentFilters() {
|
|
33757
|
+
return this.currentFiltersVisible ? Boolean(this.options.facets) : false;
|
|
33719
33758
|
}
|
|
33720
33759
|
fetch() {
|
|
33721
33760
|
var _a;
|
|
@@ -35257,6 +35296,14 @@ let SearchResultsProductCustom = class SearchResultsProductCustom extends Vue$1
|
|
|
35257
35296
|
var _a;
|
|
35258
35297
|
return (_a = this.options.isHtml) !== null && _a !== void 0 ? _a : false;
|
|
35259
35298
|
}
|
|
35299
|
+
handleClick() {
|
|
35300
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
35301
|
+
if (!this.options.action) {
|
|
35302
|
+
return;
|
|
35303
|
+
}
|
|
35304
|
+
yield this.options.action(this.item);
|
|
35305
|
+
});
|
|
35306
|
+
}
|
|
35260
35307
|
};
|
|
35261
35308
|
__decorate([
|
|
35262
35309
|
Prop()
|
|
@@ -35280,23 +35327,33 @@ var __vue_render__$u = function () {
|
|
|
35280
35327
|
var _h = _vm.$createElement;
|
|
35281
35328
|
var _c = _vm._self._c || _h;
|
|
35282
35329
|
return _vm.isHtml
|
|
35283
|
-
? _c(
|
|
35284
|
-
|
|
35285
|
-
|
|
35286
|
-
|
|
35287
|
-
|
|
35288
|
-
|
|
35289
|
-
|
|
35290
|
-
|
|
35291
|
-
|
|
35292
|
-
|
|
35293
|
-
|
|
35294
|
-
|
|
35295
|
-
|
|
35296
|
-
|
|
35330
|
+
? _c(
|
|
35331
|
+
"div",
|
|
35332
|
+
_vm._g(
|
|
35333
|
+
{ class: _vm.className, domProps: { innerHTML: _vm._s(_vm.text) } },
|
|
35334
|
+
_vm.options.action ? { click: _vm.handleClick } : {}
|
|
35335
|
+
)
|
|
35336
|
+
)
|
|
35337
|
+
: _c(
|
|
35338
|
+
"div",
|
|
35339
|
+
_vm._g(
|
|
35340
|
+
{ class: _vm.className },
|
|
35341
|
+
_vm.options.action ? { click: _vm.handleClick } : {}
|
|
35342
|
+
),
|
|
35343
|
+
[
|
|
35344
|
+
!_vm.label
|
|
35345
|
+
? _c("div", [_vm._v("\n " + _vm._s(_vm.text) + "\n ")])
|
|
35346
|
+
: _c("div", [
|
|
35347
|
+
_c("div", { staticClass: "lupa-search-box-custom-label" }, [
|
|
35348
|
+
_vm._v(_vm._s(_vm.label)),
|
|
35349
|
+
]),
|
|
35350
|
+
_vm._v(" "),
|
|
35351
|
+
_c("div", { staticClass: "lupa-search-box-custom-text" }, [
|
|
35352
|
+
_vm._v(_vm._s(_vm.text)),
|
|
35353
|
+
]),
|
|
35297
35354
|
]),
|
|
35298
|
-
|
|
35299
|
-
|
|
35355
|
+
]
|
|
35356
|
+
)
|
|
35300
35357
|
};
|
|
35301
35358
|
var __vue_staticRenderFns__$u = [];
|
|
35302
35359
|
__vue_render__$u._withStripped = true;
|
|
@@ -35337,6 +35394,14 @@ let SearchResultsProductCustomHtmlElement = class SearchResultsProductCustomHtml
|
|
|
35337
35394
|
get className() {
|
|
35338
35395
|
return this.options.className;
|
|
35339
35396
|
}
|
|
35397
|
+
handleClick() {
|
|
35398
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
35399
|
+
if (!this.options.action) {
|
|
35400
|
+
return;
|
|
35401
|
+
}
|
|
35402
|
+
yield this.options.action(this.item);
|
|
35403
|
+
});
|
|
35404
|
+
}
|
|
35340
35405
|
};
|
|
35341
35406
|
__decorate([
|
|
35342
35407
|
Prop()
|
|
@@ -35359,10 +35424,13 @@ var __vue_render__$t = function () {
|
|
|
35359
35424
|
var _vm = this;
|
|
35360
35425
|
var _h = _vm.$createElement;
|
|
35361
35426
|
var _c = _vm._self._c || _h;
|
|
35362
|
-
return _c(
|
|
35363
|
-
|
|
35364
|
-
|
|
35365
|
-
|
|
35427
|
+
return _c(
|
|
35428
|
+
"div",
|
|
35429
|
+
_vm._g(
|
|
35430
|
+
{ class: _vm.className, domProps: { innerHTML: _vm._s(_vm.text) } },
|
|
35431
|
+
_vm.options.action ? { click: _vm.handleClick } : {}
|
|
35432
|
+
)
|
|
35433
|
+
)
|
|
35366
35434
|
};
|
|
35367
35435
|
var __vue_staticRenderFns__$t = [];
|
|
35368
35436
|
__vue_render__$t._withStripped = true;
|
|
@@ -37871,12 +37939,34 @@ let SearchResultsProducts = class SearchResultsProducts extends Vue$1 {
|
|
|
37871
37939
|
get showMobileFilters() {
|
|
37872
37940
|
return this.options.searchTitlePosition !== "search-results-top";
|
|
37873
37941
|
}
|
|
37942
|
+
get currentFilterToolbarVisible() {
|
|
37943
|
+
var _a, _b, _c, _d, _e, _f;
|
|
37944
|
+
return Boolean(((_c = (_b = (_a = this.options.filters) === null || _a === void 0 ? void 0 : _a.currentFilters) === null || _b === void 0 ? void 0 : _b.visibility) === null || _c === void 0 ? void 0 : _c.mobileToolbar) ||
|
|
37945
|
+
((_f = (_e = (_d = this.options.filters) === null || _d === void 0 ? void 0 : _d.currentFilters) === null || _e === void 0 ? void 0 : _e.visibility) === null || _f === void 0 ? void 0 : _f.desktopToolbar));
|
|
37946
|
+
}
|
|
37874
37947
|
get currentFilterOptions() {
|
|
37875
|
-
var _a
|
|
37876
|
-
return
|
|
37877
|
-
? (
|
|
37948
|
+
var _a;
|
|
37949
|
+
return this.currentFilterToolbarVisible
|
|
37950
|
+
? (_a = this.options.filters) === null || _a === void 0 ? void 0 : _a.currentFilters
|
|
37878
37951
|
: undefined;
|
|
37879
37952
|
}
|
|
37953
|
+
get currentFiltersClass() {
|
|
37954
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
37955
|
+
if (!this.currentFilterToolbarVisible) {
|
|
37956
|
+
return "";
|
|
37957
|
+
}
|
|
37958
|
+
if (((_c = (_b = (_a = this.options.filters) === null || _a === void 0 ? void 0 : _a.currentFilters) === null || _b === void 0 ? void 0 : _b.visibility) === null || _c === void 0 ? void 0 : _c.mobileToolbar) &&
|
|
37959
|
+
((_f = (_e = (_d = this.options.filters) === null || _d === void 0 ? void 0 : _d.currentFilters) === null || _e === void 0 ? void 0 : _e.visibility) === null || _f === void 0 ? void 0 : _f.desktopToolbar)) {
|
|
37960
|
+
return "lupa-toolbar-filters";
|
|
37961
|
+
}
|
|
37962
|
+
return ((_j = (_h = (_g = this.options.filters) === null || _g === void 0 ? void 0 : _g.currentFilters) === null || _h === void 0 ? void 0 : _h.visibility) === null || _j === void 0 ? void 0 : _j.mobileToolbar)
|
|
37963
|
+
? "lupa-filters-mobile"
|
|
37964
|
+
: "lupa-toolbar-filters-desktop";
|
|
37965
|
+
}
|
|
37966
|
+
get desktopFiltersExpanded() {
|
|
37967
|
+
var _a, _b, _c, _d, _e;
|
|
37968
|
+
return ((_e = (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.currentFilters) === null || _c === void 0 ? void 0 : _c.desktopToolbar) === null || _d === void 0 ? void 0 : _d.activeFiltersExpanded) !== null && _e !== void 0 ? _e : false);
|
|
37969
|
+
}
|
|
37880
37970
|
get columnSize() {
|
|
37881
37971
|
if (this.layout === ResultsLayoutEnum.LIST) {
|
|
37882
37972
|
return "width: 100%";
|
|
@@ -37977,11 +38067,11 @@ var __vue_render__$c = function () {
|
|
|
37977
38067
|
_vm._v(" "),
|
|
37978
38068
|
_vm.currentFilterOptions
|
|
37979
38069
|
? _c("CurrentFilters", {
|
|
37980
|
-
|
|
38070
|
+
class: _vm.currentFiltersClass,
|
|
37981
38071
|
attrs: {
|
|
37982
38072
|
"data-cy": "lupa-search-result-filters-mobile-toolbar",
|
|
37983
38073
|
options: _vm.currentFilterOptions,
|
|
37984
|
-
expandable:
|
|
38074
|
+
expandable: !_vm.desktopFiltersExpanded,
|
|
37985
38075
|
},
|
|
37986
38076
|
})
|
|
37987
38077
|
: _vm._e(),
|
|
@@ -38736,7 +38826,10 @@ var __vue_render__$8 = function () {
|
|
|
38736
38826
|
var _c = _vm._self._c || _h;
|
|
38737
38827
|
return _c(
|
|
38738
38828
|
"div",
|
|
38739
|
-
{
|
|
38829
|
+
{
|
|
38830
|
+
staticClass: "lupa-search-result-wrapper",
|
|
38831
|
+
class: { "lupa-search-wrapper-no-results": !_vm.hasResults },
|
|
38832
|
+
},
|
|
38740
38833
|
[
|
|
38741
38834
|
_vm.isContainer
|
|
38742
38835
|
? [
|
|
@@ -43,6 +43,7 @@ export declare type CustomDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
|
43
43
|
className: string;
|
|
44
44
|
key: string;
|
|
45
45
|
label?: string;
|
|
46
|
+
action?: (document: T) => Promise<unknown> | undefined;
|
|
46
47
|
};
|
|
47
48
|
export declare type PriceElement<T = any> = DocumentElementBase<T> & {
|
|
48
49
|
type: DocumentElementType.PRICE;
|
|
@@ -85,5 +86,6 @@ export declare type CustomHtmlElement<T = any> = DocumentElementBase<T> & {
|
|
|
85
86
|
type: DocumentElementType.CUSTOM_HTML;
|
|
86
87
|
html: (document: T) => string;
|
|
87
88
|
className: string;
|
|
89
|
+
action?: (document: T) => Promise<unknown> | undefined;
|
|
88
90
|
};
|
|
89
91
|
export declare type DocumentElement = ImageDocumentElement | TitleDocumentElement | DescriptionDocumentElement | CustomDocumentElement | PriceElement | RegularPriceDocumentElement | RatingElement | SingleStarRatingElement | AddToCartElement | CustomHtmlElement;
|
|
@@ -110,13 +110,18 @@ export declare type ResultCurrentFilterOptions = {
|
|
|
110
110
|
clearAll: string;
|
|
111
111
|
};
|
|
112
112
|
visibility?: {
|
|
113
|
-
mobileSidebar
|
|
114
|
-
mobileToolbar
|
|
113
|
+
mobileSidebar?: boolean;
|
|
114
|
+
mobileToolbar?: boolean;
|
|
115
|
+
desktopSidebar?: boolean;
|
|
116
|
+
desktopToolbar?: boolean;
|
|
115
117
|
};
|
|
116
118
|
mobileSidebar?: {
|
|
117
119
|
showFilterCount?: boolean;
|
|
118
120
|
activeFiltersExpanded?: boolean;
|
|
119
121
|
};
|
|
122
|
+
desktopToolbar?: {
|
|
123
|
+
activeFiltersExpanded?: boolean;
|
|
124
|
+
};
|
|
120
125
|
};
|
|
121
126
|
export declare type FacetStyle = "sidebar" | "top-dropdown";
|
|
122
127
|
export declare type FacetFilterQuery = {
|
|
@@ -3,6 +3,8 @@ import { SearchResultsFilterOptions } from "@/types/search-results/SearchResults
|
|
|
3
3
|
export default class SearchResultsFilters extends Vue {
|
|
4
4
|
options: SearchResultsFilterOptions;
|
|
5
5
|
expandable: boolean;
|
|
6
|
+
get desktopFiltersVisible(): boolean;
|
|
7
|
+
get currentFiltersVisible(): boolean;
|
|
6
8
|
get showCurrentFilters(): boolean;
|
|
7
9
|
fetch(): void;
|
|
8
10
|
}
|
|
@@ -14,7 +14,10 @@ export default class SearchResultsProducts extends Vue {
|
|
|
14
14
|
get similarQueriesLabels(): SearchResultsSimilarQueriesLabels;
|
|
15
15
|
get showTopFilters(): boolean;
|
|
16
16
|
get showMobileFilters(): boolean;
|
|
17
|
+
get currentFilterToolbarVisible(): boolean;
|
|
17
18
|
get currentFilterOptions(): ResultCurrentFilterOptions | undefined;
|
|
19
|
+
get currentFiltersClass(): string;
|
|
20
|
+
get desktopFiltersExpanded(): boolean;
|
|
18
21
|
columnCount: number;
|
|
19
22
|
searchResult: SearchQueryResult;
|
|
20
23
|
layout: ResultsLayout;
|
|
@@ -57,6 +57,8 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
|
|
|
57
57
|
visibility: {
|
|
58
58
|
mobileSidebar: boolean;
|
|
59
59
|
mobileToolbar: boolean;
|
|
60
|
+
desktopToolbar: boolean;
|
|
61
|
+
desktopSidebar: boolean;
|
|
60
62
|
};
|
|
61
63
|
labels: {
|
|
62
64
|
title: string;
|
|
@@ -66,6 +68,9 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
|
|
|
66
68
|
showFilterCount: boolean;
|
|
67
69
|
activeFiltersExpanded: boolean;
|
|
68
70
|
};
|
|
71
|
+
desktopToolbar: {
|
|
72
|
+
activeFiltersExpanded: boolean;
|
|
73
|
+
};
|
|
69
74
|
};
|
|
70
75
|
facets: {
|
|
71
76
|
labels: {
|