@synerise/ds-core 1.11.0 → 1.11.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/CHANGELOG.md +4 -0
- package/dist/i18n/{en.json → en.json.d.ts} +4 -2
- package/dist/i18n/en.json.js +8 -0
- package/dist/i18n/{es.json → es.json.d.ts} +4 -2
- package/dist/i18n/es.json.js +8 -0
- package/dist/i18n/index.js +14 -11
- package/dist/i18n/{pl.json → pl.json.d.ts} +4 -2
- package/dist/i18n/pl.json.js +8 -0
- package/dist/i18n/{pt.json → pt.json.d.ts} +4 -2
- package/dist/i18n/pt.json.js +8 -0
- package/dist/js/DSProvider/DSProvider.d.ts +5 -6
- package/dist/js/DSProvider/DSProvider.js +36 -31
- package/dist/js/DSProvider/LocaleProvider/LocaleProvider.d.ts +2 -2
- package/dist/js/DSProvider/LocaleProvider/LocaleProvider.js +29 -38
- package/dist/js/DSProvider/LocaleProvider/LocaleProvider.types.d.ts +3 -3
- package/dist/js/DSProvider/LocaleProvider/LocaleProvider.types.js +1 -1
- package/dist/js/DSProvider/LocaleProvider/LocaleProvider.utils.d.ts +1 -1
- package/dist/js/DSProvider/LocaleProvider/LocaleProvider.utils.js +22 -19
- package/dist/js/DSProvider/LocaleProvider/antLocales.d.ts +6 -6
- package/dist/js/DSProvider/LocaleProvider/antLocales.js +16 -13
- package/dist/js/DSProvider/LocaleProvider/index.js +4 -1
- package/dist/js/DSProvider/ThemeProvider/ThemeProvider.d.ts +2 -2
- package/dist/js/DSProvider/ThemeProvider/ThemeProvider.js +14 -12
- package/dist/js/DSProvider/ThemeProvider/breakpoints.js +5 -2
- package/dist/js/DSProvider/ThemeProvider/index.js +4 -1
- package/dist/js/DSProvider/ThemeProvider/theme.d.ts +1 -1
- package/dist/js/DSProvider/ThemeProvider/theme.js +17 -17
- package/dist/js/DSProvider/ThemeProvider/variables.d.ts +8 -0
- package/dist/js/DSProvider/ThemeProvider/variables.js +531 -530
- package/dist/js/DSProvider/index.js +4 -1
- package/dist/js/DropdownContext/DropdownContext/DropdownContextProvider.d.ts +2 -2
- package/dist/js/DropdownContext/DropdownContext/DropdownContextProvider.js +11 -11
- package/dist/js/DropdownContext/DropdownContext.d.ts +1 -1
- package/dist/js/DropdownContext/DropdownContext.js +5 -2
- package/dist/js/DropdownContext/DropdownContextProvider.d.ts +2 -2
- package/dist/js/DropdownContext/DropdownContextProvider.js +11 -11
- package/dist/js/DropdownContext/index.js +8 -3
- package/dist/js/DropdownContext/useDropdown.d.ts +1 -1
- package/dist/js/DropdownContext/useDropdown.js +7 -4
- package/dist/js/data-format/components/FormattedDate.d.ts +4 -4
- package/dist/js/data-format/components/FormattedDate.js +23 -9
- package/dist/js/data-format/components/FormattedDateTime.d.ts +4 -4
- package/dist/js/data-format/components/FormattedDateTime.js +26 -12
- package/dist/js/data-format/components/FormattedNumber.d.ts +2 -2
- package/dist/js/data-format/components/FormattedNumber.js +23 -9
- package/dist/js/data-format/components/FormattedRelativeDateTime.d.ts +3 -3
- package/dist/js/data-format/components/FormattedRelativeDateTime.js +40 -21
- package/dist/js/data-format/components/FormattedTime.d.ts +4 -4
- package/dist/js/data-format/components/FormattedTime.js +26 -12
- package/dist/js/data-format/components/index.js +13 -5
- package/dist/js/data-format/constants/dataFormat.constants.d.ts +2 -2
- package/dist/js/data-format/constants/dataFormat.constants.js +85 -49
- package/dist/js/data-format/constants/dataFormatConfig.constants.d.ts +2 -2
- package/dist/js/data-format/constants/dataFormatConfig.constants.js +15 -8
- package/dist/js/data-format/constants/dateTimeParts.constants.d.ts +1 -1
- package/dist/js/data-format/constants/dateTimeParts.constants.js +10 -4
- package/dist/js/data-format/constants/index.js +48 -3
- package/dist/js/data-format/contexts/DataFormatConfigContext.d.ts +2 -2
- package/dist/js/data-format/contexts/DataFormatConfigContext.js +6 -3
- package/dist/js/data-format/contexts/DataFormatIntlsContext.d.ts +2 -2
- package/dist/js/data-format/contexts/DataFormatIntlsContext.js +7 -4
- package/dist/js/data-format/contexts/index.js +6 -2
- package/dist/js/data-format/hocs/withDataFormat.d.ts +2 -2
- package/dist/js/data-format/hocs/withDataFormat.js +23 -9
- package/dist/js/data-format/hooks/index.js +14 -6
- package/dist/js/data-format/hooks/useDataFormat.d.ts +1 -1
- package/dist/js/data-format/hooks/useDataFormat.js +93 -90
- package/dist/js/data-format/hooks/useDataFormatConfig.d.ts +1 -1
- package/dist/js/data-format/hooks/useDataFormatConfig.js +8 -4
- package/dist/js/data-format/hooks/useDataFormatIntls.d.ts +1 -1
- package/dist/js/data-format/hooks/useDataFormatIntls.js +8 -4
- package/dist/js/data-format/hooks/useDataFormatUtils.d.ts +4 -4
- package/dist/js/data-format/hooks/useDataFormatUtils.js +62 -63
- package/dist/js/data-format/hooks/useRelativeDateTimeUpdate.d.ts +2 -2
- package/dist/js/data-format/hooks/useRelativeDateTimeUpdate.js +19 -23
- package/dist/js/data-format/hooks/useSingleIntl.d.ts +1 -1
- package/dist/js/data-format/hooks/useSingleIntl.js +11 -8
- package/dist/js/data-format/index.js +83 -7
- package/dist/js/data-format/providers/DataFormatConfigProvider.d.ts +2 -2
- package/dist/js/data-format/providers/DataFormatConfigProvider.js +37 -26
- package/dist/js/data-format/types/dataFormat.types.d.ts +3 -3
- package/dist/js/data-format/types/dataFormat.types.js +1 -5
- package/dist/js/data-format/types/dataFormatConfig.types.d.ts +1 -1
- package/dist/js/data-format/types/dataFormatConfig.types.js +1 -2
- package/dist/js/data-format/types/dateTimeParts.types.js +1 -2
- package/dist/js/data-format/types/index.js +1 -1
- package/dist/js/data-format/utils/dataFormat.utils.d.ts +2 -2
- package/dist/js/data-format/utils/dataFormat.utils.js +82 -67
- package/dist/js/data-format/utils/dataFormatConfig.utils.d.ts +1 -1
- package/dist/js/data-format/utils/dataFormatConfig.utils.js +9 -8
- package/dist/js/data-format/utils/date.utils.d.ts +2 -2
- package/dist/js/data-format/utils/date.utils.js +25 -21
- package/dist/js/data-format/utils/dateTimeParts.utils.d.ts +2 -2
- package/dist/js/data-format/utils/dateTimeParts.utils.js +68 -52
- package/dist/js/data-format/utils/index.js +41 -5
- package/dist/js/data-format/utils/timeZone.utils.d.ts +1 -1
- package/dist/js/data-format/utils/timeZone.utils.js +59 -51
- package/dist/js/index.js +112 -7
- package/dist/js/mediaQuery/mediaQuery.d.ts +2 -2
- package/dist/js/mediaQuery/mediaQuery.js +15 -25
- package/dist/js/style.d.ts +0 -2
- package/dist/js/style.js +1 -2
- package/dist/js/testing/index.js +6 -2
- package/dist/js/testing/renderWithProvider/renderWithProvider.d.ts +4 -4
- package/dist/js/testing/renderWithProvider/renderWithProvider.js +35 -27
- package/dist/js/testing/sleep.js +6 -8
- package/dist/js/toaster/Toaster.d.ts +1 -1
- package/dist/js/toaster/Toaster.js +12 -8
- package/dist/js/toaster/Toaster.types.js +1 -1
- package/dist/js/toaster/constants.d.ts +1 -1
- package/dist/js/toaster/constants.js +7 -4
- package/dist/js/toaster/contexts/ToasterContext.d.ts +2 -2
- package/dist/js/toaster/contexts/ToasterContext.js +9 -5
- package/dist/js/toaster/hooks/useToaster.d.ts +1 -1
- package/dist/js/toaster/hooks/useToaster.js +7 -4
- package/dist/js/toaster/index.js +12 -5
- package/dist/js/toaster/providers/ToasterProvider.d.ts +2 -2
- package/dist/js/toaster/providers/ToasterProvider.js +17 -17
- package/package.json +4 -4
- package/dist/js/testing/renderWithProvider/renderWithProvider.spec.d.ts +0 -1
- package/dist/style/colors.less +0 -137
- package/dist/style/config.less +0 -521
- package/dist/style/core.less +0 -55
- package/dist/style/variables.less +0 -2
- /package/dist/{style/variables.css → assets/style/core-tn0RQdqM.css} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React,
|
|
2
|
-
import {
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { DropdownContextProps } from '../DropdownContext';
|
|
3
3
|
export declare const DropdownContextProvider: ({ children, ...rest }: DropdownContextProps & {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}) => React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DropdownContext } from "../DropdownContext.js";
|
|
3
|
+
const DropdownContextProvider = ({
|
|
4
|
+
children,
|
|
5
|
+
...rest
|
|
6
|
+
}) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(DropdownContext.Provider, { value: rest, children });
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
DropdownContextProvider
|
|
11
|
+
};
|
|
@@ -4,4 +4,4 @@ export type DropdownContextProps = {
|
|
|
4
4
|
setIsOpen: (newOpen: boolean) => void;
|
|
5
5
|
hideOnItemClick?: string | boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const DropdownContext: import(
|
|
7
|
+
export declare const DropdownContext: import('react').Context<DropdownContextProps | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React,
|
|
2
|
-
import {
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { DropdownContextProps } from './DropdownContext';
|
|
3
3
|
export declare const DropdownContextProvider: ({ children, ...rest }: DropdownContextProps & {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}) => React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DropdownContext } from "./DropdownContext.js";
|
|
3
|
+
const DropdownContextProvider = ({
|
|
4
|
+
children,
|
|
5
|
+
...rest
|
|
6
|
+
}) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(DropdownContext.Provider, { value: rest, children });
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
DropdownContextProvider
|
|
11
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { DropdownContext } from "./DropdownContext.js";
|
|
2
|
+
import { DropdownContextProvider } from "./DropdownContextProvider.js";
|
|
3
|
+
import { useDropdown } from "./useDropdown.js";
|
|
4
|
+
export {
|
|
5
|
+
DropdownContext,
|
|
6
|
+
DropdownContextProvider,
|
|
7
|
+
useDropdown
|
|
8
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useDropdown: () => import(
|
|
1
|
+
export declare const useDropdown: () => import('./DropdownContext').DropdownContextProps | undefined;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { useContext } from
|
|
2
|
-
import { DropdownContext } from
|
|
3
|
-
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { DropdownContext } from "./DropdownContext.js";
|
|
3
|
+
const useDropdown = () => {
|
|
4
4
|
return useContext(DropdownContext);
|
|
5
|
-
};
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
useDropdown
|
|
8
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import {
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { Moment } from 'moment';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
import { DateToFormatOptions } from '../types';
|
|
5
5
|
export type FormattedDateProps = {
|
|
6
6
|
value: Date | Moment | Dayjs;
|
|
7
7
|
options?: DateToFormatOptions;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../contexts/DataFormatConfigContext.js";
|
|
4
|
+
import "../contexts/DataFormatIntlsContext.js";
|
|
5
|
+
import { useDataFormat } from "../hooks/useDataFormat.js";
|
|
6
|
+
import "dayjs";
|
|
7
|
+
import "moment";
|
|
8
|
+
import "react-intl";
|
|
9
|
+
import "../constants/dataFormatConfig.constants.js";
|
|
10
|
+
import "../utils/timeZone.utils.js";
|
|
11
|
+
import "../utils/dataFormat.utils.js";
|
|
12
|
+
const FormattedDate = ({
|
|
13
|
+
value,
|
|
14
|
+
options
|
|
15
|
+
}) => {
|
|
16
|
+
const {
|
|
17
|
+
formatValue
|
|
18
|
+
} = useDataFormat();
|
|
19
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, options) });
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
FormattedDate
|
|
23
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import {
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { Moment } from 'moment';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
import { DateToFormatOptions } from '../types';
|
|
5
5
|
export type FormattedTimeProps = {
|
|
6
6
|
value: Date | Moment | Dayjs;
|
|
7
7
|
options?: DateToFormatOptions;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { DATETIME } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "../constants/dataFormatConfig.constants.js";
|
|
3
|
+
import { DATETIME } from "../constants/dataFormat.constants.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../contexts/DataFormatConfigContext.js";
|
|
6
|
+
import "../contexts/DataFormatIntlsContext.js";
|
|
7
|
+
import { useDataFormat } from "../hooks/useDataFormat.js";
|
|
8
|
+
import "dayjs";
|
|
9
|
+
import "moment";
|
|
10
|
+
import "react-intl";
|
|
11
|
+
import "../utils/timeZone.utils.js";
|
|
12
|
+
import "../utils/dataFormat.utils.js";
|
|
13
|
+
const FormattedDateTime = ({
|
|
14
|
+
value,
|
|
15
|
+
options
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
formatValue
|
|
19
|
+
} = useDataFormat();
|
|
20
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, {
|
|
21
|
+
...options,
|
|
11
22
|
targetFormat: DATETIME
|
|
12
|
-
}))
|
|
13
|
-
};
|
|
23
|
+
}) });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
FormattedDateTime
|
|
27
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NumberToFormatOptions } from '../types';
|
|
3
3
|
export type FormattedNumberProps = {
|
|
4
4
|
value: number;
|
|
5
5
|
options?: NumberToFormatOptions;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../contexts/DataFormatConfigContext.js";
|
|
4
|
+
import "../contexts/DataFormatIntlsContext.js";
|
|
5
|
+
import { useDataFormat } from "../hooks/useDataFormat.js";
|
|
6
|
+
import "dayjs";
|
|
7
|
+
import "moment";
|
|
8
|
+
import "react-intl";
|
|
9
|
+
import "../constants/dataFormatConfig.constants.js";
|
|
10
|
+
import "../utils/timeZone.utils.js";
|
|
11
|
+
import "../utils/dataFormat.utils.js";
|
|
12
|
+
const FormattedNumber = ({
|
|
13
|
+
value,
|
|
14
|
+
options
|
|
15
|
+
}) => {
|
|
16
|
+
const {
|
|
17
|
+
formatValue
|
|
18
|
+
} = useDataFormat();
|
|
19
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, options) });
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
FormattedNumber
|
|
23
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { Moment } from 'moment';
|
|
3
|
+
import { DateToFormatOptions } from '../types';
|
|
4
4
|
export type FormattedRelativeDateTimeProps = {
|
|
5
5
|
value: Date | Moment | Dayjs;
|
|
6
6
|
withoutSuffix?: boolean;
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { RELATIVE_FROM,
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "../constants/dataFormatConfig.constants.js";
|
|
3
|
+
import { RELATIVE_FROM_WITHOUT_SUFFIX, RELATIVE_FROM, RELATIVE_TO_WITHOUT_SUFFIX, RELATIVE_TO } from "../constants/dataFormat.constants.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../contexts/DataFormatConfigContext.js";
|
|
6
|
+
import "../contexts/DataFormatIntlsContext.js";
|
|
7
|
+
import { useDataFormat } from "../hooks/useDataFormat.js";
|
|
8
|
+
import "dayjs";
|
|
9
|
+
import "moment";
|
|
10
|
+
import "react-intl";
|
|
11
|
+
import "../utils/timeZone.utils.js";
|
|
12
|
+
import "../utils/dataFormat.utils.js";
|
|
13
|
+
import { useRelativeDateTimeUpdate } from "../hooks/useRelativeDateTimeUpdate.js";
|
|
14
|
+
const FormattedRelativeDateTimeTo = ({
|
|
15
|
+
value,
|
|
16
|
+
withoutSuffix,
|
|
17
|
+
options
|
|
18
|
+
}) => {
|
|
9
19
|
useRelativeDateTimeUpdate(value);
|
|
10
|
-
|
|
11
|
-
formatValue
|
|
12
|
-
|
|
20
|
+
const {
|
|
21
|
+
formatValue
|
|
22
|
+
} = useDataFormat();
|
|
23
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, {
|
|
24
|
+
...options,
|
|
13
25
|
targetFormat: withoutSuffix ? RELATIVE_TO_WITHOUT_SUFFIX : RELATIVE_TO
|
|
14
|
-
}))
|
|
26
|
+
}) });
|
|
15
27
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
const FormattedRelativeDateTimeFrom = ({
|
|
29
|
+
value,
|
|
30
|
+
withoutSuffix,
|
|
31
|
+
options
|
|
32
|
+
}) => {
|
|
20
33
|
useRelativeDateTimeUpdate(value);
|
|
21
|
-
|
|
22
|
-
formatValue
|
|
23
|
-
|
|
34
|
+
const {
|
|
35
|
+
formatValue
|
|
36
|
+
} = useDataFormat();
|
|
37
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, {
|
|
38
|
+
...options,
|
|
24
39
|
targetFormat: withoutSuffix ? RELATIVE_FROM_WITHOUT_SUFFIX : RELATIVE_FROM
|
|
25
|
-
}))
|
|
26
|
-
};
|
|
40
|
+
}) });
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
FormattedRelativeDateTimeFrom,
|
|
44
|
+
FormattedRelativeDateTimeTo
|
|
45
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import {
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { Moment } from 'moment';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
import { DateToFormatOptions } from '../types';
|
|
5
5
|
export type FormattedTimeProps = {
|
|
6
6
|
value: Date | Moment | Dayjs;
|
|
7
7
|
options?: DateToFormatOptions;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { TIME } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "../constants/dataFormatConfig.constants.js";
|
|
3
|
+
import { TIME } from "../constants/dataFormat.constants.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../contexts/DataFormatConfigContext.js";
|
|
6
|
+
import "../contexts/DataFormatIntlsContext.js";
|
|
7
|
+
import { useDataFormat } from "../hooks/useDataFormat.js";
|
|
8
|
+
import "dayjs";
|
|
9
|
+
import "moment";
|
|
10
|
+
import "react-intl";
|
|
11
|
+
import "../utils/timeZone.utils.js";
|
|
12
|
+
import "../utils/dataFormat.utils.js";
|
|
13
|
+
const FormattedTime = ({
|
|
14
|
+
value,
|
|
15
|
+
options
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
formatValue
|
|
19
|
+
} = useDataFormat();
|
|
20
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, {
|
|
21
|
+
...options,
|
|
11
22
|
targetFormat: TIME
|
|
12
|
-
}))
|
|
13
|
-
};
|
|
23
|
+
}) });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
FormattedTime
|
|
27
|
+
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { FormattedDate } from "./FormattedDate.js";
|
|
2
|
+
import { FormattedDateTime } from "./FormattedDateTime.js";
|
|
3
|
+
import { FormattedNumber } from "./FormattedNumber.js";
|
|
4
|
+
import { FormattedTime } from "./FormattedTime.js";
|
|
5
|
+
import { FormattedRelativeDateTimeFrom, FormattedRelativeDateTimeTo } from "./FormattedRelativeDateTime.js";
|
|
6
|
+
export {
|
|
7
|
+
FormattedDate,
|
|
8
|
+
FormattedDateTime,
|
|
9
|
+
FormattedNumber,
|
|
10
|
+
FormattedRelativeDateTimeFrom,
|
|
11
|
+
FormattedRelativeDateTimeTo,
|
|
12
|
+
FormattedTime
|
|
13
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FormatDateOptions, FormatNumberOptions } from 'react-intl';
|
|
2
|
+
import { DateConstantsTargetFormat, DateTargetFormat, Delimiter, NamingConvention, NumberTargetFormat } from '../types';
|
|
3
3
|
export declare const DEFAULT_FORMAT_NUMBER_OPTIONS: FormatNumberOptions;
|
|
4
4
|
export declare const DEFAULT_FORMAT_DATE_OPTIONS: FormatDateOptions;
|
|
5
5
|
export declare const DEFAULT_FORMAT_TIME_OPTIONS: FormatDateOptions;
|
|
@@ -1,52 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
const DEFAULT_FORMAT_NUMBER_OPTIONS = {
|
|
2
2
|
maximumFractionDigits: 2,
|
|
3
3
|
useGrouping: true
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
year:
|
|
7
|
-
month:
|
|
8
|
-
day:
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
hour:
|
|
12
|
-
minute:
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
weekday:
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
weekday:
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
month:
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
month:
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
5
|
+
const DEFAULT_FORMAT_DATE_OPTIONS = {
|
|
6
|
+
year: "numeric",
|
|
7
|
+
month: "numeric",
|
|
8
|
+
day: "numeric"
|
|
9
|
+
};
|
|
10
|
+
const DEFAULT_FORMAT_TIME_OPTIONS = {
|
|
11
|
+
hour: "numeric",
|
|
12
|
+
minute: "numeric"
|
|
13
|
+
};
|
|
14
|
+
const DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS = {
|
|
15
|
+
weekday: "long"
|
|
16
|
+
};
|
|
17
|
+
const DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS = {
|
|
18
|
+
weekday: "short"
|
|
19
|
+
};
|
|
20
|
+
const DEFAULT_FORMAT_MONTH_LONG_OPTIONS = {
|
|
21
|
+
month: "long"
|
|
22
|
+
};
|
|
23
|
+
const DEFAULT_FORMAT_MONTH_SHORT_OPTIONS = {
|
|
24
|
+
month: "short"
|
|
25
|
+
};
|
|
26
|
+
const DATE = "date";
|
|
27
|
+
const TIME = "time";
|
|
28
|
+
const DATETIME = "datetime";
|
|
29
|
+
const RELATIVE_FROM = "relative-from";
|
|
30
|
+
const RELATIVE_TO = "relative-to";
|
|
31
|
+
const RELATIVE_FROM_WITHOUT_SUFFIX = "relative-from-without-suffix";
|
|
32
|
+
const RELATIVE_TO_WITHOUT_SUFFIX = "relative-to-without-suffix";
|
|
33
|
+
const WEEKDAY_LONG = "weekday-long";
|
|
34
|
+
const WEEKDAY_SHORT = "weekday-short";
|
|
35
|
+
const MONTH_LONG = "month-long";
|
|
36
|
+
const MONTH_SHORT = "month-short";
|
|
37
|
+
const COMPACT_LARGER_NUMBER = "compact-larger-number";
|
|
38
|
+
const COMPACT_DECIMAL_LARGER_NUMBER = "compact-decimal-larger-number";
|
|
39
|
+
const LARGER_NUMBER_LIMIT = 999;
|
|
40
|
+
const UPPER_CASE = "upperCase";
|
|
41
|
+
const UPPER_FIRST = "upperFirst";
|
|
42
|
+
const LOWER_CASE = "lowerCase";
|
|
43
|
+
const LOWER_FIRST = "lowerFirst";
|
|
44
|
+
const US_THOUSAND_DELIMITER = ",";
|
|
45
|
+
const US_DECIMAL_DELIMITER = ".";
|
|
46
|
+
const EU_THOUSAND_DELIMITER = " ";
|
|
47
|
+
const EU_DECIMAL_DELIMITER = ",";
|
|
48
|
+
const DATE_CONSTANTS_TARGET_FORMATS = ["months-long", "months-short", "weekdays-long", "weekdays-short"];
|
|
49
|
+
const MONTHS_LONG = "months-long";
|
|
50
|
+
const MONTHS_SHORT = "months-short";
|
|
51
|
+
const WEEKDAYS_LONG = "weekdays-long";
|
|
52
|
+
const WEEKDAYS_SHORT = "weekdays-short";
|
|
53
|
+
export {
|
|
54
|
+
COMPACT_DECIMAL_LARGER_NUMBER,
|
|
55
|
+
COMPACT_LARGER_NUMBER,
|
|
56
|
+
DATE,
|
|
57
|
+
DATETIME,
|
|
58
|
+
DATE_CONSTANTS_TARGET_FORMATS,
|
|
59
|
+
DEFAULT_FORMAT_DATE_OPTIONS,
|
|
60
|
+
DEFAULT_FORMAT_MONTH_LONG_OPTIONS,
|
|
61
|
+
DEFAULT_FORMAT_MONTH_SHORT_OPTIONS,
|
|
62
|
+
DEFAULT_FORMAT_NUMBER_OPTIONS,
|
|
63
|
+
DEFAULT_FORMAT_TIME_OPTIONS,
|
|
64
|
+
DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS,
|
|
65
|
+
DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS,
|
|
66
|
+
EU_DECIMAL_DELIMITER,
|
|
67
|
+
EU_THOUSAND_DELIMITER,
|
|
68
|
+
LARGER_NUMBER_LIMIT,
|
|
69
|
+
LOWER_CASE,
|
|
70
|
+
LOWER_FIRST,
|
|
71
|
+
MONTHS_LONG,
|
|
72
|
+
MONTHS_SHORT,
|
|
73
|
+
MONTH_LONG,
|
|
74
|
+
MONTH_SHORT,
|
|
75
|
+
RELATIVE_FROM,
|
|
76
|
+
RELATIVE_FROM_WITHOUT_SUFFIX,
|
|
77
|
+
RELATIVE_TO,
|
|
78
|
+
RELATIVE_TO_WITHOUT_SUFFIX,
|
|
79
|
+
TIME,
|
|
80
|
+
UPPER_CASE,
|
|
81
|
+
UPPER_FIRST,
|
|
82
|
+
US_DECIMAL_DELIMITER,
|
|
83
|
+
US_THOUSAND_DELIMITER,
|
|
84
|
+
WEEKDAYS_LONG,
|
|
85
|
+
WEEKDAYS_SHORT,
|
|
86
|
+
WEEKDAY_LONG,
|
|
87
|
+
WEEKDAY_SHORT
|
|
88
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IntlShape } from 'react-intl';
|
|
2
|
+
import { DataFormatConfig, DataFormatNotationType } from '../types';
|
|
3
3
|
export declare const EU_NOTATION: DataFormatNotationType;
|
|
4
4
|
export declare const US_NOTATION: DataFormatNotationType;
|
|
5
5
|
export declare const DEFAULT_DATA_FORMAT_NOTATION: DataFormatNotationType;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { createIntl } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { createIntl } from "react-intl";
|
|
2
|
+
const EU_NOTATION = "EU";
|
|
3
|
+
const US_NOTATION = "US";
|
|
4
|
+
const DEFAULT_DATA_FORMAT_NOTATION = EU_NOTATION;
|
|
5
|
+
const DEFAULT_DATA_FORMAT_CONFIG = {
|
|
6
6
|
startWeekDayNotation: DEFAULT_DATA_FORMAT_NOTATION,
|
|
7
7
|
dateFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
|
|
8
8
|
timeFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
|
|
9
9
|
numberFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
|
|
10
10
|
applyTimeZoneOffset: false
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
locale:
|
|
14
|
-
});
|
|
12
|
+
const DEFAULT_DATA_FORMAT_INTL = createIntl({
|
|
13
|
+
locale: "pl"
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
DEFAULT_DATA_FORMAT_CONFIG,
|
|
17
|
+
DEFAULT_DATA_FORMAT_INTL,
|
|
18
|
+
DEFAULT_DATA_FORMAT_NOTATION,
|
|
19
|
+
EU_NOTATION,
|
|
20
|
+
US_NOTATION
|
|
21
|
+
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const WEEKDAY = "weekday";
|
|
2
|
+
const MONTH = "month";
|
|
3
|
+
const LONG = "long";
|
|
4
|
+
const SHORT = "short";
|
|
5
|
+
export {
|
|
6
|
+
LONG,
|
|
7
|
+
MONTH,
|
|
8
|
+
SHORT,
|
|
9
|
+
WEEKDAY
|
|
10
|
+
};
|