@cloud-ru/uikit-product-fields-predefined 2.4.8-preview-68cf2382.0 → 2.4.8-preview-df188565.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 +319 -12
- package/dist/cjs/components/FieldAi/FieldAi.d.ts +24 -0
- package/dist/cjs/components/FieldAi/FieldAi.js +92 -0
- package/dist/cjs/components/FieldAi/components/AlertButton/AlertButton.d.ts +5 -0
- package/dist/cjs/components/FieldAi/components/AlertButton/AlertButton.js +12 -0
- package/dist/cjs/components/FieldAi/components/AlertButton/index.d.ts +1 -0
- package/dist/cjs/components/FieldAi/components/AlertButton/index.js +17 -0
- package/dist/cjs/components/FieldAi/components/AlertButton/styles.module.css +17 -0
- package/dist/cjs/components/FieldAi/components/CheckItem/CheckItem.d.ts +9 -0
- package/dist/cjs/components/FieldAi/components/CheckItem/CheckItem.js +28 -0
- package/dist/cjs/components/FieldAi/components/CheckItem/index.d.ts +1 -0
- package/dist/cjs/components/FieldAi/components/CheckItem/index.js +17 -0
- package/dist/cjs/components/FieldAi/components/CheckItem/styles.module.css +36 -0
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/MobileFieldAi.d.ts +5 -0
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/MobileFieldAi.js +31 -0
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/index.d.ts +1 -0
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/index.js +17 -0
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/styles.module.css +78 -0
- package/dist/cjs/components/FieldAi/components/PasswordValidation/PasswordValidation.d.ts +7 -0
- package/dist/cjs/components/FieldAi/components/PasswordValidation/PasswordValidation.js +23 -0
- package/dist/cjs/components/FieldAi/components/PasswordValidation/index.d.ts +1 -0
- package/dist/cjs/components/FieldAi/components/PasswordValidation/index.js +17 -0
- package/dist/cjs/components/FieldAi/components/PasswordValidation/styles.module.css +36 -0
- package/dist/cjs/components/FieldAi/components/TextArea/TextArea.d.ts +39 -0
- package/dist/cjs/components/FieldAi/components/TextArea/TextArea.js +33 -0
- package/dist/cjs/components/FieldAi/components/TextArea/index.d.ts +1 -0
- package/dist/cjs/components/FieldAi/components/TextArea/index.js +17 -0
- package/dist/cjs/components/FieldAi/components/TextArea/styles.module.css +32 -0
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts +10 -0
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js +23 -0
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/index.d.ts +1 -0
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/index.js +17 -0
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/styles.module.css +6 -0
- package/dist/cjs/components/FieldAi/index.d.ts +1 -0
- package/dist/cjs/components/FieldAi/index.js +17 -0
- package/dist/cjs/components/FieldAi/styles.module.css +61 -0
- package/dist/cjs/components/FieldAi/utils.d.ts +10 -0
- package/dist/cjs/components/FieldAi/utils.js +19 -0
- package/dist/cjs/components/FieldCode/FieldCode.d.ts +42 -0
- package/dist/cjs/components/FieldCode/FieldCode.js +47 -0
- package/dist/cjs/components/FieldCode/components/Cell/Cell.d.ts +5 -0
- package/dist/cjs/components/FieldCode/components/Cell/Cell.js +27 -0
- package/dist/cjs/components/FieldCode/components/Cell/index.d.ts +1 -0
- package/dist/cjs/components/FieldCode/components/Cell/index.js +17 -0
- package/dist/cjs/components/FieldCode/components/Cell/styles.module.css +3 -0
- package/dist/cjs/components/FieldCode/components/ResendCode/ResendCode.d.ts +8 -0
- package/dist/cjs/components/FieldCode/components/ResendCode/ResendCode.js +28 -0
- package/dist/cjs/components/FieldCode/components/ResendCode/index.d.ts +1 -0
- package/dist/cjs/components/FieldCode/components/ResendCode/index.js +17 -0
- package/dist/cjs/components/FieldCode/components/ResendCode/utils.d.ts +1 -0
- package/dist/cjs/components/FieldCode/components/ResendCode/utils.js +8 -0
- package/dist/cjs/components/FieldCode/components/index.d.ts +2 -0
- package/dist/cjs/components/FieldCode/components/index.js +18 -0
- package/dist/cjs/components/FieldCode/constants.d.ts +14 -0
- package/dist/cjs/components/FieldCode/constants.js +10 -0
- package/dist/cjs/components/FieldCode/hooks/index.d.ts +3 -0
- package/dist/cjs/components/FieldCode/hooks/index.js +19 -0
- package/dist/cjs/components/FieldCode/hooks/useCodeInput.d.ts +22 -0
- package/dist/cjs/components/FieldCode/hooks/useCodeInput.js +98 -0
- package/dist/cjs/components/FieldCode/hooks/useFieldHelpers.d.ts +13 -0
- package/dist/cjs/components/FieldCode/hooks/useFieldHelpers.js +34 -0
- package/dist/cjs/components/FieldCode/hooks/useFocusCell.d.ts +5 -0
- package/dist/cjs/components/FieldCode/hooks/useFocusCell.js +22 -0
- package/dist/cjs/components/FieldCode/index.d.ts +1 -0
- package/dist/cjs/components/FieldCode/index.js +17 -0
- package/dist/cjs/components/FieldCode/styles.module.css +30 -0
- package/dist/cjs/components/FieldCode/utils.d.ts +6 -0
- package/dist/cjs/components/FieldCode/utils.js +21 -0
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/components/index.js +2 -0
- package/dist/esm/components/FieldAi/FieldAi.d.ts +24 -0
- package/dist/esm/components/FieldAi/FieldAi.js +86 -0
- package/dist/esm/components/FieldAi/components/AlertButton/AlertButton.d.ts +5 -0
- package/dist/esm/components/FieldAi/components/AlertButton/AlertButton.js +6 -0
- package/dist/esm/components/FieldAi/components/AlertButton/index.d.ts +1 -0
- package/dist/esm/components/FieldAi/components/AlertButton/index.js +1 -0
- package/dist/esm/components/FieldAi/components/AlertButton/styles.module.css +17 -0
- package/dist/esm/components/FieldAi/components/CheckItem/CheckItem.d.ts +9 -0
- package/dist/esm/components/FieldAi/components/CheckItem/CheckItem.js +22 -0
- package/dist/esm/components/FieldAi/components/CheckItem/index.d.ts +1 -0
- package/dist/esm/components/FieldAi/components/CheckItem/index.js +1 -0
- package/dist/esm/components/FieldAi/components/CheckItem/styles.module.css +36 -0
- package/dist/esm/components/FieldAi/components/MobileFieldAi/MobileFieldAi.d.ts +5 -0
- package/dist/esm/components/FieldAi/components/MobileFieldAi/MobileFieldAi.js +25 -0
- package/dist/esm/components/FieldAi/components/MobileFieldAi/index.d.ts +1 -0
- package/dist/esm/components/FieldAi/components/MobileFieldAi/index.js +1 -0
- package/dist/esm/components/FieldAi/components/MobileFieldAi/styles.module.css +78 -0
- package/dist/esm/components/FieldAi/components/PasswordValidation/PasswordValidation.d.ts +7 -0
- package/dist/esm/components/FieldAi/components/PasswordValidation/PasswordValidation.js +17 -0
- package/dist/esm/components/FieldAi/components/PasswordValidation/index.d.ts +1 -0
- package/dist/esm/components/FieldAi/components/PasswordValidation/index.js +1 -0
- package/dist/esm/components/FieldAi/components/PasswordValidation/styles.module.css +36 -0
- package/dist/esm/components/FieldAi/components/TextArea/TextArea.d.ts +39 -0
- package/dist/esm/components/FieldAi/components/TextArea/TextArea.js +27 -0
- package/dist/esm/components/FieldAi/components/TextArea/index.d.ts +1 -0
- package/dist/esm/components/FieldAi/components/TextArea/index.js +1 -0
- package/dist/esm/components/FieldAi/components/TextArea/styles.module.css +32 -0
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts +10 -0
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js +17 -0
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/index.d.ts +1 -0
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/index.js +1 -0
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/styles.module.css +6 -0
- package/dist/esm/components/FieldAi/index.d.ts +1 -0
- package/dist/esm/components/FieldAi/index.js +1 -0
- package/dist/esm/components/FieldAi/styles.module.css +61 -0
- package/dist/esm/components/FieldAi/utils.d.ts +10 -0
- package/dist/esm/components/FieldAi/utils.js +15 -0
- package/dist/esm/components/FieldCode/FieldCode.d.ts +42 -0
- package/dist/esm/components/FieldCode/FieldCode.js +40 -0
- package/dist/esm/components/FieldCode/components/Cell/Cell.d.ts +5 -0
- package/dist/esm/components/FieldCode/components/Cell/Cell.js +21 -0
- package/dist/esm/components/FieldCode/components/Cell/index.d.ts +1 -0
- package/dist/esm/components/FieldCode/components/Cell/index.js +1 -0
- package/dist/esm/components/FieldCode/components/Cell/styles.module.css +3 -0
- package/dist/esm/components/FieldCode/components/ResendCode/ResendCode.d.ts +8 -0
- package/dist/esm/components/FieldCode/components/ResendCode/ResendCode.js +25 -0
- package/dist/esm/components/FieldCode/components/ResendCode/index.d.ts +1 -0
- package/dist/esm/components/FieldCode/components/ResendCode/index.js +1 -0
- package/dist/esm/components/FieldCode/components/ResendCode/utils.d.ts +1 -0
- package/dist/esm/components/FieldCode/components/ResendCode/utils.js +5 -0
- package/dist/esm/components/FieldCode/components/index.d.ts +2 -0
- package/dist/esm/components/FieldCode/components/index.js +2 -0
- package/dist/esm/components/FieldCode/constants.d.ts +14 -0
- package/dist/esm/components/FieldCode/constants.js +7 -0
- package/dist/esm/components/FieldCode/hooks/index.d.ts +3 -0
- package/dist/esm/components/FieldCode/hooks/index.js +3 -0
- package/dist/esm/components/FieldCode/hooks/useCodeInput.d.ts +22 -0
- package/dist/esm/components/FieldCode/hooks/useCodeInput.js +95 -0
- package/dist/esm/components/FieldCode/hooks/useFieldHelpers.d.ts +13 -0
- package/dist/esm/components/FieldCode/hooks/useFieldHelpers.js +31 -0
- package/dist/esm/components/FieldCode/hooks/useFocusCell.d.ts +5 -0
- package/dist/esm/components/FieldCode/hooks/useFocusCell.js +19 -0
- package/dist/esm/components/FieldCode/index.d.ts +1 -0
- package/dist/esm/components/FieldCode/index.js +1 -0
- package/dist/esm/components/FieldCode/styles.module.css +30 -0
- package/dist/esm/components/FieldCode/utils.d.ts +6 -0
- package/dist/esm/components/FieldCode/utils.js +13 -0
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +9 -3
- package/src/components/FieldAi/FieldAi.tsx +201 -0
- package/src/components/FieldAi/components/AlertButton/AlertButton.tsx +16 -0
- package/src/components/FieldAi/components/AlertButton/index.ts +1 -0
- package/src/components/FieldAi/components/AlertButton/styles.module.scss +20 -0
- package/src/components/FieldAi/components/CheckItem/CheckItem.tsx +45 -0
- package/src/components/FieldAi/components/CheckItem/index.ts +1 -0
- package/src/components/FieldAi/components/CheckItem/styles.module.scss +44 -0
- package/src/components/FieldAi/components/MobileFieldAi/MobileFieldAi.tsx +57 -0
- package/src/components/FieldAi/components/MobileFieldAi/index.ts +1 -0
- package/src/components/FieldAi/components/MobileFieldAi/styles.module.scss +90 -0
- package/src/components/FieldAi/components/PasswordValidation/PasswordValidation.tsx +85 -0
- package/src/components/FieldAi/components/PasswordValidation/index.ts +1 -0
- package/src/components/FieldAi/components/PasswordValidation/styles.module.scss +34 -0
- package/src/components/FieldAi/components/TextArea/TextArea.tsx +113 -0
- package/src/components/FieldAi/components/TextArea/index.ts +1 -0
- package/src/components/FieldAi/components/TextArea/styles.module.scss +35 -0
- package/src/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.tsx +63 -0
- package/src/components/FieldAi/components/WithPasswordValidation/index.ts +1 -0
- package/src/components/FieldAi/components/WithPasswordValidation/styles.module.scss +8 -0
- package/src/components/FieldAi/index.ts +1 -0
- package/src/components/FieldAi/styles.module.scss +85 -0
- package/src/components/FieldAi/utils.ts +27 -0
- package/src/components/FieldCode/FieldCode.tsx +116 -0
- package/src/components/FieldCode/components/Cell/Cell.tsx +32 -0
- package/src/components/FieldCode/components/Cell/index.ts +1 -0
- package/src/components/FieldCode/components/Cell/styles.module.scss +5 -0
- package/src/components/FieldCode/components/ResendCode/ResendCode.tsx +33 -0
- package/src/components/FieldCode/components/ResendCode/index.ts +1 -0
- package/src/components/FieldCode/components/ResendCode/utils.ts +5 -0
- package/src/components/FieldCode/components/index.ts +2 -0
- package/src/components/FieldCode/constants.ts +20 -0
- package/src/components/FieldCode/hooks/index.ts +3 -0
- package/src/components/FieldCode/hooks/useCodeInput.ts +147 -0
- package/src/components/FieldCode/hooks/useFieldHelpers.ts +52 -0
- package/src/components/FieldCode/hooks/useFocusCell.ts +29 -0
- package/src/components/FieldCode/index.ts +1 -0
- package/src/components/FieldCode/styles.module.scss +40 -0
- package/src/components/FieldCode/utils.ts +23 -0
- package/src/components/index.ts +2 -0
package/README.md
CHANGED
|
@@ -14,8 +14,42 @@
|
|
|
14
14
|
### Props
|
|
15
15
|
| name | type | default value | description |
|
|
16
16
|
|------|------|---------------|-------------|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
17
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
18
|
+
| value | `string` | - | Значение input |
|
|
19
|
+
| onChange | `((value: string, e?: ChangeEvent<HTMLInputElement>) => void) & ((value: string) => void)` | - | Колбек смены значения |
|
|
20
|
+
| id | `string` | - | Значение html-атрибута id |
|
|
21
|
+
| name | `string` | - | Значение html-атрибута name |
|
|
22
|
+
| disabled | `boolean` | false | Является ли поле деактивированным |
|
|
23
|
+
| readonly | `boolean` | false | Является ли поле доступным только для чтения |
|
|
24
|
+
| onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
|
|
25
|
+
| onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
|
|
26
|
+
| autoComplete | `string \| boolean` | false | Включен ли автокомплит для поля |
|
|
27
|
+
| autoFocus | `boolean` | false | Включен ли авто-фокус для поля |
|
|
28
|
+
| onPaste | `ClipboardEventHandler<HTMLInputElement>` | - | Колбек обработки вставки значения |
|
|
29
|
+
| spellCheck | `boolean` | true | Значение атрибута spellcheck (проверка орфографии) |
|
|
30
|
+
| pattern | `string` | - | Регулярное выражение валидного инпута |
|
|
31
|
+
| className | `string` | - | CSS-класс |
|
|
32
|
+
| label | `string` | - | Лейбл |
|
|
33
|
+
| labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
|
|
34
|
+
| required | `boolean` | - | Является ли поле обязательным |
|
|
35
|
+
| caption | `string` | - | Подпись справа от лейбла |
|
|
36
|
+
| hint | `string` | - | Подсказка внизу |
|
|
37
|
+
| showHintIcon | `boolean` | - | Отображать иконку подсказки |
|
|
38
|
+
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
39
|
+
| validationState | enum ValidationState: `"error"`, `"default"`, `"warning"`, `"success"` | - | Состояние валидации |
|
|
40
|
+
| labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
|
|
41
|
+
| error | `string` | - | |
|
|
42
|
+
| type | "text" \| "tel" \| "email" | - | |
|
|
43
|
+
| showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
|
|
44
|
+
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
45
|
+
| showClearButton | `boolean` | true | Отображение кнопки очистки поля |
|
|
46
|
+
| onClearButtonClick | `() => void` | - | Колбек клика по кнопке очистки поля |
|
|
47
|
+
| scrollList | `boolean` | - | Включить скролл для основной части списка стран |
|
|
48
|
+
| searchPlaceholder | `string` | - | |
|
|
49
|
+
| onChangeCountry | `(country: FieldPhoneOptionsProps) => void` | - | |
|
|
50
|
+
| options | `CountrySettings` | - | options — объект конфигурации для изменения стандартного списка стран |
|
|
51
|
+
| ref | `LegacyRef<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 {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|
|
52
|
+
| key | `Key` | - | |
|
|
19
53
|
## useCountries
|
|
20
54
|
### Props
|
|
21
55
|
| name | type | default value | description |
|
|
@@ -27,48 +61,321 @@
|
|
|
27
61
|
### Props
|
|
28
62
|
| name | type | default value | description |
|
|
29
63
|
|------|------|---------------|-------------|
|
|
64
|
+
| selectProps* | `FieldSelectProps` | - | Пропсы прокидываемые в селект |
|
|
65
|
+
| submitHandler* | `() => Promise<string \| void>` | - | Коллбек создания новой опции, при успешном выполнении возвращает value новой опции |
|
|
66
|
+
| entityName* | `EntityName` | - | Тип объекта для создания новой опции (в единственном числе вин.падеже для кнопки Создать <entityName> и множественном числе) |
|
|
67
|
+
| createLayoutProps* | `CreateLayoutModalProps \| CreateLayoutDrawerProps` | - | Пропсы передаваемые в модалку или дровер создания новой опции |
|
|
68
|
+
| createLayoutType* | "modal" \| "drawer" | - | По клику на кнопку создания открывать модальное окно или дровер |
|
|
69
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
70
|
+
| onRefetch | `VoidFunction` | - | Коллбек рефетча запроса на получение списка опций в случае ошибки (при передаче dataError в selectProps). |
|
|
71
|
+
| className | `string` | - | CSS-класс |
|
|
72
|
+
| afterClose | `VoidFunction` | - | Коллбек после закрытия модального окна/дровера |
|
|
73
|
+
| entityIcon | `JSXElementConstructor<{ size?: number; className?: string; }>` | - | Иконка сервиса |
|
|
74
|
+
| permission | "none" \| "canRead" \| "canCreate" | - | Управление состоянием компонента в зависимости от прав пользователя (по дефолту permission = 'canCreate') |
|
|
75
|
+
## FieldAi
|
|
76
|
+
### Props
|
|
77
|
+
| name | type | default value | description |
|
|
78
|
+
|------|------|---------------|-------------|
|
|
79
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
80
|
+
| onSubmit* | `(value: string) => void` | - | Колбек действия при отправке |
|
|
81
|
+
| value | `string` | - | HTML-аттрибут value |
|
|
82
|
+
| onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
|
|
83
|
+
| inputMode | enum InputMode: `"search"`, `"none"`, `"text"`, `"tel"`, `"email"`, `"decimal"`, `"numeric"`, `"url"` | - | Режим работы экранной клавиатуры |
|
|
84
|
+
| id | `string` | - | HTML-аттрибут id |
|
|
85
|
+
| name | `string` | - | HTML-аттрибут name |
|
|
86
|
+
| maxLength | `number` | - | Максимальное кол-во символов |
|
|
87
|
+
| disabled | `boolean` | - | Является ли поле деактивированным |
|
|
88
|
+
| readonly | `boolean` | - | Является ли поле доступным только на чтение |
|
|
89
|
+
| onFocus | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек получения фокуса |
|
|
90
|
+
| onBlur | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек потери фокуса |
|
|
91
|
+
| autoFocus | `boolean` | - | Включен ли авто-фокус |
|
|
92
|
+
| onKeyDown | `KeyboardEventHandler<HTMLTextAreaElement>` | - | Колбек нажатия клавиши клавиатуры |
|
|
93
|
+
| className | `string` | - | CSS-класс |
|
|
94
|
+
| caption | `string` | - | Подпись справа от лейбла |
|
|
95
|
+
| hint | `string` | - | Подсказка внизу |
|
|
96
|
+
| showHintIcon | `boolean` | - | Отображать иконку подсказки |
|
|
97
|
+
| validationState | enum ValidationState: `"error"`, `"default"`, `"warning"`, `"success"` | - | Состояние валидации |
|
|
98
|
+
| labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
|
|
99
|
+
| error | `string` | - | |
|
|
100
|
+
| allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
|
|
101
|
+
| showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
|
|
102
|
+
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
103
|
+
| showClearButton | `boolean` | true | Отображение кнопки очистки поля |
|
|
104
|
+
| minRows | `number` | 3 | Минимальное кол-во строк, до которого размер поля может быть увеличен |
|
|
105
|
+
| maxRows | `number` | 1000 | Максимальное кол-во строк, до которого размер поля может быть увеличен |
|
|
106
|
+
| resizable | `boolean` | - | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
|
|
107
|
+
| secure | `boolean \| "password"` | - | Режим ввода sensitive данных (пароля, API ключей, токенов, etc) |
|
|
108
|
+
| onResetContextClick | `() => void` | - | Действие при клике по кнопке сброса контекста |
|
|
109
|
+
| onCancelSecure | `() => void` | - | Действие для отмены секьюрности поля |
|
|
110
|
+
| ref | `LegacyRef<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 {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|
|
111
|
+
| key | `Key` | - | |
|
|
30
112
|
## FieldChat
|
|
31
113
|
### Props
|
|
32
114
|
| name | type | default value | description |
|
|
33
115
|
|------|------|---------------|-------------|
|
|
116
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
117
|
+
| handleSubmit* | `(value: string) => void` | - | Колбек действия при отправке |
|
|
118
|
+
| value | `string` | - | HTML-аттрибут value |
|
|
119
|
+
| onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
|
|
120
|
+
| inputMode | enum InputMode: `"search"`, `"none"`, `"text"`, `"tel"`, `"email"`, `"decimal"`, `"numeric"`, `"url"` | - | Режим работы экранной клавиатуры |
|
|
121
|
+
| id | `string` | - | HTML-аттрибут id |
|
|
122
|
+
| name | `string` | - | HTML-аттрибут name |
|
|
123
|
+
| maxLength | `number` | - | Максимальное кол-во символов |
|
|
124
|
+
| disabled | `boolean` | - | Является ли поле деактивированным |
|
|
125
|
+
| readonly | `boolean` | - | Является ли поле доступным только на чтение |
|
|
126
|
+
| onFocus | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек получения фокуса |
|
|
127
|
+
| onBlur | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек потери фокуса |
|
|
128
|
+
| autoFocus | `boolean` | - | Включен ли авто-фокус |
|
|
129
|
+
| onKeyDown | `KeyboardEventHandler<HTMLTextAreaElement>` | - | Колбек нажатия клавиши клавиатуры |
|
|
130
|
+
| className | `string` | - | CSS-класс |
|
|
131
|
+
| caption | `string` | - | Подпись справа от лейбла |
|
|
132
|
+
| showHintIcon | `boolean` | - | Отображать иконку подсказки |
|
|
133
|
+
| validationState | enum ValidationState: `"error"`, `"default"`, `"warning"`, `"success"` | - | Состояние валидации |
|
|
134
|
+
| labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
|
|
135
|
+
| error | `string` | - | |
|
|
136
|
+
| allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
|
|
137
|
+
| showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
|
|
138
|
+
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
139
|
+
| showClearButton | `boolean` | true | Отображение кнопки очистки поля |
|
|
140
|
+
| minRows | `number` | 3 | Минимальное кол-во строк, до которого размер поля может быть увеличен |
|
|
141
|
+
| maxRows | `number` | 1000 | Максимальное кол-во строк, до которого размер поля может быть увеличен |
|
|
142
|
+
| resizable | `boolean` | - | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
|
|
143
|
+
| attachment | `Pick<FileUploadProps, "onFilesUpload" \| "accept"> & { files?: File[]; onFileDelete: (file?: File) => void; }` | - | |
|
|
34
144
|
## AIDisclaimer
|
|
35
145
|
### Props
|
|
36
146
|
| name | type | default value | description |
|
|
37
147
|
|------|------|---------------|-------------|
|
|
148
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
38
149
|
## FieldName
|
|
39
150
|
Поле имя c локальным стейтом и валидацией
|
|
40
151
|
### Props
|
|
41
152
|
| name | type | default value | description |
|
|
42
153
|
|------|------|---------------|-------------|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
154
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
155
|
+
| value | `string` | - | Значение input |
|
|
156
|
+
| onChange | `(value: string, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
|
|
157
|
+
| id | `string` | - | Значение html-атрибута id |
|
|
158
|
+
| name | `string` | - | Значение html-атрибута name |
|
|
159
|
+
| maxLength | `number` | - | Максимальная длина вводимого значения |
|
|
160
|
+
| disabled | `boolean` | false | Является ли поле деактивированным |
|
|
161
|
+
| readonly | `boolean` | false | Является ли поле доступным только для чтения |
|
|
162
|
+
| onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
|
|
163
|
+
| onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
|
|
164
|
+
| autoComplete | `string \| boolean` | false | Включен ли автокомплит для поля |
|
|
165
|
+
| autoFocus | `boolean` | false | Включен ли авто-фокус для поля |
|
|
166
|
+
| onPaste | `ClipboardEventHandler<HTMLInputElement>` | - | Колбек обработки вставки значения |
|
|
167
|
+
| onKeyDown | `KeyboardEventHandler<HTMLInputElement>` | - | Колбек обработки начала нажатия клавиши клавиатуры |
|
|
168
|
+
| spellCheck | `boolean` | true | Значение атрибута spellcheck (проверка орфографии) |
|
|
169
|
+
| pattern | `string` | - | Регулярное выражение валидного инпута |
|
|
170
|
+
| className | `string` | - | CSS-класс |
|
|
171
|
+
| labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
|
|
172
|
+
| required | `boolean` | - | Является ли поле обязательным |
|
|
173
|
+
| showHintIcon | `boolean` | - | Отображать иконку подсказки |
|
|
174
|
+
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
175
|
+
| validationState | enum ValidationState: `"error"`, `"default"`, `"warning"`, `"success"` | - | Состояние валидации |
|
|
176
|
+
| labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
|
|
177
|
+
| error | `string` | - | |
|
|
178
|
+
| prefix | `ReactNode` | - | Произвольный префикс для поля |
|
|
179
|
+
| prefixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-префикс для поля |
|
|
180
|
+
| postfix | `ReactNode` | - | Произвольный постфикс для поля |
|
|
181
|
+
| allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
|
|
182
|
+
| button | `Button` | - | Кнопка действия внутри поля |
|
|
183
|
+
| showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
|
|
184
|
+
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
185
|
+
| showClearButton | `boolean` | true | Отображение кнопки очистки поля |
|
|
186
|
+
| onClearButtonClick | `() => void` | - | Колбек клика по кнопке очистки поля |
|
|
187
|
+
| showLabel | `boolean` | - | |
|
|
188
|
+
| customSchema | `StringSchema<string, AnyObject, undefined, "">` | - | |
|
|
189
|
+
| onValidationError | `(error: ValidationError) => void` | - | Колбэк, вызываемый при изменении ошибки валидации |
|
|
190
|
+
| ref | `LegacyRef<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 {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|
|
191
|
+
| key | `Key` | - | |
|
|
45
192
|
## FieldNameRHF
|
|
46
193
|
Поле имя c оберткой для React Hook Form
|
|
47
194
|
### Props
|
|
48
195
|
| name | type | default value | description |
|
|
49
196
|
|------|------|---------------|-------------|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
197
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
198
|
+
| controllerProps* | `Omit<ControllerProps<FieldValues>, "disabled" \| "render" \| "rules">` | - | Режим контроллера с использованием react-hook-form |
|
|
199
|
+
| value | `string` | - | Значение input |
|
|
200
|
+
| onChange | `(value: string, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
|
|
201
|
+
| id | `string` | - | Значение html-атрибута id |
|
|
202
|
+
| name | `string` | - | Значение html-атрибута name |
|
|
203
|
+
| maxLength | `number` | - | Максимальная длина вводимого значения |
|
|
204
|
+
| disabled | `boolean` | false | Является ли поле деактивированным |
|
|
205
|
+
| readonly | `boolean` | false | Является ли поле доступным только для чтения |
|
|
206
|
+
| onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
|
|
207
|
+
| onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
|
|
208
|
+
| autoComplete | `string \| boolean` | false | Включен ли автокомплит для поля |
|
|
209
|
+
| autoFocus | `boolean` | false | Включен ли авто-фокус для поля |
|
|
210
|
+
| onPaste | `ClipboardEventHandler<HTMLInputElement>` | - | Колбек обработки вставки значения |
|
|
211
|
+
| onKeyDown | `KeyboardEventHandler<HTMLInputElement>` | - | Колбек обработки начала нажатия клавиши клавиатуры |
|
|
212
|
+
| spellCheck | `boolean` | true | Значение атрибута spellcheck (проверка орфографии) |
|
|
213
|
+
| pattern | `string` | - | Регулярное выражение валидного инпута |
|
|
214
|
+
| className | `string` | - | CSS-класс |
|
|
215
|
+
| labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
|
|
216
|
+
| required | `boolean` | - | Является ли поле обязательным |
|
|
217
|
+
| showHintIcon | `boolean` | - | Отображать иконку подсказки |
|
|
218
|
+
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
219
|
+
| validationState | enum ValidationState: `"error"`, `"default"`, `"warning"`, `"success"` | - | Состояние валидации |
|
|
220
|
+
| labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
|
|
221
|
+
| error | `string` | - | |
|
|
222
|
+
| prefix | `ReactNode` | - | Произвольный префикс для поля |
|
|
223
|
+
| prefixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-префикс для поля |
|
|
224
|
+
| postfix | `ReactNode` | - | Произвольный постфикс для поля |
|
|
225
|
+
| allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
|
|
226
|
+
| button | `Button` | - | Кнопка действия внутри поля |
|
|
227
|
+
| showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
|
|
228
|
+
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
229
|
+
| showClearButton | `boolean` | true | Отображение кнопки очистки поля |
|
|
230
|
+
| onClearButtonClick | `() => void` | - | Колбек клика по кнопке очистки поля |
|
|
231
|
+
| showLabel | `boolean` | - | |
|
|
232
|
+
| customSchema | `StringSchema<string, AnyObject, undefined, "">` | - | |
|
|
233
|
+
| ref | `LegacyRef<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 {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|
|
234
|
+
| key | `Key` | - | |
|
|
52
235
|
## FieldDescription
|
|
53
236
|
Поле описание c локальным стейтом и валидацией
|
|
54
237
|
### Props
|
|
55
238
|
| name | type | default value | description |
|
|
56
239
|
|------|------|---------------|-------------|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
240
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
241
|
+
| value | `string` | - | HTML-аттрибут value |
|
|
242
|
+
| onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
|
|
243
|
+
| id | `string` | - | HTML-аттрибут id |
|
|
244
|
+
| maxLength | `number` | 255 | Максимальное кол-во символов |
|
|
245
|
+
| disabled | `boolean` | - | Является ли поле деактивированным |
|
|
246
|
+
| readonly | `boolean` | - | Является ли поле доступным только на чтение |
|
|
247
|
+
| onFocus | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек получения фокуса |
|
|
248
|
+
| onBlur | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек потери фокуса |
|
|
249
|
+
| autoFocus | `boolean` | - | Включен ли авто-фокус |
|
|
250
|
+
| onKeyDown | `KeyboardEventHandler<HTMLTextAreaElement>` | - | Колбек нажатия клавиши клавиатуры |
|
|
251
|
+
| spellCheck | `boolean` | true | Включение проверки орфографии |
|
|
252
|
+
| className | `string` | - | CSS-класс |
|
|
253
|
+
| labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
|
|
254
|
+
| required | `boolean` | - | Является ли поле обязательным |
|
|
255
|
+
| showHintIcon | `boolean` | - | Отображать иконку подсказки |
|
|
256
|
+
| size | enum Size: `"s"`, `"m"`, `"l"` | m | Размер |
|
|
257
|
+
| validationState | enum ValidationState: `"error"`, `"default"`, `"warning"`, `"success"` | - | Состояние валидации |
|
|
258
|
+
| labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
|
|
259
|
+
| error | `string` | - | |
|
|
260
|
+
| allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
|
|
261
|
+
| showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
|
|
262
|
+
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
263
|
+
| showClearButton | `boolean` | true | Отображение кнопки очистки поля |
|
|
264
|
+
| minRows | `number` | 3 | Минимальное кол-во строк, до которого размер поля может быть увеличен |
|
|
265
|
+
| maxRows | `number` | 1000 | Максимальное кол-во строк, до которого размер поля может быть увеличен |
|
|
266
|
+
| resizable | `boolean` | true | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
|
|
267
|
+
| customSchema | `StringSchema<string, AnyObject, undefined, "">` | - | |
|
|
268
|
+
| addButton | `boolean` | - | Поле появляется по кнопке "Добавить описание" (только для опционального поля) |
|
|
269
|
+
| onValidationError | `(error: ValidationError) => void` | - | Колбэк, вызываемый при изменении ошибки валидации (только в standalone режиме) |
|
|
270
|
+
| ref | `LegacyRef<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 {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|
|
271
|
+
| key | `Key` | - | |
|
|
59
272
|
## FieldDescriptionRHF
|
|
60
273
|
Поле описание c оберткой для React Hook Form
|
|
61
274
|
### Props
|
|
62
275
|
| name | type | default value | description |
|
|
63
276
|
|------|------|---------------|-------------|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
277
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
278
|
+
| controllerProps* | `Omit<ControllerProps<FieldValues>, "disabled" \| "render" \| "rules">` | - | Режим контроллера с использованием react-hook-form |
|
|
279
|
+
| value | `string` | - | HTML-аттрибут value |
|
|
280
|
+
| onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
|
|
281
|
+
| id | `string` | - | HTML-аттрибут id |
|
|
282
|
+
| maxLength | `number` | 255 | Максимальное кол-во символов |
|
|
283
|
+
| disabled | `boolean` | - | Является ли поле деактивированным |
|
|
284
|
+
| readonly | `boolean` | - | Является ли поле доступным только на чтение |
|
|
285
|
+
| onFocus | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек получения фокуса |
|
|
286
|
+
| onBlur | `FocusEventHandler<HTMLTextAreaElement>` | - | Колбек потери фокуса |
|
|
287
|
+
| autoFocus | `boolean` | - | Включен ли авто-фокус |
|
|
288
|
+
| onKeyDown | `KeyboardEventHandler<HTMLTextAreaElement>` | - | Колбек нажатия клавиши клавиатуры |
|
|
289
|
+
| spellCheck | `boolean` | true | Включение проверки орфографии |
|
|
290
|
+
| className | `string` | - | CSS-класс |
|
|
291
|
+
| labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
|
|
292
|
+
| required | `boolean` | - | Является ли поле обязательным |
|
|
293
|
+
| showHintIcon | `boolean` | - | Отображать иконку подсказки |
|
|
294
|
+
| size | enum Size: `"s"`, `"m"`, `"l"` | m | Размер |
|
|
295
|
+
| validationState | enum ValidationState: `"error"`, `"default"`, `"warning"`, `"success"` | - | Состояние валидации |
|
|
296
|
+
| labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
|
|
297
|
+
| error | `string` | - | |
|
|
298
|
+
| allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
|
|
299
|
+
| showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
|
|
300
|
+
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
301
|
+
| showClearButton | `boolean` | true | Отображение кнопки очистки поля |
|
|
302
|
+
| minRows | `number` | 3 | Минимальное кол-во строк, до которого размер поля может быть увеличен |
|
|
303
|
+
| maxRows | `number` | 1000 | Максимальное кол-во строк, до которого размер поля может быть увеличен |
|
|
304
|
+
| resizable | `boolean` | true | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
|
|
305
|
+
| customSchema | `StringSchema<string, AnyObject, undefined, "">` | - | |
|
|
306
|
+
| addButton | `boolean` | - | Поле появляется по кнопке "Добавить описание" (только для опционального поля) |
|
|
307
|
+
| ref | `LegacyRef<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 {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|
|
308
|
+
| key | `Key` | - | |
|
|
66
309
|
## FieldMask
|
|
67
310
|
### Props
|
|
68
311
|
| name | type | default value | description |
|
|
69
312
|
|------|------|---------------|-------------|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
313
|
+
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
314
|
+
| mask* | enum Mask: `"code"`, `"uuid"`, `"passport"`, `"snils"`, `"ip-v4-address"`, `"ip-v4-address-with-mask"` | - | |
|
|
315
|
+
| id | `string` | - | Значение html-атрибута id |
|
|
316
|
+
| name | `string` | - | Значение html-атрибута name |
|
|
317
|
+
| placeholder | `string` | - | Значение плейсхолдера |
|
|
318
|
+
| maxLength | `number` | - | Максимальная длина вводимого значения |
|
|
319
|
+
| disabled | `boolean` | false | Является ли поле деактивированным |
|
|
320
|
+
| readonly | `boolean` | false | Является ли поле доступным только для чтения |
|
|
321
|
+
| onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
|
|
322
|
+
| onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
|
|
323
|
+
| autoComplete | `string \| boolean` | false | Включен ли автокомплит для поля |
|
|
324
|
+
| autoFocus | `boolean` | false | Включен ли авто-фокус для поля |
|
|
325
|
+
| onPaste | `ClipboardEventHandler<HTMLInputElement>` | - | Колбек обработки вставки значения |
|
|
326
|
+
| onKeyDown | `KeyboardEventHandler<HTMLInputElement>` | - | Колбек обработки начала нажатия клавиши клавиатуры |
|
|
327
|
+
| spellCheck | `boolean` | true | Значение атрибута spellcheck (проверка орфографии) |
|
|
328
|
+
| pattern | `string` | - | Регулярное выражение валидного инпута |
|
|
329
|
+
| className | `string` | - | CSS-класс |
|
|
330
|
+
| label | `string` | - | Лейбл |
|
|
331
|
+
| labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
|
|
332
|
+
| required | `boolean` | - | Является ли поле обязательным |
|
|
333
|
+
| caption | `string` | - | Подпись справа от лейбла |
|
|
334
|
+
| hint | `string` | - | Подсказка внизу |
|
|
335
|
+
| showHintIcon | `boolean` | - | Отображать иконку подсказки |
|
|
336
|
+
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
337
|
+
| validationState | enum ValidationState: `"error"`, `"default"`, `"warning"`, `"success"` | - | Состояние валидации |
|
|
338
|
+
| labelTooltipPlacement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Расположение подсказки лейбла |
|
|
339
|
+
| error | `string` | - | |
|
|
340
|
+
| prefix | `ReactNode` | - | Произвольный префикс для поля |
|
|
341
|
+
| prefixIcon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | Иконка-префикс для поля |
|
|
342
|
+
| postfix | `ReactNode` | - | Произвольный постфикс для поля |
|
|
343
|
+
| allowMoreThanMaxLength | `boolean` | - | Можно ли вводить больше разрешённого кол-ва символов |
|
|
344
|
+
| button | `Button` | - | Кнопка действия внутри поля |
|
|
345
|
+
| type | "text" \| "tel" \| "email" | - | |
|
|
346
|
+
| showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
|
|
347
|
+
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
348
|
+
| showClearButton | `boolean` | true | Отображение кнопки очистки поля |
|
|
349
|
+
| onClearButtonClick | `() => void` | - | Колбек клика по кнопке очистки поля |
|
|
350
|
+
| value | `string` | - | |
|
|
351
|
+
| onChange | `(value: string, mask: InputMask<Record<string, unknown>>) => void` | - | |
|
|
352
|
+
| ref | `LegacyRef<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 {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|
|
353
|
+
| key | `Key` | - | |
|
|
354
|
+
## FieldCode
|
|
355
|
+
### Props
|
|
356
|
+
| name | type | default value | description |
|
|
357
|
+
|------|------|---------------|-------------|
|
|
358
|
+
| codeLength* | `number` | - | Количество цифр в коде |
|
|
359
|
+
| className | `string` | - | CSS-класс компонента |
|
|
360
|
+
| cellClassName | `string` | - | CSS-класс ячейки кода |
|
|
361
|
+
| spacing | `number[]` | - | Позиции, после которых нужно вставить пробел (индексы символов, после которых будет пробел) |
|
|
362
|
+
| showEmptyChars | `boolean` | - | Подсветить пустые символы кода |
|
|
363
|
+
| resendCode | `ResendCodeProps` | - | Компонент отправки нового кода |
|
|
364
|
+
| focusEffects | `readonly FieldCodeFocusEffect[]` | - | Сценарии автофокуса; по умолчанию — первая ячейка при монтировании и после сброса (см. `FieldCodeFocusEffect`) |
|
|
365
|
+
| value | `string` | - | Значение кода |
|
|
366
|
+
| onChange | `(code: string) => void` | - | Колбек изменения значения |
|
|
367
|
+
| onComplete | `(code: string) => void` | - | Колбек достижения ввода всех символов кода |
|
|
368
|
+
| disabled | `boolean` | - | Деактивирован ли элемент Является ли поле деактивированным |
|
|
369
|
+
| label | `string` | - | Лейбл |
|
|
370
|
+
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
371
|
+
| error | `string` | - | |
|
|
372
|
+
| ref | `LegacyRef<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 {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|
|
373
|
+
| key | `Key` | - | |
|
|
374
|
+
## FieldCodeFocusEffect
|
|
375
|
+
Когда дергать `moveFocus` у `FieldCode` (массив `focusEffects`, порядок не важен).
|
|
376
|
+
### Props
|
|
377
|
+
| name | type | default value | description |
|
|
378
|
+
|------|------|---------------|-------------|
|
|
72
379
|
|
|
73
380
|
|
|
74
381
|
[//]: DOCUMENTATION_SECTION_END
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FieldTextAreaProps } from '@cloud-ru/uikit-product-mobile-fields';
|
|
2
|
+
import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
|
|
3
|
+
export type FieldAiProps = WithLayoutType<Omit<FieldTextAreaProps, 'placeholder' | 'labelTooltip' | 'label' | 'required' | 'size' | 'spellCheck' | 'footer'> & {
|
|
4
|
+
/** Режим ввода sensitive данных (пароля, API ключей, токенов, etc) */
|
|
5
|
+
secure?: boolean | 'password';
|
|
6
|
+
/** Колбек действия при отправке */
|
|
7
|
+
onSubmit(value: string): void;
|
|
8
|
+
/** Действие при клике по кнопке сброса контекста */
|
|
9
|
+
onResetContextClick?(): void;
|
|
10
|
+
/** Действие для отмены секьюрности поля */
|
|
11
|
+
onCancelSecure?(): void;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const FieldAi: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "size" | "label" | "required" | "placeholder" | "spellCheck" | "labelTooltip" | "footer"> & {
|
|
14
|
+
/** Режим ввода sensitive данных (пароля, API ключей, токенов, etc) */
|
|
15
|
+
secure?: boolean | "password";
|
|
16
|
+
/** Колбек действия при отправке */
|
|
17
|
+
onSubmit(value: string): void;
|
|
18
|
+
/** Действие при клике по кнопке сброса контекста */
|
|
19
|
+
onResetContextClick?(): void;
|
|
20
|
+
/** Действие для отмены секьюрности поля */
|
|
21
|
+
onCancelSecure?(): void;
|
|
22
|
+
} & {
|
|
23
|
+
layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
|
|
24
|
+
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.FieldAi = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
const react_1 = require("react");
|
|
21
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
22
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
23
|
+
const uikit_product_mobile_fields_1 = require("@cloud-ru/uikit-product-mobile-fields");
|
|
24
|
+
const button_1 = require("@snack-uikit/button");
|
|
25
|
+
const figma_tokens_1 = require("@snack-uikit/figma-tokens");
|
|
26
|
+
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
27
|
+
const typography_1 = require("@snack-uikit/typography");
|
|
28
|
+
const FieldSubmitButton_1 = require("../../helperComponents/FieldSubmitButton");
|
|
29
|
+
const TextAreaActionsFooter_1 = require("../../helperComponents/TextAreaActionsFooter");
|
|
30
|
+
const helpers_1 = require("../../helpers");
|
|
31
|
+
const AIDisclaimer_1 = require("../AIDisclaimer/AIDisclaimer");
|
|
32
|
+
const AlertButton_1 = require("./components/AlertButton");
|
|
33
|
+
const MobileFieldAi_1 = require("./components/MobileFieldAi");
|
|
34
|
+
const WithPasswordValidation_1 = require("./components/WithPasswordValidation");
|
|
35
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
36
|
+
const utils_1 = require("./utils");
|
|
37
|
+
exports.FieldAi = (0, react_1.forwardRef)((_a, ref) => {
|
|
38
|
+
var { secure = false, onSubmit: handleSubmitProp, value, onResetContextClick, onCancelSecure, disabled, className } = _a, props = __rest(_a, ["secure", "onSubmit", "value", "onResetContextClick", "onCancelSecure", "disabled", "className"]);
|
|
39
|
+
const { layoutType, validationState } = props;
|
|
40
|
+
const { t } = (0, uikit_product_locale_1.useLocale)('FieldsPredefined');
|
|
41
|
+
const isTouchDevice = (0, helpers_1.isTouchDevice)(layoutType);
|
|
42
|
+
const [isValueHidden, setIsValueHidden] = (0, react_1.useState)(true);
|
|
43
|
+
const [animatedValidationKey, setAnimatedValidationKey] = (0, react_1.useState)(null);
|
|
44
|
+
const timerRef = (0, react_1.useRef)(null);
|
|
45
|
+
const isValueValid = typeof value === 'string' && value.trim().length > 0;
|
|
46
|
+
const isPasswordMode = secure === 'password';
|
|
47
|
+
const passwordValidation = (0, react_1.useMemo)(() => (0, utils_1.getValidationPassword)(value), [value]);
|
|
48
|
+
const isPasswordValid = isPasswordMode ? Object.values(passwordValidation).every(Boolean) : true;
|
|
49
|
+
const showPasswordError = !isPasswordValid && secure && value;
|
|
50
|
+
const showPasswordAlert = Boolean(onCancelSecure) && secure === 'password';
|
|
51
|
+
(0, react_1.useEffect)(() => () => {
|
|
52
|
+
if (timerRef.current) {
|
|
53
|
+
clearTimeout(timerRef.current);
|
|
54
|
+
}
|
|
55
|
+
}, []);
|
|
56
|
+
const handleSubmit = () => {
|
|
57
|
+
if (isValueValid && isPasswordValid) {
|
|
58
|
+
handleSubmitProp(value);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const triggerValidationHighlight = (key) => {
|
|
62
|
+
setAnimatedValidationKey(key);
|
|
63
|
+
timerRef.current = setTimeout(() => {
|
|
64
|
+
setAnimatedValidationKey(null);
|
|
65
|
+
}, 1000);
|
|
66
|
+
};
|
|
67
|
+
const handleKeyDown = event => {
|
|
68
|
+
if (isTouchDevice) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (isPasswordMode && event.key.length === 1) {
|
|
72
|
+
const isLetter = /\p{L}/u.test(event.key);
|
|
73
|
+
const isLatinLetter = /^[a-zA-Z]$/.test(event.key);
|
|
74
|
+
if (isLetter && !isLatinLetter) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
triggerValidationHighlight('onlyLatin');
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (event.key === 'Enter' && !event.shiftKey) {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
if (!disabled) {
|
|
83
|
+
handleSubmit();
|
|
84
|
+
}
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
if (isTouchDevice && !secure) {
|
|
89
|
+
return ((0, jsx_runtime_1.jsx)(MobileFieldAi_1.MobileFieldAi, Object.assign({}, props, (0, uikit_product_mobile_fields_1.getAdaptiveFieldProps)(props), { onSubmit: handleSubmit, submitEnabled: isValueValid && !disabled, ref: ref, value: value })));
|
|
90
|
+
}
|
|
91
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, isPasswordMode && styles_module_scss_1.default.passwordWrapper, className), children: [showPasswordAlert && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.alert, children: [(0, jsx_runtime_1.jsx)(uikit_product_icons_1.PasswordLockSVG, { size: 16, color: figma_tokens_1.themeVars.sys.neutral.textSupport }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { className: styles_module_scss_1.default.alertText, children: t('FieldAi.secret.alert.text') }), (0, jsx_runtime_1.jsx)(AlertButton_1.AlertButton, { label: t('FieldAi.secret.alert.button'), onClick: onCancelSecure })] })), (0, jsx_runtime_1.jsx)(WithPasswordValidation_1.WithPasswordValidation, { showValidation: isPasswordMode, passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedValidationKey, children: (0, jsx_runtime_1.jsx)(uikit_product_mobile_fields_1.AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, size: 'm', minRows: secure ? 1 : 2, maxRows: secure ? 1 : 4, placeholder: secure ? t('FieldAi.secret.placeholder') : t('FieldAi.regular.placeholder'), className: (0, classnames_1.default)(styles_module_scss_1.default.textarea, secure && isValueHidden ? styles_module_scss_1.default.secured : undefined), onKeyDown: handleKeyDown, spellCheck: !secure, validationState: showPasswordError ? 'error' : validationState, footer: (0, jsx_runtime_1.jsx)(TextAreaActionsFooter_1.TextAreaActionsFooter, { left: secure && ((0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { size: 'xs', icon: isValueHidden ? (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeSVG, {}) : (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev) })), right: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [secure && onResetContextClick && ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { tip: t('FieldAi.resetContext.tooltip'), hoverDelayOpen: 600, children: (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, { size: 'xs', label: t('FieldAi.resetContext.label'), onClick: onResetContextClick, appearance: 'destructive' }) })), (0, jsx_runtime_1.jsx)(FieldSubmitButton_1.FieldSubmitButton, { showTooltip: !isTouchDevice, className: (0, classnames_1.default)(styles_module_scss_1.default.submitButton, isTouchDevice ? styles_module_scss_1.default.mobileSubmitButton : undefined), active: isValueValid && !disabled && isPasswordValid, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })) }), !isPasswordMode && (0, jsx_runtime_1.jsx)(AIDisclaimer_1.AIDisclaimer, { layoutType: layoutType })] }));
|
|
92
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AlertButton = AlertButton;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const typography_1 = require("@snack-uikit/typography");
|
|
9
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
10
|
+
function AlertButton({ label, onClick }) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("button", { onClick: onClick, className: styles_module_scss_1.default.button, children: (0, jsx_runtime_1.jsx)(typography_1.Typography.SansLabelM, { className: styles_module_scss_1.default.label, children: label }) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AlertButton';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AlertButton"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.button{
|
|
2
|
+
outline:none;
|
|
3
|
+
border:none;
|
|
4
|
+
background-color:transparent;
|
|
5
|
+
cursor:pointer;
|
|
6
|
+
height:16px;
|
|
7
|
+
display:flex;
|
|
8
|
+
align-items:center;
|
|
9
|
+
justify-content:center;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.label{
|
|
13
|
+
color:var(--sys-blue-text-support, #4877b0);
|
|
14
|
+
}
|
|
15
|
+
.label:hover{
|
|
16
|
+
color:var(--sys-neutral-text-main, #41424e);
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
|
|
2
|
+
type CheckItemProps = WithLayoutType<{
|
|
3
|
+
label: string;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
shouldHide?: boolean;
|
|
6
|
+
animated?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function CheckItem({ label, checked, layoutType, shouldHide, animated }: CheckItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CheckItem = CheckItem;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
10
|
+
const typography_1 = require("@snack-uikit/typography");
|
|
11
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
12
|
+
const CHECKED_ITEM_DISAPPEAR_TIMEOUT = 500;
|
|
13
|
+
function CheckItem({ label, checked, layoutType, shouldHide = false, animated = false }) {
|
|
14
|
+
const [visible, setVisible] = (0, react_1.useState)(checked);
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
if (checked) {
|
|
17
|
+
const timeoutId = setTimeout(() => {
|
|
18
|
+
setVisible(false);
|
|
19
|
+
}, CHECKED_ITEM_DISAPPEAR_TIMEOUT);
|
|
20
|
+
return () => clearTimeout(timeoutId);
|
|
21
|
+
}
|
|
22
|
+
setVisible(true);
|
|
23
|
+
}, [checked]);
|
|
24
|
+
if (shouldHide && !visible) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.checkItem, "data-layout-type": layoutType, "data-animated": animated, children: [(0, jsx_runtime_1.jsx)(uikit_product_icons_1.CheckSVG, { size: 16, className: styles_module_scss_1.default.icon, "data-checked": checked }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, { className: styles_module_scss_1.default.label, "data-checked": checked, children: label })] }));
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CheckItem';
|