techsbcn-storybook 0.11.1 → 0.12.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.
Files changed (35) hide show
  1. package/dist/components/fields/ButtonComponent/ButtonComponent.d.ts +2 -0
  2. package/dist/components/fields/TextSimpleComponent/TextSimpleComponent.d.ts +1 -0
  3. package/dist/components/tables/SimpleTableComponent/SimpleTableComponent.d.ts +74 -0
  4. package/dist/components/tables/TableComponent/TableComponent.d.ts +18 -1
  5. package/dist/data/UserList.d.ts +2 -1
  6. package/dist/data/_globalization/es.d.ts +7 -0
  7. package/dist/data/enums/ActiveStatus.d.ts +4 -0
  8. package/dist/data/index.d.ts +1 -0
  9. package/dist/interfaces/search/BasicEntity.d.ts +2 -2
  10. package/dist/stories/Tables/Tables.stories.d.ts +2 -1
  11. package/dist/stories/button/Button.stories.d.ts +3 -0
  12. package/dist/techsbcn-storybook.cjs.development.js +172 -95
  13. package/dist/techsbcn-storybook.cjs.development.js.map +1 -1
  14. package/dist/techsbcn-storybook.cjs.production.min.js +1 -1
  15. package/dist/techsbcn-storybook.cjs.production.min.js.map +1 -1
  16. package/dist/techsbcn-storybook.esm.js +173 -96
  17. package/dist/techsbcn-storybook.esm.js.map +1 -1
  18. package/package.json +2 -1
  19. package/src/components/fields/ButtonComponent/ButtonComponent.scss +8 -2
  20. package/src/components/fields/ButtonComponent/ButtonComponent.tsx +15 -2
  21. package/src/components/fields/TextSimpleComponent/TextSimpleComponent.scss +3 -0
  22. package/src/components/fields/TextSimpleComponent/TextSimpleComponent.tsx +4 -3
  23. package/src/components/tables/SimpleTableComponent/SimpleTableComponent.scss +131 -0
  24. package/src/components/tables/SimpleTableComponent/SimpleTableComponent.tsx +462 -0
  25. package/src/components/tables/TableComponent/TableComponent.tsx +113 -8
  26. package/src/data/UserList.tsx +10 -3
  27. package/src/data/Values.tsx +7 -0
  28. package/src/data/_globalization/es.js +7 -0
  29. package/src/data/enums/ActiveStatus.tsx +4 -0
  30. package/src/data/index.ts +1 -0
  31. package/src/interfaces/search/BasicEntity.tsx +2 -2
  32. package/src/stories/Fields/Fields.stories.tsx +5 -0
  33. package/src/stories/Tables/Tables.stories.tsx +170 -14
  34. package/src/stories/button/Button.stories.tsx +22 -1
  35. package/src/styles/Globals.scss +18 -0
@@ -10,5 +10,7 @@ export interface ButtonComponentProps {
10
10
  form?: string;
11
11
  type?: 'button' | 'submit' | 'reset';
12
12
  disabled?: boolean;
13
+ component?: any;
14
+ reverseColors?: boolean;
13
15
  }
14
16
  export declare const ButtonComponent: React.FC<ButtonComponentProps>;
@@ -10,6 +10,7 @@ interface TextSimpleComponentProps {
10
10
  helperText?: string;
11
11
  noBorders?: boolean;
12
12
  fullWidth?: boolean;
13
+ noMargin?: boolean;
13
14
  }
14
15
  export declare const TextSimpleComponent: React.FC<TextSimpleComponentProps>;
15
16
  export {};
@@ -0,0 +1,74 @@
1
+ import React from 'react';
2
+ import { ObjectKey } from '../../../interfaces';
3
+ import './SimpleTableComponent.scss';
4
+ import { InputType } from '../../fields/TextFieldComponent/TextFieldComponent';
5
+ interface SimpleTableComponentProps {
6
+ rows: any[];
7
+ values: ObjectKey;
8
+ className?: string;
9
+ columns: ColumnProps[];
10
+ rowsColorColumn?: {
11
+ columnName: string;
12
+ columnValue: string;
13
+ };
14
+ loading?: boolean;
15
+ onClickRow?: (id: number) => void;
16
+ isCheckTable?: {
17
+ rowsChecked?: number[];
18
+ onCheckedAction?: (ids: number[]) => void;
19
+ onCheckedSingleAction?: (id: number) => void;
20
+ };
21
+ }
22
+ interface ColumnProps {
23
+ id?: string;
24
+ label?: string;
25
+ minWidth?: number;
26
+ maxWidth?: number;
27
+ align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';
28
+ alignCell?: 'inherit' | 'left' | 'center' | 'right' | 'justify';
29
+ action?: ActionProps[];
30
+ isUnique?: boolean;
31
+ isDate?: boolean;
32
+ enumColumn?: {
33
+ isEnum: boolean;
34
+ enumType?: any;
35
+ hasColor?: boolean;
36
+ enumSuffix?: string;
37
+ };
38
+ isCheck?: boolean;
39
+ isPrice?: boolean;
40
+ isImage?: {
41
+ isUrl?: boolean;
42
+ isGuid?: {
43
+ guid: boolean;
44
+ action: (guid: string) => string;
45
+ };
46
+ };
47
+ isActiveFunction?: {
48
+ activeIcon: any;
49
+ disabledIcon: any;
50
+ onClickId: (id: number) => void;
51
+ };
52
+ isEditableTableCell?: EditableCellProps;
53
+ isBoolean?: {
54
+ enumType?: any;
55
+ hasColor?: boolean;
56
+ enumSuffix?: string;
57
+ };
58
+ }
59
+ interface ActionProps {
60
+ children: React.ReactNode;
61
+ onClick?: (row: any) => void;
62
+ onClickId?: (id: number) => void;
63
+ }
64
+ interface EditableCellProps {
65
+ isTextField?: {
66
+ type?: InputType;
67
+ onCellValueChange: (data: any) => void;
68
+ };
69
+ isSelectField?: {
70
+ onCellValueChange: (data: any) => void;
71
+ };
72
+ }
73
+ export declare const SimpleTableComponent: React.FunctionComponent<SimpleTableComponentProps>;
74
+ export {};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { SearchFilters, ObjectKey } from '../../../interfaces';
3
3
  import './TableComponent.scss';
4
+ import { InputType } from '../../fields/TextFieldComponent/TextFieldComponent';
4
5
  interface TableComponentProps {
5
6
  rows: any[];
6
7
  values: ObjectKey;
@@ -31,9 +32,10 @@ interface ColumnProps {
31
32
  isUnique?: boolean;
32
33
  isDate?: boolean;
33
34
  enumColumn?: {
34
- isEnum?: boolean;
35
+ isEnum: boolean;
35
36
  enumType?: any;
36
37
  hasColor?: boolean;
38
+ enumSuffix?: string;
37
39
  };
38
40
  isCheck?: boolean;
39
41
  noSort?: boolean;
@@ -50,11 +52,26 @@ interface ColumnProps {
50
52
  disabledIcon: any;
51
53
  onClickId: (id: number) => void;
52
54
  };
55
+ isEditableTableCell?: EditableCellProps;
56
+ isBoolean?: {
57
+ enumType?: any;
58
+ hasColor?: boolean;
59
+ enumSuffix?: string;
60
+ };
53
61
  }
54
62
  interface ActionProps {
55
63
  children: React.ReactNode;
56
64
  onClick?: (row: any) => void;
57
65
  onClickId?: (id: number) => void;
58
66
  }
67
+ interface EditableCellProps {
68
+ isTextField?: {
69
+ type?: InputType;
70
+ onCellValueChange: (data: any) => void;
71
+ };
72
+ isSelectField?: {
73
+ onCellValueChange: (data: any) => void;
74
+ };
75
+ }
59
76
  export declare const TableComponent: React.FunctionComponent<TableComponentProps>;
60
77
  export {};
@@ -10,7 +10,8 @@ interface UserList {
10
10
  website: string;
11
11
  charge: number;
12
12
  topic: string;
13
- extraInfo: BasicEntity;
13
+ extraInfo?: BasicEntity;
14
+ active: boolean;
14
15
  }
15
16
  export declare const UserList: UserList[];
16
17
  export {};
@@ -110,5 +110,12 @@ declare var _default: {
110
110
  image: string;
111
111
  skills: string;
112
112
  information: string;
113
+ enable: string;
114
+ disable: string;
115
+ enable_suffix: string;
116
+ disable_suffix: string;
117
+ boolean: string;
118
+ true_suffix: string;
119
+ false_suffix: string;
113
120
  };
114
121
  export default _default;
@@ -0,0 +1,4 @@
1
+ export declare enum ActiveStatus {
2
+ true = "ENABLE",
3
+ false = "DISABLE"
4
+ }
@@ -2,3 +2,4 @@ export * from './SelectMock';
2
2
  export * from './UserList';
3
3
  export * from './Values';
4
4
  export * from './enums/scopes';
5
+ export * from './enums/ActiveStatus';
@@ -1,5 +1,5 @@
1
1
  import { ObjectKey } from '../../interfaces';
2
2
  export interface BasicEntity extends ObjectKey {
3
- id: number;
4
- name: string;
3
+ id?: number;
4
+ name?: string;
5
5
  }
@@ -1,4 +1,5 @@
1
1
  import { Meta, Story } from '@storybook/react';
2
2
  declare const meta: Meta;
3
3
  export default meta;
4
- export declare const TableSimple: Story;
4
+ export declare const Table: Story;
5
+ export declare const SimpleTable: Story;
@@ -2,8 +2,11 @@ import { Meta, Story } from '@storybook/react';
2
2
  declare const meta: Meta;
3
3
  export default meta;
4
4
  export declare const Default: Story<import("@storybook/react").Args>;
5
+ export declare const ReverseColor: Story<import("@storybook/react").Args>;
6
+ export declare const ReverseColorLoading: Story<import("@storybook/react").Args>;
5
7
  export declare const LoginButton: Story<import("@storybook/react").Args>;
6
8
  export declare const ModalCancel: Story<import("@storybook/react").Args>;
7
9
  export declare const Loading: Story<import("@storybook/react").Args>;
8
10
  export declare const StartIcon: Story<import("@storybook/react").Args>;
9
11
  export declare const EndIcon: Story<import("@storybook/react").Args>;
12
+ export declare const Span: Story<import("@storybook/react").Args>;
@@ -9,6 +9,7 @@ var React__default = _interopDefault(React);
9
9
  var material = require('@mui/material');
10
10
  var _ = require('@mui/material/');
11
11
  var iconsMaterial = require('@mui/icons-material');
12
+ var lodash = require('lodash');
12
13
  var reactRouterDom = require('react-router-dom');
13
14
  var MenuIcon = _interopDefault(require('@mui/icons-material/Menu'));
14
15
  var Select = _interopDefault(require('react-select'));
@@ -275,6 +276,71 @@ var MainWrapperComponent = function MainWrapperComponent(props) {
275
276
  var css_248z$3 = ".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 .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: 100%;\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: inline-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: 300px;\n }\n}";
276
277
  styleInject(css_248z$3);
277
278
 
279
+ var css_248z$4 = ".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}";
280
+ styleInject(css_248z$4);
281
+
282
+ var TextFieldComponent = function TextFieldComponent(props) {
283
+ var _React$useState = React__default.useState(false),
284
+ hover = _React$useState[0],
285
+ setHover = _React$useState[1];
286
+
287
+ return React__default.createElement(_.Box, {
288
+ className: "text-field-component",
289
+ width: "100%"
290
+ }, React__default.createElement(_.TextField, {
291
+ onMouseEnter: function onMouseEnter() {
292
+ return setHover(true);
293
+ },
294
+ onMouseLeave: function onMouseLeave() {
295
+ return setHover(false);
296
+ },
297
+ name: props.name,
298
+ error: props.error,
299
+ id: props.id,
300
+ label: props.label,
301
+ value: props.value,
302
+ defaultValue: props.defaultValue,
303
+ className: props.className,
304
+ required: props.required,
305
+ disabled: props.disabled,
306
+ type: props.type,
307
+ placeholder: props.placeholder,
308
+ autoComplete: props.autoComplete,
309
+ variant: "standard",
310
+ ref: props.inputRef,
311
+ InputProps: {
312
+ className: (props.noBorders ? 'no-border' : '') + " " + (!props.disabled && hover ? 'main-border-color' : ''),
313
+ disableUnderline: true,
314
+ startAdornment: props.startIcon,
315
+ endAdornment: props.endIcon,
316
+ inputProps: {
317
+ max: props.maxNumber,
318
+ min: props.minNumber,
319
+ step: props.step
320
+ }
321
+ },
322
+ InputLabelProps: {
323
+ shrink: true
324
+ },
325
+ helperText: props.helperText,
326
+ fullWidth: props.fullWidth,
327
+ multiline: props.multiline,
328
+ rows: props.rows,
329
+ onChange: props.onChange,
330
+ onKeyUp: props.onKeyUp,
331
+ inputProps: {
332
+ maxLength: props.maxLength,
333
+ step: props.step,
334
+ max: props.maxNumber,
335
+ min: props.minNumber
336
+ }
337
+ }));
338
+ };
339
+ TextFieldComponent.defaultProps = {
340
+ fullWidth: true,
341
+ type: 'text'
342
+ };
343
+
278
344
  var TableComponent = function TableComponent(props) {
279
345
  var _props$isCheckTable7, _props$isCheckTable8, _props$isCheckTable9;
280
346
 
@@ -352,22 +418,39 @@ var TableComponent = function TableComponent(props) {
352
418
  var _column$enumColumn;
353
419
 
354
420
  if ((_column$enumColumn = column.enumColumn) != null && _column$enumColumn.isEnum) {
355
- var _column$enumColumn2;
421
+ var _column$enumColumn2, _column$enumColumn9;
356
422
 
357
423
  if ((_column$enumColumn2 = column.enumColumn) != null && _column$enumColumn2.enumType) {
358
- var _column$enumColumn4;
424
+ var _column$enumColumn5, _column$enumColumn8;
425
+
426
+ var result = [];
359
427
 
360
428
  if (value === null) {
361
429
  return value;
362
430
  } else if (value.split(',').length > 1) {
363
- var result = [];
364
431
  value.split(',').forEach(function (v) {
365
432
  var _column$enumColumn3;
366
433
 
367
434
  result.push(props.values[(_column$enumColumn3 = column.enumColumn) == null ? void 0 : _column$enumColumn3.enumType[v.replace(/ /g, '')].toUpperCase()]);
368
435
  });
369
436
  return result.join();
370
- } else return props.values[(_column$enumColumn4 = column.enumColumn) == null ? void 0 : _column$enumColumn4.enumType[value].toUpperCase()];
437
+ } else if (Array.isArray(value)) {
438
+ var split = value.toString().split(',');
439
+ split.forEach(function (v) {
440
+ var _column$enumColumn4;
441
+
442
+ if (!isNaN(parseInt(v))) result.push(props.values[(_column$enumColumn4 = column.enumColumn) == null ? void 0 : _column$enumColumn4.enumType[v.replace(/ /g, '')].toUpperCase()]);else result.push(props.values[v.toUpperCase()]);
443
+ });
444
+ return result.join();
445
+ } else if ((_column$enumColumn5 = column.enumColumn) != null && _column$enumColumn5.enumSuffix) {
446
+ var _column$enumColumn6, _column$enumColumn7;
447
+
448
+ return props.values[((_column$enumColumn6 = column.enumColumn) == null ? void 0 : _column$enumColumn6.enumType[value].toUpperCase()) + "_" + ((_column$enumColumn7 = column.enumColumn) == null ? void 0 : _column$enumColumn7.enumSuffix.toUpperCase())];
449
+ } else return props.values[(_column$enumColumn8 = column.enumColumn) == null ? void 0 : _column$enumColumn8.enumType[value].toUpperCase()];
450
+ } else if ((_column$enumColumn9 = column.enumColumn) != null && _column$enumColumn9.enumSuffix) {
451
+ var _column$enumColumn10;
452
+
453
+ return props.values[value.toUpperCase() + "_" + ((_column$enumColumn10 = column.enumColumn) == null ? void 0 : _column$enumColumn10.enumSuffix.toUpperCase())];
371
454
  } else return props.values[value.toUpperCase()];
372
455
  }
373
456
 
@@ -392,6 +475,28 @@ var TableComponent = function TableComponent(props) {
392
475
  return value.join(', ');
393
476
  }
394
477
 
478
+ if (column.isBoolean) {
479
+ var booleanStr = value ? 'true' : 'false';
480
+
481
+ if (column.isBoolean.enumType) {
482
+ var _column$isBoolean3;
483
+
484
+ if (column.isBoolean.enumSuffix) {
485
+ var _column$isBoolean, _column$isBoolean2;
486
+
487
+ return props.values[((_column$isBoolean = column.isBoolean) == null ? void 0 : _column$isBoolean.enumType[booleanStr].toUpperCase()) + "_" + ((_column$isBoolean2 = column.isBoolean) == null ? void 0 : _column$isBoolean2.enumSuffix.toUpperCase())];
488
+ } else return props.values[(_column$isBoolean3 = column.isBoolean) == null ? void 0 : _column$isBoolean3.enumType[booleanStr].toUpperCase()];
489
+ } else if (column.isBoolean.enumSuffix) {
490
+ var _column$isBoolean4;
491
+
492
+ return props.values[booleanStr.toUpperCase() + "_" + ((_column$isBoolean4 = column.isBoolean) == null ? void 0 : _column$isBoolean4.enumSuffix.toUpperCase())];
493
+ }
494
+ }
495
+
496
+ if (typeof value === 'boolean') {
497
+ return String(value);
498
+ }
499
+
395
500
  return value;
396
501
  };
397
502
 
@@ -402,16 +507,46 @@ var TableComponent = function TableComponent(props) {
402
507
  for (var i = 0, n = a.length; i < n; ++i) {
403
508
  var k = a[i];
404
509
 
405
- if (k in o) {
406
- o = o[k];
407
- } else {
408
- return;
510
+ try {
511
+ if (k in o) {
512
+ o = o[k];
513
+ } else {
514
+ return undefined;
515
+ }
516
+ } catch (_error) {
517
+ return undefined;
409
518
  }
410
519
  }
411
520
 
412
521
  return o;
413
522
  };
414
523
 
524
+ var EditableTableCell = function EditableTableCell(row, value, fieldName, editableCell) {
525
+ var rowEdit = JSON.parse(JSON.stringify(row));
526
+
527
+ if (editableCell.isTextField) {
528
+ var setUpdate = lodash.debounce(function () {
529
+ var _editableCell$isTextF, _editableCell$isTextF2;
530
+
531
+ ((_editableCell$isTextF = editableCell.isTextField) == null ? void 0 : _editableCell$isTextF.onCellValueChange) && ((_editableCell$isTextF2 = editableCell.isTextField) == null ? void 0 : _editableCell$isTextF2.onCellValueChange(rowEdit));
532
+ }, 1000);
533
+
534
+ var handleTextFieldChange = function handleTextFieldChange(e) {
535
+ rowEdit[fieldName] = e.target.value;
536
+ setUpdate();
537
+ };
538
+
539
+ return React__default.createElement(TextFieldComponent, {
540
+ type: editableCell.isTextField.type,
541
+ onChange: handleTextFieldChange,
542
+ name: fieldName,
543
+ defaultValue: value
544
+ });
545
+ } else {
546
+ return value;
547
+ }
548
+ };
549
+
415
550
  return React__default.createElement(_.Box, {
416
551
  className: "table-component"
417
552
  }, React__default.createElement(_.Paper, {
@@ -487,8 +622,6 @@ var TableComponent = function TableComponent(props) {
487
622
  tabIndex: -1,
488
623
  key: row.id || index
489
624
  }, props.columns.map(function (column) {
490
- var _column$enumColumn5;
491
-
492
625
  var value = ObjectbyString(row, column.id);
493
626
  var isItemSelected = column.isCheck && isSelected(row.id);
494
627
  return React__default.createElement(_.TableCell, {
@@ -542,8 +675,12 @@ var TableComponent = function TableComponent(props) {
542
675
  onChange: function onChange(event) {
543
676
  return onCheckAction(event, row.id);
544
677
  }
545
- })) : React__default.createElement(_.Box, {
546
- className: ((_column$enumColumn5 = column.enumColumn) != null && _column$enumColumn5.hasColor ? value.toLowerCase() + "-type-color" : '') + " format-value"
678
+ })) : column.isEditableTableCell ? EditableTableCell(row, value, column.id, column.isEditableTableCell) : column.enumColumn ? React__default.createElement(_.Box, {
679
+ className: (column.enumColumn.hasColor ? (column.enumColumn.enumSuffix ? value.toLowerCase() + "-" + column.enumColumn.enumSuffix.toLowerCase() : value.toString().toLowerCase()) + "-type-color" : '') + " format-value"
680
+ }, formatValue(value, column)) : column.isBoolean ? React__default.createElement(_.Box, {
681
+ className: (column.isBoolean.hasColor ? (column.isBoolean.enumSuffix ? value.toString().toLowerCase() + "-" + column.isBoolean.enumSuffix.toLowerCase() : value.toString().toLowerCase()) + "-boolean-color" : '') + " format-value"
682
+ }, formatValue(value, column)) : React__default.createElement(_.Box, {
683
+ className: "format-value"
547
684
  }, formatValue(value, column)));
548
685
  }));
549
686
  }) : !props.loading ? React__default.createElement(_.TableRow, null, React__default.createElement(_.TableCell, {
@@ -588,8 +725,8 @@ TableComponent.defaultProps = {
588
725
  showTotalCount: true
589
726
  };
590
727
 
591
- var css_248z$4 = ".main-layout-simple {\n width: 100%;\n}\n.main-layout-simple .main-wrapper {\n width: 100%;\n min-height: 100vh;\n height: fit-content;\n position: relative;\n}";
592
- styleInject(css_248z$4);
728
+ var css_248z$5 = ".main-layout-simple {\n width: 100%;\n}\n.main-layout-simple .main-wrapper {\n width: 100%;\n min-height: 100vh;\n height: fit-content;\n position: relative;\n}";
729
+ styleInject(css_248z$5);
593
730
 
594
731
  var MainLayoutSimple = function MainLayoutSimple(props) {
595
732
  return React__default.createElement(_.Box, {
@@ -755,8 +892,8 @@ var VerticalNavItemCollapse = function VerticalNavItemCollapse(props) {
755
892
 
756
893
  var VerticalNavItemCollapse$1 = /*#__PURE__*/React__default.memo(VerticalNavItemCollapse);
757
894
 
758
- var css_248z$5 = ".vertical-navigation {\n background: transparent;\n color: white;\n}\n.vertical-navigation .nav-item {\n cursor: pointer;\n}\n.vertical-navigation .nav-item svg {\n font-size: 28px;\n}\n.vertical-navigation .nav-item {\n padding: 12px;\n}\n.vertical-navigation .nav-item:hover {\n background-color: #333f54;\n}\n.vertical-navigation .active .nav-item {\n background-color: #3299C7;\n border-radius: 0 25px 25px 0;\n margin-right: 16px;\n}\n.vertical-navigation .active .nav-item .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .active .nav-item:hover {\n color: white !important;\n}\n.vertical-navigation .active .nav-item:hover .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active {\n background-color: #333f54;\n}\n.vertical-navigation .nav-item-collapse .active .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active:hover {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active:hover .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .open {\n background-color: #333f54;\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .open .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .collapse-children {\n background-color: #39465e;\n}\n.vertical-navigation .nav-item-collapse .collapse-children .nav-item-text {\n padding-left: 16px;\n padding-right: 16px;\n}";
759
- styleInject(css_248z$5);
895
+ var css_248z$6 = ".vertical-navigation {\n background: transparent;\n color: white;\n}\n.vertical-navigation .nav-item {\n cursor: pointer;\n}\n.vertical-navigation .nav-item svg {\n font-size: 28px;\n}\n.vertical-navigation .nav-item {\n padding: 12px;\n}\n.vertical-navigation .nav-item:hover {\n background-color: #333f54;\n}\n.vertical-navigation .active .nav-item {\n background-color: #3299C7;\n border-radius: 0 25px 25px 0;\n margin-right: 16px;\n}\n.vertical-navigation .active .nav-item .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .active .nav-item:hover {\n color: white !important;\n}\n.vertical-navigation .active .nav-item:hover .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active {\n background-color: #333f54;\n}\n.vertical-navigation .nav-item-collapse .active .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active:hover {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active:hover .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .open {\n background-color: #333f54;\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .open .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .collapse-children {\n background-color: #39465e;\n}\n.vertical-navigation .nav-item-collapse .collapse-children .nav-item-text {\n padding-left: 16px;\n padding-right: 16px;\n}";
896
+ styleInject(css_248z$6);
760
897
 
761
898
  (function (NavigationType) {
762
899
  NavigationType[NavigationType["Item"] = 0] = "Item";
@@ -786,8 +923,8 @@ var VerticalNav = function VerticalNav(props) {
786
923
  }));
787
924
  };
788
925
 
789
- var css_248z$6 = ".user-info svg {\n font-size: 28px !important;\n}";
790
- styleInject(css_248z$6);
926
+ var css_248z$7 = ".user-info svg {\n font-size: 28px !important;\n}";
927
+ styleInject(css_248z$7);
791
928
 
792
929
  var UserInfo = function UserInfo(props) {
793
930
  var _React$useState = React__default.useState(null),
@@ -839,8 +976,8 @@ var UserInfo = function UserInfo(props) {
839
976
  }))))));
840
977
  };
841
978
 
842
- var css_248z$7 = ".app-sidebar {\n width: 17rem;\n background-color: #3f4d67;\n box-shadow: 1px 0 20px 0 #3f4d67;\n z-index: 1029;\n color: white;\n}";
843
- styleInject(css_248z$7);
979
+ var css_248z$8 = ".app-sidebar {\n width: 17rem;\n background-color: #3f4d67;\n box-shadow: 1px 0 20px 0 #3f4d67;\n z-index: 1029;\n color: white;\n}";
980
+ styleInject(css_248z$8);
844
981
 
845
982
  var AppSidebar = function AppSidebar(props) {
846
983
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.Drawer, {
@@ -897,8 +1034,8 @@ var AppSidebar = function AppSidebar(props) {
897
1034
  }, props.footerComponents))))));
898
1035
  };
899
1036
 
900
- var css_248z$8 = ".drawer-sidebar {\n width: 17rem;\n background-color: #3f4d67;\n box-shadow: 1px 0 20px 0 #3f4d67;\n z-index: 1029;\n color: white;\n}";
901
- styleInject(css_248z$8);
1037
+ var css_248z$9 = ".drawer-sidebar {\n width: 17rem;\n background-color: #3f4d67;\n box-shadow: 1px 0 20px 0 #3f4d67;\n z-index: 1029;\n color: white;\n}";
1038
+ styleInject(css_248z$9);
902
1039
 
903
1040
  var DrawerSidebar = function DrawerSidebar(props) {
904
1041
  return React__default.createElement(material.Drawer, {
@@ -924,8 +1061,8 @@ var DrawerSidebar = function DrawerSidebar(props) {
924
1061
  }, props.footerComponents))));
925
1062
  };
926
1063
 
927
- var css_248z$9 = ".app-bar {\n background-color: white !important;\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n color: black !important;\n}\n.app-bar .header-logo {\n max-height: 59px;\n height: 100%;\n min-height: 56px;\n width: 100%;\n}\n.app-bar img {\n max-height: 59px;\n height: 100%;\n min-height: 56px;\n width: 100%;\n}";
928
- styleInject(css_248z$9);
1064
+ var css_248z$a = ".app-bar {\n background-color: white !important;\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n color: black !important;\n}\n.app-bar .header-logo {\n max-height: 59px;\n height: 100%;\n min-height: 56px;\n width: 100%;\n}\n.app-bar img {\n max-height: 59px;\n height: 100%;\n min-height: 56px;\n width: 100%;\n}";
1065
+ styleInject(css_248z$a);
929
1066
 
930
1067
  var AppHeader = function AppHeader(props) {
931
1068
  return React__default.createElement(material.AppBar, {
@@ -947,90 +1084,30 @@ var AppHeader = function AppHeader(props) {
947
1084
  }, React__default.createElement(MenuIcon, null)), props.children));
948
1085
  };
949
1086
 
950
- var css_248z$a = ".MuiButton-root {\n width: auto;\n padding: 0.8rem 1rem !important;\n text-transform: inherit !important;\n line-height: inherit !important;\n box-shadow: none !important;\n font-size: 1rem !important;\n background-color: #3299C7;\n}\n.MuiButton-root.btn-login {\n width: 100%;\n}\n.MuiButton-root.btn-modal-cancel {\n background-color: #666666 !important;\n}\n.MuiButton-root.btn-modal-cancel.Mui-disabled {\n background-color: #666666c4 !important;\n color: #030303b4 !important;\n}\n.MuiButton-root:hover {\n box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12) !important;\n}\n.MuiButton-root .MuiCircularProgress-root {\n color: white !important;\n}\n.MuiButton-root .MuiButton-label .MuiCircularProgress-root {\n color: white !important;\n}\n.MuiButton-root .MuiButton-startIcon svg {\n font-size: 20px !important;\n}\n.MuiButton-root .MuiButton-endIcon svg {\n font-size: 20px !important;\n}";
951
- styleInject(css_248z$a);
1087
+ var css_248z$b = ".MuiButton-root {\n width: auto;\n padding: 0.8rem 1rem !important;\n text-transform: inherit !important;\n line-height: inherit !important;\n box-shadow: none !important;\n font-size: 1rem !important;\n background-color: #3299C7;\n}\n.MuiButton-root.btn-login {\n width: 100%;\n}\n.MuiButton-root.btn-reverse-color {\n border: 1px solid #3299C7;\n color: #3299C7;\n background-color: white !important;\n}\n.MuiButton-root.btn-modal-cancel {\n background-color: #666666 !important;\n}\n.MuiButton-root.btn-modal-cancel.Mui-disabled {\n background-color: #666666c4 !important;\n color: #030303b4 !important;\n}\n.MuiButton-root:hover {\n box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12) !important;\n}\n.MuiButton-root .MuiCircularProgress-root {\n color: white;\n}\n.MuiButton-root .MuiButton-label .MuiCircularProgress-root {\n color: white;\n}\n.MuiButton-root .MuiButton-startIcon svg {\n font-size: 20px !important;\n}\n.MuiButton-root .MuiButton-endIcon svg {\n font-size: 20px !important;\n}";
1088
+ styleInject(css_248z$b);
952
1089
 
953
1090
  var ButtonComponent = function ButtonComponent(props) {
954
1091
  return React__default.createElement(_.Button, {
955
1092
  type: props.type && props.type,
956
1093
  variant: "contained",
957
1094
  form: props.form && props.form,
958
- className: "main-background-color " + (props.className ? props.className : ''),
1095
+ className: (props.reverseColors ? 'btn-reverse-color main-color main-border-color' : 'main-background-color') + " " + (props.className ? props.className : ''),
959
1096
  startIcon: !props.loading && props.startIcon,
960
1097
  endIcon: !props.loading && props.endIcon,
961
1098
  onClick: props.onClick,
962
- disabled: !props.loading && props.disabled
1099
+ disabled: !props.loading && props.disabled,
1100
+ component: props.component
963
1101
  }, props.loading ? React__default.createElement(_.CircularProgress, {
964
- size: 25
1102
+ className: "" + (props.reverseColors ? 'circular-progress-main-color' : ''),
1103
+ size: 20
965
1104
  }) : props.label);
966
1105
  };
967
-
968
- var css_248z$b = ".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}";
969
- styleInject(css_248z$b);
970
-
971
- var TextFieldComponent = function TextFieldComponent(props) {
972
- var _React$useState = React__default.useState(false),
973
- hover = _React$useState[0],
974
- setHover = _React$useState[1];
975
-
976
- return React__default.createElement(_.Box, {
977
- className: "text-field-component",
978
- width: "100%"
979
- }, React__default.createElement(_.TextField, {
980
- onMouseEnter: function onMouseEnter() {
981
- return setHover(true);
982
- },
983
- onMouseLeave: function onMouseLeave() {
984
- return setHover(false);
985
- },
986
- name: props.name,
987
- error: props.error,
988
- id: props.id,
989
- label: props.label,
990
- value: props.value,
991
- defaultValue: props.defaultValue,
992
- className: props.className,
993
- required: props.required,
994
- disabled: props.disabled,
995
- type: props.type,
996
- placeholder: props.placeholder,
997
- autoComplete: props.autoComplete,
998
- variant: "standard",
999
- ref: props.inputRef,
1000
- InputProps: {
1001
- className: (props.noBorders ? 'no-border' : '') + " " + (!props.disabled && hover ? 'main-border-color' : ''),
1002
- disableUnderline: true,
1003
- startAdornment: props.startIcon,
1004
- endAdornment: props.endIcon,
1005
- inputProps: {
1006
- max: props.maxNumber,
1007
- min: props.minNumber,
1008
- step: props.step
1009
- }
1010
- },
1011
- InputLabelProps: {
1012
- shrink: true
1013
- },
1014
- helperText: props.helperText,
1015
- fullWidth: props.fullWidth,
1016
- multiline: props.multiline,
1017
- rows: props.rows,
1018
- onChange: props.onChange,
1019
- onKeyUp: props.onKeyUp,
1020
- inputProps: {
1021
- maxLength: props.maxLength,
1022
- step: props.step,
1023
- max: props.maxNumber,
1024
- min: props.minNumber
1025
- }
1026
- }));
1027
- };
1028
- TextFieldComponent.defaultProps = {
1029
- fullWidth: true,
1030
- type: 'text'
1106
+ ButtonComponent.defaultProps = {
1107
+ component: 'button'
1031
1108
  };
1032
1109
 
1033
- var css_248z$c = ".text-simple-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-simple-component .MuiFormLabel-root + .text-simple-box.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 !important;\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}";
1110
+ var css_248z$c = ".text-simple-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-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 !important;\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}";
1034
1111
  styleInject(css_248z$c);
1035
1112
 
1036
1113
  var TextSimpleComponent = function TextSimpleComponent(props) {
@@ -1041,7 +1118,7 @@ var TextSimpleComponent = function TextSimpleComponent(props) {
1041
1118
  }, props.label && React__default.createElement(_.FormLabel, null, props.label), React__default.createElement(_.Box, {
1042
1119
  display: "flex",
1043
1120
  alignItems: "center",
1044
- className: "text-simple-box " + (props.className ? props.className : '') + " " + (props.noBorders ? 'no-border' : '') + " " + (props.error ? 'has-error-border' : ''),
1121
+ className: "text-simple-box " + (props.className ? props.className : '') + " " + (props.noMargin ? 'no-margin' : '') + " " + (props.noBorders ? 'no-border' : '') + " " + (props.error ? 'has-error-border' : ''),
1045
1122
  width: "" + (props.fullWidth ? 'auto' : 'fit-content')
1046
1123
  }, props.startIcon && React__default.createElement(_.Box, {
1047
1124
  mr: 1