@getlupa/client 1.8.3 → 1.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lupaSearch.iife.js
CHANGED
|
@@ -27601,7 +27601,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27601
27601
|
callbacks,
|
|
27602
27602
|
additionalFields
|
|
27603
27603
|
}) => {
|
|
27604
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
27604
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
27605
27605
|
const filters = searchResultOptions.showFacets ? {
|
|
27606
27606
|
currentFilters: {
|
|
27607
27607
|
visibility: {
|
|
@@ -27650,23 +27650,37 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27650
27650
|
sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
|
|
27651
27651
|
xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
|
|
27652
27652
|
};
|
|
27653
|
-
const badges =
|
|
27653
|
+
const badges = {
|
|
27654
27654
|
badges: {
|
|
27655
27655
|
anchor: "tr",
|
|
27656
27656
|
elements: [
|
|
27657
|
-
|
|
27658
|
-
|
|
27659
|
-
|
|
27660
|
-
|
|
27661
|
-
|
|
27662
|
-
|
|
27663
|
-
|
|
27657
|
+
...searchResultOptions.showRelevance && [
|
|
27658
|
+
{
|
|
27659
|
+
key: "",
|
|
27660
|
+
type: "customHtml",
|
|
27661
|
+
className: "relevance",
|
|
27662
|
+
html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
|
|
27663
|
+
display: (doc2) => Boolean(doc2._relevance !== void 0)
|
|
27664
|
+
}
|
|
27665
|
+
],
|
|
27666
|
+
...((_m = (_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) != null ? _m : false) && [
|
|
27667
|
+
{
|
|
27668
|
+
key: "",
|
|
27669
|
+
type: "customHtml",
|
|
27670
|
+
className: "boosted-marker",
|
|
27671
|
+
html: () => {
|
|
27672
|
+
var _a2;
|
|
27673
|
+
return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
|
|
27674
|
+
},
|
|
27675
|
+
display: (doc2) => doc2._boosted === true
|
|
27676
|
+
}
|
|
27677
|
+
]
|
|
27664
27678
|
]
|
|
27665
27679
|
}
|
|
27666
|
-
}
|
|
27680
|
+
};
|
|
27667
27681
|
return __spreadValues(__spreadProps(__spreadValues({
|
|
27668
27682
|
options: {
|
|
27669
|
-
environment: (
|
|
27683
|
+
environment: (_n = searchResultOptions.environment) != null ? _n : "production",
|
|
27670
27684
|
customUrl: searchResultOptions.customUrl,
|
|
27671
27685
|
customBaseUrl: searchResultOptions.customBaseUrl,
|
|
27672
27686
|
customPayload: searchResultOptions.customPayload,
|
|
@@ -27676,7 +27690,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27676
27690
|
queryKey: searchResultOptions.queryKey,
|
|
27677
27691
|
containerSelector: searchResultOptions.containerSelector,
|
|
27678
27692
|
searchTitlePosition: "search-results-top",
|
|
27679
|
-
titleKey: (
|
|
27693
|
+
titleKey: (_o = searchResultOptions.fields) == null ? void 0 : _o.titleKey,
|
|
27680
27694
|
labels: labels == null ? void 0 : labels.searchResults,
|
|
27681
27695
|
grid: {
|
|
27682
27696
|
columns
|
|
@@ -27709,7 +27723,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27709
27723
|
}
|
|
27710
27724
|
}, badges), {
|
|
27711
27725
|
links: {
|
|
27712
|
-
details: ((
|
|
27726
|
+
details: ((_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl) ? `{${(_q = searchResultOptions.fields) == null ? void 0 : _q.productUrl}}` : void 0
|
|
27713
27727
|
},
|
|
27714
27728
|
callbacks,
|
|
27715
27729
|
routingBehavior: callbacks ? "event" : "direct-link",
|
|
@@ -27718,31 +27732,31 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27718
27732
|
{
|
|
27719
27733
|
type: "image",
|
|
27720
27734
|
placeholder: placeholderImage,
|
|
27721
|
-
key: (
|
|
27722
|
-
baseUrl: (
|
|
27735
|
+
key: (_r = searchResultOptions.fields) == null ? void 0 : _r.imageKey,
|
|
27736
|
+
baseUrl: (_s = searchResultOptions.fields) == null ? void 0 : _s.baseImageUrl,
|
|
27723
27737
|
display: () => {
|
|
27724
27738
|
var _a2;
|
|
27725
27739
|
return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
|
|
27726
27740
|
}
|
|
27727
27741
|
},
|
|
27728
|
-
addFieldIfKeyExists("_emphasis", (
|
|
27742
|
+
addFieldIfKeyExists("_emphasis", (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField, {
|
|
27729
27743
|
type: "custom",
|
|
27730
27744
|
className: "lupa-custom-emphasis",
|
|
27731
|
-
key: (
|
|
27745
|
+
key: (_u = searchResultOptions.fields) == null ? void 0 : _u.emphasizedField,
|
|
27732
27746
|
display: () => true
|
|
27733
27747
|
}),
|
|
27734
27748
|
{
|
|
27735
27749
|
type: "title",
|
|
27736
|
-
key: (
|
|
27737
|
-
maxLines: (
|
|
27750
|
+
key: (_v = searchResultOptions.fields) == null ? void 0 : _v.titleKey,
|
|
27751
|
+
maxLines: (_w = searchResultOptions.maxLines) != null ? _w : 2,
|
|
27738
27752
|
display: (doc2) => {
|
|
27739
27753
|
var _a2, _b2;
|
|
27740
27754
|
return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
|
|
27741
27755
|
}
|
|
27742
27756
|
},
|
|
27743
27757
|
...getAdditionalElements(additionalFields),
|
|
27744
|
-
addFieldIfKeyExists("_discountPrice", (
|
|
27745
|
-
key: (
|
|
27758
|
+
addFieldIfKeyExists("_discountPrice", (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey, {
|
|
27759
|
+
key: (_y = searchResultOptions.fields) == null ? void 0 : _y.discountPriceKey,
|
|
27746
27760
|
type: "customHtml",
|
|
27747
27761
|
className: "lupa-price lupa-price-discounted",
|
|
27748
27762
|
display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
|
|
@@ -27764,8 +27778,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27764
27778
|
return discount + regular;
|
|
27765
27779
|
}
|
|
27766
27780
|
}),
|
|
27767
|
-
addFieldIfKeyExists("_regularPrice", (
|
|
27768
|
-
key: (
|
|
27781
|
+
addFieldIfKeyExists("_regularPrice", (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey, {
|
|
27782
|
+
key: (_A = searchResultOptions.fields) == null ? void 0 : _A.regularPriceKey,
|
|
27769
27783
|
type: "customHtml",
|
|
27770
27784
|
className: "lupa-price lupa-price-single",
|
|
27771
27785
|
display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
|
package/dist/lupaSearch.js
CHANGED
|
@@ -27601,7 +27601,7 @@ const getSearchResultsComponent = ({
|
|
|
27601
27601
|
callbacks,
|
|
27602
27602
|
additionalFields
|
|
27603
27603
|
}) => {
|
|
27604
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
27604
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
27605
27605
|
const filters = searchResultOptions.showFacets ? {
|
|
27606
27606
|
currentFilters: {
|
|
27607
27607
|
visibility: {
|
|
@@ -27650,23 +27650,37 @@ const getSearchResultsComponent = ({
|
|
|
27650
27650
|
sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
|
|
27651
27651
|
xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
|
|
27652
27652
|
};
|
|
27653
|
-
const badges =
|
|
27653
|
+
const badges = {
|
|
27654
27654
|
badges: {
|
|
27655
27655
|
anchor: "tr",
|
|
27656
27656
|
elements: [
|
|
27657
|
-
|
|
27658
|
-
|
|
27659
|
-
|
|
27660
|
-
|
|
27661
|
-
|
|
27662
|
-
|
|
27663
|
-
|
|
27657
|
+
...searchResultOptions.showRelevance && [
|
|
27658
|
+
{
|
|
27659
|
+
key: "",
|
|
27660
|
+
type: "customHtml",
|
|
27661
|
+
className: "relevance",
|
|
27662
|
+
html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
|
|
27663
|
+
display: (doc2) => Boolean(doc2._relevance !== void 0)
|
|
27664
|
+
}
|
|
27665
|
+
],
|
|
27666
|
+
...((_m = (_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) != null ? _m : false) && [
|
|
27667
|
+
{
|
|
27668
|
+
key: "",
|
|
27669
|
+
type: "customHtml",
|
|
27670
|
+
className: "boosted-marker",
|
|
27671
|
+
html: () => {
|
|
27672
|
+
var _a2;
|
|
27673
|
+
return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
|
|
27674
|
+
},
|
|
27675
|
+
display: (doc2) => doc2._boosted === true
|
|
27676
|
+
}
|
|
27677
|
+
]
|
|
27664
27678
|
]
|
|
27665
27679
|
}
|
|
27666
|
-
}
|
|
27680
|
+
};
|
|
27667
27681
|
return __spreadValues(__spreadProps(__spreadValues({
|
|
27668
27682
|
options: {
|
|
27669
|
-
environment: (
|
|
27683
|
+
environment: (_n = searchResultOptions.environment) != null ? _n : "production",
|
|
27670
27684
|
customUrl: searchResultOptions.customUrl,
|
|
27671
27685
|
customBaseUrl: searchResultOptions.customBaseUrl,
|
|
27672
27686
|
customPayload: searchResultOptions.customPayload,
|
|
@@ -27676,7 +27690,7 @@ const getSearchResultsComponent = ({
|
|
|
27676
27690
|
queryKey: searchResultOptions.queryKey,
|
|
27677
27691
|
containerSelector: searchResultOptions.containerSelector,
|
|
27678
27692
|
searchTitlePosition: "search-results-top",
|
|
27679
|
-
titleKey: (
|
|
27693
|
+
titleKey: (_o = searchResultOptions.fields) == null ? void 0 : _o.titleKey,
|
|
27680
27694
|
labels: labels == null ? void 0 : labels.searchResults,
|
|
27681
27695
|
grid: {
|
|
27682
27696
|
columns
|
|
@@ -27709,7 +27723,7 @@ const getSearchResultsComponent = ({
|
|
|
27709
27723
|
}
|
|
27710
27724
|
}, badges), {
|
|
27711
27725
|
links: {
|
|
27712
|
-
details: ((
|
|
27726
|
+
details: ((_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl) ? `{${(_q = searchResultOptions.fields) == null ? void 0 : _q.productUrl}}` : void 0
|
|
27713
27727
|
},
|
|
27714
27728
|
callbacks,
|
|
27715
27729
|
routingBehavior: callbacks ? "event" : "direct-link",
|
|
@@ -27718,31 +27732,31 @@ const getSearchResultsComponent = ({
|
|
|
27718
27732
|
{
|
|
27719
27733
|
type: "image",
|
|
27720
27734
|
placeholder: placeholderImage,
|
|
27721
|
-
key: (
|
|
27722
|
-
baseUrl: (
|
|
27735
|
+
key: (_r = searchResultOptions.fields) == null ? void 0 : _r.imageKey,
|
|
27736
|
+
baseUrl: (_s = searchResultOptions.fields) == null ? void 0 : _s.baseImageUrl,
|
|
27723
27737
|
display: () => {
|
|
27724
27738
|
var _a2;
|
|
27725
27739
|
return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
|
|
27726
27740
|
}
|
|
27727
27741
|
},
|
|
27728
|
-
addFieldIfKeyExists("_emphasis", (
|
|
27742
|
+
addFieldIfKeyExists("_emphasis", (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField, {
|
|
27729
27743
|
type: "custom",
|
|
27730
27744
|
className: "lupa-custom-emphasis",
|
|
27731
|
-
key: (
|
|
27745
|
+
key: (_u = searchResultOptions.fields) == null ? void 0 : _u.emphasizedField,
|
|
27732
27746
|
display: () => true
|
|
27733
27747
|
}),
|
|
27734
27748
|
{
|
|
27735
27749
|
type: "title",
|
|
27736
|
-
key: (
|
|
27737
|
-
maxLines: (
|
|
27750
|
+
key: (_v = searchResultOptions.fields) == null ? void 0 : _v.titleKey,
|
|
27751
|
+
maxLines: (_w = searchResultOptions.maxLines) != null ? _w : 2,
|
|
27738
27752
|
display: (doc2) => {
|
|
27739
27753
|
var _a2, _b2;
|
|
27740
27754
|
return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
|
|
27741
27755
|
}
|
|
27742
27756
|
},
|
|
27743
27757
|
...getAdditionalElements(additionalFields),
|
|
27744
|
-
addFieldIfKeyExists("_discountPrice", (
|
|
27745
|
-
key: (
|
|
27758
|
+
addFieldIfKeyExists("_discountPrice", (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey, {
|
|
27759
|
+
key: (_y = searchResultOptions.fields) == null ? void 0 : _y.discountPriceKey,
|
|
27746
27760
|
type: "customHtml",
|
|
27747
27761
|
className: "lupa-price lupa-price-discounted",
|
|
27748
27762
|
display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
|
|
@@ -27764,8 +27778,8 @@ const getSearchResultsComponent = ({
|
|
|
27764
27778
|
return discount + regular;
|
|
27765
27779
|
}
|
|
27766
27780
|
}),
|
|
27767
|
-
addFieldIfKeyExists("_regularPrice", (
|
|
27768
|
-
key: (
|
|
27781
|
+
addFieldIfKeyExists("_regularPrice", (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey, {
|
|
27782
|
+
key: (_A = searchResultOptions.fields) == null ? void 0 : _A.regularPriceKey,
|
|
27769
27783
|
type: "customHtml",
|
|
27770
27784
|
className: "lupa-price lupa-price-single",
|
|
27771
27785
|
display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -27599,7 +27599,7 @@ const getSearchResultsComponent = ({
|
|
|
27599
27599
|
callbacks,
|
|
27600
27600
|
additionalFields
|
|
27601
27601
|
}) => {
|
|
27602
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
27602
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
27603
27603
|
const filters = searchResultOptions.showFacets ? {
|
|
27604
27604
|
currentFilters: {
|
|
27605
27605
|
visibility: {
|
|
@@ -27648,23 +27648,37 @@ const getSearchResultsComponent = ({
|
|
|
27648
27648
|
sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
|
|
27649
27649
|
xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
|
|
27650
27650
|
};
|
|
27651
|
-
const badges =
|
|
27651
|
+
const badges = {
|
|
27652
27652
|
badges: {
|
|
27653
27653
|
anchor: "tr",
|
|
27654
27654
|
elements: [
|
|
27655
|
-
|
|
27656
|
-
|
|
27657
|
-
|
|
27658
|
-
|
|
27659
|
-
|
|
27660
|
-
|
|
27661
|
-
|
|
27655
|
+
...searchResultOptions.showRelevance && [
|
|
27656
|
+
{
|
|
27657
|
+
key: "",
|
|
27658
|
+
type: "customHtml",
|
|
27659
|
+
className: "relevance",
|
|
27660
|
+
html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
|
|
27661
|
+
display: (doc2) => Boolean(doc2._relevance !== void 0)
|
|
27662
|
+
}
|
|
27663
|
+
],
|
|
27664
|
+
...((_m = (_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) != null ? _m : false) && [
|
|
27665
|
+
{
|
|
27666
|
+
key: "",
|
|
27667
|
+
type: "customHtml",
|
|
27668
|
+
className: "boosted-marker",
|
|
27669
|
+
html: () => {
|
|
27670
|
+
var _a2;
|
|
27671
|
+
return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
|
|
27672
|
+
},
|
|
27673
|
+
display: (doc2) => doc2._boosted === true
|
|
27674
|
+
}
|
|
27675
|
+
]
|
|
27662
27676
|
]
|
|
27663
27677
|
}
|
|
27664
|
-
}
|
|
27678
|
+
};
|
|
27665
27679
|
return __spreadValues(__spreadProps(__spreadValues({
|
|
27666
27680
|
options: {
|
|
27667
|
-
environment: (
|
|
27681
|
+
environment: (_n = searchResultOptions.environment) != null ? _n : "production",
|
|
27668
27682
|
customUrl: searchResultOptions.customUrl,
|
|
27669
27683
|
customBaseUrl: searchResultOptions.customBaseUrl,
|
|
27670
27684
|
customPayload: searchResultOptions.customPayload,
|
|
@@ -27674,7 +27688,7 @@ const getSearchResultsComponent = ({
|
|
|
27674
27688
|
queryKey: searchResultOptions.queryKey,
|
|
27675
27689
|
containerSelector: searchResultOptions.containerSelector,
|
|
27676
27690
|
searchTitlePosition: "search-results-top",
|
|
27677
|
-
titleKey: (
|
|
27691
|
+
titleKey: (_o = searchResultOptions.fields) == null ? void 0 : _o.titleKey,
|
|
27678
27692
|
labels: labels == null ? void 0 : labels.searchResults,
|
|
27679
27693
|
grid: {
|
|
27680
27694
|
columns
|
|
@@ -27707,7 +27721,7 @@ const getSearchResultsComponent = ({
|
|
|
27707
27721
|
}
|
|
27708
27722
|
}, badges), {
|
|
27709
27723
|
links: {
|
|
27710
|
-
details: ((
|
|
27724
|
+
details: ((_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl) ? `{${(_q = searchResultOptions.fields) == null ? void 0 : _q.productUrl}}` : void 0
|
|
27711
27725
|
},
|
|
27712
27726
|
callbacks,
|
|
27713
27727
|
routingBehavior: callbacks ? "event" : "direct-link",
|
|
@@ -27716,31 +27730,31 @@ const getSearchResultsComponent = ({
|
|
|
27716
27730
|
{
|
|
27717
27731
|
type: "image",
|
|
27718
27732
|
placeholder: placeholderImage,
|
|
27719
|
-
key: (
|
|
27720
|
-
baseUrl: (
|
|
27733
|
+
key: (_r = searchResultOptions.fields) == null ? void 0 : _r.imageKey,
|
|
27734
|
+
baseUrl: (_s = searchResultOptions.fields) == null ? void 0 : _s.baseImageUrl,
|
|
27721
27735
|
display: () => {
|
|
27722
27736
|
var _a2;
|
|
27723
27737
|
return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
|
|
27724
27738
|
}
|
|
27725
27739
|
},
|
|
27726
|
-
addFieldIfKeyExists("_emphasis", (
|
|
27740
|
+
addFieldIfKeyExists("_emphasis", (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField, {
|
|
27727
27741
|
type: "custom",
|
|
27728
27742
|
className: "lupa-custom-emphasis",
|
|
27729
|
-
key: (
|
|
27743
|
+
key: (_u = searchResultOptions.fields) == null ? void 0 : _u.emphasizedField,
|
|
27730
27744
|
display: () => true
|
|
27731
27745
|
}),
|
|
27732
27746
|
{
|
|
27733
27747
|
type: "title",
|
|
27734
|
-
key: (
|
|
27735
|
-
maxLines: (
|
|
27748
|
+
key: (_v = searchResultOptions.fields) == null ? void 0 : _v.titleKey,
|
|
27749
|
+
maxLines: (_w = searchResultOptions.maxLines) != null ? _w : 2,
|
|
27736
27750
|
display: (doc2) => {
|
|
27737
27751
|
var _a2, _b2;
|
|
27738
27752
|
return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
|
|
27739
27753
|
}
|
|
27740
27754
|
},
|
|
27741
27755
|
...getAdditionalElements(additionalFields),
|
|
27742
|
-
addFieldIfKeyExists("_discountPrice", (
|
|
27743
|
-
key: (
|
|
27756
|
+
addFieldIfKeyExists("_discountPrice", (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey, {
|
|
27757
|
+
key: (_y = searchResultOptions.fields) == null ? void 0 : _y.discountPriceKey,
|
|
27744
27758
|
type: "customHtml",
|
|
27745
27759
|
className: "lupa-price lupa-price-discounted",
|
|
27746
27760
|
display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
|
|
@@ -27762,8 +27776,8 @@ const getSearchResultsComponent = ({
|
|
|
27762
27776
|
return discount + regular;
|
|
27763
27777
|
}
|
|
27764
27778
|
}),
|
|
27765
|
-
addFieldIfKeyExists("_regularPrice", (
|
|
27766
|
-
key: (
|
|
27779
|
+
addFieldIfKeyExists("_regularPrice", (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey, {
|
|
27780
|
+
key: (_A = searchResultOptions.fields) == null ? void 0 : _A.regularPriceKey,
|
|
27767
27781
|
type: "customHtml",
|
|
27768
27782
|
className: "lupa-price lupa-price-single",
|
|
27769
27783
|
display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
|
package/dist/lupaSearch.umd.js
CHANGED
|
@@ -27603,7 +27603,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27603
27603
|
callbacks,
|
|
27604
27604
|
additionalFields
|
|
27605
27605
|
}) => {
|
|
27606
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
27606
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
27607
27607
|
const filters = searchResultOptions.showFacets ? {
|
|
27608
27608
|
currentFilters: {
|
|
27609
27609
|
visibility: {
|
|
@@ -27652,23 +27652,37 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27652
27652
|
sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
|
|
27653
27653
|
xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
|
|
27654
27654
|
};
|
|
27655
|
-
const badges =
|
|
27655
|
+
const badges = {
|
|
27656
27656
|
badges: {
|
|
27657
27657
|
anchor: "tr",
|
|
27658
27658
|
elements: [
|
|
27659
|
-
|
|
27660
|
-
|
|
27661
|
-
|
|
27662
|
-
|
|
27663
|
-
|
|
27664
|
-
|
|
27665
|
-
|
|
27659
|
+
...searchResultOptions.showRelevance && [
|
|
27660
|
+
{
|
|
27661
|
+
key: "",
|
|
27662
|
+
type: "customHtml",
|
|
27663
|
+
className: "relevance",
|
|
27664
|
+
html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
|
|
27665
|
+
display: (doc2) => Boolean(doc2._relevance !== void 0)
|
|
27666
|
+
}
|
|
27667
|
+
],
|
|
27668
|
+
...((_m = (_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) != null ? _m : false) && [
|
|
27669
|
+
{
|
|
27670
|
+
key: "",
|
|
27671
|
+
type: "customHtml",
|
|
27672
|
+
className: "boosted-marker",
|
|
27673
|
+
html: () => {
|
|
27674
|
+
var _a2;
|
|
27675
|
+
return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
|
|
27676
|
+
},
|
|
27677
|
+
display: (doc2) => doc2._boosted === true
|
|
27678
|
+
}
|
|
27679
|
+
]
|
|
27666
27680
|
]
|
|
27667
27681
|
}
|
|
27668
|
-
}
|
|
27682
|
+
};
|
|
27669
27683
|
return __spreadValues(__spreadProps(__spreadValues({
|
|
27670
27684
|
options: {
|
|
27671
|
-
environment: (
|
|
27685
|
+
environment: (_n = searchResultOptions.environment) != null ? _n : "production",
|
|
27672
27686
|
customUrl: searchResultOptions.customUrl,
|
|
27673
27687
|
customBaseUrl: searchResultOptions.customBaseUrl,
|
|
27674
27688
|
customPayload: searchResultOptions.customPayload,
|
|
@@ -27678,7 +27692,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27678
27692
|
queryKey: searchResultOptions.queryKey,
|
|
27679
27693
|
containerSelector: searchResultOptions.containerSelector,
|
|
27680
27694
|
searchTitlePosition: "search-results-top",
|
|
27681
|
-
titleKey: (
|
|
27695
|
+
titleKey: (_o = searchResultOptions.fields) == null ? void 0 : _o.titleKey,
|
|
27682
27696
|
labels: labels == null ? void 0 : labels.searchResults,
|
|
27683
27697
|
grid: {
|
|
27684
27698
|
columns
|
|
@@ -27711,7 +27725,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27711
27725
|
}
|
|
27712
27726
|
}, badges), {
|
|
27713
27727
|
links: {
|
|
27714
|
-
details: ((
|
|
27728
|
+
details: ((_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl) ? `{${(_q = searchResultOptions.fields) == null ? void 0 : _q.productUrl}}` : void 0
|
|
27715
27729
|
},
|
|
27716
27730
|
callbacks,
|
|
27717
27731
|
routingBehavior: callbacks ? "event" : "direct-link",
|
|
@@ -27720,31 +27734,31 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27720
27734
|
{
|
|
27721
27735
|
type: "image",
|
|
27722
27736
|
placeholder: placeholderImage,
|
|
27723
|
-
key: (
|
|
27724
|
-
baseUrl: (
|
|
27737
|
+
key: (_r = searchResultOptions.fields) == null ? void 0 : _r.imageKey,
|
|
27738
|
+
baseUrl: (_s = searchResultOptions.fields) == null ? void 0 : _s.baseImageUrl,
|
|
27725
27739
|
display: () => {
|
|
27726
27740
|
var _a2;
|
|
27727
27741
|
return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
|
|
27728
27742
|
}
|
|
27729
27743
|
},
|
|
27730
|
-
addFieldIfKeyExists("_emphasis", (
|
|
27744
|
+
addFieldIfKeyExists("_emphasis", (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField, {
|
|
27731
27745
|
type: "custom",
|
|
27732
27746
|
className: "lupa-custom-emphasis",
|
|
27733
|
-
key: (
|
|
27747
|
+
key: (_u = searchResultOptions.fields) == null ? void 0 : _u.emphasizedField,
|
|
27734
27748
|
display: () => true
|
|
27735
27749
|
}),
|
|
27736
27750
|
{
|
|
27737
27751
|
type: "title",
|
|
27738
|
-
key: (
|
|
27739
|
-
maxLines: (
|
|
27752
|
+
key: (_v = searchResultOptions.fields) == null ? void 0 : _v.titleKey,
|
|
27753
|
+
maxLines: (_w = searchResultOptions.maxLines) != null ? _w : 2,
|
|
27740
27754
|
display: (doc2) => {
|
|
27741
27755
|
var _a2, _b2;
|
|
27742
27756
|
return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
|
|
27743
27757
|
}
|
|
27744
27758
|
},
|
|
27745
27759
|
...getAdditionalElements(additionalFields),
|
|
27746
|
-
addFieldIfKeyExists("_discountPrice", (
|
|
27747
|
-
key: (
|
|
27760
|
+
addFieldIfKeyExists("_discountPrice", (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey, {
|
|
27761
|
+
key: (_y = searchResultOptions.fields) == null ? void 0 : _y.discountPriceKey,
|
|
27748
27762
|
type: "customHtml",
|
|
27749
27763
|
className: "lupa-price lupa-price-discounted",
|
|
27750
27764
|
display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
|
|
@@ -27766,8 +27780,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27766
27780
|
return discount + regular;
|
|
27767
27781
|
}
|
|
27768
27782
|
}),
|
|
27769
|
-
addFieldIfKeyExists("_regularPrice", (
|
|
27770
|
-
key: (
|
|
27783
|
+
addFieldIfKeyExists("_regularPrice", (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey, {
|
|
27784
|
+
key: (_A = searchResultOptions.fields) == null ? void 0 : _A.regularPriceKey,
|
|
27771
27785
|
type: "customHtml",
|
|
27772
27786
|
className: "lupa-price lupa-price-single",
|
|
27773
27787
|
display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
|
|
@@ -37,6 +37,10 @@ export type SearchResultDemoOptions = {
|
|
|
37
37
|
customHeaders?: Record<string, string>;
|
|
38
38
|
gridConfiguration?: Record<string, number>;
|
|
39
39
|
showRelevance?: boolean;
|
|
40
|
+
boostedMarker?: {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
label: string;
|
|
43
|
+
};
|
|
40
44
|
errorHandler?: (errorResponse: any) => unknown;
|
|
41
45
|
};
|
|
42
46
|
export type PreconfiguredSearchContainerOptions = {
|