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.
Files changed (129) hide show
  1. package/dist/api/index.d.ts +2 -0
  2. package/dist/api/index.js +36 -1
  3. package/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +9 -1
  4. package/dist/components/ArgousComplexTable/ArgousComplexTable.js +7 -7
  5. package/dist/components/BarraFerramentas/BarraFerramentas.d.ts +4 -1
  6. package/dist/components/BarraFerramentas/BarraFerramentas.js +48 -26
  7. package/dist/components/Document/Icons.d.ts +193 -0
  8. package/dist/components/Document/Icons.js +269 -0
  9. package/dist/components/Document/ModalVisualizacaoDocumentos.d.ts +8 -0
  10. package/dist/components/Document/ModalVisualizacaoDocumentos.js +84 -0
  11. package/dist/components/Document/Visualizacao.d.ts +12 -0
  12. package/dist/components/Document/Visualizacao.js +205 -0
  13. package/dist/components/Document/icons/ai.svg +20 -0
  14. package/dist/components/Document/icons/audio.svg +16 -0
  15. package/dist/components/Document/icons/avi.svg +15 -0
  16. package/dist/components/Document/icons/css.svg +47 -0
  17. package/dist/components/Document/icons/csv.svg +37 -0
  18. package/dist/components/Document/icons/dbf.svg +30 -0
  19. package/dist/components/Document/icons/doc.svg +47 -0
  20. package/dist/components/Document/icons/dwg.svg +32 -0
  21. package/dist/components/Document/icons/exe.svg +20 -0
  22. package/dist/components/Document/icons/file.svg +11 -0
  23. package/dist/components/Document/icons/fla.svg +23 -0
  24. package/dist/components/Document/icons/html.svg +23 -0
  25. package/dist/components/Document/icons/image.svg +16 -0
  26. package/dist/components/Document/icons/iso.svg +40 -0
  27. package/dist/components/Document/icons/jpg.svg +33 -0
  28. package/dist/components/Document/icons/js.svg +40 -0
  29. package/dist/components/Document/icons/json.svg +45 -0
  30. package/dist/components/Document/icons/mod.svg +41 -0
  31. package/dist/components/Document/icons/mp3.svg +36 -0
  32. package/dist/components/Document/icons/mp4.svg +25 -0
  33. package/dist/components/Document/icons/pdf.svg +35 -0
  34. package/dist/components/Document/icons/png.svg +30 -0
  35. package/dist/components/Document/icons/ppt.svg +31 -0
  36. package/dist/components/Document/icons/psd.svg +50 -0
  37. package/dist/components/Document/icons/rtf.svg +35 -0
  38. package/dist/components/Document/icons/search.svg +20 -0
  39. package/dist/components/Document/icons/svg.svg +34 -0
  40. package/dist/components/Document/icons/txt.svg +29 -0
  41. package/dist/components/Document/icons/video.svg +17 -0
  42. package/dist/components/Document/icons/xls.svg +31 -0
  43. package/dist/components/Document/icons/xml.svg +25 -0
  44. package/dist/components/Document/icons/zip.svg +24 -0
  45. package/dist/components/Document/icons/zip1.svg +18 -0
  46. package/dist/components/Document/index.d.ts +3 -0
  47. package/dist/components/Document/index.js +21 -0
  48. package/dist/components/Programa/Annotations/Annotation.d.ts +19 -0
  49. package/dist/components/Programa/Annotations/Annotation.js +316 -0
  50. package/dist/components/Programa/Annotations/AnnotationsList.d.ts +3 -0
  51. package/dist/components/Programa/Annotations/AnnotationsList.js +50 -0
  52. package/dist/components/Programa/Annotations/Input/FileInput.d.ts +6 -0
  53. package/dist/components/Programa/Annotations/Input/FileInput.js +147 -0
  54. package/dist/components/Programa/Annotations/Input/Input.d.ts +3 -0
  55. package/dist/components/Programa/Annotations/Input/Input.js +218 -0
  56. package/dist/components/Programa/Annotations/Input/PrivacySelection.d.ts +7 -0
  57. package/dist/components/Programa/Annotations/Input/PrivacySelection.js +65 -0
  58. package/dist/components/Programa/Annotations/Input/ReplyInformation.d.ts +5 -0
  59. package/dist/components/Programa/Annotations/Input/ReplyInformation.js +78 -0
  60. package/dist/components/Programa/Annotations/Input/UsersAutocomplete.d.ts +7 -0
  61. package/dist/components/Programa/Annotations/Input/UsersAutocomplete.js +139 -0
  62. package/dist/components/Programa/Annotations/index.d.ts +23 -0
  63. package/dist/components/Programa/Annotations/index.js +195 -0
  64. package/dist/components/Programa/Annotations/utils.d.ts +18 -0
  65. package/dist/components/Programa/Annotations/utils.js +46 -0
  66. package/dist/components/Programa/Programa.d.ts +3 -1
  67. package/dist/components/Programa/Programa.js +20 -6
  68. package/dist/components/index.d.ts +3 -1
  69. package/dist/components/index.js +1 -0
  70. package/dist/utils/index.d.ts +47 -0
  71. package/dist/utils/index.js +104 -4
  72. package/lib/api/index.js +24 -6
  73. package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +9 -1
  74. package/lib/components/ArgousComplexTable/ArgousComplexTable.js +6 -4
  75. package/lib/components/BarraFerramentas/BarraFerramentas.d.ts +4 -1
  76. package/lib/components/BarraFerramentas/BarraFerramentas.js +92 -50
  77. package/lib/components/Document/Icons.js +169 -0
  78. package/lib/components/Document/ModalVisualizacaoDocumentos.js +64 -0
  79. package/lib/components/Document/Visualizacao.js +104 -0
  80. package/lib/components/Document/icons/ai.svg +20 -0
  81. package/lib/components/Document/icons/audio.svg +16 -0
  82. package/lib/components/Document/icons/avi.svg +15 -0
  83. package/lib/components/Document/icons/css.svg +47 -0
  84. package/lib/components/Document/icons/csv.svg +37 -0
  85. package/lib/components/Document/icons/dbf.svg +30 -0
  86. package/lib/components/Document/icons/doc.svg +47 -0
  87. package/lib/components/Document/icons/dwg.svg +32 -0
  88. package/lib/components/Document/icons/exe.svg +20 -0
  89. package/lib/components/Document/icons/file.svg +11 -0
  90. package/lib/components/Document/icons/fla.svg +23 -0
  91. package/lib/components/Document/icons/html.svg +23 -0
  92. package/lib/components/Document/icons/image.svg +16 -0
  93. package/lib/components/Document/icons/iso.svg +40 -0
  94. package/lib/components/Document/icons/jpg.svg +33 -0
  95. package/lib/components/Document/icons/js.svg +40 -0
  96. package/lib/components/Document/icons/json.svg +45 -0
  97. package/lib/components/Document/icons/mod.svg +41 -0
  98. package/lib/components/Document/icons/mp3.svg +36 -0
  99. package/lib/components/Document/icons/mp4.svg +25 -0
  100. package/lib/components/Document/icons/pdf.svg +35 -0
  101. package/lib/components/Document/icons/png.svg +30 -0
  102. package/lib/components/Document/icons/ppt.svg +31 -0
  103. package/lib/components/Document/icons/psd.svg +50 -0
  104. package/lib/components/Document/icons/rtf.svg +35 -0
  105. package/lib/components/Document/icons/search.svg +20 -0
  106. package/lib/components/Document/icons/svg.svg +34 -0
  107. package/lib/components/Document/icons/txt.svg +29 -0
  108. package/lib/components/Document/icons/video.svg +17 -0
  109. package/lib/components/Document/icons/xls.svg +31 -0
  110. package/lib/components/Document/icons/xml.svg +25 -0
  111. package/lib/components/Document/icons/zip.svg +24 -0
  112. package/lib/components/Document/icons/zip1.svg +18 -0
  113. package/lib/components/Document/index.d.ts +3 -0
  114. package/lib/components/Document/index.js +3 -0
  115. package/lib/components/Programa/Annotations/Annotation.js +274 -0
  116. package/lib/components/Programa/Annotations/AnnotationsList.js +30 -0
  117. package/lib/components/Programa/Annotations/Input/FileInput.js +96 -0
  118. package/lib/components/Programa/Annotations/Input/Input.js +190 -0
  119. package/lib/components/Programa/Annotations/Input/PrivacySelection.js +72 -0
  120. package/lib/components/Programa/Annotations/Input/ReplyInformation.js +86 -0
  121. package/lib/components/Programa/Annotations/Input/UsersAutocomplete.js +122 -0
  122. package/lib/components/Programa/Annotations/index.js +136 -0
  123. package/lib/components/Programa/Annotations/utils.js +30 -0
  124. package/lib/components/Programa/Programa.d.ts +3 -1
  125. package/lib/components/Programa/Programa.js +20 -5
  126. package/lib/components/index.d.ts +3 -1
  127. package/lib/components/index.js +3 -1
  128. package/lib/utils/index.ts +112 -0
  129. package/package.json +3 -1
@@ -0,0 +1,218 @@
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 __spreadArray = (this && this.__spreadArray) || function (to, from) {
69
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
70
+ to[j] = from[i];
71
+ return to;
72
+ };
73
+ var __importDefault = (this && this.__importDefault) || function (mod) {
74
+ return (mod && mod.__esModule) ? mod : { "default": mod };
75
+ };
76
+ Object.defineProperty(exports, "__esModule", { value: true });
77
+ var FileInput_1 = __importDefault(require("./FileInput"));
78
+ var PrivacySelection_1 = __importDefault(require("./PrivacySelection"));
79
+ var ReplyInformation_1 = __importDefault(require("./ReplyInformation"));
80
+ var UsersAutocomplete_1 = __importDefault(require("./UsersAutocomplete"));
81
+ var __1 = require("..");
82
+ var api_1 = require("../../../../api");
83
+ var Annotation_1 = require("../Annotation");
84
+ var utils_1 = require("../utils");
85
+ var core_1 = require("@material-ui/core");
86
+ var react_1 = __importStar(require("react"));
87
+ var useStyles = core_1.makeStyles(function (theme) { return ({
88
+ inputContainer: {
89
+ display: 'flex',
90
+ flexDirection: 'column',
91
+ gap: utils_1.SMALL_SIZE
92
+ },
93
+ materialInput: {
94
+ padding: utils_1.EXTRA_SMALL_SIZE,
95
+ backgroundColor: theme.palette.background.default,
96
+ border: "1px solid " + utils_1.LIGHT_GREY_COLOR(theme.palette.type),
97
+ '&>textarea': {
98
+ minHeight: (utils_1.LARGE_SIZE + utils_1.SMALL_SIZE)
99
+ }
100
+ },
101
+ buttonsDiv: {
102
+ display: 'flex',
103
+ justifyContent: 'flex-end',
104
+ gap: utils_1.SMALL_SIZE,
105
+ '&>button': {
106
+ minHeight: 30,
107
+ lineHeight: 1
108
+ }
109
+ }
110
+ }); });
111
+ var initialStatePrivacyType = '0';
112
+ var Input = function () {
113
+ var classes = useStyles();
114
+ var materialInputRef = react_1.useRef(null);
115
+ var _a = react_1.useContext(__1.AnnotationsContext), list = _a.list, annotationParameters = _a.annotationParameters, selectedAnnotation = _a.selectedAnnotation, code = _a.code, loading = _a.loading, dispatch = _a.dispatch;
116
+ var replying = !!selectedAnnotation.length;
117
+ var _b = react_1.useState(''), text = _b[0], setText = _b[1];
118
+ var _c = react_1.useState(''), file = _c[0], setFile = _c[1];
119
+ var _d = react_1.useState([]), markedUsers = _d[0], setMarkedUsers = _d[1];
120
+ var _e = react_1.useState(initialStatePrivacyType), privacyType = _e[0], setPrivacyType = _e[1];
121
+ function resetStates() {
122
+ setText('');
123
+ setFile('');
124
+ setMarkedUsers([]);
125
+ setPrivacyType(initialStatePrivacyType);
126
+ }
127
+ var cancelReply = function () {
128
+ dispatch({ field: 'selectedAnnotation', value: [] });
129
+ resetStates();
130
+ };
131
+ var addAnnotation = function (_a) {
132
+ var answer = _a.answer, _b = _a.newAnnotation, newAnnotation = _b === void 0 ? [] : _b;
133
+ if (!newAnnotation.length)
134
+ return;
135
+ var newList = __spreadArray([], list.annotations);
136
+ if (answer) {
137
+ var parentIndex = newList.findIndex(function (annotation) { return (annotation[Annotation_1.ANNOTATION_ID_INDEX] === answer); });
138
+ if (parentIndex === -1)
139
+ return;
140
+ var newParentAnnotation = __spreadArray([], newList[parentIndex]);
141
+ var newAnswers = __spreadArray([], newParentAnnotation[Annotation_1.ANNOTATION_ANSWERS_INDEX]);
142
+ var newAnswer = {
143
+ dsAnotacao: newAnnotation[Annotation_1.ANNOTATION_TEXT_INDEX],
144
+ dtAnotacao: newAnnotation[Annotation_1.ANNOTATION_DATE_INDEX],
145
+ idAnotacao: newAnnotation[Annotation_1.ANNOTATION_ID_INDEX],
146
+ idAnotacaoPai: answer,
147
+ parametros: newAnnotation[Annotation_1.ANNOTATION_PARAMETERS_INDEX],
148
+ pgCode: newAnnotation[Annotation_1.ANNOTATION_PROGRAM_CODE_INDEX],
149
+ usuario: newAnnotation[Annotation_1.ANNOTATION_USER_INDEX]
150
+ };
151
+ newAnswers.push(newAnswer);
152
+ newParentAnnotation.splice(Annotation_1.ANNOTATION_ANSWERS_INDEX, 1, newAnswers);
153
+ newList.splice(parentIndex, 1, newParentAnnotation);
154
+ }
155
+ else {
156
+ newList.unshift(newAnnotation);
157
+ }
158
+ dispatch({ type: 'list', field: 'annotations', value: newList });
159
+ };
160
+ var saveAnnotation = function (event) { return __awaiter(void 0, void 0, void 0, function () {
161
+ var methodParameters, idRecebimento, response;
162
+ return __generator(this, function (_a) {
163
+ switch (_a.label) {
164
+ case 0:
165
+ dispatch({ type: 'loading', field: 'save', value: true });
166
+ methodParameters = {
167
+ pgCode: code,
168
+ dsAnotacao: text,
169
+ idAnotacaoPai: (selectedAnnotation.length) ? selectedAnnotation[Annotation_1.ANNOTATION_ID_INDEX] : undefined,
170
+ parametros: annotationParameters,
171
+ tpPrivacidade: privacyType,
172
+ idRecebimento: undefined,
173
+ usuarioRelacionado: markedUsers.map(function (_a) {
174
+ var id = _a[0];
175
+ return id;
176
+ })
177
+ };
178
+ if (!file) return [3 /*break*/, 2];
179
+ return [4 /*yield*/, api_1.prepareFile(file)];
180
+ case 1:
181
+ idRecebimento = (_a.sent()).idRecebimento;
182
+ methodParameters.idRecebimento = idRecebimento;
183
+ _a.label = 2;
184
+ case 2: return [4 /*yield*/, api_1.saveProgramAnnotation(methodParameters)];
185
+ case 3:
186
+ response = _a.sent();
187
+ if (response === null || response === void 0 ? void 0 : response.status) {
188
+ cancelReply();
189
+ addAnnotation({ answer: selectedAnnotation[Annotation_1.ANNOTATION_ID_INDEX], newAnnotation: response === null || response === void 0 ? void 0 : response.anotacao });
190
+ }
191
+ dispatch({ type: 'loading', field: 'save', value: false });
192
+ return [2 /*return*/];
193
+ }
194
+ });
195
+ }); };
196
+ var setUpReply = function () {
197
+ (materialInputRef.current) && materialInputRef.current.focus();
198
+ setFile('');
199
+ setMarkedUsers([]);
200
+ setPrivacyType(initialStatePrivacyType);
201
+ };
202
+ react_1.useEffect(function () { return (replying) && setUpReply(); }, [replying]);
203
+ return react_1.default.createElement("div", { className: classes.inputContainer },
204
+ (replying) && react_1.default.createElement(ReplyInformation_1.default, __assign({}, { selectedAnnotation: selectedAnnotation })),
205
+ react_1.default.createElement("div", null,
206
+ react_1.default.createElement(core_1.Input, { fullWidth: true, multiline: true, inputRef: materialInputRef, placeholder: 'Escreva a sua anota\u00E7\u00E3o', disabled: loading.save, value: text, onChange: function (event) { return setText(event.target.value); }, className: classes.materialInput })),
207
+ (!replying) && (react_1.default.createElement(react_1.default.Fragment, null,
208
+ react_1.default.createElement("div", { className: classes.buttonsDiv },
209
+ react_1.default.createElement(FileInput_1.default, __assign({}, { file: file }, { onChange: function (_, value) { return setFile(value); } }))),
210
+ react_1.default.createElement("div", { className: classes.buttonsDiv },
211
+ react_1.default.createElement(UsersAutocomplete_1.default, { disabled: loading.save, value: markedUsers, onChange: function (event, value, reason, details) { return setMarkedUsers(value); } })),
212
+ react_1.default.createElement("div", { className: classes.buttonsDiv },
213
+ react_1.default.createElement(PrivacySelection_1.default, { disabled: loading.save, value: privacyType, onChange: function (event) { return setPrivacyType(event.target.value); } })))),
214
+ react_1.default.createElement("div", { className: classes.buttonsDiv },
215
+ (replying) && (react_1.default.createElement(core_1.Button, { color: 'default', variant: 'contained', size: 'small', onClick: cancelReply }, "Cancelar")),
216
+ react_1.default.createElement(core_1.Button, { color: 'primary', variant: 'contained', size: 'small', disabled: !text.length || loading.save, onClick: saveAnnotation, style: { width: (replying) ? 97.13 : 72.45 } }, (loading.save) ? react_1.default.createElement(core_1.CircularProgress, { color: 'primary', size: 22 }) : (replying) ? 'Responder' : 'Anotar')));
217
+ };
218
+ exports.default = Input;
@@ -0,0 +1,7 @@
1
+ export default PrivacySelection;
2
+ declare function PrivacySelection({ value, onChange, disabled }: {
3
+ value?: string | undefined;
4
+ onChange?: (() => string) | undefined;
5
+ disabled?: boolean | undefined;
6
+ }): React.JSX.Element;
7
+ import React from "react";
@@ -0,0 +1,65 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var utils_1 = require("../utils");
18
+ var core_1 = require("@material-ui/core");
19
+ var react_1 = __importDefault(require("react"));
20
+ var useStyles = core_1.makeStyles({
21
+ selectTextField: {
22
+ '&>div>svg': {
23
+ right: utils_1.EXTRA_SMALL_SIZE
24
+ }
25
+ },
26
+ menuItem: {
27
+ display: 'flex',
28
+ gap: utils_1.EXTRA_SMALL_SIZE,
29
+ padding: utils_1.EXTRA_SMALL_SIZE
30
+ }
31
+ });
32
+ var PrivacySelection = function (_a) {
33
+ var _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.onChange, onChange = _c === void 0 ? function () { return ''; } : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
34
+ var classes = useStyles();
35
+ return (react_1.default.createElement(core_1.TextField, __assign({}, { value: value, onChange: onChange, disabled: disabled }, { select: true, variant: 'filled', InputProps: {
36
+ disableUnderline: true,
37
+ style: {
38
+ borderRadius: 4,
39
+ height: '100%'
40
+ }
41
+ }, SelectProps: {
42
+ SelectDisplayProps: {
43
+ style: {
44
+ display: 'flex',
45
+ alignItems: 'center',
46
+ gap: utils_1.EXTRA_SMALL_SIZE,
47
+ padding: utils_1.EXTRA_SMALL_SIZE + "px " + ((utils_1.EXTRA_SMALL_SIZE * 2) + 24) + "px " + utils_1.EXTRA_SMALL_SIZE + "px " + utils_1.EXTRA_SMALL_SIZE + "px"
48
+ }
49
+ },
50
+ MenuProps: {
51
+ variant: 'menu',
52
+ MenuListProps: {
53
+ style: { padding: utils_1.EXTRA_SMALL_SIZE + "px 0" }
54
+ }
55
+ }
56
+ }, className: classes.selectTextField }), utils_1.privacyTypeOptions.map(function (privacyType) {
57
+ var value = privacyType[0];
58
+ var label = privacyType[1];
59
+ var ICON = privacyType[2];
60
+ return react_1.default.createElement(core_1.MenuItem, __assign({ key: value + "-menu-item" }, { value: value }, { className: classes.menuItem }),
61
+ (ICON) && react_1.default.createElement(ICON, { size: utils_1.MEDIUM_SIZE }),
62
+ react_1.default.createElement(core_1.Typography, { variant: 'body2' }, label));
63
+ })));
64
+ };
65
+ exports.default = PrivacySelection;
@@ -0,0 +1,5 @@
1
+ export default ReplyInformation;
2
+ declare function ReplyInformation({ selectedAnnotation }: {
3
+ selectedAnnotation: any;
4
+ }): React.JSX.Element;
5
+ import React from "react";
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var components_1 = require("../../../../components");
7
+ var Annotation_1 = require("../Annotation");
8
+ var utils_1 = require("../utils");
9
+ var core_1 = require("@material-ui/core");
10
+ var moment_1 = __importDefault(require("moment"));
11
+ var react_1 = __importDefault(require("react"));
12
+ var useStyles = core_1.makeStyles(function (theme) { return ({
13
+ replyInformation: {
14
+ display: 'flex',
15
+ flexDirection: 'column',
16
+ alignItems: 'flex-end',
17
+ gap: utils_1.SMALL_SIZE,
18
+ '&>div:nth-child(1)': {
19
+ display: 'flex',
20
+ gap: utils_1.SMALL_SIZE,
21
+ '&>h6': {
22
+ fontWeight: 500,
23
+ lineHeight: 1
24
+ }
25
+ },
26
+ '&>div:nth-child(2)': {
27
+ display: 'flex',
28
+ flexDirection: 'column',
29
+ gap: utils_1.SMALL_SIZE,
30
+ '&>div:nth-child(1)': {
31
+ display: 'flex',
32
+ justifyContent: 'flex-end',
33
+ gap: utils_1.SMALL_SIZE,
34
+ '&>div:nth-child(1)': {
35
+ display: 'flex',
36
+ alignItems: 'flex-end',
37
+ justifyContent: 'center',
38
+ flexDirection: 'column',
39
+ gap: utils_1.EXTRA_SMALL_SIZE,
40
+ '&>h6': {
41
+ lineHeight: 1
42
+ },
43
+ '&>p': {
44
+ lineHeight: 1,
45
+ fontSize: '.75rem',
46
+ fontWeight: 500,
47
+ color: utils_1.MEDIUM_GREY_COLOR(theme.palette.type)
48
+ }
49
+ },
50
+ '&>div:nth-child(2)': {
51
+ width: utils_1.AVATAR_SIZE,
52
+ height: utils_1.AVATAR_SIZE
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }); });
58
+ var ReplyInformation = function (_a) {
59
+ var _b, _c;
60
+ var selectedAnnotation = _a.selectedAnnotation;
61
+ var classes = useStyles();
62
+ var text = selectedAnnotation[Annotation_1.ANNOTATION_TEXT_INDEX];
63
+ var user = { id: (((_b = selectedAnnotation[Annotation_1.ANNOTATION_USER_INDEX]) === null || _b === void 0 ? void 0 : _b[0]) || -1), name: (((_c = selectedAnnotation[Annotation_1.ANNOTATION_USER_INDEX]) === null || _c === void 0 ? void 0 : _c[1]) || '') };
64
+ var date = (selectedAnnotation[Annotation_1.ANNOTATION_DATE_INDEX]) ? moment_1.default(selectedAnnotation[Annotation_1.ANNOTATION_DATE_INDEX]).format('DD/MM/YYYY HH:mm:ss') : '';
65
+ return react_1.default.createElement("div", { className: classes.replyInformation },
66
+ react_1.default.createElement("div", null,
67
+ react_1.default.createElement(utils_1.AnswerIcon, { color: utils_1.UNIMED_GREEN_COLOR, size: 16 }),
68
+ react_1.default.createElement(core_1.Typography, { variant: 'subtitle1' }, "Respondendo")),
69
+ react_1.default.createElement("div", null,
70
+ react_1.default.createElement("div", null,
71
+ react_1.default.createElement("div", null,
72
+ react_1.default.createElement(core_1.Typography, { variant: 'subtitle2' }, user.name),
73
+ react_1.default.createElement(core_1.Typography, { variant: 'body2' }, date)),
74
+ react_1.default.createElement(components_1.ArgousAvatar, { alt: user.name + "-avatar", idUsuario: user.id, nome: user.name })),
75
+ react_1.default.createElement("div", null,
76
+ react_1.default.createElement(core_1.Typography, { variant: 'body2', align: 'right' }, text))));
77
+ };
78
+ exports.default = ReplyInformation;
@@ -0,0 +1,7 @@
1
+ export default UsersAutocomplete;
2
+ declare function UsersAutocomplete({ value, onChange, disabled }: {
3
+ value?: any[] | undefined;
4
+ onChange?: (() => string) | undefined;
5
+ disabled?: boolean | undefined;
6
+ }): React.JSX.Element;
7
+ import React from "react";
@@ -0,0 +1,139 @@
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("../../../../api");
70
+ var components_1 = require("../../../../components");
71
+ var utils_1 = require("../../../../utils");
72
+ var api_2 = require("../../../../utils/api");
73
+ var utils_2 = require("../utils");
74
+ var core_1 = require("@material-ui/core");
75
+ var lab_1 = require("@material-ui/lab");
76
+ var react_1 = __importStar(require("react"));
77
+ var useStyles = core_1.makeStyles({
78
+ userAutocomplete: {
79
+ maxWidth: '100%'
80
+ },
81
+ usersAutocompleteInput: {
82
+ '&>div>input': {
83
+ minWidth: '137px !important',
84
+ padding: utils_2.EXTRA_SMALL_SIZE + "px !important"
85
+ },
86
+ '& .MuiAutocomplete-inputRoot[class*="MuiFilledInput-root"] .MuiAutocomplete-endAdornment': {
87
+ right: utils_2.EXTRA_SMALL_SIZE
88
+ }
89
+ },
90
+ usersAutocompleteChip: {
91
+ height: utils_2.LARGE_SIZE,
92
+ borderRadius: 0,
93
+ margin: utils_2.EXTRA_SMALL_SIZE,
94
+ '&>span': {
95
+ padding: "0 " + utils_2.SMALL_SIZE + "px"
96
+ },
97
+ '&>svg': {
98
+ margin: "0 " + utils_2.EXTRA_SMALL_SIZE + "px 0 0"
99
+ }
100
+ }
101
+ });
102
+ var UsersAutocomplete = function (_a) {
103
+ var _b = _a.value, value = _b === void 0 ? [] : _b, _c = _a.onChange, onChange = _c === void 0 ? function () { return ''; } : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
104
+ var classes = useStyles();
105
+ var _e = react_1.useState(''), search = _e[0], setSearch = _e[1];
106
+ var _f = react_1.useState([]), users = _f[0], setUsers = _f[1];
107
+ function getUsers(dsFiltroNome) {
108
+ var _a;
109
+ return __awaiter(this, void 0, void 0, function () {
110
+ var res;
111
+ return __generator(this, function (_b) {
112
+ switch (_b.label) {
113
+ case 0: return [4 /*yield*/, api_1.searchUsers({ dsFiltroNome: dsFiltroNome })];
114
+ case 1:
115
+ res = _b.sent();
116
+ if ((_a = res.users) === null || _a === void 0 ? void 0 : _a.length)
117
+ setUsers(res.users || []);
118
+ else
119
+ api_2.setError(res.dsErro);
120
+ return [2 /*return*/];
121
+ }
122
+ });
123
+ });
124
+ }
125
+ react_1.useEffect(function () { return getUsers(search); }, [search]);
126
+ function handleOnChange(event, value, reason, details) {
127
+ (onChange) && onChange(event, value, reason, details);
128
+ }
129
+ return (react_1.default.createElement(lab_1.Autocomplete, __assign({}, { value: value, disabled: disabled }, { multiple: true, onChange: handleOnChange, options: users.filter(function (user) { return value.indexOf(user) < 0; }), getOptionLabel: function (option) { return utils_1.formataNome(option[1]); }, getOptionSelected: function (option, value) { return ((option === null || option === void 0 ? void 0 : option[0]) === (value === null || value === void 0 ? void 0 : value[0])); }, noOptionsText: 'N\u00E3o encontrado', openText: 'Abrir', closeText: 'Fechar', clearText: 'Limpar', renderTags: function (value, getTagProps) { return (value.map(function (option, index) {
130
+ var id = option === null || option === void 0 ? void 0 : option[0];
131
+ var name = option === null || option === void 0 ? void 0 : option[1];
132
+ return (react_1.default.createElement(core_1.Chip, __assign({ icon: (react_1.default.createElement(components_1.ArgousAvatar, { alt: name + " avatar", idUsuario: id, nome: name, style: { height: 30, width: 30, margin: "0 0 0 " + utils_2.EXTRA_SMALL_SIZE + "px" } })), label: option[1] || option }, getTagProps({ index: index }), { className: classes.usersAutocompleteChip })));
133
+ })); }, renderInput: function (params) { return (react_1.default.createElement(core_1.TextField, { id: params.id, variant: 'filled', placeholder: 'Selecione usu\u00E1rios', fullWidth: params.fullWidth, size: params.size, disabled: params.disabled, InputLabelProps: params.InputLabelProps, InputProps: __assign(__assign({}, params.InputProps), { disableUnderline: true, style: {
134
+ height: '100%',
135
+ borderRadius: 4,
136
+ padding: utils_2.EXTRA_SMALL_SIZE + "px 62px " + utils_2.EXTRA_SMALL_SIZE + "px " + utils_2.EXTRA_SMALL_SIZE + "px"
137
+ } }), inputProps: params.inputProps, value: search, onChange: function (e) { return setSearch(e.target.value); }, className: classes.usersAutocompleteInput })); }, className: classes.userAutocomplete })));
138
+ };
139
+ exports.default = UsersAutocomplete;
@@ -0,0 +1,23 @@
1
+ export const AnnotationsContext: React.Context<{
2
+ selectedAnnotation: never[];
3
+ list: {
4
+ annotations: never[];
5
+ };
6
+ loading: {
7
+ main: boolean;
8
+ save: boolean;
9
+ file: boolean;
10
+ };
11
+ printScreen: {};
12
+ }>;
13
+ export default Annotations;
14
+ import React from "react";
15
+ declare function Annotations({ open, proceed, onClose, code, pgTitle, annotationParameters, openAnnotationParameters }: {
16
+ open: any;
17
+ proceed: any;
18
+ onClose: any;
19
+ code: any;
20
+ pgTitle: any;
21
+ annotationParameters: any;
22
+ openAnnotationParameters: any;
23
+ }): React.JSX.Element;