@getlupa/client 0.7.0-alpha-7 → 0.7.0-alpha-10
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/index.min.js +18 -58
- package/dist/cjs/types/search-results/SearchResultsProductCardOptions.d.ts +2 -1
- package/dist/es/index.min.js +18 -58
- package/dist/es/types/search-results/SearchResultsProductCardOptions.d.ts +2 -1
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/types/search-results/SearchResultsProductCardOptions.d.ts +2 -1
- package/package.json +1 -1
package/dist/cjs/index.min.js
CHANGED
|
@@ -12156,7 +12156,10 @@ const generateResultLink = (link, searchText, facet) => {
|
|
|
12156
12156
|
const getRelativePath = (link) => {
|
|
12157
12157
|
try {
|
|
12158
12158
|
const url = new URL(link);
|
|
12159
|
-
|
|
12159
|
+
const partialUrl = url.toString().substring(url.origin.length);
|
|
12160
|
+
return partialUrl.endsWith("/")
|
|
12161
|
+
? partialUrl.slice(0, partialUrl.length - 1)
|
|
12162
|
+
: partialUrl;
|
|
12160
12163
|
}
|
|
12161
12164
|
catch (_a) {
|
|
12162
12165
|
// Invalid url, let's return original string
|
|
@@ -16798,15 +16801,16 @@ var __vue_render__$z = function () {
|
|
|
16798
16801
|
},
|
|
16799
16802
|
[
|
|
16800
16803
|
_c("span", { staticClass: "lupa-badge-title" }, [
|
|
16804
|
+
_vm.image ? _c("img", { attrs: { src: _vm.image } }) : _vm._e(),
|
|
16801
16805
|
_vm.badge.titleText
|
|
16802
|
-
? _c("span", [_vm._v("
|
|
16806
|
+
? _c("span", [_vm._v("\n " + _vm._s(_vm.badge.titleText))])
|
|
16803
16807
|
: _vm._e(),
|
|
16804
|
-
_vm._v(" "),
|
|
16805
|
-
_vm.image ? _c("img", { attrs: { src: _vm.image } }) : _vm._e(),
|
|
16806
|
-
]),
|
|
16807
|
-
_c("span", { staticClass: "lupa-badge-full-text" }, [
|
|
16808
|
-
_vm._v(_vm._s(_vm.badge.additionalText)),
|
|
16809
16808
|
]),
|
|
16809
|
+
_vm.badge.additionalText
|
|
16810
|
+
? _c("span", { staticClass: "lupa-badge-full-text" }, [
|
|
16811
|
+
_vm._v(_vm._s(_vm.badge.additionalText)),
|
|
16812
|
+
])
|
|
16813
|
+
: _vm._e(),
|
|
16810
16814
|
]
|
|
16811
16815
|
)
|
|
16812
16816
|
};
|
|
@@ -16842,60 +16846,16 @@ __vue_render__$z._withStripped = true;
|
|
|
16842
16846
|
undefined
|
|
16843
16847
|
);
|
|
16844
16848
|
|
|
16845
|
-
const test = [
|
|
16846
|
-
{
|
|
16847
|
-
background_color: "#4b80eb",
|
|
16848
|
-
head_text: "Įsigykite iš anksto!",
|
|
16849
|
-
key: "17-25176-prod",
|
|
16850
|
-
prod_color: "#ffffff",
|
|
16851
|
-
text: "",
|
|
16852
|
-
__typename: "Label",
|
|
16853
|
-
},
|
|
16854
|
-
{
|
|
16855
|
-
background_color: "#88022A",
|
|
16856
|
-
head_text: null,
|
|
16857
|
-
key: "14-25176-prod",
|
|
16858
|
-
prod_color: "#ffffff",
|
|
16859
|
-
text: "Naujiena",
|
|
16860
|
-
__typename: "Label",
|
|
16861
|
-
},
|
|
16862
|
-
{
|
|
16863
|
-
background_color: "#C9247C",
|
|
16864
|
-
head_text: "Top",
|
|
16865
|
-
key: "15-25176-prod",
|
|
16866
|
-
prod_color: "#ffffff",
|
|
16867
|
-
text: "Top prekė",
|
|
16868
|
-
__typename: "Label",
|
|
16869
|
-
},
|
|
16870
|
-
{
|
|
16871
|
-
background_color: "#f8eaee",
|
|
16872
|
-
head_text: null,
|
|
16873
|
-
key: "19-25176-prod",
|
|
16874
|
-
prod_color: "#730324",
|
|
16875
|
-
text: "Su Pegaso kortele",
|
|
16876
|
-
__typename: "Label",
|
|
16877
|
-
},
|
|
16878
|
-
{
|
|
16879
|
-
background_color: "#F5A623",
|
|
16880
|
-
head_text: "Greitai",
|
|
16881
|
-
key: "18-25176-prod",
|
|
16882
|
-
prod_color: "#ffffff",
|
|
16883
|
-
text: "Pasirodys prekyboje",
|
|
16884
|
-
__typename: "Label",
|
|
16885
|
-
},
|
|
16886
|
-
];
|
|
16887
16849
|
let SearchResultGeneratedBadges = class SearchResultGeneratedBadges extends Vue$1 {
|
|
16888
16850
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16889
16851
|
get badgeField() {
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
|
|
16894
|
-
|
|
16895
|
-
|
|
16896
|
-
|
|
16897
|
-
// );
|
|
16898
|
-
return test;
|
|
16852
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
16853
|
+
const fieldHasBadges = ((_a = this.options.generate) === null || _a === void 0 ? void 0 : _a.key) &&
|
|
16854
|
+
this.options.product[(_c = (_b = this.options.generate) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : ""] &&
|
|
16855
|
+
Array.isArray(this.options.product[(_e = (_d = this.options.generate) === null || _d === void 0 ? void 0 : _d.key) !== null && _e !== void 0 ? _e : ""]);
|
|
16856
|
+
return fieldHasBadges
|
|
16857
|
+
? this.options.product[(_g = (_f = this.options.generate) === null || _f === void 0 ? void 0 : _f.key) !== null && _g !== void 0 ? _g : ""]
|
|
16858
|
+
: [];
|
|
16899
16859
|
}
|
|
16900
16860
|
get keyMap() {
|
|
16901
16861
|
var _a, _b;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
2
2
|
import { DocumentElement } from "../DocumentElement";
|
|
3
|
-
import { BadgeElement } from "./BadgeOptions";
|
|
3
|
+
import { BadgeElement, BadgeGenerateOptions } from "./BadgeOptions";
|
|
4
4
|
import { RoutingBehavior } from "./RoutingBehavior";
|
|
5
5
|
import { SearchResultsOptionLabels } from "./SearchResultsOptions";
|
|
6
6
|
export declare type SearchResultsProductCardOptions = {
|
|
@@ -18,5 +18,6 @@ export declare type SearchResultsProductCardOptions = {
|
|
|
18
18
|
export declare type SearchResultBadgeOptions = {
|
|
19
19
|
anchor: AnchorPosition;
|
|
20
20
|
elements: BadgeElement[];
|
|
21
|
+
generate?: BadgeGenerateOptions;
|
|
21
22
|
};
|
|
22
23
|
export declare type AnchorPosition = "tr" | "tl";
|
package/dist/es/index.min.js
CHANGED
|
@@ -12152,7 +12152,10 @@ const generateResultLink = (link, searchText, facet) => {
|
|
|
12152
12152
|
const getRelativePath = (link) => {
|
|
12153
12153
|
try {
|
|
12154
12154
|
const url = new URL(link);
|
|
12155
|
-
|
|
12155
|
+
const partialUrl = url.toString().substring(url.origin.length);
|
|
12156
|
+
return partialUrl.endsWith("/")
|
|
12157
|
+
? partialUrl.slice(0, partialUrl.length - 1)
|
|
12158
|
+
: partialUrl;
|
|
12156
12159
|
}
|
|
12157
12160
|
catch (_a) {
|
|
12158
12161
|
// Invalid url, let's return original string
|
|
@@ -16794,15 +16797,16 @@ var __vue_render__$z = function () {
|
|
|
16794
16797
|
},
|
|
16795
16798
|
[
|
|
16796
16799
|
_c("span", { staticClass: "lupa-badge-title" }, [
|
|
16800
|
+
_vm.image ? _c("img", { attrs: { src: _vm.image } }) : _vm._e(),
|
|
16797
16801
|
_vm.badge.titleText
|
|
16798
|
-
? _c("span", [_vm._v("
|
|
16802
|
+
? _c("span", [_vm._v("\n " + _vm._s(_vm.badge.titleText))])
|
|
16799
16803
|
: _vm._e(),
|
|
16800
|
-
_vm._v(" "),
|
|
16801
|
-
_vm.image ? _c("img", { attrs: { src: _vm.image } }) : _vm._e(),
|
|
16802
|
-
]),
|
|
16803
|
-
_c("span", { staticClass: "lupa-badge-full-text" }, [
|
|
16804
|
-
_vm._v(_vm._s(_vm.badge.additionalText)),
|
|
16805
16804
|
]),
|
|
16805
|
+
_vm.badge.additionalText
|
|
16806
|
+
? _c("span", { staticClass: "lupa-badge-full-text" }, [
|
|
16807
|
+
_vm._v(_vm._s(_vm.badge.additionalText)),
|
|
16808
|
+
])
|
|
16809
|
+
: _vm._e(),
|
|
16806
16810
|
]
|
|
16807
16811
|
)
|
|
16808
16812
|
};
|
|
@@ -16838,60 +16842,16 @@ __vue_render__$z._withStripped = true;
|
|
|
16838
16842
|
undefined
|
|
16839
16843
|
);
|
|
16840
16844
|
|
|
16841
|
-
const test = [
|
|
16842
|
-
{
|
|
16843
|
-
background_color: "#4b80eb",
|
|
16844
|
-
head_text: "Įsigykite iš anksto!",
|
|
16845
|
-
key: "17-25176-prod",
|
|
16846
|
-
prod_color: "#ffffff",
|
|
16847
|
-
text: "",
|
|
16848
|
-
__typename: "Label",
|
|
16849
|
-
},
|
|
16850
|
-
{
|
|
16851
|
-
background_color: "#88022A",
|
|
16852
|
-
head_text: null,
|
|
16853
|
-
key: "14-25176-prod",
|
|
16854
|
-
prod_color: "#ffffff",
|
|
16855
|
-
text: "Naujiena",
|
|
16856
|
-
__typename: "Label",
|
|
16857
|
-
},
|
|
16858
|
-
{
|
|
16859
|
-
background_color: "#C9247C",
|
|
16860
|
-
head_text: "Top",
|
|
16861
|
-
key: "15-25176-prod",
|
|
16862
|
-
prod_color: "#ffffff",
|
|
16863
|
-
text: "Top prekė",
|
|
16864
|
-
__typename: "Label",
|
|
16865
|
-
},
|
|
16866
|
-
{
|
|
16867
|
-
background_color: "#f8eaee",
|
|
16868
|
-
head_text: null,
|
|
16869
|
-
key: "19-25176-prod",
|
|
16870
|
-
prod_color: "#730324",
|
|
16871
|
-
text: "Su Pegaso kortele",
|
|
16872
|
-
__typename: "Label",
|
|
16873
|
-
},
|
|
16874
|
-
{
|
|
16875
|
-
background_color: "#F5A623",
|
|
16876
|
-
head_text: "Greitai",
|
|
16877
|
-
key: "18-25176-prod",
|
|
16878
|
-
prod_color: "#ffffff",
|
|
16879
|
-
text: "Pasirodys prekyboje",
|
|
16880
|
-
__typename: "Label",
|
|
16881
|
-
},
|
|
16882
|
-
];
|
|
16883
16845
|
let SearchResultGeneratedBadges = class SearchResultGeneratedBadges extends Vue$1 {
|
|
16884
16846
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16885
16847
|
get badgeField() {
|
|
16886
|
-
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
// );
|
|
16894
|
-
return test;
|
|
16848
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
16849
|
+
const fieldHasBadges = ((_a = this.options.generate) === null || _a === void 0 ? void 0 : _a.key) &&
|
|
16850
|
+
this.options.product[(_c = (_b = this.options.generate) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : ""] &&
|
|
16851
|
+
Array.isArray(this.options.product[(_e = (_d = this.options.generate) === null || _d === void 0 ? void 0 : _d.key) !== null && _e !== void 0 ? _e : ""]);
|
|
16852
|
+
return fieldHasBadges
|
|
16853
|
+
? this.options.product[(_g = (_f = this.options.generate) === null || _f === void 0 ? void 0 : _f.key) !== null && _g !== void 0 ? _g : ""]
|
|
16854
|
+
: [];
|
|
16895
16855
|
}
|
|
16896
16856
|
get keyMap() {
|
|
16897
16857
|
var _a, _b;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
2
2
|
import { DocumentElement } from "../DocumentElement";
|
|
3
|
-
import { BadgeElement } from "./BadgeOptions";
|
|
3
|
+
import { BadgeElement, BadgeGenerateOptions } from "./BadgeOptions";
|
|
4
4
|
import { RoutingBehavior } from "./RoutingBehavior";
|
|
5
5
|
import { SearchResultsOptionLabels } from "./SearchResultsOptions";
|
|
6
6
|
export declare type SearchResultsProductCardOptions = {
|
|
@@ -18,5 +18,6 @@ export declare type SearchResultsProductCardOptions = {
|
|
|
18
18
|
export declare type SearchResultBadgeOptions = {
|
|
19
19
|
anchor: AnchorPosition;
|
|
20
20
|
elements: BadgeElement[];
|
|
21
|
+
generate?: BadgeGenerateOptions;
|
|
21
22
|
};
|
|
22
23
|
export declare type AnchorPosition = "tr" | "tl";
|