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,316 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
69
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
70
|
+
};
|
|
71
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
+
exports.ANNOTATION_DOCUMENT_URL_INDEX = exports.ANNOTATION_DOCUMENT_MIME_TYPE_INDEX = exports.ANNOTATION_CODE_INDEX = exports.ANNOTATION_PRIVACY_TYPE_INDEX = exports.ANNOTATION_MARKED_USERS_INDEX = exports.ANNOTATION_ANSWERS_INDEX = exports.ANNOTATION_DOCUMENT_ID_INDEX = exports.ANNOTATION_TEXT_INDEX = exports.ANNOTATION_DATE_INDEX = exports.ANNOTATION_PARAMETERS_INDEX = exports.ANNOTATION_PROGRAM_CODE_INDEX = exports.ANNOTATION_USER_INDEX = exports.ANNOTATION_PARENT_ID_INDEX = exports.ANNOTATION_ID_INDEX = void 0;
|
|
73
|
+
var _1 = require(".");
|
|
74
|
+
var utils_1 = require("./utils");
|
|
75
|
+
var api_1 = require("../../../api");
|
|
76
|
+
var components_1 = require("../../../components");
|
|
77
|
+
var utils_2 = require("../../../utils");
|
|
78
|
+
var core_1 = require("@material-ui/core");
|
|
79
|
+
var moment_1 = __importDefault(require("moment"));
|
|
80
|
+
var react_1 = __importStar(require("react"));
|
|
81
|
+
var ANSWER_USER_MIN_WIDTH = 159.78;
|
|
82
|
+
var useStyles = core_1.makeStyles(function (theme) {
|
|
83
|
+
var _a;
|
|
84
|
+
return ({
|
|
85
|
+
annotationContainer: {
|
|
86
|
+
padding: utils_1.SMALL_SIZE,
|
|
87
|
+
border: "2px solid " + utils_1.LIGHT_GREY_COLOR(theme.palette.type),
|
|
88
|
+
'&:not(:last-child)': {
|
|
89
|
+
marginBottom: utils_1.MEDIUM_SIZE
|
|
90
|
+
},
|
|
91
|
+
'&:last-child': {
|
|
92
|
+
borderBottom: 0
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
annotationHeader: {
|
|
96
|
+
display: 'flex',
|
|
97
|
+
justifyContent: 'space-between'
|
|
98
|
+
},
|
|
99
|
+
annotationUser: {
|
|
100
|
+
display: 'flex',
|
|
101
|
+
gap: utils_1.SMALL_SIZE,
|
|
102
|
+
'&>div:nth-child(1)': {
|
|
103
|
+
width: utils_1.AVATAR_SIZE,
|
|
104
|
+
height: utils_1.AVATAR_SIZE
|
|
105
|
+
},
|
|
106
|
+
'&>div:nth-child(2)': {
|
|
107
|
+
display: 'flex',
|
|
108
|
+
justifyContent: 'center',
|
|
109
|
+
flexDirection: 'column',
|
|
110
|
+
gap: utils_1.EXTRA_SMALL_SIZE,
|
|
111
|
+
'&>h6': {
|
|
112
|
+
lineHeight: 1
|
|
113
|
+
},
|
|
114
|
+
'&>p': {
|
|
115
|
+
lineHeight: 1,
|
|
116
|
+
fontSize: '.75rem',
|
|
117
|
+
fontWeight: 500,
|
|
118
|
+
color: utils_1.MEDIUM_GREY_COLOR(theme.palette.type)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
annotationBody: {
|
|
123
|
+
'&>div:nth-child(1)': {
|
|
124
|
+
padding: '10px 0',
|
|
125
|
+
overflow: 'hidden'
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
annotationFooter: {
|
|
129
|
+
display: 'flex',
|
|
130
|
+
gap: utils_1.SMALL_SIZE,
|
|
131
|
+
paddingTop: utils_1.SMALL_SIZE,
|
|
132
|
+
minHeight: 43
|
|
133
|
+
},
|
|
134
|
+
buttonsDiv: {
|
|
135
|
+
display: 'flex',
|
|
136
|
+
justifyContent: 'flex-end',
|
|
137
|
+
gap: utils_1.SMALL_SIZE
|
|
138
|
+
},
|
|
139
|
+
markedUsers: {
|
|
140
|
+
display: 'flex',
|
|
141
|
+
flexWrap: 'wrap',
|
|
142
|
+
gap: utils_1.SMALL_SIZE
|
|
143
|
+
},
|
|
144
|
+
markedUser: {
|
|
145
|
+
position: 'relative',
|
|
146
|
+
'&>div:nth-child(1)': {
|
|
147
|
+
width: utils_1.AVATAR_SIZE,
|
|
148
|
+
height: utils_1.AVATAR_SIZE
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
avatarViewedIcon: {
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
bottom: -2,
|
|
154
|
+
right: -8,
|
|
155
|
+
width: 18,
|
|
156
|
+
height: 18,
|
|
157
|
+
color: utils_1.UNIMED_GREEN_COLOR
|
|
158
|
+
},
|
|
159
|
+
answer: {
|
|
160
|
+
alignItems: 'flex-start',
|
|
161
|
+
padding: utils_1.SMALL_SIZE,
|
|
162
|
+
gap: utils_1.SMALL_SIZE
|
|
163
|
+
},
|
|
164
|
+
answerUserDiv: {
|
|
165
|
+
display: 'flex',
|
|
166
|
+
gap: utils_1.SMALL_SIZE,
|
|
167
|
+
minWidth: ANSWER_USER_MIN_WIDTH,
|
|
168
|
+
'&>div:nth-child(1)': {
|
|
169
|
+
position: 'relative',
|
|
170
|
+
'&>div:nth-child(1)': {
|
|
171
|
+
width: utils_1.AVATAR_SIZE,
|
|
172
|
+
height: utils_1.AVATAR_SIZE
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
'&>div:nth-child(2)': {
|
|
176
|
+
display: 'flex',
|
|
177
|
+
justifyContent: 'center',
|
|
178
|
+
flexDirection: 'column',
|
|
179
|
+
gap: utils_1.EXTRA_SMALL_SIZE,
|
|
180
|
+
'&>h6': {
|
|
181
|
+
lineHeight: 1
|
|
182
|
+
},
|
|
183
|
+
'&>p': {
|
|
184
|
+
lineHeight: 1,
|
|
185
|
+
fontSize: '.75rem',
|
|
186
|
+
fontWeight: 500,
|
|
187
|
+
color: utils_1.MEDIUM_GREY_COLOR(theme.palette.type)
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
avatarAnswerIcon: {
|
|
192
|
+
position: 'absolute',
|
|
193
|
+
top: -2,
|
|
194
|
+
left: -8,
|
|
195
|
+
width: 18,
|
|
196
|
+
height: 18,
|
|
197
|
+
color: utils_1.UNIMED_GREEN_COLOR
|
|
198
|
+
},
|
|
199
|
+
answerTextDiv: (_a = {
|
|
200
|
+
width: '100%',
|
|
201
|
+
maxWidth: '100%'
|
|
202
|
+
},
|
|
203
|
+
_a[theme.breakpoints.up('sm')] = {
|
|
204
|
+
maxWidth: "calc(100% - " + ANSWER_USER_MIN_WIDTH + "px - " + utils_1.SMALL_SIZE + "px)"
|
|
205
|
+
},
|
|
206
|
+
_a),
|
|
207
|
+
divider: {
|
|
208
|
+
height: 2
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
exports.ANNOTATION_ID_INDEX = 0;
|
|
213
|
+
exports.ANNOTATION_PARENT_ID_INDEX = 1;
|
|
214
|
+
exports.ANNOTATION_USER_INDEX = 2;
|
|
215
|
+
exports.ANNOTATION_PROGRAM_CODE_INDEX = 3;
|
|
216
|
+
exports.ANNOTATION_PARAMETERS_INDEX = 4;
|
|
217
|
+
exports.ANNOTATION_DATE_INDEX = 5;
|
|
218
|
+
exports.ANNOTATION_TEXT_INDEX = 6;
|
|
219
|
+
exports.ANNOTATION_DOCUMENT_ID_INDEX = 7;
|
|
220
|
+
exports.ANNOTATION_ANSWERS_INDEX = 8;
|
|
221
|
+
exports.ANNOTATION_MARKED_USERS_INDEX = 9;
|
|
222
|
+
exports.ANNOTATION_PRIVACY_TYPE_INDEX = 10;
|
|
223
|
+
exports.ANNOTATION_CODE_INDEX = 11;
|
|
224
|
+
exports.ANNOTATION_DOCUMENT_MIME_TYPE_INDEX = 12;
|
|
225
|
+
exports.ANNOTATION_DOCUMENT_URL_INDEX = 13;
|
|
226
|
+
var Annotation = function (_a) {
|
|
227
|
+
var _b, _c;
|
|
228
|
+
var annotation = _a.annotation;
|
|
229
|
+
var classes = useStyles();
|
|
230
|
+
var createModal = utils_2.useModal().createModal;
|
|
231
|
+
var fileView = createModal(components_1.ModalVisualizacaoDocumentos);
|
|
232
|
+
var _d = react_1.useContext(_1.AnnotationsContext), openAnnotationParameters = _d.openAnnotationParameters, handleDialogClose = _d.handleDialogClose, scrollDialogToBottom = _d.scrollDialogToBottom, dispatch = _d.dispatch;
|
|
233
|
+
var user = { id: (((_b = annotation[exports.ANNOTATION_USER_INDEX]) === null || _b === void 0 ? void 0 : _b[0]) || -1), name: (((_c = annotation[exports.ANNOTATION_USER_INDEX]) === null || _c === void 0 ? void 0 : _c[1]) || '') };
|
|
234
|
+
var date = (annotation[exports.ANNOTATION_DATE_INDEX]) ? moment_1.default(annotation[exports.ANNOTATION_DATE_INDEX]).format('DD/MM/YYYY HH:mm:ss') : '';
|
|
235
|
+
var text = annotation[exports.ANNOTATION_TEXT_INDEX];
|
|
236
|
+
var answers = (annotation[exports.ANNOTATION_ANSWERS_INDEX] || []);
|
|
237
|
+
var markedUsers = (annotation[exports.ANNOTATION_MARKED_USERS_INDEX] || []);
|
|
238
|
+
var annotationParameters = (annotation[exports.ANNOTATION_PARAMETERS_INDEX] || {});
|
|
239
|
+
var file = {
|
|
240
|
+
id: annotation[exports.ANNOTATION_DOCUMENT_ID_INDEX],
|
|
241
|
+
type: annotation[exports.ANNOTATION_DOCUMENT_MIME_TYPE_INDEX],
|
|
242
|
+
url: annotation[exports.ANNOTATION_DOCUMENT_URL_INDEX]
|
|
243
|
+
};
|
|
244
|
+
var reply = function (event) {
|
|
245
|
+
dispatch({ field: 'selectedAnnotation', value: annotation });
|
|
246
|
+
setTimeout(function () { return scrollDialogToBottom(event); }, 0);
|
|
247
|
+
};
|
|
248
|
+
var access = function (event) {
|
|
249
|
+
(openAnnotationParameters && (typeof openAnnotationParameters === 'function')) && openAnnotationParameters(event, annotationParameters);
|
|
250
|
+
handleDialogClose();
|
|
251
|
+
};
|
|
252
|
+
var handleFileClick = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
253
|
+
var response;
|
|
254
|
+
return __generator(this, function (_a) {
|
|
255
|
+
switch (_a.label) {
|
|
256
|
+
case 0: return [4 /*yield*/, api_1.getProgramAnnotations({ snToken: true })];
|
|
257
|
+
case 1:
|
|
258
|
+
response = _a.sent();
|
|
259
|
+
if (!(response === null || response === void 0 ? void 0 : response.status)) return [3 /*break*/, 3];
|
|
260
|
+
return [4 /*yield*/, fileView({ nome: 'Documento da anotação', linkPronto: file.url, tokenSistema: response === null || response === void 0 ? void 0 : response.token })];
|
|
261
|
+
case 2:
|
|
262
|
+
_a.sent();
|
|
263
|
+
_a.label = 3;
|
|
264
|
+
case 3: return [2 /*return*/];
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}); };
|
|
268
|
+
return react_1.default.createElement("div", { className: classes.annotationContainer },
|
|
269
|
+
react_1.default.createElement("div", { className: classes.annotationHeader },
|
|
270
|
+
react_1.default.createElement("div", { className: classes.annotationUser },
|
|
271
|
+
react_1.default.createElement(components_1.ArgousAvatar, { alt: user.name + " avatar", idUsuario: user.id, nome: user.name }),
|
|
272
|
+
react_1.default.createElement("div", null,
|
|
273
|
+
react_1.default.createElement(core_1.Typography, { variant: 'subtitle2' }, user.name),
|
|
274
|
+
react_1.default.createElement(core_1.Typography, { variant: 'body2' }, date))),
|
|
275
|
+
react_1.default.createElement("div", null, (file.id) && react_1.default.createElement(components_1.IconsComponent, { mimeType: file.type, height: utils_1.AVATAR_SIZE, onClick: handleFileClick, style: { cursor: 'pointer' } }))),
|
|
276
|
+
react_1.default.createElement("div", { className: classes.annotationBody },
|
|
277
|
+
react_1.default.createElement("div", null,
|
|
278
|
+
react_1.default.createElement(core_1.Typography, { variant: 'body2' }, text)),
|
|
279
|
+
react_1.default.createElement("div", null, answers.map(function (answer, answerIndex) { return react_1.default.createElement(Answer, __assign({ key: "answer-" + answerIndex }, { answer: answer })); }))),
|
|
280
|
+
react_1.default.createElement(core_1.Divider, { className: classes.divider }),
|
|
281
|
+
react_1.default.createElement(core_1.Grid, { container: true, justifyContent: (markedUsers.length) ? 'space-between' : 'flex-end', className: classes.annotationFooter },
|
|
282
|
+
(!!markedUsers.length) && (react_1.default.createElement(core_1.Grid, { item: true, xs: 12, sm: 'auto', className: classes.markedUsers }, markedUsers.map(function (user, userIndex) { return react_1.default.createElement(MarkedUser, __assign({ key: "marked-user-" + (user === null || user === void 0 ? void 0 : user.idUsuario) }, { user: user })); }))),
|
|
283
|
+
react_1.default.createElement(core_1.Grid, { item: true, xs: 12, sm: 'auto', className: classes.buttonsDiv },
|
|
284
|
+
react_1.default.createElement(core_1.Button, { fullWidth: true, variant: 'outlined', size: 'small', onClick: access }, "Acessar"),
|
|
285
|
+
react_1.default.createElement(core_1.Button, { fullWidth: true, color: 'primary', variant: 'contained', size: 'small', onClick: reply }, "Responder"))));
|
|
286
|
+
};
|
|
287
|
+
exports.default = Annotation;
|
|
288
|
+
var Answer = function (_a) {
|
|
289
|
+
var _b, _c;
|
|
290
|
+
var answer = _a.answer;
|
|
291
|
+
var classes = useStyles();
|
|
292
|
+
var user = { id: (((_b = answer === null || answer === void 0 ? void 0 : answer.usuario) === null || _b === void 0 ? void 0 : _b[0]) || -1), name: (((_c = answer === null || answer === void 0 ? void 0 : answer.usuario) === null || _c === void 0 ? void 0 : _c[1]) || '') };
|
|
293
|
+
var date = (answer === null || answer === void 0 ? void 0 : answer.dtAnotacao) ? moment_1.default(answer === null || answer === void 0 ? void 0 : answer.dtAnotacao).format('DD/MM/YYYY HH:mm:ss') : '';
|
|
294
|
+
var text = answer === null || answer === void 0 ? void 0 : answer.dsAnotacao;
|
|
295
|
+
return react_1.default.createElement("div", null,
|
|
296
|
+
react_1.default.createElement(core_1.Divider, { className: classes.divider }),
|
|
297
|
+
react_1.default.createElement(core_1.Grid, { container: true, className: classes.answer },
|
|
298
|
+
react_1.default.createElement("div", { className: classes.answerUserDiv },
|
|
299
|
+
react_1.default.createElement("div", null,
|
|
300
|
+
react_1.default.createElement(components_1.ArgousAvatar, { alt: user.name + " avatar", idUsuario: user.id, nome: user.name }),
|
|
301
|
+
react_1.default.createElement(utils_1.AnswerIcon, { className: classes.avatarAnswerIcon })),
|
|
302
|
+
react_1.default.createElement("div", null,
|
|
303
|
+
react_1.default.createElement(core_1.Typography, { variant: 'subtitle2' }, user.name),
|
|
304
|
+
react_1.default.createElement(core_1.Typography, { variant: 'body2' }, date))),
|
|
305
|
+
react_1.default.createElement("div", { className: classes.answerTextDiv },
|
|
306
|
+
react_1.default.createElement(core_1.Typography, { variant: 'body2' }, text))));
|
|
307
|
+
};
|
|
308
|
+
var MarkedUser = function (props) {
|
|
309
|
+
var _a, _b, _c;
|
|
310
|
+
var classes = useStyles();
|
|
311
|
+
var user = { id: (((_a = props === null || props === void 0 ? void 0 : props.user) === null || _a === void 0 ? void 0 : _a.idUsuario) || -1), name: (((_b = props === null || props === void 0 ? void 0 : props.user) === null || _b === void 0 ? void 0 : _b.nmUsuario) || '') };
|
|
312
|
+
var viewDate = (_c = props === null || props === void 0 ? void 0 : props.user) === null || _c === void 0 ? void 0 : _c.dtVisualizacao;
|
|
313
|
+
return react_1.default.createElement("div", { className: classes.markedUser },
|
|
314
|
+
react_1.default.createElement(components_1.ArgousAvatar, { alt: user.name + " avatar", idUsuario: user.id, nome: user.name }),
|
|
315
|
+
(viewDate) && react_1.default.createElement(utils_1.ViewedIcon, { className: classes.avatarViewedIcon }));
|
|
316
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
var _1 = require(".");
|
|
37
|
+
var Annotation_1 = __importDefault(require("./Annotation"));
|
|
38
|
+
var utils_1 = require("./utils");
|
|
39
|
+
var core_1 = require("@material-ui/core");
|
|
40
|
+
var react_1 = __importStar(require("react"));
|
|
41
|
+
var AnnotationsList = function () {
|
|
42
|
+
var theme = core_1.useTheme();
|
|
43
|
+
var list = react_1.useContext(_1.AnnotationsContext).list;
|
|
44
|
+
return (react_1.default.createElement("div", { style: {
|
|
45
|
+
maxHeight: '60vh',
|
|
46
|
+
overflow: 'hidden auto',
|
|
47
|
+
borderBottom: "2px solid " + utils_1.LIGHT_GREY_COLOR(theme.palette.type)
|
|
48
|
+
} }, list.annotations.map(function (annotation, annotationIndex) { return (react_1.default.createElement(Annotation_1.default, __assign({ key: "annotation-" + (annotation === null || annotation === void 0 ? void 0 : annotation[0]) }, { annotation: annotation }))); })));
|
|
49
|
+
};
|
|
50
|
+
exports.default = AnnotationsList;
|
|
@@ -0,0 +1,147 @@
|
|
|
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 __1 = require("..");
|
|
70
|
+
var components_1 = require("../../../../components");
|
|
71
|
+
var utils_1 = require("../../../../utils");
|
|
72
|
+
var utils_2 = require("../utils");
|
|
73
|
+
var core_1 = require("@material-ui/core");
|
|
74
|
+
var react_1 = __importStar(require("react"));
|
|
75
|
+
var io5_1 = require("react-icons/io5");
|
|
76
|
+
var useStyles = core_1.makeStyles({
|
|
77
|
+
fileInputContainer: {
|
|
78
|
+
width: '100%',
|
|
79
|
+
display: 'flex',
|
|
80
|
+
flexDirection: 'column',
|
|
81
|
+
alignItems: 'flex-end',
|
|
82
|
+
gap: utils_2.SMALL_SIZE,
|
|
83
|
+
'&>input': {
|
|
84
|
+
display: 'none'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
fileInputButtonsDiv: {
|
|
88
|
+
display: 'flex',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
gap: utils_2.SMALL_SIZE
|
|
91
|
+
},
|
|
92
|
+
file: {
|
|
93
|
+
display: 'flex',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
gap: utils_2.EXTRA_SMALL_SIZE,
|
|
96
|
+
maxWidth: '100%',
|
|
97
|
+
'&>p': __assign({}, utils_2.ELLIPSIS_TEXT_STYLE)
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
var FileInput = function (_a) {
|
|
101
|
+
var file = _a.file, onChange = _a.onChange;
|
|
102
|
+
var classes = useStyles();
|
|
103
|
+
var _b = react_1.useContext(__1.AnnotationsContext), printScreen = _b.printScreen, loading = _b.loading, dispatch = _b.dispatch;
|
|
104
|
+
var inputRef = react_1.useRef(null);
|
|
105
|
+
var canAddPrintScreen = !(file === (printScreen === null || printScreen === void 0 ? void 0 : printScreen.file));
|
|
106
|
+
var disabled = (loading.save || loading.file);
|
|
107
|
+
var printScreenClick = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
108
|
+
var file, response;
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
switch (_a.label) {
|
|
111
|
+
case 0:
|
|
112
|
+
dispatch({ type: 'loading', field: 'file', value: true });
|
|
113
|
+
if (!(printScreen === null || printScreen === void 0 ? void 0 : printScreen.file)) return [3 /*break*/, 1];
|
|
114
|
+
file = printScreen === null || printScreen === void 0 ? void 0 : printScreen.file;
|
|
115
|
+
return [3 /*break*/, 3];
|
|
116
|
+
case 1: return [4 /*yield*/, utils_1.printScreen({ event: event })];
|
|
117
|
+
case 2:
|
|
118
|
+
response = _a.sent();
|
|
119
|
+
if (response === null || response === void 0 ? void 0 : response.status) {
|
|
120
|
+
dispatch({ field: 'printScreen', value: response });
|
|
121
|
+
file = response === null || response === void 0 ? void 0 : response.file;
|
|
122
|
+
}
|
|
123
|
+
_a.label = 3;
|
|
124
|
+
case 3:
|
|
125
|
+
(file) && onChange(event, file);
|
|
126
|
+
dispatch({ type: 'loading', field: 'file', value: false });
|
|
127
|
+
return [2 /*return*/];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}); };
|
|
131
|
+
return react_1.default.createElement("div", { className: classes.fileInputContainer },
|
|
132
|
+
react_1.default.createElement("input", { ref: inputRef, type: 'file', onChange: function (e) { var _a, _b; return ((_b = (_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.length) && onChange(e, e.target.files[0]); } }),
|
|
133
|
+
(file) && react_1.default.createElement(File, __assign({}, { file: file, disabled: disabled, classes: classes }, { onDelete: function (e) { return onChange(e, undefined); } })),
|
|
134
|
+
react_1.default.createElement("div", { className: classes.fileInputButtonsDiv },
|
|
135
|
+
react_1.default.createElement(core_1.IconButton, __assign({}, { disabled: disabled }, { onClick: function () { return (inputRef.current) && inputRef.current.click(); }, style: { padding: utils_2.EXTRA_SMALL_SIZE } }),
|
|
136
|
+
react_1.default.createElement(io5_1.IoDocumentAttachOutline, { size: utils_2.MEDIUM_SIZE })),
|
|
137
|
+
(canAddPrintScreen) && (react_1.default.createElement(core_1.Button, __assign({}, { disabled: disabled }, { size: 'small', variant: 'outlined', startIcon: react_1.default.createElement(io5_1.IoImageOutline, null), onClick: printScreenClick }), "Captura de tela"))));
|
|
138
|
+
};
|
|
139
|
+
exports.default = FileInput;
|
|
140
|
+
var File = function (_a) {
|
|
141
|
+
var file = _a.file, disabled = _a.disabled, onDelete = _a.onDelete, classes = _a.classes;
|
|
142
|
+
return react_1.default.createElement("div", { className: classes.file },
|
|
143
|
+
react_1.default.createElement(components_1.IconsComponent, { fileName: file === null || file === void 0 ? void 0 : file.name, mimeType: file === null || file === void 0 ? void 0 : file.type, height: utils_2.LARGE_SIZE }),
|
|
144
|
+
react_1.default.createElement(core_1.Typography, null, file === null || file === void 0 ? void 0 : file.name),
|
|
145
|
+
react_1.default.createElement(core_1.IconButton, __assign({}, { disabled: disabled }, { size: 'small', onClick: function (e) { return (typeof onDelete === 'function') && onDelete(e); } }),
|
|
146
|
+
react_1.default.createElement(utils_2.CloseIcon, null)));
|
|
147
|
+
};
|