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.
- package/dist/api/WebSocket.d.ts +18 -10
- package/dist/api/WebSocket.js +26 -18
- package/dist/api/index.js +54 -43
- package/dist/api/ws.d.ts +1 -1
- package/dist/api/ws.js +44 -3
- package/dist/components/Alert/Alert.js +17 -7
- package/dist/components/ArgousAction/ArgousAction.js +17 -7
- package/dist/components/ArgousAvatar/ArgousAvatar.d.ts +1 -1
- package/dist/components/ArgousAvatar/ArgousAvatar.js +44 -60
- package/dist/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +1 -1
- package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +107 -81
- package/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -1
- package/dist/components/ArgousComplexTable/ArgousComplexTable.js +39 -52
- package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +1 -1
- package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +119 -97
- package/dist/components/ArgousComplexTableBody/DragAndDrop.d.ts +37 -0
- package/dist/components/ArgousComplexTableBody/DragAndDrop.js +156 -0
- package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +64 -47
- package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +55 -37
- package/dist/components/ArgousInput/ArgousInput.js +19 -9
- package/dist/components/ArgousPagination/ArgousPagination.js +18 -11
- package/dist/components/ArgousProgressBar/ArgousProgressBar.js +64 -74
- package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +28 -22
- package/dist/components/AutoComplete/AutoComplete.js +18 -9
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +3 -4
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +226 -174
- package/dist/components/BarChart/BarChart.js +17 -7
- package/dist/components/BarraFerramentas/BarraFerramentas.js +119 -105
- package/dist/components/Button/Button.js +17 -7
- package/dist/components/Cabecalho/Cabecalho.js +17 -7
- package/dist/components/Calendar/Calendar.js +24 -41
- package/dist/components/Cam/Cam.js +19 -9
- package/dist/components/Carousel/Carousel.js +113 -103
- package/dist/components/CartaoUsuario/CartaoUsuario.js +36 -26
- package/dist/components/Collapse/Collapse.d.ts +3 -3
- package/dist/components/Collapse/Collapse.js +121 -71
- package/dist/components/Compartilhar/Compartilhar.js +70 -65
- package/dist/components/ConfirmModal/BasicModal.d.ts +1 -1
- package/dist/components/ConfirmModal/BasicModal.js +8 -8
- package/dist/components/ConfirmModal/ModalProvider.d.ts +12 -1
- package/dist/components/ConfirmModal/ModalProvider.js +17 -7
- package/dist/components/ConfirmModal/WrapperModal.d.ts +2 -2
- package/dist/components/ConfirmModal/WrapperModal.js +5 -5
- package/dist/components/ContactValidationInput/ContactValidationInput.d.ts +1 -1
- package/dist/components/ContactValidationInput/ContactValidationInput.js +105 -80
- package/dist/components/ContactValidationInput/SealModal.d.ts +1 -1
- package/dist/components/ContactValidationInput/SealModal.js +13 -20
- package/dist/components/Document/Icons.d.ts +2 -2
- package/dist/components/Document/Icons.js +33 -16
- package/dist/components/Document/ModalVisualizacaoDocumentos.d.ts +1 -1
- package/dist/components/Document/ModalVisualizacaoDocumentos.js +33 -17
- package/dist/components/Document/Visualizacao.d.ts +1 -1
- package/dist/components/Document/Visualizacao.js +48 -34
- package/dist/components/DropArea/DropArea.js +27 -12
- package/dist/components/DropArea/Html5FileSelector.js +6 -7
- package/dist/components/Editor/ScriptLoader2.d.ts +1 -1
- package/dist/components/Editor/ScriptLoader2.js +2 -2
- package/dist/components/Editor/Utils.d.ts +3 -3
- package/dist/components/Editor/Utils.js +2 -2
- package/dist/components/Editor/components/Editor.d.ts +1 -1
- package/dist/components/Editor/components/Editor.js +18 -9
- package/dist/components/Editor/components/EditorPropTypes.js +17 -7
- package/dist/components/FilePreparer/FilePreparer.d.ts +1 -1
- package/dist/components/FilePreparer/FilePreparer.js +105 -88
- package/dist/components/FileUploader/FileUploader.js +33 -22
- package/dist/components/FormVisualizer/FormVisualizer.d.ts +5 -7
- package/dist/components/FormVisualizer/FormVisualizer.js +92 -61
- package/dist/components/HalfGauge/HalfGauge.js +87 -135
- package/dist/components/Highlight/Highlight.js +23 -12
- package/dist/components/ImageResize/ImageResize.d.ts +1 -1
- package/dist/components/ImageResize/ImageResize.js +79 -85
- package/dist/components/ImageResizeButton/ImageResizeButton.d.ts +1 -1
- package/dist/components/ImageResizeButton/ImageResizeButton.js +19 -9
- package/dist/components/Input/Input.js +19 -9
- package/dist/components/InputTags/InputTags.js +22 -13
- package/dist/components/ListSelect/ListSelect.js +17 -7
- package/dist/components/MaterialButton/MaterialButton.d.ts +2 -4
- package/dist/components/MaterialButton/MaterialButton.js +56 -125
- package/dist/components/MenuBar/MenuBar.js +17 -7
- package/dist/components/MonthPicker/MonthPicker.js +20 -10
- package/dist/components/MultipleSelect/MultipleSelect.js +17 -7
- package/dist/components/OtpInput/OtpInput.d.ts +1 -1
- package/dist/components/OtpInput/OtpInput.js +71 -58
- package/dist/components/OutputText/OutputText.js +17 -7
- package/dist/components/Pagination/Pagination.js +17 -7
- package/dist/components/PercentageDisplay/PercentageDisplay.d.ts +1 -1
- package/dist/components/PercentageDisplay/PercentageDisplay.js +24 -92
- package/dist/components/Programa/PageCodeEasterEgg.d.ts +5 -4
- package/dist/components/Programa/PageCodeEasterEgg.js +41 -32
- package/dist/components/Programa/Programa.d.ts +2 -2
- package/dist/components/Programa/Programa.js +50 -28
- package/dist/components/Programa/Tab.d.ts +2 -2
- package/dist/components/Programa/TabNavigationRail.d.ts +3 -3
- package/dist/components/Programa/TabNavigationRail.js +13 -55
- package/dist/components/ProgressBar/ProgressBar.js +17 -7
- package/dist/components/Select/Select.js +17 -7
- package/dist/components/SimpleTable/SimpleTable.js +17 -7
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.js +194 -179
- package/dist/components/TablePicker/TablePicker.js +37 -12
- package/dist/components/Tabs/Tabs.js +17 -7
- package/dist/components/TextArea/TextArea.js +17 -7
- package/dist/components/TextToHtml/Cursor.d.ts +1 -1
- package/dist/components/TextToHtml/Cursor.js +17 -7
- package/dist/components/TextToHtml/TextStyles.d.ts +1 -1
- package/dist/components/TextToHtml/TextStyles.js +51 -44
- package/dist/components/TextToHtml/TextToHtml.js +37 -17
- package/dist/components/ThreadLog/ThreadLog.js +19 -9
- package/dist/components/UserCard/UserCard.js +36 -26
- package/dist/components/UtilAutoComplete/UtilAutoComplete.d.ts +3 -4
- package/dist/components/UtilAutoComplete/UtilAutoComplete.js +26 -16
- package/dist/components/UtilTextField/UtilTextField.d.ts +1 -1
- package/dist/components/UtilTextField/UtilTextField.js +26 -14
- package/dist/components/Zoom/Zoom.js +23 -24
- package/dist/fieldsRedux/createField.js +17 -7
- package/dist/fieldsRedux/fieldsRedux.js +19 -9
- package/dist/fieldsRedux/passFields.js +17 -7
- package/dist/reducers/index.d.ts +98 -2
- package/dist/utils/api.js +32 -15
- package/dist/utils/config.js +2 -3
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +68 -54
- package/dist/utils/store.js +2 -3
- package/lib/api/WebSocket.js +11 -12
- package/lib/api/index.js +14 -14
- package/lib/api/ws.js +48 -4
- package/lib/components/ArgousAvatar/ArgousAvatar.d.ts +1 -1
- package/lib/components/ArgousAvatar/ArgousAvatar.js +20 -54
- package/lib/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +1 -1
- package/lib/components/ArgousComplexPagination/ArgousComplexPagination.js +50 -25
- package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -1
- package/lib/components/ArgousComplexTable/ArgousComplexTable.js +15 -15
- package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +1 -1
- package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.js +121 -106
- package/lib/components/ArgousComplexTableBody/DragAndDrop.js +85 -0
- package/lib/components/ArgousComplexTableHead/ArgousComplexTableHead.js +60 -51
- package/lib/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +21 -12
- package/lib/components/ArgousInput/ArgousInput.js +2 -2
- package/lib/components/ArgousPagination/ArgousPagination.js +12 -4
- package/lib/components/ArgousProgressBar/ArgousProgressBar.js +67 -78
- package/lib/components/ArgousSimpleTable/ArgousSimpleTable.js +12 -18
- package/lib/components/AutoComplete/AutoComplete.js +2 -3
- package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +3 -4
- package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.js +174 -108
- package/lib/components/BarraFerramentas/BarraFerramentas.js +32 -21
- package/lib/components/Calendar/Calendar.js +7 -42
- package/lib/components/Carousel/Carousel.js +42 -27
- package/lib/components/CartaoUsuario/CartaoUsuario.js +6 -6
- package/lib/components/Collapse/Collapse.d.ts +3 -3
- package/lib/components/Collapse/Collapse.js +92 -57
- package/lib/components/Compartilhar/Compartilhar.js +47 -46
- package/lib/components/ConfirmModal/BasicModal.tsx +1 -1
- package/lib/components/ConfirmModal/WrapperModal.tsx +2 -2
- package/lib/components/ContactValidationInput/ContactValidationInput.d.ts +1 -1
- package/lib/components/ContactValidationInput/ContactValidationInput.js +248 -213
- package/lib/components/ContactValidationInput/SealModal.js +38 -32
- package/lib/components/Document/Icons.js +14 -6
- package/lib/components/Document/ModalVisualizacaoDocumentos.js +9 -2
- package/lib/components/Document/Visualizacao.js +31 -25
- package/lib/components/DropArea/DropArea.js +9 -3
- package/lib/components/Editor/ScriptLoader2.ts +3 -3
- package/lib/components/Editor/Utils.ts +3 -3
- package/lib/components/Editor/components/Editor.tsx +1 -1
- package/lib/components/Editor/tinymce/README.md +73 -0
- package/lib/components/Editor/tinymce/langs/README.md +3 -0
- package/lib/components/Editor/tinymce/models/dom/model.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/accordion/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/table/plugin.js +3 -3
- package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +1 -1
- package/lib/components/Editor/tinymce/themes/silver/theme.js +38 -38
- package/lib/components/Editor/tinymce/themes/silver/theme.min.js +1 -1
- package/lib/components/Editor/tinymce/tinymce.js +12 -12
- package/lib/components/Editor/tinymce/tinymce.min.js +1 -1
- package/lib/components/FilePreparer/FilePreparer.d.ts +1 -1
- package/lib/components/FilePreparer/FilePreparer.js +112 -108
- package/lib/components/FileUploader/FileUploader.js +8 -7
- package/lib/components/FormVisualizer/FormVisualizer.d.ts +5 -7
- package/lib/components/FormVisualizer/FormVisualizer.js +59 -46
- package/lib/components/HalfGauge/HalfGauge.js +87 -85
- package/lib/components/Highlight/Highlight.js +4 -4
- package/lib/components/ImageResize/ImageResize.d.ts +1 -1
- package/lib/components/ImageResize/ImageResize.js +123 -118
- package/lib/components/ImageResizeButton/ImageResizeButton.d.ts +1 -1
- package/lib/components/ImageResizeButton/ImageResizeButton.js +1 -1
- package/lib/components/Input/Input.js +2 -2
- package/lib/components/InputTags/InputTags.js +6 -7
- package/lib/components/MaterialButton/MaterialButton.d.ts +2 -4
- package/lib/components/MaterialButton/MaterialButton.js +50 -125
- package/lib/components/MonthPicker/MonthPicker.js +2 -2
- package/lib/components/OtpInput/OtpInput.tsx +77 -69
- package/lib/components/PercentageDisplay/PercentageDisplay.d.ts +1 -1
- package/lib/components/PercentageDisplay/PercentageDisplay.js +29 -54
- package/lib/components/Programa/PageCodeEasterEgg.js +41 -40
- package/lib/components/Programa/Programa.d.ts +2 -2
- package/lib/components/Programa/Programa.js +21 -5
- package/lib/components/Programa/Tab.ts +4 -2
- package/lib/components/Programa/TabNavigationRail.js +9 -31
- package/lib/components/Stepper/Stepper.d.ts +1 -1
- package/lib/components/Stepper/Stepper.js +222 -190
- package/lib/components/TablePicker/TablePicker.js +11 -6
- package/lib/components/TextToHtml/TextStyles.js +42 -42
- package/lib/components/TextToHtml/TextToHtml.js +102 -92
- package/lib/components/ThreadLog/ThreadLog.js +1 -1
- package/lib/components/UserCard/UserCard.js +6 -6
- package/lib/components/UtilAutoComplete/UtilAutoComplete.d.ts +3 -4
- package/lib/components/UtilAutoComplete/UtilAutoComplete.js +67 -9
- package/lib/components/UtilTextField/UtilTextField.d.ts +1 -1
- package/lib/components/UtilTextField/UtilTextField.js +18 -16
- package/lib/components/Zoom/Zoom.js +6 -3
- package/lib/utils/api.ts +1 -1
- package/lib/utils/index.ts +10 -8
- package/package.json +56 -56
- package/.gitlab-ci.yml +0 -21
package/dist/utils/index.js
CHANGED
|
@@ -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 (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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 =
|
|
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.
|
|
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
|
|
103
|
-
var colors = __importStar(require("@material
|
|
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
|
-
|
|
184
|
-
var
|
|
185
|
-
|
|
186
|
-
|
|
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,
|
|
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
|
-
|
|
451
|
-
var
|
|
452
|
-
var event =
|
|
453
|
-
return
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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, '') : ''; };
|
package/dist/utils/store.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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;
|
package/lib/api/WebSocket.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { connectArgousWS,
|
|
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
|
-
|
|
34
|
-
|
|
30
|
+
handleFocus = () => {
|
|
31
|
+
if (this.props.usuarioLogado.nome) {
|
|
32
|
+
this.connect();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
connect = () => {
|
|
37
|
+
const argousWS = connectArgousWS();
|
|
37
38
|
|
|
38
|
-
|
|
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
|
-
|
|
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
|
|
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,63 +1,21 @@
|
|
|
1
1
|
import { fetchToArgous } from '../../api';
|
|
2
2
|
import { getNumeroFromInitials, getInitials } from '../../utils';
|
|
3
|
-
import { Avatar,
|
|
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
|
|
8
|
-
|
|
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
|
|
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
|
-
|
|
60
|
-
|
|
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={
|
|
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;
|