@postnord/pn-marketweb-components 2.0.78 → 2.0.80
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/cjs/{MarketWebContextService-5840b8e0.js → FetchHelper-c6cee722.js} +85 -0
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-bonus-progressbar-level.cjs.entry.js +1 -1
- package/cjs/pn-bonus-progressbar.cjs.entry.js +1 -1
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-marketweb-sitefooter.cjs.entry.js +2 -3
- package/cjs/pn-marketweb-siteheader.cjs.entry.js +2 -3
- package/cjs/pn-product-card_4.cjs.entry.js +1 -1
- package/cjs/pn-proxio-pricegroup.cjs.entry.js +108 -0
- package/cjs/pn-proxio-productcard_4.cjs.entry.js +67 -0
- package/collection/collection-manifest.json +4 -1
- package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar-level.css +3 -3
- package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar.js +0 -1
- package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar.stories.js +69 -24
- package/collection/components/minor/pn-titletag/pn-titletag.css +4 -0
- package/collection/components/minor/pn-titletag/title-tag.stories.js +1 -0
- package/collection/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.css +71 -0
- package/collection/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.js +204 -0
- package/collection/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.stories.js +27 -0
- package/collection/components/widgets/pn-proxio-pricegroup/translations.js +16 -0
- package/collection/components/widgets/pn-proxio-pricegroup/types.js +1 -0
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-description.css +6 -0
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-description.js +93 -0
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-information.css +6 -0
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-information.js +67 -0
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-pricelink.css +13 -0
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-pricelink.js +69 -0
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard.css +60 -0
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard.js +11 -8
- package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard.stories.js +42 -5
- package/custom-elements/index.d.ts +22 -4
- package/custom-elements/index.js +177 -58
- package/esm/{MarketWebContextService-160bf3dd.js → FetchHelper-1dfe8514.js} +85 -1
- package/esm/loader.js +1 -1
- package/esm/pn-bonus-progressbar-level.entry.js +1 -1
- package/esm/pn-bonus-progressbar.entry.js +1 -1
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-marketweb-sitefooter.entry.js +1 -2
- package/esm/pn-marketweb-siteheader.entry.js +1 -2
- package/esm/pn-product-card_4.entry.js +1 -1
- package/esm/pn-proxio-pricegroup.entry.js +104 -0
- package/esm/pn-proxio-productcard_4.entry.js +60 -0
- package/esm-es5/{MarketWebContextService-160bf3dd.js → FetchHelper-1dfe8514.js} +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-bonus-progressbar-level.entry.js +1 -1
- package/esm-es5/pn-bonus-progressbar.entry.js +1 -1
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-marketweb-sitefooter.entry.js +1 -1
- package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
- package/esm-es5/pn-product-card_4.entry.js +1 -1
- package/esm-es5/pn-proxio-pricegroup.entry.js +1 -0
- package/esm-es5/pn-proxio-productcard_4.entry.js +1 -0
- package/package.json +1 -1
- package/pn-market-web-components/{p-f1812fbb.entry.js → p-022d9a78.entry.js} +1 -1
- package/pn-market-web-components/{p-3ce2b566.system.entry.js → p-1151bf60.system.entry.js} +1 -1
- package/pn-market-web-components/{p-5b750c06.system.entry.js → p-198d9c77.system.entry.js} +1 -1
- package/pn-market-web-components/p-36a1b8e1.system.entry.js +1 -0
- package/pn-market-web-components/p-4bef1bf3.entry.js +1 -0
- package/pn-market-web-components/p-5482774f.entry.js +1 -0
- package/pn-market-web-components/p-6174a610.system.js +1 -0
- package/pn-market-web-components/p-67887512.system.js +1 -1
- package/pn-market-web-components/p-6c8d3789.system.entry.js +1 -0
- package/pn-market-web-components/p-6d08e5cc.system.entry.js +1 -0
- package/pn-market-web-components/{p-e8d97347.entry.js → p-7ce41d14.entry.js} +1 -1
- package/pn-market-web-components/p-942ad206.system.entry.js +1 -0
- package/pn-market-web-components/p-c3ea7666.entry.js +1 -0
- package/pn-market-web-components/p-c5f4d6c1.entry.js +1 -0
- package/pn-market-web-components/p-df9708f2.entry.js +1 -0
- package/pn-market-web-components/p-e54d477c.system.entry.js +1 -0
- package/pn-market-web-components/{p-0a7b7046.js → p-f0f58646.js} +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.d.ts +23 -0
- package/types/components/widgets/pn-proxio-pricegroup/translations.d.ts +16 -0
- package/types/components/widgets/pn-proxio-pricegroup/types.d.ts +36 -0
- package/types/components/widgets/pn-proxio-productcard/pn-proxio-productcard-description.d.ts +7 -0
- package/types/components/widgets/pn-proxio-productcard/pn-proxio-productcard-information.d.ts +6 -0
- package/types/components/widgets/pn-proxio-productcard/pn-proxio-productcard-pricelink.d.ts +6 -0
- package/types/components.d.ts +77 -11
- package/umd/pn-marketweb-salesforce.js +2 -2
- package/cjs/FetchHelper-f80943bf.js +0 -87
- package/cjs/pn-proxio-pricefinder.cjs.entry.js +0 -43
- package/cjs/pn-proxio-productcard.cjs.entry.js +0 -19
- package/collection/components/widgets/pn-proxio-pricefinder/pn-proxio-pricefinder.css +0 -0
- package/collection/components/widgets/pn-proxio-pricefinder/pn-proxio-pricefinder.js +0 -98
- package/collection/components/widgets/pn-proxio-pricefinder/pn-proxio-pricefinder.stories.js +0 -22
- package/esm/FetchHelper-a0c8aa54.js +0 -85
- package/esm/pn-proxio-pricefinder.entry.js +0 -39
- package/esm/pn-proxio-productcard.entry.js +0 -15
- package/esm-es5/FetchHelper-a0c8aa54.js +0 -1
- package/esm-es5/pn-proxio-pricefinder.entry.js +0 -1
- package/esm-es5/pn-proxio-productcard.entry.js +0 -1
- package/pn-market-web-components/p-059e4c47.system.entry.js +0 -1
- package/pn-market-web-components/p-1a97780a.system.js +0 -1
- package/pn-market-web-components/p-2745cc43.entry.js +0 -1
- package/pn-market-web-components/p-2b8aa6a9.entry.js +0 -1
- package/pn-market-web-components/p-42a56aeb.entry.js +0 -1
- package/pn-market-web-components/p-831c0495.system.entry.js +0 -1
- package/pn-market-web-components/p-8985b02b.system.entry.js +0 -1
- package/pn-market-web-components/p-8b9961c9.system.entry.js +0 -1
- package/pn-market-web-components/p-97dc5687.js +0 -1
- package/pn-market-web-components/p-a89a2eb3.entry.js +0 -1
- package/pn-market-web-components/p-b8e9177e.system.entry.js +0 -1
- package/pn-market-web-components/p-c7afc979.entry.js +0 -1
- package/pn-market-web-components/p-d6a17042.system.js +0 -1
- package/types/components/widgets/pn-proxio-pricefinder/pn-proxio-pricefinder.d.ts +0 -13
|
@@ -13,39 +13,84 @@ const Template = ({ ...args }) => {
|
|
|
13
13
|
<div style="width:500px;padding-bottom:100px;">
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
<pn-bonus-progressbar value="
|
|
17
|
-
icon="
|
|
18
|
-
theme="
|
|
19
|
-
bonuspercentage="
|
|
20
|
-
heading="Din rabatt på
|
|
21
|
-
sumtext="Nuvarande
|
|
22
|
-
<pn-bonus-progressbar-level value="0" bonuspercentage="
|
|
23
|
-
<pn-bonus-progressbar-level value="
|
|
24
|
-
<pn-bonus-progressbar-level value="
|
|
25
|
-
<pn-bonus-progressbar-level value="
|
|
26
|
-
<pn-bonus-progressbar-level value="
|
|
16
|
+
<pn-bonus-progressbar value="0"
|
|
17
|
+
icon="box"
|
|
18
|
+
theme="blue"
|
|
19
|
+
bonuspercentage="7%"
|
|
20
|
+
heading="Din rabatt på frimärken"
|
|
21
|
+
sumtext="Nuvarande inköpssumma: 0 SEK">
|
|
22
|
+
<pn-bonus-progressbar-level value="0" bonuspercentage="7%"></pn-bonus-progressbar-level>
|
|
23
|
+
<pn-bonus-progressbar-level value="250001" bonuspercentage="7.5%"></pn-bonus-progressbar-level>
|
|
24
|
+
<pn-bonus-progressbar-level value="450001" bonuspercentage="8%"></pn-bonus-progressbar-level>
|
|
25
|
+
<pn-bonus-progressbar-level value="900001" bonuspercentage="9%"></pn-bonus-progressbar-level>
|
|
26
|
+
<pn-bonus-progressbar-level value="1500001" bonuspercentage="11%"></pn-bonus-progressbar-level>
|
|
27
27
|
|
|
28
28
|
</pn-bonus-progressbar>
|
|
29
|
+
|
|
29
30
|
</div>
|
|
31
|
+
|
|
30
32
|
<div style="width:380px;margin-bottom:3em;">
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<pn-bonus-progressbar value="477483"
|
|
37
|
+
icon="box"
|
|
38
|
+
theme="blue"
|
|
39
|
+
bonuspercentage="8%"
|
|
40
|
+
heading="Din rabatt på frimärken"
|
|
41
|
+
sumtext="Nuvarande inköpssumma: 477483 SEK">
|
|
42
|
+
<pn-bonus-progressbar-level value="0" bonuspercentage="7%"></pn-bonus-progressbar-level>
|
|
43
|
+
<pn-bonus-progressbar-level value="250001" bonuspercentage="7.5%"></pn-bonus-progressbar-level>
|
|
44
|
+
<pn-bonus-progressbar-level value="450001" bonuspercentage="8%"></pn-bonus-progressbar-level>
|
|
45
|
+
<pn-bonus-progressbar-level value="900001" bonuspercentage="9%"></pn-bonus-progressbar-level>
|
|
46
|
+
<pn-bonus-progressbar-level value="1500001" bonuspercentage="11%"></pn-bonus-progressbar-level>
|
|
47
|
+
|
|
48
|
+
</pn-bonus-progressbar>
|
|
49
|
+
|
|
50
|
+
|
|
44
51
|
</div>
|
|
45
52
|
|
|
46
53
|
`;
|
|
47
54
|
};
|
|
48
55
|
|
|
56
|
+
// const Template = ({ ...args }) => {
|
|
57
|
+
// return `
|
|
58
|
+
// <div style="width:500px;padding-bottom:100px;">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
// <pn-bonus-progressbar value="970132"
|
|
62
|
+
// icon="stamp"
|
|
63
|
+
// theme="red"
|
|
64
|
+
// bonuspercentage="17%"
|
|
65
|
+
// heading="Din rabatt på Varor"
|
|
66
|
+
// sumtext="Nuvarande summa: 970132 SEK">
|
|
67
|
+
// <pn-bonus-progressbar-level value="0" bonuspercentage="14%"></pn-bonus-progressbar-level>
|
|
68
|
+
// <pn-bonus-progressbar-level value="15001" bonuspercentage="15%"></pn-bonus-progressbar-level>
|
|
69
|
+
// <pn-bonus-progressbar-level value="35001" bonuspercentage="15.5%"></pn-bonus-progressbar-level>
|
|
70
|
+
// <pn-bonus-progressbar-level value="70001" bonuspercentage="16%"></pn-bonus-progressbar-level>
|
|
71
|
+
// <pn-bonus-progressbar-level value="105001" bonuspercentage="17%"></pn-bonus-progressbar-level>
|
|
72
|
+
|
|
73
|
+
// </pn-bonus-progressbar>
|
|
74
|
+
// </div>
|
|
75
|
+
// <div style="width:380px;margin-bottom:3em;">
|
|
76
|
+
// <pn-bonus-progressbar value="268905"
|
|
77
|
+
// icon="stamp"
|
|
78
|
+
// theme="blue"
|
|
79
|
+
// bonuspercentage="7.5%"
|
|
80
|
+
// heading="Din rabatt på frimärken"
|
|
81
|
+
// sumtext="268905 SEK">
|
|
82
|
+
// <pn-bonus-progressbar-level value="0" bonuspercentage="7%"></pn-bonus-progressbar-level>
|
|
83
|
+
// <pn-bonus-progressbar-level value="250001" bonuspercentage="7.5%"></pn-bonus-progressbar-level>
|
|
84
|
+
// <pn-bonus-progressbar-level value="450001" bonuspercentage="8%"></pn-bonus-progressbar-level>
|
|
85
|
+
// <pn-bonus-progressbar-level value="900001" bonuspercentage="9%"></pn-bonus-progressbar-level>
|
|
86
|
+
// <pn-bonus-progressbar-level value="1500001" bonuspercentage="11%"></pn-bonus-progressbar-level>
|
|
87
|
+
|
|
88
|
+
// </pn-bonus-progressbar>
|
|
89
|
+
// </div>
|
|
90
|
+
|
|
91
|
+
// `;
|
|
92
|
+
// };
|
|
93
|
+
|
|
49
94
|
export const Primary = Template.bind({});
|
|
50
95
|
Primary.args = {
|
|
51
96
|
|
|
@@ -24,4 +24,8 @@ pn-titletag[color=coral700], pn-titletag[color=coral] {
|
|
|
24
24
|
pn-titletag[color=gray900], pn-titletag[color=gray], pn-titletag[color=grey] {
|
|
25
25
|
background: #D3CECB;
|
|
26
26
|
color: #2D2013;
|
|
27
|
+
}
|
|
28
|
+
pn-titletag[color=gray50], pn-titletag[color=lightgray], pn-titletag[color=lightgrey] {
|
|
29
|
+
background: #F3F2F2;
|
|
30
|
+
color: #2D2013;
|
|
27
31
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
pn-proxio-pricegroup div.weightcontainer {
|
|
2
|
+
margin: 3rem 0;
|
|
3
|
+
}
|
|
4
|
+
pn-proxio-pricegroup div.weightvaluecontainer {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
align-content: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
align-items: flex-start;
|
|
11
|
+
}
|
|
12
|
+
pn-proxio-pricegroup div.weightdata {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
align-content: center;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
height: 5rem;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
}
|
|
21
|
+
pn-proxio-pricegroup input[type=radio] {
|
|
22
|
+
-webkit-appearance: none;
|
|
23
|
+
-moz-appearance: none;
|
|
24
|
+
width: 1.3rem;
|
|
25
|
+
height: 1.3rem;
|
|
26
|
+
background-color: #005D92;
|
|
27
|
+
border-radius: 50%;
|
|
28
|
+
}
|
|
29
|
+
pn-proxio-pricegroup input[type=radio]:checked {
|
|
30
|
+
z-index: 1;
|
|
31
|
+
transform: translateY(-0.1rem);
|
|
32
|
+
height: 1.5rem;
|
|
33
|
+
width: 1.5rem;
|
|
34
|
+
box-shadow: 0 0 0 0.3rem #FFFFFF, 0 0 0 0.4rem #005D92;
|
|
35
|
+
}
|
|
36
|
+
pn-proxio-pricegroup pn-button[disabled=disabled] {
|
|
37
|
+
opacity: 0.2;
|
|
38
|
+
}
|
|
39
|
+
pn-proxio-pricegroup pn-button button div.button-tooltip {
|
|
40
|
+
visibility: hidden;
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
pn-proxio-pricegroup pn-button button:focus .pn-button-bg {
|
|
44
|
+
box-shadow: none;
|
|
45
|
+
}
|
|
46
|
+
pn-proxio-pricegroup div.weightradios {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
align-items: center;
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
color: #005D92;
|
|
53
|
+
width: 80%;
|
|
54
|
+
margin-left: auto;
|
|
55
|
+
margin-right: auto;
|
|
56
|
+
position: relative;
|
|
57
|
+
}
|
|
58
|
+
pn-proxio-pricegroup div.weightline {
|
|
59
|
+
width: 100%;
|
|
60
|
+
background-color: #F3F2F2;
|
|
61
|
+
z-index: -1;
|
|
62
|
+
height: 0.7rem;
|
|
63
|
+
-webkit-transform: translateX(2.1rem) translateY(1.32rem);
|
|
64
|
+
transform: translateX(2.1rem) translateY(1.32rem);
|
|
65
|
+
border-radius: 3rem;
|
|
66
|
+
margin-right: 3.5rem;
|
|
67
|
+
}
|
|
68
|
+
pn-proxio-pricegroup .activeweight {
|
|
69
|
+
font-size: large;
|
|
70
|
+
font-weight: bold;
|
|
71
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { Component, h, Host, Listen, Prop, State } from "@stencil/core";
|
|
2
|
+
import { FetchHelper } from "../../../globals/FetchHelper";
|
|
3
|
+
import { MarketWebContextService } from "../../../globals/MarketWebContextService";
|
|
4
|
+
import { translations } from "./translations";
|
|
5
|
+
export class PnProxioPricegroup {
|
|
6
|
+
constructor() {
|
|
7
|
+
/** Specifies which endpoint domain we should load from */
|
|
8
|
+
this.endpoint = null;
|
|
9
|
+
this.culture = "sv-se";
|
|
10
|
+
this.tariffid = "";
|
|
11
|
+
this.cache = true;
|
|
12
|
+
this.activeWeightIndex = 0;
|
|
13
|
+
this.data = null;
|
|
14
|
+
this.i18n = translations["sv-se"];
|
|
15
|
+
this.fetchHelper = new FetchHelper("proxiopricegroup");
|
|
16
|
+
}
|
|
17
|
+
componentWillLoad() {
|
|
18
|
+
this.setInitialValues().then(() => {
|
|
19
|
+
this.init();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async setInitialValues(href = window.location.href) {
|
|
23
|
+
const marketWebContextService = new MarketWebContextService(href);
|
|
24
|
+
const environment = await marketWebContextService.getEnvironmentName();
|
|
25
|
+
if ((!this.endpoint && (environment === null || environment === void 0 ? void 0 : environment.indexOf('local')) === -1)) {
|
|
26
|
+
const market = await marketWebContextService.getMarket();
|
|
27
|
+
this.endpoint = await marketWebContextService.getEndpoint(environment, market);
|
|
28
|
+
}
|
|
29
|
+
if (!this.endpoint) {
|
|
30
|
+
this.endpoint = "";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
init() {
|
|
34
|
+
this.setCulture();
|
|
35
|
+
this.fetchData();
|
|
36
|
+
}
|
|
37
|
+
async fetchData() {
|
|
38
|
+
if (!this.culture || !this.tariffid) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const endpoint = (this.endpoint.lastIndexOf("/") === this.endpoint.length - 1) ? this.endpoint.substring(0, this.endpoint.length - 1) : this.endpoint;
|
|
42
|
+
const fetchUrl = `${endpoint}/api/proxio/price-list-group?tariffId=${this.tariffid}&culture=${this.culture}&cached=${this.cache}`;
|
|
43
|
+
const data = await this.fetchHelper.fetchJson(fetchUrl, {
|
|
44
|
+
'mode': 'cors'
|
|
45
|
+
}, this.cache, this.onFetchData.bind(this));
|
|
46
|
+
if (data === null || data === void 0 ? void 0 : data.proxioProduct) {
|
|
47
|
+
this.data = data;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
onFetchData(data) {
|
|
51
|
+
this.data = data;
|
|
52
|
+
}
|
|
53
|
+
setActiveWeightIndex(weightIndex) {
|
|
54
|
+
var _a, _b, _c;
|
|
55
|
+
let minIndex = 0;
|
|
56
|
+
let maxIndex = (_c = ((_b = (_a = this.data.proxioProduct) === null || _a === void 0 ? void 0 : _a.weightAndPriceList) === null || _b === void 0 ? void 0 : _b.length) - 1) !== null && _c !== void 0 ? _c : minIndex;
|
|
57
|
+
weightIndex = weightIndex > maxIndex ? maxIndex : weightIndex;
|
|
58
|
+
weightIndex = weightIndex < minIndex ? minIndex : weightIndex;
|
|
59
|
+
this.activeWeightIndex = weightIndex;
|
|
60
|
+
}
|
|
61
|
+
setCulture() {
|
|
62
|
+
if (translations[this.culture]) {
|
|
63
|
+
this.i18n = translations[this.culture];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
getPrice(product) {
|
|
67
|
+
var _a;
|
|
68
|
+
return (_a = product === null || product === void 0 ? void 0 : product.weightAndPriceList[this.activeWeightIndex]) === null || _a === void 0 ? void 0 : _a.item2;
|
|
69
|
+
}
|
|
70
|
+
isActive(index) {
|
|
71
|
+
return index === this.activeWeightIndex;
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
var _a, _b, _c;
|
|
75
|
+
return (h(Host, null, ((_a = this.data) === null || _a === void 0 ? void 0 : _a.proxioProduct) ? (h("div", null,
|
|
76
|
+
h("div", { class: "weightcontainer" }, this.data.proxioProduct.weightAndPriceList ?
|
|
77
|
+
(h("div", { class: "weightvaluecontainer" },
|
|
78
|
+
h("pn-button", { disabled: this.activeWeightIndex === 0 ? ("disabled") : (null), "icon-only": "true", icon: "arrow-left", appearance: "light", small: "true", onClick: () => this.setActiveWeightIndex(this.activeWeightIndex - 1) }),
|
|
79
|
+
h("div", { class: "weightradios" },
|
|
80
|
+
h("div", { class: "weightline" }),
|
|
81
|
+
this.data.proxioProduct.weightAndPriceList.map((weightItem, index) => h("div", { class: "weightdata" + (this.isActive(index) ? (" activeweight") : ("")) },
|
|
82
|
+
h("input", { type: "radio", id: "weightradio" + index, name: "weightradio", value: index, checked: this.isActive(index), onClick: () => this.setActiveWeightIndex(index) }),
|
|
83
|
+
h("label", { htmlFor: "weightradio" + index }, weightItem.item1)))),
|
|
84
|
+
h("pn-button", { disabled: this.activeWeightIndex === ((_c = (_b = this.data.proxioProduct) === null || _b === void 0 ? void 0 : _b.weightAndPriceList) === null || _c === void 0 ? void 0 : _c.length) - 1 ? ("disabled") : (null), icon: "arrow-right", appearance: "light", "icon-only": "true", small: "true", onClick: () => this.setActiveWeightIndex(this.activeWeightIndex + 1) }))) : (null)),
|
|
85
|
+
h("pn-proxio-productcard", null,
|
|
86
|
+
h("h2", { slot: "title" }, this.data.proxioProduct.productTitle),
|
|
87
|
+
h("pn-proxio-productcard-description", { slot: "description", heading: this.data.proxioProduct.productPreamble, highlight: this.data.proxioProduct.deliveryDateInformation, list: this.data.proxioProduct.productDescriptionBulletListItems }),
|
|
88
|
+
h("div", { slot: "information" },
|
|
89
|
+
h("pn-proxio-productcard-information", { label: this.i18n.labelPackage, information: this.data.proxioProduct.productPackageDimensionsList }),
|
|
90
|
+
h("pn-proxio-productcard-information", { label: this.i18n.labelRoll, information: this.data.proxioProduct.productRollDimensionsList })),
|
|
91
|
+
h("div", { slot: "bottomtags" },
|
|
92
|
+
this.data.proxioProduct.tracable ?
|
|
93
|
+
(h("pn-titletag", { color: "gray50" }, this.i18n.notTraceable)) : (null),
|
|
94
|
+
this.data.proxioProduct.usp1 ?
|
|
95
|
+
(h("pn-titletag", { color: "gray50" }, this.data.proxioProduct.usp1)) : (null),
|
|
96
|
+
this.data.proxioProduct.usp2 ?
|
|
97
|
+
(h("pn-titletag", { color: "gray50" }, this.data.proxioProduct.usp2)) : (null),
|
|
98
|
+
this.data.proxioProduct.usp3 ?
|
|
99
|
+
(h("pn-titletag", { color: "gray50" }, this.data.proxioProduct.usp3)) : (null)),
|
|
100
|
+
h("pn-illustration", { slot: "illustration", illustration: this.data.proxioProduct.productIcon }),
|
|
101
|
+
h("div", { slot: "pricelink" },
|
|
102
|
+
h("pn-proxio-productcard-pricelink", { price: this.i18n.from + this.getPrice(this.data.proxioProduct), link: this.data.proxioProduct.productLink, linktext: this.data.proxioProduct.productLinkText }),
|
|
103
|
+
this.data.relatedProxioProducts ? (this.data.relatedProxioProducts.map((product) => (h("pn-proxio-productcard-pricelink", { price: this.i18n.from + this.getPrice(product), link: product.productLink, linktext: product.productLinkText })))) : (null))))) : (null)));
|
|
104
|
+
}
|
|
105
|
+
static get is() { return "pn-proxio-pricegroup"; }
|
|
106
|
+
static get originalStyleUrls() { return {
|
|
107
|
+
"$": ["pn-proxio-pricegroup.scss"]
|
|
108
|
+
}; }
|
|
109
|
+
static get styleUrls() { return {
|
|
110
|
+
"$": ["pn-proxio-pricegroup.css"]
|
|
111
|
+
}; }
|
|
112
|
+
static get properties() { return {
|
|
113
|
+
"endpoint": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"mutable": true,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "string",
|
|
118
|
+
"resolved": "string",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": "Specifies which endpoint domain we should load from"
|
|
126
|
+
},
|
|
127
|
+
"attribute": "endpoint",
|
|
128
|
+
"reflect": false,
|
|
129
|
+
"defaultValue": "null"
|
|
130
|
+
},
|
|
131
|
+
"culture": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": ""
|
|
144
|
+
},
|
|
145
|
+
"attribute": "culture",
|
|
146
|
+
"reflect": false,
|
|
147
|
+
"defaultValue": "\"sv-se\""
|
|
148
|
+
},
|
|
149
|
+
"tariffid": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "string",
|
|
154
|
+
"resolved": "string",
|
|
155
|
+
"references": {}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": ""
|
|
162
|
+
},
|
|
163
|
+
"attribute": "tariffid",
|
|
164
|
+
"reflect": false,
|
|
165
|
+
"defaultValue": "\"\""
|
|
166
|
+
},
|
|
167
|
+
"cache": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"mutable": false,
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "boolean",
|
|
172
|
+
"resolved": "boolean",
|
|
173
|
+
"references": {}
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"optional": false,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": ""
|
|
180
|
+
},
|
|
181
|
+
"attribute": "cache",
|
|
182
|
+
"reflect": false,
|
|
183
|
+
"defaultValue": "true"
|
|
184
|
+
}
|
|
185
|
+
}; }
|
|
186
|
+
static get states() { return {
|
|
187
|
+
"activeWeightIndex": {},
|
|
188
|
+
"data": {},
|
|
189
|
+
"i18n": {}
|
|
190
|
+
}; }
|
|
191
|
+
static get listeners() { return [{
|
|
192
|
+
"name": "activeWeightIndex",
|
|
193
|
+
"method": "setActiveWeightIndex",
|
|
194
|
+
"target": undefined,
|
|
195
|
+
"capture": false,
|
|
196
|
+
"passive": false
|
|
197
|
+
}, {
|
|
198
|
+
"name": "culture",
|
|
199
|
+
"method": "setCulture",
|
|
200
|
+
"target": undefined,
|
|
201
|
+
"capture": false,
|
|
202
|
+
"passive": false
|
|
203
|
+
}]; }
|
|
204
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import readme from "./readme.md";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Proxio/Price group list",
|
|
5
|
+
parameters: {
|
|
6
|
+
notes: readme
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = ({ ...args }) => {
|
|
11
|
+
return `
|
|
12
|
+
<div style="max-width: 67em; margin:1em auto 0;">
|
|
13
|
+
<pn-proxio-pricegroup
|
|
14
|
+
culture="${args.culture}"
|
|
15
|
+
tariffid="${args.tariffId}"
|
|
16
|
+
cache="${args.cache}" >
|
|
17
|
+
</pn-proxio-pricegroup>
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Primary = Template.bind({});
|
|
23
|
+
Primary.args = {
|
|
24
|
+
culture: "sv-se",
|
|
25
|
+
tariffId: "7c702ee4-d20c-4b01-aad8-6e5309d59bd0",
|
|
26
|
+
cache: true
|
|
27
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const translations = {
|
|
2
|
+
'sv-se': {
|
|
3
|
+
"from": "Från ",
|
|
4
|
+
"labelRoll": "Rulle",
|
|
5
|
+
"labelPackage": "Paket",
|
|
6
|
+
"notTraceable": "Inte spårbart",
|
|
7
|
+
"Creapest": "Billigast"
|
|
8
|
+
},
|
|
9
|
+
'en-gb': {
|
|
10
|
+
"from": "From ",
|
|
11
|
+
"labelRoll": "Roll",
|
|
12
|
+
"labelPackage": "Package",
|
|
13
|
+
"notTraceable": "Not traceable",
|
|
14
|
+
"Creapest": "Cheapest"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-description.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Component, h, Prop, Host } from "@stencil/core";
|
|
2
|
+
export class PnProxioProductcardDescription {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.list = [];
|
|
5
|
+
}
|
|
6
|
+
render() {
|
|
7
|
+
return (h(Host, null,
|
|
8
|
+
this.heading ? (h("h3", null, this.heading)) : (null),
|
|
9
|
+
this.highlight ? (h("h3", { class: "highlight" }, this.highlight)) : (null),
|
|
10
|
+
this.description ? (h("span", null, this.description)) : (null),
|
|
11
|
+
this.list ?
|
|
12
|
+
(h("ul", null, this.list.map((text) => {
|
|
13
|
+
return (h("li", null, text));
|
|
14
|
+
})))
|
|
15
|
+
: (null)));
|
|
16
|
+
}
|
|
17
|
+
static get is() { return "pn-proxio-productcard-description"; }
|
|
18
|
+
static get originalStyleUrls() { return {
|
|
19
|
+
"$": ["pn-proxio-productcard-description.scss"]
|
|
20
|
+
}; }
|
|
21
|
+
static get styleUrls() { return {
|
|
22
|
+
"$": ["pn-proxio-productcard-description.css"]
|
|
23
|
+
}; }
|
|
24
|
+
static get properties() { return {
|
|
25
|
+
"heading": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"mutable": false,
|
|
28
|
+
"complexType": {
|
|
29
|
+
"original": "string",
|
|
30
|
+
"resolved": "string",
|
|
31
|
+
"references": {}
|
|
32
|
+
},
|
|
33
|
+
"required": false,
|
|
34
|
+
"optional": false,
|
|
35
|
+
"docs": {
|
|
36
|
+
"tags": [],
|
|
37
|
+
"text": ""
|
|
38
|
+
},
|
|
39
|
+
"attribute": "heading",
|
|
40
|
+
"reflect": false
|
|
41
|
+
},
|
|
42
|
+
"highlight": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"mutable": false,
|
|
45
|
+
"complexType": {
|
|
46
|
+
"original": "string",
|
|
47
|
+
"resolved": "string",
|
|
48
|
+
"references": {}
|
|
49
|
+
},
|
|
50
|
+
"required": false,
|
|
51
|
+
"optional": false,
|
|
52
|
+
"docs": {
|
|
53
|
+
"tags": [],
|
|
54
|
+
"text": ""
|
|
55
|
+
},
|
|
56
|
+
"attribute": "highlight",
|
|
57
|
+
"reflect": false
|
|
58
|
+
},
|
|
59
|
+
"description": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "string",
|
|
64
|
+
"resolved": "string",
|
|
65
|
+
"references": {}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": false,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": ""
|
|
72
|
+
},
|
|
73
|
+
"attribute": "description",
|
|
74
|
+
"reflect": false
|
|
75
|
+
},
|
|
76
|
+
"list": {
|
|
77
|
+
"type": "unknown",
|
|
78
|
+
"mutable": true,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "string[]",
|
|
81
|
+
"resolved": "string[]",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": ""
|
|
89
|
+
},
|
|
90
|
+
"defaultValue": "[]"
|
|
91
|
+
}
|
|
92
|
+
}; }
|
|
93
|
+
}
|
package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-information.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Component, h, Prop, Host } from "@stencil/core";
|
|
2
|
+
export class PnProxioProductcardInformation {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.information = [];
|
|
5
|
+
}
|
|
6
|
+
render() {
|
|
7
|
+
return (h(Host, null,
|
|
8
|
+
h("div", { class: "cardinfocontent" }, this.information && this.label ? (h("div", { class: "cardinfocontent-item" },
|
|
9
|
+
h("p", null,
|
|
10
|
+
h("strong", null, this.label)),
|
|
11
|
+
this.information.map((item) => (item ?
|
|
12
|
+
(h("p", null,
|
|
13
|
+
h("strong", { class: "label" },
|
|
14
|
+
item.item1,
|
|
15
|
+
":"),
|
|
16
|
+
" ",
|
|
17
|
+
item.item2))
|
|
18
|
+
: (null))))) : null)));
|
|
19
|
+
}
|
|
20
|
+
static get is() { return "pn-proxio-productcard-information"; }
|
|
21
|
+
static get originalStyleUrls() { return {
|
|
22
|
+
"$": ["pn-proxio-productcard-information.scss"]
|
|
23
|
+
}; }
|
|
24
|
+
static get styleUrls() { return {
|
|
25
|
+
"$": ["pn-proxio-productcard-information.css"]
|
|
26
|
+
}; }
|
|
27
|
+
static get properties() { return {
|
|
28
|
+
"label": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"mutable": false,
|
|
31
|
+
"complexType": {
|
|
32
|
+
"original": "string",
|
|
33
|
+
"resolved": "string",
|
|
34
|
+
"references": {}
|
|
35
|
+
},
|
|
36
|
+
"required": false,
|
|
37
|
+
"optional": false,
|
|
38
|
+
"docs": {
|
|
39
|
+
"tags": [],
|
|
40
|
+
"text": ""
|
|
41
|
+
},
|
|
42
|
+
"attribute": "label",
|
|
43
|
+
"reflect": false
|
|
44
|
+
},
|
|
45
|
+
"information": {
|
|
46
|
+
"type": "unknown",
|
|
47
|
+
"mutable": false,
|
|
48
|
+
"complexType": {
|
|
49
|
+
"original": "ProductGenericItem[]",
|
|
50
|
+
"resolved": "ProductGenericItem[]",
|
|
51
|
+
"references": {
|
|
52
|
+
"ProductGenericItem": {
|
|
53
|
+
"location": "import",
|
|
54
|
+
"path": "../pn-proxio-pricegroup/types"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": false,
|
|
59
|
+
"optional": false,
|
|
60
|
+
"docs": {
|
|
61
|
+
"tags": [],
|
|
62
|
+
"text": ""
|
|
63
|
+
},
|
|
64
|
+
"defaultValue": "[]"
|
|
65
|
+
}
|
|
66
|
+
}; }
|
|
67
|
+
}
|
package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-pricelink.css
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
pn-proxio-productcard-pricelink {
|
|
2
|
+
align-self: center;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
margin: 2rem 1rem;
|
|
7
|
+
gap: 1rem;
|
|
8
|
+
align-content: center;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
}
|
|
11
|
+
pn-proxio-productcard-pricelink pn-button {
|
|
12
|
+
min-width: 17rem;
|
|
13
|
+
}
|