@cloud-ru/uikit-product-fields-predefined 2.4.6 → 2.4.8-preview-68cf2382.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 +10 -0
- package/README.md +12 -294
- package/dist/cjs/components/index.d.ts +0 -1
- package/dist/cjs/components/index.js +0 -1
- package/dist/esm/components/index.d.ts +0 -1
- package/dist/esm/components/index.js +0 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +5 -8
- package/src/components/index.ts +0 -1
- 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/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/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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './TextArea';
|
|
@@ -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("./TextArea"), exports);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.textarea{
|
|
2
|
-
resize:none;
|
|
3
|
-
box-sizing:border-box;
|
|
4
|
-
width:100%;
|
|
5
|
-
max-width:100%;
|
|
6
|
-
margin:0;
|
|
7
|
-
padding:0;
|
|
8
|
-
color:var(--sys-neutral-text-main, #41424e);
|
|
9
|
-
background-color:transparent;
|
|
10
|
-
border:none;
|
|
11
|
-
border-radius:0;
|
|
12
|
-
outline:0;
|
|
13
|
-
}
|
|
14
|
-
.textarea::-moz-placeholder{
|
|
15
|
-
color:var(--sys-neutral-text-disabled, #aaaebd);
|
|
16
|
-
}
|
|
17
|
-
.textarea::placeholder{
|
|
18
|
-
color:var(--sys-neutral-text-disabled, #aaaebd);
|
|
19
|
-
}
|
|
20
|
-
.textarea::-webkit-scrollbar{
|
|
21
|
-
width:0;
|
|
22
|
-
max-width:0;
|
|
23
|
-
}
|
|
24
|
-
.textarea:-moz-read-only{
|
|
25
|
-
color:var(--sys-neutral-text-support, #6d707f);
|
|
26
|
-
}
|
|
27
|
-
.textarea:read-only{
|
|
28
|
-
color:var(--sys-neutral-text-support, #6d707f);
|
|
29
|
-
}
|
|
30
|
-
.textarea[disabled]{
|
|
31
|
-
color:var(--sys-neutral-text-disabled, #aaaebd);
|
|
32
|
-
}
|
package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
|
|
3
|
-
import { ValidationPassword, ValidationPasswordKey } from '../../utils';
|
|
4
|
-
export type WithPasswordTooltipProps = WithLayoutType<{
|
|
5
|
-
showValidation?: boolean;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
passwordValidation: ValidationPassword;
|
|
8
|
-
animatedKey?: ValidationPasswordKey | null;
|
|
9
|
-
}>;
|
|
10
|
-
export declare function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, animatedKey, }: WithPasswordTooltipProps): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
|
package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js
DELETED
|
@@ -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.WithPasswordValidation = WithPasswordValidation;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const uikit_product_mobile_tooltip_1 = require("@cloud-ru/uikit-product-mobile-tooltip");
|
|
9
|
-
const helpers_1 = require("../../../../helpers");
|
|
10
|
-
const PasswordValidation_1 = require("../PasswordValidation");
|
|
11
|
-
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
12
|
-
function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, animatedKey, }) {
|
|
13
|
-
if ((0, helpers_1.isTouchDevice)(layoutType)) {
|
|
14
|
-
if (showValidation) {
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.validationContainer, children: [(0, jsx_runtime_1.jsx)(PasswordValidation_1.PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedKey }), children] }));
|
|
16
|
-
}
|
|
17
|
-
return children;
|
|
18
|
-
}
|
|
19
|
-
if (showValidation) {
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.AdaptiveTooltip, { placement: 'left-end', layoutType: layoutType, tip: (0, jsx_runtime_1.jsx)(PasswordValidation_1.PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedKey }), offset: 8, children: children }));
|
|
21
|
-
}
|
|
22
|
-
return children;
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './WithPasswordValidation';
|
|
@@ -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("./WithPasswordValidation"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './FieldAi';
|
|
@@ -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("./FieldAi"), exports);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
.wrapper{
|
|
2
|
-
display:flex;
|
|
3
|
-
flex-direction:column;
|
|
4
|
-
gap:var(--dimension-050m, 4px);
|
|
5
|
-
position:relative;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.passwordWrapper{
|
|
9
|
-
gap:0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.alert{
|
|
13
|
-
display:flex;
|
|
14
|
-
gap:8px;
|
|
15
|
-
padding:4px 8px;
|
|
16
|
-
border-radius:8px 8px 0 0;
|
|
17
|
-
border:1px solid var(--sys-blue-decor-activated, #aac4ea);
|
|
18
|
-
background-color:var(--sys-blue-decor-default, #d6e2f4);
|
|
19
|
-
box-sizing:border-box;
|
|
20
|
-
height:38px;
|
|
21
|
-
position:absolute;
|
|
22
|
-
left:0;
|
|
23
|
-
top:-26px;
|
|
24
|
-
width:100%;
|
|
25
|
-
color:var(--sys-neutral-text-main, #41424e);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.alertText{
|
|
29
|
-
flex:1;
|
|
30
|
-
min-width:0;
|
|
31
|
-
color:var(--sys-neutral-text-main, #41424e);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.secured textarea{
|
|
35
|
-
-webkit-text-security:disc;
|
|
36
|
-
text-security:disc;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.mobileSubmitButton{
|
|
40
|
-
position:relative !important;
|
|
41
|
-
flex-shrink:0 !important;
|
|
42
|
-
}
|
|
43
|
-
.mobileSubmitButton:after{
|
|
44
|
-
content:"";
|
|
45
|
-
display:flex;
|
|
46
|
-
width:48px;
|
|
47
|
-
height:48px;
|
|
48
|
-
position:absolute;
|
|
49
|
-
top:50%;
|
|
50
|
-
left:50%;
|
|
51
|
-
transform:translate(-50%, -50%);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.submitButton:not([data-disabled]){
|
|
55
|
-
background:radial-gradient(229.88% 112% at 37.5% 77.08%, #26D07C 19.86%, #5FD7C2 50.73%, #7CB5F2 89.88%);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.textarea > :first-child[data-validation=default]:not([data-readonly]):not([data-disable-focus]):focus-within:not([data-disabled]){
|
|
59
|
-
border-color:transparent;
|
|
60
|
-
background:linear-gradient(var(--sys-neutral-background2-level), var(--sys-neutral-background2-level) 0) padding-box, radial-gradient(57.79% 100% at 50% 0%, #7cb5f2 38%, #5fd7c2 79%, #26d07c 90%) border-box;
|
|
61
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type ValidationPassword = {
|
|
2
|
-
onlyLatin: boolean;
|
|
3
|
-
minLength: boolean;
|
|
4
|
-
hasLetterCases: boolean;
|
|
5
|
-
hasNumber: boolean;
|
|
6
|
-
hasSymbol: boolean;
|
|
7
|
-
noSpaces: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type ValidationPasswordKey = keyof ValidationPassword;
|
|
10
|
-
export declare const getValidationPassword: (password?: string) => ValidationPassword;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getValidationPassword = void 0;
|
|
4
|
-
const MIN_PASSWORD_LENGTH = 8;
|
|
5
|
-
const NUMBER_REGEX = /[0-9]/;
|
|
6
|
-
const CAPITAL_REGEX = /\p{Lu}/u;
|
|
7
|
-
const LOWER_REGEX = /\p{Ll}/u;
|
|
8
|
-
const SYMBOLS_REGEX = /[\p{P}\p{S}]/u;
|
|
9
|
-
const NO_SPACES = /^\S*$/u;
|
|
10
|
-
const LATIN_REGEX = /^[a-zA-Z0-9\p{P}\p{S}]+$/u;
|
|
11
|
-
const getValidationPassword = (password = '') => ({
|
|
12
|
-
onlyLatin: Boolean(password.match(LATIN_REGEX)),
|
|
13
|
-
minLength: password.length >= MIN_PASSWORD_LENGTH,
|
|
14
|
-
hasLetterCases: Boolean(password.match(CAPITAL_REGEX)) && Boolean(password.match(LOWER_REGEX)),
|
|
15
|
-
hasNumber: Boolean(password.match(NUMBER_REGEX)),
|
|
16
|
-
hasSymbol: Boolean(password.match(SYMBOLS_REGEX)),
|
|
17
|
-
noSpaces: Boolean(password.match(NO_SPACES)),
|
|
18
|
-
});
|
|
19
|
-
exports.getValidationPassword = getValidationPassword;
|
|
@@ -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,86 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import cn from 'classnames';
|
|
14
|
-
import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
15
|
-
import { EyeClosedSVG, EyeSVG, PasswordLockSVG } from '@cloud-ru/uikit-product-icons';
|
|
16
|
-
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
17
|
-
import { AdaptiveFieldTextArea, getAdaptiveFieldProps, } from '@cloud-ru/uikit-product-mobile-fields';
|
|
18
|
-
import { ButtonFunction, ButtonOutline } from '@snack-uikit/button';
|
|
19
|
-
import { themeVars } from '@snack-uikit/figma-tokens';
|
|
20
|
-
import { Tooltip } from '@snack-uikit/tooltip';
|
|
21
|
-
import { Typography } from '@snack-uikit/typography';
|
|
22
|
-
import { FieldSubmitButton } from '../../helperComponents/FieldSubmitButton';
|
|
23
|
-
import { TextAreaActionsFooter } from '../../helperComponents/TextAreaActionsFooter';
|
|
24
|
-
import { isTouchDevice as isTouchDeviceHelper } from '../../helpers';
|
|
25
|
-
import { AIDisclaimer } from '../AIDisclaimer/AIDisclaimer';
|
|
26
|
-
import { AlertButton } from './components/AlertButton';
|
|
27
|
-
import { MobileFieldAi } from './components/MobileFieldAi';
|
|
28
|
-
import { WithPasswordValidation } from './components/WithPasswordValidation';
|
|
29
|
-
import styles from './styles.module.css';
|
|
30
|
-
import { getValidationPassword } from './utils';
|
|
31
|
-
export const FieldAi = forwardRef((_a, ref) => {
|
|
32
|
-
var { secure = false, onSubmit: handleSubmitProp, value, onResetContextClick, onCancelSecure, disabled, className } = _a, props = __rest(_a, ["secure", "onSubmit", "value", "onResetContextClick", "onCancelSecure", "disabled", "className"]);
|
|
33
|
-
const { layoutType, validationState } = props;
|
|
34
|
-
const { t } = useLocale('FieldsPredefined');
|
|
35
|
-
const isTouchDevice = isTouchDeviceHelper(layoutType);
|
|
36
|
-
const [isValueHidden, setIsValueHidden] = useState(true);
|
|
37
|
-
const [animatedValidationKey, setAnimatedValidationKey] = useState(null);
|
|
38
|
-
const timerRef = useRef(null);
|
|
39
|
-
const isValueValid = typeof value === 'string' && value.trim().length > 0;
|
|
40
|
-
const isPasswordMode = secure === 'password';
|
|
41
|
-
const passwordValidation = useMemo(() => getValidationPassword(value), [value]);
|
|
42
|
-
const isPasswordValid = isPasswordMode ? Object.values(passwordValidation).every(Boolean) : true;
|
|
43
|
-
const showPasswordError = !isPasswordValid && secure && value;
|
|
44
|
-
const showPasswordAlert = Boolean(onCancelSecure) && secure === 'password';
|
|
45
|
-
useEffect(() => () => {
|
|
46
|
-
if (timerRef.current) {
|
|
47
|
-
clearTimeout(timerRef.current);
|
|
48
|
-
}
|
|
49
|
-
}, []);
|
|
50
|
-
const handleSubmit = () => {
|
|
51
|
-
if (isValueValid && isPasswordValid) {
|
|
52
|
-
handleSubmitProp(value);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const triggerValidationHighlight = (key) => {
|
|
56
|
-
setAnimatedValidationKey(key);
|
|
57
|
-
timerRef.current = setTimeout(() => {
|
|
58
|
-
setAnimatedValidationKey(null);
|
|
59
|
-
}, 1000);
|
|
60
|
-
};
|
|
61
|
-
const handleKeyDown = event => {
|
|
62
|
-
if (isTouchDevice) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (isPasswordMode && event.key.length === 1) {
|
|
66
|
-
const isLetter = /\p{L}/u.test(event.key);
|
|
67
|
-
const isLatinLetter = /^[a-zA-Z]$/.test(event.key);
|
|
68
|
-
if (isLetter && !isLatinLetter) {
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
triggerValidationHighlight('onlyLatin');
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (event.key === 'Enter' && !event.shiftKey) {
|
|
75
|
-
event.preventDefault();
|
|
76
|
-
if (!disabled) {
|
|
77
|
-
handleSubmit();
|
|
78
|
-
}
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
if (isTouchDevice && !secure) {
|
|
83
|
-
return (_jsx(MobileFieldAi, Object.assign({}, props, getAdaptiveFieldProps(props), { onSubmit: handleSubmit, submitEnabled: isValueValid && !disabled, ref: ref, value: value })));
|
|
84
|
-
}
|
|
85
|
-
return (_jsxs("div", { className: cn(styles.wrapper, isPasswordMode && styles.passwordWrapper, className), children: [showPasswordAlert && (_jsxs("div", { className: styles.alert, children: [_jsx(PasswordLockSVG, { size: 16, color: themeVars.sys.neutral.textSupport }), _jsx(Typography.SansBodyS, { className: styles.alertText, children: t('FieldAi.secret.alert.text') }), _jsx(AlertButton, { label: t('FieldAi.secret.alert.button'), onClick: onCancelSecure })] })), _jsx(WithPasswordValidation, { showValidation: isPasswordMode, passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedValidationKey, children: _jsx(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: cn(styles.textarea, secure && isValueHidden ? styles.secured : undefined), onKeyDown: handleKeyDown, spellCheck: !secure, validationState: showPasswordError ? 'error' : validationState, footer: _jsx(TextAreaActionsFooter, { left: secure && (_jsx(ButtonFunction, { size: 'xs', icon: isValueHidden ? _jsx(EyeSVG, {}) : _jsx(EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev) })), right: _jsxs(_Fragment, { children: [secure && onResetContextClick && (_jsx(Tooltip, { tip: t('FieldAi.resetContext.tooltip'), hoverDelayOpen: 600, children: _jsx(ButtonOutline, { size: 'xs', label: t('FieldAi.resetContext.label'), onClick: onResetContextClick, appearance: 'destructive' }) })), _jsx(FieldSubmitButton, { showTooltip: !isTouchDevice, className: cn(styles.submitButton, isTouchDevice ? styles.mobileSubmitButton : undefined), active: isValueValid && !disabled && isPasswordValid, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })) }), !isPasswordMode && _jsx(AIDisclaimer, { layoutType: layoutType })] }));
|
|
86
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Typography } from '@snack-uikit/typography';
|
|
3
|
-
import styles from './styles.module.css';
|
|
4
|
-
export function AlertButton({ label, onClick }) {
|
|
5
|
-
return (_jsx("button", { onClick: onClick, className: styles.button, children: _jsx(Typography.SansLabelM, { className: styles.label, children: label }) }));
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AlertButton';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AlertButton';
|
|
@@ -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,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { CheckSVG } from '@cloud-ru/uikit-product-icons';
|
|
4
|
-
import { Typography } from '@snack-uikit/typography';
|
|
5
|
-
import styles from './styles.module.css';
|
|
6
|
-
const CHECKED_ITEM_DISAPPEAR_TIMEOUT = 500;
|
|
7
|
-
export function CheckItem({ label, checked, layoutType, shouldHide = false, animated = false }) {
|
|
8
|
-
const [visible, setVisible] = useState(checked);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (checked) {
|
|
11
|
-
const timeoutId = setTimeout(() => {
|
|
12
|
-
setVisible(false);
|
|
13
|
-
}, CHECKED_ITEM_DISAPPEAR_TIMEOUT);
|
|
14
|
-
return () => clearTimeout(timeoutId);
|
|
15
|
-
}
|
|
16
|
-
setVisible(true);
|
|
17
|
-
}, [checked]);
|
|
18
|
-
if (shouldHide && !visible) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
return (_jsxs("div", { className: styles.checkItem, "data-layout-type": layoutType, "data-animated": animated, children: [_jsx(CheckSVG, { size: 16, className: styles.icon, "data-checked": checked }), _jsx(Typography.SansBodyM, { className: styles.label, "data-checked": checked, children: label })] }));
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './CheckItem';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './CheckItem';
|
|
@@ -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,25 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { forwardRef } from 'react';
|
|
14
|
-
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
15
|
-
import { Scroll } from '@snack-uikit/scroll';
|
|
16
|
-
import { FieldSubmitButton } from '../../../../helperComponents/FieldSubmitButton';
|
|
17
|
-
import { TextArea } from '../TextArea';
|
|
18
|
-
import styles from './styles.module.css';
|
|
19
|
-
const MIN_ROWS = 1;
|
|
20
|
-
const MAX_ROWS = 6;
|
|
21
|
-
export const MobileFieldAi = forwardRef((_a, ref) => {
|
|
22
|
-
var { onSubmit, value, submitEnabled } = _a, props = __rest(_a, ["onSubmit", "value", "submitEnabled"]);
|
|
23
|
-
const { t } = useLocale('FieldsPredefined');
|
|
24
|
-
return (_jsxs("div", { className: styles.mobileInputWrapper, style: { '--max-rows': MAX_ROWS, '--min-rows': MIN_ROWS }, "data-size": 'm', children: [_jsx(Scroll, { className: styles.scrollContainer, size: 's', barHideStrategy: 'never', children: _jsx(TextArea, Object.assign({}, props, { className: styles.textarea, ref: ref, value: value, minRows: MIN_ROWS, placeholder: t('FieldAi.regular.placeholder'), spellCheck: true })) }), _jsx("div", { className: styles.mobileSubmitButtonWrapper, children: _jsx(FieldSubmitButton, { showTooltip: false, className: styles.mobileSubmitButton, fullWidth: true, active: submitEnabled, handleClick: onSubmit, size: 's' }) })] }));
|
|
25
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MobileFieldAi';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MobileFieldAi';
|
|
@@ -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,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
4
|
-
import { isTouchDevice as isTouchDeviceHelper } from '../../../../helpers';
|
|
5
|
-
import { CheckItem } from '../CheckItem';
|
|
6
|
-
import styles from './styles.module.css';
|
|
7
|
-
export function PasswordValidation({ passwordValidation, layoutType, animatedKey }) {
|
|
8
|
-
const { t } = useLocale('FieldsPredefined');
|
|
9
|
-
const allCriteriaMet = useMemo(() => Object.values(passwordValidation).every(item => item), [passwordValidation]);
|
|
10
|
-
const isTouchDevice = isTouchDeviceHelper(layoutType);
|
|
11
|
-
if (isTouchDevice) {
|
|
12
|
-
if (allCriteriaMet) {
|
|
13
|
-
return (_jsx("div", { className: styles.validationItemsContainer, "data-layout-type": layoutType, children: _jsx(CheckItem, { checked: true, label: t('FieldAi.secret.passwordTooltip.titleSuccess'), layoutType: layoutType, shouldHide: false }) }));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return (_jsx("div", { className: styles.validationItemsContainer, "data-layout-type": layoutType, children: _jsxs("div", { className: styles.validationList, children: [_jsx(CheckItem, { checked: passwordValidation.minLength, label: t('FieldAi.secret.passwordTooltip.minLength'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'minLength' }), _jsx(CheckItem, { checked: passwordValidation.onlyLatin, label: t('FieldAi.secret.passwordTooltip.onlyLatin'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'onlyLatin' }), _jsx(CheckItem, { checked: passwordValidation.hasLetterCases, label: t('FieldAi.secret.passwordTooltip.hasLetterCases'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasLetterCases' }), _jsx(CheckItem, { checked: passwordValidation.hasNumber, label: t('FieldAi.secret.passwordTooltip.hasNumber'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasNumber' }), _jsx(CheckItem, { checked: passwordValidation.hasSymbol, label: t('FieldAi.secret.passwordTooltip.hasSymbol'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasSymbol' }), _jsx(CheckItem, { checked: passwordValidation.noSpaces, label: t('FieldAi.secret.passwordTooltip.noSpaces'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'noSpaces' })] }) }));
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './PasswordValidation';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './PasswordValidation';
|