@danikokonn/yarik-frontend-lib 2.0.58-test9 → 2.1.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/README.md +309 -1
- package/dist/components/ActionDialog/ActionDialog.d.ts +1 -2
- package/dist/components/ActionDialog/ActionDialog.d.ts.map +1 -1
- package/dist/components/ActionDialog/ActionDialog.js +8 -19
- package/dist/components/ActionDialog/ActionDialogProps.d.ts +1 -3
- package/dist/components/ActionDialog/ActionDialogProps.d.ts.map +1 -1
- package/dist/components/ActionDialog/index.d.ts +2 -2
- package/dist/components/ActionDialog/index.d.ts.map +1 -1
- package/dist/components/ActionDialog/index.js +1 -1
- package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts +1 -2
- package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts.map +1 -1
- package/dist/components/ColumnSearchInput/ColumnSearchInput.js +5 -5
- package/dist/components/ColumnSearchInput/index.d.ts +2 -2
- package/dist/components/ColumnSearchInput/index.d.ts.map +1 -1
- package/dist/components/ColumnSearchInput/index.js +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +2 -3
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +39 -42
- package/dist/components/DateTimeRangePicker/index.d.ts +2 -2
- package/dist/components/DateTimeRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/index.js +1 -1
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts +1 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts.map +1 -1
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.js +38 -44
- package/dist/components/DatetimeRangeInput/index.d.ts +2 -2
- package/dist/components/DatetimeRangeInput/index.d.ts.map +1 -1
- package/dist/components/DatetimeRangeInput/index.js +1 -1
- package/dist/components/Footer/Footer.d.ts +1 -2
- package/dist/components/Footer/Footer.d.ts.map +1 -1
- package/dist/components/Footer/Footer.js +5 -13
- package/dist/components/Footer/index.d.ts +1 -1
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +1 -1
- package/dist/components/IpAddressInput/IpAddressInput.d.ts +1 -2
- package/dist/components/IpAddressInput/IpAddressInput.d.ts.map +1 -1
- package/dist/components/IpAddressInput/IpAddressInput.js +5 -6
- package/dist/components/IpAddressInput/index.d.ts +2 -2
- package/dist/components/IpAddressInput/index.d.ts.map +1 -1
- package/dist/components/IpAddressInput/index.js +1 -1
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts +1 -2
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts.map +1 -1
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.js +3 -2
- package/dist/components/IpAddressSwitchableInput/index.d.ts +2 -2
- package/dist/components/IpAddressSwitchableInput/index.d.ts.map +1 -1
- package/dist/components/IpAddressSwitchableInput/index.js +1 -1
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.d.ts +1 -2
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.d.ts.map +1 -1
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.js +6 -6
- package/dist/components/LocalizedDatetimePicker/index.d.ts +2 -2
- package/dist/components/LocalizedDatetimePicker/index.d.ts.map +1 -1
- package/dist/components/LocalizedDatetimePicker/index.js +1 -1
- package/dist/components/Navigation/NavMenu.d.ts +4 -3
- package/dist/components/Navigation/NavMenu.d.ts.map +1 -1
- package/dist/components/Navigation/NavMenu.js +23 -27
- package/dist/components/Navigation/Navigation.d.ts +1 -2
- package/dist/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +122 -147
- package/dist/components/Navigation/NavigationProps.d.ts +2 -1
- package/dist/components/Navigation/NavigationProps.d.ts.map +1 -1
- package/dist/components/Navigation/index.d.ts +2 -2
- package/dist/components/Navigation/index.d.ts.map +1 -1
- package/dist/components/Navigation/index.js +1 -1
- package/dist/components/NumberRangeInput/NumberRangeInput.d.ts +1 -2
- package/dist/components/NumberRangeInput/NumberRangeInput.d.ts.map +1 -1
- package/dist/components/NumberRangeInput/NumberRangeInput.js +34 -39
- package/dist/components/NumberRangeInput/index.d.ts +2 -2
- package/dist/components/NumberRangeInput/index.d.ts.map +1 -1
- package/dist/components/NumberRangeInput/index.js +1 -1
- package/dist/components/PageWrapper/PageWrapper.d.ts +2 -2
- package/dist/components/PageWrapper/PageWrapper.d.ts.map +1 -1
- package/dist/components/PageWrapper/PageWrapper.js +11 -14
- package/dist/components/PageWrapper/index.d.ts +2 -2
- package/dist/components/PageWrapper/index.d.ts.map +1 -1
- package/dist/components/PageWrapper/index.js +1 -1
- package/dist/components/RichFilterTextField/FilterHistoryMenu.d.ts +1 -2
- package/dist/components/RichFilterTextField/FilterHistoryMenu.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/FilterHistoryMenu.js +17 -31
- package/dist/components/RichFilterTextField/HintOptionsMenu.d.ts +4 -4
- package/dist/components/RichFilterTextField/HintOptionsMenu.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/HintOptionsMenu.js +8 -10
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts +1 -2
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/RichFilterTextField.js +101 -86
- package/dist/components/RichFilterTextField/index.d.ts +2 -2
- package/dist/components/RichFilterTextField/index.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/index.js +1 -1
- package/dist/components/RichFilterTextField/utils.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/utils.js +13 -5
- package/dist/components/SmartTable/RowContent.d.ts +29 -9
- package/dist/components/SmartTable/RowContent.d.ts.map +1 -1
- package/dist/components/SmartTable/RowContent.js +59 -20
- package/dist/components/SmartTable/SmartTable.d.ts +9 -2
- package/dist/components/SmartTable/SmartTable.d.ts.map +1 -1
- package/dist/components/SmartTable/SmartTable.js +97 -109
- package/dist/components/SmartTable/SmartTableProps.d.ts +20 -10
- package/dist/components/SmartTable/SmartTableProps.d.ts.map +1 -1
- package/dist/components/SmartTable/TableHeader.d.ts +1 -2
- package/dist/components/SmartTable/TableHeader.d.ts.map +1 -1
- package/dist/components/SmartTable/TableHeader.js +5 -4
- package/dist/components/SmartTable/index.d.ts +2 -2
- package/dist/components/SmartTable/index.d.ts.map +1 -1
- package/dist/components/SmartTable/index.js +1 -1
- package/dist/components/SortBtn/SortBtn.d.ts +1 -2
- package/dist/components/SortBtn/SortBtn.d.ts.map +1 -1
- package/dist/components/SortBtn/SortBtn.js +3 -2
- package/dist/components/SortBtn/index.d.ts +2 -2
- package/dist/components/SortBtn/index.d.ts.map +1 -1
- package/dist/components/SortBtn/index.js +1 -1
- package/dist/components/SubtaskItem/SubtaskItem.d.ts +1 -2
- package/dist/components/SubtaskItem/SubtaskItem.d.ts.map +1 -1
- package/dist/components/SubtaskItem/SubtaskItem.js +82 -43
- package/dist/components/SubtaskItem/SubtaskItemProps.d.ts +1 -1
- package/dist/components/SubtaskItem/SubtaskItemProps.d.ts.map +1 -1
- package/dist/components/SubtaskItem/index.d.ts +2 -2
- package/dist/components/SubtaskItem/index.d.ts.map +1 -1
- package/dist/components/SubtaskItem/index.js +1 -1
- package/dist/components/TaskLoader/TaskLoader.d.ts +2 -2
- package/dist/components/TaskLoader/TaskLoader.d.ts.map +1 -1
- package/dist/components/TaskLoader/TaskLoader.js +181 -196
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts +1 -0
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts.map +1 -1
- package/dist/components/TaskLoader/index.d.ts +2 -2
- package/dist/components/TaskLoader/index.d.ts.map +1 -1
- package/dist/components/TaskLoader/index.js +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts +1 -2
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.js +33 -47
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts +2 -1
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/index.d.ts +2 -2
- package/dist/components/TaskStateDialog/index.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/index.js +1 -1
- package/dist/components/icons/GenerateAndRunIcon.d.ts +1 -2
- package/dist/components/icons/GenerateAndRunIcon.d.ts.map +1 -1
- package/dist/components/icons/GenerateAndRunIcon.js +6 -23
- package/dist/components/icons/GenerateIcon.d.ts +1 -2
- package/dist/components/icons/GenerateIcon.d.ts.map +1 -1
- package/dist/components/icons/GenerateIcon.js +6 -21
- package/dist/components/icons/IntegerIcon.d.ts +1 -2
- package/dist/components/icons/IntegerIcon.d.ts.map +1 -1
- package/dist/components/icons/IntegerIcon.js +6 -9
- package/dist/components/icons/ProcessingIcon.d.ts +1 -2
- package/dist/components/icons/ProcessingIcon.d.ts.map +1 -1
- package/dist/components/icons/ProcessingIcon.js +2 -12
- package/dist/components/icons/QueueIcon.d.ts +1 -2
- package/dist/components/icons/QueueIcon.d.ts.map +1 -1
- package/dist/components/icons/QueueIcon.js +6 -9
- package/dist/components/icons/RangeIcon.d.ts +1 -2
- package/dist/components/icons/RangeIcon.d.ts.map +1 -1
- package/dist/components/icons/RangeIcon.js +6 -9
- package/dist/components/icons/RunIcon.d.ts +1 -2
- package/dist/components/icons/RunIcon.d.ts.map +1 -1
- package/dist/components/icons/RunIcon.js +6 -12
- package/dist/components/icons/TextModeIcon.d.ts.map +1 -1
- package/dist/components/icons/TextModeIcon.js +2 -6
- package/dist/components/icons/TreeModeIcon.d.ts.map +1 -1
- package/dist/components/icons/TreeModeIcon.js +2 -6
- package/dist/components/icons/index.d.ts +1 -1
- package/dist/components/icons/index.js +1 -1
- package/dist/http.d.ts +2 -2
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -29
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/providers/AirflowProvider.d.ts +10 -8
- package/dist/providers/AirflowProvider.d.ts.map +1 -1
- package/dist/providers/AirflowProvider.js +59 -70
- package/dist/providers/DagStateProvider.d.ts +8 -6
- package/dist/providers/DagStateProvider.d.ts.map +1 -1
- package/dist/providers/DagStateProvider.js +105 -98
- package/dist/providers/SessionProvider.d.ts +2 -2
- package/dist/providers/SessionProvider.d.ts.map +1 -1
- package/dist/providers/SessionProvider.js +15 -8
- package/dist/providers/SnackBarProvider.d.ts +3 -2
- package/dist/providers/SnackBarProvider.d.ts.map +1 -1
- package/dist/providers/SnackBarProvider.js +22 -16
- package/dist/providers/index.d.ts +4 -4
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +4 -4
- package/dist/types.d.ts +17 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +3 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -2
- package/package.json +43 -26
- package/dist/components/SmartTable/RuleRow.d.ts +0 -22
- package/dist/components/SmartTable/RuleRow.d.ts.map +0 -1
- package/dist/components/SmartTable/RuleRow.js +0 -35
package/README.md
CHANGED
|
@@ -1 +1,309 @@
|
|
|
1
|
-
# YARIK-frontend-lib
|
|
1
|
+
# YARIK-frontend-lib
|
|
2
|
+
|
|
3
|
+
Библиотека переиспользуемых React-компонентов, утилит и провайдеров.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@danikokonn/yarik-frontend-lib)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Содержание
|
|
11
|
+
|
|
12
|
+
- [Установка](#установка)
|
|
13
|
+
- [Требования](#требования)
|
|
14
|
+
- [Использование](#использование)
|
|
15
|
+
- [Компоненты](#компоненты)
|
|
16
|
+
- [Провайдеры](#провайдеры)
|
|
17
|
+
- [Утилиты и HTTP-клиент](#утилиты-и-http-клиент)
|
|
18
|
+
- [Разработка](#разработка)
|
|
19
|
+
- [Тестирование](#тестирование)
|
|
20
|
+
- [Публикация](#публикация)
|
|
21
|
+
- [Как дополнять README](#как-дополнять-readme)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Установка
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @danikokonn/yarik-frontend-lib
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Требования
|
|
34
|
+
|
|
35
|
+
| Зависимость | Версия |
|
|
36
|
+
|-------------|----------|
|
|
37
|
+
| React | >=18 <20 |
|
|
38
|
+
| react-dom | >=18 <20 |
|
|
39
|
+
|
|
40
|
+
MUI, Emotion и остальные зависимости устанавливаются автоматически.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Использование
|
|
45
|
+
|
|
46
|
+
### Импорт компонентов
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { SmartTable, Navigation, PageWrapper } from '@danikokonn/yarik-frontend-lib';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Импорт утилит
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { prettyDatetime, getCSRFToken } from '@danikokonn/yarik-frontend-lib/utils';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Импорт HTTP-клиента
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { get, post } from '@danikokonn/yarik-frontend-lib/http';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Импорт типов
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import type { Dag, DagRun, TaskInstance } from '@danikokonn/yarik-frontend-lib/types';
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Подключение провайдеров
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import { SnackBarProvider, SessionProvider } from '@danikokonn/yarik-frontend-lib';
|
|
74
|
+
|
|
75
|
+
function App() {
|
|
76
|
+
return (
|
|
77
|
+
<SessionProvider>
|
|
78
|
+
<SnackBarProvider>
|
|
79
|
+
{/* ваше приложение */}
|
|
80
|
+
</SnackBarProvider>
|
|
81
|
+
</SessionProvider>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Компоненты
|
|
89
|
+
|
|
90
|
+
| Компонент | Описание |
|
|
91
|
+
|----------------------------|------------------------------------------------------------------|
|
|
92
|
+
| `ActionDialog` | Диалог подтверждения действия с опциональной формой ввода |
|
|
93
|
+
| `ColumnSearchInput` | Поле поиска для столбца таблицы |
|
|
94
|
+
| `DateTimeRangePicker` | Выбор диапазона дат и времени |
|
|
95
|
+
| `DatetimeRangeInput` | Ввод диапазона дата/время |
|
|
96
|
+
| `Footer` | Нижний колонтитул страницы |
|
|
97
|
+
| `IpAddressInput` | Поле ввода IP-адреса с валидацией |
|
|
98
|
+
| `IpAddressSwitchableInput` | Переключаемое поле ввода IP-адреса |
|
|
99
|
+
| `LocalizedDatetimePicker` | Выбор даты/времени с поддержкой часовых поясов |
|
|
100
|
+
| `Navigation` | Навигационная панель с поддержкой меню |
|
|
101
|
+
| `NumberRangeInput` | Ввод числового диапазона |
|
|
102
|
+
| `PageWrapper` | Обёртка страницы (Navigation + контент + Footer) |
|
|
103
|
+
| `RichFilterTextField` | Расширенное поле фильтрации с историей и подсказками |
|
|
104
|
+
| `SmartTable` | Виртуализированная таблица с сортировкой, пагинацией, фильтрами |
|
|
105
|
+
| `SortBtn` | Кнопка сортировки |
|
|
106
|
+
| `SubtaskItem` | Отображение элемента подзадачи |
|
|
107
|
+
| `TaskLoader` | Компонент состояния загрузки |
|
|
108
|
+
| `TaskStateDialog` | Диалог отображения состояния задачи |
|
|
109
|
+
|
|
110
|
+
### Иконки
|
|
111
|
+
|
|
112
|
+
Доступны 9 SVG-иконок: `GenerateAndRunIcon`, `GenerateIcon`, `IntegerIcon`, `ProcessingIcon`, `QueueIcon`, `RangeIcon`, `RunIcon`, `TextModeIcon`, `TreeModeIcon`.
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import { RunIcon } from '@danikokonn/yarik-frontend-lib/components/icons/RunIcon';
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Провайдеры
|
|
121
|
+
|
|
122
|
+
### SnackBarProvider
|
|
123
|
+
|
|
124
|
+
Контекст уведомлений на основе notistack.
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
import { SnackBarProvider, useSnackbarContext } from '@danikokonn/yarik-frontend-lib';
|
|
128
|
+
|
|
129
|
+
function MyComponent() {
|
|
130
|
+
const { enqueueSnackbar } = useSnackbarContext();
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<button onClick={() => enqueueSnackbar('Успешно!', { variant: 'success' })}>
|
|
134
|
+
Показать уведомление
|
|
135
|
+
</button>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Доступные варианты: `default`, `error`, `success`, `warning`, `info`.
|
|
141
|
+
|
|
142
|
+
### SessionProvider
|
|
143
|
+
|
|
144
|
+
Управление состоянием сессии и аутентификации.
|
|
145
|
+
|
|
146
|
+
### AirflowProvider
|
|
147
|
+
|
|
148
|
+
Контекст интеграции с Apache Airflow.
|
|
149
|
+
|
|
150
|
+
### DagStateProvider
|
|
151
|
+
|
|
152
|
+
Управление состоянием DAG-рабочих процессов.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Утилиты и HTTP-клиент
|
|
157
|
+
|
|
158
|
+
### Утилиты (`/utils`)
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import {
|
|
162
|
+
prettyDatetime, // форматирование даты/времени для отображения
|
|
163
|
+
formatDate, // форматирование даты
|
|
164
|
+
formatDuration, // форматирование длительности
|
|
165
|
+
getCSRFToken, // получение CSRF-токена
|
|
166
|
+
setCSRFToken, // установка CSRF-токена
|
|
167
|
+
useDebounce, // хук debounce
|
|
168
|
+
gettextTS, // i18n: перевод строки
|
|
169
|
+
ngettextTS, // i18n: перевод с учётом числа
|
|
170
|
+
} from '@danikokonn/yarik-frontend-lib/utils';
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### HTTP-клиент (`/http`)
|
|
174
|
+
|
|
175
|
+
Fetch-обёртка с поддержкой CSRF и автоматическим определением истечения сессии (401).
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { get, post } from '@danikokonn/yarik-frontend-lib/http';
|
|
179
|
+
|
|
180
|
+
const data = await get('/api/endpoint');
|
|
181
|
+
await post('/api/endpoint', { key: 'value' });
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Разработка
|
|
187
|
+
|
|
188
|
+
### Установка зависимостей
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
npm install
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Сборка
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm run build
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Компилирует TypeScript в `dist/`. Декларации типов генерируются автоматически.
|
|
201
|
+
|
|
202
|
+
### Добавление нового компонента
|
|
203
|
+
|
|
204
|
+
Создайте папку `src/components/<ComponentName>/` со структурой:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
src/components/MyComponent/
|
|
208
|
+
├── MyComponent.tsx # компонент
|
|
209
|
+
├── MyComponentProps.ts # интерфейс пропсов
|
|
210
|
+
├── MyComponent.test.tsx # тесты (обязательно, см. раздел «Тестирование»)
|
|
211
|
+
└── index.ts # export { default } from './MyComponent'
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Добавьте экспорт в `src/components/index.ts`.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Тестирование
|
|
219
|
+
|
|
220
|
+
Проект использует [Vitest](https://vitest.dev/) + [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/).
|
|
221
|
+
|
|
222
|
+
### Запуск тестов
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
npm test # watch-режим (разработка)
|
|
226
|
+
npm run test:run # однократный запуск (CI)
|
|
227
|
+
npm run coverage # запуск с отчётом о покрытии
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Структура тестов
|
|
231
|
+
|
|
232
|
+
Тестовые файлы располагаются рядом с компонентом (`*.test.tsx`) и автоматически подхватываются Vitest.
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
src/components/SortBtn/
|
|
236
|
+
├── SortBtn.tsx
|
|
237
|
+
├── SortBtnProps.ts
|
|
238
|
+
├── SortBtn.test.tsx ← тесты
|
|
239
|
+
└── index.ts
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Обязательный плейсхолдер
|
|
243
|
+
|
|
244
|
+
При создании нового компонента **всегда** создавайте файл `<ComponentName>.test.tsx` рядом с компонентом — даже если тесты пока не написаны:
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
import { render } from '@testing-library/react'
|
|
248
|
+
import MyComponent from './MyComponent'
|
|
249
|
+
|
|
250
|
+
describe('MyComponent', () => {
|
|
251
|
+
/**
|
|
252
|
+
* Проверяем, что компонент рендерится без ошибок с обязательными пропсами.
|
|
253
|
+
* Базовая страховка от синтаксических и runtime-ошибок при первом рендере.
|
|
254
|
+
*/
|
|
255
|
+
it.todo('renders correctly')
|
|
256
|
+
})
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Это сигнализирует о том, что компонент ещё не покрыт тестами, и не даёт файлу «потеряться».
|
|
260
|
+
|
|
261
|
+
### Описание тест-кейсов
|
|
262
|
+
|
|
263
|
+
Каждый блок `it` (в том числе `it.todo`) должен предваряться JSDoc-комментарием, объясняющим **что** тестируется и **зачем**. Названия теста недостаточно — комментарий должен отвечать на вопрос «что сломается в продакшене, если этот тест упадёт»:
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
/**
|
|
267
|
+
* Проверяем, что первый клик из состояния "none" вызывает onToggleSort с направлением "asc".
|
|
268
|
+
* Это начало трёхступенчатого цикла: none → asc → desc → none.
|
|
269
|
+
* Callback должен получать и поле, и новое направление, чтобы родитель мог обновить свой стейт.
|
|
270
|
+
*/
|
|
271
|
+
it('calls onToggleSort with asc when order is none', async () => {
|
|
272
|
+
// ...
|
|
273
|
+
})
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Правило распространяется на все тесты — и реальные, и заглушки `it.todo`.
|
|
277
|
+
|
|
278
|
+
### Конфигурация
|
|
279
|
+
|
|
280
|
+
| Файл | Назначение |
|
|
281
|
+
|------|------------|
|
|
282
|
+
| `vitest.config.ts` | Основная конфигурация Vitest |
|
|
283
|
+
| `src/test/setup.ts` | Подключение `@testing-library/jest-dom` |
|
|
284
|
+
| `tsconfig.test.json` | TypeScript-конфигурация для тестов |
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Публикация
|
|
289
|
+
|
|
290
|
+
Публикация выполняется автоматически через GitHub Actions при создании релиза.
|
|
291
|
+
|
|
292
|
+
| Тип релиза | NPM-тег |
|
|
293
|
+
|-------------|----------|
|
|
294
|
+
| Pre-release | `test` |
|
|
295
|
+
| Release | `latest` |
|
|
296
|
+
|
|
297
|
+
Версия берётся из git-тега и подставляется в `package.json` во время CI-сборки.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Как дополнять README
|
|
302
|
+
|
|
303
|
+
Добавляйте информацию в соответствующий раздел. Если раздела нет — создайте новый перед этим разделом.
|
|
304
|
+
|
|
305
|
+
**Рекомендации:**
|
|
306
|
+
- Каждый новый компонент — строка в таблицу раздела «Компоненты» с кратким описанием.
|
|
307
|
+
- Каждый новый провайдер — подраздел в «Провайдеры» с примером использования.
|
|
308
|
+
- Новые утилиты — добавить в список импортов раздела «Утилиты».
|
|
309
|
+
- Примеры кода должны быть минимальными и рабочими.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import ActionDialogProps from "./ActionDialogProps";
|
|
3
2
|
/**
|
|
4
3
|
* Диалоговое окно с подтверждением действия.
|
|
@@ -19,5 +18,5 @@ import ActionDialogProps from "./ActionDialogProps";
|
|
|
19
18
|
* @param onClose Обработчик закрытия диалога
|
|
20
19
|
* @param onConfirm Обработчик подтверждения
|
|
21
20
|
*/
|
|
22
|
-
export default function ActionDialog({ open, fullWidth, maxWidth, title, contentText,
|
|
21
|
+
export default function ActionDialog({ open, fullWidth, maxWidth, title, contentText, cancelText, confirmText, confirmAllowed, confirmTooltipTitle, children, onClose, onConfirm, }: ActionDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
23
22
|
//# sourceMappingURL=ActionDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ActionDialog/ActionDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActionDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ActionDialog/ActionDialog.tsx"],"names":[],"mappings":"AASA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,KAAK,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE,iBAAiB,2CAiDnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import CloseIcon from "@mui/icons-material/Close";
|
|
3
3
|
import Button from "@mui/material/Button";
|
|
4
4
|
import Dialog from "@mui/material/Dialog";
|
|
@@ -27,22 +27,11 @@ import Tooltip from "@mui/material/Tooltip";
|
|
|
27
27
|
* @param onClose Обработчик закрытия диалога
|
|
28
28
|
* @param onConfirm Обработчик подтверждения
|
|
29
29
|
*/
|
|
30
|
-
export default function ActionDialog({ open, fullWidth, maxWidth, title, contentText,
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
top:
|
|
37
|
-
color: theme.palette.grey[500],
|
|
38
|
-
}) },
|
|
39
|
-
React.createElement(CloseIcon, null)),
|
|
40
|
-
React.createElement(DialogContent, null,
|
|
41
|
-
typeof contentText === "string" ? (React.createElement(DialogContentText, null, contentText)) : (contentText.map((t, idx) => (React.createElement(DialogContentText, { key: idx }, t)))),
|
|
42
|
-
contentInputForm),
|
|
43
|
-
React.createElement(DialogActions, null,
|
|
44
|
-
React.createElement(Button, { color: "secondary", onClick: onClose }, cancelText),
|
|
45
|
-
React.createElement(Tooltip, { title: confirmTooltipTitle, enterDelay: 400, placement: "top" },
|
|
46
|
-
React.createElement("span", { tabIndex: 0, style: { display: "inline-block" } },
|
|
47
|
-
React.createElement(Button, { color: "primary", onClick: onConfirm, disabled: !confirmAllowed }, confirmText))))));
|
|
30
|
+
export default function ActionDialog({ open, fullWidth, maxWidth, title, contentText, cancelText, confirmText, confirmAllowed, confirmTooltipTitle, children, onClose, onConfirm, }) {
|
|
31
|
+
return (_jsxs(Dialog, { open: open, onClose: onClose, maxWidth: maxWidth, fullWidth: fullWidth, children: [_jsx(DialogTitle, { children: title }), _jsx(IconButton, { "aria-label": "close", onClick: onClose, sx: (theme) => ({
|
|
32
|
+
position: "absolute",
|
|
33
|
+
right: 8,
|
|
34
|
+
top: 8,
|
|
35
|
+
color: theme.palette.grey[500],
|
|
36
|
+
}), children: _jsx(CloseIcon, {}) }), _jsxs(DialogContent, { children: [typeof contentText === "string" ? (_jsx(DialogContentText, { children: contentText })) : (contentText.map((t, idx) => (_jsx(DialogContentText, { children: t }, idx)))), children] }), _jsxs(DialogActions, { children: [_jsx(Button, { color: "secondary", onClick: onClose, children: cancelText }), _jsx(Tooltip, { title: confirmTooltipTitle, enterDelay: 400, placement: "top", children: _jsx("span", { tabIndex: 0, style: { display: "inline-block" }, children: _jsx(Button, { color: "primary", onClick: onConfirm, disabled: !confirmAllowed, children: confirmText }) }) })] })] }));
|
|
48
37
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
1
|
import { Breakpoint } from "@mui/material";
|
|
3
2
|
/**
|
|
4
3
|
* Пропсы для компонента ActionDialog.
|
|
@@ -14,8 +13,6 @@ export default interface ActionDialogProps {
|
|
|
14
13
|
title: string;
|
|
15
14
|
/** Основной текст диалога (строка или массив строк) */
|
|
16
15
|
contentText: string | string[];
|
|
17
|
-
/** Необязательная форма или элемент ввода для отображения в диалоге */
|
|
18
|
-
contentInputForm?: ReactNode;
|
|
19
16
|
/** Текст для кнопки отмены */
|
|
20
17
|
cancelText: string;
|
|
21
18
|
/** Текст для кнопки подтверждения */
|
|
@@ -28,5 +25,6 @@ export default interface ActionDialogProps {
|
|
|
28
25
|
onConfirm(): void;
|
|
29
26
|
/** Обработчик закрытия диалога */
|
|
30
27
|
onClose(): void;
|
|
28
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
31
29
|
}
|
|
32
30
|
//# sourceMappingURL=ActionDialogProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionDialogProps.d.ts","sourceRoot":"","sources":["../../../src/components/ActionDialog/ActionDialogProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ActionDialogProps.d.ts","sourceRoot":"","sources":["../../../src/components/ActionDialog/ActionDialogProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,uBAAuB;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,cAAc,EAAE,OAAO,CAAC;IACxB,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+BAA+B;IAC/B,SAAS,IAAI,IAAI,CAAC;IAClB,kCAAkC;IAClC,OAAO,IAAI,IAAI,CAAC;IAEhB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;CAChD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default } from "./ActionDialog";
|
|
2
1
|
export * from "./ActionDialog";
|
|
3
|
-
export { default
|
|
2
|
+
export { default } from "./ActionDialog";
|
|
4
3
|
export * from "./ActionDialogProps";
|
|
4
|
+
export { type default as ActionDialogProps } from "./ActionDialogProps";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ActionDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ActionDialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,KAAK,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import ColumnSearchInputProps from "./ColumnSearchInputProps";
|
|
3
2
|
/**
|
|
4
3
|
* Компонент поля поиска для таблицы или списка.
|
|
@@ -12,5 +11,5 @@ import ColumnSearchInputProps from "./ColumnSearchInputProps";
|
|
|
12
11
|
*
|
|
13
12
|
* @returns {JSX.Element} Элемент поля поиска
|
|
14
13
|
*/
|
|
15
|
-
export default function ColumnSearchInput({ field, searchStr, onInputSearch, }: ColumnSearchInputProps):
|
|
14
|
+
export default function ColumnSearchInput({ field, searchStr, onInputSearch, }: ColumnSearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
//# sourceMappingURL=ColumnSearchInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnSearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/ColumnSearchInput/ColumnSearchInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColumnSearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/ColumnSearchInput/ColumnSearchInput.tsx"],"names":[],"mappings":"AAIA,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,KAAK,EACL,SAAS,EACT,aAAa,GACd,EAAE,sBAAsB,2CA4BxB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import SearchIcon from "@mui/icons-material/Search";
|
|
2
3
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
3
4
|
import TextField from "@mui/material/TextField";
|
|
4
|
-
import
|
|
5
|
+
import { useState } from "react";
|
|
5
6
|
/**
|
|
6
7
|
* Компонент поля поиска для таблицы или списка.
|
|
7
8
|
*
|
|
@@ -21,10 +22,9 @@ export default function ColumnSearchInput({ field, searchStr, onInputSearch, })
|
|
|
21
22
|
onInputSearch([{ field: field, search: newSearch }]);
|
|
22
23
|
setSearch(newSearch);
|
|
23
24
|
}
|
|
24
|
-
return (
|
|
25
|
+
return (_jsx(TextField, { size: "small", type: "search", value: search, onChange: handleChange, variant: "standard", fullWidth: true, slotProps: {
|
|
25
26
|
input: {
|
|
26
|
-
startAdornment: (
|
|
27
|
-
React.createElement(SearchIcon, null))),
|
|
27
|
+
startAdornment: (_jsx(InputAdornment, { position: "start", children: _jsx(SearchIcon, {}) })),
|
|
28
28
|
},
|
|
29
29
|
} }));
|
|
30
30
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default } from "./ColumnSearchInput";
|
|
2
1
|
export * from "./ColumnSearchInput";
|
|
3
|
-
export { default
|
|
2
|
+
export { default } from "./ColumnSearchInput";
|
|
4
3
|
export * from "./ColumnSearchInputProps";
|
|
4
|
+
export { type default as ColumnSearchInputProps } from "./ColumnSearchInputProps";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ColumnSearchInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ColumnSearchInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,KAAK,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import DateTimeRangePickerProps from "./DateTimeRangePickerProps";
|
|
3
1
|
import "moment/locale/ru";
|
|
4
|
-
|
|
2
|
+
import DateTimeRangePickerProps from "./DateTimeRangePickerProps";
|
|
3
|
+
export default function DateTimeRangePicker({ disableFuture, disabled, fromDatetime, toDateTime, required, error, onStartDateSet, onEndDateSet, }: DateTimeRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
//# sourceMappingURL=DateTimeRangePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimeRangePicker/DateTimeRangePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTimeRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimeRangePicker/DateTimeRangePicker.tsx"],"names":[],"mappings":"AAOA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,KAAK,EACL,cAAc,EACd,YAAY,GACb,EAAE,wBAAwB,2CAmF1B"}
|
|
@@ -1,51 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import moment from "moment-timezone";
|
|
3
|
-
import "moment/locale/ru";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
2
|
import Stack from "@mui/material/Stack";
|
|
5
3
|
import { DesktopDateTimePicker, LocalizationProvider, } from "@mui/x-date-pickers";
|
|
6
4
|
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
|
|
7
|
-
import
|
|
5
|
+
import moment from "moment-timezone";
|
|
6
|
+
import "moment/locale/ru";
|
|
7
|
+
import { useState } from "react";
|
|
8
8
|
export default function DateTimeRangePicker({ disableFuture, disabled, fromDatetime, toDateTime, required, error, onStartDateSet, onEndDateSet, }) {
|
|
9
9
|
const [fromDatetimePickerOpen, setFromDatetimePickerOpen] = useState(false);
|
|
10
10
|
const [toDatetimePickerOpen, setToDatetimePickerOpen] = useState(false);
|
|
11
11
|
const fromDttm = fromDatetime.length > 0 ? moment(fromDatetime) : null;
|
|
12
12
|
const toDttm = toDateTime.length > 0 ? moment(toDateTime) : null;
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
position: "start",
|
|
49
|
-
},
|
|
50
|
-
}, onClose: () => setToDatetimePickerOpen(false) }))));
|
|
13
|
+
return (_jsx(LocalizationProvider, { dateAdapter: AdapterMoment, adapterLocale: "ru", dateLibInstance: moment, children: _jsxs(Stack, { direction: "row", sx: { m: 2 }, spacing: 2, children: [_jsx(DesktopDateTimePicker, { disabled: disabled, open: fromDatetimePickerOpen, reduceAnimations: true, onChange: (v, _c) => {
|
|
14
|
+
onStartDateSet((v && v.toISOString(true)) || "");
|
|
15
|
+
}, disableFuture: disableFuture, views: ["year", "month", "day", "hours", "minutes", "seconds"], timezone: "Europe/Moscow", ampm: false, ampmInClock: false, value: fromDttm, timeSteps: { hours: 1, minutes: 1, seconds: 1 }, slotProps: {
|
|
16
|
+
field: {
|
|
17
|
+
clearable: true,
|
|
18
|
+
},
|
|
19
|
+
textField: {
|
|
20
|
+
label: "С",
|
|
21
|
+
variant: "standard",
|
|
22
|
+
required: required,
|
|
23
|
+
helperText: required && fromDttm == null && "Введите дату начала интервала",
|
|
24
|
+
error: error || (required && toDttm == null),
|
|
25
|
+
},
|
|
26
|
+
inputAdornment: {
|
|
27
|
+
position: "start",
|
|
28
|
+
onClick: () => setFromDatetimePickerOpen(true),
|
|
29
|
+
},
|
|
30
|
+
}, onClose: () => setFromDatetimePickerOpen(false) }), _jsx(DesktopDateTimePicker, { disabled: disabled, open: toDatetimePickerOpen, reduceAnimations: true, onChange: (v, _c) => {
|
|
31
|
+
onEndDateSet((v && v.toISOString(true)) || "");
|
|
32
|
+
}, disableFuture: disableFuture, views: ["year", "month", "day", "hours", "minutes", "seconds"], timezone: "Europe/Moscow", ampm: false, ampmInClock: false, timeSteps: { hours: 1, minutes: 1, seconds: 1 }, value: toDttm, slotProps: {
|
|
33
|
+
field: {
|
|
34
|
+
clearable: true,
|
|
35
|
+
},
|
|
36
|
+
textField: {
|
|
37
|
+
label: "По",
|
|
38
|
+
variant: "standard",
|
|
39
|
+
required: required,
|
|
40
|
+
helperText: required && toDttm == null && "Введите дату конца интервала",
|
|
41
|
+
error: error || (required && toDttm == null),
|
|
42
|
+
},
|
|
43
|
+
inputAdornment: {
|
|
44
|
+
onClick: () => setToDatetimePickerOpen(true),
|
|
45
|
+
position: "start",
|
|
46
|
+
},
|
|
47
|
+
}, onClose: () => setToDatetimePickerOpen(false) })] }) }));
|
|
51
48
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default } from "./DateTimeRangePicker";
|
|
2
1
|
export * from "./DateTimeRangePicker";
|
|
3
|
-
export { default
|
|
2
|
+
export { default } from "./DateTimeRangePicker";
|
|
4
3
|
export * from "./DateTimeRangePickerProps";
|
|
4
|
+
export { type default as DateTimeRangePickerProps } from "./DateTimeRangePickerProps";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimeRangePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimeRangePicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,KAAK,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatetimeRangeInput.d.ts","sourceRoot":"","sources":["../../../src/components/DatetimeRangeInput/DatetimeRangeInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatetimeRangeInput.d.ts","sourceRoot":"","sources":["../../../src/components/DatetimeRangeInput/DatetimeRangeInput.tsx"],"names":[],"mappings":"AAOA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAoC,MAAM,OAAO,CAAC;AAE9D,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAKhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,cAAc,EACd,IAAI,EACJ,EAAE,EACF,OAAO,EACP,EAAE,EACF,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAiHvC"}
|