@stigg/react-sdk 5.28.0 → 5.28.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/dist/components/utils/currencyUtils.d.ts +2 -1
- package/dist/react-sdk.cjs.development.js +8 -4
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +8 -4
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/utils/currencyUtils.ts +4 -1
- package/src/components/utils/getPaidPriceText.ts +7 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Currency } from '@stigg/js-client-sdk';
|
|
2
|
-
export declare const currencyPriceFormatter: ({ amount, currency, locale, maximumFractionDigits, minimumFractionDigits, }: {
|
|
2
|
+
export declare const currencyPriceFormatter: ({ amount, currency, locale, maximumFractionDigits, minimumFractionDigits, removeTrailingZero, }: {
|
|
3
3
|
amount: number;
|
|
4
4
|
currency?: string | undefined;
|
|
5
5
|
locale?: string | undefined;
|
|
6
6
|
maximumFractionDigits?: number | undefined;
|
|
7
7
|
minimumFractionDigits?: number | undefined;
|
|
8
|
+
removeTrailingZero?: boolean | undefined;
|
|
8
9
|
}) => string;
|
|
@@ -1158,14 +1158,16 @@ var currencyPriceFormatter = function currencyPriceFormatter(_ref) {
|
|
|
1158
1158
|
_ref$maximumFractionD = _ref.maximumFractionDigits,
|
|
1159
1159
|
maximumFractionDigits = _ref$maximumFractionD === void 0 ? 5 : _ref$maximumFractionD,
|
|
1160
1160
|
_ref$minimumFractionD = _ref.minimumFractionDigits,
|
|
1161
|
-
minimumFractionDigits = _ref$minimumFractionD === void 0 ? 0 : _ref$minimumFractionD
|
|
1161
|
+
minimumFractionDigits = _ref$minimumFractionD === void 0 ? 0 : _ref$minimumFractionD,
|
|
1162
|
+
removeTrailingZero = _ref.removeTrailingZero;
|
|
1162
1163
|
var currencyString = currency.toString();
|
|
1163
1164
|
var currencySymbol = getSymbolFromCurrency(currencyString);
|
|
1164
1165
|
var formattedPrice = new Intl.NumberFormat(locale, _extends({
|
|
1165
1166
|
maximumFractionDigits: maximumFractionDigits,
|
|
1166
1167
|
minimumFractionDigits: minimumFractionDigits,
|
|
1167
1168
|
style: 'currency',
|
|
1168
|
-
currency: currencyString
|
|
1169
|
+
currency: currencyString,
|
|
1170
|
+
trailingZeroDisplay: removeTrailingZero ? 'stripIfInteger' : 'auto'
|
|
1169
1171
|
}, currencySymbol ? {
|
|
1170
1172
|
currencyDisplay: 'code'
|
|
1171
1173
|
} : {})).format(amount || 0);
|
|
@@ -1235,7 +1237,9 @@ function getPaidPriceText(_ref) {
|
|
|
1235
1237
|
price: currencyPriceFormatter({
|
|
1236
1238
|
amount: priceNumber,
|
|
1237
1239
|
currency: currency,
|
|
1238
|
-
locale: locale
|
|
1240
|
+
locale: locale,
|
|
1241
|
+
minimumFractionDigits: 2,
|
|
1242
|
+
removeTrailingZero: true
|
|
1239
1243
|
}),
|
|
1240
1244
|
unit: unit,
|
|
1241
1245
|
tiers: tiers,
|
|
@@ -3421,7 +3425,7 @@ function mapPaywallData(paywall, showOnlyEligiblePlans) {
|
|
|
3421
3425
|
};
|
|
3422
3426
|
}
|
|
3423
3427
|
|
|
3424
|
-
var version = "5.28.
|
|
3428
|
+
var version = "5.28.2";
|
|
3425
3429
|
var name = "@stigg/react-sdk";
|
|
3426
3430
|
|
|
3427
3431
|
var StiggContext = /*#__PURE__*/React__default.createContext(null);
|