dts-backoffice-util 2.8.2 → 5.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.
- package/bundles/dts-backoffice-util.umd.js +419 -2359
- package/bundles/dts-backoffice-util.umd.js.map +1 -1
- package/esm2015/dts-backoffice-util.js +2 -6
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +15 -131
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +1 -125
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +19 -172
- package/esm2015/lib/dts-backoffice-util.module.js +2 -8
- package/esm2015/lib/interfaces/filter-range.interface.js +2 -47
- package/esm2015/lib/interfaces/totvs-response.interface.js +2 -16
- package/esm2015/lib/model/session-info.model.js +1 -116
- package/esm2015/lib/pipes/dts-date-format.pipe.js +2 -11
- package/esm2015/lib/services/breadcrumb-control.service.js +9 -44
- package/esm2015/lib/services/cache-params.service.js +10 -24
- package/esm2015/lib/services/menu-datasul.service.js +9 -18
- package/esm2015/lib/services/profile.service.js +17 -78
- package/esm2015/lib/services/report.service.js +20 -81
- package/esm2015/lib/services/session-info.service.js +12 -27
- package/esm2015/lib/services/translate.service.js +2 -15
- package/esm2015/lib/utils/date.util.js +1 -39
- package/esm2015/lib/utils/disclaimer.util.js +33 -317
- package/esm2015/lib/utils/field-validation.util.js +1 -96
- package/esm2015/lib/utils/file.util.js +7 -102
- package/esm2015/lib/utils/filter-range.util.js +1 -20
- package/esm2015/lib/utils/generic-functions.utils.js +12 -137
- package/esm2015/public-api.js +22 -25
- package/fesm2015/dts-backoffice-util.js +176 -1501
- package/fesm2015/dts-backoffice-util.js.map +1 -1
- package/package.json +9 -8
- package/CHANGELOG.md +0 -159
- package/bundles/dts-backoffice-util.umd.min.js +0 -2
- package/bundles/dts-backoffice-util.umd.min.js.map +0 -1
- package/esm5/dts-backoffice-util.js +0 -9
- package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +0 -448
- package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +0 -143
- package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +0 -434
- package/esm5/lib/dts-backoffice-util.module.js +0 -53
- package/esm5/lib/interfaces/filter-range.interface.js +0 -47
- package/esm5/lib/interfaces/totvs-response.interface.js +0 -16
- package/esm5/lib/model/session-info.model.js +0 -239
- package/esm5/lib/pipes/dts-date-format.pipe.js +0 -36
- package/esm5/lib/services/breadcrumb-control.service.js +0 -157
- package/esm5/lib/services/cache-params.service.js +0 -61
- package/esm5/lib/services/menu-datasul.service.js +0 -92
- package/esm5/lib/services/profile.service.js +0 -146
- package/esm5/lib/services/report.service.js +0 -137
- package/esm5/lib/services/session-info.service.js +0 -64
- package/esm5/lib/services/translate.service.js +0 -47
- package/esm5/lib/utils/date.util.js +0 -135
- package/esm5/lib/utils/disclaimer.util.js +0 -930
- package/esm5/lib/utils/field-validation.util.js +0 -358
- package/esm5/lib/utils/file.util.js +0 -262
- package/esm5/lib/utils/filter-range.util.js +0 -69
- package/esm5/lib/utils/generic-functions.utils.js +0 -358
- package/esm5/public-api.js +0 -37
- package/fesm5/dts-backoffice-util.js +0 -3944
- package/fesm5/dts-backoffice-util.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dts-backoffice-util",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"tslib": "^2.0.0"
|
|
6
|
+
},
|
|
4
7
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "~
|
|
6
|
-
"@angular/core": "~
|
|
7
|
-
"@angular/forms": "~
|
|
8
|
+
"@angular/common": "~12.2.16",
|
|
9
|
+
"@angular/core": "~12.2.16",
|
|
10
|
+
"@angular/forms": "~12.2.16"
|
|
8
11
|
},
|
|
9
12
|
"main": "bundles/dts-backoffice-util.umd.js",
|
|
10
|
-
"module": "
|
|
13
|
+
"module": "fesm2015/dts-backoffice-util.js",
|
|
11
14
|
"es2015": "fesm2015/dts-backoffice-util.js",
|
|
12
|
-
"esm5": "esm5/dts-backoffice-util.js",
|
|
13
15
|
"esm2015": "esm2015/dts-backoffice-util.js",
|
|
14
|
-
"fesm5": "fesm5/dts-backoffice-util.js",
|
|
15
16
|
"fesm2015": "fesm2015/dts-backoffice-util.js",
|
|
16
17
|
"typings": "dts-backoffice-util.d.ts",
|
|
17
18
|
"metadata": "dts-backoffice-util.metadata.json",
|
|
18
19
|
"sideEffects": false
|
|
19
|
-
}
|
|
20
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
**2.8.1 / 2.8.2 (16-11-2021):**
|
|
4
|
-
|
|
5
|
-
Melhorias:
|
|
6
|
-
- **FileUtil**<br>- No método **downloadFile** foi incluído o parâmetro "base64" (boolean) para indicar se o conteúdo recebido do backEnd está no formato base64 ou Blob.<br>- No método **downloadData**, caso seja informado o parâmetro **IDownloadDataParams.columnList**, indicando as colunas a serem exportadas, o método irá respeitar a ordem informada dos campos, desta forma, as colunas estarão na mesma ordem no arquivo.
|
|
7
|
-
|
|
8
|
-
**2.8.0 (13-10-2021):**
|
|
9
|
-
|
|
10
|
-
Melhorias:
|
|
11
|
-
- **TotvsScheduleExecutionService**<br>- Novos métodos para consulta do status atual da agenda: Pelo jobScheduleID - Id Interno (**getExecutionByJobScheduleID**) ou executionID - Número da Agenda (**getExecutionByExecutionID**).<br>- O método para acompanhamento de execução (**followUpExecution**) foi substituído por dois novos métodos, onde é possível indicar, a partir de que código deve ser feito o acompanhamento: Pelo jobScheduleID - Id Interno (**followUpExcByJobScheduleID**) ou executionID - Número da Agenda (**followUpExcByExecutionID**).
|
|
12
|
-
|
|
13
|
-
Breaking Changes:
|
|
14
|
-
- Método **followUpExecution** - Renomeado para **followUpExcByJobScheduleID**. Os parâmetros e o comportamento do método, continuam os mesmos.
|
|
15
|
-
|
|
16
|
-
**2.7.0 (06-09-2021):**
|
|
17
|
-
|
|
18
|
-
Melhorias:
|
|
19
|
-
- **FileUtil** - Novo método **downloadData** que realiza a criação e o download de um arquivo CSV gerado a partir de um listagem de dados (criada diretamente no FrontEnd ou retornada do BackEnd). Este método pode ser utilizado para, por exemplo, exportar os dados de um Grid.
|
|
20
|
-
|
|
21
|
-
**2.6.0 (30-08-2021):**
|
|
22
|
-
|
|
23
|
-
Melhorias:
|
|
24
|
-
- **TotvsScheduleExecutionService** - Novo serviço que possibilita criar, de forma simplificada, agendamentos que serão executados "agora" no RPW, via código (sem tela). E também um método que permite "monitorar" a execução do agendamento, verificando o status da execução, até que ele seja finalizado.
|
|
25
|
-
|
|
26
|
-
**2.5.0 / 2.5.1 (20-08-2021):**
|
|
27
|
-
|
|
28
|
-
Correção:
|
|
29
|
-
- **TotvsScheduleExecutionComponent** - Em algumas momentos, ao selecionar a opção "Repetir ocorrência?", quando o campo "Hora Início" era apresentado, o conteúdo ficava "piscando" e não era possível editar o valor.
|
|
30
|
-
|
|
31
|
-
Melhorias:
|
|
32
|
-
- **TotvsScheduleExecutionComponent** - O campo "Servidor de Execução" utilizava o componente de "combo" para selecionar o servidor. Ele foi alterado para utilizar o componente de "lookup", desta forma, passa a ter um "Zoom" onde o usuário pode visualizar/filtrar/selecionar o servidor desejado.
|
|
33
|
-
|
|
34
|
-
**2.4.1 (31-03-2021):**
|
|
35
|
-
|
|
36
|
-
Melhorias:
|
|
37
|
-
- **TotvsScheduleExecutionComponent** - Incluído um novo parâmetro chamado **loading** para indicar que, ao executar a criação da agenda, a tela seja travada até o retorno do serviço.
|
|
38
|
-
|
|
39
|
-
**2.4.0 (25-03-2021):**
|
|
40
|
-
|
|
41
|
-
Melhorias:
|
|
42
|
-
- **DisclaimerUtil** - Incluído o método **makeDisclaimerFromMultiSelectNumber**, para geração de Disclaimer a partir de um Multi-Select, onde o Label é uma String, mas o valor é um número. Desta forma, quando incluído no Filtro, irá apresentar os Labels, mas internamente irá guardar os valores numéricos.
|
|
43
|
-
|
|
44
|
-
**2.3.0 / 2.3.1 (17-03-2021):**
|
|
45
|
-
|
|
46
|
-
Melhorias:
|
|
47
|
-
- **TotvsScheduleExecutionComponent**<br>- Para busca do Servidor RPW, passa a utilizar o endPoint oficial do framework (/dts/datasul-rest/resources/prg/btb/v1/servidoresExecucao).<br>- Novo parâmetro: **"disabledParams"**, utilizado para habilitar/desabilitar as informações do agendamento (Data Execução, Servidor, Repetir ocorrência, etc...).<br>- Novo método: **"setScheduleParameters"**, utilizado para enviar as informações do agendamento, que serão apresentadas na tela. Isto para, por exemplo, apresentar a última configuração realizada pelo usuário.<br>- Alterado o parâmetro **"endExecution"**, para enviar as informações do agendamento quando for disparado o método informado nele. Isto para, por exemplo, salvar as informações digitadas pelo usuário.<br>- Nova interface: **"IScheduleParameters"**, que descreve as informações recebidas no método **"setScheduleParameters"** e enviadas no método informado no parâmetro **"endExecution"**.
|
|
48
|
-
|
|
49
|
-
**2.2.1 (13-11-2020):**
|
|
50
|
-
|
|
51
|
-
Correção:
|
|
52
|
-
- **TotvsScheduleExecutionComponent** - Correção da mensagem de finalização do Agendamento, para: 'Agendamento realizado com sucesso !'.
|
|
53
|
-
|
|
54
|
-
**2.2.0 (10-11-2020):**
|
|
55
|
-
|
|
56
|
-
Melhorias:
|
|
57
|
-
- **FileUtil** - Nova biblioteca para controle de Arquivo, onde foi disponibilizado o método **downloadFile** para realizar o download de Arquivos provenientes do BackEnd.
|
|
58
|
-
|
|
59
|
-
**2.1.1 / 2.1.2 (09-11-2020):**
|
|
60
|
-
|
|
61
|
-
Correção:
|
|
62
|
-
- **openPath** - Corrigido para abrir as telas PO-UI corretamente no Novo FrameWork (Tomcat).
|
|
63
|
-
|
|
64
|
-
**2.1.0 (07-10-2020):**
|
|
65
|
-
|
|
66
|
-
Melhorias:
|
|
67
|
-
- **GenericFunctionsUtils** - Incluído o método **"focusInternalInput"**, para dar foco a um campo do PO-UI quando ele está em um Modal, ou não está disponível na abertura da tela (quando não é possível utilizar o @ViewChild).
|
|
68
|
-
|
|
69
|
-
**2.0.8 / 2.0.9 (02-10-2020):**
|
|
70
|
-
|
|
71
|
-
Documentação:
|
|
72
|
-
- Ajustes documentação.
|
|
73
|
-
|
|
74
|
-
**2.0.5 / 2.0.6 / 2.0.7 (29-09-2020):**
|
|
75
|
-
|
|
76
|
-
Melhorias:
|
|
77
|
-
- **TranslateService** - Criação do serviço, para realização o controle do idioma.
|
|
78
|
-
|
|
79
|
-
**2.0.4 (02-09-2020):**
|
|
80
|
-
|
|
81
|
-
Documentação:
|
|
82
|
-
- Ajustes documentação.
|
|
83
|
-
|
|
84
|
-
**2.0.3 (13-06-2020):**
|
|
85
|
-
|
|
86
|
-
Correções:
|
|
87
|
-
- **DisclaimerUtil** - Ajuste no método **"atzBooleanFromDisclamer"**, para retornar um valor **verdadeiramente boolean**. Em alguns casos, retornava uma string com "true" ou "false". Assim o componente **"po-switch"** não funciona corretamente.
|
|
88
|
-
|
|
89
|
-
**2.0.1 / 2.0.2 (15-05-2020):**
|
|
90
|
-
|
|
91
|
-
Melhorias:
|
|
92
|
-
- **TotvsScheduleExecutionComponent**<br>- Inclusão do atributo (opcional) **"programEMS5"**: Indica que o programa a ser executado é do EMS5.<br>- Inclusão do atributo (opcional) **"programVersion"**: Indica a versão do programa progress a ser executado.<br>- Alterado o parâmetro **"endExecution"**: Para ser um função (e não boolean). Será disparada a função depois que retornar do serviço de agendamento.<br>- Incluída a opção de Recorrência **"Mensal"** (Agora temos: Diária, Semanal e Mensal).<br>- Incluída a opção de **"Frequência"**, permitido que a execução seja repetida várias vezes no mesmo dia (quando for Recorrência).
|
|
93
|
-
|
|
94
|
-
**2.0.0 (12-04-2020):**
|
|
95
|
-
|
|
96
|
-
Melhorias:
|
|
97
|
-
- ATUALIZAÇÃO: **PO-UI v2** E **ANGULAR 9**.
|
|
98
|
-
|
|
99
|
-
**0.0.22 (01-04-2020):**
|
|
100
|
-
|
|
101
|
-
Melhorias:
|
|
102
|
-
- Repasse da biblioteca.
|
|
103
|
-
|
|
104
|
-
**0.0.20 / 0.0.21 (19-03-2020):**
|
|
105
|
-
|
|
106
|
-
Correções:
|
|
107
|
-
- **ReportService:**<br>- Ajuste no nome do arquivo de download, não estava respeitando o parâmetro enviado.<br>- Ajuste na montagem da URL, não estava mandando & quando havia mais de um parâmetro.
|
|
108
|
-
|
|
109
|
-
**0.0.19 (18-03-2020):**
|
|
110
|
-
|
|
111
|
-
Correções:
|
|
112
|
-
- **TotvsScheduleExecutionComponent** - A hora da execução estava indo com a data errada, não respeitando o que era informado em tela.
|
|
113
|
-
|
|
114
|
-
**0.0.18 (14-02-2020):**
|
|
115
|
-
|
|
116
|
-
Melhorias:
|
|
117
|
-
- **DisclaimerUtil** - Ajuste no método **makeDisclaimerFromMultiSelect**, para possibilitar a tradução do value. Foi incluído um novo parâmetro **tradValue** para indicar se deve ou não ser traduzido. Para tradução o value deve estar no literals que foi enviado para o serviço.
|
|
118
|
-
|
|
119
|
-
**0.0.16 / 0.017 (03-02-2020):**
|
|
120
|
-
|
|
121
|
-
Documentação:
|
|
122
|
-
- Ajustes documentação.
|
|
123
|
-
|
|
124
|
-
**0.0.15 (03-02-2020):**
|
|
125
|
-
|
|
126
|
-
Correções:
|
|
127
|
-
- **ReportService** - Realizado ajuste para a impressão funciona no novo framework.
|
|
128
|
-
|
|
129
|
-
**0.0.14 (31-01-2020):**
|
|
130
|
-
|
|
131
|
-
Correções:
|
|
132
|
-
- **TotvsScheduleExecutionComponent** - Adicionando o "zero" na frente da hora que forem menor que 10.
|
|
133
|
-
|
|
134
|
-
**0.0.13 (30-01-2020):**
|
|
135
|
-
|
|
136
|
-
Melhorias:
|
|
137
|
-
- **dtsDateFormat** - Criação do componente, para formatação de Data.
|
|
138
|
-
- **MenuDatasulService** - Criação do método **openPath**, para abrir telas em nova aba do Datasul.
|
|
139
|
-
|
|
140
|
-
**0.0.12 (28-01-2020):**
|
|
141
|
-
|
|
142
|
-
Melhorias:
|
|
143
|
-
- **TotvsScheduleExecutionComponent** - Criação do componente, para realização de agendamentos RPW.
|
|
144
|
-
|
|
145
|
-
**0.0.11 (24-01-2020):**
|
|
146
|
-
|
|
147
|
-
Melhorias:<br>
|
|
148
|
-
- **Primeira versão** - Serviços disponíveis:
|
|
149
|
-
<br>- breadcrumb-control.service
|
|
150
|
-
<br>- cache-params.service
|
|
151
|
-
<br>- menu-datasul.service
|
|
152
|
-
<br>- profile.service
|
|
153
|
-
<br>- report.service
|
|
154
|
-
<br>- session-info.service
|
|
155
|
-
<br>- date.util
|
|
156
|
-
<br>- disclaimer.util
|
|
157
|
-
<br>- field-validation.util
|
|
158
|
-
<br>- filter-range.util
|
|
159
|
-
<br>- generic-functions.utils
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@po-ui/ng-components"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define("dts-backoffice-util",["exports","@angular/core","@angular/common/http","rxjs","rxjs/operators","@po-ui/ng-components","@angular/forms","@angular/common"],t):t((e=e||self)["dts-backoffice-util"]={},e.ng.core,e.ng.common.http,e.rxjs,e.rxjs.operators,e.ngComponents,e.ng.forms,e.ng.common)}(this,(function(e,t,r,n,o,i,a,l){"use strict";var s=function(){function e(e){this.http=e,this.apiUrl="/totvs-menu/rest/getSessionInfo",this.userLogin=void 0}return e.prototype.getUserLogin=function(){var e=this;return localStorage.getItem("username")?n.of(localStorage.getItem("username")):this.userLogin?n.of(this.userLogin):this.http.get(""+this.apiUrl).pipe(o.map((function(t){return e.userLogin=t.userName,t.userName})))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:r.HttpClient}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(r.HttpClient))},token:e,providedIn:"root"}),e}();var p={STRING:1,JSON:2};p[p.STRING]="STRING",p[p.JSON]="JSON";var u=function(){function e(e){this.http=e,this.apiURL="/dts/datasul-rest/resources/api/btb/btapi930za"}return e.prototype.setProfile=function(e){var t=e.pageId,r=e.userCode;return this.http.post(this.apiURL+"/setProfile?userCode="+r+"&pageId="+t,e,{headers:{"X-PO-Screen-Lock":"true"}})},e.prototype.getProfileAsString=function(e,t){return this.getProfile(e,p.STRING,t?"true":"false")},e.prototype.getProfileAsJSON=function(e,t){return this.getProfile(e,p.JSON,t?"true":"false")},e.prototype.getProfile=function(e,t,r){var n={"X-PO-Screen-Lock":r},i=e.pageId,a=e.dataCode,l=e.userCode;return this.http.get(this.apiURL+"/getProfile?userCode="+l+"&pageId="+i+"&dataCode="+a,{headers:n}).pipe(o.map((function(e){if(e.data[0])return t===p.STRING?e.data[0].dataValue:t===p.JSON?JSON.parse(e.data[0].dataValue):void 0})))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:r.HttpClient}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(r.HttpClient))},token:e,providedIn:"root"}),e}();var c=function(){function e(e){this.httpClient=e,this.URL=window.location.href.indexOf("totvs-menu")>0?"/totvs-menu/rest/report/run/":"/dts/datasul-report/resources/run/"}return e.prototype.generate=function(e,t){var r=this;void 0===t&&(t=!0);var n={"X-PO-Screen-Lock":t?"true":"false"},i=""+this.URL+e.reportName;return e.properties.length>0&&(i+="?",e.properties.forEach((function(e,t){t>0&&(i+="&"),i+="c_properties="+e.name+"&c_values="+e.value}))),i+="&dialect="+e.dialect+"&format="+e.format,i+="&program="+e.programName+"&resultFileName="+e.downloadName,this.httpClient.post(i,{},{headers:n,responseType:"blob"}).pipe(o.map((function(t){return e.download&&r.download(t,e.downloadName+"."+e.format),t})))},e.prototype.download=function(e,t){var r=[e],n=document.createElement("a"),o=window.URL.createObjectURL(new Blob(r,{type:e.type}));n.href=o,n.setAttribute("download",t),document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(o),n.remove()},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.HttpClient}]},e}();var d=function(){function e(){}return e.prototype.newBreadcrumb=function(){this.breadcrumb={items:[]}},e.prototype.addBreadcrumb=function(e,t){this.addBreadcrumbURL(e,decodeURIComponent(t.snapshot._routerState.url))},e.prototype.addBreadcrumbURL=function(e,t){if(e&&""!==e){this.breadcrumb||this.newBreadcrumb();var r={items:[]},n=0;for(n=0;n<this.breadcrumb.items.length&&this.breadcrumb.items[n].label!==e;n++)r.items.push(this.breadcrumb.items[n]);r.items.push({label:e,link:t}),this.breadcrumb=r}},e.prototype.updBreadcrumbURL=function(e,t,r){var n=this.getCurrentRouter();n&&t&&r&&(n=n.replace(t,r),this.addBreadcrumbURL(e,n))},e.prototype.getBreadcrumb=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb},e.prototype.getCurrentRouter=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb.items.length<=0?"":this.breadcrumb.items[this.breadcrumb.items.length-1].link},e.prototype.getPrevRouter=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb.items.length<=1?"":this.breadcrumb.items[this.breadcrumb.items.length-2].link},e.prototype.hasPreviousRouter=function(){return this.breadcrumb.items.length>1},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var m=function(){function e(){}return e.prototype.callProgress=function(e){parent.postMessage({program:e},"*")},e.prototype.sendNotification=function(e){parent.postMessage({notification:e},"*")},e.prototype.openPath=function(e,t,r){void 0===r&&(r=!0);var n=document.referrer.indexOf("totvs-menu")>0?"totvs-menu":"menu-html",o="/"+n+"/#/"+n+"/program-html/"+e+"/#";t&&(o=o+"/"+t),r?window.open(o,"_parent"):window.open(o)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}(),h=function(){function e(){this.values={}}return e.prototype.setValue=function(e,t){this.values[e]=t},e.prototype.getValue=function(e){return this.values[e]},e.prototype.removeValue=function(e){delete this.values[e]},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();var f=function(){function e(){}return e.getSuportLanguage=function(){return["pt-BR","pt","en-US","en","es"]},e.getDefaultCurrencyCode=function(){return"$"},e.getCurrentLanguage=function(){var e=localStorage.getItem("user.language")||navigator.language;return e&&this.getSuportLanguage().includes(e)?e:"en-US"},e.decorators=[{type:t.Injectable}],e}(),v=function(){function e(){}return e.dateToQueryParam=function(e){var t=e.getDate(),r=e.getMonth()+1;return e.getFullYear()+"-"+this.pad(r)+"-"+this.pad(t)},e.queryParamToDate=function(e){var t=+e.split("-")[2],r=+e.split("-")[1],n=+e.split("-")[0];return new Date(n,r-1,t)},e.isValidDate=function(e){return e instanceof Date&&!isNaN(e.getTime())},e.ajustDate=function(e){return e instanceof Date?e:e?this.queryParamToDate(e.split("T")[0]):e},e.ajustDateToModel=function(e,t){if(void 0===e&&(e={}),e.hasOwnProperty(t)&&e[t]){if(e[t].indexOf("T")>=0)return new Date(e[t]);var r=+e[t].split("-")[2],n=+e[t].split("-")[1],o=+e[t].split("-")[0];return new Date(o,n-1,r)}return null},e.pad=function(e){return e<10?"0"+e:e},e}(),g=function(){function e(e,t,r){this.literals={},this.poNotification=e,this.poI18nPipe=t,this.literals=r}return e.prototype.makeDisclaimer=function(e,t,r,n,o){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),null==t||o&&""===t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+(n?this.literals[t]:t),property:""+e,value:""+t}},e.prototype.makeDisclaimerFromNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),null==t||n&&0===t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+t,property:""+e,value:""+t}},e.prototype.makeDisclaimerFromBoolean=function(e,t,r){return void 0===r&&(r=!1),null==t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+(t?this.literals.yes:this.literals.no),property:""+e,value:""+t}},e.prototype.makeDisclaimerFromDate=function(e,t,r){void 0===r&&(r=!1);var n=this.ajustDate(t);return this.isValidDate(n)?{hideClose:r,label:this.literals[e]+": "+n.toLocaleDateString(),property:""+e,value:""+this.dateToQueryParam(n)}:{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromMultiSelect=function(e,t,r,n,o){var i=this;void 0===r&&(r=0),void 0===n&&(n=!1),void 0===o&&(o=!1);var a="",l="";return t?(0===t.length||r>0&&t.length===r?(a=this.literals.all,l="all"):t.map((function(e){""!==a&&(a+=", "),""!==l&&(l+=","),a=""+a+(o?i.literals[e]:e),l=""+l+e})),{hideClose:n,label:this.literals[e]+": "+a,property:""+e,value:""+l}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromMultiSelectNumber=function(e,t,r,n,o){void 0===n&&(n=0),void 0===o&&(o=!1);var i="",a="",l=null;return t&&r?(0===t.length||n>0&&t.length===n?(i=this.literals.all,a="all"):t.map((function(e){""!==i&&(i+=", "),""!==a&&(a+=","),l=r.find((function(t){return t.value===e})),i=""+i+(l?l.label:e),a=""+a+e})),{hideClose:o,label:this.literals[e]+": "+i,property:""+e,value:""+a}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromCheckboxGroup=function(e,t,r,n){var o=this;void 0===r&&(r=0),void 0===n&&(n=!1);var i="",a="";return t?(0===t.length?(i=this.literals.none,a="none"):r>0&&t.length===r?(i=this.literals.all,a="all"):t.map((function(e){""!==i&&(i+=", "),""!==a&&(a+=","),i=""+i+o.literals[e],a=""+a+e})),{hideClose:n,label:this.literals[e]+": "+i,property:""+e,value:""+a}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromRangeCharacter=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!0),null!==t.valInitial&&void 0!==t.valInitial||(t.valInitial=t.iniInitial),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),n&&t.iniInitial===t.valInitial&&t.iniFinal===t.valFinal?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],"'"+t.valInitial+"'","'"+t.valFinal+"'"]),property:""+e,value:t.valInitial+";"+t.valFinal}},e.prototype.makeDisclaimerFromRangeNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!0),null!==t.valInitial&&void 0!==t.valInitial||(t.valInitial=t.iniInitial),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),n&&t.iniInitial===t.valInitial&&t.iniFinal===t.valFinal?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],t.valInitial,t.valFinal]),property:""+e,value:t.valInitial+";"+t.valFinal}},e.prototype.makeDisclaimerFromRangeDate=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!0);var o=this.ajustDate(t.valInitial),i=this.ajustDate(t.valFinal);return this.isValidDate(o)||(o=t.iniInitial,t.valInitial=t.iniInitial),this.isValidDate(i)||(i=t.iniFinal,t.valFinal=t.iniFinal),n&&this.dateToQueryParam(t.iniInitial)===this.dateToQueryParam(o)&&this.dateToQueryParam(t.iniFinal)===this.dateToQueryParam(i)?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],o.toLocaleDateString(),i.toLocaleDateString()]),property:""+e,value:this.dateToQueryParam(o)+";"+this.dateToQueryParam(i)}},e.prototype.atzCharFromDisclamer=function(e,t,r){var n=r;return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),n},e.prototype.atzNumberFromDisclamer=function(e,t,r){var n=r;return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),n},e.prototype.atzBooleanFromDisclamer=function(e,t,r){var n=r;if(e&&e.length>0){var o=e.find((function(e){return e.property===t}));if(o&&null!==o.value&&void 0!==o.value)return"true"===o.value}return n},e.prototype.atzDateFromDisclamer=function(e,t,r){var n=this,o=this.ajustDate(r);return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(o=n.ajustDate(e.value),!0))})),o},e.prototype.atzMultiSelectCharFromDisclamer=function(e,t,r){return this.atzMultiSelectFromDisclamer("char",e,t,r)},e.prototype.atzMultiSelectNumberFromDisclamer=function(e,t,r){return this.atzMultiSelectFromDisclamer("number",e,t,r)},e.prototype.atzMultiSelectFromDisclamer=function(e,t,r,n){var o=[];return n.map((function(e){o.push(e.value)})),t&&t.length>0&&t.find((function(t){return t.property===r&&(null!==t.value&&"all"!==t.value&&"none"!==t.value&&(o=[],t.value.split(",").forEach((function(t){"char"===e&&o.push(t),"number"===e&&o.push(+t)})),!0))})),o},e.prototype.atzCheckboxFromDisclamer=function(e,t,r){var n=[];return r.map((function(e){n.push(e.value)})),e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&"all"!==e.value&&"none"!==e.value&&(n=[],e.value.split(",").forEach((function(e){n.push(e)})),!0))})),n},e.prototype.atzRangeCharFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeCharFromQueryParam(n,r)},e.prototype.atzRangeNumFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeNumFromQueryParam(n,r)},e.prototype.atzRangeDateFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeDateFromQueryParam(n,r)},e.prototype.atzRangeCharFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=e.split(";")[0],t.valFinal=e.split(";")[1],null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.atzRangeNumFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=+e.split(";")[0],t.valFinal=+e.split(";")[1],null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.atzRangeDateFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=this.queryParamToDate(e.split(";")[0]),t.valFinal=this.queryParamToDate(e.split(";")[1]),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.dateToQueryParam=function(e){var t=e.getDate(),r=e.getMonth()+1;return e.getFullYear()+"-"+this.pad(r)+"-"+this.pad(t)},e.prototype.queryParamToDate=function(e){var t=+e.split("-")[2],r=+e.split("-")[1],n=+e.split("-")[0];return new Date(n,r-1,t)},e.prototype.isValidDate=function(e){return e instanceof Date&&!isNaN(e.getTime())},e.prototype.ajustDate=function(e){return e instanceof Date?e:e?this.queryParamToDate(e.split("T")[0]):e},e.prototype.pad=function(e){return e<10?"0"+e:e},e}();var y=function(){function e(e,t,r){this.literals={},this.poNotification=e,this.poI18nPipe=t,this.literals=r,this.disclaimerUtil=new g(this.poNotification,this.poI18nPipe,this.literals)}return e.prototype.vldFieldCharacter=function(e,t){return!(!t||""===t.trim())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRequered,[this.literals[e]])}),!1)},e.prototype.vldRangeCharacter=function(e,t,r,n){return!r||!n||(!(r.trim().toUpperCase()>n.trim().toUpperCase())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1))},e.prototype.vldFieldNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),!(r&&!this.vldValueOfNumber(e,t))&&(!(!t||t<=0)||(0===t&&!0===n||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRequered,[this.literals[e]])}),!1)))},e.prototype.vldValueOfNumber=function(e,t){return!(t&&t<0)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1)},e.prototype.vldFieldPercent=function(e,t,r){return void 0===r&&(r=!1),!(r&&!this.vldValueOfPercent(e,t))&&!!this.vldFieldNumber(e,t)},e.prototype.vldValueOfPercent=function(e,t){return t&&t<0?(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1):!(t&&t>100)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1)},e.prototype.vldRangeNumber=function(e,t,r,n){return r||(r=0),n||(n=0),!(r>n)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1)},e.prototype.vldFieldDate=function(e,t){var r=this.disclaimerUtil.ajustDate(t);return!!this.disclaimerUtil.isValidDate(r)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldDate,[this.literals[e]])}),!1)},e.prototype.vldRangeDate=function(e,t,r,n){return!r||!n||(!(this.disclaimerUtil.ajustDate(r).getTime()>this.disclaimerUtil.ajustDate(n).getTime())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1))},e.prototype.vldFieldMultiSelect=function(e,t){return!(!t||0===t.length)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldSelected,[this.literals[e]])}),!1)},e.prototype.vldFieldCheckbox=function(e,t){return!(!t||0===t.length)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldSelected,[this.literals[e]])}),!1)},e.prototype.vldFieldFormat=function(e,t,r,n){void 0===n&&(n=!1);var o,i=!0;if(!t)return i;if(n&&(o=r,r=r.replace(/\./g,"")),t.length!==r.length)i=!1;else for(var a=0;a<r.length;a++){if("9"===r[a]&&"9"!==t[a].replace(/[0-9]/,"9")){i=!1;break}if("!"===r[a]&&"A"!==t[a].replace(/[A-Z]/,"A")){i=!1;break}}return n&&(r=o),i||this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldFormat,[this.literals[e],r])}),i},e}();var b=function(){function e(){}return e.makeFilterRangeCharacter=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e.makeFilterRangeNumber=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e.makeFilterRangeDate=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e}();var x=function(){function e(e){this.literals={},this.literals=e}return e.listToArrayCharacter=function(e){var t=new Array;return e&&""!==e&&(t=e.split(",")),t},e.ArrayToListCharacter=function(e){var t="";return e&&e.length>0&&(t=e.join(",")),t},e.isEmpty=function(e){var t=!0;for(var r in e)e.hasOwnProperty(r)&&(t=!1);return t},e.getChartValues=function(e){var t,r,n;(r=void 0,n=void 0,e.map((function(e){void 0===r&&void 0===n?(r=e.data[0],n=e.data[0]):(e.data<n&&(n=e.data[0]),e.data>r&&(r=e.data[0]))})),r>0&&n>0&&(t={maxValue:r,minValue:0}),r>0&&n<0&&(t={maxValue:r,minValue:n}),r<0&&n<0)&&(t={maxValue:n/3*-1,minValue:n});(r>0&&0===n&&(t={maxValue:r,minValue:0}),0===r&&n<0)&&(t={maxValue:n/3*-1,minValue:n});return 0===r&&0===n&&(t={maxValue:void 0,minValue:void 0}),t.maxValue=Math.round(t.maxValue),t.minValue=Math.round(t.minValue),t},e.atzMultiSelectListByOptions=function(e,t){var r;return t?(r=new Array,t.map((function(t){t&&e.findIndex((function(e){return e.value===t}))>=0&&r.push(t)})),r):t},e.prototype.loadOptionsMultiSelect=function(e,t){var r=this;t&&t.map((function(t){t&&-1===e.findIndex((function(e){return e.value===t}))&&e.push({label:"all"===t?r.literals.all:t,value:t})}))},e.prototype.loadOptionsSelect=function(e,t,r){void 0===r&&(r=!1),t&&t&&-1===e.findIndex((function(e){return e.value===t}))&&e.push({label:r?this.literals[t]:t,value:t})},e.prototype.compareObjects=function(e,t){if(!e||!t)return!1;if(Object.getOwnPropertyNames(e).length!==Object.getOwnPropertyNames(t).length)return!1;for(var r in e)if("$"!==r.substr(0,1)&&"_"!==r.substr(0,1)&&e[r]!==t[r])return!1;return!0},e.prototype.referenceGeneration=function(e,t){var r,n=t.getDate(),o=t.getMonth()+1,i=t.getFullYear();return""+(""+this.pad(i)+this.pad(o)+this.pad(n)+e)+(r=(r=(r=btoa(""+(new Date).getTime())).replace(/[=]/g,"")).slice(r.length-3,r.length))},e.prototype.pad=function(e){return e<10?"0"+e:e>99?(e+"").slice(2,4):e},e.prototype.focusInternalInput=function(e){document.getElementById(e).getElementsByClassName("po-input")[0].focus()},e}();var I=function(){function e(){}return e.downloadFile=function(e,t,r,n){var o=(n=!1!==n)?this.b64toBlob(e,r):e;this.download(o,t)},e.downloadData=function(e,t){if(void 0===t&&(t=null),e){t||(t=new F),t.fileName||(t.fileName="data.csv"),t.literals||(t.literals={}),t.columnDelimiter||(t.columnDelimiter=";"),t.columnList||(t.columnList=[]),t.columnExclude||(t.columnExclude=[]);var r=btoa(this.jsonToString(e,t));this.downloadFile(r,t.fileName,"text/csv")}},e.download=function(e,t){var r=[e],n=document.createElement("a"),o=window.URL.createObjectURL(new Blob(r,{type:e.type}));navigator.userAgent.toUpperCase().indexOf(".NET")>0||navigator.userAgent.toUpperCase().indexOf("EDGE")>0?window.navigator.msSaveOrOpenBlob(e,t):(n.href=o,n.setAttribute("download",t),document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(o),n.remove())},e.b64toBlob=function(e,t,r){t=t||"",r=r||512;for(var n=atob(e),o=[],i=0;i<n.length;i+=r){for(var a=n.slice(i,i+r),l=new Array(a.length),s=0;s<a.length;s++)l[s]=a.charCodeAt(s);var p=new Uint8Array(l);o.push(p)}return new Blob(o,{type:t})},e.jsonToString=function(e,t){if(!e||0===e.length)return"";var r,n=null,o=[];return(t.columnList&&t.columnList.length>0?t.columnList:Object.keys(e[0])).forEach((function(e){r=!0,t.columnExclude&&t.columnExclude.length>0&&-1!==t.columnExclude.indexOf(e)&&(r=!1),r&&(o.push(e),n=n?n+t.columnDelimiter:"",n+=t.literals[e]?t.literals[e]:e)})),e.reduce((function(e,r){var n=!0,i=null;return o.forEach((function(o){switch(n||(e+=t.columnDelimiter),null==(i=r[o])&&(i=""),typeof i){case"number":i=i.toLocaleString();break;case"boolean":i=t.literals[""+i]?t.literals[""+i]:i;break;case"object":i=JSON.stringify(i)}e+=i,n=!1})),e+"\n"}),n+"\n")},e}();var F=function(){};var S=function(){};var D=function(){};var P=function(){};var E=function(){function e(e){this.http=e,this.headers={headers:{"X-PO-Screen-Lock":"true"}},this.urlCadServidor="/dts/datasul-rest/resources/prg/btb/v1/servidoresExecucao",this.urlJobScheduler="/dts/datasul-rest/resources/prg/framework/v1/jobScheduler",this.urlJobExecution="/dts/datasul-rest/resources/prg/framework/v1/jobExecution"}return e.prototype.getFilteredItems=function(e){var t=new Array;return t.push("pageSize="+e.pageSize.toString()),t.push("page="+e.page.toString()),e.filter&&e.filter.length>0&&t.push("quickSearch="+e.filter),this.http.get(this.urlCadServidor+"?"+t.join("&"))},e.prototype.getObjectByValue=function(e){return this.http.get(this.urlCadServidor+"/"+e,this.headers)},e.prototype.createExecution=function(e,t){var r=JSON.parse(JSON.stringify(e).replace(/\\\\/g,"*|"));return t?this.http.post(""+this.urlJobScheduler,r,this.headers):this.http.post(""+this.urlJobScheduler,r)},e.prototype.createExecutionForNow=function(e,t){var r,n=new Date,o=JSON.parse(JSON.stringify(e).replace(/\\\\/g,"*|"));return o.businessParams&&0!==o.businessParams.length||(o.businessParams=[{chave:"",valor:""}]),(r={}).status="active",r.processID=o.programName,r.firstExecution=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate()+"T"+this.addZero(n.getHours())+":"+this.addZero(n.getMinutes())+":00.000Z",r.recurrent=!1,r.executionParameter={parametros:[{chave:"rpwServer",valor:o.executionServer},{chave:"RPW_PROGRAM",valor:o.externalName},{chave:"RPW_PRG_EMS5",valor:o.programEMS5?"yes":"no"},{chave:"RPW_PRG_VERS",valor:o.programVersion},{parametros_negocio:o.businessParams}]},t?this.http.post(""+this.urlJobScheduler,r,this.headers):this.http.post(""+this.urlJobScheduler,r)},e.prototype.getExecutionByJobScheduleID=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.urlJobExecution+"?jobScheduleID="+e;return this.getExecution(n,t).pipe(o.map((function(e){return r.transformExecution("jobScheduleID",e)})))},e.prototype.getExecutionByExecutionID=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.urlJobExecution+"/"+e;return this.getExecution(n,t).pipe(o.map((function(e){return r.transformExecution("executionID",e)})))},e.prototype.getExecution=function(e,t){return t?this.http.get(e,this.headers):this.http.get(e)},e.prototype.transformExecution=function(e,t){if(t&&t.items&&0!==t.items.length){t=t.items[0];var r=new D;return r.jobScheduleID=t.jobScheduleID,r.executionID=t.executionID,r.startedDate=t.startedDate,r.error=t.error,r.status=t.status,r}},e.prototype.followUpExcByJobScheduleID=function(e,t,r,n){void 0===n&&(n=!1),this.followUpExecution("jobScheduleID",e,t,r,n)},e.prototype.followUpExcByExecutionID=function(e,t,r,n){void 0===n&&(n=!1),this.followUpExecution("executionID",e,t,r,n)},e.prototype.followUpExecution=function(e,t,r,n,o){var i=this;this.jobExecutionSubscription$=null;var a=setInterval((function(){var r=new D;r.jobScheduleID="jobScheduleID"===e?t:"",r.executionID="executionID"===e?t:"",r.startedDate=null,r.error="",r.status="PENDING",i.jobExecutionSubscription$||("jobScheduleID"===e&&(i.jobExecutionSubscription$=i.getExecutionByJobScheduleID(t,o).subscribe((function(e){i.followUpExecReturnOk(t,r,e,a,n)}),(function(e){i.followUpExecReturnError(e,r,a,n)}))),"executionID"===e&&(i.jobExecutionSubscription$=i.getExecutionByExecutionID(t,o).subscribe((function(e){i.followUpExecReturnOk(t,r,e,a,n)}),(function(e){i.followUpExecReturnError(e,r,a,n)}))))}),r)},e.prototype.followUpExecReturnOk=function(e,t,r,n,o){r?t=r:(t.error="Agendamento não encontrado com ID: "+e,t.status="FAILURE"),o(t)&&"SUCCESS"!==t.status&&"FAILURE"!==t.status||clearInterval(n),this.jobExecutionSubscription$=null},e.prototype.followUpExecReturnError=function(e,t,n,o){var i="";e instanceof r.HttpErrorResponse?(i=e.message,e.error&&(i="",e.error.code&&(i=e.error.code),e.error.message&&(i=i+" - "+e.error.message),e.error.detailedMessage&&(i=i+" - "+e.error.detailedMessage))):i=e,t.error=i,t.status="FAILURE",o(t),clearInterval(n),this.jobExecutionSubscription$=null},e.prototype.addZero=function(e){var t=""+e;return e<10&&(t="0"+e),t},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.HttpClient}]},e}();var j=function(){function e(e,r,n){this.poI18nService=e,this.rpwService=r,this.poNotification=n,this.programEMS5=!1,this.programVersion="",this.disabledParams=!1,this.loading=!1,this.endExecution=new t.EventEmitter,this.jsonObject={},this.literals={}}return e.prototype.ngOnInit=function(){this.setupComponents()},e.prototype.setupComponents=function(){this.executionTypeOptions=[{label:"Executar Hoje",value:1},{label:"Agendar Execução",value:2}],this.frequencyOptions=[{label:"Uma vez no dia",value:"no"},{label:"Várias vezes no dia",value:"yes"}],this.frequencyTypeOptions=[{label:"Hora(s)",value:"hour"},{label:"Minuto(s)",value:"minute"}],this.weeklyOptions=[{label:"Domingo",value:"Sunday"},{label:"Segunda",value:"Monday"},{label:"Terça",value:"Tuesday"},{label:"Quarta",value:"Wednesday"},{label:"Quinta",value:"Thursday"},{label:"Sexta",value:"Friday"},{label:"Sábado",value:"Saturday"}],this.zoomRpwServiceColumns=[{property:"code",label:"Servidor",type:"string",width:"20%"},{property:"name",label:"Descrição",type:"string",width:"80%"}],this.model=new S,this.model.executionType=1,this.model.repeatType=1,this.model.repeatExecution=!1},e.prototype.setScheduleParameters=function(e){e&&(this.model=e)},e.prototype.fieldRpwServiceFormat=function(e){return e.code+" - "+e.name},e.prototype.isExecutionSchedule=function(){return 2===this.model.executionType},e.prototype.isRepeatExecution=function(){return this.model.repeatExecution},e.prototype.isFrenquency=function(){return"yes"===this.model.frequency},e.prototype.changeRepeatExecution=function(){var e=new Date;this.model.execAppointHourInit||(this.model.execAppointHourInit=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())),this.model.execAppointHourFinal||(this.model.execAppointHourFinal=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())),this.model.selectWeeklys=[],this.model.dayOfMonth=0,this.model.frequency="no",this.model.frequencyType="hour",this.model.frequencyValue=0},e.prototype.changeExecutionType=function(){var e=new Date;this.model.execAppointDate=e,this.model.execAppointHour=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())},e.prototype.changeTypeFrequency=function(){},e.prototype.getActiveTab=function(e){return this.model.repeatType===e},e.prototype.setActiveTab=function(e){this.model.repeatType=e},e.prototype.addZero=function(e){var t=""+e;return e<10&&(t="0"+e),t},e.prototype.executeSchedule=function(){var e=this;if(!this.disabledParams&&this.validate()){if(this.jsonObject={},this.jsonObject.status="active",this.jsonObject.processID=this.programName,this.jsonObject.recurrent=this.model.repeatExecution,this.jsonObject.executionParameter={},1===this.model.executionType){var t=new Date;this.jsonObject.firstExecution=t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+"T"+this.addZero(t.getHours())+":"+this.addZero(t.getMinutes())+":00.000Z"}2===this.model.executionType&&(this.jsonObject.firstExecution=this.model.execAppointDate+"T"+this.model.execAppointHour+":00.000Z"),this.jsonObject.executionParameter.parametros=[],this.jsonObject.executionParameter.parametros[0]={chave:"rpwServer",valor:this.model.executionServer},this.jsonObject.executionParameter.parametros[1]={chave:"RPW_PROGRAM",valor:this.externalName},this.jsonObject.executionParameter.parametros[2]={chave:"RPW_PRG_EMS5",valor:this.programEMS5?"yes":"no"},this.jsonObject.executionParameter.parametros[3]={chave:"RPW_PRG_VERS",valor:this.programVersion},this.jsonObject.executionParameter.parametros[4]={},this.jsonObject.executionParameter.parametros[4].parametros_negocio=this.parameters,this.rpwService.createExecution(this.jsonObject,this.loading).subscribe((function(){e.poNotification.success("Agendamento realizado com sucesso !")})),this.model.repeatExecution&&(1===this.model.repeatType&&(this.jsonObject.daily={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m")}),2===this.model.repeatType&&(this.jsonObject.weekly={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m"),daysOfWeek:this.model.selectWeeklys}),3===this.model.repeatType&&(this.jsonObject.monthly={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m"),day:this.model.dayOfMonth}),this.isFrenquency()&&(this.jsonObject.rangeExecutions={frequency:{type:this.model.frequencyType,value:this.model.frequencyValue},rangeLimit:{hour:this.getHourOrMinute(this.model.execAppointHourFinal,"h"),minute:this.getHourOrMinute(this.model.execAppointHourFinal,"m")}}),this.rpwService.createExecution(this.jsonObject,this.loading).subscribe((function(){}))),this.endExecution.emit(this.model)}},e.prototype.getHourOrMinute=function(e,t){return"h"===t?+e.substring(0,2):"m"===t?+e.substring(3,6):void 0},e.prototype.compareHour=function(e,t){return e!==t&&(this.getHourOrMinute(e,"h")<this.getHourOrMinute(t,"h")||!(this.getHourOrMinute(e,"m")>this.getHourOrMinute(t,"m")))},e.prototype.validate=function(){if(!this.scheduleExecutionForm.valid)return this.poNotification.error("Verifique as inconsistências em tela."),!1;if(!this.model.executionServer)return this.poNotification.error("Servidor de Execução não foi informado."),!1;if(this.isExecutionSchedule()&&(!this.model.execAppointDate||!this.model.execAppointHour))return this.poNotification.error("Informar a data e a hora para agendamento da execução."),!1;if(this.model.repeatExecution){if(!this.model.execAppointHourInit)return this.poNotification.error("Informar a hora de início para a execução."),!1;if(2===this.model.repeatType&&0===this.model.selectWeeklys.length)return this.poNotification.error("Informar os dias da semana para a execução."),!1;if(3===this.model.repeatType&&!this.model.dayOfMonth)return this.poNotification.error("Informar o dia para a execução."),!1;if(this.isFrenquency()){if(!this.compareHour(this.model.execAppointHourInit,this.model.execAppointHourFinal))return this.poNotification.error("Hora Fim deve ser maior que Hora Início."),!1;if(0===this.model.frequencyValue)return this.poNotification.error("Informar a frequência de execução (A cada hora/minuto)."),!1}}return!0},e.decorators=[{type:t.Component,args:[{selector:"app-totvs-schedule-execution",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ção"\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álida"\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ção"\r\n p-placeholder="Servidor de Execução"\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ência ?"\r\n p-label-off="Não"\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ária" \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ência"\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ício"\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álida"\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álida"\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ência"\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ício"\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álida"\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álida"\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ês"\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ência"\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ício"\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álida"\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álida"\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',styles:[""]}]}],e.ctorParameters=function(){return[{type:i.PoI18nService},{type:E},{type:i.PoNotificationService}]},e.propDecorators={scheduleExecutionForm:[{type:t.ViewChild,args:["scheduleExecutionForm",{static:!0}]}],programName:[{type:t.Input}],externalName:[{type:t.Input}],programEMS5:[{type:t.Input}],programVersion:[{type:t.Input}],parameters:[{type:t.Input}],disabledParams:[{type:t.Input}],loading:[{type:t.Input}],endExecution:[{type:t.Output}]},e}();var w=function(){function e(){}return e.prototype.transform=function(e,t){void 0===t&&(t="dd/MM/yyyy");var r=e.split("-"),n=r[0],o=r[1],i=r[2];return t.replace("dd",i).replace("MM",o).replace("yyyy",n)},e.decorators=[{type:t.Pipe,args:[{name:"dtsDateFormat"}]}],e}(),O=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[E]}},e.decorators=[{type:t.NgModule,args:[{declarations:[j,w],imports:[l.CommonModule,i.PoModule,a.FormsModule,r.HttpClientModule],exports:[j,w],providers:[E]}]}],e}();e.BreadcrumbControlService=d,e.CacheParamsService=h,e.DateUtil=v,e.DisclaimerUtil=g,e.DownloadDataParams=F,e.DtsBackofficeUtilsModule=O,e.DtsDateFormatPipe=w,e.ExecutionParameters=P,e.ExecutionStatus=D,e.FieldValidationUtil=y,e.FileUtil=I,e.FilterRangeUtil=b,e.GenericFunctionsUtils=x,e.MenuDatasulService=m,e.ProfileService=u,e.ReportFormats={XLSX:"xlsx",PDF:"pdf",DOCX:"docx",HTML:"html"},e.ReportService=c,e.ScheduleParameters=S,e.TotvsScheduleExecutionComponent=j,e.TotvsScheduleExecutionService=E,e.TranslateService=f,e.UserLoginService=s,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
|
-
//# sourceMappingURL=dts-backoffice-util.umd.min.js.map
|