@postnord/pn-marketweb-components 1.0.4 → 1.0.8

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 (229) hide show
  1. package/cjs/convert-57b3dd5e.js +1730 -0
  2. package/cjs/{index-0f43b450.js → index-b58d2618.js} +82 -0
  3. package/cjs/index-f472d191.js +181 -0
  4. package/cjs/loader.cjs.js +2 -2
  5. package/cjs/pn-choice-button_2.cjs.entry.js +78 -0
  6. package/cjs/pn-find-service-and-price-store-56d8b760.js +23 -0
  7. package/cjs/pn-find-service-and-price.cjs.entry.js +263 -0
  8. package/cjs/pn-language-selector_9.cjs.entry.js +646 -0
  9. package/cjs/pn-mainnav-link.cjs.entry.js +45 -0
  10. package/cjs/pn-mainnav-store-dda9827f.js +18 -0
  11. package/cjs/pn-market-web-components.cjs.js +2 -2
  12. package/cjs/pn-marketweb-sitefooter.cjs.entry.js +145 -0
  13. package/cjs/{pn-siteheader.cjs.entry.js → pn-marketweb-siteheader.cjs.entry.js} +8 -8
  14. package/cjs/pn-product-pricelist-result.cjs.entry.js +45 -0
  15. package/cjs/pn-product-pricelist-store-e4f8503b.js +20 -0
  16. package/cjs/pn-product-pricelist.cjs.entry.js +219 -0
  17. package/cjs/pn-product-tile_3.cjs.entry.js +49 -0
  18. package/cjs/pn-site-footer_2.cjs.entry.js +36 -0
  19. package/collection/collection-manifest.json +22 -3
  20. package/collection/components/input/pn-choice-button/choice-button.stories.js +34 -0
  21. package/collection/components/input/pn-choice-button/pn-choice-button.css +66 -0
  22. package/collection/components/input/pn-choice-button/pn-choice-button.js +170 -0
  23. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter-types.js +10 -0
  24. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.css +0 -0
  25. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.js +166 -0
  26. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.stories.js +54 -0
  27. package/collection/components/layout-components/{pn-siteheader → pn-marketweb-sitefooter}/translations.js +0 -0
  28. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.css +34 -0
  29. package/collection/components/layout-components/{pn-siteheader/pn-siteheader-login.js → pn-marketweb-siteheader/pn-marketweb-siteheader-login.js} +6 -6
  30. package/collection/components/layout-components/{pn-siteheader/pn-siteheader-loginmanager.js → pn-marketweb-siteheader/pn-marketweb-siteheader-loginmanager.js} +0 -0
  31. package/collection/components/layout-components/{pn-siteheader/pn-siteheader-search.css → pn-marketweb-siteheader/pn-marketweb-siteheader-search.css} +0 -0
  32. package/collection/components/layout-components/{pn-siteheader/pn-siteheader-search.js → pn-marketweb-siteheader/pn-marketweb-siteheader-search.js} +5 -6
  33. package/collection/components/layout-components/{pn-siteheader/pn-siteheader-types.js → pn-marketweb-siteheader/pn-marketweb-siteheader-types.js} +0 -0
  34. package/collection/components/layout-components/{pn-siteheader/pn-siteheader.css → pn-marketweb-siteheader/pn-marketweb-siteheader.css} +21 -21
  35. package/collection/components/layout-components/{pn-siteheader/pn-siteheader.js → pn-marketweb-siteheader/pn-marketweb-siteheader.js} +7 -7
  36. package/collection/components/layout-components/{pn-siteheader/pn-siteheader.stories.js → pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js} +2 -2
  37. package/collection/components/layout-components/pn-marketweb-siteheader/translations.js +47 -0
  38. package/collection/components/navigation/pn-language-selector/language-selector.stories.js +43 -0
  39. package/collection/components/navigation/pn-language-selector/pn-language-selector-option.css +74 -0
  40. package/collection/components/navigation/pn-language-selector/pn-language-selector-option.js +148 -0
  41. package/collection/components/navigation/pn-language-selector/pn-language-selector-types.js +1 -0
  42. package/collection/components/navigation/pn-language-selector/pn-language-selector.css +32 -0
  43. package/collection/components/navigation/pn-language-selector/pn-language-selector.js +92 -0
  44. package/collection/components/navigation/pn-language-selector/translations.js +17 -0
  45. package/collection/components/navigation/pn-mainnav/main-nav.stories.js +92 -0
  46. package/collection/components/navigation/pn-mainnav/pn-main-nav-mockdata.js +5851 -0
  47. package/collection/components/navigation/pn-mainnav/pn-mainnav-level.css +139 -0
  48. package/collection/components/navigation/pn-mainnav/pn-mainnav-level.js +93 -0
  49. package/collection/components/navigation/pn-mainnav/pn-mainnav-link.css +221 -0
  50. package/collection/components/navigation/pn-mainnav/pn-mainnav-link.js +126 -0
  51. package/collection/components/navigation/pn-mainnav/pn-mainnav-list.css +51 -0
  52. package/collection/components/navigation/pn-mainnav/pn-mainnav-list.js +46 -0
  53. package/collection/components/navigation/pn-mainnav/pn-mainnav-store.js +14 -0
  54. package/collection/components/navigation/pn-mainnav/pn-mainnav.css +100 -0
  55. package/collection/components/navigation/pn-mainnav/pn-mainnav.js +200 -0
  56. package/collection/components/navigation/pn-mainnav/translations.js +32 -0
  57. package/collection/components/navigation/pn-mainnav/types.js +1 -0
  58. package/collection/components/navigation/pn-site-footer/pn-site-footer-col.css +20 -0
  59. package/collection/components/navigation/pn-site-footer/pn-site-footer-col.js +14 -0
  60. package/collection/components/navigation/pn-site-footer/pn-site-footer.css +72 -0
  61. package/collection/components/navigation/pn-site-footer/pn-site-footer.js +50 -0
  62. package/collection/components/navigation/pn-site-footer/site-footer.stories.js +87 -0
  63. package/collection/components/navigation/pn-site-selector/pn-site-selector-i18n.js +18 -0
  64. package/collection/components/navigation/pn-site-selector/pn-site-selector-item.css +62 -0
  65. package/collection/components/navigation/pn-site-selector/pn-site-selector-item.js +103 -0
  66. package/collection/components/navigation/pn-site-selector/pn-site-selector-types.js +1 -0
  67. package/collection/components/navigation/pn-site-selector/pn-site-selector.css +29 -0
  68. package/collection/components/navigation/pn-site-selector/pn-site-selector.js +96 -0
  69. package/collection/components/navigation/pn-site-selector/site-selector.stories.js +35 -0
  70. package/collection/components/widgets/pn-find-service-and-price/data.js +53 -0
  71. package/collection/components/widgets/pn-find-service-and-price/find-service-and-price.stories.js +27 -0
  72. package/collection/components/widgets/pn-find-service-and-price/libs/convertnode.js +58 -0
  73. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.css +0 -0
  74. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.js +101 -0
  75. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-store.js +20 -0
  76. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-translations.js +71 -0
  77. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-types.js +1 -0
  78. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.css +56 -0
  79. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.js +236 -0
  80. package/collection/components/widgets/pn-find-service-and-price/runconvert.js +2 -0
  81. package/collection/components/widgets/pn-product-pricelist/data.js +53 -0
  82. package/collection/components/widgets/pn-product-pricelist/libs/convert.js +43 -0
  83. package/collection/components/widgets/pn-product-pricelist/libs/convertnode.js +58 -0
  84. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-result.css +0 -0
  85. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-result.js +101 -0
  86. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-store.js +17 -0
  87. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.js +56 -0
  88. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-types.js +1 -0
  89. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.css +55 -0
  90. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.js +231 -0
  91. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.stories.js +35 -0
  92. package/collection/components/widgets/pn-product-pricelist/runconvert.js +2 -0
  93. package/collection/components/widgets/pn-product-tile/pn-product-tile-info.css +3 -0
  94. package/collection/components/widgets/pn-product-tile/pn-product-tile-info.js +70 -0
  95. package/collection/components/widgets/pn-product-tile/pn-product-tile-price.css +23 -0
  96. package/collection/components/widgets/pn-product-tile/pn-product-tile-price.js +94 -0
  97. package/collection/components/widgets/pn-product-tile/pn-product-tile.css +48 -0
  98. package/collection/components/widgets/pn-product-tile/pn-product-tile.js +21 -0
  99. package/collection/components/widgets/pn-product-tile/product-tile.stories.js +50 -0
  100. package/collection/globals/shared/productprice/convert.js +43 -0
  101. package/collection/globals/shared/productprice/product-price-types.js +1 -0
  102. package/custom-elements/index.d.ts +126 -12
  103. package/custom-elements/index.js +3179 -24
  104. package/esm/convert-b49a0857.js +1728 -0
  105. package/esm/{index-1e3839a0.js → index-52dc19ca.js} +79 -1
  106. package/esm/index-7c277874.js +179 -0
  107. package/esm/loader.js +2 -2
  108. package/esm/pn-choice-button_2.entry.js +73 -0
  109. package/esm/pn-find-service-and-price-store-d02cbfe1.js +21 -0
  110. package/esm/pn-find-service-and-price.entry.js +259 -0
  111. package/esm/pn-language-selector_9.entry.js +634 -0
  112. package/esm/pn-mainnav-link.entry.js +41 -0
  113. package/esm/pn-mainnav-store-a0726338.js +15 -0
  114. package/esm/pn-market-web-components.js +2 -2
  115. package/esm/pn-marketweb-sitefooter.entry.js +141 -0
  116. package/esm/{pn-siteheader.entry.js → pn-marketweb-siteheader.entry.js} +8 -8
  117. package/esm/pn-product-pricelist-result.entry.js +41 -0
  118. package/esm/pn-product-pricelist-store-6259b354.js +18 -0
  119. package/esm/pn-product-pricelist.entry.js +215 -0
  120. package/esm/pn-product-tile_3.entry.js +43 -0
  121. package/esm/pn-site-footer_2.entry.js +31 -0
  122. package/esm-es5/convert-b49a0857.js +13 -0
  123. package/esm-es5/index-52dc19ca.js +1 -0
  124. package/esm-es5/index-7c277874.js +1 -0
  125. package/esm-es5/loader.js +1 -1
  126. package/esm-es5/pn-choice-button_2.entry.js +1 -0
  127. package/esm-es5/pn-find-service-and-price-store-d02cbfe1.js +1 -0
  128. package/esm-es5/pn-find-service-and-price.entry.js +1 -0
  129. package/esm-es5/pn-language-selector_9.entry.js +1 -0
  130. package/esm-es5/pn-mainnav-link.entry.js +1 -0
  131. package/esm-es5/pn-mainnav-store-a0726338.js +1 -0
  132. package/esm-es5/pn-market-web-components.js +1 -1
  133. package/esm-es5/pn-marketweb-sitefooter.entry.js +1 -0
  134. package/esm-es5/pn-marketweb-siteheader.entry.js +1 -0
  135. package/esm-es5/pn-product-pricelist-result.entry.js +1 -0
  136. package/esm-es5/pn-product-pricelist-store-6259b354.js +1 -0
  137. package/esm-es5/pn-product-pricelist.entry.js +1 -0
  138. package/esm-es5/pn-product-tile_3.entry.js +1 -0
  139. package/esm-es5/pn-site-footer_2.entry.js +1 -0
  140. package/package.json +6 -3
  141. package/pn-market-web-components/p-05d06f7f.system.js +1 -0
  142. package/pn-market-web-components/p-0a756d7d.system.entry.js +1 -0
  143. package/pn-market-web-components/p-21e0e386.js +13 -0
  144. package/pn-market-web-components/p-27502f43.system.entry.js +1 -0
  145. package/pn-market-web-components/p-3ae134bf.system.entry.js +1 -0
  146. package/pn-market-web-components/p-3ae74105.system.entry.js +1 -0
  147. package/pn-market-web-components/p-43bb8707.system.js +1 -0
  148. package/pn-market-web-components/p-46018354.system.js +1 -0
  149. package/pn-market-web-components/p-4b4ee8d5.system.entry.js +1 -0
  150. package/pn-market-web-components/p-4bf9a9ff.js +1 -0
  151. package/pn-market-web-components/p-57a1db89.system.entry.js +1 -0
  152. package/pn-market-web-components/p-5f1ad0b7.entry.js +1 -0
  153. package/pn-market-web-components/p-62700d6e.system.js +1 -0
  154. package/pn-market-web-components/p-7331d3bb.system.js +1 -0
  155. package/pn-market-web-components/p-80fd4dd9.system.entry.js +1 -0
  156. package/pn-market-web-components/p-91624bd5.system.js +13 -0
  157. package/pn-market-web-components/p-926fc962.js +1 -0
  158. package/pn-market-web-components/p-986d3894.entry.js +1 -0
  159. package/pn-market-web-components/p-a04d0ba4.entry.js +1 -0
  160. package/pn-market-web-components/p-a5179982.system.entry.js +1 -0
  161. package/pn-market-web-components/p-af861bb5.js +1 -0
  162. package/pn-market-web-components/p-b129cc27.system.js +1 -0
  163. package/pn-market-web-components/p-b4904bdb.system.entry.js +1 -0
  164. package/pn-market-web-components/p-ba704cbf.entry.js +1 -0
  165. package/pn-market-web-components/p-ba8e9dfe.entry.js +1 -0
  166. package/pn-market-web-components/p-be245b29.entry.js +1 -0
  167. package/pn-market-web-components/p-bfc523fc.js +1 -0
  168. package/pn-market-web-components/p-ce136600.js +1 -0
  169. package/pn-market-web-components/p-d3590589.entry.js +1 -0
  170. package/pn-market-web-components/p-e367b055.system.entry.js +1 -0
  171. package/pn-market-web-components/p-e377410f.entry.js +1 -0
  172. package/pn-market-web-components/p-ec95bda3.entry.js +1 -0
  173. package/pn-market-web-components/p-fee1d1c9.entry.js +1 -0
  174. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  175. package/pn-market-web-components/pn-market-web-components.js +1 -1
  176. package/types/components/input/pn-choice-button/pn-choice-button.d.ts +20 -0
  177. package/types/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter-types.d.ts +21 -0
  178. package/types/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.d.ts +23 -0
  179. package/types/components/layout-components/{pn-siteheader → pn-marketweb-sitefooter}/translations.d.ts +0 -0
  180. package/types/components/layout-components/{pn-siteheader/pn-siteheader-login.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader-login.d.ts} +3 -3
  181. package/types/components/layout-components/{pn-siteheader/pn-siteheader-loginmanager.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader-loginmanager.d.ts} +0 -0
  182. package/types/components/layout-components/{pn-siteheader/pn-siteheader-search.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader-search.d.ts} +2 -2
  183. package/types/components/layout-components/{pn-siteheader/pn-siteheader-types.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader-types.d.ts} +0 -0
  184. package/types/components/layout-components/{pn-siteheader/pn-siteheader.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader.d.ts} +2 -2
  185. package/types/components/layout-components/pn-marketweb-siteheader/translations.d.ts +47 -0
  186. package/types/components/navigation/pn-language-selector/pn-language-selector-option.d.ts +12 -0
  187. package/types/components/navigation/pn-language-selector/pn-language-selector-types.d.ts +9 -0
  188. package/types/components/navigation/pn-language-selector/pn-language-selector.d.ts +15 -0
  189. package/types/components/navigation/pn-language-selector/translations.d.ts +17 -0
  190. package/types/components/navigation/pn-mainnav/pn-mainnav-level.d.ts +15 -0
  191. package/types/components/navigation/pn-mainnav/pn-mainnav-link.d.ts +19 -0
  192. package/types/components/navigation/pn-mainnav/pn-mainnav-list.d.ts +7 -0
  193. package/types/components/navigation/pn-mainnav/pn-mainnav-store.d.ts +21 -0
  194. package/types/components/navigation/pn-mainnav/pn-mainnav.d.ts +24 -0
  195. package/types/components/navigation/pn-mainnav/translations.d.ts +32 -0
  196. package/types/components/navigation/pn-mainnav/types.d.ts +6 -0
  197. package/types/components/navigation/pn-site-footer/pn-site-footer-col.d.ts +3 -0
  198. package/types/components/navigation/pn-site-footer/pn-site-footer.d.ts +6 -0
  199. package/types/components/navigation/pn-site-selector/pn-site-selector-item.d.ts +7 -0
  200. package/types/components/navigation/pn-site-selector/pn-site-selector-types.d.ts +3 -0
  201. package/types/components/navigation/pn-site-selector/pn-site-selector.d.ts +12 -0
  202. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.d.ts +9 -0
  203. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-store.d.ts +33 -0
  204. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-translations.d.ts +71 -0
  205. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-types.d.ts +29 -0
  206. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price.d.ts +18 -0
  207. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-result.d.ts +9 -0
  208. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-store.d.ts +27 -0
  209. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.d.ts +56 -0
  210. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-types.d.ts +16 -0
  211. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist.d.ts +20 -0
  212. package/types/components/widgets/pn-product-tile/pn-product-tile-info.d.ts +6 -0
  213. package/types/components/widgets/pn-product-tile/pn-product-tile-price.d.ts +7 -0
  214. package/types/components/widgets/pn-product-tile/pn-product-tile.d.ts +3 -0
  215. package/types/components.d.ts +486 -28
  216. package/types/globals/shared/productprice/product-price-types.d.ts +19 -0
  217. package/cjs/pn-siteheader-login_2.cjs.entry.js +0 -295
  218. package/collection/components/layout-components/pn-siteheader/pn-siteheader-login.css +0 -34
  219. package/esm/pn-siteheader-login_2.entry.js +0 -290
  220. package/esm-es5/index-1e3839a0.js +0 -1
  221. package/esm-es5/pn-siteheader-login_2.entry.js +0 -1
  222. package/esm-es5/pn-siteheader.entry.js +0 -1
  223. package/pn-market-web-components/p-0e743863.system.js +0 -1
  224. package/pn-market-web-components/p-1e159db8.js +0 -1
  225. package/pn-market-web-components/p-2e901469.system.entry.js +0 -1
  226. package/pn-market-web-components/p-4d08fcb9.entry.js +0 -1
  227. package/pn-market-web-components/p-530b52d0.system.js +0 -1
  228. package/pn-market-web-components/p-9a654a14.system.entry.js +0 -1
  229. package/pn-market-web-components/p-a1045531.entry.js +0 -1
@@ -0,0 +1,103 @@
1
+ import { Component, Prop, h, Host } from "@stencil/core";
2
+ export class PnSiteSelectorItem {
3
+ constructor() {
4
+ /* Link URL */
5
+ this.url = "";
6
+ /* Link title */
7
+ this.heading = "";
8
+ /* Link description */
9
+ this.description = "";
10
+ /* Open link in new window */
11
+ this.newwindow = false;
12
+ }
13
+ render() {
14
+ return (h(Host, { role: "listitem" }, this.url ? (h("a", { class: "siteselector-item-link", href: this.url, target: this.newwindow ? "_blank" : "self", rel: this.newwindow ? "nofollow noopener" : "" },
15
+ h("span", null,
16
+ this.heading && (h("span", { class: "siteselector-item-title" }, this.heading)),
17
+ this.description && (h("small", { class: "siteselector-item-description" }, this.description))),
18
+ h("pn-icon", { symbol: "angle-small-right", color: "blue700" }))) : (h("div", null,
19
+ this.heading && (h("span", { class: "siteselector-item-title" }, this.heading)),
20
+ this.description && (h("small", { class: "siteselector-item-description" }, this.description))))));
21
+ }
22
+ static get is() { return "pn-site-selector-item"; }
23
+ static get originalStyleUrls() { return {
24
+ "$": ["pn-site-selector-item.scss"]
25
+ }; }
26
+ static get styleUrls() { return {
27
+ "$": ["pn-site-selector-item.css"]
28
+ }; }
29
+ static get properties() { return {
30
+ "url": {
31
+ "type": "string",
32
+ "mutable": false,
33
+ "complexType": {
34
+ "original": "string",
35
+ "resolved": "string",
36
+ "references": {}
37
+ },
38
+ "required": false,
39
+ "optional": false,
40
+ "docs": {
41
+ "tags": [],
42
+ "text": ""
43
+ },
44
+ "attribute": "url",
45
+ "reflect": false,
46
+ "defaultValue": "\"\""
47
+ },
48
+ "heading": {
49
+ "type": "string",
50
+ "mutable": false,
51
+ "complexType": {
52
+ "original": "string",
53
+ "resolved": "string",
54
+ "references": {}
55
+ },
56
+ "required": false,
57
+ "optional": false,
58
+ "docs": {
59
+ "tags": [],
60
+ "text": ""
61
+ },
62
+ "attribute": "heading",
63
+ "reflect": false,
64
+ "defaultValue": "\"\""
65
+ },
66
+ "description": {
67
+ "type": "string",
68
+ "mutable": false,
69
+ "complexType": {
70
+ "original": "string",
71
+ "resolved": "string",
72
+ "references": {}
73
+ },
74
+ "required": false,
75
+ "optional": false,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "attribute": "description",
81
+ "reflect": false,
82
+ "defaultValue": "\"\""
83
+ },
84
+ "newwindow": {
85
+ "type": "boolean",
86
+ "mutable": false,
87
+ "complexType": {
88
+ "original": "boolean",
89
+ "resolved": "boolean",
90
+ "references": {}
91
+ },
92
+ "required": false,
93
+ "optional": false,
94
+ "docs": {
95
+ "tags": [],
96
+ "text": ""
97
+ },
98
+ "attribute": "newwindow",
99
+ "reflect": false,
100
+ "defaultValue": "false"
101
+ }
102
+ }; }
103
+ }
@@ -0,0 +1,29 @@
1
+ pn-site-selector {
2
+ display: flex;
3
+ position: relative;
4
+ justify-content: center;
5
+ }
6
+ @media screen and (min-width: 75em) {
7
+ pn-site-selector {
8
+ display: block;
9
+ }
10
+ }
11
+
12
+ .siteselector-heading {
13
+ display: block;
14
+ padding: 0;
15
+ margin-bottom: 1.6rem;
16
+ }
17
+ @media screen and (min-width: 75em) {
18
+ .siteselector-heading {
19
+ display: flex;
20
+ align-items: center;
21
+ margin-top: 0.8rem;
22
+ }
23
+ }
24
+
25
+ .siteselector-list {
26
+ list-style: none;
27
+ margin: 0;
28
+ padding: 0;
29
+ }
@@ -0,0 +1,96 @@
1
+ import { Component, Prop, h, State, Element, Host } from "@stencil/core";
2
+ import languageData from './pn-site-selector-i18n';
3
+ export class PnSiteSelector {
4
+ constructor() {
5
+ /* Site selector Button text */
6
+ this.buttontext = "postnord.se";
7
+ /* Site selector flyout title */
8
+ this.heading = "PostNord";
9
+ /** Specifies which language we want to show navigation in (sv,da,fi,no,en) */
10
+ this.language = "sv";
11
+ this.i18n = { navlabel: "Site selector" };
12
+ }
13
+ componentWillLoad() {
14
+ this.setLanguage();
15
+ }
16
+ setLanguage() {
17
+ if (languageData[this.language]) {
18
+ this.i18n = languageData[this.language];
19
+ }
20
+ }
21
+ render() {
22
+ return (h(Host, null,
23
+ h("pn-nav-dropdown", { label: this.buttontext, icon: "angle-small-down" },
24
+ h("nav", { class: "siteselector-nav", "aria-label": this.i18n.navlabel },
25
+ this.heading ? (h("strong", { class: "siteselector-heading" }, this.heading)) : null,
26
+ h("ul", { class: "siteselector-list" },
27
+ h("slot", null))))));
28
+ }
29
+ static get is() { return "pn-site-selector"; }
30
+ static get originalStyleUrls() { return {
31
+ "$": ["pn-site-selector.scss"]
32
+ }; }
33
+ static get styleUrls() { return {
34
+ "$": ["pn-site-selector.css"]
35
+ }; }
36
+ static get properties() { return {
37
+ "buttontext": {
38
+ "type": "string",
39
+ "mutable": false,
40
+ "complexType": {
41
+ "original": "string",
42
+ "resolved": "string",
43
+ "references": {}
44
+ },
45
+ "required": false,
46
+ "optional": false,
47
+ "docs": {
48
+ "tags": [],
49
+ "text": ""
50
+ },
51
+ "attribute": "buttontext",
52
+ "reflect": false,
53
+ "defaultValue": "\"postnord.se\""
54
+ },
55
+ "heading": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "string",
60
+ "resolved": "string",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": ""
68
+ },
69
+ "attribute": "heading",
70
+ "reflect": false,
71
+ "defaultValue": "\"PostNord\""
72
+ },
73
+ "language": {
74
+ "type": "string",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "string",
78
+ "resolved": "string",
79
+ "references": {}
80
+ },
81
+ "required": false,
82
+ "optional": false,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": "Specifies which language we want to show navigation in (sv,da,fi,no,en)"
86
+ },
87
+ "attribute": "language",
88
+ "reflect": false,
89
+ "defaultValue": "\"sv\""
90
+ }
91
+ }; }
92
+ static get states() { return {
93
+ "i18n": {}
94
+ }; }
95
+ static get elementRef() { return "hostElement"; }
96
+ }
@@ -0,0 +1,35 @@
1
+ import readme from "./readme.md";
2
+
3
+ export default {
4
+ title: "navigation/Site Selector",
5
+ parameters: {
6
+ notes: readme
7
+ }
8
+ };
9
+
10
+ // export const regular = () => {
11
+ // // Storybook Knobs ------------------------------------------//
12
+ // const language = select("Language", {
13
+ // 'Enlish':'en',
14
+ // 'Swedish': 'sv',
15
+ // 'Danish': 'da',
16
+ // 'Finnish': 'fi',
17
+ // 'Norwegian': 'no'
18
+ // }, 'sv');
19
+ // // --------------------------------------------------------- //
20
+ const Template = ({ ...args }) => {
21
+ return `
22
+ <pn-site-selector buttontext="${args.buttontext}" heading="${args.heading}">
23
+ <pn-site-selector-item heading="postnord.se" description="Tjänster och verktyg för att skicka och ta emot din post"></pn-site-selector-item>
24
+ <pn-site-selector-item heading="Portal" description="Hantera dina försändelser" url="https://portal.postnord.com"></pn-site-selector-item>
25
+ <pn-site-selector-item heading="postnord.com" description="Information om PostNord Koncernen" url="https://www.postnord.com"></pn-site-selector-item>
26
+ </pn-site-selector>
27
+ `;
28
+ };
29
+
30
+ export const Primary = Template.bind({});
31
+ Primary.args = {
32
+ buttontext: "postnord.se",
33
+ heading: "PostNord"
34
+ };
35
+
@@ -0,0 +1,53 @@
1
+ const postagetypes = [
2
+ { name: "Brev", value: "letter", illustration: "letterbox-reply-letter-plants" },
3
+ { name: "Paket", value: "parcel", illustration: "tracking" }
4
+ ];
5
+
6
+ const deliveryscopes = {
7
+ "letter": [
8
+ { name: "Sweden", value: "sweden", illustration: "letterboxes" },
9
+ { name: "Abroad", value: "abroad", illustration: "character-box-letters-globe" },
10
+
11
+ ],
12
+ "parcel": [
13
+ { name: "Sweden", value: "sweden", illustration: "letterboxes" },
14
+ { name: "Within Europe", value:"withineurope", illustration: "character-box-letters-globe" },
15
+ { name: "Outside Europe", value:"outsideeurope", illustration: "discover" },
16
+ ]
17
+ };
18
+
19
+ const weights = {
20
+ "letter": [
21
+ { name: "50g", abbreviation: 'g', value: 50 },
22
+ { name: "100g", abbreviation: 'g', value: 100 },
23
+ { name: "250g", abbreviation: 'g', value: 250 },
24
+ { name: "500g", abbreviation: 'g', value: 500 },
25
+ { name: "1kg", abbreviation: 'kg', value: 1 },
26
+ { name: "2kg", abbreviation: 'kg', value: 2 },
27
+ ],
28
+ "parcel": [
29
+ { name: "1kg", abbreviation: 'kg', value: 1 },
30
+ { name: "2kg", abbreviation: 'kg', value: 2 },
31
+ { name: "3kg", abbreviation: 'kg', value: 3 },
32
+ { name: "4kg", abbreviation: 'kg', value: 4 },
33
+ { name: "5kg", abbreviation: 'kg', value: 5 },
34
+ { name: "6kg", abbreviation: 'kg', value: 6 },
35
+ { name: "7Kg", abbreviation: 'kg', value: 7 },
36
+ { name: "8kg", abbreviation: 'kg', value: 8 },
37
+ { name: "9kg", abbreviation: 'kg', value: 9 },
38
+ { name: "10kg", abbreviation: 'kg', value: 10 },
39
+ { name: "11kg", abbreviation: 'kg', value: 11 },
40
+ { name: "12kg", abbreviation: 'kg', value: 12 },
41
+ { name: "13kg", abbreviation: 'kg', value: 13 },
42
+ { name: "14kg", abbreviation: 'kg', value: 14 },
43
+ { name: "15kg", abbreviation: 'kg', value: 15 },
44
+ { name: "16kg", abbreviation: 'kg', value: 16 },
45
+ { name: "17kg", abbreviation: 'kg', value: 17 },
46
+ { name: "18kg", abbreviation: 'kg', value: 18 },
47
+ { name: "20kg", abbreviation: 'kg', value: 20 },
48
+ ]
49
+ };
50
+
51
+
52
+
53
+ export { postagetypes, weights, deliveryscopes};
@@ -0,0 +1,27 @@
1
+ import readme from "./readme.md";
2
+
3
+ export default {
4
+ title: "Widgets /Find Service and Price",
5
+ parameters: {
6
+ notes: readme
7
+ }
8
+ };
9
+
10
+ const Template = ({ ...args }) => {
11
+ return `
12
+ <div style="max-width: 100%; margin:1em auto 0;">
13
+ <pn-find-service-and-price
14
+ source="${args.source}"
15
+ market="${args.market}"
16
+ language="${args.language}"
17
+ ></pn-find-service-and-price>
18
+ </div>
19
+ `;
20
+ };
21
+
22
+ export const Primary = Template.bind({});
23
+ Primary.args = {
24
+ source: 'https://com-integration.postnord.com/globalassets/global/prices/sv-se-findprice.xlsx',
25
+ language: 'sv',
26
+ market: 'se',
27
+ };
@@ -0,0 +1,58 @@
1
+ const fs = require("fs-extra");
2
+ const path = require("path");
3
+ const readXlsxFile = require('read-excel-file/node');
4
+
5
+ async function getFiles(dirpath = "./data") {
6
+ const allFiles = await fs.readdir(dirpath);
7
+ const xslxFiles = allFiles.filter(x => (x.indexOf('.xlsx') !== -1 && x.indexOf('~') !== 0));
8
+ return xslxFiles.map((file) => path.join(dirpath, file));
9
+ }
10
+
11
+ async function convertFile(filepath) {
12
+ const toFilterValue = (x) => x.toLowerCase().replace(/\s+/g, '');
13
+ const outputFilename = filepath.substring(0, filepath.lastIndexOf('.') + 1) + 'json';
14
+ console.log(`Reading file "${filepath}" and converting to "${outputFilename}"`);
15
+ const sheets = await readXlsxFile(filepath, { getSheets: true })
16
+ let dataRows = [];
17
+ let sheetsData = await Promise.all(sheets.map(async (sheet) => { return await readXlsxFile(filepath, { sheet: sheet.name }) })); //await readXlsxFile(filepath, { sheet: sheet.name });
18
+ const filterColumnNames = ["what", "deliveryscope"];
19
+ let types = {};
20
+ sheetsData.forEach(sheetData => {
21
+ const firstRow = sheetData.shift().map(x => toFilterValue(x));
22
+ // Set up column for adding options
23
+ firstRow.forEach(async (col, i) => {
24
+ if (typeof types[col] === "undefined" && filterColumnNames.includes(col)) {
25
+ types[col] = [];
26
+ }
27
+ });
28
+ sheetData.forEach((row, rowindex) => {
29
+ const dataRow = {};
30
+ firstRow.forEach(async (col, i) => {
31
+ const rowVal = row[i];
32
+ dataRow[col] = rowVal;
33
+ // Add to types options
34
+ if (filterColumnNames.includes(col)) {
35
+ const filterVal = toFilterValue(rowVal);
36
+ dataRow[col] = filterVal;
37
+ if (!types[col].includes(filterVal)) {
38
+ types[col].push(filterVal);
39
+ }
40
+ }
41
+ });
42
+ dataRows.push(dataRow);
43
+ });
44
+ });
45
+ const dataFile = filepath;
46
+ const fileData = {
47
+ "file": filepath,
48
+ "types": types,
49
+ "data": dataRows
50
+ };
51
+ console.log(`Stored ${dataRows.length} rows from ${sheetsData.length} sheets. ${Object.keys(types).length} filter types identified`)
52
+ fs.writeJsonSync(outputFilename, fileData)
53
+ }
54
+
55
+ async function convert(dirpath = "./data") {
56
+ const files = await getFiles(dirpath);
57
+ files.forEach(convertFile);
58
+ }
@@ -0,0 +1,101 @@
1
+ import { Component, h, Prop, Host, Watch, State } from "@stencil/core";
2
+ import { state } from "./pn-find-service-and-price-store";
3
+ export class PnfindServiceAndPriceResult {
4
+ constructor() {
5
+ this.item = null;
6
+ this.shownitems = [];
7
+ this.weightText = "";
8
+ }
9
+ componentWillLoad() {
10
+ this.composeItems();
11
+ }
12
+ composeItems() {
13
+ this.shownitems = [];
14
+ if (this.item.pricestamps) {
15
+ this.shownitems.push(Object.assign(Object.assign({}, this.item), { priceagent: null, pricesenddirect: null }));
16
+ }
17
+ if (this.item.priceagent) {
18
+ this.shownitems.push(Object.assign(Object.assign({}, this.item), { pricestamps: null, pricesenddirect: null }));
19
+ }
20
+ if (this.item.pricesenddirect) {
21
+ this.shownitems.push(Object.assign(Object.assign({}, this.item), { pricestamps: null, priceagent: null }));
22
+ }
23
+ // Parcels are always in KG. Letter KG must be converted from grams
24
+ this.weightText = (this.item.what === "parcel") ? this.item.maxweight + 'kg' :
25
+ (this.item.what === "letter" && this.item.maxweight > 999) ? Math.round(this.item.maxweight / 1000) + " kg" : this.item.maxweight + " g";
26
+ }
27
+ render() {
28
+ return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null,
29
+ h("pn-illustration", { slot: "illustration", illustration: item.illustration }),
30
+ h("div", { slot: "content" },
31
+ h("div", { class: "content" },
32
+ h("h3", null, item.name),
33
+ (item.description) ? (h("div", { class: "description" }, item.description)) : null,
34
+ (item.info) ? (h("div", { class: "description" }, item.info)) : null)),
35
+ item.maxweight ? (h("pn-product-tile-info", { label: state.i18n.maxweightlabel, text: this.weightText })) : null,
36
+ item.maximummeasurements ? (h("pn-product-tile-info", { label: state.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null,
37
+ item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.stampshopcta, amount: item.pricestamps + '', currency: state.market.currency })) : null,
38
+ item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "", amount: item.priceagent + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null,
39
+ item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.senddirectcta, amount: item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null,
40
+ item.note ? (h("small", { slot: "note" },
41
+ h("p", null, item.note))) : null)))));
42
+ }
43
+ static get is() { return "pn-find-service-and-price-result"; }
44
+ static get originalStyleUrls() { return {
45
+ "$": ["pn-find-service-and-price-result.scss"]
46
+ }; }
47
+ static get styleUrls() { return {
48
+ "$": ["pn-find-service-and-price-result.css"]
49
+ }; }
50
+ static get properties() { return {
51
+ "item": {
52
+ "type": "unknown",
53
+ "mutable": true,
54
+ "complexType": {
55
+ "original": "ProductPriceItem",
56
+ "resolved": "ProductPriceItem",
57
+ "references": {
58
+ "ProductPriceItem": {
59
+ "location": "import",
60
+ "path": "../../../globals/shared/productprice/product-price-types"
61
+ }
62
+ }
63
+ },
64
+ "required": false,
65
+ "optional": false,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "defaultValue": "null"
71
+ },
72
+ "shownitems": {
73
+ "type": "unknown",
74
+ "mutable": false,
75
+ "complexType": {
76
+ "original": "ProductPriceItem[]",
77
+ "resolved": "ProductPriceItem[]",
78
+ "references": {
79
+ "ProductPriceItem": {
80
+ "location": "import",
81
+ "path": "../../../globals/shared/productprice/product-price-types"
82
+ }
83
+ }
84
+ },
85
+ "required": false,
86
+ "optional": false,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": ""
90
+ },
91
+ "defaultValue": "[]"
92
+ }
93
+ }; }
94
+ static get states() { return {
95
+ "weightText": {}
96
+ }; }
97
+ static get watchers() { return [{
98
+ "propName": "item",
99
+ "methodName": "composeItems"
100
+ }]; }
101
+ }
@@ -0,0 +1,20 @@
1
+ import { createStore } from "@stencil/store";
2
+ // Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
3
+ const { state, onChange } = createStore({
4
+ i18n: {
5
+ componentheading: '',
6
+ deliveryscopeheading: '',
7
+ sizeheading: '',
8
+ resultlistheading: '',
9
+ weightlabel: '',
10
+ maxweightlabel: '',
11
+ maxmeasurementlabel: '',
12
+ senddirectcta: '',
13
+ stampshopcta: '',
14
+ },
15
+ market: {
16
+ currency: ""
17
+ }
18
+ });
19
+ export { state, onChange };
20
+ export default state;
@@ -0,0 +1,71 @@
1
+ export const translations = {
2
+ 'sv': {
3
+ 'componentheading': 'Vad vill du skicka?',
4
+ 'deliveryscopeheading': 'Hit eller dit?',
5
+ 'sizeheading': 'Hur mycket väger det?',
6
+ 'resultlistheading': 'Några utvalda val',
7
+ 'weightlabel': 'Vikt',
8
+ 'maxweightlabel': 'Maxvikt',
9
+ 'maxmeasurementlabel': 'Maxvolym',
10
+ 'senddirectcta': 'Köp frakt via Skicka Direkt',
11
+ 'stampshopcta': 'Köp frimärken via vår webshop',
12
+ },
13
+ 'en': {
14
+ 'componentheading': 'What do you want to send?',
15
+ 'deliveryscopeheading': 'Here or there?',
16
+ 'sizeheading': 'How much does it weigh?',
17
+ 'resultlistheading': 'Some suitable options for you',
18
+ 'weightlabel': 'Weight',
19
+ 'maxweightlabel': 'Max weight',
20
+ 'maxmeasurementlabel': 'Maximum measurement',
21
+ 'senddirectcta': 'Buy shipping in Send Direct',
22
+ 'stampshopcta': 'Order home stamps from the webshop',
23
+ },
24
+ 'da': {
25
+ 'componentheading': 'Vad vill du skicka?',
26
+ 'deliveryscopeheading': 'Here or there?',
27
+ 'sizeheading': 'How much does it weigh?',
28
+ 'resultlistheading': 'Some suitable options for you',
29
+ 'weightlabel': 'Vægt',
30
+ 'maxweightlabel': 'Max vægt',
31
+ 'maxmeasurementlabel': 'Maks. Volumen',
32
+ 'senddirectcta': 'Buy shipping in Send Direct',
33
+ 'stampshopcta': 'Order home stamps from the webshop',
34
+ },
35
+ 'no': {
36
+ 'componentheading': 'Vad vill du skicka?',
37
+ 'deliveryscopeheading': 'Here or there?',
38
+ 'sizeheading': 'How much does it weigh?',
39
+ 'resultlistheading': 'Some suitable options for you',
40
+ 'weightlabel': 'Vekt',
41
+ 'maxweightlabel': 'Maks vekt',
42
+ 'maxmeasurementlabel': 'Maks volum',
43
+ 'senddirectcta': 'Buy shipping in Send Direct',
44
+ 'stampshopcta': 'Order home stamps from the webshop',
45
+ },
46
+ 'fi': {
47
+ 'componentheading': 'Vad vill du skicka?',
48
+ 'deliveryscopeheading': 'Here or there?',
49
+ 'sizeheading': 'How much does it weigh?',
50
+ 'resultlistheading': 'Some suitable options for you',
51
+ 'weightlabel': 'Paino',
52
+ 'maxweightlabel': 'Max paino',
53
+ 'maxmeasurementlabel': 'Max äänenvoimakkuus',
54
+ 'senddirectcta': 'Buy shipping in Send Direct',
55
+ 'stampshopcta': 'Order home stamps from the webshop',
56
+ }
57
+ };
58
+ export const markets = {
59
+ 'se': {
60
+ "currency": "kr",
61
+ },
62
+ 'dk': {
63
+ "currency": "dk",
64
+ },
65
+ 'fi': {
66
+ "currency": " €",
67
+ },
68
+ 'no': {
69
+ "currency": "kr",
70
+ }
71
+ };
@@ -0,0 +1,56 @@
1
+ pn-find-service-and-price .findprice-form {
2
+ max-width: 50em;
3
+ margin: 0 auto;
4
+ }
5
+ pn-find-service-and-price h2,
6
+ pn-find-service-and-price .heading {
7
+ text-align: center;
8
+ font-size: 1.5em;
9
+ line-height: 1.1;
10
+ font-weight: bold;
11
+ margin-bottom: 1rem;
12
+ }
13
+ pn-find-service-and-price .postagetypes,
14
+ pn-find-service-and-price .deliveryscope {
15
+ text-align: center;
16
+ margin-bottom: 3rem;
17
+ }
18
+ pn-find-service-and-price .weightoption {
19
+ display: flex;
20
+ gap: 1em;
21
+ }
22
+ pn-find-service-and-price .weightoption-input {
23
+ width: 5em;
24
+ position: relative;
25
+ }
26
+ pn-find-service-and-price .weightoption-input input::-webkit-outer-spin-button,
27
+ pn-find-service-and-price .weightoption-input input::-webkit-inner-spin-button {
28
+ -webkit-appearance: none;
29
+ margin: 0;
30
+ }
31
+ pn-find-service-and-price .weightoption-input-abbreviation {
32
+ position: absolute;
33
+ top: 50%;
34
+ transform: translateY(-50%);
35
+ right: 1.2em;
36
+ margin-top: 1.55rem;
37
+ font-weight: 500;
38
+ }
39
+ pn-find-service-and-price .weightoption-range {
40
+ flex-grow: 1;
41
+ align-self: flex-end;
42
+ position: relative;
43
+ top: 0.5em;
44
+ }
45
+ pn-find-service-and-price .weightoption-range input {
46
+ width: calc(100% - 1.5em);
47
+ }
48
+ pn-find-service-and-price .weightoption-range datalist {
49
+ width: 100%;
50
+ display: flex;
51
+ justify-content: space-between;
52
+ font-size: 0.75em;
53
+ }
54
+ pn-find-service-and-price .resultlist {
55
+ margin: 3em 0;
56
+ }