techlify-inventory-common 18.0.1

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 (182) hide show
  1. package/README.md +24 -0
  2. package/esm2022/lib/inventory-common/category/category-form/category-form.component.mjs +77 -0
  3. package/esm2022/lib/inventory-common/category/category-form-button/category-form-button.component.mjs +32 -0
  4. package/esm2022/lib/inventory-common/category/category-list-page/category-list-page.component.mjs +68 -0
  5. package/esm2022/lib/inventory-common/category/category-routing.module.mjs +24 -0
  6. package/esm2022/lib/inventory-common/category/category.module.mjs +63 -0
  7. package/esm2022/lib/inventory-common/category/category.service.mjs +18 -0
  8. package/esm2022/lib/inventory-common/inventory-common-routing.module.mjs +53 -0
  9. package/esm2022/lib/inventory-common/inventory-common.module.mjs +39 -0
  10. package/esm2022/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.mjs +42 -0
  11. package/esm2022/lib/inventory-common/material.module.mjs +172 -0
  12. package/esm2022/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.mjs +44 -0
  13. package/esm2022/lib/inventory-common/measure/measure-delete/measure-delete.module.mjs +19 -0
  14. package/esm2022/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.mjs +80 -0
  15. package/esm2022/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.mjs +30 -0
  16. package/esm2022/lib/inventory-common/measure/measure-form/measure-form.module.mjs +21 -0
  17. package/esm2022/lib/inventory-common/measure/measure-routing.module.mjs +24 -0
  18. package/esm2022/lib/inventory-common/measure/measure.module.mjs +47 -0
  19. package/esm2022/lib/inventory-common/measure/measure.service.mjs +18 -0
  20. package/esm2022/lib/inventory-common/measure/measures-list/measures-list.component.mjs +71 -0
  21. package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.mjs +45 -0
  22. package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.mjs +36 -0
  23. package/esm2022/lib/inventory-common/product/product-basic-info/product-basic-info.component.mjs +54 -0
  24. package/esm2022/lib/inventory-common/product/product-delete-button/product-delete-button.component.mjs +54 -0
  25. package/esm2022/lib/inventory-common/product/product-form/product-form.component.mjs +180 -0
  26. package/esm2022/lib/inventory-common/product/product-form-button/product-form-button.component.mjs +40 -0
  27. package/esm2022/lib/inventory-common/product/product-form.service.mjs +17 -0
  28. package/esm2022/lib/inventory-common/product/product-import-page/product-import-page.component.mjs +66 -0
  29. package/esm2022/lib/inventory-common/product/product-list/product-list.component.mjs +189 -0
  30. package/esm2022/lib/inventory-common/product/product-measure-form/product-measure-form.component.mjs +101 -0
  31. package/esm2022/lib/inventory-common/product/product-measures-list/product-measures-list.component.mjs +151 -0
  32. package/esm2022/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.mjs +12 -0
  33. package/esm2022/lib/inventory-common/product/product-routing.module.mjs +57 -0
  34. package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.mjs +63 -0
  35. package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.mjs +29 -0
  36. package/esm2022/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.mjs +54 -0
  37. package/esm2022/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.mjs +77 -0
  38. package/esm2022/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.mjs +35 -0
  39. package/esm2022/lib/inventory-common/product/product-tax/product-tax.module.mjs +39 -0
  40. package/esm2022/lib/inventory-common/product/product-tax/product-tax.service.mjs +18 -0
  41. package/esm2022/lib/inventory-common/product/product-view-page/product-view-page.component.mjs +68 -0
  42. package/esm2022/lib/inventory-common/product/product.module.mjs +111 -0
  43. package/esm2022/lib/inventory-common/product/product.service.mjs +49 -0
  44. package/esm2022/lib/inventory-common/services/techlify-form-service.mjs +11 -0
  45. package/esm2022/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.mjs +47 -0
  46. package/esm2022/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.mjs +19 -0
  47. package/esm2022/lib/inventory-common/stock-issuances/stock-issuance.service.mjs +18 -0
  48. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.mjs +126 -0
  49. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.mjs +48 -0
  50. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-routing.module.mjs +24 -0
  51. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances.module.mjs +67 -0
  52. package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.mjs +120 -0
  53. package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.mjs +44 -0
  54. package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.mjs +53 -0
  55. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.mjs +47 -0
  56. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.mjs +125 -0
  57. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.mjs +38 -0
  58. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.mjs +53 -0
  59. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt.service.mjs +18 -0
  60. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.mjs +119 -0
  61. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-routing.module.mjs +24 -0
  62. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts.module.mjs +75 -0
  63. package/esm2022/lib/inventory-common/stock-summary.service.mjs +26 -0
  64. package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.mjs +59 -0
  65. package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector.module.mjs +35 -0
  66. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.component.mjs +118 -0
  67. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.service.mjs +17 -0
  68. package/esm2022/lib/inventory-common/supplier/supplier-information/supplier-information.component.mjs +72 -0
  69. package/esm2022/lib/inventory-common/supplier/supplier-routing.module.mjs +40 -0
  70. package/esm2022/lib/inventory-common/supplier/supplier-type.service.mjs +25 -0
  71. package/esm2022/lib/inventory-common/supplier/supplier-view/supplier-view.component.mjs +66 -0
  72. package/esm2022/lib/inventory-common/supplier/supplier.component.mjs +20 -0
  73. package/esm2022/lib/inventory-common/supplier/supplier.module.mjs +63 -0
  74. package/esm2022/lib/inventory-common/supplier/supplier.service.mjs +61 -0
  75. package/esm2022/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.mjs +241 -0
  76. package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.component.mjs +118 -0
  77. package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.module.mjs +38 -0
  78. package/esm2022/public-api.mjs +9 -0
  79. package/esm2022/techlify-inventory-common.mjs +5 -0
  80. package/fesm2022/techlify-inventory-common-category.module-Stn6e73V.mjs +257 -0
  81. package/fesm2022/techlify-inventory-common-category.module-Stn6e73V.mjs.map +1 -0
  82. package/fesm2022/techlify-inventory-common-measure.module-CirswKXn.mjs +313 -0
  83. package/fesm2022/techlify-inventory-common-measure.module-CirswKXn.mjs.map +1 -0
  84. package/fesm2022/techlify-inventory-common-product.module-qdeafFV5.mjs +1172 -0
  85. package/fesm2022/techlify-inventory-common-product.module-qdeafFV5.mjs.map +1 -0
  86. package/fesm2022/techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs +436 -0
  87. package/fesm2022/techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs.map +1 -0
  88. package/fesm2022/techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs +89 -0
  89. package/fesm2022/techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs.map +1 -0
  90. package/fesm2022/techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs +302 -0
  91. package/fesm2022/techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs.map +1 -0
  92. package/fesm2022/techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs +253 -0
  93. package/fesm2022/techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs.map +1 -0
  94. package/fesm2022/techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs +178 -0
  95. package/fesm2022/techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs.map +1 -0
  96. package/fesm2022/techlify-inventory-common-supplier.module-gzHesNtQ.mjs +665 -0
  97. package/fesm2022/techlify-inventory-common-supplier.module-gzHesNtQ.mjs.map +1 -0
  98. package/fesm2022/techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs +14 -0
  99. package/fesm2022/techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs.map +1 -0
  100. package/fesm2022/techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs +495 -0
  101. package/fesm2022/techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs.map +1 -0
  102. package/fesm2022/techlify-inventory-common.mjs +2 -0
  103. package/fesm2022/techlify-inventory-common.mjs.map +1 -0
  104. package/index.d.ts +5 -0
  105. package/lib/inventory-common/category/category-form/category-form.component.d.ts +19 -0
  106. package/lib/inventory-common/category/category-form-button/category-form-button.component.d.ts +13 -0
  107. package/lib/inventory-common/category/category-list-page/category-list-page.component.d.ts +20 -0
  108. package/lib/inventory-common/category/category-routing.module.d.ts +7 -0
  109. package/lib/inventory-common/category/category.module.d.ts +19 -0
  110. package/lib/inventory-common/category/category.service.d.ts +7 -0
  111. package/lib/inventory-common/inventory-common-routing.module.d.ts +7 -0
  112. package/lib/inventory-common/inventory-common.module.d.ts +13 -0
  113. package/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.d.ts +14 -0
  114. package/lib/inventory-common/material.module.d.ts +40 -0
  115. package/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.d.ts +19 -0
  116. package/lib/inventory-common/measure/measure-delete/measure-delete.module.d.ts +9 -0
  117. package/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.d.ts +19 -0
  118. package/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.d.ts +13 -0
  119. package/lib/inventory-common/measure/measure-form/measure-form.module.d.ts +11 -0
  120. package/lib/inventory-common/measure/measure-routing.module.d.ts +7 -0
  121. package/lib/inventory-common/measure/measure.module.d.ts +15 -0
  122. package/lib/inventory-common/measure/measure.service.d.ts +7 -0
  123. package/lib/inventory-common/measure/measures-list/measures-list.component.d.ts +17 -0
  124. package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.d.ts +13 -0
  125. package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.d.ts +12 -0
  126. package/lib/inventory-common/product/product-basic-info/product-basic-info.component.d.ts +19 -0
  127. package/lib/inventory-common/product/product-delete-button/product-delete-button.component.d.ts +26 -0
  128. package/lib/inventory-common/product/product-form/product-form.component.d.ts +44 -0
  129. package/lib/inventory-common/product/product-form-button/product-form-button.component.d.ts +20 -0
  130. package/lib/inventory-common/product/product-form.service.d.ts +7 -0
  131. package/lib/inventory-common/product/product-import-page/product-import-page.component.d.ts +10 -0
  132. package/lib/inventory-common/product/product-list/product-list.component.d.ts +44 -0
  133. package/lib/inventory-common/product/product-measure-form/product-measure-form.component.d.ts +33 -0
  134. package/lib/inventory-common/product/product-measures-list/product-measures-list.component.d.ts +43 -0
  135. package/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.d.ts +5 -0
  136. package/lib/inventory-common/product/product-routing.module.d.ts +7 -0
  137. package/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.d.ts +15 -0
  138. package/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.d.ts +10 -0
  139. package/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.d.ts +26 -0
  140. package/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.d.ts +21 -0
  141. package/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.d.ts +13 -0
  142. package/lib/inventory-common/product/product-tax/product-tax.module.d.ts +12 -0
  143. package/lib/inventory-common/product/product-tax/product-tax.service.d.ts +7 -0
  144. package/lib/inventory-common/product/product-view-page/product-view-page.component.d.ts +33 -0
  145. package/lib/inventory-common/product/product.module.d.ts +28 -0
  146. package/lib/inventory-common/product/product.service.d.ts +19 -0
  147. package/lib/inventory-common/services/techlify-form-service.d.ts +5 -0
  148. package/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.d.ts +18 -0
  149. package/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.d.ts +9 -0
  150. package/lib/inventory-common/stock-issuances/stock-issuance.service.d.ts +7 -0
  151. package/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.d.ts +24 -0
  152. package/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.d.ts +15 -0
  153. package/lib/inventory-common/stock-issuances/stock-issuances-routing.module.d.ts +7 -0
  154. package/lib/inventory-common/stock-issuances/stock-issuances.module.d.ts +19 -0
  155. package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.d.ts +24 -0
  156. package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.d.ts +18 -0
  157. package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.d.ts +17 -0
  158. package/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.d.ts +18 -0
  159. package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.d.ts +22 -0
  160. package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.d.ts +16 -0
  161. package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.d.ts +17 -0
  162. package/lib/inventory-common/stock-receipts/stock-receipt.service.d.ts +7 -0
  163. package/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.d.ts +21 -0
  164. package/lib/inventory-common/stock-receipts/stock-receipts-routing.module.d.ts +7 -0
  165. package/lib/inventory-common/stock-receipts/stock-receipts.module.d.ts +20 -0
  166. package/lib/inventory-common/stock-summary.service.d.ts +14 -0
  167. package/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.d.ts +20 -0
  168. package/lib/inventory-common/supplier/payee-selector/payee-selector.module.d.ts +11 -0
  169. package/lib/inventory-common/supplier/supplier-form/supplier-form.component.d.ts +29 -0
  170. package/lib/inventory-common/supplier/supplier-form/supplier-form.service.d.ts +7 -0
  171. package/lib/inventory-common/supplier/supplier-information/supplier-information.component.d.ts +18 -0
  172. package/lib/inventory-common/supplier/supplier-routing.module.d.ts +7 -0
  173. package/lib/inventory-common/supplier/supplier-type.service.d.ts +13 -0
  174. package/lib/inventory-common/supplier/supplier-view/supplier-view.component.d.ts +20 -0
  175. package/lib/inventory-common/supplier/supplier.component.d.ts +10 -0
  176. package/lib/inventory-common/supplier/supplier.module.d.ts +18 -0
  177. package/lib/inventory-common/supplier/supplier.service.d.ts +39 -0
  178. package/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.d.ts +51 -0
  179. package/lib/inventory-common/techlify-filter/techlify-filter.component.d.ts +31 -0
  180. package/lib/inventory-common/techlify-filter/techlify-filter.module.d.ts +11 -0
  181. package/package.json +25 -0
  182. package/public-api.d.ts +5 -0
@@ -0,0 +1,1172 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Inject, Component, Injectable, EventEmitter, Input, Output, NgModule } from '@angular/core';
3
+ import * as i4 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import { __decorate } from 'tslib';
6
+ import * as i2 from '@angular/forms';
7
+ import { Validators, FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
8
+ import * as i1 from '@angular/material/dialog';
9
+ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
10
+ import { P as ProductService, S as StockSummaryService } from './techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs';
11
+ import * as i3 from 'ngx-spinner';
12
+ import * as i1$1 from 'ngx-techlify-core';
13
+ import { TechlifyServiceBaseClass, TechlifyFormComponentInterface, TechlifyListingControllerInterface, AuthenticationGuard, MaterialModule, SearchableSelectorModule, TimelineFilterModule, ImportCsvModule } from 'ngx-techlify-core';
14
+ import * as i7 from '@angular/material/button';
15
+ import * as i6 from '@angular/material/form-field';
16
+ import * as i7$1 from '@angular/material/input';
17
+ import * as i10 from '@angular/flex-layout';
18
+ import { FlexModule } from '@angular/flex-layout';
19
+ import * as i6$1 from '@angular/material/table';
20
+ import { MatTableDataSource } from '@angular/material/table';
21
+ import { debounceTime } from 'rxjs/operators';
22
+ import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
23
+ import * as i2$1 from '@angular/router';
24
+ import { RouterModule } from '@angular/router';
25
+ import * as i3$1 from '@angular/material/icon';
26
+ import * as i10$1 from '@angular/material/core';
27
+ import * as i11 from '@angular/material/select';
28
+ import * as i5 from '@angular/material/sort';
29
+ import * as i10$2 from 'ngx-infinite-scroll';
30
+ import { InfiniteScrollModule } from 'ngx-infinite-scroll';
31
+ import moment from 'moment';
32
+ import { T as TechlifyFormService } from './techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs';
33
+ import * as i9 from '@angular/material/datepicker';
34
+ import { a as StockReceiptFormButtonComponent, S as StockReceiptFormModule } from './techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs';
35
+ import { c as StockIssueFormButtonComponent, S as StockIssuancesListComponent, a as StockIssueFormModule, b as StockIssuancesListModule } from './techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs';
36
+ import * as i3$2 from '@angular/material/card';
37
+ import * as i2$2 from '@angular/material/tooltip';
38
+ import * as i7$2 from '@angular/material/progress-bar';
39
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
40
+ import { S as StockReceiptsListPageComponent, a as StockReceiptsModule } from './techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs';
41
+ import * as i6$2 from '@angular/material/divider';
42
+
43
+ const errorMessages$1 = {
44
+ title: {
45
+ required: "Please Enter Title",
46
+ },
47
+ description: {
48
+ required: "Please Enter Description",
49
+ },
50
+ };
51
+ class ProductMeasureFormComponent {
52
+ productService;
53
+ fb;
54
+ dialogRef;
55
+ data;
56
+ spinnerService;
57
+ formValidatorService;
58
+ errorService;
59
+ alertService;
60
+ productMeasureForm;
61
+ isWorking = false;
62
+ isUpdate = false;
63
+ constructor(productService, fb, dialogRef, data, spinnerService, formValidatorService, errorService, alertService) {
64
+ this.productService = productService;
65
+ this.fb = fb;
66
+ this.dialogRef = dialogRef;
67
+ this.data = data;
68
+ this.spinnerService = spinnerService;
69
+ this.formValidatorService = formValidatorService;
70
+ this.errorService = errorService;
71
+ this.alertService = alertService;
72
+ this.productMeasureForm = this.fb.group({
73
+ id: [""],
74
+ title: ["", Validators.compose([Validators.required])],
75
+ description: ["", Validators.compose([Validators.required])],
76
+ });
77
+ }
78
+ ngOnInit() {
79
+ if (this.data.details) {
80
+ this.isUpdate = true;
81
+ this.productMeasureForm.patchValue(this.data.details);
82
+ }
83
+ }
84
+ async save() {
85
+ if (!this.productMeasureForm.valid) {
86
+ this.alertService.addAlert("Please Fill All Required Fields", "warn");
87
+ this.productMeasureForm.markAllAsTouched();
88
+ return;
89
+ }
90
+ let productMeasure = this.productMeasureForm.value;
91
+ try {
92
+ this.spinnerService.show();
93
+ this.isWorking = true;
94
+ let result = this.isUpdate
95
+ ? await this.productService.updateProductMeasure(productMeasure)
96
+ : await this.productService.createProductMeasure(productMeasure);
97
+ this.dialogRef.close(result);
98
+ }
99
+ catch (error) {
100
+ this.errorService.handleError(error);
101
+ }
102
+ finally {
103
+ this.isWorking = false;
104
+ this.spinnerService.hide();
105
+ }
106
+ }
107
+ /**
108
+ * Method to evaluate form fields
109
+ */
110
+ isFieldValid(field) {
111
+ return this.formValidatorService.isFieldValid(field, this.productMeasureForm);
112
+ }
113
+ /**
114
+ * Method to find error in form fields
115
+ */
116
+ getErrorMessage(field) {
117
+ return this.formValidatorService.getErrorMessage(field, this.productMeasureForm, errorMessages$1);
118
+ }
119
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductMeasureFormComponent, deps: [{ token: ProductService }, { token: i2.FormBuilder }, { token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i3.NgxSpinnerService }, { token: i1$1.FormValidatorService }, { token: i1$1.ErrorHandlerService }, { token: i1$1.AlertService }], target: i0.ɵɵFactoryTarget.Component });
120
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductMeasureFormComponent, selector: "app-product-measure-form", ngImport: i0, template: "<div>\n <form [formGroup]=\"productMeasureForm\" (ngSubmit)=\"save()\">\n <h3 class=\"text-center\">Create/Update Product Measure</h3>\n <div fxLayout=\"column\">\n <div fxLayout=\"column\">\n <mat-form-field>\n <input\n matInput\n placeholder=\"Title\"\n formControlName=\"title\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('title')\"\n >{{ getErrorMessage(\"title\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n placeholder=\"Description\"\n formControlName=\"description\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('description')\"\n >{{ getErrorMessage(\"description\") }}\n </mat-error>\n </mat-form-field>\n <div fxFlex=\"100%\" fxLayout fxLayoutGap=\"1rem\">\n <button\n mat-button\n class=\"mt-2\"\n type=\"button\"\n (click)=\"dialogRef.close()\"\n >\n Cancel\n </button>\n <button mat-raised-button color=\"primary\" class=\"mt-2\" type=\"submit\">\n Save\n </button>\n </div>\n </div>\n </div>\n </form>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i7$1.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: i10.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i10.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i10.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { 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.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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"] }], preserveWhitespaces: true });
121
+ }
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductMeasureFormComponent, decorators: [{
123
+ type: Component,
124
+ args: [{ selector: "app-product-measure-form", template: "<div>\n <form [formGroup]=\"productMeasureForm\" (ngSubmit)=\"save()\">\n <h3 class=\"text-center\">Create/Update Product Measure</h3>\n <div fxLayout=\"column\">\n <div fxLayout=\"column\">\n <mat-form-field>\n <input\n matInput\n placeholder=\"Title\"\n formControlName=\"title\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('title')\"\n >{{ getErrorMessage(\"title\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n placeholder=\"Description\"\n formControlName=\"description\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('description')\"\n >{{ getErrorMessage(\"description\") }}\n </mat-error>\n </mat-form-field>\n <div fxFlex=\"100%\" fxLayout fxLayoutGap=\"1rem\">\n <button\n mat-button\n class=\"mt-2\"\n type=\"button\"\n (click)=\"dialogRef.close()\"\n >\n Cancel\n </button>\n <button mat-raised-button color=\"primary\" class=\"mt-2\" type=\"submit\">\n Save\n </button>\n </div>\n </div>\n </div>\n </form>\n</div>\n" }]
125
+ }], ctorParameters: () => [{ type: ProductService }, { type: i2.FormBuilder }, { type: i1.MatDialogRef }, { type: undefined, decorators: [{
126
+ type: Inject,
127
+ args: [MAT_DIALOG_DATA]
128
+ }] }, { type: i3.NgxSpinnerService }, { type: i1$1.FormValidatorService }, { type: i1$1.ErrorHandlerService }, { type: i1$1.AlertService }] });
129
+
130
+ let ProductMeasuresListComponent = class ProductMeasuresListComponent {
131
+ fb;
132
+ dialog;
133
+ filterService;
134
+ activatedRoute;
135
+ productService;
136
+ filterFormGroup;
137
+ lastPage;
138
+ page = 1;
139
+ perPage = 25;
140
+ totalItems = 0;
141
+ currentPage = 1;
142
+ num_items = 25;
143
+ routeFilters;
144
+ productMeasures = [];
145
+ columnDefinitions = [
146
+ { def: "#", isShow: true },
147
+ { def: "Title", isShow: true },
148
+ { def: "Description", isShow: true },
149
+ { def: "Actions", isShow: true },
150
+ ];
151
+ displayedColumns = ["#", "Title", "Description", "Actions"];
152
+ dataSource = new MatTableDataSource();
153
+ constructor(fb, dialog, filterService, activatedRoute, productService) {
154
+ this.fb = fb;
155
+ this.dialog = dialog;
156
+ this.filterService = filterService;
157
+ this.activatedRoute = activatedRoute;
158
+ this.productService = productService;
159
+ this.filterFormGroup = this.fb.group({
160
+ num_items: [this.num_items + "|" + this.currentPage],
161
+ search: [""],
162
+ type_ids: [""],
163
+ sort_by: [""],
164
+ });
165
+ }
166
+ ngOnInit() {
167
+ this.patchFiltersFromRoute();
168
+ this.listenForChanges();
169
+ this.loadData();
170
+ }
171
+ listenForChanges() {
172
+ this.filterFormGroup.valueChanges
173
+ .pipe(debounceTime(500), untilDestroyed(this))
174
+ .subscribe((changes) => {
175
+ this.filterService.applyFilterToRoute(this.activatedRoute, this.filterFormGroup.value);
176
+ this.reload();
177
+ });
178
+ }
179
+ patchFiltersFromRoute() {
180
+ this.routeFilters = this.filterService.getFiltersFromRoute(this.activatedRoute, this.filterFormGroup.value);
181
+ this.filterFormGroup.setValue(this.routeFilters);
182
+ if (this.routeFilters.type_ids) {
183
+ this.filterFormGroup
184
+ .get("type_ids")
185
+ .setValue(this.routeFilters.type_ids.split(",").map(Number));
186
+ }
187
+ }
188
+ async loadData() {
189
+ let filters = this.filterFormGroup.value;
190
+ filters.page = this.page;
191
+ filters.per_page = this.perPage;
192
+ filters.type_ids = filters.type_ids.toString();
193
+ filters.num_items = this.num_items + "|" + this.currentPage;
194
+ let res = await this.productService.getProductMeasures(filters);
195
+ if (this.productMeasures.length < 1) {
196
+ this.productMeasures = res.data;
197
+ }
198
+ else {
199
+ res.data.forEach((item) => this.productMeasures.push(item));
200
+ }
201
+ this.dataSource = new MatTableDataSource(this.productMeasures);
202
+ this.totalItems = res.total;
203
+ this.lastPage = res.last_page || this.page;
204
+ }
205
+ reload() {
206
+ this.productMeasures = [];
207
+ this.currentPage = 1;
208
+ this.loadData();
209
+ }
210
+ modifyProductMeasure(model) {
211
+ const dialogRef = this.dialog.open(ProductMeasureFormComponent, {
212
+ width: "600px",
213
+ data: {
214
+ details: model,
215
+ },
216
+ });
217
+ dialogRef.afterClosed().subscribe((result) => {
218
+ if (result) {
219
+ this.reload();
220
+ }
221
+ });
222
+ }
223
+ onScroll() {
224
+ if (this.totalItems > this.productMeasures.length) {
225
+ this.currentPage += 1;
226
+ this.loadData();
227
+ }
228
+ }
229
+ assignFilter(column, direction) {
230
+ if (column) {
231
+ return this.filterFormGroup
232
+ .get("sort_by")
233
+ ?.setValue(column + "|" + direction);
234
+ }
235
+ }
236
+ sortColumn(event) {
237
+ var direction = event.direction.toString().toUpperCase();
238
+ this.assignFilter(event.active, direction);
239
+ }
240
+ // eslint-disable-next-line @angular-eslint/use-lifecycle-interface
241
+ // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
242
+ ngOnDestroy() {
243
+ //Called once, before the instance is destroyed.
244
+ //Add 'implements OnDestroy' to the class.
245
+ }
246
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductMeasuresListComponent, deps: [{ token: i2.FormBuilder }, { token: i1.MatDialog }, { token: i1$1.FilterService }, { token: i2$1.ActivatedRoute }, { token: ProductService }], target: i0.ɵɵFactoryTarget.Component });
247
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductMeasuresListComponent, selector: "app-product-measure-list", ngImport: i0, template: "<div fxLayout=\"column\">\n <div class=\"text-center\" fxLayoutAlign=\"center center\">\n <h3 fxLayout>\n <span class=\"mt-1\"> Product Measures </span>\n <button\n mat-raised-button\n class=\"ml-2\"\n color=\"primary\"\n (click)=\"modifyProductMeasure()\"\n >\n <mat-icon>add</mat-icon>\n Product Measure\n </button>\n </h3>\n </div>\n\n <div fxLayout>\n <form [formGroup]=\"filterFormGroup\" fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field>\n <input\n matInput\n placeholder=\"Item Name, Description, etc.\"\n formControlName=\"search\"\n />\n </mat-form-field>\n </form>\n\n <mat-form-field class=\"ml-2\" fxFlex=\"0 1 calc(11.11% - 0.5rem)\">\n <mat-label>Columns</mat-label>\n <mat-select [(ngModel)]=\"displayedColumns\" multiple name=\"column\">\n <mat-option\n *ngFor=\"let column of columnDefinitions\"\n [value]=\"column.def\"\n [disabled]=\"!column.isShow\"\n >\n {{ column?.def }}</mat-option\n >\n </mat-select>\n </mat-form-field>\n </div>\n\n <table\n mat-table\n #table\n [dataSource]=\"dataSource\"\n class=\"mat-elevation-z8 w-100 mt-4 table-hover\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n [fromRoot]=\"true\"\n infiniteScrollContainer=\"mat-sidenav-content\"\n matSort\n (matSortChange)=\"sortColumn($event)\"\n matSortDisableClear=\"true\"\n >\n <!-- # Column -->\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 <!-- Title Column -->\n <ng-container matColumnDef=\"Title\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Title</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.title }}</td>\n </ng-container>\n\n <!-- Description Column -->\n <ng-container matColumnDef=\"Description\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Description</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.description }}</td>\n </ng-container>\n\n <!-- Actions Column -->\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\" fxLayoutGap=\"1rem\">\n <button mat-icon-button (click)=\"modifyProductMeasure(element)\">\n <mat-icon>edit</mat-icon>\n </button>\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</div>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7$1.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: i10$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i5.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i10$2.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: i10.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i10.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i10.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i10.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { 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: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], preserveWhitespaces: true });
248
+ };
249
+ ProductMeasuresListComponent = __decorate([
250
+ UntilDestroy()
251
+ ], ProductMeasuresListComponent);
252
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductMeasuresListComponent, decorators: [{
253
+ type: Component,
254
+ args: [{ selector: "app-product-measure-list", template: "<div fxLayout=\"column\">\n <div class=\"text-center\" fxLayoutAlign=\"center center\">\n <h3 fxLayout>\n <span class=\"mt-1\"> Product Measures </span>\n <button\n mat-raised-button\n class=\"ml-2\"\n color=\"primary\"\n (click)=\"modifyProductMeasure()\"\n >\n <mat-icon>add</mat-icon>\n Product Measure\n </button>\n </h3>\n </div>\n\n <div fxLayout>\n <form [formGroup]=\"filterFormGroup\" fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field>\n <input\n matInput\n placeholder=\"Item Name, Description, etc.\"\n formControlName=\"search\"\n />\n </mat-form-field>\n </form>\n\n <mat-form-field class=\"ml-2\" fxFlex=\"0 1 calc(11.11% - 0.5rem)\">\n <mat-label>Columns</mat-label>\n <mat-select [(ngModel)]=\"displayedColumns\" multiple name=\"column\">\n <mat-option\n *ngFor=\"let column of columnDefinitions\"\n [value]=\"column.def\"\n [disabled]=\"!column.isShow\"\n >\n {{ column?.def }}</mat-option\n >\n </mat-select>\n </mat-form-field>\n </div>\n\n <table\n mat-table\n #table\n [dataSource]=\"dataSource\"\n class=\"mat-elevation-z8 w-100 mt-4 table-hover\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n [fromRoot]=\"true\"\n infiniteScrollContainer=\"mat-sidenav-content\"\n matSort\n (matSortChange)=\"sortColumn($event)\"\n matSortDisableClear=\"true\"\n >\n <!-- # Column -->\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 <!-- Title Column -->\n <ng-container matColumnDef=\"Title\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Title</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.title }}</td>\n </ng-container>\n\n <!-- Description Column -->\n <ng-container matColumnDef=\"Description\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Description</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.description }}</td>\n </ng-container>\n\n <!-- Actions Column -->\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\" fxLayoutGap=\"1rem\">\n <button mat-icon-button (click)=\"modifyProductMeasure(element)\">\n <mat-icon>edit</mat-icon>\n </button>\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</div>\n" }]
255
+ }], ctorParameters: () => [{ type: i2.FormBuilder }, { type: i1.MatDialog }, { type: i1$1.FilterService }, { type: i2$1.ActivatedRoute }, { type: ProductService }] });
256
+
257
+ class ProductFormService extends TechlifyFormService {
258
+ constructor() {
259
+ super();
260
+ }
261
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
262
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductFormService, providedIn: "root" });
263
+ }
264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductFormService, decorators: [{
265
+ type: Injectable,
266
+ args: [{
267
+ providedIn: "root",
268
+ }]
269
+ }], ctorParameters: () => [] });
270
+
271
+ const initial_quantity = 0;
272
+ const reorder_point = 10;
273
+ const errorMessages = {
274
+ type_id: {
275
+ required: "Please Enter Type",
276
+ },
277
+ name: {
278
+ required: "Please Enter Name",
279
+ },
280
+ sale_price: {
281
+ required: "Please Enter Sales Price",
282
+ },
283
+ minimum_price: {
284
+ required: "Please Enter Minimum Price",
285
+ },
286
+ reorder_point: {
287
+ required: "Please Enter Reorder Point",
288
+ },
289
+ };
290
+ class ProductFormComponent {
291
+ productService;
292
+ fb;
293
+ formValidatorService;
294
+ alertService;
295
+ datePipe;
296
+ productFormService;
297
+ productForm;
298
+ isWorking = false;
299
+ isUpdate = false;
300
+ saved = new EventEmitter();
301
+ cancelled = new EventEmitter();
302
+ product;
303
+ displayedFormFields = [
304
+ "name",
305
+ "product type",
306
+ "sku",
307
+ "description",
308
+ "product measure",
309
+ "reorder point",
310
+ "initial quantity",
311
+ "initial quantity date",
312
+ "sales price",
313
+ "minimum price",
314
+ "maximum price",
315
+ "income account",
316
+ "expense account",
317
+ ];
318
+ displayedFormSections = [
319
+ "basic information",
320
+ "inventory information",
321
+ "sales information",
322
+ "accounts information",
323
+ ];
324
+ constructor(productService, fb, formValidatorService, alertService, datePipe, productFormService) {
325
+ this.productService = productService;
326
+ this.fb = fb;
327
+ this.formValidatorService = formValidatorService;
328
+ this.alertService = alertService;
329
+ this.datePipe = datePipe;
330
+ this.productFormService = productFormService;
331
+ this.productForm = this.fb.group({
332
+ id: [""],
333
+ type_id: [1, Validators.compose([Validators.required])],
334
+ sku: [""],
335
+ name: ["", Validators.compose([Validators.required])],
336
+ initial_quantity: [initial_quantity],
337
+ initial_quantity_date: [moment().format()],
338
+ reorder_point: [reorder_point, Validators.compose([Validators.required])],
339
+ description: [""],
340
+ sale_price: [0, Validators.compose([Validators.required])],
341
+ income_account_id: [""],
342
+ expense_account_id: [""],
343
+ measure_id: [1],
344
+ minimum_price: ["", Validators.compose([Validators.required])],
345
+ maximum_price: [""],
346
+ condition_type_id: [1],
347
+ current_quantity: [],
348
+ category_ids: [""],
349
+ });
350
+ }
351
+ ngOnInit() {
352
+ if (this.product?.id) {
353
+ this.isUpdate = true;
354
+ let data = { ...this.product };
355
+ if (this.product?.categories?.length > 0) {
356
+ data.category_ids = this.product.categories.map((category) => category?.id);
357
+ }
358
+ if (data?.initial_quantity_date) {
359
+ data.initial_quantity_date = moment(data.initial_quantity_date).toISOString();
360
+ }
361
+ this.productForm.patchValue(data);
362
+ }
363
+ }
364
+ async save() {
365
+ this.productForm.markAllAsTouched();
366
+ if (this.productForm.invalid) {
367
+ this.alertService.addAlert("Please Fill All Required Fields", "warn");
368
+ return;
369
+ }
370
+ let product = this.productForm.value;
371
+ if (product.maximum_price <= 0 || !product.maximum_price) {
372
+ product.maximum_price = product.minimum_price;
373
+ }
374
+ if (product?.initial_quantity_date) {
375
+ product.initial_quantity_date = moment(product.initial_quantity_date).format("YYYY-MM-DD");
376
+ }
377
+ this.isWorking = true;
378
+ product.with = "type,measure,incomeAccount,expenseAccount";
379
+ let request = this.productService.store(product);
380
+ if (this.isUpdate) {
381
+ request = this.productService.update(product);
382
+ }
383
+ request.subscribe({
384
+ next: (response) => {
385
+ this.saved.emit(response?.item);
386
+ this.isWorking = false;
387
+ this.productFormService.listUpdated(true);
388
+ this.alertService.addAlert("Product saved successfully!", "success");
389
+ },
390
+ error: () => (this.isWorking = false),
391
+ });
392
+ }
393
+ /**
394
+ * Method to evaluate form fields
395
+ */
396
+ isFieldValid(field) {
397
+ return this.formValidatorService.isFieldValid(field, this.productForm);
398
+ }
399
+ /**
400
+ * Method to find error in form fields
401
+ */
402
+ getErrorMessage(field) {
403
+ return this.formValidatorService.getErrorMessage(field, this.productForm, errorMessages);
404
+ }
405
+ /**
406
+ * Checks displayed Form Fields array for form field and returns boolean result
407
+ */
408
+ isFormFieldShown(fieldName) {
409
+ return (this.displayedFormFields.length > 0 &&
410
+ this.displayedFormFields.includes(fieldName));
411
+ }
412
+ /**
413
+ * Checks displayed Form Section array for form section and returns boolean result
414
+ */
415
+ isFormSectionShown(sectionName) {
416
+ return (this.displayedFormSections.length > 0 &&
417
+ this.displayedFormSections.includes(sectionName));
418
+ }
419
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductFormComponent, deps: [{ token: ProductService }, { token: i2.FormBuilder }, { token: i1$1.FormValidatorService }, { token: i1$1.AlertService }, { token: i4.DatePipe }, { token: ProductFormService }], target: i0.ɵɵFactoryTarget.Component });
420
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductFormComponent, selector: "app-product-form", inputs: { product: "product", displayedFormFields: "displayedFormFields", displayedFormSections: "displayedFormSections" }, outputs: { saved: "saved", cancelled: "cancelled" }, ngImport: i0, template: "<form [formGroup]=\"productForm\" (submit)=\"save()\">\n <h3 class=\"text-center\">{{ product?.id ? \"Update\" : \"Create\" }} Product</h3>\n <div fxLayout=\"column\">\n <div fxLayout=\"column\" *ngIf=\"isFormSectionShown('basic information')\">\n <h3><strong>Basic Information</strong></h3>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('name')\">\n <input matInput placeholder=\"Name\" formControlName=\"name\" required />\n <mat-error *ngIf=\"isFieldValid('name')\"\n >{{ getErrorMessage(\"name\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('product type')\">\n <mat-label>Product Type</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-types\"\n formControlName=\"type_id\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('type_id')\"\n >{{ getErrorMessage(\"type_id\") }}\n </mat-error>\n </mat-form-field>\n </div>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('sku')\">\n <input matInput placeholder=\"SKU\" formControlName=\"sku\" />\n <mat-error *ngIf=\"isFieldValid('sku')\"\n >{{ getErrorMessage(\"sku\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"50%\">\n <mat-label>Category</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-categories\"\n formControlName=\"category_ids\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('category_ids')\">\n {{ getErrorMessage(\"category_ids\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"100%\" *ngIf=\"isFormFieldShown('description')\">\n <textarea\n matInput\n placeholder=\"Description\"\n formControlName=\"description\"\n ></textarea>\n </mat-form-field>\n </div>\n </div>\n\n <div fxLayout=\"column\" *ngIf=\"isFormSectionShown('inventory information')\">\n <h3><strong>Inventory Information</strong></h3>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field\n fxFlex=\"50%\"\n *ngIf=\"isFormFieldShown('product measure')\"\n >\n <mat-label>Measure</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-measures\"\n formControlName=\"measure_id\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('measure_id')\"\n >{{ getErrorMessage(\"measure_id\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('reorder point')\">\n <input\n matInput\n placeholder=\"Reorder Point\"\n formControlName=\"reorder_point\"\n type=\"number\"\n />\n <mat-error *ngIf=\"isFieldValid('reorder_point')\"\n >{{ getErrorMessage(\"reorder_point\") }}\n </mat-error>\n </mat-form-field>\n </div>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field\n fxFlex=\"50%\"\n *ngIf=\"isFormFieldShown('initial quantity')\"\n >\n <input\n matInput\n placeholder=\"Initial Quantity\"\n formControlName=\"initial_quantity\"\n />\n <mat-error *ngIf=\"isFieldValid('initial_quantity')\"\n >{{ getErrorMessage(\"initial_quantity\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field\n fxFlex=\"50%\"\n *ngIf=\"isFormFieldShown('initial quantity date')\"\n >\n <input\n matInput\n [matDatepicker]=\"pickerInitialQuantityDate\"\n placeholder=\"Initial Quantity Date\"\n formControlName=\"initial_quantity_date\"\n />\n <mat-datepicker-toggle\n matSuffix\n [for]=\"pickerInitialQuantityDate\"\n ></mat-datepicker-toggle>\n <mat-datepicker #pickerInitialQuantityDate></mat-datepicker>\n <mat-error *ngIf=\"isFieldValid('initial_quantity_date')\"\n >{{ getErrorMessage(\"initial_quantity_date\") }}\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n <div fxLayout=\"column\" *ngIf=\"isFormSectionShown('sales information')\">\n <h3><strong>Sale Information</strong></h3>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('sales price')\">\n <input\n matInput\n placeholder=\"Selling Price\"\n formControlName=\"sale_price\"\n required\n type=\"number\"\n step=\"any\"\n />\n <mat-error *ngIf=\"isFieldValid('sale_price')\"\n >{{ getErrorMessage(\"sale_price\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field\n fxFlex=\"50%\"\n *ngIf=\"isFormFieldShown('condition types')\"\n >\n <mat-label>Condition</mat-label>\n <app-searchable-selector\n apiUrl=\"api/condition-types\"\n formControlName=\"condition_type_id\"\n ></app-searchable-selector>\n </mat-form-field>\n </div>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('minimum price')\">\n <input\n matInput\n placeholder=\"Minimum Price\"\n formControlName=\"minimum_price\"\n required\n type=\"number\"\n step=\"any\"\n />\n <mat-error *ngIf=\"isFieldValid('minimum_price')\"\n >{{ getErrorMessage(\"minimum_price\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('maximum price')\">\n <input\n matInput\n placeholder=\"Maximum Price\"\n formControlName=\"maximum_price\"\n type=\"number\"\n step=\"any\"\n />\n </mat-form-field>\n </div>\n </div>\n <!-- <div fxLayout=\"column\" *ngIf=\"isFormSectionShown('accounts information')\">-->\n <!-- <h3><strong>Accounts Information</strong></h3>-->\n <!-- <div fxLayout fxLayoutGap=\"0.5rem\">-->\n <!-- <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('income account')\">-->\n <!-- <mat-label>Income Account</mat-label>-->\n <!-- <app-searchable-selector apiUrl=\"api/accounts\" formControlName=\"income_account_id\"> </app-searchable-selector>-->\n <!-- </mat-form-field>-->\n <!-- <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('expense account')\">-->\n <!-- <mat-label>Expense Account</mat-label>-->\n <!-- <app-searchable-selector apiUrl=\"api/accounts\" formControlName=\"expense_account_id\">-->\n <!-- </app-searchable-selector>-->\n <!-- </mat-form-field>-->\n <!-- </div>-->\n <!-- </div>-->\n <div fxFlex=\"100%\" fxLayout fxLayoutAlign=\"end\" fxLayoutGap=\"1rem\">\n <button\n [disabled]=\"isWorking\"\n mat-button\n class=\"mt-2\"\n type=\"button\"\n (click)=\"cancelled.emit(true)\"\n >\n Cancel\n </button>\n <button\n [disabled]=\"isWorking\"\n mat-raised-button\n color=\"primary\"\n class=\"mt-2\"\n type=\"submit\"\n >\n Save\n </button>\n </div>\n </div>\n</form>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i7$1.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: i9.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i9.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i9.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i10.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i10.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i10.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i10.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { 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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { 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.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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"] }], preserveWhitespaces: true });
421
+ }
422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductFormComponent, decorators: [{
423
+ type: Component,
424
+ args: [{ selector: "app-product-form", template: "<form [formGroup]=\"productForm\" (submit)=\"save()\">\n <h3 class=\"text-center\">{{ product?.id ? \"Update\" : \"Create\" }} Product</h3>\n <div fxLayout=\"column\">\n <div fxLayout=\"column\" *ngIf=\"isFormSectionShown('basic information')\">\n <h3><strong>Basic Information</strong></h3>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('name')\">\n <input matInput placeholder=\"Name\" formControlName=\"name\" required />\n <mat-error *ngIf=\"isFieldValid('name')\"\n >{{ getErrorMessage(\"name\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('product type')\">\n <mat-label>Product Type</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-types\"\n formControlName=\"type_id\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('type_id')\"\n >{{ getErrorMessage(\"type_id\") }}\n </mat-error>\n </mat-form-field>\n </div>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('sku')\">\n <input matInput placeholder=\"SKU\" formControlName=\"sku\" />\n <mat-error *ngIf=\"isFieldValid('sku')\"\n >{{ getErrorMessage(\"sku\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"50%\">\n <mat-label>Category</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-categories\"\n formControlName=\"category_ids\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('category_ids')\">\n {{ getErrorMessage(\"category_ids\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"100%\" *ngIf=\"isFormFieldShown('description')\">\n <textarea\n matInput\n placeholder=\"Description\"\n formControlName=\"description\"\n ></textarea>\n </mat-form-field>\n </div>\n </div>\n\n <div fxLayout=\"column\" *ngIf=\"isFormSectionShown('inventory information')\">\n <h3><strong>Inventory Information</strong></h3>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field\n fxFlex=\"50%\"\n *ngIf=\"isFormFieldShown('product measure')\"\n >\n <mat-label>Measure</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-measures\"\n formControlName=\"measure_id\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('measure_id')\"\n >{{ getErrorMessage(\"measure_id\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('reorder point')\">\n <input\n matInput\n placeholder=\"Reorder Point\"\n formControlName=\"reorder_point\"\n type=\"number\"\n />\n <mat-error *ngIf=\"isFieldValid('reorder_point')\"\n >{{ getErrorMessage(\"reorder_point\") }}\n </mat-error>\n </mat-form-field>\n </div>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field\n fxFlex=\"50%\"\n *ngIf=\"isFormFieldShown('initial quantity')\"\n >\n <input\n matInput\n placeholder=\"Initial Quantity\"\n formControlName=\"initial_quantity\"\n />\n <mat-error *ngIf=\"isFieldValid('initial_quantity')\"\n >{{ getErrorMessage(\"initial_quantity\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field\n fxFlex=\"50%\"\n *ngIf=\"isFormFieldShown('initial quantity date')\"\n >\n <input\n matInput\n [matDatepicker]=\"pickerInitialQuantityDate\"\n placeholder=\"Initial Quantity Date\"\n formControlName=\"initial_quantity_date\"\n />\n <mat-datepicker-toggle\n matSuffix\n [for]=\"pickerInitialQuantityDate\"\n ></mat-datepicker-toggle>\n <mat-datepicker #pickerInitialQuantityDate></mat-datepicker>\n <mat-error *ngIf=\"isFieldValid('initial_quantity_date')\"\n >{{ getErrorMessage(\"initial_quantity_date\") }}\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n <div fxLayout=\"column\" *ngIf=\"isFormSectionShown('sales information')\">\n <h3><strong>Sale Information</strong></h3>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('sales price')\">\n <input\n matInput\n placeholder=\"Selling Price\"\n formControlName=\"sale_price\"\n required\n type=\"number\"\n step=\"any\"\n />\n <mat-error *ngIf=\"isFieldValid('sale_price')\"\n >{{ getErrorMessage(\"sale_price\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field\n fxFlex=\"50%\"\n *ngIf=\"isFormFieldShown('condition types')\"\n >\n <mat-label>Condition</mat-label>\n <app-searchable-selector\n apiUrl=\"api/condition-types\"\n formControlName=\"condition_type_id\"\n ></app-searchable-selector>\n </mat-form-field>\n </div>\n <div fxLayout fxLayoutGap=\"0.5rem\">\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('minimum price')\">\n <input\n matInput\n placeholder=\"Minimum Price\"\n formControlName=\"minimum_price\"\n required\n type=\"number\"\n step=\"any\"\n />\n <mat-error *ngIf=\"isFieldValid('minimum_price')\"\n >{{ getErrorMessage(\"minimum_price\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('maximum price')\">\n <input\n matInput\n placeholder=\"Maximum Price\"\n formControlName=\"maximum_price\"\n type=\"number\"\n step=\"any\"\n />\n </mat-form-field>\n </div>\n </div>\n <!-- <div fxLayout=\"column\" *ngIf=\"isFormSectionShown('accounts information')\">-->\n <!-- <h3><strong>Accounts Information</strong></h3>-->\n <!-- <div fxLayout fxLayoutGap=\"0.5rem\">-->\n <!-- <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('income account')\">-->\n <!-- <mat-label>Income Account</mat-label>-->\n <!-- <app-searchable-selector apiUrl=\"api/accounts\" formControlName=\"income_account_id\"> </app-searchable-selector>-->\n <!-- </mat-form-field>-->\n <!-- <mat-form-field fxFlex=\"50%\" *ngIf=\"isFormFieldShown('expense account')\">-->\n <!-- <mat-label>Expense Account</mat-label>-->\n <!-- <app-searchable-selector apiUrl=\"api/accounts\" formControlName=\"expense_account_id\">-->\n <!-- </app-searchable-selector>-->\n <!-- </mat-form-field>-->\n <!-- </div>-->\n <!-- </div>-->\n <div fxFlex=\"100%\" fxLayout fxLayoutAlign=\"end\" fxLayoutGap=\"1rem\">\n <button\n [disabled]=\"isWorking\"\n mat-button\n class=\"mt-2\"\n type=\"button\"\n (click)=\"cancelled.emit(true)\"\n >\n Cancel\n </button>\n <button\n [disabled]=\"isWorking\"\n mat-raised-button\n color=\"primary\"\n class=\"mt-2\"\n type=\"submit\"\n >\n Save\n </button>\n </div>\n </div>\n</form>\n" }]
425
+ }], ctorParameters: () => [{ type: ProductService }, { type: i2.FormBuilder }, { type: i1$1.FormValidatorService }, { type: i1$1.AlertService }, { type: i4.DatePipe }, { type: ProductFormService }], propDecorators: { saved: [{
426
+ type: Output
427
+ }], cancelled: [{
428
+ type: Output
429
+ }], product: [{
430
+ type: Input
431
+ }], displayedFormFields: [{
432
+ type: Input
433
+ }], displayedFormSections: [{
434
+ type: Input
435
+ }] } });
436
+
437
+ class ProductFormButtonComponent {
438
+ matDialog;
439
+ productFormService;
440
+ product;
441
+ saved = new EventEmitter();
442
+ constructor(matDialog, productFormService) {
443
+ this.matDialog = matDialog;
444
+ this.productFormService = productFormService;
445
+ }
446
+ showForm(templateRef) {
447
+ this.matDialog.open(templateRef, { width: "600px" });
448
+ }
449
+ /**
450
+ * Handle on product saved event.
451
+ *
452
+ * @param product
453
+ */
454
+ onProductSaved(product) {
455
+ this.saved.emit(product);
456
+ this.matDialog?.closeAll();
457
+ this.productFormService.listUpdated(true);
458
+ }
459
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductFormButtonComponent, deps: [{ token: i1.MatDialog }, { token: ProductFormService }], target: i0.ɵɵFactoryTarget.Component });
460
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductFormButtonComponent, selector: "app-product-form-button", inputs: { product: "product" }, outputs: { saved: "saved" }, ngImport: i0, template: "<mat-icon\n color=\"primary\"\n class=\"cursor-pointer\"\n [class.text-secondary]=\"product\"\n (click)=\"showForm(addProductForm)\"\n>\n {{ product ? \"edit\" : \"add\" }}\n</mat-icon>\n\n<ng-template #addProductForm>\n <app-product-form\n [product]=\"product\"\n mat-dialog-content\n (saved)=\"onProductSaved($event)\"\n (cancelled)=\"matDialog.closeAll()\"\n ></app-product-form>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: ProductFormComponent, selector: "app-product-form", inputs: ["product", "displayedFormFields", "displayedFormSections"], outputs: ["saved", "cancelled"] }], preserveWhitespaces: true });
461
+ }
462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductFormButtonComponent, decorators: [{
463
+ type: Component,
464
+ args: [{ selector: "app-product-form-button", template: "<mat-icon\n color=\"primary\"\n class=\"cursor-pointer\"\n [class.text-secondary]=\"product\"\n (click)=\"showForm(addProductForm)\"\n>\n {{ product ? \"edit\" : \"add\" }}\n</mat-icon>\n\n<ng-template #addProductForm>\n <app-product-form\n [product]=\"product\"\n mat-dialog-content\n (saved)=\"onProductSaved($event)\"\n (cancelled)=\"matDialog.closeAll()\"\n ></app-product-form>\n</ng-template>\n" }]
465
+ }], ctorParameters: () => [{ type: i1.MatDialog }, { type: ProductFormService }], propDecorators: { product: [{
466
+ type: Input
467
+ }], saved: [{
468
+ type: Output
469
+ }] } });
470
+
471
+ let ProductListComponent = class ProductListComponent {
472
+ fb;
473
+ dialog;
474
+ activatedRoute;
475
+ productService;
476
+ requestHelperService;
477
+ productFormService;
478
+ filterForm;
479
+ lastPage;
480
+ page = 1;
481
+ perPage = 25;
482
+ totalItems = 0;
483
+ currentPage = 1;
484
+ num_items = 25;
485
+ routeFilters;
486
+ products = [];
487
+ dataSource = new MatTableDataSource();
488
+ isLoading = false;
489
+ columnDefinitions = [
490
+ { def: "#", isShow: true },
491
+ { def: "name", isShow: true },
492
+ { def: "type", isShow: true },
493
+ { def: "sku", isShow: true },
494
+ { def: "initial_quantity", isShow: true },
495
+ { def: "initial_quantity_date", isShow: true },
496
+ { def: "reorder_point", isShow: true },
497
+ { def: "sale_price", isShow: true },
498
+ { def: "income_account", isShow: true },
499
+ { def: "expense_account", isShow: true },
500
+ { def: "Actions", isShow: true },
501
+ ];
502
+ displayedColumns = new FormControl([
503
+ "#",
504
+ "name",
505
+ "type",
506
+ "categories",
507
+ "sku",
508
+ "initial_quantity",
509
+ "initial_quantity_date",
510
+ "reorder_point",
511
+ "sale_price",
512
+ "income_account",
513
+ "expense_account",
514
+ "Actions",
515
+ ]);
516
+ importId;
517
+ constructor(fb, dialog, activatedRoute, productService, requestHelperService, productFormService) {
518
+ this.fb = fb;
519
+ this.dialog = dialog;
520
+ this.activatedRoute = activatedRoute;
521
+ this.productService = productService;
522
+ this.requestHelperService = requestHelperService;
523
+ this.productFormService = productFormService;
524
+ this.filterForm = this.fb.group({
525
+ search: [""],
526
+ category_ids: [""],
527
+ type_ids: [""],
528
+ income_account_ids: [""],
529
+ expense_account_ids: [""],
530
+ sort_by: [""],
531
+ });
532
+ }
533
+ ngOnInit() {
534
+ if (this.activatedRoute.snapshot.params?.["import_id"]) {
535
+ this.importId = parseInt(this.activatedRoute.snapshot.params?.["import_id"]);
536
+ }
537
+ // update form with URL query params
538
+ this.requestHelperService.updateFormWithQueryParams(this.filterForm, {
539
+ type_ids: { multiple: true },
540
+ category_ids: { multiple: true },
541
+ income_account_ids: { multiple: true },
542
+ expense_account_ids: { multiple: true },
543
+ });
544
+ // Update URL query params on filter change
545
+ this.filterForm.valueChanges.pipe(debounceTime(800)).subscribe(() => {
546
+ this.requestHelperService.updateQueryParams(this.requestHelperService.convertToFormData({
547
+ ...this.filterForm.value,
548
+ }));
549
+ });
550
+ // fetch task on params change
551
+ this.activatedRoute.queryParams
552
+ .pipe(debounceTime(800))
553
+ .subscribe(() => this.reload());
554
+ // listen form product add or update event and reload.
555
+ this.productFormService.isListUpdated().subscribe((val) => {
556
+ if (val && !this.isLoading) {
557
+ this.reload();
558
+ }
559
+ });
560
+ }
561
+ loadData() {
562
+ let params = {
563
+ ...this.requestHelperService.convertToFormData(this.filterForm.value),
564
+ };
565
+ params.page = this.page;
566
+ params.perPage = this.perPage;
567
+ params.num_items = this.num_items + "|" + this.currentPage;
568
+ params.with = "categories,lastStockReceipt,lastStockIssuance";
569
+ if (this.importId) {
570
+ params.import_id = this.importId;
571
+ }
572
+ this.isLoading = true;
573
+ this.productService.index(params).subscribe({
574
+ next: (res) => {
575
+ this.isLoading = false;
576
+ this.dataSource = new MatTableDataSource(this.dataSource.data.concat(res?.data));
577
+ this.totalItems = res.total;
578
+ // stop reloading data once data loaded.
579
+ this.productFormService.listUpdated(false);
580
+ },
581
+ error: () => (this.isLoading = false),
582
+ });
583
+ }
584
+ reload() {
585
+ if (this.isLoading)
586
+ return;
587
+ this.dataSource = new MatTableDataSource();
588
+ this.currentPage = 1;
589
+ this.loadData();
590
+ }
591
+ modifyProduct(model) {
592
+ const dialogRef = this.dialog.open(ProductFormComponent, {
593
+ width: "600px",
594
+ data: {
595
+ details: model,
596
+ },
597
+ });
598
+ dialogRef.afterClosed().subscribe((result) => {
599
+ if (result) {
600
+ this.reload();
601
+ }
602
+ });
603
+ }
604
+ assignFilter(column, direction) {
605
+ if (column) {
606
+ return this.filterForm.get("sort_by")?.setValue(column + "|" + direction);
607
+ }
608
+ }
609
+ sortColumn(event) {
610
+ var direction = event.direction.toString().toUpperCase();
611
+ this.assignFilter(event.active, direction);
612
+ }
613
+ onScroll() {
614
+ if (this.totalItems > this.dataSource.data.length) {
615
+ this.currentPage += 1;
616
+ this.loadData();
617
+ }
618
+ }
619
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductListComponent, deps: [{ token: i2.FormBuilder }, { token: i1.MatDialog }, { token: i2$1.ActivatedRoute }, { token: ProductService }, { token: i1$1.RequestHelperService }, { token: ProductFormService }], target: i0.ɵɵFactoryTarget.Component });
620
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductListComponent, selector: "app-product-list", ngImport: i0, template: "<mat-card class=\"mb-3\">\n <mat-card-content>\n <form\n [formGroup]=\"filterForm\"\n class=\"d-flex justify-content-between align-items-center gap-2\"\n >\n <div class=\"d-flex justify-content-center align-items-center gap-2\">\n <h3 class=\"mb-0\">Products</h3>\n <app-product-form-button></app-product-form-button>\n <mat-icon\n routerLink=\"import\"\n class=\"cursor-pointer\"\n matTooltip=\"Import\"\n >\n download\n </mat-icon>\n </div>\n\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <mat-form-field style=\"width: 120px\">\n <input matInput placeholder=\"Product\" formControlName=\"search\" />\n </mat-form-field>\n\n <mat-form-field style=\"width: 120px\">\n <mat-label>Category</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-categories\"\n formControlName=\"category_ids\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field style=\"width: 120px\">\n <mat-label>Type</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-types\"\n formControlName=\"type_ids\"\n titleField=\"title\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n </mat-form-field>\n <!-- <mat-form-field style=\"width: 150px\">-->\n <!-- <mat-label>Income Account</mat-label>-->\n <!-- <app-searchable-selector-->\n <!-- apiUrl=\"api/accounts\"-->\n <!-- formControlName=\"income_account_ids\"-->\n <!-- titleField=\"title\"-->\n <!-- [multiple]=\"true\"-->\n <!-- >-->\n <!-- </app-searchable-selector>-->\n <!-- </mat-form-field>-->\n <!-- <mat-form-field style=\"width: 150px\">-->\n <!-- <mat-label>Expense Account</mat-label>-->\n <!-- <app-searchable-selector-->\n <!-- apiUrl=\"api/accounts\"-->\n <!-- formControlName=\"expense_account_ids\"-->\n <!-- titleField=\"title\"-->\n <!-- [multiple]=\"true\"-->\n <!-- >-->\n <!-- </app-searchable-selector>-->\n <!-- </mat-form-field>-->\n <mat-form-field>\n <mat-label>Columns</mat-label>\n <mat-select [formControl]=\"displayedColumns\" multiple>\n <mat-option\n *ngFor=\"let column of columnDefinitions\"\n [value]=\"column.def\"\n [disabled]=\"!column.isShow\"\n >\n {{ column?.def }}</mat-option\n >\n </mat-select>\n </mat-form-field>\n </div>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card>\n <mat-card-content class=\"p-0\">\n <table\n mat-table\n [dataSource]=\"dataSource\"\n class=\"w-100\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n [fromRoot]=\"true\"\n matSort\n (matSortChange)=\"sortColumn($event)\"\n matSortDisableClear=\"true\"\n aria-describedby=\"Products List\"\n >\n <!-- # Column -->\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 <!-- Name Column -->\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Name</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.name }}</td>\n </ng-container>\n\n <!-- Type Column -->\n <ng-container matColumnDef=\"type\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Type</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.type?.title }}</td>\n </ng-container>\n\n <!-- Categories Column -->\n <ng-container matColumnDef=\"categories\">\n <th mat-header-cell *matHeaderCellDef>Category</th>\n <td mat-cell *matCellDef=\"let element\" style=\"max-width: 200px\">\n <div\n *ngIf=\"element?.categories?.length > 0\"\n class=\"d-flex justify-content-start align-items-center gap-1 flex-wrap\"\n >\n <span\n class=\"badge badge-primary\"\n *ngFor=\"let category of element?.categories\"\n >\n {{ category?.title }}\n </span>\n </div>\n </td>\n </ng-container>\n\n <!-- SKU Column -->\n <ng-container matColumnDef=\"sku\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>SKU</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.sku }}</td>\n </ng-container>\n\n <!-- Initial Quantity Column -->\n <ng-container matColumnDef=\"initial_quantity\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n Initial Quantity\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element.initial_quantity }}\n </td>\n </ng-container>\n\n <!-- Initial Quantity Date Column -->\n <ng-container matColumnDef=\"initial_quantity_date\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n Initial Quantity Date\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element.initial_quantity_date }}\n </td>\n </ng-container>\n\n <!-- Reorder Point Column -->\n <ng-container matColumnDef=\"reorder_point\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Reorder Point</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element.reorder_point }}\n </td>\n </ng-container>\n\n <!-- Selling Price Column -->\n <ng-container matColumnDef=\"sale_price\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Selling Price</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element.sale_price | currency }}\n </td>\n </ng-container>\n\n <!-- Income Account Column -->\n <ng-container matColumnDef=\"income_account\">\n <th mat-header-cell *matHeaderCellDef>Income Account</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.income_account?.title }}\n </td>\n </ng-container>\n\n <!-- Expense Account Column -->\n <ng-container matColumnDef=\"expense_account\">\n <th mat-header-cell *matHeaderCellDef>Expense Account</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.expense_account?.title }}\n </td>\n </ng-container>\n\n <!-- Actions Column -->\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 gap-1\">\n <app-product-form-button\n [product]=\"element\"\n ></app-product-form-button>\n <mat-icon\n class=\"cursor-pointer\"\n matTooltip=\"View\"\n [routerLink]=\"[element.id, 'view']\"\n routerLinkActive=\"route-link-active\"\n >\n remove_red_eye\n </mat-icon>\n\n <app-stock-receipt-form-button\n [product]=\"element\"\n (saved)=\"reload()\"\n ></app-stock-receipt-form-button>\n\n <app-stock-issue-form-button\n [product]=\"element\"\n (saved)=\"reload()\"\n ></app-stock-issue-form-button>\n </div>\n </td>\n </ng-container>\n <tr\n mat-header-row\n *matHeaderRowDef=\"displayedColumns.value; sticky: true\"\n ></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns.value\"></tr>\n </table>\n\n <mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { 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: StockReceiptFormButtonComponent, selector: "app-stock-receipt-form-button", inputs: ["product", "stockReceipt", "icon"], outputs: ["saved"] }, { kind: "component", type: StockIssueFormButtonComponent, selector: "app-stock-issue-form-button", inputs: ["product", "stockIssuance", "icon", "issuableType", "issuableId"], outputs: ["saved"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7$1.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: i10$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i5.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$2.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i2$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i7$2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i10$2.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: 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["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: "component", type: ProductFormButtonComponent, selector: "app-product-form-button", inputs: ["product"], outputs: ["saved"] }, { kind: "pipe", type: i4.CurrencyPipe, name: "currency" }], preserveWhitespaces: true });
621
+ };
622
+ ProductListComponent = __decorate([
623
+ UntilDestroy()
624
+ ], ProductListComponent);
625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductListComponent, decorators: [{
626
+ type: Component,
627
+ args: [{ selector: "app-product-list", template: "<mat-card class=\"mb-3\">\n <mat-card-content>\n <form\n [formGroup]=\"filterForm\"\n class=\"d-flex justify-content-between align-items-center gap-2\"\n >\n <div class=\"d-flex justify-content-center align-items-center gap-2\">\n <h3 class=\"mb-0\">Products</h3>\n <app-product-form-button></app-product-form-button>\n <mat-icon\n routerLink=\"import\"\n class=\"cursor-pointer\"\n matTooltip=\"Import\"\n >\n download\n </mat-icon>\n </div>\n\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <mat-form-field style=\"width: 120px\">\n <input matInput placeholder=\"Product\" formControlName=\"search\" />\n </mat-form-field>\n\n <mat-form-field style=\"width: 120px\">\n <mat-label>Category</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-categories\"\n formControlName=\"category_ids\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field style=\"width: 120px\">\n <mat-label>Type</mat-label>\n <app-searchable-selector\n apiUrl=\"api/product-types\"\n formControlName=\"type_ids\"\n titleField=\"title\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n </mat-form-field>\n <!-- <mat-form-field style=\"width: 150px\">-->\n <!-- <mat-label>Income Account</mat-label>-->\n <!-- <app-searchable-selector-->\n <!-- apiUrl=\"api/accounts\"-->\n <!-- formControlName=\"income_account_ids\"-->\n <!-- titleField=\"title\"-->\n <!-- [multiple]=\"true\"-->\n <!-- >-->\n <!-- </app-searchable-selector>-->\n <!-- </mat-form-field>-->\n <!-- <mat-form-field style=\"width: 150px\">-->\n <!-- <mat-label>Expense Account</mat-label>-->\n <!-- <app-searchable-selector-->\n <!-- apiUrl=\"api/accounts\"-->\n <!-- formControlName=\"expense_account_ids\"-->\n <!-- titleField=\"title\"-->\n <!-- [multiple]=\"true\"-->\n <!-- >-->\n <!-- </app-searchable-selector>-->\n <!-- </mat-form-field>-->\n <mat-form-field>\n <mat-label>Columns</mat-label>\n <mat-select [formControl]=\"displayedColumns\" multiple>\n <mat-option\n *ngFor=\"let column of columnDefinitions\"\n [value]=\"column.def\"\n [disabled]=\"!column.isShow\"\n >\n {{ column?.def }}</mat-option\n >\n </mat-select>\n </mat-form-field>\n </div>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card>\n <mat-card-content class=\"p-0\">\n <table\n mat-table\n [dataSource]=\"dataSource\"\n class=\"w-100\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n [fromRoot]=\"true\"\n matSort\n (matSortChange)=\"sortColumn($event)\"\n matSortDisableClear=\"true\"\n aria-describedby=\"Products List\"\n >\n <!-- # Column -->\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 <!-- Name Column -->\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Name</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.name }}</td>\n </ng-container>\n\n <!-- Type Column -->\n <ng-container matColumnDef=\"type\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Type</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.type?.title }}</td>\n </ng-container>\n\n <!-- Categories Column -->\n <ng-container matColumnDef=\"categories\">\n <th mat-header-cell *matHeaderCellDef>Category</th>\n <td mat-cell *matCellDef=\"let element\" style=\"max-width: 200px\">\n <div\n *ngIf=\"element?.categories?.length > 0\"\n class=\"d-flex justify-content-start align-items-center gap-1 flex-wrap\"\n >\n <span\n class=\"badge badge-primary\"\n *ngFor=\"let category of element?.categories\"\n >\n {{ category?.title }}\n </span>\n </div>\n </td>\n </ng-container>\n\n <!-- SKU Column -->\n <ng-container matColumnDef=\"sku\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>SKU</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.sku }}</td>\n </ng-container>\n\n <!-- Initial Quantity Column -->\n <ng-container matColumnDef=\"initial_quantity\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n Initial Quantity\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element.initial_quantity }}\n </td>\n </ng-container>\n\n <!-- Initial Quantity Date Column -->\n <ng-container matColumnDef=\"initial_quantity_date\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n Initial Quantity Date\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element.initial_quantity_date }}\n </td>\n </ng-container>\n\n <!-- Reorder Point Column -->\n <ng-container matColumnDef=\"reorder_point\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Reorder Point</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element.reorder_point }}\n </td>\n </ng-container>\n\n <!-- Selling Price Column -->\n <ng-container matColumnDef=\"sale_price\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Selling Price</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element.sale_price | currency }}\n </td>\n </ng-container>\n\n <!-- Income Account Column -->\n <ng-container matColumnDef=\"income_account\">\n <th mat-header-cell *matHeaderCellDef>Income Account</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.income_account?.title }}\n </td>\n </ng-container>\n\n <!-- Expense Account Column -->\n <ng-container matColumnDef=\"expense_account\">\n <th mat-header-cell *matHeaderCellDef>Expense Account</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.expense_account?.title }}\n </td>\n </ng-container>\n\n <!-- Actions Column -->\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 gap-1\">\n <app-product-form-button\n [product]=\"element\"\n ></app-product-form-button>\n <mat-icon\n class=\"cursor-pointer\"\n matTooltip=\"View\"\n [routerLink]=\"[element.id, 'view']\"\n routerLinkActive=\"route-link-active\"\n >\n remove_red_eye\n </mat-icon>\n\n <app-stock-receipt-form-button\n [product]=\"element\"\n (saved)=\"reload()\"\n ></app-stock-receipt-form-button>\n\n <app-stock-issue-form-button\n [product]=\"element\"\n (saved)=\"reload()\"\n ></app-stock-issue-form-button>\n </div>\n </td>\n </ng-container>\n <tr\n mat-header-row\n *matHeaderRowDef=\"displayedColumns.value; sticky: true\"\n ></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns.value\"></tr>\n </table>\n\n <mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n" }]
628
+ }], ctorParameters: () => [{ type: i2.FormBuilder }, { type: i1.MatDialog }, { type: i2$1.ActivatedRoute }, { type: ProductService }, { type: i1$1.RequestHelperService }, { type: ProductFormService }] });
629
+
630
+ class ProductNavBarComponent {
631
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductNavBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
632
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductNavBarComponent, selector: "app-product-nav-bar", ngImport: i0, template: "<div>\n <router-outlet></router-outlet>\n</div>\n", dependencies: [{ kind: "directive", type: i2$1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], preserveWhitespaces: true });
633
+ }
634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductNavBarComponent, decorators: [{
635
+ type: Component,
636
+ args: [{ selector: "app-product-nav-bar", template: "<div>\n <router-outlet></router-outlet>\n</div>\n" }]
637
+ }] });
638
+
639
+ class ProductTaxService extends TechlifyServiceBaseClass {
640
+ constructor(httpService) {
641
+ super(httpService, "product-taxes");
642
+ }
643
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxService, deps: [{ token: i1$1.HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
644
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxService, providedIn: "root" });
645
+ }
646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxService, decorators: [{
647
+ type: Injectable,
648
+ args: [{
649
+ providedIn: "root",
650
+ }]
651
+ }], ctorParameters: () => [{ type: i1$1.HttpService }] });
652
+
653
+ class ProductTaxFormButtonComponent extends TechlifyFormComponentInterface {
654
+ matDialog;
655
+ productTaxService;
656
+ formBuilder;
657
+ alertService;
658
+ product;
659
+ saved = new EventEmitter();
660
+ isSaving;
661
+ constructor(matDialog, productTaxService, formValidatorService, formBuilder, alertService) {
662
+ super(formValidatorService);
663
+ this.matDialog = matDialog;
664
+ this.productTaxService = productTaxService;
665
+ this.formBuilder = formBuilder;
666
+ this.alertService = alertService;
667
+ this.errorMessages = {
668
+ tax_id: {
669
+ required: "The tax field is required.",
670
+ },
671
+ };
672
+ this.form = this.formBuilder.group({
673
+ product_id: [""],
674
+ tax_id: ["", Validators.required],
675
+ });
676
+ }
677
+ ngOnInit() {
678
+ if (this.product) {
679
+ this.form.get("product_id")?.setValue(this.product?.id);
680
+ }
681
+ }
682
+ showForm(templateRef) {
683
+ this.matDialog.open(templateRef, { width: "400px" });
684
+ }
685
+ save() {
686
+ this.form.markAllAsTouched();
687
+ if (this.form.invalid) {
688
+ this.alertService.addAlert("Please check the form for errors.", "error");
689
+ return;
690
+ }
691
+ const data = { ...this.form.value };
692
+ const params = {
693
+ with: "tax.type",
694
+ };
695
+ this.isSaving = true;
696
+ this.productTaxService.store(data, params).subscribe({
697
+ next: (response) => {
698
+ this.isSaving = false;
699
+ this.matDialog.closeAll();
700
+ this.alertService.addAlert("Product tax saved successfully!", "success");
701
+ this.saved.emit(response?.item);
702
+ },
703
+ error: () => (this.isSaving = false),
704
+ });
705
+ }
706
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxFormButtonComponent, deps: [{ token: i1.MatDialog }, { token: ProductTaxService }, { token: i1$1.FormValidatorService }, { token: i2.FormBuilder }, { token: i1$1.AlertService }], target: i0.ɵɵFactoryTarget.Component });
707
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductTaxFormButtonComponent, selector: "app-product-tax-form-button", inputs: { product: "product" }, outputs: { saved: "saved" }, usesInheritance: true, ngImport: i0, template: "<mat-icon\n color=\"primary\"\n class=\"cursor-pointer\"\n (click)=\"showForm(formTemplate)\"\n>\n add\n</mat-icon>\n\n<ng-template #formTemplate>\n <form\n [formGroup]=\"form\"\n (submit)=\"save()\"\n mat-dialog-content\n class=\"d-flex flex-column gap-2\"\n >\n <h3 class=\"text-dark\">Add tax for {{ product?.name }}</h3>\n <mat-form-field>\n <mat-label>Tax</mat-label>\n <app-searchable-selector\n formControlName=\"tax_id\"\n required\n apiUrl=\"api/taxes\"\n [enableSearch]=\"false\"\n ></app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('tax_id')\">\n {{ getErrorMessage(\"tax_id\") }}\n </mat-error>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-3\">\n <button\n [disabled]=\"isSaving\"\n type=\"submit\"\n mat-raised-button\n color=\"primary\"\n >\n Save\n </button>\n <button\n [disabled]=\"isSaving\"\n type=\"button\"\n mat-flat-button\n mat-dialog-close\n >\n Cancel\n </button>\n </div>\n </form>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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: "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"] }], preserveWhitespaces: true });
708
+ }
709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxFormButtonComponent, decorators: [{
710
+ type: Component,
711
+ args: [{ selector: "app-product-tax-form-button", template: "<mat-icon\n color=\"primary\"\n class=\"cursor-pointer\"\n (click)=\"showForm(formTemplate)\"\n>\n add\n</mat-icon>\n\n<ng-template #formTemplate>\n <form\n [formGroup]=\"form\"\n (submit)=\"save()\"\n mat-dialog-content\n class=\"d-flex flex-column gap-2\"\n >\n <h3 class=\"text-dark\">Add tax for {{ product?.name }}</h3>\n <mat-form-field>\n <mat-label>Tax</mat-label>\n <app-searchable-selector\n formControlName=\"tax_id\"\n required\n apiUrl=\"api/taxes\"\n [enableSearch]=\"false\"\n ></app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('tax_id')\">\n {{ getErrorMessage(\"tax_id\") }}\n </mat-error>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-3\">\n <button\n [disabled]=\"isSaving\"\n type=\"submit\"\n mat-raised-button\n color=\"primary\"\n >\n Save\n </button>\n <button\n [disabled]=\"isSaving\"\n type=\"button\"\n mat-flat-button\n mat-dialog-close\n >\n Cancel\n </button>\n </div>\n </form>\n</ng-template>\n" }]
712
+ }], ctorParameters: () => [{ type: i1.MatDialog }, { type: ProductTaxService }, { type: i1$1.FormValidatorService }, { type: i2.FormBuilder }, { type: i1$1.AlertService }], propDecorators: { product: [{
713
+ type: Input
714
+ }], saved: [{
715
+ type: Output
716
+ }] } });
717
+
718
+ class ProductTaxDeleteButtonComponent {
719
+ matDialog;
720
+ productTaxService;
721
+ alertService;
722
+ productTax;
723
+ deleted = new EventEmitter();
724
+ isDeleting;
725
+ constructor(matDialog, productTaxService, alertService) {
726
+ this.matDialog = matDialog;
727
+ this.productTaxService = productTaxService;
728
+ this.alertService = alertService;
729
+ }
730
+ /**
731
+ * Delete the product.
732
+ */
733
+ delete() {
734
+ this.isDeleting = true;
735
+ this.productTaxService.delete(this.productTax).subscribe({
736
+ next: () => {
737
+ this.matDialog?.closeAll();
738
+ this.deleted.emit();
739
+ this.isDeleting = false;
740
+ this.alertService.addAlert("Product tax deleted successfully!", "success");
741
+ },
742
+ error: () => (this.isDeleting = false),
743
+ });
744
+ }
745
+ /**
746
+ * Show delete product dialog.
747
+ *
748
+ * @param templateRef
749
+ */
750
+ showDeleteDialog(templateRef) {
751
+ this.matDialog.open(templateRef, { width: "500px" });
752
+ }
753
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxDeleteButtonComponent, deps: [{ token: i1.MatDialog }, { token: ProductTaxService }, { token: i1$1.AlertService }], target: i0.ɵɵFactoryTarget.Component });
754
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductTaxDeleteButtonComponent, selector: "app-product-tax-delete-button", inputs: { productTax: "productTax" }, outputs: { deleted: "deleted" }, ngImport: i0, template: "<mat-icon\n class=\"cursor-pointer text-secondary\"\n (click)=\"showDeleteDialog(deleteConfirmDialog)\"\n>\n delete\n</mat-icon>\n\n<ng-template #deleteConfirmDialog>\n <h3 mat-dialog-title>Delete Product Tax</h3>\n <div mat-dialog-content>\n Are you sure? You want to delete the product tax?\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", dependencies: [{ kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], preserveWhitespaces: true });
755
+ }
756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxDeleteButtonComponent, decorators: [{
757
+ type: Component,
758
+ args: [{ selector: "app-product-tax-delete-button", template: "<mat-icon\n class=\"cursor-pointer text-secondary\"\n (click)=\"showDeleteDialog(deleteConfirmDialog)\"\n>\n delete\n</mat-icon>\n\n<ng-template #deleteConfirmDialog>\n <h3 mat-dialog-title>Delete Product Tax</h3>\n <div mat-dialog-content>\n Are you sure? You want to delete the product tax?\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" }]
759
+ }], ctorParameters: () => [{ type: i1.MatDialog }, { type: ProductTaxService }, { type: i1$1.AlertService }], propDecorators: { productTax: [{
760
+ type: Input
761
+ }], deleted: [{
762
+ type: Output
763
+ }] } });
764
+
765
+ class ProductTaxListComponent extends TechlifyListingControllerInterface {
766
+ product;
767
+ displayedColumns = ["#", "Tax", "Actions"];
768
+ ngOnInit() {
769
+ this.loadData();
770
+ }
771
+ loadData() {
772
+ this.models = this.product?.taxes ?? [];
773
+ }
774
+ onCreated(productTax) {
775
+ this.models.unshift(productTax);
776
+ this.models = [...this.models];
777
+ }
778
+ onDeleted(index) {
779
+ this.models.splice(index, 1);
780
+ this.models = [...this.models];
781
+ }
782
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
783
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductTaxListComponent, selector: "app-product-tax-list", inputs: { product: "product" }, usesInheritance: true, ngImport: i0, template: "<mat-card>\n <mat-card-content\n class=\"pb-3 d-flex justify-content-between align-items-center gap-3\"\n >\n <div class=\"d-flex justify-content-start gap-2\">\n <span class=\"material-symbols-outlined\"> percent </span>\n <strong class=\"mb-0 text-dark\">Product Taxes</strong>\n </div>\n <app-product-tax-form-button\n [product]=\"product\"\n (saved)=\"onCreated($event)\"\n ></app-product-tax-form-button>\n </mat-card-content>\n <mat-divider></mat-divider>\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\">\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=\"Tax\">\n <th mat-header-cell *matHeaderCellDef>Tax</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">\n {{ element?.tax?.title }} ({{ element?.tax?.code }})\n </p>\n <small class=\"text-secondary\"\n >{{ element?.tax?.value }} - {{ element?.tax?.type?.title }}</small\n >\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 <app-product-tax-delete-button\n [productTax]=\"element\"\n (deleted)=\"onDeleted(i)\"\n ></app-product-tax-delete-button>\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-card-content>\n</mat-card>\n", dependencies: [{ kind: "component", type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$2.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i6$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: ProductTaxFormButtonComponent, selector: "app-product-tax-form-button", inputs: ["product"], outputs: ["saved"] }, { kind: "component", type: ProductTaxDeleteButtonComponent, selector: "app-product-tax-delete-button", inputs: ["productTax"], outputs: ["deleted"] }], preserveWhitespaces: true });
784
+ }
785
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxListComponent, decorators: [{
786
+ type: Component,
787
+ args: [{ selector: "app-product-tax-list", template: "<mat-card>\n <mat-card-content\n class=\"pb-3 d-flex justify-content-between align-items-center gap-3\"\n >\n <div class=\"d-flex justify-content-start gap-2\">\n <span class=\"material-symbols-outlined\"> percent </span>\n <strong class=\"mb-0 text-dark\">Product Taxes</strong>\n </div>\n <app-product-tax-form-button\n [product]=\"product\"\n (saved)=\"onCreated($event)\"\n ></app-product-tax-form-button>\n </mat-card-content>\n <mat-divider></mat-divider>\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\">\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=\"Tax\">\n <th mat-header-cell *matHeaderCellDef>Tax</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">\n {{ element?.tax?.title }} ({{ element?.tax?.code }})\n </p>\n <small class=\"text-secondary\"\n >{{ element?.tax?.value }} - {{ element?.tax?.type?.title }}</small\n >\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 <app-product-tax-delete-button\n [productTax]=\"element\"\n (deleted)=\"onDeleted(i)\"\n ></app-product-tax-delete-button>\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-card-content>\n</mat-card>\n" }]
788
+ }], propDecorators: { product: [{
789
+ type: Input
790
+ }] } });
791
+
792
+ class ProductDeleteButtonComponent {
793
+ matDialog;
794
+ productService;
795
+ alertService;
796
+ product;
797
+ deleted = new EventEmitter();
798
+ isDeleting;
799
+ constructor(matDialog, productService, alertService) {
800
+ this.matDialog = matDialog;
801
+ this.productService = productService;
802
+ this.alertService = alertService;
803
+ }
804
+ /**
805
+ * Delete the product.
806
+ */
807
+ deleteProduct() {
808
+ this.isDeleting = true;
809
+ this.productService.delete(this.product).subscribe({
810
+ next: () => {
811
+ this.deleted.emit();
812
+ this.isDeleting = false;
813
+ this.matDialog.closeAll();
814
+ this.alertService.addAlert("Product deleted successfully!", "success");
815
+ },
816
+ error: () => (this.isDeleting = false),
817
+ });
818
+ }
819
+ /**
820
+ * Show delete product dialog.
821
+ *
822
+ * @param templateRef
823
+ */
824
+ showDeleteDialog(templateRef) {
825
+ this.matDialog.open(templateRef, { width: "500px" });
826
+ }
827
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductDeleteButtonComponent, deps: [{ token: i1.MatDialog }, { token: ProductService }, { token: i1$1.AlertService }], target: i0.ɵɵFactoryTarget.Component });
828
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductDeleteButtonComponent, selector: "app-product-delete-button", inputs: { product: "product" }, outputs: { deleted: "deleted" }, ngImport: i0, template: "<mat-icon\n class=\"cursor-pointer text-secondary\"\n (click)=\"showDeleteDialog(deleteProductDialog)\"\n>\n delete\n</mat-icon>\n\n<ng-template #deleteProductDialog>\n <h3 mat-dialog-title>Delete Product</h3>\n <div mat-dialog-content>\n Are you sure? You want to delete the\n <strong>{{ product?.name }}</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)=\"deleteProduct()\"\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: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], preserveWhitespaces: true });
829
+ }
830
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductDeleteButtonComponent, decorators: [{
831
+ type: Component,
832
+ args: [{ selector: "app-product-delete-button", template: "<mat-icon\n class=\"cursor-pointer text-secondary\"\n (click)=\"showDeleteDialog(deleteProductDialog)\"\n>\n delete\n</mat-icon>\n\n<ng-template #deleteProductDialog>\n <h3 mat-dialog-title>Delete Product</h3>\n <div mat-dialog-content>\n Are you sure? You want to delete the\n <strong>{{ product?.name }}</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)=\"deleteProduct()\"\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" }]
833
+ }], ctorParameters: () => [{ type: i1.MatDialog }, { type: ProductService }, { type: i1$1.AlertService }], propDecorators: { product: [{
834
+ type: Input
835
+ }], deleted: [{
836
+ type: Output
837
+ }] } });
838
+
839
+ class ProductBasicInfoComponent {
840
+ stockSummaryService;
841
+ product;
842
+ saved = new EventEmitter();
843
+ deleted = new EventEmitter();
844
+ stockSummary;
845
+ constructor(stockSummaryService) {
846
+ this.stockSummaryService = stockSummaryService;
847
+ }
848
+ ngOnInit() {
849
+ if (this.product) {
850
+ this.loadProductStocksSummary();
851
+ }
852
+ }
853
+ onProductSaved(product) {
854
+ this.product = product;
855
+ this.saved.emit(this.product);
856
+ }
857
+ /**
858
+ * Load product stocks summary.
859
+ */
860
+ loadProductStocksSummary() {
861
+ const params = {
862
+ product_ids: this.product?.id,
863
+ include: "stock_receipts_quantity_sum,stock_issuances_quantity_sum,stock_quantity_remaining",
864
+ };
865
+ this.stockSummaryService.summary(params).subscribe({
866
+ next: (response) => {
867
+ this.stockSummary = response;
868
+ },
869
+ });
870
+ }
871
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductBasicInfoComponent, deps: [{ token: StockSummaryService }], target: i0.ɵɵFactoryTarget.Component });
872
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductBasicInfoComponent, selector: "app-product-basic-info", inputs: { product: "product" }, outputs: { saved: "saved", deleted: "deleted" }, ngImport: i0, template: "<mat-card *ngIf=\"product\" class=\"w-100\">\n <mat-card-content\n class=\"d-flex justify-content-between align-items-center mb-1 mb-2\"\n >\n <div class=\"d-flex justify-content-start gap-2\">\n <span class=\"material-symbols-outlined\"> campaign </span>\n <strong class=\"mb-0 text-dark\">Product Information</strong>\n </div>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <app-product-form-button\n [product]=\"product\"\n (saved)=\"onProductSaved($event)\"\n ></app-product-form-button>\n <app-product-delete-button\n [product]=\"product\"\n (deleted)=\"deleted.emit()\"\n ></app-product-delete-button>\n </div>\n </mat-card-content>\n <mat-divider></mat-divider>\n <mat-card-content class=\"mt-3\">\n <h3 class=\"mb-1 font-weight-bold\">{{ product?.name }}</h3>\n <div class=\"d-flex flex-wrap gap-1\">\n <span\n class=\"badge badge-primary\"\n *ngFor=\"let category of product?.categories\"\n >\n {{ category?.title }}\n </span>\n </div>\n </mat-card-content>\n\n <mat-card-content\n class=\"mt-3 d-flex justify-content-between align-items-start\"\n >\n <div\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">SKU</small>\n <p class=\"mb-0\">{{ product?.sku }}</p>\n </div>\n <div\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Measure</small>\n <p class=\"mb-0\">{{ product?.measure?.title }}</p>\n </div>\n <div\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Reorder Point</small>\n <p class=\"mb-0\">{{ product?.reorder_point }}</p>\n </div>\n </mat-card-content>\n\n <mat-card-content\n class=\"mt-3 d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Description</small>\n <p class=\"mb-0\">{{ product?.description }}</p>\n </mat-card-content>\n\n <mat-card-content\n class=\"mt-5 d-flex justify-content-between align-items-start\"\n >\n <div\n *ngIf=\"stockSummary\"\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Stock Receipts</small>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> arrow_downward </span>\n <p class=\"mb-0\" style=\"font-size: 24px\">\n {{ stockSummary?.stock_receipts_quantity_sum }}\n </p>\n </div>\n <small *ngIf=\"product?.last_stock_receipt\" class=\"text-secondary\">\n Last Added On {{ product?.last_stock_receipt?.date | date }}\n </small>\n </div>\n <div\n *ngIf=\"stockSummary\"\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Stock Issuances</small>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> ungroup </span>\n <p class=\"mb-0\" style=\"font-size: 24px\">\n {{ stockSummary?.stock_issuances_quantity_sum }}\n </p>\n </div>\n <small *ngIf=\"product?.last_stock_issuance\" class=\"text-secondary\">\n Last Added On {{ product?.last_stock_issuance?.date | date }}\n </small>\n </div>\n </mat-card-content>\n\n <mat-card-content\n *ngIf=\"stockSummary\"\n class=\"mt-3 d-flex justify-content-center align-items-center\"\n >\n <div\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">On Hand</small>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> inventory_2 </span>\n <p class=\"mb-0\" style=\"font-size: 24px\">\n {{ stockSummary?.stock_quantity_remaining }}\n </p>\n </div>\n </div>\n </mat-card-content>\n</mat-card>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$2.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i6$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: ProductFormButtonComponent, selector: "app-product-form-button", inputs: ["product"], outputs: ["saved"] }, { kind: "component", type: ProductDeleteButtonComponent, selector: "app-product-delete-button", inputs: ["product"], outputs: ["deleted"] }, { kind: "pipe", type: i4.DatePipe, name: "date" }], preserveWhitespaces: true });
873
+ }
874
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductBasicInfoComponent, decorators: [{
875
+ type: Component,
876
+ args: [{ selector: "app-product-basic-info", template: "<mat-card *ngIf=\"product\" class=\"w-100\">\n <mat-card-content\n class=\"d-flex justify-content-between align-items-center mb-1 mb-2\"\n >\n <div class=\"d-flex justify-content-start gap-2\">\n <span class=\"material-symbols-outlined\"> campaign </span>\n <strong class=\"mb-0 text-dark\">Product Information</strong>\n </div>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <app-product-form-button\n [product]=\"product\"\n (saved)=\"onProductSaved($event)\"\n ></app-product-form-button>\n <app-product-delete-button\n [product]=\"product\"\n (deleted)=\"deleted.emit()\"\n ></app-product-delete-button>\n </div>\n </mat-card-content>\n <mat-divider></mat-divider>\n <mat-card-content class=\"mt-3\">\n <h3 class=\"mb-1 font-weight-bold\">{{ product?.name }}</h3>\n <div class=\"d-flex flex-wrap gap-1\">\n <span\n class=\"badge badge-primary\"\n *ngFor=\"let category of product?.categories\"\n >\n {{ category?.title }}\n </span>\n </div>\n </mat-card-content>\n\n <mat-card-content\n class=\"mt-3 d-flex justify-content-between align-items-start\"\n >\n <div\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">SKU</small>\n <p class=\"mb-0\">{{ product?.sku }}</p>\n </div>\n <div\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Measure</small>\n <p class=\"mb-0\">{{ product?.measure?.title }}</p>\n </div>\n <div\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Reorder Point</small>\n <p class=\"mb-0\">{{ product?.reorder_point }}</p>\n </div>\n </mat-card-content>\n\n <mat-card-content\n class=\"mt-3 d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Description</small>\n <p class=\"mb-0\">{{ product?.description }}</p>\n </mat-card-content>\n\n <mat-card-content\n class=\"mt-5 d-flex justify-content-between align-items-start\"\n >\n <div\n *ngIf=\"stockSummary\"\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Stock Receipts</small>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> arrow_downward </span>\n <p class=\"mb-0\" style=\"font-size: 24px\">\n {{ stockSummary?.stock_receipts_quantity_sum }}\n </p>\n </div>\n <small *ngIf=\"product?.last_stock_receipt\" class=\"text-secondary\">\n Last Added On {{ product?.last_stock_receipt?.date | date }}\n </small>\n </div>\n <div\n *ngIf=\"stockSummary\"\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">Stock Issuances</small>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> ungroup </span>\n <p class=\"mb-0\" style=\"font-size: 24px\">\n {{ stockSummary?.stock_issuances_quantity_sum }}\n </p>\n </div>\n <small *ngIf=\"product?.last_stock_issuance\" class=\"text-secondary\">\n Last Added On {{ product?.last_stock_issuance?.date | date }}\n </small>\n </div>\n </mat-card-content>\n\n <mat-card-content\n *ngIf=\"stockSummary\"\n class=\"mt-3 d-flex justify-content-center align-items-center\"\n >\n <div\n class=\"d-flex flex-column justify-content-start align-items-start gap-1\"\n >\n <small class=\"text-secondary\">On Hand</small>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> inventory_2 </span>\n <p class=\"mb-0\" style=\"font-size: 24px\">\n {{ stockSummary?.stock_quantity_remaining }}\n </p>\n </div>\n </div>\n </mat-card-content>\n</mat-card>\n" }]
877
+ }], ctorParameters: () => [{ type: StockSummaryService }], propDecorators: { product: [{
878
+ type: Input
879
+ }], saved: [{
880
+ type: Output
881
+ }], deleted: [{
882
+ type: Output
883
+ }] } });
884
+
885
+ class ProductViewPageComponent {
886
+ productService;
887
+ activatedRoute;
888
+ location;
889
+ product;
890
+ id;
891
+ isLoading;
892
+ constructor(productService, activatedRoute, location) {
893
+ this.productService = productService;
894
+ this.activatedRoute = activatedRoute;
895
+ this.location = location;
896
+ this.id = this.activatedRoute.snapshot.params?.["id"];
897
+ }
898
+ ngOnInit() {
899
+ if (this.id) {
900
+ this.getProduct(this.id);
901
+ }
902
+ }
903
+ /**
904
+ * Get the product details.
905
+ *
906
+ * @param productId
907
+ */
908
+ getProduct(productId) {
909
+ this.isLoading = true;
910
+ const params = {
911
+ with: "type,measure,incomeAccount,expenseAccount,categories,lastStockReceipt,lastStockIssuance,taxes.tax.type",
912
+ };
913
+ this.productService.show(productId, params).subscribe({
914
+ next: (result) => {
915
+ this.isLoading = false;
916
+ this.product = result?.item;
917
+ },
918
+ error: () => (this.isLoading = false),
919
+ });
920
+ }
921
+ /**
922
+ * Handle the on product update event.
923
+ *
924
+ * @param product
925
+ */
926
+ onProductUpdated(product) {
927
+ this.getProduct(this.id);
928
+ }
929
+ /**
930
+ * Handle on product delete event.
931
+ */
932
+ onProductDeleted() {
933
+ this.location.back();
934
+ }
935
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductViewPageComponent, deps: [{ token: ProductService }, { token: i2$1.ActivatedRoute }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Component });
936
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductViewPageComponent, selector: "app-product-view-page", ngImport: i0, template: "<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n\n<div\n *ngIf=\"product\"\n class=\"d-flex justify-content-start align-items-start gap-3\"\n>\n <div style=\"width: calc(25% - 1rem)\" class=\"d-flex flex-column gap-3\">\n <app-product-basic-info\n [product]=\"product\"\n #productBasicInfoComponent\n (deleted)=\"onProductDeleted()\"\n (saved)=\"onProductUpdated($event)\"\n ></app-product-basic-info>\n\n <app-product-tax-list [product]=\"product\"></app-product-tax-list>\n </div>\n <div style=\"width: calc(75%)\" class=\"d-flex flex-column gap-3\">\n <app-stock-receipts-list-page\n [product]=\"product\"\n (listUpdated)=\"\n getProduct(this.id);\n productBasicInfoComponent.loadProductStocksSummary()\n \"\n ></app-stock-receipts-list-page>\n\n <app-stock-issuances-list\n [product]=\"product\"\n (listUpdated)=\"\n getProduct(this.id);\n productBasicInfoComponent.loadProductStocksSummary()\n \"\n ></app-stock-issuances-list>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: StockReceiptsListPageComponent, selector: "app-stock-receipts-list-page", inputs: ["product"], outputs: ["listUpdated"] }, { kind: "component", type: StockIssuancesListComponent, selector: "app-stock-issuances-list", inputs: ["product", "issuableType", "issuableId", "label"], outputs: ["listUpdated"] }, { kind: "component", type: ProductTaxListComponent, selector: "app-product-tax-list", inputs: ["product"] }, { kind: "component", type: i7$2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: ProductBasicInfoComponent, selector: "app-product-basic-info", inputs: ["product"], outputs: ["saved", "deleted"] }], preserveWhitespaces: true });
937
+ }
938
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductViewPageComponent, decorators: [{
939
+ type: Component,
940
+ args: [{ selector: "app-product-view-page", template: "<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n\n<div\n *ngIf=\"product\"\n class=\"d-flex justify-content-start align-items-start gap-3\"\n>\n <div style=\"width: calc(25% - 1rem)\" class=\"d-flex flex-column gap-3\">\n <app-product-basic-info\n [product]=\"product\"\n #productBasicInfoComponent\n (deleted)=\"onProductDeleted()\"\n (saved)=\"onProductUpdated($event)\"\n ></app-product-basic-info>\n\n <app-product-tax-list [product]=\"product\"></app-product-tax-list>\n </div>\n <div style=\"width: calc(75%)\" class=\"d-flex flex-column gap-3\">\n <app-stock-receipts-list-page\n [product]=\"product\"\n (listUpdated)=\"\n getProduct(this.id);\n productBasicInfoComponent.loadProductStocksSummary()\n \"\n ></app-stock-receipts-list-page>\n\n <app-stock-issuances-list\n [product]=\"product\"\n (listUpdated)=\"\n getProduct(this.id);\n productBasicInfoComponent.loadProductStocksSummary()\n \"\n ></app-stock-issuances-list>\n </div>\n</div>\n" }]
941
+ }], ctorParameters: () => [{ type: ProductService }, { type: i2$1.ActivatedRoute }, { type: i4.Location }] });
942
+
943
+ class ProductImportPageComponent {
944
+ importConfig = {
945
+ apiUrl: "api/products-import",
946
+ title: "Products",
947
+ importType: "product",
948
+ properties: [
949
+ {
950
+ label: "Name",
951
+ value: "name",
952
+ type: "text",
953
+ },
954
+ {
955
+ label: "SKU",
956
+ value: "sku",
957
+ type: "text",
958
+ },
959
+ {
960
+ label: "Initial Quantity",
961
+ value: "initial_quantity",
962
+ type: "number",
963
+ },
964
+ {
965
+ label: "Initial Quantity Date",
966
+ value: "initial_quantity_date",
967
+ type: "date",
968
+ },
969
+ {
970
+ label: "Reorder Point",
971
+ value: "reorder_point",
972
+ type: "number",
973
+ },
974
+ {
975
+ label: "Measure",
976
+ value: "measure",
977
+ type: "text",
978
+ },
979
+ {
980
+ label: "Categories",
981
+ value: "categories",
982
+ type: "text",
983
+ },
984
+ ],
985
+ sampleFile: {
986
+ name: "Products Import",
987
+ path: "assets/product/product-import-sample.csv",
988
+ },
989
+ importHistory: {
990
+ isEnabled: true,
991
+ type: "product",
992
+ apiUrl: "api/import-histories",
993
+ },
994
+ viewRouterLink: "/inventory/products/",
995
+ };
996
+ constructor() { }
997
+ ngOnInit() { }
998
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductImportPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
999
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductImportPageComponent, selector: "app-product-import-page", ngImport: i0, template: "<app-import-csv [config]=\"importConfig\"></app-import-csv>\n", styles: [""], dependencies: [{ kind: "component", type: i1$1.ImportCsvComponent, selector: "app-import-csv", inputs: ["config"] }], preserveWhitespaces: true });
1000
+ }
1001
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductImportPageComponent, decorators: [{
1002
+ type: Component,
1003
+ args: [{ selector: "app-product-import-page", template: "<app-import-csv [config]=\"importConfig\"></app-import-csv>\n" }]
1004
+ }], ctorParameters: () => [] });
1005
+
1006
+ const routes = [
1007
+ {
1008
+ path: "",
1009
+ component: ProductNavBarComponent,
1010
+ children: [
1011
+ {
1012
+ path: "",
1013
+ component: ProductListComponent,
1014
+ canLoad: [AuthenticationGuard],
1015
+ },
1016
+ {
1017
+ path: "import",
1018
+ component: ProductImportPageComponent,
1019
+ canLoad: [AuthenticationGuard],
1020
+ },
1021
+ {
1022
+ path: "measure",
1023
+ component: ProductMeasuresListComponent,
1024
+ canLoad: [AuthenticationGuard],
1025
+ },
1026
+ {
1027
+ path: ":id/view",
1028
+ component: ProductViewPageComponent,
1029
+ canLoad: [AuthenticationGuard],
1030
+ },
1031
+ {
1032
+ path: "**",
1033
+ redirectTo: "",
1034
+ pathMatch: "full",
1035
+ canLoad: [AuthenticationGuard],
1036
+ },
1037
+ ],
1038
+ },
1039
+ ];
1040
+ class ProductRoutingModule {
1041
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1042
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ProductRoutingModule, imports: [i2$1.RouterModule], exports: [RouterModule] });
1043
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
1044
+ }
1045
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductRoutingModule, decorators: [{
1046
+ type: NgModule,
1047
+ args: [{
1048
+ imports: [RouterModule.forChild(routes)],
1049
+ exports: [RouterModule],
1050
+ }]
1051
+ }] });
1052
+
1053
+ class ProductTaxModule {
1054
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1055
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxModule, declarations: [ProductTaxListComponent,
1056
+ ProductTaxFormButtonComponent,
1057
+ ProductTaxDeleteButtonComponent], imports: [CommonModule,
1058
+ MaterialModule,
1059
+ ReactiveFormsModule,
1060
+ SearchableSelectorModule], exports: [ProductTaxListComponent] });
1061
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxModule, imports: [CommonModule,
1062
+ MaterialModule,
1063
+ ReactiveFormsModule,
1064
+ SearchableSelectorModule] });
1065
+ }
1066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductTaxModule, decorators: [{
1067
+ type: NgModule,
1068
+ args: [{
1069
+ declarations: [
1070
+ ProductTaxListComponent,
1071
+ ProductTaxFormButtonComponent,
1072
+ ProductTaxDeleteButtonComponent,
1073
+ ],
1074
+ imports: [
1075
+ CommonModule,
1076
+ MaterialModule,
1077
+ ReactiveFormsModule,
1078
+ SearchableSelectorModule,
1079
+ ],
1080
+ exports: [ProductTaxListComponent],
1081
+ }]
1082
+ }] });
1083
+
1084
+ class ProductModule {
1085
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1086
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ProductModule, declarations: [ProductListComponent,
1087
+ ProductFormComponent,
1088
+ ProductNavBarComponent,
1089
+ ProductMeasuresListComponent,
1090
+ ProductMeasureFormComponent,
1091
+ ProductViewPageComponent,
1092
+ ProductFormButtonComponent,
1093
+ ProductDeleteButtonComponent,
1094
+ ProductBasicInfoComponent,
1095
+ ProductImportPageComponent], imports: [CommonModule,
1096
+ ProductRoutingModule,
1097
+ SearchableSelectorModule,
1098
+ TimelineFilterModule,
1099
+ StockReceiptFormModule,
1100
+ StockIssueFormModule,
1101
+ ImportCsvModule,
1102
+ StockReceiptsModule,
1103
+ StockIssuancesListModule,
1104
+ ProductTaxModule,
1105
+ MaterialModule,
1106
+ MatProgressBarModule,
1107
+ InfiniteScrollModule,
1108
+ FlexModule,
1109
+ ReactiveFormsModule,
1110
+ FormsModule], exports: [ProductFormComponent,
1111
+ ProductBasicInfoComponent,
1112
+ ProductFormButtonComponent] });
1113
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductModule, imports: [CommonModule,
1114
+ ProductRoutingModule,
1115
+ SearchableSelectorModule,
1116
+ TimelineFilterModule,
1117
+ StockReceiptFormModule,
1118
+ StockIssueFormModule,
1119
+ ImportCsvModule,
1120
+ StockReceiptsModule,
1121
+ StockIssuancesListModule,
1122
+ ProductTaxModule,
1123
+ MaterialModule,
1124
+ MatProgressBarModule,
1125
+ InfiniteScrollModule,
1126
+ FlexModule,
1127
+ ReactiveFormsModule,
1128
+ FormsModule] });
1129
+ }
1130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductModule, decorators: [{
1131
+ type: NgModule,
1132
+ args: [{
1133
+ declarations: [
1134
+ ProductListComponent,
1135
+ ProductFormComponent,
1136
+ ProductNavBarComponent,
1137
+ ProductMeasuresListComponent,
1138
+ ProductMeasureFormComponent,
1139
+ ProductViewPageComponent,
1140
+ ProductFormButtonComponent,
1141
+ ProductDeleteButtonComponent,
1142
+ ProductBasicInfoComponent,
1143
+ ProductImportPageComponent,
1144
+ ],
1145
+ imports: [
1146
+ CommonModule,
1147
+ ProductRoutingModule,
1148
+ SearchableSelectorModule,
1149
+ TimelineFilterModule,
1150
+ StockReceiptFormModule,
1151
+ StockIssueFormModule,
1152
+ ImportCsvModule,
1153
+ StockReceiptsModule,
1154
+ StockIssuancesListModule,
1155
+ ProductTaxModule,
1156
+ MaterialModule,
1157
+ MatProgressBarModule,
1158
+ InfiniteScrollModule,
1159
+ FlexModule,
1160
+ ReactiveFormsModule,
1161
+ FormsModule,
1162
+ ],
1163
+ exports: [
1164
+ ProductFormComponent,
1165
+ ProductBasicInfoComponent,
1166
+ ProductFormButtonComponent,
1167
+ ],
1168
+ }]
1169
+ }] });
1170
+
1171
+ export { ProductModule };
1172
+ //# sourceMappingURL=techlify-inventory-common-product.module-qdeafFV5.mjs.map