@ngstarter-ui/components 22.3.6 → 22.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/README.md +27 -0
  2. package/ai/component-registry.json +186 -101
  3. package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
  4. package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
  5. package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
  6. package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
  7. package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
  8. package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
  9. package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
  10. package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
  11. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
  12. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
  13. package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
  14. package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
  15. package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
  16. package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
  17. package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
  18. package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
  19. package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
  20. package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
  21. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
  22. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
  23. package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
  24. package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
  25. package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
  26. package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
  27. package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
  28. package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
  29. package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
  30. package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
  31. package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
  32. package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
  33. package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
  34. package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
  35. package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
  36. package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
  37. package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
  38. package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
  39. package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
  40. package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
  41. package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
  42. package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
  43. package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
  44. package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
  45. package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
  46. package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
  47. package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
  48. package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
  49. package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
  50. package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
  51. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
  52. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
  53. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
  54. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
  55. package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
  56. package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
  57. package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
  58. package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
  59. package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
  60. package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
  61. package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
  62. package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
  63. package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
  64. package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
  65. package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
  66. package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
  67. package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
  68. package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
  70. package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
  71. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
  72. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
  73. package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
  74. package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
  75. package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
  76. package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
  77. package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
  78. package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
  79. package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
  80. package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
  81. package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
  82. package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
  83. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
  84. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
  85. package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
  86. package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
  87. package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
  88. package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
  89. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
  90. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
  91. package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
  92. package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
  93. package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
  94. package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
  95. package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
  96. package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
  97. package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
  98. package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
  99. package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
  100. package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
  101. package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
  102. package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
  103. package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
  104. package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
  105. package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
  106. package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
  107. package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
  108. package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
  109. package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
  110. package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
  111. package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
  112. package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
  113. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
  114. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
  115. package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
  116. package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
  117. package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
  118. package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
  119. package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
  120. package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
  121. package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
  122. package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
  123. package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
  124. package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
  125. package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
  126. package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
  127. package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
  128. package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
  129. package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
  130. package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
  131. package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
  132. package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
  133. package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
  134. package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
  135. package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
  136. package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
  137. package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
  138. package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
  139. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
  140. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
  141. package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
  142. package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
  143. package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
  144. package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
  145. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
  146. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
  147. package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
  148. package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
  149. package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
  150. package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
  151. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
  152. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
  153. package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
  154. package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
  155. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
  156. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
  157. package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
  158. package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
  159. package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
  160. package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
  161. package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
  162. package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
  163. package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
  164. package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
  165. package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
  166. package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
  167. package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
  168. package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
  169. package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
  170. package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
  171. package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
  172. package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
  173. package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
  174. package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
  175. package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
  176. package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
  177. package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
  178. package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
  179. package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
  180. package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
  181. package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
  182. package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
  183. package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
  184. package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
  185. package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
  186. package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
  187. package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
  188. package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
  189. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
  190. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
  191. package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
  192. package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
  193. package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
  194. package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
  195. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
  196. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
  197. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
  198. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
  199. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
  200. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
  201. package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
  202. package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
  203. package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
  204. package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
  205. package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
  206. package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
  207. package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
  208. package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
  209. package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
  210. package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
  211. package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
  212. package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
  213. package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
  214. package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
  215. package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
  216. package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
  217. package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
  218. package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
  219. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
  220. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
  221. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
  222. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
  223. package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
  224. package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
  225. package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
  226. package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
  227. package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
  228. package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
  229. package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
  230. package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
  231. package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
  232. package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
  233. package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
  234. package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
  235. package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
  236. package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
  237. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
  238. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
  239. package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
  240. package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
  241. package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
  242. package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
  243. package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
  244. package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
  245. package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
  246. package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
  247. package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
  248. package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
  249. package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
  250. package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
  251. package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
  252. package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
  253. package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
  254. package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
  255. package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
  256. package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
  257. package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
  258. package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
  259. package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
  260. package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
  261. package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
  262. package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
  263. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
  264. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
  265. package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
  266. package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
  267. package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
  268. package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
  269. package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
  270. package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
  271. package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
  272. package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
  273. package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
  274. package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
  275. package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
  276. package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
  277. package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
  278. package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
  279. package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
  280. package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
  281. package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
  282. package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
  283. package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
  284. package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
  285. package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
  286. package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
  287. package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
  288. package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
  289. package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
  290. package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
  291. package/fesm2022/ngstarter-ui-components.mjs +3 -5
  292. package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
  293. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
  294. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
  295. package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
  296. package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
  297. package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
  298. package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
  299. package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
  300. package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
  301. package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
  302. package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
  303. package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
  304. package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
  305. package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
  306. package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
  307. package/package.json +11 -10
  308. package/styles/_tokens.scss +1 -0
  309. package/types/ngstarter-ui-components-action-required.d.ts +34 -14
  310. package/types/ngstarter-ui-components-alert.d.ts +53 -44
  311. package/types/ngstarter-ui-components-announcement.d.ts +74 -53
  312. package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
  313. package/types/ngstarter-ui-components-avatar.d.ts +113 -66
  314. package/types/ngstarter-ui-components-badge.d.ts +73 -37
  315. package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
  316. package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
  317. package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
  318. package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
  319. package/types/ngstarter-ui-components-button.d.ts +69 -27
  320. package/types/ngstarter-ui-components-calendar.d.ts +123 -71
  321. package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
  322. package/types/ngstarter-ui-components-card.d.ts +75 -71
  323. package/types/ngstarter-ui-components-carousel.d.ts +115 -69
  324. package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
  325. package/types/ngstarter-ui-components-chips.d.ts +288 -195
  326. package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
  327. package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
  328. package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
  329. package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
  330. package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
  331. package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
  332. package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
  333. package/types/ngstarter-ui-components-confirm.d.ts +24 -29
  334. package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
  335. package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
  336. package/types/ngstarter-ui-components-core.d.ts +513 -467
  337. package/types/ngstarter-ui-components-country-select.d.ts +170 -97
  338. package/types/ngstarter-ui-components-crop.d.ts +67 -52
  339. package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
  340. package/types/ngstarter-ui-components-data-view.d.ts +811 -567
  341. package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
  342. package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
  343. package/types/ngstarter-ui-components-dialog.d.ts +138 -116
  344. package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
  345. package/types/ngstarter-ui-components-divider.d.ts +29 -17
  346. package/types/ngstarter-ui-components-drawer.d.ts +39 -30
  347. package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
  348. package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
  349. package/types/ngstarter-ui-components-events.d.ts +73 -57
  350. package/types/ngstarter-ui-components-expand.d.ts +55 -25
  351. package/types/ngstarter-ui-components-expansion.d.ts +93 -64
  352. package/types/ngstarter-ui-components-file-type.d.ts +53 -27
  353. package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
  354. package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
  355. package/types/ngstarter-ui-components-form-field.d.ts +116 -105
  356. package/types/ngstarter-ui-components-gauge.d.ts +32 -20
  357. package/types/ngstarter-ui-components-grid.d.ts +66 -50
  358. package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
  359. package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
  360. package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
  361. package/types/ngstarter-ui-components-icon.d.ts +39 -38
  362. package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
  363. package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
  364. package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
  365. package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
  366. package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
  367. package/types/ngstarter-ui-components-incidents.d.ts +97 -104
  368. package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
  369. package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
  370. package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
  371. package/types/ngstarter-ui-components-input.d.ts +82 -54
  372. package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
  373. package/types/ngstarter-ui-components-kbd.d.ts +8 -12
  374. package/types/ngstarter-ui-components-layout.d.ts +131 -87
  375. package/types/ngstarter-ui-components-list.d.ts +123 -88
  376. package/types/ngstarter-ui-components-logo.d.ts +21 -21
  377. package/types/ngstarter-ui-components-marquee.d.ts +41 -34
  378. package/types/ngstarter-ui-components-menu.d.ts +329 -221
  379. package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
  380. package/types/ngstarter-ui-components-navigation.d.ts +186 -125
  381. package/types/ngstarter-ui-components-notifications.d.ts +104 -89
  382. package/types/ngstarter-ui-components-number-input.d.ts +138 -96
  383. package/types/ngstarter-ui-components-option.d.ts +102 -68
  384. package/types/ngstarter-ui-components-overlay.d.ts +7 -12
  385. package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
  386. package/types/ngstarter-ui-components-paginator.d.ts +171 -129
  387. package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
  388. package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
  389. package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
  390. package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
  391. package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
  392. package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
  393. package/types/ngstarter-ui-components-popover.d.ts +128 -89
  394. package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
  395. package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
  396. package/types/ngstarter-ui-components-radio.d.ts +100 -47
  397. package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
  398. package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
  399. package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
  400. package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
  401. package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
  402. package/types/ngstarter-ui-components-segmented.d.ts +93 -61
  403. package/types/ngstarter-ui-components-select.d.ts +366 -266
  404. package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
  405. package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
  406. package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
  407. package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
  408. package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
  409. package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
  410. package/types/ngstarter-ui-components-slider.d.ts +123 -82
  411. package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
  412. package/types/ngstarter-ui-components-sort.d.ts +99 -63
  413. package/types/ngstarter-ui-components-spinner.d.ts +49 -27
  414. package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
  415. package/types/ngstarter-ui-components-split.d.ts +276 -195
  416. package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
  417. package/types/ngstarter-ui-components-stepper.d.ts +57 -43
  418. package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
  419. package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
  420. package/types/ngstarter-ui-components-table.d.ts +256 -228
  421. package/types/ngstarter-ui-components-tabs.d.ts +231 -138
  422. package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
  423. package/types/ngstarter-ui-components-tiles.d.ts +166 -104
  424. package/types/ngstarter-ui-components-timeline.d.ts +45 -57
  425. package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
  426. package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
  427. package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
  428. package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
  429. package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
  430. package/types/ngstarter-ui-components-tree.d.ts +355 -229
  431. package/types/ngstarter-ui-components-upload.d.ts +216 -131
  432. package/types/ngstarter-ui-components-video-player.d.ts +130 -67
  433. package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
  434. package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
  435. package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
  436. package/types/ngstarter-ui-components.d.ts +2 -2
  437. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs +0 -35
  438. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs.map +0 -1
  439. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs +0 -26
  440. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs.map +0 -1
  441. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs +0 -220
  442. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs.map +0 -1
  443. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
  444. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
  445. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
  446. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
  447. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs +0 -375
  448. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs.map +0 -1
  449. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs +0 -80
  450. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs.map +0 -1
  451. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs +0 -65
  452. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs.map +0 -1
  453. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs +0 -137
  454. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs.map +0 -1
  455. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs +0 -113
  456. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs.map +0 -1
  457. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs +0 -188
  458. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs.map +0 -1
  459. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs +0 -117
  460. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs.map +0 -1
  461. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs +0 -4464
  462. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs.map +0 -1
  463. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs +0 -132
  464. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs.map +0 -1
  465. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs +0 -171
  466. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs.map +0 -1
  467. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs +0 -1653
  468. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs.map +0 -1
  469. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs +0 -20
  470. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs.map +0 -1
  471. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
  472. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
  473. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs +0 -134
  474. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs.map +0 -1
  475. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
  476. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
@@ -1,946 +1,1544 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, Renderer2, ViewContainerRef, Injector, DOCUMENT, PLATFORM_ID, DestroyRef, ElementRef, input, numberAttribute, booleanAttribute, effect, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { isPlatformServer } from '@angular/common';
4
- import { curveStep, curveBumpX, curveCatmullRom, curveLinear, select, scalePoint, min, max, scaleLinear, area, line, pointer, scaleBand, arc, pie, scaleOrdinal, schemeTableau10, interpolate } from 'd3';
5
- import { fromEvent } from 'rxjs';
6
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
- import { TemplatePortal } from '@angular/cdk/portal';
8
- import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
9
- import { PositionManager } from '@ngstarter-ui/components/overlay';
10
-
11
- class BaseChartTooltip {
12
- _tooltipOrigin;
13
- _tooltipPortal;
14
- _overlayRef;
15
- _renderer = inject(Renderer2);
16
- _overlay = inject(Overlay);
17
- _viewContainerRef = inject(ViewContainerRef);
18
- _injector = inject(Injector);
19
- _document = inject(DOCUMENT);
20
- _createTooltipOrigin() {
21
- let tooltipOrigin = this._document.querySelector('.ngs-mchart-tooltip-origin');
22
- if (!tooltipOrigin) {
23
- tooltipOrigin = this._renderer.createElement('div');
24
- tooltipOrigin.classList.add('ngs-mchart-tooltip-origin');
25
- this._renderer.appendChild(this._document.body, tooltipOrigin);
26
- }
27
- this._tooltipOrigin = tooltipOrigin;
28
- this._renderer.setStyle(this._tooltipOrigin, 'width', '0');
29
- this._renderer.setStyle(this._tooltipOrigin, 'height', '0');
30
- this._renderer.setStyle(this._tooltipOrigin, 'z-index', '-1');
31
- this._renderer.setStyle(this._tooltipOrigin, 'position', 'fixed');
32
- this._renderer.setStyle(this._tooltipOrigin, 'opacity', '0');
33
- }
34
- _showTooltip(data) {
35
- this._overlayRef?.detach();
36
- this._overlayRef = this._overlay.create(this._getOverlayConfig());
37
- this._overlayRef.attach(this._getContentPortal(data));
38
- }
39
- _hideTooltip() {
40
- this._overlayRef?.detach();
41
- }
42
- _setTooltipPositionByEvent(e) {
43
- const gap = 10;
44
- this._renderer.setStyle(this._tooltipOrigin, 'left', (e.clientX - gap) + 'px');
45
- this._renderer.setStyle(this._tooltipOrigin, 'top', (e.clientY) + 'px');
46
- this._renderer.setStyle(this._tooltipOrigin, 'width', (gap * 2) + 'px');
47
- }
48
- _setTooltipVisible() {
49
- this._renderer.addClass(this._tooltipOrigin, 'is-visible');
50
- }
51
- _setTooltipInVisible() {
52
- this._renderer.removeClass(this._tooltipOrigin, 'is-visible');
53
- }
54
- _getContentPortal(data) {
55
- this._tooltipPortal = new TemplatePortal(this.getTooltipTemplateRef(), this._viewContainerRef, {
56
- '$implicit': {
57
- ...data
58
- }
59
- }, this._injector);
60
- return this._tooltipPortal;
61
- }
62
- _getOverlayConfig() {
63
- return new OverlayConfig({
64
- panelClass: 'ngs-mchart-tooltip-overlay',
65
- positionStrategy: this._getOverlayPositionStrategy(),
66
- scrollStrategy: this._overlay.scrollStrategies.reposition()
67
- });
68
- }
69
- _getOverlayPositionStrategy() {
70
- return this._overlay
71
- .position()
72
- .flexibleConnectedTo(this._tooltipOrigin)
73
- .withFlexibleDimensions()
74
- .withGrowAfterOpen()
75
- .withPositions(this._getOverlayPositions());
76
- }
77
- _getOverlayPositions() {
78
- return (new PositionManager()).build(this.getTooltipPosition());
79
- }
80
- }
81
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, ElementRef, Injector, PLATFORM_ID, Renderer2, ViewContainerRef, booleanAttribute, effect, inject, input, numberAttribute } from "@angular/core";
3
+ import { isPlatformServer } from "@angular/common";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ import { Overlay, OverlayConfig } from "@angular/cdk/overlay";
6
+ import { TemplatePortal } from "@angular/cdk/portal";
7
+ import { fromEvent } from "rxjs";
8
+ import { PositionManager } from "@ngstarter-ui/components/overlay";
9
+ import { arc, area, curveBumpX, curveCatmullRom, curveLinear, curveStep, interpolate, line, max, min, pie, pointer, scaleBand, scaleLinear, scaleOrdinal, scalePoint, schemeTableau10, select } from "d3";
10
+ var BaseChartTooltip = class {
11
+ _tooltipOrigin;
12
+ _tooltipPortal;
13
+ _overlayRef;
14
+ _renderer = inject(Renderer2);
15
+ _overlay = inject(Overlay);
16
+ _viewContainerRef = inject(ViewContainerRef);
17
+ _injector = inject(Injector);
18
+ _document = inject(DOCUMENT);
19
+ _createTooltipOrigin() {
20
+ let tooltipOrigin = this._document.querySelector(".ngs-mchart-tooltip-origin");
21
+ if (!tooltipOrigin) {
22
+ tooltipOrigin = this._renderer.createElement("div");
23
+ tooltipOrigin.classList.add("ngs-mchart-tooltip-origin");
24
+ this._renderer.appendChild(this._document.body, tooltipOrigin);
25
+ }
26
+ this._tooltipOrigin = tooltipOrigin;
27
+ this._renderer.setStyle(this._tooltipOrigin, "width", "0");
28
+ this._renderer.setStyle(this._tooltipOrigin, "height", "0");
29
+ this._renderer.setStyle(this._tooltipOrigin, "z-index", "-1");
30
+ this._renderer.setStyle(this._tooltipOrigin, "position", "fixed");
31
+ this._renderer.setStyle(this._tooltipOrigin, "opacity", "0");
32
+ }
33
+ _showTooltip(data) {
34
+ this._overlayRef?.detach();
35
+ this._overlayRef = this._overlay.create(this._getOverlayConfig());
36
+ this._overlayRef.attach(this._getContentPortal(data));
37
+ }
38
+ _hideTooltip() {
39
+ this._overlayRef?.detach();
40
+ }
41
+ _setTooltipPositionByEvent(e) {
42
+ this._renderer.setStyle(this._tooltipOrigin, "left", e.clientX - 10 + "px");
43
+ this._renderer.setStyle(this._tooltipOrigin, "top", e.clientY + "px");
44
+ this._renderer.setStyle(this._tooltipOrigin, "width", "20px");
45
+ }
46
+ _setTooltipVisible() {
47
+ this._renderer.addClass(this._tooltipOrigin, "is-visible");
48
+ }
49
+ _setTooltipInVisible() {
50
+ this._renderer.removeClass(this._tooltipOrigin, "is-visible");
51
+ }
52
+ _getContentPortal(data) {
53
+ this._tooltipPortal = new TemplatePortal(this.getTooltipTemplateRef(), this._viewContainerRef, { "$implicit": { ...data } }, this._injector);
54
+ return this._tooltipPortal;
55
+ }
56
+ _getOverlayConfig() {
57
+ return new OverlayConfig({
58
+ panelClass: "ngs-mchart-tooltip-overlay",
59
+ positionStrategy: this._getOverlayPositionStrategy(),
60
+ scrollStrategy: this._overlay.scrollStrategies.reposition()
61
+ });
62
+ }
63
+ _getOverlayPositionStrategy() {
64
+ return this._overlay.position().flexibleConnectedTo(this._tooltipOrigin).withFlexibleDimensions().withGrowAfterOpen().withPositions(this._getOverlayPositions());
65
+ }
66
+ _getOverlayPositions() {
67
+ return new PositionManager().build(this.getTooltipPosition());
68
+ }
69
+ };
82
70
  let nextId$1 = 0;
83
- class MchartLine extends BaseChartTooltip {
84
- _initialized = false;
85
- _host;
86
- _svg;
87
- _dimensions;
88
- _hostWidth = 0;
89
- _hostHeight = 0;
90
- _innerWidth = 0;
91
- _innerHeight = 0;
92
- _yScale;
93
- _xScale;
94
- _curveMap = {
95
- 'linear': curveLinear,
96
- 'catmullRom': curveCatmullRom,
97
- 'curveBumpX': curveBumpX,
98
- 'curveStep': curveStep
99
- };
100
- _resizeObserver;
101
- _tooltipDot;
102
- _area;
103
- _line;
104
- _platformId = inject(PLATFORM_ID);
105
- _destroyRef = inject(DestroyRef);
106
- _elementRef = inject(ElementRef);
107
- data = input([], /* @ts-ignore */
108
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
109
- labels = input([], /* @ts-ignore */
110
- ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
111
- strokeWidth = input(2, { ...(ngDevMode ? { debugName: "strokeWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
112
- showArea = input(false, { ...(ngDevMode ? { debugName: "showArea" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
113
- showMarkers = input(false, { ...(ngDevMode ? { debugName: "showMarkers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
114
- responsive = input(false, { ...(ngDevMode ? { debugName: "responsive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
115
- fillAreaGradient = input(false, { ...(ngDevMode ? { debugName: "fillAreaGradient" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
116
- curve = input('linear', /* @ts-ignore */
117
- ...(ngDevMode ? [{ debugName: "curve" }] : /* istanbul ignore next */ []));
118
- xAccessor = input((d, i) => i, /* @ts-ignore */
119
- ...(ngDevMode ? [{ debugName: "xAccessor" }] : /* istanbul ignore next */ []));
120
- yAccessor = input((d) => d, /* @ts-ignore */
121
- ...(ngDevMode ? [{ debugName: "yAccessor" }] : /* istanbul ignore next */ []));
122
- compact = input(false, { ...(ngDevMode ? { debugName: "compact" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
123
- markerDotSize = input(5, { ...(ngDevMode ? { debugName: "markerDotSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
124
- tooltip = input(/* @ts-ignore */
125
- ...(ngDevMode ? [undefined, { debugName: "tooltip" }] : /* istanbul ignore next */ []));
126
- tooltipPosition = input('after-center', /* @ts-ignore */
127
- ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
128
- _currentTooltipPosition = 'after-center';
129
- get gradientId() {
130
- return 'areaGradient' + this._gradientId;
131
- }
132
- _gradientId = nextId$1++;
133
- constructor() {
134
- super();
135
- effect(() => {
136
- this._currentTooltipPosition = this.tooltipPosition();
137
- });
138
- effect(() => {
139
- if (!this._initialized) {
140
- return;
141
- }
142
- this._render();
143
- });
144
- }
145
- ngAfterViewChecked() {
146
- if (isPlatformServer(this._platformId)) {
147
- return;
148
- }
149
- if (!this._initialized) {
150
- const element = this._elementRef.nativeElement;
151
- this._dimensions = element.getBoundingClientRect();
152
- if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
153
- this._initialized = true;
154
- this._render();
155
- this._setupResizeObserver();
156
- }
157
- }
158
- }
159
- ngOnDestroy() {
160
- this._resizeObserver?.disconnect();
161
- }
162
- getTooltipPosition() {
163
- return this._currentTooltipPosition;
164
- }
165
- getTooltipTemplateRef() {
166
- return this.tooltip();
167
- }
168
- _render() {
169
- this._setupContainers();
170
- this._setupData();
171
- }
172
- _setupContainers() {
173
- this._hostWidth = this._dimensions.width;
174
- this._hostHeight = this._dimensions.height;
175
- this._innerWidth = this._dimensions.width;
176
- this._innerHeight = this._dimensions.height;
177
- this._host = select(this._elementRef.nativeElement);
178
- this._svg = this._host
179
- .select('svg')
180
- .attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
181
- if (this.tooltip()) {
182
- this._tooltipDot = this._renderer.createElement('div');
183
- this._renderer.setStyle(this._tooltipDot, 'width', '10px');
184
- this._renderer.setStyle(this._tooltipDot, 'height', '10px');
185
- this._renderer.setStyle(this._tooltipDot, 'z-index', '-1');
186
- this._renderer.setStyle(this._tooltipDot, 'position', 'fixed');
187
- this._renderer.setStyle(this._tooltipDot, 'opacity', '0');
188
- this._renderer.appendChild(this._document.body, this._tooltipDot);
189
- }
190
- }
191
- _setupData(isUpdate = false) {
192
- let markerDotSize = this.markerDotSize();
193
- if (!this.showMarkers()) {
194
- markerDotSize = this.strokeWidth();
195
- }
196
- const xAccessor = this.xAccessor();
197
- const yAccessor = this.yAccessor();
198
- const xDomain = this.data().map((d, i) => xAccessor(d, i));
199
- if (!this._xScale) {
200
- this._xScale = scalePoint().domain(xDomain);
201
- }
202
- this._xScale.range([markerDotSize, this._innerWidth - markerDotSize]);
203
- const yDomain = [
204
- this.compact() ? min(this.data().map(d => yAccessor(d))) : 0,
205
- max(this.data().map(d => yAccessor(d)))
206
- ];
207
- if (!this._yScale) {
208
- this._yScale = scaleLinear()
209
- .domain(yDomain);
210
- }
211
- this._yScale.range([this._innerHeight - markerDotSize, markerDotSize]);
212
- if (this.showArea()) {
213
- const areaGenerator = area()
214
- .x((d, i) => this._xScale(xAccessor(d, i)))
215
- .y1((d) => this._yScale(yAccessor(d)))
216
- .y0(this._innerHeight - markerDotSize)
217
- .curve(this._curveMap[this.curve()]);
218
- if (!this._area) {
219
- // add area
220
- this._area = this._svg
221
- .append('path')
222
- .datum(this.data())
223
- .attr('d', areaGenerator)
224
- .attr('class', 'area');
225
- if (this.fillAreaGradient()) {
226
- this._area.attr('fill', `url(#${this.gradientId})`);
227
- }
228
- }
229
- else {
230
- this._area.attr('d', areaGenerator);
231
- }
232
- }
233
- const lineGenerator = line()
234
- .x((d, i) => this._xScale(xAccessor(d, i)))
235
- .y((d) => this._yScale(yAccessor(d)));
236
- if (!this._line) {
237
- // add line
238
- this._line = this._svg
239
- .append('path')
240
- .datum(this.data())
241
- .attr('d', lineGenerator.curve(this._curveMap[this.curve()]))
242
- .attr('class', 'line')
243
- .attr('stroke-width', this.strokeWidth());
244
- }
245
- else {
246
- this._line.attr('d', lineGenerator.curve(this._curveMap[this.curve()]));
247
- }
248
- if (isUpdate) {
249
- return;
250
- }
251
- if (this.showMarkers() || this.tooltip()) {
252
- const markerLine = this._svg
253
- .append('line')
254
- .attr('x1', 0)
255
- .attr('x2', 0)
256
- .attr('y1', 0)
257
- .attr('y2', this._innerHeight - markerDotSize)
258
- .attr('opacity', 0)
259
- .attr('class', 'marker-line');
260
- const markerDot = this._svg
261
- .append('circle')
262
- .attr('cx', 0)
263
- .attr('cy', 0)
264
- .attr('r', markerDotSize)
265
- .attr('opacity', 0)
266
- .attr('class', 'marker-dot');
267
- let x = 0;
268
- let y = 0;
269
- let label;
270
- let value;
271
- if (this.tooltip()) {
272
- this._createTooltipOrigin();
273
- }
274
- fromEvent(this._document, 'mousemove')
275
- .pipe(takeUntilDestroyed(this._destroyRef))
276
- .subscribe((e) => {
277
- const target = e.target;
278
- const oldXPosition = +markerDot.attr('cx');
279
- const pointerCoords = pointer(e, this._svg.node());
280
- const [posX, posY] = pointerCoords;
281
- let visible = true;
282
- if (posX < this.markerDotSize() || posY < this.markerDotSize() || posX > this._hostWidth || posY > this._hostHeight) {
283
- visible = false;
284
- this._overlayRef?.detach();
285
- markerLine.attr('opacity', 0);
286
- markerDot.attr('opacity', 0);
287
- }
288
- else {
289
- if (target.closest('.ngs-mchart-line') ||
290
- target.classList.contains('ngs-mchart-tooltip-overlay') ||
291
- target.closest('.ngs-mchart-tooltip-overlay')) {
292
- if (this.showMarkers()) {
293
- markerLine.attr('opacity', 1);
294
- markerDot.attr('opacity', 1);
295
- }
296
- }
297
- else {
298
- visible = false;
299
- this._overlayRef?.detach();
300
- }
301
- }
302
- const eachBand = this._xScale.step();
303
- const index = Math.round((posX / eachBand));
304
- const dataValue = this.data()[index];
305
- label = this.labels()[index] ? this.labels()[index] : xAccessor(index, index);
306
- value = yAccessor(dataValue);
307
- x = this._xScale(xAccessor(index, index));
308
- y = this._yScale(yAccessor(dataValue));
309
- markerLine
310
- .attr('x1', x)
311
- .attr('x2', x);
312
- markerDot
313
- .attr('cx', x)
314
- .attr('cy', y);
315
- if (this.tooltip()) {
316
- if (posX < this._hostWidth / 2) {
317
- this._currentTooltipPosition = 'after-center';
318
- }
319
- else {
320
- this._currentTooltipPosition = 'before-center';
321
- }
322
- this._setTooltipPositionByEvent(e);
323
- if (visible) {
324
- this._setTooltipVisible();
325
- if (!this._overlayRef?.hasAttached()) {
326
- this._showTooltip({
327
- label,
328
- value
329
- });
330
- }
331
- else {
332
- if (oldXPosition !== x) {
333
- this._showTooltip({
334
- label,
335
- value
336
- });
337
- }
338
- else {
339
- this._overlayRef.updatePositionStrategy(this._getOverlayPositionStrategy());
340
- this._overlayRef.updatePosition();
341
- }
342
- }
343
- }
344
- else {
345
- this._setTooltipInVisible();
346
- }
347
- }
348
- });
349
- }
350
- }
351
- _setupResizeObserver() {
352
- if (!this.responsive()) {
353
- return;
354
- }
355
- this._resizeObserver = new ResizeObserver((entries) => {
356
- if (this._hostWidth !== entries[0].contentRect.width || this._hostHeight !== entries[0].contentRect.height) {
357
- this._hostWidth = entries[0].contentRect.width;
358
- this._hostHeight = entries[0].contentRect.height;
359
- this._innerWidth = entries[0].contentRect.width;
360
- this._innerHeight = entries[0].contentRect.height;
361
- this._svg
362
- .attr("viewBox", `0 0 ${this._hostWidth} ${this._hostHeight}`);
363
- this._setupData(true);
364
- }
365
- });
366
- this._resizeObserver.observe(this._elementRef.nativeElement);
367
- }
368
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartLine, deps: [], target: i0.ɵɵFactoryTarget.Component });
369
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: MchartLine, isStandalone: true, selector: "ngs-mchart-line", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, showArea: { classPropertyName: "showArea", publicName: "showArea", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, fillAreaGradient: { classPropertyName: "fillAreaGradient", publicName: "fillAreaGradient", isSignal: true, isRequired: false, transformFunction: null }, curve: { classPropertyName: "curve", publicName: "curve", isSignal: true, isRequired: false, transformFunction: null }, xAccessor: { classPropertyName: "xAccessor", publicName: "xAccessor", isSignal: true, isRequired: false, transformFunction: null }, yAccessor: { classPropertyName: "yAccessor", publicName: "yAccessor", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, markerDotSize: { classPropertyName: "markerDotSize", publicName: "markerDotSize", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fill-area-gradient": "fillAreaGradient()" }, classAttribute: "ngs-mchart-line" }, exportAs: ["ngsMchartLine"], usesInheritance: true, ngImport: i0, template: "<svg>\n @if (fillAreaGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n</svg>\n", styles: [":host{--ngs-mchart-line-line-bg: var(--ngs-color-primary);--ngs-mchart-line-area-bg: var(--ngs-color-primary-200);--ngs-mchart-line-marker-line-bg: var(--ngs-color-neutral);--ngs-mchart-line-marker-dot-bg: var(--ngs-color-primary);--ngs-mchart-line-area-gradient-start-color: var(--ngs-color-primary);--ngs-mchart-line-area-gradient-end-color: var(--ngs-color-background);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .line{stroke:var(--ngs-mchart-line-line-bg);fill:none;stroke-linejoin:round;stroke-linecap:round}:host ::ng-deep .area{stroke-width:0}:host ::ng-deep .marker-line{stroke:var(--ngs-mchart-line-marker-line-bg);stroke-width:1;stroke-dasharray:3}:host ::ng-deep .marker-dot{fill:var(--ngs-mchart-line-marker-dot-bg)}:host:not(.fill-area-gradient) ::ng-deep .area{fill:var(--ngs-mchart-line-area-bg)}:host.fill-area-gradient .lg-start-color{stop-color:var(--ngs-mchart-line-area-gradient-start-color)}:host.fill-area-gradient .lg-end-color{stop-color:var(--ngs-mchart-line-area-gradient-end-color)}:host-context(html.dark){--ngs-mchart-line-area-bg: var(--ngs-color-neutral-700);--ngs-mchart-line-area-gradient-start-color: var(--ngs-color-neutral-700)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
370
- }
371
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartLine, decorators: [{
372
- type: Component,
373
- args: [{ selector: 'ngs-mchart-line', exportAs: 'ngsMchartLine', changeDetection: ChangeDetectionStrategy.OnPush, host: {
374
- 'class': 'ngs-mchart-line',
375
- '[class.fill-area-gradient]': 'fillAreaGradient()',
376
- }, template: "<svg>\n @if (fillAreaGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n</svg>\n", styles: [":host{--ngs-mchart-line-line-bg: var(--ngs-color-primary);--ngs-mchart-line-area-bg: var(--ngs-color-primary-200);--ngs-mchart-line-marker-line-bg: var(--ngs-color-neutral);--ngs-mchart-line-marker-dot-bg: var(--ngs-color-primary);--ngs-mchart-line-area-gradient-start-color: var(--ngs-color-primary);--ngs-mchart-line-area-gradient-end-color: var(--ngs-color-background);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .line{stroke:var(--ngs-mchart-line-line-bg);fill:none;stroke-linejoin:round;stroke-linecap:round}:host ::ng-deep .area{stroke-width:0}:host ::ng-deep .marker-line{stroke:var(--ngs-mchart-line-marker-line-bg);stroke-width:1;stroke-dasharray:3}:host ::ng-deep .marker-dot{fill:var(--ngs-mchart-line-marker-dot-bg)}:host:not(.fill-area-gradient) ::ng-deep .area{fill:var(--ngs-mchart-line-area-bg)}:host.fill-area-gradient .lg-start-color{stop-color:var(--ngs-mchart-line-area-gradient-start-color)}:host.fill-area-gradient .lg-end-color{stop-color:var(--ngs-mchart-line-area-gradient-end-color)}:host-context(html.dark){--ngs-mchart-line-area-bg: var(--ngs-color-neutral-700);--ngs-mchart-line-area-gradient-start-color: var(--ngs-color-neutral-700)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
377
- }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], showArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArea", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], fillAreaGradient: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillAreaGradient", required: false }] }], curve: [{ type: i0.Input, args: [{ isSignal: true, alias: "curve", required: false }] }], xAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAccessor", required: false }] }], yAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAccessor", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], markerDotSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "markerDotSize", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
378
-
71
+ var MchartLine = class MchartLine extends BaseChartTooltip {
72
+ _initialized = false;
73
+ _host;
74
+ _svg;
75
+ _dimensions;
76
+ _hostWidth = 0;
77
+ _hostHeight = 0;
78
+ _innerWidth = 0;
79
+ _innerHeight = 0;
80
+ _yScale;
81
+ _xScale;
82
+ _curveMap = {
83
+ "linear": curveLinear,
84
+ "catmullRom": curveCatmullRom,
85
+ "curveBumpX": curveBumpX,
86
+ "curveStep": curveStep
87
+ };
88
+ _resizeObserver;
89
+ _tooltipDot;
90
+ _area;
91
+ _line;
92
+ _platformId = inject(PLATFORM_ID);
93
+ _destroyRef = inject(DestroyRef);
94
+ _elementRef = inject(ElementRef);
95
+ data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
96
+ labels = input([], ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
97
+ strokeWidth = input(2, {
98
+ ...ngDevMode ? { debugName: "strokeWidth" } : /* istanbul ignore next */ {},
99
+ transform: numberAttribute
100
+ });
101
+ showArea = input(false, {
102
+ ...ngDevMode ? { debugName: "showArea" } : /* istanbul ignore next */ {},
103
+ transform: booleanAttribute
104
+ });
105
+ showMarkers = input(false, {
106
+ ...ngDevMode ? { debugName: "showMarkers" } : /* istanbul ignore next */ {},
107
+ transform: booleanAttribute
108
+ });
109
+ responsive = input(false, {
110
+ ...ngDevMode ? { debugName: "responsive" } : /* istanbul ignore next */ {},
111
+ transform: booleanAttribute
112
+ });
113
+ fillAreaGradient = input(false, {
114
+ ...ngDevMode ? { debugName: "fillAreaGradient" } : /* istanbul ignore next */ {},
115
+ transform: booleanAttribute
116
+ });
117
+ curve = input("linear", ...ngDevMode ? [{ debugName: "curve" }] : /* istanbul ignore next */ []);
118
+ xAccessor = input((d, i) => i, ...ngDevMode ? [{ debugName: "xAccessor" }] : /* istanbul ignore next */ []);
119
+ yAccessor = input((d) => d, ...ngDevMode ? [{ debugName: "yAccessor" }] : /* istanbul ignore next */ []);
120
+ compact = input(false, {
121
+ ...ngDevMode ? { debugName: "compact" } : /* istanbul ignore next */ {},
122
+ transform: booleanAttribute
123
+ });
124
+ markerDotSize = input(5, {
125
+ ...ngDevMode ? { debugName: "markerDotSize" } : /* istanbul ignore next */ {},
126
+ transform: numberAttribute
127
+ });
128
+ tooltip = input(...ngDevMode ? [void 0, { debugName: "tooltip" }] : /* istanbul ignore next */ []);
129
+ tooltipPosition = input("after-center", ...ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []);
130
+ _currentTooltipPosition = "after-center";
131
+ get gradientId() {
132
+ return "areaGradient" + this._gradientId;
133
+ }
134
+ _gradientId = nextId$1++;
135
+ constructor() {
136
+ super();
137
+ effect(() => {
138
+ this._currentTooltipPosition = this.tooltipPosition();
139
+ });
140
+ effect(() => {
141
+ if (!this._initialized) return;
142
+ this._render();
143
+ });
144
+ }
145
+ ngAfterViewChecked() {
146
+ if (isPlatformServer(this._platformId)) return;
147
+ if (!this._initialized) {
148
+ const element = this._elementRef.nativeElement;
149
+ this._dimensions = element.getBoundingClientRect();
150
+ if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
151
+ this._initialized = true;
152
+ this._render();
153
+ this._setupResizeObserver();
154
+ }
155
+ }
156
+ }
157
+ ngOnDestroy() {
158
+ this._resizeObserver?.disconnect();
159
+ }
160
+ getTooltipPosition() {
161
+ return this._currentTooltipPosition;
162
+ }
163
+ getTooltipTemplateRef() {
164
+ return this.tooltip();
165
+ }
166
+ _render() {
167
+ this._setupContainers();
168
+ this._setupData();
169
+ }
170
+ _setupContainers() {
171
+ this._hostWidth = this._dimensions.width;
172
+ this._hostHeight = this._dimensions.height;
173
+ this._innerWidth = this._dimensions.width;
174
+ this._innerHeight = this._dimensions.height;
175
+ this._host = select(this._elementRef.nativeElement);
176
+ this._svg = this._host.select("svg").attr("viewBox", `0 0 ${this._hostWidth} ${this._hostHeight}`);
177
+ if (this.tooltip()) {
178
+ this._tooltipDot = this._renderer.createElement("div");
179
+ this._renderer.setStyle(this._tooltipDot, "width", "10px");
180
+ this._renderer.setStyle(this._tooltipDot, "height", "10px");
181
+ this._renderer.setStyle(this._tooltipDot, "z-index", "-1");
182
+ this._renderer.setStyle(this._tooltipDot, "position", "fixed");
183
+ this._renderer.setStyle(this._tooltipDot, "opacity", "0");
184
+ this._renderer.appendChild(this._document.body, this._tooltipDot);
185
+ }
186
+ }
187
+ _setupData(isUpdate = false) {
188
+ let markerDotSize = this.markerDotSize();
189
+ if (!this.showMarkers()) markerDotSize = this.strokeWidth();
190
+ const xAccessor = this.xAccessor();
191
+ const yAccessor = this.yAccessor();
192
+ const xDomain = this.data().map((d, i) => xAccessor(d, i));
193
+ if (!this._xScale) this._xScale = scalePoint().domain(xDomain);
194
+ this._xScale.range([markerDotSize, this._innerWidth - markerDotSize]);
195
+ const yDomain = [this.compact() ? min(this.data().map((d) => yAccessor(d))) : 0, max(this.data().map((d) => yAccessor(d)))];
196
+ if (!this._yScale) this._yScale = scaleLinear().domain(yDomain);
197
+ this._yScale.range([this._innerHeight - markerDotSize, markerDotSize]);
198
+ if (this.showArea()) {
199
+ const areaGenerator = area().x((d, i) => this._xScale(xAccessor(d, i))).y1((d) => this._yScale(yAccessor(d))).y0(this._innerHeight - markerDotSize).curve(this._curveMap[this.curve()]);
200
+ if (!this._area) {
201
+ this._area = this._svg.append("path").datum(this.data()).attr("d", areaGenerator).attr("class", "area");
202
+ if (this.fillAreaGradient()) this._area.attr("fill", `url(#${this.gradientId})`);
203
+ } else this._area.attr("d", areaGenerator);
204
+ }
205
+ const lineGenerator = line().x((d, i) => this._xScale(xAccessor(d, i))).y((d) => this._yScale(yAccessor(d)));
206
+ if (!this._line) this._line = this._svg.append("path").datum(this.data()).attr("d", lineGenerator.curve(this._curveMap[this.curve()])).attr("class", "line").attr("stroke-width", this.strokeWidth());
207
+ else this._line.attr("d", lineGenerator.curve(this._curveMap[this.curve()]));
208
+ if (isUpdate) return;
209
+ if (this.showMarkers() || this.tooltip()) {
210
+ const markerLine = this._svg.append("line").attr("x1", 0).attr("x2", 0).attr("y1", 0).attr("y2", this._innerHeight - markerDotSize).attr("opacity", 0).attr("class", "marker-line");
211
+ const markerDot = this._svg.append("circle").attr("cx", 0).attr("cy", 0).attr("r", markerDotSize).attr("opacity", 0).attr("class", "marker-dot");
212
+ let x = 0;
213
+ let y = 0;
214
+ let label;
215
+ let value;
216
+ if (this.tooltip()) this._createTooltipOrigin();
217
+ fromEvent(this._document, "mousemove").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((e) => {
218
+ const target = e.target;
219
+ const oldXPosition = +markerDot.attr("cx");
220
+ const [posX, posY] = pointer(e, this._svg.node());
221
+ let visible = true;
222
+ if (posX < this.markerDotSize() || posY < this.markerDotSize() || posX > this._hostWidth || posY > this._hostHeight) {
223
+ visible = false;
224
+ this._overlayRef?.detach();
225
+ markerLine.attr("opacity", 0);
226
+ markerDot.attr("opacity", 0);
227
+ } else if (target.closest(".ngs-mchart-line") || target.classList.contains("ngs-mchart-tooltip-overlay") || target.closest(".ngs-mchart-tooltip-overlay")) {
228
+ if (this.showMarkers()) {
229
+ markerLine.attr("opacity", 1);
230
+ markerDot.attr("opacity", 1);
231
+ }
232
+ } else {
233
+ visible = false;
234
+ this._overlayRef?.detach();
235
+ }
236
+ const eachBand = this._xScale.step();
237
+ const index = Math.round(posX / eachBand);
238
+ const dataValue = this.data()[index];
239
+ label = this.labels()[index] ? this.labels()[index] : xAccessor(index, index);
240
+ value = yAccessor(dataValue);
241
+ x = this._xScale(xAccessor(index, index));
242
+ y = this._yScale(yAccessor(dataValue));
243
+ markerLine.attr("x1", x).attr("x2", x);
244
+ markerDot.attr("cx", x).attr("cy", y);
245
+ if (this.tooltip()) {
246
+ if (posX < this._hostWidth / 2) this._currentTooltipPosition = "after-center";
247
+ else this._currentTooltipPosition = "before-center";
248
+ this._setTooltipPositionByEvent(e);
249
+ if (visible) {
250
+ this._setTooltipVisible();
251
+ if (!this._overlayRef?.hasAttached()) this._showTooltip({
252
+ label,
253
+ value
254
+ });
255
+ else if (oldXPosition !== x) this._showTooltip({
256
+ label,
257
+ value
258
+ });
259
+ else {
260
+ this._overlayRef.updatePositionStrategy(this._getOverlayPositionStrategy());
261
+ this._overlayRef.updatePosition();
262
+ }
263
+ } else this._setTooltipInVisible();
264
+ }
265
+ });
266
+ }
267
+ }
268
+ _setupResizeObserver() {
269
+ if (!this.responsive()) return;
270
+ this._resizeObserver = new ResizeObserver((entries) => {
271
+ if (this._hostWidth !== entries[0].contentRect.width || this._hostHeight !== entries[0].contentRect.height) {
272
+ this._hostWidth = entries[0].contentRect.width;
273
+ this._hostHeight = entries[0].contentRect.height;
274
+ this._innerWidth = entries[0].contentRect.width;
275
+ this._innerHeight = entries[0].contentRect.height;
276
+ this._svg.attr("viewBox", `0 0 ${this._hostWidth} ${this._hostHeight}`);
277
+ this._setupData(true);
278
+ }
279
+ });
280
+ this._resizeObserver.observe(this._elementRef.nativeElement);
281
+ }
282
+ static ɵfac = i0.ɵɵngDeclareFactory({
283
+ minVersion: "12.0.0",
284
+ version: "22.3.0",
285
+ ngImport: i0,
286
+ type: MchartLine,
287
+ deps: [],
288
+ target: i0.ɵɵFactoryTarget.Component
289
+ });
290
+ static ɵcmp = i0.ɵɵngDeclareComponent({
291
+ minVersion: "17.0.0",
292
+ version: "22.3.0",
293
+ type: MchartLine,
294
+ isStandalone: true,
295
+ selector: "ngs-mchart-line",
296
+ inputs: {
297
+ data: {
298
+ classPropertyName: "data",
299
+ publicName: "data",
300
+ isSignal: true,
301
+ isRequired: false,
302
+ transformFunction: null
303
+ },
304
+ labels: {
305
+ classPropertyName: "labels",
306
+ publicName: "labels",
307
+ isSignal: true,
308
+ isRequired: false,
309
+ transformFunction: null
310
+ },
311
+ strokeWidth: {
312
+ classPropertyName: "strokeWidth",
313
+ publicName: "strokeWidth",
314
+ isSignal: true,
315
+ isRequired: false,
316
+ transformFunction: null
317
+ },
318
+ showArea: {
319
+ classPropertyName: "showArea",
320
+ publicName: "showArea",
321
+ isSignal: true,
322
+ isRequired: false,
323
+ transformFunction: null
324
+ },
325
+ showMarkers: {
326
+ classPropertyName: "showMarkers",
327
+ publicName: "showMarkers",
328
+ isSignal: true,
329
+ isRequired: false,
330
+ transformFunction: null
331
+ },
332
+ responsive: {
333
+ classPropertyName: "responsive",
334
+ publicName: "responsive",
335
+ isSignal: true,
336
+ isRequired: false,
337
+ transformFunction: null
338
+ },
339
+ fillAreaGradient: {
340
+ classPropertyName: "fillAreaGradient",
341
+ publicName: "fillAreaGradient",
342
+ isSignal: true,
343
+ isRequired: false,
344
+ transformFunction: null
345
+ },
346
+ curve: {
347
+ classPropertyName: "curve",
348
+ publicName: "curve",
349
+ isSignal: true,
350
+ isRequired: false,
351
+ transformFunction: null
352
+ },
353
+ xAccessor: {
354
+ classPropertyName: "xAccessor",
355
+ publicName: "xAccessor",
356
+ isSignal: true,
357
+ isRequired: false,
358
+ transformFunction: null
359
+ },
360
+ yAccessor: {
361
+ classPropertyName: "yAccessor",
362
+ publicName: "yAccessor",
363
+ isSignal: true,
364
+ isRequired: false,
365
+ transformFunction: null
366
+ },
367
+ compact: {
368
+ classPropertyName: "compact",
369
+ publicName: "compact",
370
+ isSignal: true,
371
+ isRequired: false,
372
+ transformFunction: null
373
+ },
374
+ markerDotSize: {
375
+ classPropertyName: "markerDotSize",
376
+ publicName: "markerDotSize",
377
+ isSignal: true,
378
+ isRequired: false,
379
+ transformFunction: null
380
+ },
381
+ tooltip: {
382
+ classPropertyName: "tooltip",
383
+ publicName: "tooltip",
384
+ isSignal: true,
385
+ isRequired: false,
386
+ transformFunction: null
387
+ },
388
+ tooltipPosition: {
389
+ classPropertyName: "tooltipPosition",
390
+ publicName: "tooltipPosition",
391
+ isSignal: true,
392
+ isRequired: false,
393
+ transformFunction: null
394
+ }
395
+ },
396
+ host: {
397
+ properties: { "class.fill-area-gradient": "fillAreaGradient()" },
398
+ classAttribute: "ngs-mchart-line"
399
+ },
400
+ exportAs: ["ngsMchartLine"],
401
+ usesInheritance: true,
402
+ ngImport: i0,
403
+ template: "<svg>\n @if (fillAreaGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n</svg>\n",
404
+ styles: [":host{--ngs-mchart-line-line-bg: var(--ngs-color-primary);--ngs-mchart-line-area-bg: var(--ngs-color-primary-200);--ngs-mchart-line-marker-line-bg: var(--ngs-color-neutral);--ngs-mchart-line-marker-dot-bg: var(--ngs-color-primary);--ngs-mchart-line-area-gradient-start-color: var(--ngs-color-primary);--ngs-mchart-line-area-gradient-end-color: var(--ngs-color-background);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .line{stroke:var(--ngs-mchart-line-line-bg);fill:none;stroke-linejoin:round;stroke-linecap:round}:host ::ng-deep .area{stroke-width:0}:host ::ng-deep .marker-line{stroke:var(--ngs-mchart-line-marker-line-bg);stroke-width:1;stroke-dasharray:3}:host ::ng-deep .marker-dot{fill:var(--ngs-mchart-line-marker-dot-bg)}:host:not(.fill-area-gradient) ::ng-deep .area{fill:var(--ngs-mchart-line-area-bg)}:host.fill-area-gradient .lg-start-color{stop-color:var(--ngs-mchart-line-area-gradient-start-color)}:host.fill-area-gradient .lg-end-color{stop-color:var(--ngs-mchart-line-area-gradient-end-color)}:host-context(html.dark){--ngs-mchart-line-area-bg: var(--ngs-color-neutral-700);--ngs-mchart-line-area-gradient-start-color: var(--ngs-color-neutral-700)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
405
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
406
+ });
407
+ };
408
+ i0.ɵɵngDeclareClassMetadata({
409
+ minVersion: "12.0.0",
410
+ version: "22.3.0",
411
+ ngImport: i0,
412
+ type: MchartLine,
413
+ decorators: [{
414
+ type: Component,
415
+ args: [{
416
+ selector: "ngs-mchart-line",
417
+ exportAs: "ngsMchartLine",
418
+ changeDetection: ChangeDetectionStrategy.OnPush,
419
+ host: {
420
+ "class": "ngs-mchart-line",
421
+ "[class.fill-area-gradient]": "fillAreaGradient()"
422
+ },
423
+ template: "<svg>\n @if (fillAreaGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n</svg>\n",
424
+ styles: [":host{--ngs-mchart-line-line-bg: var(--ngs-color-primary);--ngs-mchart-line-area-bg: var(--ngs-color-primary-200);--ngs-mchart-line-marker-line-bg: var(--ngs-color-neutral);--ngs-mchart-line-marker-dot-bg: var(--ngs-color-primary);--ngs-mchart-line-area-gradient-start-color: var(--ngs-color-primary);--ngs-mchart-line-area-gradient-end-color: var(--ngs-color-background);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .line{stroke:var(--ngs-mchart-line-line-bg);fill:none;stroke-linejoin:round;stroke-linecap:round}:host ::ng-deep .area{stroke-width:0}:host ::ng-deep .marker-line{stroke:var(--ngs-mchart-line-marker-line-bg);stroke-width:1;stroke-dasharray:3}:host ::ng-deep .marker-dot{fill:var(--ngs-mchart-line-marker-dot-bg)}:host:not(.fill-area-gradient) ::ng-deep .area{fill:var(--ngs-mchart-line-area-bg)}:host.fill-area-gradient .lg-start-color{stop-color:var(--ngs-mchart-line-area-gradient-start-color)}:host.fill-area-gradient .lg-end-color{stop-color:var(--ngs-mchart-line-area-gradient-end-color)}:host-context(html.dark){--ngs-mchart-line-area-bg: var(--ngs-color-neutral-700);--ngs-mchart-line-area-gradient-start-color: var(--ngs-color-neutral-700)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
425
+ }]
426
+ }],
427
+ ctorParameters: () => [],
428
+ propDecorators: {
429
+ data: [{
430
+ type: i0.Input,
431
+ args: [{
432
+ isSignal: true,
433
+ alias: "data",
434
+ required: false
435
+ }]
436
+ }],
437
+ labels: [{
438
+ type: i0.Input,
439
+ args: [{
440
+ isSignal: true,
441
+ alias: "labels",
442
+ required: false
443
+ }]
444
+ }],
445
+ strokeWidth: [{
446
+ type: i0.Input,
447
+ args: [{
448
+ isSignal: true,
449
+ alias: "strokeWidth",
450
+ required: false
451
+ }]
452
+ }],
453
+ showArea: [{
454
+ type: i0.Input,
455
+ args: [{
456
+ isSignal: true,
457
+ alias: "showArea",
458
+ required: false
459
+ }]
460
+ }],
461
+ showMarkers: [{
462
+ type: i0.Input,
463
+ args: [{
464
+ isSignal: true,
465
+ alias: "showMarkers",
466
+ required: false
467
+ }]
468
+ }],
469
+ responsive: [{
470
+ type: i0.Input,
471
+ args: [{
472
+ isSignal: true,
473
+ alias: "responsive",
474
+ required: false
475
+ }]
476
+ }],
477
+ fillAreaGradient: [{
478
+ type: i0.Input,
479
+ args: [{
480
+ isSignal: true,
481
+ alias: "fillAreaGradient",
482
+ required: false
483
+ }]
484
+ }],
485
+ curve: [{
486
+ type: i0.Input,
487
+ args: [{
488
+ isSignal: true,
489
+ alias: "curve",
490
+ required: false
491
+ }]
492
+ }],
493
+ xAccessor: [{
494
+ type: i0.Input,
495
+ args: [{
496
+ isSignal: true,
497
+ alias: "xAccessor",
498
+ required: false
499
+ }]
500
+ }],
501
+ yAccessor: [{
502
+ type: i0.Input,
503
+ args: [{
504
+ isSignal: true,
505
+ alias: "yAccessor",
506
+ required: false
507
+ }]
508
+ }],
509
+ compact: [{
510
+ type: i0.Input,
511
+ args: [{
512
+ isSignal: true,
513
+ alias: "compact",
514
+ required: false
515
+ }]
516
+ }],
517
+ markerDotSize: [{
518
+ type: i0.Input,
519
+ args: [{
520
+ isSignal: true,
521
+ alias: "markerDotSize",
522
+ required: false
523
+ }]
524
+ }],
525
+ tooltip: [{
526
+ type: i0.Input,
527
+ args: [{
528
+ isSignal: true,
529
+ alias: "tooltip",
530
+ required: false
531
+ }]
532
+ }],
533
+ tooltipPosition: [{
534
+ type: i0.Input,
535
+ args: [{
536
+ isSignal: true,
537
+ alias: "tooltipPosition",
538
+ required: false
539
+ }]
540
+ }]
541
+ }
542
+ });
379
543
  let nextId = 0;
380
- class MchartBar extends BaseChartTooltip {
381
- _initialized = false;
382
- _host;
383
- _svg;
384
- _hlContainer;
385
- _dataContainer;
386
- _dimensions;
387
- _innerWidth = 0;
388
- _innerHeight = 0;
389
- _hostWidth = 0;
390
- _hostHeight = 0;
391
- _xScale;
392
- _yScale;
393
- _resizeObserver;
394
- _platformId = inject(PLATFORM_ID);
395
- _elementRef = inject(ElementRef);
396
- _destroyRef = inject(DestroyRef);
397
- data = input([], /* @ts-ignore */
398
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
399
- labels = input([], /* @ts-ignore */
400
- ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
401
- gap = input(0.2, { ...(ngDevMode ? { debugName: "gap" } : /* istanbul ignore next */ {}), transform: numberAttribute });
402
- radius = input(0, { ...(ngDevMode ? { debugName: "radius" } : /* istanbul ignore next */ {}), transform: numberAttribute });
403
- highlight = input(false, { ...(ngDevMode ? { debugName: "highlight" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
404
- responsive = input(false, { ...(ngDevMode ? { debugName: "responsive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
405
- fillGradient = input(false, { ...(ngDevMode ? { debugName: "fillGradient" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
406
- xAccessor = input((d, i) => i, /* @ts-ignore */
407
- ...(ngDevMode ? [{ debugName: "xAccessor" }] : /* istanbul ignore next */ []));
408
- yAccessor = input((d) => d, /* @ts-ignore */
409
- ...(ngDevMode ? [{ debugName: "yAccessor" }] : /* istanbul ignore next */ []));
410
- tooltip = input(/* @ts-ignore */
411
- ...(ngDevMode ? [undefined, { debugName: "tooltip" }] : /* istanbul ignore next */ []));
412
- tooltipPosition = input('after-center', /* @ts-ignore */
413
- ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
414
- _currentTooltipPosition = 'after-center';
415
- get gradientId() {
416
- return 'areaGradient' + this._gradientId;
417
- }
418
- _gradientId = nextId++;
419
- constructor() {
420
- super();
421
- effect(() => {
422
- this._currentTooltipPosition = this.tooltipPosition();
423
- });
424
- effect(() => {
425
- if (!this._initialized) {
426
- return;
427
- }
428
- this._render();
429
- this._setupResizeObserver();
430
- });
431
- }
432
- ngAfterViewChecked() {
433
- if (isPlatformServer(this._platformId)) {
434
- return;
435
- }
436
- if (!this._initialized) {
437
- const element = this._elementRef.nativeElement;
438
- this._dimensions = element.getBoundingClientRect();
439
- if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
440
- this._initialized = true;
441
- this._render();
442
- this._setupResizeObserver();
443
- }
444
- }
445
- }
446
- ngOnDestroy() {
447
- this._resizeObserver?.disconnect();
448
- }
449
- getTooltipPosition() {
450
- return this._currentTooltipPosition;
451
- }
452
- getTooltipTemplateRef() {
453
- return this.tooltip();
454
- }
455
- _render() {
456
- this._init();
457
- this._setupAxisScale();
458
- this._setupData();
459
- this._initTooltip();
460
- }
461
- _init() {
462
- this._hostWidth = this._dimensions.width;
463
- this._hostHeight = this._dimensions.height;
464
- this._innerWidth = this._dimensions.width;
465
- this._innerHeight = this._dimensions.height;
466
- this._host = select(this._elementRef.nativeElement);
467
- this._svg = this._host
468
- .select('svg')
469
- .attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
470
- }
471
- _setupAxisScale() {
472
- if (!this._xScale) {
473
- this._xScale = scaleBand()
474
- .paddingInner(this.gap())
475
- .domain(this.data().map((d, i) => i.toString()));
476
- }
477
- this._xScale.range([0, this._innerWidth]);
478
- if (!this._yScale) {
479
- this._yScale = scaleLinear().domain([0, Math.max(...this.data())]);
480
- }
481
- this._yScale.range([this._innerHeight, 0]);
482
- }
483
- _setupData() {
484
- if (this.highlight()) {
485
- if (!this._hlContainer) {
486
- this._hlContainer = this._svg.append('g')
487
- .attr('class', 'hl-container')
488
- .attr('transform', `translate(0,0)`);
489
- this._hlContainer.selectAll('rect')
490
- .data(this.data())
491
- .enter()
492
- .append('rect')
493
- .attr('rx', this.radius())
494
- .attr('x', (d, i) => this._xScale(i.toString()))
495
- .attr('y', 0)
496
- .attr('width', this._xScale.bandwidth())
497
- .attr('height', this._innerHeight)
498
- .attr('class', 'highlight');
499
- }
500
- else {
501
- this._hlContainer.selectAll('rect')
502
- .attr('x', (d, i) => this._xScale(i.toString()))
503
- .attr('y', 0)
504
- .attr('width', this._xScale.bandwidth())
505
- .attr('height', this._innerHeight);
506
- }
507
- }
508
- if (!this._dataContainer) {
509
- this._dataContainer = this._svg.append('g')
510
- .attr('class', 'data-container')
511
- .attr('transform', `translate(0,0)`);
512
- const allBars = this._dataContainer.selectAll('rect')
513
- .data(this.data())
514
- .enter()
515
- .append('rect')
516
- .attr('rx', this.radius())
517
- .attr('x', (d, i) => this._xScale(i.toString()))
518
- .attr('y', (d) => this._yScale(d))
519
- .attr('width', this._xScale.bandwidth())
520
- .attr('height', (d) => this._innerHeight - this._yScale(d))
521
- .attr('class', 'bar');
522
- if (this.fillGradient()) {
523
- allBars.attr('fill', `url(#${this.gradientId})`);
524
- }
525
- }
526
- else {
527
- this._dataContainer.selectAll('rect')
528
- .attr('x', (d, i) => this._xScale(i.toString()))
529
- .attr('y', (d) => this._yScale(d))
530
- .attr('width', this._xScale.bandwidth())
531
- .attr('height', (d) => this._innerHeight - this._yScale(d));
532
- }
533
- }
534
- _setupResizeObserver() {
535
- if (!this.responsive()) {
536
- return;
537
- }
538
- this._resizeObserver?.disconnect();
539
- this._resizeObserver = new ResizeObserver((entries) => {
540
- if (this._hostWidth !== entries[0].contentRect.width || this._hostHeight !== entries[0].contentRect.height) {
541
- this._hostWidth = entries[0].contentRect.width;
542
- this._hostHeight = entries[0].contentRect.height;
543
- this._innerWidth = entries[0].contentRect.width;
544
- this._innerHeight = entries[0].contentRect.height;
545
- this._svg.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
546
- this._setupAxisScale();
547
- this._setupData();
548
- }
549
- });
550
- this._resizeObserver.observe(this._elementRef.nativeElement);
551
- }
552
- _initTooltip() {
553
- if (!this.tooltip()) {
554
- return;
555
- }
556
- const xAccessor = this.xAccessor();
557
- const yAccessor = this.yAccessor();
558
- this._createTooltipOrigin();
559
- let x = 0;
560
- let y = 0;
561
- let label;
562
- let value;
563
- let oldX;
564
- fromEvent(this._document, 'mousemove')
565
- .pipe(takeUntilDestroyed(this._destroyRef))
566
- .subscribe((e) => {
567
- const target = e.target;
568
- const pointerCoords = pointer(e, this._svg.node());
569
- const [posX, posY] = pointerCoords;
570
- let visible = true;
571
- if (posX < 0 || posY < 0 || posX > this._hostWidth || posY > this._hostHeight) {
572
- visible = false;
573
- oldX = null;
574
- this._overlayRef?.detach();
575
- }
576
- else {
577
- if (!target.closest('.ngs-mchart-line') ||
578
- !target.classList.contains('ngs-mchart-tooltip-overlay') ||
579
- !target.closest('.ngs-mchart-tooltip-overlay')) {
580
- oldX = null;
581
- this._overlayRef?.detach();
582
- }
583
- }
584
- const eachBand = this._xScale.step();
585
- const index = Math.floor(posX / eachBand);
586
- const dataValue = this.data()[index];
587
- label = this.labels()[index] ? this.labels()[index] : xAccessor(index, index);
588
- value = yAccessor(dataValue);
589
- x = this._xScale(xAccessor(index, index));
590
- y = this._yScale(yAccessor(dataValue));
591
- if (posX < this._hostWidth / 2) {
592
- this._currentTooltipPosition = 'after-center';
593
- }
594
- else {
595
- this._currentTooltipPosition = 'before-center';
596
- }
597
- this._setTooltipPositionByEvent(e);
598
- if (visible) {
599
- this._setTooltipVisible();
600
- if (!this._overlayRef?.hasAttached()) {
601
- oldX = x;
602
- this._showTooltip({
603
- label,
604
- value
605
- });
606
- }
607
- else {
608
- if (oldX !== x) {
609
- oldX = x;
610
- this._showTooltip({
611
- label,
612
- value
613
- });
614
- }
615
- else {
616
- this._overlayRef.updatePositionStrategy(this._getOverlayPositionStrategy());
617
- this._overlayRef.updatePosition();
618
- }
619
- }
620
- }
621
- else {
622
- oldX = x;
623
- this._setTooltipInVisible();
624
- }
625
- });
626
- }
627
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
628
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: MchartBar, isStandalone: true, selector: "ngs-mchart-bar", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, fillGradient: { classPropertyName: "fillGradient", publicName: "fillGradient", isSignal: true, isRequired: false, transformFunction: null }, xAccessor: { classPropertyName: "xAccessor", publicName: "xAccessor", isSignal: true, isRequired: false, transformFunction: null }, yAccessor: { classPropertyName: "yAccessor", publicName: "yAccessor", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fill-gradient": "fillGradient()", "class.with-tooltip": "!!tooltip()" }, classAttribute: "ngs-mchart-bar" }, exportAs: ["ngsMchartBar"], usesInheritance: true, ngImport: i0, template: "<svg>\n <defs>\n @if (fillGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n </defs>\n</svg>\n", styles: [":host{--ngs-mchart-bar-bar-bg: var(--ngs-color-primary);--ngs-mchart-bar-bar-gradient-start-color: var(--ngs-color-primary-500);--ngs-mchart-bar-bar-gradient-end-color: var(--ngs-color-primary);--ngs-mchart-bar-highlight-bg: var(--ngs-color-neutral-200);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .highlight{fill:var(--ngs-mchart-bar-highlight-bg)}:host:not(.fill-gradient) ::ng-deep .bar{fill:var(--ngs-mchart-bar-bar-bg)}:host.fill-gradient .lg-start-color{stop-color:var(--ngs-mchart-bar-bar-gradient-start-color)}:host.fill-gradient .lg-end-color{stop-color:var(--ngs-mchart-bar-bar-gradient-end-color)}:host.with-tooltip ::ng-deep .bar:hover{opacity:.85}:host-context(html.dark){--ngs-mchart-bar-highlight-bg: var(--ngs-color-neutral-700)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
629
- }
630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartBar, decorators: [{
631
- type: Component,
632
- args: [{ selector: 'ngs-mchart-bar', exportAs: 'ngsMchartBar', changeDetection: ChangeDetectionStrategy.OnPush, host: {
633
- 'class': 'ngs-mchart-bar',
634
- '[class.fill-gradient]': 'fillGradient()',
635
- '[class.with-tooltip]': '!!tooltip()',
636
- }, template: "<svg>\n <defs>\n @if (fillGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n </defs>\n</svg>\n", styles: [":host{--ngs-mchart-bar-bar-bg: var(--ngs-color-primary);--ngs-mchart-bar-bar-gradient-start-color: var(--ngs-color-primary-500);--ngs-mchart-bar-bar-gradient-end-color: var(--ngs-color-primary);--ngs-mchart-bar-highlight-bg: var(--ngs-color-neutral-200);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .highlight{fill:var(--ngs-mchart-bar-highlight-bg)}:host:not(.fill-gradient) ::ng-deep .bar{fill:var(--ngs-mchart-bar-bar-bg)}:host.fill-gradient .lg-start-color{stop-color:var(--ngs-mchart-bar-bar-gradient-start-color)}:host.fill-gradient .lg-end-color{stop-color:var(--ngs-mchart-bar-bar-gradient-end-color)}:host.with-tooltip ::ng-deep .bar:hover{opacity:.85}:host-context(html.dark){--ngs-mchart-bar-highlight-bg: var(--ngs-color-neutral-700)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
637
- }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], highlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlight", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], fillGradient: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillGradient", required: false }] }], xAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAccessor", required: false }] }], yAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAccessor", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
638
-
639
- class MchartPie extends BaseChartTooltip {
640
- _initialized = false;
641
- _host;
642
- _svg;
643
- _dataContainer;
644
- _legendContainer;
645
- _dimensions;
646
- _innerWidth = 0;
647
- _innerHeight = 0;
648
- _hostWidth = 0;
649
- _hostHeight = 0;
650
- _resizeObserver;
651
- _platformId = inject(PLATFORM_ID);
652
- _elementRef = inject(ElementRef);
653
- _radius = 0;
654
- _arcGenerator;
655
- _pieGenerator;
656
- _colorsGenerator;
657
- _arcTweenGenerator;
658
- _pieData;
659
- data = input([], /* @ts-ignore */
660
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
661
- labels = input([], /* @ts-ignore */
662
- ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
663
- valueAccessor = input((d) => d, /* @ts-ignore */
664
- ...(ngDevMode ? [{ debugName: "valueAccessor" }] : /* istanbul ignore next */ []));
665
- dataItemStrokeWidth = input(1, { ...(ngDevMode ? { debugName: "dataItemStrokeWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
666
- legendContainerWidth = input(0, { ...(ngDevMode ? { debugName: "legendContainerWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
667
- showDataAnimation = input(false, { ...(ngDevMode ? { debugName: "showDataAnimation" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
668
- showValueOnSlices = input(false, { ...(ngDevMode ? { debugName: "showValueOnSlices" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
669
- showLegend = input(false, { ...(ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
670
- legendOffset = input(30, { ...(ngDevMode ? { debugName: "legendOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
671
- legendItemHeight = input(30, { ...(ngDevMode ? { debugName: "legendItemHeight" } : /* istanbul ignore next */ {}), transform: numberAttribute });
672
- legendItemSymbolSize = input(12, { ...(ngDevMode ? { debugName: "legendItemSymbolSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
673
- legendItemFontSize = input(14, { ...(ngDevMode ? { debugName: "legendItemFontSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
674
- legendItemSymbolBorderRadius = input(12, { ...(ngDevMode ? { debugName: "legendItemSymbolBorderRadius" } : /* istanbul ignore next */ {}), transform: numberAttribute });
675
- valueFontSize = input(12, { ...(ngDevMode ? { debugName: "valueFontSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
676
- tooltip = input(/* @ts-ignore */
677
- ...(ngDevMode ? [undefined, { debugName: "tooltip" }] : /* istanbul ignore next */ []));
678
- tooltipPosition = input('after-center', /* @ts-ignore */
679
- ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
680
- getTooltipPosition() {
681
- return this.tooltipPosition();
682
- }
683
- getTooltipTemplateRef() {
684
- return this.tooltip();
685
- }
686
- ngAfterViewChecked() {
687
- if (isPlatformServer(this._platformId)) {
688
- return;
689
- }
690
- if (!this._initialized) {
691
- const element = this._elementRef.nativeElement;
692
- this._dimensions = element.getBoundingClientRect();
693
- if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
694
- this._initialized = true;
695
- this._render();
696
- this._setupResizeObserver();
697
- }
698
- }
699
- }
700
- ngOnChanges(changes) {
701
- if (!this._initialized) {
702
- return;
703
- }
704
- if (changes['data'] && !changes['data'].firstChange) {
705
- this._draw(true);
706
- }
707
- }
708
- ngOnDestroy() {
709
- this._resizeObserver?.disconnect();
710
- }
711
- _render() {
712
- this._initDimensions();
713
- this._initContainers();
714
- this._setGenerators();
715
- this._setLegend();
716
- this._draw();
717
- this._initTooltip();
718
- }
719
- _initDimensions() {
720
- const legendContainerWidth = this.showLegend() ? this.legendContainerWidth() : 0;
721
- this._hostWidth = this._dimensions.width;
722
- this._hostHeight = this._dimensions.height;
723
- this._innerWidth = this._dimensions.width - legendContainerWidth - this.dataItemStrokeWidth() * 2;
724
- this._innerHeight = this._dimensions.height - this.dataItemStrokeWidth() * 2;
725
- this._host = select(this._elementRef.nativeElement);
726
- this._svg = this._host
727
- .select('svg')
728
- .attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
729
- this._radius = Math.min(this._innerWidth, this._innerHeight) * .5;
730
- }
731
- _initContainers() {
732
- this._dataContainer = this._svg
733
- .append('g')
734
- .attr('class', 'data-container')
735
- .attr('transform', `translate(${this._radius},${this._innerHeight * .5})`);
736
- if (this.showLegend()) {
737
- this._legendContainer = this._svg
738
- .append('g')
739
- .attr('class', 'legend-container');
740
- }
741
- }
742
- _setGenerators() {
743
- const self = this;
744
- this._arcGenerator = arc()
745
- .innerRadius(0)
746
- .outerRadius(this._radius);
747
- this._pieGenerator = pie()
748
- .value(this.valueAccessor());
749
- this._colorsGenerator = scaleOrdinal(schemeTableau10)
750
- .domain(this.data().map((d, i) => i.toString()));
751
- this._arcTweenGenerator = function (d) {
752
- // @ts-ignore
753
- const _this = this;
754
- const current = d;
755
- const interpolateGenerator = interpolate(_this._previous, current);
756
- _this._previous = current;
757
- return (t) => {
758
- return self._arcGenerator(interpolateGenerator(t));
759
- };
760
- };
761
- }
762
- _setLegend() {
763
- if (!this.showLegend()) {
764
- return;
765
- }
766
- this._legendContainer
767
- .selectAll('g.legend-item')
768
- .data(this.data())
769
- .join('g')
770
- .attr('class', 'legend-item')
771
- .attr('data-index', (d, i) => i)
772
- .attr('transform', (d, i) => `translate(0, ${i * this.legendItemHeight()})`)
773
- .on('mouseenter', (event, d) => {
774
- const target = event.target;
775
- const index = +target.getAttribute('data-index');
776
- this._dataContainer
777
- .select(`path.data-item[data-index="${index}"]`)
778
- .classed('active', true);
779
- })
780
- .on('mouseleave', (event, d) => {
781
- const target = event.target;
782
- const index = +target.getAttribute('data-index');
783
- this._dataContainer
784
- .select(`path.data-item[data-index="${index}"]`)
785
- .classed('active', false);
786
- });
787
- this._legendContainer
788
- .selectAll('g.legend-item')
789
- .selectAll('text')
790
- .data((d, i) => [i])
791
- .join('text')
792
- .attr('class', 'legend-item-text')
793
- .attr('x', this.legendItemSymbolSize() * 2)
794
- .attr('y', this.legendItemHeight() * .5)
795
- .attr('font-size', this.legendItemFontSize())
796
- .text((i) => this.labels()[i]);
797
- this._legendContainer
798
- .selectAll('g.legend-item')
799
- .selectAll('rect')
800
- .data((d, i) => [i])
801
- .join('rect')
802
- .attr('class', 'legend-item-symbol')
803
- .attr('rx', this.legendItemSymbolBorderRadius())
804
- .attr('width', this.legendItemSymbolSize())
805
- .attr('height', this.legendItemSymbolSize())
806
- .attr('fill', (i) => this._colorsGenerator(i))
807
- .attr('y', this.legendItemFontSize() * .5 - 2);
808
- const dimensions = this._legendContainer.node().getBBox();
809
- this._legendContainer.attr('transform', `translate(${this._radius * 2 + this.legendOffset()},${this._innerHeight * .5 - .5 * dimensions.height})`);
810
- }
811
- _draw(isUpdate = false) {
812
- if (isUpdate) {
813
- this._colorsGenerator
814
- .domain(this.data().map((d, i) => i.toString()));
815
- }
816
- this._pieData = this._pieGenerator(this.data());
817
- this._dataContainer
818
- .selectAll('g.data-item-group')
819
- .data(this.data())
820
- .join('g')
821
- .attr('class', 'data-item-group')
822
- .attr('data-index', (d, i) => i);
823
- this._dataContainer
824
- .selectAll('g.data-item-group')
825
- .selectAll('path')
826
- .data((d, i) => [this._pieData[i]])
827
- .join('path')
828
- .attr('class', 'data-item')
829
- .attr('stroke-width', this.dataItemStrokeWidth())
830
- .attr('d', (d) => this._arcGenerator(d))
831
- .style('fill', (d) => this._colorsGenerator(d.index))
832
- .attr('data-index', (d) => d.index)
833
- .transition()
834
- .duration(this.showDataAnimation() ? 1000 : 0)
835
- .attrTween('d', this._arcTweenGenerator);
836
- if (this.showValueOnSlices()) {
837
- this._dataContainer
838
- .selectAll('g.data-item-group')
839
- .selectAll('text')
840
- .data((d, i) => [this._pieData[i]])
841
- .join('text')
842
- .attr('class', 'value')
843
- .attr('font-size', this.valueFontSize())
844
- .attr('transform', (d) => {
845
- const coordinates = this._arcGenerator.centroid(d);
846
- return `translate(${coordinates[0]},${coordinates[1]})`;
847
- })
848
- .text((d) => d.data);
849
- }
850
- }
851
- _setupResizeObserver() {
852
- }
853
- _initTooltip() {
854
- if (!this.tooltip()) {
855
- return;
856
- }
857
- let oldValue;
858
- this._createTooltipOrigin();
859
- this._dataContainer
860
- .selectAll('g.data-item-group')
861
- .data(this._pieData)
862
- .on('mousemove', (event, d) => {
863
- const target = event.target;
864
- this._setTooltipPositionByEvent(event);
865
- this._setTooltipVisible();
866
- const index = +target.getAttribute('data-index');
867
- const label = this.labels()[index] ? this.labels()[index] : null;
868
- const color = this._colorsGenerator(index);
869
- const value = d.data;
870
- if (!this._overlayRef?.hasAttached()) {
871
- this._showTooltip({
872
- label,
873
- color,
874
- value
875
- });
876
- oldValue = value;
877
- }
878
- else {
879
- if (oldValue !== d.data) {
880
- this._showTooltip({
881
- label,
882
- color,
883
- value
884
- });
885
- oldValue = value;
886
- }
887
- else {
888
- this._overlayRef.updatePosition();
889
- }
890
- }
891
- });
892
- this._dataContainer
893
- .on('mouseleave', (event) => {
894
- this._setTooltipInVisible();
895
- this._hideTooltip();
896
- });
897
- }
898
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartPie, deps: null, target: i0.ɵɵFactoryTarget.Component });
899
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: MchartPie, isStandalone: true, selector: "ngs-mchart-pie", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, valueAccessor: { classPropertyName: "valueAccessor", publicName: "valueAccessor", isSignal: true, isRequired: false, transformFunction: null }, dataItemStrokeWidth: { classPropertyName: "dataItemStrokeWidth", publicName: "dataItemStrokeWidth", isSignal: true, isRequired: false, transformFunction: null }, legendContainerWidth: { classPropertyName: "legendContainerWidth", publicName: "legendContainerWidth", isSignal: true, isRequired: false, transformFunction: null }, showDataAnimation: { classPropertyName: "showDataAnimation", publicName: "showDataAnimation", isSignal: true, isRequired: false, transformFunction: null }, showValueOnSlices: { classPropertyName: "showValueOnSlices", publicName: "showValueOnSlices", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, legendOffset: { classPropertyName: "legendOffset", publicName: "legendOffset", isSignal: true, isRequired: false, transformFunction: null }, legendItemHeight: { classPropertyName: "legendItemHeight", publicName: "legendItemHeight", isSignal: true, isRequired: false, transformFunction: null }, legendItemSymbolSize: { classPropertyName: "legendItemSymbolSize", publicName: "legendItemSymbolSize", isSignal: true, isRequired: false, transformFunction: null }, legendItemFontSize: { classPropertyName: "legendItemFontSize", publicName: "legendItemFontSize", isSignal: true, isRequired: false, transformFunction: null }, legendItemSymbolBorderRadius: { classPropertyName: "legendItemSymbolBorderRadius", publicName: "legendItemSymbolBorderRadius", isSignal: true, isRequired: false, transformFunction: null }, valueFontSize: { classPropertyName: "valueFontSize", publicName: "valueFontSize", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ngs-mchart-pie" }, exportAs: ["ngsMchartPie"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<svg></svg>\n", styles: [":host{--ngs-mchart-pie-stroke-color: var(--ngs-color-background);--ngs-mchart-pie-legend-item-color: var(--ngs-color-neutral-900);--ngs-mchart-pie-legend-item-hover-color: var(--ngs-color-primary);--ngs-mchart-pie-value-color: var(--ngs-color-neutral-950);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host:has(.data-item.active) ::ng-deep .data-item:not(.active){opacity:.7;scale:.93;transition:scale .2s}:host ::ng-deep .data-item{stroke:var(--ngs-mchart-pie-stroke-color)}:host ::ng-deep .value{text-anchor:middle;alignment-baseline:middle;fill:var(--ngs-mchart-pie-value-color)}:host ::ng-deep .legend-item{cursor:pointer}:host ::ng-deep .legend-item:hover .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-hover-color)}:host ::ng-deep .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-color)}:host-context(html.dark){--ngs-mchart-pie-legend-item-color: var(--ngs-color-neutral-200)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
900
- }
901
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartPie, decorators: [{
902
- type: Component,
903
- args: [{ selector: 'ngs-mchart-pie', exportAs: 'ngsMchartPie', changeDetection: ChangeDetectionStrategy.OnPush, host: {
904
- 'class': 'ngs-mchart-pie'
905
- }, template: "<svg></svg>\n", styles: [":host{--ngs-mchart-pie-stroke-color: var(--ngs-color-background);--ngs-mchart-pie-legend-item-color: var(--ngs-color-neutral-900);--ngs-mchart-pie-legend-item-hover-color: var(--ngs-color-primary);--ngs-mchart-pie-value-color: var(--ngs-color-neutral-950);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host:has(.data-item.active) ::ng-deep .data-item:not(.active){opacity:.7;scale:.93;transition:scale .2s}:host ::ng-deep .data-item{stroke:var(--ngs-mchart-pie-stroke-color)}:host ::ng-deep .value{text-anchor:middle;alignment-baseline:middle;fill:var(--ngs-mchart-pie-value-color)}:host ::ng-deep .legend-item{cursor:pointer}:host ::ng-deep .legend-item:hover .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-hover-color)}:host ::ng-deep .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-color)}:host-context(html.dark){--ngs-mchart-pie-legend-item-color: var(--ngs-color-neutral-200)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
906
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], valueAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueAccessor", required: false }] }], dataItemStrokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataItemStrokeWidth", required: false }] }], legendContainerWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendContainerWidth", required: false }] }], showDataAnimation: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDataAnimation", required: false }] }], showValueOnSlices: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValueOnSlices", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], legendOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendOffset", required: false }] }], legendItemHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemHeight", required: false }] }], legendItemSymbolSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemSymbolSize", required: false }] }], legendItemFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemFontSize", required: false }] }], legendItemSymbolBorderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemSymbolBorderRadius", required: false }] }], valueFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFontSize", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
907
-
908
- class MchartTooltip {
909
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartTooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
910
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: MchartTooltip, isStandalone: true, selector: "ngs-mchart-tooltip", host: { classAttribute: "ngs-mchart-tooltip" }, exportAs: ["ngsMchartTooltip"], ngImport: i0, template: "<div class=\"title\">\n <ng-content select=\"ngs-mchart-tooltip-title\" />\n</div>\n<div class=\"body\">\n <ng-content select=\"ngs-mchart-tooltip-body\" />\n</div>\n<ng-content />\n", styles: [":host{display:block;width:max-content;box-shadow:var(--ngs-shadow-sm);border-radius:var(--ngs-radius-lg);background:#fff;font-size:var(--ngs-font-size-xs);overflow:hidden}:host .title:empty{display:none}:host .body:empty{display:none}:host-context(html.dark){background:var(--ngs-color-tertiary-200);color:var(--ngs-color-neutral-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.Eager });
911
- }
912
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartTooltip, decorators: [{
913
- type: Component,
914
- args: [{ selector: 'ngs-mchart-tooltip', exportAs: 'ngsMchartTooltip', changeDetection: ChangeDetectionStrategy.Eager, host: {
915
- 'class': 'ngs-mchart-tooltip'
916
- }, template: "<div class=\"title\">\n <ng-content select=\"ngs-mchart-tooltip-title\" />\n</div>\n<div class=\"body\">\n <ng-content select=\"ngs-mchart-tooltip-body\" />\n</div>\n<ng-content />\n", styles: [":host{display:block;width:max-content;box-shadow:var(--ngs-shadow-sm);border-radius:var(--ngs-radius-lg);background:#fff;font-size:var(--ngs-font-size-xs);overflow:hidden}:host .title:empty{display:none}:host .body:empty{display:none}:host-context(html.dark){background:var(--ngs-color-tertiary-200);color:var(--ngs-color-neutral-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
917
- }] });
918
-
919
- class MchartTooltipTitle {
920
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartTooltipTitle, deps: [], target: i0.ɵɵFactoryTarget.Component });
921
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: MchartTooltipTitle, isStandalone: true, selector: "ngs-mchart-tooltip-title", host: { classAttribute: "ngs-mchart-tooltip-title" }, exportAs: ["ngsMchartTooltipTitle"], ngImport: i0, template: "<ng-content />\n", styles: [":host{display:block;background:var(--ngs-color-neutral-200);padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2);font-weight:500}:host-context(html.dark){background:var(--ngs-color-neutral-300);color:var(--ngs-color-neutral-900)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.Eager });
922
- }
923
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartTooltipTitle, decorators: [{
924
- type: Component,
925
- args: [{ selector: 'ngs-mchart-tooltip-title', exportAs: 'ngsMchartTooltipTitle', changeDetection: ChangeDetectionStrategy.Eager, host: {
926
- 'class': 'ngs-mchart-tooltip-title'
927
- }, template: "<ng-content />\n", styles: [":host{display:block;background:var(--ngs-color-neutral-200);padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2);font-weight:500}:host-context(html.dark){background:var(--ngs-color-neutral-300);color:var(--ngs-color-neutral-900)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
928
- }] });
929
-
930
- class MchartTooltipBody {
931
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartTooltipBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
932
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: MchartTooltipBody, isStandalone: true, selector: "ngs-mchart-tooltip-body", host: { classAttribute: "ngs-mchart-tooltip-body" }, exportAs: ["ngsMchartTooltipBody"], ngImport: i0, template: "<ng-content />\n", styles: [":host{display:block;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.Eager });
933
- }
934
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MchartTooltipBody, decorators: [{
935
- type: Component,
936
- args: [{ selector: 'ngs-mchart-tooltip-body', exportAs: 'ngsMchartTooltipBody', changeDetection: ChangeDetectionStrategy.Eager, host: {
937
- 'class': 'ngs-mchart-tooltip-body'
938
- }, template: "<ng-content />\n", styles: [":host{display:block;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
939
- }] });
940
-
941
- /**
942
- * Generated bundle index. Do not edit.
943
- */
944
-
544
+ var MchartBar = class MchartBar extends BaseChartTooltip {
545
+ _initialized = false;
546
+ _host;
547
+ _svg;
548
+ _hlContainer;
549
+ _dataContainer;
550
+ _dimensions;
551
+ _innerWidth = 0;
552
+ _innerHeight = 0;
553
+ _hostWidth = 0;
554
+ _hostHeight = 0;
555
+ _xScale;
556
+ _yScale;
557
+ _resizeObserver;
558
+ _platformId = inject(PLATFORM_ID);
559
+ _elementRef = inject(ElementRef);
560
+ _destroyRef = inject(DestroyRef);
561
+ data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
562
+ labels = input([], ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
563
+ gap = input(.2, {
564
+ ...ngDevMode ? { debugName: "gap" } : /* istanbul ignore next */ {},
565
+ transform: numberAttribute
566
+ });
567
+ radius = input(0, {
568
+ ...ngDevMode ? { debugName: "radius" } : /* istanbul ignore next */ {},
569
+ transform: numberAttribute
570
+ });
571
+ highlight = input(false, {
572
+ ...ngDevMode ? { debugName: "highlight" } : /* istanbul ignore next */ {},
573
+ transform: booleanAttribute
574
+ });
575
+ responsive = input(false, {
576
+ ...ngDevMode ? { debugName: "responsive" } : /* istanbul ignore next */ {},
577
+ transform: booleanAttribute
578
+ });
579
+ fillGradient = input(false, {
580
+ ...ngDevMode ? { debugName: "fillGradient" } : /* istanbul ignore next */ {},
581
+ transform: booleanAttribute
582
+ });
583
+ xAccessor = input((d, i) => i, ...ngDevMode ? [{ debugName: "xAccessor" }] : /* istanbul ignore next */ []);
584
+ yAccessor = input((d) => d, ...ngDevMode ? [{ debugName: "yAccessor" }] : /* istanbul ignore next */ []);
585
+ tooltip = input(...ngDevMode ? [void 0, { debugName: "tooltip" }] : /* istanbul ignore next */ []);
586
+ tooltipPosition = input("after-center", ...ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []);
587
+ _currentTooltipPosition = "after-center";
588
+ get gradientId() {
589
+ return "areaGradient" + this._gradientId;
590
+ }
591
+ _gradientId = nextId++;
592
+ constructor() {
593
+ super();
594
+ effect(() => {
595
+ this._currentTooltipPosition = this.tooltipPosition();
596
+ });
597
+ effect(() => {
598
+ if (!this._initialized) return;
599
+ this._render();
600
+ this._setupResizeObserver();
601
+ });
602
+ }
603
+ ngAfterViewChecked() {
604
+ if (isPlatformServer(this._platformId)) return;
605
+ if (!this._initialized) {
606
+ const element = this._elementRef.nativeElement;
607
+ this._dimensions = element.getBoundingClientRect();
608
+ if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
609
+ this._initialized = true;
610
+ this._render();
611
+ this._setupResizeObserver();
612
+ }
613
+ }
614
+ }
615
+ ngOnDestroy() {
616
+ this._resizeObserver?.disconnect();
617
+ }
618
+ getTooltipPosition() {
619
+ return this._currentTooltipPosition;
620
+ }
621
+ getTooltipTemplateRef() {
622
+ return this.tooltip();
623
+ }
624
+ _render() {
625
+ this._init();
626
+ this._setupAxisScale();
627
+ this._setupData();
628
+ this._initTooltip();
629
+ }
630
+ _init() {
631
+ this._hostWidth = this._dimensions.width;
632
+ this._hostHeight = this._dimensions.height;
633
+ this._innerWidth = this._dimensions.width;
634
+ this._innerHeight = this._dimensions.height;
635
+ this._host = select(this._elementRef.nativeElement);
636
+ this._svg = this._host.select("svg").attr("viewBox", `0 0 ${this._hostWidth} ${this._hostHeight}`);
637
+ }
638
+ _setupAxisScale() {
639
+ if (!this._xScale) this._xScale = scaleBand().paddingInner(this.gap()).domain(this.data().map((d, i) => i.toString()));
640
+ this._xScale.range([0, this._innerWidth]);
641
+ if (!this._yScale) this._yScale = scaleLinear().domain([0, Math.max(...this.data())]);
642
+ this._yScale.range([this._innerHeight, 0]);
643
+ }
644
+ _setupData() {
645
+ if (this.highlight()) {
646
+ if (!this._hlContainer) {
647
+ this._hlContainer = this._svg.append("g").attr("class", "hl-container").attr("transform", `translate(0,0)`);
648
+ this._hlContainer.selectAll("rect").data(this.data()).enter().append("rect").attr("rx", this.radius()).attr("x", (d, i) => this._xScale(i.toString())).attr("y", 0).attr("width", this._xScale.bandwidth()).attr("height", this._innerHeight).attr("class", "highlight");
649
+ } else this._hlContainer.selectAll("rect").attr("x", (d, i) => this._xScale(i.toString())).attr("y", 0).attr("width", this._xScale.bandwidth()).attr("height", this._innerHeight);
650
+ }
651
+ if (!this._dataContainer) {
652
+ this._dataContainer = this._svg.append("g").attr("class", "data-container").attr("transform", `translate(0,0)`);
653
+ const allBars = this._dataContainer.selectAll("rect").data(this.data()).enter().append("rect").attr("rx", this.radius()).attr("x", (d, i) => this._xScale(i.toString())).attr("y", (d) => this._yScale(d)).attr("width", this._xScale.bandwidth()).attr("height", (d) => this._innerHeight - this._yScale(d)).attr("class", "bar");
654
+ if (this.fillGradient()) allBars.attr("fill", `url(#${this.gradientId})`);
655
+ } else this._dataContainer.selectAll("rect").attr("x", (d, i) => this._xScale(i.toString())).attr("y", (d) => this._yScale(d)).attr("width", this._xScale.bandwidth()).attr("height", (d) => this._innerHeight - this._yScale(d));
656
+ }
657
+ _setupResizeObserver() {
658
+ if (!this.responsive()) return;
659
+ this._resizeObserver?.disconnect();
660
+ this._resizeObserver = new ResizeObserver((entries) => {
661
+ if (this._hostWidth !== entries[0].contentRect.width || this._hostHeight !== entries[0].contentRect.height) {
662
+ this._hostWidth = entries[0].contentRect.width;
663
+ this._hostHeight = entries[0].contentRect.height;
664
+ this._innerWidth = entries[0].contentRect.width;
665
+ this._innerHeight = entries[0].contentRect.height;
666
+ this._svg.attr("viewBox", `0 0 ${this._hostWidth} ${this._hostHeight}`);
667
+ this._setupAxisScale();
668
+ this._setupData();
669
+ }
670
+ });
671
+ this._resizeObserver.observe(this._elementRef.nativeElement);
672
+ }
673
+ _initTooltip() {
674
+ if (!this.tooltip()) return;
675
+ const xAccessor = this.xAccessor();
676
+ const yAccessor = this.yAccessor();
677
+ this._createTooltipOrigin();
678
+ let x = 0;
679
+ let label;
680
+ let value;
681
+ let oldX;
682
+ fromEvent(this._document, "mousemove").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((e) => {
683
+ const target = e.target;
684
+ const [posX, posY] = pointer(e, this._svg.node());
685
+ let visible = true;
686
+ if (posX < 0 || posY < 0 || posX > this._hostWidth || posY > this._hostHeight) {
687
+ visible = false;
688
+ oldX = null;
689
+ this._overlayRef?.detach();
690
+ } else if (!target.closest(".ngs-mchart-line") || !target.classList.contains("ngs-mchart-tooltip-overlay") || !target.closest(".ngs-mchart-tooltip-overlay")) {
691
+ oldX = null;
692
+ this._overlayRef?.detach();
693
+ }
694
+ const eachBand = this._xScale.step();
695
+ const index = Math.floor(posX / eachBand);
696
+ const dataValue = this.data()[index];
697
+ label = this.labels()[index] ? this.labels()[index] : xAccessor(index, index);
698
+ value = yAccessor(dataValue);
699
+ x = this._xScale(xAccessor(index, index));
700
+ this._yScale(yAccessor(dataValue));
701
+ if (posX < this._hostWidth / 2) this._currentTooltipPosition = "after-center";
702
+ else this._currentTooltipPosition = "before-center";
703
+ this._setTooltipPositionByEvent(e);
704
+ if (visible) {
705
+ this._setTooltipVisible();
706
+ if (!this._overlayRef?.hasAttached()) {
707
+ oldX = x;
708
+ this._showTooltip({
709
+ label,
710
+ value
711
+ });
712
+ } else if (oldX !== x) {
713
+ oldX = x;
714
+ this._showTooltip({
715
+ label,
716
+ value
717
+ });
718
+ } else {
719
+ this._overlayRef.updatePositionStrategy(this._getOverlayPositionStrategy());
720
+ this._overlayRef.updatePosition();
721
+ }
722
+ } else {
723
+ oldX = x;
724
+ this._setTooltipInVisible();
725
+ }
726
+ });
727
+ }
728
+ static ɵfac = i0.ɵɵngDeclareFactory({
729
+ minVersion: "12.0.0",
730
+ version: "22.3.0",
731
+ ngImport: i0,
732
+ type: MchartBar,
733
+ deps: [],
734
+ target: i0.ɵɵFactoryTarget.Component
735
+ });
736
+ static ɵcmp = i0.ɵɵngDeclareComponent({
737
+ minVersion: "17.0.0",
738
+ version: "22.3.0",
739
+ type: MchartBar,
740
+ isStandalone: true,
741
+ selector: "ngs-mchart-bar",
742
+ inputs: {
743
+ data: {
744
+ classPropertyName: "data",
745
+ publicName: "data",
746
+ isSignal: true,
747
+ isRequired: false,
748
+ transformFunction: null
749
+ },
750
+ labels: {
751
+ classPropertyName: "labels",
752
+ publicName: "labels",
753
+ isSignal: true,
754
+ isRequired: false,
755
+ transformFunction: null
756
+ },
757
+ gap: {
758
+ classPropertyName: "gap",
759
+ publicName: "gap",
760
+ isSignal: true,
761
+ isRequired: false,
762
+ transformFunction: null
763
+ },
764
+ radius: {
765
+ classPropertyName: "radius",
766
+ publicName: "radius",
767
+ isSignal: true,
768
+ isRequired: false,
769
+ transformFunction: null
770
+ },
771
+ highlight: {
772
+ classPropertyName: "highlight",
773
+ publicName: "highlight",
774
+ isSignal: true,
775
+ isRequired: false,
776
+ transformFunction: null
777
+ },
778
+ responsive: {
779
+ classPropertyName: "responsive",
780
+ publicName: "responsive",
781
+ isSignal: true,
782
+ isRequired: false,
783
+ transformFunction: null
784
+ },
785
+ fillGradient: {
786
+ classPropertyName: "fillGradient",
787
+ publicName: "fillGradient",
788
+ isSignal: true,
789
+ isRequired: false,
790
+ transformFunction: null
791
+ },
792
+ xAccessor: {
793
+ classPropertyName: "xAccessor",
794
+ publicName: "xAccessor",
795
+ isSignal: true,
796
+ isRequired: false,
797
+ transformFunction: null
798
+ },
799
+ yAccessor: {
800
+ classPropertyName: "yAccessor",
801
+ publicName: "yAccessor",
802
+ isSignal: true,
803
+ isRequired: false,
804
+ transformFunction: null
805
+ },
806
+ tooltip: {
807
+ classPropertyName: "tooltip",
808
+ publicName: "tooltip",
809
+ isSignal: true,
810
+ isRequired: false,
811
+ transformFunction: null
812
+ },
813
+ tooltipPosition: {
814
+ classPropertyName: "tooltipPosition",
815
+ publicName: "tooltipPosition",
816
+ isSignal: true,
817
+ isRequired: false,
818
+ transformFunction: null
819
+ }
820
+ },
821
+ host: {
822
+ properties: {
823
+ "class.fill-gradient": "fillGradient()",
824
+ "class.with-tooltip": "!!tooltip()"
825
+ },
826
+ classAttribute: "ngs-mchart-bar"
827
+ },
828
+ exportAs: ["ngsMchartBar"],
829
+ usesInheritance: true,
830
+ ngImport: i0,
831
+ template: "<svg>\n <defs>\n @if (fillGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n </defs>\n</svg>\n",
832
+ styles: [":host{--ngs-mchart-bar-bar-bg: var(--ngs-color-primary);--ngs-mchart-bar-bar-gradient-start-color: var(--ngs-color-primary-500);--ngs-mchart-bar-bar-gradient-end-color: var(--ngs-color-primary);--ngs-mchart-bar-highlight-bg: var(--ngs-color-neutral-200);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .highlight{fill:var(--ngs-mchart-bar-highlight-bg)}:host:not(.fill-gradient) ::ng-deep .bar{fill:var(--ngs-mchart-bar-bar-bg)}:host.fill-gradient .lg-start-color{stop-color:var(--ngs-mchart-bar-bar-gradient-start-color)}:host.fill-gradient .lg-end-color{stop-color:var(--ngs-mchart-bar-bar-gradient-end-color)}:host.with-tooltip ::ng-deep .bar:hover{opacity:.85}:host-context(html.dark){--ngs-mchart-bar-highlight-bg: var(--ngs-color-neutral-700)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
833
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
834
+ });
835
+ };
836
+ i0.ɵɵngDeclareClassMetadata({
837
+ minVersion: "12.0.0",
838
+ version: "22.3.0",
839
+ ngImport: i0,
840
+ type: MchartBar,
841
+ decorators: [{
842
+ type: Component,
843
+ args: [{
844
+ selector: "ngs-mchart-bar",
845
+ exportAs: "ngsMchartBar",
846
+ changeDetection: ChangeDetectionStrategy.OnPush,
847
+ host: {
848
+ "class": "ngs-mchart-bar",
849
+ "[class.fill-gradient]": "fillGradient()",
850
+ "[class.with-tooltip]": "!!tooltip()"
851
+ },
852
+ template: "<svg>\n <defs>\n @if (fillGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n </defs>\n</svg>\n",
853
+ styles: [":host{--ngs-mchart-bar-bar-bg: var(--ngs-color-primary);--ngs-mchart-bar-bar-gradient-start-color: var(--ngs-color-primary-500);--ngs-mchart-bar-bar-gradient-end-color: var(--ngs-color-primary);--ngs-mchart-bar-highlight-bg: var(--ngs-color-neutral-200);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .highlight{fill:var(--ngs-mchart-bar-highlight-bg)}:host:not(.fill-gradient) ::ng-deep .bar{fill:var(--ngs-mchart-bar-bar-bg)}:host.fill-gradient .lg-start-color{stop-color:var(--ngs-mchart-bar-bar-gradient-start-color)}:host.fill-gradient .lg-end-color{stop-color:var(--ngs-mchart-bar-bar-gradient-end-color)}:host.with-tooltip ::ng-deep .bar:hover{opacity:.85}:host-context(html.dark){--ngs-mchart-bar-highlight-bg: var(--ngs-color-neutral-700)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
854
+ }]
855
+ }],
856
+ ctorParameters: () => [],
857
+ propDecorators: {
858
+ data: [{
859
+ type: i0.Input,
860
+ args: [{
861
+ isSignal: true,
862
+ alias: "data",
863
+ required: false
864
+ }]
865
+ }],
866
+ labels: [{
867
+ type: i0.Input,
868
+ args: [{
869
+ isSignal: true,
870
+ alias: "labels",
871
+ required: false
872
+ }]
873
+ }],
874
+ gap: [{
875
+ type: i0.Input,
876
+ args: [{
877
+ isSignal: true,
878
+ alias: "gap",
879
+ required: false
880
+ }]
881
+ }],
882
+ radius: [{
883
+ type: i0.Input,
884
+ args: [{
885
+ isSignal: true,
886
+ alias: "radius",
887
+ required: false
888
+ }]
889
+ }],
890
+ highlight: [{
891
+ type: i0.Input,
892
+ args: [{
893
+ isSignal: true,
894
+ alias: "highlight",
895
+ required: false
896
+ }]
897
+ }],
898
+ responsive: [{
899
+ type: i0.Input,
900
+ args: [{
901
+ isSignal: true,
902
+ alias: "responsive",
903
+ required: false
904
+ }]
905
+ }],
906
+ fillGradient: [{
907
+ type: i0.Input,
908
+ args: [{
909
+ isSignal: true,
910
+ alias: "fillGradient",
911
+ required: false
912
+ }]
913
+ }],
914
+ xAccessor: [{
915
+ type: i0.Input,
916
+ args: [{
917
+ isSignal: true,
918
+ alias: "xAccessor",
919
+ required: false
920
+ }]
921
+ }],
922
+ yAccessor: [{
923
+ type: i0.Input,
924
+ args: [{
925
+ isSignal: true,
926
+ alias: "yAccessor",
927
+ required: false
928
+ }]
929
+ }],
930
+ tooltip: [{
931
+ type: i0.Input,
932
+ args: [{
933
+ isSignal: true,
934
+ alias: "tooltip",
935
+ required: false
936
+ }]
937
+ }],
938
+ tooltipPosition: [{
939
+ type: i0.Input,
940
+ args: [{
941
+ isSignal: true,
942
+ alias: "tooltipPosition",
943
+ required: false
944
+ }]
945
+ }]
946
+ }
947
+ });
948
+ var MchartPie = class MchartPie extends BaseChartTooltip {
949
+ _initialized = false;
950
+ _host;
951
+ _svg;
952
+ _dataContainer;
953
+ _legendContainer;
954
+ _dimensions;
955
+ _innerWidth = 0;
956
+ _innerHeight = 0;
957
+ _hostWidth = 0;
958
+ _hostHeight = 0;
959
+ _resizeObserver;
960
+ _platformId = inject(PLATFORM_ID);
961
+ _elementRef = inject(ElementRef);
962
+ _radius = 0;
963
+ _arcGenerator;
964
+ _pieGenerator;
965
+ _colorsGenerator;
966
+ _arcTweenGenerator;
967
+ _pieData;
968
+ data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
969
+ labels = input([], ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
970
+ valueAccessor = input((d) => d, ...ngDevMode ? [{ debugName: "valueAccessor" }] : /* istanbul ignore next */ []);
971
+ dataItemStrokeWidth = input(1, {
972
+ ...ngDevMode ? { debugName: "dataItemStrokeWidth" } : /* istanbul ignore next */ {},
973
+ transform: numberAttribute
974
+ });
975
+ legendContainerWidth = input(0, {
976
+ ...ngDevMode ? { debugName: "legendContainerWidth" } : /* istanbul ignore next */ {},
977
+ transform: numberAttribute
978
+ });
979
+ showDataAnimation = input(false, {
980
+ ...ngDevMode ? { debugName: "showDataAnimation" } : /* istanbul ignore next */ {},
981
+ transform: booleanAttribute
982
+ });
983
+ showValueOnSlices = input(false, {
984
+ ...ngDevMode ? { debugName: "showValueOnSlices" } : /* istanbul ignore next */ {},
985
+ transform: booleanAttribute
986
+ });
987
+ showLegend = input(false, {
988
+ ...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
989
+ transform: booleanAttribute
990
+ });
991
+ legendOffset = input(30, {
992
+ ...ngDevMode ? { debugName: "legendOffset" } : /* istanbul ignore next */ {},
993
+ transform: numberAttribute
994
+ });
995
+ legendItemHeight = input(30, {
996
+ ...ngDevMode ? { debugName: "legendItemHeight" } : /* istanbul ignore next */ {},
997
+ transform: numberAttribute
998
+ });
999
+ legendItemSymbolSize = input(12, {
1000
+ ...ngDevMode ? { debugName: "legendItemSymbolSize" } : /* istanbul ignore next */ {},
1001
+ transform: numberAttribute
1002
+ });
1003
+ legendItemFontSize = input(14, {
1004
+ ...ngDevMode ? { debugName: "legendItemFontSize" } : /* istanbul ignore next */ {},
1005
+ transform: numberAttribute
1006
+ });
1007
+ legendItemSymbolBorderRadius = input(12, {
1008
+ ...ngDevMode ? { debugName: "legendItemSymbolBorderRadius" } : /* istanbul ignore next */ {},
1009
+ transform: numberAttribute
1010
+ });
1011
+ valueFontSize = input(12, {
1012
+ ...ngDevMode ? { debugName: "valueFontSize" } : /* istanbul ignore next */ {},
1013
+ transform: numberAttribute
1014
+ });
1015
+ tooltip = input(...ngDevMode ? [void 0, { debugName: "tooltip" }] : /* istanbul ignore next */ []);
1016
+ tooltipPosition = input("after-center", ...ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []);
1017
+ getTooltipPosition() {
1018
+ return this.tooltipPosition();
1019
+ }
1020
+ getTooltipTemplateRef() {
1021
+ return this.tooltip();
1022
+ }
1023
+ ngAfterViewChecked() {
1024
+ if (isPlatformServer(this._platformId)) return;
1025
+ if (!this._initialized) {
1026
+ const element = this._elementRef.nativeElement;
1027
+ this._dimensions = element.getBoundingClientRect();
1028
+ if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
1029
+ this._initialized = true;
1030
+ this._render();
1031
+ this._setupResizeObserver();
1032
+ }
1033
+ }
1034
+ }
1035
+ ngOnChanges(changes) {
1036
+ if (!this._initialized) return;
1037
+ if (changes["data"] && !changes["data"].firstChange) this._draw(true);
1038
+ }
1039
+ ngOnDestroy() {
1040
+ this._resizeObserver?.disconnect();
1041
+ }
1042
+ _render() {
1043
+ this._initDimensions();
1044
+ this._initContainers();
1045
+ this._setGenerators();
1046
+ this._setLegend();
1047
+ this._draw();
1048
+ this._initTooltip();
1049
+ }
1050
+ _initDimensions() {
1051
+ const legendContainerWidth = this.showLegend() ? this.legendContainerWidth() : 0;
1052
+ this._hostWidth = this._dimensions.width;
1053
+ this._hostHeight = this._dimensions.height;
1054
+ this._innerWidth = this._dimensions.width - legendContainerWidth - this.dataItemStrokeWidth() * 2;
1055
+ this._innerHeight = this._dimensions.height - this.dataItemStrokeWidth() * 2;
1056
+ this._host = select(this._elementRef.nativeElement);
1057
+ this._svg = this._host.select("svg").attr("viewBox", `0 0 ${this._hostWidth} ${this._hostHeight}`);
1058
+ this._radius = Math.min(this._innerWidth, this._innerHeight) * .5;
1059
+ }
1060
+ _initContainers() {
1061
+ this._dataContainer = this._svg.append("g").attr("class", "data-container").attr("transform", `translate(${this._radius},${this._innerHeight * .5})`);
1062
+ if (this.showLegend()) this._legendContainer = this._svg.append("g").attr("class", "legend-container");
1063
+ }
1064
+ _setGenerators() {
1065
+ const self = this;
1066
+ this._arcGenerator = arc().innerRadius(0).outerRadius(this._radius);
1067
+ this._pieGenerator = pie().value(this.valueAccessor());
1068
+ this._colorsGenerator = scaleOrdinal(schemeTableau10).domain(this.data().map((d, i) => i.toString()));
1069
+ this._arcTweenGenerator = function(d) {
1070
+ const _this = this;
1071
+ const current = d;
1072
+ const interpolateGenerator = interpolate(_this._previous, current);
1073
+ _this._previous = current;
1074
+ return (t) => {
1075
+ return self._arcGenerator(interpolateGenerator(t));
1076
+ };
1077
+ };
1078
+ }
1079
+ _setLegend() {
1080
+ if (!this.showLegend()) return;
1081
+ this._legendContainer.selectAll("g.legend-item").data(this.data()).join("g").attr("class", "legend-item").attr("data-index", (d, i) => i).attr("transform", (d, i) => `translate(0, ${i * this.legendItemHeight()})`).on("mouseenter", (event, d) => {
1082
+ const index = +event.target.getAttribute("data-index");
1083
+ this._dataContainer.select(`path.data-item[data-index="${index}"]`).classed("active", true);
1084
+ }).on("mouseleave", (event, d) => {
1085
+ const index = +event.target.getAttribute("data-index");
1086
+ this._dataContainer.select(`path.data-item[data-index="${index}"]`).classed("active", false);
1087
+ });
1088
+ this._legendContainer.selectAll("g.legend-item").selectAll("text").data((d, i) => [i]).join("text").attr("class", "legend-item-text").attr("x", this.legendItemSymbolSize() * 2).attr("y", this.legendItemHeight() * .5).attr("font-size", this.legendItemFontSize()).text((i) => this.labels()[i]);
1089
+ this._legendContainer.selectAll("g.legend-item").selectAll("rect").data((d, i) => [i]).join("rect").attr("class", "legend-item-symbol").attr("rx", this.legendItemSymbolBorderRadius()).attr("width", this.legendItemSymbolSize()).attr("height", this.legendItemSymbolSize()).attr("fill", (i) => this._colorsGenerator(i)).attr("y", this.legendItemFontSize() * .5 - 2);
1090
+ const dimensions = this._legendContainer.node().getBBox();
1091
+ this._legendContainer.attr("transform", `translate(${this._radius * 2 + this.legendOffset()},${this._innerHeight * .5 - .5 * dimensions.height})`);
1092
+ }
1093
+ _draw(isUpdate = false) {
1094
+ if (isUpdate) this._colorsGenerator.domain(this.data().map((d, i) => i.toString()));
1095
+ this._pieData = this._pieGenerator(this.data());
1096
+ this._dataContainer.selectAll("g.data-item-group").data(this.data()).join("g").attr("class", "data-item-group").attr("data-index", (d, i) => i);
1097
+ this._dataContainer.selectAll("g.data-item-group").selectAll("path").data((d, i) => [this._pieData[i]]).join("path").attr("class", "data-item").attr("stroke-width", this.dataItemStrokeWidth()).attr("d", (d) => this._arcGenerator(d)).style("fill", (d) => this._colorsGenerator(d.index)).attr("data-index", (d) => d.index).transition().duration(this.showDataAnimation() ? 1e3 : 0).attrTween("d", this._arcTweenGenerator);
1098
+ if (this.showValueOnSlices()) this._dataContainer.selectAll("g.data-item-group").selectAll("text").data((d, i) => [this._pieData[i]]).join("text").attr("class", "value").attr("font-size", this.valueFontSize()).attr("transform", (d) => {
1099
+ const coordinates = this._arcGenerator.centroid(d);
1100
+ return `translate(${coordinates[0]},${coordinates[1]})`;
1101
+ }).text((d) => d.data);
1102
+ }
1103
+ _setupResizeObserver() {}
1104
+ _initTooltip() {
1105
+ if (!this.tooltip()) return;
1106
+ let oldValue;
1107
+ this._createTooltipOrigin();
1108
+ this._dataContainer.selectAll("g.data-item-group").data(this._pieData).on("mousemove", (event, d) => {
1109
+ const target = event.target;
1110
+ this._setTooltipPositionByEvent(event);
1111
+ this._setTooltipVisible();
1112
+ const index = +target.getAttribute("data-index");
1113
+ const label = this.labels()[index] ? this.labels()[index] : null;
1114
+ const color = this._colorsGenerator(index);
1115
+ const value = d.data;
1116
+ if (!this._overlayRef?.hasAttached()) {
1117
+ this._showTooltip({
1118
+ label,
1119
+ color,
1120
+ value
1121
+ });
1122
+ oldValue = value;
1123
+ } else if (oldValue !== d.data) {
1124
+ this._showTooltip({
1125
+ label,
1126
+ color,
1127
+ value
1128
+ });
1129
+ oldValue = value;
1130
+ } else this._overlayRef.updatePosition();
1131
+ });
1132
+ this._dataContainer.on("mouseleave", (event) => {
1133
+ this._setTooltipInVisible();
1134
+ this._hideTooltip();
1135
+ });
1136
+ }
1137
+ static ɵfac = i0.ɵɵngDeclareFactory({
1138
+ minVersion: "12.0.0",
1139
+ version: "22.3.0",
1140
+ ngImport: i0,
1141
+ type: MchartPie,
1142
+ deps: null,
1143
+ target: i0.ɵɵFactoryTarget.Component
1144
+ });
1145
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1146
+ minVersion: "17.1.0",
1147
+ version: "22.3.0",
1148
+ type: MchartPie,
1149
+ isStandalone: true,
1150
+ selector: "ngs-mchart-pie",
1151
+ inputs: {
1152
+ data: {
1153
+ classPropertyName: "data",
1154
+ publicName: "data",
1155
+ isSignal: true,
1156
+ isRequired: false,
1157
+ transformFunction: null
1158
+ },
1159
+ labels: {
1160
+ classPropertyName: "labels",
1161
+ publicName: "labels",
1162
+ isSignal: true,
1163
+ isRequired: false,
1164
+ transformFunction: null
1165
+ },
1166
+ valueAccessor: {
1167
+ classPropertyName: "valueAccessor",
1168
+ publicName: "valueAccessor",
1169
+ isSignal: true,
1170
+ isRequired: false,
1171
+ transformFunction: null
1172
+ },
1173
+ dataItemStrokeWidth: {
1174
+ classPropertyName: "dataItemStrokeWidth",
1175
+ publicName: "dataItemStrokeWidth",
1176
+ isSignal: true,
1177
+ isRequired: false,
1178
+ transformFunction: null
1179
+ },
1180
+ legendContainerWidth: {
1181
+ classPropertyName: "legendContainerWidth",
1182
+ publicName: "legendContainerWidth",
1183
+ isSignal: true,
1184
+ isRequired: false,
1185
+ transformFunction: null
1186
+ },
1187
+ showDataAnimation: {
1188
+ classPropertyName: "showDataAnimation",
1189
+ publicName: "showDataAnimation",
1190
+ isSignal: true,
1191
+ isRequired: false,
1192
+ transformFunction: null
1193
+ },
1194
+ showValueOnSlices: {
1195
+ classPropertyName: "showValueOnSlices",
1196
+ publicName: "showValueOnSlices",
1197
+ isSignal: true,
1198
+ isRequired: false,
1199
+ transformFunction: null
1200
+ },
1201
+ showLegend: {
1202
+ classPropertyName: "showLegend",
1203
+ publicName: "showLegend",
1204
+ isSignal: true,
1205
+ isRequired: false,
1206
+ transformFunction: null
1207
+ },
1208
+ legendOffset: {
1209
+ classPropertyName: "legendOffset",
1210
+ publicName: "legendOffset",
1211
+ isSignal: true,
1212
+ isRequired: false,
1213
+ transformFunction: null
1214
+ },
1215
+ legendItemHeight: {
1216
+ classPropertyName: "legendItemHeight",
1217
+ publicName: "legendItemHeight",
1218
+ isSignal: true,
1219
+ isRequired: false,
1220
+ transformFunction: null
1221
+ },
1222
+ legendItemSymbolSize: {
1223
+ classPropertyName: "legendItemSymbolSize",
1224
+ publicName: "legendItemSymbolSize",
1225
+ isSignal: true,
1226
+ isRequired: false,
1227
+ transformFunction: null
1228
+ },
1229
+ legendItemFontSize: {
1230
+ classPropertyName: "legendItemFontSize",
1231
+ publicName: "legendItemFontSize",
1232
+ isSignal: true,
1233
+ isRequired: false,
1234
+ transformFunction: null
1235
+ },
1236
+ legendItemSymbolBorderRadius: {
1237
+ classPropertyName: "legendItemSymbolBorderRadius",
1238
+ publicName: "legendItemSymbolBorderRadius",
1239
+ isSignal: true,
1240
+ isRequired: false,
1241
+ transformFunction: null
1242
+ },
1243
+ valueFontSize: {
1244
+ classPropertyName: "valueFontSize",
1245
+ publicName: "valueFontSize",
1246
+ isSignal: true,
1247
+ isRequired: false,
1248
+ transformFunction: null
1249
+ },
1250
+ tooltip: {
1251
+ classPropertyName: "tooltip",
1252
+ publicName: "tooltip",
1253
+ isSignal: true,
1254
+ isRequired: false,
1255
+ transformFunction: null
1256
+ },
1257
+ tooltipPosition: {
1258
+ classPropertyName: "tooltipPosition",
1259
+ publicName: "tooltipPosition",
1260
+ isSignal: true,
1261
+ isRequired: false,
1262
+ transformFunction: null
1263
+ }
1264
+ },
1265
+ host: { classAttribute: "ngs-mchart-pie" },
1266
+ exportAs: ["ngsMchartPie"],
1267
+ usesInheritance: true,
1268
+ usesOnChanges: true,
1269
+ ngImport: i0,
1270
+ template: "<svg></svg>\n",
1271
+ styles: [":host{--ngs-mchart-pie-stroke-color: var(--ngs-color-background);--ngs-mchart-pie-legend-item-color: var(--ngs-color-neutral-900);--ngs-mchart-pie-legend-item-hover-color: var(--ngs-color-primary);--ngs-mchart-pie-value-color: var(--ngs-color-neutral-950);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host:has(.data-item.active) ::ng-deep .data-item:not(.active){opacity:.7;scale:.93;transition:scale .2s}:host ::ng-deep .data-item{stroke:var(--ngs-mchart-pie-stroke-color)}:host ::ng-deep .value{text-anchor:middle;alignment-baseline:middle;fill:var(--ngs-mchart-pie-value-color)}:host ::ng-deep .legend-item{cursor:pointer}:host ::ng-deep .legend-item:hover .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-hover-color)}:host ::ng-deep .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-color)}:host-context(html.dark){--ngs-mchart-pie-legend-item-color: var(--ngs-color-neutral-200)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1272
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1273
+ });
1274
+ };
1275
+ i0.ɵɵngDeclareClassMetadata({
1276
+ minVersion: "12.0.0",
1277
+ version: "22.3.0",
1278
+ ngImport: i0,
1279
+ type: MchartPie,
1280
+ decorators: [{
1281
+ type: Component,
1282
+ args: [{
1283
+ selector: "ngs-mchart-pie",
1284
+ exportAs: "ngsMchartPie",
1285
+ changeDetection: ChangeDetectionStrategy.OnPush,
1286
+ host: { "class": "ngs-mchart-pie" },
1287
+ template: "<svg></svg>\n",
1288
+ styles: [":host{--ngs-mchart-pie-stroke-color: var(--ngs-color-background);--ngs-mchart-pie-legend-item-color: var(--ngs-color-neutral-900);--ngs-mchart-pie-legend-item-hover-color: var(--ngs-color-primary);--ngs-mchart-pie-value-color: var(--ngs-color-neutral-950);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host:has(.data-item.active) ::ng-deep .data-item:not(.active){opacity:.7;scale:.93;transition:scale .2s}:host ::ng-deep .data-item{stroke:var(--ngs-mchart-pie-stroke-color)}:host ::ng-deep .value{text-anchor:middle;alignment-baseline:middle;fill:var(--ngs-mchart-pie-value-color)}:host ::ng-deep .legend-item{cursor:pointer}:host ::ng-deep .legend-item:hover .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-hover-color)}:host ::ng-deep .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-color)}:host-context(html.dark){--ngs-mchart-pie-legend-item-color: var(--ngs-color-neutral-200)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1289
+ }]
1290
+ }],
1291
+ propDecorators: {
1292
+ data: [{
1293
+ type: i0.Input,
1294
+ args: [{
1295
+ isSignal: true,
1296
+ alias: "data",
1297
+ required: false
1298
+ }]
1299
+ }],
1300
+ labels: [{
1301
+ type: i0.Input,
1302
+ args: [{
1303
+ isSignal: true,
1304
+ alias: "labels",
1305
+ required: false
1306
+ }]
1307
+ }],
1308
+ valueAccessor: [{
1309
+ type: i0.Input,
1310
+ args: [{
1311
+ isSignal: true,
1312
+ alias: "valueAccessor",
1313
+ required: false
1314
+ }]
1315
+ }],
1316
+ dataItemStrokeWidth: [{
1317
+ type: i0.Input,
1318
+ args: [{
1319
+ isSignal: true,
1320
+ alias: "dataItemStrokeWidth",
1321
+ required: false
1322
+ }]
1323
+ }],
1324
+ legendContainerWidth: [{
1325
+ type: i0.Input,
1326
+ args: [{
1327
+ isSignal: true,
1328
+ alias: "legendContainerWidth",
1329
+ required: false
1330
+ }]
1331
+ }],
1332
+ showDataAnimation: [{
1333
+ type: i0.Input,
1334
+ args: [{
1335
+ isSignal: true,
1336
+ alias: "showDataAnimation",
1337
+ required: false
1338
+ }]
1339
+ }],
1340
+ showValueOnSlices: [{
1341
+ type: i0.Input,
1342
+ args: [{
1343
+ isSignal: true,
1344
+ alias: "showValueOnSlices",
1345
+ required: false
1346
+ }]
1347
+ }],
1348
+ showLegend: [{
1349
+ type: i0.Input,
1350
+ args: [{
1351
+ isSignal: true,
1352
+ alias: "showLegend",
1353
+ required: false
1354
+ }]
1355
+ }],
1356
+ legendOffset: [{
1357
+ type: i0.Input,
1358
+ args: [{
1359
+ isSignal: true,
1360
+ alias: "legendOffset",
1361
+ required: false
1362
+ }]
1363
+ }],
1364
+ legendItemHeight: [{
1365
+ type: i0.Input,
1366
+ args: [{
1367
+ isSignal: true,
1368
+ alias: "legendItemHeight",
1369
+ required: false
1370
+ }]
1371
+ }],
1372
+ legendItemSymbolSize: [{
1373
+ type: i0.Input,
1374
+ args: [{
1375
+ isSignal: true,
1376
+ alias: "legendItemSymbolSize",
1377
+ required: false
1378
+ }]
1379
+ }],
1380
+ legendItemFontSize: [{
1381
+ type: i0.Input,
1382
+ args: [{
1383
+ isSignal: true,
1384
+ alias: "legendItemFontSize",
1385
+ required: false
1386
+ }]
1387
+ }],
1388
+ legendItemSymbolBorderRadius: [{
1389
+ type: i0.Input,
1390
+ args: [{
1391
+ isSignal: true,
1392
+ alias: "legendItemSymbolBorderRadius",
1393
+ required: false
1394
+ }]
1395
+ }],
1396
+ valueFontSize: [{
1397
+ type: i0.Input,
1398
+ args: [{
1399
+ isSignal: true,
1400
+ alias: "valueFontSize",
1401
+ required: false
1402
+ }]
1403
+ }],
1404
+ tooltip: [{
1405
+ type: i0.Input,
1406
+ args: [{
1407
+ isSignal: true,
1408
+ alias: "tooltip",
1409
+ required: false
1410
+ }]
1411
+ }],
1412
+ tooltipPosition: [{
1413
+ type: i0.Input,
1414
+ args: [{
1415
+ isSignal: true,
1416
+ alias: "tooltipPosition",
1417
+ required: false
1418
+ }]
1419
+ }]
1420
+ }
1421
+ });
1422
+ var MchartTooltip = class MchartTooltip {
1423
+ static ɵfac = i0.ɵɵngDeclareFactory({
1424
+ minVersion: "12.0.0",
1425
+ version: "22.3.0",
1426
+ ngImport: i0,
1427
+ type: MchartTooltip,
1428
+ deps: [],
1429
+ target: i0.ɵɵFactoryTarget.Component
1430
+ });
1431
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1432
+ minVersion: "14.0.0",
1433
+ version: "22.3.0",
1434
+ type: MchartTooltip,
1435
+ isStandalone: true,
1436
+ selector: "ngs-mchart-tooltip",
1437
+ host: { classAttribute: "ngs-mchart-tooltip" },
1438
+ exportAs: ["ngsMchartTooltip"],
1439
+ ngImport: i0,
1440
+ template: "<div class=\"title\">\n <ng-content select=\"ngs-mchart-tooltip-title\" />\n</div>\n<div class=\"body\">\n <ng-content select=\"ngs-mchart-tooltip-body\" />\n</div>\n<ng-content />\n",
1441
+ styles: [":host{display:block;width:max-content;box-shadow:var(--ngs-shadow-sm);border-radius:var(--ngs-radius-lg);background:#fff;font-size:var(--ngs-font-size-xs);overflow:hidden}:host .title:empty{display:none}:host .body:empty{display:none}:host-context(html.dark){background:var(--ngs-color-tertiary-200);color:var(--ngs-color-neutral-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1442
+ changeDetection: i0.ChangeDetectionStrategy.Eager
1443
+ });
1444
+ };
1445
+ i0.ɵɵngDeclareClassMetadata({
1446
+ minVersion: "12.0.0",
1447
+ version: "22.3.0",
1448
+ ngImport: i0,
1449
+ type: MchartTooltip,
1450
+ decorators: [{
1451
+ type: Component,
1452
+ args: [{
1453
+ selector: "ngs-mchart-tooltip",
1454
+ exportAs: "ngsMchartTooltip",
1455
+ changeDetection: ChangeDetectionStrategy.Eager,
1456
+ host: { "class": "ngs-mchart-tooltip" },
1457
+ template: "<div class=\"title\">\n <ng-content select=\"ngs-mchart-tooltip-title\" />\n</div>\n<div class=\"body\">\n <ng-content select=\"ngs-mchart-tooltip-body\" />\n</div>\n<ng-content />\n",
1458
+ styles: [":host{display:block;width:max-content;box-shadow:var(--ngs-shadow-sm);border-radius:var(--ngs-radius-lg);background:#fff;font-size:var(--ngs-font-size-xs);overflow:hidden}:host .title:empty{display:none}:host .body:empty{display:none}:host-context(html.dark){background:var(--ngs-color-tertiary-200);color:var(--ngs-color-neutral-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1459
+ }]
1460
+ }]
1461
+ });
1462
+ var MchartTooltipTitle = class MchartTooltipTitle {
1463
+ static ɵfac = i0.ɵɵngDeclareFactory({
1464
+ minVersion: "12.0.0",
1465
+ version: "22.3.0",
1466
+ ngImport: i0,
1467
+ type: MchartTooltipTitle,
1468
+ deps: [],
1469
+ target: i0.ɵɵFactoryTarget.Component
1470
+ });
1471
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1472
+ minVersion: "14.0.0",
1473
+ version: "22.3.0",
1474
+ type: MchartTooltipTitle,
1475
+ isStandalone: true,
1476
+ selector: "ngs-mchart-tooltip-title",
1477
+ host: { classAttribute: "ngs-mchart-tooltip-title" },
1478
+ exportAs: ["ngsMchartTooltipTitle"],
1479
+ ngImport: i0,
1480
+ template: "<ng-content />\n",
1481
+ styles: [":host{display:block;background:var(--ngs-color-neutral-200);padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2);font-weight:500}:host-context(html.dark){background:var(--ngs-color-neutral-300);color:var(--ngs-color-neutral-900)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1482
+ changeDetection: i0.ChangeDetectionStrategy.Eager
1483
+ });
1484
+ };
1485
+ i0.ɵɵngDeclareClassMetadata({
1486
+ minVersion: "12.0.0",
1487
+ version: "22.3.0",
1488
+ ngImport: i0,
1489
+ type: MchartTooltipTitle,
1490
+ decorators: [{
1491
+ type: Component,
1492
+ args: [{
1493
+ selector: "ngs-mchart-tooltip-title",
1494
+ exportAs: "ngsMchartTooltipTitle",
1495
+ changeDetection: ChangeDetectionStrategy.Eager,
1496
+ host: { "class": "ngs-mchart-tooltip-title" },
1497
+ template: "<ng-content />\n",
1498
+ styles: [":host{display:block;background:var(--ngs-color-neutral-200);padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2);font-weight:500}:host-context(html.dark){background:var(--ngs-color-neutral-300);color:var(--ngs-color-neutral-900)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1499
+ }]
1500
+ }]
1501
+ });
1502
+ var MchartTooltipBody = class MchartTooltipBody {
1503
+ static ɵfac = i0.ɵɵngDeclareFactory({
1504
+ minVersion: "12.0.0",
1505
+ version: "22.3.0",
1506
+ ngImport: i0,
1507
+ type: MchartTooltipBody,
1508
+ deps: [],
1509
+ target: i0.ɵɵFactoryTarget.Component
1510
+ });
1511
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1512
+ minVersion: "14.0.0",
1513
+ version: "22.3.0",
1514
+ type: MchartTooltipBody,
1515
+ isStandalone: true,
1516
+ selector: "ngs-mchart-tooltip-body",
1517
+ host: { classAttribute: "ngs-mchart-tooltip-body" },
1518
+ exportAs: ["ngsMchartTooltipBody"],
1519
+ ngImport: i0,
1520
+ template: "<ng-content />\n",
1521
+ styles: [":host{display:block;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1522
+ changeDetection: i0.ChangeDetectionStrategy.Eager
1523
+ });
1524
+ };
1525
+ i0.ɵɵngDeclareClassMetadata({
1526
+ minVersion: "12.0.0",
1527
+ version: "22.3.0",
1528
+ ngImport: i0,
1529
+ type: MchartTooltipBody,
1530
+ decorators: [{
1531
+ type: Component,
1532
+ args: [{
1533
+ selector: "ngs-mchart-tooltip-body",
1534
+ exportAs: "ngsMchartTooltipBody",
1535
+ changeDetection: ChangeDetectionStrategy.Eager,
1536
+ host: { "class": "ngs-mchart-tooltip-body" },
1537
+ template: "<ng-content />\n",
1538
+ styles: [":host{display:block;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1539
+ }]
1540
+ }]
1541
+ });
945
1542
  export { MchartBar, MchartLine, MchartPie, MchartTooltip, MchartTooltipBody, MchartTooltipTitle };
946
- //# sourceMappingURL=ngstarter-ui-components-micro-chart.mjs.map
1543
+
1544
+ //# sourceMappingURL=ngstarter-ui-components-micro-chart.mjs.map