@trafilea/afrodita-components 6.8.1 → 6.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/build/index.esm.js +9 -5
- package/build/index.esm.js.map +1 -1
- package/build/index.js +9 -5
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -3120,13 +3120,17 @@ var AssetsProvider = function (_a) {
|
|
|
3120
3120
|
};
|
|
3121
3121
|
var useThemeAssets = function () { return React$2.useContext(AssetsContext); };
|
|
3122
3122
|
|
|
3123
|
+
var localeOverrideByCurrency = {
|
|
3124
|
+
AUD: 'am-AM',
|
|
3125
|
+
};
|
|
3123
3126
|
var formatPrice = function (value, _a) {
|
|
3124
|
-
var _b;
|
|
3125
|
-
var
|
|
3126
|
-
var
|
|
3127
|
+
var _b, _c;
|
|
3128
|
+
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f;
|
|
3129
|
+
var _g = value.toFixed(3).split('.'), integer = _g[0], fraction = _g[1];
|
|
3127
3130
|
// this prevents `Intl.NumberFormat` from rounding the number
|
|
3128
3131
|
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
|
|
3129
|
-
|
|
3132
|
+
var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
|
|
3133
|
+
return new Intl.NumberFormat(overridedLocale, {
|
|
3130
3134
|
style: 'currency',
|
|
3131
3135
|
currency: currency,
|
|
3132
3136
|
maximumFractionDigits: 3,
|
|
@@ -5511,7 +5515,7 @@ var PriceLabelV2 = function (_a) {
|
|
|
5511
5515
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
5512
5516
|
var isDiscount = discount && isDiffFinalAndOriginalPrice;
|
|
5513
5517
|
var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
|
|
5514
|
-
var supportedCurrencies = ['
|
|
5518
|
+
var supportedCurrencies = ['AU$', 'CA$', '£'];
|
|
5515
5519
|
var currencySymbol = '$';
|
|
5516
5520
|
if (typeof productFinalPrice === 'string') {
|
|
5517
5521
|
supportedCurrencies.forEach(function (availableCurrency) {
|