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,195 @@
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.AnnotationsContext = void 0;
73
+ var AnnotationsList_1 = __importDefault(require("./AnnotationsList"));
74
+ var Input_1 = __importDefault(require("./Input/Input"));
75
+ var utils_1 = require("./utils");
76
+ var api_1 = require("../../../api");
77
+ var utils_2 = require("../../../utils");
78
+ var core_1 = require("@material-ui/core");
79
+ var react_1 = __importStar(require("react"));
80
+ var use_immer_1 = require("use-immer");
81
+ var useStyles = core_1.makeStyles(function () { return ({
82
+ dialogContainer: {
83
+ display: 'flex',
84
+ flexDirection: 'column',
85
+ gap: utils_1.MEDIUM_SIZE,
86
+ padding: utils_1.MEDIUM_SIZE,
87
+ overflowY: 'auto'
88
+ },
89
+ dialogHeader: {
90
+ display: 'flex',
91
+ alignItems: 'flex-start',
92
+ justifyContent: 'space-between',
93
+ gap: utils_1.MEDIUM_SIZE,
94
+ '&>h6': {
95
+ lineHeight: 1
96
+ }
97
+ },
98
+ dialogHeaderActions: {
99
+ position: 'relative',
100
+ '&>button': {
101
+ zIndex: 1,
102
+ padding: utils_1.EXTRA_SMALL_SIZE
103
+ }
104
+ },
105
+ dialogHeaderLoading: {
106
+ position: 'absolute',
107
+ inset: 0,
108
+ zIndex: 0
109
+ }
110
+ }); });
111
+ var initialStateLoading = {
112
+ main: false,
113
+ save: false,
114
+ file: false
115
+ };
116
+ var initialStateList = {
117
+ annotations: []
118
+ };
119
+ var initialState = {
120
+ selectedAnnotation: [],
121
+ list: initialStateList,
122
+ loading: initialStateLoading,
123
+ printScreen: {}
124
+ };
125
+ var reducer = function (state, _a) {
126
+ if (state === void 0) { state = initialState; }
127
+ var type = _a.type, property = _a.property, field = _a.field, value = _a.value;
128
+ switch (type) {
129
+ default:
130
+ if (type && property && field)
131
+ state[type][property][field] = value;
132
+ else if (type && field)
133
+ state[type][field] = value;
134
+ else if (field)
135
+ state[field] = value;
136
+ break;
137
+ }
138
+ };
139
+ exports.AnnotationsContext = react_1.createContext(initialState);
140
+ var Annotations = function (_a) {
141
+ var open = _a.open, proceed = _a.proceed, onClose = _a.onClose, code = _a.code, pgTitle = _a.pgTitle, annotationParameters = _a.annotationParameters, openAnnotationParameters = _a.openAnnotationParameters;
142
+ var classes = useStyles();
143
+ var loggedUser = utils_2.useStore().usuarioLogado;
144
+ var dialogRef = react_1.useRef(null);
145
+ var _b = use_immer_1.useImmerReducer(reducer, initialState), state = _b[0], dispatch = _b[1];
146
+ var loading = state.loading, list = state.list;
147
+ var handleDialogClose = react_1.useCallback(function (event) {
148
+ (proceed) && proceed();
149
+ (onClose) && onClose(event);
150
+ }, [proceed, onClose]);
151
+ var getAnnotations = react_1.useCallback(function (code) { return __awaiter(void 0, void 0, void 0, function () {
152
+ var response;
153
+ return __generator(this, function (_a) {
154
+ switch (_a.label) {
155
+ case 0:
156
+ dispatch({ type: 'loading', field: 'main', value: true });
157
+ return [4 /*yield*/, api_1.getProgramAnnotations({ pgCode: code, ctrlPgn: {} })];
158
+ case 1:
159
+ response = _a.sent();
160
+ (response === null || response === void 0 ? void 0 : response.status) && dispatch({ type: 'list', field: 'annotations', value: ((response === null || response === void 0 ? void 0 : response.list) || []) });
161
+ dispatch({ type: 'loading', field: 'main', value: false });
162
+ return [2 /*return*/];
163
+ }
164
+ });
165
+ }); }, [dispatch]);
166
+ react_1.useEffect(function () { return getAnnotations(code); }, [code, getAnnotations]);
167
+ var scrollDialogToBottom = function (event) {
168
+ if (!dialogRef.current)
169
+ return;
170
+ dialogRef.current.children[2].children[0].scroll({ top: dialogRef.current.offsetHeight, behavior: 'smooth' });
171
+ };
172
+ var contextValues = react_1.useMemo(function () { return (__assign(__assign({}, state), { code: code,
173
+ pgTitle: pgTitle,
174
+ loggedUser: loggedUser,
175
+ dialogRef: dialogRef,
176
+ annotationParameters: annotationParameters,
177
+ openAnnotationParameters: openAnnotationParameters,
178
+ scrollDialogToBottom: scrollDialogToBottom,
179
+ handleDialogClose: handleDialogClose,
180
+ dispatch: dispatch })); }, [code, pgTitle, annotationParameters, openAnnotationParameters, loggedUser, state, handleDialogClose, dispatch]);
181
+ return react_1.default.createElement(exports.AnnotationsContext.Provider, { value: contextValues },
182
+ react_1.default.createElement(core_1.Dialog, __assign({}, { open: open }, { maxWidth: 'lg', disableRestoreFocus: true, disableEnforceFocus: true, ref: dialogRef, onClose: handleDialogClose }),
183
+ react_1.default.createElement("div", { className: classes.dialogContainer },
184
+ react_1.default.createElement("div", { className: classes.dialogHeader },
185
+ react_1.default.createElement(core_1.Typography, { variant: 'h6' },
186
+ "Anota\u00E7\u00F5es ",
187
+ pgTitle),
188
+ react_1.default.createElement("div", { className: classes.dialogHeaderActions },
189
+ react_1.default.createElement(core_1.IconButton, { onClick: handleDialogClose },
190
+ react_1.default.createElement(utils_1.CloseIcon, null)),
191
+ (loading.main) && react_1.default.createElement(core_1.CircularProgress, { color: 'secondary', size: 34, className: classes.dialogHeaderLoading }))),
192
+ (!!list.annotations.length) && react_1.default.createElement(AnnotationsList_1.default, null),
193
+ react_1.default.createElement(Input_1.default, null))));
194
+ };
195
+ exports.default = Annotations;
@@ -0,0 +1,18 @@
1
+ export const EXTRA_SMALL_SIZE: 5;
2
+ export const SMALL_SIZE: number;
3
+ export const MEDIUM_SIZE: number;
4
+ export const LARGE_SIZE: number;
5
+ export const AVATAR_SIZE: 33;
6
+ export const UNIMED_GREEN_COLOR: "#00995D";
7
+ export function LIGHT_GREY_COLOR(type: any): string;
8
+ export function MEDIUM_GREY_COLOR(type: any): string;
9
+ export function ViewedIcon(props: any): React.JSX.Element;
10
+ export function AnswerIcon(props: any): React.JSX.Element;
11
+ export function CloseIcon(props: any): React.JSX.Element;
12
+ export const privacyTypeOptions: (string | import("react-icons/lib").IconType)[][];
13
+ export namespace ELLIPSIS_TEXT_STYLE {
14
+ const overflow: string;
15
+ const whiteSpace: string;
16
+ const textOverflow: string;
17
+ }
18
+ import React from "react";
@@ -0,0 +1,46 @@
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
+ exports.ELLIPSIS_TEXT_STYLE = exports.privacyTypeOptions = exports.CloseIcon = exports.AnswerIcon = exports.ViewedIcon = exports.MEDIUM_GREY_COLOR = exports.LIGHT_GREY_COLOR = exports.UNIMED_GREEN_COLOR = exports.AVATAR_SIZE = exports.LARGE_SIZE = exports.MEDIUM_SIZE = exports.SMALL_SIZE = exports.EXTRA_SMALL_SIZE = void 0;
18
+ var react_1 = __importDefault(require("react"));
19
+ var bs_1 = require("react-icons/bs");
20
+ var io_1 = require("react-icons/io");
21
+ var io5_1 = require("react-icons/io5");
22
+ exports.EXTRA_SMALL_SIZE = 5;
23
+ exports.SMALL_SIZE = (exports.EXTRA_SMALL_SIZE * 2);
24
+ exports.MEDIUM_SIZE = (exports.SMALL_SIZE * 2);
25
+ exports.LARGE_SIZE = (exports.MEDIUM_SIZE * 2);
26
+ exports.AVATAR_SIZE = 33;
27
+ exports.UNIMED_GREEN_COLOR = '#00995D';
28
+ var LIGHT_GREY_COLOR = function (type) { return "rgba(" + ((type === 'light') ? '0, 0, 0' : '255, 255, 255') + ", .12)"; };
29
+ exports.LIGHT_GREY_COLOR = LIGHT_GREY_COLOR;
30
+ var MEDIUM_GREY_COLOR = function (type) { return "rgba(" + ((type === 'light') ? '0, 0, 0' : '255, 255, 255') + ", .6)"; };
31
+ exports.MEDIUM_GREY_COLOR = MEDIUM_GREY_COLOR;
32
+ var ViewedIcon = function (props) { return react_1.default.createElement(bs_1.BsCheck2All, __assign({}, props)); };
33
+ exports.ViewedIcon = ViewedIcon;
34
+ var AnswerIcon = function (props) { return react_1.default.createElement(io5_1.IoArrowUndoSharp, __assign({}, props)); };
35
+ exports.AnswerIcon = AnswerIcon;
36
+ var CloseIcon = function (props) { return react_1.default.createElement(io5_1.IoClose, __assign({}, props)); };
37
+ exports.CloseIcon = CloseIcon;
38
+ exports.privacyTypeOptions = [
39
+ ['0', 'Público', io_1.IoMdGlobe],
40
+ ['1', 'Privado', io5_1.IoLockClosed]
41
+ ];
42
+ exports.ELLIPSIS_TEXT_STYLE = {
43
+ overflow: 'hidden',
44
+ whiteSpace: 'nowrap',
45
+ textOverflow: 'ellipsis'
46
+ };
@@ -23,7 +23,9 @@ export interface ProgramaProps extends BoxProps {
23
23
  bfHabFavorito: boolean,
24
24
  bfTitulo: string,
25
25
  linkCompartilhamento: string,
26
- className: string
26
+ className: string,
27
+ annotationParameters?: object,
28
+ openAnnotationParameters?: (event: Event, parameters: object) => void
27
29
  }
28
30
 
29
31
  declare function Programa(props: ProgramaProps): JSX.Element
@@ -81,23 +81,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
81
81
  };
82
82
  Object.defineProperty(exports, "__esModule", { value: true });
83
83
  var BarraFerramentas_1 = __importDefault(require("./../BarraFerramentas"));
84
+ var Annotations_1 = __importDefault(require("./Annotations"));
84
85
  var PageCodeEasterEgg_1 = __importDefault(require("./PageCodeEasterEgg"));
85
86
  var argous = __importStar(require("../../actions"));
86
87
  var api_1 = require("../../api");
88
+ var utils_1 = require("../../utils");
87
89
  var core_1 = require("@material-ui/core");
88
90
  var prop_types_1 = __importDefault(require("prop-types"));
89
91
  var react_1 = __importStar(require("react"));
90
92
  var fa_1 = require("react-icons/fa");
91
93
  var react_redux_1 = require("react-redux");
94
+ var initialStateToolbarLoading = {
95
+ annotations: false
96
+ };
92
97
  function Programa(_a) {
93
98
  var _this = this;
94
99
  var code = _a.code, children = _a.children, _b = _a.loading, loading = _b === void 0 ? false : _b, _c = _a.threads, threads = _c === void 0 ? [] : _c, hint = _a.hint, title = _a.title, panelTitle = _a.panelTitle, hideTitle = _a.hideTitle, setCurrentProgram = _a.setCurrentProgram, programDidMount = _a.programDidMount, favorites = _a.favorites, setFavorites = _a.setFavorites, bfHabNavegador = _a.bfHabNavegador, _d = _a.bfAbas, bfAbas = _d === void 0 ? [] : _d, _e = _a.bfFerramentas, bfFerramentas = _e === void 0 ? [] : _e, bfExecutaFuncao = _a.bfExecutaFuncao, bfNmFuncaoVoltar = _a.bfNmFuncaoVoltar, bfNmCompartilhar = _a.bfNmCompartilhar, bfHabCrud = _a.bfHabCrud, bfNmSalva = _a.bfNmSalva, bfNmExclui = _a.bfNmExclui, _f = _a.bfHabFavorito, bfHabFavorito = _f === void 0 ? true : _f, bfTitulo = _a.bfTitulo,
95
100
  // permissoes = { salvar: true, editar: true, excluir: true },
96
- linkCompartilhamento = _a.linkCompartilhamento, className = _a.className, rightSidebar = _a.rightSidebar, setRightSidebar = _a.setRightSidebar, setAddProgramWidget = _a.setAddProgramWidget, _ = _a.fields, props = __rest(_a, ["code", "children", "loading", "threads", "hint", "title", "panelTitle", "hideTitle", "setCurrentProgram", "programDidMount", "favorites", "setFavorites", "bfHabNavegador", "bfAbas", "bfFerramentas", "bfExecutaFuncao", "bfNmFuncaoVoltar", "bfNmCompartilhar", "bfHabCrud", "bfNmSalva", "bfNmExclui", "bfHabFavorito", "bfTitulo", "linkCompartilhamento", "className", "rightSidebar", "setRightSidebar", "setAddProgramWidget", "fields"]);
97
- var _g = react_1.useState({}), programa = _g[0], setPrograma = _g[1];
98
- var _h = react_1.useState(false), favoriteAnimationInsert = _h[0], setFavoriteAnimationInsert = _h[1];
99
- var _j = react_1.useState(false), favoriteAnimationRemove = _j[0], setFavoriteAnimationRemove = _j[1];
101
+ linkCompartilhamento = _a.linkCompartilhamento, className = _a.className, rightSidebar = _a.rightSidebar, setRightSidebar = _a.setRightSidebar, setAddProgramWidget = _a.setAddProgramWidget, _g = _a.annotationParameters, annotationParameters = _g === void 0 ? {} : _g, _h = _a.openAnnotationParameters, openAnnotationParameters = _h === void 0 ? function () { return ''; } : _h, _ = _a.fields, props = __rest(_a, ["code", "children", "loading", "threads", "hint", "title", "panelTitle", "hideTitle", "setCurrentProgram", "programDidMount", "favorites", "setFavorites", "bfHabNavegador", "bfAbas", "bfFerramentas", "bfExecutaFuncao", "bfNmFuncaoVoltar", "bfNmCompartilhar", "bfHabCrud", "bfNmSalva", "bfNmExclui", "bfHabFavorito", "bfTitulo", "linkCompartilhamento", "className", "rightSidebar", "setRightSidebar", "setAddProgramWidget", "annotationParameters", "openAnnotationParameters", "fields"]);
100
102
  var theme = core_1.useTheme();
103
+ var createModal = utils_1.useModal().createModal;
104
+ var annotationsModal = createModal(Annotations_1.default);
105
+ var _j = react_1.useState({}), programa = _j[0], setPrograma = _j[1];
106
+ var _k = react_1.useState(false), favoriteAnimationInsert = _k[0], setFavoriteAnimationInsert = _k[1];
107
+ var _l = react_1.useState(false), favoriteAnimationRemove = _l[0], setFavoriteAnimationRemove = _l[1];
108
+ var toolbarLoading = react_1.useState(initialStateToolbarLoading)[0] /*, setToolbarLoading*/;
101
109
  react_1.useEffect(function () {
102
110
  (function () { return __awaiter(_this, void 0, void 0, function () {
103
111
  var res;
@@ -121,6 +129,12 @@ function Programa(_a) {
121
129
  return function () { return setCurrentProgram(undefined); };
122
130
  // eslint-disable-next-line react-hooks/exhaustive-deps
123
131
  }, []);
132
+ var openAnnotations = function (event) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
133
+ switch (_a.label) {
134
+ case 0: return [4 /*yield*/, annotationsModal(__assign(__assign({}, programa), { code: code, annotationParameters: annotationParameters, openAnnotationParameters: openAnnotationParameters }))];
135
+ case 1: return [2 /*return*/, _a.sent()];
136
+ }
137
+ }); }); };
124
138
  var addFavorite = function () {
125
139
  var path = window.location.pathname;
126
140
  api_1.toggleFavorite({ link: path }).then(function (res) {
@@ -148,7 +162,7 @@ function Programa(_a) {
148
162
  var existIn = favorites.filter(function (item) { return item[3] === path; });
149
163
  return existIn.length > 0 ? 'active' : '';
150
164
  };
151
- var pgHint = programa.pgHint, pgTitle = programa.pgTitle, pnlTitle = programa.pnlTitle, dsErro = programa.dsErro, loaded = programa.loaded;
165
+ var pgHint = programa.pgHint, pgTitle = programa.pgTitle, pnlTitle = programa.pnlTitle, dsErro = programa.dsErro, loaded = programa.loaded, habWidget = programa.habWidget, snAnotacaoPrograma = programa.snAnotacaoPrograma;
152
166
  if (title !== undefined)
153
167
  pgTitle = title;
154
168
  if (hint !== undefined)
@@ -165,7 +179,7 @@ function Programa(_a) {
165
179
  react_1.default.createElement("span", { className: 'text-muted', style: { color: theme.palette.text.primary } }, "\u00A0|\u00A0")),
166
180
  react_1.default.createElement("p", { id: 'pg-subtitulo', className: 'pull-left hw-program-subtitulo', style: { color: theme.palette.text.primary } }, pgHint)),
167
181
  react_1.default.createElement(core_1.Paper, { variant: 'outlined', style: { padding: 10, position: 'relative' } },
168
- react_1.default.createElement(BarraFerramentas_1.default, __assign({ titulo: bfTitulo, abas: bfAbas, habFavorito: bfHabFavorito, habNavegador: bfHabNavegador, executaFuncao: bfExecutaFuncao, nmFuncaoVoltar: bfNmFuncaoVoltar, nmCompartilhar: bfNmCompartilhar, habCrud: bfHabCrud, nmSalva: bfNmSalva, nmExclui: bfNmExclui, ferramentas: bfFerramentas, checkIfIsFavorite: checkIfIsFavorite, addFavorite: addFavorite, linkCompartilhamento: linkCompartilhamento, favoriteAnimationInsert: favoriteAnimationInsert, favoriteAnimationRemove: favoriteAnimationRemove, threads: threads, currentProgram: code, habWidget: programa === null || programa === void 0 ? void 0 : programa.habWidget }, { addWidget: addWidget })),
182
+ react_1.default.createElement(BarraFerramentas_1.default, __assign({ titulo: bfTitulo, abas: bfAbas, habFavorito: bfHabFavorito, habNavegador: bfHabNavegador, executaFuncao: bfExecutaFuncao, nmFuncaoVoltar: bfNmFuncaoVoltar, nmCompartilhar: bfNmCompartilhar, habCrud: bfHabCrud, nmSalva: bfNmSalva, nmExclui: bfNmExclui, ferramentas: bfFerramentas, checkIfIsFavorite: checkIfIsFavorite, addFavorite: addFavorite, linkCompartilhamento: linkCompartilhamento, favoriteAnimationInsert: favoriteAnimationInsert, favoriteAnimationRemove: favoriteAnimationRemove, threads: threads, currentProgram: code }, { addWidget: addWidget, habWidget: habWidget, snAnotacaoPrograma: snAnotacaoPrograma, openAnnotations: openAnnotations, toolbarLoading: toolbarLoading })),
169
183
  dsErro ? (react_1.default.createElement(core_1.Box, { textAlign: 'center' },
170
184
  react_1.default.createElement(fa_1.FaExclamationTriangle, { style: { color: '#ED1651', width: '90px', height: '90px' } }),
171
185
  react_1.default.createElement(core_1.Typography, { variant: 'h6' }, dsErro))) : (!pnlTitle || loading || !loaded) ? (react_1.default.createElement(core_1.Box, { position: 'relative', top: 20, left: '50%', "z-index": 20, height: 80, width: 0, marginLeft: '-20px' },
@@ -169,4 +169,6 @@ export { default as Carousel } from './Carousel';
169
169
  export * from './Carousel';
170
170
 
171
171
  export { default as Cam } from './Cam';
172
- export * from './Cam';
172
+ export * from './Cam';
173
+
174
+ export * from './Document';
@@ -185,3 +185,4 @@ __exportStar(require("./Carousel"), exports);
185
185
  var Cam_1 = require("./Cam");
186
186
  Object.defineProperty(exports, "Cam", { enumerable: true, get: function () { return __importDefault(Cam_1).default; } });
187
187
  __exportStar(require("./Cam"), exports);
188
+ __exportStar(require("./Document"), exports);
@@ -75,3 +75,50 @@ export declare const bytesTranslator: (bytes?: number, decimals?: number, binary
75
75
  export declare const formatCpfCnpj: (value: (string | number)) => string;
76
76
  export declare function dataUrlToBlob(dataUrl: string): Blob | undefined;
77
77
  export declare function cpfTest(cpf: (string | number)): boolean;
78
+ interface PrintScreenParameters {
79
+ /**
80
+ * Event
81
+ */
82
+ event?: Event;
83
+ /**
84
+ * Element id
85
+ */
86
+ id: string;
87
+ /**
88
+ * Auto download
89
+ */
90
+ download: boolean;
91
+ }
92
+ export declare const printScreen: ({ event, id, download }: PrintScreenParameters) => Promise<object>;
93
+ interface GeraLogInterface {
94
+ (
95
+ /**
96
+ * Id do documento
97
+ */
98
+ idDocumento: number,
99
+ /**
100
+ * Descrição
101
+ */
102
+ descricao: string,
103
+ /**
104
+ * Tipo de ação
105
+ *
106
+ * 1 - Upload
107
+ * 2 - Alteração
108
+ * 3 - Consulta
109
+ */
110
+ tpAcao: string,
111
+ /**
112
+ * Token do sistema
113
+ */
114
+ tokenSistema?: string): Promise<void>;
115
+ }
116
+ export declare const geraLog: GeraLogInterface;
117
+ export declare const printUrl: (url: string) => Promise<void>;
118
+ declare global {
119
+ interface Window {
120
+ clipboardData: any;
121
+ }
122
+ }
123
+ export declare function stopPrntScr(e: KeyboardEvent): boolean;
124
+ export {};
@@ -81,15 +81,21 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
81
81
  to[j] = from[i];
82
82
  return to;
83
83
  };
84
+ var __importDefault = (this && this.__importDefault) || function (mod) {
85
+ return (mod && mod.__esModule) ? mod : { "default": mod };
86
+ };
84
87
  Object.defineProperty(exports, "__esModule", { value: true });
85
- exports.cpfTest = exports.dataUrlToBlob = exports.formatCpfCnpj = exports.bytesTranslator = exports.storageMeasures = exports.confirm = exports.copyToClipboard = exports.toFloat = exports.currencyMask = exports.numbersOnly = exports.formataCpf = exports.useWebSocket = exports.formataTelefone = exports.reduxDispatch = exports.useStore = exports.useModal = exports.useGraph = exports.randomColor = exports.humanFileSize = exports.sanitizaHTML = exports.formataDinheiro = exports.useUpdateEffect = exports.usePrevious = exports.getNumeroFromInitials = exports.getInitials = exports.getRandomColor = exports.printPdf = exports.downloadFromUrl = exports.downloadBase64 = exports.formataNome = exports.addExtraZero = exports.getCookie = exports.widthToCenterVertically = void 0;
88
+ exports.stopPrntScr = exports.printUrl = exports.geraLog = exports.printScreen = exports.cpfTest = exports.dataUrlToBlob = exports.formatCpfCnpj = exports.bytesTranslator = exports.storageMeasures = exports.confirm = exports.copyToClipboard = exports.toFloat = exports.currencyMask = exports.numbersOnly = exports.formataCpf = exports.useWebSocket = exports.formataTelefone = exports.reduxDispatch = exports.useStore = exports.useModal = exports.useGraph = exports.randomColor = exports.humanFileSize = exports.sanitizaHTML = exports.formataDinheiro = exports.useUpdateEffect = exports.usePrevious = exports.getNumeroFromInitials = exports.getInitials = exports.getRandomColor = exports.printPdf = exports.downloadFromUrl = exports.downloadBase64 = exports.formataNome = exports.addExtraZero = exports.getCookie = exports.widthToCenterVertically = void 0;
89
+ var api_1 = require("./api");
86
90
  var store_1 = require("./store");
87
- var api_1 = require("../api");
91
+ var api_2 = require("../api");
88
92
  var ModalProvider_1 = require("../components/ConfirmModal/ModalProvider");
89
93
  var fieldsRedux_1 = require("../fieldsRedux");
90
94
  var core_1 = require("@material-ui/core");
91
95
  var colors = __importStar(require("@material-ui/core/colors"));
96
+ var dom_to_image_1 = __importDefault(require("dom-to-image"));
92
97
  var lodash_1 = require("lodash");
98
+ var moment_1 = __importDefault(require("moment"));
93
99
  var react_1 = require("react");
94
100
  var widthToCenterVertically = function (content) {
95
101
  var B = document.body;
@@ -149,7 +155,7 @@ function downloadFromUrl(url, fileName, fileExtension) {
149
155
  var blob, urlCreator, tag;
150
156
  return __generator(this, function (_a) {
151
157
  switch (_a.label) {
152
- case 0: return [4 /*yield*/, fetch(url, { method: 'GET', headers: api_1.headers() })];
158
+ case 0: return [4 /*yield*/, fetch(url, { method: 'GET', headers: api_2.headers() })];
153
159
  case 1: return [4 /*yield*/, (_a.sent()).blob()];
154
160
  case 2:
155
161
  blob = _a.sent();
@@ -173,7 +179,7 @@ var printPdf = function (URL) {
173
179
  var url, iframe;
174
180
  return __generator(this, function (_a) {
175
181
  switch (_a.label) {
176
- case 0: return [4 /*yield*/, api_1.getFileFromLink({ URL: URL })];
182
+ case 0: return [4 /*yield*/, api_2.getFileFromLink({ URL: URL })];
177
183
  case 1:
178
184
  url = _a.sent();
179
185
  iframe = document.createElement('iframe');
@@ -476,3 +482,97 @@ function cpfTest(cpf) {
476
482
  return true;
477
483
  }
478
484
  exports.cpfTest = cpfTest;
485
+ var printScreen = function (_a) {
486
+ var event = _a.event, _b = _a.id, id = _b === void 0 ? 'root' : _b, _c = _a.download, download = _c === void 0 ? false : _c;
487
+ return __awaiter(void 0, void 0, void 0, function () {
488
+ var status, file, linkElement, element, dataUrl, blob;
489
+ return __generator(this, function (_d) {
490
+ switch (_d.label) {
491
+ case 0:
492
+ status = false;
493
+ element = document.getElementById(id);
494
+ if (!element) return [3 /*break*/, 2];
495
+ return [4 /*yield*/, dom_to_image_1.default.toPng(element)];
496
+ case 1:
497
+ dataUrl = _d.sent();
498
+ if (dataUrl) {
499
+ linkElement = document.createElement('a');
500
+ linkElement.download = "print_screen_" + moment_1.default(new Date()).format('DD-MM-YYYY_HH:mm:ss') + ".png";
501
+ linkElement.href = dataUrl;
502
+ blob = dataUrlToBlob(dataUrl);
503
+ if (blob)
504
+ file = new File([blob], linkElement.download, { type: blob.type });
505
+ }
506
+ _d.label = 2;
507
+ case 2:
508
+ (linkElement && file) && (status = true);
509
+ (linkElement && download) && linkElement.click();
510
+ return [2 /*return*/, { event: event, status: status, file: file, element: element, link: linkElement }];
511
+ }
512
+ });
513
+ });
514
+ };
515
+ exports.printScreen = printScreen;
516
+ var geraLog = function (idDocumento, descricao, tpAcao, tokenSistema) { return __awaiter(void 0, void 0, void 0, function () {
517
+ var _a, _b, _c, _d;
518
+ return __generator(this, function (_e) {
519
+ switch (_e.label) {
520
+ case 0:
521
+ if (!((_d = (_c = (_b = (_a = store_1.getStore()) === null || _a === void 0 ? void 0 : _a.getState()) === null || _b === void 0 ? void 0 : _b.argous) === null || _c === void 0 ? void 0 : _c.usuarioLogado) === null || _d === void 0 ? void 0 : _d.idUsuario))
522
+ return [2 /*return*/];
523
+ return [4 /*yield*/, api_1.serverAction('geraLog', { idDocumento: idDocumento, descricao: descricao, tpAcao: tpAcao }, 'CtrlDocumentos', false, tokenSistema)];
524
+ case 1:
525
+ _e.sent();
526
+ return [2 /*return*/];
527
+ }
528
+ });
529
+ }); };
530
+ exports.geraLog = geraLog;
531
+ var printUrl = function (url) { return __awaiter(void 0, void 0, void 0, function () {
532
+ var res, file, iframe;
533
+ return __generator(this, function (_a) {
534
+ switch (_a.label) {
535
+ case 0: return [4 /*yield*/, fetch(url)];
536
+ case 1:
537
+ res = _a.sent();
538
+ return [4 /*yield*/, res.blob()];
539
+ case 2:
540
+ file = _a.sent();
541
+ iframe = document.createElement('iframe');
542
+ document.body.appendChild(iframe);
543
+ iframe.style.display = 'none';
544
+ iframe.src = window.URL.createObjectURL(file);
545
+ iframe.onload = function () {
546
+ setTimeout(function () {
547
+ var _a;
548
+ iframe.focus();
549
+ (_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.print();
550
+ }, 1);
551
+ };
552
+ return [2 /*return*/];
553
+ }
554
+ });
555
+ }); };
556
+ exports.printUrl = printUrl;
557
+ function stopPrntScr(e) {
558
+ if (e.key === 'PrintScreen') {
559
+ e.preventDefault();
560
+ e.stopPropagation();
561
+ try {
562
+ window.clipboardData.setData('text', 'Access Restricted');
563
+ }
564
+ catch (err) { }
565
+ }
566
+ var inpFld = document.createElement('input');
567
+ inpFld.setAttribute('value', '.');
568
+ inpFld.setAttribute('width', '0');
569
+ inpFld.style.height = '0px';
570
+ inpFld.style.width = '0px';
571
+ inpFld.style.border = '0px';
572
+ document.body.appendChild(inpFld);
573
+ inpFld.select();
574
+ document.execCommand('copy');
575
+ inpFld.remove();
576
+ return false;
577
+ }
578
+ exports.stopPrntScr = stopPrntScr;
package/lib/api/index.js CHANGED
@@ -419,7 +419,7 @@ export const getLink = async (idDocumento, nrRevisao, timeout) => {
419
419
  return await (await fetch(`${api()}docs/getURL.agdoc`, {
420
420
  method: 'post',
421
421
  headers: headers(),
422
- body: JSON.stringify({ idDocumento, nrRevisao, timeout })
422
+ body: JSON.stringify({ idDocumento, nrRevisao, timeout })
423
423
  })).json();
424
424
  };
425
425
 
@@ -429,7 +429,7 @@ export const scanDocument = async (idDocumento, nrRevisao) => {
429
429
  const res = await fetch(`${docsUrl}argous/docs/scan.agdoc`, {
430
430
  method: 'post',
431
431
  headers: headers(),
432
- body: JSON.stringify({ idDocumento, nrRevisao })
432
+ body: JSON.stringify({ idDocumento, nrRevisao })
433
433
  });
434
434
  return await res.json();
435
435
  };
@@ -439,7 +439,7 @@ export const getWidgets = async (data, abortController) => {
439
439
  method: 'post',
440
440
  headers: headers(),
441
441
  body: JSON.stringify(data),
442
- signal: abortController?.signal
442
+ signal: abortController?.signal
443
443
  });
444
444
  return await res.json();
445
445
  };
@@ -448,7 +448,7 @@ export const getWidgetInfo = async (pgCode) => {
448
448
  const res = await fetch(`${api()}agetwidgetinfo.rslvr`, {
449
449
  method: 'post',
450
450
  headers: headers(),
451
- body: JSON.stringify({ pgCode })
451
+ body: JSON.stringify({ pgCode })
452
452
  });
453
453
  return await res.json();
454
454
  };
@@ -457,7 +457,7 @@ export const sendWidgets = async (widgets) => {
457
457
  const res = await fetch(`${api()}agsendwidgets.rslvr`, {
458
458
  method: 'post',
459
459
  headers: headers(),
460
- body: JSON.stringify({ widgets })
460
+ body: JSON.stringify({ widgets })
461
461
  });
462
462
  return await res.json();
463
463
  };
@@ -466,7 +466,25 @@ export const getPublicDoc = async (data) => {
466
466
  const res = await fetch(`${api()}agpublicdoc.rslvr`, {
467
467
  method: 'post',
468
468
  headers: headers(),
469
- body: JSON.stringify(data)
469
+ body: JSON.stringify(data)
470
+ });
471
+ return await res.json();
472
+ };
473
+
474
+ export const getProgramAnnotations = async (data, token) => {
475
+ const res = await fetch(`${api()}aggetpgannotation.rslvr`, {
476
+ method: 'post',
477
+ headers: headers(token),
478
+ body: JSON.stringify(data)
479
+ });
480
+ return await res.json();
481
+ };
482
+
483
+ export const saveProgramAnnotation = async (data, token) => {
484
+ const res = await fetch(`${api()}agsavepgannotation.rslvr`, {
485
+ method: 'post',
486
+ headers: headers(token),
487
+ body: JSON.stringify(data)
470
488
  });
471
489
  return await res.json();
472
490
  };
@@ -143,7 +143,15 @@ export interface ArgousComplexTableProps extends ArgousComplexTableBodyProps, Ar
143
143
  *
144
144
  * @returns {void} Sem retorno
145
145
  */
146
- setExternalCtrlPgn?: (value: Object) => void
146
+ setExternalCtrlPgn?: (value: Object) => void,
147
+ /**
148
+ * Program code (pgCode) que será utilizado junto ao método
149
+ */
150
+ code?: string,
151
+ /**
152
+ * Token que será utilizado junto ao método
153
+ */
154
+ token?: string
147
155
  }
148
156
 
149
157
  declare function ArgousComplexTable(props: ArgousComplexTableProps): JSX.Element