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