@cloud-ru/uikit-product-fields-predefined 2.4.8-preview-04a474c4.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +12 -326
- package/dist/cjs/components/index.d.ts +0 -2
- package/dist/cjs/components/index.js +0 -2
- package/dist/esm/components/index.d.ts +0 -2
- package/dist/esm/components/index.js +0 -2
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +3 -9
- package/src/components/index.ts +0 -2
- package/dist/cjs/components/FieldAi/FieldAi.d.ts +0 -24
- package/dist/cjs/components/FieldAi/FieldAi.js +0 -92
- package/dist/cjs/components/FieldAi/components/AlertButton/AlertButton.d.ts +0 -5
- package/dist/cjs/components/FieldAi/components/AlertButton/AlertButton.js +0 -12
- package/dist/cjs/components/FieldAi/components/AlertButton/index.d.ts +0 -1
- package/dist/cjs/components/FieldAi/components/AlertButton/index.js +0 -17
- package/dist/cjs/components/FieldAi/components/AlertButton/styles.module.css +0 -17
- package/dist/cjs/components/FieldAi/components/CheckItem/CheckItem.d.ts +0 -9
- package/dist/cjs/components/FieldAi/components/CheckItem/CheckItem.js +0 -28
- package/dist/cjs/components/FieldAi/components/CheckItem/index.d.ts +0 -1
- package/dist/cjs/components/FieldAi/components/CheckItem/index.js +0 -17
- package/dist/cjs/components/FieldAi/components/CheckItem/styles.module.css +0 -36
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/MobileFieldAi.d.ts +0 -5
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/MobileFieldAi.js +0 -31
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/index.d.ts +0 -1
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/index.js +0 -17
- package/dist/cjs/components/FieldAi/components/MobileFieldAi/styles.module.css +0 -78
- package/dist/cjs/components/FieldAi/components/PasswordValidation/PasswordValidation.d.ts +0 -7
- package/dist/cjs/components/FieldAi/components/PasswordValidation/PasswordValidation.js +0 -23
- package/dist/cjs/components/FieldAi/components/PasswordValidation/index.d.ts +0 -1
- package/dist/cjs/components/FieldAi/components/PasswordValidation/index.js +0 -17
- package/dist/cjs/components/FieldAi/components/PasswordValidation/styles.module.css +0 -36
- package/dist/cjs/components/FieldAi/components/TextArea/TextArea.d.ts +0 -39
- package/dist/cjs/components/FieldAi/components/TextArea/TextArea.js +0 -33
- package/dist/cjs/components/FieldAi/components/TextArea/index.d.ts +0 -1
- package/dist/cjs/components/FieldAi/components/TextArea/index.js +0 -17
- package/dist/cjs/components/FieldAi/components/TextArea/styles.module.css +0 -32
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts +0 -10
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js +0 -23
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/index.d.ts +0 -1
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/index.js +0 -17
- package/dist/cjs/components/FieldAi/components/WithPasswordValidation/styles.module.css +0 -6
- package/dist/cjs/components/FieldAi/index.d.ts +0 -1
- package/dist/cjs/components/FieldAi/index.js +0 -17
- package/dist/cjs/components/FieldAi/styles.module.css +0 -61
- package/dist/cjs/components/FieldAi/utils.d.ts +0 -10
- package/dist/cjs/components/FieldAi/utils.js +0 -19
- package/dist/cjs/components/FieldCode/FieldCode.d.ts +0 -33
- package/dist/cjs/components/FieldCode/FieldCode.js +0 -48
- package/dist/cjs/components/FieldCode/components/Cell/Cell.d.ts +0 -5
- package/dist/cjs/components/FieldCode/components/Cell/Cell.js +0 -27
- package/dist/cjs/components/FieldCode/components/Cell/index.d.ts +0 -1
- package/dist/cjs/components/FieldCode/components/Cell/index.js +0 -17
- package/dist/cjs/components/FieldCode/components/Cell/styles.module.css +0 -3
- package/dist/cjs/components/FieldCode/components/ResendCode/ResendCode.d.ts +0 -8
- package/dist/cjs/components/FieldCode/components/ResendCode/ResendCode.js +0 -28
- package/dist/cjs/components/FieldCode/components/ResendCode/index.d.ts +0 -1
- package/dist/cjs/components/FieldCode/components/ResendCode/index.js +0 -17
- package/dist/cjs/components/FieldCode/components/ResendCode/utils.d.ts +0 -1
- package/dist/cjs/components/FieldCode/components/ResendCode/utils.js +0 -8
- package/dist/cjs/components/FieldCode/components/index.d.ts +0 -2
- package/dist/cjs/components/FieldCode/components/index.js +0 -18
- package/dist/cjs/components/FieldCode/constants.d.ts +0 -14
- package/dist/cjs/components/FieldCode/constants.js +0 -10
- package/dist/cjs/components/FieldCode/hooks/index.d.ts +0 -4
- package/dist/cjs/components/FieldCode/hooks/index.js +0 -20
- package/dist/cjs/components/FieldCode/hooks/useCodeInput.d.ts +0 -22
- package/dist/cjs/components/FieldCode/hooks/useCodeInput.js +0 -98
- package/dist/cjs/components/FieldCode/hooks/useFieldCodeValidate.d.ts +0 -8
- package/dist/cjs/components/FieldCode/hooks/useFieldCodeValidate.js +0 -24
- package/dist/cjs/components/FieldCode/hooks/useFieldHelpers.d.ts +0 -13
- package/dist/cjs/components/FieldCode/hooks/useFieldHelpers.js +0 -34
- package/dist/cjs/components/FieldCode/hooks/useFocusCell.d.ts +0 -5
- package/dist/cjs/components/FieldCode/hooks/useFocusCell.js +0 -22
- package/dist/cjs/components/FieldCode/index.d.ts +0 -2
- package/dist/cjs/components/FieldCode/index.js +0 -20
- package/dist/cjs/components/FieldCode/styles.module.css +0 -30
- package/dist/cjs/components/FieldCode/utils.d.ts +0 -6
- package/dist/cjs/components/FieldCode/utils.js +0 -21
- package/dist/esm/components/FieldAi/FieldAi.d.ts +0 -24
- package/dist/esm/components/FieldAi/FieldAi.js +0 -86
- package/dist/esm/components/FieldAi/components/AlertButton/AlertButton.d.ts +0 -5
- package/dist/esm/components/FieldAi/components/AlertButton/AlertButton.js +0 -6
- package/dist/esm/components/FieldAi/components/AlertButton/index.d.ts +0 -1
- package/dist/esm/components/FieldAi/components/AlertButton/index.js +0 -1
- package/dist/esm/components/FieldAi/components/AlertButton/styles.module.css +0 -17
- package/dist/esm/components/FieldAi/components/CheckItem/CheckItem.d.ts +0 -9
- package/dist/esm/components/FieldAi/components/CheckItem/CheckItem.js +0 -22
- package/dist/esm/components/FieldAi/components/CheckItem/index.d.ts +0 -1
- package/dist/esm/components/FieldAi/components/CheckItem/index.js +0 -1
- package/dist/esm/components/FieldAi/components/CheckItem/styles.module.css +0 -36
- package/dist/esm/components/FieldAi/components/MobileFieldAi/MobileFieldAi.d.ts +0 -5
- package/dist/esm/components/FieldAi/components/MobileFieldAi/MobileFieldAi.js +0 -25
- package/dist/esm/components/FieldAi/components/MobileFieldAi/index.d.ts +0 -1
- package/dist/esm/components/FieldAi/components/MobileFieldAi/index.js +0 -1
- package/dist/esm/components/FieldAi/components/MobileFieldAi/styles.module.css +0 -78
- package/dist/esm/components/FieldAi/components/PasswordValidation/PasswordValidation.d.ts +0 -7
- package/dist/esm/components/FieldAi/components/PasswordValidation/PasswordValidation.js +0 -17
- package/dist/esm/components/FieldAi/components/PasswordValidation/index.d.ts +0 -1
- package/dist/esm/components/FieldAi/components/PasswordValidation/index.js +0 -1
- package/dist/esm/components/FieldAi/components/PasswordValidation/styles.module.css +0 -36
- package/dist/esm/components/FieldAi/components/TextArea/TextArea.d.ts +0 -39
- package/dist/esm/components/FieldAi/components/TextArea/TextArea.js +0 -27
- package/dist/esm/components/FieldAi/components/TextArea/index.d.ts +0 -1
- package/dist/esm/components/FieldAi/components/TextArea/index.js +0 -1
- package/dist/esm/components/FieldAi/components/TextArea/styles.module.css +0 -32
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts +0 -10
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js +0 -17
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/index.d.ts +0 -1
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/index.js +0 -1
- package/dist/esm/components/FieldAi/components/WithPasswordValidation/styles.module.css +0 -6
- package/dist/esm/components/FieldAi/index.d.ts +0 -1
- package/dist/esm/components/FieldAi/index.js +0 -1
- package/dist/esm/components/FieldAi/styles.module.css +0 -61
- package/dist/esm/components/FieldAi/utils.d.ts +0 -10
- package/dist/esm/components/FieldAi/utils.js +0 -15
- package/dist/esm/components/FieldCode/FieldCode.d.ts +0 -33
- package/dist/esm/components/FieldCode/FieldCode.js +0 -41
- package/dist/esm/components/FieldCode/components/Cell/Cell.d.ts +0 -5
- package/dist/esm/components/FieldCode/components/Cell/Cell.js +0 -21
- package/dist/esm/components/FieldCode/components/Cell/index.d.ts +0 -1
- package/dist/esm/components/FieldCode/components/Cell/index.js +0 -1
- package/dist/esm/components/FieldCode/components/Cell/styles.module.css +0 -3
- package/dist/esm/components/FieldCode/components/ResendCode/ResendCode.d.ts +0 -8
- package/dist/esm/components/FieldCode/components/ResendCode/ResendCode.js +0 -25
- package/dist/esm/components/FieldCode/components/ResendCode/index.d.ts +0 -1
- package/dist/esm/components/FieldCode/components/ResendCode/index.js +0 -1
- package/dist/esm/components/FieldCode/components/ResendCode/utils.d.ts +0 -1
- package/dist/esm/components/FieldCode/components/ResendCode/utils.js +0 -5
- package/dist/esm/components/FieldCode/components/index.d.ts +0 -2
- package/dist/esm/components/FieldCode/components/index.js +0 -2
- package/dist/esm/components/FieldCode/constants.d.ts +0 -14
- package/dist/esm/components/FieldCode/constants.js +0 -7
- package/dist/esm/components/FieldCode/hooks/index.d.ts +0 -4
- package/dist/esm/components/FieldCode/hooks/index.js +0 -4
- package/dist/esm/components/FieldCode/hooks/useCodeInput.d.ts +0 -22
- package/dist/esm/components/FieldCode/hooks/useCodeInput.js +0 -95
- package/dist/esm/components/FieldCode/hooks/useFieldCodeValidate.d.ts +0 -8
- package/dist/esm/components/FieldCode/hooks/useFieldCodeValidate.js +0 -21
- package/dist/esm/components/FieldCode/hooks/useFieldHelpers.d.ts +0 -13
- package/dist/esm/components/FieldCode/hooks/useFieldHelpers.js +0 -31
- package/dist/esm/components/FieldCode/hooks/useFocusCell.d.ts +0 -5
- package/dist/esm/components/FieldCode/hooks/useFocusCell.js +0 -19
- package/dist/esm/components/FieldCode/index.d.ts +0 -2
- package/dist/esm/components/FieldCode/index.js +0 -2
- package/dist/esm/components/FieldCode/styles.module.css +0 -30
- package/dist/esm/components/FieldCode/utils.d.ts +0 -6
- package/dist/esm/components/FieldCode/utils.js +0 -13
- package/src/components/FieldAi/FieldAi.tsx +0 -201
- package/src/components/FieldAi/components/AlertButton/AlertButton.tsx +0 -16
- package/src/components/FieldAi/components/AlertButton/index.ts +0 -1
- package/src/components/FieldAi/components/AlertButton/styles.module.scss +0 -20
- package/src/components/FieldAi/components/CheckItem/CheckItem.tsx +0 -45
- package/src/components/FieldAi/components/CheckItem/index.ts +0 -1
- package/src/components/FieldAi/components/CheckItem/styles.module.scss +0 -44
- package/src/components/FieldAi/components/MobileFieldAi/MobileFieldAi.tsx +0 -57
- package/src/components/FieldAi/components/MobileFieldAi/index.ts +0 -1
- package/src/components/FieldAi/components/MobileFieldAi/styles.module.scss +0 -90
- package/src/components/FieldAi/components/PasswordValidation/PasswordValidation.tsx +0 -85
- package/src/components/FieldAi/components/PasswordValidation/index.ts +0 -1
- package/src/components/FieldAi/components/PasswordValidation/styles.module.scss +0 -34
- package/src/components/FieldAi/components/TextArea/TextArea.tsx +0 -113
- package/src/components/FieldAi/components/TextArea/index.ts +0 -1
- package/src/components/FieldAi/components/TextArea/styles.module.scss +0 -35
- package/src/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.tsx +0 -63
- package/src/components/FieldAi/components/WithPasswordValidation/index.ts +0 -1
- package/src/components/FieldAi/components/WithPasswordValidation/styles.module.scss +0 -8
- package/src/components/FieldAi/index.ts +0 -1
- package/src/components/FieldAi/styles.module.scss +0 -85
- package/src/components/FieldAi/utils.ts +0 -27
- package/src/components/FieldCode/FieldCode.tsx +0 -125
- package/src/components/FieldCode/components/Cell/Cell.tsx +0 -32
- package/src/components/FieldCode/components/Cell/index.ts +0 -1
- package/src/components/FieldCode/components/Cell/styles.module.scss +0 -5
- package/src/components/FieldCode/components/ResendCode/ResendCode.tsx +0 -33
- package/src/components/FieldCode/components/ResendCode/index.ts +0 -1
- package/src/components/FieldCode/components/ResendCode/utils.ts +0 -5
- package/src/components/FieldCode/components/index.ts +0 -2
- package/src/components/FieldCode/constants.ts +0 -20
- package/src/components/FieldCode/hooks/index.ts +0 -4
- package/src/components/FieldCode/hooks/useCodeInput.ts +0 -147
- package/src/components/FieldCode/hooks/useFieldCodeValidate.ts +0 -35
- package/src/components/FieldCode/hooks/useFieldHelpers.ts +0 -52
- package/src/components/FieldCode/hooks/useFocusCell.ts +0 -29
- package/src/components/FieldCode/index.ts +0 -2
- package/src/components/FieldCode/styles.module.scss +0 -40
- package/src/components/FieldCode/utils.ts +0 -23
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/uikit-product-fields-predefined",
|
|
3
3
|
"title": "Fields Predefined",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -36,25 +36,19 @@
|
|
|
36
36
|
"@cloud-ru/uikit-product-mobile-dropdown": "2.1.13",
|
|
37
37
|
"@cloud-ru/uikit-product-mobile-fields": "2.1.2",
|
|
38
38
|
"@cloud-ru/uikit-product-mobile-modal": "2.1.3",
|
|
39
|
-
"@cloud-ru/uikit-product-mobile-tooltip": "1.1.12",
|
|
40
39
|
"@cloud-ru/uikit-product-utils": "9.1.0",
|
|
41
|
-
"@siberiacancode/reactuse": "0.3.22",
|
|
42
40
|
"@snack-uikit/attachment": "0.4.40",
|
|
43
41
|
"@snack-uikit/button": "0.19.16",
|
|
44
42
|
"@snack-uikit/drop-zone": "0.9.6",
|
|
45
|
-
"@snack-uikit/fields": "0.51.15",
|
|
46
43
|
"@snack-uikit/icon-predefined": "0.7.3",
|
|
47
44
|
"@snack-uikit/input-private": "4.8.8",
|
|
48
45
|
"@snack-uikit/scroll": "0.10.8",
|
|
49
46
|
"@snack-uikit/tooltip": "0.18.12",
|
|
50
|
-
"@snack-uikit/typography": "0.8.7",
|
|
51
47
|
"@snack-uikit/utils": "3.7.0",
|
|
52
48
|
"awesome-phonenumber": "7.5.0",
|
|
53
49
|
"classnames": "2.5.1",
|
|
54
50
|
"merge-refs": "1.2.2",
|
|
55
|
-
"react-imask": "7.6.1"
|
|
56
|
-
"react-textarea-autosize": "8.5.9",
|
|
57
|
-
"sass": "1.80.4"
|
|
51
|
+
"react-imask": "7.6.1"
|
|
58
52
|
},
|
|
59
53
|
"devDependencies": {
|
|
60
54
|
"@types/merge-refs": "1.0.0",
|
|
@@ -65,5 +59,5 @@
|
|
|
65
59
|
"react-hook-form": ">=7.51.0",
|
|
66
60
|
"yup": ">=0.32.0"
|
|
67
61
|
},
|
|
68
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "77212a170d04f0b142fcfaa5f9a107f9028fd06c"
|
|
69
63
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export * from './FieldPhone';
|
|
2
2
|
export * from './SelectCreate';
|
|
3
|
-
export * from './FieldAi';
|
|
4
3
|
export * from './FieldChat';
|
|
5
4
|
export * from './AIDisclaimer';
|
|
6
5
|
export * from './FieldName';
|
|
7
6
|
export * from './FieldDescription';
|
|
8
7
|
export * from './FieldMask';
|
|
9
|
-
export * from './FieldCode';
|
|
@@ -1,24 +0,0 @@
|
|
|
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>>;
|
|
@@ -1,92 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AlertButton';
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './CheckItem';
|
|
@@ -1,17 +0,0 @@
|
|
|
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("./CheckItem"), exports);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
@keyframes shake{
|
|
2
|
-
0%, 100%{
|
|
3
|
-
transform:translateX(0);
|
|
4
|
-
}
|
|
5
|
-
10%, 30%, 50%, 70%, 90%{
|
|
6
|
-
transform:translateX(-4px);
|
|
7
|
-
}
|
|
8
|
-
20%, 40%, 60%, 80%{
|
|
9
|
-
transform:translateX(4px);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
.checkItem{
|
|
13
|
-
display:inline-flex;
|
|
14
|
-
gap:10px;
|
|
15
|
-
}
|
|
16
|
-
.checkItem[data-layout-type=mobile], .checkItem[data-layout-type=tablet]{
|
|
17
|
-
gap:8px;
|
|
18
|
-
}
|
|
19
|
-
.checkItem[data-animated=true]{
|
|
20
|
-
animation:shake 0.5s ease-in-out;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.icon{
|
|
24
|
-
flex-shrink:0;
|
|
25
|
-
color:var(--sys-neutral-accent-default, #787b8a);
|
|
26
|
-
}
|
|
27
|
-
.icon[data-checked=true]{
|
|
28
|
-
color:var(--sys-primary-text-light, #6aaf90);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.label{
|
|
32
|
-
color:var(--sys-neutral-text-light, #8b8e9b);
|
|
33
|
-
}
|
|
34
|
-
.label[data-checked=true]{
|
|
35
|
-
color:var(--sys-primary-text-light, #6aaf90);
|
|
36
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { FieldTextAreaProps } from '@cloud-ru/uikit-product-mobile-fields';
|
|
2
|
-
export declare const MobileFieldAi: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "size" | "label" | "required" | "placeholder" | "spellCheck" | "labelTooltip" | "footer"> & {
|
|
3
|
-
onSubmit(): void;
|
|
4
|
-
submitEnabled: boolean;
|
|
5
|
-
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,31 +0,0 @@
|
|
|
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.MobileFieldAi = void 0;
|
|
18
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
const react_1 = require("react");
|
|
20
|
-
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
21
|
-
const scroll_1 = require("@snack-uikit/scroll");
|
|
22
|
-
const FieldSubmitButton_1 = require("../../../../helperComponents/FieldSubmitButton");
|
|
23
|
-
const TextArea_1 = require("../TextArea");
|
|
24
|
-
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
25
|
-
const MIN_ROWS = 1;
|
|
26
|
-
const MAX_ROWS = 6;
|
|
27
|
-
exports.MobileFieldAi = (0, react_1.forwardRef)((_a, ref) => {
|
|
28
|
-
var { onSubmit, value, submitEnabled } = _a, props = __rest(_a, ["onSubmit", "value", "submitEnabled"]);
|
|
29
|
-
const { t } = (0, uikit_product_locale_1.useLocale)('FieldsPredefined');
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.mobileInputWrapper, style: { '--max-rows': MAX_ROWS, '--min-rows': MIN_ROWS }, "data-size": 'm', children: [(0, jsx_runtime_1.jsx)(scroll_1.Scroll, { className: styles_module_scss_1.default.scrollContainer, size: 's', barHideStrategy: 'never', children: (0, jsx_runtime_1.jsx)(TextArea_1.TextArea, Object.assign({}, props, { className: styles_module_scss_1.default.textarea, ref: ref, value: value, minRows: MIN_ROWS, placeholder: t('FieldAi.regular.placeholder'), spellCheck: true })) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.mobileSubmitButtonWrapper, children: (0, jsx_runtime_1.jsx)(FieldSubmitButton_1.FieldSubmitButton, { showTooltip: false, className: styles_module_scss_1.default.mobileSubmitButton, fullWidth: true, active: submitEnabled, handleClick: onSubmit, size: 's' }) })] }));
|
|
31
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MobileFieldAi';
|
|
@@ -1,17 +0,0 @@
|
|
|
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("./MobileFieldAi"), exports);
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
.scrollContainer{
|
|
2
|
-
border-radius:4px;
|
|
3
|
-
padding:6px 0;
|
|
4
|
-
}
|
|
5
|
-
.scrollContainer [data-overlayscrollbars-contents]{
|
|
6
|
-
display:flex;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.textarea{
|
|
10
|
-
overflow:hidden;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.mobileInputWrapper{
|
|
14
|
-
--max-rows:1000;
|
|
15
|
-
--min-rows:3;
|
|
16
|
-
display:flex;
|
|
17
|
-
position:relative;
|
|
18
|
-
gap:8px;
|
|
19
|
-
}
|
|
20
|
-
.mobileInputWrapper .scrollContainer{
|
|
21
|
-
min-height:calc(var(--min-rows) * var(--row-height) + var(--horizontal-scroll-bar-height));
|
|
22
|
-
max-height:calc(var(--max-rows) * var(--row-height) + var(--horizontal-scroll-bar-height));
|
|
23
|
-
}
|
|
24
|
-
.mobileInputWrapper .textarea{
|
|
25
|
-
font-family:var(--sans-body-l-font-family, SB Sans Interface);
|
|
26
|
-
font-weight:var(--sans-body-l-font-weight, Regular);
|
|
27
|
-
line-height:var(--sans-body-l-line-height, 24px);
|
|
28
|
-
font-size:var(--sans-body-l-font-size, 16px);
|
|
29
|
-
letter-spacing:var(--sans-body-l-letter-spacing, 0.1px);
|
|
30
|
-
paragraph-spacing:var(--sans-body-l-paragraph-spacing, 8.8px);
|
|
31
|
-
padding-right:calc(42px + var(--size-fields-scroll-bar-width, 8px));
|
|
32
|
-
}
|
|
33
|
-
.mobileInputWrapper .textarea::-moz-placeholder{
|
|
34
|
-
color:var(--sys-neutral-text-disabled, #aaaebd);
|
|
35
|
-
}
|
|
36
|
-
.mobileInputWrapper .textarea::placeholder{
|
|
37
|
-
color:var(--sys-neutral-text-disabled, #aaaebd);
|
|
38
|
-
}
|
|
39
|
-
.mobileInputWrapper[data-size=s]{
|
|
40
|
-
--row-height:var(--sans-body-s-line-height, 16px);
|
|
41
|
-
--horizontal-scroll-bar-height:var(--dimension-050m, 4px);
|
|
42
|
-
}
|
|
43
|
-
.mobileInputWrapper[data-size=m]{
|
|
44
|
-
--row-height:var(--sans-body-m-line-height, 20px);
|
|
45
|
-
--horizontal-scroll-bar-height:calc(var(--dimension-025m, 2px) + var(--dimension-050m, 4px));
|
|
46
|
-
}
|
|
47
|
-
.mobileInputWrapper[data-size=l]{
|
|
48
|
-
--row-height:var(--sans-body-l-line-height, 24px);
|
|
49
|
-
--horizontal-scroll-bar-height:var(--dimension-1m, 8px);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.mobileSubmitButtonWrapper{
|
|
53
|
-
width:32px;
|
|
54
|
-
height:32px;
|
|
55
|
-
display:flex;
|
|
56
|
-
flex-shrink:0;
|
|
57
|
-
position:absolute;
|
|
58
|
-
bottom:0;
|
|
59
|
-
right:10px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.mobileSubmitButton{
|
|
63
|
-
position:relative !important;
|
|
64
|
-
flex-shrink:0 !important;
|
|
65
|
-
}
|
|
66
|
-
.mobileSubmitButton:not([data-disabled]){
|
|
67
|
-
background:radial-gradient(229.88% 112% at 37.5% 77.08%, #26D07C 19.86%, #5FD7C2 50.73%, #7CB5F2 89.88%);
|
|
68
|
-
}
|
|
69
|
-
.mobileSubmitButton:after{
|
|
70
|
-
content:"";
|
|
71
|
-
display:flex;
|
|
72
|
-
width:48px;
|
|
73
|
-
height:48px;
|
|
74
|
-
position:absolute;
|
|
75
|
-
top:50%;
|
|
76
|
-
left:50%;
|
|
77
|
-
transform:translate(-50%, -50%);
|
|
78
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
|
|
2
|
-
import { ValidationPassword, ValidationPasswordKey } from '../../utils';
|
|
3
|
-
export type WithPasswordTooltipProps = WithLayoutType<{
|
|
4
|
-
passwordValidation: ValidationPassword;
|
|
5
|
-
animatedKey?: ValidationPasswordKey | null;
|
|
6
|
-
}>;
|
|
7
|
-
export declare function PasswordValidation({ passwordValidation, layoutType, animatedKey }: WithPasswordTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
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.PasswordValidation = PasswordValidation;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
10
|
-
const helpers_1 = require("../../../../helpers");
|
|
11
|
-
const CheckItem_1 = require("../CheckItem");
|
|
12
|
-
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
13
|
-
function PasswordValidation({ passwordValidation, layoutType, animatedKey }) {
|
|
14
|
-
const { t } = (0, uikit_product_locale_1.useLocale)('FieldsPredefined');
|
|
15
|
-
const allCriteriaMet = (0, react_1.useMemo)(() => Object.values(passwordValidation).every(item => item), [passwordValidation]);
|
|
16
|
-
const isTouchDevice = (0, helpers_1.isTouchDevice)(layoutType);
|
|
17
|
-
if (isTouchDevice) {
|
|
18
|
-
if (allCriteriaMet) {
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.validationItemsContainer, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: true, label: t('FieldAi.secret.passwordTooltip.titleSuccess'), layoutType: layoutType, shouldHide: false }) }));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.validationItemsContainer, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.validationList, children: [(0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.minLength, label: t('FieldAi.secret.passwordTooltip.minLength'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'minLength' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.onlyLatin, label: t('FieldAi.secret.passwordTooltip.onlyLatin'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'onlyLatin' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasLetterCases, label: t('FieldAi.secret.passwordTooltip.hasLetterCases'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasLetterCases' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasNumber, label: t('FieldAi.secret.passwordTooltip.hasNumber'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasNumber' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasSymbol, label: t('FieldAi.secret.passwordTooltip.hasSymbol'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasSymbol' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.noSpaces, label: t('FieldAi.secret.passwordTooltip.noSpaces'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'noSpaces' })] }) }));
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './PasswordValidation';
|
|
@@ -1,17 +0,0 @@
|
|
|
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("./PasswordValidation"), exports);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
.tooltipText{
|
|
2
|
-
display:flex;
|
|
3
|
-
flex-direction:column;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.validationList{
|
|
7
|
-
display:flex;
|
|
8
|
-
flex-direction:column;
|
|
9
|
-
gap:12px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.validationItemsContainer{
|
|
13
|
-
font-family:var(--sans-body-m-font-family, SB Sans Interface);
|
|
14
|
-
font-weight:var(--sans-body-m-font-weight, Regular);
|
|
15
|
-
line-height:var(--sans-body-m-line-height, 20px);
|
|
16
|
-
font-size:var(--sans-body-m-font-size, 14px);
|
|
17
|
-
letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
|
|
18
|
-
paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
|
|
19
|
-
color:var(--sys-neutral-text-main, #41424e);
|
|
20
|
-
display:flex;
|
|
21
|
-
flex-direction:column;
|
|
22
|
-
gap:12px;
|
|
23
|
-
}
|
|
24
|
-
.validationItemsContainer[data-layout-type=mobile], .validationItemsContainer[data-layout-type=tablet]{
|
|
25
|
-
gap:8px;
|
|
26
|
-
font-family:var(--sans-body-s-font-family, SB Sans Interface);
|
|
27
|
-
font-weight:var(--sans-body-s-font-weight, Regular);
|
|
28
|
-
line-height:var(--sans-body-s-line-height, 16px);
|
|
29
|
-
font-size:var(--sans-body-s-font-size, 12px);
|
|
30
|
-
letter-spacing:var(--sans-body-s-letter-spacing, 0.1px);
|
|
31
|
-
paragraph-spacing:var(--sans-body-s-paragraph-spacing, 6.6px);
|
|
32
|
-
padding:8px 16px;
|
|
33
|
-
}
|
|
34
|
-
.validationItemsContainer[data-layout-type=mobile] .validationList, .validationItemsContainer[data-layout-type=tablet] .validationList{
|
|
35
|
-
gap:2px;
|
|
36
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ChangeEvent, FocusEventHandler, KeyboardEventHandler, RefAttributes } from 'react';
|
|
2
|
-
import { InputPrivateProps } from '@snack-uikit/input-private';
|
|
3
|
-
import { WithSupportProps } from '@snack-uikit/utils';
|
|
4
|
-
export type TextAreaProps = RefAttributes<HTMLTextAreaElement> & WithSupportProps<{
|
|
5
|
-
/** HTML-аттрибут name */
|
|
6
|
-
name?: string;
|
|
7
|
-
/** HTML-аттрибут value */
|
|
8
|
-
value?: string;
|
|
9
|
-
/** Колбек смены значения */
|
|
10
|
-
onChange?(value: string, e: ChangeEvent<HTMLTextAreaElement>): void;
|
|
11
|
-
/** HTML-аттрибут id */
|
|
12
|
-
id?: string;
|
|
13
|
-
className?: string;
|
|
14
|
-
/** Плейсхолдер */
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
/** Является ли поле доступным только на чтение */
|
|
17
|
-
readonly?: boolean;
|
|
18
|
-
/** Является ли поле деактивированным */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/** Включен ли автокомплит */
|
|
21
|
-
autoComplete?: boolean;
|
|
22
|
-
/** Максимальное кол-во символов */
|
|
23
|
-
maxLength?: number;
|
|
24
|
-
/** Колбек получения фокуса */
|
|
25
|
-
onFocus?: FocusEventHandler<HTMLTextAreaElement>;
|
|
26
|
-
/** Колбек потери фокуса */
|
|
27
|
-
onBlur?: FocusEventHandler<HTMLTextAreaElement>;
|
|
28
|
-
/** Колбек нажатия клавиши клавиатуры */
|
|
29
|
-
onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>;
|
|
30
|
-
/** HTML-аттрибут tab-index */
|
|
31
|
-
tabIndex?: number;
|
|
32
|
-
/** Минимальное кол-во строк, до которого размер поля может быть увеличен @default 3*/
|
|
33
|
-
minRows?: number;
|
|
34
|
-
/** Включение проверки орфографии @default true*/
|
|
35
|
-
spellCheck?: boolean;
|
|
36
|
-
/** Режим работы экранной клавиатуры */
|
|
37
|
-
inputMode?: InputPrivateProps['inputMode'];
|
|
38
|
-
}>;
|
|
39
|
-
export declare const TextArea: import("react").ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & RefAttributes<HTMLTextAreaElement>>;
|