@sdcorejs/angular 19.3.2 → 19.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 (399) 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/components/badge/index.d.ts +1 -0
  5. package/components/badge/src/badge.model.d.ts +19 -0
  6. package/components/section/index.d.ts +1 -0
  7. package/components/section/src/section-registry.d.ts +11 -0
  8. package/components/splitter/index.d.ts +1 -1
  9. package/components/tab-router/src/actions/tab-router.action.d.ts +1 -1
  10. package/components/tab-router/src/components/tab-router-item/tab-router-item.component.d.ts +4 -2
  11. package/components/tab-router/src/components/tab-router-nav/tab-router-nav.component.d.ts +31 -3
  12. package/components/tab-router/src/components/tab-router-outlet/tab-router-outlet.component.d.ts +6 -1
  13. package/components/tab-router/src/models/tab-router.model.d.ts +5 -0
  14. package/components/tab-router/src/pipes/tab-info.pipe.d.ts +7 -0
  15. package/components/tab-router/src/services/tab-router.service.d.ts +5 -0
  16. package/components/table/index.d.ts +2 -0
  17. package/components/table/src/components/filter/external-filter/external-filter.component.d.ts +5 -1
  18. package/components/table/src/components/mobile-cards/mobile-cards.component.d.ts +4 -0
  19. package/components/table/src/configurations/index.d.ts +1 -0
  20. package/components/table/src/configurations/table-layout.d.ts +16 -0
  21. package/components/table/src/configurations/table.configuration.d.ts +3 -1
  22. package/components/table/src/models/index.d.ts +1 -0
  23. package/components/table/src/models/table-column.model.d.ts +3 -10
  24. package/components/table/src/models/table-item.model.d.ts +4 -1
  25. package/components/table/src/models/table-option-loading.model.d.ts +42 -0
  26. package/components/table/src/models/table-option.model.d.ts +6 -0
  27. package/components/table/src/services/table-filter/table-filter.model.d.ts +5 -0
  28. package/components/table/src/services/table-loading/table-loading.util.d.ts +91 -0
  29. package/components/table/src/services/tree/tree.util.d.ts +2 -0
  30. package/components/table/src/table.component.d.ts +23 -0
  31. package/components/upload-file/src/components/file-type-icon/file-type-icon.component.d.ts +15 -0
  32. package/components/upload-file/src/components/preview/preview.component.d.ts +88 -10
  33. package/components/upload-file/src/configurations/upload-file.configuration.d.ts +1 -1
  34. package/components/upload-file/src/helpers/file-type.d.ts +25 -0
  35. package/components/upload-file/src/pipes/file-meta.pipe.d.ts +9 -0
  36. package/components/upload-file/src/pipes/file-reason.pipe.d.ts +11 -0
  37. package/components/upload-file/src/pipes/index.d.ts +2 -0
  38. package/components/upload-file/src/upload-file.component.d.ts +89 -8
  39. package/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
  40. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  41. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
  42. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  43. package/fesm2022/sdcorejs-angular-components-section.mjs +15 -3
  44. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  45. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  46. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  47. package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +390 -75
  49. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  50. package/fesm2022/sdcorejs-angular-components-table.mjs +443 -15
  51. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +886 -173
  53. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  54. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +7 -2
  55. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  56. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +5 -2
  57. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-forms-chip.mjs +421 -121
  59. package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
  60. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +4 -0
  61. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  62. package/fesm2022/sdcorejs-angular-forms-date.mjs +4 -0
  63. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  64. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +4 -0
  65. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  66. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +17 -2
  67. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  68. package/fesm2022/sdcorejs-angular-forms-input.mjs +4 -0
  69. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  70. package/fesm2022/sdcorejs-angular-forms-select.mjs +26 -20
  71. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  72. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +14 -1
  73. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  74. package/fesm2022/sdcorejs-angular-i18n.mjs +210 -0
  75. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  76. package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BFxO3eHX.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-Bk3PrEf3.mjs} +3 -3
  77. package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BFxO3eHX.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-Bk3PrEf3.mjs.map} +1 -1
  78. package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-Csy2fShj.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-CwUegGgG.mjs} +3 -3
  79. package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-Csy2fShj.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-CwUegGgG.mjs.map} +1 -1
  80. package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BIIxNR6k.mjs → sdcorejs-angular-modules-generic-generic-list.page-lF2trhfp.mjs} +3 -3
  81. package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BIIxNR6k.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-lF2trhfp.mjs.map} +1 -1
  82. package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DjDsau9C.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BbmeOduc.mjs} +4 -4
  83. package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DjDsau9C.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BbmeOduc.mjs.map} +1 -1
  84. package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
  85. package/fesm2022/sdcorejs-angular-modules-layout.mjs +265 -10
  86. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  87. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs +23 -0
  88. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map +1 -0
  89. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs +16 -0
  90. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map +1 -0
  91. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-CVEKaR8U.mjs +51 -0
  92. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-CVEKaR8U.mjs.map +1 -0
  93. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-BqHybMk0.mjs +130 -0
  94. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-BqHybMk0.mjs.map +1 -0
  95. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CND3d2zl.mjs +131 -0
  96. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CND3d2zl.mjs.map +1 -0
  97. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BbDoQccI.mjs +99 -0
  98. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BbDoQccI.mjs.map +1 -0
  99. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CB_wJIP8.mjs +460 -0
  100. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CB_wJIP8.mjs.map +1 -0
  101. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlP4BrhU.mjs +118 -0
  102. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlP4BrhU.mjs.map +1 -0
  103. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +18 -0
  104. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +1 -0
  105. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-VAMePx_q.mjs +66 -0
  106. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-VAMePx_q.mjs.map +1 -0
  107. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-BD79VR0c.mjs +148 -0
  108. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-BD79VR0c.mjs.map +1 -0
  109. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-B1rFhbOc.mjs +172 -0
  110. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-B1rFhbOc.mjs.map +1 -0
  111. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BhCjw6ZL.mjs +467 -0
  112. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BhCjw6ZL.mjs.map +1 -0
  113. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CnL2FzCx.mjs +90 -0
  114. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CnL2FzCx.mjs.map +1 -0
  115. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-BeH-NYvE.mjs +514 -0
  116. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-BeH-NYvE.mjs.map +1 -0
  117. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DpnYSG2j.mjs +61 -0
  118. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DpnYSG2j.mjs.map +1 -0
  119. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-1bi0JZdf.mjs +170 -0
  120. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-1bi0JZdf.mjs.map +1 -0
  121. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-D6eKR2cq.mjs +87 -0
  122. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-D6eKR2cq.mjs.map +1 -0
  123. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-FcJS3Nbd.mjs +232 -0
  124. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-FcJS3Nbd.mjs.map +1 -0
  125. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-BA-3FR1J.mjs +70 -0
  126. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-BA-3FR1J.mjs.map +1 -0
  127. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-BAZLCVci.mjs +100 -0
  128. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-BAZLCVci.mjs.map +1 -0
  129. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-ikk0cK1M.mjs +522 -0
  130. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-ikk0cK1M.mjs.map +1 -0
  131. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Cex41xzy.mjs +164 -0
  132. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Cex41xzy.mjs.map +1 -0
  133. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D643jEmo.mjs +629 -0
  134. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D643jEmo.mjs.map +1 -0
  135. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DTWHhNNl.mjs +71 -0
  136. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DTWHhNNl.mjs.map +1 -0
  137. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-YJUJsrIZ.mjs +115 -0
  138. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-YJUJsrIZ.mjs.map +1 -0
  139. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-qH-YO6wP.mjs +118 -0
  140. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-qH-YO6wP.mjs.map +1 -0
  141. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-S0Vuy6Oc.mjs +1069 -0
  142. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-S0Vuy6Oc.mjs.map +1 -0
  143. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs +186 -0
  144. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +1 -0
  145. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs +97 -0
  146. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +1 -0
  147. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs +12 -0
  148. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs.map +1 -0
  149. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-Ba73HPGG.mjs +48 -0
  150. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-Ba73HPGG.mjs.map +1 -0
  151. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-CBlN7eEn.mjs +295 -0
  152. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-CBlN7eEn.mjs.map +1 -0
  153. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BvzFafUW.mjs +74 -0
  154. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BvzFafUW.mjs.map +1 -0
  155. package/fesm2022/sdcorejs-angular-modules-pattern-routes-C3uWi8JZ.mjs +165 -0
  156. package/fesm2022/sdcorejs-angular-modules-pattern-routes-C3uWi8JZ.mjs.map +1 -0
  157. package/fesm2022/sdcorejs-angular-modules-pattern-routes-C5ELCTEw.mjs +74 -0
  158. package/fesm2022/sdcorejs-angular-modules-pattern-routes-C5ELCTEw.mjs.map +1 -0
  159. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClQwnO4h.mjs +50 -0
  160. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClQwnO4h.mjs.map +1 -0
  161. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DTUxYZ6g.mjs +66 -0
  162. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DTUxYZ6g.mjs.map +1 -0
  163. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DpCuYBlL.mjs +99 -0
  164. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DpCuYBlL.mjs.map +1 -0
  165. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DwZWxmJf.mjs +45 -0
  166. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DwZWxmJf.mjs.map +1 -0
  167. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ydOZduls.mjs +43 -0
  168. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ydOZduls.mjs.map +1 -0
  169. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-D3B5I9hg.mjs +406 -0
  170. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-D3B5I9hg.mjs.map +1 -0
  171. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-BW-i6BHg.mjs +317 -0
  172. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-BW-i6BHg.mjs.map +1 -0
  173. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-By1mYFa_.mjs +132 -0
  174. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-By1mYFa_.mjs.map +1 -0
  175. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DwcyKb4j.mjs +143 -0
  176. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DwcyKb4j.mjs.map +1 -0
  177. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BBR8360C.mjs +100 -0
  178. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BBR8360C.mjs.map +1 -0
  179. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CAtqPgIH.mjs +357 -0
  180. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CAtqPgIH.mjs.map +1 -0
  181. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DjMChf6s.mjs +128 -0
  182. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DjMChf6s.mjs.map +1 -0
  183. package/fesm2022/sdcorejs-angular-modules-pattern.mjs +2 -0
  184. package/fesm2022/sdcorejs-angular-modules-pattern.mjs.map +1 -0
  185. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +104 -4
  186. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
  187. package/forms/chip/src/chip.component.d.ts +135 -19
  188. package/forms/chip/src/index.d.ts +0 -1
  189. package/i18n/src/en.d.ts +42 -0
  190. package/modules/layout/components/index.d.ts +2 -0
  191. package/modules/layout/components/page/page-form-leave.guard.d.ts +9 -0
  192. package/modules/layout/components/page/page.component.d.ts +38 -2
  193. package/modules/layout/components/page-list/page-list.component.d.ts +42 -0
  194. package/modules/layout/components/shared/context-switcher/context-switcher.component.d.ts +1 -1
  195. package/modules/pattern/README.md +76 -0
  196. package/modules/pattern/configurations/pattern.configuration.d.ts +30 -0
  197. package/modules/pattern/configurations/provide-sd-patterns.d.ts +19 -0
  198. package/modules/pattern/core/mock-api/mock-api.interceptor.d.ts +8 -0
  199. package/modules/pattern/core/mock-api/mock-api.model.d.ts +62 -0
  200. package/modules/pattern/core/mock-api/mock-api.state.d.ts +36 -0
  201. package/modules/pattern/core/mock-api/mock-backend.d.ts +18 -0
  202. package/modules/pattern/core/mock-api/mock-backend.factory.d.ts +3 -0
  203. package/modules/pattern/core/mock-api/prng.d.ts +4 -0
  204. package/modules/pattern/core/mock-api/resources/approval.resource.d.ts +14 -0
  205. package/modules/pattern/core/mock-api/resources/category.resource.d.ts +9 -0
  206. package/modules/pattern/core/mock-api/resources/customer.resource.d.ts +22 -0
  207. package/modules/pattern/core/mock-api/resources/index.d.ts +3 -0
  208. package/modules/pattern/core/mock-api/resources/names.d.ts +5 -0
  209. package/modules/pattern/core/mock-api/resources/order.resource.d.ts +44 -0
  210. package/modules/pattern/core/mock-api/resources/partner.resource.d.ts +16 -0
  211. package/modules/pattern/core/mock-api/resources/product.resource.d.ts +13 -0
  212. package/modules/pattern/core/mock-api/resources/settings.resource.d.ts +18 -0
  213. package/modules/pattern/core/pattern-shell/catalog/pattern-catalog.d.ts +22 -0
  214. package/modules/pattern/core/pattern-shell/index/index.component.d.ts +9 -0
  215. package/modules/pattern/core/pattern-shell/settings/pattern-settings.store.d.ts +57 -0
  216. package/modules/pattern/core/pattern-shell/settings/settings-button.component.d.ts +44 -0
  217. package/modules/pattern/core/pattern-shell/shell/pattern-source-viewer.d.ts +8 -0
  218. package/modules/pattern/core/pattern-shell/shell/shell.component.d.ts +13 -0
  219. package/modules/pattern/core/pattern-shell/source/pattern-source.generated.d.ts +1 -0
  220. package/modules/pattern/core/pattern-shell/source/source-drawer.component.d.ts +27 -0
  221. package/modules/pattern/core/pattern-shell/toolbar/toolbar.component.d.ts +24 -0
  222. package/modules/pattern/core/permission/pattern-permission.d.ts +15 -0
  223. package/modules/pattern/core/permission/pattern-role.store.d.ts +13 -0
  224. package/modules/pattern/core/session-state.d.ts +4 -0
  225. package/modules/pattern/docs/detail.md +237 -0
  226. package/modules/pattern/docs/drawer.md +484 -0
  227. package/modules/pattern/docs/flow.md +631 -0
  228. package/modules/pattern/docs/form.md +518 -0
  229. package/modules/pattern/docs/header-actions.md +342 -0
  230. package/modules/pattern/docs/list.md +247 -0
  231. package/modules/pattern/docs/relation.md +180 -0
  232. package/modules/pattern/docs/select.md +206 -0
  233. package/modules/pattern/docs/split.md +350 -0
  234. package/modules/pattern/docs/states.md +168 -0
  235. package/modules/pattern/features/approval/entity.resolver.d.ts +4 -0
  236. package/modules/pattern/features/approval/entity.resolver.ts +21 -0
  237. package/modules/pattern/features/approval/pages/detail/detail.component.d.ts +13 -0
  238. package/modules/pattern/features/approval/pages/detail/detail.component.ts +139 -0
  239. package/modules/pattern/features/approval/pages/list/approval-inbox.d.ts +7 -0
  240. package/modules/pattern/features/approval/pages/list/approval-inbox.ts +7 -0
  241. package/modules/pattern/features/approval/pages/list/list.component.d.ts +26 -0
  242. package/modules/pattern/features/approval/pages/list/list.component.html +20 -0
  243. package/modules/pattern/features/approval/pages/list/list.component.ts +149 -0
  244. package/modules/pattern/features/approval/routes.d.ts +3 -0
  245. package/modules/pattern/features/approval/routes.ts +30 -0
  246. package/modules/pattern/features/approval/services/approval.model.d.ts +37 -0
  247. package/modules/pattern/features/approval/services/approval.model.ts +38 -0
  248. package/modules/pattern/features/approval/services/approval.service.d.ts +12 -0
  249. package/modules/pattern/features/approval/services/approval.service.ts +23 -0
  250. package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.d.ts +23 -0
  251. package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +123 -0
  252. package/modules/pattern/features/category/components/general-information-form/general-information-form.component.d.ts +20 -0
  253. package/modules/pattern/features/category/components/general-information-form/general-information-form.component.ts +61 -0
  254. package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.d.ts +23 -0
  255. package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +134 -0
  256. package/modules/pattern/features/category/entity.resolver.d.ts +6 -0
  257. package/modules/pattern/features/category/entity.resolver.ts +27 -0
  258. package/modules/pattern/features/category/pages/list/list.component.d.ts +17 -0
  259. package/modules/pattern/features/category/pages/list/list.component.html +20 -0
  260. package/modules/pattern/features/category/pages/list/list.component.ts +105 -0
  261. package/modules/pattern/features/category/routes.d.ts +3 -0
  262. package/modules/pattern/features/category/routes.ts +42 -0
  263. package/modules/pattern/features/category/services/category.model.d.ts +34 -0
  264. package/modules/pattern/features/category/services/category.model.ts +39 -0
  265. package/modules/pattern/features/category/services/category.service.d.ts +17 -0
  266. package/modules/pattern/features/category/services/category.service.ts +36 -0
  267. package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.d.ts +24 -0
  268. package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +131 -0
  269. package/modules/pattern/features/customer/components/customer-select/customer-select.component.d.ts +20 -0
  270. package/modules/pattern/features/customer/components/customer-select/customer-select.component.ts +72 -0
  271. package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.d.ts +20 -0
  272. package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.ts +30 -0
  273. package/modules/pattern/features/customer/components/debts-view/debts-view.component.d.ts +11 -0
  274. package/modules/pattern/features/customer/components/debts-view/debts-view.component.ts +28 -0
  275. package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.d.ts +20 -0
  276. package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +106 -0
  277. package/modules/pattern/features/customer/components/documents-view/documents-view.component.d.ts +14 -0
  278. package/modules/pattern/features/customer/components/documents-view/documents-view.component.ts +50 -0
  279. package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.d.ts +33 -0
  280. package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.ts +140 -0
  281. package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.d.ts +9 -0
  282. package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.ts +39 -0
  283. package/modules/pattern/features/customer/components/orders-view/orders-view.component.d.ts +11 -0
  284. package/modules/pattern/features/customer/components/orders-view/orders-view.component.ts +35 -0
  285. package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.d.ts +22 -0
  286. package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +101 -0
  287. package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.d.ts +24 -0
  288. package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +127 -0
  289. package/modules/pattern/features/customer/entity.resolver.d.ts +4 -0
  290. package/modules/pattern/features/customer/entity.resolver.ts +21 -0
  291. package/modules/pattern/features/customer/pages/list/list.component.d.ts +19 -0
  292. package/modules/pattern/features/customer/pages/list/list.component.html +22 -0
  293. package/modules/pattern/features/customer/pages/list/list.component.ts +113 -0
  294. package/modules/pattern/features/customer/pages/profile/profile.component.d.ts +31 -0
  295. package/modules/pattern/features/customer/pages/profile/profile.component.ts +120 -0
  296. package/modules/pattern/features/customer/pipes/customer-detail.pipe.d.ts +14 -0
  297. package/modules/pattern/features/customer/pipes/customer-detail.pipe.ts +18 -0
  298. package/modules/pattern/features/customer/routes.d.ts +6 -0
  299. package/modules/pattern/features/customer/routes.ts +59 -0
  300. package/modules/pattern/features/customer/services/customer.model.d.ts +77 -0
  301. package/modules/pattern/features/customer/services/customer.model.ts +87 -0
  302. package/modules/pattern/features/customer/services/customer.service.d.ts +24 -0
  303. package/modules/pattern/features/customer/services/customer.service.ts +79 -0
  304. package/modules/pattern/features/import/components/mapping-form/mapping-form.component.d.ts +21 -0
  305. package/modules/pattern/features/import/components/mapping-form/mapping-form.component.ts +41 -0
  306. package/modules/pattern/features/import/components/preview-view/preview-view.component.d.ts +10 -0
  307. package/modules/pattern/features/import/components/preview-view/preview-view.component.ts +44 -0
  308. package/modules/pattern/features/import/pages/flow/flow.component.d.ts +43 -0
  309. package/modules/pattern/features/import/pages/flow/flow.component.ts +269 -0
  310. package/modules/pattern/features/import/routes.d.ts +2 -0
  311. package/modules/pattern/features/import/routes.ts +19 -0
  312. package/modules/pattern/features/import/services/import.model.d.ts +38 -0
  313. package/modules/pattern/features/import/services/import.model.ts +82 -0
  314. package/modules/pattern/features/import/services/import.service.d.ts +15 -0
  315. package/modules/pattern/features/import/services/import.service.ts +18 -0
  316. package/modules/pattern/features/order/components/approval-steps/approval-steps.component.d.ts +9 -0
  317. package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +74 -0
  318. package/modules/pattern/features/order/components/bulk-result/bulk-result.component.d.ts +22 -0
  319. package/modules/pattern/features/order/components/bulk-result/bulk-result.component.ts +46 -0
  320. package/modules/pattern/features/order/components/general-information-form/general-information-form.component.d.ts +30 -0
  321. package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +96 -0
  322. package/modules/pattern/features/order/components/lines-form/lines-form.component.d.ts +33 -0
  323. package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +205 -0
  324. package/modules/pattern/features/order/components/lines-view/lines-view.component.d.ts +12 -0
  325. package/modules/pattern/features/order/components/lines-view/lines-view.component.ts +42 -0
  326. package/modules/pattern/features/order/components/summary-cards/summary-cards.component.d.ts +25 -0
  327. package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +128 -0
  328. package/modules/pattern/features/order/entity.resolver.d.ts +9 -0
  329. package/modules/pattern/features/order/entity.resolver.ts +37 -0
  330. package/modules/pattern/features/order/pages/create/create.component.d.ts +16 -0
  331. package/modules/pattern/features/order/pages/create/create.component.ts +99 -0
  332. package/modules/pattern/features/order/pages/detail/detail.component.d.ts +26 -0
  333. package/modules/pattern/features/order/pages/detail/detail.component.ts +222 -0
  334. package/modules/pattern/features/order/pages/list/list.component.d.ts +29 -0
  335. package/modules/pattern/features/order/pages/list/list.component.html +38 -0
  336. package/modules/pattern/features/order/pages/list/list.component.ts +291 -0
  337. package/modules/pattern/features/order/pages/update/update.component.d.ts +20 -0
  338. package/modules/pattern/features/order/pages/update/update.component.ts +119 -0
  339. package/modules/pattern/features/order/routes.d.ts +7 -0
  340. package/modules/pattern/features/order/routes.ts +54 -0
  341. package/modules/pattern/features/order/services/order.model.d.ts +106 -0
  342. package/modules/pattern/features/order/services/order.model.ts +109 -0
  343. package/modules/pattern/features/order/services/order.service.d.ts +25 -0
  344. package/modules/pattern/features/order/services/order.service.ts +63 -0
  345. package/modules/pattern/features/partner/pages/create/create.component.d.ts +41 -0
  346. package/modules/pattern/features/partner/pages/create/create.component.ts +324 -0
  347. package/modules/pattern/features/partner/routes.d.ts +2 -0
  348. package/modules/pattern/features/partner/routes.ts +20 -0
  349. package/modules/pattern/features/partner/services/partner.model.d.ts +30 -0
  350. package/modules/pattern/features/partner/services/partner.model.ts +30 -0
  351. package/modules/pattern/features/partner/services/partner.service.d.ts +13 -0
  352. package/modules/pattern/features/partner/services/partner.service.ts +17 -0
  353. package/modules/pattern/features/product/components/general-information-form/general-information-form.component.d.ts +23 -0
  354. package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +88 -0
  355. package/modules/pattern/features/product/components/product-select/product-select.component.d.ts +20 -0
  356. package/modules/pattern/features/product/components/product-select/product-select.component.ts +65 -0
  357. package/modules/pattern/features/product/components/product-status-select/product-status-select.component.d.ts +22 -0
  358. package/modules/pattern/features/product/components/product-status-select/product-status-select.component.ts +30 -0
  359. package/modules/pattern/features/product/entity.resolver.d.ts +4 -0
  360. package/modules/pattern/features/product/entity.resolver.ts +21 -0
  361. package/modules/pattern/features/product/pages/create/create.component.d.ts +15 -0
  362. package/modules/pattern/features/product/pages/create/create.component.ts +85 -0
  363. package/modules/pattern/features/product/pages/detail/detail.component.d.ts +10 -0
  364. package/modules/pattern/features/product/pages/detail/detail.component.ts +53 -0
  365. package/modules/pattern/features/product/pages/list/list.component.d.ts +15 -0
  366. package/modules/pattern/features/product/pages/list/list.component.html +30 -0
  367. package/modules/pattern/features/product/pages/list/list.component.ts +71 -0
  368. package/modules/pattern/features/product/pages/update/update.component.d.ts +16 -0
  369. package/modules/pattern/features/product/pages/update/update.component.ts +86 -0
  370. package/modules/pattern/features/product/pipes/product-detail.pipe.d.ts +14 -0
  371. package/modules/pattern/features/product/pipes/product-detail.pipe.ts +18 -0
  372. package/modules/pattern/features/product/routes.d.ts +3 -0
  373. package/modules/pattern/features/product/routes.ts +48 -0
  374. package/modules/pattern/features/product/services/product.model.d.ts +34 -0
  375. package/modules/pattern/features/product/services/product.model.ts +38 -0
  376. package/modules/pattern/features/product/services/product.service.d.ts +17 -0
  377. package/modules/pattern/features/product/services/product.service.ts +48 -0
  378. package/modules/pattern/features/settings/pages/update/update.component.d.ts +26 -0
  379. package/modules/pattern/features/settings/pages/update/update.component.ts +227 -0
  380. package/modules/pattern/features/settings/routes.d.ts +3 -0
  381. package/modules/pattern/features/settings/routes.ts +24 -0
  382. package/modules/pattern/features/settings/services/settings.model.d.ts +17 -0
  383. package/modules/pattern/features/settings/services/settings.model.ts +18 -0
  384. package/modules/pattern/features/settings/services/settings.service.d.ts +10 -0
  385. package/modules/pattern/features/settings/services/settings.service.ts +15 -0
  386. package/modules/pattern/features/settings/settings.resolver.d.ts +4 -0
  387. package/modules/pattern/features/settings/settings.resolver.ts +8 -0
  388. package/modules/pattern/index.d.ts +3 -0
  389. package/modules/pattern/routes.d.ts +6 -0
  390. package/modules/pattern/services/base-api.service.d.ts +16 -0
  391. package/modules/pattern/utils/api-error.d.ts +4 -0
  392. package/modules/pattern/utils/focus-first-invalid.d.ts +5 -0
  393. package/modules/pattern/utils/form-api-errors.d.ts +16 -0
  394. package/modules/pattern/utils/resource-url.d.ts +2 -0
  395. package/package.json +13 -9
  396. package/services/unsaved-changes/src/unsaved-changes.adapters.d.ts +9 -0
  397. package/services/unsaved-changes/src/unsaved-changes.model.d.ts +2 -0
  398. package/forms/chip/src/pipes/index.d.ts +0 -1
  399. package/forms/chip/src/pipes/removable-chip.pipe.d.ts +0 -8
@@ -0,0 +1,23 @@
1
+ import { HttpErrorResponse } from '@angular/common/http';
2
+
3
+ const bodyOf = (error) => error instanceof HttpErrorResponse && error.error && typeof error.error === 'object' ? error.error : null;
4
+ /** Field errors returned by the API, keyed by field name, to show on the matching fields. */
5
+ function apiFieldErrors(error) {
6
+ const errors = {};
7
+ for (const item of bodyOf(error)?.errors ?? []) {
8
+ if (item.field && item.message && !errors[item.field])
9
+ errors[item.field] = item.message;
10
+ }
11
+ return errors;
12
+ }
13
+ /** Message to show for a failed request, with the field errors that no field of the screen shows. */
14
+ function apiErrorMessage(error, fallback = 'Không thể thực hiện. Vui lòng thử lại.') {
15
+ if (error instanceof HttpErrorResponse && error.status === 0)
16
+ return 'Không kết nối được máy chủ. Vui lòng thử lại.';
17
+ const body = bodyOf(error);
18
+ const details = (body?.errors ?? []).map(item => item.message).filter((message) => !!message);
19
+ return [body?.message || fallback, ...details].join(' ');
20
+ }
21
+
22
+ export { apiErrorMessage as a, apiFieldErrors as b };
23
+ //# sourceMappingURL=sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/utils/api-error.ts"],"sourcesContent":["import { HttpErrorResponse } from '@angular/common/http';\n\n/** Error body of the sample API: a message and, for validation errors, one entry per field. */\ninterface ApiErrorBody {\n readonly message?: string;\n readonly errors?: readonly { readonly field?: string; readonly message?: string }[];\n}\n\nconst bodyOf = (error: unknown): ApiErrorBody | null =>\n error instanceof HttpErrorResponse && error.error && typeof error.error === 'object' ? (error.error as ApiErrorBody) : null;\n\n/** Field errors returned by the API, keyed by field name, to show on the matching fields. */\nexport function apiFieldErrors(error: unknown): Record<string, string> {\n const errors: Record<string, string> = {};\n for (const item of bodyOf(error)?.errors ?? []) {\n if (item.field && item.message && !errors[item.field]) errors[item.field] = item.message;\n }\n return errors;\n}\n\n/** Message to show for a failed request, with the field errors that no field of the screen shows. */\nexport function apiErrorMessage(error: unknown, fallback = 'Không thể thực hiện. Vui lòng thử lại.'): string {\n if (error instanceof HttpErrorResponse && error.status === 0) return 'Không kết nối được máy chủ. Vui lòng thử lại.';\n const body = bodyOf(error);\n const details = (body?.errors ?? []).map(item => item.message).filter((message): message is string => !!message);\n return [body?.message || fallback, ...details].join(' ');\n}\n"],"names":[],"mappings":";;AAQA,MAAM,MAAM,GAAG,CAAC,KAAc,KAC5B,KAAK,YAAY,iBAAiB,IAAI,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,GAAI,KAAK,CAAC,KAAsB,GAAG,IAAI;AAE7H;AACM,SAAU,cAAc,CAAC,KAAc,EAAA;IAC3C,MAAM,MAAM,GAA2B,EAAE;AACzC,IAAA,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,EAAE,EAAE;AAC9C,QAAA,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO;IAC1F;AACA,IAAA,OAAO,MAAM;AACf;AAEA;SACgB,eAAe,CAAC,KAAc,EAAE,QAAQ,GAAG,wCAAwC,EAAA;IACjG,IAAI,KAAK,YAAY,iBAAiB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,+CAA+C;AACpH,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AAC1B,IAAA,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,EAAE,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,KAAwB,CAAC,CAAC,OAAO,CAAC;AAChH,IAAA,OAAO,CAAC,IAAI,EAAE,OAAO,IAAI,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1D;;;;"}
@@ -0,0 +1,16 @@
1
+ const APPROVAL_STATUS_OPTIONS = [
2
+ { id: 'pending', name: 'Chờ duyệt', color: 'warning' },
3
+ { id: 'approved', name: 'Đã duyệt', color: 'success' },
4
+ { id: 'rejected', name: 'Bị từ chối', color: 'error' },
5
+ ];
6
+ function approvalStatusBadge(status) {
7
+ const option = APPROVAL_STATUS_OPTIONS.find(item => item.id === status);
8
+ return { type: 'round', title: option?.name ?? status, color: option?.color };
9
+ }
10
+
11
+ /** Hộp duyệt mà panel chi tiết dùng để tự chọn mục kế sau khi duyệt hoặc từ chối. */
12
+ class ApprovalInbox {
13
+ }
14
+
15
+ export { ApprovalInbox as A, APPROVAL_STATUS_OPTIONS as a, approvalStatusBadge as b };
16
+ //# sourceMappingURL=sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/approval/services/approval.model.ts","../../../projects/sdcorejs-angular/modules/pattern/features/approval/pages/list/approval-inbox.ts"],"sourcesContent":["import type { SdBadgeData } from '@sdcorejs/angular/components/badge';\nimport type { PagingReq, PagingRes } from '@sdcorejs/utils/models';\n\nexport type ApprovalStatus = 'pending' | 'approved' | 'rejected';\n\nexport const APPROVAL_STATUS_OPTIONS = [\n { id: 'pending', name: 'Chờ duyệt', color: 'warning' },\n { id: 'approved', name: 'Đã duyệt', color: 'success' },\n { id: 'rejected', name: 'Bị từ chối', color: 'error' },\n] satisfies { id: ApprovalStatus; name: string; color: SdBadgeData['color'] }[];\n\n/** Đề nghị thanh toán chờ người duyệt xử lý. */\nexport interface ApprovalDto {\n readonly id: string;\n readonly code: string;\n readonly title: string;\n readonly requester: string;\n readonly department: string;\n /** Số tiền đề nghị (₫). */\n readonly amount: number;\n readonly submittedAt: string;\n readonly status: ApprovalStatus;\n readonly reason: string | null;\n readonly note: string | null;\n}\n\nexport type ApprovalListReq = PagingReq<ApprovalDto>;\nexport type ApprovalListRes = PagingRes<ApprovalDto>;\n\nexport interface ApprovalDecisionReq {\n readonly id: string;\n readonly reason?: string;\n}\n\nexport function approvalStatusBadge(status: ApprovalStatus): SdBadgeData {\n const option = APPROVAL_STATUS_OPTIONS.find(item => item.id === status);\n return { type: 'round', title: option?.name ?? status, color: option?.color };\n}\n","/** Hộp duyệt mà panel chi tiết dùng để tự chọn mục kế sau khi duyệt hoặc từ chối. */\nexport abstract class ApprovalInbox {\n /** Mục sau `id` trong các dòng đang hiện (mục trước nếu `id` là dòng cuối); `null` khi không còn mục nào. */\n abstract nextOf(id: string): string | null;\n /** Đọc lại danh sách, giữ bộ lọc, trang và vị trí cuộn. */\n abstract refresh(): Promise<void>;\n}\n"],"names":[],"mappings":"AAKO,MAAM,uBAAuB,GAAG;IACrC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE;IACtD,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE;IACtD,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE;;AA0BlD,SAAU,mBAAmB,CAAC,MAAsB,EAAA;AACxD,IAAA,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC;AACvE,IAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AAC/E;;ACrCA;MACsB,aAAa,CAAA;AAKlC;;;;"}
@@ -0,0 +1,51 @@
1
+ import { HttpClient, HttpParams } from '@angular/common/http';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, Injectable } from '@angular/core';
4
+ import { S as SD_PATTERN_CONFIGURATION } from './sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-D3B5I9hg.mjs';
5
+
6
+ /** Joins single path segments to a base URL; takes no query string. */
7
+ function resourceUrl(baseUrl, ...segments) {
8
+ const path = segments
9
+ .map(segment => {
10
+ if (segment.length === 0 || segment === '.' || segment === '..') {
11
+ throw new Error('Resource URL requires non-empty path segments.');
12
+ }
13
+ return encodeURIComponent(segment);
14
+ })
15
+ .join('/');
16
+ const base = baseUrl.replace(/\/+$/u, '');
17
+ return path ? base + '/' + path : base || '/';
18
+ }
19
+
20
+ /**
21
+ * HttpClient, configuration and URL helpers shared by the API services of the pattern features.
22
+ * The services do not know whether the mock API or a real API answers.
23
+ */
24
+ class BaseApiService {
25
+ http = inject(HttpClient);
26
+ configuration = inject(SD_PATTERN_CONFIGURATION);
27
+ apiUrl(...segments) {
28
+ return resourceUrl(this.configuration.apiBaseUrl, ...segments);
29
+ }
30
+ /** Wire format of the sample API: scalar paging + JSON for filters/orders/fields. */
31
+ buildPagingReq(req) {
32
+ let params = new HttpParams();
33
+ if (req.pageNumber !== undefined)
34
+ params = params.set('pageNumber', req.pageNumber);
35
+ if (req.pageSize !== undefined)
36
+ params = params.set('pageSize', req.pageSize);
37
+ for (const key of ['filters', 'orders', 'fields']) {
38
+ if (req[key] !== undefined)
39
+ params = params.set(key, JSON.stringify(req[key]));
40
+ }
41
+ return params;
42
+ }
43
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: BaseApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
44
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: BaseApiService });
45
+ }
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: BaseApiService, decorators: [{
47
+ type: Injectable
48
+ }] });
49
+
50
+ export { BaseApiService as B };
51
+ //# sourceMappingURL=sdcorejs-angular-modules-pattern-base-api.service-CVEKaR8U.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-modules-pattern-base-api.service-CVEKaR8U.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/utils/resource-url.ts","../../../projects/sdcorejs-angular/modules/pattern/services/base-api.service.ts"],"sourcesContent":["/** Joins single path segments to a base URL; takes no query string. */\nexport function resourceUrl(baseUrl: string, ...segments: string[]): string {\n const path = segments\n .map(segment => {\n if (segment.length === 0 || segment === '.' || segment === '..') {\n throw new Error('Resource URL requires non-empty path segments.');\n }\n return encodeURIComponent(segment);\n })\n .join('/');\n const base = baseUrl.replace(/\\/+$/u, '');\n return path ? base + '/' + path : base || '/';\n}\n","import { HttpClient, HttpParams } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport type { PagingReq } from '@sdcorejs/utils/models';\nimport { SD_PATTERN_CONFIGURATION } from '../configurations/pattern.configuration';\nimport { resourceUrl } from '../utils/resource-url';\n\n/**\n * HttpClient, configuration and URL helpers shared by the API services of the pattern features.\n * The services do not know whether the mock API or a real API answers.\n */\n@Injectable()\nexport abstract class BaseApiService {\n protected readonly http = inject(HttpClient);\n protected readonly configuration = inject(SD_PATTERN_CONFIGURATION);\n\n protected apiUrl(...segments: string[]): string {\n return resourceUrl(this.configuration.apiBaseUrl, ...segments);\n }\n\n /** Wire format of the sample API: scalar paging + JSON for filters/orders/fields. */\n protected buildPagingReq<T>(req: PagingReq<T>): HttpParams {\n let params = new HttpParams();\n if (req.pageNumber !== undefined) params = params.set('pageNumber', req.pageNumber);\n if (req.pageSize !== undefined) params = params.set('pageSize', req.pageSize);\n for (const key of ['filters', 'orders', 'fields'] as const) {\n if (req[key] !== undefined) params = params.set(key, JSON.stringify(req[key]));\n }\n return params;\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;SACgB,WAAW,CAAC,OAAe,EAAE,GAAG,QAAkB,EAAA;IAChE,MAAM,IAAI,GAAG;SACV,GAAG,CAAC,OAAO,IAAG;AACb,QAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,EAAE;AAC/D,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AAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAd,cAAc,EAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBADnC;;;;;"}
@@ -0,0 +1,130 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injector, viewChild, ElementRef, signal, afterNextRender, DestroyRef, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { toSignal } from '@angular/core/rxjs-interop';
4
+ import { FormGroup } from '@angular/forms';
5
+ import { Router, ActivatedRoute } from '@angular/router';
6
+ import { map, firstValueFrom } from 'rxjs';
7
+ import { SdButton } from '@sdcorejs/angular/components/button';
8
+ import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
9
+ import { SdConfirmService } from '@sdcorejs/angular/services/confirm';
10
+ import { SdNotifyService } from '@sdcorejs/angular/services/notify';
11
+ import { registerSdUnsavedChangesForm, SdUnsavedChangesService } from '@sdcorejs/angular/services/unsaved-changes';
12
+ import { a as apiErrorMessage } from './sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs';
13
+ import { f as formApiErrors, a as focusFirstInvalid } from './sdcorejs-angular-modules-pattern-form-api-errors-DpnYSG2j.mjs';
14
+ import { C as CategoryService } from './sdcorejs-angular-modules-pattern-routes-DpCuYBlL.mjs';
15
+ import { G as GeneralInformationFormComponent, c as categorySaveReq } from './sdcorejs-angular-modules-pattern-general-information-form.component-D6eKR2cq.mjs';
16
+
17
+ /**
18
+ * Tạo danh mục trong drawer (route con `create`, `?parent=<id>` cho danh mục con). Danh mục cha do resolver tải.
19
+ * X, Esc và backdrop hỏi trước khi bỏ thay đổi; lưu xong đóng drawer và danh sách tải lại.
20
+ */
21
+ class CreateSideDrawerComponent {
22
+ #categoryService = inject(CategoryService);
23
+ #confirm = inject(SdConfirmService);
24
+ #notify = inject(SdNotifyService);
25
+ #router = inject(Router);
26
+ #route = inject(ActivatedRoute);
27
+ #injector = inject(Injector);
28
+ drawer = viewChild.required(SdSideDrawer);
29
+ formElement = viewChild.required(GeneralInformationFormComponent, { read: ElementRef });
30
+ parent = toSignal(this.#route.data.pipe(map(data => data['parent'] ?? null)), {
31
+ requireSync: true,
32
+ });
33
+ seed = { code: '', name: '', parentId: null, status: 'active' };
34
+ form = new FormGroup({});
35
+ saving = signal(false);
36
+ apiErrors = formApiErrors(this.form);
37
+ #unsaved = registerSdUnsavedChangesForm(inject(SdUnsavedChangesService), this.form, { id: 'category-create', dirty: 'value' });
38
+ beforeClose = async () => {
39
+ if (this.saving())
40
+ return false;
41
+ if (!this.#unsaved.dirty())
42
+ return true;
43
+ try {
44
+ await this.#confirm.confirm('Thay đổi chưa lưu sẽ bị mất.', {
45
+ title: 'Đóng khi chưa lưu?',
46
+ yesTitle: 'Bỏ thay đổi',
47
+ noTitle: 'Tiếp tục sửa',
48
+ yesButtonColor: 'warning',
49
+ });
50
+ }
51
+ catch {
52
+ return false;
53
+ }
54
+ this.#unsaved.markPristine();
55
+ return true;
56
+ };
57
+ constructor() {
58
+ afterNextRender(() => this.drawer().open());
59
+ inject(DestroyRef).onDestroy(() => this.#unsaved.destroy());
60
+ }
61
+ closed() {
62
+ void this.#router.navigate(['..'], { relativeTo: this.#route });
63
+ }
64
+ async save() {
65
+ if (this.saving())
66
+ return;
67
+ this.form.markAllAsTouched();
68
+ if (this.form.invalid) {
69
+ this.#focusFirstInvalid();
70
+ return;
71
+ }
72
+ this.saving.set(true);
73
+ try {
74
+ const category = await firstValueFrom(this.#categoryService.create(categorySaveReq(this.form, this.parent()?.id ?? null)));
75
+ this.#unsaved.markPristine();
76
+ this.#notify.success(`Đã tạo danh mục ${category.name}.`);
77
+ this.saving.set(false);
78
+ this.drawer().close();
79
+ }
80
+ catch (error) {
81
+ if (this.apiErrors.set(error))
82
+ this.#focusFirstInvalid();
83
+ else
84
+ this.#notify.error(apiErrorMessage(error, 'Không thể lưu. Dữ liệu đã nhập vẫn được giữ.'));
85
+ }
86
+ finally {
87
+ this.saving.set(false);
88
+ }
89
+ }
90
+ #focusFirstInvalid() {
91
+ afterNextRender(() => focusFirstInvalid(this.formElement().nativeElement), { injector: this.#injector });
92
+ }
93
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: CreateSideDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
94
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.21", type: CreateSideDrawerComponent, isStandalone: true, selector: "create-side-drawer", viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }, { propertyName: "formElement", first: true, predicate: GeneralInformationFormComponent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
95
+ <sd-side-drawer
96
+ [title]="parent() ? 'Thêm danh mục con của ' + parent()!.name : 'Tạo danh mục'"
97
+ autoId="category-create"
98
+ [beforeClose]="beforeClose"
99
+ (sdClosed)="closed()">
100
+ <general-information-form [form]="form" [seed]="seed" [parentName]="parent()?.name ?? null" [errors]="apiErrors.errors()" />
101
+ <div sdFooterRight class="d-flex align-items-center gap-8">
102
+ <sd-button title="Lưu" type="fill" color="primary" autoId="category-save" [loading]="saving()" (click)="save()" />
103
+ </div>
104
+ </sd-side-drawer>
105
+ `, isInline: true, dependencies: [{ kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: GeneralInformationFormComponent, selector: "general-information-form", inputs: ["form", "seed", "parentName", "editing", "errors"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
106
+ }
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: CreateSideDrawerComponent, decorators: [{
108
+ type: Component,
109
+ args: [{
110
+ selector: 'create-side-drawer',
111
+ standalone: true,
112
+ imports: [SdSideDrawer, SdButton, GeneralInformationFormComponent],
113
+ changeDetection: ChangeDetectionStrategy.OnPush,
114
+ template: `
115
+ <sd-side-drawer
116
+ [title]="parent() ? 'Thêm danh mục con của ' + parent()!.name : 'Tạo danh mục'"
117
+ autoId="category-create"
118
+ [beforeClose]="beforeClose"
119
+ (sdClosed)="closed()">
120
+ <general-information-form [form]="form" [seed]="seed" [parentName]="parent()?.name ?? null" [errors]="apiErrors.errors()" />
121
+ <div sdFooterRight class="d-flex align-items-center gap-8">
122
+ <sd-button title="Lưu" type="fill" color="primary" autoId="category-save" [loading]="saving()" (click)="save()" />
123
+ </div>
124
+ </sd-side-drawer>
125
+ `,
126
+ }]
127
+ }], ctorParameters: () => [] });
128
+
129
+ export { CreateSideDrawerComponent };
130
+ //# sourceMappingURL=sdcorejs-angular-modules-pattern-create-side-drawer.component-BqHybMk0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-modules-pattern-create-side-drawer.component-BqHybMk0.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts"],"sourcesContent":["import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n inject,\n Injector,\n signal,\n viewChild,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { FormGroup } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { firstValueFrom, map } from 'rxjs';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';\nimport { SdConfirmService } from '@sdcorejs/angular/services/confirm';\nimport { SdNotifyService } from '@sdcorejs/angular/services/notify';\nimport { registerSdUnsavedChangesForm, SdUnsavedChangesService } from '@sdcorejs/angular/services/unsaved-changes';\nimport { apiErrorMessage } from '../../../../utils/api-error';\nimport { focusFirstInvalid } from '../../../../utils/focus-first-invalid';\nimport { formApiErrors } from '../../../../utils/form-api-errors';\nimport { CategoryService } from '../../services/category.service';\nimport type { CategoryDto, CategorySaveReq } from '../../services/category.model';\nimport {\n categorySaveReq,\n GeneralInformationFormComponent,\n type CategoryForm,\n} from '../general-information-form/general-information-form.component';\n\n/**\n * Tạo danh mục trong drawer (route con `create`, `?parent=<id>` cho danh mục con). Danh mục cha do resolver tải.\n * X, Esc và backdrop hỏi trước khi bỏ thay đổi; lưu xong đóng drawer và danh sách tải lại.\n */\n@Component({\n selector: 'create-side-drawer',\n standalone: true,\n imports: [SdSideDrawer, SdButton, GeneralInformationFormComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-side-drawer\n [title]=\"parent() ? 'Thêm danh mục con của ' + parent()!.name : 'Tạo danh mục'\"\n autoId=\"category-create\"\n [beforeClose]=\"beforeClose\"\n (sdClosed)=\"closed()\">\n <general-information-form [form]=\"form\" [seed]=\"seed\" [parentName]=\"parent()?.name ?? null\" [errors]=\"apiErrors.errors()\" />\n <div sdFooterRight class=\"d-flex align-items-center gap-8\">\n <sd-button title=\"Lưu\" type=\"fill\" color=\"primary\" autoId=\"category-save\" [loading]=\"saving()\" (click)=\"save()\" />\n </div>\n </sd-side-drawer>\n `,\n})\nexport class CreateSideDrawerComponent {\n readonly #categoryService = inject(CategoryService);\n readonly #confirm = inject(SdConfirmService);\n readonly #notify = inject(SdNotifyService);\n readonly #router = inject(Router);\n readonly #route = inject(ActivatedRoute);\n readonly #injector = inject(Injector);\n private readonly drawer = viewChild.required(SdSideDrawer);\n private readonly formElement = viewChild.required(GeneralInformationFormComponent, { read: ElementRef });\n protected readonly parent = toSignal(this.#route.data.pipe(map(data => (data['parent'] as CategoryDto | null) ?? null)), {\n requireSync: true,\n });\n protected readonly seed: CategorySaveReq = { code: '', name: '', parentId: null, status: 'active' };\n protected readonly form: CategoryForm = new FormGroup({});\n protected readonly saving = signal(false);\n protected readonly apiErrors = formApiErrors(this.form);\n readonly #unsaved = registerSdUnsavedChangesForm(inject(SdUnsavedChangesService), this.form, { id: 'category-create', dirty: 'value' });\n\n protected readonly beforeClose = async (): Promise<boolean> => {\n if (this.saving()) return false;\n if (!this.#unsaved.dirty()) return true;\n try {\n await this.#confirm.confirm('Thay đổi chưa lưu sẽ bị mất.', {\n title: 'Đóng khi chưa lưu?',\n yesTitle: 'Bỏ thay đổi',\n noTitle: 'Tiếp tục sửa',\n yesButtonColor: 'warning',\n });\n } catch {\n return false;\n }\n this.#unsaved.markPristine();\n return true;\n };\n\n constructor() {\n afterNextRender(() => this.drawer().open());\n inject(DestroyRef).onDestroy(() => this.#unsaved.destroy());\n }\n\n protected closed(): void {\n void this.#router.navigate(['..'], { relativeTo: this.#route });\n }\n\n protected async save(): Promise<void> {\n if (this.saving()) return;\n this.form.markAllAsTouched();\n if (this.form.invalid) {\n this.#focusFirstInvalid();\n return;\n }\n this.saving.set(true);\n try {\n const category = await firstValueFrom(this.#categoryService.create(categorySaveReq(this.form, this.parent()?.id ?? null)));\n this.#unsaved.markPristine();\n this.#notify.success(`Đã tạo danh mục ${category.name}.`);\n this.saving.set(false);\n this.drawer().close();\n } catch (error) {\n if (this.apiErrors.set(error)) this.#focusFirstInvalid();\n else this.#notify.error(apiErrorMessage(error, 'Không thể lưu. Dữ liệu đã nhập vẫn được giữ.'));\n } finally {\n this.saving.set(false);\n }\n }\n\n #focusFirstInvalid(): void {\n afterNextRender(() => focusFirstInvalid(this.formElement().nativeElement), { injector: this.#injector });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+BA;;;AAGG;MAmBU,yBAAyB,CAAA;AAC3B,IAAA,gBAAgB,GAAG,MAAM,CAAC,eAAe,CAAC;AAC1C,IAAA,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACn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iBAAA;;;;;"}
@@ -0,0 +1,131 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injector, viewChild, ElementRef, signal, afterNextRender, DestroyRef, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { FormGroup } from '@angular/forms';
4
+ import { Router, ActivatedRoute } from '@angular/router';
5
+ import { firstValueFrom } from 'rxjs';
6
+ import { SdButton } from '@sdcorejs/angular/components/button';
7
+ import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
8
+ import { SdConfirmService } from '@sdcorejs/angular/services/confirm';
9
+ import { SdNotifyService } from '@sdcorejs/angular/services/notify';
10
+ import { registerSdUnsavedChangesForm, SdUnsavedChangesService } from '@sdcorejs/angular/services/unsaved-changes';
11
+ import { a as apiErrorMessage } from './sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs';
12
+ import { f as formApiErrors, a as focusFirstInvalid } from './sdcorejs-angular-modules-pattern-form-api-errors-DpnYSG2j.mjs';
13
+ import { C as CustomerService } from './sdcorejs-angular-modules-pattern-customer.service-VAMePx_q.mjs';
14
+ import { G as GeneralInformationFormComponent, c as customerSaveReq, i as invalidCustomerGroups } from './sdcorejs-angular-modules-pattern-general-information-form.component-FcJS3Nbd.mjs';
15
+
16
+ /**
17
+ * Tạo khách hàng trong drawer (route con `create` của danh sách). Ba nhóm, mỗi nhóm còn lỗi hiện `sd-inform`; BE báo
18
+ * trùng email ngay trên field. Lưu thành công thì đóng drawer, danh sách tải lại.
19
+ */
20
+ class CreateSideDrawerComponent {
21
+ #customerService = inject(CustomerService);
22
+ #confirm = inject(SdConfirmService);
23
+ #notify = inject(SdNotifyService);
24
+ #router = inject(Router);
25
+ #route = inject(ActivatedRoute);
26
+ #injector = inject(Injector);
27
+ drawer = viewChild.required(SdSideDrawer);
28
+ // why: sd-side-drawer chuyển nội dung ra body, nên tìm field lỗi trong form chứ không trong host của component.
29
+ formElement = viewChild.required(GeneralInformationFormComponent, { read: ElementRef });
30
+ seed = {
31
+ name: '',
32
+ type: 'individual',
33
+ tier: 'standard',
34
+ email: '',
35
+ phone: '',
36
+ address: '',
37
+ taxCode: null,
38
+ status: 'active',
39
+ note: null,
40
+ };
41
+ form = new FormGroup({});
42
+ saving = signal(false);
43
+ apiErrors = formApiErrors(this.form);
44
+ invalidGroups = signal([]);
45
+ #unsaved = registerSdUnsavedChangesForm(inject(SdUnsavedChangesService), this.form, { id: 'customer-create', dirty: 'value' });
46
+ /** Đóng khi còn thay đổi chưa lưu: hỏi, đồng ý thì bỏ thay đổi (guard rời route không hỏi lại). */
47
+ beforeClose = async () => {
48
+ if (!this.#unsaved.dirty() || this.saving())
49
+ return !this.saving();
50
+ try {
51
+ await this.#confirm.confirm('Thay đổi chưa lưu sẽ bị mất.', {
52
+ title: 'Đóng khi chưa lưu?',
53
+ yesTitle: 'Bỏ thay đổi',
54
+ noTitle: 'Tiếp tục sửa',
55
+ yesButtonColor: 'warning',
56
+ });
57
+ }
58
+ catch {
59
+ return false;
60
+ }
61
+ this.#unsaved.markPristine();
62
+ return true;
63
+ };
64
+ constructor() {
65
+ afterNextRender(() => this.drawer().open());
66
+ inject(DestroyRef).onDestroy(() => this.#unsaved.destroy());
67
+ }
68
+ closed() {
69
+ void this.#router.navigate(['..'], { relativeTo: this.#route });
70
+ }
71
+ async save() {
72
+ if (this.saving())
73
+ return;
74
+ this.form.markAllAsTouched();
75
+ if (this.form.invalid) {
76
+ this.#showErrors();
77
+ return;
78
+ }
79
+ this.saving.set(true);
80
+ try {
81
+ const customer = await firstValueFrom(this.#customerService.create(customerSaveReq(this.form)));
82
+ this.#unsaved.markPristine();
83
+ this.#notify.success(`Đã tạo khách hàng ${customer.code}.`);
84
+ this.saving.set(false);
85
+ this.drawer().close();
86
+ }
87
+ catch (error) {
88
+ if (this.apiErrors.set(error))
89
+ this.#showErrors();
90
+ else
91
+ this.#notify.error(apiErrorMessage(error, 'Không thể lưu. Dữ liệu đã nhập vẫn được giữ.'));
92
+ }
93
+ finally {
94
+ this.saving.set(false);
95
+ }
96
+ }
97
+ /** `sd-inform` trong từng nhóm có lỗi, rồi focus field lỗi đầu tiên. */
98
+ #showErrors() {
99
+ this.invalidGroups.set(invalidCustomerGroups(this.form, this.apiErrors.errors()));
100
+ afterNextRender(() => focusFirstInvalid(this.formElement().nativeElement), { injector: this.#injector });
101
+ }
102
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: CreateSideDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
103
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.21", type: CreateSideDrawerComponent, isStandalone: true, selector: "create-side-drawer", viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }, { propertyName: "formElement", first: true, predicate: GeneralInformationFormComponent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
104
+ <sd-side-drawer title="Tạo khách hàng" width="600px" autoId="customer-create" [beforeClose]="beforeClose" (sdClosed)="closed()">
105
+ <general-information-form [form]="form" [seed]="seed" [errors]="apiErrors.errors()" [invalidGroups]="invalidGroups()" />
106
+ <div sdFooterRight class="d-flex align-items-center gap-8">
107
+ <sd-button title="Lưu" type="fill" color="primary" autoId="customer-save" [loading]="saving()" (click)="save()" />
108
+ </div>
109
+ </sd-side-drawer>
110
+ `, isInline: true, dependencies: [{ kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: GeneralInformationFormComponent, selector: "general-information-form", inputs: ["form", "seed", "errors", "invalidGroups"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
111
+ }
112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: CreateSideDrawerComponent, decorators: [{
113
+ type: Component,
114
+ args: [{
115
+ selector: 'create-side-drawer',
116
+ standalone: true,
117
+ imports: [SdSideDrawer, SdButton, GeneralInformationFormComponent],
118
+ changeDetection: ChangeDetectionStrategy.OnPush,
119
+ template: `
120
+ <sd-side-drawer title="Tạo khách hàng" width="600px" autoId="customer-create" [beforeClose]="beforeClose" (sdClosed)="closed()">
121
+ <general-information-form [form]="form" [seed]="seed" [errors]="apiErrors.errors()" [invalidGroups]="invalidGroups()" />
122
+ <div sdFooterRight class="d-flex align-items-center gap-8">
123
+ <sd-button title="Lưu" type="fill" color="primary" autoId="customer-save" [loading]="saving()" (click)="save()" />
124
+ </div>
125
+ </sd-side-drawer>
126
+ `,
127
+ }]
128
+ }], ctorParameters: () => [] });
129
+
130
+ export { CreateSideDrawerComponent };
131
+ //# sourceMappingURL=sdcorejs-angular-modules-pattern-create-side-drawer.component-CND3d2zl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-modules-pattern-create-side-drawer.component-CND3d2zl.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts"],"sourcesContent":["import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n inject,\n Injector,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';\nimport { SdConfirmService } from '@sdcorejs/angular/services/confirm';\nimport { SdNotifyService } from '@sdcorejs/angular/services/notify';\nimport { registerSdUnsavedChangesForm, SdUnsavedChangesService } from '@sdcorejs/angular/services/unsaved-changes';\nimport { apiErrorMessage } from '../../../../utils/api-error';\nimport { focusFirstInvalid } from '../../../../utils/focus-first-invalid';\nimport { formApiErrors } from '../../../../utils/form-api-errors';\nimport { CustomerService } from '../../services/customer.service';\nimport type { CustomerSaveReq } from '../../services/customer.model';\nimport {\n customerSaveReq,\n GeneralInformationFormComponent,\n invalidCustomerGroups,\n type CustomerForm,\n type CustomerFormGroup,\n} from '../general-information-form/general-information-form.component';\n\n/**\n * Tạo khách hàng trong drawer (route con `create` của danh sách). Ba nhóm, mỗi nhóm còn lỗi hiện `sd-inform`; BE báo\n * trùng email ngay trên field. Lưu thành công thì đóng drawer, danh sách tải lại.\n */\n@Component({\n selector: 'create-side-drawer',\n standalone: true,\n imports: [SdSideDrawer, SdButton, GeneralInformationFormComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-side-drawer title=\"Tạo khách hàng\" width=\"600px\" autoId=\"customer-create\" [beforeClose]=\"beforeClose\" (sdClosed)=\"closed()\">\n <general-information-form [form]=\"form\" [seed]=\"seed\" [errors]=\"apiErrors.errors()\" [invalidGroups]=\"invalidGroups()\" />\n <div sdFooterRight class=\"d-flex align-items-center gap-8\">\n <sd-button title=\"Lưu\" type=\"fill\" color=\"primary\" autoId=\"customer-save\" [loading]=\"saving()\" (click)=\"save()\" />\n </div>\n </sd-side-drawer>\n `,\n})\nexport class CreateSideDrawerComponent {\n readonly #customerService = inject(CustomerService);\n readonly #confirm = inject(SdConfirmService);\n readonly #notify = inject(SdNotifyService);\n readonly #router = inject(Router);\n readonly #route = inject(ActivatedRoute);\n readonly #injector = inject(Injector);\n private readonly drawer = viewChild.required(SdSideDrawer);\n // why: sd-side-drawer chuyển nội dung ra body, nên tìm field lỗi trong form chứ không trong host của component.\n private readonly formElement = viewChild.required(GeneralInformationFormComponent, { read: ElementRef });\n protected readonly seed: CustomerSaveReq = {\n name: '',\n type: 'individual',\n tier: 'standard',\n email: '',\n phone: '',\n address: '',\n taxCode: null,\n status: 'active',\n note: null,\n };\n protected readonly form: CustomerForm = new FormGroup({});\n protected readonly saving = signal(false);\n protected readonly apiErrors = formApiErrors(this.form);\n protected readonly invalidGroups = signal<CustomerFormGroup[]>([]);\n readonly #unsaved = registerSdUnsavedChangesForm(inject(SdUnsavedChangesService), this.form, { id: 'customer-create', dirty: 'value' });\n\n /** Đóng khi còn thay đổi chưa lưu: hỏi, đồng ý thì bỏ thay đổi (guard rời route không hỏi lại). */\n protected readonly beforeClose = async (): Promise<boolean> => {\n if (!this.#unsaved.dirty() || this.saving()) return !this.saving();\n try {\n await this.#confirm.confirm('Thay đổi chưa lưu sẽ bị mất.', {\n title: 'Đóng khi chưa lưu?',\n yesTitle: 'Bỏ thay đổi',\n noTitle: 'Tiếp tục sửa',\n yesButtonColor: 'warning',\n });\n } catch {\n return false;\n }\n this.#unsaved.markPristine();\n return true;\n };\n\n constructor() {\n afterNextRender(() => this.drawer().open());\n inject(DestroyRef).onDestroy(() => this.#unsaved.destroy());\n }\n\n protected closed(): void {\n void this.#router.navigate(['..'], { relativeTo: this.#route });\n }\n\n protected async save(): Promise<void> {\n if (this.saving()) return;\n this.form.markAllAsTouched();\n if (this.form.invalid) {\n this.#showErrors();\n return;\n }\n this.saving.set(true);\n try {\n const customer = await firstValueFrom(this.#customerService.create(customerSaveReq(this.form)));\n this.#unsaved.markPristine();\n this.#notify.success(`Đã tạo khách hàng ${customer.code}.`);\n this.saving.set(false);\n this.drawer().close();\n } catch (error) {\n if (this.apiErrors.set(error)) this.#showErrors();\n else this.#notify.error(apiErrorMessage(error, 'Không thể lưu. Dữ liệu đã nhập vẫn được giữ.'));\n } finally {\n this.saving.set(false);\n }\n }\n\n /** `sd-inform` trong từng nhóm có lỗi, rồi focus field lỗi đầu tiên. */\n #showErrors(): void {\n this.invalidGroups.set(invalidCustomerGroups(this.form, this.apiErrors.errors()));\n afterNextRender(() => focusFirstInvalid(this.formElement().nativeElement), { injector: this.#injector });\n }\n}\n"],"names":[],"mappings":";;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AE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,+BAA+B,CAAC;oBAClE,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;AAOT,EAAA,CAAA;AACF,iBAAA;;;;;"}
@@ -0,0 +1,99 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ElementRef, Injector, signal, DestroyRef, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { FormGroup } from '@angular/forms';
4
+ import { Router, ActivatedRoute } from '@angular/router';
5
+ import { firstValueFrom } from 'rxjs';
6
+ import { SdButton } from '@sdcorejs/angular/components/button';
7
+ import { SdPageComponent } from '@sdcorejs/angular/modules/layout';
8
+ import { SdNotifyService } from '@sdcorejs/angular/services/notify';
9
+ import { registerSdUnsavedChangesForm, SdUnsavedChangesService } from '@sdcorejs/angular/services/unsaved-changes';
10
+ import { a as apiErrorMessage } from './sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs';
11
+ import { f as formApiErrors, a as focusFirstInvalid } from './sdcorejs-angular-modules-pattern-form-api-errors-DpnYSG2j.mjs';
12
+ import { p as productSaveReq, G as GeneralInformationFormComponent } from './sdcorejs-angular-modules-pattern-general-information-form.component-1bi0JZdf.mjs';
13
+ import { P as ProductService } from './sdcorejs-angular-modules-pattern-product.service-Ba73HPGG.mjs';
14
+
15
+ class CreateComponent {
16
+ #productService = inject(ProductService);
17
+ #notify = inject(SdNotifyService);
18
+ #router = inject(Router);
19
+ #route = inject(ActivatedRoute);
20
+ #host = inject(ElementRef).nativeElement;
21
+ #injector = inject(Injector);
22
+ seed = { code: '', name: '', unit: 'Cái', price: 0, status: 'active' };
23
+ form = new FormGroup({});
24
+ saving = signal(false);
25
+ apiErrors = formApiErrors(this.form);
26
+ // Dirty theo giá trị: gõ rồi xoá về như cũ thì rời trang không bị hỏi.
27
+ #unsaved = registerSdUnsavedChangesForm(inject(SdUnsavedChangesService), this.form, { id: 'product-create', dirty: 'value' });
28
+ constructor() {
29
+ inject(DestroyRef).onDestroy(() => this.#unsaved.destroy());
30
+ }
31
+ cancel() {
32
+ void this.#router.navigate(['..'], { relativeTo: this.#route });
33
+ }
34
+ async save() {
35
+ if (this.saving())
36
+ return;
37
+ this.form.markAllAsTouched();
38
+ if (this.form.invalid) {
39
+ this.#focusFirstInvalid();
40
+ return;
41
+ }
42
+ this.saving.set(true);
43
+ try {
44
+ const product = await firstValueFrom(this.#productService.create(productSaveReq(this.form)));
45
+ this.#unsaved.markPristine();
46
+ this.#notify.success(`Đã tạo sản phẩm ${product.code}.`);
47
+ // replaceUrl: Back ở trang chi tiết về danh sách, không quay lại form tạo mới.
48
+ await this.#router.navigate(['..', product.id, 'detail'], { relativeTo: this.#route, replaceUrl: true });
49
+ }
50
+ catch (error) {
51
+ // Lưu lỗi: giữ nguyên dữ liệu đã nhập; lỗi theo field hiện ngay trên field.
52
+ if (this.apiErrors.set(error))
53
+ this.#focusFirstInvalid();
54
+ else
55
+ this.#notify.error(apiErrorMessage(error, 'Không thể lưu. Dữ liệu đã nhập vẫn được giữ.'));
56
+ }
57
+ finally {
58
+ this.saving.set(false);
59
+ }
60
+ }
61
+ #focusFirstInvalid() {
62
+ afterNextRender(() => focusFirstInvalid(this.#host), { injector: this.#injector });
63
+ }
64
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: CreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
65
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.21", type: CreateComponent, isStandalone: true, selector: "create", ngImport: i0, template: `
66
+ <sd-page-form title="Tạo mới sản phẩm" [backLink]="['..']">
67
+ <div headerRight class="d-flex align-items-center gap-8">
68
+ <sd-button title="Huỷ" type="outline" autoId="product-cancel" (click)="cancel()" />
69
+ <sd-button title="Lưu" type="fill" color="primary" autoId="product-save" [loading]="saving()" (click)="save()" />
70
+ </div>
71
+ <div class="py-16">
72
+ <general-information-form [form]="form" [seed]="seed" [errors]="apiErrors.errors()" />
73
+ </div>
74
+ </sd-page-form>
75
+ `, isInline: true, dependencies: [{ kind: "component", type: SdPageComponent, selector: "sd-page, sd-page-detail, sd-page-form", inputs: ["title", "description", "noHeader", "backLink", "badges", "width", "aside", "toc"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: GeneralInformationFormComponent, selector: "general-information-form", inputs: ["form", "seed", "editing", "errors"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
76
+ }
77
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: CreateComponent, decorators: [{
78
+ type: Component,
79
+ args: [{
80
+ selector: 'create',
81
+ standalone: true,
82
+ changeDetection: ChangeDetectionStrategy.OnPush,
83
+ imports: [SdPageComponent, SdButton, GeneralInformationFormComponent],
84
+ template: `
85
+ <sd-page-form title="Tạo mới sản phẩm" [backLink]="['..']">
86
+ <div headerRight class="d-flex align-items-center gap-8">
87
+ <sd-button title="Huỷ" type="outline" autoId="product-cancel" (click)="cancel()" />
88
+ <sd-button title="Lưu" type="fill" color="primary" autoId="product-save" [loading]="saving()" (click)="save()" />
89
+ </div>
90
+ <div class="py-16">
91
+ <general-information-form [form]="form" [seed]="seed" [errors]="apiErrors.errors()" />
92
+ </div>
93
+ </sd-page-form>
94
+ `,
95
+ }]
96
+ }], ctorParameters: () => [] });
97
+
98
+ export { CreateComponent };
99
+ //# sourceMappingURL=sdcorejs-angular-modules-pattern-create.component-BbDoQccI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-modules-pattern-create.component-BbDoQccI.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/product/pages/create/create.component.ts"],"sourcesContent":["import { afterNextRender, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Injector, signal } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdPageComponent } from '@sdcorejs/angular/modules/layout';\nimport { SdNotifyService } from '@sdcorejs/angular/services/notify';\nimport { registerSdUnsavedChangesForm, SdUnsavedChangesService } from '@sdcorejs/angular/services/unsaved-changes';\nimport { apiErrorMessage } from '../../../../utils/api-error';\nimport { focusFirstInvalid } from '../../../../utils/focus-first-invalid';\nimport { formApiErrors } from '../../../../utils/form-api-errors';\nimport {\n GeneralInformationFormComponent,\n productSaveReq,\n type ProductForm,\n} from '../../components/general-information-form/general-information-form.component';\nimport { ProductService } from '../../services/product.service';\nimport type { ProductSaveReq } from '../../services/product.model';\n\n@Component({\n selector: 'create',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SdPageComponent, SdButton, GeneralInformationFormComponent],\n template: `\n <sd-page-form title=\"Tạo mới sản phẩm\" [backLink]=\"['..']\">\n <div headerRight class=\"d-flex align-items-center gap-8\">\n <sd-button title=\"Huỷ\" type=\"outline\" autoId=\"product-cancel\" (click)=\"cancel()\" />\n <sd-button title=\"Lưu\" type=\"fill\" color=\"primary\" autoId=\"product-save\" [loading]=\"saving()\" (click)=\"save()\" />\n </div>\n <div class=\"py-16\">\n <general-information-form [form]=\"form\" [seed]=\"seed\" [errors]=\"apiErrors.errors()\" />\n </div>\n </sd-page-form>\n `,\n})\nexport class CreateComponent {\n readonly #productService = inject(ProductService);\n readonly #notify = inject(SdNotifyService);\n readonly #router = inject(Router);\n readonly #route = inject(ActivatedRoute);\n readonly #host: HTMLElement = inject(ElementRef).nativeElement;\n readonly #injector = inject(Injector);\n protected readonly seed: ProductSaveReq = { code: '', name: '', unit: 'Cái', price: 0, status: 'active' };\n protected readonly form: ProductForm = new FormGroup({});\n protected readonly saving = signal(false);\n protected readonly apiErrors = formApiErrors(this.form);\n // Dirty theo giá trị: gõ rồi xoá về như cũ thì rời trang không bị hỏi.\n readonly #unsaved = registerSdUnsavedChangesForm(inject(SdUnsavedChangesService), this.form, { id: 'product-create', dirty: 'value' });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.#unsaved.destroy());\n }\n\n protected cancel(): void {\n void this.#router.navigate(['..'], { relativeTo: this.#route });\n }\n\n protected async save(): Promise<void> {\n if (this.saving()) return;\n this.form.markAllAsTouched();\n if (this.form.invalid) {\n this.#focusFirstInvalid();\n return;\n }\n this.saving.set(true);\n try {\n const product = await firstValueFrom(this.#productService.create(productSaveReq(this.form)));\n this.#unsaved.markPristine();\n this.#notify.success(`Đã tạo sản phẩm ${product.code}.`);\n // replaceUrl: Back ở trang chi tiết về danh sách, không quay lại form tạo mới.\n await this.#router.navigate(['..', product.id, 'detail'], { relativeTo: this.#route, replaceUrl: true });\n } catch (error) {\n // Lưu lỗi: giữ nguyên dữ liệu đã nhập; lỗi theo field hiện ngay trên field.\n if (this.apiErrors.set(error)) this.#focusFirstInvalid();\n else this.#notify.error(apiErrorMessage(error, 'Không thể lưu. Dữ liệu đã nhập vẫn được giữ.'));\n } finally {\n this.saving.set(false);\n }\n }\n\n #focusFirstInvalid(): void {\n afterNextRender(() => focusFirstInvalid(this.#host), { injector: this.#injector });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAoCa,eAAe,CAAA;AACjB,IAAA,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC;AACxC,IAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;AACjC,IAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;AACxB,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/B,IAAA,KAAK,GAAgB,MAAM,CAAC,UAAU,CAAC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