@postnord/pn-marketweb-components 1.0.42-beta → 1.0.44-beta2
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-5431b20e.js → MarketWebLoginManager-1282a883.js} +1 -1
- 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 +34 -0
- package/cjs/pn-find-price-store-d9aabecb.js +24 -0
- package/cjs/pn-find-price.cjs.entry.js +243 -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-card_3.cjs.entry.js +49 -0
- 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 +5 -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 +42 -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 +9 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-result.js +94 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-store.js +21 -0
- package/collection/components/widgets/pn-find-price/pn-find-price-translations.js +73 -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 +56 -0
- package/collection/components/widgets/pn-find-price/pn-find-price.js +217 -0
- package/collection/components/widgets/pn-product-card/pn-product-card-info.css +30 -0
- package/collection/components/widgets/pn-product-card/pn-product-card-info.js +92 -0
- package/collection/components/widgets/pn-product-card/pn-product-card-price.css +37 -0
- package/collection/components/widgets/pn-product-card/pn-product-card-price.js +112 -0
- package/collection/components/widgets/pn-product-card/pn-product-card.css +86 -0
- package/collection/components/widgets/pn-product-card/pn-product-card.js +26 -0
- package/collection/components/widgets/pn-product-card/product-card.stories.js +50 -0
- package/collection/globals/MarketWebLoginManager.js +1 -1
- package/collection/globals/shared/productprice/convert.js +55 -1
- package/custom-elements/index.d.ts +30 -0
- package/custom-elements/index.js +465 -66
- package/esm/{MarketWebLoginManager-12c15210.js → MarketWebLoginManager-310d2552.js} +1 -1
- 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 +30 -0
- package/esm/pn-find-price-store-8560f26c.js +22 -0
- package/esm/pn-find-price.entry.js +239 -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-card_3.entry.js +43 -0
- package/esm/pn-product-pricelist.entry.js +1 -1
- package/esm/pn-profile-selector.entry.js +1 -1
- package/esm-es5/{MarketWebLoginManager-12c15210.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-8560f26c.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-card_3.entry.js +1 -0
- package/esm-es5/pn-product-pricelist.entry.js +1 -1
- package/esm-es5/pn-profile-selector.entry.js +1 -1
- package/package.json +7 -6
- package/pn-market-web-components/{p-e6a209c6.system.entry.js → p-0d0ea574.system.entry.js} +1 -1
- package/pn-market-web-components/p-0fb48ff6.entry.js +1 -0
- package/pn-market-web-components/p-1051c2d9.system.entry.js +1 -0
- 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-412ed7a0.js → p-2456901a.js} +1 -1
- 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-390d9a03.js +1 -0
- package/pn-market-web-components/p-492e6f0d.system.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-80ca78f4.entry.js +1 -0
- 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-a425e095.system.entry.js +1 -0
- package/pn-market-web-components/{p-592ef510.entry.js → p-a5284c78.entry.js} +1 -1
- package/pn-market-web-components/p-b42fd0cb.entry.js +1 -0
- package/pn-market-web-components/{p-030c3c8a.system.entry.js → p-d133f30d.system.entry.js} +1 -1
- 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-f9437818.system.js → p-f1311662.system.js} +1 -1
- package/pn-market-web-components/p-f2898a60.system.entry.js +1 -0
- 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 +35 -0
- package/types/components/widgets/pn-find-price/pn-find-price-translations.d.ts +73 -0
- package/types/components/widgets/pn-find-price/pn-find-price-types.d.ts +51 -0
- package/types/components/widgets/pn-find-price/pn-find-price.d.ts +16 -0
- package/types/components/widgets/pn-product-card/pn-product-card-info.d.ts +7 -0
- package/types/components/widgets/pn-product-card/pn-product-card-price.d.ts +8 -0
- package/types/components/widgets/pn-product-card/pn-product-card.d.ts +3 -0
- package/types/components.d.ts +94 -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-4aa3b95d.entry.js +0 -1
- package/pn-market-web-components/p-861210ae.entry.js +0 -1
- package/pn-market-web-components/p-b2383083.system.entry.js +0 -1
- package/pn-market-web-components/p-bbb59009.entry.js +0 -1
- package/pn-market-web-components/p-ca1c99dc.system.entry.js +0 -1
- package/pn-market-web-components/p-ec1127de.system.entry.js +0 -1
- package/pn-market-web-components/p-ef8a89bc.entry.js +0 -1
- package/pn-market-web-components/p-f6b6052b.system.entry.js +0 -1
|
@@ -40,4 +40,58 @@ async function convertFileFromStream(stream, filterColumnNames = ["what", "deliv
|
|
|
40
40
|
return fileData;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
async function convertFileForSizeCategogy(stream, filterColumnNames = ["sizecategory"]) {
|
|
44
|
+
const toFilterValue = (x) => x.toLowerCase().replace(/\s+/g, '');
|
|
45
|
+
const sheets = await readXlsxFile(stream, { getSheets: true })
|
|
46
|
+
let dataRows = [];
|
|
47
|
+
let sizecategoryColumn;
|
|
48
|
+
let sheetsData = await Promise.all(sheets.map(async (sheet) => { return await readXlsxFile(stream, { sheet: sheet.name }) }));
|
|
49
|
+
|
|
50
|
+
let types = {};
|
|
51
|
+
sheetsData.forEach(sheetData => {
|
|
52
|
+
const firstRow = sheetData.shift().map(x => toFilterValue(x));
|
|
53
|
+
// Set up column for adding options
|
|
54
|
+
firstRow.forEach((col, i) => {
|
|
55
|
+
if (typeof types[col] === "undefined" && filterColumnNames.includes(col)) {
|
|
56
|
+
types[col] = [];
|
|
57
|
+
}
|
|
58
|
+
if(col === "sizecategory")
|
|
59
|
+
sizecategoryColumn = i;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
sheetData.forEach((row, rowindex) => {
|
|
63
|
+
// read sizeCategory column of each row and split it to save data for each item
|
|
64
|
+
const firstColRow = row[sizecategoryColumn];
|
|
65
|
+
const sizeCatColumnValue = firstColRow.split('/');
|
|
66
|
+
|
|
67
|
+
sizeCatColumnValue.forEach((value, j) => {
|
|
68
|
+
const dataRow = {};
|
|
69
|
+
|
|
70
|
+
firstRow.forEach(async (col, i) => {
|
|
71
|
+
const rowVal = (i === sizecategoryColumn) ? value : row[i];
|
|
72
|
+
dataRow[col] = rowVal;
|
|
73
|
+
|
|
74
|
+
// Add to types options
|
|
75
|
+
if (filterColumnNames.includes(col)) {
|
|
76
|
+
const filterVal = toFilterValue(rowVal);
|
|
77
|
+
dataRow[col] = filterVal;
|
|
78
|
+
|
|
79
|
+
if (!types[col].includes(filterVal)) {
|
|
80
|
+
types[col].push(filterVal);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
dataRows.push(dataRow);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
const fileData = {
|
|
91
|
+
"types": types,
|
|
92
|
+
"data": dataRows
|
|
93
|
+
};
|
|
94
|
+
return fileData;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { convertFileFromStream, convertFileForSizeCategogy };
|
|
@@ -32,6 +32,18 @@ export const PnFilterSearch: {
|
|
|
32
32
|
new (): PnFilterSearch;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
interface PnFindPrice extends Components.PnFindPrice, HTMLElement {}
|
|
36
|
+
export const PnFindPrice: {
|
|
37
|
+
prototype: PnFindPrice;
|
|
38
|
+
new (): PnFindPrice;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
interface PnFindPriceResult extends Components.PnFindPriceResult, HTMLElement {}
|
|
42
|
+
export const PnFindPriceResult: {
|
|
43
|
+
prototype: PnFindPriceResult;
|
|
44
|
+
new (): PnFindPriceResult;
|
|
45
|
+
};
|
|
46
|
+
|
|
35
47
|
interface PnFindServiceAndPrice extends Components.PnFindServiceAndPrice, HTMLElement {}
|
|
36
48
|
export const PnFindServiceAndPrice: {
|
|
37
49
|
prototype: PnFindServiceAndPrice;
|
|
@@ -110,6 +122,24 @@ export const PnPexPricefinder: {
|
|
|
110
122
|
new (): PnPexPricefinder;
|
|
111
123
|
};
|
|
112
124
|
|
|
125
|
+
interface PnProductCard extends Components.PnProductCard, HTMLElement {}
|
|
126
|
+
export const PnProductCard: {
|
|
127
|
+
prototype: PnProductCard;
|
|
128
|
+
new (): PnProductCard;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
interface PnProductCardInfo extends Components.PnProductCardInfo, HTMLElement {}
|
|
132
|
+
export const PnProductCardInfo: {
|
|
133
|
+
prototype: PnProductCardInfo;
|
|
134
|
+
new (): PnProductCardInfo;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
interface PnProductCardPrice extends Components.PnProductCardPrice, HTMLElement {}
|
|
138
|
+
export const PnProductCardPrice: {
|
|
139
|
+
prototype: PnProductCardPrice;
|
|
140
|
+
new (): PnProductCardPrice;
|
|
141
|
+
};
|
|
142
|
+
|
|
113
143
|
interface PnProductPricelist extends Components.PnProductPricelist, HTMLElement {}
|
|
114
144
|
export const PnProductPricelist: {
|
|
115
145
|
prototype: PnProductPricelist;
|