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,11 +1,15 @@
1
- import { Box, Button, DialogActions, Divider, ListItem, ListItemIcon, ListItemText, MobileStepper, Paper, Step, StepButton, StepConnector, StepLabel, Stepper as MuiStepper, Typography, useMediaQuery, useTheme, withStyles } from '@material-ui/core';
2
- import clsx from 'clsx';
1
+ import { Box, Button, DialogActions, Divider, GlobalStyles, ListItem, ListItemIcon, ListItemText, MobileStepper, Paper, Step, StepButton, StepConnector, StepLabel, Stepper as MuiStepper, Typography, useMediaQuery, useTheme } from '@mui/material';
2
+ import { stepConnectorClasses } from '@mui/material/StepConnector';
3
+ import { styled } from '@mui/material/styles';
4
+ import { clsx } from 'clsx';
3
5
  import React, { useEffect, useState } from 'react';
4
6
  import { IconContext } from 'react-icons/lib';
5
7
  import { MdCheck, MdChevronLeft, MdChevronRight } from 'react-icons/md';
6
8
 
7
- const ColorlibConnector = withStyles(theme => ({
8
- alternativeLabel: ({ orientation }) => orientation === 'vertical' ? {
9
+ const ColorlibConnector = styled(StepConnector, {
10
+ shouldForwardProp: prop => prop !== 'customOrientation'
11
+ })(({ theme, customOrientation }) => ({
12
+ [`&.${stepConnectorClasses.alternativeLabel}`]: customOrientation === 'vertical' ? {
9
13
  top: -28,
10
14
  transform: 'rotate(90deg)',
11
15
  left: 'calc(-50% + 40px)',
@@ -16,18 +20,18 @@ const ColorlibConnector = withStyles(theme => ({
16
20
  } : {
17
21
  top: 22,
18
22
  },
19
- active: {
20
- '& $line': {
23
+ [`&.${stepConnectorClasses.active}`]: {
24
+ [`& .${stepConnectorClasses.line}`]: {
21
25
  backgroundPosition: 'left bottom'
22
26
  },
23
27
  },
24
- completed: {
25
- '& $line': {
28
+ [`&.${stepConnectorClasses.completed}`]: {
29
+ [`& .${stepConnectorClasses.line}`]: {
26
30
  backgroundPosition: 'left bottom',
27
31
  backgroundImage: `linear-gradient( to right, ${theme.palette.secondary.main} 0%,${theme.palette.secondary.main} 50%,#eaeaf0 51%, #eaeaf0 100%)`,
28
32
  },
29
33
  },
30
- line: {
34
+ [`& .${stepConnectorClasses.line}`]: {
31
35
  height: 3,
32
36
  border: 0,
33
37
  backgroundImage: `linear-gradient( to right, ${theme.palette.secondary.main} 0%,${theme.palette.primary.main} 50%,#eaeaf0 51%, #eaeaf0 100%)`,
@@ -36,91 +40,101 @@ const ColorlibConnector = withStyles(theme => ({
36
40
  transition: 'background-position 500ms ease',
37
41
  borderRadius: 1,
38
42
  }
39
- }))(StepConnector);
43
+ }));
40
44
 
41
- const ColorlibStepIcon = withStyles(theme => ({
42
- root: {
43
- zIndex: 1,
44
- color: '#fff',
45
- width: 50,
46
- height: 50,
47
- display: 'flex',
48
- borderRadius: '50%',
49
- justifyContent: 'center',
50
- alignItems: 'center',
51
- fontSize: 24,
52
- backgroundColor: theme.palette.type === 'light' ? '#ccc' : '#838383',
53
- transition: 'all 400ms ease 100ms'
54
- },
55
- initial: theme.palette.type === 'light' ? {
56
- backgroundColor: ({ ambienteTeste }) => ambienteTeste ? '#ffc7a2' : '#9acbb8'
57
- } : {
58
- backgroundColor: ({ ambienteTeste }) => ambienteTeste ? '#8b6751' : '#507265'
59
- },
60
- active: {
61
- backgroundColor: ({ ambienteTeste }) => ambienteTeste ? '#f5781e !important' : '#00995D !important',
62
- boxShadow: theme.shadows[5],
63
- },
64
- completed: {
65
- backgroundColor: '#2979ff !important',
66
- },
67
- error: {
68
- backgroundColor: '#f44336 !important',
69
- },
70
- icon: {
71
- '& path': {
72
- stroke: '#FFF'
73
- }
74
- }
75
- }))(({ initial, active, completed, icon, classes, error }) => (
76
- <div
77
- className={clsx(classes.root, {
78
- [classes.initial]: initial,
79
- [classes.active]: active,
80
- [classes.completed]: completed,
81
- [classes.error]: error,
82
- })}
83
- >
84
- <IconContext.Provider value={{ className: classes.icon }} >
85
- {icon}
86
- </IconContext.Provider>
87
- </div>
88
- ));
45
+ const ColorlibStepIcon = ({ initial, active, completed, icon, error, ambienteTeste }) => {
46
+ const theme = useTheme();
47
+ const initialBackground = theme.palette.mode === 'light'
48
+ ? ambienteTeste ? '#ffc7a2' : '#9acbb8'
49
+ : ambienteTeste ? '#8b6751' : '#507265';
50
+ const backgroundColor = error
51
+ ? '#f44336 !important'
52
+ : completed
53
+ ? '#2979ff !important'
54
+ : active
55
+ ? ambienteTeste ? '#f5781e !important' : '#00995D !important'
56
+ : initial
57
+ ? initialBackground
58
+ : theme.palette.mode === 'light' ? '#ccc' : '#838383';
59
+
60
+ return (
61
+ <Box
62
+ sx={{
63
+ zIndex: 1,
64
+ color: '#fff',
65
+ width: 50,
66
+ height: 50,
67
+ display: 'flex',
68
+ borderRadius: '50%',
69
+ justifyContent: 'center',
70
+ alignItems: 'center',
71
+ fontSize: 24,
72
+ backgroundColor,
73
+ transition: 'all 400ms ease 100ms',
74
+ boxShadow: active ? theme.shadows[5] : undefined,
75
+ '& svg path': {
76
+ stroke: '#FFF'
77
+ }
78
+ }}
79
+ >
80
+ <IconContext.Provider value={{}}>
81
+ {icon}
82
+ </IconContext.Provider>
83
+ </Box>
84
+ );
85
+ };
86
+
87
+ const stepperClasses = {
88
+ root: 'argous-stepper-root',
89
+ header: 'argous-stepper-header',
90
+ caption: 'argous-stepper-caption',
91
+ selectedCaption: 'argous-stepper-selected-caption',
92
+ stepper: 'argous-stepper-stepper',
93
+ subDescription: 'argous-stepper-sub-description',
94
+ icon: 'argous-stepper-icon',
95
+ mobileDivider: 'argous-stepper-mobile-divider',
96
+ stepLabel: 'argous-stepper-step-label',
97
+ };
98
+
99
+ const mergeClasses = (defaultClasses, overrideClasses = {}) => Object.keys(defaultClasses).reduce((acc, key) => ({
100
+ ...acc,
101
+ [key]: overrideClasses[key] || defaultClasses[key],
102
+ }), {});
89
103
 
90
- const stepperStyles = theme => ({
91
- root: {
104
+ const stepperStyles = ({ orientation }) => theme => ({
105
+ [`.${stepperClasses.root}`]: {
92
106
  '&>div': {
93
107
  minHeight: 'calc(100vh - 50px)'
94
108
  }
95
109
  },
96
- header: {
110
+ [`.${stepperClasses.header}`]: {
97
111
  background: theme.palette.background.default,
98
112
  marginTop: -10,
99
113
  },
100
- caption: {
114
+ [`.${stepperClasses.caption}`]: {
101
115
  display: 'block',
102
116
  textAlign: 'center',
103
117
  color: theme.palette.text.hint
104
118
  },
105
- selectedCaption: {
119
+ [`.${stepperClasses.selectedCaption}`]: {
106
120
  color: theme.palette.text.secondary
107
121
  },
108
- stepper: {
109
- padding: ({ orientation }) => orientation === 'vertical' ? '0 0 0 136px' : '',
122
+ [`.${stepperClasses.stepper}`]: {
123
+ padding: orientation === 'vertical' ? '0 0 0 136px' : '',
110
124
  [theme.breakpoints.down('sm')]: {
111
125
  padding: 0
112
126
  },
113
127
  '&>div': {
114
128
  display: 'flex',
115
- padding: ({ orientation }) => orientation === 'vertical' ? '0 0 30px' : '',
129
+ padding: orientation === 'vertical' ? '0 0 30px' : '',
116
130
  '&>button': {
117
131
  '&>span:nth-child(1)': {
118
- flexDirection: ({ orientation }) => orientation === 'vertical' ? 'row' : 'column'
132
+ flexDirection: orientation === 'vertical' ? 'row' : 'column'
119
133
  }
120
134
  }
121
135
  }
122
136
  },
123
- subDescription: {
137
+ [`.${stepperClasses.subDescription}`]: {
124
138
  minWidth: 140,
125
139
  display: 'flex',
126
140
  alignItems: 'center',
@@ -129,34 +143,34 @@ const stepperStyles = theme => ({
129
143
  top: 17,
130
144
  left: -148,
131
145
  },
132
- icon: {
146
+ [`.${stepperClasses.icon}`]: {
133
147
  fontSize: theme.typography.fontSize * 2,
134
148
  '& path': {
135
149
  stroke: theme.palette.text.primary
136
150
  }
137
151
  },
138
- mobileDivider: {
152
+ [`.${stepperClasses.mobileDivider}`]: {
139
153
  marginBottom: theme.spacing(2)
140
154
  },
141
- stepLabel: {
155
+ [`.${stepperClasses.stepLabel}`]: {
142
156
  '&>span:nth-child(2)': {
143
- margin: ({ orientation }) => orientation === 'vertical' ? '0 0 0 8px' : '',
157
+ margin: orientation === 'vertical' ? '0 0 0 8px' : '',
144
158
  '&>span:nth-child(1)': {
145
- margin: ({ orientation }) => orientation === 'vertical' ? 0 : ''
159
+ margin: orientation === 'vertical' ? 0 : ''
146
160
  }
147
161
  },
148
162
  }
149
163
  });
150
164
 
151
- const Stepper = ({
152
- children,
153
- classes = {},
154
- steps = [],
155
- onClick = (index) => (event) => void(index, event),
156
- onNext = (event) => void(event),
157
- onPrevious = (event) => void(event),
158
- onFinish = (event) => void(event),
159
- maxStep: maxStepProps,
165
+ const Stepper = ({
166
+ children,
167
+ classes: classesProp = {},
168
+ steps = [],
169
+ onClick = (index) => (event) => void(index, event),
170
+ onNext = (event) => void(event),
171
+ onPrevious = (event) => void(event),
172
+ onFinish = (event) => void(event),
173
+ maxStep: maxStepProps,
160
174
  activeStep = 0,
161
175
  errors = [],
162
176
  component: Component = 'div',
@@ -172,126 +186,144 @@ const Stepper = ({
172
186
  ...props
173
187
  }) => {
174
188
  const theme = useTheme();
189
+ const classes = mergeClasses(stepperClasses, classesProp);
175
190
  const maxSteps = steps.length;
176
191
  const maxStep = maxStepProps || steps.length - 1;
177
192
  const mobile = useMediaQuery(theme.breakpoints.down(Math.max(maxSteps * 100, theme.breakpoints.values.sm)));
178
193
  const ambienteTeste = JSON.parse(window.localStorage.getItem('ambienteTeste'));
179
194
  const [initialStep, setInitialStep] = useState(-1);
180
- useEffect(() => (activeStep > initialStep && showProgress) && setInitialStep(activeStep), [activeStep, initialStep, showProgress]);
195
+ useEffect(() => {
196
+ if (activeStep > initialStep && showProgress) setInitialStep(activeStep);
197
+ }, [activeStep, initialStep, showProgress]);
181
198
 
182
- return <Component {...props}>
183
- {mobile && orientation !== 'vertical' ? (
184
- <Paper square elevation={0}>
185
- <ListItem dense className={classes.header}>
186
- <ListItemIcon className={classes.icon}>{steps[activeStep][0]}</ListItemIcon>
187
- <ListItemText primary={steps[activeStep][1]} secondary={steps[activeStep][2]}/>
188
- </ListItem>
189
- <Divider className={classes.mobileDivider}/>
190
- </Paper>
191
- ) : (
192
- <MuiStepper
193
- className={classes.stepper}
194
- alternativeLabel
195
- activeStep={activeStep}
196
- orientation={orientation}
197
- connector={<ColorlibConnector />}
198
- >
199
- {steps.map(([icon, label, description, subDescription], i) => (
200
- <Step key={label}>
201
- {orientation === 'vertical' && subDescription &&
202
- <div className={classes.subDescription}>
203
- <Typography
204
- variant='caption'
205
- className={clsx(classes.caption, { [classes.selectedCaption]: activeStep >= i })}>
206
- {subDescription}
207
- </Typography>
208
- </div>
209
- }
210
- <StepButton
211
- onClick={onClick(i)}
212
- disabled={i > maxStep}
213
- optional={
214
- <>
215
- <Typography
216
- variant='caption'
199
+ return (
200
+ <Component {...props} className={clsx(classes.root, props.className)}>
201
+ <GlobalStyles styles={stepperStyles({ orientation })} />
202
+ {mobile && orientation !== 'vertical' ? (
203
+ <Paper square elevation={0}>
204
+ <ListItem dense className={classes.header}>
205
+ <ListItemIcon className={classes.icon}>{steps[activeStep][0]}</ListItemIcon>
206
+ <ListItemText primary={steps[activeStep][1]} secondary={steps[activeStep][2]}/>
207
+ </ListItem>
208
+ <Divider className={classes.mobileDivider}/>
209
+ </Paper>
210
+ ) : (
211
+ <MuiStepper
212
+ className={classes.stepper}
213
+ alternativeLabel
214
+ activeStep={activeStep}
215
+ orientation={orientation}
216
+ connector={<ColorlibConnector customOrientation={orientation} />}
217
+ >
218
+ {steps.map(([icon, label, description, subDescription], i) => (
219
+ <Step key={label}>
220
+ {orientation === 'vertical' && subDescription &&
221
+ <div className={classes.subDescription}>
222
+ <Typography
223
+ variant='caption'
217
224
  className={clsx(classes.caption, { [classes.selectedCaption]: activeStep >= i })}>
218
- {description}
225
+ {subDescription}
219
226
  </Typography>
220
- {orientation !== 'vertical' && subDescription &&
221
- <Typography
227
+ </div>
228
+ }
229
+ <StepButton
230
+ onClick={onClick(i)}
231
+ disabled={i > maxStep}
232
+ optional={
233
+ <>
234
+ <Typography
222
235
  variant='caption'
223
236
  className={clsx(classes.caption, { [classes.selectedCaption]: activeStep >= i })}>
224
- {subDescription}
237
+ {description}
225
238
  </Typography>
226
- }
227
- </>
228
- }
229
- >
230
- <StepLabel
231
- className={classes.stepLabel}
232
- disabled={i > maxStep}
233
- error={errors[i]}
234
- StepIconComponent={ColorlibStepIcon}
235
- StepIconProps={{ icon, error: errors[i], initial: initialStep >= i, ambienteTeste }}
239
+ {orientation !== 'vertical' && subDescription &&
240
+ <Typography
241
+ variant='caption'
242
+ className={clsx(classes.caption, { [classes.selectedCaption]: activeStep >= i })}>
243
+ {subDescription}
244
+ </Typography>
245
+ }
246
+ </>
247
+ }
236
248
  >
237
- {label}
238
- </StepLabel>
239
- </StepButton>
240
- </Step>
241
- ))}
242
- </MuiStepper>
243
- )}
244
-
245
- {children &&
246
- <Box padding={mobile ? 0 : 4} pt={1} pb={0}>
247
- {children}
248
- </Box>
249
- }
250
-
251
- {mobile && orientation !== 'vertical' ? (
252
- <MobileStepper
253
- steps={maxSteps}
254
- position='bottom'
255
- variant='dots'
256
- activeStep={activeStep}
257
- backButton={
258
- <Button
259
- startIcon={<MdChevronLeft/>}
260
- onClick={onPrevious}
261
- disabled={activeStep === 0}>
262
- {backLabel}
263
- </Button>
264
- }
265
- nextButton={
266
- <Button
267
- variant='contained'
268
- color='primary'
269
- endIcon={activeStep === maxSteps - 1 ? <MdCheck/> : <MdChevronRight/>}
270
- onClick={activeStep === steps.length - 1 ? onFinish : onNext}>
271
- {activeStep === steps.length - 1 ? finishLabel : nextLabel}
272
- </Button>
273
- }
274
- />
275
- ) : !disableActions ? (
276
- <DialogActions>
277
- <Box padding={mobile ? 0 : 4} paddingTop={1} paddingBottom={1}>
278
- <Button
279
- disabled={activeStep === 0 || disablePrevious}
280
- onClick={onPrevious}>
281
- {backLabel}
282
- </Button>
283
- <Button
284
- variant='contained'
285
- color='primary'
286
- onClick={activeStep === steps.length - 1 ? onFinish : onNext}
287
- disabled={activeStep === steps.length - 1 ? disableFinish : disableNext}
288
- >
289
- {activeStep === steps.length - 1 ? finishLabel : nextLabel}
290
- </Button>
249
+ <StepLabel
250
+ className={classes.stepLabel}
251
+ disabled={i > maxStep}
252
+ error={errors[i]}
253
+ slots={{
254
+ stepIcon: ColorlibStepIcon
255
+ }}
256
+ slotProps={{
257
+ stepIcon: { icon, error: errors[i], initial: initialStep >= i, ambienteTeste }
258
+ }}
259
+ >
260
+ {label}
261
+ </StepLabel>
262
+ </StepButton>
263
+ </Step>
264
+ ))}
265
+ </MuiStepper>
266
+ )}
267
+ {children &&
268
+ <Box
269
+ sx={{
270
+ padding: mobile ? 0 : 4,
271
+ pt: 1,
272
+ pb: 0
273
+ }}>
274
+ {children}
291
275
  </Box>
292
- </DialogActions>
293
- ) : null }
294
- </Component>;
276
+ }
277
+ {mobile && orientation !== 'vertical' ? (
278
+ <MobileStepper
279
+ steps={maxSteps}
280
+ position='bottom'
281
+ variant='dots'
282
+ activeStep={activeStep}
283
+ backButton={
284
+ <Button
285
+ startIcon={<MdChevronLeft/>}
286
+ onClick={onPrevious}
287
+ disabled={activeStep === 0}>
288
+ {backLabel}
289
+ </Button>
290
+ }
291
+ nextButton={
292
+ <Button
293
+ variant='contained'
294
+ color='primary'
295
+ endIcon={activeStep === maxSteps - 1 ? <MdCheck/> : <MdChevronRight/>}
296
+ onClick={activeStep === steps.length - 1 ? onFinish : onNext}>
297
+ {activeStep === steps.length - 1 ? finishLabel : nextLabel}
298
+ </Button>
299
+ }
300
+ />
301
+ ) : !disableActions ? (
302
+ <DialogActions>
303
+ <Box
304
+ sx={{
305
+ padding: mobile ? 0 : 4,
306
+ paddingTop: 1,
307
+ paddingBottom: 1
308
+ }}>
309
+ <Button
310
+ disabled={activeStep === 0 || disablePrevious}
311
+ onClick={onPrevious}>
312
+ {backLabel}
313
+ </Button>
314
+ <Button
315
+ variant='contained'
316
+ color='primary'
317
+ onClick={activeStep === steps.length - 1 ? onFinish : onNext}
318
+ disabled={activeStep === steps.length - 1 ? disableFinish : disableNext}
319
+ >
320
+ {activeStep === steps.length - 1 ? finishLabel : nextLabel}
321
+ </Button>
322
+ </Box>
323
+ </DialogActions>
324
+ ) : null }
325
+ </Component>
326
+ );
295
327
  };
296
328
 
297
- export default withStyles(stepperStyles, { name: 'ArgousStepper' })(Stepper);
329
+ export default Stepper;
@@ -2,10 +2,9 @@ import Input from './../Input';
2
2
  import SimpleTable, { Action } from './../SimpleTable';
3
3
  import { setField, getField } from '../../fieldsRedux';
4
4
  import { serverAction } from '../../utils/api';
5
- import { withTheme } from '@material-ui/core';
5
+ import { useTheme } from '@mui/material/styles';
6
6
  import PropTypes from 'prop-types';
7
7
  import React, { Component } from 'react';
8
- import { Scrollbars } from 'react-custom-scrollbars';
9
8
 
10
9
  /**
11
10
  * @deprecated
@@ -190,7 +189,7 @@ class TablePicker extends Component {
190
189
  <td colSpan='2'>
191
190
 
192
191
  <div className='argous-list-dropdown' style={{ height: resultHeight }}>
193
- <Scrollbars>
192
+ <div style={{ height: '100%', overflowY: 'auto' }}>
194
193
  {typeMessage > 0 && (
195
194
  <div className='padding-top-sm padding-bottom-sm color999 text-center'>
196
195
  {typeMessage === 1 && 'Escreva para começar a buscar'}
@@ -200,7 +199,7 @@ class TablePicker extends Component {
200
199
  )}
201
200
 
202
201
  <SimpleTable field={`results-${field}`} alias={alias} onClick={this.selectResult} className='reset-margin' />
203
- </Scrollbars>
202
+ </div>
204
203
  </div>
205
204
 
206
205
  <SimpleTable field={field} defaultValue={defaultValue} alias={alias} head={head} rows={value && value.length > rows ? rows : undefined} fieldListener={fieldListener} className='reset-margin-bottom'>
@@ -232,7 +231,13 @@ TablePicker.propTypes = {
232
231
  placeholder: PropTypes.string,
233
232
  removeAction: PropTypes.string,
234
233
  head: PropTypes.array,
235
- rows: PropTypes.number
234
+ rows: PropTypes.number,
235
+ theme: PropTypes.object
236
+ };
237
+
238
+ const TablePickerWithTheme = props => {
239
+ const theme = useTheme();
240
+ return <TablePicker {...props} theme={theme} />;
236
241
  };
237
242
 
238
- export default withTheme(TablePicker);
243
+ export default TablePickerWithTheme;