techlify-inventory-common 18.8.1 → 18.10.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.
Files changed (70) hide show
  1. package/esm2022/lib/inventory-common/incident/incident-form/incident-form.component.mjs +116 -0
  2. package/esm2022/lib/inventory-common/incident/incident-form-button/incident-form-button.component.mjs +45 -0
  3. package/esm2022/lib/inventory-common/incident/incident-list/incident-list.component.mjs +142 -0
  4. package/esm2022/lib/inventory-common/incident/incident-routing.module.mjs +24 -0
  5. package/esm2022/lib/inventory-common/incident/incident.module.mjs +22 -0
  6. package/esm2022/lib/inventory-common/incident/incident.service.mjs +18 -0
  7. package/esm2022/lib/inventory-common/location/location-list/location-list.component.mjs +11 -6
  8. package/esm2022/lib/inventory-common/location/location-product-statistics/location-product-statistics.component.mjs +2 -2
  9. package/esm2022/lib/inventory-common/location/location-status-changer/location-status-changer.component.mjs +66 -0
  10. package/esm2022/lib/inventory-common/location/location.service.mjs +7 -1
  11. package/esm2022/lib/inventory-common/product/product-basic-info/product-basic-info.component.mjs +3 -3
  12. package/esm2022/lib/inventory-common/product/product-form/product-form.component.mjs +3 -3
  13. package/esm2022/lib/inventory-common/product/product-list/product-list.component.mjs +3 -3
  14. package/esm2022/lib/inventory-common/product/product-location/product-location-list/product-location-list.component.mjs +7 -4
  15. package/esm2022/lib/inventory-common/product/product-view-page/product-view-page.component.mjs +15 -3
  16. package/esm2022/lib/inventory-common/rating/rating-form/rating-form.component.mjs +115 -0
  17. package/esm2022/lib/inventory-common/rating/rating-form-button/rating-form-button.component.mjs +45 -0
  18. package/esm2022/lib/inventory-common/rating/rating-list/rating-list.component.mjs +138 -0
  19. package/esm2022/lib/inventory-common/rating/rating-routing.module.mjs +23 -0
  20. package/esm2022/lib/inventory-common/rating/rating.module.mjs +22 -0
  21. package/esm2022/lib/inventory-common/rating/rating.service.mjs +18 -0
  22. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.mjs +10 -4
  23. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.mjs +4 -4
  24. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-form/stock-transfer-form.component.mjs +8 -2
  25. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-form-button/stock-transfer-form-button.component.mjs +6 -3
  26. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-list/stock-transfer-list.component.mjs +6 -4
  27. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.component.mjs +2 -2
  28. package/esm2022/lib/inventory-common/supplier/supplier-routing.module.mjs +1 -1
  29. package/esm2022/lib/inventory-common/supplier/supplier-type.service.mjs +25 -0
  30. package/esm2022/lib/inventory-common/supplier/supplier-view/supplier-view.component.mjs +6 -4
  31. package/esm2022/lib/inventory-common/supplier/supplier.module.mjs +12 -4
  32. package/esm2022/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.mjs +3 -3
  33. package/esm2022/public-api.mjs +18 -1
  34. package/fesm2022/{techlify-inventory-common-category.module-CAPeu05n.mjs → techlify-inventory-common-category.module-BmhaQykz.mjs} +2 -2
  35. package/fesm2022/{techlify-inventory-common-category.module-CAPeu05n.mjs.map → techlify-inventory-common-category.module-BmhaQykz.mjs.map} +1 -1
  36. package/fesm2022/{techlify-inventory-common-location.module-Bpt1avqg.mjs → techlify-inventory-common-location.module-CSrRu4pQ.mjs} +69 -8
  37. package/fesm2022/techlify-inventory-common-location.module-CSrRu4pQ.mjs.map +1 -0
  38. package/fesm2022/{techlify-inventory-common-measure.module-BjJ4KTU_.mjs → techlify-inventory-common-measure.module-Dz5Lc4oT.mjs} +2 -2
  39. package/fesm2022/{techlify-inventory-common-measure.module-BjJ4KTU_.mjs.map → techlify-inventory-common-measure.module-Dz5Lc4oT.mjs.map} +1 -1
  40. package/fesm2022/{techlify-inventory-common-techlify-inventory-common-KJHI_roN.mjs → techlify-inventory-common-techlify-inventory-common-BBi2hKoE.mjs} +1172 -43
  41. package/fesm2022/techlify-inventory-common-techlify-inventory-common-BBi2hKoE.mjs.map +1 -0
  42. package/fesm2022/techlify-inventory-common.mjs +1 -1
  43. package/lib/inventory-common/incident/incident-form/incident-form.component.d.ts +21 -0
  44. package/lib/inventory-common/incident/incident-form-button/incident-form-button.component.d.ts +15 -0
  45. package/lib/inventory-common/incident/incident-list/incident-list.component.d.ts +23 -0
  46. package/lib/inventory-common/incident/incident-routing.module.d.ts +7 -0
  47. package/lib/inventory-common/incident/incident.module.d.ts +8 -0
  48. package/lib/inventory-common/incident/incident.service.d.ts +7 -0
  49. package/lib/inventory-common/location/location-status-changer/location-status-changer.component.d.ts +18 -0
  50. package/lib/inventory-common/location/location.service.d.ts +4 -0
  51. package/lib/inventory-common/product/product-location/product-location-list/product-location-list.component.d.ts +3 -2
  52. package/lib/inventory-common/product/product-view-page/product-view-page.component.d.ts +6 -0
  53. package/lib/inventory-common/rating/rating-form/rating-form.component.d.ts +21 -0
  54. package/lib/inventory-common/rating/rating-form-button/rating-form-button.component.d.ts +15 -0
  55. package/lib/inventory-common/rating/rating-list/rating-list.component.d.ts +23 -0
  56. package/lib/inventory-common/rating/rating-routing.module.d.ts +7 -0
  57. package/lib/inventory-common/rating/rating.module.d.ts +8 -0
  58. package/lib/inventory-common/rating/rating.service.d.ts +7 -0
  59. package/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.d.ts +3 -1
  60. package/lib/inventory-common/stock-transfer/stock-transfer-form/stock-transfer-form.component.d.ts +2 -1
  61. package/lib/inventory-common/stock-transfer/stock-transfer-form-button/stock-transfer-form-button.component.d.ts +2 -1
  62. package/lib/inventory-common/supplier/supplier-form/supplier-form.component.d.ts +1 -1
  63. package/lib/inventory-common/supplier/supplier-type.service.d.ts +13 -0
  64. package/lib/inventory-common/supplier/supplier.module.d.ts +3 -1
  65. package/package.json +1 -1
  66. package/public-api.d.ts +17 -0
  67. package/fesm2022/techlify-inventory-common-location.module-Bpt1avqg.mjs.map +0 -1
  68. package/fesm2022/techlify-inventory-common-supplier.module-DaTU-lMt.mjs +0 -468
  69. package/fesm2022/techlify-inventory-common-supplier.module-DaTU-lMt.mjs.map +0 -1
  70. package/fesm2022/techlify-inventory-common-techlify-inventory-common-KJHI_roN.mjs.map +0 -1
@@ -1,468 +0,0 @@
1
- import * as i1$1 from 'ngx-techlify-core';
2
- import { ActionPopupComponent, TechlifyListingControllerInterface, SearchableSelectorModule, AuditLogForModelModule, NoteModule } from 'ngx-techlify-core';
3
- import * as i0 from '@angular/core';
4
- import { Input, Component, Injectable, EventEmitter, Output, NgModule } from '@angular/core';
5
- import * as i5 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
- import { lastValueFrom, debounceTime, distinctUntilChanged } from 'rxjs';
8
- import { S as SupplierFormComponent, a as SupplierService, b as StockReceiptsListPageComponent, T as TechlifyFormService, M as MaterialModule, c as StockReceiptsModule } from './techlify-inventory-common-techlify-inventory-common-KJHI_roN.mjs';
9
- import * as i4 from '@angular/router';
10
- import { RouterModule } from '@angular/router';
11
- import * as i4$1 from '@angular/material/card';
12
- import * as i6 from '@angular/material/progress-bar';
13
- import * as i6$1 from '@angular/material/tabs';
14
- import * as i1 from '@angular/material/dialog';
15
- import * as i5$1 from '@angular/material/divider';
16
- import * as i8 from '@angular/material/icon';
17
- import { __decorate } from 'tslib';
18
- import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
19
- import * as i4$2 from 'ngx-spinner';
20
- import * as i2 from '@angular/forms';
21
- import { ReactiveFormsModule } from '@angular/forms';
22
- import * as i8$1 from '@angular/material/form-field';
23
- import * as i9 from '@angular/material/input';
24
- import * as i12 from '@angular/material/sort';
25
- import * as i15 from '@angular/material/table';
26
- import * as i2$1 from '@angular/material/tooltip';
27
- import * as i11 from 'ngx-infinite-scroll';
28
- import { InfiniteScrollModule } from 'ngx-infinite-scroll';
29
- import * as i13 from 'ngx-permissions';
30
- import { NgxPermissionsModule } from 'ngx-permissions';
31
- import { FlexModule } from '@angular/flex-layout';
32
-
33
- class SupplierInformationComponent {
34
- dialog;
35
- supplierService;
36
- alertService;
37
- router;
38
- errorService;
39
- supplier;
40
- constructor(dialog, supplierService, alertService, router, errorService) {
41
- this.dialog = dialog;
42
- this.supplierService = supplierService;
43
- this.alertService = alertService;
44
- this.router = router;
45
- this.errorService = errorService;
46
- }
47
- modifySupplier(model) {
48
- const dialogRef = this.dialog.open(SupplierFormComponent, {
49
- width: '600px',
50
- data: {
51
- details: model,
52
- },
53
- });
54
- dialogRef.afterClosed().subscribe((result) => {
55
- if (result) {
56
- location.reload();
57
- }
58
- });
59
- }
60
- deleteSupplier(id) {
61
- const dialogRef = this.dialog.open(ActionPopupComponent, {
62
- width: '400px',
63
- data: {
64
- title: 'Delete Supplier',
65
- message: 'Are you sure you want to delete this supplier?',
66
- },
67
- autoFocus: false,
68
- });
69
- dialogRef.afterClosed().subscribe(async (result) => {
70
- if (result) {
71
- try {
72
- const result = await this.supplierService.destroy(id);
73
- this.alertService.addAlert('Successfully Deleted Supplier', 'success');
74
- }
75
- catch (error) {
76
- this.errorService.handleError(error);
77
- }
78
- finally {
79
- this.router.navigateByUrl('/suppliers');
80
- }
81
- }
82
- });
83
- }
84
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierInformationComponent, deps: [{ token: i1.MatDialog }, { token: SupplierService }, { token: i1$1.AlertService }, { token: i4.Router }, { token: i1$1.ErrorHandlerService }], target: i0.ɵɵFactoryTarget.Component });
85
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SupplierInformationComponent, selector: "app-supplier-information", inputs: { supplier: "supplier" }, ngImport: i0, template: "<mat-card>\n <mat-card-content>\n <div class=\"d-flex justify-content-between align-items-center\">\n <h3 class=\"mb-0\">Personal Information</h3>\n <div class=\"d-flex justify-content-end align-items-center gap-1\">\n <app-audit-log-for-model [modelId]=\"supplier?.id\" modelType=\"Supplier\" logView=\"all\"></app-audit-log-for-model>\n <mat-icon class=\"material-icons cursor-pointer\" (click)=\"modifySupplier(supplier)\"> edit </mat-icon>\n <mat-icon class=\"material-icons cursor-pointer\" (click)=\"deleteSupplier(supplier)\"> delete </mat-icon>\n </div>\n </div>\n\n <mat-divider></mat-divider>\n\n <div class=\"mt-2\">\n <div class=\"d-flex justify-content-start gap-2\">\n <div>\n <h3 class=\"mb-0\">{{ supplier?.company_name }}</h3>\n <span *ngIf=\"supplier?.type\" class=\"status-pill-sm status-light-orange\"> {{ supplier?.type?.title }}</span>\n </div>\n </div>\n </div>\n\n <div class=\"row mt-3\">\n <div class=\"col-6\" *ngIf=\"supplier?.contact_name\">\n <p class=\"text-muted mb-0\">Contact Name</p>\n <p class=\"text-wrap\">{{ supplier?.contact_name }}</p>\n </div>\n <div class=\"col-6\" *ngIf=\"supplier?.email\">\n <p class=\"text-muted mb-0\">Email</p>\n <p class=\"text-wrap\">{{ supplier?.email }}</p>\n </div>\n <div class=\"col-6\" *ngIf=\"supplier?.phone\">\n <p class=\"text-muted mb-0\">Phone</p>\n <p class=\"text-wrap\">{{ supplier?.phone }}</p>\n </div>\n <div class=\"col-6\" *ngIf=\"supplier?.details\">\n <p class=\"text-muted mb-0\">Details</p>\n <p class=\"text-wrap\">{{ supplier?.details }}</p>\n </div>\n </div>\n\n <div class=\"row mt-2 h-100\">\n <div class=\"d-flex\" *ngIf=\"supplier?.address\">\n <mat-icon class=\"material-icons text-primary my-auto\">location_on</mat-icon>\n <p class=\"ms-2 my-auto\">{{ supplier?.address }}</p>\n </div>\n </div>\n </mat-card-content>\n</mat-card>\n", dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$1.AuditLogForModelComponent, selector: "app-audit-log-for-model", inputs: ["modelType", "modelId", "logView"] }], preserveWhitespaces: true });
86
- }
87
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierInformationComponent, decorators: [{
88
- type: Component,
89
- args: [{ selector: 'app-supplier-information', template: "<mat-card>\n <mat-card-content>\n <div class=\"d-flex justify-content-between align-items-center\">\n <h3 class=\"mb-0\">Personal Information</h3>\n <div class=\"d-flex justify-content-end align-items-center gap-1\">\n <app-audit-log-for-model [modelId]=\"supplier?.id\" modelType=\"Supplier\" logView=\"all\"></app-audit-log-for-model>\n <mat-icon class=\"material-icons cursor-pointer\" (click)=\"modifySupplier(supplier)\"> edit </mat-icon>\n <mat-icon class=\"material-icons cursor-pointer\" (click)=\"deleteSupplier(supplier)\"> delete </mat-icon>\n </div>\n </div>\n\n <mat-divider></mat-divider>\n\n <div class=\"mt-2\">\n <div class=\"d-flex justify-content-start gap-2\">\n <div>\n <h3 class=\"mb-0\">{{ supplier?.company_name }}</h3>\n <span *ngIf=\"supplier?.type\" class=\"status-pill-sm status-light-orange\"> {{ supplier?.type?.title }}</span>\n </div>\n </div>\n </div>\n\n <div class=\"row mt-3\">\n <div class=\"col-6\" *ngIf=\"supplier?.contact_name\">\n <p class=\"text-muted mb-0\">Contact Name</p>\n <p class=\"text-wrap\">{{ supplier?.contact_name }}</p>\n </div>\n <div class=\"col-6\" *ngIf=\"supplier?.email\">\n <p class=\"text-muted mb-0\">Email</p>\n <p class=\"text-wrap\">{{ supplier?.email }}</p>\n </div>\n <div class=\"col-6\" *ngIf=\"supplier?.phone\">\n <p class=\"text-muted mb-0\">Phone</p>\n <p class=\"text-wrap\">{{ supplier?.phone }}</p>\n </div>\n <div class=\"col-6\" *ngIf=\"supplier?.details\">\n <p class=\"text-muted mb-0\">Details</p>\n <p class=\"text-wrap\">{{ supplier?.details }}</p>\n </div>\n </div>\n\n <div class=\"row mt-2 h-100\">\n <div class=\"d-flex\" *ngIf=\"supplier?.address\">\n <mat-icon class=\"material-icons text-primary my-auto\">location_on</mat-icon>\n <p class=\"ms-2 my-auto\">{{ supplier?.address }}</p>\n </div>\n </div>\n </mat-card-content>\n</mat-card>\n" }]
90
- }], ctorParameters: () => [{ type: i1.MatDialog }, { type: SupplierService }, { type: i1$1.AlertService }, { type: i4.Router }, { type: i1$1.ErrorHandlerService }], propDecorators: { supplier: [{
91
- type: Input
92
- }] } });
93
-
94
- class SupplierViewComponent {
95
- supplierService;
96
- route;
97
- router;
98
- supplier;
99
- supplierId = 0;
100
- selectedTabIndex = 0;
101
- isLoading = false;
102
- constructor(supplierService, route, router) {
103
- this.supplierService = supplierService;
104
- this.route = route;
105
- this.router = router;
106
- }
107
- ngOnInit() {
108
- this.route.firstChild?.url.subscribe((url) => {
109
- if (url[0].path === 'ratings') {
110
- this.selectedTabIndex = 1;
111
- }
112
- else if (url[0].path === 'estimates') {
113
- this.selectedTabIndex = 2;
114
- }
115
- else {
116
- this.selectedTabIndex = 0;
117
- }
118
- });
119
- this.supplierId = this.route.snapshot.params['id'];
120
- this.getSupplier(this.supplierId);
121
- }
122
- onTabChange(event) {
123
- switch (event.index) {
124
- case 0:
125
- this.router.navigate(['incidents'], { relativeTo: this.route });
126
- return;
127
- case 1:
128
- this.router.navigate(['ratings'], { relativeTo: this.route });
129
- return;
130
- case 2:
131
- this.router.navigate(['estimates'], { relativeTo: this.route });
132
- return;
133
- }
134
- }
135
- async getSupplier(id) {
136
- this.isLoading = true;
137
- let result = await lastValueFrom(this.supplierService.show(id));
138
- this.isLoading = false;
139
- this.supplier = result.item;
140
- }
141
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierViewComponent, deps: [{ token: SupplierService }, { token: i4.ActivatedRoute }, { token: i4.Router }], target: i0.ɵɵFactoryTarget.Component });
142
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SupplierViewComponent, selector: "app-supplier-view", ngImport: i0, template: "<mat-progress-bar *ngIf=\"isLoading\" mode=\"indeterminate\"></mat-progress-bar>\n\n<div *ngIf=\"supplier\" class=\"d-flex flex-row gap-3 justify-content-between\">\n <div style=\"width: 300px\">\n <app-supplier-information [supplier]=\"supplier\"></app-supplier-information>\n <mat-card class=\"mt-3\">\n <mat-card-content class=\"p-0\">\n <app-note-list modelType=\"Supplier\" [relatedModelId]=\"supplier?.id\" viewMode=\"timeline\"\n labelText=\"Notes\"></app-note-list>\n </mat-card-content>\n </mat-card>\n </div>\n\n <mat-card class='w-100'>\n <mat-card-content>\n <mat-tab-group>\n <mat-tab label=\"Stock Receipts\">\n <app-stock-receipts-list-page [supplierId]=\"supplier?.id\"></app-stock-receipts-list-page>\n </mat-tab>\n </mat-tab-group>\n </mat-card-content>\n </mat-card>\n</div>", dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i6.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i6$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i6$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: i1$1.NoteListComponent, selector: "app-note-list", inputs: ["relatedModelId", "modelType", "readonly", "labelText", "commentsView", "viewMode"] }, { kind: "component", type: StockReceiptsListPageComponent, selector: "app-stock-receipts-list-page", inputs: ["product", "supplierId"], outputs: ["listUpdated"] }, { kind: "component", type: SupplierInformationComponent, selector: "app-supplier-information", inputs: ["supplier"] }], preserveWhitespaces: true });
143
- }
144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierViewComponent, decorators: [{
145
- type: Component,
146
- args: [{ selector: 'app-supplier-view', template: "<mat-progress-bar *ngIf=\"isLoading\" mode=\"indeterminate\"></mat-progress-bar>\n\n<div *ngIf=\"supplier\" class=\"d-flex flex-row gap-3 justify-content-between\">\n <div style=\"width: 300px\">\n <app-supplier-information [supplier]=\"supplier\"></app-supplier-information>\n <mat-card class=\"mt-3\">\n <mat-card-content class=\"p-0\">\n <app-note-list modelType=\"Supplier\" [relatedModelId]=\"supplier?.id\" viewMode=\"timeline\"\n labelText=\"Notes\"></app-note-list>\n </mat-card-content>\n </mat-card>\n </div>\n\n <mat-card class='w-100'>\n <mat-card-content>\n <mat-tab-group>\n <mat-tab label=\"Stock Receipts\">\n <app-stock-receipts-list-page [supplierId]=\"supplier?.id\"></app-stock-receipts-list-page>\n </mat-tab>\n </mat-tab-group>\n </mat-card-content>\n </mat-card>\n</div>" }]
147
- }], ctorParameters: () => [{ type: SupplierService }, { type: i4.ActivatedRoute }, { type: i4.Router }] });
148
-
149
- class SupplierFormService extends TechlifyFormService {
150
- constructor() {
151
- super();
152
- }
153
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
154
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierFormService, providedIn: 'root' });
155
- }
156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierFormService, decorators: [{
157
- type: Injectable,
158
- args: [{
159
- providedIn: 'root',
160
- }]
161
- }], ctorParameters: () => [] });
162
-
163
- class SupplierComponent {
164
- dialog;
165
- supplierFormService;
166
- constructor(dialog, supplierFormService) {
167
- this.dialog = dialog;
168
- this.supplierFormService = supplierFormService;
169
- }
170
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierComponent, deps: [{ token: i1.MatDialog }, { token: SupplierFormService }], target: i0.ɵɵFactoryTarget.Component });
171
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SupplierComponent, selector: "app-supplier", ngImport: i0, template: "<div>\n <router-outlet></router-outlet>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], preserveWhitespaces: true });
172
- }
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierComponent, decorators: [{
174
- type: Component,
175
- args: [{ selector: 'app-supplier', template: "<div>\n <router-outlet></router-outlet>\n</div>\n" }]
176
- }], ctorParameters: () => [{ type: i1.MatDialog }, { type: SupplierFormService }] });
177
-
178
- class SupplierFormButtonComponent {
179
- matDialog;
180
- supplier;
181
- onSaved = new EventEmitter();
182
- constructor(matDialog) {
183
- this.matDialog = matDialog;
184
- }
185
- ngOnInit() {
186
- }
187
- openDialog() {
188
- this.matDialog.open(SupplierFormComponent, {
189
- width: '600px',
190
- data: {
191
- details: this.supplier
192
- },
193
- }).afterClosed().subscribe((result) => {
194
- if (result) {
195
- this.onSaved.emit(result);
196
- }
197
- });
198
- }
199
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierFormButtonComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
200
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SupplierFormButtonComponent, isStandalone: true, selector: "app-supplier-form-button", inputs: { supplier: "supplier" }, outputs: { onSaved: "onSaved" }, ngImport: i0, template: "<mat-icon color=\"primary\" class=\"cursor-pointer\" [class.text-secondary]=\"supplier\" (click)=\"openDialog()\">\n {{ supplier ? \"edit\" : \"add\" }}\n</mat-icon>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], preserveWhitespaces: true });
201
- }
202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierFormButtonComponent, decorators: [{
203
- type: Component,
204
- args: [{ selector: 'app-supplier-form-button', standalone: true, imports: [
205
- CommonModule,
206
- MaterialModule
207
- ], template: "<mat-icon color=\"primary\" class=\"cursor-pointer\" [class.text-secondary]=\"supplier\" (click)=\"openDialog()\">\n {{ supplier ? \"edit\" : \"add\" }}\n</mat-icon>" }]
208
- }], ctorParameters: () => [{ type: i1.MatDialog }], propDecorators: { supplier: [{
209
- type: Input
210
- }], onSaved: [{
211
- type: Output
212
- }] } });
213
-
214
- class SupplierDeleteButtonComponent {
215
- dialog;
216
- alertService;
217
- errorHandler;
218
- supplierService;
219
- supplier;
220
- onDelete = new EventEmitter();
221
- constructor(dialog, alertService, errorHandler, supplierService) {
222
- this.dialog = dialog;
223
- this.alertService = alertService;
224
- this.errorHandler = errorHandler;
225
- this.supplierService = supplierService;
226
- }
227
- ngOnInit() {
228
- }
229
- openDialog() {
230
- this.dialog.open(ActionPopupComponent, {
231
- width: '400px',
232
- data: {
233
- title: 'Delete Supplier',
234
- message: 'Are you sure you want to delete the Supplier?',
235
- },
236
- autoFocus: false,
237
- }).afterClosed().subscribe(async (result) => {
238
- if (result) {
239
- try {
240
- await lastValueFrom(this.supplierService.destroy(this.supplier.id));
241
- this.alertService.addAlert('Successfully deleted the Supplier', 'success');
242
- this.onDelete.emit(this.supplier);
243
- }
244
- catch (error) {
245
- this.errorHandler.handleError(error);
246
- }
247
- }
248
- });
249
- }
250
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierDeleteButtonComponent, deps: [{ token: i1.MatDialog }, { token: i1$1.AlertService }, { token: i1$1.ErrorHandlerService }, { token: SupplierService }], target: i0.ɵɵFactoryTarget.Component });
251
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SupplierDeleteButtonComponent, isStandalone: true, selector: "app-supplier-delete-button", inputs: { supplier: "supplier" }, outputs: { onDelete: "onDelete" }, ngImport: i0, template: "<mat-icon class=\"cursor-pointer\" *ngxPermissionsOnly=\"['supplier.delete']\" (click)=\"openDialog()\">\n delete\n</mat-icon>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: NgxPermissionsModule }, { kind: "directive", type: i13.NgxPermissionsDirective, selector: "[ngxPermissionsOnly],[ngxPermissionsExcept]", inputs: ["ngxPermissionsOnly", "ngxPermissionsOnlyThen", "ngxPermissionsOnlyElse", "ngxPermissionsExcept", "ngxPermissionsExceptElse", "ngxPermissionsExceptThen", "ngxPermissionsThen", "ngxPermissionsElse", "ngxPermissionsOnlyAuthorisedStrategy", "ngxPermissionsOnlyUnauthorisedStrategy", "ngxPermissionsExceptUnauthorisedStrategy", "ngxPermissionsExceptAuthorisedStrategy", "ngxPermissionsUnauthorisedStrategy", "ngxPermissionsAuthorisedStrategy"], outputs: ["permissionsAuthorized", "permissionsUnauthorized"] }], preserveWhitespaces: true });
252
- }
253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierDeleteButtonComponent, decorators: [{
254
- type: Component,
255
- args: [{ selector: 'app-supplier-delete-button', standalone: true, imports: [
256
- CommonModule,
257
- MaterialModule,
258
- NgxPermissionsModule
259
- ], template: "<mat-icon class=\"cursor-pointer\" *ngxPermissionsOnly=\"['supplier.delete']\" (click)=\"openDialog()\">\n delete\n</mat-icon>" }]
260
- }], ctorParameters: () => [{ type: i1.MatDialog }, { type: i1$1.AlertService }, { type: i1$1.ErrorHandlerService }, { type: SupplierService }], propDecorators: { supplier: [{
261
- type: Input
262
- }], onDelete: [{
263
- type: Output
264
- }] } });
265
-
266
- let SuppliersListComponent = class SuppliersListComponent extends TechlifyListingControllerInterface {
267
- spinner;
268
- fb;
269
- supplierService;
270
- errorHandler;
271
- filterService;
272
- activatedRoute;
273
- alertService;
274
- dialog;
275
- supplierFormService;
276
- requestHelperService;
277
- displayedColumns = [
278
- '#',
279
- 'company_name',
280
- 'type',
281
- 'contact_name',
282
- 'phone',
283
- 'address',
284
- 'email',
285
- 'details',
286
- 'actions',
287
- ];
288
- constructor(spinner, fb, supplierService, errorHandler, filterService, activatedRoute, alertService, dialog, supplierFormService, requestHelperService) {
289
- super();
290
- this.spinner = spinner;
291
- this.fb = fb;
292
- this.supplierService = supplierService;
293
- this.errorHandler = errorHandler;
294
- this.filterService = filterService;
295
- this.activatedRoute = activatedRoute;
296
- this.alertService = alertService;
297
- this.dialog = dialog;
298
- this.supplierFormService = supplierFormService;
299
- this.requestHelperService = requestHelperService;
300
- this.page = 1;
301
- this.perPage = 25;
302
- this.models = [];
303
- this.filterForm = this.fb.group({
304
- search: [''],
305
- supplier_type_ids: [''],
306
- sort_by: ['created_at|desc'],
307
- });
308
- }
309
- ngOnInit() {
310
- this.updateFormWithQueryParams();
311
- this.subscribeToFormChanges();
312
- this.subscribeToRouteChanges();
313
- }
314
- listenForChanges() {
315
- // listen for supplier added event to update the list.
316
- this.supplierFormService.isListUpdated().subscribe((val) => {
317
- if (val && !this.isWorking)
318
- this.reload();
319
- });
320
- // listen for form group changes.
321
- this.filterForm.valueChanges.pipe(debounceTime(500), untilDestroyed(this)).subscribe(() => {
322
- this.filterService.applyFilterToRoute(this.activatedRoute, this.filterForm.value);
323
- this.reload();
324
- });
325
- }
326
- sortColumn(event) {
327
- var direction = event.direction.toString().toUpperCase();
328
- this.assignFilter(event.active, direction);
329
- }
330
- assignFilter(column, direction) {
331
- return this.filterForm.get('sort_by')?.setValue(column + '|' + direction);
332
- }
333
- async loadData() {
334
- let filters = { ...this.requestHelperService.convertToFormData(this.filterForm.value) };
335
- filters.page = this.page = 1;
336
- filters.perPage = this.perPage;
337
- try {
338
- this.isWorking = true;
339
- let res = await lastValueFrom(this.supplierService.index(filters));
340
- this.models = this.models?.concat(res?.data);
341
- this.lastPage = res.last_page;
342
- // list is updated do not listen form isListUpdated
343
- this.supplierFormService.listUpdated(false);
344
- }
345
- catch (error) {
346
- this.errorHandler.handleError(error);
347
- }
348
- finally {
349
- this.isWorking = false;
350
- }
351
- }
352
- updateFormWithQueryParams() {
353
- this.requestHelperService.updateFormWithQueryParams(this.filterForm, {
354
- supplier_type_ids: { multiple: true },
355
- });
356
- }
357
- subscribeToFormChanges() {
358
- this.filterForm.valueChanges.pipe(debounceTime(800)).subscribe({
359
- next: () => {
360
- this.requestHelperService.updateQueryParams(this.requestHelperService.convertToFormData(this.filterForm.value));
361
- },
362
- });
363
- }
364
- subscribeToRouteChanges() {
365
- this.activatedRoute.queryParams.pipe(debounceTime(500), distinctUntilChanged()).subscribe(() => {
366
- this.reload();
367
- });
368
- }
369
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SuppliersListComponent, deps: [{ token: i4$2.NgxSpinnerService }, { token: i2.FormBuilder }, { token: SupplierService }, { token: i1$1.ErrorHandlerService }, { token: i1$1.FilterService }, { token: i4.ActivatedRoute }, { token: i1$1.AlertService }, { token: i1.MatDialog }, { token: SupplierFormService }, { token: i1$1.RequestHelperService }], target: i0.ɵɵFactoryTarget.Component });
370
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SuppliersListComponent, selector: "app-suppliers-list", usesInheritance: true, ngImport: i0, template: "<mat-card class=\"mb-3\">\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-3\">\n <div class=\"d-flex justify-content-start align-items-center gap-3\">\n <h3 class=\"mb-0\">Suppliers</h3>\n <app-supplier-form-button (onSaved)=\"reload()\"></app-supplier-form-button>\n </div>\n <form [formGroup]=\"filterForm\" class=\"d-flex justify-content-end align-items-center gap-2\">\n <mat-form-field>\n <mat-label>Search</mat-label>\n <input matInput placeholder=\"Search Supplier by Name, Phone, Address, Email, Description\"\n formControlName=\"search\" />\n <mat-icon matSuffix>search</mat-icon>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Type</mat-label>\n <app-searchable-selector apiUrl=\"api/supplier-types\" formControlName=\"supplier_type_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n </form>\n </mat-card-content>\n</mat-card>\n<mat-card>\n <mat-card-content class=\"p-0\">\n <table mat-table #table [dataSource]=\"models\" class=\"w-100 table-hover\" infiniteScroll [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" [fromRoot]=\"true\" matSort\n (matSortChange)=\"sortColumn($event)\" aria-describedby=\"Suppliers List\">\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=\"company_name\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.company_name }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"type\">\n <th mat-header-cell *matHeaderCellDef>Type</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.type?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"contact_name\">\n <th mat-header-cell *matHeaderCellDef>Contact</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.contact_name }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"phone\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Phone</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.phone }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"address\">\n <th mat-header-cell *matHeaderCellDef>Address</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.address }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Email</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.email }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"details\">\n <th mat-header-cell *matHeaderCellDef>Details</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.details }}</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\">\n <div class=\"text-secondary d-flex align-items-center gap-1\">\n\n <a class=\"text-decoration-none text-dark\" [routerLink]=\"['/inventory/suppliers', element.id, 'view']\"\n routerLinkActive=\"route-link-active\" *ngxPermissionsOnly=\"['supplier.read']\">\n <mat-icon matTooltip=\"View\">remove_red_eye</mat-icon>\n </a>\n <app-supplier-form-button *ngxPermissionsOnly=\"['supplier.update']\" [supplier]=\"element\"\n (onSaved)=\"reload()\"></app-supplier-form-button>\n <app-supplier-delete-button [supplier]=\"element\" (onDelete)=\"reload()\"></app-supplier-delete-button>\n <app-audit-log-for-model [modelId]=\"element?.id\" modelType=\"Supplier\"\n logView=\"all\"></app-audit-log-for-model>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n <mat-progress-bar mode=\"indeterminate\" *ngIf=\"isWorking\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n", dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i4.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: i4$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.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: "component", type: i6.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i12.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i12.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i15.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i15.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i15.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i15.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i15.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i15.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i15.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i15.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i15.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i15.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i1$1.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"] }, { kind: "component", type: i1$1.AuditLogForModelComponent, selector: "app-audit-log-for-model", inputs: ["modelType", "modelId", "logView"] }, { 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: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i11.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: i13.NgxPermissionsDirective, selector: "[ngxPermissionsOnly],[ngxPermissionsExcept]", inputs: ["ngxPermissionsOnly", "ngxPermissionsOnlyThen", "ngxPermissionsOnlyElse", "ngxPermissionsExcept", "ngxPermissionsExceptElse", "ngxPermissionsExceptThen", "ngxPermissionsThen", "ngxPermissionsElse", "ngxPermissionsOnlyAuthorisedStrategy", "ngxPermissionsOnlyUnauthorisedStrategy", "ngxPermissionsExceptUnauthorisedStrategy", "ngxPermissionsExceptAuthorisedStrategy", "ngxPermissionsUnauthorisedStrategy", "ngxPermissionsAuthorisedStrategy"], outputs: ["permissionsAuthorized", "permissionsUnauthorized"] }, { kind: "component", type: SupplierFormButtonComponent, selector: "app-supplier-form-button", inputs: ["supplier"], outputs: ["onSaved"] }, { kind: "component", type: SupplierDeleteButtonComponent, selector: "app-supplier-delete-button", inputs: ["supplier"], outputs: ["onDelete"] }], preserveWhitespaces: true });
371
- };
372
- SuppliersListComponent = __decorate([
373
- UntilDestroy()
374
- ], SuppliersListComponent);
375
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SuppliersListComponent, decorators: [{
376
- type: Component,
377
- args: [{ selector: 'app-suppliers-list', template: "<mat-card class=\"mb-3\">\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-3\">\n <div class=\"d-flex justify-content-start align-items-center gap-3\">\n <h3 class=\"mb-0\">Suppliers</h3>\n <app-supplier-form-button (onSaved)=\"reload()\"></app-supplier-form-button>\n </div>\n <form [formGroup]=\"filterForm\" class=\"d-flex justify-content-end align-items-center gap-2\">\n <mat-form-field>\n <mat-label>Search</mat-label>\n <input matInput placeholder=\"Search Supplier by Name, Phone, Address, Email, Description\"\n formControlName=\"search\" />\n <mat-icon matSuffix>search</mat-icon>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Type</mat-label>\n <app-searchable-selector apiUrl=\"api/supplier-types\" formControlName=\"supplier_type_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n </form>\n </mat-card-content>\n</mat-card>\n<mat-card>\n <mat-card-content class=\"p-0\">\n <table mat-table #table [dataSource]=\"models\" class=\"w-100 table-hover\" infiniteScroll [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" [fromRoot]=\"true\" matSort\n (matSortChange)=\"sortColumn($event)\" aria-describedby=\"Suppliers List\">\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=\"company_name\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.company_name }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"type\">\n <th mat-header-cell *matHeaderCellDef>Type</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.type?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"contact_name\">\n <th mat-header-cell *matHeaderCellDef>Contact</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.contact_name }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"phone\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Phone</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.phone }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"address\">\n <th mat-header-cell *matHeaderCellDef>Address</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.address }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Email</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.email }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"details\">\n <th mat-header-cell *matHeaderCellDef>Details</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.details }}</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\">\n <div class=\"text-secondary d-flex align-items-center gap-1\">\n\n <a class=\"text-decoration-none text-dark\" [routerLink]=\"['/inventory/suppliers', element.id, 'view']\"\n routerLinkActive=\"route-link-active\" *ngxPermissionsOnly=\"['supplier.read']\">\n <mat-icon matTooltip=\"View\">remove_red_eye</mat-icon>\n </a>\n <app-supplier-form-button *ngxPermissionsOnly=\"['supplier.update']\" [supplier]=\"element\"\n (onSaved)=\"reload()\"></app-supplier-form-button>\n <app-supplier-delete-button [supplier]=\"element\" (onDelete)=\"reload()\"></app-supplier-delete-button>\n <app-audit-log-for-model [modelId]=\"element?.id\" modelType=\"Supplier\"\n logView=\"all\"></app-audit-log-for-model>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n <mat-progress-bar mode=\"indeterminate\" *ngIf=\"isWorking\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n" }]
378
- }], ctorParameters: () => [{ type: i4$2.NgxSpinnerService }, { type: i2.FormBuilder }, { type: SupplierService }, { type: i1$1.ErrorHandlerService }, { type: i1$1.FilterService }, { type: i4.ActivatedRoute }, { type: i1$1.AlertService }, { type: i1.MatDialog }, { type: SupplierFormService }, { type: i1$1.RequestHelperService }] });
379
-
380
- const routes = [
381
- {
382
- path: '',
383
- component: SupplierComponent,
384
- children: [
385
- { path: '', component: SuppliersListComponent },
386
- {
387
- path: ':id/view',
388
- component: SupplierViewComponent,
389
- },
390
- ],
391
- },
392
- ];
393
- class SupplierRoutingModule {
394
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
395
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: SupplierRoutingModule, imports: [i4.RouterModule], exports: [RouterModule] });
396
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
397
- }
398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierRoutingModule, decorators: [{
399
- type: NgModule,
400
- args: [{
401
- imports: [RouterModule.forChild(routes)],
402
- exports: [RouterModule],
403
- }]
404
- }] });
405
-
406
- class SupplierModule {
407
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
408
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: SupplierModule, declarations: [SupplierComponent,
409
- SupplierViewComponent,
410
- SuppliersListComponent,
411
- SupplierFormComponent,
412
- SupplierInformationComponent], imports: [CommonModule,
413
- SupplierRoutingModule,
414
- MaterialModule,
415
- SearchableSelectorModule,
416
- AuditLogForModelModule,
417
- NoteModule,
418
- FlexModule,
419
- ReactiveFormsModule,
420
- InfiniteScrollModule,
421
- NgxPermissionsModule,
422
- SupplierFormButtonComponent,
423
- SupplierDeleteButtonComponent,
424
- StockReceiptsModule] });
425
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierModule, imports: [CommonModule,
426
- SupplierRoutingModule,
427
- MaterialModule,
428
- SearchableSelectorModule,
429
- AuditLogForModelModule,
430
- NoteModule,
431
- FlexModule,
432
- ReactiveFormsModule,
433
- InfiniteScrollModule,
434
- NgxPermissionsModule,
435
- SupplierFormButtonComponent,
436
- SupplierDeleteButtonComponent,
437
- StockReceiptsModule] });
438
- }
439
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierModule, decorators: [{
440
- type: NgModule,
441
- args: [{
442
- declarations: [
443
- SupplierComponent,
444
- SupplierViewComponent,
445
- SuppliersListComponent,
446
- SupplierFormComponent,
447
- SupplierInformationComponent,
448
- ],
449
- imports: [
450
- CommonModule,
451
- SupplierRoutingModule,
452
- MaterialModule,
453
- SearchableSelectorModule,
454
- AuditLogForModelModule,
455
- NoteModule,
456
- FlexModule,
457
- ReactiveFormsModule,
458
- InfiniteScrollModule,
459
- NgxPermissionsModule,
460
- SupplierFormButtonComponent,
461
- SupplierDeleteButtonComponent,
462
- StockReceiptsModule
463
- ],
464
- }]
465
- }] });
466
-
467
- export { SupplierModule };
468
- //# sourceMappingURL=techlify-inventory-common-supplier.module-DaTU-lMt.mjs.map