dts-backoffice-util 2.8.0 → 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 (58) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +53 -10
  3. package/bundles/dts-backoffice-util.umd.js +477 -1127
  4. package/bundles/dts-backoffice-util.umd.js.map +1 -1
  5. package/bundles/dts-backoffice-util.umd.min.js +1 -1
  6. package/bundles/dts-backoffice-util.umd.min.js.map +1 -1
  7. package/esm2015/dts-backoffice-util.js +3 -2
  8. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +3 -2
  9. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +3 -2
  10. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +3 -2
  11. package/esm2015/lib/dts-backoffice-util.module.js +3 -2
  12. package/esm2015/lib/interfaces/filter-range.interface.js +3 -2
  13. package/esm2015/lib/interfaces/totvs-response.interface.js +3 -2
  14. package/esm2015/lib/model/session-info.model.js +3 -2
  15. package/esm2015/lib/pipes/dts-date-format.pipe.js +3 -2
  16. package/esm2015/lib/services/breadcrumb-control.service.js +3 -2
  17. package/esm2015/lib/services/cache-params.service.js +3 -2
  18. package/esm2015/lib/services/menu-datasul.service.js +3 -2
  19. package/esm2015/lib/services/profile.service.js +3 -2
  20. package/esm2015/lib/services/report.service.js +7 -6
  21. package/esm2015/lib/services/session-info.service.js +3 -2
  22. package/esm2015/lib/services/translate.service.js +3 -2
  23. package/esm2015/lib/utils/date.util.js +3 -2
  24. package/esm2015/lib/utils/disclaimer.util.js +3 -2
  25. package/esm2015/lib/utils/field-validation.util.js +3 -2
  26. package/esm2015/lib/utils/file.util.js +21 -10
  27. package/esm2015/lib/utils/filter-range.util.js +3 -2
  28. package/esm2015/lib/utils/generic-functions.utils.js +3 -2
  29. package/esm2015/public-api.js +3 -2
  30. package/fesm2015/dts-backoffice-util.js +66 -34
  31. package/fesm2015/dts-backoffice-util.js.map +1 -1
  32. package/lib/utils/file.util.d.ts +1 -1
  33. package/package.json +8 -7
  34. package/esm5/dts-backoffice-util.js +0 -9
  35. package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +0 -448
  36. package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +0 -143
  37. package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +0 -434
  38. package/esm5/lib/dts-backoffice-util.module.js +0 -53
  39. package/esm5/lib/interfaces/filter-range.interface.js +0 -47
  40. package/esm5/lib/interfaces/totvs-response.interface.js +0 -16
  41. package/esm5/lib/model/session-info.model.js +0 -239
  42. package/esm5/lib/pipes/dts-date-format.pipe.js +0 -36
  43. package/esm5/lib/services/breadcrumb-control.service.js +0 -157
  44. package/esm5/lib/services/cache-params.service.js +0 -61
  45. package/esm5/lib/services/menu-datasul.service.js +0 -92
  46. package/esm5/lib/services/profile.service.js +0 -146
  47. package/esm5/lib/services/report.service.js +0 -137
  48. package/esm5/lib/services/session-info.service.js +0 -64
  49. package/esm5/lib/services/translate.service.js +0 -47
  50. package/esm5/lib/utils/date.util.js +0 -135
  51. package/esm5/lib/utils/disclaimer.util.js +0 -930
  52. package/esm5/lib/utils/field-validation.util.js +0 -358
  53. package/esm5/lib/utils/file.util.js +0 -251
  54. package/esm5/lib/utils/filter-range.util.js +0 -69
  55. package/esm5/lib/utils/generic-functions.utils.js +0 -358
  56. package/esm5/public-api.js +0 -37
  57. package/fesm5/dts-backoffice-util.js +0 -3933
  58. package/fesm5/dts-backoffice-util.js.map +0 -1
@@ -1,3933 +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 {?} datab64
2531
- * @param {?} fileName
2532
- * @param {?=} contentType
2533
- * @return {?}
2534
- */
2535
- FileUtil.downloadFile = /**
2536
- * @param {?} datab64
2537
- * @param {?} fileName
2538
- * @param {?=} contentType
2539
- * @return {?}
2540
- */
2541
- function (datab64, fileName, contentType) {
2542
- /** @type {?} */
2543
- var dataBlob = this.b64toBlob(datab64, contentType);
2544
- this.download(dataBlob, fileName);
2545
- };
2546
- /**
2547
- * @param {?} data
2548
- * @param {?=} dwldDataParam
2549
- * @return {?}
2550
- */
2551
- FileUtil.downloadData = /**
2552
- * @param {?} data
2553
- * @param {?=} dwldDataParam
2554
- * @return {?}
2555
- */
2556
- function (data, dwldDataParam) {
2557
- if (dwldDataParam === void 0) { dwldDataParam = null; }
2558
- if (!data) {
2559
- return;
2560
- }
2561
- if (!dwldDataParam) {
2562
- dwldDataParam = new DownloadDataParams();
2563
- }
2564
- if (!dwldDataParam.fileName) {
2565
- dwldDataParam.fileName = 'data.csv';
2566
- }
2567
- if (!dwldDataParam.literals) {
2568
- dwldDataParam.literals = {};
2569
- }
2570
- if (!dwldDataParam.columnDelimiter) {
2571
- dwldDataParam.columnDelimiter = ';';
2572
- }
2573
- if (!dwldDataParam.columnList) {
2574
- dwldDataParam.columnList = [];
2575
- }
2576
- if (!dwldDataParam.columnExclude) {
2577
- dwldDataParam.columnExclude = [];
2578
- }
2579
- /** @type {?} */
2580
- var datab64 = btoa(this.jsonToString(data, dwldDataParam));
2581
- this.downloadFile(datab64, dwldDataParam.fileName, 'text/csv');
2582
- };
2583
- /**
2584
- * @private
2585
- * @param {?} file
2586
- * @param {?} fileName
2587
- * @return {?}
2588
- */
2589
- FileUtil.download = /**
2590
- * @private
2591
- * @param {?} file
2592
- * @param {?} fileName
2593
- * @return {?}
2594
- */
2595
- function (file, fileName) {
2596
- /** @type {?} */
2597
- var binaryData = [file];
2598
- /** @type {?} */
2599
- var downloadLink = document.createElement('a');
2600
- /** @type {?} */
2601
- var urlDownload = window.URL.createObjectURL(new Blob(binaryData, { type: file.type }));
2602
- /**Verifica se é ie ou edge, pois o mesmo tem tratamento próprio para arquivos blob */
2603
- if (navigator.userAgent.toUpperCase().indexOf('.NET') > 0 || navigator.userAgent.toUpperCase().indexOf('EDGE') > 0) {
2604
- window.navigator.msSaveOrOpenBlob(file, fileName);
2605
- }
2606
- else {
2607
- downloadLink.href = urlDownload;
2608
- downloadLink.setAttribute('download', fileName);
2609
- document.body.appendChild(downloadLink);
2610
- downloadLink.click();
2611
- window.URL.revokeObjectURL(urlDownload);
2612
- downloadLink.remove();
2613
- }
2614
- };
2615
- /**
2616
- * @private
2617
- * @param {?} b64Data
2618
- * @param {?=} contentType
2619
- * @param {?=} sliceSize
2620
- * @return {?}
2621
- */
2622
- FileUtil.b64toBlob = /**
2623
- * @private
2624
- * @param {?} b64Data
2625
- * @param {?=} contentType
2626
- * @param {?=} sliceSize
2627
- * @return {?}
2628
- */
2629
- function (b64Data, contentType, sliceSize) {
2630
- contentType = contentType || '';
2631
- sliceSize = sliceSize || 512;
2632
- /** @type {?} */
2633
- var byteCharacters = atob(b64Data);
2634
- /** @type {?} */
2635
- var byteArrays = [];
2636
- for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
2637
- /** @type {?} */
2638
- var slice = byteCharacters.slice(offset, offset + sliceSize);
2639
- /** @type {?} */
2640
- var byteNumbers = new Array(slice.length);
2641
- for (var i = 0; i < slice.length; i++) {
2642
- byteNumbers[i] = slice.charCodeAt(i);
2643
- }
2644
- /** @type {?} */
2645
- var byteArray = new Uint8Array(byteNumbers);
2646
- byteArrays.push(byteArray);
2647
- }
2648
- /** @type {?} */
2649
- var blob = new Blob(byteArrays, { type: contentType });
2650
- return blob;
2651
- };
2652
- /**
2653
- * @private
2654
- * @param {?} jsonData
2655
- * @param {?} dwldDataParam
2656
- * @return {?}
2657
- */
2658
- FileUtil.jsonToString = /**
2659
- * @private
2660
- * @param {?} jsonData
2661
- * @param {?} dwldDataParam
2662
- * @return {?}
2663
- */
2664
- function (jsonData, dwldDataParam) {
2665
- if (!jsonData || jsonData.length === 0) {
2666
- return '';
2667
- }
2668
- /** @type {?} */
2669
- var lineDelimiter = '\n';
2670
- /** @type {?} */
2671
- var columnHeader = null;
2672
- /** @type {?} */
2673
- var keys = [];
2674
- /** @type {?} */
2675
- var includeKey;
2676
- Object.keys(jsonData[0]).forEach((/**
2677
- * @param {?} key
2678
- * @return {?}
2679
- */
2680
- function (key) {
2681
- includeKey = true;
2682
- if (dwldDataParam.columnList.length > 0 && dwldDataParam.columnList.indexOf(key) === -1) {
2683
- includeKey = false;
2684
- }
2685
- if (dwldDataParam.columnExclude.length > 0 && dwldDataParam.columnExclude.indexOf(key) !== -1) {
2686
- includeKey = false;
2687
- }
2688
- if (includeKey) {
2689
- keys.push(key);
2690
- columnHeader = (!columnHeader) ? '' : columnHeader + dwldDataParam.columnDelimiter;
2691
- columnHeader += (dwldDataParam.literals[key]) ? dwldDataParam.literals[key] : key;
2692
- }
2693
- }));
2694
- /** @type {?} */
2695
- var lineStr = jsonData.reduce((/**
2696
- * @param {?} accLineStr
2697
- * @param {?} currentItem
2698
- * @return {?}
2699
- */
2700
- function (accLineStr, currentItem) {
2701
- /** @type {?} */
2702
- var first = true;
2703
- /** @type {?} */
2704
- var columnValue = null;
2705
- keys.forEach((/**
2706
- * @param {?} key
2707
- * @return {?}
2708
- */
2709
- function (key) {
2710
- if (!first) {
2711
- accLineStr += dwldDataParam.columnDelimiter;
2712
- }
2713
- columnValue = currentItem[key];
2714
- if (columnValue === null || columnValue === undefined) {
2715
- columnValue = '';
2716
- }
2717
- switch (typeof (columnValue)) {
2718
- case 'number':
2719
- columnValue = columnValue.toLocaleString();
2720
- break;
2721
- case 'boolean':
2722
- columnValue = (dwldDataParam.literals["" + columnValue]) ?
2723
- dwldDataParam.literals["" + columnValue] : columnValue;
2724
- break;
2725
- case 'object':
2726
- columnValue = JSON.stringify(columnValue);
2727
- }
2728
- accLineStr += columnValue;
2729
- first = false;
2730
- }));
2731
- return accLineStr + lineDelimiter;
2732
- }), columnHeader + lineDelimiter);
2733
- return lineStr;
2734
- };
2735
- return FileUtil;
2736
- }());
2737
- /**
2738
- * @record
2739
- */
2740
- function IDownloadDataParams() { }
2741
- if (false) {
2742
- /** @type {?} */
2743
- IDownloadDataParams.prototype.fileName;
2744
- /** @type {?} */
2745
- IDownloadDataParams.prototype.literals;
2746
- /** @type {?} */
2747
- IDownloadDataParams.prototype.columnDelimiter;
2748
- /** @type {?} */
2749
- IDownloadDataParams.prototype.columnList;
2750
- /** @type {?} */
2751
- IDownloadDataParams.prototype.columnExclude;
2752
- }
2753
- var DownloadDataParams = /** @class */ (function () {
2754
- function DownloadDataParams() {
2755
- }
2756
- return DownloadDataParams;
2757
- }());
2758
- if (false) {
2759
- /** @type {?} */
2760
- DownloadDataParams.prototype.fileName;
2761
- /** @type {?} */
2762
- DownloadDataParams.prototype.literals;
2763
- /** @type {?} */
2764
- DownloadDataParams.prototype.columnDelimiter;
2765
- /** @type {?} */
2766
- DownloadDataParams.prototype.columnList;
2767
- /** @type {?} */
2768
- DownloadDataParams.prototype.columnExclude;
2769
- }
2770
-
2771
- /**
2772
- * @fileoverview added by tsickle
2773
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2774
- */
2775
- /**
2776
- * @record
2777
- * @template T
2778
- */
2779
- function TotvsResponse() { }
2780
- if (false) {
2781
- /** @type {?} */
2782
- TotvsResponse.prototype.items;
2783
- /** @type {?|undefined} */
2784
- TotvsResponse.prototype.hasNext;
2785
- }
2786
-
2787
- /**
2788
- * @fileoverview added by tsickle
2789
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2790
- */
2791
- /**
2792
- * @record
2793
- */
2794
- function IFilterRangeCharacter() { }
2795
- if (false) {
2796
- /** @type {?} */
2797
- IFilterRangeCharacter.prototype.iniInitial;
2798
- /** @type {?} */
2799
- IFilterRangeCharacter.prototype.iniFinal;
2800
- /** @type {?} */
2801
- IFilterRangeCharacter.prototype.valInitial;
2802
- /** @type {?} */
2803
- IFilterRangeCharacter.prototype.valFinal;
2804
- }
2805
- /**
2806
- * @record
2807
- */
2808
- function IFilterRangeNumber() { }
2809
- if (false) {
2810
- /** @type {?} */
2811
- IFilterRangeNumber.prototype.iniInitial;
2812
- /** @type {?} */
2813
- IFilterRangeNumber.prototype.iniFinal;
2814
- /** @type {?} */
2815
- IFilterRangeNumber.prototype.valInitial;
2816
- /** @type {?} */
2817
- IFilterRangeNumber.prototype.valFinal;
2818
- }
2819
- /**
2820
- * @record
2821
- */
2822
- function IFilterRangeDate() { }
2823
- if (false) {
2824
- /** @type {?} */
2825
- IFilterRangeDate.prototype.iniInitial;
2826
- /** @type {?} */
2827
- IFilterRangeDate.prototype.iniFinal;
2828
- /** @type {?} */
2829
- IFilterRangeDate.prototype.valInitial;
2830
- /** @type {?} */
2831
- IFilterRangeDate.prototype.valFinal;
2832
- }
2833
-
2834
- /**
2835
- * @fileoverview added by tsickle
2836
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2837
- */
2838
- /**
2839
- * @record
2840
- */
2841
- function IScheduleParameters() { }
2842
- if (false) {
2843
- /** @type {?} */
2844
- IScheduleParameters.prototype.executionType;
2845
- /** @type {?} */
2846
- IScheduleParameters.prototype.execAppointDate;
2847
- /** @type {?} */
2848
- IScheduleParameters.prototype.execAppointHour;
2849
- /** @type {?} */
2850
- IScheduleParameters.prototype.executionServer;
2851
- /** @type {?} */
2852
- IScheduleParameters.prototype.repeatExecution;
2853
- /** @type {?} */
2854
- IScheduleParameters.prototype.repeatType;
2855
- /** @type {?} */
2856
- IScheduleParameters.prototype.frequency;
2857
- /** @type {?} */
2858
- IScheduleParameters.prototype.frequencyValue;
2859
- /** @type {?} */
2860
- IScheduleParameters.prototype.frequencyType;
2861
- /** @type {?} */
2862
- IScheduleParameters.prototype.execAppointHourInit;
2863
- /** @type {?} */
2864
- IScheduleParameters.prototype.execAppointHourFinal;
2865
- /** @type {?} */
2866
- IScheduleParameters.prototype.selectWeeklys;
2867
- /** @type {?} */
2868
- IScheduleParameters.prototype.dayOfMonth;
2869
- }
2870
- var ScheduleParameters = /** @class */ (function () {
2871
- function ScheduleParameters() {
2872
- }
2873
- return ScheduleParameters;
2874
- }());
2875
- if (false) {
2876
- /** @type {?} */
2877
- ScheduleParameters.prototype.executionType;
2878
- /** @type {?} */
2879
- ScheduleParameters.prototype.execAppointDate;
2880
- /** @type {?} */
2881
- ScheduleParameters.prototype.execAppointHour;
2882
- /** @type {?} */
2883
- ScheduleParameters.prototype.executionServer;
2884
- /** @type {?} */
2885
- ScheduleParameters.prototype.repeatExecution;
2886
- /** @type {?} */
2887
- ScheduleParameters.prototype.repeatType;
2888
- /** @type {?} */
2889
- ScheduleParameters.prototype.frequency;
2890
- /** @type {?} */
2891
- ScheduleParameters.prototype.frequencyValue;
2892
- /** @type {?} */
2893
- ScheduleParameters.prototype.frequencyType;
2894
- /** @type {?} */
2895
- ScheduleParameters.prototype.execAppointHourInit;
2896
- /** @type {?} */
2897
- ScheduleParameters.prototype.execAppointHourFinal;
2898
- /** @type {?} */
2899
- ScheduleParameters.prototype.selectWeeklys;
2900
- /** @type {?} */
2901
- ScheduleParameters.prototype.dayOfMonth;
2902
- }
2903
- /**
2904
- * @record
2905
- */
2906
- function IExecutionStatus() { }
2907
- if (false) {
2908
- /** @type {?} */
2909
- IExecutionStatus.prototype.jobScheduleID;
2910
- /** @type {?} */
2911
- IExecutionStatus.prototype.executionID;
2912
- /** @type {?} */
2913
- IExecutionStatus.prototype.startedDate;
2914
- /** @type {?} */
2915
- IExecutionStatus.prototype.error;
2916
- /** @type {?} */
2917
- IExecutionStatus.prototype.status;
2918
- }
2919
- var ExecutionStatus = /** @class */ (function () {
2920
- function ExecutionStatus() {
2921
- }
2922
- return ExecutionStatus;
2923
- }());
2924
- if (false) {
2925
- /** @type {?} */
2926
- ExecutionStatus.prototype.jobScheduleID;
2927
- /** @type {?} */
2928
- ExecutionStatus.prototype.executionID;
2929
- /** @type {?} */
2930
- ExecutionStatus.prototype.startedDate;
2931
- /** @type {?} */
2932
- ExecutionStatus.prototype.error;
2933
- /** @type {?} */
2934
- ExecutionStatus.prototype.status;
2935
- }
2936
- /**
2937
- * @record
2938
- */
2939
- function IExecutionParameters() { }
2940
- if (false) {
2941
- /** @type {?} */
2942
- IExecutionParameters.prototype.executionServer;
2943
- /** @type {?} */
2944
- IExecutionParameters.prototype.programName;
2945
- /** @type {?} */
2946
- IExecutionParameters.prototype.externalName;
2947
- /** @type {?} */
2948
- IExecutionParameters.prototype.programEMS5;
2949
- /** @type {?} */
2950
- IExecutionParameters.prototype.programVersion;
2951
- /** @type {?} */
2952
- IExecutionParameters.prototype.businessParams;
2953
- }
2954
- var ExecutionParameters = /** @class */ (function () {
2955
- function ExecutionParameters() {
2956
- }
2957
- return ExecutionParameters;
2958
- }());
2959
- if (false) {
2960
- /** @type {?} */
2961
- ExecutionParameters.prototype.executionServer;
2962
- /** @type {?} */
2963
- ExecutionParameters.prototype.programName;
2964
- /** @type {?} */
2965
- ExecutionParameters.prototype.externalName;
2966
- /** @type {?} */
2967
- ExecutionParameters.prototype.programEMS5;
2968
- /** @type {?} */
2969
- ExecutionParameters.prototype.programVersion;
2970
- /** @type {?} */
2971
- ExecutionParameters.prototype.businessParams;
2972
- }
2973
-
2974
- /**
2975
- * @fileoverview added by tsickle
2976
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2977
- */
2978
- var TotvsScheduleExecutionService = /** @class */ (function () {
2979
- function TotvsScheduleExecutionService(http) {
2980
- this.http = http;
2981
- this.headers = { headers: { 'X-PO-Screen-Lock': 'true' } };
2982
- this.urlCadServidor = '/dts/datasul-rest/resources/prg/btb/v1/servidoresExecucao';
2983
- this.urlJobScheduler = '/dts/datasul-rest/resources/prg/framework/v1/jobScheduler';
2984
- this.urlJobExecution = '/dts/datasul-rest/resources/prg/framework/v1/jobExecution';
2985
- }
2986
- /**
2987
- * @param {?} params
2988
- * @return {?}
2989
- */
2990
- TotvsScheduleExecutionService.prototype.getFilteredItems = /**
2991
- * @param {?} params
2992
- * @return {?}
2993
- */
2994
- function (params) {
2995
- /** @type {?} */
2996
- var urlParams = new Array();
2997
- urlParams.push("pageSize=" + params.pageSize.toString());
2998
- urlParams.push("page=" + params.page.toString());
2999
- if (params.filter && params.filter.length > 0) {
3000
- urlParams.push("quickSearch=" + params.filter);
3001
- }
3002
- return this.http.get(this.urlCadServidor + "?" + urlParams.join('&'));
3003
- };
3004
- /**
3005
- * @param {?} id
3006
- * @return {?}
3007
- */
3008
- TotvsScheduleExecutionService.prototype.getObjectByValue = /**
3009
- * @param {?} id
3010
- * @return {?}
3011
- */
3012
- function (id) {
3013
- return this.http.get(this.urlCadServidor + "/" + id, this.headers);
3014
- };
3015
- /**
3016
- * @param {?} parameters
3017
- * @param {?} loading
3018
- * @return {?}
3019
- */
3020
- TotvsScheduleExecutionService.prototype.createExecution = /**
3021
- * @param {?} parameters
3022
- * @param {?} loading
3023
- * @return {?}
3024
- */
3025
- function (parameters, loading) {
3026
- /** @type {?} */
3027
- var params = JSON.parse(JSON.stringify(parameters).replace(/\\\\/g, '*|'));
3028
- if (loading) {
3029
- return this.http.post("" + this.urlJobScheduler, params, this.headers);
3030
- }
3031
- else {
3032
- return this.http.post("" + this.urlJobScheduler, params);
3033
- }
3034
- };
3035
- /**
3036
- * @param {?} executionParams
3037
- * @param {?} loading
3038
- * @return {?}
3039
- */
3040
- TotvsScheduleExecutionService.prototype.createExecutionForNow = /**
3041
- * @param {?} executionParams
3042
- * @param {?} loading
3043
- * @return {?}
3044
- */
3045
- function (executionParams, loading) {
3046
- /** @type {?} */
3047
- var jobScheduleParams;
3048
- /** @type {?} */
3049
- var date = new Date();
3050
- /** @type {?} */
3051
- var params = JSON.parse(JSON.stringify(executionParams).replace(/\\\\/g, '*|'));
3052
- if (!params.businessParams || params.businessParams.length === 0) {
3053
- params.businessParams = [{ chave: '', valor: '' }];
3054
- }
3055
- jobScheduleParams = {};
3056
- jobScheduleParams.status = 'active';
3057
- jobScheduleParams.processID = params.programName;
3058
- jobScheduleParams.firstExecution = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + "T" + this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes()) + ":00.000Z";
3059
- jobScheduleParams.recurrent = false;
3060
- jobScheduleParams.executionParameter = {
3061
- parametros: [
3062
- { chave: 'rpwServer', valor: params.executionServer },
3063
- { chave: 'RPW_PROGRAM', valor: params.externalName },
3064
- { chave: 'RPW_PRG_EMS5', valor: params.programEMS5 ? 'yes' : 'no' },
3065
- { chave: 'RPW_PRG_VERS', valor: params.programVersion },
3066
- { parametros_negocio: params.businessParams }
3067
- ]
3068
- };
3069
- if (loading) {
3070
- return this.http.post("" + this.urlJobScheduler, jobScheduleParams, this.headers);
3071
- }
3072
- else {
3073
- return this.http.post("" + this.urlJobScheduler, jobScheduleParams);
3074
- }
3075
- };
3076
- /**
3077
- * @param {?} jobScheduleID
3078
- * @param {?=} loading
3079
- * @return {?}
3080
- */
3081
- TotvsScheduleExecutionService.prototype.getExecutionByJobScheduleID = /**
3082
- * @param {?} jobScheduleID
3083
- * @param {?=} loading
3084
- * @return {?}
3085
- */
3086
- function (jobScheduleID, loading) {
3087
- var _this = this;
3088
- if (loading === void 0) { loading = false; }
3089
- /** @type {?} */
3090
- var url = this.urlJobExecution + "?jobScheduleID=" + jobScheduleID;
3091
- return this.getExecution(url, loading).pipe(map((/**
3092
- * @param {?} response
3093
- * @return {?}
3094
- */
3095
- function (response) { return _this.transformExecution('jobScheduleID', response); })));
3096
- };
3097
- /**
3098
- * @param {?} executionID
3099
- * @param {?=} loading
3100
- * @return {?}
3101
- */
3102
- TotvsScheduleExecutionService.prototype.getExecutionByExecutionID = /**
3103
- * @param {?} executionID
3104
- * @param {?=} loading
3105
- * @return {?}
3106
- */
3107
- function (executionID, loading) {
3108
- var _this = this;
3109
- if (loading === void 0) { loading = false; }
3110
- /** @type {?} */
3111
- var url = this.urlJobExecution + "/" + executionID;
3112
- return this.getExecution(url, loading).pipe(map((/**
3113
- * @param {?} response
3114
- * @return {?}
3115
- */
3116
- function (response) { return _this.transformExecution('executionID', response); })));
3117
- };
3118
- /**
3119
- * @private
3120
- * @param {?} url
3121
- * @param {?} loading
3122
- * @return {?}
3123
- */
3124
- TotvsScheduleExecutionService.prototype.getExecution = /**
3125
- * @private
3126
- * @param {?} url
3127
- * @param {?} loading
3128
- * @return {?}
3129
- */
3130
- function (url, loading) {
3131
- if (loading) {
3132
- return this.http.get(url, this.headers);
3133
- }
3134
- else {
3135
- return this.http.get(url);
3136
- }
3137
- };
3138
- /**
3139
- * @private
3140
- * @param {?} type
3141
- * @param {?} response
3142
- * @return {?}
3143
- */
3144
- TotvsScheduleExecutionService.prototype.transformExecution = /**
3145
- * @private
3146
- * @param {?} type
3147
- * @param {?} response
3148
- * @return {?}
3149
- */
3150
- function (type, response) {
3151
- if (!response || !response.items || response.items.length === 0) {
3152
- return;
3153
- }
3154
- response = response.items[0];
3155
- /** @type {?} */
3156
- var execStatus = new ExecutionStatus();
3157
- execStatus.jobScheduleID = response.jobScheduleID;
3158
- execStatus.executionID = response.executionID;
3159
- execStatus.startedDate = response.startedDate;
3160
- execStatus.error = response.error;
3161
- execStatus.status = response.status;
3162
- return execStatus;
3163
- };
3164
- /**
3165
- * @param {?} jobScheduleID
3166
- * @param {?} intervalNum
3167
- * @param {?} fncCallBack
3168
- * @param {?=} loading
3169
- * @return {?}
3170
- */
3171
- TotvsScheduleExecutionService.prototype.followUpExcByJobScheduleID = /**
3172
- * @param {?} jobScheduleID
3173
- * @param {?} intervalNum
3174
- * @param {?} fncCallBack
3175
- * @param {?=} loading
3176
- * @return {?}
3177
- */
3178
- function (jobScheduleID, intervalNum, fncCallBack, loading) {
3179
- if (loading === void 0) { loading = false; }
3180
- this.followUpExecution('jobScheduleID', jobScheduleID, intervalNum, fncCallBack, loading);
3181
- };
3182
- /**
3183
- * @param {?} executionID
3184
- * @param {?} intervalNum
3185
- * @param {?} fncCallBack
3186
- * @param {?=} loading
3187
- * @return {?}
3188
- */
3189
- TotvsScheduleExecutionService.prototype.followUpExcByExecutionID = /**
3190
- * @param {?} executionID
3191
- * @param {?} intervalNum
3192
- * @param {?} fncCallBack
3193
- * @param {?=} loading
3194
- * @return {?}
3195
- */
3196
- function (executionID, intervalNum, fncCallBack, loading) {
3197
- if (loading === void 0) { loading = false; }
3198
- this.followUpExecution('executionID', executionID, intervalNum, fncCallBack, loading);
3199
- };
3200
- /**
3201
- * @private
3202
- * @param {?} type
3203
- * @param {?} execID
3204
- * @param {?} intervalNum
3205
- * @param {?} fncCallBack
3206
- * @param {?} loading
3207
- * @return {?}
3208
- */
3209
- TotvsScheduleExecutionService.prototype.followUpExecution = /**
3210
- * @private
3211
- * @param {?} type
3212
- * @param {?} execID
3213
- * @param {?} intervalNum
3214
- * @param {?} fncCallBack
3215
- * @param {?} loading
3216
- * @return {?}
3217
- */
3218
- function (type, execID, intervalNum, fncCallBack, loading) {
3219
- var _this = this;
3220
- this.jobExecutionSubscription$ = null;
3221
- /** @type {?} */
3222
- var intervalID = setInterval((/**
3223
- * @return {?}
3224
- */
3225
- function () {
3226
- /** @type {?} */
3227
- var execStatus = new ExecutionStatus();
3228
- execStatus.jobScheduleID = (type === 'jobScheduleID') ? execID : '';
3229
- execStatus.executionID = (type === 'executionID') ? execID : '';
3230
- execStatus.startedDate = null;
3231
- execStatus.error = '';
3232
- execStatus.status = 'PENDING'; // PENDING, RUNNING, SUCCESS, FAILURE
3233
- if (_this.jobExecutionSubscription$) {
3234
- return;
3235
- }
3236
- if (type === 'jobScheduleID') {
3237
- _this.jobExecutionSubscription$ = _this.getExecutionByJobScheduleID(execID, loading)
3238
- .subscribe((/**
3239
- * @param {?} response
3240
- * @return {?}
3241
- */
3242
- function (response) {
3243
- _this.followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack);
3244
- }), (/**
3245
- * @param {?} error
3246
- * @return {?}
3247
- */
3248
- function (error) {
3249
- _this.followUpExecReturnError(error, execStatus, intervalID, fncCallBack);
3250
- }));
3251
- }
3252
- if (type === 'executionID') {
3253
- _this.jobExecutionSubscription$ = _this.getExecutionByExecutionID(execID, loading)
3254
- .subscribe((/**
3255
- * @param {?} response
3256
- * @return {?}
3257
- */
3258
- function (response) {
3259
- _this.followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack);
3260
- }), (/**
3261
- * @param {?} error
3262
- * @return {?}
3263
- */
3264
- function (error) {
3265
- _this.followUpExecReturnError(error, execStatus, intervalID, fncCallBack);
3266
- }));
3267
- }
3268
- }), intervalNum);
3269
- };
3270
- /**
3271
- * @private
3272
- * @param {?} execID
3273
- * @param {?} execStatus
3274
- * @param {?} response
3275
- * @param {?} intervalID
3276
- * @param {?} fncCallBack
3277
- * @return {?}
3278
- */
3279
- TotvsScheduleExecutionService.prototype.followUpExecReturnOk = /**
3280
- * @private
3281
- * @param {?} execID
3282
- * @param {?} execStatus
3283
- * @param {?} response
3284
- * @param {?} intervalID
3285
- * @param {?} fncCallBack
3286
- * @return {?}
3287
- */
3288
- function (execID, execStatus, response, intervalID, fncCallBack) {
3289
- if (response) {
3290
- execStatus = response;
3291
- }
3292
- else {
3293
- execStatus.error = "Agendamento n\u00E3o encontrado com ID: " + execID;
3294
- execStatus.status = 'FAILURE';
3295
- }
3296
- if (!fncCallBack(execStatus) ||
3297
- execStatus.status === 'SUCCESS' ||
3298
- execStatus.status === 'FAILURE') {
3299
- clearInterval(intervalID);
3300
- }
3301
- this.jobExecutionSubscription$ = null;
3302
- };
3303
- /**
3304
- * @private
3305
- * @param {?} error
3306
- * @param {?} execStatus
3307
- * @param {?} intervalID
3308
- * @param {?} fncCallBack
3309
- * @return {?}
3310
- */
3311
- TotvsScheduleExecutionService.prototype.followUpExecReturnError = /**
3312
- * @private
3313
- * @param {?} error
3314
- * @param {?} execStatus
3315
- * @param {?} intervalID
3316
- * @param {?} fncCallBack
3317
- * @return {?}
3318
- */
3319
- function (error, execStatus, intervalID, fncCallBack) {
3320
- /** @type {?} */
3321
- var erroDesc = '';
3322
- if (error instanceof HttpErrorResponse) {
3323
- erroDesc = error.message;
3324
- if (error.error) {
3325
- erroDesc = '';
3326
- if (error.error.code) {
3327
- erroDesc = error.error.code;
3328
- }
3329
- if (error.error.message) {
3330
- erroDesc = erroDesc + " - " + error.error.message;
3331
- }
3332
- if (error.error.detailedMessage) {
3333
- erroDesc = erroDesc + " - " + error.error.detailedMessage;
3334
- }
3335
- }
3336
- }
3337
- else {
3338
- erroDesc = error;
3339
- }
3340
- execStatus.error = erroDesc;
3341
- execStatus.status = 'FAILURE';
3342
- fncCallBack(execStatus);
3343
- clearInterval(intervalID);
3344
- this.jobExecutionSubscription$ = null;
3345
- };
3346
- /**
3347
- * @private
3348
- * @param {?} num
3349
- * @return {?}
3350
- */
3351
- TotvsScheduleExecutionService.prototype.addZero = /**
3352
- * @private
3353
- * @param {?} num
3354
- * @return {?}
3355
- */
3356
- function (num) {
3357
- /** @type {?} */
3358
- var str = "" + num;
3359
- if (num < 10) {
3360
- str = "0" + num;
3361
- }
3362
- return str;
3363
- };
3364
- TotvsScheduleExecutionService.decorators = [
3365
- { type: Injectable }
3366
- ];
3367
- /** @nocollapse */
3368
- TotvsScheduleExecutionService.ctorParameters = function () { return [
3369
- { type: HttpClient }
3370
- ]; };
3371
- return TotvsScheduleExecutionService;
3372
- }());
3373
- if (false) {
3374
- /**
3375
- * @type {?}
3376
- * @private
3377
- */
3378
- TotvsScheduleExecutionService.prototype.headers;
3379
- /**
3380
- * @type {?}
3381
- * @private
3382
- */
3383
- TotvsScheduleExecutionService.prototype.urlCadServidor;
3384
- /**
3385
- * @type {?}
3386
- * @private
3387
- */
3388
- TotvsScheduleExecutionService.prototype.urlJobScheduler;
3389
- /**
3390
- * @type {?}
3391
- * @private
3392
- */
3393
- TotvsScheduleExecutionService.prototype.urlJobExecution;
3394
- /**
3395
- * @type {?}
3396
- * @private
3397
- */
3398
- TotvsScheduleExecutionService.prototype.jobExecutionSubscription$;
3399
- /** @type {?} */
3400
- TotvsScheduleExecutionService.prototype.http;
3401
- }
3402
-
3403
- /**
3404
- * @fileoverview added by tsickle
3405
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3406
- */
3407
- var TotvsScheduleExecutionComponent = /** @class */ (function () {
3408
- function TotvsScheduleExecutionComponent(poI18nService, rpwService, poNotification) {
3409
- this.poI18nService = poI18nService;
3410
- this.rpwService = rpwService;
3411
- this.poNotification = poNotification;
3412
- this.programEMS5 = false;
3413
- this.programVersion = '';
3414
- this.disabledParams = false;
3415
- this.loading = false;
3416
- this.endExecution = new EventEmitter();
3417
- this.jsonObject = {};
3418
- this.literals = {};
3419
- }
3420
- /**
3421
- * @return {?}
3422
- */
3423
- TotvsScheduleExecutionComponent.prototype.ngOnInit = /**
3424
- * @return {?}
3425
- */
3426
- function () {
3427
- /* VERIFICAR COMO FICARÁ A TRADUÇÃO
3428
- forkJoin(
3429
- this.poI18nService.getLiterals(),
3430
- this.poI18nService.getLiterals({ context: 'generalRpw' })
3431
- ).subscribe(literals => {
3432
- literals.map(item => Object.assign(this.literals, item) );
3433
- this.setupComponents();
3434
- });*/
3435
- this.setupComponents();
3436
- };
3437
- /**
3438
- * @return {?}
3439
- */
3440
- TotvsScheduleExecutionComponent.prototype.setupComponents = /**
3441
- * @return {?}
3442
- */
3443
- function () {
3444
- this.executionTypeOptions = [
3445
- { label: 'Executar Hoje', value: 1 },
3446
- { label: 'Agendar Execução', value: 2 }
3447
- ];
3448
- this.frequencyOptions = [
3449
- { label: 'Uma vez no dia', value: 'no' },
3450
- { label: 'Várias vezes no dia', value: 'yes' }
3451
- ];
3452
- this.frequencyTypeOptions = [
3453
- { label: 'Hora(s)', value: 'hour' },
3454
- { label: 'Minuto(s)', value: 'minute' }
3455
- ];
3456
- this.weeklyOptions = [
3457
- { label: 'Domingo', value: 'Sunday' },
3458
- { label: 'Segunda', value: 'Monday' },
3459
- { label: 'Terça', value: 'Tuesday' },
3460
- { label: 'Quarta', value: 'Wednesday' },
3461
- { label: 'Quinta', value: 'Thursday' },
3462
- { label: 'Sexta', value: 'Friday' },
3463
- { label: 'Sábado', value: 'Saturday' }
3464
- ];
3465
- this.zoomRpwServiceColumns = [
3466
- { property: 'code', label: 'Servidor', type: 'string', width: '20%' },
3467
- { property: 'name', label: 'Descrição', type: 'string', width: '80%' }
3468
- ];
3469
- this.model = new ScheduleParameters();
3470
- this.model.executionType = 1;
3471
- this.model.repeatType = 1;
3472
- this.model.repeatExecution = false;
3473
- };
3474
- /**
3475
- * @param {?} schParam
3476
- * @return {?}
3477
- */
3478
- TotvsScheduleExecutionComponent.prototype.setScheduleParameters = /**
3479
- * @param {?} schParam
3480
- * @return {?}
3481
- */
3482
- function (schParam) {
3483
- if (!schParam) {
3484
- return;
3485
- }
3486
- this.model = schParam;
3487
- };
3488
- /**
3489
- * @param {?} value
3490
- * @return {?}
3491
- */
3492
- TotvsScheduleExecutionComponent.prototype.fieldRpwServiceFormat = /**
3493
- * @param {?} value
3494
- * @return {?}
3495
- */
3496
- function (value) {
3497
- return value.code + " - " + value.name;
3498
- };
3499
- /**
3500
- * @return {?}
3501
- */
3502
- TotvsScheduleExecutionComponent.prototype.isExecutionSchedule = /**
3503
- * @return {?}
3504
- */
3505
- function () {
3506
- return (this.model.executionType === 2);
3507
- };
3508
- /**
3509
- * @return {?}
3510
- */
3511
- TotvsScheduleExecutionComponent.prototype.isRepeatExecution = /**
3512
- * @return {?}
3513
- */
3514
- function () {
3515
- return this.model.repeatExecution;
3516
- };
3517
- /**
3518
- * @return {?}
3519
- */
3520
- TotvsScheduleExecutionComponent.prototype.isFrenquency = /**
3521
- * @return {?}
3522
- */
3523
- function () {
3524
- return (this.model.frequency === 'yes');
3525
- };
3526
- /**
3527
- * @return {?}
3528
- */
3529
- TotvsScheduleExecutionComponent.prototype.changeRepeatExecution = /**
3530
- * @return {?}
3531
- */
3532
- function () {
3533
- /** @type {?} */
3534
- var date = new Date();
3535
- if (!this.model.execAppointHourInit) {
3536
- this.model.execAppointHourInit = this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes());
3537
- }
3538
- if (!this.model.execAppointHourFinal) {
3539
- this.model.execAppointHourFinal = this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes());
3540
- }
3541
- this.model.selectWeeklys = [];
3542
- this.model.dayOfMonth = 0;
3543
- this.model.frequency = 'no';
3544
- this.model.frequencyType = 'hour';
3545
- this.model.frequencyValue = 0;
3546
- };
3547
- /**
3548
- * @return {?}
3549
- */
3550
- TotvsScheduleExecutionComponent.prototype.changeExecutionType = /**
3551
- * @return {?}
3552
- */
3553
- function () {
3554
- /** @type {?} */
3555
- var date = new Date();
3556
- this.model.execAppointDate = date;
3557
- this.model.execAppointHour = this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes());
3558
- };
3559
- /**
3560
- * @return {?}
3561
- */
3562
- TotvsScheduleExecutionComponent.prototype.changeTypeFrequency = /**
3563
- * @return {?}
3564
- */
3565
- function () {
3566
- };
3567
- /**
3568
- * @param {?} codTab
3569
- * @return {?}
3570
- */
3571
- TotvsScheduleExecutionComponent.prototype.getActiveTab = /**
3572
- * @param {?} codTab
3573
- * @return {?}
3574
- */
3575
- function (codTab) {
3576
- return (this.model.repeatType === codTab);
3577
- };
3578
- /**
3579
- * @param {?} codTab
3580
- * @return {?}
3581
- */
3582
- TotvsScheduleExecutionComponent.prototype.setActiveTab = /**
3583
- * @param {?} codTab
3584
- * @return {?}
3585
- */
3586
- function (codTab) {
3587
- this.model.repeatType = codTab;
3588
- };
3589
- /**
3590
- * @param {?} num
3591
- * @return {?}
3592
- */
3593
- TotvsScheduleExecutionComponent.prototype.addZero = /**
3594
- * @param {?} num
3595
- * @return {?}
3596
- */
3597
- function (num) {
3598
- /** @type {?} */
3599
- var str = "" + num;
3600
- if (num < 10) {
3601
- str = "0" + num;
3602
- }
3603
- return str;
3604
- };
3605
- /**
3606
- * @return {?}
3607
- */
3608
- TotvsScheduleExecutionComponent.prototype.executeSchedule = /**
3609
- * @return {?}
3610
- */
3611
- function () {
3612
- var _this = this;
3613
- if (this.disabledParams) {
3614
- return;
3615
- }
3616
- if (!this.validate()) {
3617
- return;
3618
- }
3619
- this.jsonObject = {};
3620
- this.jsonObject.status = 'active';
3621
- this.jsonObject.processID = this.programName;
3622
- this.jsonObject.recurrent = this.model.repeatExecution;
3623
- this.jsonObject.executionParameter = {};
3624
- if (this.model.executionType === 1) {
3625
- /** @type {?} */
3626
- var date = new Date();
3627
- this.jsonObject.firstExecution = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + "T" + this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes()) + ":00.000Z";
3628
- }
3629
- if (this.model.executionType === 2) {
3630
- this.jsonObject.firstExecution = this.model.execAppointDate + "T" + this.model.execAppointHour + ":00.000Z";
3631
- }
3632
- this.jsonObject.executionParameter.parametros = [];
3633
- this.jsonObject.executionParameter.parametros[0] = { chave: 'rpwServer', valor: this.model.executionServer };
3634
- this.jsonObject.executionParameter.parametros[1] = { chave: 'RPW_PROGRAM', valor: this.externalName };
3635
- this.jsonObject.executionParameter.parametros[2] = { chave: 'RPW_PRG_EMS5', valor: this.programEMS5 ? 'yes' : 'no' };
3636
- this.jsonObject.executionParameter.parametros[3] = { chave: 'RPW_PRG_VERS', valor: this.programVersion };
3637
- this.jsonObject.executionParameter.parametros[4] = {};
3638
- this.jsonObject.executionParameter.parametros[4].parametros_negocio = this.parameters;
3639
- // Executa hoje ou agendada
3640
- this.rpwService.createExecution(this.jsonObject, this.loading).subscribe((/**
3641
- * @return {?}
3642
- */
3643
- function () {
3644
- _this.poNotification.success('Agendamento realizado com sucesso !');
3645
- }));
3646
- if (this.model.repeatExecution) {
3647
- if (this.model.repeatType === 1) {
3648
- this.jsonObject.daily = {
3649
- hour: this.getHourOrMinute(this.model.execAppointHourInit, 'h'),
3650
- minute: this.getHourOrMinute(this.model.execAppointHourInit, 'm')
3651
- };
3652
- }
3653
- if (this.model.repeatType === 2) {
3654
- this.jsonObject.weekly = {
3655
- hour: this.getHourOrMinute(this.model.execAppointHourInit, 'h'),
3656
- minute: this.getHourOrMinute(this.model.execAppointHourInit, 'm'),
3657
- daysOfWeek: this.model.selectWeeklys
3658
- };
3659
- }
3660
- if (this.model.repeatType === 3) {
3661
- this.jsonObject.monthly = {
3662
- hour: this.getHourOrMinute(this.model.execAppointHourInit, 'h'),
3663
- minute: this.getHourOrMinute(this.model.execAppointHourInit, 'm'),
3664
- day: this.model.dayOfMonth
3665
- };
3666
- }
3667
- if (this.isFrenquency()) {
3668
- this.jsonObject.rangeExecutions = {
3669
- frequency: {
3670
- type: this.model.frequencyType,
3671
- value: this.model.frequencyValue
3672
- },
3673
- rangeLimit: {
3674
- hour: this.getHourOrMinute(this.model.execAppointHourFinal, 'h'),
3675
- minute: this.getHourOrMinute(this.model.execAppointHourFinal, 'm')
3676
- }
3677
- };
3678
- }
3679
- // Executa a diária, semanal ou mensal
3680
- this.rpwService.createExecution(this.jsonObject, this.loading).subscribe((/**
3681
- * @return {?}
3682
- */
3683
- function () {
3684
- }));
3685
- }
3686
- this.endExecution.emit(this.model);
3687
- };
3688
- /**
3689
- * @param {?} value
3690
- * @param {?} type
3691
- * @return {?}
3692
- */
3693
- TotvsScheduleExecutionComponent.prototype.getHourOrMinute = /**
3694
- * @param {?} value
3695
- * @param {?} type
3696
- * @return {?}
3697
- */
3698
- function (value, type) {
3699
- if (type === 'h') {
3700
- return +value.substring(0, 2);
3701
- }
3702
- if (type === 'm') {
3703
- return +value.substring(3, 6);
3704
- }
3705
- };
3706
- /**
3707
- * @param {?} hourInit
3708
- * @param {?} hourFinal
3709
- * @return {?}
3710
- */
3711
- TotvsScheduleExecutionComponent.prototype.compareHour = /**
3712
- * @param {?} hourInit
3713
- * @param {?} hourFinal
3714
- * @return {?}
3715
- */
3716
- function (hourInit, hourFinal) {
3717
- if (hourInit === hourFinal) {
3718
- return false;
3719
- }
3720
- if (this.getHourOrMinute(hourInit, 'h') < this.getHourOrMinute(hourFinal, 'h')) {
3721
- return true;
3722
- }
3723
- if (this.getHourOrMinute(hourInit, 'm') > this.getHourOrMinute(hourFinal, 'm')) {
3724
- return false;
3725
- }
3726
- return true;
3727
- };
3728
- /**
3729
- * @return {?}
3730
- */
3731
- TotvsScheduleExecutionComponent.prototype.validate = /**
3732
- * @return {?}
3733
- */
3734
- function () {
3735
- if (!this.scheduleExecutionForm.valid) {
3736
- this.poNotification.error('Verifique as inconsistências em tela.');
3737
- return false;
3738
- }
3739
- if (!this.model.executionServer) {
3740
- this.poNotification.error('Servidor de Execução não foi informado.');
3741
- return false;
3742
- }
3743
- if (this.isExecutionSchedule() && (!this.model.execAppointDate || !this.model.execAppointHour)) {
3744
- this.poNotification.error('Informar a data e a hora para agendamento da execução.');
3745
- return false;
3746
- }
3747
- if (this.model.repeatExecution) {
3748
- if (!this.model.execAppointHourInit) {
3749
- this.poNotification.error('Informar a hora de início para a execução.');
3750
- return false;
3751
- }
3752
- if (this.model.repeatType === 2 && (this.model.selectWeeklys.length === 0)) {
3753
- this.poNotification.error('Informar os dias da semana para a execução.');
3754
- return false;
3755
- }
3756
- if (this.model.repeatType === 3 && (!this.model.dayOfMonth)) {
3757
- this.poNotification.error('Informar o dia para a execução.');
3758
- return false;
3759
- }
3760
- if (this.isFrenquency()) {
3761
- if (!this.compareHour(this.model.execAppointHourInit, this.model.execAppointHourFinal)) {
3762
- this.poNotification.error('Hora Fim deve ser maior que Hora Início.');
3763
- return false;
3764
- }
3765
- if (this.model.frequencyValue === 0) {
3766
- this.poNotification.error('Informar a frequência de execução (A cada hora/minuto).');
3767
- return false;
3768
- }
3769
- }
3770
- }
3771
- return true;
3772
- };
3773
- TotvsScheduleExecutionComponent.decorators = [
3774
- { type: Component, args: [{
3775
- selector: 'app-totvs-schedule-execution',
3776
- 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",
3777
- styles: [""]
3778
- }] }
3779
- ];
3780
- /** @nocollapse */
3781
- TotvsScheduleExecutionComponent.ctorParameters = function () { return [
3782
- { type: PoI18nService },
3783
- { type: TotvsScheduleExecutionService },
3784
- { type: PoNotificationService }
3785
- ]; };
3786
- TotvsScheduleExecutionComponent.propDecorators = {
3787
- scheduleExecutionForm: [{ type: ViewChild, args: ['scheduleExecutionForm', { static: true },] }],
3788
- programName: [{ type: Input }],
3789
- externalName: [{ type: Input }],
3790
- programEMS5: [{ type: Input }],
3791
- programVersion: [{ type: Input }],
3792
- parameters: [{ type: Input }],
3793
- disabledParams: [{ type: Input }],
3794
- loading: [{ type: Input }],
3795
- endExecution: [{ type: Output }]
3796
- };
3797
- return TotvsScheduleExecutionComponent;
3798
- }());
3799
- if (false) {
3800
- /** @type {?} */
3801
- TotvsScheduleExecutionComponent.prototype.scheduleExecutionForm;
3802
- /** @type {?} */
3803
- TotvsScheduleExecutionComponent.prototype.programName;
3804
- /** @type {?} */
3805
- TotvsScheduleExecutionComponent.prototype.externalName;
3806
- /** @type {?} */
3807
- TotvsScheduleExecutionComponent.prototype.programEMS5;
3808
- /** @type {?} */
3809
- TotvsScheduleExecutionComponent.prototype.programVersion;
3810
- /** @type {?} */
3811
- TotvsScheduleExecutionComponent.prototype.parameters;
3812
- /** @type {?} */
3813
- TotvsScheduleExecutionComponent.prototype.disabledParams;
3814
- /** @type {?} */
3815
- TotvsScheduleExecutionComponent.prototype.loading;
3816
- /** @type {?} */
3817
- TotvsScheduleExecutionComponent.prototype.endExecution;
3818
- /** @type {?} */
3819
- TotvsScheduleExecutionComponent.prototype.executionTypeOptions;
3820
- /** @type {?} */
3821
- TotvsScheduleExecutionComponent.prototype.frequencyOptions;
3822
- /** @type {?} */
3823
- TotvsScheduleExecutionComponent.prototype.frequencyTypeOptions;
3824
- /** @type {?} */
3825
- TotvsScheduleExecutionComponent.prototype.weeklyOptions;
3826
- /** @type {?} */
3827
- TotvsScheduleExecutionComponent.prototype.zoomRpwServiceColumns;
3828
- /** @type {?} */
3829
- TotvsScheduleExecutionComponent.prototype.model;
3830
- /**
3831
- * @type {?}
3832
- * @private
3833
- */
3834
- TotvsScheduleExecutionComponent.prototype.jsonObject;
3835
- /** @type {?} */
3836
- TotvsScheduleExecutionComponent.prototype.literals;
3837
- /** @type {?} */
3838
- TotvsScheduleExecutionComponent.prototype.poI18nService;
3839
- /** @type {?} */
3840
- TotvsScheduleExecutionComponent.prototype.rpwService;
3841
- /** @type {?} */
3842
- TotvsScheduleExecutionComponent.prototype.poNotification;
3843
- }
3844
-
3845
- /**
3846
- * @fileoverview added by tsickle
3847
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3848
- */
3849
- var DtsDateFormatPipe = /** @class */ (function () {
3850
- function DtsDateFormatPipe() {
3851
- }
3852
- /**
3853
- * @param {?} value
3854
- * @param {?=} format
3855
- * @return {?}
3856
- */
3857
- DtsDateFormatPipe.prototype.transform = /**
3858
- * @param {?} value
3859
- * @param {?=} format
3860
- * @return {?}
3861
- */
3862
- function (value, format) {
3863
- if (format === void 0) { format = 'dd/MM/yyyy'; }
3864
- var _a = value.split('-'), year = _a[0], month = _a[1], day = _a[2];
3865
- /** @type {?} */
3866
- var formattedDate = format.replace('dd', day)
3867
- .replace('MM', month)
3868
- .replace('yyyy', year);
3869
- return formattedDate;
3870
- };
3871
- DtsDateFormatPipe.decorators = [
3872
- { type: Pipe, args: [{
3873
- name: 'dtsDateFormat'
3874
- },] }
3875
- ];
3876
- return DtsDateFormatPipe;
3877
- }());
3878
-
3879
- /**
3880
- * @fileoverview added by tsickle
3881
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3882
- */
3883
- var DtsBackofficeUtilsModule = /** @class */ (function () {
3884
- function DtsBackofficeUtilsModule() {
3885
- }
3886
- /**
3887
- * @return {?}
3888
- */
3889
- DtsBackofficeUtilsModule.forRoot = /**
3890
- * @return {?}
3891
- */
3892
- function () {
3893
- return {
3894
- ngModule: DtsBackofficeUtilsModule,
3895
- providers: [TotvsScheduleExecutionService]
3896
- };
3897
- };
3898
- DtsBackofficeUtilsModule.decorators = [
3899
- { type: NgModule, args: [{
3900
- declarations: [
3901
- TotvsScheduleExecutionComponent,
3902
- DtsDateFormatPipe
3903
- ],
3904
- imports: [
3905
- CommonModule,
3906
- PoModule,
3907
- FormsModule,
3908
- HttpClientModule
3909
- ],
3910
- exports: [
3911
- TotvsScheduleExecutionComponent,
3912
- DtsDateFormatPipe
3913
- ],
3914
- providers: [
3915
- TotvsScheduleExecutionService
3916
- ]
3917
- },] }
3918
- ];
3919
- return DtsBackofficeUtilsModule;
3920
- }());
3921
-
3922
- /**
3923
- * @fileoverview added by tsickle
3924
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3925
- */
3926
-
3927
- /**
3928
- * @fileoverview added by tsickle
3929
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3930
- */
3931
-
3932
- export { BreadcrumbControlService, CacheParamsService, DateUtil, DisclaimerUtil, DownloadDataParams, DtsBackofficeUtilsModule, DtsDateFormatPipe, ExecutionParameters, ExecutionStatus, FieldValidationUtil, FileUtil, FilterRangeUtil, GenericFunctionsUtils, MenuDatasulService, ProfileService, ReportFormats, ReportService, ScheduleParameters, TotvsScheduleExecutionComponent, TotvsScheduleExecutionService, TranslateService, UserLoginService };
3933
- //# sourceMappingURL=dts-backoffice-util.js.map