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
|
@@ -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]) {
|
|
@@ -72,27 +76,27 @@ var core_1 = require("@material-ui/core");
|
|
|
72
76
|
var lab_1 = require("@material-ui/lab");
|
|
73
77
|
var react_1 = __importStar(require("react"));
|
|
74
78
|
var md_1 = require("react-icons/md");
|
|
75
|
-
var useStyles = core_1.makeStyles({
|
|
79
|
+
var useStyles = (0, core_1.makeStyles)({
|
|
76
80
|
fundoCompartilhar: {
|
|
77
81
|
width: '500px',
|
|
78
82
|
padding: '20px',
|
|
79
83
|
marginTop: 5,
|
|
80
84
|
}
|
|
81
85
|
});
|
|
82
|
-
var Compartilhar = react_1.forwardRef(function (props, ref) {
|
|
83
|
-
var _a = react_1.useState(''), metodoCompartilhar = _a[0], setMetodoCompartilhar = _a[1];
|
|
84
|
-
var _b = react_1.useState(''), mensagemEmail = _b[0], setMensagemEmail = _b[1];
|
|
85
|
-
var _c = react_1.useState([]), email = _c[0], setEmail = _c[1];
|
|
86
|
-
var _d = react_1.useState(''), stringEmail = _d[0], setStringEmail = _d[1];
|
|
87
|
-
var _f = react_1.useState([]), notificacao = _f[0], setNotificacao = _f[1];
|
|
88
|
-
var _g = react_1.useState(''), stringNotificacao = _g[0], setStringNotificacao = _g[1];
|
|
89
|
-
var _h = react_1.useState(''), mensagemNotificação = _h[0], setMensagemNotificacao = _h[1];
|
|
86
|
+
var Compartilhar = (0, react_1.forwardRef)(function (props, ref) {
|
|
87
|
+
var _a = (0, react_1.useState)(''), metodoCompartilhar = _a[0], setMetodoCompartilhar = _a[1];
|
|
88
|
+
var _b = (0, react_1.useState)(''), mensagemEmail = _b[0], setMensagemEmail = _b[1];
|
|
89
|
+
var _c = (0, react_1.useState)([]), email = _c[0], setEmail = _c[1];
|
|
90
|
+
var _d = (0, react_1.useState)(''), stringEmail = _d[0], setStringEmail = _d[1];
|
|
91
|
+
var _f = (0, react_1.useState)([]), notificacao = _f[0], setNotificacao = _f[1];
|
|
92
|
+
var _g = (0, react_1.useState)(''), stringNotificacao = _g[0], setStringNotificacao = _g[1];
|
|
93
|
+
var _h = (0, react_1.useState)(''), mensagemNotificação = _h[0], setMensagemNotificacao = _h[1];
|
|
90
94
|
var link = props.linkCompartilhamento;
|
|
91
|
-
var _j = react_1.useState(false), copiado = _j[0], setCopiado = _j[1];
|
|
92
|
-
var _k = react_1.useState(false), enviado = _k[0], setEnviado = _k[1];
|
|
93
|
-
var _l = react_1.useState([]), options = _l[0], setOptions = _l[1];
|
|
95
|
+
var _j = (0, react_1.useState)(false), copiado = _j[0], setCopiado = _j[1];
|
|
96
|
+
var _k = (0, react_1.useState)(false), enviado = _k[0], setEnviado = _k[1];
|
|
97
|
+
var _l = (0, react_1.useState)([]), options = _l[0], setOptions = _l[1];
|
|
94
98
|
var erroVazio = { email: '', stringEmail: '', notificacao: '', stringNotificacao: '' };
|
|
95
|
-
var _m = react_1.useState(erroVazio), erro = _m[0], setErro = _m[1];
|
|
99
|
+
var _m = (0, react_1.useState)(erroVazio), erro = _m[0], setErro = _m[1];
|
|
96
100
|
var classes = useStyles();
|
|
97
101
|
function copiarParaAreaDeTransferencia() {
|
|
98
102
|
var link = document.getElementById('link');
|
|
@@ -104,21 +108,21 @@ var Compartilhar = react_1.forwardRef(function (props, ref) {
|
|
|
104
108
|
setCopiado(false);
|
|
105
109
|
}, 3500);
|
|
106
110
|
}
|
|
107
|
-
react_1.useEffect(function () {
|
|
111
|
+
(0, react_1.useEffect)(function () {
|
|
108
112
|
if (stringEmail.length < 3 && stringNotificacao.length < 3)
|
|
109
113
|
return;
|
|
110
114
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
111
115
|
var res;
|
|
112
116
|
return __generator(this, function (_a) {
|
|
113
117
|
switch (_a.label) {
|
|
114
|
-
case 0: return [4 /*yield*/, index_1.searchUsers({ dsFiltroNome: metodoCompartilhar === 'email' ? stringEmail : stringNotificacao })];
|
|
118
|
+
case 0: return [4 /*yield*/, (0, index_1.searchUsers)({ dsFiltroNome: metodoCompartilhar === 'email' ? stringEmail : stringNotificacao })];
|
|
115
119
|
case 1:
|
|
116
120
|
res = _a.sent();
|
|
117
121
|
if (res.status) {
|
|
118
122
|
setOptions(res.users);
|
|
119
123
|
}
|
|
120
124
|
else
|
|
121
|
-
index_2.setError(res.dsErro);
|
|
125
|
+
(0, index_2.setError)(res.dsErro);
|
|
122
126
|
return [2 /*return*/];
|
|
123
127
|
}
|
|
124
128
|
});
|
|
@@ -169,7 +173,7 @@ var Compartilhar = react_1.forwardRef(function (props, ref) {
|
|
|
169
173
|
tpMensagem: tpComp,
|
|
170
174
|
link: link
|
|
171
175
|
};
|
|
172
|
-
return [4 /*yield*/, index_1.enviaCompartilhamentoDePrograma(dados)];
|
|
176
|
+
return [4 /*yield*/, (0, index_1.enviaCompartilhamentoDePrograma)(dados)];
|
|
173
177
|
case 1:
|
|
174
178
|
res = _a.sent();
|
|
175
179
|
if (res.status) {
|
|
@@ -240,7 +244,7 @@ var Compartilhar = react_1.forwardRef(function (props, ref) {
|
|
|
240
244
|
react_1.default.createElement(core_1.Collapse, { in: metodoCompartilhar === 'notificacao' },
|
|
241
245
|
react_1.default.createElement(core_1.Grid, { container: true, spacing: 2 },
|
|
242
246
|
react_1.default.createElement(core_1.Grid, { item: true, xs: 12 },
|
|
243
|
-
react_1.default.createElement(lab_1.Autocomplete, { multiple: true, value: notificacao, options: options, getOptionLabel: function (option) { return index_2.formataNome(option[1]); }, size: 'small', limitTags: 1, onChange: function (_e, value) { return setNotificacao(value); }, disableCloseOnSelect: true, disablePortal: true, noOptionsText: stringEmail.length < 3 && stringNotificacao.length < 3 ? 'Digite para começar a pesquisar' : 'Não Encontrado', renderTags: function (value, getTagProps) { return (value.map(function (option, index) { return (react_1.default.createElement(core_1.Chip, __assign({ variant: 'outlined', label: option[1] || option }, getTagProps({ index: index })))); })); }, renderInput: function (params) { return (react_1.default.createElement(core_1.TextField, __assign({ variant: 'outlined', margin: 'dense', label: 'Contatos:', onChange: function (e) { return setStringNotificacao(e.target.value); }, placeholder: notificacao.length === 0 ? 'Selecionar' : undefined, InputLabelProps: { shrink: true }, error: !!erro.notificacao, helperText: erro.notificacao }, params))); } })),
|
|
247
|
+
react_1.default.createElement(lab_1.Autocomplete, { multiple: true, value: notificacao, options: options, getOptionLabel: function (option) { return (0, index_2.formataNome)(option[1]); }, size: 'small', limitTags: 1, onChange: function (_e, value) { return setNotificacao(value); }, disableCloseOnSelect: true, disablePortal: true, noOptionsText: stringEmail.length < 3 && stringNotificacao.length < 3 ? 'Digite para começar a pesquisar' : 'Não Encontrado', renderTags: function (value, getTagProps) { return (value.map(function (option, index) { return (react_1.default.createElement(core_1.Chip, __assign({ variant: 'outlined', label: option[1] || option }, getTagProps({ index: index })))); })); }, renderInput: function (params) { return (react_1.default.createElement(core_1.TextField, __assign({ variant: 'outlined', margin: 'dense', label: 'Contatos:', onChange: function (e) { return setStringNotificacao(e.target.value); }, placeholder: notificacao.length === 0 ? 'Selecionar' : undefined, InputLabelProps: { shrink: true }, error: !!erro.notificacao, helperText: erro.notificacao }, params))); } })),
|
|
244
248
|
react_1.default.createElement(core_1.Grid, { item: true, xs: 12 },
|
|
245
249
|
react_1.default.createElement(core_1.TextField, { variant: 'outlined', margin: 'dense', label: 'Mensagem:', placeholder: 'Mensagem da Notifica\u00E7\u00E3o', fullWidth: true, value: mensagemNotificação, onChange: function (e) { return setMensagemNotificacao(e.target.value); }, error: !!erro.stringNotificacao, helperText: erro.stringNotificacao })),
|
|
246
250
|
react_1.default.createElement(core_1.Grid, { container: true, style: { display: 'flex ' }, direction: 'row-reverse' },
|
|
@@ -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];
|
|
@@ -51,14 +55,14 @@ var react_1 = __importStar(require("react"));
|
|
|
51
55
|
var react_redux_1 = require("react-redux");
|
|
52
56
|
var use_immer_1 = require("use-immer");
|
|
53
57
|
// @ts-ignore
|
|
54
|
-
exports.ModalProviderContext = react_1.createContext();
|
|
58
|
+
exports.ModalProviderContext = (0, react_1.createContext)();
|
|
55
59
|
var ModalProvider = function (_a) {
|
|
56
60
|
var children = _a.children, argousSystem = _a.argousSystem;
|
|
57
|
-
var _b = use_immer_1.useImmer([]), modals = _b[0], setCurrentModal = _b[1];
|
|
58
|
-
var close = react_1.useCallback(function (unmountDelay, index) { return function () {
|
|
61
|
+
var _b = (0, use_immer_1.useImmer)([]), modals = _b[0], setCurrentModal = _b[1];
|
|
62
|
+
var close = (0, react_1.useCallback)(function (unmountDelay, index) { return function () {
|
|
59
63
|
setTimeout(function () { return setCurrentModal(function (modais) { return void (modais.splice(index, 1)); }); }, unmountDelay);
|
|
60
64
|
}; }, [setCurrentModal]);
|
|
61
|
-
var createModal = react_1.useCallback(function (Component, unmountDelay) {
|
|
65
|
+
var createModal = (0, react_1.useCallback)(function (Component, unmountDelay) {
|
|
62
66
|
if (unmountDelay === void 0) { unmountDelay = 0; }
|
|
63
67
|
return function (props) {
|
|
64
68
|
var promise = new Promise(function (resolve, reject) {
|
|
@@ -73,16 +77,16 @@ var ModalProvider = function (_a) {
|
|
|
73
77
|
});
|
|
74
78
|
};
|
|
75
79
|
}, [close, modals.length, setCurrentModal]);
|
|
76
|
-
var openModal = react_1.useMemo(function () { var _a; return (_a = argousSystem === null || argousSystem === void 0 ? void 0 : argousSystem.openModal) === null || _a === void 0 ? void 0 : _a.value; }, [argousSystem]);
|
|
77
|
-
react_1.useEffect(function () {
|
|
80
|
+
var openModal = (0, react_1.useMemo)(function () { var _a; return (_a = argousSystem === null || argousSystem === void 0 ? void 0 : argousSystem.openModal) === null || _a === void 0 ? void 0 : _a.value; }, [argousSystem]);
|
|
81
|
+
(0, react_1.useEffect)(function () {
|
|
78
82
|
if (!openModal)
|
|
79
83
|
return;
|
|
80
84
|
var reject = openModal.reject, resolve = openModal.resolve, props = __rest(openModal, ["reject", "resolve"]);
|
|
81
85
|
createModal(BasicModal_1.default)(props).then(resolve, reject);
|
|
82
|
-
fieldsRedux_1.setAnotherProgramField('openModal', undefined, 'argousSystem');
|
|
86
|
+
(0, fieldsRedux_1.setAnotherProgramField)('openModal', undefined, 'argousSystem');
|
|
83
87
|
//eslint-disable-next-line
|
|
84
88
|
}, [openModal]);
|
|
85
|
-
var context = react_1.useMemo(function () { return ({ createModal: createModal }); }, [createModal]);
|
|
89
|
+
var context = (0, react_1.useMemo)(function () { return ({ createModal: createModal }); }, [createModal]);
|
|
86
90
|
return (react_1.default.createElement(exports.ModalProviderContext.Provider, { value: context },
|
|
87
91
|
children,
|
|
88
92
|
modals.map(function (Modal) { return Modal; })));
|
|
@@ -90,16 +94,16 @@ var ModalProvider = function (_a) {
|
|
|
90
94
|
var mapStateToProps = function (state) { return ({
|
|
91
95
|
argousSystem: state.argous.fields.argousSystem,
|
|
92
96
|
}); };
|
|
93
|
-
exports.default = react_redux_1.connect(mapStateToProps)(ModalProvider);
|
|
97
|
+
exports.default = (0, react_redux_1.connect)(mapStateToProps)(ModalProvider);
|
|
94
98
|
var ModalWrapper = function (_a) {
|
|
95
99
|
var Component = _a.Component, reject = _a.reject, resolve = _a.resolve, close = _a.close, props = __rest(_a, ["Component", "reject", "resolve", "close"]);
|
|
96
|
-
var _b = react_1.useState(true), show = _b[0], setShow = _b[1];
|
|
97
|
-
var cancel = react_1.useCallback(function (reject) { return function (value) {
|
|
100
|
+
var _b = (0, react_1.useState)(true), show = _b[0], setShow = _b[1];
|
|
101
|
+
var cancel = (0, react_1.useCallback)(function (reject) { return function (value) {
|
|
98
102
|
setShow(false);
|
|
99
103
|
reject(value);
|
|
100
104
|
close();
|
|
101
105
|
}; }, [close]);
|
|
102
|
-
var proceed = react_1.useCallback(function (resolve) { return function (value) {
|
|
106
|
+
var proceed = (0, react_1.useCallback)(function (resolve) { return function (value) {
|
|
103
107
|
setShow(false);
|
|
104
108
|
resolve(value);
|
|
105
109
|
close();
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -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]) {
|
|
@@ -107,12 +111,12 @@ var initialState = {
|
|
|
107
111
|
};
|
|
108
112
|
var ContactValidationInput = function (_a) {
|
|
109
113
|
var id = _a.id, _b = _a.type, type = _b === void 0 ? ('cellphone' || 'email') : _b, _c = _a.textFieldProps, textFieldProps = _c === void 0 ? {} : _c, _d = _a.style, style = _d === void 0 ? {} : _d, _e = _a.className, className = _e === void 0 ? '' : _e, disabled = _a.disabled, _f = _a.cpf, cpf = _f === void 0 ? '' : _f, _g = _a.userName, userName = _g === void 0 ? '' : _g, _h = _a.value, value = _h === void 0 ? '' : _h, _j = _a.onChange, onChange = _j === void 0 ? function () { return ''; } : _j, _k = _a.getComponentData, getComponentData = _k === void 0 ? function () { return ''; } : _k;
|
|
110
|
-
var theme = core_1.useTheme();
|
|
111
|
-
var _l = react_1.useState(__assign(__assign({}, initialState), { inputValue: value })), state = _l[0], setState = _l[1];
|
|
114
|
+
var theme = (0, core_1.useTheme)();
|
|
115
|
+
var _l = (0, react_1.useState)(__assign(__assign({}, initialState), { inputValue: value })), state = _l[0], setState = _l[1];
|
|
112
116
|
var inputValue = state.inputValue, loading = state.loading, searched = state.searched, validated = state.validated, idContato = state.idContato, cdContato = state.cdContato, code = state.code, message = state.message, validating = state.validating;
|
|
113
|
-
var createModal = utils_1.useModal().createModal;
|
|
117
|
+
var createModal = (0, utils_1.useModal)().createModal;
|
|
114
118
|
var sealModal = createModal(SealModal_1.default);
|
|
115
|
-
var onChangeRef = react_1.useRef(onChange);
|
|
119
|
+
var onChangeRef = (0, react_1.useRef)(onChange);
|
|
116
120
|
var logicSetState = function (_a) {
|
|
117
121
|
var type = _a.type, field = _a.field, value = _a.value;
|
|
118
122
|
return setState(function (states) {
|
|
@@ -122,7 +126,7 @@ var ContactValidationInput = function (_a) {
|
|
|
122
126
|
};
|
|
123
127
|
var cellphoneType = (type === 'cellphone');
|
|
124
128
|
var emailType = (type === 'email');
|
|
125
|
-
var formattedInputValue = (cellphoneType) ? utils_1.numbersOnly(inputValue) : inputValue;
|
|
129
|
+
var formattedInputValue = (cellphoneType) ? (0, utils_1.numbersOnly)(inputValue) : inputValue;
|
|
126
130
|
var invalidType = (!cellphoneType && !emailType);
|
|
127
131
|
var disabledRule = (disabled || !cpf || !userName || invalidType || loading.input);
|
|
128
132
|
var validatedRule = (searched && validated && !validating);
|
|
@@ -144,17 +148,17 @@ var ContactValidationInput = function (_a) {
|
|
|
144
148
|
var sealButtonStyle = {
|
|
145
149
|
height: '100%',
|
|
146
150
|
color: exports.GREEN_COLOR,
|
|
147
|
-
border: "2px solid "
|
|
151
|
+
border: "2px solid ".concat(exports.GREEN_COLOR),
|
|
148
152
|
borderRadius: 4,
|
|
149
153
|
padding: 5,
|
|
150
154
|
fontSize: 22
|
|
151
155
|
};
|
|
152
|
-
var handleOnChange = react_1.useCallback(function (event) {
|
|
156
|
+
var handleOnChange = (0, react_1.useCallback)(function (event) {
|
|
153
157
|
event.target.value = event.target.value.toString().toLowerCase();
|
|
154
158
|
logicSetState({ type: 'inputValue', value: event.target.value });
|
|
155
159
|
(typeof onChangeRef.current === 'function') && onChangeRef.current(event);
|
|
156
160
|
}, []);
|
|
157
|
-
var search = react_1.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
161
|
+
var search = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
158
162
|
var parameters, fetchOptions, _a, status, cdContato, isVerificado, newInputValue_1, newEvent;
|
|
159
163
|
return __generator(this, function (_b) {
|
|
160
164
|
switch (_b.label) {
|
|
@@ -165,14 +169,14 @@ var ContactValidationInput = function (_a) {
|
|
|
165
169
|
parameters = {
|
|
166
170
|
method: 'S',
|
|
167
171
|
type: (cellphoneType) ? '1' : (emailType) ? '2' : '',
|
|
168
|
-
cdCpf: utils_1.numbersOnly(cpf)
|
|
172
|
+
cdCpf: (0, utils_1.numbersOnly)(cpf)
|
|
169
173
|
};
|
|
170
174
|
fetchOptions = {
|
|
171
175
|
method: 'POST',
|
|
172
176
|
body: JSON.stringify(parameters),
|
|
173
|
-
headers: api_1.headers()
|
|
177
|
+
headers: (0, api_1.headers)()
|
|
174
178
|
};
|
|
175
|
-
return [4 /*yield*/, fetch(api_1.api()
|
|
179
|
+
return [4 /*yield*/, fetch("".concat((0, api_1.api)(), "agscontactconfirmation.rslvr"), fetchOptions).then(function (response) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
176
180
|
switch (_a.label) {
|
|
177
181
|
case 0: return [4 /*yield*/, response.json()];
|
|
178
182
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -192,7 +196,7 @@ var ContactValidationInput = function (_a) {
|
|
|
192
196
|
}
|
|
193
197
|
});
|
|
194
198
|
}); }, [cellphoneType, emailType, invalidType, cpf, handleOnChange]);
|
|
195
|
-
react_1.useEffect(function () {
|
|
199
|
+
(0, react_1.useEffect)(function () {
|
|
196
200
|
search();
|
|
197
201
|
}, [search]);
|
|
198
202
|
var sendValidationCode = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -207,16 +211,16 @@ var ContactValidationInput = function (_a) {
|
|
|
207
211
|
method: 'C',
|
|
208
212
|
type: (cellphoneType) ? '1' : (emailType) ? '2' : '',
|
|
209
213
|
tpMetodo: (emailType) ? '3' : '',
|
|
210
|
-
cdCpf: utils_1.numbersOnly(cpf),
|
|
214
|
+
cdCpf: (0, utils_1.numbersOnly)(cpf),
|
|
211
215
|
dsNome: userName,
|
|
212
216
|
cdContato: formattedInputValue
|
|
213
217
|
};
|
|
214
218
|
fetchOptions = {
|
|
215
219
|
method: 'POST',
|
|
216
220
|
body: JSON.stringify(parameters),
|
|
217
|
-
headers: api_1.headers()
|
|
221
|
+
headers: (0, api_1.headers)()
|
|
218
222
|
};
|
|
219
|
-
return [4 /*yield*/, fetch(api_1.api()
|
|
223
|
+
return [4 /*yield*/, fetch("".concat((0, api_1.api)(), "agscontactconfirmation.rslvr"), fetchOptions).then(function (response) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
220
224
|
switch (_a.label) {
|
|
221
225
|
case 0: return [4 /*yield*/, response.json()];
|
|
222
226
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -225,14 +229,13 @@ var ContactValidationInput = function (_a) {
|
|
|
225
229
|
case 1:
|
|
226
230
|
_a = _b.sent(), status = _a.status, idContato = _a.idContato, cdContato = _a.cdContato, dsErro = _a.dsErro;
|
|
227
231
|
if (status) {
|
|
228
|
-
setState(function (states) { return (__assign(__assign({}, states), { idContato: idContato,
|
|
229
|
-
cdContato: cdContato, validated: false, validating: true, message: {
|
|
232
|
+
setState(function (states) { return (__assign(__assign({}, states), { idContato: idContato, cdContato: cdContato, validated: false, validating: true, message: {
|
|
230
233
|
color: ORANGE_COLOR,
|
|
231
234
|
text: (cellphoneType) ? 'Utilize o código recebido via sms' : (emailType) ? 'Utilize o código recebido via e-mail' : ''
|
|
232
235
|
} })); });
|
|
233
236
|
}
|
|
234
237
|
else {
|
|
235
|
-
(dsErro) && api_2.setError(dsErro);
|
|
238
|
+
(dsErro) && (0, api_2.setError)(dsErro);
|
|
236
239
|
}
|
|
237
240
|
logicSetState({ type: 'loading', field: 'input', value: false });
|
|
238
241
|
return [2 /*return*/];
|
|
@@ -251,16 +254,16 @@ var ContactValidationInput = function (_a) {
|
|
|
251
254
|
method: 'C',
|
|
252
255
|
type: '2',
|
|
253
256
|
tpMetodo: '4',
|
|
254
|
-
cdCpf: utils_1.numbersOnly(cpf),
|
|
257
|
+
cdCpf: (0, utils_1.numbersOnly)(cpf),
|
|
255
258
|
dsNome: userName,
|
|
256
259
|
cdContato: formattedInputValue
|
|
257
260
|
};
|
|
258
261
|
fetchOptions = {
|
|
259
262
|
method: 'POST',
|
|
260
263
|
body: JSON.stringify(parameters),
|
|
261
|
-
headers: api_1.headers()
|
|
264
|
+
headers: (0, api_1.headers)()
|
|
262
265
|
};
|
|
263
|
-
return [4 /*yield*/, fetch(api_1.api()
|
|
266
|
+
return [4 /*yield*/, fetch("".concat((0, api_1.api)(), "agscontactconfirmation.rslvr"), fetchOptions).then(function (response) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
264
267
|
switch (_a.label) {
|
|
265
268
|
case 0: return [4 /*yield*/, response.json()];
|
|
266
269
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -271,11 +274,11 @@ var ContactValidationInput = function (_a) {
|
|
|
271
274
|
if (status) {
|
|
272
275
|
setState(function (states) { return (__assign(__assign({}, states), { idContato: '', cdContato: cdContato, code: '', message: {
|
|
273
276
|
color: '',
|
|
274
|
-
text: "O link de valida\u00E7\u00E3o foi enviado para o e-mail \""
|
|
277
|
+
text: "O link de valida\u00E7\u00E3o foi enviado para o e-mail \"".concat(cdContato, "\"")
|
|
275
278
|
} })); });
|
|
276
279
|
}
|
|
277
280
|
else {
|
|
278
|
-
(dsErro) && api_2.setError(dsErro);
|
|
281
|
+
(dsErro) && (0, api_2.setError)(dsErro);
|
|
279
282
|
}
|
|
280
283
|
logicSetState({ type: 'loading', field: 'sendValidationLink', value: false });
|
|
281
284
|
return [2 /*return*/];
|
|
@@ -295,7 +298,7 @@ var ContactValidationInput = function (_a) {
|
|
|
295
298
|
parameters = {
|
|
296
299
|
method: 'V',
|
|
297
300
|
type: (cellphoneType) ? '1' : (emailType) ? '2' : '',
|
|
298
|
-
cdCpf: utils_1.numbersOnly(cpf),
|
|
301
|
+
cdCpf: (0, utils_1.numbersOnly)(cpf),
|
|
299
302
|
dsNome: userName,
|
|
300
303
|
cdCode: code,
|
|
301
304
|
cdContato: formattedInputValue,
|
|
@@ -305,9 +308,9 @@ var ContactValidationInput = function (_a) {
|
|
|
305
308
|
fetchOptions = {
|
|
306
309
|
method: 'POST',
|
|
307
310
|
body: JSON.stringify(parameters),
|
|
308
|
-
headers: api_1.headers()
|
|
311
|
+
headers: (0, api_1.headers)()
|
|
309
312
|
};
|
|
310
|
-
return [4 /*yield*/, fetch(api_1.api()
|
|
313
|
+
return [4 /*yield*/, fetch("".concat((0, api_1.api)(), "agscontactconfirmation.rslvr"), fetchOptions).then(function (response) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
311
314
|
switch (_a.label) {
|
|
312
315
|
case 0: return [4 /*yield*/, response.json()];
|
|
313
316
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -351,7 +354,7 @@ var ContactValidationInput = function (_a) {
|
|
|
351
354
|
}
|
|
352
355
|
});
|
|
353
356
|
}); };
|
|
354
|
-
var checkConsistency = react_1.useCallback(function () {
|
|
357
|
+
var checkConsistency = (0, react_1.useCallback)(function () {
|
|
355
358
|
if ((formattedInputValue === cdContato) && validated)
|
|
356
359
|
logicSetState({ type: 'validating', value: false });
|
|
357
360
|
else if (!(formattedInputValue === cdContato) && validated)
|
|
@@ -360,8 +363,8 @@ var ContactValidationInput = function (_a) {
|
|
|
360
363
|
setState(function (states) { return (__assign(__assign({}, states), { idContato: '', validated: false, validating: false, code: '', message: messageInitialState })); });
|
|
361
364
|
}
|
|
362
365
|
}, [formattedInputValue, cdContato, validated, validating]);
|
|
363
|
-
react_1.useEffect(function () { return checkConsistency(); }, [formattedInputValue, checkConsistency]);
|
|
364
|
-
react_1.useEffect(function () {
|
|
366
|
+
(0, react_1.useEffect)(function () { return checkConsistency(); }, [formattedInputValue, checkConsistency]);
|
|
367
|
+
(0, react_1.useEffect)(function () {
|
|
365
368
|
(typeof getComponentData === 'function') && getComponentData(state);
|
|
366
369
|
}, [state, getComponentData]);
|
|
367
370
|
return react_1.default.createElement(core_1.Grid, __assign({ container: true, direction: 'column' }, { id: id, className: className }, { style: __assign(__assign({}, style), containerStyle) }),
|
|
@@ -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]) {
|
|
@@ -174,9 +178,9 @@ var icones;
|
|
|
174
178
|
var IconsComponent = function (_a) {
|
|
175
179
|
var type = _a.type, fileName = _a.fileName, mimeType = _a.mimeType, idDocumento = _a.idDocumento, link = _a.link, props = __rest(_a, ["type", "fileName", "mimeType", "idDocumento", "link"]);
|
|
176
180
|
/** @type {[FileIcons, React.Dispatch<FileIcons>]} */
|
|
177
|
-
var _b = react_1.useState(icones), state = _b[0], setState = _b[1];
|
|
178
|
-
var _c = react_1.useState(), preview = _c[0], setPreview = _c[1];
|
|
179
|
-
var setarState = react_1.useCallback(function () {
|
|
181
|
+
var _b = (0, react_1.useState)(icones), state = _b[0], setState = _b[1];
|
|
182
|
+
var _c = (0, react_1.useState)(), preview = _c[0], setPreview = _c[1];
|
|
183
|
+
var setarState = (0, react_1.useCallback)(function () {
|
|
180
184
|
if (state)
|
|
181
185
|
return;
|
|
182
186
|
if (icones)
|
|
@@ -184,8 +188,8 @@ var IconsComponent = function (_a) {
|
|
|
184
188
|
else
|
|
185
189
|
setTimeout(setarState, 200);
|
|
186
190
|
}, [state]);
|
|
187
|
-
react_1.useEffect(setarState, [setarState]);
|
|
188
|
-
var selectedImage = react_1.useMemo(function () {
|
|
191
|
+
(0, react_1.useEffect)(setarState, [setarState]);
|
|
192
|
+
var selectedImage = (0, react_1.useMemo)(function () {
|
|
189
193
|
var _a;
|
|
190
194
|
if (type)
|
|
191
195
|
return type;
|
|
@@ -201,14 +205,14 @@ var IconsComponent = function (_a) {
|
|
|
201
205
|
return iconClasses[key];
|
|
202
206
|
return 'file';
|
|
203
207
|
}, [type, mimeType, fileName, state]);
|
|
204
|
-
var buscaImagemPreview = react_1.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
208
|
+
var buscaImagemPreview = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
205
209
|
var file, _a;
|
|
206
210
|
return __generator(this, function (_b) {
|
|
207
211
|
switch (_b.label) {
|
|
208
212
|
case 0:
|
|
209
213
|
if (!(idDocumento && (mimeType === null || mimeType === void 0 ? void 0 : mimeType.includes('image')))) return [3 /*break*/, 3];
|
|
210
214
|
_a = api_1.getFileFromLink;
|
|
211
|
-
return [4 /*yield*/, api_1.getLink(idDocumento)];
|
|
215
|
+
return [4 /*yield*/, (0, api_1.getLink)(idDocumento)];
|
|
212
216
|
case 1: return [4 /*yield*/, _a.apply(void 0, [_b.sent()])];
|
|
213
217
|
case 2:
|
|
214
218
|
file = _b.sent();
|
|
@@ -218,7 +222,7 @@ var IconsComponent = function (_a) {
|
|
|
218
222
|
}
|
|
219
223
|
});
|
|
220
224
|
}); }, [mimeType, idDocumento]);
|
|
221
|
-
react_1.useEffect(function () { return void (buscaImagemPreview()); }, [buscaImagemPreview]);
|
|
225
|
+
(0, react_1.useEffect)(function () { return void (buscaImagemPreview()); }, [buscaImagemPreview]);
|
|
222
226
|
if (!state)
|
|
223
227
|
return react_1.default.createElement(core_1.CircularProgress, { disableShrink: true });
|
|
224
228
|
return react_1.default.createElement(react_1.default.Fragment, null, (preview) ? (react_1.default.createElement("img", __assign({ src: preview, alt: type }, props, { style: { position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, width: '100%', height: '100%', objectFit: 'contain' } }))) : (react_1.default.createElement("img", __assign({ src: state[selectedImage], alt: type }, props))));
|
|
@@ -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];
|
|
@@ -51,7 +55,7 @@ var react_1 = __importStar(require("react"));
|
|
|
51
55
|
var md_1 = require("react-icons/md");
|
|
52
56
|
var ModalVisualizacaoDocumentos = function (_a) {
|
|
53
57
|
var open = _a.open, proceed = _a.proceed, tokenSistema = _a.tokenSistema, props = __rest(_a, ["open", "proceed", "tokenSistema"]);
|
|
54
|
-
var _b = react_1.useState(props), visualizando = _b[0], setVisualizando = _b[1];
|
|
58
|
+
var _b = (0, react_1.useState)(props), visualizando = _b[0], setVisualizando = _b[1];
|
|
55
59
|
return (react_1.default.createElement(core_1.Dialog, { fullScreen: true, open: open, onClose: function () { return proceed(undefined); }, onKeyDown: index_1.stopPrntScr, onContextMenu: function (e) { return e.preventDefault(); } },
|
|
56
60
|
react_1.default.createElement(core_1.AppBar, { style: { position: 'relative' } },
|
|
57
61
|
react_1.default.createElement(core_1.Toolbar, null,
|
|
@@ -62,19 +66,19 @@ var ModalVisualizacaoDocumentos = function (_a) {
|
|
|
62
66
|
react_1.default.createElement(core_1.IconButton, { onClick: function (_) {
|
|
63
67
|
var _a;
|
|
64
68
|
if (!((_a = visualizando === null || visualizando === void 0 ? void 0 : visualizando.linkPronto) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
65
|
-
index_1.geraLog(visualizando.idDocumento, 'Impressão do documento', '3', tokenSistema);
|
|
69
|
+
(0, index_1.geraLog)(visualizando.idDocumento, 'Impressão do documento', '3', tokenSistema);
|
|
66
70
|
}
|
|
67
|
-
index_1.printUrl(visualizando.URL ? visualizando.URL : visualizando.linkPronto);
|
|
71
|
+
(0, index_1.printUrl)(visualizando.URL ? visualizando.URL : visualizando.linkPronto);
|
|
68
72
|
}, color: 'inherit', title: 'Imprimir arquivo' },
|
|
69
73
|
react_1.default.createElement(md_1.MdPrint, null)),
|
|
70
74
|
react_1.default.createElement(core_1.IconButton, { onClick: function () {
|
|
71
75
|
var _a;
|
|
72
76
|
if (!((_a = visualizando === null || visualizando === void 0 ? void 0 : visualizando.linkPronto) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
73
|
-
index_1.geraLog(visualizando.idDocumento, 'Download do documento', '3', tokenSistema);
|
|
74
|
-
index_1.downloadFromUrl(visualizando === null || visualizando === void 0 ? void 0 : visualizando.URL, visualizando === null || visualizando === void 0 ? void 0 : visualizando.nome);
|
|
77
|
+
(0, index_1.geraLog)(visualizando.idDocumento, 'Download do documento', '3', tokenSistema);
|
|
78
|
+
(0, index_1.downloadFromUrl)(visualizando === null || visualizando === void 0 ? void 0 : visualizando.URL, visualizando === null || visualizando === void 0 ? void 0 : visualizando.nome);
|
|
75
79
|
}
|
|
76
80
|
else {
|
|
77
|
-
index_1.downloadBase64(visualizando === null || visualizando === void 0 ? void 0 : visualizando.linkPronto, visualizando === null || visualizando === void 0 ? void 0 : visualizando.nome);
|
|
81
|
+
(0, index_1.downloadBase64)(visualizando === null || visualizando === void 0 ? void 0 : visualizando.linkPronto, visualizando === null || visualizando === void 0 ? void 0 : visualizando.nome);
|
|
78
82
|
}
|
|
79
83
|
}, color: 'inherit', title: 'Baixar arquivo' },
|
|
80
84
|
react_1.default.createElement(md_1.MdFileDownload, null)))))),
|
|
@@ -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]) {
|
|
@@ -69,7 +73,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
69
73
|
var api_1 = require("../../utils/api");
|
|
70
74
|
var core_1 = require("@material-ui/core");
|
|
71
75
|
var react_1 = __importStar(require("react"));
|
|
72
|
-
var useStyles = core_1.makeStyles(function (theme) { return ({
|
|
76
|
+
var useStyles = (0, core_1.makeStyles)(function (theme) { return ({
|
|
73
77
|
iframe: {
|
|
74
78
|
width: '100%',
|
|
75
79
|
height: '100%',
|
|
@@ -92,10 +96,10 @@ var Visualizacao = function (_a) {
|
|
|
92
96
|
var _b;
|
|
93
97
|
var idDocumento = _a.idDocumento, nrRevisao = _a.nrRevisao, setVisualizando = _a.setVisualizando, proceed = _a.proceed, documento = _a.URL, linkPronto = _a.linkPronto, tokenSistema = _a.tokenSistema, ariaLabel = _a.ariaLabel;
|
|
94
98
|
var classes = useStyles();
|
|
95
|
-
var blockLoop = react_1.useRef(null);
|
|
96
|
-
var _c = react_1.useState({}), type = _c[0].type, setArquivo = _c[1];
|
|
99
|
+
var blockLoop = (0, react_1.useRef)(null);
|
|
100
|
+
var _c = (0, react_1.useState)({}), type = _c[0].type, setArquivo = _c[1];
|
|
97
101
|
var tagType = (_b = type === null || type === void 0 ? void 0 : type.match(/^[^/]+/)) === null || _b === void 0 ? void 0 : _b.at(0);
|
|
98
|
-
var _d = react_1.useState(linkPronto), link = _d[0], setLink = _d[1];
|
|
102
|
+
var _d = (0, react_1.useState)(linkPronto), link = _d[0], setLink = _d[1];
|
|
99
103
|
var preparaLink = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
100
104
|
var objGetLinkDocumento, res, _a, _b, file, url_1, error_1;
|
|
101
105
|
return __generator(this, function (_c) {
|
|
@@ -112,7 +116,7 @@ var Visualizacao = function (_a) {
|
|
|
112
116
|
if (!documento) return [3 /*break*/, 2];
|
|
113
117
|
_b = { link: { URL: documento } };
|
|
114
118
|
return [3 /*break*/, 4];
|
|
115
|
-
case 2: return [4 /*yield*/, api_1.serverAction('getLinkDocumento', objGetLinkDocumento, 'CtrlDocumentos', true)];
|
|
119
|
+
case 2: return [4 /*yield*/, (0, api_1.serverAction)('getLinkDocumento', objGetLinkDocumento, 'CtrlDocumentos', true)];
|
|
116
120
|
case 3:
|
|
117
121
|
_b = _c.sent();
|
|
118
122
|
_c.label = 4;
|
|
@@ -139,15 +143,15 @@ var Visualizacao = function (_a) {
|
|
|
139
143
|
return [3 /*break*/, 10];
|
|
140
144
|
case 9:
|
|
141
145
|
error_1 = _c.sent();
|
|
142
|
-
api_1.setError('Não foi possível visualizar este documento.');
|
|
146
|
+
(0, api_1.setError)('Não foi possível visualizar este documento.');
|
|
143
147
|
return [3 /*break*/, 10];
|
|
144
148
|
case 10: return [2 /*return*/];
|
|
145
149
|
}
|
|
146
150
|
});
|
|
147
151
|
}); };
|
|
148
152
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
149
|
-
react_1.useEffect(function () { return preparaLink(); }, []);
|
|
150
|
-
react_1.useEffect(function () {
|
|
153
|
+
(0, react_1.useEffect)(function () { return preparaLink(); }, []);
|
|
154
|
+
(0, react_1.useEffect)(function () {
|
|
151
155
|
onchange = function (evt) {
|
|
152
156
|
var v = 'visible', h = 'hidden', evtMap = { focus: v, focusin: v, pageshow: v, blur: h, focusout: h, pagehide: h };
|
|
153
157
|
evt = evt || window.event;
|
|
@@ -198,7 +202,7 @@ var Visualizacao = function (_a) {
|
|
|
198
202
|
case 'video':
|
|
199
203
|
return react_1.default.createElement("video", { className: classes.restricSize, "aria-label": ariaLabel, controls: true, controlsList: 'nodownload', autoPlay: true, src: link });
|
|
200
204
|
default:
|
|
201
|
-
return link ? react_1.default.createElement("iframe", { className: classes.iframe, "aria-label": ariaLabel, title: 'Iframe', src: link
|
|
205
|
+
return link ? react_1.default.createElement("iframe", { className: classes.iframe, "aria-label": ariaLabel, title: 'Iframe', src: "".concat(link, "#toolbar=0") }) : react_1.default.createElement(core_1.Box, { justifyContent: 'center', alignItems: 'center', display: 'flex' },
|
|
202
206
|
react_1.default.createElement(core_1.CircularProgress, { disableShrink: true }));
|
|
203
207
|
}
|
|
204
208
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|