@trafilea/afrodita-components 6.5.8 → 6.5.10
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.esm.js
CHANGED
|
@@ -3094,13 +3094,17 @@ var AssetsProvider = function (_a) {
|
|
|
3094
3094
|
};
|
|
3095
3095
|
var useThemeAssets = function () { return useContext(AssetsContext); };
|
|
3096
3096
|
|
|
3097
|
+
var localeOverrideByCurrency = {
|
|
3098
|
+
AUD: 'am-AM',
|
|
3099
|
+
};
|
|
3097
3100
|
var formatPrice = function (value, _a) {
|
|
3098
|
-
var _b;
|
|
3099
|
-
var
|
|
3100
|
-
var
|
|
3101
|
+
var _b, _c;
|
|
3102
|
+
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;
|
|
3103
|
+
var _g = value.toFixed(3).split('.'), integer = _g[0], fraction = _g[1];
|
|
3101
3104
|
// this prevents `Intl.NumberFormat` from rounding the number
|
|
3102
3105
|
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
|
|
3103
|
-
|
|
3106
|
+
var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
|
|
3107
|
+
return new Intl.NumberFormat(overridedLocale, {
|
|
3104
3108
|
style: 'currency',
|
|
3105
3109
|
currency: currency,
|
|
3106
3110
|
maximumFractionDigits: 3,
|
|
@@ -5467,7 +5471,7 @@ var PriceLabelV2 = function (_a) {
|
|
|
5467
5471
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
5468
5472
|
var isDiscount = discount && isDiffFinalAndOriginalPrice;
|
|
5469
5473
|
var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
|
|
5470
|
-
var supportedCurrencies = ['
|
|
5474
|
+
var supportedCurrencies = ['AU$', 'CA$', '£'];
|
|
5471
5475
|
var currencySymbol = '$';
|
|
5472
5476
|
if (typeof productFinalPrice === 'string') {
|
|
5473
5477
|
supportedCurrencies.forEach(function (availableCurrency) {
|