oxpi-nglib 1.0.0 → 1.0.3

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 (82) hide show
  1. package/esm2020/lib/cadastros/funcionarios/funcionario-add-dialog/funcionario-add-dialog.component.mjs +74 -0
  2. package/esm2020/lib/cadastros/funcionarios/funcionario-edit-dialog/funcionario-edit-dialog.component.mjs +68 -0
  3. package/esm2020/lib/cadastros/funcionarios/funcionario-form/funcionario-form.component.mjs +38 -0
  4. package/esm2020/lib/cadastros/funcionarios/funcionarios/funcionarios.component.mjs +157 -0
  5. package/esm2020/lib/cadastros/produtos/produto-add-dialog/produto-add-dialog.component.mjs +79 -0
  6. package/esm2020/lib/cadastros/produtos/produto-busca-filtros-dialog/produto-busca-filtros-dialog.component.mjs +56 -0
  7. package/esm2020/lib/cadastros/produtos/produto-edit-dialog/produto-edit-dialog.component.mjs +68 -0
  8. package/esm2020/lib/cadastros/produtos/produto-form/produto-form.component.mjs +343 -0
  9. package/esm2020/lib/cadastros/produtos/produtos/produtos.component.mjs +211 -0
  10. package/esm2020/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-add-dialog/produto-categoria-cardapio-add-dialog.component.mjs +69 -0
  11. package/esm2020/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-edit-dialog/produto-categoria-cardapio-edit-dialog.component.mjs +68 -0
  12. package/esm2020/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-selecao-dialog/produto-categoria-cardapio-selecao-dialog.component.mjs +106 -0
  13. package/esm2020/lib/cadastros/produtos-categoria-cardapio/produtos-categorias-cardapio/produtos-categorias-cardapio.component.mjs +156 -0
  14. package/esm2020/lib/cadastros/produtos-grupos/mover-grupo-dialog/mover-grupo-dialog.component.mjs +65 -0
  15. package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-add-dialog/produto-grupo-add-dialog.component.mjs +69 -0
  16. package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-edit-dialog/produto-grupo-edit-dialog.component.mjs +68 -0
  17. package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-form/produto-grupo-form.component.mjs +18 -0
  18. package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-selecao-dialog/produto-grupo-selecao-dialog.component.mjs +106 -0
  19. package/esm2020/lib/cadastros/produtos-grupos/produtos-grupos/produtos-grupos.component.mjs +179 -0
  20. package/esm2020/lib/cadastros/produtos-ncm-dialog/produtos-ncm-dialog.component.mjs +58 -0
  21. package/esm2020/lib/cadastros/produtos-subgrupos/produto-subgrupo-add-dialog/produto-subgrupo-add-dialog.component.mjs +71 -0
  22. package/esm2020/lib/cadastros/produtos-subgrupos/produto-subgrupo-edit-dialog/produto-subgrupo-edit-dialog.component.mjs +68 -0
  23. package/esm2020/lib/cadastros/produtos-subgrupos/produto-subgrupo-selecao-dialog/produto-subgrupo-selecao-dialog.component.mjs +106 -0
  24. package/esm2020/lib/cadastros/produtos-subgrupos/produtos-subgrupos/produtos-subgrupos.component.mjs +156 -0
  25. package/esm2020/lib/models/entidades/funcionario.mjs +12 -0
  26. package/esm2020/lib/models/entidades/produto-grupo.mjs +9 -0
  27. package/esm2020/lib/models/entidades/produto-ncm.mjs +2 -0
  28. package/esm2020/lib/models/entidades/produto.mjs +106 -0
  29. package/esm2020/lib/models/entidades/setor-estoque.mjs +2 -0
  30. package/esm2020/lib/models/infra/number-parser.mjs +1 -1
  31. package/esm2020/lib/models/infra/selecao-utils.mjs +4 -2
  32. package/esm2020/lib/models/infra/validations.mjs +1 -1
  33. package/esm2020/lib/models/tuple.mjs +2 -0
  34. package/esm2020/lib/oxpi-nglib.module.mjs +92 -5
  35. package/esm2020/lib/providers/auth-data.service.mjs +219 -0
  36. package/esm2020/lib/providers/common-web-service.mjs +220 -0
  37. package/esm2020/lib/providers/notification.service.mjs +29 -0
  38. package/esm2020/public-api.mjs +32 -1
  39. package/fesm2015/oxpi-nglib.mjs +3417 -663
  40. package/fesm2015/oxpi-nglib.mjs.map +1 -1
  41. package/fesm2020/oxpi-nglib.mjs +3392 -663
  42. package/fesm2020/oxpi-nglib.mjs.map +1 -1
  43. package/lib/cadastros/funcionarios/funcionario-add-dialog/funcionario-add-dialog.component.d.ts +27 -0
  44. package/lib/cadastros/funcionarios/funcionario-edit-dialog/funcionario-edit-dialog.component.d.ts +27 -0
  45. package/lib/cadastros/funcionarios/funcionario-form/funcionario-form.component.d.ts +15 -0
  46. package/lib/cadastros/funcionarios/funcionarios/funcionarios.component.d.ts +36 -0
  47. package/lib/cadastros/produtos/produto-add-dialog/produto-add-dialog.component.d.ts +28 -0
  48. package/lib/cadastros/produtos/produto-busca-filtros-dialog/produto-busca-filtros-dialog.component.d.ts +27 -0
  49. package/lib/cadastros/produtos/produto-edit-dialog/produto-edit-dialog.component.d.ts +27 -0
  50. package/lib/cadastros/produtos/produto-form/produto-form.component.d.ts +78 -0
  51. package/lib/cadastros/produtos/produtos/produtos.component.d.ts +44 -0
  52. package/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-add-dialog/produto-categoria-cardapio-add-dialog.component.d.ts +27 -0
  53. package/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-edit-dialog/produto-categoria-cardapio-edit-dialog.component.d.ts +27 -0
  54. package/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-selecao-dialog/produto-categoria-cardapio-selecao-dialog.component.d.ts +35 -0
  55. package/lib/cadastros/produtos-categoria-cardapio/produtos-categorias-cardapio/produtos-categorias-cardapio.component.d.ts +36 -0
  56. package/lib/cadastros/produtos-grupos/mover-grupo-dialog/mover-grupo-dialog.component.d.ts +21 -0
  57. package/lib/cadastros/produtos-grupos/produto-grupo-add-dialog/produto-grupo-add-dialog.component.d.ts +27 -0
  58. package/lib/cadastros/produtos-grupos/produto-grupo-edit-dialog/produto-grupo-edit-dialog.component.d.ts +27 -0
  59. package/lib/cadastros/produtos-grupos/produto-grupo-form/produto-grupo-form.component.d.ts +10 -0
  60. package/lib/cadastros/produtos-grupos/produto-grupo-selecao-dialog/produto-grupo-selecao-dialog.component.d.ts +35 -0
  61. package/lib/cadastros/produtos-grupos/produtos-grupos/produtos-grupos.component.d.ts +37 -0
  62. package/lib/cadastros/produtos-ncm-dialog/produtos-ncm-dialog.component.d.ts +29 -0
  63. package/lib/cadastros/produtos-subgrupos/produto-subgrupo-add-dialog/produto-subgrupo-add-dialog.component.d.ts +27 -0
  64. package/lib/cadastros/produtos-subgrupos/produto-subgrupo-edit-dialog/produto-subgrupo-edit-dialog.component.d.ts +28 -0
  65. package/lib/cadastros/produtos-subgrupos/produto-subgrupo-selecao-dialog/produto-subgrupo-selecao-dialog.component.d.ts +35 -0
  66. package/lib/cadastros/produtos-subgrupos/produtos-subgrupos/produtos-subgrupos.component.d.ts +36 -0
  67. package/lib/models/entidades/funcionario.d.ts +15 -0
  68. package/lib/models/entidades/produto-grupo.d.ts +20 -0
  69. package/lib/models/entidades/produto-ncm.d.ts +10 -0
  70. package/lib/models/entidades/produto.d.ts +74 -0
  71. package/lib/models/entidades/setor-estoque.d.ts +7 -0
  72. package/lib/models/infra/number-parser.d.ts +1 -1
  73. package/lib/models/infra/selecao-utils.d.ts +1 -1
  74. package/lib/models/infra/validations.d.ts +3 -3
  75. package/lib/models/tuple.d.ts +4 -0
  76. package/lib/oxpi-nglib.module.d.ts +34 -7
  77. package/lib/providers/auth-data.service.d.ts +20 -0
  78. package/lib/providers/common-web-service.d.ts +80 -0
  79. package/lib/providers/notification.service.d.ts +12 -0
  80. package/package.json +1 -1
  81. package/public-api.d.ts +31 -0
  82. package/styles/cadastros-listagens-form.scss +15 -0
@@ -1,68 +1,3283 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input, EventEmitter, Output, HostListener, Inject, Pipe, NgModule, Injectable } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import * as i2 from '@angular/material/button';
2
+ import { Injectable, EventEmitter, Component, Input, Inject, Output, HostListener, Pipe, NgModule } from '@angular/core';
3
+ import * as i3 from '@angular/material/dialog';
4
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
5
+ import * as i1 from '@angular/common/http';
6
+ import { HttpParams, HttpHeaders, HttpEventType } from '@angular/common/http';
7
+ import { map } from 'rxjs';
8
+ import * as i1$1 from '@angular/material/snack-bar';
9
+ import * as i6 from '@angular/common';
10
+ import * as i6$1 from '@angular/material/button';
5
11
  import { MatButtonModule } from '@angular/material/button';
6
- import * as i3 from '@angular/material/icon';
12
+ import * as i7$1 from '@angular/material/icon';
7
13
  import { MatIconModule } from '@angular/material/icon';
8
- import * as i1$1 from '@angular/forms';
14
+ import * as i7 from '@angular/forms';
9
15
  import { FormsModule } from '@angular/forms';
10
- import * as i1$2 from '@angular/material/dialog';
11
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
16
+ import * as i4 from '@angular/material/select';
17
+ import { MatSelectModule } from '@angular/material/select';
18
+ import * as i5 from '@angular/material/core';
19
+ import { trigger, transition, style, animate } from '@angular/animations';
20
+ import * as i12 from '@angular/material/autocomplete';
21
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
12
22
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
13
- import * as i1$3 from '@angular/platform-browser';
23
+ import * as i1$2 from '@angular/platform-browser';
14
24
  import { BrowserModule } from '@angular/platform-browser';
15
- import { trigger, transition, style, animate } from '@angular/animations';
16
25
  import * as FileSaver from 'file-saver';
17
26
 
18
- class BusyIndicatorComponent {
19
- constructor() {
27
+ function valTextEmpty(v) {
28
+ return v === null ||
29
+ v === undefined ||
30
+ v.trim() === '';
31
+ }
32
+ function valNumberEmpty(v) {
33
+ return v === null ||
34
+ v === undefined ||
35
+ v === 0;
36
+ }
37
+ function valTextMax(v, max) {
38
+ return v.length > max;
39
+ }
40
+ function valNumberMin(v, min) {
41
+ if (v === null || v === undefined)
42
+ return true;
43
+ return v <= min;
44
+ }
45
+
46
+ function valida(item, focus) {
47
+ if (valTextEmpty(item.nome)) {
48
+ focus.set('nome');
49
+ return 'Digite um nome válido.';
50
+ }
51
+ if (valNumberEmpty(item.cargoId)) {
52
+ return 'Escolha um cargo.';
53
+ }
54
+ return null;
55
+ }
56
+
57
+ class FocusService {
58
+ constructor() {
59
+ }
60
+ hasInit() {
61
+ return this._element !== undefined;
62
+ }
63
+ registerElementById(name) {
64
+ this.registerElement(document.getElementById(name));
65
+ }
66
+ registerElement(element) {
67
+ if (element === null || element === undefined)
68
+ return;
69
+ this._element = element;
70
+ //this._items = this.getItems();
71
+ console.info(element);
72
+ element.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
73
+ }
74
+ registerWindow() {
75
+ this._element = null;
76
+ //this._items = this.getItems();
77
+ window.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
78
+ }
79
+ unregisterElementById(name) {
80
+ this.unregisterElement(document.getElementById(name));
81
+ }
82
+ unregisterElement(element) {
83
+ if (element === null || element === undefined)
84
+ return;
85
+ element.removeEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
86
+ }
87
+ handleKeyboardEvent(event) {
88
+ if (event.keyCode !== 13)
89
+ return;
90
+ if (event.target.nodeName === "BUTTON")
91
+ return;
92
+ const items = this.getItems();
93
+ const index = Array.prototype.indexOf.call(items, event.target);
94
+ const nextIndex = index + 1;
95
+ if (nextIndex > items.length - 1)
96
+ return;
97
+ const i = items[index + 1];
98
+ if (i.tabIndex > -1)
99
+ i.focus();
100
+ event.preventDefault();
101
+ }
102
+ setFirst() {
103
+ const el = this.getItems()[0]; //[0];
104
+ if (el !== undefined)
105
+ el.focus();
106
+ }
107
+ getItems() {
108
+ const query = this._element !== null && this._element !== undefined ?
109
+ this._element.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])') :
110
+ document.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])');
111
+ const items = [];
112
+ for (let index = 0; index < query.length; index++) {
113
+ const el = query[index];
114
+ if (el.tabIndex > 0)
115
+ items.push(el);
116
+ }
117
+ return items;
118
+ }
119
+ set(id) {
120
+ const el = document.getElementById(id);
121
+ if (el === null)
122
+ return;
123
+ el.focus();
124
+ }
125
+ }
126
+
127
+ class CommonWebService {
128
+ constructor(http) {
129
+ this.http = http;
130
+ this.ROOT_URL = '';
131
+ this.GERENCIAL_URL = '';
132
+ this.FUNCIONARIO_BASE_URL = '';
133
+ this.FUNCIONARIO_CARGO_BASE_URL = '';
134
+ this.token = '';
135
+ this.PRODUTO_BASE_URL = '';
136
+ this.PRODUTO_GRUPO_BASE_URL = '';
137
+ this.PRODUTO_SUBGRUPO_BASE_URL = '';
138
+ this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL = '';
139
+ this.ESTOQUE_URL = '';
140
+ this.MEDIA_BASE_URL = '';
141
+ this.MEDIA_PRODUTO_IMAGEM_URL = '';
142
+ }
143
+ setToken(token) {
144
+ this.token = token;
145
+ }
146
+ start(rootUrl) {
147
+ this.ROOT_URL = rootUrl;
148
+ this.FUNCIONARIO_BASE_URL = rootUrl + "Funcionario/";
149
+ this.FUNCIONARIO_CARGO_BASE_URL = rootUrl + "FuncionarioCargo/";
150
+ this.PRODUTO_BASE_URL = rootUrl + "ProdutoFiscal/";
151
+ this.PRODUTO_GRUPO_BASE_URL = rootUrl + "ProdutoGrupo/";
152
+ this.PRODUTO_SUBGRUPO_BASE_URL = rootUrl + "ProdutoSubgrupo/";
153
+ this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL = rootUrl + "ProdutoCategoriaCardapio/";
154
+ this.ESTOQUE_URL = rootUrl + 'Estoque/';
155
+ this.GERENCIAL_URL = rootUrl + 'Gerencial/';
156
+ this.MEDIA_BASE_URL = this.GERENCIAL_URL + "Media/";
157
+ this.MEDIA_PRODUTO_IMAGEM_URL = this.GERENCIAL_URL + 'GetProdutoImagem/';
158
+ }
159
+ getFuncionarios() {
160
+ const url = this.FUNCIONARIO_BASE_URL;
161
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
162
+ }
163
+ getFuncionariosCargos() {
164
+ const url = this.FUNCIONARIO_CARGO_BASE_URL;
165
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
166
+ }
167
+ buscaFuncionario(setting) {
168
+ const url = this.FUNCIONARIO_BASE_URL + CommonWebService.URL_PART_BUSCA;
169
+ return this.http.post(url, JSON.stringify(setting), this.getHttpOptions()).pipe(map(data => data));
170
+ }
171
+ getNextIdFuncionario() {
172
+ const url = this.FUNCIONARIO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
173
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
174
+ }
175
+ getAllFuncionario() {
176
+ const url = this.FUNCIONARIO_BASE_URL;
177
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
178
+ }
179
+ saveFuncionario(s) {
180
+ const url = this.FUNCIONARIO_BASE_URL;
181
+ return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
182
+ }
183
+ addFuncionario(p) {
184
+ const url = this.FUNCIONARIO_BASE_URL;
185
+ return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
186
+ }
187
+ deleteFuncionario(id) {
188
+ const url = this.FUNCIONARIO_BASE_URL + id;
189
+ return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
190
+ }
191
+ buscaPaginadaProdutos(setting, page, pageSize) {
192
+ const url = this.PRODUTO_BASE_URL + CommonWebService.URL_PART_BUSCA_PAGINADA;
193
+ const p = { setting: setting, page: page, pageSize: pageSize };
194
+ return this.http.post(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
195
+ }
196
+ getNextIdProduto() {
197
+ const url = this.PRODUTO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
198
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
199
+ }
200
+ saveProduto(s) {
201
+ const url = this.PRODUTO_BASE_URL;
202
+ return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
203
+ }
204
+ addProduto(p) {
205
+ const url = this.PRODUTO_BASE_URL;
206
+ return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
207
+ }
208
+ deleteProduto(id) {
209
+ const url = this.PRODUTO_BASE_URL + id;
210
+ return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
211
+ }
212
+ buscaProdutoGrupo(setting) {
213
+ const url = this.PRODUTO_GRUPO_BASE_URL + CommonWebService.URL_PART_BUSCA;
214
+ return this.http.post(url, JSON.stringify(setting), this.getHttpOptions()).pipe(map(data => data));
215
+ }
216
+ getAllProdutoGrupo() {
217
+ const url = this.PRODUTO_GRUPO_BASE_URL;
218
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
219
+ }
220
+ getNextIdProdutoGrupo() {
221
+ const url = this.PRODUTO_GRUPO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
222
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
223
+ }
224
+ saveProdutoGrupo(s) {
225
+ const url = this.PRODUTO_GRUPO_BASE_URL;
226
+ return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
227
+ }
228
+ transfereProdutoGrupo(grupoId, novoGrupoId) {
229
+ const url = this.PRODUTO_BASE_URL + 'AlteraGrupo';
230
+ const p = { oldId: grupoId, newId: novoGrupoId };
231
+ return this.http.post(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
232
+ }
233
+ addProdutoGrupo(p) {
234
+ const url = this.PRODUTO_GRUPO_BASE_URL;
235
+ return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
236
+ }
237
+ deleteProdutoGrupo(id) {
238
+ const url = this.PRODUTO_GRUPO_BASE_URL + id;
239
+ return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
240
+ }
241
+ buscaNcm(ncm) {
242
+ const url = this.PRODUTO_BASE_URL + 'BuscaNCM/';
243
+ const params = new HttpParams()
244
+ .set("ncm", '' + ncm);
245
+ return this.http.get(url, this.getHttpOptions(params)).pipe(map(data => data));
246
+ }
247
+ findNcm(ncm) {
248
+ const url = this.PRODUTO_BASE_URL + 'FindNCM/';
249
+ const params = new HttpParams()
250
+ .set("ncm", '' + ncm);
251
+ return this.http.get(url, this.getHttpOptions(params)).pipe(map(data => data));
252
+ }
253
+ buscaProdutoSubgrupo(setting) {
254
+ const url = this.PRODUTO_SUBGRUPO_BASE_URL + CommonWebService.URL_PART_BUSCA;
255
+ return this.http.post(url, JSON.stringify(setting), this.getHttpOptions()).pipe(map(data => data));
256
+ }
257
+ getNextIdProdutoSubgrupo() {
258
+ const url = this.PRODUTO_SUBGRUPO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
259
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
260
+ }
261
+ saveProdutoSubgrupo(s) {
262
+ const url = this.PRODUTO_SUBGRUPO_BASE_URL;
263
+ return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
264
+ }
265
+ addProdutoSubgrupo(p) {
266
+ const url = this.PRODUTO_SUBGRUPO_BASE_URL;
267
+ return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
268
+ }
269
+ deleteProdutoSubgrupo(id) {
270
+ const url = this.PRODUTO_SUBGRUPO_BASE_URL + id;
271
+ return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
272
+ }
273
+ buscaProdutoCategoriaCardapio(setting) {
274
+ const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL + CommonWebService.URL_PART_BUSCA;
275
+ return this.http.post(url, JSON.stringify(setting), this.getHttpOptions()).pipe(map(data => data));
276
+ }
277
+ getNextIdProdutoCategoriaCardapio() {
278
+ const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
279
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
280
+ }
281
+ saveProdutoCategoriaCardapio(s) {
282
+ const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL;
283
+ return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
284
+ }
285
+ addProdutoCategoriaCardapio(p) {
286
+ const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL;
287
+ return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
288
+ }
289
+ deleteProdutoCategoriaCardapio(id) {
290
+ const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL + id;
291
+ return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
292
+ }
293
+ getAllSetores() {
294
+ const url = this.ESTOQUE_URL + 'Setor/';
295
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
296
+ }
297
+ getHttpOptions(parameters) {
298
+ return {
299
+ headers: new HttpHeaders({
300
+ 'Content-Type': 'application/json',
301
+ "Accept": "application/json",
302
+ "Authorization": 'token ' + this.token,
303
+ }),
304
+ params: parameters
305
+ };
306
+ }
307
+ getExcelOptions(parameters) {
308
+ return {
309
+ headers: new HttpHeaders({
310
+ 'Content-Type': 'application/json',
311
+ "Accept": "application/json",
312
+ "Authorization": 'token ' + this.token,
313
+ }),
314
+ params: parameters,
315
+ responseType: 'arraybuffer',
316
+ };
317
+ }
318
+ getHtmlOptions(parameters) {
319
+ return {
320
+ headers: new HttpHeaders({
321
+ 'Content-Type': 'application/json',
322
+ "Accept": "application/json",
323
+ "Authorization": 'token ' + this.token,
324
+ }),
325
+ params: parameters,
326
+ responseType: 'text',
327
+ };
328
+ }
329
+ }
330
+ CommonWebService.URL_PART_BUSCA = "Busca/";
331
+ CommonWebService.URL_PART_NEXT_ID = "GetNextId/";
332
+ CommonWebService.URL_PART_BUSCA_PAGINADA = "BuscaPaginada/";
333
+ CommonWebService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CommonWebService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
334
+ CommonWebService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CommonWebService, providedIn: 'root' });
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CommonWebService, decorators: [{
336
+ type: Injectable,
337
+ args: [{
338
+ providedIn: 'root'
339
+ }]
340
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
341
+
342
+ class NotificationService {
343
+ constructor(snackBar) {
344
+ this.snackBar = snackBar;
345
+ }
346
+ showHttpError(res) {
347
+ this.snackBar.open(`Ocorreu um erro de conexão. Erro ${res.status}: ${res.statusText}`);
348
+ }
349
+ showMsg(msg) {
350
+ this.snackBar.open(msg);
351
+ }
352
+ showMsgError(msg) {
353
+ this.snackBar.open(msg, undefined, {
354
+ duration: 2000,
355
+ panelClass: ['red-snackbar']
356
+ });
357
+ }
358
+ }
359
+ NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NotificationService, deps: [{ token: i1$1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
360
+ NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NotificationService, providedIn: 'root' });
361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NotificationService, decorators: [{
362
+ type: Injectable,
363
+ args: [{
364
+ providedIn: 'root'
365
+ }]
366
+ }], ctorParameters: function () { return [{ type: i1$1.MatSnackBar }]; } });
367
+
368
+ const SM_WIDTH = 576;
369
+ const MD_WIDTH = 768;
370
+ const LG_WIDTH = 992;
371
+ const XL_WIDTH = 1200;
372
+ const XXL_WIDTH = 1400;
373
+ class ScreenHelperService {
374
+ constructor() {
375
+ this.changedMobileScreen = new EventEmitter();
376
+ this.changedMediumScreen = new EventEmitter();
377
+ this.changedLargeScreen = new EventEmitter();
378
+ this.changedXLargeScreen = new EventEmitter();
379
+ this.changedXXLargeScreen = new EventEmitter();
380
+ this.changedMinSmallScreen = new EventEmitter();
381
+ this.changedMinMediumScreen = new EventEmitter();
382
+ this.changedMinLargeScreen = new EventEmitter();
383
+ this.changedMinXLargeScreen = new EventEmitter();
384
+ this.changedMinXXLargeScreen = new EventEmitter();
385
+ this.mobileScreen = false;
386
+ this.isMedium = false;
387
+ this.isLarge = false;
388
+ this.isXLarge = false;
389
+ this.isXXLarge = false;
390
+ this.minSmall = false;
391
+ this.minMedium = false;
392
+ this.minLarge = false;
393
+ this.minXLarge = false;
394
+ this.minXXLarge = false;
395
+ this.determinaMobileScreen();
396
+ window.addEventListener('resize', (event) => {
397
+ this.determinaMobileScreen();
398
+ });
399
+ }
400
+ determinaMobileScreen() {
401
+ const width = window.innerWidth;
402
+ const isSmall = width <= SM_WIDTH;
403
+ const isMedium = width <= MD_WIDTH;
404
+ const isLarge = width <= LG_WIDTH;
405
+ const isXLarge = width <= XL_WIDTH;
406
+ const isXXLarge = width <= XXL_WIDTH;
407
+ const minSmall = width >= SM_WIDTH;
408
+ const minMedium = width >= MD_WIDTH;
409
+ const minLarge = width >= LG_WIDTH;
410
+ const minXLarge = width >= XL_WIDTH;
411
+ const minXXLarge = width >= XXL_WIDTH;
412
+ if (isSmall !== this.mobileScreen) {
413
+ this.changedMobileScreen.emit(isSmall);
414
+ this.mobileScreen = isSmall;
415
+ }
416
+ if (isMedium !== this.isMedium) {
417
+ this.changedMediumScreen.emit(isMedium);
418
+ this.isMedium = isMedium;
419
+ }
420
+ if (isLarge !== this.isLarge) {
421
+ this.changedLargeScreen.emit(isLarge);
422
+ this.isLarge = isLarge;
423
+ }
424
+ if (isXLarge !== this.isXLarge) {
425
+ this.changedXLargeScreen.emit(isXLarge);
426
+ this.isXLarge = isXLarge;
427
+ }
428
+ if (isXXLarge !== this.isXXLarge) {
429
+ this.changedXXLargeScreen.emit(isXXLarge);
430
+ this.isXXLarge = isXXLarge;
431
+ }
432
+ if (minSmall !== this.minSmall) {
433
+ this.changedMinSmallScreen.emit(isSmall);
434
+ this.minMedium = isSmall;
435
+ }
436
+ if (minMedium !== this.minMedium) {
437
+ this.changedMinMediumScreen.emit(isMedium);
438
+ this.minMedium = isMedium;
439
+ }
440
+ if (minLarge !== this.minLarge) {
441
+ this.changedMinLargeScreen.emit(minLarge);
442
+ this.minLarge = minLarge;
443
+ }
444
+ if (minXLarge !== this.minXLarge) {
445
+ this.changedMinXLargeScreen.emit(minXLarge);
446
+ this.minXLarge = minXLarge;
447
+ }
448
+ if (minXXLarge !== this.minXXLarge) {
449
+ this.changedMinXXLargeScreen.emit(minXXLarge);
450
+ this.minXXLarge = minXXLarge;
451
+ }
452
+ }
453
+ }
454
+ ScreenHelperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
455
+ ScreenHelperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, providedIn: 'root' });
456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, decorators: [{
457
+ type: Injectable,
458
+ args: [{
459
+ providedIn: 'root'
460
+ }]
461
+ }], ctorParameters: function () { return []; } });
462
+
463
+ class BusyIndicatorComponent {
464
+ constructor() {
465
+ this.isBusy = false;
466
+ }
467
+ ngOnInit() {
468
+ }
469
+ }
470
+ BusyIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: BusyIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
471
+ BusyIndicatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: { isBusy: "isBusy" }, ngImport: i0, template: "<div class=\"busy-indicator-container\" *ngIf=\"isBusy\">\n <div class=\"busy-indicator\"></div>\n</div>", styles: [".busy-indicator-container{position:fixed;left:50%;top:35%;text-align:center;z-index:1000;margin-left:-47px;background:rgb(255,255,255);border-radius:8px;padding:20px;border:solid 2px transparent;background-clip:padding-box;box-shadow:10px 10px 10px #2e364414}.busy-indicator{border:10px solid #e2e2e2;border-top:10px solid var(--app-color, black);border-radius:50%;width:50px;height:50px;animation:spin .5s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
472
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: BusyIndicatorComponent, decorators: [{
473
+ type: Component,
474
+ args: [{ selector: 'ox-busy-indicator', template: "<div class=\"busy-indicator-container\" *ngIf=\"isBusy\">\n <div class=\"busy-indicator\"></div>\n</div>", styles: [".busy-indicator-container{position:fixed;left:50%;top:35%;text-align:center;z-index:1000;margin-left:-47px;background:rgb(255,255,255);border-radius:8px;padding:20px;border:solid 2px transparent;background-clip:padding-box;box-shadow:10px 10px 10px #2e364414}.busy-indicator{border:10px solid #e2e2e2;border-top:10px solid var(--app-color, black);border-radius:50%;width:50px;height:50px;animation:spin .5s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
475
+ }], ctorParameters: function () { return []; }, propDecorators: { isBusy: [{
476
+ type: Input
477
+ }] } });
478
+
479
+ class FuncionarioFormComponent {
480
+ constructor(ws) {
481
+ this.ws = ws;
482
+ this.isBusy = false;
483
+ this.cargos = [];
484
+ }
485
+ ngOnInit() {
486
+ this.getCargos();
487
+ }
488
+ getCargos() {
489
+ this.isBusy = true;
490
+ this.ws.getFuncionariosCargos()
491
+ .subscribe(r => {
492
+ this.cargos = r;
493
+ console.info(r);
494
+ this.isBusy = false;
495
+ }, err => {
496
+ this.isBusy = false;
497
+ });
498
+ }
499
+ }
500
+ FuncionarioFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioFormComponent, deps: [{ token: CommonWebService }], target: i0.ɵɵFactoryTarget.Component });
501
+ FuncionarioFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FuncionarioFormComponent, selector: "ox-funcionario-form", inputs: { model: "model" }, ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"form-group\" *ngIf=\"model\">\n <label for=\"nome\">Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" required class=\"form-control input-300\" tabindex=\"2\">\n</div>\n<div class=\"form-group\" *ngIf=\"model\">\n <label for=\"cargo\">Cargo</label>\n <mat-select id=\"cargo\" [(value)]=\"model.cargoId\" tabindex=\"2\"\n class=\"form-control input-300\" color=\"primary\">\n <mat-option *ngFor=\"let m of cargos\" [value]=\"m.id\">\n {{m.nome}}\n </mat-option>\n </mat-select>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }] });
502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioFormComponent, decorators: [{
503
+ type: Component,
504
+ args: [{ selector: 'ox-funcionario-form', template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"form-group\" *ngIf=\"model\">\n <label for=\"nome\">Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" required class=\"form-control input-300\" tabindex=\"2\">\n</div>\n<div class=\"form-group\" *ngIf=\"model\">\n <label for=\"cargo\">Cargo</label>\n <mat-select id=\"cargo\" [(value)]=\"model.cargoId\" tabindex=\"2\"\n class=\"form-control input-300\" color=\"primary\">\n <mat-option *ngFor=\"let m of cargos\" [value]=\"m.id\">\n {{m.nome}}\n </mat-option>\n </mat-select>\n</div>" }]
505
+ }], ctorParameters: function () { return [{ type: CommonWebService }]; }, propDecorators: { model: [{
506
+ type: Input
507
+ }] } });
508
+
509
+ class FuncionarioAddDialogComponent {
510
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
511
+ this.ws = ws;
512
+ this.notification = notification;
513
+ this.dataDialog = dataDialog;
514
+ this.dialog = dialog;
515
+ this.elRef = elRef;
516
+ this.dialogRef = dialogRef;
517
+ this.screenHelper = screenHelper;
518
+ this.isBusy = false;
519
+ this.focus = new FocusService();
520
+ this.model = {
521
+ id: 0,
522
+ nome: '',
523
+ login: '',
524
+ senha: '',
525
+ enviadoPC: false,
526
+ isAtivo: true,
527
+ cargoId: 1
528
+ };
529
+ this.mobile = this.screenHelper.isMedium;
530
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
531
+ }
532
+ ngOnInit() {
533
+ this.focus.registerElement(this.elRef.nativeElement);
534
+ }
535
+ ngOnDestroy() {
536
+ this.focus.unregisterElement(this.elRef.nativeElement);
537
+ }
538
+ salvar() {
539
+ if (this.model)
540
+ return;
541
+ const valMsg = valida(this.model, this.focus);
542
+ if (valMsg) {
543
+ this.notification.showMsgError(valMsg);
544
+ return;
545
+ }
546
+ this.isBusy = true;
547
+ this.ws.addFuncionario(this.model)
548
+ .subscribe(r => {
549
+ this.isBusy = false;
550
+ this.notification.showMsg("Salvo com sucesso.");
551
+ if (this.dialogRef)
552
+ this.dialogRef.close(true);
553
+ }, err => {
554
+ this.isBusy = false;
555
+ this.notification.showMsg(err.error);
556
+ });
557
+ }
558
+ }
559
+ FuncionarioAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
560
+ FuncionarioAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FuncionarioAddDialogComponent, selector: "ox-funcionario-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Funcion\u00E1rio</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <ox-funcionario-form [model]=\"model\" *ngIf=\"model\"></ox-funcionario-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: FuncionarioFormComponent, selector: "ox-funcionario-form", inputs: ["model"] }] });
561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioAddDialogComponent, decorators: [{
562
+ type: Component,
563
+ args: [{ selector: 'ox-funcionario-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Funcion\u00E1rio</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <ox-funcionario-form [model]=\"model\" *ngIf=\"model\"></ox-funcionario-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
564
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
565
+ type: Inject,
566
+ args: [MAT_DIALOG_DATA]
567
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
568
+
569
+ class FuncionarioEditDialogComponent {
570
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
571
+ this.ws = ws;
572
+ this.notification = notification;
573
+ this.dataDialog = dataDialog;
574
+ this.dialog = dialog;
575
+ this.elRef = elRef;
576
+ this.dialogRef = dialogRef;
577
+ this.screenHelper = screenHelper;
578
+ this.isBusy = false;
579
+ this.focus = new FocusService();
580
+ if (dataDialog) {
581
+ this.model = dataDialog;
582
+ }
583
+ this.mobile = this.screenHelper.isMedium;
584
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
585
+ }
586
+ ngOnInit() {
587
+ this.focus.registerElement(this.elRef.nativeElement);
588
+ }
589
+ ngOnDestroy() {
590
+ this.focus.unregisterElement(this.elRef.nativeElement);
591
+ }
592
+ salvar() {
593
+ if (!this.model)
594
+ return;
595
+ const valMsg = valida(this.model, this.focus);
596
+ if (valMsg) {
597
+ this.notification.showMsgError(valMsg);
598
+ return;
599
+ }
600
+ this.isBusy = true;
601
+ this.ws.saveFuncionario(this.model)
602
+ .subscribe(r => {
603
+ this.isBusy = false;
604
+ this.notification.showMsg("Salvo com sucesso.");
605
+ if (this.dialogRef)
606
+ this.dialogRef.close(true);
607
+ }, err => {
608
+ this.isBusy = false;
609
+ this.notification.showMsg(err.error);
610
+ });
611
+ }
612
+ }
613
+ FuncionarioEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
614
+ FuncionarioEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FuncionarioEditDialogComponent, selector: "ox-funcionario-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Funcion\u00E1rio</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <ox-funcionario-form [model]=\"model\" *ngIf=\"model\"></ox-funcionario-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: FuncionarioFormComponent, selector: "ox-funcionario-form", inputs: ["model"] }] });
615
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioEditDialogComponent, decorators: [{
616
+ type: Component,
617
+ args: [{ selector: 'ox-funcionario-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Funcion\u00E1rio</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <ox-funcionario-form [model]=\"model\" *ngIf=\"model\"></ox-funcionario-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
618
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
619
+ type: Inject,
620
+ args: [MAT_DIALOG_DATA]
621
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
622
+
623
+ const fadeAnimation = trigger('fade', [
624
+ transition(':enter', [
625
+ style({ transform: 'translateY(100%)', opacity: 0 }),
626
+ animate('250ms', style({ transform: 'translateY(0)', 'opacity': 1 }))
627
+ ]),
628
+ transition(':leave', [
629
+ style({ transform: 'translateY(0)', 'opacity': 1 }),
630
+ animate('250ms', style({ transform: 'translateY(100%)', 'opacity': 0 })),
631
+ ])
632
+ ]);
633
+ const menuLateralAnimation = trigger('menuLateral', [
634
+ transition(':enter', [
635
+ style({ transform: 'translateX(-100%)', opacity: 1 }),
636
+ animate('200ms', style({ transform: 'translateX(0)', 'opacity': 1 }))
637
+ ]),
638
+ transition(':leave', [
639
+ style({ 'opacity': 1 }),
640
+ animate('200ms', style({ 'opacity': 0 })),
641
+ ])
642
+ ]);
643
+
644
+ class LazyTrigger {
645
+ constructor(doFunc, timeout = 800) {
646
+ this.doFunc = doFunc;
647
+ this.timeout = timeout;
648
+ }
649
+ fire() {
650
+ console.debug("lazyTimeoutId");
651
+ if (this.lazyTimeoutId != undefined)
652
+ clearTimeout(this.lazyTimeoutId);
653
+ this.lazyTimeoutId = window.setTimeout(() => { this.doFunc(); }, this.timeout);
654
+ }
655
+ }
656
+
657
+ class AlertDialogComponent {
658
+ constructor(dialogRef, args) {
659
+ this.dialogRef = dialogRef;
660
+ this.args = args;
661
+ }
662
+ ngOnInit() {
663
+ }
664
+ }
665
+ AlertDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AlertDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
666
+ AlertDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: AlertDialogComponent, selector: "app-alert-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{args.titulo}}</h1>\n<div mat-dialog-content>\n <p>{{args.msg}}</p>\n</div>\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">Cancelar</button>\n <button mat-button [mat-dialog-close]=\"true\" cdkFocusInitial>Continuar</button>\n</mat-dialog-actions>", styles: [""], dependencies: [{ kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
667
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AlertDialogComponent, decorators: [{
668
+ type: Component,
669
+ args: [{ selector: 'app-alert-dialog', template: "<h1 mat-dialog-title>{{args.titulo}}</h1>\n<div mat-dialog-content>\n <p>{{args.msg}}</p>\n</div>\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">Cancelar</button>\n <button mat-button [mat-dialog-close]=\"true\" cdkFocusInitial>Continuar</button>\n</mat-dialog-actions>" }]
670
+ }], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: undefined, decorators: [{
671
+ type: Inject,
672
+ args: [MAT_DIALOG_DATA]
673
+ }] }]; } });
674
+
675
+ class NavegacaoSelecaoDialogUtil {
676
+ constructor(view) {
677
+ this.view = view;
678
+ }
679
+ onKeyDown(event) {
680
+ console.info(event.keyCode);
681
+ let key = event.keyCode;
682
+ const selected = this.view.selectedItem;
683
+ const enterKey = 13, keyDown = 40, keyUp = 38;
684
+ if (key === enterKey) {
685
+ event.cancelBubble = true;
686
+ if (selected !== null && selected !== undefined) {
687
+ this.view.dialogRef.close(selected);
688
+ return;
689
+ }
690
+ key = keyDown;
691
+ }
692
+ if (key !== keyDown && key !== keyUp)
693
+ return;
694
+ let index = -1;
695
+ if (selected)
696
+ this.view.items.indexOf(selected, 0);
697
+ if (key === keyDown)
698
+ index++;
699
+ if (key === keyUp && index > 0)
700
+ index--;
701
+ if (index > (this.view.items.length - 1))
702
+ return;
703
+ this.view.selectedItem = this.view.items[index];
704
+ }
705
+ }
706
+ function confirmaExclusao(dialog, msg, continueFunc) {
707
+ const args = {
708
+ titulo: "Atenção",
709
+ msg: msg
710
+ };
711
+ const dialogRef = dialog.open(AlertDialogComponent, {
712
+ data: args
713
+ });
714
+ dialogRef.afterClosed().subscribe(dialogResult => {
715
+ if (dialogResult !== true)
716
+ return;
717
+ continueFunc();
718
+ });
719
+ }
720
+
721
+ class SearchSetting {
722
+ constructor(propChanged) {
723
+ this.propChanged = propChanged;
724
+ this._meses = ["JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO"];
725
+ this._mesesShort = ["JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT", "NOV", "DEZ"];
726
+ const now = new Date();
727
+ const hj = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
728
+ console.info(hj);
729
+ this.modo = SearchMode.Mensal;
730
+ this.mes = hj.getMonth() + 1;
731
+ this.ano = hj.getFullYear();
732
+ this.inicial = hj.addDays(-30);
733
+ this.final = hj;
734
+ }
735
+ set(prop, value) {
736
+ const me = this;
737
+ me[prop] = value;
738
+ if (this.propChanged !== undefined)
739
+ this.propChanged();
740
+ }
741
+ toStringArquivo() {
742
+ const ini = this.inicial;
743
+ const fim = this.final;
744
+ if (this.modo === SearchMode.Mensal)
745
+ return this.ano + "_" + this.mes;
746
+ if (this.modo === SearchMode.Anual)
747
+ return "" + this.ano;
748
+ if (this.modo === SearchMode.Diario)
749
+ return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}`;
750
+ return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}_ate_${fim.getDate()}_${fim.getMonth() + 1}_${fim.getFullYear()}`;
751
+ }
752
+ getDatasTexto(short = false) {
753
+ const ini = this.inicial;
754
+ const fim = this.final;
755
+ if (this.modo === SearchMode.Mensal && short)
756
+ return this._mesesShort[this.mes - 1] + " DE " + this.ano;
757
+ if (this.modo === SearchMode.Mensal)
758
+ return this._meses[this.mes - 1] + " DE " + this.ano;
759
+ if (this.modo === SearchMode.Anual)
760
+ return "" + this.ano;
761
+ if (this.modo === SearchMode.Diario)
762
+ return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()}`;
763
+ return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()} ATÉ ${fim.getDate()}/${fim.getMonth() + 1}/${fim.getFullYear()}`;
764
+ }
765
+ goNextMonth() {
766
+ this.mes++;
767
+ if (this.mes > 12) {
768
+ this.mes = 1;
769
+ this.ano += 1;
770
+ }
771
+ }
772
+ goBackMonth() {
773
+ this.mes--;
774
+ if (this.mes < 1) {
775
+ this.mes = 12;
776
+ this.ano -= 1;
777
+ }
778
+ }
779
+ }
780
+ var SearchMode;
781
+ (function (SearchMode) {
782
+ SearchMode[SearchMode["Mensal"] = 0] = "Mensal";
783
+ SearchMode[SearchMode["Anual"] = 1] = "Anual";
784
+ SearchMode[SearchMode["Periodo"] = 2] = "Periodo";
785
+ SearchMode[SearchMode["Diario"] = 3] = "Diario";
786
+ })(SearchMode || (SearchMode = {}));
787
+
788
+ class AuthDataService {
789
+ constructor() {
790
+ this.isLoggedIn = false;
791
+ this.token = '';
792
+ this.sensoresDef = { energizacao: false, garagem: false, portaCliente: false, portaServico: false };
793
+ this.permissoes = {
794
+ gerencialCaixasAgrupadoMensal: false,
795
+ financasLogin: false,
796
+ financasDespesaAdd: false,
797
+ financasDespesaUltimosCadastros: false,
798
+ financasDespesaPesquisar: false,
799
+ financasDespesaDelete: false,
800
+ financasDespesaEditar: false,
801
+ financasReceitaAdd: false,
802
+ financasReceitaUltimosCadastros: false,
803
+ financasReceitaPesquisar: false,
804
+ financasReceitaDelete: false,
805
+ financasReceitaEditar: false,
806
+ financasClientePesquisa: false,
807
+ financasClienteAdd: false,
808
+ financasClienteDelete: false,
809
+ financasFornecedorPesquisa: false,
810
+ financasFornecedorAdd: false,
811
+ financasFornecedorDelete: false,
812
+ financasMarcadorPesquisa: false,
813
+ financasMarcadorAdd: false,
814
+ financasMarcadorDelete: false,
815
+ financasDespesaGrupoPesquisa: false,
816
+ financasDespesaGrupoAdd: false,
817
+ financasDespesaGrupoDelete: false,
818
+ financasReceitaGrupoPesquisa: false,
819
+ financasReceitaGrupoAdd: false,
820
+ financasReceitaGrupoDelete: false,
821
+ financasContaPesquisa: false,
822
+ financasContaAdd: false,
823
+ financasContaDelete: false,
824
+ financasExtrato: false,
825
+ financasContaAjuste: false,
826
+ financasGradeAnualDespesa: false,
827
+ financasGradeAnualReceita: false,
828
+ financasMensal: false,
829
+ financasConfiguracoes: false,
830
+ recepcaoEnergizar: false,
831
+ recepcaoConfiguracoes: false,
832
+ recepcaoTrocaOperador: false,
833
+ recepcaoCancelarOcupacao: false,
834
+ recepcaoAcrescimo: false,
835
+ recepcaoDesconto: false,
836
+ recepcaoLimpeza: false,
837
+ recepcaoAtrasarHora: false,
838
+ gerencialLogin: false,
839
+ gerencialPrincipal: false,
840
+ gerencialPrincipalCaixa: false,
841
+ gerencialPrincipalInfo: false,
842
+ gerencialPrincipalQuantidadeOcupacoesDia: false,
843
+ gerencialDiario: false,
844
+ gerencialMensal: false,
845
+ gerencialResumoMensal: false,
846
+ gerencialPorFormaPagamento: false,
847
+ gerencialMediaTempoOcupacao: false,
848
+ gerencialPorOcupacao: false,
849
+ gerencialOcupacoesCanceladas: false,
850
+ gerencialAgrupado: false,
851
+ gerencialPorTurno: false,
852
+ gerencialConsumoFuncionarios: false,
853
+ gerencialConsumoProdutos: false,
854
+ gerencialImagensrecepcao: false,
855
+ gerencialCaixas: false,
856
+ gerencialVerificacaoCaixa: false,
857
+ gerencialComandasPorCaixa: false,
858
+ gerencialRegistrorecepcao: false,
859
+ gerencialAgrupadoDia: false,
860
+ gerencialLogUsuarios: false,
861
+ gerencialPesquisaOcupacoes: false,
862
+ gerencialDescontos: false,
863
+ gerencialGraficoMensal: false,
864
+ gerencialGraficoDiaSemana: false,
865
+ gerencialGraficoAnual: false,
866
+ gerencialGraficoSituacaoSuite: false,
867
+ gerencialOcupacoesHoraClasse: false,
868
+ gerencialLimpezasStatus: false,
869
+ gerencialVendasPorRecepcionistas: false,
870
+ estoqueLogin: false,
871
+ estoqueListaCompras: false,
872
+ estoqueListaProdutoGrupo: false,
873
+ estoqueMovimento: false,
874
+ estoqueSaldoProdutos: false,
875
+ estoqueNotaEntradaAdd: false,
876
+ estoqueNotaEntradaDelete: false,
877
+ estoqueNotaSaidaAdd: false,
878
+ estoqueNotaSaidaDelete: false,
879
+ estoqueAjusteAdd: false,
880
+ estoqueAjusteDelete: false,
881
+ estoqueTrocaSetorAdd: false,
882
+ estoqueTrocaSetorDelete: false,
883
+ estoqueFornecedorPesquisa: false,
884
+ estoqueFornecedorAdd: false,
885
+ estoqueFornecedorDelete: false,
886
+ estoqueClientePesquisa: false,
887
+ estoqueClienteAdd: false,
888
+ estoqueClienteDelete: false,
889
+ estoqueSetorPesquisa: false,
890
+ estoqueSetorAdd: false,
891
+ estoqueSetorDelete: false,
892
+ estoqueProdutoPesquisa: false,
893
+ estoqueProdutoAdd: false,
894
+ estoqueProdutoDelete: false,
895
+ estoqueProdutoGrupoPesquisa: false,
896
+ estoqueProdutoGrupoAdd: false,
897
+ estoqueProdutoGrupoDelete: false,
898
+ estoqueConfiguracao: false,
899
+ adminLogin: false,
900
+ adminProdutoPesquisa: false,
901
+ adminProdutoAdd: false,
902
+ adminProdutoDelete: false,
903
+ adminProdutoGrupoPesquisa: false,
904
+ adminProdutoGrupoAdd: false,
905
+ adminProdutoGrupoDelete: false,
906
+ adminSuitePesquisa: false,
907
+ adminSuiteAdd: false,
908
+ adminSuiteDelete: false,
909
+ adminSuiteClassePesquisa: false,
910
+ adminSuiteClasseAdd: false,
911
+ adminSuiteClasseDelete: false,
912
+ adminOperadorPesquisa: false,
913
+ adminOperadorAdd: false,
914
+ adminOperadorDelete: false,
915
+ adminFuncionarioPesquisa: false,
916
+ adminFuncionarioAdd: false,
917
+ adminFuncionarioDelete: false,
918
+ adminUsuariosPesquisa: false,
919
+ adminUsuariosAdd: false,
920
+ adminUsuariosDelete: false,
921
+ adminPrecos: false,
922
+ adminPatrimonios: false,
923
+ adminDefinicoesGerais: false,
924
+ adminEditarComanda: false,
925
+ adminCortesiaVale: false,
926
+ adminClienteFidelidade: false,
927
+ adminConfiguracoes: false,
928
+ adminPesquisaSatisfacao: false,
929
+ onGerencialLogin: false,
930
+ onGerencialPrincipal: false,
931
+ onGerencialDiario: false,
932
+ onGerencialMensal: false,
933
+ onGerencialPorFormaPagamento: false,
934
+ onGerencialMediaTempoOcupacao: false,
935
+ onGerencialPorOcupacao: false,
936
+ onGerencialOcupacoesCanceladas: false,
937
+ onGerencialAgrupadoDia: false,
938
+ onGerencialPorTurno: false,
939
+ onGerencialConsumoFuncionarios: false,
940
+ onGerencialConsumoProdutos: false,
941
+ onGerencialImagensRecepcao: false,
942
+ onGerencialCaixas: false,
943
+ onGerencialComandasPorCaixa: false,
944
+ onGerencialRegistroRecepcao: false,
945
+ onGerencialGraficoMensal: false,
946
+ onGerencialGraficoDiaSemana: false,
947
+ onGerencialGraficoAnual: false,
948
+ onGerencialGraficoSituacaoSuite: false,
949
+ onGerencialOcupacoesHoraClasse: false,
950
+ onadminLogin: false,
951
+ onadminProdutoPesquisa: false,
952
+ onadminProdutoAdd: false,
953
+ onadminProdutoDelete: false,
954
+ onadminProdutoGrupoPesquisa: false,
955
+ onadminProdutoGrupoAdd: false,
956
+ onadminProdutoGrupoDelete: false,
957
+ onadminSuitePesquisa: false,
958
+ onadminSuiteAdd: false,
959
+ onadminSuiteDelete: false,
960
+ onadminSuiteClassePesquisa: false,
961
+ onadminSuiteClasseAdd: false,
962
+ onadminSuiteClasseDelete: false,
963
+ onadminUsuariosPesquisa: false,
964
+ onadminUsuariosAdd: false,
965
+ onadminUsuariosDelete: false,
966
+ onadminOperadorPesquisa: false,
967
+ onadminOperadorAdd: false,
968
+ onadminOperadorDelete: false,
969
+ onadminFuncionarioPesquisa: false,
970
+ onadminFuncionarioAdd: false,
971
+ onadminFuncionarioDelete: false,
972
+ onadminPrecos: false,
973
+ onadminDefinicoesGerais: false,
974
+ onadminCortesiaVale: false,
975
+ };
976
+ this.empresaNome = '';
977
+ this.empresaId = 0;
978
+ this.loginNome = '';
979
+ this.userId = 0;
980
+ this.email = '';
981
+ this.nome = '';
982
+ }
983
+ login(result) {
984
+ this.isLoggedIn = true;
985
+ this.token = result.token;
986
+ this.sensoresDef = result.sensoresDef;
987
+ this.permissoes = result.permissoes;
988
+ this.empresaNome = result.empresaNome;
989
+ this.empresaId = result.empresaId;
990
+ this.loginNome = result.login;
991
+ this.userId = result.userId;
992
+ this.nome = result.nome;
993
+ this.email = result.email;
994
+ }
995
+ }
996
+ AuthDataService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AuthDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
997
+ AuthDataService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AuthDataService, providedIn: 'root' });
998
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AuthDataService, decorators: [{
999
+ type: Injectable,
1000
+ args: [{
1001
+ providedIn: 'root'
1002
+ }]
1003
+ }], ctorParameters: function () { return []; } });
1004
+
1005
+ class ItemCardComponent {
1006
+ constructor() { }
1007
+ ngOnInit() {
1008
+ }
1009
+ }
1010
+ ItemCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ItemCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1011
+ ItemCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ItemCardComponent, selector: "ox-item-card", inputs: { nome: "nome", codigo: "codigo", star: "star", cloud: "cloud", desativado: "desativado" }, ngImport: i0, template: "<div class=\"nome-codigo-row\"><span class=\"codigo\" *ngIf=\"codigo\">{{codigo}}</span>{{nome}}</div>\n<div class=\"icons-row\">\n <span class=\"material-icons star\" *ngIf=\"star\">\n grade\n </span>\n <span class=\"material-icons desativado\" *ngIf=\"desativado === true\">\n dangerous\n </span>\n <span class=\"material-icons sync-pendente\" *ngIf=\"cloud === false\">\n cloud_queue\n </span>\n <span class=\"material-icons sync-concluido\" *ngIf=\"cloud === true\">\n cloud_done\n </span>\n</div>\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:12px 16px;background:#fff;justify-content:space-between;cursor:pointer;flex-shrink:0;align-items:center;transition:border-left-color 1s;-webkit-user-select:none;user-select:none;font-size:small}:host:hover{box-shadow:0 0 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:var(--app-color, black);z-index:1;box-shadow:0 0 8px 5px #00000008;flex-shrink:0;background:linear-gradient(45deg,var(--item-card-selected-bg, rgba(0, 0, 0, .05)),transparent)}.nome-codigo-row{display:flex;flex-direction:row;flex-grow:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right:8px}.icons-row{display:flex;flex-direction:row;align-items:center;gap:8px}.codigo{color:#666;font-size:x-small;border-radius:4px;padding:0 4px;width:50px;min-width:50px;text-align:center;border:1px solid #eee;margin-right:16px;display:flex;align-items:center;justify-content:center}.sync-pendente{color:#141212;font-size:16px}.sync-concluido{color:#dbdbdb;font-size:16px}.star{color:#000}.desativado{color:#8f07bb;font-size:16px}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1012
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ItemCardComponent, decorators: [{
1013
+ type: Component,
1014
+ args: [{ selector: 'ox-item-card', template: "<div class=\"nome-codigo-row\"><span class=\"codigo\" *ngIf=\"codigo\">{{codigo}}</span>{{nome}}</div>\n<div class=\"icons-row\">\n <span class=\"material-icons star\" *ngIf=\"star\">\n grade\n </span>\n <span class=\"material-icons desativado\" *ngIf=\"desativado === true\">\n dangerous\n </span>\n <span class=\"material-icons sync-pendente\" *ngIf=\"cloud === false\">\n cloud_queue\n </span>\n <span class=\"material-icons sync-concluido\" *ngIf=\"cloud === true\">\n cloud_done\n </span>\n</div>\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:12px 16px;background:#fff;justify-content:space-between;cursor:pointer;flex-shrink:0;align-items:center;transition:border-left-color 1s;-webkit-user-select:none;user-select:none;font-size:small}:host:hover{box-shadow:0 0 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:var(--app-color, black);z-index:1;box-shadow:0 0 8px 5px #00000008;flex-shrink:0;background:linear-gradient(45deg,var(--item-card-selected-bg, rgba(0, 0, 0, .05)),transparent)}.nome-codigo-row{display:flex;flex-direction:row;flex-grow:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right:8px}.icons-row{display:flex;flex-direction:row;align-items:center;gap:8px}.codigo{color:#666;font-size:x-small;border-radius:4px;padding:0 4px;width:50px;min-width:50px;text-align:center;border:1px solid #eee;margin-right:16px;display:flex;align-items:center;justify-content:center}.sync-pendente{color:#141212;font-size:16px}.sync-concluido{color:#dbdbdb;font-size:16px}.star{color:#000}.desativado{color:#8f07bb;font-size:16px}\n"] }]
1015
+ }], ctorParameters: function () { return []; }, propDecorators: { nome: [{
1016
+ type: Input
1017
+ }], codigo: [{
1018
+ type: Input
1019
+ }], star: [{
1020
+ type: Input
1021
+ }], cloud: [{
1022
+ type: Input
1023
+ }], desativado: [{
1024
+ type: Input
1025
+ }] } });
1026
+
1027
+ class FuncionariosComponent {
1028
+ constructor(ws, notification, dialog, auth, screenHelper) {
1029
+ this.ws = ws;
1030
+ this.notification = notification;
1031
+ this.dialog = dialog;
1032
+ this.screenHelper = screenHelper;
1033
+ this.isBusy = false;
1034
+ this.items = [];
1035
+ this.selectedItem = null;
1036
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
1037
+ this.setting = new SearchSetting();
1038
+ this.focus = new FocusService();
1039
+ this.allowAdd = auth.permissoes.adminFuncionarioAdd;
1040
+ this.allowExcluir = auth.permissoes.adminFuncionarioDelete;
1041
+ this.mobile = this.screenHelper.isMedium;
1042
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1043
+ }
1044
+ ngOnInit() {
1045
+ this.setting.ordem = "nome";
1046
+ this.atualiza();
1047
+ }
1048
+ onSelectItem() {
1049
+ if (!this.focus.hasInit()) {
1050
+ setTimeout(() => {
1051
+ this.focus.registerElementById("form-column");
1052
+ this.focus.setFirst();
1053
+ }, 500);
1054
+ //this._focus.registerElementById("form-column");
1055
+ }
1056
+ else {
1057
+ this.focus.setFirst();
1058
+ }
1059
+ }
1060
+ ngOnDestroy() {
1061
+ this.focus.unregisterElementById("form-column");
1062
+ }
1063
+ atualiza() {
1064
+ this.isBusy = true;
1065
+ this.ws.buscaFuncionario(this.setting)
1066
+ .subscribe(r => {
1067
+ this.items = r;
1068
+ this.selectedItem = null;
1069
+ console.info(r);
1070
+ this.isBusy = false;
1071
+ }, err => {
1072
+ this.isBusy = false;
1073
+ this.notification.showHttpError(err);
1074
+ });
1075
+ }
1076
+ excluir() {
1077
+ const item = this.selectedItem;
1078
+ if (!item)
1079
+ return;
1080
+ confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do funcionário ${item.nome}?`, () => {
1081
+ this.isBusy = true;
1082
+ this.ws.deleteFuncionario(item.id)
1083
+ .subscribe(r => {
1084
+ this.notification.showMsg("O funcionário foi excluído com sucesso.");
1085
+ this.items.remove(item);
1086
+ this.selectedItem = null;
1087
+ this.isBusy = false;
1088
+ }, err => {
1089
+ this.isBusy = false;
1090
+ this.notification.showMsg(err.error);
1091
+ });
1092
+ });
1093
+ }
1094
+ novo() {
1095
+ let height = (window.innerHeight * 0.90) + 'px';
1096
+ let width = 550 + 'px';
1097
+ if (this.mobile) {
1098
+ width = (window.innerWidth * 0.99) + 'px';
1099
+ //height = (window.innerHeight * 0.98) + 'px';
1100
+ }
1101
+ const dialog = this.dialog.open(FuncionarioAddDialogComponent, {
1102
+ width: width,
1103
+ //height: height,
1104
+ maxWidth: '100%',
1105
+ panelClass: 'dialog-p0',
1106
+ });
1107
+ dialog.afterClosed().subscribe(result => {
1108
+ if (result === undefined)
1109
+ return;
1110
+ this.notification.showMsg("Salvo com sucesso.");
1111
+ this.atualiza();
1112
+ });
1113
+ }
1114
+ abreCadastro(item) {
1115
+ let height = undefined;
1116
+ let width = 550 + 'px';
1117
+ if (this.mobile) {
1118
+ width = (window.innerWidth * 0.99) + 'px';
1119
+ height = (window.innerHeight * 0.99) + 'px';
1120
+ }
1121
+ const dialog = this.dialog.open(FuncionarioEditDialogComponent, {
1122
+ data: item,
1123
+ width: width,
1124
+ //height: height,
1125
+ maxWidth: '100%',
1126
+ panelClass: 'dialog-p0',
1127
+ });
1128
+ dialog.afterClosed().subscribe(result => {
1129
+ if (result !== true)
1130
+ return;
1131
+ this.notification.showMsg("Salvo com sucesso.");
1132
+ this.atualiza();
1133
+ });
1134
+ }
1135
+ salvar() {
1136
+ const item = this.selectedItem;
1137
+ if (!item)
1138
+ return;
1139
+ const valMsg = valida(item, this.focus);
1140
+ if (valMsg) {
1141
+ this.notification.showMsgError(valMsg);
1142
+ return;
1143
+ }
1144
+ this.isBusy = true;
1145
+ this.ws.saveFuncionario(item)
1146
+ .subscribe(r => {
1147
+ this.notification.showMsg("Salvo com sucesso.");
1148
+ this.isBusy = false;
1149
+ }, err => {
1150
+ this.isBusy = false;
1151
+ this.notification.showMsg(err.error);
1152
+ });
1153
+ }
1154
+ }
1155
+ FuncionariosComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionariosComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1156
+ FuncionariosComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FuncionariosComponent, selector: "ox-funcionarios", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Funcion\u00E1rios</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um funcion\u00E1rio no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <ox-funcionario-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </ox-funcionario-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: FuncionarioFormComponent, selector: "ox-funcionario-form", inputs: ["model"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
1157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionariosComponent, decorators: [{
1158
+ type: Component,
1159
+ args: [{ selector: 'ox-funcionarios', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Funcion\u00E1rios</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um funcion\u00E1rio no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <ox-funcionario-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </ox-funcionario-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"] }]
1160
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
1161
+
1162
+ var ModalidadeBaseICMS;
1163
+ (function (ModalidadeBaseICMS) {
1164
+ ModalidadeBaseICMS[ModalidadeBaseICMS["MargemValorAgregado"] = 0] = "MargemValorAgregado";
1165
+ ModalidadeBaseICMS[ModalidadeBaseICMS["PautaValor"] = 1] = "PautaValor";
1166
+ ModalidadeBaseICMS[ModalidadeBaseICMS["Pre\u00E7oTabeladoMax"] = 2] = "Pre\u00E7oTabeladoMax";
1167
+ ModalidadeBaseICMS[ModalidadeBaseICMS["ValorDaOpera\u00E7\u00E3o"] = 3] = "ValorDaOpera\u00E7\u00E3o";
1168
+ })(ModalidadeBaseICMS || (ModalidadeBaseICMS = {}));
1169
+ function createProduct() {
1170
+ return {
1171
+ id: 0,
1172
+ nome: '',
1173
+ unidade: 'UN',
1174
+ precoCusto: 0,
1175
+ precoVenda: 0,
1176
+ precoFuncionario: 0,
1177
+ estoqueMinimo: 0,
1178
+ referencia: '',
1179
+ aliquotaICMS: null,
1180
+ ncm: null,
1181
+ grupoId: 0,
1182
+ grupoNome: null,
1183
+ subgrupoId: 0,
1184
+ subgrupoNome: null,
1185
+ quantidadeSuite: 0,
1186
+ estoqueControlado: true,
1187
+ imprimiCozinha: true,
1188
+ imprimeCorredor: false,
1189
+ verNaRecepcao: true,
1190
+ prato: false,
1191
+ isAtivo: true,
1192
+ isComposto: true,
1193
+ isIngrediente: true,
1194
+ omiteCliente: false,
1195
+ estoqueRecepcao: false,
1196
+ estoqueRecepcaoQuantidade: 0,
1197
+ gtin: null,
1198
+ cfop: null,
1199
+ csT_icms: null,
1200
+ modBC_icms: 0,
1201
+ pICMS_icms: null,
1202
+ pRedBC_icms: null,
1203
+ pfcP_icms: null,
1204
+ vbcfcP_icms: null,
1205
+ pfcpsT_icms: null,
1206
+ pRedBCEfet_icms: null,
1207
+ vbcEfet_icms: null,
1208
+ picmsEfet_icms: null,
1209
+ vicmsEfet_icms: null,
1210
+ csT_pis: null,
1211
+ vbC_pis: null,
1212
+ ppiS_pis: null,
1213
+ csT_cofins: null,
1214
+ vbC_cofins: null,
1215
+ pcofinS_cofins: null,
1216
+ psT_icms: null,
1217
+ vbcstRet_icms: null,
1218
+ vicmsSubstituto_icms: null,
1219
+ vicmsstRet_icms: null,
1220
+ emiteNFCe: false,
1221
+ cest: null,
1222
+ vbcfcpsT_icms: null,
1223
+ vbcfcpstRet_icms: null,
1224
+ pfcpstRet_icms: null,
1225
+ sitTrib: null,
1226
+ setorSubEstoqueId: null,
1227
+ setorSubEstoqueNome: null,
1228
+ setorPrincipalId: null,
1229
+ setorPrincipalNome: null,
1230
+ qtdMinSubEstoque: null,
1231
+ disponivelCardapio: false,
1232
+ categoriaCardapioId: null,
1233
+ categoriaCardapioNome: null,
1234
+ descricao: null,
1235
+ enviadoPC: false,
1236
+ qbcProd_cofins: null,
1237
+ vAliqProd_cofins: null
1238
+ };
1239
+ }
1240
+ ;
1241
+ function validaProduto(item, focus) {
1242
+ if (valTextEmpty(item.nome)) {
1243
+ focus.set('nome');
1244
+ return 'Digite um nome válido.';
1245
+ }
1246
+ if (valNumberEmpty(item.grupoId)) {
1247
+ return 'Escolha um grupo de produto.';
1248
+ }
1249
+ if (valNumberEmpty(item.subgrupoId)) {
1250
+ return 'Escolha um subgrupo de produto.';
1251
+ }
1252
+ if (valTextEmpty(item.unidade)) {
1253
+ focus.set('unidade');
1254
+ return 'Digite uma unidade.';
1255
+ }
1256
+ if (item.disponivelCardapio) {
1257
+ if (valNumberEmpty(item.categoriaCardapioId))
1258
+ return 'Escolha uma categoria do cardápio digital.';
1259
+ if (valTextEmpty(item.descricao)) {
1260
+ focus.set('descricao');
1261
+ return 'Digite uma descrição para o cardápio digital.';
1262
+ }
1263
+ }
1264
+ return null;
1265
+ }
1266
+
1267
+ class NumberParser {
1268
+ constructor(setPropFunc, getPropFunc, min, max, triggerMilliseconds = 1500) {
1269
+ this.setPropFunc = setPropFunc;
1270
+ this.getPropFunc = getPropFunc;
1271
+ this.min = min;
1272
+ this.max = max;
1273
+ this.parsed = false;
1274
+ this._parseTrigger = new LazyTrigger(() => this.parseValor(), triggerMilliseconds);
1275
+ }
1276
+ parse(vlr) {
1277
+ this.valor = vlr;
1278
+ this.parsed = false;
1279
+ this._parseTrigger.fire();
1280
+ }
1281
+ store(vlr) {
1282
+ this.valor = vlr;
1283
+ this.parsed = false;
1284
+ }
1285
+ checkout() {
1286
+ if (this.parsed || !this.valor)
1287
+ return;
1288
+ this.parseValor();
1289
+ }
1290
+ parseValor() {
1291
+ if (this.valor === undefined)
1292
+ return;
1293
+ this.parsed = true;
1294
+ const vlrTxt = this.valor.split(",").join(".");
1295
+ ;
1296
+ const spTxt = vlrTxt.split(".");
1297
+ let toParseTxt = "";
1298
+ if (spTxt.length > 2) {
1299
+ const chars = vlrTxt.split("");
1300
+ const lastIndex = vlrTxt.lastIndexOf(".");
1301
+ for (let i = 0; i < chars.length; i++) {
1302
+ const c = chars[i];
1303
+ if (c === "." && i != lastIndex)
1304
+ continue;
1305
+ toParseTxt = toParseTxt.concat(c);
1306
+ }
1307
+ }
1308
+ else {
1309
+ toParseTxt = vlrTxt;
1310
+ }
1311
+ const vlr = parseFloat(toParseTxt);
1312
+ if (isNaN(vlr) || !this.validaMinMax(vlr)) {
1313
+ const original = this.getPropFunc();
1314
+ this.setPropFunc(0);
1315
+ setTimeout(() => this.setPropFunc(original));
1316
+ }
1317
+ else {
1318
+ this.setPropFunc(vlr);
1319
+ }
1320
+ }
1321
+ validaMinMax(value) {
1322
+ if ((this.min === undefined) && this.max === undefined)
1323
+ return true;
1324
+ if (!(this.min === undefined) && value < this.min)
1325
+ return false;
1326
+ if (!(this.max === undefined) && value > this.max)
1327
+ return false;
1328
+ return true;
1329
+ }
1330
+ }
1331
+
1332
+ function validaProdutoGrupo(item, focus) {
1333
+ if (valTextEmpty(item.nome)) {
1334
+ focus.set('nome');
1335
+ return 'Digite um nome válido.';
1336
+ }
1337
+ return null;
1338
+ }
1339
+
1340
+ class ProdutoGrupoFormComponent {
1341
+ constructor() { }
1342
+ ngOnInit() {
1343
+ }
1344
+ }
1345
+ ProdutoGrupoFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1346
+ ProdutoGrupoFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: { model: "model" }, ngImport: i0, template: "<div class=\"form-group\" *ngIf=\"model\">\n <label>Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" required class=\"form-control input-300\" cdkFocusInitial tabindex=\"1\">\n</div>", styles: [":host{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1347
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoFormComponent, decorators: [{
1348
+ type: Component,
1349
+ args: [{ selector: 'app-produto-grupo-form', template: "<div class=\"form-group\" *ngIf=\"model\">\n <label>Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" required class=\"form-control input-300\" cdkFocusInitial tabindex=\"1\">\n</div>", styles: [":host{display:flex;flex-direction:column}\n"] }]
1350
+ }], ctorParameters: function () { return []; }, propDecorators: { model: [{
1351
+ type: Input
1352
+ }] } });
1353
+
1354
+ class ProdutoCategoriaCardapioAddDialogComponent {
1355
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
1356
+ this.ws = ws;
1357
+ this.notification = notification;
1358
+ this.dataDialog = dataDialog;
1359
+ this.dialog = dialog;
1360
+ this.elRef = elRef;
1361
+ this.dialogRef = dialogRef;
1362
+ this.screenHelper = screenHelper;
1363
+ this.isBusy = false;
1364
+ this.focus = new FocusService();
1365
+ this.model = {
1366
+ id: 0,
1367
+ nome: '',
1368
+ isAtivo: true,
1369
+ enviadoPC: false
1370
+ };
1371
+ this.mobile = this.screenHelper.isMedium;
1372
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1373
+ }
1374
+ ngOnInit() {
1375
+ this.focus.registerElement(this.elRef.nativeElement);
1376
+ }
1377
+ ngOnDestroy() {
1378
+ this.focus.unregisterElement(this.elRef.nativeElement);
1379
+ }
1380
+ salvar() {
1381
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
1382
+ if (valMsg) {
1383
+ this.notification.showMsgError(valMsg);
1384
+ return;
1385
+ }
1386
+ this.isBusy = true;
1387
+ this.ws.addProdutoCategoriaCardapio(this.model)
1388
+ .subscribe(r => {
1389
+ this.isBusy = false;
1390
+ this.notification.showMsg("Salvo com sucesso.");
1391
+ if (this.dialogRef)
1392
+ this.dialogRef.close(true);
1393
+ }, err => {
1394
+ this.isBusy = false;
1395
+ this.notification.showMsg(err.error);
1396
+ });
1397
+ }
1398
+ }
1399
+ ProdutoCategoriaCardapioAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1400
+ ProdutoCategoriaCardapioAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoCategoriaCardapioAddDialogComponent, selector: "app-produto-categoria-cardapio-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Nova Categoria</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
1401
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioAddDialogComponent, decorators: [{
1402
+ type: Component,
1403
+ args: [{ selector: 'app-produto-categoria-cardapio-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Nova Categoria</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1404
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
1405
+ type: Inject,
1406
+ args: [MAT_DIALOG_DATA]
1407
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
1408
+
1409
+ class ProdutoCategoriaCardapioEditDialogComponent {
1410
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
1411
+ this.ws = ws;
1412
+ this.notification = notification;
1413
+ this.dataDialog = dataDialog;
1414
+ this.dialog = dialog;
1415
+ this.elRef = elRef;
1416
+ this.dialogRef = dialogRef;
1417
+ this.screenHelper = screenHelper;
1418
+ this.isBusy = false;
1419
+ this.focus = new FocusService();
1420
+ if (dataDialog) {
1421
+ this.model = dataDialog;
1422
+ }
1423
+ this.mobile = this.screenHelper.isMedium;
1424
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1425
+ }
1426
+ ngOnInit() {
1427
+ this.focus.registerElement(this.elRef.nativeElement);
1428
+ }
1429
+ ngOnDestroy() {
1430
+ this.focus.unregisterElement(this.elRef.nativeElement);
1431
+ }
1432
+ salvar() {
1433
+ if (!this.model)
1434
+ return;
1435
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
1436
+ if (valMsg) {
1437
+ this.notification.showMsgError(valMsg);
1438
+ return;
1439
+ }
1440
+ this.isBusy = true;
1441
+ this.ws.saveProdutoCategoriaCardapio(this.model)
1442
+ .subscribe(r => {
1443
+ this.isBusy = false;
1444
+ this.notification.showMsg("Salvo com sucesso.");
1445
+ if (this.dialogRef)
1446
+ this.dialogRef.close(true);
1447
+ }, err => {
1448
+ this.isBusy = false;
1449
+ this.notification.showMsg(err.error);
1450
+ });
1451
+ }
1452
+ }
1453
+ ProdutoCategoriaCardapioEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1454
+ ProdutoCategoriaCardapioEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoCategoriaCardapioEditDialogComponent, selector: "app-produto-categoria-cardapio-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Categoria do Card\u00E1pio</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
1455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioEditDialogComponent, decorators: [{
1456
+ type: Component,
1457
+ args: [{ selector: 'app-produto-categoria-cardapio-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Categoria do Card\u00E1pio</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1458
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
1459
+ type: Inject,
1460
+ args: [MAT_DIALOG_DATA]
1461
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
1462
+
1463
+ class ProdutoCategoriaCardapioSelecaoDialogComponent {
1464
+ constructor(dialogRef, dialog, ws, notification, auth, screenHelper) {
1465
+ this.dialogRef = dialogRef;
1466
+ this.dialog = dialog;
1467
+ this.ws = ws;
1468
+ this.notification = notification;
1469
+ this.screenHelper = screenHelper;
1470
+ this.items = [];
1471
+ this.selectedItem = null;
1472
+ this.isBusy = false;
1473
+ this.setting = new SearchSetting();
1474
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
1475
+ this.nav = new NavegacaoSelecaoDialogUtil(this);
1476
+ this.mobile = this.screenHelper.isMedium;
1477
+ this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
1478
+ this.allowEdit = auth.permissoes.adminProdutoGrupoPesquisa;
1479
+ }
1480
+ ngOnInit() {
1481
+ this.setting.ordem = "nome";
1482
+ this.atualiza();
1483
+ }
1484
+ atualiza() {
1485
+ this.isBusy = true;
1486
+ this.ws.buscaProdutoCategoriaCardapio(this.setting)
1487
+ .subscribe(r => {
1488
+ this.isBusy = false;
1489
+ this.items = r;
1490
+ console.info(r);
1491
+ }, err => {
1492
+ this.isBusy = false;
1493
+ this.notification.showHttpError(err);
1494
+ });
1495
+ }
1496
+ selectItem(i) {
1497
+ if (this.selectedItem === i) {
1498
+ this.dialogRef.close(i);
1499
+ }
1500
+ this.selectedItem = i;
1501
+ }
1502
+ novo() {
1503
+ let height = (window.innerHeight * 0.90) + 'px';
1504
+ let width = 550 + 'px';
1505
+ if (this.mobile) {
1506
+ width = (window.innerWidth * 0.99) + 'px';
1507
+ //height = (window.innerHeight * 0.98) + 'px';
1508
+ }
1509
+ const dialog = this.dialog.open(ProdutoCategoriaCardapioAddDialogComponent, {
1510
+ width: width,
1511
+ height: height,
1512
+ maxWidth: '100%',
1513
+ panelClass: 'dialog-p0',
1514
+ });
1515
+ dialog.afterClosed().subscribe(result => {
1516
+ if (result === undefined)
1517
+ return;
1518
+ this.notification.showMsg("Salvo com sucesso.");
1519
+ this.atualiza();
1520
+ });
1521
+ }
1522
+ editar() {
1523
+ let height = (window.innerHeight * 0.90) + 'px';
1524
+ let width = 550 + 'px';
1525
+ if (this.mobile) {
1526
+ width = (window.innerWidth * 0.99) + 'px';
1527
+ //height = (window.innerHeight * 0.98) + 'px';
1528
+ }
1529
+ const dialog = this.dialog.open(ProdutoCategoriaCardapioEditDialogComponent, {
1530
+ width: width,
1531
+ height: height,
1532
+ maxWidth: '100%',
1533
+ panelClass: 'dialog-p0',
1534
+ data: this.selectedItem
1535
+ });
1536
+ dialog.afterClosed().subscribe(result => {
1537
+ if (result === undefined)
1538
+ return;
1539
+ this.notification.showMsg("Salvo com sucesso.");
1540
+ this.atualiza();
1541
+ });
1542
+ }
1543
+ }
1544
+ ProdutoCategoriaCardapioSelecaoDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioSelecaoDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: i3.MatDialog }, { token: CommonWebService }, { token: NotificationService }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1545
+ ProdutoCategoriaCardapioSelecaoDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoCategoriaCardapioSelecaoDialogComponent, selector: "app-produto-categoria-cardapio-selecao-dialog", ngImport: i0, template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n<!--\n <div (click)=\"selectItem(i)\" [ngClass]=\"{selected: selectedItem === i}\" class=\"list-item\" *ngFor=\"let i of items\">\n <span>{{i.nome}}</span>\n </div>\n-->\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }] });
1546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioSelecaoDialogComponent, decorators: [{
1547
+ type: Component,
1548
+ args: [{ selector: 'app-produto-categoria-cardapio-selecao-dialog', template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n<!--\n <div (click)=\"selectItem(i)\" [ngClass]=\"{selected: selectedItem === i}\" class=\"list-item\" *ngFor=\"let i of items\">\n <span>{{i.nome}}</span>\n </div>\n-->\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1549
+ }], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
1550
+
1551
+ class ProdutoGrupoAddDialogComponent {
1552
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
1553
+ this.ws = ws;
1554
+ this.notification = notification;
1555
+ this.dataDialog = dataDialog;
1556
+ this.dialog = dialog;
1557
+ this.elRef = elRef;
1558
+ this.dialogRef = dialogRef;
1559
+ this.screenHelper = screenHelper;
1560
+ this.isBusy = false;
1561
+ this.focus = new FocusService();
1562
+ this.model = {
1563
+ id: 0,
1564
+ nome: '',
1565
+ isAtivo: true,
1566
+ enviadoPC: false
1567
+ };
1568
+ this.mobile = this.screenHelper.isMedium;
1569
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1570
+ }
1571
+ ngOnInit() {
1572
+ this.focus.registerElement(this.elRef.nativeElement);
1573
+ }
1574
+ ngOnDestroy() {
1575
+ this.focus.unregisterElement(this.elRef.nativeElement);
1576
+ }
1577
+ salvar() {
1578
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
1579
+ if (valMsg) {
1580
+ this.notification.showMsgError(valMsg);
1581
+ return;
1582
+ }
1583
+ this.isBusy = true;
1584
+ this.ws.addProdutoGrupo(this.model)
1585
+ .subscribe(r => {
1586
+ this.isBusy = false;
1587
+ this.notification.showMsg("Salvo com sucesso.");
1588
+ if (this.dialogRef)
1589
+ this.dialogRef.close(true);
1590
+ }, err => {
1591
+ this.isBusy = false;
1592
+ this.notification.showMsg(err.error);
1593
+ });
1594
+ }
1595
+ }
1596
+ ProdutoGrupoAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1597
+ ProdutoGrupoAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoGrupoAddDialogComponent, selector: "app-produto-grupo-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Grupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
1598
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoAddDialogComponent, decorators: [{
1599
+ type: Component,
1600
+ args: [{ selector: 'app-produto-grupo-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Grupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1601
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
1602
+ type: Inject,
1603
+ args: [MAT_DIALOG_DATA]
1604
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
1605
+
1606
+ class ProdutoGrupoEditDialogComponent {
1607
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
1608
+ this.ws = ws;
1609
+ this.notification = notification;
1610
+ this.dataDialog = dataDialog;
1611
+ this.dialog = dialog;
1612
+ this.elRef = elRef;
1613
+ this.dialogRef = dialogRef;
1614
+ this.screenHelper = screenHelper;
1615
+ this.isBusy = false;
1616
+ this.focus = new FocusService();
1617
+ if (dataDialog) {
1618
+ this.model = dataDialog;
1619
+ }
1620
+ this.mobile = this.screenHelper.isMedium;
1621
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1622
+ }
1623
+ ngOnInit() {
1624
+ this.focus.registerElement(this.elRef.nativeElement);
1625
+ }
1626
+ ngOnDestroy() {
1627
+ this.focus.unregisterElement(this.elRef.nativeElement);
1628
+ }
1629
+ salvar() {
1630
+ if (!this.model)
1631
+ return;
1632
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
1633
+ if (valMsg) {
1634
+ this.notification.showMsgError(valMsg);
1635
+ return;
1636
+ }
1637
+ this.isBusy = true;
1638
+ this.ws.saveProdutoGrupo(this.model)
1639
+ .subscribe(r => {
1640
+ this.isBusy = false;
1641
+ this.notification.showMsg("Salvo com sucesso.");
1642
+ if (this.dialogRef)
1643
+ this.dialogRef.close(true);
1644
+ }, err => {
1645
+ this.isBusy = false;
1646
+ this.notification.showMsg(err.error);
1647
+ });
1648
+ }
1649
+ }
1650
+ ProdutoGrupoEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1651
+ ProdutoGrupoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoGrupoEditDialogComponent, selector: "app-produto-grupo-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Grupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
1652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoEditDialogComponent, decorators: [{
1653
+ type: Component,
1654
+ args: [{ selector: 'app-produto-grupo-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Grupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1655
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
1656
+ type: Inject,
1657
+ args: [MAT_DIALOG_DATA]
1658
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
1659
+
1660
+ class ProdutoGrupoSelecaoDialogComponent {
1661
+ constructor(dialogRef, dialog, ws, notification, auth, screenHelper) {
1662
+ this.dialogRef = dialogRef;
1663
+ this.dialog = dialog;
1664
+ this.ws = ws;
1665
+ this.notification = notification;
1666
+ this.screenHelper = screenHelper;
1667
+ this.items = [];
1668
+ this.selectedItem = null;
1669
+ this.isBusy = false;
1670
+ this.setting = new SearchSetting();
1671
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
1672
+ this.nav = new NavegacaoSelecaoDialogUtil(this);
1673
+ this.mobile = this.screenHelper.isMedium;
1674
+ this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
1675
+ this.allowEdit = auth.permissoes.adminProdutoGrupoPesquisa;
1676
+ }
1677
+ ngOnInit() {
1678
+ this.setting.ordem = "nome";
1679
+ this.atualiza();
1680
+ }
1681
+ atualiza() {
1682
+ this.isBusy = true;
1683
+ this.ws.buscaProdutoGrupo(this.setting)
1684
+ .subscribe(r => {
1685
+ this.isBusy = false;
1686
+ this.items = r;
1687
+ console.info(r);
1688
+ }, err => {
1689
+ this.isBusy = false;
1690
+ this.notification.showHttpError(err);
1691
+ });
1692
+ }
1693
+ selectItem(i) {
1694
+ if (this.selectedItem === i) {
1695
+ this.dialogRef.close(i);
1696
+ }
1697
+ this.selectedItem = i;
1698
+ }
1699
+ novo() {
1700
+ let height = (window.innerHeight * 0.90) + 'px';
1701
+ let width = 550 + 'px';
1702
+ if (this.mobile) {
1703
+ width = (window.innerWidth * 0.99) + 'px';
1704
+ //height = (window.innerHeight * 0.98) + 'px';
1705
+ }
1706
+ const dialog = this.dialog.open(ProdutoGrupoAddDialogComponent, {
1707
+ width: width,
1708
+ height: height,
1709
+ maxWidth: '100%',
1710
+ panelClass: 'dialog-p0',
1711
+ });
1712
+ dialog.afterClosed().subscribe(result => {
1713
+ if (result === undefined)
1714
+ return;
1715
+ this.notification.showMsg("Salvo com sucesso.");
1716
+ this.atualiza();
1717
+ });
1718
+ }
1719
+ editar() {
1720
+ let height = (window.innerHeight * 0.90) + 'px';
1721
+ let width = 550 + 'px';
1722
+ if (this.mobile) {
1723
+ width = (window.innerWidth * 0.99) + 'px';
1724
+ //height = (window.innerHeight * 0.98) + 'px';
1725
+ }
1726
+ const dialog = this.dialog.open(ProdutoGrupoEditDialogComponent, {
1727
+ width: width,
1728
+ height: height,
1729
+ maxWidth: '100%',
1730
+ panelClass: 'dialog-p0',
1731
+ data: this.selectedItem
1732
+ });
1733
+ dialog.afterClosed().subscribe(result => {
1734
+ if (result === undefined)
1735
+ return;
1736
+ this.notification.showMsg("Salvo com sucesso.");
1737
+ this.atualiza();
1738
+ });
1739
+ }
1740
+ }
1741
+ ProdutoGrupoSelecaoDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoSelecaoDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: i3.MatDialog }, { token: CommonWebService }, { token: NotificationService }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1742
+ ProdutoGrupoSelecaoDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoGrupoSelecaoDialogComponent, selector: "app-produto-grupo-selecao-dialog", ngImport: i0, template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }] });
1743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoSelecaoDialogComponent, decorators: [{
1744
+ type: Component,
1745
+ args: [{ selector: 'app-produto-grupo-selecao-dialog', template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1746
+ }], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
1747
+
1748
+ class ProdutosNcmDialogComponent {
1749
+ constructor(dialogRef, dialog, ws, notification, screenHelper) {
1750
+ this.dialogRef = dialogRef;
1751
+ this.dialog = dialog;
1752
+ this.ws = ws;
1753
+ this.notification = notification;
1754
+ this.screenHelper = screenHelper;
1755
+ this.isBusy = false;
1756
+ this.frase = '';
1757
+ this.items = [];
1758
+ this.selectedItem = null;
1759
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
1760
+ this.nav = new NavegacaoSelecaoDialogUtil(this);
1761
+ this.mobile = this.screenHelper.isMedium;
1762
+ }
1763
+ ngOnInit() {
1764
+ this.atualiza();
1765
+ }
1766
+ atualiza() {
1767
+ this.isBusy = true;
1768
+ this.ws.buscaNcm(this.frase)
1769
+ .subscribe(r => {
1770
+ this.isBusy = false;
1771
+ this.items = r;
1772
+ console.info(r);
1773
+ }, err => {
1774
+ this.isBusy = false;
1775
+ this.notification.showHttpError(err);
1776
+ });
1777
+ }
1778
+ selectItem(i) {
1779
+ if (this.selectedItem === i) {
1780
+ this.dialogRef.close(i);
1781
+ }
1782
+ this.selectedItem = i;
1783
+ }
1784
+ }
1785
+ ProdutosNcmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosNcmDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: i3.MatDialog }, { token: CommonWebService }, { token: NotificationService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1786
+ ProdutosNcmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosNcmDialogComponent, selector: "app-produtos-ncm-dialog", ngImport: i0, template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [codigo]=\"i.codigo\" [nome]=\"i.descricao\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }] });
1787
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosNcmDialogComponent, decorators: [{
1788
+ type: Component,
1789
+ args: [{ selector: 'app-produtos-ncm-dialog', template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [codigo]=\"i.codigo\" [nome]=\"i.descricao\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1790
+ }], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: ScreenHelperService }]; } });
1791
+
1792
+ class ProdutoSubgrupoAddDialogComponent {
1793
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
1794
+ this.ws = ws;
1795
+ this.notification = notification;
1796
+ this.dataDialog = dataDialog;
1797
+ this.dialog = dialog;
1798
+ this.elRef = elRef;
1799
+ this.dialogRef = dialogRef;
1800
+ this.screenHelper = screenHelper;
1801
+ this.isBusy = false;
1802
+ this.focus = new FocusService();
1803
+ this.model = {
1804
+ id: 0,
1805
+ nome: '',
1806
+ isAtivo: true,
1807
+ enviadoPC: false
1808
+ };
1809
+ this.mobile = this.screenHelper.isMedium;
1810
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1811
+ }
1812
+ ngOnInit() {
1813
+ this.focus.registerElement(this.elRef.nativeElement);
1814
+ }
1815
+ ngOnDestroy() {
1816
+ this.focus.unregisterElement(this.elRef.nativeElement);
1817
+ }
1818
+ salvar() {
1819
+ if (!this.model)
1820
+ return;
1821
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
1822
+ if (valMsg) {
1823
+ this.notification.showMsgError(valMsg);
1824
+ return;
1825
+ }
1826
+ this.isBusy = true;
1827
+ this.ws.addProdutoSubgrupo(this.model)
1828
+ .subscribe(r => {
1829
+ this.isBusy = false;
1830
+ this.notification.showMsg("Salvo com sucesso.");
1831
+ if (this.dialogRef)
1832
+ this.dialogRef.close(true);
1833
+ }, err => {
1834
+ this.isBusy = false;
1835
+ this.notification.showMsg(err.error);
1836
+ });
1837
+ }
1838
+ }
1839
+ ProdutoSubgrupoAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1840
+ ProdutoSubgrupoAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoSubgrupoAddDialogComponent, selector: "app-produto-subgrupo-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Subgrupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
1841
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoAddDialogComponent, decorators: [{
1842
+ type: Component,
1843
+ args: [{ selector: 'app-produto-subgrupo-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Subgrupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1844
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
1845
+ type: Inject,
1846
+ args: [MAT_DIALOG_DATA]
1847
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
1848
+
1849
+ class ProdutoSubgrupoEditDialogComponent {
1850
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
1851
+ this.ws = ws;
1852
+ this.notification = notification;
1853
+ this.dataDialog = dataDialog;
1854
+ this.dialog = dialog;
1855
+ this.elRef = elRef;
1856
+ this.dialogRef = dialogRef;
1857
+ this.screenHelper = screenHelper;
1858
+ this.isBusy = false;
1859
+ this.focus = new FocusService();
1860
+ if (dataDialog) {
1861
+ this.model = dataDialog;
1862
+ }
1863
+ this.mobile = this.screenHelper.isMedium;
1864
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1865
+ }
1866
+ ngOnInit() {
1867
+ this.focus.registerElement(this.elRef.nativeElement);
1868
+ }
1869
+ ngOnDestroy() {
1870
+ this.focus.unregisterElement(this.elRef.nativeElement);
1871
+ }
1872
+ salvar() {
1873
+ if (!this.model)
1874
+ return;
1875
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
1876
+ if (valMsg) {
1877
+ this.notification.showMsgError(valMsg);
1878
+ return;
1879
+ }
1880
+ this.isBusy = true;
1881
+ this.ws.saveProdutoSubgrupo(this.model)
1882
+ .subscribe(r => {
1883
+ this.isBusy = false;
1884
+ this.notification.showMsg("Salvo com sucesso.");
1885
+ if (this.dialogRef)
1886
+ this.dialogRef.close(true);
1887
+ }, err => {
1888
+ this.isBusy = false;
1889
+ this.notification.showMsg(err.error);
1890
+ });
1891
+ }
1892
+ }
1893
+ ProdutoSubgrupoEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1894
+ ProdutoSubgrupoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoSubgrupoEditDialogComponent, selector: "app-produto-subgrupo-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Subgrupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
1895
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoEditDialogComponent, decorators: [{
1896
+ type: Component,
1897
+ args: [{ selector: 'app-produto-subgrupo-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Subgrupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1898
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
1899
+ type: Inject,
1900
+ args: [MAT_DIALOG_DATA]
1901
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
1902
+
1903
+ class ProdutoSubgrupoSelecaoDialogComponent {
1904
+ constructor(dialogRef, dialog, ws, notification, auth, screenHelper) {
1905
+ this.dialogRef = dialogRef;
1906
+ this.dialog = dialog;
1907
+ this.ws = ws;
1908
+ this.notification = notification;
1909
+ this.screenHelper = screenHelper;
1910
+ this.items = [];
1911
+ this.selectedItem = null;
1912
+ this.isBusy = false;
1913
+ this.setting = new SearchSetting();
1914
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
1915
+ this.nav = new NavegacaoSelecaoDialogUtil(this);
1916
+ this.mobile = this.screenHelper.isMedium;
1917
+ this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
1918
+ this.allowEdit = auth.permissoes.adminProdutoGrupoPesquisa;
1919
+ }
1920
+ ngOnInit() {
1921
+ this.setting.ordem = "nome";
1922
+ this.atualiza();
1923
+ }
1924
+ atualiza() {
1925
+ this.isBusy = true;
1926
+ this.ws.buscaProdutoSubgrupo(this.setting)
1927
+ .subscribe(r => {
1928
+ this.isBusy = false;
1929
+ this.items = r;
1930
+ console.info(r);
1931
+ }, err => {
1932
+ this.isBusy = false;
1933
+ this.notification.showHttpError(err);
1934
+ });
1935
+ }
1936
+ selectItem(i) {
1937
+ if (this.selectedItem === i) {
1938
+ this.dialogRef.close(i);
1939
+ }
1940
+ this.selectedItem = i;
1941
+ }
1942
+ novo() {
1943
+ let height = (window.innerHeight * 0.90) + 'px';
1944
+ let width = 550 + 'px';
1945
+ if (this.mobile) {
1946
+ width = (window.innerWidth * 0.99) + 'px';
1947
+ //height = (window.innerHeight * 0.98) + 'px';
1948
+ }
1949
+ const dialog = this.dialog.open(ProdutoSubgrupoAddDialogComponent, {
1950
+ width: width,
1951
+ height: height,
1952
+ maxWidth: '100%',
1953
+ panelClass: 'dialog-p0',
1954
+ });
1955
+ dialog.afterClosed().subscribe(result => {
1956
+ if (result === undefined)
1957
+ return;
1958
+ this.notification.showMsg("Salvo com sucesso.");
1959
+ this.atualiza();
1960
+ });
1961
+ }
1962
+ editar() {
1963
+ let height = (window.innerHeight * 0.90) + 'px';
1964
+ let width = 550 + 'px';
1965
+ if (this.mobile) {
1966
+ width = (window.innerWidth * 0.99) + 'px';
1967
+ //height = (window.innerHeight * 0.98) + 'px';
1968
+ }
1969
+ const dialog = this.dialog.open(ProdutoSubgrupoEditDialogComponent, {
1970
+ width: width,
1971
+ height: height,
1972
+ maxWidth: '100%',
1973
+ panelClass: 'dialog-p0',
1974
+ data: this.selectedItem
1975
+ });
1976
+ dialog.afterClosed().subscribe(result => {
1977
+ if (result === undefined)
1978
+ return;
1979
+ this.notification.showMsg("Salvo com sucesso.");
1980
+ this.atualiza();
1981
+ });
1982
+ }
1983
+ }
1984
+ ProdutoSubgrupoSelecaoDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoSelecaoDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: i3.MatDialog }, { token: CommonWebService }, { token: NotificationService }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
1985
+ ProdutoSubgrupoSelecaoDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoSubgrupoSelecaoDialogComponent, selector: "app-produto-subgrupo-selecao-dialog", ngImport: i0, template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Subgrupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }] });
1986
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoSelecaoDialogComponent, decorators: [{
1987
+ type: Component,
1988
+ args: [{ selector: 'app-produto-subgrupo-selecao-dialog', template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Subgrupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
1989
+ }], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
1990
+
1991
+ class CheckButtonComponent {
1992
+ constructor() {
1993
+ this.checked = false;
1994
+ this.radioBehavior = false;
1995
+ this.changed = new EventEmitter();
1996
+ this.checked = true;
1997
+ }
1998
+ ngOnInit() {
1999
+ }
2000
+ onClick(e) {
2001
+ if (!this.radioBehavior)
2002
+ this.checked = !this.checked;
2003
+ this.changed.emit(this.checked);
2004
+ }
2005
+ }
2006
+ CheckButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CheckButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2007
+ CheckButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: CheckButtonComponent, selector: "ox-check-button", inputs: { checked: "checked", radioBehavior: "radioBehavior" }, outputs: { changed: "changed" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.checked": "checked" } }, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{padding:4px 8px;cursor:pointer;white-space:nowrap;color:#666;font-size:small;text-transform:uppercase;background-color:#ececec}:host:hover{background:rgba(0,0,0,.1)}:host(.checked){background:var(--app-tool-accent-color, black);color:#fff;box-shadow:0 8px 16px #0000001a}\n"] });
2008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CheckButtonComponent, decorators: [{
2009
+ type: Component,
2010
+ args: [{ selector: 'ox-check-button', host: {
2011
+ '[class.checked]': "checked",
2012
+ }, template: "<ng-content></ng-content>", styles: [":host{padding:4px 8px;cursor:pointer;white-space:nowrap;color:#666;font-size:small;text-transform:uppercase;background-color:#ececec}:host:hover{background:rgba(0,0,0,.1)}:host(.checked){background:var(--app-tool-accent-color, black);color:#fff;box-shadow:0 8px 16px #0000001a}\n"] }]
2013
+ }], ctorParameters: function () { return []; }, propDecorators: { checked: [{
2014
+ type: Input
2015
+ }], radioBehavior: [{
2016
+ type: Input
2017
+ }], changed: [{
2018
+ type: Output
2019
+ }], onClick: [{
2020
+ type: HostListener,
2021
+ args: ['click', ['$event']]
2022
+ }] } });
2023
+
2024
+ class RadioButtonGroupComponent {
2025
+ constructor() {
2026
+ this.change = new EventEmitter();
2027
+ this._items = [];
2028
+ //_init : boolean = false;
2029
+ this.selectedItem = null;
2030
+ }
2031
+ get items() {
2032
+ return this._items;
2033
+ }
2034
+ set items(val) {
2035
+ this._items = val;
2036
+ this.selectedItem = this.items.filter(x => x.default === true).firstOrNull();
2037
+ if (this.selectedItem === null)
2038
+ this.selectedItem = this.items.firstOrNull();
2039
+ }
2040
+ ngOnInit() {
2041
+ }
2042
+ raiseChange(item) {
2043
+ this.selectedItem = item;
2044
+ this.change.emit(this.selectedItem);
2045
+ }
2046
+ }
2047
+ RadioButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2048
+ RadioButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: RadioButtonGroupComponent, selector: "ox-radio-button-group", inputs: { selectedItem: "selectedItem", items: "items" }, outputs: { change: "change" }, ngImport: i0, template: "<ox-check-button [radioBehavior]=\"true\" (changed)=\"raiseChange(item)\" [checked]=\"item == selectedItem\" *ngFor=\"let item of items\">\n {{item.name}}\n</ox-check-button>", styles: [":host>:first-child{border-radius:4px 0 0 4px}:host>:last-child{border-radius:0 4px 4px 0}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: CheckButtonComponent, selector: "ox-check-button", inputs: ["checked", "radioBehavior"], outputs: ["changed"] }] });
2049
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, decorators: [{
2050
+ type: Component,
2051
+ args: [{ selector: 'ox-radio-button-group', template: "<ox-check-button [radioBehavior]=\"true\" (changed)=\"raiseChange(item)\" [checked]=\"item == selectedItem\" *ngFor=\"let item of items\">\n {{item.name}}\n</ox-check-button>", styles: [":host>:first-child{border-radius:4px 0 0 4px}:host>:last-child{border-radius:0 4px 4px 0}\n"] }]
2052
+ }], ctorParameters: function () { return []; }, propDecorators: { change: [{
2053
+ type: Output
2054
+ }], selectedItem: [{
2055
+ type: Input
2056
+ }], items: [{
2057
+ type: Input
2058
+ }] } });
2059
+
2060
+ const lateralAnimation = trigger('menuLateral', [
2061
+ transition(':enter', [
2062
+ style({ opacity: 0 }),
2063
+ animate('600ms', style({ 'opacity': 1 }))
2064
+ ])
2065
+ ]);
2066
+ class ProdutoFormComponent {
2067
+ constructor(dialog, ws, http, auth, notification, screenHelper) {
2068
+ this.dialog = dialog;
2069
+ this.ws = ws;
2070
+ this.http = http;
2071
+ this.auth = auth;
2072
+ this.notification = notification;
2073
+ this.screenHelper = screenHelper;
2074
+ this.cfopList = [
2075
+ { item1: '5101', item2: 'Venda de produção do estabelecimento' },
2076
+ { item1: '5102', item2: 'Venda de mercadoria adquirida ou recebida de terceiros' },
2077
+ { item1: '5405', item2: 'Venda de mercadoria, adquirida ou recebida de terceiros, sujeita ao regime de substituição tributária, na condição de contribuinte-substituído' },
2078
+ { item1: '5933', item2: 'Serviço' },
2079
+ ];
2080
+ this.stList = [
2081
+ { item1: 'F', item2: 'Subs. Trib.' },
2082
+ { item1: 'I', item2: 'Isento' },
2083
+ { item1: 'N', item2: 'Não Tributado' },
2084
+ { item1: 'Q', item2: 'Isento ISSQN' },
2085
+ { item1: 'S', item2: 'Tributado ISSQN' },
2086
+ { item1: 'T', item2: 'Tributado ICMS' },
2087
+ ];
2088
+ this.modBaseICMS = [
2089
+ { item1: 0, item2: 'Margem Valor Agregado (%)' },
2090
+ { item1: 1, item2: 'Pauta (Valor)' },
2091
+ { item1: 2, item2: 'Preço Tabelado Máx. (valor)' },
2092
+ { item1: 3, item2: 'Valor da operação' },
2093
+ ];
2094
+ this.cstICMSList = [
2095
+ { item1: '00', item2: 'Tributada integralmente' },
2096
+ { item1: '10', item2: 'Tributada e com cobrança do ICMS por substituição tributária' },
2097
+ { item1: '20', item2: 'Com redução de base de cálculo' },
2098
+ { item1: '30', item2: 'Isenta ou não tributada e com cobrança do ICMS por substituição tributária' },
2099
+ { item1: '40', item2: 'Isenta' },
2100
+ { item1: '41', item2: 'Não tributada' },
2101
+ { item1: '50', item2: 'Suspensão' },
2102
+ { item1: '51', item2: 'Diferimento' },
2103
+ { item1: '60', item2: 'ICMS cobrado anteriormente por substituição tributária' },
2104
+ { item1: '70', item2: 'Com redução de base de cálculo e cobrança do ICMS por substituição tributária' },
2105
+ { item1: '90', item2: 'Outros' },
2106
+ { item1: '101', item2: 'Tributada pelo Simples Nacional com permissão de crédito' },
2107
+ { item1: '102', item2: 'Tributada pelo Simples Nacional sem permissão de crédito' },
2108
+ { item1: '103', item2: 'Isenção do ICMS no Simples Nacional para faixa de receita bruta' },
2109
+ { item1: '300', item2: 'Imune' },
2110
+ { item1: '400', item2: 'Não tributada pelo Simples Nacional' },
2111
+ { item1: '201', item2: 'Tributada pelo Simples Nacional com permissão de crédito e com cobrança do ICMS por Substituição Tributária' },
2112
+ { item1: '202', item2: 'Tributada pelo Simples Nacional sem permissão de crédito e com cobrança do ICMS por Substituição Tributária' },
2113
+ { item1: '203', item2: 'Isenção do ICMS nos Simples Nacional para faixa de receita bruta e com cobrança do ICMS por Substituição Tributária' },
2114
+ { item1: '500', item2: 'ICMS cobrado anteriormente por substituição tributária (substituído) ou por antecipação' },
2115
+ { item1: '900', item2: 'Outros' }
2116
+ ];
2117
+ this.cstCofinsList = [
2118
+ { item1: '01', item2: ' Operação Tributável (base de cálculo = valor da operação alíquota normal (cumulativo/não cumulativo));' },
2119
+ { item1: '02', item2: ' Operação Tributável (base de cálculo = valor da operação (alíquota diferenciada));' },
2120
+ { item1: '03', item2: ' Operação Tributável (base de cálculo = quantidade vendida x alíquota por unidade de produto);' },
2121
+ { item1: '04', item2: ' Operação Tributável (tributação monofásica (alíquota zero));' },
2122
+ { item1: '05', item2: ' Operação Tributável (Substituição Tributária);' },
2123
+ { item1: '06', item2: ' Operação Tributável (alíquota zero);' },
2124
+ { item1: '07', item2: ' Operação Isenta da Contribuição;' },
2125
+ { item1: '08', item2: ' Operação Sem Incidência da Contribuição;' },
2126
+ { item1: '09', item2: ' Operação com Suspensão da Contribuição;' },
2127
+ { item1: '99', item2: ' Outras Operações;' },
2128
+ { item1: '49', item2: ' Outras Operações de Saída; ' },
2129
+ { item1: '50', item2: ' Operação com Direito a Crédito Vinculada Exclusivamente a Receita Tributada no Mercado Interno; ' },
2130
+ { item1: '51', item2: ' Operação com Direito a Crédito Vinculada Exclusivamente a Receita Não Tributada no Mercado Interno ;' },
2131
+ { item1: '52', item2: ' Operação com Direito a Crédito Vinculada Exclusivamente a Receita de Exportação; ' },
2132
+ { item1: '53', item2: ' Operação com Direito a Crédito Vinculada a Receitas Tributadas e NãoTributadas no Mercado Interno; ' },
2133
+ { item1: '54', item2: ' Operação com Direito a Crédito Vinculada a Receitas Tributadas no Mercado Interno e de Exportação ;' },
2134
+ { item1: '55', item2: ' Operação com Direito a Crédito Vinculada a Receitas NãoTributadas no Mercado Interno e de Exportação; ' },
2135
+ { item1: '56', item2: ' Operação com Direito a Crédito Vinculada a Receitas Tributadas e NãoTributadas no Mercado Interno, e de Exportação;' },
2136
+ { item1: '60', item2: ' Crédito Presumido Operação de Aquisição Vinculada Exclusivamente a Receita Tributada no Mercado Interno; ' },
2137
+ { item1: '61', item2: ' Crédito Presumido Operação de Aquisição Vinculada Exclusivamente a Receita Não Tributada no Mercado Interno; ' },
2138
+ { item1: '62', item2: ' Crédito Presumido Operação de Aquisição Vinculada Exclusivamente a Receita de Exportação; ' },
2139
+ { item1: '63', item2: ' Crédito Presumido Operação de Aquisição Vinculada a Receitas Tributadas e NãoTributadas no Mercado Interno; ' },
2140
+ { item1: '64', item2: ' Crédito Presumido Operação de Aquisição Vinculada a Receitas Tributadas no Mercado Interno e de Exportação; ' },
2141
+ { item1: '65', item2: ' Crédito Presumido Operação de Aquisição Vinculada a Receitas NãoTributadas no Mercado Interno e de Exportação; ' },
2142
+ { item1: '66', item2: ' Crédito Presumido Operação de Aquisição Vinculada a Receitas Tributadas e NãoTributadas no Mercado Interno, e de Exportação; ' },
2143
+ { item1: '67', item2: ' Crédito Presumido Outras Operações; ' },
2144
+ { item1: '70', item2: ' Operação de Aquisição sem Direito a Crédito; ' },
2145
+ { item1: '71', item2: ' Operação de Aquisição com Isenção; ' },
2146
+ { item1: '72', item2: ' Operação de Aquisição com Suspensão; ' },
2147
+ { item1: '73', item2: ' Operação de Aquisição a Alíquota Zero; ' },
2148
+ { item1: '74', item2: ' Operação de Aquisição sem Incidência da Contribuição; ' },
2149
+ { item1: '75', item2: ' Operação de Aquisição por Substituição Tributária;' },
2150
+ { item1: '98', item2: ' Outras Operações de Entrada;' },
2151
+ ];
2152
+ this.ncmEncontrado = false;
2153
+ this.ncmNaoEncontrado = false;
2154
+ this.isBusy = false;
2155
+ this.pRedBCEfet_icmsParser = new NumberParser(v => this.model.pRedBCEfet_icms = v, () => this.model.pRedBCEfet_icms);
2156
+ this.picmsEfet_icmsParser = new NumberParser(v => this.model.picmsEfet_icms = v, () => this.model.picmsEfet_icms);
2157
+ this.vbcEfet_icmsParser = new NumberParser(v => this.model.vbcEfet_icms = v, () => this.model.vbcEfet_icms);
2158
+ this.vicmsEfet_icmsParser = new NumberParser(v => this.model.vicmsEfet_icms = v, () => this.model.vicmsEfet_icms);
2159
+ this.psT_icmsParser = new NumberParser(v => this.model.psT_icms = v, () => this.model.psT_icms);
2160
+ this.vbcstRet_icmsParser = new NumberParser(v => this.model.vbcstRet_icms = v, () => this.model.vbcstRet_icms);
2161
+ this.vicmsSubstituto_icmsParser = new NumberParser(v => this.model.vicmsSubstituto_icms = v, () => this.model.vicmsSubstituto_icms);
2162
+ this.vicmsstRet_icmsParser = new NumberParser(v => this.model.vicmsstRet_icms = v, () => this.model.vicmsstRet_icms);
2163
+ this.pfcP_icmsParser = new NumberParser(v => this.model.pfcP_icms = v, () => this.model.pfcP_icms);
2164
+ this.vbcfcP_icmsParser = new NumberParser(v => this.model.vbcfcP_icms = v, () => this.model.vbcfcP_icms);
2165
+ this.pfcpsT_icmsParser = new NumberParser(v => this.model.pfcpsT_icms = v, () => this.model.pfcpsT_icms);
2166
+ this.vbcfcpsT_icmsParser = new NumberParser(v => this.model.vbcfcpsT_icms = v, () => this.model.vbcfcpsT_icms);
2167
+ this.pfcpstRet_icmsParser = new NumberParser(v => this.model.pfcpstRet_icms = v, () => this.model.pfcpstRet_icms);
2168
+ this.vbcfcpstRet_icmsParser = new NumberParser(v => this.model.vbcfcpstRet_icms = v, () => this.model.vbcfcpstRet_icms);
2169
+ this.ppiS_pisParser = new NumberParser(v => this.model.ppiS_pis = v, () => this.model.ppiS_pis);
2170
+ this.vbC_pisParser = new NumberParser(v => this.model.vbC_pis = v, () => this.model.vbC_pis);
2171
+ this.pcofinS_cofinsParser = new NumberParser(v => this.model.pcofinS_cofins = v, () => this.model.pcofinS_cofins);
2172
+ this.vbC_cofinsParser = new NumberParser(v => this.model.vbC_cofins = v, () => this.model.vbC_cofins);
2173
+ this.precoVendaParser = new NumberParser((v) => this.model.precoVenda = v ?? 0, () => this.model.precoVenda);
2174
+ this.precoCustoParser = new NumberParser((v) => this.model.precoCusto = v ?? 0, () => this.model.precoCusto);
2175
+ this.precoFuncParser = new NumberParser((v) => this.model.precoFuncionario = v ?? 0, () => this.model.precoFuncionario);
2176
+ this.pICMS_icmsParser = new NumberParser((v) => this.model.pICMS_icms = v, () => this.model.pICMS_icms);
2177
+ this.lazyTriggerNcm = new LazyTrigger(() => { this.findNCM(); });
2178
+ this.editMode = false;
2179
+ this.nextIdClick = new EventEmitter();
2180
+ this.progress = 0;
2181
+ this.message = '';
2182
+ this._model = createProduct();
2183
+ this.tabs = [
2184
+ { name: "Campos Gerais", value: 0 },
2185
+ { name: "Campos Fiscais", value: 1 },
2186
+ { name: "Cardápio Digital", value: 2 }
2187
+ ];
2188
+ this.selectedTab = 0;
2189
+ this.setores = [];
2190
+ }
2191
+ get model() {
2192
+ return this._model;
2193
+ }
2194
+ set model(value) {
2195
+ this._model = value;
2196
+ this.setImgUrl();
2197
+ this.findNCM();
2198
+ }
2199
+ ngOnInit() {
2200
+ this.loadSetores();
2201
+ }
2202
+ loadSetores() {
2203
+ this.isBusy = true;
2204
+ this.ws.getAllSetores()
2205
+ .subscribe(r => {
2206
+ this.setores = r;
2207
+ console.info(r);
2208
+ this.isBusy = false;
2209
+ }, err => {
2210
+ this.isBusy = false;
2211
+ this.notification.showHttpError(err);
2212
+ });
2213
+ }
2214
+ editarNCM() {
2215
+ let height = (window.innerHeight * 0.95) + 'px';
2216
+ let width = 550 + 'px';
2217
+ if (this.screenHelper.mobileScreen) {
2218
+ width = (window.innerWidth * 0.99) + 'px';
2219
+ height = (window.innerHeight * 0.99) + 'px';
2220
+ }
2221
+ let dialogRef = this.dialog.open(ProdutosNcmDialogComponent, {
2222
+ height: height,
2223
+ width: width,
2224
+ maxWidth: '100%',
2225
+ panelClass: 'dialog-p0',
2226
+ });
2227
+ dialogRef.afterClosed().subscribe(result => {
2228
+ if (result == undefined)
2229
+ return;
2230
+ if (!this.model)
2231
+ return;
2232
+ this.model.ncm = result.codigoApenasDigitos;
2233
+ this.lazyTriggerNcm.fire();
2234
+ });
2235
+ }
2236
+ editarSubgrupo() {
2237
+ let height = (window.innerHeight * 0.95) + 'px';
2238
+ let width = 550 + 'px';
2239
+ if (this.screenHelper.mobileScreen) {
2240
+ width = (window.innerWidth * 0.99) + 'px';
2241
+ height = (window.innerHeight * 0.99) + 'px';
2242
+ }
2243
+ let dialogRef = this.dialog.open(ProdutoSubgrupoSelecaoDialogComponent, {
2244
+ height: height,
2245
+ width: width,
2246
+ maxWidth: '100%',
2247
+ panelClass: 'dialog-p0',
2248
+ });
2249
+ dialogRef.afterClosed().subscribe(result => {
2250
+ if (result == undefined)
2251
+ return;
2252
+ if (!this.model)
2253
+ return;
2254
+ this.model.subgrupoId = result.id;
2255
+ this.model.subgrupoNome = result.nome;
2256
+ });
2257
+ }
2258
+ editarGrupo() {
2259
+ let height = (window.innerHeight * 0.95) + 'px';
2260
+ let width = 550 + 'px';
2261
+ if (this.screenHelper.mobileScreen) {
2262
+ width = (window.innerWidth * 0.99) + 'px';
2263
+ height = (window.innerHeight * 0.99) + 'px';
2264
+ }
2265
+ let dialogRef = this.dialog.open(ProdutoGrupoSelecaoDialogComponent, {
2266
+ height: height,
2267
+ width: width,
2268
+ maxWidth: '100%',
2269
+ panelClass: 'dialog-p0',
2270
+ });
2271
+ dialogRef.afterClosed().subscribe(result => {
2272
+ if (result == undefined)
2273
+ return;
2274
+ if (!this.model)
2275
+ return;
2276
+ this.model.grupoId = result.id;
2277
+ this.model.grupoNome = result.nome;
2278
+ });
2279
+ }
2280
+ editarCategoriaCardapio() {
2281
+ let height = (window.innerHeight * 0.95) + 'px';
2282
+ let width = 550 + 'px';
2283
+ if (this.screenHelper.mobileScreen) {
2284
+ width = (window.innerWidth * 0.99) + 'px';
2285
+ height = (window.innerHeight * 0.99) + 'px';
2286
+ }
2287
+ let dialogRef = this.dialog.open(ProdutoCategoriaCardapioSelecaoDialogComponent, {
2288
+ height: height,
2289
+ width: width,
2290
+ maxWidth: '100%',
2291
+ panelClass: 'dialog-p0',
2292
+ });
2293
+ dialogRef.afterClosed().subscribe(result => {
2294
+ if (result == undefined)
2295
+ return;
2296
+ if (!this.model)
2297
+ return;
2298
+ this.model.categoriaCardapioId = result.id;
2299
+ this.model.categoriaCardapioNome = result.nome;
2300
+ });
2301
+ }
2302
+ changeModo(ev) {
2303
+ this.selectedTab = ev.value;
2304
+ }
2305
+ uploadFile(files) {
2306
+ if (!this.model)
2307
+ return;
2308
+ if (files.length === 0) {
2309
+ return;
2310
+ }
2311
+ let fileToUpload = files[0];
2312
+ const formData = new FormData();
2313
+ formData.append('file', fileToUpload, fileToUpload.name);
2314
+ this.http.post(this.ws.PRODUTO_BASE_URL + "Imagem?produtoId=" + this.model.id, formData, {
2315
+ reportProgress: true,
2316
+ observe: 'events',
2317
+ headers: {
2318
+ "Authorization": 'token ' + this.auth.token,
2319
+ }
2320
+ })
2321
+ .subscribe(event => {
2322
+ if (event.type === HttpEventType.UploadProgress) {
2323
+ const total = event.total ?? -1;
2324
+ this.progress = Math.round(100 * event.loaded / total);
2325
+ }
2326
+ else if (event.type === HttpEventType.Response) {
2327
+ this.message = 'Sucesso';
2328
+ this.imgUrl = undefined;
2329
+ setTimeout(() => {
2330
+ this.setImgUrl(new Date().getMinutes() + "");
2331
+ }, 1000);
2332
+ }
2333
+ }, err => {
2334
+ const httpError = err;
2335
+ this.message = httpError.error;
2336
+ });
2337
+ }
2338
+ setImgUrl(upload = undefined) {
2339
+ if (!this.model)
2340
+ return;
2341
+ this.imgUrl = this.ws.MEDIA_PRODUTO_IMAGEM_URL +
2342
+ '?produtoId=' + this.model.id +
2343
+ '&token=' + this.auth.token +
2344
+ (upload !== undefined ? '&upload=' + upload : '');
2345
+ }
2346
+ findNCM() {
2347
+ this.ncmEncontrado = false;
2348
+ this.ncmNaoEncontrado = false;
2349
+ if (!this.model)
2350
+ return;
2351
+ if (!this.model.ncm)
2352
+ return;
2353
+ this.isBusy = true;
2354
+ this.ws.findNcm(this.model.ncm)
2355
+ .subscribe(r => {
2356
+ this.ncmEncontrado = r != null;
2357
+ this.ncmNaoEncontrado = r == null;
2358
+ console.info(r);
2359
+ this.isBusy = false;
2360
+ }, err => {
2361
+ this.isBusy = false;
2362
+ this.notification.showHttpError(err);
2363
+ });
2364
+ }
2365
+ }
2366
+ ProdutoFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoFormComponent, deps: [{ token: i3.MatDialog }, { token: CommonWebService }, { token: i1.HttpClient }, { token: AuthDataService }, { token: NotificationService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
2367
+ ProdutoFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoFormComponent, selector: "app-produto-form", inputs: { editMode: "editMode", model: "model" }, outputs: { nextIdClick: "nextIdClick" }, ngImport: i0, template: "<div style=\"margin-bottom: 16px\">\n <ox-radio-button-group (change)=\"changeModo($event)\" [items]=\"tabs\" class=\"tool-item-container\">\n </ox-radio-button-group>\n</div>\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 0\">\n <div class=\"hbox\">\n <div class=\"form-group\">\n <label>C\u00F3digo</label>\n <div class=\"hbox\">\n <input id=\"id\" [attr.readonly]=\"editMode\" [(ngModel)]=\"model.id\" class=\"form-control input-120\"\n tabindex=\"2\">\n <button (click)=\"nextIdClick.emit()\" *ngIf=\"!editMode\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n lightbulb\n </span>\n </button>\n </div>\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Refer\u00EAncia</label>\n <input id=\"referencia\" [(ngModel)]=\"model.referencia\" class=\"form-control input-120\" tabindex=\"2\">\n </div>\n </div>\n <div class=\"form-group\">\n <label>Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" cdkFocusInitial class=\"form-control input-300\" tabindex=\"2\">\n </div>\n <div class=\"hbox\">\n <div class=\"form-group\">\n <label>Pre\u00E7o de Venda</label>\n <input id=\"precoVenda\" [ngModel]=\"model.precoVenda | number:'1.2-2'\"\n (ngModelChange)=\"precoVendaParser.parse($event)\" (focusout)=\"precoVendaParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Pre\u00E7o p/ Func.</label>\n <input id=\"precoFuncionario\" [ngModel]=\"model.precoFuncionario | number:'1.2-2'\"\n (ngModelChange)=\"precoFuncParser.parse($event)\" (focusout)=\"precoFuncParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Pre\u00E7o de Custo</label>\n <input id=\"precoCusto\" [ngModel]=\"model.precoCusto | number:'1.2-2'\"\n (ngModelChange)=\"precoCustoParser.parse($event)\" (focusout)=\"precoCustoParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n </div>\n <div class=\"form-group\">\n <label>Grupo</label>\n <div class=\"hbox\">\n <div id=\"grupo\" (click)=\"editarGrupo()\" class=\"form-control grow-1 input-selecao input-300\">\n {{model.grupoNome}} </div>\n <button (click)=\"editarGrupo()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n <div class=\"form-group\">\n <label>Subgrupo</label>\n <div class=\"hbox\">\n <div id=\"subgrupo\" (click)=\"editarSubgrupo()\" class=\"form-control grow-1 input-selecao input-300\">\n {{model.subgrupoNome}} </div>\n <button (click)=\"editarSubgrupo()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>Unidade</label>\n <input id=\"unidade\" [(ngModel)]=\"model.unidade\" class=\"form-control input-120\">\n </div>\n <div class=\"form-group\">\n <label>Estoque Min.</label>\n <input id=\"estoqueMinimo\" [(ngModel)]=\"model.estoqueMinimo\" class=\"form-control input-120\">\n </div>\n </div>\n\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>C\u00F3digo Patrim\u00F4nio</label>\n <input id=\"codigoPatrimonio\" [(ngModel)]=\"model.codigoPatrimonio\" class=\"form-control input-120\"\n maxlength=\"36\">\n </div>\n <div class=\"form-group\">\n <label>Obs.</label>\n <input id=\"obs\" [(ngModel)]=\"model.obs\" class=\"form-control input-300\" maxlength=\"300\">\n </div>\n </div>\n \n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>Setor Subestoque</label>\n <mat-select [(value)]=\"model.setorSubEstoqueId\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of setores\" [value]=\"i.id\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Qtd. Subestoque</label>\n <input id=\"qtdMinSubEstoque\" [(ngModel)]=\"model.qtdMinSubEstoque\" class=\"form-control input-120 text-right\">\n </div>\n </div>\n <div class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.estoqueControlado\" tabindex=-1>Controlado no Estoque</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.imprimiCozinha\" tabindex=-1>Imprime Cozinha</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.imprimeCorredor\" tabindex=-1>Imprime Corredor</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.verNaRecepcao\" tabindex=-1>Ver na Recep\u00E7\u00E3o</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.omiteCliente\" tabindex=-1>N\u00E3o Exibe para o Cliente na Sa\u00EDda\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.isAtivo\" tabindex=-1>Ativado</mat-slide-toggle>\n </div>\n\n</div>\n\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 1\">\n\n <div style=\"margin-bottom: 16px;\" class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.emiteNFCe\" tabindex=-1>Emite Fiscal\n </mat-slide-toggle>\n </div>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>GTIN</label>\n <input id=\"gtin\" [(ngModel)]=\"model.gtin\" class=\"form-control input-120\" placeholder=\"SEM GTIN\"\n maxlength=\"14\">\n </div>\n <div class=\"form-group\">\n <label>CFOP</label>\n <input id=\"cfop\" [(ngModel)]=\"model.cfop\" [matAutocomplete]=\"auto\" matInput class=\"form-control input-100\"\n maxlength=\"4\">\n <mat-autocomplete #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of cfopList\" [value]=\"option.item1\">\n {{option.item1}} <small>{{option.item2}}</small>\n </mat-option>\n </mat-autocomplete>\n </div>\n <div class=\"form-group\">\n <label>NCM</label>\n <div class=\"hbox\">\n <input id=\"ncm\" (input)=\"lazyTriggerNcm.fire()\" [(ngModel)]=\"model.ncm\" class=\"form-control input-100\"\n maxlength=\"8\">\n <button (click)=\"editarNCM()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n <span class=\"badge buscando\" *ngIf=\"isBusy\">Buscando...</span>\n <span class=\"badge encontrado\" *ngIf=\"ncmEncontrado\">Encontrado</span>\n <span class=\"badge nao-encontrado\" *ngIf=\"ncmNaoEncontrado\">N\u00E3o encontrado</span>\n </div>\n </div>\n </div>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CEST</label>\n <input id=\"cest\" [(ngModel)]=\"model.cest\" autocomplete=\"off\" class=\"form-control input-120\" maxlength=\"7\">\n </div>\n <div class=\"form-group\">\n <label>ICMS (ECF/SAT)</label>\n <input id=\"aliquotaICMS\" [(ngModel)]=\"model.aliquotaICMS\" autocomplete=\"off\" class=\"form-control input-100 text-right\"\n maxlength=\"5\">\n </div>\n <div class=\"form-group\">\n <label>S. T. (ECF/SAT)</label>\n <input id=\"sitTrib\" [(ngModel)]=\"model.sitTrib\" autocomplete=\"off\" [matAutocomplete]=\"autoST\" matInput\n class=\"form-control input-120\" maxlength=\"5\">\n <mat-autocomplete #autoST=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of stList\" [value]=\"option.item1\">\n {{option.item1}} <small>{{option.item2}}</small>\n </mat-option>\n </mat-autocomplete>\n </div>\n </div>\n <h4>Campos da NFC-e</h4>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/CSOSN</label>\n <mat-select [(value)]=\"model.csT_icms\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of cstICMSList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliq. ICMS (%)</label>\n <input id=\"pICMS_icms\" [ngModel]=\"model.pICMS_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pICMS_icmsParser.parse($event)\" (focusout)=\"pICMS_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>Modalidade BC</label>\n <mat-select [(value)]=\"model.modBC_icms\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of modBaseICMS\" [value]=\"i.item1\">\n {{i.item1}} <small>{{i.item2}}</small>\n </mat-option>\n </mat-select>\n </div>\n </div>\n <h6>ICMS Efetivo CST60/CSOSN500</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pRedBCEfet (%)</label>\n <input id=\"pRedBCEfet_icms\" [ngModel]=\"model.pRedBCEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pRedBCEfet_icmsParser.parse($event)\" (focusout)=\"pRedBCEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pICMSEfet (%)</label>\n <input id=\"picmsEfet_icms\" [ngModel]=\"model.picmsEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"picmsEfet_icmsParser.parse($event)\" (focusout)=\"picmsEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCEfet (R$)</label>\n <input id=\"vbcEfet_icms\" [ngModel]=\"model.vbcEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcEfet_icmsParser.parse($event)\" (focusout)=\"vbcEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSEfet (R$)</label>\n <input id=\"vicmsEfet_icms\" [ngModel]=\"model.vicmsEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsEfet_icmsParser.parse($event)\" (focusout)=\"vicmsEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>Substitui\u00E7\u00E3o Tribut\u00E1ria (ST)</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pST (%)</label>\n <input id=\"psT_icms\" [ngModel]=\"model.psT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"psT_icmsParser.parse($event)\" (focusout)=\"psT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCSTRet (R$)</label>\n <input id=\"vbcstRet_icms\" [ngModel]=\"model.vbcstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcstRet_icmsParser.parse($event)\" (focusout)=\"vbcstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSSubs (R$)</label>\n <input id=\"vicmsSubstituto_icms\" [ngModel]=\"model.vicmsSubstituto_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsSubstituto_icmsParser.parse($event)\"\n (focusout)=\"vicmsSubstituto_icmsParser.checkout()\" class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSSTRet (R$)</label>\n <input id=\"vicmsstRet_icms\" [ngModel]=\"model.vicmsstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsstRet_icmsParser.parse($event)\" (focusout)=\"vicmsstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>Fundo de Combate a Pobresa</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pFCP (%)</label>\n <input id=\"pfcP_icms\" [ngModel]=\"model.pfcP_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcP_icmsParser.parse($event)\" (focusout)=\"pfcP_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCP (R$)</label>\n <input id=\"vbcfcP_icms\" [ngModel]=\"model.vbcfcP_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcP_icmsParser.parse($event)\" (focusout)=\"vbcfcP_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pFCPST (%)</label>\n <input id=\"pfcpsT_icms\" [ngModel]=\"model.pfcpsT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcpsT_icmsParser.parse($event)\" (focusout)=\"pfcpsT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCPST (R$)</label>\n <input id=\"vbcfcpsT_icms\" [ngModel]=\"model.vbcfcpsT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcpsT_icmsParser.parse($event)\" (focusout)=\"vbcfcpsT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pFCPSTRet (%)</label>\n <input id=\"pfcpstRet_icms\" [ngModel]=\"model.pfcpstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcpstRet_icmsParser.parse($event)\" (focusout)=\"pfcpstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCPSTRet (R$)</label>\n <input id=\"vbcfcpstRet_icms\" [ngModel]=\"model.vbcfcpstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcpstRet_icmsParser.parse($event)\" (focusout)=\"vbcfcpstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>PIS</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/PIS</label>\n <mat-select [(value)]=\"model.csT_pis\" class=\"form-control input-120\">\n <mat-option [value]=\"null\">\n Nenhum\n </mat-option>\n <mat-option *ngFor=\"let i of cstCofinsList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliquota PIS (%)</label>\n <input id=\"ppiS_pis\" [ngModel]=\"model.ppiS_pis | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"ppiS_pisParser.parse($event)\" (focusout)=\"ppiS_pisParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>PIS BC %</label>\n <input id=\"vbC_pis\" [ngModel]=\"model.vbC_pis | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbC_pisParser.parse($event)\" (focusout)=\"vbC_pisParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n \n <h6>COFINS</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/COFINS</label>\n <mat-select [(value)]=\"model.csT_cofins\" class=\"form-control input-120\">\n <mat-option [value]=\"null\">\n Nenhum\n </mat-option>\n <mat-option *ngFor=\"let i of cstCofinsList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliq. COFINS (%)</label>\n <input id=\"pcofinS_cofins\" [ngModel]=\"model.pcofinS_cofins | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pcofinS_cofinsParser.parse($event)\" (focusout)=\"pcofinS_cofinsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>COFINS BC %</label>\n <input id=\"vbC_cofins\" [ngModel]=\"model.vbC_cofins | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbC_cofinsParser.parse($event)\" (focusout)=\"vbC_cofinsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n</div>\n\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 2\">\n\n <div style=\"margin-bottom: 16px;\" class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.disponivelCardapio\" tabindex=-1>Dispon\u00EDvel no Card\u00E1pio Digital\n </mat-slide-toggle>\n </div>\n <div class=\"form-group\">\n <label>Descri\u00E7\u00E3o</label>\n <textarea id=\"descricao\" [(ngModel)]=\"model.descricao\" cols=\"40\" rows=\"5\" class=\"form-control input-300\"\n tabindex=\"2\"></textarea>\n </div>\n <div class=\"form-group\">\n <label>Categoria</label>\n <div class=\"hbox\">\n <div id=\"categoriaCardapio\" (click)=\"editarCategoriaCardapio()\"\n class=\"form-control grow-1 input-selecao input-300\">\n {{model.categoriaCardapioNome}} </div>\n <button (click)=\"editarCategoriaCardapio()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n <div class=\"imagem-container\" *ngIf=\"editMode\">\n <img [src]=\"imgUrl\" class=\"img-fluid\" *ngIf=\"imgUrl\" />\n\n <input type=\"file\" #file placeholder=\"Choose file\" (change)=\"uploadFile(file.files)\" accept=\".jpg,.png\"\n style=\"display: none;\">\n\n <button mat-button color=\"primary\" type=\"button\" (click)=\"file.click()\">Escolher Imagem</button>\n\n <span class=\"upload\" *ngIf=\"progress > 0\">\n {{progress}}%\n </span>\n <span class=\"upload\" *ngIf=\"message\">\n {{message}}\n </span>\n </div>\n\n</div>", styles: [".imagem-container{border:1px solid #ced4da;display:flex;flex-direction:column;border-radius:9px;max-width:460px}small{font-size:xx-small}.badge{color:#fff;font-size:xx-small;display:flex;align-items:center;padding:4px;border-radius:13px;margin-left:2px}.badge.encontrado{background:#05a301;border:1px solid #28d112}.badge.nao-encontrado{background:#a30101;border:1px solid #d17812}.badge.buscando{background:#929292;border:1px solid #a3a3a3}h6{margin:8px 0;color:#666}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i12.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i12.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: RadioButtonGroupComponent, selector: "ox-radio-button-group", inputs: ["selectedItem", "items"], outputs: ["change"] }, { kind: "pipe", type: i6.DecimalPipe, name: "number" }], animations: [lateralAnimation] });
2368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoFormComponent, decorators: [{
2369
+ type: Component,
2370
+ args: [{ selector: 'app-produto-form', animations: [lateralAnimation], template: "<div style=\"margin-bottom: 16px\">\n <ox-radio-button-group (change)=\"changeModo($event)\" [items]=\"tabs\" class=\"tool-item-container\">\n </ox-radio-button-group>\n</div>\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 0\">\n <div class=\"hbox\">\n <div class=\"form-group\">\n <label>C\u00F3digo</label>\n <div class=\"hbox\">\n <input id=\"id\" [attr.readonly]=\"editMode\" [(ngModel)]=\"model.id\" class=\"form-control input-120\"\n tabindex=\"2\">\n <button (click)=\"nextIdClick.emit()\" *ngIf=\"!editMode\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n lightbulb\n </span>\n </button>\n </div>\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Refer\u00EAncia</label>\n <input id=\"referencia\" [(ngModel)]=\"model.referencia\" class=\"form-control input-120\" tabindex=\"2\">\n </div>\n </div>\n <div class=\"form-group\">\n <label>Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" cdkFocusInitial class=\"form-control input-300\" tabindex=\"2\">\n </div>\n <div class=\"hbox\">\n <div class=\"form-group\">\n <label>Pre\u00E7o de Venda</label>\n <input id=\"precoVenda\" [ngModel]=\"model.precoVenda | number:'1.2-2'\"\n (ngModelChange)=\"precoVendaParser.parse($event)\" (focusout)=\"precoVendaParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Pre\u00E7o p/ Func.</label>\n <input id=\"precoFuncionario\" [ngModel]=\"model.precoFuncionario | number:'1.2-2'\"\n (ngModelChange)=\"precoFuncParser.parse($event)\" (focusout)=\"precoFuncParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Pre\u00E7o de Custo</label>\n <input id=\"precoCusto\" [ngModel]=\"model.precoCusto | number:'1.2-2'\"\n (ngModelChange)=\"precoCustoParser.parse($event)\" (focusout)=\"precoCustoParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n </div>\n <div class=\"form-group\">\n <label>Grupo</label>\n <div class=\"hbox\">\n <div id=\"grupo\" (click)=\"editarGrupo()\" class=\"form-control grow-1 input-selecao input-300\">\n {{model.grupoNome}} </div>\n <button (click)=\"editarGrupo()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n <div class=\"form-group\">\n <label>Subgrupo</label>\n <div class=\"hbox\">\n <div id=\"subgrupo\" (click)=\"editarSubgrupo()\" class=\"form-control grow-1 input-selecao input-300\">\n {{model.subgrupoNome}} </div>\n <button (click)=\"editarSubgrupo()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>Unidade</label>\n <input id=\"unidade\" [(ngModel)]=\"model.unidade\" class=\"form-control input-120\">\n </div>\n <div class=\"form-group\">\n <label>Estoque Min.</label>\n <input id=\"estoqueMinimo\" [(ngModel)]=\"model.estoqueMinimo\" class=\"form-control input-120\">\n </div>\n </div>\n\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>C\u00F3digo Patrim\u00F4nio</label>\n <input id=\"codigoPatrimonio\" [(ngModel)]=\"model.codigoPatrimonio\" class=\"form-control input-120\"\n maxlength=\"36\">\n </div>\n <div class=\"form-group\">\n <label>Obs.</label>\n <input id=\"obs\" [(ngModel)]=\"model.obs\" class=\"form-control input-300\" maxlength=\"300\">\n </div>\n </div>\n \n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>Setor Subestoque</label>\n <mat-select [(value)]=\"model.setorSubEstoqueId\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of setores\" [value]=\"i.id\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Qtd. Subestoque</label>\n <input id=\"qtdMinSubEstoque\" [(ngModel)]=\"model.qtdMinSubEstoque\" class=\"form-control input-120 text-right\">\n </div>\n </div>\n <div class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.estoqueControlado\" tabindex=-1>Controlado no Estoque</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.imprimiCozinha\" tabindex=-1>Imprime Cozinha</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.imprimeCorredor\" tabindex=-1>Imprime Corredor</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.verNaRecepcao\" tabindex=-1>Ver na Recep\u00E7\u00E3o</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.omiteCliente\" tabindex=-1>N\u00E3o Exibe para o Cliente na Sa\u00EDda\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.isAtivo\" tabindex=-1>Ativado</mat-slide-toggle>\n </div>\n\n</div>\n\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 1\">\n\n <div style=\"margin-bottom: 16px;\" class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.emiteNFCe\" tabindex=-1>Emite Fiscal\n </mat-slide-toggle>\n </div>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>GTIN</label>\n <input id=\"gtin\" [(ngModel)]=\"model.gtin\" class=\"form-control input-120\" placeholder=\"SEM GTIN\"\n maxlength=\"14\">\n </div>\n <div class=\"form-group\">\n <label>CFOP</label>\n <input id=\"cfop\" [(ngModel)]=\"model.cfop\" [matAutocomplete]=\"auto\" matInput class=\"form-control input-100\"\n maxlength=\"4\">\n <mat-autocomplete #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of cfopList\" [value]=\"option.item1\">\n {{option.item1}} <small>{{option.item2}}</small>\n </mat-option>\n </mat-autocomplete>\n </div>\n <div class=\"form-group\">\n <label>NCM</label>\n <div class=\"hbox\">\n <input id=\"ncm\" (input)=\"lazyTriggerNcm.fire()\" [(ngModel)]=\"model.ncm\" class=\"form-control input-100\"\n maxlength=\"8\">\n <button (click)=\"editarNCM()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n <span class=\"badge buscando\" *ngIf=\"isBusy\">Buscando...</span>\n <span class=\"badge encontrado\" *ngIf=\"ncmEncontrado\">Encontrado</span>\n <span class=\"badge nao-encontrado\" *ngIf=\"ncmNaoEncontrado\">N\u00E3o encontrado</span>\n </div>\n </div>\n </div>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CEST</label>\n <input id=\"cest\" [(ngModel)]=\"model.cest\" autocomplete=\"off\" class=\"form-control input-120\" maxlength=\"7\">\n </div>\n <div class=\"form-group\">\n <label>ICMS (ECF/SAT)</label>\n <input id=\"aliquotaICMS\" [(ngModel)]=\"model.aliquotaICMS\" autocomplete=\"off\" class=\"form-control input-100 text-right\"\n maxlength=\"5\">\n </div>\n <div class=\"form-group\">\n <label>S. T. (ECF/SAT)</label>\n <input id=\"sitTrib\" [(ngModel)]=\"model.sitTrib\" autocomplete=\"off\" [matAutocomplete]=\"autoST\" matInput\n class=\"form-control input-120\" maxlength=\"5\">\n <mat-autocomplete #autoST=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of stList\" [value]=\"option.item1\">\n {{option.item1}} <small>{{option.item2}}</small>\n </mat-option>\n </mat-autocomplete>\n </div>\n </div>\n <h4>Campos da NFC-e</h4>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/CSOSN</label>\n <mat-select [(value)]=\"model.csT_icms\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of cstICMSList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliq. ICMS (%)</label>\n <input id=\"pICMS_icms\" [ngModel]=\"model.pICMS_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pICMS_icmsParser.parse($event)\" (focusout)=\"pICMS_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>Modalidade BC</label>\n <mat-select [(value)]=\"model.modBC_icms\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of modBaseICMS\" [value]=\"i.item1\">\n {{i.item1}} <small>{{i.item2}}</small>\n </mat-option>\n </mat-select>\n </div>\n </div>\n <h6>ICMS Efetivo CST60/CSOSN500</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pRedBCEfet (%)</label>\n <input id=\"pRedBCEfet_icms\" [ngModel]=\"model.pRedBCEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pRedBCEfet_icmsParser.parse($event)\" (focusout)=\"pRedBCEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pICMSEfet (%)</label>\n <input id=\"picmsEfet_icms\" [ngModel]=\"model.picmsEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"picmsEfet_icmsParser.parse($event)\" (focusout)=\"picmsEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCEfet (R$)</label>\n <input id=\"vbcEfet_icms\" [ngModel]=\"model.vbcEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcEfet_icmsParser.parse($event)\" (focusout)=\"vbcEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSEfet (R$)</label>\n <input id=\"vicmsEfet_icms\" [ngModel]=\"model.vicmsEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsEfet_icmsParser.parse($event)\" (focusout)=\"vicmsEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>Substitui\u00E7\u00E3o Tribut\u00E1ria (ST)</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pST (%)</label>\n <input id=\"psT_icms\" [ngModel]=\"model.psT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"psT_icmsParser.parse($event)\" (focusout)=\"psT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCSTRet (R$)</label>\n <input id=\"vbcstRet_icms\" [ngModel]=\"model.vbcstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcstRet_icmsParser.parse($event)\" (focusout)=\"vbcstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSSubs (R$)</label>\n <input id=\"vicmsSubstituto_icms\" [ngModel]=\"model.vicmsSubstituto_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsSubstituto_icmsParser.parse($event)\"\n (focusout)=\"vicmsSubstituto_icmsParser.checkout()\" class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSSTRet (R$)</label>\n <input id=\"vicmsstRet_icms\" [ngModel]=\"model.vicmsstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsstRet_icmsParser.parse($event)\" (focusout)=\"vicmsstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>Fundo de Combate a Pobresa</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pFCP (%)</label>\n <input id=\"pfcP_icms\" [ngModel]=\"model.pfcP_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcP_icmsParser.parse($event)\" (focusout)=\"pfcP_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCP (R$)</label>\n <input id=\"vbcfcP_icms\" [ngModel]=\"model.vbcfcP_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcP_icmsParser.parse($event)\" (focusout)=\"vbcfcP_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pFCPST (%)</label>\n <input id=\"pfcpsT_icms\" [ngModel]=\"model.pfcpsT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcpsT_icmsParser.parse($event)\" (focusout)=\"pfcpsT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCPST (R$)</label>\n <input id=\"vbcfcpsT_icms\" [ngModel]=\"model.vbcfcpsT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcpsT_icmsParser.parse($event)\" (focusout)=\"vbcfcpsT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pFCPSTRet (%)</label>\n <input id=\"pfcpstRet_icms\" [ngModel]=\"model.pfcpstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcpstRet_icmsParser.parse($event)\" (focusout)=\"pfcpstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCPSTRet (R$)</label>\n <input id=\"vbcfcpstRet_icms\" [ngModel]=\"model.vbcfcpstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcpstRet_icmsParser.parse($event)\" (focusout)=\"vbcfcpstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>PIS</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/PIS</label>\n <mat-select [(value)]=\"model.csT_pis\" class=\"form-control input-120\">\n <mat-option [value]=\"null\">\n Nenhum\n </mat-option>\n <mat-option *ngFor=\"let i of cstCofinsList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliquota PIS (%)</label>\n <input id=\"ppiS_pis\" [ngModel]=\"model.ppiS_pis | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"ppiS_pisParser.parse($event)\" (focusout)=\"ppiS_pisParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>PIS BC %</label>\n <input id=\"vbC_pis\" [ngModel]=\"model.vbC_pis | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbC_pisParser.parse($event)\" (focusout)=\"vbC_pisParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n \n <h6>COFINS</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/COFINS</label>\n <mat-select [(value)]=\"model.csT_cofins\" class=\"form-control input-120\">\n <mat-option [value]=\"null\">\n Nenhum\n </mat-option>\n <mat-option *ngFor=\"let i of cstCofinsList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliq. COFINS (%)</label>\n <input id=\"pcofinS_cofins\" [ngModel]=\"model.pcofinS_cofins | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pcofinS_cofinsParser.parse($event)\" (focusout)=\"pcofinS_cofinsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>COFINS BC %</label>\n <input id=\"vbC_cofins\" [ngModel]=\"model.vbC_cofins | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbC_cofinsParser.parse($event)\" (focusout)=\"vbC_cofinsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n</div>\n\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 2\">\n\n <div style=\"margin-bottom: 16px;\" class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.disponivelCardapio\" tabindex=-1>Dispon\u00EDvel no Card\u00E1pio Digital\n </mat-slide-toggle>\n </div>\n <div class=\"form-group\">\n <label>Descri\u00E7\u00E3o</label>\n <textarea id=\"descricao\" [(ngModel)]=\"model.descricao\" cols=\"40\" rows=\"5\" class=\"form-control input-300\"\n tabindex=\"2\"></textarea>\n </div>\n <div class=\"form-group\">\n <label>Categoria</label>\n <div class=\"hbox\">\n <div id=\"categoriaCardapio\" (click)=\"editarCategoriaCardapio()\"\n class=\"form-control grow-1 input-selecao input-300\">\n {{model.categoriaCardapioNome}} </div>\n <button (click)=\"editarCategoriaCardapio()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n <div class=\"imagem-container\" *ngIf=\"editMode\">\n <img [src]=\"imgUrl\" class=\"img-fluid\" *ngIf=\"imgUrl\" />\n\n <input type=\"file\" #file placeholder=\"Choose file\" (change)=\"uploadFile(file.files)\" accept=\".jpg,.png\"\n style=\"display: none;\">\n\n <button mat-button color=\"primary\" type=\"button\" (click)=\"file.click()\">Escolher Imagem</button>\n\n <span class=\"upload\" *ngIf=\"progress > 0\">\n {{progress}}%\n </span>\n <span class=\"upload\" *ngIf=\"message\">\n {{message}}\n </span>\n </div>\n\n</div>", styles: [".imagem-container{border:1px solid #ced4da;display:flex;flex-direction:column;border-radius:9px;max-width:460px}small{font-size:xx-small}.badge{color:#fff;font-size:xx-small;display:flex;align-items:center;padding:4px;border-radius:13px;margin-left:2px}.badge.encontrado{background:#05a301;border:1px solid #28d112}.badge.nao-encontrado{background:#a30101;border:1px solid #d17812}.badge.buscando{background:#929292;border:1px solid #a3a3a3}h6{margin:8px 0;color:#666}\n"] }]
2371
+ }], ctorParameters: function () { return [{ type: i3.MatDialog }, { type: CommonWebService }, { type: i1.HttpClient }, { type: AuthDataService }, { type: NotificationService }, { type: ScreenHelperService }]; }, propDecorators: { editMode: [{
2372
+ type: Input
2373
+ }], nextIdClick: [{
2374
+ type: Output
2375
+ }], model: [{
2376
+ type: Input
2377
+ }] } });
2378
+
2379
+ class ProdutoAddDialogComponent {
2380
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
2381
+ this.ws = ws;
2382
+ this.notification = notification;
2383
+ this.dataDialog = dataDialog;
2384
+ this.dialog = dialog;
2385
+ this.elRef = elRef;
2386
+ this.dialogRef = dialogRef;
2387
+ this.screenHelper = screenHelper;
2388
+ this.isBusy = false;
2389
+ this.focus = new FocusService();
2390
+ this.model = createProduct();
2391
+ this.mobile = this.screenHelper.isMedium;
2392
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2393
+ }
2394
+ ngOnInit() {
2395
+ this.focus.registerElement(this.elRef.nativeElement);
2396
+ this.getNextId();
2397
+ }
2398
+ ngOnDestroy() {
2399
+ this.focus.unregisterElement(this.elRef.nativeElement);
2400
+ }
2401
+ salvar() {
2402
+ if (!this.model)
2403
+ return;
2404
+ const valMsg = validaProduto(this.model, this.focus);
2405
+ if (valMsg) {
2406
+ this.notification.showMsgError(valMsg);
2407
+ return;
2408
+ }
2409
+ this.isBusy = true;
2410
+ this.ws.addProduto(this.model)
2411
+ .subscribe(r => {
2412
+ this.isBusy = false;
2413
+ this.notification.showMsg("Salvo com sucesso.");
2414
+ if (this.dialogRef)
2415
+ this.dialogRef.close(true);
2416
+ }, err => {
2417
+ this.isBusy = false;
2418
+ this.notification.showMsg(err.error);
2419
+ });
2420
+ }
2421
+ getNextId() {
2422
+ this.isBusy = true;
2423
+ this.ws.getNextIdProduto()
2424
+ .subscribe(r => {
2425
+ this.model.id = r;
2426
+ this.model.referencia = '' + r;
2427
+ this.isBusy = false;
2428
+ }, err => {
2429
+ this.isBusy = false;
2430
+ this.notification.showMsg(err.error);
2431
+ });
2432
+ }
2433
+ }
2434
+ ProdutoAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
2435
+ ProdutoAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoAddDialogComponent, selector: "app-produto-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Produto</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-form (nextIdClick)=\"getNextId()\" [model]=\"model\" *ngIf=\"model\"></app-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoFormComponent, selector: "app-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }] });
2436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoAddDialogComponent, decorators: [{
2437
+ type: Component,
2438
+ args: [{ selector: 'app-produto-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Produto</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-form (nextIdClick)=\"getNextId()\" [model]=\"model\" *ngIf=\"model\"></app-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
2439
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
2440
+ type: Inject,
2441
+ args: [MAT_DIALOG_DATA]
2442
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
2443
+
2444
+ class ProdutoBuscaFiltrosDialogComponent {
2445
+ constructor(d, ws, notification, dialogRef) {
2446
+ this.d = d;
2447
+ this.ws = ws;
2448
+ this.notification = notification;
2449
+ this.dialogRef = dialogRef;
2450
+ this.isBusy = false;
2451
+ this.produtosGrupos = [];
2452
+ this.d.setting.grupos = undefined;
2453
+ }
2454
+ ngOnInit() {
2455
+ this.getProdutos();
2456
+ }
2457
+ getProdutos() {
2458
+ this.isBusy = true;
2459
+ this.ws.getAllProdutoGrupo()
2460
+ .subscribe(r => {
2461
+ this.produtosGrupos = r;
2462
+ console.info(r);
2463
+ this.isBusy = false;
2464
+ }, err => {
2465
+ this.isBusy = false;
2466
+ this.notification.showHttpError(err);
2467
+ });
2468
+ }
2469
+ salvar() {
2470
+ this.dialogRef.close(this.d);
2471
+ }
2472
+ changeGruposProdutos(ev) {
2473
+ const itens = ev.value;
2474
+ this.d.setting.grupos = itens;
2475
+ }
2476
+ }
2477
+ ProdutoBuscaFiltrosDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoBuscaFiltrosDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
2478
+ ProdutoBuscaFiltrosDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoBuscaFiltrosDialogComponent, selector: "app-produto-busca-filtros-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <span class=\"titulo\">Filtros de Pesquisa</span>\n <button mat-icon-button mat-dialog-close>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"dialog-content\">\n <div class=\"vbox\">\n <h4>Op\u00E7\u00F5es de exibi\u00E7\u00E3o</h4>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeNaoControladoEstoque\" tabindex=-1>Exibir n\u00E3o controlado no\n estoque</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeApenasMostraRecepcao\" tabindex=-1>Apenas o que mostra na recep\u00E7\u00E3o\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeImprimiCozinha\" tabindex=-1>Exibir imprime na cozinha\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeInativo\" tabindex=-1>Exibir desativados</mat-slide-toggle>\n </div>\n <div class=\"vbox margin-top-16\">\n <h4>Selecione um ou mais grupos</h4>\n <mat-select (selectionChange)=\"changeGruposProdutos($event)\" multiple>\n <mat-option *ngFor=\"let i of produtosGrupos\" [value]=\"i.id\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"vbox margin-top-32\">\n <h4>Quantidade de Itens por P\u00E1gina</h4>\n\n <div class=\"form-group\">\n <label>Quantidade</label>\n <input [(ngModel)]=\"d.qtd\" class=\"form-control input-120\" maxlength=\"10\" type=\"number\">\n </div>\n </div>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button (click)=\"salvar()\">CONFIRMAR</button>\n</div>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}.header{display:flex;background:white;border-bottom:1px solid #eee}.header .titulo{align-self:center;margin-left:16px;text-transform:uppercase;flex-grow:1}mat-select{background:white;height:36px;padding:8px 16px;border-radius:.25rem;border:1px solid #ced4da}h4{margin:0 0 16px}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }] });
2479
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoBuscaFiltrosDialogComponent, decorators: [{
2480
+ type: Component,
2481
+ args: [{ selector: 'app-produto-busca-filtros-dialog', template: "<div class=\"ox-header\">\n <span class=\"titulo\">Filtros de Pesquisa</span>\n <button mat-icon-button mat-dialog-close>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"dialog-content\">\n <div class=\"vbox\">\n <h4>Op\u00E7\u00F5es de exibi\u00E7\u00E3o</h4>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeNaoControladoEstoque\" tabindex=-1>Exibir n\u00E3o controlado no\n estoque</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeApenasMostraRecepcao\" tabindex=-1>Apenas o que mostra na recep\u00E7\u00E3o\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeImprimiCozinha\" tabindex=-1>Exibir imprime na cozinha\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeInativo\" tabindex=-1>Exibir desativados</mat-slide-toggle>\n </div>\n <div class=\"vbox margin-top-16\">\n <h4>Selecione um ou mais grupos</h4>\n <mat-select (selectionChange)=\"changeGruposProdutos($event)\" multiple>\n <mat-option *ngFor=\"let i of produtosGrupos\" [value]=\"i.id\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"vbox margin-top-32\">\n <h4>Quantidade de Itens por P\u00E1gina</h4>\n\n <div class=\"form-group\">\n <label>Quantidade</label>\n <input [(ngModel)]=\"d.qtd\" class=\"form-control input-120\" maxlength=\"10\" type=\"number\">\n </div>\n </div>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button (click)=\"salvar()\">CONFIRMAR</button>\n</div>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}.header{display:flex;background:white;border-bottom:1px solid #eee}.header .titulo{align-self:center;margin-left:16px;text-transform:uppercase;flex-grow:1}mat-select{background:white;height:36px;padding:8px 16px;border-radius:.25rem;border:1px solid #ced4da}h4{margin:0 0 16px}\n"] }]
2482
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2483
+ type: Inject,
2484
+ args: [MAT_DIALOG_DATA]
2485
+ }] }, { type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialogRef }]; } });
2486
+
2487
+ class ProdutoEditDialogComponent {
2488
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
2489
+ this.ws = ws;
2490
+ this.notification = notification;
2491
+ this.dataDialog = dataDialog;
2492
+ this.dialog = dialog;
2493
+ this.elRef = elRef;
2494
+ this.dialogRef = dialogRef;
2495
+ this.screenHelper = screenHelper;
2496
+ this.isBusy = false;
2497
+ this.focus = new FocusService();
2498
+ if (dataDialog) {
2499
+ this.model = dataDialog;
2500
+ }
2501
+ this.mobile = this.screenHelper.isMedium;
2502
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2503
+ }
2504
+ ngOnInit() {
2505
+ this.focus.registerElement(this.elRef.nativeElement);
2506
+ }
2507
+ ngOnDestroy() {
2508
+ this.focus.unregisterElement(this.elRef.nativeElement);
2509
+ }
2510
+ salvar() {
2511
+ if (!this.model)
2512
+ return;
2513
+ const valMsg = validaProduto(this.model, this.focus);
2514
+ if (valMsg) {
2515
+ this.notification.showMsgError(valMsg);
2516
+ return;
2517
+ }
2518
+ this.isBusy = true;
2519
+ this.ws.saveProduto(this.model)
2520
+ .subscribe(r => {
2521
+ this.isBusy = false;
2522
+ this.notification.showMsg("Salvo com sucesso.");
2523
+ if (this.dialogRef)
2524
+ this.dialogRef.close(true);
2525
+ }, err => {
2526
+ this.isBusy = false;
2527
+ this.notification.showMsg(err.error);
2528
+ });
2529
+ }
2530
+ }
2531
+ ProdutoEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
2532
+ ProdutoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoEditDialogComponent, selector: "app-produto-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Produto</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></app-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoFormComponent, selector: "app-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }] });
2533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoEditDialogComponent, decorators: [{
2534
+ type: Component,
2535
+ args: [{ selector: 'app-produto-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Produto</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <app-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></app-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
2536
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
2537
+ type: Inject,
2538
+ args: [MAT_DIALOG_DATA]
2539
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
2540
+
2541
+ class ProdutoSearchSetting extends SearchSetting {
2542
+ constructor() {
2543
+ super();
2544
+ this.exibeNaoControladoEstoque = true;
2545
+ this.exibeApenasMostraRecepcao = false;
2546
+ this.exibeInativo = false;
2547
+ this.exibeImprimiCozinha = false;
2548
+ this.exibeHePrato = false;
2549
+ }
2550
+ }
2551
+
2552
+ class PaginatorComponent {
2553
+ constructor() {
2554
+ this.paginaAtualChange = new EventEmitter();
2555
+ this.totalPaginasChange = new EventEmitter();
2556
+ this.change = new EventEmitter();
2557
+ this._paginaAtual = 1;
2558
+ this._totalPaginas = 1;
2559
+ this.inicio = true;
2560
+ this.fim = true;
2561
+ this.pageSize = 0;
2562
+ }
2563
+ get paginaAtual() {
2564
+ return this._paginaAtual;
2565
+ }
2566
+ set paginaAtual(val) {
2567
+ this._paginaAtual = val;
2568
+ this.paginaAtualChange.emit(val);
2569
+ this.refreshUI();
2570
+ }
2571
+ get totalPaginas() {
2572
+ return this._totalPaginas;
2573
+ }
2574
+ set totalPaginas(val) {
2575
+ this._totalPaginas = val;
2576
+ this.totalPaginasChange.emit(val);
2577
+ this.refreshUI();
2578
+ }
2579
+ ngOnInit() {
2580
+ }
2581
+ trocaPagina(pagina) {
2582
+ if (pagina > this.totalPaginas || pagina < 1)
2583
+ return;
2584
+ this.paginaAtual = pagina;
2585
+ this.refreshUI();
2586
+ this.change.emit(this.paginaAtual);
2587
+ }
2588
+ refreshUI() {
2589
+ this.inicio = this.paginaAtual == 1;
2590
+ this.fim = this.paginaAtual == this.totalPaginas;
2591
+ }
2592
+ goBack() {
2593
+ this.trocaPagina(this.paginaAtual - 1);
2594
+ }
2595
+ goNext() {
2596
+ this.trocaPagina(this.paginaAtual + 1);
2597
+ }
2598
+ }
2599
+ PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2600
+ PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: PaginatorComponent, selector: "ox-paginator", inputs: { pageSize: "pageSize", paginaAtual: "paginaAtual", totalPaginas: "totalPaginas" }, outputs: { paginaAtualChange: "paginaAtualChange", totalPaginasChange: "totalPaginasChange", change: "change" }, ngImport: i0, template: "<button [disabled]=\"inicio\" mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n</button>\n<span class=\"picker-text\">\n {{paginaAtual}}/{{totalPaginas}}\n</span>\n<button [disabled]=\"fim\" mat-icon-button (click)=\"goNext()\">\n <mat-icon>chevron_right</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;flex-wrap:nowrap}.picker-text{flex-flow:1;flex-grow:1;text-align:center}\n"], dependencies: [{ kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
2601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, decorators: [{
2602
+ type: Component,
2603
+ args: [{ selector: 'ox-paginator', template: "<button [disabled]=\"inicio\" mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n</button>\n<span class=\"picker-text\">\n {{paginaAtual}}/{{totalPaginas}}\n</span>\n<button [disabled]=\"fim\" mat-icon-button (click)=\"goNext()\">\n <mat-icon>chevron_right</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;flex-wrap:nowrap}.picker-text{flex-flow:1;flex-grow:1;text-align:center}\n"] }]
2604
+ }], ctorParameters: function () { return []; }, propDecorators: { paginaAtualChange: [{
2605
+ type: Output
2606
+ }], totalPaginasChange: [{
2607
+ type: Output
2608
+ }], change: [{
2609
+ type: Output
2610
+ }], pageSize: [{
2611
+ type: Input
2612
+ }], paginaAtual: [{
2613
+ type: Input
2614
+ }], totalPaginas: [{
2615
+ type: Input
2616
+ }] } });
2617
+
2618
+ class ProdutosComponent {
2619
+ constructor(ws, notification, dialog, auth, screenHelper) {
2620
+ this.ws = ws;
2621
+ this.notification = notification;
2622
+ this.dialog = dialog;
2623
+ this.screenHelper = screenHelper;
2624
+ this.isBusy = false;
2625
+ this.items = [];
2626
+ this.result = {
2627
+ finalQtd: 0,
2628
+ inicioQtd: 0,
2629
+ items: [],
2630
+ pagina: 0,
2631
+ quantidade: 0,
2632
+ valor: 0,
2633
+ totalPaginas: 0
2634
+ };
2635
+ this._selectedItem = null;
2636
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
2637
+ this.setting = new ProdutoSearchSetting();
2638
+ this.focus = new FocusService();
2639
+ this.paginaAtual = 1;
2640
+ this.quantidadePagina = 50;
2641
+ this.allowAdd = auth.permissoes.adminProdutoAdd;
2642
+ this.allowExcluir = auth.permissoes.adminProdutoDelete;
2643
+ this.mobile = this.screenHelper.isMedium;
2644
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2645
+ this.setting.exibeNaoControladoEstoque = true;
2646
+ this.setting.exibeImprimiCozinha = true;
2647
+ }
2648
+ get selectedItem() {
2649
+ return this._selectedItem;
2650
+ }
2651
+ set selectedItem(p) {
2652
+ this._selectedItem = p;
2653
+ }
2654
+ ngOnInit() {
2655
+ this.setting.ordem = "nome";
2656
+ this.atualiza();
2657
+ }
2658
+ onSelectItem() {
2659
+ if (!this.focus.hasInit()) {
2660
+ setTimeout(() => {
2661
+ this.focus.registerElementById("form-column");
2662
+ this.focus.setFirst();
2663
+ }, 500);
2664
+ //this._focus.registerElementById("form-column");
2665
+ }
2666
+ else {
2667
+ this.focus.setFirst();
2668
+ }
2669
+ }
2670
+ ngOnDestroy() {
2671
+ this.focus.unregisterElementById("form-column");
2672
+ }
2673
+ trocaPagina() {
2674
+ this.atualiza(this.paginaAtual);
2675
+ }
2676
+ atualiza(pagina) {
2677
+ if (pagina == undefined)
2678
+ this.paginaAtual = 1;
2679
+ else
2680
+ this.paginaAtual = pagina;
2681
+ this.isBusy = true;
2682
+ this.ws.buscaPaginadaProdutos(this.setting, this.paginaAtual, this.quantidadePagina)
2683
+ .subscribe(r => {
2684
+ this.items = r.items;
2685
+ this.result = r;
2686
+ this.selectedItem = null;
2687
+ console.info(r);
2688
+ this.isBusy = false;
2689
+ }, err => {
2690
+ this.isBusy = false;
2691
+ this.notification.showHttpError(err);
2692
+ });
2693
+ }
2694
+ excluir() {
2695
+ const item = this.selectedItem;
2696
+ if (!item)
2697
+ return;
2698
+ confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do produto ${item.nome}?`, () => {
2699
+ this.isBusy = true;
2700
+ this.ws.deleteProduto(item.id)
2701
+ .subscribe(r => {
2702
+ this.notification.showMsg("O produto foi excluído com sucesso.");
2703
+ this.items.remove(item);
2704
+ this.selectedItem = null;
2705
+ this.isBusy = false;
2706
+ }, err => {
2707
+ this.isBusy = false;
2708
+ this.notification.showMsg(err.error);
2709
+ });
2710
+ });
2711
+ }
2712
+ novo() {
2713
+ let height = (window.innerHeight * 0.90) + 'px';
2714
+ let width = 550 + 'px';
2715
+ if (this.mobile) {
2716
+ width = (window.innerWidth * 0.99) + 'px';
2717
+ //height = (window.innerHeight * 0.98) + 'px';
2718
+ }
2719
+ const dialog = this.dialog.open(ProdutoAddDialogComponent, {
2720
+ width: width,
2721
+ height: height,
2722
+ maxWidth: '100%',
2723
+ panelClass: 'dialog-p0',
2724
+ });
2725
+ dialog.afterClosed().subscribe(result => {
2726
+ if (result === undefined)
2727
+ return;
2728
+ this.notification.showMsg("Salvo com sucesso.");
2729
+ this.atualiza();
2730
+ });
2731
+ }
2732
+ abreCadastro(item) {
2733
+ let height = undefined;
2734
+ let width = 550 + 'px';
2735
+ if (this.mobile) {
2736
+ width = (window.innerWidth * 0.99) + 'px';
2737
+ height = (window.innerHeight * 0.99) + 'px';
2738
+ }
2739
+ const dialog = this.dialog.open(ProdutoEditDialogComponent, {
2740
+ data: item,
2741
+ width: width,
2742
+ height: height,
2743
+ maxWidth: '100%',
2744
+ panelClass: 'dialog-p0',
2745
+ });
2746
+ dialog.afterClosed().subscribe(result => {
2747
+ if (result !== true)
2748
+ return;
2749
+ this.notification.showMsg("Salvo com sucesso.");
2750
+ this.atualiza();
2751
+ });
2752
+ }
2753
+ salvar() {
2754
+ if (!this.selectedItem)
2755
+ return;
2756
+ const valMsg = validaProduto(this.selectedItem, this.focus);
2757
+ if (valMsg) {
2758
+ this.notification.showMsgError(valMsg);
2759
+ return;
2760
+ }
2761
+ this.isBusy = true;
2762
+ this.ws.saveProduto(this.selectedItem)
2763
+ .subscribe(r => {
2764
+ this.notification.showMsg("Salvo com sucesso.");
2765
+ this.isBusy = false;
2766
+ }, err => {
2767
+ this.isBusy = false;
2768
+ this.notification.showMsg(err.error);
2769
+ });
2770
+ }
2771
+ filtros() {
2772
+ let height = undefined;
2773
+ let width = 550 + 'px';
2774
+ if (this.mobile) {
2775
+ width = (window.innerWidth * 0.99) + 'px';
2776
+ height = (window.innerHeight * 0.99) + 'px';
2777
+ }
2778
+ const p = {
2779
+ qtd: this.quantidadePagina,
2780
+ setting: this.setting
2781
+ };
2782
+ const dialog = this.dialog.open(ProdutoBuscaFiltrosDialogComponent, {
2783
+ data: p,
2784
+ width: width,
2785
+ height: height,
2786
+ maxWidth: '100%',
2787
+ panelClass: 'dialog-p0',
2788
+ });
2789
+ dialog.afterClosed().subscribe(result => {
2790
+ if (!result)
2791
+ return;
2792
+ const r = result;
2793
+ this.quantidadePagina = r.qtd;
2794
+ this.atualiza();
2795
+ });
2796
+ }
2797
+ }
2798
+ ProdutosComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
2799
+ ProdutosComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosComponent, selector: "app-produtos", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n <button mat-icon-button (click)=\"filtros()\">\n <mat-icon aria-label=\"Filtros\">manage_search</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [desativado]=\"!i.isAtivo\" [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div> \n <div class=\"hbox\" *ngIf=\"mobile\">\n <ox-paginator (change)=\"trocaPagina()\" [(paginaAtual)]=\"paginaAtual\" [(totalPaginas)]=\"result.totalPaginas\">\n </ox-paginator>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n <button mat-icon-button (click)=\"filtros()\">\n <mat-icon aria-label=\"Filtros\">manage_search</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [desativado]=\"!i.isAtivo\" [cloud]=\"i.enviadoPC\" [codigo]=\"i.id\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n <div class=\"hbox\">\n <ox-paginator (change)=\"trocaPagina()\" [(paginaAtual)]=\"paginaAtual\" [(totalPaginas)]=\"result.totalPaginas\">\n </ox-paginator>\n <div class=\"total-qtd\">Exibindo {{result.inicioQtd}}-{{result.finalQtd}} de {{result.quantidade}}</div>\n \n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um produto no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\" [editMode]=\"true\">\n </app-produto-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}.total-qtd{align-self:center;font-size:small}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: PaginatorComponent, selector: "ox-paginator", inputs: ["pageSize", "paginaAtual", "totalPaginas"], outputs: ["paginaAtualChange", "totalPaginasChange", "change"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: ProdutoFormComponent, selector: "app-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
2800
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosComponent, decorators: [{
2801
+ type: Component,
2802
+ args: [{ selector: 'app-produtos', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n <button mat-icon-button (click)=\"filtros()\">\n <mat-icon aria-label=\"Filtros\">manage_search</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [desativado]=\"!i.isAtivo\" [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div> \n <div class=\"hbox\" *ngIf=\"mobile\">\n <ox-paginator (change)=\"trocaPagina()\" [(paginaAtual)]=\"paginaAtual\" [(totalPaginas)]=\"result.totalPaginas\">\n </ox-paginator>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n <button mat-icon-button (click)=\"filtros()\">\n <mat-icon aria-label=\"Filtros\">manage_search</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [desativado]=\"!i.isAtivo\" [cloud]=\"i.enviadoPC\" [codigo]=\"i.id\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n <div class=\"hbox\">\n <ox-paginator (change)=\"trocaPagina()\" [(paginaAtual)]=\"paginaAtual\" [(totalPaginas)]=\"result.totalPaginas\">\n </ox-paginator>\n <div class=\"total-qtd\">Exibindo {{result.inicioQtd}}-{{result.finalQtd}} de {{result.quantidade}}</div>\n \n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um produto no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\" [editMode]=\"true\">\n </app-produto-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}.total-qtd{align-self:center;font-size:small}\n"] }]
2803
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
2804
+
2805
+ class ProdutosCategoriasCardapioComponent {
2806
+ constructor(ws, notification, dialog, auth, screenHelper) {
2807
+ this.ws = ws;
2808
+ this.notification = notification;
2809
+ this.dialog = dialog;
2810
+ this.screenHelper = screenHelper;
2811
+ this.isBusy = false;
2812
+ this.items = [];
2813
+ this.selectedItem = null;
2814
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
2815
+ this.setting = new SearchSetting();
2816
+ this.focus = new FocusService();
2817
+ this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
2818
+ this.allowExcluir = auth.permissoes.adminProdutoGrupoDelete;
2819
+ this.mobile = this.screenHelper.isMedium;
2820
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2821
+ }
2822
+ ngOnInit() {
2823
+ this.setting.ordem = "nome";
2824
+ this.atualiza();
2825
+ }
2826
+ onSelectItem() {
2827
+ if (!this.focus.hasInit()) {
2828
+ setTimeout(() => {
2829
+ this.focus.registerElementById("form-column");
2830
+ this.focus.setFirst();
2831
+ }, 500);
2832
+ //this._focus.registerElementById("form-column");
2833
+ }
2834
+ else {
2835
+ this.focus.setFirst();
2836
+ }
2837
+ }
2838
+ ngOnDestroy() {
2839
+ this.focus.unregisterElementById("form-column");
2840
+ }
2841
+ atualiza() {
2842
+ this.isBusy = true;
2843
+ this.ws.buscaProdutoCategoriaCardapio(this.setting)
2844
+ .subscribe(r => {
2845
+ this.items = r;
2846
+ this.selectedItem = null;
2847
+ console.info(r);
2848
+ this.isBusy = false;
2849
+ }, err => {
2850
+ this.isBusy = false;
2851
+ this.notification.showHttpError(err);
2852
+ });
2853
+ }
2854
+ excluir() {
2855
+ const item = this.selectedItem;
2856
+ if (!item)
2857
+ return;
2858
+ confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do grupo ${item.nome}?`, () => {
2859
+ this.isBusy = true;
2860
+ this.ws.deleteProdutoCategoriaCardapio(item.id)
2861
+ .subscribe(r => {
2862
+ this.notification.showMsg("O grupo foi excluído com sucesso.");
2863
+ this.items.remove(item);
2864
+ this.selectedItem = null;
2865
+ this.isBusy = false;
2866
+ }, err => {
2867
+ this.isBusy = false;
2868
+ this.notification.showMsg(err.error);
2869
+ });
2870
+ });
2871
+ }
2872
+ novo() {
2873
+ let height = (window.innerHeight * 0.90) + 'px';
2874
+ let width = 550 + 'px';
2875
+ if (this.mobile) {
2876
+ width = (window.innerWidth * 0.99) + 'px';
2877
+ //height = (window.innerHeight * 0.98) + 'px';
2878
+ }
2879
+ const dialog = this.dialog.open(ProdutoCategoriaCardapioAddDialogComponent, {
2880
+ width: width,
2881
+ //height: height,
2882
+ maxWidth: '100%',
2883
+ panelClass: 'dialog-p0',
2884
+ });
2885
+ dialog.afterClosed().subscribe(result => {
2886
+ if (result === undefined)
2887
+ return;
2888
+ this.notification.showMsg("Salvo com sucesso.");
2889
+ this.atualiza();
2890
+ });
2891
+ }
2892
+ abreCadastro(item) {
2893
+ let height = undefined;
2894
+ let width = 550 + 'px';
2895
+ if (this.mobile) {
2896
+ width = (window.innerWidth * 0.99) + 'px';
2897
+ height = (window.innerHeight * 0.99) + 'px';
2898
+ }
2899
+ const dialog = this.dialog.open(ProdutoCategoriaCardapioEditDialogComponent, {
2900
+ data: item,
2901
+ width: width,
2902
+ //height: height,
2903
+ maxWidth: '100%',
2904
+ panelClass: 'dialog-p0',
2905
+ });
2906
+ dialog.afterClosed().subscribe(result => {
2907
+ if (result !== true)
2908
+ return;
2909
+ this.notification.showMsg("Salvo com sucesso.");
2910
+ this.atualiza();
2911
+ });
2912
+ }
2913
+ salvar() {
2914
+ if (!this.selectedItem)
2915
+ return;
2916
+ const valMsg = validaProdutoGrupo(this.selectedItem, this.focus);
2917
+ if (valMsg) {
2918
+ this.notification.showMsgError(valMsg);
2919
+ return;
2920
+ }
2921
+ this.isBusy = true;
2922
+ this.ws.saveProdutoCategoriaCardapio(this.selectedItem)
2923
+ .subscribe(r => {
2924
+ this.notification.showMsg("Salvo com sucesso.");
2925
+ this.isBusy = false;
2926
+ }, err => {
2927
+ this.isBusy = false;
2928
+ this.notification.showMsg(err.error);
2929
+ });
2930
+ }
2931
+ }
2932
+ ProdutosCategoriasCardapioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosCategoriasCardapioComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
2933
+ ProdutosCategoriasCardapioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosCategoriasCardapioComponent, selector: "app-produtos-categorias-cardapio", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Grupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um grupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
2934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosCategoriasCardapioComponent, decorators: [{
2935
+ type: Component,
2936
+ args: [{ selector: 'app-produtos-categorias-cardapio', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Grupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um grupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"] }]
2937
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
2938
+
2939
+ class MoverGrupoDialogComponent {
2940
+ constructor(ws, dialogRef, notification, dataDialog) {
2941
+ this.ws = ws;
2942
+ this.dialogRef = dialogRef;
2943
+ this.notification = notification;
2944
+ this.dataDialog = dataDialog;
2945
+ this.grupos = [];
2946
+ this.selected = null;
2947
+ this.isBusy = false;
2948
+ }
2949
+ ngOnInit() {
2950
+ this.atualiza();
2951
+ }
2952
+ atualiza() {
2953
+ this.isBusy = true;
2954
+ this.ws.getAllProdutoGrupo()
2955
+ .subscribe(r => {
2956
+ this.grupos = r;
2957
+ console.info(r);
2958
+ this.isBusy = false;
2959
+ }, err => {
2960
+ this.isBusy = false;
2961
+ this.notification.showHttpError(err);
2962
+ });
2963
+ }
2964
+ salvar() {
2965
+ if (!this.selected) {
2966
+ this.notification.showMsgError("Selecione um novo grupo.");
2967
+ return;
2968
+ }
2969
+ this.isBusy = true;
2970
+ this.ws.transfereProdutoGrupo(this.dataDialog.id, this.selected.id)
2971
+ .subscribe(r => {
2972
+ console.info(r);
2973
+ this.notification.showMsg(`${r} produtos foram atualizados com sucesso.`);
2974
+ this.dialogRef.close();
2975
+ this.isBusy = false;
2976
+ }, err => {
2977
+ this.isBusy = false;
2978
+ this.notification.showHttpError(err);
2979
+ });
2980
+ }
2981
+ }
2982
+ MoverGrupoDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MoverGrupoDialogComponent, deps: [{ token: CommonWebService }, { token: i3.MatDialogRef }, { token: NotificationService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2983
+ MoverGrupoDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: MoverGrupoDialogComponent, selector: "app-mover-grupo-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Transferir Produtos para um Novo Grupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <div class=\"vbox\">\n <p *ngIf=\"!selected\">Voc\u00EA pode transferir todos os produtos que utilizam o grupo <strong>'{{dataDialog.nome}}'</strong> para outro grupo.</p>\n <p class=\"alert alert-warning\" *ngIf=\"selected\">Transferir produtos com grupo '{{dataDialog.nome}}'' para '{{selected?.nome}}'</p>\n <h4>Selecione um novo grupo para transferir os produtos do grupo</h4>\n \n <mat-select class=\"form-group\" [(value)]=\"selected\">\n <mat-option *ngFor=\"let i of grupos\" [value]=\"i\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n \n </div>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }] });
2984
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MoverGrupoDialogComponent, decorators: [{
2985
+ type: Component,
2986
+ args: [{ selector: 'app-mover-grupo-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Transferir Produtos para um Novo Grupo</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <div class=\"vbox\">\n <p *ngIf=\"!selected\">Voc\u00EA pode transferir todos os produtos que utilizam o grupo <strong>'{{dataDialog.nome}}'</strong> para outro grupo.</p>\n <p class=\"alert alert-warning\" *ngIf=\"selected\">Transferir produtos com grupo '{{dataDialog.nome}}'' para '{{selected?.nome}}'</p>\n <h4>Selecione um novo grupo para transferir os produtos do grupo</h4>\n \n <mat-select class=\"form-group\" [(value)]=\"selected\">\n <mat-option *ngFor=\"let i of grupos\" [value]=\"i\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n \n </div>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
2987
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: i3.MatDialogRef }, { type: NotificationService }, { type: undefined, decorators: [{
2988
+ type: Inject,
2989
+ args: [MAT_DIALOG_DATA]
2990
+ }] }]; } });
2991
+
2992
+ class ProdutosGruposComponent {
2993
+ constructor(ws, notification, dialog, auth, screenHelper) {
2994
+ this.ws = ws;
2995
+ this.notification = notification;
2996
+ this.dialog = dialog;
2997
+ this.screenHelper = screenHelper;
20
2998
  this.isBusy = false;
2999
+ this.items = [];
3000
+ this.selectedItem = null;
3001
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
3002
+ this.setting = new SearchSetting();
3003
+ this.focus = new FocusService();
3004
+ this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
3005
+ this.allowExcluir = auth.permissoes.adminProdutoGrupoDelete;
3006
+ this.mobile = this.screenHelper.isMedium;
3007
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
21
3008
  }
22
3009
  ngOnInit() {
3010
+ this.setting.ordem = "nome";
3011
+ this.atualiza();
3012
+ }
3013
+ onSelectItem() {
3014
+ if (!this.focus.hasInit()) {
3015
+ setTimeout(() => {
3016
+ this.focus.registerElementById("form-column");
3017
+ this.focus.setFirst();
3018
+ }, 500);
3019
+ //this._focus.registerElementById("form-column");
3020
+ }
3021
+ else {
3022
+ this.focus.setFirst();
3023
+ }
3024
+ }
3025
+ ngOnDestroy() {
3026
+ this.focus.unregisterElementById("form-column");
3027
+ }
3028
+ atualiza() {
3029
+ this.isBusy = true;
3030
+ this.ws.buscaProdutoGrupo(this.setting)
3031
+ .subscribe(r => {
3032
+ this.items = r;
3033
+ this.selectedItem = null;
3034
+ console.info(r);
3035
+ this.isBusy = false;
3036
+ }, err => {
3037
+ this.isBusy = false;
3038
+ this.notification.showHttpError(err);
3039
+ });
3040
+ }
3041
+ excluir() {
3042
+ const item = this.selectedItem;
3043
+ if (!item)
3044
+ return;
3045
+ confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do grupo ${item.nome}?`, () => {
3046
+ this.isBusy = true;
3047
+ this.ws.deleteProdutoGrupo(item.id)
3048
+ .subscribe(r => {
3049
+ this.notification.showMsg("O grupo foi excluído com sucesso.");
3050
+ this.items.remove(item);
3051
+ this.selectedItem = null;
3052
+ this.isBusy = false;
3053
+ }, err => {
3054
+ this.isBusy = false;
3055
+ this.notification.showMsg(err.error);
3056
+ });
3057
+ });
3058
+ }
3059
+ novo() {
3060
+ let height = (window.innerHeight * 0.90) + 'px';
3061
+ let width = 550 + 'px';
3062
+ if (this.mobile) {
3063
+ width = (window.innerWidth * 0.99) + 'px';
3064
+ //height = (window.innerHeight * 0.98) + 'px';
3065
+ }
3066
+ const dialog = this.dialog.open(ProdutoGrupoAddDialogComponent, {
3067
+ width: width,
3068
+ //height: height,
3069
+ maxWidth: '100%',
3070
+ panelClass: 'dialog-p0',
3071
+ });
3072
+ dialog.afterClosed().subscribe(result => {
3073
+ if (result === undefined)
3074
+ return;
3075
+ this.notification.showMsg("Salvo com sucesso.");
3076
+ this.atualiza();
3077
+ });
3078
+ }
3079
+ abreCadastro(item) {
3080
+ let height = undefined;
3081
+ let width = 550 + 'px';
3082
+ if (this.mobile) {
3083
+ width = (window.innerWidth * 0.99) + 'px';
3084
+ height = (window.innerHeight * 0.99) + 'px';
3085
+ }
3086
+ const dialog = this.dialog.open(ProdutoGrupoEditDialogComponent, {
3087
+ data: item,
3088
+ width: width,
3089
+ //height: height,
3090
+ maxWidth: '100%',
3091
+ panelClass: 'dialog-p0',
3092
+ });
3093
+ dialog.afterClosed().subscribe(result => {
3094
+ if (result !== true)
3095
+ return;
3096
+ this.notification.showMsg("Salvo com sucesso.");
3097
+ this.atualiza();
3098
+ });
3099
+ }
3100
+ salvar() {
3101
+ const item = this.selectedItem;
3102
+ if (!item)
3103
+ return;
3104
+ const valMsg = validaProdutoGrupo(item, this.focus);
3105
+ if (valMsg) {
3106
+ this.notification.showMsgError(valMsg);
3107
+ return;
3108
+ }
3109
+ this.isBusy = true;
3110
+ this.ws.saveProdutoGrupo(item)
3111
+ .subscribe(r => {
3112
+ this.notification.showMsg("Salvo com sucesso.");
3113
+ this.isBusy = false;
3114
+ }, err => {
3115
+ this.isBusy = false;
3116
+ this.notification.showMsg(err.error);
3117
+ });
3118
+ }
3119
+ moverGrupo() {
3120
+ let height = (window.innerHeight * 0.90) + 'px';
3121
+ let width = 550 + 'px';
3122
+ if (this.mobile) {
3123
+ width = (window.innerWidth * 0.99) + 'px';
3124
+ //height = (window.innerHeight * 0.98) + 'px';
3125
+ }
3126
+ const dialog = this.dialog.open(MoverGrupoDialogComponent, {
3127
+ width: width,
3128
+ data: this.selectedItem,
3129
+ //height: height,
3130
+ maxWidth: '100%',
3131
+ panelClass: 'dialog-p0',
3132
+ });
3133
+ dialog.afterClosed().subscribe(result => {
3134
+ if (result === undefined)
3135
+ return;
3136
+ this.notification.showMsg("Salvo com sucesso.");
3137
+ this.atualiza();
3138
+ });
23
3139
  }
24
3140
  }
25
- BusyIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: BusyIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
26
- BusyIndicatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: { isBusy: "isBusy" }, ngImport: i0, template: "<div class=\"busy-indicator-container\" *ngIf=\"isBusy\">\n <div class=\"busy-indicator\"></div>\n</div>", styles: [".busy-indicator-container{position:fixed;left:50%;top:35%;text-align:center;z-index:1000;margin-left:-47px;background:rgb(255,255,255);border-radius:8px;padding:20px;border:solid 2px transparent;background-clip:padding-box;box-shadow:10px 10px 10px #2e364414}.busy-indicator{border:10px solid #e2e2e2;border-top:10px solid var(--app-color, black);border-radius:50%;width:50px;height:50px;animation:spin .5s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: BusyIndicatorComponent, decorators: [{
3141
+ ProdutosGruposComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosGruposComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
3142
+ ProdutosGruposComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosGruposComponent, selector: "app-produtos-grupos", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n <button mat-icon-button (click)=\"moverGrupo()\" *ngIf=\"selectedItem\" [@fade]>\n <mat-icon aria-label=\"Transferir Grupo\">sync_alt</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Grupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n <button mat-icon-button (click)=\"moverGrupo()\" *ngIf=\"selectedItem\" [@fade]>\n <mat-icon aria-label=\"Transferir Grupo\">move_up</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um grupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
3143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosGruposComponent, decorators: [{
28
3144
  type: Component,
29
- args: [{ selector: 'ox-busy-indicator', template: "<div class=\"busy-indicator-container\" *ngIf=\"isBusy\">\n <div class=\"busy-indicator\"></div>\n</div>", styles: [".busy-indicator-container{position:fixed;left:50%;top:35%;text-align:center;z-index:1000;margin-left:-47px;background:rgb(255,255,255);border-radius:8px;padding:20px;border:solid 2px transparent;background-clip:padding-box;box-shadow:10px 10px 10px #2e364414}.busy-indicator{border:10px solid #e2e2e2;border-top:10px solid var(--app-color, black);border-radius:50%;width:50px;height:50px;animation:spin .5s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
30
- }], ctorParameters: function () { return []; }, propDecorators: { isBusy: [{
31
- type: Input
32
- }] } });
3145
+ args: [{ selector: 'app-produtos-grupos', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n <button mat-icon-button (click)=\"moverGrupo()\" *ngIf=\"selectedItem\" [@fade]>\n <mat-icon aria-label=\"Transferir Grupo\">sync_alt</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Grupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n <button mat-icon-button (click)=\"moverGrupo()\" *ngIf=\"selectedItem\" [@fade]>\n <mat-icon aria-label=\"Transferir Grupo\">move_up</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um grupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"] }]
3146
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
33
3147
 
34
- class CheckButtonComponent {
35
- constructor() {
36
- this.checked = false;
37
- this.radioBehavior = false;
38
- this.changed = new EventEmitter();
39
- this.checked = true;
3148
+ class ProdutosSubgruposComponent {
3149
+ constructor(ws, notification, dialog, auth, screenHelper) {
3150
+ this.ws = ws;
3151
+ this.notification = notification;
3152
+ this.dialog = dialog;
3153
+ this.screenHelper = screenHelper;
3154
+ this.isBusy = false;
3155
+ this.items = [];
3156
+ this.selectedItem = null;
3157
+ this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
3158
+ this.setting = new SearchSetting();
3159
+ this.focus = new FocusService();
3160
+ this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
3161
+ this.allowExcluir = auth.permissoes.adminProdutoGrupoDelete;
3162
+ this.mobile = this.screenHelper.isMedium;
3163
+ this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
40
3164
  }
41
3165
  ngOnInit() {
3166
+ this.setting.ordem = "nome";
3167
+ this.atualiza();
3168
+ }
3169
+ onSelectItem() {
3170
+ if (!this.focus.hasInit()) {
3171
+ setTimeout(() => {
3172
+ this.focus.registerElementById("form-column");
3173
+ this.focus.setFirst();
3174
+ }, 500);
3175
+ //this._focus.registerElementById("form-column");
3176
+ }
3177
+ else {
3178
+ this.focus.setFirst();
3179
+ }
42
3180
  }
43
- onClick(e) {
44
- if (!this.radioBehavior)
45
- this.checked = !this.checked;
46
- this.changed.emit(this.checked);
3181
+ ngOnDestroy() {
3182
+ this.focus.unregisterElementById("form-column");
3183
+ }
3184
+ atualiza() {
3185
+ this.isBusy = true;
3186
+ this.ws.buscaProdutoSubgrupo(this.setting)
3187
+ .subscribe(r => {
3188
+ this.items = r;
3189
+ this.selectedItem = null;
3190
+ console.info(r);
3191
+ this.isBusy = false;
3192
+ }, err => {
3193
+ this.isBusy = false;
3194
+ this.notification.showHttpError(err);
3195
+ });
3196
+ }
3197
+ excluir() {
3198
+ const item = this.selectedItem;
3199
+ if (!item)
3200
+ return;
3201
+ confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do subgrupo ${item.nome}?`, () => {
3202
+ this.isBusy = true;
3203
+ this.ws.deleteProdutoSubgrupo(item.id)
3204
+ .subscribe(r => {
3205
+ this.notification.showMsg("O subgrupo foi excluído com sucesso.");
3206
+ this.items.remove(item);
3207
+ this.selectedItem = null;
3208
+ this.isBusy = false;
3209
+ }, err => {
3210
+ this.isBusy = false;
3211
+ this.notification.showMsg(err.error);
3212
+ });
3213
+ });
3214
+ }
3215
+ novo() {
3216
+ let height = (window.innerHeight * 0.90) + 'px';
3217
+ let width = 550 + 'px';
3218
+ if (this.mobile) {
3219
+ width = (window.innerWidth * 0.99) + 'px';
3220
+ //height = (window.innerHeight * 0.98) + 'px';
3221
+ }
3222
+ const dialog = this.dialog.open(ProdutoSubgrupoAddDialogComponent, {
3223
+ width: width,
3224
+ //height: height,
3225
+ maxWidth: '100%',
3226
+ panelClass: 'dialog-p0',
3227
+ });
3228
+ dialog.afterClosed().subscribe(result => {
3229
+ if (result === undefined)
3230
+ return;
3231
+ this.notification.showMsg("Salvo com sucesso.");
3232
+ this.atualiza();
3233
+ });
3234
+ }
3235
+ abreCadastro(item) {
3236
+ let height = undefined;
3237
+ let width = 550 + 'px';
3238
+ if (this.mobile) {
3239
+ width = (window.innerWidth * 0.99) + 'px';
3240
+ height = (window.innerHeight * 0.99) + 'px';
3241
+ }
3242
+ const dialog = this.dialog.open(ProdutoSubgrupoEditDialogComponent, {
3243
+ data: item,
3244
+ width: width,
3245
+ //height: height,
3246
+ maxWidth: '100%',
3247
+ panelClass: 'dialog-p0',
3248
+ });
3249
+ dialog.afterClosed().subscribe(result => {
3250
+ if (result !== true)
3251
+ return;
3252
+ this.notification.showMsg("Salvo com sucesso.");
3253
+ this.atualiza();
3254
+ });
3255
+ }
3256
+ salvar() {
3257
+ if (!this.selectedItem)
3258
+ return;
3259
+ const valMsg = validaProdutoGrupo(this.selectedItem, this.focus);
3260
+ if (valMsg) {
3261
+ this.notification.showMsgError(valMsg);
3262
+ return;
3263
+ }
3264
+ this.isBusy = true;
3265
+ this.ws.saveProdutoSubgrupo(this.selectedItem)
3266
+ .subscribe(r => {
3267
+ this.notification.showMsg("Salvo com sucesso.");
3268
+ this.isBusy = false;
3269
+ }, err => {
3270
+ this.isBusy = false;
3271
+ this.notification.showMsg(err.error);
3272
+ });
47
3273
  }
48
3274
  }
49
- CheckButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CheckButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
50
- CheckButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: CheckButtonComponent, selector: "ox-check-button", inputs: { checked: "checked", radioBehavior: "radioBehavior" }, outputs: { changed: "changed" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.checked": "checked" } }, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{padding:4px 8px;cursor:pointer;white-space:nowrap;color:#666;font-size:small;text-transform:uppercase;background-color:#ececec}:host:hover{background:rgba(0,0,0,.1)}:host(.checked){background:var(--app-tool-accent-color, black);color:#fff;box-shadow:0 8px 16px #0000001a}\n"] });
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CheckButtonComponent, decorators: [{
3275
+ ProdutosSubgruposComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosSubgruposComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
3276
+ ProdutosSubgruposComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosSubgruposComponent, selector: "app-produtos-subgrupos", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Subgrupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Subgrupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Subgrupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um subgrupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
3277
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosSubgruposComponent, decorators: [{
52
3278
  type: Component,
53
- args: [{ selector: 'ox-check-button', host: {
54
- '[class.checked]': "checked",
55
- }, template: "<ng-content></ng-content>", styles: [":host{padding:4px 8px;cursor:pointer;white-space:nowrap;color:#666;font-size:small;text-transform:uppercase;background-color:#ececec}:host:hover{background:rgba(0,0,0,.1)}:host(.checked){background:var(--app-tool-accent-color, black);color:#fff;box-shadow:0 8px 16px #0000001a}\n"] }]
56
- }], ctorParameters: function () { return []; }, propDecorators: { checked: [{
57
- type: Input
58
- }], radioBehavior: [{
59
- type: Input
60
- }], changed: [{
61
- type: Output
62
- }], onClick: [{
63
- type: HostListener,
64
- args: ['click', ['$event']]
65
- }] } });
3279
+ args: [{ selector: 'app-produtos-subgrupos', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Subgrupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Subgrupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Subgrupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um subgrupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"] }]
3280
+ }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
66
3281
 
67
3282
  class ImageViewerComponent {
68
3283
  constructor() {
@@ -115,7 +3330,7 @@ class ImageViewerComponent {
115
3330
  }
116
3331
  }
117
3332
  ImageViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ImageViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
118
- ImageViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ImageViewerComponent, selector: "ox-image-viewer", inputs: { info: "info", infos: "infos", isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<div class=\"image-fullsize\" *ngIf=\"isOpen\">\n <div class=\"titulo\">\n {{info?.titulo}}\n </div>\n <div class=\"img-container\" (click)=\"isOpen = !isOpen\">\n <img class=\"image\" *ngIf=\"info\" [src]=\"info?.url\" />\n </div>\n <div class=\"action-bar\" *ngIf=\"infos\">\n <button (click)=\"goBack()\" [disabled]=\"disableBack\" mat-icon-button>\n <mat-icon>chevron_left</mat-icon>\n </button>\n <span class=\"picker-text\">\n {{paginaAtual}}/{{infos?.length}}\n </span>\n <button (click)=\"goNext()\" [disabled]=\"disableNext\" mat-icon-button>\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".image-fullsize{position:absolute;left:0;top:0;background:rgba(0,0,0,.8);width:100%;height:100%;display:flex;flex-flow:column}.titulo{color:#fff;text-align:center;padding:16px;font-size:large;font-weight:300}.action-bar{background:linear-gradient(135deg,rgba(0,0,0,.8) 0%,rgba(0,0,0,.9) 50%,rgba(0,0,0,.8) 100%);color:#fff;padding:8px}.img-container{flex-grow:1;display:flex;justify-content:center;align-items:center}.image{box-shadow:0 5px 35px #000000a6;max-width:100%;height:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
3333
+ ImageViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ImageViewerComponent, selector: "ox-image-viewer", inputs: { info: "info", infos: "infos", isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<div class=\"image-fullsize\" *ngIf=\"isOpen\">\n <div class=\"titulo\">\n {{info?.titulo}}\n </div>\n <div class=\"img-container\" (click)=\"isOpen = !isOpen\">\n <img class=\"image\" *ngIf=\"info\" [src]=\"info?.url\" />\n </div>\n <div class=\"action-bar\" *ngIf=\"infos\">\n <button (click)=\"goBack()\" [disabled]=\"disableBack\" mat-icon-button>\n <mat-icon>chevron_left</mat-icon>\n </button>\n <span class=\"picker-text\">\n {{paginaAtual}}/{{infos?.length}}\n </span>\n <button (click)=\"goNext()\" [disabled]=\"disableNext\" mat-icon-button>\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".image-fullsize{position:absolute;left:0;top:0;background:rgba(0,0,0,.8);width:100%;height:100%;display:flex;flex-flow:column}.titulo{color:#fff;text-align:center;padding:16px;font-size:large;font-weight:300}.action-bar{background:linear-gradient(135deg,rgba(0,0,0,.8) 0%,rgba(0,0,0,.9) 50%,rgba(0,0,0,.8) 100%);color:#fff;padding:8px}.img-container{flex-grow:1;display:flex;justify-content:center;align-items:center}.image{box-shadow:0 5px 35px #000000a6;max-width:100%;height:auto}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
119
3334
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ImageViewerComponent, decorators: [{
120
3335
  type: Component,
121
3336
  args: [{ selector: 'ox-image-viewer', template: "<div class=\"image-fullsize\" *ngIf=\"isOpen\">\n <div class=\"titulo\">\n {{info?.titulo}}\n </div>\n <div class=\"img-container\" (click)=\"isOpen = !isOpen\">\n <img class=\"image\" *ngIf=\"info\" [src]=\"info?.url\" />\n </div>\n <div class=\"action-bar\" *ngIf=\"infos\">\n <button (click)=\"goBack()\" [disabled]=\"disableBack\" mat-icon-button>\n <mat-icon>chevron_left</mat-icon>\n </button>\n <span class=\"picker-text\">\n {{paginaAtual}}/{{infos?.length}}\n </span>\n <button (click)=\"goNext()\" [disabled]=\"disableNext\" mat-icon-button>\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".image-fullsize{position:absolute;left:0;top:0;background:rgba(0,0,0,.8);width:100%;height:100%;display:flex;flex-flow:column}.titulo{color:#fff;text-align:center;padding:16px;font-size:large;font-weight:300}.action-bar{background:linear-gradient(135deg,rgba(0,0,0,.8) 0%,rgba(0,0,0,.9) 50%,rgba(0,0,0,.8) 100%);color:#fff;padding:8px}.img-container{flex-grow:1;display:flex;justify-content:center;align-items:center}.image{box-shadow:0 5px 35px #000000a6;max-width:100%;height:auto}\n"] }]
@@ -233,7 +3448,7 @@ class MonthYearPickerComponent {
233
3448
  }
234
3449
  }
235
3450
  MonthYearPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MonthYearPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
236
- MonthYearPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: MonthYearPickerComponent, selector: "ox-month-year-picker", inputs: { blockFuture: "blockFuture", modoAnual: "modoAnual", ano: "ano", mes: "mes" }, outputs: { anoChange: "anoChange", mesChange: "mesChange", changed: "changed" }, ngImport: i0, template: "<div class=\"picker-container\">\n <div>\n <button mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n </div>\n <span class=\"picker-text\">\n {{text}}\n </span>\n <div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>", styles: [".picker-container{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:250px}.picker-text{flex-flow:1;flex-grow:1;text-align:center;font-weight:700}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
3451
+ MonthYearPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: MonthYearPickerComponent, selector: "ox-month-year-picker", inputs: { blockFuture: "blockFuture", modoAnual: "modoAnual", ano: "ano", mes: "mes" }, outputs: { anoChange: "anoChange", mesChange: "mesChange", changed: "changed" }, ngImport: i0, template: "<div class=\"picker-container\">\n <div>\n <button mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n </div>\n <span class=\"picker-text\">\n {{text}}\n </span>\n <div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>", styles: [".picker-container{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:250px}.picker-text{flex-flow:1;flex-grow:1;text-align:center;font-weight:700}\n"], dependencies: [{ kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
237
3452
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MonthYearPickerComponent, decorators: [{
238
3453
  type: Component,
239
3454
  args: [{ selector: 'ox-month-year-picker', template: "<div class=\"picker-container\">\n <div>\n <button mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n </div>\n <span class=\"picker-text\">\n {{text}}\n </span>\n <div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>", styles: [".picker-container{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:250px}.picker-text{flex-flow:1;flex-grow:1;text-align:center;font-weight:700}\n"] }]
@@ -321,176 +3536,34 @@ class NumericPickerComponent {
321
3536
  this.disableBack = this.min !== undefined && this.value === this.min;
322
3537
  }
323
3538
  valida(val) {
324
- if (isNaN(val))
325
- return false;
326
- if (this.max !== undefined && val > this.max)
327
- return false;
328
- if (this.min !== undefined && val < this.min)
329
- return false;
330
- return true;
331
- }
332
- raiseChange() {
333
- this.change.emit(this.value);
334
- }
335
- }
336
- NumericPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
337
- NumericPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: NumericPickerComponent, selector: "ox-numeric-picker", inputs: { value: "value", max: "max", min: "min" }, outputs: { valueChange: "valueChange", change: "change" }, ngImport: i0, template: "<div>\n <button mat-icon-button (click)=\"goBack()\" [disabled]=\"disableBack\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n</div>\n<input [(ngModel)]=\"text\" (change)=\"onTextEdit($event)\" class=\"date\">\n<div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n</div>", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:60px}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, decorators: [{
339
- type: Component,
340
- args: [{ selector: 'ox-numeric-picker', template: "<div>\n <button mat-icon-button (click)=\"goBack()\" [disabled]=\"disableBack\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n</div>\n<input [(ngModel)]=\"text\" (change)=\"onTextEdit($event)\" class=\"date\">\n<div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n</div>", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:60px}\n"] }]
341
- }], ctorParameters: function () { return []; }, propDecorators: { valueChange: [{
342
- type: Output
343
- }], change: [{
344
- type: Output
345
- }], value: [{
346
- type: Input
347
- }], max: [{
348
- type: Input
349
- }], min: [{
350
- type: Input
351
- }] } });
352
-
353
- class PaginatorComponent {
354
- constructor() {
355
- this.paginaAtualChange = new EventEmitter();
356
- this.totalPaginasChange = new EventEmitter();
357
- this.change = new EventEmitter();
358
- this._paginaAtual = 1;
359
- this._totalPaginas = 1;
360
- this.inicio = true;
361
- this.fim = true;
362
- this.pageSize = 0;
363
- }
364
- get paginaAtual() {
365
- return this._paginaAtual;
366
- }
367
- set paginaAtual(val) {
368
- this._paginaAtual = val;
369
- this.paginaAtualChange.emit(val);
370
- this.refreshUI();
371
- }
372
- get totalPaginas() {
373
- return this._totalPaginas;
374
- }
375
- set totalPaginas(val) {
376
- this._totalPaginas = val;
377
- this.totalPaginasChange.emit(val);
378
- this.refreshUI();
379
- }
380
- ngOnInit() {
381
- }
382
- trocaPagina(pagina) {
383
- if (pagina > this.totalPaginas || pagina < 1)
384
- return;
385
- this.paginaAtual = pagina;
386
- this.refreshUI();
387
- this.change.emit(this.paginaAtual);
388
- }
389
- refreshUI() {
390
- this.inicio = this.paginaAtual == 1;
391
- this.fim = this.paginaAtual == this.totalPaginas;
392
- }
393
- goBack() {
394
- this.trocaPagina(this.paginaAtual - 1);
395
- }
396
- goNext() {
397
- this.trocaPagina(this.paginaAtual + 1);
398
- }
399
- }
400
- PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
401
- PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: PaginatorComponent, selector: "ox-paginator", inputs: { pageSize: "pageSize", paginaAtual: "paginaAtual", totalPaginas: "totalPaginas" }, outputs: { paginaAtualChange: "paginaAtualChange", totalPaginasChange: "totalPaginasChange", change: "change" }, ngImport: i0, template: "<button [disabled]=\"inicio\" mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n</button>\n<span class=\"picker-text\">\n {{paginaAtual}}/{{totalPaginas}}\n</span>\n<button [disabled]=\"fim\" mat-icon-button (click)=\"goNext()\">\n <mat-icon>chevron_right</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;flex-wrap:nowrap}.picker-text{flex-flow:1;flex-grow:1;text-align:center}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, decorators: [{
403
- type: Component,
404
- args: [{ selector: 'ox-paginator', template: "<button [disabled]=\"inicio\" mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n</button>\n<span class=\"picker-text\">\n {{paginaAtual}}/{{totalPaginas}}\n</span>\n<button [disabled]=\"fim\" mat-icon-button (click)=\"goNext()\">\n <mat-icon>chevron_right</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;flex-wrap:nowrap}.picker-text{flex-flow:1;flex-grow:1;text-align:center}\n"] }]
405
- }], ctorParameters: function () { return []; }, propDecorators: { paginaAtualChange: [{
406
- type: Output
407
- }], totalPaginasChange: [{
408
- type: Output
409
- }], change: [{
410
- type: Output
411
- }], pageSize: [{
412
- type: Input
413
- }], paginaAtual: [{
414
- type: Input
415
- }], totalPaginas: [{
416
- type: Input
417
- }] } });
418
-
419
- class RadioButtonGroupComponent {
420
- constructor() {
421
- this.change = new EventEmitter();
422
- this._items = [];
423
- //_init : boolean = false;
424
- this.selectedItem = null;
425
- }
426
- get items() {
427
- return this._items;
428
- }
429
- set items(val) {
430
- this._items = val;
431
- this.selectedItem = this.items.filter(x => x.default === true).firstOrNull();
432
- if (this.selectedItem === null)
433
- this.selectedItem = this.items.firstOrNull();
434
- }
435
- ngOnInit() {
436
- }
437
- raiseChange(item) {
438
- this.selectedItem = item;
439
- this.change.emit(this.selectedItem);
440
- }
441
- }
442
- RadioButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
443
- RadioButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: RadioButtonGroupComponent, selector: "ox-radio-button-group", inputs: { selectedItem: "selectedItem", items: "items" }, outputs: { change: "change" }, ngImport: i0, template: "<ox-check-button [radioBehavior]=\"true\" (changed)=\"raiseChange(item)\" [checked]=\"item == selectedItem\" *ngFor=\"let item of items\">\n {{item.name}}\n</ox-check-button>", styles: [":host>:first-child{border-radius:4px 0 0 4px}:host>:last-child{border-radius:0 4px 4px 0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: CheckButtonComponent, selector: "ox-check-button", inputs: ["checked", "radioBehavior"], outputs: ["changed"] }] });
444
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, decorators: [{
445
- type: Component,
446
- args: [{ selector: 'ox-radio-button-group', template: "<ox-check-button [radioBehavior]=\"true\" (changed)=\"raiseChange(item)\" [checked]=\"item == selectedItem\" *ngFor=\"let item of items\">\n {{item.name}}\n</ox-check-button>", styles: [":host>:first-child{border-radius:4px 0 0 4px}:host>:last-child{border-radius:0 4px 4px 0}\n"] }]
447
- }], ctorParameters: function () { return []; }, propDecorators: { change: [{
448
- type: Output
449
- }], selectedItem: [{
450
- type: Input
451
- }], items: [{
452
- type: Input
453
- }] } });
454
-
455
- class ItemCardComponent {
456
- constructor() { }
457
- ngOnInit() {
458
- }
459
- }
460
- ItemCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ItemCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
461
- ItemCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ItemCardComponent, selector: "ox-item-card", inputs: { nome: "nome", codigo: "codigo", star: "star", cloud: "cloud", desativado: "desativado" }, ngImport: i0, template: "<div class=\"nome-codigo-row\"><span class=\"codigo\" *ngIf=\"codigo\">{{codigo}}</span>{{nome}}</div>\n<div class=\"icons-row\">\n <span class=\"material-icons star\" *ngIf=\"star\">\n grade\n </span>\n <span class=\"material-icons desativado\" *ngIf=\"desativado === true\">\n dangerous\n </span>\n <span class=\"material-icons sync-pendente\" *ngIf=\"cloud === false\">\n cloud_queue\n </span>\n <span class=\"material-icons sync-concluido\" *ngIf=\"cloud === true\">\n cloud_done\n </span>\n</div>\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:12px 16px;background:#fff;justify-content:space-between;cursor:pointer;flex-shrink:0;align-items:center;transition:border-left-color 1s;-webkit-user-select:none;user-select:none;font-size:small}:host:hover{box-shadow:0 0 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:var(--app-color, black);z-index:1;box-shadow:0 0 8px 5px #00000008;flex-shrink:0;background:linear-gradient(45deg,var(--item-card-selected-bg, rgba(0, 0, 0, .05)),transparent)}.nome-codigo-row{display:flex;flex-direction:row;flex-grow:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right:8px}.icons-row{display:flex;flex-direction:row;align-items:center;gap:8px}.codigo{color:#666;font-size:x-small;border-radius:4px;padding:0 4px;width:50px;min-width:50px;text-align:center;border:1px solid #eee;margin-right:16px;display:flex;align-items:center;justify-content:center}.sync-pendente{color:#141212;font-size:16px}.sync-concluido{color:#dbdbdb;font-size:16px}.star{color:#000}.desativado{color:#8f07bb;font-size:16px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ItemCardComponent, decorators: [{
463
- type: Component,
464
- args: [{ selector: 'ox-item-card', template: "<div class=\"nome-codigo-row\"><span class=\"codigo\" *ngIf=\"codigo\">{{codigo}}</span>{{nome}}</div>\n<div class=\"icons-row\">\n <span class=\"material-icons star\" *ngIf=\"star\">\n grade\n </span>\n <span class=\"material-icons desativado\" *ngIf=\"desativado === true\">\n dangerous\n </span>\n <span class=\"material-icons sync-pendente\" *ngIf=\"cloud === false\">\n cloud_queue\n </span>\n <span class=\"material-icons sync-concluido\" *ngIf=\"cloud === true\">\n cloud_done\n </span>\n</div>\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:12px 16px;background:#fff;justify-content:space-between;cursor:pointer;flex-shrink:0;align-items:center;transition:border-left-color 1s;-webkit-user-select:none;user-select:none;font-size:small}:host:hover{box-shadow:0 0 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:var(--app-color, black);z-index:1;box-shadow:0 0 8px 5px #00000008;flex-shrink:0;background:linear-gradient(45deg,var(--item-card-selected-bg, rgba(0, 0, 0, .05)),transparent)}.nome-codigo-row{display:flex;flex-direction:row;flex-grow:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right:8px}.icons-row{display:flex;flex-direction:row;align-items:center;gap:8px}.codigo{color:#666;font-size:x-small;border-radius:4px;padding:0 4px;width:50px;min-width:50px;text-align:center;border:1px solid #eee;margin-right:16px;display:flex;align-items:center;justify-content:center}.sync-pendente{color:#141212;font-size:16px}.sync-concluido{color:#dbdbdb;font-size:16px}.star{color:#000}.desativado{color:#8f07bb;font-size:16px}\n"] }]
465
- }], ctorParameters: function () { return []; }, propDecorators: { nome: [{
466
- type: Input
467
- }], codigo: [{
468
- type: Input
469
- }], star: [{
470
- type: Input
471
- }], cloud: [{
472
- type: Input
473
- }], desativado: [{
474
- type: Input
475
- }] } });
476
-
477
- class AlertDialogComponent {
478
- constructor(dialogRef, args) {
479
- this.dialogRef = dialogRef;
480
- this.args = args;
3539
+ if (isNaN(val))
3540
+ return false;
3541
+ if (this.max !== undefined && val > this.max)
3542
+ return false;
3543
+ if (this.min !== undefined && val < this.min)
3544
+ return false;
3545
+ return true;
481
3546
  }
482
- ngOnInit() {
3547
+ raiseChange() {
3548
+ this.change.emit(this.value);
483
3549
  }
484
3550
  }
485
- AlertDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AlertDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
486
- AlertDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: AlertDialogComponent, selector: "app-alert-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{args.titulo}}</h1>\n<div mat-dialog-content>\n <p>{{args.msg}}</p>\n</div>\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">Cancelar</button>\n <button mat-button [mat-dialog-close]=\"true\" cdkFocusInitial>Continuar</button>\n</mat-dialog-actions>", styles: [""], dependencies: [{ kind: "component", type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
487
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AlertDialogComponent, decorators: [{
3551
+ NumericPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3552
+ NumericPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: NumericPickerComponent, selector: "ox-numeric-picker", inputs: { value: "value", max: "max", min: "min" }, outputs: { valueChange: "valueChange", change: "change" }, ngImport: i0, template: "<div>\n <button mat-icon-button (click)=\"goBack()\" [disabled]=\"disableBack\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n</div>\n<input [(ngModel)]=\"text\" (change)=\"onTextEdit($event)\" class=\"date\">\n<div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n</div>", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:60px}\n"], dependencies: [{ kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
3553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, decorators: [{
488
3554
  type: Component,
489
- args: [{ selector: 'app-alert-dialog', template: "<h1 mat-dialog-title>{{args.titulo}}</h1>\n<div mat-dialog-content>\n <p>{{args.msg}}</p>\n</div>\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">Cancelar</button>\n <button mat-button [mat-dialog-close]=\"true\" cdkFocusInitial>Continuar</button>\n</mat-dialog-actions>" }]
490
- }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
491
- type: Inject,
492
- args: [MAT_DIALOG_DATA]
493
- }] }]; } });
3555
+ args: [{ selector: 'ox-numeric-picker', template: "<div>\n <button mat-icon-button (click)=\"goBack()\" [disabled]=\"disableBack\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n</div>\n<input [(ngModel)]=\"text\" (change)=\"onTextEdit($event)\" class=\"date\">\n<div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n</div>", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:60px}\n"] }]
3556
+ }], ctorParameters: function () { return []; }, propDecorators: { valueChange: [{
3557
+ type: Output
3558
+ }], change: [{
3559
+ type: Output
3560
+ }], value: [{
3561
+ type: Input
3562
+ }], max: [{
3563
+ type: Input
3564
+ }], min: [{
3565
+ type: Input
3566
+ }] } });
494
3567
 
495
3568
  class SafeHtmlPipe {
496
3569
  constructor(sanitizer) {
@@ -500,15 +3573,22 @@ class SafeHtmlPipe {
500
3573
  return this.sanitizer.bypassSecurityTrustHtml(html);
501
3574
  }
502
3575
  }
503
- SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
3576
+ SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
504
3577
  SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
505
3578
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, decorators: [{
506
3579
  type: Pipe,
507
3580
  args: [{
508
3581
  name: 'safeHtml'
509
3582
  }]
510
- }], ctorParameters: function () { return [{ type: i1$3.DomSanitizer }]; } });
3583
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
511
3584
 
3585
+ Array.prototype.remove = function (item) {
3586
+ const index = this.indexOf(item);
3587
+ if (index === -1)
3588
+ return false;
3589
+ this.splice(index, 1);
3590
+ return true;
3591
+ };
512
3592
  Array.prototype.firstOrNull = function () {
513
3593
  if (this.length > 0)
514
3594
  return this[0];
@@ -531,12 +3611,38 @@ OxpiNglibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
531
3611
  RadioButtonGroupComponent,
532
3612
  ItemCardComponent,
533
3613
  SafeHtmlPipe,
534
- AlertDialogComponent], imports: [BrowserModule,
3614
+ AlertDialogComponent,
3615
+ FuncionariosComponent,
3616
+ FuncionarioFormComponent,
3617
+ FuncionarioEditDialogComponent,
3618
+ FuncionarioAddDialogComponent,
3619
+ ProdutosComponent,
3620
+ ProdutoFormComponent,
3621
+ ProdutoAddDialogComponent,
3622
+ ProdutoBuscaFiltrosDialogComponent,
3623
+ ProdutoEditDialogComponent,
3624
+ ProdutosGruposComponent,
3625
+ MoverGrupoDialogComponent,
3626
+ ProdutoGrupoSelecaoDialogComponent,
3627
+ ProdutoGrupoAddDialogComponent,
3628
+ ProdutoGrupoEditDialogComponent,
3629
+ ProdutoGrupoFormComponent,
3630
+ ProdutosNcmDialogComponent,
3631
+ ProdutosSubgruposComponent,
3632
+ ProdutoSubgrupoSelecaoDialogComponent,
3633
+ ProdutoSubgrupoAddDialogComponent,
3634
+ ProdutoSubgrupoEditDialogComponent,
3635
+ ProdutosCategoriasCardapioComponent,
3636
+ ProdutoCategoriaCardapioAddDialogComponent,
3637
+ ProdutoCategoriaCardapioEditDialogComponent,
3638
+ ProdutoCategoriaCardapioSelecaoDialogComponent], imports: [BrowserModule,
535
3639
  BrowserAnimationsModule,
536
3640
  FormsModule,
537
3641
  MatButtonModule,
538
3642
  MatIconModule,
539
- MatDialogModule], exports: [BusyIndicatorComponent,
3643
+ MatDialogModule,
3644
+ MatSelectModule,
3645
+ MatAutocompleteModule], exports: [BusyIndicatorComponent,
540
3646
  MonthYearPickerComponent,
541
3647
  ImageViewerComponent,
542
3648
  NumericPickerComponent,
@@ -550,7 +3656,9 @@ OxpiNglibModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
550
3656
  FormsModule,
551
3657
  MatButtonModule,
552
3658
  MatIconModule,
553
- MatDialogModule] });
3659
+ MatDialogModule,
3660
+ MatSelectModule,
3661
+ MatAutocompleteModule] });
554
3662
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: OxpiNglibModule, decorators: [{
555
3663
  type: NgModule,
556
3664
  args: [{
@@ -564,7 +3672,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
564
3672
  RadioButtonGroupComponent,
565
3673
  ItemCardComponent,
566
3674
  SafeHtmlPipe,
567
- AlertDialogComponent
3675
+ AlertDialogComponent,
3676
+ FuncionariosComponent,
3677
+ FuncionarioFormComponent,
3678
+ FuncionarioEditDialogComponent,
3679
+ FuncionarioAddDialogComponent,
3680
+ ProdutosComponent,
3681
+ ProdutoFormComponent,
3682
+ ProdutoAddDialogComponent,
3683
+ ProdutoBuscaFiltrosDialogComponent,
3684
+ ProdutoEditDialogComponent,
3685
+ ProdutosGruposComponent,
3686
+ MoverGrupoDialogComponent,
3687
+ ProdutoGrupoSelecaoDialogComponent,
3688
+ ProdutoGrupoAddDialogComponent,
3689
+ ProdutoGrupoEditDialogComponent,
3690
+ ProdutoGrupoFormComponent,
3691
+ ProdutosNcmDialogComponent,
3692
+ ProdutosSubgruposComponent,
3693
+ ProdutoSubgrupoSelecaoDialogComponent,
3694
+ ProdutoSubgrupoAddDialogComponent,
3695
+ ProdutoSubgrupoEditDialogComponent,
3696
+ ProdutosCategoriasCardapioComponent,
3697
+ ProdutoCategoriaCardapioAddDialogComponent,
3698
+ ProdutoCategoriaCardapioEditDialogComponent,
3699
+ ProdutoCategoriaCardapioSelecaoDialogComponent
568
3700
  ],
569
3701
  imports: [
570
3702
  BrowserModule,
@@ -573,6 +3705,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
573
3705
  MatButtonModule,
574
3706
  MatIconModule,
575
3707
  MatDialogModule,
3708
+ MatSelectModule,
3709
+ MatAutocompleteModule,
576
3710
  ],
577
3711
  exports: [
578
3712
  BusyIndicatorComponent,
@@ -593,279 +3727,50 @@ class BusyState {
593
3727
  this.isBusy = false;
594
3728
  this.counter = 0;
595
3729
  }
596
- show() {
597
- this.counter++;
598
- this.isBusy = true;
599
- }
600
- hide() {
601
- this.counter--;
602
- if (this.counter < 0)
603
- this.counter = 0;
604
- if (this.counter == 0)
605
- this.isBusy = false;
606
- }
607
- }
608
-
609
- class LazyTrigger {
610
- constructor(doFunc, timeout = 800) {
611
- this.doFunc = doFunc;
612
- this.timeout = timeout;
613
- }
614
- fire() {
615
- console.debug("lazyTimeoutId");
616
- if (this.lazyTimeoutId != undefined)
617
- clearTimeout(this.lazyTimeoutId);
618
- this.lazyTimeoutId = window.setTimeout(() => { this.doFunc(); }, this.timeout);
619
- }
620
- }
621
-
622
- class NumberParser {
623
- constructor(setPropFunc, getPropFunc, min, max, triggerMilliseconds = 1500) {
624
- this.setPropFunc = setPropFunc;
625
- this.getPropFunc = getPropFunc;
626
- this.min = min;
627
- this.max = max;
628
- this.parsed = false;
629
- this._parseTrigger = new LazyTrigger(() => this.parseValor(), triggerMilliseconds);
630
- }
631
- parse(vlr) {
632
- this.valor = vlr;
633
- this.parsed = false;
634
- this._parseTrigger.fire();
635
- }
636
- store(vlr) {
637
- this.valor = vlr;
638
- this.parsed = false;
639
- }
640
- checkout() {
641
- if (this.parsed || !this.valor)
642
- return;
643
- this.parseValor();
644
- }
645
- parseValor() {
646
- if (this.valor === undefined)
647
- return;
648
- this.parsed = true;
649
- const vlrTxt = this.valor.split(",").join(".");
650
- ;
651
- const spTxt = vlrTxt.split(".");
652
- let toParseTxt = "";
653
- if (spTxt.length > 2) {
654
- const chars = vlrTxt.split("");
655
- const lastIndex = vlrTxt.lastIndexOf(".");
656
- for (let i = 0; i < chars.length; i++) {
657
- const c = chars[i];
658
- if (c === "." && i != lastIndex)
659
- continue;
660
- toParseTxt = toParseTxt.concat(c);
661
- }
662
- }
663
- else {
664
- toParseTxt = vlrTxt;
665
- }
666
- const vlr = parseFloat(toParseTxt);
667
- if (isNaN(vlr) || !this.validaMinMax(vlr)) {
668
- const original = this.getPropFunc();
669
- this.setPropFunc(0);
670
- setTimeout(() => this.setPropFunc(original));
671
- }
672
- else {
673
- this.setPropFunc(vlr);
674
- }
675
- }
676
- validaMinMax(value) {
677
- if ((this.min === undefined) && this.max === undefined)
678
- return true;
679
- if (!(this.min === undefined) && value < this.min)
680
- return false;
681
- if (!(this.max === undefined) && value > this.max)
682
- return false;
683
- return true;
684
- }
685
- }
686
-
687
- class Ordem {
688
- constructor(ordens, isCrescente, onToggle) {
689
- const d = ordens.filter(x => x.default === true).firstOrNull();
690
- this.colName = d === null ? ordens[0].value : d.value;
691
- this.isCrescente = isCrescente;
692
- this.onToggle = onToggle;
693
- }
694
- toggle() {
695
- this.isCrescente = !this.isCrescente;
696
- if (this.onToggle !== undefined)
697
- this.onToggle();
698
- }
699
- toString() {
700
- return this.colName + (!this.isCrescente ? " desc" : "");
701
- }
702
- }
703
-
704
- function printTxt(txt) {
705
- const r = "<!doctype html><head><meta charset=\"utf-8\"></head><body><div style='font-family: \"Courier New\", Courier, monospace; white-space: pre-wrap;color: black;font-weight: bold;word-wrap: break-word;word-break: break-all;overflow-wrap: break-word;'>" + txt + '</div></body>';
706
- printHtml(r);
707
- }
708
- function printHtml(r) {
709
- const blob = new Blob([r], { type: 'text/html' });
710
- const url = window.URL.createObjectURL(blob);
711
- const w = window.open(url, '_blank');
712
- if (w != null)
713
- w.print();
714
- }
715
- function selectText(ev) {
716
- ev.target.select();
717
- }
718
-
719
- function valTextEmpty(v) {
720
- return v === null ||
721
- v === undefined ||
722
- v.trim() === '';
723
- }
724
- function valNumberEmpty(v) {
725
- return v === null ||
726
- v === undefined ||
727
- v === 0;
728
- }
729
- function valTextMax(v, max) {
730
- return v.length > max;
731
- }
732
- function valNumberMin(v, min) {
733
- if (v === null || v === undefined)
734
- return true;
735
- return v <= min;
736
- }
737
-
738
- class NavegacaoSelecaoDialogUtil {
739
- constructor(view) {
740
- this.view = view;
741
- }
742
- onKeyDown(event) {
743
- console.info(event.keyCode);
744
- let key = event.keyCode;
745
- const selected = this.view.selectedItem;
746
- const enterKey = 13, keyDown = 40, keyUp = 38;
747
- if (key === enterKey) {
748
- event.cancelBubble = true;
749
- if (selected !== null && selected !== undefined) {
750
- this.view.dialogRef.close(selected);
751
- return;
752
- }
753
- key = keyDown;
754
- }
755
- if (key !== keyDown && key !== keyUp)
756
- return;
757
- let index = this.view.items.indexOf(selected, 0);
758
- if (key === keyDown)
759
- index++;
760
- if (key === keyUp && index > 0)
761
- index--;
762
- if (index > (this.view.items.length - 1))
763
- return;
764
- this.view.selectedItem = this.view.items[index];
765
- }
766
- }
767
- function confirmaExclusao(dialog, msg, continueFunc) {
768
- const args = {
769
- titulo: "Atenção",
770
- msg: msg
771
- };
772
- const dialogRef = dialog.open(AlertDialogComponent, {
773
- data: args
774
- });
775
- dialogRef.afterClosed().subscribe(dialogResult => {
776
- if (dialogResult !== true)
777
- return;
778
- continueFunc();
779
- });
780
- }
781
-
782
- const fadeAnimation = trigger('fade', [
783
- transition(':enter', [
784
- style({ transform: 'translateY(100%)', opacity: 0 }),
785
- animate('250ms', style({ transform: 'translateY(0)', 'opacity': 1 }))
786
- ]),
787
- transition(':leave', [
788
- style({ transform: 'translateY(0)', 'opacity': 1 }),
789
- animate('250ms', style({ transform: 'translateY(100%)', 'opacity': 0 })),
790
- ])
791
- ]);
792
- const menuLateralAnimation = trigger('menuLateral', [
793
- transition(':enter', [
794
- style({ transform: 'translateX(-100%)', opacity: 1 }),
795
- animate('200ms', style({ transform: 'translateX(0)', 'opacity': 1 }))
796
- ]),
797
- transition(':leave', [
798
- style({ 'opacity': 1 }),
799
- animate('200ms', style({ 'opacity': 0 })),
800
- ])
801
- ]);
802
-
803
- class SearchSetting {
804
- constructor(propChanged) {
805
- this.propChanged = propChanged;
806
- this._meses = ["JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO"];
807
- this._mesesShort = ["JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT", "NOV", "DEZ"];
808
- const now = new Date();
809
- const hj = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
810
- console.info(hj);
811
- this.modo = SearchMode.Mensal;
812
- this.mes = hj.getMonth() + 1;
813
- this.ano = hj.getFullYear();
814
- this.inicial = hj.addDays(-30);
815
- this.final = hj;
816
- }
817
- set(prop, value) {
818
- const me = this;
819
- me[prop] = value;
820
- if (this.propChanged !== undefined)
821
- this.propChanged();
822
- }
823
- toStringArquivo() {
824
- const ini = this.inicial;
825
- const fim = this.final;
826
- if (this.modo === SearchMode.Mensal)
827
- return this.ano + "_" + this.mes;
828
- if (this.modo === SearchMode.Anual)
829
- return "" + this.ano;
830
- if (this.modo === SearchMode.Diario)
831
- return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}`;
832
- return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}_ate_${fim.getDate()}_${fim.getMonth() + 1}_${fim.getFullYear()}`;
3730
+ show() {
3731
+ this.counter++;
3732
+ this.isBusy = true;
833
3733
  }
834
- getDatasTexto(short = false) {
835
- const ini = this.inicial;
836
- const fim = this.final;
837
- if (this.modo === SearchMode.Mensal && short)
838
- return this._mesesShort[this.mes - 1] + " DE " + this.ano;
839
- if (this.modo === SearchMode.Mensal)
840
- return this._meses[this.mes - 1] + " DE " + this.ano;
841
- if (this.modo === SearchMode.Anual)
842
- return "" + this.ano;
843
- if (this.modo === SearchMode.Diario)
844
- return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()}`;
845
- return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()} ATÉ ${fim.getDate()}/${fim.getMonth() + 1}/${fim.getFullYear()}`;
3734
+ hide() {
3735
+ this.counter--;
3736
+ if (this.counter < 0)
3737
+ this.counter = 0;
3738
+ if (this.counter == 0)
3739
+ this.isBusy = false;
846
3740
  }
847
- goNextMonth() {
848
- this.mes++;
849
- if (this.mes > 12) {
850
- this.mes = 1;
851
- this.ano += 1;
852
- }
3741
+ }
3742
+
3743
+ class Ordem {
3744
+ constructor(ordens, isCrescente, onToggle) {
3745
+ const d = ordens.filter(x => x.default === true).firstOrNull();
3746
+ this.colName = d === null ? ordens[0].value : d.value;
3747
+ this.isCrescente = isCrescente;
3748
+ this.onToggle = onToggle;
853
3749
  }
854
- goBackMonth() {
855
- this.mes--;
856
- if (this.mes < 1) {
857
- this.mes = 12;
858
- this.ano -= 1;
859
- }
3750
+ toggle() {
3751
+ this.isCrescente = !this.isCrescente;
3752
+ if (this.onToggle !== undefined)
3753
+ this.onToggle();
3754
+ }
3755
+ toString() {
3756
+ return this.colName + (!this.isCrescente ? " desc" : "");
860
3757
  }
3758
+ }
3759
+
3760
+ function printTxt(txt) {
3761
+ const r = "<!doctype html><head><meta charset=\"utf-8\"></head><body><div style='font-family: \"Courier New\", Courier, monospace; white-space: pre-wrap;color: black;font-weight: bold;word-wrap: break-word;word-break: break-all;overflow-wrap: break-word;'>" + txt + '</div></body>';
3762
+ printHtml(r);
861
3763
  }
862
- var SearchMode;
863
- (function (SearchMode) {
864
- SearchMode[SearchMode["Mensal"] = 0] = "Mensal";
865
- SearchMode[SearchMode["Anual"] = 1] = "Anual";
866
- SearchMode[SearchMode["Periodo"] = 2] = "Periodo";
867
- SearchMode[SearchMode["Diario"] = 3] = "Diario";
868
- })(SearchMode || (SearchMode = {}));
3764
+ function printHtml(r) {
3765
+ const blob = new Blob([r], { type: 'text/html' });
3766
+ const url = window.URL.createObjectURL(blob);
3767
+ const w = window.open(url, '_blank');
3768
+ if (w != null)
3769
+ w.print();
3770
+ }
3771
+ function selectText(ev) {
3772
+ ev.target.select();
3773
+ }
869
3774
 
870
3775
  class PagamentoRecebimentoSearchSetting extends SearchSetting {
871
3776
  constructor() {
@@ -938,17 +3843,6 @@ class DuplicataSearchSetting extends SearchSetting {
938
3843
  }
939
3844
  }
940
3845
 
941
- class ProdutoSearchSetting extends SearchSetting {
942
- constructor() {
943
- super();
944
- this.exibeNaoControladoEstoque = true;
945
- this.exibeApenasMostraRecepcao = false;
946
- this.exibeInativo = false;
947
- this.exibeImprimiCozinha = false;
948
- this.exibeHePrato = false;
949
- }
950
- }
951
-
952
3846
  class SuitesIntervencoesSetting extends SearchSetting {
953
3847
  }
954
3848
 
@@ -977,76 +3871,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
977
3871
  }]
978
3872
  }], ctorParameters: function () { return []; } });
979
3873
 
980
- class FocusService {
981
- constructor() {
982
- }
983
- hasInit() {
984
- return this._element !== undefined;
985
- }
986
- registerElementById(name) {
987
- this.registerElement(document.getElementById(name));
988
- }
989
- registerElement(element) {
990
- if (element === null || element === undefined)
991
- return;
992
- this._element = element;
993
- //this._items = this.getItems();
994
- console.info(element);
995
- element.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
996
- }
997
- registerWindow() {
998
- this._element = null;
999
- //this._items = this.getItems();
1000
- window.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
1001
- }
1002
- unregisterElementById(name) {
1003
- this.unregisterElement(document.getElementById(name));
1004
- }
1005
- unregisterElement(element) {
1006
- if (element === null || element === undefined)
1007
- return;
1008
- element.removeEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
1009
- }
1010
- handleKeyboardEvent(event) {
1011
- if (event.keyCode !== 13)
1012
- return;
1013
- if (event.target.nodeName === "BUTTON")
1014
- return;
1015
- const items = this.getItems();
1016
- const index = Array.prototype.indexOf.call(items, event.target);
1017
- const nextIndex = index + 1;
1018
- if (nextIndex > items.length - 1)
1019
- return;
1020
- const i = items[index + 1];
1021
- if (i.tabIndex > -1)
1022
- i.focus();
1023
- event.preventDefault();
1024
- }
1025
- setFirst() {
1026
- const el = this.getItems()[0]; //[0];
1027
- if (el !== undefined)
1028
- el.focus();
1029
- }
1030
- getItems() {
1031
- const query = this._element !== null && this._element !== undefined ?
1032
- this._element.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])') :
1033
- document.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])');
1034
- const items = [];
1035
- for (let index = 0; index < query.length; index++) {
1036
- const el = query[index];
1037
- if (el.tabIndex > 0)
1038
- items.push(el);
1039
- }
1040
- return items;
1041
- }
1042
- set(id) {
1043
- const el = document.getElementById(id);
1044
- if (el === null)
1045
- return;
1046
- el.focus();
1047
- }
1048
- }
1049
-
1050
3874
  class Preferences {
1051
3875
  constructor() {
1052
3876
  }
@@ -1087,101 +3911,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
1087
3911
  }]
1088
3912
  }], ctorParameters: function () { return []; } });
1089
3913
 
1090
- const SM_WIDTH = 576;
1091
- const MD_WIDTH = 768;
1092
- const LG_WIDTH = 992;
1093
- const XL_WIDTH = 1200;
1094
- const XXL_WIDTH = 1400;
1095
- class ScreenHelperService {
1096
- constructor() {
1097
- this.changedMobileScreen = new EventEmitter();
1098
- this.changedMediumScreen = new EventEmitter();
1099
- this.changedLargeScreen = new EventEmitter();
1100
- this.changedXLargeScreen = new EventEmitter();
1101
- this.changedXXLargeScreen = new EventEmitter();
1102
- this.changedMinSmallScreen = new EventEmitter();
1103
- this.changedMinMediumScreen = new EventEmitter();
1104
- this.changedMinLargeScreen = new EventEmitter();
1105
- this.changedMinXLargeScreen = new EventEmitter();
1106
- this.changedMinXXLargeScreen = new EventEmitter();
1107
- this.mobileScreen = false;
1108
- this.isMedium = false;
1109
- this.isLarge = false;
1110
- this.isXLarge = false;
1111
- this.isXXLarge = false;
1112
- this.minSmall = false;
1113
- this.minMedium = false;
1114
- this.minLarge = false;
1115
- this.minXLarge = false;
1116
- this.minXXLarge = false;
1117
- this.determinaMobileScreen();
1118
- window.addEventListener('resize', (event) => {
1119
- this.determinaMobileScreen();
1120
- });
1121
- }
1122
- determinaMobileScreen() {
1123
- const width = window.innerWidth;
1124
- const isSmall = width <= SM_WIDTH;
1125
- const isMedium = width <= MD_WIDTH;
1126
- const isLarge = width <= LG_WIDTH;
1127
- const isXLarge = width <= XL_WIDTH;
1128
- const isXXLarge = width <= XXL_WIDTH;
1129
- const minSmall = width >= SM_WIDTH;
1130
- const minMedium = width >= MD_WIDTH;
1131
- const minLarge = width >= LG_WIDTH;
1132
- const minXLarge = width >= XL_WIDTH;
1133
- const minXXLarge = width >= XXL_WIDTH;
1134
- if (isSmall !== this.mobileScreen) {
1135
- this.changedMobileScreen.emit(isSmall);
1136
- this.mobileScreen = isSmall;
1137
- }
1138
- if (isMedium !== this.isMedium) {
1139
- this.changedMediumScreen.emit(isMedium);
1140
- this.isMedium = isMedium;
1141
- }
1142
- if (isLarge !== this.isLarge) {
1143
- this.changedLargeScreen.emit(isLarge);
1144
- this.isLarge = isLarge;
1145
- }
1146
- if (isXLarge !== this.isXLarge) {
1147
- this.changedXLargeScreen.emit(isXLarge);
1148
- this.isXLarge = isXLarge;
1149
- }
1150
- if (isXXLarge !== this.isXXLarge) {
1151
- this.changedXXLargeScreen.emit(isXXLarge);
1152
- this.isXXLarge = isXXLarge;
1153
- }
1154
- if (minSmall !== this.minSmall) {
1155
- this.changedMinSmallScreen.emit(isSmall);
1156
- this.minMedium = isSmall;
1157
- }
1158
- if (minMedium !== this.minMedium) {
1159
- this.changedMinMediumScreen.emit(isMedium);
1160
- this.minMedium = isMedium;
1161
- }
1162
- if (minLarge !== this.minLarge) {
1163
- this.changedMinLargeScreen.emit(minLarge);
1164
- this.minLarge = minLarge;
1165
- }
1166
- if (minXLarge !== this.minXLarge) {
1167
- this.changedMinXLargeScreen.emit(minXLarge);
1168
- this.minXLarge = minXLarge;
1169
- }
1170
- if (minXXLarge !== this.minXXLarge) {
1171
- this.changedMinXXLargeScreen.emit(minXXLarge);
1172
- this.minXXLarge = minXXLarge;
1173
- }
1174
- }
1175
- }
1176
- ScreenHelperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1177
- ScreenHelperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, providedIn: 'root' });
1178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, decorators: [{
1179
- type: Injectable,
1180
- args: [{
1181
- providedIn: 'root'
1182
- }]
1183
- }], ctorParameters: function () { return []; } });
1184
-
1185
3914
  /*
1186
3915
  * Public API Surface of oxpi-nglib
1187
3916
  */
@@ -1190,5 +3919,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
1190
3919
  * Generated bundle index. Do not edit.
1191
3920
  */
1192
3921
 
1193
- export { AlertDialogComponent, BusyIndicatorComponent, BusyState, CheckButtonComponent, ConsumoProdutoSearchSetting, DuplicataSearchSetting, ExportFileService, FocusService, ImageViewerComponent, ItemCardComponent, LazyTrigger, MonthYearPickerComponent, NavegacaoSelecaoDialogUtil, NumberParser, NumericPickerComponent, OcupacaoFilterSetting, OcupacaoSearchDateField, OcupacaoSearchSetting, OcupacaoSearchTipoEntrada, Ordem, OxpiNglibModule, PagamentoRecebimentoSearchSetting, PaginatorComponent, PorOcupacaoTipo, Preferences, ProdutoSearchSetting, RadioButtonGroupComponent, SafeHtmlPipe, ScreenHelperService, SearchMode, SearchSetting, SuitesIntervencoesSetting, confirmaExclusao, fadeAnimation, menuLateralAnimation, printHtml, printTxt, selectText, valNumberEmpty, valNumberMin, valTextEmpty, valTextMax };
3922
+ export { AlertDialogComponent, AuthDataService, BusyIndicatorComponent, BusyState, CheckButtonComponent, CommonWebService, ConsumoProdutoSearchSetting, DuplicataSearchSetting, ExportFileService, FocusService, FuncionarioAddDialogComponent, FuncionarioEditDialogComponent, FuncionarioFormComponent, FuncionariosComponent, ImageViewerComponent, ItemCardComponent, LazyTrigger, MonthYearPickerComponent, MoverGrupoDialogComponent, NavegacaoSelecaoDialogUtil, NotificationService, NumberParser, NumericPickerComponent, OcupacaoFilterSetting, OcupacaoSearchDateField, OcupacaoSearchSetting, OcupacaoSearchTipoEntrada, Ordem, OxpiNglibModule, PagamentoRecebimentoSearchSetting, PaginatorComponent, PorOcupacaoTipo, Preferences, ProdutoAddDialogComponent, ProdutoBuscaFiltrosDialogComponent, ProdutoCategoriaCardapioAddDialogComponent, ProdutoCategoriaCardapioEditDialogComponent, ProdutoCategoriaCardapioSelecaoDialogComponent, ProdutoEditDialogComponent, ProdutoFormComponent, ProdutoGrupoAddDialogComponent, ProdutoGrupoEditDialogComponent, ProdutoGrupoFormComponent, ProdutoGrupoSelecaoDialogComponent, ProdutoSearchSetting, ProdutoSubgrupoAddDialogComponent, ProdutoSubgrupoEditDialogComponent, ProdutosCategoriasCardapioComponent, ProdutosComponent, ProdutosGruposComponent, ProdutosNcmDialogComponent, ProdutosSubgruposComponent, RadioButtonGroupComponent, SafeHtmlPipe, ScreenHelperService, SearchMode, SearchSetting, SuitesIntervencoesSetting, confirmaExclusao, createProduct, fadeAnimation, lateralAnimation, menuLateralAnimation, printHtml, printTxt, selectText, valNumberEmpty, valNumberMin, valTextEmpty, valTextMax, validaProduto, validaProdutoGrupo };
1194
3923
  //# sourceMappingURL=oxpi-nglib.mjs.map