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.
Files changed (226) hide show
  1. package/dist/api/WebSocket.d.ts +18 -10
  2. package/dist/api/WebSocket.js +26 -18
  3. package/dist/api/index.js +54 -43
  4. package/dist/api/ws.d.ts +1 -1
  5. package/dist/api/ws.js +44 -3
  6. package/dist/components/Alert/Alert.js +17 -7
  7. package/dist/components/ArgousAction/ArgousAction.js +17 -7
  8. package/dist/components/ArgousAvatar/ArgousAvatar.d.ts +1 -1
  9. package/dist/components/ArgousAvatar/ArgousAvatar.js +44 -60
  10. package/dist/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +1 -1
  11. package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +107 -81
  12. package/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -1
  13. package/dist/components/ArgousComplexTable/ArgousComplexTable.js +39 -52
  14. package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +1 -1
  15. package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +119 -97
  16. package/dist/components/ArgousComplexTableBody/DragAndDrop.d.ts +37 -0
  17. package/dist/components/ArgousComplexTableBody/DragAndDrop.js +156 -0
  18. package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +64 -47
  19. package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +55 -37
  20. package/dist/components/ArgousInput/ArgousInput.js +19 -9
  21. package/dist/components/ArgousPagination/ArgousPagination.js +18 -11
  22. package/dist/components/ArgousProgressBar/ArgousProgressBar.js +64 -74
  23. package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +28 -22
  24. package/dist/components/AutoComplete/AutoComplete.js +18 -9
  25. package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +3 -4
  26. package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +226 -174
  27. package/dist/components/BarChart/BarChart.js +17 -7
  28. package/dist/components/BarraFerramentas/BarraFerramentas.js +119 -105
  29. package/dist/components/Button/Button.js +17 -7
  30. package/dist/components/Cabecalho/Cabecalho.js +17 -7
  31. package/dist/components/Calendar/Calendar.js +24 -41
  32. package/dist/components/Cam/Cam.js +19 -9
  33. package/dist/components/Carousel/Carousel.js +113 -103
  34. package/dist/components/CartaoUsuario/CartaoUsuario.js +36 -26
  35. package/dist/components/Collapse/Collapse.d.ts +3 -3
  36. package/dist/components/Collapse/Collapse.js +121 -71
  37. package/dist/components/Compartilhar/Compartilhar.js +70 -65
  38. package/dist/components/ConfirmModal/BasicModal.d.ts +1 -1
  39. package/dist/components/ConfirmModal/BasicModal.js +8 -8
  40. package/dist/components/ConfirmModal/ModalProvider.d.ts +12 -1
  41. package/dist/components/ConfirmModal/ModalProvider.js +17 -7
  42. package/dist/components/ConfirmModal/WrapperModal.d.ts +2 -2
  43. package/dist/components/ConfirmModal/WrapperModal.js +5 -5
  44. package/dist/components/ContactValidationInput/ContactValidationInput.d.ts +1 -1
  45. package/dist/components/ContactValidationInput/ContactValidationInput.js +105 -80
  46. package/dist/components/ContactValidationInput/SealModal.d.ts +1 -1
  47. package/dist/components/ContactValidationInput/SealModal.js +13 -20
  48. package/dist/components/Document/Icons.d.ts +2 -2
  49. package/dist/components/Document/Icons.js +33 -16
  50. package/dist/components/Document/ModalVisualizacaoDocumentos.d.ts +1 -1
  51. package/dist/components/Document/ModalVisualizacaoDocumentos.js +33 -17
  52. package/dist/components/Document/Visualizacao.d.ts +1 -1
  53. package/dist/components/Document/Visualizacao.js +48 -34
  54. package/dist/components/DropArea/DropArea.js +27 -12
  55. package/dist/components/DropArea/Html5FileSelector.js +6 -7
  56. package/dist/components/Editor/ScriptLoader2.d.ts +1 -1
  57. package/dist/components/Editor/ScriptLoader2.js +2 -2
  58. package/dist/components/Editor/Utils.d.ts +3 -3
  59. package/dist/components/Editor/Utils.js +2 -2
  60. package/dist/components/Editor/components/Editor.d.ts +1 -1
  61. package/dist/components/Editor/components/Editor.js +18 -9
  62. package/dist/components/Editor/components/EditorPropTypes.js +17 -7
  63. package/dist/components/FilePreparer/FilePreparer.d.ts +1 -1
  64. package/dist/components/FilePreparer/FilePreparer.js +105 -88
  65. package/dist/components/FileUploader/FileUploader.js +33 -22
  66. package/dist/components/FormVisualizer/FormVisualizer.d.ts +5 -7
  67. package/dist/components/FormVisualizer/FormVisualizer.js +92 -61
  68. package/dist/components/HalfGauge/HalfGauge.js +87 -135
  69. package/dist/components/Highlight/Highlight.js +23 -12
  70. package/dist/components/ImageResize/ImageResize.d.ts +1 -1
  71. package/dist/components/ImageResize/ImageResize.js +79 -85
  72. package/dist/components/ImageResizeButton/ImageResizeButton.d.ts +1 -1
  73. package/dist/components/ImageResizeButton/ImageResizeButton.js +19 -9
  74. package/dist/components/Input/Input.js +19 -9
  75. package/dist/components/InputTags/InputTags.js +22 -13
  76. package/dist/components/ListSelect/ListSelect.js +17 -7
  77. package/dist/components/MaterialButton/MaterialButton.d.ts +2 -4
  78. package/dist/components/MaterialButton/MaterialButton.js +56 -125
  79. package/dist/components/MenuBar/MenuBar.js +17 -7
  80. package/dist/components/MonthPicker/MonthPicker.js +20 -10
  81. package/dist/components/MultipleSelect/MultipleSelect.js +17 -7
  82. package/dist/components/OtpInput/OtpInput.d.ts +1 -1
  83. package/dist/components/OtpInput/OtpInput.js +71 -58
  84. package/dist/components/OutputText/OutputText.js +17 -7
  85. package/dist/components/Pagination/Pagination.js +17 -7
  86. package/dist/components/PercentageDisplay/PercentageDisplay.d.ts +1 -1
  87. package/dist/components/PercentageDisplay/PercentageDisplay.js +24 -92
  88. package/dist/components/Programa/PageCodeEasterEgg.d.ts +5 -4
  89. package/dist/components/Programa/PageCodeEasterEgg.js +41 -32
  90. package/dist/components/Programa/Programa.d.ts +2 -2
  91. package/dist/components/Programa/Programa.js +50 -28
  92. package/dist/components/Programa/Tab.d.ts +2 -2
  93. package/dist/components/Programa/TabNavigationRail.d.ts +3 -3
  94. package/dist/components/Programa/TabNavigationRail.js +13 -55
  95. package/dist/components/ProgressBar/ProgressBar.js +17 -7
  96. package/dist/components/Select/Select.js +17 -7
  97. package/dist/components/SimpleTable/SimpleTable.js +17 -7
  98. package/dist/components/Stepper/Stepper.d.ts +1 -1
  99. package/dist/components/Stepper/Stepper.js +194 -179
  100. package/dist/components/TablePicker/TablePicker.js +37 -12
  101. package/dist/components/Tabs/Tabs.js +17 -7
  102. package/dist/components/TextArea/TextArea.js +17 -7
  103. package/dist/components/TextToHtml/Cursor.d.ts +1 -1
  104. package/dist/components/TextToHtml/Cursor.js +17 -7
  105. package/dist/components/TextToHtml/TextStyles.d.ts +1 -1
  106. package/dist/components/TextToHtml/TextStyles.js +51 -44
  107. package/dist/components/TextToHtml/TextToHtml.js +37 -17
  108. package/dist/components/ThreadLog/ThreadLog.js +19 -9
  109. package/dist/components/UserCard/UserCard.js +36 -26
  110. package/dist/components/UtilAutoComplete/UtilAutoComplete.d.ts +3 -4
  111. package/dist/components/UtilAutoComplete/UtilAutoComplete.js +26 -16
  112. package/dist/components/UtilTextField/UtilTextField.d.ts +1 -1
  113. package/dist/components/UtilTextField/UtilTextField.js +26 -14
  114. package/dist/components/Zoom/Zoom.js +23 -24
  115. package/dist/fieldsRedux/createField.js +17 -7
  116. package/dist/fieldsRedux/fieldsRedux.js +19 -9
  117. package/dist/fieldsRedux/passFields.js +17 -7
  118. package/dist/reducers/index.d.ts +98 -2
  119. package/dist/utils/api.js +32 -15
  120. package/dist/utils/config.js +2 -3
  121. package/dist/utils/index.d.ts +3 -3
  122. package/dist/utils/index.js +68 -54
  123. package/dist/utils/store.js +2 -3
  124. package/lib/api/WebSocket.js +11 -12
  125. package/lib/api/index.js +14 -14
  126. package/lib/api/ws.js +48 -4
  127. package/lib/components/ArgousAvatar/ArgousAvatar.d.ts +1 -1
  128. package/lib/components/ArgousAvatar/ArgousAvatar.js +20 -54
  129. package/lib/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +1 -1
  130. package/lib/components/ArgousComplexPagination/ArgousComplexPagination.js +50 -25
  131. package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -1
  132. package/lib/components/ArgousComplexTable/ArgousComplexTable.js +15 -15
  133. package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +1 -1
  134. package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.js +121 -106
  135. package/lib/components/ArgousComplexTableBody/DragAndDrop.js +85 -0
  136. package/lib/components/ArgousComplexTableHead/ArgousComplexTableHead.js +60 -51
  137. package/lib/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +21 -12
  138. package/lib/components/ArgousInput/ArgousInput.js +2 -2
  139. package/lib/components/ArgousPagination/ArgousPagination.js +12 -4
  140. package/lib/components/ArgousProgressBar/ArgousProgressBar.js +67 -78
  141. package/lib/components/ArgousSimpleTable/ArgousSimpleTable.js +12 -18
  142. package/lib/components/AutoComplete/AutoComplete.js +2 -3
  143. package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +3 -4
  144. package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.js +174 -108
  145. package/lib/components/BarraFerramentas/BarraFerramentas.js +32 -21
  146. package/lib/components/Calendar/Calendar.js +7 -42
  147. package/lib/components/Carousel/Carousel.js +42 -27
  148. package/lib/components/CartaoUsuario/CartaoUsuario.js +6 -6
  149. package/lib/components/Collapse/Collapse.d.ts +3 -3
  150. package/lib/components/Collapse/Collapse.js +92 -57
  151. package/lib/components/Compartilhar/Compartilhar.js +47 -46
  152. package/lib/components/ConfirmModal/BasicModal.tsx +1 -1
  153. package/lib/components/ConfirmModal/WrapperModal.tsx +2 -2
  154. package/lib/components/ContactValidationInput/ContactValidationInput.d.ts +1 -1
  155. package/lib/components/ContactValidationInput/ContactValidationInput.js +248 -213
  156. package/lib/components/ContactValidationInput/SealModal.js +38 -32
  157. package/lib/components/Document/Icons.js +14 -6
  158. package/lib/components/Document/ModalVisualizacaoDocumentos.js +9 -2
  159. package/lib/components/Document/Visualizacao.js +31 -25
  160. package/lib/components/DropArea/DropArea.js +9 -3
  161. package/lib/components/Editor/ScriptLoader2.ts +3 -3
  162. package/lib/components/Editor/Utils.ts +3 -3
  163. package/lib/components/Editor/components/Editor.tsx +1 -1
  164. package/lib/components/Editor/tinymce/README.md +73 -0
  165. package/lib/components/Editor/tinymce/langs/README.md +3 -0
  166. package/lib/components/Editor/tinymce/models/dom/model.min.js +1 -1
  167. package/lib/components/Editor/tinymce/plugins/accordion/plugin.min.js +1 -1
  168. package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +1 -1
  169. package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +1 -1
  170. package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +1 -1
  171. package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +1 -1
  172. package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +1 -1
  173. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +1 -1
  174. package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +1 -1
  175. package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +1 -1
  176. package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +1 -1
  177. package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +1 -1
  178. package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +1 -1
  179. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
  180. package/lib/components/Editor/tinymce/plugins/table/plugin.js +3 -3
  181. package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +1 -1
  182. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +1 -1
  183. package/lib/components/Editor/tinymce/themes/silver/theme.js +38 -38
  184. package/lib/components/Editor/tinymce/themes/silver/theme.min.js +1 -1
  185. package/lib/components/Editor/tinymce/tinymce.js +12 -12
  186. package/lib/components/Editor/tinymce/tinymce.min.js +1 -1
  187. package/lib/components/FilePreparer/FilePreparer.d.ts +1 -1
  188. package/lib/components/FilePreparer/FilePreparer.js +112 -108
  189. package/lib/components/FileUploader/FileUploader.js +8 -7
  190. package/lib/components/FormVisualizer/FormVisualizer.d.ts +5 -7
  191. package/lib/components/FormVisualizer/FormVisualizer.js +59 -46
  192. package/lib/components/HalfGauge/HalfGauge.js +87 -85
  193. package/lib/components/Highlight/Highlight.js +4 -4
  194. package/lib/components/ImageResize/ImageResize.d.ts +1 -1
  195. package/lib/components/ImageResize/ImageResize.js +123 -118
  196. package/lib/components/ImageResizeButton/ImageResizeButton.d.ts +1 -1
  197. package/lib/components/ImageResizeButton/ImageResizeButton.js +1 -1
  198. package/lib/components/Input/Input.js +2 -2
  199. package/lib/components/InputTags/InputTags.js +6 -7
  200. package/lib/components/MaterialButton/MaterialButton.d.ts +2 -4
  201. package/lib/components/MaterialButton/MaterialButton.js +50 -125
  202. package/lib/components/MonthPicker/MonthPicker.js +2 -2
  203. package/lib/components/OtpInput/OtpInput.tsx +77 -69
  204. package/lib/components/PercentageDisplay/PercentageDisplay.d.ts +1 -1
  205. package/lib/components/PercentageDisplay/PercentageDisplay.js +29 -54
  206. package/lib/components/Programa/PageCodeEasterEgg.js +41 -40
  207. package/lib/components/Programa/Programa.d.ts +2 -2
  208. package/lib/components/Programa/Programa.js +21 -5
  209. package/lib/components/Programa/Tab.ts +4 -2
  210. package/lib/components/Programa/TabNavigationRail.js +9 -31
  211. package/lib/components/Stepper/Stepper.d.ts +1 -1
  212. package/lib/components/Stepper/Stepper.js +222 -190
  213. package/lib/components/TablePicker/TablePicker.js +11 -6
  214. package/lib/components/TextToHtml/TextStyles.js +42 -42
  215. package/lib/components/TextToHtml/TextToHtml.js +102 -92
  216. package/lib/components/ThreadLog/ThreadLog.js +1 -1
  217. package/lib/components/UserCard/UserCard.js +6 -6
  218. package/lib/components/UtilAutoComplete/UtilAutoComplete.d.ts +3 -4
  219. package/lib/components/UtilAutoComplete/UtilAutoComplete.js +67 -9
  220. package/lib/components/UtilTextField/UtilTextField.d.ts +1 -1
  221. package/lib/components/UtilTextField/UtilTextField.js +18 -16
  222. package/lib/components/Zoom/Zoom.js +6 -3
  223. package/lib/utils/api.ts +1 -1
  224. package/lib/utils/index.ts +10 -8
  225. package/package.json +56 -56
  226. package/.gitlab-ci.yml +0 -21
@@ -1,4 +1,4 @@
1
- import { ChipProps, TextFieldProps } from '@material-ui/core';
1
+ import { ChipProps, TextFieldProps } from '@mui/material';
2
2
  import * as React from 'react';
3
3
 
4
4
  export interface FilePreparerRef {
@@ -1,117 +1,117 @@
1
1
  import { prepareFile } from '../../api';
2
2
  import { setError } from '../../utils/api';
3
- import { Chip, CircularProgress, FilledInput, IconButton, makeStyles, TextField } from '@material-ui/core';
4
- import { useAutocomplete } from '@material-ui/lab';
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 useStyles = makeStyles(_theme => ({
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
- '$hasPopupIcon &, $hasClearIcon &': {
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
- '& $input': {
35
+ [`& .${classes.input}`]: {
30
36
  padding: 4,
31
37
  },
32
- '& $input:first-child': {
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
- '$hasClearIcon &': {
40
- paddingRight: 52 + 4 + 9,
41
- },
42
- '& $input': {
45
+ [`& .${classes.input}`]: {
43
46
  padding: '9.5px 4px',
44
47
  },
45
- '& $input:first-child': {
48
+ [`& .${classes.input}:first-child`]: {
46
49
  paddingLeft: 6,
47
50
  },
48
- '& $endAdornment': {
51
+ [`& .${classes.endAdornment}`]: {
49
52
  right: 9,
50
53
  },
51
54
  },
52
- '&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]': {
55
+ '&[class*="MuiOutlinedInput-root"][class*="MuiInputBase-sizeSmall"]': {
53
56
  padding: 6,
54
- '& $input': {
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
- clearIndicatorDirty: {},
73
- root: {
75
+ [`.${classes.root}`]: {
74
76
  display: 'flex',
75
77
  flexGrow: 1,
76
- '&$focused $clearIndicatorDirty': {
78
+ [`& .${classes.clearIndicatorDirty}`]: {
77
79
  visibility: 'visible',
78
80
  },
79
81
  '@media (pointer: fine)': {
80
- '&:hover $clearIndicatorDirty': {
82
+ [`&:hover .${classes.clearIndicatorDirty}`]: {
81
83
  visibility: 'visible',
82
84
  },
83
85
  },
84
86
  },
85
- loading: {},
86
- endAdornment: {
87
+ [`.${classes.endAdornment}`]: {
87
88
  position: 'absolute',
88
- right: 0,
89
+ right: 0,
89
90
  top: 'calc(50% - 24px)',
90
- '$loading &': {
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
- getTagProps,
159
- setAnchorEl,
160
- focusedTag,
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
- InputProps={{
197
- readOnly: true,
198
- startAdornment: files.length > 0 ?
199
- files.map((option, index) => editando === index ? (
200
- <FilledInput className={classes.rename} defaultValue={option.name} autoFocus onBlur={handleRename} multiline disableUnderline/>
201
- ) : (
202
- <Chip
203
- className={clsx(classes.tag)}
204
- label={option.name}
205
- onClick={handleEditing(index)}
206
- clickable
207
- {...{ disabled, ...ChipProps }}
208
- {...getTagProps({ index })}
209
- />
210
- )) : undefined,
211
- className: classes.inputRoot,
212
- endAdornment: <div className={classes.endAdornment}>
213
- {loading ? <CircularProgress disableShrink size={24}/> : <>
214
- <IconButton
215
- disabled={disabled}
216
- {...getClearProps()}
217
- className={clsx(classes.clearIndicator, {
218
- [classes.clearIndicatorDirty]: dirty,
219
- })}
220
- >
221
- <MdClear/>
222
- </IconButton>
223
- <IconButton
224
- disabled={disabled}
225
- onClick={e => {
226
- e.stopPropagation();
227
- inputRef.current.click();
228
- }}>
229
- <MdAttachment />
230
- </IconButton>
231
- </> }
232
- </div>
233
- }}
234
- inputProps={{
235
- className: clsx(classes.input, {
236
- [classes.inputFocused]: focusedTag === -1,
237
- }), disabled, ...getInputProps()
238
- }}
239
- {...TextFieldProps}/>
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 { withStyles, CircularProgress, LinearProgress } from '@material-ui/core';
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 = withStyles({
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
- barColorPrimary: {
109
+ '& .MuiLinearProgress-bar': {
109
110
  backgroundColor: '#009C6A',
110
111
  },
111
- })(LinearProgress);
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-ui/core';
2
- import { ClassNameMap } from '@material-ui/core/styles/withStyles';
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 KeyboardDatePickerProps {
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: ClassNameMap,
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 MomentUtils from '@date-io/moment';
5
- import { makeStyles, Grid, Paper, Card, Typography, TextField, FormLabel, FormGroup, FormControlLabel, Checkbox, RadioGroup, Radio, Dialog, DialogTitle, DialogContent, DialogActions, InputAdornment, IconButton } from '@material-ui/core';
6
- import Autocomplete from '@material-ui/lab/Autocomplete';
7
- import { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
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 = makeStyles(json.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 item key={l} xs={span} className={classes[className]} style={style}>
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={`${classes.textArea} mostraSpinner ${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
- <MuiPickersUtilsProvider utils={MomentUtils}>
147
- <KeyboardDatePicker
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
- value={state || null}
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
- </MuiPickersUtilsProvider>
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 item xs={12} style={{ ...style, display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: 5, }} {...{ className }}>
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 item xs={12} style={{ ...style, display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: 5, }} {...{ className }}>
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 item xs={12} sm={6} md={4} lg={2} xl={1}>
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
+ };