@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.
Files changed (121) hide show
  1. package/cjs/loader.cjs.js +1 -1
  2. package/cjs/pn-customernumber-selector-option.cjs.entry.js +2 -2
  3. package/cjs/pn-customernumber-selector.cjs.entry.js +3 -3
  4. package/cjs/pn-find-price-result.cjs.entry.js +5 -5
  5. package/cjs/{pn-find-price-store-a2728ff4.js → pn-find-price-store-0b8c195c.js} +2 -0
  6. package/cjs/pn-find-price.cjs.entry.js +17 -9
  7. package/cjs/pn-language-selector_9.cjs.entry.js +51 -59
  8. package/cjs/pn-market-web-components.cjs.js +1 -1
  9. package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js +72 -0
  10. package/cjs/pn-marketweb-siteheader-login-links_2.cjs.entry.js +186 -0
  11. package/cjs/pn-marketweb-siteheader.cjs.entry.js +26 -7
  12. package/cjs/pn-product-pricelist.cjs.entry.js +1 -1
  13. package/cjs/pn-profile-selector-option.cjs.entry.js +2 -2
  14. package/collection/collection-manifest.json +3 -1
  15. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.css +22 -0
  16. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js +149 -0
  17. package/collection/components/layout-components/pn-marketweb-siteheader/{pn-marketweb-siteheader-profileselection.css → pn-marketweb-siteheader-login-links.css} +0 -0
  18. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.js +199 -0
  19. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.css +93 -0
  20. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js +269 -0
  21. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.css +0 -17
  22. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js +79 -72
  23. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +24 -2
  24. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +69 -2
  25. package/collection/components/layout-components/pn-marketweb-siteheader/translations.js +20 -5
  26. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector-option.js +4 -4
  27. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector.js +7 -7
  28. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector.stories.js +3 -3
  29. package/collection/components/profile/pn-profile-selector/pn-profile-selector-option.js +4 -4
  30. package/collection/components/widgets/pn-find-price/pn-find-price-result.js +4 -4
  31. package/collection/components/widgets/pn-find-price/pn-find-price-store.js +2 -0
  32. package/collection/components/widgets/pn-find-price/pn-find-price-translations.js +6 -0
  33. package/collection/components/widgets/pn-find-price/pn-find-price.css +6 -3
  34. package/collection/components/widgets/pn-find-price/pn-find-price.js +9 -5
  35. package/custom-elements/index.d.ts +16 -4
  36. package/custom-elements/index.js +303 -186
  37. package/esm/loader.js +1 -1
  38. package/esm/pn-customernumber-selector-option.entry.js +2 -2
  39. package/esm/pn-customernumber-selector.entry.js +3 -3
  40. package/esm/pn-find-price-result.entry.js +5 -5
  41. package/esm/{pn-find-price-store-f531ab7e.js → pn-find-price-store-b4556c9b.js} +2 -0
  42. package/esm/pn-find-price.entry.js +17 -9
  43. package/esm/pn-language-selector_9.entry.js +51 -59
  44. package/esm/pn-market-web-components.js +1 -1
  45. package/esm/pn-marketweb-siteheader-login-linklist.entry.js +68 -0
  46. package/esm/pn-marketweb-siteheader-login-links_2.entry.js +181 -0
  47. package/esm/pn-marketweb-siteheader.entry.js +26 -7
  48. package/esm/pn-product-pricelist.entry.js +1 -1
  49. package/esm/pn-profile-selector-option.entry.js +2 -2
  50. package/esm-es5/loader.js +1 -1
  51. package/esm-es5/pn-customernumber-selector-option.entry.js +1 -1
  52. package/esm-es5/pn-customernumber-selector.entry.js +1 -1
  53. package/esm-es5/pn-find-price-result.entry.js +1 -1
  54. package/esm-es5/pn-find-price-store-b4556c9b.js +1 -0
  55. package/esm-es5/pn-find-price.entry.js +1 -1
  56. package/esm-es5/pn-language-selector_9.entry.js +1 -1
  57. package/esm-es5/pn-market-web-components.js +1 -1
  58. package/esm-es5/pn-marketweb-siteheader-login-linklist.entry.js +1 -0
  59. package/esm-es5/pn-marketweb-siteheader-login-links_2.entry.js +1 -0
  60. package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
  61. package/esm-es5/pn-product-pricelist.entry.js +1 -1
  62. package/esm-es5/pn-profile-selector-option.entry.js +1 -1
  63. package/package.json +1 -1
  64. package/pn-market-web-components/p-04240175.entry.js +1 -0
  65. package/pn-market-web-components/p-08411f5e.entry.js +1 -0
  66. package/pn-market-web-components/p-0d5d05cc.system.entry.js +1 -0
  67. package/pn-market-web-components/{p-77887623.system.entry.js → p-1924152a.system.entry.js} +1 -1
  68. package/pn-market-web-components/p-1f2d9304.entry.js +1 -0
  69. package/pn-market-web-components/p-37017f68.system.js +1 -0
  70. package/pn-market-web-components/p-4791c81b.entry.js +1 -0
  71. package/pn-market-web-components/p-67887512.system.js +1 -1
  72. package/pn-market-web-components/p-845d6b0a.entry.js +1 -0
  73. package/pn-market-web-components/{p-2a7e6d3a.system.entry.js → p-93cecc43.system.entry.js} +1 -1
  74. package/pn-market-web-components/p-a7bb94a0.entry.js +1 -0
  75. package/pn-market-web-components/{p-1f5b2d7a.entry.js → p-b32a8507.entry.js} +1 -1
  76. package/pn-market-web-components/p-ba41a7c0.system.entry.js +1 -0
  77. package/pn-market-web-components/p-c4254e9e.js +1 -0
  78. package/pn-market-web-components/p-c5a97974.entry.js +1 -0
  79. package/pn-market-web-components/{p-7f5bee11.entry.js → p-dc1827a6.entry.js} +1 -1
  80. package/pn-market-web-components/p-e32dc098.entry.js +1 -0
  81. package/pn-market-web-components/p-e66a8bb8.system.entry.js +1 -0
  82. package/pn-market-web-components/{p-ddbd131f.system.entry.js → p-e6fa11ad.system.entry.js} +1 -1
  83. package/pn-market-web-components/p-ec96434c.system.entry.js +1 -0
  84. package/pn-market-web-components/p-f4630c00.system.entry.js +1 -0
  85. package/pn-market-web-components/{p-e23a18f4.system.entry.js → p-f7d1c0a0.system.entry.js} +1 -1
  86. package/pn-market-web-components/{p-c1c79c65.system.entry.js → p-fecc53bb.system.entry.js} +1 -1
  87. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  88. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.d.ts +13 -0
  89. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.d.ts +14 -0
  90. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.d.ts +20 -0
  91. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.d.ts +6 -4
  92. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-types.d.ts +21 -0
  93. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.d.ts +4 -2
  94. package/types/components/layout-components/pn-marketweb-siteheader/translations.d.ts +15 -0
  95. package/types/components/profile/pn-customernumber-selector/pn-customernumber-selector-option.d.ts +1 -1
  96. package/types/components/profile/pn-customernumber-selector/pn-customernumber-selector.d.ts +1 -1
  97. package/types/components/profile/pn-profile-selector/pn-profile-selector-option.d.ts +1 -1
  98. package/types/components/widgets/pn-find-price/pn-find-price-store.d.ts +4 -0
  99. package/types/components/widgets/pn-find-price/pn-find-price-translations.d.ts +6 -0
  100. package/types/components/widgets/pn-find-price/pn-find-price-types.d.ts +3 -1
  101. package/types/components.d.ts +89 -45
  102. package/umd/pn-marketweb-salesforce.js +1 -1
  103. package/cjs/pn-marketweb-siteheader-profileselection.cjs.entry.js +0 -161
  104. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-profileselection.js +0 -319
  105. package/esm/pn-marketweb-siteheader-profileselection.entry.js +0 -157
  106. package/esm-es5/pn-find-price-store-f531ab7e.js +0 -1
  107. package/esm-es5/pn-marketweb-siteheader-profileselection.entry.js +0 -1
  108. package/pn-market-web-components/p-39c42017.entry.js +0 -1
  109. package/pn-market-web-components/p-3a4b70d1.system.entry.js +0 -1
  110. package/pn-market-web-components/p-4cea6bf3.system.entry.js +0 -1
  111. package/pn-market-web-components/p-63a2ba1c.entry.js +0 -1
  112. package/pn-market-web-components/p-7e294268.entry.js +0 -1
  113. package/pn-market-web-components/p-893206f2.js +0 -1
  114. package/pn-market-web-components/p-a702dcfd.system.entry.js +0 -1
  115. package/pn-market-web-components/p-a94593a9.system.entry.js +0 -1
  116. package/pn-market-web-components/p-ac8285b4.entry.js +0 -1
  117. package/pn-market-web-components/p-b0053a2d.entry.js +0 -1
  118. package/pn-market-web-components/p-c2670af1.system.js +0 -1
  119. package/pn-market-web-components/p-ea39d576.entry.js +0 -1
  120. package/pn-market-web-components/p-fcea21cb.entry.js +0 -1
  121. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-profileselection.d.ts +0 -28
@@ -3,6 +3,8 @@ export declare const translations: {
3
3
  componentheading: string;
4
4
  deliveryscopeheading: string;
5
5
  resultlistheading: string;
6
+ sizeheading: string;
7
+ weightheading: string;
6
8
  weightlabel: string;
7
9
  maxweightlabel: string;
8
10
  maxmeasurementlabel: string;
@@ -19,6 +21,8 @@ export declare const translations: {
19
21
  componentheading: string;
20
22
  deliveryscopeheading: string;
21
23
  resultlistheading: string;
24
+ sizeheading: string;
25
+ weightheading: string;
22
26
  weightlabel: string;
23
27
  maxweightlabel: string;
24
28
  maxmeasurementlabel: string;
@@ -35,6 +39,8 @@ export declare const translations: {
35
39
  componentheading: string;
36
40
  deliveryscopeheading: string;
37
41
  resultlistheading: string;
42
+ sizeheading: string;
43
+ weightheading: string;
38
44
  weightlabel: string;
39
45
  maxweightlabel: string;
40
46
  maxmeasurementlabel: string;
@@ -14,6 +14,8 @@ export interface PnfindPricei18n {
14
14
  componentheading: string;
15
15
  deliveryscopeheading: string;
16
16
  resultlistheading: string;
17
+ sizeheading: string;
18
+ weightheading: string;
17
19
  weightlabel: string;
18
20
  maxweightlabel: string;
19
21
  maxmeasurementlabel: string;
@@ -55,5 +57,5 @@ export interface ProductPriceItem {
55
57
  illustration?: string;
56
58
  showservicepointlink?: string;
57
59
  infopagelink?: string;
58
- availableonline?: string;
60
+ ombudpurchase?: string;
59
61
  }
@@ -7,7 +7,8 @@
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { ProductPriceItem } from "./components/widgets/pn-find-price/pn-find-price-types";
9
9
  import { ProductPriceItem as ProductPriceItem1 } from "./globals/shared/productprice/product-price-types";
10
- import { LoginDialog, SiteHeaderSearch } from "./components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-types";
10
+ import { LoginDialog, LoginDialogLink, ProfileSelectorCustomer, ProfileSelectorDialog, SiteHeaderI18N, SiteHeaderSearch } from "./components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-types";
11
+ import { MarketWebLoginManager } from "./globals/MarketWebLoginManager";
11
12
  export namespace Components {
12
13
  interface PnBonusProgressbar {
13
14
  "bonuspercentage": string;
@@ -45,13 +46,13 @@ export namespace Components {
45
46
  }
46
47
  interface PnCustomernumberSelector {
47
48
  "description": string;
49
+ "heading": string;
48
50
  "language": string;
49
51
  "open": boolean;
50
- "title": string;
51
52
  }
52
53
  interface PnCustomernumberSelectorOption {
53
54
  "description": string;
54
- "title": string;
55
+ "heading": string;
55
56
  "url": string;
56
57
  }
57
58
  interface PnFilterCheckbox {
@@ -279,6 +280,10 @@ export namespace Components {
279
280
  * Forward session to backend
280
281
  */
281
282
  "sessionForward": boolean;
283
+ /**
284
+ * If this is selected we will show the new profile selection dropdown instead of the login version
285
+ */
286
+ "showProfileSelection": boolean;
282
287
  /**
283
288
  * Event based only language switch
284
289
  */
@@ -306,31 +311,40 @@ export namespace Components {
306
311
  * User Fullname
307
312
  */
308
313
  "fullname": string;
309
- "i18n": any;
314
+ "i18n": SiteHeaderI18N;
310
315
  "loggedin": boolean;
311
316
  "loginDialog": LoginDialog;
317
+ /**
318
+ * If this is selected we will show the new profile selection dropdown instead of the login version
319
+ */
320
+ "showProfileSelection": boolean;
312
321
  /**
313
322
  * Access token passed from backend
314
323
  */
315
324
  "token": string;
316
325
  }
317
- interface PnMarketwebSiteheaderProfileselection {
318
- "emitEvents": boolean;
319
- /**
320
- * Specifies which endpoint domain we should load from
321
- */
326
+ interface PnMarketwebSiteheaderLoginLinklist {
327
+ "heading": string;
328
+ "idNamespace": string;
329
+ "links": LoginDialogLink[];
330
+ "loginManager": MarketWebLoginManager;
331
+ }
332
+ interface PnMarketwebSiteheaderLoginLinks {
333
+ "idNamespace": string;
334
+ "loggedin": boolean;
335
+ "loginDialog": LoginDialog;
336
+ "loginManager": MarketWebLoginManager;
337
+ "username": string;
338
+ }
339
+ interface PnMarketwebSiteheaderLoginProfileselection {
322
340
  "endpoint": string;
323
- /**
324
- * User Fullname
325
- */
326
- "fullname": string;
327
- "i18n": any;
341
+ "heading": string;
342
+ "i18n": SiteHeaderI18N;
343
+ "idNamespace": string;
328
344
  "loggedin": boolean;
329
345
  "loginDialog": LoginDialog;
330
- /**
331
- * Access token passed from backend
332
- */
333
- "token": string;
346
+ "loginManager": MarketWebLoginManager;
347
+ "profileSelectorDialog": ProfileSelectorDialog;
334
348
  }
335
349
  interface PnMarketwebSiteheaderSearch {
336
350
  "hideSearch": boolean;
@@ -406,7 +420,7 @@ export namespace Components {
406
420
  }
407
421
  interface PnProfileSelectorOption {
408
422
  "description": string;
409
- "title": string;
423
+ "heading": string;
410
424
  "url": string;
411
425
  }
412
426
  interface PnSidenav {
@@ -608,11 +622,23 @@ declare global {
608
622
  prototype: HTMLPnMarketwebSiteheaderLoginElement;
609
623
  new (): HTMLPnMarketwebSiteheaderLoginElement;
610
624
  };
611
- interface HTMLPnMarketwebSiteheaderProfileselectionElement extends Components.PnMarketwebSiteheaderProfileselection, HTMLStencilElement {
625
+ interface HTMLPnMarketwebSiteheaderLoginLinklistElement extends Components.PnMarketwebSiteheaderLoginLinklist, HTMLStencilElement {
612
626
  }
613
- var HTMLPnMarketwebSiteheaderProfileselectionElement: {
614
- prototype: HTMLPnMarketwebSiteheaderProfileselectionElement;
615
- new (): HTMLPnMarketwebSiteheaderProfileselectionElement;
627
+ var HTMLPnMarketwebSiteheaderLoginLinklistElement: {
628
+ prototype: HTMLPnMarketwebSiteheaderLoginLinklistElement;
629
+ new (): HTMLPnMarketwebSiteheaderLoginLinklistElement;
630
+ };
631
+ interface HTMLPnMarketwebSiteheaderLoginLinksElement extends Components.PnMarketwebSiteheaderLoginLinks, HTMLStencilElement {
632
+ }
633
+ var HTMLPnMarketwebSiteheaderLoginLinksElement: {
634
+ prototype: HTMLPnMarketwebSiteheaderLoginLinksElement;
635
+ new (): HTMLPnMarketwebSiteheaderLoginLinksElement;
636
+ };
637
+ interface HTMLPnMarketwebSiteheaderLoginProfileselectionElement extends Components.PnMarketwebSiteheaderLoginProfileselection, HTMLStencilElement {
638
+ }
639
+ var HTMLPnMarketwebSiteheaderLoginProfileselectionElement: {
640
+ prototype: HTMLPnMarketwebSiteheaderLoginProfileselectionElement;
641
+ new (): HTMLPnMarketwebSiteheaderLoginProfileselectionElement;
616
642
  };
617
643
  interface HTMLPnMarketwebSiteheaderSearchElement extends Components.PnMarketwebSiteheaderSearch, HTMLStencilElement {
618
644
  }
@@ -756,7 +782,9 @@ declare global {
756
782
  "pn-marketweb-sitefooter": HTMLPnMarketwebSitefooterElement;
757
783
  "pn-marketweb-siteheader": HTMLPnMarketwebSiteheaderElement;
758
784
  "pn-marketweb-siteheader-login": HTMLPnMarketwebSiteheaderLoginElement;
759
- "pn-marketweb-siteheader-profileselection": HTMLPnMarketwebSiteheaderProfileselectionElement;
785
+ "pn-marketweb-siteheader-login-linklist": HTMLPnMarketwebSiteheaderLoginLinklistElement;
786
+ "pn-marketweb-siteheader-login-links": HTMLPnMarketwebSiteheaderLoginLinksElement;
787
+ "pn-marketweb-siteheader-login-profileselection": HTMLPnMarketwebSiteheaderLoginProfileselectionElement;
760
788
  "pn-marketweb-siteheader-search": HTMLPnMarketwebSiteheaderSearchElement;
761
789
  "pn-pex-pricefinder": HTMLPnPexPricefinderElement;
762
790
  "pn-product-card": HTMLPnProductCardElement;
@@ -816,13 +844,13 @@ declare namespace LocalJSX {
816
844
  }
817
845
  interface PnCustomernumberSelector {
818
846
  "description"?: string;
847
+ "heading"?: string;
819
848
  "language"?: string;
820
849
  "open"?: boolean;
821
- "title"?: string;
822
850
  }
823
851
  interface PnCustomernumberSelectorOption {
824
852
  "description"?: string;
825
- "title"?: string;
853
+ "heading"?: string;
826
854
  "url"?: string;
827
855
  }
828
856
  interface PnFilterCheckbox {
@@ -1065,6 +1093,10 @@ declare namespace LocalJSX {
1065
1093
  * Forward session to backend
1066
1094
  */
1067
1095
  "sessionForward"?: boolean;
1096
+ /**
1097
+ * If this is selected we will show the new profile selection dropdown instead of the login version
1098
+ */
1099
+ "showProfileSelection"?: boolean;
1068
1100
  /**
1069
1101
  * Event based only language switch
1070
1102
  */
@@ -1092,33 +1124,41 @@ declare namespace LocalJSX {
1092
1124
  * User Fullname
1093
1125
  */
1094
1126
  "fullname"?: string;
1095
- "i18n"?: any;
1127
+ "i18n"?: SiteHeaderI18N;
1096
1128
  "loggedin"?: boolean;
1097
1129
  "loginDialog"?: LoginDialog;
1098
1130
  "onLoginStateChange"?: (event: CustomEvent<any>) => void;
1131
+ /**
1132
+ * If this is selected we will show the new profile selection dropdown instead of the login version
1133
+ */
1134
+ "showProfileSelection"?: boolean;
1099
1135
  /**
1100
1136
  * Access token passed from backend
1101
1137
  */
1102
1138
  "token"?: string;
1103
1139
  }
1104
- interface PnMarketwebSiteheaderProfileselection {
1105
- "emitEvents"?: boolean;
1106
- /**
1107
- * Specifies which endpoint domain we should load from
1108
- */
1140
+ interface PnMarketwebSiteheaderLoginLinklist {
1141
+ "heading"?: string;
1142
+ "idNamespace"?: string;
1143
+ "links"?: LoginDialogLink[];
1144
+ "loginManager"?: MarketWebLoginManager;
1145
+ }
1146
+ interface PnMarketwebSiteheaderLoginLinks {
1147
+ "idNamespace"?: string;
1148
+ "loggedin"?: boolean;
1149
+ "loginDialog"?: LoginDialog;
1150
+ "loginManager"?: MarketWebLoginManager;
1151
+ "username"?: string;
1152
+ }
1153
+ interface PnMarketwebSiteheaderLoginProfileselection {
1109
1154
  "endpoint"?: string;
1110
- /**
1111
- * User Fullname
1112
- */
1113
- "fullname"?: string;
1114
- "i18n"?: any;
1155
+ "heading"?: string;
1156
+ "i18n"?: SiteHeaderI18N;
1157
+ "idNamespace"?: string;
1115
1158
  "loggedin"?: boolean;
1116
1159
  "loginDialog"?: LoginDialog;
1117
- "onLoginStateChange"?: (event: CustomEvent<any>) => void;
1118
- /**
1119
- * Access token passed from backend
1120
- */
1121
- "token"?: string;
1160
+ "loginManager"?: MarketWebLoginManager;
1161
+ "profileSelectorDialog"?: ProfileSelectorDialog;
1122
1162
  }
1123
1163
  interface PnMarketwebSiteheaderSearch {
1124
1164
  "hideSearch"?: boolean;
@@ -1194,7 +1234,7 @@ declare namespace LocalJSX {
1194
1234
  }
1195
1235
  interface PnProfileSelectorOption {
1196
1236
  "description"?: string;
1197
- "title"?: string;
1237
+ "heading"?: string;
1198
1238
  "url"?: string;
1199
1239
  }
1200
1240
  interface PnSidenav {
@@ -1290,7 +1330,9 @@ declare namespace LocalJSX {
1290
1330
  "pn-marketweb-sitefooter": PnMarketwebSitefooter;
1291
1331
  "pn-marketweb-siteheader": PnMarketwebSiteheader;
1292
1332
  "pn-marketweb-siteheader-login": PnMarketwebSiteheaderLogin;
1293
- "pn-marketweb-siteheader-profileselection": PnMarketwebSiteheaderProfileselection;
1333
+ "pn-marketweb-siteheader-login-linklist": PnMarketwebSiteheaderLoginLinklist;
1334
+ "pn-marketweb-siteheader-login-links": PnMarketwebSiteheaderLoginLinks;
1335
+ "pn-marketweb-siteheader-login-profileselection": PnMarketwebSiteheaderLoginProfileselection;
1294
1336
  "pn-marketweb-siteheader-search": PnMarketwebSiteheaderSearch;
1295
1337
  "pn-pex-pricefinder": PnPexPricefinder;
1296
1338
  "pn-product-card": PnProductCard;
@@ -1338,7 +1380,9 @@ declare module "@stencil/core" {
1338
1380
  "pn-marketweb-sitefooter": LocalJSX.PnMarketwebSitefooter & JSXBase.HTMLAttributes<HTMLPnMarketwebSitefooterElement>;
1339
1381
  "pn-marketweb-siteheader": LocalJSX.PnMarketwebSiteheader & JSXBase.HTMLAttributes<HTMLPnMarketwebSiteheaderElement>;
1340
1382
  "pn-marketweb-siteheader-login": LocalJSX.PnMarketwebSiteheaderLogin & JSXBase.HTMLAttributes<HTMLPnMarketwebSiteheaderLoginElement>;
1341
- "pn-marketweb-siteheader-profileselection": LocalJSX.PnMarketwebSiteheaderProfileselection & JSXBase.HTMLAttributes<HTMLPnMarketwebSiteheaderProfileselectionElement>;
1383
+ "pn-marketweb-siteheader-login-linklist": LocalJSX.PnMarketwebSiteheaderLoginLinklist & JSXBase.HTMLAttributes<HTMLPnMarketwebSiteheaderLoginLinklistElement>;
1384
+ "pn-marketweb-siteheader-login-links": LocalJSX.PnMarketwebSiteheaderLoginLinks & JSXBase.HTMLAttributes<HTMLPnMarketwebSiteheaderLoginLinksElement>;
1385
+ "pn-marketweb-siteheader-login-profileselection": LocalJSX.PnMarketwebSiteheaderLoginProfileselection & JSXBase.HTMLAttributes<HTMLPnMarketwebSiteheaderLoginProfileselectionElement>;
1342
1386
  "pn-marketweb-siteheader-search": LocalJSX.PnMarketwebSiteheaderSearch & JSXBase.HTMLAttributes<HTMLPnMarketwebSiteheaderSearchElement>;
1343
1387
  "pn-pex-pricefinder": LocalJSX.PnPexPricefinder & JSXBase.HTMLAttributes<HTMLPnPexPricefinderElement>;
1344
1388
  "pn-product-card": LocalJSX.PnProductCard & JSXBase.HTMLAttributes<HTMLPnProductCardElement>;
@@ -18,7 +18,7 @@
18
18
 
19
19
  const s = document.createElement('script');
20
20
  s.setAttribute("type", "module");
21
- s.setAttribute("src", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.23-beta4/umd/standalone-loader-salesforce.js");
21
+ s.setAttribute("src", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.24/umd/standalone-loader-salesforce.js");
22
22
  document.querySelector("head").appendChild(s);
23
23
 
24
24
 
@@ -1,161 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-e3e27c79.js');
6
- const MarketWebLoginManager = require('./MarketWebLoginManager-865226ea.js');
7
-
8
- const pnMarketwebSiteheaderProfileselectionCss = "";
9
-
10
- let PnMarketwebSiteheaderProfileSelection = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.loginStateChange = index.createEvent(this, "loginStateChange", 7);
14
- /** Specifies which endpoint domain we should load from */
15
- this.endpoint = "";
16
- /** Access token passed from backend */
17
- this.token = "";
18
- this.emitEvents = true;
19
- // Login dialog
20
- this.loginDialog = null;
21
- /** User Fullname */
22
- this.fullname = "";
23
- this.loggedin = false;
24
- this.loginManager = null;
25
- this.toggleButtonText = "";
26
- this.username = this.fullname;
27
- }
28
- componentWillLoad() {
29
- const userInfo = this.loggedin && this.fullname ? { given_name: this.fullname } : null;
30
- this.loginManager = new MarketWebLoginManager.MarketWebLoginManager({ endpoint: this.endpoint, eventTarget: this.hostElement, userInfo });
31
- this.hostElement["loginmanager"] = this.loginManager;
32
- if (this.token) {
33
- this.loginManager.registerToken(this.token, 'backend');
34
- }
35
- else if (this.emitEvents) { // The primary login instance
36
- this.loginManager.invalidateTokenOfType('backend');
37
- }
38
- this.hostElement.addEventListener(this.loginManager.events.loginstatechange, this.onLoginStateChange.bind(this));
39
- this.init();
40
- this.setUserName();
41
- this.setToggleButtonText();
42
- }
43
- async init() {
44
- this.toggleButtonText = this.loginDialog.loginMenuLinkText;
45
- this.loginManager.init(this.emitEvents);
46
- this.setToggleButtonText();
47
- }
48
- setUserName() {
49
- const userInfo = this.loginManager.getUserInfo();
50
- let name = "";
51
- if (!this.loggedin || !userInfo) {
52
- this.username = name;
53
- }
54
- if (userInfo && userInfo.given_name) {
55
- name = userInfo.given_name + ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.family_name) ? ` ${userInfo === null || userInfo === void 0 ? void 0 : userInfo.family_name}` : "");
56
- }
57
- if (!name && userInfo && userInfo.email) {
58
- name = userInfo.email;
59
- }
60
- if (!name && this.fullname) {
61
- name = this.fullname;
62
- }
63
- this.username = name;
64
- }
65
- setToggleButtonText() {
66
- if (this.loggedin) {
67
- this.toggleButtonText = this.username;
68
- if (!this.toggleButtonText) {
69
- this.toggleButtonText = this.loginDialog.loggedInButtonText;
70
- }
71
- }
72
- else {
73
- this.toggleButtonText = this.loginDialog.loginMenuLinkText;
74
- }
75
- }
76
- onLoginStateChange(e) {
77
- if (this.loggedin !== e.detail && this.emitEvents) {
78
- this.loggedin = e.detail;
79
- this.loginStateChange.emit({ loggedIn: this.loggedin, token: this.loginManager.getToken() });
80
- this.setUserName();
81
- this.setToggleButtonText();
82
- }
83
- }
84
- uniqueId(text) {
85
- return "loginlink-" + text.replace(/[^A-Za-z0-9.\\\/]/igm, "") + "-" + (this.emitEvents ? "1" : "2");
86
- }
87
- linkAppearanceAttributes(link) {
88
- let attributes = {};
89
- if (link.linkType) {
90
- switch (link.linkType) {
91
- case 'primary':
92
- attributes = {
93
- appearance: '',
94
- variant: ''
95
- };
96
- break;
97
- case 'secondary':
98
- attributes = {
99
- appearance: 'light',
100
- variant: 'outlined'
101
- };
102
- break;
103
- case 'regularlink':
104
- default:
105
- attributes = {
106
- appearance: 'light',
107
- variant: 'borderless',
108
- icon: 'arrow-right'
109
- };
110
- break;
111
- }
112
- return attributes;
113
- }
114
- if (!link.linkType) {
115
- attributes = {
116
- appearance: link.primaryLinkApperance ? "dark" : "light"
117
- };
118
- }
119
- return attributes;
120
- }
121
- render() {
122
- var _a, _b, _c;
123
- if (!this.loginDialog) {
124
- return;
125
- }
126
- let hostElementAttribute = {
127
- username: null
128
- };
129
- if (this.username) {
130
- hostElementAttribute.username = this.username;
131
- }
132
- return (index.h(index.Host, Object.assign({}, hostElementAttribute), index.h("pn-nav-dropdown", { label: this.toggleButtonText, icon: "user", class: "siteheader-logindialog" }, (!this.loginDialog.overrideLoginMenu) ?
133
- index.h("div", { "data-loggedin": this.loggedin + '' }, (!this.loggedin) ?
134
- index.h("div", null, (_a = this.loginDialog.loginTitle) !== null && _a !== void 0 ? _a : index.h("strong", null, this.loginDialog.loginTitle), ((_b = this.loginDialog.loginMenuLinks) === null || _b === void 0 ? void 0 : _b.length) > 0 ?
135
- index.h("ul", null, this.loginDialog.loginMenuLinks.map((link, i) => {
136
- const href = (i === 0 && !link.href) ? this.loginManager.getLoginUrl() : link.href;
137
- return (index.h("li", null, index.h("pn-button", Object.assign({ href: href, id: this.uniqueId(link.linkText) }, this.linkAppearanceAttributes(link), (link.openInNewWindow && { target: '_blank' })), link.linkText)));
138
- }))
139
- : (index.h("ul", null, index.h("li", null, index.h("pn-button", { href: this.loginManager.getLoginUrl(this.loginDialog.loginUrl), target: "_top" }, this.loginDialog.loginLinkText)), index.h("li", null, index.h("pn-button", { href: this.loginDialog.registerUrl, target: "_top", appearance: "light", variant: "outlined" }, this.loginDialog.createLoginLinkText)))))
140
- :
141
- index.h("div", null, index.h("ul", null, this.loginDialog.loggedInLinks.map((link) => {
142
- const isLogoutLink = link.href.indexOf('logout') !== -1;
143
- const href = (isLogoutLink) ? this.loginManager.getLogoutUrl(link.href.replace('logout', '').replace('http://window.location.href/?', '').replace('https://window.location.href/?', '')) : link.href;
144
- return (index.h("li", null, index.h("pn-button", Object.assign({ href: href, id: this.uniqueId(link.linkText) }, (link.openInNewWindow && { target: '_blank' }), this.linkAppearanceAttributes(link), { onClick: () => {
145
- if (isLogoutLink) {
146
- this.loginManager.clearUserData();
147
- }
148
- } }), link.linkText)));
149
- }))))
150
- :
151
- index.h("div", null, index.h("ul", null, (_c = this.loginDialog.loginMenuLinks) === null || _c === void 0 ? void 0 : _c.map(link => index.h("li", null, index.h("a", { href: link.href, target: link.openInNewWindow ? "_blank" : "_self", class: "btn btn-link" }, link.linkText))))))));
152
- }
153
- get hostElement() { return index.getElement(this); }
154
- static get watchers() { return {
155
- "i18n": ["init"],
156
- "loginDialog": ["init"]
157
- }; }
158
- };
159
- PnMarketwebSiteheaderProfileSelection.style = pnMarketwebSiteheaderProfileselectionCss;
160
-
161
- exports.pn_marketweb_siteheader_profileselection = PnMarketwebSiteheaderProfileSelection;