oxpi-nglib 1.0.70 → 1.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/cadastros/produtos/produto-edit-dialog/produto-edit-dialog.component.mjs +3 -3
- package/esm2020/lib/cadastros/produtos-history/produtos-history.component.mjs +76 -0
- package/esm2020/lib/models/entidades/produto.mjs +3 -1
- package/esm2020/lib/oxpi-nglib.module.mjs +6 -3
- package/esm2020/lib/providers/common-web-service.mjs +5 -1
- package/fesm2015/oxpi-nglib.mjs +79 -4
- package/fesm2015/oxpi-nglib.mjs.map +1 -1
- package/fesm2020/oxpi-nglib.mjs +77 -4
- package/fesm2020/oxpi-nglib.mjs.map +1 -1
- package/lib/cadastros/produtos-history/produtos-history.component.d.ts +26 -0
- package/lib/models/entidades/produto.d.ts +3 -0
- package/lib/oxpi-nglib.module.d.ts +11 -10
- package/lib/providers/common-web-service.d.ts +1 -0
- package/package.json +1 -1
package/fesm2020/oxpi-nglib.mjs
CHANGED
|
@@ -234,6 +234,10 @@ class CommonWebService {
|
|
|
234
234
|
const url = this.PRODUTO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
|
|
235
235
|
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
236
236
|
}
|
|
237
|
+
getProdutoHistory(id) {
|
|
238
|
+
const url = this.PRODUTO_BASE_URL + 'GetHistory/' + id;
|
|
239
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
240
|
+
}
|
|
237
241
|
findProduto(produtoId) {
|
|
238
242
|
const url = this.PRODUTO_BASE_URL + produtoId;
|
|
239
243
|
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
@@ -1444,6 +1448,8 @@ function createProduct() {
|
|
|
1444
1448
|
adicionalDeProdutoId: null,
|
|
1445
1449
|
produtoVerificaoGrupoId: null,
|
|
1446
1450
|
produtoVerificaoGrupoNome: null,
|
|
1451
|
+
startTime: undefined,
|
|
1452
|
+
endTime: undefined
|
|
1447
1453
|
};
|
|
1448
1454
|
}
|
|
1449
1455
|
;
|
|
@@ -3000,10 +3006,10 @@ class ProdutoEditDialogComponent {
|
|
|
3000
3006
|
}
|
|
3001
3007
|
}
|
|
3002
3008
|
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 });
|
|
3003
|
-
ProdutoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoEditDialogComponent, selector: "ox-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 <ox-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></ox-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$2.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: "ox-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }] });
|
|
3009
|
+
ProdutoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoEditDialogComponent, selector: "ox-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 <ox-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></ox-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button *ngIf=\"model?.isHistorico !== true\" 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$2.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: "ox-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }] });
|
|
3004
3010
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoEditDialogComponent, decorators: [{
|
|
3005
3011
|
type: Component,
|
|
3006
|
-
args: [{ selector: 'ox-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 <ox-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></ox-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"] }]
|
|
3012
|
+
args: [{ selector: 'ox-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 <ox-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></ox-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button *ngIf=\"model?.isHistorico !== true\" 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"] }]
|
|
3007
3013
|
}], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
3008
3014
|
type: Inject,
|
|
3009
3015
|
args: [MAT_DIALOG_DATA]
|
|
@@ -5291,6 +5297,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
|
|
|
5291
5297
|
}]
|
|
5292
5298
|
}], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
|
|
5293
5299
|
|
|
5300
|
+
class ProdutosHistoryComponent {
|
|
5301
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
5302
|
+
this.ws = ws;
|
|
5303
|
+
this.notification = notification;
|
|
5304
|
+
this.dataDialog = dataDialog;
|
|
5305
|
+
this.dialog = dialog;
|
|
5306
|
+
this.elRef = elRef;
|
|
5307
|
+
this.dialogRef = dialogRef;
|
|
5308
|
+
this.screenHelper = screenHelper;
|
|
5309
|
+
this.items = [];
|
|
5310
|
+
this.isBusy = false;
|
|
5311
|
+
this.model = dataDialog;
|
|
5312
|
+
}
|
|
5313
|
+
ngOnInit() {
|
|
5314
|
+
this.atualiza();
|
|
5315
|
+
}
|
|
5316
|
+
atualiza() {
|
|
5317
|
+
this.isBusy = true;
|
|
5318
|
+
this.ws.getProdutoHistory(this.model.id)
|
|
5319
|
+
.subscribe({
|
|
5320
|
+
next: r => {
|
|
5321
|
+
for (const p of r) {
|
|
5322
|
+
p.isHistorico = true;
|
|
5323
|
+
}
|
|
5324
|
+
this.items = r;
|
|
5325
|
+
console.info(r);
|
|
5326
|
+
this.isBusy = false;
|
|
5327
|
+
}, error: err => {
|
|
5328
|
+
this.isBusy = false;
|
|
5329
|
+
this.notification.showHttpError(err);
|
|
5330
|
+
}
|
|
5331
|
+
});
|
|
5332
|
+
}
|
|
5333
|
+
abreCadastro(item) {
|
|
5334
|
+
let height = undefined;
|
|
5335
|
+
let width = 550 + 'px';
|
|
5336
|
+
if (this.mobile) {
|
|
5337
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
5338
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
5339
|
+
}
|
|
5340
|
+
const dialog = this.dialog.open(ProdutoEditDialogComponent, {
|
|
5341
|
+
data: item,
|
|
5342
|
+
width: width,
|
|
5343
|
+
height: height,
|
|
5344
|
+
maxWidth: '100%',
|
|
5345
|
+
panelClass: 'dialog-p0',
|
|
5346
|
+
});
|
|
5347
|
+
dialog.afterClosed().subscribe(result => {
|
|
5348
|
+
if (result !== true)
|
|
5349
|
+
return;
|
|
5350
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
5351
|
+
this.atualiza();
|
|
5352
|
+
});
|
|
5353
|
+
}
|
|
5354
|
+
}
|
|
5355
|
+
ProdutosHistoryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosHistoryComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5356
|
+
ProdutosHistoryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosHistoryComponent, selector: "lib-produtos-history", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Hist\u00F3rico do Produto '{{model.id}}'</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"reservas-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">Nenhum registro para ser exibido</h4>\n <div (click)=\"abreCadastro(item)\" class=\"historico-item\" *ngFor=\"let item of items\">\n <div class=\"historico-icon\">\n <i class=\"material-icons\">history</i>\n </div>\n <div class=\"historico-content\">\n <p class=\"historico-date\">{{ item.startTime | date:'EEE dd/MM/yy HH:mm' }} - {{ item.endTime | date:'EEE dd/MM/yy HH:mm' }}</p>\n <p class=\"historico-user\">{{ item.usuarioLogin }}</p>\n <p class=\"historico-modulo\">{{ item.modulo }}</p>\n </div>\n </div>\n </div>\n</div>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh;position:relative}.reservas-container{display:flex;flex-direction:column}.historico-item{display:flex;align-items:center;padding:10px;border-bottom:1px solid #ccc;font-family:Open Sans,sans-serif;background-color:#fff;cursor:pointer}.historico-item:hover{background-color:var(--item-card-selected-bg)}.historico-icon{font-size:24px;color:#39b7ab;margin-right:32px}.historico-content{flex:1;display:flex;flex-direction:column;gap:4px}.historico-date{margin:0;font-weight:500}.historico-user{margin:0;color:purple}.historico-modulo{margin:0;font-style:italic;color:#666;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: "component", type: i6$2.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: "pipe", type: i6.DatePipe, name: "date" }] });
|
|
5357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosHistoryComponent, decorators: [{
|
|
5358
|
+
type: Component,
|
|
5359
|
+
args: [{ selector: 'lib-produtos-history', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Hist\u00F3rico do Produto '{{model.id}}'</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"reservas-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">Nenhum registro para ser exibido</h4>\n <div (click)=\"abreCadastro(item)\" class=\"historico-item\" *ngFor=\"let item of items\">\n <div class=\"historico-icon\">\n <i class=\"material-icons\">history</i>\n </div>\n <div class=\"historico-content\">\n <p class=\"historico-date\">{{ item.startTime | date:'EEE dd/MM/yy HH:mm' }} - {{ item.endTime | date:'EEE dd/MM/yy HH:mm' }}</p>\n <p class=\"historico-user\">{{ item.usuarioLogin }}</p>\n <p class=\"historico-modulo\">{{ item.modulo }}</p>\n </div>\n </div>\n </div>\n</div>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh;position:relative}.reservas-container{display:flex;flex-direction:column}.historico-item{display:flex;align-items:center;padding:10px;border-bottom:1px solid #ccc;font-family:Open Sans,sans-serif;background-color:#fff;cursor:pointer}.historico-item:hover{background-color:var(--item-card-selected-bg)}.historico-icon{font-size:24px;color:#39b7ab;margin-right:32px}.historico-content{flex:1;display:flex;flex-direction:column;gap:4px}.historico-date{margin:0;font-weight:500}.historico-user{margin:0;color:purple}.historico-modulo{margin:0;font-style:italic;color:#666;font-size:small}\n"] }]
|
|
5360
|
+
}], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
5361
|
+
type: Inject,
|
|
5362
|
+
args: [MAT_DIALOG_DATA]
|
|
5363
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }]; } });
|
|
5364
|
+
|
|
5294
5365
|
Array.prototype.remove = function (item) {
|
|
5295
5366
|
const index = this.indexOf(item);
|
|
5296
5367
|
if (index === -1)
|
|
@@ -5361,7 +5432,8 @@ OxpiNglibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
|
|
|
5361
5432
|
FornecedoresComponent,
|
|
5362
5433
|
FornecedoresAddDialogComponent,
|
|
5363
5434
|
FornecedoresEditDialogComponent,
|
|
5364
|
-
SelecaoFornecedorDialogComponent
|
|
5435
|
+
SelecaoFornecedorDialogComponent,
|
|
5436
|
+
ProdutosHistoryComponent], imports: [BrowserModule,
|
|
5365
5437
|
BrowserAnimationsModule,
|
|
5366
5438
|
FormsModule,
|
|
5367
5439
|
MatButtonModule,
|
|
@@ -5441,7 +5513,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
|
|
|
5441
5513
|
FornecedoresComponent,
|
|
5442
5514
|
FornecedoresAddDialogComponent,
|
|
5443
5515
|
FornecedoresEditDialogComponent,
|
|
5444
|
-
SelecaoFornecedorDialogComponent
|
|
5516
|
+
SelecaoFornecedorDialogComponent,
|
|
5517
|
+
ProdutosHistoryComponent
|
|
5445
5518
|
],
|
|
5446
5519
|
imports: [
|
|
5447
5520
|
BrowserModule,
|