@snack-uikit/fields 0.19.0 → 0.19.2

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 (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +406 -31
  3. package/dist/components/FieldDate/FieldDate.js +4 -2
  4. package/dist/components/FieldDecorator/FieldDecorator.d.ts +1 -1
  5. package/dist/components/FieldDecorator/FieldDecorator.js +4 -3
  6. package/dist/components/FieldSecure/FieldSecure.js +3 -1
  7. package/dist/components/FieldSelect/FieldSelectMultiple.d.ts +2 -2
  8. package/dist/components/FieldSelect/FieldSelectMultiple.js +4 -2
  9. package/dist/components/FieldSelect/FieldSelectSingle.d.ts +2 -2
  10. package/dist/components/FieldSelect/FieldSelectSingle.js +4 -2
  11. package/dist/components/FieldSelect/types.d.ts +2 -2
  12. package/dist/components/FieldSlider/FieldSlider.js +63 -19
  13. package/dist/components/FieldSlider/helpers/getClosestMark.d.ts +2 -2
  14. package/dist/components/FieldSlider/helpers/getClosestMark.js +3 -3
  15. package/dist/components/FieldSlider/helpers/index.d.ts +1 -0
  16. package/dist/components/FieldSlider/helpers/index.js +1 -0
  17. package/dist/components/FieldSlider/helpers/isMarkObject.d.ts +8 -0
  18. package/dist/components/FieldSlider/helpers/isMarkObject.js +3 -0
  19. package/dist/components/FieldStepper/FieldStepper.js +3 -1
  20. package/dist/components/FieldText/FieldText.js +3 -1
  21. package/dist/components/FieldTextArea/FieldTextArea.js +3 -1
  22. package/dist/utils/getValidationState.d.ts +5 -0
  23. package/dist/utils/getValidationState.js +4 -0
  24. package/package.json +5 -5
  25. package/src/components/FieldDate/FieldDate.tsx +4 -2
  26. package/src/components/FieldDecorator/FieldDecorator.tsx +4 -3
  27. package/src/components/FieldSecure/FieldSecure.tsx +5 -2
  28. package/src/components/FieldSelect/FieldSelectMultiple.tsx +5 -2
  29. package/src/components/FieldSelect/FieldSelectSingle.tsx +5 -2
  30. package/src/components/FieldSelect/types.ts +2 -2
  31. package/src/components/FieldSlider/FieldSlider.tsx +93 -19
  32. package/src/components/FieldSlider/helpers/getClosestMark.ts +7 -3
  33. package/src/components/FieldSlider/helpers/index.ts +1 -0
  34. package/src/components/FieldSlider/helpers/isMarkObject.ts +13 -0
  35. package/src/components/FieldStepper/FieldStepper.tsx +5 -2
  36. package/src/components/FieldText/FieldText.tsx +4 -2
  37. package/src/components/FieldTextArea/FieldTextArea.tsx +5 -2
  38. package/src/utils/getValidationState.ts +6 -0
package/README.md CHANGED
@@ -163,56 +163,431 @@ const [isOpen, setIsOpen] = useState(false);
163
163
 
164
164
  [//]: DOCUMENTATION_SECTION_START
165
165
  [//]: THIS_SECTION_IS_AUTOGENERATED_PLEASE_DONT_EDIT_IT
166
+
166
167
  ## FieldDecorator
168
+
167
169
  ### Props
168
- | name | type | default value | description |
169
- |------|------|---------------|-------------|
170
+
171
+ | name | type | default value | description |
172
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ----------------------------------------------------------------------------- |
173
+ | children\* | `ReactNode` | - | Контент |
174
+ | className | `string` | - | CSS-класс |
175
+ | disabled | `boolean` | - | Деактивирован ли элемент Является ли поле деактивированным |
176
+ | readonly | `boolean` | - | Является ли поле доступным только на чтение Доступно ли поле только на чтение |
177
+ | error | `string` | - | |
178
+ | label | `string` | - | Лейбл |
179
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
180
+ | labelFor | `string` | - | Аттрибут for |
181
+ | required | `boolean` | - | Является ли поле обязательным |
182
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
183
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
184
+ | length | `{ current: number; max?: number; }` | - | Допустимая длинна текста |
185
+ | hint | `string` | - | Подсказка внизу |
186
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | - | Состояние валидации |
187
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
188
+
170
189
  ## FieldText
190
+
171
191
  ### Props
172
- | name | type | default value | description |
173
- |------|------|---------------|-------------|
174
- | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
175
- | key | `Key` | - | |
192
+
193
+ | name | type | default value | description |
194
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
195
+ | showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
196
+ | showClearButton | `boolean` | true | Отображение кнопки очистки поля |
197
+ | allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
198
+ | prefixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-префикс для поля |
199
+ | value | `string` | - | Значение input |
200
+ | onChange | `(value: string, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
201
+ | disabled | `boolean` | - | Является ли поле деактивированным |
202
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
203
+ | id | `string` | - | Значение html-атрибута id |
204
+ | name | `string` | - | Значение html-атрибута name |
205
+ | placeholder | `string` | - | Значение плейсхолдера |
206
+ | maxLength | `number` | - | Максимальная длина вводимого значения |
207
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
208
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
209
+ | error | `string` | - | |
210
+ | className | `string` | - | CSS-класс |
211
+ | label | `string` | - | Лейбл |
212
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
213
+ | required | `boolean` | - | Является ли поле обязательным |
214
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
215
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
216
+ | hint | `string` | - | Подсказка внизу |
217
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
218
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
219
+ | showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
220
+ | showClearButton | `boolean` | true | Отображение кнопки очистки поля |
221
+ | allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
222
+ | prefixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-префикс для поля |
223
+ | value | `string` | - | Значение input |
224
+ | onChange | `(value: string, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
225
+ | disabled | `boolean` | - | Является ли поле деактивированным |
226
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
227
+ | id | `string` | - | Значение html-атрибута id |
228
+ | name | `string` | - | Значение html-атрибута name |
229
+ | placeholder | `string` | - | Значение плейсхолдера |
230
+ | maxLength | `number` | - | Максимальная длина вводимого значения |
231
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
232
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
233
+ | error | `string` | - | |
234
+ | className | `string` | - | CSS-класс |
235
+ | label | `string` | - | Лейбл |
236
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
237
+ | required | `boolean` | - | Является ли поле обязательным |
238
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
239
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
240
+ | hint | `string` | - | Подсказка внизу |
241
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
242
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
243
+ | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
244
+ | key | `Key` | - | |
245
+
176
246
  ## FieldTextArea
247
+
177
248
  ### Props
178
- | name | type | default value | description |
179
- |------|------|---------------|-------------|
180
- | ref | `Ref<HTMLTextAreaElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
181
- | key | `Key` | - | |
249
+
250
+ | name | type | default value | description |
251
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
252
+ | maxRows | `number` | - | Максимальное кол-во строк, до которого размер поля может быть увеличен |
253
+ | resizable | `boolean` | - | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
254
+ | onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
255
+ | showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
256
+ | showClearButton | `boolean` | true | Отображение кнопки очистки поля |
257
+ | allowMoreThanMaxLength | `boolean` | true | Можно ли вводить больше разрешённого кол-ва символов |
258
+ | value | `string` | - | HTML-аттрибут value |
259
+ | disabled | `boolean` | - | Является ли поле деактивированным |
260
+ | readonly | `boolean` | - | Является ли поле доступным только на чтение |
261
+ | id | `string` | - | HTML-аттрибут id |
262
+ | name | `string` | - | HTML-аттрибут name |
263
+ | placeholder | `string` | - | Плейсхолдер |
264
+ | maxLength | `number` | - | Максимальное кол-во символов |
265
+ | onFocus | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек получения фокуса |
266
+ | onBlur | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек потери фокуса |
267
+ | error | `string` | - | |
268
+ | className | `string` | - | CSS-класс |
269
+ | label | `string` | - | Лейбл |
270
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
271
+ | required | `boolean` | - | Является ли поле обязательным |
272
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
273
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
274
+ | hint | `string` | - | Подсказка внизу |
275
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
276
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
277
+ | maxRows | `number` | - | Максимальное кол-во строк, до которого размер поля может быть увеличен |
278
+ | resizable | `boolean` | - | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
279
+ | onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
280
+ | showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
281
+ | showClearButton | `boolean` | true | Отображение кнопки очистки поля |
282
+ | allowMoreThanMaxLength | `boolean` | true | Можно ли вводить больше разрешённого кол-ва символов |
283
+ | value | `string` | - | HTML-аттрибут value |
284
+ | disabled | `boolean` | - | Является ли поле деактивированным |
285
+ | readonly | `boolean` | - | Является ли поле доступным только на чтение |
286
+ | id | `string` | - | HTML-аттрибут id |
287
+ | name | `string` | - | HTML-аттрибут name |
288
+ | placeholder | `string` | - | Плейсхолдер |
289
+ | maxLength | `number` | - | Максимальное кол-во символов |
290
+ | onFocus | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек получения фокуса |
291
+ | onBlur | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек потери фокуса |
292
+ | error | `string` | - | |
293
+ | className | `string` | - | CSS-класс |
294
+ | label | `string` | - | Лейбл |
295
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
296
+ | required | `boolean` | - | Является ли поле обязательным |
297
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
298
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
299
+ | hint | `string` | - | Подсказка внизу |
300
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
301
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
302
+ | ref | `Ref<HTMLTextAreaElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
303
+ | key | `Key` | - | |
304
+
182
305
  ## FieldSecure
306
+
183
307
  ### Props
184
- | name | type | default value | description |
185
- |------|------|---------------|-------------|
186
- | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
187
- | key | `Key` | - | |
308
+
309
+ | name | type | default value | description |
310
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
311
+ | hidden | `boolean` | - | Замаскированно ли значение поля |
312
+ | onHiddenChange | `(value: boolean) => void` | - | Колбек смены маскирования |
313
+ | showCopyButton | `boolean` | - | Отображение кнопки копирования |
314
+ | allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
315
+ | prefixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-префикс для поля |
316
+ | value | `string` | - | Значение input |
317
+ | onChange | `(value: string, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
318
+ | disabled | `boolean` | - | Является ли поле деактивированным |
319
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
320
+ | id | `string` | - | Значение html-атрибута id |
321
+ | name | `string` | - | Значение html-атрибута name |
322
+ | placeholder | `string` | - | Значение плейсхолдера |
323
+ | maxLength | `number` | - | Максимальная длина вводимого значения |
324
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
325
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
326
+ | error | `string` | - | |
327
+ | className | `string` | - | CSS-класс |
328
+ | label | `string` | - | Лейбл |
329
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
330
+ | required | `boolean` | - | Является ли поле обязательным |
331
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
332
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
333
+ | hint | `string` | - | Подсказка внизу |
334
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
335
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
336
+ | hidden | `boolean` | - | Замаскированно ли значение поля |
337
+ | onHiddenChange | `(value: boolean) => void` | - | Колбек смены маскирования |
338
+ | showCopyButton | `boolean` | - | Отображение кнопки копирования |
339
+ | allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
340
+ | prefixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-префикс для поля |
341
+ | value | `string` | - | Значение input |
342
+ | onChange | `(value: string, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
343
+ | disabled | `boolean` | - | Является ли поле деактивированным |
344
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
345
+ | id | `string` | - | Значение html-атрибута id |
346
+ | name | `string` | - | Значение html-атрибута name |
347
+ | placeholder | `string` | - | Значение плейсхолдера |
348
+ | maxLength | `number` | - | Максимальная длина вводимого значения |
349
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
350
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
351
+ | error | `string` | - | |
352
+ | className | `string` | - | CSS-класс |
353
+ | label | `string` | - | Лейбл |
354
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
355
+ | required | `boolean` | - | Является ли поле обязательным |
356
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
357
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
358
+ | hint | `string` | - | Подсказка внизу |
359
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
360
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
361
+ | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
362
+ | key | `Key` | - | |
363
+
188
364
  ## parseDate
189
- `helper`
365
+
366
+ `helper`
190
367
 
191
368
  Преобразует строковое значение поля FieldDate в тип Date
369
+
192
370
  ## FieldDate
371
+
193
372
  ### Props
194
- | name | type | default value | description |
195
- |------|------|---------------|-------------|
196
- | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
197
- | key | `Key` | - | |
373
+
374
+ | name | type | default value | description |
375
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
376
+ | value\* | `string` | - | Значение input |
377
+ | open | `boolean` | - | Открыт date-picker |
378
+ | onOpenChange | `(value: boolean) => void` | - | Колбек открытия пикера |
379
+ | onChange | `(value: string) => void` | - | Колбек смены значения |
380
+ | showCopyButton | `boolean` | - | Отображение кнопки копирования |
381
+ | showClearButton | `boolean` | true | Отображение кнопки Очистки поля |
382
+ | locale | `Locale` | new Intl.Locale('ru-RU') | Текущая локаль календаря |
383
+ | buildCellProps | `(date: Date, viewMode: ViewMode) => { isDisabled?: boolean; isHoliday?: boolean };` | - | Колбек установки свойств ячеек календаря. Вызывается на построение каждой ячейки. Принимает два параметра: <br> `Date` - дата ячейки <br> `ViewMode`: <br> - `month` отображение месяца, каждая ячейка - 1 день <br> - `year` отображение года, каждая ячейка - 1 месяц <br> - `decade` отображение декады, каждая ячейка - 1 год <br><br> Колбек должен возвращать объект с полями, отвечающими за отключение и подкраску ячейки. |
384
+ | disabled | `boolean` | - | Является ли поле деактивированным |
385
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
386
+ | id | `string` | - | Значение html-атрибута id |
387
+ | name | `string` | - | Значение html-атрибута name |
388
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
389
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
390
+ | error | `string` | - | |
391
+ | className | `string` | - | CSS-класс |
392
+ | label | `string` | - | Лейбл |
393
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
394
+ | required | `boolean` | - | Является ли поле обязательным |
395
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
396
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
397
+ | hint | `string` | - | Подсказка внизу |
398
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
399
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
400
+ | value\* | `string` | - | Значение input |
401
+ | open | `boolean` | - | Открыт date-picker |
402
+ | onOpenChange | `(value: boolean) => void` | - | Колбек открытия пикера |
403
+ | onChange | `(value: string) => void` | - | Колбек смены значения |
404
+ | showCopyButton | `boolean` | - | Отображение кнопки копирования |
405
+ | showClearButton | `boolean` | true | Отображение кнопки Очистки поля |
406
+ | locale | `Locale` | new Intl.Locale('ru-RU') | Текущая локаль календаря |
407
+ | buildCellProps | `(date: Date, viewMode: ViewMode) => { isDisabled?: boolean; isHoliday?: boolean };` | - | Колбек установки свойств ячеек календаря. Вызывается на построение каждой ячейки. Принимает два параметра: <br> `Date` - дата ячейки <br> `ViewMode`: <br> - `month` отображение месяца, каждая ячейка - 1 день <br> - `year` отображение года, каждая ячейка - 1 месяц <br> - `decade` отображение декады, каждая ячейка - 1 год <br><br> Колбек должен возвращать объект с полями, отвечающими за отключение и подкраску ячейки. |
408
+ | disabled | `boolean` | - | Является ли поле деактивированным |
409
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
410
+ | id | `string` | - | Значение html-атрибута id |
411
+ | name | `string` | - | Значение html-атрибута name |
412
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
413
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
414
+ | error | `string` | - | |
415
+ | className | `string` | - | CSS-класс |
416
+ | label | `string` | - | Лейбл |
417
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
418
+ | required | `boolean` | - | Является ли поле обязательным |
419
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
420
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
421
+ | hint | `string` | - | Подсказка внизу |
422
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
423
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
424
+ | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
425
+ | key | `Key` | - | |
426
+
198
427
  ## FieldSelect
428
+
199
429
  ### Props
200
- | name | type | default value | description |
201
- |------|------|---------------|-------------|
202
- | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
203
- | key | `Key` | - | |
430
+
431
+ | name | type | default value | description |
432
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
433
+ | options\* | `OptionProps[]` | - | |
434
+ | disabled | `boolean` | false | Является ли поле деактивированным |
435
+ | readonly | `boolean` | false false | Является ли поле доступным только для чтения |
436
+ | id | `string` | - | Значение html-атрибута id |
437
+ | name | `string` | - | Значение html-атрибута name |
438
+ | placeholder | `string` | - | Значение плейсхолдера |
439
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
440
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
441
+ | onKeyDown | `KeyboardEventHandler<HTMLInputElement>` | - | Колбек обработки нажатия клавиши клавиатуры |
442
+ | error | `string` | - | |
443
+ | className | `string` | - | CSS-класс |
444
+ | label | `string` | - | Лейбл |
445
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
446
+ | required | `boolean` | - | Является ли поле обязательным |
447
+ | size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
448
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
449
+ | hint | `string` | - | Подсказка внизу |
450
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | - | Состояние валидации |
451
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
452
+ | loading | `boolean` | - | |
453
+ | value | `ItemId \| ItemId[]` | - | Controlled состояние |
454
+ | onChange | `OnChangeHandler<any>` | - | Controlled обработчик измения состояния |
455
+ | defaultValue | `ItemId \| ItemId[]` | - | Начальное состояние |
456
+ | pinTop | `OptionProps[]` | - | |
457
+ | pinBottom | `OptionProps[]` | - | |
458
+ | searchable | `boolean` | - | |
459
+ | showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
460
+ | showClearButton | `boolean` | true | Отображение кнопки очистки поля |
461
+ | prefixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-префикс для поля |
462
+ | footer | `ReactNode` | - | |
463
+ | widthStrategy | enum PopoverWidthStrategy: `"auto"`, `"gte"`, `"eq"` | - | |
464
+ | search | `SearchState` | - | |
465
+ | autocomplete | `boolean` | - | |
466
+ | addOptionByEnter | `boolean` | - | |
467
+ | open | `boolean` | - | |
468
+ | onOpenChange | `(open: boolean) => void` | - | |
469
+ | selectedOptionFormatter | `SelectedOptionFormatter` | - | |
470
+ | dataFiltered | `boolean` | - | |
471
+ | dataError | `boolean` | - | |
472
+ | noDataState | `EmptyStateProps` | - | Экран при отстутствии данных |
473
+ | noResultsState | `EmptyStateProps` | - | Экран при отстутствии результатов поиска или фильтров |
474
+ | errorDataState | `EmptyStateProps` | - | Экран при ошибке запроса |
475
+ | selection | "single" \| "multiple" | - | |
476
+ | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
477
+ | key | `Key` | - | |
478
+ | removeByBackspace | `boolean` | - | |
479
+ | removeByBackspace | `boolean` | - | |
480
+
204
481
  ## FieldStepper
482
+
205
483
  ### Props
206
- | name | type | default value | description |
207
- |------|------|---------------|-------------|
208
- | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
209
- | key | `Key` | - | |
484
+
485
+ | name | type | default value | description |
486
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
487
+ | value | `number` | - | Значение поля |
488
+ | onChange | `(value: number, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
489
+ | step | `number` | 1 | Шаг поля |
490
+ | allowMoreThanLimits | `boolean` | true | Можно ли вводить c клавиатуры числа, выходящие за пределы min/max |
491
+ | disabled | `boolean` | - | Является ли поле деактивированным |
492
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
493
+ | id | `string` | - | Значение html-атрибута id |
494
+ | name | `string` | - | Значение html-атрибута name |
495
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
496
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
497
+ | min | `number` | Number.NEGATIVE_INFINITY | Минимальное значение поля |
498
+ | max | `number` | Number.POSITIVE_INFINITY | Максимальное значение поля |
499
+ | error | `string` | - | |
500
+ | className | `string` | - | CSS-класс |
501
+ | label | `string` | - | Лейбл |
502
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
503
+ | required | `boolean` | - | Является ли поле обязательным |
504
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
505
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
506
+ | hint | `string` | - | Подсказка внизу |
507
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
508
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
509
+ | value | `number` | - | Значение поля |
510
+ | onChange | `(value: number, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
511
+ | step | `number` | 1 | Шаг поля |
512
+ | allowMoreThanLimits | `boolean` | true | Можно ли вводить c клавиатуры числа, выходящие за пределы min/max |
513
+ | disabled | `boolean` | - | Является ли поле деактивированным |
514
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
515
+ | id | `string` | - | Значение html-атрибута id |
516
+ | name | `string` | - | Значение html-атрибута name |
517
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
518
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
519
+ | min | `number` | Number.NEGATIVE_INFINITY | Минимальное значение поля |
520
+ | max | `number` | Number.POSITIVE_INFINITY | Максимальное значение поля |
521
+ | error | `string` | - | |
522
+ | className | `string` | - | CSS-класс |
523
+ | label | `string` | - | Лейбл |
524
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
525
+ | required | `boolean` | - | Является ли поле обязательным |
526
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
527
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
528
+ | hint | `string` | - | Подсказка внизу |
529
+ | validationState | enum ValidationState: `"default"`, `"error"`, `"warning"`, `"success"` | default | Состояние валидации |
530
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
531
+ | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
532
+ | key | `Key` | - | |
533
+
210
534
  ## FieldSlider
535
+
211
536
  ### Props
212
- | name | type | default value | description |
213
- |------|------|---------------|-------------|
214
- | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
215
- | key | `Key` | - | |
216
537
 
538
+ | name | type | default value | description |
539
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
540
+ | postfixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-постфикс для поля |
541
+ | showScaleBar | `boolean` | true | Отображение линейки |
542
+ | textInputFormatter | `TextInputFormatter` | - | Функция для форматирования значений в текстовом поле |
543
+ | disabled | `boolean` | - | Является ли поле деактивированным |
544
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
545
+ | id | `string` | - | Значение html-атрибута id |
546
+ | name | `string` | - | Значение html-атрибута name |
547
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
548
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
549
+ | value | `number \| number[]` | - | |
550
+ | onChange | `(value: number \| number[]) => void` | - | |
551
+ | range | `boolean` | - | |
552
+ | tipFormatter | `(value: string \| number) => ReactNode` | - | |
553
+ | step | `number` | - | |
554
+ | min | `number` | - | |
555
+ | max | `number` | - | |
556
+ | marks | `Record<string \| number, ReactNode \| MarkObj>` | - | |
557
+ | className | `string` | - | CSS-класс |
558
+ | label | `string` | - | Лейбл |
559
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
560
+ | required | `boolean` | - | Является ли поле обязательным |
561
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
562
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
563
+ | hint | `string` | - | Подсказка внизу |
564
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
565
+ | postfixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-постфикс для поля |
566
+ | showScaleBar | `boolean` | true | Отображение линейки |
567
+ | textInputFormatter | `TextInputFormatter` | - | Функция для форматирования значений в текстовом поле |
568
+ | disabled | `boolean` | - | Является ли поле деактивированным |
569
+ | readonly | `boolean` | - | Является ли поле доступным только для чтения |
570
+ | id | `string` | - | Значение html-атрибута id |
571
+ | name | `string` | - | Значение html-атрибута name |
572
+ | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
573
+ | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
574
+ | value | `number \| number[]` | - | |
575
+ | onChange | `(value: number \| number[]) => void` | - | |
576
+ | range | `boolean` | - | |
577
+ | tipFormatter | `(value: string \| number) => ReactNode` | - | |
578
+ | step | `number` | - | |
579
+ | min | `number` | - | |
580
+ | max | `number` | - | |
581
+ | marks | `Record<string \| number, ReactNode \| MarkObj>` | - | |
582
+ | className | `string` | - | CSS-класс |
583
+ | label | `string` | - | Лейбл |
584
+ | labelTooltip | `string` | - | Всплывающая подсказка лейбла |
585
+ | required | `boolean` | - | Является ли поле обязательным |
586
+ | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
587
+ | labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
588
+ | hint | `string` | - | Подсказка внизу |
589
+ | showHintIcon | `boolean` | - | Отображать иконку подсказки |
590
+ | ref | `Ref<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
591
+ | key | `Key` | - | |
217
592
 
218
593
  [//]: DOCUMENTATION_SECTION_END