@sdcorejs/angular 22.3.2 → 22.3.3

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 (253) hide show
  1. package/assets/THEME.md +58 -6
  2. package/assets/scss/core/form.scss +291 -3
  3. package/assets/scss/themes/_component-tokens.scss +35 -6
  4. package/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
  5. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  6. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
  7. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  8. package/fesm2022/sdcorejs-angular-components-section.mjs +15 -3
  9. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  10. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  11. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  12. package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
  13. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +398 -78
  14. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  15. package/fesm2022/sdcorejs-angular-components-table.mjs +460 -16
  16. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  17. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +932 -174
  18. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  19. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +7 -2
  20. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  21. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +5 -2
  22. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  23. package/fesm2022/sdcorejs-angular-forms-chip.mjs +437 -122
  24. package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
  25. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +4 -0
  26. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  27. package/fesm2022/sdcorejs-angular-forms-date.mjs +4 -0
  28. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  29. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +4 -0
  30. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  31. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +18 -2
  32. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  33. package/fesm2022/sdcorejs-angular-forms-input.mjs +4 -0
  34. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  35. package/fesm2022/sdcorejs-angular-forms-select.mjs +26 -20
  36. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  37. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +14 -1
  38. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  39. package/fesm2022/sdcorejs-angular-i18n.mjs +210 -0
  40. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  41. package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BrJfOTWy.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-SJIWI1dX.mjs} +3 -3
  42. package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BrJfOTWy.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-SJIWI1dX.mjs.map} +1 -1
  43. package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-DQYXx2nr.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-BPhMLVbv.mjs} +3 -3
  44. package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-DQYXx2nr.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-BPhMLVbv.mjs.map} +1 -1
  45. package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-Cjg3Dfq1.mjs → sdcorejs-angular-modules-generic-generic-list.page-aGhowe9Y.mjs} +3 -3
  46. package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-Cjg3Dfq1.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-aGhowe9Y.mjs.map} +1 -1
  47. package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DpXg2yI7.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-N8_oGpqD.mjs} +4 -4
  48. package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DpXg2yI7.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-N8_oGpqD.mjs.map} +1 -1
  49. package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
  50. package/fesm2022/sdcorejs-angular-modules-layout.mjs +289 -11
  51. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs +23 -0
  53. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map +1 -0
  54. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs +16 -0
  55. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map +1 -0
  56. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-Cfmr0L_5.mjs +51 -0
  57. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-Cfmr0L_5.mjs.map +1 -0
  58. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C7-itJqB.mjs +134 -0
  59. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C7-itJqB.mjs.map +1 -0
  60. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CxgmaNod.mjs +132 -0
  61. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CxgmaNod.mjs.map +1 -0
  62. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-C2GdGhkJ.mjs +100 -0
  63. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-C2GdGhkJ.mjs.map +1 -0
  64. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CzJh4LMR.mjs +119 -0
  65. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CzJh4LMR.mjs.map +1 -0
  66. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DIivNX4o.mjs +469 -0
  67. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DIivNX4o.mjs.map +1 -0
  68. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +18 -0
  69. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +1 -0
  70. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-B0nhFd_M.mjs +67 -0
  71. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-B0nhFd_M.mjs.map +1 -0
  72. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-D1dqsKX0.mjs +152 -0
  73. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-D1dqsKX0.mjs.map +1 -0
  74. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-Dkmm0a2Y.mjs +479 -0
  75. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-Dkmm0a2Y.mjs.map +1 -0
  76. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-WK0AcxNJ.mjs +175 -0
  77. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-WK0AcxNJ.mjs.map +1 -0
  78. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-yJ5fPyYU.mjs +92 -0
  79. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-yJ5fPyYU.mjs.map +1 -0
  80. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-BvhEMUgY.mjs +533 -0
  81. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-BvhEMUgY.mjs.map +1 -0
  82. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-Ydotvlyc.mjs +64 -0
  83. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-Ydotvlyc.mjs.map +1 -0
  84. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-D8-WXUAE.mjs +92 -0
  85. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-D8-WXUAE.mjs.map +1 -0
  86. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DHTxzjRN.mjs +242 -0
  87. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DHTxzjRN.mjs.map +1 -0
  88. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-cxNRkeRU.mjs +179 -0
  89. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-cxNRkeRU.mjs.map +1 -0
  90. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-CTgHdGeQ.mjs +72 -0
  91. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-CTgHdGeQ.mjs.map +1 -0
  92. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-D1zWXyN6.mjs +100 -0
  93. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-D1zWXyN6.mjs.map +1 -0
  94. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BK__9Mzb.mjs +541 -0
  95. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BK__9Mzb.mjs.map +1 -0
  96. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-1Xn1WaAP.mjs +647 -0
  97. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-1Xn1WaAP.mjs.map +1 -0
  98. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B6Ndq542.mjs +120 -0
  99. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B6Ndq542.mjs.map +1 -0
  100. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Bv_l7vnz.mjs +73 -0
  101. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Bv_l7vnz.mjs.map +1 -0
  102. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CaXgC8wK.mjs +172 -0
  103. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CaXgC8wK.mjs.map +1 -0
  104. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-ChwTb4BU.mjs +118 -0
  105. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-ChwTb4BU.mjs.map +1 -0
  106. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DKK3NmbN.mjs +1069 -0
  107. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DKK3NmbN.mjs.map +1 -0
  108. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs +186 -0
  109. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +1 -0
  110. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs +97 -0
  111. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +1 -0
  112. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs +12 -0
  113. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs.map +1 -0
  114. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-GSlXwL2Z.mjs +49 -0
  115. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-GSlXwL2Z.mjs.map +1 -0
  116. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-DPBwMafn.mjs +301 -0
  117. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-DPBwMafn.mjs.map +1 -0
  118. package/fesm2022/sdcorejs-angular-modules-pattern-routes-1kifjm82.mjs +100 -0
  119. package/fesm2022/sdcorejs-angular-modules-pattern-routes-1kifjm82.mjs.map +1 -0
  120. package/fesm2022/sdcorejs-angular-modules-pattern-routes-B6z9lJYB.mjs +45 -0
  121. package/fesm2022/sdcorejs-angular-modules-pattern-routes-B6z9lJYB.mjs.map +1 -0
  122. package/fesm2022/sdcorejs-angular-modules-pattern-routes-D1fsRfRB.mjs +66 -0
  123. package/fesm2022/sdcorejs-angular-modules-pattern-routes-D1fsRfRB.mjs.map +1 -0
  124. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DdCFCwxY.mjs +50 -0
  125. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DdCFCwxY.mjs.map +1 -0
  126. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DeThmv4f.mjs +74 -0
  127. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DeThmv4f.mjs.map +1 -0
  128. package/fesm2022/sdcorejs-angular-modules-pattern-routes-bQpdxKlY.mjs +166 -0
  129. package/fesm2022/sdcorejs-angular-modules-pattern-routes-bQpdxKlY.mjs.map +1 -0
  130. package/fesm2022/sdcorejs-angular-modules-pattern-routes-h66efEeH.mjs +74 -0
  131. package/fesm2022/sdcorejs-angular-modules-pattern-routes-h66efEeH.mjs.map +1 -0
  132. package/fesm2022/sdcorejs-angular-modules-pattern-routes-t3O2L2J5.mjs +43 -0
  133. package/fesm2022/sdcorejs-angular-modules-pattern-routes-t3O2L2J5.mjs.map +1 -0
  134. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-B6w4N6wo.mjs +413 -0
  135. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-B6w4N6wo.mjs.map +1 -0
  136. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-BIYHlzVQ.mjs +325 -0
  137. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-BIYHlzVQ.mjs.map +1 -0
  138. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DKgmhJT2.mjs +146 -0
  139. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DKgmhJT2.mjs.map +1 -0
  140. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-nnldn2cz.mjs +135 -0
  141. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-nnldn2cz.mjs.map +1 -0
  142. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-C0Bewuwz.mjs +129 -0
  143. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-C0Bewuwz.mjs.map +1 -0
  144. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Qlh3Lm2p.mjs +360 -0
  145. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Qlh3Lm2p.mjs.map +1 -0
  146. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-p9R5-eou.mjs +101 -0
  147. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-p9R5-eou.mjs.map +1 -0
  148. package/fesm2022/sdcorejs-angular-modules-pattern.mjs +2 -0
  149. package/fesm2022/sdcorejs-angular-modules-pattern.mjs.map +1 -0
  150. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +104 -4
  151. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
  152. package/modules/pattern/README.md +76 -0
  153. package/modules/pattern/docs/detail.md +237 -0
  154. package/modules/pattern/docs/drawer.md +484 -0
  155. package/modules/pattern/docs/flow.md +631 -0
  156. package/modules/pattern/docs/form.md +518 -0
  157. package/modules/pattern/docs/header-actions.md +342 -0
  158. package/modules/pattern/docs/list.md +247 -0
  159. package/modules/pattern/docs/relation.md +180 -0
  160. package/modules/pattern/docs/select.md +206 -0
  161. package/modules/pattern/docs/split.md +350 -0
  162. package/modules/pattern/docs/states.md +168 -0
  163. package/modules/pattern/features/approval/entity.resolver.ts +21 -0
  164. package/modules/pattern/features/approval/pages/detail/detail.component.ts +139 -0
  165. package/modules/pattern/features/approval/pages/list/approval-inbox.ts +7 -0
  166. package/modules/pattern/features/approval/pages/list/list.component.html +20 -0
  167. package/modules/pattern/features/approval/pages/list/list.component.ts +149 -0
  168. package/modules/pattern/features/approval/routes.ts +30 -0
  169. package/modules/pattern/features/approval/services/approval.model.ts +38 -0
  170. package/modules/pattern/features/approval/services/approval.service.ts +23 -0
  171. package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +123 -0
  172. package/modules/pattern/features/category/components/general-information-form/general-information-form.component.ts +61 -0
  173. package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +134 -0
  174. package/modules/pattern/features/category/entity.resolver.ts +27 -0
  175. package/modules/pattern/features/category/pages/list/list.component.html +20 -0
  176. package/modules/pattern/features/category/pages/list/list.component.ts +105 -0
  177. package/modules/pattern/features/category/routes.ts +42 -0
  178. package/modules/pattern/features/category/services/category.model.ts +39 -0
  179. package/modules/pattern/features/category/services/category.service.ts +36 -0
  180. package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +131 -0
  181. package/modules/pattern/features/customer/components/customer-select/customer-select.component.ts +72 -0
  182. package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.ts +30 -0
  183. package/modules/pattern/features/customer/components/debts-view/debts-view.component.ts +28 -0
  184. package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +106 -0
  185. package/modules/pattern/features/customer/components/documents-view/documents-view.component.ts +50 -0
  186. package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.ts +140 -0
  187. package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.ts +39 -0
  188. package/modules/pattern/features/customer/components/orders-view/orders-view.component.ts +35 -0
  189. package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +101 -0
  190. package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +127 -0
  191. package/modules/pattern/features/customer/entity.resolver.ts +21 -0
  192. package/modules/pattern/features/customer/pages/list/list.component.html +22 -0
  193. package/modules/pattern/features/customer/pages/list/list.component.ts +113 -0
  194. package/modules/pattern/features/customer/pages/profile/profile.component.ts +120 -0
  195. package/modules/pattern/features/customer/pipes/customer-detail.pipe.ts +18 -0
  196. package/modules/pattern/features/customer/routes.ts +59 -0
  197. package/modules/pattern/features/customer/services/customer.model.ts +87 -0
  198. package/modules/pattern/features/customer/services/customer.service.ts +79 -0
  199. package/modules/pattern/features/import/components/mapping-form/mapping-form.component.ts +41 -0
  200. package/modules/pattern/features/import/components/preview-view/preview-view.component.ts +44 -0
  201. package/modules/pattern/features/import/pages/flow/flow.component.ts +269 -0
  202. package/modules/pattern/features/import/routes.ts +19 -0
  203. package/modules/pattern/features/import/services/import.model.ts +82 -0
  204. package/modules/pattern/features/import/services/import.service.ts +18 -0
  205. package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +74 -0
  206. package/modules/pattern/features/order/components/bulk-result/bulk-result.component.ts +46 -0
  207. package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +96 -0
  208. package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +205 -0
  209. package/modules/pattern/features/order/components/lines-view/lines-view.component.ts +42 -0
  210. package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +128 -0
  211. package/modules/pattern/features/order/entity.resolver.ts +37 -0
  212. package/modules/pattern/features/order/pages/create/create.component.ts +99 -0
  213. package/modules/pattern/features/order/pages/detail/detail.component.ts +222 -0
  214. package/modules/pattern/features/order/pages/list/list.component.html +38 -0
  215. package/modules/pattern/features/order/pages/list/list.component.ts +291 -0
  216. package/modules/pattern/features/order/pages/update/update.component.ts +119 -0
  217. package/modules/pattern/features/order/routes.ts +54 -0
  218. package/modules/pattern/features/order/services/order.model.ts +109 -0
  219. package/modules/pattern/features/order/services/order.service.ts +63 -0
  220. package/modules/pattern/features/partner/pages/create/create.component.ts +324 -0
  221. package/modules/pattern/features/partner/routes.ts +20 -0
  222. package/modules/pattern/features/partner/services/partner.model.ts +30 -0
  223. package/modules/pattern/features/partner/services/partner.service.ts +17 -0
  224. package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +88 -0
  225. package/modules/pattern/features/product/components/product-select/product-select.component.ts +65 -0
  226. package/modules/pattern/features/product/components/product-status-select/product-status-select.component.ts +30 -0
  227. package/modules/pattern/features/product/entity.resolver.ts +21 -0
  228. package/modules/pattern/features/product/pages/create/create.component.ts +85 -0
  229. package/modules/pattern/features/product/pages/detail/detail.component.ts +53 -0
  230. package/modules/pattern/features/product/pages/list/list.component.html +30 -0
  231. package/modules/pattern/features/product/pages/list/list.component.ts +71 -0
  232. package/modules/pattern/features/product/pages/update/update.component.ts +86 -0
  233. package/modules/pattern/features/product/pipes/product-detail.pipe.ts +18 -0
  234. package/modules/pattern/features/product/routes.ts +48 -0
  235. package/modules/pattern/features/product/services/product.model.ts +38 -0
  236. package/modules/pattern/features/product/services/product.service.ts +48 -0
  237. package/modules/pattern/features/settings/pages/update/update.component.ts +227 -0
  238. package/modules/pattern/features/settings/routes.ts +24 -0
  239. package/modules/pattern/features/settings/services/settings.model.ts +18 -0
  240. package/modules/pattern/features/settings/services/settings.service.ts +15 -0
  241. package/modules/pattern/features/settings/settings.resolver.ts +8 -0
  242. package/package.json +5 -1
  243. package/types/sdcorejs-angular-components-badge.d.ts +19 -1
  244. package/types/sdcorejs-angular-components-section.d.ts +13 -1
  245. package/types/sdcorejs-angular-components-splitter.d.ts +1 -1
  246. package/types/sdcorejs-angular-components-tab-router.d.ts +47 -5
  247. package/types/sdcorejs-angular-components-table.d.ts +127 -13
  248. package/types/sdcorejs-angular-components-upload-file.d.ts +181 -21
  249. package/types/sdcorejs-angular-forms-chip.d.ts +136 -26
  250. package/types/sdcorejs-angular-i18n.d.ts +42 -0
  251. package/types/sdcorejs-angular-modules-layout.d.ts +89 -6
  252. package/types/sdcorejs-angular-modules-pattern.d.ts +50 -0
  253. package/types/sdcorejs-angular-services-unsaved-changes.d.ts +11 -0
@@ -0,0 +1,120 @@
1
+ import { ChangeDetectionStrategy, Component, computed, inject, linkedSignal, untracked } from '@angular/core';
2
+ import { toSignal } from '@angular/core/rxjs-interop';
3
+ import { ActivatedRoute, Router, RouterLink } from '@angular/router';
4
+ import { map } from 'rxjs';
5
+ import { SdButton } from '@sdcorejs/angular/components/button';
6
+ import { SdTab, SdTabGroup } from '@sdcorejs/angular/components/tab';
7
+ import { SdPageComponent } from '@sdcorejs/angular/modules/layout';
8
+ import { SdPermissionDirective } from '@sdcorejs/angular/modules/permission';
9
+ import { DebtsViewComponent } from '../../components/debts-view/debts-view.component';
10
+ import { DocumentsViewComponent } from '../../components/documents-view/documents-view.component';
11
+ import { GeneralInformationViewComponent } from '../../components/general-information-view/general-information-view.component';
12
+ import { OrdersViewComponent } from '../../components/orders-view/orders-view.component';
13
+ import { customerStatusBadge, customerTypeName, type CustomerDto } from '../../services/customer.model';
14
+
15
+ const TABS = [
16
+ { key: 'info', label: 'Thông tin' },
17
+ { key: 'orders', label: 'Đơn hàng' },
18
+ { key: 'debts', label: 'Công nợ' },
19
+ { key: 'documents', label: 'Tài liệu' },
20
+ ] as const;
21
+ type TabKey = (typeof TABS)[number]['key'];
22
+
23
+ /**
24
+ * Hồ sơ 360° (`:id/360`): thông tin chung và các quan hệ của khách hàng theo tab. Tab ghi trên URL (`?tab=`);
25
+ * mở tab nào mới tải tab đó, mỗi tab tự có trạng thái đang tải, rỗng và lỗi.
26
+ */
27
+ @Component({
28
+ selector: 'profile',
29
+ standalone: true,
30
+ imports: [
31
+ RouterLink,
32
+ SdPageComponent,
33
+ SdButton,
34
+ SdTabGroup,
35
+ SdTab,
36
+ SdPermissionDirective,
37
+ GeneralInformationViewComponent,
38
+ OrdersViewComponent,
39
+ DebtsViewComponent,
40
+ DocumentsViewComponent,
41
+ ],
42
+ changeDetection: ChangeDetectionStrategy.OnPush,
43
+ template: `
44
+ @let customer = entity();
45
+ <sd-page-detail
46
+ [title]="'Hồ sơ khách hàng #' + customer.code"
47
+ [description]="customer.name + ' · ' + typeName()"
48
+ [badges]="badges()"
49
+ [backLink]="['../..']">
50
+ <sd-button
51
+ headerRight
52
+ *sdPermission="'PATTERN_CUSTOMER_U_UPDATE'"
53
+ title="Cập nhật khách hàng"
54
+ prefixIcon="edit"
55
+ type="fill"
56
+ color="primary"
57
+ autoId="customer-profile-update"
58
+ [routerLink]="['../update']" />
59
+ <sd-tab-group sdSubheader [selectedIndex]="tabIndex()" (selectedIndexChange)="selectTab($event)">
60
+ @for (tab of tabs; track tab.key) {
61
+ <sd-tab [label]="tab.label" />
62
+ }
63
+ </sd-tab-group>
64
+ <div class="py-16">
65
+ @for (tab of tabs; track tab.key; let index = $index) {
66
+ @if (opened().has(tab.key)) {
67
+ <div [hidden]="tabIndex() !== index" [attr.data-customer-tab]="tab.key">
68
+ @switch (tab.key) {
69
+ @case ('info') {
70
+ <general-information-view [customer]="customer" />
71
+ }
72
+ @case ('orders') {
73
+ <orders-view [customerId]="customer.id" />
74
+ }
75
+ @case ('debts') {
76
+ <debts-view [customerId]="customer.id" />
77
+ }
78
+ @case ('documents') {
79
+ <documents-view [customerId]="customer.id" />
80
+ }
81
+ }
82
+ </div>
83
+ }
84
+ }
85
+ </div>
86
+ </sd-page-detail>
87
+ `,
88
+ })
89
+ export class ProfileComponent {
90
+ readonly #router = inject(Router);
91
+ readonly #route = inject(ActivatedRoute);
92
+ protected readonly tabs = TABS;
93
+ protected readonly entity = toSignal(this.#route.data.pipe(map(data => data['entity'] as CustomerDto)), { requireSync: true });
94
+ protected readonly badges = computed(() => [customerStatusBadge(this.entity().status)]);
95
+ protected readonly typeName = computed(() => customerTypeName(this.entity().type));
96
+ readonly #tabParam = toSignal(this.#route.queryParamMap.pipe(map(params => params.get('tab'))), { requireSync: true });
97
+ protected readonly tabIndex = computed(() =>
98
+ Math.max(
99
+ 0,
100
+ TABS.findIndex(tab => tab.key === this.#tabParam())
101
+ )
102
+ );
103
+ /** Tab đã mở ít nhất một lần: giữ lại khi chuyển tab, không tải lại. Đổi khách hàng thì bắt đầu lại. */
104
+ protected readonly opened = linkedSignal<CustomerDto, ReadonlySet<TabKey>>({
105
+ source: this.entity,
106
+ // untracked: đổi tab không được đặt lại các tab đã mở; chỉ đổi khách hàng mới bắt đầu lại.
107
+ computation: () => new Set<TabKey>([TABS[untracked(this.tabIndex)].key]),
108
+ });
109
+
110
+ protected selectTab(index: number): void {
111
+ const key = TABS[index]?.key ?? 'info';
112
+ this.opened.update(opened => new Set([...opened, key]));
113
+ void this.#router.navigate([], {
114
+ relativeTo: this.#route,
115
+ queryParams: { tab: key === 'info' ? null : key },
116
+ queryParamsHandling: 'merge',
117
+ replaceUrl: true,
118
+ });
119
+ }
120
+ }
@@ -0,0 +1,18 @@
1
+ import { inject, Pipe, type PipeTransform } from '@angular/core';
2
+ import { of, type Observable } from 'rxjs';
3
+ import { CustomerService } from '../services/customer.service';
4
+ import type { CustomerDto } from '../services/customer.model';
5
+
6
+ /**
7
+ * Relation khách hàng theo ID: `@let customer = order.customerId | customerDetail | async;`.
8
+ * CustomerService cache và chia sẻ request theo ID; nơi dùng pipe phải có CustomerService trong injector.
9
+ */
10
+ @Pipe({ name: 'customerDetail', standalone: true })
11
+ export class CustomerDetailPipe implements PipeTransform {
12
+ readonly #customerService = inject(CustomerService);
13
+
14
+ transform(id: CustomerDto['id'] | null | undefined): Observable<CustomerDto | null> {
15
+ if (id === null || id === undefined || id === '') return of(null);
16
+ return this.#customerService.cachedDetail(id);
17
+ }
18
+ }
@@ -0,0 +1,59 @@
1
+ import type { Routes } from '@angular/router';
2
+ import { sdPageFormLeaveGuard } from '@sdcorejs/angular/modules/layout';
3
+ import { SdPermissionGuard } from '@sdcorejs/angular/modules/permission';
4
+ import { entityResolver } from './entity.resolver';
5
+ import { CustomerService } from './services/customer.service';
6
+
7
+ /**
8
+ * Chi tiết, tạo và cập nhật mở trong drawer (route con của danh sách); hồ sơ 360° là trang thay chỗ danh sách
9
+ * (`data.detail: 'page'`). Đóng drawer hay quay lại đều giữ bộ lọc, trang và vị trí cuộn của danh sách.
10
+ */
11
+ export const routes: Routes = [
12
+ {
13
+ path: '',
14
+ providers: [CustomerService],
15
+ canActivateChild: [SdPermissionGuard],
16
+ children: [
17
+ {
18
+ path: '',
19
+ title: 'Khách hàng',
20
+ data: { permission: 'PATTERN_CUSTOMER_R_LIST' },
21
+ loadComponent: () => import('./pages/list/list.component').then(module => module.ListComponent),
22
+ children: [
23
+ {
24
+ path: 'create',
25
+ data: { permission: 'PATTERN_CUSTOMER_C_CREATE' },
26
+ canDeactivate: [sdPageFormLeaveGuard],
27
+ loadComponent: () =>
28
+ import('./components/create-side-drawer/create-side-drawer.component').then(module => module.CreateSideDrawerComponent),
29
+ },
30
+ {
31
+ path: ':id/detail',
32
+ data: { permission: 'PATTERN_CUSTOMER_R_DETAIL' },
33
+ resolve: { entity: entityResolver },
34
+ runGuardsAndResolvers: 'paramsChange',
35
+ loadComponent: () =>
36
+ import('./components/detail-side-drawer/detail-side-drawer.component').then(module => module.DetailSideDrawerComponent),
37
+ },
38
+ {
39
+ path: ':id/update',
40
+ data: { permission: 'PATTERN_CUSTOMER_U_UPDATE' },
41
+ resolve: { entity: entityResolver },
42
+ runGuardsAndResolvers: 'paramsChange',
43
+ canDeactivate: [sdPageFormLeaveGuard],
44
+ loadComponent: () =>
45
+ import('./components/update-side-drawer/update-side-drawer.component').then(module => module.UpdateSideDrawerComponent),
46
+ },
47
+ {
48
+ path: ':id/360',
49
+ title: 'Hồ sơ khách hàng',
50
+ data: { permission: 'PATTERN_CUSTOMER_R_DETAIL', detail: 'page' },
51
+ resolve: { entity: entityResolver },
52
+ runGuardsAndResolvers: 'paramsChange',
53
+ loadComponent: () => import('./pages/profile/profile.component').then(module => module.ProfileComponent),
54
+ },
55
+ ],
56
+ },
57
+ ],
58
+ },
59
+ ];
@@ -0,0 +1,87 @@
1
+ import type { SdBadgeData } from '@sdcorejs/angular/components/badge';
2
+ import type { PagingReq, PagingRes } from '@sdcorejs/utils/models';
3
+
4
+ export type CustomerType = 'individual' | 'business';
5
+ export type CustomerTier = 'standard' | 'vip';
6
+ export type CustomerStatus = 'active' | 'inactive';
7
+
8
+ export const CUSTOMER_TYPE_OPTIONS = [
9
+ { id: 'individual', name: 'Cá nhân' },
10
+ { id: 'business', name: 'Doanh nghiệp' },
11
+ ] satisfies { id: CustomerType; name: string }[];
12
+
13
+ export const CUSTOMER_STATUS_OPTIONS = [
14
+ { id: 'active', name: 'Đang hoạt động', color: 'success' },
15
+ { id: 'inactive', name: 'Ngừng hoạt động', color: 'secondary' },
16
+ ] satisfies { id: CustomerStatus; name: string; color: SdBadgeData['color'] }[];
17
+
18
+ /** Nhóm khách của score card; `null` là tất cả. */
19
+ export type CustomerSegment = 'individual' | 'business' | 'vip';
20
+
21
+ export interface CustomerDto {
22
+ readonly id: string;
23
+ readonly code: string;
24
+ readonly name: string;
25
+ readonly type: CustomerType;
26
+ readonly tier: CustomerTier;
27
+ readonly email: string;
28
+ readonly phone: string;
29
+ readonly address: string;
30
+ readonly taxCode: string | null;
31
+ readonly status: CustomerStatus;
32
+ /** Công nợ hiện tại (₫). */
33
+ readonly debt: number;
34
+ readonly createdAt: string;
35
+ readonly note: string | null;
36
+ }
37
+
38
+ export type CustomerListReq = PagingReq<CustomerDto>;
39
+ export type CustomerListRes = PagingRes<CustomerDto>;
40
+
41
+ /** Số khách theo nhóm, cùng bộ lọc với danh sách (trừ nhóm đang chọn). */
42
+ export type CustomerCounts = Record<'all' | CustomerSegment, number>;
43
+
44
+ export interface CustomerSaveReq {
45
+ readonly name: string;
46
+ readonly type: CustomerType;
47
+ readonly tier: CustomerTier;
48
+ readonly email: string;
49
+ readonly phone: string;
50
+ readonly address: string;
51
+ readonly taxCode: string | null;
52
+ readonly status: CustomerStatus;
53
+ readonly note: string | null;
54
+ }
55
+
56
+ /** Dòng của tab Đơn hàng trong hồ sơ 360°. */
57
+ export interface CustomerOrderDto {
58
+ readonly id: string;
59
+ readonly code: string;
60
+ readonly createdAt: string;
61
+ readonly total: number;
62
+ readonly status: string;
63
+ }
64
+
65
+ /** Dòng của tab Công nợ. */
66
+ export interface CustomerDebtDto {
67
+ readonly id: string;
68
+ readonly orderCode: string;
69
+ readonly dueDate: string;
70
+ readonly amount: number;
71
+ }
72
+
73
+ /** Dòng của tab Tài liệu. */
74
+ export interface CustomerDocumentDto {
75
+ readonly id: string;
76
+ readonly name: string;
77
+ readonly size: number;
78
+ }
79
+
80
+ export function customerStatusBadge(status: CustomerStatus): SdBadgeData {
81
+ const option = CUSTOMER_STATUS_OPTIONS.find(item => item.id === status);
82
+ return { type: 'round', title: option?.name ?? status, color: option?.color };
83
+ }
84
+
85
+ export function customerTypeName(type: CustomerType): string {
86
+ return CUSTOMER_TYPE_OPTIONS.find(item => item.id === type)?.name ?? type;
87
+ }
@@ -0,0 +1,79 @@
1
+ import { HttpParams } from '@angular/common/http';
2
+ import { Injectable, signal } from '@angular/core';
3
+ import { shareReplay, tap, type Observable } from 'rxjs';
4
+ import type { Filter, PagingRes } from '@sdcorejs/utils/models';
5
+ import { BaseApiService } from '../../../services/base-api.service';
6
+ import type {
7
+ CustomerCounts,
8
+ CustomerDebtDto,
9
+ CustomerDocumentDto,
10
+ CustomerDto,
11
+ CustomerListReq,
12
+ CustomerListRes,
13
+ CustomerOrderDto,
14
+ CustomerSaveReq,
15
+ } from './customer.model';
16
+
17
+ @Injectable()
18
+ export class CustomerService extends BaseApiService {
19
+ readonly #details = new Map<string, Observable<CustomerDto>>();
20
+ readonly #changes = signal(0);
21
+ /** Tăng sau mỗi lần tạo, cập nhật hoặc xoá thành công: danh sách chỉ tải lại khi có thay đổi. */
22
+ readonly changes = this.#changes.asReadonly();
23
+
24
+ list(req: CustomerListReq): Observable<CustomerListRes> {
25
+ return this.http.get<CustomerListRes>(this.apiUrl('customers'), { params: this.buildPagingReq(req) });
26
+ }
27
+
28
+ /** Số khách theo nhóm cho score card, theo cùng bộ lọc của danh sách. */
29
+ counts(filters: Filter<CustomerDto>[]): Observable<CustomerCounts> {
30
+ return this.http.get<CustomerCounts>(this.apiUrl('customers', 'counts'), {
31
+ params: new HttpParams().set('filters', JSON.stringify(filters)),
32
+ });
33
+ }
34
+
35
+ detail(id: string): Observable<CustomerDto> {
36
+ return this.http.get<CustomerDto>(this.apiUrl('customers', id));
37
+ }
38
+
39
+ /** `detail(id)` có cache, cho relation (`customerDetail`) và giá trị đã chọn của `customer-select`. */
40
+ cachedDetail(id: string): Observable<CustomerDto> {
41
+ let detail = this.#details.get(id);
42
+ if (!detail) {
43
+ detail = this.detail(id).pipe(shareReplay({ bufferSize: 1, refCount: false }));
44
+ this.#details.set(id, detail);
45
+ // Lỗi tra cứu không được cache: lần gọi sau hỏi lại.
46
+ detail.subscribe({ error: () => this.#details.delete(id) });
47
+ }
48
+ return detail;
49
+ }
50
+
51
+ create(req: CustomerSaveReq): Observable<CustomerDto> {
52
+ return this.http.post<CustomerDto>(this.apiUrl('customers'), req).pipe(tap(() => this.#changed()));
53
+ }
54
+
55
+ update(id: string, req: CustomerSaveReq): Observable<CustomerDto> {
56
+ return this.http.put<CustomerDto>(this.apiUrl('customers', id), req).pipe(tap(() => this.#changed(id)));
57
+ }
58
+
59
+ delete(id: string): Observable<void> {
60
+ return this.http.delete<void>(this.apiUrl('customers', id)).pipe(tap(() => this.#changed(id)));
61
+ }
62
+
63
+ orders(id: string): Observable<PagingRes<CustomerOrderDto>> {
64
+ return this.http.get<PagingRes<CustomerOrderDto>>(this.apiUrl('customers', id, 'orders'));
65
+ }
66
+
67
+ debts(id: string): Observable<PagingRes<CustomerDebtDto>> {
68
+ return this.http.get<PagingRes<CustomerDebtDto>>(this.apiUrl('customers', id, 'debts'));
69
+ }
70
+
71
+ documents(id: string): Observable<PagingRes<CustomerDocumentDto>> {
72
+ return this.http.get<PagingRes<CustomerDocumentDto>>(this.apiUrl('customers', id, 'documents'));
73
+ }
74
+
75
+ #changed(id?: string): void {
76
+ if (id) this.#details.delete(id);
77
+ this.#changes.update(count => count + 1);
78
+ }
79
+ }
@@ -0,0 +1,41 @@
1
+ import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
2
+ import { SdSelect } from '@sdcorejs/angular/forms/select';
3
+ import { IMPORT_FIELDS, type ImportField, type ImportMapping } from '../../services/import.model';
4
+
5
+ /** Bước "Nhận diện & ánh xạ": chọn cột của nguồn cho từng field; mã và tên là bắt buộc. */
6
+ @Component({
7
+ selector: 'mapping-form',
8
+ standalone: true,
9
+ imports: [SdSelect],
10
+ changeDetection: ChangeDetectionStrategy.OnPush,
11
+ template: `
12
+ <div class="d-flex flex-column gap-8">
13
+ @for (item of fields; track item.field) {
14
+ <sd-select
15
+ [label]="item.label"
16
+ [items]="columns()"
17
+ valueField="value"
18
+ displayField="value"
19
+ [required]="item.required"
20
+ [autoId]="'import-map-' + item.field"
21
+ [model]="mapping()[item.field]"
22
+ [inlineError]="
23
+ item.required && showErrors() && !mapping()[item.field] ? 'Chọn cột cho ' + item.label.toLowerCase() + '.' : undefined
24
+ "
25
+ (modelChange)="change(item.field, $event)" />
26
+ }
27
+ </div>
28
+ `,
29
+ })
30
+ export class MappingFormComponent {
31
+ readonly sourceColumns = input.required<readonly string[]>();
32
+ readonly mapping = input.required<ImportMapping>();
33
+ readonly showErrors = input(false);
34
+ readonly mappingChange = output<ImportMapping>();
35
+ protected readonly fields = IMPORT_FIELDS;
36
+ protected readonly columns = computed(() => this.sourceColumns().map(value => ({ value })));
37
+
38
+ protected change(field: ImportField, value: unknown): void {
39
+ this.mappingChange.emit({ ...this.mapping(), [field]: typeof value === 'string' && value ? value : null });
40
+ }
41
+ }
@@ -0,0 +1,44 @@
1
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
2
+ import { SdTable, type SdTableOption } from '@sdcorejs/angular/components/table';
3
+ import type { ImportPreviewRowDto } from '../../services/import.model';
4
+
5
+ const RESULTS = [
6
+ { id: 'new', name: 'Thêm mới', color: 'success' },
7
+ { id: 'duplicate', name: 'Trùng mã', color: 'warning' },
8
+ { id: 'invalid', name: 'Lỗi', color: 'error' },
9
+ ] as const;
10
+
11
+ /** Bước "Xem trước & xung đột": từng dòng với kết quả kiểm tra của API. */
12
+ @Component({
13
+ selector: 'preview-view',
14
+ standalone: true,
15
+ imports: [SdTable],
16
+ changeDetection: ChangeDetectionStrategy.OnPush,
17
+ template: `<sd-table autoId="import-preview" [option]="option()" />`,
18
+ })
19
+ export class PreviewViewComponent {
20
+ readonly rows = input.required<readonly ImportPreviewRowDto[]>();
21
+ protected readonly option = computed<SdTableOption<ImportPreviewRowDto>>(() => {
22
+ const rows = [...this.rows()];
23
+ return {
24
+ type: 'local',
25
+ items: () => rows,
26
+ paginate: { pageSize: 50 },
27
+ filter: { hideInlineFilter: 'auto' },
28
+ columns: [
29
+ { field: 'code', title: 'Mã', type: 'string', width: '110px' },
30
+ { field: 'name', title: 'Tên sản phẩm', type: 'string', minWidth: '180px' },
31
+ { field: 'price', title: 'Giá bán (₫)', type: 'number', width: '120px', align: 'right' },
32
+ {
33
+ field: 'result',
34
+ title: 'Kết quả',
35
+ type: 'values',
36
+ width: '130px',
37
+ option: { items: [...RESULTS], valueField: 'id', displayField: 'name' },
38
+ useBadge: result => ({ type: 'round', color: RESULTS.find(item => item.id === result)?.color }),
39
+ },
40
+ { field: 'message', title: 'Ghi chú', type: 'string', minWidth: '160px' },
41
+ ],
42
+ };
43
+ });
44
+ }