argous 1.2.247 → 1.3.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/api/WebSocket.d.ts +18 -10
- package/dist/api/WebSocket.js +26 -18
- package/dist/api/index.js +54 -43
- package/dist/api/ws.d.ts +1 -1
- package/dist/api/ws.js +44 -3
- package/dist/components/Alert/Alert.js +17 -7
- package/dist/components/ArgousAction/ArgousAction.js +17 -7
- package/dist/components/ArgousAvatar/ArgousAvatar.d.ts +1 -1
- package/dist/components/ArgousAvatar/ArgousAvatar.js +44 -60
- package/dist/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +1 -1
- package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +107 -81
- package/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -1
- package/dist/components/ArgousComplexTable/ArgousComplexTable.js +39 -52
- package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +1 -1
- package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +119 -97
- package/dist/components/ArgousComplexTableBody/DragAndDrop.d.ts +37 -0
- package/dist/components/ArgousComplexTableBody/DragAndDrop.js +156 -0
- package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +64 -47
- package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +55 -37
- package/dist/components/ArgousInput/ArgousInput.js +19 -9
- package/dist/components/ArgousPagination/ArgousPagination.js +18 -11
- package/dist/components/ArgousProgressBar/ArgousProgressBar.js +64 -74
- package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +28 -22
- package/dist/components/AutoComplete/AutoComplete.js +18 -9
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +3 -4
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +226 -174
- package/dist/components/BarChart/BarChart.js +17 -7
- package/dist/components/BarraFerramentas/BarraFerramentas.js +119 -105
- package/dist/components/Button/Button.js +17 -7
- package/dist/components/Cabecalho/Cabecalho.js +17 -7
- package/dist/components/Calendar/Calendar.js +24 -41
- package/dist/components/Cam/Cam.js +19 -9
- package/dist/components/Carousel/Carousel.js +113 -103
- package/dist/components/CartaoUsuario/CartaoUsuario.js +36 -26
- package/dist/components/Collapse/Collapse.d.ts +3 -3
- package/dist/components/Collapse/Collapse.js +121 -71
- package/dist/components/Compartilhar/Compartilhar.js +70 -65
- package/dist/components/ConfirmModal/BasicModal.d.ts +1 -1
- package/dist/components/ConfirmModal/BasicModal.js +8 -8
- package/dist/components/ConfirmModal/ModalProvider.d.ts +12 -1
- package/dist/components/ConfirmModal/ModalProvider.js +17 -7
- package/dist/components/ConfirmModal/WrapperModal.d.ts +2 -2
- package/dist/components/ConfirmModal/WrapperModal.js +5 -5
- package/dist/components/ContactValidationInput/ContactValidationInput.d.ts +1 -1
- package/dist/components/ContactValidationInput/ContactValidationInput.js +105 -80
- package/dist/components/ContactValidationInput/SealModal.d.ts +1 -1
- package/dist/components/ContactValidationInput/SealModal.js +13 -20
- package/dist/components/Document/Icons.d.ts +2 -2
- package/dist/components/Document/Icons.js +33 -16
- package/dist/components/Document/ModalVisualizacaoDocumentos.d.ts +1 -1
- package/dist/components/Document/ModalVisualizacaoDocumentos.js +33 -17
- package/dist/components/Document/Visualizacao.d.ts +1 -1
- package/dist/components/Document/Visualizacao.js +48 -34
- package/dist/components/DropArea/DropArea.js +27 -12
- package/dist/components/DropArea/Html5FileSelector.js +6 -7
- package/dist/components/Editor/ScriptLoader2.d.ts +1 -1
- package/dist/components/Editor/ScriptLoader2.js +2 -2
- package/dist/components/Editor/Utils.d.ts +3 -3
- package/dist/components/Editor/Utils.js +2 -2
- package/dist/components/Editor/components/Editor.d.ts +1 -1
- package/dist/components/Editor/components/Editor.js +18 -9
- package/dist/components/Editor/components/EditorPropTypes.js +17 -7
- package/dist/components/FilePreparer/FilePreparer.d.ts +1 -1
- package/dist/components/FilePreparer/FilePreparer.js +105 -88
- package/dist/components/FileUploader/FileUploader.js +33 -22
- package/dist/components/FormVisualizer/FormVisualizer.d.ts +5 -7
- package/dist/components/FormVisualizer/FormVisualizer.js +92 -61
- package/dist/components/HalfGauge/HalfGauge.js +87 -135
- package/dist/components/Highlight/Highlight.js +23 -12
- package/dist/components/ImageResize/ImageResize.d.ts +1 -1
- package/dist/components/ImageResize/ImageResize.js +79 -85
- package/dist/components/ImageResizeButton/ImageResizeButton.d.ts +1 -1
- package/dist/components/ImageResizeButton/ImageResizeButton.js +19 -9
- package/dist/components/Input/Input.js +19 -9
- package/dist/components/InputTags/InputTags.js +22 -13
- package/dist/components/ListSelect/ListSelect.js +17 -7
- package/dist/components/MaterialButton/MaterialButton.d.ts +2 -4
- package/dist/components/MaterialButton/MaterialButton.js +56 -125
- package/dist/components/MenuBar/MenuBar.js +17 -7
- package/dist/components/MonthPicker/MonthPicker.js +20 -10
- package/dist/components/MultipleSelect/MultipleSelect.js +17 -7
- package/dist/components/OtpInput/OtpInput.d.ts +1 -1
- package/dist/components/OtpInput/OtpInput.js +71 -58
- package/dist/components/OutputText/OutputText.js +17 -7
- package/dist/components/Pagination/Pagination.js +17 -7
- package/dist/components/PercentageDisplay/PercentageDisplay.d.ts +1 -1
- package/dist/components/PercentageDisplay/PercentageDisplay.js +24 -92
- package/dist/components/Programa/PageCodeEasterEgg.d.ts +5 -4
- package/dist/components/Programa/PageCodeEasterEgg.js +41 -32
- package/dist/components/Programa/Programa.d.ts +2 -2
- package/dist/components/Programa/Programa.js +50 -28
- package/dist/components/Programa/Tab.d.ts +2 -2
- package/dist/components/Programa/TabNavigationRail.d.ts +3 -3
- package/dist/components/Programa/TabNavigationRail.js +13 -55
- package/dist/components/ProgressBar/ProgressBar.js +17 -7
- package/dist/components/Select/Select.js +17 -7
- package/dist/components/SimpleTable/SimpleTable.js +17 -7
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.js +194 -179
- package/dist/components/TablePicker/TablePicker.js +37 -12
- package/dist/components/Tabs/Tabs.js +17 -7
- package/dist/components/TextArea/TextArea.js +17 -7
- package/dist/components/TextToHtml/Cursor.d.ts +1 -1
- package/dist/components/TextToHtml/Cursor.js +17 -7
- package/dist/components/TextToHtml/TextStyles.d.ts +1 -1
- package/dist/components/TextToHtml/TextStyles.js +51 -44
- package/dist/components/TextToHtml/TextToHtml.js +37 -17
- package/dist/components/ThreadLog/ThreadLog.js +19 -9
- package/dist/components/UserCard/UserCard.js +36 -26
- package/dist/components/UtilAutoComplete/UtilAutoComplete.d.ts +3 -4
- package/dist/components/UtilAutoComplete/UtilAutoComplete.js +26 -16
- package/dist/components/UtilTextField/UtilTextField.d.ts +1 -1
- package/dist/components/UtilTextField/UtilTextField.js +26 -14
- package/dist/components/Zoom/Zoom.js +23 -24
- package/dist/fieldsRedux/createField.js +17 -7
- package/dist/fieldsRedux/fieldsRedux.js +19 -9
- package/dist/fieldsRedux/passFields.js +17 -7
- package/dist/reducers/index.d.ts +98 -2
- package/dist/utils/api.js +32 -15
- package/dist/utils/config.js +2 -3
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +68 -54
- package/dist/utils/store.js +2 -3
- package/lib/api/WebSocket.js +11 -12
- package/lib/api/index.js +14 -14
- package/lib/api/ws.js +48 -4
- package/lib/components/ArgousAvatar/ArgousAvatar.d.ts +1 -1
- package/lib/components/ArgousAvatar/ArgousAvatar.js +20 -54
- package/lib/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +1 -1
- package/lib/components/ArgousComplexPagination/ArgousComplexPagination.js +50 -25
- package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -1
- package/lib/components/ArgousComplexTable/ArgousComplexTable.js +15 -15
- package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +1 -1
- package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.js +121 -106
- package/lib/components/ArgousComplexTableBody/DragAndDrop.js +85 -0
- package/lib/components/ArgousComplexTableHead/ArgousComplexTableHead.js +60 -51
- package/lib/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +21 -12
- package/lib/components/ArgousInput/ArgousInput.js +2 -2
- package/lib/components/ArgousPagination/ArgousPagination.js +12 -4
- package/lib/components/ArgousProgressBar/ArgousProgressBar.js +67 -78
- package/lib/components/ArgousSimpleTable/ArgousSimpleTable.js +12 -18
- package/lib/components/AutoComplete/AutoComplete.js +2 -3
- package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +3 -4
- package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.js +174 -108
- package/lib/components/BarraFerramentas/BarraFerramentas.js +32 -21
- package/lib/components/Calendar/Calendar.js +7 -42
- package/lib/components/Carousel/Carousel.js +42 -27
- package/lib/components/CartaoUsuario/CartaoUsuario.js +6 -6
- package/lib/components/Collapse/Collapse.d.ts +3 -3
- package/lib/components/Collapse/Collapse.js +92 -57
- package/lib/components/Compartilhar/Compartilhar.js +47 -46
- package/lib/components/ConfirmModal/BasicModal.tsx +1 -1
- package/lib/components/ConfirmModal/WrapperModal.tsx +2 -2
- package/lib/components/ContactValidationInput/ContactValidationInput.d.ts +1 -1
- package/lib/components/ContactValidationInput/ContactValidationInput.js +248 -213
- package/lib/components/ContactValidationInput/SealModal.js +38 -32
- package/lib/components/Document/Icons.js +14 -6
- package/lib/components/Document/ModalVisualizacaoDocumentos.js +9 -2
- package/lib/components/Document/Visualizacao.js +31 -25
- package/lib/components/DropArea/DropArea.js +9 -3
- package/lib/components/Editor/ScriptLoader2.ts +3 -3
- package/lib/components/Editor/Utils.ts +3 -3
- package/lib/components/Editor/components/Editor.tsx +1 -1
- package/lib/components/Editor/tinymce/README.md +73 -0
- package/lib/components/Editor/tinymce/langs/README.md +3 -0
- package/lib/components/Editor/tinymce/models/dom/model.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/accordion/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/table/plugin.js +3 -3
- package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/themes/silver/theme.js +38 -38
- package/lib/components/Editor/tinymce/themes/silver/theme.min.js +1 -1
- package/lib/components/Editor/tinymce/tinymce.js +12 -12
- package/lib/components/Editor/tinymce/tinymce.min.js +1 -1
- package/lib/components/FilePreparer/FilePreparer.d.ts +1 -1
- package/lib/components/FilePreparer/FilePreparer.js +112 -108
- package/lib/components/FileUploader/FileUploader.js +8 -7
- package/lib/components/FormVisualizer/FormVisualizer.d.ts +5 -7
- package/lib/components/FormVisualizer/FormVisualizer.js +59 -46
- package/lib/components/HalfGauge/HalfGauge.js +87 -85
- package/lib/components/Highlight/Highlight.js +4 -4
- package/lib/components/ImageResize/ImageResize.d.ts +1 -1
- package/lib/components/ImageResize/ImageResize.js +123 -118
- package/lib/components/ImageResizeButton/ImageResizeButton.d.ts +1 -1
- package/lib/components/ImageResizeButton/ImageResizeButton.js +1 -1
- package/lib/components/Input/Input.js +2 -2
- package/lib/components/InputTags/InputTags.js +6 -7
- package/lib/components/MaterialButton/MaterialButton.d.ts +2 -4
- package/lib/components/MaterialButton/MaterialButton.js +50 -125
- package/lib/components/MonthPicker/MonthPicker.js +2 -2
- package/lib/components/OtpInput/OtpInput.tsx +77 -69
- package/lib/components/PercentageDisplay/PercentageDisplay.d.ts +1 -1
- package/lib/components/PercentageDisplay/PercentageDisplay.js +29 -54
- package/lib/components/Programa/PageCodeEasterEgg.js +41 -40
- package/lib/components/Programa/Programa.d.ts +2 -2
- package/lib/components/Programa/Programa.js +21 -5
- package/lib/components/Programa/Tab.ts +4 -2
- package/lib/components/Programa/TabNavigationRail.js +9 -31
- package/lib/components/Stepper/Stepper.d.ts +1 -1
- package/lib/components/Stepper/Stepper.js +222 -190
- package/lib/components/TablePicker/TablePicker.js +11 -6
- package/lib/components/TextToHtml/TextStyles.js +42 -42
- package/lib/components/TextToHtml/TextToHtml.js +102 -92
- package/lib/components/ThreadLog/ThreadLog.js +1 -1
- package/lib/components/UserCard/UserCard.js +6 -6
- package/lib/components/UtilAutoComplete/UtilAutoComplete.d.ts +3 -4
- package/lib/components/UtilAutoComplete/UtilAutoComplete.js +67 -9
- package/lib/components/UtilTextField/UtilTextField.d.ts +1 -1
- package/lib/components/UtilTextField/UtilTextField.js +18 -16
- package/lib/components/Zoom/Zoom.js +6 -3
- package/lib/utils/api.ts +1 -1
- package/lib/utils/index.ts +10 -8
- package/package.json +56 -56
- package/.gitlab-ci.yml +0 -21
|
@@ -1,117 +1,117 @@
|
|
|
1
1
|
import { prepareFile } from '../../api';
|
|
2
2
|
import { setError } from '../../utils/api';
|
|
3
|
-
import { Chip, CircularProgress, FilledInput,
|
|
4
|
-
import {
|
|
5
|
-
import clsx from 'clsx';
|
|
3
|
+
import { Chip, CircularProgress, FilledInput, GlobalStyles, IconButton, TextField, useAutocomplete } from '@mui/material';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
6
5
|
import { produce } from 'immer';
|
|
7
6
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
8
7
|
import { MdAttachment, MdClear } from 'react-icons/md';
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
tag:
|
|
9
|
+
const classes = {
|
|
10
|
+
tag: 'argous-file-preparer-tag',
|
|
11
|
+
inputRoot: 'argous-file-preparer-input-root',
|
|
12
|
+
input: 'argous-file-preparer-input',
|
|
13
|
+
inputFocused: 'argous-file-preparer-input-focused',
|
|
14
|
+
clearIndicator: 'argous-file-preparer-clear-indicator',
|
|
15
|
+
clearIndicatorDirty: 'argous-file-preparer-clear-indicator-dirty',
|
|
16
|
+
root: 'argous-file-preparer-root',
|
|
17
|
+
loading: 'argous-file-preparer-loading',
|
|
18
|
+
endAdornment: 'argous-file-preparer-end-adornment',
|
|
19
|
+
rename: 'argous-file-preparer-rename',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const filePreparerStyles = {
|
|
23
|
+
[`.${classes.tag}`]: {
|
|
12
24
|
margin: 3,
|
|
13
25
|
maxWidth: 'calc(100% - 6px)',
|
|
14
26
|
},
|
|
15
|
-
inputRoot: {
|
|
27
|
+
[`.${classes.inputRoot}`]: {
|
|
16
28
|
flexWrap: 'wrap',
|
|
17
|
-
|
|
18
|
-
paddingRight: 26 + 4,
|
|
19
|
-
},
|
|
20
|
-
'$hasPopupIcon$hasClearIcon &': {
|
|
21
|
-
paddingRight: 52 + 4,
|
|
22
|
-
},
|
|
23
|
-
'& $input': {
|
|
29
|
+
[`& .${classes.input}`]: {
|
|
24
30
|
width: 0,
|
|
25
31
|
minWidth: 30,
|
|
26
32
|
},
|
|
27
33
|
'&[class*="MuiInput-root"]': {
|
|
28
34
|
paddingBottom: 1,
|
|
29
|
-
|
|
35
|
+
[`& .${classes.input}`]: {
|
|
30
36
|
padding: 4,
|
|
31
37
|
},
|
|
32
|
-
|
|
38
|
+
[`& .${classes.input}:first-child`]: {
|
|
33
39
|
padding: '6px 0',
|
|
34
40
|
},
|
|
35
|
-
},
|
|
41
|
+
},
|
|
36
42
|
'&[class*="MuiOutlinedInput-root"]': {
|
|
37
43
|
padding: 9,
|
|
38
44
|
paddingRight: 26 + 4 + 9,
|
|
39
|
-
|
|
40
|
-
paddingRight: 52 + 4 + 9,
|
|
41
|
-
},
|
|
42
|
-
'& $input': {
|
|
45
|
+
[`& .${classes.input}`]: {
|
|
43
46
|
padding: '9.5px 4px',
|
|
44
47
|
},
|
|
45
|
-
|
|
48
|
+
[`& .${classes.input}:first-child`]: {
|
|
46
49
|
paddingLeft: 6,
|
|
47
50
|
},
|
|
48
|
-
|
|
51
|
+
[`& .${classes.endAdornment}`]: {
|
|
49
52
|
right: 9,
|
|
50
53
|
},
|
|
51
54
|
},
|
|
52
|
-
'&[class*="MuiOutlinedInput-root"][class*="
|
|
55
|
+
'&[class*="MuiOutlinedInput-root"][class*="MuiInputBase-sizeSmall"]': {
|
|
53
56
|
padding: 6,
|
|
54
|
-
|
|
57
|
+
[`& .${classes.input}`]: {
|
|
55
58
|
padding: '4.5px 4px',
|
|
56
59
|
},
|
|
57
|
-
},
|
|
60
|
+
},
|
|
58
61
|
},
|
|
59
|
-
input: {
|
|
62
|
+
[`.${classes.input}`]: {
|
|
60
63
|
flexGrow: 1,
|
|
61
64
|
textOverflow: 'ellipsis',
|
|
62
65
|
opacity: 0,
|
|
63
66
|
},
|
|
64
|
-
inputFocused: {
|
|
67
|
+
[`.${classes.inputFocused}`]: {
|
|
65
68
|
opacity: 1,
|
|
66
69
|
},
|
|
67
|
-
clearIndicator: {
|
|
70
|
+
[`.${classes.clearIndicator}`]: {
|
|
68
71
|
marginRight: -2,
|
|
69
72
|
padding: 4,
|
|
70
73
|
visibility: 'hidden',
|
|
71
74
|
},
|
|
72
|
-
|
|
73
|
-
root: {
|
|
75
|
+
[`.${classes.root}`]: {
|
|
74
76
|
display: 'flex',
|
|
75
77
|
flexGrow: 1,
|
|
76
|
-
|
|
78
|
+
[`& .${classes.clearIndicatorDirty}`]: {
|
|
77
79
|
visibility: 'visible',
|
|
78
80
|
},
|
|
79
81
|
'@media (pointer: fine)': {
|
|
80
|
-
|
|
82
|
+
[`&:hover .${classes.clearIndicatorDirty}`]: {
|
|
81
83
|
visibility: 'visible',
|
|
82
84
|
},
|
|
83
85
|
},
|
|
84
86
|
},
|
|
85
|
-
|
|
86
|
-
endAdornment: {
|
|
87
|
+
[`.${classes.endAdornment}`]: {
|
|
87
88
|
position: 'absolute',
|
|
88
|
-
right: 0,
|
|
89
|
+
right: 0,
|
|
89
90
|
top: 'calc(50% - 24px)',
|
|
90
|
-
|
|
91
|
+
[`.${classes.loading} &`]: {
|
|
91
92
|
top: 'calc(50% - 14px)',
|
|
92
93
|
},
|
|
93
94
|
},
|
|
94
|
-
rename: {
|
|
95
|
+
[`.${classes.rename}`]: {
|
|
95
96
|
borderRadius: 10,
|
|
96
97
|
padding: '5px !important'
|
|
97
98
|
}
|
|
98
|
-
}
|
|
99
|
+
};
|
|
99
100
|
|
|
100
|
-
const FilePreparer = ({
|
|
101
|
-
onChange,
|
|
101
|
+
const FilePreparer = ({
|
|
102
|
+
onChange,
|
|
102
103
|
TextFieldProps,
|
|
103
|
-
placeholder,
|
|
104
|
-
label,
|
|
105
|
-
multiple,
|
|
104
|
+
placeholder,
|
|
105
|
+
label,
|
|
106
|
+
multiple,
|
|
106
107
|
ChipProps,
|
|
107
108
|
disabled,
|
|
108
109
|
fileInputProps,
|
|
109
110
|
valuePlaceHolder,
|
|
110
111
|
concat,
|
|
111
112
|
initialFiles = [],
|
|
112
|
-
...props
|
|
113
|
+
...props
|
|
113
114
|
}, ref) => {
|
|
114
|
-
const classes = useStyles();
|
|
115
115
|
const inputRef = useRef();
|
|
116
116
|
|
|
117
117
|
const [loading, setLoading] = useState(false);
|
|
@@ -153,20 +153,20 @@ const FilePreparer = ({
|
|
|
153
153
|
|
|
154
154
|
useImperativeHandle(ref, () => ({ preparaArquivo, loading, setLoading, setFiles }), [preparaArquivo, loading]);
|
|
155
155
|
|
|
156
|
-
const {
|
|
157
|
-
getInputProps,
|
|
158
|
-
|
|
159
|
-
setAnchorEl,
|
|
160
|
-
|
|
161
|
-
getClearProps,
|
|
162
|
-
dirty
|
|
163
|
-
} = useAutocomplete({
|
|
164
|
-
value: files,
|
|
165
|
-
inputValue: files.length ? '' : placeholder || 'Selecione um arquivo',
|
|
166
|
-
options: [],
|
|
167
|
-
onChange: handleChange,
|
|
168
|
-
multiple: true,
|
|
169
|
-
componentName: 'FilePreparer'
|
|
156
|
+
const {
|
|
157
|
+
getInputProps,
|
|
158
|
+
getItemProps,
|
|
159
|
+
setAnchorEl,
|
|
160
|
+
focusedItem,
|
|
161
|
+
getClearProps,
|
|
162
|
+
dirty
|
|
163
|
+
} = useAutocomplete({
|
|
164
|
+
value: files,
|
|
165
|
+
inputValue: files.length ? '' : placeholder || 'Selecione um arquivo',
|
|
166
|
+
options: [],
|
|
167
|
+
onChange: handleChange,
|
|
168
|
+
multiple: true,
|
|
169
|
+
componentName: 'FilePreparer'
|
|
170
170
|
});
|
|
171
171
|
|
|
172
172
|
const [editando, setEditando] = useState();
|
|
@@ -185,60 +185,64 @@ const FilePreparer = ({
|
|
|
185
185
|
|
|
186
186
|
return (
|
|
187
187
|
<div className={clsx(classes.root, { [classes.loading]: loading })} {...props}>
|
|
188
|
+
<GlobalStyles styles={filePreparerStyles} />
|
|
188
189
|
<input ref={inputRef} type='file' {...{ multiple }} onChange={e => e?.target?.files?.length && preparaArquivo(e.target.files)} style={{ display: 'none' }} {...fileInputProps}/>
|
|
189
190
|
<TextField
|
|
190
191
|
ref={setAnchorEl}
|
|
191
|
-
variant='outlined'
|
|
192
|
-
label={label || 'Arquivo'}
|
|
193
|
-
margin='dense'
|
|
194
|
-
onClick={handleClick}
|
|
192
|
+
variant='outlined'
|
|
193
|
+
label={label || 'Arquivo'}
|
|
194
|
+
margin='dense'
|
|
195
|
+
onClick={handleClick}
|
|
195
196
|
style={{ flexGrow: '1' }}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
197
|
+
{...TextFieldProps}
|
|
198
|
+
slotProps={{
|
|
199
|
+
input: {
|
|
200
|
+
readOnly: true,
|
|
201
|
+
startAdornment: files.length > 0 ?
|
|
202
|
+
files.map((option, index) => editando === index ? (
|
|
203
|
+
<FilledInput className={classes.rename} defaultValue={option.name} autoFocus onBlur={handleRename} multiline disableUnderline/>
|
|
204
|
+
) : (
|
|
205
|
+
<Chip
|
|
206
|
+
className={clsx(classes.tag)}
|
|
207
|
+
label={option.name}
|
|
208
|
+
onClick={handleEditing(index)}
|
|
209
|
+
clickable
|
|
210
|
+
{...{ disabled, ...ChipProps }}
|
|
211
|
+
{...getItemProps({ index })}
|
|
212
|
+
/>
|
|
213
|
+
)) : undefined,
|
|
214
|
+
className: classes.inputRoot,
|
|
215
|
+
endAdornment: <div className={classes.endAdornment}>
|
|
216
|
+
{loading ? <CircularProgress disableShrink size={24}/> : <>
|
|
217
|
+
<IconButton
|
|
218
|
+
disabled={disabled}
|
|
219
|
+
{...getClearProps()}
|
|
220
|
+
className={clsx(classes.clearIndicator, {
|
|
221
|
+
[classes.clearIndicatorDirty]: dirty,
|
|
222
|
+
})}
|
|
223
|
+
>
|
|
224
|
+
<MdClear/>
|
|
225
|
+
</IconButton>
|
|
226
|
+
<IconButton
|
|
227
|
+
disabled={disabled}
|
|
228
|
+
onClick={e => {
|
|
229
|
+
e.stopPropagation();
|
|
230
|
+
inputRef.current.click();
|
|
231
|
+
}}>
|
|
232
|
+
<MdAttachment />
|
|
233
|
+
</IconButton>
|
|
234
|
+
</> }
|
|
235
|
+
</div>
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
htmlInput: {
|
|
239
|
+
className: clsx(classes.input, {
|
|
240
|
+
[classes.inputFocused]: focusedItem === -1,
|
|
241
|
+
}), disabled, ...getInputProps()
|
|
242
|
+
}
|
|
243
|
+
}} />
|
|
240
244
|
</div>
|
|
241
245
|
);
|
|
242
246
|
};
|
|
243
247
|
|
|
244
|
-
export default forwardRef(FilePreparer);
|
|
248
|
+
export default forwardRef(FilePreparer);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { inicFileUpload, sendFilePart, endFileUpload, cancelFileUpload/*, getFileInfo*/ } from '../../api/index';
|
|
2
|
-
import {
|
|
2
|
+
import { CircularProgress, LinearProgress } from '@mui/material';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import React, { useState, useEffect } from 'react';
|
|
5
6
|
|
|
@@ -98,17 +99,17 @@ export function retomaUpload(dados) {
|
|
|
98
99
|
return confirmFileUpload(dados.arquivo, dados.retornaProgresso);
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
export const ColorLinearProgress =
|
|
102
|
-
root: {
|
|
102
|
+
export const ColorLinearProgress = styled(LinearProgress)({
|
|
103
|
+
'&.MuiLinearProgress-root': {
|
|
103
104
|
margin: '5px 0px 0px 5px'
|
|
104
105
|
},
|
|
105
|
-
colorPrimary: {
|
|
106
|
+
'&.MuiLinearProgress-colorPrimary': {
|
|
106
107
|
backgroundColor: '#d3deda',
|
|
107
108
|
},
|
|
108
|
-
|
|
109
|
+
'& .MuiLinearProgress-bar': {
|
|
109
110
|
backgroundColor: '#009C6A',
|
|
110
111
|
},
|
|
111
|
-
})
|
|
112
|
+
});
|
|
112
113
|
|
|
113
114
|
const estiloBotoes = {
|
|
114
115
|
margin: '0px 3px',
|
|
@@ -315,4 +316,4 @@ FileUploader.propTypes = {
|
|
|
315
316
|
funcaoRetorno: PropTypes.func,
|
|
316
317
|
enviarDireto: PropTypes.bool,
|
|
317
318
|
variant: PropTypes.string
|
|
318
|
-
};
|
|
319
|
+
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { CheckboxProps, OutlinedTextFieldProps, RadioProps, TypographyProps } from '@material
|
|
2
|
-
import {
|
|
3
|
-
import { AutocompleteProps } from '@material-ui/lab';
|
|
4
|
-
import { KeyboardDatePickerProps } from '@material-ui/pickers';
|
|
1
|
+
import { CheckboxProps, OutlinedTextFieldProps, RadioProps, TypographyProps, AutocompleteProps } from '@mui/material';
|
|
2
|
+
import { DatePickerProps } from '@mui/x-date-pickers';
|
|
5
3
|
import * as React from 'react';
|
|
6
4
|
|
|
7
5
|
interface TextField extends OutlinedTextFieldProps {
|
|
@@ -27,7 +25,7 @@ interface Label extends TypographyProps {
|
|
|
27
25
|
value: string
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
interface Data extends
|
|
28
|
+
interface Data extends DatePickerProps<any> {
|
|
31
29
|
tp: 'data',
|
|
32
30
|
name: string
|
|
33
31
|
}
|
|
@@ -77,7 +75,7 @@ interface Fase {
|
|
|
77
75
|
|
|
78
76
|
interface JSONInterface {
|
|
79
77
|
nome: string,
|
|
80
|
-
classes:
|
|
78
|
+
classes: Record<string, React.CSSProperties>,
|
|
81
79
|
fases: Fase[],
|
|
82
80
|
}
|
|
83
81
|
|
|
@@ -89,4 +87,4 @@ export interface FormVisualizerProps {
|
|
|
89
87
|
|
|
90
88
|
declare function FormVisualizer(props: FormVisualizerProps): JSX.Element
|
|
91
89
|
|
|
92
|
-
export default FormVisualizer;
|
|
90
|
+
export default FormVisualizer;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import Button from '../../components/MaterialButton';
|
|
2
2
|
import { useUpdateEffect } from '../../utils';
|
|
3
3
|
import { getStore } from '../../utils/store';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
4
|
+
import { Grid, Paper, Card, Typography, TextField, FormLabel, FormGroup, FormControlLabel, Checkbox, RadioGroup, Radio, Dialog, DialogTitle, DialogContent, DialogActions, InputAdornment, IconButton, GlobalStyles } from '@mui/material';
|
|
5
|
+
import Autocomplete from '@mui/material/Autocomplete';
|
|
6
|
+
import { DatePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
|
7
|
+
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
8
8
|
import { isArray, isEqual, isString, set } from 'lodash';
|
|
9
9
|
import moment from 'moment';
|
|
10
10
|
import React, { useEffect, useState, useCallback, memo } from 'react';
|
|
@@ -23,7 +23,8 @@ const init = (initialValues) => (initialState) => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const FormVisualizer = ({ json = {}, initialValues = [], onChange = () => '', disabled }) => {
|
|
26
|
-
const classes =
|
|
26
|
+
const classes = Object.keys(json.classes || {}).reduce((acc, key) => ({ ...acc, [key]: `argous-form-visualizer-${key}` }), {});
|
|
27
|
+
const globalStyles = Object.keys(json.classes || {}).reduce((acc, key) => ({ ...acc, [`.${classes[key]}`]: json.classes[key] }), {});
|
|
27
28
|
|
|
28
29
|
const [state, dispatch] = useImmerReducer(reducer, json.fases.map(fase => fase.documentos.map(documento => documento.linhas.reduce((a, linha) => ({ ...a, ...linha.colunas.reduce((ac, { obj }) => obj.name ? ({ ...ac, [obj.name]: obj.value }) : ac, {}) }), {}))), init(initialValues));
|
|
29
30
|
|
|
@@ -33,6 +34,7 @@ const FormVisualizer = ({ json = {}, initialValues = [], onChange = () => '', di
|
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
36
|
<Card style={{ padding: '10px' }}>
|
|
37
|
+
<GlobalStyles styles={globalStyles} />
|
|
36
38
|
<Typography variant='h4' component='div' align='center' style={{ marginBottom: '10px' }}>{json.nome}</Typography>
|
|
37
39
|
{json.fases && json.fases.map((fase, i) => (
|
|
38
40
|
<Card key={fase.idFase} className={classes[fase.className]} style={{ ...fase.style, padding: '10px', margin: '10px' }}>
|
|
@@ -43,7 +45,7 @@ const FormVisualizer = ({ json = {}, initialValues = [], onChange = () => '', di
|
|
|
43
45
|
{documento.linhas.map((linha, k) => (
|
|
44
46
|
<Grid container spacing={linha.spacing || 2} key={`${k}`} className={classes[linha.className]} style={linha.style}>
|
|
45
47
|
{linha.colunas.map(({ span, className, style, obj: { name, ...obj } }, l) => (
|
|
46
|
-
<Grid
|
|
48
|
+
<Grid key={l} className={classes[className]} style={style} size={span}>
|
|
47
49
|
{console.log(state[i][j][name])}
|
|
48
50
|
<RetornaComponente value={obj.value || state[i][j][name]} fase={i} documento={j} {...{ ...obj, name, dispatch, disabled }} />
|
|
49
51
|
</Grid>
|
|
@@ -81,17 +83,7 @@ const Label = ({ className, style, value, ...props }) => {
|
|
|
81
83
|
return <Typography {...{ className, style, ...props }}>{value}</Typography>;
|
|
82
84
|
};
|
|
83
85
|
|
|
84
|
-
const useStyles = makeStyles({
|
|
85
|
-
textArea: {
|
|
86
|
-
'& textarea': {
|
|
87
|
-
resize: 'vertical',
|
|
88
|
-
minHeight: '50px'
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
86
|
const Text = ({ variant, label, multiple, className, style, options, value, dispatch, path, ...props }) => {
|
|
94
|
-
const classes = useStyles();
|
|
95
87
|
if (variant === 'select') return (
|
|
96
88
|
<Autocomplete
|
|
97
89
|
{...{ multiple, options }}
|
|
@@ -117,7 +109,13 @@ const Text = ({ variant, label, multiple, className, style, options, value, disp
|
|
|
117
109
|
);
|
|
118
110
|
return (
|
|
119
111
|
<TextField
|
|
120
|
-
className={
|
|
112
|
+
className={`mostraSpinner ${className || ''}`}
|
|
113
|
+
sx={{
|
|
114
|
+
'& textarea': {
|
|
115
|
+
resize: 'vertical',
|
|
116
|
+
minHeight: '50px'
|
|
117
|
+
}
|
|
118
|
+
}}
|
|
121
119
|
variant='outlined' margin='dense'
|
|
122
120
|
fullWidth multiline={variant === 'multiline'}
|
|
123
121
|
{...{ label, style }}
|
|
@@ -143,23 +141,25 @@ const Data = ({ label, className, style, value, dispatch, path, ...props }) => {
|
|
|
143
141
|
}, [state, path])
|
|
144
142
|
|
|
145
143
|
return (
|
|
146
|
-
<
|
|
147
|
-
<
|
|
148
|
-
fullWidth
|
|
149
|
-
invalidDateMessage='Data inválida'
|
|
150
|
-
autoOk
|
|
151
|
-
variant='inline'
|
|
152
|
-
inputVariant='outlined'
|
|
153
|
-
label='Data inicial'
|
|
154
|
-
margin='dense'
|
|
155
|
-
InputAdornmentProps={{ position: 'end' }}
|
|
144
|
+
<LocalizationProvider dateAdapter={AdapterMoment}>
|
|
145
|
+
<DatePicker
|
|
156
146
|
format='DD/MM/YYYY'
|
|
157
|
-
{...{ className, label, style }}
|
|
158
147
|
{...props}
|
|
159
|
-
|
|
148
|
+
label={label || 'Data inicial'}
|
|
149
|
+
value={state ? moment(state) : null}
|
|
160
150
|
onChange={setState}
|
|
151
|
+
slotProps={{
|
|
152
|
+
inputAdornment: { position: 'end' },
|
|
153
|
+
textField: {
|
|
154
|
+
className,
|
|
155
|
+
style,
|
|
156
|
+
fullWidth: true,
|
|
157
|
+
margin: 'dense',
|
|
158
|
+
variant: 'outlined',
|
|
159
|
+
}
|
|
160
|
+
}}
|
|
161
161
|
/>
|
|
162
|
-
</
|
|
162
|
+
</LocalizationProvider>
|
|
163
163
|
);
|
|
164
164
|
};
|
|
165
165
|
|
|
@@ -186,7 +186,9 @@ const Selection = ({ label, multiple, className, style, options, value, dispatch
|
|
|
186
186
|
|
|
187
187
|
if (multiple) return (
|
|
188
188
|
<Grid container>
|
|
189
|
-
<Grid
|
|
189
|
+
<Grid
|
|
190
|
+
style={{ ...style, display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: 5, }}
|
|
191
|
+
size={12}>
|
|
190
192
|
{label && <FormLabel style={{ marginBottom: '0px' }}>{label}</FormLabel>}
|
|
191
193
|
<FormGroup row style={{ flexGrow: 1, justifyContent: label ? 'flex-end' : 'space-evenly' }}>
|
|
192
194
|
{options.map((item, i) => (
|
|
@@ -204,7 +206,9 @@ const Selection = ({ label, multiple, className, style, options, value, dispatch
|
|
|
204
206
|
);
|
|
205
207
|
return (
|
|
206
208
|
<Grid container>
|
|
207
|
-
<Grid
|
|
209
|
+
<Grid
|
|
210
|
+
style={{ ...style, display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: 5, }}
|
|
211
|
+
size={12}>
|
|
208
212
|
{label && <FormLabel style={{ marginBottom: '0px' }}>{label}</FormLabel>}
|
|
209
213
|
<RadioGroup row defaultValue={value} onChange={e => setState(e.target.value)} style={{ flexGrow: 1, justifyContent: label ? 'flex-end' : 'space-evenly' }}>
|
|
210
214
|
{options.map((item, i) => (
|
|
@@ -249,7 +253,14 @@ const Signature = ({ label, grupos, usuarios, className, style, value, dados, se
|
|
|
249
253
|
return (
|
|
250
254
|
<>
|
|
251
255
|
<Grid container direction='row-reverse' {...{ className, style }}>
|
|
252
|
-
<Grid
|
|
256
|
+
<Grid
|
|
257
|
+
size={{
|
|
258
|
+
xs: 12,
|
|
259
|
+
sm: 6,
|
|
260
|
+
md: 4,
|
|
261
|
+
lg: 2,
|
|
262
|
+
xl: 1
|
|
263
|
+
}}>
|
|
253
264
|
<Button title={label} color='primary' variant='contained' fullWidth disabled={!podeAssinar} onClick={() => setValues({ ...values, modal: true })}>Assinar</Button>
|
|
254
265
|
</Grid>
|
|
255
266
|
</Grid>
|
|
@@ -263,20 +274,22 @@ const Signature = ({ label, grupos, usuarios, className, style, value, dados, se
|
|
|
263
274
|
type={values.showPassword ? 'text' : 'password'}
|
|
264
275
|
value={values.password}
|
|
265
276
|
onChange={e => setValues({ ...values, password: e.target.value })}
|
|
266
|
-
InputProps={{
|
|
267
|
-
endAdornment: (
|
|
268
|
-
<InputAdornment position='end'>
|
|
269
|
-
<IconButton
|
|
270
|
-
onClick={() => setValues({ ...values, showPassword: !values.showPassword })}
|
|
271
|
-
onMouseDown={e => e.preventDefault()}
|
|
272
|
-
>
|
|
273
|
-
{values.showPassword ? <MdVisibility /> : <MdVisibilityOff />}
|
|
274
|
-
</IconButton>
|
|
275
|
-
</InputAdornment>
|
|
276
|
-
)
|
|
277
|
-
}}
|
|
278
277
|
error={!!values.senhaIncorreta}
|
|
279
278
|
helperText={values.senhaIncorreta}
|
|
279
|
+
slotProps={{
|
|
280
|
+
input: {
|
|
281
|
+
endAdornment: (
|
|
282
|
+
<InputAdornment position='end'>
|
|
283
|
+
<IconButton
|
|
284
|
+
onClick={() => setValues({ ...values, showPassword: !values.showPassword })}
|
|
285
|
+
onMouseDown={e => e.preventDefault()}
|
|
286
|
+
>
|
|
287
|
+
{values.showPassword ? <MdVisibility /> : <MdVisibilityOff />}
|
|
288
|
+
</IconButton>
|
|
289
|
+
</InputAdornment>
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
}}
|
|
280
293
|
/>
|
|
281
294
|
</DialogContent>
|
|
282
295
|
<DialogActions>
|
|
@@ -286,4 +299,4 @@ const Signature = ({ label, grupos, usuarios, className, style, value, dados, se
|
|
|
286
299
|
</Dialog>
|
|
287
300
|
</>
|
|
288
301
|
);
|
|
289
|
-
};
|
|
302
|
+
};
|