@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
|
@@ -1,44 +1,79 @@
|
|
|
1
1
|
import { Component, h, Prop, Host, State, Watch } from "@stencil/core";
|
|
2
2
|
import { state } from "./pn-product-pricelist-store";
|
|
3
|
+
import { sendDirectUrl, stampShopUrl } from "./data.js";
|
|
3
4
|
export class PnFindProductPricelistResult {
|
|
4
5
|
constructor() {
|
|
5
6
|
this.item = null;
|
|
7
|
+
this.description = [];
|
|
6
8
|
this.shownitems = [];
|
|
9
|
+
this.showMeasurement = false;
|
|
7
10
|
this.weightText = "";
|
|
8
11
|
}
|
|
9
12
|
componentWillLoad() {
|
|
10
13
|
this.composeItems();
|
|
11
14
|
}
|
|
12
15
|
composeItems() {
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
this.shownitems.push(Object.assign(Object.assign({}, this.item), { priceagent: null, pricesenddirect: null }));
|
|
16
|
-
}
|
|
17
|
-
if (this.item.priceagent) {
|
|
18
|
-
this.shownitems.push(Object.assign(Object.assign({}, this.item), { pricestamps: null, pricesenddirect: null }));
|
|
19
|
-
}
|
|
20
|
-
if (this.item.pricesenddirect) {
|
|
21
|
-
this.shownitems.push(Object.assign(Object.assign({}, this.item), { pricestamps: null, priceagent: null }));
|
|
16
|
+
if (this.item.description) {
|
|
17
|
+
this.description = this.item.description.split("#bullet").filter(x => x !== "");
|
|
22
18
|
}
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
|
|
19
|
+
this.showMeasurement = (this.item.maxmått !== null) || (this.item.rulle !== null);
|
|
20
|
+
this.shownitems = [this.item];
|
|
21
|
+
// if (this.item.pricestamps) {
|
|
22
|
+
// this.shownitems.push({...this.item, priceagent: null, pricesenddirect: null});
|
|
23
|
+
// }
|
|
24
|
+
// if (this.item.priceagent) {
|
|
25
|
+
// this.shownitems.push({...this.item, pricestamps: null, pricesenddirect: null});
|
|
26
|
+
// }
|
|
27
|
+
// if (this.item.pricesenddirect) {
|
|
28
|
+
// this.shownitems.push({...this.item, pricestamps: null, priceagent: null});
|
|
29
|
+
// }
|
|
30
|
+
// // Parcels are always in KG. Letter KG must be converted from grams
|
|
31
|
+
// this.weightText = (this.item.what === "parcel") ? this.item.maxweight + 'kg' :
|
|
32
|
+
// (this.item.what === "letter" && this.item.maxweight > 999) ? Math.round(this.item.maxweight/1000) + " kg" : this.item.maxweight + " g";
|
|
26
33
|
}
|
|
27
34
|
render() {
|
|
28
|
-
return (h(Host, null, this.shownitems.map((item) => (h("pn-product-
|
|
29
|
-
h("pn-illustration", { slot: "illustration", illustration: item.illustration }),
|
|
35
|
+
return (h(Host, null, this.shownitems.map((item) => (h("pn-product-card", { "data-productid": item.id },
|
|
36
|
+
h("pn-illustration", { slot: "illustration", illustration: this.item.illustration }),
|
|
37
|
+
h("div", { slot: "title" },
|
|
38
|
+
h("h2", null,
|
|
39
|
+
item.name,
|
|
40
|
+
" "),
|
|
41
|
+
(this.item.highestrankusp) ?
|
|
42
|
+
(this.item.highestrankusp === "Billigast") ?
|
|
43
|
+
(h("span", { slot: "Billigast" },
|
|
44
|
+
this.item.highestrankusp,
|
|
45
|
+
h("pn-icon", { symbol: "box-label", small: "false", color: "green700" })))
|
|
46
|
+
: (h("span", { slot: "Snabbast" },
|
|
47
|
+
this.item.highestrankusp,
|
|
48
|
+
h("pn-icon", { symbol: "bolt", small: "false", color: "blue700" }))) : null),
|
|
30
49
|
h("div", { slot: "content" },
|
|
31
50
|
h("div", { class: "content" },
|
|
32
|
-
h("
|
|
33
|
-
(item.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
item.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
(this.item.description) ? (h("div", { class: "description" }, this.description.map((desc) => (h("li", null, desc))))) : null,
|
|
52
|
+
(this.item.info) ? (h("div", { class: "description" }, this.item.info)) : null)),
|
|
53
|
+
this.item.note ? (h("small", { slot: "note" },
|
|
54
|
+
h("p", null, this.item.note))) : null,
|
|
55
|
+
this.item.additionalusp ? (h("div", { slot: "additionalUSP" })) : null,
|
|
56
|
+
this.showMeasurement ? (h("pn-product-card-info", { paket: this.item.maxmått, rulle: this.item.rulle })) : null,
|
|
57
|
+
h("div", { slot: "cardprice" },
|
|
58
|
+
this.item.pricesenddirect ? (h("pn-product-card-price", { slot: "sendDirectPrice", label: state.i18n.senddirectcta, amount: this.item.pricesenddirect + '', currency: state.market.currency, url: sendDirectUrl, service: this.item.name + "-portal" })) : null,
|
|
59
|
+
this.item.pricestamps ? (h("pn-product-card-price", { slot: "stampPrice", label: state.i18n.stampshopcta, amount: this.item.pricestamps + '', currency: state.market.currency, url: stampShopUrl, service: this.item.name + "-eshop" })) : null))
|
|
60
|
+
// <pn-product-tile>
|
|
61
|
+
// <pn-illustration slot="illustration" illustration={ item.illustration }></pn-illustration>
|
|
62
|
+
// <div slot="content">
|
|
63
|
+
// <div class="content">
|
|
64
|
+
// <h3>{item.name}</h3>
|
|
65
|
+
// {(item.description) ? (<div class="description">{item.description}</div>) : null}
|
|
66
|
+
// {(item.info) ? (<div class="description">{item.info}</div>) : null}
|
|
67
|
+
// </div>
|
|
68
|
+
// </div>
|
|
69
|
+
// { item.maxweight ? (<pn-product-tile-info label={state.i18n.maxweightlabel} text={this.weightText}></pn-product-tile-info>) : null }
|
|
70
|
+
// {/* { item.maximummeasurements ? (<pn-product-tile-info label={state.i18n.maxmeasurementlabel} text={item.maximummeasurements}></pn-product-tile-info>) : null } */}
|
|
71
|
+
// { item.pricestamps ? (<pn-product-tile-price slot="price" label={state.i18n.stampshopcta} amount={item.pricestamps+''} currency={ state.market.currency }></pn-product-tile-price>) : null }
|
|
72
|
+
// {/* { item.priceagent ? (<pn-product-tile-price slot="price" label="" amount={item.priceagent+''} currency={ state.market.currency } url="https://shop.postnord.se/ebutik/default.aspx"></pn-product-tile-price>) : null } */}
|
|
73
|
+
// { item.pricesenddirect ? (<pn-product-tile-price slot="price" label={state.i18n.senddirectcta} amount={item.pricesenddirect+''} currency={ state.market.currency } url="https://portal.postnord.com/skickadirekt/"></pn-product-tile-price>) : null }
|
|
74
|
+
// { item.note ? (<small slot="note"><p>{item.note}</p></small>) : null }
|
|
75
|
+
// </pn-product-tile>
|
|
76
|
+
))));
|
|
42
77
|
}
|
|
43
78
|
static get is() { return "pn-product-pricelist-result"; }
|
|
44
79
|
static get originalStyleUrls() { return {
|
|
@@ -69,6 +104,22 @@ export class PnFindProductPricelistResult {
|
|
|
69
104
|
},
|
|
70
105
|
"defaultValue": "null"
|
|
71
106
|
},
|
|
107
|
+
"description": {
|
|
108
|
+
"type": "unknown",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "string[]",
|
|
112
|
+
"resolved": "string[]",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": true,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": ""
|
|
120
|
+
},
|
|
121
|
+
"defaultValue": "[]"
|
|
122
|
+
},
|
|
72
123
|
"shownitems": {
|
|
73
124
|
"type": "unknown",
|
|
74
125
|
"mutable": false,
|
|
@@ -89,6 +140,24 @@ export class PnFindProductPricelistResult {
|
|
|
89
140
|
"text": ""
|
|
90
141
|
},
|
|
91
142
|
"defaultValue": "[]"
|
|
143
|
+
},
|
|
144
|
+
"showMeasurement": {
|
|
145
|
+
"type": "boolean",
|
|
146
|
+
"mutable": false,
|
|
147
|
+
"complexType": {
|
|
148
|
+
"original": "boolean",
|
|
149
|
+
"resolved": "boolean",
|
|
150
|
+
"references": {}
|
|
151
|
+
},
|
|
152
|
+
"required": false,
|
|
153
|
+
"optional": true,
|
|
154
|
+
"docs": {
|
|
155
|
+
"tags": [],
|
|
156
|
+
"text": ""
|
|
157
|
+
},
|
|
158
|
+
"attribute": "show-measurement",
|
|
159
|
+
"reflect": false,
|
|
160
|
+
"defaultValue": "false"
|
|
92
161
|
}
|
|
93
162
|
}; }
|
|
94
163
|
static get states() { return {
|
package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.js
CHANGED
|
@@ -1,41 +1,57 @@
|
|
|
1
1
|
export const translations = {
|
|
2
2
|
'sv': {
|
|
3
|
-
'
|
|
3
|
+
'componentheading': 'Våra priser och villkor för inrikesförsändelser för dig som direktbetalande kund?',
|
|
4
|
+
'deliveryscopeheading': 'Endast leveranser inom Sverige',
|
|
5
|
+
'resultlistheading': 'Några bra alternativ för dig',
|
|
4
6
|
'weightlabel': 'Vikt',
|
|
7
|
+
'maxweightlabel': 'Maxvikt',
|
|
5
8
|
'maxmeasurementlabel': 'Maxvolym',
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
+
'senddirectcta': 'Köp online',
|
|
10
|
+
'stampshopcta': 'Köp frimärken',
|
|
11
|
+
'message': '*Vid köp hos valfritt ombud',
|
|
12
|
+
'servicePointHeader': 'Eller hitta närmaste serviceställe',
|
|
13
|
+
'servicePointLink': 'Sök serviceställe eller brevlåda'
|
|
9
14
|
},
|
|
10
15
|
'en': {
|
|
11
|
-
'
|
|
16
|
+
'componentheading': 'Our prices and terms and conditions for domestic shipments for you as a direct paying customer',
|
|
17
|
+
'deliveryscopeheading': 'Deliveries within Sweden only',
|
|
18
|
+
'resultlistheading': 'Some suitable options for you',
|
|
12
19
|
'weightlabel': 'Weight',
|
|
20
|
+
'maxweightlabel': 'Max weight',
|
|
13
21
|
'maxmeasurementlabel': 'Maximum measurement',
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
22
|
+
'senddirectcta': 'Buy Online',
|
|
23
|
+
'stampshopcta': 'Buy Stamps',
|
|
24
|
+
'message': 'When buying from any agent',
|
|
25
|
+
'servicePointHeader': 'Or find nearest service point',
|
|
26
|
+
'servicePointLink': 'Search letter-box or service point'
|
|
17
27
|
},
|
|
18
28
|
'da': {
|
|
19
|
-
'
|
|
29
|
+
'componentheading': 'Vad vill du skicka?',
|
|
30
|
+
'deliveryscopeheading': 'Kun leveringer indenfor Sverige',
|
|
31
|
+
'resultlistheading': 'Some suitable options for you',
|
|
20
32
|
'weightlabel': 'Vægt',
|
|
33
|
+
'maxweightlabel': 'Max vægt',
|
|
21
34
|
'maxmeasurementlabel': 'Maks. Volumen',
|
|
22
|
-
'sizeheading': 'How much does it weigh?',
|
|
23
35
|
'senddirectcta': 'Buy shipping in Send Direct',
|
|
24
36
|
'stampshopcta': 'Order home stamps from the webshop',
|
|
25
37
|
},
|
|
26
38
|
'no': {
|
|
27
|
-
'
|
|
39
|
+
'componentheading': 'Vad vill du skicka?',
|
|
40
|
+
'deliveryscopeheading': 'Kun leveranser innen Sverige',
|
|
41
|
+
'resultlistheading': 'Some suitable options for you',
|
|
28
42
|
'weightlabel': 'Vekt',
|
|
43
|
+
'maxweightlabel': 'Maks vekt',
|
|
29
44
|
'maxmeasurementlabel': 'Maks volum',
|
|
30
|
-
'sizeheading': 'How much does it weigh?',
|
|
31
45
|
'senddirectcta': 'Buy shipping in Send Direct',
|
|
32
46
|
'stampshopcta': 'Order home stamps from the webshop',
|
|
33
47
|
},
|
|
34
48
|
'fi': {
|
|
49
|
+
'componentheading': 'Vad vill du skicka?',
|
|
50
|
+
'deliveryscopeheading': 'Toimitukset vain Ruotsin sisällä',
|
|
51
|
+
'resultlistheading': 'Some suitable options for you',
|
|
52
|
+
'weightlabel': 'Paino',
|
|
35
53
|
'maxweightlabel': 'Max paino',
|
|
36
|
-
'weightlabel': 'Piano',
|
|
37
54
|
'maxmeasurementlabel': 'Max äänenvoimakkuus',
|
|
38
|
-
'sizeheading': 'How much does it weigh?',
|
|
39
55
|
'senddirectcta': 'Buy shipping in Send Direct',
|
|
40
56
|
'stampshopcta': 'Order home stamps from the webshop',
|
|
41
57
|
}
|
|
@@ -10,13 +10,14 @@ pn-product-pricelist .heading {
|
|
|
10
10
|
margin-bottom: 1rem;
|
|
11
11
|
}
|
|
12
12
|
pn-product-pricelist .content,
|
|
13
|
-
pn-product-pricelist .weightselection
|
|
13
|
+
pn-product-pricelist .weightselection,
|
|
14
|
+
pn-product-pricelist .resultlist {
|
|
14
15
|
max-width: 50em;
|
|
15
|
-
margin: 0 auto
|
|
16
|
+
margin: 0 auto 1.6rem;
|
|
16
17
|
}
|
|
17
18
|
pn-product-pricelist .weightoption {
|
|
18
19
|
display: flex;
|
|
19
|
-
gap:
|
|
20
|
+
gap: 1.6rem;
|
|
20
21
|
}
|
|
21
22
|
pn-product-pricelist .weightoption-input {
|
|
22
23
|
width: 5em;
|
|
@@ -2,10 +2,11 @@ import { Component, h, Prop, State, Host, Watch } from "@stencil/core";
|
|
|
2
2
|
import { translations, markets } from "./pn-product-pricelist-translations";
|
|
3
3
|
import { weights } from "./data.js";
|
|
4
4
|
import { convertFileFromStream } from "../../../globals/shared/productprice/convert.js";
|
|
5
|
-
import { state } from "./pn-product-pricelist-store";
|
|
5
|
+
// import { state } from "./pn-product-pricelist-store";
|
|
6
|
+
import { state } from "../pn-find-price/pn-find-price-store";
|
|
6
7
|
export class PnFindProductPricelist {
|
|
7
8
|
constructor() {
|
|
8
|
-
this.source = "https://com-integration.postnord.com/globalassets/global/prices/sv-
|
|
9
|
+
this.source = "https://com-integration.postnord.com/globalassets/global/prices/sv-findprice-1-PN.xlsx";
|
|
9
10
|
this.language = "sv";
|
|
10
11
|
this.market = "se";
|
|
11
12
|
this.productid = "";
|
|
@@ -89,7 +90,6 @@ export class PnFindProductPricelist {
|
|
|
89
90
|
h("slot", null)),
|
|
90
91
|
this.loading ? (h("pn-spinner", null)) : null,
|
|
91
92
|
(this.postagetype.value && weights[this.postagetype.value]) ? (h("div", { class: "weightselection" },
|
|
92
|
-
(state.i18n.sizeheading) ? (h("div", { class: "heading" }, state.i18n.sizeheading)) : null,
|
|
93
93
|
h("div", { class: "weightoption" },
|
|
94
94
|
h("div", { class: "weightoption-input" },
|
|
95
95
|
h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: state.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
|
|
@@ -124,7 +124,7 @@ export class PnFindProductPricelist {
|
|
|
124
124
|
return (h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {}))));
|
|
125
125
|
})))))) : null,
|
|
126
126
|
h("div", { class: "resultlist", "data-list-count": this.filteredItems.length }, this.filteredItems.map((item) => (h("div", null,
|
|
127
|
-
h("pn-
|
|
127
|
+
h("pn-find-price-result", { item: item })))))));
|
|
128
128
|
}
|
|
129
129
|
static get is() { return "pn-product-pricelist"; }
|
|
130
130
|
static get originalStyleUrls() { return {
|
|
@@ -150,7 +150,7 @@ export class PnFindProductPricelist {
|
|
|
150
150
|
},
|
|
151
151
|
"attribute": "source",
|
|
152
152
|
"reflect": false,
|
|
153
|
-
"defaultValue": "\"https://com-integration.postnord.com/globalassets/global/prices/sv-
|
|
153
|
+
"defaultValue": "\"https://com-integration.postnord.com/globalassets/global/prices/sv-findprice-1-PN.xlsx\""
|
|
154
154
|
},
|
|
155
155
|
"language": {
|
|
156
156
|
"type": "string",
|
|
@@ -26,10 +26,10 @@ const Template = ({ ...args }) => {
|
|
|
26
26
|
|
|
27
27
|
export const Primary = Template.bind({});
|
|
28
28
|
Primary.args = {
|
|
29
|
-
heading: '
|
|
30
|
-
description: '
|
|
31
|
-
source: 'https://com-integration.postnord.com/globalassets/global/prices/sv-
|
|
29
|
+
heading: '',
|
|
30
|
+
description: '',
|
|
31
|
+
source: 'https://com-integration.postnord.com/globalassets/global/prices/sv-findprice-1-PN.xlsx',
|
|
32
32
|
language: 'sv',
|
|
33
33
|
market: 'se',
|
|
34
|
-
productid: '
|
|
34
|
+
productid: 'letter'
|
|
35
35
|
};
|