@postnord/pn-marketweb-components 2.0.3-beta6 → 2.0.6-beta1
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/{pn-find-price-store-345037e9.js → data-b9e6d752.js} +1 -27
- package/cjs/data-e77c1ada.js +41 -0
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-find-price-result.cjs.entry.js +6 -3
- package/cjs/{pn-product-pricelist-store-86310b5a.js → pn-find-price-store-63671327.js} +10 -3
- package/cjs/pn-find-price.cjs.entry.js +26 -13
- package/cjs/pn-find-service-and-price-result.cjs.entry.js +14 -13
- package/cjs/pn-language-selector_9.cjs.entry.js +1 -1
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-product-card_3.cjs.entry.js +1 -1
- package/cjs/pn-product-pricelist-result.cjs.entry.js +58 -17
- package/cjs/pn-product-pricelist.cjs.entry.js +46 -61
- package/cjs/{pn-product-tile_3.cjs.entry.js → pn-product-tile-info_2.cjs.entry.js} +0 -13
- package/cjs/pn-product-tile.cjs.entry.js +19 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search.css +3 -0
- package/collection/components/widgets/pn-find-price/data.js +2 -4
- package/collection/components/widgets/pn-find-price/find-price.stories.js +2 -2
- package/collection/components/widgets/pn-find-price/pn-find-price-result.js +13 -10
- package/collection/components/widgets/pn-find-price/pn-find-price-store.js +3 -1
- package/collection/components/widgets/pn-find-price/pn-find-price-translations.js +14 -3
- package/collection/components/widgets/pn-find-price/pn-find-price.css +1 -1
- package/collection/components/widgets/pn-find-price/pn-find-price.js +4 -3
- package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.js +14 -15
- package/collection/components/widgets/pn-product-card/pn-product-card-price.js +19 -2
- package/collection/components/widgets/pn-product-pricelist/data.js +8 -1
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-result.js +93 -24
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.js +30 -14
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.css +4 -3
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.js +5 -5
- package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.stories.js +4 -4
- package/custom-elements/index.js +140 -79
- package/esm/data-108a2820.js +37 -0
- package/esm/{pn-find-price-store-cb8e4714.js → data-8e7bd46e.js} +2 -26
- package/esm/loader.js +1 -1
- package/esm/pn-find-price-result.entry.js +6 -3
- package/esm/{pn-product-pricelist-store-2c336043.js → pn-find-price-store-55b65ec0.js} +10 -3
- package/esm/pn-find-price.entry.js +20 -7
- package/esm/pn-find-service-and-price-result.entry.js +14 -13
- package/esm/pn-language-selector_9.entry.js +1 -1
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-product-card_3.entry.js +1 -1
- package/esm/pn-product-pricelist-result.entry.js +56 -15
- package/esm/pn-product-pricelist.entry.js +36 -51
- package/esm/pn-product-tile-info_2.entry.js +31 -0
- package/esm/{pn-product-tile_3.entry.js → pn-product-tile.entry.js} +1 -29
- package/esm-es5/data-108a2820.js +1 -0
- package/esm-es5/data-8e7bd46e.js +1 -0
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-find-price-result.entry.js +1 -1
- package/esm-es5/pn-find-price-store-55b65ec0.js +1 -0
- package/esm-es5/pn-find-price.entry.js +1 -1
- package/esm-es5/pn-find-service-and-price-result.entry.js +1 -1
- package/esm-es5/pn-language-selector_9.entry.js +1 -1
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-product-card_3.entry.js +1 -1
- package/esm-es5/pn-product-pricelist-result.entry.js +1 -1
- package/esm-es5/pn-product-pricelist.entry.js +1 -1
- package/esm-es5/pn-product-tile-info_2.entry.js +1 -0
- package/esm-es5/{pn-product-tile_3.entry.js → pn-product-tile.entry.js} +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/{p-d55dbea8.system.entry.js → p-01a615ef.system.entry.js} +1 -1
- package/pn-market-web-components/p-1ecf47ed.entry.js +1 -0
- package/pn-market-web-components/p-23902611.system.entry.js +1 -0
- package/pn-market-web-components/p-28db6d9f.entry.js +1 -0
- package/pn-market-web-components/p-290d5824.system.entry.js +1 -0
- package/pn-market-web-components/p-29b8041d.entry.js +1 -0
- package/pn-market-web-components/p-4d584dca.system.entry.js +1 -0
- package/pn-market-web-components/p-4e9a272d.js +1 -0
- package/pn-market-web-components/{p-d58e3078.entry.js → p-51fc5bc4.entry.js} +1 -1
- package/pn-market-web-components/p-606ab75d.system.entry.js +1 -0
- package/pn-market-web-components/p-61dbe832.entry.js +1 -0
- package/pn-market-web-components/p-67887512.system.js +1 -1
- package/pn-market-web-components/p-6f556e76.system.entry.js +1 -0
- package/pn-market-web-components/p-8117b79e.system.entry.js +1 -0
- package/pn-market-web-components/p-8e146205.entry.js +1 -0
- package/pn-market-web-components/p-9a8dba33.entry.js +1 -0
- package/pn-market-web-components/p-a7421a8e.system.js +1 -0
- package/pn-market-web-components/p-a921d3fd.system.entry.js +1 -0
- package/pn-market-web-components/p-bf7cc19d.system.js +1 -0
- package/pn-market-web-components/p-d0155ddf.entry.js +1 -0
- package/pn-market-web-components/p-d94d8879.js +1 -0
- package/pn-market-web-components/{p-3120f5c4.entry.js → p-dc869f2f.entry.js} +1 -1
- package/pn-market-web-components/{p-83baf538.system.entry.js → p-e89a9e79.system.entry.js} +1 -1
- package/pn-market-web-components/p-f6fa6caa.system.js +1 -0
- package/pn-market-web-components/p-f9586bef.js +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/widgets/pn-find-price/pn-find-price-result.d.ts +4 -3
- package/types/components/widgets/pn-find-price/pn-find-price-store.d.ts +4 -0
- package/types/components/widgets/pn-find-price/pn-find-price-translations.d.ts +11 -0
- package/types/components/widgets/pn-find-price/pn-find-price-types.d.ts +4 -2
- package/types/components/widgets/pn-find-price/pn-find-price.d.ts +2 -2
- package/types/components/widgets/pn-product-card/pn-product-card-price.d.ts +1 -0
- package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-result.d.ts +2 -0
- package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.d.ts +26 -10
- package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-types.d.ts +2 -0
- package/types/components.d.ts +12 -6
- package/types/globals/shared/productprice/product-price-types.d.ts +5 -2
- package/umd/pn-marketweb-inject.js +0 -2
- package/esm-es5/pn-find-price-store-cb8e4714.js +0 -1
- package/esm-es5/pn-product-pricelist-store-2c336043.js +0 -1
- package/pn-market-web-components/p-045a349a.entry.js +0 -1
- package/pn-market-web-components/p-10b95894.entry.js +0 -1
- package/pn-market-web-components/p-20c72142.entry.js +0 -1
- package/pn-market-web-components/p-43dd4b37.system.js +0 -1
- package/pn-market-web-components/p-7b93d570.system.entry.js +0 -1
- package/pn-market-web-components/p-86b271f4.entry.js +0 -1
- package/pn-market-web-components/p-9e8c5793.system.entry.js +0 -1
- package/pn-market-web-components/p-a5bc1695.system.js +0 -1
- package/pn-market-web-components/p-adc8d9ab.js +0 -1
- package/pn-market-web-components/p-ae2bd55f.js +0 -1
- package/pn-market-web-components/p-aeb26d10.system.entry.js +0 -1
- package/pn-market-web-components/p-af800e0e.system.entry.js +0 -1
- package/pn-market-web-components/p-c90b8645.system.entry.js +0 -1
- package/pn-market-web-components/p-d46d9b6e.system.entry.js +0 -1
- package/pn-market-web-components/p-e056d2c6.entry.js +0 -1
- package/pn-market-web-components/p-f1c06bc8.entry.js +0 -1
|
@@ -3,48 +3,65 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-e3e27c79.js');
|
|
6
|
+
const data = require('./data-e77c1ada.js');
|
|
6
7
|
const convert = require('./convert-362ef5e6.js');
|
|
7
|
-
const
|
|
8
|
+
const pnFindPriceStore = require('./pn-find-price-store-63671327.js');
|
|
8
9
|
require('./index-28bbc937.js');
|
|
9
10
|
|
|
10
11
|
const translations = {
|
|
11
12
|
'sv': {
|
|
12
|
-
'
|
|
13
|
+
'componentheading': 'Våra priser och villkor för inrikesförsändelser för dig som direktbetalande kund?',
|
|
14
|
+
'deliveryscopeheading': 'Endast leveranser inom Sverige',
|
|
15
|
+
'resultlistheading': 'Några bra alternativ för dig',
|
|
13
16
|
'weightlabel': 'Vikt',
|
|
17
|
+
'maxweightlabel': 'Maxvikt',
|
|
14
18
|
'maxmeasurementlabel': 'Maxvolym',
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
19
|
+
'senddirectcta': 'Köp online',
|
|
20
|
+
'stampshopcta': 'Köp frimärken',
|
|
21
|
+
'message': '*Vid köp hos valfritt ombud',
|
|
22
|
+
'servicePointHeader': 'Eller hitta närmaste serviceställe',
|
|
23
|
+
'servicePointLink': 'Sök serviceställe eller brevlåda'
|
|
18
24
|
},
|
|
19
25
|
'en': {
|
|
20
|
-
'
|
|
26
|
+
'componentheading': 'Our prices and terms and conditions for domestic shipments for you as a direct paying customer',
|
|
27
|
+
'deliveryscopeheading': 'Deliveries within Sweden only',
|
|
28
|
+
'resultlistheading': 'Some suitable options for you',
|
|
21
29
|
'weightlabel': 'Weight',
|
|
30
|
+
'maxweightlabel': 'Max weight',
|
|
22
31
|
'maxmeasurementlabel': 'Maximum measurement',
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
32
|
+
'senddirectcta': 'Buy Online',
|
|
33
|
+
'stampshopcta': 'Buy Stamps',
|
|
34
|
+
'message': 'When buying from any agent',
|
|
35
|
+
'servicePointHeader': 'Or find nearest service point',
|
|
36
|
+
'servicePointLink': 'Search letter-box or service point'
|
|
26
37
|
},
|
|
27
38
|
'da': {
|
|
28
|
-
'
|
|
39
|
+
'componentheading': 'Vad vill du skicka?',
|
|
40
|
+
'deliveryscopeheading': 'Kun leveringer indenfor Sverige',
|
|
41
|
+
'resultlistheading': 'Some suitable options for you',
|
|
29
42
|
'weightlabel': 'Vægt',
|
|
43
|
+
'maxweightlabel': 'Max vægt',
|
|
30
44
|
'maxmeasurementlabel': 'Maks. Volumen',
|
|
31
|
-
'sizeheading': 'How much does it weigh?',
|
|
32
45
|
'senddirectcta': 'Buy shipping in Send Direct',
|
|
33
46
|
'stampshopcta': 'Order home stamps from the webshop',
|
|
34
47
|
},
|
|
35
48
|
'no': {
|
|
36
|
-
'
|
|
49
|
+
'componentheading': 'Vad vill du skicka?',
|
|
50
|
+
'deliveryscopeheading': 'Kun leveranser innen Sverige',
|
|
51
|
+
'resultlistheading': 'Some suitable options for you',
|
|
37
52
|
'weightlabel': 'Vekt',
|
|
53
|
+
'maxweightlabel': 'Maks vekt',
|
|
38
54
|
'maxmeasurementlabel': 'Maks volum',
|
|
39
|
-
'sizeheading': 'How much does it weigh?',
|
|
40
55
|
'senddirectcta': 'Buy shipping in Send Direct',
|
|
41
56
|
'stampshopcta': 'Order home stamps from the webshop',
|
|
42
57
|
},
|
|
43
58
|
'fi': {
|
|
59
|
+
'componentheading': 'Vad vill du skicka?',
|
|
60
|
+
'deliveryscopeheading': 'Toimitukset vain Ruotsin sisällä',
|
|
61
|
+
'resultlistheading': 'Some suitable options for you',
|
|
62
|
+
'weightlabel': 'Paino',
|
|
44
63
|
'maxweightlabel': 'Max paino',
|
|
45
|
-
'weightlabel': 'Piano',
|
|
46
64
|
'maxmeasurementlabel': 'Max äänenvoimakkuus',
|
|
47
|
-
'sizeheading': 'How much does it weigh?',
|
|
48
65
|
'senddirectcta': 'Buy shipping in Send Direct',
|
|
49
66
|
'stampshopcta': 'Order home stamps from the webshop',
|
|
50
67
|
}
|
|
@@ -64,44 +81,12 @@ const markets = {
|
|
|
64
81
|
}
|
|
65
82
|
};
|
|
66
83
|
|
|
67
|
-
const
|
|
68
|
-
"letter": [
|
|
69
|
-
{ name: "50g", abbreviation: 'g', value: 50 },
|
|
70
|
-
{ name: "100g", abbreviation: 'g', value: 100 },
|
|
71
|
-
{ name: "250g", abbreviation: 'g', value: 250 },
|
|
72
|
-
{ name: "500g", abbreviation: 'g', value: 500 },
|
|
73
|
-
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
74
|
-
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
75
|
-
],
|
|
76
|
-
"parcel": [
|
|
77
|
-
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
78
|
-
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
79
|
-
{ name: "3kg", abbreviation: 'kg', value: 3 },
|
|
80
|
-
{ name: "4kg", abbreviation: 'kg', value: 4 },
|
|
81
|
-
{ name: "5kg", abbreviation: 'kg', value: 5 },
|
|
82
|
-
{ name: "6kg", abbreviation: 'kg', value: 6 },
|
|
83
|
-
{ name: "7Kg", abbreviation: 'kg', value: 7 },
|
|
84
|
-
{ name: "8kg", abbreviation: 'kg', value: 8 },
|
|
85
|
-
{ name: "9kg", abbreviation: 'kg', value: 9 },
|
|
86
|
-
{ name: "10kg", abbreviation: 'kg', value: 10 },
|
|
87
|
-
{ name: "11kg", abbreviation: 'kg', value: 11 },
|
|
88
|
-
{ name: "12kg", abbreviation: 'kg', value: 12 },
|
|
89
|
-
{ name: "13kg", abbreviation: 'kg', value: 13 },
|
|
90
|
-
{ name: "14kg", abbreviation: 'kg', value: 14 },
|
|
91
|
-
{ name: "15kg", abbreviation: 'kg', value: 15 },
|
|
92
|
-
{ name: "16kg", abbreviation: 'kg', value: 16 },
|
|
93
|
-
{ name: "17kg", abbreviation: 'kg', value: 17 },
|
|
94
|
-
{ name: "18kg", abbreviation: 'kg', value: 18 },
|
|
95
|
-
{ name: "20kg", abbreviation: 'kg', value: 20 },
|
|
96
|
-
]
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const pnProductPricelistCss = "pn-product-pricelist pn-spinner{margin:1em auto}pn-product-pricelist h2,pn-product-pricelist .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-product-pricelist .content,pn-product-pricelist .weightselection{max-width:50em;margin:0 auto 1em}pn-product-pricelist .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-product-pricelist .weightoption-input{width:5em;position:relative;display:none}pn-product-pricelist .weightoption-input input::-webkit-outer-spin-button,pn-product-pricelist .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-product-pricelist .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:1.55rem;font-weight:500}pn-product-pricelist .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-product-pricelist .weightoption-range input{width:calc(100% - 1.5em)}pn-product-pricelist .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-product-pricelist .resultlist:not([data-list-count=\"0\"]){margin-top:2em}";
|
|
84
|
+
const pnProductPricelistCss = "pn-product-pricelist pn-spinner{margin:1em auto}pn-product-pricelist h2,pn-product-pricelist .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-product-pricelist .content,pn-product-pricelist .weightselection,pn-product-pricelist .resultlist{max-width:50em;margin:0 auto 1.6rem}pn-product-pricelist .weightoption{display:-ms-flexbox;display:flex;gap:1.6rem}pn-product-pricelist .weightoption-input{width:5em;position:relative;display:none}pn-product-pricelist .weightoption-input input::-webkit-outer-spin-button,pn-product-pricelist .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-product-pricelist .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:1.55rem;font-weight:500}pn-product-pricelist .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-product-pricelist .weightoption-range input{width:calc(100% - 1.5em)}pn-product-pricelist .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-product-pricelist .resultlist:not([data-list-count=\"0\"]){margin-top:2em}";
|
|
100
85
|
|
|
101
86
|
let PnFindProductPricelist = class {
|
|
102
87
|
constructor(hostRef) {
|
|
103
88
|
index.registerInstance(this, hostRef);
|
|
104
|
-
this.source = "https://com-integration.postnord.com/globalassets/global/prices/sv-
|
|
89
|
+
this.source = "https://com-integration.postnord.com/globalassets/global/prices/sv-findprice-1-PN.xlsx";
|
|
105
90
|
this.language = "sv";
|
|
106
91
|
this.market = "se";
|
|
107
92
|
this.productid = "";
|
|
@@ -119,10 +104,10 @@ let PnFindProductPricelist = class {
|
|
|
119
104
|
}
|
|
120
105
|
setState() {
|
|
121
106
|
if (this.market) {
|
|
122
|
-
|
|
107
|
+
pnFindPriceStore.state.market = markets[this.market];
|
|
123
108
|
}
|
|
124
109
|
if (this.language && translations[this.language]) {
|
|
125
|
-
|
|
110
|
+
pnFindPriceStore.state.i18n = translations[this.language];
|
|
126
111
|
}
|
|
127
112
|
}
|
|
128
113
|
async getDataSource() {
|
|
@@ -155,11 +140,11 @@ let PnFindProductPricelist = class {
|
|
|
155
140
|
return;
|
|
156
141
|
}
|
|
157
142
|
this.postagetype.value = productIdItems[0].what;
|
|
158
|
-
if (!weights[this.postagetype.value] || weights[this.postagetype.value].length === 0) {
|
|
143
|
+
if (!data.weights[this.postagetype.value] || data.weights[this.postagetype.value].length === 0) {
|
|
159
144
|
return;
|
|
160
145
|
}
|
|
161
146
|
if (this.weightvalue === 0) {
|
|
162
|
-
this.weight = weights[this.postagetype.value][0];
|
|
147
|
+
this.weight = data.weights[this.postagetype.value][0];
|
|
163
148
|
this.weightvalue = this.weight.value;
|
|
164
149
|
}
|
|
165
150
|
// For letters we use grams. Otherwise we use KG
|
|
@@ -180,11 +165,11 @@ let PnFindProductPricelist = class {
|
|
|
180
165
|
this.gotData = this.filteredItems.length > 0;
|
|
181
166
|
}
|
|
182
167
|
render() {
|
|
183
|
-
return (index.h(index.Host, null, index.h("div", { class: "content" }, index.h("slot", null)), this.loading ? (index.h("pn-spinner", null)) : null, (this.postagetype.value && weights[this.postagetype.value]) ? (index.h("div", { class: "weightselection" },
|
|
168
|
+
return (index.h(index.Host, null, index.h("div", { class: "content" }, index.h("slot", null)), this.loading ? (index.h("pn-spinner", null)) : null, (this.postagetype.value && data.weights[this.postagetype.value]) ? (index.h("div", { class: "weightselection" }, index.h("div", { class: "weightoption" }, index.h("div", { class: "weightoption-input" }, index.h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: pnFindPriceStore.state.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
|
|
184
169
|
if (e && e.target && e.target.value) {
|
|
185
170
|
const weightNum = parseInt(e.target.value, 10);
|
|
186
171
|
if (!isNaN(weightNum)) {
|
|
187
|
-
let matchingWeights = weights[this.postagetype.value].filter((x) => {
|
|
172
|
+
let matchingWeights = data.weights[this.postagetype.value].filter((x) => {
|
|
188
173
|
let weightInGrams = (x.abbreviation === "kg") ? x.value * 1000 : x.value;
|
|
189
174
|
return weightInGrams >= weightNum;
|
|
190
175
|
});
|
|
@@ -194,19 +179,19 @@ let PnFindProductPricelist = class {
|
|
|
194
179
|
}
|
|
195
180
|
}
|
|
196
181
|
}
|
|
197
|
-
} }), 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) => {
|
|
182
|
+
} }), 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 : data.weights[this.postagetype.value].findIndex((x) => x.value === this.weightvalue), onChange: (e) => {
|
|
198
183
|
const value = e.target.value;
|
|
199
|
-
this.weight = weights[this.postagetype.value][value];
|
|
184
|
+
this.weight = data.weights[this.postagetype.value][value];
|
|
200
185
|
this.weightvalue = this.weight.value;
|
|
201
186
|
}, min: "0",
|
|
202
187
|
// max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }
|
|
203
|
-
max: weights[this.postagetype.value].length - 1 }), index.h("datalist", { id: "weightlist" }, weights[this.postagetype.value].map((weight, weightindex) => {
|
|
188
|
+
max: data.weights[this.postagetype.value].length - 1 }), index.h("datalist", { id: "weightlist" }, data.weights[this.postagetype.value].map((weight, weightindex) => {
|
|
204
189
|
let labelText = weight.name;
|
|
205
|
-
if (weights[this.postagetype.value].length > 6) {
|
|
206
|
-
labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1) ? weight.name : '';
|
|
190
|
+
if (data.weights[this.postagetype.value].length > 6) {
|
|
191
|
+
labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === data.weights[this.postagetype.value].length - 1) ? weight.name : '';
|
|
207
192
|
}
|
|
208
193
|
return (index.h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {}))));
|
|
209
|
-
})))))) : null, index.h("div", { class: "resultlist", "data-list-count": this.filteredItems.length }, this.filteredItems.map((item) => (index.h("div", null, index.h("pn-
|
|
194
|
+
})))))) : null, index.h("div", { class: "resultlist", "data-list-count": this.filteredItems.length }, this.filteredItems.map((item) => (index.h("div", null, index.h("pn-find-price-result", { item: item })))))));
|
|
210
195
|
}
|
|
211
196
|
static get watchers() { return {
|
|
212
197
|
"market": ["setState"],
|
|
@@ -4,18 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-e3e27c79.js');
|
|
6
6
|
|
|
7
|
-
const pnProductTileCss = "pn-product-tile{margin-bottom:1em;border:0.1rem solid #D3CECB;outline:none;background:white;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);display:-ms-flexbox;display:flex;padding:1.5em;word-break:break-word;text-decoration:none;border-radius:0.8rem}pn-product-tile [slot=content] h3{display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:0.5em}pn-product-tile>pn-illustration{min-width:8rem;width:8rem;height:8rem;margin-right:3rem;-ms-flex-item-align:center;align-self:center}pn-product-tile .tilecontent{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;-ms-flex-positive:1;flex-grow:1}pn-product-tile .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:100%}pn-product-tile .info{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-positive:1;flex-grow:1;max-width:66.6666666667%;-ms-flex-flow:wrap;flex-flow:wrap}pn-product-tile .info>*{min-width:6em;margin:0.2em 1em 0.2em 0}";
|
|
8
|
-
|
|
9
|
-
let PnProductTile = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
}
|
|
13
|
-
render() {
|
|
14
|
-
return (index.h(index.Host, null, index.h("slot", { name: "illustration" }), index.h("div", { class: "tilecontent" }, index.h("div", { class: "details" }, index.h("slot", { name: "content" }), index.h("div", { class: "info" }, index.h("slot", null)), index.h("slot", { name: "note" })), index.h("slot", { name: "price" }))));
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
PnProductTile.style = pnProductTileCss;
|
|
18
|
-
|
|
19
7
|
const pnProductTileInfoCss = "pn-product-tile-info{-ms-flex-item-align:center;align-self:center}";
|
|
20
8
|
|
|
21
9
|
let PnProductTileInfo = class {
|
|
@@ -44,6 +32,5 @@ let PnProductTilePrice = class {
|
|
|
44
32
|
};
|
|
45
33
|
PnProductTilePrice.style = pnProductTilePriceCss;
|
|
46
34
|
|
|
47
|
-
exports.pn_product_tile = PnProductTile;
|
|
48
35
|
exports.pn_product_tile_info = PnProductTileInfo;
|
|
49
36
|
exports.pn_product_tile_price = PnProductTilePrice;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e3e27c79.js');
|
|
6
|
+
|
|
7
|
+
const pnProductTileCss = "pn-product-tile{margin-bottom:1em;border:0.1rem solid #D3CECB;outline:none;background:white;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);display:-ms-flexbox;display:flex;padding:1.5em;word-break:break-word;text-decoration:none;border-radius:0.8rem}pn-product-tile [slot=content] h3{display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:0.5em}pn-product-tile>pn-illustration{min-width:8rem;width:8rem;height:8rem;margin-right:3rem;-ms-flex-item-align:center;align-self:center}pn-product-tile .tilecontent{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;-ms-flex-positive:1;flex-grow:1}pn-product-tile .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:100%}pn-product-tile .info{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-positive:1;flex-grow:1;max-width:66.6666666667%;-ms-flex-flow:wrap;flex-flow:wrap}pn-product-tile .info>*{min-width:6em;margin:0.2em 1em 0.2em 0}";
|
|
8
|
+
|
|
9
|
+
let PnProductTile = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (index.h(index.Host, null, index.h("slot", { name: "illustration" }), index.h("div", { class: "tilecontent" }, index.h("div", { class: "details" }, index.h("slot", { name: "content" }), index.h("div", { class: "info" }, index.h("slot", null)), index.h("slot", { name: "note" })), index.h("slot", { name: "price" }))));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
PnProductTile.style = pnProductTileCss;
|
|
18
|
+
|
|
19
|
+
exports.pn_product_tile = PnProductTile;
|
|
@@ -33,12 +33,10 @@ const weights = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
const fileLocation = "https://com-integration.postnord.com/globalassets/global/prices/
|
|
37
|
-
|
|
38
|
-
const servicePointUrl = "https://www.postnord.se/vara-verktyg/sok-brevlada-eller-servicestalle";
|
|
36
|
+
const fileLocation = "https://com-integration.postnord.com/globalassets/global/prices/dk-findprice.xlsx";
|
|
39
37
|
|
|
40
38
|
const sendDirectUrl = "https://portal.postnord.com/skickadirekt/";
|
|
41
39
|
|
|
42
40
|
const stampShopUrl = "https://shop.postnord.se/ebutik/default.aspx";
|
|
43
41
|
|
|
44
|
-
export { weights, sizeCategories, fileLocation,
|
|
42
|
+
export { weights, sizeCategories, fileLocation, sendDirectUrl, stampShopUrl };
|
|
@@ -8,6 +8,7 @@ export class PnfindPriceResult {
|
|
|
8
8
|
this.description = [];
|
|
9
9
|
this.showMeasurement = false;
|
|
10
10
|
this.weightText = "";
|
|
11
|
+
this.linkId = '';
|
|
11
12
|
}
|
|
12
13
|
componentWillLoad() {
|
|
13
14
|
this.composeItems();
|
|
@@ -23,9 +24,10 @@ export class PnfindPriceResult {
|
|
|
23
24
|
this.description = this.item.description.split("#bullet").filter(x => x !== "");
|
|
24
25
|
}
|
|
25
26
|
this.showMeasurement = (this.item.maxmått !== null) || (this.item.rulle !== null);
|
|
27
|
+
this.linkId = `${this.item.id}-${this.item.name.toLocaleLowerCase().replace(/[^a-zA-Z0-9]/g, '')}`;
|
|
26
28
|
}
|
|
27
29
|
render() {
|
|
28
|
-
return (h(Host, null, h("pn-product-card",
|
|
30
|
+
return (h(Host, null, h("pn-product-card", { "data-productid": this.item.id },
|
|
29
31
|
h("pn-illustration", { slot: "illustration", illustration: this.item.illustration }),
|
|
30
32
|
h("div", { slot: "title" },
|
|
31
33
|
h("h2", null,
|
|
@@ -51,8 +53,8 @@ export class PnfindPriceResult {
|
|
|
51
53
|
this.Usp3 ? (h("span", null, this.Usp3)) : null)) : null,
|
|
52
54
|
this.showMeasurement ? (h("pn-product-card-info", { paket: this.item.maxmått, rulle: this.item.rulle })) : null,
|
|
53
55
|
h("div", { slot: "cardprice" },
|
|
54
|
-
this.item.pricesenddirect ? (h("pn-product-card-price", { slot: "sendDirectPrice", label: state.i18n.senddirectcta, amount: this.item.pricesenddirect + '', currency: state.market.currency, url: sendDirectUrl,
|
|
55
|
-
this.item.pricestamps ? (h("pn-product-card-price", { slot: "stampPrice", label: state.i18n.stampshopcta, amount: this.item.pricestamps + '', currency: state.market.currency, url: stampShopUrl,
|
|
56
|
+
this.item.pricesenddirect ? (h("pn-product-card-price", { slot: "sendDirectPrice", label: state.i18n.senddirectcta, amount: this.item.pricesenddirect + '', currency: state.market.currency, url: sendDirectUrl, linkid: this.linkId + '-portal' })) : null,
|
|
57
|
+
this.item.pricestamps ? (h("pn-product-card-price", { slot: "stampPrice", label: state.i18n.stampshopcta, amount: this.item.pricestamps + '', currency: state.market.currency, url: stampShopUrl, linkid: this.linkId + '-stampshop' })) : null))));
|
|
56
58
|
}
|
|
57
59
|
static get is() { return "pn-find-price-result"; }
|
|
58
60
|
static get originalStyleUrls() { return {
|
|
@@ -66,10 +68,10 @@ export class PnfindPriceResult {
|
|
|
66
68
|
"type": "unknown",
|
|
67
69
|
"mutable": true,
|
|
68
70
|
"complexType": {
|
|
69
|
-
"original": "
|
|
70
|
-
"resolved": "
|
|
71
|
+
"original": "ProductPriceItem",
|
|
72
|
+
"resolved": "ProductPriceItem",
|
|
71
73
|
"references": {
|
|
72
|
-
"
|
|
74
|
+
"ProductPriceItem": {
|
|
73
75
|
"location": "import",
|
|
74
76
|
"path": "./pn-find-price-types"
|
|
75
77
|
}
|
|
@@ -87,10 +89,10 @@ export class PnfindPriceResult {
|
|
|
87
89
|
"type": "unknown",
|
|
88
90
|
"mutable": false,
|
|
89
91
|
"complexType": {
|
|
90
|
-
"original": "
|
|
91
|
-
"resolved": "
|
|
92
|
+
"original": "ProductPriceItem[]",
|
|
93
|
+
"resolved": "ProductPriceItem[]",
|
|
92
94
|
"references": {
|
|
93
|
-
"
|
|
95
|
+
"ProductPriceItem": {
|
|
94
96
|
"location": "import",
|
|
95
97
|
"path": "./pn-find-price-types"
|
|
96
98
|
}
|
|
@@ -191,7 +193,8 @@ export class PnfindPriceResult {
|
|
|
191
193
|
}
|
|
192
194
|
}; }
|
|
193
195
|
static get states() { return {
|
|
194
|
-
"weightText": {}
|
|
196
|
+
"weightText": {},
|
|
197
|
+
"linkId": {}
|
|
195
198
|
}; }
|
|
196
199
|
static get watchers() { return [{
|
|
197
200
|
"propName": "item",
|
|
@@ -28,12 +28,15 @@ export const translations = {
|
|
|
28
28
|
'da': {
|
|
29
29
|
'componentheading': 'Vad vill du skicka?',
|
|
30
30
|
'deliveryscopeheading': 'Kun leveringer indenfor Sverige',
|
|
31
|
-
'resultlistheading': '
|
|
31
|
+
'resultlistheading': 'Nogle passende muligheder for dig',
|
|
32
32
|
'weightlabel': 'Vægt',
|
|
33
33
|
'maxweightlabel': 'Max vægt',
|
|
34
34
|
'maxmeasurementlabel': 'Maks. Volumen',
|
|
35
|
-
'senddirectcta': '
|
|
36
|
-
'stampshopcta': '
|
|
35
|
+
'senddirectcta': 'Køb Online',
|
|
36
|
+
'stampshopcta': 'Køb Frimærker',
|
|
37
|
+
'message': 'When buying from any agent',
|
|
38
|
+
'servicePointHeader': 'Eller find nærmeste servicested',
|
|
39
|
+
'servicePointLink': 'Søg i brevkasse eller servicepunkt'
|
|
37
40
|
},
|
|
38
41
|
'no': {
|
|
39
42
|
'componentheading': 'Vad vill du skicka?',
|
|
@@ -59,14 +62,22 @@ export const translations = {
|
|
|
59
62
|
export const markets = {
|
|
60
63
|
'se': {
|
|
61
64
|
"currency": "kr",
|
|
65
|
+
"country": "Sweden",
|
|
66
|
+
"servicePoint": "https://www.postnord.se/vara-verktyg/sok-brevlada-eller-servicestalle",
|
|
62
67
|
},
|
|
63
68
|
'dk': {
|
|
64
69
|
"currency": "dk",
|
|
70
|
+
"country": "Denmark",
|
|
71
|
+
"servicePoint": "https://www.postnord.dk/varktojer/find-os",
|
|
65
72
|
},
|
|
66
73
|
'fi': {
|
|
67
74
|
"currency": " €",
|
|
75
|
+
"country": "Finland",
|
|
76
|
+
"servicePoint": "",
|
|
68
77
|
},
|
|
69
78
|
'no': {
|
|
70
79
|
"currency": "kr",
|
|
80
|
+
"country": "Norway",
|
|
81
|
+
"servicePoint": "",
|
|
71
82
|
}
|
|
72
83
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component, h, Prop, State, Watch } from "@stencil/core";
|
|
2
2
|
import { translations, markets } from "./pn-find-price-translations";
|
|
3
|
-
import { weights, sizeCategories, fileLocation
|
|
3
|
+
import { weights, sizeCategories, fileLocation } from "./data.js";
|
|
4
4
|
import { convertFileForSizeCategogy } from "../../../globals/shared/productprice/convert.js";
|
|
5
5
|
import { state } from "./pn-find-price-store";
|
|
6
6
|
import small from "./img/small-package.svg";
|
|
@@ -52,7 +52,8 @@ export class PnfindPrice {
|
|
|
52
52
|
console.log('Data has not yet been loaded');
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
//to handle withing country search
|
|
56
|
+
const deliveryScopeData = this.sourceData.data.filter((x) => x.deliveryscope.toLocaleLowerCase() === state.market.country.toLocaleLowerCase());
|
|
56
57
|
if (!this.sizecategory) {
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
@@ -116,7 +117,7 @@ export class PnfindPrice {
|
|
|
116
117
|
h("div", { class: "servicePoint" },
|
|
117
118
|
h("pn-illustration", { illustration: "character-box-letters-house" }),
|
|
118
119
|
h("h3", null, state.i18n.servicePointHeader),
|
|
119
|
-
h("a", { href:
|
|
120
|
+
h("a", { href: state.market.servicePoint, target: "_blank" },
|
|
120
121
|
h("pn-icon", { symbol: "map-marker", color: "blue700" }),
|
|
121
122
|
state.i18n.servicePointLink)))) : null));
|
|
122
123
|
}
|
package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.js
CHANGED
|
@@ -10,22 +10,23 @@ export class PnfindServiceAndPriceResult {
|
|
|
10
10
|
this.composeItems();
|
|
11
11
|
}
|
|
12
12
|
composeItems() {
|
|
13
|
-
this.shownitems = [];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
13
|
+
this.shownitems = [this.item];
|
|
14
|
+
// this.shownitems = [];
|
|
15
|
+
// if (this.item.pricestamps) {
|
|
16
|
+
// this.shownitems.push({...this.item, priceagent: null, pricesenddirect: null});
|
|
17
|
+
// }
|
|
18
|
+
// if (this.item.priceagent) {
|
|
19
|
+
// this.shownitems.push({...this.item, pricestamps: null, pricesenddirect: null});
|
|
20
|
+
// }
|
|
21
|
+
// if (this.item.pricesenddirect) {
|
|
22
|
+
// this.shownitems.push({...this.item, pricestamps: null, priceagent: null});
|
|
23
|
+
// }
|
|
23
24
|
// Parcels are always in KG. Letter KG must be converted from grams
|
|
24
|
-
this.weightText = (this.item.what === "parcel") ? this.item.maxweight + 'kg' :
|
|
25
|
-
|
|
25
|
+
// this.weightText = (this.item.what === "parcel") ? this.item.maxweight + 'kg' :
|
|
26
|
+
// (this.item.what === "letter" && this.item.maxweight > 999) ? Math.round(this.item.maxweight/1000) + " kg" : this.item.maxweight + " g";
|
|
26
27
|
}
|
|
27
28
|
render() {
|
|
28
|
-
return (h(Host, null, this.shownitems.map((item) => (h("pn-product-
|
|
29
|
+
return (h(Host, null, this.shownitems.map((item) => (h("pn-product-card", null,
|
|
29
30
|
h("pn-illustration", { slot: "illustration", illustration: item.illustration }),
|
|
30
31
|
h("div", { slot: "content" },
|
|
31
32
|
h("div", { class: "content" },
|
|
@@ -33,9 +34,7 @@ export class PnfindServiceAndPriceResult {
|
|
|
33
34
|
(item.description) ? (h("div", { class: "description" }, item.description)) : null,
|
|
34
35
|
(item.info) ? (h("div", { class: "description" }, item.info)) : null)),
|
|
35
36
|
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
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
38
|
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
39
|
item.note ? (h("small", { slot: "note" },
|
|
41
40
|
h("p", null, item.note))) : null)))));
|
|
@@ -4,12 +4,12 @@ export class PnProductCardPrice {
|
|
|
4
4
|
if (!this.amount) {
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
7
|
-
return (this.url) ? (h(Host,
|
|
7
|
+
return (this.url) ? (h(Host, { id: this.linkid },
|
|
8
8
|
h("div", { class: "price" },
|
|
9
9
|
(this.amount) ? (h("span", null, this.amount)) : null,
|
|
10
10
|
(this.currency) ? (h("span", null, " " + this.currency)) : null),
|
|
11
11
|
(this.note) ? (h("p", null, this.note)) : null,
|
|
12
|
-
(this.label) ? (h("pn-button", { small: "true", icon: "open-in-new", appearance: "light", href: this.url, target: "_blank"
|
|
12
|
+
(this.label) ? (h("pn-button", { small: "true", icon: "open-in-new", appearance: "light", href: this.url, target: "_blank" }, this.label)) : null)) : (h(Host, null,
|
|
13
13
|
h("div", { class: "price" },
|
|
14
14
|
(this.amount) ? (h("span", null, this.amount)) : null,
|
|
15
15
|
(this.currency) ? (h("span", null, this.currency)) : null)));
|
|
@@ -123,6 +123,23 @@ export class PnProductCardPrice {
|
|
|
123
123
|
},
|
|
124
124
|
"attribute": "service",
|
|
125
125
|
"reflect": false
|
|
126
|
+
},
|
|
127
|
+
"linkid": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "string",
|
|
132
|
+
"resolved": "string",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": ""
|
|
140
|
+
},
|
|
141
|
+
"attribute": "linkid",
|
|
142
|
+
"reflect": false
|
|
126
143
|
}
|
|
127
144
|
}; }
|
|
128
145
|
}
|
|
@@ -48,6 +48,13 @@ const weights = {
|
|
|
48
48
|
]
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
const fileLocation = "https://com-integration.postnord.com/globalassets/global/prices/sv-findprice-1-PN.xlsx";
|
|
51
52
|
|
|
53
|
+
const servicePointUrl = "https://www.postnord.se/vara-verktyg/sok-brevlada-eller-servicestalle";
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
const sendDirectUrl = "https://portal.postnord.com/skickadirekt/";
|
|
56
|
+
|
|
57
|
+
const stampShopUrl = "https://shop.postnord.se/ebutik/default.aspx";
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export { postagetypes, weights, deliveryscopes, servicePointUrl, sendDirectUrl, stampShopUrl};
|