argous 1.2.246 → 1.2.247
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 +4 -0
- package/dist/api/WebSocket.js +17 -13
- package/dist/api/index.js +119 -108
- package/dist/api/ws.js +3 -3
- package/dist/components/Alert/Alert.js +6 -2
- package/dist/components/ArgousAction/ArgousAction.js +8 -4
- package/dist/components/ArgousAvatar/ArgousAvatar.js +14 -10
- package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +15 -9
- package/dist/components/ArgousComplexTable/ArgousComplexTable.js +79 -52
- package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +16 -12
- package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +13 -9
- package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +12 -8
- package/dist/components/ArgousInput/ArgousInput.js +8 -4
- package/dist/components/ArgousPagination/ArgousPagination.js +1 -1
- package/dist/components/ArgousProgressBar/ArgousProgressBar.js +18 -18
- package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +16 -12
- package/dist/components/AutoComplete/AutoComplete.js +16 -12
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +34 -30
- package/dist/components/BarChart/BarChart.js +5 -1
- package/dist/components/BarraFerramentas/BarraFerramentas.d.ts +30 -2
- package/dist/components/BarraFerramentas/BarraFerramentas.js +58 -40
- package/dist/components/Button/Button.js +8 -4
- package/dist/components/Cabecalho/Cabecalho.js +29 -25
- package/dist/components/Calendar/Calendar.js +12 -8
- package/dist/components/Cam/Cam.js +15 -11
- package/dist/components/Carousel/Carousel.js +21 -17
- package/dist/components/CartaoUsuario/CartaoUsuario.js +21 -17
- package/dist/components/Collapse/Collapse.js +18 -14
- package/dist/components/Compartilhar/Compartilhar.js +24 -20
- package/dist/components/ConfirmModal/ModalProvider.js +17 -13
- package/dist/components/ConfirmModal/index.js +5 -1
- package/dist/components/ContactValidationInput/ContactValidationInput.js +34 -31
- package/dist/components/Document/Icons.js +14 -10
- package/dist/components/Document/ModalVisualizacaoDocumentos.js +11 -7
- package/dist/components/Document/Visualizacao.js +15 -11
- package/dist/components/Document/index.js +5 -1
- package/dist/components/DropArea/DropArea.js +16 -12
- package/dist/components/DropArea/Html5FileSelector.js +2 -2
- package/dist/components/Editor/Events.d.ts +2 -2
- package/dist/components/Editor/ScriptLoader2.d.ts +1 -1
- package/dist/components/Editor/ScriptLoader2.js +1 -1
- package/dist/components/Editor/Utils.d.ts +1 -1
- package/dist/components/Editor/Utils.js +1 -1
- package/dist/components/Editor/components/Editor.d.ts +1 -1
- package/dist/components/Editor/components/Editor.js +23 -18
- package/dist/components/Editor/components/EditorPropTypes.d.ts +2 -2
- package/dist/components/Editor/components/EditorPropTypes.js +5 -1
- package/dist/components/FilePreparer/FilePreparer.js +34 -26
- package/dist/components/FileUploader/FileUploader.js +22 -18
- package/dist/components/FormVisualizer/FormVisualizer.js +34 -26
- package/dist/components/HalfGauge/HalfGauge.js +30 -26
- package/dist/components/Highlight/Highlight.js +7 -3
- package/dist/components/ImageResize/ImageResize.js +61 -57
- package/dist/components/ImageResizeButton/ImageResizeButton.js +9 -5
- package/dist/components/Input/Input.js +8 -4
- package/dist/components/InputTags/InputTags.js +16 -8
- package/dist/components/ListSelect/ListSelect.js +11 -7
- package/dist/components/MaterialButton/MaterialButton.js +18 -18
- package/dist/components/MenuBar/MenuBar.js +11 -7
- package/dist/components/MonthPicker/MonthPicker.js +33 -25
- package/dist/components/MultipleSelect/MultipleSelect.js +20 -12
- package/dist/components/OtpInput/OtpInput.js +11 -7
- package/dist/components/OutputText/OutputText.js +8 -4
- package/dist/components/Pagination/Pagination.js +5 -1
- package/dist/components/PercentageDisplay/PercentageDisplay.js +11 -7
- package/dist/components/Programa/PageCodeEasterEgg.d.ts +1 -1
- package/dist/components/Programa/PageCodeEasterEgg.js +11 -7
- package/dist/components/Programa/Programa.d.ts +16 -1
- package/dist/components/Programa/Programa.js +41 -13
- package/dist/components/Programa/Tab.d.ts +7 -0
- package/dist/components/Programa/Tab.js +2 -0
- package/dist/components/Programa/TabNavigationRail.d.ts +12 -0
- package/dist/components/Programa/TabNavigationRail.js +118 -0
- package/dist/components/ProgressBar/ProgressBar.js +8 -4
- package/dist/components/Select/Select.js +11 -7
- package/dist/components/SimpleTable/SimpleTable.js +30 -26
- package/dist/components/Stepper/Stepper.js +18 -14
- package/dist/components/TablePicker/TablePicker.js +40 -32
- package/dist/components/Tabs/Tabs.js +8 -4
- package/dist/components/TextArea/TextArea.js +8 -4
- package/dist/components/TextToHtml/Cursor.js +9 -5
- package/dist/components/TextToHtml/TextStyles.js +10 -6
- package/dist/components/TextToHtml/TextToHtml.js +44 -44
- package/dist/components/ThreadLog/ThreadLog.js +15 -11
- package/dist/components/UserCard/UserCard.js +18 -14
- package/dist/components/UtilAutoComplete/UtilAutoComplete.js +22 -18
- package/dist/components/UtilTextField/UtilTextField.js +10 -6
- package/dist/components/Zoom/Zoom.js +11 -7
- package/dist/components/index.js +5 -1
- package/dist/fieldsRedux/createField.js +22 -18
- package/dist/fieldsRedux/fieldsRedux.js +44 -40
- package/dist/fieldsRedux/passFields.js +16 -12
- package/dist/reducers/index.js +1 -1
- package/dist/utils/api.d.ts +2 -2
- package/dist/utils/api.js +18 -18
- package/dist/utils/date.js +4 -4
- package/dist/utils/index.js +44 -112
- package/dist/utils/xmlToJson.js +1 -1
- package/lib/components/BarraFerramentas/BarraFerramentas.d.ts +30 -2
- package/lib/components/BarraFerramentas/BarraFerramentas.js +63 -19
- package/lib/components/Programa/Programa.d.ts +16 -1
- package/lib/components/Programa/Programa.js +40 -3
- package/lib/components/Programa/Tab.ts +6 -0
- package/lib/components/Programa/TabNavigationRail.js +118 -0
- package/lib/utils/index.ts +0 -88
- package/package.json +2 -2
- package/lib/components/Editor/tinymce/README.md +0 -73
- package/lib/components/Editor/tinymce/langs/README.md +0 -3
|
@@ -27,7 +27,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
27
27
|
};
|
|
28
28
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
29
|
if (k2 === undefined) k2 = k;
|
|
30
|
-
Object.
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
31
35
|
}) : (function(o, m, k, k2) {
|
|
32
36
|
if (k2 === undefined) k2 = k;
|
|
33
37
|
o[k2] = m[k];
|
|
@@ -59,38 +63,38 @@ var passFields = function (WrappedComponent) {
|
|
|
59
63
|
function HOCComponent() {
|
|
60
64
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
61
65
|
_this.getField = function (field, key) {
|
|
62
|
-
return fieldsRedux_1.getField(field, key);
|
|
66
|
+
return (0, fieldsRedux_1.getField)(field, key);
|
|
63
67
|
};
|
|
64
68
|
_this.getPreviousField = function (p1, p2, p3) {
|
|
65
|
-
return fieldsRedux_1.getPreviousField(p1, p2, p3);
|
|
69
|
+
return (0, fieldsRedux_1.getPreviousField)(p1, p2, p3);
|
|
66
70
|
};
|
|
67
71
|
_this.setField = function (p1, p2, p3) {
|
|
68
72
|
if (typeof p2 === 'object') {
|
|
69
|
-
return fieldsRedux_1.setField(p1, p2);
|
|
73
|
+
return (0, fieldsRedux_1.setField)(p1, p2);
|
|
70
74
|
}
|
|
71
|
-
return fieldsRedux_1.setField(p1, p2, p3);
|
|
75
|
+
return (0, fieldsRedux_1.setField)(p1, p2, p3);
|
|
72
76
|
};
|
|
73
77
|
_this.setFieldsByObject = function (object, prefix) {
|
|
74
|
-
fieldsRedux_1.setFieldsByObject(object, prefix);
|
|
78
|
+
(0, fieldsRedux_1.setFieldsByObject)(object, prefix);
|
|
75
79
|
};
|
|
76
80
|
_this.getFieldsByPrefix = function (prefix, letPrefix) {
|
|
77
|
-
return fieldsRedux_1.getFieldsByPrefix(prefix, letPrefix);
|
|
81
|
+
return (0, fieldsRedux_1.getFieldsByPrefix)(prefix, letPrefix);
|
|
78
82
|
};
|
|
79
83
|
_this.waitFieldsData = function (wFields, wDatas, rejectMilliseconds, milliseconds) {
|
|
80
84
|
if (wFields === void 0) { wFields = []; }
|
|
81
85
|
if (wDatas === void 0) { wDatas = []; }
|
|
82
86
|
if (rejectMilliseconds === void 0) { rejectMilliseconds = 5000; }
|
|
83
87
|
if (milliseconds === void 0) { milliseconds = 100; }
|
|
84
|
-
return fieldsRedux_1.waitFieldsData(wFields, wDatas, rejectMilliseconds, milliseconds);
|
|
88
|
+
return (0, fieldsRedux_1.waitFieldsData)(wFields, wDatas, rejectMilliseconds, milliseconds);
|
|
85
89
|
};
|
|
86
90
|
_this.setServerValueToField = function (field) {
|
|
87
|
-
return fieldsRedux_1.setServerValueToField(field);
|
|
91
|
+
return (0, fieldsRedux_1.setServerValueToField)(field);
|
|
88
92
|
};
|
|
89
93
|
_this.setFieldValueToServer = function (field) {
|
|
90
|
-
return fieldsRedux_1.setFieldValueToServer(field);
|
|
94
|
+
return (0, fieldsRedux_1.setFieldValueToServer)(field);
|
|
91
95
|
};
|
|
92
96
|
_this.clearField = function (field) {
|
|
93
|
-
fieldsRedux_1.clearField(field);
|
|
97
|
+
(0, fieldsRedux_1.clearField)(field);
|
|
94
98
|
};
|
|
95
99
|
return _this;
|
|
96
100
|
}
|
|
@@ -102,6 +106,6 @@ var passFields = function (WrappedComponent) {
|
|
|
102
106
|
var mapStateToProps = function (state) {
|
|
103
107
|
return { fields: state.argous.fields };
|
|
104
108
|
};
|
|
105
|
-
return react_redux_1.connect(mapStateToProps)(HOCComponent);
|
|
109
|
+
return (0, react_redux_1.connect)(mapStateToProps)(HOCComponent);
|
|
106
110
|
};
|
|
107
111
|
exports.default = passFields;
|
package/dist/reducers/index.js
CHANGED
|
@@ -5,5 +5,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var argous_1 = __importDefault(require("./argous"));
|
|
7
7
|
var redux_1 = require("redux");
|
|
8
|
-
var reducers = redux_1.combineReducers({ argous: argous_1.default });
|
|
8
|
+
var reducers = (0, redux_1.combineReducers)({ argous: argous_1.default });
|
|
9
9
|
exports.default = reducers;
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const getServerValue: (field: string) => Promise<any>;
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const setServerValue: (field: string, value: any) => Promise<any>;
|
|
14
14
|
export declare const enableDebugger: () => void;
|
|
15
|
-
export declare const serverAction: (metodo: string, dados?: {}, pgCode?: string | boolean
|
|
15
|
+
export declare const serverAction: (metodo: string, dados?: {}, pgCode?: string | boolean, tratarErro?: string | boolean, token?: string) => Promise<any>;
|
|
16
16
|
export declare function setAlert(mensagem: string, type: 'error' | 'success' | 'info' | 'warning', title: string, time?: number): void;
|
|
17
17
|
export declare function setError(mensagem: string, title?: string): void;
|
|
18
18
|
export declare function setSuccess(mensagem: string, title: string, time?: number): void;
|
|
@@ -26,4 +26,4 @@ export declare function sendNotification({ id, mensagem, title, type, link, dsLa
|
|
|
26
26
|
link: string;
|
|
27
27
|
dsLabel: string;
|
|
28
28
|
}): void;
|
|
29
|
-
export declare const getUrlParameters: (pgCode?: string
|
|
29
|
+
export declare const getUrlParameters: (pgCode?: string) => Promise<any>;
|
package/dist/utils/api.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
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
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -46,7 +46,7 @@ var getCurrentProgram = function (n) {
|
|
|
46
46
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
47
47
|
var state, currentProgram;
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
|
-
state = store_1.getStore().getState();
|
|
49
|
+
state = (0, store_1.getStore)().getState();
|
|
50
50
|
currentProgram = state.argous.currentProgram;
|
|
51
51
|
if (!currentProgram) {
|
|
52
52
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
@@ -81,7 +81,7 @@ var getServerValue = function (field) { return __awaiter(void 0, void 0, void 0,
|
|
|
81
81
|
case 0: return [4 /*yield*/, getCurrentProgram()];
|
|
82
82
|
case 1:
|
|
83
83
|
currentProgram = _a.sent();
|
|
84
|
-
return [4 /*yield*/, api_1.agGet({ pgCode: currentProgram, field: field })];
|
|
84
|
+
return [4 /*yield*/, (0, api_1.agGet)({ pgCode: currentProgram, field: field })];
|
|
85
85
|
case 2:
|
|
86
86
|
res = _a.sent();
|
|
87
87
|
if (res.pgmOk) {
|
|
@@ -114,7 +114,7 @@ var setServerValue = function (field, value) { return __awaiter(void 0, void 0,
|
|
|
114
114
|
case 0: return [4 /*yield*/, getCurrentProgram()];
|
|
115
115
|
case 1:
|
|
116
116
|
currentProgram = _b.sent();
|
|
117
|
-
return [4 /*yield*/, api_1.agSet((_a = { pgCode: currentProgram }, _a[field] = value, _a))];
|
|
117
|
+
return [4 /*yield*/, (0, api_1.agSet)((_a = { pgCode: currentProgram }, _a[field] = value, _a))];
|
|
118
118
|
case 2:
|
|
119
119
|
res = _b.sent();
|
|
120
120
|
return [2 /*return*/, !!res.pgmOk];
|
|
@@ -149,7 +149,7 @@ var serverAction = function (metodo, dados, pgCode, tratarErro, token) {
|
|
|
149
149
|
action: metodo,
|
|
150
150
|
dados: dados
|
|
151
151
|
};
|
|
152
|
-
return [4 /*yield*/, api_1.action(data, token)];
|
|
152
|
+
return [4 /*yield*/, (0, api_1.action)(data, token)];
|
|
153
153
|
case 3:
|
|
154
154
|
res = _b.sent();
|
|
155
155
|
if (debuging && process.env.NODE_ENV !== 'production') {
|
|
@@ -165,16 +165,16 @@ var serverAction = function (metodo, dados, pgCode, tratarErro, token) {
|
|
|
165
165
|
if (res.dsErro && tErro)
|
|
166
166
|
setError(res.dsErro);
|
|
167
167
|
if (res.chTkn)
|
|
168
|
-
document.cookie = "lt="
|
|
168
|
+
document.cookie = "lt=".concat(res.chTkn, ";path=/;SameSite=Lax;").concat((0, config_1.getConfig)().ssl ? 'secure' : '');
|
|
169
169
|
if (res.blkTkn) {
|
|
170
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;"
|
|
174
|
-
store_1.getStore().dispatch({ type: 'setBlockUser', block: true });
|
|
171
|
+
window.localStorage.setItem('blkUs', JSON.stringify((0, store_1.getStore)().getState().argous.usuarioLogado));
|
|
172
|
+
(0, store_1.getStore)().dispatch({ type: 'setUsuarioLogado', usuarioLogado: {} });
|
|
173
|
+
document.cookie = "lt=;path=/;SameSite=Lax;".concat((0, config_1.getConfig)().ssl ? 'secure' : '');
|
|
174
|
+
(0, store_1.getStore)().dispatch({ type: 'setBlockUser', block: true });
|
|
175
175
|
}
|
|
176
176
|
if (res.vldPsw)
|
|
177
|
-
store_1.getStore().dispatch({ type: 'setVldPsw', vldPsw: true });
|
|
177
|
+
(0, store_1.getStore)().dispatch({ type: 'setVldPsw', vldPsw: true });
|
|
178
178
|
return [2 /*return*/, res];
|
|
179
179
|
}
|
|
180
180
|
});
|
|
@@ -184,42 +184,42 @@ exports.serverAction = serverAction;
|
|
|
184
184
|
function setAlert(mensagem, type, title, time) {
|
|
185
185
|
if (time === void 0) { time = 5000; }
|
|
186
186
|
setTimeout(function () {
|
|
187
|
-
fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: type, title: title, time: time }, 'argousSystem');
|
|
187
|
+
(0, fieldsRedux_1.setAnotherProgramField)('systemTopAlert', { mensagem: mensagem, type: type, title: title, time: time }, 'argousSystem');
|
|
188
188
|
}, 0);
|
|
189
189
|
}
|
|
190
190
|
exports.setAlert = setAlert;
|
|
191
191
|
function setError(mensagem, title) {
|
|
192
192
|
if (title === void 0) { title = 'Erro'; }
|
|
193
193
|
setTimeout(function () {
|
|
194
|
-
fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: 'error', title: title }, 'argousSystem');
|
|
194
|
+
(0, fieldsRedux_1.setAnotherProgramField)('systemTopAlert', { mensagem: mensagem, type: 'error', title: title }, 'argousSystem');
|
|
195
195
|
}, 0);
|
|
196
196
|
}
|
|
197
197
|
exports.setError = setError;
|
|
198
198
|
function setSuccess(mensagem, title, time) {
|
|
199
199
|
if (time === void 0) { time = 5000; }
|
|
200
200
|
setTimeout(function () {
|
|
201
|
-
fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: 'success', title: title, time: time }, 'argousSystem');
|
|
201
|
+
(0, fieldsRedux_1.setAnotherProgramField)('systemTopAlert', { mensagem: mensagem, type: 'success', title: title, time: time }, 'argousSystem');
|
|
202
202
|
}, 0);
|
|
203
203
|
}
|
|
204
204
|
exports.setSuccess = setSuccess;
|
|
205
205
|
function setInfo(mensagem, title, time) {
|
|
206
206
|
if (time === void 0) { time = 5000; }
|
|
207
207
|
setTimeout(function () {
|
|
208
|
-
fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: 'info', title: title, time: time }, 'argousSystem');
|
|
208
|
+
(0, fieldsRedux_1.setAnotherProgramField)('systemTopAlert', { mensagem: mensagem, type: 'info', title: title, time: time }, 'argousSystem');
|
|
209
209
|
}, 0);
|
|
210
210
|
}
|
|
211
211
|
exports.setInfo = setInfo;
|
|
212
212
|
function setWarning(mensagem, title, time) {
|
|
213
213
|
if (time === void 0) { time = 5000; }
|
|
214
214
|
setTimeout(function () {
|
|
215
|
-
fieldsRedux_1.setAnotherProgramField('systemTopAlert', { mensagem: mensagem, type: 'warning', title: title, time: time }, 'argousSystem');
|
|
215
|
+
(0, fieldsRedux_1.setAnotherProgramField)('systemTopAlert', { mensagem: mensagem, type: 'warning', title: title, time: time }, 'argousSystem');
|
|
216
216
|
}, 0);
|
|
217
217
|
}
|
|
218
218
|
exports.setWarning = setWarning;
|
|
219
219
|
function sendNotification(_a) {
|
|
220
220
|
var id = _a.id, mensagem = _a.mensagem, title = _a.title, type = _a.type, link = _a.link, dsLabel = _a.dsLabel;
|
|
221
221
|
setTimeout(function () {
|
|
222
|
-
fieldsRedux_1.setAnotherProgramField('systemTopAlert', { type: 'notification', id: id, mensagem: mensagem, title: title, link: link, dsLabel: dsLabel, icon: type }, 'argousSystem');
|
|
222
|
+
(0, fieldsRedux_1.setAnotherProgramField)('systemTopAlert', { type: 'notification', id: id, mensagem: mensagem, title: title, link: link, dsLabel: dsLabel, icon: type }, 'argousSystem');
|
|
223
223
|
}, 0);
|
|
224
224
|
}
|
|
225
225
|
exports.sendNotification = sendNotification;
|
|
@@ -246,7 +246,7 @@ var getUrlParameters = function (pgCode) { return __awaiter(void 0, void 0, void
|
|
|
246
246
|
urlPrms = getUrlVars();
|
|
247
247
|
if (!urlPrms.ctrl) return [3 /*break*/, 2];
|
|
248
248
|
deleteURLParameters();
|
|
249
|
-
return [4 /*yield*/, exports.serverAction('getURLParameters', { ctrl: urlPrms.ctrl }, pgCode, true)];
|
|
249
|
+
return [4 /*yield*/, (0, exports.serverAction)('getURLParameters', { ctrl: urlPrms.ctrl }, pgCode, true)];
|
|
250
250
|
case 1: return [2 /*return*/, _a.sent()];
|
|
251
251
|
case 2: return [2 /*return*/];
|
|
252
252
|
}
|
package/dist/utils/date.js
CHANGED
|
@@ -35,17 +35,17 @@ exports.getDayName = getDayName;
|
|
|
35
35
|
var convertMinutesToHour = function (minutes) {
|
|
36
36
|
var dtAux = new Date(0, 0, 0, 0, 0, 0, 0);
|
|
37
37
|
dtAux.setMinutes(minutes);
|
|
38
|
-
return _1.addExtraZero(dtAux.getHours())
|
|
38
|
+
return "".concat((0, _1.addExtraZero)(dtAux.getHours()), ":").concat((0, _1.addExtraZero)(dtAux.getMinutes()));
|
|
39
39
|
};
|
|
40
40
|
exports.convertMinutesToHour = convertMinutesToHour;
|
|
41
41
|
var sqlDateToReadableDate = function (sqlDate) {
|
|
42
42
|
var readableDate = { date: '', hour: '' };
|
|
43
43
|
if (sqlDate.length > 10) {
|
|
44
44
|
var date = sqlDate.slice(0, 10).split('-');
|
|
45
|
-
readableDate.date = date[2]
|
|
45
|
+
readableDate.date = "".concat(date[2], "/").concat(date[1], "/").concat(date[0]);
|
|
46
46
|
if (sqlDate.indexOf(' ') > -1) {
|
|
47
47
|
var hour = sqlDate.split(' ')[1].split(':');
|
|
48
|
-
readableDate.hour = hour[0]
|
|
48
|
+
readableDate.hour = "".concat(hour[0], ":").concat(hour[1]);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
return readableDate;
|
|
@@ -55,6 +55,6 @@ var fixInvalidDate = function (date) {
|
|
|
55
55
|
if (!date || typeof date !== 'string')
|
|
56
56
|
return date;
|
|
57
57
|
var splitDate = date.split(' ');
|
|
58
|
-
return splitDate[0]
|
|
58
|
+
return "".concat(splitDate[0], " ").concat(splitDate[1].split(':').map(function (t) { return (0, _1.addExtraZero)(t); }).join(':'));
|
|
59
59
|
};
|
|
60
60
|
exports.fixInvalidDate = fixInvalidDate;
|
package/dist/utils/index.js
CHANGED
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -44,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
44
48
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
49
|
function step(op) {
|
|
46
50
|
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
-
while (_) try {
|
|
51
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
48
52
|
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;
|
|
49
53
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
54
|
switch (op[0]) {
|
|
@@ -76,10 +80,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
76
80
|
}
|
|
77
81
|
return t;
|
|
78
82
|
};
|
|
79
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
80
|
-
for (var i = 0,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
84
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
85
|
+
if (ar || !(i in from)) {
|
|
86
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
87
|
+
ar[i] = from[i];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
83
91
|
};
|
|
84
92
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
85
93
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -119,7 +127,7 @@ var getCookie = function (cName) {
|
|
|
119
127
|
return '';
|
|
120
128
|
};
|
|
121
129
|
exports.getCookie = getCookie;
|
|
122
|
-
var addExtraZero = function (vl) { return (vl < 10) ? "0"
|
|
130
|
+
var addExtraZero = function (vl) { return (vl < 10) ? "0".concat(typeof vl === 'string' ? parseInt(vl) : vl) : vl; };
|
|
123
131
|
exports.addExtraZero = addExtraZero;
|
|
124
132
|
var formataNome = function (value) {
|
|
125
133
|
if (value) {
|
|
@@ -134,7 +142,7 @@ exports.formataNome = formataNome;
|
|
|
134
142
|
function downloadBase64(base64, fileName, fileExtension) {
|
|
135
143
|
var element = document.createElement('a');
|
|
136
144
|
element.setAttribute('href', base64);
|
|
137
|
-
element.setAttribute('download', fileExtension ? fileName
|
|
145
|
+
element.setAttribute('download', fileExtension ? "".concat(fileName, ".").concat(fileExtension) : fileName);
|
|
138
146
|
element.style.display = 'none';
|
|
139
147
|
document.body.appendChild(element);
|
|
140
148
|
element.click();
|
|
@@ -155,14 +163,14 @@ function downloadFromUrl(url, fileName, fileExtension) {
|
|
|
155
163
|
var blob, urlCreator, tag;
|
|
156
164
|
return __generator(this, function (_a) {
|
|
157
165
|
switch (_a.label) {
|
|
158
|
-
case 0: return [4 /*yield*/, fetch(url, { method: 'GET', headers: api_2.headers() })];
|
|
166
|
+
case 0: return [4 /*yield*/, fetch(url, { method: 'GET', headers: (0, api_2.headers)() })];
|
|
159
167
|
case 1: return [4 /*yield*/, (_a.sent()).blob()];
|
|
160
168
|
case 2:
|
|
161
169
|
blob = _a.sent();
|
|
162
170
|
urlCreator = URL || window.URL || window.webkitURL;
|
|
163
171
|
tag = document.createElement('a');
|
|
164
172
|
tag.href = urlCreator.createObjectURL(blob);
|
|
165
|
-
tag.download = fileExtension ? fileName
|
|
173
|
+
tag.download = fileExtension ? "".concat(fileName, ".").concat(fileExtension) : fileName;
|
|
166
174
|
tag.style.display = 'none';
|
|
167
175
|
document.body.appendChild(tag);
|
|
168
176
|
tag.click();
|
|
@@ -179,7 +187,7 @@ var printPdf = function (URL) {
|
|
|
179
187
|
var url, iframe;
|
|
180
188
|
return __generator(this, function (_a) {
|
|
181
189
|
switch (_a.label) {
|
|
182
|
-
case 0: return [4 /*yield*/, api_2.getFileFromLink({ URL: URL })];
|
|
190
|
+
case 0: return [4 /*yield*/, (0, api_2.getFileFromLink)({ URL: URL })];
|
|
183
191
|
case 1:
|
|
184
192
|
url = _a.sent();
|
|
185
193
|
iframe = document.createElement('iframe');
|
|
@@ -230,14 +238,14 @@ var RNG = /** @class */ (function () {
|
|
|
230
238
|
}());
|
|
231
239
|
var getInitials = function (nome) {
|
|
232
240
|
if (nome === void 0) { nome = ''; }
|
|
233
|
-
return ""
|
|
241
|
+
return "".concat(nome.split(' ')[0].substring(0, 1).toUpperCase()).concat(nome.split(' ')[nome.split(' ').length - 1].substring(0, 1).toUpperCase());
|
|
234
242
|
};
|
|
235
243
|
exports.getInitials = getInitials;
|
|
236
244
|
var getNumeroFromInitials = function (initials, length) { return Math.ceil(new RNG((initials.charCodeAt(0) + initials.charCodeAt(1) - 130) * length / 5).nextFloat() * 10) - 1; };
|
|
237
245
|
exports.getNumeroFromInitials = getNumeroFromInitials;
|
|
238
246
|
var usePrevious = function (value) {
|
|
239
|
-
var ref = react_1.useRef();
|
|
240
|
-
react_1.useEffect(function () {
|
|
247
|
+
var ref = (0, react_1.useRef)();
|
|
248
|
+
(0, react_1.useEffect)(function () {
|
|
241
249
|
ref.current = value;
|
|
242
250
|
});
|
|
243
251
|
return ref.current;
|
|
@@ -252,8 +260,8 @@ exports.usePrevious = usePrevious;
|
|
|
252
260
|
* @returns {void} Sem retorno
|
|
253
261
|
*/
|
|
254
262
|
function useUpdateEffect(effect, dependencies) {
|
|
255
|
-
var isInitialMount = react_1.useRef(true);
|
|
256
|
-
react_1.useEffect(function () {
|
|
263
|
+
var isInitialMount = (0, react_1.useRef)(true);
|
|
264
|
+
(0, react_1.useEffect)(function () {
|
|
257
265
|
if (isInitialMount.current)
|
|
258
266
|
isInitialMount.current = false;
|
|
259
267
|
else
|
|
@@ -264,7 +272,7 @@ exports.useUpdateEffect = useUpdateEffect;
|
|
|
264
272
|
function formataDinheiro(n) {
|
|
265
273
|
if (n >= 0)
|
|
266
274
|
return new Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(n);
|
|
267
|
-
return "("
|
|
275
|
+
return "(".concat(new Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Math.abs(n)), ")");
|
|
268
276
|
}
|
|
269
277
|
exports.formataDinheiro = formataDinheiro;
|
|
270
278
|
var sanitizaHTML = function (html) {
|
|
@@ -286,7 +294,7 @@ var humanFileSize = function (bytes, si, dp) {
|
|
|
286
294
|
if (dp === void 0) { dp = 2; }
|
|
287
295
|
var thresh = si ? 1000 : 1024;
|
|
288
296
|
if (Math.abs(bytes) < thresh)
|
|
289
|
-
return bytes
|
|
297
|
+
return "".concat(bytes, " B");
|
|
290
298
|
var units = si
|
|
291
299
|
? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
292
300
|
: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
|
|
@@ -296,7 +304,7 @@ var humanFileSize = function (bytes, si, dp) {
|
|
|
296
304
|
bytes /= thresh;
|
|
297
305
|
++u;
|
|
298
306
|
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
|
299
|
-
return bytes.toFixed(dp)
|
|
307
|
+
return "".concat(bytes.toFixed(dp), " ").concat(units[u]);
|
|
300
308
|
};
|
|
301
309
|
exports.humanFileSize = humanFileSize;
|
|
302
310
|
var chaves = Object.keys(colors).filter(function (i) { return i !== 'common'; });
|
|
@@ -315,21 +323,21 @@ exports.randomColor = randomColor;
|
|
|
315
323
|
var useGraph = function (_a) {
|
|
316
324
|
if (_a === void 0) { _a = {}; }
|
|
317
325
|
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"]);
|
|
318
|
-
var theme = core_1.useTheme();
|
|
319
|
-
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), xAxes: __spreadArray([__assign({ ticks: __assign({ fontColor: theme.palette.text.secondary }, xticks), gridLines: __assign({ color: theme.palette.divider, zeroLineColor: theme.palette.divider }, xgridLines) }, xAxes)], x) }, scales) }, props);
|
|
326
|
+
var theme = (0, core_1.useTheme)();
|
|
327
|
+
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);
|
|
320
328
|
};
|
|
321
329
|
exports.useGraph = useGraph;
|
|
322
330
|
var useModal = function () {
|
|
323
|
-
var createModal = react_1.useContext(ModalProvider_1.ModalProviderContext);
|
|
331
|
+
var createModal = (0, react_1.useContext)(ModalProvider_1.ModalProviderContext);
|
|
324
332
|
return createModal;
|
|
325
333
|
};
|
|
326
334
|
exports.useModal = useModal;
|
|
327
335
|
var useStore = function () {
|
|
328
|
-
return store_1.getStore().getState().argous || {};
|
|
336
|
+
return (0, store_1.getStore)().getState().argous || {};
|
|
329
337
|
};
|
|
330
338
|
exports.useStore = useStore;
|
|
331
339
|
var reduxDispatch = function (action) {
|
|
332
|
-
store_1.getStore().dispatch(action);
|
|
340
|
+
(0, store_1.getStore)().dispatch(action);
|
|
333
341
|
};
|
|
334
342
|
exports.reduxDispatch = reduxDispatch;
|
|
335
343
|
var formataTelefone = function (value) {
|
|
@@ -340,26 +348,26 @@ var formataTelefone = function (value) {
|
|
|
340
348
|
if (cvLength < 3)
|
|
341
349
|
return currentValue;
|
|
342
350
|
if (cvLength < 7)
|
|
343
|
-
return "("
|
|
351
|
+
return "(".concat(currentValue.slice(0, 2), ") ").concat(currentValue.slice(2));
|
|
344
352
|
if (cvLength < 11)
|
|
345
|
-
return "("
|
|
346
|
-
return "("
|
|
353
|
+
return "(".concat(currentValue.slice(0, 2), ") ").concat(currentValue.slice(2, 6), "-").concat(currentValue.slice(6));
|
|
354
|
+
return "(".concat(currentValue.slice(0, 2), ") ").concat(currentValue.slice(2, 7), "-").concat(currentValue.slice(7, 11));
|
|
347
355
|
};
|
|
348
356
|
exports.formataTelefone = formataTelefone;
|
|
349
357
|
var useWebSocket = function () {
|
|
350
|
-
var _a = react_1.useState({}), value = _a[0], setValue = _a[1];
|
|
351
|
-
react_1.useEffect(function () {
|
|
352
|
-
fieldsRedux_1.setField('WSHandler', { onMessage: setValue });
|
|
358
|
+
var _a = (0, react_1.useState)({}), value = _a[0], setValue = _a[1];
|
|
359
|
+
(0, react_1.useEffect)(function () {
|
|
360
|
+
(0, fieldsRedux_1.setField)('WSHandler', { onMessage: setValue });
|
|
353
361
|
}, []);
|
|
354
362
|
return value;
|
|
355
363
|
};
|
|
356
364
|
exports.useWebSocket = useWebSocket;
|
|
357
365
|
var currencyMask = function (value) {
|
|
358
366
|
if (value === 0)
|
|
359
|
-
return value.toString()
|
|
367
|
+
return "".concat(value.toString(), ",00");
|
|
360
368
|
if (!value)
|
|
361
369
|
return '';
|
|
362
|
-
if (lodash_1.isNumber(value))
|
|
370
|
+
if ((0, lodash_1.isNumber)(value))
|
|
363
371
|
value = value.toFixed(2);
|
|
364
372
|
value = value.toString();
|
|
365
373
|
value = value.replace(/\D/g, '');
|
|
@@ -391,7 +399,7 @@ var copyToClipboard = function (text) {
|
|
|
391
399
|
};
|
|
392
400
|
exports.copyToClipboard = copyToClipboard;
|
|
393
401
|
var confirm = function (props) { return new Promise(function (resolve, reject) {
|
|
394
|
-
fieldsRedux_1.setAnotherProgramField('openModal', { value: Object.assign({ resolve: resolve, reject: reject, okLabel: 'Confirmar', cancelLabel: 'Cancelar', title: 'Confirmar?' }, typeof props === 'string' ? { description: props } : props) }, 'argousSystem');
|
|
402
|
+
(0, fieldsRedux_1.setAnotherProgramField)('openModal', { value: Object.assign({ resolve: resolve, reject: reject, okLabel: 'Confirmar', cancelLabel: 'Cancelar', title: 'Confirmar?' }, typeof props === 'string' ? { description: props } : props) }, 'argousSystem');
|
|
395
403
|
}); };
|
|
396
404
|
exports.confirm = confirm;
|
|
397
405
|
exports.storageMeasures = {
|
|
@@ -455,7 +463,7 @@ var printScreen = function (_a) {
|
|
|
455
463
|
dataUrl = _d.sent();
|
|
456
464
|
if (dataUrl) {
|
|
457
465
|
linkElement = document.createElement('a');
|
|
458
|
-
linkElement.download = "print_screen_"
|
|
466
|
+
linkElement.download = "print_screen_".concat((0, moment_1.default)(new Date()).format('DD-MM-YYYY_HH:mm:ss'), ".png");
|
|
459
467
|
linkElement.href = dataUrl;
|
|
460
468
|
blob = dataUrlToBlob(dataUrl);
|
|
461
469
|
if (blob)
|
|
@@ -476,9 +484,9 @@ var geraLog = function (idDocumento, descricao, tpAcao, tokenSistema) { return _
|
|
|
476
484
|
return __generator(this, function (_e) {
|
|
477
485
|
switch (_e.label) {
|
|
478
486
|
case 0:
|
|
479
|
-
if (!((_d = (_c = (_b = (_a = store_1.getStore()) === null || _a === void 0 ? void 0 : _a.getState()) === null || _b === void 0 ? void 0 : _b.argous) === null || _c === void 0 ? void 0 : _c.usuarioLogado) === null || _d === void 0 ? void 0 : _d.idUsuario))
|
|
487
|
+
if (!((_d = (_c = (_b = (_a = (0, store_1.getStore)()) === null || _a === void 0 ? void 0 : _a.getState()) === null || _b === void 0 ? void 0 : _b.argous) === null || _c === void 0 ? void 0 : _c.usuarioLogado) === null || _d === void 0 ? void 0 : _d.idUsuario))
|
|
480
488
|
return [2 /*return*/];
|
|
481
|
-
return [4 /*yield*/, api_1.serverAction('geraLog', { idDocumento: idDocumento, descricao: descricao, tpAcao: tpAcao }, 'CtrlDocumentos', false, tokenSistema)];
|
|
489
|
+
return [4 /*yield*/, (0, api_1.serverAction)('geraLog', { idDocumento: idDocumento, descricao: descricao, tpAcao: tpAcao }, 'CtrlDocumentos', false, tokenSistema)];
|
|
482
490
|
case 1:
|
|
483
491
|
_e.sent();
|
|
484
492
|
return [2 /*return*/];
|
|
@@ -540,79 +548,3 @@ var lettersOnly = function (valor) { return valor ? valor.replace(/\W/g, '') : '
|
|
|
540
548
|
exports.lettersOnly = lettersOnly;
|
|
541
549
|
var numbersLettersOnly = function (valor) { return valor ? valor.replace(/[^a-zA-Z0-9]+/g, '') : ''; };
|
|
542
550
|
exports.numbersLettersOnly = numbersLettersOnly;
|
|
543
|
-
// REMOVER
|
|
544
|
-
// export const documentType = {
|
|
545
|
-
// cpf: {
|
|
546
|
-
// length: 11,
|
|
547
|
-
// symbols: {
|
|
548
|
-
// length: 3
|
|
549
|
-
// },
|
|
550
|
-
// lengthWithSymbols: 14
|
|
551
|
-
// },
|
|
552
|
-
// cnpj: {
|
|
553
|
-
// length: 14,
|
|
554
|
-
// symbols: {
|
|
555
|
-
// length: 4
|
|
556
|
-
// },
|
|
557
|
-
// lengthWithSymbols: 18
|
|
558
|
-
// },
|
|
559
|
-
// rg: {
|
|
560
|
-
// length: 10,
|
|
561
|
-
// symbols: {
|
|
562
|
-
// length: 0
|
|
563
|
-
// },
|
|
564
|
-
// lengthWithSymbols: 10
|
|
565
|
-
// },
|
|
566
|
-
// cnes: {
|
|
567
|
-
// length: 7
|
|
568
|
-
// },
|
|
569
|
-
// crm: {
|
|
570
|
-
// length: 6
|
|
571
|
-
// },
|
|
572
|
-
// unimedCard: {
|
|
573
|
-
// length: 17
|
|
574
|
-
// },
|
|
575
|
-
// cep: {
|
|
576
|
-
// length: 8,
|
|
577
|
-
// symbols: {
|
|
578
|
-
// length: 1
|
|
579
|
-
// },
|
|
580
|
-
// lengthWithSymbols: 9
|
|
581
|
-
// },
|
|
582
|
-
// telephone: {
|
|
583
|
-
// length: 11,
|
|
584
|
-
// symbols: {
|
|
585
|
-
// length: 2
|
|
586
|
-
// },
|
|
587
|
-
// lengthWithSymbols: 13
|
|
588
|
-
// }
|
|
589
|
-
// };
|
|
590
|
-
// export const formatCpfCnpj = (value: (string|number)) => {
|
|
591
|
-
// if (!value) return '';
|
|
592
|
-
// if (isNumber(value)) value = value.toString();
|
|
593
|
-
// value = value.replace(/[^\d]/g, '');
|
|
594
|
-
// const valueLen = value.length;
|
|
595
|
-
// if (valueLen > 3 && valueLen < 7) value = `${value.substring(0, 3)}.${value.substring(3)}`;
|
|
596
|
-
// else if (valueLen > 6 && valueLen < 10) value = `${value.substring(0, 3)}.${value.substring(3, 6)}.${value.substring(6)}`;
|
|
597
|
-
// else if (valueLen > 8 && valueLen < 12) value = `${value.substring(0, 3)}.${value.substring(3, 6)}.${value.substring(6, 9)}-${value.substring(9)}`;
|
|
598
|
-
// else if (valueLen > 11 && valueLen < 13) value = `${value.substring(0, 2)}.${value.substring(2, 5)}.${value.substring(5, 8)}/${value.substring(8)}`;
|
|
599
|
-
// else if (valueLen > 12) value = `${value.substring(0, 2)}.${value.substring(2, 5)}.${value.substring(5, 8)}/${value.substring(8, 12)}-${value.substring(12, 14)}`;
|
|
600
|
-
// return value;
|
|
601
|
-
// };
|
|
602
|
-
// export const formataCpf = (value: string) => value?.replace(/[^\d]/, '').replace(/^(.{3})(.{3})(.{3})(.{2})$/, '$1.$2.$3-$4');
|
|
603
|
-
// export function cpfTest(cpf: (string|number)) {
|
|
604
|
-
// if (typeof cpf === 'number') cpf = cpf.toString();
|
|
605
|
-
// if (!cpf || allCharactersSame(cpf)) return false;
|
|
606
|
-
// let sum = 0;
|
|
607
|
-
// let rest: number;
|
|
608
|
-
// for (let index = 1; index <= 9; index++) sum += (parseInt(cpf.substring(index - 1, index)) * (11 - index));
|
|
609
|
-
// rest = ((sum * 10) % 11);
|
|
610
|
-
// if ((rest === 10) || (rest === 11)) rest = 0;
|
|
611
|
-
// if (rest !== parseInt(cpf.substring(9, 10))) return false;
|
|
612
|
-
// sum = 0;
|
|
613
|
-
// for (let index = 1; index <= 10; index++) sum += (parseInt(cpf.substring(index - 1, index)) * (12 - index));
|
|
614
|
-
// rest = ((sum * 10) % 11);
|
|
615
|
-
// if ((rest === 10) || (rest === 11)) rest = 0;
|
|
616
|
-
// if (rest !== parseInt(cpf.substring(10, 11))) return false;
|
|
617
|
-
// return true;
|
|
618
|
-
// }
|
package/dist/utils/xmlToJson.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.parseXml = exports.xmlStringToJson = void 0;
|
|
4
4
|
var xmlStringToJson = function (xml, prefixToRemove) {
|
|
5
5
|
if (prefixToRemove === void 0) { prefixToRemove = ''; }
|
|
6
|
-
return JSON.parse(xml2json(exports.parseXml(xml)).replaceAll(prefixToRemove, ''));
|
|
6
|
+
return JSON.parse(xml2json((0, exports.parseXml)(xml)).replaceAll(prefixToRemove, ''));
|
|
7
7
|
};
|
|
8
8
|
exports.xmlStringToJson = xmlStringToJson;
|
|
9
9
|
var parseXml = function (xml) {
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
import { TabArray } from '../Programa/Tab';
|
|
1
2
|
import { IconType } from 'react-icons';
|
|
2
3
|
|
|
4
|
+
|
|
3
5
|
export interface BarraFerramentasProps {
|
|
4
6
|
titulo?: string,
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Abas para a barra de ferramentas
|
|
9
|
+
*
|
|
10
|
+
* Array de arrays
|
|
11
|
+
*
|
|
12
|
+
* Array da aba: [('Label' || undefined), ('active' || undefined), ('alias' || undefined), (Icon || undefined)]
|
|
13
|
+
*
|
|
14
|
+
* - [0] Label: Rótulo da aba.
|
|
15
|
+
* - [1] Active: Quando 'active' inicia o programa com essa aba selecionada.
|
|
16
|
+
* - [2] Alias: O nome que será recebido na função 'bfExecutaFuncao'. Caso não forneça esse nome a função retorna 'T[index]'.
|
|
17
|
+
* - [3] Icon: JSX do ícone da aba.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
abas?: Array<TabArray>,
|
|
6
21
|
ferramentas?: [IconType, string, string | (() => void) ][][],
|
|
7
22
|
habCrud?: boolean,
|
|
8
23
|
habNavegador?: boolean,
|
|
@@ -18,7 +33,20 @@ export interface BarraFerramentasProps {
|
|
|
18
33
|
addWidget?: () => void,
|
|
19
34
|
snAnotacaoPrograma: boolean,
|
|
20
35
|
openAnnotations: (event: Event) => void,
|
|
21
|
-
toolbarLoading: object
|
|
36
|
+
toolbarLoading: object,
|
|
37
|
+
/**
|
|
38
|
+
* Aba selecionada
|
|
39
|
+
*
|
|
40
|
+
* Array da aba: [('Label' || undefined), ('active' || undefined), ('alias' || undefined), (Icon || undefined)]
|
|
41
|
+
*
|
|
42
|
+
* - [0] Label: Rótulo da aba.
|
|
43
|
+
* - [1] Active: Quando 'active' inicia o programa com essa aba selecionada.
|
|
44
|
+
* - [2] Alias: O nome que será recebido na função 'bfExecutaFuncao'. Caso não forneça esse nome a função retorna 'T[index]'.
|
|
45
|
+
* - [3] Icon: JSX do ícone da aba.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
selectedTab?: TabArray,
|
|
49
|
+
setSelectedTab?: (tab: TabArray) => void
|
|
22
50
|
}
|
|
23
51
|
|
|
24
52
|
declare function BarraFerramentas(props: BarraFerramentasProps): JSX.Element
|