@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.
- package/CHANGELOG.md +19 -0
- package/README.md +181 -0
- package/dist/i18n/en.json +11 -1
- package/dist/i18n/es.json +10 -1
- package/dist/i18n/index.d.ts +51 -1
- package/dist/i18n/pl.json +11 -1
- package/dist/i18n/pt.json +11 -1
- package/dist/js/DSProvider/DSProvider.d.ts +2 -2
- package/dist/js/DSProvider/DSProvider.js +2 -2
- package/dist/js/DSProvider/LocaleProvider/LocaleProvider.utils.d.ts +21 -1
- package/dist/js/DSProvider/ThemeProvider/breakpoints.d.ts +5 -1
- package/dist/js/data-format/components/FormattedDate.d.ts +9 -0
- package/dist/js/data-format/components/FormattedDate.js +9 -0
- package/dist/js/data-format/components/FormattedDateTime.d.ts +9 -0
- package/dist/js/data-format/components/FormattedDateTime.js +13 -0
- package/dist/js/data-format/components/FormattedNumber.d.ts +7 -0
- package/dist/js/data-format/components/FormattedNumber.js +9 -0
- package/dist/js/data-format/components/FormattedRelativeDateTime.d.ts +10 -0
- package/dist/js/data-format/components/FormattedRelativeDateTime.js +24 -0
- package/dist/js/data-format/components/FormattedTime.d.ts +9 -0
- package/dist/js/data-format/components/FormattedTime.js +13 -0
- package/dist/js/data-format/components/index.d.ts +5 -0
- package/dist/js/data-format/components/index.js +5 -0
- package/dist/js/data-format/constants/dataFormat.constants.d.ts +36 -0
- package/dist/js/data-format/constants/dataFormat.constants.js +52 -0
- package/dist/js/data-format/constants/dataFormatConfig.constants.d.ts +7 -0
- package/dist/js/data-format/constants/dataFormatConfig.constants.js +14 -0
- package/dist/js/data-format/constants/dateTimeParts.constants.d.ts +5 -0
- package/dist/js/data-format/constants/dateTimeParts.constants.js +4 -0
- package/dist/js/data-format/constants/index.d.ts +3 -0
- package/dist/js/data-format/constants/index.js +3 -0
- package/dist/js/data-format/contexts/DataFormatConfigContext.d.ts +2 -0
- package/dist/js/data-format/contexts/DataFormatConfigContext.js +3 -0
- package/dist/js/data-format/contexts/DataFormatIntlsContext.d.ts +2 -0
- package/dist/js/data-format/contexts/DataFormatIntlsContext.js +7 -0
- package/dist/js/data-format/contexts/index.d.ts +2 -0
- package/dist/js/data-format/contexts/index.js +2 -0
- package/dist/js/data-format/hocs/withDataFormat.d.ts +4 -0
- package/dist/js/data-format/hocs/withDataFormat.js +10 -0
- package/dist/js/data-format/hooks/index.d.ts +5 -0
- package/dist/js/data-format/hooks/index.js +5 -0
- package/dist/js/data-format/hooks/useDataFormat.d.ts +12 -0
- package/dist/js/data-format/hooks/useDataFormat.js +96 -0
- package/dist/js/data-format/hooks/useDataFormatConfig.d.ts +2 -0
- package/dist/js/data-format/hooks/useDataFormatConfig.js +5 -0
- package/dist/js/data-format/hooks/useDataFormatIntls.d.ts +2 -0
- package/dist/js/data-format/hooks/useDataFormatIntls.js +5 -0
- package/dist/js/data-format/hooks/useDataFormatUtils.d.ts +16 -0
- package/dist/js/data-format/hooks/useDataFormatUtils.js +113 -0
- package/dist/js/data-format/hooks/useSingleIntl.d.ts +4 -0
- package/dist/js/data-format/hooks/useSingleIntl.js +12 -0
- package/dist/js/data-format/index.d.ts +8 -0
- package/dist/js/data-format/index.js +7 -0
- package/dist/js/data-format/providers/DataFormatConfigProvider.d.ts +7 -0
- package/dist/js/data-format/providers/DataFormatConfigProvider.js +26 -0
- package/dist/js/data-format/types/dataFormat.types.d.ts +42 -0
- package/dist/js/data-format/types/dataFormat.types.js +5 -0
- package/dist/js/data-format/types/dataFormatConfig.types.d.ts +16 -0
- package/dist/js/data-format/types/dataFormatConfig.types.js +2 -0
- package/dist/js/data-format/types/dateTimeParts.types.d.ts +3 -0
- package/dist/js/data-format/types/dateTimeParts.types.js +2 -0
- package/dist/js/data-format/types/index.d.ts +3 -0
- package/dist/js/data-format/types/index.js +1 -0
- package/dist/js/data-format/utils/dataFormat.utils.d.ts +16 -0
- package/dist/js/data-format/utils/dataFormat.utils.js +119 -0
- package/dist/js/data-format/utils/dataFormatConfig.utils.d.ts +2 -0
- package/dist/js/data-format/utils/dataFormatConfig.utils.js +8 -0
- package/dist/js/data-format/utils/date.utils.d.ts +8 -0
- package/dist/js/data-format/utils/date.utils.js +50 -0
- package/dist/js/data-format/utils/dateTimeParts.utils.d.ts +14 -0
- package/dist/js/data-format/utils/dateTimeParts.utils.js +86 -0
- package/dist/js/data-format/utils/index.d.ts +5 -0
- package/dist/js/data-format/utils/index.js +5 -0
- package/dist/js/data-format/utils/timeZone.utils.d.ts +16 -0
- package/dist/js/data-format/utils/timeZone.utils.js +94 -0
- package/dist/js/index.d.ts +3 -0
- package/dist/js/index.js +4 -1
- package/dist/js/mediaQuery/mediaQuery.d.ts +1 -5
- package/dist/js/testing/index.d.ts +2 -0
- package/dist/js/testing/index.js +2 -0
- package/dist/js/testing/renderWithProvider/renderWithProvider.d.ts +10 -0
- package/dist/js/testing/renderWithProvider/renderWithProvider.js +28 -0
- package/dist/js/testing/renderWithProvider/renderWithProvider.spec.d.ts +1 -0
- package/dist/js/testing/sleep.d.ts +1 -0
- package/dist/js/testing/sleep.js +8 -0
- package/dist/js/toaster/Toaster.d.ts +2 -0
- package/dist/js/toaster/Toaster.js +8 -0
- package/dist/js/toaster/Toaster.types.d.ts +1 -0
- package/dist/js/toaster/Toaster.types.js +1 -0
- package/dist/js/toaster/constants.d.ts +2 -0
- package/dist/js/toaster/constants.js +8 -0
- package/dist/js/toaster/contexts/ToasterContext.d.ts +6 -0
- package/dist/js/toaster/contexts/ToasterContext.js +6 -0
- package/dist/js/toaster/hooks/useToaster.d.ts +1 -0
- package/dist/js/toaster/hooks/useToaster.js +5 -0
- package/dist/js/toaster/index.d.ts +6 -0
- package/dist/js/toaster/index.js +5 -0
- package/dist/js/toaster/providers/ToasterProvider.d.ts +6 -0
- package/dist/js/toaster/providers/ToasterProvider.js +17 -0
- package/package.json +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
# [1.6.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-core@1.5.2...@synerise/ds-core@1.6.0) (2025-09-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **table:** cell with tags list ([109820e](https://github.com/synerise/synerise-design/commit/109820ed06f931a178580633277a7643aebe1072))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.5.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-core@1.5.1...@synerise/ds-core@1.5.2) (2025-09-16)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-core
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.5.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-core@1.5.0...@synerise/ds-core@1.5.1) (2025-08-28)
|
|
7
26
|
|
|
8
27
|
|
package/README.md
CHANGED
|
@@ -26,3 +26,184 @@ Bunch of components to bootstrap application.
|
|
|
26
26
|
| defaultMessages | Object with fallback translations | object | |
|
|
27
27
|
| dataFormatConfig | Object with data (dates/numbers) notations | DataFormatConfig | EU notation |
|
|
28
28
|
| includeToaster | Opt out of rendering a Toaster component for rendering toasts (messages) | boolean | true |
|
|
29
|
+
|
|
30
|
+
# Data formatting
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
### For function components:
|
|
35
|
+
|
|
36
|
+
```tsx harmony
|
|
37
|
+
import React, { FC } from 'react';
|
|
38
|
+
|
|
39
|
+
import {
|
|
40
|
+
FormattedDate,
|
|
41
|
+
FormattedDateTime,
|
|
42
|
+
FormattedNumber,
|
|
43
|
+
FormattedTime,
|
|
44
|
+
useDataFormat,
|
|
45
|
+
} from '@synerise/ds-core';
|
|
46
|
+
|
|
47
|
+
const DATE = new Date('2023-06-25T15:40:00');
|
|
48
|
+
const DATE_TO_FORMAT = DATE; // moment(DATE) // dayjs(DATE)
|
|
49
|
+
|
|
50
|
+
export const FunctionComponent: FC = (): JSX.Element => {
|
|
51
|
+
const {
|
|
52
|
+
firstDayOfWeek,
|
|
53
|
+
isSundayFirstWeekDay,
|
|
54
|
+
is12HoursClock,
|
|
55
|
+
formatValue,
|
|
56
|
+
formatMultipleValues,
|
|
57
|
+
getConstants,
|
|
58
|
+
thousandDelimiter,
|
|
59
|
+
decimalDelimiter,
|
|
60
|
+
} = useDataFormat();
|
|
61
|
+
|
|
62
|
+
firstDayOfWeek; // Sunday = 0 // Monday = 1
|
|
63
|
+
isSundayFirstWeekDay; // true // false
|
|
64
|
+
is12HoursClock; // true // false
|
|
65
|
+
|
|
66
|
+
formatValue(1234567);
|
|
67
|
+
formatValue(DATE_TO_FORMAT);
|
|
68
|
+
formatValue(DATE_TO_FORMAT, { targetFormat: 'date' });
|
|
69
|
+
formatValue(DATE_TO_FORMAT, { targetFormat: 'time' });
|
|
70
|
+
formatValue(DATE_TO_FORMAT, { targetFormat: 'datetime' });
|
|
71
|
+
|
|
72
|
+
formatMultipleValues([1234567, 1234567]);
|
|
73
|
+
formatMultipleValues([DATE_TO_FORMAT, DATE_TO_FORMAT], {
|
|
74
|
+
targetFormat: 'datetime',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
getConstants('months-long');
|
|
78
|
+
getConstants('months-short');
|
|
79
|
+
getConstants('weekdays-long');
|
|
80
|
+
getConstants('weekdays-short');
|
|
81
|
+
getConstants(
|
|
82
|
+
'months-long',
|
|
83
|
+
{ namingConvention: 'lowerCase' },
|
|
84
|
+
new Date(2022, 10),
|
|
85
|
+
new Date(2023, 2),
|
|
86
|
+
'month',
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
thousandDelimiter; // "," // " "
|
|
90
|
+
decimalDelimiter; // "." // ","
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
<FormattedNumber value={1234567} options={{ unit: 'percent' }} />
|
|
95
|
+
<FormattedDate value={DATE_TO_FORMAT} options={{ month: 'long' }} />
|
|
96
|
+
<FormattedTime value={DATE_TO_FORMAT} options={{ second: 'numeric' }} />
|
|
97
|
+
<FormattedDateTime
|
|
98
|
+
value={DATE_TO_FORMAT}
|
|
99
|
+
options={{
|
|
100
|
+
dateOptions: { month: 'long' },
|
|
101
|
+
timeOptions: { second: 'numeric' },
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
For class components:
|
|
110
|
+
|
|
111
|
+
```tsx harmony
|
|
112
|
+
import React, { Component, FC } from 'react';
|
|
113
|
+
import { withDataFormat, WithDataFormatProps } from '@synerise/ds-core';
|
|
114
|
+
|
|
115
|
+
type ClassComponentProps = {
|
|
116
|
+
...
|
|
117
|
+
} & WithDataFormatProps;
|
|
118
|
+
|
|
119
|
+
class ClassComponent extends Component<ClassComponentProps> {
|
|
120
|
+
constructor(props: ClassComponentProps) {
|
|
121
|
+
super(props);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
render() {
|
|
125
|
+
const {
|
|
126
|
+
firstDayOfWeek,
|
|
127
|
+
isSundayFirstWeekDay,
|
|
128
|
+
is12HoursClock,
|
|
129
|
+
formatValue,
|
|
130
|
+
formatMultipleValues,
|
|
131
|
+
getConstants,
|
|
132
|
+
thousandDelimiter,
|
|
133
|
+
decimalDelimiter,
|
|
134
|
+
} = this.props;
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<>
|
|
138
|
+
<div>{formatValue(1234567)}</div>
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export default withDataFormat(ClassComponent) as FC<ClassComponentProps>;
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Examples
|
|
148
|
+
|
|
149
|
+
### Number
|
|
150
|
+
|
|
151
|
+
The `options` object is compatible with https://formatjs.io/docs/react-intl/api#formatnumber
|
|
152
|
+
|
|
153
|
+
| Code | EU Notation | US Notation |
|
|
154
|
+
| ---------------------------------------------------------------------------------------------------------- | ------------------------------- | ------------------------------- |
|
|
155
|
+
| formatValue(1234567) | 1 234 567 | 1,234,567 |
|
|
156
|
+
| formatValue(1234567.89) | 1 234 567,89 | 1,234,567.89 |
|
|
157
|
+
| formatValue(1234567, { minimumFractionDigits: 2 }) | 1 234 567,00 | 1,234,567.00 |
|
|
158
|
+
| formatValue(1234567.89, { maximumFractionDigits: 1 }) | 1 234 567,9 | 1,234,567.9 |
|
|
159
|
+
| formatValue(1234567.89, { style: 'currency', currency: 'USD', prefix: 'Salary: ', suffix: ' per month' })) | Salary: $1 234 567,89 per month | Salary: $1,234,567.89 per month |
|
|
160
|
+
| formatValue(1234, { notation: 'compact' })) | 1,2K (with PL locale: 1,2 tys.) | 1.2K (with PL locale: 1.2 tys.) |
|
|
161
|
+
| formatValue(1, { pluralOptions: { type: 'ordinal' } })) | one | one |
|
|
162
|
+
|
|
163
|
+
### Date
|
|
164
|
+
|
|
165
|
+
The `options` object is compatible with https://formatjs.io/docs/react-intl/api#formatdate
|
|
166
|
+
|
|
167
|
+
| Code | EU Notation | US Notation |
|
|
168
|
+
| ---------------------------------------------------- | ------------ | ------------- |
|
|
169
|
+
| formatValue(date) | 25.06.2023 | 6/25/2023 |
|
|
170
|
+
| formatValue(date, { month: 'long' }) | 25 June 2023 | June 25, 2023 |
|
|
171
|
+
| formatValue(date, { targetFormat: 'weekday-long' }) | Sunday | Sunday |
|
|
172
|
+
| formatValue(date, { targetFormat: 'weekday-short' }) | Sun | Sun |
|
|
173
|
+
| formatValue(date, { targetFormat: 'month-long' }) | June | June |
|
|
174
|
+
| formatValue(date, { targetFormat: 'month-short' }) | Jun | Jun |
|
|
175
|
+
|
|
176
|
+
### Time
|
|
177
|
+
|
|
178
|
+
The `options` object is compatible with https://formatjs.io/docs/react-intl/api#formatdate
|
|
179
|
+
|
|
180
|
+
| Code | EU Notation | US Notation |
|
|
181
|
+
| -------------------------------------------------------------- | ----------- | ----------- |
|
|
182
|
+
| formatValue(date, { targetFormat: 'time' }) | 15:40 | 3:40 PM |
|
|
183
|
+
| formatValue(date, { targetFormat: 'time', second: 'numeric' }) | 15:40:00 | 3:40:00 PM |
|
|
184
|
+
|
|
185
|
+
### DateTime
|
|
186
|
+
|
|
187
|
+
The `dateOptions` object and the `timeOptions` object are compatible with https://formatjs.io/docs/react-intl/api#formatdate
|
|
188
|
+
|
|
189
|
+
| Code | EU Notation | US Notation |
|
|
190
|
+
| ------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------- |
|
|
191
|
+
| formatValue(date, { targetFormat: 'datetime' }) | 25.06.2023, 15:40 | 6/25/2023, 3:40 PM |
|
|
192
|
+
| formatValue(date, { targetFormat: 'datetime', dateOptions: { month: 'long' }, timeOptions: { second: 'numeric' } }) | 25 June 2023, 3:40:00 PM | June 25, 2023, 3:40:00 PM |
|
|
193
|
+
|
|
194
|
+
### formatMultipleValues
|
|
195
|
+
|
|
196
|
+
| Code | EU Notation | US Notation |
|
|
197
|
+
| ---------------------------------------------------------------------- | -------------------------------- | -------------------------------- |
|
|
198
|
+
| formatMultipleValues([1234567, 1234567], { minimumFractionDigits: 2 }) | ['1 234 567,00', '1 234 567,00'] | ['1,234,567.00', '1,234,567.00'] |
|
|
199
|
+
| formatMultipleValues([date, date], { targetFormat: 'month-long' }) | ['June', 'June'] | ['June', 'June'] |
|
|
200
|
+
|
|
201
|
+
### getConstants
|
|
202
|
+
|
|
203
|
+
| Code | EU Notation | US Notation |
|
|
204
|
+
| ------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------ |
|
|
205
|
+
| getConstants('months-long') | ['January', '...', 'December'] | ['January', '...', 'December'] |
|
|
206
|
+
| getConstants('months-short') | ['Jan', '...', 'Dec'] | ['Jan', '...', 'Dec'] |
|
|
207
|
+
| getConstants('weekdays-long') | ['Monday', '...', 'Sunday'] | ['Sunday', '...', 'Saturday'] |
|
|
208
|
+
| getConstants('weekdays-short') | ['Mon', '...', 'Sun'] | ['Sun', '...', 'Sat'] |
|
|
209
|
+
| getConstants('months-long', { namingConvention: 'lowerCase' }, startDate, endDate, 'month') | ['november', '...', 'march'] | ['november', '...', 'march'] |
|
package/dist/i18n/en.json
CHANGED
|
@@ -469,6 +469,16 @@
|
|
|
469
469
|
},
|
|
470
470
|
"PLACEHOLDER": {
|
|
471
471
|
"CHOOSE-CONDITION": "Choose type of condition below"
|
|
472
|
+
},
|
|
473
|
+
"TAG": {
|
|
474
|
+
"SEARCH-PLACEHOLDER": "Search",
|
|
475
|
+
"ADD-BUTTON-LABEL": "Add tag",
|
|
476
|
+
"MANAGE-LINK-LABEL": "Manage tags",
|
|
477
|
+
"CREATE-TAG-LABEL": "Create tag",
|
|
478
|
+
"NO-TAGS": "No data",
|
|
479
|
+
"CLEAR-TOOLTIP": "Clear",
|
|
480
|
+
"DELETE-TOOLTIP": "Delete",
|
|
481
|
+
"NO-SEARCH-RESULTS": "No tags found"
|
|
472
482
|
}
|
|
473
483
|
}
|
|
474
|
-
}
|
|
484
|
+
}
|
package/dist/i18n/es.json
CHANGED
|
@@ -176,7 +176,6 @@
|
|
|
176
176
|
"TITLE": "Administrar columnas",
|
|
177
177
|
"SEARCH-PLACEHOLDER": "Buscar",
|
|
178
178
|
"SEARCH-RESULTS": "Resultados de búsqueda",
|
|
179
|
-
"NO-RESULTS": "Sin resultados",
|
|
180
179
|
"VISIBLE": "Visible",
|
|
181
180
|
"HIDDEN": "Oculto",
|
|
182
181
|
"SAVE-VIEW": "Guardar vista",
|
|
@@ -469,6 +468,16 @@
|
|
|
469
468
|
},
|
|
470
469
|
"PLACEHOLDER": {
|
|
471
470
|
"CHOOSE-CONDITION": "Elige el tipo de condición abajo"
|
|
471
|
+
},
|
|
472
|
+
"TAG": {
|
|
473
|
+
"SEARCH-PLACEHOLDER": "Buscar",
|
|
474
|
+
"ADD-BUTTON-LABEL": "Agregar etiqueta",
|
|
475
|
+
"MANAGE-LINK-LABEL": "Administrar etiquetas",
|
|
476
|
+
"CREATE-TAG-LABEL": "Crear etiqueta",
|
|
477
|
+
"NO-TAGS": "Sin datos",
|
|
478
|
+
"CLEAR-TOOLTIP": "Borrar",
|
|
479
|
+
"DELETE-TOOLTIP": "Eliminar",
|
|
480
|
+
"NO-SEARCH-RESULTS": "No se encontraron etiquetas"
|
|
472
481
|
}
|
|
473
482
|
}
|
|
474
483
|
}
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -412,6 +412,16 @@ declare const _default: {
|
|
|
412
412
|
PLACEHOLDER: {
|
|
413
413
|
"CHOOSE-CONDITION": string;
|
|
414
414
|
};
|
|
415
|
+
TAG: {
|
|
416
|
+
"SEARCH-PLACEHOLDER": string;
|
|
417
|
+
"ADD-BUTTON-LABEL": string;
|
|
418
|
+
"MANAGE-LINK-LABEL": string;
|
|
419
|
+
"CREATE-TAG-LABEL": string;
|
|
420
|
+
"NO-TAGS": string;
|
|
421
|
+
"CLEAR-TOOLTIP": string;
|
|
422
|
+
"DELETE-TOOLTIP": string;
|
|
423
|
+
"NO-SEARCH-RESULTS": string;
|
|
424
|
+
};
|
|
415
425
|
};
|
|
416
426
|
};
|
|
417
427
|
en: {
|
|
@@ -886,6 +896,16 @@ declare const _default: {
|
|
|
886
896
|
PLACEHOLDER: {
|
|
887
897
|
"CHOOSE-CONDITION": string;
|
|
888
898
|
};
|
|
899
|
+
TAG: {
|
|
900
|
+
"SEARCH-PLACEHOLDER": string;
|
|
901
|
+
"ADD-BUTTON-LABEL": string;
|
|
902
|
+
"MANAGE-LINK-LABEL": string;
|
|
903
|
+
"CREATE-TAG-LABEL": string;
|
|
904
|
+
"NO-TAGS": string;
|
|
905
|
+
"CLEAR-TOOLTIP": string;
|
|
906
|
+
"DELETE-TOOLTIP": string;
|
|
907
|
+
"NO-SEARCH-RESULTS": string;
|
|
908
|
+
};
|
|
889
909
|
};
|
|
890
910
|
};
|
|
891
911
|
es: {
|
|
@@ -1066,7 +1086,6 @@ declare const _default: {
|
|
|
1066
1086
|
TITLE: string;
|
|
1067
1087
|
"SEARCH-PLACEHOLDER": string;
|
|
1068
1088
|
"SEARCH-RESULTS": string;
|
|
1069
|
-
"NO-RESULTS": string;
|
|
1070
1089
|
VISIBLE: string;
|
|
1071
1090
|
HIDDEN: string;
|
|
1072
1091
|
"SAVE-VIEW": string;
|
|
@@ -1096,6 +1115,7 @@ declare const _default: {
|
|
|
1096
1115
|
TO: string;
|
|
1097
1116
|
REMOVE: string;
|
|
1098
1117
|
ADD_RANGE: string;
|
|
1118
|
+
"NO-RESULTS": string;
|
|
1099
1119
|
ERROR_EMPTY_RANGE: string;
|
|
1100
1120
|
ERROR_EMPTY_FROM_FIELD: string;
|
|
1101
1121
|
ERROR_EMPTY_TO_FIELD: string;
|
|
@@ -1359,6 +1379,16 @@ declare const _default: {
|
|
|
1359
1379
|
PLACEHOLDER: {
|
|
1360
1380
|
"CHOOSE-CONDITION": string;
|
|
1361
1381
|
};
|
|
1382
|
+
TAG: {
|
|
1383
|
+
"SEARCH-PLACEHOLDER": string;
|
|
1384
|
+
"ADD-BUTTON-LABEL": string;
|
|
1385
|
+
"MANAGE-LINK-LABEL": string;
|
|
1386
|
+
"CREATE-TAG-LABEL": string;
|
|
1387
|
+
"NO-TAGS": string;
|
|
1388
|
+
"CLEAR-TOOLTIP": string;
|
|
1389
|
+
"DELETE-TOOLTIP": string;
|
|
1390
|
+
"NO-SEARCH-RESULTS": string;
|
|
1391
|
+
};
|
|
1362
1392
|
};
|
|
1363
1393
|
};
|
|
1364
1394
|
pt: {
|
|
@@ -1834,6 +1864,16 @@ declare const _default: {
|
|
|
1834
1864
|
PLACEHOLDER: {
|
|
1835
1865
|
"CHOOSE-CONDITION": string;
|
|
1836
1866
|
};
|
|
1867
|
+
TAG: {
|
|
1868
|
+
"SEARCH-PLACEHOLDER": string;
|
|
1869
|
+
"ADD-BUTTON-LABEL": string;
|
|
1870
|
+
"MANAGE-LINK-LABEL": string;
|
|
1871
|
+
"CREATE-TAG-LABEL": string;
|
|
1872
|
+
"NO-TAGS": string;
|
|
1873
|
+
"CLEAR-TOOLTIP": string;
|
|
1874
|
+
"DELETE-TOOLTIP": string;
|
|
1875
|
+
"NO-SEARCH-RESULTS": string;
|
|
1876
|
+
};
|
|
1837
1877
|
};
|
|
1838
1878
|
};
|
|
1839
1879
|
default: {
|
|
@@ -2308,6 +2348,16 @@ declare const _default: {
|
|
|
2308
2348
|
PLACEHOLDER: {
|
|
2309
2349
|
"CHOOSE-CONDITION": string;
|
|
2310
2350
|
};
|
|
2351
|
+
TAG: {
|
|
2352
|
+
"SEARCH-PLACEHOLDER": string;
|
|
2353
|
+
"ADD-BUTTON-LABEL": string;
|
|
2354
|
+
"MANAGE-LINK-LABEL": string;
|
|
2355
|
+
"CREATE-TAG-LABEL": string;
|
|
2356
|
+
"NO-TAGS": string;
|
|
2357
|
+
"CLEAR-TOOLTIP": string;
|
|
2358
|
+
"DELETE-TOOLTIP": string;
|
|
2359
|
+
"NO-SEARCH-RESULTS": string;
|
|
2360
|
+
};
|
|
2311
2361
|
};
|
|
2312
2362
|
};
|
|
2313
2363
|
};
|
package/dist/i18n/pl.json
CHANGED
|
@@ -410,6 +410,16 @@
|
|
|
410
410
|
},
|
|
411
411
|
"PLACEHOLDER": {
|
|
412
412
|
"CHOOSE-CONDITION": "Wybierz rodzaj warunku"
|
|
413
|
+
},
|
|
414
|
+
"TAG": {
|
|
415
|
+
"SEARCH-PLACEHOLDER": "Szukaj",
|
|
416
|
+
"ADD-BUTTON-LABEL": "Dodaj tag",
|
|
417
|
+
"MANAGE-LINK-LABEL": "Zarządzaj tagami",
|
|
418
|
+
"CREATE-TAG-LABEL": "Utwórz tag",
|
|
419
|
+
"NO-TAGS": "Brak danych",
|
|
420
|
+
"CLEAR-TOOLTIP": "Wyczyść",
|
|
421
|
+
"DELETE-TOOLTIP": "Usuń",
|
|
422
|
+
"NO-SEARCH-RESULTS": "Nie znaleziono tagów"
|
|
413
423
|
}
|
|
414
424
|
}
|
|
415
|
-
}
|
|
425
|
+
}
|
package/dist/i18n/pt.json
CHANGED
|
@@ -470,6 +470,16 @@
|
|
|
470
470
|
},
|
|
471
471
|
"PLACEHOLDER": {
|
|
472
472
|
"CHOOSE-CONDITION": "Escolha o tipo de condição abaixo"
|
|
473
|
+
},
|
|
474
|
+
"TAG": {
|
|
475
|
+
"SEARCH-PLACEHOLDER": "Pesquisar",
|
|
476
|
+
"ADD-BUTTON-LABEL": "Adicionar tag",
|
|
477
|
+
"MANAGE-LINK-LABEL": "Gerenciar tags",
|
|
478
|
+
"CREATE-TAG-LABEL": "Criar tag",
|
|
479
|
+
"NO-TAGS": "Sem dados",
|
|
480
|
+
"CLEAR-TOOLTIP": "Limpar",
|
|
481
|
+
"DELETE-TOOLTIP": "Excluir",
|
|
482
|
+
"NO-SEARCH-RESULTS": "Nenhuma tag encontrada"
|
|
473
483
|
}
|
|
474
484
|
}
|
|
475
|
-
}
|
|
485
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import { type DataFormatConfigProviderProps } from '
|
|
3
|
-
import { type ToasterProps } from '@synerise/ds-toaster';
|
|
2
|
+
import { type DataFormatConfigProviderProps } from '../data-format';
|
|
4
3
|
import '../style';
|
|
4
|
+
import { type ToasterProps } from '../toaster';
|
|
5
5
|
import { type LocaleProviderProps } from './LocaleProvider/LocaleProvider.types';
|
|
6
6
|
import { type ThemeProviderProps } from './ThemeProvider/ThemeProvider';
|
|
7
7
|
export type DSProviderProps = PropsWithChildren<LocaleProviderProps & ThemeProviderProps & DataFormatConfigProviderProps & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DataFormatConfigProvider } from '
|
|
3
|
-
import Toaster, { TOASTER_DEFAULTS, ToasterProvider } from '@synerise/ds-toaster';
|
|
2
|
+
import { DataFormatConfigProvider } from '../data-format';
|
|
4
3
|
import '../style';
|
|
4
|
+
import Toaster, { TOASTER_DEFAULTS, ToasterProvider } from '../toaster';
|
|
5
5
|
import LocaleProvider from './LocaleProvider';
|
|
6
6
|
import ThemeProvider from './ThemeProvider';
|
|
7
7
|
var DSProvider = function DSProvider(_ref) {
|
|
@@ -178,7 +178,6 @@ export declare const getDSMessages: (lang: string) => {
|
|
|
178
178
|
TITLE: string;
|
|
179
179
|
"SEARCH-PLACEHOLDER": string;
|
|
180
180
|
"SEARCH-RESULTS": string;
|
|
181
|
-
"NO-RESULTS": string;
|
|
182
181
|
VISIBLE: string;
|
|
183
182
|
HIDDEN: string;
|
|
184
183
|
"SAVE-VIEW": string;
|
|
@@ -208,6 +207,7 @@ export declare const getDSMessages: (lang: string) => {
|
|
|
208
207
|
TO: string;
|
|
209
208
|
REMOVE: string;
|
|
210
209
|
ADD_RANGE: string;
|
|
210
|
+
"NO-RESULTS": string;
|
|
211
211
|
ERROR_EMPTY_RANGE: string;
|
|
212
212
|
ERROR_EMPTY_FROM_FIELD: string;
|
|
213
213
|
ERROR_EMPTY_TO_FIELD: string;
|
|
@@ -471,6 +471,16 @@ export declare const getDSMessages: (lang: string) => {
|
|
|
471
471
|
PLACEHOLDER: {
|
|
472
472
|
"CHOOSE-CONDITION": string;
|
|
473
473
|
};
|
|
474
|
+
TAG: {
|
|
475
|
+
"SEARCH-PLACEHOLDER": string;
|
|
476
|
+
"ADD-BUTTON-LABEL": string;
|
|
477
|
+
"MANAGE-LINK-LABEL": string;
|
|
478
|
+
"CREATE-TAG-LABEL": string;
|
|
479
|
+
"NO-TAGS": string;
|
|
480
|
+
"CLEAR-TOOLTIP": string;
|
|
481
|
+
"DELETE-TOOLTIP": string;
|
|
482
|
+
"NO-SEARCH-RESULTS": string;
|
|
483
|
+
};
|
|
474
484
|
};
|
|
475
485
|
} | {
|
|
476
486
|
DS: {
|
|
@@ -885,5 +895,15 @@ export declare const getDSMessages: (lang: string) => {
|
|
|
885
895
|
PLACEHOLDER: {
|
|
886
896
|
"CHOOSE-CONDITION": string;
|
|
887
897
|
};
|
|
898
|
+
TAG: {
|
|
899
|
+
"SEARCH-PLACEHOLDER": string;
|
|
900
|
+
"ADD-BUTTON-LABEL": string;
|
|
901
|
+
"MANAGE-LINK-LABEL": string;
|
|
902
|
+
"CREATE-TAG-LABEL": string;
|
|
903
|
+
"NO-TAGS": string;
|
|
904
|
+
"CLEAR-TOOLTIP": string;
|
|
905
|
+
"DELETE-TOOLTIP": string;
|
|
906
|
+
"NO-SEARCH-RESULTS": string;
|
|
907
|
+
};
|
|
888
908
|
};
|
|
889
909
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export type BreakpointKey = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
2
|
+
export type BreakpointsData = Record<BreakpointKey, {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
}>;
|
|
2
6
|
export declare const breakpoints: BreakpointsData;
|
|
3
7
|
export default breakpoints;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
|
+
import { type Moment } from 'moment';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { type DateToFormatOptions } from '../types';
|
|
5
|
+
export type FormattedDateProps = {
|
|
6
|
+
value: Date | Moment | Dayjs;
|
|
7
|
+
options?: DateToFormatOptions;
|
|
8
|
+
};
|
|
9
|
+
export declare const FormattedDate: React.FC<FormattedDateProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDataFormat } from '../hooks';
|
|
3
|
+
export var FormattedDate = function FormattedDate(_ref) {
|
|
4
|
+
var value = _ref.value,
|
|
5
|
+
options = _ref.options;
|
|
6
|
+
var _useDataFormat = useDataFormat(),
|
|
7
|
+
formatValue = _useDataFormat.formatValue;
|
|
8
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, options));
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
|
+
import { type Moment } from 'moment';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { type DateToFormatOptions } from '../types';
|
|
5
|
+
export type FormattedTimeProps = {
|
|
6
|
+
value: Date | Moment | Dayjs;
|
|
7
|
+
options?: DateToFormatOptions;
|
|
8
|
+
};
|
|
9
|
+
export declare const FormattedDateTime: React.FC<FormattedTimeProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 { DATETIME } from '../constants';
|
|
4
|
+
import { useDataFormat } from '../hooks';
|
|
5
|
+
export var FormattedDateTime = function FormattedDateTime(_ref) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
options = _ref.options;
|
|
8
|
+
var _useDataFormat = useDataFormat(),
|
|
9
|
+
formatValue = _useDataFormat.formatValue;
|
|
10
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, _extends({}, options, {
|
|
11
|
+
targetFormat: DATETIME
|
|
12
|
+
})));
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDataFormat } from '../hooks';
|
|
3
|
+
export var FormattedNumber = function FormattedNumber(_ref) {
|
|
4
|
+
var value = _ref.value,
|
|
5
|
+
options = _ref.options;
|
|
6
|
+
var _useDataFormat = useDataFormat(),
|
|
7
|
+
formatValue = _useDataFormat.formatValue;
|
|
8
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, options));
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
|
+
import { type Moment } from 'moment';
|
|
3
|
+
import { type DateToFormatOptions } from '../types';
|
|
4
|
+
export type FormattedRelativeDateTimeProps = {
|
|
5
|
+
value: Date | Moment | Dayjs;
|
|
6
|
+
withoutSuffix?: boolean;
|
|
7
|
+
options?: DateToFormatOptions;
|
|
8
|
+
};
|
|
9
|
+
export declare const FormattedRelativeDateTimeTo: ({ value, withoutSuffix, options, }: FormattedRelativeDateTimeProps) => JSX.Element;
|
|
10
|
+
export declare const FormattedRelativeDateTimeFrom: ({ value, withoutSuffix, options, }: FormattedRelativeDateTimeProps) => JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { RELATIVE_FROM, RELATIVE_FROM_WITHOUT_SUFFIX, RELATIVE_TO, RELATIVE_TO_WITHOUT_SUFFIX } from '../constants';
|
|
4
|
+
import { useDataFormat } from '../hooks';
|
|
5
|
+
export var FormattedRelativeDateTimeTo = function FormattedRelativeDateTimeTo(_ref) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
withoutSuffix = _ref.withoutSuffix,
|
|
8
|
+
options = _ref.options;
|
|
9
|
+
var _useDataFormat = useDataFormat(),
|
|
10
|
+
formatValue = _useDataFormat.formatValue;
|
|
11
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, _extends({}, options, {
|
|
12
|
+
targetFormat: withoutSuffix ? RELATIVE_TO_WITHOUT_SUFFIX : RELATIVE_TO
|
|
13
|
+
})));
|
|
14
|
+
};
|
|
15
|
+
export var FormattedRelativeDateTimeFrom = function FormattedRelativeDateTimeFrom(_ref2) {
|
|
16
|
+
var value = _ref2.value,
|
|
17
|
+
withoutSuffix = _ref2.withoutSuffix,
|
|
18
|
+
options = _ref2.options;
|
|
19
|
+
var _useDataFormat2 = useDataFormat(),
|
|
20
|
+
formatValue = _useDataFormat2.formatValue;
|
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, _extends({}, options, {
|
|
22
|
+
targetFormat: withoutSuffix ? RELATIVE_FROM_WITHOUT_SUFFIX : RELATIVE_FROM
|
|
23
|
+
})));
|
|
24
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
|
+
import { type Moment } from 'moment';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { type DateToFormatOptions } from '../types';
|
|
5
|
+
export type FormattedTimeProps = {
|
|
6
|
+
value: Date | Moment | Dayjs;
|
|
7
|
+
options?: DateToFormatOptions;
|
|
8
|
+
};
|
|
9
|
+
export declare const FormattedTime: React.FC<FormattedTimeProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 { TIME } from '../constants';
|
|
4
|
+
import { useDataFormat } from '../hooks';
|
|
5
|
+
export var FormattedTime = function FormattedTime(_ref) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
options = _ref.options;
|
|
8
|
+
var _useDataFormat = useDataFormat(),
|
|
9
|
+
formatValue = _useDataFormat.formatValue;
|
|
10
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, _extends({}, options, {
|
|
11
|
+
targetFormat: TIME
|
|
12
|
+
})));
|
|
13
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { FormattedDate } from './FormattedDate';
|
|
2
|
+
export { FormattedDateTime } from './FormattedDateTime';
|
|
3
|
+
export { FormattedNumber } from './FormattedNumber';
|
|
4
|
+
export { FormattedTime } from './FormattedTime';
|
|
5
|
+
export { FormattedRelativeDateTimeFrom, FormattedRelativeDateTimeTo, } from './FormattedRelativeDateTime';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { FormattedDate } from './FormattedDate';
|
|
2
|
+
export { FormattedDateTime } from './FormattedDateTime';
|
|
3
|
+
export { FormattedNumber } from './FormattedNumber';
|
|
4
|
+
export { FormattedTime } from './FormattedTime';
|
|
5
|
+
export { FormattedRelativeDateTimeFrom, FormattedRelativeDateTimeTo } from './FormattedRelativeDateTime';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type FormatDateOptions, type FormatNumberOptions } from 'react-intl';
|
|
2
|
+
import { type DateConstantsTargetFormat, type DateTargetFormat, type Delimiter, type NamingConvention, type NumberTargetFormat } from '../types';
|
|
3
|
+
export declare const DEFAULT_FORMAT_NUMBER_OPTIONS: FormatNumberOptions;
|
|
4
|
+
export declare const DEFAULT_FORMAT_DATE_OPTIONS: FormatDateOptions;
|
|
5
|
+
export declare const DEFAULT_FORMAT_TIME_OPTIONS: FormatDateOptions;
|
|
6
|
+
export declare const DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS: FormatDateOptions;
|
|
7
|
+
export declare const DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS: FormatDateOptions;
|
|
8
|
+
export declare const DEFAULT_FORMAT_MONTH_LONG_OPTIONS: FormatDateOptions;
|
|
9
|
+
export declare const DEFAULT_FORMAT_MONTH_SHORT_OPTIONS: FormatDateOptions;
|
|
10
|
+
export declare const DATE: DateTargetFormat;
|
|
11
|
+
export declare const TIME: DateTargetFormat;
|
|
12
|
+
export declare const DATETIME: DateTargetFormat;
|
|
13
|
+
export declare const RELATIVE_FROM: DateTargetFormat;
|
|
14
|
+
export declare const RELATIVE_TO: DateTargetFormat;
|
|
15
|
+
export declare const RELATIVE_FROM_WITHOUT_SUFFIX: DateTargetFormat;
|
|
16
|
+
export declare const RELATIVE_TO_WITHOUT_SUFFIX: DateTargetFormat;
|
|
17
|
+
export declare const WEEKDAY_LONG: DateTargetFormat;
|
|
18
|
+
export declare const WEEKDAY_SHORT: DateTargetFormat;
|
|
19
|
+
export declare const MONTH_LONG: DateTargetFormat;
|
|
20
|
+
export declare const MONTH_SHORT: DateTargetFormat;
|
|
21
|
+
export declare const COMPACT_LARGER_NUMBER: NumberTargetFormat;
|
|
22
|
+
export declare const COMPACT_DECIMAL_LARGER_NUMBER: NumberTargetFormat;
|
|
23
|
+
export declare const LARGER_NUMBER_LIMIT = 999;
|
|
24
|
+
export declare const UPPER_CASE: NamingConvention;
|
|
25
|
+
export declare const UPPER_FIRST: NamingConvention;
|
|
26
|
+
export declare const LOWER_CASE: NamingConvention;
|
|
27
|
+
export declare const LOWER_FIRST: NamingConvention;
|
|
28
|
+
export declare const US_THOUSAND_DELIMITER: Delimiter;
|
|
29
|
+
export declare const US_DECIMAL_DELIMITER: Delimiter;
|
|
30
|
+
export declare const EU_THOUSAND_DELIMITER: Delimiter;
|
|
31
|
+
export declare const EU_DECIMAL_DELIMITER: Delimiter;
|
|
32
|
+
export declare const DATE_CONSTANTS_TARGET_FORMATS: DateConstantsTargetFormat[];
|
|
33
|
+
export declare const MONTHS_LONG: DateConstantsTargetFormat;
|
|
34
|
+
export declare const MONTHS_SHORT: DateConstantsTargetFormat;
|
|
35
|
+
export declare const WEEKDAYS_LONG: DateConstantsTargetFormat;
|
|
36
|
+
export declare const WEEKDAYS_SHORT: DateConstantsTargetFormat;
|