react-intl 4.5.8 → 4.5.12
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/CHANGELOG.md +35 -0
- package/dist/components/plural.d.ts +1 -1
- package/dist/formatters/number.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/react-intl.api.md +4 -4
- package/dist/react-intl.d.ts +36 -38
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/lib/components/plural.d.ts +1 -1
- package/lib/formatters/number.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/react-intl.d.ts +4 -4
- package/lib/types.d.ts +2 -2
- package/lib/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/formatters/number.ts +3 -3
- package/src/index.ts +2 -2
- package/src/types.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.5.12](https://github.com/formatjs/formatjs/compare/react-intl@4.5.11...react-intl@4.5.12) (2020-05-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package react-intl
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [4.5.11](https://github.com/formatjs/formatjs/compare/react-intl@4.5.10...react-intl@4.5.11) (2020-05-23)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package react-intl
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [4.5.10](https://github.com/formatjs/formatjs/compare/react-intl@4.5.9...react-intl@4.5.10) (2020-05-23)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package react-intl
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [4.5.9](https://github.com/formatjs/formatjs/compare/react-intl@4.5.8...react-intl@4.5.9) (2020-05-22)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **eslint-plugin-formatjs:** add no-id to index ([8e5c0af](https://github.com/formatjs/formatjs/commit/8e5c0afe69944d52653b92c2f08e15363246834a))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
## [4.5.8](https://github.com/formatjs/formatjs/compare/react-intl@4.5.7...react-intl@4.5.8) (2020-05-21)
|
|
7
42
|
|
|
8
43
|
|
|
@@ -11,7 +11,7 @@ interface Props extends FormatPluralOptions {
|
|
|
11
11
|
many?: React.ReactNode;
|
|
12
12
|
children?(value: React.ReactNode): React.ReactElement | null;
|
|
13
13
|
}
|
|
14
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "
|
|
14
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "value" | "localeMatcher" | "format" | "type"> & {
|
|
15
15
|
forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
|
|
16
16
|
} & React.RefAttributes<any>> & {
|
|
17
17
|
WrappedComponent: React.ComponentType<Props>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../src/formatters/number.ts"],"names":[],"mappings":";;AACA,kCAAqD;AAErD,kCAA4D;AAE5D,IAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../src/formatters/number.ts"],"names":[],"mappings":";;AACA,kCAAqD;AAErD,kCAA4D;AAE5D,IAAM,qBAAqB,GAAqC;IAC9D,eAAe;IAEf,OAAO;IACP,UAAU;IACV,iBAAiB;IACjB,MAAM;IACN,aA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,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAC5E;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,OAAO,CACZ,IAAI,sBAAc,oCAEhB,0BAA0B,EAC1B,CAAC,CACF,CACF,CAAC;KACH;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAnBD,kDAmBC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from './types';
|
|
|
3
3
|
export declare function defineMessages<T, U extends Record<string, T>>(msgs: U): U;
|
|
4
4
|
export declare function defineMessage<T>(msg: T): T;
|
|
5
5
|
import { CustomFormatConfig } from './types';
|
|
6
|
-
import {
|
|
6
|
+
import { NumberFormatOptions } from '@formatjs/intl-numberformat';
|
|
7
7
|
import { IntlListFormatOptions } from '@formatjs/intl-listformat';
|
|
8
8
|
import { DisplayNamesOptions } from '@formatjs/intl-displaynames/lib';
|
|
9
9
|
export { default as injectIntl, Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps, } from './components/injectIntl';
|
|
@@ -15,7 +15,7 @@ export declare const FormattedDate: React.FC<Intl.DateTimeFormatOptions & Custom
|
|
|
15
15
|
export declare const FormattedTime: React.FC<Intl.DateTimeFormatOptions & CustomFormatConfig & {
|
|
16
16
|
value: string | number | Date | undefined;
|
|
17
17
|
}>;
|
|
18
|
-
export declare const FormattedNumber: React.FC<
|
|
18
|
+
export declare const FormattedNumber: React.FC<NumberFormatOptions & CustomFormatConfig & {
|
|
19
19
|
value: number;
|
|
20
20
|
}>;
|
|
21
21
|
export declare const FormattedList: React.FC<IntlListFormatOptions & {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SA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,CAAC;AAC3C,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC,IAAI,CAAC,qBAAqB,GACxB,kBAAkB,GAAG;IACnB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC3C,CACqC,CAAC;AAC3C,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CACpC,mBAAmB,GACjB,kBAAkB,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CACuC,CAAC;AAC7C,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC,qBAAqB,GAAG;IACtB,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;CAC1B,CACuC,CAAC;AAC3C,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CACzC,mBAAmB,GAAG;IACpB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACjC,CAC8C,CAAC;AAClD,eAAO,MAAM,kBAAkB;;;EAE9B,CAAC;AACF,eAAO,MAAM,kBAAkB;;;EAE9B,CAAC;AACF,OAAO,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAC,OAAO,IAAI,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC"}
|
package/dist/react-intl.api.md
CHANGED
|
@@ -49,10 +49,10 @@ export type FormatDisplayNameOptions = Exclude<DisplayNamesOptions, 'localeMatch
|
|
|
49
49
|
// @public (undocumented)
|
|
50
50
|
export type FormatListOptions = Exclude<IntlListFormatOptions, 'localeMatcher'>;
|
|
51
51
|
|
|
52
|
-
// Warning: (ae-forgotten-export) The symbol "
|
|
52
|
+
// Warning: (ae-forgotten-export) The symbol "NumberFormatOptions" needs to be exported by the entry point index.d.ts
|
|
53
53
|
//
|
|
54
54
|
// @public (undocumented)
|
|
55
|
-
export type FormatNumberOptions = Exclude<
|
|
55
|
+
export type FormatNumberOptions = Exclude<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
56
56
|
|
|
57
57
|
// @public (undocumented)
|
|
58
58
|
export type FormatPluralOptions = Exclude<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
@@ -100,7 +100,7 @@ export class FormattedMessage<V extends Record<string, any> = Record<string, Pri
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
// @public (undocumented)
|
|
103
|
-
export const FormattedNumber: React_2.FC<
|
|
103
|
+
export const FormattedNumber: React_2.FC<NumberFormatOptions & CustomFormatConfig & {
|
|
104
104
|
value: number;
|
|
105
105
|
}>;
|
|
106
106
|
|
|
@@ -115,7 +115,7 @@ export const FormattedNumberParts: React_2.FC<Formatter['formatNumber'] & {
|
|
|
115
115
|
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
|
|
116
116
|
//
|
|
117
117
|
// @public (undocumented)
|
|
118
|
-
export const FormattedPlural: React_2.ForwardRefExoticComponent<Pick<Props_2, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "
|
|
118
|
+
export const FormattedPlural: React_2.ForwardRefExoticComponent<Pick<Props_2, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "value" | "localeMatcher" | "format" | "type"> & {
|
|
119
119
|
forwardedRef?: ((instance: any) => void) | React_2.RefObject<any> | null | undefined;
|
|
120
120
|
} & React_2.RefAttributes<any>> & {
|
|
121
121
|
WrappedComponent: React_2.ComponentType<Props_2>;
|
package/dist/react-intl.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ declare class FormatError extends Error {
|
|
|
153
153
|
|
|
154
154
|
export declare type FormatListOptions = Exclude<IntlListFormatOptions, 'localeMatcher'>;
|
|
155
155
|
|
|
156
|
-
export declare type FormatNumberOptions = Exclude<
|
|
156
|
+
export declare type FormatNumberOptions = Exclude<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
157
157
|
|
|
158
158
|
export declare type FormatPluralOptions = Exclude<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
159
159
|
|
|
@@ -193,7 +193,7 @@ export declare class FormattedMessage<V extends Record<string, any> = Record<str
|
|
|
193
193
|
render(): JSX.Element;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
export declare const FormattedNumber: React_2.FC<
|
|
196
|
+
export declare const FormattedNumber: React_2.FC<NumberFormatOptions & CustomFormatConfig & {
|
|
197
197
|
value: number;
|
|
198
198
|
}>;
|
|
199
199
|
|
|
@@ -202,7 +202,7 @@ export declare const FormattedNumberParts: React_2.FC<Formatter['formatNumber']
|
|
|
202
202
|
children(val: Intl.NumberFormatPart[]): React_2.ReactElement | null;
|
|
203
203
|
}>;
|
|
204
204
|
|
|
205
|
-
export declare const FormattedPlural: React_2.ForwardRefExoticComponent<Pick<Props_2, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "
|
|
205
|
+
export declare const FormattedPlural: React_2.ForwardRefExoticComponent<Pick<Props_2, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "value" | "localeMatcher" | "format" | "type"> & {
|
|
206
206
|
forwardedRef?: ((instance: any) => void) | React_2.RefObject<any> | null | undefined;
|
|
207
207
|
} & React_2.RefAttributes<any>> & {
|
|
208
208
|
WrappedComponent: React_2.ComponentType<Props_2>;
|
|
@@ -509,9 +509,7 @@ declare type Locale = string;
|
|
|
509
509
|
|
|
510
510
|
declare interface LocaleData<T> {
|
|
511
511
|
data: Record<Locale, T>;
|
|
512
|
-
aliases: Record<string, string>;
|
|
513
512
|
availableLocales: string[];
|
|
514
|
-
parentLocales: Record<string, string>;
|
|
515
513
|
}
|
|
516
514
|
|
|
517
515
|
declare type LocaleFieldsData = {
|
|
@@ -545,12 +543,43 @@ declare type NumberElement = SimpleFormatElement<TYPE.number, NumberSkeleton>;
|
|
|
545
543
|
|
|
546
544
|
declare interface NumberFormatDigitOptions {
|
|
547
545
|
minimumIntegerDigits?: number;
|
|
548
|
-
minimumFractionDigits?: number;
|
|
549
|
-
maximumFractionDigits?: number;
|
|
550
546
|
minimumSignificantDigits?: number;
|
|
551
547
|
maximumSignificantDigits?: number;
|
|
548
|
+
minimumFractionDigits?: number;
|
|
549
|
+
maximumFractionDigits?: number;
|
|
552
550
|
}
|
|
553
551
|
|
|
552
|
+
declare type NumberFormatNotation = 'standard' | 'scientific' | 'engineering' | 'compact';
|
|
553
|
+
|
|
554
|
+
declare type NumberFormatOptions = Intl.NumberFormatOptions & NumberFormatDigitOptions & {
|
|
555
|
+
localeMatcher?: NumberFormatOptionsLocaleMatcher;
|
|
556
|
+
style?: NumberFormatOptionsStyle;
|
|
557
|
+
compactDisplay?: NumberFormatOptionsCompactDisplay;
|
|
558
|
+
currencyDisplay?: NumberFormatOptionsCurrencyDisplay;
|
|
559
|
+
currencySign?: NumberFormatOptionsCurrencySign;
|
|
560
|
+
notation?: NumberFormatOptionsNotation;
|
|
561
|
+
signDisplay?: NumberFormatOptionsSignDisplay;
|
|
562
|
+
unit?: string;
|
|
563
|
+
unitDisplay?: NumberFormatOptionsUnitDisplay;
|
|
564
|
+
numberingSystem?: string;
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
declare type NumberFormatOptionsCompactDisplay = 'short' | 'long';
|
|
568
|
+
|
|
569
|
+
declare type NumberFormatOptionsCurrencyDisplay = 'symbol' | 'code' | 'name' | 'narrowSymbol';
|
|
570
|
+
|
|
571
|
+
declare type NumberFormatOptionsCurrencySign = 'standard' | 'accounting';
|
|
572
|
+
|
|
573
|
+
declare type NumberFormatOptionsLocaleMatcher = 'lookup' | 'best fit';
|
|
574
|
+
|
|
575
|
+
declare type NumberFormatOptionsNotation = NumberFormatNotation;
|
|
576
|
+
|
|
577
|
+
declare type NumberFormatOptionsSignDisplay = 'auto' | 'always' | 'never' | 'exceptZero';
|
|
578
|
+
|
|
579
|
+
declare type NumberFormatOptionsStyle = 'decimal' | 'percent' | 'currency' | 'unit';
|
|
580
|
+
|
|
581
|
+
declare type NumberFormatOptionsUnitDisplay = 'long' | 'short' | 'narrow';
|
|
582
|
+
|
|
554
583
|
declare interface NumberSkeleton {
|
|
555
584
|
type: SKELETON_TYPE.number;
|
|
556
585
|
tokens: NumberSkeletonToken[];
|
|
@@ -829,39 +858,8 @@ declare enum TYPE {
|
|
|
829
858
|
tag = 8
|
|
830
859
|
}
|
|
831
860
|
|
|
832
|
-
declare type UnifiedNumberFormatOptions = Intl.NumberFormatOptions & NumberFormatDigitOptions & {
|
|
833
|
-
localeMatcher?: UnifiedNumberFormatOptionsLocaleMatcher;
|
|
834
|
-
style?: UnifiedNumberFormatOptionsStyle;
|
|
835
|
-
compactDisplay?: UnifiedNumberFormatOptionsCompactDisplay;
|
|
836
|
-
currencyDisplay?: UnifiedNumberFormatOptionsCurrencyDisplay;
|
|
837
|
-
currencySign?: UnifiedNumberFormatOptionsCurrencySign;
|
|
838
|
-
notation?: UnifiedNumberFormatOptionsNotation;
|
|
839
|
-
signDisplay?: UnifiedNumberFormatOptionsSignDisplay;
|
|
840
|
-
unit?: Unit_2;
|
|
841
|
-
unitDisplay?: UnifiedNumberFormatOptionsUnitDisplay;
|
|
842
|
-
numberingSystem?: string;
|
|
843
|
-
};
|
|
844
|
-
|
|
845
|
-
declare type UnifiedNumberFormatOptionsCompactDisplay = 'short' | 'long';
|
|
846
|
-
|
|
847
|
-
declare type UnifiedNumberFormatOptionsCurrencyDisplay = 'symbol' | 'code' | 'name' | 'narrowSymbol';
|
|
848
|
-
|
|
849
|
-
declare type UnifiedNumberFormatOptionsCurrencySign = 'standard' | 'accounting';
|
|
850
|
-
|
|
851
|
-
declare type UnifiedNumberFormatOptionsLocaleMatcher = 'lookup' | 'best fit';
|
|
852
|
-
|
|
853
|
-
declare type UnifiedNumberFormatOptionsNotation = 'standard' | 'scientific' | 'engineering' | 'compact';
|
|
854
|
-
|
|
855
|
-
declare type UnifiedNumberFormatOptionsSignDisplay = 'auto' | 'always' | 'never' | 'exceptZero';
|
|
856
|
-
|
|
857
|
-
declare type UnifiedNumberFormatOptionsStyle = 'decimal' | 'percent' | 'currency' | 'unit';
|
|
858
|
-
|
|
859
|
-
declare type UnifiedNumberFormatOptionsUnitDisplay = 'long' | 'short' | 'narrow';
|
|
860
|
-
|
|
861
861
|
declare type Unit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
862
862
|
|
|
863
|
-
declare type Unit_2 = 'degree' | 'acre' | 'hectare' | 'percent' | 'bit' | 'byte' | 'gigabit' | 'gigabyte' | 'kilobit' | 'kilobyte' | 'megabit' | 'megabyte' | 'petabyte' | 'terabit' | 'terabyte' | 'day' | 'hour' | 'millisecond' | 'minute' | 'month' | 'second' | 'week' | 'year' | 'centimeter' | 'foot' | 'inch' | 'kilometer' | 'meter' | 'mile-scandinavian' | 'mile' | 'millimeter' | 'yard' | 'gram' | 'kilogram' | 'ounce' | 'pound' | 'stone' | 'celsius' | 'fahrenheit' | 'fluid-ounce' | 'gallon' | 'liter' | 'milliliter';
|
|
864
|
-
|
|
865
863
|
declare type Units = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years';
|
|
866
864
|
|
|
867
865
|
declare type UnpackedLocaleFieldsData = {
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import IntlMessageFormat, { Formats, PrimitiveType, FormatXMLElementFn, FormatError } from 'intl-messageformat';
|
|
3
3
|
import IntlRelativeTimeFormat, { IntlRelativeTimeFormatOptions } from '@formatjs/intl-relativetimeformat';
|
|
4
4
|
import { MessageFormatElement } from 'intl-messageformat-parser';
|
|
5
|
-
import {
|
|
5
|
+
import { NumberFormatOptions } from '@formatjs/intl-numberformat';
|
|
6
6
|
import IntlListFormat, { IntlListFormatOptions } from '@formatjs/intl-listformat';
|
|
7
7
|
import { DisplayNames, DisplayNamesOptions } from '@formatjs/intl-displaynames';
|
|
8
8
|
import { ReactIntlError } from './error';
|
|
@@ -24,7 +24,7 @@ export interface CustomFormatConfig {
|
|
|
24
24
|
format?: string;
|
|
25
25
|
}
|
|
26
26
|
export declare type FormatDateOptions = Exclude<Intl.DateTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
27
|
-
export declare type FormatNumberOptions = Exclude<
|
|
27
|
+
export declare type FormatNumberOptions = Exclude<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
28
28
|
export declare type FormatRelativeTimeOptions = Exclude<IntlRelativeTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
29
29
|
export declare type FormatPluralOptions = Exclude<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
30
30
|
export declare type FormatListOptions = Exclude<IntlListFormatOptions, 'localeMatcher'>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,iBAAiB,EAAE,EACxB,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,EAAE,EAC7B,6BAA6B,EAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,iBAAiB,EAAE,EACxB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M,EAAE,iBAAiB,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACrD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,oBAAY,IAAI,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@ interface Props extends FormatPluralOptions {
|
|
|
11
11
|
many?: React.ReactNode;
|
|
12
12
|
children?(value: React.ReactNode): React.ReactElement | null;
|
|
13
13
|
}
|
|
14
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "
|
|
14
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "value" | "localeMatcher" | "format" | "type"> & {
|
|
15
15
|
forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
|
|
16
16
|
} & React.RefAttributes<any>> & {
|
|
17
17
|
WrappedComponent: React.ComponentType<Props>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../src/formatters/number.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAErD,OAAO,EAAC,cAAc,E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CAAC,OAAO,CACZ,IAAI,cAAc,oCAEhB,0BAA0B,EAC1B,CAAC,CACF,CACF,CAAC;KACH;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,MAA0D,EAC1D,eAA8C,EAC9C,KAAoD,EACpD,OAA2D;IAA3D,wBAAA,EAAA,YAA2D;IAE3D,IAAI;QACF,OAAO,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAC5E;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,OAAO,CACZ,IAAI,cAAc,oCAEhB,0BAA0B,EAC1B,CAAC,CACF,CACF,CAAC;KACH;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from './types';
|
|
|
3
3
|
export declare function defineMessages<T, U extends Record<string, T>>(msgs: U): U;
|
|
4
4
|
export declare function defineMessage<T>(msg: T): T;
|
|
5
5
|
import { CustomFormatConfig } from './types';
|
|
6
|
-
import {
|
|
6
|
+
import { NumberFormatOptions } from '@formatjs/intl-numberformat';
|
|
7
7
|
import { IntlListFormatOptions } from '@formatjs/intl-listformat';
|
|
8
8
|
import { DisplayNamesOptions } from '@formatjs/intl-displaynames/lib';
|
|
9
9
|
export { default as injectIntl, Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps, } from './components/injectIntl';
|
|
@@ -15,7 +15,7 @@ export declare const FormattedDate: React.FC<Intl.DateTimeFormatOptions & Custom
|
|
|
15
15
|
export declare const FormattedTime: React.FC<Intl.DateTimeFormatOptions & CustomFormatConfig & {
|
|
16
16
|
value: string | number | Date | undefined;
|
|
17
17
|
}>;
|
|
18
|
-
export declare const FormattedNumber: React.FC<
|
|
18
|
+
export declare const FormattedNumber: React.FC<NumberFormatOptions & CustomFormatConfig & {
|
|
19
19
|
value: number;
|
|
20
20
|
}>;
|
|
21
21
|
export declare const FormattedList: React.FC<IntlListFormatOptions & {
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAEzE;AACD,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAE1C;AAKD,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAEzE;AACD,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAE1C;AAKD,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,QAAQ,IAAI,eAAe,EAC3B,OAAO,IAAI,WAAW,EACtB,aAAa,EACb,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,OAA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O,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC"}
|
package/lib/react-intl.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ import IntlMessageFormat from 'intl-messageformat';
|
|
|
10
10
|
import IntlRelativeTimeFormat from '@formatjs/intl-relativetimeformat';
|
|
11
11
|
import { IntlRelativeTimeFormatOptions } from '@formatjs/intl-relativetimeformat';
|
|
12
12
|
import { MessageFormatElement } from 'intl-messageformat-parser';
|
|
13
|
+
import { NumberFormatOptions } from '@formatjs/intl-numberformat';
|
|
13
14
|
import { PrimitiveType } from 'intl-messageformat';
|
|
14
15
|
import * as React_2 from 'react';
|
|
15
|
-
import { UnifiedNumberFormatOptions } from '@formatjs/intl-numberformat';
|
|
16
16
|
import { Unit } from '@formatjs/intl-relativetimeformat';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -44,7 +44,7 @@ export declare type FormatDisplayNameOptions = Exclude<DisplayNamesOptions, 'loc
|
|
|
44
44
|
|
|
45
45
|
export declare type FormatListOptions = Exclude<IntlListFormatOptions, 'localeMatcher'>;
|
|
46
46
|
|
|
47
|
-
export declare type FormatNumberOptions = Exclude<
|
|
47
|
+
export declare type FormatNumberOptions = Exclude<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
48
48
|
|
|
49
49
|
export declare type FormatPluralOptions = Exclude<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
50
50
|
|
|
@@ -76,7 +76,7 @@ export declare class FormattedMessage<V extends Record<string, any> = Record<str
|
|
|
76
76
|
render(): JSX.Element;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
export declare const FormattedNumber: React_2.FC<
|
|
79
|
+
export declare const FormattedNumber: React_2.FC<NumberFormatOptions & CustomFormatConfig & {
|
|
80
80
|
value: number;
|
|
81
81
|
}>;
|
|
82
82
|
|
|
@@ -85,7 +85,7 @@ export declare const FormattedNumberParts: React_2.FC<Formatter['formatNumber']
|
|
|
85
85
|
children(val: Intl.NumberFormatPart[]): React_2.ReactElement | null;
|
|
86
86
|
}>;
|
|
87
87
|
|
|
88
|
-
export declare const FormattedPlural: React_2.ForwardRefExoticComponent<Pick<Props_2, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "
|
|
88
|
+
export declare const FormattedPlural: React_2.ForwardRefExoticComponent<Pick<Props_2, "children" | "other" | "zero" | "one" | "two" | "few" | "many" | "value" | "localeMatcher" | "format" | "type"> & {
|
|
89
89
|
forwardedRef?: ((instance: any) => void) | React_2.RefObject<any> | null | undefined;
|
|
90
90
|
} & React_2.RefAttributes<any>> & {
|
|
91
91
|
WrappedComponent: React_2.ComponentType<Props_2>;
|
package/lib/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import IntlMessageFormat, { Formats, PrimitiveType, FormatXMLElementFn, FormatError } from 'intl-messageformat';
|
|
3
3
|
import IntlRelativeTimeFormat, { IntlRelativeTimeFormatOptions } from '@formatjs/intl-relativetimeformat';
|
|
4
4
|
import { MessageFormatElement } from 'intl-messageformat-parser';
|
|
5
|
-
import {
|
|
5
|
+
import { NumberFormatOptions } from '@formatjs/intl-numberformat';
|
|
6
6
|
import IntlListFormat, { IntlListFormatOptions } from '@formatjs/intl-listformat';
|
|
7
7
|
import { DisplayNames, DisplayNamesOptions } from '@formatjs/intl-displaynames';
|
|
8
8
|
import { ReactIntlError } from './error';
|
|
@@ -24,7 +24,7 @@ export interface CustomFormatConfig {
|
|
|
24
24
|
format?: string;
|
|
25
25
|
}
|
|
26
26
|
export declare type FormatDateOptions = Exclude<Intl.DateTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
27
|
-
export declare type FormatNumberOptions = Exclude<
|
|
27
|
+
export declare type FormatNumberOptions = Exclude<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
28
28
|
export declare type FormatRelativeTimeOptions = Exclude<IntlRelativeTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
29
29
|
export declare type FormatPluralOptions = Exclude<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig;
|
|
30
30
|
export declare type FormatListOptions = Exclude<IntlListFormatOptions, 'localeMatcher'>;
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,iBAAiB,EAAE,EACxB,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,EAAE,EAC7B,6BAA6B,EAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,iBAAiB,EAAE,EACxB,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,EAAE,EAC7B,6BAA6B,EAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,cAAc,EAAE,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,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AAC,SAAS,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.12",
|
|
4
4
|
"description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -133,17 +133,17 @@
|
|
|
133
133
|
"types": "./lib/react-intl.d.ts",
|
|
134
134
|
"sideEffects": false,
|
|
135
135
|
"dependencies": {
|
|
136
|
-
"@formatjs/intl-displaynames": "^1.
|
|
137
|
-
"@formatjs/intl-listformat": "^1.
|
|
138
|
-
"@formatjs/intl-numberformat": "^
|
|
139
|
-
"@formatjs/intl-relativetimeformat": "^
|
|
140
|
-
"@formatjs/intl-utils": "^
|
|
136
|
+
"@formatjs/intl-displaynames": "^2.1.0",
|
|
137
|
+
"@formatjs/intl-listformat": "^2.1.0",
|
|
138
|
+
"@formatjs/intl-numberformat": "^4.1.0",
|
|
139
|
+
"@formatjs/intl-relativetimeformat": "^5.1.0",
|
|
140
|
+
"@formatjs/intl-utils": "^3.1.0",
|
|
141
141
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
142
142
|
"@types/invariant": "^2.2.31",
|
|
143
143
|
"hoist-non-react-statics": "^3.3.2",
|
|
144
|
-
"intl-format-cache": "^4.2.
|
|
145
|
-
"intl-messageformat": "^8.3.
|
|
146
|
-
"intl-messageformat-parser": "^5.0.
|
|
144
|
+
"intl-format-cache": "^4.2.31",
|
|
145
|
+
"intl-messageformat": "^8.3.16",
|
|
146
|
+
"intl-messageformat-parser": "^5.0.9",
|
|
147
147
|
"shallow-equal": "^1.2.1"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"ie 11"
|
|
167
167
|
],
|
|
168
168
|
"devDependencies": {
|
|
169
|
-
"@formatjs/intl-pluralrules": "^1.
|
|
169
|
+
"@formatjs/intl-pluralrules": "^2.1.0",
|
|
170
170
|
"@microsoft/api-documenter": "^7.7.18",
|
|
171
171
|
"@microsoft/api-extractor": "^7.7.13",
|
|
172
172
|
"@types/benchmark": "^1.0.31",
|
|
@@ -197,5 +197,5 @@
|
|
|
197
197
|
"tslib": "^1.11.1",
|
|
198
198
|
"typescript": "3.8"
|
|
199
199
|
},
|
|
200
|
-
"gitHead": "
|
|
200
|
+
"gitHead": "91d1251eb9a54e153314e6c14572cd5dfd01b9ce"
|
|
201
201
|
}
|
package/src/formatters/number.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {IntlConfig, Formatters, IntlFormatters} from '../types';
|
|
2
2
|
import {getNamedFormat, filterProps} from '../utils';
|
|
3
|
-
import {
|
|
3
|
+
import {NumberFormatOptions} from '@formatjs/intl-numberformat';
|
|
4
4
|
import {ReactIntlError, ReactIntlErrorCode} from '../error';
|
|
5
5
|
|
|
6
|
-
const NUMBER_FORMAT_OPTIONS: Array<keyof
|
|
6
|
+
const NUMBER_FORMAT_OPTIONS: Array<keyof NumberFormatOptions> = [
|
|
7
7
|
'localeMatcher',
|
|
8
8
|
|
|
9
9
|
'style',
|
|
@@ -41,7 +41,7 @@ export function getFormatter(
|
|
|
41
41
|
const {format} = options;
|
|
42
42
|
const defaults = ((format &&
|
|
43
43
|
getNamedFormat(formats!, 'number', format, onError)) ||
|
|
44
|
-
{}) as
|
|
44
|
+
{}) as NumberFormatOptions;
|
|
45
45
|
const filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);
|
|
46
46
|
|
|
47
47
|
return getNumberFormat(locale, filteredOptions);
|
package/src/index.ts
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
createFormattedDateTimePartsComponent,
|
|
17
17
|
} from './components/createFormattedComponent';
|
|
18
18
|
import {CustomFormatConfig} from './types';
|
|
19
|
-
import {
|
|
19
|
+
import {NumberFormatOptions} from '@formatjs/intl-numberformat';
|
|
20
20
|
import {IntlListFormatOptions} from '@formatjs/intl-listformat';
|
|
21
21
|
import {DisplayNamesOptions} from '@formatjs/intl-displaynames/lib';
|
|
22
22
|
export {
|
|
@@ -42,7 +42,7 @@ export const FormattedTime: React.FC<
|
|
|
42
42
|
}
|
|
43
43
|
> = createFormattedComponent('formatTime');
|
|
44
44
|
export const FormattedNumber: React.FC<
|
|
45
|
-
|
|
45
|
+
NumberFormatOptions &
|
|
46
46
|
CustomFormatConfig & {
|
|
47
47
|
value: number;
|
|
48
48
|
}
|
package/src/types.ts
CHANGED
|
@@ -14,7 +14,7 @@ import IntlRelativeTimeFormat, {
|
|
|
14
14
|
IntlRelativeTimeFormatOptions,
|
|
15
15
|
} from '@formatjs/intl-relativetimeformat';
|
|
16
16
|
import {MessageFormatElement} from 'intl-messageformat-parser';
|
|
17
|
-
import {
|
|
17
|
+
import {NumberFormatOptions} from '@formatjs/intl-numberformat';
|
|
18
18
|
import IntlListFormat, {IntlListFormatOptions} from '@formatjs/intl-listformat';
|
|
19
19
|
import {DisplayNames, DisplayNamesOptions} from '@formatjs/intl-displaynames';
|
|
20
20
|
import {ReactIntlError} from './error';
|
|
@@ -45,7 +45,7 @@ export type FormatDateOptions = Exclude<
|
|
|
45
45
|
> &
|
|
46
46
|
CustomFormatConfig;
|
|
47
47
|
export type FormatNumberOptions = Exclude<
|
|
48
|
-
|
|
48
|
+
NumberFormatOptions,
|
|
49
49
|
'localeMatcher'
|
|
50
50
|
> &
|
|
51
51
|
CustomFormatConfig;
|