techsbcn-storybook 0.13.3 → 0.14.1
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/dist/components/fields/SelectFieldComponent/SelectAsyncField.d.ts +2 -0
- package/dist/components/fields/SelectFieldComponent/SelectField.d.ts +3 -0
- package/dist/components/fields/TextFieldComponent/TextFieldComponent.d.ts +1 -2
- package/dist/components/fields/TextSimpleComponent/TextSimpleComponent.d.ts +2 -1
- package/dist/components/forms/ChangePasswordForm.d.ts +1 -0
- package/dist/components/tables/SimpleTableComponent/SimpleTableComponent.d.ts +2 -2
- package/dist/components/tables/TableComponent/TableComponent.d.ts +2 -2
- package/dist/data/_globalization/es.d.ts +1 -0
- package/dist/techsbcn-storybook.cjs.development.js +68 -47
- package/dist/techsbcn-storybook.cjs.development.js.map +1 -1
- package/dist/techsbcn-storybook.cjs.production.min.js +1 -1
- package/dist/techsbcn-storybook.cjs.production.min.js.map +1 -1
- package/dist/techsbcn-storybook.esm.js +68 -47
- package/dist/techsbcn-storybook.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/fields/SelectFieldComponent/SelectAsyncField.tsx +5 -0
- package/src/components/fields/SelectFieldComponent/SelectField.tsx +7 -0
- package/src/components/fields/TextFieldComponent/TextFieldComponent.tsx +1 -1
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.scss +2 -2
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.tsx +4 -3
- package/src/components/forms/ChangePasswordForm.tsx +15 -12
- package/src/components/forms/LoginForm.tsx +10 -10
- package/src/components/forms/ResetPasswordForm.tsx +5 -7
- package/src/components/tables/SimpleTableComponent/SimpleTableComponent.tsx +3 -3
- package/src/components/tables/TableComponent/TableComponent.tsx +3 -3
- package/src/components/wrappers/MainWrapperComponent/MainWrapperComponent.tsx +29 -31
- package/src/data/Values.tsx +1 -0
- package/src/data/_globalization/es.js +1 -0
- package/src/interfaces/search/SearchFilters.tsx +1 -1
- package/src/stories/Fields/Fields.stories.tsx +1 -1
- package/src/stories/Tables/Tables.stories.tsx +12 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SearchFilters } from '../../../interfaces';
|
|
3
3
|
import './SelectField.scss';
|
|
4
|
+
declare type MenuPlacement = 'bottom' | 'auto' | 'top';
|
|
4
5
|
interface SelectAsyncFieldProps {
|
|
5
6
|
name: string;
|
|
6
7
|
placeholder?: string;
|
|
@@ -18,6 +19,7 @@ interface SelectAsyncFieldProps {
|
|
|
18
19
|
filters?: any;
|
|
19
20
|
inputRef?: React.Ref<any>;
|
|
20
21
|
label?: string;
|
|
22
|
+
menuPlacement?: MenuPlacement;
|
|
21
23
|
}
|
|
22
24
|
export declare const SelectAsyncField: React.FunctionComponent<SelectAsyncFieldProps>;
|
|
23
25
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './SelectField.scss';
|
|
3
|
+
declare type MenuPlacement = 'bottom' | 'auto' | 'top';
|
|
3
4
|
interface SelectFieldProps {
|
|
4
5
|
name: string;
|
|
5
6
|
placeholder?: string;
|
|
@@ -16,6 +17,8 @@ interface SelectFieldProps {
|
|
|
16
17
|
isSearchable?: boolean;
|
|
17
18
|
inputRef?: React.Ref<any>;
|
|
18
19
|
label?: string;
|
|
20
|
+
menuPlacement?: MenuPlacement;
|
|
21
|
+
isLoading?: boolean;
|
|
19
22
|
}
|
|
20
23
|
export declare const SelectField: React.FunctionComponent<SelectFieldProps>;
|
|
21
24
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './TextFieldComponent.scss';
|
|
3
3
|
export declare type InputType = 'text' | 'radio' | 'checkbox' | 'textarea' | 'submit' | 'date' | 'hidden' | 'number' | 'range' | 'password' | 'time' | 'file';
|
|
4
|
-
interface TextFieldComponentProps {
|
|
4
|
+
export interface TextFieldComponentProps {
|
|
5
5
|
id?: string;
|
|
6
6
|
label?: string;
|
|
7
7
|
name?: string;
|
|
@@ -31,4 +31,3 @@ interface TextFieldComponentProps {
|
|
|
31
31
|
noBorders?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export declare const TextFieldComponent: React.FC<TextFieldComponentProps>;
|
|
34
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './TextSimpleComponent.scss';
|
|
3
3
|
interface TextSimpleComponentProps {
|
|
4
|
-
label?:
|
|
4
|
+
label?: any;
|
|
5
5
|
value?: any;
|
|
6
6
|
className?: string;
|
|
7
7
|
error?: boolean;
|
|
@@ -11,6 +11,7 @@ interface TextSimpleComponentProps {
|
|
|
11
11
|
noBorders?: boolean;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
noMargin?: boolean;
|
|
14
|
+
isLoading?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare const TextSimpleComponent: React.FC<TextSimpleComponentProps>;
|
|
16
17
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ObjectKey } from '../../../interfaces';
|
|
3
3
|
import './SimpleTableComponent.scss';
|
|
4
|
-
import {
|
|
4
|
+
import { TextFieldComponentProps } from '../../fields/TextFieldComponent/TextFieldComponent';
|
|
5
5
|
interface SimpleTableComponentProps {
|
|
6
6
|
rows: any[];
|
|
7
7
|
values: ObjectKey;
|
|
@@ -65,7 +65,7 @@ interface ActionProps {
|
|
|
65
65
|
}
|
|
66
66
|
interface EditableCellProps {
|
|
67
67
|
isTextField?: {
|
|
68
|
-
|
|
68
|
+
textFieldProps?: TextFieldComponentProps;
|
|
69
69
|
onCellValueChange: (data: any) => void;
|
|
70
70
|
};
|
|
71
71
|
isSelectField?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SearchFilters, ObjectKey } from '../../../interfaces';
|
|
3
3
|
import './TableComponent.scss';
|
|
4
|
-
import {
|
|
4
|
+
import { TextFieldComponentProps } from '../../fields/TextFieldComponent/TextFieldComponent';
|
|
5
5
|
interface TableComponentProps {
|
|
6
6
|
rows: any[];
|
|
7
7
|
values: ObjectKey;
|
|
@@ -67,7 +67,7 @@ interface ActionProps {
|
|
|
67
67
|
}
|
|
68
68
|
interface EditableCellProps {
|
|
69
69
|
isTextField?: {
|
|
70
|
-
|
|
70
|
+
textFieldProps?: TextFieldComponentProps;
|
|
71
71
|
onCellValueChange: (data: any) => void;
|
|
72
72
|
};
|
|
73
73
|
isSelectField?: {
|
|
@@ -259,10 +259,12 @@ var css_248z$3 = ".main-wrapper-component {\n background-color: white;\n box-s
|
|
|
259
259
|
styleInject(css_248z$3);
|
|
260
260
|
|
|
261
261
|
var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
262
|
-
return React__default.createElement(
|
|
262
|
+
return React__default.createElement(_.Box, {
|
|
263
263
|
className: "main-wrapper-component",
|
|
264
264
|
height: "100%"
|
|
265
265
|
}, React__default.createElement(_.Box, {
|
|
266
|
+
height: "4px"
|
|
267
|
+
}, props.loadingProgressBar && React__default.createElement(LinearProgressComponent, null)), React__default.createElement(_.Box, {
|
|
266
268
|
py: 2
|
|
267
269
|
}, props.loading ? React__default.createElement(_.Box, {
|
|
268
270
|
display: "flex",
|
|
@@ -287,7 +289,7 @@ var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
|
287
289
|
px: 2
|
|
288
290
|
}, React__default.createElement(_.CircularProgress, {
|
|
289
291
|
className: "circular-progress-main-color"
|
|
290
|
-
})) : React__default.createElement(React__default.Fragment, null))))
|
|
292
|
+
})) : React__default.createElement(React__default.Fragment, null))));
|
|
291
293
|
};
|
|
292
294
|
|
|
293
295
|
var css_248z$4 = ".table-component .paper-container {\n box-shadow: none;\n background-color: transparent !important;\n}\n.table-component .paper-container .checkbox-cell .MuiCheckbox-root {\n padding: 0 !important;\n}\n.table-component .paper-container .checkbox-cell .MuiCheckbox-root:hover {\n background-color: transparent !important;\n}\n.table-component .paper-container .checkbox-cell .Mui-checked {\n color: rgba(0, 0, 0, 0.54) !important;\n}\n.table-component .paper-container .checkbox-cell .MuiCheckbox-indeterminate {\n color: #212529 !important;\n}\n.table-component .paper-container .table-container {\n max-height: 68vh;\n border-bottom: 1px solid black;\n}\n.table-component .paper-container .table-container .table-column:first-child {\n border-radius: 5px 0 0 5px;\n}\n.table-component .paper-container .table-container .table-column:last-child {\n border-right: none !important;\n border-radius: 0 5px 5px 0;\n}\n.table-component .paper-container .table-container .table-column {\n font-weight: bold;\n font-size: 1rem !important;\n padding: 10px !important;\n border-top: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n border-bottom: 2px solid #e0e0e0;\n}\n.table-component .paper-container .table-container .table-column .table-header-cell {\n color: black;\n padding: 0px 10px 0px 10px !important;\n}\n.table-component .paper-container .table-container .table-rows.row-click {\n cursor: pointer;\n}\n.table-component .paper-container .table-container .table-rows.row-click:hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.table-component .paper-container .table-container .table-rows.Mui-selected {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.table-component .paper-container .table-container .table-rows .Mui-selected {\n background-color: transparent !important;\n}\n.table-component .paper-container .table-container .table-rows .MuiTableCell-root {\n padding: 6px !important;\n overflow: hidden;\n}\n.table-component .paper-container .table-container .table-rows .img-table {\n width: 100%;\n height: 110px;\n}\n.table-component .paper-container .table-container .table-rows .img-table img {\n object-fit: contain;\n}\n.table-component .paper-container .table-container .table-rows .actions {\n float: right;\n}\n.table-component .paper-container .table-container .table-rows .btn-action {\n color: rgba(0, 0, 0, 0.54);\n display: inline-block;\n text-decoration: none;\n font-size: 1.6em !important;\n padding: 0px 7px;\n cursor: pointer;\n}\n.table-component .paper-container .MuiTable-root.loading {\n opacity: 0.5;\n}\n.table-component .paper-container .MuiTable-root.loading .MuiCircularProgress-root {\n width: 80px !important;\n height: 80px !important;\n position: absolute;\n left: 0;\n right: 0;\n top: 5px;\n margin: auto;\n color: grey;\n}\n.table-component .paper-container .MuiTablePagination-root {\n overflow: unset;\n}\n.table-component .paper-container .MuiTablePagination-root .MuiToolbar-root {\n justify-content: center !important;\n flex-wrap: wrap;\n padding: 0px !important;\n}\n.table-component .paper-container .MuiTablePagination-root .MuiTablePagination-spacer {\n flex: 0 !important;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination .MuiPaginationItem-page {\n border-radius: 0px;\n margin: 1px;\n color: white !important;\n background-color: #3f4d67;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination .MuiPaginationItem-page.Mui-selected {\n background-color: #3299C7;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination li button {\n padding: 14px;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination li:nth-child(2) .MuiPaginationItem-page {\n border-radius: 5px 0 0 5px !important;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination li:nth-last-child(2) .MuiPaginationItem-page {\n border-radius: 0 5px 5px 0 !important;\n}\n@media (max-width: 992px) {\n .table-component .paper-container .table-container {\n max-height: 60vh;\n border-top: 1px solid #cccccc;\n }\n .table-component .paper-container .table-container .MuiTable-root {\n border-collapse: collapse !important;\n }\n .table-component .paper-container .table-container .MuiTableHead-root {\n display: none !important;\n }\n .table-component .paper-container .table-container .table-rows {\n border-bottom: 2px solid #cccccc;\n }\n .table-component .paper-container .table-container .table-rows .MuiTableCell-root {\n width: auto;\n border-bottom: none !important;\n }\n .table-component .paper-container .table-container .table-rows .MuiTableCell-root .label-cell {\n font-size: 1rem;\n vertical-align: top;\n width: 50%;\n height: auto;\n }\n .table-component .paper-container .table-container .table-rows .MuiTableCell-root .label-cell + div {\n display: inline-block;\n }\n .table-component .paper-container .table-container .table-rows .table-cell {\n display: block !important;\n }\n .table-component .paper-container .table-container .table-rows .format-value {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: 50%;\n max-width: 299px;\n }\n}";
|
|
@@ -557,12 +559,11 @@ var TableComponent = function TableComponent(props) {
|
|
|
557
559
|
setUpdate();
|
|
558
560
|
};
|
|
559
561
|
|
|
560
|
-
return React__default.createElement(TextFieldComponent, {
|
|
561
|
-
type: editableCell.isTextField.type,
|
|
562
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
562
563
|
onChange: handleTextFieldChange,
|
|
563
564
|
name: fieldName,
|
|
564
565
|
defaultValue: value
|
|
565
|
-
});
|
|
566
|
+
}));
|
|
566
567
|
} else {
|
|
567
568
|
return value;
|
|
568
569
|
}
|
|
@@ -933,12 +934,11 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
933
934
|
setUpdate();
|
|
934
935
|
};
|
|
935
936
|
|
|
936
|
-
return React__default.createElement(TextFieldComponent, {
|
|
937
|
-
type: editableCell.isTextField.type,
|
|
937
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
938
938
|
onChange: handleTextFieldChange,
|
|
939
939
|
name: fieldName,
|
|
940
940
|
defaultValue: value
|
|
941
|
-
});
|
|
941
|
+
}));
|
|
942
942
|
} else {
|
|
943
943
|
return value;
|
|
944
944
|
}
|
|
@@ -1464,7 +1464,7 @@ ButtonComponent.defaultProps = {
|
|
|
1464
1464
|
component: 'button'
|
|
1465
1465
|
};
|
|
1466
1466
|
|
|
1467
|
-
var css_248z$e = ".text-simple-component .MuiFormLabel-root {\n color: #666666
|
|
1467
|
+
var css_248z$e = ".text-simple-component .MuiFormLabel-root {\n color: #666666;\n font-size: calc(12pt + (14 - 12) * calc(100vw - 300px)/1300) !important;\n transform: translate(0, 0.5px) scale(0.85);\n transform-origin: top left;\n text-overflow: initial !important;\n}\n.text-simple-component .MuiFormLabel-root + .text-simple-box.no-border {\n margin-top: 16px !important;\n}\n.text-simple-component .MuiFormLabel-root + .text-simple-box.no-margin.no-border {\n margin-top: 7px !important;\n}\n.text-simple-component .text-simple-box.no-border {\n border: none !important;\n padding: 0 !important;\n}\n.text-simple-component .text-simple-box {\n color: #666666;\n font-size: 1rem;\n border: 1px solid grey;\n padding: 0.868rem;\n border-radius: 3px !important;\n}\n.text-simple-component .helper-text {\n font-size: 0.85rem !important;\n padding: 0 !important;\n margin-top: 3px;\n line-height: 1.66;\n color: #666666 !important;\n letter-spacing: 0.03333em;\n}\n.text-simple-component .has-error-border {\n border-color: #F24726 !important;\n}\n.text-simple-component .has-error {\n color: #F24726 !important;\n}";
|
|
1468
1468
|
styleInject(css_248z$e);
|
|
1469
1469
|
|
|
1470
1470
|
var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
@@ -1479,7 +1479,10 @@ var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
|
1479
1479
|
width: "" + (props.fullWidth ? 'auto' : 'fit-content')
|
|
1480
1480
|
}, props.startIcon && React__default.createElement(_.Box, {
|
|
1481
1481
|
mr: 1
|
|
1482
|
-
}, props.startIcon), props.
|
|
1482
|
+
}, props.startIcon), props.isLoading ? React__default.createElement(_.CircularProgress, {
|
|
1483
|
+
className: "circular-progress-main-color",
|
|
1484
|
+
size: 20
|
|
1485
|
+
}) : props.value, props.endIcon && React__default.createElement(_.Box, {
|
|
1483
1486
|
ml: "" + (props.fullWidth ? 'auto' : 1)
|
|
1484
1487
|
}, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
|
|
1485
1488
|
className: "helper-text " + (props.error ? 'has-error' : '')
|
|
@@ -1516,13 +1519,16 @@ var SelectField = function SelectField(props) {
|
|
|
1516
1519
|
ref: props.inputRef,
|
|
1517
1520
|
isDisabled: props.disabled,
|
|
1518
1521
|
isClearable: props.isClearable,
|
|
1519
|
-
isSearchable: props.isSearchable
|
|
1522
|
+
isSearchable: props.isSearchable,
|
|
1523
|
+
isLoading: props.isLoading,
|
|
1524
|
+
menuPlacement: props.menuPlacement
|
|
1520
1525
|
}), props.helperText && React__default.createElement("div", {
|
|
1521
1526
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
1522
1527
|
}, props.helperText));
|
|
1523
1528
|
};
|
|
1524
1529
|
SelectField.defaultProps = {
|
|
1525
|
-
isClearable: true
|
|
1530
|
+
isClearable: true,
|
|
1531
|
+
menuPlacement: 'auto'
|
|
1526
1532
|
};
|
|
1527
1533
|
|
|
1528
1534
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2409,13 +2415,15 @@ var SelectAsyncField = function SelectAsyncField(props) {
|
|
|
2409
2415
|
selectRef: props.inputRef,
|
|
2410
2416
|
isDisabled: props.disabled,
|
|
2411
2417
|
isClearable: props.isClearable,
|
|
2412
|
-
loadOptions: loadOptions
|
|
2418
|
+
loadOptions: loadOptions,
|
|
2419
|
+
menuPlacement: props.menuPlacement
|
|
2413
2420
|
}), props.helperText && React__default.createElement("div", {
|
|
2414
2421
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
2415
2422
|
}, props.helperText));
|
|
2416
2423
|
};
|
|
2417
2424
|
SelectAsyncField.defaultProps = {
|
|
2418
|
-
isClearable: true
|
|
2425
|
+
isClearable: true,
|
|
2426
|
+
menuPlacement: 'auto'
|
|
2419
2427
|
};
|
|
2420
2428
|
|
|
2421
2429
|
var LoginForm = function LoginForm(props) {
|
|
@@ -2441,10 +2449,6 @@ var LoginForm = function LoginForm(props) {
|
|
|
2441
2449
|
trigger = _useForm.trigger,
|
|
2442
2450
|
errors = _useForm.formState.errors;
|
|
2443
2451
|
|
|
2444
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2445
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2446
|
-
};
|
|
2447
|
-
|
|
2448
2452
|
return React__default.createElement(material.Box, {
|
|
2449
2453
|
m: 2
|
|
2450
2454
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2485,17 +2489,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2485
2489
|
while (1) {
|
|
2486
2490
|
switch (_context.prev = _context.next) {
|
|
2487
2491
|
case 0:
|
|
2488
|
-
|
|
2492
|
+
if (!(e.key === 'Enter')) {
|
|
2493
|
+
_context.next = 5;
|
|
2494
|
+
break;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
_context.next = 3;
|
|
2489
2498
|
return trigger();
|
|
2490
2499
|
|
|
2491
|
-
case
|
|
2500
|
+
case 3:
|
|
2492
2501
|
result = _context.sent;
|
|
2493
2502
|
|
|
2494
2503
|
if (result) {
|
|
2495
|
-
|
|
2504
|
+
props.onClick(getValues());
|
|
2496
2505
|
}
|
|
2497
2506
|
|
|
2498
|
-
case
|
|
2507
|
+
case 5:
|
|
2499
2508
|
case "end":
|
|
2500
2509
|
return _context.stop();
|
|
2501
2510
|
}
|
|
@@ -2541,17 +2550,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2541
2550
|
while (1) {
|
|
2542
2551
|
switch (_context2.prev = _context2.next) {
|
|
2543
2552
|
case 0:
|
|
2544
|
-
|
|
2553
|
+
if (!(e.key === 'Enter')) {
|
|
2554
|
+
_context2.next = 5;
|
|
2555
|
+
break;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
_context2.next = 3;
|
|
2545
2559
|
return trigger();
|
|
2546
2560
|
|
|
2547
|
-
case
|
|
2561
|
+
case 3:
|
|
2548
2562
|
result = _context2.sent;
|
|
2549
2563
|
|
|
2550
2564
|
if (result) {
|
|
2551
|
-
|
|
2565
|
+
props.onClick(getValues());
|
|
2552
2566
|
}
|
|
2553
2567
|
|
|
2554
|
-
case
|
|
2568
|
+
case 5:
|
|
2555
2569
|
case "end":
|
|
2556
2570
|
return _context2.stop();
|
|
2557
2571
|
}
|
|
@@ -2584,7 +2598,7 @@ var LoginForm = function LoginForm(props) {
|
|
|
2584
2598
|
|
|
2585
2599
|
var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
2586
2600
|
var validationSchema = yup.object().shape({
|
|
2587
|
-
password: yup.string().required(props.requiredText.requiredTextPassword),
|
|
2601
|
+
password: yup.string().required(props.requiredText.requiredTextPassword).matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{6,})/, props.requiredText.requiredPasswordPolices),
|
|
2588
2602
|
passwordConfirmation: yup.string().when('password', function (password, schema) {
|
|
2589
2603
|
if (password) return schema.required(props.requiredText.requiredTextPassword);
|
|
2590
2604
|
}).oneOf([yup.ref('password'), null], props.requiredText.requiredTextSamePassword)
|
|
@@ -2611,10 +2625,6 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2611
2625
|
event.preventDefault();
|
|
2612
2626
|
};
|
|
2613
2627
|
|
|
2614
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2615
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2616
|
-
};
|
|
2617
|
-
|
|
2618
2628
|
return React__default.createElement(_.Box, {
|
|
2619
2629
|
m: 2
|
|
2620
2630
|
}, props.topComponent && React__default.createElement(_.Box, {
|
|
@@ -2655,17 +2665,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2655
2665
|
while (1) {
|
|
2656
2666
|
switch (_context.prev = _context.next) {
|
|
2657
2667
|
case 0:
|
|
2658
|
-
|
|
2668
|
+
if (!(e.key === 'Enter')) {
|
|
2669
|
+
_context.next = 5;
|
|
2670
|
+
break;
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
_context.next = 3;
|
|
2659
2674
|
return trigger();
|
|
2660
2675
|
|
|
2661
|
-
case
|
|
2676
|
+
case 3:
|
|
2662
2677
|
result = _context.sent;
|
|
2663
2678
|
|
|
2664
2679
|
if (result) {
|
|
2665
|
-
|
|
2680
|
+
props.onClick(getValues());
|
|
2666
2681
|
}
|
|
2667
2682
|
|
|
2668
|
-
case
|
|
2683
|
+
case 5:
|
|
2669
2684
|
case "end":
|
|
2670
2685
|
return _context.stop();
|
|
2671
2686
|
}
|
|
@@ -2717,17 +2732,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2717
2732
|
while (1) {
|
|
2718
2733
|
switch (_context2.prev = _context2.next) {
|
|
2719
2734
|
case 0:
|
|
2720
|
-
|
|
2735
|
+
if (!(e.key === 'Enter')) {
|
|
2736
|
+
_context2.next = 5;
|
|
2737
|
+
break;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
_context2.next = 3;
|
|
2721
2741
|
return trigger();
|
|
2722
2742
|
|
|
2723
|
-
case
|
|
2743
|
+
case 3:
|
|
2724
2744
|
result = _context2.sent;
|
|
2725
2745
|
|
|
2726
2746
|
if (result) {
|
|
2727
|
-
|
|
2747
|
+
props.onClick(getValues());
|
|
2728
2748
|
}
|
|
2729
2749
|
|
|
2730
|
-
case
|
|
2750
|
+
case 5:
|
|
2731
2751
|
case "end":
|
|
2732
2752
|
return _context2.stop();
|
|
2733
2753
|
}
|
|
@@ -2773,10 +2793,6 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2773
2793
|
trigger = _useForm.trigger,
|
|
2774
2794
|
errors = _useForm.formState.errors;
|
|
2775
2795
|
|
|
2776
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2777
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2778
|
-
};
|
|
2779
|
-
|
|
2780
2796
|
return React__default.createElement(material.Box, {
|
|
2781
2797
|
m: 2
|
|
2782
2798
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2811,17 +2827,22 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2811
2827
|
while (1) {
|
|
2812
2828
|
switch (_context.prev = _context.next) {
|
|
2813
2829
|
case 0:
|
|
2814
|
-
|
|
2830
|
+
if (!(e.key === 'Enter')) {
|
|
2831
|
+
_context.next = 5;
|
|
2832
|
+
break;
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
_context.next = 3;
|
|
2815
2836
|
return trigger();
|
|
2816
2837
|
|
|
2817
|
-
case
|
|
2838
|
+
case 3:
|
|
2818
2839
|
result = _context.sent;
|
|
2819
2840
|
|
|
2820
2841
|
if (result) {
|
|
2821
|
-
|
|
2842
|
+
props.onClick(getValues());
|
|
2822
2843
|
}
|
|
2823
2844
|
|
|
2824
|
-
case
|
|
2845
|
+
case 5:
|
|
2825
2846
|
case "end":
|
|
2826
2847
|
return _context.stop();
|
|
2827
2848
|
}
|