@trafilea/afrodita-components 6.8.8 → 6.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +1 -0
- package/build/index.esm.js +9 -7
- package/build/index.esm.js.map +1 -1
- package/build/index.js +9 -7
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -2087,6 +2087,7 @@ declare const PriceLabel: React__default.FC<PriceLabelProps>;
|
|
|
2087
2087
|
declare type Props$1 = PriceLabelProps & {
|
|
2088
2088
|
savingsDisplay?: boolean;
|
|
2089
2089
|
pricePerItem?: string;
|
|
2090
|
+
hasRoundedSavings?: boolean;
|
|
2090
2091
|
};
|
|
2091
2092
|
declare const PriceLabelV2: React__default.FC<Props$1>;
|
|
2092
2093
|
|
package/build/index.esm.js
CHANGED
|
@@ -5485,7 +5485,7 @@ var templateObject_1$1F, templateObject_2$14, templateObject_3$T;
|
|
|
5485
5485
|
var FinalPriceStyledContainer$1 = newStyled.div(templateObject_1$1E || (templateObject_1$1E = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
5486
5486
|
var PriceLabelV2 = function (_a) {
|
|
5487
5487
|
var _b;
|
|
5488
|
-
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, clubOffer = _a.clubOffer, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? ComponentSize.Small : _e, _f = _a.bordersRounded, bordersRounded = _f === void 0 ? false : _f, _g = _a.savingsDisplay, savingsDisplay = _g === void 0 ? true : _g, pricePerItem = _a.pricePerItem, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "clubOffer", "color", "testId", "originalPriceStyled", "originalPriceUnderlined", "size", "bordersRounded", "savingsDisplay", "pricePerItem"]);
|
|
5488
|
+
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, clubOffer = _a.clubOffer, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? ComponentSize.Small : _e, _f = _a.bordersRounded, bordersRounded = _f === void 0 ? false : _f, _g = _a.savingsDisplay, savingsDisplay = _g === void 0 ? true : _g, pricePerItem = _a.pricePerItem, _h = _a.hasRoundedSavings, hasRoundedSavings = _h === void 0 ? true : _h, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "clubOffer", "color", "testId", "originalPriceStyled", "originalPriceUnderlined", "size", "bordersRounded", "savingsDisplay", "pricePerItem", "hasRoundedSavings"]);
|
|
5489
5489
|
var theme = useTheme();
|
|
5490
5490
|
var productFinalPrice = pricePerItem ? pricePerItem : finalPrice;
|
|
5491
5491
|
var isDiffFinalAndOriginalPrice = originalPrice !== productFinalPrice;
|
|
@@ -5523,12 +5523,14 @@ var PriceLabelV2 = function (_a) {
|
|
|
5523
5523
|
finalPriceNum = typeof productFinalPrice === 'number' ? productFinalPrice : 0;
|
|
5524
5524
|
}
|
|
5525
5525
|
var saveto = originalPriceNum - finalPriceNum;
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5526
|
+
if (hasRoundedSavings) {
|
|
5527
|
+
var decimalPart = Number((saveto - Math.floor(saveto)).toFixed(2));
|
|
5528
|
+
if (decimalPart >= 0.01 && decimalPart < 0.5) {
|
|
5529
|
+
saveto = Math.floor(saveto) + 0.0;
|
|
5530
|
+
}
|
|
5531
|
+
else if (decimalPart >= 0.51 && decimalPart < 1.0) {
|
|
5532
|
+
saveto = Math.floor(saveto) + 0.5;
|
|
5533
|
+
}
|
|
5532
5534
|
}
|
|
5533
5535
|
var savetoString = saveto.toFixed(2);
|
|
5534
5536
|
var OriginalPrice = function () { return (jsx$1(Price, __assign$1({ size: originalPriceStyled ? size : ComponentSize.Small, color: theme.component.pricing.priceLabel.price.originalPriceColor ||
|