@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.
@@ -3120,11 +3120,23 @@ var formatPrice = function (value, _a) {
3120
3120
  // this prevents `Intl.NumberFormat` from rounding the number
3121
3121
  var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
3122
3122
  var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
3123
- return new Intl.NumberFormat(overridedLocale, {
3123
+ var result = new Intl.NumberFormat(overridedLocale, {
3124
3124
  style: 'currency',
3125
3125
  currency: currency,
3126
3126
  maximumFractionDigits: 3,
3127
3127
  }).format(valueToFormat);
3128
+ if (currency === 'NZD') {
3129
+ // intlFormat does not support NZD$ currency format
3130
+ var resultOverridden = result.replace('NZ$', 'NZD$');
3131
+ return resultOverridden;
3132
+ }
3133
+ if (currency === 'SGD') {
3134
+ // intlFormat does not support singapure currency
3135
+ var onlyValue = result.slice(result.indexOf('SGD') + 4);
3136
+ var resultOverridden = "SGD$".concat(onlyValue);
3137
+ return resultOverridden;
3138
+ }
3139
+ return result;
3128
3140
  };
3129
3141
 
3130
3142
  var CardSectionType;
@@ -3470,7 +3482,7 @@ var PriceLabelV2$1 = function (_a) {
3470
3482
  var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
3471
3483
  var isDiscount = discount && isDiffFinalAndOriginalPrice;
3472
3484
  var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
3473
- var supportedCurrencies = ['AU$', 'CA$', '£'];
3485
+ var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
3474
3486
  var currencySymbol = '$';
3475
3487
  if (typeof productFinalPrice === 'string') {
3476
3488
  supportedCurrencies.forEach(function (availableCurrency) {
@@ -3542,7 +3554,7 @@ var PriceLabelV3 = function (_a) {
3542
3554
  var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
3543
3555
  var isDiscount = discount && isDiffFinalAndOriginalPrice;
3544
3556
  var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
3545
- var supportedCurrencies = ['AU$', 'CA$', '£'];
3557
+ var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
3546
3558
  var currencySymbol = '$';
3547
3559
  if (typeof finalPrice === 'string') {
3548
3560
  supportedCurrencies.forEach(function (availableCurrency) {
@@ -3613,7 +3625,7 @@ var PriceLabel = function (_a) {
3613
3625
  var theme = useTheme();
3614
3626
  var isDiffFinalAndOriginalPrice = originalPrice !== finalPrice;
3615
3627
  var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
3616
- var supportedCurrencies = ['AU$', 'CA$', '£'];
3628
+ var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
3617
3629
  var currencySymbol = '$';
3618
3630
  if (typeof finalPrice === 'string') {
3619
3631
  supportedCurrencies.forEach(function (availableCurrency) {
@@ -3649,7 +3661,7 @@ var PriceLabelV2 = function (_a) {
3649
3661
  var theme = useTheme();
3650
3662
  var isDiffFinalAndOriginalPrice = originalPrice !== finalPrice;
3651
3663
  var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
3652
- var supportedCurrencies = ['AU$', 'CA$', '£'];
3664
+ var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
3653
3665
  var currencySymbol = '$';
3654
3666
  if (typeof finalPrice === 'string') {
3655
3667
  supportedCurrencies.forEach(function (availableCurrency) {
@@ -6652,7 +6664,7 @@ var PriceLabelV4 = function (_a) {
6652
6664
  var theme = useTheme();
6653
6665
  var isMobile = useWindowDimensions().isMobile;
6654
6666
  var productFinalPrice = clubPrice;
6655
- var supportedCurrencies = ['AU$', 'CA$', '£'];
6667
+ var supportedCurrencies = ['AU$', 'CA$', '£', 'NZD$', 'SGD$'];
6656
6668
  var currencySymbol = '$';
6657
6669
  if (typeof productFinalPrice === 'string') {
6658
6670
  supportedCurrencies.forEach(function (availableCurrency) {