@postnord/pn-marketweb-components 1.0.41 → 1.0.44-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/{MarketWebLoginManager-859590e2.js → MarketWebLoginManager-1282a883.js} +1 -2
- package/cjs/{convert-57b3dd5e.js → convert-b8a6d658.js} +55 -0
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-choice-button.cjs.entry.js +39 -0
- package/cjs/pn-find-price-result.cjs.entry.js +44 -0
- package/cjs/pn-find-price-store-85b100ba.js +23 -0
- package/cjs/pn-find-price.cjs.entry.js +260 -0
- package/cjs/{pn-choice-button_2.cjs.entry.js → pn-find-service-and-price-result.cjs.entry.js} +0 -33
- package/cjs/pn-find-service-and-price.cjs.entry.js +1 -1
- package/cjs/pn-language-selector_9.cjs.entry.js +17 -2
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-marketweb-sitefooter.cjs.entry.js +0 -1
- package/cjs/pn-marketweb-siteheader.cjs.entry.js +5 -6
- package/cjs/pn-product-pricelist.cjs.entry.js +1 -1
- package/cjs/pn-profile-selector.cjs.entry.js +1 -1
- package/collection/collection-manifest.json +2 -0
- package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.js +0 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js +1 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +28 -30
- package/collection/components/navigation/pn-language-selector/pn-language-selector.js +15 -0
- package/collection/components/widgets/pn-find-price/data.js +68 -0
- package/collection/components/widgets/pn-find-price/find-price.stories.js +27 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-result.css +3 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-result.js +100 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-store.js +20 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-translations.js +71 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-types.js +1 -0
- package/collection/components/widgets/pn-find-price/pn-find-price.css +55 -0
- package/collection/components/widgets/pn-find-price/pn-find-price.js +212 -0
- package/collection/globals/MarketWebLoginManager.js +1 -2
- package/collection/globals/shared/productprice/convert.js +55 -1
- package/custom-elements/index.d.ts +12 -0
- package/custom-elements/index.js +412 -37
- package/esm/{MarketWebLoginManager-83f2e86a.js → MarketWebLoginManager-310d2552.js} +1 -2
- package/esm/{convert-b49a0857.js → convert-8cce67c4.js} +55 -1
- package/esm/loader.js +1 -1
- package/esm/{pn-choice-button_2.entry.js → pn-choice-button.entry.js} +1 -39
- package/esm/pn-find-price-result.entry.js +40 -0
- package/esm/pn-find-price-store-d2053b72.js +21 -0
- package/esm/pn-find-price.entry.js +256 -0
- package/esm/pn-find-service-and-price-result.entry.js +41 -0
- package/esm/pn-find-service-and-price.entry.js +1 -1
- package/esm/pn-language-selector_9.entry.js +17 -2
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-marketweb-sitefooter.entry.js +0 -1
- package/esm/pn-marketweb-siteheader.entry.js +5 -6
- package/esm/pn-product-pricelist.entry.js +1 -1
- package/esm/pn-profile-selector.entry.js +1 -1
- package/esm-es5/{MarketWebLoginManager-83f2e86a.js → MarketWebLoginManager-310d2552.js} +1 -1
- package/esm-es5/{convert-b49a0857.js → convert-8cce67c4.js} +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-choice-button.entry.js +1 -0
- package/esm-es5/pn-find-price-result.entry.js +1 -0
- package/esm-es5/pn-find-price-store-d2053b72.js +1 -0
- package/esm-es5/pn-find-price.entry.js +1 -0
- package/esm-es5/pn-find-service-and-price-result.entry.js +1 -0
- package/esm-es5/pn-find-service-and-price.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-marketweb-sitefooter.entry.js +1 -1
- package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
- package/esm-es5/pn-product-pricelist.entry.js +1 -1
- package/esm-es5/pn-profile-selector.entry.js +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/{p-e6a209c6.system.entry.js → p-0d0ea574.system.entry.js} +1 -1
- package/pn-market-web-components/p-1611123a.system.entry.js +1 -0
- package/pn-market-web-components/{p-b8af690a.entry.js → p-22738646.entry.js} +1 -1
- package/pn-market-web-components/p-233ca151.system.js +1 -0
- package/pn-market-web-components/p-2456901a.js +1 -0
- package/pn-market-web-components/p-2e6644ea.system.entry.js +1 -0
- package/pn-market-web-components/p-325a7cae.entry.js +1 -0
- package/pn-market-web-components/p-38ff23f5.entry.js +1 -0
- package/pn-market-web-components/p-4fcabdb8.entry.js +1 -0
- package/pn-market-web-components/p-50454694.system.entry.js +1 -0
- package/pn-market-web-components/{p-91624bd5.system.js → p-5ce5be4f.system.js} +2 -2
- package/pn-market-web-components/p-5f8ef634.entry.js +1 -0
- package/pn-market-web-components/p-6ee881ea.system.entry.js +1 -0
- package/pn-market-web-components/p-725e4377.entry.js +1 -0
- package/pn-market-web-components/{p-21e0e386.js → p-7dd91709.js} +1 -1
- package/pn-market-web-components/p-93d8620b.entry.js +1 -0
- package/pn-market-web-components/p-a22df959.system.js +1 -1
- package/pn-market-web-components/{p-9aca0bae.entry.js → p-a5284c78.entry.js} +1 -1
- package/pn-market-web-components/p-b30e348c.system.entry.js +1 -0
- package/pn-market-web-components/p-bea2dcc6.entry.js +1 -0
- package/pn-market-web-components/p-c30207e6.js +1 -0
- package/pn-market-web-components/{p-f4fda846.system.entry.js → p-d133f30d.system.entry.js} +1 -1
- package/pn-market-web-components/p-d8882f68.system.entry.js +1 -0
- package/pn-market-web-components/p-da370548.system.entry.js +1 -0
- package/pn-market-web-components/p-dd4de1a9.entry.js +1 -0
- package/pn-market-web-components/{p-e04f8d34.system.entry.js → p-eb75d0cf.system.entry.js} +1 -1
- package/pn-market-web-components/{p-58cdf3a6.system.js → p-f1311662.system.js} +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/navigation/pn-language-selector/pn-language-selector.d.ts +1 -0
- package/types/components/widgets/pn-find-price/pn-find-price-result.d.ts +9 -0
- package/types/components/widgets/pn-find-price/pn-find-price-store.d.ts +33 -0
- package/types/components/widgets/pn-find-price/pn-find-price-translations.d.ts +71 -0
- package/types/components/widgets/pn-find-price/pn-find-price-types.d.ts +46 -0
- package/types/components/widgets/pn-find-price/pn-find-price.d.ts +16 -0
- package/types/components.d.ts +37 -0
- package/esm-es5/pn-choice-button_2.entry.js +0 -1
- package/pn-market-web-components/p-37801e32.entry.js +0 -1
- package/pn-market-web-components/p-3f876199.entry.js +0 -1
- package/pn-market-web-components/p-4aa3b95d.entry.js +0 -1
- package/pn-market-web-components/p-861210ae.entry.js +0 -1
- package/pn-market-web-components/p-a924001f.system.entry.js +0 -1
- package/pn-market-web-components/p-ac36097e.system.entry.js +0 -1
- package/pn-market-web-components/p-b2383083.system.entry.js +0 -1
- package/pn-market-web-components/p-c254cfdf.js +0 -1
- package/pn-market-web-components/p-e9d8a991.entry.js +0 -1
- package/pn-market-web-components/p-ec1127de.system.entry.js +0 -1
package/custom-elements/index.js
CHANGED
|
@@ -281,10 +281,10 @@ let PnFilterSearch$1 = class extends HTMLElement {
|
|
|
281
281
|
static get style() { return pnFilterSearchCss; }
|
|
282
282
|
};
|
|
283
283
|
|
|
284
|
-
const translations$
|
|
284
|
+
const translations$9 = {
|
|
285
285
|
'sv': {
|
|
286
286
|
'componentheading': 'Vad vill du skicka?',
|
|
287
|
-
'deliveryscopeheading': '
|
|
287
|
+
'deliveryscopeheading': 'Endast leveranser inom Sverige',
|
|
288
288
|
'sizeheading': 'Hur mycket väger det?',
|
|
289
289
|
'resultlistheading': 'Några utvalda val',
|
|
290
290
|
'weightlabel': 'Vikt',
|
|
@@ -295,7 +295,7 @@ const translations$8 = {
|
|
|
295
295
|
},
|
|
296
296
|
'en': {
|
|
297
297
|
'componentheading': 'What do you want to send?',
|
|
298
|
-
'deliveryscopeheading': '
|
|
298
|
+
'deliveryscopeheading': 'Deliveries within Sweden only',
|
|
299
299
|
'sizeheading': 'How much does it weigh?',
|
|
300
300
|
'resultlistheading': 'Some suitable options for you',
|
|
301
301
|
'weightlabel': 'Weight',
|
|
@@ -306,7 +306,7 @@ const translations$8 = {
|
|
|
306
306
|
},
|
|
307
307
|
'da': {
|
|
308
308
|
'componentheading': 'Vad vill du skicka?',
|
|
309
|
-
'deliveryscopeheading': '
|
|
309
|
+
'deliveryscopeheading': 'Kun leveringer indenfor Sverige',
|
|
310
310
|
'sizeheading': 'How much does it weigh?',
|
|
311
311
|
'resultlistheading': 'Some suitable options for you',
|
|
312
312
|
'weightlabel': 'Vægt',
|
|
@@ -317,7 +317,7 @@ const translations$8 = {
|
|
|
317
317
|
},
|
|
318
318
|
'no': {
|
|
319
319
|
'componentheading': 'Vad vill du skicka?',
|
|
320
|
-
'deliveryscopeheading': '
|
|
320
|
+
'deliveryscopeheading': 'Kun leveranser innen Sverige',
|
|
321
321
|
'sizeheading': 'How much does it weigh?',
|
|
322
322
|
'resultlistheading': 'Some suitable options for you',
|
|
323
323
|
'weightlabel': 'Vekt',
|
|
@@ -328,7 +328,7 @@ const translations$8 = {
|
|
|
328
328
|
},
|
|
329
329
|
'fi': {
|
|
330
330
|
'componentheading': 'Vad vill du skicka?',
|
|
331
|
-
'deliveryscopeheading': '
|
|
331
|
+
'deliveryscopeheading': 'Toimitukset vain Ruotsin sisällä',
|
|
332
332
|
'sizeheading': 'How much does it weigh?',
|
|
333
333
|
'resultlistheading': 'Some suitable options for you',
|
|
334
334
|
'weightlabel': 'Paino',
|
|
@@ -338,7 +338,7 @@ const translations$8 = {
|
|
|
338
338
|
'stampshopcta': 'Order home stamps from the webshop',
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
|
-
const markets$
|
|
341
|
+
const markets$2 = {
|
|
342
342
|
'se': {
|
|
343
343
|
"currency": "kr",
|
|
344
344
|
},
|
|
@@ -353,26 +353,15 @@ const markets$1 = {
|
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
355
|
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
"letter": [
|
|
363
|
-
{ name: "Sweden", value: "sweden", illustration: "letterboxes" },
|
|
364
|
-
{ name: "Abroad", value: "abroad", illustration: "character-box-letters-globe" },
|
|
365
|
-
|
|
366
|
-
],
|
|
367
|
-
"parcel": [
|
|
368
|
-
{ name: "Sweden", value: "sweden", illustration: "letterboxes" },
|
|
369
|
-
{ name: "Within Europe", value:"withineurope", illustration: "character-box-letters-globe" },
|
|
370
|
-
{ name: "Outside Europe", value:"outsideeurope", illustration: "discover" },
|
|
371
|
-
]
|
|
372
|
-
};
|
|
356
|
+
const sizeCategories = [
|
|
357
|
+
{ name: "Document", value: "document", illustration: "claims", unit: "gram" },
|
|
358
|
+
{ name: "Box Of Chocolate", value: "boxofchocolate", illustration: "outgoing", unit: "gram" },
|
|
359
|
+
{ name: "Rubber Boots", value: "rubberboots", illustration: "christmas", unit: "combo" },
|
|
360
|
+
{ name: "Moving Box", value:"movingbox", illustration: "outgoing", unit: "kgram" },
|
|
361
|
+
];
|
|
373
362
|
|
|
374
|
-
const weights$
|
|
375
|
-
"
|
|
363
|
+
const weights$2 = {
|
|
364
|
+
"gram": [
|
|
376
365
|
{ name: "50g", abbreviation: 'g', value: 50 },
|
|
377
366
|
{ name: "100g", abbreviation: 'g', value: 100 },
|
|
378
367
|
{ name: "250g", abbreviation: 'g', value: 250 },
|
|
@@ -380,7 +369,7 @@ const weights$1 = {
|
|
|
380
369
|
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
381
370
|
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
382
371
|
],
|
|
383
|
-
"
|
|
372
|
+
"kgram": [
|
|
384
373
|
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
385
374
|
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
386
375
|
{ name: "3kg", abbreviation: 'kg', value: 3 },
|
|
@@ -400,6 +389,31 @@ const weights$1 = {
|
|
|
400
389
|
{ name: "17kg", abbreviation: 'kg', value: 17 },
|
|
401
390
|
{ name: "18kg", abbreviation: 'kg', value: 18 },
|
|
402
391
|
{ name: "20kg", abbreviation: 'kg', value: 20 },
|
|
392
|
+
],
|
|
393
|
+
"combo": [
|
|
394
|
+
{ name: "50g", abbreviation: 'g', value: 50 },
|
|
395
|
+
{ name: "100g", abbreviation: 'g', value: 100 },
|
|
396
|
+
{ name: "250g", abbreviation: 'g', value: 250 },
|
|
397
|
+
{ name: "500g", abbreviation: 'g', value: 500 },
|
|
398
|
+
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
399
|
+
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
400
|
+
{ name: "3kg", abbreviation: 'kg', value: 3 },
|
|
401
|
+
{ name: "4kg", abbreviation: 'kg', value: 4 },
|
|
402
|
+
{ name: "5kg", abbreviation: 'kg', value: 5 },
|
|
403
|
+
{ name: "6kg", abbreviation: 'kg', value: 6 },
|
|
404
|
+
{ name: "7Kg", abbreviation: 'kg', value: 7 },
|
|
405
|
+
{ name: "8kg", abbreviation: 'kg', value: 8 },
|
|
406
|
+
{ name: "9kg", abbreviation: 'kg', value: 9 },
|
|
407
|
+
{ name: "10kg", abbreviation: 'kg', value: 10 },
|
|
408
|
+
{ name: "11kg", abbreviation: 'kg', value: 11 },
|
|
409
|
+
{ name: "12kg", abbreviation: 'kg', value: 12 },
|
|
410
|
+
{ name: "13kg", abbreviation: 'kg', value: 13 },
|
|
411
|
+
{ name: "14kg", abbreviation: 'kg', value: 14 },
|
|
412
|
+
{ name: "15kg", abbreviation: 'kg', value: 15 },
|
|
413
|
+
{ name: "16kg", abbreviation: 'kg', value: 16 },
|
|
414
|
+
{ name: "17kg", abbreviation: 'kg', value: 17 },
|
|
415
|
+
{ name: "18kg", abbreviation: 'kg', value: 18 },
|
|
416
|
+
{ name: "20kg", abbreviation: 'kg', value: 20 },
|
|
403
417
|
]
|
|
404
418
|
};
|
|
405
419
|
|
|
@@ -2130,6 +2144,60 @@ async function convertFileFromStream(stream, filterColumnNames = ["what", "deliv
|
|
|
2130
2144
|
return fileData;
|
|
2131
2145
|
}
|
|
2132
2146
|
|
|
2147
|
+
async function convertFileForSizeCategogy(stream, filterColumnNames = ["sizecategory"]) {
|
|
2148
|
+
const toFilterValue = (x) => x.toLowerCase().replace(/\s+/g, '');
|
|
2149
|
+
const sheets = await readXlsxFile(stream, { getSheets: true });
|
|
2150
|
+
let dataRows = [];
|
|
2151
|
+
let sizecategoryColumn;
|
|
2152
|
+
let sheetsData = await Promise.all(sheets.map(async (sheet) => { return await readXlsxFile(stream, { sheet: sheet.name }) }));
|
|
2153
|
+
|
|
2154
|
+
let types = {};
|
|
2155
|
+
sheetsData.forEach(sheetData => {
|
|
2156
|
+
const firstRow = sheetData.shift().map(x => toFilterValue(x));
|
|
2157
|
+
// Set up column for adding options
|
|
2158
|
+
firstRow.forEach((col, i) => {
|
|
2159
|
+
if (typeof types[col] === "undefined" && filterColumnNames.includes(col)) {
|
|
2160
|
+
types[col] = [];
|
|
2161
|
+
}
|
|
2162
|
+
if(col === "sizecategory")
|
|
2163
|
+
sizecategoryColumn = i;
|
|
2164
|
+
});
|
|
2165
|
+
|
|
2166
|
+
sheetData.forEach((row, rowindex) => {
|
|
2167
|
+
// read sizeCategory column of each row and split it to save data for each item
|
|
2168
|
+
const firstColRow = row[sizecategoryColumn];
|
|
2169
|
+
const sizeCatColumnValue = firstColRow.split('/');
|
|
2170
|
+
|
|
2171
|
+
sizeCatColumnValue.forEach((value, j) => {
|
|
2172
|
+
const dataRow = {};
|
|
2173
|
+
|
|
2174
|
+
firstRow.forEach(async (col, i) => {
|
|
2175
|
+
const rowVal = (i === sizecategoryColumn) ? value : row[i];
|
|
2176
|
+
dataRow[col] = rowVal;
|
|
2177
|
+
|
|
2178
|
+
// Add to types options
|
|
2179
|
+
if (filterColumnNames.includes(col)) {
|
|
2180
|
+
const filterVal = toFilterValue(rowVal);
|
|
2181
|
+
dataRow[col] = filterVal;
|
|
2182
|
+
|
|
2183
|
+
if (!types[col].includes(filterVal)) {
|
|
2184
|
+
types[col].push(filterVal);
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
});
|
|
2188
|
+
dataRows.push(dataRow);
|
|
2189
|
+
});
|
|
2190
|
+
});
|
|
2191
|
+
});
|
|
2192
|
+
|
|
2193
|
+
|
|
2194
|
+
const fileData = {
|
|
2195
|
+
"types": types,
|
|
2196
|
+
"data": dataRows
|
|
2197
|
+
};
|
|
2198
|
+
return fileData;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2133
2201
|
const appendToMap = (map, propName, value) => {
|
|
2134
2202
|
const items = map.get(propName);
|
|
2135
2203
|
if (!items) {
|
|
@@ -2314,6 +2382,297 @@ const createStore = (defaultState, shouldUpdate) => {
|
|
|
2314
2382
|
return map;
|
|
2315
2383
|
};
|
|
2316
2384
|
|
|
2385
|
+
// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
|
|
2386
|
+
const { state: state$4, onChange: onChange$4 } = createStore({
|
|
2387
|
+
i18n: {
|
|
2388
|
+
componentheading: '',
|
|
2389
|
+
deliveryscopeheading: '',
|
|
2390
|
+
sizeheading: '',
|
|
2391
|
+
resultlistheading: '',
|
|
2392
|
+
weightlabel: '',
|
|
2393
|
+
maxweightlabel: '',
|
|
2394
|
+
maxmeasurementlabel: '',
|
|
2395
|
+
senddirectcta: '',
|
|
2396
|
+
stampshopcta: '',
|
|
2397
|
+
},
|
|
2398
|
+
market: {
|
|
2399
|
+
currency: ""
|
|
2400
|
+
}
|
|
2401
|
+
});
|
|
2402
|
+
|
|
2403
|
+
const pnFindPriceCss = "pn-find-price .findprice-form{max-width:50em;margin:0 auto}pn-find-price h2,pn-find-price .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-find-price .sizecategory{text-align:center;margin-bottom:3rem}pn-find-price .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-find-price .weightoption-input{width:5em;position:relative}pn-find-price .weightoption-input input::-webkit-outer-spin-button,pn-find-price .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-find-price .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-find-price .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-find-price .weightoption-range input{width:calc(100% - 1.5em)}pn-find-price .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-find-price .resultlist{margin:3em 0}";
|
|
2404
|
+
|
|
2405
|
+
let PnfindPrice = class extends HTMLElement {
|
|
2406
|
+
constructor() {
|
|
2407
|
+
super();
|
|
2408
|
+
this.__registerHost();
|
|
2409
|
+
this.source = "https://com-integration.postnord.com/globalassets/global/prices/sv-findprice.xlsx";
|
|
2410
|
+
this.language = "sv";
|
|
2411
|
+
this.market = "se";
|
|
2412
|
+
this.filteredItems = [];
|
|
2413
|
+
this.weight = { value: 0, name: "" };
|
|
2414
|
+
this.weightvalue = 0;
|
|
2415
|
+
this.sourceData = { types: [], data: [] };
|
|
2416
|
+
this.sizecategory = { value: "", name: "", icon: "", unit: "" };
|
|
2417
|
+
}
|
|
2418
|
+
componentWillLoad() {
|
|
2419
|
+
this.setState();
|
|
2420
|
+
this.getDataSource();
|
|
2421
|
+
}
|
|
2422
|
+
async getDataSource() {
|
|
2423
|
+
const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;
|
|
2424
|
+
const req = await fetch(this.source + cacheBusting);
|
|
2425
|
+
const reqbody = await req.blob();
|
|
2426
|
+
try {
|
|
2427
|
+
const convertedData = await convertFileForSizeCategogy(reqbody);
|
|
2428
|
+
this.sourceData = convertedData;
|
|
2429
|
+
this.filterItems();
|
|
2430
|
+
}
|
|
2431
|
+
catch (e) {
|
|
2432
|
+
console.log('Unable to parse data');
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
setState() {
|
|
2436
|
+
if (this.market) {
|
|
2437
|
+
state$4.market = markets$2[this.market];
|
|
2438
|
+
}
|
|
2439
|
+
if (this.language && translations$9[this.language]) {
|
|
2440
|
+
state$4.i18n = translations$9[this.language];
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
filterItems() {
|
|
2444
|
+
var _a;
|
|
2445
|
+
if (!((_a = this.sourceData) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
2446
|
+
console.log('Data has not yet been loaded');
|
|
2447
|
+
return;
|
|
2448
|
+
}
|
|
2449
|
+
const deliveryScopeData = this.sourceData.data.filter((x) => x.deliveryscope === "Sweden");
|
|
2450
|
+
if (!this.sizecategory) {
|
|
2451
|
+
return;
|
|
2452
|
+
}
|
|
2453
|
+
const sizeItemData = deliveryScopeData.filter((x) => x.sizecategory === this.sizecategory.value);
|
|
2454
|
+
if (!this.weight || !this.weight.value) {
|
|
2455
|
+
return;
|
|
2456
|
+
}
|
|
2457
|
+
const comparisonWeight = this.weight.value <= 20 ? this.weight.value * 1000 : this.weight.value;
|
|
2458
|
+
let weightFilteredData = sizeItemData.filter(x => (x.maxweight <= 20 ? x.maxweight * 1000 : x.maxweight) === comparisonWeight);
|
|
2459
|
+
// if no value found select the next available value
|
|
2460
|
+
if (weightFilteredData.length === 0) {
|
|
2461
|
+
weightFilteredData = sizeItemData.filter(x => (x.maxweight <= 20 ? x.maxweight * 1000 : x.maxweight) >= comparisonWeight);
|
|
2462
|
+
if (weightFilteredData.length > 0) {
|
|
2463
|
+
//sort based on the maxvalue
|
|
2464
|
+
weightFilteredData.sort((a, b) => { return (a.maxweight - b.maxweight); });
|
|
2465
|
+
// map to get the next unique item
|
|
2466
|
+
const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item["id"], item])).values()];
|
|
2467
|
+
if (uniqueWeightOptions.length > 0) {
|
|
2468
|
+
weightFilteredData = uniqueWeightOptions;
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
this.filteredItems = weightFilteredData;
|
|
2473
|
+
}
|
|
2474
|
+
render() {
|
|
2475
|
+
return (h("div", null, h("div", { class: "findprice-form" }, h("div", null, (h("div", { class: "heading" }, state$4.i18n.deliveryscopeheading))), h("div", null, (h("div", { class: "heading" }, state$4.i18n.componentheading)), h("div", { class: "sizecategory" }, sizeCategories.map((sizeCategory) => (h("pn-choice-button", { choiceid: sizeCategory.value, value: sizeCategory.value, name: "sizecategory", type: "radio", checked: sizeCategory.value === this.sizecategory.value, onChange: () => {
|
|
2476
|
+
this.sizecategory = sizeCategories.filter(x => x.value === sizeCategory.value)[0];
|
|
2477
|
+
if (this.weight.value === 0) {
|
|
2478
|
+
this.weight = weights$2[this.sizecategory.unit][0];
|
|
2479
|
+
this.weightvalue = this.weight.value;
|
|
2480
|
+
}
|
|
2481
|
+
} }, h("pn-illustration", { illustration: sizeCategory.illustration }), " ", sizeCategory.name))))), (this.sizecategory.value && weights$2[this.sizecategory.unit]) ? (h("div", null, (state$4.i18n.sizeheading) ? (h("div", { class: "heading" }, state$4.i18n.sizeheading)) : null, h("div", { class: "weightoption" }, h("div", { class: "weightoption-input" }, h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: state$4.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
|
|
2482
|
+
if (e && e.target && e.target.value) {
|
|
2483
|
+
const weightNum = parseInt(e.target.value, 10);
|
|
2484
|
+
if (!isNaN(weightNum)) {
|
|
2485
|
+
let matchingWeights = weights$2[this.sizecategory.unit].filter((x) => {
|
|
2486
|
+
let weightInGrams = (x.abbreviation === "kg") ? x.value * 1000 : x.value;
|
|
2487
|
+
return weightInGrams >= weightNum;
|
|
2488
|
+
});
|
|
2489
|
+
if (matchingWeights && matchingWeights.length > 0) {
|
|
2490
|
+
this.weight = matchingWeights[0];
|
|
2491
|
+
this.weightvalue = this.weight.value;
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
} }), h("span", { class: "weightoption-input-abbreviation" }, this.weight.abbreviation)), h("div", { class: "weightoption-range" }, h("input", { type: "range", id: "weightrange", name: "weightrange", list: "weightlist", value: (!this.weight.value) ? 0 : weights$2[this.sizecategory.unit].findIndex((x) => x.value === this.weightvalue), onChange: (e) => {
|
|
2496
|
+
const value = e.target.value;
|
|
2497
|
+
this.weight = weights$2[this.sizecategory.unit][value];
|
|
2498
|
+
this.weightvalue = this.weight.value;
|
|
2499
|
+
}, min: "0",
|
|
2500
|
+
// max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }
|
|
2501
|
+
max: weights$2[this.sizecategory.unit].length - 1 }), h("datalist", { id: "weightlist" }, weights$2[this.sizecategory.unit].map((weight, weightindex) => {
|
|
2502
|
+
let labelText = weight.name;
|
|
2503
|
+
if (weights$2[this.sizecategory.unit].length > 6) {
|
|
2504
|
+
labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === weights$2[this.sizecategory.unit].length - 1) ? weight.name : '';
|
|
2505
|
+
}
|
|
2506
|
+
return (h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {}))));
|
|
2507
|
+
})))))) : null), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state$4.i18n.resultlistheading) ? (h("div", { class: "heading" }, state$4.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-find-price-result", { item: item })))))) : null));
|
|
2508
|
+
}
|
|
2509
|
+
static get watchers() { return {
|
|
2510
|
+
"market": ["setState"],
|
|
2511
|
+
"language": ["setState"],
|
|
2512
|
+
"weightvalue": ["filterItems"],
|
|
2513
|
+
"sizecategory": ["filterItems"]
|
|
2514
|
+
}; }
|
|
2515
|
+
static get style() { return pnFindPriceCss; }
|
|
2516
|
+
};
|
|
2517
|
+
|
|
2518
|
+
const pnFindPriceResultCss = "pn-find-price-result .test{margin:3em 0}";
|
|
2519
|
+
|
|
2520
|
+
let PnfindPriceResult = class extends HTMLElement {
|
|
2521
|
+
constructor() {
|
|
2522
|
+
super();
|
|
2523
|
+
this.__registerHost();
|
|
2524
|
+
this.item = null;
|
|
2525
|
+
this.shownitems = [];
|
|
2526
|
+
this.weightText = "";
|
|
2527
|
+
}
|
|
2528
|
+
componentWillLoad() {
|
|
2529
|
+
this.composeItems();
|
|
2530
|
+
}
|
|
2531
|
+
composeItems() {
|
|
2532
|
+
this.shownitems = [];
|
|
2533
|
+
if (this.item.pricestamps) {
|
|
2534
|
+
this.shownitems.push(Object.assign(Object.assign({}, this.item), { priceagent: null, pricesenddirect: null }));
|
|
2535
|
+
}
|
|
2536
|
+
if (this.item.priceagent) {
|
|
2537
|
+
this.shownitems.push(Object.assign(Object.assign({}, this.item), { pricestamps: null, pricesenddirect: null }));
|
|
2538
|
+
}
|
|
2539
|
+
if (this.item.pricesenddirect) {
|
|
2540
|
+
this.shownitems.push(Object.assign(Object.assign({}, this.item), { pricestamps: null, priceagent: null }));
|
|
2541
|
+
}
|
|
2542
|
+
this.weightText = (this.item.maxweight <= 20) ? this.item.maxweight + 'kg' :
|
|
2543
|
+
(this.item.maxweight > 999) ? Math.round(this.item.maxweight / 1000) + " kg" : this.item.maxweight + " g";
|
|
2544
|
+
}
|
|
2545
|
+
render() {
|
|
2546
|
+
return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.note ? (h("small", { slot: "note" }, h("p", null, item.note))) : null, item.maxweight ? (h("pn-product-tile-info", { label: state$4.i18n.maxweightlabel, text: this.weightText })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state$4.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "", amount: item.priceagent + '', currency: state$4.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: state$4.i18n.stampshopcta, amount: item.pricestamps + '', currency: state$4.market.currency })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: state$4.i18n.senddirectcta, amount: item.pricesenddirect + '', currency: state$4.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null)))));
|
|
2547
|
+
}
|
|
2548
|
+
static get watchers() { return {
|
|
2549
|
+
"item": ["composeItems"]
|
|
2550
|
+
}; }
|
|
2551
|
+
static get style() { return pnFindPriceResultCss; }
|
|
2552
|
+
};
|
|
2553
|
+
|
|
2554
|
+
const translations$8 = {
|
|
2555
|
+
'sv': {
|
|
2556
|
+
'componentheading': 'Vad vill du skicka?',
|
|
2557
|
+
'deliveryscopeheading': 'Hit eller dit?',
|
|
2558
|
+
'sizeheading': 'Hur mycket väger det?',
|
|
2559
|
+
'resultlistheading': 'Några utvalda val',
|
|
2560
|
+
'weightlabel': 'Vikt',
|
|
2561
|
+
'maxweightlabel': 'Maxvikt',
|
|
2562
|
+
'maxmeasurementlabel': 'Maxvolym',
|
|
2563
|
+
'senddirectcta': 'Köp frakt via Skicka Direkt',
|
|
2564
|
+
'stampshopcta': 'Köp frimärken via vår webshop',
|
|
2565
|
+
},
|
|
2566
|
+
'en': {
|
|
2567
|
+
'componentheading': 'What do you want to send?',
|
|
2568
|
+
'deliveryscopeheading': 'Here or there?',
|
|
2569
|
+
'sizeheading': 'How much does it weigh?',
|
|
2570
|
+
'resultlistheading': 'Some suitable options for you',
|
|
2571
|
+
'weightlabel': 'Weight',
|
|
2572
|
+
'maxweightlabel': 'Max weight',
|
|
2573
|
+
'maxmeasurementlabel': 'Maximum measurement',
|
|
2574
|
+
'senddirectcta': 'Buy shipping in Send Direct',
|
|
2575
|
+
'stampshopcta': 'Order home stamps from the webshop',
|
|
2576
|
+
},
|
|
2577
|
+
'da': {
|
|
2578
|
+
'componentheading': 'Vad vill du skicka?',
|
|
2579
|
+
'deliveryscopeheading': 'Here or there?',
|
|
2580
|
+
'sizeheading': 'How much does it weigh?',
|
|
2581
|
+
'resultlistheading': 'Some suitable options for you',
|
|
2582
|
+
'weightlabel': 'Vægt',
|
|
2583
|
+
'maxweightlabel': 'Max vægt',
|
|
2584
|
+
'maxmeasurementlabel': 'Maks. Volumen',
|
|
2585
|
+
'senddirectcta': 'Buy shipping in Send Direct',
|
|
2586
|
+
'stampshopcta': 'Order home stamps from the webshop',
|
|
2587
|
+
},
|
|
2588
|
+
'no': {
|
|
2589
|
+
'componentheading': 'Vad vill du skicka?',
|
|
2590
|
+
'deliveryscopeheading': 'Here or there?',
|
|
2591
|
+
'sizeheading': 'How much does it weigh?',
|
|
2592
|
+
'resultlistheading': 'Some suitable options for you',
|
|
2593
|
+
'weightlabel': 'Vekt',
|
|
2594
|
+
'maxweightlabel': 'Maks vekt',
|
|
2595
|
+
'maxmeasurementlabel': 'Maks volum',
|
|
2596
|
+
'senddirectcta': 'Buy shipping in Send Direct',
|
|
2597
|
+
'stampshopcta': 'Order home stamps from the webshop',
|
|
2598
|
+
},
|
|
2599
|
+
'fi': {
|
|
2600
|
+
'componentheading': 'Vad vill du skicka?',
|
|
2601
|
+
'deliveryscopeheading': 'Here or there?',
|
|
2602
|
+
'sizeheading': 'How much does it weigh?',
|
|
2603
|
+
'resultlistheading': 'Some suitable options for you',
|
|
2604
|
+
'weightlabel': 'Paino',
|
|
2605
|
+
'maxweightlabel': 'Max paino',
|
|
2606
|
+
'maxmeasurementlabel': 'Max äänenvoimakkuus',
|
|
2607
|
+
'senddirectcta': 'Buy shipping in Send Direct',
|
|
2608
|
+
'stampshopcta': 'Order home stamps from the webshop',
|
|
2609
|
+
}
|
|
2610
|
+
};
|
|
2611
|
+
const markets$1 = {
|
|
2612
|
+
'se': {
|
|
2613
|
+
"currency": "kr",
|
|
2614
|
+
},
|
|
2615
|
+
'dk': {
|
|
2616
|
+
"currency": "dk",
|
|
2617
|
+
},
|
|
2618
|
+
'fi': {
|
|
2619
|
+
"currency": " €",
|
|
2620
|
+
},
|
|
2621
|
+
'no': {
|
|
2622
|
+
"currency": "kr",
|
|
2623
|
+
}
|
|
2624
|
+
};
|
|
2625
|
+
|
|
2626
|
+
const postagetypes = [
|
|
2627
|
+
{ name: "Brev", value: "letter", illustration: "letterbox-reply-letter-plants" },
|
|
2628
|
+
{ name: "Paket", value: "parcel", illustration: "tracking" }
|
|
2629
|
+
];
|
|
2630
|
+
|
|
2631
|
+
const deliveryscopes = {
|
|
2632
|
+
"letter": [
|
|
2633
|
+
{ name: "Sweden", value: "sweden", illustration: "letterboxes" },
|
|
2634
|
+
{ name: "Abroad", value: "abroad", illustration: "character-box-letters-globe" },
|
|
2635
|
+
|
|
2636
|
+
],
|
|
2637
|
+
"parcel": [
|
|
2638
|
+
{ name: "Sweden", value: "sweden", illustration: "letterboxes" },
|
|
2639
|
+
{ name: "Within Europe", value:"withineurope", illustration: "character-box-letters-globe" },
|
|
2640
|
+
{ name: "Outside Europe", value:"outsideeurope", illustration: "discover" },
|
|
2641
|
+
]
|
|
2642
|
+
};
|
|
2643
|
+
|
|
2644
|
+
const weights$1 = {
|
|
2645
|
+
"letter": [
|
|
2646
|
+
{ name: "50g", abbreviation: 'g', value: 50 },
|
|
2647
|
+
{ name: "100g", abbreviation: 'g', value: 100 },
|
|
2648
|
+
{ name: "250g", abbreviation: 'g', value: 250 },
|
|
2649
|
+
{ name: "500g", abbreviation: 'g', value: 500 },
|
|
2650
|
+
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
2651
|
+
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
2652
|
+
],
|
|
2653
|
+
"parcel": [
|
|
2654
|
+
{ name: "1kg", abbreviation: 'kg', value: 1 },
|
|
2655
|
+
{ name: "2kg", abbreviation: 'kg', value: 2 },
|
|
2656
|
+
{ name: "3kg", abbreviation: 'kg', value: 3 },
|
|
2657
|
+
{ name: "4kg", abbreviation: 'kg', value: 4 },
|
|
2658
|
+
{ name: "5kg", abbreviation: 'kg', value: 5 },
|
|
2659
|
+
{ name: "6kg", abbreviation: 'kg', value: 6 },
|
|
2660
|
+
{ name: "7Kg", abbreviation: 'kg', value: 7 },
|
|
2661
|
+
{ name: "8kg", abbreviation: 'kg', value: 8 },
|
|
2662
|
+
{ name: "9kg", abbreviation: 'kg', value: 9 },
|
|
2663
|
+
{ name: "10kg", abbreviation: 'kg', value: 10 },
|
|
2664
|
+
{ name: "11kg", abbreviation: 'kg', value: 11 },
|
|
2665
|
+
{ name: "12kg", abbreviation: 'kg', value: 12 },
|
|
2666
|
+
{ name: "13kg", abbreviation: 'kg', value: 13 },
|
|
2667
|
+
{ name: "14kg", abbreviation: 'kg', value: 14 },
|
|
2668
|
+
{ name: "15kg", abbreviation: 'kg', value: 15 },
|
|
2669
|
+
{ name: "16kg", abbreviation: 'kg', value: 16 },
|
|
2670
|
+
{ name: "17kg", abbreviation: 'kg', value: 17 },
|
|
2671
|
+
{ name: "18kg", abbreviation: 'kg', value: 18 },
|
|
2672
|
+
{ name: "20kg", abbreviation: 'kg', value: 20 },
|
|
2673
|
+
]
|
|
2674
|
+
};
|
|
2675
|
+
|
|
2317
2676
|
// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
|
|
2318
2677
|
const { state: state$3, onChange: onChange$3 } = createStore({
|
|
2319
2678
|
i18n: {
|
|
@@ -2531,6 +2890,7 @@ let PnlanguageSelector = class extends HTMLElement {
|
|
|
2531
2890
|
this.options = [];
|
|
2532
2891
|
}
|
|
2533
2892
|
componentWillLoad() {
|
|
2893
|
+
this.setInitialSelectedLanguageName();
|
|
2534
2894
|
this.setTranslations();
|
|
2535
2895
|
}
|
|
2536
2896
|
componentDidLoad() {
|
|
@@ -2540,6 +2900,20 @@ let PnlanguageSelector = class extends HTMLElement {
|
|
|
2540
2900
|
this.setSelectedLanguageName();
|
|
2541
2901
|
this.addEventBindingsToOptions();
|
|
2542
2902
|
}
|
|
2903
|
+
setInitialSelectedLanguageName() {
|
|
2904
|
+
if (!window.Intl || !this.value) {
|
|
2905
|
+
return;
|
|
2906
|
+
}
|
|
2907
|
+
const langs = new Intl.DisplayNames([this.value], { type: 'language' });
|
|
2908
|
+
if (!langs) {
|
|
2909
|
+
return;
|
|
2910
|
+
}
|
|
2911
|
+
const languageName = langs.of(this.value);
|
|
2912
|
+
if (!languageName) {
|
|
2913
|
+
return;
|
|
2914
|
+
}
|
|
2915
|
+
this.selectedLanguageName = languageName.charAt(0).toUpperCase() + languageName.slice(1);
|
|
2916
|
+
}
|
|
2543
2917
|
addEventBindingsToOptions() {
|
|
2544
2918
|
const options = [].slice.apply(this.hostElement.querySelectorAll("pn-language-selector-option"));
|
|
2545
2919
|
options.map((option) => {
|
|
@@ -3244,7 +3618,6 @@ let PnMarketwebSiteheader$2 = class extends HTMLElement {
|
|
|
3244
3618
|
await this.setStateFromData(data);
|
|
3245
3619
|
}
|
|
3246
3620
|
onFetchRefreshed(data) {
|
|
3247
|
-
console.log('Data was updated after request', data);
|
|
3248
3621
|
this.setStateFromData(data);
|
|
3249
3622
|
}
|
|
3250
3623
|
getLinkContentByType(linkType = "") {
|
|
@@ -3452,8 +3825,7 @@ class MarketWebLoginManager {
|
|
|
3452
3825
|
return `${this.getBaseUrl()}${this.endpoints.authorizationEndpoint}?redirectionUrl=${redirectPage}`;
|
|
3453
3826
|
}
|
|
3454
3827
|
getLogoutUrl(redirectPage = "") {
|
|
3455
|
-
|
|
3456
|
-
redirectPage = redirectPage ? redirectPage : currentPage;
|
|
3828
|
+
redirectPage = window.location.origin + '/logout';
|
|
3457
3829
|
return `${this.getBaseUrl()}${this.endpoints.logoutEndpoint}?redirectionUrl=${redirectPage}&authorization=${this.store.get(this.keys.token)}`;
|
|
3458
3830
|
}
|
|
3459
3831
|
getUserInfo() {
|
|
@@ -3656,7 +4028,6 @@ let PnMarketwebSiteheader$1 = class extends HTMLElement {
|
|
|
3656
4028
|
}
|
|
3657
4029
|
}
|
|
3658
4030
|
onLanguageSelectorChange(e) {
|
|
3659
|
-
console.log('onLanguageSelectorChange(e', e);
|
|
3660
4031
|
this.language = e.detail;
|
|
3661
4032
|
window.dispatchEvent(new CustomEvent('marketweb-languagechange', { detail: this.language }));
|
|
3662
4033
|
}
|
|
@@ -3805,10 +4176,10 @@ let PnMarketwebSiteheader$1 = class extends HTMLElement {
|
|
|
3805
4176
|
}
|
|
3806
4177
|
render() {
|
|
3807
4178
|
var _a, _b, _c, _d, _e, _f;
|
|
3808
|
-
return (h(Host, { language: this.language, market: this.market, environment: this.environment }, h("header", null, h("div", { class: "siteheader-row" }, h("div", { class: "siteheader-topleft" }, h("slot", { name: "topleft" }), !this.hideSiteSelector &&
|
|
4179
|
+
return (h(Host, { language: this.language, market: this.market, environment: this.environment }, h("header", null, h("div", { class: "siteheader-row" }, h("div", { class: "siteheader-topleft" }, h("slot", { name: "topleft" }), (this.gotData && this.siteSelector && !this.hideSiteSelector) &&
|
|
3809
4180
|
h("pn-site-selector", { language: this.language, buttontext: (_b = (_a = this.siteSelector) === null || _a === void 0 ? void 0 : _a.currentSiteTitle) !== null && _b !== void 0 ? _b : 'postnord' }, (this.gotData && ((_c = this.siteSelector) === null || _c === void 0 ? void 0 : _c.currentSiteTitle)) &&
|
|
3810
4181
|
h("pn-site-selector-item", { heading: this.siteSelector.currentSiteTitle + ' ', description: this.siteSelector.currentSiteDescription }), (this.gotData && ((_d = this.siteSelector) === null || _d === void 0 ? void 0 : _d.siteSelections)) && this.siteSelector.siteSelections.map((site) => h("pn-site-selector-item", { heading: site.linkText + ' ', description: site.linkDescription, url: this.adjustSiteSelectorUrl(site.href), newwindow: site.openInNewWindow })))), h("div", { class: "siteheader-logocontainer" }, h("a", { href: this.homePageLink, title: "Home", class: "siteheader-logolink" }, h("svg", { class: "siteheader-logo", xmlns: "http://www.w3.org/2000/svg", width: "12.7rem", height: "2.4rem", viewBox: "0 0 141.73 26.65" }, h("path", { d: "M108.84,13.35c0,6.34-5.17,9-10,9S89,19.76,89,13.63c0-6.28,5.08-9,10-9S108.84,7.25,108.84,13.35Zm-6.56.18a3.4,3.4,0,1,0-6.8,0,3.29,3.29,0,0,0,3.42,3.41A3.24,3.24,0,0,0,102.28,13.54Zm-83,0c0,4.83-3.32,8.82-8.49,8.82a6.54,6.54,0,0,1-4.65-1.57v5.86H0V5.16H6.17V6.8a6.43,6.43,0,0,1,5.11-2.18C16.41,4.62,19.31,8.58,19.31,13.54Zm-6.53,0A3.27,3.27,0,0,0,9.4,10,3.28,3.28,0,0,0,6,13.54,3.29,3.29,0,0,0,9.4,16.95,3.24,3.24,0,0,0,12.78,13.54Zm103.69,0.27c0-2.54,1.54-3.32,3.6-3.32a6.56,6.56,0,0,1,2.08.3L122.3,5.1a3.92,3.92,0,0,0-1.45-.18c-3.45,0-4.38,2.18-4.38,2.18V5.16H110.3V21.84h6.17v-8ZM141.73,0V21.84h-6.16V20.21a6.43,6.43,0,0,1-5.11,2.18c-5.14,0-8-4-8-8.91s3.32-8.82,8.49-8.82a6.54,6.54,0,0,1,4.65,1.57v-5Zm-6,13.48a3.28,3.28,0,0,0-3.41-3.41A3.24,3.24,0,0,0,129,13.47,3.4,3.4,0,1,0,135.75,13.47ZM81.35,4.62c-3.6,0-4.9,2.18-4.9,2.18V5.16H70.29V21.84h6.16V13.29c0-2.11.79-3.08,2.69-3.08s2.18,1.57,2.18,3.57v8.07h6.22V11.6C87.55,7,85.34,4.62,81.35,4.62ZM64.07,1.42H57.9V21.84h6.16V10.36H67l2.81-5.2H64.07V1.42ZM50.26,11.21c-2-.3-2.87-0.3-2.87-1.09s0.81-.94,2.42-0.94a16.15,16.15,0,0,1,5.11.91L56,5.41a24.56,24.56,0,0,0-6.13-.75c-5.89,0-9,2.27-9,5.89,0,2.81,1.66,4.47,6.53,5.11,2.06,0.27,2.81.39,2.81,1.15s-0.82,1-2.24,1a16.67,16.67,0,0,1-6-1.3L40.77,21.3a22.14,22.14,0,0,0,6.68,1c6.35,0,9.28-2.24,9.28-5.89C56.72,13.54,55.15,12,50.26,11.21ZM40.19,13.35c0,6.34-5.17,9-10,9s-9.82-2.6-9.82-8.73c0-6.28,5.08-9,10-9S40.19,7.25,40.19,13.35Zm-6.56.18a3.4,3.4,0,1,0-6.8,0,3.28,3.28,0,0,0,3.41,3.41A3.24,3.24,0,0,0,33.63,13.54Z", fill: "#00A0D6", transform: "translate(0 0)" })))), h("div", { class: "siteheader-topright" }, h("slot", { name: "toprightstart" }), (this.gotData && this.loginDialog && !this.hideLogin) && (h("pn-marketweb-siteheader-login", { token: this.token, loginDialog: this.loginDialog, endpoint: this.endpoint, i18n: this.i18n })), (this.gotData && this.languageOptions && this.languageOptions.length) && !this.hideLanguageSelector &&
|
|
3811
|
-
h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))), h("slot", { name: "toprightend" }))), h("div", { class: "siteheader-row" }, h("div", { class: "siteheader-menu" }, h("pn-mainnav", { market: this.market, language: this.language, onMenuOpenChange: (e) => {
|
|
4182
|
+
h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))), h("slot", { name: "toprightend" }))), h("div", { class: "siteheader-row" }, h("div", { class: "siteheader-menu" }, (this.gotData && this.menuItems) && (h("pn-mainnav", { market: this.market, language: this.language, onMenuOpenChange: (e) => {
|
|
3812
4183
|
document.body.setAttribute("data-siteheader-menuopen", (e.detail + ''));
|
|
3813
4184
|
} }, h("pn-mainnav-level", null, h("pn-mainnav-list", null, this.menuItems.map((item) => {
|
|
3814
4185
|
var _a, _b;
|
|
@@ -3818,11 +4189,11 @@ let PnMarketwebSiteheader$1 = class extends HTMLElement {
|
|
|
3818
4189
|
var _a;
|
|
3819
4190
|
return (h("pn-mainnav-link", { name: childitem.name, href: childitem.href, target: (_a = childitem.linkTarget) !== null && _a !== void 0 ? _a : "_self", linkid: childitem.trackingId }));
|
|
3820
4191
|
})), (item.promotedMenuItems && item.promotedMenuItems.length > 0) &&
|
|
3821
|
-
h("pn-mainnav-list", { heading: item.promotedMenuItemsHeader }, item.promotedMenuItems.map((childitem) => (h("pn-mainnav-link", { href: childitem.href, name: childitem.linkText, target: childitem.openInNewWindow ? "_blank" : "_self", linkid: this.promotedItemId(childitem) })))))));
|
|
4192
|
+
h("pn-mainnav-list", { heading: item.promotedMenuItemsHeader }, item.promotedMenuItems.map((childitem) => (h("pn-mainnav-link", { href: childitem.href, name: childitem.linkText, target: childitem.openInNewWindow ? "_blank" : "_self", linkid: this.promotedItemId(childitem) + item.id })))))));
|
|
3822
4193
|
})), h("div", { slot: "footer", class: "siteheader-menu-footer" }, (this.gotData && this.loginDialog && !this.hideLogin) && (h("pn-marketweb-siteheader-login", { emitEvents: false, loginDialog: this.loginDialog, endpoint: this.endpoint, i18n: this.i18n })), (this.gotData && this.languageOptions && this.languageOptions.length) && !this.hideLanguageSelector &&
|
|
3823
4194
|
h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))), !this.hideSiteSelector &&
|
|
3824
4195
|
h("pn-site-selector", { language: this.language }, (this.gotData && ((_e = this.siteSelector) === null || _e === void 0 ? void 0 : _e.currentSiteTitle)) &&
|
|
3825
|
-
h("pn-site-selector-item", { heading: this.siteSelector.currentSiteTitle, description: this.siteSelector.currentSiteDescription }), (this.gotData && ((_f = this.siteSelector) === null || _f === void 0 ? void 0 : _f.siteSelections)) && this.siteSelector.siteSelections.map((site) => h("pn-site-selector-item", { heading: site.linkText, description: site.linkDescription, url: site.pageLink, newwindow: site.openInNewWindow })))), h("div", { slot: "top", class: "siteheader-menu-top" }, h("pn-marketweb-siteheader-search", { search: this.search, "hide-search": this.hideSearch, i18n: this.i18n }))))), h("pn-marketweb-siteheader-search", { search: this.search, "hide-search": this.hideSearch, "show-only-link": this.minimizeSearch, i18n: this.i18n })))));
|
|
4196
|
+
h("pn-site-selector-item", { heading: this.siteSelector.currentSiteTitle, description: this.siteSelector.currentSiteDescription }), (this.gotData && ((_f = this.siteSelector) === null || _f === void 0 ? void 0 : _f.siteSelections)) && this.siteSelector.siteSelections.map((site) => h("pn-site-selector-item", { heading: site.linkText, description: site.linkDescription, url: site.pageLink, newwindow: site.openInNewWindow })))), h("div", { slot: "top", class: "siteheader-menu-top" }, h("pn-marketweb-siteheader-search", { search: this.search, "hide-search": this.hideSearch, i18n: this.i18n })))))), h("pn-marketweb-siteheader-search", { search: this.search, "hide-search": this.hideSearch, "show-only-link": this.minimizeSearch, i18n: this.i18n })))));
|
|
3826
4197
|
}
|
|
3827
4198
|
get hostElement() { return this; }
|
|
3828
4199
|
static get watchers() { return {
|
|
@@ -3956,7 +4327,7 @@ let PnMarketwebSiteheaderLogin$1 = class extends HTMLElement {
|
|
|
3956
4327
|
: (h("ul", null, h("li", null, h("pn-button", { href: this.loginManager.getLoginUrl(this.loginDialog.loginUrl), target: "_top" }, this.loginDialog.loginLinkText)), h("li", null, h("pn-button", { href: this.loginDialog.registerUrl, target: "_top", appearance: "light", variant: "outlined" }, this.loginDialog.createLoginLinkText)))))
|
|
3957
4328
|
:
|
|
3958
4329
|
h("div", null, h("ul", null, this.loginDialog.loggedInLinks.map((link) => {
|
|
3959
|
-
const isLogoutLink = link.href.indexOf('logout');
|
|
4330
|
+
const isLogoutLink = link.href.indexOf('logout') !== -1;
|
|
3960
4331
|
const href = (isLogoutLink) ? this.loginManager.getLogoutUrl(link.href.replace('logout', '').replace('http://window.location.href/?', '').replace('https://window.location.href/?', '')) : link.href;
|
|
3961
4332
|
return (h("li", null, h("pn-button", Object.assign({ href: href, id: this.uniqueId(link.linkText) }, (link.openInNewWindow && { target: '_blank' }), this.linkAppearanceAttributes(link), { onClick: () => {
|
|
3962
4333
|
if (isLogoutLink) {
|
|
@@ -4823,6 +5194,8 @@ const PnBonusProgressbarLevel = /*@__PURE__*/proxyCustomElement(PnBonusProgressb
|
|
|
4823
5194
|
const PnChoiceButton = /*@__PURE__*/proxyCustomElement(PnChoiceButton$1, [4,"pn-choice-button",{"value":[520],"name":[1],"choiceid":[1],"type":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]);
|
|
4824
5195
|
const PnFilterCheckbox = /*@__PURE__*/proxyCustomElement(PnFilterCheckbox$1, [1,"pn-filter-checkbox",{"value":[520],"name":[1],"checkboxid":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]);
|
|
4825
5196
|
const PnFilterSearch = /*@__PURE__*/proxyCustomElement(PnFilterSearch$1, [1,"pn-filter-search",{"disabled":[4],"placeholder":[1],"inputid":[1],"name":[1],"autocomplete":[1],"value":[1],"label":[1],"loading":[4],"button":[1],"light":[4]},[[0,"input","inputHandler"]]]);
|
|
5197
|
+
const PnFindPrice = /*@__PURE__*/proxyCustomElement(PnfindPrice, [0,"pn-find-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"weight":[32],"weightvalue":[32],"sourceData":[32],"sizecategory":[32]}]);
|
|
5198
|
+
const PnFindPriceResult = /*@__PURE__*/proxyCustomElement(PnfindPriceResult, [0,"pn-find-price-result",{"item":[1040],"shownitems":[16],"weightText":[32]}]);
|
|
4826
5199
|
const PnFindServiceAndPrice = /*@__PURE__*/proxyCustomElement(PnfindServiceAndPrice, [0,"pn-find-service-and-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"postagetype":[32],"weight":[32],"weightvalue":[32],"deliveryscope":[32],"sourceData":[32]}]);
|
|
4827
5200
|
const PnFindServiceAndPriceResult = /*@__PURE__*/proxyCustomElement(PnfindServiceAndPriceResult, [0,"pn-find-service-and-price-result",{"item":[1040],"shownitems":[16],"weightText":[32]}]);
|
|
4828
5201
|
const PnLanguageSelector = /*@__PURE__*/proxyCustomElement(PnlanguageSelector, [4,"pn-language-selector",{"value":[1537],"selectedLanguageName":[32],"options":[32],"i18n":[32]}]);
|
|
@@ -4857,6 +5230,8 @@ const defineCustomElements = (opts) => {
|
|
|
4857
5230
|
PnChoiceButton,
|
|
4858
5231
|
PnFilterCheckbox,
|
|
4859
5232
|
PnFilterSearch,
|
|
5233
|
+
PnFindPrice,
|
|
5234
|
+
PnFindPriceResult,
|
|
4860
5235
|
PnFindServiceAndPrice,
|
|
4861
5236
|
PnFindServiceAndPriceResult,
|
|
4862
5237
|
PnLanguageSelector,
|
|
@@ -4891,4 +5266,4 @@ const defineCustomElements = (opts) => {
|
|
|
4891
5266
|
}
|
|
4892
5267
|
};
|
|
4893
5268
|
|
|
4894
|
-
export { PnBonusProgressbar, PnBonusProgressbarLevel, PnChoiceButton, PnFilterCheckbox, PnFilterSearch, PnFindServiceAndPrice, PnFindServiceAndPriceResult, PnLanguageSelector, PnLanguageSelectorOption, PnMainnav, PnMainnavLevel, PnMainnavLink, PnMainnavList, PnMarketwebSitefooter, PnMarketwebSiteheader, PnMarketwebSiteheaderLogin, PnMarketwebSiteheaderSearch, PnPexPricefinder, PnProductPricelist, PnProductPricelistResult, PnProductTile, PnProductTileInfo, PnProductTilePrice, PnProfileSelector, PnSidenav, PnSidenavLevel, PnSidenavLink, PnSiteFooter, PnSiteFooterCol, PnSiteSelector, PnSiteSelectorItem, defineCustomElements };
|
|
5269
|
+
export { PnBonusProgressbar, PnBonusProgressbarLevel, PnChoiceButton, PnFilterCheckbox, PnFilterSearch, PnFindPrice, PnFindPriceResult, PnFindServiceAndPrice, PnFindServiceAndPriceResult, PnLanguageSelector, PnLanguageSelectorOption, PnMainnav, PnMainnavLevel, PnMainnavLink, PnMainnavList, PnMarketwebSitefooter, PnMarketwebSiteheader, PnMarketwebSiteheaderLogin, PnMarketwebSiteheaderSearch, PnPexPricefinder, PnProductPricelist, PnProductPricelistResult, PnProductTile, PnProductTileInfo, PnProductTilePrice, PnProfileSelector, PnSidenav, PnSidenavLevel, PnSidenavLink, PnSiteFooter, PnSiteFooterCol, PnSiteSelector, PnSiteSelectorItem, defineCustomElements };
|
|
@@ -87,8 +87,7 @@ class MarketWebLoginManager {
|
|
|
87
87
|
return `${this.getBaseUrl()}${this.endpoints.authorizationEndpoint}?redirectionUrl=${redirectPage}`;
|
|
88
88
|
}
|
|
89
89
|
getLogoutUrl(redirectPage = "") {
|
|
90
|
-
|
|
91
|
-
redirectPage = redirectPage ? redirectPage : currentPage;
|
|
90
|
+
redirectPage = window.location.origin + '/logout';
|
|
92
91
|
return `${this.getBaseUrl()}${this.endpoints.logoutEndpoint}?redirectionUrl=${redirectPage}&authorization=${this.store.get(this.keys.token)}`;
|
|
93
92
|
}
|
|
94
93
|
getUserInfo() {
|