@stigg/react-sdk 5.28.1 → 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 +6 -5
- 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 +6 -5
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/utils/currencyUtils.ts +4 -3
- 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,7 +1158,8 @@ 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({
|
|
@@ -1166,8 +1167,7 @@ var currencyPriceFormatter = function currencyPriceFormatter(_ref) {
|
|
|
1166
1167
|
minimumFractionDigits: minimumFractionDigits,
|
|
1167
1168
|
style: 'currency',
|
|
1168
1169
|
currency: currencyString,
|
|
1169
|
-
|
|
1170
|
-
trailingZeroDisplay: 'stripIfInteger'
|
|
1170
|
+
trailingZeroDisplay: removeTrailingZero ? 'stripIfInteger' : 'auto'
|
|
1171
1171
|
}, currencySymbol ? {
|
|
1172
1172
|
currencyDisplay: 'code'
|
|
1173
1173
|
} : {})).format(amount || 0);
|
|
@@ -1238,7 +1238,8 @@ function getPaidPriceText(_ref) {
|
|
|
1238
1238
|
amount: priceNumber,
|
|
1239
1239
|
currency: currency,
|
|
1240
1240
|
locale: locale,
|
|
1241
|
-
minimumFractionDigits: 2
|
|
1241
|
+
minimumFractionDigits: 2,
|
|
1242
|
+
removeTrailingZero: true
|
|
1242
1243
|
}),
|
|
1243
1244
|
unit: unit,
|
|
1244
1245
|
tiers: tiers,
|
|
@@ -3424,7 +3425,7 @@ function mapPaywallData(paywall, showOnlyEligiblePlans) {
|
|
|
3424
3425
|
};
|
|
3425
3426
|
}
|
|
3426
3427
|
|
|
3427
|
-
var version = "5.28.
|
|
3428
|
+
var version = "5.28.2";
|
|
3428
3429
|
var name = "@stigg/react-sdk";
|
|
3429
3430
|
|
|
3430
3431
|
var StiggContext = /*#__PURE__*/React__default.createContext(null);
|