@evlop/commons 1.0.355 → 1.0.357
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/cjs/src/constants/iconInfo/index.d.ts +10 -0
- package/dist/cjs/src/constants/iconInfo/index.d.ts.map +1 -1
- package/dist/cjs/src/constants/iconInfo/index.js +12 -3
- package/dist/cjs/src/constants/iconInfo/index.js.map +1 -1
- package/dist/cjs/src/helpers/number-formatter/components.d.ts +19 -0
- package/dist/cjs/src/helpers/number-formatter/components.d.ts.map +1 -0
- package/dist/cjs/src/helpers/number-formatter/components.js +40 -0
- package/dist/cjs/src/helpers/number-formatter/components.js.map +1 -0
- package/dist/cjs/src/helpers/number-formatter/formatter.d.ts +6 -0
- package/dist/cjs/src/helpers/number-formatter/formatter.d.ts.map +1 -0
- package/dist/cjs/src/helpers/number-formatter/formatter.js +58 -0
- package/dist/cjs/src/helpers/number-formatter/formatter.js.map +1 -0
- package/dist/cjs/src/helpers/number-formatter/index.d.ts +5 -5
- package/dist/cjs/src/helpers/number-formatter/index.d.ts.map +1 -1
- package/dist/cjs/src/helpers/number-formatter/index.js +10 -55
- package/dist/cjs/src/helpers/number-formatter/index.js.map +1 -1
- package/dist/esm/src/constants/iconInfo/index.d.ts +10 -0
- package/dist/esm/src/constants/iconInfo/index.d.ts.map +1 -1
- package/dist/esm/src/constants/iconInfo/index.js +12 -3
- package/dist/esm/src/constants/iconInfo/index.js.map +1 -1
- package/dist/esm/src/helpers/number-formatter/components.d.ts +19 -0
- package/dist/esm/src/helpers/number-formatter/components.d.ts.map +1 -0
- package/dist/esm/src/helpers/number-formatter/components.js +30 -0
- package/dist/esm/src/helpers/number-formatter/components.js.map +1 -0
- package/dist/esm/src/helpers/number-formatter/formatter.d.ts +6 -0
- package/dist/esm/src/helpers/number-formatter/formatter.d.ts.map +1 -0
- package/dist/esm/src/helpers/number-formatter/formatter.js +49 -0
- package/dist/esm/src/helpers/number-formatter/formatter.js.map +1 -0
- package/dist/esm/src/helpers/number-formatter/index.d.ts +5 -5
- package/dist/esm/src/helpers/number-formatter/index.d.ts.map +1 -1
- package/dist/esm/src/helpers/number-formatter/index.js +6 -48
- package/dist/esm/src/helpers/number-formatter/index.js.map +1 -1
- package/dist/types/src/constants/iconInfo/index.d.ts +10 -0
- package/dist/types/src/constants/iconInfo/index.d.ts.map +1 -1
- package/dist/types/src/helpers/number-formatter/components.d.ts +19 -0
- package/dist/types/src/helpers/number-formatter/components.d.ts.map +1 -0
- package/dist/types/src/helpers/number-formatter/formatter.d.ts +6 -0
- package/dist/types/src/helpers/number-formatter/formatter.d.ts.map +1 -0
- package/dist/types/src/helpers/number-formatter/index.d.ts +5 -5
- package/dist/types/src/helpers/number-formatter/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import IconIdentifier from "./types";
|
|
2
2
|
declare function _getIconInfo(iconIdentifier: IconIdentifier | any): {
|
|
3
|
+
id: any;
|
|
4
|
+
type: string;
|
|
5
|
+
url: any;
|
|
6
|
+
name?: undefined;
|
|
7
|
+
character?: undefined;
|
|
8
|
+
isDirected?: undefined;
|
|
9
|
+
variant?: undefined;
|
|
10
|
+
} | {
|
|
3
11
|
id: any;
|
|
4
12
|
type: any;
|
|
5
13
|
name: any;
|
|
6
14
|
character: any;
|
|
7
15
|
isDirected: any;
|
|
16
|
+
url?: undefined;
|
|
8
17
|
variant?: undefined;
|
|
9
18
|
} | {
|
|
10
19
|
id: any;
|
|
@@ -13,6 +22,7 @@ declare function _getIconInfo(iconIdentifier: IconIdentifier | any): {
|
|
|
13
22
|
name: any;
|
|
14
23
|
character: any;
|
|
15
24
|
isDirected: any;
|
|
25
|
+
url?: undefined;
|
|
16
26
|
};
|
|
17
27
|
export declare const getIconInfo: typeof _getIconInfo & import("lodash").MemoizedFunction;
|
|
18
28
|
declare const reactNativeVectorIcons: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC,iBAAS,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,GAAG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC,iBAAS,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;EAoCzD;AAED,eAAO,MAAM,WAAW,yDAAwB,CAAC;AAEjD,QAAA,MAAM,sBAAsB,IAAK,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,eAAe,sBAAsB,CAAC"}
|
|
@@ -9,8 +9,17 @@ const directed_icons_1 = __importDefault(require("./directed-icons"));
|
|
|
9
9
|
const reactNativeVectorIcons_lookup_min_json_1 = __importDefault(require("./reactNativeVectorIcons.lookup.min.json"));
|
|
10
10
|
function _getIconInfo(iconIdentifier) {
|
|
11
11
|
const parts = iconIdentifier.split(':');
|
|
12
|
+
const [library] = parts;
|
|
13
|
+
if (library === 'svg') {
|
|
14
|
+
const [, url] = parts;
|
|
15
|
+
return {
|
|
16
|
+
id: iconIdentifier,
|
|
17
|
+
type: 'svg',
|
|
18
|
+
url,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
12
21
|
if (parts.length === 2) {
|
|
13
|
-
const [
|
|
22
|
+
const [, iconName] = parts;
|
|
14
23
|
const character = reactNativeVectorIcons_lookup_min_json_1.default[library]?.[iconName];
|
|
15
24
|
return {
|
|
16
25
|
id: iconIdentifier,
|
|
@@ -20,8 +29,8 @@ function _getIconInfo(iconIdentifier) {
|
|
|
20
29
|
isDirected: directed_icons_1.default[library]?.[iconName],
|
|
21
30
|
};
|
|
22
31
|
}
|
|
23
|
-
|
|
24
|
-
const [
|
|
32
|
+
if (parts.length === 3) {
|
|
33
|
+
const [, variant, iconName] = parts;
|
|
25
34
|
const character = reactNativeVectorIcons_lookup_min_json_1.default[library]?.[variant]?.[iconName];
|
|
26
35
|
return {
|
|
27
36
|
id: iconIdentifier,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAiC;AACjC,sEAA6C;AAC7C,sHAAoF;AAGpF,SAAS,YAAY,CAAC,cAAoC;IACxD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxC,IAAG,KAAK,CAAC,MAAM,KAAK,CAAC,EAAC,CAAC;QACrB,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAiC;AACjC,sEAA6C;AAC7C,sHAAoF;AAGpF,SAAS,YAAY,CAAC,cAAoC;IACxD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IACxB,IAAG,OAAO,KAAK,KAAK,EAAC,CAAC;QACpB,MAAM,CAAC,EAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,OAAO;YACL,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,KAAK;YACX,GAAG;SACJ,CAAA;IACH,CAAC;IAED,IAAG,KAAK,CAAC,MAAM,KAAK,CAAC,EAAC,CAAC;QACrB,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC;QAC3B,MAAM,SAAS,GAAG,gDAA4B,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QACpE,OAAO;YACH,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,SAAS;YACT,UAAU,EAAE,wBAAa,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC;SACjD,CAAA;IACH,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAC,CAAC;QACtB,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC;QACpC,MAAM,SAAS,GAAG,gDAA4B,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC/E,OAAO;YACH,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,OAAO;YACb,OAAO;YACP,IAAI,EAAE,QAAQ;YACd,SAAS;YACT,UAAU,EAAE,wBAAa,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC;SACjD,CAAA;IACH,CAAC;AACH,CAAC;AAEY,QAAA,WAAW,GAAG,IAAA,gBAAO,EAAC,YAAY,CAAC,CAAC;AAEjD,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAIlC,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CurrencyDisplayProps {
|
|
2
|
+
amount: number;
|
|
3
|
+
currency: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const CurrencyDisplay: ({ amount, currency }: CurrencyDisplayProps) => string;
|
|
6
|
+
export interface UnitDisplayProps {
|
|
7
|
+
value: number;
|
|
8
|
+
unit: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const UnitDisplay: ({ value, unit }: UnitDisplayProps) => string;
|
|
11
|
+
export interface PercentageDisplayProps {
|
|
12
|
+
value: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const PercentageDisplay: ({ value }: PercentageDisplayProps) => string;
|
|
15
|
+
export interface DecimalDisplayProps {
|
|
16
|
+
amount: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const DecimalDisplay: ({ amount }: DecimalDisplayProps) => string;
|
|
19
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/components.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,GAAI,sBAAsB,oBAAoB,WAGzE,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,GAAI,iBAAiB,gBAAgB,WAG5D,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,CAAC;CAEjB;AAED,eAAO,MAAM,iBAAiB,GAAI,WAAW,sBAAsB,WAGlE,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,cAAc,GAAI,YAAY,mBAAmB,WAG7D,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DecimalDisplay = exports.PercentageDisplay = exports.UnitDisplay = exports.CurrencyDisplay = void 0;
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
|
+
const i18ninstance_1 = __importDefault(require("../i18ninstance"));
|
|
9
|
+
const formatter_1 = require("./formatter");
|
|
10
|
+
const getMemoizedCurrencyFormatter = (0, lodash_1.memoize)(formatter_1.getCurrencyFormatter, (options) => options.currency);
|
|
11
|
+
const getMemoizedUnitFormatter = (0, lodash_1.memoize)(formatter_1.getUnitFormatter, (options) => options.unit);
|
|
12
|
+
const getMemoizedPercentageFormatter = (0, lodash_1.memoize)(formatter_1.getPercentageFormatter);
|
|
13
|
+
const getMemoizedDecimalFormatter = (0, lodash_1.memoize)(formatter_1.getDecimalFormatter);
|
|
14
|
+
i18ninstance_1.default.on('languageChanged', () => {
|
|
15
|
+
getMemoizedCurrencyFormatter.cache.clear();
|
|
16
|
+
getMemoizedUnitFormatter.cache.clear();
|
|
17
|
+
getMemoizedPercentageFormatter.cache.clear();
|
|
18
|
+
getMemoizedDecimalFormatter.cache.clear();
|
|
19
|
+
});
|
|
20
|
+
const CurrencyDisplay = ({ amount, currency }) => {
|
|
21
|
+
const formatter = (0, formatter_1.getCurrencyFormatter)({ currency });
|
|
22
|
+
return formatter.format(amount);
|
|
23
|
+
};
|
|
24
|
+
exports.CurrencyDisplay = CurrencyDisplay;
|
|
25
|
+
const UnitDisplay = ({ value, unit }) => {
|
|
26
|
+
const formatter = (0, formatter_1.getUnitFormatter)({ unit });
|
|
27
|
+
return formatter.format(value);
|
|
28
|
+
};
|
|
29
|
+
exports.UnitDisplay = UnitDisplay;
|
|
30
|
+
const PercentageDisplay = ({ value }) => {
|
|
31
|
+
const formatter = (0, formatter_1.getPercentageFormatter)();
|
|
32
|
+
return formatter.format(value);
|
|
33
|
+
};
|
|
34
|
+
exports.PercentageDisplay = PercentageDisplay;
|
|
35
|
+
const DecimalDisplay = ({ amount }) => {
|
|
36
|
+
const formatter = (0, formatter_1.getDecimalFormatter)();
|
|
37
|
+
return formatter.format(amount);
|
|
38
|
+
};
|
|
39
|
+
exports.DecimalDisplay = DecimalDisplay;
|
|
40
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/components.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAAiC;AACjC,mEAA2C;AAC3C,2CAAkH;AAElH,MAAM,4BAA4B,GAAE,IAAA,gBAAO,EAAC,gCAAoB,EAAE,CAAC,OAAiC,EAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AACzH,MAAM,wBAAwB,GAAE,IAAA,gBAAO,EAAC,4BAAgB,EAAE,CAAC,OAAiC,EAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC7G,MAAM,8BAA8B,GAAE,IAAA,gBAAO,EAAC,kCAAsB,CAAC,CAAA;AACrE,MAAM,2BAA2B,GAAE,IAAA,gBAAO,EAAC,+BAAmB,CAAC,CAAA;AAE/D,sBAAY,CAAC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;IACpC,4BAA4B,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC3C,wBAAwB,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACvC,8BAA8B,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC7C,2BAA2B,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;AAC9C,CAAC,CAAC,CAAC;AAOI,MAAM,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAwB,EAAE,EAAE;IAC1E,MAAM,SAAS,GAAG,IAAA,gCAAoB,EAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrD,OAAO,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B;AAOK,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAoB,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,IAAA,4BAAgB,EAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC,CAAC;AAHW,QAAA,WAAW,eAGtB;AAOK,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAA0B,EAAE,EAAE;IACnE,MAAM,SAAS,GAAG,IAAA,kCAAsB,GAAE,CAAC;IAC3C,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B;AAMK,MAAM,cAAc,GAAG,CAAC,EAAE,MAAM,EAAuB,EAAE,EAAE;IAC9D,MAAM,SAAS,GAAG,IAAA,+BAAmB,GAAE,CAAC;IACxC,OAAO,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './polyfill';
|
|
2
|
+
export declare function getCurrencyFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
3
|
+
export declare function getUnitFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
4
|
+
export declare function getPercentageFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
5
|
+
export declare function getDecimalFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
6
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/formatter.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,CAAC;AAOpB,wBAAgB,oBAAoB,CAAE,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAYrG;AAED,wBAAgB,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAYhG;AAED,wBAAgB,sBAAsB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAUtG;AAED,wBAAgB,mBAAmB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAUnG"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getCurrencyFormatter = getCurrencyFormatter;
|
|
7
|
+
exports.getUnitFormatter = getUnitFormatter;
|
|
8
|
+
exports.getPercentageFormatter = getPercentageFormatter;
|
|
9
|
+
exports.getDecimalFormatter = getDecimalFormatter;
|
|
10
|
+
const i18ninstance_1 = __importDefault(require("../i18ninstance"));
|
|
11
|
+
require("./polyfill");
|
|
12
|
+
function getNumberFormatter(options) {
|
|
13
|
+
const locales = i18ninstance_1.default.languages;
|
|
14
|
+
return new Intl.NumberFormat(locales, options);
|
|
15
|
+
}
|
|
16
|
+
function getCurrencyFormatter(numberFormatterOptions) {
|
|
17
|
+
const _numberFormatterOptions = {
|
|
18
|
+
style: 'currency',
|
|
19
|
+
currency: 'USD',
|
|
20
|
+
numberingSystem: 'latn',
|
|
21
|
+
};
|
|
22
|
+
if (numberFormatterOptions) {
|
|
23
|
+
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
24
|
+
}
|
|
25
|
+
return getNumberFormatter(_numberFormatterOptions);
|
|
26
|
+
}
|
|
27
|
+
function getUnitFormatter(numberFormatterOptions) {
|
|
28
|
+
const _numberFormatterOptions = {
|
|
29
|
+
style: 'unit',
|
|
30
|
+
notation: 'compact',
|
|
31
|
+
unitDisplay: 'narrow',
|
|
32
|
+
maximumFractionDigits: 2,
|
|
33
|
+
};
|
|
34
|
+
if (numberFormatterOptions) {
|
|
35
|
+
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
36
|
+
}
|
|
37
|
+
return getNumberFormatter(_numberFormatterOptions);
|
|
38
|
+
}
|
|
39
|
+
function getPercentageFormatter(numberFormatterOptions) {
|
|
40
|
+
const _numberFormatterOptions = {
|
|
41
|
+
style: 'percentage',
|
|
42
|
+
maximumFractionDigits: 2,
|
|
43
|
+
};
|
|
44
|
+
if (numberFormatterOptions) {
|
|
45
|
+
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
46
|
+
}
|
|
47
|
+
return getNumberFormatter(_numberFormatterOptions);
|
|
48
|
+
}
|
|
49
|
+
function getDecimalFormatter(numberFormatterOptions) {
|
|
50
|
+
const _numberFormatterOptions = {
|
|
51
|
+
style: 'decimal',
|
|
52
|
+
};
|
|
53
|
+
if (numberFormatterOptions) {
|
|
54
|
+
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
55
|
+
}
|
|
56
|
+
return getNumberFormatter(_numberFormatterOptions);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/formatter.tsx"],"names":[],"mappings":";;;;;AAQA,oDAYC;AAED,4CAYC;AAED,wDAUC;AAED,kDAUC;AA1DD,mEAA2C;AAC3C,sBAAoB;AAEpB,SAAS,kBAAkB,CAAC,OAAiC;IACzD,MAAM,OAAO,GAAG,sBAAY,CAAC,SAAS,CAAA;IACtC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,SAAgB,oBAAoB,CAAE,sBAAgE;IAClG,MAAM,uBAAuB,GAAsC;QAC/D,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,KAAK;QACf,eAAe,EAAE,MAAM;KAC1B,CAAA;IAED,IAAI,sBAAsB,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,kBAAkB,CAAC,uBAAmD,CAAC,CAAC;AACnF,CAAC;AAED,SAAgB,gBAAgB,CAAC,sBAAgE;IAC7F,MAAM,uBAAuB,GAAG;QAC5B,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,QAAQ;QACrB,qBAAqB,EAAE,CAAC;KAC3B,CAAA;IAED,IAAI,sBAAsB,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,kBAAkB,CAAC,uBAAmD,CAAC,CAAC;AACnF,CAAC;AAED,SAAgB,sBAAsB,CAAC,sBAAgE;IACnG,MAAM,uBAAuB,GAAG;QAC5B,KAAK,EAAE,YAAY;QACnB,qBAAqB,EAAE,CAAC;KAC3B,CAAA;IAED,IAAI,sBAAsB,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,kBAAkB,CAAC,uBAAmD,CAAC,CAAC;AACnF,CAAC;AAED,SAAgB,mBAAmB,CAAC,sBAAgE;IAChG,MAAM,uBAAuB,GAAG;QAC5B,KAAK,EAAE,SAAS;KACnB,CAAA;IAED,IAAI,sBAAsB,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,kBAAkB,CAAC,uBAAmD,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare function getCurrencyFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
3
|
-
declare function getUnitFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
4
|
-
declare function getPercentageFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
5
|
-
declare function getDecimalFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
1
|
+
import { getCurrencyFormatter, getDecimalFormatter, getPercentageFormatter, getUnitFormatter } from "./formatter";
|
|
6
2
|
export declare const NumberFormatter: {
|
|
7
3
|
getCurrencyFormatter: typeof getCurrencyFormatter;
|
|
8
4
|
getUnitFormatter: typeof getUnitFormatter;
|
|
9
5
|
getPercentageFormatter: typeof getPercentageFormatter;
|
|
10
6
|
getDecimalFormatter: typeof getDecimalFormatter;
|
|
7
|
+
Currency: ({ amount, currency }: import("./components").CurrencyDisplayProps) => string;
|
|
8
|
+
Unit: ({ value, unit }: import("./components").UnitDisplayProps) => string;
|
|
9
|
+
Percentage: ({ value }: import("./components").PercentageDisplayProps) => string;
|
|
10
|
+
Decimal: ({ amount }: import("./components").DecimalDisplayProps) => string;
|
|
11
11
|
};
|
|
12
12
|
export default NumberFormatter;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElH,eAAO,MAAM,eAAe;;;;;;;;;CAU3B,CAAA;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,62 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.NumberFormatter = void 0;
|
|
7
|
-
const
|
|
8
|
-
require("./
|
|
9
|
-
function getNumberFormatter(options) {
|
|
10
|
-
const locales = i18ninstance_1.default.languages;
|
|
11
|
-
return new Intl.NumberFormat(locales, options);
|
|
12
|
-
}
|
|
13
|
-
function getCurrencyFormatter(numberFormatterOptions) {
|
|
14
|
-
const _numberFormatterOptions = {
|
|
15
|
-
style: 'currency',
|
|
16
|
-
currency: 'USD',
|
|
17
|
-
numberingSystem: 'latn',
|
|
18
|
-
};
|
|
19
|
-
if (numberFormatterOptions) {
|
|
20
|
-
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
21
|
-
}
|
|
22
|
-
return getNumberFormatter(_numberFormatterOptions);
|
|
23
|
-
}
|
|
24
|
-
function getUnitFormatter(numberFormatterOptions) {
|
|
25
|
-
const _numberFormatterOptions = {
|
|
26
|
-
style: 'unit',
|
|
27
|
-
notation: 'compact',
|
|
28
|
-
unitDisplay: 'narrow',
|
|
29
|
-
maximumFractionDigits: 2,
|
|
30
|
-
};
|
|
31
|
-
if (numberFormatterOptions) {
|
|
32
|
-
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
33
|
-
}
|
|
34
|
-
return getNumberFormatter(_numberFormatterOptions);
|
|
35
|
-
}
|
|
36
|
-
function getPercentageFormatter(numberFormatterOptions) {
|
|
37
|
-
const _numberFormatterOptions = {
|
|
38
|
-
style: 'percentage',
|
|
39
|
-
maximumFractionDigits: 2,
|
|
40
|
-
};
|
|
41
|
-
if (numberFormatterOptions) {
|
|
42
|
-
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
43
|
-
}
|
|
44
|
-
return getNumberFormatter(_numberFormatterOptions);
|
|
45
|
-
}
|
|
46
|
-
function getDecimalFormatter(numberFormatterOptions) {
|
|
47
|
-
const _numberFormatterOptions = {
|
|
48
|
-
style: 'decimal',
|
|
49
|
-
};
|
|
50
|
-
if (numberFormatterOptions) {
|
|
51
|
-
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
52
|
-
}
|
|
53
|
-
return getNumberFormatter(_numberFormatterOptions);
|
|
54
|
-
}
|
|
4
|
+
const components_1 = require("./components");
|
|
5
|
+
const formatter_1 = require("./formatter");
|
|
55
6
|
exports.NumberFormatter = {
|
|
56
|
-
getCurrencyFormatter,
|
|
57
|
-
getUnitFormatter,
|
|
58
|
-
getPercentageFormatter,
|
|
59
|
-
getDecimalFormatter,
|
|
7
|
+
getCurrencyFormatter: formatter_1.getCurrencyFormatter,
|
|
8
|
+
getUnitFormatter: formatter_1.getUnitFormatter,
|
|
9
|
+
getPercentageFormatter: formatter_1.getPercentageFormatter,
|
|
10
|
+
getDecimalFormatter: formatter_1.getDecimalFormatter,
|
|
11
|
+
Currency: components_1.CurrencyDisplay,
|
|
12
|
+
Unit: components_1.UnitDisplay,
|
|
13
|
+
Percentage: components_1.PercentageDisplay,
|
|
14
|
+
Decimal: components_1.DecimalDisplay,
|
|
60
15
|
};
|
|
61
16
|
exports.default = exports.NumberFormatter;
|
|
62
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":";;;AAAA,6CAA+F;AAC/F,2CAAkH;AAErG,QAAA,eAAe,GAAG;IAC3B,oBAAoB,EAApB,gCAAoB;IACpB,gBAAgB,EAAhB,4BAAgB;IAChB,sBAAsB,EAAtB,kCAAsB;IACtB,mBAAmB,EAAnB,+BAAmB;IAEnB,QAAQ,EAAE,4BAAe;IACzB,IAAI,EAAE,wBAAW;IACjB,UAAU,EAAE,8BAAiB;IAC7B,OAAO,EAAE,2BAAc;CAC1B,CAAA;AAED,kBAAe,uBAAe,CAAC"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import IconIdentifier from "./types";
|
|
2
2
|
declare function _getIconInfo(iconIdentifier: IconIdentifier | any): {
|
|
3
|
+
id: any;
|
|
4
|
+
type: string;
|
|
5
|
+
url: any;
|
|
6
|
+
name?: undefined;
|
|
7
|
+
character?: undefined;
|
|
8
|
+
isDirected?: undefined;
|
|
9
|
+
variant?: undefined;
|
|
10
|
+
} | {
|
|
3
11
|
id: any;
|
|
4
12
|
type: any;
|
|
5
13
|
name: any;
|
|
6
14
|
character: any;
|
|
7
15
|
isDirected: any;
|
|
16
|
+
url?: undefined;
|
|
8
17
|
variant?: undefined;
|
|
9
18
|
} | {
|
|
10
19
|
id: any;
|
|
@@ -13,6 +22,7 @@ declare function _getIconInfo(iconIdentifier: IconIdentifier | any): {
|
|
|
13
22
|
name: any;
|
|
14
23
|
character: any;
|
|
15
24
|
isDirected: any;
|
|
25
|
+
url?: undefined;
|
|
16
26
|
};
|
|
17
27
|
export declare const getIconInfo: typeof _getIconInfo & import("lodash").MemoizedFunction;
|
|
18
28
|
declare const reactNativeVectorIcons: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC,iBAAS,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,GAAG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC,iBAAS,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;EAoCzD;AAED,eAAO,MAAM,WAAW,yDAAwB,CAAC;AAEjD,QAAA,MAAM,sBAAsB,IAAK,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,eAAe,sBAAsB,CAAC"}
|
|
@@ -3,8 +3,17 @@ import directedIcons from "./directed-icons";
|
|
|
3
3
|
import reactNativeVectorIconsLookup from "./reactNativeVectorIcons.lookup.min.json";
|
|
4
4
|
function _getIconInfo(iconIdentifier) {
|
|
5
5
|
const parts = iconIdentifier.split(':');
|
|
6
|
+
const [library] = parts;
|
|
7
|
+
if (library === 'svg') {
|
|
8
|
+
const [, url] = parts;
|
|
9
|
+
return {
|
|
10
|
+
id: iconIdentifier,
|
|
11
|
+
type: 'svg',
|
|
12
|
+
url,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
6
15
|
if (parts.length === 2) {
|
|
7
|
-
const [
|
|
16
|
+
const [, iconName] = parts;
|
|
8
17
|
const character = reactNativeVectorIconsLookup[library]?.[iconName];
|
|
9
18
|
return {
|
|
10
19
|
id: iconIdentifier,
|
|
@@ -14,8 +23,8 @@ function _getIconInfo(iconIdentifier) {
|
|
|
14
23
|
isDirected: directedIcons[library]?.[iconName],
|
|
15
24
|
};
|
|
16
25
|
}
|
|
17
|
-
|
|
18
|
-
const [
|
|
26
|
+
if (parts.length === 3) {
|
|
27
|
+
const [, variant, iconName] = parts;
|
|
19
28
|
const character = reactNativeVectorIconsLookup[library]?.[variant]?.[iconName];
|
|
20
29
|
return {
|
|
21
30
|
id: iconIdentifier,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,4BAA4B,MAAM,0CAA0C,CAAC;AAGpF,SAAS,YAAY,CAAC,cAAoC;IACxD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxC,IAAG,KAAK,CAAC,MAAM,KAAK,CAAC,EAAC,CAAC;QACrB,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,4BAA4B,MAAM,0CAA0C,CAAC;AAGpF,SAAS,YAAY,CAAC,cAAoC;IACxD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IACxB,IAAG,OAAO,KAAK,KAAK,EAAC,CAAC;QACpB,MAAM,CAAC,EAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,OAAO;YACL,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,KAAK;YACX,GAAG;SACJ,CAAA;IACH,CAAC;IAED,IAAG,KAAK,CAAC,MAAM,KAAK,CAAC,EAAC,CAAC;QACrB,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC;QAC3B,MAAM,SAAS,GAAG,4BAA4B,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QACpE,OAAO;YACH,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,SAAS;YACT,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC;SACjD,CAAA;IACH,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAC,CAAC;QACtB,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC;QACpC,MAAM,SAAS,GAAG,4BAA4B,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC/E,OAAO;YACH,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,OAAO;YACb,OAAO;YACP,IAAI,EAAE,QAAQ;YACd,SAAS;YACT,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC;SACjD,CAAA;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEjD,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAIlC,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CurrencyDisplayProps {
|
|
2
|
+
amount: number;
|
|
3
|
+
currency: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const CurrencyDisplay: ({ amount, currency }: CurrencyDisplayProps) => string;
|
|
6
|
+
export interface UnitDisplayProps {
|
|
7
|
+
value: number;
|
|
8
|
+
unit: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const UnitDisplay: ({ value, unit }: UnitDisplayProps) => string;
|
|
11
|
+
export interface PercentageDisplayProps {
|
|
12
|
+
value: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const PercentageDisplay: ({ value }: PercentageDisplayProps) => string;
|
|
15
|
+
export interface DecimalDisplayProps {
|
|
16
|
+
amount: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const DecimalDisplay: ({ amount }: DecimalDisplayProps) => string;
|
|
19
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/components.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,GAAI,sBAAsB,oBAAoB,WAGzE,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,GAAI,iBAAiB,gBAAgB,WAG5D,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,CAAC;CAEjB;AAED,eAAO,MAAM,iBAAiB,GAAI,WAAW,sBAAsB,WAGlE,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,cAAc,GAAI,YAAY,mBAAmB,WAG7D,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { memoize } from "lodash";
|
|
2
|
+
import i18nInstance from "../i18ninstance";
|
|
3
|
+
import { getCurrencyFormatter, getUnitFormatter, getPercentageFormatter, getDecimalFormatter } from "./formatter";
|
|
4
|
+
const getMemoizedCurrencyFormatter = memoize(getCurrencyFormatter, (options) => options.currency);
|
|
5
|
+
const getMemoizedUnitFormatter = memoize(getUnitFormatter, (options) => options.unit);
|
|
6
|
+
const getMemoizedPercentageFormatter = memoize(getPercentageFormatter);
|
|
7
|
+
const getMemoizedDecimalFormatter = memoize(getDecimalFormatter);
|
|
8
|
+
i18nInstance.on('languageChanged', () => {
|
|
9
|
+
getMemoizedCurrencyFormatter.cache.clear();
|
|
10
|
+
getMemoizedUnitFormatter.cache.clear();
|
|
11
|
+
getMemoizedPercentageFormatter.cache.clear();
|
|
12
|
+
getMemoizedDecimalFormatter.cache.clear();
|
|
13
|
+
});
|
|
14
|
+
export const CurrencyDisplay = ({ amount, currency }) => {
|
|
15
|
+
const formatter = getCurrencyFormatter({ currency });
|
|
16
|
+
return formatter.format(amount);
|
|
17
|
+
};
|
|
18
|
+
export const UnitDisplay = ({ value, unit }) => {
|
|
19
|
+
const formatter = getUnitFormatter({ unit });
|
|
20
|
+
return formatter.format(value);
|
|
21
|
+
};
|
|
22
|
+
export const PercentageDisplay = ({ value }) => {
|
|
23
|
+
const formatter = getPercentageFormatter();
|
|
24
|
+
return formatter.format(value);
|
|
25
|
+
};
|
|
26
|
+
export const DecimalDisplay = ({ amount }) => {
|
|
27
|
+
const formatter = getDecimalFormatter();
|
|
28
|
+
return formatter.format(amount);
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/components.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElH,MAAM,4BAA4B,GAAE,OAAO,CAAC,oBAAoB,EAAE,CAAC,OAAiC,EAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AACzH,MAAM,wBAAwB,GAAE,OAAO,CAAC,gBAAgB,EAAE,CAAC,OAAiC,EAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC7G,MAAM,8BAA8B,GAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACrE,MAAM,2BAA2B,GAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAE/D,YAAY,CAAC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;IACpC,4BAA4B,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC3C,wBAAwB,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACvC,8BAA8B,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC7C,2BAA2B,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;AAC9C,CAAC,CAAC,CAAC;AAOH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAwB,EAAE,EAAE;IAC1E,MAAM,SAAS,GAAG,oBAAoB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrD,OAAO,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAoB,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAA0B,EAAE,EAAE;IACnE,MAAM,SAAS,GAAG,sBAAsB,EAAE,CAAC;IAC3C,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,MAAM,EAAuB,EAAE,EAAE;IAC9D,MAAM,SAAS,GAAG,mBAAmB,EAAE,CAAC;IACxC,OAAO,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './polyfill';
|
|
2
|
+
export declare function getCurrencyFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
3
|
+
export declare function getUnitFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
4
|
+
export declare function getPercentageFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
5
|
+
export declare function getDecimalFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
6
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/formatter.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,CAAC;AAOpB,wBAAgB,oBAAoB,CAAE,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAYrG;AAED,wBAAgB,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAYhG;AAED,wBAAgB,sBAAsB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAUtG;AAED,wBAAgB,mBAAmB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAUnG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import i18nInstance from '../i18ninstance';
|
|
2
|
+
import './polyfill';
|
|
3
|
+
function getNumberFormatter(options) {
|
|
4
|
+
const locales = i18nInstance.languages;
|
|
5
|
+
return new Intl.NumberFormat(locales, options);
|
|
6
|
+
}
|
|
7
|
+
export function getCurrencyFormatter(numberFormatterOptions) {
|
|
8
|
+
const _numberFormatterOptions = {
|
|
9
|
+
style: 'currency',
|
|
10
|
+
currency: 'USD',
|
|
11
|
+
numberingSystem: 'latn',
|
|
12
|
+
};
|
|
13
|
+
if (numberFormatterOptions) {
|
|
14
|
+
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
15
|
+
}
|
|
16
|
+
return getNumberFormatter(_numberFormatterOptions);
|
|
17
|
+
}
|
|
18
|
+
export function getUnitFormatter(numberFormatterOptions) {
|
|
19
|
+
const _numberFormatterOptions = {
|
|
20
|
+
style: 'unit',
|
|
21
|
+
notation: 'compact',
|
|
22
|
+
unitDisplay: 'narrow',
|
|
23
|
+
maximumFractionDigits: 2,
|
|
24
|
+
};
|
|
25
|
+
if (numberFormatterOptions) {
|
|
26
|
+
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
27
|
+
}
|
|
28
|
+
return getNumberFormatter(_numberFormatterOptions);
|
|
29
|
+
}
|
|
30
|
+
export function getPercentageFormatter(numberFormatterOptions) {
|
|
31
|
+
const _numberFormatterOptions = {
|
|
32
|
+
style: 'percentage',
|
|
33
|
+
maximumFractionDigits: 2,
|
|
34
|
+
};
|
|
35
|
+
if (numberFormatterOptions) {
|
|
36
|
+
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
37
|
+
}
|
|
38
|
+
return getNumberFormatter(_numberFormatterOptions);
|
|
39
|
+
}
|
|
40
|
+
export function getDecimalFormatter(numberFormatterOptions) {
|
|
41
|
+
const _numberFormatterOptions = {
|
|
42
|
+
style: 'decimal',
|
|
43
|
+
};
|
|
44
|
+
if (numberFormatterOptions) {
|
|
45
|
+
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
46
|
+
}
|
|
47
|
+
return getNumberFormatter(_numberFormatterOptions);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/formatter.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,CAAC;AAEpB,SAAS,kBAAkB,CAAC,OAAiC;IACzD,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,CAAA;IACtC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAE,sBAAgE;IAClG,MAAM,uBAAuB,GAAsC;QAC/D,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,KAAK;QACf,eAAe,EAAE,MAAM;KAC1B,CAAA;IAED,IAAI,sBAAsB,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,kBAAkB,CAAC,uBAAmD,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,sBAAgE;IAC7F,MAAM,uBAAuB,GAAG;QAC5B,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,QAAQ;QACrB,qBAAqB,EAAE,CAAC;KAC3B,CAAA;IAED,IAAI,sBAAsB,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,kBAAkB,CAAC,uBAAmD,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,sBAAgE;IACnG,MAAM,uBAAuB,GAAG;QAC5B,KAAK,EAAE,YAAY;QACnB,qBAAqB,EAAE,CAAC;KAC3B,CAAA;IAED,IAAI,sBAAsB,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,kBAAkB,CAAC,uBAAmD,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,sBAAgE;IAChG,MAAM,uBAAuB,GAAG;QAC5B,KAAK,EAAE,SAAS;KACnB,CAAA;IAED,IAAI,sBAAsB,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,kBAAkB,CAAC,uBAAmD,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare function getCurrencyFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
3
|
-
declare function getUnitFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
4
|
-
declare function getPercentageFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
5
|
-
declare function getDecimalFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
1
|
+
import { getCurrencyFormatter, getDecimalFormatter, getPercentageFormatter, getUnitFormatter } from "./formatter";
|
|
6
2
|
export declare const NumberFormatter: {
|
|
7
3
|
getCurrencyFormatter: typeof getCurrencyFormatter;
|
|
8
4
|
getUnitFormatter: typeof getUnitFormatter;
|
|
9
5
|
getPercentageFormatter: typeof getPercentageFormatter;
|
|
10
6
|
getDecimalFormatter: typeof getDecimalFormatter;
|
|
7
|
+
Currency: ({ amount, currency }: import("./components").CurrencyDisplayProps) => string;
|
|
8
|
+
Unit: ({ value, unit }: import("./components").UnitDisplayProps) => string;
|
|
9
|
+
Percentage: ({ value }: import("./components").PercentageDisplayProps) => string;
|
|
10
|
+
Decimal: ({ amount }: import("./components").DecimalDisplayProps) => string;
|
|
11
11
|
};
|
|
12
12
|
export default NumberFormatter;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElH,eAAO,MAAM,eAAe;;;;;;;;;CAU3B,CAAA;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,56 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
function getNumberFormatter(options) {
|
|
4
|
-
const locales = i18nInstance.languages;
|
|
5
|
-
return new Intl.NumberFormat(locales, options);
|
|
6
|
-
}
|
|
7
|
-
function getCurrencyFormatter(numberFormatterOptions) {
|
|
8
|
-
const _numberFormatterOptions = {
|
|
9
|
-
style: 'currency',
|
|
10
|
-
currency: 'USD',
|
|
11
|
-
numberingSystem: 'latn',
|
|
12
|
-
};
|
|
13
|
-
if (numberFormatterOptions) {
|
|
14
|
-
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
15
|
-
}
|
|
16
|
-
return getNumberFormatter(_numberFormatterOptions);
|
|
17
|
-
}
|
|
18
|
-
function getUnitFormatter(numberFormatterOptions) {
|
|
19
|
-
const _numberFormatterOptions = {
|
|
20
|
-
style: 'unit',
|
|
21
|
-
notation: 'compact',
|
|
22
|
-
unitDisplay: 'narrow',
|
|
23
|
-
maximumFractionDigits: 2,
|
|
24
|
-
};
|
|
25
|
-
if (numberFormatterOptions) {
|
|
26
|
-
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
27
|
-
}
|
|
28
|
-
return getNumberFormatter(_numberFormatterOptions);
|
|
29
|
-
}
|
|
30
|
-
function getPercentageFormatter(numberFormatterOptions) {
|
|
31
|
-
const _numberFormatterOptions = {
|
|
32
|
-
style: 'percentage',
|
|
33
|
-
maximumFractionDigits: 2,
|
|
34
|
-
};
|
|
35
|
-
if (numberFormatterOptions) {
|
|
36
|
-
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
37
|
-
}
|
|
38
|
-
return getNumberFormatter(_numberFormatterOptions);
|
|
39
|
-
}
|
|
40
|
-
function getDecimalFormatter(numberFormatterOptions) {
|
|
41
|
-
const _numberFormatterOptions = {
|
|
42
|
-
style: 'decimal',
|
|
43
|
-
};
|
|
44
|
-
if (numberFormatterOptions) {
|
|
45
|
-
Object.assign(_numberFormatterOptions, numberFormatterOptions);
|
|
46
|
-
}
|
|
47
|
-
return getNumberFormatter(_numberFormatterOptions);
|
|
48
|
-
}
|
|
1
|
+
import { CurrencyDisplay, UnitDisplay, DecimalDisplay, PercentageDisplay } from "./components";
|
|
2
|
+
import { getCurrencyFormatter, getDecimalFormatter, getPercentageFormatter, getUnitFormatter } from "./formatter";
|
|
49
3
|
export const NumberFormatter = {
|
|
50
4
|
getCurrencyFormatter,
|
|
51
5
|
getUnitFormatter,
|
|
52
6
|
getPercentageFormatter,
|
|
53
7
|
getDecimalFormatter,
|
|
8
|
+
Currency: CurrencyDisplay,
|
|
9
|
+
Unit: UnitDisplay,
|
|
10
|
+
Percentage: PercentageDisplay,
|
|
11
|
+
Decimal: DecimalDisplay,
|
|
54
12
|
};
|
|
55
13
|
export default NumberFormatter;
|
|
56
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAG,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,oBAAoB;IACpB,gBAAgB;IAChB,sBAAsB;IACtB,mBAAmB;IAEnB,QAAQ,EAAE,eAAe;IACzB,IAAI,EAAE,WAAW;IACjB,UAAU,EAAE,iBAAiB;IAC7B,OAAO,EAAE,cAAc;CAC1B,CAAA;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import IconIdentifier from "./types";
|
|
2
2
|
declare function _getIconInfo(iconIdentifier: IconIdentifier | any): {
|
|
3
|
+
id: any;
|
|
4
|
+
type: string;
|
|
5
|
+
url: any;
|
|
6
|
+
name?: undefined;
|
|
7
|
+
character?: undefined;
|
|
8
|
+
isDirected?: undefined;
|
|
9
|
+
variant?: undefined;
|
|
10
|
+
} | {
|
|
3
11
|
id: any;
|
|
4
12
|
type: any;
|
|
5
13
|
name: any;
|
|
6
14
|
character: any;
|
|
7
15
|
isDirected: any;
|
|
16
|
+
url?: undefined;
|
|
8
17
|
variant?: undefined;
|
|
9
18
|
} | {
|
|
10
19
|
id: any;
|
|
@@ -13,6 +22,7 @@ declare function _getIconInfo(iconIdentifier: IconIdentifier | any): {
|
|
|
13
22
|
name: any;
|
|
14
23
|
character: any;
|
|
15
24
|
isDirected: any;
|
|
25
|
+
url?: undefined;
|
|
16
26
|
};
|
|
17
27
|
export declare const getIconInfo: typeof _getIconInfo & import("lodash").MemoizedFunction;
|
|
18
28
|
declare const reactNativeVectorIcons: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC,iBAAS,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,GAAG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/constants/iconInfo/index.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC,iBAAS,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;EAoCzD;AAED,eAAO,MAAM,WAAW,yDAAwB,CAAC;AAEjD,QAAA,MAAM,sBAAsB,IAAK,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CurrencyDisplayProps {
|
|
2
|
+
amount: number;
|
|
3
|
+
currency: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const CurrencyDisplay: ({ amount, currency }: CurrencyDisplayProps) => string;
|
|
6
|
+
export interface UnitDisplayProps {
|
|
7
|
+
value: number;
|
|
8
|
+
unit: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const UnitDisplay: ({ value, unit }: UnitDisplayProps) => string;
|
|
11
|
+
export interface PercentageDisplayProps {
|
|
12
|
+
value: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const PercentageDisplay: ({ value }: PercentageDisplayProps) => string;
|
|
15
|
+
export interface DecimalDisplayProps {
|
|
16
|
+
amount: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const DecimalDisplay: ({ amount }: DecimalDisplayProps) => string;
|
|
19
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/components.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,GAAI,sBAAsB,oBAAoB,WAGzE,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,GAAI,iBAAiB,gBAAgB,WAG5D,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,CAAC;CAEjB;AAED,eAAO,MAAM,iBAAiB,GAAI,WAAW,sBAAsB,WAGlE,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,cAAc,GAAI,YAAY,mBAAmB,WAG7D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './polyfill';
|
|
2
|
+
export declare function getCurrencyFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
3
|
+
export declare function getUnitFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
4
|
+
export declare function getPercentageFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
5
|
+
export declare function getDecimalFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
6
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/formatter.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,CAAC;AAOpB,wBAAgB,oBAAoB,CAAE,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAYrG;AAED,wBAAgB,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAYhG;AAED,wBAAgB,sBAAsB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAUtG;AAED,wBAAgB,mBAAmB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,qBAUnG"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare function getCurrencyFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
3
|
-
declare function getUnitFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
4
|
-
declare function getPercentageFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
5
|
-
declare function getDecimalFormatter(numberFormatterOptions?: Omit<Intl.NumberFormatOptions, 'style'>): Intl.NumberFormat;
|
|
1
|
+
import { getCurrencyFormatter, getDecimalFormatter, getPercentageFormatter, getUnitFormatter } from "./formatter";
|
|
6
2
|
export declare const NumberFormatter: {
|
|
7
3
|
getCurrencyFormatter: typeof getCurrencyFormatter;
|
|
8
4
|
getUnitFormatter: typeof getUnitFormatter;
|
|
9
5
|
getPercentageFormatter: typeof getPercentageFormatter;
|
|
10
6
|
getDecimalFormatter: typeof getDecimalFormatter;
|
|
7
|
+
Currency: ({ amount, currency }: import("./components").CurrencyDisplayProps) => string;
|
|
8
|
+
Unit: ({ value, unit }: import("./components").UnitDisplayProps) => string;
|
|
9
|
+
Percentage: ({ value }: import("./components").PercentageDisplayProps) => string;
|
|
10
|
+
Decimal: ({ amount }: import("./components").DecimalDisplayProps) => string;
|
|
11
11
|
};
|
|
12
12
|
export default NumberFormatter;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/number-formatter/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElH,eAAO,MAAM,eAAe;;;;;;;;;CAU3B,CAAA;AAED,eAAe,eAAe,CAAC"}
|