techlify-inventory-common 18.2.0 → 18.3.0

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