@ngstarter-ui/components 1.0.21

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