@postnord/pn-marketweb-components 2.0.23-beta4 → 2.0.24
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/loader.cjs.js +1 -1
- package/cjs/pn-customernumber-selector-option.cjs.entry.js +2 -2
- package/cjs/pn-customernumber-selector.cjs.entry.js +3 -3
- package/cjs/pn-find-price-result.cjs.entry.js +5 -5
- package/cjs/{pn-find-price-store-a2728ff4.js → pn-find-price-store-0b8c195c.js} +2 -0
- package/cjs/pn-find-price.cjs.entry.js +17 -9
- package/cjs/pn-language-selector_9.cjs.entry.js +51 -59
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js +72 -0
- package/cjs/pn-marketweb-siteheader-login-links_2.cjs.entry.js +186 -0
- package/cjs/pn-marketweb-siteheader.cjs.entry.js +26 -7
- package/cjs/pn-product-pricelist.cjs.entry.js +1 -1
- package/cjs/pn-profile-selector-option.cjs.entry.js +2 -2
- package/collection/collection-manifest.json +3 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.css +22 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js +149 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/{pn-marketweb-siteheader-profileselection.css → pn-marketweb-siteheader-login-links.css} +0 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.js +199 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.css +93 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js +269 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.css +0 -17
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js +79 -72
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +24 -2
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +69 -2
- package/collection/components/layout-components/pn-marketweb-siteheader/translations.js +20 -5
- package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector-option.js +4 -4
- package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector.js +7 -7
- package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector.stories.js +3 -3
- package/collection/components/profile/pn-profile-selector/pn-profile-selector-option.js +4 -4
- package/collection/components/widgets/pn-find-price/pn-find-price-result.js +4 -4
- package/collection/components/widgets/pn-find-price/pn-find-price-store.js +2 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-translations.js +6 -0
- package/collection/components/widgets/pn-find-price/pn-find-price.css +6 -3
- package/collection/components/widgets/pn-find-price/pn-find-price.js +9 -5
- package/custom-elements/index.d.ts +16 -4
- package/custom-elements/index.js +303 -186
- package/esm/loader.js +1 -1
- package/esm/pn-customernumber-selector-option.entry.js +2 -2
- package/esm/pn-customernumber-selector.entry.js +3 -3
- package/esm/pn-find-price-result.entry.js +5 -5
- package/esm/{pn-find-price-store-f531ab7e.js → pn-find-price-store-b4556c9b.js} +2 -0
- package/esm/pn-find-price.entry.js +17 -9
- package/esm/pn-language-selector_9.entry.js +51 -59
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-marketweb-siteheader-login-linklist.entry.js +68 -0
- package/esm/pn-marketweb-siteheader-login-links_2.entry.js +181 -0
- package/esm/pn-marketweb-siteheader.entry.js +26 -7
- package/esm/pn-product-pricelist.entry.js +1 -1
- package/esm/pn-profile-selector-option.entry.js +2 -2
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-customernumber-selector-option.entry.js +1 -1
- package/esm-es5/pn-customernumber-selector.entry.js +1 -1
- package/esm-es5/pn-find-price-result.entry.js +1 -1
- package/esm-es5/pn-find-price-store-b4556c9b.js +1 -0
- package/esm-es5/pn-find-price.entry.js +1 -1
- package/esm-es5/pn-language-selector_9.entry.js +1 -1
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-marketweb-siteheader-login-linklist.entry.js +1 -0
- package/esm-es5/pn-marketweb-siteheader-login-links_2.entry.js +1 -0
- package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
- package/esm-es5/pn-product-pricelist.entry.js +1 -1
- package/esm-es5/pn-profile-selector-option.entry.js +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/p-04240175.entry.js +1 -0
- package/pn-market-web-components/p-08411f5e.entry.js +1 -0
- package/pn-market-web-components/p-0d5d05cc.system.entry.js +1 -0
- package/pn-market-web-components/{p-77887623.system.entry.js → p-1924152a.system.entry.js} +1 -1
- package/pn-market-web-components/p-1f2d9304.entry.js +1 -0
- package/pn-market-web-components/p-37017f68.system.js +1 -0
- package/pn-market-web-components/p-4791c81b.entry.js +1 -0
- package/pn-market-web-components/p-67887512.system.js +1 -1
- package/pn-market-web-components/p-845d6b0a.entry.js +1 -0
- package/pn-market-web-components/{p-2a7e6d3a.system.entry.js → p-93cecc43.system.entry.js} +1 -1
- package/pn-market-web-components/p-a7bb94a0.entry.js +1 -0
- package/pn-market-web-components/{p-1f5b2d7a.entry.js → p-b32a8507.entry.js} +1 -1
- package/pn-market-web-components/p-ba41a7c0.system.entry.js +1 -0
- package/pn-market-web-components/p-c4254e9e.js +1 -0
- package/pn-market-web-components/p-c5a97974.entry.js +1 -0
- package/pn-market-web-components/{p-7f5bee11.entry.js → p-dc1827a6.entry.js} +1 -1
- package/pn-market-web-components/p-e32dc098.entry.js +1 -0
- package/pn-market-web-components/p-e66a8bb8.system.entry.js +1 -0
- package/pn-market-web-components/{p-ddbd131f.system.entry.js → p-e6fa11ad.system.entry.js} +1 -1
- package/pn-market-web-components/p-ec96434c.system.entry.js +1 -0
- package/pn-market-web-components/p-f4630c00.system.entry.js +1 -0
- package/pn-market-web-components/{p-e23a18f4.system.entry.js → p-f7d1c0a0.system.entry.js} +1 -1
- package/pn-market-web-components/{p-c1c79c65.system.entry.js → p-fecc53bb.system.entry.js} +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.d.ts +13 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.d.ts +14 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.d.ts +20 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.d.ts +6 -4
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-types.d.ts +21 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.d.ts +4 -2
- package/types/components/layout-components/pn-marketweb-siteheader/translations.d.ts +15 -0
- package/types/components/profile/pn-customernumber-selector/pn-customernumber-selector-option.d.ts +1 -1
- package/types/components/profile/pn-customernumber-selector/pn-customernumber-selector.d.ts +1 -1
- package/types/components/profile/pn-profile-selector/pn-profile-selector-option.d.ts +1 -1
- package/types/components/widgets/pn-find-price/pn-find-price-store.d.ts +4 -0
- package/types/components/widgets/pn-find-price/pn-find-price-translations.d.ts +6 -0
- package/types/components/widgets/pn-find-price/pn-find-price-types.d.ts +3 -1
- package/types/components.d.ts +89 -45
- package/umd/pn-marketweb-salesforce.js +1 -1
- package/cjs/pn-marketweb-siteheader-profileselection.cjs.entry.js +0 -161
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-profileselection.js +0 -319
- package/esm/pn-marketweb-siteheader-profileselection.entry.js +0 -157
- package/esm-es5/pn-find-price-store-f531ab7e.js +0 -1
- package/esm-es5/pn-marketweb-siteheader-profileselection.entry.js +0 -1
- package/pn-market-web-components/p-39c42017.entry.js +0 -1
- package/pn-market-web-components/p-3a4b70d1.system.entry.js +0 -1
- package/pn-market-web-components/p-4cea6bf3.system.entry.js +0 -1
- package/pn-market-web-components/p-63a2ba1c.entry.js +0 -1
- package/pn-market-web-components/p-7e294268.entry.js +0 -1
- package/pn-market-web-components/p-893206f2.js +0 -1
- package/pn-market-web-components/p-a702dcfd.system.entry.js +0 -1
- package/pn-market-web-components/p-a94593a9.system.entry.js +0 -1
- package/pn-market-web-components/p-ac8285b4.entry.js +0 -1
- package/pn-market-web-components/p-b0053a2d.entry.js +0 -1
- package/pn-market-web-components/p-c2670af1.system.js +0 -1
- package/pn-market-web-components/p-ea39d576.entry.js +0 -1
- package/pn-market-web-components/p-fcea21cb.entry.js +0 -1
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-profileselection.d.ts +0 -28
|
@@ -6,12 +6,15 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
6
6
|
this.endpoint = "";
|
|
7
7
|
/** Access token passed from backend */
|
|
8
8
|
this.token = "";
|
|
9
|
+
this.i18n = { "searchlabel": "", "searchplaceholder": "", "searchbuttontext": "", "menuHomeButton": "", "menuGoBackButton": "", "mainMenuButton": "", "menuStartButton": "", "profileSelectionFlyoutHeading": "" };
|
|
9
10
|
this.emitEvents = true;
|
|
10
11
|
// Login dialog
|
|
11
12
|
this.loginDialog = null;
|
|
12
13
|
/** User Fullname */
|
|
13
14
|
this.fullname = "";
|
|
14
15
|
this.loggedin = false;
|
|
16
|
+
/** If this is selected we will show the new profile selection dropdown instead of the login version */
|
|
17
|
+
this.showProfileSelection = false;
|
|
15
18
|
this.loginManager = null;
|
|
16
19
|
this.toggleButtonText = "";
|
|
17
20
|
this.username = this.fullname;
|
|
@@ -35,6 +38,47 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
35
38
|
this.toggleButtonText = this.loginDialog.loginMenuLinkText;
|
|
36
39
|
this.loginManager.init(this.emitEvents);
|
|
37
40
|
this.setToggleButtonText();
|
|
41
|
+
this.adjustLoginLinks();
|
|
42
|
+
}
|
|
43
|
+
adjustLoginLinks() {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
if (!((_a = this.loginDialog) === null || _a === void 0 ? void 0 : _a.loginMenuLinks)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const adjustLink = (link, i) => {
|
|
49
|
+
link.isLogoutLink = (link.href.indexOf('logout') !== -1);
|
|
50
|
+
if (link.isLogoutLink) {
|
|
51
|
+
link.href = this.loginManager.getLogoutUrl(link.href.replace('logout', '').replace('http://window.location.href/?', '').replace('https://window.location.href/?', ''));
|
|
52
|
+
}
|
|
53
|
+
if (i === 0 && !link.href) {
|
|
54
|
+
link.href = this.loginManager.getLoginUrl();
|
|
55
|
+
link.linkType = 'primary';
|
|
56
|
+
}
|
|
57
|
+
if (link.primaryLinkApperance && !link.linkType) {
|
|
58
|
+
link.linkType = 'primary';
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
(_b = this.loginDialog) === null || _b === void 0 ? void 0 : _b.loginMenuLinks.forEach(adjustLink);
|
|
62
|
+
(_c = this.loginDialog) === null || _c === void 0 ? void 0 : _c.loggedInLinks.forEach(adjustLink);
|
|
63
|
+
this.loginDialog.legacyLoginLinks = [
|
|
64
|
+
{
|
|
65
|
+
href: this.loginManager.getLoginUrl(this.loginDialog.loginUrl),
|
|
66
|
+
linkText: this.loginDialog.loginLinkText,
|
|
67
|
+
openInNewWindow: false,
|
|
68
|
+
isLogoutLink: false,
|
|
69
|
+
pageLink: null,
|
|
70
|
+
linkType: 'primary',
|
|
71
|
+
primaryLinkApperance: true
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
href: this.loginManager.getLoginUrl(this.loginDialog.registerUrl),
|
|
75
|
+
linkText: this.loginDialog.createLoginLinkText,
|
|
76
|
+
openInNewWindow: false,
|
|
77
|
+
isLogoutLink: false,
|
|
78
|
+
pageLink: null,
|
|
79
|
+
primaryLinkApperance: false
|
|
80
|
+
}
|
|
81
|
+
];
|
|
38
82
|
}
|
|
39
83
|
setUserName() {
|
|
40
84
|
const userInfo = this.loginManager.getUserInfo();
|
|
@@ -72,83 +116,23 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
72
116
|
this.setToggleButtonText();
|
|
73
117
|
}
|
|
74
118
|
}
|
|
75
|
-
uniqueId(text) {
|
|
76
|
-
return "loginlink-" + text.replace(/[^A-Za-z0-9.\\\/]/igm, "") + "-" + (this.emitEvents ? "1" : "2");
|
|
77
|
-
}
|
|
78
|
-
linkAppearanceAttributes(link) {
|
|
79
|
-
let attributes = {};
|
|
80
|
-
if (link.linkType) {
|
|
81
|
-
switch (link.linkType) {
|
|
82
|
-
case 'primary':
|
|
83
|
-
attributes = {
|
|
84
|
-
appearance: '',
|
|
85
|
-
variant: ''
|
|
86
|
-
};
|
|
87
|
-
break;
|
|
88
|
-
case 'secondary':
|
|
89
|
-
attributes = {
|
|
90
|
-
appearance: 'light',
|
|
91
|
-
variant: 'outlined'
|
|
92
|
-
};
|
|
93
|
-
break;
|
|
94
|
-
case 'regularlink':
|
|
95
|
-
default:
|
|
96
|
-
attributes = {
|
|
97
|
-
appearance: 'light',
|
|
98
|
-
variant: 'borderless',
|
|
99
|
-
icon: 'arrow-right'
|
|
100
|
-
};
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
return attributes;
|
|
104
|
-
}
|
|
105
|
-
if (!link.linkType) {
|
|
106
|
-
attributes = {
|
|
107
|
-
appearance: link.primaryLinkApperance ? "dark" : "light"
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return attributes;
|
|
111
|
-
}
|
|
112
119
|
render() {
|
|
113
|
-
var _a, _b, _c;
|
|
114
120
|
if (!this.loginDialog) {
|
|
115
121
|
return;
|
|
116
122
|
}
|
|
117
123
|
let hostElementAttribute = {
|
|
118
|
-
username: null
|
|
124
|
+
username: null,
|
|
125
|
+
loggedin: 'false',
|
|
119
126
|
};
|
|
120
127
|
if (this.username) {
|
|
121
128
|
hostElementAttribute.username = this.username;
|
|
129
|
+
hostElementAttribute.loggedin = this.loggedin + '';
|
|
122
130
|
}
|
|
123
131
|
return (h(Host, Object.assign({}, hostElementAttribute),
|
|
124
|
-
h("pn-nav-dropdown", { label: this.toggleButtonText, icon: "user", class: "siteheader-logindialog" },
|
|
125
|
-
h("
|
|
126
|
-
h("div", null, (_a = this.loginDialog.loginTitle) !== null && _a !== void 0 ? _a : h("strong", null, this.loginDialog.loginTitle),
|
|
127
|
-
((_b = this.loginDialog.loginMenuLinks) === null || _b === void 0 ? void 0 : _b.length) > 0 ?
|
|
128
|
-
h("ul", null, this.loginDialog.loginMenuLinks.map((link, i) => {
|
|
129
|
-
const href = (i === 0 && !link.href) ? this.loginManager.getLoginUrl() : link.href;
|
|
130
|
-
return (h("li", null,
|
|
131
|
-
h("pn-button", Object.assign({ href: href, id: this.uniqueId(link.linkText) }, this.linkAppearanceAttributes(link), (link.openInNewWindow && { target: '_blank' })), link.linkText)));
|
|
132
|
-
}))
|
|
133
|
-
: (h("ul", null,
|
|
134
|
-
h("li", null,
|
|
135
|
-
h("pn-button", { href: this.loginManager.getLoginUrl(this.loginDialog.loginUrl), target: "_top" }, this.loginDialog.loginLinkText)),
|
|
136
|
-
h("li", null,
|
|
137
|
-
h("pn-button", { href: this.loginDialog.registerUrl, target: "_top", appearance: "light", variant: "outlined" }, this.loginDialog.createLoginLinkText)))))
|
|
138
|
-
:
|
|
139
|
-
h("div", null,
|
|
140
|
-
h("ul", null, this.loginDialog.loggedInLinks.map((link) => {
|
|
141
|
-
const isLogoutLink = link.href.indexOf('logout') !== -1;
|
|
142
|
-
const href = (isLogoutLink) ? this.loginManager.getLogoutUrl(link.href.replace('logout', '').replace('http://window.location.href/?', '').replace('https://window.location.href/?', '')) : link.href;
|
|
143
|
-
return (h("li", null,
|
|
144
|
-
h("pn-button", Object.assign({ href: href, id: this.uniqueId(link.linkText) }, (link.openInNewWindow && { target: '_blank' }), this.linkAppearanceAttributes(link), { onClick: () => { if (isLogoutLink) {
|
|
145
|
-
this.loginManager.clearUserData();
|
|
146
|
-
} } }), link.linkText)));
|
|
147
|
-
}))))
|
|
132
|
+
h("pn-nav-dropdown", { label: this.toggleButtonText, icon: "user", class: "siteheader-logindialog" }, this.loggedin && this.showProfileSelection ?
|
|
133
|
+
h("pn-marketweb-siteheader-login-profileselection", { loginDialog: this.loginDialog, loginManager: this.loginManager, loggedin: this.loggedin, i18n: this.i18n, idNamespace: this.emitEvents ? '1' : '2', endpoint: this.endpoint })
|
|
148
134
|
:
|
|
149
|
-
h("
|
|
150
|
-
h("ul", null, (_c = this.loginDialog.loginMenuLinks) === null || _c === void 0 ? void 0 : _c.map(link => h("li", null,
|
|
151
|
-
h("a", { href: link.href, target: link.openInNewWindow ? "_blank" : "_self", class: "btn btn-link" }, link.linkText))))))));
|
|
135
|
+
h("pn-marketweb-siteheader-login-links", { loginDialog: this.loginDialog, loginManager: this.loginManager, loggedin: this.loggedin, idNamespace: this.emitEvents ? '1' : '2', username: this.username }))));
|
|
152
136
|
}
|
|
153
137
|
static get is() { return "pn-marketweb-siteheader-login"; }
|
|
154
138
|
static get originalStyleUrls() { return {
|
|
@@ -195,12 +179,17 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
195
179
|
"defaultValue": "\"\""
|
|
196
180
|
},
|
|
197
181
|
"i18n": {
|
|
198
|
-
"type": "
|
|
182
|
+
"type": "unknown",
|
|
199
183
|
"mutable": false,
|
|
200
184
|
"complexType": {
|
|
201
|
-
"original": "
|
|
202
|
-
"resolved": "
|
|
203
|
-
"references": {
|
|
185
|
+
"original": "SiteHeaderI18N",
|
|
186
|
+
"resolved": "SiteHeaderI18N",
|
|
187
|
+
"references": {
|
|
188
|
+
"SiteHeaderI18N": {
|
|
189
|
+
"location": "import",
|
|
190
|
+
"path": "./pn-marketweb-siteheader-types"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
204
193
|
},
|
|
205
194
|
"required": false,
|
|
206
195
|
"optional": false,
|
|
@@ -208,8 +197,7 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
208
197
|
"tags": [],
|
|
209
198
|
"text": ""
|
|
210
199
|
},
|
|
211
|
-
"
|
|
212
|
-
"reflect": false
|
|
200
|
+
"defaultValue": "{ \"searchlabel\":\"\", \"searchplaceholder\":\"\", \"searchbuttontext\":\"\", \"menuHomeButton\": \"\", \"menuGoBackButton\": \"\", \"mainMenuButton\": \"\", \"menuStartButton\": \"\", \"profileSelectionFlyoutHeading\": \"\" } as SiteHeaderI18N"
|
|
213
201
|
},
|
|
214
202
|
"emitEvents": {
|
|
215
203
|
"type": "boolean",
|
|
@@ -285,10 +273,29 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
285
273
|
"attribute": "loggedin",
|
|
286
274
|
"reflect": false,
|
|
287
275
|
"defaultValue": "false"
|
|
276
|
+
},
|
|
277
|
+
"showProfileSelection": {
|
|
278
|
+
"type": "boolean",
|
|
279
|
+
"mutable": true,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "boolean",
|
|
282
|
+
"resolved": "boolean",
|
|
283
|
+
"references": {}
|
|
284
|
+
},
|
|
285
|
+
"required": false,
|
|
286
|
+
"optional": false,
|
|
287
|
+
"docs": {
|
|
288
|
+
"tags": [],
|
|
289
|
+
"text": "If this is selected we will show the new profile selection dropdown instead of the login version"
|
|
290
|
+
},
|
|
291
|
+
"attribute": "show-profile-selection",
|
|
292
|
+
"reflect": false,
|
|
293
|
+
"defaultValue": "false"
|
|
288
294
|
}
|
|
289
295
|
}; }
|
|
290
296
|
static get states() { return {
|
|
291
297
|
"loginManager": {},
|
|
298
|
+
"loginLinks": {},
|
|
292
299
|
"toggleButtonText": {},
|
|
293
300
|
"username": {}
|
|
294
301
|
}; }
|
package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js
CHANGED
|
@@ -30,6 +30,8 @@ export class PnMarketwebSiteheader {
|
|
|
30
30
|
this.hideSearch = false;
|
|
31
31
|
/** Hides the login if set to true*/
|
|
32
32
|
this.hideLogin = false;
|
|
33
|
+
/** If this is selected we will show the new profile selection dropdown instead of the login version */
|
|
34
|
+
this.showProfileSelection = false;
|
|
33
35
|
/** Autocomplete endpoint */
|
|
34
36
|
this.AutocompleteEndpoint = "";
|
|
35
37
|
/** Forward session to backend */
|
|
@@ -38,6 +40,7 @@ export class PnMarketwebSiteheader {
|
|
|
38
40
|
this.cache = false;
|
|
39
41
|
/** Event based only language switch */
|
|
40
42
|
this.spaMode = false;
|
|
43
|
+
this.i18n = { "searchlabel": "", "searchplaceholder": "", "searchbuttontext": "", "menuHomeButton": "", "menuGoBackButton": "", "mainMenuButton": "", "menuStartButton": "", "profileSelectionFlyoutHeading": "" };
|
|
41
44
|
this.gotData = false;
|
|
42
45
|
this.fetchingData = false;
|
|
43
46
|
this.homePageLink = "/";
|
|
@@ -200,6 +203,7 @@ export class PnMarketwebSiteheader {
|
|
|
200
203
|
}
|
|
201
204
|
onLoginStateChange(e) {
|
|
202
205
|
var _a, _b, _c;
|
|
206
|
+
console.log('onLoginStateChange(e', e);
|
|
203
207
|
if (((_a = e.detail) === null || _a === void 0 ? void 0 : _a.loggedIn) && ((_b = e.detail) === null || _b === void 0 ? void 0 : _b.token)) {
|
|
204
208
|
this.loggedIn = ((_c = e.detail) === null || _c === void 0 ? void 0 : _c.loggedIn) === true;
|
|
205
209
|
if (this.sessionForward) {
|
|
@@ -268,7 +272,7 @@ export class PnMarketwebSiteheader {
|
|
|
268
272
|
h("path", { d: "M108.84,13.35c0,6.34-5.17,9-10,9S89,19.76,89,13.63c0-6.28,5.08-9,10-9S108.84,7.25,108.84,13.35Zm-6.56.18a3.4,3.4,0,1,0-6.8,0,3.29,3.29,0,0,0,3.42,3.41A3.24,3.24,0,0,0,102.28,13.54Zm-83,0c0,4.83-3.32,8.82-8.49,8.82a6.54,6.54,0,0,1-4.65-1.57v5.86H0V5.16H6.17V6.8a6.43,6.43,0,0,1,5.11-2.18C16.41,4.62,19.31,8.58,19.31,13.54Zm-6.53,0A3.27,3.27,0,0,0,9.4,10,3.28,3.28,0,0,0,6,13.54,3.29,3.29,0,0,0,9.4,16.95,3.24,3.24,0,0,0,12.78,13.54Zm103.69,0.27c0-2.54,1.54-3.32,3.6-3.32a6.56,6.56,0,0,1,2.08.3L122.3,5.1a3.92,3.92,0,0,0-1.45-.18c-3.45,0-4.38,2.18-4.38,2.18V5.16H110.3V21.84h6.17v-8ZM141.73,0V21.84h-6.16V20.21a6.43,6.43,0,0,1-5.11,2.18c-5.14,0-8-4-8-8.91s3.32-8.82,8.49-8.82a6.54,6.54,0,0,1,4.65,1.57v-5Zm-6,13.48a3.28,3.28,0,0,0-3.41-3.41A3.24,3.24,0,0,0,129,13.47,3.4,3.4,0,1,0,135.75,13.47ZM81.35,4.62c-3.6,0-4.9,2.18-4.9,2.18V5.16H70.29V21.84h6.16V13.29c0-2.11.79-3.08,2.69-3.08s2.18,1.57,2.18,3.57v8.07h6.22V11.6C87.55,7,85.34,4.62,81.35,4.62ZM64.07,1.42H57.9V21.84h6.16V10.36H67l2.81-5.2H64.07V1.42ZM50.26,11.21c-2-.3-2.87-0.3-2.87-1.09s0.81-.94,2.42-0.94a16.15,16.15,0,0,1,5.11.91L56,5.41a24.56,24.56,0,0,0-6.13-.75c-5.89,0-9,2.27-9,5.89,0,2.81,1.66,4.47,6.53,5.11,2.06,0.27,2.81.39,2.81,1.15s-0.82,1-2.24,1a16.67,16.67,0,0,1-6-1.3L40.77,21.3a22.14,22.14,0,0,0,6.68,1c6.35,0,9.28-2.24,9.28-5.89C56.72,13.54,55.15,12,50.26,11.21ZM40.19,13.35c0,6.34-5.17,9-10,9s-9.82-2.6-9.82-8.73c0-6.28,5.08-9,10-9S40.19,7.25,40.19,13.35Zm-6.56.18a3.4,3.4,0,1,0-6.8,0,3.28,3.28,0,0,0,3.41,3.41A3.24,3.24,0,0,0,33.63,13.54Z", fill: "#00A0D6", transform: "translate(0 0)" }))))),
|
|
269
273
|
h("div", { class: "siteheader-topright" },
|
|
270
274
|
h("slot", { name: "toprightstart" }),
|
|
271
|
-
(this.gotData && this.loginDialog && !this.hideLogin) && (h("pn-marketweb-siteheader-login", { token: this.userToken, fullname: this.userFullname, loggedin: this.userLoggedin, loginDialog: this.loginDialog, endpoint: this.endpoint, i18n: this.i18n })),
|
|
275
|
+
(this.gotData && this.loginDialog && !this.hideLogin) && (h("pn-marketweb-siteheader-login", { token: this.userToken, fullname: this.userFullname, loggedin: this.userLoggedin, loginDialog: this.loginDialog, endpoint: this.endpoint, i18n: this.i18n, showProfileSelection: this.showProfileSelection })),
|
|
272
276
|
(this.gotData && this.languageOptions && this.languageOptions.length) && !this.hideLanguageSelector &&
|
|
273
277
|
h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))),
|
|
274
278
|
h("slot", { name: "toprightend" }))),
|
|
@@ -290,7 +294,7 @@ export class PnMarketwebSiteheader {
|
|
|
290
294
|
h("pn-mainnav-list", { heading: item.promotedMenuItemsHeader }, item.promotedMenuItems.map((childitem) => (h("pn-mainnav-link", { href: childitem.href, name: childitem.linkText, target: childitem.openInNewWindow ? "_blank" : "_self", linkid: this.promotedItemId(childitem) + item.id })))))));
|
|
291
295
|
})),
|
|
292
296
|
h("div", { slot: "footer", class: "siteheader-menu-footer" },
|
|
293
|
-
(this.gotData && this.loginDialog && !this.hideLogin) && (h("pn-marketweb-siteheader-login", { emitEvents: false, loginDialog: this.loginDialog, endpoint: this.endpoint, fullname: this.userFullname, loggedin: this.userLoggedin, i18n: this.i18n })),
|
|
297
|
+
(this.gotData && this.loginDialog && !this.hideLogin) && (h("pn-marketweb-siteheader-login", { emitEvents: false, loginDialog: this.loginDialog, endpoint: this.endpoint, fullname: this.userFullname, loggedin: this.userLoggedin, i18n: this.i18n, showProfileSelection: this.showProfileSelection })),
|
|
294
298
|
(this.gotData && this.languageOptions && this.languageOptions.length) && !this.hideLanguageSelector &&
|
|
295
299
|
h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))),
|
|
296
300
|
!this.hideSiteSelector &&
|
|
@@ -508,6 +512,24 @@ export class PnMarketwebSiteheader {
|
|
|
508
512
|
"reflect": true,
|
|
509
513
|
"defaultValue": "false"
|
|
510
514
|
},
|
|
515
|
+
"showProfileSelection": {
|
|
516
|
+
"type": "boolean",
|
|
517
|
+
"mutable": true,
|
|
518
|
+
"complexType": {
|
|
519
|
+
"original": "boolean",
|
|
520
|
+
"resolved": "boolean",
|
|
521
|
+
"references": {}
|
|
522
|
+
},
|
|
523
|
+
"required": false,
|
|
524
|
+
"optional": false,
|
|
525
|
+
"docs": {
|
|
526
|
+
"tags": [],
|
|
527
|
+
"text": "If this is selected we will show the new profile selection dropdown instead of the login version"
|
|
528
|
+
},
|
|
529
|
+
"attribute": "show-profile-selection",
|
|
530
|
+
"reflect": true,
|
|
531
|
+
"defaultValue": "false"
|
|
532
|
+
},
|
|
511
533
|
"AutocompleteEndpoint": {
|
|
512
534
|
"type": "string",
|
|
513
535
|
"mutable": false,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import readme from "./readme.md";
|
|
2
2
|
|
|
3
|
+
const usertoken = '5e5357915ea021150aa24fe6bd889bdacee14da41632a6c305e13ee';
|
|
4
|
+
|
|
3
5
|
export default {
|
|
4
6
|
title: "Web Components/Market web site Header",
|
|
5
7
|
parameters: {
|
|
@@ -51,6 +53,7 @@ const PrimaryTemplate = ({ ...args }) => {
|
|
|
51
53
|
hide-search="false"
|
|
52
54
|
hide-login="false"
|
|
53
55
|
cache="false"
|
|
56
|
+
show-profile-selection="true"
|
|
54
57
|
autocomplete-endpoint="http://localhost:51444/find_v2/_autocomplete"
|
|
55
58
|
session-forward="true">
|
|
56
59
|
<a href="" class="header-cart" slot="toprightend" style="align-self:center;position:relative;text-decoration:none;">
|
|
@@ -77,6 +80,45 @@ Primary.args = {
|
|
|
77
80
|
endpoint: 'http://localhost:51444'
|
|
78
81
|
}
|
|
79
82
|
|
|
83
|
+
const OldLoginDropdownTemplate = ({ ...args }) => {
|
|
84
|
+
return `
|
|
85
|
+
<div style="background:#ddd;min-height:100vh;">
|
|
86
|
+
<pn-marketweb-siteheader
|
|
87
|
+
market="${ args.market }"
|
|
88
|
+
language="${ args.language }"
|
|
89
|
+
endpoint="${ args.endpoint }"
|
|
90
|
+
hide-site-selector="false"
|
|
91
|
+
hide-language-selector="false"
|
|
92
|
+
hide-search="false"
|
|
93
|
+
hide-login="false"
|
|
94
|
+
show-profile-selection="false"
|
|
95
|
+
cache="false"
|
|
96
|
+
autocomplete-endpoint="http://localhost:51444/find_v2/_autocomplete"
|
|
97
|
+
session-forward="true">
|
|
98
|
+
<a href="" class="header-cart" slot="toprightend" style="align-self:center;position:relative;text-decoration:none;">
|
|
99
|
+
<span>Varukorg</span>
|
|
100
|
+
<pn-icon symbol="shop" color="blue700" class="pn-icon"></pn-icon>
|
|
101
|
+
</a>
|
|
102
|
+
</pn-marketweb-siteheader>
|
|
103
|
+
<div style="height:120vh; margin:2em; max-width:calc(100vw - 1em);background:#ccc;border:1px solid #333;">
|
|
104
|
+
Content that is higher than 100% viewport height
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<!--
|
|
109
|
+
<link rel="alternate" href="https://www.postnord.se/en/business-solutions" hreflang="en" />
|
|
110
|
+
<link rel="alternate" href="https://www.postnord.se/foretagslosningar" hreflang="sv" />
|
|
111
|
+
-->
|
|
112
|
+
`;
|
|
113
|
+
};
|
|
114
|
+
//
|
|
115
|
+
export const OldLoginDropdown = OldLoginDropdownTemplate.bind({});
|
|
116
|
+
OldLoginDropdown.args = {
|
|
117
|
+
market : "se",
|
|
118
|
+
language: 'sv',
|
|
119
|
+
endpoint: 'http://localhost:51444'
|
|
120
|
+
}
|
|
121
|
+
|
|
80
122
|
|
|
81
123
|
const MinimalOptionsTemplate = ({ ...args }) => {
|
|
82
124
|
return `
|
|
@@ -191,8 +233,33 @@ export const LoggedIn = LoggedInTemplate.bind({});
|
|
|
191
233
|
LoggedIn.args = {
|
|
192
234
|
market : "se",
|
|
193
235
|
language: 'sv',
|
|
194
|
-
endpoint: 'https://com-integration.postnord.com',
|
|
195
|
-
|
|
236
|
+
// endpoint: 'https://com-integration.postnord.com',
|
|
237
|
+
endpoint: 'http://localhost:51444/',
|
|
238
|
+
token: usertoken,
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const LoggedInProfileSelectionTemplate = ({ ...args }) => {
|
|
242
|
+
return `
|
|
243
|
+
<div style="background:#ddd;min-height:100vh;">
|
|
244
|
+
<pn-marketweb-siteheader
|
|
245
|
+
market="${ args.market }"
|
|
246
|
+
language="${ args.language }"
|
|
247
|
+
endpoint="${ args.endpoint }"
|
|
248
|
+
user-token="${ args.token }"
|
|
249
|
+
show-profile-selection="true"
|
|
250
|
+
>
|
|
251
|
+
</pn-marketweb-siteheader>
|
|
252
|
+
</div>
|
|
253
|
+
`;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export const LoggedInProfileSelection = LoggedInProfileSelectionTemplate.bind({});
|
|
257
|
+
LoggedInProfileSelection.args = {
|
|
258
|
+
market : "se",
|
|
259
|
+
language: 'sv',
|
|
260
|
+
// endpoint: 'https://com-integration.postnord.com',
|
|
261
|
+
endpoint: 'http://localhost:51444/',
|
|
262
|
+
token: usertoken,
|
|
196
263
|
};
|
|
197
264
|
|
|
198
265
|
const BusinessUserLoggedInTemplate = ({ ...args }) => {
|
|
@@ -6,7 +6,8 @@ export const translations = {
|
|
|
6
6
|
"menuHomeButton": "Hem",
|
|
7
7
|
"menuGoBackButton": "Gå tillbaka",
|
|
8
8
|
"mainMenuButton": "Meny",
|
|
9
|
-
"menuStartButton": "Start"
|
|
9
|
+
"menuStartButton": "Start",
|
|
10
|
+
"profileSelectionFlyoutHeading": "Inloggad som",
|
|
10
11
|
},
|
|
11
12
|
'en': {
|
|
12
13
|
"searchlabel": "Search",
|
|
@@ -15,7 +16,8 @@ export const translations = {
|
|
|
15
16
|
"menuHomeButton": "Home",
|
|
16
17
|
"menuGoBackButton": "Go back",
|
|
17
18
|
"mainMenuButton": "Menu",
|
|
18
|
-
"menuStartButton": "Start"
|
|
19
|
+
"menuStartButton": "Start",
|
|
20
|
+
"profileSelectionFlyoutHeading": "Logged in as",
|
|
19
21
|
},
|
|
20
22
|
'da': {
|
|
21
23
|
"searchlabel": "Søg",
|
|
@@ -24,7 +26,8 @@ export const translations = {
|
|
|
24
26
|
"menuHomeButton": "Hjem",
|
|
25
27
|
"menuGoBackButton": "Gå tilbage",
|
|
26
28
|
"mainMenuButton": "Menu",
|
|
27
|
-
"menuStartButton": "Start"
|
|
29
|
+
"menuStartButton": "Start",
|
|
30
|
+
"profileSelectionFlyoutHeading": "Logget ind som",
|
|
28
31
|
},
|
|
29
32
|
'no': {
|
|
30
33
|
"searchlabel": "Søk",
|
|
@@ -33,7 +36,8 @@ export const translations = {
|
|
|
33
36
|
"menuHomeButton": "Hjem",
|
|
34
37
|
"menuGoBackButton": "Gå tilbake",
|
|
35
38
|
"mainMenuButton": "Meny",
|
|
36
|
-
"menuStartButton": "Start"
|
|
39
|
+
"menuStartButton": "Start",
|
|
40
|
+
"profileSelectionFlyoutHeading": "Logget på som",
|
|
37
41
|
},
|
|
38
42
|
'fi': {
|
|
39
43
|
"searchlabel": "Hae",
|
|
@@ -42,6 +46,17 @@ export const translations = {
|
|
|
42
46
|
"menuHomeButton": "Koti",
|
|
43
47
|
"menuGoBackButton": "Mene takaisin",
|
|
44
48
|
"mainMenuButton": "Valikko",
|
|
45
|
-
"menuStartButton": "Alkaa"
|
|
49
|
+
"menuStartButton": "Alkaa",
|
|
50
|
+
"profileSelectionFlyoutHeading": "Kirjautunut sisään nimellä",
|
|
51
|
+
},
|
|
52
|
+
'de': {
|
|
53
|
+
"searchlabel": "Suche",
|
|
54
|
+
"searchplaceholder": "Wonach suchen Sie?",
|
|
55
|
+
"searchbuttontext": "Suche",
|
|
56
|
+
"menuHomeButton": "Heim",
|
|
57
|
+
"menuGoBackButton": "Geh zurück",
|
|
58
|
+
"mainMenuButton": "Menü",
|
|
59
|
+
"menuStartButton": "Start",
|
|
60
|
+
"profileSelectionFlyoutHeading": "Eingeloggt als",
|
|
46
61
|
}
|
|
47
62
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, Prop, h, Element, Host } from "@stencil/core";
|
|
2
2
|
export class PnProfileSelectorOption {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.
|
|
4
|
+
this.heading = "";
|
|
5
5
|
this.description = "";
|
|
6
6
|
this.url = "";
|
|
7
7
|
}
|
|
@@ -9,7 +9,7 @@ export class PnProfileSelectorOption {
|
|
|
9
9
|
return (h(Host, null,
|
|
10
10
|
h("a", { class: "customernumberoption", href: this.url },
|
|
11
11
|
h("span", { class: "customernumberoption-text" },
|
|
12
|
-
h("span", { class: "customernumberoption-title" }, this.
|
|
12
|
+
h("span", { class: "customernumberoption-title" }, this.heading),
|
|
13
13
|
h("span", { class: "customernumberoption-description" }, this.description),
|
|
14
14
|
h("slot", null)))));
|
|
15
15
|
}
|
|
@@ -21,7 +21,7 @@ export class PnProfileSelectorOption {
|
|
|
21
21
|
"$": ["pn-customernumber-selector-option.css"]
|
|
22
22
|
}; }
|
|
23
23
|
static get properties() { return {
|
|
24
|
-
"
|
|
24
|
+
"heading": {
|
|
25
25
|
"type": "string",
|
|
26
26
|
"mutable": false,
|
|
27
27
|
"complexType": {
|
|
@@ -35,7 +35,7 @@ export class PnProfileSelectorOption {
|
|
|
35
35
|
"tags": [],
|
|
36
36
|
"text": ""
|
|
37
37
|
},
|
|
38
|
-
"attribute": "
|
|
38
|
+
"attribute": "heading",
|
|
39
39
|
"reflect": false,
|
|
40
40
|
"defaultValue": "\"\""
|
|
41
41
|
},
|
package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector.js
CHANGED
|
@@ -4,8 +4,8 @@ export class PnCustomernumberSelector {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.language = "sv";
|
|
6
6
|
this.open = false;
|
|
7
|
-
this.
|
|
8
|
-
this.description = "
|
|
7
|
+
this.heading = "";
|
|
8
|
+
this.description = "";
|
|
9
9
|
this.i18n = translations["en"];
|
|
10
10
|
}
|
|
11
11
|
componentWillLoad() {
|
|
@@ -24,7 +24,7 @@ export class PnCustomernumberSelector {
|
|
|
24
24
|
h("div", { class: "customernumber-container" },
|
|
25
25
|
h("button", { class: "customernumber-toggle", "aria-label": this.i18n.toggleLinkTitleText, onClick: () => this.open = !this.open },
|
|
26
26
|
h("div", { class: "customernumber-selected" },
|
|
27
|
-
h("strong", { class: "customernumber-selected-title" }, this.
|
|
27
|
+
h("strong", { class: "customernumber-selected-title" }, this.heading),
|
|
28
28
|
h("div", { class: "customernumber-selected-description" }, this.description)),
|
|
29
29
|
h("pn-icon", { symbol: this.open ? 'angle-up' : 'angle-down', small: "false", color: "blue700" })),
|
|
30
30
|
h("div", { class: "customernumber-options" },
|
|
@@ -74,7 +74,7 @@ export class PnCustomernumberSelector {
|
|
|
74
74
|
"reflect": true,
|
|
75
75
|
"defaultValue": "false"
|
|
76
76
|
},
|
|
77
|
-
"
|
|
77
|
+
"heading": {
|
|
78
78
|
"type": "string",
|
|
79
79
|
"mutable": false,
|
|
80
80
|
"complexType": {
|
|
@@ -88,9 +88,9 @@ export class PnCustomernumberSelector {
|
|
|
88
88
|
"tags": [],
|
|
89
89
|
"text": ""
|
|
90
90
|
},
|
|
91
|
-
"attribute": "
|
|
91
|
+
"attribute": "heading",
|
|
92
92
|
"reflect": false,
|
|
93
|
-
"defaultValue": "\"
|
|
93
|
+
"defaultValue": "\"\""
|
|
94
94
|
},
|
|
95
95
|
"description": {
|
|
96
96
|
"type": "string",
|
|
@@ -108,7 +108,7 @@ export class PnCustomernumberSelector {
|
|
|
108
108
|
},
|
|
109
109
|
"attribute": "description",
|
|
110
110
|
"reflect": false,
|
|
111
|
-
"defaultValue": "\"
|
|
111
|
+
"defaultValue": "\"\""
|
|
112
112
|
}
|
|
113
113
|
}; }
|
|
114
114
|
static get states() { return {
|
|
@@ -13,10 +13,10 @@ const PrimaryTemplate = ({ ...args }) => {
|
|
|
13
13
|
<div style="min-width:100%;min-height:100vh;background:#eee;padding:1em;">
|
|
14
14
|
<div style="max-width:15em; background:#fff;">
|
|
15
15
|
|
|
16
|
-
<pn-customernumber-selector selected="abc1">
|
|
17
|
-
<pn-customernumber-selector-option id="abc1"
|
|
16
|
+
<pn-customernumber-selector selected="abc1" heading="Lorem Ipsum" description="123 546 789">
|
|
17
|
+
<pn-customernumber-selector-option id="abc1" heading="John Doe Karlsson (Privat)" description="john.doe.karlsson@hotmail.com" url="?id=123"></pn-customernumber-selector-option>
|
|
18
18
|
<pn-customernumber-selector-option id="12345678" url="?id=12345678">12345678</pn-customernumber-selector-option>
|
|
19
|
-
<pn-customernumber-selector-option id="abc3"
|
|
19
|
+
<pn-customernumber-selector-option id="abc3" heading="Long name company incorporated business practice" description="Kundnr: 1234321" url="?id=123"></pn-customernumber-selector-option>
|
|
20
20
|
</pn-customernumber-selector>
|
|
21
21
|
|
|
22
22
|
<pn-sidenav language="${args.language}">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, Prop, h, Element, Host } from "@stencil/core";
|
|
2
2
|
export class PnProfileSelectorOption {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.
|
|
4
|
+
this.heading = "";
|
|
5
5
|
this.description = "";
|
|
6
6
|
this.url = "";
|
|
7
7
|
}
|
|
@@ -9,7 +9,7 @@ export class PnProfileSelectorOption {
|
|
|
9
9
|
return (h(Host, null,
|
|
10
10
|
h("a", { class: "profileselectoroption", href: this.url },
|
|
11
11
|
h("span", { class: "profileselectoroption-text" },
|
|
12
|
-
h("span", { class: "profileselectoroption-title" }, this.
|
|
12
|
+
h("span", { class: "profileselectoroption-title" }, this.heading),
|
|
13
13
|
h("span", { class: "profileselectoroption-description" }, this.description)),
|
|
14
14
|
h("pn-icon", { symbol: "arrow-right", small: "false", color: "blue700" }))));
|
|
15
15
|
}
|
|
@@ -21,7 +21,7 @@ export class PnProfileSelectorOption {
|
|
|
21
21
|
"$": ["pn-profile-selector-option.css"]
|
|
22
22
|
}; }
|
|
23
23
|
static get properties() { return {
|
|
24
|
-
"
|
|
24
|
+
"heading": {
|
|
25
25
|
"type": "string",
|
|
26
26
|
"mutable": false,
|
|
27
27
|
"complexType": {
|
|
@@ -35,7 +35,7 @@ export class PnProfileSelectorOption {
|
|
|
35
35
|
"tags": [],
|
|
36
36
|
"text": ""
|
|
37
37
|
},
|
|
38
|
-
"attribute": "
|
|
38
|
+
"attribute": "heading",
|
|
39
39
|
"reflect": false,
|
|
40
40
|
"defaultValue": "\"\""
|
|
41
41
|
},
|
|
@@ -28,10 +28,10 @@ export class PnfindPriceResult {
|
|
|
28
28
|
}
|
|
29
29
|
this.showMeasurement = (this.item.maxmått !== null) || (this.item.rulle !== null);
|
|
30
30
|
this.linkId = `${this.item.id}-${this.item.name.toLocaleLowerCase().replace(/[^a-zA-Z0-9]/g, '')}`;
|
|
31
|
-
var
|
|
32
|
-
this.shopLabel =
|
|
33
|
-
this.shopUrl =
|
|
34
|
-
this.shopId =
|
|
31
|
+
var showServicepointLink = (this.item.ombudpurchase === "Yes");
|
|
32
|
+
this.shopLabel = showServicepointLink ? state.i18n.ombudHeader : state.i18n.stampshopcta;
|
|
33
|
+
this.shopUrl = showServicepointLink ? state.market.servicePoint : stampShopUrl;
|
|
34
|
+
this.shopId = showServicepointLink ? '-servicepoint' : '-stampshop';
|
|
35
35
|
}
|
|
36
36
|
render() {
|
|
37
37
|
return (h(Host, null, h("pn-product-card", { "data-productid": this.item.id },
|
|
@@ -3,6 +3,8 @@ export const translations = {
|
|
|
3
3
|
'componentheading': 'Våra priser och villkor för inrikesförsändelser för dig som direktbetalande kund?',
|
|
4
4
|
'deliveryscopeheading': 'Endast leveranser inom Sverige',
|
|
5
5
|
'resultlistheading': 'Några bra alternativ för dig',
|
|
6
|
+
'sizeheading': 'Uppskatta storleken på din försändelse',
|
|
7
|
+
'weightheading': 'Uppskatta vikten på din försändelse',
|
|
6
8
|
'weightlabel': 'Vikt',
|
|
7
9
|
'maxweightlabel': 'Maxvikt',
|
|
8
10
|
'maxmeasurementlabel': 'Maxvolym',
|
|
@@ -19,6 +21,8 @@ export const translations = {
|
|
|
19
21
|
'componentheading': 'Our prices and terms and conditions for domestic shipments for you as a direct paying customer',
|
|
20
22
|
'deliveryscopeheading': 'Deliveries within Sweden only',
|
|
21
23
|
'resultlistheading': 'Some suitable options for you',
|
|
24
|
+
'sizeheading': 'Estimate the size of your shipment',
|
|
25
|
+
'weightheading': 'Estimate the weight of your shipment',
|
|
22
26
|
'weightlabel': 'Weight',
|
|
23
27
|
'maxweightlabel': 'Max weight',
|
|
24
28
|
'maxmeasurementlabel': 'Maximum measurement',
|
|
@@ -35,6 +39,8 @@ export const translations = {
|
|
|
35
39
|
'componentheading': 'Vad vill du skicka?',
|
|
36
40
|
'deliveryscopeheading': 'Kun leveringer indenfor Sverige',
|
|
37
41
|
'resultlistheading': 'Nogle passende muligheder for dig',
|
|
42
|
+
'sizeheading': 'Anslå størrelsen på din forsendelse',
|
|
43
|
+
'weightheading': 'Anslå vægten af din forsendelse',
|
|
38
44
|
'weightlabel': 'Vægt',
|
|
39
45
|
'maxweightlabel': 'Max vægt',
|
|
40
46
|
'maxmeasurementlabel': 'Maks. Volumen',
|
|
@@ -23,15 +23,18 @@ pn-find-price .firstCell {
|
|
|
23
23
|
}
|
|
24
24
|
pn-find-price .findprice-form {
|
|
25
25
|
max-width: 60em;
|
|
26
|
-
margin:
|
|
26
|
+
margin: 2em auto 3em auto;
|
|
27
|
+
}
|
|
28
|
+
pn-find-price h2 {
|
|
29
|
+
text-align: center;
|
|
30
|
+
margin-bottom: 1rem;
|
|
27
31
|
}
|
|
28
|
-
pn-find-price h2,
|
|
29
32
|
pn-find-price .heading {
|
|
30
33
|
text-align: center;
|
|
31
|
-
font-size: 1.5em;
|
|
32
34
|
line-height: 1.1;
|
|
33
35
|
font-weight: bold;
|
|
34
36
|
margin-bottom: 1rem;
|
|
37
|
+
color: #005D92;
|
|
35
38
|
}
|
|
36
39
|
pn-find-price .resultHeading {
|
|
37
40
|
text-align: center;
|