@trafilea/afrodita-components 6.42.2 → 6.42.4
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.esm.js +18 -6
- package/build/index.esm.js.map +1 -1
- package/build/index.js +18 -6
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -3146,11 +3146,23 @@ var formatPrice = function (value, _a) {
|
|
|
3146
3146
|
// this prevents `Intl.NumberFormat` from rounding the number
|
|
3147
3147
|
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
|
|
3148
3148
|
var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
|
|
3149
|
-
|
|
3149
|
+
var result = new Intl.NumberFormat(overridedLocale, {
|
|
3150
3150
|
style: 'currency',
|
|
3151
3151
|
currency: currency,
|
|
3152
3152
|
maximumFractionDigits: 3,
|
|
3153
3153
|
}).format(valueToFormat);
|
|
3154
|
+
if (currency === 'NZD') {
|
|
3155
|
+
// intlFormat does not support NZD$ currency format
|
|
3156
|
+
var resultOverridden = result.replace('NZ$', 'NZD$');
|
|
3157
|
+
return resultOverridden;
|
|
3158
|
+
}
|
|
3159
|
+
if (currency === 'SGD') {
|
|
3160
|
+
// intlFormat does not support singapure currency
|
|
3161
|
+
var onlyValue = result.slice(result.indexOf('SGD') + 4);
|
|
3162
|
+
var resultOverridden = "SGD$".concat(onlyValue);
|
|
3163
|
+
return resultOverridden;
|
|
3164
|
+
}
|
|
3165
|
+
return result;
|
|
3154
3166
|
};
|
|
3155
3167
|
|
|
3156
3168
|
exports.CardSectionType = void 0;
|
|
@@ -3496,7 +3508,7 @@ var PriceLabelV2$1 = function (_a) {
|
|
|
3496
3508
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
3497
3509
|
var isDiscount = discount && isDiffFinalAndOriginalPrice;
|
|
3498
3510
|
var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
|
|
3499
|
-
var supportedCurrencies = ['AU$', 'CA$', '£'];
|
|
3511
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
|
|
3500
3512
|
var currencySymbol = '$';
|
|
3501
3513
|
if (typeof productFinalPrice === 'string') {
|
|
3502
3514
|
supportedCurrencies.forEach(function (availableCurrency) {
|
|
@@ -3568,7 +3580,7 @@ var PriceLabelV3 = function (_a) {
|
|
|
3568
3580
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
3569
3581
|
var isDiscount = discount && isDiffFinalAndOriginalPrice;
|
|
3570
3582
|
var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
|
|
3571
|
-
var supportedCurrencies = ['AU$', 'CA$', '£'];
|
|
3583
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
|
|
3572
3584
|
var currencySymbol = '$';
|
|
3573
3585
|
if (typeof finalPrice === 'string') {
|
|
3574
3586
|
supportedCurrencies.forEach(function (availableCurrency) {
|
|
@@ -3639,7 +3651,7 @@ var PriceLabel = function (_a) {
|
|
|
3639
3651
|
var theme = useTheme();
|
|
3640
3652
|
var isDiffFinalAndOriginalPrice = originalPrice !== finalPrice;
|
|
3641
3653
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
3642
|
-
var supportedCurrencies = ['AU$', 'CA$', '£'];
|
|
3654
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
|
|
3643
3655
|
var currencySymbol = '$';
|
|
3644
3656
|
if (typeof finalPrice === 'string') {
|
|
3645
3657
|
supportedCurrencies.forEach(function (availableCurrency) {
|
|
@@ -3675,7 +3687,7 @@ var PriceLabelV2 = function (_a) {
|
|
|
3675
3687
|
var theme = useTheme();
|
|
3676
3688
|
var isDiffFinalAndOriginalPrice = originalPrice !== finalPrice;
|
|
3677
3689
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
3678
|
-
var supportedCurrencies = ['AU$', 'CA$', '£'];
|
|
3690
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
|
|
3679
3691
|
var currencySymbol = '$';
|
|
3680
3692
|
if (typeof finalPrice === 'string') {
|
|
3681
3693
|
supportedCurrencies.forEach(function (availableCurrency) {
|
|
@@ -6678,7 +6690,7 @@ var PriceLabelV4 = function (_a) {
|
|
|
6678
6690
|
var theme = useTheme();
|
|
6679
6691
|
var isMobile = useWindowDimensions().isMobile;
|
|
6680
6692
|
var productFinalPrice = clubPrice;
|
|
6681
|
-
var supportedCurrencies = ['AU$', 'CA$', '£'];
|
|
6693
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
|
|
6682
6694
|
var currencySymbol = '$';
|
|
6683
6695
|
if (typeof productFinalPrice === 'string') {
|
|
6684
6696
|
supportedCurrencies.forEach(function (availableCurrency) {
|