@postnord/pn-marketweb-components 2.1.0 → 2.1.1

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.
Files changed (150) hide show
  1. package/cjs/{data-b5ef4f7c.js → data-4fa6b08d.js} +2 -2
  2. package/cjs/loader.cjs.js +1 -1
  3. package/cjs/pn-find-price-result.cjs.entry.js +4 -4
  4. package/cjs/{pn-find-price-store-0b8c195c.js → pn-find-price-store-a91ce3f6.js} +2 -2
  5. package/cjs/pn-find-price.cjs.entry.js +7 -7
  6. package/cjs/pn-language-selector_9.cjs.entry.js +29 -19
  7. package/cjs/pn-market-web-components.cjs.js +1 -1
  8. package/cjs/{pn-marketweb-siteheader-login-links_2.cjs.entry.js → pn-marketweb-siteheader-login-button_4.cjs.entry.js} +67 -18
  9. package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js +7 -42
  10. package/cjs/pn-marketweb-siteheader.cjs.entry.js +2 -2
  11. package/cjs/{pn-product-card_4.cjs.entry.js → pn-product-card_3.cjs.entry.js} +0 -18
  12. package/cjs/pn-product-pricelist.cjs.entry.js +1 -1
  13. package/cjs/pn-proxio-findprice-result.cjs.entry.js +63 -0
  14. package/cjs/pn-proxio-findprice.cjs.entry.js +311 -0
  15. package/cjs/pn-proxio-pricegroup.cjs.entry.js +6 -22
  16. package/cjs/pn-titletag.cjs.entry.js +24 -0
  17. package/cjs/translations-585711ff.js +21 -0
  18. package/collection/collection-manifest.json +4 -0
  19. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.css +0 -0
  20. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.js +77 -0
  21. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.css +25 -13
  22. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js +14 -45
  23. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.js +13 -23
  24. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.css +0 -0
  25. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.js +55 -0
  26. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js +56 -25
  27. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.css +26 -0
  28. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +3 -3
  29. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +4 -5
  30. package/collection/components/widgets/pn-find-price/data.js +2 -2
  31. package/collection/components/widgets/pn-find-price/pn-find-price-result.js +7 -7
  32. package/collection/components/widgets/pn-find-price/pn-find-price-store.js +2 -2
  33. package/collection/components/widgets/pn-find-price/pn-find-price-translations.js +5 -5
  34. package/collection/components/widgets/pn-proxio-findprice/data.js +52 -0
  35. package/collection/components/widgets/pn-proxio-findprice/find-price.stories.js +27 -0
  36. package/collection/components/widgets/pn-proxio-findprice/img/clouds.svg +5 -0
  37. package/collection/components/widgets/pn-proxio-findprice/img/large-package.svg +9 -0
  38. package/collection/components/widgets/pn-proxio-findprice/img/medium-package.svg +9 -0
  39. package/collection/components/widgets/pn-proxio-findprice/img/postnord-person1.svg +52 -0
  40. package/collection/components/widgets/pn-proxio-findprice/img/postnord-person2.svg +56 -0
  41. package/collection/components/widgets/pn-proxio-findprice/img/small-package.svg +23 -0
  42. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.css +9 -0
  43. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.js +234 -0
  44. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-store.js +29 -0
  45. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-translations.js +106 -0
  46. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-types.js +1 -0
  47. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.css +119 -0
  48. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.js +250 -0
  49. package/collection/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.css +3 -0
  50. package/collection/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.js +1 -0
  51. package/collection/globals/MarketWebLoginManager.js +1 -1
  52. package/custom-elements/index.d.ts +24 -0
  53. package/custom-elements/index.js +634 -242
  54. package/esm/{data-9c9c5f41.js → data-059c2a58.js} +2 -2
  55. package/esm/loader.js +1 -1
  56. package/esm/pn-find-price-result.entry.js +4 -4
  57. package/esm/{pn-find-price-store-b4556c9b.js → pn-find-price-store-bde5071d.js} +2 -2
  58. package/esm/pn-find-price.entry.js +7 -7
  59. package/esm/pn-language-selector_9.entry.js +29 -19
  60. package/esm/pn-market-web-components.js +1 -1
  61. package/esm/{pn-marketweb-siteheader-login-links_2.entry.js → pn-marketweb-siteheader-login-button_4.entry.js} +66 -19
  62. package/esm/pn-marketweb-siteheader-login-linklist.entry.js +7 -42
  63. package/esm/pn-marketweb-siteheader.entry.js +2 -2
  64. package/esm/{pn-product-card_4.entry.js → pn-product-card_3.entry.js} +2 -19
  65. package/esm/pn-product-pricelist.entry.js +1 -1
  66. package/esm/pn-proxio-findprice-result.entry.js +59 -0
  67. package/esm/pn-proxio-findprice.entry.js +307 -0
  68. package/esm/pn-proxio-pricegroup.entry.js +3 -19
  69. package/esm/pn-titletag.entry.js +20 -0
  70. package/esm/translations-022fefa0.js +19 -0
  71. package/esm-es5/{data-9c9c5f41.js → data-059c2a58.js} +1 -1
  72. package/esm-es5/loader.js +1 -1
  73. package/esm-es5/pn-find-price-result.entry.js +1 -1
  74. package/esm-es5/{pn-find-price-store-b4556c9b.js → pn-find-price-store-bde5071d.js} +1 -1
  75. package/esm-es5/pn-find-price.entry.js +1 -1
  76. package/esm-es5/pn-language-selector_9.entry.js +1 -1
  77. package/esm-es5/pn-market-web-components.js +1 -1
  78. package/esm-es5/pn-marketweb-siteheader-login-button_4.entry.js +1 -0
  79. package/esm-es5/pn-marketweb-siteheader-login-linklist.entry.js +1 -1
  80. package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
  81. package/esm-es5/pn-product-card_3.entry.js +1 -0
  82. package/esm-es5/pn-product-pricelist.entry.js +1 -1
  83. package/esm-es5/pn-proxio-findprice-result.entry.js +1 -0
  84. package/esm-es5/pn-proxio-findprice.entry.js +1 -0
  85. package/esm-es5/pn-proxio-pricegroup.entry.js +1 -1
  86. package/esm-es5/pn-titletag.entry.js +1 -0
  87. package/esm-es5/translations-022fefa0.js +1 -0
  88. package/package.json +1 -1
  89. package/pn-market-web-components/p-10eafcd7.entry.js +1 -0
  90. package/pn-market-web-components/p-20be85a1.system.entry.js +1 -0
  91. package/pn-market-web-components/p-2b4c41aa.system.entry.js +1 -0
  92. package/pn-market-web-components/{p-37017f68.system.js → p-3738a2df.system.js} +1 -1
  93. package/pn-market-web-components/p-3969ec4d.entry.js +1 -0
  94. package/pn-market-web-components/p-499bb3ac.entry.js +1 -0
  95. package/pn-market-web-components/p-4a03854b.system.entry.js +1 -0
  96. package/pn-market-web-components/p-557328e3.system.entry.js +1 -0
  97. package/pn-market-web-components/{p-ac0e3c22.system.entry.js → p-59be826b.system.entry.js} +1 -1
  98. package/pn-market-web-components/p-67887512.system.js +1 -1
  99. package/pn-market-web-components/{p-0b0727dc.entry.js → p-70b360dd.entry.js} +1 -1
  100. package/pn-market-web-components/{p-d0653c80.system.entry.js → p-7f9c643c.system.entry.js} +1 -1
  101. package/pn-market-web-components/p-8afa354b.system.entry.js +1 -0
  102. package/pn-market-web-components/{p-aab2e28f.entry.js → p-8b684578.entry.js} +1 -1
  103. package/pn-market-web-components/p-951861fa.entry.js +1 -0
  104. package/pn-market-web-components/{p-736e5b84.system.entry.js → p-98a7ddd1.system.entry.js} +1 -1
  105. package/pn-market-web-components/p-a120063f.js +1 -0
  106. package/pn-market-web-components/p-b501b216.system.js +1 -0
  107. package/pn-market-web-components/{p-3ae38e63.entry.js → p-b9a84e67.entry.js} +1 -1
  108. package/pn-market-web-components/p-dd01024a.system.entry.js +1 -0
  109. package/pn-market-web-components/p-de823255.entry.js +1 -0
  110. package/pn-market-web-components/p-e397e11b.entry.js +1 -0
  111. package/pn-market-web-components/p-e4ebf17d.system.entry.js +1 -0
  112. package/pn-market-web-components/p-e7a1cda9.entry.js +1 -0
  113. package/pn-market-web-components/{p-e4a4e68f.system.entry.js → p-ecdf2b69.system.entry.js} +1 -1
  114. package/pn-market-web-components/p-f58bde56.js +1 -0
  115. package/pn-market-web-components/p-f782ce94.system.entry.js +1 -0
  116. package/pn-market-web-components/p-fe95397b.entry.js +1 -0
  117. package/pn-market-web-components/p-ff83e974.entry.js +1 -0
  118. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  119. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.d.ts +10 -0
  120. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.d.ts +1 -2
  121. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.d.ts +1 -1
  122. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.d.ts +6 -0
  123. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.d.ts +3 -2
  124. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-types.d.ts +10 -8
  125. package/types/components/widgets/pn-find-price/pn-find-price-store.d.ts +4 -4
  126. package/types/components/widgets/pn-find-price/pn-find-price-translations.d.ts +5 -5
  127. package/types/components/widgets/pn-find-price/pn-find-price-types.d.ts +2 -2
  128. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.d.ts +22 -0
  129. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-store.d.ts +51 -0
  130. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-translations.d.ts +106 -0
  131. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-types.d.ts +39 -0
  132. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice.d.ts +24 -0
  133. package/types/components/widgets/pn-proxio-pricegroup/types.d.ts +1 -1
  134. package/types/components.d.ts +85 -1
  135. package/esm-es5/pn-marketweb-siteheader-login-links_2.entry.js +0 -1
  136. package/esm-es5/pn-product-card_4.entry.js +0 -1
  137. package/pn-market-web-components/p-022d9a78.entry.js +0 -1
  138. package/pn-market-web-components/p-198d9c77.system.entry.js +0 -1
  139. package/pn-market-web-components/p-332e9005.entry.js +0 -1
  140. package/pn-market-web-components/p-3c0d63fb.system.entry.js +0 -1
  141. package/pn-market-web-components/p-63c30175.entry.js +0 -1
  142. package/pn-market-web-components/p-6b33db5b.system.entry.js +0 -1
  143. package/pn-market-web-components/p-77557da8.entry.js +0 -1
  144. package/pn-market-web-components/p-92fd28e6.entry.js +0 -1
  145. package/pn-market-web-components/p-a119cb8e.entry.js +0 -1
  146. package/pn-market-web-components/p-c4254e9e.js +0 -1
  147. package/pn-market-web-components/p-d542a52b.system.entry.js +0 -1
  148. package/pn-market-web-components/p-eb662559.system.entry.js +0 -1
  149. /package/pn-market-web-components/{p-bfa7c83f.system.js → p-1534926e.system.js} +0 -0
  150. /package/pn-market-web-components/{p-86b52823.js → p-a07906d5.js} +0 -0
@@ -1,49 +1,14 @@
1
- import { Component, Prop, h, Element, Host } from "@stencil/core";
2
- import { state as headerState } from "./pn-marketweb-siteheader-store";
1
+ import { Component, Element, h, Host, Prop } from '@stencil/core';
2
+ import { state as headerState } from './pn-marketweb-siteheader-store';
3
3
  export class PnMarketwebSiteheaderLoginLinklist {
4
4
  constructor() {
5
5
  this.heading = null;
6
6
  this.links = [];
7
- this.idNamespace = "";
8
- }
9
- componentWillLoad() {
7
+ this.idNamespace = '';
10
8
  }
9
+ componentWillLoad() { }
11
10
  uniqueId(text) {
12
- return "loginlink-" + text.replace(/[^A-Za-z0-9.\\\/]/igm, "") + "-" + this.idNamespace;
13
- }
14
- linkAppearanceAttributes(link) {
15
- let attributes = {};
16
- if (link.linkType) {
17
- switch (link.linkType) {
18
- case 'primary':
19
- attributes = {
20
- appearance: '',
21
- variant: ''
22
- };
23
- break;
24
- case 'secondary':
25
- attributes = {
26
- appearance: 'light',
27
- variant: 'outlined'
28
- };
29
- break;
30
- case 'regularlink':
31
- default:
32
- attributes = {
33
- appearance: 'light',
34
- variant: 'borderless',
35
- icon: 'arrow-right'
36
- };
37
- break;
38
- }
39
- return attributes;
40
- }
41
- if (!link.linkType) {
42
- attributes = {
43
- appearance: link.primaryLinkApperance ? "dark" : "light"
44
- };
45
- }
46
- return attributes;
11
+ return 'loginlink-' + text.replace(/[^A-Za-z0-9.\\\/]/gim, '') + '-' + this.idNamespace;
47
12
  }
48
13
  render() {
49
14
  if (!this.links || this.links.length === 0) {
@@ -51,11 +16,15 @@ export class PnMarketwebSiteheaderLoginLinklist {
51
16
  }
52
17
  return (h(Host, null,
53
18
  this.heading ? h("strong", null, this.heading) : null,
54
- h("ul", null, this.links.map((link) => {
19
+ h("ul", null, this.links.map(link => {
55
20
  return (h("li", null,
56
- h("pn-button", Object.assign({ href: link.href, id: this.uniqueId(link.linkText) }, (link.openInNewWindow && { target: '_blank' }), this.linkAppearanceAttributes(link), { onClick: () => { if (link.isLogoutLink) {
57
- headerState.loginManager.clearUserData();
58
- } } }), link.linkText)));
21
+ h("a", Object.assign({ href: link.href, id: this.uniqueId(link.linkText) }, (link.openInNewWindow && { target: '_blank' }), { onClick: () => {
22
+ if (link.isLogoutLink) {
23
+ headerState.loginManager.clearUserData();
24
+ }
25
+ } }),
26
+ link.linkText,
27
+ link.isLogoutLink ? h("pn-icon", { symbol: "transfer" }) : h("pn-icon", { symbol: "arrow-right" }))));
59
28
  }))));
60
29
  }
61
30
  static get is() { return "pn-marketweb-siteheader-login-linklist"; }
@@ -121,7 +90,7 @@ export class PnMarketwebSiteheaderLoginLinklist {
121
90
  },
122
91
  "attribute": "id-namespace",
123
92
  "reflect": false,
124
- "defaultValue": "\"\""
93
+ "defaultValue": "''"
125
94
  }
126
95
  }; }
127
96
  static get elementRef() { return "hostElement"; }
@@ -1,12 +1,12 @@
1
- import { Component, Prop, h, Element, Watch, Host } from "@stencil/core";
2
- import { state as headerState } from "./pn-marketweb-siteheader-store";
1
+ import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';
2
+ import { state as headerState } from './pn-marketweb-siteheader-store';
3
3
  export class PnMarketwebSiteheaderLoginLinks {
4
4
  constructor() {
5
5
  // Login dialog
6
6
  this.loginDialog = null;
7
- this.idNamespace = "";
7
+ this.idNamespace = '';
8
8
  this.loggedin = false;
9
- this.username = "";
9
+ this.username = '';
10
10
  }
11
11
  componentWillLoad() {
12
12
  this.init();
@@ -21,12 +21,12 @@ export class PnMarketwebSiteheaderLoginLinks {
21
21
  }
22
22
  const adjustLink = (link, i) => {
23
23
  if (!link.isLogoutLink) {
24
- link.isLogoutLink = (link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1);
24
+ link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;
25
25
  }
26
26
  if (link.isLogoutLink) {
27
27
  link.href = headerState.loginManager.getLogoutUrl(link.href);
28
28
  }
29
- link.href = link.href.replace("window.location.href", window.location.href);
29
+ link.href = link.href.replace('window.location.href', window.location.href);
30
30
  if (i === 0 && !link.href) {
31
31
  link.href = headerState.loginManager.getLoginUrl();
32
32
  link.linkType = 'primary';
@@ -49,7 +49,7 @@ export class PnMarketwebSiteheaderLoginLinks {
49
49
  isLogoutLink: false,
50
50
  pageLink: null,
51
51
  linkType: 'primary',
52
- primaryLinkApperance: true
52
+ primaryLinkApperance: true,
53
53
  },
54
54
  {
55
55
  href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),
@@ -57,8 +57,8 @@ export class PnMarketwebSiteheaderLoginLinks {
57
57
  openInNewWindow: false,
58
58
  isLogoutLink: false,
59
59
  pageLink: null,
60
- primaryLinkApperance: false
61
- }
60
+ primaryLinkApperance: false,
61
+ },
62
62
  ];
63
63
  }
64
64
  render() {
@@ -75,18 +75,8 @@ export class PnMarketwebSiteheaderLoginLinks {
75
75
  hostElementAttribute.loggedin = this.loggedin;
76
76
  }
77
77
  return (h(Host, Object.assign({}, hostElementAttribute),
78
- (!this.loginDialog.overrideLoginMenu) ?
79
- h("div", { "data-loggedin": this.loggedin + '' }, (this.loggedin) ?
80
- h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loggedInLinks, idNamespace: this.idNamespace })
81
- :
82
- h("div", null, ((_a = this.loginDialog.loginMenuLinks) === null || _a === void 0 ? void 0 : _a.length) > 0 ?
83
- h("pn-marketweb-siteheader-login-linklist", { heading: this.loginDialog.loginTitle, links: this.loginDialog.loginMenuLinks, idNamespace: this.idNamespace })
84
- :
85
- h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.legacyLoginLinks, idNamespace: this.idNamespace })))
86
- : null,
87
- (this.loginDialog.overrideLoginMenu) ?
88
- h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loginMenuLinks, idNamespace: this.idNamespace })
89
- : null));
78
+ !this.loginDialog.overrideLoginMenu ? (h("div", { "data-loggedin": this.loggedin + '' }, this.loggedin ? (h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loggedInLinks, idNamespace: this.idNamespace })) : (h("div", null, ((_a = this.loginDialog.loginMenuLinks) === null || _a === void 0 ? void 0 : _a.length) > 0 ? (h("pn-marketweb-siteheader-login-linklist", { heading: this.loginDialog.loginTitle, links: this.loginDialog.loginMenuLinks, idNamespace: this.idNamespace })) : (h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.legacyLoginLinks, idNamespace: this.idNamespace })))))) : null,
79
+ this.loginDialog.overrideLoginMenu ? (h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loginMenuLinks, idNamespace: this.idNamespace })) : null));
90
80
  }
91
81
  static get is() { return "pn-marketweb-siteheader-login-links"; }
92
82
  static get originalStyleUrls() { return {
@@ -133,7 +123,7 @@ export class PnMarketwebSiteheaderLoginLinks {
133
123
  },
134
124
  "attribute": "id-namespace",
135
125
  "reflect": false,
136
- "defaultValue": "\"\""
126
+ "defaultValue": "''"
137
127
  },
138
128
  "loggedin": {
139
129
  "type": "boolean",
@@ -169,7 +159,7 @@ export class PnMarketwebSiteheaderLoginLinks {
169
159
  },
170
160
  "attribute": "username",
171
161
  "reflect": false,
172
- "defaultValue": "\"\""
162
+ "defaultValue": "''"
173
163
  }
174
164
  }; }
175
165
  static get elementRef() { return "hostElement"; }
@@ -0,0 +1,55 @@
1
+ import { Component, Element, h, Host, Prop } from '@stencil/core';
2
+ export class PnMarketwebSiteheaderLoginMypageButton {
3
+ constructor() {
4
+ this.label = 'Mina sidor!';
5
+ }
6
+ render() {
7
+ return (h(Host, null,
8
+ h("pn-button", { href: this.myPageUrl }, this.label)));
9
+ }
10
+ static get is() { return "pn-marketweb-siteheader-login-mypage-button"; }
11
+ static get originalStyleUrls() { return {
12
+ "$": ["pn-marketweb-siteheader-login-mypage-button.scss"]
13
+ }; }
14
+ static get styleUrls() { return {
15
+ "$": ["pn-marketweb-siteheader-login-mypage-button.css"]
16
+ }; }
17
+ static get properties() { return {
18
+ "label": {
19
+ "type": "string",
20
+ "mutable": false,
21
+ "complexType": {
22
+ "original": "string",
23
+ "resolved": "string",
24
+ "references": {}
25
+ },
26
+ "required": false,
27
+ "optional": false,
28
+ "docs": {
29
+ "tags": [],
30
+ "text": ""
31
+ },
32
+ "attribute": "label",
33
+ "reflect": false,
34
+ "defaultValue": "'Mina sidor!'"
35
+ },
36
+ "myPageUrl": {
37
+ "type": "string",
38
+ "mutable": false,
39
+ "complexType": {
40
+ "original": "string",
41
+ "resolved": "string",
42
+ "references": {}
43
+ },
44
+ "required": false,
45
+ "optional": false,
46
+ "docs": {
47
+ "tags": [],
48
+ "text": ""
49
+ },
50
+ "attribute": "my-page-url",
51
+ "reflect": false
52
+ }
53
+ }; }
54
+ static get elementRef() { return "hostElement"; }
55
+ }
@@ -1,42 +1,55 @@
1
- import { Component, Prop, h, State, Element, Watch, Event, Host } from "@stencil/core";
2
- import { MarketWebLoginManager } from "../../../globals/MarketWebLoginManager";
3
- import { state as headerState } from "./pn-marketweb-siteheader-store";
1
+ import { Component, Element, Event, h, Host, Prop, State, Watch } from '@stencil/core';
2
+ import { MarketWebLoginManager } from '../../../globals/MarketWebLoginManager';
3
+ import { state as headerState } from './pn-marketweb-siteheader-store';
4
4
  export class PnMarketwebSiteheaderLogin {
5
5
  constructor() {
6
6
  var _a;
7
7
  /** Specifies which endpoint domain we should load from */
8
- this.endpoint = "";
8
+ this.endpoint = '';
9
9
  /** Access token passed from backend */
10
- this.token = "";
11
- this.i18n = { "searchlabel": "", "searchplaceholder": "", "searchbuttontext": "", "menuHomeButton": "", "menuGoBackButton": "", "mainMenuButton": "", "menuStartButton": "", "profileSelectionFlyoutHeading": "" };
10
+ this.token = '';
11
+ this.i18n = {
12
+ searchlabel: '',
13
+ searchplaceholder: '',
14
+ searchbuttontext: '',
15
+ menuHomeButton: '',
16
+ menuGoBackButton: '',
17
+ mainMenuButton: '',
18
+ menuStartButton: '',
19
+ profileSelectionFlyoutHeading: '',
20
+ loginButtonText: '',
21
+ loginPreamble: '',
22
+ };
12
23
  this.siteUrl = '';
13
24
  this.emitEvents = true;
14
25
  // Login dialog
15
26
  this.loginDialog = null;
16
27
  /** User Fullname */
17
- this.fullname = "";
28
+ this.fullname = '';
18
29
  this.loggedin = false;
19
30
  /** If this is selected we will show the new profile selection dropdown instead of the login version */
20
31
  this.showProfileSelection = false;
21
32
  /** Continiously check if a user is logged in **/
22
33
  this.checkUserLoggedInStateInterval = 0;
23
- this.toggleButtonText = (((_a = this.loginDialog) === null || _a === void 0 ? void 0 : _a.loginMenuLinkText) ? this.loginDialog.loginMenuLinkText : "");
34
+ this.toggleButtonText = ((_a = this.loginDialog) === null || _a === void 0 ? void 0 : _a.loginMenuLinkText) ? this.loginDialog.loginMenuLinkText : '';
24
35
  this.username = this.fullname;
25
36
  }
26
37
  componentWillLoad() {
38
+ console.log('env: ', this.environment);
27
39
  const userInfo = this.loggedin && this.fullname ? { given_name: this.fullname } : null;
28
40
  headerState.loginManager = new MarketWebLoginManager({
29
41
  endpoint: this.endpoint,
30
42
  eventTarget: this.hostElement,
31
43
  checkUserLoggedInStateInterval: this.checkUserLoggedInStateInterval,
32
- userInfo
44
+ userInfo,
33
45
  });
34
46
  headerState.loginManager.setSiteUrl(this.siteUrl);
35
- this.hostElement["loginmanager"] = headerState.loginManager;
47
+ this.hostElement['loginmanager'] = headerState.loginManager;
36
48
  if (this.token) {
37
49
  headerState.loginManager.registerToken(this.token, 'backend');
38
50
  }
39
- else if (this.emitEvents) { // The primary login instance
51
+ else if (this.emitEvents) {
52
+ // The primary login instance
40
53
  headerState.loginManager.invalidateTokenOfType('backend');
41
54
  }
42
55
  this.hostElement.addEventListener(headerState.loginManager.events.loginstatechange, this.onLoginStateChange.bind(this));
@@ -56,7 +69,7 @@ export class PnMarketwebSiteheaderLogin {
56
69
  }
57
70
  const adjustLink = (link, i) => {
58
71
  if (!link.isLogoutLink) {
59
- link.isLogoutLink = (link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1);
72
+ link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;
60
73
  }
61
74
  if (link.isLogoutLink) {
62
75
  link.href = headerState.loginManager.getLogoutUrl(link.href);
@@ -82,7 +95,7 @@ export class PnMarketwebSiteheaderLogin {
82
95
  isLogoutLink: false,
83
96
  pageLink: null,
84
97
  linkType: 'primary',
85
- primaryLinkApperance: true
98
+ primaryLinkApperance: true,
86
99
  },
87
100
  {
88
101
  href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),
@@ -90,18 +103,18 @@ export class PnMarketwebSiteheaderLogin {
90
103
  openInNewWindow: false,
91
104
  isLogoutLink: false,
92
105
  pageLink: null,
93
- primaryLinkApperance: false
94
- }
106
+ primaryLinkApperance: false,
107
+ },
95
108
  ];
96
109
  }
97
110
  setUserName() {
98
111
  const userInfo = headerState.loginManager.getUserInfo();
99
- let name = "";
112
+ let name = '';
100
113
  if (!this.loggedin || !userInfo) {
101
114
  this.username = name;
102
115
  }
103
116
  if (userInfo && userInfo.given_name) {
104
- name = userInfo.given_name + ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.family_name) ? ` ${userInfo === null || userInfo === void 0 ? void 0 : userInfo.family_name}` : "");
117
+ name = userInfo.given_name + ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.family_name) ? ` ${userInfo === null || userInfo === void 0 ? void 0 : userInfo.family_name}` : '');
105
118
  }
106
119
  if (!name && userInfo && userInfo.email) {
107
120
  name = userInfo.email;
@@ -143,10 +156,11 @@ export class PnMarketwebSiteheaderLogin {
143
156
  hostElementAttribute.loggedin = this.loggedin + '';
144
157
  }
145
158
  return (h(Host, Object.assign({}, hostElementAttribute),
146
- h("pn-nav-dropdown", { label: this.toggleButtonText, icon: "user", class: "siteheader-logindialog" }, this.loggedin && this.showProfileSelection ?
147
- h("pn-marketweb-siteheader-login-profileselection", { loginDialog: this.loginDialog, loggedin: this.loggedin, i18n: this.i18n, idNamespace: this.emitEvents ? '1' : '2', endpoint: this.endpoint })
148
- :
149
- h("pn-marketweb-siteheader-login-links", { loginDialog: this.loginDialog, loggedin: this.loggedin, idNamespace: this.emitEvents ? '1' : '2', username: this.username }))));
159
+ h("pn-nav-dropdown", { label: this.toggleButtonText, icon: "user", class: "siteheader-logindialog" },
160
+ this.environment !== 'production' && !this.loggedin && h("pn-marketweb-siteheader-login-button", { label: /* this.i18n?.loginButtonText */ 'login check' }),
161
+ this.environment !== 'production' && this.loggedin && h("pn-marketweb-siteheader-login-mypage-button", { myPageUrl: "https://account.postnord.com/secure/profile" }),
162
+ this.loggedin && this.showProfileSelection ? (h("pn-marketweb-siteheader-login-profileselection", { loginDialog: this.loginDialog, loggedin: this.loggedin, i18n: this.i18n, idNamespace: this.emitEvents ? '1' : '2', endpoint: this.endpoint })) : (h("pn-marketweb-siteheader-login-links", { loginDialog: this.loginDialog, loggedin: this.loggedin, idNamespace: this.emitEvents ? '1' : '2', username: this.username })),
163
+ this.environment !== 'production' && h("p", null, "L\u00E4s mer om v\u00E5ra inloggade tj\u00E4nster och hur du anv\u00E4nder dem"))));
150
164
  }
151
165
  static get is() { return "pn-marketweb-siteheader-login"; }
152
166
  static get originalStyleUrls() { return {
@@ -172,7 +186,7 @@ export class PnMarketwebSiteheaderLogin {
172
186
  },
173
187
  "attribute": "endpoint",
174
188
  "reflect": false,
175
- "defaultValue": "\"\""
189
+ "defaultValue": "''"
176
190
  },
177
191
  "token": {
178
192
  "type": "string",
@@ -190,7 +204,7 @@ export class PnMarketwebSiteheaderLogin {
190
204
  },
191
205
  "attribute": "token",
192
206
  "reflect": false,
193
- "defaultValue": "\"\""
207
+ "defaultValue": "''"
194
208
  },
195
209
  "i18n": {
196
210
  "type": "unknown",
@@ -211,7 +225,7 @@ export class PnMarketwebSiteheaderLogin {
211
225
  "tags": [],
212
226
  "text": ""
213
227
  },
214
- "defaultValue": "{ \"searchlabel\":\"\", \"searchplaceholder\":\"\", \"searchbuttontext\":\"\", \"menuHomeButton\": \"\", \"menuGoBackButton\": \"\", \"mainMenuButton\": \"\", \"menuStartButton\": \"\", \"profileSelectionFlyoutHeading\": \"\" } as SiteHeaderI18N"
228
+ "defaultValue": "{\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n loginButtonText: '',\n loginPreamble: '',\n } as SiteHeaderI18N"
215
229
  },
216
230
  "siteUrl": {
217
231
  "type": "string",
@@ -286,7 +300,7 @@ export class PnMarketwebSiteheaderLogin {
286
300
  },
287
301
  "attribute": "fullname",
288
302
  "reflect": false,
289
- "defaultValue": "\"\""
303
+ "defaultValue": "''"
290
304
  },
291
305
  "loggedin": {
292
306
  "type": "boolean",
@@ -341,6 +355,23 @@ export class PnMarketwebSiteheaderLogin {
341
355
  "attribute": "check-user-logged-in-state-interval",
342
356
  "reflect": false,
343
357
  "defaultValue": "0"
358
+ },
359
+ "environment": {
360
+ "type": "string",
361
+ "mutable": false,
362
+ "complexType": {
363
+ "original": "string",
364
+ "resolved": "string",
365
+ "references": {}
366
+ },
367
+ "required": false,
368
+ "optional": true,
369
+ "docs": {
370
+ "tags": [],
371
+ "text": ""
372
+ },
373
+ "attribute": "environment",
374
+ "reflect": false
344
375
  }
345
376
  }; }
346
377
  static get states() { return {
@@ -87,6 +87,29 @@ pn-marketweb-siteheader .siteheader-row > pn-marketweb-siteheader-search {
87
87
  pn-marketweb-siteheader pn-spinner {
88
88
  display: none;
89
89
  }
90
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content {
91
+ max-width: 350px;
92
+ display: flex;
93
+ flex-direction: column;
94
+ gap: 2.4rem;
95
+ padding: 4rem;
96
+ }
97
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content pn-button {
98
+ width: 100%;
99
+ }
100
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content pn-marketweb-siteheader-login-links::before,
101
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content p::before {
102
+ display: block;
103
+ content: "";
104
+ height: 2px;
105
+ background: #F9F8F8;
106
+ width: 100%;
107
+ margin-bottom: 2.4rem;
108
+ }
109
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content p {
110
+ font-size: 1.4rem;
111
+ color: #005D92;
112
+ }
90
113
  pn-marketweb-siteheader pn-nav-dropdown:not(.hydrated) .nav-dropdown-content-container {
91
114
  display: none;
92
115
  }
@@ -360,6 +383,9 @@ header[data-header-theme=dotcom] > pn-marketweb-siteheader > header nav.mainnav
360
383
  background-color: #00A0D6;
361
384
  text-decoration: none;
362
385
  }
386
+ header[data-header-theme=dotcom] > pn-marketweb-siteheader > header nav.mainnav pn-marketweb-siteheader-login-linklist ul li a {
387
+ color: #005D92;
388
+ }
363
389
  header[data-header-theme=dotcom] > pn-marketweb-siteheader > header [data-level="1"] pn-mainnav-link pn-icon.first-level_arrow svg > path {
364
390
  fill: #FFFFFF;
365
391
  }
@@ -1,7 +1,7 @@
1
- import { Component, Element, Event, h, Host, Listen, Prop, State, Watch, } from '@stencil/core';
1
+ import { Component, Element, Event, h, Host, Listen, Prop, State, Watch } from '@stencil/core';
2
2
  import { FetchHelper } from '../../../globals/FetchHelper';
3
3
  import { MarketWebContextService } from '../../../globals/MarketWebContextService';
4
- import { state as headerState } from "./pn-marketweb-siteheader-store";
4
+ import { state as headerState } from './pn-marketweb-siteheader-store';
5
5
  import { translations } from './translations';
6
6
  export class PnMarketwebSiteheader {
7
7
  constructor() {
@@ -367,7 +367,7 @@ export class PnMarketwebSiteheader {
367
367
  })),
368
368
  h("div", { slot: "footer", class: "siteheader-menu-footer" },
369
369
  h("slot", { name: "menu-footer-cta" }),
370
- this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { emitEvents: false, siteUrl: this.siteDefinition.url, loginDialog: this.loginDialog, endpoint: this.endpoint, fullname: this.userFullname, loggedin: this.userLoggedin, i18n: this.i18n, showProfileSelection: this.showProfileSelection })),
370
+ this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { emitEvents: false, siteUrl: this.siteDefinition.url, loginDialog: this.loginDialog, endpoint: this.endpoint, fullname: this.userFullname, loggedin: this.userLoggedin, i18n: this.i18n, showProfileSelection: this.showProfileSelection, environment: this.environment })),
371
371
  this.gotData && this.languageOptions && this.languageOptions.length && !this.hideLanguageSelector && (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) }))))),
372
372
  !this.hideSiteSelector && (h("pn-site-selector", { language: this.language },
373
373
  this.gotData && ((_e = this.siteSelector) === null || _e === void 0 ? void 0 : _e.currentSiteTitle) && (h("pn-site-selector-item", { heading: this.siteSelector.currentSiteTitle, description: this.siteSelector.currentSiteDescription })),
@@ -380,7 +380,7 @@ const LoggedInTemplate = ({ ...args }) => {
380
380
  language="${args.language}"
381
381
  endpoint="${args.endpoint}"
382
382
  user-token="${args.token}"
383
- check-user-logged-in-state-interval="${args.checkUserLoggedInStateInterval+''}"
383
+ check-user-logged-in-state-interval="${args.checkUserLoggedInStateInterval + ''}"
384
384
  >
385
385
  </pn-marketweb-siteheader>
386
386
  </div>
@@ -477,7 +477,7 @@ DotComSiteHeader.args = {
477
477
  language: 'sv',
478
478
  endpoint: 'https://com-integration.postnord.com',
479
479
  name: 'DotCom User',
480
- loggedin: false,
480
+ loggedin: true,
481
481
  };
482
482
 
483
483
  const TPLSiteHeaderTemplate = ({ ...args }) => {
@@ -510,8 +510,8 @@ TPLSiteHeader.args = {
510
510
  hideHomeMenuItem: true,
511
511
  hideLanguageSelector: false,
512
512
  loggedin: false,
513
- buttonText: "Kontrolltornet",
514
- placeholder: "placeholder"
513
+ buttonText: 'Kontrolltornet',
514
+ placeholder: 'placeholder',
515
515
  };
516
516
 
517
517
  const ATLoginTestTemplate = ({ ...args }) => {
@@ -534,4 +534,3 @@ const ATLoginTestTemplate = ({ ...args }) => {
534
534
  </header>`;
535
535
  };
536
536
  export const ATLoginTest = ATLoginTestTemplate.bind({});
537
-
@@ -34,7 +34,7 @@ const weights = {
34
34
 
35
35
 
36
36
 
37
- const RiktigaValues =
37
+ const RealValues =
38
38
  {
39
39
  WebUrl: "https://riktigavykort.postnord.se/sv",
40
40
  AndroidAppUrl: "https://play.google.com/store/apps/details?id=se.posten.riktigavykort&hl=sv",
@@ -54,4 +54,4 @@ const stampShopUrl = "https://shop.postnord.se/ebutik/default.aspx";
54
54
  const productDescriptionUrl = "https://se-integration.postnord.com/skicka-forsandelser/brev-och-vykort/"
55
55
 
56
56
 
57
- export { weights, sizeCategories, fileLocation, sendDirectUrl, stampShopUrl, RiktigaValues };
57
+ export { weights, sizeCategories, fileLocation, sendDirectUrl, stampShopUrl, RealValues };
@@ -1,6 +1,6 @@
1
1
  import { Component, h, Prop, Host, Watch, State } from "@stencil/core";
2
2
  import { state } from "./pn-find-price-store";
3
- import { sendDirectUrl, stampShopUrl, RiktigaValues } from "./data.js";
3
+ import { sendDirectUrl, stampShopUrl, RealValues } from "./data.js";
4
4
  export class PnfindPriceResult {
5
5
  constructor() {
6
6
  this.item = null;
@@ -62,18 +62,18 @@ export class PnfindPriceResult {
62
62
  this.item.pricesenddirect ? (h("pn-product-card-price", { slot: "sendDirectPrice", label: state.i18n.senddirectcta, amount: this.item.pricesenddirect + '', currency: state.market.currency, url: sendDirectUrl, linkid: this.linkId + '-portal' })) : null,
63
63
  this.item.pricestamps ? ((this.item.name.toLocaleLowerCase() !== "riktiga vykort") ?
64
64
  (h("pn-product-card-price", { slot: "stampPrice", label: this.shopLabel, amount: this.item.pricestamps + '', currency: state.market.currency, url: this.shopUrl, linkid: this.linkId + this.shopId })) :
65
- (h("pn-product-card-price", { slot: "riktiga", label: state.i18n.riktigaVykort, amount: this.item.pricestamps + '', currency: state.market.currency, url: RiktigaValues["WebUrl"], linkid: this.linkId + '-riktiga' }))) : null),
65
+ (h("pn-product-card-price", { slot: "riktiga", label: state.i18n.realPostcard, amount: this.item.pricestamps + '', currency: state.market.currency, url: RealValues["WebUrl"], linkid: this.linkId + '-riktiga' }))) : null),
66
66
  h("div", { slot: "servicepoint" }, (this.item.showservicepointlink) ? (h("a", { href: state.market.servicePoint, target: "_blank" },
67
67
  h("pn-icon", { symbol: "map-marker", color: "blue700" }),
68
68
  state.i18n.servicePointLink)) : null),
69
69
  h("div", { slot: "mobiledownload" }, (this.item.name.toLocaleLowerCase() === "riktiga vykort") ?
70
70
  (h("div", { id: "riktiga" },
71
- h("h4", null, state.i18n.riktigaVykortMobile),
71
+ h("h4", null, state.i18n.realPostcardMobile),
72
72
  h("div", null,
73
- h("a", { href: RiktigaValues["AndroidAppUrl"], target: "_blank" },
74
- h("img", { class: "riktigaAndroidImg", src: RiktigaValues["AndroidImg"] })),
75
- h("a", { href: RiktigaValues["IosAppUrl"], target: "_blank" },
76
- h("img", { class: "riktigaAppleImg", src: RiktigaValues["IosImg"] }))))) : null))));
73
+ h("a", { href: RealValues["AndroidAppUrl"], target: "_blank" },
74
+ h("img", { class: "riktigaAndroidImg", src: RealValues["AndroidImg"] })),
75
+ h("a", { href: RealValues["IosAppUrl"], target: "_blank" },
76
+ h("img", { class: "riktigaAppleImg", src: RealValues["IosImg"] }))))) : null))));
77
77
  }
78
78
  static get is() { return "pn-find-price-result"; }
79
79
  static get originalStyleUrls() { return {
@@ -15,8 +15,8 @@ const { state, onChange } = createStore({
15
15
  message: '',
16
16
  servicePointHeader: '',
17
17
  servicePointLink: '',
18
- riktigaVykort: '',
19
- riktigaVykortMobile: '',
18
+ realPostcard: '',
19
+ realPostcardMobile: '',
20
20
  ombudHeader: ''
21
21
  },
22
22
  market: {
@@ -13,8 +13,8 @@ export const translations = {
13
13
  'message': '*Vid köp hos valfritt ombud',
14
14
  'servicePointHeader': 'Eller hitta närmaste serviceställe',
15
15
  'servicePointLink': 'Hitta Serviceställe',
16
- 'riktigaVykort': 'Köp Riktiga Vykort',
17
- 'riktigaVykortMobile': 'Ladda ner appen',
16
+ 'realPostcard': 'Köp Riktiga Vykort',
17
+ 'realPostcardMobile': 'Ladda ner appen',
18
18
  'ombudHeader': 'Köp via ombud'
19
19
  },
20
20
  'en': {
@@ -31,8 +31,8 @@ export const translations = {
31
31
  'message': 'When buying from any agent',
32
32
  'servicePointHeader': 'Find service point',
33
33
  'servicePointLink': 'Find service point',
34
- 'riktigaVykort': 'Buy Postcards',
35
- 'riktigaVykortMobile': 'Download the app',
34
+ 'realPostcard': 'Buy Postcards',
35
+ 'realPostcardMobile': 'Download the app',
36
36
  'ombudHeader': 'Purchase by agent'
37
37
  },
38
38
  'da': {
@@ -49,7 +49,7 @@ export const translations = {
49
49
  'message': 'When buying from any agent',
50
50
  'servicePointHeader': 'Find nærmeste servicested',
51
51
  'servicePointLink': 'Find nærmeste servicested',
52
- 'riktigaVykort': 'Køb Riktiga Vykort',
52
+ 'realPostcard': 'Køb Riktiga Vykort',
53
53
  'ombudHeader': 'Køb af agent'
54
54
  },
55
55
  'no': {