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,5 +1,4 @@
1
- import { makeStyles } from '@material-ui/core';
2
- import clsx from 'clsx';
1
+ import { Box } from '@mui/material';
3
2
  import { isNumber } from 'lodash';
4
3
  import React, { useCallback, useEffect, useMemo } from 'react';
5
4
 
@@ -9,74 +8,6 @@ const ELLIPSIS_TEXT_STYLE = {
9
8
  textOverflow: 'ellipsis'
10
9
  };
11
10
 
12
- const useStyles = makeStyles({
13
- container: {
14
- display: 'flex',
15
- height: ({ size }) => `${size / 2}px`,
16
- transition: 'all .3s',
17
- opacity: ({ responsive }) => responsive ? 0 : 1
18
- },
19
- gauge: {
20
- height: ({ size }) => size,
21
- width: ({ size }) => size,
22
- backgroundColor: ({ barBackgroundColor }) => barBackgroundColor,
23
- borderRadius: '50%',
24
- display: 'grid',
25
- placeItems: 'center',
26
- webkitClipPath: 'polygon(0 0, 100% 0, 100% 51%, 0 51%)',
27
- clipPath: 'polygon(0 0, 100% 0, 100% 51%, 0 51%)',
28
- '&::before': {
29
- content: '""',
30
- position: 'absolute',
31
- height: ({ gaugeBarWidth }) => gaugeBarWidth,
32
- width: ({ gaugeBarWidth }) => gaugeBarWidth,
33
- borderRadius: '50%',
34
- backgroundColor: ({ backgroundColor }) => backgroundColor
35
- }
36
- },
37
- valueDiv: {
38
- position: 'absolute',
39
- color: ({ color }) => color,
40
- fontSize: ({ fontSize }) => fontSize,
41
- maxWidth: ({ size }) => `${size / 2}px`,
42
- minWidth: ({ size }) => `${size / 2}px`,
43
- maxHeight: ({ size }) => `${size / 4}px`,
44
- minHeight: ({ size }) => `${size / 4}px`,
45
- transform: ({ size }) => `translateY(-${(size / 4) / 2}px)`,
46
- display: 'flex',
47
- flexDirection: 'column',
48
- alignItems: 'center',
49
- justifyContent: 'end',
50
- overflow: 'hidden',
51
- whiteSpace: 'nowrap',
52
- padding: 4,
53
- '&>p': {
54
- ...ELLIPSIS_TEXT_STYLE,
55
- margin: 0,
56
- width: '100%',
57
- textAlign: 'center',
58
- '&:first-child': {
59
- fontWeight: 'bold'
60
- }
61
- }
62
- },
63
- minMax: {
64
- display: 'flex',
65
- alignItems: 'end',
66
- padding: '0 1rem',
67
- width: ({ minMaxWidth }) => minMaxWidth,
68
- color: ({ color }) => color,
69
- fontSize: ({ fontSize }) => fontSize,
70
- '&>p': {
71
- margin: 0
72
- }
73
- },
74
- min: {
75
- justifyContent: 'end'
76
- }
77
- });
78
-
79
-
80
11
  const getHand = (percentage, handColor) => {
81
12
  if (!isNumber(percentage)) return '';
82
13
 
@@ -128,7 +59,6 @@ const HalfGauge = ({
128
59
  }) => {
129
60
 
130
61
  const gaugeBarWidth = size - (size / 2);
131
- const classes = useStyles({ color, backgroundColor, barBackgroundColor, size, gaugeBarWidth, fontSize, minMaxWidth, responsive });
132
62
 
133
63
  const halfGaugeId = `${id}-halfGauge`;
134
64
  const halfGaugeHandId = `${id}-halfGaugeHand`;
@@ -231,37 +161,109 @@ const HalfGauge = ({
231
161
 
232
162
  setTimeout(() => makeResponsive(), 500);
233
163
  }, [halfGaugeContainerId]);
234
- useEffect(() => responsive && makeResponsive(), [responsive, makeResponsive]);
164
+ useEffect(() => {
165
+ if (responsive) makeResponsive();
166
+ }, [responsive, makeResponsive]);
235
167
 
236
168
 
237
169
  const displayContainer = useCallback(() => {
238
170
  const containerEl = document.getElementById(halfGaugeContainerId);
239
171
  if (containerEl) containerEl.style.opacity = 1;
240
172
  }, [halfGaugeContainerId]);
241
- useEffect(() => responsive && setTimeout(() => displayContainer(), 500), [responsive, displayContainer]);
173
+ useEffect(() => {
174
+ if (!responsive) return undefined;
175
+ const timeoutId = setTimeout(() => displayContainer(), 500);
176
+ return () => clearTimeout(timeoutId);
177
+ }, [responsive, displayContainer]);
242
178
 
243
179
  //____________________________________________________________________________________________________
244
180
 
245
181
 
246
- return <div id={halfGaugeContainerId} className={classes.container}>
247
- <div className={clsx(classes.minMax, classes.min)}>
182
+ const gaugeSx = {
183
+ height: size,
184
+ width: size,
185
+ backgroundColor: barBackgroundColor,
186
+ borderRadius: '50%',
187
+ display: 'grid',
188
+ placeItems: 'center',
189
+ webkitClipPath: 'polygon(0 0, 100% 0, 100% 51%, 0 51%)',
190
+ clipPath: 'polygon(0 0, 100% 0, 100% 51%, 0 51%)',
191
+ '&::before': {
192
+ content: '""',
193
+ position: 'absolute',
194
+ height: gaugeBarWidth,
195
+ width: gaugeBarWidth,
196
+ borderRadius: '50%',
197
+ backgroundColor
198
+ }
199
+ };
200
+
201
+ const minMaxSx = {
202
+ display: 'flex',
203
+ alignItems: 'end',
204
+ padding: '0 1rem',
205
+ width: minMaxWidth,
206
+ color,
207
+ fontSize,
208
+ '&>p': {
209
+ margin: 0
210
+ }
211
+ };
212
+
213
+ return <Box
214
+ id={halfGaugeContainerId}
215
+ sx={{
216
+ display: 'flex',
217
+ height: `${size / 2}px`,
218
+ transition: 'all .3s',
219
+ opacity: responsive ? 0 : 1
220
+ }}
221
+ >
222
+ <Box sx={{ ...minMaxSx, justifyContent: 'end' }}>
248
223
  <p>
249
224
  {min}
250
225
  </p>
251
- </div>
252
- <div id={halfGaugeId} className={classes.gauge}>
253
- <div id={halfGaugeHandId} className={classes.gauge} />
254
- <div className={classes.valueDiv}>
226
+ </Box>
227
+ <Box id={halfGaugeId} sx={gaugeSx}>
228
+ <Box id={halfGaugeHandId} sx={gaugeSx} />
229
+ <Box
230
+ sx={{
231
+ position: 'absolute',
232
+ color,
233
+ fontSize,
234
+ maxWidth: `${size / 2}px`,
235
+ minWidth: `${size / 2}px`,
236
+ maxHeight: `${size / 4}px`,
237
+ minHeight: `${size / 4}px`,
238
+ transform: `translateY(-${(size / 4) / 2}px)`,
239
+ display: 'flex',
240
+ flexDirection: 'column',
241
+ alignItems: 'center',
242
+ justifyContent: 'end',
243
+ overflow: 'hidden',
244
+ whiteSpace: 'nowrap',
245
+ padding: 4,
246
+ '&>p': {
247
+ ...ELLIPSIS_TEXT_STYLE,
248
+ margin: 0,
249
+ width: '100%',
250
+ textAlign: 'center',
251
+ '&:first-of-type': {
252
+ fontWeight: 'bold'
253
+ }
254
+ }
255
+ }}
256
+ >
255
257
  {percentageText && <p>{percentageText}</p>}
256
258
  {label && <p>{label}</p>}
257
- </div>
258
- </div>
259
- <div className={classes.minMax}>
259
+ </Box>
260
+ </Box>
261
+ <Box sx={minMaxSx}>
260
262
  <p>
261
263
  {max}
262
264
  </p>
263
- </div>
264
- </div>;
265
+ </Box>
266
+ </Box>;
265
267
  };
266
268
 
267
- export default HalfGauge;
269
+ export default HalfGauge;
@@ -1,12 +1,12 @@
1
1
  import highlight from 'highlight.js';
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { Component } from 'react';
4
- import { findDOMNode } from 'react-dom';
5
4
 
6
5
  class HighLight extends Component {
6
+ codeRef = React.createRef();
7
7
 
8
8
  componentDidMount () {
9
- highlight.highlightBlock(findDOMNode(this.refs.code));
9
+ highlight.highlightBlock(this.codeRef.current);
10
10
  }
11
11
 
12
12
  shouldComponentUpdate(nextProps) {
@@ -19,7 +19,7 @@ class HighLight extends Component {
19
19
 
20
20
  componentDidUpdate () {
21
21
  highlight.initHighlighting.called = false;
22
- highlight.highlightBlock(findDOMNode(this.refs.code));
22
+ highlight.highlightBlock(this.codeRef.current);
23
23
  }
24
24
 
25
25
  render () {
@@ -32,7 +32,7 @@ class HighLight extends Component {
32
32
  >
33
33
  <code
34
34
  className={language}
35
- ref='code'
35
+ ref={this.codeRef}
36
36
  >
37
37
  {children}
38
38
  </code>
@@ -1,4 +1,4 @@
1
- import { DialogProps } from '@material-ui/core';
1
+ import { DialogProps } from '@mui/material';
2
2
 
3
3
  export interface ImageResizeProps extends DialogProps {
4
4
  /**
@@ -1,74 +1,78 @@
1
1
 
2
2
  import { useUpdateEffect } from '../../utils';
3
- import { Button, Dialog, DialogTitle, DialogContent, DialogActions, makeStyles, Grid, List, ListItem, ListItemText, Slider } from '@material-ui/core';
4
- import clsx from 'clsx';
3
+ import { Box, Button, Dialog, DialogTitle, DialogContent, DialogActions, Grid, List, ListItem, ListItemText, Slider } from '@mui/material';
4
+ import { clsx } from 'clsx';
5
5
  import $ from 'jquery';
6
6
  import React, { useEffect, useRef, useState } from 'react';
7
7
  import { MdCrop } from 'react-icons/md';
8
8
 
9
- const useStyles = makeStyles(({
10
- component: {
11
- position: 'relative',
12
- background: 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAAHmWi9wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMBJREFUeNpinDFjemBgIAMaePv2zX8MwMSADdBKFCCAGF++fIEuBHQEYb3UFAIIIOwBQWzQEOvVwaMOIICwBDoWRZjRQKaNo4rorQgggBiBCVpISJiBGoCJgXpg1KxRs0aiWQABxPj79+93795SbhAwUxNVLo+G/ahZo2aNmjVq1qhZI8wsgADt1zERADAMAsD6t5B4bRHRgeGj4I8FctKPM3ObLp6fk7w1eSwsLCwsLCwsLCwsrE5WvrHdrTLF8wBDaPAHu14WwgAAAABJRU5ErkJggg==") repeat center center',
13
- padding: '4em',
14
- height: ({ height = 300 }) => `calc(${height}px + 200px)`,
15
- border: '3px solid #49708A',
16
- maxWidth: ({ width = 300 }) => `calc(${width}px + 600px)`,
17
- overflow: 'hidden',
18
- margin: '0 auto',
19
- },
20
- overlay: {
21
- position: 'absolute',
22
- left: ({ width = 300 }) => `calc(50% - ${(width - 300) / 2}px)`,
23
- top: ({ height = 300 }) => `calc(50% - ${(height - 300) / 2}px)`,
24
- marginLeft: '-150px',
25
- marginTop: '-150px',
26
- zIndex: 999,
27
- width: ({ width }) => width ?? '300px',
28
- height: ({ height }) => height ?? '300px',
29
- border: 'solid 2px rgba(222,60,80,.9)',
30
- borderRadius: ({ borderRadius }) => borderRadius ?? '50%',
31
- boxSizing: 'content-box',
32
- pointerEvents: 'none',
33
- },
34
- resizeContainer: {
35
- position: 'relative',
36
- display: 'inline-block',
37
- cursor: 'move',
38
- margin: '0 auto',
39
- '&:hover, &:active': {
40
- outline: '2px dashed rgba(222,60,80,.9)'
41
- }
42
- },
43
- resizeHandle: {
44
- position: 'absolute',
45
- display: 'block',
46
- width: '10px',
47
- height: '10px',
48
- background: 'rgba(222,60,80,.9)',
49
- zIndex: 999,
50
- },
51
- resizeHandleNw: {
9
+ const componentSx = ({ height = 300, width = 300 }) => ({
10
+ position: 'relative',
11
+ background: 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAAHmWi9wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMBJREFUeNpinDFjemBgIAMaePv2zX8MwMSADdBKFCCAGF++fIEuBHQEYb3UFAIIIOwBQWzQEOvVwaMOIICwBDoWRZjRQKaNo4rorQgggBiBCVpISJiBGoCJgXpg1KxRs0aiWQABxPj79+93795SbhAwUxNVLo+G/ahZo2aNmjVq1qhZI8wsgADt1zERADAMAsD6t5B4bRHRgeGj4I8FctKPM3ObLp6fk7w1eSwsLCwsLCwsLCwsrE5WvrHdrTLF8wBDaPAHu14WwgAAAABJRU5ErkJggg==") repeat center center',
12
+ padding: '4em',
13
+ height: `calc(${height}px + 200px)`,
14
+ border: '3px solid #49708A',
15
+ maxWidth: `calc(${width}px + 600px)`,
16
+ overflow: 'hidden',
17
+ margin: '0 auto',
18
+ });
19
+
20
+ const overlaySx = ({ width = 300, height = 300, borderRadius }) => ({
21
+ position: 'absolute',
22
+ left: `calc(50% - ${(width - 300) / 2}px)`,
23
+ top: `calc(50% - ${(height - 300) / 2}px)`,
24
+ marginLeft: '-150px',
25
+ marginTop: '-150px',
26
+ zIndex: 999,
27
+ width: width ?? '300px',
28
+ height: height ?? '300px',
29
+ border: 'solid 2px rgba(222,60,80,.9)',
30
+ borderRadius: borderRadius ?? '50%',
31
+ boxSizing: 'content-box',
32
+ pointerEvents: 'none',
33
+ });
34
+
35
+ const resizeContainerSx = {
36
+ position: 'relative',
37
+ display: 'inline-block',
38
+ cursor: 'move',
39
+ margin: '0 auto',
40
+ '&:hover, &:active': {
41
+ outline: '2px dashed rgba(222,60,80,.9)'
42
+ }
43
+ };
44
+
45
+ const resizeHandleSx = {
46
+ position: 'absolute',
47
+ display: 'block',
48
+ width: '10px',
49
+ height: '10px',
50
+ background: 'rgba(222,60,80,.9)',
51
+ zIndex: 999,
52
+ };
53
+
54
+ const resizeHandlePositionSx = {
55
+ nw: {
52
56
  top: '-5px',
53
57
  left: '-5px',
54
58
  cursor: 'nw-resize',
55
59
  },
56
- resizeHandleSw: {
60
+ sw: {
57
61
  bottom: '-5px',
58
62
  left: '-5px',
59
63
  cursor: 'sw-resize',
60
64
  },
61
- resizeHandleNe: {
65
+ ne: {
62
66
  top: '-5px',
63
67
  right: '-5px',
64
68
  cursor: 'ne-resize',
65
69
  },
66
- resizeHandleSe: {
70
+ se: {
67
71
  bottom: '-5px',
68
72
  right: '-5px',
69
73
  cursor: 'se-resize',
70
74
  }
71
- }));
75
+ };
72
76
 
73
77
  const DEFAULT_OPTIONS = [
74
78
  {
@@ -156,7 +160,6 @@ const DEFAULT_OPTIONS = [
156
160
  ];
157
161
 
158
162
  const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) => {
159
- const classes = useStyles(finalImageProperties);
160
163
  const [urlImagem, setUrlImagem] = useState(undefined);
161
164
 
162
165
  const [key, setKey] = useState(undefined);
@@ -219,11 +222,11 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
219
222
  // Save the initial event details and container state
220
223
  eventState.container_width = $container.width();
221
224
  eventState.container_height = $container.height();
222
- eventState.container_left = $container.offset().left;
225
+ eventState.container_left = $container.offset().left;
223
226
  eventState.container_top = $container.offset().top;
224
- eventState.mouse_x = (e.clientX || e.pageX || e.originalEvent.touches?.at(0).clientX) + $(window).scrollLeft();
227
+ eventState.mouse_x = (e.clientX || e.pageX || e.originalEvent.touches?.at(0).clientX) + $(window).scrollLeft();
225
228
  eventState.mouse_y = (e.clientY || e.pageY || e.originalEvent.touches?.at(0).clientY) + $(window).scrollTop();
226
-
229
+
227
230
  // This is a fix for mobile safari
228
231
  // For some reason it does not allow a direct copy of the touches property
229
232
  if (typeof e.originalEvent.touches !== 'undefined') {
@@ -239,9 +242,9 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
239
242
 
240
243
  const resizing = (e) => {
241
244
  let mouse = {}, width, height, left, top;
242
- mouse.x = (e.clientX || e.pageX || e.originalEvent.touches?.at(0).clientX) + $(window).scrollLeft();
245
+ mouse.x = (e.clientX || e.pageX || e.originalEvent.touches?.at(0).clientX) + $(window).scrollLeft();
243
246
  mouse.y = (e.clientY || e.pageY || e.originalEvent.touches?.at(0).clientY) + $(window).scrollTop();
244
-
247
+
245
248
  // Position image differently depending on the corner dragged and constraints
246
249
  if (eventState.evnt.target.id === `resizeHandleSe_${key}`) {
247
250
  width = mouse.x - eventState.container_left;
@@ -270,7 +273,7 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
270
273
  top = mouse.y - ((width / origSrc.width * origSrc.height) - height);
271
274
  }
272
275
  }
273
-
276
+
274
277
  // Optionally maintain aspect ratio
275
278
  if (constrain || !e.shiftKey) {
276
279
  height = width / origSrc.width * origSrc.height;
@@ -278,8 +281,8 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
278
281
 
279
282
  if (width > minWidth && height > minHeight) {
280
283
  // To improve performance you might limit how often resizeImage() is called
281
- resizeImage(width, height);
282
-
284
+ resizeImage(width, height);
285
+
283
286
  //detecção de colisao para impedir q imagem saia do quadro
284
287
  const wantedLeft = left;
285
288
  const wantedTop = top;
@@ -306,9 +309,9 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
306
309
  const resizeImage = (width, height) => {
307
310
  resizeCanvas.width = width;
308
311
  resizeCanvas.height = height;
309
- resizeCanvas.getContext('2d').drawImage(origSrc, 0, 0, width, height);
312
+ resizeCanvas.getContext('2d').drawImage(origSrc, 0, 0, width, height);
310
313
  // setUrlImagem(resizeCanvas.toDataURL('image/png'))
311
- $(imageTarget).attr('src', resizeCanvas.toDataURL('image/png'));
314
+ $(imageTarget).attr('src', resizeCanvas.toDataURL('image/png'));
312
315
  resized = true;
313
316
  };
314
317
 
@@ -330,12 +333,12 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
330
333
  let mouse = {}, touches;
331
334
  e.preventDefault();
332
335
  e.stopPropagation();
333
-
336
+
334
337
  touches = e.originalEvent.touches;
335
-
336
- mouse.x = (e.clientX || e.pageX || touches?.at(0).clientX) + $(window).scrollLeft();
338
+
339
+ mouse.x = (e.clientX || e.pageX || touches?.at(0).clientX) + $(window).scrollLeft();
337
340
  mouse.y = (e.clientY || e.pageY || touches?.at(0).clientY) + $(window).scrollTop();
338
-
341
+
339
342
  //detecção de colisao para impedir q imagem saia do quadro
340
343
  const wantedLeft = mouse.x - (eventState.mouse_x - eventState.container_left);
341
344
  const wantedTop = mouse.y - (eventState.mouse_y - eventState.container_top);
@@ -361,15 +364,15 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
361
364
  if (eventState.touches && eventState.touches.length > 1 && touches.length > 1) {
362
365
  let width = eventState.container_width, height = eventState.container_height;
363
366
  let a = eventState.touches?.at(0).clientX - eventState.touches?.at(1).clientX;
364
- a = a * a;
367
+ a = a * a;
365
368
  let b = eventState.touches?.at(0).clientY - eventState.touches?.at(1).clientY;
366
- b = b * b;
369
+ b = b * b;
367
370
  let dist1 = Math.sqrt(a + b);
368
-
371
+
369
372
  a = e.originalEvent.touches?.at(0).clientX - touches?.at(1).clientX;
370
- a = a * a;
373
+ a = a * a;
371
374
  b = e.originalEvent.touches?.at(0).clientY - touches?.at(1).clientY;
372
- b = b * b;
375
+ b = b * b;
373
376
  let dist2 = Math.sqrt(a + b);
374
377
 
375
378
  let ratio = dist2 / dist1;
@@ -388,23 +391,23 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
388
391
  resizeImage(width, height);
389
392
  }
390
393
  setTimeout(() => {
391
-
394
+
392
395
  //Find the part of the image that is inside the crop box
393
396
  let cropCanvas,
394
397
  left = $(`#overlay_${key}`).offset().left - $container.offset().left,
395
398
  top = $(`#overlay_${key}`).offset().top - $container.offset().top,
396
399
  width = $(`#overlay_${key}`).width(),
397
400
  height = $(`#overlay_${key}`).height();
398
-
401
+
399
402
  cropCanvas = document.createElement('canvas');
400
403
  cropCanvas.width = width;
401
404
  cropCanvas.height = height;
402
-
403
- const ctx = cropCanvas.getContext('2d');
405
+
406
+ const ctx = cropCanvas.getContext('2d');
404
407
  ctx.filter = $(`#resizeImage_${key}`).css('filter');
405
408
  ctx.drawImage(imageTarget, left, top, width, height, 0, 0, width, height);
406
409
  // window.open(cropCanvas.toDataURL('image/png'));
407
-
410
+
408
411
  onImage(cropCanvas.toDataURL('image/png'));
409
412
  }, 0);
410
413
  };
@@ -430,50 +433,52 @@ const ImageResize = ({ imagem, onImage, finalImageProperties = {}, ...props }) =
430
433
  return onlyFilters ? filters : { filter: filters };
431
434
  };
432
435
 
433
- return <Dialog {...props} maxWidth='lg' fullWidth keepMounted>
434
- <DialogTitle>Ajustar Imagem</DialogTitle>
435
- <DialogContent style={{ display: 'block', position: 'relative' }}>
436
-
437
- <Grid container spacing={2}>
438
- <Grid item xs={8}>
439
- <div className={classes.component}>
440
- <div id={`overlay_${key}`} className={classes.overlay}></div>
441
- <div id={`container_${key}`} className={classes.resizeContainer}>
442
- <span id={`resizeHandleNw_${key}`} className={clsx(`resize-handle_${key}`, classes.resizeHandle, classes.resizeHandleNw)}></span>
443
- <span id={`resizeHandleNe_${key}`} className={clsx(`resize-handle_${key}`, classes.resizeHandle, classes.resizeHandleNe)}></span>
444
- <img ref={image} id={`resizeImage_${key}`} style={{ display: 'block', minWidth: $(`#overlay_${key}`).width(), minHeight: $(`#overlay_${key}`).height(), ...getImageStyle() }} src={urlImagem} alt='Imagem a ser Redimensionada'/>
445
- <span id={`resizeHandleSw_${key}`} className={clsx(`resize-handle_${key}`, classes.resizeHandle, classes.resizeHandleSw)}></span>
446
- <span id={`resizeHandleSe_${key}`} className={clsx(`resize-handle_${key}`, classes.resizeHandle, classes.resizeHandleSe)}></span>
447
- </div>
448
- </div>
449
- </Grid>
450
- <Grid item xs={2} style={{ display: 'flex', alignItems: 'center' }}>
451
- <Slider
452
- style={{ height: 'calc(100% - 30px)' }}
453
- orientation='vertical'
454
- // getAriaValueText={valuetext}
455
- step={selectedOption.step}
456
- min={selectedOption.range.min}
457
- max={selectedOption.range.max}
458
- value={selectedOption.value}
459
- onChange={handleSliderChange}
460
- />
461
- </Grid>
462
- <Grid item xs={2}>
463
- <List>
464
- {options.map((option, index) => (
465
- <ListItem button onClick={() => setSelectedOptionIndex(index)} key={index} selected={index === selectedOptionIndex}>
466
- <ListItemText primary={option.name}/>
467
- </ListItem>
468
- ))}
469
- </List>
436
+ return (
437
+ <Dialog {...props} maxWidth='lg' fullWidth keepMounted>
438
+ <DialogTitle>Ajustar Imagem</DialogTitle>
439
+ <DialogContent style={{ display: 'block', position: 'relative' }}>
440
+
441
+ <Grid container spacing={2}>
442
+ <Grid size={8}>
443
+ <Box sx={componentSx(finalImageProperties)}>
444
+ <Box id={`overlay_${key}`} sx={overlaySx(finalImageProperties)}></Box>
445
+ <Box id={`container_${key}`} sx={resizeContainerSx}>
446
+ <Box component='span' id={`resizeHandleNw_${key}`} className={clsx(`resize-handle_${key}`)} sx={{ ...resizeHandleSx, ...resizeHandlePositionSx.nw }}></Box>
447
+ <Box component='span' id={`resizeHandleNe_${key}`} className={clsx(`resize-handle_${key}`)} sx={{ ...resizeHandleSx, ...resizeHandlePositionSx.ne }}></Box>
448
+ <img ref={image} id={`resizeImage_${key}`} style={{ display: 'block', minWidth: $(`#overlay_${key}`).width(), minHeight: $(`#overlay_${key}`).height(), ...getImageStyle() }} src={urlImagem} alt='Imagem a ser Redimensionada'/>
449
+ <Box component='span' id={`resizeHandleSw_${key}`} className={clsx(`resize-handle_${key}`)} sx={{ ...resizeHandleSx, ...resizeHandlePositionSx.sw }}></Box>
450
+ <Box component='span' id={`resizeHandleSe_${key}`} className={clsx(`resize-handle_${key}`)} sx={{ ...resizeHandleSx, ...resizeHandlePositionSx.se }}></Box>
451
+ </Box>
452
+ </Box>
453
+ </Grid>
454
+ <Grid style={{ display: 'flex', alignItems: 'center' }} size={2}>
455
+ <Slider
456
+ style={{ height: 'calc(100% - 30px)' }}
457
+ orientation='vertical'
458
+ // getAriaValueText={valuetext}
459
+ step={selectedOption.step}
460
+ min={selectedOption.range.min}
461
+ max={selectedOption.range.max}
462
+ value={selectedOption.value}
463
+ onChange={handleSliderChange}
464
+ />
465
+ </Grid>
466
+ <Grid size={2}>
467
+ <List>
468
+ {options.map((option, index) => (
469
+ <ListItem button onClick={() => setSelectedOptionIndex(index)} key={index} selected={index === selectedOptionIndex}>
470
+ <ListItemText primary={option.name}/>
471
+ </ListItem>
472
+ ))}
473
+ </List>
474
+ </Grid>
470
475
  </Grid>
471
- </Grid>
472
- </DialogContent>
473
- <DialogActions>
474
- <Button ref={button} id={`js-crop_${key}`} color='primary' variant='contained'>Recortar<MdCrop style={{ marginLeft: 5 }}/></Button>
475
- </DialogActions>
476
- </Dialog>;
476
+ </DialogContent>
477
+ <DialogActions>
478
+ <Button ref={button} id={`js-crop_${key}`} color='primary' variant='contained'>Recortar<MdCrop style={{ marginLeft: 5 }}/></Button>
479
+ </DialogActions>
480
+ </Dialog>
481
+ );
477
482
  };
478
483
 
479
- export default ImageResize;
484
+ export default ImageResize;
@@ -1,5 +1,5 @@
1
1
  import { ImageResizeProps } from '../ImageResize/ImageResize';
2
- import { ButtonClassKey, ExtendButtonBase } from '@material-ui/core';
2
+ import { ButtonClassKey, ExtendButtonBase } from '@mui/material';
3
3
  import React from 'react';
4
4
  export interface ImageResizeButtonTypeMap<P = {}, D extends React.ElementType = 'button'>{
5
5
  props: P & {
@@ -1,5 +1,5 @@
1
1
  import { ImageResize } from '../';
2
- import { Button } from '@material-ui/core';
2
+ import { Button } from '@mui/material';
3
3
  import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';
4
4
 
5
5
  const ImageResizeButton = forwardRef(({ children, ImageResizeProps, onImage, Component = Button, ...props }, ref) => {
@@ -1,7 +1,7 @@
1
1
  import { createField, getField } from '../../fieldsRedux';
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { Component } from 'react';
4
- import MaskedInput from 'react-maskedinput';
4
+ import MaskedInput from '@mona-health/react-input-mask';
5
5
 
6
6
  /**
7
7
  * @deprecated
@@ -165,7 +165,7 @@ class Input extends Component {
165
165
 
166
166
  return !mask
167
167
  ? (<input {...inputProps} />)
168
- : (<MaskedInput mask={mask} {...inputProps} />);
168
+ : (<MaskedInput mask={mask.replaceAll('1', '9').replaceAll('#', '*')} {...inputProps} />);
169
169
  }
170
170
 
171
171
  stateOptions = () => {