@ngstarter-ui/components 22.3.5 → 22.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/README.md +27 -0
  2. package/ai/component-registry.json +186 -101
  3. package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
  4. package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
  5. package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
  6. package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
  7. package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
  8. package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
  9. package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
  10. package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
  11. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
  12. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
  13. package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
  14. package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
  15. package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
  16. package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
  17. package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
  18. package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
  19. package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
  20. package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
  21. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
  22. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
  23. package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
  24. package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
  25. package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
  26. package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
  27. package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
  28. package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
  29. package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
  30. package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
  31. package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
  32. package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
  33. package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
  34. package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
  35. package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
  36. package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
  37. package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
  38. package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
  39. package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
  40. package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
  41. package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
  42. package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
  43. package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
  44. package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
  45. package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
  46. package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
  47. package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
  48. package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
  49. package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
  50. package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
  51. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
  52. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
  53. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
  54. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
  55. package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
  56. package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
  57. package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
  58. package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
  59. package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
  60. package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
  61. package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
  62. package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
  63. package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
  64. package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
  65. package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
  66. package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
  67. package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
  68. package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
  70. package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
  71. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
  72. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
  73. package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
  74. package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
  75. package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
  76. package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
  77. package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
  78. package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
  79. package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
  80. package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
  81. package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
  82. package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
  83. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
  84. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
  85. package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
  86. package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
  87. package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
  88. package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
  89. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
  90. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
  91. package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
  92. package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
  93. package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
  94. package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
  95. package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
  96. package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
  97. package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
  98. package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
  99. package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
  100. package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
  101. package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
  102. package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
  103. package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
  104. package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
  105. package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
  106. package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
  107. package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
  108. package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
  109. package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
  110. package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
  111. package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
  112. package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
  113. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
  114. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
  115. package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
  116. package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
  117. package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
  118. package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
  119. package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
  120. package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
  121. package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
  122. package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
  123. package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
  124. package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
  125. package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
  126. package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
  127. package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
  128. package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
  129. package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
  130. package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
  131. package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
  132. package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
  133. package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
  134. package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
  135. package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
  136. package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
  137. package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
  138. package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
  139. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
  140. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
  141. package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
  142. package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
  143. package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
  144. package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
  145. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
  146. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
  147. package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
  148. package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
  149. package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
  150. package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
  151. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
  152. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
  153. package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
  154. package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
  155. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
  156. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
  157. package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
  158. package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
  159. package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
  160. package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
  161. package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
  162. package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
  163. package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
  164. package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
  165. package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
  166. package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
  167. package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
  168. package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
  169. package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
  170. package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
  171. package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
  172. package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
  173. package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
  174. package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
  175. package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
  176. package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
  177. package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
  178. package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
  179. package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
  180. package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
  181. package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
  182. package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
  183. package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
  184. package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
  185. package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
  186. package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
  187. package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
  188. package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
  189. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
  190. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
  191. package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
  192. package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
  193. package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
  194. package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
  195. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
  196. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
  197. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
  198. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
  199. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
  200. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
  201. package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
  202. package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
  203. package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
  204. package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
  205. package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
  206. package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
  207. package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
  208. package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
  209. package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
  210. package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
  211. package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
  212. package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
  213. package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
  214. package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
  215. package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
  216. package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
  217. package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
  218. package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
  219. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
  220. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
  221. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
  222. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
  223. package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
  224. package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
  225. package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
  226. package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
  227. package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
  228. package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
  229. package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
  230. package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
  231. package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
  232. package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
  233. package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
  234. package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
  235. package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
  236. package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
  237. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
  238. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
  239. package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
  240. package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
  241. package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
  242. package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
  243. package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
  244. package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
  245. package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
  246. package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
  247. package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
  248. package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
  249. package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
  250. package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
  251. package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
  252. package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
  253. package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
  254. package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
  255. package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
  256. package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
  257. package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
  258. package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
  259. package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
  260. package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
  261. package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
  262. package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
  263. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
  264. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
  265. package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
  266. package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
  267. package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
  268. package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
  269. package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
  270. package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
  271. package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
  272. package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
  273. package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
  274. package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
  275. package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
  276. package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
  277. package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
  278. package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
  279. package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
  280. package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
  281. package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
  282. package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
  283. package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
  284. package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
  285. package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
  286. package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
  287. package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
  288. package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
  289. package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
  290. package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
  291. package/fesm2022/ngstarter-ui-components.mjs +3 -5
  292. package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
  293. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
  294. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
  295. package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
  296. package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
  297. package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
  298. package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
  299. package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
  300. package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
  301. package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
  302. package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
  303. package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
  304. package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
  305. package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
  306. package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
  307. package/package.json +11 -10
  308. package/styles/_tokens.scss +1 -0
  309. package/types/ngstarter-ui-components-action-required.d.ts +34 -14
  310. package/types/ngstarter-ui-components-alert.d.ts +53 -44
  311. package/types/ngstarter-ui-components-announcement.d.ts +74 -53
  312. package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
  313. package/types/ngstarter-ui-components-avatar.d.ts +113 -66
  314. package/types/ngstarter-ui-components-badge.d.ts +73 -37
  315. package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
  316. package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
  317. package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
  318. package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
  319. package/types/ngstarter-ui-components-button.d.ts +69 -27
  320. package/types/ngstarter-ui-components-calendar.d.ts +123 -71
  321. package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
  322. package/types/ngstarter-ui-components-card.d.ts +75 -71
  323. package/types/ngstarter-ui-components-carousel.d.ts +115 -69
  324. package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
  325. package/types/ngstarter-ui-components-chips.d.ts +288 -195
  326. package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
  327. package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
  328. package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
  329. package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
  330. package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
  331. package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
  332. package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
  333. package/types/ngstarter-ui-components-confirm.d.ts +24 -29
  334. package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
  335. package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
  336. package/types/ngstarter-ui-components-core.d.ts +513 -467
  337. package/types/ngstarter-ui-components-country-select.d.ts +170 -97
  338. package/types/ngstarter-ui-components-crop.d.ts +67 -52
  339. package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
  340. package/types/ngstarter-ui-components-data-view.d.ts +811 -567
  341. package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
  342. package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
  343. package/types/ngstarter-ui-components-dialog.d.ts +138 -116
  344. package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
  345. package/types/ngstarter-ui-components-divider.d.ts +29 -17
  346. package/types/ngstarter-ui-components-drawer.d.ts +39 -30
  347. package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
  348. package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
  349. package/types/ngstarter-ui-components-events.d.ts +73 -57
  350. package/types/ngstarter-ui-components-expand.d.ts +55 -25
  351. package/types/ngstarter-ui-components-expansion.d.ts +93 -64
  352. package/types/ngstarter-ui-components-file-type.d.ts +53 -27
  353. package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
  354. package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
  355. package/types/ngstarter-ui-components-form-field.d.ts +116 -105
  356. package/types/ngstarter-ui-components-gauge.d.ts +32 -20
  357. package/types/ngstarter-ui-components-grid.d.ts +66 -50
  358. package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
  359. package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
  360. package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
  361. package/types/ngstarter-ui-components-icon.d.ts +39 -38
  362. package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
  363. package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
  364. package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
  365. package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
  366. package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
  367. package/types/ngstarter-ui-components-incidents.d.ts +97 -104
  368. package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
  369. package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
  370. package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
  371. package/types/ngstarter-ui-components-input.d.ts +82 -54
  372. package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
  373. package/types/ngstarter-ui-components-kbd.d.ts +8 -12
  374. package/types/ngstarter-ui-components-layout.d.ts +131 -87
  375. package/types/ngstarter-ui-components-list.d.ts +123 -88
  376. package/types/ngstarter-ui-components-logo.d.ts +21 -21
  377. package/types/ngstarter-ui-components-marquee.d.ts +41 -34
  378. package/types/ngstarter-ui-components-menu.d.ts +329 -221
  379. package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
  380. package/types/ngstarter-ui-components-navigation.d.ts +186 -125
  381. package/types/ngstarter-ui-components-notifications.d.ts +104 -89
  382. package/types/ngstarter-ui-components-number-input.d.ts +138 -96
  383. package/types/ngstarter-ui-components-option.d.ts +102 -68
  384. package/types/ngstarter-ui-components-overlay.d.ts +7 -12
  385. package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
  386. package/types/ngstarter-ui-components-paginator.d.ts +171 -129
  387. package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
  388. package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
  389. package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
  390. package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
  391. package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
  392. package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
  393. package/types/ngstarter-ui-components-popover.d.ts +128 -89
  394. package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
  395. package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
  396. package/types/ngstarter-ui-components-radio.d.ts +100 -47
  397. package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
  398. package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
  399. package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
  400. package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
  401. package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
  402. package/types/ngstarter-ui-components-segmented.d.ts +93 -61
  403. package/types/ngstarter-ui-components-select.d.ts +366 -266
  404. package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
  405. package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
  406. package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
  407. package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
  408. package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
  409. package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
  410. package/types/ngstarter-ui-components-slider.d.ts +123 -82
  411. package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
  412. package/types/ngstarter-ui-components-sort.d.ts +99 -63
  413. package/types/ngstarter-ui-components-spinner.d.ts +49 -27
  414. package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
  415. package/types/ngstarter-ui-components-split.d.ts +276 -195
  416. package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
  417. package/types/ngstarter-ui-components-stepper.d.ts +57 -43
  418. package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
  419. package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
  420. package/types/ngstarter-ui-components-table.d.ts +256 -228
  421. package/types/ngstarter-ui-components-tabs.d.ts +231 -138
  422. package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
  423. package/types/ngstarter-ui-components-tiles.d.ts +166 -104
  424. package/types/ngstarter-ui-components-timeline.d.ts +45 -57
  425. package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
  426. package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
  427. package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
  428. package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
  429. package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
  430. package/types/ngstarter-ui-components-tree.d.ts +355 -229
  431. package/types/ngstarter-ui-components-upload.d.ts +216 -131
  432. package/types/ngstarter-ui-components-video-player.d.ts +130 -67
  433. package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
  434. package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
  435. package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
  436. package/types/ngstarter-ui-components.d.ts +2 -2
  437. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-8OmuepvH.mjs +0 -35
  438. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-8OmuepvH.mjs.map +0 -1
  439. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Dp5tISk3.mjs +0 -26
  440. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Dp5tISk3.mjs.map +0 -1
  441. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbBs-R_y.mjs +0 -220
  442. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbBs-R_y.mjs.map +0 -1
  443. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
  444. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
  445. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
  446. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
  447. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGCCeU-Y.mjs +0 -375
  448. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGCCeU-Y.mjs.map +0 -1
  449. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-BJfRgtaA.mjs +0 -80
  450. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-BJfRgtaA.mjs.map +0 -1
  451. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-C_L7hF2G.mjs +0 -65
  452. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-C_L7hF2G.mjs.map +0 -1
  453. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-durrPUhm.mjs +0 -137
  454. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-durrPUhm.mjs.map +0 -1
  455. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-BoL1jZpT.mjs +0 -113
  456. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-BoL1jZpT.mjs.map +0 -1
  457. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-ChZpgXO5.mjs +0 -235
  458. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-ChZpgXO5.mjs.map +0 -1
  459. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DwyNFnII.mjs +0 -117
  460. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DwyNFnII.mjs.map +0 -1
  461. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BWpJv6CO.mjs +0 -4464
  462. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BWpJv6CO.mjs.map +0 -1
  463. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-BvNvkqTO.mjs +0 -132
  464. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-BvNvkqTO.mjs.map +0 -1
  465. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-tgNKltfK.mjs +0 -171
  466. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-tgNKltfK.mjs.map +0 -1
  467. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-BcAlqmh8.mjs +0 -1653
  468. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-BcAlqmh8.mjs.map +0 -1
  469. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-S474I51r.mjs +0 -20
  470. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-S474I51r.mjs.map +0 -1
  471. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
  472. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
  473. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-Dj82fxTI.mjs +0 -134
  474. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-Dj82fxTI.mjs.map +0 -1
  475. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
  476. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
@@ -1,954 +1,1092 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, inject, NgZone, ElementRef, ChangeDetectorRef, Renderer2, signal, input, booleanAttribute, output, viewChildren, effect, ChangeDetectionStrategy, Component, Directive } from '@angular/core';
3
- import { Subject } from 'rxjs';
4
- import { debounceTime } from 'rxjs/operators';
5
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Directive, ElementRef, InjectionToken, NgZone, Renderer2, booleanAttribute, effect, inject, input, makeEnvironmentProviders, output, signal, viewChildren } from "@angular/core";
3
+ import { Subject } from "rxjs";
4
+ import { debounceTime as debounceTime$1 } from "rxjs/operators";
6
5
  function getPointFromEvent(event) {
7
- // TouchEvent
8
- if (event.changedTouches !== undefined &&
9
- event.changedTouches.length > 0) {
10
- return {
11
- x: event.changedTouches[0].clientX,
12
- y: event.changedTouches[0].clientY,
13
- };
14
- }
15
- // MouseEvent
16
- else if (event.clientX !== undefined &&
17
- event.clientY !== undefined) {
18
- return {
19
- x: event.clientX,
20
- y: event.clientY,
21
- };
22
- }
23
- return null;
6
+ if (event.changedTouches !== void 0 && event.changedTouches.length > 0) return {
7
+ x: event.changedTouches[0].clientX,
8
+ y: event.changedTouches[0].clientY
9
+ };
10
+ else if (event.clientX !== void 0 && event.clientY !== void 0) return {
11
+ x: event.clientX,
12
+ y: event.clientY
13
+ };
14
+ return null;
24
15
  }
25
16
  function getElementPixelSize(elRef, direction) {
26
- const rect = elRef.nativeElement.getBoundingClientRect();
27
- return direction === 'horizontal' ? rect.width : rect.height;
17
+ const rect = elRef.nativeElement.getBoundingClientRect();
18
+ return direction === "horizontal" ? rect.width : rect.height;
28
19
  }
29
20
  function getInputPositiveNumber(v, defaultValue) {
30
- if (v === null || v === undefined) {
31
- return defaultValue;
32
- }
33
- v = Number(v);
34
- return !isNaN(v) && v >= 0 ? v : defaultValue;
21
+ if (v === null || v === void 0) return defaultValue;
22
+ v = Number(v);
23
+ return !isNaN(v) && v >= 0 ? v : defaultValue;
35
24
  }
36
25
  function isUserSizesValid(unit, sizes) {
37
- // All sizes have to be not null and total should be 100
38
- if (unit === 'percent') {
39
- const total = sizes.reduce((_total, s) => (s !== null ? _total + s : _total), 0);
40
- return sizes.every(s => s !== null) && total && total > 99.9 && total < 100.1;
41
- }
42
- // A size at null is mandatory but only one.
43
- if (unit === 'pixel') {
44
- return sizes.filter(s => s === null).length === 1;
45
- }
26
+ if (unit === "percent") {
27
+ const total = sizes.reduce((_total, s) => s !== null ? _total + s : _total, 0);
28
+ return sizes.every((s) => s !== null) && total && total > 99.9 && total < 100.1;
29
+ }
30
+ if (unit === "pixel") return sizes.filter((s) => s === null).length === 1;
46
31
  }
47
32
  function getAreaMinSize(a) {
48
- if (a.size === null) {
49
- return 0;
50
- }
51
- if (a.component.isLocked() === true) {
52
- return a.size;
53
- }
54
- if (a.component.getMinSize() === null) {
55
- return 0;
56
- }
57
- if (a.component.getMinSize() > a.size) {
58
- return a.size;
59
- }
60
- return a.component.getMinSize();
33
+ if (a.size === null) return 0;
34
+ if (a.component.isLocked() === true) return a.size;
35
+ if (a.component.getMinSize() === null) return 0;
36
+ if (a.component.getMinSize() > a.size) return a.size;
37
+ return a.component.getMinSize();
61
38
  }
62
39
  function getAreaMaxSize(a) {
63
- if (a.size === null) {
64
- return null;
65
- }
66
- if (a.component.isLocked() === true) {
67
- return a.size;
68
- }
69
- if (a.component.getMaxSize() === null) {
70
- return null;
71
- }
72
- if (a.component.getMaxSize() < a.size) {
73
- return a.size;
74
- }
75
- return a.component.getMaxSize();
40
+ if (a.size === null) return null;
41
+ if (a.component.isLocked() === true) return a.size;
42
+ if (a.component.getMaxSize() === null) return null;
43
+ if (a.component.getMaxSize() < a.size) return a.size;
44
+ return a.component.getMaxSize();
76
45
  }
77
46
  function getGutterSideAbsorptionCapacity(unit, sideAreas, pixels, allAreasSizePixel) {
78
- return sideAreas.reduce((acc, area) => {
79
- const res = getAreaAbsorptionCapacity(unit, area, acc.remain, allAreasSizePixel);
80
- acc.list.push(res);
81
- acc.remain = res && res.pixelRemain;
82
- return acc;
83
- }, { remain: pixels, list: [] });
47
+ return sideAreas.reduce((acc, area) => {
48
+ const res = getAreaAbsorptionCapacity(unit, area, acc.remain, allAreasSizePixel);
49
+ acc.list.push(res);
50
+ acc.remain = res && res.pixelRemain;
51
+ return acc;
52
+ }, {
53
+ remain: pixels,
54
+ list: []
55
+ });
84
56
  }
85
57
  function getAreaAbsorptionCapacity(unit, areaSnapshot, pixels, allAreasSizePixel) {
86
- // No pain no gain
87
- if (pixels === 0) {
88
- return {
89
- areaSnapshot,
90
- pixelAbsorb: 0,
91
- percentAfterAbsorption: areaSnapshot.sizePercentAtStart,
92
- pixelRemain: 0,
93
- };
94
- }
95
- // Area start at zero and need to be reduced, not possible
96
- if (areaSnapshot.sizePixelAtStart === 0 && pixels < 0) {
97
- return {
98
- areaSnapshot,
99
- pixelAbsorb: 0,
100
- percentAfterAbsorption: 0,
101
- pixelRemain: pixels,
102
- };
103
- }
104
- if (unit === 'percent') {
105
- return getAreaAbsorptionCapacityPercent(areaSnapshot, pixels, allAreasSizePixel);
106
- }
107
- if (unit === 'pixel') {
108
- return getAreaAbsorptionCapacityPixel(areaSnapshot, pixels, allAreasSizePixel);
109
- }
58
+ if (pixels === 0) return {
59
+ areaSnapshot,
60
+ pixelAbsorb: 0,
61
+ percentAfterAbsorption: areaSnapshot.sizePercentAtStart,
62
+ pixelRemain: 0
63
+ };
64
+ if (areaSnapshot.sizePixelAtStart === 0 && pixels < 0) return {
65
+ areaSnapshot,
66
+ pixelAbsorb: 0,
67
+ percentAfterAbsorption: 0,
68
+ pixelRemain: pixels
69
+ };
70
+ if (unit === "percent") return getAreaAbsorptionCapacityPercent(areaSnapshot, pixels, allAreasSizePixel);
71
+ if (unit === "pixel") return getAreaAbsorptionCapacityPixel(areaSnapshot, pixels, allAreasSizePixel);
110
72
  }
111
73
  function getAreaAbsorptionCapacityPercent(areaSnapshot, pixels, allAreasSizePixel) {
112
- const tempPixelSize = areaSnapshot.sizePixelAtStart + pixels;
113
- const tempPercentSize = (tempPixelSize / allAreasSizePixel) * 100;
114
- // ENLARGE AREA
115
- if (pixels > 0) {
116
- // If maxSize & newSize bigger than it > absorb to max and return remaining pixels
117
- if (areaSnapshot.area.maxSize !== null && tempPercentSize > areaSnapshot.area.maxSize) {
118
- // Use area.area.maxSize as newPercentSize and return calculate pixels remaining
119
- const maxSizePixel = (areaSnapshot.area.maxSize / 100) * allAreasSizePixel;
120
- return {
121
- areaSnapshot,
122
- pixelAbsorb: maxSizePixel,
123
- percentAfterAbsorption: areaSnapshot.area.maxSize,
124
- pixelRemain: areaSnapshot.sizePixelAtStart + pixels - maxSizePixel,
125
- };
126
- }
127
- return {
128
- areaSnapshot,
129
- pixelAbsorb: pixels,
130
- percentAfterAbsorption: tempPercentSize > 100 ? 100 : tempPercentSize,
131
- pixelRemain: 0,
132
- };
133
- }
134
- // REDUCE AREA
135
- else if (pixels < 0) {
136
- // If minSize & newSize smaller than it > absorb to min and return remaining pixels
137
- if (areaSnapshot.area.minSize !== null && tempPercentSize < areaSnapshot.area.minSize) {
138
- // Use area.area.minSize as newPercentSize and return calculate pixels remaining
139
- const minSizePixel = (areaSnapshot.area.minSize / 100) * allAreasSizePixel;
140
- return {
141
- areaSnapshot,
142
- pixelAbsorb: minSizePixel,
143
- percentAfterAbsorption: areaSnapshot.area.minSize,
144
- pixelRemain: areaSnapshot.sizePixelAtStart + pixels - minSizePixel,
145
- };
146
- }
147
- // If reduced under zero > return remaining pixels
148
- else if (tempPercentSize < 0) {
149
- // Use 0 as newPercentSize and return calculate pixels remaining
150
- return {
151
- areaSnapshot,
152
- pixelAbsorb: -areaSnapshot.sizePixelAtStart,
153
- percentAfterAbsorption: 0,
154
- pixelRemain: pixels + areaSnapshot.sizePixelAtStart,
155
- };
156
- }
157
- return {
158
- areaSnapshot,
159
- pixelAbsorb: pixels,
160
- percentAfterAbsorption: tempPercentSize,
161
- pixelRemain: 0,
162
- };
163
- }
74
+ const tempPercentSize = (areaSnapshot.sizePixelAtStart + pixels) / allAreasSizePixel * 100;
75
+ if (pixels > 0) {
76
+ if (areaSnapshot.area.maxSize !== null && tempPercentSize > areaSnapshot.area.maxSize) {
77
+ const maxSizePixel = areaSnapshot.area.maxSize / 100 * allAreasSizePixel;
78
+ return {
79
+ areaSnapshot,
80
+ pixelAbsorb: maxSizePixel,
81
+ percentAfterAbsorption: areaSnapshot.area.maxSize,
82
+ pixelRemain: areaSnapshot.sizePixelAtStart + pixels - maxSizePixel
83
+ };
84
+ }
85
+ return {
86
+ areaSnapshot,
87
+ pixelAbsorb: pixels,
88
+ percentAfterAbsorption: tempPercentSize > 100 ? 100 : tempPercentSize,
89
+ pixelRemain: 0
90
+ };
91
+ } else if (pixels < 0) {
92
+ if (areaSnapshot.area.minSize !== null && tempPercentSize < areaSnapshot.area.minSize) {
93
+ const minSizePixel = areaSnapshot.area.minSize / 100 * allAreasSizePixel;
94
+ return {
95
+ areaSnapshot,
96
+ pixelAbsorb: minSizePixel,
97
+ percentAfterAbsorption: areaSnapshot.area.minSize,
98
+ pixelRemain: areaSnapshot.sizePixelAtStart + pixels - minSizePixel
99
+ };
100
+ } else if (tempPercentSize < 0) return {
101
+ areaSnapshot,
102
+ pixelAbsorb: -areaSnapshot.sizePixelAtStart,
103
+ percentAfterAbsorption: 0,
104
+ pixelRemain: pixels + areaSnapshot.sizePixelAtStart
105
+ };
106
+ return {
107
+ areaSnapshot,
108
+ pixelAbsorb: pixels,
109
+ percentAfterAbsorption: tempPercentSize,
110
+ pixelRemain: 0
111
+ };
112
+ }
164
113
  }
165
114
  function getAreaAbsorptionCapacityPixel(areaSnapshot, pixels, containerSizePixel) {
166
- const tempPixelSize = areaSnapshot.sizePixelAtStart + pixels;
167
- // ENLARGE AREA
168
- if (pixels > 0) {
169
- // If maxSize & newSize bigger than it > absorb to max and return remaining pixels
170
- if (areaSnapshot.area.maxSize !== null && tempPixelSize > areaSnapshot.area.maxSize) {
171
- return {
172
- areaSnapshot,
173
- pixelAbsorb: areaSnapshot.area.maxSize - areaSnapshot.sizePixelAtStart,
174
- percentAfterAbsorption: -1,
175
- pixelRemain: tempPixelSize - areaSnapshot.area.maxSize,
176
- };
177
- }
178
- return {
179
- areaSnapshot,
180
- pixelAbsorb: pixels,
181
- percentAfterAbsorption: -1,
182
- pixelRemain: 0,
183
- };
184
- }
185
- // REDUCE AREA
186
- else if (pixels < 0) {
187
- // If minSize & newSize smaller than it > absorb to min and return remaining pixels
188
- if (areaSnapshot.area.minSize !== null && tempPixelSize < areaSnapshot.area.minSize) {
189
- return {
190
- areaSnapshot,
191
- pixelAbsorb: areaSnapshot.area.minSize + pixels - tempPixelSize,
192
- percentAfterAbsorption: -1,
193
- pixelRemain: tempPixelSize - areaSnapshot.area.minSize,
194
- };
195
- }
196
- // If reduced under zero > return remaining pixels
197
- else if (tempPixelSize < 0) {
198
- return {
199
- areaSnapshot,
200
- pixelAbsorb: -areaSnapshot.sizePixelAtStart,
201
- percentAfterAbsorption: -1,
202
- pixelRemain: pixels + areaSnapshot.sizePixelAtStart,
203
- };
204
- }
205
- return {
206
- areaSnapshot,
207
- pixelAbsorb: pixels,
208
- percentAfterAbsorption: -1,
209
- pixelRemain: 0,
210
- };
211
- }
115
+ const tempPixelSize = areaSnapshot.sizePixelAtStart + pixels;
116
+ if (pixels > 0) {
117
+ if (areaSnapshot.area.maxSize !== null && tempPixelSize > areaSnapshot.area.maxSize) return {
118
+ areaSnapshot,
119
+ pixelAbsorb: areaSnapshot.area.maxSize - areaSnapshot.sizePixelAtStart,
120
+ percentAfterAbsorption: -1,
121
+ pixelRemain: tempPixelSize - areaSnapshot.area.maxSize
122
+ };
123
+ return {
124
+ areaSnapshot,
125
+ pixelAbsorb: pixels,
126
+ percentAfterAbsorption: -1,
127
+ pixelRemain: 0
128
+ };
129
+ } else if (pixels < 0) {
130
+ if (areaSnapshot.area.minSize !== null && tempPixelSize < areaSnapshot.area.minSize) return {
131
+ areaSnapshot,
132
+ pixelAbsorb: areaSnapshot.area.minSize + pixels - tempPixelSize,
133
+ percentAfterAbsorption: -1,
134
+ pixelRemain: tempPixelSize - areaSnapshot.area.minSize
135
+ };
136
+ else if (tempPixelSize < 0) return {
137
+ areaSnapshot,
138
+ pixelAbsorb: -areaSnapshot.sizePixelAtStart,
139
+ percentAfterAbsorption: -1,
140
+ pixelRemain: pixels + areaSnapshot.sizePixelAtStart
141
+ };
142
+ return {
143
+ areaSnapshot,
144
+ pixelAbsorb: pixels,
145
+ percentAfterAbsorption: -1,
146
+ pixelRemain: 0
147
+ };
148
+ }
212
149
  }
213
150
  function updateAreaSize(unit, item) {
214
- if (unit === 'percent') {
215
- item.areaSnapshot.area.component.setSize(item.percentAfterAbsorption);
216
- }
217
- else if (unit === 'pixel') {
218
- // Update size except for the wildcard size area
219
- if (item.areaSnapshot.area.size !== null) {
220
- item.areaSnapshot.area.component.setSize(item.areaSnapshot.sizePixelAtStart + item.pixelAbsorb);
221
- }
222
- }
151
+ if (unit === "percent") item.areaSnapshot.area.component.setSize(item.percentAfterAbsorption);
152
+ else if (unit === "pixel") {
153
+ if (item.areaSnapshot.area.size !== null) item.areaSnapshot.area.component.setSize(item.areaSnapshot.sizePixelAtStart + item.pixelAbsorb);
154
+ }
223
155
  }
224
-
225
- /** Injection token that can be used to specify default split options. */
226
- const SPLIT_DEFAULT_OPTIONS = new InjectionToken('SPLIT_DEFAULT_OPTIONS');
227
- /**
228
- * Configures the default options for the split component.
229
- * @param options The default options to use.
230
- * @returns The environment providers.
231
- */
156
+ const SPLIT_DEFAULT_OPTIONS = new InjectionToken("SPLIT_DEFAULT_OPTIONS");
232
157
  function provideSplit(options) {
233
- return makeEnvironmentProviders([
234
- { provide: SPLIT_DEFAULT_OPTIONS, useValue: options },
235
- ]);
236
- }
237
- class Split {
238
- shouldShowHandle(gutterIndex) {
239
- // show if either adjacent pane has withHandle=true
240
- const left = this.displayedAreas[gutterIndex]?.component;
241
- const right = this.displayedAreas[gutterIndex + 1]?.component;
242
- return !!(left?.hasHandle() || right?.hasHandle());
243
- }
244
- ngZone = inject(NgZone);
245
- elRef = inject(ElementRef);
246
- cdRef = inject(ChangeDetectorRef);
247
- renderer = inject(Renderer2);
248
- isInit = signal(false, /* @ts-ignore */
249
- ...(ngDevMode ? [{ debugName: "isInit" }] : /* istanbul ignore next */ []));
250
- _defaultOptions = inject(SPLIT_DEFAULT_OPTIONS, {
251
- optional: true,
252
- });
253
- /** The split direction. */
254
- direction = input(this._defaultOptions?.direction ?? 'horizontal', /* @ts-ignore */
255
- ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
256
- /** The unit you want to specify area sizes. */
257
- unit = input(this._defaultOptions?.unit ?? 'percent', /* @ts-ignore */
258
- ...(ngDevMode ? [{ debugName: "unit" }] : /* istanbul ignore next */ []));
259
- /** Gutters's size (dragging elements) in pixels. */
260
- gutterSize = input(this._defaultOptions?.gutterSize ?? 5, { ...(ngDevMode ? { debugName: "gutterSize" } : /* istanbul ignore next */ {}), transform: (v) => getInputPositiveNumber(v, 4) });
261
- /** Gutter step while moving in pixels. */
262
- gutterStep = input(this._defaultOptions?.gutterStep ?? 1, { ...(ngDevMode ? { debugName: "gutterStep" } : /* istanbul ignore next */ {}), transform: (v) => getInputPositiveNumber(v, 1) });
263
- /** Set to true if you want to limit gutter move to adjacent areas only. */
264
- restrictMove = input(this._defaultOptions?.restrictMove ?? false, { ...(ngDevMode ? { debugName: "restrictMove" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
265
- /** Add transition when toggling visibility using `visible` or `size` changes. */
266
- useTransition = input(this._defaultOptions?.useTransition ?? false, { ...(ngDevMode ? { debugName: "useTransition" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
267
- /**
268
- * Disable the dragging feature (remove cursor/image on gutters).
269
- * `gutterClick`/`gutterDblClick` still emits.
270
- */
271
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
272
- /** Indicates the directionality of the areas. */
273
- dir = input(this._defaultOptions?.dir ?? 'ltr', /* @ts-ignore */
274
- ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
275
- /**
276
- * Milliseconds to detect a double click on a gutter. Set it around 300-500ms if
277
- * you want to use `gutterDblClick` event.
278
- */
279
- gutterDblClickDuration = input(this._defaultOptions?.gutterDblClickDuration ?? 0, { ...(ngDevMode ? { debugName: "gutterDblClickDuration" } : /* istanbul ignore next */ {}), transform: (v) => getInputPositiveNumber(v, 0) });
280
- /** Event emitted when drag starts. */
281
- dragStart = output();
282
- /** Event emitted when drag ends. */
283
- dragEnd = output();
284
- /** Event emitted when user clicks on a gutter. */
285
- gutterClick = output();
286
- /** Event emitted when user double clicks on a gutter. */
287
- gutterDblClick = output();
288
- /** Event emitted when transition ends (debounced). */
289
- transitionEnd = output();
290
- transitionEndSubject = new Subject();
291
- dragProgressSubject = new Subject();
292
- dragProgress$ = this.dragProgressSubject.asObservable();
293
- isDragging = signal(false, /* @ts-ignore */
294
- ...(ngDevMode ? [{ debugName: "isDragging" }] : /* istanbul ignore next */ []));
295
- dragListeners = [];
296
- snapshot = null;
297
- startPoint = null;
298
- endPoint = null;
299
- displayedAreas = [];
300
- hidedAreas = [];
301
- gutterEls = viewChildren('gutterEls', /* @ts-ignore */
302
- ...(ngDevMode ? [{ debugName: "gutterEls" }] : /* istanbul ignore next */ []));
303
- isDraggingSignal = this.isDragging.asReadonly();
304
- isDraggingPublic = this.isDragging.asReadonly();
305
- isInitSignal = this.isInit.asReadonly();
306
- constructor() {
307
- // Debounce transitionEnd output
308
- this.transitionEndSubject.pipe(debounceTime(20)).subscribe(sizes => {
309
- this.transitionEnd.emit(sizes);
310
- });
311
- effect(() => {
312
- this.direction();
313
- this.cdRef.markForCheck();
314
- this.build(false, false);
315
- });
316
- effect(() => {
317
- this.unit();
318
- this.cdRef.markForCheck();
319
- this.build(false, true);
320
- });
321
- effect(() => {
322
- this.gutterSize();
323
- this.build(false, false);
324
- });
325
- effect(() => {
326
- this.useTransition();
327
- this.cdRef.markForCheck();
328
- });
329
- effect(() => {
330
- this.disabled();
331
- this.cdRef.markForCheck();
332
- });
333
- effect(() => {
334
- this.renderer.setAttribute(this.elRef.nativeElement, 'dir', this.dir());
335
- });
336
- }
337
- ngAfterViewInit() {
338
- this.ngZone.runOutsideAngular(() => {
339
- // To avoid transition at first rendering
340
- setTimeout(() => {
341
- this.isInit.set(true);
342
- this.cdRef.markForCheck();
343
- });
344
- });
345
- }
346
- getNbGutters() {
347
- return this.displayedAreas.length === 0 ? 0 : this.displayedAreas.length - 1;
348
- }
349
- addArea(component) {
350
- const newArea = {
351
- component,
352
- order: 0,
353
- size: 0,
354
- minSize: null,
355
- maxSize: null,
356
- };
357
- if (component.isVisible() === true) {
358
- this.displayedAreas.push(newArea);
359
- this.build(true, true);
360
- }
361
- else {
362
- this.hidedAreas.push(newArea);
363
- }
364
- }
365
- removeArea(component) {
366
- if (this.displayedAreas.some(a => a.component === component)) {
367
- const area = this.displayedAreas.find(a => a.component === component);
368
- this.displayedAreas.splice(this.displayedAreas.indexOf(area), 1);
369
- this.build(true, true);
370
- }
371
- else if (this.hidedAreas.some(a => a.component === component)) {
372
- const area = this.hidedAreas.find(a => a.component === component);
373
- this.hidedAreas.splice(this.hidedAreas.indexOf(area), 1);
374
- }
375
- }
376
- updateArea(component, resetOrders, resetSizes) {
377
- if (component.isVisible() === true) {
378
- this.build(resetOrders, resetSizes);
379
- }
380
- }
381
- updateAreaInternal(component) {
382
- const area = this.displayedAreas.find(a => a.component === component);
383
- if (area) {
384
- area.size = component.getSize();
385
- }
386
- }
387
- showArea(component) {
388
- const area = this.hidedAreas.find(a => a.component === component);
389
- if (area === undefined) {
390
- return;
391
- }
392
- const areas = this.hidedAreas.splice(this.hidedAreas.indexOf(area), 1);
393
- this.displayedAreas.push(...areas);
394
- this.build(true, true);
395
- }
396
- hideArea(comp) {
397
- const area = this.displayedAreas.find(a => a.component === comp);
398
- if (area === undefined) {
399
- return;
400
- }
401
- const areas = this.displayedAreas.splice(this.displayedAreas.indexOf(area), 1);
402
- areas.forEach(_area => {
403
- _area.order = 0;
404
- _area.size = 0;
405
- });
406
- this.hidedAreas.push(...areas);
407
- this.build(true, true);
408
- }
409
- getVisibleAreaSizes() {
410
- return this.displayedAreas.map(a => (a.size === null ? '*' : a.size));
411
- }
412
- setVisibleAreaSizes(sizes) {
413
- if (sizes.length !== this.displayedAreas.length) {
414
- return false;
415
- }
416
- const formatedSizes = sizes.map(s => getInputPositiveNumber(s, null));
417
- const isValid = isUserSizesValid(this.unit(), formatedSizes);
418
- if (isValid === false) {
419
- return false;
420
- }
421
- this.displayedAreas.forEach((area, i) => area.component.setSize(formatedSizes[i]));
422
- this.build(false, true);
423
- return true;
424
- }
425
- build(resetOrders, resetSizes) {
426
- // ¤ AREAS ORDER
427
- if (resetOrders === true) {
428
- // If user provided 'order' for each area, use it to sort them.
429
- if (this.displayedAreas.every(a => a.component.getOrder() !== null)) {
430
- this.displayedAreas.sort((a, b) => a.component.getOrder() - b.component.getOrder());
431
- }
432
- // Then set real order with multiples of 2, numbers between will be used by gutters.
433
- this.displayedAreas.forEach((area, i) => {
434
- area.order = i * 2;
435
- area.component.setStyleOrder(area.order);
436
- });
437
- }
438
- // ¤ AREAS SIZE
439
- if (resetSizes === true) {
440
- const useUserSizes = isUserSizesValid(this.unit(), this.displayedAreas.map(a => a.component.getSize()));
441
- switch (this.unit()) {
442
- case 'percent': {
443
- const defaultSize = 100 / this.displayedAreas.length;
444
- this.displayedAreas.forEach(area => {
445
- area.size = useUserSizes ? area.component.getSize() : defaultSize;
446
- area.minSize = getAreaMinSize(area);
447
- area.maxSize = getAreaMaxSize(area);
448
- });
449
- break;
450
- }
451
- case 'pixel': {
452
- if (useUserSizes) {
453
- this.displayedAreas.forEach(area => {
454
- area.size = area.component.getSize();
455
- area.minSize = getAreaMinSize(area);
456
- area.maxSize = getAreaMaxSize(area);
457
- });
458
- }
459
- else {
460
- const wildcardSizeAreas = this.displayedAreas.filter(a => a.component.getSize() === null);
461
- // No wildcard area > Need to select one arbitrarily > first
462
- if (wildcardSizeAreas.length === 0 && this.displayedAreas.length > 0) {
463
- this.displayedAreas.forEach((area, i) => {
464
- area.size = i === 0 ? null : area.component.getSize();
465
- area.minSize = i === 0 ? null : getAreaMinSize(area);
466
- area.maxSize = i === 0 ? null : getAreaMaxSize(area);
467
- });
468
- }
469
- // More than one wildcard area > Need to keep only one arbitrarly > first
470
- else if (wildcardSizeAreas.length > 1) {
471
- let alreadyGotOne = false;
472
- this.displayedAreas.forEach(area => {
473
- if (area.component.getSize() === null) {
474
- if (alreadyGotOne === false) {
475
- area.size = null;
476
- area.minSize = null;
477
- area.maxSize = null;
478
- alreadyGotOne = true;
479
- }
480
- else {
481
- area.size = 100;
482
- area.minSize = null;
483
- area.maxSize = null;
484
- }
485
- }
486
- else {
487
- area.size = area.component.getSize();
488
- area.minSize = getAreaMinSize(area);
489
- area.maxSize = getAreaMaxSize(area);
490
- }
491
- });
492
- }
493
- }
494
- break;
495
- }
496
- }
497
- }
498
- this.refreshStyleSizes();
499
- this.cdRef.markForCheck();
500
- }
501
- refreshStyleSizes() {
502
- ///////////////////////////////////////////
503
- // PERCENT MODE
504
- if (this.unit() === 'percent') {
505
- // Only one area > flex-basis 100%
506
- if (this.displayedAreas.length === 1) {
507
- this.displayedAreas[0].component.setStyleFlex(0, 0, `100%`, false, false);
508
- }
509
- // Multiple areas > use each percent basis
510
- else {
511
- const sumGutterSize = this.getNbGutters() * this.gutterSize();
512
- this.displayedAreas.forEach(area => {
513
- area.component.setStyleFlex(0, 0, `calc( ${area.size}% - ${(area.size / 100) * sumGutterSize}px )`, area.minSize !== null && area.minSize === area.size ? true : false, area.maxSize !== null && area.maxSize === area.size ? true : false);
514
- });
515
- }
516
- }
517
- ///////////////////////////////////////////
518
- // PIXEL MODE
519
- else if (this.unit() === 'pixel') {
520
- this.displayedAreas.forEach(area => {
521
- // Area with wildcard size
522
- if (area.size === null) {
523
- if (this.displayedAreas.length === 1) {
524
- area.component.setStyleFlex(1, 1, `100%`, false, false);
525
- }
526
- else {
527
- area.component.setStyleFlex(1, 1, `auto`, false, false);
528
- }
529
- }
530
- // Area with pixel size
531
- else {
532
- // Only one area > flex-basis 100%
533
- if (this.displayedAreas.length === 1) {
534
- area.component.setStyleFlex(0, 0, `100%`, false, false);
535
- }
536
- // Multiple areas > use each pixel basis
537
- else {
538
- area.component.setStyleFlex(0, 0, `${area.size}px`, area.minSize !== null && area.minSize === area.size ? true : false, area.maxSize !== null && area.maxSize === area.size ? true : false);
539
- }
540
- }
541
- });
542
- }
543
- }
544
- _clickTimeout = null;
545
- clickGutter(event, gutterNum) {
546
- const tempPoint = getPointFromEvent(event);
547
- // Be sure mouseup/touchend happened at same point as mousedown/touchstart to trigger click/dblclick
548
- if (this.startPoint && this.startPoint.x === tempPoint.x && this.startPoint.y === tempPoint.y) {
549
- // If timeout in progress and new click > clearTimeout & dblClickEvent
550
- if (this._clickTimeout !== null) {
551
- window.clearTimeout(this._clickTimeout);
552
- this._clickTimeout = null;
553
- this.notify('dblclick', gutterNum);
554
- this.stopDragging();
555
- }
556
- // Else start timeout to call clickEvent at end
557
- else {
558
- this._clickTimeout = window.setTimeout(() => {
559
- this._clickTimeout = null;
560
- this.notify('click', gutterNum);
561
- this.stopDragging();
562
- }, this.gutterDblClickDuration());
563
- }
564
- }
565
- }
566
- startDragging(event, gutterOrder, gutterNum) {
567
- if (event.cancelable) {
568
- event.preventDefault();
569
- }
570
- event.stopPropagation();
571
- this.startPoint = getPointFromEvent(event);
572
- if (this.startPoint === null || this.disabled() === true) {
573
- return;
574
- }
575
- this.isDragging.set(true);
576
- this.cdRef.markForCheck();
577
- this.snapshot = {
578
- gutterNum,
579
- lastSteppedOffset: 0,
580
- allAreasSizePixel: getElementPixelSize(this.elRef, this.direction()) - this.getNbGutters() * this.gutterSize(),
581
- allInvolvedAreasSizePercent: 100,
582
- areasBeforeGutter: [],
583
- areasAfterGutter: [],
584
- };
585
- this.displayedAreas.forEach(area => {
586
- const areaSnapshot = {
587
- area,
588
- sizePixelAtStart: getElementPixelSize(area.component.elRef, this.direction()),
589
- sizePercentAtStart: (this.unit() === 'percent' ? area.size : -1), // If pixel mode, anyway, will not be used.
590
- };
591
- if (area.order < gutterOrder) {
592
- if (this.restrictMove() === true) {
593
- this.snapshot.areasBeforeGutter = [areaSnapshot];
594
- }
595
- else {
596
- this.snapshot.areasBeforeGutter.unshift(areaSnapshot);
597
- }
598
- }
599
- else if (area.order > gutterOrder) {
600
- if (this.restrictMove() === true) {
601
- if (this.snapshot.areasAfterGutter.length === 0) {
602
- this.snapshot.areasAfterGutter = [areaSnapshot];
603
- }
604
- }
605
- else {
606
- this.snapshot.areasAfterGutter.push(areaSnapshot);
607
- }
608
- }
609
- });
610
- this.snapshot.allInvolvedAreasSizePercent = [
611
- ...this.snapshot.areasBeforeGutter,
612
- ...this.snapshot.areasAfterGutter,
613
- ].reduce((t, a) => t + (a.sizePercentAtStart > 0 ? a.sizePercentAtStart : 0), 0);
614
- if (this.snapshot.areasBeforeGutter.length === 0 ||
615
- this.snapshot.areasAfterGutter.length === 0) {
616
- return;
617
- }
618
- this.dragListeners.push(this.renderer.listen('document', 'mouseup', this.stopDragging.bind(this)));
619
- this.dragListeners.push(this.renderer.listen('document', 'touchend', this.stopDragging.bind(this)));
620
- this.dragListeners.push(this.renderer.listen('document', 'touchcancel', this.stopDragging.bind(this)));
621
- this.ngZone.runOutsideAngular(() => {
622
- this.dragListeners.push(this.renderer.listen('document', 'mousemove', this.dragEvent.bind(this)));
623
- this.dragListeners.push(this.renderer.listen('document', 'touchmove', this.dragEvent.bind(this)));
624
- });
625
- this.displayedAreas.forEach(area => area.component.lockEvents());
626
- this.isDragging.set(true);
627
- this.renderer.addClass(this.elRef.nativeElement, 'ngs-dragging');
628
- this.renderer.addClass(this.gutterEls()[this.snapshot.gutterNum - 1].nativeElement, 'ngs-dragged');
629
- this.notify('start', this.snapshot.gutterNum);
630
- }
631
- dragEvent(event) {
632
- if (event.cancelable) {
633
- event.preventDefault();
634
- }
635
- event.stopPropagation();
636
- if (this._clickTimeout !== null) {
637
- window.clearTimeout(this._clickTimeout);
638
- this._clickTimeout = null;
639
- }
640
- if (this.isDragging() === false) {
641
- return;
642
- }
643
- this.endPoint = getPointFromEvent(event);
644
- if (this.endPoint === null) {
645
- return;
646
- }
647
- // Calculate steppedOffset
648
- let offset = this.direction() === 'horizontal'
649
- ? this.startPoint.x - this.endPoint.x
650
- : this.startPoint.y - this.endPoint.y;
651
- if (this.dir() === 'rtl' && this.direction() === 'horizontal') {
652
- offset = -offset;
653
- }
654
- const steppedOffset = Math.round(offset / this.gutterStep()) * this.gutterStep();
655
- if (steppedOffset === this.snapshot.lastSteppedOffset) {
656
- return;
657
- }
658
- this.snapshot.lastSteppedOffset = steppedOffset;
659
- // Need to know if each gutter side areas could reacts to steppedOffset
660
- let areasBefore = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasBeforeGutter, -steppedOffset, this.snapshot.allAreasSizePixel);
661
- let areasAfter = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasAfterGutter, steppedOffset, this.snapshot.allAreasSizePixel);
662
- // Each gutter side areas can't absorb all offset
663
- if (areasBefore.remain !== 0 && areasAfter.remain !== 0) {
664
- if (Math.abs(areasBefore.remain) === Math.abs(areasAfter.remain)) {
665
- /** */
666
- }
667
- else if (Math.abs(areasBefore.remain) > Math.abs(areasAfter.remain)) {
668
- areasAfter = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasAfterGutter, steppedOffset + areasBefore.remain, this.snapshot.allAreasSizePixel);
669
- }
670
- else {
671
- areasBefore = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasBeforeGutter, -(steppedOffset - areasAfter.remain), this.snapshot.allAreasSizePixel);
672
- }
673
- }
674
- // Areas before gutter can't absorbs all offset > need to recalculate sizes for areas after gutter.
675
- else if (areasBefore.remain !== 0) {
676
- areasAfter = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasAfterGutter, steppedOffset + areasBefore.remain, this.snapshot.allAreasSizePixel);
677
- }
678
- // Areas after gutter can't absorbs all offset > need to recalculate sizes for areas before gutter.
679
- else if (areasAfter.remain !== 0) {
680
- areasBefore = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasBeforeGutter, -(steppedOffset - areasAfter.remain), this.snapshot.allAreasSizePixel);
681
- }
682
- if (this.unit() === 'percent') {
683
- // Hack because of browser messing up with sizes using calc(X% - Ypx) -> el.getBoundingClientRect()
684
- // If not there, playing with gutters makes total going down to 99.99875% then 99.99286%, 99.98986%,..
685
- const all = [...areasBefore.list, ...areasAfter.list];
686
- const areaToReset = all.find(a => a.percentAfterAbsorption !== 0 &&
687
- a.percentAfterAbsorption !== a.areaSnapshot.area.minSize &&
688
- a.percentAfterAbsorption !== a.areaSnapshot.area.maxSize);
689
- if (areaToReset) {
690
- areaToReset.percentAfterAbsorption =
691
- this.snapshot.allInvolvedAreasSizePercent -
692
- all
693
- .filter(a => a !== areaToReset)
694
- .reduce((total, a) => total + a.percentAfterAbsorption, 0);
695
- }
696
- }
697
- // Now we know areas could absorb steppedOffset, time to really update sizes
698
- areasBefore.list.forEach(item => updateAreaSize(this.unit(), item));
699
- areasAfter.list.forEach(item => updateAreaSize(this.unit(), item));
700
- this.refreshStyleSizes();
701
- this.notify('progress', this.snapshot.gutterNum);
702
- }
703
- stopDragging(event) {
704
- if (event && event.cancelable) {
705
- event.preventDefault();
706
- event.stopPropagation();
707
- }
708
- if (this.isDragging() === false) {
709
- return;
710
- }
711
- this.displayedAreas.forEach(area => area.component.unlockEvents());
712
- while (this.dragListeners.length > 0) {
713
- const fct = this.dragListeners.pop();
714
- if (fct) {
715
- fct();
716
- }
717
- }
718
- // Warning: Have to be before "notify('end')"
719
- // because "notify('end')"" can be linked to "[size]='x'" > "build()" > "stopDragging()"
720
- this.isDragging.set(false);
721
- this.cdRef.markForCheck();
722
- // If moved from starting point, notify end
723
- if (this.endPoint &&
724
- (this.startPoint.x !== this.endPoint.x ||
725
- this.startPoint.y !== this.endPoint.y)) {
726
- this.notify('end', this.snapshot.gutterNum);
727
- }
728
- this.renderer.removeClass(this.elRef.nativeElement, 'ngs-dragging');
729
- this.renderer.removeClass(this.gutterEls()[this.snapshot.gutterNum - 1].nativeElement, 'ngs-dragged');
730
- this.snapshot = null;
731
- // Needed to let (click)="clickGutter(...)" event run and verify if mouse moved or not
732
- this.ngZone.runOutsideAngular(() => {
733
- setTimeout(() => {
734
- this.startPoint = null;
735
- this.endPoint = null;
736
- });
737
- });
738
- }
739
- notify(type, gutterNum) {
740
- const sizes = this.getVisibleAreaSizes();
741
- if (type === 'start') {
742
- this.dragStart.emit({ gutterNum, sizes });
743
- }
744
- else if (type === 'end') {
745
- this.dragEnd.emit({ gutterNum, sizes });
746
- }
747
- else if (type === 'click') {
748
- this.gutterClick.emit({ gutterNum, sizes });
749
- }
750
- else if (type === 'dblclick') {
751
- this.gutterDblClick.emit({ gutterNum, sizes });
752
- }
753
- else if (type === 'transitionEnd') {
754
- this.ngZone.run(() => this.transitionEndSubject.next(sizes));
755
- }
756
- else if (type === 'progress') {
757
- // Stay outside zone to allow users do what they want about change detection mechanism.
758
- this.dragProgressSubject.next({ gutterNum, sizes });
759
- }
760
- }
761
- ngOnDestroy() {
762
- this.stopDragging();
763
- }
764
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Split, deps: [], target: i0.ɵɵFactoryTarget.Component });
765
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: Split, isStandalone: true, selector: "ngs-split", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, gutterSize: { classPropertyName: "gutterSize", publicName: "gutterSize", isSignal: true, isRequired: false, transformFunction: null }, gutterStep: { classPropertyName: "gutterStep", publicName: "gutterStep", isSignal: true, isRequired: false, transformFunction: null }, restrictMove: { classPropertyName: "restrictMove", publicName: "restrictMove", isSignal: true, isRequired: false, transformFunction: null }, useTransition: { classPropertyName: "useTransition", publicName: "useTransition", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, gutterDblClickDuration: { classPropertyName: "gutterDblClickDuration", publicName: "gutterDblClickDuration", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dragStart: "dragStart", dragEnd: "dragEnd", gutterClick: "gutterClick", gutterDblClick: "gutterDblClick", transitionEnd: "transitionEnd" }, host: { properties: { "class.ngs-split-horizontal": "direction() === \"horizontal\"", "class.ngs-split-vertical": "direction() === \"vertical\"", "class.ngs-split-percent": "unit() === \"percent\"", "class.ngs-split-pixel": "unit() === \"pixel\"", "class.ngs-split-disabled": "disabled()", "class.ngs-split-transition": "useTransition()", "class.ngs-dragging": "isDraggingSignal()", "class.ngs-split-init": "isInitSignal()" }, classAttribute: "ngs-split" }, viewQueries: [{ propertyName: "gutterEls", predicate: ["gutterEls"], descendants: true, isSignal: true }], exportAs: ["ngsSplit"], ngImport: i0, template: "<ng-content/>\n@for (area of displayedAreas; track area; let index = $index; let last = $last) {\n @if (!last) {\n <div\n #gutterEls\n class=\"ngs-split-gutter\"\n [style.flex-basis.px]=\"gutterSize()\"\n [style.order]=\"index * 2 + 1\"\n (mousedown)=\"startDragging($event, index * 2 + 1, index + 1)\"\n (touchstart)=\"startDragging($event, index * 2 + 1, index + 1)\"\n (mouseup)=\"clickGutter($event, index + 1)\"\n (touchend)=\"clickGutter($event, index + 1)\"\n >\n <div class=\"ngs-split-gutter-handle\" [class.has-dots]=\"shouldShowHandle(index)\">\n @if (shouldShowHandle(index)) {\n <div class=\"ngs-split-gutter-dot\"></div>\n <div class=\"ngs-split-gutter-dot\"></div>\n <div class=\"ngs-split-gutter-dot\"></div>\n }\n </div>\n </div>\n }\n}\n", styles: [":host{--ngs-split-gutter-size: 5px;--ngs-split-handle-size: 10px;--ngs-split-handle-offset: calc((var(--ngs-split-handle-size) - var(--ngs-split-gutter-size)) * .5);--ngs-split-gutter-bg: var(--ngs-color-surface-container-high);--ngs-split-gutter-hover-bg: var(--ngs-color-primary);display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;overflow:hidden;width:100%;height:100%}:host ::ng-deep>.ngs-split-gutter{position:relative;display:flex;flex-grow:0;flex-shrink:0;align-items:center;justify-content:center;background-color:transparent;z-index:10}:host ::ng-deep>.ngs-split-gutter:before{content:\"\";position:absolute;background-color:var(--ngs-split-gutter-bg);transition:background-color .2s}:host ::ng-deep>.ngs-split-gutter:hover:before{background-color:var(--ngs-split-gutter-hover-bg)}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{position:absolute;opacity:0;display:flex;align-items:center;justify-content:center}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle.has-dots{opacity:1}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle .ngs-split-gutter-dot{width:2px;height:2px;border-radius:50%;background-color:var(--ngs-color-on-surface)}:host ::ng-deep>.ngs-split-pane{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;min-width:0;min-height:0;overflow:hidden auto}:host ::ng-deep>.ngs-split-pane.ngs-dragging{-webkit-user-select:none;user-select:none}:host ::ng-deep>.ngs-split-pane>*{flex-shrink:0}:host ::ng-deep>.ngs-split-pane.ngs-split-pane-hidden{flex:0 1 0!important;overflow:hidden}:host.ngs-split-horizontal{flex-direction:row}:host.ngs-split-horizontal.ngs-dragging{cursor:col-resize}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter{flex-direction:row;height:100%;width:var(--ngs-split-gutter-size);cursor:col-resize}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter:before{width:100%;height:100%;top:0;left:0}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{width:var(--ngs-split-handle-size);height:100%;left:calc(-1 * var(--ngs-split-handle-offset));flex-direction:column;gap:2px}:host.ngs-split-horizontal ::ng-deep>.ngs-split-pane{height:100%;min-height:0}:host.ngs-split-vertical{flex-direction:column}:host.ngs-split-vertical.ngs-dragging{cursor:row-resize}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter{flex-direction:column;width:100%;height:var(--ngs-split-gutter-size);cursor:row-resize}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter:before{width:100%;height:100%;top:0;left:0}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{width:100%;height:var(--ngs-split-handle-size);top:calc(-1 * var(--ngs-split-handle-offset));flex-direction:row;gap:3px}:host.ngs-split-vertical ::ng-deep>.ngs-split-pane{width:100%;min-width:0}:host.ngs-split-vertical ::ng-deep>.ngs-split-pane.ngs-split-pane-hidden{max-width:0}:host.ngs-split-disabled ::ng-deep>.ngs-split-gutter{cursor:default}:host.ngs-split-disabled ::ng-deep>.ngs-split-gutter .ngs-split-gutter-handle{background-image:none}:host.ngs-split-transition.ngs-split-init:not(.ngs-dragging) ::ng-deep>.ngs-split-gutter,:host.ngs-split-transition.ngs-split-init:not(.ngs-dragging) ::ng-deep>.ngs-split-pane{transition:flex-basis .3s}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
766
- }
767
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Split, decorators: [{
768
- type: Component,
769
- args: [{ selector: 'ngs-split', exportAs: 'ngsSplit', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: {
770
- class: 'ngs-split',
771
- '[class.ngs-split-horizontal]': 'direction() === "horizontal"',
772
- '[class.ngs-split-vertical]': 'direction() === "vertical"',
773
- '[class.ngs-split-percent]': 'unit() === "percent"',
774
- '[class.ngs-split-pixel]': 'unit() === "pixel"',
775
- '[class.ngs-split-disabled]': 'disabled()',
776
- '[class.ngs-split-transition]': 'useTransition()',
777
- '[class.ngs-dragging]': 'isDraggingSignal()',
778
- '[class.ngs-split-init]': 'isInitSignal()',
779
- }, template: "<ng-content/>\n@for (area of displayedAreas; track area; let index = $index; let last = $last) {\n @if (!last) {\n <div\n #gutterEls\n class=\"ngs-split-gutter\"\n [style.flex-basis.px]=\"gutterSize()\"\n [style.order]=\"index * 2 + 1\"\n (mousedown)=\"startDragging($event, index * 2 + 1, index + 1)\"\n (touchstart)=\"startDragging($event, index * 2 + 1, index + 1)\"\n (mouseup)=\"clickGutter($event, index + 1)\"\n (touchend)=\"clickGutter($event, index + 1)\"\n >\n <div class=\"ngs-split-gutter-handle\" [class.has-dots]=\"shouldShowHandle(index)\">\n @if (shouldShowHandle(index)) {\n <div class=\"ngs-split-gutter-dot\"></div>\n <div class=\"ngs-split-gutter-dot\"></div>\n <div class=\"ngs-split-gutter-dot\"></div>\n }\n </div>\n </div>\n }\n}\n", styles: [":host{--ngs-split-gutter-size: 5px;--ngs-split-handle-size: 10px;--ngs-split-handle-offset: calc((var(--ngs-split-handle-size) - var(--ngs-split-gutter-size)) * .5);--ngs-split-gutter-bg: var(--ngs-color-surface-container-high);--ngs-split-gutter-hover-bg: var(--ngs-color-primary);display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;overflow:hidden;width:100%;height:100%}:host ::ng-deep>.ngs-split-gutter{position:relative;display:flex;flex-grow:0;flex-shrink:0;align-items:center;justify-content:center;background-color:transparent;z-index:10}:host ::ng-deep>.ngs-split-gutter:before{content:\"\";position:absolute;background-color:var(--ngs-split-gutter-bg);transition:background-color .2s}:host ::ng-deep>.ngs-split-gutter:hover:before{background-color:var(--ngs-split-gutter-hover-bg)}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{position:absolute;opacity:0;display:flex;align-items:center;justify-content:center}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle.has-dots{opacity:1}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle .ngs-split-gutter-dot{width:2px;height:2px;border-radius:50%;background-color:var(--ngs-color-on-surface)}:host ::ng-deep>.ngs-split-pane{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;min-width:0;min-height:0;overflow:hidden auto}:host ::ng-deep>.ngs-split-pane.ngs-dragging{-webkit-user-select:none;user-select:none}:host ::ng-deep>.ngs-split-pane>*{flex-shrink:0}:host ::ng-deep>.ngs-split-pane.ngs-split-pane-hidden{flex:0 1 0!important;overflow:hidden}:host.ngs-split-horizontal{flex-direction:row}:host.ngs-split-horizontal.ngs-dragging{cursor:col-resize}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter{flex-direction:row;height:100%;width:var(--ngs-split-gutter-size);cursor:col-resize}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter:before{width:100%;height:100%;top:0;left:0}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{width:var(--ngs-split-handle-size);height:100%;left:calc(-1 * var(--ngs-split-handle-offset));flex-direction:column;gap:2px}:host.ngs-split-horizontal ::ng-deep>.ngs-split-pane{height:100%;min-height:0}:host.ngs-split-vertical{flex-direction:column}:host.ngs-split-vertical.ngs-dragging{cursor:row-resize}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter{flex-direction:column;width:100%;height:var(--ngs-split-gutter-size);cursor:row-resize}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter:before{width:100%;height:100%;top:0;left:0}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{width:100%;height:var(--ngs-split-handle-size);top:calc(-1 * var(--ngs-split-handle-offset));flex-direction:row;gap:3px}:host.ngs-split-vertical ::ng-deep>.ngs-split-pane{width:100%;min-width:0}:host.ngs-split-vertical ::ng-deep>.ngs-split-pane.ngs-split-pane-hidden{max-width:0}:host.ngs-split-disabled ::ng-deep>.ngs-split-gutter{cursor:default}:host.ngs-split-disabled ::ng-deep>.ngs-split-gutter .ngs-split-gutter-handle{background-image:none}:host.ngs-split-transition.ngs-split-init:not(.ngs-dragging) ::ng-deep>.ngs-split-gutter,:host.ngs-split-transition.ngs-split-init:not(.ngs-dragging) ::ng-deep>.ngs-split-pane{transition:flex-basis .3s}\n"] }]
780
- }], ctorParameters: () => [], propDecorators: { direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], gutterSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "gutterSize", required: false }] }], gutterStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "gutterStep", required: false }] }], restrictMove: [{ type: i0.Input, args: [{ isSignal: true, alias: "restrictMove", required: false }] }], useTransition: [{ type: i0.Input, args: [{ isSignal: true, alias: "useTransition", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], gutterDblClickDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "gutterDblClickDuration", required: false }] }], dragStart: [{ type: i0.Output, args: ["dragStart"] }], dragEnd: [{ type: i0.Output, args: ["dragEnd"] }], gutterClick: [{ type: i0.Output, args: ["gutterClick"] }], gutterDblClick: [{ type: i0.Output, args: ["gutterDblClick"] }], transitionEnd: [{ type: i0.Output, args: ["transitionEnd"] }], gutterEls: [{ type: i0.ViewChildren, args: ['gutterEls', { isSignal: true }] }] } });
781
-
782
- class SplitPane {
783
- ngZone = inject(NgZone);
784
- renderer = inject(Renderer2);
785
- split = inject(Split);
786
- elRef = inject(ElementRef);
787
- /**
788
- * Order of the area. Used to maintain the order of areas when toggling their visibility.
789
- * Toggling area visibility without specifying an `order` leads to weird behavior.
790
- */
791
- orderIn = input(null, { ...(ngDevMode ? { debugName: "orderIn" } : /* istanbul ignore next */ {}), alias: 'order',
792
- transform: v => getInputPositiveNumber(v, null) });
793
- /**
794
- * Size of the area in selected unit (percent/pixel).
795
- * - Percent: All areas sizes should equal to `100`, If not, all areas will have the same size.
796
- * - Pixel: An area with wildcard size (`size="*"`) is mandatory (only one) and
797
- * can't have `visible="false"` or `minSize`/`maxSize`/`lockSize` properties.
798
- */
799
- sizeIn = input(null, { ...(ngDevMode ? { debugName: "sizeIn" } : /* istanbul ignore next */ {}), alias: 'size',
800
- transform: v => getInputPositiveNumber(v, null) });
801
- /** Minimum pixel or percent size, should be equal to or smaller than provided `size`. */
802
- minSizeIn = input(null, { ...(ngDevMode ? { debugName: "minSizeIn" } : /* istanbul ignore next */ {}), alias: 'minSize',
803
- transform: v => getInputPositiveNumber(v, null) });
804
- /** Maximum pixel or percent size, should be equal to or larger than provided `size`. */
805
- maxSizeIn = input(null, { ...(ngDevMode ? { debugName: "maxSizeIn" } : /* istanbul ignore next */ {}), alias: 'maxSize',
806
- transform: v => getInputPositiveNumber(v, null) });
807
- /** Lock area size, same as `minSize`=`maxSize`=`size`. */
808
- lockSizeIn = input(false, { ...(ngDevMode ? { debugName: "lockSizeIn" } : /* istanbul ignore next */ {}), alias: 'lockSize', transform: booleanAttribute });
809
- /** Hide area visually but still present in the DOM, use `ngIf` to completely remove it. */
810
- visibleIn = input(true, { ...(ngDevMode ? { debugName: "visibleIn" } : /* istanbul ignore next */ {}), alias: 'visible', transform: booleanAttribute });
811
- /** Show handle (three dots) on the gutter adjacent to this pane. */
812
- withHandleIn = input(false, { ...(ngDevMode ? { debugName: "withHandleIn" } : /* istanbul ignore next */ {}), alias: 'withHandle', transform: booleanAttribute });
813
- // Writable state reflecting current effective values (can be changed programmatically by Split)
814
- orderSig = signal(null, { ...(ngDevMode ? { debugName: "orderSig" } : /* istanbul ignore next */ {}), equal: Object.is });
815
- sizeSig = signal(null, { ...(ngDevMode ? { debugName: "sizeSig" } : /* istanbul ignore next */ {}), equal: Object.is });
816
- minSizeSig = signal(null, { ...(ngDevMode ? { debugName: "minSizeSig" } : /* istanbul ignore next */ {}), equal: Object.is });
817
- maxSizeSig = signal(null, { ...(ngDevMode ? { debugName: "maxSizeSig" } : /* istanbul ignore next */ {}), equal: Object.is });
818
- lockSizeSig = signal(false, { ...(ngDevMode ? { debugName: "lockSizeSig" } : /* istanbul ignore next */ {}), equal: Object.is });
819
- visibleSig = signal(true, { ...(ngDevMode ? { debugName: "visibleSig" } : /* istanbul ignore next */ {}), equal: Object.is });
820
- withHandleSig = signal(false, { ...(ngDevMode ? { debugName: "withHandleSig" } : /* istanbul ignore next */ {}), equal: Object.is });
821
- transitionListener;
822
- lockListeners = [];
823
- constructor() {
824
- this.renderer.addClass(this.elRef.nativeElement, 'ngs-split-pane');
825
- this.split.addArea(this);
826
- this.ngZone.runOutsideAngular(() => {
827
- this.transitionListener = this.renderer.listen(this.elRef.nativeElement, 'transitionend', (event) => {
828
- // Limit only flex-basis transition to trigger the event
829
- if (event.propertyName === 'flex-basis') {
830
- this.split.notify('transitionEnd', -1);
831
- }
832
- });
833
- });
834
- // Sync inputs to writable state
835
- effect(() => this.orderSig.set(this.orderIn()));
836
- effect(() => this.sizeSig.set(this.sizeIn()));
837
- effect(() => this.minSizeSig.set(this.minSizeIn()));
838
- effect(() => this.maxSizeSig.set(this.maxSizeIn()));
839
- effect(() => this.lockSizeSig.set(this.lockSizeIn()));
840
- effect(() => this.withHandleSig.set(this.withHandleIn()));
841
- // React to visibility changes
842
- effect(() => {
843
- const isVisible = this.visibleIn();
844
- this.visibleSig.set(isVisible);
845
- if (isVisible) {
846
- this.split.showArea(this);
847
- this.renderer.removeClass(this.elRef.nativeElement, 'ngs-split-pane-hidden');
848
- }
849
- else {
850
- this.split.hideArea(this);
851
- this.renderer.addClass(this.elRef.nativeElement, 'ngs-split-pane-hidden');
852
- }
853
- });
854
- // React to state changes that require rebuild
855
- effect(() => {
856
- this.orderSig();
857
- if (!this.split.isDraggingPublic()) {
858
- this.split.updateArea(this, true, false);
859
- }
860
- });
861
- effect(() => {
862
- this.sizeSig();
863
- this.minSizeSig();
864
- this.maxSizeSig();
865
- this.lockSizeSig();
866
- if (!this.split.isDraggingPublic()) {
867
- this.split.updateArea(this, false, true);
868
- }
869
- });
870
- effect(() => {
871
- this.withHandleSig();
872
- if (!this.split.isDraggingPublic()) {
873
- this.split.updateArea(this, false, false);
874
- }
875
- });
876
- }
877
- // Imperative API used by Split
878
- getOrder() { return this.orderSig(); }
879
- getSize() { return this.sizeSig(); }
880
- setSize(v) {
881
- this.sizeSig.set(v);
882
- this.split.updateAreaInternal(this);
883
- }
884
- getMinSize() { return this.minSizeSig(); }
885
- getMaxSize() { return this.maxSizeSig(); }
886
- isLocked() { return this.lockSizeSig(); }
887
- isVisible() { return this.visibleSig(); }
888
- hasHandle() { return this.withHandleSig(); }
889
- setStyleOrder(value) {
890
- this.renderer.setStyle(this.elRef.nativeElement, 'order', value);
891
- }
892
- setStyleFlex(grow, shrink, basis, isMin, isMax) {
893
- // Need 3 separated properties to work on IE11 (https://github.com/angular/flex-layout/issues/323)
894
- this.renderer.setStyle(this.elRef.nativeElement, 'flex-grow', grow);
895
- this.renderer.setStyle(this.elRef.nativeElement, 'flex-shrink', shrink);
896
- this.renderer.setStyle(this.elRef.nativeElement, 'flex-basis', basis);
897
- if (basis === '0px' || basis === '0%') {
898
- this.renderer.setStyle(this.elRef.nativeElement, 'overflow', 'hidden');
899
- }
900
- else {
901
- this.renderer.removeStyle(this.elRef.nativeElement, 'overflow');
902
- }
903
- if (isMin === true) {
904
- this.renderer.addClass(this.elRef.nativeElement, 'ngs-min');
905
- }
906
- else {
907
- this.renderer.removeClass(this.elRef.nativeElement, 'ngs-min');
908
- }
909
- if (isMax === true) {
910
- this.renderer.addClass(this.elRef.nativeElement, 'ngs-max');
911
- }
912
- else {
913
- this.renderer.removeClass(this.elRef.nativeElement, 'ngs-max');
914
- }
915
- }
916
- lockEvents() {
917
- this.ngZone.runOutsideAngular(() => {
918
- this.lockListeners.push(this.renderer.listen(this.elRef.nativeElement, 'selectstart', (e) => false));
919
- this.lockListeners.push(this.renderer.listen(this.elRef.nativeElement, 'dragstart', (e) => false));
920
- });
921
- }
922
- unlockEvents() {
923
- while (this.lockListeners.length > 0) {
924
- const fct = this.lockListeners.pop();
925
- if (fct) {
926
- fct();
927
- }
928
- }
929
- }
930
- ngOnDestroy() {
931
- this.unlockEvents();
932
- if (this.transitionListener) {
933
- this.transitionListener();
934
- }
935
- this.split.removeArea(this);
936
- }
937
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SplitPane, deps: [], target: i0.ɵɵFactoryTarget.Directive });
938
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SplitPane, isStandalone: true, selector: "ngs-split-pane, [ngs-split-pane]", inputs: { orderIn: { classPropertyName: "orderIn", publicName: "order", isSignal: true, isRequired: false, transformFunction: null }, sizeIn: { classPropertyName: "sizeIn", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, minSizeIn: { classPropertyName: "minSizeIn", publicName: "minSize", isSignal: true, isRequired: false, transformFunction: null }, maxSizeIn: { classPropertyName: "maxSizeIn", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, lockSizeIn: { classPropertyName: "lockSizeIn", publicName: "lockSize", isSignal: true, isRequired: false, transformFunction: null }, visibleIn: { classPropertyName: "visibleIn", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, withHandleIn: { classPropertyName: "withHandleIn", publicName: "withHandle", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ngsSplitPane"], ngImport: i0 });
158
+ return makeEnvironmentProviders([{
159
+ provide: SPLIT_DEFAULT_OPTIONS,
160
+ useValue: options
161
+ }]);
939
162
  }
940
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SplitPane, decorators: [{
941
- type: Directive,
942
- args: [{
943
- selector: 'ngs-split-pane, [ngs-split-pane]',
944
- exportAs: 'ngsSplitPane',
945
- standalone: true,
946
- }]
947
- }], ctorParameters: () => [], propDecorators: { orderIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "order", required: false }] }], sizeIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], minSizeIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSize", required: false }] }], maxSizeIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], lockSizeIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockSize", required: false }] }], visibleIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], withHandleIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "withHandle", required: false }] }] } });
948
-
949
- /**
950
- * Generated bundle index. Do not edit.
951
- */
952
-
163
+ var Split = class Split {
164
+ shouldShowHandle(gutterIndex) {
165
+ const left = this.displayedAreas[gutterIndex]?.component;
166
+ const right = this.displayedAreas[gutterIndex + 1]?.component;
167
+ return !!(left?.hasHandle() || right?.hasHandle());
168
+ }
169
+ ngZone = inject(NgZone);
170
+ elRef = inject(ElementRef);
171
+ cdRef = inject(ChangeDetectorRef);
172
+ renderer = inject(Renderer2);
173
+ isInit = signal(false, ...ngDevMode ? [{ debugName: "isInit" }] : /* istanbul ignore next */ []);
174
+ _defaultOptions = inject(SPLIT_DEFAULT_OPTIONS, { optional: true });
175
+ direction = input(this._defaultOptions?.direction ?? "horizontal", ...ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []);
176
+ unit = input(this._defaultOptions?.unit ?? "percent", ...ngDevMode ? [{ debugName: "unit" }] : /* istanbul ignore next */ []);
177
+ gutterSize = input(this._defaultOptions?.gutterSize ?? 5, {
178
+ ...ngDevMode ? { debugName: "gutterSize" } : /* istanbul ignore next */ {},
179
+ transform: (v) => getInputPositiveNumber(v, 4)
180
+ });
181
+ gutterStep = input(this._defaultOptions?.gutterStep ?? 1, {
182
+ ...ngDevMode ? { debugName: "gutterStep" } : /* istanbul ignore next */ {},
183
+ transform: (v) => getInputPositiveNumber(v, 1)
184
+ });
185
+ restrictMove = input(this._defaultOptions?.restrictMove ?? false, {
186
+ ...ngDevMode ? { debugName: "restrictMove" } : /* istanbul ignore next */ {},
187
+ transform: booleanAttribute
188
+ });
189
+ useTransition = input(this._defaultOptions?.useTransition ?? false, {
190
+ ...ngDevMode ? { debugName: "useTransition" } : /* istanbul ignore next */ {},
191
+ transform: booleanAttribute
192
+ });
193
+ disabled = input(false, {
194
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
195
+ transform: booleanAttribute
196
+ });
197
+ dir = input(this._defaultOptions?.dir ?? "ltr", ...ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []);
198
+ gutterDblClickDuration = input(this._defaultOptions?.gutterDblClickDuration ?? 0, {
199
+ ...ngDevMode ? { debugName: "gutterDblClickDuration" } : /* istanbul ignore next */ {},
200
+ transform: (v) => getInputPositiveNumber(v, 0)
201
+ });
202
+ dragStart = output();
203
+ dragEnd = output();
204
+ gutterClick = output();
205
+ gutterDblClick = output();
206
+ transitionEnd = output();
207
+ transitionEndSubject = new Subject();
208
+ dragProgressSubject = new Subject();
209
+ dragProgress$ = this.dragProgressSubject.asObservable();
210
+ isDragging = signal(false, ...ngDevMode ? [{ debugName: "isDragging" }] : /* istanbul ignore next */ []);
211
+ dragListeners = [];
212
+ snapshot = null;
213
+ startPoint = null;
214
+ endPoint = null;
215
+ displayedAreas = [];
216
+ hidedAreas = [];
217
+ gutterEls = viewChildren("gutterEls", ...ngDevMode ? [{ debugName: "gutterEls" }] : /* istanbul ignore next */ []);
218
+ isDraggingSignal = this.isDragging.asReadonly();
219
+ isDraggingPublic = this.isDragging.asReadonly();
220
+ isInitSignal = this.isInit.asReadonly();
221
+ constructor() {
222
+ this.transitionEndSubject.pipe(debounceTime$1(20)).subscribe((sizes) => {
223
+ this.transitionEnd.emit(sizes);
224
+ });
225
+ effect(() => {
226
+ this.direction();
227
+ this.cdRef.markForCheck();
228
+ this.build(false, false);
229
+ });
230
+ effect(() => {
231
+ this.unit();
232
+ this.cdRef.markForCheck();
233
+ this.build(false, true);
234
+ });
235
+ effect(() => {
236
+ this.gutterSize();
237
+ this.build(false, false);
238
+ });
239
+ effect(() => {
240
+ this.useTransition();
241
+ this.cdRef.markForCheck();
242
+ });
243
+ effect(() => {
244
+ this.disabled();
245
+ this.cdRef.markForCheck();
246
+ });
247
+ effect(() => {
248
+ this.renderer.setAttribute(this.elRef.nativeElement, "dir", this.dir());
249
+ });
250
+ }
251
+ ngAfterViewInit() {
252
+ this.ngZone.runOutsideAngular(() => {
253
+ setTimeout(() => {
254
+ this.isInit.set(true);
255
+ this.cdRef.markForCheck();
256
+ });
257
+ });
258
+ }
259
+ getNbGutters() {
260
+ return this.displayedAreas.length === 0 ? 0 : this.displayedAreas.length - 1;
261
+ }
262
+ addArea(component) {
263
+ const newArea = {
264
+ component,
265
+ order: 0,
266
+ size: 0,
267
+ minSize: null,
268
+ maxSize: null
269
+ };
270
+ if (component.isVisible() === true) {
271
+ this.displayedAreas.push(newArea);
272
+ this.build(true, true);
273
+ } else this.hidedAreas.push(newArea);
274
+ }
275
+ removeArea(component) {
276
+ if (this.displayedAreas.some((a) => a.component === component)) {
277
+ const area = this.displayedAreas.find((a) => a.component === component);
278
+ this.displayedAreas.splice(this.displayedAreas.indexOf(area), 1);
279
+ this.build(true, true);
280
+ } else if (this.hidedAreas.some((a) => a.component === component)) {
281
+ const area = this.hidedAreas.find((a) => a.component === component);
282
+ this.hidedAreas.splice(this.hidedAreas.indexOf(area), 1);
283
+ }
284
+ }
285
+ updateArea(component, resetOrders, resetSizes) {
286
+ if (component.isVisible() === true) this.build(resetOrders, resetSizes);
287
+ }
288
+ updateAreaInternal(component) {
289
+ const area = this.displayedAreas.find((a) => a.component === component);
290
+ if (area) area.size = component.getSize();
291
+ }
292
+ showArea(component) {
293
+ const area = this.hidedAreas.find((a) => a.component === component);
294
+ if (area === void 0) return;
295
+ const areas = this.hidedAreas.splice(this.hidedAreas.indexOf(area), 1);
296
+ this.displayedAreas.push(...areas);
297
+ this.build(true, true);
298
+ }
299
+ hideArea(comp) {
300
+ const area = this.displayedAreas.find((a) => a.component === comp);
301
+ if (area === void 0) return;
302
+ const areas = this.displayedAreas.splice(this.displayedAreas.indexOf(area), 1);
303
+ areas.forEach((_area) => {
304
+ _area.order = 0;
305
+ _area.size = 0;
306
+ });
307
+ this.hidedAreas.push(...areas);
308
+ this.build(true, true);
309
+ }
310
+ getVisibleAreaSizes() {
311
+ return this.displayedAreas.map((a) => a.size === null ? "*" : a.size);
312
+ }
313
+ setVisibleAreaSizes(sizes) {
314
+ if (sizes.length !== this.displayedAreas.length) return false;
315
+ const formatedSizes = sizes.map((s) => getInputPositiveNumber(s, null));
316
+ if (isUserSizesValid(this.unit(), formatedSizes) === false) return false;
317
+ this.displayedAreas.forEach((area, i) => area.component.setSize(formatedSizes[i]));
318
+ this.build(false, true);
319
+ return true;
320
+ }
321
+ build(resetOrders, resetSizes) {
322
+ if (resetOrders === true) {
323
+ if (this.displayedAreas.every((a) => a.component.getOrder() !== null)) this.displayedAreas.sort((a, b) => a.component.getOrder() - b.component.getOrder());
324
+ this.displayedAreas.forEach((area, i) => {
325
+ area.order = i * 2;
326
+ area.component.setStyleOrder(area.order);
327
+ });
328
+ }
329
+ if (resetSizes === true) {
330
+ const useUserSizes = isUserSizesValid(this.unit(), this.displayedAreas.map((a) => a.component.getSize()));
331
+ switch (this.unit()) {
332
+ case "percent": {
333
+ const defaultSize = 100 / this.displayedAreas.length;
334
+ this.displayedAreas.forEach((area) => {
335
+ area.size = useUserSizes ? area.component.getSize() : defaultSize;
336
+ area.minSize = getAreaMinSize(area);
337
+ area.maxSize = getAreaMaxSize(area);
338
+ });
339
+ break;
340
+ }
341
+ case "pixel": if (useUserSizes) this.displayedAreas.forEach((area) => {
342
+ area.size = area.component.getSize();
343
+ area.minSize = getAreaMinSize(area);
344
+ area.maxSize = getAreaMaxSize(area);
345
+ });
346
+ else {
347
+ const wildcardSizeAreas = this.displayedAreas.filter((a) => a.component.getSize() === null);
348
+ if (wildcardSizeAreas.length === 0 && this.displayedAreas.length > 0) this.displayedAreas.forEach((area, i) => {
349
+ area.size = i === 0 ? null : area.component.getSize();
350
+ area.minSize = i === 0 ? null : getAreaMinSize(area);
351
+ area.maxSize = i === 0 ? null : getAreaMaxSize(area);
352
+ });
353
+ else if (wildcardSizeAreas.length > 1) {
354
+ let alreadyGotOne = false;
355
+ this.displayedAreas.forEach((area) => {
356
+ if (area.component.getSize() === null) {
357
+ if (alreadyGotOne === false) {
358
+ area.size = null;
359
+ area.minSize = null;
360
+ area.maxSize = null;
361
+ alreadyGotOne = true;
362
+ } else {
363
+ area.size = 100;
364
+ area.minSize = null;
365
+ area.maxSize = null;
366
+ }
367
+ } else {
368
+ area.size = area.component.getSize();
369
+ area.minSize = getAreaMinSize(area);
370
+ area.maxSize = getAreaMaxSize(area);
371
+ }
372
+ });
373
+ }
374
+ }
375
+ }
376
+ }
377
+ this.refreshStyleSizes();
378
+ this.cdRef.markForCheck();
379
+ }
380
+ refreshStyleSizes() {
381
+ if (this.unit() === "percent") {
382
+ if (this.displayedAreas.length === 1) this.displayedAreas[0].component.setStyleFlex(0, 0, `100%`, false, false);
383
+ else {
384
+ const sumGutterSize = this.getNbGutters() * this.gutterSize();
385
+ this.displayedAreas.forEach((area) => {
386
+ area.component.setStyleFlex(0, 0, `calc( ${area.size}% - ${area.size / 100 * sumGutterSize}px )`, area.minSize !== null && area.minSize === area.size ? true : false, area.maxSize !== null && area.maxSize === area.size ? true : false);
387
+ });
388
+ }
389
+ } else if (this.unit() === "pixel") this.displayedAreas.forEach((area) => {
390
+ if (area.size === null) {
391
+ if (this.displayedAreas.length === 1) area.component.setStyleFlex(1, 1, `100%`, false, false);
392
+ else area.component.setStyleFlex(1, 1, `auto`, false, false);
393
+ } else if (this.displayedAreas.length === 1) area.component.setStyleFlex(0, 0, `100%`, false, false);
394
+ else area.component.setStyleFlex(0, 0, `${area.size}px`, area.minSize !== null && area.minSize === area.size ? true : false, area.maxSize !== null && area.maxSize === area.size ? true : false);
395
+ });
396
+ }
397
+ _clickTimeout = null;
398
+ clickGutter(event, gutterNum) {
399
+ const tempPoint = getPointFromEvent(event);
400
+ if (this.startPoint && this.startPoint.x === tempPoint.x && this.startPoint.y === tempPoint.y) {
401
+ if (this._clickTimeout !== null) {
402
+ window.clearTimeout(this._clickTimeout);
403
+ this._clickTimeout = null;
404
+ this.notify("dblclick", gutterNum);
405
+ this.stopDragging();
406
+ } else this._clickTimeout = window.setTimeout(() => {
407
+ this._clickTimeout = null;
408
+ this.notify("click", gutterNum);
409
+ this.stopDragging();
410
+ }, this.gutterDblClickDuration());
411
+ }
412
+ }
413
+ startDragging(event, gutterOrder, gutterNum) {
414
+ if (event.cancelable) event.preventDefault();
415
+ event.stopPropagation();
416
+ this.startPoint = getPointFromEvent(event);
417
+ if (this.startPoint === null || this.disabled() === true) return;
418
+ this.isDragging.set(true);
419
+ this.cdRef.markForCheck();
420
+ this.snapshot = {
421
+ gutterNum,
422
+ lastSteppedOffset: 0,
423
+ allAreasSizePixel: getElementPixelSize(this.elRef, this.direction()) - this.getNbGutters() * this.gutterSize(),
424
+ allInvolvedAreasSizePercent: 100,
425
+ areasBeforeGutter: [],
426
+ areasAfterGutter: []
427
+ };
428
+ this.displayedAreas.forEach((area) => {
429
+ const areaSnapshot = {
430
+ area,
431
+ sizePixelAtStart: getElementPixelSize(area.component.elRef, this.direction()),
432
+ sizePercentAtStart: this.unit() === "percent" ? area.size : -1
433
+ };
434
+ if (area.order < gutterOrder) {
435
+ if (this.restrictMove() === true) this.snapshot.areasBeforeGutter = [areaSnapshot];
436
+ else this.snapshot.areasBeforeGutter.unshift(areaSnapshot);
437
+ } else if (area.order > gutterOrder) {
438
+ if (this.restrictMove() === true) {
439
+ if (this.snapshot.areasAfterGutter.length === 0) this.snapshot.areasAfterGutter = [areaSnapshot];
440
+ } else this.snapshot.areasAfterGutter.push(areaSnapshot);
441
+ }
442
+ });
443
+ this.snapshot.allInvolvedAreasSizePercent = [...this.snapshot.areasBeforeGutter, ...this.snapshot.areasAfterGutter].reduce((t, a) => t + (a.sizePercentAtStart > 0 ? a.sizePercentAtStart : 0), 0);
444
+ if (this.snapshot.areasBeforeGutter.length === 0 || this.snapshot.areasAfterGutter.length === 0) return;
445
+ this.dragListeners.push(this.renderer.listen("document", "mouseup", this.stopDragging.bind(this)));
446
+ this.dragListeners.push(this.renderer.listen("document", "touchend", this.stopDragging.bind(this)));
447
+ this.dragListeners.push(this.renderer.listen("document", "touchcancel", this.stopDragging.bind(this)));
448
+ this.ngZone.runOutsideAngular(() => {
449
+ this.dragListeners.push(this.renderer.listen("document", "mousemove", this.dragEvent.bind(this)));
450
+ this.dragListeners.push(this.renderer.listen("document", "touchmove", this.dragEvent.bind(this)));
451
+ });
452
+ this.displayedAreas.forEach((area) => area.component.lockEvents());
453
+ this.isDragging.set(true);
454
+ this.renderer.addClass(this.elRef.nativeElement, "ngs-dragging");
455
+ this.renderer.addClass(this.gutterEls()[this.snapshot.gutterNum - 1].nativeElement, "ngs-dragged");
456
+ this.notify("start", this.snapshot.gutterNum);
457
+ }
458
+ dragEvent(event) {
459
+ if (event.cancelable) event.preventDefault();
460
+ event.stopPropagation();
461
+ if (this._clickTimeout !== null) {
462
+ window.clearTimeout(this._clickTimeout);
463
+ this._clickTimeout = null;
464
+ }
465
+ if (this.isDragging() === false) return;
466
+ this.endPoint = getPointFromEvent(event);
467
+ if (this.endPoint === null) return;
468
+ let offset = this.direction() === "horizontal" ? this.startPoint.x - this.endPoint.x : this.startPoint.y - this.endPoint.y;
469
+ if (this.dir() === "rtl" && this.direction() === "horizontal") offset = -offset;
470
+ const steppedOffset = Math.round(offset / this.gutterStep()) * this.gutterStep();
471
+ if (steppedOffset === this.snapshot.lastSteppedOffset) return;
472
+ this.snapshot.lastSteppedOffset = steppedOffset;
473
+ let areasBefore = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasBeforeGutter, -steppedOffset, this.snapshot.allAreasSizePixel);
474
+ let areasAfter = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasAfterGutter, steppedOffset, this.snapshot.allAreasSizePixel);
475
+ if (areasBefore.remain !== 0 && areasAfter.remain !== 0) {
476
+ if (Math.abs(areasBefore.remain) === Math.abs(areasAfter.remain)) {} else if (Math.abs(areasBefore.remain) > Math.abs(areasAfter.remain)) areasAfter = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasAfterGutter, steppedOffset + areasBefore.remain, this.snapshot.allAreasSizePixel);
477
+ else areasBefore = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasBeforeGutter, -(steppedOffset - areasAfter.remain), this.snapshot.allAreasSizePixel);
478
+ } else if (areasBefore.remain !== 0) areasAfter = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasAfterGutter, steppedOffset + areasBefore.remain, this.snapshot.allAreasSizePixel);
479
+ else if (areasAfter.remain !== 0) areasBefore = getGutterSideAbsorptionCapacity(this.unit(), this.snapshot.areasBeforeGutter, -(steppedOffset - areasAfter.remain), this.snapshot.allAreasSizePixel);
480
+ if (this.unit() === "percent") {
481
+ const all = [...areasBefore.list, ...areasAfter.list];
482
+ const areaToReset = all.find((a) => a.percentAfterAbsorption !== 0 && a.percentAfterAbsorption !== a.areaSnapshot.area.minSize && a.percentAfterAbsorption !== a.areaSnapshot.area.maxSize);
483
+ if (areaToReset) areaToReset.percentAfterAbsorption = this.snapshot.allInvolvedAreasSizePercent - all.filter((a) => a !== areaToReset).reduce((total, a) => total + a.percentAfterAbsorption, 0);
484
+ }
485
+ areasBefore.list.forEach((item) => updateAreaSize(this.unit(), item));
486
+ areasAfter.list.forEach((item) => updateAreaSize(this.unit(), item));
487
+ this.refreshStyleSizes();
488
+ this.notify("progress", this.snapshot.gutterNum);
489
+ }
490
+ stopDragging(event) {
491
+ if (event && event.cancelable) {
492
+ event.preventDefault();
493
+ event.stopPropagation();
494
+ }
495
+ if (this.isDragging() === false) return;
496
+ this.displayedAreas.forEach((area) => area.component.unlockEvents());
497
+ while (this.dragListeners.length > 0) {
498
+ const fct = this.dragListeners.pop();
499
+ if (fct) fct();
500
+ }
501
+ this.isDragging.set(false);
502
+ this.cdRef.markForCheck();
503
+ if (this.endPoint && (this.startPoint.x !== this.endPoint.x || this.startPoint.y !== this.endPoint.y)) this.notify("end", this.snapshot.gutterNum);
504
+ this.renderer.removeClass(this.elRef.nativeElement, "ngs-dragging");
505
+ this.renderer.removeClass(this.gutterEls()[this.snapshot.gutterNum - 1].nativeElement, "ngs-dragged");
506
+ this.snapshot = null;
507
+ this.ngZone.runOutsideAngular(() => {
508
+ setTimeout(() => {
509
+ this.startPoint = null;
510
+ this.endPoint = null;
511
+ });
512
+ });
513
+ }
514
+ notify(type, gutterNum) {
515
+ const sizes = this.getVisibleAreaSizes();
516
+ if (type === "start") this.dragStart.emit({
517
+ gutterNum,
518
+ sizes
519
+ });
520
+ else if (type === "end") this.dragEnd.emit({
521
+ gutterNum,
522
+ sizes
523
+ });
524
+ else if (type === "click") this.gutterClick.emit({
525
+ gutterNum,
526
+ sizes
527
+ });
528
+ else if (type === "dblclick") this.gutterDblClick.emit({
529
+ gutterNum,
530
+ sizes
531
+ });
532
+ else if (type === "transitionEnd") this.ngZone.run(() => this.transitionEndSubject.next(sizes));
533
+ else if (type === "progress") this.dragProgressSubject.next({
534
+ gutterNum,
535
+ sizes
536
+ });
537
+ }
538
+ ngOnDestroy() {
539
+ this.stopDragging();
540
+ }
541
+ static ɵfac = i0.ɵɵngDeclareFactory({
542
+ minVersion: "12.0.0",
543
+ version: "22.3.0",
544
+ ngImport: i0,
545
+ type: Split,
546
+ deps: [],
547
+ target: i0.ɵɵFactoryTarget.Component
548
+ });
549
+ static ɵcmp = i0.ɵɵngDeclareComponent({
550
+ minVersion: "17.0.0",
551
+ version: "22.3.0",
552
+ type: Split,
553
+ isStandalone: true,
554
+ selector: "ngs-split",
555
+ inputs: {
556
+ direction: {
557
+ classPropertyName: "direction",
558
+ publicName: "direction",
559
+ isSignal: true,
560
+ isRequired: false,
561
+ transformFunction: null
562
+ },
563
+ unit: {
564
+ classPropertyName: "unit",
565
+ publicName: "unit",
566
+ isSignal: true,
567
+ isRequired: false,
568
+ transformFunction: null
569
+ },
570
+ gutterSize: {
571
+ classPropertyName: "gutterSize",
572
+ publicName: "gutterSize",
573
+ isSignal: true,
574
+ isRequired: false,
575
+ transformFunction: null
576
+ },
577
+ gutterStep: {
578
+ classPropertyName: "gutterStep",
579
+ publicName: "gutterStep",
580
+ isSignal: true,
581
+ isRequired: false,
582
+ transformFunction: null
583
+ },
584
+ restrictMove: {
585
+ classPropertyName: "restrictMove",
586
+ publicName: "restrictMove",
587
+ isSignal: true,
588
+ isRequired: false,
589
+ transformFunction: null
590
+ },
591
+ useTransition: {
592
+ classPropertyName: "useTransition",
593
+ publicName: "useTransition",
594
+ isSignal: true,
595
+ isRequired: false,
596
+ transformFunction: null
597
+ },
598
+ disabled: {
599
+ classPropertyName: "disabled",
600
+ publicName: "disabled",
601
+ isSignal: true,
602
+ isRequired: false,
603
+ transformFunction: null
604
+ },
605
+ dir: {
606
+ classPropertyName: "dir",
607
+ publicName: "dir",
608
+ isSignal: true,
609
+ isRequired: false,
610
+ transformFunction: null
611
+ },
612
+ gutterDblClickDuration: {
613
+ classPropertyName: "gutterDblClickDuration",
614
+ publicName: "gutterDblClickDuration",
615
+ isSignal: true,
616
+ isRequired: false,
617
+ transformFunction: null
618
+ }
619
+ },
620
+ outputs: {
621
+ dragStart: "dragStart",
622
+ dragEnd: "dragEnd",
623
+ gutterClick: "gutterClick",
624
+ gutterDblClick: "gutterDblClick",
625
+ transitionEnd: "transitionEnd"
626
+ },
627
+ host: {
628
+ properties: {
629
+ "class.ngs-split-horizontal": "direction() === \"horizontal\"",
630
+ "class.ngs-split-vertical": "direction() === \"vertical\"",
631
+ "class.ngs-split-percent": "unit() === \"percent\"",
632
+ "class.ngs-split-pixel": "unit() === \"pixel\"",
633
+ "class.ngs-split-disabled": "disabled()",
634
+ "class.ngs-split-transition": "useTransition()",
635
+ "class.ngs-dragging": "isDraggingSignal()",
636
+ "class.ngs-split-init": "isInitSignal()"
637
+ },
638
+ classAttribute: "ngs-split"
639
+ },
640
+ viewQueries: [{
641
+ propertyName: "gutterEls",
642
+ predicate: ["gutterEls"],
643
+ descendants: true,
644
+ isSignal: true
645
+ }],
646
+ exportAs: ["ngsSplit"],
647
+ ngImport: i0,
648
+ template: "<ng-content/>\n@for (area of displayedAreas; track area; let index = $index; let last = $last) {\n @if (!last) {\n <div\n #gutterEls\n class=\"ngs-split-gutter\"\n [style.flex-basis.px]=\"gutterSize()\"\n [style.order]=\"index * 2 + 1\"\n (mousedown)=\"startDragging($event, index * 2 + 1, index + 1)\"\n (touchstart)=\"startDragging($event, index * 2 + 1, index + 1)\"\n (mouseup)=\"clickGutter($event, index + 1)\"\n (touchend)=\"clickGutter($event, index + 1)\"\n >\n <div class=\"ngs-split-gutter-handle\" [class.has-dots]=\"shouldShowHandle(index)\">\n @if (shouldShowHandle(index)) {\n <div class=\"ngs-split-gutter-dot\"></div>\n <div class=\"ngs-split-gutter-dot\"></div>\n <div class=\"ngs-split-gutter-dot\"></div>\n }\n </div>\n </div>\n }\n}\n",
649
+ styles: [":host{--ngs-split-gutter-size: 5px;--ngs-split-handle-size: 10px;--ngs-split-handle-offset: calc((var(--ngs-split-handle-size) - var(--ngs-split-gutter-size)) * .5);--ngs-split-gutter-bg: var(--ngs-color-surface-container-high);--ngs-split-gutter-hover-bg: var(--ngs-color-primary);display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;overflow:hidden;width:100%;height:100%}:host ::ng-deep>.ngs-split-gutter{position:relative;display:flex;flex-grow:0;flex-shrink:0;align-items:center;justify-content:center;background-color:transparent;z-index:10}:host ::ng-deep>.ngs-split-gutter:before{content:\"\";position:absolute;background-color:var(--ngs-split-gutter-bg);transition:background-color .2s}:host ::ng-deep>.ngs-split-gutter:hover:before{background-color:var(--ngs-split-gutter-hover-bg)}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{position:absolute;opacity:0;display:flex;align-items:center;justify-content:center}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle.has-dots{opacity:1}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle .ngs-split-gutter-dot{width:2px;height:2px;border-radius:50%;background-color:var(--ngs-color-on-surface)}:host ::ng-deep>.ngs-split-pane{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;min-width:0;min-height:0;overflow:hidden auto}:host ::ng-deep>.ngs-split-pane.ngs-dragging{-webkit-user-select:none;user-select:none}:host ::ng-deep>.ngs-split-pane>*{flex-shrink:0}:host ::ng-deep>.ngs-split-pane.ngs-split-pane-hidden{flex:0 1 0!important;overflow:hidden}:host.ngs-split-horizontal{flex-direction:row}:host.ngs-split-horizontal.ngs-dragging{cursor:col-resize}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter{flex-direction:row;height:100%;width:var(--ngs-split-gutter-size);cursor:col-resize}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter:before{width:100%;height:100%;top:0;left:0}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{width:var(--ngs-split-handle-size);height:100%;left:calc(-1 * var(--ngs-split-handle-offset));flex-direction:column;gap:2px}:host.ngs-split-horizontal ::ng-deep>.ngs-split-pane{height:100%;min-height:0}:host.ngs-split-vertical{flex-direction:column}:host.ngs-split-vertical.ngs-dragging{cursor:row-resize}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter{flex-direction:column;width:100%;height:var(--ngs-split-gutter-size);cursor:row-resize}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter:before{width:100%;height:100%;top:0;left:0}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{width:100%;height:var(--ngs-split-handle-size);top:calc(-1 * var(--ngs-split-handle-offset));flex-direction:row;gap:3px}:host.ngs-split-vertical ::ng-deep>.ngs-split-pane{width:100%;min-width:0}:host.ngs-split-vertical ::ng-deep>.ngs-split-pane.ngs-split-pane-hidden{max-width:0}:host.ngs-split-disabled ::ng-deep>.ngs-split-gutter{cursor:default}:host.ngs-split-disabled ::ng-deep>.ngs-split-gutter .ngs-split-gutter-handle{background-image:none}:host.ngs-split-transition.ngs-split-init:not(.ngs-dragging) ::ng-deep>.ngs-split-gutter,:host.ngs-split-transition.ngs-split-init:not(.ngs-dragging) ::ng-deep>.ngs-split-pane{transition:flex-basis .3s}\n"],
650
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
651
+ });
652
+ };
653
+ i0.ɵɵngDeclareClassMetadata({
654
+ minVersion: "12.0.0",
655
+ version: "22.3.0",
656
+ ngImport: i0,
657
+ type: Split,
658
+ decorators: [{
659
+ type: Component,
660
+ args: [{
661
+ selector: "ngs-split",
662
+ exportAs: "ngsSplit",
663
+ standalone: true,
664
+ imports: [],
665
+ changeDetection: ChangeDetectionStrategy.OnPush,
666
+ host: {
667
+ class: "ngs-split",
668
+ "[class.ngs-split-horizontal]": "direction() === \"horizontal\"",
669
+ "[class.ngs-split-vertical]": "direction() === \"vertical\"",
670
+ "[class.ngs-split-percent]": "unit() === \"percent\"",
671
+ "[class.ngs-split-pixel]": "unit() === \"pixel\"",
672
+ "[class.ngs-split-disabled]": "disabled()",
673
+ "[class.ngs-split-transition]": "useTransition()",
674
+ "[class.ngs-dragging]": "isDraggingSignal()",
675
+ "[class.ngs-split-init]": "isInitSignal()"
676
+ },
677
+ template: "<ng-content/>\n@for (area of displayedAreas; track area; let index = $index; let last = $last) {\n @if (!last) {\n <div\n #gutterEls\n class=\"ngs-split-gutter\"\n [style.flex-basis.px]=\"gutterSize()\"\n [style.order]=\"index * 2 + 1\"\n (mousedown)=\"startDragging($event, index * 2 + 1, index + 1)\"\n (touchstart)=\"startDragging($event, index * 2 + 1, index + 1)\"\n (mouseup)=\"clickGutter($event, index + 1)\"\n (touchend)=\"clickGutter($event, index + 1)\"\n >\n <div class=\"ngs-split-gutter-handle\" [class.has-dots]=\"shouldShowHandle(index)\">\n @if (shouldShowHandle(index)) {\n <div class=\"ngs-split-gutter-dot\"></div>\n <div class=\"ngs-split-gutter-dot\"></div>\n <div class=\"ngs-split-gutter-dot\"></div>\n }\n </div>\n </div>\n }\n}\n",
678
+ styles: [":host{--ngs-split-gutter-size: 5px;--ngs-split-handle-size: 10px;--ngs-split-handle-offset: calc((var(--ngs-split-handle-size) - var(--ngs-split-gutter-size)) * .5);--ngs-split-gutter-bg: var(--ngs-color-surface-container-high);--ngs-split-gutter-hover-bg: var(--ngs-color-primary);display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;overflow:hidden;width:100%;height:100%}:host ::ng-deep>.ngs-split-gutter{position:relative;display:flex;flex-grow:0;flex-shrink:0;align-items:center;justify-content:center;background-color:transparent;z-index:10}:host ::ng-deep>.ngs-split-gutter:before{content:\"\";position:absolute;background-color:var(--ngs-split-gutter-bg);transition:background-color .2s}:host ::ng-deep>.ngs-split-gutter:hover:before{background-color:var(--ngs-split-gutter-hover-bg)}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{position:absolute;opacity:0;display:flex;align-items:center;justify-content:center}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle.has-dots{opacity:1}:host ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle .ngs-split-gutter-dot{width:2px;height:2px;border-radius:50%;background-color:var(--ngs-color-on-surface)}:host ::ng-deep>.ngs-split-pane{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;min-width:0;min-height:0;overflow:hidden auto}:host ::ng-deep>.ngs-split-pane.ngs-dragging{-webkit-user-select:none;user-select:none}:host ::ng-deep>.ngs-split-pane>*{flex-shrink:0}:host ::ng-deep>.ngs-split-pane.ngs-split-pane-hidden{flex:0 1 0!important;overflow:hidden}:host.ngs-split-horizontal{flex-direction:row}:host.ngs-split-horizontal.ngs-dragging{cursor:col-resize}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter{flex-direction:row;height:100%;width:var(--ngs-split-gutter-size);cursor:col-resize}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter:before{width:100%;height:100%;top:0;left:0}:host.ngs-split-horizontal ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{width:var(--ngs-split-handle-size);height:100%;left:calc(-1 * var(--ngs-split-handle-offset));flex-direction:column;gap:2px}:host.ngs-split-horizontal ::ng-deep>.ngs-split-pane{height:100%;min-height:0}:host.ngs-split-vertical{flex-direction:column}:host.ngs-split-vertical.ngs-dragging{cursor:row-resize}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter{flex-direction:column;width:100%;height:var(--ngs-split-gutter-size);cursor:row-resize}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter:before{width:100%;height:100%;top:0;left:0}:host.ngs-split-vertical ::ng-deep>.ngs-split-gutter>.ngs-split-gutter-handle{width:100%;height:var(--ngs-split-handle-size);top:calc(-1 * var(--ngs-split-handle-offset));flex-direction:row;gap:3px}:host.ngs-split-vertical ::ng-deep>.ngs-split-pane{width:100%;min-width:0}:host.ngs-split-vertical ::ng-deep>.ngs-split-pane.ngs-split-pane-hidden{max-width:0}:host.ngs-split-disabled ::ng-deep>.ngs-split-gutter{cursor:default}:host.ngs-split-disabled ::ng-deep>.ngs-split-gutter .ngs-split-gutter-handle{background-image:none}:host.ngs-split-transition.ngs-split-init:not(.ngs-dragging) ::ng-deep>.ngs-split-gutter,:host.ngs-split-transition.ngs-split-init:not(.ngs-dragging) ::ng-deep>.ngs-split-pane{transition:flex-basis .3s}\n"]
679
+ }]
680
+ }],
681
+ ctorParameters: () => [],
682
+ propDecorators: {
683
+ direction: [{
684
+ type: i0.Input,
685
+ args: [{
686
+ isSignal: true,
687
+ alias: "direction",
688
+ required: false
689
+ }]
690
+ }],
691
+ unit: [{
692
+ type: i0.Input,
693
+ args: [{
694
+ isSignal: true,
695
+ alias: "unit",
696
+ required: false
697
+ }]
698
+ }],
699
+ gutterSize: [{
700
+ type: i0.Input,
701
+ args: [{
702
+ isSignal: true,
703
+ alias: "gutterSize",
704
+ required: false
705
+ }]
706
+ }],
707
+ gutterStep: [{
708
+ type: i0.Input,
709
+ args: [{
710
+ isSignal: true,
711
+ alias: "gutterStep",
712
+ required: false
713
+ }]
714
+ }],
715
+ restrictMove: [{
716
+ type: i0.Input,
717
+ args: [{
718
+ isSignal: true,
719
+ alias: "restrictMove",
720
+ required: false
721
+ }]
722
+ }],
723
+ useTransition: [{
724
+ type: i0.Input,
725
+ args: [{
726
+ isSignal: true,
727
+ alias: "useTransition",
728
+ required: false
729
+ }]
730
+ }],
731
+ disabled: [{
732
+ type: i0.Input,
733
+ args: [{
734
+ isSignal: true,
735
+ alias: "disabled",
736
+ required: false
737
+ }]
738
+ }],
739
+ dir: [{
740
+ type: i0.Input,
741
+ args: [{
742
+ isSignal: true,
743
+ alias: "dir",
744
+ required: false
745
+ }]
746
+ }],
747
+ gutterDblClickDuration: [{
748
+ type: i0.Input,
749
+ args: [{
750
+ isSignal: true,
751
+ alias: "gutterDblClickDuration",
752
+ required: false
753
+ }]
754
+ }],
755
+ dragStart: [{
756
+ type: i0.Output,
757
+ args: ["dragStart"]
758
+ }],
759
+ dragEnd: [{
760
+ type: i0.Output,
761
+ args: ["dragEnd"]
762
+ }],
763
+ gutterClick: [{
764
+ type: i0.Output,
765
+ args: ["gutterClick"]
766
+ }],
767
+ gutterDblClick: [{
768
+ type: i0.Output,
769
+ args: ["gutterDblClick"]
770
+ }],
771
+ transitionEnd: [{
772
+ type: i0.Output,
773
+ args: ["transitionEnd"]
774
+ }],
775
+ gutterEls: [{
776
+ type: i0.ViewChildren,
777
+ args: ["gutterEls", { isSignal: true }]
778
+ }]
779
+ }
780
+ });
781
+ var SplitPane = class SplitPane {
782
+ ngZone = inject(NgZone);
783
+ renderer = inject(Renderer2);
784
+ split = inject(Split);
785
+ elRef = inject(ElementRef);
786
+ orderIn = input(null, {
787
+ ...ngDevMode ? { debugName: "orderIn" } : /* istanbul ignore next */ {},
788
+ alias: "order",
789
+ transform: (v) => getInputPositiveNumber(v, null)
790
+ });
791
+ sizeIn = input(null, {
792
+ ...ngDevMode ? { debugName: "sizeIn" } : /* istanbul ignore next */ {},
793
+ alias: "size",
794
+ transform: (v) => getInputPositiveNumber(v, null)
795
+ });
796
+ minSizeIn = input(null, {
797
+ ...ngDevMode ? { debugName: "minSizeIn" } : /* istanbul ignore next */ {},
798
+ alias: "minSize",
799
+ transform: (v) => getInputPositiveNumber(v, null)
800
+ });
801
+ maxSizeIn = input(null, {
802
+ ...ngDevMode ? { debugName: "maxSizeIn" } : /* istanbul ignore next */ {},
803
+ alias: "maxSize",
804
+ transform: (v) => getInputPositiveNumber(v, null)
805
+ });
806
+ lockSizeIn = input(false, {
807
+ ...ngDevMode ? { debugName: "lockSizeIn" } : /* istanbul ignore next */ {},
808
+ alias: "lockSize",
809
+ transform: booleanAttribute
810
+ });
811
+ visibleIn = input(true, {
812
+ ...ngDevMode ? { debugName: "visibleIn" } : /* istanbul ignore next */ {},
813
+ alias: "visible",
814
+ transform: booleanAttribute
815
+ });
816
+ withHandleIn = input(false, {
817
+ ...ngDevMode ? { debugName: "withHandleIn" } : /* istanbul ignore next */ {},
818
+ alias: "withHandle",
819
+ transform: booleanAttribute
820
+ });
821
+ orderSig = signal(null, {
822
+ ...ngDevMode ? { debugName: "orderSig" } : /* istanbul ignore next */ {},
823
+ equal: Object.is
824
+ });
825
+ sizeSig = signal(null, {
826
+ ...ngDevMode ? { debugName: "sizeSig" } : /* istanbul ignore next */ {},
827
+ equal: Object.is
828
+ });
829
+ minSizeSig = signal(null, {
830
+ ...ngDevMode ? { debugName: "minSizeSig" } : /* istanbul ignore next */ {},
831
+ equal: Object.is
832
+ });
833
+ maxSizeSig = signal(null, {
834
+ ...ngDevMode ? { debugName: "maxSizeSig" } : /* istanbul ignore next */ {},
835
+ equal: Object.is
836
+ });
837
+ lockSizeSig = signal(false, {
838
+ ...ngDevMode ? { debugName: "lockSizeSig" } : /* istanbul ignore next */ {},
839
+ equal: Object.is
840
+ });
841
+ visibleSig = signal(true, {
842
+ ...ngDevMode ? { debugName: "visibleSig" } : /* istanbul ignore next */ {},
843
+ equal: Object.is
844
+ });
845
+ withHandleSig = signal(false, {
846
+ ...ngDevMode ? { debugName: "withHandleSig" } : /* istanbul ignore next */ {},
847
+ equal: Object.is
848
+ });
849
+ transitionListener;
850
+ lockListeners = [];
851
+ constructor() {
852
+ this.renderer.addClass(this.elRef.nativeElement, "ngs-split-pane");
853
+ this.split.addArea(this);
854
+ this.ngZone.runOutsideAngular(() => {
855
+ this.transitionListener = this.renderer.listen(this.elRef.nativeElement, "transitionend", (event) => {
856
+ if (event.propertyName === "flex-basis") this.split.notify("transitionEnd", -1);
857
+ });
858
+ });
859
+ effect(() => this.orderSig.set(this.orderIn()));
860
+ effect(() => this.sizeSig.set(this.sizeIn()));
861
+ effect(() => this.minSizeSig.set(this.minSizeIn()));
862
+ effect(() => this.maxSizeSig.set(this.maxSizeIn()));
863
+ effect(() => this.lockSizeSig.set(this.lockSizeIn()));
864
+ effect(() => this.withHandleSig.set(this.withHandleIn()));
865
+ effect(() => {
866
+ const isVisible = this.visibleIn();
867
+ this.visibleSig.set(isVisible);
868
+ if (isVisible) {
869
+ this.split.showArea(this);
870
+ this.renderer.removeClass(this.elRef.nativeElement, "ngs-split-pane-hidden");
871
+ } else {
872
+ this.split.hideArea(this);
873
+ this.renderer.addClass(this.elRef.nativeElement, "ngs-split-pane-hidden");
874
+ }
875
+ });
876
+ effect(() => {
877
+ this.orderSig();
878
+ if (!this.split.isDraggingPublic()) this.split.updateArea(this, true, false);
879
+ });
880
+ effect(() => {
881
+ this.sizeSig();
882
+ this.minSizeSig();
883
+ this.maxSizeSig();
884
+ this.lockSizeSig();
885
+ if (!this.split.isDraggingPublic()) this.split.updateArea(this, false, true);
886
+ });
887
+ effect(() => {
888
+ this.withHandleSig();
889
+ if (!this.split.isDraggingPublic()) this.split.updateArea(this, false, false);
890
+ });
891
+ }
892
+ getOrder() {
893
+ return this.orderSig();
894
+ }
895
+ getSize() {
896
+ return this.sizeSig();
897
+ }
898
+ setSize(v) {
899
+ this.sizeSig.set(v);
900
+ this.split.updateAreaInternal(this);
901
+ }
902
+ getMinSize() {
903
+ return this.minSizeSig();
904
+ }
905
+ getMaxSize() {
906
+ return this.maxSizeSig();
907
+ }
908
+ isLocked() {
909
+ return this.lockSizeSig();
910
+ }
911
+ isVisible() {
912
+ return this.visibleSig();
913
+ }
914
+ hasHandle() {
915
+ return this.withHandleSig();
916
+ }
917
+ setStyleOrder(value) {
918
+ this.renderer.setStyle(this.elRef.nativeElement, "order", value);
919
+ }
920
+ setStyleFlex(grow, shrink, basis, isMin, isMax) {
921
+ this.renderer.setStyle(this.elRef.nativeElement, "flex-grow", grow);
922
+ this.renderer.setStyle(this.elRef.nativeElement, "flex-shrink", shrink);
923
+ this.renderer.setStyle(this.elRef.nativeElement, "flex-basis", basis);
924
+ if (basis === "0px" || basis === "0%") this.renderer.setStyle(this.elRef.nativeElement, "overflow", "hidden");
925
+ else this.renderer.removeStyle(this.elRef.nativeElement, "overflow");
926
+ if (isMin === true) this.renderer.addClass(this.elRef.nativeElement, "ngs-min");
927
+ else this.renderer.removeClass(this.elRef.nativeElement, "ngs-min");
928
+ if (isMax === true) this.renderer.addClass(this.elRef.nativeElement, "ngs-max");
929
+ else this.renderer.removeClass(this.elRef.nativeElement, "ngs-max");
930
+ }
931
+ lockEvents() {
932
+ this.ngZone.runOutsideAngular(() => {
933
+ this.lockListeners.push(this.renderer.listen(this.elRef.nativeElement, "selectstart", (e) => false));
934
+ this.lockListeners.push(this.renderer.listen(this.elRef.nativeElement, "dragstart", (e) => false));
935
+ });
936
+ }
937
+ unlockEvents() {
938
+ while (this.lockListeners.length > 0) {
939
+ const fct = this.lockListeners.pop();
940
+ if (fct) fct();
941
+ }
942
+ }
943
+ ngOnDestroy() {
944
+ this.unlockEvents();
945
+ if (this.transitionListener) this.transitionListener();
946
+ this.split.removeArea(this);
947
+ }
948
+ static ɵfac = i0.ɵɵngDeclareFactory({
949
+ minVersion: "12.0.0",
950
+ version: "22.3.0",
951
+ ngImport: i0,
952
+ type: SplitPane,
953
+ deps: [],
954
+ target: i0.ɵɵFactoryTarget.Directive
955
+ });
956
+ static ɵdir = i0.ɵɵngDeclareDirective({
957
+ minVersion: "17.1.0",
958
+ version: "22.3.0",
959
+ type: SplitPane,
960
+ isStandalone: true,
961
+ selector: "ngs-split-pane, [ngs-split-pane]",
962
+ inputs: {
963
+ orderIn: {
964
+ classPropertyName: "orderIn",
965
+ publicName: "order",
966
+ isSignal: true,
967
+ isRequired: false,
968
+ transformFunction: null
969
+ },
970
+ sizeIn: {
971
+ classPropertyName: "sizeIn",
972
+ publicName: "size",
973
+ isSignal: true,
974
+ isRequired: false,
975
+ transformFunction: null
976
+ },
977
+ minSizeIn: {
978
+ classPropertyName: "minSizeIn",
979
+ publicName: "minSize",
980
+ isSignal: true,
981
+ isRequired: false,
982
+ transformFunction: null
983
+ },
984
+ maxSizeIn: {
985
+ classPropertyName: "maxSizeIn",
986
+ publicName: "maxSize",
987
+ isSignal: true,
988
+ isRequired: false,
989
+ transformFunction: null
990
+ },
991
+ lockSizeIn: {
992
+ classPropertyName: "lockSizeIn",
993
+ publicName: "lockSize",
994
+ isSignal: true,
995
+ isRequired: false,
996
+ transformFunction: null
997
+ },
998
+ visibleIn: {
999
+ classPropertyName: "visibleIn",
1000
+ publicName: "visible",
1001
+ isSignal: true,
1002
+ isRequired: false,
1003
+ transformFunction: null
1004
+ },
1005
+ withHandleIn: {
1006
+ classPropertyName: "withHandleIn",
1007
+ publicName: "withHandle",
1008
+ isSignal: true,
1009
+ isRequired: false,
1010
+ transformFunction: null
1011
+ }
1012
+ },
1013
+ exportAs: ["ngsSplitPane"],
1014
+ ngImport: i0
1015
+ });
1016
+ };
1017
+ i0.ɵɵngDeclareClassMetadata({
1018
+ minVersion: "12.0.0",
1019
+ version: "22.3.0",
1020
+ ngImport: i0,
1021
+ type: SplitPane,
1022
+ decorators: [{
1023
+ type: Directive,
1024
+ args: [{
1025
+ selector: "ngs-split-pane, [ngs-split-pane]",
1026
+ exportAs: "ngsSplitPane",
1027
+ standalone: true
1028
+ }]
1029
+ }],
1030
+ ctorParameters: () => [],
1031
+ propDecorators: {
1032
+ orderIn: [{
1033
+ type: i0.Input,
1034
+ args: [{
1035
+ isSignal: true,
1036
+ alias: "order",
1037
+ required: false
1038
+ }]
1039
+ }],
1040
+ sizeIn: [{
1041
+ type: i0.Input,
1042
+ args: [{
1043
+ isSignal: true,
1044
+ alias: "size",
1045
+ required: false
1046
+ }]
1047
+ }],
1048
+ minSizeIn: [{
1049
+ type: i0.Input,
1050
+ args: [{
1051
+ isSignal: true,
1052
+ alias: "minSize",
1053
+ required: false
1054
+ }]
1055
+ }],
1056
+ maxSizeIn: [{
1057
+ type: i0.Input,
1058
+ args: [{
1059
+ isSignal: true,
1060
+ alias: "maxSize",
1061
+ required: false
1062
+ }]
1063
+ }],
1064
+ lockSizeIn: [{
1065
+ type: i0.Input,
1066
+ args: [{
1067
+ isSignal: true,
1068
+ alias: "lockSize",
1069
+ required: false
1070
+ }]
1071
+ }],
1072
+ visibleIn: [{
1073
+ type: i0.Input,
1074
+ args: [{
1075
+ isSignal: true,
1076
+ alias: "visible",
1077
+ required: false
1078
+ }]
1079
+ }],
1080
+ withHandleIn: [{
1081
+ type: i0.Input,
1082
+ args: [{
1083
+ isSignal: true,
1084
+ alias: "withHandle",
1085
+ required: false
1086
+ }]
1087
+ }]
1088
+ }
1089
+ });
953
1090
  export { SPLIT_DEFAULT_OPTIONS, Split, SplitPane, getAreaAbsorptionCapacity, getAreaAbsorptionCapacityPercent, getAreaAbsorptionCapacityPixel, getAreaMaxSize, getAreaMinSize, getElementPixelSize, getGutterSideAbsorptionCapacity, getInputPositiveNumber, getPointFromEvent, isUserSizesValid, provideSplit, updateAreaSize };
954
- //# sourceMappingURL=ngstarter-ui-components-split.mjs.map
1091
+
1092
+ //# sourceMappingURL=ngstarter-ui-components-split.mjs.map