@postnord/pn-marketweb-components 2.4.8 → 2.4.9

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 (47) hide show
  1. package/cjs/loader.cjs.js +1 -1
  2. package/cjs/pn-market-web-components.cjs.js +1 -1
  3. package/cjs/pn-proxio-findprice-result.cjs.entry.js +41 -9
  4. package/cjs/pn-proxio-findprice.cjs.entry.js +58 -29
  5. package/cjs/pn-proxio-productcard_4.cjs.entry.js +1 -1
  6. package/collection/components/widgets/pn-proxio-findprice/find-price.stories.js +24 -0
  7. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.css +10 -6
  8. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.js +94 -8
  9. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-store.js +2 -1
  10. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-translations.js +15 -5
  11. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.css +56 -0
  12. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.js +78 -21
  13. package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard.js +1 -1
  14. package/components/pn-proxio-findprice-result2.js +44 -9
  15. package/components/pn-proxio-findprice.js +61 -29
  16. package/components/pn-proxio-productcard2.js +1 -1
  17. package/esm/loader.js +1 -1
  18. package/esm/pn-market-web-components.js +1 -1
  19. package/esm/pn-proxio-findprice-result.entry.js +41 -9
  20. package/esm/pn-proxio-findprice.entry.js +58 -29
  21. package/esm/pn-proxio-productcard_4.entry.js +1 -1
  22. package/esm-es5/loader.js +1 -1
  23. package/esm-es5/pn-market-web-components.js +1 -1
  24. package/esm-es5/pn-proxio-findprice-result.entry.js +1 -1
  25. package/esm-es5/pn-proxio-findprice.entry.js +1 -1
  26. package/esm-es5/pn-proxio-productcard_4.entry.js +1 -1
  27. package/package.json +1 -1
  28. package/pn-market-web-components/p-3afc3173.entry.js +1 -0
  29. package/pn-market-web-components/p-548b62a8.system.entry.js +1 -0
  30. package/pn-market-web-components/p-6b46c15c.entry.js +1 -0
  31. package/pn-market-web-components/{p-cccb53f2.system.entry.js → p-6eabccbc.system.entry.js} +1 -1
  32. package/pn-market-web-components/p-9271cf8e.entry.js +1 -0
  33. package/pn-market-web-components/p-d295ef71.system.js +1 -1
  34. package/pn-market-web-components/p-de823bdb.system.entry.js +1 -0
  35. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  36. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.d.ts +5 -0
  37. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-store.d.ts +2 -0
  38. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-translations.d.ts +10 -0
  39. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-types.d.ts +10 -0
  40. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice.d.ts +5 -0
  41. package/types/components/widgets/pn-proxio-pricegroup/types.d.ts +9 -0
  42. package/types/components.d.ts +10 -0
  43. package/pn-market-web-components/p-0ba1df3b.entry.js +0 -1
  44. package/pn-market-web-components/p-1d9de480.system.entry.js +0 -1
  45. package/pn-market-web-components/p-59024d31.entry.js +0 -1
  46. package/pn-market-web-components/p-97564852.entry.js +0 -1
  47. package/pn-market-web-components/p-ea4ec1db.system.entry.js +0 -1
@@ -10,6 +10,9 @@ export class PnProxioFindPriceResult {
10
10
  this.Usp3 = undefined;
11
11
  this.description = [];
12
12
  this.showMeasurement = false;
13
+ this.showInternational = false;
14
+ this.selectedCountrycode = "";
15
+ this.market = "";
13
16
  this.language = "sv";
14
17
  this.weightText = "";
15
18
  this.linkId = '';
@@ -25,13 +28,20 @@ export class PnProxioFindPriceResult {
25
28
  this.shownitems = [this.item];
26
29
  }
27
30
  getPriceString(product) {
28
- var _a;
29
- if (product.productWeightGroupList) {
30
- const activeIndex = product.productWeightGroupList.findIndex((item) => item.item1 === this.activeweight);
31
- let price = product.weightAndPriceList ? (_a = product === null || product === void 0 ? void 0 : product.weightAndPriceList[activeIndex]) === null || _a === void 0 ? void 0 : _a.item2 : '';
32
- return price ? this.i18n.from + price : '';
31
+ var _a, _b;
32
+ if (!product.productWeightGroupList) {
33
+ return null;
33
34
  }
34
- return null;
35
+ const activeIndex = product.productWeightGroupList.findIndex((item) => item.item1 === this.activeweight);
36
+ let price = '';
37
+ if (this.showInternational && this.selectedCountrycode && this.selectedCountrycode !== this.market && product.weightPriceCountryList) {
38
+ let weightPriceCountryList = product.weightPriceCountryList.filter(item => item.item3.includes(this.selectedCountrycode.toUpperCase()));
39
+ price = weightPriceCountryList ? (_a = weightPriceCountryList[activeIndex]) === null || _a === void 0 ? void 0 : _a.item2 : '';
40
+ }
41
+ else {
42
+ price = product.weightAndPriceList ? (_b = product === null || product === void 0 ? void 0 : product.weightAndPriceList[activeIndex]) === null || _b === void 0 ? void 0 : _b.item2 : '';
43
+ }
44
+ return price ? this.i18n.from + price : '';
35
45
  }
36
46
  getProductLink(product, productWeightGroupList) {
37
47
  var _a;
@@ -43,11 +53,33 @@ export class PnProxioFindPriceResult {
43
53
  }
44
54
  return null;
45
55
  }
56
+ getDeliveryInformation(product) {
57
+ var _a, _b;
58
+ if (!this.showInternational || !product.deliveryDateInternationalInformation) {
59
+ return product.deliveryDateInformation;
60
+ }
61
+ const internationalShipment = (_a = product === null || product === void 0 ? void 0 : product.deliveryDateInternationalInformation) === null || _a === void 0 ? void 0 : _a.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
62
+ if ((_b = !(internationalShipment === null || internationalShipment === void 0 ? void 0 : internationalShipment.item2)) !== null && _b !== void 0 ? _b : true) {
63
+ return product.deliveryDateInformation;
64
+ }
65
+ return internationalShipment.item2;
66
+ }
67
+ getInsuranceAmountText(product) {
68
+ var _a, _b;
69
+ if (!product.insuranceAmounts) {
70
+ return '';
71
+ }
72
+ const insuranceAmount = (_a = product === null || product === void 0 ? void 0 : product.insuranceAmounts) === null || _a === void 0 ? void 0 : _a.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
73
+ if ((_b = !(insuranceAmount === null || insuranceAmount === void 0 ? void 0 : insuranceAmount.item2)) !== null && _b !== void 0 ? _b : true) {
74
+ return '';
75
+ }
76
+ return insuranceAmount.item2;
77
+ }
46
78
  render() {
47
- return (h(Host, null, h("pn-proxio-productcard", null, h("pn-illustration", { slot: "illustrationmobile", illustration: this.item.proxioProduct.productIcon }), h("h2", { slot: "title" }, this.item.proxioProduct.productTitle), h("pn-proxio-productcard-description", { slot: "description", heading: this.item.proxioProduct.productPreamble, highlight: this.item.proxioProduct.deliveryDateInformation, list: this.item.proxioProduct.productDescriptionBulletListItems }), h("div", { slot: "information" }, h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensions, information: this.item.proxioProduct.productPackageDimensionsList }), h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensionsRoll, information: this.item.proxioProduct.productRollDimensionsList })), h("div", { slot: "bottomtags" }, this.item.proxioProduct.usp1 ?
79
+ return (h(Host, null, h("pn-proxio-productcard", null, h("pn-illustration", { slot: "illustrationmobile", illustration: this.item.proxioProduct.productIcon }), h("h2", { slot: "title" }, this.item.proxioProduct.productTitle), h("pn-proxio-productcard-description", { slot: "description", heading: this.item.proxioProduct.productPreamble, highlight: this.getDeliveryInformation(this.item.proxioProduct), list: this.item.proxioProduct.productDescriptionBulletListItems }), h("div", { slot: "information" }, h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensions, information: this.item.proxioProduct.productPackageDimensionsList }), h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensionsRoll, information: this.item.proxioProduct.productRollDimensionsList })), h("div", { slot: "bottomtags" }, this.item.proxioProduct.usp1 ?
48
80
  (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp1)) : (null), this.item.proxioProduct.usp2 ?
49
81
  (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp2)) : (null), this.item.proxioProduct.usp3 ?
50
- (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp3)) : (null)), h("pn-illustration", { slot: "illustration", illustration: this.item.proxioProduct.productIcon }), h("div", { slot: "pricelink" }, h("pn-proxio-productcard-pricelink", { price: this.getPriceString(this.item.proxioProduct), link: this.getProductLink(this.item.proxioProduct, this.item.proxioProduct.productWeightGroupList), linktext: this.item.proxioProduct.productLinkText }), this.item.relatedProxioProducts ? (this.item.relatedProxioProducts.map((product) => (h("pn-proxio-productcard-pricelink", { price: this.getPriceString(product), link: product.productLink, linktext: product.productLinkText })))) : (null)))));
82
+ (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp3)) : (null)), h("pn-illustration", { slot: "illustration", illustration: this.item.proxioProduct.productIcon }), h("div", { slot: "pricelink" }, h("pn-proxio-productcard-pricelink", { price: this.getPriceString(this.item.proxioProduct), link: this.getProductLink(this.item.proxioProduct, this.item.proxioProduct.productWeightGroupList), linktext: this.item.proxioProduct.productLinkText }), this.item.relatedProxioProducts ? (this.item.relatedProxioProducts.map((product) => (h("pn-proxio-productcard-pricelink", { price: this.getPriceString(product), link: product.productLink, linktext: product.productLinkText })))) : (null)), this.getInsuranceAmountText(this.item.proxioProduct) ? (h("div", { slot: "insurance" }, h("div", { class: "insurance-box" }, this.getInsuranceAmountText(this.item.proxioProduct)))) : (null))));
51
83
  }
52
84
  static get is() { return "pn-proxio-findprice-result"; }
53
85
  static get originalStyleUrls() {
@@ -207,6 +239,60 @@ export class PnProxioFindPriceResult {
207
239
  "reflect": false,
208
240
  "defaultValue": "false"
209
241
  },
242
+ "showInternational": {
243
+ "type": "boolean",
244
+ "mutable": false,
245
+ "complexType": {
246
+ "original": "boolean",
247
+ "resolved": "boolean",
248
+ "references": {}
249
+ },
250
+ "required": false,
251
+ "optional": false,
252
+ "docs": {
253
+ "tags": [],
254
+ "text": ""
255
+ },
256
+ "attribute": "show-international",
257
+ "reflect": false,
258
+ "defaultValue": "false"
259
+ },
260
+ "selectedCountrycode": {
261
+ "type": "string",
262
+ "mutable": false,
263
+ "complexType": {
264
+ "original": "string",
265
+ "resolved": "string",
266
+ "references": {}
267
+ },
268
+ "required": false,
269
+ "optional": false,
270
+ "docs": {
271
+ "tags": [],
272
+ "text": ""
273
+ },
274
+ "attribute": "selected-countrycode",
275
+ "reflect": false,
276
+ "defaultValue": "\"\""
277
+ },
278
+ "market": {
279
+ "type": "string",
280
+ "mutable": false,
281
+ "complexType": {
282
+ "original": "string",
283
+ "resolved": "string",
284
+ "references": {}
285
+ },
286
+ "required": false,
287
+ "optional": false,
288
+ "docs": {
289
+ "tags": [],
290
+ "text": ""
291
+ },
292
+ "attribute": "market",
293
+ "reflect": false,
294
+ "defaultValue": "\"\""
295
+ },
210
296
  "language": {
211
297
  "type": "string",
212
298
  "mutable": true,
@@ -19,7 +19,8 @@ const { state, onChange } = createStore({
19
19
  realPostcardMobile: '',
20
20
  ombudHeader: '',
21
21
  noResultMessage: '',
22
- clearFilterButton: ''
22
+ clearFilterButton: '',
23
+ countryToSendTo: ''
23
24
  },
24
25
  market: {
25
26
  currency: "",
@@ -20,7 +20,9 @@ export const translations = {
20
20
  "labelMaxDimensionsRoll": "Rulle",
21
21
  "labelMaxDimensions": "Maxmått",
22
22
  'noResultMessage': 'Inga produkter matchar dina kriterier',
23
- 'clearFilterButton': 'Rensa alla filter'
23
+ 'clearFilterButton': 'Rensa alla filter',
24
+ 'compensateUpTo': 'Kompenserad upp till',
25
+ 'countryToSendTo': 'Vilket land vill du skicka till?'
24
26
  },
25
27
  'en': {
26
28
  'componentheading': 'Our prices and terms and conditions for domestic shipments for you as a direct paying customer',
@@ -43,7 +45,9 @@ export const translations = {
43
45
  "labelMaxDimensionsRoll": "Roll",
44
46
  "labelMaxDimensions": "Maximum dimensions",
45
47
  'noResultMessage': 'No products match your criterias',
46
- 'clearFilterButton': 'Clear all filters'
48
+ 'clearFilterButton': 'Clear all filters',
49
+ 'compensateUpTo': 'Compensated up to',
50
+ 'countryToSendTo': 'To which country do you want to send?'
47
51
  },
48
52
  'da': {
49
53
  'componentheading': 'Vad vill du skicka?',
@@ -65,7 +69,9 @@ export const translations = {
65
69
  "labelMaxDimensionsRoll": "Rulle",
66
70
  "labelMaxDimensions": "Maks. mål og vægt",
67
71
  'noResultMessage': 'Ingen produkter matcher dine kriterier',
68
- 'clearFilterButton': 'Ryd alle filtre'
72
+ 'clearFilterButton': 'Ryd alle filtre',
73
+ 'compensateUpTo': 'Erstattet op til',
74
+ 'countryToSendTo': 'Hvilket land vil du sende til?'
69
75
  },
70
76
  'no': {
71
77
  'componentheading': 'Vad vill du skicka?',
@@ -77,7 +83,9 @@ export const translations = {
77
83
  'senddirectcta': 'Buy shipping in Send Direct',
78
84
  'stampshopcta': 'Order home stamps from the webshop',
79
85
  'noResultMessage': 'No products match your criterias',
80
- 'clearFilterButton': 'Clear all filters'
86
+ 'clearFilterButton': 'Clear all filters',
87
+ 'compensateUpTo': 'Kompensert inntil',
88
+ 'countryToSendTo': 'Hvilket land vil du sende til?'
81
89
  },
82
90
  'fi': {
83
91
  'componentheading': 'Vad vill du skicka?',
@@ -89,7 +97,9 @@ export const translations = {
89
97
  'senddirectcta': 'Buy shipping in Send Direct',
90
98
  'stampshopcta': 'Order home stamps from the webshop',
91
99
  'noResultMessage': 'No products match your criterias',
92
- 'clearFilterButton': 'Clear all filters'
100
+ 'clearFilterButton': 'Clear all filters',
101
+ 'compensateUpTo': 'Korvaus asti',
102
+ 'countryToSendTo': 'Mihin maahan haluaisit lähettää?'
93
103
  }
94
104
  };
95
105
  export const markets = {
@@ -76,6 +76,62 @@ pn-proxio-findprice .weightoption {
76
76
  font-size: 0.9em;
77
77
  margin: 0 auto;
78
78
  }
79
+ pn-proxio-findprice .shipmentcountry {
80
+ margin-top: 3rem;
81
+ display: flex;
82
+ flex-direction: column;
83
+ }
84
+ pn-proxio-findprice .shipmentcountry .shipmentcountry-header {
85
+ text-align: center;
86
+ font-size: 2rem;
87
+ font-weight: 700;
88
+ line-height: 2.2rem;
89
+ }
90
+ pn-proxio-findprice .shipmentcountry select {
91
+ color: #005D92;
92
+ font-size: 1.6rem;
93
+ font-weight: 500;
94
+ border-radius: 0.8rem;
95
+ cursor: pointer;
96
+ outline: none;
97
+ position: relative;
98
+ display: -ms-flexbox;
99
+ display: flex;
100
+ padding: 0.6em 1em;
101
+ z-index: 0;
102
+ -webkit-transition: z-index 0s 0.5s;
103
+ transition: z-index 0s 0.5s;
104
+ appearance: none;
105
+ width: 100%;
106
+ }
107
+ @media screen and (min-width: 500px) {
108
+ pn-proxio-findprice .shipmentcountry select {
109
+ min-width: 47.3rem;
110
+ width: inherit;
111
+ }
112
+ }
113
+ pn-proxio-findprice .shipmentcountry .shipmentcountry-select-container {
114
+ max-width: inherit;
115
+ position: relative;
116
+ margin-top: 1.2rem;
117
+ width: 100%;
118
+ }
119
+ @media screen and (min-width: 500px) {
120
+ pn-proxio-findprice .shipmentcountry .shipmentcountry-select-container {
121
+ margin: 0 auto;
122
+ margin-top: 1.2rem;
123
+ width: inherit;
124
+ }
125
+ }
126
+ pn-proxio-findprice .shipmentcountry .shipmentcountry-select-container svg {
127
+ position: absolute;
128
+ z-index: 1;
129
+ right: 1rem;
130
+ top: 1.5rem;
131
+ }
132
+ pn-proxio-findprice .shipmentcountry .shipmentcountry-select-container svg path {
133
+ fill: #005D92;
134
+ }
79
135
  pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content {
80
136
  text-align: center;
81
137
  display: flex;
@@ -16,12 +16,15 @@ export class PnProxioFindPrice {
16
16
  this.language = "da";
17
17
  this.market = "dk";
18
18
  this.showMedium = false;
19
+ this.showInternational = false;
20
+ this.maxAbroadKg = 0;
19
21
  this.cache = false;
20
22
  this.filteredItems = [];
21
23
  this.weight = { value: 0, name: "" };
22
24
  this.weightvalue = 0;
25
+ this.countrycodevalue = "";
23
26
  this.sizecategory = { value: "", name: "", icon: "", unit: "" };
24
- this.data = { proxioProducts: [] };
27
+ this.data = { proxioProducts: [], shipmentCountries: [] };
25
28
  }
26
29
  componentWillLoad() {
27
30
  this.setInitialValues().then(() => {
@@ -39,6 +42,9 @@ export class PnProxioFindPrice {
39
42
  if (!this.endpoint) {
40
43
  this.endpoint = "";
41
44
  }
45
+ if (this.countrycodevalue === "") {
46
+ this.countrycodevalue = this.market.toLowerCase();
47
+ }
42
48
  }
43
49
  init() {
44
50
  this.setState();
@@ -66,7 +72,8 @@ export class PnProxioFindPrice {
66
72
  'mode': 'cors',
67
73
  }, false, this.onFetchData.bind(this));
68
74
  if (data) {
69
- this.data.proxioProducts = data;
75
+ this.data = data;
76
+ this.data.proxioProducts = data.proxioProducts;
70
77
  }
71
78
  this.filterItems();
72
79
  }
@@ -83,16 +90,6 @@ export class PnProxioFindPrice {
83
90
  }
84
91
  }
85
92
  filterItems() {
86
- var _a;
87
- if (!this.data || !this.data.proxioProducts) {
88
- console.log('Data has not yet been loaded, fetching again');
89
- this.fetchData().then(() => {
90
- if (!this.data) {
91
- console.log('Data could not be loaded');
92
- return;
93
- }
94
- });
95
- }
96
93
  const sizeItemData = this.data.proxioProducts.filter(item => {
97
94
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
98
95
  return weightGroup.item3.includes(this.sizecategory.value);
@@ -102,18 +99,31 @@ export class PnProxioFindPrice {
102
99
  return;
103
100
  }
104
101
  const comparisonWeight = this.weight.value;
105
- let weightFilteredData = sizeItemData.filter(item => {
102
+ let weightFilteredData = sizeItemData === null || sizeItemData === void 0 ? void 0 : sizeItemData.filter(item => {
106
103
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
107
104
  return weightGroup.item1 === comparisonWeight;
108
105
  });
109
106
  });
110
107
  if (weightFilteredData.length === 0 && this.weightvalue !== 0) {
111
- weightFilteredData = sizeItemData.filter(item => {
108
+ weightFilteredData = sizeItemData === null || sizeItemData === void 0 ? void 0 : sizeItemData.filter(item => {
112
109
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
113
110
  return weightGroup.item1 === comparisonWeight;
114
111
  });
115
112
  });
116
113
  }
114
+ if (this.showInternational && this.countrycodevalue) {
115
+ weightFilteredData = weightFilteredData === null || weightFilteredData === void 0 ? void 0 : weightFilteredData.filter(item => item.proxioProduct.weightPriceCountryList.some(countryItem => countryItem.item3.includes(this.countrycodevalue.toUpperCase())));
116
+ }
117
+ weightFilteredData = this.sortWeightItems(weightFilteredData);
118
+ this.filteredItems = weightFilteredData;
119
+ }
120
+ parseFloatFromString(text) {
121
+ var _a;
122
+ return parseFloat((_a = text === null || text === void 0 ? void 0 : text.replace(/[^\d\.\,]*/g, '')) !== null && _a !== void 0 ? _a : 100000);
123
+ }
124
+ sortWeightItems(weightFilteredData) {
125
+ var _a;
126
+ const comparisonWeight = this.weight.value;
117
127
  (_a = weightFilteredData === null || weightFilteredData === void 0 ? void 0 : weightFilteredData.sort((a, b) => {
118
128
  var _a, _b, _c, _d, _e, _f, _g, _h;
119
129
  let aIndex = a.proxioProduct.productWeightGroupList.findIndex(weightGroup => weightGroup.item1 === comparisonWeight);
@@ -137,23 +147,30 @@ export class PnProxioFindPrice {
137
147
  }
138
148
  return 0;
139
149
  })) !== null && _a !== void 0 ? _a : [];
140
- this.filteredItems = weightFilteredData;
141
- }
142
- parseFloatFromString(text) {
143
- var _a;
144
- return parseFloat((_a = text === null || text === void 0 ? void 0 : text.replace(/[^\d\.\,]*/g, '')) !== null && _a !== void 0 ? _a : 100000);
150
+ return weightFilteredData;
145
151
  }
146
152
  resetFilters() {
153
+ var _a, _b, _c;
147
154
  this.weight = { value: 0, name: "" };
148
155
  this.sizecategory = sizeCategories.filter(x => x.value === "S")[0];
149
156
  this.weightvalue = 0;
157
+ this.countrycodevalue = (_c = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.shipmentCountries[0]) === null || _b === void 0 ? void 0 : _b.countryCode) !== null && _c !== void 0 ? _c : this.market;
150
158
  }
151
159
  getWeights() {
152
160
  var _a;
153
161
  let marketWeightsArray = (_a = weights[this.market]) !== null && _a !== void 0 ? _a : { "S": [], "M": [], "L": [] };
154
- return marketWeightsArray[this.sizecategory.unit];
162
+ let marketWeights = marketWeightsArray[this.sizecategory.unit];
163
+ let isInternationalWeights = this.maxAbroadKg != 0 && this.countrycodevalue.toLowerCase() !== this.market.toLowerCase();
164
+ marketWeights = isInternationalWeights ? marketWeights.filter(number => (number.value / 1000) <= this.maxAbroadKg) : marketWeights;
165
+ return marketWeights;
166
+ }
167
+ handleDropdownChange(event) {
168
+ const target = event.target;
169
+ const countryCode = target.value;
170
+ this.countrycodevalue = countryCode;
155
171
  }
156
172
  render() {
173
+ var _a, _b;
157
174
  return (h("div", { class: "findprice-form" }, h("div", { class: "findprice-form-wrapper" }, h("h4", { class: "findprice__heading" }, state.i18n.sizeheading), h("div", { class: "sizecategory" }, h("table", { class: "sizeTable" }, h("img", { id: "clouds", src: clouds }), h("tr", null, h("td", null, h("img", { class: "firstCell", src: person })), h("td", null, h("img", { src: S })), this.showMedium ? h("td", null, h("img", { src: M })) : null, h("td", null, h("img", { src: L }))), h("tr", null, h("td", null), sizeCategories.map((sizeCategory) => (!this.showMedium && sizeCategory.value === "M" ? null : (h("td", null, h("pn-radio-button", { id: 'findpricecategory-' + sizeCategory.value, radioid: sizeCategory.value, value: sizeCategory.value, name: "sizecategory", checked: sizeCategory.value === this.sizecategory.value, onChange: () => {
158
175
  this.sizecategory = sizeCategories.filter(x => x.value === sizeCategory.value)[0];
159
176
  this.weight = { value: 0, name: "" };
@@ -161,7 +178,7 @@ export class PnProxioFindPrice {
161
178
  } })))))))), h("h4", { class: "findprice__heading findprice__subheading" }, state.i18n.weightheading), (this.sizecategory.value && this.getWeights()) ? (h("div", { class: "weightoption" }, h("div", { class: "weightoption-content" }, this.getWeights().map((wght) => (h("pn-choice-button", { id: 'findpriceweight-' + wght.value, choiceid: this.sizecategory.value + wght.value, name: "weight", type: "radio", value: (!this.weight.value) ? 0 : this.getWeights().findIndex((x) => x.value === this.weightvalue), checked: wght.value === this.weight.value, onChange: () => {
162
179
  this.weight = this.getWeights().filter(x => x.value === wght.value)[0];
163
180
  this.weightvalue = this.weight.value;
164
- } }, wght.name)))))) : null, h("div", { class: 'findprice__clear-all-filters', role: 'button' }, h("div", { class: 'findprice__clear-all-filters__btn', onClick: () => this.resetFilters() }, h("pn-icon", { symbol: "trash-can", color: "blue700" }), h("span", { class: 'clear-all-filters__text' }, state.i18n.clearFilterButton)))), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state.i18n.resultlistheading) ? (h("div", { class: "resultHeading" }, state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-proxio-findprice-result", { activeweight: this.weight.value, item: item, language: this.language })))))) : ((this.weightvalue !== 0) ? (h("h4", { class: "resultHeading" }, state.i18n.noResultMessage)) : null)));
181
+ } }, wght.name)))))) : null, this.showInternational && ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.shipmentCountries) !== null && _b !== void 0 ? _b : false) ? (h("div", { class: "shipmentcountry" }, h("h4", { class: "shipmentcountry-header" }, state.i18n.countryToSendTo), h("div", { class: "shipmentcountry-select-container" }, h("svg", { class: "arrow", width: "18", height: "10", viewBox: "0 0 18 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L0.292892 1.70711C-0.0976315 1.31658 -0.0976315 0.683417 0.292892 0.292893C0.683418 -0.0976315 1.31658 -0.0976315 1.70711 0.292893L9 7.58579L16.2929 0.292893C16.6834 -0.0976315 17.3166 -0.0976315 17.7071 0.292893C18.0976 0.683417 18.0976 1.31658 17.7071 1.70711L9.70711 9.70711Z" })), h("select", { name: "shipmentCountry-select", id: "proxio-shipmentcountry", onChange: this.handleDropdownChange.bind(this) }, this.data.shipmentCountries.map((item) => (h("option", { selected: item.countryCode.toLowerCase() === this.countrycodevalue.toLowerCase(), value: item.countryCode }, item.countryName))))))) : (null), h("div", { class: 'findprice__clear-all-filters', role: 'button' }, h("div", { class: 'findprice__clear-all-filters__btn', onClick: () => this.resetFilters() }, h("pn-icon", { symbol: "trash-can", color: "blue700" }), h("span", { class: 'clear-all-filters__text' }, state.i18n.clearFilterButton)))), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state.i18n.resultlistheading) ? (h("div", { class: "resultHeading" }, state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-proxio-findprice-result", { activeweight: this.weight.value, item: item, language: this.language, "selected-countrycode": this.countrycodevalue, "show-international": this.showInternational, market: this.market })))))) : ((this.weightvalue !== 0) ? (h("h4", { class: "resultHeading" }, state.i18n.noResultMessage)) : null)));
165
182
  }
166
183
  static get is() { return "pn-proxio-findprice"; }
167
184
  static get originalStyleUrls() {
@@ -248,6 +265,42 @@ export class PnProxioFindPrice {
248
265
  "reflect": false,
249
266
  "defaultValue": "false"
250
267
  },
268
+ "showInternational": {
269
+ "type": "boolean",
270
+ "mutable": false,
271
+ "complexType": {
272
+ "original": "boolean",
273
+ "resolved": "boolean",
274
+ "references": {}
275
+ },
276
+ "required": false,
277
+ "optional": false,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": ""
281
+ },
282
+ "attribute": "show-international",
283
+ "reflect": false,
284
+ "defaultValue": "false"
285
+ },
286
+ "maxAbroadKg": {
287
+ "type": "number",
288
+ "mutable": false,
289
+ "complexType": {
290
+ "original": "number",
291
+ "resolved": "number",
292
+ "references": {}
293
+ },
294
+ "required": false,
295
+ "optional": false,
296
+ "docs": {
297
+ "tags": [],
298
+ "text": ""
299
+ },
300
+ "attribute": "max-abroad-kg",
301
+ "reflect": false,
302
+ "defaultValue": "0"
303
+ },
251
304
  "cache": {
252
305
  "type": "boolean",
253
306
  "mutable": false,
@@ -273,6 +326,7 @@ export class PnProxioFindPrice {
273
326
  "filteredItems": {},
274
327
  "weight": {},
275
328
  "weightvalue": {},
329
+ "countrycodevalue": {},
276
330
  "sizecategory": {},
277
331
  "data": {}
278
332
  };
@@ -290,6 +344,9 @@ export class PnProxioFindPrice {
290
344
  }, {
291
345
  "propName": "weightvalue",
292
346
  "methodName": "filterItems"
347
+ }, {
348
+ "propName": "countrycodevalue",
349
+ "methodName": "filterItems"
293
350
  }];
294
351
  }
295
352
  }
@@ -1,7 +1,7 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  export class PnProxioProductcard {
3
3
  render() {
4
- return (h(Host, null, h("div", { class: "cardcontent" }, h("div", { class: "carddetails" }, h("slot", { name: "illustrationmobile" }), h("div", { class: "heading" }, h("slot", { name: "title" }), h("slot", { name: "uppertags" })), h("slot", { name: "description" }), h("slot", { name: "information" }), h("slot", { name: "bottomtags" })), h("div", { class: "cardcalltoactions" }, h("slot", { name: "illustration" }), h("slot", { name: "pricelink" })))));
4
+ return (h(Host, null, h("div", { class: "cardcontent" }, h("div", { class: "carddetails" }, h("slot", { name: "illustrationmobile" }), h("div", { class: "heading" }, h("slot", { name: "title" }), h("slot", { name: "uppertags" })), h("slot", { name: "description" }), h("slot", { name: "information" }), h("slot", { name: "bottomtags" })), h("div", { class: "cardcalltoactions" }, h("slot", { name: "illustration" }), h("slot", { name: "pricelink" }), h("slot", { name: "insurance" })))));
5
5
  }
6
6
  static get is() { return "pn-proxio-productcard"; }
7
7
  static get originalStyleUrls() {
@@ -6,7 +6,7 @@ import { d as defineCustomElement$3 } from './pn-proxio-productcard-information2
6
6
  import { d as defineCustomElement$2 } from './pn-proxio-productcard-pricelink2.js';
7
7
  import { d as defineCustomElement$1 } from './pn-titletag2.js';
8
8
 
9
- const pnProxioFindpriceResultCss = "pn-proxio-find-price-result .test{margin:3em 0}.resultcontent{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-positive:1;flex-grow:1}";
9
+ const pnProxioFindpriceResultCss = "pn-proxio-findprice-result [slot=insurance]{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}pn-proxio-findprice-result .insurance-box{padding:0.4rem 0.8rem;border-radius:0.8rem;background-color:#8EDDF9;text-align:center;font-size:1.2rem;font-weight:400;margin-bottom:2.4rem}";
10
10
 
11
11
  const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
12
12
  constructor() {
@@ -20,6 +20,9 @@ const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends H
20
20
  this.Usp3 = undefined;
21
21
  this.description = [];
22
22
  this.showMeasurement = false;
23
+ this.showInternational = false;
24
+ this.selectedCountrycode = "";
25
+ this.market = "";
23
26
  this.language = "sv";
24
27
  this.weightText = "";
25
28
  this.linkId = '';
@@ -35,13 +38,20 @@ const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends H
35
38
  this.shownitems = [this.item];
36
39
  }
37
40
  getPriceString(product) {
38
- var _a;
39
- if (product.productWeightGroupList) {
40
- const activeIndex = product.productWeightGroupList.findIndex((item) => item.item1 === this.activeweight);
41
- let price = product.weightAndPriceList ? (_a = product === null || product === void 0 ? void 0 : product.weightAndPriceList[activeIndex]) === null || _a === void 0 ? void 0 : _a.item2 : '';
42
- return price ? this.i18n.from + price : '';
41
+ var _a, _b;
42
+ if (!product.productWeightGroupList) {
43
+ return null;
43
44
  }
44
- return null;
45
+ const activeIndex = product.productWeightGroupList.findIndex((item) => item.item1 === this.activeweight);
46
+ let price = '';
47
+ if (this.showInternational && this.selectedCountrycode && this.selectedCountrycode !== this.market && product.weightPriceCountryList) {
48
+ let weightPriceCountryList = product.weightPriceCountryList.filter(item => item.item3.includes(this.selectedCountrycode.toUpperCase()));
49
+ price = weightPriceCountryList ? (_a = weightPriceCountryList[activeIndex]) === null || _a === void 0 ? void 0 : _a.item2 : '';
50
+ }
51
+ else {
52
+ price = product.weightAndPriceList ? (_b = product === null || product === void 0 ? void 0 : product.weightAndPriceList[activeIndex]) === null || _b === void 0 ? void 0 : _b.item2 : '';
53
+ }
54
+ return price ? this.i18n.from + price : '';
45
55
  }
46
56
  getProductLink(product, productWeightGroupList) {
47
57
  var _a;
@@ -53,11 +63,33 @@ const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends H
53
63
  }
54
64
  return null;
55
65
  }
66
+ getDeliveryInformation(product) {
67
+ var _a, _b;
68
+ if (!this.showInternational || !product.deliveryDateInternationalInformation) {
69
+ return product.deliveryDateInformation;
70
+ }
71
+ const internationalShipment = (_a = product === null || product === void 0 ? void 0 : product.deliveryDateInternationalInformation) === null || _a === void 0 ? void 0 : _a.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
72
+ if ((_b = !(internationalShipment === null || internationalShipment === void 0 ? void 0 : internationalShipment.item2)) !== null && _b !== void 0 ? _b : true) {
73
+ return product.deliveryDateInformation;
74
+ }
75
+ return internationalShipment.item2;
76
+ }
77
+ getInsuranceAmountText(product) {
78
+ var _a, _b;
79
+ if (!product.insuranceAmounts) {
80
+ return '';
81
+ }
82
+ const insuranceAmount = (_a = product === null || product === void 0 ? void 0 : product.insuranceAmounts) === null || _a === void 0 ? void 0 : _a.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
83
+ if ((_b = !(insuranceAmount === null || insuranceAmount === void 0 ? void 0 : insuranceAmount.item2)) !== null && _b !== void 0 ? _b : true) {
84
+ return '';
85
+ }
86
+ return insuranceAmount.item2;
87
+ }
56
88
  render() {
57
- return (h(Host, null, h("pn-proxio-productcard", null, h("pn-illustration", { slot: "illustrationmobile", illustration: this.item.proxioProduct.productIcon }), h("h2", { slot: "title" }, this.item.proxioProduct.productTitle), h("pn-proxio-productcard-description", { slot: "description", heading: this.item.proxioProduct.productPreamble, highlight: this.item.proxioProduct.deliveryDateInformation, list: this.item.proxioProduct.productDescriptionBulletListItems }), h("div", { slot: "information" }, h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensions, information: this.item.proxioProduct.productPackageDimensionsList }), h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensionsRoll, information: this.item.proxioProduct.productRollDimensionsList })), h("div", { slot: "bottomtags" }, this.item.proxioProduct.usp1 ?
89
+ return (h(Host, null, h("pn-proxio-productcard", null, h("pn-illustration", { slot: "illustrationmobile", illustration: this.item.proxioProduct.productIcon }), h("h2", { slot: "title" }, this.item.proxioProduct.productTitle), h("pn-proxio-productcard-description", { slot: "description", heading: this.item.proxioProduct.productPreamble, highlight: this.getDeliveryInformation(this.item.proxioProduct), list: this.item.proxioProduct.productDescriptionBulletListItems }), h("div", { slot: "information" }, h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensions, information: this.item.proxioProduct.productPackageDimensionsList }), h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensionsRoll, information: this.item.proxioProduct.productRollDimensionsList })), h("div", { slot: "bottomtags" }, this.item.proxioProduct.usp1 ?
58
90
  (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp1)) : (null), this.item.proxioProduct.usp2 ?
59
91
  (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp2)) : (null), this.item.proxioProduct.usp3 ?
60
- (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp3)) : (null)), h("pn-illustration", { slot: "illustration", illustration: this.item.proxioProduct.productIcon }), h("div", { slot: "pricelink" }, h("pn-proxio-productcard-pricelink", { price: this.getPriceString(this.item.proxioProduct), link: this.getProductLink(this.item.proxioProduct, this.item.proxioProduct.productWeightGroupList), linktext: this.item.proxioProduct.productLinkText }), this.item.relatedProxioProducts ? (this.item.relatedProxioProducts.map((product) => (h("pn-proxio-productcard-pricelink", { price: this.getPriceString(product), link: product.productLink, linktext: product.productLinkText })))) : (null)))));
92
+ (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp3)) : (null)), h("pn-illustration", { slot: "illustration", illustration: this.item.proxioProduct.productIcon }), h("div", { slot: "pricelink" }, h("pn-proxio-productcard-pricelink", { price: this.getPriceString(this.item.proxioProduct), link: this.getProductLink(this.item.proxioProduct, this.item.proxioProduct.productWeightGroupList), linktext: this.item.proxioProduct.productLinkText }), this.item.relatedProxioProducts ? (this.item.relatedProxioProducts.map((product) => (h("pn-proxio-productcard-pricelink", { price: this.getPriceString(product), link: product.productLink, linktext: product.productLinkText })))) : (null)), this.getInsuranceAmountText(this.item.proxioProduct) ? (h("div", { slot: "insurance" }, h("div", { class: "insurance-box" }, this.getInsuranceAmountText(this.item.proxioProduct)))) : (null))));
61
93
  }
62
94
  static get watchers() { return {
63
95
  "item": ["composeItems"],
@@ -73,6 +105,9 @@ const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends H
73
105
  "Usp3": [1, "usp-3"],
74
106
  "description": [16],
75
107
  "showMeasurement": [4, "show-measurement"],
108
+ "showInternational": [4, "show-international"],
109
+ "selectedCountrycode": [1, "selected-countrycode"],
110
+ "market": [1],
76
111
  "language": [1025],
77
112
  "weightText": [32],
78
113
  "linkId": [32],