techsbcn-storybook 0.14.0 → 0.14.4
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/TextFieldComponent/TextFieldComponent.d.ts +1 -2
- 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 +61 -26
- 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 -33
- package/dist/techsbcn-storybook.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/fields/TextFieldComponent/TextFieldComponent.tsx +1 -1
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.tsx +2 -2
- package/src/components/forms/ChangePasswordForm.tsx +5 -2
- 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 +19 -13
- package/src/components/tables/TableComponent/TableComponent.scss +3 -1
- package/src/components/tables/TableComponent/TableComponent.tsx +19 -11
- 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/stories/Forms/Forms.stories.tsx +1 -0
- package/src/stories/Tables/Tables.stories.tsx +11 -1
|
@@ -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
|
@@ -292,7 +292,7 @@ var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
|
292
292
|
})) : React__default.createElement(React__default.Fragment, null))));
|
|
293
293
|
};
|
|
294
294
|
|
|
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
|
|
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}";
|
|
296
296
|
styleInject(css_248z$4);
|
|
297
297
|
|
|
298
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}";
|
|
@@ -363,6 +363,36 @@ TextFieldComponent.defaultProps = {
|
|
|
363
363
|
type: 'text'
|
|
364
364
|
};
|
|
365
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
|
+
|
|
366
396
|
var TableComponent = function TableComponent(props) {
|
|
367
397
|
var _props$isCheckTable7, _props$isCheckTable8, _props$isCheckTable9;
|
|
368
398
|
|
|
@@ -478,12 +508,9 @@ var TableComponent = function TableComponent(props) {
|
|
|
478
508
|
}
|
|
479
509
|
|
|
480
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;
|
|
481
512
|
|
|
482
|
-
if (column.
|
|
483
|
-
if (value !== null) return value.toLocaleString() + " " + props.values.SYMBOL_EURO;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
if (column.isImage) {
|
|
513
|
+
if (column.isImage && value) {
|
|
487
514
|
if (column.isImage.isUrl) {
|
|
488
515
|
return React__default.createElement(_.Avatar, {
|
|
489
516
|
alt: "-",
|
|
@@ -491,6 +518,12 @@ var TableComponent = function TableComponent(props) {
|
|
|
491
518
|
className: "img-table",
|
|
492
519
|
variant: "square"
|
|
493
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
|
+
});
|
|
494
527
|
}
|
|
495
528
|
}
|
|
496
529
|
|
|
@@ -559,12 +592,11 @@ var TableComponent = function TableComponent(props) {
|
|
|
559
592
|
setUpdate();
|
|
560
593
|
};
|
|
561
594
|
|
|
562
|
-
return React__default.createElement(TextFieldComponent, {
|
|
563
|
-
type: editableCell.isTextField.type,
|
|
595
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
564
596
|
onChange: handleTextFieldChange,
|
|
565
597
|
name: fieldName,
|
|
566
|
-
|
|
567
|
-
});
|
|
598
|
+
value: value || ''
|
|
599
|
+
}));
|
|
568
600
|
} else {
|
|
569
601
|
return value;
|
|
570
602
|
}
|
|
@@ -591,7 +623,7 @@ var TableComponent = function TableComponent(props) {
|
|
|
591
623
|
mr: 1,
|
|
592
624
|
alignSelf: "center"
|
|
593
625
|
}, props.totalCount, " ", props.values.RESULTS)), React__default.createElement(_.TableContainer, {
|
|
594
|
-
className: "table-container"
|
|
626
|
+
className: "table-container " + (props.withScroll ? 'with-scroll' : '')
|
|
595
627
|
}, React__default.createElement(_.Table, {
|
|
596
628
|
stickyHeader: true,
|
|
597
629
|
"aria-label": "sticky table",
|
|
@@ -756,7 +788,7 @@ TableComponent.defaultProps = {
|
|
|
756
788
|
showTotalCount: true
|
|
757
789
|
};
|
|
758
790
|
|
|
759
|
-
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}";
|
|
760
792
|
styleInject(css_248z$6);
|
|
761
793
|
|
|
762
794
|
var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
@@ -854,12 +886,9 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
854
886
|
}
|
|
855
887
|
|
|
856
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;
|
|
857
890
|
|
|
858
|
-
if (column.
|
|
859
|
-
if (value !== null) return value.toLocaleString() + " " + props.values.SYMBOL_EURO;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
if (column.isImage) {
|
|
891
|
+
if (column.isImage && value) {
|
|
863
892
|
if (column.isImage.isUrl) {
|
|
864
893
|
return React__default.createElement(_.Avatar, {
|
|
865
894
|
alt: "-",
|
|
@@ -867,6 +896,12 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
867
896
|
className: "img-table",
|
|
868
897
|
variant: "square"
|
|
869
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
|
+
});
|
|
870
905
|
}
|
|
871
906
|
}
|
|
872
907
|
|
|
@@ -935,14 +970,11 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
935
970
|
setUpdate();
|
|
936
971
|
};
|
|
937
972
|
|
|
938
|
-
return React__default.createElement(TextFieldComponent, {
|
|
939
|
-
type: editableCell.isTextField.type,
|
|
973
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
940
974
|
onChange: handleTextFieldChange,
|
|
941
975
|
name: fieldName,
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
minNumber: 0
|
|
945
|
-
});
|
|
976
|
+
value: value || ''
|
|
977
|
+
}));
|
|
946
978
|
} else {
|
|
947
979
|
return value;
|
|
948
980
|
}
|
|
@@ -962,7 +994,7 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
962
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,
|
|
963
995
|
onChange: handleSelectAllClick
|
|
964
996
|
}))), React__default.createElement(_.TableContainer, {
|
|
965
|
-
className: "table-container"
|
|
997
|
+
className: "table-container " + (props.withScroll ? 'with-scroll' : '')
|
|
966
998
|
}, React__default.createElement(_.Table, {
|
|
967
999
|
stickyHeader: true,
|
|
968
1000
|
"aria-label": "sticky table",
|
|
@@ -1483,7 +1515,10 @@ var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
|
1483
1515
|
width: "" + (props.fullWidth ? 'auto' : 'fit-content')
|
|
1484
1516
|
}, props.startIcon && React__default.createElement(_.Box, {
|
|
1485
1517
|
mr: 1
|
|
1486
|
-
}, 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, {
|
|
1487
1522
|
ml: "" + (props.fullWidth ? 'auto' : 1)
|
|
1488
1523
|
}, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
|
|
1489
1524
|
className: "helper-text " + (props.error ? 'has-error' : '')
|
|
@@ -2599,7 +2634,7 @@ var LoginForm = function LoginForm(props) {
|
|
|
2599
2634
|
|
|
2600
2635
|
var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
2601
2636
|
var validationSchema = yup.object().shape({
|
|
2602
|
-
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),
|
|
2603
2638
|
passwordConfirmation: yup.string().when('password', function (password, schema) {
|
|
2604
2639
|
if (password) return schema.required(props.requiredText.requiredTextPassword);
|
|
2605
2640
|
}).oneOf([yup.ref('password'), null], props.requiredText.requiredTextSamePassword)
|