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
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
26
26
  }) : function(o, v) {
27
27
  o["default"] = v;
28
28
  });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
36
46
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
47
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
48
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -43,8 +53,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
53
  });
44
54
  };
45
55
  var __generator = (this && this.__generator) || function (thisArg, body) {
46
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
56
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
57
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
58
  function verb(n) { return function (v) { return step([n, v]); }; }
49
59
  function step(op) {
50
60
  if (f) throw new TypeError("Generator is already executing.");
@@ -93,14 +103,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
93
103
  return (mod && mod.__esModule) ? mod : { "default": mod };
94
104
  };
95
105
  Object.defineProperty(exports, "__esModule", { value: true });
96
- exports.numbersLettersOnly = exports.lettersOnly = exports.numbersOnly = exports.stopPrntScr = exports.printUrl = exports.geraLog = exports.printScreen = exports.allCharactersSame = exports.dataUrlToBlob = exports.bytesTranslator = exports.storageMeasures = exports.confirm = exports.copyToClipboard = exports.toFloat = exports.currencyMask = exports.useWebSocket = exports.formataTelefone = exports.reduxDispatch = exports.useStore = exports.useModal = exports.useGraph = exports.randomColor = exports.humanFileSize = exports.sanitizaHTML = exports.formataDinheiro = exports.useUpdateEffect = exports.usePrevious = exports.getNumeroFromInitials = exports.getInitials = exports.getRandomColor = exports.printPdf = exports.downloadFromUrl = exports.downloadBase64 = exports.formataNome = exports.addExtraZero = exports.getCookie = exports.widthToCenterVertically = void 0;
106
+ exports.numbersLettersOnly = exports.lettersOnly = exports.numbersOnly = exports.printUrl = exports.geraLog = exports.printScreen = exports.bytesTranslator = exports.storageMeasures = exports.confirm = exports.copyToClipboard = exports.toFloat = exports.currencyMask = exports.useWebSocket = exports.formataTelefone = exports.reduxDispatch = exports.useStore = exports.useModal = exports.useGraph = exports.randomColor = exports.humanFileSize = exports.sanitizaHTML = exports.usePrevious = exports.getNumeroFromInitials = exports.getInitials = exports.getRandomColor = exports.printPdf = exports.formataNome = exports.addExtraZero = exports.getCookie = exports.widthToCenterVertically = void 0;
107
+ exports.downloadBase64 = downloadBase64;
108
+ exports.downloadFromUrl = downloadFromUrl;
109
+ exports.useUpdateEffect = useUpdateEffect;
110
+ exports.formataDinheiro = formataDinheiro;
111
+ exports.dataUrlToBlob = dataUrlToBlob;
112
+ exports.allCharactersSame = allCharactersSame;
113
+ exports.stopPrntScr = stopPrntScr;
97
114
  var api_1 = require("./api");
98
115
  var store_1 = require("./store");
99
116
  var api_2 = require("../api");
100
117
  var ModalProvider_1 = require("../components/ConfirmModal/ModalProvider");
101
118
  var fieldsRedux_1 = require("../fieldsRedux");
102
- var core_1 = require("@material-ui/core");
103
- var colors = __importStar(require("@material-ui/core/colors"));
119
+ var material_1 = require("@mui/material");
120
+ var colors = __importStar(require("@mui/material/colors"));
104
121
  var dom_to_image_1 = __importDefault(require("dom-to-image"));
105
122
  var lodash_1 = require("lodash");
106
123
  var moment_1 = __importDefault(require("moment"));
@@ -127,7 +144,7 @@ var getCookie = function (cName) {
127
144
  return '';
128
145
  };
129
146
  exports.getCookie = getCookie;
130
- var addExtraZero = function (vl) { return (vl < 10) ? "0".concat(typeof vl === 'string' ? parseInt(vl) : vl) : vl; };
147
+ var addExtraZero = function (vl) { return (Number(vl) < 10) ? "0".concat(typeof vl === 'string' ? parseInt(vl) : vl) : vl; };
131
148
  exports.addExtraZero = addExtraZero;
132
149
  var formataNome = function (value) {
133
150
  if (value) {
@@ -148,7 +165,6 @@ function downloadBase64(base64, fileName, fileExtension) {
148
165
  element.click();
149
166
  document.body.removeChild(element);
150
167
  }
151
- exports.downloadBase64 = downloadBase64;
152
168
  /**
153
169
  * Função faz o download de qualquer url
154
170
  *
@@ -180,11 +196,14 @@ function downloadFromUrl(url, fileName, fileExtension) {
180
196
  });
181
197
  });
182
198
  }
183
- exports.downloadFromUrl = downloadFromUrl;
184
- var printPdf = function (URL) {
185
- if (URL === void 0) { URL = ''; }
186
- return __awaiter(void 0, void 0, void 0, function () {
199
+ var printPdf = function () {
200
+ var args_1 = [];
201
+ for (var _i = 0; _i < arguments.length; _i++) {
202
+ args_1[_i] = arguments[_i];
203
+ }
204
+ return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (URL) {
187
205
  var url, iframe;
206
+ if (URL === void 0) { URL = ''; }
188
207
  return __generator(this, function (_a) {
189
208
  switch (_a.label) {
190
209
  case 0: return [4 /*yield*/, (0, api_2.getFileFromLink)({ URL: URL })];
@@ -244,7 +263,7 @@ exports.getInitials = getInitials;
244
263
  var getNumeroFromInitials = function (initials, length) { return Math.ceil(new RNG((initials.charCodeAt(0) + initials.charCodeAt(1) - 130) * length / 5).nextFloat() * 10) - 1; };
245
264
  exports.getNumeroFromInitials = getNumeroFromInitials;
246
265
  var usePrevious = function (value) {
247
- var ref = (0, react_1.useRef)();
266
+ var ref = (0, react_1.useRef)(undefined);
248
267
  (0, react_1.useEffect)(function () {
249
268
  ref.current = value;
250
269
  });
@@ -266,15 +285,15 @@ function useUpdateEffect(effect, dependencies) {
266
285
  isInitialMount.current = false;
267
286
  else
268
287
  effect();
288
+ // This compatibility hook deliberately forwards the caller's dependency list.
289
+ // eslint-disable-next-line react-hooks/exhaustive-deps
269
290
  }, dependencies);
270
291
  }
271
- exports.useUpdateEffect = useUpdateEffect;
272
292
  function formataDinheiro(n) {
273
293
  if (n >= 0)
274
294
  return new Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(n);
275
295
  return "(".concat(new Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Math.abs(n)), ")");
276
296
  }
277
- exports.formataDinheiro = formataDinheiro;
278
297
  var sanitizaHTML = function (html) {
279
298
  if (html === void 0) { html = ''; }
280
299
  return (html === null || html === void 0 ? void 0 : html.replace(/(<script>)|(<\/script>)|(\bon[^ ]*=('|"))/gi, '')) || '';
@@ -323,7 +342,7 @@ exports.randomColor = randomColor;
323
342
  var useGraph = function (_a) {
324
343
  if (_a === void 0) { _a = {}; }
325
344
  var title = _a.title, _b = _a.legend, _c = _b === void 0 ? {} : _b, labels = _c.labels, legend = __rest(_c, ["labels"]), _d = _a.plugins, _e = _d === void 0 ? {} : _d, datalabels = _e.datalabels, plugins = __rest(_e, ["datalabels"]), _f = _a.scales, _g = _f === void 0 ? {} : _f, _h = _g.yAxes, _j = _h === void 0 ? [] : _h, _k = _j, _l = _k[0], y = _k.slice(1), _m = _l === void 0 ? {} : _l, _o = _m.ticks, yticks = _o === void 0 ? {} : _o, _p = _m.gridLines, ygridLines = _p === void 0 ? {} : _p, yAxes = __rest(_m, ["ticks", "gridLines"]), _q = _g.xAxes, _r = _q === void 0 ? [] : _q, _s = _r, _t = _s[0], x = _s.slice(1), _u = _t === void 0 ? {} : _t, _v = _u.ticks, xticks = _v === void 0 ? {} : _v, _w = _u.gridLines, xgridLines = _w === void 0 ? {} : _w, xAxes = __rest(_u, ["ticks", "gridLines"]), scales = __rest(_g, ["yAxes", "xAxes"]), props = __rest(_a, ["title", "legend", "plugins", "scales"]);
326
- var theme = (0, core_1.useTheme)();
345
+ var theme = (0, material_1.useTheme)();
327
346
  return __assign({ title: __assign({ fontColor: theme.palette.text.primary, fontSize: theme.typography.fontSize }, title), legend: __assign({ position: 'bottom', labels: __assign({ fontColor: theme.palette.text.primary }, labels) }, legend), plugins: __assign({ datalabels: __assign({ align: 'end', anchor: 'end', color: theme.palette.text.secondary, textShadowColor: theme.palette.background.default, textShadowBlur: 3 }, datalabels) }, plugins), scales: __assign({ yAxes: __spreadArray([__assign({ ticks: __assign({ fontColor: theme.palette.text.secondary }, yticks), gridLines: __assign({ color: theme.palette.divider, zeroLineColor: theme.palette.divider }, ygridLines) }, yAxes)], y, true), xAxes: __spreadArray([__assign({ ticks: __assign({ fontColor: theme.palette.text.secondary }, xticks), gridLines: __assign({ color: theme.palette.divider, zeroLineColor: theme.palette.divider }, xgridLines) }, xAxes)], x, true) }, scales) }, props);
328
347
  };
329
348
  exports.useGraph = useGraph;
@@ -439,7 +458,6 @@ function dataUrlToBlob(dataUrl) {
439
458
  var blob = new Blob([arrayBuffer], { type: mimeString });
440
459
  return blob;
441
460
  }
442
- exports.dataUrlToBlob = dataUrlToBlob;
443
461
  function allCharactersSame(s) {
444
462
  var n = s.length;
445
463
  for (var i = 1; i < n; i++)
@@ -447,37 +465,34 @@ function allCharactersSame(s) {
447
465
  return false;
448
466
  return true;
449
467
  }
450
- exports.allCharactersSame = allCharactersSame;
451
- var printScreen = function (_a) {
452
- var event = _a.event, _b = _a.id, id = _b === void 0 ? 'root' : _b, _c = _a.download, download = _c === void 0 ? false : _c;
453
- return __awaiter(void 0, void 0, void 0, function () {
454
- var status, file, linkElement, element, dataUrl, blob;
455
- return __generator(this, function (_d) {
456
- switch (_d.label) {
457
- case 0:
458
- status = false;
459
- element = document.getElementById(id);
460
- if (!element) return [3 /*break*/, 2];
461
- return [4 /*yield*/, dom_to_image_1.default.toPng(element)];
462
- case 1:
463
- dataUrl = _d.sent();
464
- if (dataUrl) {
465
- linkElement = document.createElement('a');
466
- linkElement.download = "print_screen_".concat((0, moment_1.default)(new Date()).format('DD-MM-YYYY_HH:mm:ss'), ".png");
467
- linkElement.href = dataUrl;
468
- blob = dataUrlToBlob(dataUrl);
469
- if (blob)
470
- file = new File([blob], linkElement.download, { type: blob.type });
471
- }
472
- _d.label = 2;
473
- case 2:
474
- (linkElement && file) && (status = true);
475
- (linkElement && download) && linkElement.click();
476
- return [2 /*return*/, { event: event, status: status, file: file, element: element, link: linkElement }];
477
- }
478
- });
468
+ var printScreen = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
469
+ var status, file, linkElement, element, dataUrl, blob;
470
+ var event = _b.event, _c = _b.id, id = _c === void 0 ? 'root' : _c, _d = _b.download, download = _d === void 0 ? false : _d;
471
+ return __generator(this, function (_e) {
472
+ switch (_e.label) {
473
+ case 0:
474
+ status = false;
475
+ element = document.getElementById(id);
476
+ if (!element) return [3 /*break*/, 2];
477
+ return [4 /*yield*/, dom_to_image_1.default.toPng(element)];
478
+ case 1:
479
+ dataUrl = _e.sent();
480
+ if (dataUrl) {
481
+ linkElement = document.createElement('a');
482
+ linkElement.download = "print_screen_".concat((0, moment_1.default)(new Date()).format('DD-MM-YYYY_HH:mm:ss'), ".png");
483
+ linkElement.href = dataUrl;
484
+ blob = dataUrlToBlob(dataUrl);
485
+ if (blob)
486
+ file = new File([blob], linkElement.download, { type: blob.type });
487
+ }
488
+ _e.label = 2;
489
+ case 2:
490
+ (linkElement && file) && (status = true);
491
+ (linkElement && download) && linkElement.click();
492
+ return [2 /*return*/, { event: event, status: status, file: file, element: element, link: linkElement }];
493
+ }
479
494
  });
480
- };
495
+ }); };
481
496
  exports.printScreen = printScreen;
482
497
  var geraLog = function (idDocumento, descricao, tpAcao, tokenSistema) { return __awaiter(void 0, void 0, void 0, function () {
483
498
  var _a, _b, _c, _d;
@@ -541,7 +556,6 @@ function stopPrntScr(e) {
541
556
  inpFld.remove();
542
557
  return false;
543
558
  }
544
- exports.stopPrntScr = stopPrntScr;
545
559
  var numbersOnly = function (value, type) { return value ? value.replace(type === 'float' ? /[^0-9/.,]/g : /[^0-9]/g, '') : ''; };
546
560
  exports.numbersOnly = numbersOnly;
547
561
  var lettersOnly = function (valor) { return valor ? valor.replace(/\W/g, '') : ''; };
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStore = exports.setStore = void 0;
3
+ exports.setStore = setStore;
4
+ exports.getStore = getStore;
4
5
  var store;
5
6
  function setStore(providedStore) {
6
7
  store = providedStore;
7
8
  }
8
- exports.setStore = setStore;
9
9
  function getStore() {
10
10
  return store;
11
11
  }
12
- exports.getStore = getStore;
@@ -1,4 +1,4 @@
1
- import { connectArgousWS, getArgousWS, enviaMensagem, disconnect } from './ws';
1
+ import { connectArgousWS, enviaMensagem, disconnect } from './ws';
2
2
  import * as argous from '../actions';
3
3
  import { getField, getCurrentProgram } from '../fieldsRedux';
4
4
  import { sendNotification } from '../utils/api';
@@ -9,11 +9,7 @@ import { connect } from 'react-redux';
9
9
  class WebSocketComponent extends Component {
10
10
 
11
11
  componentDidMount() {
12
- window.addEventListener('focus', () => {
13
- if (this.props.usuarioLogado.nome) {
14
- this.connect();
15
- }
16
- });
12
+ window.addEventListener('focus', this.handleFocus);
17
13
  }
18
14
 
19
15
  componentDidUpdate(previousProps, previousState) {
@@ -27,17 +23,20 @@ class WebSocketComponent extends Component {
27
23
  }
28
24
 
29
25
  componentWillUnmount() {
26
+ window.removeEventListener('focus', this.handleFocus);
30
27
  disconnect();
31
28
  }
32
29
 
33
- connect = () => {
34
- connectArgousWS();
30
+ handleFocus = () => {
31
+ if (this.props.usuarioLogado.nome) {
32
+ this.connect();
33
+ }
34
+ }
35
35
 
36
- const argousWS = getArgousWS();
36
+ connect = () => {
37
+ const argousWS = connectArgousWS();
37
38
 
38
- argousWS.onopen = (event) => {
39
- enviaMensagem({ trn: 1 });
40
- };
39
+ enviaMensagem({ trn: 1 });
41
40
 
42
41
  argousWS.onmessage = (event) => {
43
42
  const res = JSON.parse(event.data);
package/lib/api/index.js CHANGED
@@ -9,10 +9,10 @@ export const headers = (token) => ({ lgTkn: (token) ? token : getCookie('lt') })
9
9
 
10
10
  /**
11
11
  * @deprecated
12
- *
13
- * @param {string} request - Metodo chamado
12
+ *
13
+ * @param {string} request - Metodo chamado
14
14
  * @param {*} data - Dados Enviados
15
- *
15
+ *
16
16
  * @returns {*} retorno
17
17
  */
18
18
  export const fetchToArgous = async (request, data) => {
@@ -103,10 +103,10 @@ export const getProgram = async (data) => {
103
103
 
104
104
  /**
105
105
  * @deprecated
106
- *
106
+ *
107
107
  * @param {*} data - Dados
108
- *
109
- * @returns {object} retorno
108
+ *
109
+ * @returns {object} retorno
110
110
  */
111
111
  export const agGet = async (data) => {
112
112
  const res = await fetch(`${api()}agget.rslvr`, {
@@ -119,10 +119,10 @@ export const agGet = async (data) => {
119
119
 
120
120
  /**
121
121
  * @deprecated
122
- *
122
+ *
123
123
  * @param {*} data - Dados
124
- *
125
- * @returns {object} retorno
124
+ *
125
+ * @returns {object} retorno
126
126
  */
127
127
  export const agSet = async (data) => {
128
128
  const res = await fetch(`${api()}agset.rslvr`, {
@@ -144,10 +144,10 @@ export const action = async (data, token) => {
144
144
 
145
145
  /**
146
146
  * @deprecated
147
- *
147
+ *
148
148
  * @param {*} data - Dados
149
- *
150
- * @returns {object} retorno
149
+ *
150
+ * @returns {object} retorno
151
151
  */
152
152
  export const method = async (data) => {
153
153
  const res = await fetch(`${api()}agmethod.rslvr`, {
@@ -317,7 +317,7 @@ export const sendFilePart = async (data) => { // Envia um pedaco do do arquivo,
317
317
  return await res.json();
318
318
  };
319
319
 
320
- export const endFileUpload = async (data) => { //Finaliza o processo de envio de arquivo
320
+ export const endFileUpload = async (data) => { //Finaliza o processo de envio de arquivo
321
321
  const res = await fetch(`${api()}setEndFileUpload.filepart`, {
322
322
  method: 'POST',
323
323
  body: JSON.stringify(data),
@@ -372,7 +372,7 @@ export const prepareFile = async (file) => {
372
372
  headers: headers(),
373
373
  body: formData
374
374
  });
375
- return { ...await res.json(),
375
+ return { ...(await res.json()),
376
376
  lastModified: file.lastModified,
377
377
  lastModifiedDate: file.lastModifiedDate,
378
378
  name: file.name,
package/lib/api/ws.js CHANGED
@@ -4,9 +4,38 @@ import { getConfig } from '../utils/config';
4
4
  const api = () => `${getConfig().ssl ? 'wss' : 'ws'}${ server() }ws`;
5
5
 
6
6
  let argousWS = null;
7
+ let filaMensagens = [];
8
+
9
+ const WS_CONNECTING = 0;
10
+ const WS_OPEN = 1;
11
+ const WS_CLOSING = 2;
12
+ const WS_CLOSED = 3;
13
+
14
+ const isSocketActive = (ws) => ws && [WS_CONNECTING, WS_OPEN].includes(ws.readyState);
15
+ const isSocketOpen = (ws) => ws && ws.readyState === WS_OPEN;
16
+
17
+ const flushMensagens = () => {
18
+ if (!isSocketOpen(argousWS) || !filaMensagens.length) {
19
+ return;
20
+ }
21
+
22
+ const mensagens = [...filaMensagens];
23
+ filaMensagens = [];
24
+
25
+ mensagens.forEach((mensagem) => {
26
+ argousWS.send(mensagem);
27
+ });
28
+ };
7
29
 
8
30
  export const connectArgousWS = (data) => {
31
+ if (isSocketActive(argousWS)) {
32
+ return argousWS;
33
+ }
34
+
9
35
  argousWS = new WebSocket(api());
36
+ argousWS.addEventListener('open', flushMensagens);
37
+
38
+ return argousWS;
10
39
  };
11
40
 
12
41
  export const getArgousWS = (data) => {
@@ -14,14 +43,29 @@ export const getArgousWS = (data) => {
14
43
  };
15
44
 
16
45
  export const disconnect = () => {
17
- if (argousWS)
46
+ filaMensagens = [];
47
+
48
+ if (argousWS && ![WS_CLOSING, WS_CLOSED].includes(argousWS.readyState)) {
18
49
  argousWS.close();
50
+ }
51
+
52
+ argousWS = null;
19
53
  };
20
54
 
21
55
  export const enviaMensagem = (data) => {
22
- const argousWS = getArgousWS();
23
- argousWS.send(JSON.stringify({
56
+ const mensagem = JSON.stringify({
24
57
  ...headers(),
25
58
  ...data
26
- }));
59
+ });
60
+
61
+ if (!isSocketActive(argousWS)) {
62
+ connectArgousWS();
63
+ }
64
+
65
+ if (isSocketOpen(argousWS)) {
66
+ argousWS.send(mensagem);
67
+ return;
68
+ }
69
+
70
+ filaMensagens.push(mensagem);
27
71
  };
@@ -1,4 +1,4 @@
1
- import { AvatarProps } from '@material-ui/core';
1
+ import { AvatarProps } from '@mui/material';
2
2
 
3
3
  export interface ArgousAvatarTypeMap extends AvatarProps{
4
4
  /**
@@ -1,63 +1,21 @@
1
1
  import { fetchToArgous } from '../../api';
2
2
  import { getNumeroFromInitials, getInitials } from '../../utils';
3
- import { Avatar, makeStyles, colors } from '@material-ui/core';
3
+ import { Avatar, useTheme } from '@mui/material';
4
+ import { blue, brown, deepOrange, deepPurple, green, grey, pink, red, yellow } from '@mui/material/colors';
4
5
  import PropTypes from 'prop-types';
5
6
  import React, { useEffect, useState } from 'react';
6
7
 
7
- const useStyles = makeStyles(theme => ({
8
- orange: {
9
- color: theme.palette.getContrastText(colors.deepOrange[500]),
10
- backgroundColor: colors.deepOrange[500],
11
- },
12
- purple: {
13
- color: theme.palette.getContrastText(colors.deepPurple[500]),
14
- backgroundColor: colors.deepPurple[500],
15
- },
16
- blue: {
17
- color: theme.palette.getContrastText(colors.blue[500]),
18
- backgroundColor: colors.blue[500],
19
- },
20
- red: {
21
- color: theme.palette.getContrastText(colors.red[500]),
22
- backgroundColor: colors.red[500],
23
- },
24
- rosa: {
25
- color: theme.palette.getContrastText(colors.pink[500]),
26
- backgroundColor: colors.pink[500],
27
- },
28
- cinza: {
29
- color: theme.palette.getContrastText(colors.grey[500]),
30
- backgroundColor: colors.grey[500],
31
- },
32
- green: {
33
- color: theme.palette.getContrastText(colors.green[500]),
34
- backgroundColor: colors.green[500],
35
- },
36
- amarelo: {
37
- color: theme.palette.getContrastText(colors.yellow[500]),
38
- backgroundColor: colors.yellow[500],
39
- },
40
- marrom: {
41
- color: theme.palette.getContrastText(colors.brown[500]),
42
- backgroundColor: colors.brown[500],
43
- },
44
- preto: {
45
- color: theme.palette.getContrastText(colors.grey['A400']),
46
- backgroundColor: colors.grey['A400'],
47
- },
48
- img: {
49
- border: '2px solid #FFF'
50
- },
51
- }));
8
+ const avatarColors = [deepOrange[500], deepPurple[500], blue[500], pink[500], grey[500], red[500], yellow[500], brown[500], grey['A400'], green[500]];
9
+ const normalizeSx = sx => sx ? (Array.isArray(sx) ? sx : [sx]) : [];
52
10
 
53
- const ArgousAvatar = React.forwardRef(({ nome, src, className, idUsuario, forwardedBlockSearch, ...props }, ref) => {
54
- const classes = useStyles();
55
- const cores = [classes.orange, classes.purple, classes.blue, classes.rosa, classes.cinza, classes.red, classes.amarelo, classes.marrom, classes.preto, classes.green];
11
+ const ArgousAvatar = React.forwardRef(({ nome, src, className, idUsuario, forwardedBlockSearch, sx, ...props }, ref) => {
12
+ const theme = useTheme();
56
13
  const [userImage, setUserImage] = useState(undefined);
57
14
 
58
15
  useEffect(() => {
59
- setUserImage(localStorage.getItem(`imgUsuario-${idUsuario}`) || '');
60
- if (!idUsuario || userImage || localStorage.getItem(`imgUsuario-${idUsuario}`) || forwardedBlockSearch?.return) return;
16
+ const storedUserImage = localStorage.getItem(`imgUsuario-${idUsuario}`) || '';
17
+ setUserImage(storedUserImage);
18
+ if (!idUsuario || storedUserImage || forwardedBlockSearch?.return) return;
61
19
  fetchToArgous('aguserimage', { idUsuario })
62
20
  .then(({ userImage }) => {
63
21
  if (userImage) {
@@ -65,9 +23,17 @@ const ArgousAvatar = React.forwardRef(({ nome, src, className, idUsuario, forwar
65
23
  localStorage.setItem(`imgUsuario-${idUsuario}`, userImage);
66
24
  } else localStorage.setItem(`imgUsuario-${idUsuario}`, '');
67
25
  });
68
- }, [idUsuario]);
26
+ }, [forwardedBlockSearch?.return, idUsuario]);
27
+
28
+ const color = avatarColors[getNumeroFromInitials(getInitials(nome), avatarColors.length)];
29
+ const avatarSx = src || userImage ? {
30
+ border: '2px solid #FFF'
31
+ } : {
32
+ color: theme.palette.getContrastText(color),
33
+ backgroundColor: color
34
+ };
69
35
 
70
- return <Avatar ref={ref} className={`${className} ${src || userImage ? classes.img : cores[getNumeroFromInitials(getInitials(nome), cores.length)]}`} {...props} src={src || userImage}>{getInitials(nome)}</Avatar>;
36
+ return <Avatar ref={ref} className={className} sx={[avatarSx, ...normalizeSx(sx)]} {...props} src={src || userImage}>{getInitials(nome)}</Avatar>;
71
37
  });
72
38
 
73
39
  ArgousAvatar.propTypes = {
@@ -76,4 +42,4 @@ ArgousAvatar.propTypes = {
76
42
  className: PropTypes.string
77
43
  };
78
44
 
79
- export default ArgousAvatar;
45
+ export default ArgousAvatar;
@@ -1,4 +1,4 @@
1
- import { SelectProps } from '@material-ui/core';
1
+ import { SelectProps } from '@mui/material';
2
2
  import * as React from 'react';
3
3
 
4
4
  export interface ArgousComplexPaginationProps {