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 { ClickAwayListener, IconButton, makeStyles } from '@material-ui/core';
1
+ import { Box, ClickAwayListener, IconButton } from '@mui/material';
2
2
  import React, { useState } from 'react';
3
3
  import { RgbaColorPicker } from 'react-colorful';
4
4
  import { RiAlignCenter, RiAlignJustify, RiAlignLeft, RiAlignRight, RiFontColor, RiFontSize } from 'react-icons/ri';
@@ -7,37 +7,38 @@ import { RiAlignCenter, RiAlignJustify, RiAlignLeft, RiAlignRight, RiFontColor,
7
7
  const ICON_SIZE = '2.5rem';
8
8
  const BOX_SHADOW = 'rgba(0, 0, 0, 0.3) 0px 1px 12px -2px';
9
9
 
10
- const useStyles = makeStyles(theme => ({
11
- container: {
12
- zIndex: 1,
13
- position: 'absolute',
14
- top: 0,
15
- right: 0,
16
- display: 'flex',
17
- alignItems: 'flex-start',
18
- justifyContent: 'flex-end',
19
- gap: ({ defaultSpacing }) => (defaultSpacing) ? defaultSpacing : ''
20
- },
21
- button: {
22
- padding: ({ defaultSpacing }) => (defaultSpacing) ? (defaultSpacing / 2) : '',
23
- color: `rgba(${(theme.palette.type === 'light') ? '0, 0, 0' : '255, 255, 255'}, .7)`,
24
- backgroundColor: `rgba(${(theme.palette.type === 'light') ? '255, 255, 255' : '0, 0, 0'}, .5)`,
25
- '&:hover': {
26
- backgroundColor: `rgba(${(theme.palette.type === 'light') ? '255, 255, 255' : '0, 0, 0'}, .7)`
27
- }
28
- },
29
- colorPickerContainer: {
30
- zIndex: 2,
31
- position: 'absolute',
32
- padding: '2rem'
33
- },
34
- colorPickerBoxShadow: {
35
- borderRadius: 8,
36
- webKitBoxShadow: BOX_SHADOW,
37
- mozBoxShadow: BOX_SHADOW,
38
- boxShadow: BOX_SHADOW
10
+ const containerSx = ({ defaultSpacing }) => ({
11
+ zIndex: 1,
12
+ position: 'absolute',
13
+ top: 0,
14
+ right: 0,
15
+ display: 'flex',
16
+ alignItems: 'flex-start',
17
+ justifyContent: 'flex-end',
18
+ gap: defaultSpacing ? defaultSpacing : ''
19
+ });
20
+
21
+ const buttonSx = ({ defaultSpacing }) => theme => ({
22
+ padding: defaultSpacing ? defaultSpacing / 2 : '',
23
+ color: `rgba(${theme.palette.mode === 'light' ? '0, 0, 0' : '255, 255, 255'}, .7)`,
24
+ backgroundColor: `rgba(${theme.palette.mode === 'light' ? '255, 255, 255' : '0, 0, 0'}, .5)`,
25
+ '&:hover': {
26
+ backgroundColor: `rgba(${theme.palette.mode === 'light' ? '255, 255, 255' : '0, 0, 0'}, .7)`
39
27
  }
40
- }));
28
+ });
29
+
30
+ const colorPickerContainerSx = {
31
+ zIndex: 2,
32
+ position: 'absolute',
33
+ padding: '2rem'
34
+ };
35
+
36
+ const colorPickerBoxShadowSx = {
37
+ borderRadius: 8,
38
+ webKitBoxShadow: BOX_SHADOW,
39
+ mozBoxShadow: BOX_SHADOW,
40
+ boxShadow: BOX_SHADOW
41
+ };
41
42
 
42
43
 
43
44
  const initialStateOpen = {
@@ -51,7 +52,6 @@ const initialState = {
51
52
 
52
53
  const TextStyles = ({ color, setColor, defaultSpacing, toggleClickAway, handleFontSizeChange, textAlign, handleTextAlignChange }) => {
53
54
 
54
- const classes = useStyles({ defaultSpacing });
55
55
  const [state, setState] = useState(initialState);
56
56
  const { open } = state;
57
57
 
@@ -72,8 +72,8 @@ const TextStyles = ({ color, setColor, defaultSpacing, toggleClickAway, handleFo
72
72
  };
73
73
 
74
74
 
75
- return <div className={classes.container}>
76
- <IconButton onClick={handleTextAlignChange} onTouchStart={handleTextAlignChange} className={classes.button}>
75
+ return <Box sx={containerSx({ defaultSpacing })}>
76
+ <IconButton onClick={handleTextAlignChange} onTouchStart={handleTextAlignChange} sx={buttonSx({ defaultSpacing })}>
77
77
  {(() => {
78
78
  switch (textAlign) {
79
79
  case 'start':
@@ -89,23 +89,23 @@ const TextStyles = ({ color, setColor, defaultSpacing, toggleClickAway, handleFo
89
89
  }
90
90
  })()}
91
91
  </IconButton>
92
- <IconButton onClick={handleColorPickerOpen} onTouchStart={handleColorPickerOpen} className={classes.button}>
92
+ <IconButton onClick={handleColorPickerOpen} onTouchStart={handleColorPickerOpen} sx={buttonSx({ defaultSpacing })}>
93
93
  <RiFontColor size={ICON_SIZE} />
94
94
  </IconButton>
95
- <IconButton onClick={handleFontSizeChange} onTouchStart={handleFontSizeChange} className={classes.button}>
95
+ <IconButton onClick={handleFontSizeChange} onTouchStart={handleFontSizeChange} sx={buttonSx({ defaultSpacing })}>
96
96
  <RiFontSize size={ICON_SIZE} />
97
97
  </IconButton>
98
98
  {(!!open.colorPicker) && (
99
99
  <ClickAwayListener disableReactTree onClickAway={handleColorPickerClose}>
100
- <div className={classes.colorPickerContainer}>
101
- <div className={classes.colorPickerBoxShadow}>
100
+ <Box sx={colorPickerContainerSx}>
101
+ <Box sx={colorPickerBoxShadowSx}>
102
102
  <RgbaColorPicker color={color} onChange={setColor} />
103
- </div>
104
- </div>
103
+ </Box>
104
+ </Box>
105
105
  </ClickAwayListener>
106
106
  )}
107
- </div>;
107
+ </Box>;
108
108
  };
109
109
 
110
110
 
111
- export default TextStyles;
111
+ export default TextStyles;
@@ -1,15 +1,15 @@
1
1
  import Cursor from './Cursor';
2
2
  import TextStyles from './TextStyles';
3
3
  import { translateKey } from './utils';
4
- import { ClickAwayListener } from '@material-ui/core';
4
+ import { ClickAwayListener } from '@mui/material';
5
5
  import { isEqual } from 'lodash';
6
6
  import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
7
7
  import './style.css';
8
8
 
9
9
 
10
- const resizeStyle = {
11
- resize: 'both',
12
- overflow: 'auto'
10
+ const resizeStyle = {
11
+ resize: 'both',
12
+ overflow: 'auto'
13
13
  };
14
14
 
15
15
 
@@ -18,43 +18,43 @@ const TEXT_TO_HTML_CURSOR_ID = 'text-to-html-cursor';
18
18
  const TEXT_TO_HTML_TEXT_CONTAINER_ID = 'text-to-html-text-container';
19
19
 
20
20
 
21
- export const initialStateCharacter = {
22
- key: undefined,
23
- keyCode: undefined,
24
- code: undefined,
25
- string: '',
26
- dead: false,
27
- shift: false,
28
- mark: []
21
+ export const initialStateCharacter = {
22
+ key: undefined,
23
+ keyCode: undefined,
24
+ code: undefined,
25
+ string: '',
26
+ dead: false,
27
+ shift: false,
28
+ mark: []
29
29
  };
30
30
 
31
31
  export const initialStateCursor = { ...initialStateCharacter, string: 'cursor' };
32
32
 
33
33
  export const textToHtmlInitialValue = { text: '', cssText: '', markedPeople: [], characters: [] };
34
34
 
35
- const initialStateMove = {
36
- isDown: false,
37
- offset: []
35
+ const initialStateMove = {
36
+ isDown: false,
37
+ offset: []
38
38
  };
39
39
 
40
40
  const initialStateKeyboardRef = { altGraph: false };
41
41
 
42
- const initialStateTextStyle = {
43
- color: { r: 255, g: 255, b: 255, a: 1 },
44
- textAlign: 'center',
45
- fontSize: 2,
46
- fontFamily: 'Roboto, Helvetica, Arial, sans-serif',
47
- letterSpacing: '0.01em'
42
+ const initialStateTextStyle = {
43
+ color: { r: 255, g: 255, b: 255, a: 1 },
44
+ textAlign: 'center',
45
+ fontSize: 2,
46
+ fontFamily: 'Roboto, Helvetica, Arial, sans-serif',
47
+ letterSpacing: '0.01em'
48
48
  };
49
49
 
50
- const initialState = {
51
- textStyle: initialStateTextStyle,
52
- createCursorClick: false,
53
- clickAway: undefined,
54
- tap: 0,
55
- resize: false,
56
- move: initialStateMove,
57
- characters: []
50
+ const initialState = {
51
+ textStyle: initialStateTextStyle,
52
+ createCursorClick: false,
53
+ clickAway: undefined,
54
+ tap: 0,
55
+ resize: false,
56
+ move: initialStateMove,
57
+ characters: []
58
58
  };
59
59
 
60
60
 
@@ -64,17 +64,17 @@ const TextToHtml = ({ initialValue = textToHtmlInitialValue, onChange, onDelete,
64
64
  const [state, setState] = useState(initialState);
65
65
  const { createCursorClick, characters, move, resize, tap, textStyle } = state;
66
66
  const { color, fontSize, fontFamily, textAlign, letterSpacing } = textStyle;
67
- const propsRef = useRef({
68
- onChange
67
+ const propsRef = useRef({
68
+ onChange
69
69
  });
70
70
 
71
71
  const cursor = characters.findIndex(({ string }) => (string === 'cursor'));
72
72
  const canWrite = (cursor > -1);
73
73
 
74
74
 
75
- const logicSetState = ({ type, field, value }) => setState(values => ({
76
- ...values,
77
- [type]: (type && field) ? { ...values[type], [field]: value } : value
75
+ const logicSetState = ({ type, field, value }) => setState(values => ({
76
+ ...values,
77
+ [type]: (type && field) ? { ...values[type], [field]: value } : value
78
78
  }));
79
79
 
80
80
 
@@ -158,7 +158,9 @@ const TextToHtml = ({ initialValue = textToHtmlInitialValue, onChange, onDelete,
158
158
  (initialValue.cssText) && setStyleFromInitialValue(initialValue.cssText);
159
159
  (initialValue.characters) && setCharacters(initialValue.characters);
160
160
  }, [setCharacters]);
161
- useEffect(() => loadInitialValue(initialValue), [initialValue, loadInitialValue]);
161
+ useEffect(() => {
162
+ loadInitialValue(initialValue);
163
+ }, [initialValue, loadInitialValue]);
162
164
 
163
165
  const handleKeyDown = (e) => {
164
166
 
@@ -216,14 +218,14 @@ const TextToHtml = ({ initialValue = textToHtmlInitialValue, onChange, onDelete,
216
218
  else {
217
219
  const { string, before } = translateKey({ key, keyCode, code, shift, altGraph: keyboardRef.current.altGraph, capsLock, before: characterBeforeCursor });
218
220
  if (string) {
219
- newCharacter = {
220
- ...initialStateCharacter,
221
- key,
222
- keyCode,
223
- code,
224
- string,
225
- dead: before.dead,
226
- shift
221
+ newCharacter = {
222
+ ...initialStateCharacter,
223
+ key,
224
+ keyCode,
225
+ code,
226
+ string,
227
+ dead: before.dead,
228
+ shift
227
229
  };
228
230
 
229
231
  newCharacters.splice(cursor, 0, newCharacter);
@@ -265,16 +267,16 @@ const TextToHtml = ({ initialValue = textToHtmlInitialValue, onChange, onDelete,
265
267
  if (!element) return;
266
268
  const clientX = (e.clientX || e.touches[0].clientX);
267
269
  const clientY = (e.clientY || e.touches[0].clientY);
268
- logicSetState({
269
- type: 'move',
270
- value: {
271
- ...move,
272
- isDown: true,
270
+ logicSetState({
271
+ type: 'move',
272
+ value: {
273
+ ...move,
274
+ isDown: true,
273
275
  offset: [
274
- element.offsetLeft - clientX,
276
+ element.offsetLeft - clientX,
275
277
  element.offsetTop - clientY
276
278
  ]
277
- }
279
+ }
278
280
  });
279
281
  };
280
282
 
@@ -351,7 +353,9 @@ const TextToHtml = ({ initialValue = textToHtmlInitialValue, onChange, onDelete,
351
353
  }
352
354
  }
353
355
  }, []);
354
- useEffect(() => changeStyles({ resize }), [resize, changeStyles]);
356
+ useEffect(() => {
357
+ changeStyles({ resize });
358
+ }, [resize, changeStyles]);
355
359
 
356
360
  const createHtmlString = useCallback(() => {
357
361
  const element = document.getElementById(TEXT_TO_HTML_ID);
@@ -370,55 +374,61 @@ const TextToHtml = ({ initialValue = textToHtmlInitialValue, onChange, onDelete,
370
374
  return { htmlString };
371
375
  }
372
376
  }, [characters, ref]);
373
- useEffect(() => createHtmlString(), [characters, createHtmlString]);
374
-
375
-
376
- useEffect(() => ref.current = {
377
- ...ref.current,
378
- ...state,
379
- clickAway,
380
- focusToWrite,
381
- createCursor,
382
- setCharacters,
383
- createHtmlString,
384
- setExternalValues
377
+ useEffect(() => {
378
+ createHtmlString();
379
+ }, [characters, createHtmlString]);
380
+
381
+
382
+ useEffect(() => {
383
+ ref.current = {
384
+ ...ref.current,
385
+ ...state,
386
+ clickAway,
387
+ focusToWrite,
388
+ createCursor,
389
+ setCharacters,
390
+ createHtmlString,
391
+ setExternalValues
392
+ };
385
393
  }, [ref, state, setCharacters, createCursor, createHtmlString, clickAway, setExternalValues]);
386
394
 
387
395
  const updateExternalValues = ({ state, setExternalValues }) => {
388
396
  setExternalValues && setExternalValues(state);
389
397
  };
390
- useEffect(() => updateExternalValues({ state, setExternalValues }), [state, setExternalValues]);
398
+ useEffect(() => {
399
+ updateExternalValues({ state, setExternalValues });
400
+ }, [state, setExternalValues]);
391
401
 
392
402
 
393
403
  return <div className='text-to-html-container'>
394
404
  {(canWrite) && (
395
- <TextStyles
396
- setColor={value => logicSetState({ type: 'textStyle', field: 'color', value })}
397
- {...{ color, defaultSpacing, toggleClickAway, handleFontSizeChange, textAlign, handleTextAlignChange }}
405
+ <TextStyles
406
+ setColor={value => logicSetState({ type: 'textStyle', field: 'color', value })}
407
+ {...{ color, defaultSpacing, toggleClickAway, handleFontSizeChange, textAlign, handleTextAlignChange }}
398
408
  />
399
409
  )}
400
410
  <div id={TEXT_TO_HTML_TEXT_CONTAINER_ID} onClick={handleContainerClick} className='text-to-html-text-container'>
401
411
  <ClickAwayListener mouseEvent={state.clickAway} touchEvent={state.clickAway} disableReactTree onClickAway={handleClickAway}>
402
- <div
403
- id={TEXT_TO_HTML_ID}
404
- tabIndex={0}
405
- onKeyDown={handleKeyDown}
406
- onKeyUp={handleKeyUp}
407
- onMouseDown={handleMouseDownTouchStart}
408
- onMouseUp={handleMouseUpTouchEnd}
409
- onMouseMove={handleMouseTouchMove}
410
- onTouchStart={handleMouseDownTouchStart}
411
- onTouchEnd={handleMouseUpTouchEnd}
412
- onTouchMove={handleMouseTouchMove}
413
- onClick={handleClick}
414
- onDoubleClick={handleDoubleClick}
415
- style={{
416
- color: (color) ? `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})` : 'inherit',
417
- textAlign: (textAlign) ? textAlign : 'inherit',
418
- fontSize: (fontSize) ? `${fontSize}rem` : '1rem',
419
- fontFamily: (fontFamily) ? fontFamily : 'inherit',
420
- letterSpacing: (letterSpacing) ? letterSpacing : 'inherit'
421
- }}
412
+ <div
413
+ id={TEXT_TO_HTML_ID}
414
+ tabIndex={0}
415
+ onKeyDown={handleKeyDown}
416
+ onKeyUp={handleKeyUp}
417
+ onMouseDown={handleMouseDownTouchStart}
418
+ onMouseUp={handleMouseUpTouchEnd}
419
+ onMouseMove={handleMouseTouchMove}
420
+ onTouchStart={handleMouseDownTouchStart}
421
+ onTouchEnd={handleMouseUpTouchEnd}
422
+ onTouchMove={handleMouseTouchMove}
423
+ onClick={handleClick}
424
+ onDoubleClick={handleDoubleClick}
425
+ style={{
426
+ color: (color) ? `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})` : 'inherit',
427
+ textAlign: (textAlign) ? textAlign : 'inherit',
428
+ fontSize: (fontSize) ? `${fontSize}rem` : '1rem',
429
+ fontFamily: (fontFamily) ? fontFamily : 'inherit',
430
+ letterSpacing: (letterSpacing) ? letterSpacing : 'inherit'
431
+ }}
422
432
  className='text-to-html'
423
433
  >
424
434
  <p>
@@ -428,10 +438,10 @@ const TextToHtml = ({ initialValue = textToHtmlInitialValue, onChange, onDelete,
428
438
  return <Cursor key={`${stringIndex}-${string}`} id={TEXT_TO_HTML_CURSOR_ID} className='text-to-html-cursor' />;
429
439
  default:
430
440
  return (string) ? (
431
- <span
432
- key={`${stringIndex}-${string}`}
433
- style={{
434
- textDecoration: (dead || mark?.length) ? 'underline' : ''
441
+ <span
442
+ key={`${stringIndex}-${string}`}
443
+ style={{
444
+ textDecoration: (dead || mark?.length) ? 'underline' : ''
435
445
  }}
436
446
  >
437
447
  {string}
@@ -447,4 +457,4 @@ const TextToHtml = ({ initialValue = textToHtmlInitialValue, onChange, onDelete,
447
457
  };
448
458
 
449
459
 
450
- export default forwardRef(TextToHtml);
460
+ export default forwardRef(TextToHtml);
@@ -4,7 +4,7 @@ import SimpleTable from '../../components/SimpleTable';
4
4
  import { setField } from '../../fieldsRedux';
5
5
  import { getConfig } from '../../utils/config';
6
6
  import { sqlDateToReadableDate } from '../../utils/date';
7
- import { IconButton } from '@material-ui/core';
7
+ import { IconButton } from '@mui/material';
8
8
  import PropTypes from 'prop-types';
9
9
  import React, { Component } from 'react';
10
10
  import { FaAngleLeft, FaPrint } from 'react-icons/fa';
@@ -2,7 +2,7 @@ import { ArgousAvatar } from '../';
2
2
  import { setAnotherProgramField } from '../../fieldsRedux';
3
3
  import { useStore } from '../../utils';
4
4
  import { serverAction } from '../../utils/api';
5
- import { Card, Typography, Grid, Button, Portal, Popper } from '@material-ui/core';
5
+ import { Card, Typography, Grid, Button, Portal, Popper } from '@mui/material';
6
6
  import React, { useState, useEffect, useRef, useCallback } from 'react';
7
7
  import { IoIosCall } from 'react-icons/io';
8
8
  import { MdMail, MdMessage } from 'react-icons/md';
@@ -100,10 +100,10 @@ function UserCard({ anchor, userId }) {
100
100
  >
101
101
  <Card variant='outlined' style={{ padding: '10px', maxWidth: '350px' }}>
102
102
  <Grid container spacing={1}>
103
- <Grid item xs='auto'>
103
+ <Grid size='auto'>
104
104
  <ArgousAvatar style={{ width: '50px', height: '50px', margin: '10px' }} nome={data.dsNomeUsuario} idUsuario={userId || local.userId} />
105
105
  </Grid>
106
- <Grid item xs='auto'>
106
+ <Grid size='auto'>
107
107
  <Typography variant='h6' style={{ overflow: 'hidden', width: '250px', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{data.dsNomeUsuario}</Typography>
108
108
  <Typography variant='body2' style={{ width: '250px' }}>{data.dsFuncaoUsuario}</Typography>
109
109
  <Typography variant='caption' style={{ width: '250px' }}>{data.dsSetor}</Typography>
@@ -112,14 +112,14 @@ function UserCard({ anchor, userId }) {
112
112
  ((userId && (loggedUserId !== userId)) || (local.userId && (loggedUserId !== local.userId))) && (
113
113
  <React.Fragment>
114
114
  {(data.nrRamalUsuario) && (
115
- <Grid item xs>
115
+ <Grid size='grow'>
116
116
  <Button fullWidth variant='contained' href={`tel: ${data.nrRamalUsuario}`} title={`Ramal: ${data.nrRamalUsuario}`}><IoIosCall/>&nbsp;{data.nrRamalUsuario}</Button>
117
117
  </Grid>
118
118
  )}
119
- <Grid item xs>
119
+ <Grid size='grow'>
120
120
  <Button fullWidth variant='contained' href={`mailto: ${data.dsEmailUsuario}`} title={data.dsEmailUsuario}><MdMail/>&nbsp;Email</Button>
121
121
  </Grid>
122
- <Grid item xs>
122
+ <Grid size='grow'>
123
123
  <Button fullWidth variant='contained' onClick={() => setAnotherProgramField('janelaChatOpen', returnUser(), 'argousSystem')} title='Abrir chat de conversa'><MdMessage/>&nbsp;Mensagem</Button>
124
124
  </Grid>
125
125
  </React.Fragment>
@@ -1,8 +1,7 @@
1
- import { TextFieldProps } from '@material-ui/core';
2
- import { AutocompleteProps, AutocompleteChangeDetails } from '@material-ui/lab';
1
+ import { TextFieldProps, AutocompleteProps, AutocompleteChangeDetails } from '@mui/material';
3
2
  import * as React from 'react';
4
3
 
5
- export interface UtilAutoCompleteProps extends Omit<AutocompleteProps<any, false, false, false>, 'getOptionLabel'>{
4
+ export interface UtilAutoCompleteProps extends Omit<AutocompleteProps<any, false, false, false>, 'getOptionLabel' | 'onChange'>{
6
5
  /**
7
6
  * Tipo de autocomplete
8
7
  */
@@ -94,4 +93,4 @@ export interface UtilAutoCompleteProps extends Omit<AutocompleteProps<any, false
94
93
 
95
94
  declare function UtilAutoComplete(props: UtilAutoCompleteProps): JSX.Element
96
95
 
97
- export default UtilAutoComplete;
96
+ export default UtilAutoComplete;
@@ -1,7 +1,6 @@
1
1
  import { formataNome } from '../../utils';
2
2
  import { serverAction } from '../../utils/api';
3
- import { TextField } from '@material-ui/core';
4
- import { Autocomplete } from '@material-ui/lab';
3
+ import { TextField, Autocomplete } from '@mui/material';
5
4
  import { isArray, isObject, isString } from 'lodash';
6
5
  import React, { useState, useEffect, useCallback } from 'react';
7
6
  // import PropTypes from 'prop-types';
@@ -69,10 +68,48 @@ const retornaType = type => {
69
68
  }
70
69
  };
71
70
 
72
- const UtilAutoComplete = ({ type = '', label, value, textFieldProps = {}, onChange = e => e, excluidos, idEmpresa, cdEstado, cdUnimed, getOptionLabel, pgCode = 'BuscasHelper', action, busca, resposta, searchParams, filterFunction, forceUpdate, readOnly, ...props }) => {
71
+ const UtilAutoComplete = ({
72
+ type = '',
73
+ label,
74
+ value,
75
+ textFieldProps = {},
76
+ onChange = e => e,
77
+ excluidos,
78
+ idEmpresa,
79
+ cdEstado,
80
+ cdUnimed,
81
+ getOptionLabel,
82
+ pgCode = 'BuscasHelper',
83
+ action,
84
+ busca,
85
+ resposta,
86
+ searchParams,
87
+ filterFunction,
88
+ forceUpdate,
89
+ readOnly,
90
+ ListboxComponent,
91
+ ListboxProps,
92
+ PaperComponent,
93
+ PopperComponent,
94
+ ChipProps,
95
+ renderTags,
96
+ renderValue,
97
+ slots = {},
98
+ slotProps = {},
99
+ ...props
100
+ }) => {
73
101
  const [open, setOpen] = useState(false);
74
102
  const [lista, setLista] = useState([]);
75
103
  const [inputValue, setInputValue] = useState('');
104
+ const {
105
+ FormHelperTextProps,
106
+ InputLabelProps,
107
+ InputProps,
108
+ inputProps,
109
+ SelectProps,
110
+ slotProps: textFieldSlotProps = {},
111
+ ...resolvedTextFieldProps
112
+ } = textFieldProps;
76
113
 
77
114
  const buscar = useCallback(async valor => {
78
115
  const res = await serverAction(action || retornaType(type).action, { [busca || retornaType(type)?.busca || 'value']: valor || inputValue, excluidos, idEmpresa, cdEstado, cdUnimed, ...searchParams }, true, pgCode);
@@ -97,7 +134,7 @@ const UtilAutoComplete = ({ type = '', label, value, textFieldProps = {}, onChan
97
134
  onClose={() => setOpen(false)}
98
135
  disableClearable={readOnly}
99
136
  options={isObject(value) ? lista.filter(v => filterFunction ? filterFunction(v, value) : true || v[0] !== value[0]) : lista}
100
- getOptionSelected={(o, v) => o[0] === v}
137
+ isOptionEqualToValue={(o, v) => o[0] === (isArray(v) ? v[0] : v)}
101
138
  getOptionLabel={getOptionLabel ? (option => getOptionLabel(option, lista)) : (option => retornaType(type).getLabel(option, lista)) }
102
139
  noOptionsText={inputValue.length < 2 ? 'Digite para pesquisar' : 'Não Encontrado'}
103
140
  clearText='Limpar'
@@ -108,16 +145,37 @@ const UtilAutoComplete = ({ type = '', label, value, textFieldProps = {}, onChan
108
145
  autoHighlight
109
146
  {...{ value, onChange }}
110
147
  {...props}
148
+ renderValue={renderValue || renderTags}
149
+ slots={{
150
+ ...(PaperComponent ? { paper: PaperComponent } : {}),
151
+ ...(PopperComponent ? { popper: PopperComponent } : {}),
152
+ ...slots
153
+ }}
154
+ slotProps={{
155
+ ...slotProps,
156
+ chip: { ...ChipProps, ...slotProps.chip },
157
+ listbox: {
158
+ ...(ListboxComponent ? { component: ListboxComponent } : {}),
159
+ ...ListboxProps,
160
+ ...slotProps.listbox
161
+ }
162
+ }}
111
163
  renderInput={params => (
112
164
  <TextField
113
165
  margin='dense'
114
166
  variant='outlined'
115
167
  label={label || retornaType(type).label}
116
168
  {...params}
117
- {...textFieldProps}
118
- InputProps={{ ...textFieldProps.InputProps, ...params.InputProps }}
119
- inputProps={{ ...textFieldProps.inputProps, ...params.inputProps, readOnly }}
120
- />
169
+ {...resolvedTextFieldProps}
170
+ slotProps={{
171
+ ...textFieldSlotProps,
172
+ ...params.slotProps,
173
+ formHelperText: { ...FormHelperTextProps, ...textFieldSlotProps.formHelperText, ...params.slotProps.formHelperText },
174
+ input: { ...InputProps, ...textFieldSlotProps.input, ...params.slotProps.input },
175
+ inputLabel: { ...InputLabelProps, ...textFieldSlotProps.inputLabel, ...params.slotProps.inputLabel },
176
+ htmlInput: { ...inputProps, ...textFieldSlotProps.htmlInput, ...params.slotProps.htmlInput, readOnly },
177
+ select: { ...SelectProps, ...textFieldSlotProps.select, ...params.slotProps.select }
178
+ }} />
121
179
  )}
122
180
  />
123
181
  );
@@ -135,4 +193,4 @@ const UtilAutoComplete = ({ type = '', label, value, textFieldProps = {}, onChan
135
193
  // getOptionLabel: PropTypes.func
136
194
  // }
137
195
 
138
- export default UtilAutoComplete;
196
+ export default UtilAutoComplete;
@@ -1,4 +1,4 @@
1
- import { BaseTextFieldProps } from '@material-ui/core';
1
+ import { BaseTextFieldProps } from '@mui/material';
2
2
  import * as React from 'react';
3
3
 
4
4