techsbcn-storybook 0.13.4 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1 -0
- package/dist/components/forms/ChangePasswordForm.d.ts +1 -0
- package/dist/components/tables/ImageTableComponent/ImageTableComponent.d.ts +8 -0
- package/dist/components/tables/SimpleTableComponent/SimpleTableComponent.d.ts +4 -4
- package/dist/components/tables/TableComponent/TableComponent.d.ts +4 -4
- package/dist/data/_globalization/es.d.ts +1 -0
- package/dist/helpers/FileDownloader.d.ts +5 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/techsbcn-storybook.cjs.development.js +109 -46
- 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 +116 -53
- 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.tsx +3 -2
- 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/ImageTableComponent/ImageTableComponent.tsx +35 -0
- package/src/components/tables/SimpleTableComponent/SimpleTableComponent.tsx +14 -5
- package/src/components/tables/TableComponent/TableComponent.tsx +14 -5
- package/src/components/wrappers/MainWrapperComponent/MainWrapperComponent.tsx +29 -31
- package/src/data/UserList.tsx +7 -6
- package/src/data/Values.tsx +1 -0
- package/src/data/_globalization/es.js +1 -0
- package/src/helpers/FileDownloader.tsx +34 -0
- package/src/helpers/index.tsx +1 -0
- package/src/interfaces/search/SearchFilters.tsx +1 -1
- package/src/stories/Fields/Fields.stories.tsx +1 -1
- package/src/stories/Forms/Forms.stories.tsx +1 -0
- package/src/stories/Tables/Tables.stories.tsx +11 -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 {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ImageTableComponentProps {
|
|
3
|
+
readFile: (guid: string) => Promise<any>;
|
|
4
|
+
guid: string;
|
|
5
|
+
convertImage?: (result: any) => string;
|
|
6
|
+
}
|
|
7
|
+
declare const ImageTableComponent: React.FC<ImageTableComponentProps>;
|
|
8
|
+
export default ImageTableComponent;
|
|
@@ -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;
|
|
@@ -42,8 +42,8 @@ interface ColumnProps {
|
|
|
42
42
|
isImage?: {
|
|
43
43
|
isUrl?: boolean;
|
|
44
44
|
isGuid?: {
|
|
45
|
-
guid:
|
|
46
|
-
|
|
45
|
+
readFile: (guid: string) => Promise<any>;
|
|
46
|
+
convertImage?: (content: any) => string;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
isActiveFunction?: {
|
|
@@ -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;
|
|
@@ -44,8 +44,8 @@ interface ColumnProps {
|
|
|
44
44
|
isImage?: {
|
|
45
45
|
isUrl?: boolean;
|
|
46
46
|
isGuid?: {
|
|
47
|
-
guid:
|
|
48
|
-
|
|
47
|
+
readFile: (guid: string) => Promise<any>;
|
|
48
|
+
convertImage?: (content: any) => string;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
isActiveFunction?: {
|
|
@@ -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?: {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const downloadFileBlob: (binaryString: any) => void;
|
|
2
|
+
export declare const redirectDownload: (url: any, fileName: string) => void;
|
|
3
|
+
export declare const getImageByBlob: (binaryString: any) => string;
|
|
4
|
+
export declare const getImageByBase64: (content: string) => string;
|
|
5
|
+
export declare const toBase64: (file: Blob) => Promise<string>;
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -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}";
|
|
@@ -361,6 +363,36 @@ TextFieldComponent.defaultProps = {
|
|
|
361
363
|
type: 'text'
|
|
362
364
|
};
|
|
363
365
|
|
|
366
|
+
var ImageTableComponent = function ImageTableComponent(props) {
|
|
367
|
+
var _useState = React.useState(false),
|
|
368
|
+
loading = _useState[0],
|
|
369
|
+
setLoading = _useState[1];
|
|
370
|
+
|
|
371
|
+
var _useState2 = React.useState(),
|
|
372
|
+
image = _useState2[0],
|
|
373
|
+
setImage = _useState2[1];
|
|
374
|
+
|
|
375
|
+
React.useEffect(function () {
|
|
376
|
+
setLoading(true);
|
|
377
|
+
props.readFile(props.guid).then(function (result) {
|
|
378
|
+
setImage(props.convertImage ? props.convertImage(result) : result);
|
|
379
|
+
setLoading(false);
|
|
380
|
+
});
|
|
381
|
+
}, [props]);
|
|
382
|
+
return React__default.createElement(material.Box, {
|
|
383
|
+
className: "images-table-component"
|
|
384
|
+
}, loading ? React__default.createElement(material.Box, {
|
|
385
|
+
textAlign: "center"
|
|
386
|
+
}, React__default.createElement(material.CircularProgress, {
|
|
387
|
+
className: "main-color"
|
|
388
|
+
})) : React__default.createElement(material.Avatar, {
|
|
389
|
+
alt: "-",
|
|
390
|
+
src: image,
|
|
391
|
+
className: "img-table",
|
|
392
|
+
variant: "square"
|
|
393
|
+
}));
|
|
394
|
+
};
|
|
395
|
+
|
|
364
396
|
var TableComponent = function TableComponent(props) {
|
|
365
397
|
var _props$isCheckTable7, _props$isCheckTable8, _props$isCheckTable9;
|
|
366
398
|
|
|
@@ -489,6 +521,12 @@ var TableComponent = function TableComponent(props) {
|
|
|
489
521
|
className: "img-table",
|
|
490
522
|
variant: "square"
|
|
491
523
|
});
|
|
524
|
+
} else if (column.isImage.isGuid) {
|
|
525
|
+
return React__default.createElement(ImageTableComponent, {
|
|
526
|
+
guid: value,
|
|
527
|
+
readFile: column.isImage.isGuid.readFile,
|
|
528
|
+
convertImage: column.isImage.isGuid.convertImage
|
|
529
|
+
});
|
|
492
530
|
}
|
|
493
531
|
}
|
|
494
532
|
|
|
@@ -557,12 +595,11 @@ var TableComponent = function TableComponent(props) {
|
|
|
557
595
|
setUpdate();
|
|
558
596
|
};
|
|
559
597
|
|
|
560
|
-
return React__default.createElement(TextFieldComponent, {
|
|
561
|
-
type: editableCell.isTextField.type,
|
|
598
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
562
599
|
onChange: handleTextFieldChange,
|
|
563
600
|
name: fieldName,
|
|
564
601
|
defaultValue: value
|
|
565
|
-
});
|
|
602
|
+
}));
|
|
566
603
|
} else {
|
|
567
604
|
return value;
|
|
568
605
|
}
|
|
@@ -865,6 +902,12 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
865
902
|
className: "img-table",
|
|
866
903
|
variant: "square"
|
|
867
904
|
});
|
|
905
|
+
} else if (column.isImage.isGuid) {
|
|
906
|
+
return React__default.createElement(ImageTableComponent, {
|
|
907
|
+
guid: value,
|
|
908
|
+
readFile: column.isImage.isGuid.readFile,
|
|
909
|
+
convertImage: column.isImage.isGuid.convertImage
|
|
910
|
+
});
|
|
868
911
|
}
|
|
869
912
|
}
|
|
870
913
|
|
|
@@ -933,12 +976,11 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
933
976
|
setUpdate();
|
|
934
977
|
};
|
|
935
978
|
|
|
936
|
-
return React__default.createElement(TextFieldComponent, {
|
|
937
|
-
type: editableCell.isTextField.type,
|
|
979
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
938
980
|
onChange: handleTextFieldChange,
|
|
939
981
|
name: fieldName,
|
|
940
982
|
defaultValue: value
|
|
941
|
-
});
|
|
983
|
+
}));
|
|
942
984
|
} else {
|
|
943
985
|
return value;
|
|
944
986
|
}
|
|
@@ -1479,7 +1521,10 @@ var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
|
1479
1521
|
width: "" + (props.fullWidth ? 'auto' : 'fit-content')
|
|
1480
1522
|
}, props.startIcon && React__default.createElement(_.Box, {
|
|
1481
1523
|
mr: 1
|
|
1482
|
-
}, props.startIcon), props.
|
|
1524
|
+
}, props.startIcon), props.isLoading ? React__default.createElement(_.CircularProgress, {
|
|
1525
|
+
className: "circular-progress-main-color",
|
|
1526
|
+
size: 20
|
|
1527
|
+
}) : props.value, props.endIcon && React__default.createElement(_.Box, {
|
|
1483
1528
|
ml: "" + (props.fullWidth ? 'auto' : 1)
|
|
1484
1529
|
}, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
|
|
1485
1530
|
className: "helper-text " + (props.error ? 'has-error' : '')
|
|
@@ -1516,13 +1561,16 @@ var SelectField = function SelectField(props) {
|
|
|
1516
1561
|
ref: props.inputRef,
|
|
1517
1562
|
isDisabled: props.disabled,
|
|
1518
1563
|
isClearable: props.isClearable,
|
|
1519
|
-
isSearchable: props.isSearchable
|
|
1564
|
+
isSearchable: props.isSearchable,
|
|
1565
|
+
isLoading: props.isLoading,
|
|
1566
|
+
menuPlacement: props.menuPlacement
|
|
1520
1567
|
}), props.helperText && React__default.createElement("div", {
|
|
1521
1568
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
1522
1569
|
}, props.helperText));
|
|
1523
1570
|
};
|
|
1524
1571
|
SelectField.defaultProps = {
|
|
1525
|
-
isClearable: true
|
|
1572
|
+
isClearable: true,
|
|
1573
|
+
menuPlacement: 'auto'
|
|
1526
1574
|
};
|
|
1527
1575
|
|
|
1528
1576
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2409,13 +2457,15 @@ var SelectAsyncField = function SelectAsyncField(props) {
|
|
|
2409
2457
|
selectRef: props.inputRef,
|
|
2410
2458
|
isDisabled: props.disabled,
|
|
2411
2459
|
isClearable: props.isClearable,
|
|
2412
|
-
loadOptions: loadOptions
|
|
2460
|
+
loadOptions: loadOptions,
|
|
2461
|
+
menuPlacement: props.menuPlacement
|
|
2413
2462
|
}), props.helperText && React__default.createElement("div", {
|
|
2414
2463
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
2415
2464
|
}, props.helperText));
|
|
2416
2465
|
};
|
|
2417
2466
|
SelectAsyncField.defaultProps = {
|
|
2418
|
-
isClearable: true
|
|
2467
|
+
isClearable: true,
|
|
2468
|
+
menuPlacement: 'auto'
|
|
2419
2469
|
};
|
|
2420
2470
|
|
|
2421
2471
|
var LoginForm = function LoginForm(props) {
|
|
@@ -2441,10 +2491,6 @@ var LoginForm = function LoginForm(props) {
|
|
|
2441
2491
|
trigger = _useForm.trigger,
|
|
2442
2492
|
errors = _useForm.formState.errors;
|
|
2443
2493
|
|
|
2444
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2445
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2446
|
-
};
|
|
2447
|
-
|
|
2448
2494
|
return React__default.createElement(material.Box, {
|
|
2449
2495
|
m: 2
|
|
2450
2496
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2485,17 +2531,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2485
2531
|
while (1) {
|
|
2486
2532
|
switch (_context.prev = _context.next) {
|
|
2487
2533
|
case 0:
|
|
2488
|
-
|
|
2534
|
+
if (!(e.key === 'Enter')) {
|
|
2535
|
+
_context.next = 5;
|
|
2536
|
+
break;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
_context.next = 3;
|
|
2489
2540
|
return trigger();
|
|
2490
2541
|
|
|
2491
|
-
case
|
|
2542
|
+
case 3:
|
|
2492
2543
|
result = _context.sent;
|
|
2493
2544
|
|
|
2494
2545
|
if (result) {
|
|
2495
|
-
|
|
2546
|
+
props.onClick(getValues());
|
|
2496
2547
|
}
|
|
2497
2548
|
|
|
2498
|
-
case
|
|
2549
|
+
case 5:
|
|
2499
2550
|
case "end":
|
|
2500
2551
|
return _context.stop();
|
|
2501
2552
|
}
|
|
@@ -2541,17 +2592,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2541
2592
|
while (1) {
|
|
2542
2593
|
switch (_context2.prev = _context2.next) {
|
|
2543
2594
|
case 0:
|
|
2544
|
-
|
|
2595
|
+
if (!(e.key === 'Enter')) {
|
|
2596
|
+
_context2.next = 5;
|
|
2597
|
+
break;
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
_context2.next = 3;
|
|
2545
2601
|
return trigger();
|
|
2546
2602
|
|
|
2547
|
-
case
|
|
2603
|
+
case 3:
|
|
2548
2604
|
result = _context2.sent;
|
|
2549
2605
|
|
|
2550
2606
|
if (result) {
|
|
2551
|
-
|
|
2607
|
+
props.onClick(getValues());
|
|
2552
2608
|
}
|
|
2553
2609
|
|
|
2554
|
-
case
|
|
2610
|
+
case 5:
|
|
2555
2611
|
case "end":
|
|
2556
2612
|
return _context2.stop();
|
|
2557
2613
|
}
|
|
@@ -2584,7 +2640,7 @@ var LoginForm = function LoginForm(props) {
|
|
|
2584
2640
|
|
|
2585
2641
|
var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
2586
2642
|
var validationSchema = yup.object().shape({
|
|
2587
|
-
password: yup.string().required(props.requiredText.requiredTextPassword),
|
|
2643
|
+
password: yup.string().required(props.requiredText.requiredTextPassword).matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{6,})/, props.requiredText.requiredPasswordPolices),
|
|
2588
2644
|
passwordConfirmation: yup.string().when('password', function (password, schema) {
|
|
2589
2645
|
if (password) return schema.required(props.requiredText.requiredTextPassword);
|
|
2590
2646
|
}).oneOf([yup.ref('password'), null], props.requiredText.requiredTextSamePassword)
|
|
@@ -2611,10 +2667,6 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2611
2667
|
event.preventDefault();
|
|
2612
2668
|
};
|
|
2613
2669
|
|
|
2614
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2615
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2616
|
-
};
|
|
2617
|
-
|
|
2618
2670
|
return React__default.createElement(_.Box, {
|
|
2619
2671
|
m: 2
|
|
2620
2672
|
}, props.topComponent && React__default.createElement(_.Box, {
|
|
@@ -2655,17 +2707,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2655
2707
|
while (1) {
|
|
2656
2708
|
switch (_context.prev = _context.next) {
|
|
2657
2709
|
case 0:
|
|
2658
|
-
|
|
2710
|
+
if (!(e.key === 'Enter')) {
|
|
2711
|
+
_context.next = 5;
|
|
2712
|
+
break;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
_context.next = 3;
|
|
2659
2716
|
return trigger();
|
|
2660
2717
|
|
|
2661
|
-
case
|
|
2718
|
+
case 3:
|
|
2662
2719
|
result = _context.sent;
|
|
2663
2720
|
|
|
2664
2721
|
if (result) {
|
|
2665
|
-
|
|
2722
|
+
props.onClick(getValues());
|
|
2666
2723
|
}
|
|
2667
2724
|
|
|
2668
|
-
case
|
|
2725
|
+
case 5:
|
|
2669
2726
|
case "end":
|
|
2670
2727
|
return _context.stop();
|
|
2671
2728
|
}
|
|
@@ -2717,17 +2774,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2717
2774
|
while (1) {
|
|
2718
2775
|
switch (_context2.prev = _context2.next) {
|
|
2719
2776
|
case 0:
|
|
2720
|
-
|
|
2777
|
+
if (!(e.key === 'Enter')) {
|
|
2778
|
+
_context2.next = 5;
|
|
2779
|
+
break;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
_context2.next = 3;
|
|
2721
2783
|
return trigger();
|
|
2722
2784
|
|
|
2723
|
-
case
|
|
2785
|
+
case 3:
|
|
2724
2786
|
result = _context2.sent;
|
|
2725
2787
|
|
|
2726
2788
|
if (result) {
|
|
2727
|
-
|
|
2789
|
+
props.onClick(getValues());
|
|
2728
2790
|
}
|
|
2729
2791
|
|
|
2730
|
-
case
|
|
2792
|
+
case 5:
|
|
2731
2793
|
case "end":
|
|
2732
2794
|
return _context2.stop();
|
|
2733
2795
|
}
|
|
@@ -2773,10 +2835,6 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2773
2835
|
trigger = _useForm.trigger,
|
|
2774
2836
|
errors = _useForm.formState.errors;
|
|
2775
2837
|
|
|
2776
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2777
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2778
|
-
};
|
|
2779
|
-
|
|
2780
2838
|
return React__default.createElement(material.Box, {
|
|
2781
2839
|
m: 2
|
|
2782
2840
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2811,17 +2869,22 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2811
2869
|
while (1) {
|
|
2812
2870
|
switch (_context.prev = _context.next) {
|
|
2813
2871
|
case 0:
|
|
2814
|
-
|
|
2872
|
+
if (!(e.key === 'Enter')) {
|
|
2873
|
+
_context.next = 5;
|
|
2874
|
+
break;
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
_context.next = 3;
|
|
2815
2878
|
return trigger();
|
|
2816
2879
|
|
|
2817
|
-
case
|
|
2880
|
+
case 3:
|
|
2818
2881
|
result = _context.sent;
|
|
2819
2882
|
|
|
2820
2883
|
if (result) {
|
|
2821
|
-
|
|
2884
|
+
props.onClick(getValues());
|
|
2822
2885
|
}
|
|
2823
2886
|
|
|
2824
|
-
case
|
|
2887
|
+
case 5:
|
|
2825
2888
|
case "end":
|
|
2826
2889
|
return _context.stop();
|
|
2827
2890
|
}
|