argous 1.2.134 → 1.2.138

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 (263) hide show
  1. package/dist/actions/index.d.ts +58 -0
  2. package/dist/actions/index.js +59 -0
  3. package/dist/api/WebSocket.d.ts +25 -0
  4. package/dist/api/WebSocket.js +170 -0
  5. package/dist/api/index.d.ts +63 -0
  6. package/dist/api/index.js +762 -0
  7. package/dist/api/ws.d.ts +4 -0
  8. package/dist/api/ws.js +36 -0
  9. package/dist/components/Alert/Alert.d.ts +8 -0
  10. package/dist/components/Alert/Alert.js +68 -0
  11. package/dist/components/Alert/index.d.ts +2 -0
  12. package/dist/components/Alert/index.js +8 -0
  13. package/dist/components/ArgousAction/ArgousAction.d.ts +8 -0
  14. package/dist/components/ArgousAction/ArgousAction.js +87 -0
  15. package/dist/components/ArgousAction/index.d.ts +2 -0
  16. package/dist/components/ArgousAction/index.js +8 -0
  17. package/dist/components/ArgousAvatar/ArgousAvatar.d.ts +14 -0
  18. package/dist/components/ArgousAvatar/ArgousAvatar.js +124 -0
  19. package/dist/components/ArgousAvatar/index.d.ts +2 -0
  20. package/dist/components/ArgousAvatar/index.js +8 -0
  21. package/dist/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +76 -0
  22. package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +156 -0
  23. package/dist/components/ArgousComplexPagination/index.d.ts +2 -0
  24. package/dist/components/ArgousComplexPagination/index.js +8 -0
  25. package/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +131 -0
  26. package/dist/components/ArgousComplexTable/ArgousComplexTable.js +333 -0
  27. package/dist/components/ArgousComplexTable/index.d.ts +2 -0
  28. package/dist/components/ArgousComplexTable/index.js +8 -0
  29. package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +177 -0
  30. package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +155 -0
  31. package/dist/components/ArgousComplexTableBody/index.d.ts +2 -0
  32. package/dist/components/ArgousComplexTableBody/index.js +8 -0
  33. package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.d.ts +73 -0
  34. package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +88 -0
  35. package/dist/components/ArgousComplexTableHead/index.d.ts +2 -0
  36. package/dist/components/ArgousComplexTableHead/index.js +8 -0
  37. package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.d.ts +58 -0
  38. package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +70 -0
  39. package/dist/components/ArgousComplexTableToolbar/index.d.ts +2 -0
  40. package/dist/components/ArgousComplexTableToolbar/index.js +8 -0
  41. package/dist/components/ArgousInput/ArgousInput.d.ts +8 -0
  42. package/dist/components/ArgousInput/ArgousInput.js +578 -0
  43. package/dist/components/ArgousInput/index.d.ts +2 -0
  44. package/dist/components/ArgousInput/index.js +8 -0
  45. package/dist/components/ArgousPagination/ArgousPagination.d.ts +8 -0
  46. package/dist/components/ArgousPagination/ArgousPagination.js +29 -0
  47. package/dist/components/ArgousPagination/index.d.ts +2 -0
  48. package/dist/components/ArgousPagination/index.js +8 -0
  49. package/dist/components/ArgousProgressBar/ArgousProgressBar.d.ts +22 -0
  50. package/dist/components/ArgousProgressBar/ArgousProgressBar.js +162 -0
  51. package/dist/components/ArgousProgressBar/index.d.ts +2 -0
  52. package/dist/components/ArgousProgressBar/index.js +8 -0
  53. package/dist/components/ArgousSimpleTable/ArgousSimpleTable.d.ts +8 -0
  54. package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +201 -0
  55. package/dist/components/ArgousSimpleTable/index.d.ts +2 -0
  56. package/dist/components/ArgousSimpleTable/index.js +8 -0
  57. package/dist/components/AutoComplete/AutoComplete.d.ts +8 -0
  58. package/dist/components/AutoComplete/AutoComplete.js +185 -0
  59. package/dist/components/AutoComplete/index.d.ts +2 -0
  60. package/dist/components/AutoComplete/index.js +8 -0
  61. package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +20 -0
  62. package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +331 -0
  63. package/dist/components/AutoCompleteFavorites/index.d.ts +1 -0
  64. package/dist/components/AutoCompleteFavorites/index.js +8 -0
  65. package/dist/components/BarChart/BarChart.d.ts +8 -0
  66. package/dist/components/BarChart/BarChart.js +125 -0
  67. package/dist/components/BarChart/index.d.ts +2 -0
  68. package/dist/components/BarChart/index.js +8 -0
  69. package/dist/components/BarraFerramentas/BarraFerramentas.d.ts +21 -0
  70. package/dist/components/BarraFerramentas/BarraFerramentas.js +228 -0
  71. package/dist/components/BarraFerramentas/index.d.ts +2 -0
  72. package/dist/components/BarraFerramentas/index.js +8 -0
  73. package/dist/components/Button/Button.d.ts +8 -0
  74. package/dist/components/Button/Button.js +144 -0
  75. package/dist/components/Button/index.d.ts +2 -0
  76. package/dist/components/Button/index.js +8 -0
  77. package/dist/components/Cabecalho/Cabecalho.d.ts +8 -0
  78. package/dist/components/Cabecalho/Cabecalho.js +231 -0
  79. package/dist/components/Cabecalho/index.d.ts +2 -0
  80. package/dist/components/Cabecalho/index.js +8 -0
  81. package/dist/components/Calendar/Calendar.d.ts +8 -0
  82. package/dist/components/Calendar/Calendar.js +171 -0
  83. package/dist/components/Calendar/index.d.ts +2 -0
  84. package/dist/components/Calendar/index.js +8 -0
  85. package/dist/components/CartaoUsuario/CartaoUsuario.d.ts +9 -0
  86. package/dist/components/CartaoUsuario/CartaoUsuario.js +165 -0
  87. package/dist/components/CartaoUsuario/index.d.ts +2 -0
  88. package/dist/components/CartaoUsuario/index.js +8 -0
  89. package/dist/components/Collapse/Collapse.d.ts +60 -0
  90. package/dist/components/Collapse/Collapse.js +290 -0
  91. package/dist/components/Collapse/index.d.ts +3 -0
  92. package/dist/components/Collapse/index.js +8 -0
  93. package/dist/components/Compartilhar/Compartilhar.d.ts +7 -0
  94. package/dist/components/Compartilhar/Compartilhar.js +266 -0
  95. package/dist/components/Compartilhar/index.d.ts +2 -0
  96. package/dist/components/Compartilhar/index.js +8 -0
  97. package/dist/components/ConfirmModal/BasicModal.d.ts +38 -0
  98. package/dist/components/ConfirmModal/BasicModal.js +29 -0
  99. package/dist/components/ConfirmModal/ModalProvider.d.ts +5 -0
  100. package/dist/components/ConfirmModal/ModalProvider.js +108 -0
  101. package/dist/components/ConfirmModal/WrapperModal.d.ts +18 -0
  102. package/dist/components/ConfirmModal/WrapperModal.js +41 -0
  103. package/dist/components/ConfirmModal/index.d.ts +20 -0
  104. package/dist/components/ConfirmModal/index.js +25 -0
  105. package/dist/components/DropArea/DropArea.d.ts +21 -0
  106. package/dist/components/DropArea/DropArea.js +149 -0
  107. package/dist/components/DropArea/Html5FileSelector.d.ts +16 -0
  108. package/dist/components/DropArea/Html5FileSelector.js +229 -0
  109. package/dist/components/DropArea/index.d.ts +2 -0
  110. package/dist/components/DropArea/index.js +8 -0
  111. package/dist/components/Editor/Events.d.ts +79 -0
  112. package/dist/components/Editor/Events.js +9 -0
  113. package/dist/components/Editor/ScriptLoader.d.ts +20 -0
  114. package/dist/components/Editor/ScriptLoader.js +70 -0
  115. package/dist/components/Editor/TinyMCE.d.ts +10 -0
  116. package/dist/components/Editor/TinyMCE.js +16 -0
  117. package/dist/components/Editor/Utils.d.ts +19 -0
  118. package/dist/components/Editor/Utils.js +62 -0
  119. package/dist/components/Editor/components/Editor.d.ts +67 -0
  120. package/dist/components/Editor/components/Editor.js +351 -0
  121. package/dist/components/Editor/components/EditorPropTypes.d.ts +18 -0
  122. package/dist/components/Editor/components/EditorPropTypes.js +110 -0
  123. package/dist/components/Editor/index.d.ts +9 -0
  124. package/dist/components/Editor/index.js +12 -0
  125. package/dist/components/Editor/tinymce/tinymce.d.ts +2963 -0
  126. package/dist/components/FilePreparer/FilePreparer.d.ts +26 -0
  127. package/dist/components/FilePreparer/FilePreparer.js +279 -0
  128. package/dist/components/FilePreparer/index.d.ts +2 -0
  129. package/dist/components/FilePreparer/index.js +8 -0
  130. package/dist/components/FileUploader/FileUploader.d.ts +9 -0
  131. package/dist/components/FileUploader/FileUploader.js +445 -0
  132. package/dist/components/FileUploader/index.d.ts +2 -0
  133. package/dist/components/FileUploader/index.js +8 -0
  134. package/dist/components/FormVisualizer/FormVisualizer.d.ts +92 -0
  135. package/dist/components/FormVisualizer/FormVisualizer.js +264 -0
  136. package/dist/components/FormVisualizer/index.d.ts +2 -0
  137. package/dist/components/FormVisualizer/index.js +8 -0
  138. package/dist/components/Highlight/Highlight.d.ts +7 -0
  139. package/dist/components/Highlight/Highlight.js +75 -0
  140. package/dist/components/Highlight/index.d.ts +2 -0
  141. package/dist/components/Highlight/index.js +8 -0
  142. package/dist/components/ImageResize/ImageResize.d.ts +28 -0
  143. package/dist/components/ImageResize/ImageResize.js +472 -0
  144. package/dist/components/ImageResize/index.d.ts +2 -0
  145. package/dist/components/ImageResize/index.js +8 -0
  146. package/dist/components/ImageResizeButton/ImageResizeButton.d.ts +26 -0
  147. package/dist/components/ImageResizeButton/ImageResizeButton.js +89 -0
  148. package/dist/components/ImageResizeButton/index.d.ts +2 -0
  149. package/dist/components/ImageResizeButton/index.js +8 -0
  150. package/dist/components/Input/Input.d.ts +8 -0
  151. package/dist/components/Input/Input.js +328 -0
  152. package/dist/components/Input/index.d.ts +2 -0
  153. package/dist/components/Input/index.js +8 -0
  154. package/dist/components/InputTags/InputTags.d.ts +8 -0
  155. package/dist/components/InputTags/InputTags.js +129 -0
  156. package/dist/components/InputTags/index.d.ts +2 -0
  157. package/dist/components/InputTags/index.js +8 -0
  158. package/dist/components/ListSelect/ListSelect.d.ts +8 -0
  159. package/dist/components/ListSelect/ListSelect.js +126 -0
  160. package/dist/components/ListSelect/index.d.ts +2 -0
  161. package/dist/components/ListSelect/index.js +8 -0
  162. package/dist/components/MaterialButton/MaterialButton.d.ts +13 -0
  163. package/dist/components/MaterialButton/MaterialButton.js +192 -0
  164. package/dist/components/MaterialButton/index.d.ts +2 -0
  165. package/dist/components/MaterialButton/index.js +8 -0
  166. package/dist/components/MenuBar/MenuBar.d.ts +8 -0
  167. package/dist/components/MenuBar/MenuBar.js +157 -0
  168. package/dist/components/MenuBar/index.d.ts +2 -0
  169. package/dist/components/MenuBar/index.js +8 -0
  170. package/dist/components/MonthPicker/MonthPicker.d.ts +8 -0
  171. package/dist/components/MonthPicker/MonthPicker.js +288 -0
  172. package/dist/components/MonthPicker/index.d.ts +2 -0
  173. package/dist/components/MonthPicker/index.js +8 -0
  174. package/dist/components/MultipleSelect/MultipleSelect.d.ts +8 -0
  175. package/dist/components/MultipleSelect/MultipleSelect.js +139 -0
  176. package/dist/components/MultipleSelect/index.d.ts +2 -0
  177. package/dist/components/MultipleSelect/index.js +8 -0
  178. package/dist/components/OtpInput/OtpInput.d.ts +18 -0
  179. package/dist/components/OtpInput/OtpInput.js +207 -0
  180. package/dist/components/OtpInput/index.d.ts +2 -0
  181. package/dist/components/OtpInput/index.js +8 -0
  182. package/dist/components/OutputText/OutputText.d.ts +8 -0
  183. package/dist/components/OutputText/OutputText.js +89 -0
  184. package/dist/components/OutputText/index.d.ts +2 -0
  185. package/dist/components/OutputText/index.js +8 -0
  186. package/dist/components/Pagination/Pagination.d.ts +8 -0
  187. package/dist/components/Pagination/Pagination.js +64 -0
  188. package/dist/components/Pagination/index.d.ts +2 -0
  189. package/dist/components/Pagination/index.js +8 -0
  190. package/dist/components/Programa/Programa.d.ts +31 -0
  191. package/dist/components/Programa/Programa.js +201 -0
  192. package/dist/components/Programa/index.d.ts +2 -0
  193. package/dist/components/Programa/index.js +8 -0
  194. package/dist/components/ProgressBar/ProgressBar.d.ts +8 -0
  195. package/dist/components/ProgressBar/ProgressBar.js +98 -0
  196. package/dist/components/ProgressBar/index.d.ts +2 -0
  197. package/dist/components/ProgressBar/index.js +8 -0
  198. package/dist/components/Select/Select.d.ts +8 -0
  199. package/dist/components/Select/Select.js +142 -0
  200. package/dist/components/Select/index.d.ts +2 -0
  201. package/dist/components/Select/index.js +8 -0
  202. package/dist/components/SimpleTable/SimpleTable.d.ts +13 -0
  203. package/dist/components/SimpleTable/SimpleTable.js +390 -0
  204. package/dist/components/SimpleTable/index.d.ts +2 -0
  205. package/dist/components/SimpleTable/index.js +10 -0
  206. package/dist/components/Stepper/Stepper.d.ts +54 -0
  207. package/dist/components/Stepper/Stepper.js +157 -0
  208. package/dist/components/Stepper/index.d.ts +2 -0
  209. package/dist/components/Stepper/index.js +8 -0
  210. package/dist/components/TablePicker/TablePicker.d.ts +8 -0
  211. package/dist/components/TablePicker/TablePicker.js +222 -0
  212. package/dist/components/TablePicker/index.d.ts +2 -0
  213. package/dist/components/TablePicker/index.js +8 -0
  214. package/dist/components/Tabs/Tabs.d.ts +8 -0
  215. package/dist/components/Tabs/Tabs.js +76 -0
  216. package/dist/components/Tabs/index.d.ts +2 -0
  217. package/dist/components/Tabs/index.js +8 -0
  218. package/dist/components/TextArea/TextArea.d.ts +8 -0
  219. package/dist/components/TextArea/TextArea.js +148 -0
  220. package/dist/components/TextArea/index.d.ts +2 -0
  221. package/dist/components/TextArea/index.js +8 -0
  222. package/dist/components/ThreadLog/ThreadLog.d.ts +8 -0
  223. package/dist/components/ThreadLog/ThreadLog.js +225 -0
  224. package/dist/components/ThreadLog/index.d.ts +2 -0
  225. package/dist/components/ThreadLog/index.js +8 -0
  226. package/dist/components/UtilAutoComplete/UtilAutoComplete.d.ts +93 -0
  227. package/dist/components/UtilAutoComplete/UtilAutoComplete.js +188 -0
  228. package/dist/components/UtilAutoComplete/index.d.ts +2 -0
  229. package/dist/components/UtilAutoComplete/index.js +8 -0
  230. package/dist/components/index.d.ts +148 -0
  231. package/dist/components/index.js +165 -0
  232. package/dist/fieldsRedux/createField.d.ts +8 -0
  233. package/dist/fieldsRedux/createField.js +149 -0
  234. package/dist/fieldsRedux/fieldsRedux.d.ts +71 -0
  235. package/dist/fieldsRedux/fieldsRedux.js +436 -0
  236. package/dist/fieldsRedux/index.d.ts +4 -0
  237. package/dist/fieldsRedux/index.js +27 -0
  238. package/dist/fieldsRedux/passFields.d.ts +5 -0
  239. package/dist/fieldsRedux/passFields.js +107 -0
  240. package/dist/reducers/argous.d.ts +76 -0
  241. package/dist/reducers/argous.js +63 -0
  242. package/dist/reducers/index.d.ts +4 -0
  243. package/dist/reducers/index.js +9 -0
  244. package/dist/types.d.ts +144 -0
  245. package/dist/utils/api.d.ts +29 -0
  246. package/dist/utils/api.js +255 -0
  247. package/dist/utils/config.d.ts +3 -0
  248. package/dist/utils/config.js +13 -0
  249. package/dist/utils/date.d.ts +8 -0
  250. package/dist/utils/date.js +60 -0
  251. package/dist/utils/index.d.ts +61 -0
  252. package/dist/utils/index.js +383 -0
  253. package/dist/utils/rippleEffect.d.ts +2 -0
  254. package/dist/utils/rippleEffect.js +173 -0
  255. package/dist/utils/store.d.ts +3 -0
  256. package/dist/utils/store.js +12 -0
  257. package/dist/utils/xmlToJson.d.ts +2 -0
  258. package/dist/utils/xmlToJson.js +158 -0
  259. package/lib/api/index.js +16 -0
  260. package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.js +298 -0
  261. package/lib/components/AutoCompleteFavorites/index.js +1 -0
  262. package/lib/components/index.js +4 -1
  263. package/package.json +1 -1
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var argous = function (state, action) {
15
+ var _a, _b, _c, _d;
16
+ if (state === void 0) { state = {
17
+ usuarioLogado: {},
18
+ loading: true,
19
+ processos: [],
20
+ favorites: [],
21
+ initialPage: '/',
22
+ fields: {},
23
+ block: false,
24
+ vldPsw: false,
25
+ sidebar: true
26
+ }; }
27
+ switch (action.type) {
28
+ case 'setUsuarioLogado':
29
+ return __assign(__assign({}, state), { usuarioLogado: action.usuarioLogado });
30
+ case 'setLoading':
31
+ return __assign(__assign({}, state), { loading: action.loading });
32
+ case 'setProcesso':
33
+ return __assign(__assign({}, state), { processos: action.processo });
34
+ case 'setNotificacao':
35
+ return __assign(__assign({}, state), { notificacao: action.notificacao });
36
+ case 'setInitialPage':
37
+ return __assign(__assign({}, state), { initialPage: action.initialPage });
38
+ case 'setCurrentProgram':
39
+ return __assign(__assign({}, state), { currentProgram: action.currentProgram });
40
+ case 'setCurrentField':
41
+ return __assign(__assign({}, state), { fields: state.fields[action.program]
42
+ ? __assign(__assign({}, state.fields), (_a = {}, _a[action.program] = __assign(__assign({}, state.fields[action.program]), (_b = {}, _b[action.field] = action.value, _b)), _a)) : __assign(__assign({}, state.fields), (_c = {}, _c[action.program] = (_d = {},
43
+ _d[action.field] = action.value,
44
+ _d), _c)) });
45
+ case 'clearAllFields':
46
+ return __assign(__assign({}, state), { fields: {} });
47
+ case 'setFields':
48
+ return __assign(__assign({}, state), { fields: action.fields });
49
+ case 'setFavorites':
50
+ return __assign(__assign({}, state), { favorites: action.favorites });
51
+ case 'setBlockUser':
52
+ return __assign(__assign({}, state), { block: action.block });
53
+ case 'setVldPsw':
54
+ return __assign(__assign({}, state), { block: action.vldPsw });
55
+ case 'setSidebar':
56
+ return __assign(__assign({}, state), { sidebar: action.sidebar });
57
+ case 'setMensagensNaoLidas':
58
+ return __assign(__assign({}, state), { mensagensNaoLidas: action.mensagensNaoLidas });
59
+ default:
60
+ return state;
61
+ }
62
+ };
63
+ exports.default = argous;
@@ -0,0 +1,4 @@
1
+ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
2
+ argous: never;
3
+ }>, import("../types").ActionType>;
4
+ export default reducers;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var argous_1 = __importDefault(require("./argous"));
7
+ var redux_1 = require("redux");
8
+ var reducers = redux_1.combineReducers({ argous: argous_1.default });
9
+ exports.default = reducers;
@@ -0,0 +1,144 @@
1
+ import { BasicModalProps } from './components';
2
+ import { Store } from 'redux';
3
+
4
+ export type argousConfig = {
5
+ ssl: boolean,
6
+ ip: string,
7
+ ipImagePosts?: string,
8
+ codigoCliente: string,
9
+ path?: string
10
+ }
11
+
12
+ export interface UsuarioLogado {
13
+ habGrupo?: boolean,
14
+ habChat?: boolean,
15
+ habProcesso?: boolean,
16
+ habFavorito?: boolean,
17
+ habNotificacao?: boolean,
18
+ email?: string,
19
+ funcao?: string,
20
+ idFornecedorInterno?: number,
21
+ idUsuario?: number,
22
+ nome?: string,
23
+ ramal?: string,
24
+ publTL?: boolean,
25
+ imagem?: string,
26
+ imagemCapa?: string
27
+ }
28
+
29
+ interface PromiseOptions extends BasicModalProps{
30
+ resolve: (value: boolean | PromiseLike<boolean>) => void,
31
+ reject: (reason?: any) => void
32
+ }
33
+ export interface ArgousSystemType {
34
+ WSHandler: { onMessage: (params: any) => void },
35
+ headerState: { value?: 'min' },
36
+ pessoasChatOpen: { value: boolean },
37
+ janelaChatOpen?: {
38
+ idUsuario: number,
39
+ idSala: number,
40
+ titulo: string,
41
+ subtitulo: string,
42
+ online: boolean,
43
+ msgsNaoLidas: number
44
+ },
45
+ systemTopAlert?: Record<string, any>,
46
+ openModal?: PromiseOptions,
47
+ [other: string]: Record<string, any> | undefined
48
+ }
49
+
50
+ export interface FieldsType {
51
+ argousSystem: ArgousSystemType,
52
+ [program: string]: Record<string, any> | undefined
53
+ }
54
+
55
+ export interface ArgousType {
56
+ block: boolean,
57
+ currentProgram: string,
58
+ favorites: any[],
59
+ fields: FieldsType,
60
+ initialPage: string,
61
+ loading: boolean,
62
+ processos: any[],
63
+ sidebar: boolean
64
+ usuarioLogado: UsuarioLogado,
65
+ vldPsw: boolean
66
+ }
67
+ export interface StoreState {
68
+ argous: ArgousType
69
+ }
70
+
71
+ export type ArgousStore = Store<StoreState, ActionType>
72
+
73
+ interface setUsuarioLogado {
74
+ type: 'setUsuarioLogado',
75
+ usuarioLogado: UsuarioLogado
76
+ }
77
+
78
+ interface setLoading {
79
+ type: 'setLoading',
80
+ loading: boolean
81
+ }
82
+
83
+ interface setProcesso {
84
+ type: 'setProcesso',
85
+ processo: any
86
+ }
87
+
88
+ interface setInitialPage {
89
+ type: 'setInitialPage',
90
+ initialPage: string
91
+ }
92
+
93
+ interface setCurrentProgram {
94
+ type: 'setCurrentProgram',
95
+ currentProgram: string
96
+ }
97
+
98
+ interface setCurrentField {
99
+ type: 'setCurrentField',
100
+ program: string,
101
+ field: string,
102
+ value: any
103
+ }
104
+
105
+ interface clearAllFields {
106
+ type: 'clearAllFields'
107
+ }
108
+
109
+ interface setFields {
110
+ type: 'setFields',
111
+ fields: any
112
+ }
113
+
114
+ interface setFavorites {
115
+ type: 'setFavorites',
116
+ favorites: any[]
117
+ }
118
+
119
+ interface setBlockUser {
120
+ type: 'setBlockUser',
121
+ block: boolean
122
+ }
123
+
124
+ interface setNotificacao {
125
+ type: 'setNotificacao',
126
+ notificacao: any
127
+ }
128
+
129
+ interface setSidebar {
130
+ type: 'setSidebar',
131
+ sidebar: boolean
132
+ }
133
+
134
+ interface setMensagensNaoLidas {
135
+ type: 'setMensagensNaoLidas',
136
+ mensagensNaoLidas: number
137
+ }
138
+
139
+ interface setVldPsw {
140
+ type: 'setVldPsw',
141
+ vldPsw: boolean
142
+ }
143
+
144
+ export type ActionType = setUsuarioLogado|setLoading|setProcesso|setInitialPage|setCurrentProgram|setCurrentField|clearAllFields|setFields|setFavorites|setBlockUser|setNotificacao|setSidebar|setMensagensNaoLidas|setVldPsw
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @deprecated
3
+ */
4
+ export declare const getServerValue: (field: string) => Promise<any>;
5
+ /**
6
+ * @deprecated
7
+ *
8
+ * @param {string} field - String
9
+ * @param {any} value - Valor
10
+ *
11
+ * @returns {Promise<any>} retorno
12
+ */
13
+ export declare const setServerValue: (field: string, value: any) => Promise<any>;
14
+ export declare const enableDebugger: () => void;
15
+ export declare const serverAction: (metodo: string, dados?: {}, pgCode?: string | boolean | undefined, tratarErro?: string | boolean | undefined) => Promise<any>;
16
+ export declare function setAlert(mensagem: string, type: 'error' | 'success' | 'info' | 'warning', title: string, time?: number): void;
17
+ export declare function setError(mensagem: string, title?: string): void;
18
+ export declare function setSuccess(mensagem: string, title: string, time?: number): void;
19
+ export declare function setInfo(mensagem: string, title: string, time?: number): void;
20
+ export declare function setWarning(mensagem: string, title: string, time?: number): void;
21
+ export declare function sendNotification({ id, mensagem, title, type, link, dsLabel }: {
22
+ id: string | number;
23
+ mensagem: string;
24
+ title: string;
25
+ type: string;
26
+ link: string;
27
+ dsLabel: string;
28
+ }): void;
29
+ export declare const getUrlParameters: (pgCode?: string | undefined) => Promise<any>;
@@ -0,0 +1,255 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getUrlParameters = exports.sendNotification = exports.setWarning = exports.setInfo = exports.setSuccess = exports.setError = exports.setAlert = exports.serverAction = exports.enableDebugger = exports.setServerValue = exports.getServerValue = void 0;
40
+ var config_1 = require("./config");
41
+ var store_1 = require("./store");
42
+ var api_1 = require("../api");
43
+ var fieldsRedux_1 = require("../fieldsRedux");
44
+ var getCurrentProgram = function (n) {
45
+ if (n === void 0) { n = 0; }
46
+ return __awaiter(void 0, void 0, void 0, function () {
47
+ var state, currentProgram;
48
+ return __generator(this, function (_a) {
49
+ state = store_1.getStore().getState();
50
+ currentProgram = state.argous.currentProgram;
51
+ if (!currentProgram) {
52
+ return [2 /*return*/, new Promise(function (resolve, reject) {
53
+ if (n >= 10)
54
+ reject(console.error('getServerValue, setServerValue ou serverAction chamado antes do mount do Programa. Use programDidMount().'));
55
+ setTimeout(function () { return __awaiter(void 0, void 0, void 0, function () {
56
+ var _a;
57
+ return __generator(this, function (_b) {
58
+ switch (_b.label) {
59
+ case 0:
60
+ _a = resolve;
61
+ return [4 /*yield*/, getCurrentProgram(n++)];
62
+ case 1:
63
+ _a.apply(void 0, [_b.sent()]);
64
+ return [2 /*return*/];
65
+ }
66
+ });
67
+ }); }, 100);
68
+ })];
69
+ }
70
+ return [2 /*return*/, currentProgram];
71
+ });
72
+ });
73
+ };
74
+ /**
75
+ * @deprecated
76
+ */
77
+ var getServerValue = function (field) { return __awaiter(void 0, void 0, void 0, function () {
78
+ var currentProgram, res, value;
79
+ return __generator(this, function (_a) {
80
+ switch (_a.label) {
81
+ case 0: return [4 /*yield*/, getCurrentProgram()];
82
+ case 1:
83
+ currentProgram = _a.sent();
84
+ return [4 /*yield*/, api_1.agGet({ pgCode: currentProgram, field: field })];
85
+ case 2:
86
+ res = _a.sent();
87
+ if (res.pgmOk) {
88
+ value = res[field];
89
+ try {
90
+ value = typeof value === 'object'
91
+ ? value : JSON.parse(value);
92
+ }
93
+ catch (err) { }
94
+ return [2 /*return*/, value];
95
+ }
96
+ return [2 /*return*/, ''];
97
+ }
98
+ });
99
+ }); };
100
+ exports.getServerValue = getServerValue;
101
+ /**
102
+ * @deprecated
103
+ *
104
+ * @param {string} field - String
105
+ * @param {any} value - Valor
106
+ *
107
+ * @returns {Promise<any>} retorno
108
+ */
109
+ var setServerValue = function (field, value) { return __awaiter(void 0, void 0, void 0, function () {
110
+ var currentProgram, res;
111
+ var _a;
112
+ return __generator(this, function (_b) {
113
+ switch (_b.label) {
114
+ case 0: return [4 /*yield*/, getCurrentProgram()];
115
+ case 1:
116
+ currentProgram = _b.sent();
117
+ return [4 /*yield*/, api_1.agSet((_a = { pgCode: currentProgram }, _a[field] = value, _a))];
118
+ case 2:
119
+ res = _b.sent();
120
+ return [2 /*return*/, !!res.pgmOk];
121
+ }
122
+ });
123
+ }); };
124
+ exports.setServerValue = setServerValue;
125
+ var debuging = false;
126
+ var enableDebugger = function () {
127
+ debuging = true;
128
+ };
129
+ exports.enableDebugger = enableDebugger;
130
+ var serverAction = function (metodo, dados, pgCode, tratarErro) {
131
+ if (dados === void 0) { dados = {}; }
132
+ return __awaiter(void 0, void 0, void 0, function () {
133
+ var code, tErro, currentProgram, _a, data, res;
134
+ return __generator(this, function (_b) {
135
+ switch (_b.label) {
136
+ case 0:
137
+ code = typeof pgCode === 'string' ? pgCode : typeof tratarErro === 'string' ? tratarErro : undefined;
138
+ tErro = typeof tratarErro === 'boolean' ? tratarErro : typeof pgCode === 'boolean' ? pgCode : false;
139
+ _a = code;
140
+ if (_a) return [3 /*break*/, 2];
141
+ return [4 /*yield*/, getCurrentProgram()];
142
+ case 1:
143
+ _a = (_b.sent());
144
+ _b.label = 2;
145
+ case 2:
146
+ currentProgram = _a;
147
+ data = {
148
+ pgCode: currentProgram,
149
+ action: metodo,
150
+ dados: dados
151
+ };
152
+ return [4 /*yield*/, api_1.action(data)];
153
+ case 3:
154
+ res = _b.sent();
155
+ if (debuging && process.env.NODE_ENV !== 'production') {
156
+ console.log('-------- Server Action ---------');
157
+ console.log('pgCode: ', currentProgram);
158
+ console.log('action: ', metodo);
159
+ console.log('dados: ', dados);
160
+ console.log('res: ', res);
161
+ if (res.dsErro)
162
+ console.error(res.dsErro);
163
+ console.log('--------------------------------');
164
+ }
165
+ if (res.dsErro && tErro)
166
+ setError(res.dsErro);
167
+ if (res.chTkn)
168
+ document.cookie = "lt=" + res.chTkn + ";path=/;SameSite=Lax;" + (config_1.getConfig().ssl ? 'secure' : '');
169
+ if (res.blkTkn) {
170
+ setInfo(res.blkTkn, 'Justificativa de Bloqueio', 0);
171
+ window.localStorage.setItem('blkUs', JSON.stringify(store_1.getStore().getState().argous.usuarioLogado));
172
+ store_1.getStore().dispatch({ type: 'setUsuarioLogado', usuarioLogado: {} });
173
+ document.cookie = "lt=;path=/;SameSite=Lax;" + (config_1.getConfig().ssl ? 'secure' : '');
174
+ store_1.getStore().dispatch({ type: 'setBlockUser', block: true });
175
+ }
176
+ if (res.vldPsw)
177
+ store_1.getStore().dispatch({ type: 'setVldPsw', vldPsw: true });
178
+ return [2 /*return*/, res];
179
+ }
180
+ });
181
+ });
182
+ };
183
+ exports.serverAction = serverAction;
184
+ function setAlert(mensagem, type, title, time) {
185
+ if (time === void 0) { time = 5000; }
186
+ setTimeout(function () {
187
+ fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: type, title: title, time: time }, 'argousSystem');
188
+ }, 0);
189
+ }
190
+ exports.setAlert = setAlert;
191
+ function setError(mensagem, title) {
192
+ if (title === void 0) { title = 'Erro'; }
193
+ setTimeout(function () {
194
+ fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: 'error', title: title }, 'argousSystem');
195
+ }, 0);
196
+ }
197
+ exports.setError = setError;
198
+ function setSuccess(mensagem, title, time) {
199
+ if (time === void 0) { time = 5000; }
200
+ setTimeout(function () {
201
+ fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: 'success', title: title, time: time }, 'argousSystem');
202
+ }, 0);
203
+ }
204
+ exports.setSuccess = setSuccess;
205
+ function setInfo(mensagem, title, time) {
206
+ if (time === void 0) { time = 5000; }
207
+ setTimeout(function () {
208
+ fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: 'info', title: title, time: time }, 'argousSystem');
209
+ }, 0);
210
+ }
211
+ exports.setInfo = setInfo;
212
+ function setWarning(mensagem, title, time) {
213
+ if (time === void 0) { time = 5000; }
214
+ setTimeout(function () {
215
+ fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: 'warning', title: title, time: time }, 'argousSystem');
216
+ }, 0);
217
+ }
218
+ exports.setWarning = setWarning;
219
+ function sendNotification(_a) {
220
+ var id = _a.id, mensagem = _a.mensagem, title = _a.title, type = _a.type, link = _a.link, dsLabel = _a.dsLabel;
221
+ setTimeout(function () {
222
+ fieldsRedux_1.setAnotherProgramField('systemTopAlert', { type: 'notification', id: id, mensagem: mensagem, title: title, link: link, dsLabel: dsLabel, icon: type }, 'argousSystem');
223
+ }, 0);
224
+ }
225
+ exports.sendNotification = sendNotification;
226
+ var getUrlVars = function () {
227
+ var vars = {};
228
+ window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (_, key, value) {
229
+ vars[key] = value;
230
+ return '';
231
+ });
232
+ return vars;
233
+ };
234
+ var deleteURLParameters = function () {
235
+ var params = window.location.href;
236
+ var pos = params.indexOf('?');
237
+ if (pos > 0)
238
+ params = params.substring(0, pos);
239
+ window.history.replaceState('object or string', 'Title', params);
240
+ };
241
+ var getUrlParameters = function (pgCode) { return __awaiter(void 0, void 0, void 0, function () {
242
+ var urlPrms;
243
+ return __generator(this, function (_a) {
244
+ switch (_a.label) {
245
+ case 0:
246
+ urlPrms = getUrlVars();
247
+ if (!urlPrms.ctrl) return [3 /*break*/, 2];
248
+ deleteURLParameters();
249
+ return [4 /*yield*/, exports.serverAction('getURLParameters', { ctrl: urlPrms.ctrl }, pgCode, true)];
250
+ case 1: return [2 /*return*/, _a.sent()];
251
+ case 2: return [2 /*return*/];
252
+ }
253
+ });
254
+ }); };
255
+ exports.getUrlParameters = getUrlParameters;
@@ -0,0 +1,3 @@
1
+ import { argousConfig } from '../types';
2
+ export declare function setConfig(providedConfig: argousConfig, callback?: () => any): void;
3
+ export declare function getConfig(): argousConfig;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfig = exports.setConfig = void 0;
4
+ var config;
5
+ function setConfig(providedConfig, callback) {
6
+ config = providedConfig;
7
+ callback && callback();
8
+ }
9
+ exports.setConfig = setConfig;
10
+ function getConfig() {
11
+ return config;
12
+ }
13
+ exports.getConfig = getConfig;
@@ -0,0 +1,8 @@
1
+ export declare const getMonthName: (nr: number) => "" | "Janeiro" | "Fevereiro" | "Março" | "Abril" | "Maio" | "Junho" | "Julho" | "Agosto" | "Setembro" | "Outubro" | "Novembro" | "Dezembro";
2
+ export declare const getDayName: (day: number) => "Segunda" | "Terça" | "Quarta" | "Quinta" | "Sexta" | "Sábado" | "Domingo";
3
+ export declare const convertMinutesToHour: (minutes: number) => string;
4
+ export declare const sqlDateToReadableDate: (sqlDate: string) => {
5
+ date: string;
6
+ hour: string;
7
+ };
8
+ export declare const fixInvalidDate: (date: string) => string;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fixInvalidDate = exports.sqlDateToReadableDate = exports.convertMinutesToHour = exports.getDayName = exports.getMonthName = void 0;
4
+ var _1 = require(".");
5
+ var getMonthName = function (nr) {
6
+ switch (nr) {
7
+ case 0: return 'Janeiro';
8
+ case 1: return 'Fevereiro';
9
+ case 2: return 'Março';
10
+ case 3: return 'Abril';
11
+ case 4: return 'Maio';
12
+ case 5: return 'Junho';
13
+ case 6: return 'Julho';
14
+ case 7: return 'Agosto';
15
+ case 8: return 'Setembro';
16
+ case 9: return 'Outubro';
17
+ case 10: return 'Novembro';
18
+ case 11: return 'Dezembro';
19
+ default: return '';
20
+ }
21
+ };
22
+ exports.getMonthName = getMonthName;
23
+ var getDayName = function (day) {
24
+ switch (day) {
25
+ case 1: return 'Segunda';
26
+ case 2: return 'Terça';
27
+ case 3: return 'Quarta';
28
+ case 4: return 'Quinta';
29
+ case 5: return 'Sexta';
30
+ case 6: return 'Sábado';
31
+ default: return 'Domingo';
32
+ }
33
+ };
34
+ exports.getDayName = getDayName;
35
+ var convertMinutesToHour = function (minutes) {
36
+ var dtAux = new Date(0, 0, 0, 0, 0, 0, 0);
37
+ dtAux.setMinutes(minutes);
38
+ return _1.addExtraZero(dtAux.getHours()) + ":" + _1.addExtraZero(dtAux.getMinutes());
39
+ };
40
+ exports.convertMinutesToHour = convertMinutesToHour;
41
+ var sqlDateToReadableDate = function (sqlDate) {
42
+ var readableDate = { date: '', hour: '' };
43
+ if (sqlDate.length > 10) {
44
+ var date = sqlDate.slice(0, 10).split('-');
45
+ readableDate.date = date[2] + "/" + date[1] + "/" + date[0];
46
+ if (sqlDate.indexOf(' ') > -1) {
47
+ var hour = sqlDate.split(' ')[1].split(':');
48
+ readableDate.hour = hour[0] + ":" + hour[1];
49
+ }
50
+ }
51
+ return readableDate;
52
+ };
53
+ exports.sqlDateToReadableDate = sqlDateToReadableDate;
54
+ var fixInvalidDate = function (date) {
55
+ if (!date || typeof date !== 'string')
56
+ return date;
57
+ var splitDate = date.split(' ');
58
+ return splitDate[0] + " " + splitDate[1].split(':').map(function (t) { return _1.addExtraZero(t); }).join(':');
59
+ };
60
+ exports.fixInvalidDate = fixInvalidDate;
@@ -0,0 +1,61 @@
1
+ import { ActionType, ArgousType } from '../types';
2
+ import { ChartOptions } from 'chart.js';
3
+ import { BasicModalProps } from 'lib/components';
4
+ import React from 'react';
5
+ export declare const widthToCenterVertically: (content: number) => number;
6
+ export declare const getCookie: (cName: string) => string;
7
+ export declare const addExtraZero: (vl: number | string) => string | number;
8
+ export declare const formataNome: (value: string) => string;
9
+ export declare function downloadBase64(base64: string, fileName: string, fileExtension: string): void;
10
+ /**
11
+ * Função faz o download de qualquer url
12
+ *
13
+ * @param {string} url - Url a ser baixada
14
+ * @param {string} fileName - Nome do arquivo baixado
15
+ * @param {string=} fileExtension - Extenção do arquivo baixado
16
+ *
17
+ * @returns {void}
18
+ */
19
+ export declare function downloadFromUrl(url: string, fileName: string, fileExtension?: string): Promise<void>;
20
+ export declare const printPdf: (URL?: string) => Promise<void>;
21
+ export declare const getRandomColor: () => string;
22
+ export declare const getInitials: (nome?: string) => string;
23
+ export declare const getNumeroFromInitials: (initials: string, length: number) => number;
24
+ export declare const usePrevious: (value: any) => undefined;
25
+ /**
26
+ * Igual o useEffect, mas não ativa quando o componente monta
27
+ *
28
+ * @param {React.EffectCallback} effect - Função imperativa que pode retornar uma função de limpeza
29
+ * @param {React.DependencyList} dependencies - Dependencias que quando atualizadas rodarão o efeito
30
+ *
31
+ * @returns {void} Sem retorno
32
+ */
33
+ export declare function useUpdateEffect(effect: React.EffectCallback, dependencies: React.DependencyList): void;
34
+ export declare function formataDinheiro(n: number): string;
35
+ export declare const sanitizaHTML: (html?: string) => string;
36
+ /**
37
+ * Format bytes as human-readable text.
38
+ *
39
+ * @param {number} bytes - Number of bytes.
40
+ * @param {boolean} si - True to use metric (SI) units, aka powers of 1000. False to use binary (IEC) units, aka powers of 1024.
41
+ * @param {number} dp - Number of decimal places to display.
42
+ *
43
+ * @returns {string} Formatted string.
44
+ */
45
+ export declare const humanFileSize: (bytes: number, si?: boolean, dp?: number) => string;
46
+ export declare const randomColor: () => string;
47
+ /**
48
+ * Hook para padronizar o tema dos gráficos
49
+ *
50
+ * @param {ChartOptions} props - Props customizados
51
+ * @returns {ChartOptions} - retorno com tema ajustado
52
+ */
53
+ export declare const useGraph: ({ title, legend: { labels, ...legend }, plugins: { datalabels, ...plugins }, scales: { yAxes: [{ ticks: yticks, gridLines: ygridLines, ...yAxes }, ...y], xAxes: [{ ticks: xticks, gridLines: xgridLines, ...xAxes }, ...x], ...scales }, ...props }?: ChartOptions) => ChartOptions;
54
+ export declare const useModal: () => import("lib/components").ModalProviderContextProps;
55
+ export declare const useStore: () => ArgousType;
56
+ export declare const reduxDispatch: (action: ActionType) => void;
57
+ export declare const formataTelefone: (value: string) => string;
58
+ export declare const useWebSocket: () => {};
59
+ export declare const formataCpf: (value: string) => string;
60
+ export declare const copyToClipboard: (text: string) => void;
61
+ export declare const confirm: (props: BasicModalProps | string) => Promise<boolean>;