techsbcn-storybook 0.13.5 → 0.14.3
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 +5 -4
- package/dist/components/tables/TableComponent/TableComponent.d.ts +5 -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 +118 -63
- 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 +125 -70
- 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.scss +3 -1
- package/src/components/tables/SimpleTableComponent/SimpleTableComponent.tsx +18 -12
- package/src/components/tables/TableComponent/TableComponent.scss +3 -1
- package/src/components/tables/TableComponent/TableComponent.tsx +18 -10
- 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/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;
|
|
@@ -20,6 +20,7 @@ interface SimpleTableComponentProps {
|
|
|
20
20
|
onCheckedAction?: (ids: number[]) => void;
|
|
21
21
|
onCheckedSingleAction?: (id: number) => void;
|
|
22
22
|
};
|
|
23
|
+
withScroll?: boolean;
|
|
23
24
|
}
|
|
24
25
|
interface ColumnProps {
|
|
25
26
|
id?: string;
|
|
@@ -42,8 +43,8 @@ interface ColumnProps {
|
|
|
42
43
|
isImage?: {
|
|
43
44
|
isUrl?: boolean;
|
|
44
45
|
isGuid?: {
|
|
45
|
-
guid:
|
|
46
|
-
|
|
46
|
+
readFile: (guid: string) => Promise<any>;
|
|
47
|
+
convertImage?: (content: any) => string;
|
|
47
48
|
};
|
|
48
49
|
};
|
|
49
50
|
isActiveFunction?: {
|
|
@@ -65,7 +66,7 @@ interface ActionProps {
|
|
|
65
66
|
}
|
|
66
67
|
interface EditableCellProps {
|
|
67
68
|
isTextField?: {
|
|
68
|
-
|
|
69
|
+
textFieldProps?: TextFieldComponentProps;
|
|
69
70
|
onCellValueChange: (data: any) => void;
|
|
70
71
|
};
|
|
71
72
|
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;
|
|
@@ -21,6 +21,7 @@ interface TableComponentProps {
|
|
|
21
21
|
rowsChecked?: number[];
|
|
22
22
|
onCheckedAction?: (ids: number[]) => void;
|
|
23
23
|
};
|
|
24
|
+
withScroll?: boolean;
|
|
24
25
|
}
|
|
25
26
|
interface ColumnProps {
|
|
26
27
|
id: string;
|
|
@@ -44,8 +45,8 @@ interface ColumnProps {
|
|
|
44
45
|
isImage?: {
|
|
45
46
|
isUrl?: boolean;
|
|
46
47
|
isGuid?: {
|
|
47
|
-
guid:
|
|
48
|
-
|
|
48
|
+
readFile: (guid: string) => Promise<any>;
|
|
49
|
+
convertImage?: (content: any) => string;
|
|
49
50
|
};
|
|
50
51
|
};
|
|
51
52
|
isActiveFunction?: {
|
|
@@ -67,7 +68,7 @@ interface ActionProps {
|
|
|
67
68
|
}
|
|
68
69
|
interface EditableCellProps {
|
|
69
70
|
isTextField?: {
|
|
70
|
-
|
|
71
|
+
textFieldProps?: TextFieldComponentProps;
|
|
71
72
|
onCellValueChange: (data: any) => void;
|
|
72
73
|
};
|
|
73
74
|
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,10 +289,10 @@ 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
|
-
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
|
|
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 border-bottom: 1px solid black;\n}\n.table-component .paper-container .table-container.with-scroll {\n max-height: 68vh;\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}";
|
|
294
296
|
styleInject(css_248z$4);
|
|
295
297
|
|
|
296
298
|
var css_248z$5 = ".text-field-component .MuiFormLabel-root {\n color: #666666 !important;\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-field-component .MuiFormLabel-root + .MuiInputBase-formControl {\n margin-top: 25px !important;\n}\n.text-field-component .MuiInputBase-root.no-border {\n border: none !important;\n padding: 0 !important;\n width: fit-content !important;\n}\n.text-field-component .MuiInputBase-root {\n color: #666666 !important;\n border: 1px solid grey;\n padding: 0.43rem 0.87rem;\n background-color: white !important;\n border-radius: 3px !important;\n}\n.text-field-component .MuiInputBase-root.Mui-error {\n border: 1px solid #F24726 !important;\n}\n.text-field-component .MuiInputBase-root:not(.Mui-disabled):hover {\n border: 1px solid grey;\n}\n.text-field-component .MuiInputBase-root.Mui-focused {\n border: 1px solid #3299C7;\n}\n.text-field-component .MuiInputBase-root .MuiInputBase-input {\n color: #666666 !important;\n background-color: white !important;\n}\n.text-field-component .MuiInputBase-root .MuiInputBase-input::placeholder {\n text-overflow: ellipsis !important;\n color: #666666 !important;\n opacity: 1;\n}\n.text-field-component .MuiInputBase-root .Mui-disabled {\n -webkit-text-fill-color: #666666 !important;\n}\n.text-field-component .MuiFormHelperText-root {\n padding: 0 !important;\n font-size: 0.85rem !important;\n color: #666666;\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
|
|
|
@@ -476,12 +508,9 @@ var TableComponent = function TableComponent(props) {
|
|
|
476
508
|
}
|
|
477
509
|
|
|
478
510
|
if (column.isDate && value) return new Date(value).toLocaleDateString('es-ES');
|
|
511
|
+
if (column.isPrice && value) return Number(value).toFixed(2).replace('.', ',') + " " + props.values.SYMBOL_EURO;
|
|
479
512
|
|
|
480
|
-
if (column.
|
|
481
|
-
if (value !== null) return value.toLocaleString() + " " + props.values.SYMBOL_EURO;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
if (column.isImage) {
|
|
513
|
+
if (column.isImage && value) {
|
|
485
514
|
if (column.isImage.isUrl) {
|
|
486
515
|
return React__default.createElement(_.Avatar, {
|
|
487
516
|
alt: "-",
|
|
@@ -489,6 +518,12 @@ var TableComponent = function TableComponent(props) {
|
|
|
489
518
|
className: "img-table",
|
|
490
519
|
variant: "square"
|
|
491
520
|
});
|
|
521
|
+
} else if (column.isImage.isGuid) {
|
|
522
|
+
return React__default.createElement(ImageTableComponent, {
|
|
523
|
+
guid: value,
|
|
524
|
+
readFile: column.isImage.isGuid.readFile,
|
|
525
|
+
convertImage: column.isImage.isGuid.convertImage
|
|
526
|
+
});
|
|
492
527
|
}
|
|
493
528
|
}
|
|
494
529
|
|
|
@@ -557,12 +592,11 @@ var TableComponent = function TableComponent(props) {
|
|
|
557
592
|
setUpdate();
|
|
558
593
|
};
|
|
559
594
|
|
|
560
|
-
return React__default.createElement(TextFieldComponent, {
|
|
561
|
-
type: editableCell.isTextField.type,
|
|
595
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
562
596
|
onChange: handleTextFieldChange,
|
|
563
597
|
name: fieldName,
|
|
564
598
|
defaultValue: value
|
|
565
|
-
});
|
|
599
|
+
}));
|
|
566
600
|
} else {
|
|
567
601
|
return value;
|
|
568
602
|
}
|
|
@@ -589,7 +623,7 @@ var TableComponent = function TableComponent(props) {
|
|
|
589
623
|
mr: 1,
|
|
590
624
|
alignSelf: "center"
|
|
591
625
|
}, props.totalCount, " ", props.values.RESULTS)), React__default.createElement(_.TableContainer, {
|
|
592
|
-
className: "table-container"
|
|
626
|
+
className: "table-container " + (props.withScroll ? 'with-scroll' : '')
|
|
593
627
|
}, React__default.createElement(_.Table, {
|
|
594
628
|
stickyHeader: true,
|
|
595
629
|
"aria-label": "sticky table",
|
|
@@ -754,7 +788,7 @@ TableComponent.defaultProps = {
|
|
|
754
788
|
showTotalCount: true
|
|
755
789
|
};
|
|
756
790
|
|
|
757
|
-
var css_248z$6 = ".table-simple-component .paper-container {\n box-shadow: none;\n background-color: transparent !important;\n}\n.table-simple-component .paper-container .checkbox-cell .MuiCheckbox-root {\n padding: 0 !important;\n}\n.table-simple-component .paper-container .checkbox-cell .MuiCheckbox-root:hover {\n background-color: transparent !important;\n}\n.table-simple-component .paper-container .checkbox-cell .Mui-checked {\n color: rgba(0, 0, 0, 0.54) !important;\n}\n.table-simple-component .paper-container .checkbox-cell .MuiCheckbox-indeterminate {\n color: #212529 !important;\n}\n.table-simple-component .paper-container .table-container {\n
|
|
791
|
+
var css_248z$6 = ".table-simple-component .paper-container {\n box-shadow: none;\n background-color: transparent !important;\n}\n.table-simple-component .paper-container .checkbox-cell .MuiCheckbox-root {\n padding: 0 !important;\n}\n.table-simple-component .paper-container .checkbox-cell .MuiCheckbox-root:hover {\n background-color: transparent !important;\n}\n.table-simple-component .paper-container .checkbox-cell .Mui-checked {\n color: rgba(0, 0, 0, 0.54) !important;\n}\n.table-simple-component .paper-container .checkbox-cell .MuiCheckbox-indeterminate {\n color: #212529 !important;\n}\n.table-simple-component .paper-container .table-container {\n border-bottom: 1px solid black;\n}\n.table-simple-component .paper-container .table-container.with-scroll {\n max-height: 68vh;\n}\n.table-simple-component .paper-container .table-container .table-column:first-child {\n border-radius: 5px 0 0 5px;\n}\n.table-simple-component .paper-container .table-container .table-column:last-child {\n border-right: none !important;\n border-radius: 0 5px 5px 0;\n}\n.table-simple-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-simple-component .paper-container .table-container .table-column .table-header-cell {\n color: black;\n padding: 0px 10px 0px 10px !important;\n}\n.table-simple-component .paper-container .table-container .table-rows.row-click {\n cursor: pointer;\n}\n.table-simple-component .paper-container .table-container .table-rows.row-click:hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.table-simple-component .paper-container .table-container .table-rows.Mui-selected {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.table-simple-component .paper-container .table-container .table-rows .Mui-selected {\n background-color: transparent !important;\n}\n.table-simple-component .paper-container .table-container .table-rows .MuiTableCell-root {\n padding: 6px !important;\n overflow: hidden;\n}\n.table-simple-component .paper-container .table-container .table-rows .img-table {\n width: 100%;\n height: 110px;\n}\n.table-simple-component .paper-container .table-container .table-rows .img-table img {\n object-fit: contain;\n}\n.table-simple-component .paper-container .table-container .table-rows .actions {\n float: right;\n}\n.table-simple-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-simple-component .paper-container .MuiTable-root.loading {\n opacity: 0.5;\n}\n.table-simple-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@media (max-width: 992px) {\n .table-simple-component .paper-container .table-container {\n max-height: 60vh;\n border-top: 1px solid #cccccc;\n }\n .table-simple-component .paper-container .table-container .MuiTable-root {\n border-collapse: collapse !important;\n }\n .table-simple-component .paper-container .table-container .MuiTableHead-root {\n display: none !important;\n }\n .table-simple-component .paper-container .table-container .table-rows {\n border-bottom: 2px solid #cccccc;\n }\n .table-simple-component .paper-container .table-container .table-rows .MuiTableCell-root {\n width: auto;\n border-bottom: none !important;\n }\n .table-simple-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-simple-component .paper-container .table-container .table-rows .MuiTableCell-root .label-cell + div {\n display: inline-block;\n }\n .table-simple-component .paper-container .table-container .table-rows .table-cell {\n display: block !important;\n }\n .table-simple-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}";
|
|
758
792
|
styleInject(css_248z$6);
|
|
759
793
|
|
|
760
794
|
var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
@@ -852,12 +886,9 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
852
886
|
}
|
|
853
887
|
|
|
854
888
|
if (column.isDate && value) return new Date(value).toLocaleDateString('es-ES');
|
|
889
|
+
if (column.isPrice && value) return Number(value).toFixed(2).replace('.', ',') + " " + props.values.SYMBOL_EURO;
|
|
855
890
|
|
|
856
|
-
if (column.
|
|
857
|
-
if (value !== null) return value.toLocaleString() + " " + props.values.SYMBOL_EURO;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
if (column.isImage) {
|
|
891
|
+
if (column.isImage && value) {
|
|
861
892
|
if (column.isImage.isUrl) {
|
|
862
893
|
return React__default.createElement(_.Avatar, {
|
|
863
894
|
alt: "-",
|
|
@@ -865,6 +896,12 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
865
896
|
className: "img-table",
|
|
866
897
|
variant: "square"
|
|
867
898
|
});
|
|
899
|
+
} else if (column.isImage.isGuid) {
|
|
900
|
+
return React__default.createElement(ImageTableComponent, {
|
|
901
|
+
guid: value,
|
|
902
|
+
readFile: column.isImage.isGuid.readFile,
|
|
903
|
+
convertImage: column.isImage.isGuid.convertImage
|
|
904
|
+
});
|
|
868
905
|
}
|
|
869
906
|
}
|
|
870
907
|
|
|
@@ -933,14 +970,11 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
933
970
|
setUpdate();
|
|
934
971
|
};
|
|
935
972
|
|
|
936
|
-
return React__default.createElement(TextFieldComponent, {
|
|
937
|
-
type: editableCell.isTextField.type,
|
|
973
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
938
974
|
onChange: handleTextFieldChange,
|
|
939
975
|
name: fieldName,
|
|
940
|
-
defaultValue: value
|
|
941
|
-
|
|
942
|
-
minNumber: 0
|
|
943
|
-
});
|
|
976
|
+
defaultValue: value
|
|
977
|
+
}));
|
|
944
978
|
} else {
|
|
945
979
|
return value;
|
|
946
980
|
}
|
|
@@ -960,7 +994,7 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
960
994
|
checked: props.rows && props.rows.length > 0 && JSON.parse(JSON.stringify((_props$isCheckTable12 = props.isCheckTable) == null ? void 0 : _props$isCheckTable12.rowsChecked)).length === props.rows.length,
|
|
961
995
|
onChange: handleSelectAllClick
|
|
962
996
|
}))), React__default.createElement(_.TableContainer, {
|
|
963
|
-
className: "table-container"
|
|
997
|
+
className: "table-container " + (props.withScroll ? 'with-scroll' : '')
|
|
964
998
|
}, React__default.createElement(_.Table, {
|
|
965
999
|
stickyHeader: true,
|
|
966
1000
|
"aria-label": "sticky table",
|
|
@@ -1481,7 +1515,10 @@ var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
|
1481
1515
|
width: "" + (props.fullWidth ? 'auto' : 'fit-content')
|
|
1482
1516
|
}, props.startIcon && React__default.createElement(_.Box, {
|
|
1483
1517
|
mr: 1
|
|
1484
|
-
}, props.startIcon), props.
|
|
1518
|
+
}, props.startIcon), props.isLoading ? React__default.createElement(_.CircularProgress, {
|
|
1519
|
+
className: "circular-progress-main-color",
|
|
1520
|
+
size: 20
|
|
1521
|
+
}) : props.value, props.endIcon && React__default.createElement(_.Box, {
|
|
1485
1522
|
ml: "" + (props.fullWidth ? 'auto' : 1)
|
|
1486
1523
|
}, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
|
|
1487
1524
|
className: "helper-text " + (props.error ? 'has-error' : '')
|
|
@@ -1518,13 +1555,16 @@ var SelectField = function SelectField(props) {
|
|
|
1518
1555
|
ref: props.inputRef,
|
|
1519
1556
|
isDisabled: props.disabled,
|
|
1520
1557
|
isClearable: props.isClearable,
|
|
1521
|
-
isSearchable: props.isSearchable
|
|
1558
|
+
isSearchable: props.isSearchable,
|
|
1559
|
+
isLoading: props.isLoading,
|
|
1560
|
+
menuPlacement: props.menuPlacement
|
|
1522
1561
|
}), props.helperText && React__default.createElement("div", {
|
|
1523
1562
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
1524
1563
|
}, props.helperText));
|
|
1525
1564
|
};
|
|
1526
1565
|
SelectField.defaultProps = {
|
|
1527
|
-
isClearable: true
|
|
1566
|
+
isClearable: true,
|
|
1567
|
+
menuPlacement: 'auto'
|
|
1528
1568
|
};
|
|
1529
1569
|
|
|
1530
1570
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2411,13 +2451,15 @@ var SelectAsyncField = function SelectAsyncField(props) {
|
|
|
2411
2451
|
selectRef: props.inputRef,
|
|
2412
2452
|
isDisabled: props.disabled,
|
|
2413
2453
|
isClearable: props.isClearable,
|
|
2414
|
-
loadOptions: loadOptions
|
|
2454
|
+
loadOptions: loadOptions,
|
|
2455
|
+
menuPlacement: props.menuPlacement
|
|
2415
2456
|
}), props.helperText && React__default.createElement("div", {
|
|
2416
2457
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
2417
2458
|
}, props.helperText));
|
|
2418
2459
|
};
|
|
2419
2460
|
SelectAsyncField.defaultProps = {
|
|
2420
|
-
isClearable: true
|
|
2461
|
+
isClearable: true,
|
|
2462
|
+
menuPlacement: 'auto'
|
|
2421
2463
|
};
|
|
2422
2464
|
|
|
2423
2465
|
var LoginForm = function LoginForm(props) {
|
|
@@ -2443,10 +2485,6 @@ var LoginForm = function LoginForm(props) {
|
|
|
2443
2485
|
trigger = _useForm.trigger,
|
|
2444
2486
|
errors = _useForm.formState.errors;
|
|
2445
2487
|
|
|
2446
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2447
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2448
|
-
};
|
|
2449
|
-
|
|
2450
2488
|
return React__default.createElement(material.Box, {
|
|
2451
2489
|
m: 2
|
|
2452
2490
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2487,17 +2525,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2487
2525
|
while (1) {
|
|
2488
2526
|
switch (_context.prev = _context.next) {
|
|
2489
2527
|
case 0:
|
|
2490
|
-
|
|
2528
|
+
if (!(e.key === 'Enter')) {
|
|
2529
|
+
_context.next = 5;
|
|
2530
|
+
break;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
_context.next = 3;
|
|
2491
2534
|
return trigger();
|
|
2492
2535
|
|
|
2493
|
-
case
|
|
2536
|
+
case 3:
|
|
2494
2537
|
result = _context.sent;
|
|
2495
2538
|
|
|
2496
2539
|
if (result) {
|
|
2497
|
-
|
|
2540
|
+
props.onClick(getValues());
|
|
2498
2541
|
}
|
|
2499
2542
|
|
|
2500
|
-
case
|
|
2543
|
+
case 5:
|
|
2501
2544
|
case "end":
|
|
2502
2545
|
return _context.stop();
|
|
2503
2546
|
}
|
|
@@ -2543,17 +2586,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2543
2586
|
while (1) {
|
|
2544
2587
|
switch (_context2.prev = _context2.next) {
|
|
2545
2588
|
case 0:
|
|
2546
|
-
|
|
2589
|
+
if (!(e.key === 'Enter')) {
|
|
2590
|
+
_context2.next = 5;
|
|
2591
|
+
break;
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
_context2.next = 3;
|
|
2547
2595
|
return trigger();
|
|
2548
2596
|
|
|
2549
|
-
case
|
|
2597
|
+
case 3:
|
|
2550
2598
|
result = _context2.sent;
|
|
2551
2599
|
|
|
2552
2600
|
if (result) {
|
|
2553
|
-
|
|
2601
|
+
props.onClick(getValues());
|
|
2554
2602
|
}
|
|
2555
2603
|
|
|
2556
|
-
case
|
|
2604
|
+
case 5:
|
|
2557
2605
|
case "end":
|
|
2558
2606
|
return _context2.stop();
|
|
2559
2607
|
}
|
|
@@ -2586,7 +2634,7 @@ var LoginForm = function LoginForm(props) {
|
|
|
2586
2634
|
|
|
2587
2635
|
var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
2588
2636
|
var validationSchema = yup.object().shape({
|
|
2589
|
-
password: yup.string().required(props.requiredText.requiredTextPassword),
|
|
2637
|
+
password: yup.string().required(props.requiredText.requiredTextPassword).matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{6,})/, props.requiredText.requiredPasswordPolices),
|
|
2590
2638
|
passwordConfirmation: yup.string().when('password', function (password, schema) {
|
|
2591
2639
|
if (password) return schema.required(props.requiredText.requiredTextPassword);
|
|
2592
2640
|
}).oneOf([yup.ref('password'), null], props.requiredText.requiredTextSamePassword)
|
|
@@ -2613,10 +2661,6 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2613
2661
|
event.preventDefault();
|
|
2614
2662
|
};
|
|
2615
2663
|
|
|
2616
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2617
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2618
|
-
};
|
|
2619
|
-
|
|
2620
2664
|
return React__default.createElement(_.Box, {
|
|
2621
2665
|
m: 2
|
|
2622
2666
|
}, props.topComponent && React__default.createElement(_.Box, {
|
|
@@ -2657,17 +2701,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2657
2701
|
while (1) {
|
|
2658
2702
|
switch (_context.prev = _context.next) {
|
|
2659
2703
|
case 0:
|
|
2660
|
-
|
|
2704
|
+
if (!(e.key === 'Enter')) {
|
|
2705
|
+
_context.next = 5;
|
|
2706
|
+
break;
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
_context.next = 3;
|
|
2661
2710
|
return trigger();
|
|
2662
2711
|
|
|
2663
|
-
case
|
|
2712
|
+
case 3:
|
|
2664
2713
|
result = _context.sent;
|
|
2665
2714
|
|
|
2666
2715
|
if (result) {
|
|
2667
|
-
|
|
2716
|
+
props.onClick(getValues());
|
|
2668
2717
|
}
|
|
2669
2718
|
|
|
2670
|
-
case
|
|
2719
|
+
case 5:
|
|
2671
2720
|
case "end":
|
|
2672
2721
|
return _context.stop();
|
|
2673
2722
|
}
|
|
@@ -2719,17 +2768,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2719
2768
|
while (1) {
|
|
2720
2769
|
switch (_context2.prev = _context2.next) {
|
|
2721
2770
|
case 0:
|
|
2722
|
-
|
|
2771
|
+
if (!(e.key === 'Enter')) {
|
|
2772
|
+
_context2.next = 5;
|
|
2773
|
+
break;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
_context2.next = 3;
|
|
2723
2777
|
return trigger();
|
|
2724
2778
|
|
|
2725
|
-
case
|
|
2779
|
+
case 3:
|
|
2726
2780
|
result = _context2.sent;
|
|
2727
2781
|
|
|
2728
2782
|
if (result) {
|
|
2729
|
-
|
|
2783
|
+
props.onClick(getValues());
|
|
2730
2784
|
}
|
|
2731
2785
|
|
|
2732
|
-
case
|
|
2786
|
+
case 5:
|
|
2733
2787
|
case "end":
|
|
2734
2788
|
return _context2.stop();
|
|
2735
2789
|
}
|
|
@@ -2775,10 +2829,6 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2775
2829
|
trigger = _useForm.trigger,
|
|
2776
2830
|
errors = _useForm.formState.errors;
|
|
2777
2831
|
|
|
2778
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2779
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2780
|
-
};
|
|
2781
|
-
|
|
2782
2832
|
return React__default.createElement(material.Box, {
|
|
2783
2833
|
m: 2
|
|
2784
2834
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2813,17 +2863,22 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2813
2863
|
while (1) {
|
|
2814
2864
|
switch (_context.prev = _context.next) {
|
|
2815
2865
|
case 0:
|
|
2816
|
-
|
|
2866
|
+
if (!(e.key === 'Enter')) {
|
|
2867
|
+
_context.next = 5;
|
|
2868
|
+
break;
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
_context.next = 3;
|
|
2817
2872
|
return trigger();
|
|
2818
2873
|
|
|
2819
|
-
case
|
|
2874
|
+
case 3:
|
|
2820
2875
|
result = _context.sent;
|
|
2821
2876
|
|
|
2822
2877
|
if (result) {
|
|
2823
|
-
|
|
2878
|
+
props.onClick(getValues());
|
|
2824
2879
|
}
|
|
2825
2880
|
|
|
2826
|
-
case
|
|
2881
|
+
case 5:
|
|
2827
2882
|
case "end":
|
|
2828
2883
|
return _context.stop();
|
|
2829
2884
|
}
|