@sdcorejs/angular 20.3.2 → 20.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/components/badge/index.d.ts +19 -1
  5. package/components/section/index.d.ts +13 -1
  6. package/components/splitter/index.d.ts +1 -1
  7. package/components/tab-router/index.d.ts +47 -5
  8. package/components/table/index.d.ts +127 -13
  9. package/components/upload-file/index.d.ts +181 -21
  10. package/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
  11. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  12. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
  13. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  14. package/fesm2022/sdcorejs-angular-components-section.mjs +15 -3
  15. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  16. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  17. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  18. package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
  19. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +393 -78
  20. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  21. package/fesm2022/sdcorejs-angular-components-table.mjs +444 -16
  22. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  23. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +887 -174
  24. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  25. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +7 -2
  26. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  27. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +5 -2
  28. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  29. package/fesm2022/sdcorejs-angular-forms-chip.mjs +422 -122
  30. package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
  31. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +4 -0
  32. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  33. package/fesm2022/sdcorejs-angular-forms-date.mjs +4 -0
  34. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  35. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +4 -0
  36. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  37. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +17 -2
  38. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  39. package/fesm2022/sdcorejs-angular-forms-input.mjs +4 -0
  40. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  41. package/fesm2022/sdcorejs-angular-forms-select.mjs +26 -20
  42. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  43. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +14 -1
  44. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  45. package/fesm2022/sdcorejs-angular-i18n.mjs +210 -0
  46. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  47. package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-DnbDCdcz.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs} +3 -3
  48. package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-DnbDCdcz.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs.map} +1 -1
  49. package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-EBHM4kx2.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs} +3 -3
  50. package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-EBHM4kx2.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs.map} +1 -1
  51. package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BtHe8YIW.mjs → sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs} +3 -3
  52. package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BtHe8YIW.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs.map} +1 -1
  53. package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-eFshU7ew.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs} +4 -4
  54. package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-eFshU7ew.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs.map} +1 -1
  55. package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
  56. package/fesm2022/sdcorejs-angular-modules-layout.mjs +266 -11
  57. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs +23 -0
  59. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map +1 -0
  60. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs +16 -0
  61. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map +1 -0
  62. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-BubUwgBK.mjs +51 -0
  63. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-BubUwgBK.mjs.map +1 -0
  64. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C9WQdsEi.mjs +131 -0
  65. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C9WQdsEi.mjs.map +1 -0
  66. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-s7ZXoakT.mjs +130 -0
  67. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-s7ZXoakT.mjs.map +1 -0
  68. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BxfQux1Q.mjs +99 -0
  69. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BxfQux1Q.mjs.map +1 -0
  70. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-D4GrcahQ.mjs +460 -0
  71. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-D4GrcahQ.mjs.map +1 -0
  72. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlYVJqHo.mjs +118 -0
  73. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlYVJqHo.mjs.map +1 -0
  74. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +18 -0
  75. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +1 -0
  76. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Bfx6_CmA.mjs +66 -0
  77. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Bfx6_CmA.mjs.map +1 -0
  78. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-3PUIy1Vi.mjs +148 -0
  79. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-3PUIy1Vi.mjs.map +1 -0
  80. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CbYMo3D1.mjs +172 -0
  81. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CbYMo3D1.mjs.map +1 -0
  82. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-awjgX7ph.mjs +90 -0
  83. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-awjgX7ph.mjs.map +1 -0
  84. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-c__NdSt3.mjs +467 -0
  85. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-c__NdSt3.mjs.map +1 -0
  86. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-Bjvq6wJz.mjs +514 -0
  87. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-Bjvq6wJz.mjs.map +1 -0
  88. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-FwmYVkag.mjs +61 -0
  89. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-FwmYVkag.mjs.map +1 -0
  90. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs +87 -0
  91. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs.map +1 -0
  92. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs +232 -0
  93. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs.map +1 -0
  94. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-pqT7lnS6.mjs +170 -0
  95. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-pqT7lnS6.mjs.map +1 -0
  96. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs +70 -0
  97. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs.map +1 -0
  98. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DZXPZuM4.mjs +100 -0
  99. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DZXPZuM4.mjs.map +1 -0
  100. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BjMOON6K.mjs +522 -0
  101. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BjMOON6K.mjs.map +1 -0
  102. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Bf9QWXBp.mjs +115 -0
  103. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Bf9QWXBp.mjs.map +1 -0
  104. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CuDjsIzi.mjs +118 -0
  105. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CuDjsIzi.mjs.map +1 -0
  106. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkVrMSPZ.mjs +164 -0
  107. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkVrMSPZ.mjs.map +1 -0
  108. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkxheDVz.mjs +629 -0
  109. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkxheDVz.mjs.map +1 -0
  110. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-E8rkFCkK.mjs +71 -0
  111. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-E8rkFCkK.mjs.map +1 -0
  112. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DgmM-wTI.mjs +1069 -0
  113. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DgmM-wTI.mjs.map +1 -0
  114. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs +186 -0
  115. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +1 -0
  116. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs +97 -0
  117. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +1 -0
  118. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs +12 -0
  119. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs.map +1 -0
  120. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-C3coYwmZ.mjs +48 -0
  121. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-C3coYwmZ.mjs.map +1 -0
  122. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs +297 -0
  123. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs.map +1 -0
  124. package/fesm2022/sdcorejs-angular-modules-pattern-routes-9ujH01cX.mjs +74 -0
  125. package/fesm2022/sdcorejs-angular-modules-pattern-routes-9ujH01cX.mjs.map +1 -0
  126. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BfpsCkim.mjs +45 -0
  127. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BfpsCkim.mjs.map +1 -0
  128. package/fesm2022/sdcorejs-angular-modules-pattern-routes-C7b5dRrJ.mjs +165 -0
  129. package/fesm2022/sdcorejs-angular-modules-pattern-routes-C7b5dRrJ.mjs.map +1 -0
  130. package/fesm2022/sdcorejs-angular-modules-pattern-routes-CGeqkySv.mjs +66 -0
  131. package/fesm2022/sdcorejs-angular-modules-pattern-routes-CGeqkySv.mjs.map +1 -0
  132. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DoBxGoRE.mjs +74 -0
  133. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DoBxGoRE.mjs.map +1 -0
  134. package/fesm2022/sdcorejs-angular-modules-pattern-routes-dBuQqYkO.mjs +43 -0
  135. package/fesm2022/sdcorejs-angular-modules-pattern-routes-dBuQqYkO.mjs.map +1 -0
  136. package/fesm2022/sdcorejs-angular-modules-pattern-routes-quSIwMOx.mjs +50 -0
  137. package/fesm2022/sdcorejs-angular-modules-pattern-routes-quSIwMOx.mjs.map +1 -0
  138. package/fesm2022/sdcorejs-angular-modules-pattern-routes-rR-MpQFh.mjs +99 -0
  139. package/fesm2022/sdcorejs-angular-modules-pattern-routes-rR-MpQFh.mjs.map +1 -0
  140. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-LQNpFSmN.mjs +406 -0
  141. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-LQNpFSmN.mjs.map +1 -0
  142. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-CcmrUIvP.mjs +317 -0
  143. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-CcmrUIvP.mjs.map +1 -0
  144. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Cq72tG9h.mjs +143 -0
  145. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Cq72tG9h.mjs.map +1 -0
  146. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-xFbutFLY.mjs +132 -0
  147. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-xFbutFLY.mjs.map +1 -0
  148. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CsfGgGJb.mjs +128 -0
  149. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CsfGgGJb.mjs.map +1 -0
  150. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DYPI_CRD.mjs +100 -0
  151. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DYPI_CRD.mjs.map +1 -0
  152. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-lHmdUXWT.mjs +357 -0
  153. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-lHmdUXWT.mjs.map +1 -0
  154. package/fesm2022/sdcorejs-angular-modules-pattern.mjs +2 -0
  155. package/fesm2022/sdcorejs-angular-modules-pattern.mjs.map +1 -0
  156. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +104 -4
  157. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
  158. package/forms/chip/index.d.ts +136 -26
  159. package/i18n/index.d.ts +42 -0
  160. package/modules/layout/index.d.ts +89 -6
  161. package/modules/pattern/README.md +76 -0
  162. package/modules/pattern/docs/detail.md +237 -0
  163. package/modules/pattern/docs/drawer.md +484 -0
  164. package/modules/pattern/docs/flow.md +631 -0
  165. package/modules/pattern/docs/form.md +518 -0
  166. package/modules/pattern/docs/header-actions.md +342 -0
  167. package/modules/pattern/docs/list.md +247 -0
  168. package/modules/pattern/docs/relation.md +180 -0
  169. package/modules/pattern/docs/select.md +206 -0
  170. package/modules/pattern/docs/split.md +350 -0
  171. package/modules/pattern/docs/states.md +168 -0
  172. package/modules/pattern/features/approval/entity.resolver.ts +21 -0
  173. package/modules/pattern/features/approval/pages/detail/detail.component.ts +139 -0
  174. package/modules/pattern/features/approval/pages/list/approval-inbox.ts +7 -0
  175. package/modules/pattern/features/approval/pages/list/list.component.html +20 -0
  176. package/modules/pattern/features/approval/pages/list/list.component.ts +149 -0
  177. package/modules/pattern/features/approval/routes.ts +30 -0
  178. package/modules/pattern/features/approval/services/approval.model.ts +38 -0
  179. package/modules/pattern/features/approval/services/approval.service.ts +23 -0
  180. package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +123 -0
  181. package/modules/pattern/features/category/components/general-information-form/general-information-form.component.ts +61 -0
  182. package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +134 -0
  183. package/modules/pattern/features/category/entity.resolver.ts +27 -0
  184. package/modules/pattern/features/category/pages/list/list.component.html +20 -0
  185. package/modules/pattern/features/category/pages/list/list.component.ts +105 -0
  186. package/modules/pattern/features/category/routes.ts +42 -0
  187. package/modules/pattern/features/category/services/category.model.ts +39 -0
  188. package/modules/pattern/features/category/services/category.service.ts +36 -0
  189. package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +131 -0
  190. package/modules/pattern/features/customer/components/customer-select/customer-select.component.ts +72 -0
  191. package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.ts +30 -0
  192. package/modules/pattern/features/customer/components/debts-view/debts-view.component.ts +28 -0
  193. package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +106 -0
  194. package/modules/pattern/features/customer/components/documents-view/documents-view.component.ts +50 -0
  195. package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.ts +140 -0
  196. package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.ts +39 -0
  197. package/modules/pattern/features/customer/components/orders-view/orders-view.component.ts +35 -0
  198. package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +101 -0
  199. package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +127 -0
  200. package/modules/pattern/features/customer/entity.resolver.ts +21 -0
  201. package/modules/pattern/features/customer/pages/list/list.component.html +22 -0
  202. package/modules/pattern/features/customer/pages/list/list.component.ts +113 -0
  203. package/modules/pattern/features/customer/pages/profile/profile.component.ts +120 -0
  204. package/modules/pattern/features/customer/pipes/customer-detail.pipe.ts +18 -0
  205. package/modules/pattern/features/customer/routes.ts +59 -0
  206. package/modules/pattern/features/customer/services/customer.model.ts +87 -0
  207. package/modules/pattern/features/customer/services/customer.service.ts +79 -0
  208. package/modules/pattern/features/import/components/mapping-form/mapping-form.component.ts +41 -0
  209. package/modules/pattern/features/import/components/preview-view/preview-view.component.ts +44 -0
  210. package/modules/pattern/features/import/pages/flow/flow.component.ts +269 -0
  211. package/modules/pattern/features/import/routes.ts +19 -0
  212. package/modules/pattern/features/import/services/import.model.ts +82 -0
  213. package/modules/pattern/features/import/services/import.service.ts +18 -0
  214. package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +74 -0
  215. package/modules/pattern/features/order/components/bulk-result/bulk-result.component.ts +46 -0
  216. package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +96 -0
  217. package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +205 -0
  218. package/modules/pattern/features/order/components/lines-view/lines-view.component.ts +42 -0
  219. package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +128 -0
  220. package/modules/pattern/features/order/entity.resolver.ts +37 -0
  221. package/modules/pattern/features/order/pages/create/create.component.ts +99 -0
  222. package/modules/pattern/features/order/pages/detail/detail.component.ts +222 -0
  223. package/modules/pattern/features/order/pages/list/list.component.html +38 -0
  224. package/modules/pattern/features/order/pages/list/list.component.ts +291 -0
  225. package/modules/pattern/features/order/pages/update/update.component.ts +119 -0
  226. package/modules/pattern/features/order/routes.ts +54 -0
  227. package/modules/pattern/features/order/services/order.model.ts +109 -0
  228. package/modules/pattern/features/order/services/order.service.ts +63 -0
  229. package/modules/pattern/features/partner/pages/create/create.component.ts +324 -0
  230. package/modules/pattern/features/partner/routes.ts +20 -0
  231. package/modules/pattern/features/partner/services/partner.model.ts +30 -0
  232. package/modules/pattern/features/partner/services/partner.service.ts +17 -0
  233. package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +88 -0
  234. package/modules/pattern/features/product/components/product-select/product-select.component.ts +65 -0
  235. package/modules/pattern/features/product/components/product-status-select/product-status-select.component.ts +30 -0
  236. package/modules/pattern/features/product/entity.resolver.ts +21 -0
  237. package/modules/pattern/features/product/pages/create/create.component.ts +85 -0
  238. package/modules/pattern/features/product/pages/detail/detail.component.ts +53 -0
  239. package/modules/pattern/features/product/pages/list/list.component.html +30 -0
  240. package/modules/pattern/features/product/pages/list/list.component.ts +71 -0
  241. package/modules/pattern/features/product/pages/update/update.component.ts +86 -0
  242. package/modules/pattern/features/product/pipes/product-detail.pipe.ts +18 -0
  243. package/modules/pattern/features/product/routes.ts +48 -0
  244. package/modules/pattern/features/product/services/product.model.ts +38 -0
  245. package/modules/pattern/features/product/services/product.service.ts +48 -0
  246. package/modules/pattern/features/settings/pages/update/update.component.ts +227 -0
  247. package/modules/pattern/features/settings/routes.ts +24 -0
  248. package/modules/pattern/features/settings/services/settings.model.ts +18 -0
  249. package/modules/pattern/features/settings/services/settings.service.ts +15 -0
  250. package/modules/pattern/features/settings/settings.resolver.ts +8 -0
  251. package/modules/pattern/index.d.ts +50 -0
  252. package/package.json +5 -1
  253. package/services/unsaved-changes/index.d.ts +11 -0
@@ -1 +1 @@
1
- {"version":3,"file":"sdcorejs-angular-services-unsaved-changes.mjs","sources":["../../../projects/sdcorejs-angular/services/unsaved-changes/src/unsaved-changes.tokens.ts","../../../projects/sdcorejs-angular/services/unsaved-changes/src/unsaved-changes.service.ts","../../../projects/sdcorejs-angular/services/unsaved-changes/src/unsaved-changes.adapters.ts","../../../projects/sdcorejs-angular/services/unsaved-changes/sdcorejs-angular-services-unsaved-changes.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { InjectionToken, inject } from '@angular/core';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport { SdUnsavedChangesConfirmationAdapter, SdUnsavedChangesDecision, SdUnsavedChangesPromptContext } from './unsaved-changes.model';\n\nexport interface SdUnsavedChangesWindow {\n addEventListener(type: 'beforeunload', listener: (event: BeforeUnloadEvent) => void): void;\n removeEventListener(type: 'beforeunload', listener: (event: BeforeUnloadEvent) => void): void;\n confirm?(message?: string): boolean;\n}\n\nexport const SD_UNSAVED_CHANGES_WINDOW = new InjectionToken<SdUnsavedChangesWindow | null>('SD_UNSAVED_CHANGES_WINDOW', {\n factory: () => inject(DOCUMENT).defaultView as SdUnsavedChangesWindow | null,\n});\n\nexport const SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER = new InjectionToken<SdUnsavedChangesConfirmationAdapter>(\n 'SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER',\n {\n factory: () => {\n const windowRef = inject(SD_UNSAVED_CHANGES_WINDOW);\n const i18n = inject(I18nService);\n return {\n confirm: (context: SdUnsavedChangesPromptContext): SdUnsavedChangesDecision => {\n if (!windowRef?.confirm) return 'cancel';\n const message = context.message || i18n.t('core.service.unsaved-changes.message');\n return windowRef.confirm(message) ? 'discard' : 'cancel';\n },\n };\n },\n }\n);\n","import { DestroyRef, Injectable, computed, effect, inject, isSignal, signal } from '@angular/core';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport {\n SdUnsavedChangesConfirmOptions,\n SdUnsavedChangesDecision,\n SdUnsavedChangesRegistration,\n SdUnsavedChangesWatcher,\n} from './unsaved-changes.model';\nimport { SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER, SD_UNSAVED_CHANGES_WINDOW } from './unsaved-changes.tokens';\n\ninterface RegistryEntry {\n readonly watcher: SdUnsavedChangesWatcher;\n readonly dirtyOverride: ReturnType<typeof signal<boolean | undefined>>;\n readonly destroyed: ReturnType<typeof signal<boolean>>;\n readonly dirty: ReturnType<typeof computed<boolean>>;\n readonly ref: SdUnsavedChangesRegistration;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SdUnsavedChangesService {\n readonly #adapter = inject(SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER);\n readonly #window = inject(SD_UNSAVED_CHANGES_WINDOW);\n readonly #i18n = inject(I18nService);\n readonly #destroyRef = inject(DestroyRef);\n readonly #entries = signal<readonly RegistryEntry[]>([]);\n readonly #pendingPrompts = new Map<unknown, Promise<boolean>>();\n\n readonly registrations = computed(() => this.#entries().map(entry => entry.ref));\n readonly dirty = computed(() => this.#dirtyEntries().length > 0);\n\n constructor() {\n effect(onCleanup => {\n if (!this.#window || !this.dirty()) return;\n const listener = (event: BeforeUnloadEvent): void => {\n const message = this.#dirtyEntries()[0]?.watcher.message ?? this.#i18n.t('core.service.unsaved-changes.message');\n event.preventDefault();\n event.returnValue = message;\n };\n this.#window.addEventListener('beforeunload', listener);\n onCleanup(() => this.#window?.removeEventListener('beforeunload', listener));\n });\n\n this.#destroyRef.onDestroy(() => {\n for (const entry of this.#entries()) {\n if (entry.destroyed()) continue;\n entry.destroyed.set(true);\n this.#runCleanup(entry.watcher);\n }\n this.#entries.set([]);\n this.#pendingPrompts.clear();\n });\n }\n\n register(watcher: SdUnsavedChangesWatcher): SdUnsavedChangesRegistration {\n const existing = this.#entries().find(entry => entry.watcher.id === watcher.id && Object.is(entry.watcher.scope, watcher.scope));\n if (existing) {\n if (existing.watcher !== watcher) this.#runCleanup(watcher);\n return existing.ref;\n }\n\n const dirtyOverride = signal<boolean | undefined>(undefined);\n const destroyed = signal(false);\n const dirty = computed(() => !destroyed() && (dirtyOverride() ?? readDirty(watcher.isDirty)));\n const entry = {} as RegistryEntry;\n const ref: SdUnsavedChangesRegistration = {\n id: watcher.id,\n scope: watcher.scope,\n message: watcher.message,\n destroyed: destroyed.asReadonly(),\n dirty,\n markDirty: () => dirtyOverride.set(true),\n markPristine: () => dirtyOverride.set(false),\n save: () => this.#runEntryAction(entry, 'save'),\n reset: () => this.#runEntryAction(entry, 'reset'),\n discard: () => this.#runEntryAction(entry, 'discard'),\n destroy: () => this.#destroyEntry(entry),\n };\n Object.assign(entry, { watcher, dirtyOverride, destroyed, dirty, ref });\n this.#entries.update(entries => [...entries, entry]);\n return ref;\n }\n\n hasChanges(scope?: unknown): boolean {\n return this.#dirtyEntries(scope).length > 0;\n }\n\n confirmLeave(options: SdUnsavedChangesConfirmOptions = {}): Promise<boolean> {\n if (!this.hasChanges(options.scope)) return Promise.resolve(true);\n const promptKey = options.scope;\n const existingPrompt = this.#pendingPrompts.get(promptKey);\n if (existingPrompt) return existingPrompt;\n\n const watchers = this.#dirtyEntries(options.scope).map(entry => entry.ref);\n const message = watchers.find(watcher => watcher.message)?.message ?? this.#i18n.t('core.service.unsaved-changes.message');\n const run = async (): Promise<boolean> => {\n try {\n const rawDecision = await Promise.resolve(\n this.#adapter.confirm({ reason: options.reason ?? 'manual', scope: options.scope, message, watchers })\n );\n const decision: SdUnsavedChangesDecision = typeof rawDecision === 'boolean' ? (rawDecision ? 'discard' : 'cancel') : rawDecision;\n if (decision === 'save') return this.saveAll(options.scope);\n if (decision === 'discard') return this.discardAll(options.scope);\n return false;\n } catch {\n return false;\n }\n };\n\n const pending = run().finally(() => {\n if (this.#pendingPrompts.get(promptKey) === pending) this.#pendingPrompts.delete(promptKey);\n });\n this.#pendingPrompts.set(promptKey, pending);\n return pending;\n }\n\n saveAll(scope?: unknown): Promise<boolean> {\n return this.#runAll('save', scope);\n }\n\n resetAll(scope?: unknown): Promise<boolean> {\n return this.#runAll('reset', scope);\n }\n\n discardAll(scope?: unknown): Promise<boolean> {\n return this.#runAll('discard', scope);\n }\n\n async #runAll(action: 'save' | 'reset' | 'discard', scope?: unknown): Promise<boolean> {\n for (const entry of this.#dirtyEntries(scope)) {\n if (!(await this.#runEntryAction(entry, action))) return false;\n }\n return true;\n }\n\n async #runEntryAction(entry: RegistryEntry, action: 'save' | 'reset' | 'discard'): Promise<boolean> {\n if (entry.destroyed()) return true;\n try {\n const callback = entry.watcher[action];\n const result = callback ? await Promise.resolve(callback()) : undefined;\n if (result === false) return false;\n // A callback owns its underlying dirty source (for example FormGroup\n // marks itself pristine). Only synthesize pristine state when there is\n // no callback capable of updating that source.\n entry.dirtyOverride.set(callback ? undefined : false);\n return true;\n } catch {\n return false;\n }\n }\n\n #dirtyEntries(scope?: unknown): RegistryEntry[] {\n return this.#entries().filter(entry => (scope === undefined || Object.is(entry.watcher.scope, scope)) && entry.dirty());\n }\n\n #destroyEntry(entry: RegistryEntry): void {\n if (entry.destroyed()) return;\n entry.destroyed.set(true);\n this.#runCleanup(entry.watcher);\n this.#entries.update(entries => entries.filter(candidate => candidate !== entry));\n }\n\n #runCleanup(watcher: SdUnsavedChangesWatcher): void {\n try {\n watcher.cleanup?.();\n } catch {\n // Cleanup must never prevent registry teardown.\n }\n }\n}\n\nfunction readDirty(source: SdUnsavedChangesWatcher['isDirty']): boolean {\n if (typeof source === 'boolean') return source;\n if (isSignal(source)) return !!source();\n return !!source();\n}\n","import { signal } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { CanDeactivateFn } from '@angular/router';\nimport { SdUnsavedChangesConfirmOptions, SdUnsavedChangesMaybeAsync, SdUnsavedChangesRegistration } from './unsaved-changes.model';\nimport { SdUnsavedChangesService } from './unsaved-changes.service';\nimport { inject } from '@angular/core';\n\nexport interface SdUnsavedChangesFormOptions<TValue> {\n readonly id: string;\n readonly scope?: unknown;\n readonly message?: string;\n readonly save?: (value: TValue) => SdUnsavedChangesMaybeAsync<void | boolean>;\n readonly reset?: (form: FormGroup) => SdUnsavedChangesMaybeAsync<void | boolean>;\n readonly discard?: (form: FormGroup) => SdUnsavedChangesMaybeAsync<void | boolean>;\n}\n\nexport function registerSdUnsavedChangesForm<TValue extends Record<string, unknown>>(\n service: SdUnsavedChangesService,\n form: FormGroup,\n options: SdUnsavedChangesFormOptions<TValue>\n): SdUnsavedChangesRegistration {\n let snapshot = cloneValue(form.getRawValue()) as TValue;\n const dirty = signal(form.dirty);\n const subscription = form.events.subscribe(() => dirty.set(form.dirty));\n const resetToSnapshot = (): void => {\n form.reset(cloneValue(snapshot));\n form.markAsPristine();\n dirty.set(false);\n };\n const registration = service.register({\n id: options.id,\n scope: options.scope,\n message: options.message,\n isDirty: dirty,\n save: async () => {\n const result = options.save ? await Promise.resolve(options.save(form.getRawValue() as TValue)) : undefined;\n if (result === false) return false;\n snapshot = cloneValue(form.getRawValue()) as TValue;\n form.markAsPristine();\n dirty.set(false);\n return true;\n },\n reset: async () => {\n const result = options.reset ? await Promise.resolve(options.reset(form)) : undefined;\n if (result === false) return false;\n if (!options.reset) resetToSnapshot();\n else {\n form.markAsPristine();\n dirty.set(false);\n }\n return true;\n },\n discard: async () => {\n const result = options.discard ? await Promise.resolve(options.discard(form)) : undefined;\n if (result === false) return false;\n if (!options.discard) resetToSnapshot();\n else {\n form.markAsPristine();\n dirty.set(false);\n }\n return true;\n },\n cleanup: () => subscription.unsubscribe(),\n });\n return registration;\n}\n\nexport function createSdUnsavedChangesCloseGuard(\n service: SdUnsavedChangesService,\n options: Omit<SdUnsavedChangesConfirmOptions, 'reason'> = {}\n): () => Promise<boolean> {\n return () => service.confirmLeave({ ...options, reason: 'close' });\n}\n\nexport const sdUnsavedChangesGuard: CanDeactivateFn<unknown> = () => inject(SdUnsavedChangesService).confirmLeave({ reason: 'navigation' });\n\nfunction cloneValue<T>(value: T): T {\n if (value instanceof Date) return new Date(value.getTime()) as T;\n if (Array.isArray(value)) return value.map(item => cloneValue(item)) as T;\n if (value && typeof value === 'object') {\n return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, cloneValue(item)])) as T;\n }\n return value;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAWa,yBAAyB,GAAG,IAAI,cAAc,CAAgC,2BAA2B,EAAE;IACtH,OAAO,EAAE,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC,WAA4C;AAC7E,CAAA;MAEY,uCAAuC,GAAG,IAAI,cAAc,CACvE,yCAAyC,EACzC;IACE,OA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AAC1C,KAAA,CAAC;AACF,IAAA,OAAO,YAAY;AACrB;SAEgB,gCAAgC,CAC9C,OAAgC,EAChC,UAA0D,EAAE,EAAA;AAE5D,IAAA,OAAO,MAAM,OAAO,CAAC,YAAY,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACpE;MAEa,qBAAqB,GAA6B,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;AAE1I,SAAS,UAAU,CAAI,KAAQ,EAAA;IAC7B,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAM;AAChE,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,CAAM;AACzE,IAAA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACtC,QAAA,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAM;IACrG;AACA,IAAA,OAAO,KAAK;AACd;;ACnFA;;AAEG;;;;"}
1
+ {"version":3,"file":"sdcorejs-angular-services-unsaved-changes.mjs","sources":["../../../projects/sdcorejs-angular/services/unsaved-changes/src/unsaved-changes.tokens.ts","../../../projects/sdcorejs-angular/services/unsaved-changes/src/unsaved-changes.service.ts","../../../projects/sdcorejs-angular/services/unsaved-changes/src/unsaved-changes.adapters.ts","../../../projects/sdcorejs-angular/services/unsaved-changes/sdcorejs-angular-services-unsaved-changes.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { InjectionToken, inject } from '@angular/core';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport { SdUnsavedChangesConfirmationAdapter, SdUnsavedChangesDecision, SdUnsavedChangesPromptContext } from './unsaved-changes.model';\n\nexport interface SdUnsavedChangesWindow {\n addEventListener(type: 'beforeunload', listener: (event: BeforeUnloadEvent) => void): void;\n removeEventListener(type: 'beforeunload', listener: (event: BeforeUnloadEvent) => void): void;\n confirm?(message?: string): boolean;\n}\n\nexport const SD_UNSAVED_CHANGES_WINDOW = new InjectionToken<SdUnsavedChangesWindow | null>('SD_UNSAVED_CHANGES_WINDOW', {\n factory: () => inject(DOCUMENT).defaultView as SdUnsavedChangesWindow | null,\n});\n\nexport const SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER = new InjectionToken<SdUnsavedChangesConfirmationAdapter>(\n 'SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER',\n {\n factory: () => {\n const windowRef = inject(SD_UNSAVED_CHANGES_WINDOW);\n const i18n = inject(I18nService);\n return {\n confirm: (context: SdUnsavedChangesPromptContext): SdUnsavedChangesDecision => {\n if (!windowRef?.confirm) return 'cancel';\n const message = context.message || i18n.t('core.service.unsaved-changes.message');\n return windowRef.confirm(message) ? 'discard' : 'cancel';\n },\n };\n },\n }\n);\n","import { DestroyRef, Injectable, computed, effect, inject, isSignal, signal } from '@angular/core';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport {\n SdUnsavedChangesConfirmOptions,\n SdUnsavedChangesDecision,\n SdUnsavedChangesRegistration,\n SdUnsavedChangesWatcher,\n} from './unsaved-changes.model';\nimport { SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER, SD_UNSAVED_CHANGES_WINDOW } from './unsaved-changes.tokens';\n\ninterface RegistryEntry {\n readonly watcher: SdUnsavedChangesWatcher;\n readonly dirtyOverride: ReturnType<typeof signal<boolean | undefined>>;\n readonly destroyed: ReturnType<typeof signal<boolean>>;\n readonly dirty: ReturnType<typeof computed<boolean>>;\n readonly ref: SdUnsavedChangesRegistration;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SdUnsavedChangesService {\n readonly #adapter = inject(SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER);\n readonly #window = inject(SD_UNSAVED_CHANGES_WINDOW);\n readonly #i18n = inject(I18nService);\n readonly #destroyRef = inject(DestroyRef);\n readonly #entries = signal<readonly RegistryEntry[]>([]);\n readonly #pendingPrompts = new Map<unknown, Promise<boolean>>();\n\n readonly registrations = computed(() => this.#entries().map(entry => entry.ref));\n readonly dirty = computed(() => this.#dirtyEntries().length > 0);\n\n constructor() {\n effect(onCleanup => {\n if (!this.#window || !this.dirty()) return;\n const listener = (event: BeforeUnloadEvent): void => {\n const message = this.#dirtyEntries()[0]?.watcher.message ?? this.#i18n.t('core.service.unsaved-changes.message');\n event.preventDefault();\n event.returnValue = message;\n };\n this.#window.addEventListener('beforeunload', listener);\n onCleanup(() => this.#window?.removeEventListener('beforeunload', listener));\n });\n\n this.#destroyRef.onDestroy(() => {\n for (const entry of this.#entries()) {\n if (entry.destroyed()) continue;\n entry.destroyed.set(true);\n this.#runCleanup(entry.watcher);\n }\n this.#entries.set([]);\n this.#pendingPrompts.clear();\n });\n }\n\n register(watcher: SdUnsavedChangesWatcher): SdUnsavedChangesRegistration {\n const existing = this.#entries().find(entry => entry.watcher.id === watcher.id && Object.is(entry.watcher.scope, watcher.scope));\n if (existing) {\n if (existing.watcher !== watcher) this.#runCleanup(watcher);\n return existing.ref;\n }\n\n const dirtyOverride = signal<boolean | undefined>(undefined);\n const destroyed = signal(false);\n const dirty = computed(() => !destroyed() && (dirtyOverride() ?? readDirty(watcher.isDirty)));\n const entry = {} as RegistryEntry;\n const ref: SdUnsavedChangesRegistration = {\n id: watcher.id,\n scope: watcher.scope,\n message: watcher.message,\n destroyed: destroyed.asReadonly(),\n dirty,\n markDirty: () => dirtyOverride.set(true),\n markPristine: () => dirtyOverride.set(false),\n save: () => this.#runEntryAction(entry, 'save'),\n reset: () => this.#runEntryAction(entry, 'reset'),\n discard: () => this.#runEntryAction(entry, 'discard'),\n destroy: () => this.#destroyEntry(entry),\n };\n Object.assign(entry, { watcher, dirtyOverride, destroyed, dirty, ref });\n this.#entries.update(entries => [...entries, entry]);\n return ref;\n }\n\n hasChanges(scope?: unknown): boolean {\n return this.#dirtyEntries(scope).length > 0;\n }\n\n confirmLeave(options: SdUnsavedChangesConfirmOptions = {}): Promise<boolean> {\n if (!this.hasChanges(options.scope)) return Promise.resolve(true);\n const promptKey = options.scope;\n const existingPrompt = this.#pendingPrompts.get(promptKey);\n if (existingPrompt) return existingPrompt;\n\n const watchers = this.#dirtyEntries(options.scope).map(entry => entry.ref);\n const message = watchers.find(watcher => watcher.message)?.message ?? this.#i18n.t('core.service.unsaved-changes.message');\n const adapter = options.adapter ?? this.#adapter;\n const run = async (): Promise<boolean> => {\n try {\n const rawDecision = await Promise.resolve(\n adapter.confirm({ reason: options.reason ?? 'manual', scope: options.scope, message, watchers })\n );\n const decision: SdUnsavedChangesDecision = typeof rawDecision === 'boolean' ? (rawDecision ? 'discard' : 'cancel') : rawDecision;\n if (decision === 'save') return this.saveAll(options.scope);\n if (decision === 'discard') return this.discardAll(options.scope);\n return false;\n } catch {\n return false;\n }\n };\n\n const pending = run().finally(() => {\n if (this.#pendingPrompts.get(promptKey) === pending) this.#pendingPrompts.delete(promptKey);\n });\n this.#pendingPrompts.set(promptKey, pending);\n return pending;\n }\n\n saveAll(scope?: unknown): Promise<boolean> {\n return this.#runAll('save', scope);\n }\n\n resetAll(scope?: unknown): Promise<boolean> {\n return this.#runAll('reset', scope);\n }\n\n discardAll(scope?: unknown): Promise<boolean> {\n return this.#runAll('discard', scope);\n }\n\n async #runAll(action: 'save' | 'reset' | 'discard', scope?: unknown): Promise<boolean> {\n for (const entry of this.#dirtyEntries(scope)) {\n if (!(await this.#runEntryAction(entry, action))) return false;\n }\n return true;\n }\n\n async #runEntryAction(entry: RegistryEntry, action: 'save' | 'reset' | 'discard'): Promise<boolean> {\n if (entry.destroyed()) return true;\n try {\n const callback = entry.watcher[action];\n const result = callback ? await Promise.resolve(callback()) : undefined;\n if (result === false) return false;\n // A callback owns its underlying dirty source (for example FormGroup\n // marks itself pristine). Only synthesize pristine state when there is\n // no callback capable of updating that source.\n entry.dirtyOverride.set(callback ? undefined : false);\n return true;\n } catch {\n return false;\n }\n }\n\n #dirtyEntries(scope?: unknown): RegistryEntry[] {\n return this.#entries().filter(entry => (scope === undefined || Object.is(entry.watcher.scope, scope)) && entry.dirty());\n }\n\n #destroyEntry(entry: RegistryEntry): void {\n if (entry.destroyed()) return;\n entry.destroyed.set(true);\n this.#runCleanup(entry.watcher);\n this.#entries.update(entries => entries.filter(candidate => candidate !== entry));\n }\n\n #runCleanup(watcher: SdUnsavedChangesWatcher): void {\n try {\n watcher.cleanup?.();\n } catch {\n // Cleanup must never prevent registry teardown.\n }\n }\n}\n\nfunction readDirty(source: SdUnsavedChangesWatcher['isDirty']): boolean {\n if (typeof source === 'boolean') return source;\n if (isSignal(source)) return !!source();\n return !!source();\n}\n","import { signal } from '@angular/core';\nimport { FormGroup, PristineChangeEvent, type AbstractControl, type ControlEvent } from '@angular/forms';\nimport { CanDeactivateFn } from '@angular/router';\nimport { SdUnsavedChangesConfirmOptions, SdUnsavedChangesMaybeAsync, SdUnsavedChangesRegistration } from './unsaved-changes.model';\nimport { SdUnsavedChangesService } from './unsaved-changes.service';\nimport { inject } from '@angular/core';\n\nexport interface SdUnsavedChangesFormOptions<TValue> {\n readonly id: string;\n readonly scope?: unknown;\n readonly message?: string;\n readonly save?: (value: TValue) => SdUnsavedChangesMaybeAsync<void | boolean>;\n readonly reset?: (form: FormGroup) => SdUnsavedChangesMaybeAsync<void | boolean>;\n readonly discard?: (form: FormGroup) => SdUnsavedChangesMaybeAsync<void | boolean>;\n /**\n * `'control'` (default): the form's own `dirty` flag. `'value'`: dirty only while the value differs from the\n * saved one, so a value typed back to what it was is no change, whether or not the field marks its control dirty.\n * In `'value'` mode each control's saved value is the one it holds once it has joined the form (an `<sd-*>`\n * field registers and writes its model after this call), and it is taken again when the form or the control is\n * marked pristine, on `save()`, `reset()`, `discard()` and on `markPristine()` of the registration. A page that\n * loads another record into the same form calls `markPristine()` once the record is in.\n */\n readonly dirty?: 'control' | 'value';\n}\n\nexport function registerSdUnsavedChangesForm<TValue extends Record<string, unknown>>(\n service: SdUnsavedChangesService,\n form: FormGroup,\n options: SdUnsavedChangesFormOptions<TValue>\n): SdUnsavedChangesRegistration {\n let snapshot = cloneValue(form.getRawValue()) as TValue;\n const valueMode = options.dirty === 'value';\n // why: `<sd-*>` fields join the form in an effect after this call and write their model with `emitEvent: false`;\n // some of them write a user edit without marking the control dirty, or mark it only after the value. The saved\n // value of a control is therefore not tied to its dirty flag: it is read once the task that added the control\n // ends (its model is in by then), and again whenever the form or the control is marked pristine.\n const pending = new Set<string>();\n let settleQueued = false;\n const keyOf = (control: AbstractControl): string | undefined => {\n let current: AbstractControl | null = control;\n while (current && current.parent !== form) current = current.parent;\n return current ? Object.entries(form.controls).find(([, child]) => child === current)?.[0] : undefined;\n };\n const takeBaseline = (keys: Iterable<string>): void => {\n if (!valueMode) return;\n const value = form.getRawValue() as Record<string, unknown>;\n const baseline = snapshot as Record<string, unknown>;\n for (const key of keys) {\n if (key in form.controls) baseline[key] = cloneValue(value[key]);\n pending.delete(key);\n }\n };\n const readFormDirty = (): boolean => {\n if (!valueMode) return form.dirty;\n const value = form.getRawValue() as Record<string, unknown>;\n const baseline = snapshot as Record<string, unknown>;\n return Object.keys(form.controls).some(key => !pending.has(key) && !sameValue(value[key], baseline[key]));\n };\n const dirty = signal(readFormDirty());\n const settle = (): void => {\n settleQueued = false;\n takeBaseline([...pending]);\n dirty.set(readFormDirty());\n };\n const trackControls = (event?: ControlEvent): void => {\n const baseline = snapshot as Record<string, unknown>;\n for (const key of Object.keys(baseline)) {\n if (!(key in form.controls)) delete baseline[key];\n }\n for (const key of Object.keys(form.controls)) {\n if (!(key in baseline) && !pending.has(key)) pending.add(key);\n }\n // `form.events` reports the form's own pristine state, with the control that changed it as source.\n if (event instanceof PristineChangeEvent) {\n const key = event.source === form ? undefined : keyOf(event.source);\n if (event.pristine) takeBaseline(event.source === form ? Object.keys(form.controls) : key === undefined ? [] : [key]);\n // A field that marks dirty before writing (as Angular's value accessors do) still holds the value before\n // the edit: a control that joined in this very task gets that value as its saved value.\n else if (key !== undefined && pending.has(key)) takeBaseline([key]);\n }\n if (pending.size && !settleQueued) {\n settleQueued = true;\n queueMicrotask(settle);\n }\n };\n if (valueMode) trackControls();\n const subscription = form.events.subscribe(event => {\n if (valueMode) trackControls(event);\n dirty.set(readFormDirty());\n });\n const resetToSnapshot = (): void => {\n form.reset(cloneValue(snapshot));\n form.markAsPristine();\n takeBaseline(Object.keys(form.controls));\n dirty.set(false);\n };\n const registration = service.register({\n id: options.id,\n scope: options.scope,\n message: options.message,\n isDirty: dirty,\n save: async () => {\n const result = options.save ? await Promise.resolve(options.save(form.getRawValue() as TValue)) : undefined;\n if (result === false) return false;\n snapshot = cloneValue(form.getRawValue()) as TValue;\n pending.clear();\n form.markAsPristine();\n dirty.set(false);\n return true;\n },\n reset: async () => {\n const result = options.reset ? await Promise.resolve(options.reset(form)) : undefined;\n if (result === false) return false;\n if (!options.reset) resetToSnapshot();\n else {\n form.markAsPristine();\n takeBaseline(Object.keys(form.controls));\n dirty.set(false);\n }\n return true;\n },\n discard: async () => {\n const result = options.discard ? await Promise.resolve(options.discard(form)) : undefined;\n if (result === false) return false;\n if (!options.discard) resetToSnapshot();\n else {\n form.markAsPristine();\n takeBaseline(Object.keys(form.controls));\n dirty.set(false);\n }\n return true;\n },\n cleanup: () => subscription.unsubscribe(),\n });\n if (!valueMode) return registration;\n // why: in value mode `markPristine()` means \"the current value is saved\": the form keeps reporting later edits.\n // The registry's own `markPristine()` pins the registration clean until a prompt resets it.\n return {\n ...registration,\n markPristine: () => {\n snapshot = cloneValue(form.getRawValue()) as TValue;\n pending.clear();\n form.markAsPristine();\n dirty.set(false);\n },\n };\n}\n\nexport function createSdUnsavedChangesCloseGuard(\n service: SdUnsavedChangesService,\n options: Omit<SdUnsavedChangesConfirmOptions, 'reason'> = {}\n): () => Promise<boolean> {\n return () => service.confirmLeave({ ...options, reason: 'close' });\n}\n\nexport const sdUnsavedChangesGuard: CanDeactivateFn<unknown> = () => inject(SdUnsavedChangesService).confirmLeave({ reason: 'navigation' });\n\nfunction cloneValue<T>(value: T): T {\n if (value instanceof Date) return new Date(value.getTime()) as T;\n if (Array.isArray(value)) return value.map(item => cloneValue(item)) as T;\n if (value && typeof value === 'object') {\n return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, cloneValue(item)])) as T;\n }\n return value;\n}\n\nfunction sameValue(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();\n if (Array.isArray(a) && Array.isArray(b)) return a.length === b.length && a.every((item, index) => sameValue(item, b[index]));\n if (a && b && typeof a === 'object' && typeof b === 'object' && !Array.isArray(a) && !Array.isArray(b)) {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n return (\n aKeys.length === bKeys.length &&\n aKeys.every(key => sameValue((a as Record<string, unknown>)[key], (b as Record<string, unknown>)[key]))\n );\n }\n return false;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAWa,yBAAyB,GAAG,IAAI,cAAc,CAAgC,2BAA2B,EAAE;IACtH,OAAO,EAAE,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC,WAA4C;AAC7E,CAAA;MAEY,uCAAuC,GAAG,IAAI,cAAc,CACvE,yCAAyC,EACzC;IACE,OAAO,EAAE,MAAK;AACZ,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACnD,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;QAChC,OAAO;AACL,YAAA,OAAO,EAAE,CAAC,OAAsC,KAA8B;gBAC5E,IAAI,CAAC,SAAS,EA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AAI,CAAC,CAAC,CAAC;AAC5B,QAAA,QACE,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAC7B,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,SAAS,CAAE,CAA6B,CAAC,GAAG,CAAC,EAAG,CAA6B,CAAC,GAAG,CAAC,CAAC,CAAC;IAE3G;AACA,IAAA,OAAO,KAAK;AACd;;ACnLA;;AAEG;;;;"}
@@ -1,28 +1,17 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { PipeTransform, AfterViewInit, OnDestroy, ElementRef, TemplateRef } from '@angular/core';
3
- import { FormGroup, FormControl, FormGroupDirective, NgForm } from '@angular/forms';
4
- import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
5
- import { MatChipInputEvent } from '@angular/material/chips';
2
+ import { ElementRef, TemplateRef } from '@angular/core';
3
+ import { FormGroup, FormControl } from '@angular/forms';
4
+ import { MatChipGrid, MatChipInputEvent } from '@angular/material/chips';
6
5
  import { ErrorStateMatcher } from '@angular/material/core';
7
6
  import { MatFormFieldAppearance, FloatLabelType } from '@angular/material/form-field';
8
7
  import { SdViewDefDirective, SdLabelDefDirective } from '@sdcorejs/angular/forms/directives';
9
8
  import { SdLabelPlacement, SdViewed, SdViewedInput, SdFormControl } from '@sdcorejs/angular/forms/models';
10
9
  import { Size } from '@sdcorejs/utils/models';
11
10
 
12
- declare class SdRemovableChipPipe implements PipeTransform {
13
- constructor();
14
- transform(item: any, removable: boolean | ((item: any) => boolean)): boolean;
15
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdRemovableChipPipe, never>;
16
- static ɵpipe: _angular_core.ɵɵPipeDeclaration<SdRemovableChipPipe, "sdRemovableChip", true>;
17
- }
18
-
19
- declare class SdChipErrorStateMatcher implements ErrorStateMatcher {
20
- private formControl;
21
- constructor(formControl: FormControl);
22
- isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean;
23
- }
24
- declare class SdChip implements AfterViewInit, OnDestroy {
11
+ declare class SdChip {
25
12
  #private;
13
+ /** why: id ổn định của lỗi (`<mat-error>` hoặc chữ ẩn của `hideInlineError`) để ô nhập trỏ `aria-describedby` sang (A8). */
14
+ readonly errorId: string;
26
15
  autoIdInput: _angular_core.InputSignalWithTransform<string | undefined, string | null | undefined>;
27
16
  autoId: _angular_core.Signal<string | undefined>;
28
17
  readonly dataDisabled: _angular_core.Signal<"true" | "false">;
@@ -52,9 +41,31 @@ declare class SdChip implements AfterViewInit, OnDestroy {
52
41
  removable: _angular_core.InputSignalWithTransform<boolean | ((item: any) => boolean), boolean | ((item: any) => boolean) | null | undefined>;
53
42
  hideInlineError: _angular_core.InputSignalWithTransform<boolean, unknown>;
54
43
  required: _angular_core.InputSignalWithTransform<boolean, unknown>;
44
+ /** Fewest chips; > 0 adds `Validators.minLength`. Replaces `min`. */
45
+ minCount: _angular_core.InputSignalWithTransform<number | undefined, number | null | undefined>;
46
+ /** Most chips; > 0 adds `Validators.maxLength` (for a model set from outside) and stops adding once reached. Replaces `max`. */
47
+ maxCount: _angular_core.InputSignalWithTransform<number | undefined, number | null | undefined>;
48
+ /** @deprecated Use `minCount`; `minCount` wins when both are set. */
55
49
  min: _angular_core.InputSignalWithTransform<number, number | null | undefined>;
50
+ /** @deprecated Use `maxCount`; `maxCount` wins when both are set. */
56
51
  max: _angular_core.InputSignalWithTransform<number, number | null | undefined>;
52
+ /** `false` keeps the field read-only for typing: the input stays (mat-chip-grid needs it) but is read-only and out of the Tab order. */
57
53
  addable: _angular_core.InputSignalWithTransform<boolean, unknown>;
54
+ /** Leaving the field turns the typed text into a chip. `false` drops the text instead, as before. */
55
+ addOnBlur: _angular_core.InputSignalWithTransform<boolean, unknown>;
56
+ /** Keys that commit the typed text (`KeyboardEvent.key`). A paste also splits on these characters, new lines and tabs. */
57
+ separators: _angular_core.InputSignalWithTransform<readonly string[], readonly string[] | null | undefined>;
58
+ /** Normalises typed or pasted text before it is compared and stored; `null` or `''` drops it. Default: trim. */
59
+ chipTransform: _angular_core.InputSignalWithTransform<(raw: string) => string | number | null, ((raw: string) => string | number | null) | null | undefined>;
60
+ /**
61
+ * Checks a normalised value: an i18n key (or the message itself) when it is refused, else `null`. A refused value does
62
+ * not become a chip; its text stays in the input and the message shows under the field.
63
+ */
64
+ chipValidator: _angular_core.InputSignal<((value: string | number) => string | null) | null | undefined>;
65
+ /** Shows a button that removes every chip `removable` allows. Off by default, like `clearable` of `<sd-date>`. */
66
+ clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
67
+ /** Chips shown while the field is not focused; the rest fold into “+N”. `null` shows them all. `2` suits `<sd-table>` cells. */
68
+ maxVisible: _angular_core.InputSignal<number | null | undefined>;
58
69
  disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
59
70
  /** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */
60
71
  viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
@@ -64,31 +75,130 @@ declare class SdChip implements AfterViewInit, OnDestroy {
64
75
  model: _angular_core.ModelSignal<(string | number)[] | undefined>;
65
76
  sdChange: _angular_core.OutputEmitterRef<any[]>;
66
77
  input: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
78
+ readonly chipGrid: _angular_core.Signal<MatChipGrid | undefined>;
79
+ private readonly chipTextElements;
67
80
  sdViewDef: _angular_core.Signal<SdViewDefDirective<any, any> | undefined>;
68
81
  sdLabelDef: _angular_core.Signal<SdLabelDefDirective | undefined>;
69
82
  sdLabelTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
70
83
  sdValueTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
71
- isFocused: boolean;
72
- readonly separatorKeysCodes: number[];
73
- readonly selectable = true;
84
+ /** The field is being edited: the `sdViewDef` face gives way to the field. A signal, so OnPush redraws without `detectChanges()` (D1). */
85
+ readonly isFocused: _angular_core.WritableSignal<boolean>;
86
+ /**
87
+ * Control of `mat-chip-grid` only. why: the grid is a ControlValueAccessor that writes the text of the rendered chips
88
+ * into its control on blur, after a timeout (numbers became strings, a form reset was undone). It still needs an
89
+ * ngControl to work out its error state on every check, so it gets this one; nothing reads its value.
90
+ */
91
+ readonly gridControl: FormControl<unknown>;
92
+ /** `minCount`, else the deprecated `min`. */
93
+ readonly effectiveMinCount: _angular_core.Signal<number>;
94
+ /** `maxCount`, else the deprecated `max`. */
95
+ readonly effectiveMaxCount: _angular_core.Signal<number>;
96
+ /** why: phím tách do `separators` + onInputKeydown xử lý, nên Material không nhận phím nào. */
97
+ readonly noSeparatorKeys: number[];
98
+ /**
99
+ * Items rendered as chips: every value except `null`, `undefined` and `''`, so `0` shows (A2). Display only: the
100
+ * model is never rewritten. why: exact duplicates are dropped too, because the chips are tracked by value.
101
+ */
102
+ readonly chips: _angular_core.Signal<(string | number)[]>;
103
+ /** Message of a typed or pasted value that `chipValidator` refused; it shows under the field until the text changes (B4). */
104
+ readonly inputError: _angular_core.WritableSignal<string | null>;
105
+ /** Last polite announcement; a new id re-renders the text so a repeated message is read again. */
106
+ readonly liveMessage: _angular_core.WritableSignal<{
107
+ id: number;
108
+ text: string;
109
+ } | null>;
110
+ /** Chip that the typed value duplicates, highlighted for 1.4s (B3). */
111
+ readonly duplicateChip: _angular_core.WritableSignal<string | number | null>;
112
+ /** Text of the chips that the 240px limit cuts; only they get a tooltip (B7). */
113
+ readonly truncatedChips: _angular_core.WritableSignal<ReadonlySet<string>>;
114
+ /** `maxCount` reached: typing and pasting add nothing more (B3). */
115
+ readonly full: _angular_core.Signal<boolean>;
116
+ /** Chips on screen: all while the field has focus, else at most `maxVisible` (B7). */
117
+ readonly visibleChips: _angular_core.Signal<(string | number)[]>;
118
+ /** Chips folded into “+N”. */
119
+ readonly hiddenCount: _angular_core.Signal<number>;
120
+ /** At least one chip may be removed, so the clear button has something to do (B6). */
121
+ readonly hasRemovable: _angular_core.Signal<boolean>;
122
+ /**
123
+ * Placeholder: “Đã đủ …” once full, else the input, else “Nhập rồi nhấn Enter” — never the label (B5). None when not
124
+ * addable, or while chips are folded into “+N”: nobody types then, and the input only fills the rest of the line (C1).
125
+ */
126
+ readonly effectivePlaceholder: _angular_core.Signal<string | null>;
127
+ readonly clearLabel: _angular_core.Signal<string>;
128
+ /** Tooltip of the lock on a chip that `removable` keeps (C3). */
129
+ readonly lockedLabel: _angular_core.Signal<string>;
130
+ /** Sizes of the chip ✕ / lock and of the clear-button icon for the current `size` (C1). */
131
+ readonly iconSizes: _angular_core.Signal<{
132
+ readonly chip: "12px";
133
+ readonly clear: "16px";
134
+ } | {
135
+ readonly chip: "14px";
136
+ readonly clear: "18px";
137
+ } | {
138
+ readonly chip: "16px";
139
+ readonly clear: "20px";
140
+ }>;
141
+ readonly moreLabel: _angular_core.Signal<string>;
74
142
  constructor();
75
143
  get formControl(): SdFormControl;
76
144
  get inputControl(): FormControl<any>;
77
145
  readonly errorMessage: _angular_core.Signal<string | undefined>;
78
- get matcher(): SdChipErrorStateMatcher;
79
- ngAfterViewInit(): void;
80
- ngOnDestroy(): void;
146
+ get matcher(): ErrorStateMatcher;
147
+ /**
148
+ * The one place that decides whether the error shows (A5): the `ErrorStateMatcher` of the chip grid and the input,
149
+ * `<mat-error>`, the `hideInlineError` icon and `aria-invalid` all read it. Invalid and touched, or the parent form
150
+ * was submitted; a field that is only dirty shows nothing.
151
+ */
152
+ isErrorShown(): boolean;
153
+ /** Text under the field: the `chipValidator` message of the typed value first, else the form error. */
154
+ readonly errorText: _angular_core.Signal<string | undefined>;
155
+ /** Whether `item` may be removed, per `removable`; applied on every removal path (A1). */
156
+ isRemovable(item: string | number): boolean;
157
+ /** Accessible name of the ✕ button of a chip (A6). */
158
+ removeLabel(item: string | number): string;
159
+ /** Accessible name of a chip that `removable` keeps: its text plus “, Không xoá được” (C3). A removable chip keeps its text. */
160
+ chipLabel(item: string | number): string | null;
161
+ /** Text of a chip, also its key for `truncatedChips`. */
162
+ chipText(item: string | number): string;
163
+ /** A separator key (`separators`) commits the typed text; the key itself is not typed (B2 / separators). */
164
+ onInputKeydown(event: KeyboardEvent): void;
165
+ /** The refused-value message goes as soon as the text changes (B4). */
166
+ onInputText(): void;
167
+ /**
168
+ * A paste that holds a separator, a new line or a tab becomes several chips in one change (B2). Duplicates are
169
+ * skipped, refused values and values past `maxCount` stay in the input, and the result is announced. A paste with
170
+ * no separator is left to the browser.
171
+ */
172
+ onPaste(event: ClipboardEvent): void;
173
+ /** Backspace / Delete on a chip that `removable` keeps says why nothing happened (A1, B3). */
174
+ onChipKeydown(event: KeyboardEvent, item: string | number): void;
175
+ /** “+N” moves focus to the input, where every chip shows (B7). */
176
+ onMoreClick(event: Event): void;
177
+ /** Focus entering the input or a chip unfolds “+N”; focus on the “+N” button itself does not (B7). */
178
+ onFocusIn(event: FocusEvent): void;
179
+ /**
180
+ * Marks the field touched once focus leaves it; moving between the input and the chips does not count.
181
+ * why: `mat-chip-grid` is no longer bound to the control. As a ControlValueAccessor it wrote the text of the rendered
182
+ * chips back into the control on blur (numbers became strings, a form reset was undone), so the component marks
183
+ * touched itself, like the grid did.
184
+ */
185
+ onFocusOut(event: FocusEvent): void;
81
186
  onAdd: (event: MatChipInputEvent) => void;
82
187
  onClickChip: (event: Event, item: any) => void;
83
188
  onRemove: (item: any) => void;
84
- onSelect: (event: MatAutocompleteSelectedEvent) => void;
85
189
  onFocus: () => void;
86
190
  onBlur: () => void;
87
191
  onClick: () => void;
192
+ /**
193
+ * why: khi `sdViewDef` đang hiển thị thì bên trong không còn phần tử nào focus được, nên phần tử view là lối vào
194
+ * duy nhất để chuyển sang chế độ sửa. Bàn phím phải mở được y hệt chuột → Enter/Space chạy chung handler;
195
+ * preventDefault chặn Space cuộn trang (A7).
196
+ */
197
+ onViewKeydown: (event: Event) => void;
88
198
  focus: () => void;
89
199
  onClear: ($event?: any) => void;
90
200
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdChip, never>;
91
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdChip, "sd-chip", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "labelPlacement": { "alias": "labelPlacement"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "removable": { "alias": "removable"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "addable": { "alias": "addable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "hyperlink": { "alias": "hyperlink"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; }, { "model": "modelChange"; "sdChange": "sdChange"; }, ["sdViewDef", "sdLabelDef", "sdLabelTemplate", "sdValueTemplate"], never, true, never>;
201
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdChip, "sd-chip", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "labelPlacement": { "alias": "labelPlacement"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "removable": { "alias": "removable"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "minCount": { "alias": "minCount"; "required": false; "isSignal": true; }; "maxCount": { "alias": "maxCount"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "addable": { "alias": "addable"; "required": false; "isSignal": true; }; "addOnBlur": { "alias": "addOnBlur"; "required": false; "isSignal": true; }; "separators": { "alias": "separators"; "required": false; "isSignal": true; }; "chipTransform": { "alias": "chipTransform"; "required": false; "isSignal": true; }; "chipValidator": { "alias": "chipValidator"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "maxVisible": { "alias": "maxVisible"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "hyperlink": { "alias": "hyperlink"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; }, { "model": "modelChange"; "sdChange": "sdChange"; }, ["sdViewDef", "sdLabelDef", "sdLabelTemplate", "sdValueTemplate"], never, true, never>;
92
202
  }
93
203
 
94
- export { SdChip, SdRemovableChipPipe };
204
+ export { SdChip };
package/i18n/index.d.ts CHANGED
@@ -38,6 +38,7 @@ declare const EN_MESSAGES: {
38
38
  readonly 'core.component.table.mobile.reorder': "Drag to reorder row";
39
39
  readonly 'core.component.table.mobile.details': "Details";
40
40
  readonly 'core.component.table.mobile.summary': "Summary";
41
+ readonly 'core.common.back': "Back";
41
42
  readonly 'core.common.cancel': "Cancel";
42
43
  readonly 'core.common.close': "Close";
43
44
  readonly 'core.common.reload': "Reload page";
@@ -142,6 +143,15 @@ declare const EN_MESSAGES: {
142
143
  readonly 'core.form.chip.required': "Please enter information";
143
144
  readonly 'core.form.chip.minlength': "Please enter at least {min} values";
144
145
  readonly 'core.form.chip.maxlength': "Please enter at most {max} values";
146
+ readonly 'core.form.chip.remove': "Remove {value}";
147
+ readonly 'core.form.chip.placeholder': "Type, then press Enter";
148
+ readonly 'core.form.chip.locked': "Cannot be removed";
149
+ readonly 'core.form.chip.duplicate': "“{value}” is already added";
150
+ readonly 'core.form.chip.full': "All {max} values are added";
151
+ readonly 'core.form.chip.added': "Added {count}";
152
+ readonly 'core.form.chip.skipped': "skipped {count} duplicates";
153
+ readonly 'core.form.chip.more': "Show {count} more";
154
+ readonly 'core.form.chip.clear': "Remove all";
145
155
  readonly 'core.form.chip-calendar.required': "Please enter information";
146
156
  readonly 'core.form.chip-calendar.minlength': "Please enter at least {min} values";
147
157
  readonly 'core.form.chip-calendar.maxlength': "Please enter at most {max} values";
@@ -500,6 +510,8 @@ declare const EN_MESSAGES: {
500
510
  readonly 'core.component.table.selector-action.default-msg': "items selected";
501
511
  readonly 'core.component.tab-router.too-many-tabs': "You have opened too many tabs.";
502
512
  readonly 'core.component.tab-router.close-tab': "Close tab";
513
+ readonly 'core.component.tab-router.close-others': "Close other tabs";
514
+ readonly 'core.component.tab-router.unsaved': "Unsaved changes";
503
515
  readonly 'core.component.tab-router.open-tabs': "{count} open tabs";
504
516
  readonly 'core.component.tab-router.tab-list': "Tab list";
505
517
  readonly 'core.component.upload-file.upload': "Upload file";
@@ -548,6 +560,12 @@ declare const EN_MESSAGES: {
548
560
  readonly 'core.module.layout.forbidden.title': "Access denied";
549
561
  readonly 'core.module.layout.forbidden.message': "You don't have permission to access this page. Please contact your administrator or go back to the home page";
550
562
  readonly 'core.module.layout.forbidden.back-home': "Back to home";
563
+ readonly 'core.module.layout.page.actions': "Page actions";
564
+ readonly 'core.module.layout.page.toc': "Contents";
565
+ readonly 'core.module.layout.page.leave.title': "Leave this page without saving?";
566
+ readonly 'core.module.layout.page.leave.message': "Unsaved changes will be lost.";
567
+ readonly 'core.module.layout.page.leave.stay': "Stay";
568
+ readonly 'core.module.layout.page.leave.leave': "Leave";
551
569
  readonly 'core.module.layout.not-found.title': "404 - Page not found";
552
570
  readonly 'core.module.layout.not-found.message': "The page you're looking for doesn't exist or has been removed. Please check the URL or go back to the home page to continue.";
553
571
  readonly 'core.module.layout.not-found.back': "Go back";
@@ -876,11 +894,35 @@ declare const EN_MESSAGES: {
876
894
  readonly 'core.form.select.search': "Search";
877
895
  readonly 'core.form.search-field.clear': "Clear search";
878
896
  readonly 'core.component.table.loading': "Loading table data";
897
+ readonly 'core.component.table.loaded': "Loaded {count} rows";
898
+ readonly 'core.component.table.loaded-one': "Loaded 1 row";
899
+ readonly 'core.component.table.tree-toggle': "Toggle child rows";
879
900
  readonly 'core.component.upload-file.loading': "Uploading file";
880
901
  readonly 'core.component.import-excel.loading': "Loading data";
881
902
  readonly 'core.component.upload-file.remove': "Remove file";
882
903
  readonly 'core.component.upload-file.zoom': "Zoom image";
883
904
  readonly 'core.component.upload-file.view-all': "View all images";
905
+ readonly 'core.component.upload-file.viewer.download': "Download";
906
+ readonly 'core.component.upload-file.viewer.open-new-tab': "Open in new tab";
907
+ readonly 'core.component.upload-file.viewer.zoom-in': "Zoom in";
908
+ readonly 'core.component.upload-file.viewer.zoom-out': "Zoom out";
909
+ readonly 'core.component.upload-file.viewer.fit': "Fit to window";
910
+ readonly 'core.component.upload-file.viewer.rotate': "Rotate";
911
+ readonly 'core.component.upload-file.viewer.prev': "Previous file";
912
+ readonly 'core.component.upload-file.viewer.next': "Next file";
913
+ readonly 'core.component.upload-file.viewer.load-error': "Could not load the file";
914
+ readonly 'core.component.upload-file.viewer.load-error-hint': "Try again or download it to open in another app.";
915
+ readonly 'core.component.upload-file.viewer.no-preview': "No preview available";
916
+ readonly 'core.component.upload-file.viewer.loading': "Loading…";
917
+ readonly 'core.component.upload-file.viewer.position': "File {index} of {total}";
918
+ readonly 'core.component.upload-file.retry': "Retry";
919
+ readonly 'core.component.upload-file.add-image': "Add image";
920
+ readonly 'core.component.upload-file.upload-tile': "Upload";
921
+ readonly 'core.component.upload-file.drop-hint': "Drag files here or";
922
+ readonly 'core.component.upload-file.choose-file': "choose a file";
923
+ readonly 'core.component.upload-file.drop-to-upload': "Drop to upload";
924
+ readonly 'core.component.upload-file.remove-named': "Remove {name}";
925
+ readonly 'core.component.upload-file.no-files': "No files";
884
926
  readonly 'core.component.form-builder.canvas': "Form design canvas";
885
927
  readonly 'core.component.form-builder.toolbar': "Form builder toolbar";
886
928
  readonly 'core.component.form-builder.mode': "Mode";
@@ -2,12 +2,15 @@ import * as _angular_core from '@angular/core';
2
2
  import { Signal, InjectionToken, PipeTransform } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import * as i1 from '@angular/router';
5
- import { Params } from '@angular/router';
5
+ import { Params, CanDeactivateFn } from '@angular/router';
6
6
  import { SdStorage } from '@sdcorejs/angular/services';
7
7
  import { MaybeAsync } from '@sdcorejs/utils/models';
8
8
  import { Observable } from 'rxjs';
9
9
  import { SdViewport } from '@sdcorejs/angular/services/viewport';
10
10
  import * as _sdcorejs_angular_modules_layout from '@sdcorejs/angular/modules/layout';
11
+ import { SdBadgeData } from '@sdcorejs/angular/components/badge';
12
+ import { SdSectionRegistry, SdSection } from '@sdcorejs/angular/components/section';
13
+ import { SdTableLayout } from '@sdcorejs/angular/components/table';
11
14
  import { FlexibleConnectedPositionStrategyOrigin, ConnectedPosition } from '@angular/cdk/overlay';
12
15
 
13
16
  declare class HomeRoutingModule {
@@ -535,14 +538,94 @@ declare class SdLayoutContextService {
535
538
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutContextService>;
536
539
  }
537
540
 
538
- declare class SdPageComponent {
541
+ /** Bề rộng cột nội dung: `full` không giới hạn · `wide` 1200px · `medium` 960px · `narrow` 720px. */
542
+ type SdPageWidth = 'full' | 'wide' | 'medium' | 'narrow';
543
+ /** Đích của nút ←: URL hoặc router commands như `routerLink`. */
544
+ type SdPageBackLink = string | readonly unknown[];
545
+ /** Vị trí cột phụ `[sdAside]` khi đủ chỗ đặt cạnh nội dung. */
546
+ type SdPageAside = 'end' | 'start';
547
+ interface SdPageTocItem {
548
+ readonly title: string;
549
+ readonly el: HTMLElement;
550
+ }
551
+ declare class SdPageComponent implements SdSectionRegistry {
552
+ #private;
539
553
  private el;
540
554
  title: _angular_core.InputSignal<string>;
541
555
  description: _angular_core.InputSignal<string>;
542
556
  noHeader: _angular_core.InputSignalWithTransform<boolean, unknown>;
557
+ /** Hiện nút ← trước title; title, description và badges vẫn lấy từ input. */
558
+ backLink: _angular_core.InputSignal<SdPageBackLink | null | undefined>;
559
+ /** Tối đa 2 badge cạnh title: trạng thái trước, thuộc tính sau. Badge không có `title` bị bỏ qua. */
560
+ badges: _angular_core.InputSignal<readonly SdBadgeData[] | null | undefined>;
561
+ /** `null` / không truyền thì lấy mặc định theo selector: `sd-page` full · `sd-page-detail` wide · `sd-page-form` medium. */
562
+ width: _angular_core.InputSignal<SdPageWidth | null | undefined>;
563
+ /** Cột phụ ở cuối (mặc định) hay ở đầu. Viewport < 1200px thì cột phụ luôn xuống dưới nội dung. */
564
+ aside: _angular_core.InputSignal<SdPageAside | null | undefined>;
565
+ /** Mục lục ở cột phụ, liệt kê các `sd-section` có `title` ở cấp ngoài cùng của thân trang. */
566
+ toc: _angular_core.InputSignalWithTransform<boolean, unknown>;
567
+ readonly resolvedWidth: _angular_core.Signal<SdPageWidth>;
568
+ protected readonly visibleBadges: _angular_core.Signal<SdBadgeData[]>;
569
+ /** Header có nút ← hoặc badge: title một dòng, cắt bằng dấu "…". Màn cũ giữ title xuống dòng như trước. */
570
+ protected readonly hasLead: _angular_core.Signal<boolean>;
571
+ protected readonly tocItems: _angular_core.WritableSignal<readonly SdPageTocItem[]>;
572
+ protected readonly activeTocIndex: _angular_core.WritableSignal<number>;
573
+ private readonly titleBlock;
574
+ private readonly wrapper;
543
575
  constructor();
576
+ /** Cuộn tới section của mục lục thứ `index`. */
577
+ protected scrollToSection(index: number): void;
578
+ /** Thêm một section ngoài cùng của thân trang vào mục lục (gọi bởi `sd-section`). */
579
+ register(section: SdSection, el: HTMLElement): () => void;
544
580
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdPageComponent, never>;
545
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdPageComponent, "sd-page", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "noHeader": { "alias": "noHeader"; "required": false; "isSignal": true; }; }, {}, never, ["[headerLeft]", "[headerRight]", "*"], true, never>;
581
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdPageComponent, "sd-page, sd-page-detail, sd-page-form", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "noHeader": { "alias": "noHeader"; "required": false; "isSignal": true; }; "backLink": { "alias": "backLink"; "required": false; "isSignal": true; }; "badges": { "alias": "badges"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "aside": { "alias": "aside"; "required": false; "isSignal": true; }; "toc": { "alias": "toc"; "required": false; "isSignal": true; }; }, {}, never, ["[headerLeft],[sdHeaderLeft]", "[headerRight],[sdHeaderRight]", "[sdSubheader]", "*", "[sdAside]", "[sdFooterLeft]", "[sdFooterRight]"], true, never>;
582
+ }
583
+
584
+ /**
585
+ * Guard rời trang của `sd-page-form`: còn thay đổi chưa lưu (watcher của `SdUnsavedChangesService`, thường đăng ký
586
+ * bằng `registerSdUnsavedChangesForm(..., { dirty: 'value' })`) thì hỏi bằng dialog xác nhận của Core.
587
+ *
588
+ * why: adapter của service là của cả app (mặc định `window.confirm`); guard này truyền adapter riêng cho lần hỏi
589
+ * này nên app đang dùng `sdUnsavedChangesGuard` không đổi hành vi.
590
+ */
591
+ declare const sdPageFormLeaveGuard: CanDeactivateFn<unknown>;
592
+
593
+ /**
594
+ * Cách mở chi tiết (route con của danh sách): thay danh sách bằng một trang, drawer đè lên danh sách, hoặc `'none'`:
595
+ * `sd-page-list` không đặt router-outlet, route con hiện trong outlet do màn tự đặt trong thân (chia đôi).
596
+ */
597
+ type SdPageListDetail = 'page' | 'drawer' | 'none';
598
+ /** Trạng thái `sd-page-list` mà nội dung bên trong (score card, route con…) đọc qua `SD_PAGE_LIST`. */
599
+ interface SdPageListContext {
600
+ /** Màn thấp (viewport cao < 720px) và `autoCompact` bật: vùng phụ nên chuyển sang dạng gọn. */
601
+ readonly compact: Signal<boolean>;
602
+ /** Đang có route con (chi tiết, tạo, cập nhật). */
603
+ readonly childActive: Signal<boolean>;
604
+ readonly detail: Signal<SdPageListDetail>;
605
+ }
606
+ declare const SD_PAGE_LIST: InjectionToken<SdPageListContext>;
607
+ declare class SdPageList implements SdPageListContext, SdTableLayout {
608
+ #private;
609
+ title: _angular_core.InputSignal<string>;
610
+ description: _angular_core.InputSignal<string>;
611
+ backLink: _angular_core.InputSignal<SdPageBackLink | null | undefined>;
612
+ badges: _angular_core.InputSignal<readonly SdBadgeData[] | null | undefined>;
613
+ width: _angular_core.InputSignal<SdPageWidth | null | undefined>;
614
+ /** Chi tiết là route con: `page` thay danh sách bằng trang con, `drawer` giữ danh sách và mở drawer. */
615
+ detail: _angular_core.InputSignal<SdPageListDetail>;
616
+ /** Tự thu gọn vùng phụ khi viewport thấp. Tắt thì vùng phụ luôn đầy đủ và thân trang cuộn khi thiếu chỗ. */
617
+ autoCompact: _angular_core.InputSignalWithTransform<boolean, unknown>;
618
+ readonly compact: Signal<boolean>;
619
+ readonly childActive: _angular_core.WritableSignal<boolean>;
620
+ /** Bảng chính: `[sdPageListMain]`, hoặc `sd-table` con trực tiếp cuối cùng của thân trang. */
621
+ readonly fillTarget: _angular_core.WritableSignal<Element | null>;
622
+ readonly externalFilterCollapsed: Signal<boolean>;
623
+ protected readonly hidesList: Signal<boolean>;
624
+ constructor();
625
+ protected onActivate(): void;
626
+ protected onDeactivate(): void;
627
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdPageList, never>;
628
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdPageList, "sd-page-list", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "backLink": { "alias": "backLink"; "required": false; "isSignal": true; }; "badges": { "alias": "badges"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "detail": { "alias": "detail"; "required": false; "isSignal": true; }; "autoCompact": { "alias": "autoCompact"; "required": false; "isSignal": true; }; }, {}, never, ["[headerRight],[sdHeaderRight]", "[sdSubheader]", "[sdFooterLeft]", "[sdFooterRight]", "*"], true, never>;
546
629
  }
547
630
 
548
631
  declare class SdLayoutComponent {
@@ -1006,7 +1089,7 @@ declare class SdLayoutContextSwitcher {
1006
1089
  /** Context configuration of the sidebar; nothing renders without items. */
1007
1090
  configuration: _angular_core.InputSignal<SdLayoutContextConfiguration | null | undefined>;
1008
1091
  /** Header trigger, collapsed-rail avatar, or mobile row that opens a bottom sheet. */
1009
- appearance: _angular_core.InputSignal<"sheet" | "header" | "rail">;
1092
+ appearance: _angular_core.InputSignal<"header" | "sheet" | "rail">;
1010
1093
  /** Side the desktop popover opens on; defaults to `below` for the header and `right` for the rail. The sheet ignores it. */
1011
1094
  placement: _angular_core.InputSignal<"below" | "right" | undefined>;
1012
1095
  /**
@@ -1115,5 +1198,5 @@ declare class SdLayoutModule {
1115
1198
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<SdLayoutModule>;
1116
1199
  }
1117
1200
 
1118
- export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_CONTEXT_MARKER_KEY, SD_LAYOUT_CONTEXT_RUNTIME, SD_LAYOUT_DEMO_FALLBACK, SD_LAYOUT_STORAGE_NAMESPACE, SD_LAYOUT_VIEWPORT, SdLayoutComponent, SdLayoutContextService, SdLayoutContextSwitcher, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SdSidebarMobileOverlay, SdSidebarMobileV1, SdSidebarMobileV2, SdSidebarMobileV3, SdSidebarMobileV4, SdSidebarV2, SdSidebarV3, SdSidebarV4, collectMatchedMenuPaths, containsMenuPath, createSdLayoutContextBrowserRuntime, flattenMenuLeaves, getMenuStableKey, groupMenusBySection, isMenuPathMatch, normalizeLayoutMobileBreakpoint, normalizeMenuPath, normalizeSidebarConfiguration, resolveActiveMenuPath, resolveMenuKeys, resolveMenuTrailing, resolveSidebarV2Interaction, resolveSidebarV3Recent, resolveTabName, searchAvailableMenuLeaves, searchMenuLeaves, selectPrimaryMenuGroups };
1119
- export type { ISdLayoutConfiguration, ISdSidebarConfiguration, Menus, ResolvedSidebarRecentConfiguration, SdLayoutAccountAction, SdLayoutChildrenMenu, SdLayoutContext, SdLayoutContextConfiguration, SdLayoutContextRuntime, SdLayoutMenu, SdLayoutMenuBadge, SdLayoutMenuSectionGroup, SdLayoutMenuStatus, SdLayoutMenuTrailing, SdLayoutNotificationConfiguration, SdLayoutRootMenu, SdLayoutStorageNamespace, SdLayoutUserInfo, SdLayoutUserRole, SdLayoutVersionState, SdLayoutViewport, SidebarConfigurationBase, SidebarConfigurationV1, SidebarConfigurationV2, SidebarConfigurationV3, SidebarConfigurationV4 };
1201
+ export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_CONTEXT_MARKER_KEY, SD_LAYOUT_CONTEXT_RUNTIME, SD_LAYOUT_DEMO_FALLBACK, SD_LAYOUT_STORAGE_NAMESPACE, SD_LAYOUT_VIEWPORT, SD_PAGE_LIST, SdLayoutComponent, SdLayoutContextService, SdLayoutContextSwitcher, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SdPageList, SdSidebarMobileOverlay, SdSidebarMobileV1, SdSidebarMobileV2, SdSidebarMobileV3, SdSidebarMobileV4, SdSidebarV2, SdSidebarV3, SdSidebarV4, collectMatchedMenuPaths, containsMenuPath, createSdLayoutContextBrowserRuntime, flattenMenuLeaves, getMenuStableKey, groupMenusBySection, isMenuPathMatch, normalizeLayoutMobileBreakpoint, normalizeMenuPath, normalizeSidebarConfiguration, resolveActiveMenuPath, resolveMenuKeys, resolveMenuTrailing, resolveSidebarV2Interaction, resolveSidebarV3Recent, resolveTabName, sdPageFormLeaveGuard, searchAvailableMenuLeaves, searchMenuLeaves, selectPrimaryMenuGroups };
1202
+ export type { ISdLayoutConfiguration, ISdSidebarConfiguration, Menus, ResolvedSidebarRecentConfiguration, SdLayoutAccountAction, SdLayoutChildrenMenu, SdLayoutContext, SdLayoutContextConfiguration, SdLayoutContextRuntime, SdLayoutMenu, SdLayoutMenuBadge, SdLayoutMenuSectionGroup, SdLayoutMenuStatus, SdLayoutMenuTrailing, SdLayoutNotificationConfiguration, SdLayoutRootMenu, SdLayoutStorageNamespace, SdLayoutUserInfo, SdLayoutUserRole, SdLayoutVersionState, SdLayoutViewport, SdPageAside, SdPageBackLink, SdPageListContext, SdPageListDetail, SdPageWidth, SidebarConfigurationBase, SidebarConfigurationV1, SidebarConfigurationV2, SidebarConfigurationV3, SidebarConfigurationV4 };