@synerise/ds-core 1.5.1 → 1.6.0

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.
Files changed (100) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +181 -0
  3. package/dist/i18n/en.json +11 -1
  4. package/dist/i18n/es.json +10 -1
  5. package/dist/i18n/index.d.ts +51 -1
  6. package/dist/i18n/pl.json +11 -1
  7. package/dist/i18n/pt.json +11 -1
  8. package/dist/js/DSProvider/DSProvider.d.ts +2 -2
  9. package/dist/js/DSProvider/DSProvider.js +2 -2
  10. package/dist/js/DSProvider/LocaleProvider/LocaleProvider.utils.d.ts +21 -1
  11. package/dist/js/DSProvider/ThemeProvider/breakpoints.d.ts +5 -1
  12. package/dist/js/data-format/components/FormattedDate.d.ts +9 -0
  13. package/dist/js/data-format/components/FormattedDate.js +9 -0
  14. package/dist/js/data-format/components/FormattedDateTime.d.ts +9 -0
  15. package/dist/js/data-format/components/FormattedDateTime.js +13 -0
  16. package/dist/js/data-format/components/FormattedNumber.d.ts +7 -0
  17. package/dist/js/data-format/components/FormattedNumber.js +9 -0
  18. package/dist/js/data-format/components/FormattedRelativeDateTime.d.ts +10 -0
  19. package/dist/js/data-format/components/FormattedRelativeDateTime.js +24 -0
  20. package/dist/js/data-format/components/FormattedTime.d.ts +9 -0
  21. package/dist/js/data-format/components/FormattedTime.js +13 -0
  22. package/dist/js/data-format/components/index.d.ts +5 -0
  23. package/dist/js/data-format/components/index.js +5 -0
  24. package/dist/js/data-format/constants/dataFormat.constants.d.ts +36 -0
  25. package/dist/js/data-format/constants/dataFormat.constants.js +52 -0
  26. package/dist/js/data-format/constants/dataFormatConfig.constants.d.ts +7 -0
  27. package/dist/js/data-format/constants/dataFormatConfig.constants.js +14 -0
  28. package/dist/js/data-format/constants/dateTimeParts.constants.d.ts +5 -0
  29. package/dist/js/data-format/constants/dateTimeParts.constants.js +4 -0
  30. package/dist/js/data-format/constants/index.d.ts +3 -0
  31. package/dist/js/data-format/constants/index.js +3 -0
  32. package/dist/js/data-format/contexts/DataFormatConfigContext.d.ts +2 -0
  33. package/dist/js/data-format/contexts/DataFormatConfigContext.js +3 -0
  34. package/dist/js/data-format/contexts/DataFormatIntlsContext.d.ts +2 -0
  35. package/dist/js/data-format/contexts/DataFormatIntlsContext.js +7 -0
  36. package/dist/js/data-format/contexts/index.d.ts +2 -0
  37. package/dist/js/data-format/contexts/index.js +2 -0
  38. package/dist/js/data-format/hocs/withDataFormat.d.ts +4 -0
  39. package/dist/js/data-format/hocs/withDataFormat.js +10 -0
  40. package/dist/js/data-format/hooks/index.d.ts +5 -0
  41. package/dist/js/data-format/hooks/index.js +5 -0
  42. package/dist/js/data-format/hooks/useDataFormat.d.ts +12 -0
  43. package/dist/js/data-format/hooks/useDataFormat.js +96 -0
  44. package/dist/js/data-format/hooks/useDataFormatConfig.d.ts +2 -0
  45. package/dist/js/data-format/hooks/useDataFormatConfig.js +5 -0
  46. package/dist/js/data-format/hooks/useDataFormatIntls.d.ts +2 -0
  47. package/dist/js/data-format/hooks/useDataFormatIntls.js +5 -0
  48. package/dist/js/data-format/hooks/useDataFormatUtils.d.ts +16 -0
  49. package/dist/js/data-format/hooks/useDataFormatUtils.js +113 -0
  50. package/dist/js/data-format/hooks/useSingleIntl.d.ts +4 -0
  51. package/dist/js/data-format/hooks/useSingleIntl.js +12 -0
  52. package/dist/js/data-format/index.d.ts +8 -0
  53. package/dist/js/data-format/index.js +7 -0
  54. package/dist/js/data-format/providers/DataFormatConfigProvider.d.ts +7 -0
  55. package/dist/js/data-format/providers/DataFormatConfigProvider.js +26 -0
  56. package/dist/js/data-format/types/dataFormat.types.d.ts +42 -0
  57. package/dist/js/data-format/types/dataFormat.types.js +5 -0
  58. package/dist/js/data-format/types/dataFormatConfig.types.d.ts +16 -0
  59. package/dist/js/data-format/types/dataFormatConfig.types.js +2 -0
  60. package/dist/js/data-format/types/dateTimeParts.types.d.ts +3 -0
  61. package/dist/js/data-format/types/dateTimeParts.types.js +2 -0
  62. package/dist/js/data-format/types/index.d.ts +3 -0
  63. package/dist/js/data-format/types/index.js +1 -0
  64. package/dist/js/data-format/utils/dataFormat.utils.d.ts +16 -0
  65. package/dist/js/data-format/utils/dataFormat.utils.js +119 -0
  66. package/dist/js/data-format/utils/dataFormatConfig.utils.d.ts +2 -0
  67. package/dist/js/data-format/utils/dataFormatConfig.utils.js +8 -0
  68. package/dist/js/data-format/utils/date.utils.d.ts +8 -0
  69. package/dist/js/data-format/utils/date.utils.js +50 -0
  70. package/dist/js/data-format/utils/dateTimeParts.utils.d.ts +14 -0
  71. package/dist/js/data-format/utils/dateTimeParts.utils.js +86 -0
  72. package/dist/js/data-format/utils/index.d.ts +5 -0
  73. package/dist/js/data-format/utils/index.js +5 -0
  74. package/dist/js/data-format/utils/timeZone.utils.d.ts +16 -0
  75. package/dist/js/data-format/utils/timeZone.utils.js +94 -0
  76. package/dist/js/index.d.ts +3 -0
  77. package/dist/js/index.js +4 -1
  78. package/dist/js/mediaQuery/mediaQuery.d.ts +1 -5
  79. package/dist/js/testing/index.d.ts +2 -0
  80. package/dist/js/testing/index.js +2 -0
  81. package/dist/js/testing/renderWithProvider/renderWithProvider.d.ts +10 -0
  82. package/dist/js/testing/renderWithProvider/renderWithProvider.js +28 -0
  83. package/dist/js/testing/renderWithProvider/renderWithProvider.spec.d.ts +1 -0
  84. package/dist/js/testing/sleep.d.ts +1 -0
  85. package/dist/js/testing/sleep.js +8 -0
  86. package/dist/js/toaster/Toaster.d.ts +2 -0
  87. package/dist/js/toaster/Toaster.js +8 -0
  88. package/dist/js/toaster/Toaster.types.d.ts +1 -0
  89. package/dist/js/toaster/Toaster.types.js +1 -0
  90. package/dist/js/toaster/constants.d.ts +2 -0
  91. package/dist/js/toaster/constants.js +8 -0
  92. package/dist/js/toaster/contexts/ToasterContext.d.ts +6 -0
  93. package/dist/js/toaster/contexts/ToasterContext.js +6 -0
  94. package/dist/js/toaster/hooks/useToaster.d.ts +1 -0
  95. package/dist/js/toaster/hooks/useToaster.js +5 -0
  96. package/dist/js/toaster/index.d.ts +6 -0
  97. package/dist/js/toaster/index.js +5 -0
  98. package/dist/js/toaster/providers/ToasterProvider.d.ts +6 -0
  99. package/dist/js/toaster/providers/ToasterProvider.js +17 -0
  100. package/package.json +15 -7
@@ -0,0 +1,52 @@
1
+ export var DEFAULT_FORMAT_NUMBER_OPTIONS = {
2
+ maximumFractionDigits: 2,
3
+ useGrouping: true
4
+ };
5
+ export var DEFAULT_FORMAT_DATE_OPTIONS = {
6
+ year: 'numeric',
7
+ month: 'numeric',
8
+ day: 'numeric'
9
+ };
10
+ export var DEFAULT_FORMAT_TIME_OPTIONS = {
11
+ hour: 'numeric',
12
+ minute: 'numeric'
13
+ };
14
+ export var DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS = {
15
+ weekday: 'long'
16
+ };
17
+ export var DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS = {
18
+ weekday: 'short'
19
+ };
20
+ export var DEFAULT_FORMAT_MONTH_LONG_OPTIONS = {
21
+ month: 'long'
22
+ };
23
+ export var DEFAULT_FORMAT_MONTH_SHORT_OPTIONS = {
24
+ month: 'short'
25
+ };
26
+ export var DATE = 'date';
27
+ export var TIME = 'time';
28
+ export var DATETIME = 'datetime';
29
+ export var RELATIVE_FROM = 'relative-from';
30
+ export var RELATIVE_TO = 'relative-to';
31
+ export var RELATIVE_FROM_WITHOUT_SUFFIX = 'relative-from-without-suffix';
32
+ export var RELATIVE_TO_WITHOUT_SUFFIX = 'relative-to-without-suffix';
33
+ export var WEEKDAY_LONG = 'weekday-long';
34
+ export var WEEKDAY_SHORT = 'weekday-short';
35
+ export var MONTH_LONG = 'month-long';
36
+ export var MONTH_SHORT = 'month-short';
37
+ export var COMPACT_LARGER_NUMBER = 'compact-larger-number';
38
+ export var COMPACT_DECIMAL_LARGER_NUMBER = 'compact-decimal-larger-number';
39
+ export var LARGER_NUMBER_LIMIT = 999;
40
+ export var UPPER_CASE = 'upperCase';
41
+ export var UPPER_FIRST = 'upperFirst';
42
+ export var LOWER_CASE = 'lowerCase';
43
+ export var LOWER_FIRST = 'lowerFirst';
44
+ export var US_THOUSAND_DELIMITER = ',';
45
+ export var US_DECIMAL_DELIMITER = '.';
46
+ export var EU_THOUSAND_DELIMITER = ' ';
47
+ export var EU_DECIMAL_DELIMITER = ',';
48
+ export var DATE_CONSTANTS_TARGET_FORMATS = ['months-long', 'months-short', 'weekdays-long', 'weekdays-short'];
49
+ export var MONTHS_LONG = 'months-long';
50
+ export var MONTHS_SHORT = 'months-short';
51
+ export var WEEKDAYS_LONG = 'weekdays-long';
52
+ export var WEEKDAYS_SHORT = 'weekdays-short';
@@ -0,0 +1,7 @@
1
+ import { type IntlShape } from 'react-intl';
2
+ import { type DataFormatConfig, type DataFormatNotationType } from '../types';
3
+ export declare const EU_NOTATION: DataFormatNotationType;
4
+ export declare const US_NOTATION: DataFormatNotationType;
5
+ export declare const DEFAULT_DATA_FORMAT_NOTATION: DataFormatNotationType;
6
+ export declare const DEFAULT_DATA_FORMAT_CONFIG: DataFormatConfig;
7
+ export declare const DEFAULT_DATA_FORMAT_INTL: IntlShape;
@@ -0,0 +1,14 @@
1
+ import { createIntl } from 'react-intl';
2
+ export var EU_NOTATION = 'EU';
3
+ export var US_NOTATION = 'US';
4
+ export var DEFAULT_DATA_FORMAT_NOTATION = EU_NOTATION;
5
+ export var DEFAULT_DATA_FORMAT_CONFIG = {
6
+ startWeekDayNotation: DEFAULT_DATA_FORMAT_NOTATION,
7
+ dateFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
8
+ timeFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
9
+ numberFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
10
+ applyTimeZoneOffset: false
11
+ };
12
+ export var DEFAULT_DATA_FORMAT_INTL = createIntl({
13
+ locale: 'pl'
14
+ });
@@ -0,0 +1,5 @@
1
+ import { type DateTimePartFormat } from '../types';
2
+ export declare const WEEKDAY: Intl.DateTimeFormatPartTypes;
3
+ export declare const MONTH: Intl.DateTimeFormatPartTypes;
4
+ export declare const LONG: DateTimePartFormat;
5
+ export declare const SHORT: DateTimePartFormat;
@@ -0,0 +1,4 @@
1
+ export var WEEKDAY = 'weekday';
2
+ export var MONTH = 'month';
3
+ export var LONG = 'long';
4
+ export var SHORT = 'short';
@@ -0,0 +1,3 @@
1
+ export { DEFAULT_DATA_FORMAT_CONFIG, DEFAULT_DATA_FORMAT_INTL, DEFAULT_DATA_FORMAT_NOTATION, EU_NOTATION, US_NOTATION, } from './dataFormatConfig.constants';
2
+ export { DEFAULT_FORMAT_DATE_OPTIONS, DEFAULT_FORMAT_TIME_OPTIONS, DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS, DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS, DEFAULT_FORMAT_MONTH_LONG_OPTIONS, DEFAULT_FORMAT_MONTH_SHORT_OPTIONS, DATE, TIME, RELATIVE_TO, RELATIVE_FROM, RELATIVE_TO_WITHOUT_SUFFIX, RELATIVE_FROM_WITHOUT_SUFFIX, DATETIME, WEEKDAY_LONG, WEEKDAY_SHORT, MONTH_LONG, MONTH_SHORT, UPPER_CASE, UPPER_FIRST, LOWER_CASE, LOWER_FIRST, US_THOUSAND_DELIMITER, US_DECIMAL_DELIMITER, EU_THOUSAND_DELIMITER, EU_DECIMAL_DELIMITER, DATE_CONSTANTS_TARGET_FORMATS, MONTHS_LONG, MONTHS_SHORT, WEEKDAYS_LONG, WEEKDAYS_SHORT, COMPACT_LARGER_NUMBER, COMPACT_DECIMAL_LARGER_NUMBER, LARGER_NUMBER_LIMIT, DEFAULT_FORMAT_NUMBER_OPTIONS, } from './dataFormat.constants';
3
+ export { WEEKDAY, MONTH, LONG, SHORT } from './dateTimeParts.constants';
@@ -0,0 +1,3 @@
1
+ export { DEFAULT_DATA_FORMAT_CONFIG, DEFAULT_DATA_FORMAT_INTL, DEFAULT_DATA_FORMAT_NOTATION, EU_NOTATION, US_NOTATION } from './dataFormatConfig.constants';
2
+ export { DEFAULT_FORMAT_DATE_OPTIONS, DEFAULT_FORMAT_TIME_OPTIONS, DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS, DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS, DEFAULT_FORMAT_MONTH_LONG_OPTIONS, DEFAULT_FORMAT_MONTH_SHORT_OPTIONS, DATE, TIME, RELATIVE_TO, RELATIVE_FROM, RELATIVE_TO_WITHOUT_SUFFIX, RELATIVE_FROM_WITHOUT_SUFFIX, DATETIME, WEEKDAY_LONG, WEEKDAY_SHORT, MONTH_LONG, MONTH_SHORT, UPPER_CASE, UPPER_FIRST, LOWER_CASE, LOWER_FIRST, US_THOUSAND_DELIMITER, US_DECIMAL_DELIMITER, EU_THOUSAND_DELIMITER, EU_DECIMAL_DELIMITER, DATE_CONSTANTS_TARGET_FORMATS, MONTHS_LONG, MONTHS_SHORT, WEEKDAYS_LONG, WEEKDAYS_SHORT, COMPACT_LARGER_NUMBER, COMPACT_DECIMAL_LARGER_NUMBER, LARGER_NUMBER_LIMIT, DEFAULT_FORMAT_NUMBER_OPTIONS } from './dataFormat.constants';
3
+ export { WEEKDAY, MONTH, LONG, SHORT } from './dateTimeParts.constants';
@@ -0,0 +1,2 @@
1
+ import { type DataFormatConfig } from '../types';
2
+ export declare const DataFormatConfigContext: import("react").Context<DataFormatConfig>;
@@ -0,0 +1,3 @@
1
+ import { createContext } from 'react';
2
+ import { DEFAULT_DATA_FORMAT_CONFIG } from '../constants';
3
+ export var DataFormatConfigContext = /*#__PURE__*/createContext(DEFAULT_DATA_FORMAT_CONFIG);
@@ -0,0 +1,2 @@
1
+ import { type DataFormatIntls } from '../types';
2
+ export declare const DataFormatIntlsContext: import("react").Context<DataFormatIntls>;
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+ import { DEFAULT_DATA_FORMAT_INTL } from '../constants';
3
+ export var DataFormatIntlsContext = /*#__PURE__*/createContext({
4
+ timeFormatIntl: DEFAULT_DATA_FORMAT_INTL,
5
+ numberFormatIntl: DEFAULT_DATA_FORMAT_INTL,
6
+ dateFormatIntl: DEFAULT_DATA_FORMAT_INTL
7
+ });
@@ -0,0 +1,2 @@
1
+ export { DataFormatConfigContext } from './DataFormatConfigContext';
2
+ export { DataFormatIntlsContext } from './DataFormatIntlsContext';
@@ -0,0 +1,2 @@
1
+ export { DataFormatConfigContext } from './DataFormatConfigContext';
2
+ export { DataFormatIntlsContext } from './DataFormatIntlsContext';
@@ -0,0 +1,4 @@
1
+ import { type ComponentType } from 'react';
2
+ import { type UseDataFormatProps } from '../hooks';
3
+ export type WithDataFormatProps = UseDataFormatProps;
4
+ export declare const withDataFormat: <Props extends object>(WrappedComponent: ComponentType<Props>) => ComponentType<Omit<Props, keyof UseDataFormatProps>>;
@@ -0,0 +1,10 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React from 'react';
3
+ import { useDataFormat } from '../hooks';
4
+ export var withDataFormat = function withDataFormat(WrappedComponent) {
5
+ return function (props) {
6
+ var dataFormatProps = useDataFormat();
7
+ var newProps = _extends({}, props, dataFormatProps);
8
+ return /*#__PURE__*/React.createElement(WrappedComponent, newProps);
9
+ };
10
+ };
@@ -0,0 +1,5 @@
1
+ export { useDataFormatConfig } from './useDataFormatConfig';
2
+ export { useDataFormat, type UseDataFormatProps } from './useDataFormat';
3
+ export { useDataFormatUtils } from './useDataFormatUtils';
4
+ export { useSingleIntl } from './useSingleIntl';
5
+ export { useDataFormatIntls } from './useDataFormatIntls';
@@ -0,0 +1,5 @@
1
+ export { useDataFormatConfig } from './useDataFormatConfig';
2
+ export { useDataFormat } from './useDataFormat';
3
+ export { useDataFormatUtils } from './useDataFormatUtils';
4
+ export { useSingleIntl } from './useSingleIntl';
5
+ export { useDataFormatIntls } from './useDataFormatIntls';
@@ -0,0 +1,12 @@
1
+ import { type Delimiter, type OverloadFormatMultipleValues, type OverloadFormatValue, type OverloadGetConstants } from '../types';
2
+ export type UseDataFormatProps = {
3
+ firstDayOfWeek: number;
4
+ isSundayFirstWeekDay: boolean;
5
+ is12HoursClock: boolean;
6
+ formatValue: OverloadFormatValue;
7
+ formatMultipleValues: OverloadFormatMultipleValues;
8
+ getConstants: OverloadGetConstants;
9
+ thousandDelimiter: Delimiter;
10
+ decimalDelimiter: Delimiter;
11
+ };
12
+ export declare const useDataFormat: () => UseDataFormatProps;
@@ -0,0 +1,96 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import { isDayjs } from 'dayjs';
3
+ import moment from 'moment';
4
+ import { useCallback, useMemo } from 'react';
5
+ import { DATE_CONSTANTS_TARGET_FORMATS } from '../constants';
6
+ import { getConstantDatesAndFormattingOptions } from '../utils';
7
+ import { isValidDate } from '../utils/date.utils';
8
+ import { useDataFormatConfig } from './useDataFormatConfig';
9
+ import { useDataFormatIntls } from './useDataFormatIntls';
10
+ import { useDataFormatUtils } from './useDataFormatUtils';
11
+ export var useDataFormat = function useDataFormat() {
12
+ var _useDataFormatIntls = useDataFormatIntls(),
13
+ numberFormatIntl = _useDataFormatIntls.numberFormatIntl,
14
+ timeFormatIntl = _useDataFormatIntls.timeFormatIntl,
15
+ dateFormatIntl = _useDataFormatIntls.dateFormatIntl;
16
+ var _useDataFormatConfig = useDataFormatConfig(),
17
+ startWeekDayNotation = _useDataFormatConfig.startWeekDayNotation,
18
+ timeFormatNotation = _useDataFormatConfig.timeFormatNotation,
19
+ numberFormatNotation = _useDataFormatConfig.numberFormatNotation;
20
+ var _useDataFormatUtils = useDataFormatUtils(),
21
+ getFirstDayOfWeekFromNotation = _useDataFormatUtils.getFirstDayOfWeekFromNotation,
22
+ getIs12HoursClockFromNotation = _useDataFormatUtils.getIs12HoursClockFromNotation,
23
+ getFormattedNumber = _useDataFormatUtils.getFormattedNumber,
24
+ getFormattedDate = _useDataFormatUtils.getFormattedDate,
25
+ getFormattedDateFromMoment = _useDataFormatUtils.getFormattedDateFromMoment,
26
+ getFormattedDateFromDayjs = _useDataFormatUtils.getFormattedDateFromDayjs,
27
+ getFormattedValueUsingCommonOptions = _useDataFormatUtils.getFormattedValueUsingCommonOptions,
28
+ getThousandDelimiterFromNotation = _useDataFormatUtils.getThousandDelimiterFromNotation,
29
+ getDecimalDelimiterFromNotation = _useDataFormatUtils.getDecimalDelimiterFromNotation;
30
+ var firstDayOfWeek = useMemo(function () {
31
+ return getFirstDayOfWeekFromNotation(startWeekDayNotation);
32
+ }, [startWeekDayNotation, getFirstDayOfWeekFromNotation]);
33
+ var isSundayFirstWeekDay = useMemo(function () {
34
+ return firstDayOfWeek === 0;
35
+ }, [firstDayOfWeek]);
36
+ var is12HoursClock = useMemo(function () {
37
+ return getIs12HoursClockFromNotation(timeFormatNotation);
38
+ }, [timeFormatNotation, getIs12HoursClockFromNotation]);
39
+ var formatValue = useCallback(
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ function (value, options) {
42
+ var result = '';
43
+ if (value instanceof moment) {
44
+ result = getFormattedDateFromMoment(value, dateFormatIntl, timeFormatIntl, options);
45
+ }
46
+ if (isDayjs(value)) {
47
+ result = getFormattedDateFromDayjs(value, dateFormatIntl, timeFormatIntl, options);
48
+ }
49
+ if (value instanceof Date) {
50
+ if (!isValidDate(value)) {
51
+ console.warn('invalid date', value);
52
+ return value.toString();
53
+ }
54
+ result = getFormattedDate(value, dateFormatIntl, timeFormatIntl, options);
55
+ }
56
+ if (typeof value === 'number') {
57
+ result = getFormattedNumber(value, numberFormatIntl, options);
58
+ }
59
+ if (typeof value === 'string') {
60
+ result = value;
61
+ }
62
+ return getFormattedValueUsingCommonOptions(result, options);
63
+ }, [numberFormatIntl, dateFormatIntl, timeFormatIntl, getFormattedDate, getFormattedDateFromMoment, getFormattedNumber, getFormattedDateFromDayjs, getFormattedValueUsingCommonOptions]);
64
+ var formatMultipleValues = useCallback(
65
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
+ function (values, options) {
67
+ return values.map(function (value) {
68
+ return formatValue(value, options);
69
+ });
70
+ }, [formatValue]);
71
+ var getConstants = useCallback(function (targetFormat, options, customStartDate, customEndDate, interval) {
72
+ if (DATE_CONSTANTS_TARGET_FORMATS.includes(targetFormat)) {
73
+ var _getConstantDatesAndF = getConstantDatesAndFormattingOptions(targetFormat, isSundayFirstWeekDay, customStartDate, customEndDate, interval),
74
+ constantDates = _getConstantDatesAndF.constantDates,
75
+ defaultOptions = _getConstantDatesAndF.defaultOptions;
76
+ return formatMultipleValues(constantDates, _extends({}, defaultOptions, options));
77
+ }
78
+ return undefined;
79
+ }, [formatMultipleValues, isSundayFirstWeekDay]);
80
+ var thousandDelimiter = useMemo(function () {
81
+ return getThousandDelimiterFromNotation(numberFormatNotation);
82
+ }, [numberFormatNotation, getThousandDelimiterFromNotation]);
83
+ var decimalDelimiter = useMemo(function () {
84
+ return getDecimalDelimiterFromNotation(numberFormatNotation);
85
+ }, [numberFormatNotation, getDecimalDelimiterFromNotation]);
86
+ return {
87
+ firstDayOfWeek: firstDayOfWeek,
88
+ isSundayFirstWeekDay: isSundayFirstWeekDay,
89
+ is12HoursClock: is12HoursClock,
90
+ formatValue: formatValue,
91
+ formatMultipleValues: formatMultipleValues,
92
+ getConstants: getConstants,
93
+ thousandDelimiter: thousandDelimiter,
94
+ decimalDelimiter: decimalDelimiter
95
+ };
96
+ };
@@ -0,0 +1,2 @@
1
+ import { type DataFormatConfig } from '../types';
2
+ export declare const useDataFormatConfig: () => DataFormatConfig;
@@ -0,0 +1,5 @@
1
+ import { useContext } from 'react';
2
+ import { DataFormatConfigContext } from '../contexts';
3
+ export var useDataFormatConfig = function useDataFormatConfig() {
4
+ return useContext(DataFormatConfigContext);
5
+ };
@@ -0,0 +1,2 @@
1
+ import { type DataFormatIntls } from '../types';
2
+ export declare const useDataFormatIntls: () => DataFormatIntls;
@@ -0,0 +1,5 @@
1
+ import { useContext } from 'react';
2
+ import { DataFormatIntlsContext } from '../contexts';
3
+ export var useDataFormatIntls = function useDataFormatIntls() {
4
+ return useContext(DataFormatIntlsContext);
5
+ };
@@ -0,0 +1,16 @@
1
+ import { type Dayjs } from 'dayjs';
2
+ import { type Moment } from 'moment';
3
+ import { type IntlShape } from 'react-intl';
4
+ import { type CommonFormatOptions, type DataFormatNotationType, type DateToFormatOptions, type Delimiter, type NumberToFormatOptions } from '../types';
5
+ export declare const useDataFormatUtils: () => {
6
+ getLocaleFromNotation: (notation?: DataFormatNotationType) => string;
7
+ getFirstDayOfWeekFromNotation: (notation?: DataFormatNotationType) => number;
8
+ getIs12HoursClockFromNotation: (notation?: DataFormatNotationType) => boolean;
9
+ getFormattedNumber: (value: number, numberFormatIntl: IntlShape, options?: NumberToFormatOptions) => string;
10
+ getFormattedDate: (value: Date, dateFormatIntl: IntlShape, timeFormatIntl: IntlShape, options?: DateToFormatOptions) => string;
11
+ getFormattedDateFromMoment: (value: Moment, dateFormatIntl: IntlShape, timeFormatIntl: IntlShape, options?: DateToFormatOptions) => string;
12
+ getFormattedDateFromDayjs: (value: Dayjs, dateFormatIntl: IntlShape, timeFormatIntl: IntlShape, options?: DateToFormatOptions) => string;
13
+ getFormattedValueUsingCommonOptions: (value: string, options?: CommonFormatOptions) => string;
14
+ getThousandDelimiterFromNotation: (notation?: DataFormatNotationType) => Delimiter;
15
+ getDecimalDelimiterFromNotation: (notation?: DataFormatNotationType) => Delimiter;
16
+ };
@@ -0,0 +1,113 @@
1
+ import dayjs from 'dayjs';
2
+ import moment from 'moment';
3
+ import { useCallback } from 'react';
4
+ import { useIntl } from 'react-intl';
5
+ import { DATE, DATETIME, EU_DECIMAL_DELIMITER, EU_NOTATION, EU_THOUSAND_DELIMITER, MONTH_LONG, MONTH_SHORT, RELATIVE_FROM, RELATIVE_FROM_WITHOUT_SUFFIX, RELATIVE_TO, RELATIVE_TO_WITHOUT_SUFFIX, TIME, US_DECIMAL_DELIMITER, US_NOTATION, US_THOUSAND_DELIMITER, WEEKDAY_LONG, WEEKDAY_SHORT } from '../constants';
6
+ import { addPrefix, addSuffix, changeNamingConvention, convertDateToDateString, convertDateToDateTimeString, convertDateToMonthLongString, convertDateToMonthShortString, convertDateToRelativeFromString, convertDateToRelativeToString, convertDateToTimeString, convertDateToWeekdayLongString, convertDateToWeekdayShortString, convertNumberString } from '../utils';
7
+ import { getLocalDateInTimeZone } from '../utils/timeZone.utils';
8
+ import { useDataFormatConfig } from './useDataFormatConfig';
9
+ export var useDataFormatUtils = function useDataFormatUtils() {
10
+ var languageIntl = useIntl();
11
+ var _useDataFormatConfig = useDataFormatConfig(),
12
+ numberFormatNotation = _useDataFormatConfig.numberFormatNotation,
13
+ applyTimeZoneOffset = _useDataFormatConfig.applyTimeZoneOffset;
14
+ var getLocaleFromNotation = useCallback(function (notation) {
15
+ switch (notation) {
16
+ case EU_NOTATION:
17
+ return 'pl';
18
+ case US_NOTATION:
19
+ return 'en-US';
20
+ default:
21
+ return 'pl';
22
+ }
23
+ }, []);
24
+ var getFirstDayOfWeekFromNotation = useCallback(function (notation) {
25
+ switch (notation) {
26
+ case EU_NOTATION:
27
+ return 1;
28
+ case US_NOTATION:
29
+ return 0;
30
+ default:
31
+ return 1;
32
+ }
33
+ }, []);
34
+ var getThousandDelimiterFromNotation = useCallback(function (notation) {
35
+ return notation === US_NOTATION ? US_THOUSAND_DELIMITER : EU_THOUSAND_DELIMITER;
36
+ }, []);
37
+ var getDecimalDelimiterFromNotation = useCallback(function (notation) {
38
+ return notation === US_NOTATION ? US_DECIMAL_DELIMITER : EU_DECIMAL_DELIMITER;
39
+ }, []);
40
+ var getIs12HoursClockFromNotation = useCallback(function (notation) {
41
+ return notation === US_NOTATION;
42
+ }, []);
43
+ var getFormattedNumber = useCallback(function (value, numberFormatIntl, options) {
44
+ var thousandDelimiter = getThousandDelimiterFromNotation(numberFormatNotation);
45
+ var decimalDelimiter = getDecimalDelimiterFromNotation(numberFormatNotation);
46
+ return convertNumberString(value, numberFormatIntl, languageIntl, thousandDelimiter, decimalDelimiter, options);
47
+ }, [languageIntl, numberFormatNotation, getThousandDelimiterFromNotation, getDecimalDelimiterFromNotation]);
48
+ var _useIntl = useIntl(),
49
+ globalTimeZone = _useIntl.timeZone;
50
+ var getFormattedDate = useCallback(function (value, dateFormatIntl, timeFormatIntl, options) {
51
+ var _value$toString;
52
+ var valueInTimezone = globalTimeZone && applyTimeZoneOffset ? getLocalDateInTimeZone(value.toISOString(), globalTimeZone) : value;
53
+ if ((options == null ? void 0 : options.targetFormat) === DATETIME) {
54
+ return convertDateToDateTimeString(valueInTimezone, dateFormatIntl, timeFormatIntl, languageIntl, options);
55
+ }
56
+ if ((options == null ? void 0 : options.targetFormat) === TIME) {
57
+ return convertDateToTimeString(valueInTimezone, timeFormatIntl, options);
58
+ }
59
+ if ((options == null ? void 0 : options.targetFormat) === RELATIVE_TO) {
60
+ return convertDateToRelativeToString(value);
61
+ }
62
+ if ((options == null ? void 0 : options.targetFormat) === RELATIVE_TO_WITHOUT_SUFFIX) {
63
+ return convertDateToRelativeToString(value, true);
64
+ }
65
+ if ((options == null ? void 0 : options.targetFormat) === RELATIVE_FROM) {
66
+ return convertDateToRelativeFromString(value);
67
+ }
68
+ if ((options == null ? void 0 : options.targetFormat) === RELATIVE_FROM_WITHOUT_SUFFIX) {
69
+ return convertDateToRelativeFromString(value, true);
70
+ }
71
+ if ((options == null ? void 0 : options.targetFormat) === WEEKDAY_LONG) {
72
+ return convertDateToWeekdayLongString(valueInTimezone, dateFormatIntl, languageIntl, options);
73
+ }
74
+ if ((options == null ? void 0 : options.targetFormat) === WEEKDAY_SHORT) {
75
+ return convertDateToWeekdayShortString(valueInTimezone, dateFormatIntl, languageIntl, options);
76
+ }
77
+ if ((options == null ? void 0 : options.targetFormat) === MONTH_LONG) {
78
+ return convertDateToMonthLongString(valueInTimezone, dateFormatIntl, languageIntl, options);
79
+ }
80
+ if ((options == null ? void 0 : options.targetFormat) === MONTH_SHORT) {
81
+ return convertDateToMonthShortString(valueInTimezone, dateFormatIntl, languageIntl, options);
82
+ }
83
+ if ((options == null ? void 0 : options.targetFormat) === DATE || !(options != null && options.targetFormat)) {
84
+ return convertDateToDateString(valueInTimezone, dateFormatIntl, languageIntl, options);
85
+ }
86
+ return (_value$toString = value == null ? void 0 : value.toString()) != null ? _value$toString : '';
87
+ }, [globalTimeZone, applyTimeZoneOffset, languageIntl]);
88
+ var getFormattedDateFromMoment = useCallback(function (value, dateFormatIntl, timeFormatIntl, options) {
89
+ return getFormattedDate(moment(value).toDate(), dateFormatIntl, timeFormatIntl, options);
90
+ }, [getFormattedDate]);
91
+ var getFormattedDateFromDayjs = useCallback(function (value, dateFormatIntl, timeFormatIntl, options) {
92
+ return getFormattedDate(dayjs(value).toDate(), dateFormatIntl, timeFormatIntl, options);
93
+ }, [getFormattedDate]);
94
+ var getFormattedValueUsingCommonOptions = useCallback(function (value, options) {
95
+ var result = value;
96
+ result = addPrefix(result, options);
97
+ result = addSuffix(result, options);
98
+ result = changeNamingConvention(result, options);
99
+ return result;
100
+ }, []);
101
+ return {
102
+ getLocaleFromNotation: getLocaleFromNotation,
103
+ getFirstDayOfWeekFromNotation: getFirstDayOfWeekFromNotation,
104
+ getIs12HoursClockFromNotation: getIs12HoursClockFromNotation,
105
+ getFormattedNumber: getFormattedNumber,
106
+ getFormattedDate: getFormattedDate,
107
+ getFormattedDateFromMoment: getFormattedDateFromMoment,
108
+ getFormattedDateFromDayjs: getFormattedDateFromDayjs,
109
+ getFormattedValueUsingCommonOptions: getFormattedValueUsingCommonOptions,
110
+ getThousandDelimiterFromNotation: getThousandDelimiterFromNotation,
111
+ getDecimalDelimiterFromNotation: getDecimalDelimiterFromNotation
112
+ };
113
+ };
@@ -0,0 +1,4 @@
1
+ import { type IntlShape } from 'react-intl';
2
+ export declare const useSingleIntl: (locale: string) => {
3
+ intl: IntlShape;
4
+ };
@@ -0,0 +1,12 @@
1
+ import { createIntl, createIntlCache, useIntl } from 'react-intl';
2
+ export var useSingleIntl = function useSingleIntl(locale) {
3
+ var cache = createIntlCache();
4
+ var globalIntl = useIntl();
5
+ var intl = createIntl({
6
+ locale: locale,
7
+ timeZone: globalIntl.timeZone
8
+ }, cache);
9
+ return {
10
+ intl: intl
11
+ };
12
+ };
@@ -0,0 +1,8 @@
1
+ export { DataFormatConfigProvider, type DataFormatConfigProviderProps, } from './providers/DataFormatConfigProvider';
2
+ export { FormattedDate, FormattedDateTime, FormattedNumber, FormattedTime, FormattedRelativeDateTimeFrom, FormattedRelativeDateTimeTo, } from './components';
3
+ export { useDataFormat, useDataFormatUtils, useDataFormatConfig, useDataFormatIntls, type UseDataFormatProps, } from './hooks';
4
+ export { withDataFormat, type WithDataFormatProps, } from './hocs/withDataFormat';
5
+ export { getDataFormatConfigFromNotation, getDefaultDataTimeOptions, } from './utils';
6
+ export * from './constants';
7
+ export { DataFormatConfigContext, DataFormatIntlsContext } from './contexts';
8
+ export type { DataFormatNotationType, NumberToFormatOptions, DateToFormatOptions, DataFormatConfig, Delimiter, DateTargetFormat, NumberTargetFormat, NamingConvention, DateToFormat, OverloadFormatValue, OverloadFormatMultipleValues, CommonFormatOptions, DateConstantsTargetFormat, OverloadGetConstants, DateTimePartFormat, DataFormatIntls, } from './types';
@@ -0,0 +1,7 @@
1
+ export { DataFormatConfigProvider } from './providers/DataFormatConfigProvider';
2
+ export { FormattedDate, FormattedDateTime, FormattedNumber, FormattedTime, FormattedRelativeDateTimeFrom, FormattedRelativeDateTimeTo } from './components';
3
+ export { useDataFormat, useDataFormatUtils, useDataFormatConfig, useDataFormatIntls } from './hooks';
4
+ export { withDataFormat } from './hocs/withDataFormat';
5
+ export { getDataFormatConfigFromNotation, getDefaultDataTimeOptions } from './utils';
6
+ export * from './constants';
7
+ export { DataFormatConfigContext, DataFormatIntlsContext } from './contexts';
@@ -0,0 +1,7 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { type DataFormatConfig } from '../types';
3
+ export type DataFormatConfigProviderProps = {
4
+ dataFormatConfig?: DataFormatConfig;
5
+ children?: ReactNode;
6
+ };
7
+ export declare const DataFormatConfigProvider: ({ dataFormatConfig: dataFormatConfigFromProps, children, }: DataFormatConfigProviderProps) => React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { DEFAULT_DATA_FORMAT_CONFIG } from '../constants';
3
+ import { DataFormatConfigContext, DataFormatIntlsContext } from '../contexts';
4
+ import { useDataFormatUtils, useSingleIntl } from '../hooks';
5
+ export var DataFormatConfigProvider = function DataFormatConfigProvider(_ref) {
6
+ var dataFormatConfigFromProps = _ref.dataFormatConfig,
7
+ children = _ref.children;
8
+ var dataFormatConfig = dataFormatConfigFromProps != null ? dataFormatConfigFromProps : DEFAULT_DATA_FORMAT_CONFIG;
9
+ var _useDataFormatUtils = useDataFormatUtils(),
10
+ getLocaleFromNotation = _useDataFormatUtils.getLocaleFromNotation;
11
+ var _useSingleIntl = useSingleIntl(getLocaleFromNotation(dataFormatConfig == null ? void 0 : dataFormatConfig.numberFormatNotation)),
12
+ numberFormatIntl = _useSingleIntl.intl;
13
+ var _useSingleIntl2 = useSingleIntl(getLocaleFromNotation(dataFormatConfig == null ? void 0 : dataFormatConfig.dateFormatNotation)),
14
+ dateFormatIntl = _useSingleIntl2.intl;
15
+ var _useSingleIntl3 = useSingleIntl(getLocaleFromNotation(dataFormatConfig == null ? void 0 : dataFormatConfig.timeFormatNotation)),
16
+ timeFormatIntl = _useSingleIntl3.intl;
17
+ return /*#__PURE__*/React.createElement(DataFormatIntlsContext.Provider, {
18
+ value: {
19
+ numberFormatIntl: numberFormatIntl,
20
+ dateFormatIntl: dateFormatIntl,
21
+ timeFormatIntl: timeFormatIntl
22
+ }
23
+ }, /*#__PURE__*/React.createElement(DataFormatConfigContext.Provider, {
24
+ value: dataFormatConfig
25
+ }, children));
26
+ };
@@ -0,0 +1,42 @@
1
+ import { type Dayjs, type default as dayjs } from 'dayjs';
2
+ import { type Moment } from 'moment';
3
+ import { type FormatDateOptions, type FormatNumberOptions, type FormatPluralOptions } from 'react-intl';
4
+ declare const _DATE_TARGET_FORMATS: readonly ["date", "datetime", "relative-from", "relative-to", "relative-from-without-suffix", "relative-to-without-suffix", "time", "weekday-long", "weekday-short", "month-long", "month-short"];
5
+ export type DateTargetFormat = (typeof _DATE_TARGET_FORMATS)[number];
6
+ declare const _NUMBER_TARGET_FORMATS: readonly ["compact-larger-number", "compact-decimal-larger-number"];
7
+ export type NumberTargetFormat = (typeof _NUMBER_TARGET_FORMATS)[number];
8
+ declare const _NAMING_CONVENTIONS: readonly ["upperCase", "upperFirst", "lowerCase", "lowerFirst"];
9
+ export type NamingConvention = (typeof _NAMING_CONVENTIONS)[number];
10
+ export type DateConstantsTargetFormat = 'months-long' | 'months-short' | 'weekdays-long' | 'weekdays-short';
11
+ export type DateToFormat = Date | Moment | Dayjs;
12
+ export type CommonFormatOptions = {
13
+ prefix?: string;
14
+ suffix?: string;
15
+ namingConvention?: NamingConvention;
16
+ };
17
+ export type NumberToFormatOptions = FormatNumberOptions & CommonFormatOptions & {
18
+ pluralOptions?: FormatPluralOptions;
19
+ targetFormat?: NumberTargetFormat;
20
+ };
21
+ export type DateToFormatOptions = FormatDateOptions & CommonFormatOptions & {
22
+ dateOptions?: FormatDateOptions;
23
+ timeOptions?: FormatDateOptions;
24
+ targetFormat?: DateTargetFormat;
25
+ applyTimeZoneOffset?: boolean;
26
+ };
27
+ export type OverloadFormatValue = {
28
+ (value: number, options?: NumberToFormatOptions): string;
29
+ (value: Date | Moment | Dayjs, options?: DateToFormatOptions): string;
30
+ (value: string, options?: CommonFormatOptions): string;
31
+ };
32
+ export type OverloadFormatMultipleValues = {
33
+ (values: number[], options?: NumberToFormatOptions): string[];
34
+ (values: Date[] | Moment[] | Dayjs[], options?: DateToFormatOptions): string[];
35
+ (values: string[], options?: CommonFormatOptions): string[];
36
+ };
37
+ export type OverloadGetConstants = {
38
+ (targetFormat: DateConstantsTargetFormat, options?: DateToFormatOptions, customStartDate?: Date, customEndDate?: Date, customInterval?: dayjs.UnitType): string[] | undefined;
39
+ };
40
+ declare const _DELIMITERS: readonly [",", ".", " "];
41
+ export type Delimiter = (typeof _DELIMITERS)[number];
42
+ export {};
@@ -0,0 +1,5 @@
1
+ var _DATE_TARGET_FORMATS = ['date', 'datetime', 'relative-from', 'relative-to', 'relative-from-without-suffix', 'relative-to-without-suffix', 'time', 'weekday-long', 'weekday-short', 'month-long', 'month-short'];
2
+ var _NUMBER_TARGET_FORMATS = ['compact-larger-number', 'compact-decimal-larger-number'];
3
+ var _NAMING_CONVENTIONS = ['upperCase', 'upperFirst', 'lowerCase', 'lowerFirst'];
4
+ var _DELIMITERS = [',', '.', ' '];
5
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type IntlShape } from 'react-intl';
2
+ declare const _DATA_FORMAT_NOTATION_TYPES: readonly ["US", "EU"];
3
+ export type DataFormatNotationType = (typeof _DATA_FORMAT_NOTATION_TYPES)[number];
4
+ export type DataFormatConfig = {
5
+ startWeekDayNotation?: DataFormatNotationType;
6
+ dateFormatNotation?: DataFormatNotationType;
7
+ timeFormatNotation?: DataFormatNotationType;
8
+ numberFormatNotation?: DataFormatNotationType;
9
+ applyTimeZoneOffset?: boolean;
10
+ };
11
+ export type DataFormatIntls = {
12
+ numberFormatIntl: IntlShape;
13
+ dateFormatIntl: IntlShape;
14
+ timeFormatIntl: IntlShape;
15
+ };
16
+ export {};
@@ -0,0 +1,2 @@
1
+ var _DATA_FORMAT_NOTATION_TYPES = ['US', 'EU'];
2
+ export {};
@@ -0,0 +1,3 @@
1
+ declare const _DATE_TIME_PART_FORMAT: readonly ["long", "short", "numeric"];
2
+ export type DateTimePartFormat = (typeof _DATE_TIME_PART_FORMAT)[number];
3
+ export {};
@@ -0,0 +1,2 @@
1
+ var _DATE_TIME_PART_FORMAT = ['long', 'short', 'numeric'];
2
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { NumberToFormatOptions, DateToFormatOptions, CommonFormatOptions, DateTargetFormat, NumberTargetFormat, NamingConvention, DateToFormat, OverloadFormatValue, OverloadFormatMultipleValues, OverloadGetConstants, Delimiter, DateConstantsTargetFormat, } from './dataFormat.types';
2
+ export type { DataFormatNotationType, DataFormatConfig, DataFormatIntls, } from './dataFormatConfig.types';
3
+ export type { DateTimePartFormat } from './dateTimeParts.types';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type IntlShape } from 'react-intl';
2
+ import { type CommonFormatOptions, type DateToFormatOptions, type Delimiter, type NumberToFormatOptions } from '../types';
3
+ export declare const convertNumberString: (value: number, numberFormatIntl: IntlShape, languageIntl: IntlShape, thousandDelimiter: Delimiter, decimalDelimiter: Delimiter, numberOptions?: NumberToFormatOptions) => string;
4
+ export declare const convertDateToDateTimeString: (value: Date, dateFormatIntl: IntlShape, timeFormatIntl: IntlShape, languageIntl: IntlShape, options?: DateToFormatOptions) => string;
5
+ export declare const convertDateToRelativeToString: (value: Date, withoutSuffix?: boolean) => string;
6
+ export declare const convertDateToRelativeFromString: (value: Date, withoutSuffix?: boolean) => string;
7
+ export declare const convertDateToTimeString: (value: Date, timeFormatIntl: IntlShape, options?: DateToFormatOptions) => string;
8
+ export declare const convertDateToDateString: (value: Date, dateFormatIntl: IntlShape, languageIntl: IntlShape, options?: DateToFormatOptions) => string;
9
+ export declare const convertDateToWeekdayLongString: (value: Date, dateFormatIntl: IntlShape, languageIntl: IntlShape, options?: DateToFormatOptions) => string;
10
+ export declare const convertDateToWeekdayShortString: (value: Date, dateFormatIntl: IntlShape, languageIntl: IntlShape, options?: DateToFormatOptions) => string;
11
+ export declare const convertDateToMonthLongString: (value: Date, dateFormatIntl: IntlShape, languageIntl: IntlShape, options?: DateToFormatOptions) => string;
12
+ export declare const convertDateToMonthShortString: (value: Date, dateFormatIntl: IntlShape, languageIntl: IntlShape, options?: DateToFormatOptions) => string;
13
+ export declare const addPrefix: (value: string, options?: CommonFormatOptions) => string;
14
+ export declare const addSuffix: (value: string, options?: CommonFormatOptions) => string;
15
+ export declare const changeNamingConvention: (value: string, options?: CommonFormatOptions) => string;
16
+ export declare const getDefaultDataTimeOptions: (showTime?: boolean) => DateToFormatOptions;