techlify-inventory-common 18.19.0 → 18.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/inventory-common/inventory-common-routing.module.mjs +7 -2
- package/esm2022/lib/inventory-common/location/location-routing.module.mjs +12 -3
- package/esm2022/lib/inventory-common/location/shelf/shelf-delete-button/shelf-delete-button.component.mjs +60 -0
- package/esm2022/lib/inventory-common/location/shelf/shelf-form/shelf-form.component.mjs +88 -0
- package/esm2022/lib/inventory-common/location/shelf/shelf-form-button/shelf-form-button.component.mjs +35 -0
- package/esm2022/lib/inventory-common/location/shelf/shelf-list/shelf-list.component.mjs +106 -0
- package/esm2022/lib/inventory-common/location/shelf/shelf-routing.module.mjs +24 -0
- package/esm2022/lib/inventory-common/location/shelf/shelf.module.mjs +22 -0
- package/esm2022/lib/inventory-common/location/shelf/shelf.service.mjs +20 -0
- package/esm2022/lib/inventory-common/product/product-search/product-search.component.mjs +8 -5
- package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.mjs +3 -3
- package/esm2022/lib/inventory-common/product/product-view-page/product-view-page.component.mjs +3 -3
- package/esm2022/lib/inventory-common/product/product.module.mjs +4 -2
- package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.mjs +20 -7
- package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.mjs +33 -5
- package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.mjs +7 -4
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.mjs +13 -3
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.mjs +8 -5
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-view/stock-receipt-view.component.mjs +56 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.mjs +32 -13
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-routing.module.mjs +6 -1
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts.module.mjs +13 -6
- package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-form/stock-transfer-form.component.mjs +7 -5
- package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-list/stock-transfer-list.component.mjs +56 -15
- package/esm2022/lib/inventory-common/supplier/supplier-information/supplier-information.component.mjs +1 -1
- package/esm2022/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.mjs +1 -1
- package/esm2022/public-api.mjs +32 -1
- package/fesm2022/{techlify-inventory-common-category.module-B4CGfj58.mjs → techlify-inventory-common-category.module-Dw7cV-28.mjs} +7 -7
- package/fesm2022/{techlify-inventory-common-category.module-B4CGfj58.mjs.map → techlify-inventory-common-category.module-Dw7cV-28.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-measure.module-DymSMJIU.mjs → techlify-inventory-common-measure.module-BvuwOooQ.mjs} +5 -5
- package/fesm2022/{techlify-inventory-common-measure.module-DymSMJIU.mjs.map → techlify-inventory-common-measure.module-BvuwOooQ.mjs.map} +1 -1
- package/fesm2022/techlify-inventory-common.mjs +6228 -1
- package/fesm2022/techlify-inventory-common.mjs.map +1 -1
- package/lib/inventory-common/location/shelf/shelf-delete-button/shelf-delete-button.component.d.ts +20 -0
- package/lib/inventory-common/location/shelf/shelf-form/shelf-form.component.d.ts +19 -0
- package/lib/inventory-common/location/shelf/shelf-form-button/shelf-form-button.component.d.ts +13 -0
- package/lib/inventory-common/location/shelf/shelf-list/shelf-list.component.d.ts +20 -0
- package/lib/inventory-common/location/shelf/shelf-routing.module.d.ts +7 -0
- package/lib/inventory-common/location/shelf/shelf.module.d.ts +8 -0
- package/lib/inventory-common/location/shelf/shelf.service.d.ts +8 -0
- package/lib/inventory-common/product/product-search/product-search.component.d.ts +2 -1
- package/lib/inventory-common/product/product.module.d.ts +1 -1
- package/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.d.ts +4 -2
- package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.d.ts +4 -1
- package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.d.ts +1 -1
- package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.d.ts +1 -1
- package/lib/inventory-common/stock-receipts/stock-receipt-view/stock-receipt-view.component.d.ts +19 -0
- package/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.d.ts +7 -3
- package/lib/inventory-common/stock-receipts/stock-receipts.module.d.ts +15 -14
- package/lib/inventory-common/stock-transfer/stock-transfer-list/stock-transfer-list.component.d.ts +8 -2
- package/package.json +1 -1
- package/public-api.d.ts +31 -0
- package/fesm2022/techlify-inventory-common-location.module-NaTWwOXZ.mjs +0 -572
- package/fesm2022/techlify-inventory-common-location.module-NaTWwOXZ.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-BYBEwInz.mjs +0 -5193
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-BYBEwInz.mjs.map +0 -1
|
@@ -1,572 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, Component, NgModule } from '@angular/core';
|
|
3
|
-
import * as i5 from '@angular/common';
|
|
4
|
-
import { NgIf, CommonModule } from '@angular/common';
|
|
5
|
-
import * as i4 from '@angular/router';
|
|
6
|
-
import { RouterLink, RouterModule } from '@angular/router';
|
|
7
|
-
import { MatCard, MatCardContent } from '@angular/material/card';
|
|
8
|
-
import * as i1 from 'ngx-techlify-core';
|
|
9
|
-
import { TechlifyFormComponentInterface, SearchableSelectorModule, TechlifyListingControllerInterface } from 'ngx-techlify-core';
|
|
10
|
-
import * as i2 from '@angular/forms';
|
|
11
|
-
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
12
|
-
import { debounceTime, distinctUntilChanged } from 'rxjs';
|
|
13
|
-
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
|
14
|
-
import { InfiniteScrollDirective } from 'ngx-infinite-scroll';
|
|
15
|
-
import { MatCell, MatCellDef, MatColumnDef, MatHeaderCell, MatHeaderRow, MatHeaderRowDef, MatRow, MatRowDef, MatTable, MatHeaderCellDef } from '@angular/material/table';
|
|
16
|
-
import * as i8 from '@angular/material/form-field';
|
|
17
|
-
import { MatError, MatFormField, MatLabel } from '@angular/material/form-field';
|
|
18
|
-
import { MatInput } from '@angular/material/input';
|
|
19
|
-
import { MatProgressBar } from '@angular/material/progress-bar';
|
|
20
|
-
import * as i1$1 from '@angular/material/dialog';
|
|
21
|
-
import { MatDialogContent, MatDialogTitle, MatDialogActions, MatDialogClose } from '@angular/material/dialog';
|
|
22
|
-
import { MatButton } from '@angular/material/button';
|
|
23
|
-
import { L as LocationService, M as MaterialModule, P as ProductModule, a as ProductCategoryBadgesComponent, S as StockTransferFormButtonComponent } from './techlify-inventory-common-techlify-inventory-common-BYBEwInz.mjs';
|
|
24
|
-
import { MatIcon } from '@angular/material/icon';
|
|
25
|
-
import { MatDivider } from '@angular/material/divider';
|
|
26
|
-
|
|
27
|
-
class LocationFormComponent extends TechlifyFormComponentInterface {
|
|
28
|
-
formBuilder;
|
|
29
|
-
alertService;
|
|
30
|
-
service;
|
|
31
|
-
model;
|
|
32
|
-
saved = new EventEmitter();
|
|
33
|
-
cancelled = new EventEmitter();
|
|
34
|
-
isSaving;
|
|
35
|
-
constructor(formValidatorService, formBuilder, alertService, service) {
|
|
36
|
-
super(formValidatorService);
|
|
37
|
-
this.formBuilder = formBuilder;
|
|
38
|
-
this.alertService = alertService;
|
|
39
|
-
this.service = service;
|
|
40
|
-
this.errorMessages = {
|
|
41
|
-
title: {
|
|
42
|
-
required: 'The title field is required.'
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
this.form = this.formBuilder.group({
|
|
46
|
-
id: [''],
|
|
47
|
-
title: ['', Validators.required],
|
|
48
|
-
address: [''],
|
|
49
|
-
description: [''],
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
ngOnInit() {
|
|
53
|
-
if (this.model) {
|
|
54
|
-
this.form.patchValue({ ...this.model });
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
save() {
|
|
58
|
-
this.form.markAllAsTouched();
|
|
59
|
-
if (this.form.invalid) {
|
|
60
|
-
this.alertService.addAlert('Please check the form for errors.', 'error');
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const data = this.form.value;
|
|
64
|
-
this.isSaving = true;
|
|
65
|
-
let request = this.service.store(data);
|
|
66
|
-
if (data?.id) {
|
|
67
|
-
request = this.service.update(data);
|
|
68
|
-
}
|
|
69
|
-
request.subscribe({
|
|
70
|
-
next: (response) => {
|
|
71
|
-
this.isSaving = false;
|
|
72
|
-
this.saved.emit(response?.item);
|
|
73
|
-
this.alertService.addAlert('The location saved successfully!', 'success');
|
|
74
|
-
},
|
|
75
|
-
error: () => (this.isSaving = false)
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationFormComponent, deps: [{ token: i1.FormValidatorService }, { token: i2.FormBuilder }, { token: i1.AlertService }, { token: LocationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
79
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LocationFormComponent, isStandalone: true, selector: "app-location-form", inputs: { model: "model" }, outputs: { saved: "saved", cancelled: "cancelled" }, usesInheritance: true, ngImport: i0, template: "<form\n [formGroup]=\"form\"\n (submit)=\"save()\"\n class=\"d-flex flex-column gap-1\"\n>\n <mat-form-field>\n <mat-label>Title</mat-label>\n <input type=\"text\" matInput formControlName=\"title\" placeholder=\"Title\">\n <mat-error *ngIf=\"isFieldValid('title')\">\n {{ getErrorMessage('title') }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Address</mat-label>\n <input type=\"text\" matInput formControlName=\"address\" placeholder=\"Address\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Description</mat-label>\n <textarea matInput formControlName=\"description\" placeholder=\"Description\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2\">\n <button [disabled]=\"isSaving\" type=\"submit\" mat-raised-button color=\"primary\">\n Save\n </button>\n <button (click)=\"cancelled.emit()\" [disabled]=\"isSaving\" type=\"button\" mat-flat-button>\n Cancel\n </button>\n </div>\n</form>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: SearchableSelectorModule }], preserveWhitespaces: true });
|
|
80
|
-
}
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationFormComponent, decorators: [{
|
|
82
|
-
type: Component,
|
|
83
|
-
args: [{ selector: 'app-location-form', standalone: true, imports: [
|
|
84
|
-
FormsModule,
|
|
85
|
-
MatButton,
|
|
86
|
-
MatError,
|
|
87
|
-
MatFormField,
|
|
88
|
-
MatInput,
|
|
89
|
-
MatLabel,
|
|
90
|
-
NgIf,
|
|
91
|
-
ReactiveFormsModule,
|
|
92
|
-
SearchableSelectorModule
|
|
93
|
-
], template: "<form\n [formGroup]=\"form\"\n (submit)=\"save()\"\n class=\"d-flex flex-column gap-1\"\n>\n <mat-form-field>\n <mat-label>Title</mat-label>\n <input type=\"text\" matInput formControlName=\"title\" placeholder=\"Title\">\n <mat-error *ngIf=\"isFieldValid('title')\">\n {{ getErrorMessage('title') }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Address</mat-label>\n <input type=\"text\" matInput formControlName=\"address\" placeholder=\"Address\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Description</mat-label>\n <textarea matInput formControlName=\"description\" placeholder=\"Description\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2\">\n <button [disabled]=\"isSaving\" type=\"submit\" mat-raised-button color=\"primary\">\n Save\n </button>\n <button (click)=\"cancelled.emit()\" [disabled]=\"isSaving\" type=\"button\" mat-flat-button>\n Cancel\n </button>\n </div>\n</form>\n" }]
|
|
94
|
-
}], ctorParameters: () => [{ type: i1.FormValidatorService }, { type: i2.FormBuilder }, { type: i1.AlertService }, { type: LocationService }], propDecorators: { model: [{
|
|
95
|
-
type: Input
|
|
96
|
-
}], saved: [{
|
|
97
|
-
type: Output
|
|
98
|
-
}], cancelled: [{
|
|
99
|
-
type: Output
|
|
100
|
-
}] } });
|
|
101
|
-
|
|
102
|
-
class LocationFormButtonComponent {
|
|
103
|
-
matDialog;
|
|
104
|
-
model;
|
|
105
|
-
saved = new EventEmitter();
|
|
106
|
-
constructor(matDialog) {
|
|
107
|
-
this.matDialog = matDialog;
|
|
108
|
-
}
|
|
109
|
-
showForm(templateRef) {
|
|
110
|
-
this.matDialog.open(templateRef, { width: '400px' });
|
|
111
|
-
}
|
|
112
|
-
onSaved(model) {
|
|
113
|
-
this.matDialog.closeAll();
|
|
114
|
-
this.saved.emit(model);
|
|
115
|
-
}
|
|
116
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationFormButtonComponent, deps: [{ token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
117
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LocationFormButtonComponent, isStandalone: true, selector: "app-location-form-button", inputs: { model: "model" }, outputs: { saved: "saved" }, ngImport: i0, template: "<span\n class=\"material-symbols-outlined cursor-pointer\"\n (click)=\"showForm(formTemplate)\"\n>\n {{ model ? 'edit' : 'add' }}\n</span>\n\n<ng-template #formTemplate>\n <h3 mat-dialog-title>{{ model ? 'Edit' : 'Create' }} Location</h3>\n <app-location-form\n mat-dialog-content\n [model]=\"model\"\n (saved)=\"onSaved($event)\"\n (cancelled)=\"matDialog.closeAll()\"\n ></app-location-form>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: LocationFormComponent, selector: "app-location-form", inputs: ["model"], outputs: ["saved", "cancelled"] }], preserveWhitespaces: true });
|
|
118
|
-
}
|
|
119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationFormButtonComponent, decorators: [{
|
|
120
|
-
type: Component,
|
|
121
|
-
args: [{ selector: 'app-location-form-button', standalone: true, imports: [
|
|
122
|
-
MatDialogContent,
|
|
123
|
-
MatDialogTitle,
|
|
124
|
-
LocationFormComponent
|
|
125
|
-
], template: "<span\n class=\"material-symbols-outlined cursor-pointer\"\n (click)=\"showForm(formTemplate)\"\n>\n {{ model ? 'edit' : 'add' }}\n</span>\n\n<ng-template #formTemplate>\n <h3 mat-dialog-title>{{ model ? 'Edit' : 'Create' }} Location</h3>\n <app-location-form\n mat-dialog-content\n [model]=\"model\"\n (saved)=\"onSaved($event)\"\n (cancelled)=\"matDialog.closeAll()\"\n ></app-location-form>\n</ng-template>\n" }]
|
|
126
|
-
}], ctorParameters: () => [{ type: i1$1.MatDialog }], propDecorators: { model: [{
|
|
127
|
-
type: Input
|
|
128
|
-
}], saved: [{
|
|
129
|
-
type: Output
|
|
130
|
-
}] } });
|
|
131
|
-
|
|
132
|
-
class LocationDeleteButtonComponent {
|
|
133
|
-
matDialog;
|
|
134
|
-
service;
|
|
135
|
-
alertService;
|
|
136
|
-
credentialsService;
|
|
137
|
-
model;
|
|
138
|
-
deleted = new EventEmitter();
|
|
139
|
-
isDeleting;
|
|
140
|
-
user;
|
|
141
|
-
constructor(matDialog, service, alertService, credentialsService) {
|
|
142
|
-
this.matDialog = matDialog;
|
|
143
|
-
this.service = service;
|
|
144
|
-
this.alertService = alertService;
|
|
145
|
-
this.credentialsService = credentialsService;
|
|
146
|
-
this.user = this.credentialsService.credentials?.user;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Delete the product.
|
|
150
|
-
*/
|
|
151
|
-
delete() {
|
|
152
|
-
this.isDeleting = true;
|
|
153
|
-
this.service.delete(this.model).subscribe({
|
|
154
|
-
next: () => {
|
|
155
|
-
this.deleted.emit();
|
|
156
|
-
this.isDeleting = false;
|
|
157
|
-
this.matDialog.closeAll();
|
|
158
|
-
this.alertService.addAlert('Location deleted successfully!', 'success');
|
|
159
|
-
},
|
|
160
|
-
error: () => (this.isDeleting = false)
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Show delete product dialog.
|
|
165
|
-
*
|
|
166
|
-
* @param templateRef
|
|
167
|
-
*/
|
|
168
|
-
showDeleteDialog(templateRef) {
|
|
169
|
-
this.matDialog.open(templateRef, { width: '500px' });
|
|
170
|
-
}
|
|
171
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationDeleteButtonComponent, deps: [{ token: i1$1.MatDialog }, { token: LocationService }, { token: i1.AlertService }, { token: i1.CredentialsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
172
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LocationDeleteButtonComponent, isStandalone: true, selector: "app-location-delete-button", inputs: { model: "model" }, outputs: { deleted: "deleted" }, ngImport: i0, template: "<mat-icon\n *ngIf=\"model?.client_id === user?.client_id\"\n class=\"cursor-pointer text-dark\"\n (click)=\"showDeleteDialog(deleteConfirmDialog)\"\n>\n delete\n</mat-icon>\n\n<ng-template #deleteConfirmDialog>\n <h3 mat-dialog-title>Delete Location</h3>\n <div mat-dialog-content>\n Are you sure? You want to delete the location\n <strong>{{ model?.title }}</strong> ?\n </div>\n <div mat-dialog-actions class=\"d-flex justify-content-end gap-1 mb-2\">\n <button\n [disabled]=\"isDeleting\"\n type=\"button\"\n mat-raised-button\n color=\"warn\"\n (click)=\"delete()\"\n >\n Delete\n </button>\n <button\n [disabled]=\"isDeleting\"\n type=\"button\"\n mat-flat-button\n mat-dialog-close\n >\n Cancel\n </button>\n </div>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], preserveWhitespaces: true });
|
|
173
|
-
}
|
|
174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationDeleteButtonComponent, decorators: [{
|
|
175
|
-
type: Component,
|
|
176
|
-
args: [{ selector: 'app-location-delete-button', standalone: true, imports: [
|
|
177
|
-
MatButton,
|
|
178
|
-
MatDialogActions,
|
|
179
|
-
MatDialogClose,
|
|
180
|
-
MatDialogContent,
|
|
181
|
-
MatDialogTitle,
|
|
182
|
-
MatIcon,
|
|
183
|
-
NgIf
|
|
184
|
-
], template: "<mat-icon\n *ngIf=\"model?.client_id === user?.client_id\"\n class=\"cursor-pointer text-dark\"\n (click)=\"showDeleteDialog(deleteConfirmDialog)\"\n>\n delete\n</mat-icon>\n\n<ng-template #deleteConfirmDialog>\n <h3 mat-dialog-title>Delete Location</h3>\n <div mat-dialog-content>\n Are you sure? You want to delete the location\n <strong>{{ model?.title }}</strong> ?\n </div>\n <div mat-dialog-actions class=\"d-flex justify-content-end gap-1 mb-2\">\n <button\n [disabled]=\"isDeleting\"\n type=\"button\"\n mat-raised-button\n color=\"warn\"\n (click)=\"delete()\"\n >\n Delete\n </button>\n <button\n [disabled]=\"isDeleting\"\n type=\"button\"\n mat-flat-button\n mat-dialog-close\n >\n Cancel\n </button>\n </div>\n</ng-template>\n" }]
|
|
185
|
-
}], ctorParameters: () => [{ type: i1$1.MatDialog }, { type: LocationService }, { type: i1.AlertService }, { type: i1.CredentialsService }], propDecorators: { model: [{
|
|
186
|
-
type: Input
|
|
187
|
-
}], deleted: [{
|
|
188
|
-
type: Output
|
|
189
|
-
}] } });
|
|
190
|
-
|
|
191
|
-
class LocationStatusChangerComponent extends TechlifyFormComponentInterface {
|
|
192
|
-
formValidatorService;
|
|
193
|
-
service;
|
|
194
|
-
fb;
|
|
195
|
-
alertService;
|
|
196
|
-
errorHandler;
|
|
197
|
-
location;
|
|
198
|
-
constructor(formValidatorService, service, fb, alertService, errorHandler) {
|
|
199
|
-
super(formValidatorService);
|
|
200
|
-
this.formValidatorService = formValidatorService;
|
|
201
|
-
this.service = service;
|
|
202
|
-
this.fb = fb;
|
|
203
|
-
this.alertService = alertService;
|
|
204
|
-
this.errorHandler = errorHandler;
|
|
205
|
-
this.form = this.fb.group({
|
|
206
|
-
id: [''],
|
|
207
|
-
status_id: ['']
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
ngOnInit() {
|
|
211
|
-
this.form.patchValue({
|
|
212
|
-
id: this.location.id,
|
|
213
|
-
status_id: this.location.status_id
|
|
214
|
-
});
|
|
215
|
-
this.form.valueChanges.subscribe({
|
|
216
|
-
next: () => {
|
|
217
|
-
this.save();
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
save() {
|
|
222
|
-
this.service.updateStatus(this.form.value).subscribe({
|
|
223
|
-
next: () => {
|
|
224
|
-
this.form.markAsPristine();
|
|
225
|
-
this.alertService.addAlert('Location status updated successfully!', 'success');
|
|
226
|
-
},
|
|
227
|
-
error: (error) => {
|
|
228
|
-
this.errorHandler.handleError(error);
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationStatusChangerComponent, deps: [{ token: i1.FormValidatorService }, { token: LocationService }, { token: i2.FormBuilder }, { token: i1.AlertService }, { token: i1.ErrorHandlerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
233
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LocationStatusChangerComponent, isStandalone: true, selector: "app-location-status-changer", inputs: { location: "location" }, usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"form\">\n <mat-form-field>\n <mat-label>Status</mat-label>\n <app-searchable-selector apiUrl=\"api/inventory-location-statuses\"\n formControlName=\"status_id\" [cache]=\"true\"></app-searchable-selector>\n </mat-form-field>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: SearchableSelectorModule }, { kind: "component", type: i1.SearchableSelectorComponent, selector: "app-searchable-selector", inputs: ["valueField", "titleField", "subtitleField", "apiUrl", "multiple", "selectedValue", "enableSearch", "add", "addConfig", "edit", "editConfig", "sort", "sortBy", "searchField", "itemComponent", "items", "apiDataProperty", "cache", "perPage", "inDataSearch", "panelWidth", "focusSearchOnOpen", "required", "disabled", "value"], outputs: ["selectedValueChange", "selectionChange", "itemsChange"] }], preserveWhitespaces: true });
|
|
234
|
-
}
|
|
235
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationStatusChangerComponent, decorators: [{
|
|
236
|
-
type: Component,
|
|
237
|
-
args: [{ selector: 'app-location-status-changer', standalone: true, imports: [
|
|
238
|
-
CommonModule,
|
|
239
|
-
MaterialModule,
|
|
240
|
-
ReactiveFormsModule,
|
|
241
|
-
SearchableSelectorModule
|
|
242
|
-
], template: "<form [formGroup]=\"form\">\n <mat-form-field>\n <mat-label>Status</mat-label>\n <app-searchable-selector apiUrl=\"api/inventory-location-statuses\"\n formControlName=\"status_id\" [cache]=\"true\"></app-searchable-selector>\n </mat-form-field>\n</form>" }]
|
|
243
|
-
}], ctorParameters: () => [{ type: i1.FormValidatorService }, { type: LocationService }, { type: i2.FormBuilder }, { type: i1.AlertService }, { type: i1.ErrorHandlerService }], propDecorators: { location: [{
|
|
244
|
-
type: Input
|
|
245
|
-
}] } });
|
|
246
|
-
|
|
247
|
-
class LocationListComponent extends TechlifyListingControllerInterface {
|
|
248
|
-
service;
|
|
249
|
-
formBuilder;
|
|
250
|
-
requestHelperService;
|
|
251
|
-
activatedRoute;
|
|
252
|
-
displayedColumns = [
|
|
253
|
-
'#',
|
|
254
|
-
'Title',
|
|
255
|
-
'Address',
|
|
256
|
-
'stock_receipts',
|
|
257
|
-
'stock_issues',
|
|
258
|
-
'Description',
|
|
259
|
-
'status',
|
|
260
|
-
'Actions',
|
|
261
|
-
];
|
|
262
|
-
constructor(service, formBuilder, requestHelperService, activatedRoute) {
|
|
263
|
-
super();
|
|
264
|
-
this.service = service;
|
|
265
|
-
this.formBuilder = formBuilder;
|
|
266
|
-
this.requestHelperService = requestHelperService;
|
|
267
|
-
this.activatedRoute = activatedRoute;
|
|
268
|
-
this.lastPage = 0;
|
|
269
|
-
this.filterForm = this.formBuilder.group({
|
|
270
|
-
search: [''],
|
|
271
|
-
sort_by: ['id|desc'],
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
ngOnInit() {
|
|
275
|
-
this.requestHelperService.updateFormWithQueryParams(this.filterForm, {});
|
|
276
|
-
this.filterForm.valueChanges.pipe(debounceTime(800)).subscribe({
|
|
277
|
-
next: () => {
|
|
278
|
-
this.requestHelperService.updateQueryParams(this.requestHelperService.convertToFormData(this.filterForm.value));
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
// listen for route change
|
|
282
|
-
this.activatedRoute.queryParams
|
|
283
|
-
.pipe(debounceTime(500), distinctUntilChanged())
|
|
284
|
-
.subscribe((val) => {
|
|
285
|
-
this.reload();
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
loadData() {
|
|
289
|
-
if (this.isWorking) {
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
const params = {
|
|
293
|
-
...this.requestHelperService.convertToFormData(this.filterForm.value),
|
|
294
|
-
page: this.page,
|
|
295
|
-
perPage: this.perPage,
|
|
296
|
-
with: 'status',
|
|
297
|
-
withCount: 'stockReceipts,stockIssues',
|
|
298
|
-
};
|
|
299
|
-
this.isWorking = true;
|
|
300
|
-
this.service.index(params).subscribe({
|
|
301
|
-
next: (response) => {
|
|
302
|
-
this.models = this.models?.concat(response?.data);
|
|
303
|
-
this.lastPage = response?.last_page;
|
|
304
|
-
this.isWorking = false;
|
|
305
|
-
},
|
|
306
|
-
error: () => (this.isWorking = false)
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
onSortChange(sort) {
|
|
310
|
-
let { active, direction } = sort;
|
|
311
|
-
if (!active)
|
|
312
|
-
active = 'id';
|
|
313
|
-
if (!direction)
|
|
314
|
-
direction = 'desc';
|
|
315
|
-
this.filterForm.get('sort_by')?.setValue(active + '|' + direction);
|
|
316
|
-
}
|
|
317
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationListComponent, deps: [{ token: LocationService }, { token: i2.FormBuilder }, { token: i1.RequestHelperService }, { token: i4.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
318
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LocationListComponent, isStandalone: true, selector: "app-location-list", usesInheritance: true, ngImport: i0, template: "<mat-card>\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-3\">\n <strong>Locations</strong>\n <app-location-form-button (saved)=\"modelCreated($event)\"></app-location-form-button>\n </div>\n <form class=\"d-flex justify-content-end align-items-center gap-2\" [formGroup]=\"filterForm\" (submit)=\"reload()\">\n <mat-form-field>\n <mat-label>Search</mat-label>\n <input type=\"text\" placeholder=\"Search locations\" matInput formControlName=\"search\">\n </mat-form-field>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card class=\"mt-3\">\n <mat-card-content class=\"p-0\">\n <table #table mat-table [dataSource]=\"models\" class=\"w-100\" infiniteScroll [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" [fromRoot]=\"true\" matSort\n (matSortChange)=\"onSortChange($event)\">\n\n <ng-container matColumnDef=\"#\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"Title\">\n <th mat-header-cell mat-sort-header=\"title\" *matHeaderCellDef> Title </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.title }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"Address\">\n <th mat-header-cell mat-sort-header=\"address\" *matHeaderCellDef> Address </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.address }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"stock_receipts\">\n <th mat-header-cell *matHeaderCellDef> Stock Receipts </th>\n <td mat-cell *matCellDef=\"let element\">\n <span [routerLink]=\"['/inventory/stock-receipts']\" [queryParams]=\"{ location_ids: element.id }\"\n class='cursor-pointer'>\n {{element?.stock_receipts_count }} receipt(s)</span>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"stock_issues\">\n <th mat-header-cell *matHeaderCellDef> Stock Issues </th>\n <td mat-cell *matCellDef=\"let element\">\n <span [routerLink]=\"['/inventory/stock-issues']\" [queryParams]=\"{ location_ids: element.id }\"\n class='cursor-pointer'>\n {{element?.stock_issues_count }} issue(s)</span>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Description\">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.description }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef> Status </th>\n <td mat-cell *matCellDef=\"let element\">\n <app-location-status-changer [location]=\"element\"></app-location-status-changer>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Actions\">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef=\"let element; let i = index\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <app-location-form-button [model]=\"element\" (saved)=\"modelUpdated($event, i)\"></app-location-form-button>\n <a [routerLink]=\"['/inventory/locations', element?.id, 'view']\" class=\"text-decoration-none text-dark\">\n <span class=\"material-symbols-outlined\">visibility</span>\n </a>\n <span *ngIf=\"element?.stock_receipts_count == 0 && element?.stock_issues_count == 0\">\n <app-location-delete-button [model]=\"element\" (deleted)=\"modelDeleted(i)\"></app-location-delete-button>\n </span>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>", styles: [""], dependencies: [{ kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: SearchableSelectorModule }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "component", type: LocationFormButtonComponent, selector: "app-location-form-button", inputs: ["model"], outputs: ["saved"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: LocationDeleteButtonComponent, selector: "app-location-delete-button", inputs: ["model"], outputs: ["deleted"] }, { kind: "component", type: LocationStatusChangerComponent, selector: "app-location-status-changer", inputs: ["location"] }], preserveWhitespaces: true });
|
|
319
|
-
}
|
|
320
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationListComponent, decorators: [{
|
|
321
|
-
type: Component,
|
|
322
|
-
args: [{ selector: 'app-location-list', standalone: true, imports: [
|
|
323
|
-
MatCard,
|
|
324
|
-
MatCardContent,
|
|
325
|
-
FormsModule,
|
|
326
|
-
InfiniteScrollDirective,
|
|
327
|
-
MatCell,
|
|
328
|
-
MatCellDef,
|
|
329
|
-
MatColumnDef,
|
|
330
|
-
MatFormField,
|
|
331
|
-
MatHeaderCell,
|
|
332
|
-
MatHeaderRow,
|
|
333
|
-
MatHeaderRowDef,
|
|
334
|
-
MatInput,
|
|
335
|
-
MatLabel,
|
|
336
|
-
MatProgressBar,
|
|
337
|
-
MatRow,
|
|
338
|
-
MatRowDef,
|
|
339
|
-
MatSort,
|
|
340
|
-
MatSortHeader,
|
|
341
|
-
MatTable,
|
|
342
|
-
NgIf,
|
|
343
|
-
ReactiveFormsModule,
|
|
344
|
-
SearchableSelectorModule,
|
|
345
|
-
MatHeaderCellDef,
|
|
346
|
-
LocationFormButtonComponent,
|
|
347
|
-
RouterLink,
|
|
348
|
-
LocationDeleteButtonComponent,
|
|
349
|
-
LocationStatusChangerComponent
|
|
350
|
-
], template: "<mat-card>\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-3\">\n <strong>Locations</strong>\n <app-location-form-button (saved)=\"modelCreated($event)\"></app-location-form-button>\n </div>\n <form class=\"d-flex justify-content-end align-items-center gap-2\" [formGroup]=\"filterForm\" (submit)=\"reload()\">\n <mat-form-field>\n <mat-label>Search</mat-label>\n <input type=\"text\" placeholder=\"Search locations\" matInput formControlName=\"search\">\n </mat-form-field>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card class=\"mt-3\">\n <mat-card-content class=\"p-0\">\n <table #table mat-table [dataSource]=\"models\" class=\"w-100\" infiniteScroll [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" [fromRoot]=\"true\" matSort\n (matSortChange)=\"onSortChange($event)\">\n\n <ng-container matColumnDef=\"#\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"Title\">\n <th mat-header-cell mat-sort-header=\"title\" *matHeaderCellDef> Title </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.title }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"Address\">\n <th mat-header-cell mat-sort-header=\"address\" *matHeaderCellDef> Address </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.address }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"stock_receipts\">\n <th mat-header-cell *matHeaderCellDef> Stock Receipts </th>\n <td mat-cell *matCellDef=\"let element\">\n <span [routerLink]=\"['/inventory/stock-receipts']\" [queryParams]=\"{ location_ids: element.id }\"\n class='cursor-pointer'>\n {{element?.stock_receipts_count }} receipt(s)</span>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"stock_issues\">\n <th mat-header-cell *matHeaderCellDef> Stock Issues </th>\n <td mat-cell *matCellDef=\"let element\">\n <span [routerLink]=\"['/inventory/stock-issues']\" [queryParams]=\"{ location_ids: element.id }\"\n class='cursor-pointer'>\n {{element?.stock_issues_count }} issue(s)</span>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Description\">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.description }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef> Status </th>\n <td mat-cell *matCellDef=\"let element\">\n <app-location-status-changer [location]=\"element\"></app-location-status-changer>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Actions\">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef=\"let element; let i = index\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <app-location-form-button [model]=\"element\" (saved)=\"modelUpdated($event, i)\"></app-location-form-button>\n <a [routerLink]=\"['/inventory/locations', element?.id, 'view']\" class=\"text-decoration-none text-dark\">\n <span class=\"material-symbols-outlined\">visibility</span>\n </a>\n <span *ngIf=\"element?.stock_receipts_count == 0 && element?.stock_issues_count == 0\">\n <app-location-delete-button [model]=\"element\" (deleted)=\"modelDeleted(i)\"></app-location-delete-button>\n </span>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>" }]
|
|
351
|
-
}], ctorParameters: () => [{ type: LocationService }, { type: i2.FormBuilder }, { type: i1.RequestHelperService }, { type: i4.ActivatedRoute }] });
|
|
352
|
-
|
|
353
|
-
class LocationInformationComponent {
|
|
354
|
-
location;
|
|
355
|
-
model;
|
|
356
|
-
constructor(location) {
|
|
357
|
-
this.location = location;
|
|
358
|
-
}
|
|
359
|
-
redirectBack() {
|
|
360
|
-
this.location.back();
|
|
361
|
-
}
|
|
362
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationInformationComponent, deps: [{ token: i5.Location }], target: i0.ɵɵFactoryTarget.Component });
|
|
363
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LocationInformationComponent, isStandalone: true, selector: "app-location-information", inputs: { model: "model" }, ngImport: i0, template: "<mat-card *ngIf=\"model\">\n <mat-card-content class=\"d-flex justify-content-between align-items-center\">\n <h3 class=\"mb-2 fw-bold\">{{ model?.title }}</h3>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <app-location-form-button [model]=\"model\" (saved)=\"model = $event\"></app-location-form-button>\n <app-location-delete-button [model]=\"model\" (deleted)=\"redirectBack()\"></app-location-delete-button>\n </div>\n </mat-card-content>\n <mat-divider class=\"mx-2\"></mat-divider>\n <mat-card-content class=\"mt-2 d-flex flex-column justify-content-start gap-2\">\n <div class=\"d-flex justify-content-start align-items-start flex-wrap\">\n <strong class=\"w-100 mb-2\">Location Details</strong>\n <div *ngIf=\"model?.address\" class=\"d-flex flex-column gap-1 justify-content-start w-100 mb-2\">\n <small class=\"text-secondary\">Address</small>\n <p class=\"mb-0\">{{ model?.address }}</p>\n </div>\n <div *ngIf=\"model?.description\" class=\"d-flex flex-column gap-1 justify-content-start w-100 mb-2\">\n <small class=\"text-secondary\">Description</small>\n <p class=\"mb-0\">{{ model?.description }}</p>\n </div>\n </div>\n\n </mat-card-content>\n</mat-card>\n", styles: [""], dependencies: [{ kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LocationFormButtonComponent, selector: "app-location-form-button", inputs: ["model"], outputs: ["saved"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: LocationDeleteButtonComponent, selector: "app-location-delete-button", inputs: ["model"], outputs: ["deleted"] }], preserveWhitespaces: true });
|
|
364
|
-
}
|
|
365
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationInformationComponent, decorators: [{
|
|
366
|
-
type: Component,
|
|
367
|
-
args: [{ selector: 'app-location-information', standalone: true, imports: [
|
|
368
|
-
MatCard,
|
|
369
|
-
MatCardContent,
|
|
370
|
-
NgIf,
|
|
371
|
-
LocationFormButtonComponent,
|
|
372
|
-
MatDivider,
|
|
373
|
-
LocationDeleteButtonComponent
|
|
374
|
-
], template: "<mat-card *ngIf=\"model\">\n <mat-card-content class=\"d-flex justify-content-between align-items-center\">\n <h3 class=\"mb-2 fw-bold\">{{ model?.title }}</h3>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <app-location-form-button [model]=\"model\" (saved)=\"model = $event\"></app-location-form-button>\n <app-location-delete-button [model]=\"model\" (deleted)=\"redirectBack()\"></app-location-delete-button>\n </div>\n </mat-card-content>\n <mat-divider class=\"mx-2\"></mat-divider>\n <mat-card-content class=\"mt-2 d-flex flex-column justify-content-start gap-2\">\n <div class=\"d-flex justify-content-start align-items-start flex-wrap\">\n <strong class=\"w-100 mb-2\">Location Details</strong>\n <div *ngIf=\"model?.address\" class=\"d-flex flex-column gap-1 justify-content-start w-100 mb-2\">\n <small class=\"text-secondary\">Address</small>\n <p class=\"mb-0\">{{ model?.address }}</p>\n </div>\n <div *ngIf=\"model?.description\" class=\"d-flex flex-column gap-1 justify-content-start w-100 mb-2\">\n <small class=\"text-secondary\">Description</small>\n <p class=\"mb-0\">{{ model?.description }}</p>\n </div>\n </div>\n\n </mat-card-content>\n</mat-card>\n" }]
|
|
375
|
-
}], ctorParameters: () => [{ type: i5.Location }], propDecorators: { model: [{
|
|
376
|
-
type: Input
|
|
377
|
-
}] } });
|
|
378
|
-
|
|
379
|
-
class LocationProductStatisticsComponent extends TechlifyListingControllerInterface {
|
|
380
|
-
service;
|
|
381
|
-
formBuilder;
|
|
382
|
-
requestHelperService;
|
|
383
|
-
activatedRoute;
|
|
384
|
-
location;
|
|
385
|
-
displayedColumns = [
|
|
386
|
-
'#',
|
|
387
|
-
'SKU',
|
|
388
|
-
'Product',
|
|
389
|
-
'Category',
|
|
390
|
-
'Quantity',
|
|
391
|
-
'Actions'
|
|
392
|
-
];
|
|
393
|
-
constructor(service, formBuilder, requestHelperService, activatedRoute) {
|
|
394
|
-
super();
|
|
395
|
-
this.service = service;
|
|
396
|
-
this.formBuilder = formBuilder;
|
|
397
|
-
this.requestHelperService = requestHelperService;
|
|
398
|
-
this.activatedRoute = activatedRoute;
|
|
399
|
-
this.lastPage = 0;
|
|
400
|
-
this.filterForm = this.formBuilder.group({
|
|
401
|
-
search: [''],
|
|
402
|
-
sort_by: ['id|desc'],
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
ngOnInit() {
|
|
406
|
-
this.requestHelperService.updateFormWithQueryParams(this.filterForm, {});
|
|
407
|
-
this.filterForm.valueChanges.pipe(debounceTime(800)).subscribe({
|
|
408
|
-
next: () => {
|
|
409
|
-
this.requestHelperService.updateQueryParams(this.requestHelperService.convertToFormData(this.filterForm.value));
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
// listen for route change
|
|
413
|
-
this.activatedRoute.queryParams
|
|
414
|
-
.pipe(debounceTime(500), distinctUntilChanged())
|
|
415
|
-
.subscribe((val) => {
|
|
416
|
-
this.reload();
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
loadData() {
|
|
420
|
-
if (this.isWorking) {
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
const params = {
|
|
424
|
-
...this.requestHelperService.convertToFormData(this.filterForm.value),
|
|
425
|
-
page: this.page,
|
|
426
|
-
perPage: this.perPage,
|
|
427
|
-
with: 'categories',
|
|
428
|
-
};
|
|
429
|
-
this.isWorking = true;
|
|
430
|
-
this.service.productStatistics(this.location, params).subscribe({
|
|
431
|
-
next: (response) => {
|
|
432
|
-
this.models = this.models?.concat(response?.data);
|
|
433
|
-
this.lastPage = response?.last_page;
|
|
434
|
-
this.isWorking = false;
|
|
435
|
-
},
|
|
436
|
-
error: () => (this.isWorking = false)
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
onSortChange(sort) {
|
|
440
|
-
let { active, direction } = sort;
|
|
441
|
-
if (!active)
|
|
442
|
-
active = 'id';
|
|
443
|
-
if (!direction)
|
|
444
|
-
direction = 'desc';
|
|
445
|
-
this.filterForm.get('sort_by')?.setValue(active + '|' + direction);
|
|
446
|
-
}
|
|
447
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationProductStatisticsComponent, deps: [{ token: LocationService }, { token: i2.FormBuilder }, { token: i1.RequestHelperService }, { token: i4.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
448
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LocationProductStatisticsComponent, isStandalone: true, selector: "app-location-product-statistics", inputs: { location: "location" }, usesInheritance: true, ngImport: i0, template: "<mat-card>\n <mat-card-content>\n <h3>Location Products</h3>\n </mat-card-content>\n <mat-divider class=\"mt-3\"></mat-divider>\n <mat-card-content class=\"p-0\">\n <table\n #table\n mat-table [dataSource]=\"models\" class=\"w-100\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n [fromRoot]=\"true\"\n matSort\n (matSortChange)=\"onSortChange($event)\"\n >\n\n <ng-container matColumnDef=\"#\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"SKU\">\n <th mat-header-cell *matHeaderCellDef> SKU </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.sku }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"Product\">\n <th mat-header-cell *matHeaderCellDef> Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a\n class=\"text-dark\"\n [routerLink]=\"['/inventory/products', element.id, 'view']\"\n >\n {{ element?.name }}\n </a>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Category\">\n <th mat-header-cell *matHeaderCellDef> Category </th>\n <td mat-cell *matCellDef=\"let element\">\n <app-product-category-badges [product]=\"element\"></app-product-category-badges>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Quantity\">\n <th mat-header-cell *matHeaderCellDef> Quantity </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.current_stock }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Actions\">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef=\"let element; let i = index\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <app-stock-transfer-form-button\n *ngIf=\"location?.id\"\n [productId]=\"element?.id\"\n (saved)=\"reload()\"\n ></app-stock-transfer-form-button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n", styles: [""], dependencies: [{ kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: ProductModule }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: ProductCategoryBadgesComponent, selector: "app-product-category-badges", inputs: ["product"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: StockTransferFormButtonComponent, selector: "app-stock-transfer-form-button", inputs: ["productId", "locationFromId"], outputs: ["saved"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], preserveWhitespaces: true });
|
|
449
|
-
}
|
|
450
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationProductStatisticsComponent, decorators: [{
|
|
451
|
-
type: Component,
|
|
452
|
-
args: [{ selector: 'app-location-product-statistics', standalone: true, imports: [
|
|
453
|
-
MatCard,
|
|
454
|
-
MatCardContent,
|
|
455
|
-
ProductModule,
|
|
456
|
-
MatProgressBar,
|
|
457
|
-
NgIf,
|
|
458
|
-
MatHeaderCellDef,
|
|
459
|
-
MatHeaderCellDef,
|
|
460
|
-
MatCellDef,
|
|
461
|
-
MatCellDef,
|
|
462
|
-
MatHeaderRowDef,
|
|
463
|
-
MatRowDef,
|
|
464
|
-
MatCell,
|
|
465
|
-
MatCell,
|
|
466
|
-
MatRow,
|
|
467
|
-
MatColumnDef,
|
|
468
|
-
MatHeaderCell,
|
|
469
|
-
MatTable,
|
|
470
|
-
InfiniteScrollDirective,
|
|
471
|
-
InfiniteScrollDirective,
|
|
472
|
-
InfiniteScrollDirective,
|
|
473
|
-
InfiniteScrollDirective,
|
|
474
|
-
InfiniteScrollDirective,
|
|
475
|
-
MatHeaderRow,
|
|
476
|
-
MatSort,
|
|
477
|
-
MatSort,
|
|
478
|
-
ProductCategoryBadgesComponent,
|
|
479
|
-
RouterLink,
|
|
480
|
-
StockTransferFormButtonComponent,
|
|
481
|
-
MatDivider
|
|
482
|
-
], template: "<mat-card>\n <mat-card-content>\n <h3>Location Products</h3>\n </mat-card-content>\n <mat-divider class=\"mt-3\"></mat-divider>\n <mat-card-content class=\"p-0\">\n <table\n #table\n mat-table [dataSource]=\"models\" class=\"w-100\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n [fromRoot]=\"true\"\n matSort\n (matSortChange)=\"onSortChange($event)\"\n >\n\n <ng-container matColumnDef=\"#\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"SKU\">\n <th mat-header-cell *matHeaderCellDef> SKU </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.sku }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"Product\">\n <th mat-header-cell *matHeaderCellDef> Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a\n class=\"text-dark\"\n [routerLink]=\"['/inventory/products', element.id, 'view']\"\n >\n {{ element?.name }}\n </a>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Category\">\n <th mat-header-cell *matHeaderCellDef> Category </th>\n <td mat-cell *matCellDef=\"let element\">\n <app-product-category-badges [product]=\"element\"></app-product-category-badges>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Quantity\">\n <th mat-header-cell *matHeaderCellDef> Quantity </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.current_stock }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Actions\">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef=\"let element; let i = index\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <app-stock-transfer-form-button\n *ngIf=\"location?.id\"\n [productId]=\"element?.id\"\n (saved)=\"reload()\"\n ></app-stock-transfer-form-button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n" }]
|
|
483
|
-
}], ctorParameters: () => [{ type: LocationService }, { type: i2.FormBuilder }, { type: i1.RequestHelperService }, { type: i4.ActivatedRoute }], propDecorators: { location: [{
|
|
484
|
-
type: Input
|
|
485
|
-
}] } });
|
|
486
|
-
|
|
487
|
-
class LocationViewComponent {
|
|
488
|
-
service;
|
|
489
|
-
activatedRoute;
|
|
490
|
-
id;
|
|
491
|
-
isLoading;
|
|
492
|
-
model;
|
|
493
|
-
constructor(service, activatedRoute) {
|
|
494
|
-
this.service = service;
|
|
495
|
-
this.activatedRoute = activatedRoute;
|
|
496
|
-
this.id = parseInt(this.activatedRoute.snapshot.params['id']);
|
|
497
|
-
}
|
|
498
|
-
ngOnInit() {
|
|
499
|
-
if (this.id) {
|
|
500
|
-
this.loadModel();
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
loadModel() {
|
|
504
|
-
this.isLoading = true;
|
|
505
|
-
const params = {};
|
|
506
|
-
this.service.show(this.id, params).subscribe({
|
|
507
|
-
next: (response) => {
|
|
508
|
-
this.model = response?.item;
|
|
509
|
-
this.isLoading = false;
|
|
510
|
-
},
|
|
511
|
-
error: () => (this.isLoading = false)
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationViewComponent, deps: [{ token: LocationService }, { token: i4.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
515
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LocationViewComponent, isStandalone: true, selector: "app-location-view", ngImport: i0, template: "<div *ngIf=\"model\" class=\"d-flex justify-content-start align-items-start flex-wrap gap-3\">\n <div class=\"d-flex flex-column gap-2\" style=\"width: 400px\">\n <app-location-information\n [model]=\"model\"\n ></app-location-information>\n </div>\n\n <app-location-product-statistics\n style=\"width: calc(100% - 400px - 1rem)\"\n [location]=\"model\"\n ></app-location-product-statistics>\n\n</div>\n\n<mat-progress-bar *ngIf=\"isLoading\" mode=\"indeterminate\"></mat-progress-bar>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: LocationInformationComponent, selector: "app-location-information", inputs: ["model"] }, { kind: "ngmodule", type: ProductModule }, { kind: "component", type: LocationProductStatisticsComponent, selector: "app-location-product-statistics", inputs: ["location"] }], preserveWhitespaces: true });
|
|
516
|
-
}
|
|
517
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationViewComponent, decorators: [{
|
|
518
|
-
type: Component,
|
|
519
|
-
args: [{ selector: 'app-location-view', standalone: true, imports: [
|
|
520
|
-
NgIf,
|
|
521
|
-
MatCard,
|
|
522
|
-
MatCardContent,
|
|
523
|
-
MatProgressBar,
|
|
524
|
-
LocationInformationComponent,
|
|
525
|
-
ProductModule,
|
|
526
|
-
LocationProductStatisticsComponent
|
|
527
|
-
], template: "<div *ngIf=\"model\" class=\"d-flex justify-content-start align-items-start flex-wrap gap-3\">\n <div class=\"d-flex flex-column gap-2\" style=\"width: 400px\">\n <app-location-information\n [model]=\"model\"\n ></app-location-information>\n </div>\n\n <app-location-product-statistics\n style=\"width: calc(100% - 400px - 1rem)\"\n [location]=\"model\"\n ></app-location-product-statistics>\n\n</div>\n\n<mat-progress-bar *ngIf=\"isLoading\" mode=\"indeterminate\"></mat-progress-bar>\n" }]
|
|
528
|
-
}], ctorParameters: () => [{ type: LocationService }, { type: i4.ActivatedRoute }] });
|
|
529
|
-
|
|
530
|
-
const routes = [
|
|
531
|
-
{
|
|
532
|
-
path: '',
|
|
533
|
-
component: LocationListComponent
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
path: ':id/view',
|
|
537
|
-
component: LocationViewComponent
|
|
538
|
-
}
|
|
539
|
-
];
|
|
540
|
-
class LocationRoutingModule {
|
|
541
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
542
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LocationRoutingModule, imports: [i4.RouterModule], exports: [RouterModule] });
|
|
543
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
|
|
544
|
-
}
|
|
545
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationRoutingModule, decorators: [{
|
|
546
|
-
type: NgModule,
|
|
547
|
-
args: [{
|
|
548
|
-
imports: [RouterModule.forChild(routes)],
|
|
549
|
-
exports: [RouterModule]
|
|
550
|
-
}]
|
|
551
|
-
}] });
|
|
552
|
-
|
|
553
|
-
class LocationModule {
|
|
554
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
555
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LocationModule, imports: [CommonModule,
|
|
556
|
-
LocationRoutingModule] });
|
|
557
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationModule, imports: [CommonModule,
|
|
558
|
-
LocationRoutingModule] });
|
|
559
|
-
}
|
|
560
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LocationModule, decorators: [{
|
|
561
|
-
type: NgModule,
|
|
562
|
-
args: [{
|
|
563
|
-
declarations: [],
|
|
564
|
-
imports: [
|
|
565
|
-
CommonModule,
|
|
566
|
-
LocationRoutingModule
|
|
567
|
-
]
|
|
568
|
-
}]
|
|
569
|
-
}] });
|
|
570
|
-
|
|
571
|
-
export { LocationModule };
|
|
572
|
-
//# sourceMappingURL=techlify-inventory-common-location.module-NaTWwOXZ.mjs.map
|