@getlupa/client 0.9.0 → 0.9.3
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/cypress.config.ts +12 -0
- package/dist/cjs/components/search-box/SearchBox.vue.d.ts +1 -0
- package/dist/cjs/components/search-results/filters/facets/StatsFacet.vue.d.ts +2 -0
- package/dist/cjs/index.min.js +38 -7
- package/dist/cjs/utils/string.utils.d.ts +1 -0
- package/dist/es/components/search-box/SearchBox.vue.d.ts +1 -0
- package/dist/es/components/search-results/filters/facets/StatsFacet.vue.d.ts +2 -0
- package/dist/es/index.min.js +38 -7
- package/dist/es/utils/string.utils.d.ts +1 -0
- package/dist/iife/components/search-box/SearchBox.vue.d.ts +1 -0
- package/dist/iife/components/search-results/filters/facets/StatsFacet.vue.d.ts +2 -0
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/utils/string.utils.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from "cypress";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
e2e: {
|
|
5
|
+
// We've imported your old cypress plugins here.
|
|
6
|
+
// You may want to clean this up later by importing these.
|
|
7
|
+
setupNodeEvents(on, config) {
|
|
8
|
+
return require("./cypress/plugins/index.js")(on, config);
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
chromeWebSecurity: false,
|
|
12
|
+
});
|
|
@@ -27,6 +27,8 @@ export default class TermFacet extends Vue {
|
|
|
27
27
|
get facetMax(): number;
|
|
28
28
|
get statsSummary(): string;
|
|
29
29
|
get separator(): string;
|
|
30
|
+
get isIntegerRange(): boolean;
|
|
31
|
+
get interval(): 1 | 0.01;
|
|
30
32
|
get sliderInputFormat(): string | undefined;
|
|
31
33
|
onMinValueChange(): void;
|
|
32
34
|
onMaxValueChange(): void;
|
package/dist/cjs/index.min.js
CHANGED
|
@@ -10828,6 +10828,13 @@ const getProductKey = (index, product, idKey) => {
|
|
|
10828
10828
|
}
|
|
10829
10829
|
return index;
|
|
10830
10830
|
};
|
|
10831
|
+
const normalizeFloat = (value) => {
|
|
10832
|
+
var _a;
|
|
10833
|
+
if (!value) {
|
|
10834
|
+
return 0;
|
|
10835
|
+
}
|
|
10836
|
+
return +((_a = value === null || value === void 0 ? void 0 : value.replace(/[^0-9,.]/g, "")) === null || _a === void 0 ? void 0 : _a.replace(",", "."));
|
|
10837
|
+
};
|
|
10831
10838
|
const escapeHtml = (value) => {
|
|
10832
10839
|
if (!value) {
|
|
10833
10840
|
return "";
|
|
@@ -12264,6 +12271,7 @@ let SearchBoxProduct = class SearchBoxProduct extends Vue$1 {
|
|
|
12264
12271
|
if (!this.link) {
|
|
12265
12272
|
return;
|
|
12266
12273
|
}
|
|
12274
|
+
this.$emit("product-click");
|
|
12267
12275
|
handleRoutingEvent(this.link, event, this.boxRoutingBehavior === "event");
|
|
12268
12276
|
}
|
|
12269
12277
|
};
|
|
@@ -12440,6 +12448,11 @@ var __vue_render__$$ = function () {
|
|
|
12440
12448
|
highlighted: index === _vm.highlightedIndex,
|
|
12441
12449
|
inputValue: _vm.inputValue,
|
|
12442
12450
|
},
|
|
12451
|
+
on: {
|
|
12452
|
+
"product-click": function ($event) {
|
|
12453
|
+
return _vm.$emit("product-click")
|
|
12454
|
+
},
|
|
12455
|
+
},
|
|
12443
12456
|
})
|
|
12444
12457
|
}),
|
|
12445
12458
|
1
|
|
@@ -12558,6 +12571,11 @@ var __vue_render__$_ = function () {
|
|
|
12558
12571
|
labels: _vm.labels,
|
|
12559
12572
|
inputValue: _vm.inputValue,
|
|
12560
12573
|
},
|
|
12574
|
+
on: {
|
|
12575
|
+
"product-click": function ($event) {
|
|
12576
|
+
return _vm.$emit("product-click")
|
|
12577
|
+
},
|
|
12578
|
+
},
|
|
12561
12579
|
})
|
|
12562
12580
|
};
|
|
12563
12581
|
var __vue_staticRenderFns__$_ = [];
|
|
@@ -12566,7 +12584,7 @@ __vue_render__$_._withStripped = true;
|
|
|
12566
12584
|
/* style */
|
|
12567
12585
|
const __vue_inject_styles__$_ = function (inject) {
|
|
12568
12586
|
if (!inject) return
|
|
12569
|
-
inject("data-v-
|
|
12587
|
+
inject("data-v-58b6ab21_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: undefined, media: undefined });
|
|
12570
12588
|
|
|
12571
12589
|
};
|
|
12572
12590
|
/* scoped */
|
|
@@ -13437,6 +13455,9 @@ var __vue_render__$T = function () {
|
|
|
13437
13455
|
itemSelect: function (item) {
|
|
13438
13456
|
return _vm.$emit("itemSelect", item)
|
|
13439
13457
|
},
|
|
13458
|
+
"product-click": function ($event) {
|
|
13459
|
+
return _vm.$emit("product-click")
|
|
13460
|
+
},
|
|
13440
13461
|
},
|
|
13441
13462
|
})
|
|
13442
13463
|
: _vm._e(),
|
|
@@ -13486,7 +13507,7 @@ __vue_render__$T._withStripped = true;
|
|
|
13486
13507
|
/* style */
|
|
13487
13508
|
const __vue_inject_styles__$T = function (inject) {
|
|
13488
13509
|
if (!inject) return
|
|
13489
|
-
inject("data-v-
|
|
13510
|
+
inject("data-v-d48b96f0_0", { source: "#lupa-search-box-panel {\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n}\n.lupa-more-results {\n text-align: center;\n}", map: undefined, media: undefined });
|
|
13490
13511
|
|
|
13491
13512
|
};
|
|
13492
13513
|
/* scoped */
|
|
@@ -13734,6 +13755,9 @@ let SearchBox = class SearchBox extends Vue$1 {
|
|
|
13734
13755
|
this.inputValue = "";
|
|
13735
13756
|
this.suggestedValue = defaultSuggestedValue;
|
|
13736
13757
|
}
|
|
13758
|
+
handleProductClick() {
|
|
13759
|
+
this.opened = false;
|
|
13760
|
+
}
|
|
13737
13761
|
};
|
|
13738
13762
|
__decorate([
|
|
13739
13763
|
Prop()
|
|
@@ -13803,6 +13827,7 @@ var __vue_render__$S = function () {
|
|
|
13803
13827
|
fetched: _vm.handleItemsFetch,
|
|
13804
13828
|
itemSelect: _vm.handleItemSelect,
|
|
13805
13829
|
"go-to-results": _vm.handleSearch,
|
|
13830
|
+
"product-click": _vm.handleProductClick,
|
|
13806
13831
|
},
|
|
13807
13832
|
})
|
|
13808
13833
|
: _vm._e(),
|
|
@@ -13817,7 +13842,7 @@ __vue_render__$S._withStripped = true;
|
|
|
13817
13842
|
/* style */
|
|
13818
13843
|
const __vue_inject_styles__$S = function (inject) {
|
|
13819
13844
|
if (!inject) return
|
|
13820
|
-
inject("data-v-
|
|
13845
|
+
inject("data-v-7c20b12e_0", { source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n", map: undefined, media: undefined });
|
|
13821
13846
|
|
|
13822
13847
|
};
|
|
13823
13848
|
/* scoped */
|
|
@@ -14834,8 +14859,7 @@ let TermFacet = class TermFacet extends Vue$1 {
|
|
|
14834
14859
|
: `${this.sliderRange[0]}`;
|
|
14835
14860
|
}
|
|
14836
14861
|
set fromValue(stringValue) {
|
|
14837
|
-
|
|
14838
|
-
let value = +numberString;
|
|
14862
|
+
let value = normalizeFloat(stringValue);
|
|
14839
14863
|
if (value < this.facetMin) {
|
|
14840
14864
|
value = this.facetMin;
|
|
14841
14865
|
}
|
|
@@ -14851,8 +14875,7 @@ let TermFacet = class TermFacet extends Vue$1 {
|
|
|
14851
14875
|
: `${this.sliderRange[1]}`;
|
|
14852
14876
|
}
|
|
14853
14877
|
set toValue(stringValue) {
|
|
14854
|
-
|
|
14855
|
-
let value = +numberString;
|
|
14878
|
+
let value = normalizeFloat(stringValue);
|
|
14856
14879
|
if (value > this.facetMax) {
|
|
14857
14880
|
value = this.facetMax;
|
|
14858
14881
|
}
|
|
@@ -14914,6 +14937,13 @@ let TermFacet = class TermFacet extends Vue$1 {
|
|
|
14914
14937
|
var _a, _b, _c;
|
|
14915
14938
|
return (_c = (_b = (_a = this.searchResultOptions) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.priceSeparator) !== null && _c !== void 0 ? _c : ",";
|
|
14916
14939
|
}
|
|
14940
|
+
get isIntegerRange() {
|
|
14941
|
+
return (Number.isInteger(this.currentMinValue) &&
|
|
14942
|
+
Number.isInteger(this.currentMaxValue));
|
|
14943
|
+
}
|
|
14944
|
+
get interval() {
|
|
14945
|
+
return this.isIntegerRange ? 1 : 0.01;
|
|
14946
|
+
}
|
|
14917
14947
|
get sliderInputFormat() {
|
|
14918
14948
|
return this.isPrice ? `[0-9]+([${this.separator}][0-9]{1,2})?` : undefined;
|
|
14919
14949
|
}
|
|
@@ -15083,6 +15113,7 @@ var __vue_render__$N = function () {
|
|
|
15083
15113
|
lazy: true,
|
|
15084
15114
|
silent: true,
|
|
15085
15115
|
duration: 0.1,
|
|
15116
|
+
interval: _vm.interval,
|
|
15086
15117
|
},
|
|
15087
15118
|
on: {
|
|
15088
15119
|
change: _vm.handleChange,
|
|
@@ -5,4 +5,5 @@ export declare const addParamsToLabel: (label: string, ...params: unknown[]) =>
|
|
|
5
5
|
export declare const getRandomString: (length: number) => string;
|
|
6
6
|
export declare const getDisplayValue: (value?: string | number | undefined) => string;
|
|
7
7
|
export declare const getProductKey: (index: string, product: Document, idKey: string | undefined) => string;
|
|
8
|
+
export declare const normalizeFloat: (value?: string | undefined) => number;
|
|
8
9
|
export declare const escapeHtml: (value?: string | undefined) => string;
|
|
@@ -27,6 +27,8 @@ export default class TermFacet extends Vue {
|
|
|
27
27
|
get facetMax(): number;
|
|
28
28
|
get statsSummary(): string;
|
|
29
29
|
get separator(): string;
|
|
30
|
+
get isIntegerRange(): boolean;
|
|
31
|
+
get interval(): 1 | 0.01;
|
|
30
32
|
get sliderInputFormat(): string | undefined;
|
|
31
33
|
onMinValueChange(): void;
|
|
32
34
|
onMaxValueChange(): void;
|
package/dist/es/index.min.js
CHANGED
|
@@ -10824,6 +10824,13 @@ const getProductKey = (index, product, idKey) => {
|
|
|
10824
10824
|
}
|
|
10825
10825
|
return index;
|
|
10826
10826
|
};
|
|
10827
|
+
const normalizeFloat = (value) => {
|
|
10828
|
+
var _a;
|
|
10829
|
+
if (!value) {
|
|
10830
|
+
return 0;
|
|
10831
|
+
}
|
|
10832
|
+
return +((_a = value === null || value === void 0 ? void 0 : value.replace(/[^0-9,.]/g, "")) === null || _a === void 0 ? void 0 : _a.replace(",", "."));
|
|
10833
|
+
};
|
|
10827
10834
|
const escapeHtml = (value) => {
|
|
10828
10835
|
if (!value) {
|
|
10829
10836
|
return "";
|
|
@@ -12260,6 +12267,7 @@ let SearchBoxProduct = class SearchBoxProduct extends Vue$1 {
|
|
|
12260
12267
|
if (!this.link) {
|
|
12261
12268
|
return;
|
|
12262
12269
|
}
|
|
12270
|
+
this.$emit("product-click");
|
|
12263
12271
|
handleRoutingEvent(this.link, event, this.boxRoutingBehavior === "event");
|
|
12264
12272
|
}
|
|
12265
12273
|
};
|
|
@@ -12436,6 +12444,11 @@ var __vue_render__$$ = function () {
|
|
|
12436
12444
|
highlighted: index === _vm.highlightedIndex,
|
|
12437
12445
|
inputValue: _vm.inputValue,
|
|
12438
12446
|
},
|
|
12447
|
+
on: {
|
|
12448
|
+
"product-click": function ($event) {
|
|
12449
|
+
return _vm.$emit("product-click")
|
|
12450
|
+
},
|
|
12451
|
+
},
|
|
12439
12452
|
})
|
|
12440
12453
|
}),
|
|
12441
12454
|
1
|
|
@@ -12554,6 +12567,11 @@ var __vue_render__$_ = function () {
|
|
|
12554
12567
|
labels: _vm.labels,
|
|
12555
12568
|
inputValue: _vm.inputValue,
|
|
12556
12569
|
},
|
|
12570
|
+
on: {
|
|
12571
|
+
"product-click": function ($event) {
|
|
12572
|
+
return _vm.$emit("product-click")
|
|
12573
|
+
},
|
|
12574
|
+
},
|
|
12557
12575
|
})
|
|
12558
12576
|
};
|
|
12559
12577
|
var __vue_staticRenderFns__$_ = [];
|
|
@@ -12562,7 +12580,7 @@ __vue_render__$_._withStripped = true;
|
|
|
12562
12580
|
/* style */
|
|
12563
12581
|
const __vue_inject_styles__$_ = function (inject) {
|
|
12564
12582
|
if (!inject) return
|
|
12565
|
-
inject("data-v-
|
|
12583
|
+
inject("data-v-58b6ab21_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: undefined, media: undefined });
|
|
12566
12584
|
|
|
12567
12585
|
};
|
|
12568
12586
|
/* scoped */
|
|
@@ -13433,6 +13451,9 @@ var __vue_render__$T = function () {
|
|
|
13433
13451
|
itemSelect: function (item) {
|
|
13434
13452
|
return _vm.$emit("itemSelect", item)
|
|
13435
13453
|
},
|
|
13454
|
+
"product-click": function ($event) {
|
|
13455
|
+
return _vm.$emit("product-click")
|
|
13456
|
+
},
|
|
13436
13457
|
},
|
|
13437
13458
|
})
|
|
13438
13459
|
: _vm._e(),
|
|
@@ -13482,7 +13503,7 @@ __vue_render__$T._withStripped = true;
|
|
|
13482
13503
|
/* style */
|
|
13483
13504
|
const __vue_inject_styles__$T = function (inject) {
|
|
13484
13505
|
if (!inject) return
|
|
13485
|
-
inject("data-v-
|
|
13506
|
+
inject("data-v-d48b96f0_0", { source: "#lupa-search-box-panel {\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n}\n.lupa-more-results {\n text-align: center;\n}", map: undefined, media: undefined });
|
|
13486
13507
|
|
|
13487
13508
|
};
|
|
13488
13509
|
/* scoped */
|
|
@@ -13730,6 +13751,9 @@ let SearchBox = class SearchBox extends Vue$1 {
|
|
|
13730
13751
|
this.inputValue = "";
|
|
13731
13752
|
this.suggestedValue = defaultSuggestedValue;
|
|
13732
13753
|
}
|
|
13754
|
+
handleProductClick() {
|
|
13755
|
+
this.opened = false;
|
|
13756
|
+
}
|
|
13733
13757
|
};
|
|
13734
13758
|
__decorate([
|
|
13735
13759
|
Prop()
|
|
@@ -13799,6 +13823,7 @@ var __vue_render__$S = function () {
|
|
|
13799
13823
|
fetched: _vm.handleItemsFetch,
|
|
13800
13824
|
itemSelect: _vm.handleItemSelect,
|
|
13801
13825
|
"go-to-results": _vm.handleSearch,
|
|
13826
|
+
"product-click": _vm.handleProductClick,
|
|
13802
13827
|
},
|
|
13803
13828
|
})
|
|
13804
13829
|
: _vm._e(),
|
|
@@ -13813,7 +13838,7 @@ __vue_render__$S._withStripped = true;
|
|
|
13813
13838
|
/* style */
|
|
13814
13839
|
const __vue_inject_styles__$S = function (inject) {
|
|
13815
13840
|
if (!inject) return
|
|
13816
|
-
inject("data-v-
|
|
13841
|
+
inject("data-v-7c20b12e_0", { source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n", map: undefined, media: undefined });
|
|
13817
13842
|
|
|
13818
13843
|
};
|
|
13819
13844
|
/* scoped */
|
|
@@ -14830,8 +14855,7 @@ let TermFacet = class TermFacet extends Vue$1 {
|
|
|
14830
14855
|
: `${this.sliderRange[0]}`;
|
|
14831
14856
|
}
|
|
14832
14857
|
set fromValue(stringValue) {
|
|
14833
|
-
|
|
14834
|
-
let value = +numberString;
|
|
14858
|
+
let value = normalizeFloat(stringValue);
|
|
14835
14859
|
if (value < this.facetMin) {
|
|
14836
14860
|
value = this.facetMin;
|
|
14837
14861
|
}
|
|
@@ -14847,8 +14871,7 @@ let TermFacet = class TermFacet extends Vue$1 {
|
|
|
14847
14871
|
: `${this.sliderRange[1]}`;
|
|
14848
14872
|
}
|
|
14849
14873
|
set toValue(stringValue) {
|
|
14850
|
-
|
|
14851
|
-
let value = +numberString;
|
|
14874
|
+
let value = normalizeFloat(stringValue);
|
|
14852
14875
|
if (value > this.facetMax) {
|
|
14853
14876
|
value = this.facetMax;
|
|
14854
14877
|
}
|
|
@@ -14910,6 +14933,13 @@ let TermFacet = class TermFacet extends Vue$1 {
|
|
|
14910
14933
|
var _a, _b, _c;
|
|
14911
14934
|
return (_c = (_b = (_a = this.searchResultOptions) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.priceSeparator) !== null && _c !== void 0 ? _c : ",";
|
|
14912
14935
|
}
|
|
14936
|
+
get isIntegerRange() {
|
|
14937
|
+
return (Number.isInteger(this.currentMinValue) &&
|
|
14938
|
+
Number.isInteger(this.currentMaxValue));
|
|
14939
|
+
}
|
|
14940
|
+
get interval() {
|
|
14941
|
+
return this.isIntegerRange ? 1 : 0.01;
|
|
14942
|
+
}
|
|
14913
14943
|
get sliderInputFormat() {
|
|
14914
14944
|
return this.isPrice ? `[0-9]+([${this.separator}][0-9]{1,2})?` : undefined;
|
|
14915
14945
|
}
|
|
@@ -15079,6 +15109,7 @@ var __vue_render__$N = function () {
|
|
|
15079
15109
|
lazy: true,
|
|
15080
15110
|
silent: true,
|
|
15081
15111
|
duration: 0.1,
|
|
15112
|
+
interval: _vm.interval,
|
|
15082
15113
|
},
|
|
15083
15114
|
on: {
|
|
15084
15115
|
change: _vm.handleChange,
|
|
@@ -5,4 +5,5 @@ export declare const addParamsToLabel: (label: string, ...params: unknown[]) =>
|
|
|
5
5
|
export declare const getRandomString: (length: number) => string;
|
|
6
6
|
export declare const getDisplayValue: (value?: string | number | undefined) => string;
|
|
7
7
|
export declare const getProductKey: (index: string, product: Document, idKey: string | undefined) => string;
|
|
8
|
+
export declare const normalizeFloat: (value?: string | undefined) => number;
|
|
8
9
|
export declare const escapeHtml: (value?: string | undefined) => string;
|
|
@@ -27,6 +27,8 @@ export default class TermFacet extends Vue {
|
|
|
27
27
|
get facetMax(): number;
|
|
28
28
|
get statsSummary(): string;
|
|
29
29
|
get separator(): string;
|
|
30
|
+
get isIntegerRange(): boolean;
|
|
31
|
+
get interval(): 1 | 0.01;
|
|
30
32
|
get sliderInputFormat(): string | undefined;
|
|
31
33
|
onMinValueChange(): void;
|
|
32
34
|
onMaxValueChange(): void;
|