techlify-inventory-common 18.51.0 → 22.0.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 (356) hide show
  1. package/fesm2022/techlify-inventory-common-category.module-Dtn1604q.mjs +842 -0
  2. package/fesm2022/techlify-inventory-common-category.module-Dtn1604q.mjs.map +1 -0
  3. package/fesm2022/techlify-inventory-common-location.service-C99J8Lje.mjs +50 -0
  4. package/fesm2022/techlify-inventory-common-location.service-C99J8Lje.mjs.map +1 -0
  5. package/fesm2022/techlify-inventory-common-material.module-ClupVm7-.mjs +190 -0
  6. package/fesm2022/techlify-inventory-common-material.module-ClupVm7-.mjs.map +1 -0
  7. package/fesm2022/techlify-inventory-common-measure.service-DvJUGa0i.mjs +38 -0
  8. package/fesm2022/techlify-inventory-common-measure.service-DvJUGa0i.mjs.map +1 -0
  9. package/fesm2022/techlify-inventory-common-product-category-badges.component-VnfnNhtV.mjs +133 -0
  10. package/fesm2022/techlify-inventory-common-product-category-badges.component-VnfnNhtV.mjs.map +1 -0
  11. package/fesm2022/techlify-inventory-common-product.module-MZoVK3bN.mjs +4278 -0
  12. package/fesm2022/techlify-inventory-common-product.module-MZoVK3bN.mjs.map +1 -0
  13. package/fesm2022/techlify-inventory-common-purchase-order-view.component-CjED8n4_.mjs +852 -0
  14. package/fesm2022/techlify-inventory-common-purchase-order-view.component-CjED8n4_.mjs.map +1 -0
  15. package/fesm2022/techlify-inventory-common-purchase-order.service-ztJ5RRH5.mjs +40 -0
  16. package/fesm2022/techlify-inventory-common-purchase-order.service-ztJ5RRH5.mjs.map +1 -0
  17. package/fesm2022/techlify-inventory-common-recipient.module-gxR77BIj.mjs +647 -0
  18. package/fesm2022/techlify-inventory-common-recipient.module-gxR77BIj.mjs.map +1 -0
  19. package/fesm2022/techlify-inventory-common-shared.module-DP-FVqea.mjs +102 -0
  20. package/fesm2022/techlify-inventory-common-shared.module-DP-FVqea.mjs.map +1 -0
  21. package/fesm2022/techlify-inventory-common-stock-allocation-list.component-Du-VCtbs.mjs +382 -0
  22. package/fesm2022/techlify-inventory-common-stock-allocation-list.component-Du-VCtbs.mjs.map +1 -0
  23. package/fesm2022/techlify-inventory-common-stock-issue-form.component-DfgbqIKn.mjs +486 -0
  24. package/fesm2022/techlify-inventory-common-stock-issue-form.component-DfgbqIKn.mjs.map +1 -0
  25. package/fesm2022/techlify-inventory-common-stock-issue-page.module-DX9n3X1T.mjs +2509 -0
  26. package/fesm2022/techlify-inventory-common-stock-issue-page.module-DX9n3X1T.mjs.map +1 -0
  27. package/fesm2022/techlify-inventory-common-stock-issue-product-view.component-D8aIc5Oh.mjs +208 -0
  28. package/fesm2022/techlify-inventory-common-stock-issue-product-view.component-D8aIc5Oh.mjs.map +1 -0
  29. package/fesm2022/techlify-inventory-common-stock-issue-product.service-BRbfc5KP.mjs +38 -0
  30. package/fesm2022/techlify-inventory-common-stock-issue-product.service-BRbfc5KP.mjs.map +1 -0
  31. package/fesm2022/techlify-inventory-common-stock-issue-view.component-Cp_0YkKh.mjs +239 -0
  32. package/fesm2022/techlify-inventory-common-stock-issue-view.component-Cp_0YkKh.mjs.map +1 -0
  33. package/fesm2022/techlify-inventory-common-stock-issue.service-CLHasWVp.mjs +38 -0
  34. package/fesm2022/techlify-inventory-common-stock-issue.service-CLHasWVp.mjs.map +1 -0
  35. package/fesm2022/techlify-inventory-common-stock-receipts.module-BPxUGNbD.mjs +4195 -0
  36. package/fesm2022/techlify-inventory-common-stock-receipts.module-BPxUGNbD.mjs.map +1 -0
  37. package/fesm2022/techlify-inventory-common-techlify-filter.module-BdRNWNHi.mjs +464 -0
  38. package/fesm2022/techlify-inventory-common-techlify-filter.module-BdRNWNHi.mjs.map +1 -0
  39. package/fesm2022/techlify-inventory-common-techlify-form-service-D9K3W2jt.mjs +13 -0
  40. package/fesm2022/techlify-inventory-common-techlify-form-service-D9K3W2jt.mjs.map +1 -0
  41. package/fesm2022/techlify-inventory-common.mjs +10803 -2
  42. package/fesm2022/techlify-inventory-common.mjs.map +1 -1
  43. package/package.json +9 -11
  44. package/types/techlify-inventory-common.d.ts +1792 -0
  45. package/esm2022/lib/inventory-common/category/category-form/category-form.component.mjs +0 -75
  46. package/esm2022/lib/inventory-common/category/category-form-button/category-form-button.component.mjs +0 -32
  47. package/esm2022/lib/inventory-common/category/category-list-page/category-list-page.component.mjs +0 -64
  48. package/esm2022/lib/inventory-common/category/category-routing.module.mjs +0 -29
  49. package/esm2022/lib/inventory-common/category/category-view/category-view.component.mjs +0 -46
  50. package/esm2022/lib/inventory-common/category/category.module.mjs +0 -62
  51. package/esm2022/lib/inventory-common/category/category.service.mjs +0 -18
  52. package/esm2022/lib/inventory-common/incident/incident-form/incident-form.component.mjs +0 -113
  53. package/esm2022/lib/inventory-common/incident/incident-form-button/incident-form-button.component.mjs +0 -45
  54. package/esm2022/lib/inventory-common/incident/incident-list/incident-list.component.mjs +0 -140
  55. package/esm2022/lib/inventory-common/incident/incident-routing.module.mjs +0 -24
  56. package/esm2022/lib/inventory-common/incident/incident.module.mjs +0 -22
  57. package/esm2022/lib/inventory-common/incident/incident.service.mjs +0 -18
  58. package/esm2022/lib/inventory-common/inventory-common-routing.module.mjs +0 -81
  59. package/esm2022/lib/inventory-common/inventory-common.module.mjs +0 -43
  60. package/esm2022/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.mjs +0 -44
  61. package/esm2022/lib/inventory-common/inventory-value-report.service.mjs +0 -21
  62. package/esm2022/lib/inventory-common/location/location-form/location-form.component.mjs +0 -63
  63. package/esm2022/lib/inventory-common/location/location-form-button/location-form-button.component.mjs +0 -47
  64. package/esm2022/lib/inventory-common/location/location-information/location-information.component.mjs +0 -36
  65. package/esm2022/lib/inventory-common/location/location-list/location-list.component.mjs +0 -81
  66. package/esm2022/lib/inventory-common/location/location-product-statistics/location-product-statistics.component.mjs +0 -80
  67. package/esm2022/lib/inventory-common/location/location-routing.module.mjs +0 -38
  68. package/esm2022/lib/inventory-common/location/location-status-changer/location-status-changer.component.mjs +0 -64
  69. package/esm2022/lib/inventory-common/location/location-view/location-view.component.mjs +0 -52
  70. package/esm2022/lib/inventory-common/location/location.module.mjs +0 -22
  71. package/esm2022/lib/inventory-common/location/location.service.mjs +0 -33
  72. package/esm2022/lib/inventory-common/location/shelf/shelf-form/shelf-form.component.mjs +0 -86
  73. package/esm2022/lib/inventory-common/location/shelf/shelf-form-button/shelf-form-button.component.mjs +0 -39
  74. package/esm2022/lib/inventory-common/location/shelf/shelf-list/shelf-list.component.mjs +0 -103
  75. package/esm2022/lib/inventory-common/location/shelf/shelf-routing.module.mjs +0 -24
  76. package/esm2022/lib/inventory-common/location/shelf/shelf.module.mjs +0 -22
  77. package/esm2022/lib/inventory-common/location/shelf/shelf.service.mjs +0 -20
  78. package/esm2022/lib/inventory-common/low-stock-report.service.mjs +0 -23
  79. package/esm2022/lib/inventory-common/material.module.mjs +0 -172
  80. package/esm2022/lib/inventory-common/measure/measure-form/measure-form.component.mjs +0 -63
  81. package/esm2022/lib/inventory-common/measure/measure-list/measure-list.component.mjs +0 -75
  82. package/esm2022/lib/inventory-common/measure/measure-routing.module.mjs +0 -24
  83. package/esm2022/lib/inventory-common/measure/measure.module.mjs +0 -43
  84. package/esm2022/lib/inventory-common/measure/measure.service.mjs +0 -18
  85. package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.mjs +0 -47
  86. package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.mjs +0 -22
  87. package/esm2022/lib/inventory-common/product/product-basic-info/product-basic-info.component.mjs +0 -58
  88. package/esm2022/lib/inventory-common/product/product-batch-update-form/product-batch-update-form.component.mjs +0 -54
  89. package/esm2022/lib/inventory-common/product/product-delete-button/product-delete-button.component.mjs +0 -54
  90. package/esm2022/lib/inventory-common/product/product-form/product-form.component.mjs +0 -258
  91. package/esm2022/lib/inventory-common/product/product-form-button/product-form-button.component.mjs +0 -15
  92. package/esm2022/lib/inventory-common/product/product-form.service.mjs +0 -17
  93. package/esm2022/lib/inventory-common/product/product-import-page/product-import-page.component.mjs +0 -66
  94. package/esm2022/lib/inventory-common/product/product-list/product-list.component.mjs +0 -177
  95. package/esm2022/lib/inventory-common/product/product-location/product-location-list/product-location-list.component.mjs +0 -61
  96. package/esm2022/lib/inventory-common/product/product-measure-form/product-measure-form.component.mjs +0 -101
  97. package/esm2022/lib/inventory-common/product/product-measures-list/product-measures-list.component.mjs +0 -145
  98. package/esm2022/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.mjs +0 -12
  99. package/esm2022/lib/inventory-common/product/product-quick-search/product-quick-search.component.mjs +0 -69
  100. package/esm2022/lib/inventory-common/product/product-routing.module.mjs +0 -68
  101. package/esm2022/lib/inventory-common/product/product-search/product-search.component.mjs +0 -151
  102. package/esm2022/lib/inventory-common/product/product-search/product-search.module.mjs +0 -39
  103. package/esm2022/lib/inventory-common/product/product-statistics.service.mjs +0 -23
  104. package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.mjs +0 -57
  105. package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.mjs +0 -18
  106. package/esm2022/lib/inventory-common/product/product-summary.service.mjs +0 -20
  107. package/esm2022/lib/inventory-common/product/product-view-page/product-view-page.component.mjs +0 -98
  108. package/esm2022/lib/inventory-common/product/product.module.mjs +0 -145
  109. package/esm2022/lib/inventory-common/product/product.service.mjs +0 -20
  110. package/esm2022/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.mjs +0 -15
  111. package/esm2022/lib/inventory-common/product-batch.service.mjs +0 -20
  112. package/esm2022/lib/inventory-common/rating/rating-form/rating-form.component.mjs +0 -112
  113. package/esm2022/lib/inventory-common/rating/rating-form-button/rating-form-button.component.mjs +0 -45
  114. package/esm2022/lib/inventory-common/rating/rating-list/rating-list.component.mjs +0 -135
  115. package/esm2022/lib/inventory-common/rating/rating-routing.module.mjs +0 -23
  116. package/esm2022/lib/inventory-common/rating/rating.module.mjs +0 -22
  117. package/esm2022/lib/inventory-common/rating/rating.service.mjs +0 -18
  118. package/esm2022/lib/inventory-common/recipient/recipient-form/recipient-form.component.mjs +0 -59
  119. package/esm2022/lib/inventory-common/recipient/recipient-list/recipient-list.component.mjs +0 -49
  120. package/esm2022/lib/inventory-common/recipient/recipient-routing.module.mjs +0 -24
  121. package/esm2022/lib/inventory-common/recipient/recipient.module.mjs +0 -18
  122. package/esm2022/lib/inventory-common/recipient/recipient.service.mjs +0 -18
  123. package/esm2022/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.mjs +0 -152
  124. package/esm2022/lib/inventory-common/reports/low-stock-report/low-stock-report.component.mjs +0 -161
  125. package/esm2022/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-product-data.service.mjs +0 -20
  126. package/esm2022/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-summary-report.component.mjs +0 -98
  127. package/esm2022/lib/inventory-common/services/techlify-form-service.mjs +0 -11
  128. package/esm2022/lib/inventory-common/shared/export-to-excel-button/export-to-excel-button.component.mjs +0 -58
  129. package/esm2022/lib/inventory-common/shared.module.mjs +0 -67
  130. package/esm2022/lib/inventory-common/stock-allocation/stock-allocation-list/stock-allocation-list.component.mjs +0 -81
  131. package/esm2022/lib/inventory-common/stock-allocation/stock-allocation.service.mjs +0 -16
  132. package/esm2022/lib/inventory-common/stock-issue/stock-issue-form/stock-issue-form.component.mjs +0 -198
  133. package/esm2022/lib/inventory-common/stock-issue/stock-issue-import-page/stock-issue-import-page.component.mjs +0 -59
  134. package/esm2022/lib/inventory-common/stock-issue/stock-issue-list/stock-issue-list.component.mjs +0 -149
  135. package/esm2022/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.component.mjs +0 -91
  136. package/esm2022/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.module.mjs +0 -82
  137. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form-button/stock-issue-product-form-button.component.mjs +0 -35
  138. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form.component.mjs +0 -102
  139. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product-view/stock-issue-product-view.component.mjs +0 -59
  140. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product.service.mjs +0 -16
  141. package/esm2022/lib/inventory-common/stock-issue/stock-issue-products-list/stock-issue-products-list.component.mjs +0 -167
  142. package/esm2022/lib/inventory-common/stock-issue/stock-issue-routing.module.mjs +0 -51
  143. package/esm2022/lib/inventory-common/stock-issue/stock-issue-single-product-form/stock-issue-single-product-form.component.mjs +0 -201
  144. package/esm2022/lib/inventory-common/stock-issue/stock-issue-view/stock-issue-view.component.mjs +0 -64
  145. package/esm2022/lib/inventory-common/stock-issue/stock-issue.module.mjs +0 -47
  146. package/esm2022/lib/inventory-common/stock-issue/stock-issue.service.mjs +0 -18
  147. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.component.mjs +0 -226
  148. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-import-page/stock-receipt-import-page.component.mjs +0 -74
  149. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-list/stock-receipt-list.component.mjs +0 -152
  150. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-form/stock-receipt-product-form-button/stock-receipt-product-form-button.component.mjs +0 -37
  151. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-form/stock-receipt-product-form.component.mjs +0 -80
  152. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-list/stock-receipt-product-list.component.mjs +0 -149
  153. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-view/stock-receipt-product-view.component.mjs +0 -59
  154. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product.service.mjs +0 -18
  155. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-single-product-form/stock-receipt-simple-form/stock-receipt-single-product-form.component.mjs +0 -181
  156. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-view/stock-receipt-view.component.mjs +0 -54
  157. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt.service.mjs +0 -18
  158. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-page/stock-receipts-page.component.mjs +0 -70
  159. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-routing.module.mjs +0 -52
  160. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts.module.mjs +0 -104
  161. package/esm2022/lib/inventory-common/stock-summary.service.mjs +0 -26
  162. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-form/stock-transfer-form.component.mjs +0 -98
  163. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-list/stock-transfer-list.component.mjs +0 -139
  164. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer.service.mjs +0 -18
  165. package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.mjs +0 -59
  166. package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector.module.mjs +0 -21
  167. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-form/purchase-order-form.component.mjs +0 -156
  168. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-listing/purchase-order-listing.component.mjs +0 -67
  169. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-form/purchase-order-product-form.component.mjs +0 -74
  170. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-form-button/purchase-order-product-form-button.component.mjs +0 -38
  171. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-list.component.mjs +0 -61
  172. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product.service.mjs +0 -20
  173. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-view/purchase-order-view.component.mjs +0 -64
  174. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order.service.mjs +0 -20
  175. package/esm2022/lib/inventory-common/supplier/supplier-branch-delete-button/supplier-branch-delete-button.component.mjs +0 -63
  176. package/esm2022/lib/inventory-common/supplier/supplier-branch-form/supplier-branch-form-button/supplier-branch-form-button.component.mjs +0 -47
  177. package/esm2022/lib/inventory-common/supplier/supplier-branch-form/supplier-branch-form.component.mjs +0 -79
  178. package/esm2022/lib/inventory-common/supplier/supplier-branch.service.mjs +0 -18
  179. package/esm2022/lib/inventory-common/supplier/supplier-branches-list/supplier-branches-list.component.mjs +0 -79
  180. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.component.mjs +0 -94
  181. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.service.mjs +0 -17
  182. package/esm2022/lib/inventory-common/supplier/supplier-information/supplier-information.component.mjs +0 -73
  183. package/esm2022/lib/inventory-common/supplier/supplier-list/supplier-list.component.mjs +0 -68
  184. package/esm2022/lib/inventory-common/supplier/supplier-routing.module.mjs +0 -51
  185. package/esm2022/lib/inventory-common/supplier/supplier-type.service.mjs +0 -25
  186. package/esm2022/lib/inventory-common/supplier/supplier-view/supplier-view.component.mjs +0 -70
  187. package/esm2022/lib/inventory-common/supplier/supplier.component.mjs +0 -20
  188. package/esm2022/lib/inventory-common/supplier/supplier.module.mjs +0 -64
  189. package/esm2022/lib/inventory-common/supplier/supplier.service.mjs +0 -20
  190. package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.component.mjs +0 -116
  191. package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.module.mjs +0 -42
  192. package/esm2022/public-api.mjs +0 -71
  193. package/esm2022/techlify-inventory-common.mjs +0 -5
  194. package/fesm2022/techlify-inventory-common-category.module-oi41ku5U.mjs +0 -288
  195. package/fesm2022/techlify-inventory-common-category.module-oi41ku5U.mjs.map +0 -1
  196. package/fesm2022/techlify-inventory-common-purchase-order-view.component-DkWmMRaW.mjs +0 -227
  197. package/fesm2022/techlify-inventory-common-purchase-order-view.component-DkWmMRaW.mjs.map +0 -1
  198. package/fesm2022/techlify-inventory-common-recipient.module-v77bDJCC.mjs +0 -147
  199. package/fesm2022/techlify-inventory-common-recipient.module-v77bDJCC.mjs.map +0 -1
  200. package/fesm2022/techlify-inventory-common-stock-issue-form.component-ABIh_GkN.mjs +0 -199
  201. package/fesm2022/techlify-inventory-common-stock-issue-form.component-ABIh_GkN.mjs.map +0 -1
  202. package/fesm2022/techlify-inventory-common-stock-issue-product-view.component-3FB_GfyZ.mjs +0 -60
  203. package/fesm2022/techlify-inventory-common-stock-issue-product-view.component-3FB_GfyZ.mjs.map +0 -1
  204. package/fesm2022/techlify-inventory-common-stock-issue-view.component-D4AloV4G.mjs +0 -66
  205. package/fesm2022/techlify-inventory-common-stock-issue-view.component-D4AloV4G.mjs.map +0 -1
  206. package/fesm2022/techlify-inventory-common-techlify-inventory-common-B_42CQL_.mjs +0 -7218
  207. package/fesm2022/techlify-inventory-common-techlify-inventory-common-B_42CQL_.mjs.map +0 -1
  208. package/index.d.ts +0 -5
  209. package/lib/inventory-common/category/category-form/category-form.component.d.ts +0 -18
  210. package/lib/inventory-common/category/category-form-button/category-form-button.component.d.ts +0 -13
  211. package/lib/inventory-common/category/category-list-page/category-list-page.component.d.ts +0 -20
  212. package/lib/inventory-common/category/category-routing.module.d.ts +0 -7
  213. package/lib/inventory-common/category/category-view/category-view.component.d.ts +0 -16
  214. package/lib/inventory-common/category/category.module.d.ts +0 -20
  215. package/lib/inventory-common/category/category.service.d.ts +0 -7
  216. package/lib/inventory-common/incident/incident-form/incident-form.component.d.ts +0 -19
  217. package/lib/inventory-common/incident/incident-form-button/incident-form-button.component.d.ts +0 -15
  218. package/lib/inventory-common/incident/incident-list/incident-list.component.d.ts +0 -22
  219. package/lib/inventory-common/incident/incident-routing.module.d.ts +0 -7
  220. package/lib/inventory-common/incident/incident.module.d.ts +0 -8
  221. package/lib/inventory-common/incident/incident.service.d.ts +0 -7
  222. package/lib/inventory-common/inventory-common-routing.module.d.ts +0 -7
  223. package/lib/inventory-common/inventory-common.module.d.ts +0 -14
  224. package/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.d.ts +0 -14
  225. package/lib/inventory-common/inventory-value-report.service.d.ts +0 -9
  226. package/lib/inventory-common/location/location-form/location-form.component.d.ts +0 -18
  227. package/lib/inventory-common/location/location-form-button/location-form-button.component.d.ts +0 -13
  228. package/lib/inventory-common/location/location-information/location-information.component.d.ts +0 -12
  229. package/lib/inventory-common/location/location-list/location-list.component.d.ts +0 -18
  230. package/lib/inventory-common/location/location-product-statistics/location-product-statistics.component.d.ts +0 -18
  231. package/lib/inventory-common/location/location-routing.module.d.ts +0 -7
  232. package/lib/inventory-common/location/location-status-changer/location-status-changer.component.d.ts +0 -17
  233. package/lib/inventory-common/location/location-view/location-view.component.d.ts +0 -16
  234. package/lib/inventory-common/location/location.module.d.ts +0 -8
  235. package/lib/inventory-common/location/location.service.d.ts +0 -15
  236. package/lib/inventory-common/location/shelf/shelf-form/shelf-form.component.d.ts +0 -18
  237. package/lib/inventory-common/location/shelf/shelf-form-button/shelf-form-button.component.d.ts +0 -13
  238. package/lib/inventory-common/location/shelf/shelf-list/shelf-list.component.d.ts +0 -19
  239. package/lib/inventory-common/location/shelf/shelf-routing.module.d.ts +0 -7
  240. package/lib/inventory-common/location/shelf/shelf.module.d.ts +0 -8
  241. package/lib/inventory-common/location/shelf/shelf.service.d.ts +0 -8
  242. package/lib/inventory-common/low-stock-report.service.d.ts +0 -10
  243. package/lib/inventory-common/material.module.d.ts +0 -40
  244. package/lib/inventory-common/measure/measure-form/measure-form.component.d.ts +0 -21
  245. package/lib/inventory-common/measure/measure-list/measure-list.component.d.ts +0 -19
  246. package/lib/inventory-common/measure/measure-routing.module.d.ts +0 -7
  247. package/lib/inventory-common/measure/measure.module.d.ts +0 -14
  248. package/lib/inventory-common/measure/measure.service.d.ts +0 -7
  249. package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.d.ts +0 -13
  250. package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.d.ts +0 -12
  251. package/lib/inventory-common/product/product-basic-info/product-basic-info.component.d.ts +0 -21
  252. package/lib/inventory-common/product/product-batch-update-form/product-batch-update-form.component.d.ts +0 -17
  253. package/lib/inventory-common/product/product-delete-button/product-delete-button.component.d.ts +0 -26
  254. package/lib/inventory-common/product/product-form/product-form.component.d.ts +0 -46
  255. package/lib/inventory-common/product/product-form-button/product-form-button.component.d.ts +0 -7
  256. package/lib/inventory-common/product/product-form.service.d.ts +0 -7
  257. package/lib/inventory-common/product/product-import-page/product-import-page.component.d.ts +0 -10
  258. package/lib/inventory-common/product/product-list/product-list.component.d.ts +0 -34
  259. package/lib/inventory-common/product/product-location/product-location-list/product-location-list.component.d.ts +0 -18
  260. package/lib/inventory-common/product/product-measure-form/product-measure-form.component.d.ts +0 -33
  261. package/lib/inventory-common/product/product-measures-list/product-measures-list.component.d.ts +0 -43
  262. package/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.d.ts +0 -5
  263. package/lib/inventory-common/product/product-quick-search/product-quick-search.component.d.ts +0 -15
  264. package/lib/inventory-common/product/product-routing.module.d.ts +0 -7
  265. package/lib/inventory-common/product/product-search/product-search.component.d.ts +0 -48
  266. package/lib/inventory-common/product/product-search/product-search.module.d.ts +0 -13
  267. package/lib/inventory-common/product/product-statistics.service.d.ts +0 -9
  268. package/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.d.ts +0 -15
  269. package/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.d.ts +0 -10
  270. package/lib/inventory-common/product/product-summary.service.d.ts +0 -8
  271. package/lib/inventory-common/product/product-view-page/product-view-page.component.d.ts +0 -44
  272. package/lib/inventory-common/product/product.module.d.ts +0 -31
  273. package/lib/inventory-common/product/product.service.d.ts +0 -8
  274. package/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.d.ts +0 -6
  275. package/lib/inventory-common/product-batch.service.d.ts +0 -8
  276. package/lib/inventory-common/rating/rating-form/rating-form.component.d.ts +0 -19
  277. package/lib/inventory-common/rating/rating-form-button/rating-form-button.component.d.ts +0 -15
  278. package/lib/inventory-common/rating/rating-list/rating-list.component.d.ts +0 -22
  279. package/lib/inventory-common/rating/rating-routing.module.d.ts +0 -7
  280. package/lib/inventory-common/rating/rating.module.d.ts +0 -8
  281. package/lib/inventory-common/rating/rating.service.d.ts +0 -7
  282. package/lib/inventory-common/recipient/recipient-form/recipient-form.component.d.ts +0 -21
  283. package/lib/inventory-common/recipient/recipient-list/recipient-list.component.d.ts +0 -16
  284. package/lib/inventory-common/recipient/recipient-routing.module.d.ts +0 -7
  285. package/lib/inventory-common/recipient/recipient.module.d.ts +0 -9
  286. package/lib/inventory-common/recipient/recipient.service.d.ts +0 -7
  287. package/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.d.ts +0 -27
  288. package/lib/inventory-common/reports/low-stock-report/low-stock-report.component.d.ts +0 -25
  289. package/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-product-data.service.d.ts +0 -8
  290. package/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-summary-report.component.d.ts +0 -25
  291. package/lib/inventory-common/services/techlify-form-service.d.ts +0 -5
  292. package/lib/inventory-common/shared/export-to-excel-button/export-to-excel-button.component.d.ts +0 -12
  293. package/lib/inventory-common/shared.module.d.ts +0 -13
  294. package/lib/inventory-common/stock-allocation/stock-allocation-list/stock-allocation-list.component.d.ts +0 -19
  295. package/lib/inventory-common/stock-allocation/stock-allocation.service.d.ts +0 -7
  296. package/lib/inventory-common/stock-issue/stock-issue-form/stock-issue-form.component.d.ts +0 -45
  297. package/lib/inventory-common/stock-issue/stock-issue-import-page/stock-issue-import-page.component.d.ts +0 -10
  298. package/lib/inventory-common/stock-issue/stock-issue-list/stock-issue-list.component.d.ts +0 -33
  299. package/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.component.d.ts +0 -30
  300. package/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.module.d.ts +0 -18
  301. package/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form-button/stock-issue-product-form-button.component.d.ts +0 -12
  302. package/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form.component.d.ts +0 -21
  303. package/lib/inventory-common/stock-issue/stock-issue-product-view/stock-issue-product-view.component.d.ts +0 -19
  304. package/lib/inventory-common/stock-issue/stock-issue-product.service.d.ts +0 -7
  305. package/lib/inventory-common/stock-issue/stock-issue-products-list/stock-issue-products-list.component.d.ts +0 -41
  306. package/lib/inventory-common/stock-issue/stock-issue-routing.module.d.ts +0 -7
  307. package/lib/inventory-common/stock-issue/stock-issue-single-product-form/stock-issue-single-product-form.component.d.ts +0 -42
  308. package/lib/inventory-common/stock-issue/stock-issue-view/stock-issue-view.component.d.ts +0 -19
  309. package/lib/inventory-common/stock-issue/stock-issue.module.d.ts +0 -14
  310. package/lib/inventory-common/stock-issue/stock-issue.service.d.ts +0 -7
  311. package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.component.d.ts +0 -48
  312. package/lib/inventory-common/stock-receipts/stock-receipt-import-page/stock-receipt-import-page.component.d.ts +0 -10
  313. package/lib/inventory-common/stock-receipts/stock-receipt-list/stock-receipt-list.component.d.ts +0 -30
  314. package/lib/inventory-common/stock-receipts/stock-receipt-product-form/stock-receipt-product-form-button/stock-receipt-product-form-button.component.d.ts +0 -12
  315. package/lib/inventory-common/stock-receipts/stock-receipt-product-form/stock-receipt-product-form.component.d.ts +0 -17
  316. package/lib/inventory-common/stock-receipts/stock-receipt-product-list/stock-receipt-product-list.component.d.ts +0 -31
  317. package/lib/inventory-common/stock-receipts/stock-receipt-product-view/stock-receipt-product-view.component.d.ts +0 -19
  318. package/lib/inventory-common/stock-receipts/stock-receipt-product.service.d.ts +0 -7
  319. package/lib/inventory-common/stock-receipts/stock-receipt-single-product-form/stock-receipt-simple-form/stock-receipt-single-product-form.component.d.ts +0 -33
  320. package/lib/inventory-common/stock-receipts/stock-receipt-view/stock-receipt-view.component.d.ts +0 -19
  321. package/lib/inventory-common/stock-receipts/stock-receipt.service.d.ts +0 -7
  322. package/lib/inventory-common/stock-receipts/stock-receipts-page/stock-receipts-page.component.d.ts +0 -21
  323. package/lib/inventory-common/stock-receipts/stock-receipts-routing.module.d.ts +0 -7
  324. package/lib/inventory-common/stock-receipts/stock-receipts.module.d.ts +0 -22
  325. package/lib/inventory-common/stock-summary.service.d.ts +0 -14
  326. package/lib/inventory-common/stock-transfer/stock-transfer-form/stock-transfer-form.component.d.ts +0 -19
  327. package/lib/inventory-common/stock-transfer/stock-transfer-list/stock-transfer-list.component.d.ts +0 -28
  328. package/lib/inventory-common/stock-transfer/stock-transfer.service.d.ts +0 -7
  329. package/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.d.ts +0 -20
  330. package/lib/inventory-common/supplier/payee-selector/payee-selector.module.d.ts +0 -11
  331. package/lib/inventory-common/supplier/purchase-order/purchase-order-form/purchase-order-form.component.d.ts +0 -30
  332. package/lib/inventory-common/supplier/purchase-order/purchase-order-listing/purchase-order-listing.component.d.ts +0 -16
  333. package/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-form/purchase-order-product-form.component.d.ts +0 -16
  334. package/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-form-button/purchase-order-product-form-button.component.d.ts +0 -12
  335. package/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-list.component.d.ts +0 -15
  336. package/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product.service.d.ts +0 -8
  337. package/lib/inventory-common/supplier/purchase-order/purchase-order-view/purchase-order-view.component.d.ts +0 -19
  338. package/lib/inventory-common/supplier/purchase-order/purchase-order.service.d.ts +0 -8
  339. package/lib/inventory-common/supplier/supplier-branch-delete-button/supplier-branch-delete-button.component.d.ts +0 -18
  340. package/lib/inventory-common/supplier/supplier-branch-form/supplier-branch-form-button/supplier-branch-form-button.component.d.ts +0 -13
  341. package/lib/inventory-common/supplier/supplier-branch-form/supplier-branch-form.component.d.ts +0 -22
  342. package/lib/inventory-common/supplier/supplier-branch.service.d.ts +0 -7
  343. package/lib/inventory-common/supplier/supplier-branches-list/supplier-branches-list.component.d.ts +0 -18
  344. package/lib/inventory-common/supplier/supplier-form/supplier-form.component.d.ts +0 -25
  345. package/lib/inventory-common/supplier/supplier-form/supplier-form.service.d.ts +0 -7
  346. package/lib/inventory-common/supplier/supplier-information/supplier-information.component.d.ts +0 -18
  347. package/lib/inventory-common/supplier/supplier-list/supplier-list.component.d.ts +0 -20
  348. package/lib/inventory-common/supplier/supplier-routing.module.d.ts +0 -7
  349. package/lib/inventory-common/supplier/supplier-type.service.d.ts +0 -13
  350. package/lib/inventory-common/supplier/supplier-view/supplier-view.component.d.ts +0 -20
  351. package/lib/inventory-common/supplier/supplier.component.d.ts +0 -10
  352. package/lib/inventory-common/supplier/supplier.module.d.ts +0 -20
  353. package/lib/inventory-common/supplier/supplier.service.d.ts +0 -8
  354. package/lib/inventory-common/techlify-filter/techlify-filter.component.d.ts +0 -31
  355. package/lib/inventory-common/techlify-filter/techlify-filter.module.d.ts +0 -12
  356. package/public-api.d.ts +0 -67
@@ -0,0 +1,4278 @@
1
+ import { t as MeasureService } from "./techlify-inventory-common-measure.service-DvJUGa0i.mjs";
2
+ import { t as TechlifyFormService } from "./techlify-inventory-common-techlify-form-service-D9K3W2jt.mjs";
3
+ import { n as ExportToExcelButtonComponent } from "./techlify-inventory-common-product-category-badges.component-VnfnNhtV.mjs";
4
+ import { m as __exportAll, o as StockReceiptProductsListComponent, t as StockReceiptsModule } from "./techlify-inventory-common-stock-receipts.module-BPxUGNbD.mjs";
5
+ import { i as StockIssueProductListComponent, t as StockIssuePageModule } from "./techlify-inventory-common-stock-issue-page.module-DX9n3X1T.mjs";
6
+ import { t as MaterialModule$1 } from "./techlify-inventory-common-material.module-ClupVm7-.mjs";
7
+ import { t as SharedModule } from "./techlify-inventory-common-shared.module-DP-FVqea.mjs";
8
+ import * as i0 from "@angular/core";
9
+ import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Injectable, Input, NgModule, Optional, Output, ViewChild, effect, input, output, signal, viewChild } from "@angular/core";
10
+ import * as i4$1 from "@angular/router";
11
+ import { RouterLink, RouterModule } from "@angular/router";
12
+ import moment from "moment";
13
+ import * as i1 from "ngx-techlify-core";
14
+ import { AuthenticationGuard, ColumnSelectorModule, DocumentViewerModule, FileDropperModule, FormConfigurationUtilityService, ImportCsvModule, SearchableSelectorModule, TechlifyFormButtonComponent, TechlifyFormComponent, TechlifyListComponent, TechlifyService } from "ngx-techlify-core";
15
+ import * as i10 from "@angular/material/icon";
16
+ import * as i7 from "@angular/material/card";
17
+ import { MatCardContent, MatCardTitle } from "@angular/material/card";
18
+ import * as i14$1 from "@angular/material/table";
19
+ import { MatTableDataSource } from "@angular/material/table";
20
+ import * as i11 from "@angular/material/progress-bar";
21
+ import * as i6$1 from "ngx-infinite-scroll";
22
+ import { InfiniteScrollDirective } from "ngx-infinite-scroll";
23
+ import * as i2 from "@angular/forms";
24
+ import { FormControl, FormsModule, ReactiveFormsModule, Validators } from "@angular/forms";
25
+ import { debounceTime, distinctUntilChanged } from "rxjs";
26
+ import { __decorate } from "tslib";
27
+ import * as i3 from "@angular/material/dialog";
28
+ import { MAT_DIALOG_DATA } from "@angular/material/dialog";
29
+ import * as i4$2 from "ngx-spinner";
30
+ import * as i6$2 from "@angular/material/button";
31
+ import { MatButton } from "@angular/material/button";
32
+ import * as i7$2 from "@angular/material/form-field";
33
+ import { MatError, MatFormField, MatHint, MatLabel, MatSuffix } from "@angular/material/form-field";
34
+ import * as i8$1 from "@angular/material/input";
35
+ import { MatInput } from "@angular/material/input";
36
+ import { debounceTime as debounceTime$1 } from "rxjs/operators";
37
+ import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
38
+ import * as i7$1 from "@angular/material/autocomplete";
39
+ import * as i12$1 from "@angular/material/select";
40
+ import * as i13 from "@angular/material/sort";
41
+ import { SelectionModel } from "@angular/cdk/collections";
42
+ import * as i8 from "@angular/material/checkbox";
43
+ import * as i14 from "@angular/material/tooltip";
44
+ import * as i9 from "@angular/material/datepicker";
45
+ import { MatDatepicker, MatDatepickerInput, MatDatepickerToggle } from "@angular/material/datepicker";
46
+ import * as i4 from "@angular/material/divider";
47
+ import * as i12 from "@angular/material/progress-spinner";
48
+ import * as i19 from "@angular/common";
49
+ import { CommonModule } from "@angular/common";
50
+ import moment$1 from "moment/moment";
51
+ import * as i6 from "angularx-qrcode";
52
+ import { QRCodeComponent } from "angularx-qrcode";
53
+ import JsBarcode from "jsbarcode";
54
+ var ProductService = class ProductService extends TechlifyService {
55
+ httpService;
56
+ constructor(httpService) {
57
+ super(httpService, "products");
58
+ this.httpService = httpService;
59
+ }
60
+ static ɵfac = i0.ɵɵngDeclareFactory({
61
+ minVersion: "12.0.0",
62
+ version: "22.2.5",
63
+ ngImport: i0,
64
+ type: ProductService,
65
+ deps: [{ token: i1.HttpService }],
66
+ target: i0.ɵɵFactoryTarget.Injectable
67
+ });
68
+ static ɵprov = i0.ɵɵngDeclareInjectable({
69
+ minVersion: "12.0.0",
70
+ version: "22.2.5",
71
+ ngImport: i0,
72
+ type: ProductService,
73
+ providedIn: "root"
74
+ });
75
+ };
76
+ i0.ɵɵngDeclareClassMetadata({
77
+ minVersion: "12.0.0",
78
+ version: "22.2.5",
79
+ ngImport: i0,
80
+ type: ProductService,
81
+ decorators: [{
82
+ type: Injectable,
83
+ args: [{ providedIn: "root" }]
84
+ }],
85
+ ctorParameters: () => [{ type: i1.HttpService }]
86
+ });
87
+ const errorMessages = {
88
+ title: { required: "Please Enter Title" },
89
+ description: { required: "Please Enter Description" }
90
+ };
91
+ var ProductMeasureFormComponent = class ProductMeasureFormComponent {
92
+ measureService;
93
+ fb;
94
+ dialogRef;
95
+ data;
96
+ spinnerService;
97
+ formValidatorService;
98
+ errorService;
99
+ alertService;
100
+ productMeasureForm;
101
+ isWorking = false;
102
+ isUpdate = false;
103
+ constructor(measureService, fb, dialogRef, data, spinnerService, formValidatorService, errorService, alertService) {
104
+ this.measureService = measureService;
105
+ this.fb = fb;
106
+ this.dialogRef = dialogRef;
107
+ this.data = data;
108
+ this.spinnerService = spinnerService;
109
+ this.formValidatorService = formValidatorService;
110
+ this.errorService = errorService;
111
+ this.alertService = alertService;
112
+ this.productMeasureForm = this.fb.group({
113
+ id: [""],
114
+ title: ["", Validators.compose([Validators.required])],
115
+ description: ["", Validators.compose([Validators.required])]
116
+ });
117
+ }
118
+ ngOnInit() {
119
+ if (this.data.details) {
120
+ this.isUpdate = true;
121
+ this.productMeasureForm.patchValue(this.data.details);
122
+ }
123
+ }
124
+ async save() {
125
+ if (!this.productMeasureForm.valid) {
126
+ this.alertService.addAlert("Please Fill All Required Fields", "warn");
127
+ this.productMeasureForm.markAllAsTouched();
128
+ return;
129
+ }
130
+ let productMeasure = this.productMeasureForm.value;
131
+ try {
132
+ this.spinnerService.show();
133
+ this.isWorking = true;
134
+ let result = this.isUpdate ? await this.measureService.update(productMeasure).toPromise() : await this.measureService.store(productMeasure).toPromise();
135
+ this.dialogRef.close(result);
136
+ } catch (error) {
137
+ this.errorService.handleError(error);
138
+ } finally {
139
+ this.isWorking = false;
140
+ this.spinnerService.hide();
141
+ }
142
+ }
143
+ isFieldValid(field) {
144
+ return this.formValidatorService.isFieldValid(field, this.productMeasureForm);
145
+ }
146
+ getErrorMessage(field) {
147
+ return this.formValidatorService.getErrorMessage(field, this.productMeasureForm, errorMessages);
148
+ }
149
+ static ɵfac = i0.ɵɵngDeclareFactory({
150
+ minVersion: "12.0.0",
151
+ version: "22.2.5",
152
+ ngImport: i0,
153
+ type: ProductMeasureFormComponent,
154
+ deps: [
155
+ { token: MeasureService },
156
+ { token: i2.FormBuilder },
157
+ { token: i3.MatDialogRef },
158
+ { token: MAT_DIALOG_DATA },
159
+ { token: i4$2.NgxSpinnerService },
160
+ { token: i1.FormValidatorService },
161
+ { token: i1.ErrorHandlerService },
162
+ { token: i1.AlertService }
163
+ ],
164
+ target: i0.ɵɵFactoryTarget.Component
165
+ });
166
+ static ɵcmp = i0.ɵɵngDeclareComponent({
167
+ minVersion: "17.0.0",
168
+ version: "22.2.5",
169
+ type: ProductMeasureFormComponent,
170
+ isStandalone: false,
171
+ selector: "app-product-measure-form",
172
+ ngImport: i0,
173
+ template: "<div>\n <form [formGroup]=\"productMeasureForm\" (ngSubmit)=\"save()\">\n <h3 class=\"text-center\">Create/Update Product Measure</h3>\n <div class=\"d-flex flex-column\">\n <div class=\"d-flex flex-column\">\n <mat-form-field>\n <input matInput placeholder=\"Title\" formControlName=\"title\" required />\n @if (isFieldValid('title')) {\n <mat-error>{{ getErrorMessage('title') }} </mat-error>\n }\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Description\" formControlName=\"description\" required />\n @if (isFieldValid('description')) {\n <mat-error>{{ getErrorMessage('description') }} </mat-error>\n }\n </mat-form-field>\n <div class=\"d-flex gap-3\">\n <button mat-button class=\"mt-2\" type=\"button\" (click)=\"dialogRef.close()\">Cancel</button>\n <button mat-raised-button color=\"primary\" class=\"mt-2\" type=\"submit\">Save</button>\n </div>\n </div>\n </div>\n </form>\n</div>\n",
174
+ dependencies: [
175
+ {
176
+ kind: "component",
177
+ type: i6$2.MatButton,
178
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
179
+ inputs: ["matButton"],
180
+ exportAs: ["matButton", "matAnchor"]
181
+ },
182
+ {
183
+ kind: "component",
184
+ type: i7$2.MatFormField,
185
+ selector: "mat-form-field",
186
+ inputs: [
187
+ "hideRequiredMarker",
188
+ "color",
189
+ "floatLabel",
190
+ "appearance",
191
+ "subscriptSizing",
192
+ "hintLabel"
193
+ ],
194
+ exportAs: ["matFormField"]
195
+ },
196
+ {
197
+ kind: "directive",
198
+ type: i7$2.MatError,
199
+ selector: "mat-error, [matError]",
200
+ inputs: ["id"]
201
+ },
202
+ {
203
+ kind: "directive",
204
+ type: i8$1.MatInput,
205
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
206
+ inputs: [
207
+ "disabled",
208
+ "id",
209
+ "placeholder",
210
+ "name",
211
+ "required",
212
+ "type",
213
+ "errorStateMatcher",
214
+ "aria-describedby",
215
+ "value",
216
+ "readonly",
217
+ "disabledInteractive"
218
+ ],
219
+ exportAs: ["matInput"]
220
+ },
221
+ {
222
+ kind: "directive",
223
+ type: i2.ɵNgNoValidate,
224
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
225
+ },
226
+ {
227
+ kind: "directive",
228
+ type: i2.DefaultValueAccessor,
229
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
230
+ },
231
+ {
232
+ kind: "directive",
233
+ type: i2.NgControlStatus,
234
+ selector: "[formControlName],[ngModel],[formControl]"
235
+ },
236
+ {
237
+ kind: "directive",
238
+ type: i2.NgControlStatusGroup,
239
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
240
+ },
241
+ {
242
+ kind: "directive",
243
+ type: i2.RequiredValidator,
244
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
245
+ inputs: ["required"]
246
+ },
247
+ {
248
+ kind: "directive",
249
+ type: i2.FormGroupDirective,
250
+ selector: "[formGroup]",
251
+ inputs: ["formGroup"],
252
+ outputs: ["ngSubmit"],
253
+ exportAs: ["ngForm"]
254
+ },
255
+ {
256
+ kind: "directive",
257
+ type: i2.FormControlName,
258
+ selector: "[formControlName]",
259
+ inputs: [
260
+ "formControlName",
261
+ "disabled",
262
+ "ngModel"
263
+ ],
264
+ outputs: ["ngModelChange"]
265
+ }
266
+ ],
267
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
268
+ preserveWhitespaces: true
269
+ });
270
+ };
271
+ i0.ɵɵngDeclareClassMetadata({
272
+ minVersion: "12.0.0",
273
+ version: "22.2.5",
274
+ ngImport: i0,
275
+ type: ProductMeasureFormComponent,
276
+ decorators: [{
277
+ type: Component,
278
+ args: [{
279
+ selector: "app-product-measure-form",
280
+ changeDetection: ChangeDetectionStrategy.Eager,
281
+ standalone: false,
282
+ template: "<div>\n <form [formGroup]=\"productMeasureForm\" (ngSubmit)=\"save()\">\n <h3 class=\"text-center\">Create/Update Product Measure</h3>\n <div class=\"d-flex flex-column\">\n <div class=\"d-flex flex-column\">\n <mat-form-field>\n <input matInput placeholder=\"Title\" formControlName=\"title\" required />\n @if (isFieldValid('title')) {\n <mat-error>{{ getErrorMessage('title') }} </mat-error>\n }\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Description\" formControlName=\"description\" required />\n @if (isFieldValid('description')) {\n <mat-error>{{ getErrorMessage('description') }} </mat-error>\n }\n </mat-form-field>\n <div class=\"d-flex gap-3\">\n <button mat-button class=\"mt-2\" type=\"button\" (click)=\"dialogRef.close()\">Cancel</button>\n <button mat-raised-button color=\"primary\" class=\"mt-2\" type=\"submit\">Save</button>\n </div>\n </div>\n </div>\n </form>\n</div>\n"
283
+ }]
284
+ }],
285
+ ctorParameters: () => [
286
+ { type: MeasureService },
287
+ { type: i2.FormBuilder },
288
+ { type: i3.MatDialogRef },
289
+ {
290
+ type: void 0,
291
+ decorators: [{
292
+ type: Inject,
293
+ args: [MAT_DIALOG_DATA]
294
+ }]
295
+ },
296
+ { type: i4$2.NgxSpinnerService },
297
+ { type: i1.FormValidatorService },
298
+ { type: i1.ErrorHandlerService },
299
+ { type: i1.AlertService }
300
+ ]
301
+ });
302
+ let ProductMeasuresListComponent = class ProductMeasuresListComponent {
303
+ fb;
304
+ dialog;
305
+ filterService;
306
+ activatedRoute;
307
+ measureService;
308
+ filterFormGroup;
309
+ lastPage;
310
+ page = 1;
311
+ perPage = 25;
312
+ totalItems = 0;
313
+ currentPage = 1;
314
+ num_items = 25;
315
+ routeFilters;
316
+ productMeasures = [];
317
+ columnDefinitions = [
318
+ {
319
+ def: "#",
320
+ isShow: true
321
+ },
322
+ {
323
+ def: "Title",
324
+ isShow: true
325
+ },
326
+ {
327
+ def: "Description",
328
+ isShow: true
329
+ },
330
+ {
331
+ def: "Actions",
332
+ isShow: true
333
+ }
334
+ ];
335
+ displayedColumns = [
336
+ "#",
337
+ "Title",
338
+ "Description",
339
+ "Actions"
340
+ ];
341
+ dataSource = new MatTableDataSource();
342
+ constructor(fb, dialog, filterService, activatedRoute, measureService) {
343
+ this.fb = fb;
344
+ this.dialog = dialog;
345
+ this.filterService = filterService;
346
+ this.activatedRoute = activatedRoute;
347
+ this.measureService = measureService;
348
+ this.filterFormGroup = this.fb.group({
349
+ num_items: [this.num_items + "|" + this.currentPage],
350
+ search: [""],
351
+ type_ids: [""],
352
+ sort_by: [""]
353
+ });
354
+ }
355
+ ngOnInit() {
356
+ this.patchFiltersFromRoute();
357
+ this.listenForChanges();
358
+ this.loadData();
359
+ }
360
+ listenForChanges() {
361
+ this.filterFormGroup.valueChanges.pipe(debounceTime$1(500), untilDestroyed(this)).subscribe((changes) => {
362
+ this.filterService.applyFilterToRoute(this.activatedRoute, this.filterFormGroup.value);
363
+ this.reload();
364
+ });
365
+ }
366
+ patchFiltersFromRoute() {
367
+ this.routeFilters = this.filterService.getFiltersFromRoute(this.activatedRoute, this.filterFormGroup.value);
368
+ this.filterFormGroup.setValue(this.routeFilters);
369
+ if (this.routeFilters.type_ids) this.filterFormGroup.get("type_ids").setValue(this.routeFilters.type_ids.split(",").map(Number));
370
+ }
371
+ async loadData() {
372
+ let filters = this.filterFormGroup.value;
373
+ filters.page = this.page;
374
+ filters.per_page = this.perPage;
375
+ filters.type_ids = filters.type_ids.toString();
376
+ filters.num_items = this.num_items + "|" + this.currentPage;
377
+ let res = await this.measureService.index(filters).toPromise();
378
+ if (this.productMeasures.length < 1) this.productMeasures = res.data;
379
+ else res.data.forEach((item) => this.productMeasures.push(item));
380
+ this.dataSource = new MatTableDataSource(this.productMeasures);
381
+ this.totalItems = res.total;
382
+ this.lastPage = res.last_page || this.page;
383
+ }
384
+ reload() {
385
+ this.productMeasures = [];
386
+ this.currentPage = 1;
387
+ this.loadData();
388
+ }
389
+ modifyProductMeasure(model) {
390
+ this.dialog.open(ProductMeasureFormComponent, {
391
+ width: "600px",
392
+ data: { details: model }
393
+ }).afterClosed().subscribe((result) => {
394
+ if (result) this.reload();
395
+ });
396
+ }
397
+ onScroll() {
398
+ if (this.totalItems > this.productMeasures.length) {
399
+ this.currentPage += 1;
400
+ this.loadData();
401
+ }
402
+ }
403
+ assignFilter(column, direction) {
404
+ if (column) return this.filterFormGroup.get("sort_by")?.setValue(column + "|" + direction);
405
+ }
406
+ sortColumn(event) {
407
+ var direction = event.direction.toString().toUpperCase();
408
+ this.assignFilter(event.active, direction);
409
+ }
410
+ ngOnDestroy() {}
411
+ static ɵfac = i0.ɵɵngDeclareFactory({
412
+ minVersion: "12.0.0",
413
+ version: "22.2.5",
414
+ ngImport: i0,
415
+ type: ProductMeasuresListComponent,
416
+ deps: [
417
+ { token: i2.FormBuilder },
418
+ { token: i3.MatDialog },
419
+ { token: i1.FilterService },
420
+ { token: i4$1.ActivatedRoute },
421
+ { token: MeasureService }
422
+ ],
423
+ target: i0.ɵɵFactoryTarget.Component
424
+ });
425
+ static ɵcmp = i0.ɵɵngDeclareComponent({
426
+ minVersion: "17.0.0",
427
+ version: "22.2.5",
428
+ type: ProductMeasuresListComponent,
429
+ isStandalone: false,
430
+ selector: "app-product-measure-list",
431
+ ngImport: i0,
432
+ template: "<div class=\"d-flex flex-column\">\n <div class=\"text-center d-flex justify-content-center align-items-center\">\n <h3 class=\"d-flex\">\n <span class=\"mt-1\"> Product Measures </span>\n <button mat-raised-button class=\"ml-2\" color=\"primary\" (click)=\"modifyProductMeasure()\">\n <mat-icon>add</mat-icon>\n Product Measure\n </button>\n </h3>\n </div>\n\n <div class=\"d-flex\">\n <form [formGroup]=\"filterFormGroup\" class=\"d-flex gap-2\">\n <mat-form-field>\n <input matInput placeholder=\"Item Name, Description, etc.\" formControlName=\"search\" />\n </mat-form-field>\n </form>\n\n <mat-form-field class=\"ml-2\" style=\"flex: 0 1 calc(11.11% - 0.5rem)\">\n <mat-label>Columns</mat-label>\n <mat-select [(ngModel)]=\"displayedColumns\" multiple name=\"column\">\n @for (column of columnDefinitions; track column) {\n <mat-option [value]=\"column.def\" [disabled]=\"!column.isShow\">\n {{ column?.def }}</mat-option\n >\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 d-flex gap-3\">\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",
433
+ dependencies: [
434
+ {
435
+ kind: "directive",
436
+ type: i6$1.InfiniteScrollDirective,
437
+ selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]",
438
+ inputs: [
439
+ "infiniteScrollDistance",
440
+ "infiniteScrollUpDistance",
441
+ "infiniteScrollThrottle",
442
+ "infiniteScrollDisabled",
443
+ "infiniteScrollContainer",
444
+ "scrollWindow",
445
+ "immediateCheck",
446
+ "horizontal",
447
+ "alwaysCallback",
448
+ "fromRoot"
449
+ ],
450
+ outputs: ["scrolled", "scrolledUp"]
451
+ },
452
+ {
453
+ kind: "component",
454
+ type: i7$1.MatOption,
455
+ selector: "mat-option",
456
+ inputs: [
457
+ "value",
458
+ "id",
459
+ "disabled"
460
+ ],
461
+ outputs: ["onSelectionChange"],
462
+ exportAs: ["matOption"]
463
+ },
464
+ {
465
+ kind: "component",
466
+ type: i6$2.MatButton,
467
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
468
+ inputs: ["matButton"],
469
+ exportAs: ["matButton", "matAnchor"]
470
+ },
471
+ {
472
+ kind: "component",
473
+ type: i6$2.MatIconButton,
474
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
475
+ exportAs: ["matButton", "matAnchor"]
476
+ },
477
+ {
478
+ kind: "component",
479
+ type: i7$2.MatFormField,
480
+ selector: "mat-form-field",
481
+ inputs: [
482
+ "hideRequiredMarker",
483
+ "color",
484
+ "floatLabel",
485
+ "appearance",
486
+ "subscriptSizing",
487
+ "hintLabel"
488
+ ],
489
+ exportAs: ["matFormField"]
490
+ },
491
+ {
492
+ kind: "directive",
493
+ type: i7$2.MatLabel,
494
+ selector: "mat-label"
495
+ },
496
+ {
497
+ kind: "component",
498
+ type: i10.MatIcon,
499
+ selector: "mat-icon",
500
+ inputs: [
501
+ "color",
502
+ "inline",
503
+ "svgIcon",
504
+ "fontSet",
505
+ "fontIcon"
506
+ ],
507
+ exportAs: ["matIcon"]
508
+ },
509
+ {
510
+ kind: "directive",
511
+ type: i8$1.MatInput,
512
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
513
+ inputs: [
514
+ "disabled",
515
+ "id",
516
+ "placeholder",
517
+ "name",
518
+ "required",
519
+ "type",
520
+ "errorStateMatcher",
521
+ "aria-describedby",
522
+ "value",
523
+ "readonly",
524
+ "disabledInteractive"
525
+ ],
526
+ exportAs: ["matInput"]
527
+ },
528
+ {
529
+ kind: "component",
530
+ type: i12$1.MatSelect,
531
+ selector: "mat-select",
532
+ inputs: [
533
+ "aria-describedby",
534
+ "panelClass",
535
+ "disabled",
536
+ "disableRipple",
537
+ "tabIndex",
538
+ "hideSingleSelectionIndicator",
539
+ "placeholder",
540
+ "required",
541
+ "multiple",
542
+ "disableOptionCentering",
543
+ "compareWith",
544
+ "value",
545
+ "aria-label",
546
+ "aria-labelledby",
547
+ "errorStateMatcher",
548
+ "typeaheadDebounceInterval",
549
+ "sortComparator",
550
+ "id",
551
+ "panelWidth",
552
+ "canSelectNullableOptions"
553
+ ],
554
+ outputs: [
555
+ "openedChange",
556
+ "opened",
557
+ "closed",
558
+ "selectionChange",
559
+ "valueChange"
560
+ ],
561
+ exportAs: ["matSelect"]
562
+ },
563
+ {
564
+ kind: "directive",
565
+ type: i13.MatSort,
566
+ selector: "[matSort]",
567
+ inputs: [
568
+ "matSortActive",
569
+ "matSortStart",
570
+ "matSortDirection",
571
+ "matSortDisableClear",
572
+ "matSortDisabled"
573
+ ],
574
+ outputs: ["matSortChange"],
575
+ exportAs: ["matSort"]
576
+ },
577
+ {
578
+ kind: "component",
579
+ type: i13.MatSortHeader,
580
+ selector: "[mat-sort-header]",
581
+ inputs: [
582
+ "mat-sort-header",
583
+ "arrowPosition",
584
+ "start",
585
+ "disabled",
586
+ "sortActionDescription",
587
+ "disableClear"
588
+ ],
589
+ exportAs: ["matSortHeader"]
590
+ },
591
+ {
592
+ kind: "component",
593
+ type: i14$1.MatTable,
594
+ selector: "mat-table, table[mat-table]",
595
+ exportAs: ["matTable"]
596
+ },
597
+ {
598
+ kind: "directive",
599
+ type: i14$1.MatHeaderCellDef,
600
+ selector: "[matHeaderCellDef]"
601
+ },
602
+ {
603
+ kind: "directive",
604
+ type: i14$1.MatHeaderRowDef,
605
+ selector: "[matHeaderRowDef]",
606
+ inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"]
607
+ },
608
+ {
609
+ kind: "directive",
610
+ type: i14$1.MatColumnDef,
611
+ selector: "[matColumnDef]",
612
+ inputs: ["matColumnDef"]
613
+ },
614
+ {
615
+ kind: "directive",
616
+ type: i14$1.MatCellDef,
617
+ selector: "[matCellDef]"
618
+ },
619
+ {
620
+ kind: "directive",
621
+ type: i14$1.MatRowDef,
622
+ selector: "[matRowDef]",
623
+ inputs: ["matRowDefColumns", "matRowDefWhen"]
624
+ },
625
+ {
626
+ kind: "directive",
627
+ type: i14$1.MatHeaderCell,
628
+ selector: "mat-header-cell, th[mat-header-cell]"
629
+ },
630
+ {
631
+ kind: "directive",
632
+ type: i14$1.MatCell,
633
+ selector: "mat-cell, td[mat-cell]"
634
+ },
635
+ {
636
+ kind: "component",
637
+ type: i14$1.MatHeaderRow,
638
+ selector: "mat-header-row, tr[mat-header-row]",
639
+ exportAs: ["matHeaderRow"]
640
+ },
641
+ {
642
+ kind: "component",
643
+ type: i14$1.MatRow,
644
+ selector: "mat-row, tr[mat-row]",
645
+ exportAs: ["matRow"]
646
+ },
647
+ {
648
+ kind: "directive",
649
+ type: i2.ɵNgNoValidate,
650
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
651
+ },
652
+ {
653
+ kind: "directive",
654
+ type: i2.DefaultValueAccessor,
655
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
656
+ },
657
+ {
658
+ kind: "directive",
659
+ type: i2.NgControlStatus,
660
+ selector: "[formControlName],[ngModel],[formControl]"
661
+ },
662
+ {
663
+ kind: "directive",
664
+ type: i2.NgControlStatusGroup,
665
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
666
+ },
667
+ {
668
+ kind: "directive",
669
+ type: i2.FormGroupDirective,
670
+ selector: "[formGroup]",
671
+ inputs: ["formGroup"],
672
+ outputs: ["ngSubmit"],
673
+ exportAs: ["ngForm"]
674
+ },
675
+ {
676
+ kind: "directive",
677
+ type: i2.FormControlName,
678
+ selector: "[formControlName]",
679
+ inputs: [
680
+ "formControlName",
681
+ "disabled",
682
+ "ngModel"
683
+ ],
684
+ outputs: ["ngModelChange"]
685
+ },
686
+ {
687
+ kind: "directive",
688
+ type: i2.NgModel,
689
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
690
+ inputs: [
691
+ "name",
692
+ "disabled",
693
+ "ngModel",
694
+ "ngModelOptions"
695
+ ],
696
+ outputs: ["ngModelChange"],
697
+ exportAs: ["ngModel"]
698
+ }
699
+ ],
700
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
701
+ preserveWhitespaces: true
702
+ });
703
+ };
704
+ ProductMeasuresListComponent = __decorate([UntilDestroy()], ProductMeasuresListComponent);
705
+ i0.ɵɵngDeclareClassMetadata({
706
+ minVersion: "12.0.0",
707
+ version: "22.2.5",
708
+ ngImport: i0,
709
+ type: ProductMeasuresListComponent,
710
+ decorators: [{
711
+ type: Component,
712
+ args: [{
713
+ selector: "app-product-measure-list",
714
+ changeDetection: ChangeDetectionStrategy.Eager,
715
+ standalone: false,
716
+ template: "<div class=\"d-flex flex-column\">\n <div class=\"text-center d-flex justify-content-center align-items-center\">\n <h3 class=\"d-flex\">\n <span class=\"mt-1\"> Product Measures </span>\n <button mat-raised-button class=\"ml-2\" color=\"primary\" (click)=\"modifyProductMeasure()\">\n <mat-icon>add</mat-icon>\n Product Measure\n </button>\n </h3>\n </div>\n\n <div class=\"d-flex\">\n <form [formGroup]=\"filterFormGroup\" class=\"d-flex gap-2\">\n <mat-form-field>\n <input matInput placeholder=\"Item Name, Description, etc.\" formControlName=\"search\" />\n </mat-form-field>\n </form>\n\n <mat-form-field class=\"ml-2\" style=\"flex: 0 1 calc(11.11% - 0.5rem)\">\n <mat-label>Columns</mat-label>\n <mat-select [(ngModel)]=\"displayedColumns\" multiple name=\"column\">\n @for (column of columnDefinitions; track column) {\n <mat-option [value]=\"column.def\" [disabled]=\"!column.isShow\">\n {{ column?.def }}</mat-option\n >\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 d-flex gap-3\">\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"
717
+ }]
718
+ }],
719
+ ctorParameters: () => [
720
+ { type: i2.FormBuilder },
721
+ { type: i3.MatDialog },
722
+ { type: i1.FilterService },
723
+ { type: i4$1.ActivatedRoute },
724
+ { type: MeasureService }
725
+ ]
726
+ });
727
+ var ProductFormService = class ProductFormService extends TechlifyFormService {
728
+ constructor() {
729
+ super();
730
+ }
731
+ static ɵfac = i0.ɵɵngDeclareFactory({
732
+ minVersion: "12.0.0",
733
+ version: "22.2.5",
734
+ ngImport: i0,
735
+ type: ProductFormService,
736
+ deps: [],
737
+ target: i0.ɵɵFactoryTarget.Injectable
738
+ });
739
+ static ɵprov = i0.ɵɵngDeclareInjectable({
740
+ minVersion: "12.0.0",
741
+ version: "22.2.5",
742
+ ngImport: i0,
743
+ type: ProductFormService,
744
+ providedIn: "root"
745
+ });
746
+ };
747
+ i0.ɵɵngDeclareClassMetadata({
748
+ minVersion: "12.0.0",
749
+ version: "22.2.5",
750
+ ngImport: i0,
751
+ type: ProductFormService,
752
+ decorators: [{
753
+ type: Injectable,
754
+ args: [{ providedIn: "root" }]
755
+ }],
756
+ ctorParameters: () => []
757
+ });
758
+ var ProductFormButtonComponent = class ProductFormButtonComponent {
759
+ product = input(void 0, ...ngDevMode ? [{ debugName: "product" }] : /* istanbul ignore next */ []);
760
+ constructor() {}
761
+ static ɵfac = i0.ɵɵngDeclareFactory({
762
+ minVersion: "12.0.0",
763
+ version: "22.2.5",
764
+ ngImport: i0,
765
+ type: ProductFormButtonComponent,
766
+ deps: [],
767
+ target: i0.ɵɵFactoryTarget.Component
768
+ });
769
+ static ɵcmp = i0.ɵɵngDeclareComponent({
770
+ minVersion: "17.0.0",
771
+ version: "22.2.5",
772
+ type: ProductFormButtonComponent,
773
+ isStandalone: false,
774
+ selector: "app-product-form-button",
775
+ inputs: { product: {
776
+ classPropertyName: "product",
777
+ publicName: "product",
778
+ isSignal: true,
779
+ isRequired: false,
780
+ transformFunction: null
781
+ } },
782
+ ngImport: i0,
783
+ template: "@if (product()) {\n<app-techlify-icon role='button' name='edit' [routerLink]=\"['/inventory/products/form', product().id]\"></app-techlify-icon>\n} @else {\n<app-techlify-icon role='button' name='add' routerLink=\"form\"></app-techlify-icon>\n}",
784
+ styles: [""],
785
+ dependencies: [{
786
+ kind: "directive",
787
+ type: i4$1.RouterLink,
788
+ selector: "[routerLink]",
789
+ inputs: [
790
+ "target",
791
+ "queryParams",
792
+ "fragment",
793
+ "queryParamsHandling",
794
+ "state",
795
+ "info",
796
+ "relativeTo",
797
+ "preserveFragment",
798
+ "skipLocationChange",
799
+ "replaceUrl",
800
+ "browserUrl",
801
+ "routerLink"
802
+ ]
803
+ }, {
804
+ kind: "component",
805
+ type: i1.TechlifyIconComponent,
806
+ selector: "app-techlify-icon",
807
+ inputs: ["name", "size"]
808
+ }],
809
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
810
+ preserveWhitespaces: true
811
+ });
812
+ };
813
+ i0.ɵɵngDeclareClassMetadata({
814
+ minVersion: "12.0.0",
815
+ version: "22.2.5",
816
+ ngImport: i0,
817
+ type: ProductFormButtonComponent,
818
+ decorators: [{
819
+ type: Component,
820
+ args: [{
821
+ selector: "app-product-form-button",
822
+ changeDetection: ChangeDetectionStrategy.Eager,
823
+ standalone: false,
824
+ template: "@if (product()) {\n<app-techlify-icon role='button' name='edit' [routerLink]=\"['/inventory/products/form', product().id]\"></app-techlify-icon>\n} @else {\n<app-techlify-icon role='button' name='add' routerLink=\"form\"></app-techlify-icon>\n}"
825
+ }]
826
+ }],
827
+ ctorParameters: () => [],
828
+ propDecorators: { product: [{
829
+ type: i0.Input,
830
+ args: [{
831
+ isSignal: true,
832
+ alias: "product",
833
+ required: false
834
+ }]
835
+ }] }
836
+ });
837
+ var ProductBatchService = class ProductBatchService extends TechlifyService {
838
+ httpService;
839
+ constructor(httpService) {
840
+ super(httpService, "products-batch");
841
+ this.httpService = httpService;
842
+ }
843
+ static ɵfac = i0.ɵɵngDeclareFactory({
844
+ minVersion: "12.0.0",
845
+ version: "22.2.5",
846
+ ngImport: i0,
847
+ type: ProductBatchService,
848
+ deps: [{ token: i1.HttpService }],
849
+ target: i0.ɵɵFactoryTarget.Injectable
850
+ });
851
+ static ɵprov = i0.ɵɵngDeclareInjectable({
852
+ minVersion: "12.0.0",
853
+ version: "22.2.5",
854
+ ngImport: i0,
855
+ type: ProductBatchService,
856
+ providedIn: "root"
857
+ });
858
+ };
859
+ i0.ɵɵngDeclareClassMetadata({
860
+ minVersion: "12.0.0",
861
+ version: "22.2.5",
862
+ ngImport: i0,
863
+ type: ProductBatchService,
864
+ decorators: [{
865
+ type: Injectable,
866
+ args: [{ providedIn: "root" }]
867
+ }],
868
+ ctorParameters: () => [{ type: i1.HttpService }]
869
+ });
870
+ var ProductBatchUpdateFormComponent = class ProductBatchUpdateFormComponent extends TechlifyFormComponent {
871
+ formBuilder;
872
+ batchService;
873
+ selection;
874
+ updated = new EventEmitter();
875
+ isSaving;
876
+ constructor(formValidatorService, formBuilder, batchService) {
877
+ super(formValidatorService);
878
+ this.formBuilder = formBuilder;
879
+ this.batchService = batchService;
880
+ this.form = this.formBuilder.group({
881
+ type_id: [""],
882
+ category_ids: [""],
883
+ measure_id: [""],
884
+ reorder_point: [""]
885
+ });
886
+ }
887
+ save() {
888
+ const data = { ...this.form.value };
889
+ data.ids = this.selection.selected.map((product) => product?.id);
890
+ this.isSaving = true;
891
+ this.batchService.store(data).subscribe({
892
+ next: () => {
893
+ this.isSaving = false;
894
+ this.alertService.addAlert("The products updated successfully!", "success");
895
+ this.selection.clear();
896
+ this.updated.emit();
897
+ },
898
+ error: () => {
899
+ this.isSaving = false;
900
+ }
901
+ });
902
+ }
903
+ static ɵfac = i0.ɵɵngDeclareFactory({
904
+ minVersion: "12.0.0",
905
+ version: "22.2.5",
906
+ ngImport: i0,
907
+ type: ProductBatchUpdateFormComponent,
908
+ deps: [
909
+ { token: i1.FormValidatorService },
910
+ { token: i2.FormBuilder },
911
+ { token: ProductBatchService }
912
+ ],
913
+ target: i0.ɵɵFactoryTarget.Component
914
+ });
915
+ static ɵcmp = i0.ɵɵngDeclareComponent({
916
+ minVersion: "14.0.0",
917
+ version: "22.2.5",
918
+ type: ProductBatchUpdateFormComponent,
919
+ isStandalone: false,
920
+ selector: "app-product-batch-update-form",
921
+ inputs: { selection: "selection" },
922
+ outputs: { updated: "updated" },
923
+ usesInheritance: true,
924
+ ngImport: i0,
925
+ template: "<p class=\"text-primary fw-bold\">{{ selection.selected.length }} Product(s) Selected</p>\n<form [formGroup]=\"form\" class=\"d-flex flex-column justify-content-start\" (submit)=\"save()\">\n <mat-form-field>\n <mat-label>Type</mat-label>\n <app-searchable-selector apiUrl=\"api/product-types\" formControlName=\"type_id\"></app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Category</mat-label>\n <app-searchable-selector apiUrl=\"api/product-categories\" formControlName=\"category_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Measure</mat-label>\n <app-searchable-selector apiUrl=\"api/product-measures\" formControlName=\"measure_id\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Reorder Point</mat-label>\n <input matInput placeholder=\"Reorder Point\" formControlName=\"reorder_point\" type=\"number\" />\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2 mt-3\">\n <button [disabled]=\"isSaving\" type=\"submit\" mat-raised-button color=\"primary\">Update</button>\n <button [disabled]=\"isSaving\" mat-flat-button type=\"button\" (click)=\"selection.clear()\">Cancel</button>\n </div>\n</form>\n",
926
+ styles: [""],
927
+ dependencies: [
928
+ {
929
+ kind: "component",
930
+ type: i6$2.MatButton,
931
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
932
+ inputs: ["matButton"],
933
+ exportAs: ["matButton", "matAnchor"]
934
+ },
935
+ {
936
+ kind: "component",
937
+ type: i7$2.MatFormField,
938
+ selector: "mat-form-field",
939
+ inputs: [
940
+ "hideRequiredMarker",
941
+ "color",
942
+ "floatLabel",
943
+ "appearance",
944
+ "subscriptSizing",
945
+ "hintLabel"
946
+ ],
947
+ exportAs: ["matFormField"]
948
+ },
949
+ {
950
+ kind: "directive",
951
+ type: i7$2.MatLabel,
952
+ selector: "mat-label"
953
+ },
954
+ {
955
+ kind: "directive",
956
+ type: i8$1.MatInput,
957
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
958
+ inputs: [
959
+ "disabled",
960
+ "id",
961
+ "placeholder",
962
+ "name",
963
+ "required",
964
+ "type",
965
+ "errorStateMatcher",
966
+ "aria-describedby",
967
+ "value",
968
+ "readonly",
969
+ "disabledInteractive"
970
+ ],
971
+ exportAs: ["matInput"]
972
+ },
973
+ {
974
+ kind: "directive",
975
+ type: i2.ɵNgNoValidate,
976
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
977
+ },
978
+ {
979
+ kind: "directive",
980
+ type: i2.DefaultValueAccessor,
981
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
982
+ },
983
+ {
984
+ kind: "directive",
985
+ type: i2.NumberValueAccessor,
986
+ selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
987
+ },
988
+ {
989
+ kind: "directive",
990
+ type: i2.NgControlStatus,
991
+ selector: "[formControlName],[ngModel],[formControl]"
992
+ },
993
+ {
994
+ kind: "directive",
995
+ type: i2.NgControlStatusGroup,
996
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
997
+ },
998
+ {
999
+ kind: "directive",
1000
+ type: i2.FormGroupDirective,
1001
+ selector: "[formGroup]",
1002
+ inputs: ["formGroup"],
1003
+ outputs: ["ngSubmit"],
1004
+ exportAs: ["ngForm"]
1005
+ },
1006
+ {
1007
+ kind: "directive",
1008
+ type: i2.FormControlName,
1009
+ selector: "[formControlName]",
1010
+ inputs: [
1011
+ "formControlName",
1012
+ "disabled",
1013
+ "ngModel"
1014
+ ],
1015
+ outputs: ["ngModelChange"]
1016
+ },
1017
+ {
1018
+ kind: "component",
1019
+ type: i1.SearchableSelectorComponent,
1020
+ selector: "app-searchable-selector",
1021
+ inputs: [
1022
+ "valueField",
1023
+ "titleField",
1024
+ "subtitleField",
1025
+ "apiUrl",
1026
+ "multiple",
1027
+ "selectedValue",
1028
+ "enableSearch",
1029
+ "add",
1030
+ "addConfig",
1031
+ "edit",
1032
+ "editConfig",
1033
+ "sort",
1034
+ "sortBy",
1035
+ "searchField",
1036
+ "itemComponent",
1037
+ "items",
1038
+ "apiDataProperty",
1039
+ "cache",
1040
+ "perPage",
1041
+ "inDataSearch",
1042
+ "panelWidth",
1043
+ "focusSearchOnOpen",
1044
+ "isEmitInitialEvent",
1045
+ "required",
1046
+ "disabled",
1047
+ "value"
1048
+ ],
1049
+ outputs: [
1050
+ "selectedValueChange",
1051
+ "selectionChange",
1052
+ "itemsChange",
1053
+ "isItemsEmpty"
1054
+ ]
1055
+ }
1056
+ ],
1057
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
1058
+ preserveWhitespaces: true
1059
+ });
1060
+ };
1061
+ i0.ɵɵngDeclareClassMetadata({
1062
+ minVersion: "12.0.0",
1063
+ version: "22.2.5",
1064
+ ngImport: i0,
1065
+ type: ProductBatchUpdateFormComponent,
1066
+ decorators: [{
1067
+ type: Component,
1068
+ args: [{
1069
+ selector: "app-product-batch-update-form",
1070
+ changeDetection: ChangeDetectionStrategy.Eager,
1071
+ standalone: false,
1072
+ template: "<p class=\"text-primary fw-bold\">{{ selection.selected.length }} Product(s) Selected</p>\n<form [formGroup]=\"form\" class=\"d-flex flex-column justify-content-start\" (submit)=\"save()\">\n <mat-form-field>\n <mat-label>Type</mat-label>\n <app-searchable-selector apiUrl=\"api/product-types\" formControlName=\"type_id\"></app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Category</mat-label>\n <app-searchable-selector apiUrl=\"api/product-categories\" formControlName=\"category_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Measure</mat-label>\n <app-searchable-selector apiUrl=\"api/product-measures\" formControlName=\"measure_id\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Reorder Point</mat-label>\n <input matInput placeholder=\"Reorder Point\" formControlName=\"reorder_point\" type=\"number\" />\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2 mt-3\">\n <button [disabled]=\"isSaving\" type=\"submit\" mat-raised-button color=\"primary\">Update</button>\n <button [disabled]=\"isSaving\" mat-flat-button type=\"button\" (click)=\"selection.clear()\">Cancel</button>\n </div>\n</form>\n"
1073
+ }]
1074
+ }],
1075
+ ctorParameters: () => [
1076
+ { type: i1.FormValidatorService },
1077
+ { type: i2.FormBuilder },
1078
+ { type: ProductBatchService }
1079
+ ],
1080
+ propDecorators: {
1081
+ selection: [{ type: Input }],
1082
+ updated: [{ type: Output }]
1083
+ }
1084
+ });
1085
+ let ProductListComponent = class ProductListComponent extends TechlifyListComponent {
1086
+ fb;
1087
+ dialog;
1088
+ activatedRoute;
1089
+ productService;
1090
+ productFormService;
1091
+ selection = new SelectionModel(true, []);
1092
+ exportInProgress = false;
1093
+ columnConfig = [
1094
+ {
1095
+ label: "#",
1096
+ def: "#",
1097
+ isSelected: true,
1098
+ isEditable: false
1099
+ },
1100
+ {
1101
+ label: "Name",
1102
+ def: "name",
1103
+ isSelected: true,
1104
+ isEditable: false
1105
+ },
1106
+ {
1107
+ label: "SKU",
1108
+ def: "sku",
1109
+ isSelected: true,
1110
+ isEditable: false
1111
+ },
1112
+ {
1113
+ label: "Average Cost",
1114
+ def: "average_cost",
1115
+ isSelected: false,
1116
+ isEditable: true
1117
+ },
1118
+ {
1119
+ label: "Categories",
1120
+ def: "categories",
1121
+ isSelected: true,
1122
+ isEditable: false
1123
+ },
1124
+ {
1125
+ label: "Description",
1126
+ def: "description",
1127
+ isSelected: true,
1128
+ isEditable: false,
1129
+ isExportable: false
1130
+ },
1131
+ {
1132
+ label: "Reorder Point",
1133
+ def: "reorder_point",
1134
+ isSelected: true,
1135
+ isEditable: false
1136
+ },
1137
+ {
1138
+ label: "Stock Receipts",
1139
+ def: "stock_receipts",
1140
+ isSelected: true,
1141
+ isEditable: false
1142
+ },
1143
+ {
1144
+ label: "Stock Issues",
1145
+ def: "stock_issues",
1146
+ isSelected: true,
1147
+ isEditable: false
1148
+ },
1149
+ {
1150
+ label: "On Hand",
1151
+ def: "on_hand",
1152
+ isSelected: true,
1153
+ isEditable: false
1154
+ },
1155
+ {
1156
+ label: "Measure",
1157
+ def: "measure",
1158
+ isSelected: true,
1159
+ isEditable: false
1160
+ },
1161
+ {
1162
+ label: "Sale Price",
1163
+ def: "sale_price",
1164
+ isSelected: true,
1165
+ isEditable: false
1166
+ },
1167
+ {
1168
+ label: "Type",
1169
+ def: "type",
1170
+ isSelected: false,
1171
+ isEditable: false,
1172
+ isExportable: true
1173
+ },
1174
+ {
1175
+ label: "Initial Quantity",
1176
+ def: "initial_quantity",
1177
+ isSelected: false,
1178
+ isEditable: true
1179
+ },
1180
+ {
1181
+ label: "Income Account",
1182
+ def: "income_account",
1183
+ isSelected: false,
1184
+ isEditable: true
1185
+ },
1186
+ {
1187
+ label: "Expense Account",
1188
+ def: "expense_account",
1189
+ isSelected: false,
1190
+ isEditable: true
1191
+ },
1192
+ {
1193
+ label: "Creator",
1194
+ def: "creator",
1195
+ isSelected: false,
1196
+ isEditable: true
1197
+ },
1198
+ {
1199
+ label: "Actions",
1200
+ def: "Actions",
1201
+ isSelected: true,
1202
+ isEditable: false,
1203
+ isExportable: false
1204
+ },
1205
+ {
1206
+ label: "Select",
1207
+ def: "Select",
1208
+ isSelected: true,
1209
+ isEditable: false,
1210
+ isExportable: false
1211
+ }
1212
+ ];
1213
+ selectedColumns = this.columnConfig.filter((col) => col.isSelected);
1214
+ get displayedColumns() {
1215
+ const selectedDefs = new Set(this.selectedColumns.map((col) => col.def));
1216
+ return this.columnConfig.filter((col) => {
1217
+ if (this.exportInProgress) {
1218
+ if (col.isExportable === true) return true;
1219
+ if (col.isExportable === false) return false;
1220
+ }
1221
+ return selectedDefs.has(col.def);
1222
+ }).map((col) => col.def);
1223
+ }
1224
+ importId;
1225
+ constructor(fb, dialog, activatedRoute, productService, productFormService) {
1226
+ super();
1227
+ this.fb = fb;
1228
+ this.dialog = dialog;
1229
+ this.activatedRoute = activatedRoute;
1230
+ this.productService = productService;
1231
+ this.productFormService = productFormService;
1232
+ this.filterForm = this.fb.group({
1233
+ category_ids: [""],
1234
+ expense_account_ids: [""],
1235
+ income_account_ids: [""],
1236
+ measure_ids: [""],
1237
+ search: [""],
1238
+ sort_by: [""],
1239
+ type_ids: [""]
1240
+ });
1241
+ }
1242
+ ngOnInit() {
1243
+ if (this.activatedRoute.snapshot.queryParams?.["import_id"]) this.importId = parseInt(this.activatedRoute.snapshot.queryParams?.["import_id"]);
1244
+ this.requestHelperService.updateFormWithQueryParams(this.filterForm, {
1245
+ type_ids: { multiple: true },
1246
+ category_ids: { multiple: true },
1247
+ income_account_ids: { multiple: true },
1248
+ expense_account_ids: { multiple: true }
1249
+ });
1250
+ this.filterForm.valueChanges.pipe(debounceTime$1(800)).subscribe(() => {
1251
+ this.requestHelperService.updateQueryParams(this.requestHelperService.convertToFormData({ ...this.filterForm.value }));
1252
+ });
1253
+ this.activatedRoute.queryParams.pipe(debounceTime$1(800)).subscribe(() => this.reload());
1254
+ this.productFormService.isListUpdated().subscribe((val) => {
1255
+ if (val && !this.isWorking) this.reload();
1256
+ });
1257
+ }
1258
+ loadData() {
1259
+ let params = { ...this.requestHelperService.convertToFormData(this.filterForm.value) };
1260
+ params.page = this.page;
1261
+ params.perPage = this.perPage;
1262
+ params.with = "categories,lastStockReceipt,lastStockIssue,measure,creator";
1263
+ if (this.importId) params.import_id = this.importId;
1264
+ this.isWorking = true;
1265
+ this.productService.index(params).subscribe({
1266
+ next: (res) => {
1267
+ this.isWorking = false;
1268
+ this.models = this.models.concat(res?.data);
1269
+ this.lastPage = res?.last_page;
1270
+ this.productFormService.listUpdated(false);
1271
+ },
1272
+ error: () => this.isWorking = false
1273
+ });
1274
+ }
1275
+ assignFilter(column, direction) {
1276
+ if (column) return this.filterForm.get("sort_by")?.setValue(column + "|" + direction);
1277
+ }
1278
+ sortColumn(event) {
1279
+ var direction = event.direction.toString().toUpperCase();
1280
+ this.assignFilter(event.active, direction);
1281
+ }
1282
+ isAllRowsSelected() {
1283
+ return this.selection.selected.length === this.models.length;
1284
+ }
1285
+ toggleAllRows() {
1286
+ if (this.isAllRowsSelected()) {
1287
+ this.selection.clear();
1288
+ return;
1289
+ }
1290
+ this.selection.select(...this.models);
1291
+ }
1292
+ checkboxLabel(row) {
1293
+ if (!row) return `${this.isAllRowsSelected() ? "deselect" : "select"} all`;
1294
+ return `${this.selection.isSelected(row) ? "deselect" : "select"} row ${row.position + 1}`;
1295
+ }
1296
+ handleExport(hideColumns) {
1297
+ this.exportInProgress = hideColumns;
1298
+ }
1299
+ static ɵfac = i0.ɵɵngDeclareFactory({
1300
+ minVersion: "12.0.0",
1301
+ version: "22.2.5",
1302
+ ngImport: i0,
1303
+ type: ProductListComponent,
1304
+ deps: [
1305
+ { token: i2.FormBuilder },
1306
+ { token: i3.MatDialog },
1307
+ { token: i4$1.ActivatedRoute },
1308
+ { token: ProductService },
1309
+ { token: ProductFormService }
1310
+ ],
1311
+ target: i0.ɵɵFactoryTarget.Component
1312
+ });
1313
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1314
+ minVersion: "17.0.0",
1315
+ version: "22.2.5",
1316
+ type: ProductListComponent,
1317
+ isStandalone: false,
1318
+ selector: "app-product-list",
1319
+ usesInheritance: true,
1320
+ ngImport: i0,
1321
+ template: "<mat-card class=\"mb-3\">\n <mat-card-content>\n <form [formGroup]=\"filterForm\" class=\"d-flex justify-content-between align-items-center gap-2\">\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 <span matTooltip=\"Import\" routerLink=\"import\" class=\"cursor-pointer material-symbols-outlined\">\n file_upload\n </span>\n <app-export-to-excel-button tableId=\"productTable\" fileName=\"products\" (onExportStart)=\"handleExport(true)\"\n (onExportEnd)=\"handleExport(false)\">\n </app-export-to-excel-button>\n <app-column-selector mode=\"icon\" class=\"d-print-none\" [columnConfigs]=\"columnConfig\"\n [(selectedColumns)]=\"selectedColumns\"></app-column-selector>\n </div>\n\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <mat-form-field class='fl-md'>\n <mat-label>Search</mat-label>\n <input matInput placeholder=\"Search products\" formControlName=\"search\" />\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Category</mat-label>\n <app-searchable-selector apiUrl=\"api/product-categories\" formControlName=\"category_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Type</mat-label>\n <app-searchable-selector apiUrl=\"api/product-types\" formControlName=\"type_ids\" titleField=\"title\"\n [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n </div>\n </form>\n </mat-card-content>\n</mat-card>\n\n<div class=\"d-flex justify-content-start gap-3\">\n <mat-card [class.flex-fill]=\"!selection.isEmpty()\" [class.w-100]=\"selection.isEmpty()\">\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\" infiniteScroll [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" [fromRoot]=\"true\" matSort\n (matSortChange)=\"sortColumn($event)\" matSortDisableClear=\"true\" aria-describedby=\"Products List\"\n id=\"productTable\">\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\">\n <div class=\"d-flex flex-column gap-1\">\n <a class=\"text-decoration-none text-dark\" [routerLink]=\"[$safeNavigationMigration(element?.id), 'view']\">{{ element.name }}</a>\n @if (element.type && !exportInProgress) {\n <small class=\"text-secondary\">\n {{ element.type?.title }}\n </small>\n }\n </div>\n </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\">\n {{ element?.type?.title }}\n </td>\n </ng-container>\n\n <!-- Categories Column -->\n <ng-container matColumnDef=\"categories\">\n <th mat-header-cell *matHeaderCellDef>Categories</th>\n <td mat-cell *matCellDef=\"let element\" style=\"max-width: 200px\">\n @if (element?.categories?.length > 0) {\n <div\n class=\"d-flex justify-content-start align-items-center gap-1 flex-wrap\">\n @for (category of element?.categories; track category) {\n <span class=\"badge bg-secondary\">\n {{ category?.title }}\n </span>\n }\n </div>\n }\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 <!-- Average Cost Column -->\n <ng-container matColumnDef=\"average_cost\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Average Cost</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.average_cost | currency }}</td>\n </ng-container>\n\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 <!-- Initial Quantity Column -->\n <ng-container matColumnDef=\"initial_quantity\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Initial Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">{{ element.initial_quantity }}</p>\n @if (element?.initial_quantity_date) {\n <small class=\"text-secondary\">\n on\n {{ $safeNavigationMigration(element?.initial_quantity_date) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- Stock Receipts Column -->\n <ng-container matColumnDef=\"stock_receipts\">\n <th mat-header-cell mat-sort-header=\"stock_receipts_sum_quantity\" *matHeaderCellDef>Stock Receipts</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">{{ element?.stock_receipts_sum_quantity }}</p>\n @if (element?.last_stock_receipt && !exportInProgress) {\n <small class=\"text-secondary\">\n Latest on\n {{ $safeNavigationMigration(element?.last_stock_receipt?.date) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- Stock Issues Column -->\n <ng-container matColumnDef=\"stock_issues\">\n <th mat-header-cell mat-sort-header=\"stock_issues_sum_quantity\" *matHeaderCellDef>Stock Issues</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">{{ element?.stock_issues_sum_quantity }}</p>\n @if (element?.last_stock_issue && !exportInProgress) {\n <small class=\"text-secondary\">\n Latest on\n {{ $safeNavigationMigration(element?.last_stock_issue?.date) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- On Hand Column -->\n <ng-container matColumnDef=\"on_hand\">\n <th mat-header-cell mat-sort-header='stock_on_hand' *matHeaderCellDef>On Hand</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.stock_on_hand }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"measure\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Measure</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.measure?.title }}\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 <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ $safeNavigationMigration(element?.created_at) | date }}</small>\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-techlify-icon name='view' [routerLink]=\"[element.id, 'view']\"\n routerLinkActive=\"route-link-active\"></app-techlify-icon>\n\n <app-product-form-button [product]=\"element\"></app-product-form-button>\n </div>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Select\">\n <th mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? toggleAllRows() : null\"\n [checked]=\"selection.hasValue() && isAllRowsSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllRowsSelected()\" [aria-label]=\"checkboxLabel()\">\n </mat-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null\"\n [checked]=\"selection.isSelected(row)\" [aria-label]=\"checkboxLabel(row)\">\n </mat-checkbox>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n @if (isWorking) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-card-content>\n </mat-card>\n @if (!selection.isEmpty()) {\n <mat-card class=\"batch-update-card\">\n <mat-card-content>\n <app-product-batch-update-form [selection]=\"selection\" (updated)=\"reload()\"></app-product-batch-update-form>\n </mat-card-content>\n </mat-card>\n }\n</div>",
1322
+ styles: [".batch-update-card{width:15%;min-width:300px}\n"],
1323
+ dependencies: [
1324
+ {
1325
+ kind: "directive",
1326
+ type: i6$1.InfiniteScrollDirective,
1327
+ selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]",
1328
+ inputs: [
1329
+ "infiniteScrollDistance",
1330
+ "infiniteScrollUpDistance",
1331
+ "infiniteScrollThrottle",
1332
+ "infiniteScrollDisabled",
1333
+ "infiniteScrollContainer",
1334
+ "scrollWindow",
1335
+ "immediateCheck",
1336
+ "horizontal",
1337
+ "alwaysCallback",
1338
+ "fromRoot"
1339
+ ],
1340
+ outputs: ["scrolled", "scrolledUp"]
1341
+ },
1342
+ {
1343
+ kind: "component",
1344
+ type: i7.MatCard,
1345
+ selector: "mat-card",
1346
+ inputs: ["appearance"],
1347
+ exportAs: ["matCard"]
1348
+ },
1349
+ {
1350
+ kind: "directive",
1351
+ type: i7.MatCardContent,
1352
+ selector: "mat-card-content"
1353
+ },
1354
+ {
1355
+ kind: "component",
1356
+ type: i8.MatCheckbox,
1357
+ selector: "mat-checkbox",
1358
+ inputs: [
1359
+ "aria-label",
1360
+ "aria-labelledby",
1361
+ "aria-describedby",
1362
+ "aria-expanded",
1363
+ "aria-controls",
1364
+ "aria-owns",
1365
+ "id",
1366
+ "required",
1367
+ "labelPosition",
1368
+ "name",
1369
+ "value",
1370
+ "disableRipple",
1371
+ "tabIndex",
1372
+ "color",
1373
+ "disabledInteractive",
1374
+ "checked",
1375
+ "disabled",
1376
+ "indeterminate"
1377
+ ],
1378
+ outputs: ["change", "indeterminateChange"],
1379
+ exportAs: ["matCheckbox"]
1380
+ },
1381
+ {
1382
+ kind: "component",
1383
+ type: i7$2.MatFormField,
1384
+ selector: "mat-form-field",
1385
+ inputs: [
1386
+ "hideRequiredMarker",
1387
+ "color",
1388
+ "floatLabel",
1389
+ "appearance",
1390
+ "subscriptSizing",
1391
+ "hintLabel"
1392
+ ],
1393
+ exportAs: ["matFormField"]
1394
+ },
1395
+ {
1396
+ kind: "directive",
1397
+ type: i7$2.MatLabel,
1398
+ selector: "mat-label"
1399
+ },
1400
+ {
1401
+ kind: "directive",
1402
+ type: i8$1.MatInput,
1403
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
1404
+ inputs: [
1405
+ "disabled",
1406
+ "id",
1407
+ "placeholder",
1408
+ "name",
1409
+ "required",
1410
+ "type",
1411
+ "errorStateMatcher",
1412
+ "aria-describedby",
1413
+ "value",
1414
+ "readonly",
1415
+ "disabledInteractive"
1416
+ ],
1417
+ exportAs: ["matInput"]
1418
+ },
1419
+ {
1420
+ kind: "component",
1421
+ type: i11.MatProgressBar,
1422
+ selector: "mat-progress-bar",
1423
+ inputs: [
1424
+ "color",
1425
+ "value",
1426
+ "bufferValue",
1427
+ "mode"
1428
+ ],
1429
+ outputs: ["animationEnd"],
1430
+ exportAs: ["matProgressBar"]
1431
+ },
1432
+ {
1433
+ kind: "directive",
1434
+ type: i13.MatSort,
1435
+ selector: "[matSort]",
1436
+ inputs: [
1437
+ "matSortActive",
1438
+ "matSortStart",
1439
+ "matSortDirection",
1440
+ "matSortDisableClear",
1441
+ "matSortDisabled"
1442
+ ],
1443
+ outputs: ["matSortChange"],
1444
+ exportAs: ["matSort"]
1445
+ },
1446
+ {
1447
+ kind: "component",
1448
+ type: i13.MatSortHeader,
1449
+ selector: "[mat-sort-header]",
1450
+ inputs: [
1451
+ "mat-sort-header",
1452
+ "arrowPosition",
1453
+ "start",
1454
+ "disabled",
1455
+ "sortActionDescription",
1456
+ "disableClear"
1457
+ ],
1458
+ exportAs: ["matSortHeader"]
1459
+ },
1460
+ {
1461
+ kind: "component",
1462
+ type: i14$1.MatTable,
1463
+ selector: "mat-table, table[mat-table]",
1464
+ exportAs: ["matTable"]
1465
+ },
1466
+ {
1467
+ kind: "directive",
1468
+ type: i14$1.MatHeaderCellDef,
1469
+ selector: "[matHeaderCellDef]"
1470
+ },
1471
+ {
1472
+ kind: "directive",
1473
+ type: i14$1.MatHeaderRowDef,
1474
+ selector: "[matHeaderRowDef]",
1475
+ inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"]
1476
+ },
1477
+ {
1478
+ kind: "directive",
1479
+ type: i14$1.MatColumnDef,
1480
+ selector: "[matColumnDef]",
1481
+ inputs: ["matColumnDef"]
1482
+ },
1483
+ {
1484
+ kind: "directive",
1485
+ type: i14$1.MatCellDef,
1486
+ selector: "[matCellDef]"
1487
+ },
1488
+ {
1489
+ kind: "directive",
1490
+ type: i14$1.MatRowDef,
1491
+ selector: "[matRowDef]",
1492
+ inputs: ["matRowDefColumns", "matRowDefWhen"]
1493
+ },
1494
+ {
1495
+ kind: "directive",
1496
+ type: i14$1.MatFooterCellDef,
1497
+ selector: "[matFooterCellDef]"
1498
+ },
1499
+ {
1500
+ kind: "directive",
1501
+ type: i14$1.MatHeaderCell,
1502
+ selector: "mat-header-cell, th[mat-header-cell]"
1503
+ },
1504
+ {
1505
+ kind: "directive",
1506
+ type: i14$1.MatCell,
1507
+ selector: "mat-cell, td[mat-cell]"
1508
+ },
1509
+ {
1510
+ kind: "directive",
1511
+ type: i14$1.MatFooterCell,
1512
+ selector: "mat-footer-cell, td[mat-footer-cell]"
1513
+ },
1514
+ {
1515
+ kind: "component",
1516
+ type: i14$1.MatHeaderRow,
1517
+ selector: "mat-header-row, tr[mat-header-row]",
1518
+ exportAs: ["matHeaderRow"]
1519
+ },
1520
+ {
1521
+ kind: "component",
1522
+ type: i14$1.MatRow,
1523
+ selector: "mat-row, tr[mat-row]",
1524
+ exportAs: ["matRow"]
1525
+ },
1526
+ {
1527
+ kind: "directive",
1528
+ type: i14.MatTooltip,
1529
+ selector: "[matTooltip]",
1530
+ inputs: [
1531
+ "matTooltipPosition",
1532
+ "matTooltipPositionAtOrigin",
1533
+ "matTooltipDisabled",
1534
+ "matTooltipShowDelay",
1535
+ "matTooltipHideDelay",
1536
+ "matTooltipTouchGestures",
1537
+ "matTooltip",
1538
+ "matTooltipClass"
1539
+ ],
1540
+ exportAs: ["matTooltip"]
1541
+ },
1542
+ {
1543
+ kind: "directive",
1544
+ type: i2.ɵNgNoValidate,
1545
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
1546
+ },
1547
+ {
1548
+ kind: "directive",
1549
+ type: i2.DefaultValueAccessor,
1550
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
1551
+ },
1552
+ {
1553
+ kind: "directive",
1554
+ type: i2.NgControlStatus,
1555
+ selector: "[formControlName],[ngModel],[formControl]"
1556
+ },
1557
+ {
1558
+ kind: "directive",
1559
+ type: i2.NgControlStatusGroup,
1560
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
1561
+ },
1562
+ {
1563
+ kind: "directive",
1564
+ type: i2.FormGroupDirective,
1565
+ selector: "[formGroup]",
1566
+ inputs: ["formGroup"],
1567
+ outputs: ["ngSubmit"],
1568
+ exportAs: ["ngForm"]
1569
+ },
1570
+ {
1571
+ kind: "directive",
1572
+ type: i2.FormControlName,
1573
+ selector: "[formControlName]",
1574
+ inputs: [
1575
+ "formControlName",
1576
+ "disabled",
1577
+ "ngModel"
1578
+ ],
1579
+ outputs: ["ngModelChange"]
1580
+ },
1581
+ {
1582
+ kind: "directive",
1583
+ type: i4$1.RouterLink,
1584
+ selector: "[routerLink]",
1585
+ inputs: [
1586
+ "target",
1587
+ "queryParams",
1588
+ "fragment",
1589
+ "queryParamsHandling",
1590
+ "state",
1591
+ "info",
1592
+ "relativeTo",
1593
+ "preserveFragment",
1594
+ "skipLocationChange",
1595
+ "replaceUrl",
1596
+ "browserUrl",
1597
+ "routerLink"
1598
+ ]
1599
+ },
1600
+ {
1601
+ kind: "directive",
1602
+ type: i4$1.RouterLinkActive,
1603
+ selector: "[routerLinkActive]",
1604
+ inputs: [
1605
+ "routerLinkActiveOptions",
1606
+ "ariaCurrentWhenActive",
1607
+ "routerLinkActive"
1608
+ ],
1609
+ outputs: ["isActiveChange"],
1610
+ exportAs: ["routerLinkActive"]
1611
+ },
1612
+ {
1613
+ kind: "component",
1614
+ type: i1.SearchableSelectorComponent,
1615
+ selector: "app-searchable-selector",
1616
+ inputs: [
1617
+ "valueField",
1618
+ "titleField",
1619
+ "subtitleField",
1620
+ "apiUrl",
1621
+ "multiple",
1622
+ "selectedValue",
1623
+ "enableSearch",
1624
+ "add",
1625
+ "addConfig",
1626
+ "edit",
1627
+ "editConfig",
1628
+ "sort",
1629
+ "sortBy",
1630
+ "searchField",
1631
+ "itemComponent",
1632
+ "items",
1633
+ "apiDataProperty",
1634
+ "cache",
1635
+ "perPage",
1636
+ "inDataSearch",
1637
+ "panelWidth",
1638
+ "focusSearchOnOpen",
1639
+ "isEmitInitialEvent",
1640
+ "required",
1641
+ "disabled",
1642
+ "value"
1643
+ ],
1644
+ outputs: [
1645
+ "selectedValueChange",
1646
+ "selectionChange",
1647
+ "itemsChange",
1648
+ "isItemsEmpty"
1649
+ ]
1650
+ },
1651
+ {
1652
+ kind: "component",
1653
+ type: i1.TechlifyIconComponent,
1654
+ selector: "app-techlify-icon",
1655
+ inputs: ["name", "size"]
1656
+ },
1657
+ {
1658
+ kind: "component",
1659
+ type: i1.ColumnSelectorComponent,
1660
+ selector: "app-column-selector",
1661
+ inputs: [
1662
+ "label",
1663
+ "mode",
1664
+ "columnConfigs",
1665
+ "selectedColumns",
1666
+ "isExportWorking"
1667
+ ],
1668
+ outputs: ["selectedColumnsChange", "displayedColumnsChange"]
1669
+ },
1670
+ {
1671
+ kind: "component",
1672
+ type: ExportToExcelButtonComponent,
1673
+ selector: "app-export-to-excel-button",
1674
+ inputs: ["tableId", "fileName"],
1675
+ outputs: ["onExportStart", "onExportEnd"]
1676
+ },
1677
+ {
1678
+ kind: "component",
1679
+ type: ProductFormButtonComponent,
1680
+ selector: "app-product-form-button",
1681
+ inputs: ["product"]
1682
+ },
1683
+ {
1684
+ kind: "component",
1685
+ type: ProductBatchUpdateFormComponent,
1686
+ selector: "app-product-batch-update-form",
1687
+ inputs: ["selection"],
1688
+ outputs: ["updated"]
1689
+ },
1690
+ {
1691
+ kind: "pipe",
1692
+ type: i19.CurrencyPipe,
1693
+ name: "currency"
1694
+ },
1695
+ {
1696
+ kind: "pipe",
1697
+ type: i19.DatePipe,
1698
+ name: "date"
1699
+ }
1700
+ ],
1701
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
1702
+ preserveWhitespaces: true
1703
+ });
1704
+ };
1705
+ ProductListComponent = __decorate([UntilDestroy()], ProductListComponent);
1706
+ i0.ɵɵngDeclareClassMetadata({
1707
+ minVersion: "12.0.0",
1708
+ version: "22.2.5",
1709
+ ngImport: i0,
1710
+ type: ProductListComponent,
1711
+ decorators: [{
1712
+ type: Component,
1713
+ args: [{
1714
+ selector: "app-product-list",
1715
+ changeDetection: ChangeDetectionStrategy.Eager,
1716
+ standalone: false,
1717
+ template: "<mat-card class=\"mb-3\">\n <mat-card-content>\n <form [formGroup]=\"filterForm\" class=\"d-flex justify-content-between align-items-center gap-2\">\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 <span matTooltip=\"Import\" routerLink=\"import\" class=\"cursor-pointer material-symbols-outlined\">\n file_upload\n </span>\n <app-export-to-excel-button tableId=\"productTable\" fileName=\"products\" (onExportStart)=\"handleExport(true)\"\n (onExportEnd)=\"handleExport(false)\">\n </app-export-to-excel-button>\n <app-column-selector mode=\"icon\" class=\"d-print-none\" [columnConfigs]=\"columnConfig\"\n [(selectedColumns)]=\"selectedColumns\"></app-column-selector>\n </div>\n\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <mat-form-field class='fl-md'>\n <mat-label>Search</mat-label>\n <input matInput placeholder=\"Search products\" formControlName=\"search\" />\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Category</mat-label>\n <app-searchable-selector apiUrl=\"api/product-categories\" formControlName=\"category_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Type</mat-label>\n <app-searchable-selector apiUrl=\"api/product-types\" formControlName=\"type_ids\" titleField=\"title\"\n [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n </div>\n </form>\n </mat-card-content>\n</mat-card>\n\n<div class=\"d-flex justify-content-start gap-3\">\n <mat-card [class.flex-fill]=\"!selection.isEmpty()\" [class.w-100]=\"selection.isEmpty()\">\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\" infiniteScroll [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" [fromRoot]=\"true\" matSort\n (matSortChange)=\"sortColumn($event)\" matSortDisableClear=\"true\" aria-describedby=\"Products List\"\n id=\"productTable\">\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\">\n <div class=\"d-flex flex-column gap-1\">\n <a class=\"text-decoration-none text-dark\" [routerLink]=\"[$safeNavigationMigration(element?.id), 'view']\">{{ element.name }}</a>\n @if (element.type && !exportInProgress) {\n <small class=\"text-secondary\">\n {{ element.type?.title }}\n </small>\n }\n </div>\n </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\">\n {{ element?.type?.title }}\n </td>\n </ng-container>\n\n <!-- Categories Column -->\n <ng-container matColumnDef=\"categories\">\n <th mat-header-cell *matHeaderCellDef>Categories</th>\n <td mat-cell *matCellDef=\"let element\" style=\"max-width: 200px\">\n @if (element?.categories?.length > 0) {\n <div\n class=\"d-flex justify-content-start align-items-center gap-1 flex-wrap\">\n @for (category of element?.categories; track category) {\n <span class=\"badge bg-secondary\">\n {{ category?.title }}\n </span>\n }\n </div>\n }\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 <!-- Average Cost Column -->\n <ng-container matColumnDef=\"average_cost\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Average Cost</th>\n <td mat-cell *matCellDef=\"let element\">{{ element.average_cost | currency }}</td>\n </ng-container>\n\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 <!-- Initial Quantity Column -->\n <ng-container matColumnDef=\"initial_quantity\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Initial Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">{{ element.initial_quantity }}</p>\n @if (element?.initial_quantity_date) {\n <small class=\"text-secondary\">\n on\n {{ $safeNavigationMigration(element?.initial_quantity_date) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- Stock Receipts Column -->\n <ng-container matColumnDef=\"stock_receipts\">\n <th mat-header-cell mat-sort-header=\"stock_receipts_sum_quantity\" *matHeaderCellDef>Stock Receipts</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">{{ element?.stock_receipts_sum_quantity }}</p>\n @if (element?.last_stock_receipt && !exportInProgress) {\n <small class=\"text-secondary\">\n Latest on\n {{ $safeNavigationMigration(element?.last_stock_receipt?.date) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- Stock Issues Column -->\n <ng-container matColumnDef=\"stock_issues\">\n <th mat-header-cell mat-sort-header=\"stock_issues_sum_quantity\" *matHeaderCellDef>Stock Issues</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">{{ element?.stock_issues_sum_quantity }}</p>\n @if (element?.last_stock_issue && !exportInProgress) {\n <small class=\"text-secondary\">\n Latest on\n {{ $safeNavigationMigration(element?.last_stock_issue?.date) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- On Hand Column -->\n <ng-container matColumnDef=\"on_hand\">\n <th mat-header-cell mat-sort-header='stock_on_hand' *matHeaderCellDef>On Hand</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.stock_on_hand }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"measure\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>Measure</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.measure?.title }}\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 <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-0\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ $safeNavigationMigration(element?.created_at) | date }}</small>\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-techlify-icon name='view' [routerLink]=\"[element.id, 'view']\"\n routerLinkActive=\"route-link-active\"></app-techlify-icon>\n\n <app-product-form-button [product]=\"element\"></app-product-form-button>\n </div>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Select\">\n <th mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? toggleAllRows() : null\"\n [checked]=\"selection.hasValue() && isAllRowsSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllRowsSelected()\" [aria-label]=\"checkboxLabel()\">\n </mat-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null\"\n [checked]=\"selection.isSelected(row)\" [aria-label]=\"checkboxLabel(row)\">\n </mat-checkbox>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n @if (isWorking) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-card-content>\n </mat-card>\n @if (!selection.isEmpty()) {\n <mat-card class=\"batch-update-card\">\n <mat-card-content>\n <app-product-batch-update-form [selection]=\"selection\" (updated)=\"reload()\"></app-product-batch-update-form>\n </mat-card-content>\n </mat-card>\n }\n</div>",
1718
+ styles: [".batch-update-card{width:15%;min-width:300px}\n"]
1719
+ }]
1720
+ }],
1721
+ ctorParameters: () => [
1722
+ { type: i2.FormBuilder },
1723
+ { type: i3.MatDialog },
1724
+ { type: i4$1.ActivatedRoute },
1725
+ { type: ProductService },
1726
+ { type: ProductFormService }
1727
+ ]
1728
+ });
1729
+ var ProductNavBarComponent = class ProductNavBarComponent {
1730
+ static ɵfac = i0.ɵɵngDeclareFactory({
1731
+ minVersion: "12.0.0",
1732
+ version: "22.2.5",
1733
+ ngImport: i0,
1734
+ type: ProductNavBarComponent,
1735
+ deps: [],
1736
+ target: i0.ɵɵFactoryTarget.Component
1737
+ });
1738
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1739
+ minVersion: "14.0.0",
1740
+ version: "22.2.5",
1741
+ type: ProductNavBarComponent,
1742
+ isStandalone: false,
1743
+ selector: "app-product-nav-bar",
1744
+ ngImport: i0,
1745
+ template: "<div>\n <router-outlet></router-outlet>\n</div>\n",
1746
+ dependencies: [{
1747
+ kind: "directive",
1748
+ type: i4$1.RouterOutlet,
1749
+ selector: "router-outlet",
1750
+ inputs: ["name", "routerOutletData"],
1751
+ outputs: [
1752
+ "activate",
1753
+ "deactivate",
1754
+ "attach",
1755
+ "detach"
1756
+ ],
1757
+ exportAs: ["outlet"]
1758
+ }],
1759
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
1760
+ preserveWhitespaces: true
1761
+ });
1762
+ };
1763
+ i0.ɵɵngDeclareClassMetadata({
1764
+ minVersion: "12.0.0",
1765
+ version: "22.2.5",
1766
+ ngImport: i0,
1767
+ type: ProductNavBarComponent,
1768
+ decorators: [{
1769
+ type: Component,
1770
+ args: [{
1771
+ selector: "app-product-nav-bar",
1772
+ changeDetection: ChangeDetectionStrategy.Eager,
1773
+ standalone: false,
1774
+ template: "<div>\n <router-outlet></router-outlet>\n</div>\n"
1775
+ }]
1776
+ }]
1777
+ });
1778
+ var StockTransferService = class StockTransferService extends TechlifyService {
1779
+ constructor(httpService) {
1780
+ super(httpService, "stock-transfers");
1781
+ }
1782
+ static ɵfac = i0.ɵɵngDeclareFactory({
1783
+ minVersion: "12.0.0",
1784
+ version: "22.2.5",
1785
+ ngImport: i0,
1786
+ type: StockTransferService,
1787
+ deps: [{ token: i1.HttpService }],
1788
+ target: i0.ɵɵFactoryTarget.Injectable
1789
+ });
1790
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1791
+ minVersion: "12.0.0",
1792
+ version: "22.2.5",
1793
+ ngImport: i0,
1794
+ type: StockTransferService,
1795
+ providedIn: "root"
1796
+ });
1797
+ };
1798
+ i0.ɵɵngDeclareClassMetadata({
1799
+ minVersion: "12.0.0",
1800
+ version: "22.2.5",
1801
+ ngImport: i0,
1802
+ type: StockTransferService,
1803
+ decorators: [{
1804
+ type: Injectable,
1805
+ args: [{ providedIn: "root" }]
1806
+ }],
1807
+ ctorParameters: () => [{ type: i1.HttpService }]
1808
+ });
1809
+ var StockTransferFormComponent = class StockTransferFormComponent extends TechlifyFormComponent {
1810
+ formValidatorService;
1811
+ formBuilder;
1812
+ service;
1813
+ data;
1814
+ productId;
1815
+ locationFrom;
1816
+ constructor(formValidatorService, formBuilder, service, dialogRef, data) {
1817
+ super(formValidatorService, service);
1818
+ this.formValidatorService = formValidatorService;
1819
+ this.formBuilder = formBuilder;
1820
+ this.service = service;
1821
+ this.data = data;
1822
+ this.dialogRef = dialogRef;
1823
+ this.errorMessages = {
1824
+ date: { required: "The date field is required." },
1825
+ product_id: { required: "The product field is required." },
1826
+ location_from_id: { required: "The location from field is required." },
1827
+ location_to_id: { required: "The location to field is required." },
1828
+ quantity: { required: "The quantity field is required." }
1829
+ };
1830
+ this.form = this.formBuilder.group({
1831
+ product_id: ["", Validators.required],
1832
+ date: [/* @__PURE__ */ new Date(), [Validators.required]],
1833
+ location_from_id: ["", Validators.required],
1834
+ location_to_id: ["", Validators.required],
1835
+ quantity: [1, Validators.required],
1836
+ particulars: [""]
1837
+ });
1838
+ }
1839
+ ngOnInit() {
1840
+ const productId = this.data?.product_id ?? this.productId;
1841
+ if (productId) this.form.get("product_id")?.setValue(productId);
1842
+ const locationFrom = this.data?.location_from ?? this.locationFrom;
1843
+ if (locationFrom) this.form.get("location_from_id")?.setValue(locationFrom.id);
1844
+ }
1845
+ getFormData() {
1846
+ const data = { ...this.form.value };
1847
+ if (data.date) data.date = moment$1(data.date).format("YYYY-MM-DD");
1848
+ return data;
1849
+ }
1850
+ static ɵfac = i0.ɵɵngDeclareFactory({
1851
+ minVersion: "12.0.0",
1852
+ version: "22.2.5",
1853
+ ngImport: i0,
1854
+ type: StockTransferFormComponent,
1855
+ deps: [
1856
+ { token: i1.FormValidatorService },
1857
+ { token: i2.FormBuilder },
1858
+ { token: StockTransferService },
1859
+ {
1860
+ token: i3.MatDialogRef,
1861
+ optional: true
1862
+ },
1863
+ {
1864
+ token: MAT_DIALOG_DATA,
1865
+ optional: true
1866
+ }
1867
+ ],
1868
+ target: i0.ɵɵFactoryTarget.Component
1869
+ });
1870
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1871
+ minVersion: "17.0.0",
1872
+ version: "22.2.5",
1873
+ type: StockTransferFormComponent,
1874
+ isStandalone: true,
1875
+ selector: "app-stock-transfer-form",
1876
+ inputs: {
1877
+ productId: "productId",
1878
+ locationFrom: "locationFrom"
1879
+ },
1880
+ usesInheritance: true,
1881
+ ngImport: i0,
1882
+ template: "<div class=\"p-2\">\n <h5 class=\"d-flex flex-row justify-content-center align-items-center\">\n Stock Transfer\n </h5>\n\n <mat-card-content>\n <form class=\"d-flex flex-column gap-3\" [formGroup]=\"form\" (ngSubmit)=\"submit(getFormData())\">\n\n <mat-form-field>\n <mat-label>Date</mat-label>\n <input formControlName=\"date\" matInput [matDatepicker]=\"picker\" placeholder=\"Date\" (focus)=\"picker.open()\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n @if (isFieldValid('date')) {\n <mat-error>{{ getErrorMessage('date') }}</mat-error>\n }\n </mat-form-field>\n\n @if (!(data?.product_id ?? productId)) {\n <mat-form-field>\n <mat-label>Product</mat-label>\n <app-searchable-selector formControlName=\"product_id\" titleField=\"name\"\n apiUrl=\"api/products\"></app-searchable-selector>\n @if (isFieldValid('product_id')) {\n <mat-error>{{ getErrorMessage('product_id') }}</mat-error>\n }\n </mat-form-field>\n }\n\n <mat-form-field>\n <mat-label>Location From</mat-label>\n <app-searchable-selector formControlName=\"location_from_id\" apiUrl=\"api/inventory-locations?status_ids=1\"\n [selectedValue]=\"data?.location_from ?? locationFrom\"></app-searchable-selector>\n <mat-hint>Where are we taking stock from?</mat-hint>\n @if (isFieldValid('location_from_id')) {\n <mat-error>{{ getErrorMessage('location_from_id') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Location To</mat-label>\n <app-searchable-selector formControlName=\"location_to_id\"\n apiUrl=\"api/inventory-locations?status_ids=1\"></app-searchable-selector>\n <mat-hint>Where are we taking stock to?</mat-hint>\n @if (isFieldValid('location_to_id')) {\n <mat-error>{{ getErrorMessage('location_to_id') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Quantity</mat-label>\n <input matInput placeholder=\"Quantity\" formControlName=\"quantity\" type=\"number\">\n @if (isFieldValid('quantity')) {\n <mat-error>{{ getErrorMessage('quantity') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Particulars</mat-label>\n <textarea matInput placeholder=\"Particulars\" formControlName=\"particulars\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" mat-flat-button [disabled]=\"isWorking\" (click)=\"dialogRef.close()\">Cancel</button>\n <button type=\"submit\" mat-raised-button color=\"primary\" [disabled]=\"isWorking\">Save</button>\n </div>\n </form>\n </mat-card-content>\n\n</div>",
1883
+ styles: [""],
1884
+ dependencies: [
1885
+ {
1886
+ kind: "ngmodule",
1887
+ type: ReactiveFormsModule
1888
+ },
1889
+ {
1890
+ kind: "directive",
1891
+ type: i2.ɵNgNoValidate,
1892
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
1893
+ },
1894
+ {
1895
+ kind: "directive",
1896
+ type: i2.DefaultValueAccessor,
1897
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
1898
+ },
1899
+ {
1900
+ kind: "directive",
1901
+ type: i2.NumberValueAccessor,
1902
+ selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
1903
+ },
1904
+ {
1905
+ kind: "directive",
1906
+ type: i2.NgControlStatus,
1907
+ selector: "[formControlName],[ngModel],[formControl]"
1908
+ },
1909
+ {
1910
+ kind: "directive",
1911
+ type: i2.NgControlStatusGroup,
1912
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
1913
+ },
1914
+ {
1915
+ kind: "directive",
1916
+ type: i2.FormGroupDirective,
1917
+ selector: "[formGroup]",
1918
+ inputs: ["formGroup"],
1919
+ outputs: ["ngSubmit"],
1920
+ exportAs: ["ngForm"]
1921
+ },
1922
+ {
1923
+ kind: "directive",
1924
+ type: i2.FormControlName,
1925
+ selector: "[formControlName]",
1926
+ inputs: [
1927
+ "formControlName",
1928
+ "disabled",
1929
+ "ngModel"
1930
+ ],
1931
+ outputs: ["ngModelChange"]
1932
+ },
1933
+ {
1934
+ kind: "component",
1935
+ type: MatFormField,
1936
+ selector: "mat-form-field",
1937
+ inputs: [
1938
+ "hideRequiredMarker",
1939
+ "color",
1940
+ "floatLabel",
1941
+ "appearance",
1942
+ "subscriptSizing",
1943
+ "hintLabel"
1944
+ ],
1945
+ exportAs: ["matFormField"]
1946
+ },
1947
+ {
1948
+ kind: "directive",
1949
+ type: MatLabel,
1950
+ selector: "mat-label"
1951
+ },
1952
+ {
1953
+ kind: "directive",
1954
+ type: MatInput,
1955
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
1956
+ inputs: [
1957
+ "disabled",
1958
+ "id",
1959
+ "placeholder",
1960
+ "name",
1961
+ "required",
1962
+ "type",
1963
+ "errorStateMatcher",
1964
+ "aria-describedby",
1965
+ "value",
1966
+ "readonly",
1967
+ "disabledInteractive"
1968
+ ],
1969
+ exportAs: ["matInput"]
1970
+ },
1971
+ {
1972
+ kind: "directive",
1973
+ type: MatDatepickerInput,
1974
+ selector: "input[matDatepicker]",
1975
+ inputs: [
1976
+ "matDatepicker",
1977
+ "min",
1978
+ "max",
1979
+ "matDatepickerFilter"
1980
+ ],
1981
+ exportAs: ["matDatepickerInput"]
1982
+ },
1983
+ {
1984
+ kind: "component",
1985
+ type: MatDatepickerToggle,
1986
+ selector: "mat-datepicker-toggle",
1987
+ inputs: [
1988
+ "for",
1989
+ "tabIndex",
1990
+ "aria-label",
1991
+ "disabled",
1992
+ "disableRipple"
1993
+ ],
1994
+ exportAs: ["matDatepickerToggle"]
1995
+ },
1996
+ {
1997
+ kind: "component",
1998
+ type: MatDatepicker,
1999
+ selector: "mat-datepicker",
2000
+ exportAs: ["matDatepicker"]
2001
+ },
2002
+ {
2003
+ kind: "directive",
2004
+ type: MatSuffix,
2005
+ selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
2006
+ inputs: ["matTextSuffix"]
2007
+ },
2008
+ {
2009
+ kind: "ngmodule",
2010
+ type: SearchableSelectorModule
2011
+ },
2012
+ {
2013
+ kind: "component",
2014
+ type: i1.SearchableSelectorComponent,
2015
+ selector: "app-searchable-selector",
2016
+ inputs: [
2017
+ "valueField",
2018
+ "titleField",
2019
+ "subtitleField",
2020
+ "apiUrl",
2021
+ "multiple",
2022
+ "selectedValue",
2023
+ "enableSearch",
2024
+ "add",
2025
+ "addConfig",
2026
+ "edit",
2027
+ "editConfig",
2028
+ "sort",
2029
+ "sortBy",
2030
+ "searchField",
2031
+ "itemComponent",
2032
+ "items",
2033
+ "apiDataProperty",
2034
+ "cache",
2035
+ "perPage",
2036
+ "inDataSearch",
2037
+ "panelWidth",
2038
+ "focusSearchOnOpen",
2039
+ "isEmitInitialEvent",
2040
+ "required",
2041
+ "disabled",
2042
+ "value"
2043
+ ],
2044
+ outputs: [
2045
+ "selectedValueChange",
2046
+ "selectionChange",
2047
+ "itemsChange",
2048
+ "isItemsEmpty"
2049
+ ]
2050
+ },
2051
+ {
2052
+ kind: "directive",
2053
+ type: MatError,
2054
+ selector: "mat-error, [matError]",
2055
+ inputs: ["id"]
2056
+ },
2057
+ {
2058
+ kind: "directive",
2059
+ type: MatHint,
2060
+ selector: "mat-hint",
2061
+ inputs: ["align", "id"]
2062
+ },
2063
+ {
2064
+ kind: "component",
2065
+ type: MatButton,
2066
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
2067
+ inputs: ["matButton"],
2068
+ exportAs: ["matButton", "matAnchor"]
2069
+ },
2070
+ {
2071
+ kind: "directive",
2072
+ type: MatCardContent,
2073
+ selector: "mat-card-content"
2074
+ }
2075
+ ],
2076
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
2077
+ preserveWhitespaces: true
2078
+ });
2079
+ };
2080
+ i0.ɵɵngDeclareClassMetadata({
2081
+ minVersion: "12.0.0",
2082
+ version: "22.2.5",
2083
+ ngImport: i0,
2084
+ type: StockTransferFormComponent,
2085
+ decorators: [{
2086
+ type: Component,
2087
+ args: [{
2088
+ selector: "app-stock-transfer-form",
2089
+ imports: [
2090
+ ReactiveFormsModule,
2091
+ MatFormField,
2092
+ MatLabel,
2093
+ MatInput,
2094
+ MatDatepickerInput,
2095
+ MatDatepickerToggle,
2096
+ MatDatepicker,
2097
+ MatSuffix,
2098
+ SearchableSelectorModule,
2099
+ MatError,
2100
+ MatHint,
2101
+ MatButton,
2102
+ MatCardTitle,
2103
+ MatCardContent
2104
+ ],
2105
+ changeDetection: ChangeDetectionStrategy.Eager,
2106
+ template: "<div class=\"p-2\">\n <h5 class=\"d-flex flex-row justify-content-center align-items-center\">\n Stock Transfer\n </h5>\n\n <mat-card-content>\n <form class=\"d-flex flex-column gap-3\" [formGroup]=\"form\" (ngSubmit)=\"submit(getFormData())\">\n\n <mat-form-field>\n <mat-label>Date</mat-label>\n <input formControlName=\"date\" matInput [matDatepicker]=\"picker\" placeholder=\"Date\" (focus)=\"picker.open()\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n @if (isFieldValid('date')) {\n <mat-error>{{ getErrorMessage('date') }}</mat-error>\n }\n </mat-form-field>\n\n @if (!(data?.product_id ?? productId)) {\n <mat-form-field>\n <mat-label>Product</mat-label>\n <app-searchable-selector formControlName=\"product_id\" titleField=\"name\"\n apiUrl=\"api/products\"></app-searchable-selector>\n @if (isFieldValid('product_id')) {\n <mat-error>{{ getErrorMessage('product_id') }}</mat-error>\n }\n </mat-form-field>\n }\n\n <mat-form-field>\n <mat-label>Location From</mat-label>\n <app-searchable-selector formControlName=\"location_from_id\" apiUrl=\"api/inventory-locations?status_ids=1\"\n [selectedValue]=\"data?.location_from ?? locationFrom\"></app-searchable-selector>\n <mat-hint>Where are we taking stock from?</mat-hint>\n @if (isFieldValid('location_from_id')) {\n <mat-error>{{ getErrorMessage('location_from_id') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Location To</mat-label>\n <app-searchable-selector formControlName=\"location_to_id\"\n apiUrl=\"api/inventory-locations?status_ids=1\"></app-searchable-selector>\n <mat-hint>Where are we taking stock to?</mat-hint>\n @if (isFieldValid('location_to_id')) {\n <mat-error>{{ getErrorMessage('location_to_id') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Quantity</mat-label>\n <input matInput placeholder=\"Quantity\" formControlName=\"quantity\" type=\"number\">\n @if (isFieldValid('quantity')) {\n <mat-error>{{ getErrorMessage('quantity') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Particulars</mat-label>\n <textarea matInput placeholder=\"Particulars\" formControlName=\"particulars\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" mat-flat-button [disabled]=\"isWorking\" (click)=\"dialogRef.close()\">Cancel</button>\n <button type=\"submit\" mat-raised-button color=\"primary\" [disabled]=\"isWorking\">Save</button>\n </div>\n </form>\n </mat-card-content>\n\n</div>"
2107
+ }]
2108
+ }],
2109
+ ctorParameters: () => [
2110
+ { type: i1.FormValidatorService },
2111
+ { type: i2.FormBuilder },
2112
+ { type: StockTransferService },
2113
+ {
2114
+ type: i3.MatDialogRef,
2115
+ decorators: [{ type: Optional }]
2116
+ },
2117
+ {
2118
+ type: void 0,
2119
+ decorators: [{
2120
+ type: Inject,
2121
+ args: [MAT_DIALOG_DATA]
2122
+ }, { type: Optional }]
2123
+ }
2124
+ ],
2125
+ propDecorators: {
2126
+ productId: [{ type: Input }],
2127
+ locationFrom: [{ type: Input }]
2128
+ }
2129
+ });
2130
+ var ProductStatisticsService = class ProductStatisticsService extends TechlifyService {
2131
+ http;
2132
+ constructor(http) {
2133
+ super(http, "product-statistics");
2134
+ this.http = http;
2135
+ }
2136
+ stockByLocation(params) {
2137
+ return this.http.get("api/product-statistics/stock-by-location", { params });
2138
+ }
2139
+ static ɵfac = i0.ɵɵngDeclareFactory({
2140
+ minVersion: "12.0.0",
2141
+ version: "22.2.5",
2142
+ ngImport: i0,
2143
+ type: ProductStatisticsService,
2144
+ deps: [{ token: i1.HttpService }],
2145
+ target: i0.ɵɵFactoryTarget.Injectable
2146
+ });
2147
+ static ɵprov = i0.ɵɵngDeclareInjectable({
2148
+ minVersion: "12.0.0",
2149
+ version: "22.2.5",
2150
+ ngImport: i0,
2151
+ type: ProductStatisticsService,
2152
+ providedIn: "root"
2153
+ });
2154
+ };
2155
+ i0.ɵɵngDeclareClassMetadata({
2156
+ minVersion: "12.0.0",
2157
+ version: "22.2.5",
2158
+ ngImport: i0,
2159
+ type: ProductStatisticsService,
2160
+ decorators: [{
2161
+ type: Injectable,
2162
+ args: [{ providedIn: "root" }]
2163
+ }],
2164
+ ctorParameters: () => [{ type: i1.HttpService }]
2165
+ });
2166
+ var ProductLocationListComponent = class ProductLocationListComponent extends TechlifyListComponent {
2167
+ statisticsService;
2168
+ errorHandler;
2169
+ product;
2170
+ updated = new EventEmitter();
2171
+ stockTransferForm = signal(StockTransferFormComponent, ...ngDevMode ? [{ debugName: "stockTransferForm" }] : /* istanbul ignore next */ []);
2172
+ constructor(statisticsService, errorHandler) {
2173
+ super();
2174
+ this.statisticsService = statisticsService;
2175
+ this.errorHandler = errorHandler;
2176
+ }
2177
+ displayedColumns = [
2178
+ "#",
2179
+ "Location",
2180
+ "Stock",
2181
+ "Actions"
2182
+ ];
2183
+ ngOnInit() {
2184
+ this.loadData();
2185
+ }
2186
+ loadData() {
2187
+ this.statisticsService.stockByLocation({ product_id: this.product.id }).subscribe({
2188
+ next: (response) => {
2189
+ this.models = response?.data;
2190
+ this.lastPage = response?.last_page;
2191
+ },
2192
+ error: (error) => {
2193
+ this.errorHandler.handleError(error);
2194
+ }
2195
+ });
2196
+ }
2197
+ static ɵfac = i0.ɵɵngDeclareFactory({
2198
+ minVersion: "12.0.0",
2199
+ version: "22.2.5",
2200
+ ngImport: i0,
2201
+ type: ProductLocationListComponent,
2202
+ deps: [{ token: ProductStatisticsService }, { token: i1.ErrorHandlerService }],
2203
+ target: i0.ɵɵFactoryTarget.Component
2204
+ });
2205
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2206
+ minVersion: "17.0.0",
2207
+ version: "22.2.5",
2208
+ type: ProductLocationListComponent,
2209
+ isStandalone: true,
2210
+ selector: "app-product-location-list",
2211
+ inputs: { product: "product" },
2212
+ outputs: { updated: "updated" },
2213
+ usesInheritance: true,
2214
+ ngImport: i0,
2215
+ template: "<mat-card>\n <mat-card-content class=\"pb-3 d-flex justify-content-between align-items-center gap-3\">\n <div class=\"d-flex justify-content-start gap-2\">\n <span class=\"material-symbols-outlined\"> location_on </span>\n <strong class=\"mb-0 text-dark\">Product Locations</strong>\n </div>\n\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\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=\"Location\">\n <th mat-header-cell *matHeaderCellDef> Location </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Stock\">\n <th mat-header-cell *matHeaderCellDef> Stock </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 @if (element?.id) {\n <app-techlify-form-button\n [component]=\"stockTransferForm()\"\n [data]=\"{\n product_id: $safeNavigationMigration(product?.id),\n location_from: element\n }\"\n [width]=\"'500px'\"\n (saved)=\"reload(); updated.emit($event)\"></app-techlify-form-button>\n }\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\n </mat-card-content>\n</mat-card>",
2216
+ styles: [""],
2217
+ dependencies: [
2218
+ {
2219
+ kind: "ngmodule",
2220
+ type: MaterialModule$1
2221
+ },
2222
+ {
2223
+ kind: "component",
2224
+ type: i7.MatCard,
2225
+ selector: "mat-card",
2226
+ inputs: ["appearance"],
2227
+ exportAs: ["matCard"]
2228
+ },
2229
+ {
2230
+ kind: "directive",
2231
+ type: i7.MatCardContent,
2232
+ selector: "mat-card-content"
2233
+ },
2234
+ {
2235
+ kind: "component",
2236
+ type: i4.MatDivider,
2237
+ selector: "mat-divider",
2238
+ inputs: ["vertical", "inset"]
2239
+ },
2240
+ {
2241
+ kind: "component",
2242
+ type: i14$1.MatTable,
2243
+ selector: "mat-table, table[mat-table]",
2244
+ exportAs: ["matTable"]
2245
+ },
2246
+ {
2247
+ kind: "directive",
2248
+ type: i14$1.MatHeaderCellDef,
2249
+ selector: "[matHeaderCellDef]"
2250
+ },
2251
+ {
2252
+ kind: "directive",
2253
+ type: i14$1.MatHeaderRowDef,
2254
+ selector: "[matHeaderRowDef]",
2255
+ inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"]
2256
+ },
2257
+ {
2258
+ kind: "directive",
2259
+ type: i14$1.MatColumnDef,
2260
+ selector: "[matColumnDef]",
2261
+ inputs: ["matColumnDef"]
2262
+ },
2263
+ {
2264
+ kind: "directive",
2265
+ type: i14$1.MatCellDef,
2266
+ selector: "[matCellDef]"
2267
+ },
2268
+ {
2269
+ kind: "directive",
2270
+ type: i14$1.MatRowDef,
2271
+ selector: "[matRowDef]",
2272
+ inputs: ["matRowDefColumns", "matRowDefWhen"]
2273
+ },
2274
+ {
2275
+ kind: "directive",
2276
+ type: i14$1.MatHeaderCell,
2277
+ selector: "mat-header-cell, th[mat-header-cell]"
2278
+ },
2279
+ {
2280
+ kind: "directive",
2281
+ type: i14$1.MatCell,
2282
+ selector: "mat-cell, td[mat-cell]"
2283
+ },
2284
+ {
2285
+ kind: "component",
2286
+ type: i14$1.MatHeaderRow,
2287
+ selector: "mat-header-row, tr[mat-header-row]",
2288
+ exportAs: ["matHeaderRow"]
2289
+ },
2290
+ {
2291
+ kind: "component",
2292
+ type: i14$1.MatRow,
2293
+ selector: "mat-row, tr[mat-row]",
2294
+ exportAs: ["matRow"]
2295
+ },
2296
+ {
2297
+ kind: "component",
2298
+ type: TechlifyFormButtonComponent,
2299
+ selector: "app-techlify-form-button",
2300
+ inputs: [
2301
+ "component",
2302
+ "model",
2303
+ "data",
2304
+ "width",
2305
+ "tooltip",
2306
+ "multiAddComponent",
2307
+ "multiAddData",
2308
+ "multiAddWidth",
2309
+ "multiAddTooltip"
2310
+ ],
2311
+ outputs: ["saved"]
2312
+ }
2313
+ ],
2314
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
2315
+ preserveWhitespaces: true
2316
+ });
2317
+ };
2318
+ i0.ɵɵngDeclareClassMetadata({
2319
+ minVersion: "12.0.0",
2320
+ version: "22.2.5",
2321
+ ngImport: i0,
2322
+ type: ProductLocationListComponent,
2323
+ decorators: [{
2324
+ type: Component,
2325
+ args: [{
2326
+ selector: "app-product-location-list",
2327
+ changeDetection: ChangeDetectionStrategy.Eager,
2328
+ imports: [
2329
+ MaterialModule$1,
2330
+ StockTransferFormComponent,
2331
+ TechlifyFormButtonComponent
2332
+ ],
2333
+ template: "<mat-card>\n <mat-card-content class=\"pb-3 d-flex justify-content-between align-items-center gap-3\">\n <div class=\"d-flex justify-content-start gap-2\">\n <span class=\"material-symbols-outlined\"> location_on </span>\n <strong class=\"mb-0 text-dark\">Product Locations</strong>\n </div>\n\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\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=\"Location\">\n <th mat-header-cell *matHeaderCellDef> Location </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"Stock\">\n <th mat-header-cell *matHeaderCellDef> Stock </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 @if (element?.id) {\n <app-techlify-form-button\n [component]=\"stockTransferForm()\"\n [data]=\"{\n product_id: $safeNavigationMigration(product?.id),\n location_from: element\n }\"\n [width]=\"'500px'\"\n (saved)=\"reload(); updated.emit($event)\"></app-techlify-form-button>\n }\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\n </mat-card-content>\n</mat-card>"
2334
+ }]
2335
+ }],
2336
+ ctorParameters: () => [{ type: ProductStatisticsService }, { type: i1.ErrorHandlerService }],
2337
+ propDecorators: {
2338
+ product: [{ type: Input }],
2339
+ updated: [{ type: Output }]
2340
+ }
2341
+ });
2342
+ var StockTransferListComponent = class StockTransferListComponent extends TechlifyListComponent {
2343
+ service;
2344
+ fb;
2345
+ errorHandler;
2346
+ activatedRoute;
2347
+ productId;
2348
+ changed = output();
2349
+ stockTransferForm = signal(StockTransferFormComponent, ...ngDevMode ? [{ debugName: "stockTransferForm" }] : /* istanbul ignore next */ []);
2350
+ displayedColumns = [
2351
+ "#",
2352
+ "product",
2353
+ "date",
2354
+ "quantity",
2355
+ "location_from",
2356
+ "location_to",
2357
+ "status",
2358
+ "creator"
2359
+ ];
2360
+ constructor(service, fb, errorHandler, activatedRoute) {
2361
+ super();
2362
+ this.service = service;
2363
+ this.fb = fb;
2364
+ this.errorHandler = errorHandler;
2365
+ this.activatedRoute = activatedRoute;
2366
+ this.filterForm = this.fb.group({
2367
+ product_id: [""],
2368
+ search: [""],
2369
+ status_ids: [""],
2370
+ sort_by: ["date|desc"]
2371
+ });
2372
+ }
2373
+ ngOnInit() {
2374
+ if (this.productId) {
2375
+ this.displayedColumns = this.displayedColumns.filter((c) => c !== "product");
2376
+ this.filterForm.patchValue({ product_id: this.productId });
2377
+ this.loadData();
2378
+ } else {
2379
+ this.updateFormWithQueryParams();
2380
+ this.subscribeToFormChanges();
2381
+ this.subscribeToRouteChanges();
2382
+ }
2383
+ }
2384
+ loadData() {
2385
+ this.isWorking = true;
2386
+ let filters = this.filterForm.value;
2387
+ filters.page = this.page;
2388
+ filters.per_page = this.productId ? 9999 : this.perPage;
2389
+ this.service.index(filters).subscribe({
2390
+ next: (response) => {
2391
+ this.models = this.models.concat(response?.data);
2392
+ this.lastPage = response?.last_page;
2393
+ this.isWorking = false;
2394
+ },
2395
+ error: (error) => {
2396
+ this.errorHandler.handleError(error);
2397
+ this.isWorking = false;
2398
+ }
2399
+ });
2400
+ }
2401
+ updateFormWithQueryParams() {
2402
+ this.requestHelperService.updateFormWithQueryParams(this.filterForm, { status_ids: { multiple: true } });
2403
+ }
2404
+ subscribeToFormChanges() {
2405
+ this.filterForm.valueChanges.pipe(debounceTime(800)).subscribe({ next: () => {
2406
+ this.requestHelperService.updateQueryParams(this.requestHelperService.convertToFormData(this.filterForm.value));
2407
+ } });
2408
+ }
2409
+ subscribeToRouteChanges() {
2410
+ this.activatedRoute.queryParams.pipe(debounceTime(500), distinctUntilChanged()).subscribe(() => {
2411
+ this.reload();
2412
+ });
2413
+ }
2414
+ transferSaved() {
2415
+ this.reload();
2416
+ this.changed.emit();
2417
+ }
2418
+ onSortChange(sort) {
2419
+ let { active, direction } = sort;
2420
+ if (!active) active = "date";
2421
+ if (!direction) {
2422
+ direction = "desc";
2423
+ active = "date";
2424
+ }
2425
+ this.filterForm.get("sort_by").setValue(active + "|" + direction);
2426
+ }
2427
+ static ɵfac = i0.ɵɵngDeclareFactory({
2428
+ minVersion: "12.0.0",
2429
+ version: "22.2.5",
2430
+ ngImport: i0,
2431
+ type: StockTransferListComponent,
2432
+ deps: [
2433
+ { token: StockTransferService },
2434
+ { token: i2.FormBuilder },
2435
+ { token: i1.ErrorHandlerService },
2436
+ { token: i4$1.ActivatedRoute }
2437
+ ],
2438
+ target: i0.ɵɵFactoryTarget.Component
2439
+ });
2440
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2441
+ minVersion: "17.0.0",
2442
+ version: "22.2.5",
2443
+ type: StockTransferListComponent,
2444
+ isStandalone: true,
2445
+ selector: "app-stock-transfer-list",
2446
+ inputs: { productId: "productId" },
2447
+ outputs: { changed: "changed" },
2448
+ usesInheritance: true,
2449
+ ngImport: i0,
2450
+ template: "@if (!productId) {\n<mat-card class=\"mb-2\">\n <mat-card-content class=\"mb-0 d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> ungroup </span>\n\n <div class=\"d-flex flex-row gap-2 align-items-center\">\n <h3 class=\"mb-0\">Stock Transfers</h3>\n <app-techlify-form-button [component]=\"stockTransferForm()\" [data]=\"{ product_id: productId }\" [width]=\"'500px'\" (saved)=\"transferSaved()\"></app-techlify-form-button>\n </div>\n </div>\n <form [formGroup]=\"filterForm\" class=\"d-flex justify-content-end align-items-center gap-2\">\n <mat-form-field>\n <mat-label>Search</mat-label>\n <input type=\"text\" placeholder=\"Search Stock Transfers\" matInput formControlName=\"search\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Status</mat-label>\n <app-searchable-selector apiUrl=\"api/stock-transfer-statuses\" formControlName=\"status_ids\"\n [enableSearch]=\"false\" [multiple]=\"true\"></app-searchable-selector>\n </mat-form-field>\n </form>\n </mat-card-content>\n</mat-card>\n}\n\n<mat-card>\n @if (productId) {\n <mat-card-content class=\"mb-0 d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> ungroup </span>\n\n <div class=\"d-flex flex-row gap-2 align-items-center\">\n <h3 class=\"mb-0\">Stock Transfers</h3>\n <app-techlify-form-button [component]=\"stockTransferForm()\" [data]=\"{ product_id: productId }\" [width]=\"'500px'\" (saved)=\"transferSaved()\"></app-techlify-form-button>\n </div>\n </div>\n </mat-card-content>\n }\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Stock Transfers\" infiniteScroll\n [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"onSortChange($event)\">\n\n <ng-container matColumnDef=\"#\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"date\">Date</th>\n <td mat-cell *matCellDef=\"let element\">\n <div class=\"d-flex flex-column\">\n <span>{{ $safeNavigationMigration(element?.date) | date }}</span>\n <span>{{ element?.particulars }}</span>\n </div>\n </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 [routerLink]=\"['/inventory/products', $safeNavigationMigration(element?.product?.id), 'view']\"\n class=\"text-decoration-none text-dark\">\n {{ element?.product?.name }}\n </a>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"quantity\">Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.quantity }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"location_from\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"location_from_id\">From</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.location_from?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"location_to\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"location_to_id\">To</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.location_to?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"status\">Status</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.status?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ $safeNavigationMigration(element?.created_at) | date }}</small>\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\n @if (isWorking) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-card-content>\n</mat-card>\n",
2451
+ styles: [""],
2452
+ dependencies: [
2453
+ {
2454
+ kind: "ngmodule",
2455
+ type: CommonModule
2456
+ },
2457
+ {
2458
+ kind: "ngmodule",
2459
+ type: MaterialModule$1
2460
+ },
2461
+ {
2462
+ kind: "component",
2463
+ type: i7.MatCard,
2464
+ selector: "mat-card",
2465
+ inputs: ["appearance"],
2466
+ exportAs: ["matCard"]
2467
+ },
2468
+ {
2469
+ kind: "directive",
2470
+ type: i7.MatCardContent,
2471
+ selector: "mat-card-content"
2472
+ },
2473
+ {
2474
+ kind: "component",
2475
+ type: i7$2.MatFormField,
2476
+ selector: "mat-form-field",
2477
+ inputs: [
2478
+ "hideRequiredMarker",
2479
+ "color",
2480
+ "floatLabel",
2481
+ "appearance",
2482
+ "subscriptSizing",
2483
+ "hintLabel"
2484
+ ],
2485
+ exportAs: ["matFormField"]
2486
+ },
2487
+ {
2488
+ kind: "directive",
2489
+ type: i7$2.MatLabel,
2490
+ selector: "mat-label"
2491
+ },
2492
+ {
2493
+ kind: "directive",
2494
+ type: i8$1.MatInput,
2495
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
2496
+ inputs: [
2497
+ "disabled",
2498
+ "id",
2499
+ "placeholder",
2500
+ "name",
2501
+ "required",
2502
+ "type",
2503
+ "errorStateMatcher",
2504
+ "aria-describedby",
2505
+ "value",
2506
+ "readonly",
2507
+ "disabledInteractive"
2508
+ ],
2509
+ exportAs: ["matInput"]
2510
+ },
2511
+ {
2512
+ kind: "component",
2513
+ type: i11.MatProgressBar,
2514
+ selector: "mat-progress-bar",
2515
+ inputs: [
2516
+ "color",
2517
+ "value",
2518
+ "bufferValue",
2519
+ "mode"
2520
+ ],
2521
+ outputs: ["animationEnd"],
2522
+ exportAs: ["matProgressBar"]
2523
+ },
2524
+ {
2525
+ kind: "directive",
2526
+ type: i13.MatSort,
2527
+ selector: "[matSort]",
2528
+ inputs: [
2529
+ "matSortActive",
2530
+ "matSortStart",
2531
+ "matSortDirection",
2532
+ "matSortDisableClear",
2533
+ "matSortDisabled"
2534
+ ],
2535
+ outputs: ["matSortChange"],
2536
+ exportAs: ["matSort"]
2537
+ },
2538
+ {
2539
+ kind: "component",
2540
+ type: i13.MatSortHeader,
2541
+ selector: "[mat-sort-header]",
2542
+ inputs: [
2543
+ "mat-sort-header",
2544
+ "arrowPosition",
2545
+ "start",
2546
+ "disabled",
2547
+ "sortActionDescription",
2548
+ "disableClear"
2549
+ ],
2550
+ exportAs: ["matSortHeader"]
2551
+ },
2552
+ {
2553
+ kind: "component",
2554
+ type: i14$1.MatTable,
2555
+ selector: "mat-table, table[mat-table]",
2556
+ exportAs: ["matTable"]
2557
+ },
2558
+ {
2559
+ kind: "directive",
2560
+ type: i14$1.MatHeaderCellDef,
2561
+ selector: "[matHeaderCellDef]"
2562
+ },
2563
+ {
2564
+ kind: "directive",
2565
+ type: i14$1.MatHeaderRowDef,
2566
+ selector: "[matHeaderRowDef]",
2567
+ inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"]
2568
+ },
2569
+ {
2570
+ kind: "directive",
2571
+ type: i14$1.MatColumnDef,
2572
+ selector: "[matColumnDef]",
2573
+ inputs: ["matColumnDef"]
2574
+ },
2575
+ {
2576
+ kind: "directive",
2577
+ type: i14$1.MatCellDef,
2578
+ selector: "[matCellDef]"
2579
+ },
2580
+ {
2581
+ kind: "directive",
2582
+ type: i14$1.MatRowDef,
2583
+ selector: "[matRowDef]",
2584
+ inputs: ["matRowDefColumns", "matRowDefWhen"]
2585
+ },
2586
+ {
2587
+ kind: "directive",
2588
+ type: i14$1.MatHeaderCell,
2589
+ selector: "mat-header-cell, th[mat-header-cell]"
2590
+ },
2591
+ {
2592
+ kind: "directive",
2593
+ type: i14$1.MatCell,
2594
+ selector: "mat-cell, td[mat-cell]"
2595
+ },
2596
+ {
2597
+ kind: "component",
2598
+ type: i14$1.MatHeaderRow,
2599
+ selector: "mat-header-row, tr[mat-header-row]",
2600
+ exportAs: ["matHeaderRow"]
2601
+ },
2602
+ {
2603
+ kind: "component",
2604
+ type: i14$1.MatRow,
2605
+ selector: "mat-row, tr[mat-row]",
2606
+ exportAs: ["matRow"]
2607
+ },
2608
+ {
2609
+ kind: "directive",
2610
+ type: InfiniteScrollDirective,
2611
+ selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]",
2612
+ inputs: [
2613
+ "infiniteScrollDistance",
2614
+ "infiniteScrollUpDistance",
2615
+ "infiniteScrollThrottle",
2616
+ "infiniteScrollDisabled",
2617
+ "infiniteScrollContainer",
2618
+ "scrollWindow",
2619
+ "immediateCheck",
2620
+ "horizontal",
2621
+ "alwaysCallback",
2622
+ "fromRoot"
2623
+ ],
2624
+ outputs: ["scrolled", "scrolledUp"]
2625
+ },
2626
+ {
2627
+ kind: "component",
2628
+ type: TechlifyFormButtonComponent,
2629
+ selector: "app-techlify-form-button",
2630
+ inputs: [
2631
+ "component",
2632
+ "model",
2633
+ "data",
2634
+ "width",
2635
+ "tooltip",
2636
+ "multiAddComponent",
2637
+ "multiAddData",
2638
+ "multiAddWidth",
2639
+ "multiAddTooltip"
2640
+ ],
2641
+ outputs: ["saved"]
2642
+ },
2643
+ {
2644
+ kind: "ngmodule",
2645
+ type: ReactiveFormsModule
2646
+ },
2647
+ {
2648
+ kind: "directive",
2649
+ type: i2.ɵNgNoValidate,
2650
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
2651
+ },
2652
+ {
2653
+ kind: "directive",
2654
+ type: i2.DefaultValueAccessor,
2655
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
2656
+ },
2657
+ {
2658
+ kind: "directive",
2659
+ type: i2.NgControlStatus,
2660
+ selector: "[formControlName],[ngModel],[formControl]"
2661
+ },
2662
+ {
2663
+ kind: "directive",
2664
+ type: i2.NgControlStatusGroup,
2665
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
2666
+ },
2667
+ {
2668
+ kind: "directive",
2669
+ type: i2.FormGroupDirective,
2670
+ selector: "[formGroup]",
2671
+ inputs: ["formGroup"],
2672
+ outputs: ["ngSubmit"],
2673
+ exportAs: ["ngForm"]
2674
+ },
2675
+ {
2676
+ kind: "directive",
2677
+ type: i2.FormControlName,
2678
+ selector: "[formControlName]",
2679
+ inputs: [
2680
+ "formControlName",
2681
+ "disabled",
2682
+ "ngModel"
2683
+ ],
2684
+ outputs: ["ngModelChange"]
2685
+ },
2686
+ {
2687
+ kind: "directive",
2688
+ type: RouterLink,
2689
+ selector: "[routerLink]",
2690
+ inputs: [
2691
+ "target",
2692
+ "queryParams",
2693
+ "fragment",
2694
+ "queryParamsHandling",
2695
+ "state",
2696
+ "info",
2697
+ "relativeTo",
2698
+ "preserveFragment",
2699
+ "skipLocationChange",
2700
+ "replaceUrl",
2701
+ "browserUrl",
2702
+ "routerLink"
2703
+ ]
2704
+ },
2705
+ {
2706
+ kind: "ngmodule",
2707
+ type: SearchableSelectorModule
2708
+ },
2709
+ {
2710
+ kind: "component",
2711
+ type: i1.SearchableSelectorComponent,
2712
+ selector: "app-searchable-selector",
2713
+ inputs: [
2714
+ "valueField",
2715
+ "titleField",
2716
+ "subtitleField",
2717
+ "apiUrl",
2718
+ "multiple",
2719
+ "selectedValue",
2720
+ "enableSearch",
2721
+ "add",
2722
+ "addConfig",
2723
+ "edit",
2724
+ "editConfig",
2725
+ "sort",
2726
+ "sortBy",
2727
+ "searchField",
2728
+ "itemComponent",
2729
+ "items",
2730
+ "apiDataProperty",
2731
+ "cache",
2732
+ "perPage",
2733
+ "inDataSearch",
2734
+ "panelWidth",
2735
+ "focusSearchOnOpen",
2736
+ "isEmitInitialEvent",
2737
+ "required",
2738
+ "disabled",
2739
+ "value"
2740
+ ],
2741
+ outputs: [
2742
+ "selectedValueChange",
2743
+ "selectionChange",
2744
+ "itemsChange",
2745
+ "isItemsEmpty"
2746
+ ]
2747
+ },
2748
+ {
2749
+ kind: "pipe",
2750
+ type: i19.DatePipe,
2751
+ name: "date"
2752
+ }
2753
+ ],
2754
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
2755
+ preserveWhitespaces: true
2756
+ });
2757
+ };
2758
+ i0.ɵɵngDeclareClassMetadata({
2759
+ minVersion: "12.0.0",
2760
+ version: "22.2.5",
2761
+ ngImport: i0,
2762
+ type: StockTransferListComponent,
2763
+ decorators: [{
2764
+ type: Component,
2765
+ args: [{
2766
+ selector: "app-stock-transfer-list",
2767
+ changeDetection: ChangeDetectionStrategy.Eager,
2768
+ imports: [
2769
+ CommonModule,
2770
+ MaterialModule$1,
2771
+ InfiniteScrollDirective,
2772
+ StockTransferFormComponent,
2773
+ TechlifyFormButtonComponent,
2774
+ ReactiveFormsModule,
2775
+ RouterLink,
2776
+ SearchableSelectorModule
2777
+ ],
2778
+ template: "@if (!productId) {\n<mat-card class=\"mb-2\">\n <mat-card-content class=\"mb-0 d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> ungroup </span>\n\n <div class=\"d-flex flex-row gap-2 align-items-center\">\n <h3 class=\"mb-0\">Stock Transfers</h3>\n <app-techlify-form-button [component]=\"stockTransferForm()\" [data]=\"{ product_id: productId }\" [width]=\"'500px'\" (saved)=\"transferSaved()\"></app-techlify-form-button>\n </div>\n </div>\n <form [formGroup]=\"filterForm\" class=\"d-flex justify-content-end align-items-center gap-2\">\n <mat-form-field>\n <mat-label>Search</mat-label>\n <input type=\"text\" placeholder=\"Search Stock Transfers\" matInput formControlName=\"search\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Status</mat-label>\n <app-searchable-selector apiUrl=\"api/stock-transfer-statuses\" formControlName=\"status_ids\"\n [enableSearch]=\"false\" [multiple]=\"true\"></app-searchable-selector>\n </mat-form-field>\n </form>\n </mat-card-content>\n</mat-card>\n}\n\n<mat-card>\n @if (productId) {\n <mat-card-content class=\"mb-0 d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> ungroup </span>\n\n <div class=\"d-flex flex-row gap-2 align-items-center\">\n <h3 class=\"mb-0\">Stock Transfers</h3>\n <app-techlify-form-button [component]=\"stockTransferForm()\" [data]=\"{ product_id: productId }\" [width]=\"'500px'\" (saved)=\"transferSaved()\"></app-techlify-form-button>\n </div>\n </div>\n </mat-card-content>\n }\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Stock Transfers\" infiniteScroll\n [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"onSortChange($event)\">\n\n <ng-container matColumnDef=\"#\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"date\">Date</th>\n <td mat-cell *matCellDef=\"let element\">\n <div class=\"d-flex flex-column\">\n <span>{{ $safeNavigationMigration(element?.date) | date }}</span>\n <span>{{ element?.particulars }}</span>\n </div>\n </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 [routerLink]=\"['/inventory/products', $safeNavigationMigration(element?.product?.id), 'view']\"\n class=\"text-decoration-none text-dark\">\n {{ element?.product?.name }}\n </a>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"quantity\">Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.quantity }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"location_from\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"location_from_id\">From</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.location_from?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"location_to\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"location_to_id\">To</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.location_to?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header=\"status\">Status</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.status?.title }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ $safeNavigationMigration(element?.created_at) | date }}</small>\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\n @if (isWorking) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-card-content>\n</mat-card>\n"
2779
+ }]
2780
+ }],
2781
+ ctorParameters: () => [
2782
+ { type: StockTransferService },
2783
+ { type: i2.FormBuilder },
2784
+ { type: i1.ErrorHandlerService },
2785
+ { type: i4$1.ActivatedRoute }
2786
+ ],
2787
+ propDecorators: {
2788
+ productId: [{ type: Input }],
2789
+ changed: [{
2790
+ type: i0.Output,
2791
+ args: ["changed"]
2792
+ }]
2793
+ }
2794
+ });
2795
+ var StockSummaryService = class StockSummaryService {
2796
+ httpService;
2797
+ constructor(httpService) {
2798
+ this.httpService = httpService;
2799
+ }
2800
+ summary(params) {
2801
+ return this.httpService.get("api/stocks-summary", { params });
2802
+ }
2803
+ static ɵfac = i0.ɵɵngDeclareFactory({
2804
+ minVersion: "12.0.0",
2805
+ version: "22.2.5",
2806
+ ngImport: i0,
2807
+ type: StockSummaryService,
2808
+ deps: [{ token: i1.HttpService }],
2809
+ target: i0.ɵɵFactoryTarget.Injectable
2810
+ });
2811
+ static ɵprov = i0.ɵɵngDeclareInjectable({
2812
+ minVersion: "12.0.0",
2813
+ version: "22.2.5",
2814
+ ngImport: i0,
2815
+ type: StockSummaryService,
2816
+ providedIn: "root"
2817
+ });
2818
+ };
2819
+ i0.ɵɵngDeclareClassMetadata({
2820
+ minVersion: "12.0.0",
2821
+ version: "22.2.5",
2822
+ ngImport: i0,
2823
+ type: StockSummaryService,
2824
+ decorators: [{
2825
+ type: Injectable,
2826
+ args: [{ providedIn: "root" }]
2827
+ }],
2828
+ ctorParameters: () => [{ type: i1.HttpService }]
2829
+ });
2830
+ var BarcodeComponent = class BarcodeComponent {
2831
+ value = input("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
2832
+ format = input("CODE128", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
2833
+ displayValue = input(false, ...ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []);
2834
+ svg = viewChild.required("barcode", ...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
2835
+ constructor() {
2836
+ effect(() => {
2837
+ const element = this.svg().nativeElement;
2838
+ const value = this.value();
2839
+ element.replaceChildren();
2840
+ if (!value) return;
2841
+ try {
2842
+ JsBarcode(element, value, {
2843
+ format: this.format(),
2844
+ displayValue: this.displayValue()
2845
+ });
2846
+ } catch {
2847
+ element.replaceChildren();
2848
+ }
2849
+ });
2850
+ }
2851
+ static ɵfac = i0.ɵɵngDeclareFactory({
2852
+ minVersion: "12.0.0",
2853
+ version: "22.2.5",
2854
+ ngImport: i0,
2855
+ type: BarcodeComponent,
2856
+ deps: [],
2857
+ target: i0.ɵɵFactoryTarget.Component
2858
+ });
2859
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2860
+ minVersion: "17.2.0",
2861
+ version: "22.2.5",
2862
+ type: BarcodeComponent,
2863
+ isStandalone: true,
2864
+ selector: "app-barcode",
2865
+ inputs: {
2866
+ value: {
2867
+ classPropertyName: "value",
2868
+ publicName: "value",
2869
+ isSignal: true,
2870
+ isRequired: false,
2871
+ transformFunction: null
2872
+ },
2873
+ format: {
2874
+ classPropertyName: "format",
2875
+ publicName: "format",
2876
+ isSignal: true,
2877
+ isRequired: false,
2878
+ transformFunction: null
2879
+ },
2880
+ displayValue: {
2881
+ classPropertyName: "displayValue",
2882
+ publicName: "displayValue",
2883
+ isSignal: true,
2884
+ isRequired: false,
2885
+ transformFunction: null
2886
+ }
2887
+ },
2888
+ viewQueries: [{
2889
+ propertyName: "svg",
2890
+ first: true,
2891
+ predicate: ["barcode"],
2892
+ descendants: true,
2893
+ isSignal: true
2894
+ }],
2895
+ ngImport: i0,
2896
+ template: "<svg #barcode></svg>",
2897
+ isInline: true,
2898
+ preserveWhitespaces: true
2899
+ });
2900
+ };
2901
+ i0.ɵɵngDeclareClassMetadata({
2902
+ minVersion: "12.0.0",
2903
+ version: "22.2.5",
2904
+ ngImport: i0,
2905
+ type: BarcodeComponent,
2906
+ decorators: [{
2907
+ type: Component,
2908
+ args: [{
2909
+ selector: "app-barcode",
2910
+ template: "<svg #barcode></svg>"
2911
+ }]
2912
+ }],
2913
+ ctorParameters: () => [],
2914
+ propDecorators: {
2915
+ value: [{
2916
+ type: i0.Input,
2917
+ args: [{
2918
+ isSignal: true,
2919
+ alias: "value",
2920
+ required: false
2921
+ }]
2922
+ }],
2923
+ format: [{
2924
+ type: i0.Input,
2925
+ args: [{
2926
+ isSignal: true,
2927
+ alias: "format",
2928
+ required: false
2929
+ }]
2930
+ }],
2931
+ displayValue: [{
2932
+ type: i0.Input,
2933
+ args: [{
2934
+ isSignal: true,
2935
+ alias: "displayValue",
2936
+ required: false
2937
+ }]
2938
+ }],
2939
+ svg: [{
2940
+ type: i0.ViewChild,
2941
+ args: ["barcode", { isSignal: true }]
2942
+ }]
2943
+ }
2944
+ });
2945
+ var ProductBasicInfoComponent = class ProductBasicInfoComponent {
2946
+ stockSummaryService;
2947
+ service;
2948
+ product;
2949
+ saved = new EventEmitter();
2950
+ deleted = new EventEmitter();
2951
+ stockSummary;
2952
+ constructor(stockSummaryService, service) {
2953
+ this.stockSummaryService = stockSummaryService;
2954
+ this.service = service;
2955
+ }
2956
+ ngOnInit() {
2957
+ if (this.product) this.loadProductStocksSummary();
2958
+ }
2959
+ onProductSaved(product) {
2960
+ this.product = product;
2961
+ this.saved.emit(this.product);
2962
+ }
2963
+ loadProductStocksSummary() {
2964
+ const params = {
2965
+ product_ids: this.product?.id,
2966
+ include: "stock_receipts_quantity_sum,stock_issue_quantity_sum,stock_quantity_remaining"
2967
+ };
2968
+ this.stockSummaryService.summary(params).subscribe({ next: (response) => {
2969
+ this.stockSummary = response;
2970
+ } });
2971
+ }
2972
+ static ɵfac = i0.ɵɵngDeclareFactory({
2973
+ minVersion: "12.0.0",
2974
+ version: "22.2.5",
2975
+ ngImport: i0,
2976
+ type: ProductBasicInfoComponent,
2977
+ deps: [{ token: StockSummaryService }, { token: ProductService }],
2978
+ target: i0.ɵɵFactoryTarget.Component
2979
+ });
2980
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2981
+ minVersion: "17.0.0",
2982
+ version: "22.2.5",
2983
+ type: ProductBasicInfoComponent,
2984
+ isStandalone: false,
2985
+ selector: "app-product-basic-info",
2986
+ inputs: { product: "product" },
2987
+ outputs: {
2988
+ saved: "saved",
2989
+ deleted: "deleted"
2990
+ },
2991
+ ngImport: i0,
2992
+ template: "@if (product) {\n<mat-card class=\"w-100\">\n\n <!-- Header: Image + Product Info + Actions -->\n <mat-card-content class=\"d-flex gap-3 align-items-start\">\n <div class=\"product-image-container rounded overflow-hidden flex-shrink-0\">\n @if (product?.image_file_url) {\n <img [src]=\"product.image_file_url\" alt=\"{{ product?.name }}\"\n class=\"w-100 h-100 object-fit-cover\" />\n } @if (!product?.image_file_url) {\n <div\n class=\"w-100 h-100 bg-secondary-subtle d-flex align-items-center justify-content-center rounded\">\n <span class=\"material-symbols-outlined text-secondary\"\n style=\"font-size: 40px\"\n >inventory_2</span>\n </div>\n }\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"d-flex justify-content-between align-items-start\">\n <div>\n <h5 class=\"fw-semibold mb-1\">{{ product?.name }}</h5>\n <div class=\"d-flex align-items-center gap-1 text-secondary small flex-wrap\">\n <span>{{ product?.sku }}</span>\n <span> • </span>\n <span>{{ product?.type?.title }}</span>\n <span> • </span>\n <span class=\"material-symbols-outlined\" style=\"font-size: 16px\"\n >view_in_ar</span>\n <span>{{ product?.measure?.title }}</span>\n </div>\n @if (product?.average_cost != null) {\n <div class=\"d-flex align-items-center gap-1 text-secondary small\">\n <i class=\"fa-solid fa-money-bill\"></i>\n <span>{{ $safeNavigationMigration(product?.average_cost) | currency }}</span>\n </div>\n }\n </div>\n <div class=\"d-flex gap-2 flex-shrink-0 align-middle text-secondary\">\n <app-product-form-button [product]=\"product\" (saved)=\"onProductSaved($event)\"></app-product-form-button>\n <app-techlify-delete-button [model]=\"product\" [data]=\"{ type: 'Product', title: $safeNavigationMigration(product?.name) }\"\n [service]=\"service\"></app-techlify-delete-button>\n </div>\n </div>\n\n <!-- Categories -->\n @if (product?.categories?.length) {\n <div class=\"d-flex flex-wrap gap-1 mt-2\">\n @for (category of product?.categories; track category) {\n <span class=\"badge border bg-light text-dark fw-medium\">\n {{ category?.title }}\n </span>\n }\n </div>\n }\n </div>\n </mat-card-content>\n\n <!-- Stock Summary Row -->\n <mat-card-content class=\"py-3\">\n <div class=\"row g-0\">\n <!-- Stock Receipts -->\n @if (stockSummary) {\n <div class=\"col-4 d-flex flex-column\">\n <small class=\"text-secondary\">Stock Receipts</small>\n <p class=\"mb-0 fw-semibold fs-2\">{{ $safeNavigationMigration(stockSummary?.stock_receipts_quantity_sum) | number }}</p>\n @if (product?.last_stock_receipt) {\n <small class=\"text-secondary\">\n Last Added On\n {{ $safeNavigationMigration(product?.last_stock_receipt?.date) | date : 'MMM d, y' }}\n </small>\n }\n </div>\n }\n <!-- Stock Issues -->\n @if (stockSummary) {\n <div class=\"col-4 d-flex flex-column\">\n <small class=\"text-secondary\">Stock Issues</small>\n <p class=\"mb-0 fw-semibold fs-2\">{{ $safeNavigationMigration(stockSummary?.stock_issue_quantity_sum) | number }}</p>\n @if (product?.last_stock_issue) {\n <small class=\"text-secondary\">\n Last Added On\n {{ $safeNavigationMigration(product?.last_stock_issue?.date) | date : 'MMM d, y' }}\n </small>\n }\n </div>\n }\n <!-- On Hand -->\n <div class=\"col-4 d-flex flex-column\">\n <small class=\"text-secondary\">On Hand</small>\n <p class=\"mb-0 fw-semibold fs-2 text-success\"\n [ngClass]=\"{ 'text-danger': $safeNavigationMigration(product?.stock_on_hand) < $safeNavigationMigration(product?.reorder_point) }\">\n {{ ($safeNavigationMigration(product?.stock_on_hand) | number) ?? 0 }}</p>\n @if (product?.reorder_point) {\n <small class=\"text-secondary\">\n Reorder At {{ product?.reorder_point }}\n </small>\n }\n </div>\n </div>\n </mat-card-content>\n\n <!-- Description -->\n @if (product?.description) {\n <mat-card-content class=\"pt-2\">\n <small class=\"text-secondary\">Description</small>\n <p class=\"mb-0 mt-1\">{{ product?.description }}</p>\n </mat-card-content>\n }\n <div class=\"d-flex flex-row align-items-center w-100 mt-2 gap-3 overflow-hidden\">\n <div class=\"barcode-container flex-grow-1 min-width-0 overflow-hidden\">\n <app-barcode [value]=\"product?.sku\" [displayValue]=\"true\"></app-barcode>\n </div>\n <div class=\"flex-shrink-0\">\n <qrcode [qrdata]=\"$safeNavigationMigration(product?.sku)\" [width]=\"128\"></qrcode>\n </div>\n </div>\n\n</mat-card>\n}",
2993
+ styles: [".product-image-container{width:80px;height:80px}.barcode-container{min-width:0}.barcode-container ::ng-deep ngx-barcode6 svg{width:100%;height:auto}\n"],
2994
+ dependencies: [
2995
+ {
2996
+ kind: "directive",
2997
+ type: i19.NgClass,
2998
+ selector: "[ngClass]",
2999
+ inputs: ["class", "ngClass"]
3000
+ },
3001
+ {
3002
+ kind: "component",
3003
+ type: i7.MatCard,
3004
+ selector: "mat-card",
3005
+ inputs: ["appearance"],
3006
+ exportAs: ["matCard"]
3007
+ },
3008
+ {
3009
+ kind: "directive",
3010
+ type: i7.MatCardContent,
3011
+ selector: "mat-card-content"
3012
+ },
3013
+ {
3014
+ kind: "component",
3015
+ type: i1.TechlifyDeleteButtonComponent,
3016
+ selector: "app-techlify-delete-button",
3017
+ inputs: [
3018
+ "data",
3019
+ "model",
3020
+ "message",
3021
+ "service"
3022
+ ],
3023
+ outputs: ["deleted", "loading"]
3024
+ },
3025
+ {
3026
+ kind: "component",
3027
+ type: i6.QRCodeComponent,
3028
+ selector: "qrcode",
3029
+ inputs: [
3030
+ "allowEmptyString",
3031
+ "colorDark",
3032
+ "colorLight",
3033
+ "cssClass",
3034
+ "elementType",
3035
+ "errorCorrectionLevel",
3036
+ "imageSrc",
3037
+ "imageHeight",
3038
+ "imageWidth",
3039
+ "margin",
3040
+ "qrdata",
3041
+ "scale",
3042
+ "version",
3043
+ "width",
3044
+ "alt",
3045
+ "ariaLabel",
3046
+ "title"
3047
+ ],
3048
+ outputs: ["qrCodeURL"]
3049
+ },
3050
+ {
3051
+ kind: "component",
3052
+ type: BarcodeComponent,
3053
+ selector: "app-barcode",
3054
+ inputs: [
3055
+ "value",
3056
+ "format",
3057
+ "displayValue"
3058
+ ]
3059
+ },
3060
+ {
3061
+ kind: "component",
3062
+ type: ProductFormButtonComponent,
3063
+ selector: "app-product-form-button",
3064
+ inputs: ["product"]
3065
+ },
3066
+ {
3067
+ kind: "pipe",
3068
+ type: i19.DecimalPipe,
3069
+ name: "number"
3070
+ },
3071
+ {
3072
+ kind: "pipe",
3073
+ type: i19.CurrencyPipe,
3074
+ name: "currency"
3075
+ },
3076
+ {
3077
+ kind: "pipe",
3078
+ type: i19.DatePipe,
3079
+ name: "date"
3080
+ }
3081
+ ],
3082
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
3083
+ preserveWhitespaces: true
3084
+ });
3085
+ };
3086
+ i0.ɵɵngDeclareClassMetadata({
3087
+ minVersion: "12.0.0",
3088
+ version: "22.2.5",
3089
+ ngImport: i0,
3090
+ type: ProductBasicInfoComponent,
3091
+ decorators: [{
3092
+ type: Component,
3093
+ args: [{
3094
+ selector: "app-product-basic-info",
3095
+ changeDetection: ChangeDetectionStrategy.Eager,
3096
+ standalone: false,
3097
+ template: "@if (product) {\n<mat-card class=\"w-100\">\n\n <!-- Header: Image + Product Info + Actions -->\n <mat-card-content class=\"d-flex gap-3 align-items-start\">\n <div class=\"product-image-container rounded overflow-hidden flex-shrink-0\">\n @if (product?.image_file_url) {\n <img [src]=\"product.image_file_url\" alt=\"{{ product?.name }}\"\n class=\"w-100 h-100 object-fit-cover\" />\n } @if (!product?.image_file_url) {\n <div\n class=\"w-100 h-100 bg-secondary-subtle d-flex align-items-center justify-content-center rounded\">\n <span class=\"material-symbols-outlined text-secondary\"\n style=\"font-size: 40px\"\n >inventory_2</span>\n </div>\n }\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"d-flex justify-content-between align-items-start\">\n <div>\n <h5 class=\"fw-semibold mb-1\">{{ product?.name }}</h5>\n <div class=\"d-flex align-items-center gap-1 text-secondary small flex-wrap\">\n <span>{{ product?.sku }}</span>\n <span> • </span>\n <span>{{ product?.type?.title }}</span>\n <span> • </span>\n <span class=\"material-symbols-outlined\" style=\"font-size: 16px\"\n >view_in_ar</span>\n <span>{{ product?.measure?.title }}</span>\n </div>\n @if (product?.average_cost != null) {\n <div class=\"d-flex align-items-center gap-1 text-secondary small\">\n <i class=\"fa-solid fa-money-bill\"></i>\n <span>{{ $safeNavigationMigration(product?.average_cost) | currency }}</span>\n </div>\n }\n </div>\n <div class=\"d-flex gap-2 flex-shrink-0 align-middle text-secondary\">\n <app-product-form-button [product]=\"product\" (saved)=\"onProductSaved($event)\"></app-product-form-button>\n <app-techlify-delete-button [model]=\"product\" [data]=\"{ type: 'Product', title: $safeNavigationMigration(product?.name) }\"\n [service]=\"service\"></app-techlify-delete-button>\n </div>\n </div>\n\n <!-- Categories -->\n @if (product?.categories?.length) {\n <div class=\"d-flex flex-wrap gap-1 mt-2\">\n @for (category of product?.categories; track category) {\n <span class=\"badge border bg-light text-dark fw-medium\">\n {{ category?.title }}\n </span>\n }\n </div>\n }\n </div>\n </mat-card-content>\n\n <!-- Stock Summary Row -->\n <mat-card-content class=\"py-3\">\n <div class=\"row g-0\">\n <!-- Stock Receipts -->\n @if (stockSummary) {\n <div class=\"col-4 d-flex flex-column\">\n <small class=\"text-secondary\">Stock Receipts</small>\n <p class=\"mb-0 fw-semibold fs-2\">{{ $safeNavigationMigration(stockSummary?.stock_receipts_quantity_sum) | number }}</p>\n @if (product?.last_stock_receipt) {\n <small class=\"text-secondary\">\n Last Added On\n {{ $safeNavigationMigration(product?.last_stock_receipt?.date) | date : 'MMM d, y' }}\n </small>\n }\n </div>\n }\n <!-- Stock Issues -->\n @if (stockSummary) {\n <div class=\"col-4 d-flex flex-column\">\n <small class=\"text-secondary\">Stock Issues</small>\n <p class=\"mb-0 fw-semibold fs-2\">{{ $safeNavigationMigration(stockSummary?.stock_issue_quantity_sum) | number }}</p>\n @if (product?.last_stock_issue) {\n <small class=\"text-secondary\">\n Last Added On\n {{ $safeNavigationMigration(product?.last_stock_issue?.date) | date : 'MMM d, y' }}\n </small>\n }\n </div>\n }\n <!-- On Hand -->\n <div class=\"col-4 d-flex flex-column\">\n <small class=\"text-secondary\">On Hand</small>\n <p class=\"mb-0 fw-semibold fs-2 text-success\"\n [ngClass]=\"{ 'text-danger': $safeNavigationMigration(product?.stock_on_hand) < $safeNavigationMigration(product?.reorder_point) }\">\n {{ ($safeNavigationMigration(product?.stock_on_hand) | number) ?? 0 }}</p>\n @if (product?.reorder_point) {\n <small class=\"text-secondary\">\n Reorder At {{ product?.reorder_point }}\n </small>\n }\n </div>\n </div>\n </mat-card-content>\n\n <!-- Description -->\n @if (product?.description) {\n <mat-card-content class=\"pt-2\">\n <small class=\"text-secondary\">Description</small>\n <p class=\"mb-0 mt-1\">{{ product?.description }}</p>\n </mat-card-content>\n }\n <div class=\"d-flex flex-row align-items-center w-100 mt-2 gap-3 overflow-hidden\">\n <div class=\"barcode-container flex-grow-1 min-width-0 overflow-hidden\">\n <app-barcode [value]=\"product?.sku\" [displayValue]=\"true\"></app-barcode>\n </div>\n <div class=\"flex-shrink-0\">\n <qrcode [qrdata]=\"$safeNavigationMigration(product?.sku)\" [width]=\"128\"></qrcode>\n </div>\n </div>\n\n</mat-card>\n}",
3098
+ styles: [".product-image-container{width:80px;height:80px}.barcode-container{min-width:0}.barcode-container ::ng-deep ngx-barcode6 svg{width:100%;height:auto}\n"]
3099
+ }]
3100
+ }],
3101
+ ctorParameters: () => [{ type: StockSummaryService }, { type: ProductService }],
3102
+ propDecorators: {
3103
+ product: [{ type: Input }],
3104
+ saved: [{ type: Output }],
3105
+ deleted: [{ type: Output }]
3106
+ }
3107
+ });
3108
+ var ProductViewPageComponent = class ProductViewPageComponent {
3109
+ productService;
3110
+ activatedRoute;
3111
+ location;
3112
+ product;
3113
+ id;
3114
+ isLoading;
3115
+ productBasicInfoComponent;
3116
+ productLocationList;
3117
+ stockTransferList;
3118
+ stockReceiptProductListPage;
3119
+ stockIssueProductListPage;
3120
+ constructor(productService, activatedRoute, location) {
3121
+ this.productService = productService;
3122
+ this.activatedRoute = activatedRoute;
3123
+ this.location = location;
3124
+ this.id = this.activatedRoute.snapshot.params?.["id"];
3125
+ }
3126
+ ngOnInit() {
3127
+ if (this.id) this.getProduct(this.id);
3128
+ }
3129
+ getProduct(productId) {
3130
+ this.isLoading = true;
3131
+ this.productService.show(productId, { with: "type,measure,incomeAccount,expenseAccount,categories,lastStockReceipt,lastStockIssue,taxes.tax.type" }).subscribe({
3132
+ next: (result) => {
3133
+ this.isLoading = false;
3134
+ this.product = result?.item;
3135
+ },
3136
+ error: () => this.isLoading = false
3137
+ });
3138
+ }
3139
+ stockTransferChanged() {
3140
+ this.getProduct(this.id);
3141
+ this.productBasicInfoComponent.loadProductStocksSummary();
3142
+ this.productLocationList.reload();
3143
+ this.stockReceiptProductListPage.reload();
3144
+ this.stockIssueProductListPage.reload();
3145
+ }
3146
+ onProductUpdated(product) {
3147
+ this.getProduct(this.id);
3148
+ }
3149
+ onProductDeleted() {
3150
+ this.location.back();
3151
+ }
3152
+ static ɵfac = i0.ɵɵngDeclareFactory({
3153
+ minVersion: "12.0.0",
3154
+ version: "22.2.5",
3155
+ ngImport: i0,
3156
+ type: ProductViewPageComponent,
3157
+ deps: [
3158
+ { token: ProductService },
3159
+ { token: i4$1.ActivatedRoute },
3160
+ { token: i19.Location }
3161
+ ],
3162
+ target: i0.ɵɵFactoryTarget.Component
3163
+ });
3164
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3165
+ minVersion: "17.0.0",
3166
+ version: "22.2.5",
3167
+ type: ProductViewPageComponent,
3168
+ isStandalone: false,
3169
+ selector: "app-product-view-page",
3170
+ viewQueries: [
3171
+ {
3172
+ propertyName: "productBasicInfoComponent",
3173
+ first: true,
3174
+ predicate: ["productBasicInfoComponent"],
3175
+ descendants: true
3176
+ },
3177
+ {
3178
+ propertyName: "productLocationList",
3179
+ first: true,
3180
+ predicate: ["productLocationList"],
3181
+ descendants: true
3182
+ },
3183
+ {
3184
+ propertyName: "stockTransferList",
3185
+ first: true,
3186
+ predicate: ["stockTransferList"],
3187
+ descendants: true
3188
+ },
3189
+ {
3190
+ propertyName: "stockReceiptProductListPage",
3191
+ first: true,
3192
+ predicate: ["stockReceiptProductListPage"],
3193
+ descendants: true
3194
+ },
3195
+ {
3196
+ propertyName: "stockIssueProductListPage",
3197
+ first: true,
3198
+ predicate: ["stockIssueProductListPage"],
3199
+ descendants: true
3200
+ }
3201
+ ],
3202
+ ngImport: i0,
3203
+ template: "@if (isLoading) {\n<mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n} @if (product) {\n<div class=\"d-flex justify-content-start align-items-start gap-3 w-100\">\n @if (product) {\n <div class=\"d-flex justify-content-start align-items-start gap-3 w-100\">\n <div style=\"width: calc(25% - 1rem)\" class=\"d-flex flex-column gap-3\">\n <app-product-basic-info [product]=\"product\" #productBasicInfoComponent (deleted)=\"onProductDeleted()\"\n (saved)=\"onProductUpdated($event)\"></app-product-basic-info>\n\n <app-product-location-list [product]=\"product\"\n (updated)=\"stockTransferList.reload(); stockIssueProductListPage.reload(); stockReceiptProductListPage.reload()\"\n #productLocationList></app-product-location-list>\n\n <app-note-list labelText=\"Notes\" viewMode=\"timeline\" modelType=\"Product\"\n [relatedModelId]=\"product.id\"></app-note-list>\n\n </div>\n <div class=\"d-flex flex-column gap-3 w-100\">\n <app-stock-receipt-product-list #stockReceiptProductListPage [filters]=\"{ product_ids: $safeNavigationMigration(product?.id) }\"\n [product]=\"product\" [isProductView]=\"true\"\n (listUpdated)=\" getProduct(this.id); productBasicInfoComponent.loadProductStocksSummary(); productLocationList.reload() \"\n ></app-stock-receipt-product-list>\n\n <app-stock-issue-products-list #stockIssueProductListPage [isProductView]=\"true\"\n [product]=\"product\" [filters]=\"{ product_ids: $safeNavigationMigration(product?.id) }\"\n (listUpdated)=\" getProduct(this.id); productBasicInfoComponent.loadProductStocksSummary(); productLocationList.reload() \"\n ></app-stock-issue-products-list>\n @if (product) {\n <app-stock-transfer-list #stockTransferList [productId]=\"product.id\"\n (changed)=\"stockTransferChanged()\"></app-stock-transfer-list>\n }\n </div>\n </div>\n }\n</div>\n}",
3204
+ dependencies: [
3205
+ {
3206
+ kind: "component",
3207
+ type: i11.MatProgressBar,
3208
+ selector: "mat-progress-bar",
3209
+ inputs: [
3210
+ "color",
3211
+ "value",
3212
+ "bufferValue",
3213
+ "mode"
3214
+ ],
3215
+ outputs: ["animationEnd"],
3216
+ exportAs: ["matProgressBar"]
3217
+ },
3218
+ {
3219
+ kind: "component",
3220
+ type: i1.NoteListComponent,
3221
+ selector: "app-note-list",
3222
+ inputs: [
3223
+ "relatedModelId",
3224
+ "modelType",
3225
+ "readonly",
3226
+ "labelText",
3227
+ "commentsView",
3228
+ "viewMode"
3229
+ ]
3230
+ },
3231
+ {
3232
+ kind: "component",
3233
+ type: StockReceiptProductsListComponent,
3234
+ selector: "app-stock-receipt-product-list",
3235
+ inputs: [
3236
+ "filters",
3237
+ "isProductView",
3238
+ "selectedColumns",
3239
+ "exportInProgress",
3240
+ "product"
3241
+ ],
3242
+ outputs: ["listUpdated", "columnConfigReady"]
3243
+ },
3244
+ {
3245
+ kind: "component",
3246
+ type: StockIssueProductListComponent,
3247
+ selector: "app-stock-issue-products-list",
3248
+ inputs: [
3249
+ "filters",
3250
+ "isProductView",
3251
+ "product",
3252
+ "selectedColumns",
3253
+ "exportInProgress",
3254
+ "issuableData"
3255
+ ],
3256
+ outputs: [
3257
+ "selectedColumnsChange",
3258
+ "listUpdated",
3259
+ "columnConfigReady"
3260
+ ]
3261
+ },
3262
+ {
3263
+ kind: "component",
3264
+ type: ProductLocationListComponent,
3265
+ selector: "app-product-location-list",
3266
+ inputs: ["product"],
3267
+ outputs: ["updated"]
3268
+ },
3269
+ {
3270
+ kind: "component",
3271
+ type: StockTransferListComponent,
3272
+ selector: "app-stock-transfer-list",
3273
+ inputs: ["productId"],
3274
+ outputs: ["changed"]
3275
+ },
3276
+ {
3277
+ kind: "component",
3278
+ type: ProductBasicInfoComponent,
3279
+ selector: "app-product-basic-info",
3280
+ inputs: ["product"],
3281
+ outputs: ["saved", "deleted"]
3282
+ }
3283
+ ],
3284
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
3285
+ preserveWhitespaces: true
3286
+ });
3287
+ };
3288
+ i0.ɵɵngDeclareClassMetadata({
3289
+ minVersion: "12.0.0",
3290
+ version: "22.2.5",
3291
+ ngImport: i0,
3292
+ type: ProductViewPageComponent,
3293
+ decorators: [{
3294
+ type: Component,
3295
+ args: [{
3296
+ selector: "app-product-view-page",
3297
+ changeDetection: ChangeDetectionStrategy.Eager,
3298
+ standalone: false,
3299
+ template: "@if (isLoading) {\n<mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n} @if (product) {\n<div class=\"d-flex justify-content-start align-items-start gap-3 w-100\">\n @if (product) {\n <div class=\"d-flex justify-content-start align-items-start gap-3 w-100\">\n <div style=\"width: calc(25% - 1rem)\" class=\"d-flex flex-column gap-3\">\n <app-product-basic-info [product]=\"product\" #productBasicInfoComponent (deleted)=\"onProductDeleted()\"\n (saved)=\"onProductUpdated($event)\"></app-product-basic-info>\n\n <app-product-location-list [product]=\"product\"\n (updated)=\"stockTransferList.reload(); stockIssueProductListPage.reload(); stockReceiptProductListPage.reload()\"\n #productLocationList></app-product-location-list>\n\n <app-note-list labelText=\"Notes\" viewMode=\"timeline\" modelType=\"Product\"\n [relatedModelId]=\"product.id\"></app-note-list>\n\n </div>\n <div class=\"d-flex flex-column gap-3 w-100\">\n <app-stock-receipt-product-list #stockReceiptProductListPage [filters]=\"{ product_ids: $safeNavigationMigration(product?.id) }\"\n [product]=\"product\" [isProductView]=\"true\"\n (listUpdated)=\" getProduct(this.id); productBasicInfoComponent.loadProductStocksSummary(); productLocationList.reload() \"\n ></app-stock-receipt-product-list>\n\n <app-stock-issue-products-list #stockIssueProductListPage [isProductView]=\"true\"\n [product]=\"product\" [filters]=\"{ product_ids: $safeNavigationMigration(product?.id) }\"\n (listUpdated)=\" getProduct(this.id); productBasicInfoComponent.loadProductStocksSummary(); productLocationList.reload() \"\n ></app-stock-issue-products-list>\n @if (product) {\n <app-stock-transfer-list #stockTransferList [productId]=\"product.id\"\n (changed)=\"stockTransferChanged()\"></app-stock-transfer-list>\n }\n </div>\n </div>\n }\n</div>\n}"
3300
+ }]
3301
+ }],
3302
+ ctorParameters: () => [
3303
+ { type: ProductService },
3304
+ { type: i4$1.ActivatedRoute },
3305
+ { type: i19.Location }
3306
+ ],
3307
+ propDecorators: {
3308
+ productBasicInfoComponent: [{
3309
+ type: ViewChild,
3310
+ args: ["productBasicInfoComponent"]
3311
+ }],
3312
+ productLocationList: [{
3313
+ type: ViewChild,
3314
+ args: ["productLocationList"]
3315
+ }],
3316
+ stockTransferList: [{
3317
+ type: ViewChild,
3318
+ args: ["stockTransferList"]
3319
+ }],
3320
+ stockReceiptProductListPage: [{
3321
+ type: ViewChild,
3322
+ args: ["stockReceiptProductListPage"]
3323
+ }],
3324
+ stockIssueProductListPage: [{
3325
+ type: ViewChild,
3326
+ args: ["stockIssueProductListPage"]
3327
+ }]
3328
+ }
3329
+ });
3330
+ var ProductImportPageComponent = class ProductImportPageComponent {
3331
+ importConfig = {
3332
+ apiUrl: "api/products-import",
3333
+ title: "Products",
3334
+ importType: "product",
3335
+ properties: [
3336
+ {
3337
+ label: "Name",
3338
+ value: "name",
3339
+ type: "text"
3340
+ },
3341
+ {
3342
+ label: "SKU",
3343
+ value: "sku",
3344
+ type: "text"
3345
+ },
3346
+ {
3347
+ label: "Initial Quantity",
3348
+ value: "initial_quantity",
3349
+ type: "number"
3350
+ },
3351
+ {
3352
+ label: "Initial Quantity Date",
3353
+ value: "initial_quantity_date",
3354
+ type: "date"
3355
+ },
3356
+ {
3357
+ label: "Reorder Point",
3358
+ value: "reorder_point",
3359
+ type: "number"
3360
+ },
3361
+ {
3362
+ label: "Measure",
3363
+ value: "measure",
3364
+ type: "text"
3365
+ },
3366
+ {
3367
+ label: "Categories",
3368
+ value: "categories",
3369
+ type: "text"
3370
+ }
3371
+ ],
3372
+ sampleFile: {
3373
+ name: "Products Import",
3374
+ path: "assets/product/product-import-sample.csv"
3375
+ },
3376
+ importHistory: {
3377
+ isEnabled: true,
3378
+ type: "product",
3379
+ apiUrl: "api/import-histories"
3380
+ },
3381
+ viewRouterLink: "/inventory/products/"
3382
+ };
3383
+ constructor() {}
3384
+ ngOnInit() {}
3385
+ static ɵfac = i0.ɵɵngDeclareFactory({
3386
+ minVersion: "12.0.0",
3387
+ version: "22.2.5",
3388
+ ngImport: i0,
3389
+ type: ProductImportPageComponent,
3390
+ deps: [],
3391
+ target: i0.ɵɵFactoryTarget.Component
3392
+ });
3393
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3394
+ minVersion: "14.0.0",
3395
+ version: "22.2.5",
3396
+ type: ProductImportPageComponent,
3397
+ isStandalone: false,
3398
+ selector: "app-product-import-page",
3399
+ ngImport: i0,
3400
+ template: "<app-import-csv [config]=\"importConfig\"></app-import-csv>\n",
3401
+ styles: [""],
3402
+ dependencies: [{
3403
+ kind: "component",
3404
+ type: i1.ImportCsvComponent,
3405
+ selector: "app-import-csv",
3406
+ inputs: ["config"]
3407
+ }],
3408
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
3409
+ preserveWhitespaces: true
3410
+ });
3411
+ };
3412
+ i0.ɵɵngDeclareClassMetadata({
3413
+ minVersion: "12.0.0",
3414
+ version: "22.2.5",
3415
+ ngImport: i0,
3416
+ type: ProductImportPageComponent,
3417
+ decorators: [{
3418
+ type: Component,
3419
+ args: [{
3420
+ selector: "app-product-import-page",
3421
+ changeDetection: ChangeDetectionStrategy.Eager,
3422
+ standalone: false,
3423
+ template: "<app-import-csv [config]=\"importConfig\"></app-import-csv>\n"
3424
+ }]
3425
+ }],
3426
+ ctorParameters: () => []
3427
+ });
3428
+ var ProductFormComponent = class ProductFormComponent extends TechlifyFormComponent {
3429
+ fileService;
3430
+ fb;
3431
+ formValidatorService;
3432
+ service;
3433
+ activatedRoute;
3434
+ errorHandler;
3435
+ location;
3436
+ router;
3437
+ formConfigService;
3438
+ displayedFormFields = [
3439
+ "name",
3440
+ "product type",
3441
+ "sku",
3442
+ "color",
3443
+ "description",
3444
+ "product measure",
3445
+ "reorder point",
3446
+ "initial quantity",
3447
+ "initial quantity date",
3448
+ "sales price",
3449
+ "minimum price",
3450
+ "maximum price",
3451
+ "income account",
3452
+ "expense account"
3453
+ ];
3454
+ displayedFormSections = [
3455
+ "basic information",
3456
+ "inventory information",
3457
+ "sales information",
3458
+ "accounts information"
3459
+ ];
3460
+ product = signal(null, ...ngDevMode ? [{ debugName: "product" }] : /* istanbul ignore next */ []);
3461
+ isFormSetup = signal(false, ...ngDevMode ? [{ debugName: "isFormSetup" }] : /* istanbul ignore next */ []);
3462
+ errorMessages = {
3463
+ type_id: { required: "Please Enter Type" },
3464
+ name: { required: "Please Enter Name" },
3465
+ sale_price: { required: "Please Enter Sales Price" },
3466
+ minimum_price: { required: "Please Enter Minimum Price" },
3467
+ reorder_point: { required: "Please Enter Reorder Point" },
3468
+ color_id: { required: "Please Select Color" }
3469
+ };
3470
+ isCreateAnother = new FormControl(false);
3471
+ savedCount = 0;
3472
+ formConfigurationUtilityService;
3473
+ fileConfig;
3474
+ viewerConfig;
3475
+ fileList = [];
3476
+ constructor(fileService, fb, formValidatorService, service, activatedRoute, errorHandler, location, router, formConfigService) {
3477
+ super(formValidatorService);
3478
+ this.fileService = fileService;
3479
+ this.fb = fb;
3480
+ this.formValidatorService = formValidatorService;
3481
+ this.service = service;
3482
+ this.activatedRoute = activatedRoute;
3483
+ this.errorHandler = errorHandler;
3484
+ this.location = location;
3485
+ this.router = router;
3486
+ this.formConfigService = formConfigService;
3487
+ this.formConfigurationUtilityService = new FormConfigurationUtilityService();
3488
+ }
3489
+ ngOnInit() {
3490
+ this.fileConfig = {
3491
+ fileId: "productImageFile",
3492
+ containerId: "productImageFileContainer",
3493
+ styles: { height: "200px" },
3494
+ multiple: false,
3495
+ acceptFile: "image/*",
3496
+ maxSize: 10,
3497
+ acceptFileText: "PNG, JPEG, and JPG only"
3498
+ };
3499
+ this.viewerConfig = { viewerStyle: { height: "50px" } };
3500
+ this.formConfigurationUtilityService.initialize(this.formConfigService, "product").subscribe({
3501
+ next: (response) => {
3502
+ this.form = this.fb.group({
3503
+ id: [""],
3504
+ type_id: [1, Validators.compose([Validators.required])],
3505
+ color_id: ["", this.formConfigurationUtilityService.getFieldRequired("color_id") ? Validators.required : null],
3506
+ sku: [""],
3507
+ name: ["", Validators.compose([Validators.required])],
3508
+ initial_quantity: [0],
3509
+ initial_quantity_date: [moment().format()],
3510
+ reorder_point: [10, Validators.compose([Validators.required])],
3511
+ description: [""],
3512
+ sale_price: [0, Validators.compose([Validators.required])],
3513
+ income_account_id: [""],
3514
+ expense_account_id: [""],
3515
+ measure_id: [1],
3516
+ minimum_price: ["", Validators.compose([Validators.required])],
3517
+ maximum_price: [""],
3518
+ condition_type_id: [1],
3519
+ current_quantity: [],
3520
+ category_ids: [""],
3521
+ image_file: [null],
3522
+ image_file_url: [null]
3523
+ });
3524
+ },
3525
+ error: (error) => {
3526
+ this.errorHandler.handleError(error);
3527
+ },
3528
+ complete: () => {
3529
+ this.isFormSetup.set(true);
3530
+ this.loadProduct();
3531
+ }
3532
+ });
3533
+ }
3534
+ loadProduct() {
3535
+ let id = this.activatedRoute.snapshot.params["id"];
3536
+ if (!id) return;
3537
+ this.isWorking = true;
3538
+ this.service?.show(id, { with: "measure,categories" }).subscribe({
3539
+ next: (response) => {
3540
+ this.product.set(response?.item);
3541
+ this.isWorking = false;
3542
+ },
3543
+ error: (error) => {
3544
+ this.isWorking = false;
3545
+ this.errorHandler.handleError(error);
3546
+ },
3547
+ complete: () => {
3548
+ this.patchProduct();
3549
+ this.isWorking = false;
3550
+ }
3551
+ });
3552
+ }
3553
+ patchProduct() {
3554
+ this.isUpdate = true;
3555
+ let data = { ...this.product() };
3556
+ if (this.product()?.categories?.length > 0) data.category_ids = this.product().categories.map((category) => category?.id);
3557
+ if (data?.initial_quantity_date) data.initial_quantity_date = moment(data.initial_quantity_date).toISOString();
3558
+ this.form.patchValue(data);
3559
+ }
3560
+ async save() {
3561
+ this.form.markAllAsTouched();
3562
+ if (this.form.invalid) {
3563
+ this.alertService.addAlert("Please Fill All Required Fields", "warn");
3564
+ return;
3565
+ }
3566
+ let product = this.form.value;
3567
+ if (product.maximum_price <= 0 || !product.maximum_price) product.maximum_price = product.minimum_price;
3568
+ if (product?.initial_quantity_date) product.initial_quantity_date = moment(product.initial_quantity_date).format("YYYY-MM-DD");
3569
+ this.isWorking = true;
3570
+ (product.id ? this.service.update(product) : this.service.store(product)).subscribe({
3571
+ next: () => {
3572
+ this.isWorking = false;
3573
+ this.alertService.addAlert("Product saved successfully!", "success");
3574
+ },
3575
+ error: () => this.isWorking = false,
3576
+ complete: () => {
3577
+ if (this.isCreateAnother.value && !this.isUpdate) this.savedCount++;
3578
+ else this.router.navigate(["/inventory/products"]);
3579
+ }
3580
+ });
3581
+ }
3582
+ isFormFieldShown(fieldName) {
3583
+ return this.displayedFormFields.length > 0 && this.displayedFormFields.includes(fieldName);
3584
+ }
3585
+ isFormSectionShown(sectionName) {
3586
+ return this.displayedFormSections.length > 0 && this.displayedFormSections.includes(sectionName);
3587
+ }
3588
+ async fileChanged(event) {
3589
+ this.fileList = event;
3590
+ if (this.fileList.length > 0) {
3591
+ const result = await this.fileService.uploadEntityFile(this.fileList[0], {
3592
+ entity_id: this.product()?.id,
3593
+ entity_type: "product",
3594
+ sub_path: `${this.product()?.id}`
3595
+ });
3596
+ this.form.get("image_file")?.setValue(result.item.file);
3597
+ this.form.get("image_file_url")?.setValue(result.item.url);
3598
+ this.fileList = [];
3599
+ }
3600
+ }
3601
+ async removeFile() {
3602
+ if (this.form.value.image_file) try {
3603
+ this.form.patchValue({
3604
+ image_file: "",
3605
+ image_file_url: ""
3606
+ });
3607
+ } catch (error) {
3608
+ this.alertService.addAlert("Unable to remove file, try later", "warn");
3609
+ }
3610
+ }
3611
+ static ɵfac = i0.ɵɵngDeclareFactory({
3612
+ minVersion: "12.0.0",
3613
+ version: "22.2.5",
3614
+ ngImport: i0,
3615
+ type: ProductFormComponent,
3616
+ deps: [
3617
+ { token: i1.EntityFileService },
3618
+ { token: i2.FormBuilder },
3619
+ { token: i1.FormValidatorService },
3620
+ { token: ProductService },
3621
+ { token: i4$1.ActivatedRoute },
3622
+ { token: i1.ErrorHandlerService },
3623
+ { token: i19.Location },
3624
+ { token: i4$1.Router },
3625
+ { token: i1.FormConfigurationFormService }
3626
+ ],
3627
+ target: i0.ɵɵFactoryTarget.Component
3628
+ });
3629
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3630
+ minVersion: "17.0.0",
3631
+ version: "22.2.5",
3632
+ type: ProductFormComponent,
3633
+ isStandalone: false,
3634
+ selector: "app-product-form",
3635
+ inputs: {
3636
+ displayedFormFields: "displayedFormFields",
3637
+ displayedFormSections: "displayedFormSections"
3638
+ },
3639
+ usesInheritance: true,
3640
+ ngImport: i0,
3641
+ template: "@if (isFormSetup()) {\n<div class=\"d-flex flex-column gap-2\">\n <mat-card class='container'>\n <mat-card-content>\n <div class=\"d-flex justify-content-between align-items-center\">\n <span></span>\n <h3 class=\"text-center m-0\">Product Form</h3>\n <app-form-configuration-for-form formCode='product'></app-form-configuration-for-form>\n </div>\n </mat-card-content>\n </mat-card>\n <mat-card class='container'>\n <mat-card-content>\n <form [formGroup]=\"form\" (submit)=\"save()\">\n <div class=\"d-flex flex-column\">\n\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n @if (form.get('image_file')?.value) {\n <div\n style=\"width: 200px\"\n class=\"justify-content-center align-items-center\"\n >\n <app-document-viewer\n (remove)=\"removeFile()\"\n [config]=\"viewerConfig\"\n [fileUrl]=\"\n $safeNavigationMigration(form.get('image_file_url')?.value)\n \"\n [file]=\"$safeNavigationMigration(form.get('image_file')?.value)\"\n >\n </app-document-viewer>\n </div>\n } @else {\n <div class=\"w-100\">\n <app-file-dropper (fileChanged)=\"fileChanged($event)\" [config]=\"fileConfig\" [fileArray]=\"fileList\">\n </app-file-dropper>\n </div>\n }\n </div>\n\n @if (isFormSectionShown('basic information')) {\n <div class=\"d-flex flex-column mt-2\">\n <h6>Basic Information</h6>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('name')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Name</mat-label>\n <input matInput placeholder=\"Name\" formControlName=\"name\" required />\n @if (isFieldValid('name')) {\n <mat-error>{{ getErrorMessage('name') }} </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('product type')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Product Type</mat-label>\n <app-searchable-selector apiUrl=\"api/product-types\" formControlName=\"type_id\">\n </app-searchable-selector>\n @if (isFieldValid('type_id')) {\n <mat-error>{{ getErrorMessage('type_id') }} </mat-error>\n }\n </mat-form-field>\n }\n </div>\n\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('sku')) {\n <mat-form-field class=\"w-50\">\n <mat-label>SKU</mat-label>\n <input matInput placeholder=\"SKU\" formControlName=\"sku\" />\n @if (isFieldValid('sku')) {\n <mat-error>{{ getErrorMessage('sku') }} </mat-error>\n }\n </mat-form-field>\n }\n <mat-form-field class=\"w-50\">\n <mat-label>Category</mat-label>\n <app-searchable-selector apiUrl=\"api/product-categories\" formControlName=\"category_ids\"\n [multiple]=\"true\">\n </app-searchable-selector>\n @if (isFieldValid('category_ids')) {\n <mat-error>\n {{ getErrorMessage('category_ids') }}\n </mat-error>\n }\n </mat-form-field>\n </div>\n\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('color') &&\n formConfigurationUtilityService.getFieldEnabled('color_id')) {\n <mat-form-field class=\"w-50 align-self-start\">\n <mat-label>\n Color @if\n (formConfigurationUtilityService.getFieldRequired('color_id'))\n {\n <sup>*</sup>\n }\n </mat-label>\n <app-searchable-selector apiUrl=\"api/attributes?type_code=color\"\n formControlName=\"color_id\"></app-searchable-selector>\n @if (isFieldValid('color_id')) {\n <mat-error>{{getErrorMessage('color_id')}}</mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('description')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Description</mat-label>\n <textarea matInput placeholder=\"Description\" formControlName=\"description\"></textarea>\n </mat-form-field>\n }\n </div>\n </div>\n } @if (isFormSectionShown('inventory information')) {\n <div class=\"d-flex flex-column\">\n <h6>Inventory Information</h6>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('product measure')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Measure</mat-label>\n <app-searchable-selector apiUrl=\"api/product-measures\" formControlName=\"measure_id\">\n </app-searchable-selector>\n @if (isFieldValid('measure_id')) {\n <mat-error>{{ getErrorMessage('measure_id') }} </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('reorder point')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Reorder Point</mat-label>\n <input matInput placeholder=\"Reorder Point\" formControlName=\"reorder_point\" type=\"number\" />\n @if (isFieldValid('reorder_point')) {\n <mat-error>{{ getErrorMessage('reorder_point') }} </mat-error>\n }\n </mat-form-field>\n }\n </div>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('initial quantity')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Initial Quantity</mat-label>\n <input matInput placeholder=\"Initial Quantity\" formControlName=\"initial_quantity\" />\n @if (isFieldValid('initial_quantity')) {\n <mat-error>{{ getErrorMessage('initial_quantity') }}\n </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('initial quantity date')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Initial Quantity Date</mat-label>\n <input matInput [matDatepicker]=\"pickerInitialQuantityDate\" placeholder=\"Initial Quantity Date\"\n formControlName=\"initial_quantity_date\" />\n <mat-datepicker-toggle matSuffix [for]=\"pickerInitialQuantityDate\"></mat-datepicker-toggle>\n <mat-datepicker #pickerInitialQuantityDate></mat-datepicker>\n @if (isFieldValid('initial_quantity_date')) {\n <mat-error>{{ getErrorMessage('initial_quantity_date') }}\n </mat-error>\n }\n </mat-form-field>\n }\n </div>\n </div>\n } @if (isFormSectionShown('sales information')) {\n <div class=\"d-flex flex-column\">\n <h6>Sale Information</h6>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('sales price')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Selling Price</mat-label>\n <input matInput placeholder=\"Selling Price\" formControlName=\"sale_price\" required type=\"number\"\n step=\"any\" />\n @if (isFieldValid('sale_price')) {\n <mat-error>{{ getErrorMessage('sale_price') }} </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('condition types')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Condition</mat-label>\n <app-searchable-selector apiUrl=\"api/condition-types\"\n formControlName=\"condition_type_id\"></app-searchable-selector>\n </mat-form-field>\n }\n </div>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('minimum price')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Minimum Price</mat-label>\n <input matInput placeholder=\"Minimum Price\" formControlName=\"minimum_price\" required type=\"number\"\n step=\"any\" />\n @if (isFieldValid('minimum_price')) {\n <mat-error>{{ getErrorMessage('minimum_price') }} </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('maximum price')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Maximum Price</mat-label>\n <input matInput placeholder=\"Maximum Price\" formControlName=\"maximum_price\" type=\"number\" step=\"any\" />\n </mat-form-field>\n }\n </div>\n </div>\n }\n\n <div class=\"w-100 d-flex justify-content-between\">\n @if (!isUpdate) {\n <mat-checkbox [formControl]=\"isCreateAnother\">Create Another @if (savedCount > 0) {\n <span>({{ savedCount }} items saved)</span>\n }\n </mat-checkbox>\n } @else {\n <span class='d-flex flex-grow'></span>\n }\n\n <div class=\"d-flex flex-row gap-3 align-items-center justify-content-end\">\n <button [disabled]=\"isWorking\" mat-button class=\"mt-2\" type=\"button\" (click)=\"location.back()\">\n Cancel\n </button>\n <button [disabled]=\"isWorking\" mat-raised-button color=\"primary\" class=\"mt-2\" type=\"submit\">Save</button>\n </div>\n </div>\n </div>\n </form>\n </mat-card-content>\n </mat-card>\n</div>\n} @else {\n<mat-card-content class=\"d-flex vh-100 justify-content-center align-items-center\">\n <mat-spinner></mat-spinner>\n</mat-card-content>\n}",
3642
+ dependencies: [
3643
+ {
3644
+ kind: "component",
3645
+ type: i1.FormConfigurationForFormComponent,
3646
+ selector: "app-form-configuration-for-form",
3647
+ inputs: ["formCode"]
3648
+ },
3649
+ {
3650
+ kind: "component",
3651
+ type: i6$2.MatButton,
3652
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
3653
+ inputs: ["matButton"],
3654
+ exportAs: ["matButton", "matAnchor"]
3655
+ },
3656
+ {
3657
+ kind: "component",
3658
+ type: i7.MatCard,
3659
+ selector: "mat-card",
3660
+ inputs: ["appearance"],
3661
+ exportAs: ["matCard"]
3662
+ },
3663
+ {
3664
+ kind: "directive",
3665
+ type: i7.MatCardContent,
3666
+ selector: "mat-card-content"
3667
+ },
3668
+ {
3669
+ kind: "component",
3670
+ type: i8.MatCheckbox,
3671
+ selector: "mat-checkbox",
3672
+ inputs: [
3673
+ "aria-label",
3674
+ "aria-labelledby",
3675
+ "aria-describedby",
3676
+ "aria-expanded",
3677
+ "aria-controls",
3678
+ "aria-owns",
3679
+ "id",
3680
+ "required",
3681
+ "labelPosition",
3682
+ "name",
3683
+ "value",
3684
+ "disableRipple",
3685
+ "tabIndex",
3686
+ "color",
3687
+ "disabledInteractive",
3688
+ "checked",
3689
+ "disabled",
3690
+ "indeterminate"
3691
+ ],
3692
+ outputs: ["change", "indeterminateChange"],
3693
+ exportAs: ["matCheckbox"]
3694
+ },
3695
+ {
3696
+ kind: "component",
3697
+ type: i9.MatDatepicker,
3698
+ selector: "mat-datepicker",
3699
+ exportAs: ["matDatepicker"]
3700
+ },
3701
+ {
3702
+ kind: "directive",
3703
+ type: i9.MatDatepickerInput,
3704
+ selector: "input[matDatepicker]",
3705
+ inputs: [
3706
+ "matDatepicker",
3707
+ "min",
3708
+ "max",
3709
+ "matDatepickerFilter"
3710
+ ],
3711
+ exportAs: ["matDatepickerInput"]
3712
+ },
3713
+ {
3714
+ kind: "component",
3715
+ type: i9.MatDatepickerToggle,
3716
+ selector: "mat-datepicker-toggle",
3717
+ inputs: [
3718
+ "for",
3719
+ "tabIndex",
3720
+ "aria-label",
3721
+ "disabled",
3722
+ "disableRipple"
3723
+ ],
3724
+ exportAs: ["matDatepickerToggle"]
3725
+ },
3726
+ {
3727
+ kind: "component",
3728
+ type: i7$2.MatFormField,
3729
+ selector: "mat-form-field",
3730
+ inputs: [
3731
+ "hideRequiredMarker",
3732
+ "color",
3733
+ "floatLabel",
3734
+ "appearance",
3735
+ "subscriptSizing",
3736
+ "hintLabel"
3737
+ ],
3738
+ exportAs: ["matFormField"]
3739
+ },
3740
+ {
3741
+ kind: "directive",
3742
+ type: i7$2.MatLabel,
3743
+ selector: "mat-label"
3744
+ },
3745
+ {
3746
+ kind: "directive",
3747
+ type: i7$2.MatError,
3748
+ selector: "mat-error, [matError]",
3749
+ inputs: ["id"]
3750
+ },
3751
+ {
3752
+ kind: "directive",
3753
+ type: i7$2.MatSuffix,
3754
+ selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
3755
+ inputs: ["matTextSuffix"]
3756
+ },
3757
+ {
3758
+ kind: "directive",
3759
+ type: i8$1.MatInput,
3760
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
3761
+ inputs: [
3762
+ "disabled",
3763
+ "id",
3764
+ "placeholder",
3765
+ "name",
3766
+ "required",
3767
+ "type",
3768
+ "errorStateMatcher",
3769
+ "aria-describedby",
3770
+ "value",
3771
+ "readonly",
3772
+ "disabledInteractive"
3773
+ ],
3774
+ exportAs: ["matInput"]
3775
+ },
3776
+ {
3777
+ kind: "component",
3778
+ type: i12.MatProgressSpinner,
3779
+ selector: "mat-progress-spinner, mat-spinner",
3780
+ inputs: [
3781
+ "color",
3782
+ "mode",
3783
+ "value",
3784
+ "diameter",
3785
+ "strokeWidth"
3786
+ ],
3787
+ exportAs: ["matProgressSpinner"]
3788
+ },
3789
+ {
3790
+ kind: "directive",
3791
+ type: i2.ɵNgNoValidate,
3792
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
3793
+ },
3794
+ {
3795
+ kind: "directive",
3796
+ type: i2.DefaultValueAccessor,
3797
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
3798
+ },
3799
+ {
3800
+ kind: "directive",
3801
+ type: i2.NumberValueAccessor,
3802
+ selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
3803
+ },
3804
+ {
3805
+ kind: "directive",
3806
+ type: i2.NgControlStatus,
3807
+ selector: "[formControlName],[ngModel],[formControl]"
3808
+ },
3809
+ {
3810
+ kind: "directive",
3811
+ type: i2.NgControlStatusGroup,
3812
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
3813
+ },
3814
+ {
3815
+ kind: "directive",
3816
+ type: i2.RequiredValidator,
3817
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
3818
+ inputs: ["required"]
3819
+ },
3820
+ {
3821
+ kind: "directive",
3822
+ type: i2.FormControlDirective,
3823
+ selector: "[formControl]",
3824
+ inputs: [
3825
+ "formControl",
3826
+ "disabled",
3827
+ "ngModel"
3828
+ ],
3829
+ outputs: ["ngModelChange"],
3830
+ exportAs: ["ngForm"]
3831
+ },
3832
+ {
3833
+ kind: "directive",
3834
+ type: i2.FormGroupDirective,
3835
+ selector: "[formGroup]",
3836
+ inputs: ["formGroup"],
3837
+ outputs: ["ngSubmit"],
3838
+ exportAs: ["ngForm"]
3839
+ },
3840
+ {
3841
+ kind: "directive",
3842
+ type: i2.FormControlName,
3843
+ selector: "[formControlName]",
3844
+ inputs: [
3845
+ "formControlName",
3846
+ "disabled",
3847
+ "ngModel"
3848
+ ],
3849
+ outputs: ["ngModelChange"]
3850
+ },
3851
+ {
3852
+ kind: "component",
3853
+ type: i1.SearchableSelectorComponent,
3854
+ selector: "app-searchable-selector",
3855
+ inputs: [
3856
+ "valueField",
3857
+ "titleField",
3858
+ "subtitleField",
3859
+ "apiUrl",
3860
+ "multiple",
3861
+ "selectedValue",
3862
+ "enableSearch",
3863
+ "add",
3864
+ "addConfig",
3865
+ "edit",
3866
+ "editConfig",
3867
+ "sort",
3868
+ "sortBy",
3869
+ "searchField",
3870
+ "itemComponent",
3871
+ "items",
3872
+ "apiDataProperty",
3873
+ "cache",
3874
+ "perPage",
3875
+ "inDataSearch",
3876
+ "panelWidth",
3877
+ "focusSearchOnOpen",
3878
+ "isEmitInitialEvent",
3879
+ "required",
3880
+ "disabled",
3881
+ "value"
3882
+ ],
3883
+ outputs: [
3884
+ "selectedValueChange",
3885
+ "selectionChange",
3886
+ "itemsChange",
3887
+ "isItemsEmpty"
3888
+ ]
3889
+ },
3890
+ {
3891
+ kind: "component",
3892
+ type: i1.FileDropperComponent,
3893
+ selector: "app-file-dropper",
3894
+ inputs: [
3895
+ "fileArray",
3896
+ "config",
3897
+ "styles"
3898
+ ],
3899
+ outputs: ["fileChanged"]
3900
+ },
3901
+ {
3902
+ kind: "component",
3903
+ type: i1.DocumentViewerComponent,
3904
+ selector: "app-document-viewer",
3905
+ inputs: [
3906
+ "config",
3907
+ "file",
3908
+ "fileUrl",
3909
+ "disableEdit"
3910
+ ],
3911
+ outputs: ["remove"]
3912
+ }
3913
+ ],
3914
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
3915
+ preserveWhitespaces: true
3916
+ });
3917
+ };
3918
+ i0.ɵɵngDeclareClassMetadata({
3919
+ minVersion: "12.0.0",
3920
+ version: "22.2.5",
3921
+ ngImport: i0,
3922
+ type: ProductFormComponent,
3923
+ decorators: [{
3924
+ type: Component,
3925
+ args: [{
3926
+ selector: "app-product-form",
3927
+ changeDetection: ChangeDetectionStrategy.Eager,
3928
+ standalone: false,
3929
+ template: "@if (isFormSetup()) {\n<div class=\"d-flex flex-column gap-2\">\n <mat-card class='container'>\n <mat-card-content>\n <div class=\"d-flex justify-content-between align-items-center\">\n <span></span>\n <h3 class=\"text-center m-0\">Product Form</h3>\n <app-form-configuration-for-form formCode='product'></app-form-configuration-for-form>\n </div>\n </mat-card-content>\n </mat-card>\n <mat-card class='container'>\n <mat-card-content>\n <form [formGroup]=\"form\" (submit)=\"save()\">\n <div class=\"d-flex flex-column\">\n\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n @if (form.get('image_file')?.value) {\n <div\n style=\"width: 200px\"\n class=\"justify-content-center align-items-center\"\n >\n <app-document-viewer\n (remove)=\"removeFile()\"\n [config]=\"viewerConfig\"\n [fileUrl]=\"\n $safeNavigationMigration(form.get('image_file_url')?.value)\n \"\n [file]=\"$safeNavigationMigration(form.get('image_file')?.value)\"\n >\n </app-document-viewer>\n </div>\n } @else {\n <div class=\"w-100\">\n <app-file-dropper (fileChanged)=\"fileChanged($event)\" [config]=\"fileConfig\" [fileArray]=\"fileList\">\n </app-file-dropper>\n </div>\n }\n </div>\n\n @if (isFormSectionShown('basic information')) {\n <div class=\"d-flex flex-column mt-2\">\n <h6>Basic Information</h6>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('name')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Name</mat-label>\n <input matInput placeholder=\"Name\" formControlName=\"name\" required />\n @if (isFieldValid('name')) {\n <mat-error>{{ getErrorMessage('name') }} </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('product type')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Product Type</mat-label>\n <app-searchable-selector apiUrl=\"api/product-types\" formControlName=\"type_id\">\n </app-searchable-selector>\n @if (isFieldValid('type_id')) {\n <mat-error>{{ getErrorMessage('type_id') }} </mat-error>\n }\n </mat-form-field>\n }\n </div>\n\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('sku')) {\n <mat-form-field class=\"w-50\">\n <mat-label>SKU</mat-label>\n <input matInput placeholder=\"SKU\" formControlName=\"sku\" />\n @if (isFieldValid('sku')) {\n <mat-error>{{ getErrorMessage('sku') }} </mat-error>\n }\n </mat-form-field>\n }\n <mat-form-field class=\"w-50\">\n <mat-label>Category</mat-label>\n <app-searchable-selector apiUrl=\"api/product-categories\" formControlName=\"category_ids\"\n [multiple]=\"true\">\n </app-searchable-selector>\n @if (isFieldValid('category_ids')) {\n <mat-error>\n {{ getErrorMessage('category_ids') }}\n </mat-error>\n }\n </mat-form-field>\n </div>\n\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('color') &&\n formConfigurationUtilityService.getFieldEnabled('color_id')) {\n <mat-form-field class=\"w-50 align-self-start\">\n <mat-label>\n Color @if\n (formConfigurationUtilityService.getFieldRequired('color_id'))\n {\n <sup>*</sup>\n }\n </mat-label>\n <app-searchable-selector apiUrl=\"api/attributes?type_code=color\"\n formControlName=\"color_id\"></app-searchable-selector>\n @if (isFieldValid('color_id')) {\n <mat-error>{{getErrorMessage('color_id')}}</mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('description')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Description</mat-label>\n <textarea matInput placeholder=\"Description\" formControlName=\"description\"></textarea>\n </mat-form-field>\n }\n </div>\n </div>\n } @if (isFormSectionShown('inventory information')) {\n <div class=\"d-flex flex-column\">\n <h6>Inventory Information</h6>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('product measure')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Measure</mat-label>\n <app-searchable-selector apiUrl=\"api/product-measures\" formControlName=\"measure_id\">\n </app-searchable-selector>\n @if (isFieldValid('measure_id')) {\n <mat-error>{{ getErrorMessage('measure_id') }} </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('reorder point')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Reorder Point</mat-label>\n <input matInput placeholder=\"Reorder Point\" formControlName=\"reorder_point\" type=\"number\" />\n @if (isFieldValid('reorder_point')) {\n <mat-error>{{ getErrorMessage('reorder_point') }} </mat-error>\n }\n </mat-form-field>\n }\n </div>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('initial quantity')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Initial Quantity</mat-label>\n <input matInput placeholder=\"Initial Quantity\" formControlName=\"initial_quantity\" />\n @if (isFieldValid('initial_quantity')) {\n <mat-error>{{ getErrorMessage('initial_quantity') }}\n </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('initial quantity date')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Initial Quantity Date</mat-label>\n <input matInput [matDatepicker]=\"pickerInitialQuantityDate\" placeholder=\"Initial Quantity Date\"\n formControlName=\"initial_quantity_date\" />\n <mat-datepicker-toggle matSuffix [for]=\"pickerInitialQuantityDate\"></mat-datepicker-toggle>\n <mat-datepicker #pickerInitialQuantityDate></mat-datepicker>\n @if (isFieldValid('initial_quantity_date')) {\n <mat-error>{{ getErrorMessage('initial_quantity_date') }}\n </mat-error>\n }\n </mat-form-field>\n }\n </div>\n </div>\n } @if (isFormSectionShown('sales information')) {\n <div class=\"d-flex flex-column\">\n <h6>Sale Information</h6>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('sales price')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Selling Price</mat-label>\n <input matInput placeholder=\"Selling Price\" formControlName=\"sale_price\" required type=\"number\"\n step=\"any\" />\n @if (isFieldValid('sale_price')) {\n <mat-error>{{ getErrorMessage('sale_price') }} </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('condition types')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Condition</mat-label>\n <app-searchable-selector apiUrl=\"api/condition-types\"\n formControlName=\"condition_type_id\"></app-searchable-selector>\n </mat-form-field>\n }\n </div>\n <div class=\"d-flex gap-2\">\n @if (isFormFieldShown('minimum price')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Minimum Price</mat-label>\n <input matInput placeholder=\"Minimum Price\" formControlName=\"minimum_price\" required type=\"number\"\n step=\"any\" />\n @if (isFieldValid('minimum_price')) {\n <mat-error>{{ getErrorMessage('minimum_price') }} </mat-error>\n }\n </mat-form-field>\n } @if (isFormFieldShown('maximum price')) {\n <mat-form-field class=\"w-50\">\n <mat-label>Maximum Price</mat-label>\n <input matInput placeholder=\"Maximum Price\" formControlName=\"maximum_price\" type=\"number\" step=\"any\" />\n </mat-form-field>\n }\n </div>\n </div>\n }\n\n <div class=\"w-100 d-flex justify-content-between\">\n @if (!isUpdate) {\n <mat-checkbox [formControl]=\"isCreateAnother\">Create Another @if (savedCount > 0) {\n <span>({{ savedCount }} items saved)</span>\n }\n </mat-checkbox>\n } @else {\n <span class='d-flex flex-grow'></span>\n }\n\n <div class=\"d-flex flex-row gap-3 align-items-center justify-content-end\">\n <button [disabled]=\"isWorking\" mat-button class=\"mt-2\" type=\"button\" (click)=\"location.back()\">\n Cancel\n </button>\n <button [disabled]=\"isWorking\" mat-raised-button color=\"primary\" class=\"mt-2\" type=\"submit\">Save</button>\n </div>\n </div>\n </div>\n </form>\n </mat-card-content>\n </mat-card>\n</div>\n} @else {\n<mat-card-content class=\"d-flex vh-100 justify-content-center align-items-center\">\n <mat-spinner></mat-spinner>\n</mat-card-content>\n}"
3930
+ }]
3931
+ }],
3932
+ ctorParameters: () => [
3933
+ { type: i1.EntityFileService },
3934
+ { type: i2.FormBuilder },
3935
+ { type: i1.FormValidatorService },
3936
+ { type: ProductService },
3937
+ { type: i4$1.ActivatedRoute },
3938
+ { type: i1.ErrorHandlerService },
3939
+ { type: i19.Location },
3940
+ { type: i4$1.Router },
3941
+ { type: i1.FormConfigurationFormService }
3942
+ ],
3943
+ propDecorators: {
3944
+ displayedFormFields: [{ type: Input }],
3945
+ displayedFormSections: [{ type: Input }]
3946
+ }
3947
+ });
3948
+ const routes = [{
3949
+ path: "",
3950
+ component: ProductNavBarComponent,
3951
+ children: [
3952
+ {
3953
+ path: "",
3954
+ component: ProductListComponent,
3955
+ canLoad: [AuthenticationGuard]
3956
+ },
3957
+ {
3958
+ path: "import",
3959
+ component: ProductImportPageComponent,
3960
+ canLoad: [AuthenticationGuard]
3961
+ },
3962
+ {
3963
+ path: "measure",
3964
+ component: ProductMeasuresListComponent,
3965
+ canLoad: [AuthenticationGuard]
3966
+ },
3967
+ {
3968
+ path: ":id/view",
3969
+ component: ProductViewPageComponent,
3970
+ canLoad: [AuthenticationGuard]
3971
+ },
3972
+ {
3973
+ path: "form/:id",
3974
+ component: ProductFormComponent,
3975
+ canLoad: [AuthenticationGuard]
3976
+ },
3977
+ {
3978
+ path: "form",
3979
+ component: ProductFormComponent,
3980
+ canLoad: [AuthenticationGuard]
3981
+ },
3982
+ {
3983
+ path: "**",
3984
+ redirectTo: "",
3985
+ pathMatch: "full",
3986
+ canLoad: [AuthenticationGuard]
3987
+ }
3988
+ ]
3989
+ }];
3990
+ var ProductRoutingModule = class ProductRoutingModule {
3991
+ static ɵfac = i0.ɵɵngDeclareFactory({
3992
+ minVersion: "12.0.0",
3993
+ version: "22.2.5",
3994
+ ngImport: i0,
3995
+ type: ProductRoutingModule,
3996
+ deps: [],
3997
+ target: i0.ɵɵFactoryTarget.NgModule
3998
+ });
3999
+ static ɵmod = i0.ɵɵngDeclareNgModule({
4000
+ minVersion: "14.0.0",
4001
+ version: "22.2.5",
4002
+ ngImport: i0,
4003
+ type: ProductRoutingModule,
4004
+ imports: [i4$1.RouterModule],
4005
+ exports: [RouterModule]
4006
+ });
4007
+ static ɵinj = i0.ɵɵngDeclareInjector({
4008
+ minVersion: "12.0.0",
4009
+ version: "22.2.5",
4010
+ ngImport: i0,
4011
+ type: ProductRoutingModule,
4012
+ imports: [RouterModule.forChild(routes), RouterModule]
4013
+ });
4014
+ };
4015
+ i0.ɵɵngDeclareClassMetadata({
4016
+ minVersion: "12.0.0",
4017
+ version: "22.2.5",
4018
+ ngImport: i0,
4019
+ type: ProductRoutingModule,
4020
+ decorators: [{
4021
+ type: NgModule,
4022
+ args: [{
4023
+ imports: [RouterModule.forChild(routes)],
4024
+ exports: [RouterModule]
4025
+ }]
4026
+ }]
4027
+ });
4028
+ var ProductDeleteButtonComponent = class ProductDeleteButtonComponent {
4029
+ matDialog;
4030
+ productService;
4031
+ alertService;
4032
+ product;
4033
+ deleted = new EventEmitter();
4034
+ isDeleting;
4035
+ constructor(matDialog, productService, alertService) {
4036
+ this.matDialog = matDialog;
4037
+ this.productService = productService;
4038
+ this.alertService = alertService;
4039
+ }
4040
+ deleteProduct() {
4041
+ this.isDeleting = true;
4042
+ this.productService.delete(this.product).subscribe({
4043
+ next: () => {
4044
+ this.deleted.emit();
4045
+ this.isDeleting = false;
4046
+ this.matDialog.closeAll();
4047
+ this.alertService.addAlert("Product deleted successfully!", "success");
4048
+ },
4049
+ error: () => this.isDeleting = false
4050
+ });
4051
+ }
4052
+ showDeleteDialog(templateRef) {
4053
+ this.matDialog.open(templateRef, { width: "500px" });
4054
+ }
4055
+ static ɵfac = i0.ɵɵngDeclareFactory({
4056
+ minVersion: "12.0.0",
4057
+ version: "22.2.5",
4058
+ ngImport: i0,
4059
+ type: ProductDeleteButtonComponent,
4060
+ deps: [
4061
+ { token: i3.MatDialog },
4062
+ { token: ProductService },
4063
+ { token: i1.AlertService }
4064
+ ],
4065
+ target: i0.ɵɵFactoryTarget.Component
4066
+ });
4067
+ static ɵcmp = i0.ɵɵngDeclareComponent({
4068
+ minVersion: "14.0.0",
4069
+ version: "22.2.5",
4070
+ type: ProductDeleteButtonComponent,
4071
+ isStandalone: false,
4072
+ selector: "app-product-delete-button",
4073
+ inputs: { product: "product" },
4074
+ outputs: { deleted: "deleted" },
4075
+ ngImport: i0,
4076
+ template: "<mat-icon class=\"cursor-pointer text-secondary\" (click)=\"showDeleteDialog(deleteProductDialog)\"> delete </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 [disabled]=\"isDeleting\" type=\"button\" mat-raised-button color=\"warn\" (click)=\"deleteProduct()\">\n Delete\n </button>\n <button [disabled]=\"isDeleting\" type=\"button\" mat-flat-button mat-dialog-close>Cancel</button>\n </div>\n</ng-template>\n",
4077
+ styles: [""],
4078
+ dependencies: [
4079
+ {
4080
+ kind: "component",
4081
+ type: i6$2.MatButton,
4082
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
4083
+ inputs: ["matButton"],
4084
+ exportAs: ["matButton", "matAnchor"]
4085
+ },
4086
+ {
4087
+ kind: "directive",
4088
+ type: i3.MatDialogClose,
4089
+ selector: "[mat-dialog-close], [matDialogClose]",
4090
+ inputs: [
4091
+ "aria-label",
4092
+ "type",
4093
+ "mat-dialog-close",
4094
+ "matDialogClose"
4095
+ ],
4096
+ exportAs: ["matDialogClose"]
4097
+ },
4098
+ {
4099
+ kind: "directive",
4100
+ type: i3.MatDialogTitle,
4101
+ selector: "[mat-dialog-title], [matDialogTitle]",
4102
+ inputs: ["id"],
4103
+ exportAs: ["matDialogTitle"]
4104
+ },
4105
+ {
4106
+ kind: "directive",
4107
+ type: i3.MatDialogActions,
4108
+ selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]",
4109
+ inputs: ["align"]
4110
+ },
4111
+ {
4112
+ kind: "directive",
4113
+ type: i3.MatDialogContent,
4114
+ selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]"
4115
+ },
4116
+ {
4117
+ kind: "component",
4118
+ type: i10.MatIcon,
4119
+ selector: "mat-icon",
4120
+ inputs: [
4121
+ "color",
4122
+ "inline",
4123
+ "svgIcon",
4124
+ "fontSet",
4125
+ "fontIcon"
4126
+ ],
4127
+ exportAs: ["matIcon"]
4128
+ }
4129
+ ],
4130
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
4131
+ preserveWhitespaces: true
4132
+ });
4133
+ };
4134
+ i0.ɵɵngDeclareClassMetadata({
4135
+ minVersion: "12.0.0",
4136
+ version: "22.2.5",
4137
+ ngImport: i0,
4138
+ type: ProductDeleteButtonComponent,
4139
+ decorators: [{
4140
+ type: Component,
4141
+ args: [{
4142
+ selector: "app-product-delete-button",
4143
+ changeDetection: ChangeDetectionStrategy.Eager,
4144
+ standalone: false,
4145
+ template: "<mat-icon class=\"cursor-pointer text-secondary\" (click)=\"showDeleteDialog(deleteProductDialog)\"> delete </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 [disabled]=\"isDeleting\" type=\"button\" mat-raised-button color=\"warn\" (click)=\"deleteProduct()\">\n Delete\n </button>\n <button [disabled]=\"isDeleting\" type=\"button\" mat-flat-button mat-dialog-close>Cancel</button>\n </div>\n</ng-template>\n"
4146
+ }]
4147
+ }],
4148
+ ctorParameters: () => [
4149
+ { type: i3.MatDialog },
4150
+ { type: ProductService },
4151
+ { type: i1.AlertService }
4152
+ ],
4153
+ propDecorators: {
4154
+ product: [{ type: Input }],
4155
+ deleted: [{ type: Output }]
4156
+ }
4157
+ });
4158
+ var product_module_exports = /* @__PURE__ */ __exportAll({ ProductModule: () => ProductModule });
4159
+ var ProductModule = class ProductModule {
4160
+ static ɵfac = i0.ɵɵngDeclareFactory({
4161
+ minVersion: "12.0.0",
4162
+ version: "22.2.5",
4163
+ ngImport: i0,
4164
+ type: ProductModule,
4165
+ deps: [],
4166
+ target: i0.ɵɵFactoryTarget.NgModule
4167
+ });
4168
+ static ɵmod = i0.ɵɵngDeclareNgModule({
4169
+ minVersion: "14.0.0",
4170
+ version: "22.2.5",
4171
+ ngImport: i0,
4172
+ type: ProductModule,
4173
+ declarations: [
4174
+ ProductListComponent,
4175
+ ProductFormComponent,
4176
+ ProductNavBarComponent,
4177
+ ProductMeasuresListComponent,
4178
+ ProductMeasureFormComponent,
4179
+ ProductViewPageComponent,
4180
+ ProductFormButtonComponent,
4181
+ ProductDeleteButtonComponent,
4182
+ ProductBasicInfoComponent,
4183
+ ProductImportPageComponent,
4184
+ ProductBatchUpdateFormComponent
4185
+ ],
4186
+ imports: [
4187
+ SharedModule,
4188
+ ProductRoutingModule,
4189
+ ImportCsvModule,
4190
+ StockReceiptsModule,
4191
+ StockIssuePageModule,
4192
+ FormsModule,
4193
+ ColumnSelectorModule,
4194
+ ProductLocationListComponent,
4195
+ StockTransferListComponent,
4196
+ ExportToExcelButtonComponent,
4197
+ QRCodeComponent,
4198
+ BarcodeComponent,
4199
+ FileDropperModule,
4200
+ DocumentViewerModule
4201
+ ],
4202
+ exports: [
4203
+ ProductFormComponent,
4204
+ ProductBasicInfoComponent,
4205
+ ProductFormButtonComponent,
4206
+ ProductBatchUpdateFormComponent
4207
+ ]
4208
+ });
4209
+ static ɵinj = i0.ɵɵngDeclareInjector({
4210
+ minVersion: "12.0.0",
4211
+ version: "22.2.5",
4212
+ ngImport: i0,
4213
+ type: ProductModule,
4214
+ imports: [
4215
+ SharedModule,
4216
+ ProductRoutingModule,
4217
+ ImportCsvModule,
4218
+ StockReceiptsModule,
4219
+ StockIssuePageModule,
4220
+ FormsModule,
4221
+ ColumnSelectorModule,
4222
+ ProductLocationListComponent,
4223
+ StockTransferListComponent,
4224
+ QRCodeComponent,
4225
+ FileDropperModule,
4226
+ DocumentViewerModule
4227
+ ]
4228
+ });
4229
+ };
4230
+ i0.ɵɵngDeclareClassMetadata({
4231
+ minVersion: "12.0.0",
4232
+ version: "22.2.5",
4233
+ ngImport: i0,
4234
+ type: ProductModule,
4235
+ decorators: [{
4236
+ type: NgModule,
4237
+ args: [{
4238
+ declarations: [
4239
+ ProductListComponent,
4240
+ ProductFormComponent,
4241
+ ProductNavBarComponent,
4242
+ ProductMeasuresListComponent,
4243
+ ProductMeasureFormComponent,
4244
+ ProductViewPageComponent,
4245
+ ProductFormButtonComponent,
4246
+ ProductDeleteButtonComponent,
4247
+ ProductBasicInfoComponent,
4248
+ ProductImportPageComponent,
4249
+ ProductBatchUpdateFormComponent
4250
+ ],
4251
+ imports: [
4252
+ SharedModule,
4253
+ ProductRoutingModule,
4254
+ ImportCsvModule,
4255
+ StockReceiptsModule,
4256
+ StockIssuePageModule,
4257
+ FormsModule,
4258
+ ColumnSelectorModule,
4259
+ ProductLocationListComponent,
4260
+ StockTransferListComponent,
4261
+ ExportToExcelButtonComponent,
4262
+ QRCodeComponent,
4263
+ BarcodeComponent,
4264
+ FileDropperModule,
4265
+ DocumentViewerModule
4266
+ ],
4267
+ exports: [
4268
+ ProductFormComponent,
4269
+ ProductBasicInfoComponent,
4270
+ ProductFormButtonComponent,
4271
+ ProductBatchUpdateFormComponent
4272
+ ]
4273
+ }]
4274
+ }]
4275
+ });
4276
+ export { ProductViewPageComponent as a, StockTransferListComponent as c, ProductListComponent as d, ProductBatchUpdateFormComponent as f, ProductService as h, ProductImportPageComponent as i, StockTransferFormComponent as l, ProductFormService as m, product_module_exports as n, ProductBasicInfoComponent as o, ProductFormButtonComponent as p, ProductFormComponent as r, StockSummaryService as s, ProductModule as t, StockTransferService as u };
4277
+
4278
+ //# sourceMappingURL=techlify-inventory-common-product.module-MZoVK3bN.mjs.map