dts-backoffice-util 3.0.0 → 6.0.0

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 (71) hide show
  1. package/README.md +1 -1
  2. package/dts-backoffice-util.d.ts +1 -0
  3. package/esm2020/dts-backoffice-util.mjs +5 -0
  4. package/esm2020/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.mjs +269 -0
  5. package/esm2020/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.mjs +7 -0
  6. package/esm2020/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.mjs +183 -0
  7. package/esm2020/lib/dts-backoffice-util.module.mjs +56 -0
  8. package/esm2020/lib/interfaces/filter-range.interface.mjs +2 -0
  9. package/esm2020/lib/interfaces/totvs-response.interface.mjs +2 -0
  10. package/esm2020/lib/model/session-info.model.mjs +67 -0
  11. package/esm2020/lib/pipes/dts-date-format.pipe.mjs +20 -0
  12. package/esm2020/lib/services/breadcrumb-control.service.mjs +82 -0
  13. package/esm2020/lib/services/cache-params.service.mjs +25 -0
  14. package/esm2020/lib/services/menu-datasul.service.mjs +41 -0
  15. package/esm2020/lib/services/profile.service.mjs +55 -0
  16. package/esm2020/lib/services/report.service.mjs +57 -0
  17. package/esm2020/lib/services/session-info.service.mjs +36 -0
  18. package/esm2020/lib/services/translate.service.mjs +23 -0
  19. package/esm2020/lib/utils/date.util.mjs +56 -0
  20. package/esm2020/lib/utils/disclaimer.util.mjs +453 -0
  21. package/esm2020/lib/utils/field-validation.util.mjs +179 -0
  22. package/esm2020/lib/utils/file.util.mjs +122 -0
  23. package/esm2020/lib/utils/filter-range.util.mjs +33 -0
  24. package/esm2020/lib/utils/generic-functions.utils.mjs +170 -0
  25. package/esm2020/public-api.mjs +34 -0
  26. package/fesm2015/{dts-backoffice-util.js → dts-backoffice-util.mjs} +230 -1626
  27. package/fesm2015/dts-backoffice-util.mjs.map +1 -0
  28. package/fesm2020/dts-backoffice-util.mjs +1844 -0
  29. package/fesm2020/dts-backoffice-util.mjs.map +1 -0
  30. package/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.d.ts +3 -0
  31. package/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.d.ts +3 -0
  32. package/lib/dts-backoffice-util.module.d.ts +10 -0
  33. package/lib/pipes/dts-date-format.pipe.d.ts +3 -0
  34. package/lib/services/breadcrumb-control.service.d.ts +3 -0
  35. package/lib/services/cache-params.service.d.ts +3 -0
  36. package/lib/services/menu-datasul.service.d.ts +3 -0
  37. package/lib/services/profile.service.d.ts +3 -0
  38. package/lib/services/report.service.d.ts +3 -0
  39. package/lib/services/session-info.service.d.ts +3 -0
  40. package/lib/services/translate.service.d.ts +3 -0
  41. package/package.json +23 -11
  42. package/CHANGELOG.md +0 -159
  43. package/bundles/dts-backoffice-util.umd.js +0 -3296
  44. package/bundles/dts-backoffice-util.umd.js.map +0 -1
  45. package/bundles/dts-backoffice-util.umd.min.js +0 -2
  46. package/bundles/dts-backoffice-util.umd.min.js.map +0 -1
  47. package/dts-backoffice-util.metadata.json +0 -1
  48. package/esm2015/dts-backoffice-util.js +0 -10
  49. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +0 -391
  50. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +0 -132
  51. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +0 -344
  52. package/esm2015/lib/dts-backoffice-util.module.js +0 -47
  53. package/esm2015/lib/interfaces/filter-range.interface.js +0 -48
  54. package/esm2015/lib/interfaces/totvs-response.interface.js +0 -17
  55. package/esm2015/lib/model/session-info.model.js +0 -183
  56. package/esm2015/lib/pipes/dts-date-format.pipe.js +0 -27
  57. package/esm2015/lib/services/breadcrumb-control.service.js +0 -124
  58. package/esm2015/lib/services/cache-params.service.js +0 -47
  59. package/esm2015/lib/services/menu-datasul.service.js +0 -57
  60. package/esm2015/lib/services/profile.service.js +0 -127
  61. package/esm2015/lib/services/report.service.js +0 -127
  62. package/esm2015/lib/services/session-info.service.js +0 -62
  63. package/esm2015/lib/services/translate.service.js +0 -35
  64. package/esm2015/lib/utils/date.util.js +0 -95
  65. package/esm2015/lib/utils/disclaimer.util.js +0 -738
  66. package/esm2015/lib/utils/field-validation.util.js +0 -275
  67. package/esm2015/lib/utils/file.util.js +0 -224
  68. package/esm2015/lib/utils/filter-range.util.js +0 -53
  69. package/esm2015/lib/utils/generic-functions.utils.js +0 -296
  70. package/esm2015/public-api.js +0 -38
  71. package/fesm2015/dts-backoffice-util.js.map +0 -1
@@ -1,3296 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@po-ui/ng-components'), require('@angular/forms'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('dts-backoffice-util', ['exports', '@angular/core', '@angular/common/http', 'rxjs', 'rxjs/operators', '@po-ui/ng-components', '@angular/forms', '@angular/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['dts-backoffice-util'] = {}, global.ng.core, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ngComponents, global.ng.forms, global.ng.common));
5
- }(this, (function (exports, i0, i1, rxjs, operators, ngComponents, forms, common) { 'use strict';
6
-
7
- /**
8
- * @fileoverview added by tsickle
9
- * Generated from: lib/services/session-info.service.ts
10
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
11
- */
12
- var UserLoginService = /** @class */ (function () {
13
- /**
14
- * @param {?} http
15
- */
16
- function UserLoginService(http) {
17
- this.http = http;
18
- this.apiUrl = '/totvs-menu/rest/getSessionInfo';
19
- this.userLogin = undefined;
20
- }
21
- /**
22
- * @return {?}
23
- */
24
- UserLoginService.prototype.getUserLogin = function () {
25
- var _this = this;
26
- if (localStorage.getItem('username')) {
27
- return rxjs.of(localStorage.getItem('username'));
28
- }
29
- if (this.userLogin) {
30
- return rxjs.of(this.userLogin);
31
- }
32
- else {
33
- return this.http.get("" + this.apiUrl)
34
- .pipe(operators.map(( /**
35
- * @param {?} response
36
- * @return {?}
37
- */function (response) {
38
- _this.userLogin = response.userName;
39
- return response.userName;
40
- })));
41
- }
42
- };
43
- return UserLoginService;
44
- }());
45
- UserLoginService.decorators = [
46
- { type: i0.Injectable, args: [{
47
- providedIn: 'root'
48
- },] }
49
- ];
50
- /** @nocollapse */
51
- UserLoginService.ctorParameters = function () { return [
52
- { type: i1.HttpClient }
53
- ]; };
54
- /** @nocollapse */ UserLoginService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UserLoginService_Factory() { return new UserLoginService(i0.ɵɵinject(i1.HttpClient)); }, token: UserLoginService, providedIn: "root" });
55
- if (false) {
56
- /** @type {?} */
57
- UserLoginService.prototype.apiUrl;
58
- /** @type {?} */
59
- UserLoginService.prototype.userLogin;
60
- /** @type {?} */
61
- UserLoginService.prototype.http;
62
- }
63
-
64
- /**
65
- * @fileoverview added by tsickle
66
- * Generated from: lib/services/profile.service.ts
67
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
68
- */
69
- /**
70
- * @record
71
- */
72
- function IProfile() { }
73
- if (false) {
74
- /** @type {?} */
75
- IProfile.prototype.pageId;
76
- /** @type {?} */
77
- IProfile.prototype.dataCode;
78
- /** @type {?} */
79
- IProfile.prototype.userCode;
80
- /** @type {?|undefined} */
81
- IProfile.prototype.dataValue;
82
- }
83
- /**
84
- * @record
85
- */
86
- function IProfileResponse() { }
87
- if (false) {
88
- /** @type {?} */
89
- IProfileResponse.prototype.message;
90
- /** @type {?} */
91
- IProfileResponse.prototype.length;
92
- /** @type {?} */
93
- IProfileResponse.prototype.data;
94
- }
95
- /** @enum {number} */
96
- var EDataType = {
97
- STRING: 1,
98
- JSON: 2,
99
- };
100
- EDataType[EDataType.STRING] = 'STRING';
101
- EDataType[EDataType.JSON] = 'JSON';
102
- var ProfileService = /** @class */ (function () {
103
- /**
104
- * @param {?} http
105
- */
106
- function ProfileService(http) {
107
- this.http = http;
108
- this.apiURL = '/dts/datasul-rest/resources/api/btb/btapi930za';
109
- }
110
- /**
111
- * @param {?} profile
112
- * @return {?}
113
- */
114
- ProfileService.prototype.setProfile = function (profile) {
115
- /** @type {?} */
116
- var headers = { 'X-PO-Screen-Lock': 'true' };
117
- var pageId = profile.pageId, userCode = profile.userCode;
118
- return this.http
119
- .post(this.apiURL + "/setProfile?userCode=" + userCode + "&pageId=" + pageId, profile, { headers: headers });
120
- };
121
- /**
122
- * @param {?} profile
123
- * @param {?=} showLoading
124
- * @return {?}
125
- */
126
- ProfileService.prototype.getProfileAsString = function (profile, showLoading) {
127
- return this.getProfile(profile, EDataType.STRING, showLoading ? 'true' : 'false');
128
- };
129
- /**
130
- * @param {?} profile
131
- * @param {?=} showLoading
132
- * @return {?}
133
- */
134
- ProfileService.prototype.getProfileAsJSON = function (profile, showLoading) {
135
- return this.getProfile(profile, EDataType.JSON, showLoading ? 'true' : 'false');
136
- };
137
- /**
138
- * @private
139
- * @param {?} profile
140
- * @param {?} dataType
141
- * @param {?=} showLoading
142
- * @return {?}
143
- */
144
- ProfileService.prototype.getProfile = function (profile, dataType, showLoading) {
145
- /** @type {?} */
146
- var headers = { 'X-PO-Screen-Lock': showLoading };
147
- var pageId = profile.pageId, dataCode = profile.dataCode, userCode = profile.userCode;
148
- return this.http
149
- .get(this.apiURL + "/getProfile?userCode=" + userCode + "&pageId=" + pageId + "&dataCode=" + dataCode, { headers: headers })
150
- .pipe(operators.map(( /**
151
- * @param {?} preference
152
- * @return {?}
153
- */function (/**
154
- * @param {?} preference
155
- * @return {?}
156
- */ preference) {
157
- if (preference.data[0]) {
158
- if (dataType === EDataType.STRING) {
159
- return preference.data[0].dataValue;
160
- }
161
- if (dataType === EDataType.JSON) {
162
- return JSON.parse(preference.data[0].dataValue);
163
- }
164
- }
165
- else {
166
- return undefined;
167
- }
168
- })));
169
- };
170
- return ProfileService;
171
- }());
172
- ProfileService.decorators = [
173
- { type: i0.Injectable, args: [{
174
- providedIn: 'root'
175
- },] }
176
- ];
177
- /** @nocollapse */
178
- ProfileService.ctorParameters = function () { return [
179
- { type: i1.HttpClient }
180
- ]; };
181
- /** @nocollapse */ ProfileService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProfileService_Factory() { return new ProfileService(i0.ɵɵinject(i1.HttpClient)); }, token: ProfileService, providedIn: "root" });
182
- if (false) {
183
- /** @type {?} */
184
- ProfileService.prototype.apiURL;
185
- /** @type {?} */
186
- ProfileService.prototype.http;
187
- }
188
-
189
- /**
190
- * @fileoverview added by tsickle
191
- * Generated from: lib/services/report.service.ts
192
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
193
- */
194
- /**
195
- * @record
196
- */
197
- function IProperty() { }
198
- if (false) {
199
- /** @type {?} */
200
- IProperty.prototype.name;
201
- /** @type {?} */
202
- IProperty.prototype.value;
203
- }
204
- /**
205
- * @record
206
- */
207
- function IReportServiceParams() { }
208
- if (false) {
209
- /** @type {?} */
210
- IReportServiceParams.prototype.reportName;
211
- /** @type {?} */
212
- IReportServiceParams.prototype.programName;
213
- /** @type {?} */
214
- IReportServiceParams.prototype.properties;
215
- /** @type {?} */
216
- IReportServiceParams.prototype.dialect;
217
- /** @type {?} */
218
- IReportServiceParams.prototype.downloadName;
219
- /** @type {?} */
220
- IReportServiceParams.prototype.download;
221
- /** @type {?} */
222
- IReportServiceParams.prototype.format;
223
- }
224
- /** @enum {string} */
225
- var ReportFormats = {
226
- XLSX: "xlsx",
227
- PDF: "pdf",
228
- DOCX: "docx",
229
- HTML: "html",
230
- };
231
- var ReportService = /** @class */ (function () {
232
- /**
233
- * @param {?} httpClient
234
- */
235
- function ReportService(httpClient) {
236
- this.httpClient = httpClient;
237
- this.URL = window.location.href.indexOf('totvs-menu') > 0 ? '/totvs-menu/rest/report/run/'
238
- : '/dts/datasul-report/resources/run/';
239
- }
240
- /**
241
- * @param {?} params
242
- * @param {?=} showLoading
243
- * @return {?}
244
- */
245
- ReportService.prototype.generate = function (params, showLoading) {
246
- var _this = this;
247
- if (showLoading === void 0) { showLoading = true; }
248
- /** @type {?} */
249
- var headers = { 'X-PO-Screen-Lock': showLoading ? 'true' : 'false' };
250
- /** @type {?} */
251
- var reportURL = "" + this.URL + params.reportName;
252
- if (params.properties.length > 0) {
253
- reportURL += '?';
254
- params.properties.forEach(( /**
255
- * @param {?} property
256
- * @param {?} index
257
- * @return {?}
258
- */function (property, index) {
259
- if (index > 0) {
260
- reportURL += '&';
261
- }
262
- reportURL += "c_properties=" + property.name + "&c_values=" + property.value;
263
- }));
264
- }
265
- reportURL += "&dialect=" + params.dialect + "&format=" + params.format;
266
- reportURL += "&program=" + params.programName + "&resultFileName=" + params.downloadName;
267
- return this.httpClient.post(reportURL, {}, { headers: headers, responseType: 'blob' })
268
- .pipe(operators.map(( /**
269
- * @param {?} report
270
- * @return {?}
271
- */function (/**
272
- * @param {?} report
273
- * @return {?}
274
- */ report) {
275
- if (params.download) {
276
- _this.download(report, params.downloadName + "." + params.format);
277
- }
278
- return report;
279
- })));
280
- };
281
- /**
282
- * @param {?} file
283
- * @param {?} fileName
284
- * @return {?}
285
- */
286
- ReportService.prototype.download = function (file, fileName) {
287
- /** @type {?} */
288
- var binaryData = [file];
289
- /** @type {?} */
290
- var downloadLink = document.createElement('a');
291
- /** @type {?} */
292
- var urlDownload = window.URL.createObjectURL(new Blob(binaryData, { type: file.type }));
293
- downloadLink.href = urlDownload;
294
- downloadLink.setAttribute('download', fileName);
295
- document.body.appendChild(downloadLink);
296
- downloadLink.click();
297
- window.URL.revokeObjectURL(urlDownload);
298
- downloadLink.remove();
299
- };
300
- return ReportService;
301
- }());
302
- ReportService.decorators = [
303
- { type: i0.Injectable }
304
- ];
305
- /** @nocollapse */
306
- ReportService.ctorParameters = function () { return [
307
- { type: i1.HttpClient }
308
- ]; };
309
- if (false) {
310
- /** @type {?} */
311
- ReportService.prototype.URL;
312
- /** @type {?} */
313
- ReportService.prototype.httpClient;
314
- }
315
-
316
- /**
317
- * @fileoverview added by tsickle
318
- * Generated from: lib/services/breadcrumb-control.service.ts
319
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
320
- */
321
- var BreadcrumbControlService = /** @class */ (function () {
322
- function BreadcrumbControlService() {
323
- }
324
- /**
325
- * @return {?}
326
- */
327
- BreadcrumbControlService.prototype.newBreadcrumb = function () {
328
- this.breadcrumb = { items: [] };
329
- };
330
- /**
331
- * @param {?} literal
332
- * @param {?} activatedRoute
333
- * @return {?}
334
- */
335
- BreadcrumbControlService.prototype.addBreadcrumb = function (literal, activatedRoute) {
336
- this.addBreadcrumbURL(literal, decodeURIComponent(activatedRoute.snapshot['_routerState'].url));
337
- };
338
- /**
339
- * @param {?} literal
340
- * @param {?} url
341
- * @return {?}
342
- */
343
- BreadcrumbControlService.prototype.addBreadcrumbURL = function (literal, url) {
344
- if (!literal || literal === '') {
345
- return;
346
- }
347
- if (!this.breadcrumb) {
348
- this.newBreadcrumb();
349
- }
350
- /** @type {?} */
351
- var breadcrumbAux = { items: [] };
352
- /** @type {?} */
353
- var idx = 0;
354
- for (idx = 0; idx < this.breadcrumb.items.length; idx++) {
355
- if (this.breadcrumb.items[idx].label !== literal) {
356
- breadcrumbAux.items.push(this.breadcrumb.items[idx]);
357
- }
358
- else {
359
- break;
360
- }
361
- }
362
- breadcrumbAux.items.push({ label: literal, link: url });
363
- this.breadcrumb = breadcrumbAux;
364
- };
365
- /**
366
- * @param {?} literal
367
- * @param {?} valueOld
368
- * @param {?} valueNew
369
- * @return {?}
370
- */
371
- BreadcrumbControlService.prototype.updBreadcrumbURL = function (literal, valueOld, valueNew) {
372
- /** @type {?} */
373
- var currentRouterURL = this.getCurrentRouter();
374
- if (!currentRouterURL) {
375
- return;
376
- }
377
- if (!valueOld) {
378
- return;
379
- }
380
- if (!valueNew) {
381
- return;
382
- }
383
- currentRouterURL = currentRouterURL.replace(valueOld, valueNew);
384
- this.addBreadcrumbURL(literal, currentRouterURL);
385
- };
386
- /**
387
- * @return {?}
388
- */
389
- BreadcrumbControlService.prototype.getBreadcrumb = function () {
390
- if (!this.breadcrumb) {
391
- this.newBreadcrumb();
392
- }
393
- return this.breadcrumb;
394
- };
395
- /**
396
- * @return {?}
397
- */
398
- BreadcrumbControlService.prototype.getCurrentRouter = function () {
399
- if (!this.breadcrumb) {
400
- this.newBreadcrumb();
401
- }
402
- if (this.breadcrumb.items.length <= 0) {
403
- return '';
404
- }
405
- return this.breadcrumb.items[this.breadcrumb.items.length - 1].link;
406
- };
407
- /**
408
- * @return {?}
409
- */
410
- BreadcrumbControlService.prototype.getPrevRouter = function () {
411
- if (!this.breadcrumb) {
412
- this.newBreadcrumb();
413
- }
414
- if (this.breadcrumb.items.length <= 1) {
415
- return '';
416
- }
417
- return this.breadcrumb.items[this.breadcrumb.items.length - 2].link;
418
- };
419
- /**
420
- * @return {?}
421
- */
422
- BreadcrumbControlService.prototype.hasPreviousRouter = function () {
423
- return this.breadcrumb.items.length > 1;
424
- };
425
- return BreadcrumbControlService;
426
- }());
427
- BreadcrumbControlService.decorators = [
428
- { type: i0.Injectable }
429
- ];
430
- /** @nocollapse */
431
- BreadcrumbControlService.ctorParameters = function () { return []; };
432
- if (false) {
433
- /** @type {?} */
434
- BreadcrumbControlService.prototype.breadcrumb;
435
- }
436
-
437
- /**
438
- * @fileoverview added by tsickle
439
- * Generated from: lib/services/menu-datasul.service.ts
440
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
441
- */
442
- var MenuDatasulService = /** @class */ (function () {
443
- function MenuDatasulService() {
444
- }
445
- /**
446
- * var program = {};
447
- * program['prg'] = "cd0210";
448
- * program['params'] = '01|123456'
449
- * @param {?} program
450
- * @return {?}
451
- */
452
- MenuDatasulService.prototype.callProgress = function (program) {
453
- parent.postMessage({ program: program }, '*');
454
- };
455
- /**
456
- * var notification = {};
457
- * notification['type'] = 'success';
458
- * notification['title'] = 'Notification Title'
459
- * notification['detail'] = 'Notification Detail'
460
- * @param {?} notification
461
- * @return {?}
462
- */
463
- MenuDatasulService.prototype.sendNotification = function (notification) {
464
- parent.postMessage({ notification: notification }, '*');
465
- };
466
- /**
467
- * @param {?} programName
468
- * @param {?} params
469
- * @param {?=} parent
470
- * @return {?}
471
- */
472
- MenuDatasulService.prototype.openPath = function (programName, params, parent) {
473
- if (parent === void 0) { parent = true; }
474
- /** @type {?} */
475
- var datasulPath = document.referrer.indexOf('totvs-menu') > 0 ? 'totvs-menu' : 'menu-html';
476
- /** @type {?} */
477
- var baseUrl = "/" + datasulPath + "/#/" + datasulPath + "/program-html/" + programName + "/#";
478
- if (params) {
479
- baseUrl = baseUrl + "/" + params;
480
- }
481
- if (parent) {
482
- window.open(baseUrl, '_parent');
483
- }
484
- else {
485
- window.open(baseUrl);
486
- }
487
- };
488
- return MenuDatasulService;
489
- }());
490
- MenuDatasulService.decorators = [
491
- { type: i0.Injectable }
492
- ];
493
- /** @nocollapse */
494
- MenuDatasulService.ctorParameters = function () { return []; };
495
-
496
- /**
497
- * @fileoverview added by tsickle
498
- * Generated from: lib/services/cache-params.service.ts
499
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
500
- */
501
- var CacheParamsService = /** @class */ (function () {
502
- function CacheParamsService() {
503
- this.values = {};
504
- }
505
- /**
506
- * @param {?} key
507
- * @param {?} value
508
- * @return {?}
509
- */
510
- CacheParamsService.prototype.setValue = function (key, value) {
511
- this.values[key] = value;
512
- };
513
- /**
514
- * @param {?} key
515
- * @return {?}
516
- */
517
- CacheParamsService.prototype.getValue = function (key) {
518
- return this.values[key];
519
- };
520
- /**
521
- * @param {?} key
522
- * @return {?}
523
- */
524
- CacheParamsService.prototype.removeValue = function (key) {
525
- delete this.values[key];
526
- };
527
- return CacheParamsService;
528
- }());
529
- CacheParamsService.decorators = [
530
- { type: i0.Injectable, args: [{
531
- providedIn: 'root'
532
- },] }
533
- ];
534
- /** @nocollapse */
535
- CacheParamsService.ctorParameters = function () { return []; };
536
- /** @nocollapse */ CacheParamsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CacheParamsService_Factory() { return new CacheParamsService(); }, token: CacheParamsService, providedIn: "root" });
537
- if (false) {
538
- /** @type {?} */
539
- CacheParamsService.prototype.values;
540
- }
541
-
542
- /**
543
- * @fileoverview added by tsickle
544
- * Generated from: lib/services/translate.service.ts
545
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
546
- */
547
- var TranslateService = /** @class */ (function () {
548
- function TranslateService() {
549
- }
550
- /**
551
- * @return {?}
552
- */
553
- TranslateService.getSuportLanguage = function () {
554
- return ['pt-BR', 'pt', 'en-US', 'en', 'es'];
555
- };
556
- /**
557
- * @return {?}
558
- */
559
- TranslateService.getDefaultCurrencyCode = function () {
560
- return '$';
561
- };
562
- /**
563
- * @return {?}
564
- */
565
- TranslateService.getCurrentLanguage = function () {
566
- /** @type {?} */
567
- var locale = localStorage.getItem('user.language') || navigator.language;
568
- if (locale && this.getSuportLanguage().includes(locale)) {
569
- return locale;
570
- }
571
- return 'en-US';
572
- };
573
- return TranslateService;
574
- }());
575
- TranslateService.decorators = [
576
- { type: i0.Injectable }
577
- ];
578
-
579
- /**
580
- * @fileoverview added by tsickle
581
- * Generated from: lib/utils/date.util.ts
582
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
583
- */
584
- /*
585
- Versão: 1.000
586
- Data Criação: 18/04/2019
587
- */
588
- var DateUtil = /** @class */ (function () {
589
- function DateUtil() {
590
- }
591
- /* Transforma data para o padrão YYYY-MM-DD */
592
- /**
593
- * @param {?} date
594
- * @return {?}
595
- */
596
- DateUtil.dateToQueryParam = function (date) {
597
- /** @type {?} */
598
- var iDay = date.getDate();
599
- /** @type {?} */
600
- var iMonth = date.getMonth() + 1;
601
- /** @type {?} */
602
- var iYear = date.getFullYear();
603
- return iYear + "-" + this.pad(iMonth) + "-" + this.pad(iDay);
604
- };
605
- /* Transforma data no padrão YYYY-MM-DD para DATE */
606
- /**
607
- * @param {?} param
608
- * @return {?}
609
- */
610
- DateUtil.queryParamToDate = function (param) {
611
- /** @type {?} */
612
- var iDay = +param.split('-')[2];
613
- /** @type {?} */
614
- var iMonth = +param.split('-')[1];
615
- /** @type {?} */
616
- var iYear = +param.split('-')[0];
617
- return new Date(iYear, iMonth - 1, iDay);
618
- };
619
- /* Valida se foi informado uma data válida */
620
- /**
621
- * @param {?} date
622
- * @return {?}
623
- */
624
- DateUtil.isValidDate = function (date) {
625
- return date instanceof Date && !isNaN(date.getTime());
626
- };
627
- /* Ajusta a data retornando o padrão DATE */
628
- /**
629
- * @param {?} param
630
- * @return {?}
631
- */
632
- DateUtil.ajustDate = function (param) {
633
- if (param instanceof Date) {
634
- return param;
635
- }
636
- if (!param) {
637
- return param;
638
- }
639
- return this.queryParamToDate(param.split('T')[0]);
640
- };
641
- /* Ajusta a data para o padrão DATE - utilizada nos construtores dos modelos */
642
- /**
643
- * @param {?=} values
644
- * @param {?=} fieldName
645
- * @return {?}
646
- */
647
- DateUtil.ajustDateToModel = function (values, fieldName) {
648
- if (values === void 0) { values = {}; }
649
- if (values.hasOwnProperty(fieldName) && (values[fieldName])) {
650
- if (values[fieldName].indexOf('T') >= 0) {
651
- return new Date(values[fieldName]);
652
- }
653
- /** @type {?} */
654
- var iDay = +values[fieldName].split('-')[2];
655
- /** @type {?} */
656
- var iMonth = +values[fieldName].split('-')[1];
657
- /** @type {?} */
658
- var iYear = +values[fieldName].split('-')[0];
659
- return new Date(iYear, iMonth - 1, iDay);
660
- }
661
- return null;
662
- };
663
- /* Adicona zero a esquerda do número */
664
- /**
665
- * @param {?} number
666
- * @return {?}
667
- */
668
- DateUtil.pad = function (number) {
669
- if (number < 10) {
670
- return '0' + number;
671
- }
672
- return number;
673
- };
674
- return DateUtil;
675
- }());
676
-
677
- /**
678
- * @fileoverview added by tsickle
679
- * Generated from: lib/utils/disclaimer.util.ts
680
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
681
- */
682
- /*
683
- Versão: 1.009
684
- Data Criação: 06/08/2018
685
- */
686
- var DisclaimerUtil = /** @class */ (function () {
687
- /**
688
- * @param {?} poNotification
689
- * @param {?} poI18nPipe
690
- * @param {?} literals
691
- */
692
- function DisclaimerUtil(poNotification, poI18nPipe, literals) {
693
- this.literals = {};
694
- this.poNotification = poNotification;
695
- this.poI18nPipe = poI18nPipe;
696
- this.literals = literals;
697
- }
698
- /**
699
- * @param {?} property
700
- * @param {?} value
701
- * @param {?=} hideClose
702
- * @param {?=} tradValue
703
- * @param {?=} vldBlank
704
- * @return {?}
705
- */
706
- DisclaimerUtil.prototype.makeDisclaimer = function (property, value, hideClose, tradValue, vldBlank) {
707
- if (hideClose === void 0) { hideClose = false; }
708
- if (tradValue === void 0) { tradValue = false; }
709
- if (vldBlank === void 0) { vldBlank = false; }
710
- if (value === null || value === undefined) {
711
- return { label: '', property: '', value: '' };
712
- }
713
- if (vldBlank && value === '') {
714
- return { label: '', property: '', value: '' };
715
- }
716
- return {
717
- hideClose: hideClose,
718
- label: this.literals[property] + ": " + (tradValue ? this.literals[value] : value),
719
- property: "" + property,
720
- value: "" + value
721
- };
722
- };
723
- /**
724
- * @param {?} property
725
- * @param {?} value
726
- * @param {?=} hideClose
727
- * @param {?=} vldBlank
728
- * @return {?}
729
- */
730
- DisclaimerUtil.prototype.makeDisclaimerFromNumber = function (property, value, hideClose, vldBlank) {
731
- if (hideClose === void 0) { hideClose = false; }
732
- if (vldBlank === void 0) { vldBlank = false; }
733
- if (value === null || value === undefined) {
734
- return { label: '', property: '', value: '' };
735
- }
736
- if (vldBlank && value === 0) {
737
- return { label: '', property: '', value: '' };
738
- }
739
- return {
740
- hideClose: hideClose,
741
- label: this.literals[property] + ": " + value,
742
- property: "" + property,
743
- value: "" + value
744
- };
745
- };
746
- /**
747
- * @param {?} property
748
- * @param {?} value
749
- * @param {?=} hideClose
750
- * @return {?}
751
- */
752
- DisclaimerUtil.prototype.makeDisclaimerFromBoolean = function (property, value, hideClose) {
753
- if (hideClose === void 0) { hideClose = false; }
754
- if (value === null || value === undefined) {
755
- return { label: '', property: '', value: '' };
756
- }
757
- return {
758
- hideClose: hideClose,
759
- label: this.literals[property] + ": " + (value ? this.literals['yes'] : this.literals['no']),
760
- property: "" + property,
761
- value: "" + value
762
- };
763
- };
764
- /**
765
- * @param {?} property
766
- * @param {?} value
767
- * @param {?=} hideClose
768
- * @return {?}
769
- */
770
- DisclaimerUtil.prototype.makeDisclaimerFromDate = function (property, value, hideClose) {
771
- if (hideClose === void 0) { hideClose = false; }
772
- /** @type {?} */
773
- var dDate = this.ajustDate(value);
774
- if (!this.isValidDate(dDate)) {
775
- return { label: '', property: '', value: '' };
776
- }
777
- return {
778
- hideClose: hideClose,
779
- label: this.literals[property] + ": " + dDate.toLocaleDateString(),
780
- property: "" + property,
781
- value: "" + this.dateToQueryParam(dDate)
782
- };
783
- };
784
- /**
785
- * @param {?} property
786
- * @param {?} value
787
- * @param {?=} length
788
- * @param {?=} hideClose
789
- * @param {?=} tradValue
790
- * @return {?}
791
- */
792
- DisclaimerUtil.prototype.makeDisclaimerFromMultiSelect = function (property, value, length, hideClose, tradValue) {
793
- var _this = this;
794
- if (length === void 0) { length = 0; }
795
- if (hideClose === void 0) { hideClose = false; }
796
- if (tradValue === void 0) { tradValue = false; }
797
- /** @type {?} */
798
- var lstLabels = '';
799
- /** @type {?} */
800
- var lstValues = '';
801
- if (!value) {
802
- return { label: '', property: '', value: '' };
803
- }
804
- if (value.length === 0 || (length > 0 && value.length === length)) {
805
- lstLabels = this.literals['all'];
806
- lstValues = 'all';
807
- }
808
- else {
809
- value.map(( /**
810
- * @param {?} item
811
- * @return {?}
812
- */function (/**
813
- * @param {?} item
814
- * @return {?}
815
- */ item) {
816
- if (lstLabels !== '') {
817
- lstLabels = lstLabels + ", ";
818
- }
819
- if (lstValues !== '') {
820
- lstValues = lstValues + ",";
821
- }
822
- lstLabels = "" + lstLabels + (tradValue ? _this.literals[item] : item);
823
- lstValues = "" + lstValues + item;
824
- }));
825
- }
826
- return {
827
- hideClose: hideClose,
828
- label: this.literals[property] + ": " + lstLabels,
829
- property: "" + property,
830
- value: "" + lstValues
831
- };
832
- };
833
- /**
834
- * @param {?} property
835
- * @param {?} value
836
- * @param {?} options
837
- * @param {?=} length
838
- * @param {?=} hideClose
839
- * @return {?}
840
- */
841
- DisclaimerUtil.prototype.makeDisclaimerFromMultiSelectNumber = function (property, value, options, length, hideClose) {
842
- if (length === void 0) { length = 0; }
843
- if (hideClose === void 0) { hideClose = false; }
844
- /** @type {?} */
845
- var lstLabels = '';
846
- /** @type {?} */
847
- var lstValues = '';
848
- /** @type {?} */
849
- var opt = null;
850
- if (!value || !options) {
851
- return { label: '', property: '', value: '' };
852
- }
853
- if (value.length === 0 || (length > 0 && value.length === length)) {
854
- lstLabels = this.literals['all'];
855
- lstValues = 'all';
856
- }
857
- else {
858
- value.map(( /**
859
- * @param {?} item
860
- * @return {?}
861
- */function (/**
862
- * @param {?} item
863
- * @return {?}
864
- */ item) {
865
- if (lstLabels !== '') {
866
- lstLabels = lstLabels + ", ";
867
- }
868
- if (lstValues !== '') {
869
- lstValues = lstValues + ",";
870
- }
871
- opt = options.find(( /**
872
- * @param {?} itOpt
873
- * @return {?}
874
- */function (/**
875
- * @param {?} itOpt
876
- * @return {?}
877
- */ itOpt) { return itOpt.value === item; }));
878
- lstLabels = "" + lstLabels + (opt ? opt.label : item);
879
- lstValues = "" + lstValues + item;
880
- }));
881
- }
882
- return {
883
- hideClose: hideClose,
884
- label: this.literals[property] + ": " + lstLabels,
885
- property: "" + property,
886
- value: "" + lstValues
887
- };
888
- };
889
- /**
890
- * @param {?} property
891
- * @param {?} value
892
- * @param {?=} length
893
- * @param {?=} hideClose
894
- * @return {?}
895
- */
896
- DisclaimerUtil.prototype.makeDisclaimerFromCheckboxGroup = function (property, value, length, hideClose) {
897
- var _this = this;
898
- if (length === void 0) { length = 0; }
899
- if (hideClose === void 0) { hideClose = false; }
900
- /** @type {?} */
901
- var lstLabels = '';
902
- /** @type {?} */
903
- var lstValues = '';
904
- if (!value) {
905
- return { label: '', property: '', value: '' };
906
- }
907
- if (value.length === 0) {
908
- lstLabels = this.literals['none'];
909
- lstValues = 'none';
910
- }
911
- else if (length > 0 && value.length === length) {
912
- lstLabels = this.literals['all'];
913
- lstValues = 'all';
914
- }
915
- else {
916
- value.map(( /**
917
- * @param {?} checkParam
918
- * @return {?}
919
- */function (/**
920
- * @param {?} checkParam
921
- * @return {?}
922
- */ checkParam) {
923
- if (lstLabels !== '') {
924
- lstLabels = lstLabels + ", ";
925
- }
926
- if (lstValues !== '') {
927
- lstValues = lstValues + ",";
928
- }
929
- lstLabels = "" + lstLabels + _this.literals[checkParam];
930
- lstValues = "" + lstValues + checkParam;
931
- }));
932
- }
933
- return {
934
- hideClose: hideClose,
935
- label: this.literals[property] + ": " + lstLabels,
936
- property: "" + property,
937
- value: "" + lstValues
938
- };
939
- };
940
- /**
941
- * @param {?} property
942
- * @param {?} value
943
- * @param {?=} hideClose
944
- * @param {?=} validateEqual
945
- * @return {?}
946
- */
947
- DisclaimerUtil.prototype.makeDisclaimerFromRangeCharacter = function (property, value, hideClose, validateEqual) {
948
- if (hideClose === void 0) { hideClose = false; }
949
- if (validateEqual === void 0) { validateEqual = true; }
950
- if (value.valInitial === null || value.valInitial === undefined) {
951
- value.valInitial = value.iniInitial;
952
- }
953
- if (value.valFinal === null || value.valFinal === undefined) {
954
- value.valFinal = value.iniFinal;
955
- }
956
- if (validateEqual &&
957
- value.iniInitial === value.valInitial &&
958
- value.iniFinal === value.valFinal) {
959
- return { label: '', property: '', value: '' };
960
- }
961
- return {
962
- hideClose: hideClose,
963
- label: this.poI18nPipe.transform(this.literals['filterRange'], [this.literals[property], "'" + value.valInitial + "'", "'" + value.valFinal + "'"]),
964
- property: "" + property,
965
- value: value.valInitial + ";" + value.valFinal
966
- };
967
- };
968
- /**
969
- * @param {?} property
970
- * @param {?} value
971
- * @param {?=} hideClose
972
- * @param {?=} validateEqual
973
- * @return {?}
974
- */
975
- DisclaimerUtil.prototype.makeDisclaimerFromRangeNumber = function (property, value, hideClose, validateEqual) {
976
- if (hideClose === void 0) { hideClose = false; }
977
- if (validateEqual === void 0) { validateEqual = true; }
978
- if (value.valInitial === null || value.valInitial === undefined) {
979
- value.valInitial = value.iniInitial;
980
- }
981
- if (value.valFinal === null || value.valFinal === undefined) {
982
- value.valFinal = value.iniFinal;
983
- }
984
- if (validateEqual &&
985
- value.iniInitial === value.valInitial &&
986
- value.iniFinal === value.valFinal) {
987
- return { label: '', property: '', value: '' };
988
- }
989
- return {
990
- hideClose: hideClose,
991
- label: this.poI18nPipe.transform(this.literals['filterRange'], [this.literals[property], value.valInitial, value.valFinal]),
992
- property: "" + property,
993
- value: value.valInitial + ";" + value.valFinal
994
- };
995
- };
996
- /**
997
- * @param {?} property
998
- * @param {?} value
999
- * @param {?=} hideClose
1000
- * @param {?=} validateEqual
1001
- * @return {?}
1002
- */
1003
- DisclaimerUtil.prototype.makeDisclaimerFromRangeDate = function (property, value, hideClose, validateEqual) {
1004
- if (hideClose === void 0) { hideClose = false; }
1005
- if (validateEqual === void 0) { validateEqual = true; }
1006
- /** @type {?} */
1007
- var valInitDate = this.ajustDate(value.valInitial);
1008
- /** @type {?} */
1009
- var valFinalDate = this.ajustDate(value.valFinal);
1010
- if (!this.isValidDate(valInitDate)) {
1011
- valInitDate = value.iniInitial;
1012
- value.valInitial = value.iniInitial;
1013
- }
1014
- if (!this.isValidDate(valFinalDate)) {
1015
- valFinalDate = value.iniFinal;
1016
- value.valFinal = value.iniFinal;
1017
- }
1018
- if (validateEqual &&
1019
- this.dateToQueryParam(value.iniInitial) === this.dateToQueryParam(valInitDate) &&
1020
- this.dateToQueryParam(value.iniFinal) === this.dateToQueryParam(valFinalDate)) {
1021
- return { label: '', property: '', value: '' };
1022
- }
1023
- return {
1024
- hideClose: hideClose,
1025
- label: this.poI18nPipe.transform(this.literals['filterRange'], [this.literals[property], valInitDate.toLocaleDateString(), valFinalDate.toLocaleDateString()]),
1026
- property: "" + property,
1027
- value: this.dateToQueryParam(valInitDate) + ";" + this.dateToQueryParam(valFinalDate)
1028
- };
1029
- };
1030
- /**
1031
- * @param {?} disclaimers
1032
- * @param {?} property
1033
- * @param {?} defaultValue
1034
- * @return {?}
1035
- */
1036
- DisclaimerUtil.prototype.atzCharFromDisclamer = function (disclaimers, property, defaultValue) {
1037
- /** @type {?} */
1038
- var returnValue = defaultValue;
1039
- if (disclaimers && disclaimers.length > 0) {
1040
- disclaimers.find(( /**
1041
- * @param {?} item
1042
- * @return {?}
1043
- */function (item) {
1044
- if (item.property === property) {
1045
- if (item.value === null) {
1046
- return false;
1047
- }
1048
- returnValue = item.value;
1049
- return true;
1050
- }
1051
- return false;
1052
- }));
1053
- }
1054
- return returnValue;
1055
- };
1056
- /**
1057
- * @param {?} disclaimers
1058
- * @param {?} property
1059
- * @param {?} defaultValue
1060
- * @return {?}
1061
- */
1062
- DisclaimerUtil.prototype.atzNumberFromDisclamer = function (disclaimers, property, defaultValue) {
1063
- /** @type {?} */
1064
- var returnValue = defaultValue;
1065
- if (disclaimers && disclaimers.length > 0) {
1066
- disclaimers.find(( /**
1067
- * @param {?} item
1068
- * @return {?}
1069
- */function (item) {
1070
- if (item.property === property) {
1071
- if (item.value === null) {
1072
- return false;
1073
- }
1074
- returnValue = item.value;
1075
- return true;
1076
- }
1077
- return false;
1078
- }));
1079
- }
1080
- return returnValue;
1081
- };
1082
- /**
1083
- * @param {?} disclaimers
1084
- * @param {?} property
1085
- * @param {?} defaultValue
1086
- * @return {?}
1087
- */
1088
- DisclaimerUtil.prototype.atzBooleanFromDisclamer = function (disclaimers, property, defaultValue) {
1089
- /** @type {?} */
1090
- var returnValue = defaultValue;
1091
- if (disclaimers && disclaimers.length > 0) {
1092
- /** @type {?} */
1093
- var disclaimerFind = disclaimers.find(( /**
1094
- * @param {?} item
1095
- * @return {?}
1096
- */function (item) { return item.property === property; }));
1097
- if (disclaimerFind && disclaimerFind.value !== null && disclaimerFind.value !== undefined) {
1098
- if (disclaimerFind.value === 'true') {
1099
- return true;
1100
- }
1101
- else {
1102
- return false;
1103
- }
1104
- }
1105
- }
1106
- return returnValue;
1107
- };
1108
- /**
1109
- * @param {?} disclaimers
1110
- * @param {?} property
1111
- * @param {?} defaultValue
1112
- * @return {?}
1113
- */
1114
- DisclaimerUtil.prototype.atzDateFromDisclamer = function (disclaimers, property, defaultValue) {
1115
- var _this = this;
1116
- /** @type {?} */
1117
- var returnValue = this.ajustDate(defaultValue);
1118
- if (disclaimers && disclaimers.length > 0) {
1119
- disclaimers.find(( /**
1120
- * @param {?} item
1121
- * @return {?}
1122
- */function (item) {
1123
- if (item.property === property) {
1124
- if (item.value === null) {
1125
- return false;
1126
- }
1127
- returnValue = _this.ajustDate(item.value);
1128
- return true;
1129
- }
1130
- return false;
1131
- }));
1132
- }
1133
- return returnValue;
1134
- };
1135
- /**
1136
- * @param {?} disclaimers
1137
- * @param {?} property
1138
- * @param {?} defaultValue
1139
- * @return {?}
1140
- */
1141
- DisclaimerUtil.prototype.atzMultiSelectCharFromDisclamer = function (disclaimers, property, defaultValue) {
1142
- return this.atzMultiSelectFromDisclamer('char', disclaimers, property, defaultValue);
1143
- };
1144
- /**
1145
- * @param {?} disclaimers
1146
- * @param {?} property
1147
- * @param {?} defaultValue
1148
- * @return {?}
1149
- */
1150
- DisclaimerUtil.prototype.atzMultiSelectNumberFromDisclamer = function (disclaimers, property, defaultValue) {
1151
- return this.atzMultiSelectFromDisclamer('number', disclaimers, property, defaultValue);
1152
- };
1153
- /**
1154
- * @param {?} type
1155
- * @param {?} disclaimers
1156
- * @param {?} property
1157
- * @param {?} defaultValue
1158
- * @return {?}
1159
- */
1160
- DisclaimerUtil.prototype.atzMultiSelectFromDisclamer = function (type, disclaimers, property, defaultValue) {
1161
- /** @type {?} */
1162
- var returnValue = [];
1163
- defaultValue.map(( /**
1164
- * @param {?} item
1165
- * @return {?}
1166
- */function (/**
1167
- * @param {?} item
1168
- * @return {?}
1169
- */ item) {
1170
- returnValue.push(item.value);
1171
- }));
1172
- if (disclaimers && disclaimers.length > 0) {
1173
- disclaimers.find(( /**
1174
- * @param {?} item
1175
- * @return {?}
1176
- */function (item) {
1177
- if (item.property === property) {
1178
- if (item.value === null || item.value === 'all' || item.value === 'none') {
1179
- return false;
1180
- }
1181
- returnValue = [];
1182
- item.value.split(',').forEach(( /**
1183
- * @param {?} itemOpt
1184
- * @return {?}
1185
- */function (/**
1186
- * @param {?} itemOpt
1187
- * @return {?}
1188
- */ itemOpt) {
1189
- if (type === 'char') {
1190
- returnValue.push(itemOpt);
1191
- }
1192
- if (type === 'number') {
1193
- returnValue.push(+itemOpt);
1194
- }
1195
- }));
1196
- return true;
1197
- }
1198
- return false;
1199
- }));
1200
- }
1201
- return returnValue;
1202
- };
1203
- /**
1204
- * @param {?} disclaimers
1205
- * @param {?} property
1206
- * @param {?} options
1207
- * @return {?}
1208
- */
1209
- DisclaimerUtil.prototype.atzCheckboxFromDisclamer = function (disclaimers, property, options) {
1210
- /** @type {?} */
1211
- var returnValue = [];
1212
- options.map(( /**
1213
- * @param {?} item
1214
- * @return {?}
1215
- */function (/**
1216
- * @param {?} item
1217
- * @return {?}
1218
- */ item) {
1219
- returnValue.push(item.value);
1220
- }));
1221
- if (disclaimers && disclaimers.length > 0) {
1222
- disclaimers.find(( /**
1223
- * @param {?} item
1224
- * @return {?}
1225
- */function (item) {
1226
- if (item.property === property) {
1227
- if (item.value === null || item.value === 'all' || item.value === 'none') {
1228
- return false;
1229
- }
1230
- returnValue = [];
1231
- item.value.split(',').forEach(( /**
1232
- * @param {?} itemOpt
1233
- * @return {?}
1234
- */function (/**
1235
- * @param {?} itemOpt
1236
- * @return {?}
1237
- */ itemOpt) {
1238
- returnValue.push(itemOpt);
1239
- }));
1240
- return true;
1241
- }
1242
- return false;
1243
- }));
1244
- }
1245
- return returnValue;
1246
- };
1247
- /**
1248
- * @param {?} disclaimers
1249
- * @param {?} property
1250
- * @param {?} rangeChar
1251
- * @return {?}
1252
- */
1253
- DisclaimerUtil.prototype.atzRangeCharFromDisclamer = function (disclaimers, property, rangeChar) {
1254
- /** @type {?} */
1255
- var value = '';
1256
- if (disclaimers && disclaimers.length > 0) {
1257
- disclaimers.find(( /**
1258
- * @param {?} item
1259
- * @return {?}
1260
- */function (item) {
1261
- if (item.property === property) {
1262
- if (item.value === null) {
1263
- return false;
1264
- }
1265
- value = item.value;
1266
- return true;
1267
- }
1268
- return false;
1269
- }));
1270
- }
1271
- return this.atzRangeCharFromQueryParam(value, rangeChar);
1272
- };
1273
- /**
1274
- * @param {?} disclaimers
1275
- * @param {?} property
1276
- * @param {?} rangeNum
1277
- * @return {?}
1278
- */
1279
- DisclaimerUtil.prototype.atzRangeNumFromDisclamer = function (disclaimers, property, rangeNum) {
1280
- /** @type {?} */
1281
- var value = '';
1282
- if (disclaimers && disclaimers.length > 0) {
1283
- disclaimers.find(( /**
1284
- * @param {?} item
1285
- * @return {?}
1286
- */function (item) {
1287
- if (item.property === property) {
1288
- if (item.value === null) {
1289
- return false;
1290
- }
1291
- value = item.value;
1292
- return true;
1293
- }
1294
- return false;
1295
- }));
1296
- }
1297
- return this.atzRangeNumFromQueryParam(value, rangeNum);
1298
- };
1299
- /**
1300
- * @param {?} disclaimers
1301
- * @param {?} property
1302
- * @param {?} rangeDate
1303
- * @return {?}
1304
- */
1305
- DisclaimerUtil.prototype.atzRangeDateFromDisclamer = function (disclaimers, property, rangeDate) {
1306
- /** @type {?} */
1307
- var value = '';
1308
- if (disclaimers && disclaimers.length > 0) {
1309
- disclaimers.find(( /**
1310
- * @param {?} item
1311
- * @return {?}
1312
- */function (item) {
1313
- if (item.property === property) {
1314
- if (item.value === null) {
1315
- return false;
1316
- }
1317
- value = item.value;
1318
- return true;
1319
- }
1320
- return false;
1321
- }));
1322
- }
1323
- return this.atzRangeDateFromQueryParam(value, rangeDate);
1324
- };
1325
- /**
1326
- * @param {?} value
1327
- * @param {?} rangeChar
1328
- * @return {?}
1329
- */
1330
- DisclaimerUtil.prototype.atzRangeCharFromQueryParam = function (value, rangeChar) {
1331
- rangeChar.valInitial = rangeChar.iniInitial;
1332
- rangeChar.valFinal = rangeChar.iniFinal;
1333
- if (!value || value === '') {
1334
- return rangeChar;
1335
- }
1336
- rangeChar.valInitial = value.split(';')[0];
1337
- rangeChar.valFinal = value.split(';')[1];
1338
- if (rangeChar.valFinal === null || rangeChar.valFinal === undefined) {
1339
- rangeChar.valFinal = rangeChar.iniFinal;
1340
- }
1341
- return rangeChar;
1342
- };
1343
- /**
1344
- * @param {?} value
1345
- * @param {?} rangeNum
1346
- * @return {?}
1347
- */
1348
- DisclaimerUtil.prototype.atzRangeNumFromQueryParam = function (value, rangeNum) {
1349
- rangeNum.valInitial = rangeNum.iniInitial;
1350
- rangeNum.valFinal = rangeNum.iniFinal;
1351
- if (!value || value === '') {
1352
- return rangeNum;
1353
- }
1354
- rangeNum.valInitial = +value.split(';')[0];
1355
- rangeNum.valFinal = +value.split(';')[1];
1356
- if (rangeNum.valFinal === null || rangeNum.valFinal === undefined) {
1357
- rangeNum.valFinal = rangeNum.iniFinal;
1358
- }
1359
- return rangeNum;
1360
- };
1361
- /**
1362
- * @param {?} value
1363
- * @param {?} rangeDate
1364
- * @return {?}
1365
- */
1366
- DisclaimerUtil.prototype.atzRangeDateFromQueryParam = function (value, rangeDate) {
1367
- rangeDate.valInitial = rangeDate.iniInitial;
1368
- rangeDate.valFinal = rangeDate.iniFinal;
1369
- if (!value || value === '') {
1370
- return rangeDate;
1371
- }
1372
- rangeDate.valInitial = this.queryParamToDate(value.split(';')[0]);
1373
- rangeDate.valFinal = this.queryParamToDate(value.split(';')[1]);
1374
- if (rangeDate.valFinal === null || rangeDate.valFinal === undefined) {
1375
- rangeDate.valFinal = rangeDate.iniFinal;
1376
- }
1377
- return rangeDate;
1378
- };
1379
- /**
1380
- * @param {?} date
1381
- * @return {?}
1382
- */
1383
- DisclaimerUtil.prototype.dateToQueryParam = function (date) {
1384
- /** @type {?} */
1385
- var iDay = date.getDate();
1386
- /** @type {?} */
1387
- var iMonth = date.getMonth() + 1;
1388
- /** @type {?} */
1389
- var iYear = date.getFullYear();
1390
- return iYear + "-" + this.pad(iMonth) + "-" + this.pad(iDay);
1391
- };
1392
- /**
1393
- * @param {?} param
1394
- * @return {?}
1395
- */
1396
- DisclaimerUtil.prototype.queryParamToDate = function (param) {
1397
- /** @type {?} */
1398
- var iDay = +param.split('-')[2];
1399
- /** @type {?} */
1400
- var iMonth = +param.split('-')[1];
1401
- /** @type {?} */
1402
- var iYear = +param.split('-')[0];
1403
- return new Date(iYear, iMonth - 1, iDay);
1404
- };
1405
- /**
1406
- * @param {?} date
1407
- * @return {?}
1408
- */
1409
- DisclaimerUtil.prototype.isValidDate = function (date) {
1410
- return date instanceof Date && !isNaN(date.getTime());
1411
- };
1412
- /**
1413
- * @param {?} param
1414
- * @return {?}
1415
- */
1416
- DisclaimerUtil.prototype.ajustDate = function (param) {
1417
- if (param instanceof Date) {
1418
- return param;
1419
- }
1420
- if (!param) {
1421
- return param;
1422
- }
1423
- return this.queryParamToDate(param.split('T')[0]);
1424
- };
1425
- /**
1426
- * @param {?} number
1427
- * @return {?}
1428
- */
1429
- DisclaimerUtil.prototype.pad = function (number) {
1430
- if (number < 10) {
1431
- return '0' + number;
1432
- }
1433
- return number;
1434
- };
1435
- return DisclaimerUtil;
1436
- }());
1437
- if (false) {
1438
- /** @type {?} */
1439
- DisclaimerUtil.prototype.poNotification;
1440
- /** @type {?} */
1441
- DisclaimerUtil.prototype.poI18nPipe;
1442
- /** @type {?} */
1443
- DisclaimerUtil.prototype.literals;
1444
- }
1445
-
1446
- /**
1447
- * @fileoverview added by tsickle
1448
- * Generated from: lib/utils/field-validation.util.ts
1449
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1450
- */
1451
- var FieldValidationUtil = /** @class */ (function () {
1452
- /**
1453
- * @param {?} poNotification
1454
- * @param {?} poI18nPipe
1455
- * @param {?} literals
1456
- */
1457
- function FieldValidationUtil(poNotification, poI18nPipe, literals) {
1458
- this.literals = {};
1459
- this.poNotification = poNotification;
1460
- this.poI18nPipe = poI18nPipe;
1461
- this.literals = literals;
1462
- this.disclaimerUtil = new DisclaimerUtil(this.poNotification, this.poI18nPipe, this.literals);
1463
- }
1464
- /**
1465
- * @param {?} field
1466
- * @param {?} value
1467
- * @return {?}
1468
- */
1469
- FieldValidationUtil.prototype.vldFieldCharacter = function (field, value) {
1470
- if (!value || value.trim() === '') {
1471
- this.poNotification.error({
1472
- message: this.poI18nPipe.transform(this.literals['fieldVldRequered'], [this.literals[field]])
1473
- });
1474
- return false;
1475
- }
1476
- return true;
1477
- };
1478
- // Valida uma faixa de caracteres se o inicial é menor que final
1479
- /**
1480
- * @param {?} initialField
1481
- * @param {?} finalField
1482
- * @param {?} initialValue
1483
- * @param {?} finalValue
1484
- * @return {?}
1485
- */
1486
- FieldValidationUtil.prototype.vldRangeCharacter = function (initialField, finalField, initialValue, finalValue) {
1487
- if (!initialValue || !finalValue) {
1488
- return true;
1489
- }
1490
- if (initialValue.trim().toUpperCase() > finalValue.trim().toUpperCase()) {
1491
- this.poNotification.error({
1492
- message: this.poI18nPipe.transform(this.literals['fieldVldRange'], [this.literals[initialField], this.literals[finalField]])
1493
- });
1494
- return false;
1495
- }
1496
- return true;
1497
- };
1498
- /**
1499
- * @param {?} field
1500
- * @param {?} value
1501
- * @param {?=} vldValue
1502
- * @param {?=} zeroAccept
1503
- * @return {?}
1504
- */
1505
- FieldValidationUtil.prototype.vldFieldNumber = function (field, value, vldValue, zeroAccept) {
1506
- if (vldValue === void 0) { vldValue = false; }
1507
- if (zeroAccept === void 0) { zeroAccept = false; }
1508
- if (vldValue && !this.vldValueOfNumber(field, value)) {
1509
- return false;
1510
- }
1511
- if ((!value) || value <= 0) {
1512
- if (value === 0 && zeroAccept === true) {
1513
- return true;
1514
- }
1515
- this.poNotification.error({
1516
- message: this.poI18nPipe.transform(this.literals['fieldVldRequered'], [this.literals[field]])
1517
- });
1518
- return false;
1519
- }
1520
- return true;
1521
- };
1522
- /**
1523
- * @param {?} field
1524
- * @param {?} value
1525
- * @return {?}
1526
- */
1527
- FieldValidationUtil.prototype.vldValueOfNumber = function (field, value) {
1528
- if (value && value < 0) {
1529
- this.poNotification.error({ message: this.poI18nPipe.transform(this.literals['fieldVldNumber'], [value.toString(), this.literals[field]]) });
1530
- return false;
1531
- }
1532
- return true;
1533
- };
1534
- /**
1535
- * @param {?} field
1536
- * @param {?} value
1537
- * @param {?=} vldValue
1538
- * @return {?}
1539
- */
1540
- FieldValidationUtil.prototype.vldFieldPercent = function (field, value, vldValue) {
1541
- if (vldValue === void 0) { vldValue = false; }
1542
- if (vldValue && !this.vldValueOfPercent(field, value)) {
1543
- return false;
1544
- }
1545
- if (!this.vldFieldNumber(field, value)) {
1546
- return false;
1547
- }
1548
- return true;
1549
- };
1550
- /**
1551
- * @param {?} field
1552
- * @param {?} value
1553
- * @return {?}
1554
- */
1555
- FieldValidationUtil.prototype.vldValueOfPercent = function (field, value) {
1556
- if (value && value < 0) {
1557
- this.poNotification.error({ message: this.poI18nPipe.transform(this.literals['fieldVldNumber'], [value.toString(), this.literals[field]]) });
1558
- return false;
1559
- }
1560
- if (value && value > 100) {
1561
- this.poNotification.error({ message: this.poI18nPipe.transform(this.literals['fieldVldNumber'], [value.toString(), this.literals[field]]) });
1562
- return false;
1563
- }
1564
- return true;
1565
- };
1566
- // Valida uma faixa de números se o inicial é menor que final
1567
- /**
1568
- * @param {?} initialField
1569
- * @param {?} finalField
1570
- * @param {?} initialValue
1571
- * @param {?} finalValue
1572
- * @return {?}
1573
- */
1574
- FieldValidationUtil.prototype.vldRangeNumber = function (initialField, finalField, initialValue, finalValue) {
1575
- if (!initialValue) {
1576
- initialValue = 0;
1577
- }
1578
- if (!finalValue) {
1579
- finalValue = 0;
1580
- }
1581
- if (initialValue > finalValue) {
1582
- this.poNotification.error({
1583
- message: this.poI18nPipe.transform(this.literals['fieldVldRange'], [this.literals[initialField], this.literals[finalField]])
1584
- });
1585
- return false;
1586
- }
1587
- return true;
1588
- };
1589
- /**
1590
- * @param {?} field
1591
- * @param {?} value
1592
- * @return {?}
1593
- */
1594
- FieldValidationUtil.prototype.vldFieldDate = function (field, value) {
1595
- /** @type {?} */
1596
- var valDate = this.disclaimerUtil.ajustDate(value);
1597
- if (!this.disclaimerUtil.isValidDate(valDate)) {
1598
- this.poNotification.error({
1599
- message: this.poI18nPipe.transform(this.literals['fieldVldDate'], [this.literals[field]])
1600
- });
1601
- return false;
1602
- }
1603
- return true;
1604
- };
1605
- // Valida uma faixa de datas se o inicial é menor que final
1606
- /**
1607
- * @param {?} initialField
1608
- * @param {?} finalField
1609
- * @param {?} initialValue
1610
- * @param {?} finalValue
1611
- * @return {?}
1612
- */
1613
- FieldValidationUtil.prototype.vldRangeDate = function (initialField, finalField, initialValue, finalValue) {
1614
- if (!initialValue || !finalValue) {
1615
- return true;
1616
- }
1617
- /** @type {?} */
1618
- var valInitialDate = this.disclaimerUtil.ajustDate(initialValue).getTime();
1619
- /** @type {?} */
1620
- var valFinalDate = this.disclaimerUtil.ajustDate(finalValue).getTime();
1621
- if (valInitialDate > valFinalDate) {
1622
- this.poNotification.error({
1623
- message: this.poI18nPipe.transform(this.literals['fieldVldRange'], [this.literals[initialField], this.literals[finalField]])
1624
- });
1625
- return false;
1626
- }
1627
- return true;
1628
- };
1629
- /**
1630
- * @param {?} field
1631
- * @param {?} value
1632
- * @return {?}
1633
- */
1634
- FieldValidationUtil.prototype.vldFieldMultiSelect = function (field, value) {
1635
- if (!value || value.length === 0) {
1636
- this.poNotification.error({
1637
- message: this.poI18nPipe.transform(this.literals['fieldVldSelected'], [this.literals[field]])
1638
- });
1639
- return false;
1640
- }
1641
- return true;
1642
- };
1643
- /**
1644
- * @param {?} field
1645
- * @param {?} value
1646
- * @return {?}
1647
- */
1648
- FieldValidationUtil.prototype.vldFieldCheckbox = function (field, value) {
1649
- if (!value || value.length === 0) {
1650
- this.poNotification.error({
1651
- message: this.poI18nPipe.transform(this.literals['fieldVldSelected'], [this.literals[field]])
1652
- });
1653
- return false;
1654
- }
1655
- return true;
1656
- };
1657
- // Valida formato conforme regra: "9" apenas números, "X" qualquer caracter, "!" apenas letras maiúsculas
1658
- /**
1659
- * @param {?} field
1660
- * @param {?} value
1661
- * @param {?} format
1662
- * @param {?=} replacePoint
1663
- * @return {?}
1664
- */
1665
- FieldValidationUtil.prototype.vldFieldFormat = function (field, value, format, replacePoint) {
1666
- if (replacePoint === void 0) { replacePoint = false; }
1667
- /** @type {?} */
1668
- var lOK = true;
1669
- /** @type {?} */
1670
- var oldFormat;
1671
- if (!value) {
1672
- return lOK;
1673
- }
1674
- /*Retira os pontos do formato*/
1675
- if (replacePoint) {
1676
- oldFormat = format;
1677
- format = format.replace(/\./g, '');
1678
- }
1679
- if (value.length !== format.length) {
1680
- lOK = false;
1681
- }
1682
- else {
1683
- for (var idx = 0; idx < format.length; idx++) {
1684
- if (format[idx] === '9') {
1685
- if (value[idx].replace(/[0-9]/, '9') !== '9') {
1686
- lOK = false;
1687
- break;
1688
- }
1689
- }
1690
- if (format[idx] === '!') {
1691
- if (value[idx].replace(/[A-Z]/, 'A') !== 'A') {
1692
- lOK = false;
1693
- break;
1694
- }
1695
- }
1696
- }
1697
- }
1698
- if (replacePoint) {
1699
- format = oldFormat;
1700
- }
1701
- if (!lOK) {
1702
- this.poNotification.error({
1703
- message: this.poI18nPipe.transform(this.literals['fieldVldFormat'], [this.literals[field], format])
1704
- });
1705
- }
1706
- return lOK;
1707
- };
1708
- return FieldValidationUtil;
1709
- }());
1710
- if (false) {
1711
- /** @type {?} */
1712
- FieldValidationUtil.prototype.poNotification;
1713
- /** @type {?} */
1714
- FieldValidationUtil.prototype.poI18nPipe;
1715
- /** @type {?} */
1716
- FieldValidationUtil.prototype.literals;
1717
- /** @type {?} */
1718
- FieldValidationUtil.prototype.disclaimerUtil;
1719
- }
1720
-
1721
- /**
1722
- * @fileoverview added by tsickle
1723
- * Generated from: lib/utils/filter-range.util.ts
1724
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1725
- */
1726
- /*
1727
- Versão: 1.000
1728
- Data Criação: 06/08/2018
1729
- */
1730
- var FilterRangeUtil = /** @class */ (function () {
1731
- function FilterRangeUtil() {
1732
- }
1733
- /**
1734
- * @param {?} iniInitial
1735
- * @param {?} iniFinal
1736
- * @return {?}
1737
- */
1738
- FilterRangeUtil.makeFilterRangeCharacter = function (iniInitial, iniFinal) {
1739
- return {
1740
- iniInitial: iniInitial,
1741
- iniFinal: iniFinal,
1742
- valInitial: iniInitial,
1743
- valFinal: iniFinal
1744
- };
1745
- };
1746
- /**
1747
- * @param {?} iniInitial
1748
- * @param {?} iniFinal
1749
- * @return {?}
1750
- */
1751
- FilterRangeUtil.makeFilterRangeNumber = function (iniInitial, iniFinal) {
1752
- return {
1753
- iniInitial: iniInitial,
1754
- iniFinal: iniFinal,
1755
- valInitial: iniInitial,
1756
- valFinal: iniFinal
1757
- };
1758
- };
1759
- /**
1760
- * @param {?} iniInitial
1761
- * @param {?} iniFinal
1762
- * @return {?}
1763
- */
1764
- FilterRangeUtil.makeFilterRangeDate = function (iniInitial, iniFinal) {
1765
- return {
1766
- iniInitial: iniInitial,
1767
- iniFinal: iniFinal,
1768
- valInitial: iniInitial,
1769
- valFinal: iniFinal
1770
- };
1771
- };
1772
- return FilterRangeUtil;
1773
- }());
1774
-
1775
- /**
1776
- * @fileoverview added by tsickle
1777
- * Generated from: lib/utils/generic-functions.utils.ts
1778
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1779
- */
1780
- /*
1781
- Versão: 1.003
1782
- Data Criação: 18/04/2019
1783
- */
1784
- /**
1785
- * @record
1786
- */
1787
- function ChartSeries() { }
1788
- if (false) {
1789
- /** @type {?|undefined} */
1790
- ChartSeries.prototype.name;
1791
- /** @type {?|undefined} */
1792
- ChartSeries.prototype.data;
1793
- }
1794
- /**
1795
- * @record
1796
- */
1797
- function ChartValues() { }
1798
- if (false) {
1799
- /** @type {?} */
1800
- ChartValues.prototype.minValue;
1801
- /** @type {?} */
1802
- ChartValues.prototype.maxValue;
1803
- }
1804
- var GenericFunctionsUtils = /** @class */ (function () {
1805
- /**
1806
- * @param {?} literals
1807
- */
1808
- function GenericFunctionsUtils(literals) {
1809
- this.literals = {};
1810
- this.literals = literals;
1811
- }
1812
- /* Transforma uma Lista separada por "," em um Array */
1813
- /**
1814
- * @param {?} list
1815
- * @return {?}
1816
- */
1817
- GenericFunctionsUtils.listToArrayCharacter = function (list) {
1818
- /** @type {?} */
1819
- var returnArray = new Array();
1820
- if (list && list !== '') {
1821
- returnArray = list.split(',');
1822
- }
1823
- return returnArray;
1824
- };
1825
- /* Transforma um Array em uma Lista separada por "," */
1826
- /**
1827
- * @param {?} array
1828
- * @return {?}
1829
- */
1830
- GenericFunctionsUtils.ArrayToListCharacter = function (array) {
1831
- /** @type {?} */
1832
- var list = '';
1833
- if (array && array.length > 0) {
1834
- list = array.join(',');
1835
- }
1836
- return list;
1837
- };
1838
- /**
1839
- * @param {?} object
1840
- * @return {?}
1841
- */
1842
- GenericFunctionsUtils.isEmpty = function (object) {
1843
- /** @type {?} */
1844
- var isEmpty = true;
1845
- for (var content in object) {
1846
- if (object.hasOwnProperty(content)) {
1847
- isEmpty = false;
1848
- }
1849
- }
1850
- return isEmpty;
1851
- };
1852
- /**
1853
- * @param {?} chartData
1854
- * @return {?}
1855
- */
1856
- GenericFunctionsUtils.getChartValues = function (chartData) {
1857
- /** @type {?} */
1858
- var chartValues;
1859
- /** @type {?} */
1860
- var maxValue;
1861
- /** @type {?} */
1862
- var minValue;
1863
- maxValue = undefined;
1864
- minValue = undefined;
1865
- chartData.map(( /**
1866
- * @param {?} item
1867
- * @return {?}
1868
- */function (/**
1869
- * @param {?} item
1870
- * @return {?}
1871
- */ item) {
1872
- if (maxValue === undefined && minValue === undefined) {
1873
- maxValue = item.data[0];
1874
- minValue = item.data[0];
1875
- }
1876
- else {
1877
- if (item.data < minValue) {
1878
- minValue = item.data[0];
1879
- }
1880
- if (item.data > maxValue) {
1881
- maxValue = item.data[0];
1882
- }
1883
- }
1884
- }));
1885
- if (maxValue > 0 && minValue > 0) {
1886
- chartValues = { maxValue: maxValue, minValue: 0 };
1887
- }
1888
- if (maxValue > 0 && minValue < 0) {
1889
- chartValues = { maxValue: maxValue, minValue: minValue };
1890
- }
1891
- if (maxValue < 0 && minValue < 0) {
1892
- /** @type {?} */
1893
- var max = (minValue / 3) * (-1);
1894
- chartValues = { maxValue: max, minValue: minValue };
1895
- }
1896
- if (maxValue > 0 && minValue === 0) {
1897
- chartValues = { maxValue: maxValue, minValue: 0 };
1898
- }
1899
- if (maxValue === 0 && minValue < 0) {
1900
- /** @type {?} */
1901
- var max = (minValue / 3) * (-1);
1902
- chartValues = { maxValue: max, minValue: minValue };
1903
- }
1904
- if (maxValue === 0 && minValue === 0) {
1905
- chartValues = { maxValue: undefined, minValue: undefined };
1906
- }
1907
- chartValues.maxValue = Math.round(chartValues.maxValue);
1908
- chartValues.minValue = Math.round(chartValues.minValue);
1909
- return chartValues;
1910
- };
1911
- /*Deixa no list apenas o itens que existem no options*/
1912
- /**
1913
- * @param {?} options
1914
- * @param {?} list
1915
- * @return {?}
1916
- */
1917
- GenericFunctionsUtils.atzMultiSelectListByOptions = function (options, list) {
1918
- /** @type {?} */
1919
- var idx;
1920
- /** @type {?} */
1921
- var newList;
1922
- if (!list) {
1923
- return list;
1924
- }
1925
- newList = new Array();
1926
- list.map(( /**
1927
- * @param {?} item
1928
- * @return {?}
1929
- */function (/**
1930
- * @param {?} item
1931
- * @return {?}
1932
- */ item) {
1933
- if (item) {
1934
- idx = options.findIndex(( /**
1935
- * @param {?} itemOptions
1936
- * @return {?}
1937
- */function (/**
1938
- * @param {?} itemOptions
1939
- * @return {?}
1940
- */ itemOptions) { return itemOptions.value === item; }));
1941
- if (idx >= 0) {
1942
- newList.push(item);
1943
- }
1944
- }
1945
- }));
1946
- return newList;
1947
- };
1948
- /*Carrega o Options com os valores defaults passados como parâmetro (list)*/
1949
- /**
1950
- * @param {?} options
1951
- * @param {?} list
1952
- * @return {?}
1953
- */
1954
- GenericFunctionsUtils.prototype.loadOptionsMultiSelect = function (options, list) {
1955
- var _this = this;
1956
- /** @type {?} */
1957
- var idx;
1958
- if (!list) {
1959
- return;
1960
- }
1961
- list.map(( /**
1962
- * @param {?} item
1963
- * @return {?}
1964
- */function (/**
1965
- * @param {?} item
1966
- * @return {?}
1967
- */ item) {
1968
- if (item) {
1969
- idx = options.findIndex(( /**
1970
- * @param {?} itemOptions
1971
- * @return {?}
1972
- */function (/**
1973
- * @param {?} itemOptions
1974
- * @return {?}
1975
- */ itemOptions) { return itemOptions.value === item; }));
1976
- if (idx === -1) {
1977
- options.push({ label: item === 'all' ? _this.literals['all'] : item, value: item });
1978
- }
1979
- }
1980
- }));
1981
- };
1982
- /*Carrega o Options com os valores defaults passados como parâmetro (list)*/
1983
- /**
1984
- * @param {?} options
1985
- * @param {?} selectValue
1986
- * @param {?=} tradValue
1987
- * @return {?}
1988
- */
1989
- GenericFunctionsUtils.prototype.loadOptionsSelect = function (options, selectValue, tradValue) {
1990
- if (tradValue === void 0) { tradValue = false; }
1991
- /** @type {?} */
1992
- var idx;
1993
- if (!selectValue) {
1994
- return;
1995
- }
1996
- if (selectValue) {
1997
- idx = options.findIndex(( /**
1998
- * @param {?} itemOptions
1999
- * @return {?}
2000
- */function (/**
2001
- * @param {?} itemOptions
2002
- * @return {?}
2003
- */ itemOptions) { return itemOptions.value === selectValue; }));
2004
- if (idx === -1) {
2005
- options.push({ label: tradValue ? this.literals[selectValue] : selectValue, value: selectValue });
2006
- }
2007
- }
2008
- };
2009
- /*Método que compara 2 objetos e retorna se são iguais ou diferentes*/
2010
- /**
2011
- * @param {?} firstObject
2012
- * @param {?} secondObject
2013
- * @return {?}
2014
- */
2015
- GenericFunctionsUtils.prototype.compareObjects = function (firstObject, secondObject) {
2016
- if (!firstObject || !secondObject) {
2017
- return false;
2018
- }
2019
- /*Pega a lista de nomes dos campos do objetos e compara*/
2020
- if (Object.getOwnPropertyNames(firstObject).length !== Object.getOwnPropertyNames(secondObject).length) {
2021
- return false;
2022
- }
2023
- for (var content in firstObject) {
2024
- if (content.substr(0, 1) === '$' || content.substr(0, 1) === '_') {
2025
- continue;
2026
- }
2027
- if (firstObject[content] !== secondObject[content]) {
2028
- return false;
2029
- }
2030
- }
2031
- return true;
2032
- };
2033
- /**
2034
- * @param {?} charInd
2035
- * @param {?} dateRef
2036
- * @return {?}
2037
- */
2038
- GenericFunctionsUtils.prototype.referenceGeneration = function (charInd, dateRef) {
2039
- /** @type {?} */
2040
- var reference;
2041
- /** @type {?} */
2042
- var random;
2043
- /** @type {?} */
2044
- var iDay = dateRef.getDate();
2045
- /** @type {?} */
2046
- var iMonth = dateRef.getMonth() + 1;
2047
- /** @type {?} */
2048
- var iYear = dateRef.getFullYear();
2049
- reference = "" + this.pad(iYear) + this.pad(iMonth) + this.pad(iDay) + charInd;
2050
- random = btoa("" + (new Date()).getTime());
2051
- random = random.replace(/[=]/g, '');
2052
- random = random.slice(random.length - 3, random.length);
2053
- return "" + reference + random;
2054
- };
2055
- /**
2056
- * @param {?} number
2057
- * @return {?}
2058
- */
2059
- GenericFunctionsUtils.prototype.pad = function (number) {
2060
- if (number < 10) {
2061
- return '0' + number;
2062
- }
2063
- if (number > 99) {
2064
- return (number + '').slice(2, 4);
2065
- }
2066
- return number;
2067
- };
2068
- /**
2069
- * @param {?} idField
2070
- * @return {?}
2071
- */
2072
- GenericFunctionsUtils.prototype.focusInternalInput = function (idField) {
2073
- /** @type {?} */
2074
- var fieldComponent = document.getElementById(idField);
2075
- /** @type {?} */
2076
- var fieldInput = (( /** @type {?} */(( /** @type {?} */(fieldComponent.getElementsByClassName('po-input'))))))[0];
2077
- fieldInput.focus();
2078
- };
2079
- return GenericFunctionsUtils;
2080
- }());
2081
- if (false) {
2082
- /** @type {?} */
2083
- GenericFunctionsUtils.prototype.literals;
2084
- }
2085
-
2086
- /**
2087
- * @fileoverview added by tsickle
2088
- * Generated from: lib/utils/file.util.ts
2089
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2090
- */
2091
- var FileUtil = /** @class */ (function () {
2092
- function FileUtil() {
2093
- }
2094
- /**
2095
- * @param {?} data
2096
- * @param {?} fileName
2097
- * @param {?=} contentType
2098
- * @param {?=} base64
2099
- * @return {?}
2100
- */
2101
- FileUtil.downloadFile = function (data, fileName, contentType, base64) {
2102
- base64 = (base64 === false) ? false : true;
2103
- /** @type {?} */
2104
- var dataBlob = base64 ? this.b64toBlob(data, contentType) : data;
2105
- this.download(dataBlob, fileName);
2106
- };
2107
- /**
2108
- * @param {?} data
2109
- * @param {?=} dwldDataParam
2110
- * @return {?}
2111
- */
2112
- FileUtil.downloadData = function (data, dwldDataParam) {
2113
- if (dwldDataParam === void 0) { dwldDataParam = null; }
2114
- if (!data) {
2115
- return;
2116
- }
2117
- if (!dwldDataParam) {
2118
- dwldDataParam = new DownloadDataParams();
2119
- }
2120
- if (!dwldDataParam.fileName) {
2121
- dwldDataParam.fileName = 'data.csv';
2122
- }
2123
- if (!dwldDataParam.literals) {
2124
- dwldDataParam.literals = {};
2125
- }
2126
- if (!dwldDataParam.columnDelimiter) {
2127
- dwldDataParam.columnDelimiter = ';';
2128
- }
2129
- if (!dwldDataParam.columnList) {
2130
- dwldDataParam.columnList = [];
2131
- }
2132
- if (!dwldDataParam.columnExclude) {
2133
- dwldDataParam.columnExclude = [];
2134
- }
2135
- /** @type {?} */
2136
- var datab64 = btoa(this.jsonToString(data, dwldDataParam));
2137
- this.downloadFile(datab64, dwldDataParam.fileName, 'text/csv');
2138
- };
2139
- /**
2140
- * @private
2141
- * @param {?} file
2142
- * @param {?} fileName
2143
- * @return {?}
2144
- */
2145
- FileUtil.download = function (file, fileName) {
2146
- /** @type {?} */
2147
- var binaryData = [file];
2148
- /** @type {?} */
2149
- var downloadLink = document.createElement('a');
2150
- /** @type {?} */
2151
- var urlDownload = window.URL.createObjectURL(new Blob(binaryData, { type: file.type }));
2152
- /**Verifica se é ie ou edge, pois o mesmo tem tratamento próprio para arquivos blob */
2153
- if (navigator.userAgent.toUpperCase().indexOf('.NET') > 0 || navigator.userAgent.toUpperCase().indexOf('EDGE') > 0) {
2154
- window.navigator.msSaveOrOpenBlob(file, fileName);
2155
- }
2156
- else {
2157
- downloadLink.href = urlDownload;
2158
- downloadLink.setAttribute('download', fileName);
2159
- document.body.appendChild(downloadLink);
2160
- downloadLink.click();
2161
- window.URL.revokeObjectURL(urlDownload);
2162
- downloadLink.remove();
2163
- }
2164
- };
2165
- /**
2166
- * @private
2167
- * @param {?} b64Data
2168
- * @param {?=} contentType
2169
- * @param {?=} sliceSize
2170
- * @return {?}
2171
- */
2172
- FileUtil.b64toBlob = function (b64Data, contentType, sliceSize) {
2173
- contentType = contentType || '';
2174
- sliceSize = sliceSize || 512;
2175
- /** @type {?} */
2176
- var byteCharacters = atob(b64Data);
2177
- /** @type {?} */
2178
- var byteArrays = [];
2179
- for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
2180
- /** @type {?} */
2181
- var slice = byteCharacters.slice(offset, offset + sliceSize);
2182
- /** @type {?} */
2183
- var byteNumbers = new Array(slice.length);
2184
- for (var i = 0; i < slice.length; i++) {
2185
- byteNumbers[i] = slice.charCodeAt(i);
2186
- }
2187
- /** @type {?} */
2188
- var byteArray = new Uint8Array(byteNumbers);
2189
- byteArrays.push(byteArray);
2190
- }
2191
- /** @type {?} */
2192
- var blob = new Blob(byteArrays, { type: contentType });
2193
- return blob;
2194
- };
2195
- /**
2196
- * @private
2197
- * @param {?} jsonData
2198
- * @param {?} dwldDataParam
2199
- * @return {?}
2200
- */
2201
- FileUtil.jsonToString = function (jsonData, dwldDataParam) {
2202
- if (!jsonData || jsonData.length === 0) {
2203
- return '';
2204
- }
2205
- /** @type {?} */
2206
- var lineDelimiter = '\n';
2207
- /** @type {?} */
2208
- var columnOrig = null;
2209
- /** @type {?} */
2210
- var columnHeader = null;
2211
- /** @type {?} */
2212
- var keys = [];
2213
- /** @type {?} */
2214
- var includeKey;
2215
- if (dwldDataParam.columnList &&
2216
- dwldDataParam.columnList.length > 0) {
2217
- columnOrig = dwldDataParam.columnList;
2218
- }
2219
- else {
2220
- columnOrig = Object.keys(jsonData[0]);
2221
- }
2222
- columnOrig.forEach(( /**
2223
- * @param {?} key
2224
- * @return {?}
2225
- */function (/**
2226
- * @param {?} key
2227
- * @return {?}
2228
- */ key) {
2229
- includeKey = true;
2230
- if (dwldDataParam.columnExclude &&
2231
- dwldDataParam.columnExclude.length > 0 &&
2232
- dwldDataParam.columnExclude.indexOf(key) !== -1) {
2233
- includeKey = false;
2234
- }
2235
- if (includeKey) {
2236
- keys.push(key);
2237
- columnHeader = (!columnHeader) ? '' : columnHeader + dwldDataParam.columnDelimiter;
2238
- columnHeader += (dwldDataParam.literals[key]) ? dwldDataParam.literals[key] : key;
2239
- }
2240
- }));
2241
- /** @type {?} */
2242
- var lineStr = jsonData.reduce(( /**
2243
- * @param {?} accLineStr
2244
- * @param {?} currentItem
2245
- * @return {?}
2246
- */function (accLineStr, currentItem) {
2247
- /** @type {?} */
2248
- var first = true;
2249
- /** @type {?} */
2250
- var columnValue = null;
2251
- keys.forEach(( /**
2252
- * @param {?} key
2253
- * @return {?}
2254
- */function (/**
2255
- * @param {?} key
2256
- * @return {?}
2257
- */ key) {
2258
- if (!first) {
2259
- accLineStr += dwldDataParam.columnDelimiter;
2260
- }
2261
- columnValue = currentItem[key];
2262
- if (columnValue === null || columnValue === undefined) {
2263
- columnValue = '';
2264
- }
2265
- switch (typeof (columnValue)) {
2266
- case 'number':
2267
- columnValue = columnValue.toLocaleString();
2268
- break;
2269
- case 'boolean':
2270
- columnValue = (dwldDataParam.literals["" + columnValue]) ?
2271
- dwldDataParam.literals["" + columnValue] : columnValue;
2272
- break;
2273
- case 'object':
2274
- columnValue = JSON.stringify(columnValue);
2275
- }
2276
- accLineStr += columnValue;
2277
- first = false;
2278
- }));
2279
- return accLineStr + lineDelimiter;
2280
- }), columnHeader + lineDelimiter);
2281
- return lineStr;
2282
- };
2283
- return FileUtil;
2284
- }());
2285
- /**
2286
- * @record
2287
- */
2288
- function IDownloadDataParams() { }
2289
- if (false) {
2290
- /** @type {?} */
2291
- IDownloadDataParams.prototype.fileName;
2292
- /** @type {?} */
2293
- IDownloadDataParams.prototype.literals;
2294
- /** @type {?} */
2295
- IDownloadDataParams.prototype.columnDelimiter;
2296
- /** @type {?} */
2297
- IDownloadDataParams.prototype.columnList;
2298
- /** @type {?} */
2299
- IDownloadDataParams.prototype.columnExclude;
2300
- }
2301
- var DownloadDataParams = /** @class */ (function () {
2302
- function DownloadDataParams() {
2303
- }
2304
- return DownloadDataParams;
2305
- }());
2306
- if (false) {
2307
- /** @type {?} */
2308
- DownloadDataParams.prototype.fileName;
2309
- /** @type {?} */
2310
- DownloadDataParams.prototype.literals;
2311
- /** @type {?} */
2312
- DownloadDataParams.prototype.columnDelimiter;
2313
- /** @type {?} */
2314
- DownloadDataParams.prototype.columnList;
2315
- /** @type {?} */
2316
- DownloadDataParams.prototype.columnExclude;
2317
- }
2318
-
2319
- /**
2320
- * @fileoverview added by tsickle
2321
- * Generated from: lib/components/totvs-schedule-execution/totvs-schedule-execution.model.ts
2322
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2323
- */
2324
- /**
2325
- * @record
2326
- */
2327
- function IScheduleParameters() { }
2328
- if (false) {
2329
- /** @type {?} */
2330
- IScheduleParameters.prototype.executionType;
2331
- /** @type {?} */
2332
- IScheduleParameters.prototype.execAppointDate;
2333
- /** @type {?} */
2334
- IScheduleParameters.prototype.execAppointHour;
2335
- /** @type {?} */
2336
- IScheduleParameters.prototype.executionServer;
2337
- /** @type {?} */
2338
- IScheduleParameters.prototype.repeatExecution;
2339
- /** @type {?} */
2340
- IScheduleParameters.prototype.repeatType;
2341
- /** @type {?} */
2342
- IScheduleParameters.prototype.frequency;
2343
- /** @type {?} */
2344
- IScheduleParameters.prototype.frequencyValue;
2345
- /** @type {?} */
2346
- IScheduleParameters.prototype.frequencyType;
2347
- /** @type {?} */
2348
- IScheduleParameters.prototype.execAppointHourInit;
2349
- /** @type {?} */
2350
- IScheduleParameters.prototype.execAppointHourFinal;
2351
- /** @type {?} */
2352
- IScheduleParameters.prototype.selectWeeklys;
2353
- /** @type {?} */
2354
- IScheduleParameters.prototype.dayOfMonth;
2355
- }
2356
- var ScheduleParameters = /** @class */ (function () {
2357
- function ScheduleParameters() {
2358
- }
2359
- return ScheduleParameters;
2360
- }());
2361
- if (false) {
2362
- /** @type {?} */
2363
- ScheduleParameters.prototype.executionType;
2364
- /** @type {?} */
2365
- ScheduleParameters.prototype.execAppointDate;
2366
- /** @type {?} */
2367
- ScheduleParameters.prototype.execAppointHour;
2368
- /** @type {?} */
2369
- ScheduleParameters.prototype.executionServer;
2370
- /** @type {?} */
2371
- ScheduleParameters.prototype.repeatExecution;
2372
- /** @type {?} */
2373
- ScheduleParameters.prototype.repeatType;
2374
- /** @type {?} */
2375
- ScheduleParameters.prototype.frequency;
2376
- /** @type {?} */
2377
- ScheduleParameters.prototype.frequencyValue;
2378
- /** @type {?} */
2379
- ScheduleParameters.prototype.frequencyType;
2380
- /** @type {?} */
2381
- ScheduleParameters.prototype.execAppointHourInit;
2382
- /** @type {?} */
2383
- ScheduleParameters.prototype.execAppointHourFinal;
2384
- /** @type {?} */
2385
- ScheduleParameters.prototype.selectWeeklys;
2386
- /** @type {?} */
2387
- ScheduleParameters.prototype.dayOfMonth;
2388
- }
2389
- /**
2390
- * @record
2391
- */
2392
- function IExecutionStatus() { }
2393
- if (false) {
2394
- /** @type {?} */
2395
- IExecutionStatus.prototype.jobScheduleID;
2396
- /** @type {?} */
2397
- IExecutionStatus.prototype.executionID;
2398
- /** @type {?} */
2399
- IExecutionStatus.prototype.startedDate;
2400
- /** @type {?} */
2401
- IExecutionStatus.prototype.error;
2402
- /** @type {?} */
2403
- IExecutionStatus.prototype.status;
2404
- }
2405
- var ExecutionStatus = /** @class */ (function () {
2406
- function ExecutionStatus() {
2407
- }
2408
- return ExecutionStatus;
2409
- }());
2410
- if (false) {
2411
- /** @type {?} */
2412
- ExecutionStatus.prototype.jobScheduleID;
2413
- /** @type {?} */
2414
- ExecutionStatus.prototype.executionID;
2415
- /** @type {?} */
2416
- ExecutionStatus.prototype.startedDate;
2417
- /** @type {?} */
2418
- ExecutionStatus.prototype.error;
2419
- /** @type {?} */
2420
- ExecutionStatus.prototype.status;
2421
- }
2422
- /**
2423
- * @record
2424
- */
2425
- function IExecutionParameters() { }
2426
- if (false) {
2427
- /** @type {?} */
2428
- IExecutionParameters.prototype.executionServer;
2429
- /** @type {?} */
2430
- IExecutionParameters.prototype.programName;
2431
- /** @type {?} */
2432
- IExecutionParameters.prototype.externalName;
2433
- /** @type {?} */
2434
- IExecutionParameters.prototype.programEMS5;
2435
- /** @type {?} */
2436
- IExecutionParameters.prototype.programVersion;
2437
- /** @type {?} */
2438
- IExecutionParameters.prototype.businessParams;
2439
- }
2440
- var ExecutionParameters = /** @class */ (function () {
2441
- function ExecutionParameters() {
2442
- }
2443
- return ExecutionParameters;
2444
- }());
2445
- if (false) {
2446
- /** @type {?} */
2447
- ExecutionParameters.prototype.executionServer;
2448
- /** @type {?} */
2449
- ExecutionParameters.prototype.programName;
2450
- /** @type {?} */
2451
- ExecutionParameters.prototype.externalName;
2452
- /** @type {?} */
2453
- ExecutionParameters.prototype.programEMS5;
2454
- /** @type {?} */
2455
- ExecutionParameters.prototype.programVersion;
2456
- /** @type {?} */
2457
- ExecutionParameters.prototype.businessParams;
2458
- }
2459
-
2460
- /**
2461
- * @fileoverview added by tsickle
2462
- * Generated from: lib/components/totvs-schedule-execution/totvs-schedule-execution.service.ts
2463
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2464
- */
2465
- var TotvsScheduleExecutionService = /** @class */ (function () {
2466
- /**
2467
- * @param {?} http
2468
- */
2469
- function TotvsScheduleExecutionService(http) {
2470
- this.http = http;
2471
- this.headers = { headers: { 'X-PO-Screen-Lock': 'true' } };
2472
- this.urlCadServidor = '/dts/datasul-rest/resources/prg/btb/v1/servidoresExecucao';
2473
- this.urlJobScheduler = '/dts/datasul-rest/resources/prg/framework/v1/jobScheduler';
2474
- this.urlJobExecution = '/dts/datasul-rest/resources/prg/framework/v1/jobExecution';
2475
- }
2476
- /**
2477
- * @param {?} params
2478
- * @return {?}
2479
- */
2480
- TotvsScheduleExecutionService.prototype.getFilteredItems = function (params) {
2481
- /** @type {?} */
2482
- var urlParams = new Array();
2483
- urlParams.push("pageSize=" + params.pageSize.toString());
2484
- urlParams.push("page=" + params.page.toString());
2485
- if (params.filter && params.filter.length > 0) {
2486
- urlParams.push("quickSearch=" + params.filter);
2487
- }
2488
- return this.http.get(this.urlCadServidor + "?" + urlParams.join('&'));
2489
- };
2490
- /**
2491
- * @param {?} id
2492
- * @return {?}
2493
- */
2494
- TotvsScheduleExecutionService.prototype.getObjectByValue = function (id) {
2495
- return this.http.get(this.urlCadServidor + "/" + id, this.headers);
2496
- };
2497
- /**
2498
- * @param {?} parameters
2499
- * @param {?} loading
2500
- * @return {?}
2501
- */
2502
- TotvsScheduleExecutionService.prototype.createExecution = function (parameters, loading) {
2503
- /** @type {?} */
2504
- var params = JSON.parse(JSON.stringify(parameters).replace(/\\\\/g, '*|'));
2505
- if (loading) {
2506
- return this.http.post("" + this.urlJobScheduler, params, this.headers);
2507
- }
2508
- else {
2509
- return this.http.post("" + this.urlJobScheduler, params);
2510
- }
2511
- };
2512
- /**
2513
- * @param {?} executionParams
2514
- * @param {?} loading
2515
- * @return {?}
2516
- */
2517
- TotvsScheduleExecutionService.prototype.createExecutionForNow = function (executionParams, loading) {
2518
- /** @type {?} */
2519
- var jobScheduleParams;
2520
- /** @type {?} */
2521
- var date = new Date();
2522
- /** @type {?} */
2523
- var params = JSON.parse(JSON.stringify(executionParams).replace(/\\\\/g, '*|'));
2524
- if (!params.businessParams || params.businessParams.length === 0) {
2525
- params.businessParams = [{ chave: '', valor: '' }];
2526
- }
2527
- jobScheduleParams = {};
2528
- jobScheduleParams.status = 'active';
2529
- jobScheduleParams.processID = params.programName;
2530
- jobScheduleParams.firstExecution = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + "T" + this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes()) + ":00.000Z";
2531
- jobScheduleParams.recurrent = false;
2532
- jobScheduleParams.executionParameter = {
2533
- parametros: [
2534
- { chave: 'rpwServer', valor: params.executionServer },
2535
- { chave: 'RPW_PROGRAM', valor: params.externalName },
2536
- { chave: 'RPW_PRG_EMS5', valor: params.programEMS5 ? 'yes' : 'no' },
2537
- { chave: 'RPW_PRG_VERS', valor: params.programVersion },
2538
- { parametros_negocio: params.businessParams }
2539
- ]
2540
- };
2541
- if (loading) {
2542
- return this.http.post("" + this.urlJobScheduler, jobScheduleParams, this.headers);
2543
- }
2544
- else {
2545
- return this.http.post("" + this.urlJobScheduler, jobScheduleParams);
2546
- }
2547
- };
2548
- /**
2549
- * @param {?} jobScheduleID
2550
- * @param {?=} loading
2551
- * @return {?}
2552
- */
2553
- TotvsScheduleExecutionService.prototype.getExecutionByJobScheduleID = function (jobScheduleID, loading) {
2554
- var _this = this;
2555
- if (loading === void 0) { loading = false; }
2556
- /** @type {?} */
2557
- var url = this.urlJobExecution + "?jobScheduleID=" + jobScheduleID;
2558
- return this.getExecution(url, loading).pipe(operators.map(( /**
2559
- * @param {?} response
2560
- * @return {?}
2561
- */function (response) { return _this.transformExecution('jobScheduleID', response); })));
2562
- };
2563
- /**
2564
- * @param {?} executionID
2565
- * @param {?=} loading
2566
- * @return {?}
2567
- */
2568
- TotvsScheduleExecutionService.prototype.getExecutionByExecutionID = function (executionID, loading) {
2569
- var _this = this;
2570
- if (loading === void 0) { loading = false; }
2571
- /** @type {?} */
2572
- var url = this.urlJobExecution + "/" + executionID;
2573
- return this.getExecution(url, loading).pipe(operators.map(( /**
2574
- * @param {?} response
2575
- * @return {?}
2576
- */function (response) { return _this.transformExecution('executionID', response); })));
2577
- };
2578
- /**
2579
- * @private
2580
- * @param {?} url
2581
- * @param {?} loading
2582
- * @return {?}
2583
- */
2584
- TotvsScheduleExecutionService.prototype.getExecution = function (url, loading) {
2585
- if (loading) {
2586
- return this.http.get(url, this.headers);
2587
- }
2588
- else {
2589
- return this.http.get(url);
2590
- }
2591
- };
2592
- /**
2593
- * @private
2594
- * @param {?} type
2595
- * @param {?} response
2596
- * @return {?}
2597
- */
2598
- TotvsScheduleExecutionService.prototype.transformExecution = function (type, response) {
2599
- if (!response || !response.items || response.items.length === 0) {
2600
- return;
2601
- }
2602
- response = response.items[0];
2603
- /** @type {?} */
2604
- var execStatus = new ExecutionStatus();
2605
- execStatus.jobScheduleID = response.jobScheduleID;
2606
- execStatus.executionID = response.executionID;
2607
- execStatus.startedDate = response.startedDate;
2608
- execStatus.error = response.error;
2609
- execStatus.status = response.status;
2610
- return execStatus;
2611
- };
2612
- /**
2613
- * @param {?} jobScheduleID
2614
- * @param {?} intervalNum
2615
- * @param {?} fncCallBack
2616
- * @param {?=} loading
2617
- * @return {?}
2618
- */
2619
- TotvsScheduleExecutionService.prototype.followUpExcByJobScheduleID = function (jobScheduleID, intervalNum, fncCallBack, loading) {
2620
- if (loading === void 0) { loading = false; }
2621
- this.followUpExecution('jobScheduleID', jobScheduleID, intervalNum, fncCallBack, loading);
2622
- };
2623
- /**
2624
- * @param {?} executionID
2625
- * @param {?} intervalNum
2626
- * @param {?} fncCallBack
2627
- * @param {?=} loading
2628
- * @return {?}
2629
- */
2630
- TotvsScheduleExecutionService.prototype.followUpExcByExecutionID = function (executionID, intervalNum, fncCallBack, loading) {
2631
- if (loading === void 0) { loading = false; }
2632
- this.followUpExecution('executionID', executionID, intervalNum, fncCallBack, loading);
2633
- };
2634
- /**
2635
- * @private
2636
- * @param {?} type
2637
- * @param {?} execID
2638
- * @param {?} intervalNum
2639
- * @param {?} fncCallBack
2640
- * @param {?} loading
2641
- * @return {?}
2642
- */
2643
- TotvsScheduleExecutionService.prototype.followUpExecution = function (type, execID, intervalNum, fncCallBack, loading) {
2644
- var _this = this;
2645
- this.jobExecutionSubscription$ = null;
2646
- /** @type {?} */
2647
- var intervalID = setInterval(( /**
2648
- * @return {?}
2649
- */function () {
2650
- /** @type {?} */
2651
- var execStatus = new ExecutionStatus();
2652
- execStatus.jobScheduleID = (type === 'jobScheduleID') ? execID : '';
2653
- execStatus.executionID = (type === 'executionID') ? execID : '';
2654
- execStatus.startedDate = null;
2655
- execStatus.error = '';
2656
- execStatus.status = 'PENDING'; // PENDING, RUNNING, SUCCESS, FAILURE
2657
- if (_this.jobExecutionSubscription$) {
2658
- return;
2659
- }
2660
- if (type === 'jobScheduleID') {
2661
- _this.jobExecutionSubscription$ = _this.getExecutionByJobScheduleID(execID, loading)
2662
- .subscribe(( /**
2663
- * @param {?} response
2664
- * @return {?}
2665
- */function (response) {
2666
- _this.followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack);
2667
- }), ( /**
2668
- * @param {?} error
2669
- * @return {?}
2670
- */function (error) {
2671
- _this.followUpExecReturnError(error, execStatus, intervalID, fncCallBack);
2672
- }));
2673
- }
2674
- if (type === 'executionID') {
2675
- _this.jobExecutionSubscription$ = _this.getExecutionByExecutionID(execID, loading)
2676
- .subscribe(( /**
2677
- * @param {?} response
2678
- * @return {?}
2679
- */function (response) {
2680
- _this.followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack);
2681
- }), ( /**
2682
- * @param {?} error
2683
- * @return {?}
2684
- */function (error) {
2685
- _this.followUpExecReturnError(error, execStatus, intervalID, fncCallBack);
2686
- }));
2687
- }
2688
- }), intervalNum);
2689
- };
2690
- /**
2691
- * @private
2692
- * @param {?} execID
2693
- * @param {?} execStatus
2694
- * @param {?} response
2695
- * @param {?} intervalID
2696
- * @param {?} fncCallBack
2697
- * @return {?}
2698
- */
2699
- TotvsScheduleExecutionService.prototype.followUpExecReturnOk = function (execID, execStatus, response, intervalID, fncCallBack) {
2700
- if (response) {
2701
- execStatus = response;
2702
- }
2703
- else {
2704
- execStatus.error = "Agendamento n\u00E3o encontrado com ID: " + execID;
2705
- execStatus.status = 'FAILURE';
2706
- }
2707
- if (!fncCallBack(execStatus) ||
2708
- execStatus.status === 'SUCCESS' ||
2709
- execStatus.status === 'FAILURE') {
2710
- clearInterval(intervalID);
2711
- }
2712
- this.jobExecutionSubscription$ = null;
2713
- };
2714
- /**
2715
- * @private
2716
- * @param {?} error
2717
- * @param {?} execStatus
2718
- * @param {?} intervalID
2719
- * @param {?} fncCallBack
2720
- * @return {?}
2721
- */
2722
- TotvsScheduleExecutionService.prototype.followUpExecReturnError = function (error, execStatus, intervalID, fncCallBack) {
2723
- /** @type {?} */
2724
- var erroDesc = '';
2725
- if (error instanceof i1.HttpErrorResponse) {
2726
- erroDesc = error.message;
2727
- if (error.error) {
2728
- erroDesc = '';
2729
- if (error.error.code) {
2730
- erroDesc = error.error.code;
2731
- }
2732
- if (error.error.message) {
2733
- erroDesc = erroDesc + " - " + error.error.message;
2734
- }
2735
- if (error.error.detailedMessage) {
2736
- erroDesc = erroDesc + " - " + error.error.detailedMessage;
2737
- }
2738
- }
2739
- }
2740
- else {
2741
- erroDesc = error;
2742
- }
2743
- execStatus.error = erroDesc;
2744
- execStatus.status = 'FAILURE';
2745
- fncCallBack(execStatus);
2746
- clearInterval(intervalID);
2747
- this.jobExecutionSubscription$ = null;
2748
- };
2749
- /**
2750
- * @private
2751
- * @param {?} num
2752
- * @return {?}
2753
- */
2754
- TotvsScheduleExecutionService.prototype.addZero = function (num) {
2755
- /** @type {?} */
2756
- var str = "" + num;
2757
- if (num < 10) {
2758
- str = "0" + num;
2759
- }
2760
- return str;
2761
- };
2762
- return TotvsScheduleExecutionService;
2763
- }());
2764
- TotvsScheduleExecutionService.decorators = [
2765
- { type: i0.Injectable }
2766
- ];
2767
- /** @nocollapse */
2768
- TotvsScheduleExecutionService.ctorParameters = function () { return [
2769
- { type: i1.HttpClient }
2770
- ]; };
2771
- if (false) {
2772
- /**
2773
- * @type {?}
2774
- * @private
2775
- */
2776
- TotvsScheduleExecutionService.prototype.headers;
2777
- /**
2778
- * @type {?}
2779
- * @private
2780
- */
2781
- TotvsScheduleExecutionService.prototype.urlCadServidor;
2782
- /**
2783
- * @type {?}
2784
- * @private
2785
- */
2786
- TotvsScheduleExecutionService.prototype.urlJobScheduler;
2787
- /**
2788
- * @type {?}
2789
- * @private
2790
- */
2791
- TotvsScheduleExecutionService.prototype.urlJobExecution;
2792
- /**
2793
- * @type {?}
2794
- * @private
2795
- */
2796
- TotvsScheduleExecutionService.prototype.jobExecutionSubscription$;
2797
- /** @type {?} */
2798
- TotvsScheduleExecutionService.prototype.http;
2799
- }
2800
-
2801
- /**
2802
- * @fileoverview added by tsickle
2803
- * Generated from: lib/components/totvs-schedule-execution/totvs-schedule-execution.component.ts
2804
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2805
- */
2806
- var TotvsScheduleExecutionComponent = /** @class */ (function () {
2807
- /**
2808
- * @param {?} poI18nService
2809
- * @param {?} rpwService
2810
- * @param {?} poNotification
2811
- */
2812
- function TotvsScheduleExecutionComponent(poI18nService, rpwService, poNotification) {
2813
- this.poI18nService = poI18nService;
2814
- this.rpwService = rpwService;
2815
- this.poNotification = poNotification;
2816
- this.programEMS5 = false;
2817
- this.programVersion = '';
2818
- this.disabledParams = false;
2819
- this.loading = false;
2820
- this.endExecution = new i0.EventEmitter();
2821
- this.jsonObject = {};
2822
- this.literals = {};
2823
- }
2824
- /**
2825
- * @return {?}
2826
- */
2827
- TotvsScheduleExecutionComponent.prototype.ngOnInit = function () {
2828
- /* VERIFICAR COMO FICARÁ A TRADUÇÃO
2829
- forkJoin(
2830
- this.poI18nService.getLiterals(),
2831
- this.poI18nService.getLiterals({ context: 'generalRpw' })
2832
- ).subscribe(literals => {
2833
- literals.map(item => Object.assign(this.literals, item) );
2834
- this.setupComponents();
2835
- });*/
2836
- this.setupComponents();
2837
- };
2838
- /**
2839
- * @return {?}
2840
- */
2841
- TotvsScheduleExecutionComponent.prototype.setupComponents = function () {
2842
- this.executionTypeOptions = [
2843
- { label: 'Executar Hoje', value: 1 },
2844
- { label: 'Agendar Execução', value: 2 }
2845
- ];
2846
- this.frequencyOptions = [
2847
- { label: 'Uma vez no dia', value: 'no' },
2848
- { label: 'Várias vezes no dia', value: 'yes' }
2849
- ];
2850
- this.frequencyTypeOptions = [
2851
- { label: 'Hora(s)', value: 'hour' },
2852
- { label: 'Minuto(s)', value: 'minute' }
2853
- ];
2854
- this.weeklyOptions = [
2855
- { label: 'Domingo', value: 'Sunday' },
2856
- { label: 'Segunda', value: 'Monday' },
2857
- { label: 'Terça', value: 'Tuesday' },
2858
- { label: 'Quarta', value: 'Wednesday' },
2859
- { label: 'Quinta', value: 'Thursday' },
2860
- { label: 'Sexta', value: 'Friday' },
2861
- { label: 'Sábado', value: 'Saturday' }
2862
- ];
2863
- this.zoomRpwServiceColumns = [
2864
- { property: 'code', label: 'Servidor', type: 'string', width: '20%' },
2865
- { property: 'name', label: 'Descrição', type: 'string', width: '80%' }
2866
- ];
2867
- this.model = new ScheduleParameters();
2868
- this.model.executionType = 1;
2869
- this.model.repeatType = 1;
2870
- this.model.repeatExecution = false;
2871
- };
2872
- /**
2873
- * @param {?} schParam
2874
- * @return {?}
2875
- */
2876
- TotvsScheduleExecutionComponent.prototype.setScheduleParameters = function (schParam) {
2877
- if (!schParam) {
2878
- return;
2879
- }
2880
- this.model = schParam;
2881
- };
2882
- /**
2883
- * @param {?} value
2884
- * @return {?}
2885
- */
2886
- TotvsScheduleExecutionComponent.prototype.fieldRpwServiceFormat = function (value) {
2887
- return value.code + " - " + value.name;
2888
- };
2889
- /**
2890
- * @return {?}
2891
- */
2892
- TotvsScheduleExecutionComponent.prototype.isExecutionSchedule = function () {
2893
- return (this.model.executionType === 2);
2894
- };
2895
- /**
2896
- * @return {?}
2897
- */
2898
- TotvsScheduleExecutionComponent.prototype.isRepeatExecution = function () {
2899
- return this.model.repeatExecution;
2900
- };
2901
- /**
2902
- * @return {?}
2903
- */
2904
- TotvsScheduleExecutionComponent.prototype.isFrenquency = function () {
2905
- return (this.model.frequency === 'yes');
2906
- };
2907
- /**
2908
- * @return {?}
2909
- */
2910
- TotvsScheduleExecutionComponent.prototype.changeRepeatExecution = function () {
2911
- /** @type {?} */
2912
- var date = new Date();
2913
- if (!this.model.execAppointHourInit) {
2914
- this.model.execAppointHourInit = this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes());
2915
- }
2916
- if (!this.model.execAppointHourFinal) {
2917
- this.model.execAppointHourFinal = this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes());
2918
- }
2919
- this.model.selectWeeklys = [];
2920
- this.model.dayOfMonth = 0;
2921
- this.model.frequency = 'no';
2922
- this.model.frequencyType = 'hour';
2923
- this.model.frequencyValue = 0;
2924
- };
2925
- /**
2926
- * @return {?}
2927
- */
2928
- TotvsScheduleExecutionComponent.prototype.changeExecutionType = function () {
2929
- /** @type {?} */
2930
- var date = new Date();
2931
- this.model.execAppointDate = date;
2932
- this.model.execAppointHour = this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes());
2933
- };
2934
- /**
2935
- * @return {?}
2936
- */
2937
- TotvsScheduleExecutionComponent.prototype.changeTypeFrequency = function () {
2938
- };
2939
- /**
2940
- * @param {?} codTab
2941
- * @return {?}
2942
- */
2943
- TotvsScheduleExecutionComponent.prototype.getActiveTab = function (codTab) {
2944
- return (this.model.repeatType === codTab);
2945
- };
2946
- /**
2947
- * @param {?} codTab
2948
- * @return {?}
2949
- */
2950
- TotvsScheduleExecutionComponent.prototype.setActiveTab = function (codTab) {
2951
- this.model.repeatType = codTab;
2952
- };
2953
- /**
2954
- * @param {?} num
2955
- * @return {?}
2956
- */
2957
- TotvsScheduleExecutionComponent.prototype.addZero = function (num) {
2958
- /** @type {?} */
2959
- var str = "" + num;
2960
- if (num < 10) {
2961
- str = "0" + num;
2962
- }
2963
- return str;
2964
- };
2965
- /**
2966
- * @return {?}
2967
- */
2968
- TotvsScheduleExecutionComponent.prototype.executeSchedule = function () {
2969
- var _this = this;
2970
- if (this.disabledParams) {
2971
- return;
2972
- }
2973
- if (!this.validate()) {
2974
- return;
2975
- }
2976
- this.jsonObject = {};
2977
- this.jsonObject.status = 'active';
2978
- this.jsonObject.processID = this.programName;
2979
- this.jsonObject.recurrent = this.model.repeatExecution;
2980
- this.jsonObject.executionParameter = {};
2981
- if (this.model.executionType === 1) {
2982
- /** @type {?} */
2983
- var date = new Date();
2984
- this.jsonObject.firstExecution = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + "T" + this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes()) + ":00.000Z";
2985
- }
2986
- if (this.model.executionType === 2) {
2987
- this.jsonObject.firstExecution = this.model.execAppointDate + "T" + this.model.execAppointHour + ":00.000Z";
2988
- }
2989
- this.jsonObject.executionParameter.parametros = [];
2990
- this.jsonObject.executionParameter.parametros[0] = { chave: 'rpwServer', valor: this.model.executionServer };
2991
- this.jsonObject.executionParameter.parametros[1] = { chave: 'RPW_PROGRAM', valor: this.externalName };
2992
- this.jsonObject.executionParameter.parametros[2] = { chave: 'RPW_PRG_EMS5', valor: this.programEMS5 ? 'yes' : 'no' };
2993
- this.jsonObject.executionParameter.parametros[3] = { chave: 'RPW_PRG_VERS', valor: this.programVersion };
2994
- this.jsonObject.executionParameter.parametros[4] = {};
2995
- this.jsonObject.executionParameter.parametros[4].parametros_negocio = this.parameters;
2996
- // Executa hoje ou agendada
2997
- this.rpwService.createExecution(this.jsonObject, this.loading).subscribe(( /**
2998
- * @return {?}
2999
- */function () {
3000
- _this.poNotification.success('Agendamento realizado com sucesso !');
3001
- }));
3002
- if (this.model.repeatExecution) {
3003
- if (this.model.repeatType === 1) {
3004
- this.jsonObject.daily = {
3005
- hour: this.getHourOrMinute(this.model.execAppointHourInit, 'h'),
3006
- minute: this.getHourOrMinute(this.model.execAppointHourInit, 'm')
3007
- };
3008
- }
3009
- if (this.model.repeatType === 2) {
3010
- this.jsonObject.weekly = {
3011
- hour: this.getHourOrMinute(this.model.execAppointHourInit, 'h'),
3012
- minute: this.getHourOrMinute(this.model.execAppointHourInit, 'm'),
3013
- daysOfWeek: this.model.selectWeeklys
3014
- };
3015
- }
3016
- if (this.model.repeatType === 3) {
3017
- this.jsonObject.monthly = {
3018
- hour: this.getHourOrMinute(this.model.execAppointHourInit, 'h'),
3019
- minute: this.getHourOrMinute(this.model.execAppointHourInit, 'm'),
3020
- day: this.model.dayOfMonth
3021
- };
3022
- }
3023
- if (this.isFrenquency()) {
3024
- this.jsonObject.rangeExecutions = {
3025
- frequency: {
3026
- type: this.model.frequencyType,
3027
- value: this.model.frequencyValue
3028
- },
3029
- rangeLimit: {
3030
- hour: this.getHourOrMinute(this.model.execAppointHourFinal, 'h'),
3031
- minute: this.getHourOrMinute(this.model.execAppointHourFinal, 'm')
3032
- }
3033
- };
3034
- }
3035
- // Executa a diária, semanal ou mensal
3036
- this.rpwService.createExecution(this.jsonObject, this.loading).subscribe(( /**
3037
- * @return {?}
3038
- */function () {
3039
- }));
3040
- }
3041
- this.endExecution.emit(this.model);
3042
- };
3043
- /**
3044
- * @param {?} value
3045
- * @param {?} type
3046
- * @return {?}
3047
- */
3048
- TotvsScheduleExecutionComponent.prototype.getHourOrMinute = function (value, type) {
3049
- if (type === 'h') {
3050
- return +value.substring(0, 2);
3051
- }
3052
- if (type === 'm') {
3053
- return +value.substring(3, 6);
3054
- }
3055
- };
3056
- /**
3057
- * @param {?} hourInit
3058
- * @param {?} hourFinal
3059
- * @return {?}
3060
- */
3061
- TotvsScheduleExecutionComponent.prototype.compareHour = function (hourInit, hourFinal) {
3062
- if (hourInit === hourFinal) {
3063
- return false;
3064
- }
3065
- if (this.getHourOrMinute(hourInit, 'h') < this.getHourOrMinute(hourFinal, 'h')) {
3066
- return true;
3067
- }
3068
- if (this.getHourOrMinute(hourInit, 'm') > this.getHourOrMinute(hourFinal, 'm')) {
3069
- return false;
3070
- }
3071
- return true;
3072
- };
3073
- /**
3074
- * @return {?}
3075
- */
3076
- TotvsScheduleExecutionComponent.prototype.validate = function () {
3077
- if (!this.scheduleExecutionForm.valid) {
3078
- this.poNotification.error('Verifique as inconsistências em tela.');
3079
- return false;
3080
- }
3081
- if (!this.model.executionServer) {
3082
- this.poNotification.error('Servidor de Execução não foi informado.');
3083
- return false;
3084
- }
3085
- if (this.isExecutionSchedule() && (!this.model.execAppointDate || !this.model.execAppointHour)) {
3086
- this.poNotification.error('Informar a data e a hora para agendamento da execução.');
3087
- return false;
3088
- }
3089
- if (this.model.repeatExecution) {
3090
- if (!this.model.execAppointHourInit) {
3091
- this.poNotification.error('Informar a hora de início para a execução.');
3092
- return false;
3093
- }
3094
- if (this.model.repeatType === 2 && (this.model.selectWeeklys.length === 0)) {
3095
- this.poNotification.error('Informar os dias da semana para a execução.');
3096
- return false;
3097
- }
3098
- if (this.model.repeatType === 3 && (!this.model.dayOfMonth)) {
3099
- this.poNotification.error('Informar o dia para a execução.');
3100
- return false;
3101
- }
3102
- if (this.isFrenquency()) {
3103
- if (!this.compareHour(this.model.execAppointHourInit, this.model.execAppointHourFinal)) {
3104
- this.poNotification.error('Hora Fim deve ser maior que Hora Início.');
3105
- return false;
3106
- }
3107
- if (this.model.frequencyValue === 0) {
3108
- this.poNotification.error('Informar a frequência de execução (A cada hora/minuto).');
3109
- return false;
3110
- }
3111
- }
3112
- }
3113
- return true;
3114
- };
3115
- return TotvsScheduleExecutionComponent;
3116
- }());
3117
- TotvsScheduleExecutionComponent.decorators = [
3118
- { type: i0.Component, args: [{
3119
- selector: 'app-totvs-schedule-execution',
3120
- template: "<form #scheduleExecutionForm=\"ngForm\">\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-radio-group \r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"executionType\"\r\n p-label=\"Data de Execu\u00E7\u00E3o\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.executionType\"\r\n [p-options]=\"executionTypeOptions\"\r\n (p-change)=\"changeExecutionType()\">\r\n </po-radio-group>\r\n\r\n <po-datepicker *ngIf=isExecutionSchedule()\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"model.execAppointDate\"\r\n p-label=\"Agendar para\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointDate\">\r\n </po-datepicker>\r\n\r\n <po-input *ngIf=isExecutionSchedule()\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHour\"\r\n p-label=\"Hora\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHour\">\r\n </po-input>\r\n </div>\r\n\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-lookup\r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"executionServer\"\r\n p-label=\"Servidor de Execu\u00E7\u00E3o\"\r\n p-placeholder=\"Servidor de Execu\u00E7\u00E3o\"\r\n [p-columns]=\"zoomRpwServiceColumns\"\r\n [p-field-format]=\"fieldRpwServiceFormat\"\r\n [p-filter-service]=\"rpwService\"\r\n p-field-label=\"name\"\r\n p-field-value=\"code\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.executionServer\">\r\n </po-lookup>\r\n </div>\r\n\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-switch\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"repeatExecution\"\r\n p-label=\"Repetir ocorr\u00EAncia ?\"\r\n p-label-off=\"N\u00E3o\"\r\n p-label-on=\"Sim\"\r\n [(ngModel)]=\"model.repeatExecution\"\r\n [p-disabled]=\"disabledParams\"\r\n (click)=\"changeRepeatExecution()\">\r\n </po-switch>\r\n </div>\r\n\r\n <div class=\"po-row\" *ngIf=\"isRepeatExecution()\">\r\n \r\n <po-tabs>\r\n\r\n <po-tab \r\n p-label=\"Di\u00E1ria\" \r\n [p-active]=\"getActiveTab(1)\" \r\n (p-click)=\"setActiveTab(1)\">\r\n\r\n <div class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-radio-group \r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"frequencyDaily\"\r\n p-label=\"Frequ\u00EAncia\"\r\n p-columns=1\r\n [(ngModel)]=\"model.frequency\"\r\n [p-disabled]=\"disabledParams\"\r\n [p-options]=\"frequencyOptions\"\r\n (p-change)=\"changeTypeFrequency()\">\r\n </po-radio-group>\r\n </div>\r\n \r\n <div class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"> \r\n <po-input\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourInitDaily\"\r\n p-label=\"Hora In\u00EDcio\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourInit\">\r\n </po-input>\r\n \r\n <po-input *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourFinalDaily\"\r\n p-label=\"Hora Fim\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourFinal\">\r\n </po-input>\r\n \r\n <po-number *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-5 po-md-5 po-lg-5 po-xl-5\"\r\n name=\"frequencyValueDaily\"\r\n p-label=\"A cada\"\r\n p-minlength=\"1\"\r\n p-maxlength=\"3\"\r\n p-min=\"0\"\r\n p-max=\"999\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyValue\">\r\n </po-number>\r\n \r\n <po-select *ngIf=\"isFrenquency()\"\r\n class=\"po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7\"\r\n name=\"frequencyTypeDaily\"\r\n p-label=\"\"\r\n [p-options]=\"frequencyTypeOptions\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyType\">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n\r\n <po-tab \r\n p-label=\"Semanal\"\r\n [p-active]=\"getActiveTab(2)\"\r\n (p-click)=\"setActiveTab(2)\">\r\n\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-multiselect\r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"selectWeeklys\"\r\n p-label=\"Dias da Semana\"\r\n p-placeholder=\"Escolha os dias da semana\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.selectWeeklys\"\r\n [p-options]=\"weeklyOptions\">\r\n </po-multiselect>\r\n </div>\r\n\r\n <div class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-radio-group \r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"frequencyWeekly\"\r\n p-label=\"Frequ\u00EAncia\"\r\n p-columns=1\r\n [(ngModel)]=\"model.frequency\"\r\n [p-disabled]=\"disabledParams\"\r\n [p-options]=\"frequencyOptions\"\r\n (p-change)=\"changeTypeFrequency()\">\r\n </po-radio-group>\r\n </div>\r\n\r\n <div class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-input\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourInitWeekly\"\r\n p-label=\"Hora In\u00EDcio\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourInit\">\r\n </po-input>\r\n\r\n <po-input *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourFinalWeekly\"\r\n p-label=\"Hora Fim\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourFinal\">\r\n </po-input>\r\n\r\n <po-number *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-5 po-md-5 po-lg-5 po-xl-5\"\r\n name=\"frequencyValueWeekly\"\r\n p-label=\"A cada\"\r\n p-minlength=\"1\"\r\n p-maxlength=\"3\"\r\n p-min=\"0\"\r\n p-max=\"999\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyValue\">\r\n </po-number>\r\n\r\n <po-select *ngIf=\"isFrenquency()\"\r\n class=\"po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7\"\r\n name=\"frequencyTypeWeekly\"\r\n p-label=\"\"\r\n [p-options]=\"frequencyTypeOptions\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyType\">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n\r\n <po-tab \r\n p-label=\"Mensal\" \r\n [p-active]=\"getActiveTab(3)\" \r\n (p-click)=\"setActiveTab(3)\">\r\n\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-number\r\n class=\"po-sm-3 po-md-3 po-lg-3 po-xl-3\"\r\n name=\"dayOfMonth\"\r\n p-label=\"Dia do m\u00EAs\"\r\n p-minlength=\"1\"\r\n p-maxlength=\"2\"\r\n p-min=\"0\"\r\n p-max=\"31\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.dayOfMonth\">\r\n </po-number>\r\n </div>\r\n\r\n <div class=\"po-row po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-radio-group \r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"frequencyMonthly\"\r\n p-label=\"Frequ\u00EAncia\"\r\n p-columns=1\r\n [(ngModel)]=\"model.frequency\"\r\n [p-disabled]=\"disabledParams\"\r\n [p-options]=\"frequencyOptions\"\r\n (p-change)=\"changeTypeFrequency()\">\r\n </po-radio-group>\r\n </div>\r\n\r\n <div class=\"po-row po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-input\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourInitMonthly\"\r\n p-label=\"Hora In\u00EDcio\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourInit\">\r\n </po-input>\r\n\r\n <po-input *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourFinalWeekly\"\r\n p-label=\"Hora Fim\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourFinal\">\r\n </po-input>\r\n\r\n <po-number *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-5 po-md-5 po-lg-5 po-xl-5\"\r\n name=\"frequencyValueWeekly\"\r\n p-label=\"A cada\"\r\n p-minlength=\"1\"\r\n p-maxlength=\"3\"\r\n p-min=\"0\"\r\n p-max=\"999\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyValue\">\r\n </po-number>\r\n\r\n <po-select *ngIf=\"isFrenquency()\"\r\n class=\"po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7\"\r\n name=\"frequencyTypeWeekly\"\r\n p-label=\"\"\r\n [p-options]=\"frequencyTypeOptions\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyType\">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n </po-tabs>\r\n </div>\r\n\r\n <div class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\" style=\"padding-top: 15px;\">\r\n <po-button\r\n style=\"float: right;\"\r\n p-label=\"Gerar Agendamento RPW\"\r\n [p-disabled]=\"disabledParams\"\r\n (click)=\"executeSchedule()\">\r\n </po-button>\r\n </div>\r\n</form>\r\n",
3121
- styles: [""]
3122
- }] }
3123
- ];
3124
- /** @nocollapse */
3125
- TotvsScheduleExecutionComponent.ctorParameters = function () { return [
3126
- { type: ngComponents.PoI18nService },
3127
- { type: TotvsScheduleExecutionService },
3128
- { type: ngComponents.PoNotificationService }
3129
- ]; };
3130
- TotvsScheduleExecutionComponent.propDecorators = {
3131
- scheduleExecutionForm: [{ type: i0.ViewChild, args: ['scheduleExecutionForm', { static: true },] }],
3132
- programName: [{ type: i0.Input }],
3133
- externalName: [{ type: i0.Input }],
3134
- programEMS5: [{ type: i0.Input }],
3135
- programVersion: [{ type: i0.Input }],
3136
- parameters: [{ type: i0.Input }],
3137
- disabledParams: [{ type: i0.Input }],
3138
- loading: [{ type: i0.Input }],
3139
- endExecution: [{ type: i0.Output }]
3140
- };
3141
- if (false) {
3142
- /** @type {?} */
3143
- TotvsScheduleExecutionComponent.prototype.scheduleExecutionForm;
3144
- /** @type {?} */
3145
- TotvsScheduleExecutionComponent.prototype.programName;
3146
- /** @type {?} */
3147
- TotvsScheduleExecutionComponent.prototype.externalName;
3148
- /** @type {?} */
3149
- TotvsScheduleExecutionComponent.prototype.programEMS5;
3150
- /** @type {?} */
3151
- TotvsScheduleExecutionComponent.prototype.programVersion;
3152
- /** @type {?} */
3153
- TotvsScheduleExecutionComponent.prototype.parameters;
3154
- /** @type {?} */
3155
- TotvsScheduleExecutionComponent.prototype.disabledParams;
3156
- /** @type {?} */
3157
- TotvsScheduleExecutionComponent.prototype.loading;
3158
- /** @type {?} */
3159
- TotvsScheduleExecutionComponent.prototype.endExecution;
3160
- /** @type {?} */
3161
- TotvsScheduleExecutionComponent.prototype.executionTypeOptions;
3162
- /** @type {?} */
3163
- TotvsScheduleExecutionComponent.prototype.frequencyOptions;
3164
- /** @type {?} */
3165
- TotvsScheduleExecutionComponent.prototype.frequencyTypeOptions;
3166
- /** @type {?} */
3167
- TotvsScheduleExecutionComponent.prototype.weeklyOptions;
3168
- /** @type {?} */
3169
- TotvsScheduleExecutionComponent.prototype.zoomRpwServiceColumns;
3170
- /** @type {?} */
3171
- TotvsScheduleExecutionComponent.prototype.model;
3172
- /**
3173
- * @type {?}
3174
- * @private
3175
- */
3176
- TotvsScheduleExecutionComponent.prototype.jsonObject;
3177
- /** @type {?} */
3178
- TotvsScheduleExecutionComponent.prototype.literals;
3179
- /** @type {?} */
3180
- TotvsScheduleExecutionComponent.prototype.poI18nService;
3181
- /** @type {?} */
3182
- TotvsScheduleExecutionComponent.prototype.rpwService;
3183
- /** @type {?} */
3184
- TotvsScheduleExecutionComponent.prototype.poNotification;
3185
- }
3186
-
3187
- /**
3188
- * @fileoverview added by tsickle
3189
- * Generated from: lib/pipes/dts-date-format.pipe.ts
3190
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3191
- */
3192
- var DtsDateFormatPipe = /** @class */ (function () {
3193
- function DtsDateFormatPipe() {
3194
- }
3195
- /**
3196
- * @param {?} value
3197
- * @param {?=} format
3198
- * @return {?}
3199
- */
3200
- DtsDateFormatPipe.prototype.transform = function (value, format) {
3201
- if (format === void 0) { format = 'dd/MM/yyyy'; }
3202
- var _a = value.split('-'), year = _a[0], month = _a[1], day = _a[2];
3203
- /** @type {?} */
3204
- var formattedDate = format.replace('dd', day)
3205
- .replace('MM', month)
3206
- .replace('yyyy', year);
3207
- return formattedDate;
3208
- };
3209
- return DtsDateFormatPipe;
3210
- }());
3211
- DtsDateFormatPipe.decorators = [
3212
- { type: i0.Pipe, args: [{
3213
- name: 'dtsDateFormat'
3214
- },] }
3215
- ];
3216
-
3217
- /**
3218
- * @fileoverview added by tsickle
3219
- * Generated from: lib/dts-backoffice-util.module.ts
3220
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3221
- */
3222
- var DtsBackofficeUtilsModule = /** @class */ (function () {
3223
- function DtsBackofficeUtilsModule() {
3224
- }
3225
- /**
3226
- * @return {?}
3227
- */
3228
- DtsBackofficeUtilsModule.forRoot = function () {
3229
- return {
3230
- ngModule: DtsBackofficeUtilsModule,
3231
- providers: [TotvsScheduleExecutionService]
3232
- };
3233
- };
3234
- return DtsBackofficeUtilsModule;
3235
- }());
3236
- DtsBackofficeUtilsModule.decorators = [
3237
- { type: i0.NgModule, args: [{
3238
- declarations: [
3239
- TotvsScheduleExecutionComponent,
3240
- DtsDateFormatPipe
3241
- ],
3242
- imports: [
3243
- common.CommonModule,
3244
- ngComponents.PoModule,
3245
- forms.FormsModule,
3246
- i1.HttpClientModule
3247
- ],
3248
- exports: [
3249
- TotvsScheduleExecutionComponent,
3250
- DtsDateFormatPipe
3251
- ],
3252
- providers: [
3253
- TotvsScheduleExecutionService
3254
- ]
3255
- },] }
3256
- ];
3257
-
3258
- /**
3259
- * @fileoverview added by tsickle
3260
- * Generated from: public-api.ts
3261
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3262
- */
3263
-
3264
- /**
3265
- * @fileoverview added by tsickle
3266
- * Generated from: dts-backoffice-util.ts
3267
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3268
- */
3269
-
3270
- exports.BreadcrumbControlService = BreadcrumbControlService;
3271
- exports.CacheParamsService = CacheParamsService;
3272
- exports.DateUtil = DateUtil;
3273
- exports.DisclaimerUtil = DisclaimerUtil;
3274
- exports.DownloadDataParams = DownloadDataParams;
3275
- exports.DtsBackofficeUtilsModule = DtsBackofficeUtilsModule;
3276
- exports.DtsDateFormatPipe = DtsDateFormatPipe;
3277
- exports.ExecutionParameters = ExecutionParameters;
3278
- exports.ExecutionStatus = ExecutionStatus;
3279
- exports.FieldValidationUtil = FieldValidationUtil;
3280
- exports.FileUtil = FileUtil;
3281
- exports.FilterRangeUtil = FilterRangeUtil;
3282
- exports.GenericFunctionsUtils = GenericFunctionsUtils;
3283
- exports.MenuDatasulService = MenuDatasulService;
3284
- exports.ProfileService = ProfileService;
3285
- exports.ReportFormats = ReportFormats;
3286
- exports.ReportService = ReportService;
3287
- exports.ScheduleParameters = ScheduleParameters;
3288
- exports.TotvsScheduleExecutionComponent = TotvsScheduleExecutionComponent;
3289
- exports.TotvsScheduleExecutionService = TotvsScheduleExecutionService;
3290
- exports.TranslateService = TranslateService;
3291
- exports.UserLoginService = UserLoginService;
3292
-
3293
- Object.defineProperty(exports, '__esModule', { value: true });
3294
-
3295
- })));
3296
- //# sourceMappingURL=dts-backoffice-util.umd.js.map