@ngstarter-ui/components 22.3.6 → 22.4.1

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 (476) hide show
  1. package/README.md +27 -0
  2. package/ai/component-registry.json +186 -101
  3. package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
  4. package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
  5. package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
  6. package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
  7. package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
  8. package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
  9. package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
  10. package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
  11. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
  12. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
  13. package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
  14. package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
  15. package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
  16. package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
  17. package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
  18. package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
  19. package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
  20. package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
  21. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
  22. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
  23. package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
  24. package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
  25. package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
  26. package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
  27. package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
  28. package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
  29. package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
  30. package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
  31. package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
  32. package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
  33. package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
  34. package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
  35. package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
  36. package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
  37. package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
  38. package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
  39. package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
  40. package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
  41. package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
  42. package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
  43. package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
  44. package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
  45. package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
  46. package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
  47. package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
  48. package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
  49. package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
  50. package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
  51. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
  52. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
  53. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
  54. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
  55. package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
  56. package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
  57. package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
  58. package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
  59. package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
  60. package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
  61. package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
  62. package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
  63. package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
  64. package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
  65. package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
  66. package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
  67. package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
  68. package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
  70. package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
  71. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
  72. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
  73. package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
  74. package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
  75. package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
  76. package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
  77. package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
  78. package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
  79. package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
  80. package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
  81. package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
  82. package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
  83. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
  84. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
  85. package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
  86. package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
  87. package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
  88. package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
  89. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
  90. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
  91. package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
  92. package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
  93. package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
  94. package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
  95. package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
  96. package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
  97. package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
  98. package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
  99. package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
  100. package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
  101. package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
  102. package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
  103. package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
  104. package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
  105. package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
  106. package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
  107. package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
  108. package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
  109. package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
  110. package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
  111. package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
  112. package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
  113. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
  114. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
  115. package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
  116. package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
  117. package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
  118. package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
  119. package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
  120. package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
  121. package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
  122. package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
  123. package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
  124. package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
  125. package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
  126. package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
  127. package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
  128. package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
  129. package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
  130. package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
  131. package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
  132. package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
  133. package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
  134. package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
  135. package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
  136. package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
  137. package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
  138. package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
  139. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
  140. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
  141. package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
  142. package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
  143. package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
  144. package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
  145. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
  146. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
  147. package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
  148. package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
  149. package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
  150. package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
  151. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
  152. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
  153. package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
  154. package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
  155. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
  156. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
  157. package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
  158. package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
  159. package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
  160. package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
  161. package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
  162. package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
  163. package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
  164. package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
  165. package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
  166. package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
  167. package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
  168. package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
  169. package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
  170. package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
  171. package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
  172. package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
  173. package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
  174. package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
  175. package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
  176. package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
  177. package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
  178. package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
  179. package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
  180. package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
  181. package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
  182. package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
  183. package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
  184. package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
  185. package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
  186. package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
  187. package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
  188. package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
  189. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
  190. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
  191. package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
  192. package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
  193. package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
  194. package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
  195. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
  196. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
  197. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
  198. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
  199. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
  200. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
  201. package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
  202. package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
  203. package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
  204. package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
  205. package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
  206. package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
  207. package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
  208. package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
  209. package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
  210. package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
  211. package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
  212. package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
  213. package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
  214. package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
  215. package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
  216. package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
  217. package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
  218. package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
  219. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
  220. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
  221. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
  222. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
  223. package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
  224. package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
  225. package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
  226. package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
  227. package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
  228. package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
  229. package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
  230. package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
  231. package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
  232. package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
  233. package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
  234. package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
  235. package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
  236. package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
  237. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
  238. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
  239. package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
  240. package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
  241. package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
  242. package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
  243. package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
  244. package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
  245. package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
  246. package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
  247. package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
  248. package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
  249. package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
  250. package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
  251. package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
  252. package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
  253. package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
  254. package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
  255. package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
  256. package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
  257. package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
  258. package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
  259. package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
  260. package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
  261. package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
  262. package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
  263. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
  264. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
  265. package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
  266. package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
  267. package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
  268. package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
  269. package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
  270. package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
  271. package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
  272. package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
  273. package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
  274. package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
  275. package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
  276. package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
  277. package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
  278. package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
  279. package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
  280. package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
  281. package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
  282. package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
  283. package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
  284. package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
  285. package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
  286. package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
  287. package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
  288. package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
  289. package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
  290. package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
  291. package/fesm2022/ngstarter-ui-components.mjs +3 -5
  292. package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
  293. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
  294. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
  295. package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
  296. package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
  297. package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
  298. package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
  299. package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
  300. package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
  301. package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
  302. package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
  303. package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
  304. package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
  305. package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
  306. package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
  307. package/package.json +11 -10
  308. package/styles/_tokens.scss +1 -0
  309. package/types/ngstarter-ui-components-action-required.d.ts +34 -14
  310. package/types/ngstarter-ui-components-alert.d.ts +53 -44
  311. package/types/ngstarter-ui-components-announcement.d.ts +74 -53
  312. package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
  313. package/types/ngstarter-ui-components-avatar.d.ts +113 -66
  314. package/types/ngstarter-ui-components-badge.d.ts +73 -37
  315. package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
  316. package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
  317. package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
  318. package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
  319. package/types/ngstarter-ui-components-button.d.ts +69 -27
  320. package/types/ngstarter-ui-components-calendar.d.ts +123 -71
  321. package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
  322. package/types/ngstarter-ui-components-card.d.ts +75 -71
  323. package/types/ngstarter-ui-components-carousel.d.ts +115 -69
  324. package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
  325. package/types/ngstarter-ui-components-chips.d.ts +288 -195
  326. package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
  327. package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
  328. package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
  329. package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
  330. package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
  331. package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
  332. package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
  333. package/types/ngstarter-ui-components-confirm.d.ts +24 -29
  334. package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
  335. package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
  336. package/types/ngstarter-ui-components-core.d.ts +513 -467
  337. package/types/ngstarter-ui-components-country-select.d.ts +170 -97
  338. package/types/ngstarter-ui-components-crop.d.ts +67 -52
  339. package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
  340. package/types/ngstarter-ui-components-data-view.d.ts +811 -567
  341. package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
  342. package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
  343. package/types/ngstarter-ui-components-dialog.d.ts +138 -116
  344. package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
  345. package/types/ngstarter-ui-components-divider.d.ts +29 -17
  346. package/types/ngstarter-ui-components-drawer.d.ts +39 -30
  347. package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
  348. package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
  349. package/types/ngstarter-ui-components-events.d.ts +73 -57
  350. package/types/ngstarter-ui-components-expand.d.ts +55 -25
  351. package/types/ngstarter-ui-components-expansion.d.ts +93 -64
  352. package/types/ngstarter-ui-components-file-type.d.ts +53 -27
  353. package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
  354. package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
  355. package/types/ngstarter-ui-components-form-field.d.ts +116 -105
  356. package/types/ngstarter-ui-components-gauge.d.ts +32 -20
  357. package/types/ngstarter-ui-components-grid.d.ts +66 -50
  358. package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
  359. package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
  360. package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
  361. package/types/ngstarter-ui-components-icon.d.ts +39 -38
  362. package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
  363. package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
  364. package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
  365. package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
  366. package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
  367. package/types/ngstarter-ui-components-incidents.d.ts +97 -104
  368. package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
  369. package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
  370. package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
  371. package/types/ngstarter-ui-components-input.d.ts +82 -54
  372. package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
  373. package/types/ngstarter-ui-components-kbd.d.ts +8 -12
  374. package/types/ngstarter-ui-components-layout.d.ts +131 -87
  375. package/types/ngstarter-ui-components-list.d.ts +123 -88
  376. package/types/ngstarter-ui-components-logo.d.ts +21 -21
  377. package/types/ngstarter-ui-components-marquee.d.ts +41 -34
  378. package/types/ngstarter-ui-components-menu.d.ts +329 -221
  379. package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
  380. package/types/ngstarter-ui-components-navigation.d.ts +186 -125
  381. package/types/ngstarter-ui-components-notifications.d.ts +104 -89
  382. package/types/ngstarter-ui-components-number-input.d.ts +138 -96
  383. package/types/ngstarter-ui-components-option.d.ts +102 -68
  384. package/types/ngstarter-ui-components-overlay.d.ts +7 -12
  385. package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
  386. package/types/ngstarter-ui-components-paginator.d.ts +171 -129
  387. package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
  388. package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
  389. package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
  390. package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
  391. package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
  392. package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
  393. package/types/ngstarter-ui-components-popover.d.ts +128 -89
  394. package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
  395. package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
  396. package/types/ngstarter-ui-components-radio.d.ts +100 -47
  397. package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
  398. package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
  399. package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
  400. package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
  401. package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
  402. package/types/ngstarter-ui-components-segmented.d.ts +93 -61
  403. package/types/ngstarter-ui-components-select.d.ts +366 -266
  404. package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
  405. package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
  406. package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
  407. package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
  408. package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
  409. package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
  410. package/types/ngstarter-ui-components-slider.d.ts +123 -82
  411. package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
  412. package/types/ngstarter-ui-components-sort.d.ts +99 -63
  413. package/types/ngstarter-ui-components-spinner.d.ts +49 -27
  414. package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
  415. package/types/ngstarter-ui-components-split.d.ts +276 -195
  416. package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
  417. package/types/ngstarter-ui-components-stepper.d.ts +57 -43
  418. package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
  419. package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
  420. package/types/ngstarter-ui-components-table.d.ts +256 -228
  421. package/types/ngstarter-ui-components-tabs.d.ts +231 -138
  422. package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
  423. package/types/ngstarter-ui-components-tiles.d.ts +166 -104
  424. package/types/ngstarter-ui-components-timeline.d.ts +45 -57
  425. package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
  426. package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
  427. package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
  428. package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
  429. package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
  430. package/types/ngstarter-ui-components-tree.d.ts +355 -229
  431. package/types/ngstarter-ui-components-upload.d.ts +216 -131
  432. package/types/ngstarter-ui-components-video-player.d.ts +130 -67
  433. package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
  434. package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
  435. package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
  436. package/types/ngstarter-ui-components.d.ts +2 -2
  437. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs +0 -35
  438. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs.map +0 -1
  439. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs +0 -26
  440. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs.map +0 -1
  441. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs +0 -220
  442. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs.map +0 -1
  443. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
  444. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
  445. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
  446. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
  447. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs +0 -375
  448. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs.map +0 -1
  449. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs +0 -80
  450. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs.map +0 -1
  451. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs +0 -65
  452. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs.map +0 -1
  453. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs +0 -137
  454. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs.map +0 -1
  455. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs +0 -113
  456. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs.map +0 -1
  457. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs +0 -188
  458. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs.map +0 -1
  459. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs +0 -117
  460. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs.map +0 -1
  461. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs +0 -4464
  462. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs.map +0 -1
  463. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs +0 -132
  464. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs.map +0 -1
  465. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs +0 -171
  466. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs.map +0 -1
  467. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs +0 -1653
  468. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs.map +0 -1
  469. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs +0 -20
  470. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs.map +0 -1
  471. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
  472. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
  473. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs +0 -134
  474. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs.map +0 -1
  475. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
  476. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
@@ -0,0 +1,1859 @@
1
+ import { f as contentEditorText, i as cloneContentEditorValue, n as CONTENT_BUILDER, r as CONTENT_EDITOR_BLOCK, t as ContentBuilderStore } from "./content-builder.store-D622mHxt.mjs";
2
+ import { t as ContentEditorContentEditableDirective } from "./content-editor-content-editable.directive-WzD9_71s.mjs";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, Directive, ElementRef, HostBinding, Input, NgZone, PLATFORM_ID, Renderer2, afterNextRender, booleanAttribute, computed, effect, inject, input, output, signal, untracked, viewChild } from "@angular/core";
5
+ import { Icon } from "@ngstarter-ui/components/icon";
6
+ import { DOCUMENT as DOCUMENT$1, isPlatformBrowser, isPlatformServer } from "@angular/common";
7
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
8
+ import { Subject, fromEvent } from "rxjs";
9
+ import { takeUntil as takeUntil$1 } from "rxjs/operators";
10
+ import { CdkMonitorFocus } from "@angular/cdk/a11y";
11
+ import { moveItemInArray } from "@angular/cdk/drag-drop";
12
+ import SelectionArea from "@viselect/vanilla";
13
+ var TableColumnsManagerDirective = class TableColumnsManagerDirective {
14
+ _elementRef = inject(ElementRef);
15
+ _destroyRef = inject(DestroyRef);
16
+ _document = inject(DOCUMENT$1);
17
+ _dragging = false;
18
+ _elementPosition = 0;
19
+ _cellWidth = 90;
20
+ columnAdded = output();
21
+ columnDeleted = output();
22
+ columnManagingStart = output();
23
+ columnManagingEnd = output();
24
+ constructor() {
25
+ afterNextRender(() => {
26
+ this._initResize();
27
+ });
28
+ }
29
+ onContextMenu(event) {
30
+ event.preventDefault();
31
+ event.stopPropagation();
32
+ }
33
+ _initResize() {
34
+ fromEvent(this._elementRef.nativeElement, "mousedown").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
35
+ this._dragging = true;
36
+ const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
37
+ this._elementPosition = elementRect.x + elementRect.width / 2;
38
+ this.columnManagingStart.emit();
39
+ });
40
+ fromEvent(this._document, "mousemove").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
41
+ if (this._dragging) {
42
+ const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
43
+ const elementRightPosition = elementRect.x + elementRect.width;
44
+ const elementLeftPosition = elementRect.x;
45
+ if (event.clientX > this._elementPosition + this._cellWidth && event.clientX > elementRightPosition + this._cellWidth) {
46
+ this._elementPosition = Math.max(this._elementPosition, elementRightPosition) + this._cellWidth;
47
+ this.columnAdded.emit();
48
+ } else if (event.clientX < this._elementPosition - this._cellWidth && event.clientX < elementLeftPosition - this._cellWidth) {
49
+ this._elementPosition = Math.min(this._elementPosition, elementLeftPosition) - this._cellWidth;
50
+ this.columnDeleted.emit();
51
+ }
52
+ }
53
+ });
54
+ fromEvent(this._document, "mouseup").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
55
+ if (this._dragging) {
56
+ this._dragging = false;
57
+ this.columnManagingEnd.emit();
58
+ }
59
+ });
60
+ }
61
+ static ɵfac = i0.ɵɵngDeclareFactory({
62
+ minVersion: "12.0.0",
63
+ version: "22.3.0",
64
+ ngImport: i0,
65
+ type: TableColumnsManagerDirective,
66
+ deps: [],
67
+ target: i0.ɵɵFactoryTarget.Directive
68
+ });
69
+ static ɵdir = i0.ɵɵngDeclareDirective({
70
+ minVersion: "14.0.0",
71
+ version: "22.3.0",
72
+ type: TableColumnsManagerDirective,
73
+ isStandalone: true,
74
+ selector: "[ngsTableColumnsManager]",
75
+ outputs: {
76
+ columnAdded: "columnAdded",
77
+ columnDeleted: "columnDeleted",
78
+ columnManagingStart: "columnManagingStart",
79
+ columnManagingEnd: "columnManagingEnd"
80
+ },
81
+ host: { listeners: { "contextmenu": "onContextMenu($event)" } },
82
+ ngImport: i0
83
+ });
84
+ };
85
+ i0.ɵɵngDeclareClassMetadata({
86
+ minVersion: "12.0.0",
87
+ version: "22.3.0",
88
+ ngImport: i0,
89
+ type: TableColumnsManagerDirective,
90
+ decorators: [{
91
+ type: Directive,
92
+ args: [{
93
+ selector: "[ngsTableColumnsManager]",
94
+ host: { "(contextmenu)": "onContextMenu($event)" }
95
+ }]
96
+ }],
97
+ ctorParameters: () => [],
98
+ propDecorators: {
99
+ columnAdded: [{
100
+ type: i0.Output,
101
+ args: ["columnAdded"]
102
+ }],
103
+ columnDeleted: [{
104
+ type: i0.Output,
105
+ args: ["columnDeleted"]
106
+ }],
107
+ columnManagingStart: [{
108
+ type: i0.Output,
109
+ args: ["columnManagingStart"]
110
+ }],
111
+ columnManagingEnd: [{
112
+ type: i0.Output,
113
+ args: ["columnManagingEnd"]
114
+ }]
115
+ }
116
+ });
117
+ var TableRowsManagerDirective = class TableRowsManagerDirective {
118
+ _elementRef = inject(ElementRef);
119
+ _destroyRef = inject(DestroyRef);
120
+ _document = inject(DOCUMENT$1);
121
+ _dragging = false;
122
+ _elementPosition = 0;
123
+ _cellHeight = 24;
124
+ rowManagingStart = output();
125
+ rowManagingEnd = output();
126
+ rowAdded = output();
127
+ rowDeleted = output();
128
+ constructor() {
129
+ afterNextRender(() => {
130
+ this._initResize();
131
+ });
132
+ }
133
+ onContextMenu(event) {
134
+ event.preventDefault();
135
+ event.stopPropagation();
136
+ }
137
+ _initResize() {
138
+ fromEvent(this._elementRef.nativeElement, "mousedown").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
139
+ this._dragging = true;
140
+ const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
141
+ this._elementPosition = elementRect.y + elementRect.height / 2;
142
+ this.rowManagingStart.emit();
143
+ });
144
+ fromEvent(this._document, "mousemove").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
145
+ if (this._dragging) {
146
+ const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
147
+ const elementBottomPosition = elementRect.y + elementRect.height;
148
+ const elementTopPosition = elementRect.y;
149
+ if (event.clientY > this._elementPosition + this._cellHeight && event.clientY > elementBottomPosition + this._cellHeight) {
150
+ this._elementPosition = elementBottomPosition + this._cellHeight;
151
+ this.rowAdded.emit();
152
+ } else if (event.clientY < this._elementPosition - this._cellHeight && event.clientY < elementTopPosition - this._cellHeight) {
153
+ this._elementPosition = elementTopPosition - this._cellHeight;
154
+ this.rowDeleted.emit();
155
+ }
156
+ }
157
+ });
158
+ fromEvent(this._document, "mouseup").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
159
+ if (this._dragging) {
160
+ this._dragging = false;
161
+ this.rowManagingEnd.emit();
162
+ }
163
+ });
164
+ }
165
+ static ɵfac = i0.ɵɵngDeclareFactory({
166
+ minVersion: "12.0.0",
167
+ version: "22.3.0",
168
+ ngImport: i0,
169
+ type: TableRowsManagerDirective,
170
+ deps: [],
171
+ target: i0.ɵɵFactoryTarget.Directive
172
+ });
173
+ static ɵdir = i0.ɵɵngDeclareDirective({
174
+ minVersion: "14.0.0",
175
+ version: "22.3.0",
176
+ type: TableRowsManagerDirective,
177
+ isStandalone: true,
178
+ selector: "[ngsTableRowsManager]",
179
+ outputs: {
180
+ rowManagingStart: "rowManagingStart",
181
+ rowManagingEnd: "rowManagingEnd",
182
+ rowAdded: "rowAdded",
183
+ rowDeleted: "rowDeleted"
184
+ },
185
+ host: { listeners: { "contextmenu": "onContextMenu($event)" } },
186
+ ngImport: i0
187
+ });
188
+ };
189
+ i0.ɵɵngDeclareClassMetadata({
190
+ minVersion: "12.0.0",
191
+ version: "22.3.0",
192
+ ngImport: i0,
193
+ type: TableRowsManagerDirective,
194
+ decorators: [{
195
+ type: Directive,
196
+ args: [{
197
+ selector: "[ngsTableRowsManager]",
198
+ host: { "(contextmenu)": "onContextMenu($event)" }
199
+ }]
200
+ }],
201
+ ctorParameters: () => [],
202
+ propDecorators: {
203
+ rowManagingStart: [{
204
+ type: i0.Output,
205
+ args: ["rowManagingStart"]
206
+ }],
207
+ rowManagingEnd: [{
208
+ type: i0.Output,
209
+ args: ["rowManagingEnd"]
210
+ }],
211
+ rowAdded: [{
212
+ type: i0.Output,
213
+ args: ["rowAdded"]
214
+ }],
215
+ rowDeleted: [{
216
+ type: i0.Output,
217
+ args: ["rowDeleted"]
218
+ }]
219
+ }
220
+ });
221
+ const RESIZING_TABLE_CLASS = "table-resizing";
222
+ const RESIZE_HANDLE_ACTIVE_CLASS = "resize-handle--active";
223
+ var ResizableTableDirective = class ResizableTableDirective {
224
+ el;
225
+ renderer;
226
+ ngZone;
227
+ _platformId = inject(PLATFORM_ID);
228
+ minColumnWidth = 120;
229
+ resizeHandleWidth = 5;
230
+ mutationObserverDebounceTime = 20;
231
+ resizeEnabled = input(true, ...ngDevMode ? [{ debugName: "resizeEnabled" }] : /* istanbul ignore next */ []);
232
+ columnWidthChange = output();
233
+ columnWidthChangeStart = output();
234
+ columnWidthChangeEnd = output();
235
+ table;
236
+ wrapper = null;
237
+ resizeHandle = null;
238
+ colgroup = null;
239
+ colElements = [];
240
+ isResizing = false;
241
+ resizingColumnIndex = -1;
242
+ resizingColElement = null;
243
+ startX = 0;
244
+ startWidth = 0;
245
+ startEdgeXRelative = 0;
246
+ activeHoverColumnIndex = -1;
247
+ isHandleVisible = false;
248
+ destroy$ = new Subject();
249
+ hideHandleDebounced;
250
+ syncColumnsDebounced;
251
+ listeners = [];
252
+ observer = null;
253
+ constructor(el, renderer, ngZone) {
254
+ this.el = el;
255
+ this.renderer = renderer;
256
+ this.ngZone = ngZone;
257
+ this.table = this.el.nativeElement;
258
+ this.hideHandleDebounced = this.debounce(() => this.hideResizeHandle(), 50);
259
+ this.syncColumnsDebounced = this.debounce(() => {
260
+ this.syncColumnsAndColgroup();
261
+ this.ensureColWidths();
262
+ if (this.isHandleVisible) this.hideResizeHandle();
263
+ }, this.mutationObserverDebounceTime);
264
+ effect(() => {
265
+ if (!this.resizeEnabled()) {
266
+ if (this.isResizing) this.stopResizing(false);
267
+ else this.hideResizeHandle();
268
+ }
269
+ });
270
+ }
271
+ ngOnInit() {}
272
+ ngAfterViewInit() {
273
+ if (isPlatformServer(this._platformId)) return;
274
+ this.checkTableLayout();
275
+ this.createWrapperAndHandle();
276
+ this.syncColumnsAndColgroup();
277
+ if (!this.wrapper || !this.resizeHandle) {
278
+ console.error("ResizableTableDirective: Wrapper or handle creation failed.");
279
+ this.cleanupWrapperAndHandleOnError();
280
+ return;
281
+ }
282
+ this.addWrapperListeners();
283
+ this.setupGlobalResizeListeners();
284
+ this.setupMutationObserver();
285
+ this.ensureColWidths();
286
+ }
287
+ ngOnDestroy() {
288
+ this.observer?.disconnect();
289
+ this.destroy$.next();
290
+ this.destroy$.complete();
291
+ this.listeners.forEach((unlisten) => unlisten());
292
+ this.cleanupWrapperAndHandle();
293
+ }
294
+ checkTableLayout() {
295
+ if (getComputedStyle(this.table).tableLayout !== "fixed") {
296
+ console.warn("ResizableTableDirective: table-layout: fixed is highly recommended.");
297
+ this.renderer.setStyle(this.table, "table-layout", "fixed");
298
+ }
299
+ }
300
+ syncColumnsAndColgroup() {
301
+ let requiredColumnCount = 0;
302
+ const firstDataRow = this.table.querySelector("tbody > tr:first-child");
303
+ if (firstDataRow) requiredColumnCount = firstDataRow.cells.length;
304
+ else {
305
+ const firstHeadRow = this.table.querySelector("thead > tr:first-child");
306
+ if (firstHeadRow) requiredColumnCount = firstHeadRow.cells.length;
307
+ else {
308
+ if (this.colgroup) this.colElements.forEach((col) => this.renderer.removeChild(this.colgroup, col));
309
+ this.colElements = [];
310
+ return;
311
+ }
312
+ }
313
+ this.colgroup = this.table.querySelector("colgroup");
314
+ const currentColElements = Array.from(this.colgroup.querySelectorAll("col"));
315
+ const currentColCount = currentColElements.length;
316
+ if (requiredColumnCount > currentColCount) for (let i = currentColCount; i < requiredColumnCount; i++) {
317
+ const col = this.renderer.createElement("col");
318
+ this.renderer.appendChild(this.colgroup, col);
319
+ }
320
+ else if (requiredColumnCount < currentColCount) for (let i = currentColCount - 1; i >= requiredColumnCount; i--) this.renderer.removeChild(this.colgroup, currentColElements[i]);
321
+ this.colElements = Array.from(this.colgroup.querySelectorAll("col"));
322
+ }
323
+ ensureColWidths() {
324
+ if (!this.resizeEnabled()) return;
325
+ const referenceRow = this.table.querySelector("tbody > tr:first-child, thead > tr:first-child");
326
+ if (!referenceRow || this.colElements.length !== referenceRow.cells.length) return;
327
+ this.colElements.forEach((col, index) => {
328
+ if (!col.style.width && referenceRow.cells[index]) {
329
+ const cellWidth = referenceRow.cells[index].getBoundingClientRect().width;
330
+ if (cellWidth > 0) this.renderer.setStyle(col, "width", `${cellWidth}px`);
331
+ }
332
+ });
333
+ }
334
+ setupMutationObserver() {
335
+ const targetNode = this.table.querySelector("tbody") ?? this.table;
336
+ const config = {
337
+ childList: true,
338
+ subtree: true
339
+ };
340
+ const callback = (mutationsList, observer) => {
341
+ this.ngZone.runOutsideAngular(() => {
342
+ this.syncColumnsDebounced();
343
+ });
344
+ };
345
+ this.observer = new MutationObserver(callback);
346
+ this.observer.observe(targetNode, config);
347
+ }
348
+ createWrapperAndHandle() {
349
+ this.wrapper = this.renderer.createElement("div");
350
+ this.renderer.addClass(this.wrapper, "resizable-table-wrapper");
351
+ this.resizeHandle = this.renderer.createElement("div");
352
+ this.renderer.addClass(this.resizeHandle, "resizable-table-handle");
353
+ this.renderer.setStyle(this.resizeHandle, "width", `${this.resizeHandleWidth}px`);
354
+ const parent = this.renderer.parentNode(this.table);
355
+ if (parent) {
356
+ this.renderer.insertBefore(parent, this.wrapper, this.table);
357
+ this.renderer.appendChild(this.wrapper, this.table);
358
+ this.renderer.appendChild(this.wrapper, this.resizeHandle);
359
+ } else {
360
+ console.error("ResizableTableDirective: Table has no parent node.");
361
+ this.wrapper = null;
362
+ this.resizeHandle = null;
363
+ }
364
+ }
365
+ cleanupWrapperAndHandle() {
366
+ if (this.wrapper && this.wrapper.parentNode) {
367
+ if (this.table.parentNode === this.wrapper) this.renderer.insertBefore(this.wrapper.parentNode, this.table, this.wrapper);
368
+ this.renderer.removeChild(this.wrapper.parentNode, this.wrapper);
369
+ } else if (this.resizeHandle && this.resizeHandle.parentNode) this.renderer.removeChild(this.resizeHandle.parentNode, this.resizeHandle);
370
+ this.wrapper = null;
371
+ this.resizeHandle = null;
372
+ }
373
+ cleanupWrapperAndHandleOnError() {
374
+ if (this.wrapper && this.table.parentNode === this.wrapper) {
375
+ const parent = this.wrapper.parentNode;
376
+ if (parent) {
377
+ this.renderer.insertBefore(parent, this.table, this.wrapper);
378
+ this.renderer.removeChild(parent, this.wrapper);
379
+ }
380
+ }
381
+ this.wrapper = null;
382
+ this.resizeHandle = null;
383
+ }
384
+ addWrapperListeners() {
385
+ if (!this.wrapper) return;
386
+ this.ngZone.runOutsideAngular(() => {
387
+ const mm = this.renderer.listen(this.wrapper, "mousemove", (e) => this.handleMouseMoveWrapper(e));
388
+ this.listeners.push(mm);
389
+ });
390
+ const md = this.renderer.listen(this.wrapper, "mousedown", (e) => this.handleMouseDownWrapper(e));
391
+ const ml = this.renderer.listen(this.wrapper, "mouseleave", (e) => {
392
+ if (!this.isResizing) this.hideResizeHandle();
393
+ });
394
+ this.listeners.push(md, ml);
395
+ }
396
+ handleMouseMoveWrapper(event) {
397
+ if (!this.resizeEnabled() || this.isResizing || !this.wrapper) return;
398
+ const wrapperRect = this.wrapper.getBoundingClientRect();
399
+ const mouseXRelative = event.clientX - wrapperRect.left;
400
+ let targetColumnIndex = -1;
401
+ let edgeXPosition = 0;
402
+ const firstRow = this.table.querySelector("tbody > tr:first-child, thead > tr:first-child");
403
+ if (!firstRow) return;
404
+ if (this.colElements.length !== firstRow.cells.length) return;
405
+ for (let i = 0; i < firstRow.cells.length; i++) {
406
+ const cell = firstRow.cells[i];
407
+ if (!cell) continue;
408
+ const cellEdgeX = cell.getBoundingClientRect().right - wrapperRect.left;
409
+ if (Math.abs(mouseXRelative - cellEdgeX) <= this.resizeHandleWidth / 2) {
410
+ if (this.colElements[i]) {
411
+ targetColumnIndex = i;
412
+ edgeXPosition = cellEdgeX;
413
+ break;
414
+ }
415
+ }
416
+ }
417
+ if (targetColumnIndex !== -1) {
418
+ this.showResizeHandle(edgeXPosition);
419
+ this.activeHoverColumnIndex = targetColumnIndex;
420
+ } else this.hideHandleDebounced();
421
+ }
422
+ handleMouseDownWrapper(event) {
423
+ if (this.resizeEnabled() && this.activeHoverColumnIndex !== -1 && this.isHandleVisible && this.wrapper) {
424
+ const targetCol = this.colElements[this.activeHoverColumnIndex];
425
+ const firstRow = this.table.querySelector("tbody > tr:first-child, thead > tr:first-child");
426
+ if (!targetCol || !firstRow || !firstRow.cells[this.activeHoverColumnIndex]) return;
427
+ this.ensureColWidths();
428
+ this.isResizing = true;
429
+ this.resizingColumnIndex = this.activeHoverColumnIndex;
430
+ this.resizingColElement = targetCol;
431
+ this.startX = event.clientX;
432
+ const colStyleWidth = this.resizingColElement.style.width;
433
+ this.startWidth = colStyleWidth && colStyleWidth.endsWith("px") ? parseFloat(colStyleWidth) : this.resizingColElement.getBoundingClientRect().width;
434
+ if (this.startWidth <= 0) this.startWidth = firstRow.cells[this.resizingColumnIndex].getBoundingClientRect().width;
435
+ const wrapperRect = this.wrapper.getBoundingClientRect();
436
+ const cellRect = firstRow.cells[this.resizingColumnIndex].getBoundingClientRect();
437
+ this.startEdgeXRelative = cellRect.right - wrapperRect.left;
438
+ this.renderer.addClass(this.table, RESIZING_TABLE_CLASS);
439
+ event.preventDefault();
440
+ this.columnWidthChangeStart.emit();
441
+ }
442
+ }
443
+ showResizeHandle(edgeX) {
444
+ if (!this.resizeHandle || !this.wrapper) return;
445
+ const handleLeft = edgeX - this.resizeHandleWidth / 2;
446
+ this.renderer.setStyle(this.resizeHandle, "left", `${handleLeft}px`);
447
+ this.renderer.setStyle(this.resizeHandle, "top", `${this.table.offsetTop}px`);
448
+ this.renderer.setStyle(this.resizeHandle, "height", `${this.table.offsetHeight}px`);
449
+ this.renderer.addClass(this.resizeHandle, RESIZE_HANDLE_ACTIVE_CLASS);
450
+ this.isHandleVisible = true;
451
+ }
452
+ hideResizeHandle() {
453
+ if (this.resizeHandle && this.isHandleVisible) {
454
+ this.renderer.removeClass(this.resizeHandle, RESIZE_HANDLE_ACTIVE_CLASS);
455
+ this.isHandleVisible = false;
456
+ this.activeHoverColumnIndex = -1;
457
+ }
458
+ }
459
+ debounce(func, wait) {
460
+ let timeout;
461
+ return (...args) => {
462
+ clearTimeout(timeout);
463
+ timeout = setTimeout(() => func.apply(this, args), wait);
464
+ };
465
+ }
466
+ setupGlobalResizeListeners() {
467
+ this.ngZone.runOutsideAngular(() => {
468
+ fromEvent(document, "mousemove").pipe(takeUntil$1(this.destroy$)).subscribe((event) => {
469
+ if (!this.resizeEnabled() || !this.isResizing || !this.resizingColElement || !this.wrapper || !this.resizeHandle) return;
470
+ if (!this.resizingColElement.parentElement) {
471
+ this.stopResizing();
472
+ return;
473
+ }
474
+ const deltaX = event.clientX - this.startX;
475
+ const newWidth = this.startWidth + deltaX;
476
+ const finalWidth = Math.max(newWidth, this.minColumnWidth);
477
+ this.renderer.setStyle(this.resizingColElement, "width", `${finalWidth}px`);
478
+ const actualDeltaX = finalWidth - this.startWidth;
479
+ const handleLeft = this.startEdgeXRelative + actualDeltaX - this.resizeHandleWidth / 2;
480
+ this.renderer.setStyle(this.resizeHandle, "left", `${handleLeft}px`);
481
+ if (!this.isHandleVisible) {
482
+ this.renderer.addClass(this.resizeHandle, RESIZE_HANDLE_ACTIVE_CLASS);
483
+ this.isHandleVisible = true;
484
+ }
485
+ this.updateHandleHeight();
486
+ });
487
+ fromEvent(document, "mouseup").pipe(takeUntil$1(this.destroy$)).subscribe(() => {
488
+ if (this.isResizing) this.ngZone.run(() => {
489
+ this.stopResizing(this.resizeEnabled());
490
+ });
491
+ });
492
+ });
493
+ }
494
+ stopResizing(commit = true) {
495
+ if (commit && this.resizingColElement) this.columnWidthChange.emit({
496
+ columnIndex: this.resizingColumnIndex,
497
+ width: this.resizingColElement.getBoundingClientRect().width
498
+ });
499
+ else if (this.resizingColElement) this.renderer.setStyle(this.resizingColElement, "width", `${this.startWidth}px`);
500
+ this.renderer.removeClass(this.table, RESIZING_TABLE_CLASS);
501
+ this.hideResizeHandle();
502
+ this.isResizing = false;
503
+ this.resizingColumnIndex = -1;
504
+ this.resizingColElement = null;
505
+ this.columnWidthChangeEnd.emit();
506
+ }
507
+ updateHandleHeight() {
508
+ if (this.resizeHandle && this.isHandleVisible && this.wrapper) requestAnimationFrame(() => {
509
+ if (this.isHandleVisible && this.resizeHandle && this.table) {
510
+ this.renderer.setStyle(this.resizeHandle, "top", `${this.table.offsetTop}px`);
511
+ this.renderer.setStyle(this.resizeHandle, "height", `${this.table.offsetHeight}px`);
512
+ }
513
+ });
514
+ }
515
+ static ɵfac = i0.ɵɵngDeclareFactory({
516
+ minVersion: "12.0.0",
517
+ version: "22.3.0",
518
+ ngImport: i0,
519
+ type: ResizableTableDirective,
520
+ deps: [
521
+ { token: i0.ElementRef },
522
+ { token: i0.Renderer2 },
523
+ { token: i0.NgZone }
524
+ ],
525
+ target: i0.ɵɵFactoryTarget.Directive
526
+ });
527
+ static ɵdir = i0.ɵɵngDeclareDirective({
528
+ minVersion: "17.1.0",
529
+ version: "22.3.0",
530
+ type: ResizableTableDirective,
531
+ isStandalone: true,
532
+ selector: "table[ngsResizableTable]",
533
+ inputs: {
534
+ minColumnWidth: {
535
+ classPropertyName: "minColumnWidth",
536
+ publicName: "minColumnWidth",
537
+ isSignal: false,
538
+ isRequired: false,
539
+ transformFunction: null
540
+ },
541
+ resizeHandleWidth: {
542
+ classPropertyName: "resizeHandleWidth",
543
+ publicName: "resizeHandleWidth",
544
+ isSignal: false,
545
+ isRequired: false,
546
+ transformFunction: null
547
+ },
548
+ mutationObserverDebounceTime: {
549
+ classPropertyName: "mutationObserverDebounceTime",
550
+ publicName: "mutationObserverDebounceTime",
551
+ isSignal: false,
552
+ isRequired: false,
553
+ transformFunction: null
554
+ },
555
+ resizeEnabled: {
556
+ classPropertyName: "resizeEnabled",
557
+ publicName: "resizeEnabled",
558
+ isSignal: true,
559
+ isRequired: false,
560
+ transformFunction: null
561
+ }
562
+ },
563
+ outputs: {
564
+ columnWidthChange: "columnWidthChange",
565
+ columnWidthChangeStart: "columnWidthChangeStart",
566
+ columnWidthChangeEnd: "columnWidthChangeEnd"
567
+ },
568
+ ngImport: i0
569
+ });
570
+ };
571
+ i0.ɵɵngDeclareClassMetadata({
572
+ minVersion: "12.0.0",
573
+ version: "22.3.0",
574
+ ngImport: i0,
575
+ type: ResizableTableDirective,
576
+ decorators: [{
577
+ type: Directive,
578
+ args: [{ selector: "table[ngsResizableTable]" }]
579
+ }],
580
+ ctorParameters: () => [
581
+ { type: i0.ElementRef },
582
+ { type: i0.Renderer2 },
583
+ { type: i0.NgZone }
584
+ ],
585
+ propDecorators: {
586
+ minColumnWidth: [{ type: Input }],
587
+ resizeHandleWidth: [{ type: Input }],
588
+ mutationObserverDebounceTime: [{ type: Input }],
589
+ resizeEnabled: [{
590
+ type: i0.Input,
591
+ args: [{
592
+ isSignal: true,
593
+ alias: "resizeEnabled",
594
+ required: false
595
+ }]
596
+ }],
597
+ columnWidthChange: [{
598
+ type: i0.Output,
599
+ args: ["columnWidthChange"]
600
+ }],
601
+ columnWidthChangeStart: [{
602
+ type: i0.Output,
603
+ args: ["columnWidthChangeStart"]
604
+ }],
605
+ columnWidthChangeEnd: [{
606
+ type: i0.Output,
607
+ args: ["columnWidthChangeEnd"]
608
+ }]
609
+ }
610
+ });
611
+ const HIDE_DELAY_MS = 300;
612
+ var DraggableTableComponent = class DraggableTableComponent {
613
+ contentBuilder = inject(CONTENT_BUILDER);
614
+ _platformId = inject(PLATFORM_ID);
615
+ elRef = inject(ElementRef);
616
+ renderer = inject(Renderer2);
617
+ ngZone = inject(NgZone);
618
+ destroyRef = inject(DestroyRef);
619
+ table = null;
620
+ suppressInteractions = false;
621
+ columnHandler;
622
+ rowHandler;
623
+ dropIndicator;
624
+ hoveredCell = null;
625
+ hoveredColumnIndex = -1;
626
+ hoveredRowIndex = -1;
627
+ isDragging = false;
628
+ dragMode = null;
629
+ startX = 0;
630
+ startY = 0;
631
+ handlerStartY = 0;
632
+ draggedElement = null;
633
+ draggedElementSource = null;
634
+ startElementIndex = -1;
635
+ currentDropIndex = -1;
636
+ hideTimeoutId = null;
637
+ columnInfo = [];
638
+ rowInfo = [];
639
+ listeners = [];
640
+ boundOnDrag;
641
+ boundEndDrag;
642
+ handlerSize = 18;
643
+ handlerOffset = -9;
644
+ indicatorThickness = 3;
645
+ suppressResetTimeoutId = null;
646
+ scrollContainerRef = null;
647
+ scrollSub = null;
648
+ hostClass = true;
649
+ disabled = input(false, {
650
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
651
+ transform: booleanAttribute
652
+ });
653
+ columnMoved = output();
654
+ rowMoved = output();
655
+ moveStart = output();
656
+ moveEnd = output();
657
+ constructor() {
658
+ this.boundOnDrag = this.onDrag.bind(this);
659
+ this.boundEndDrag = this.endDrag.bind(this);
660
+ }
661
+ ngOnInit() {
662
+ if (isPlatformServer(this._platformId)) return;
663
+ this.createHandlers();
664
+ this.createDropIndicator();
665
+ this.prepareListeners();
666
+ }
667
+ ngAfterViewInit() {
668
+ if (isPlatformServer(this._platformId)) return;
669
+ this.table = this.elRef.nativeElement.querySelector("table");
670
+ if (!this.table) return;
671
+ if (getComputedStyle(this.table).position === "static") this.renderer.setStyle(this.table, "position", "relative");
672
+ this.renderer.appendChild(this.table, this.columnHandler);
673
+ this.renderer.appendChild(this.table, this.rowHandler);
674
+ this.renderer.appendChild(this.table, this.dropIndicator);
675
+ this.attachListeners("element");
676
+ this.bindScrollContainerListener();
677
+ }
678
+ ngOnDestroy() {
679
+ if (isPlatformServer(this._platformId)) return;
680
+ this.unbindScrollContainerListener();
681
+ this.detachListeners("all");
682
+ this.cancelHideTimer();
683
+ if (this.suppressResetTimeoutId) {
684
+ clearTimeout(this.suppressResetTimeoutId);
685
+ this.suppressResetTimeoutId = null;
686
+ }
687
+ if (this.dropIndicator?.parentNode) this.renderer.removeChild(this.dropIndicator.parentNode, this.dropIndicator);
688
+ if (this.columnHandler?.parentNode) this.renderer.removeChild(this.columnHandler.parentNode, this.columnHandler);
689
+ if (this.rowHandler?.parentNode) this.renderer.removeChild(this.rowHandler.parentNode, this.rowHandler);
690
+ if (this.table) {
691
+ this.renderer.removeClass(this.table, "dragging-column");
692
+ this.renderer.removeClass(this.table, "dragging-row");
693
+ this.table.querySelectorAll(".dragging-source").forEach((el) => this.renderer.removeClass(el, "dragging-source"));
694
+ this.table.querySelectorAll(".col-highlight").forEach((el) => this.renderer.removeClass(el, "col-highlight"));
695
+ }
696
+ document.body.style.cursor = "";
697
+ this.columnInfo = [];
698
+ this.rowInfo = [];
699
+ this.currentDropIndex = -1;
700
+ this.suppressInteractions = false;
701
+ }
702
+ prepareListeners() {
703
+ this.listeners = [
704
+ {
705
+ name: "tableMouseOver",
706
+ type: "element",
707
+ target: () => this.table,
708
+ event: "mouseover",
709
+ handler: this.onTableMouseOver.bind(this)
710
+ },
711
+ {
712
+ name: "tableMouseLeave",
713
+ type: "element",
714
+ target: () => this.table,
715
+ event: "mouseleave",
716
+ handler: this.onTableMouseLeave.bind(this)
717
+ },
718
+ {
719
+ name: "colHandlerMouseDown",
720
+ type: "element",
721
+ target: () => this.columnHandler,
722
+ event: "mousedown",
723
+ handler: (e) => this.onHandlerMouseDown(e, "column")
724
+ },
725
+ {
726
+ name: "colHandlerMouseEnter",
727
+ type: "element",
728
+ target: () => this.columnHandler,
729
+ event: "mouseenter",
730
+ handler: this.onHandlerMouseEnter.bind(this)
731
+ },
732
+ {
733
+ name: "colHandlerMouseLeave",
734
+ type: "element",
735
+ target: () => this.columnHandler,
736
+ event: "mouseleave",
737
+ handler: this.onHandlerMouseLeave.bind(this)
738
+ },
739
+ {
740
+ name: "rowHandlerMouseDown",
741
+ type: "element",
742
+ target: () => this.rowHandler,
743
+ event: "mousedown",
744
+ handler: (e) => this.onHandlerMouseDown(e, "row")
745
+ },
746
+ {
747
+ name: "rowHandlerMouseEnter",
748
+ type: "element",
749
+ target: () => this.rowHandler,
750
+ event: "mouseenter",
751
+ handler: this.onHandlerMouseEnter.bind(this)
752
+ },
753
+ {
754
+ name: "rowHandlerMouseLeave",
755
+ type: "element",
756
+ target: () => this.rowHandler,
757
+ event: "mouseleave",
758
+ handler: this.onHandlerMouseLeave.bind(this)
759
+ },
760
+ {
761
+ name: "docMouseMove",
762
+ type: "document",
763
+ target: () => document,
764
+ event: "mousemove",
765
+ handler: this.boundOnDrag
766
+ },
767
+ {
768
+ name: "docMouseUp",
769
+ type: "document",
770
+ target: () => document,
771
+ event: "mouseup",
772
+ handler: (e) => {
773
+ this.suppressInteractions = false;
774
+ this.boundEndDrag(e);
775
+ }
776
+ },
777
+ {
778
+ name: "winBlur",
779
+ type: "document",
780
+ target: () => window,
781
+ event: "blur",
782
+ handler: () => {
783
+ this.suppressInteractions = false;
784
+ }
785
+ },
786
+ {
787
+ name: "visibilityChange",
788
+ type: "document",
789
+ target: () => document,
790
+ event: "visibilitychange",
791
+ handler: () => {
792
+ if (document.visibilityState !== "visible") this.suppressInteractions = false;
793
+ }
794
+ }
795
+ ];
796
+ }
797
+ attachListeners(type = "element") {
798
+ this.ngZone.runOutsideAngular(() => {
799
+ this.listeners.forEach((listener) => {
800
+ if (listener.type === "document" && type !== "document" && type !== "all") return;
801
+ if (listener.type === "element" && type === "document") return;
802
+ if (listener.cleanup || !listener.target) return;
803
+ const targetElement = listener.target();
804
+ if (!targetElement) return;
805
+ listener.cleanup = this.renderer.listen(targetElement, listener.event, listener.handler);
806
+ });
807
+ });
808
+ }
809
+ detachListeners(type = "all") {
810
+ this.listeners.forEach((listener) => {
811
+ if (listener.type === "document" && type !== "document" && type !== "all") return;
812
+ if (listener.type === "element" && type === "document") return;
813
+ if (listener.cleanup) {
814
+ listener.cleanup();
815
+ listener.cleanup = void 0;
816
+ }
817
+ });
818
+ }
819
+ onTableMouseOver(event) {
820
+ this.cancelHideTimer();
821
+ this.ensureScrollContainerListener();
822
+ if (!this.table || this.isDragging) return;
823
+ if (this.suppressInteractions) return;
824
+ if (typeof event.buttons === "number" ? event.buttons !== 0 : false) return;
825
+ const cell = event.target.closest("td, th");
826
+ if (cell && this.table.contains(cell)) {
827
+ const currentColumnIndex = cell.cellIndex;
828
+ const currentRow = cell.closest("tr");
829
+ const currentRowIndex = currentRow?.parentElement?.tagName === "TBODY" ? Array.from(currentRow.parentElement.children).indexOf(currentRow) : -1;
830
+ this.hoveredCell = cell;
831
+ if (currentColumnIndex !== this.hoveredColumnIndex || this.columnHandler.style.visibility === "hidden") {
832
+ this.hoveredColumnIndex = currentColumnIndex;
833
+ this.positionColumnHandler(cell);
834
+ this.renderer.setStyle(this.columnHandler, "visibility", "visible");
835
+ }
836
+ if (currentRowIndex !== -1) {
837
+ if (currentRowIndex !== this.hoveredRowIndex || this.rowHandler.style.visibility === "hidden") {
838
+ this.hoveredRowIndex = currentRowIndex;
839
+ this.positionRowHandler(cell);
840
+ this.renderer.setStyle(this.rowHandler, "visibility", "visible");
841
+ }
842
+ } else if (this.hoveredRowIndex !== -1) {
843
+ this.renderer.setStyle(this.rowHandler, "visibility", "hidden");
844
+ this.hoveredRowIndex = -1;
845
+ }
846
+ }
847
+ }
848
+ onTableMouseLeave(event) {
849
+ if (this.isDragging) return;
850
+ if (this.suppressInteractions) return;
851
+ const relatedTarget = event.relatedTarget;
852
+ if (relatedTarget !== this.columnHandler && relatedTarget !== this.rowHandler) this.scheduleHideHandlers();
853
+ }
854
+ onHandlerMouseEnter() {
855
+ this.cancelHideTimer();
856
+ }
857
+ onHandlerMouseLeave(event) {
858
+ if (this.isDragging) return;
859
+ if (this.suppressInteractions) return;
860
+ const relatedTarget = event.relatedTarget;
861
+ const isOverTable = relatedTarget && this.table && this.table.contains(relatedTarget);
862
+ const isOverOtherHandler = event.target === this.columnHandler && relatedTarget === this.rowHandler || event.target === this.rowHandler && relatedTarget === this.columnHandler;
863
+ if (!isOverTable && !isOverOtherHandler) this.scheduleHideHandlers();
864
+ }
865
+ onHandlerMouseDown(event, mode) {
866
+ if (!(event.button === 0 && (event.buttons & 1) === 1) || event.ctrlKey) {
867
+ this.suppressInteractions = true;
868
+ event.preventDefault();
869
+ event.stopPropagation();
870
+ this.cancelHideTimer();
871
+ if (this.suppressResetTimeoutId) {
872
+ clearTimeout(this.suppressResetTimeoutId);
873
+ this.suppressResetTimeoutId = null;
874
+ }
875
+ this.suppressResetTimeoutId = setTimeout(() => {
876
+ this.suppressInteractions = false;
877
+ this.suppressResetTimeoutId = null;
878
+ }, 1200);
879
+ return;
880
+ }
881
+ this.startDrag(event, mode);
882
+ }
883
+ createHandlers() {
884
+ this.columnHandler = this.renderer.createElement("div");
885
+ this.columnHandler.oncontextmenu = ((e) => {
886
+ e.preventDefault();
887
+ e.stopPropagation();
888
+ });
889
+ this.renderer.addClass(this.columnHandler, "drag-handler");
890
+ this.renderer.addClass(this.columnHandler, "column-handler");
891
+ this.renderer.setStyle(this.columnHandler, "position", "fixed");
892
+ this.renderer.setStyle(this.columnHandler, "visibility", "hidden");
893
+ this.renderer.setStyle(this.columnHandler, "z-index", "1000");
894
+ this.rowHandler = this.renderer.createElement("div");
895
+ this.rowHandler.oncontextmenu = ((e) => {
896
+ e.preventDefault();
897
+ e.stopPropagation();
898
+ });
899
+ this.renderer.addClass(this.rowHandler, "drag-handler");
900
+ this.renderer.addClass(this.rowHandler, "row-handler");
901
+ this.renderer.setStyle(this.rowHandler, "position", "fixed");
902
+ this.renderer.setStyle(this.rowHandler, "visibility", "hidden");
903
+ this.renderer.setStyle(this.rowHandler, "z-index", "1000");
904
+ }
905
+ createDropIndicator() {
906
+ this.dropIndicator = this.renderer.createElement("div");
907
+ this.renderer.addClass(this.dropIndicator, "drop-indicator");
908
+ }
909
+ positionColumnHandler(cellOrIndex) {
910
+ if (!this.table) return;
911
+ let targetCell = null;
912
+ if (typeof cellOrIndex === "number") {
913
+ targetCell = this.findFirstVisibleCellInColumn(cellOrIndex);
914
+ if (!targetCell) return;
915
+ } else targetCell = cellOrIndex;
916
+ const tableRect = this.table.getBoundingClientRect();
917
+ const cellRect = targetCell.getBoundingClientRect();
918
+ const colHandlerLeft = cellRect.left + cellRect.width / 2 - this.handlerSize / 2;
919
+ const colHandlerTop = tableRect.top - this.handlerSize - this.handlerOffset;
920
+ this.renderer.setStyle(this.columnHandler, "top", `${colHandlerTop}px`);
921
+ this.renderer.setStyle(this.columnHandler, "left", `${colHandlerLeft}px`);
922
+ }
923
+ positionRowHandler(cell) {
924
+ if (!this.table || this.isDragging) return;
925
+ const tableRect = this.table.getBoundingClientRect();
926
+ const cellRect = cell.getBoundingClientRect();
927
+ const rowHandlerTop = cellRect.top + cellRect.height / 2 - this.handlerSize / 2;
928
+ const rowHandlerLeft = tableRect.left - this.handlerSize - this.handlerOffset;
929
+ this.renderer.setStyle(this.rowHandler, "top", `${rowHandlerTop}px`);
930
+ this.renderer.setStyle(this.rowHandler, "left", `${rowHandlerLeft}px`);
931
+ }
932
+ scheduleHideHandlers() {
933
+ this.cancelHideTimer();
934
+ this.hideTimeoutId = setTimeout(() => {
935
+ this.hideHandlers();
936
+ this.hideTimeoutId = null;
937
+ }, HIDE_DELAY_MS);
938
+ }
939
+ cancelHideTimer() {
940
+ if (this.hideTimeoutId) {
941
+ clearTimeout(this.hideTimeoutId);
942
+ this.hideTimeoutId = null;
943
+ }
944
+ }
945
+ hideHandlers() {
946
+ if (!this.isDragging) {
947
+ this.renderer.setStyle(this.columnHandler, "visibility", "hidden");
948
+ this.renderer.setStyle(this.rowHandler, "visibility", "hidden");
949
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
950
+ this.hoveredCell = null;
951
+ this.hoveredColumnIndex = -1;
952
+ this.hoveredRowIndex = -1;
953
+ }
954
+ }
955
+ startDrag(event, mode) {
956
+ if (!(event.button === 0 && (event.buttons & 1) === 1) || event.ctrlKey) return;
957
+ this.cancelHideTimer();
958
+ const sourceRow = mode === "row" ? this.hoveredCell?.closest("tr") : null;
959
+ if (!this.table || mode === "row" && this.hoveredRowIndex < 0 || mode === "column" && this.hoveredColumnIndex < 0 || mode === "row" && sourceRow?.parentElement?.tagName !== "TBODY") return;
960
+ event.preventDefault();
961
+ this.isDragging = true;
962
+ this.dragMode = mode;
963
+ this.startX = event.clientX;
964
+ this.startY = event.clientY;
965
+ this.currentDropIndex = -1;
966
+ if (mode === "column") {
967
+ this.startElementIndex = this.hoveredColumnIndex;
968
+ this.currentDropIndex = this.startElementIndex;
969
+ this.draggedElement = this.columnHandler;
970
+ this.draggedElementSource = null;
971
+ this.renderer.addClass(this.table, "dragging-column");
972
+ this.styleColumnAsSource(this.startElementIndex, true);
973
+ this.calculateColumnInfo();
974
+ this.updateColumnHandlerPositionOnDrag(event.clientX);
975
+ this.renderer.setStyle(this.columnHandler, "visibility", "visible");
976
+ this.renderer.setStyle(this.rowHandler, "visibility", "hidden");
977
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
978
+ } else {
979
+ this.startElementIndex = this.hoveredRowIndex;
980
+ this.currentDropIndex = this.startElementIndex;
981
+ this.draggedElement = this.rowHandler;
982
+ this.draggedElementSource = sourceRow;
983
+ this.renderer.addClass(this.draggedElementSource, "dragging-source");
984
+ this.renderer.addClass(this.table, "dragging-row");
985
+ this.calculateRowInfo();
986
+ this.handlerStartY = parseFloat(this.rowHandler.style.top || "0");
987
+ this.updateRowHandlerPositionOnDrag(event.clientY);
988
+ this.renderer.setStyle(this.rowHandler, "visibility", "visible");
989
+ this.renderer.setStyle(this.columnHandler, "visibility", "hidden");
990
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
991
+ }
992
+ if (this.draggedElement) this.renderer.addClass(this.draggedElement, "dragging-active-handler");
993
+ this.attachListeners("document");
994
+ }
995
+ onDrag(event) {
996
+ if (!this.isDragging || !this.draggedElement || !this.table) return;
997
+ if ((event.buttons & 1) !== 1) {
998
+ this.endDrag(event);
999
+ return;
1000
+ }
1001
+ event.preventDefault();
1002
+ this.moveStart.emit();
1003
+ const currentX = event.clientX;
1004
+ const currentY = event.clientY;
1005
+ document.body.style.cursor = "grabbing";
1006
+ if (this.dragMode === "row") {
1007
+ this.updateRowHandlerPositionOnDrag(currentY);
1008
+ const currentHandlerCenterY = parseFloat(this.rowHandler.style.top || "0") + this.handlerSize / 2;
1009
+ const newVisualTargetIndex = this.getVisualTargetRowIndex(currentHandlerCenterY);
1010
+ if (newVisualTargetIndex !== -1) {
1011
+ this.updateDropIndicator(newVisualTargetIndex, "row");
1012
+ this.currentDropIndex = newVisualTargetIndex;
1013
+ } else {
1014
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
1015
+ this.currentDropIndex = -1;
1016
+ }
1017
+ this.clearDropHighlights();
1018
+ } else if (this.dragMode === "column") {
1019
+ this.updateColumnHandlerPositionOnDrag(currentX);
1020
+ const currentHandlerCenterX = parseFloat(this.columnHandler.style.left || "0") + this.handlerSize / 2;
1021
+ const newVisualTargetIndex = this.getVisualTargetColumnIndex(currentHandlerCenterX);
1022
+ if (newVisualTargetIndex !== -1) {
1023
+ this.updateDropIndicator(newVisualTargetIndex, "column");
1024
+ this.currentDropIndex = newVisualTargetIndex;
1025
+ } else {
1026
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
1027
+ this.currentDropIndex = -1;
1028
+ }
1029
+ this.clearDropHighlights();
1030
+ }
1031
+ }
1032
+ getVisualTargetColumnIndex(currentHandlerCenterX) {
1033
+ if (this.startElementIndex < 0 || !this.columnInfo?.length) return -1;
1034
+ let potentialTargetIndex = this.startElementIndex;
1035
+ const currentGeometry = this.columnInfo;
1036
+ for (const targetColumn of currentGeometry) {
1037
+ if (targetColumn.index === this.startElementIndex) continue;
1038
+ const targetCenter = targetColumn.center;
1039
+ const threshold = targetColumn.width * .5;
1040
+ if (targetColumn.index > this.startElementIndex && currentHandlerCenterX > targetCenter - threshold) potentialTargetIndex = Math.max(potentialTargetIndex, targetColumn.index);
1041
+ else if (targetColumn.index < this.startElementIndex && currentHandlerCenterX < targetCenter + threshold) potentialTargetIndex = potentialTargetIndex === this.startElementIndex ? targetColumn.index : Math.min(potentialTargetIndex, targetColumn.index);
1042
+ }
1043
+ return potentialTargetIndex;
1044
+ }
1045
+ getVisualTargetRowIndex(currentHandlerCenterY) {
1046
+ if (this.startElementIndex < 0 || !this.table?.tBodies[0] || !this.rowInfo?.length) return -1;
1047
+ let potentialTargetIndex = this.startElementIndex;
1048
+ const currentGeometry = this.rowInfo;
1049
+ for (const targetRow of currentGeometry) {
1050
+ if (targetRow.index === this.startElementIndex) continue;
1051
+ const targetCenter = targetRow.center;
1052
+ const threshold = targetRow.height * .5;
1053
+ if (targetRow.index > this.startElementIndex && currentHandlerCenterY > targetCenter - threshold) potentialTargetIndex = Math.max(potentialTargetIndex, targetRow.index);
1054
+ else if (targetRow.index < this.startElementIndex && currentHandlerCenterY < targetCenter + threshold) potentialTargetIndex = potentialTargetIndex === this.startElementIndex ? targetRow.index : Math.min(potentialTargetIndex, targetRow.index);
1055
+ }
1056
+ return potentialTargetIndex;
1057
+ }
1058
+ updateColumnHandlerPositionOnDrag(currentX) {
1059
+ if (!this.table || !this.columnHandler) return;
1060
+ const handlerLeft = currentX - this.handlerSize / 2;
1061
+ this.renderer.setStyle(this.columnHandler, "left", `${handlerLeft}px`);
1062
+ }
1063
+ updateRowHandlerPositionOnDrag(currentY) {
1064
+ if (!this.table || !this.rowHandler) return;
1065
+ const deltaY = currentY - this.startY;
1066
+ const handlerTop = this.handlerStartY + deltaY;
1067
+ this.renderer.setStyle(this.rowHandler, "top", `${handlerTop}px`);
1068
+ }
1069
+ endDrag(event) {
1070
+ if (!this.isDragging) return;
1071
+ this.detachListeners("document");
1072
+ event.preventDefault();
1073
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
1074
+ if (!this.table) {
1075
+ this.cleanupDragState();
1076
+ return;
1077
+ }
1078
+ const finalTargetIndex = this.currentDropIndex;
1079
+ if (this.startElementIndex !== -1 && finalTargetIndex !== -1 && finalTargetIndex !== this.startElementIndex) {
1080
+ if (this.dragMode === "column") {
1081
+ this.moveColumn(this.startElementIndex, finalTargetIndex);
1082
+ this.columnMoved.emit({
1083
+ startElementIndex: this.startElementIndex,
1084
+ finalTargetIndex
1085
+ });
1086
+ } else if (this.dragMode === "row") {
1087
+ this.moveRow(this.startElementIndex, finalTargetIndex);
1088
+ this.rowMoved.emit({
1089
+ startElementIndex: this.startElementIndex,
1090
+ finalTargetIndex
1091
+ });
1092
+ }
1093
+ }
1094
+ this.cleanupDragState();
1095
+ this.moveEnd.emit();
1096
+ this.table.querySelectorAll("td.dragging-source, th.dragging-source").forEach((cell) => {
1097
+ this.renderer.removeClass(cell, "dragging-source");
1098
+ });
1099
+ }
1100
+ cleanupDragState() {
1101
+ const draggedMode = this.dragMode;
1102
+ const startIndex = this.startElementIndex;
1103
+ const sourceElement = this.draggedElementSource;
1104
+ const activeHandler = this.draggedElement;
1105
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
1106
+ this.isDragging = false;
1107
+ this.dragMode = null;
1108
+ this.startElementIndex = -1;
1109
+ this.draggedElement = null;
1110
+ this.draggedElementSource = null;
1111
+ this.columnInfo = [];
1112
+ this.rowInfo = [];
1113
+ this.currentDropIndex = -1;
1114
+ this.handlerStartY = 0;
1115
+ this.suppressInteractions = false;
1116
+ this.clearDropHighlights();
1117
+ if (this.table) {
1118
+ if (draggedMode === "column") {
1119
+ this.renderer.removeClass(this.table, "dragging-column");
1120
+ if (startIndex >= 0) {
1121
+ this.styleColumnAsSource(startIndex, false);
1122
+ this.highlightColumn(startIndex, false);
1123
+ } else {
1124
+ this.table.querySelectorAll("td.dragging-source, th.dragging-source").forEach((cell) => this.renderer.removeClass(cell, "dragging-source"));
1125
+ this.table.querySelectorAll(".col-highlight").forEach((cell) => this.renderer.removeClass(cell, "col-highlight"));
1126
+ }
1127
+ } else if (draggedMode === "row") {
1128
+ this.renderer.removeClass(this.table, "dragging-row");
1129
+ if (sourceElement) this.renderer.removeClass(sourceElement, "dragging-source");
1130
+ }
1131
+ }
1132
+ if (activeHandler) this.renderer.removeClass(activeHandler, "dragging-active-handler");
1133
+ document.body.style.cursor = "";
1134
+ this.hideHandlers();
1135
+ this.cancelHideTimer();
1136
+ }
1137
+ moveRow(fromIndex, toIndex) {
1138
+ if (!this.table) return;
1139
+ const tbody = this.table.tBodies[0];
1140
+ if (!tbody) return;
1141
+ const visibleRows = Array.from(tbody.rows).filter((r) => !r.classList.contains("dragging-source"));
1142
+ if (fromIndex < 0 || fromIndex >= visibleRows.length || toIndex < 0 || toIndex > visibleRows.length || fromIndex === toIndex) {
1143
+ const allRows = Array.from(tbody.rows);
1144
+ if (fromIndex < 0 || fromIndex >= allRows.length || toIndex < 0 || toIndex > allRows.length || fromIndex === toIndex) return;
1145
+ }
1146
+ const rowToMove = tbody.querySelector("tr.dragging-source");
1147
+ if (!rowToMove) return;
1148
+ const actualFromIndex = Array.from(tbody.rows).indexOf(rowToMove);
1149
+ const allRows = Array.from(tbody.rows);
1150
+ let referenceNode = null;
1151
+ let currentVisibleIndex = 0;
1152
+ let actualInsertIndex = -1;
1153
+ for (let i = 0; i < allRows.length; i++) if (!allRows[i].classList.contains("dragging-source")) {
1154
+ if (currentVisibleIndex === toIndex) {
1155
+ actualInsertIndex = i;
1156
+ break;
1157
+ }
1158
+ currentVisibleIndex++;
1159
+ }
1160
+ if (actualInsertIndex === -1 && toIndex === visibleRows.length) actualInsertIndex = allRows.length;
1161
+ if (actualInsertIndex !== -1) {
1162
+ if (actualFromIndex < actualInsertIndex) referenceNode = allRows[actualInsertIndex] ?? null;
1163
+ else referenceNode = allRows[actualInsertIndex];
1164
+ } else return;
1165
+ try {
1166
+ this.renderer.insertBefore(tbody, rowToMove, referenceNode);
1167
+ } catch (error) {}
1168
+ this.hoveredRowIndex = -1;
1169
+ }
1170
+ moveColumn(fromIndex, toIndex) {
1171
+ if (!this.table || fromIndex === toIndex || fromIndex < 0 || toIndex < 0) return;
1172
+ for (let i = 0; i < this.table.rows.length; i++) {
1173
+ const row = this.table.rows[i];
1174
+ const cells = Array.from(row.cells);
1175
+ if (fromIndex >= cells.length || toIndex > cells.length) continue;
1176
+ const cellToMove = cells[fromIndex];
1177
+ let referenceNode = null;
1178
+ if (fromIndex < toIndex) referenceNode = cells[toIndex + 1] ?? null;
1179
+ else referenceNode = cells[toIndex];
1180
+ if (cellToMove) try {
1181
+ this.renderer.insertBefore(row, cellToMove, referenceNode);
1182
+ } catch (error) {}
1183
+ }
1184
+ }
1185
+ styleColumnAsSource(columnIndex, add) {
1186
+ if (!this.table || columnIndex < 0) return;
1187
+ for (let i = 0; i < this.table.rows.length; i++) {
1188
+ const row = this.table.rows[i];
1189
+ if (columnIndex < row.cells.length) {
1190
+ const cell = row.cells[columnIndex];
1191
+ if (cell) {
1192
+ if (add) this.renderer.addClass(cell, "dragging-source");
1193
+ else this.renderer.removeClass(cell, "dragging-source");
1194
+ }
1195
+ }
1196
+ }
1197
+ }
1198
+ calculateColumnInfo() {
1199
+ this.columnInfo = [];
1200
+ if (!this.table || this.table.rows.length === 0) return;
1201
+ const referenceRow = this.table.tHead?.rows[0] ?? this.table.rows[0];
1202
+ if (!referenceRow) return;
1203
+ for (let i = 0; i < referenceRow.cells.length; i++) {
1204
+ const rect = referenceRow.cells[i].getBoundingClientRect();
1205
+ this.columnInfo.push({
1206
+ index: i,
1207
+ left: rect.left,
1208
+ width: rect.width,
1209
+ center: rect.left + rect.width / 2
1210
+ });
1211
+ }
1212
+ }
1213
+ calculateRowInfo() {
1214
+ this.rowInfo = [];
1215
+ if (!this.table || !this.table.tBodies[0]) return;
1216
+ const tbody = this.table.tBodies[0];
1217
+ let visibleIndex = 0;
1218
+ for (let i = 0; i < tbody.rows.length; i++) {
1219
+ const row = tbody.rows[i];
1220
+ const rect = row.getBoundingClientRect();
1221
+ this.rowInfo.push({
1222
+ index: visibleIndex,
1223
+ element: row,
1224
+ top: rect.top,
1225
+ height: rect.height,
1226
+ center: rect.top + rect.height / 2
1227
+ });
1228
+ visibleIndex++;
1229
+ }
1230
+ }
1231
+ findFirstVisibleCellInColumn(columnIndex) {
1232
+ if (!this.table || columnIndex < 0) return null;
1233
+ for (let i = 0; i < this.table.rows.length; i++) {
1234
+ const row = this.table.rows[i];
1235
+ if (columnIndex < row.cells.length) {
1236
+ const c = row.cells[columnIndex];
1237
+ if (c && c.offsetParent !== null) return c;
1238
+ }
1239
+ }
1240
+ return null;
1241
+ }
1242
+ updateDropIndicator(targetVisualIndex, mode) {
1243
+ if (!this.table || targetVisualIndex < 0 || this.startElementIndex < 0) {
1244
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
1245
+ return;
1246
+ }
1247
+ const insertBeforeIndex = targetVisualIndex <= this.startElementIndex ? targetVisualIndex : targetVisualIndex + 1;
1248
+ if (insertBeforeIndex === this.startElementIndex || insertBeforeIndex === this.startElementIndex + 1) {
1249
+ this.renderer.setStyle(this.dropIndicator, "visibility", "hidden");
1250
+ return;
1251
+ }
1252
+ const tableRect = this.table.getBoundingClientRect();
1253
+ if (mode === "column") {
1254
+ const referenceColumnInfo = this.columnInfo.find((c) => c.index === insertBeforeIndex);
1255
+ let indicatorLeftTable = 0;
1256
+ if (referenceColumnInfo) indicatorLeftTable = referenceColumnInfo.left - tableRect.left;
1257
+ else {
1258
+ const lastColInfo = this.columnInfo[this.columnInfo.length - 1];
1259
+ indicatorLeftTable = lastColInfo ? lastColInfo.left - tableRect.left + lastColInfo.width : this.table.offsetWidth;
1260
+ }
1261
+ indicatorLeftTable -= Math.floor(this.indicatorThickness / 2);
1262
+ this.renderer.setStyle(this.dropIndicator, "left", `${indicatorLeftTable}px`);
1263
+ this.renderer.setStyle(this.dropIndicator, "top", `0px`);
1264
+ this.renderer.setStyle(this.dropIndicator, "height", `${this.table.offsetHeight}px`);
1265
+ this.renderer.setStyle(this.dropIndicator, "width", `${this.indicatorThickness}px`);
1266
+ this.renderer.removeStyle(this.dropIndicator, "right");
1267
+ this.renderer.removeStyle(this.dropIndicator, "bottom");
1268
+ } else {
1269
+ const referenceRowInfo = this.rowInfo.find((r) => r.index === insertBeforeIndex);
1270
+ let indicatorTopTable = 0;
1271
+ if (referenceRowInfo) indicatorTopTable = referenceRowInfo.top - tableRect.top;
1272
+ else {
1273
+ const lastRowInfo = this.rowInfo[this.rowInfo.length - 1];
1274
+ indicatorTopTable = lastRowInfo ? lastRowInfo.top - tableRect.top + lastRowInfo.height : this.table.tBodies[0]?.offsetHeight ?? this.table.offsetHeight;
1275
+ }
1276
+ indicatorTopTable -= Math.floor(this.indicatorThickness / 2);
1277
+ this.renderer.setStyle(this.dropIndicator, "top", `${indicatorTopTable}px`);
1278
+ this.renderer.setStyle(this.dropIndicator, "left", `0px`);
1279
+ this.renderer.setStyle(this.dropIndicator, "width", `${this.table.offsetWidth}px`);
1280
+ this.renderer.setStyle(this.dropIndicator, "height", `${this.indicatorThickness}px`);
1281
+ this.renderer.removeStyle(this.dropIndicator, "bottom");
1282
+ this.renderer.removeStyle(this.dropIndicator, "right");
1283
+ }
1284
+ this.renderer.setStyle(this.dropIndicator, "visibility", "visible");
1285
+ }
1286
+ highlightColumn(index, add) {}
1287
+ clearDropHighlights() {}
1288
+ getCurrentScrollContainer() {
1289
+ if (isPlatformServer(this._platformId)) return null;
1290
+ try {
1291
+ return this.contentBuilder?.getScrollContainer?.() || null;
1292
+ } catch {
1293
+ return null;
1294
+ }
1295
+ }
1296
+ bindScrollContainerListener() {
1297
+ if (isPlatformServer(this._platformId)) return;
1298
+ if (this.scrollSub) return;
1299
+ this.unbindScrollContainerListener();
1300
+ this.ngZone.runOutsideAngular(() => {
1301
+ const scroll$ = this.contentBuilder?.scrollContainerScrolled;
1302
+ if (!scroll$) return;
1303
+ this.scrollSub = scroll$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.onScrollContainerScrolled());
1304
+ });
1305
+ }
1306
+ unbindScrollContainerListener() {
1307
+ if (this.scrollSub) {
1308
+ try {
1309
+ this.scrollSub.unsubscribe();
1310
+ } catch {}
1311
+ this.scrollSub = null;
1312
+ }
1313
+ this.scrollContainerRef = null;
1314
+ }
1315
+ ensureScrollContainerListener() {
1316
+ if (isPlatformServer(this._platformId)) return;
1317
+ if (!this.scrollSub) this.bindScrollContainerListener();
1318
+ }
1319
+ onScrollContainerScrolled() {
1320
+ this.cancelHideTimer();
1321
+ this.hideHandlers();
1322
+ }
1323
+ static ɵfac = i0.ɵɵngDeclareFactory({
1324
+ minVersion: "12.0.0",
1325
+ version: "22.3.0",
1326
+ ngImport: i0,
1327
+ type: DraggableTableComponent,
1328
+ deps: [],
1329
+ target: i0.ɵɵFactoryTarget.Component
1330
+ });
1331
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1332
+ minVersion: "17.1.0",
1333
+ version: "22.3.0",
1334
+ type: DraggableTableComponent,
1335
+ isStandalone: true,
1336
+ selector: "ngs-draggable-table",
1337
+ inputs: { disabled: {
1338
+ classPropertyName: "disabled",
1339
+ publicName: "disabled",
1340
+ isSignal: true,
1341
+ isRequired: false,
1342
+ transformFunction: null
1343
+ } },
1344
+ outputs: {
1345
+ columnMoved: "columnMoved",
1346
+ rowMoved: "rowMoved",
1347
+ moveStart: "moveStart",
1348
+ moveEnd: "moveEnd"
1349
+ },
1350
+ host: { properties: {
1351
+ "class.disabled": "disabled() || null",
1352
+ "class.draggable-table-host": "this.hostClass"
1353
+ } },
1354
+ exportAs: ["ngsDraggableTable"],
1355
+ ngImport: i0,
1356
+ template: "<ng-content/>\n",
1357
+ styles: [":host{display:block}:host ::ng-deep .drag-handler{position:fixed;width:18px;height:18px;background-color:#6496ffb3;border:1px solid var(--ngs-color-primary);border-radius:3px;cursor:grab;box-sizing:border-box;transition:background-color .2s ease,visibility .1s linear;z-index:1000;visibility:hidden}:host ::ng-deep .drag-handler:hover{background-color:var(--ngs-color-primary)}:host ::ng-deep .drag-handler.dragging-active-handler{cursor:grabbing!important;background-color:var(--ngs-color-primary)!important;border-color:var(--ngs-color-primary)!important;z-index:1001!important}:host ::ng-deep .drop-indicator{position:absolute;background-color:var(--ngs-color-primary);z-index:5;pointer-events:none;visibility:hidden}:host ::ng-deep tr.dragging-source,:host ::ng-deep td.dragging-source,:host ::ng-deep th.dragging-source{background:var(--ngs-color-surface-container-low)}:host ::ng-deep table.dragging-row td,:host ::ng-deep table.dragging-row th,:host ::ng-deep table.dragging-column td,:host ::ng-deep table.dragging-column th,:host ::ng-deep tr.dragging-source td,:host ::ng-deep tr.dragging-source th,:host ::ng-deep td.dragging-source,:host ::ng-deep th.dragging-source{pointer-events:none}:host.disabled ::ng-deep .drag-handler{visibility:hidden!important}\n"],
1358
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1359
+ });
1360
+ };
1361
+ i0.ɵɵngDeclareClassMetadata({
1362
+ minVersion: "12.0.0",
1363
+ version: "22.3.0",
1364
+ ngImport: i0,
1365
+ type: DraggableTableComponent,
1366
+ decorators: [{
1367
+ type: Component,
1368
+ args: [{
1369
+ selector: "ngs-draggable-table",
1370
+ exportAs: "ngsDraggableTable",
1371
+ imports: [],
1372
+ changeDetection: ChangeDetectionStrategy.OnPush,
1373
+ host: { "[class.disabled]": "disabled() || null" },
1374
+ template: "<ng-content/>\n",
1375
+ styles: [":host{display:block}:host ::ng-deep .drag-handler{position:fixed;width:18px;height:18px;background-color:#6496ffb3;border:1px solid var(--ngs-color-primary);border-radius:3px;cursor:grab;box-sizing:border-box;transition:background-color .2s ease,visibility .1s linear;z-index:1000;visibility:hidden}:host ::ng-deep .drag-handler:hover{background-color:var(--ngs-color-primary)}:host ::ng-deep .drag-handler.dragging-active-handler{cursor:grabbing!important;background-color:var(--ngs-color-primary)!important;border-color:var(--ngs-color-primary)!important;z-index:1001!important}:host ::ng-deep .drop-indicator{position:absolute;background-color:var(--ngs-color-primary);z-index:5;pointer-events:none;visibility:hidden}:host ::ng-deep tr.dragging-source,:host ::ng-deep td.dragging-source,:host ::ng-deep th.dragging-source{background:var(--ngs-color-surface-container-low)}:host ::ng-deep table.dragging-row td,:host ::ng-deep table.dragging-row th,:host ::ng-deep table.dragging-column td,:host ::ng-deep table.dragging-column th,:host ::ng-deep tr.dragging-source td,:host ::ng-deep tr.dragging-source th,:host ::ng-deep td.dragging-source,:host ::ng-deep th.dragging-source{pointer-events:none}:host.disabled ::ng-deep .drag-handler{visibility:hidden!important}\n"]
1376
+ }]
1377
+ }],
1378
+ ctorParameters: () => [],
1379
+ propDecorators: {
1380
+ hostClass: [{
1381
+ type: HostBinding,
1382
+ args: ["class.draggable-table-host"]
1383
+ }],
1384
+ disabled: [{
1385
+ type: i0.Input,
1386
+ args: [{
1387
+ isSignal: true,
1388
+ alias: "disabled",
1389
+ required: false
1390
+ }]
1391
+ }],
1392
+ columnMoved: [{
1393
+ type: i0.Output,
1394
+ args: ["columnMoved"]
1395
+ }],
1396
+ rowMoved: [{
1397
+ type: i0.Output,
1398
+ args: ["rowMoved"]
1399
+ }],
1400
+ moveStart: [{
1401
+ type: i0.Output,
1402
+ args: ["moveStart"]
1403
+ }],
1404
+ moveEnd: [{
1405
+ type: i0.Output,
1406
+ args: ["moveEnd"]
1407
+ }]
1408
+ }
1409
+ });
1410
+ var TableBlockComponent = class TableBlockComponent {
1411
+ _platformId = inject(PLATFORM_ID);
1412
+ _contentBuilder = inject(CONTENT_BUILDER);
1413
+ _store = inject(ContentBuilderStore);
1414
+ _cdr = inject(ChangeDetectorRef);
1415
+ _tableRef = viewChild.required("table", ...ngDevMode ? [{ debugName: "_tableRef" }] : /* istanbul ignore next */ []);
1416
+ id = input.required(...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
1417
+ content = input.required(...ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []);
1418
+ settings = input.required(...ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []);
1419
+ index = input.required(...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
1420
+ props = input([], ...ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []);
1421
+ fullWidth = computed(() => this.settings().fullWidth !== false, ...ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []);
1422
+ _content = signal([], ...ngDevMode ? [{ debugName: "_content" }] : /* istanbul ignore next */ []);
1423
+ _columnManaging = signal(false, ...ngDevMode ? [{ debugName: "_columnManaging" }] : /* istanbul ignore next */ []);
1424
+ _rowManaging = signal(false, ...ngDevMode ? [{ debugName: "_rowManaging" }] : /* istanbul ignore next */ []);
1425
+ _tableManging = signal(false, ...ngDevMode ? [{ debugName: "_tableManging" }] : /* istanbul ignore next */ []);
1426
+ _resizeManging = signal(false, ...ngDevMode ? [{ debugName: "_resizeManging" }] : /* istanbul ignore next */ []);
1427
+ initialized = signal(false, ...ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []);
1428
+ constructor() {
1429
+ effect(() => {
1430
+ const content = this.content();
1431
+ untracked(() => this._content.set(cloneContentEditorValue(content)));
1432
+ });
1433
+ }
1434
+ onCellContentChanged(cell, content) {
1435
+ cell.content = content;
1436
+ this.update();
1437
+ }
1438
+ onCellPropsChanged(cell, props) {
1439
+ cell.props = props;
1440
+ this.update();
1441
+ }
1442
+ ngOnInit() {
1443
+ this._content.set(cloneContentEditorValue(this.content()));
1444
+ }
1445
+ ngAfterViewInit() {
1446
+ if (isPlatformBrowser(this._platformId)) {
1447
+ const selection = new SelectionArea({
1448
+ selectables: [".table td"],
1449
+ boundaries: [".table"],
1450
+ features: {
1451
+ touch: true,
1452
+ range: true,
1453
+ deselectOnBlur: true,
1454
+ singleTap: {
1455
+ allow: false,
1456
+ intersect: "native"
1457
+ }
1458
+ }
1459
+ }).on("start", ({ store, event }) => {
1460
+ if (!event.ctrlKey && !event.metaKey) {
1461
+ store.stored.forEach((el) => el.classList.remove("selected"));
1462
+ selection.clearSelection();
1463
+ }
1464
+ }).on("move", ({ store: { changed: { added, removed } } }) => {
1465
+ if (this._tableManging() || this._columnManaging() || this._rowManaging()) return;
1466
+ added.forEach((el) => el.classList.add("selected"));
1467
+ removed.forEach((el) => el.classList.remove("selected"));
1468
+ });
1469
+ }
1470
+ this.initialized.set(true);
1471
+ }
1472
+ focus() {}
1473
+ onTableFocusChange(type) {
1474
+ if (type === null) this.clearCellsSelection();
1475
+ }
1476
+ clearCellsSelection() {
1477
+ this._tableRef().nativeElement.querySelectorAll("td").forEach((el) => el.classList.remove("selected"));
1478
+ this.update();
1479
+ }
1480
+ onColAdded() {
1481
+ this._content.update((content) => {
1482
+ content.forEach((row) => {
1483
+ row.push({
1484
+ content: [],
1485
+ props: [],
1486
+ styles: {},
1487
+ options: {
1488
+ colspan: 1,
1489
+ rowspan: 1
1490
+ }
1491
+ });
1492
+ });
1493
+ return content;
1494
+ });
1495
+ this._cdr.markForCheck();
1496
+ this.update();
1497
+ }
1498
+ onColDeleted() {
1499
+ if (this._content().length > 0 && this._content()[0].length === 1) return;
1500
+ let isLastColEmpty = false;
1501
+ this._content().forEach((row) => {
1502
+ if (contentEditorText(row[row.length - 1].content)) isLastColEmpty = true;
1503
+ });
1504
+ if (isLastColEmpty) return;
1505
+ this._content.update((content) => {
1506
+ content.forEach((row) => {
1507
+ row.splice(row.length - 1, 1);
1508
+ });
1509
+ return content;
1510
+ });
1511
+ this._cdr.markForCheck();
1512
+ this.update();
1513
+ }
1514
+ onRowAdded() {
1515
+ this._content.update((content) => {
1516
+ const row = [];
1517
+ for (let i = 0; i < content[0].length; i++) row.push({
1518
+ content: [],
1519
+ props: [],
1520
+ styles: {},
1521
+ options: {
1522
+ colspan: 1,
1523
+ rowspan: 1
1524
+ }
1525
+ });
1526
+ content.push(row);
1527
+ return content;
1528
+ });
1529
+ this._cdr.markForCheck();
1530
+ this.update();
1531
+ }
1532
+ onRowDeleted() {
1533
+ if (this._content().length === 1) return;
1534
+ let isLastRowEmpty = false;
1535
+ this._content()[this._content().length - 1].forEach((cell) => {
1536
+ if (contentEditorText(cell.content)) isLastRowEmpty = true;
1537
+ });
1538
+ if (isLastRowEmpty) return;
1539
+ this._content.update((content) => {
1540
+ content.splice(content.length - 1, 1);
1541
+ return content;
1542
+ });
1543
+ this._cdr.markForCheck();
1544
+ this.update();
1545
+ }
1546
+ onColumnManagingStart() {
1547
+ this._columnManaging.set(true);
1548
+ }
1549
+ onColumnManagingEnd() {
1550
+ this._columnManaging.set(false);
1551
+ }
1552
+ onRowManagingStart() {
1553
+ this._rowManaging.set(true);
1554
+ }
1555
+ onRowManagingEnd() {
1556
+ this._rowManaging.set(false);
1557
+ }
1558
+ onColumnWidthChange({ columnIndex, width }) {
1559
+ this._content.update((content) => {
1560
+ content.forEach((row) => {
1561
+ const cell = row[columnIndex];
1562
+ if (cell) cell.options.width = width;
1563
+ });
1564
+ return content;
1565
+ });
1566
+ this.update();
1567
+ }
1568
+ onColumnMoved(event) {
1569
+ this._content.update((content) => {
1570
+ content.forEach((row) => {
1571
+ moveItemInArray(row, event.startElementIndex, event.finalTargetIndex);
1572
+ });
1573
+ return content;
1574
+ });
1575
+ this._cdr.markForCheck();
1576
+ this.update();
1577
+ }
1578
+ onRowMoved(event) {
1579
+ this._content.update((content) => {
1580
+ moveItemInArray(content, event.startElementIndex, event.finalTargetIndex);
1581
+ return content;
1582
+ });
1583
+ this._cdr.markForCheck();
1584
+ this.update();
1585
+ }
1586
+ onMoveStart() {
1587
+ this._tableManging.set(true);
1588
+ }
1589
+ onMoveEnd() {
1590
+ this._tableManging.set(false);
1591
+ }
1592
+ onColumnWidthChangeStart() {
1593
+ this._tableManging.set(true);
1594
+ this._resizeManging.set(true);
1595
+ }
1596
+ onColumnWidthChangeEnd() {
1597
+ this._tableManging.set(false);
1598
+ this._resizeManging.set(false);
1599
+ this._cdr.markForCheck();
1600
+ }
1601
+ getData() {
1602
+ return {
1603
+ content: this._content(),
1604
+ settings: { ...this.settings() }
1605
+ };
1606
+ }
1607
+ isEmpty() {
1608
+ return false;
1609
+ }
1610
+ update() {
1611
+ this._store.updateBlock(this.id(), {
1612
+ content: this._content(),
1613
+ isEmpty: this.isEmpty()
1614
+ });
1615
+ this._contentBuilder.emitContentChangeEvent();
1616
+ }
1617
+ static ɵfac = i0.ɵɵngDeclareFactory({
1618
+ minVersion: "12.0.0",
1619
+ version: "22.3.0",
1620
+ ngImport: i0,
1621
+ type: TableBlockComponent,
1622
+ deps: [],
1623
+ target: i0.ɵɵFactoryTarget.Component
1624
+ });
1625
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1626
+ minVersion: "17.0.0",
1627
+ version: "22.3.0",
1628
+ type: TableBlockComponent,
1629
+ isStandalone: true,
1630
+ selector: "ngs-table-block",
1631
+ inputs: {
1632
+ id: {
1633
+ classPropertyName: "id",
1634
+ publicName: "id",
1635
+ isSignal: true,
1636
+ isRequired: true,
1637
+ transformFunction: null
1638
+ },
1639
+ content: {
1640
+ classPropertyName: "content",
1641
+ publicName: "content",
1642
+ isSignal: true,
1643
+ isRequired: true,
1644
+ transformFunction: null
1645
+ },
1646
+ settings: {
1647
+ classPropertyName: "settings",
1648
+ publicName: "settings",
1649
+ isSignal: true,
1650
+ isRequired: true,
1651
+ transformFunction: null
1652
+ },
1653
+ index: {
1654
+ classPropertyName: "index",
1655
+ publicName: "index",
1656
+ isSignal: true,
1657
+ isRequired: true,
1658
+ transformFunction: null
1659
+ },
1660
+ props: {
1661
+ classPropertyName: "props",
1662
+ publicName: "props",
1663
+ isSignal: true,
1664
+ isRequired: false,
1665
+ transformFunction: null
1666
+ }
1667
+ },
1668
+ host: { properties: {
1669
+ "class.is-full-width": "fullWidth()",
1670
+ "class.is-column-managing": "_columnManaging()",
1671
+ "class.is-row-managing": "_rowManaging()"
1672
+ } },
1673
+ providers: [{
1674
+ provide: CONTENT_EDITOR_BLOCK,
1675
+ useExisting: TableBlockComponent,
1676
+ multi: true
1677
+ }],
1678
+ viewQueries: [{
1679
+ propertyName: "_tableRef",
1680
+ first: true,
1681
+ predicate: ["table"],
1682
+ descendants: true,
1683
+ isSignal: true
1684
+ }],
1685
+ ngImport: i0,
1686
+ template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n [resizeEnabled]=\"!fullWidth()\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"onCellContentChanged(cell, $event)\"\n (propsChanged)=\"onCellPropsChanged(cell, $event)\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n",
1687
+ styles: [":host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;max-width:100%;width:var(--ngs-content-editor-builder-content-width, 704px)}:host .table-container{position:relative;width:max-content}:host table{width:auto;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-content-editor-selected-bg, var(--ngs-color-primary-container))}:host.is-full-width .table-overflow{width:auto;padding-inline-end:calc(var(--spacing, .25rem) * 5)}:host.is-full-width .table-container,:host.is-full-width table{width:100%}:host.is-full-width table col{width:auto!important}:host.is-full-width table td{min-width:0}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1688
+ dependencies: [
1689
+ {
1690
+ kind: "directive",
1691
+ type: ContentEditorContentEditableDirective,
1692
+ selector: "[ngsContentEditorContentEditable]",
1693
+ inputs: [
1694
+ "ngsContentEditorContentEditable",
1695
+ "settings",
1696
+ "props",
1697
+ "singleLine"
1698
+ ],
1699
+ outputs: [
1700
+ "contentChanged",
1701
+ "propsChanged",
1702
+ "pressedEnter",
1703
+ "initialized"
1704
+ ],
1705
+ exportAs: ["ngsContentEditorContentEditable"]
1706
+ },
1707
+ {
1708
+ kind: "component",
1709
+ type: Icon,
1710
+ selector: "ngs-icon",
1711
+ inputs: ["name"],
1712
+ exportAs: ["ngsIcon"]
1713
+ },
1714
+ {
1715
+ kind: "directive",
1716
+ type: TableColumnsManagerDirective,
1717
+ selector: "[ngsTableColumnsManager]",
1718
+ outputs: [
1719
+ "columnAdded",
1720
+ "columnDeleted",
1721
+ "columnManagingStart",
1722
+ "columnManagingEnd"
1723
+ ]
1724
+ },
1725
+ {
1726
+ kind: "directive",
1727
+ type: TableRowsManagerDirective,
1728
+ selector: "[ngsTableRowsManager]",
1729
+ outputs: [
1730
+ "rowManagingStart",
1731
+ "rowManagingEnd",
1732
+ "rowAdded",
1733
+ "rowDeleted"
1734
+ ]
1735
+ },
1736
+ {
1737
+ kind: "directive",
1738
+ type: CdkMonitorFocus,
1739
+ selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]",
1740
+ outputs: ["cdkFocusChange"],
1741
+ exportAs: ["cdkMonitorFocus"]
1742
+ },
1743
+ {
1744
+ kind: "directive",
1745
+ type: ResizableTableDirective,
1746
+ selector: "table[ngsResizableTable]",
1747
+ inputs: [
1748
+ "minColumnWidth",
1749
+ "resizeHandleWidth",
1750
+ "mutationObserverDebounceTime",
1751
+ "resizeEnabled"
1752
+ ],
1753
+ outputs: [
1754
+ "columnWidthChange",
1755
+ "columnWidthChangeStart",
1756
+ "columnWidthChangeEnd"
1757
+ ]
1758
+ },
1759
+ {
1760
+ kind: "component",
1761
+ type: DraggableTableComponent,
1762
+ selector: "ngs-draggable-table",
1763
+ inputs: ["disabled"],
1764
+ outputs: [
1765
+ "columnMoved",
1766
+ "rowMoved",
1767
+ "moveStart",
1768
+ "moveEnd"
1769
+ ],
1770
+ exportAs: ["ngsDraggableTable"]
1771
+ }
1772
+ ],
1773
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1774
+ });
1775
+ };
1776
+ i0.ɵɵngDeclareClassMetadata({
1777
+ minVersion: "12.0.0",
1778
+ version: "22.3.0",
1779
+ ngImport: i0,
1780
+ type: TableBlockComponent,
1781
+ decorators: [{
1782
+ type: Component,
1783
+ args: [{
1784
+ selector: "ngs-table-block",
1785
+ imports: [
1786
+ ContentEditorContentEditableDirective,
1787
+ Icon,
1788
+ TableColumnsManagerDirective,
1789
+ TableRowsManagerDirective,
1790
+ CdkMonitorFocus,
1791
+ ResizableTableDirective,
1792
+ DraggableTableComponent
1793
+ ],
1794
+ providers: [{
1795
+ provide: CONTENT_EDITOR_BLOCK,
1796
+ useExisting: TableBlockComponent,
1797
+ multi: true
1798
+ }],
1799
+ changeDetection: ChangeDetectionStrategy.OnPush,
1800
+ host: {
1801
+ "[class.is-full-width]": "fullWidth()",
1802
+ "[class.is-column-managing]": "_columnManaging()",
1803
+ "[class.is-row-managing]": "_rowManaging()"
1804
+ },
1805
+ template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n [resizeEnabled]=\"!fullWidth()\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"onCellContentChanged(cell, $event)\"\n (propsChanged)=\"onCellPropsChanged(cell, $event)\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n",
1806
+ styles: [":host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;max-width:100%;width:var(--ngs-content-editor-builder-content-width, 704px)}:host .table-container{position:relative;width:max-content}:host table{width:auto;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-content-editor-selected-bg, var(--ngs-color-primary-container))}:host.is-full-width .table-overflow{width:auto;padding-inline-end:calc(var(--spacing, .25rem) * 5)}:host.is-full-width .table-container,:host.is-full-width table{width:100%}:host.is-full-width table col{width:auto!important}:host.is-full-width table td{min-width:0}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1807
+ }]
1808
+ }],
1809
+ ctorParameters: () => [],
1810
+ propDecorators: {
1811
+ _tableRef: [{
1812
+ type: i0.ViewChild,
1813
+ args: ["table", { isSignal: true }]
1814
+ }],
1815
+ id: [{
1816
+ type: i0.Input,
1817
+ args: [{
1818
+ isSignal: true,
1819
+ alias: "id",
1820
+ required: true
1821
+ }]
1822
+ }],
1823
+ content: [{
1824
+ type: i0.Input,
1825
+ args: [{
1826
+ isSignal: true,
1827
+ alias: "content",
1828
+ required: true
1829
+ }]
1830
+ }],
1831
+ settings: [{
1832
+ type: i0.Input,
1833
+ args: [{
1834
+ isSignal: true,
1835
+ alias: "settings",
1836
+ required: true
1837
+ }]
1838
+ }],
1839
+ index: [{
1840
+ type: i0.Input,
1841
+ args: [{
1842
+ isSignal: true,
1843
+ alias: "index",
1844
+ required: true
1845
+ }]
1846
+ }],
1847
+ props: [{
1848
+ type: i0.Input,
1849
+ args: [{
1850
+ isSignal: true,
1851
+ alias: "props",
1852
+ required: false
1853
+ }]
1854
+ }]
1855
+ }
1856
+ });
1857
+ export { TableBlockComponent };
1858
+
1859
+ //# sourceMappingURL=table-block.component-BuzRRggv.mjs.map