@postnord/pn-marketweb-components 1.0.3 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/convert-57b3dd5e.js +1730 -0
- package/cjs/{index-0f43b450.js → index-b58d2618.js} +82 -0
- package/cjs/index-f472d191.js +181 -0
- package/cjs/loader.cjs.js +2 -2
- package/cjs/pn-choice-button_2.cjs.entry.js +78 -0
- package/cjs/pn-find-service-and-price-store-7ced0e29.js +21 -0
- package/cjs/pn-find-service-and-price.cjs.entry.js +246 -0
- package/cjs/pn-language-selector_9.cjs.entry.js +646 -0
- package/cjs/pn-mainnav-link.cjs.entry.js +45 -0
- package/cjs/pn-mainnav-store-dda9827f.js +18 -0
- package/cjs/pn-market-web-components.cjs.js +2 -2
- package/cjs/pn-marketweb-sitefooter.cjs.entry.js +145 -0
- package/cjs/{pn-siteheader.cjs.entry.js → pn-marketweb-siteheader.cjs.entry.js} +14 -11
- package/cjs/pn-product-pricelist-result.cjs.entry.js +34 -0
- package/cjs/pn-product-pricelist-store-ffd73312.js +16 -0
- package/cjs/pn-product-pricelist.cjs.entry.js +110 -0
- package/cjs/pn-product-tile_3.cjs.entry.js +49 -0
- package/cjs/pn-site-footer_2.cjs.entry.js +36 -0
- package/collection/collection-manifest.json +22 -3
- package/collection/components/input/pn-choice-button/choice-button.stories.js +34 -0
- package/collection/components/input/pn-choice-button/pn-choice-button.css +66 -0
- package/collection/components/input/pn-choice-button/pn-choice-button.js +170 -0
- package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter-types.js +10 -0
- package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.css +0 -0
- package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.js +166 -0
- package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.stories.js +54 -0
- package/collection/components/layout-components/{pn-siteheader → pn-marketweb-sitefooter}/translations.js +0 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.css +34 -0
- package/collection/components/layout-components/{pn-siteheader/pn-siteheader-login.js → pn-marketweb-siteheader/pn-marketweb-siteheader-login.js} +6 -6
- package/collection/components/layout-components/{pn-siteheader/pn-siteheader-loginmanager.js → pn-marketweb-siteheader/pn-marketweb-siteheader-loginmanager.js} +0 -0
- package/collection/components/layout-components/{pn-siteheader/pn-siteheader-search.css → pn-marketweb-siteheader/pn-marketweb-siteheader-search.css} +0 -0
- package/collection/components/layout-components/{pn-siteheader/pn-siteheader-search.js → pn-marketweb-siteheader/pn-marketweb-siteheader-search.js} +5 -6
- package/collection/components/layout-components/{pn-siteheader/pn-siteheader-types.js → pn-marketweb-siteheader/pn-marketweb-siteheader-types.js} +0 -0
- package/collection/components/layout-components/{pn-siteheader/pn-siteheader.css → pn-marketweb-siteheader/pn-marketweb-siteheader.css} +21 -21
- package/collection/components/layout-components/{pn-siteheader/pn-siteheader.js → pn-marketweb-siteheader/pn-marketweb-siteheader.js} +13 -10
- package/collection/components/layout-components/{pn-siteheader/pn-siteheader.stories.js → pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js} +2 -2
- package/collection/components/layout-components/pn-marketweb-siteheader/translations.js +47 -0
- package/collection/components/navigation/pn-language-selector/language-selector.stories.js +43 -0
- package/collection/components/navigation/pn-language-selector/pn-language-selector-option.css +74 -0
- package/collection/components/navigation/pn-language-selector/pn-language-selector-option.js +148 -0
- package/collection/components/navigation/pn-language-selector/pn-language-selector-types.js +1 -0
- package/collection/components/navigation/pn-language-selector/pn-language-selector.css +32 -0
- package/collection/components/navigation/pn-language-selector/pn-language-selector.js +92 -0
- package/collection/components/navigation/pn-language-selector/translations.js +17 -0
- package/collection/components/navigation/pn-mainnav/main-nav.stories.js +92 -0
- package/collection/components/navigation/pn-mainnav/pn-main-nav-mockdata.js +5851 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav-level.css +139 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav-level.js +93 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav-link.css +221 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav-link.js +126 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav-list.css +51 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav-list.js +46 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav-store.js +14 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav.css +100 -0
- package/collection/components/navigation/pn-mainnav/pn-mainnav.js +200 -0
- package/collection/components/navigation/pn-mainnav/translations.js +32 -0
- package/collection/components/navigation/pn-mainnav/types.js +1 -0
- package/collection/components/navigation/pn-site-footer/pn-site-footer-col.css +20 -0
- package/collection/components/navigation/pn-site-footer/pn-site-footer-col.js +14 -0
- package/collection/components/navigation/pn-site-footer/pn-site-footer.css +72 -0
- package/collection/components/navigation/pn-site-footer/pn-site-footer.js +50 -0
- package/collection/components/navigation/pn-site-footer/site-footer.stories.js +87 -0
- package/collection/components/navigation/pn-site-selector/pn-site-selector-i18n.js +18 -0
- package/collection/components/navigation/pn-site-selector/pn-site-selector-item.css +62 -0
- package/collection/components/navigation/pn-site-selector/pn-site-selector-item.js +103 -0
- package/collection/components/navigation/pn-site-selector/pn-site-selector-types.js +1 -0
- package/collection/components/navigation/pn-site-selector/pn-site-selector.css +29 -0
- package/collection/components/navigation/pn-site-selector/pn-site-selector.js +96 -0
- package/collection/components/navigation/pn-site-selector/site-selector.stories.js +35 -0
- package/collection/components/widgets/pn-find-service-and-price/data.js +53 -0
- package/collection/components/widgets/pn-find-service-and-price/find-service-and-price.stories.js +27 -0
- package/collection/components/widgets/pn-find-service-and-price/libs/convertnode.js +58 -0
- package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.css +0 -0
- package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.js +101 -0
- package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-store.js +18 -0
- package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-translations.js +61 -0
- package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-types.js +1 -0
- package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.css +52 -0
- package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.js +229 -0
- package/collection/components/widgets/pn-find-service-and-price/runconvert.js +2 -0
- package/collection/components/widgets/pn-product-pricelist/data.js +51 -0
- package/collection/components/widgets/pn-product-pricelist/libs/convert.js +43 -0
- package/collection/components/widgets/pn-product-pricelist/libs/convertnode.js +58 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-result.css +0 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-result.js +86 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-store.js +13 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.js +36 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-types.js +1 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.css +6 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.js +157 -0
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.stories.js +35 -0
- package/collection/components/widgets/pn-product-pricelist/runconvert.js +2 -0
- package/collection/components/widgets/pn-product-tile/pn-product-tile-info.css +3 -0
- package/collection/components/widgets/pn-product-tile/pn-product-tile-info.js +70 -0
- package/collection/components/widgets/pn-product-tile/pn-product-tile-price.css +21 -0
- package/collection/components/widgets/pn-product-tile/pn-product-tile-price.js +99 -0
- package/collection/components/widgets/pn-product-tile/pn-product-tile.css +48 -0
- package/collection/components/widgets/pn-product-tile/pn-product-tile.js +21 -0
- package/collection/components/widgets/pn-product-tile/product-tile.stories.js +50 -0
- package/collection/globals/shared/productprice/convert.js +43 -0
- package/collection/globals/shared/productprice/product-price-types.js +1 -0
- package/custom-elements/index.d.ts +126 -12
- package/custom-elements/index.js +3042 -27
- package/esm/convert-b49a0857.js +1728 -0
- package/esm/{index-1e3839a0.js → index-52dc19ca.js} +79 -1
- package/esm/index-7c277874.js +179 -0
- package/esm/loader.js +2 -2
- package/esm/pn-choice-button_2.entry.js +73 -0
- package/esm/pn-find-service-and-price-store-0c7083bd.js +19 -0
- package/esm/pn-find-service-and-price.entry.js +242 -0
- package/esm/pn-language-selector_9.entry.js +634 -0
- package/esm/pn-mainnav-link.entry.js +41 -0
- package/esm/pn-mainnav-store-a0726338.js +15 -0
- package/esm/pn-market-web-components.js +2 -2
- package/esm/pn-marketweb-sitefooter.entry.js +141 -0
- package/esm/{pn-siteheader.entry.js → pn-marketweb-siteheader.entry.js} +14 -11
- package/esm/pn-product-pricelist-result.entry.js +30 -0
- package/esm/pn-product-pricelist-store-82211c4a.js +14 -0
- package/esm/pn-product-pricelist.entry.js +106 -0
- package/esm/pn-product-tile_3.entry.js +43 -0
- package/esm/pn-site-footer_2.entry.js +31 -0
- package/esm-es5/convert-b49a0857.js +13 -0
- package/esm-es5/index-52dc19ca.js +1 -0
- package/esm-es5/index-7c277874.js +1 -0
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-choice-button_2.entry.js +1 -0
- package/esm-es5/pn-find-service-and-price-store-0c7083bd.js +1 -0
- package/esm-es5/pn-find-service-and-price.entry.js +1 -0
- package/esm-es5/pn-language-selector_9.entry.js +1 -0
- package/esm-es5/pn-mainnav-link.entry.js +1 -0
- package/esm-es5/pn-mainnav-store-a0726338.js +1 -0
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-marketweb-sitefooter.entry.js +1 -0
- package/esm-es5/pn-marketweb-siteheader.entry.js +1 -0
- package/esm-es5/pn-product-pricelist-result.entry.js +1 -0
- package/esm-es5/pn-product-pricelist-store-82211c4a.js +1 -0
- package/esm-es5/pn-product-pricelist.entry.js +1 -0
- package/esm-es5/pn-product-tile_3.entry.js +1 -0
- package/esm-es5/pn-site-footer_2.entry.js +1 -0
- package/package.json +6 -3
- package/pn-market-web-components/p-05d06f7f.system.js +1 -0
- package/pn-market-web-components/p-0a756d7d.system.entry.js +1 -0
- package/pn-market-web-components/p-1905c548.entry.js +1 -0
- package/pn-market-web-components/p-1fe6de09.entry.js +1 -0
- package/pn-market-web-components/p-21e0e386.js +13 -0
- package/pn-market-web-components/p-23743bec.system.entry.js +1 -0
- package/pn-market-web-components/p-23d34c82.system.entry.js +1 -0
- package/pn-market-web-components/p-27502f43.system.entry.js +1 -0
- package/pn-market-web-components/p-2fa246f1.system.js +1 -0
- package/pn-market-web-components/p-3ae74105.system.entry.js +1 -0
- package/pn-market-web-components/p-44f74289.system.entry.js +1 -0
- package/pn-market-web-components/p-46018354.system.js +1 -0
- package/pn-market-web-components/p-4bf9a9ff.js +1 -0
- package/pn-market-web-components/p-4f283190.js +1 -0
- package/pn-market-web-components/p-5f1ad0b7.entry.js +1 -0
- package/pn-market-web-components/p-62700d6e.system.js +1 -0
- package/pn-market-web-components/p-64a6c2fb.js +1 -0
- package/pn-market-web-components/p-7331d3bb.system.js +1 -0
- package/pn-market-web-components/p-91624bd5.system.js +13 -0
- package/pn-market-web-components/p-986d3894.entry.js +1 -0
- package/pn-market-web-components/p-a5179982.system.entry.js +1 -0
- package/pn-market-web-components/p-be245b29.entry.js +1 -0
- package/pn-market-web-components/p-bfc523fc.js +1 -0
- package/pn-market-web-components/p-c06b37c7.entry.js +1 -0
- package/pn-market-web-components/p-c9af6ced.entry.js +1 -0
- package/pn-market-web-components/p-ce136600.js +1 -0
- package/pn-market-web-components/p-d0e7e65c.system.js +1 -0
- package/pn-market-web-components/p-dc5ff15f.entry.js +1 -0
- package/pn-market-web-components/p-e367b055.system.entry.js +1 -0
- package/pn-market-web-components/p-ea9afb95.system.entry.js +1 -0
- package/pn-market-web-components/p-ec95bda3.entry.js +1 -0
- package/pn-market-web-components/p-f37be6ee.system.entry.js +1 -0
- package/pn-market-web-components/p-fee1d1c9.entry.js +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/pn-market-web-components/pn-market-web-components.js +1 -1
- package/types/components/input/pn-choice-button/pn-choice-button.d.ts +20 -0
- package/types/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter-types.d.ts +21 -0
- package/types/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.d.ts +23 -0
- package/types/components/layout-components/{pn-siteheader → pn-marketweb-sitefooter}/translations.d.ts +0 -0
- package/types/components/layout-components/{pn-siteheader/pn-siteheader-login.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader-login.d.ts} +3 -3
- package/types/components/layout-components/{pn-siteheader/pn-siteheader-loginmanager.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader-loginmanager.d.ts} +0 -0
- package/types/components/layout-components/{pn-siteheader/pn-siteheader-search.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader-search.d.ts} +2 -2
- package/types/components/layout-components/{pn-siteheader/pn-siteheader-types.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader-types.d.ts} +1 -0
- package/types/components/layout-components/{pn-siteheader/pn-siteheader.d.ts → pn-marketweb-siteheader/pn-marketweb-siteheader.d.ts} +3 -2
- package/types/components/layout-components/pn-marketweb-siteheader/translations.d.ts +47 -0
- package/types/components/navigation/pn-language-selector/pn-language-selector-option.d.ts +12 -0
- package/types/components/navigation/pn-language-selector/pn-language-selector-types.d.ts +9 -0
- package/types/components/navigation/pn-language-selector/pn-language-selector.d.ts +15 -0
- package/types/components/navigation/pn-language-selector/translations.d.ts +17 -0
- package/types/components/navigation/pn-mainnav/pn-mainnav-level.d.ts +15 -0
- package/types/components/navigation/pn-mainnav/pn-mainnav-link.d.ts +19 -0
- package/types/components/navigation/pn-mainnav/pn-mainnav-list.d.ts +7 -0
- package/types/components/navigation/pn-mainnav/pn-mainnav-store.d.ts +21 -0
- package/types/components/navigation/pn-mainnav/pn-mainnav.d.ts +24 -0
- package/types/components/navigation/pn-mainnav/translations.d.ts +32 -0
- package/types/components/navigation/pn-mainnav/types.d.ts +6 -0
- package/types/components/navigation/pn-site-footer/pn-site-footer-col.d.ts +3 -0
- package/types/components/navigation/pn-site-footer/pn-site-footer.d.ts +6 -0
- package/types/components/navigation/pn-site-selector/pn-site-selector-item.d.ts +7 -0
- package/types/components/navigation/pn-site-selector/pn-site-selector-types.d.ts +3 -0
- package/types/components/navigation/pn-site-selector/pn-site-selector.d.ts +12 -0
- package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.d.ts +9 -0
- package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-store.d.ts +29 -0
- package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-translations.d.ts +61 -0
- package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-types.d.ts +27 -0
- package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price.d.ts +18 -0
- package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-result.d.ts +7 -0
- package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-store.d.ts +19 -0
- package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.d.ts +36 -0
- package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-types.d.ts +7 -0
- package/types/components/widgets/pn-product-pricelist/pn-product-pricelist.d.ts +16 -0
- package/types/components/widgets/pn-product-tile/pn-product-tile-info.d.ts +6 -0
- package/types/components/widgets/pn-product-tile/pn-product-tile-price.d.ts +7 -0
- package/types/components/widgets/pn-product-tile/pn-product-tile.d.ts +3 -0
- package/types/components.d.ts +486 -28
- package/types/globals/shared/productprice/product-price-types.d.ts +19 -0
- package/cjs/pn-siteheader-login_2.cjs.entry.js +0 -295
- package/collection/components/layout-components/pn-siteheader/pn-siteheader-login.css +0 -34
- package/esm/pn-siteheader-login_2.entry.js +0 -290
- package/esm-es5/index-1e3839a0.js +0 -1
- package/esm-es5/pn-siteheader-login_2.entry.js +0 -1
- package/esm-es5/pn-siteheader.entry.js +0 -1
- package/pn-market-web-components/p-0e743863.system.js +0 -1
- package/pn-market-web-components/p-1e159db8.js +0 -1
- package/pn-market-web-components/p-50b6c2c1.system.entry.js +0 -1
- package/pn-market-web-components/p-530b52d0.system.js +0 -1
- package/pn-market-web-components/p-9a654a14.system.entry.js +0 -1
- package/pn-market-web-components/p-a1045531.entry.js +0 -1
- package/pn-market-web-components/p-fc344aee.entry.js +0 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-b58d2618.js');
|
|
6
|
+
const convert = require('./convert-57b3dd5e.js');
|
|
7
|
+
const pnFindServiceAndPriceStore = require('./pn-find-service-and-price-store-7ced0e29.js');
|
|
8
|
+
require('./index-f472d191.js');
|
|
9
|
+
|
|
10
|
+
const translations = {
|
|
11
|
+
'sv': {
|
|
12
|
+
'componentheading': 'Vad vill du skicka?',
|
|
13
|
+
'deliveryscopeheading': 'Hit eller dit?',
|
|
14
|
+
'sizeheading': 'Hur mycket väger det?',
|
|
15
|
+
'resultlistheading': 'Några utvalda val',
|
|
16
|
+
'weightlabel': 'Vikt',
|
|
17
|
+
'maxweightlabel': 'Maxvikt',
|
|
18
|
+
'maxmeasurementlabel': 'Maxvolym',
|
|
19
|
+
},
|
|
20
|
+
'en': {
|
|
21
|
+
'componentheading': 'What do you want to send?',
|
|
22
|
+
'deliveryscopeheading': 'Here or there?',
|
|
23
|
+
'sizeheading': 'How much does it weigh?',
|
|
24
|
+
'resultlistheading': 'Some suitable options for you',
|
|
25
|
+
'weightlabel': 'Weight',
|
|
26
|
+
'maxweightlabel': 'Max weight',
|
|
27
|
+
'maxmeasurementlabel': 'Maximum measurement',
|
|
28
|
+
},
|
|
29
|
+
'da': {
|
|
30
|
+
'componentheading': 'Vad vill du skicka?',
|
|
31
|
+
'deliveryscopeheading': 'Here or there?',
|
|
32
|
+
'sizeheading': 'How much does it weigh?',
|
|
33
|
+
'resultlistheading': 'Some suitable options for you',
|
|
34
|
+
'weightlabel': 'Vægt',
|
|
35
|
+
'maxweightlabel': 'Max vægt',
|
|
36
|
+
'maxmeasurementlabel': 'Maks. Volumen',
|
|
37
|
+
},
|
|
38
|
+
'no': {
|
|
39
|
+
'componentheading': 'Vad vill du skicka?',
|
|
40
|
+
'deliveryscopeheading': 'Here or there?',
|
|
41
|
+
'sizeheading': 'How much does it weigh?',
|
|
42
|
+
'resultlistheading': 'Some suitable options for you',
|
|
43
|
+
'weightlabel': 'Vekt',
|
|
44
|
+
'maxweightlabel': 'Maks vekt',
|
|
45
|
+
'maxmeasurementlabel': 'Maks volum',
|
|
46
|
+
},
|
|
47
|
+
'fi': {
|
|
48
|
+
'componentheading': 'Vad vill du skicka?',
|
|
49
|
+
'deliveryscopeheading': 'Here or there?',
|
|
50
|
+
'sizeheading': 'How much does it weigh?',
|
|
51
|
+
'resultlistheading': 'Some suitable options for you',
|
|
52
|
+
'weightlabel': 'Paino',
|
|
53
|
+
'maxweightlabel': 'Max paino',
|
|
54
|
+
'maxmeasurementlabel': 'Max äänenvoimakkuus',
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const markets = {
|
|
58
|
+
'se': {
|
|
59
|
+
"currency": "kr",
|
|
60
|
+
},
|
|
61
|
+
'dk': {
|
|
62
|
+
"currency": "dk",
|
|
63
|
+
},
|
|
64
|
+
'fi': {
|
|
65
|
+
"currency": " €",
|
|
66
|
+
},
|
|
67
|
+
'no': {
|
|
68
|
+
"currency": "kr",
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const postagetypes = [
|
|
73
|
+
{ name: "Brev", value: "letter", illustration: "letterbox-reply-letter-plants" },
|
|
74
|
+
{ name: "Paket", value: "parcel", illustration: "tracking" }
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
const deliveryscopes = {
|
|
78
|
+
"letter": [
|
|
79
|
+
{ name: "Sweden", value: "sweden", illustration: "letterboxes" },
|
|
80
|
+
{ name: "Abroad", value: "abroad", illustration: "character-box-letters-globe" },
|
|
81
|
+
|
|
82
|
+
],
|
|
83
|
+
"parcel": [
|
|
84
|
+
{ name: "Sweden", value: "sweden", illustration: "letterboxes" },
|
|
85
|
+
{ name: "Within Europe", value:"withineurope", illustration: "character-box-letters-globe" },
|
|
86
|
+
{ name: "Outside Europe", value:"outsideeurope", illustration: "discover" },
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const weights = {
|
|
91
|
+
"letter": [
|
|
92
|
+
{ name: "50g", abbreviation: 'g', value: 50 },
|
|
93
|
+
{ name: "100g", abbreviation: 'g', value: 100 },
|
|
94
|
+
{ name: "250g", abbreviation: 'g', value: 250 },
|
|
95
|
+
{ name: "500g", abbreviation: 'g', value: 500 },
|
|
96
|
+
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
97
|
+
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
98
|
+
],
|
|
99
|
+
"parcel": [
|
|
100
|
+
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
101
|
+
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
102
|
+
{ name: "3kg", abbreviation: 'kg', value: 3 },
|
|
103
|
+
{ name: "4kg", abbreviation: 'kg', value: 4 },
|
|
104
|
+
{ name: "5kg", abbreviation: 'kg', value: 5 },
|
|
105
|
+
{ name: "6kg", abbreviation: 'kg', value: 6 },
|
|
106
|
+
{ name: "7Kg", abbreviation: 'kg', value: 7 },
|
|
107
|
+
{ name: "8kg", abbreviation: 'kg', value: 8 },
|
|
108
|
+
{ name: "9kg", abbreviation: 'kg', value: 9 },
|
|
109
|
+
{ name: "10kg", abbreviation: 'kg', value: 10 },
|
|
110
|
+
{ name: "11kg", abbreviation: 'kg', value: 11 },
|
|
111
|
+
{ name: "12kg", abbreviation: 'kg', value: 12 },
|
|
112
|
+
{ name: "13kg", abbreviation: 'kg', value: 13 },
|
|
113
|
+
{ name: "14kg", abbreviation: 'kg', value: 14 },
|
|
114
|
+
{ name: "15kg", abbreviation: 'kg', value: 15 },
|
|
115
|
+
{ name: "16kg", abbreviation: 'kg', value: 16 },
|
|
116
|
+
{ name: "17kg", abbreviation: 'kg', value: 17 },
|
|
117
|
+
{ name: "18kg", abbreviation: 'kg', value: 18 },
|
|
118
|
+
{ name: "20kg", abbreviation: 'kg', value: 20 },
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const pnFindServiceAndPriceCss = "pn-find-service-and-price h2,pn-find-service-and-price .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-find-service-and-price .postagetypes,pn-find-service-and-price .deliveryscope{text-align:center;margin-bottom:3rem}pn-find-service-and-price .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-find-service-and-price .weightoption-input{width:5em;position:relative}pn-find-service-and-price .weightoption-input input::-webkit-outer-spin-button,pn-find-service-and-price .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-find-service-and-price .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:0.75em;font-weight:500}pn-find-service-and-price .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-find-service-and-price .weightoption-range input{width:calc(100% - 1.5em)}pn-find-service-and-price .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-find-service-and-price .resultlist{margin:3em 0}";
|
|
123
|
+
|
|
124
|
+
const PnfindServiceAndPrice = class {
|
|
125
|
+
constructor(hostRef) {
|
|
126
|
+
index.registerInstance(this, hostRef);
|
|
127
|
+
this.source = "https://com-integration.postnord.com/globalassets/global/prices/sv-se-findprice.xlsx";
|
|
128
|
+
this.language = "sv";
|
|
129
|
+
this.market = "se";
|
|
130
|
+
this.filteredItems = [];
|
|
131
|
+
this.postagetype = { value: "", name: "", icon: "" };
|
|
132
|
+
this.weight = { value: 0, name: "" };
|
|
133
|
+
this.weightvalue = 0;
|
|
134
|
+
this.deliveryscope = { value: "", name: "", icon: "" };
|
|
135
|
+
this.sourceData = { types: [], data: [] };
|
|
136
|
+
}
|
|
137
|
+
componentWillLoad() {
|
|
138
|
+
this.setState();
|
|
139
|
+
this.getDataSource();
|
|
140
|
+
window.setTimeout(() => {
|
|
141
|
+
this.postagetype = postagetypes[1];
|
|
142
|
+
this.deliveryscope = deliveryscopes[this.postagetype.value][0];
|
|
143
|
+
this.weight = weights[this.postagetype.value][0];
|
|
144
|
+
this.weightvalue = this.weight.value;
|
|
145
|
+
}, 500);
|
|
146
|
+
// this.filterItems();
|
|
147
|
+
}
|
|
148
|
+
async getDataSource() {
|
|
149
|
+
const req = await fetch(this.source);
|
|
150
|
+
const reqbody = await req.blob();
|
|
151
|
+
try {
|
|
152
|
+
const convertedData = await convert.convertFileFromStream(reqbody);
|
|
153
|
+
this.sourceData = convertedData;
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
console.log('Unable to parse data');
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
setState() {
|
|
160
|
+
if (this.market) {
|
|
161
|
+
pnFindServiceAndPriceStore.state.market = markets[this.market];
|
|
162
|
+
}
|
|
163
|
+
if (this.language && translations[this.language]) {
|
|
164
|
+
pnFindServiceAndPriceStore.state.i18n = translations[this.language];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
filterItems() {
|
|
168
|
+
var _a;
|
|
169
|
+
// this.debug = `Postagetype: ${this.postagetype.value}. <br/>Weight: ${ this.weight.value }`;
|
|
170
|
+
if (!((_a = this.sourceData) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
171
|
+
console.log('Data has not yet been loaded');
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (!this.postagetype) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const typeData = this.sourceData.data.filter((x) => x.what === this.postagetype.value);
|
|
178
|
+
if (!this.deliveryscope) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const deliveryScopeData = typeData.filter((x) => x.deliveryscope === this.deliveryscope.value);
|
|
182
|
+
if (!this.weight || !this.weight.value) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
// For letters we use grams. Otherwise we use KG
|
|
186
|
+
const comparisonWeight = (this.weight.abbreviation.toLocaleLowerCase() === "kg" && this.postagetype.value === 'letter') ? this.weight.value * 1000 : this.weight.value;
|
|
187
|
+
let weightData = deliveryScopeData.filter(x => x.maxweight === comparisonWeight);
|
|
188
|
+
// In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value
|
|
189
|
+
if (weightData.length === 0) {
|
|
190
|
+
weightData = deliveryScopeData.filter(x => x.maxweight >= comparisonWeight);
|
|
191
|
+
if (weightData.length > 0) {
|
|
192
|
+
// We reverse the result array since the map will take the last unique item instead of the first
|
|
193
|
+
const uniqueWeightOptions = [...new Map(weightData.reverse().map(item => [item["id"], item])).values()];
|
|
194
|
+
if (uniqueWeightOptions.length > 0) {
|
|
195
|
+
weightData = uniqueWeightOptions;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
this.filteredItems = weightData;
|
|
200
|
+
}
|
|
201
|
+
render() {
|
|
202
|
+
return (index.h("div", null, index.h("div", { class: "form" }, (pnFindServiceAndPriceStore.state.i18n.componentheading) ? (index.h("h2", null, pnFindServiceAndPriceStore.state.i18n.componentheading)) : null, index.h("div", { class: "postagetypes" }, postagetypes.map((postagetype) => (index.h("pn-choice-button", { choiceid: postagetype.value, value: postagetype.value, name: "postagetype", type: "radio", checked: postagetype.value === this.postagetype.value, onChange: () => {
|
|
203
|
+
this.postagetype = postagetypes.filter(x => x.value === postagetype.value)[0];
|
|
204
|
+
this.weight = weights[this.postagetype.value][0];
|
|
205
|
+
this.weightvalue = this.weight.value;
|
|
206
|
+
} }, index.h("pn-illustration", { illustration: postagetype.illustration }), " ", postagetype.name)))), this.postagetype.value && deliveryscopes[this.postagetype.value] ? (index.h("div", null, (pnFindServiceAndPriceStore.state.i18n.deliveryscopeheading) ? (index.h("div", { class: "heading" }, pnFindServiceAndPriceStore.state.i18n.deliveryscopeheading)) : null, index.h("div", { class: "deliveryscope" }, deliveryscopes[this.postagetype.value].map((deliveryscope) => (index.h("pn-choice-button", { choiceid: this.postagetype.value + deliveryscope.value, value: deliveryscope.value, name: "deliveryscope", type: "radio", checked: deliveryscope.value === this.deliveryscope.value, onChange: () => {
|
|
207
|
+
this.deliveryscope = deliveryscopes[this.postagetype.value].filter(x => x.value === deliveryscope.value)[0];
|
|
208
|
+
} }, index.h("pn-illustration", { illustration: deliveryscope.illustration }), " ", deliveryscope.name)))))) : null, (this.postagetype.value && weights[this.postagetype.value] && this.deliveryscope.value) ? (index.h("div", null, (pnFindServiceAndPriceStore.state.i18n.sizeheading) ? (index.h("div", { class: "heading" }, pnFindServiceAndPriceStore.state.i18n.sizeheading)) : null, index.h("div", { class: "weightoption" }, index.h("div", { class: "weightoption-input" }, index.h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: pnFindServiceAndPriceStore.state.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
|
|
209
|
+
if (e && e.target && e.target.value) {
|
|
210
|
+
const weightNum = parseInt(e.target.value, 10);
|
|
211
|
+
if (!isNaN(weightNum)) {
|
|
212
|
+
let matchingWeights = weights[this.postagetype.value].filter((x) => {
|
|
213
|
+
let weightInGrams = (x.abbreviation === "kg") ? x.value * 1000 : x.value;
|
|
214
|
+
return weightInGrams >= weightNum;
|
|
215
|
+
});
|
|
216
|
+
if (matchingWeights && matchingWeights.length > 0) {
|
|
217
|
+
this.weight = matchingWeights[0];
|
|
218
|
+
this.weightvalue = this.weight.value;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
} }), index.h("span", { class: "weightoption-input-abbreviation" }, this.weight.abbreviation)), index.h("div", { class: "weightoption-range" }, index.h("input", { type: "range", id: "weightrange", name: "weightrange", list: "weightlist", value: (!this.weight.value) ? 0 : weights[this.postagetype.value].findIndex((x) => x.value === this.weightvalue), onChange: (e) => {
|
|
223
|
+
const value = e.target.value;
|
|
224
|
+
this.weight = weights[this.postagetype.value][value];
|
|
225
|
+
this.weightvalue = this.weight.value;
|
|
226
|
+
}, min: "0",
|
|
227
|
+
// max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }
|
|
228
|
+
max: weights[this.postagetype.value].length - 1 }), index.h("datalist", { id: "weightlist" }, weights[this.postagetype.value].map((weight, weightindex) => {
|
|
229
|
+
let labelText = weight.name;
|
|
230
|
+
if (weights[this.postagetype.value].length > 6) {
|
|
231
|
+
labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1) ? weight.name : '';
|
|
232
|
+
}
|
|
233
|
+
return (index.h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {}))));
|
|
234
|
+
})))))) : null), (this.filteredItems) ? (index.h("div", { class: "resultlist" }, (pnFindServiceAndPriceStore.state.i18n.resultlistheading) ? (index.h("div", { class: "heading" }, pnFindServiceAndPriceStore.state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (index.h("div", null, index.h("pn-find-service-and-price-result", { item: item })))))) : null));
|
|
235
|
+
}
|
|
236
|
+
static get watchers() { return {
|
|
237
|
+
"market": ["setState"],
|
|
238
|
+
"language": ["setState"],
|
|
239
|
+
"postagetype": ["filterItems"],
|
|
240
|
+
"deliveryscope": ["filterItems"],
|
|
241
|
+
"weightvalue": ["filterItems"]
|
|
242
|
+
}; }
|
|
243
|
+
};
|
|
244
|
+
PnfindServiceAndPrice.style = pnFindServiceAndPriceCss;
|
|
245
|
+
|
|
246
|
+
exports.pn_find_service_and_price = PnfindServiceAndPrice;
|