oxpi-nglib 1.0.2 → 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 (23) hide show
  1. package/esm2020/lib/cadastros/produtos/produto-add-dialog/produto-add-dialog.component.mjs +3 -3
  2. package/esm2020/lib/cadastros/produtos/produto-edit-dialog/produto-edit-dialog.component.mjs +3 -3
  3. package/esm2020/lib/cadastros/produtos/produtos/produtos.component.mjs +3 -3
  4. package/esm2020/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-add-dialog/produto-categoria-cardapio-add-dialog.component.mjs +3 -3
  5. package/esm2020/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-edit-dialog/produto-categoria-cardapio-edit-dialog.component.mjs +3 -3
  6. package/esm2020/lib/cadastros/produtos-categoria-cardapio/produtos-categorias-cardapio/produtos-categorias-cardapio.component.mjs +3 -3
  7. package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-add-dialog/produto-grupo-add-dialog.component.mjs +3 -3
  8. package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-edit-dialog/produto-grupo-edit-dialog.component.mjs +3 -3
  9. package/esm2020/lib/cadastros/produtos-grupos/produtos-grupos/produtos-grupos.component.mjs +3 -3
  10. package/esm2020/lib/cadastros/produtos-subgrupos/produto-subgrupo-add-dialog/produto-subgrupo-add-dialog.component.mjs +3 -3
  11. package/esm2020/lib/cadastros/produtos-subgrupos/produto-subgrupo-edit-dialog/produto-subgrupo-edit-dialog.component.mjs +3 -3
  12. package/esm2020/lib/cadastros/produtos-subgrupos/produtos-subgrupos/produtos-subgrupos.component.mjs +3 -3
  13. package/esm2020/lib/models/entidades/produto-grupo.mjs +2 -2
  14. package/esm2020/lib/models/entidades/produto.mjs +2 -2
  15. package/esm2020/public-api.mjs +25 -1
  16. package/fesm2015/oxpi-nglib.mjs +1224 -1224
  17. package/fesm2015/oxpi-nglib.mjs.map +1 -1
  18. package/fesm2020/oxpi-nglib.mjs +1193 -1193
  19. package/fesm2020/oxpi-nglib.mjs.map +1 -1
  20. package/lib/models/entidades/produto-grupo.d.ts +1 -1
  21. package/lib/models/entidades/produto.d.ts +1 -1
  22. package/package.json +1 -1
  23. package/public-api.d.ts +24 -0
@@ -17,11 +17,11 @@ import * as i4 from '@angular/material/select';
17
17
  import { MatSelectModule } from '@angular/material/select';
18
18
  import * as i5 from '@angular/material/core';
19
19
  import { trigger, transition, style, animate } from '@angular/animations';
20
+ import * as i12 from '@angular/material/autocomplete';
21
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
20
22
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
21
23
  import * as i1$2 from '@angular/platform-browser';
22
24
  import { BrowserModule } from '@angular/platform-browser';
23
- import * as i12 from '@angular/material/autocomplete';
24
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
25
25
  import * as FileSaver from 'file-saver';
26
26
 
27
27
  function valTextEmpty(v) {
@@ -43,7 +43,7 @@ function valNumberMin(v, min) {
43
43
  return v <= min;
44
44
  }
45
45
 
46
- function valida$2(item, focus) {
46
+ function valida(item, focus) {
47
47
  if (valTextEmpty(item.nome)) {
48
48
  focus.set('nome');
49
49
  return 'Digite um nome válido.';
@@ -538,7 +538,7 @@ class FuncionarioAddDialogComponent {
538
538
  salvar() {
539
539
  if (this.model)
540
540
  return;
541
- const valMsg = valida$2(this.model, this.focus);
541
+ const valMsg = valida(this.model, this.focus);
542
542
  if (valMsg) {
543
543
  this.notification.showMsgError(valMsg);
544
544
  return;
@@ -592,7 +592,7 @@ class FuncionarioEditDialogComponent {
592
592
  salvar() {
593
593
  if (!this.model)
594
594
  return;
595
- const valMsg = valida$2(this.model, this.focus);
595
+ const valMsg = valida(this.model, this.focus);
596
596
  if (valMsg) {
597
597
  this.notification.showMsgError(valMsg);
598
598
  return;
@@ -1136,7 +1136,7 @@ class FuncionariosComponent {
1136
1136
  const item = this.selectedItem;
1137
1137
  if (!item)
1138
1138
  return;
1139
- const valMsg = valida$2(item, this.focus);
1139
+ const valMsg = valida(item, this.focus);
1140
1140
  if (valMsg) {
1141
1141
  this.notification.showMsgError(valMsg);
1142
1142
  return;
@@ -1159,926 +1159,477 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
1159
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
1160
  }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
1161
1161
 
1162
- class CheckButtonComponent {
1163
- constructor() {
1164
- this.checked = false;
1165
- this.radioBehavior = false;
1166
- this.changed = new EventEmitter();
1167
- this.checked = true;
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.';
1168
1245
  }
1169
- ngOnInit() {
1246
+ if (valNumberEmpty(item.grupoId)) {
1247
+ return 'Escolha um grupo de produto.';
1170
1248
  }
1171
- onClick(e) {
1172
- if (!this.radioBehavior)
1173
- this.checked = !this.checked;
1174
- this.changed.emit(this.checked);
1249
+ if (valNumberEmpty(item.subgrupoId)) {
1250
+ return 'Escolha um subgrupo de produto.';
1175
1251
  }
1176
- }
1177
- CheckButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CheckButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1178
- 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"] });
1179
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CheckButtonComponent, decorators: [{
1180
- type: Component,
1181
- args: [{ selector: 'ox-check-button', host: {
1182
- '[class.checked]': "checked",
1183
- }, 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"] }]
1184
- }], ctorParameters: function () { return []; }, propDecorators: { checked: [{
1185
- type: Input
1186
- }], radioBehavior: [{
1187
- type: Input
1188
- }], changed: [{
1189
- type: Output
1190
- }], onClick: [{
1191
- type: HostListener,
1192
- args: ['click', ['$event']]
1193
- }] } });
1194
-
1195
- class ImageViewerComponent {
1196
- constructor() {
1197
- this.infos = [];
1198
- this._isOpen = false;
1199
- this.paginaAtual = 0;
1200
- this.disableBack = false;
1201
- this.disableNext = false;
1202
- this.isOpenChange = new EventEmitter();
1252
+ if (valTextEmpty(item.unidade)) {
1253
+ focus.set('unidade');
1254
+ return 'Digite uma unidade.';
1203
1255
  }
1204
- get isOpen() {
1205
- return this._isOpen;
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
+ }
1206
1263
  }
1207
- set isOpen(val) {
1208
- this._isOpen = val;
1209
- this.isOpenChange.emit(val);
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);
1210
1275
  }
1211
- onClick(e) {
1212
- //this.isOpen = !this.isOpen;
1276
+ parse(vlr) {
1277
+ this.valor = vlr;
1278
+ this.parsed = false;
1279
+ this._parseTrigger.fire();
1213
1280
  }
1214
- ngOnInit() {
1281
+ store(vlr) {
1282
+ this.valor = vlr;
1283
+ this.parsed = false;
1215
1284
  }
1216
- open(info, infos) {
1217
- if (infos !== undefined) {
1218
- for (let i = 0; i < infos.length; i++) {
1219
- if (infos[i] === info) {
1220
- this.paginaAtual = i + 1;
1221
- break;
1222
- }
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);
1223
1306
  }
1224
1307
  }
1225
- this.info = info;
1226
- this.infos = infos;
1227
- this.isOpen = true;
1228
- this.updateUI();
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
+ }
1229
1320
  }
1230
- goNext() {
1231
- this.paginaAtual += 1;
1232
- this.info = this.infos[this.paginaAtual - 1];
1233
- this.updateUI();
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;
1234
1329
  }
1235
- goBack() {
1236
- this.paginaAtual -= 1;
1237
- this.info = this.infos[this.paginaAtual - 1];
1238
- this.updateUI();
1330
+ }
1331
+
1332
+ function validaProdutoGrupo(item, focus) {
1333
+ if (valTextEmpty(item.nome)) {
1334
+ focus.set('nome');
1335
+ return 'Digite um nome válido.';
1239
1336
  }
1240
- updateUI() {
1241
- this.disableBack = this.paginaAtual == 1;
1242
- this.disableNext = this.paginaAtual == this.infos.length;
1337
+ return null;
1338
+ }
1339
+
1340
+ class ProdutoGrupoFormComponent {
1341
+ constructor() { }
1342
+ ngOnInit() {
1243
1343
  }
1244
1344
  }
1245
- ImageViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ImageViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1246
- 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"] }] });
1247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ImageViewerComponent, decorators: [{
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: [{
1248
1348
  type: Component,
1249
- 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"] }]
1250
- }], ctorParameters: function () { return []; }, propDecorators: { info: [{
1251
- type: Input
1252
- }], infos: [{
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: [{
1253
1351
  type: Input
1254
- }], isOpenChange: [{
1255
- type: Output
1256
- }], isOpen: [{
1257
- type: Input
1258
- }], onClick: [{
1259
- type: HostListener,
1260
- args: ['click', ['$event']]
1261
1352
  }] } });
1262
1353
 
1263
- class MonthYearPickerComponent {
1264
- constructor() {
1265
- this.anoChange = new EventEmitter();
1266
- this.mesChange = new EventEmitter();
1267
- this.changed = new EventEmitter();
1268
- this._init = false;
1269
- this._modoAnual = false;
1270
- this._meses = ["JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO"];
1271
- this.text = '';
1272
- this.disableNext = false;
1273
- this.blockFuture = false;
1274
- let d = new Date();
1275
- this._ano = d.getFullYear();
1276
- this._mes = d.getMonth() + 1;
1277
- }
1278
- get modoAnual() {
1279
- return this._modoAnual;
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);
1280
1373
  }
1281
- set modoAnual(val) {
1282
- this._modoAnual = val;
1283
- if (!this._init)
1284
- return;
1285
- this.updateText();
1286
- this.raiseOnSelectionChanged();
1374
+ ngOnInit() {
1375
+ this.focus.registerElement(this.elRef.nativeElement);
1287
1376
  }
1288
- get ano() {
1289
- return this._ano;
1377
+ ngOnDestroy() {
1378
+ this.focus.unregisterElement(this.elRef.nativeElement);
1290
1379
  }
1291
- set ano(val) {
1292
- this._ano = val;
1293
- if (!this._init)
1380
+ salvar() {
1381
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
1382
+ if (valMsg) {
1383
+ this.notification.showMsgError(valMsg);
1294
1384
  return;
1295
- this.anoChange.emit(val);
1296
- this.updateText();
1297
- }
1298
- get mes() {
1299
- return this._mes;
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
+ });
1300
1397
  }
1301
- set mes(val) {
1302
- this._mes = val;
1303
- if (!this._init)
1304
- return;
1305
- this.mesChange.emit(val);
1306
- this.updateText();
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);
1307
1425
  }
1308
1426
  ngOnInit() {
1309
- this.updateText();
1310
- this._init = true;
1311
- }
1312
- goBack() {
1313
- if (this.modoAnual) {
1314
- this.ano -= 1;
1315
- }
1316
- else {
1317
- this.mes--;
1318
- if (this.mes < 1) {
1319
- this.ano -= 1;
1320
- this.mes = 12;
1321
- }
1322
- }
1323
- this.updateText();
1324
- this.raiseOnSelectionChanged();
1427
+ this.focus.registerElement(this.elRef.nativeElement);
1325
1428
  }
1326
- ;
1327
- goNext() {
1328
- if (this.modoAnual) {
1329
- this.ano += 1;
1330
- }
1331
- else {
1332
- this.mes++;
1333
- if (this.mes > 12) {
1334
- this.ano += 1;
1335
- this.mes = 1;
1336
- }
1337
- }
1338
- this.updateText();
1339
- this.raiseOnSelectionChanged();
1429
+ ngOnDestroy() {
1430
+ this.focus.unregisterElement(this.elRef.nativeElement);
1340
1431
  }
1341
- ;
1342
- updateText() {
1343
- if (this.modoAnual)
1344
- this.text = '' + this._ano;
1345
- else
1346
- this.text = this._meses[this._mes - 1] + " DE " + this._ano;
1347
- if (!this.blockFuture)
1432
+ salvar() {
1433
+ if (!this.model)
1348
1434
  return;
1349
- let d = new Date();
1350
- let ano = d.getFullYear();
1351
- let mes = d.getMonth() + 1;
1352
- if (!this.modoAnual)
1353
- this.disableNext = ano == this.ano && this.mes >= mes;
1354
- else
1355
- this.disableNext = ano == this.ano;
1356
- }
1357
- ;
1358
- raiseOnSelectionChanged() {
1359
- let d = { ano: this._ano, mes: this._mes };
1360
- this.changed.emit(d);
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
+ });
1361
1451
  }
1362
1452
  }
1363
- MonthYearPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MonthYearPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1364
- 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"] }] });
1365
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MonthYearPickerComponent, decorators: [{
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: [{
1366
1456
  type: Component,
1367
- 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"] }]
1368
- }], ctorParameters: function () { return []; }, propDecorators: { anoChange: [{
1369
- type: Output
1370
- }], mesChange: [{
1371
- type: Output
1372
- }], changed: [{
1373
- type: Output
1374
- }], blockFuture: [{
1375
- type: Input
1376
- }], modoAnual: [{
1377
- type: Input
1378
- }], ano: [{
1379
- type: Input
1380
- }], mes: [{
1381
- type: Input
1382
- }] } });
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 }]; } });
1383
1462
 
1384
- class NumericPickerComponent {
1385
- constructor() {
1386
- this.valueChange = new EventEmitter();
1387
- this.change = new EventEmitter();
1388
- this._value = 0;
1389
- this._max = 0;
1390
- this._min = 0;
1391
- this.text = '';
1392
- this.disableNext = false;
1393
- this.disableBack = false;
1394
- }
1395
- get value() {
1396
- return this._value;
1397
- }
1398
- set value(val) {
1399
- this._value = val;
1400
- this.valueChange.emit(val);
1401
- this.refreshUI();
1402
- }
1403
- get max() {
1404
- return this._max;
1405
- }
1406
- set max(val) {
1407
- this._max = val;
1408
- this.refreshUI();
1409
- }
1410
- get min() {
1411
- return this._min;
1412
- }
1413
- set min(val) {
1414
- this._min = Number(val);
1415
- this.refreshUI();
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;
1416
1479
  }
1417
1480
  ngOnInit() {
1481
+ this.setting.ordem = "nome";
1482
+ this.atualiza();
1418
1483
  }
1419
- onTextEdit(ev) {
1420
- console.info(ev);
1421
- const i = Number(ev.target.value);
1422
- if (!this.valida(i))
1423
- this.text = '' + this.value;
1424
- else {
1425
- this.value = i;
1426
- this.raiseChange();
1427
- this.refreshUI();
1428
- }
1429
- }
1430
- goBack() {
1431
- const newVal = this.value - 1;
1432
- if (!this.valida(newVal))
1433
- return;
1434
- this.value = newVal;
1435
- this.raiseChange();
1436
- }
1437
- ;
1438
- goNext() {
1439
- const newVal = this.value + 1;
1440
- if (!this.valida(newVal))
1441
- return;
1442
- this.value = newVal;
1443
- this.raiseChange();
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
+ });
1444
1495
  }
1445
- ;
1446
- refreshUI() {
1447
- this.text = this.value === undefined ? '--' : '' + this.value;
1448
- this.disableNext = this.max !== undefined && this.value === this.max;
1449
- this.disableBack = this.min !== undefined && this.value === this.min;
1496
+ selectItem(i) {
1497
+ if (this.selectedItem === i) {
1498
+ this.dialogRef.close(i);
1499
+ }
1500
+ this.selectedItem = i;
1450
1501
  }
1451
- valida(val) {
1452
- if (isNaN(val))
1453
- return false;
1454
- if (this.max !== undefined && val > this.max)
1455
- return false;
1456
- if (this.min !== undefined && val < this.min)
1457
- return false;
1458
- return true;
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
+ });
1459
1521
  }
1460
- raiseChange() {
1461
- this.change.emit(this.value);
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
+ });
1462
1542
  }
1463
1543
  }
1464
- NumericPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1465
- 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"] }] });
1466
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, decorators: [{
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: [{
1467
1547
  type: Component,
1468
- 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"] }]
1469
- }], ctorParameters: function () { return []; }, propDecorators: { valueChange: [{
1470
- type: Output
1471
- }], change: [{
1472
- type: Output
1473
- }], value: [{
1474
- type: Input
1475
- }], max: [{
1476
- type: Input
1477
- }], min: [{
1478
- type: Input
1479
- }] } });
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 }]; } });
1480
1550
 
1481
- class PaginatorComponent {
1482
- constructor() {
1483
- this.paginaAtualChange = new EventEmitter();
1484
- this.totalPaginasChange = new EventEmitter();
1485
- this.change = new EventEmitter();
1486
- this._paginaAtual = 1;
1487
- this._totalPaginas = 1;
1488
- this.inicio = true;
1489
- this.fim = true;
1490
- this.pageSize = 0;
1491
- }
1492
- get paginaAtual() {
1493
- return this._paginaAtual;
1494
- }
1495
- set paginaAtual(val) {
1496
- this._paginaAtual = val;
1497
- this.paginaAtualChange.emit(val);
1498
- this.refreshUI();
1499
- }
1500
- get totalPaginas() {
1501
- return this._totalPaginas;
1502
- }
1503
- set totalPaginas(val) {
1504
- this._totalPaginas = val;
1505
- this.totalPaginasChange.emit(val);
1506
- this.refreshUI();
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);
1507
1570
  }
1508
1571
  ngOnInit() {
1572
+ this.focus.registerElement(this.elRef.nativeElement);
1509
1573
  }
1510
- trocaPagina(pagina) {
1511
- if (pagina > this.totalPaginas || pagina < 1)
1512
- return;
1513
- this.paginaAtual = pagina;
1514
- this.refreshUI();
1515
- this.change.emit(this.paginaAtual);
1516
- }
1517
- refreshUI() {
1518
- this.inicio = this.paginaAtual == 1;
1519
- this.fim = this.paginaAtual == this.totalPaginas;
1520
- }
1521
- goBack() {
1522
- this.trocaPagina(this.paginaAtual - 1);
1574
+ ngOnDestroy() {
1575
+ this.focus.unregisterElement(this.elRef.nativeElement);
1523
1576
  }
1524
- goNext() {
1525
- this.trocaPagina(this.paginaAtual + 1);
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
+ });
1526
1594
  }
1527
1595
  }
1528
- PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1529
- 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"] }] });
1530
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, decorators: [{
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: [{
1531
1599
  type: Component,
1532
- 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"] }]
1533
- }], ctorParameters: function () { return []; }, propDecorators: { paginaAtualChange: [{
1534
- type: Output
1535
- }], totalPaginasChange: [{
1536
- type: Output
1537
- }], change: [{
1538
- type: Output
1539
- }], pageSize: [{
1540
- type: Input
1541
- }], paginaAtual: [{
1542
- type: Input
1543
- }], totalPaginas: [{
1544
- type: Input
1545
- }] } });
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 }]; } });
1546
1605
 
1547
- class RadioButtonGroupComponent {
1548
- constructor() {
1549
- this.change = new EventEmitter();
1550
- this._items = [];
1551
- //_init : boolean = false;
1552
- this.selectedItem = null;
1553
- }
1554
- get items() {
1555
- return this._items;
1556
- }
1557
- set items(val) {
1558
- this._items = val;
1559
- this.selectedItem = this.items.filter(x => x.default === true).firstOrNull();
1560
- if (this.selectedItem === null)
1561
- this.selectedItem = this.items.firstOrNull();
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);
1562
1622
  }
1563
1623
  ngOnInit() {
1624
+ this.focus.registerElement(this.elRef.nativeElement);
1564
1625
  }
1565
- raiseChange(item) {
1566
- this.selectedItem = item;
1567
- this.change.emit(this.selectedItem);
1568
- }
1569
- }
1570
- RadioButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1571
- 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"] }] });
1572
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, decorators: [{
1573
- type: Component,
1574
- 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"] }]
1575
- }], ctorParameters: function () { return []; }, propDecorators: { change: [{
1576
- type: Output
1577
- }], selectedItem: [{
1578
- type: Input
1579
- }], items: [{
1580
- type: Input
1581
- }] } });
1582
-
1583
- class SafeHtmlPipe {
1584
- constructor(sanitizer) {
1585
- this.sanitizer = sanitizer;
1586
- }
1587
- transform(html) {
1588
- return this.sanitizer.bypassSecurityTrustHtml(html);
1589
- }
1590
- }
1591
- 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 });
1592
- SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
1593
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, decorators: [{
1594
- type: Pipe,
1595
- args: [{
1596
- name: 'safeHtml'
1597
- }]
1598
- }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
1599
-
1600
- var ModalidadeBaseICMS;
1601
- (function (ModalidadeBaseICMS) {
1602
- ModalidadeBaseICMS[ModalidadeBaseICMS["MargemValorAgregado"] = 0] = "MargemValorAgregado";
1603
- ModalidadeBaseICMS[ModalidadeBaseICMS["PautaValor"] = 1] = "PautaValor";
1604
- ModalidadeBaseICMS[ModalidadeBaseICMS["Pre\u00E7oTabeladoMax"] = 2] = "Pre\u00E7oTabeladoMax";
1605
- ModalidadeBaseICMS[ModalidadeBaseICMS["ValorDaOpera\u00E7\u00E3o"] = 3] = "ValorDaOpera\u00E7\u00E3o";
1606
- })(ModalidadeBaseICMS || (ModalidadeBaseICMS = {}));
1607
- function createProduct() {
1608
- return {
1609
- id: 0,
1610
- nome: '',
1611
- unidade: 'UN',
1612
- precoCusto: 0,
1613
- precoVenda: 0,
1614
- precoFuncionario: 0,
1615
- estoqueMinimo: 0,
1616
- referencia: '',
1617
- aliquotaICMS: null,
1618
- ncm: null,
1619
- grupoId: 0,
1620
- grupoNome: null,
1621
- subgrupoId: 0,
1622
- subgrupoNome: null,
1623
- quantidadeSuite: 0,
1624
- estoqueControlado: true,
1625
- imprimiCozinha: true,
1626
- imprimeCorredor: false,
1627
- verNaRecepcao: true,
1628
- prato: false,
1629
- isAtivo: true,
1630
- isComposto: true,
1631
- isIngrediente: true,
1632
- omiteCliente: false,
1633
- estoqueRecepcao: false,
1634
- estoqueRecepcaoQuantidade: 0,
1635
- gtin: null,
1636
- cfop: null,
1637
- csT_icms: null,
1638
- modBC_icms: 0,
1639
- pICMS_icms: null,
1640
- pRedBC_icms: null,
1641
- pfcP_icms: null,
1642
- vbcfcP_icms: null,
1643
- pfcpsT_icms: null,
1644
- pRedBCEfet_icms: null,
1645
- vbcEfet_icms: null,
1646
- picmsEfet_icms: null,
1647
- vicmsEfet_icms: null,
1648
- csT_pis: null,
1649
- vbC_pis: null,
1650
- ppiS_pis: null,
1651
- csT_cofins: null,
1652
- vbC_cofins: null,
1653
- pcofinS_cofins: null,
1654
- psT_icms: null,
1655
- vbcstRet_icms: null,
1656
- vicmsSubstituto_icms: null,
1657
- vicmsstRet_icms: null,
1658
- emiteNFCe: false,
1659
- cest: null,
1660
- vbcfcpsT_icms: null,
1661
- vbcfcpstRet_icms: null,
1662
- pfcpstRet_icms: null,
1663
- sitTrib: null,
1664
- setorSubEstoqueId: null,
1665
- setorSubEstoqueNome: null,
1666
- setorPrincipalId: null,
1667
- setorPrincipalNome: null,
1668
- qtdMinSubEstoque: null,
1669
- disponivelCardapio: false,
1670
- categoriaCardapioId: null,
1671
- categoriaCardapioNome: null,
1672
- descricao: null,
1673
- enviadoPC: false,
1674
- qbcProd_cofins: null,
1675
- vAliqProd_cofins: null
1676
- };
1677
- }
1678
- ;
1679
- function valida$1(item, focus) {
1680
- if (valTextEmpty(item.nome)) {
1681
- focus.set('nome');
1682
- return 'Digite um nome válido.';
1683
- }
1684
- if (valNumberEmpty(item.grupoId)) {
1685
- return 'Escolha um grupo de produto.';
1686
- }
1687
- if (valNumberEmpty(item.subgrupoId)) {
1688
- return 'Escolha um subgrupo de produto.';
1689
- }
1690
- if (valTextEmpty(item.unidade)) {
1691
- focus.set('unidade');
1692
- return 'Digite uma unidade.';
1693
- }
1694
- if (item.disponivelCardapio) {
1695
- if (valNumberEmpty(item.categoriaCardapioId))
1696
- return 'Escolha uma categoria do cardápio digital.';
1697
- if (valTextEmpty(item.descricao)) {
1698
- focus.set('descricao');
1699
- return 'Digite uma descrição para o cardápio digital.';
1700
- }
1701
- }
1702
- return null;
1703
- }
1704
-
1705
- class ProdutoSearchSetting extends SearchSetting {
1706
- constructor() {
1707
- super();
1708
- this.exibeNaoControladoEstoque = true;
1709
- this.exibeApenasMostraRecepcao = false;
1710
- this.exibeInativo = false;
1711
- this.exibeImprimiCozinha = false;
1712
- this.exibeHePrato = false;
1713
- }
1714
- }
1715
-
1716
- class NumberParser {
1717
- constructor(setPropFunc, getPropFunc, min, max, triggerMilliseconds = 1500) {
1718
- this.setPropFunc = setPropFunc;
1719
- this.getPropFunc = getPropFunc;
1720
- this.min = min;
1721
- this.max = max;
1722
- this.parsed = false;
1723
- this._parseTrigger = new LazyTrigger(() => this.parseValor(), triggerMilliseconds);
1724
- }
1725
- parse(vlr) {
1726
- this.valor = vlr;
1727
- this.parsed = false;
1728
- this._parseTrigger.fire();
1729
- }
1730
- store(vlr) {
1731
- this.valor = vlr;
1732
- this.parsed = false;
1733
- }
1734
- checkout() {
1735
- if (this.parsed || !this.valor)
1736
- return;
1737
- this.parseValor();
1738
- }
1739
- parseValor() {
1740
- if (this.valor === undefined)
1741
- return;
1742
- this.parsed = true;
1743
- const vlrTxt = this.valor.split(",").join(".");
1744
- ;
1745
- const spTxt = vlrTxt.split(".");
1746
- let toParseTxt = "";
1747
- if (spTxt.length > 2) {
1748
- const chars = vlrTxt.split("");
1749
- const lastIndex = vlrTxt.lastIndexOf(".");
1750
- for (let i = 0; i < chars.length; i++) {
1751
- const c = chars[i];
1752
- if (c === "." && i != lastIndex)
1753
- continue;
1754
- toParseTxt = toParseTxt.concat(c);
1755
- }
1756
- }
1757
- else {
1758
- toParseTxt = vlrTxt;
1759
- }
1760
- const vlr = parseFloat(toParseTxt);
1761
- if (isNaN(vlr) || !this.validaMinMax(vlr)) {
1762
- const original = this.getPropFunc();
1763
- this.setPropFunc(0);
1764
- setTimeout(() => this.setPropFunc(original));
1765
- }
1766
- else {
1767
- this.setPropFunc(vlr);
1768
- }
1769
- }
1770
- validaMinMax(value) {
1771
- if ((this.min === undefined) && this.max === undefined)
1772
- return true;
1773
- if (!(this.min === undefined) && value < this.min)
1774
- return false;
1775
- if (!(this.max === undefined) && value > this.max)
1776
- return false;
1777
- return true;
1778
- }
1779
- }
1780
-
1781
- function valida(item, focus) {
1782
- if (valTextEmpty(item.nome)) {
1783
- focus.set('nome');
1784
- return 'Digite um nome válido.';
1785
- }
1786
- return null;
1787
- }
1788
-
1789
- class ProdutoGrupoFormComponent {
1790
- constructor() { }
1791
- ngOnInit() {
1792
- }
1793
- }
1794
- ProdutoGrupoFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1795
- 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"] }] });
1796
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoFormComponent, decorators: [{
1797
- type: Component,
1798
- 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"] }]
1799
- }], ctorParameters: function () { return []; }, propDecorators: { model: [{
1800
- type: Input
1801
- }] } });
1802
-
1803
- class ProdutoCategoriaCardapioAddDialogComponent {
1804
- constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
1805
- this.ws = ws;
1806
- this.notification = notification;
1807
- this.dataDialog = dataDialog;
1808
- this.dialog = dialog;
1809
- this.elRef = elRef;
1810
- this.dialogRef = dialogRef;
1811
- this.screenHelper = screenHelper;
1812
- this.isBusy = false;
1813
- this.focus = new FocusService();
1814
- this.model = {
1815
- id: 0,
1816
- nome: '',
1817
- isAtivo: true,
1818
- enviadoPC: false
1819
- };
1820
- this.mobile = this.screenHelper.isMedium;
1821
- this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1822
- }
1823
- ngOnInit() {
1824
- this.focus.registerElement(this.elRef.nativeElement);
1825
- }
1826
- ngOnDestroy() {
1827
- this.focus.unregisterElement(this.elRef.nativeElement);
1828
- }
1829
- salvar() {
1830
- const valMsg = valida(this.model, this.focus);
1831
- if (valMsg) {
1832
- this.notification.showMsgError(valMsg);
1833
- return;
1834
- }
1835
- this.isBusy = true;
1836
- this.ws.addProdutoCategoriaCardapio(this.model)
1837
- .subscribe(r => {
1838
- this.isBusy = false;
1839
- this.notification.showMsg("Salvo com sucesso.");
1840
- if (this.dialogRef)
1841
- this.dialogRef.close(true);
1842
- }, err => {
1843
- this.isBusy = false;
1844
- this.notification.showMsg(err.error);
1845
- });
1846
- }
1847
- }
1848
- 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 });
1849
- 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"] }] });
1850
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioAddDialogComponent, decorators: [{
1851
- type: Component,
1852
- 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"] }]
1853
- }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
1854
- type: Inject,
1855
- args: [MAT_DIALOG_DATA]
1856
- }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
1857
-
1858
- class ProdutoCategoriaCardapioEditDialogComponent {
1859
- constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
1860
- this.ws = ws;
1861
- this.notification = notification;
1862
- this.dataDialog = dataDialog;
1863
- this.dialog = dialog;
1864
- this.elRef = elRef;
1865
- this.dialogRef = dialogRef;
1866
- this.screenHelper = screenHelper;
1867
- this.isBusy = false;
1868
- this.focus = new FocusService();
1869
- if (dataDialog) {
1870
- this.model = dataDialog;
1871
- }
1872
- this.mobile = this.screenHelper.isMedium;
1873
- this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
1874
- }
1875
- ngOnInit() {
1876
- this.focus.registerElement(this.elRef.nativeElement);
1877
- }
1878
- ngOnDestroy() {
1879
- this.focus.unregisterElement(this.elRef.nativeElement);
1880
- }
1881
- salvar() {
1882
- if (!this.model)
1883
- return;
1884
- const valMsg = valida(this.model, this.focus);
1885
- if (valMsg) {
1886
- this.notification.showMsgError(valMsg);
1887
- return;
1888
- }
1889
- this.isBusy = true;
1890
- this.ws.saveProdutoCategoriaCardapio(this.model)
1891
- .subscribe(r => {
1892
- this.isBusy = false;
1893
- this.notification.showMsg("Salvo com sucesso.");
1894
- if (this.dialogRef)
1895
- this.dialogRef.close(true);
1896
- }, err => {
1897
- this.isBusy = false;
1898
- this.notification.showMsg(err.error);
1899
- });
1900
- }
1901
- }
1902
- 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 });
1903
- 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"] }] });
1904
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioEditDialogComponent, decorators: [{
1905
- type: Component,
1906
- 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"] }]
1907
- }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
1908
- type: Inject,
1909
- args: [MAT_DIALOG_DATA]
1910
- }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
1911
-
1912
- class ProdutoCategoriaCardapioSelecaoDialogComponent {
1913
- constructor(dialogRef, dialog, ws, notification, auth, screenHelper) {
1914
- this.dialogRef = dialogRef;
1915
- this.dialog = dialog;
1916
- this.ws = ws;
1917
- this.notification = notification;
1918
- this.screenHelper = screenHelper;
1919
- this.items = [];
1920
- this.selectedItem = null;
1921
- this.isBusy = false;
1922
- this.setting = new SearchSetting();
1923
- this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
1924
- this.nav = new NavegacaoSelecaoDialogUtil(this);
1925
- this.mobile = this.screenHelper.isMedium;
1926
- this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
1927
- this.allowEdit = auth.permissoes.adminProdutoGrupoPesquisa;
1928
- }
1929
- ngOnInit() {
1930
- this.setting.ordem = "nome";
1931
- this.atualiza();
1932
- }
1933
- atualiza() {
1934
- this.isBusy = true;
1935
- this.ws.buscaProdutoCategoriaCardapio(this.setting)
1936
- .subscribe(r => {
1937
- this.isBusy = false;
1938
- this.items = r;
1939
- console.info(r);
1940
- }, err => {
1941
- this.isBusy = false;
1942
- this.notification.showHttpError(err);
1943
- });
1944
- }
1945
- selectItem(i) {
1946
- if (this.selectedItem === i) {
1947
- this.dialogRef.close(i);
1948
- }
1949
- this.selectedItem = i;
1950
- }
1951
- novo() {
1952
- let height = (window.innerHeight * 0.90) + 'px';
1953
- let width = 550 + 'px';
1954
- if (this.mobile) {
1955
- width = (window.innerWidth * 0.99) + 'px';
1956
- //height = (window.innerHeight * 0.98) + 'px';
1957
- }
1958
- const dialog = this.dialog.open(ProdutoCategoriaCardapioAddDialogComponent, {
1959
- width: width,
1960
- height: height,
1961
- maxWidth: '100%',
1962
- panelClass: 'dialog-p0',
1963
- });
1964
- dialog.afterClosed().subscribe(result => {
1965
- if (result === undefined)
1966
- return;
1967
- this.notification.showMsg("Salvo com sucesso.");
1968
- this.atualiza();
1969
- });
1970
- }
1971
- editar() {
1972
- let height = (window.innerHeight * 0.90) + 'px';
1973
- let width = 550 + 'px';
1974
- if (this.mobile) {
1975
- width = (window.innerWidth * 0.99) + 'px';
1976
- //height = (window.innerHeight * 0.98) + 'px';
1977
- }
1978
- const dialog = this.dialog.open(ProdutoCategoriaCardapioEditDialogComponent, {
1979
- width: width,
1980
- height: height,
1981
- maxWidth: '100%',
1982
- panelClass: 'dialog-p0',
1983
- data: this.selectedItem
1984
- });
1985
- dialog.afterClosed().subscribe(result => {
1986
- if (result === undefined)
1987
- return;
1988
- this.notification.showMsg("Salvo com sucesso.");
1989
- this.atualiza();
1990
- });
1991
- }
1992
- }
1993
- 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 });
1994
- 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"] }] });
1995
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioSelecaoDialogComponent, decorators: [{
1996
- type: Component,
1997
- 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"] }]
1998
- }], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
1999
-
2000
- class ProdutoGrupoAddDialogComponent {
2001
- constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
2002
- this.ws = ws;
2003
- this.notification = notification;
2004
- this.dataDialog = dataDialog;
2005
- this.dialog = dialog;
2006
- this.elRef = elRef;
2007
- this.dialogRef = dialogRef;
2008
- this.screenHelper = screenHelper;
2009
- this.isBusy = false;
2010
- this.focus = new FocusService();
2011
- this.model = {
2012
- id: 0,
2013
- nome: '',
2014
- isAtivo: true,
2015
- enviadoPC: false
2016
- };
2017
- this.mobile = this.screenHelper.isMedium;
2018
- this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2019
- }
2020
- ngOnInit() {
2021
- this.focus.registerElement(this.elRef.nativeElement);
2022
- }
2023
- ngOnDestroy() {
2024
- this.focus.unregisterElement(this.elRef.nativeElement);
2025
- }
2026
- salvar() {
2027
- const valMsg = valida(this.model, this.focus);
2028
- if (valMsg) {
2029
- this.notification.showMsgError(valMsg);
2030
- return;
2031
- }
2032
- this.isBusy = true;
2033
- this.ws.addProdutoGrupo(this.model)
2034
- .subscribe(r => {
2035
- this.isBusy = false;
2036
- this.notification.showMsg("Salvo com sucesso.");
2037
- if (this.dialogRef)
2038
- this.dialogRef.close(true);
2039
- }, err => {
2040
- this.isBusy = false;
2041
- this.notification.showMsg(err.error);
2042
- });
2043
- }
2044
- }
2045
- 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 });
2046
- 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"] }] });
2047
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoAddDialogComponent, decorators: [{
2048
- type: Component,
2049
- 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"] }]
2050
- }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
2051
- type: Inject,
2052
- args: [MAT_DIALOG_DATA]
2053
- }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
2054
-
2055
- class ProdutoGrupoEditDialogComponent {
2056
- constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
2057
- this.ws = ws;
2058
- this.notification = notification;
2059
- this.dataDialog = dataDialog;
2060
- this.dialog = dialog;
2061
- this.elRef = elRef;
2062
- this.dialogRef = dialogRef;
2063
- this.screenHelper = screenHelper;
2064
- this.isBusy = false;
2065
- this.focus = new FocusService();
2066
- if (dataDialog) {
2067
- this.model = dataDialog;
2068
- }
2069
- this.mobile = this.screenHelper.isMedium;
2070
- this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2071
- }
2072
- ngOnInit() {
2073
- this.focus.registerElement(this.elRef.nativeElement);
2074
- }
2075
- ngOnDestroy() {
2076
- this.focus.unregisterElement(this.elRef.nativeElement);
1626
+ ngOnDestroy() {
1627
+ this.focus.unregisterElement(this.elRef.nativeElement);
2077
1628
  }
2078
1629
  salvar() {
2079
1630
  if (!this.model)
2080
1631
  return;
2081
- const valMsg = valida(this.model, this.focus);
1632
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
2082
1633
  if (valMsg) {
2083
1634
  this.notification.showMsgError(valMsg);
2084
1635
  return;
@@ -2267,7 +1818,7 @@ class ProdutoSubgrupoAddDialogComponent {
2267
1818
  salvar() {
2268
1819
  if (!this.model)
2269
1820
  return;
2270
- const valMsg = valida(this.model, this.focus);
1821
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
2271
1822
  if (valMsg) {
2272
1823
  this.notification.showMsgError(valMsg);
2273
1824
  return;
@@ -2321,7 +1872,7 @@ class ProdutoSubgrupoEditDialogComponent {
2321
1872
  salvar() {
2322
1873
  if (!this.model)
2323
1874
  return;
2324
- const valMsg = valida(this.model, this.focus);
1875
+ const valMsg = validaProdutoGrupo(this.model, this.focus);
2325
1876
  if (valMsg) {
2326
1877
  this.notification.showMsgError(valMsg);
2327
1878
  return;
@@ -2430,12 +1981,81 @@ class ProdutoSubgrupoSelecaoDialogComponent {
2430
1981
  });
2431
1982
  }
2432
1983
  }
2433
- 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 });
2434
- 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"] }] });
2435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoSelecaoDialogComponent, decorators: [{
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: [{
2436
2050
  type: Component,
2437
- 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"] }]
2438
- }], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
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
+ }] } });
2439
2059
 
2440
2060
  const lateralAnimation = trigger('menuLateral', [
2441
2061
  transition(':enter', [
@@ -2756,89 +2376,314 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
2756
2376
  type: Input
2757
2377
  }] } });
2758
2378
 
2759
- class ProdutoAddDialogComponent {
2760
- constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
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) {
2761
2620
  this.ws = ws;
2762
2621
  this.notification = notification;
2763
- this.dataDialog = dataDialog;
2764
2622
  this.dialog = dialog;
2765
- this.elRef = elRef;
2766
- this.dialogRef = dialogRef;
2767
2623
  this.screenHelper = screenHelper;
2768
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();
2769
2638
  this.focus = new FocusService();
2770
- this.model = createProduct();
2639
+ this.paginaAtual = 1;
2640
+ this.quantidadePagina = 50;
2641
+ this.allowAdd = auth.permissoes.adminProdutoAdd;
2642
+ this.allowExcluir = auth.permissoes.adminProdutoDelete;
2771
2643
  this.mobile = this.screenHelper.isMedium;
2772
2644
  this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2645
+ this.setting.exibeNaoControladoEstoque = true;
2646
+ this.setting.exibeImprimiCozinha = true;
2773
2647
  }
2774
- ngOnInit() {
2775
- this.focus.registerElement(this.elRef.nativeElement);
2776
- this.getNextId();
2648
+ get selectedItem() {
2649
+ return this._selectedItem;
2777
2650
  }
2778
- ngOnDestroy() {
2779
- this.focus.unregisterElement(this.elRef.nativeElement);
2651
+ set selectedItem(p) {
2652
+ this._selectedItem = p;
2780
2653
  }
2781
- salvar() {
2782
- if (!this.model)
2783
- return;
2784
- const valMsg = valida$1(this.model, this.focus);
2785
- if (valMsg) {
2786
- this.notification.showMsgError(valMsg);
2787
- return;
2788
- }
2789
- this.isBusy = true;
2790
- this.ws.addProduto(this.model)
2791
- .subscribe(r => {
2792
- this.isBusy = false;
2793
- this.notification.showMsg("Salvo com sucesso.");
2794
- if (this.dialogRef)
2795
- this.dialogRef.close(true);
2796
- }, err => {
2797
- this.isBusy = false;
2798
- this.notification.showMsg(err.error);
2799
- });
2654
+ ngOnInit() {
2655
+ this.setting.ordem = "nome";
2656
+ this.atualiza();
2800
2657
  }
2801
- getNextId() {
2802
- this.isBusy = true;
2803
- this.ws.getNextIdProduto()
2804
- .subscribe(r => {
2805
- this.model.id = r;
2806
- this.model.referencia = '' + r;
2807
- this.isBusy = false;
2808
- }, err => {
2809
- this.isBusy = false;
2810
- this.notification.showMsg(err.error);
2811
- });
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
+ }
2812
2669
  }
2813
- }
2814
- 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 });
2815
- 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"] }] });
2816
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoAddDialogComponent, decorators: [{
2817
- type: Component,
2818
- 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"] }]
2819
- }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
2820
- type: Inject,
2821
- args: [MAT_DIALOG_DATA]
2822
- }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
2823
-
2824
- class ProdutoBuscaFiltrosDialogComponent {
2825
- constructor(d, ws, notification, dialogRef) {
2826
- this.d = d;
2827
- this.ws = ws;
2828
- this.notification = notification;
2829
- this.dialogRef = dialogRef;
2830
- this.isBusy = false;
2831
- this.produtosGrupos = [];
2832
- this.d.setting.grupos = undefined;
2670
+ ngOnDestroy() {
2671
+ this.focus.unregisterElementById("form-column");
2833
2672
  }
2834
- ngOnInit() {
2835
- this.getProdutos();
2673
+ trocaPagina() {
2674
+ this.atualiza(this.paginaAtual);
2836
2675
  }
2837
- getProdutos() {
2676
+ atualiza(pagina) {
2677
+ if (pagina == undefined)
2678
+ this.paginaAtual = 1;
2679
+ else
2680
+ this.paginaAtual = pagina;
2838
2681
  this.isBusy = true;
2839
- this.ws.getAllProdutoGrupo()
2682
+ this.ws.buscaPaginadaProdutos(this.setting, this.paginaAtual, this.quantidadePagina)
2840
2683
  .subscribe(r => {
2841
- this.produtosGrupos = r;
2684
+ this.items = r.items;
2685
+ this.result = r;
2686
+ this.selectedItem = null;
2842
2687
  console.info(r);
2843
2688
  this.isBusy = false;
2844
2689
  }, err => {
@@ -2846,79 +2691,118 @@ class ProdutoBuscaFiltrosDialogComponent {
2846
2691
  this.notification.showHttpError(err);
2847
2692
  });
2848
2693
  }
2849
- salvar() {
2850
- this.dialogRef.close(this.d);
2851
- }
2852
- changeGruposProdutos(ev) {
2853
- const itens = ev.value;
2854
- this.d.setting.grupos = itens;
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
+ });
2855
2711
  }
2856
- }
2857
- 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 });
2858
- 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"] }] });
2859
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoBuscaFiltrosDialogComponent, decorators: [{
2860
- type: Component,
2861
- 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"] }]
2862
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2863
- type: Inject,
2864
- args: [MAT_DIALOG_DATA]
2865
- }] }, { type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialogRef }]; } });
2866
-
2867
- class ProdutoEditDialogComponent {
2868
- constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
2869
- this.ws = ws;
2870
- this.notification = notification;
2871
- this.dataDialog = dataDialog;
2872
- this.dialog = dialog;
2873
- this.elRef = elRef;
2874
- this.dialogRef = dialogRef;
2875
- this.screenHelper = screenHelper;
2876
- this.isBusy = false;
2877
- this.focus = new FocusService();
2878
- if (dataDialog) {
2879
- this.model = dataDialog;
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';
2880
2718
  }
2881
- this.mobile = this.screenHelper.isMedium;
2882
- this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2883
- }
2884
- ngOnInit() {
2885
- this.focus.registerElement(this.elRef.nativeElement);
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
+ });
2886
2731
  }
2887
- ngOnDestroy() {
2888
- this.focus.unregisterElement(this.elRef.nativeElement);
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
+ });
2889
2752
  }
2890
2753
  salvar() {
2891
- if (!this.model)
2754
+ if (!this.selectedItem)
2892
2755
  return;
2893
- const valMsg = valida$1(this.model, this.focus);
2756
+ const valMsg = validaProduto(this.selectedItem, this.focus);
2894
2757
  if (valMsg) {
2895
2758
  this.notification.showMsgError(valMsg);
2896
2759
  return;
2897
2760
  }
2898
2761
  this.isBusy = true;
2899
- this.ws.saveProduto(this.model)
2762
+ this.ws.saveProduto(this.selectedItem)
2900
2763
  .subscribe(r => {
2901
- this.isBusy = false;
2902
2764
  this.notification.showMsg("Salvo com sucesso.");
2903
- if (this.dialogRef)
2904
- this.dialogRef.close(true);
2765
+ this.isBusy = false;
2905
2766
  }, err => {
2906
2767
  this.isBusy = false;
2907
2768
  this.notification.showMsg(err.error);
2908
2769
  });
2909
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
+ }
2910
2797
  }
2911
- 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 });
2912
- 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"] }] });
2913
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoEditDialogComponent, decorators: [{
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: [{
2914
2801
  type: Component,
2915
- 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"] }]
2916
- }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
2917
- type: Inject,
2918
- args: [MAT_DIALOG_DATA]
2919
- }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
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 }]; } });
2920
2804
 
2921
- class ProdutosComponent {
2805
+ class ProdutosCategoriasCardapioComponent {
2922
2806
  constructor(ws, notification, dialog, auth, screenHelper) {
2923
2807
  this.ws = ws;
2924
2808
  this.notification = notification;
@@ -2926,33 +2810,14 @@ class ProdutosComponent {
2926
2810
  this.screenHelper = screenHelper;
2927
2811
  this.isBusy = false;
2928
2812
  this.items = [];
2929
- this.result = {
2930
- finalQtd: 0,
2931
- inicioQtd: 0,
2932
- items: [],
2933
- pagina: 0,
2934
- quantidade: 0,
2935
- valor: 0,
2936
- totalPaginas: 0
2937
- };
2938
- this._selectedItem = null;
2813
+ this.selectedItem = null;
2939
2814
  this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
2940
- this.setting = new ProdutoSearchSetting();
2815
+ this.setting = new SearchSetting();
2941
2816
  this.focus = new FocusService();
2942
- this.paginaAtual = 1;
2943
- this.quantidadePagina = 50;
2944
- this.allowAdd = auth.permissoes.adminProdutoAdd;
2945
- this.allowExcluir = auth.permissoes.adminProdutoDelete;
2817
+ this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
2818
+ this.allowExcluir = auth.permissoes.adminProdutoGrupoDelete;
2946
2819
  this.mobile = this.screenHelper.isMedium;
2947
2820
  this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
2948
- this.setting.exibeNaoControladoEstoque = true;
2949
- this.setting.exibeImprimiCozinha = true;
2950
- }
2951
- get selectedItem() {
2952
- return this._selectedItem;
2953
- }
2954
- set selectedItem(p) {
2955
- this._selectedItem = p;
2956
2821
  }
2957
2822
  ngOnInit() {
2958
2823
  this.setting.ordem = "nome";
@@ -2973,19 +2838,11 @@ class ProdutosComponent {
2973
2838
  ngOnDestroy() {
2974
2839
  this.focus.unregisterElementById("form-column");
2975
2840
  }
2976
- trocaPagina() {
2977
- this.atualiza(this.paginaAtual);
2978
- }
2979
- atualiza(pagina) {
2980
- if (pagina == undefined)
2981
- this.paginaAtual = 1;
2982
- else
2983
- this.paginaAtual = pagina;
2841
+ atualiza() {
2984
2842
  this.isBusy = true;
2985
- this.ws.buscaPaginadaProdutos(this.setting, this.paginaAtual, this.quantidadePagina)
2843
+ this.ws.buscaProdutoCategoriaCardapio(this.setting)
2986
2844
  .subscribe(r => {
2987
- this.items = r.items;
2988
- this.result = r;
2845
+ this.items = r;
2989
2846
  this.selectedItem = null;
2990
2847
  console.info(r);
2991
2848
  this.isBusy = false;
@@ -2998,11 +2855,11 @@ class ProdutosComponent {
2998
2855
  const item = this.selectedItem;
2999
2856
  if (!item)
3000
2857
  return;
3001
- confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do produto ${item.nome}?`, () => {
2858
+ confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do grupo ${item.nome}?`, () => {
3002
2859
  this.isBusy = true;
3003
- this.ws.deleteProduto(item.id)
2860
+ this.ws.deleteProdutoCategoriaCardapio(item.id)
3004
2861
  .subscribe(r => {
3005
- this.notification.showMsg("O produto foi excluído com sucesso.");
2862
+ this.notification.showMsg("O grupo foi excluído com sucesso.");
3006
2863
  this.items.remove(item);
3007
2864
  this.selectedItem = null;
3008
2865
  this.isBusy = false;
@@ -3019,9 +2876,9 @@ class ProdutosComponent {
3019
2876
  width = (window.innerWidth * 0.99) + 'px';
3020
2877
  //height = (window.innerHeight * 0.98) + 'px';
3021
2878
  }
3022
- const dialog = this.dialog.open(ProdutoAddDialogComponent, {
2879
+ const dialog = this.dialog.open(ProdutoCategoriaCardapioAddDialogComponent, {
3023
2880
  width: width,
3024
- height: height,
2881
+ //height: height,
3025
2882
  maxWidth: '100%',
3026
2883
  panelClass: 'dialog-p0',
3027
2884
  });
@@ -3039,10 +2896,10 @@ class ProdutosComponent {
3039
2896
  width = (window.innerWidth * 0.99) + 'px';
3040
2897
  height = (window.innerHeight * 0.99) + 'px';
3041
2898
  }
3042
- const dialog = this.dialog.open(ProdutoEditDialogComponent, {
2899
+ const dialog = this.dialog.open(ProdutoCategoriaCardapioEditDialogComponent, {
3043
2900
  data: item,
3044
2901
  width: width,
3045
- height: height,
2902
+ //height: height,
3046
2903
  maxWidth: '100%',
3047
2904
  panelClass: 'dialog-p0',
3048
2905
  });
@@ -3056,13 +2913,13 @@ class ProdutosComponent {
3056
2913
  salvar() {
3057
2914
  if (!this.selectedItem)
3058
2915
  return;
3059
- const valMsg = valida$1(this.selectedItem, this.focus);
2916
+ const valMsg = validaProdutoGrupo(this.selectedItem, this.focus);
3060
2917
  if (valMsg) {
3061
2918
  this.notification.showMsgError(valMsg);
3062
2919
  return;
3063
2920
  }
3064
2921
  this.isBusy = true;
3065
- this.ws.saveProduto(this.selectedItem)
2922
+ this.ws.saveProdutoCategoriaCardapio(this.selectedItem)
3066
2923
  .subscribe(r => {
3067
2924
  this.notification.showMsg("Salvo com sucesso.");
3068
2925
  this.isBusy = false;
@@ -3071,38 +2928,12 @@ class ProdutosComponent {
3071
2928
  this.notification.showMsg(err.error);
3072
2929
  });
3073
2930
  }
3074
- filtros() {
3075
- let height = undefined;
3076
- let width = 550 + 'px';
3077
- if (this.mobile) {
3078
- width = (window.innerWidth * 0.99) + 'px';
3079
- height = (window.innerHeight * 0.99) + 'px';
3080
- }
3081
- const p = {
3082
- qtd: this.quantidadePagina,
3083
- setting: this.setting
3084
- };
3085
- const dialog = this.dialog.open(ProdutoBuscaFiltrosDialogComponent, {
3086
- data: p,
3087
- width: width,
3088
- height: height,
3089
- maxWidth: '100%',
3090
- panelClass: 'dialog-p0',
3091
- });
3092
- dialog.afterClosed().subscribe(result => {
3093
- if (!result)
3094
- return;
3095
- const r = result;
3096
- this.quantidadePagina = r.qtd;
3097
- this.atualiza();
3098
- });
3099
- }
3100
2931
  }
3101
- 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 });
3102
- 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] });
3103
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosComponent, decorators: [{
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: [{
3104
2935
  type: Component,
3105
- 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"] }]
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"] }]
3106
2937
  }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
3107
2938
 
3108
2939
  class MoverGrupoDialogComponent {
@@ -3270,7 +3101,7 @@ class ProdutosGruposComponent {
3270
3101
  const item = this.selectedItem;
3271
3102
  if (!item)
3272
3103
  return;
3273
- const valMsg = valida(item, this.focus);
3104
+ const valMsg = validaProdutoGrupo(item, this.focus);
3274
3105
  if (valMsg) {
3275
3106
  this.notification.showMsgError(valMsg);
3276
3107
  return;
@@ -3425,7 +3256,7 @@ class ProdutosSubgruposComponent {
3425
3256
  salvar() {
3426
3257
  if (!this.selectedItem)
3427
3258
  return;
3428
- const valMsg = valida(this.selectedItem, this.focus);
3259
+ const valMsg = validaProdutoGrupo(this.selectedItem, this.focus);
3429
3260
  if (valMsg) {
3430
3261
  this.notification.showMsgError(valMsg);
3431
3262
  return;
@@ -3441,146 +3272,315 @@ class ProdutosSubgruposComponent {
3441
3272
  });
3442
3273
  }
3443
3274
  }
3444
- 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 });
3445
- 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] });
3446
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosSubgruposComponent, 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: [{
3278
+ type: Component,
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 }]; } });
3281
+
3282
+ class ImageViewerComponent {
3283
+ constructor() {
3284
+ this.infos = [];
3285
+ this._isOpen = false;
3286
+ this.paginaAtual = 0;
3287
+ this.disableBack = false;
3288
+ this.disableNext = false;
3289
+ this.isOpenChange = new EventEmitter();
3290
+ }
3291
+ get isOpen() {
3292
+ return this._isOpen;
3293
+ }
3294
+ set isOpen(val) {
3295
+ this._isOpen = val;
3296
+ this.isOpenChange.emit(val);
3297
+ }
3298
+ onClick(e) {
3299
+ //this.isOpen = !this.isOpen;
3300
+ }
3301
+ ngOnInit() {
3302
+ }
3303
+ open(info, infos) {
3304
+ if (infos !== undefined) {
3305
+ for (let i = 0; i < infos.length; i++) {
3306
+ if (infos[i] === info) {
3307
+ this.paginaAtual = i + 1;
3308
+ break;
3309
+ }
3310
+ }
3311
+ }
3312
+ this.info = info;
3313
+ this.infos = infos;
3314
+ this.isOpen = true;
3315
+ this.updateUI();
3316
+ }
3317
+ goNext() {
3318
+ this.paginaAtual += 1;
3319
+ this.info = this.infos[this.paginaAtual - 1];
3320
+ this.updateUI();
3321
+ }
3322
+ goBack() {
3323
+ this.paginaAtual -= 1;
3324
+ this.info = this.infos[this.paginaAtual - 1];
3325
+ this.updateUI();
3326
+ }
3327
+ updateUI() {
3328
+ this.disableBack = this.paginaAtual == 1;
3329
+ this.disableNext = this.paginaAtual == this.infos.length;
3330
+ }
3331
+ }
3332
+ ImageViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ImageViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
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"] }] });
3334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ImageViewerComponent, decorators: [{
3335
+ type: Component,
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"] }]
3337
+ }], ctorParameters: function () { return []; }, propDecorators: { info: [{
3338
+ type: Input
3339
+ }], infos: [{
3340
+ type: Input
3341
+ }], isOpenChange: [{
3342
+ type: Output
3343
+ }], isOpen: [{
3344
+ type: Input
3345
+ }], onClick: [{
3346
+ type: HostListener,
3347
+ args: ['click', ['$event']]
3348
+ }] } });
3349
+
3350
+ class MonthYearPickerComponent {
3351
+ constructor() {
3352
+ this.anoChange = new EventEmitter();
3353
+ this.mesChange = new EventEmitter();
3354
+ this.changed = new EventEmitter();
3355
+ this._init = false;
3356
+ this._modoAnual = false;
3357
+ this._meses = ["JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO"];
3358
+ this.text = '';
3359
+ this.disableNext = false;
3360
+ this.blockFuture = false;
3361
+ let d = new Date();
3362
+ this._ano = d.getFullYear();
3363
+ this._mes = d.getMonth() + 1;
3364
+ }
3365
+ get modoAnual() {
3366
+ return this._modoAnual;
3367
+ }
3368
+ set modoAnual(val) {
3369
+ this._modoAnual = val;
3370
+ if (!this._init)
3371
+ return;
3372
+ this.updateText();
3373
+ this.raiseOnSelectionChanged();
3374
+ }
3375
+ get ano() {
3376
+ return this._ano;
3377
+ }
3378
+ set ano(val) {
3379
+ this._ano = val;
3380
+ if (!this._init)
3381
+ return;
3382
+ this.anoChange.emit(val);
3383
+ this.updateText();
3384
+ }
3385
+ get mes() {
3386
+ return this._mes;
3387
+ }
3388
+ set mes(val) {
3389
+ this._mes = val;
3390
+ if (!this._init)
3391
+ return;
3392
+ this.mesChange.emit(val);
3393
+ this.updateText();
3394
+ }
3395
+ ngOnInit() {
3396
+ this.updateText();
3397
+ this._init = true;
3398
+ }
3399
+ goBack() {
3400
+ if (this.modoAnual) {
3401
+ this.ano -= 1;
3402
+ }
3403
+ else {
3404
+ this.mes--;
3405
+ if (this.mes < 1) {
3406
+ this.ano -= 1;
3407
+ this.mes = 12;
3408
+ }
3409
+ }
3410
+ this.updateText();
3411
+ this.raiseOnSelectionChanged();
3412
+ }
3413
+ ;
3414
+ goNext() {
3415
+ if (this.modoAnual) {
3416
+ this.ano += 1;
3417
+ }
3418
+ else {
3419
+ this.mes++;
3420
+ if (this.mes > 12) {
3421
+ this.ano += 1;
3422
+ this.mes = 1;
3423
+ }
3424
+ }
3425
+ this.updateText();
3426
+ this.raiseOnSelectionChanged();
3427
+ }
3428
+ ;
3429
+ updateText() {
3430
+ if (this.modoAnual)
3431
+ this.text = '' + this._ano;
3432
+ else
3433
+ this.text = this._meses[this._mes - 1] + " DE " + this._ano;
3434
+ if (!this.blockFuture)
3435
+ return;
3436
+ let d = new Date();
3437
+ let ano = d.getFullYear();
3438
+ let mes = d.getMonth() + 1;
3439
+ if (!this.modoAnual)
3440
+ this.disableNext = ano == this.ano && this.mes >= mes;
3441
+ else
3442
+ this.disableNext = ano == this.ano;
3443
+ }
3444
+ ;
3445
+ raiseOnSelectionChanged() {
3446
+ let d = { ano: this._ano, mes: this._mes };
3447
+ this.changed.emit(d);
3448
+ }
3449
+ }
3450
+ MonthYearPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MonthYearPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
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"] }] });
3452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MonthYearPickerComponent, decorators: [{
3447
3453
  type: Component,
3448
- 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"] }]
3449
- }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
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"] }]
3455
+ }], ctorParameters: function () { return []; }, propDecorators: { anoChange: [{
3456
+ type: Output
3457
+ }], mesChange: [{
3458
+ type: Output
3459
+ }], changed: [{
3460
+ type: Output
3461
+ }], blockFuture: [{
3462
+ type: Input
3463
+ }], modoAnual: [{
3464
+ type: Input
3465
+ }], ano: [{
3466
+ type: Input
3467
+ }], mes: [{
3468
+ type: Input
3469
+ }] } });
3450
3470
 
3451
- class ProdutosCategoriasCardapioComponent {
3452
- constructor(ws, notification, dialog, auth, screenHelper) {
3453
- this.ws = ws;
3454
- this.notification = notification;
3455
- this.dialog = dialog;
3456
- this.screenHelper = screenHelper;
3457
- this.isBusy = false;
3458
- this.items = [];
3459
- this.selectedItem = null;
3460
- this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
3461
- this.setting = new SearchSetting();
3462
- this.focus = new FocusService();
3463
- this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
3464
- this.allowExcluir = auth.permissoes.adminProdutoGrupoDelete;
3465
- this.mobile = this.screenHelper.isMedium;
3466
- this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
3471
+ class NumericPickerComponent {
3472
+ constructor() {
3473
+ this.valueChange = new EventEmitter();
3474
+ this.change = new EventEmitter();
3475
+ this._value = 0;
3476
+ this._max = 0;
3477
+ this._min = 0;
3478
+ this.text = '';
3479
+ this.disableNext = false;
3480
+ this.disableBack = false;
3467
3481
  }
3468
- ngOnInit() {
3469
- this.setting.ordem = "nome";
3470
- this.atualiza();
3482
+ get value() {
3483
+ return this._value;
3471
3484
  }
3472
- onSelectItem() {
3473
- if (!this.focus.hasInit()) {
3474
- setTimeout(() => {
3475
- this.focus.registerElementById("form-column");
3476
- this.focus.setFirst();
3477
- }, 500);
3478
- //this._focus.registerElementById("form-column");
3479
- }
3480
- else {
3481
- this.focus.setFirst();
3482
- }
3485
+ set value(val) {
3486
+ this._value = val;
3487
+ this.valueChange.emit(val);
3488
+ this.refreshUI();
3483
3489
  }
3484
- ngOnDestroy() {
3485
- this.focus.unregisterElementById("form-column");
3490
+ get max() {
3491
+ return this._max;
3486
3492
  }
3487
- atualiza() {
3488
- this.isBusy = true;
3489
- this.ws.buscaProdutoCategoriaCardapio(this.setting)
3490
- .subscribe(r => {
3491
- this.items = r;
3492
- this.selectedItem = null;
3493
- console.info(r);
3494
- this.isBusy = false;
3495
- }, err => {
3496
- this.isBusy = false;
3497
- this.notification.showHttpError(err);
3498
- });
3493
+ set max(val) {
3494
+ this._max = val;
3495
+ this.refreshUI();
3499
3496
  }
3500
- excluir() {
3501
- const item = this.selectedItem;
3502
- if (!item)
3503
- return;
3504
- confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do grupo ${item.nome}?`, () => {
3505
- this.isBusy = true;
3506
- this.ws.deleteProdutoCategoriaCardapio(item.id)
3507
- .subscribe(r => {
3508
- this.notification.showMsg("O grupo foi excluído com sucesso.");
3509
- this.items.remove(item);
3510
- this.selectedItem = null;
3511
- this.isBusy = false;
3512
- }, err => {
3513
- this.isBusy = false;
3514
- this.notification.showMsg(err.error);
3515
- });
3516
- });
3497
+ get min() {
3498
+ return this._min;
3517
3499
  }
3518
- novo() {
3519
- let height = (window.innerHeight * 0.90) + 'px';
3520
- let width = 550 + 'px';
3521
- if (this.mobile) {
3522
- width = (window.innerWidth * 0.99) + 'px';
3523
- //height = (window.innerHeight * 0.98) + 'px';
3524
- }
3525
- const dialog = this.dialog.open(ProdutoCategoriaCardapioAddDialogComponent, {
3526
- width: width,
3527
- //height: height,
3528
- maxWidth: '100%',
3529
- panelClass: 'dialog-p0',
3530
- });
3531
- dialog.afterClosed().subscribe(result => {
3532
- if (result === undefined)
3533
- return;
3534
- this.notification.showMsg("Salvo com sucesso.");
3535
- this.atualiza();
3536
- });
3500
+ set min(val) {
3501
+ this._min = Number(val);
3502
+ this.refreshUI();
3537
3503
  }
3538
- abreCadastro(item) {
3539
- let height = undefined;
3540
- let width = 550 + 'px';
3541
- if (this.mobile) {
3542
- width = (window.innerWidth * 0.99) + 'px';
3543
- height = (window.innerHeight * 0.99) + 'px';
3504
+ ngOnInit() {
3505
+ }
3506
+ onTextEdit(ev) {
3507
+ console.info(ev);
3508
+ const i = Number(ev.target.value);
3509
+ if (!this.valida(i))
3510
+ this.text = '' + this.value;
3511
+ else {
3512
+ this.value = i;
3513
+ this.raiseChange();
3514
+ this.refreshUI();
3544
3515
  }
3545
- const dialog = this.dialog.open(ProdutoCategoriaCardapioEditDialogComponent, {
3546
- data: item,
3547
- width: width,
3548
- //height: height,
3549
- maxWidth: '100%',
3550
- panelClass: 'dialog-p0',
3551
- });
3552
- dialog.afterClosed().subscribe(result => {
3553
- if (result !== true)
3554
- return;
3555
- this.notification.showMsg("Salvo com sucesso.");
3556
- this.atualiza();
3557
- });
3558
3516
  }
3559
- salvar() {
3560
- if (!this.selectedItem)
3517
+ goBack() {
3518
+ const newVal = this.value - 1;
3519
+ if (!this.valida(newVal))
3561
3520
  return;
3562
- const valMsg = valida(this.selectedItem, this.focus);
3563
- if (valMsg) {
3564
- this.notification.showMsgError(valMsg);
3521
+ this.value = newVal;
3522
+ this.raiseChange();
3523
+ }
3524
+ ;
3525
+ goNext() {
3526
+ const newVal = this.value + 1;
3527
+ if (!this.valida(newVal))
3565
3528
  return;
3566
- }
3567
- this.isBusy = true;
3568
- this.ws.saveProdutoCategoriaCardapio(this.selectedItem)
3569
- .subscribe(r => {
3570
- this.notification.showMsg("Salvo com sucesso.");
3571
- this.isBusy = false;
3572
- }, err => {
3573
- this.isBusy = false;
3574
- this.notification.showMsg(err.error);
3575
- });
3529
+ this.value = newVal;
3530
+ this.raiseChange();
3531
+ }
3532
+ ;
3533
+ refreshUI() {
3534
+ this.text = this.value === undefined ? '--' : '' + this.value;
3535
+ this.disableNext = this.max !== undefined && this.value === this.max;
3536
+ this.disableBack = this.min !== undefined && this.value === this.min;
3537
+ }
3538
+ valida(val) {
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;
3546
+ }
3547
+ raiseChange() {
3548
+ this.change.emit(this.value);
3576
3549
  }
3577
3550
  }
3578
- 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 });
3579
- 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] });
3580
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosCategoriasCardapioComponent, 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: [{
3581
3554
  type: Component,
3582
- 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"] }]
3583
- }], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
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
+ }] } });
3567
+
3568
+ class SafeHtmlPipe {
3569
+ constructor(sanitizer) {
3570
+ this.sanitizer = sanitizer;
3571
+ }
3572
+ transform(html) {
3573
+ return this.sanitizer.bypassSecurityTrustHtml(html);
3574
+ }
3575
+ }
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 });
3577
+ SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
3578
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, decorators: [{
3579
+ type: Pipe,
3580
+ args: [{
3581
+ name: 'safeHtml'
3582
+ }]
3583
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
3584
3584
 
3585
3585
  Array.prototype.remove = function (item) {
3586
3586
  const index = this.indexOf(item);
@@ -3919,5 +3919,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
3919
3919
  * Generated bundle index. Do not edit.
3920
3920
  */
3921
3921
 
3922
- export { AlertDialogComponent, AuthDataService, BusyIndicatorComponent, BusyState, CheckButtonComponent, CommonWebService, ConsumoProdutoSearchSetting, DuplicataSearchSetting, ExportFileService, FocusService, FuncionarioAddDialogComponent, FuncionarioEditDialogComponent, FuncionarioFormComponent, FuncionariosComponent, ImageViewerComponent, ItemCardComponent, LazyTrigger, MonthYearPickerComponent, NavegacaoSelecaoDialogUtil, NotificationService, 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 };
3923
3923
  //# sourceMappingURL=oxpi-nglib.mjs.map