@postnord/pn-marketweb-components 1.0.39 → 1.0.42-beta2
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/{MarketWebLoginManager-859590e2.js → MarketWebLoginManager-1282a883.js} +1 -2
- package/cjs/{index-ea886985.js → index-31d574c5.js} +1 -1
- package/cjs/{index-0404c97e.js → index-cd08e313.js} +4 -0
- package/cjs/loader.cjs.js +2 -2
- package/cjs/mockresponse-c40ea527.js +24 -0
- package/cjs/pn-bonus-progressbar-level.cjs.entry.js +42 -0
- package/cjs/pn-bonus-progressbar.cjs.entry.js +90 -0
- package/cjs/pn-choice-button_2.cjs.entry.js +3 -3
- package/cjs/pn-filter-checkbox.cjs.entry.js +1 -1
- package/cjs/pn-filter-search.cjs.entry.js +1 -1
- package/cjs/{pn-find-service-and-price-store-df7890f3.js → pn-find-service-and-price-store-bded912f.js} +1 -1
- package/cjs/pn-find-service-and-price.cjs.entry.js +3 -3
- package/cjs/pn-language-selector_9.cjs.entry.js +4 -4
- package/cjs/pn-mainnav-link.cjs.entry.js +3 -3
- package/cjs/{pn-mainnav-store-87a95686.js → pn-mainnav-store-4a3492cd.js} +1 -1
- package/cjs/pn-market-web-components.cjs.js +2 -2
- package/cjs/pn-marketweb-sitefooter.cjs.entry.js +1 -1
- package/cjs/pn-marketweb-siteheader.cjs.entry.js +2 -2
- package/cjs/pn-pex-pricefinder.cjs.entry.js +121 -0
- package/cjs/pn-product-pricelist-result.cjs.entry.js +3 -3
- package/cjs/{pn-product-pricelist-store-3a956b18.js → pn-product-pricelist-store-8dda97db.js} +1 -1
- package/cjs/pn-product-pricelist.cjs.entry.js +3 -3
- package/cjs/pn-product-tile_3.cjs.entry.js +1 -1
- package/cjs/pn-profile-selector.cjs.entry.js +2 -2
- package/cjs/pn-sidenav-level.cjs.entry.js +3 -3
- package/cjs/pn-sidenav-link.cjs.entry.js +3 -3
- package/cjs/{pn-sidenav-store-ac7b8608.js → pn-sidenav-store-044d6595.js} +1 -1
- package/cjs/pn-sidenav.cjs.entry.js +3 -3
- package/cjs/pn-site-footer_2.cjs.entry.js +1 -1
- package/collection/collection-manifest.json +3 -0
- package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar-level.css +48 -0
- package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar-level.js +120 -0
- package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar.css +77 -0
- package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar.js +254 -0
- package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar.stories.js +79 -0
- package/collection/components/widgets/pn-pex-pricefinder/pex-pricefinder.stories.js +22 -0
- package/collection/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.css +59 -0
- package/collection/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.js +188 -0
- package/collection/components/widgets/pn-pex-pricefinder/translations.js +22 -0
- package/collection/components/widgets/pn-pex-pricefinder/types.js +1 -0
- package/collection/globals/MarketWebLoginManager.js +1 -2
- package/custom-elements/index.d.ts +18 -0
- package/custom-elements/index.js +259 -19
- package/custom-elements/mockresponse.js +20 -0
- package/esm/{MarketWebLoginManager-83f2e86a.js → MarketWebLoginManager-310d2552.js} +1 -2
- package/esm/{index-e34aec9d.js → index-94746173.js} +1 -1
- package/esm/{index-1537f439.js → index-b26d0794.js} +4 -0
- package/esm/loader.js +2 -2
- package/esm/mockresponse-e2c08e66.js +20 -0
- package/esm/pn-bonus-progressbar-level.entry.js +38 -0
- package/esm/pn-bonus-progressbar.entry.js +86 -0
- package/esm/pn-choice-button_2.entry.js +3 -3
- package/esm/pn-filter-checkbox.entry.js +1 -1
- package/esm/pn-filter-search.entry.js +1 -1
- package/esm/{pn-find-service-and-price-store-ae3cddfb.js → pn-find-service-and-price-store-2ddc6cfa.js} +1 -1
- package/esm/pn-find-service-and-price.entry.js +3 -3
- package/esm/pn-language-selector_9.entry.js +4 -4
- package/esm/pn-mainnav-link.entry.js +3 -3
- package/esm/{pn-mainnav-store-8e518460.js → pn-mainnav-store-c14ad7e8.js} +1 -1
- package/esm/pn-market-web-components.js +2 -2
- package/esm/pn-marketweb-sitefooter.entry.js +1 -1
- package/esm/pn-marketweb-siteheader.entry.js +2 -2
- package/esm/pn-pex-pricefinder.entry.js +117 -0
- package/esm/pn-product-pricelist-result.entry.js +3 -3
- package/esm/{pn-product-pricelist-store-b59d0cba.js → pn-product-pricelist-store-a287a3f5.js} +1 -1
- package/esm/pn-product-pricelist.entry.js +3 -3
- package/esm/pn-product-tile_3.entry.js +1 -1
- package/esm/pn-profile-selector.entry.js +2 -2
- package/esm/pn-sidenav-level.entry.js +3 -3
- package/esm/pn-sidenav-link.entry.js +3 -3
- package/esm/{pn-sidenav-store-c46b24d2.js → pn-sidenav-store-6f25eef9.js} +1 -1
- package/esm/pn-sidenav.entry.js +3 -3
- package/esm/pn-site-footer_2.entry.js +1 -1
- package/esm-es5/{MarketWebLoginManager-83f2e86a.js → MarketWebLoginManager-310d2552.js} +1 -1
- package/esm-es5/{index-e34aec9d.js → index-94746173.js} +1 -1
- package/esm-es5/{index-1537f439.js → index-b26d0794.js} +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/mockresponse-e2c08e66.js +1 -0
- package/esm-es5/pn-bonus-progressbar-level.entry.js +1 -0
- package/esm-es5/pn-bonus-progressbar.entry.js +1 -0
- package/esm-es5/pn-choice-button_2.entry.js +1 -1
- package/esm-es5/pn-filter-checkbox.entry.js +1 -1
- package/esm-es5/pn-filter-search.entry.js +1 -1
- package/esm-es5/{pn-find-service-and-price-store-ae3cddfb.js → pn-find-service-and-price-store-2ddc6cfa.js} +1 -1
- package/esm-es5/pn-find-service-and-price.entry.js +1 -1
- package/esm-es5/pn-language-selector_9.entry.js +1 -1
- package/esm-es5/pn-mainnav-link.entry.js +1 -1
- package/esm-es5/{pn-mainnav-store-8e518460.js → pn-mainnav-store-c14ad7e8.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-pex-pricefinder.entry.js +1 -0
- package/esm-es5/pn-product-pricelist-result.entry.js +1 -1
- package/esm-es5/{pn-product-pricelist-store-b59d0cba.js → pn-product-pricelist-store-a287a3f5.js} +1 -1
- package/esm-es5/pn-product-pricelist.entry.js +1 -1
- package/esm-es5/pn-product-tile_3.entry.js +1 -1
- package/esm-es5/pn-profile-selector.entry.js +1 -1
- package/esm-es5/pn-sidenav-level.entry.js +1 -1
- package/esm-es5/pn-sidenav-link.entry.js +1 -1
- package/esm-es5/{pn-sidenav-store-c46b24d2.js → pn-sidenav-store-6f25eef9.js} +1 -1
- package/esm-es5/pn-sidenav.entry.js +1 -1
- package/esm-es5/pn-site-footer_2.entry.js +1 -1
- package/package.json +2 -2
- package/pn-market-web-components/{p-8dad5ed9.js → p-020f1667.js} +1 -1
- package/pn-market-web-components/{p-7071b45d.system.entry.js → p-02a985d9.system.entry.js} +1 -1
- package/pn-market-web-components/{p-2713500f.entry.js → p-02c8dcd0.entry.js} +1 -1
- package/pn-market-web-components/p-038b8060.system.js +1 -0
- package/pn-market-web-components/{p-e3fb52a6.system.entry.js → p-043f460c.system.entry.js} +1 -1
- package/pn-market-web-components/{p-57e4ced3.system.entry.js → p-0ba9ae69.system.entry.js} +1 -1
- package/pn-market-web-components/{p-88d82a49.entry.js → p-0d975e39.entry.js} +1 -1
- package/pn-market-web-components/p-12297437.system.entry.js +1 -0
- package/pn-market-web-components/p-1caf4231.system.entry.js +1 -0
- package/pn-market-web-components/{p-9718752b.system.entry.js → p-21463fc1.system.entry.js} +1 -1
- package/pn-market-web-components/p-2456901a.js +1 -0
- package/pn-market-web-components/{p-d2c98a81.system.js → p-26f72169.system.js} +1 -1
- package/pn-market-web-components/{p-f14cff8e.js → p-3359dac6.js} +1 -1
- package/pn-market-web-components/p-33cefc5e.system.entry.js +1 -0
- package/pn-market-web-components/{p-71d3db79.entry.js → p-37801e32.entry.js} +1 -1
- package/pn-market-web-components/p-3cf489ac.js +1 -0
- package/pn-market-web-components/{p-4feb3557.system.entry.js → p-478ac9b4.system.entry.js} +1 -1
- package/pn-market-web-components/{p-2e71089b.js → p-4832a520.js} +1 -1
- package/pn-market-web-components/{p-dc471243.entry.js → p-4aa3b95d.entry.js} +1 -1
- package/pn-market-web-components/p-52787ac9.entry.js +1 -0
- package/pn-market-web-components/{p-1d9a3108.entry.js → p-53e14b27.entry.js} +1 -1
- package/pn-market-web-components/{p-8e8fe71e.system.js → p-5510f188.system.js} +1 -1
- package/pn-market-web-components/{p-03fb0285.entry.js → p-5df99382.entry.js} +1 -1
- package/pn-market-web-components/p-772c078c.entry.js +1 -0
- package/pn-market-web-components/{p-423807b2.entry.js → p-77d43e30.entry.js} +1 -1
- package/pn-market-web-components/{p-492ba223.js → p-789e1b30.js} +1 -1
- package/pn-market-web-components/p-7d92e5c7.system.entry.js +1 -0
- package/pn-market-web-components/{p-02ab0208.entry.js → p-81df672d.entry.js} +1 -1
- package/pn-market-web-components/p-84d9f552.system.js +1 -0
- package/pn-market-web-components/{p-d70008da.entry.js → p-861210ae.entry.js} +1 -1
- package/pn-market-web-components/{p-d9465a21.system.js → p-915cef83.system.js} +1 -1
- package/pn-market-web-components/p-942f590f.entry.js +1 -0
- package/pn-market-web-components/{p-86a9f853.system.js → p-98bc5c17.system.js} +1 -1
- package/pn-market-web-components/{p-7b4c721f.system.entry.js → p-a1309b3b.system.entry.js} +1 -1
- package/pn-market-web-components/p-a22df959.system.js +1 -0
- package/pn-market-web-components/{p-1411f767.entry.js → p-a25fc106.entry.js} +1 -1
- package/pn-market-web-components/{p-015a433e.entry.js → p-a37ea453.entry.js} +1 -1
- package/pn-market-web-components/{p-1649b94a.entry.js → p-a5284c78.entry.js} +1 -1
- package/pn-market-web-components/{p-daa6ddb3.system.entry.js → p-b2383083.system.entry.js} +1 -1
- package/pn-market-web-components/{p-dade9bdb.system.entry.js → p-b446ca28.system.entry.js} +1 -1
- package/pn-market-web-components/{p-a65b61d6.system.entry.js → p-b7fdc5cb.system.entry.js} +1 -1
- package/pn-market-web-components/{p-32f4efa6.entry.js → p-b8af690a.entry.js} +1 -1
- package/pn-market-web-components/{p-79611456.system.entry.js → p-c127e22c.system.entry.js} +1 -1
- package/pn-market-web-components/p-c25ada49.js +1 -0
- package/pn-market-web-components/{p-22cd41df.entry.js → p-cce32042.entry.js} +1 -1
- package/pn-market-web-components/p-cec6130e.system.js +1 -0
- package/pn-market-web-components/{p-96ef731c.entry.js → p-d1053abf.entry.js} +1 -1
- package/pn-market-web-components/{p-a983c263.system.entry.js → p-d133f30d.system.entry.js} +1 -1
- package/pn-market-web-components/{p-4921fcc3.entry.js → p-dde2cf1c.entry.js} +1 -1
- package/pn-market-web-components/{p-e695c8e8.system.entry.js → p-e04f8d34.system.entry.js} +1 -1
- package/pn-market-web-components/{p-5a155773.system.entry.js → p-e6a209c6.system.entry.js} +1 -1
- package/pn-market-web-components/{p-a5b178b5.system.entry.js → p-eb049e9d.system.entry.js} +1 -1
- package/pn-market-web-components/p-ec0adffe.js +1 -0
- package/pn-market-web-components/{p-cb10d64f.system.entry.js → p-ec1127de.system.entry.js} +1 -1
- package/pn-market-web-components/{p-58cdf3a6.system.js → p-f1311662.system.js} +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/pn-market-web-components/pn-market-web-components.js +1 -1
- package/types/components/input/pn-bonus-progressbar/pn-bonus-progressbar-level.d.ts +14 -0
- package/types/components/input/pn-bonus-progressbar/pn-bonus-progressbar.d.ts +20 -0
- package/types/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.d.ts +30 -0
- package/types/components/widgets/pn-pex-pricefinder/translations.d.ts +22 -0
- package/types/components/widgets/pn-pex-pricefinder/types.d.ts +27 -0
- package/types/components.d.ts +87 -0
- package/pn-market-web-components/p-02a1466e.system.js +0 -1
- package/pn-market-web-components/p-25bdf3f8.system.js +0 -1
- package/pn-market-web-components/p-2e4a6bc7.system.entry.js +0 -1
- package/pn-market-web-components/p-8be38a7e.system.js +0 -1
- package/pn-market-web-components/p-a14f54af.js +0 -1
- package/pn-market-web-components/p-c254cfdf.js +0 -1
- package/pn-market-web-components/p-d319f735.js +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import readme from "./readme.md";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Widgets/Pex Pricefinder",
|
|
5
|
+
parameters: {
|
|
6
|
+
notes: readme
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = ({ ...args }) => {
|
|
11
|
+
return `
|
|
12
|
+
<div style="max-width: 30em; margin:1em auto 0;">
|
|
13
|
+
<pn-pex-pricefinder language="${args.language}">
|
|
14
|
+
</pn-product-tile>
|
|
15
|
+
</div>
|
|
16
|
+
`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Primary = Template.bind({});
|
|
20
|
+
Primary.args = {
|
|
21
|
+
language: "sv",
|
|
22
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.pex-pricefinder-top {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
}
|
|
5
|
+
.pex-pricefinder-top pn-illustration {
|
|
6
|
+
width: 5.5rem;
|
|
7
|
+
height: 5.5rem;
|
|
8
|
+
margin-right: 1.6rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.pex-pricefinder-form {
|
|
12
|
+
margin: 1.6rem 0 0 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
border: 0;
|
|
15
|
+
}
|
|
16
|
+
.pex-pricefinder-form fieldset {
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
border: 0;
|
|
20
|
+
}
|
|
21
|
+
.pex-pricefinder-form fieldset + fieldset {
|
|
22
|
+
margin-top: 1.6rem;
|
|
23
|
+
}
|
|
24
|
+
.pex-pricefinder-form fieldset > div {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 1em;
|
|
28
|
+
}
|
|
29
|
+
.pex-pricefinder-form fieldset > div > * {
|
|
30
|
+
flex-grow: 1;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
.pex-pricefinder-form pn-button {
|
|
34
|
+
align-self: end;
|
|
35
|
+
margin-left: auto;
|
|
36
|
+
}
|
|
37
|
+
.pex-pricefinder-form .datepicker {
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
}
|
|
41
|
+
.pex-pricefinder-form .datepicker label {
|
|
42
|
+
margin-bottom: 0.4rem;
|
|
43
|
+
color: #5E554A;
|
|
44
|
+
font-size: 0.875em;
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: space-between;
|
|
47
|
+
align-items: flex-end;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
transition: color 0.2s;
|
|
50
|
+
}
|
|
51
|
+
.pex-pricefinder-form .datepicker pn-date-picker {
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pex-pricefinder-response {
|
|
56
|
+
margin-top: 2.4rem;
|
|
57
|
+
text-align: center;
|
|
58
|
+
font-size: 2.4em;
|
|
59
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Component, h, Host, Element, Prop, State, Listen } from "@stencil/core";
|
|
2
|
+
import { translations } from "./translations";
|
|
3
|
+
export class PnPexPricefinder {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** Specifies which language we want to show component in (sv,da,fi,no,en) */
|
|
6
|
+
this.language = "sv";
|
|
7
|
+
/** Currency (Kr, €)*/
|
|
8
|
+
this.currency = "Kr";
|
|
9
|
+
/** API Url */
|
|
10
|
+
this.apiUrl = "/api/pex/order";
|
|
11
|
+
this.i18n = translations.sv;
|
|
12
|
+
this.fromzip = null;
|
|
13
|
+
this.tozip = null;
|
|
14
|
+
this.weight = 100;
|
|
15
|
+
this.when = (new Date()).toISOString().split('T')[0];
|
|
16
|
+
this.response = null;
|
|
17
|
+
}
|
|
18
|
+
componentWillLoad() {
|
|
19
|
+
this.init();
|
|
20
|
+
}
|
|
21
|
+
async init() {
|
|
22
|
+
this.checkParameters();
|
|
23
|
+
this.setLanguage();
|
|
24
|
+
}
|
|
25
|
+
checkParameters() {
|
|
26
|
+
const params = new URLSearchParams(window.location.href);
|
|
27
|
+
if (!params) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const paramKeys = ['fromzip', 'tozip', 'weight', 'when'];
|
|
31
|
+
paramKeys.forEach((key) => {
|
|
32
|
+
if (params.get(key)) {
|
|
33
|
+
this[key] = params.get(key);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
setLanguage() {
|
|
38
|
+
if (translations[this.language]) {
|
|
39
|
+
this.i18n = translations[this.language];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
onSubmit(e) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
const formData = new FormData(e.target);
|
|
45
|
+
const requestQuery = this.compileRequestQuery(formData);
|
|
46
|
+
this.fetchResult(requestQuery);
|
|
47
|
+
}
|
|
48
|
+
compileRequestQuery(formData) {
|
|
49
|
+
let query = {
|
|
50
|
+
"from": formData.get("fromzip"),
|
|
51
|
+
"to": formData.get("tozip"),
|
|
52
|
+
"weight": formData.get("weight"),
|
|
53
|
+
"when": formData.get("when")
|
|
54
|
+
};
|
|
55
|
+
if (!query.when) {
|
|
56
|
+
query.when = this.hostElement.querySelector('input.date-input').value;
|
|
57
|
+
}
|
|
58
|
+
if (!formData.get("fromzip") || !formData.get("tozip") || !formData.get("weight")) {
|
|
59
|
+
console.error("Form data is not compliant");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
return query;
|
|
63
|
+
}
|
|
64
|
+
async fetchResult(query) {
|
|
65
|
+
this.response = null;
|
|
66
|
+
const params = new URLSearchParams(query);
|
|
67
|
+
const req = await (fetch(`${this.apiUrl}?${params.toString()}`, {
|
|
68
|
+
method: 'get',
|
|
69
|
+
headers: {
|
|
70
|
+
'Content-Type': 'application/json'
|
|
71
|
+
}
|
|
72
|
+
}).catch(this.onFetchError.bind(this)));
|
|
73
|
+
let response = await (req.json().catch(this.onFetchError.bind(this)));
|
|
74
|
+
if (!response) {
|
|
75
|
+
response = await (await import("./mockresponse.json")).default;
|
|
76
|
+
}
|
|
77
|
+
if (response) {
|
|
78
|
+
this.response = response;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
onFetchError(error) {
|
|
82
|
+
console.error('onFetchError(error', error);
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return (h(Host, null,
|
|
86
|
+
h("div", { class: "pex-pricefinder-top" },
|
|
87
|
+
h("pn-illustration", { illustration: "PEX-truck" }),
|
|
88
|
+
h("h2", null, this.i18n.heading)),
|
|
89
|
+
h("form", { method: "get", action: "", class: "pex-pricefinder-form", onSubmit: this.onSubmit.bind(this) },
|
|
90
|
+
h("fieldset", null,
|
|
91
|
+
h("div", null,
|
|
92
|
+
h("pn-input", { type: "number", label: this.i18n.labelFrom, inputid: "fromzip", name: "fromzip", placeholder: this.i18n.zipPlaceholder, required: true, value: this.fromzip }),
|
|
93
|
+
h("pn-input", { type: "number", label: this.i18n.labelTo, inputid: "tozip", name: "tozip", placeholder: this.i18n.zipPlaceholder, required: true, value: this.tozip }))),
|
|
94
|
+
h("fieldset", null,
|
|
95
|
+
h("div", null,
|
|
96
|
+
h("pn-input", { type: "number", label: this.i18n.labelWeight, inputid: "weight", name: "weight", placeholder: this.i18n.weightPlaceholder, required: true, value: this.weight }),
|
|
97
|
+
h("div", { class: "datepicker" },
|
|
98
|
+
h("label", { htmlFor: "when" }, this.i18n.labelWhen),
|
|
99
|
+
h("pn-date-picker", { inputid: "when", name: "when", "start-of-week": "1", min: (new Date()).toISOString().split('T')[0], language: this.language, value: this.when })))),
|
|
100
|
+
h("fieldset", null,
|
|
101
|
+
h("div", null,
|
|
102
|
+
h("pn-button", { type: "submit" }, this.i18n.submitButtonText)))),
|
|
103
|
+
this.response ? (h("div", { class: "pex-pricefinder-response" },
|
|
104
|
+
h("strong", null,
|
|
105
|
+
this.response.data.value,
|
|
106
|
+
" ",
|
|
107
|
+
this.currency))) : null));
|
|
108
|
+
}
|
|
109
|
+
static get is() { return "pn-pex-pricefinder"; }
|
|
110
|
+
static get originalStyleUrls() { return {
|
|
111
|
+
"$": ["pn-pex-pricefinder.scss"]
|
|
112
|
+
}; }
|
|
113
|
+
static get styleUrls() { return {
|
|
114
|
+
"$": ["pn-pex-pricefinder.css"]
|
|
115
|
+
}; }
|
|
116
|
+
static get properties() { return {
|
|
117
|
+
"language": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"mutable": false,
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "string",
|
|
122
|
+
"resolved": "string",
|
|
123
|
+
"references": {}
|
|
124
|
+
},
|
|
125
|
+
"required": false,
|
|
126
|
+
"optional": false,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [],
|
|
129
|
+
"text": "Specifies which language we want to show component in (sv,da,fi,no,en)"
|
|
130
|
+
},
|
|
131
|
+
"attribute": "language",
|
|
132
|
+
"reflect": false,
|
|
133
|
+
"defaultValue": "\"sv\""
|
|
134
|
+
},
|
|
135
|
+
"currency": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"mutable": false,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "string",
|
|
140
|
+
"resolved": "string",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": "Currency (Kr, \u20AC)"
|
|
148
|
+
},
|
|
149
|
+
"attribute": "currency",
|
|
150
|
+
"reflect": false,
|
|
151
|
+
"defaultValue": "\"Kr\""
|
|
152
|
+
},
|
|
153
|
+
"apiUrl": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "string",
|
|
158
|
+
"resolved": "string",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": "API Url"
|
|
166
|
+
},
|
|
167
|
+
"attribute": "api-url",
|
|
168
|
+
"reflect": false,
|
|
169
|
+
"defaultValue": "\"/api/pex/order\""
|
|
170
|
+
}
|
|
171
|
+
}; }
|
|
172
|
+
static get states() { return {
|
|
173
|
+
"i18n": {},
|
|
174
|
+
"fromzip": {},
|
|
175
|
+
"tozip": {},
|
|
176
|
+
"weight": {},
|
|
177
|
+
"when": {},
|
|
178
|
+
"response": {}
|
|
179
|
+
}; }
|
|
180
|
+
static get elementRef() { return "hostElement"; }
|
|
181
|
+
static get listeners() { return [{
|
|
182
|
+
"name": "language",
|
|
183
|
+
"method": "setLanguage",
|
|
184
|
+
"target": undefined,
|
|
185
|
+
"capture": false,
|
|
186
|
+
"passive": false
|
|
187
|
+
}]; }
|
|
188
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const translations = {
|
|
2
|
+
'sv': {
|
|
3
|
+
"heading": "Beräkna kostnad med PEX Bud",
|
|
4
|
+
"labelFrom": "Från postkod",
|
|
5
|
+
"labelTo": "Till postkod",
|
|
6
|
+
"zipPlaceholder": "Ex. 12831",
|
|
7
|
+
"labelWeight": "Vikt (i gram)",
|
|
8
|
+
"weightPlaceholder": "Ex. 1000",
|
|
9
|
+
"labelWhen": "När",
|
|
10
|
+
"submitButtonText": "Beräkna pris"
|
|
11
|
+
},
|
|
12
|
+
'en': {
|
|
13
|
+
"heading": "Calculate cost with PEX Bud",
|
|
14
|
+
"labelFrom": "From zip",
|
|
15
|
+
"labelTo": "To zip",
|
|
16
|
+
"zipPlaceholder": "Ex. 12831",
|
|
17
|
+
"labelWeight": "Weight (in grams)",
|
|
18
|
+
"weightPlaceholder": "Ex. 1000",
|
|
19
|
+
"labelWhen": "When",
|
|
20
|
+
"submitButtonText": "Calculate price"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -87,8 +87,7 @@ class MarketWebLoginManager {
|
|
|
87
87
|
return `${this.getBaseUrl()}${this.endpoints.authorizationEndpoint}?redirectionUrl=${redirectPage}`;
|
|
88
88
|
}
|
|
89
89
|
getLogoutUrl(redirectPage = "") {
|
|
90
|
-
|
|
91
|
-
redirectPage = redirectPage ? redirectPage : currentPage;
|
|
90
|
+
redirectPage = window.location.origin + '/logout';
|
|
92
91
|
return `${this.getBaseUrl()}${this.endpoints.logoutEndpoint}?redirectionUrl=${redirectPage}&authorization=${this.store.get(this.keys.token)}`;
|
|
93
92
|
}
|
|
94
93
|
getUserInfo() {
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import type { Components, JSX } from "../types/components";
|
|
4
4
|
|
|
5
|
+
interface PnBonusProgressbar extends Components.PnBonusProgressbar, HTMLElement {}
|
|
6
|
+
export const PnBonusProgressbar: {
|
|
7
|
+
prototype: PnBonusProgressbar;
|
|
8
|
+
new (): PnBonusProgressbar;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
interface PnBonusProgressbarLevel extends Components.PnBonusProgressbarLevel, HTMLElement {}
|
|
12
|
+
export const PnBonusProgressbarLevel: {
|
|
13
|
+
prototype: PnBonusProgressbarLevel;
|
|
14
|
+
new (): PnBonusProgressbarLevel;
|
|
15
|
+
};
|
|
16
|
+
|
|
5
17
|
interface PnChoiceButton extends Components.PnChoiceButton, HTMLElement {}
|
|
6
18
|
export const PnChoiceButton: {
|
|
7
19
|
prototype: PnChoiceButton;
|
|
@@ -92,6 +104,12 @@ export const PnMarketwebSiteheaderSearch: {
|
|
|
92
104
|
new (): PnMarketwebSiteheaderSearch;
|
|
93
105
|
};
|
|
94
106
|
|
|
107
|
+
interface PnPexPricefinder extends Components.PnPexPricefinder, HTMLElement {}
|
|
108
|
+
export const PnPexPricefinder: {
|
|
109
|
+
prototype: PnPexPricefinder;
|
|
110
|
+
new (): PnPexPricefinder;
|
|
111
|
+
};
|
|
112
|
+
|
|
95
113
|
interface PnProductPricelist extends Components.PnProductPricelist, HTMLElement {}
|
|
96
114
|
export const PnProductPricelist: {
|
|
97
115
|
prototype: PnProductPricelist;
|