hemfixarna-web-components 1.8.1 → 1.8.2
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/dist/cjs/hemfixarna-address_15.cjs.entry.js +61 -28
- package/dist/cjs/hemfixarna-address_15.cjs.entry.js.map +1 -1
- package/dist/cjs/hemfixarna-byggmax.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-category.cjs.entry.js +2 -2
- package/dist/cjs/hemfixarna-components.cjs.js +2 -2
- package/dist/cjs/hemfixarna-components.cjs.js.map +1 -1
- package/dist/cjs/hemfixarna-doro.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-elfa.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-forebygg.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-hornbach.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-kbygg.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-klint.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-kund.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-power.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-service.cjs.entry.js +2 -2
- package/dist/cjs/hemfixarna-skanska.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-superfront.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-tesla.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js +1 -1
- package/dist/cjs/hemfixarna-zaptec.cjs.entry.js +1 -1
- package/dist/cjs/{index-3e8dcb29.js → index-6af772cf.js} +2 -2
- package/dist/cjs/{index-3e8dcb29.js.map → index-6af772cf.js.map} +1 -1
- package/dist/cjs/{index-e6926623.js → index-b83343b9.js} +20 -74
- package/dist/cjs/index-b83343b9.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js +2 -2
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -1
- package/dist/collection/utils/calc.js +55 -22
- package/dist/collection/utils/calc.js.map +1 -1
- package/dist/esm/hemfixarna-address_15.entry.js +61 -28
- package/dist/esm/hemfixarna-address_15.entry.js.map +1 -1
- package/dist/esm/hemfixarna-byggmax.entry.js +1 -1
- package/dist/esm/hemfixarna-category.entry.js +2 -2
- package/dist/esm/hemfixarna-components.js +3 -3
- package/dist/esm/hemfixarna-components.js.map +1 -1
- package/dist/esm/hemfixarna-doro.entry.js +1 -1
- package/dist/esm/hemfixarna-elfa.entry.js +1 -1
- package/dist/esm/hemfixarna-fargvaruhuset.entry.js +1 -1
- package/dist/esm/hemfixarna-flyttsmart.entry.js +1 -1
- package/dist/esm/hemfixarna-forebygg.entry.js +1 -1
- package/dist/esm/hemfixarna-hornbach.entry.js +1 -1
- package/dist/esm/hemfixarna-kbygg.entry.js +1 -1
- package/dist/esm/hemfixarna-klint.entry.js +1 -1
- package/dist/esm/hemfixarna-kund.entry.js +1 -1
- package/dist/esm/hemfixarna-norrgavel.entry.js +1 -1
- package/dist/esm/hemfixarna-power.entry.js +1 -1
- package/dist/esm/hemfixarna-service.entry.js +2 -2
- package/dist/esm/hemfixarna-skanska.entry.js +1 -1
- package/dist/esm/hemfixarna-sparfonster.entry.js +1 -1
- package/dist/esm/hemfixarna-string-furniture.entry.js +1 -1
- package/dist/esm/hemfixarna-superfront.entry.js +1 -1
- package/dist/esm/hemfixarna-tesla.entry.js +1 -1
- package/dist/esm/hemfixarna-traningspartner.entry.js +1 -1
- package/dist/esm/hemfixarna-zaptec.entry.js +1 -1
- package/dist/esm/{index-ea1d222e.js → index-04bcf90e.js} +20 -74
- package/dist/esm/index-04bcf90e.js.map +1 -0
- package/dist/esm/{index-aa51ad9d.js → index-8282f88e.js} +2 -2
- package/dist/esm/{index-aa51ad9d.js.map → index-8282f88e.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
- package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
- package/dist/hemfixarna-components/{p-3a05b24c.entry.js → p-075a13b6.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-3b6bf910.entry.js → p-0aa722e7.entry.js} +2 -2
- package/dist/hemfixarna-components/p-1cbfbf5a.entry.js +2 -0
- package/dist/hemfixarna-components/p-1cbfbf5a.entry.js.map +1 -0
- package/dist/hemfixarna-components/{p-e2c0ddb1.entry.js → p-226a06bb.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-76cec215.entry.js → p-24b53f91.entry.js} +2 -2
- package/dist/hemfixarna-components/p-32a8152b.js +3 -0
- package/dist/hemfixarna-components/p-32a8152b.js.map +1 -0
- package/dist/hemfixarna-components/{p-7f5b7e4d.entry.js → p-49c372d6.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-b250a909.entry.js → p-506c766c.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-e63f00b7.entry.js → p-53edf50e.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-fcb4a599.entry.js → p-66515865.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-d26af1b1.entry.js → p-6c0e0f95.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-a66f910f.entry.js → p-8cc96dd9.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-c7a68aec.entry.js → p-9b409902.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-6d17838c.entry.js → p-a09f4a5d.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-642db21e.js → p-b397b966.js} +2 -2
- package/dist/hemfixarna-components/{p-85caa0b1.entry.js → p-bf515028.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-a64997e6.entry.js → p-d013eeee.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-89e35a2b.entry.js → p-d281e9e3.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-ae532b1e.entry.js → p-d6af83de.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-e2cd711c.entry.js → p-e8800c3b.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-7bdc4485.entry.js → p-eaa3e1c0.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-eabbb263.entry.js → p-ee6d1a35.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-e0c54744.entry.js → p-f6de66c8.entry.js} +2 -2
- package/dist/hemfixarna-components/{p-d96ab852.entry.js → p-facaf951.entry.js} +2 -2
- package/dist/types/stencil-public-runtime.d.ts +0 -3
- package/dist/types/utils/calc.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-e6926623.js.map +0 -1
- package/dist/esm/index-ea1d222e.js.map +0 -1
- package/dist/hemfixarna-components/p-6aed6e88.entry.js +0 -2
- package/dist/hemfixarna-components/p-6aed6e88.entry.js.map +0 -1
- package/dist/hemfixarna-components/p-c707b937.js +0 -3
- package/dist/hemfixarna-components/p-c707b937.js.map +0 -1
- /package/dist/hemfixarna-components/{p-3a05b24c.entry.js.map → p-075a13b6.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-3b6bf910.entry.js.map → p-0aa722e7.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-e2c0ddb1.entry.js.map → p-226a06bb.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-76cec215.entry.js.map → p-24b53f91.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-7f5b7e4d.entry.js.map → p-49c372d6.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-b250a909.entry.js.map → p-506c766c.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-e63f00b7.entry.js.map → p-53edf50e.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-fcb4a599.entry.js.map → p-66515865.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-d26af1b1.entry.js.map → p-6c0e0f95.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-a66f910f.entry.js.map → p-8cc96dd9.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-c7a68aec.entry.js.map → p-9b409902.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-6d17838c.entry.js.map → p-a09f4a5d.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-642db21e.js.map → p-b397b966.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-85caa0b1.entry.js.map → p-bf515028.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-a64997e6.entry.js.map → p-d013eeee.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-89e35a2b.entry.js.map → p-d281e9e3.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-ae532b1e.entry.js.map → p-d6af83de.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-e2cd711c.entry.js.map → p-e8800c3b.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-7bdc4485.entry.js.map → p-eaa3e1c0.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-eabbb263.entry.js.map → p-ee6d1a35.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-e0c54744.entry.js.map → p-f6de66c8.entry.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-d96ab852.entry.js.map → p-facaf951.entry.js.map} +0 -0
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
6
|
-
const index$1 = require('./index-
|
5
|
+
const index = require('./index-b83343b9.js');
|
6
|
+
const index$1 = require('./index-6af772cf.js');
|
7
7
|
const index$2 = require('./index-739bf321.js');
|
8
8
|
|
9
9
|
const hideField = (field) => {
|
@@ -188,39 +188,72 @@ const getItemPrice = (item) => {
|
|
188
188
|
const calculateRot = () => {
|
189
189
|
const totalWithRot = index$1.state.cart.reduce((acc, curr) => {
|
190
190
|
return curr.rot ? acc + getItemPrice(curr) : acc;
|
191
|
-
}, 0) + calculateStartFee().rot;
|
191
|
+
}, 0) + (index$1.state.cart.some(item => item.rot) ? calculateStartFee().rot : 0);
|
192
192
|
const totalWithoutRot = index$1.state.cart.reduce((acc, curr) => {
|
193
|
-
|
194
|
-
|
193
|
+
var _a;
|
194
|
+
const partsPrice = curr.parts.reduce((acc, part) => {
|
195
|
+
return acc + part.price * part.amount;
|
195
196
|
}, 0);
|
196
|
-
|
197
|
-
|
197
|
+
const startFee = ((_a = curr.start_fee_obj) === null || _a === void 0 ? void 0 : _a.price) || 0;
|
198
|
+
if (curr.rot) {
|
199
|
+
if (!acc.startFeeApplied) {
|
200
|
+
acc.startFeeApplied = true;
|
201
|
+
acc.amount += curr.price * curr.amount + partsPrice + startFee;
|
202
|
+
}
|
203
|
+
else {
|
204
|
+
acc.amount += curr.price * curr.amount + partsPrice;
|
205
|
+
}
|
206
|
+
}
|
207
|
+
return acc;
|
208
|
+
}, { amount: 0, startFeeApplied: false }).amount;
|
198
209
|
return totalWithoutRot - totalWithRot;
|
199
210
|
};
|
200
|
-
const calculateRut = () => {
|
201
|
-
const totalWithRut = index$1.state.cart.reduce((acc, curr) => {
|
202
|
-
return curr.rut ? acc + getItemPrice(curr) : acc;
|
203
|
-
}, 0) + calculateStartFee().rut;
|
204
|
-
const totalWithoutRut = index$1.state.cart.reduce((acc, curr) => {
|
205
|
-
const partsPrice = curr.parts.reduce((acc, curr) => {
|
206
|
-
return acc + curr.price * curr.amount;
|
207
|
-
}, 0);
|
208
|
-
return curr.rut ? acc + curr.price * curr.amount + partsPrice : acc;
|
209
|
-
}, 0) + Number(index$1.state.options.start_fee);
|
210
|
-
return totalWithoutRut - totalWithRut;
|
211
|
-
};
|
212
211
|
const calculateGreenDiscount = () => {
|
213
212
|
const totalWithGreen = index$1.state.cart.reduce((acc, curr) => {
|
214
213
|
return curr.green ? acc + getItemPrice(curr) : acc;
|
215
|
-
}, 0) + calculateStartFee().green;
|
214
|
+
}, 0) + (index$1.state.cart.some(item => item.green) ? calculateStartFee().green : 0);
|
216
215
|
const totalWithoutGreen = index$1.state.cart.reduce((acc, curr) => {
|
217
|
-
|
218
|
-
|
216
|
+
var _a;
|
217
|
+
const partsPrice = curr.parts.reduce((acc, part) => {
|
218
|
+
return acc + part.price * part.amount;
|
219
219
|
}, 0);
|
220
|
-
|
221
|
-
|
220
|
+
const startFee = ((_a = curr.start_fee_obj) === null || _a === void 0 ? void 0 : _a.price) || 0;
|
221
|
+
if (curr.green) {
|
222
|
+
if (!acc.startFeeApplied) {
|
223
|
+
acc.startFeeApplied = true;
|
224
|
+
acc.amount += curr.price * curr.amount + partsPrice + startFee;
|
225
|
+
}
|
226
|
+
else {
|
227
|
+
acc.amount += curr.price * curr.amount + partsPrice;
|
228
|
+
}
|
229
|
+
}
|
230
|
+
return acc;
|
231
|
+
}, { amount: 0, startFeeApplied: false }).amount;
|
222
232
|
return totalWithoutGreen - totalWithGreen;
|
223
233
|
};
|
234
|
+
const calculateRut = () => {
|
235
|
+
const totalWithRut = index$1.state.cart.reduce((acc, curr) => {
|
236
|
+
return curr.rut ? acc + getItemPrice(curr) : acc;
|
237
|
+
}, 0) + (index$1.state.cart.some(item => item.rut) ? calculateStartFee().rut : 0);
|
238
|
+
const totalWithoutRut = index$1.state.cart.reduce((acc, curr) => {
|
239
|
+
var _a;
|
240
|
+
const partsPrice = curr.parts.reduce((acc, part) => {
|
241
|
+
return acc + part.price * part.amount;
|
242
|
+
}, 0);
|
243
|
+
const startFee = ((_a = curr.start_fee_obj) === null || _a === void 0 ? void 0 : _a.price) || 0;
|
244
|
+
if (curr.rut) {
|
245
|
+
if (!acc.startFeeApplied) {
|
246
|
+
acc.startFeeApplied = true;
|
247
|
+
acc.amount += curr.price * curr.amount + partsPrice + startFee;
|
248
|
+
}
|
249
|
+
else {
|
250
|
+
acc.amount += curr.price * curr.amount + partsPrice;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
return acc;
|
254
|
+
}, { amount: 0, startFeeApplied: false }).amount;
|
255
|
+
return totalWithoutRut - totalWithRut;
|
256
|
+
};
|
224
257
|
const getTotalPrice = () => {
|
225
258
|
return index$1.state.cart.reduce((acc, curr) => acc + getItemPrice(curr), 0) + calculateStartFee().rot + calculateStartFee().rut + calculateStartFee().green + calculateStartFee().default;
|
226
259
|
};
|
@@ -348,8 +381,8 @@ const getDefaultApiUrl = () => {
|
|
348
381
|
}
|
349
382
|
};
|
350
383
|
const getApiUrl = () => {
|
351
|
-
if (typeof process !== 'undefined' && process.env && "
|
352
|
-
return "
|
384
|
+
if (typeof process !== 'undefined' && process.env && "https://hemfixarna.se") {
|
385
|
+
return "https://hemfixarna.se";
|
353
386
|
}
|
354
387
|
return getDefaultApiUrl();
|
355
388
|
};
|
@@ -513,7 +546,7 @@ const HemfixarnaCheckout = class {
|
|
513
546
|
quantity: part.amount,
|
514
547
|
rut: 0,
|
515
548
|
rot: 0,
|
516
|
-
start_fee_id: item.start_fee_obj.ID,
|
549
|
+
start_fee_id: item.start_fee_obj ? item.start_fee_obj.ID : null,
|
517
550
|
}));
|
518
551
|
return [
|
519
552
|
{
|
@@ -522,7 +555,7 @@ const HemfixarnaCheckout = class {
|
|
522
555
|
quantity: item.amount,
|
523
556
|
rot: item.rot ? 1 : 0,
|
524
557
|
rut: item.rut ? 1 : 0,
|
525
|
-
start_fee_id: item.start_fee_obj.ID,
|
558
|
+
start_fee_id: item.start_fee_obj ? item.start_fee_obj.ID : null,
|
526
559
|
},
|
527
560
|
...parts,
|
528
561
|
];
|