@sdcorejs/angular 21.3.1 → 21.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 (386) hide show
  1. package/assets/STYLE-GUIDE.md +25 -5
  2. package/assets/THEME.md +289 -5
  3. package/assets/licenses/tiptap-oss-NOTICES.txt +332 -0
  4. package/assets/scss/ckeditor5.scss +2 -88
  5. package/assets/scss/core/_control.scss +39 -0
  6. package/assets/scss/core/form.scss +444 -45
  7. package/assets/scss/core/view.scss +24 -0
  8. package/assets/scss/editor-content.scss +173 -0
  9. package/assets/scss/sd-core.scss +1 -0
  10. package/assets/scss/themes/_component-tokens.scss +123 -32
  11. package/assets/scss/themes/_material-tokens.scss +112 -0
  12. package/assets/scss/themes/_presets.scss +25 -0
  13. package/assets/scss/themes/_scales.scss +10 -0
  14. package/assets/scss/themes/_semantic.scss +13 -0
  15. package/assets/scss/themes/default.scss +8 -2
  16. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +5 -5
  17. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  18. package/fesm2022/sdcorejs-angular-components-avatar.mjs +142 -11
  19. package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
  20. package/fesm2022/sdcorejs-angular-components-badge.mjs +542 -24
  21. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  22. package/fesm2022/sdcorejs-angular-components-button.mjs +31 -3
  23. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  24. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +5 -20
  25. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
  26. package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
  27. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  28. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1872 -0
  29. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
  30. package/fesm2022/sdcorejs-angular-components-editor.mjs +457 -756
  31. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  32. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +68 -37
  33. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
  34. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2118 -1159
  35. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  36. package/fesm2022/sdcorejs-angular-components-history.mjs +5 -2
  37. package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
  38. package/fesm2022/sdcorejs-angular-components-image-editor.mjs +1 -1
  39. package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -1
  40. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +21 -6
  41. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  42. package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
  43. package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
  44. package/fesm2022/sdcorejs-angular-components-kanban.mjs +12 -2
  45. package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -1
  46. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +177 -283
  47. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -308
  49. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
  50. package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
  51. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-components-operator.mjs +260 -43
  53. package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
  54. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +12 -12
  55. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  56. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  57. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-components-section.mjs +17 -5
  59. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  60. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  61. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  62. package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
  63. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +559 -94
  64. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  65. package/fesm2022/sdcorejs-angular-components-table.mjs +1001 -119
  66. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  67. package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
  68. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  69. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +887 -174
  70. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  71. package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
  72. package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
  73. package/fesm2022/sdcorejs-angular-components-window.mjs +484 -0
  74. package/fesm2022/sdcorejs-angular-components-window.mjs.map +1 -0
  75. package/fesm2022/sdcorejs-angular-components.mjs +1 -0
  76. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  77. package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
  78. package/fesm2022/sdcorejs-angular-directives.mjs +18 -1
  79. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  80. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +20 -2
  81. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  82. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
  83. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
  84. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +457 -125
  85. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  86. package/fesm2022/sdcorejs-angular-forms-chip.mjs +414 -122
  87. package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
  88. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +79 -13
  89. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  90. package/fesm2022/sdcorejs-angular-forms-date.mjs +75 -18
  91. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  92. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +79 -16
  93. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  94. package/fesm2022/sdcorejs-angular-forms-directives.mjs +82 -2
  95. package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
  96. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
  97. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  98. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
  99. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  100. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +56 -6
  101. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  102. package/fesm2022/sdcorejs-angular-forms-input.mjs +54 -7
  103. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  104. package/fesm2022/sdcorejs-angular-forms-models.mjs +88 -5
  105. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  106. package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
  107. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  108. package/fesm2022/sdcorejs-angular-forms-segmented.mjs +5 -4
  109. package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -1
  110. package/fesm2022/sdcorejs-angular-forms-select.mjs +87 -33
  111. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  112. package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
  113. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  114. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +16 -3
  115. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  116. package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
  117. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
  118. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  119. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  120. package/fesm2022/sdcorejs-angular-i18n.mjs +1745 -22
  121. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  122. package/fesm2022/sdcorejs-angular-interceptors.mjs +1 -1
  123. package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
  124. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs +478 -0
  125. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs.map +1 -0
  126. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs +214 -0
  127. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs.map +1 -0
  128. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs +277 -0
  129. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs.map +1 -0
  130. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs +1556 -0
  131. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs.map +1 -0
  132. package/fesm2022/sdcorejs-angular-modules-generic.mjs +2 -0
  133. package/fesm2022/sdcorejs-angular-modules-generic.mjs.map +1 -0
  134. package/fesm2022/sdcorejs-angular-modules-icon.mjs +96 -3
  135. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  136. package/fesm2022/sdcorejs-angular-modules-layout.mjs +2055 -37
  137. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  138. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs +23 -0
  139. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map +1 -0
  140. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs +16 -0
  141. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map +1 -0
  142. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-p8-V_Ol9.mjs +51 -0
  143. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-p8-V_Ol9.mjs.map +1 -0
  144. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-DTcpSsbe.mjs +130 -0
  145. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-DTcpSsbe.mjs.map +1 -0
  146. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-T2ox0oMZ.mjs +131 -0
  147. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-T2ox0oMZ.mjs.map +1 -0
  148. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DAjVXHXc.mjs +99 -0
  149. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DAjVXHXc.mjs.map +1 -0
  150. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DkHR_ix2.mjs +118 -0
  151. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DkHR_ix2.mjs.map +1 -0
  152. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DxWuy1ul.mjs +460 -0
  153. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DxWuy1ul.mjs.map +1 -0
  154. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +18 -0
  155. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +1 -0
  156. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Cbs05A2j.mjs +66 -0
  157. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Cbs05A2j.mjs.map +1 -0
  158. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bkk3_Lf0.mjs +148 -0
  159. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bkk3_Lf0.mjs.map +1 -0
  160. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BIuEchUV.mjs +467 -0
  161. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BIuEchUV.mjs.map +1 -0
  162. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CH21RSWx.mjs +172 -0
  163. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CH21RSWx.mjs.map +1 -0
  164. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CX4WWzER.mjs +90 -0
  165. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CX4WWzER.mjs.map +1 -0
  166. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-D1kpfcf_.mjs +514 -0
  167. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-D1kpfcf_.mjs.map +1 -0
  168. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DYyFPZUU.mjs +61 -0
  169. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DYyFPZUU.mjs.map +1 -0
  170. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs +232 -0
  171. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs.map +1 -0
  172. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs +87 -0
  173. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs.map +1 -0
  174. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-qs8Yoxn0.mjs +170 -0
  175. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-qs8Yoxn0.mjs.map +1 -0
  176. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs +70 -0
  177. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs.map +1 -0
  178. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DYphTR6C.mjs +100 -0
  179. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DYphTR6C.mjs.map +1 -0
  180. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-C692P-z0.mjs +522 -0
  181. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-C692P-z0.mjs.map +1 -0
  182. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-5sLtmhG1.mjs +71 -0
  183. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-5sLtmhG1.mjs.map +1 -0
  184. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BIFg9bUW.mjs +629 -0
  185. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BIFg9bUW.mjs.map +1 -0
  186. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CZ1NoLIo.mjs +115 -0
  187. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CZ1NoLIo.mjs.map +1 -0
  188. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CmZeYoF7.mjs +118 -0
  189. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CmZeYoF7.mjs.map +1 -0
  190. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Dy2Rkh8f.mjs +164 -0
  191. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Dy2Rkh8f.mjs.map +1 -0
  192. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-BdxQkZXW.mjs +1069 -0
  193. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-BdxQkZXW.mjs.map +1 -0
  194. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs +186 -0
  195. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +1 -0
  196. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs +97 -0
  197. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +1 -0
  198. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs +12 -0
  199. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs.map +1 -0
  200. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-BpSTfkeT.mjs +48 -0
  201. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-BpSTfkeT.mjs.map +1 -0
  202. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-D3QP1i9v.mjs +293 -0
  203. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-D3QP1i9v.mjs.map +1 -0
  204. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BA64XAgv.mjs +74 -0
  205. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BA64XAgv.mjs.map +1 -0
  206. package/fesm2022/sdcorejs-angular-modules-pattern-routes-CWTlhZzo.mjs +50 -0
  207. package/fesm2022/sdcorejs-angular-modules-pattern-routes-CWTlhZzo.mjs.map +1 -0
  208. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClRXOw9g.mjs +165 -0
  209. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClRXOw9g.mjs.map +1 -0
  210. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DYT6cDVo.mjs +45 -0
  211. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DYT6cDVo.mjs.map +1 -0
  212. package/fesm2022/sdcorejs-angular-modules-pattern-routes-Dww3V1b9.mjs +43 -0
  213. package/fesm2022/sdcorejs-angular-modules-pattern-routes-Dww3V1b9.mjs.map +1 -0
  214. package/fesm2022/sdcorejs-angular-modules-pattern-routes-HwJm344-.mjs +74 -0
  215. package/fesm2022/sdcorejs-angular-modules-pattern-routes-HwJm344-.mjs.map +1 -0
  216. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ZkBSRFv_.mjs +99 -0
  217. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ZkBSRFv_.mjs.map +1 -0
  218. package/fesm2022/sdcorejs-angular-modules-pattern-routes-px1VU73r.mjs +66 -0
  219. package/fesm2022/sdcorejs-angular-modules-pattern-routes-px1VU73r.mjs.map +1 -0
  220. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BSDQaT9e.mjs +406 -0
  221. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BSDQaT9e.mjs.map +1 -0
  222. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-2EN7PuIE.mjs +317 -0
  223. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-2EN7PuIE.mjs.map +1 -0
  224. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Crg1J2V5.mjs +132 -0
  225. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Crg1J2V5.mjs.map +1 -0
  226. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-LIBiOZLn.mjs +143 -0
  227. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-LIBiOZLn.mjs.map +1 -0
  228. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-4Mm8-ehz.mjs +128 -0
  229. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-4Mm8-ehz.mjs.map +1 -0
  230. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-ClEGOr5D.mjs +357 -0
  231. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-ClEGOr5D.mjs.map +1 -0
  232. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CoGA7wxY.mjs +100 -0
  233. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CoGA7wxY.mjs.map +1 -0
  234. package/fesm2022/sdcorejs-angular-modules-pattern.mjs +2 -0
  235. package/fesm2022/sdcorejs-angular-modules-pattern.mjs.map +1 -0
  236. package/fesm2022/sdcorejs-angular-modules.mjs +1 -0
  237. package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
  238. package/fesm2022/sdcorejs-angular-pipes.mjs +27 -7
  239. package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
  240. package/fesm2022/sdcorejs-angular-services-confirm.mjs +1 -1
  241. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  242. package/fesm2022/sdcorejs-angular-services-date-time.mjs +143 -0
  243. package/fesm2022/sdcorejs-angular-services-date-time.mjs.map +1 -0
  244. package/fesm2022/sdcorejs-angular-services-storage.mjs +44 -8
  245. package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
  246. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +104 -4
  247. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
  248. package/fesm2022/sdcorejs-angular-services.mjs +1 -0
  249. package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
  250. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +4 -0
  251. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -1
  252. package/fesm2022/sdcorejs-angular-utilities-theme.mjs +10 -0
  253. package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -1
  254. package/modules/pattern/README.md +76 -0
  255. package/modules/pattern/docs/detail.md +237 -0
  256. package/modules/pattern/docs/drawer.md +484 -0
  257. package/modules/pattern/docs/flow.md +631 -0
  258. package/modules/pattern/docs/form.md +518 -0
  259. package/modules/pattern/docs/header-actions.md +342 -0
  260. package/modules/pattern/docs/list.md +247 -0
  261. package/modules/pattern/docs/relation.md +180 -0
  262. package/modules/pattern/docs/select.md +206 -0
  263. package/modules/pattern/docs/split.md +350 -0
  264. package/modules/pattern/docs/states.md +168 -0
  265. package/modules/pattern/features/approval/entity.resolver.ts +21 -0
  266. package/modules/pattern/features/approval/pages/detail/detail.component.ts +139 -0
  267. package/modules/pattern/features/approval/pages/list/approval-inbox.ts +7 -0
  268. package/modules/pattern/features/approval/pages/list/list.component.html +20 -0
  269. package/modules/pattern/features/approval/pages/list/list.component.ts +149 -0
  270. package/modules/pattern/features/approval/routes.ts +30 -0
  271. package/modules/pattern/features/approval/services/approval.model.ts +38 -0
  272. package/modules/pattern/features/approval/services/approval.service.ts +23 -0
  273. package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +123 -0
  274. package/modules/pattern/features/category/components/general-information-form/general-information-form.component.ts +61 -0
  275. package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +134 -0
  276. package/modules/pattern/features/category/entity.resolver.ts +27 -0
  277. package/modules/pattern/features/category/pages/list/list.component.html +20 -0
  278. package/modules/pattern/features/category/pages/list/list.component.ts +105 -0
  279. package/modules/pattern/features/category/routes.ts +42 -0
  280. package/modules/pattern/features/category/services/category.model.ts +39 -0
  281. package/modules/pattern/features/category/services/category.service.ts +36 -0
  282. package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +131 -0
  283. package/modules/pattern/features/customer/components/customer-select/customer-select.component.ts +72 -0
  284. package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.ts +30 -0
  285. package/modules/pattern/features/customer/components/debts-view/debts-view.component.ts +28 -0
  286. package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +106 -0
  287. package/modules/pattern/features/customer/components/documents-view/documents-view.component.ts +50 -0
  288. package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.ts +140 -0
  289. package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.ts +39 -0
  290. package/modules/pattern/features/customer/components/orders-view/orders-view.component.ts +35 -0
  291. package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +101 -0
  292. package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +127 -0
  293. package/modules/pattern/features/customer/entity.resolver.ts +21 -0
  294. package/modules/pattern/features/customer/pages/list/list.component.html +22 -0
  295. package/modules/pattern/features/customer/pages/list/list.component.ts +113 -0
  296. package/modules/pattern/features/customer/pages/profile/profile.component.ts +120 -0
  297. package/modules/pattern/features/customer/pipes/customer-detail.pipe.ts +18 -0
  298. package/modules/pattern/features/customer/routes.ts +59 -0
  299. package/modules/pattern/features/customer/services/customer.model.ts +87 -0
  300. package/modules/pattern/features/customer/services/customer.service.ts +79 -0
  301. package/modules/pattern/features/import/components/mapping-form/mapping-form.component.ts +41 -0
  302. package/modules/pattern/features/import/components/preview-view/preview-view.component.ts +44 -0
  303. package/modules/pattern/features/import/pages/flow/flow.component.ts +269 -0
  304. package/modules/pattern/features/import/routes.ts +19 -0
  305. package/modules/pattern/features/import/services/import.model.ts +82 -0
  306. package/modules/pattern/features/import/services/import.service.ts +18 -0
  307. package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +74 -0
  308. package/modules/pattern/features/order/components/bulk-result/bulk-result.component.ts +46 -0
  309. package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +96 -0
  310. package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +205 -0
  311. package/modules/pattern/features/order/components/lines-view/lines-view.component.ts +42 -0
  312. package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +128 -0
  313. package/modules/pattern/features/order/entity.resolver.ts +37 -0
  314. package/modules/pattern/features/order/pages/create/create.component.ts +99 -0
  315. package/modules/pattern/features/order/pages/detail/detail.component.ts +222 -0
  316. package/modules/pattern/features/order/pages/list/list.component.html +38 -0
  317. package/modules/pattern/features/order/pages/list/list.component.ts +291 -0
  318. package/modules/pattern/features/order/pages/update/update.component.ts +119 -0
  319. package/modules/pattern/features/order/routes.ts +54 -0
  320. package/modules/pattern/features/order/services/order.model.ts +109 -0
  321. package/modules/pattern/features/order/services/order.service.ts +63 -0
  322. package/modules/pattern/features/partner/pages/create/create.component.ts +324 -0
  323. package/modules/pattern/features/partner/routes.ts +20 -0
  324. package/modules/pattern/features/partner/services/partner.model.ts +30 -0
  325. package/modules/pattern/features/partner/services/partner.service.ts +17 -0
  326. package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +88 -0
  327. package/modules/pattern/features/product/components/product-select/product-select.component.ts +65 -0
  328. package/modules/pattern/features/product/components/product-status-select/product-status-select.component.ts +30 -0
  329. package/modules/pattern/features/product/entity.resolver.ts +21 -0
  330. package/modules/pattern/features/product/pages/create/create.component.ts +85 -0
  331. package/modules/pattern/features/product/pages/detail/detail.component.ts +53 -0
  332. package/modules/pattern/features/product/pages/list/list.component.html +30 -0
  333. package/modules/pattern/features/product/pages/list/list.component.ts +71 -0
  334. package/modules/pattern/features/product/pages/update/update.component.ts +86 -0
  335. package/modules/pattern/features/product/pipes/product-detail.pipe.ts +18 -0
  336. package/modules/pattern/features/product/routes.ts +48 -0
  337. package/modules/pattern/features/product/services/product.model.ts +38 -0
  338. package/modules/pattern/features/product/services/product.service.ts +48 -0
  339. package/modules/pattern/features/settings/pages/update/update.component.ts +227 -0
  340. package/modules/pattern/features/settings/routes.ts +24 -0
  341. package/modules/pattern/features/settings/services/settings.model.ts +18 -0
  342. package/modules/pattern/features/settings/services/settings.service.ts +15 -0
  343. package/modules/pattern/features/settings/settings.resolver.ts +8 -0
  344. package/package.json +44 -7
  345. package/types/sdcorejs-angular-components-avatar.d.ts +67 -2
  346. package/types/sdcorejs-angular-components-badge.d.ts +206 -6
  347. package/types/sdcorejs-angular-components-button.d.ts +20 -1
  348. package/types/sdcorejs-angular-components-ckeditor-styles.d.ts +3 -18
  349. package/types/sdcorejs-angular-components-editor-engine.d.ts +246 -0
  350. package/types/sdcorejs-angular-components-editor.d.ts +20 -17
  351. package/types/sdcorejs-angular-components-file-explorer.d.ts +4 -2
  352. package/types/sdcorejs-angular-components-form-generic.d.ts +246 -35
  353. package/types/sdcorejs-angular-components-mini-editor.d.ts +33 -70
  354. package/types/sdcorejs-angular-components-modal-resizable.d.ts +1 -124
  355. package/types/sdcorejs-angular-components-operator.d.ts +137 -8
  356. package/types/sdcorejs-angular-components-section.d.ts +13 -1
  357. package/types/sdcorejs-angular-components-splitter.d.ts +1 -1
  358. package/types/sdcorejs-angular-components-tab-router.d.ts +74 -19
  359. package/types/sdcorejs-angular-components-table.d.ts +210 -18
  360. package/types/sdcorejs-angular-components-upload-file.d.ts +181 -21
  361. package/types/sdcorejs-angular-components-window.d.ts +81 -0
  362. package/types/sdcorejs-angular-components.d.ts +1 -0
  363. package/types/sdcorejs-angular-configurations.d.ts +8 -1
  364. package/types/sdcorejs-angular-forms-autocomplete.d.ts +5 -0
  365. package/types/sdcorejs-angular-forms-chip-calendar.d.ts +163 -18
  366. package/types/sdcorejs-angular-forms-chip.d.ts +136 -26
  367. package/types/sdcorejs-angular-forms-date-range.d.ts +24 -2
  368. package/types/sdcorejs-angular-forms-date.d.ts +23 -2
  369. package/types/sdcorejs-angular-forms-directives.d.ts +47 -2
  370. package/types/sdcorejs-angular-forms-input-number.d.ts +23 -2
  371. package/types/sdcorejs-angular-forms-input.d.ts +23 -2
  372. package/types/sdcorejs-angular-forms-models.d.ts +38 -3
  373. package/types/sdcorejs-angular-forms-select.d.ts +32 -2
  374. package/types/sdcorejs-angular-i18n.d.ts +344 -2
  375. package/types/sdcorejs-angular-modules-generic.d.ts +316 -0
  376. package/types/sdcorejs-angular-modules-icon.d.ts +37 -6
  377. package/types/sdcorejs-angular-modules-layout.d.ts +622 -89
  378. package/types/sdcorejs-angular-modules-pattern.d.ts +50 -0
  379. package/types/sdcorejs-angular-modules.d.ts +1 -0
  380. package/types/sdcorejs-angular-pipes.d.ts +2 -0
  381. package/types/sdcorejs-angular-services-date-time.d.ts +57 -0
  382. package/types/sdcorejs-angular-services-storage.d.ts +8 -1
  383. package/types/sdcorejs-angular-services-unsaved-changes.d.ts +11 -0
  384. package/types/sdcorejs-angular-services.d.ts +1 -0
  385. package/types/sdcorejs-angular-utilities-read-state.d.ts +2 -0
  386. package/types/sdcorejs-angular-utilities-theme.d.ts +1 -1
@@ -1,337 +1,231 @@
1
- import { CommonModule } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { output, input, forwardRef, Input, HostBinding, Component } from '@angular/core';
4
- import * as i1 from '@ckeditor/ckeditor5-angular';
5
- import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
6
- import { SdCKEditorStyles } from '@sdcorejs/angular/components/ckeditor-styles';
7
- import { ClassicEditor, Essentials, FontColor, Paragraph, Bold, Italic, Underline, Link, List, Undo, Widget, Markdown, Mention, HtmlDataProcessor } from 'ckeditor5';
8
- import { Subscription, Subject } from 'rxjs';
9
- import { throttleTime } from 'rxjs/operators';
2
+ import { input, output, signal, computed, inject, ChangeDetectorRef, effect, forwardRef, HostBinding, Input, Component } from '@angular/core';
10
3
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
11
- import { sdSanitizeEditorHtml } from '@sdcorejs/angular/utilities/extensions';
4
+ import { SdEditorSurface } from '@sdcorejs/angular/components/editor-engine';
5
+ export { SdEditorImportError } from '@sdcorejs/angular/components/editor-engine';
12
6
 
13
- /**
14
- * Component sd-mini-editor - Editor đơn giản cho comment input
15
- * Sử dụng CKEditor với chế độ đơn giản (bold, italic, link)
16
- * Hỗ trợ mention và output format (html/markdown)
17
- *
18
- * @example
19
- * ```html
20
- * <sd-mini-editor
21
- * [option]="editorOption"
22
- * [(ngModel)]="content"
23
- * (contentChange)="onContentChange($event)"
24
- * >
25
- * </sd-mini-editor>
26
- * ```
27
- */
7
+ /** Compact Core toolbar with the same document schema as SdEditor. */
28
8
  class SdMiniEditor {
29
- /** Cấu hình option cho editor */
30
9
  option;
31
- get maxEditorHeight() {
32
- return this.option?.maxHeight;
33
- }
34
- /** NgModel binding - nội dung HTML/Markdown */
35
10
  value = '';
11
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
36
12
  valueChange = output();
37
- /** Event emitter khi content thay đổi */
38
13
  contentChange = output();
39
- /** Event emitter khi blur */
40
14
  blur = output();
41
- /** Event emitter khi focus */
42
15
  focus = output();
43
- /** Disabled state */
44
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
45
- Editor = ClassicEditor;
46
- #editor;
47
- #subscription = new Subscription();
48
- #contentChangeSubject = new Subject();
49
- // Build editor config dynamically
50
- get editorConfig() {
51
- const enableMention = this.option?.enableMention ?? false;
52
- const useMarkdown = this.option?.outputFormat === 'markdown';
53
- const plugins = [Essentials, FontColor, Paragraph, Bold, Italic, Underline, Link, List, Undo, Widget];
54
- // Add Markdown plugin if outputFormat is markdown
55
- if (useMarkdown) {
56
- plugins.push(Markdown);
57
- }
58
- // Add Mention plugin if enabled
59
- if (enableMention) {
60
- plugins.push(Mention);
61
- }
62
- // Build base config
63
- const config = {
64
- licenseKey: 'GPL',
65
- getOption: () => this.option,
66
- plugins,
67
- toolbar: {
68
- items: ['bold', 'italic', 'underline', '|', 'fontColor', '|', 'bulletedList', 'numberedList', '|', 'link'],
69
- shouldNotGroupWhenFull: true,
70
- },
71
- placeholder: this.option?.placeholder,
72
- link: {
73
- addTargetToExternalLinks: true,
74
- defaultProtocol: 'https://',
75
- // why: mặc định CKEditor cho cả ftp/ftps; link trong bình luận chỉ cần web, mail và điện thoại.
76
- allowedProtocols: ['https', 'http', 'mailto', 'tel'],
77
- },
78
- fontColor: {
79
- columns: 5,
80
- documentColors: 10,
81
- colorPicker: { format: 'hex' },
82
- },
83
- };
84
- // Add mention configuration if enabled
85
- if (enableMention && this.option?.mentionConfig?.feeds) {
86
- config.mention = {
87
- feeds: this.option.mentionConfig.feeds,
88
- };
89
- }
90
- return config;
16
+ importWarning = output();
17
+ #diagnostics = signal([], ...(ngDevMode ? [{ debugName: "#diagnostics" }] : /* istanbul ignore next */ []));
18
+ importDiagnostics = this.#diagnostics.asReadonly();
19
+ surfaceContent = signal('', ...(ngDevMode ? [{ debugName: "surfaceContent" }] : /* istanbul ignore next */ []));
20
+ #formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "#formDisabled" }] : /* istanbul ignore next */ []));
21
+ effectiveDisabled = computed(() => this.disabled() || this.#formDisabled(), ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
22
+ #cdRef = inject(ChangeDetectorRef);
23
+ #engine;
24
+ #timer;
25
+ #trailing;
26
+ #deadline;
27
+ #composing = false;
28
+ #formatPending = false;
29
+ #destroyed = false;
30
+ #onChange = () => { };
31
+ #onTouched = () => { };
32
+ get maxEditorHeight() {
33
+ return this.option?.maxHeight;
91
34
  }
92
35
  constructor() {
93
- // Setup debounce cho content change
94
- this.#subscription.add(this.#contentChangeSubject.pipe(throttleTime(500, undefined, { leading: true, trailing: true })).subscribe(() => {
95
- const output = this.#convertOutput();
96
- this.value = output;
97
- this.#onChange(output);
98
- this.valueChange.emit(output);
99
- this.contentChange.emit(output);
100
- this.option?.onChange?.(output);
101
- }));
36
+ effect(() => {
37
+ if (this.effectiveDisabled())
38
+ this.onSourceChange();
39
+ });
102
40
  }
103
- ngOnDestroy() {
104
- this.#subscription.unsubscribe();
105
- this.#editor?.destroy?.();
41
+ ngOnChanges(changes) {
42
+ if (changes['value'])
43
+ this.setContent(this.value);
106
44
  }
107
- /**
108
- * Kiểm tra có nên enable mention plugin không
109
- */
110
- #shouldEnableMention() {
111
- return this.option?.enableMention ?? false;
45
+ onEngineReady(engine) {
46
+ this.onSourceChange();
47
+ this.#composing = false;
48
+ this.#engine = engine;
112
49
  }
113
- /**
114
- * Xử lý khi editor ready
115
- */
116
- onReady(editor) {
117
- this.#editor = editor;
118
- // Set initial content
119
- if (this.value) {
120
- this.setContent(this.value);
50
+ /** Cancel a stale throttle window before replacing an authoritative source. */
51
+ onSourceChange(reason = 'source') {
52
+ this.#clearTimer();
53
+ if (reason === 'format') {
54
+ this.#formatPending = true;
55
+ return;
121
56
  }
122
- // Lắng nghe sự kiện thay đổi nội dung
123
- editor.model.document.on('change:data', () => {
124
- this.#contentChangeSubject.next();
125
- });
126
- // Lắng nghe focus/blur events
127
- editor.editing.view.document.on('focus', evt => {
128
- const domEvent = evt.domEvent;
129
- this.focus.emit(domEvent);
130
- this.option?.onFocus?.(domEvent);
131
- });
132
- editor.editing.view.document.on('blur', evt => {
133
- const domEvent = evt.domEvent;
134
- this.blur.emit(domEvent);
135
- this.option?.onBlur?.(domEvent);
136
- });
137
- // Lắng nghe sự kiện mention được chọn
138
- if (this.#shouldEnableMention()) {
139
- editor.commands.get('mention')?.on('execute', (_evt, data) => {
140
- const mentionData = data[0];
141
- this.option?.onMentionSelect?.(mentionData.mention);
142
- // Trigger content change sau khi insert mention
143
- this.#contentChangeSubject.next();
144
- });
145
- // Custom downcast converter để thay đổi cấu trúc mention HTML
146
- editor.conversion.for('downcast').attributeToElement({
147
- model: 'mention',
148
- view: (mentionData, { writer }) => {
149
- const data = mentionData;
150
- const rawId = data?.id || '';
151
- const marker = rawId[0];
152
- const cleanId = rawId.slice(1);
153
- return writer.createAttributeElement('span', {
154
- class: 'ck-custom-mention',
155
- 'data-id': cleanId,
156
- 'data-marker': marker,
157
- contenteditable: 'false',
158
- });
159
- },
160
- converterPriority: 'highest',
161
- });
162
- // Xử lý keyboard để xóa mention 1 lần
163
- editor.editing.view.document.on('keydown', (evt, data) => {
164
- const keyEvent = data;
165
- // Delete (46) hoặc Backspace (8)
166
- if (keyEvent.keyCode === 46 || keyEvent.keyCode === 8) {
167
- const model = editor.model;
168
- const selection = model.document.selection;
169
- const position = selection.getFirstPosition();
170
- if (!position)
171
- return;
172
- // Tìm text node có mention attribute
173
- const node = position.textNode || position.nodeBefore || position.nodeAfter;
174
- if (node && node.is('$text')) {
175
- const mentionAttr = node.getAttribute('mention');
176
- if (mentionAttr) {
177
- // Xóa toàn bộ text node chứa mention
178
- model.change(writer => {
179
- writer.remove(node);
180
- });
181
- evt.stop();
182
- }
183
- }
184
- }
185
- });
57
+ this.#formatPending = false;
58
+ this.#deadline = undefined;
59
+ this.#trailing = undefined;
60
+ }
61
+ onFormatChange(value) {
62
+ if (this.#destroyed || this.effectiveDisabled())
63
+ return;
64
+ // A refused conversion stays paused until a supported representation is
65
+ // restored. Retain the live pending edit without exporting stale HTML.
66
+ if (value === undefined)
67
+ return;
68
+ this.#formatPending = false;
69
+ this.#trailing = undefined;
70
+ if (value !== this.value)
71
+ this.onSurfaceChange(value);
72
+ if (this.#deadline !== undefined)
73
+ this.#scheduleWindow();
74
+ }
75
+ onSurfaceChange(value) {
76
+ if (this.#destroyed || this.effectiveDisabled())
77
+ return;
78
+ if (this.#composing || this.#formatPending) {
79
+ this.#trailing = value;
80
+ return;
81
+ }
82
+ if (this.#deadline === undefined) {
83
+ // App callbacks can replace content synchronously; establish the window first.
84
+ this.#startWindow();
85
+ this.#emit(value);
186
86
  }
87
+ else
88
+ this.#trailing = value;
187
89
  }
188
- /**
189
- * Nội dung phát ra ngoài theo `outputFormat`: HTML đã lọc, hoặc Markdown dựng từ HTML đã lọc.
190
- * Là điểm ra duy nhất cho cả luồng throttle (valueChange/contentChange/form) lẫn `getContent()` (D-032).
191
- */
192
- #convertOutput() {
193
- const editor = this.#editor;
194
- if (!editor)
195
- return '';
196
- const html = this.#readSanitizedHtml(editor);
197
- if (!this.#isMarkdown())
198
- return html;
199
- // why: dựng Markdown từ HTML ĐÃ lọc, để `[text](javascript:...)` không thể lọt vào chuỗi Markdown.
200
- const htmlProcessor = new HtmlDataProcessor(editor.data.viewDocument);
201
- return editor.data.processor.toData(htmlProcessor.toView(html));
90
+ #startWindow() {
91
+ this.#deadline = Date.now() + 500;
92
+ this.#scheduleWindow();
202
93
  }
203
- #isMarkdown() {
204
- return this.option?.outputFormat === 'markdown';
94
+ #scheduleWindow() {
95
+ if (this.#deadline === undefined || this.#composing || this.#formatPending || this.#destroyed)
96
+ return;
97
+ this.#clearTimer();
98
+ this.#timer = setTimeout(() => {
99
+ this.#timer = undefined;
100
+ this.#deadline = undefined;
101
+ const trailing = this.#trailing;
102
+ this.#trailing = undefined;
103
+ if (trailing !== undefined && !this.#destroyed && !this.#composing && !this.effectiveDisabled()) {
104
+ this.#startWindow();
105
+ this.#emit(trailing);
106
+ }
107
+ }, Math.max(0, this.#deadline - Date.now()));
108
+ }
109
+ onCompositionChange(composing) {
110
+ this.#composing = composing;
111
+ this.#clearTimer();
112
+ if (composing || this.#formatPending || this.#destroyed || this.effectiveDisabled())
113
+ return;
114
+ if (this.#deadline !== undefined)
115
+ this.#scheduleWindow();
116
+ else if (this.#trailing !== undefined) {
117
+ const value = this.#trailing;
118
+ this.#trailing = undefined;
119
+ this.#startWindow();
120
+ this.#emit(value);
121
+ }
122
+ }
123
+ #clearTimer() {
124
+ if (this.#timer !== undefined)
125
+ clearTimeout(this.#timer);
126
+ this.#timer = undefined;
127
+ }
128
+ #emit(value) {
129
+ this.value = value;
130
+ this.#onChange(value);
131
+ this.valueChange.emit(value);
132
+ this.contentChange.emit(value);
133
+ this.option?.onChange?.(value);
134
+ this.#cdRef.markForCheck();
205
135
  }
206
- /** HTML hiện tại của editor (kể cả ở chế độ Markdown), đã qua `sdSanitizeEditorHtml`. */
207
- #readSanitizedHtml(editor) {
208
- if (!this.#isMarkdown())
209
- return sdSanitizeEditorHtml(editor.getData());
210
- // why: với plugin Markdown, `getData()` trả Markdown. Lấy HTML từ data view (đúng thứ getData() dùng)
211
- // để lọc trước khi chuyển.
212
- const root = editor.model.document.getRoot();
213
- if (!root)
214
- return '';
215
- const htmlProcessor = new HtmlDataProcessor(editor.data.viewDocument);
216
- return sdSanitizeEditorHtml(htmlProcessor.toData(editor.data.toView(root)));
136
+ onSurfaceFocus(event) {
137
+ this.focus.emit(event);
138
+ this.option?.onFocus?.(event);
139
+ }
140
+ onSurfaceBlur(event) {
141
+ this.#onTouched();
142
+ this.blur.emit(event);
143
+ this.option?.onBlur?.(event);
144
+ this.#cdRef.markForCheck();
145
+ }
146
+ onDiagnostics(diagnostics) {
147
+ this.#diagnostics.set(diagnostics);
148
+ this.importWarning.emit(diagnostics);
149
+ }
150
+ onMentionSelected(item) {
151
+ this.option?.onMentionSelect?.(item);
217
152
  }
218
- /**
219
- * Set nội dung cho editor
220
- */
221
153
  setContent(content) {
222
- this.#editor?.setData?.(content);
154
+ const value = content ?? '';
155
+ this.value = value;
156
+ // Consumer echoes must not replay content or reset the current selection/history.
157
+ if (this.#isCurrentContent(value))
158
+ return;
159
+ this.onSourceChange();
160
+ this.surfaceContent.set(value);
161
+ this.#engine?.setContent(value, this.option?.outputFormat ?? 'html');
162
+ this.#cdRef.markForCheck();
163
+ }
164
+ #isCurrentContent(value) {
165
+ if (!this.#engine)
166
+ return value === this.surfaceContent();
167
+ try {
168
+ return this.#engine.format === (this.option?.outputFormat ?? 'html') && value === this.#engine.getContent();
169
+ }
170
+ catch {
171
+ return false;
172
+ }
223
173
  }
224
- /**
225
- * Get nội dung từ editor
226
- */
227
174
  getContent() {
228
- return this.#convertOutput();
175
+ return this.#engine?.getContent() ?? '';
229
176
  }
230
- /**
231
- * Nội dung dạng HTML (đã lọc), bất kể `outputFormat`.
232
- */
233
177
  getHtmlContent() {
234
- return this.#editor ? this.#readSanitizedHtml(this.#editor) : '';
178
+ return this.#engine?.getHtml() ?? '';
235
179
  }
236
- /**
237
- * Focus vào editor
238
- */
239
180
  focusEditor() {
240
- this.#editor?.editing?.view?.focus?.();
181
+ if (!this.effectiveDisabled())
182
+ this.#engine?.focus();
241
183
  }
242
- /**
243
- * Insert mention vào vị trí con trỏ hiện tại
244
- */
245
184
  insertMention(item) {
246
- if (!this.#editor)
185
+ if (!this.#engine || !this.option?.enableMention || this.effectiveDisabled() || this.importDiagnostics().length)
247
186
  return;
248
- const firstFeed = this.option?.mentionConfig?.feeds?.[0];
249
- const marker = item.marker || firstFeed?.marker || '@';
250
- // Sử dụng CKEditor mention command
251
- this.#editor.execute('mention', {
252
- marker,
253
- mention: {
254
- id: item.id,
255
- text: `${marker}${item.name}`,
256
- },
257
- });
187
+ const marker = item.marker ?? this.option.mentionConfig?.feeds?.[0]?.marker ?? '@';
188
+ this.#engine.insertMention({ ...item, marker });
189
+ this.option.onMentionSelect?.({ id: item.id, name: item.name, text: `${marker}${item.name}` });
258
190
  }
259
- /**
260
- * Get danh sách mentions trong nội dung
261
- */
262
191
  getMentions() {
263
- if (!this.#editor)
264
- return [];
265
- const mentions = [];
266
- const root = this.#editor.model.document.getRoot();
267
- if (!root)
268
- return mentions;
269
- const range = this.#editor.model.createRangeIn(root);
270
- for (const item of range.getItems()) {
271
- if (item.is('$text')) {
272
- const mentionAttr = item.getAttribute('mention');
273
- if (mentionAttr) {
274
- const text = item.data;
275
- const marker = text.charAt(0);
276
- const name = text.substring(1);
277
- const id = item.getAttribute('data-user-id');
278
- mentions.push({ id, name, marker });
279
- }
280
- }
281
- }
282
- return mentions;
192
+ return this.#engine?.getMentions() ?? [];
283
193
  }
284
- /**
285
- * ControlValueAccessor: Write value
286
- */
287
194
  writeValue(value) {
288
- this.value = value || '';
289
- if (this.#editor) {
290
- this.setContent(this.value);
291
- }
195
+ this.setContent(value || '');
292
196
  }
293
- /**
294
- * ControlValueAccessor: Register change callback
295
- */
296
197
  registerOnChange(fn) {
297
198
  this.#onChange = fn;
298
199
  }
299
- /**
300
- * ControlValueAccessor: Register touched callback
301
- */
302
200
  registerOnTouched(fn) {
303
201
  this.#onTouched = fn;
304
202
  }
305
- /** ControlValueAccessor callbacks */
306
- #onChange = () => { };
307
- #onTouched = () => { };
203
+ setDisabledState(disabled) {
204
+ this.#formDisabled.set(disabled);
205
+ if (disabled)
206
+ this.onSourceChange();
207
+ this.#cdRef.markForCheck();
208
+ }
209
+ ngOnDestroy() {
210
+ this.#destroyed = true;
211
+ this.onSourceChange();
212
+ this.#engine = undefined; // Surface owns engine destruction.
213
+ }
308
214
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdMiniEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
309
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SdMiniEditor, isStandalone: true, selector: "sd-mini-editor", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: false, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", contentChange: "contentChange", blur: "blur", focus: "focus" }, host: { properties: { "style.--sd-mini-editor-max-height": "this.maxEditorHeight" } }, providers: [
310
- {
311
- provide: NG_VALUE_ACCESSOR,
312
- useExisting: forwardRef(() => SdMiniEditor),
313
- multi: true,
314
- },
315
- ], ngImport: i0, template: "<sd-ckeditor-styles />\n<ckeditor class=\"sd-mini-editor\" [editor]=\"Editor\" [config]=\"editorConfig\" [disabled]=\"disabled()\" (ready)=\"onReady($event)\"> </ckeditor>\n", styles: [".sd-mini-editor{display:block}::ng-deep .ck-powered-by-balloon{display:none!important}::ng-deep .ck-mentions .ck-button.ck-on{background:var(--sd-primary)!important;color:var(--sd-text-on-solid, #ffffff)!important}::ng-deep .ck-mentions .ck-button.ck-on *{color:var(--sd-text-on-solid, #ffffff)!important}:host ::ng-deep .ck-editor{--ck-content-font-size: 14px;--ck-content-line-height: 1.5}:host ::ng-deep .ck-editor__editable_inline{border:var(--ck-focus-ring);border-top-left-radius:0!important;border-top-right-radius:0!important;max-height:var(--sd-mini-editor-max-height);overflow:auto}:host ::ng-deep .ck-toolbar{border-radius:0;border:0!important}:host ::ng-deep .ck-content img{max-width:100%!important;height:auto!important;object-fit:contain}:host ::ng-deep .ck-content p{margin-bottom:var(--ck-spacing-large);text-indent:0}:host ::ng-deep .ck-content ul,:host ::ng-deep .ck-content ol{padding-left:20px!important;margin-left:0!important}:host ::ng-deep .ck-custom-mention{font-weight:var(--sd-font-weight-semibold, 600);padding:0 2px;display:inline-block;pointer-events:none;-webkit-user-select:none;user-select:none;color:var(--sd-primary, #005cbb)}:host ::ng-deep .ck-custom-mention:before{content:attr(data-marker)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CKEditorModule }, { kind: "component", type: i1.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableWatchdog", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }, { kind: "component", type: SdCKEditorStyles, selector: "sd-ckeditor-styles" }] });
215
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SdMiniEditor, isStandalone: true, selector: "sd-mini-editor", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: false, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", contentChange: "contentChange", blur: "blur", focus: "focus", importWarning: "importWarning" }, host: { properties: { "style.--sd-mini-editor-max-height": "this.maxEditorHeight" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SdMiniEditor), multi: true }], usesOnChanges: true, ngImport: i0, template: "<sd-editor-surface\n class=\"sd-mini-editor\"\n variant=\"compact\"\n [content]=\"surfaceContent()\"\n [format]=\"option?.outputFormat ?? 'html'\"\n [editable]=\"!effectiveDisabled()\"\n [placeholder]=\"option?.placeholder\"\n [disabled]=\"effectiveDisabled()\"\n [height]=\"option?.height\"\n [maxHeight]=\"option?.maxHeight\"\n [mentionFeeds]=\"option?.enableMention ? option?.mentionConfig?.feeds : undefined\"\n (engineReady)=\"onEngineReady($event)\"\n (sourceChange)=\"onSourceChange($event)\"\n (formatChange)=\"onFormatChange($event)\"\n (compositionChange)=\"onCompositionChange($event)\"\n (change)=\"onSurfaceChange($event)\"\n (focus)=\"onSurfaceFocus($event)\"\n (blur)=\"onSurfaceBlur($event)\"\n (diagnostics)=\"onDiagnostics($event)\"\n (mentionSelected)=\"onMentionSelected($event)\" />\n", styles: [":host,.sd-mini-editor{display:block}\n"], dependencies: [{ kind: "component", type: SdEditorSurface, selector: "sd-editor-surface", inputs: ["content", "format", "variant", "editable", "disabled", "readonly", "placeholder", "mentionFeeds", "uploadEnabled", "height", "maxHeight", "label", "describedBy", "invalid", "id"], outputs: ["engineReady", "change", "focus", "blur", "diagnostics", "sourceChange", "formatChange", "compositionChange", "mentionSelected", "filesSelected"] }] });
316
216
  }
317
217
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdMiniEditor, decorators: [{
318
218
  type: Component,
319
- args: [{ selector: 'sd-mini-editor', standalone: true, imports: [CommonModule, CKEditorModule, SdCKEditorStyles], providers: [
320
- {
321
- provide: NG_VALUE_ACCESSOR,
322
- useExisting: forwardRef(() => SdMiniEditor),
323
- multi: true,
324
- },
325
- ], template: "<sd-ckeditor-styles />\n<ckeditor class=\"sd-mini-editor\" [editor]=\"Editor\" [config]=\"editorConfig\" [disabled]=\"disabled()\" (ready)=\"onReady($event)\"> </ckeditor>\n", styles: [".sd-mini-editor{display:block}::ng-deep .ck-powered-by-balloon{display:none!important}::ng-deep .ck-mentions .ck-button.ck-on{background:var(--sd-primary)!important;color:var(--sd-text-on-solid, #ffffff)!important}::ng-deep .ck-mentions .ck-button.ck-on *{color:var(--sd-text-on-solid, #ffffff)!important}:host ::ng-deep .ck-editor{--ck-content-font-size: 14px;--ck-content-line-height: 1.5}:host ::ng-deep .ck-editor__editable_inline{border:var(--ck-focus-ring);border-top-left-radius:0!important;border-top-right-radius:0!important;max-height:var(--sd-mini-editor-max-height);overflow:auto}:host ::ng-deep .ck-toolbar{border-radius:0;border:0!important}:host ::ng-deep .ck-content img{max-width:100%!important;height:auto!important;object-fit:contain}:host ::ng-deep .ck-content p{margin-bottom:var(--ck-spacing-large);text-indent:0}:host ::ng-deep .ck-content ul,:host ::ng-deep .ck-content ol{padding-left:20px!important;margin-left:0!important}:host ::ng-deep .ck-custom-mention{font-weight:var(--sd-font-weight-semibold, 600);padding:0 2px;display:inline-block;pointer-events:none;-webkit-user-select:none;user-select:none;color:var(--sd-primary, #005cbb)}:host ::ng-deep .ck-custom-mention:before{content:attr(data-marker)}\n"] }]
219
+ args: [{ selector: 'sd-mini-editor', standalone: true, imports: [SdEditorSurface], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SdMiniEditor), multi: true }], template: "<sd-editor-surface\n class=\"sd-mini-editor\"\n variant=\"compact\"\n [content]=\"surfaceContent()\"\n [format]=\"option?.outputFormat ?? 'html'\"\n [editable]=\"!effectiveDisabled()\"\n [placeholder]=\"option?.placeholder\"\n [disabled]=\"effectiveDisabled()\"\n [height]=\"option?.height\"\n [maxHeight]=\"option?.maxHeight\"\n [mentionFeeds]=\"option?.enableMention ? option?.mentionConfig?.feeds : undefined\"\n (engineReady)=\"onEngineReady($event)\"\n (sourceChange)=\"onSourceChange($event)\"\n (formatChange)=\"onFormatChange($event)\"\n (compositionChange)=\"onCompositionChange($event)\"\n (change)=\"onSurfaceChange($event)\"\n (focus)=\"onSurfaceFocus($event)\"\n (blur)=\"onSurfaceBlur($event)\"\n (diagnostics)=\"onDiagnostics($event)\"\n (mentionSelected)=\"onMentionSelected($event)\" />\n", styles: [":host,.sd-mini-editor{display:block}\n"] }]
326
220
  }], ctorParameters: () => [], propDecorators: { option: [{
327
221
  type: Input,
328
222
  args: [{ required: true }]
329
- }], maxEditorHeight: [{
330
- type: HostBinding,
331
- args: ['style.--sd-mini-editor-max-height']
332
223
  }], value: [{
333
224
  type: Input
334
- }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], contentChange: [{ type: i0.Output, args: ["contentChange"] }], blur: [{ type: i0.Output, args: ["blur"] }], focus: [{ type: i0.Output, args: ["focus"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
225
+ }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], contentChange: [{ type: i0.Output, args: ["contentChange"] }], blur: [{ type: i0.Output, args: ["blur"] }], focus: [{ type: i0.Output, args: ["focus"] }], importWarning: [{ type: i0.Output, args: ["importWarning"] }], maxEditorHeight: [{
226
+ type: HostBinding,
227
+ args: ['style.--sd-mini-editor-max-height']
228
+ }] } });
335
229
 
336
230
  /**
337
231
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"sdcorejs-angular-components-mini-editor.mjs","sources":["../../../projects/sdcorejs-angular/components/mini-editor/src/mini-editor.component.ts","../../../projects/sdcorejs-angular/components/mini-editor/src/mini-editor.component.html","../../../projects/sdcorejs-angular/components/mini-editor/sdcorejs-angular-components-mini-editor.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, HostBinding, Input, forwardRef, OnDestroy, input, output } from '@angular/core';\nimport { CKEditorModule } from '@ckeditor/ckeditor5-angular';\nimport { SdCKEditorStyles } from '@sdcorejs/angular/components/ckeditor-styles';\nimport {\n Bold,\n ClassicEditor,\n Essentials,\n Italic,\n Link,\n List,\n FontColor,\n HtmlDataProcessor,\n Markdown,\n Mention,\n Paragraph,\n Underline,\n Undo,\n Widget,\n} from 'ckeditor5';\nimport { Subject, Subscription } from 'rxjs';\nimport { throttleTime } from 'rxjs/operators';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { sdSanitizeEditorHtml } from '@sdcorejs/angular/utilities/extensions';\n\nimport { SdMiniEditorOption, SdMiniEditorConfig, SdMiniEditorMentionItem } from './mini-editor.model';\n\n/**\n * Component sd-mini-editor - Editor đơn giản cho comment input\n * Sử dụng CKEditor với chế độ đơn giản (bold, italic, link)\n * Hỗ trợ mention và output format (html/markdown)\n *\n * @example\n * ```html\n * <sd-mini-editor\n * [option]=\"editorOption\"\n * [(ngModel)]=\"content\"\n * (contentChange)=\"onContentChange($event)\"\n * >\n * </sd-mini-editor>\n * ```\n */\n@Component({\n selector: 'sd-mini-editor',\n standalone: true,\n imports: [CommonModule, CKEditorModule, SdCKEditorStyles],\n templateUrl: './mini-editor.component.html',\n styleUrl: './mini-editor.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SdMiniEditor),\n multi: true,\n },\n ],\n})\nexport class SdMiniEditor implements ControlValueAccessor, OnDestroy {\n /** Cấu hình option cho editor */\n @Input({ required: true }) option!: SdMiniEditorOption;\n\n @HostBinding('style.--sd-mini-editor-max-height')\n get maxEditorHeight(): string | undefined {\n return this.option?.maxHeight;\n }\n\n /** NgModel binding - nội dung HTML/Markdown */\n @Input() value = '';\n readonly valueChange = output<string>();\n\n /** Event emitter khi content thay đổi */\n readonly contentChange = output<string>();\n\n /** Event emitter khi blur */\n readonly blur = output<FocusEvent>();\n\n /** Event emitter khi focus */\n readonly focus = output<FocusEvent>();\n\n /** Disabled state */\n readonly disabled = input(false);\n\n Editor = ClassicEditor;\n #editor!: ClassicEditor;\n #subscription = new Subscription();\n #contentChangeSubject = new Subject<void>();\n\n // Build editor config dynamically\n get editorConfig(): SdMiniEditorConfig {\n const enableMention = this.option?.enableMention ?? false;\n const useMarkdown = this.option?.outputFormat === 'markdown';\n const plugins: any[] = [Essentials, FontColor, Paragraph, Bold, Italic, Underline, Link, List, Undo, Widget];\n\n // Add Markdown plugin if outputFormat is markdown\n if (useMarkdown) {\n plugins.push(Markdown);\n }\n\n // Add Mention plugin if enabled\n if (enableMention) {\n plugins.push(Mention);\n }\n\n // Build base config\n const config: SdMiniEditorConfig = {\n licenseKey: 'GPL',\n getOption: () => this.option,\n plugins,\n toolbar: {\n items: ['bold', 'italic', 'underline', '|', 'fontColor', '|', 'bulletedList', 'numberedList', '|', 'link'],\n shouldNotGroupWhenFull: true,\n },\n placeholder: this.option?.placeholder,\n link: {\n addTargetToExternalLinks: true,\n defaultProtocol: 'https://',\n // why: mặc định CKEditor cho cả ftp/ftps; link trong bình luận chỉ cần web, mail và điện thoại.\n allowedProtocols: ['https', 'http', 'mailto', 'tel'],\n },\n fontColor: {\n columns: 5,\n documentColors: 10,\n colorPicker: { format: 'hex' },\n },\n };\n\n // Add mention configuration if enabled\n if (enableMention && this.option?.mentionConfig?.feeds) {\n config.mention = {\n feeds: this.option.mentionConfig.feeds,\n };\n }\n\n return config;\n }\n\n constructor() {\n // Setup debounce cho content change\n this.#subscription.add(\n this.#contentChangeSubject.pipe(throttleTime(500, undefined, { leading: true, trailing: true })).subscribe(() => {\n const output = this.#convertOutput();\n this.value = output;\n this.#onChange(output);\n this.valueChange.emit(output);\n this.contentChange.emit(output);\n this.option?.onChange?.(output);\n })\n );\n }\n\n ngOnDestroy() {\n this.#subscription.unsubscribe();\n this.#editor?.destroy?.();\n }\n\n /**\n * Kiểm tra có nên enable mention plugin không\n */\n #shouldEnableMention(): boolean {\n return this.option?.enableMention ?? false;\n }\n\n /**\n * Xử lý khi editor ready\n */\n onReady(editor: ClassicEditor) {\n this.#editor = editor;\n\n // Set initial content\n if (this.value) {\n this.setContent(this.value);\n }\n\n // Lắng nghe sự kiện thay đổi nội dung\n editor.model.document.on('change:data', () => {\n this.#contentChangeSubject.next();\n });\n\n // Lắng nghe focus/blur events\n editor.editing.view.document.on('focus', evt => {\n const domEvent = (evt as any).domEvent as FocusEvent;\n this.focus.emit(domEvent);\n this.option?.onFocus?.(domEvent);\n });\n\n editor.editing.view.document.on('blur', evt => {\n const domEvent = (evt as any).domEvent as FocusEvent;\n this.blur.emit(domEvent);\n this.option?.onBlur?.(domEvent);\n });\n\n // Lắng nghe sự kiện mention được chọn\n if (this.#shouldEnableMention()) {\n editor.commands.get('mention')?.on('execute', (_evt, data: any) => {\n const mentionData = data[0];\n this.option?.onMentionSelect?.(mentionData.mention);\n // Trigger content change sau khi insert mention\n this.#contentChangeSubject.next();\n });\n\n // Custom downcast converter để thay đổi cấu trúc mention HTML\n editor.conversion.for('downcast').attributeToElement({\n model: 'mention',\n view: (mentionData, { writer }) => {\n const data = mentionData as SdMiniEditorMentionItem;\n const rawId = data?.id || '';\n const marker = rawId[0];\n const cleanId = rawId.slice(1);\n\n return writer.createAttributeElement('span', {\n class: 'ck-custom-mention',\n 'data-id': cleanId,\n 'data-marker': marker,\n contenteditable: 'false',\n });\n },\n converterPriority: 'highest',\n });\n\n // Xử lý keyboard để xóa mention 1 lần\n editor.editing.view.document.on('keydown', (evt, data) => {\n const keyEvent = data as { keyCode: number; domEvent: KeyboardEvent };\n // Delete (46) hoặc Backspace (8)\n if (keyEvent.keyCode === 46 || keyEvent.keyCode === 8) {\n const model = editor.model;\n const selection = model.document.selection;\n const position = selection.getFirstPosition();\n if (!position) return;\n\n // Tìm text node có mention attribute\n const node = position.textNode || position.nodeBefore || position.nodeAfter;\n if (node && node.is('$text')) {\n const mentionAttr = node.getAttribute('mention');\n if (mentionAttr) {\n // Xóa toàn bộ text node chứa mention\n model.change(writer => {\n writer.remove(node);\n });\n evt.stop();\n }\n }\n }\n });\n }\n }\n\n /**\n * Nội dung phát ra ngoài theo `outputFormat`: HTML đã lọc, hoặc Markdown dựng từ HTML đã lọc.\n * Là điểm ra duy nhất cho cả luồng throttle (valueChange/contentChange/form) lẫn `getContent()` (D-032).\n */\n #convertOutput(): string {\n const editor = this.#editor;\n if (!editor) return '';\n const html = this.#readSanitizedHtml(editor);\n if (!this.#isMarkdown()) return html;\n // why: dựng Markdown từ HTML ĐÃ lọc, để `[text](javascript:...)` không thể lọt vào chuỗi Markdown.\n const htmlProcessor = new HtmlDataProcessor(editor.data.viewDocument);\n return editor.data.processor.toData(htmlProcessor.toView(html));\n }\n\n #isMarkdown(): boolean {\n return this.option?.outputFormat === 'markdown';\n }\n\n /** HTML hiện tại của editor (kể cả ở chế độ Markdown), đã qua `sdSanitizeEditorHtml`. */\n #readSanitizedHtml(editor: ClassicEditor): string {\n if (!this.#isMarkdown()) return sdSanitizeEditorHtml(editor.getData());\n // why: với plugin Markdown, `getData()` trả Markdown. Lấy HTML từ data view (đúng thứ getData() dùng)\n // để lọc trước khi chuyển.\n const root = editor.model.document.getRoot();\n if (!root) return '';\n const htmlProcessor = new HtmlDataProcessor(editor.data.viewDocument);\n return sdSanitizeEditorHtml(htmlProcessor.toData(editor.data.toView(root)));\n }\n\n /**\n * Set nội dung cho editor\n */\n setContent(content: string) {\n this.#editor?.setData?.(content);\n }\n\n /**\n * Get nội dung từ editor\n */\n getContent(): string {\n return this.#convertOutput();\n }\n\n /**\n * Nội dung dạng HTML (đã lọc), bất kể `outputFormat`.\n */\n getHtmlContent(): string {\n return this.#editor ? this.#readSanitizedHtml(this.#editor) : '';\n }\n\n /**\n * Focus vào editor\n */\n focusEditor() {\n this.#editor?.editing?.view?.focus?.();\n }\n\n /**\n * Insert mention vào vị trí con trỏ hiện tại\n */\n insertMention(item: { id: string; name: string; marker?: string }) {\n if (!this.#editor) return;\n\n const firstFeed = this.option?.mentionConfig?.feeds?.[0];\n const marker = item.marker || (firstFeed as any)?.marker || '@';\n\n // Sử dụng CKEditor mention command\n this.#editor.execute('mention', {\n marker,\n mention: {\n id: item.id,\n text: `${marker}${item.name}`,\n },\n });\n }\n\n /**\n * Get danh sách mentions trong nội dung\n */\n getMentions(): { id: string; name: string; marker: string }[] {\n if (!this.#editor) return [];\n\n const mentions: { id: string; name: string; marker: string }[] = [];\n const root = this.#editor.model.document.getRoot();\n if (!root) return mentions;\n\n const range = this.#editor.model.createRangeIn(root);\n\n for (const item of range.getItems()) {\n if (item.is('$text')) {\n const mentionAttr = item.getAttribute('mention');\n if (mentionAttr) {\n const text = (item as any).data as string;\n const marker = text.charAt(0);\n const name = text.substring(1);\n const id = item.getAttribute('data-user-id') as string;\n\n mentions.push({ id, name, marker });\n }\n }\n }\n\n return mentions;\n }\n\n /**\n * ControlValueAccessor: Write value\n */\n writeValue(value: string): void {\n this.value = value || '';\n if (this.#editor) {\n this.setContent(this.value);\n }\n }\n\n /**\n * ControlValueAccessor: Register change callback\n */\n registerOnChange(fn: (value: string) => void): void {\n this.#onChange = fn;\n }\n\n /**\n * ControlValueAccessor: Register touched callback\n */\n registerOnTouched(fn: () => void): void {\n this.#onTouched = fn;\n }\n\n /** ControlValueAccessor callbacks */\n #onChange: (value: string) => void = () => {};\n #onTouched: () => void = () => {};\n}\n","<sd-ckeditor-styles />\n<ckeditor class=\"sd-mini-editor\" [editor]=\"Editor\" [config]=\"editorConfig\" [disabled]=\"disabled()\" (ready)=\"onReady($event)\"> </ckeditor>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BA;;;;;;;;;;;;;;AAcG;MAeU,YAAY,CAAA;;AAEI,IAAA,MAAM;AAEjC,IAAA,IACI,eAAe,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,MAAM,EAAE,SAAS;IAC/B;;IAGS,KAAK,GAAG,EAAE;IACV,WAAW,GAAG,MAAM,EAAU;;IAG9B,aAAa,GAAG,MAAM,EAAU;;IAGhC,IAAI,GAAG,MAAM,EAAc;;IAG3B,KAAK,GAAG,MAAM,EAAc;;AAG5B,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,+EAAC;IAEhC,MAAM,GAAG,aAAa;AACtB,IAAA,OAAO;AACP,IAAA,aAAa,GAAG,IAAI,YAAY,EAAE;AAClC,IAAA,qBAAqB,GAAG,IAAI,OAAO,EAAQ;;AAG3C,IAAA,IAAI,YAAY,GAAA;QACd,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,aAAa,IAAI,KAAK;QACzD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,YAAY,KAAK,UAAU;QAC5D,MAAM,OAAO,GAAU,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC;;QAG5G,IAAI,WAAW,EAAE;AACf,YA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C;AAC3C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,+KAAA,EAAA,MAAA,EAAA,CAAA,ktCAAA,CAAA,EAAA;;sBAIA,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAExB,WAAW;uBAAC,mCAAmC;;sBAM/C;;;AEnEH;;AAEG;;;;"}
1
+ {"version":3,"file":"sdcorejs-angular-components-mini-editor.mjs","sources":["../../../projects/sdcorejs-angular/components/mini-editor/src/mini-editor.component.ts","../../../projects/sdcorejs-angular/components/mini-editor/src/mini-editor.component.html","../../../projects/sdcorejs-angular/components/mini-editor/sdcorejs-angular-components-mini-editor.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n SdEditorEngine,\n SdEditorImportDiagnostic,\n SdEditorMentionItem,\n SdEditorSourceChangeReason,\n SdEditorSurface,\n} from '@sdcorejs/angular/components/editor-engine';\nimport { SdMiniEditorOption } from './mini-editor.model';\n\n/** Compact Core toolbar with the same document schema as SdEditor. */\n@Component({\n selector: 'sd-mini-editor',\n standalone: true,\n imports: [SdEditorSurface],\n templateUrl: './mini-editor.component.html',\n styleUrl: './mini-editor.component.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SdMiniEditor), multi: true }],\n})\nexport class SdMiniEditor implements ControlValueAccessor, OnChanges, OnDestroy {\n @Input({ required: true }) option!: SdMiniEditorOption;\n @Input() value = '';\n readonly disabled = input(false);\n readonly valueChange = output<string>();\n readonly contentChange = output<string>();\n readonly blur = output<FocusEvent>();\n readonly focus = output<FocusEvent>();\n readonly importWarning = output<readonly SdEditorImportDiagnostic[]>();\n readonly #diagnostics = signal<readonly SdEditorImportDiagnostic[]>([]);\n readonly importDiagnostics = this.#diagnostics.asReadonly();\n readonly surfaceContent = signal('');\n readonly #formDisabled = signal(false);\n readonly effectiveDisabled = computed(() => this.disabled() || this.#formDisabled());\n readonly #cdRef = inject(ChangeDetectorRef);\n #engine?: SdEditorEngine;\n #timer?: ReturnType<typeof setTimeout>;\n #trailing?: string;\n #deadline?: number;\n #composing = false;\n #formatPending = false;\n #destroyed = false;\n #onChange: (value: string) => void = () => {};\n #onTouched: () => void = () => {};\n\n @HostBinding('style.--sd-mini-editor-max-height')\n get maxEditorHeight(): string | undefined {\n return this.option?.maxHeight;\n }\n\n constructor() {\n effect(() => {\n if (this.effectiveDisabled()) this.onSourceChange();\n });\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['value']) this.setContent(this.value);\n }\n onEngineReady(engine: SdEditorEngine): void {\n this.onSourceChange();\n this.#composing = false;\n this.#engine = engine;\n }\n /** Cancel a stale throttle window before replacing an authoritative source. */\n onSourceChange(reason: SdEditorSourceChangeReason = 'source'): void {\n this.#clearTimer();\n if (reason === 'format') {\n this.#formatPending = true;\n return;\n }\n this.#formatPending = false;\n this.#deadline = undefined;\n this.#trailing = undefined;\n }\n onFormatChange(value: string | undefined): void {\n if (this.#destroyed || this.effectiveDisabled()) return;\n // A refused conversion stays paused until a supported representation is\n // restored. Retain the live pending edit without exporting stale HTML.\n if (value === undefined) return;\n this.#formatPending = false;\n this.#trailing = undefined;\n if (value !== this.value) this.onSurfaceChange(value);\n if (this.#deadline !== undefined) this.#scheduleWindow();\n }\n onSurfaceChange(value: string): void {\n if (this.#destroyed || this.effectiveDisabled()) return;\n if (this.#composing || this.#formatPending) {\n this.#trailing = value;\n return;\n }\n if (this.#deadline === undefined) {\n // App callbacks can replace content synchronously; establish the window first.\n this.#startWindow();\n this.#emit(value);\n } else this.#trailing = value;\n }\n #startWindow(): void {\n this.#deadline = Date.now() + 500;\n this.#scheduleWindow();\n }\n #scheduleWindow(): void {\n if (this.#deadline === undefined || this.#composing || this.#formatPending || this.#destroyed) return;\n this.#clearTimer();\n this.#timer = setTimeout(\n () => {\n this.#timer = undefined;\n this.#deadline = undefined;\n const trailing = this.#trailing;\n this.#trailing = undefined;\n if (trailing !== undefined && !this.#destroyed && !this.#composing && !this.effectiveDisabled()) {\n this.#startWindow();\n this.#emit(trailing);\n }\n },\n Math.max(0, this.#deadline - Date.now())\n );\n }\n onCompositionChange(composing: boolean): void {\n this.#composing = composing;\n this.#clearTimer();\n if (composing || this.#formatPending || this.#destroyed || this.effectiveDisabled()) return;\n if (this.#deadline !== undefined) this.#scheduleWindow();\n else if (this.#trailing !== undefined) {\n const value = this.#trailing;\n this.#trailing = undefined;\n this.#startWindow();\n this.#emit(value);\n }\n }\n #clearTimer(): void {\n if (this.#timer !== undefined) clearTimeout(this.#timer);\n this.#timer = undefined;\n }\n #emit(value: string): void {\n this.value = value;\n this.#onChange(value);\n this.valueChange.emit(value);\n this.contentChange.emit(value);\n this.option?.onChange?.(value);\n this.#cdRef.markForCheck();\n }\n onSurfaceFocus(event: FocusEvent): void {\n this.focus.emit(event);\n this.option?.onFocus?.(event);\n }\n onSurfaceBlur(event: FocusEvent): void {\n this.#onTouched();\n this.blur.emit(event);\n this.option?.onBlur?.(event);\n this.#cdRef.markForCheck();\n }\n onDiagnostics(diagnostics: readonly SdEditorImportDiagnostic[]): void {\n this.#diagnostics.set(diagnostics);\n this.importWarning.emit(diagnostics);\n }\n onMentionSelected(item: SdEditorMentionItem): void {\n this.option?.onMentionSelect?.(item);\n }\n setContent(content: string): void {\n const value = content ?? '';\n this.value = value;\n // Consumer echoes must not replay content or reset the current selection/history.\n if (this.#isCurrentContent(value)) return;\n this.onSourceChange();\n this.surfaceContent.set(value);\n this.#engine?.setContent(value, this.option?.outputFormat ?? 'html');\n this.#cdRef.markForCheck();\n }\n #isCurrentContent(value: string): boolean {\n if (!this.#engine) return value === this.surfaceContent();\n try {\n return this.#engine.format === (this.option?.outputFormat ?? 'html') && value === this.#engine.getContent();\n } catch {\n return false;\n }\n }\n getContent(): string {\n return this.#engine?.getContent() ?? '';\n }\n getHtmlContent(): string {\n return this.#engine?.getHtml() ?? '';\n }\n focusEditor(): void {\n if (!this.effectiveDisabled()) this.#engine?.focus();\n }\n insertMention(item: { id: string; name: string; marker?: string }): void {\n if (!this.#engine || !this.option?.enableMention || this.effectiveDisabled() || this.importDiagnostics().length) return;\n const marker = item.marker ?? this.option.mentionConfig?.feeds?.[0]?.marker ?? '@';\n this.#engine.insertMention({ ...item, marker });\n this.option.onMentionSelect?.({ id: item.id, name: item.name, text: `${marker}${item.name}` });\n }\n getMentions(): { id: string; name: string; marker: string }[] {\n return this.#engine?.getMentions() ?? [];\n }\n writeValue(value: string): void {\n this.setContent(value || '');\n }\n registerOnChange(fn: (value: string) => void): void {\n this.#onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.#onTouched = fn;\n }\n setDisabledState(disabled: boolean): void {\n this.#formDisabled.set(disabled);\n if (disabled) this.onSourceChange();\n this.#cdRef.markForCheck();\n }\n ngOnDestroy(): void {\n this.#destroyed = true;\n this.onSourceChange();\n this.#engine = undefined; // Surface owns engine destruction.\n }\n}\n","<sd-editor-surface\n class=\"sd-mini-editor\"\n variant=\"compact\"\n [content]=\"surfaceContent()\"\n [format]=\"option?.outputFormat ?? 'html'\"\n [editable]=\"!effectiveDisabled()\"\n [placeholder]=\"option?.placeholder\"\n [disabled]=\"effectiveDisabled()\"\n [height]=\"option?.height\"\n [maxHeight]=\"option?.maxHeight\"\n [mentionFeeds]=\"option?.enableMention ? option?.mentionConfig?.feeds : undefined\"\n (engineReady)=\"onEngineReady($event)\"\n (sourceChange)=\"onSourceChange($event)\"\n (formatChange)=\"onFormatChange($event)\"\n (compositionChange)=\"onCompositionChange($event)\"\n (change)=\"onSurfaceChange($event)\"\n (focus)=\"onSurfaceFocus($event)\"\n (blur)=\"onSurfaceBlur($event)\"\n (diagnostics)=\"onDiagnostics($event)\"\n (mentionSelected)=\"onMentionSelected($event)\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