react-intl 5.17.5 → 5.18.1
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/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/src/components/createFormattedComponent.d.ts +5 -0
- package/lib/src/components/createFormattedComponent.d.ts.map +1 -1
- package/lib/src/components/createFormattedComponent.js +6 -0
- package/package.json +7 -7
- package/react-intl.iife.js +1483 -1450
- package/src/components/createFormattedComponent.d.ts +5 -0
- package/src/components/createFormattedComponent.d.ts.map +1 -1
- package/src/components/createFormattedComponent.js +8 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FormatDateOptions, FormatNumberOptions, FormatListOptions, FormatDisplayNameOptions } from '@formatjs/intl';
|
|
3
3
|
import { IntlShape } from '../types';
|
|
4
|
+
import { Part } from '@formatjs/intl-listformat';
|
|
4
5
|
declare type Formatter = {
|
|
5
6
|
formatDate: FormatDateOptions;
|
|
6
7
|
formatTime: FormatDateOptions;
|
|
@@ -12,6 +13,10 @@ export declare const FormattedNumberParts: React.FC<Formatter['formatNumber'] &
|
|
|
12
13
|
value: Parameters<IntlShape['formatNumber']>[0];
|
|
13
14
|
children(val: Intl.NumberFormatPart[]): React.ReactElement | null;
|
|
14
15
|
}>;
|
|
16
|
+
export declare const FormattedListParts: React.FC<Formatter['formatList'] & {
|
|
17
|
+
value: Parameters<IntlShape['formatList']>[0];
|
|
18
|
+
children(val: Part[]): React.ReactElement | null;
|
|
19
|
+
}>;
|
|
15
20
|
export declare function createFormattedDateTimePartsComponent<Name extends 'formatDate' | 'formatTime'>(name: Name): React.FC<Formatter[Name] & {
|
|
16
21
|
value: Parameters<IntlShape[Name]>[0];
|
|
17
22
|
children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFormattedComponent.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react-intl/src/components/createFormattedComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"createFormattedComponent.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react-intl/src/components/createFormattedComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAElC,OAAO,EAAC,IAAI,EAAC,MAAM,2BAA2B,CAAA;AAmB9C,aAAK,SAAS,GAAG;IACf,UAAU,EAAE,iBAAiB,CAAA;IAC7B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,YAAY,EAAE,mBAAmB,CAAA;IACjC,UAAU,EAAE,iBAAiB,CAAA;IAC7B,iBAAiB,EAAE,wBAAwB,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CACzC,SAAS,CAAC,cAAc,CAAC,GAAG;IAC1B,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAE/C,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,gBAAgB,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;CAClE,CAKF,CAAA;AAGD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CACvC,SAAS,CAAC,YAAY,CAAC,GAAG;IACxB,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAE7C,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;CACjD,CAKF,CAAA;AAGD,wBAAgB,qCAAqC,CACnD,IAAI,SAAS,YAAY,GAAG,YAAY,EAExC,IAAI,EAAE,IAAI,GACT,KAAK,CAAC,EAAE,CACT,SAAS,CAAC,IAAI,CAAC,GAAG;IAChB,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACrC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,kBAAkB,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;CACpE,CACF,CAoBA;AAED,wBAAgB,wBAAwB,CAAC,IAAI,SAAS,MAAM,SAAS,EACnE,IAAI,EAAE,IAAI,GACT,KAAK,CAAC,EAAE,CACT,SAAS,CAAC,IAAI,CAAC,GAAG;IAChB,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACrC,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;CAClD,CACF,CAsBA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFormattedComponent = exports.createFormattedDateTimePartsComponent = exports.FormattedNumberParts = void 0;
|
|
3
|
+
exports.createFormattedComponent = exports.createFormattedDateTimePartsComponent = exports.FormattedListParts = exports.FormattedNumberParts = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var React = tslib_1.__importStar(require("react"));
|
|
6
6
|
var useIntl_1 = tslib_1.__importDefault(require("./useIntl"));
|
|
@@ -28,6 +28,13 @@ var FormattedNumberParts = function (props) {
|
|
|
28
28
|
};
|
|
29
29
|
exports.FormattedNumberParts = FormattedNumberParts;
|
|
30
30
|
exports.FormattedNumberParts.displayName = 'FormattedNumberParts';
|
|
31
|
+
var FormattedListParts = function (props) {
|
|
32
|
+
var intl = useIntl_1.default();
|
|
33
|
+
var value = props.value, children = props.children, formatProps = tslib_1.__rest(props, ["value", "children"]);
|
|
34
|
+
return children(intl.formatListToParts(value, formatProps));
|
|
35
|
+
};
|
|
36
|
+
exports.FormattedListParts = FormattedListParts;
|
|
37
|
+
exports.FormattedNumberParts.displayName = 'FormattedNumberParts';
|
|
31
38
|
function createFormattedDateTimePartsComponent(name) {
|
|
32
39
|
var ComponentParts = function (props) {
|
|
33
40
|
var intl = useIntl_1.default();
|