argous 1.2.222 → 1.2.224
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/index.d.ts +2 -0
- package/dist/api/index.js +36 -1
- package/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +9 -1
- package/dist/components/ArgousComplexTable/ArgousComplexTable.js +7 -7
- package/dist/components/BarraFerramentas/BarraFerramentas.d.ts +4 -1
- package/dist/components/BarraFerramentas/BarraFerramentas.js +48 -26
- package/dist/components/Document/Icons.d.ts +193 -0
- package/dist/components/Document/Icons.js +269 -0
- package/dist/components/Document/ModalVisualizacaoDocumentos.d.ts +8 -0
- package/dist/components/Document/ModalVisualizacaoDocumentos.js +84 -0
- package/dist/components/Document/Visualizacao.d.ts +12 -0
- package/dist/components/Document/Visualizacao.js +205 -0
- package/dist/components/Document/icons/ai.svg +20 -0
- package/dist/components/Document/icons/audio.svg +16 -0
- package/dist/components/Document/icons/avi.svg +15 -0
- package/dist/components/Document/icons/css.svg +47 -0
- package/dist/components/Document/icons/csv.svg +37 -0
- package/dist/components/Document/icons/dbf.svg +30 -0
- package/dist/components/Document/icons/doc.svg +47 -0
- package/dist/components/Document/icons/dwg.svg +32 -0
- package/dist/components/Document/icons/exe.svg +20 -0
- package/dist/components/Document/icons/file.svg +11 -0
- package/dist/components/Document/icons/fla.svg +23 -0
- package/dist/components/Document/icons/html.svg +23 -0
- package/dist/components/Document/icons/image.svg +16 -0
- package/dist/components/Document/icons/iso.svg +40 -0
- package/dist/components/Document/icons/jpg.svg +33 -0
- package/dist/components/Document/icons/js.svg +40 -0
- package/dist/components/Document/icons/json.svg +45 -0
- package/dist/components/Document/icons/mod.svg +41 -0
- package/dist/components/Document/icons/mp3.svg +36 -0
- package/dist/components/Document/icons/mp4.svg +25 -0
- package/dist/components/Document/icons/pdf.svg +35 -0
- package/dist/components/Document/icons/png.svg +30 -0
- package/dist/components/Document/icons/ppt.svg +31 -0
- package/dist/components/Document/icons/psd.svg +50 -0
- package/dist/components/Document/icons/rtf.svg +35 -0
- package/dist/components/Document/icons/search.svg +20 -0
- package/dist/components/Document/icons/svg.svg +34 -0
- package/dist/components/Document/icons/txt.svg +29 -0
- package/dist/components/Document/icons/video.svg +17 -0
- package/dist/components/Document/icons/xls.svg +31 -0
- package/dist/components/Document/icons/xml.svg +25 -0
- package/dist/components/Document/icons/zip.svg +24 -0
- package/dist/components/Document/icons/zip1.svg +18 -0
- package/dist/components/Document/index.d.ts +3 -0
- package/dist/components/Document/index.js +21 -0
- package/dist/components/Programa/Annotations/Annotation.d.ts +19 -0
- package/dist/components/Programa/Annotations/Annotation.js +316 -0
- package/dist/components/Programa/Annotations/AnnotationsList.d.ts +3 -0
- package/dist/components/Programa/Annotations/AnnotationsList.js +50 -0
- package/dist/components/Programa/Annotations/Input/FileInput.d.ts +6 -0
- package/dist/components/Programa/Annotations/Input/FileInput.js +147 -0
- package/dist/components/Programa/Annotations/Input/Input.d.ts +3 -0
- package/dist/components/Programa/Annotations/Input/Input.js +218 -0
- package/dist/components/Programa/Annotations/Input/PrivacySelection.d.ts +7 -0
- package/dist/components/Programa/Annotations/Input/PrivacySelection.js +65 -0
- package/dist/components/Programa/Annotations/Input/ReplyInformation.d.ts +5 -0
- package/dist/components/Programa/Annotations/Input/ReplyInformation.js +78 -0
- package/dist/components/Programa/Annotations/Input/UsersAutocomplete.d.ts +7 -0
- package/dist/components/Programa/Annotations/Input/UsersAutocomplete.js +139 -0
- package/dist/components/Programa/Annotations/index.d.ts +23 -0
- package/dist/components/Programa/Annotations/index.js +195 -0
- package/dist/components/Programa/Annotations/utils.d.ts +18 -0
- package/dist/components/Programa/Annotations/utils.js +46 -0
- package/dist/components/Programa/Programa.d.ts +3 -1
- package/dist/components/Programa/Programa.js +20 -6
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +1 -0
- package/dist/utils/index.d.ts +47 -0
- package/dist/utils/index.js +104 -4
- package/lib/api/index.js +24 -6
- package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +9 -1
- package/lib/components/ArgousComplexTable/ArgousComplexTable.js +6 -4
- package/lib/components/BarraFerramentas/BarraFerramentas.d.ts +4 -1
- package/lib/components/BarraFerramentas/BarraFerramentas.js +92 -50
- package/lib/components/Document/Icons.js +169 -0
- package/lib/components/Document/ModalVisualizacaoDocumentos.js +64 -0
- package/lib/components/Document/Visualizacao.js +104 -0
- package/lib/components/Document/icons/ai.svg +20 -0
- package/lib/components/Document/icons/audio.svg +16 -0
- package/lib/components/Document/icons/avi.svg +15 -0
- package/lib/components/Document/icons/css.svg +47 -0
- package/lib/components/Document/icons/csv.svg +37 -0
- package/lib/components/Document/icons/dbf.svg +30 -0
- package/lib/components/Document/icons/doc.svg +47 -0
- package/lib/components/Document/icons/dwg.svg +32 -0
- package/lib/components/Document/icons/exe.svg +20 -0
- package/lib/components/Document/icons/file.svg +11 -0
- package/lib/components/Document/icons/fla.svg +23 -0
- package/lib/components/Document/icons/html.svg +23 -0
- package/lib/components/Document/icons/image.svg +16 -0
- package/lib/components/Document/icons/iso.svg +40 -0
- package/lib/components/Document/icons/jpg.svg +33 -0
- package/lib/components/Document/icons/js.svg +40 -0
- package/lib/components/Document/icons/json.svg +45 -0
- package/lib/components/Document/icons/mod.svg +41 -0
- package/lib/components/Document/icons/mp3.svg +36 -0
- package/lib/components/Document/icons/mp4.svg +25 -0
- package/lib/components/Document/icons/pdf.svg +35 -0
- package/lib/components/Document/icons/png.svg +30 -0
- package/lib/components/Document/icons/ppt.svg +31 -0
- package/lib/components/Document/icons/psd.svg +50 -0
- package/lib/components/Document/icons/rtf.svg +35 -0
- package/lib/components/Document/icons/search.svg +20 -0
- package/lib/components/Document/icons/svg.svg +34 -0
- package/lib/components/Document/icons/txt.svg +29 -0
- package/lib/components/Document/icons/video.svg +17 -0
- package/lib/components/Document/icons/xls.svg +31 -0
- package/lib/components/Document/icons/xml.svg +25 -0
- package/lib/components/Document/icons/zip.svg +24 -0
- package/lib/components/Document/icons/zip1.svg +18 -0
- package/lib/components/Document/index.d.ts +3 -0
- package/lib/components/Document/index.js +3 -0
- package/lib/components/Programa/Annotations/Annotation.js +274 -0
- package/lib/components/Programa/Annotations/AnnotationsList.js +30 -0
- package/lib/components/Programa/Annotations/Input/FileInput.js +96 -0
- package/lib/components/Programa/Annotations/Input/Input.js +190 -0
- package/lib/components/Programa/Annotations/Input/PrivacySelection.js +72 -0
- package/lib/components/Programa/Annotations/Input/ReplyInformation.js +86 -0
- package/lib/components/Programa/Annotations/Input/UsersAutocomplete.js +122 -0
- package/lib/components/Programa/Annotations/index.js +136 -0
- package/lib/components/Programa/Annotations/utils.js +30 -0
- package/lib/components/Programa/Programa.d.ts +3 -1
- package/lib/components/Programa/Programa.js +20 -5
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +3 -1
- package/lib/utils/index.ts +112 -0
- package/package.json +3 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
|
+
function step(op) {
|
|
46
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
+
while (_) try {
|
|
48
|
+
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
|
+
switch (op[0]) {
|
|
51
|
+
case 0: case 1: t = op; break;
|
|
52
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
53
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
54
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
55
|
+
default:
|
|
56
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
57
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
58
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
60
|
+
if (t[2]) _.ops.pop();
|
|
61
|
+
_.trys.pop(); continue;
|
|
62
|
+
}
|
|
63
|
+
op = body.call(thisArg, _);
|
|
64
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
65
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
69
|
+
var t = {};
|
|
70
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
71
|
+
t[p] = s[p];
|
|
72
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
73
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
74
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
75
|
+
t[p[i]] = s[p[i]];
|
|
76
|
+
}
|
|
77
|
+
return t;
|
|
78
|
+
};
|
|
79
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
80
|
+
exports.Icons = exports.IconsComponent = void 0;
|
|
81
|
+
var api_1 = require("../../api");
|
|
82
|
+
var core_1 = require("@material-ui/core");
|
|
83
|
+
var react_1 = __importStar(require("react"));
|
|
84
|
+
var reqSvgs = require.context('./icons', true, /\.svg$/);
|
|
85
|
+
var loadSvg = function (svg, path) { return __awaiter(void 0, void 0, void 0, function () {
|
|
86
|
+
var _a, _b, _c;
|
|
87
|
+
var _d;
|
|
88
|
+
return __generator(this, function (_e) {
|
|
89
|
+
switch (_e.label) {
|
|
90
|
+
case 0:
|
|
91
|
+
_d = {};
|
|
92
|
+
_a = path.replace(/.\/|.svg/g, '');
|
|
93
|
+
_c = (_b = URL).createObjectURL;
|
|
94
|
+
return [4 /*yield*/, fetch((svg === null || svg === void 0 ? void 0 : svg.default) || svg)];
|
|
95
|
+
case 1: return [4 /*yield*/, (_e.sent()).blob()];
|
|
96
|
+
case 2: return [2 /*return*/, (_d[_a] = _c.apply(_b, [_e.sent()]), _d)];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}); };
|
|
100
|
+
var iconClasses = {
|
|
101
|
+
'application/pdf': 'pdf',
|
|
102
|
+
'application/msword': 'doc',
|
|
103
|
+
'application/vnd.ms-word': 'doc',
|
|
104
|
+
'application/vnd.oasis.opendocument.text': 'doc',
|
|
105
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml': 'doc',
|
|
106
|
+
'application/vnd.ms-excel': 'xls',
|
|
107
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml': 'xls',
|
|
108
|
+
'application/vnd.oasis.opendocument.spreadsheet': 'xls',
|
|
109
|
+
'application/vnd.ms-powerpoint': 'ppt',
|
|
110
|
+
'application/vnd.openxmlformats-officedocument.presentationml': 'ppt',
|
|
111
|
+
'application/vnd.oasis.opendocument.presentation': 'ppt',
|
|
112
|
+
'text/rtf': 'rtf',
|
|
113
|
+
'text/plain': 'txt',
|
|
114
|
+
'text/html': 'html',
|
|
115
|
+
'text/css': 'css',
|
|
116
|
+
'text/csv': 'csv',
|
|
117
|
+
'application/json': 'json',
|
|
118
|
+
'image/vnd.adobe.photoshop': 'psd',
|
|
119
|
+
'image/photoshop': 'psd',
|
|
120
|
+
'image/x-photoshop': 'psd',
|
|
121
|
+
'image/psd': 'psd',
|
|
122
|
+
'application/photoshop': 'psd',
|
|
123
|
+
'application/psd': 'psd',
|
|
124
|
+
'zz-application/zz-winassoc-psd': 'psd',
|
|
125
|
+
'video/x-msvideo': 'avi',
|
|
126
|
+
'application/gzip': 'zip1',
|
|
127
|
+
'application/zip': 'zip',
|
|
128
|
+
'application/acad': 'dwg',
|
|
129
|
+
'image/vnd.dwg': 'dwg',
|
|
130
|
+
'image/x-dwg': 'dwg',
|
|
131
|
+
'application/octet-stream': 'exe',
|
|
132
|
+
'audio/flac': 'fla',
|
|
133
|
+
'image/jpeg': 'jpg',
|
|
134
|
+
'image/jpg': 'jpg',
|
|
135
|
+
'text/javascript': 'js',
|
|
136
|
+
'audio/mpeg': 'mp3',
|
|
137
|
+
'video/mpeg': 'mp4',
|
|
138
|
+
'audio/mp4': 'mp4',
|
|
139
|
+
'image/png': 'png',
|
|
140
|
+
'application/xml': 'xml',
|
|
141
|
+
'application/x-7z-compressed': 'zip1',
|
|
142
|
+
'application/x-compressed-tar': 'zip1',
|
|
143
|
+
'application/vnd.rar': 'zip1',
|
|
144
|
+
'modelo/contrato': 'mod',
|
|
145
|
+
image: 'image',
|
|
146
|
+
audio: 'audio',
|
|
147
|
+
video: 'video'
|
|
148
|
+
};
|
|
149
|
+
var icones;
|
|
150
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
151
|
+
return __generator(this, function (_a) {
|
|
152
|
+
switch (_a.label) {
|
|
153
|
+
case 0: return [4 /*yield*/, Promise.all(reqSvgs.keys()
|
|
154
|
+
.map(function (path) { return loadSvg(reqSvgs(path), path); }))];
|
|
155
|
+
case 1: return [4 /*yield*/, (_a.sent()).reduce(function (acc, item) { return (__assign(__assign({}, acc), item)); }, {})];
|
|
156
|
+
case 2:
|
|
157
|
+
icones = _a.sent();
|
|
158
|
+
return [2 /*return*/];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}); })();
|
|
162
|
+
// eslint-disable-next-line valid-jsdoc
|
|
163
|
+
/**
|
|
164
|
+
* @typedef {'ai'|'audio'|'avi'|'css'|'csv'|'dbf'|'doc'|'dwg'|'exe'|'file'|'fla'|'html'|'image'|'iso'|'jpg'|'js'|'json'|'mod'|'mp3'|'mp4'|'pdf'|'png'|'ppt'|'psd'|'rtf'|'search'|'svg'|'txt'|'video'|'xls'|'xml'|'zip'|'zip1'} Extencoes
|
|
165
|
+
*
|
|
166
|
+
* @typedef {object} Tipos
|
|
167
|
+
* @property {Extencoes} type - Tipos de arquivos suportados
|
|
168
|
+
* @property {string} mimeType - MimeType do arquivo
|
|
169
|
+
* @property {string} fileName - Nome do arquivo
|
|
170
|
+
*
|
|
171
|
+
* @param {React.ImgHTMLAttributes<HTMLImageElement> & Tipos} props - props
|
|
172
|
+
* @returns {JSX.Element} retorno
|
|
173
|
+
*/
|
|
174
|
+
var IconsComponent = function (_a) {
|
|
175
|
+
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
|
+
/** @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 () {
|
|
180
|
+
if (state)
|
|
181
|
+
return;
|
|
182
|
+
if (icones)
|
|
183
|
+
setState(icones);
|
|
184
|
+
else
|
|
185
|
+
setTimeout(setarState, 200);
|
|
186
|
+
}, [state]);
|
|
187
|
+
react_1.useEffect(setarState, [setarState]);
|
|
188
|
+
var selectedImage = react_1.useMemo(function () {
|
|
189
|
+
var _a;
|
|
190
|
+
if (type)
|
|
191
|
+
return type;
|
|
192
|
+
/** @type {Extencoes} */
|
|
193
|
+
var extension = (_a = fileName === null || fileName === void 0 ? void 0 : fileName.match(/\.([^.]*)$/)) === null || _a === void 0 ? void 0 : _a.at(1);
|
|
194
|
+
if (!state)
|
|
195
|
+
return '';
|
|
196
|
+
if (Object.keys(state).includes(extension))
|
|
197
|
+
return extension;
|
|
198
|
+
for (var key in iconClasses)
|
|
199
|
+
if (Object.prototype.hasOwnProperty.call(iconClasses, key))
|
|
200
|
+
if ((mimeType === null || mimeType === void 0 ? void 0 : mimeType.search(key)) === 0)
|
|
201
|
+
return iconClasses[key];
|
|
202
|
+
return 'file';
|
|
203
|
+
}, [type, mimeType, fileName, state]);
|
|
204
|
+
var buscaImagemPreview = react_1.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
205
|
+
var file, _a;
|
|
206
|
+
return __generator(this, function (_b) {
|
|
207
|
+
switch (_b.label) {
|
|
208
|
+
case 0:
|
|
209
|
+
if (!(idDocumento && (mimeType === null || mimeType === void 0 ? void 0 : mimeType.includes('image')))) return [3 /*break*/, 3];
|
|
210
|
+
_a = api_1.getFileFromLink;
|
|
211
|
+
return [4 /*yield*/, api_1.getLink(idDocumento)];
|
|
212
|
+
case 1: return [4 /*yield*/, _a.apply(void 0, [_b.sent()])];
|
|
213
|
+
case 2:
|
|
214
|
+
file = _b.sent();
|
|
215
|
+
setPreview(file);
|
|
216
|
+
_b.label = 3;
|
|
217
|
+
case 3: return [2 /*return*/];
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}); }, [mimeType, idDocumento]);
|
|
221
|
+
react_1.useEffect(function () { return void (buscaImagemPreview()); }, [buscaImagemPreview]);
|
|
222
|
+
if (!state)
|
|
223
|
+
return react_1.default.createElement(core_1.CircularProgress, { disableShrink: true });
|
|
224
|
+
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))));
|
|
225
|
+
};
|
|
226
|
+
exports.IconsComponent = IconsComponent;
|
|
227
|
+
/**
|
|
228
|
+
* @typedef {object} FileIcons - Objeto de icones
|
|
229
|
+
* @property {JSX.Element} ai -Icone de arquivos do Ilustrator
|
|
230
|
+
* @property {JSX.Element} audio -Icone genérico de Audio
|
|
231
|
+
* @property {JSX.Element} avi -Icone de videos AVI
|
|
232
|
+
* @property {JSX.Element} css -Icone de arquivos CSS
|
|
233
|
+
* @property {JSX.Element} csv -Icone de arquivos CSV
|
|
234
|
+
* @property {JSX.Element} dbf -Icone de arquivos DBF
|
|
235
|
+
* @property {JSX.Element} doc -Icone de arquivos Word
|
|
236
|
+
* @property {JSX.Element} dwg -Icone de arquivos DWG
|
|
237
|
+
* @property {JSX.Element} exe -Icone de arquivos EXE
|
|
238
|
+
* @property {JSX.Element} file -Icone de arquivos genéricos
|
|
239
|
+
* @property {JSX.Element} fla -Icone de arquivos FLA
|
|
240
|
+
* @property {JSX.Element} html -Icone de arquivos HTML
|
|
241
|
+
* @property {JSX.Element} image -Icone genérico de Imagens
|
|
242
|
+
* @property {JSX.Element} iso -Icone de imagens ISO
|
|
243
|
+
* @property {JSX.Element} jpg -Icone de imagens JPG
|
|
244
|
+
* @property {JSX.Element} js -Icone de arquivos Javascript
|
|
245
|
+
* @property {JSX.Element} json -Icone de arquivos JSON
|
|
246
|
+
* @property {JSX.Element} mod -Icone de modelos de documentos
|
|
247
|
+
* @property {JSX.Element} mp3 -Icone de músicas MP3
|
|
248
|
+
* @property {JSX.Element} mp4 -Icone de vídeos MP4
|
|
249
|
+
* @property {JSX.Element} pdf -Icone de arquivos PDP
|
|
250
|
+
* @property {JSX.Element} png -Icone de imagens PNG
|
|
251
|
+
* @property {JSX.Element} ppt -Icone de arquivos do Power Point
|
|
252
|
+
* @property {JSX.Element} psd -Icone de arquivos do Photoshop
|
|
253
|
+
* @property {JSX.Element} rtf -Icone de arquivos RTF
|
|
254
|
+
* @property {JSX.Element} search -Icone genérico de Busca
|
|
255
|
+
* @property {JSX.Element} svg -Icone de arquivos SVG
|
|
256
|
+
* @property {JSX.Element} txt -Icone de arquivos de Texto
|
|
257
|
+
* @property {JSX.Element} video -Icone genérico de Vídeo
|
|
258
|
+
* @property {JSX.Element} xls -Icone de arquivos do Excel
|
|
259
|
+
* @property {JSX.Element} xml -Icone de arquivos XML
|
|
260
|
+
* @property {JSX.Element} zip -Icone de arquivos ZIP
|
|
261
|
+
* @property {JSX.Element} zip1 -Icone genérico de arquivos comprimidos
|
|
262
|
+
*/
|
|
263
|
+
/** @type {FileIcons} */
|
|
264
|
+
exports.Icons = reqSvgs.keys().reduce(function (images, path) {
|
|
265
|
+
var key = path.replace(/.\/|.svg/g, '');
|
|
266
|
+
images[key] = react_1.default.createElement(exports.IconsComponent, { type: key });
|
|
267
|
+
return images;
|
|
268
|
+
}, {});
|
|
269
|
+
exports.default = exports.Icons;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
+
var t = {};
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
+
t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
var Visualizacao_1 = __importDefault(require("./Visualizacao"));
|
|
48
|
+
var index_1 = require("../../utils/index");
|
|
49
|
+
var core_1 = require("@material-ui/core");
|
|
50
|
+
var react_1 = __importStar(require("react"));
|
|
51
|
+
var md_1 = require("react-icons/md");
|
|
52
|
+
var ModalVisualizacaoDocumentos = function (_a) {
|
|
53
|
+
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];
|
|
55
|
+
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
|
+
react_1.default.createElement(core_1.AppBar, { style: { position: 'relative' } },
|
|
57
|
+
react_1.default.createElement(core_1.Toolbar, null,
|
|
58
|
+
react_1.default.createElement(core_1.IconButton, { edge: 'start', color: 'inherit', onClick: function () { return proceed(undefined); } },
|
|
59
|
+
react_1.default.createElement(md_1.MdClose, null)),
|
|
60
|
+
react_1.default.createElement(core_1.Typography, { variant: 'h6', style: { flexGrow: '1' } }, visualizando === null || visualizando === void 0 ? void 0 : visualizando.nome),
|
|
61
|
+
!(visualizando === null || visualizando === void 0 ? void 0 : visualizando.sensible) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
62
|
+
react_1.default.createElement(core_1.IconButton, { onClick: function (_) {
|
|
63
|
+
var _a;
|
|
64
|
+
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);
|
|
66
|
+
}
|
|
67
|
+
index_1.printUrl(visualizando.URL ? visualizando.URL : visualizando.linkPronto);
|
|
68
|
+
}, color: 'inherit', title: 'Imprimir arquivo' },
|
|
69
|
+
react_1.default.createElement(md_1.MdPrint, null)),
|
|
70
|
+
react_1.default.createElement(core_1.IconButton, { onClick: function () {
|
|
71
|
+
var _a;
|
|
72
|
+
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);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
index_1.downloadBase64(visualizando === null || visualizando === void 0 ? void 0 : visualizando.linkPronto, visualizando === null || visualizando === void 0 ? void 0 : visualizando.nome);
|
|
78
|
+
}
|
|
79
|
+
}, color: 'inherit', title: 'Baixar arquivo' },
|
|
80
|
+
react_1.default.createElement(md_1.MdFileDownload, null)))))),
|
|
81
|
+
react_1.default.createElement(core_1.Box, { display: 'flex', justifyContent: 'center', alignItems: 'center', width: '100%', height: '100%' },
|
|
82
|
+
react_1.default.createElement(Visualizacao_1.default, __assign({}, __assign(__assign({ setVisualizando: setVisualizando }, visualizando), { tokenSistema: tokenSistema, proceed: proceed }))))));
|
|
83
|
+
};
|
|
84
|
+
exports.default = ModalVisualizacaoDocumentos;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default Visualizacao;
|
|
2
|
+
declare function Visualizacao({ idDocumento, nrRevisao, setVisualizando, proceed, URL: documento, linkPronto, tokenSistema, ariaLabel }: {
|
|
3
|
+
idDocumento: any;
|
|
4
|
+
nrRevisao: any;
|
|
5
|
+
setVisualizando: any;
|
|
6
|
+
proceed: any;
|
|
7
|
+
URL: any;
|
|
8
|
+
linkPronto: any;
|
|
9
|
+
tokenSistema: any;
|
|
10
|
+
ariaLabel: any;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
import React from "react";
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
|
+
function step(op) {
|
|
46
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
+
while (_) try {
|
|
48
|
+
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
|
+
switch (op[0]) {
|
|
51
|
+
case 0: case 1: t = op; break;
|
|
52
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
53
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
54
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
55
|
+
default:
|
|
56
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
57
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
58
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
60
|
+
if (t[2]) _.ops.pop();
|
|
61
|
+
_.trys.pop(); continue;
|
|
62
|
+
}
|
|
63
|
+
op = body.call(thisArg, _);
|
|
64
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
65
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69
|
+
var api_1 = require("../../utils/api");
|
|
70
|
+
var core_1 = require("@material-ui/core");
|
|
71
|
+
var react_1 = __importStar(require("react"));
|
|
72
|
+
var useStyles = core_1.makeStyles(function (theme) { return ({
|
|
73
|
+
iframe: {
|
|
74
|
+
width: '100%',
|
|
75
|
+
height: '100%',
|
|
76
|
+
border: 'none',
|
|
77
|
+
background: theme.palette.background.default,
|
|
78
|
+
'&:focus': {
|
|
79
|
+
outline: 'none'
|
|
80
|
+
},
|
|
81
|
+
'&[seamless]': {
|
|
82
|
+
display: 'block'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
restricSize: {
|
|
86
|
+
maxWidth: '100%',
|
|
87
|
+
maxHeight: '100%'
|
|
88
|
+
}
|
|
89
|
+
}); });
|
|
90
|
+
var onchange = function () { return undefined; };
|
|
91
|
+
var Visualizacao = function (_a) {
|
|
92
|
+
var _b;
|
|
93
|
+
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
|
+
var classes = useStyles();
|
|
95
|
+
var blockLoop = react_1.useRef(null);
|
|
96
|
+
var _c = react_1.useState({}), type = _c[0].type, setArquivo = _c[1];
|
|
97
|
+
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];
|
|
99
|
+
var preparaLink = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
100
|
+
var objGetLinkDocumento, res, _a, _b, file, url_1, error_1;
|
|
101
|
+
return __generator(this, function (_c) {
|
|
102
|
+
switch (_c.label) {
|
|
103
|
+
case 0:
|
|
104
|
+
if (!linkPronto && ((!idDocumento && !documento) || (documento === blockLoop.current))) {
|
|
105
|
+
return [2 /*return*/];
|
|
106
|
+
}
|
|
107
|
+
objGetLinkDocumento = { idDocumento: idDocumento, nrRevisao: nrRevisao, dsToken: tokenSistema === null || tokenSistema === void 0 ? void 0 : tokenSistema.toString() };
|
|
108
|
+
if (!linkPronto) return [3 /*break*/, 1];
|
|
109
|
+
_a = { link: { URL: linkPronto } };
|
|
110
|
+
return [3 /*break*/, 5];
|
|
111
|
+
case 1:
|
|
112
|
+
if (!documento) return [3 /*break*/, 2];
|
|
113
|
+
_b = { link: { URL: documento } };
|
|
114
|
+
return [3 /*break*/, 4];
|
|
115
|
+
case 2: return [4 /*yield*/, api_1.serverAction('getLinkDocumento', objGetLinkDocumento, 'CtrlDocumentos', true)];
|
|
116
|
+
case 3:
|
|
117
|
+
_b = _c.sent();
|
|
118
|
+
_c.label = 4;
|
|
119
|
+
case 4:
|
|
120
|
+
_a = _b;
|
|
121
|
+
_c.label = 5;
|
|
122
|
+
case 5:
|
|
123
|
+
res = (_a).link;
|
|
124
|
+
_c.label = 6;
|
|
125
|
+
case 6:
|
|
126
|
+
_c.trys.push([6, 9, , 10]);
|
|
127
|
+
return [4 /*yield*/, fetch(res === null || res === void 0 ? void 0 : res.URL, {
|
|
128
|
+
method: 'post',
|
|
129
|
+
headers: { lgTkn: tokenSistema }
|
|
130
|
+
})];
|
|
131
|
+
case 7: return [4 /*yield*/, (_c.sent()).blob()];
|
|
132
|
+
case 8:
|
|
133
|
+
file = _c.sent();
|
|
134
|
+
url_1 = URL.createObjectURL(file);
|
|
135
|
+
setVisualizando(function (v) { return (__assign(__assign({}, v), { URL: url_1 })); });
|
|
136
|
+
blockLoop.current = url_1;
|
|
137
|
+
setLink(url_1);
|
|
138
|
+
setArquivo(__assign(__assign({}, res), { type: file === null || file === void 0 ? void 0 : file.type }));
|
|
139
|
+
return [3 /*break*/, 10];
|
|
140
|
+
case 9:
|
|
141
|
+
error_1 = _c.sent();
|
|
142
|
+
api_1.setError('Não foi possível visualizar este documento.');
|
|
143
|
+
return [3 /*break*/, 10];
|
|
144
|
+
case 10: return [2 /*return*/];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}); };
|
|
148
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
149
|
+
react_1.useEffect(function () { return preparaLink(); }, []);
|
|
150
|
+
react_1.useEffect(function () {
|
|
151
|
+
onchange = function (evt) {
|
|
152
|
+
var v = 'visible', h = 'hidden', evtMap = { focus: v, focusin: v, pageshow: v, blur: h, focusout: h, pagehide: h };
|
|
153
|
+
evt = evt || window.event;
|
|
154
|
+
if (evt.type in evtMap)
|
|
155
|
+
document.body.style.opacity = evtMap[evt.type];
|
|
156
|
+
else
|
|
157
|
+
document.body.style.opacity = this[hidden] ? 0 : 1;
|
|
158
|
+
};
|
|
159
|
+
var hidden = 'hidden';
|
|
160
|
+
if (hidden in document)
|
|
161
|
+
document.addEventListener('visibilitychange', onchange);
|
|
162
|
+
else if ((hidden = 'mozHidden') in document)
|
|
163
|
+
document.addEventListener('mozvisibilitychange', onchange);
|
|
164
|
+
else if ((hidden = 'webkitHidden') in document)
|
|
165
|
+
document.addEventListener('webkitvisibilitychange', onchange);
|
|
166
|
+
else if ((hidden = 'msHidden') in document)
|
|
167
|
+
document.addEventListener('msvisibilitychange', onchange);
|
|
168
|
+
else if ('onfocusin' in document)
|
|
169
|
+
document.onfocusin = document.onfocusout = onchange;
|
|
170
|
+
else
|
|
171
|
+
window.onpageshow = window.onpagehide = window.onfocus = window.onblur = onchange;
|
|
172
|
+
if (document[hidden] !== undefined)
|
|
173
|
+
onchange({ type: document[hidden] ? 'blur' : 'focus' });
|
|
174
|
+
window.onkeydown = function (e) {
|
|
175
|
+
if (e.key === 'Escape')
|
|
176
|
+
proceed(undefined);
|
|
177
|
+
if (e.key === 'F12')
|
|
178
|
+
return false;
|
|
179
|
+
if (e.ctrlKey && e.shiftKey && e.key === 'I')
|
|
180
|
+
return false;
|
|
181
|
+
if (e.ctrlKey && e.shiftKey && e.key === 'C')
|
|
182
|
+
return false;
|
|
183
|
+
if (e.ctrlKey && e.shiftKey && e.key === 'J')
|
|
184
|
+
return false;
|
|
185
|
+
if (e.ctrlKey && e.key === 'u')
|
|
186
|
+
return false;
|
|
187
|
+
};
|
|
188
|
+
return function () {
|
|
189
|
+
window.onkeydown = undefined;
|
|
190
|
+
onchange = function () { return undefined; };
|
|
191
|
+
};
|
|
192
|
+
}, [proceed]);
|
|
193
|
+
switch (tagType) {
|
|
194
|
+
case 'audio':
|
|
195
|
+
return react_1.default.createElement("audio", { className: classes.restricSize, "aria-label": ariaLabel, src: link, controls: true, controlsList: 'nodownload' });
|
|
196
|
+
case 'image':
|
|
197
|
+
return react_1.default.createElement("img", { className: classes.restricSize, alt: ariaLabel || 'Imagem', "aria-label": ariaLabel, src: link, onClick: function (e) { return e.preventDefault(); } });
|
|
198
|
+
case 'video':
|
|
199
|
+
return react_1.default.createElement("video", { className: classes.restricSize, "aria-label": ariaLabel, controls: true, controlsList: 'nodownload', autoPlay: true, src: link });
|
|
200
|
+
default:
|
|
201
|
+
return link ? react_1.default.createElement("iframe", { className: classes.iframe, "aria-label": ariaLabel, title: 'Iframe', src: link + "#toolbar=0" }) : react_1.default.createElement(core_1.Box, { justifyContent: 'center', alignItems: 'center', display: 'flex' },
|
|
202
|
+
react_1.default.createElement(core_1.CircularProgress, { disableShrink: true }));
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
exports.default = Visualizacao;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 56 56">
|
|
2
|
+
<g>
|
|
3
|
+
<path style="fill:#E9E9E0;" d="M36.985,0H7.963C7.155,0,6.5,0.655,6.5,1.926V55c0,0.345,0.655,1,1.463,1h40.074
|
|
4
|
+
c0.808,0,1.463-0.655,1.463-1V12.978c0-0.696-0.093-0.92-0.257-1.085L37.607,0.257C37.442,0.093,37.218,0,36.985,0z"/>
|
|
5
|
+
<path style="fill:#FFC14F;" d="M48.037,56H7.963C7.155,56,6.5,55.345,6.5,54.537V39h43v15.537C49.5,55.345,48.845,56,48.037,56z"/>
|
|
6
|
+
<g>
|
|
7
|
+
<path style="fill:#FFFFFF;" d="M20.067,53l3.527-10.063h1.627L28.722,53h-1.695l-0.725-2.092h-3.787L21.776,53H20.067z
|
|
8
|
+
M22.897,49.801h3.008l-1.49-4.348L22.897,49.801z"/>
|
|
9
|
+
<path style="fill:#FFFFFF;" d="M32.536,53h-1.668V42.924h1.668V53z"/>
|
|
10
|
+
</g>
|
|
11
|
+
<path style="fill:#C8BDB8;" d="M37.5,11v0.461c-3.071,0.968-5.503,3.382-6.502,6.44C30.311,17.346,29.45,17,28.5,17
|
|
12
|
+
c-1.859,0-3.411,1.28-3.858,3H21.5v-2h-6v6h6v-2h2.921c-0.336,2.663-1.985,4.978-4.389,6.163C19.364,26.884,18.04,26,16.5,26
|
|
13
|
+
c-2.206,0-4,1.794-4,4s1.794,4,4,4c2.146,0,3.888-1.702,3.982-3.825c2.655-1.151,4.647-3.387,5.524-6.073
|
|
14
|
+
C26.692,24.655,27.552,25,28.5,25c1.859,0,3.411-1.28,3.858-3H35.5v2h6v-6h-6v2h-2.931c0.379-3.019,2.444-5.514,5.222-6.518
|
|
15
|
+
C38.383,14.955,39.818,16,41.5,16c2.206,0,4-1.794,4-4v-1H37.5z M19.5,22h-2v-2h2V22z M16.5,32c-1.103,0-2-0.897-2-2s0.897-2,2-2
|
|
16
|
+
s2,0.897,2,2S17.603,32,16.5,32z M37.5,20h2v2h-2V20z M28.5,23c-1.103,0-2-0.897-2-2s0.897-2,2-2s2,0.897,2,2S29.603,23,28.5,23z
|
|
17
|
+
M41.5,14c-0.723,0-1.353-0.389-1.704-0.964C40.028,13.015,40.262,13,40.5,13h2.731C42.886,13.597,42.239,14,41.5,14z"/>
|
|
18
|
+
<polygon style="fill:#D9D7CA;" points="37.5,0.151 37.5,12 49.349,12 "/>
|
|
19
|
+
</g>
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 56 56">
|
|
2
|
+
<g>
|
|
3
|
+
<path style="fill:#E9E9E0;" d="M36.985,0H7.963C7.155,0,6.5,0.655,6.5,1.926V55c0,0.345,0.655,1,1.463,1h40.074 c0.808,0,1.463-0.655,1.463-1V12.978c0-0.696-0.093-0.92-0.257-1.085L37.607,0.257C37.442,0.093,37.218,0,36.985,0z" />
|
|
4
|
+
<polygon style="fill:#D9D7CA;" points="37.5,0.151 37.5,12 49.349,12 " />
|
|
5
|
+
<path style="fill:#656699;fill-opacity:1" d="M48.037,56H7.963C7.155,56,6.5,55.345,6.5,54.537V39h43v15.537C49.5,55.345,48.845,56,48.037,56z" />
|
|
6
|
+
<path style="fill:#C8BDB8;" d="M35.67,14.986c-0.567-0.796-1.3-1.543-2.308-2.351c-3.914-3.131-4.757-6.277-4.862-6.738V5 c0-0.553-0.447-1-1-1s-1,0.447-1,1v1v8.359v9.053h-3.706c-3.882,0-6.294,1.961-6.294,5.117c0,3.466,2.24,5.706,5.706,5.706 c3.471,0,6.294-2.823,6.294-6.294V16.468l0.298,0.243c0.34,0.336,0.861,0.72,1.521,1.205c2.318,1.709,6.2,4.567,5.224,7.793 C35.514,25.807,35.5,25.904,35.5,26c0,0.43,0.278,0.826,0.71,0.957C36.307,26.986,36.404,27,36.5,27c0.43,0,0.826-0.278,0.957-0.71 C39.084,20.915,37.035,16.9,35.67,14.986z M26.5,27.941c0,2.368-1.926,4.294-4.294,4.294c-2.355,0-3.706-1.351-3.706-3.706 c0-2.576,2.335-3.117,4.294-3.117H26.5V27.941z M31.505,16.308c-0.571-0.422-1.065-0.785-1.371-1.081l-1.634-1.34v-3.473 c0.827,1.174,1.987,2.483,3.612,3.783c0.858,0.688,1.472,1.308,1.929,1.95c0.716,1.003,1.431,2.339,1.788,3.978 C34.502,18.515,32.745,17.221,31.505,16.308z" />
|
|
7
|
+
|
|
8
|
+
<g>
|
|
9
|
+
<path d="m 12.540482,44.371216 -1.739258,4.716308 h 3.484863 z m -0.723633,-1.263184 h 1.453613 l 3.611816,9.477051 H 15.549271 L 14.685989,50.153931 H 10.414017 L 9.5507355,52.585083 H 8.1986847 Z" style="font-size:13px;fill:#ffffff" />
|
|
10
|
+
<path d="m 17.413724,43.108032 h 1.288574 v 5.757324 q 0,1.523438 0.552246,2.19629 0.552246,0.666503 1.790039,0.666503 1.231446,0 1.783692,-0.666503 0.552246,-0.672852 0.552246,-2.19629 v -5.757324 h 1.288574 v 5.916016 q 0,1.853515 -0.92041,2.799316 -0.914063,0.945801 -2.704102,0.945801 -1.796386,0 -2.716797,-0.945801 -0.914062,-0.945801 -0.914062,-2.799316 z" style="font-size:13px;fill:#ffffff" />
|
|
11
|
+
<path d="m 27.663431,44.161743 v 7.369629 h 1.548828 q 1.961426,0 2.869141,-0.888672 0.914062,-0.888672 0.914062,-2.805664 0,-1.904297 -0.914062,-2.786621 -0.907715,-0.888672 -2.869141,-0.888672 z m -1.282226,-1.053711 h 2.634277 q 2.754883,0 4.043457,1.148926 1.288574,1.142578 1.288574,3.580078 0,2.450195 -1.294922,3.599121 -1.294922,1.148926 -4.037109,1.148926 h -2.634277 z" style="font-size:13px;fill:#ffffff" />
|
|
12
|
+
<path d="m 35.68511,43.108032 h 1.282227 v 9.477051 H 35.68511 Z" style="font-size:13px;fill:#ffffff" />
|
|
13
|
+
<path d="m 42.665775,43.977661 q -1.396484,0 -2.221679,1.041016 -0.818848,1.041015 -0.818848,2.837402 0,1.790039 0.818848,2.831055 0.825195,1.041015 2.221679,1.041015 1.396485,0 2.208985,-1.041015 0.818847,-1.041016 0.818847,-2.831055 0,-1.796387 -0.818847,-2.837402 -0.8125,-1.041016 -2.208985,-1.041016 z m 0,-1.041015 q 1.993164,0 3.186524,1.339355 1.193359,1.333008 1.193359,3.580078 0,2.240723 -1.193359,3.580078 -1.19336,1.333008 -3.186524,1.333008 -1.999511,0 -3.199218,-1.333008 -1.19336,-1.333008 -1.19336,-3.580078 0,-2.24707 1.19336,-3.580078 1.199707,-1.339355 3.199218,-1.339355 z" style="font-size:13px;fill:#ffffff" />
|
|
14
|
+
</g>
|
|
15
|
+
</g>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 56 56">
|
|
2
|
+
<g>
|
|
3
|
+
<path style="fill:#E9E9E0;" d="M36.985,0H7.963C7.155,0,6.5,0.655,6.5,1.926V55c0,0.345,0.655,1,1.463,1h40.074
|
|
4
|
+
c0.808,0,1.463-0.655,1.463-1V12.978c0-0.696-0.093-0.92-0.257-1.085L37.607,0.257C37.442,0.093,37.218,0,36.985,0z"/>
|
|
5
|
+
<polygon style="fill:#D9D7CA;" points="37.5,0.151 37.5,12 49.349,12 "/>
|
|
6
|
+
<path style="fill:#D75E72;" d="M48.037,56H7.963C7.155,56,6.5,55.345,6.5,54.537V39h43v15.537C49.5,55.345,48.845,56,48.037,56z"/>
|
|
7
|
+
<g>
|
|
8
|
+
<path style="fill:#FFFFFF;" d="M16.361,53l3.527-10.063h1.627L25.016,53H23.32l-0.725-2.092h-3.787L18.07,53H16.361z
|
|
9
|
+
M19.191,49.801h3.008l-1.49-4.348L19.191,49.801z"/>
|
|
10
|
+
<path style="fill:#FFFFFF;" d="M29.828,53.055l-3.131-10.131h1.873l2.338,8.695l2.475-8.695h1.859l-3.281,10.131H29.828z"/>
|
|
11
|
+
<path style="fill:#FFFFFF;" d="M38.988,53H37.32V42.924h1.668V53z"/>
|
|
12
|
+
</g>
|
|
13
|
+
<polygon style="fill:#C8BDB8;" points="23.5,28 23.5,20.954 23.5,14 34.5,21 "/>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|