@nanahoshi/mona-ui 0.27.1 → 0.28.0

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 (359) hide show
  1. package/docs/api/auto-complete.md +67 -0
  2. package/docs/api/avatar.md +31 -0
  3. package/docs/api/breadcrumb.md +74 -0
  4. package/docs/api/button-group.md +71 -0
  5. package/docs/api/button.md +84 -0
  6. package/docs/api/calendar.md +123 -0
  7. package/docs/api/card.md +97 -0
  8. package/docs/api/chart.md +4380 -0
  9. package/docs/api/check-box.md +70 -0
  10. package/docs/api/chip.md +55 -0
  11. package/docs/api/circular-progress-bar.md +71 -0
  12. package/docs/api/collapsible.md +71 -0
  13. package/docs/api/color-gradient.md +54 -0
  14. package/docs/api/color-palette.md +52 -0
  15. package/docs/api/color-picker.md +89 -0
  16. package/docs/api/combo-box.md +69 -0
  17. package/docs/api/command.md +282 -0
  18. package/docs/api/common.md +599 -0
  19. package/docs/api/contextmenu.md +239 -0
  20. package/docs/api/date-input.md +119 -0
  21. package/docs/api/date-picker.md +67 -0
  22. package/docs/api/datetime-picker.md +72 -0
  23. package/docs/api/dialog.md +291 -0
  24. package/docs/api/dropdown-button.md +248 -0
  25. package/docs/api/dropdown-list.md +72 -0
  26. package/docs/api/dropdowns.md +172 -0
  27. package/docs/api/editor.md +117 -0
  28. package/docs/api/expansion-panel.md +85 -0
  29. package/docs/api/fieldset.md +33 -0
  30. package/docs/api/filter.md +116 -0
  31. package/docs/api/grid.md +1445 -0
  32. package/docs/api/i18n.md +1699 -0
  33. package/docs/api/label.md +58 -0
  34. package/docs/api/list-box.md +301 -0
  35. package/docs/api/list-view.md +294 -0
  36. package/docs/api/list.md +119 -0
  37. package/docs/api/locales.md +134 -0
  38. package/docs/api/menubar.md +275 -0
  39. package/docs/api/multi-select.md +92 -0
  40. package/docs/api/notification.md +164 -0
  41. package/docs/api/numeric-text-box.md +130 -0
  42. package/docs/api/otp-input.md +100 -0
  43. package/docs/api/pager.md +371 -0
  44. package/docs/api/placeholder.md +18 -0
  45. package/docs/api/popover.md +170 -0
  46. package/docs/api/popup-menu.md +328 -0
  47. package/docs/api/popup.md +299 -0
  48. package/docs/api/progress-bar.md +79 -0
  49. package/docs/api/query.md +367 -0
  50. package/docs/api/radio-button.md +113 -0
  51. package/docs/api/rating.md +187 -0
  52. package/docs/api/scroll-view.md +93 -0
  53. package/docs/api/segmented.md +114 -0
  54. package/docs/api/sheet.md +65 -0
  55. package/docs/api/sidebar.md +583 -0
  56. package/docs/api/skeleton.md +26 -0
  57. package/docs/api/slider.md +173 -0
  58. package/docs/api/spinner.md +132 -0
  59. package/docs/api/split-button.md +261 -0
  60. package/docs/api/splitter.md +57 -0
  61. package/docs/api/stepper.md +148 -0
  62. package/docs/api/switch.md +78 -0
  63. package/docs/api/tabs.md +139 -0
  64. package/docs/api/text-area.md +20 -0
  65. package/docs/api/text-box.md +106 -0
  66. package/docs/api/theme.md +627 -0
  67. package/docs/api/time-picker.md +69 -0
  68. package/docs/api/time-selector.md +54 -0
  69. package/docs/api/tooltip.md +112 -0
  70. package/docs/api/tree-view.md +631 -0
  71. package/docs/api/window.md +245 -0
  72. package/docs/auto-complete.md +28 -329
  73. package/docs/avatar.md +4 -24
  74. package/docs/breadcrumb.md +10 -65
  75. package/docs/button-group.md +7 -60
  76. package/docs/button.md +8 -67
  77. package/docs/calendar.md +16 -121
  78. package/docs/card.md +16 -79
  79. package/docs/chart-bar.md +16 -234
  80. package/docs/chart-financial.md +10 -121
  81. package/docs/chart-funnel.md +13 -176
  82. package/docs/chart-heatmap.md +15 -131
  83. package/docs/chart-line-area.md +12 -137
  84. package/docs/chart-pie.md +17 -221
  85. package/docs/chart-radar.md +13 -129
  86. package/docs/chart-radial.md +13 -211
  87. package/docs/chart-scatter.md +6 -74
  88. package/docs/chart-treemap.md +14 -196
  89. package/docs/chart.md +168 -1892
  90. package/docs/checkbox.md +5 -61
  91. package/docs/chip.md +7 -42
  92. package/docs/circular-progress-bar.md +9 -61
  93. package/docs/collapsible.md +5 -87
  94. package/docs/color-gradient.md +8 -81
  95. package/docs/color-palette.md +7 -69
  96. package/docs/color-picker.md +9 -105
  97. package/docs/combo-box.md +28 -331
  98. package/docs/command.md +25 -236
  99. package/docs/contextmenu.md +15 -140
  100. package/docs/date-picker.md +7 -110
  101. package/docs/datetime-picker.md +7 -129
  102. package/docs/decimal-textbox.md +6 -69
  103. package/docs/dialog.md +23 -263
  104. package/docs/dropdown-button.md +15 -146
  105. package/docs/dropdown-list.md +29 -332
  106. package/docs/editor.md +10 -164
  107. package/docs/expansion-panel.md +7 -69
  108. package/docs/fieldset.md +5 -24
  109. package/docs/grid-columns.md +12 -92
  110. package/docs/grid-editing.md +29 -291
  111. package/docs/grid-grouping.md +11 -50
  112. package/docs/grid-rows.md +10 -74
  113. package/docs/grid-selection.md +7 -36
  114. package/docs/grid-server.md +8 -293
  115. package/docs/grid-sorting-filtering.md +10 -333
  116. package/docs/grid-state-export.md +17 -228
  117. package/docs/grid.md +23 -216
  118. package/docs/input.md +7 -19
  119. package/docs/installation.md +147 -15
  120. package/docs/introduction.md +37 -15
  121. package/docs/label.md +8 -39
  122. package/docs/list-box.md +21 -253
  123. package/docs/list-view.md +25 -232
  124. package/docs/menubar.md +21 -167
  125. package/docs/multi-select.md +31 -350
  126. package/docs/notification.md +17 -116
  127. package/docs/numeric-textbox.md +9 -78
  128. package/docs/otp-input.md +9 -95
  129. package/docs/pager.md +19 -239
  130. package/docs/placeholder.md +5 -18
  131. package/docs/popover.md +13 -123
  132. package/docs/popup-menu.md +22 -243
  133. package/docs/popup.md +24 -248
  134. package/docs/progress-bar.md +10 -75
  135. package/docs/radio-button.md +8 -96
  136. package/docs/range-slider.md +9 -82
  137. package/docs/rating.md +15 -163
  138. package/docs/scroll-view.md +9 -86
  139. package/docs/segmented.md +8 -90
  140. package/docs/sheet.md +10 -74
  141. package/docs/sidebar-menus.md +20 -155
  142. package/docs/sidebar-state.md +16 -134
  143. package/docs/sidebar.md +18 -218
  144. package/docs/skeleton.md +5 -26
  145. package/docs/slider.md +9 -97
  146. package/docs/spinner.md +15 -95
  147. package/docs/split-button.md +21 -166
  148. package/docs/splitter.md +9 -56
  149. package/docs/stepper.md +13 -127
  150. package/docs/switch.md +8 -58
  151. package/docs/tabs.md +13 -111
  152. package/docs/textarea.md +4 -13
  153. package/docs/textbox.md +10 -77
  154. package/docs/theming-built-in-themes.md +67 -0
  155. package/docs/theming-custom-colors.md +274 -0
  156. package/docs/theming-custom-themes.md +168 -0
  157. package/docs/theming.md +164 -248
  158. package/docs/time-picker.md +7 -112
  159. package/docs/tooltip-directive.md +12 -96
  160. package/docs/tooltip.md +12 -96
  161. package/docs/tree-view.md +42 -495
  162. package/docs/window.md +19 -230
  163. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  164. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  165. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  166. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  167. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  168. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  169. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  170. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  171. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  172. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  173. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  174. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -389
  175. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  176. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  177. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  178. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  179. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  180. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -740
  181. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  182. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -254
  183. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  184. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  185. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  186. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  187. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  188. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -729
  189. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  190. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  191. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  192. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  193. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  194. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  195. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  196. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  197. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  198. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  199. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  200. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  201. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5068
  202. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  203. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  204. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  205. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  206. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  207. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  208. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  209. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  210. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  211. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  212. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  213. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  214. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  215. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  216. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  217. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  218. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  219. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  220. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  221. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  222. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  223. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  224. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  225. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  226. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  227. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  228. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  229. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  230. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  231. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  232. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  233. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  234. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  235. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  236. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  237. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  238. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  239. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  240. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  241. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  242. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  243. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  244. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  245. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  246. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  247. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  248. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  249. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  250. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  251. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  252. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  253. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  254. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  255. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  256. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  257. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  258. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  259. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  260. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  261. package/llms.txt +80 -2
  262. package/package.json +62 -23
  263. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  264. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  265. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  266. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  267. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  268. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  269. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  270. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  271. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  272. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  273. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  274. package/types/nanahoshi-mona-ui-collapsible.d.ts +105 -87
  275. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  276. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  277. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  278. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  279. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  280. package/types/nanahoshi-mona-ui-common.d.ts +360 -385
  281. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  282. package/types/nanahoshi-mona-ui-date-input.d.ts +97 -97
  283. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  284. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  285. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  286. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  287. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  288. package/types/nanahoshi-mona-ui-dropdowns.d.ts +255 -235
  289. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  290. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  291. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  292. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  293. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  294. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  295. package/types/nanahoshi-mona-ui-i18n.d.ts +999 -1052
  296. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  297. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  298. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  299. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  300. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  301. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  302. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  303. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  304. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  305. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  306. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  307. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  308. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  309. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  310. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  311. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  312. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  313. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  314. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  315. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  316. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  317. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  318. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  319. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  320. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  321. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  322. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  323. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  324. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  325. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  326. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  327. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  328. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  329. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  330. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  331. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  332. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  333. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  334. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  335. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  336. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  337. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  338. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  339. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  340. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  341. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  342. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  343. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  344. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  345. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  346. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  347. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  348. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  349. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  350. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  351. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  352. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  353. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  354. package/types/nanahoshi-mona-ui.d.ts +1 -2
  355. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  356. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  357. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  358. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  359. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,808 +1,1364 @@
1
- import { LiveAnnouncer } from '@angular/cdk/a11y';
2
- import { NgTemplateOutlet } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { input, Directive, inject, ElementRef, NgZone, computed, contentChild, TemplateRef, booleanAttribute, output, effect, untracked, DestroyRef, isDevMode, afterNextRender, Component, model } from '@angular/core';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
7
- import { injectLabelledByText, createElementControlId } from '@nanahoshi/mona-ui/internal';
8
- import { FilterInputComponent } from '@nanahoshi/mona-ui/internal/filter-input';
9
- import { TREE_DEFAULT_MESSAGES, TreeService, TreeComponent, TreeNodeTemplateDirective, NodeDropEvent } from '@nanahoshi/mona-ui/internal/tree';
10
- export { NodeCheckEvent, NodeClickEvent, NodeDragEndEvent, NodeDragEvent, NodeDragStartEvent, NodeDropEvent, NodeSelectEvent, moveFlatTreeNode, moveTreeNode } from '@nanahoshi/mona-ui/internal/tree';
11
- import { PlaceholderComponent } from '@nanahoshi/mona-ui/placeholder';
12
-
13
- /**
14
- * Template for each node's content. The data item is the template's implicit value (`let-dataItem`) and the node's
15
- * element is `element`. Bind the tree view's data to `monaTreeViewNodeTemplateOf` to type the data item; without it,
16
- * the data item is `any` in templates.
17
- */
18
- // `any` by default: a template without `monaTreeViewNodeTemplateOf` keeps an untyped data item, as before the guard.
19
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
- class TreeViewNodeTemplateDirective {
21
- constructor() {
22
- /**
23
- * @description The tree view's data, used only to type the template's data item. Optional.
24
- * @default null
25
- */
26
- this.monaTreeViewNodeTemplateOf = input(null, /* @ts-ignore */
27
- ...(ngDevMode ? [{ debugName: "monaTreeViewNodeTemplateOf" }] : /* istanbul ignore next */ []));
28
- }
29
- static ngTemplateContextGuard(_directive, _context) {
30
- return true;
31
- }
32
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewNodeTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
33
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TreeViewNodeTemplateDirective, isStandalone: true, selector: "ng-template[monaTreeViewNodeTemplate]", inputs: { monaTreeViewNodeTemplateOf: { classPropertyName: "monaTreeViewNodeTemplateOf", publicName: "monaTreeViewNodeTemplateOf", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
34
- }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewNodeTemplateDirective, decorators: [{
36
- type: Directive,
37
- args: [{
38
- selector: "ng-template[monaTreeViewNodeTemplate]"
39
- }]
40
- }], propDecorators: { monaTreeViewNodeTemplateOf: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaTreeViewNodeTemplateOf", required: false }] }] } });
41
-
1
+ import { LiveAnnouncer } from "@angular/cdk/a11y";
2
+ import { NgTemplateOutlet } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { Component, DestroyRef, Directive, ElementRef, NgZone, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, model, output, untracked } from "@angular/core";
5
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
6
+ import { MonaI18nService } from "@nanahoshi/mona-ui/i18n";
7
+ import { createElementControlId, injectLabelledByText } from "@nanahoshi/mona-ui/internal";
8
+ import { FilterInputComponent } from "@nanahoshi/mona-ui/internal/filter-input";
9
+ import { NodeCheckEvent, NodeClickEvent, NodeDragEndEvent, NodeDragEvent, NodeDragStartEvent, NodeDropEvent, NodeDropEvent as NodeDropEvent$1, NodeSelectEvent, TREE_DEFAULT_MESSAGES, TreeComponent, TreeNodeTemplateDirective, TreeService, moveFlatTreeNode, moveTreeNode } from "@nanahoshi/mona-ui/internal/tree";
10
+ import { PlaceholderComponent } from "@nanahoshi/mona-ui/placeholder";
11
+ var TreeViewNodeTemplateDirective = class TreeViewNodeTemplateDirective {
12
+ constructor() {
13
+ this.monaTreeViewNodeTemplateOf = input(null, ...ngDevMode ? [{ debugName: "monaTreeViewNodeTemplateOf" }] : /* istanbul ignore next */ []);
14
+ }
15
+ static ngTemplateContextGuard(_directive, _context) {
16
+ return true;
17
+ }
18
+ static {
19
+ this.ɵfac = i0.ɵɵngDeclareFactory({
20
+ minVersion: "12.0.0",
21
+ version: "22.2.6",
22
+ ngImport: i0,
23
+ type: TreeViewNodeTemplateDirective,
24
+ deps: [],
25
+ target: i0.ɵɵFactoryTarget.Directive
26
+ });
27
+ }
28
+ static {
29
+ this.ɵdir = i0.ɵɵngDeclareDirective({
30
+ minVersion: "17.1.0",
31
+ version: "22.2.6",
32
+ type: TreeViewNodeTemplateDirective,
33
+ isStandalone: true,
34
+ selector: "ng-template[monaTreeViewNodeTemplate]",
35
+ inputs: { monaTreeViewNodeTemplateOf: {
36
+ classPropertyName: "monaTreeViewNodeTemplateOf",
37
+ publicName: "monaTreeViewNodeTemplateOf",
38
+ isSignal: true,
39
+ isRequired: false,
40
+ transformFunction: null
41
+ } },
42
+ ngImport: i0
43
+ });
44
+ }
45
+ };
46
+ i0.ɵɵngDeclareClassMetadata({
47
+ minVersion: "12.0.0",
48
+ version: "22.2.6",
49
+ ngImport: i0,
50
+ type: TreeViewNodeTemplateDirective,
51
+ decorators: [{
52
+ type: Directive,
53
+ args: [{ selector: "ng-template[monaTreeViewNodeTemplate]" }]
54
+ }],
55
+ propDecorators: { monaTreeViewNodeTemplateOf: [{
56
+ type: i0.Input,
57
+ args: [{
58
+ isSignal: true,
59
+ alias: "monaTreeViewNodeTemplateOf",
60
+ required: false
61
+ }]
62
+ }] }
63
+ });
42
64
  const TREE_VIEW_DEFAULT_MESSAGES = TREE_DEFAULT_MESSAGES;
43
-
44
- /** A load that finishes within this time isn't announced; the children just appear. */
45
65
  const LOADING_ANNOUNCEMENT_DELAY = 400;
46
- class TreeViewComponent {
47
- #announcer;
48
- #hostElementRef;
49
- #i18n;
50
- #labelledByText;
51
- #loadingTimers;
52
- #zone;
53
- /** The filter text the user typed, announced with its result count once the tree applies it. */
54
- #pendingFilterAnnouncement;
55
- constructor() {
56
- this.#announcer = inject(LiveAnnouncer);
57
- this.#hostElementRef = inject(ElementRef);
58
- this.#i18n = inject(MonaI18nService);
59
- this.#labelledByText = injectLabelledByText(() => this.ariaLabelledBy());
60
- this.#loadingTimers = new Set();
61
- this.#zone = inject(NgZone);
62
- /** The filter text the user typed, announced with its result count once the tree applies it. */
63
- this.#pendingFilterAnnouncement = null;
64
- this.empty = computed(() => this.treeService.viewNodeSet().isEmpty(), /* @ts-ignore */
65
- ...(ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []));
66
- this.emptyText = computed(() => this.treeService.isTreeFiltered() ? this.messages().noMatches : this.messages().noData, /* @ts-ignore */
67
- ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
68
- /** "Filter {name}", from the tree's `aria-label` or else the text of its `aria-labelledby` elements. */
69
- this.filterAriaLabel = computed(() => {
70
- const name = this.ariaLabel().trim() || this.#labelledByText();
71
- return name ? this.messages().filterLabel(name) : this.messages().filterTree;
72
- }, /* @ts-ignore */
73
- ...(ngDevMode ? [{ debugName: "filterAriaLabel" }] : /* istanbul ignore next */ []));
74
- this.messages = this.#i18n.componentMessages("treeView", TREE_VIEW_DEFAULT_MESSAGES);
75
- this.nodeTemplate = contentChild(TreeViewNodeTemplateDirective, { ...(ngDevMode ? { debugName: "nodeTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
76
- this.statusId = `${createElementControlId()}-status`;
77
- this.treeId = createElementControlId();
78
- this.treeService = inject((TreeService));
79
- /**
80
- * @description Enables CSS transitions when nodes expand or collapse. Accepts the attribute form
81
- * (`animate="false"`).
82
- * @default true
83
- */
84
- this.animate = input(true, { ...(ngDevMode ? { debugName: "animate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
85
- /**
86
- * @description Accessible name of the tree. Describe what the tree represents; it also names the filter input
87
- * ("Filter {name}"). Set this or `aria-labelledby`: an unnamed tree logs a warning in development. A plain
88
- * `aria-label` attribute on `mona-tree-view` doesn't name the tree.
89
- * @default ""
90
- */
91
- this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
92
- /**
93
- * @description Id of the element that names the tree, as an alternative to `aria-label`.
94
- * @default ""
95
- */
96
- this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
97
- /**
98
- * @description Emitted when the tree-view loses focus.
99
- */
100
- // eslint-disable-next-line @angular-eslint/no-output-native
101
- this.blur = output();
102
- /**
103
- * @description Property name or accessor used to derive a node's children from a data item. Accepts a property name, a function returning the children, or a function returning an observable of the children.
104
- * @default ""
105
- */
106
- this.children = input("", /* @ts-ignore */
107
- ...(ngDevMode ? [{ debugName: "children" }] : /* istanbul ignore next */ []));
108
- /**
109
- * @description Emitted when the children observable of a node errors. The node is collapsed again and marked
110
- * as failed (its expander reads "Retry loading {node}"), the failure is announced, and expanding the node
111
- * retries the load.
112
- */
113
- this.childrenLoadError = output();
114
- /**
115
- * @description Collection of items to render.
116
- * @default []
117
- */
118
- this.data = input([], /* @ts-ignore */
119
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
120
- /**
121
- * @description Emitted when the tree-view gains focus.
122
- */
123
- // eslint-disable-next-line @angular-eslint/no-output-native
124
- this.focus = output();
125
- /**
126
- * @description Predicate that determines whether a node has children. Required when the children selector returns an observable.
127
- * @default null
128
- */
129
- this.hasChildren = input(null, /* @ts-ignore */
130
- ...(ngDevMode ? [{ debugName: "hasChildren" }] : /* istanbul ignore next */ []));
131
- /**
132
- * @description Property name that holds a node's unique identifier. Required when `mode` is set to `"flat"`.
133
- * @default ""
134
- */
135
- this.idField = input("", /* @ts-ignore */
136
- ...(ngDevMode ? [{ debugName: "idField" }] : /* istanbul ignore next */ []));
137
- /**
138
- * @description Shape of the source data: `"hierarchical"` for nested items via `children`, or `"flat"` for a flat list linked by `idField` and `parentIdField`.
139
- * @default "hierarchical"
140
- */
141
- this.mode = input("hierarchical", /* @ts-ignore */
142
- ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
143
- /**
144
- * @description Emitted when a node is clicked.
145
- */
146
- this.nodeClick = output();
147
- /**
148
- * @description Property name that holds a node's parent identifier. Required when `mode` is set to `"flat"`.
149
- * @default ""
150
- */
151
- this.parentIdField = input("", /* @ts-ignore */
152
- ...(ngDevMode ? [{ debugName: "parentIdField" }] : /* istanbul ignore next */ []));
153
- /**
154
- * @description Property name or accessor used to derive the display text from a data item.
155
- * @default ""
156
- */
157
- this.textField = input("", /* @ts-ignore */
158
- ...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
159
- // The text is read when nodes render, so changing it doesn't rebuild the nodes (which would undo moves).
160
- effect(() => {
161
- const textField = this.textField();
162
- untracked(() => this.treeService.setTextField(textField));
163
- });
164
- // Only the data and its structure rebuild the nodes.
165
- effect(() => {
166
- const mode = this.mode();
167
- if (mode === "flat") {
168
- this.#setFlatDataStructureFields();
169
- }
170
- else if (mode === "hierarchical") {
171
- this.#setHierarchicalDataStructureFields();
172
- }
173
- const data = this.data();
174
- untracked(() => {
175
- this.treeService.setDataStructure(mode);
176
- this.treeService.setData(data);
177
- });
178
- });
179
- effect(() => {
180
- const animate = this.animate();
181
- untracked(() => {
182
- this.treeService.setAnimationEnabled(animate);
183
- });
184
- });
185
- effect(() => {
186
- const filterText = this.treeService.filterText();
187
- const matchCount = this.treeService.matchCount();
188
- untracked(() => this.#announceFilterResults(filterText, matchCount));
189
- });
190
- this.treeService.nodeClick$.pipe(takeUntilDestroyed()).subscribe(event => this.nodeClick.emit(event));
191
- this.treeService.focus$.pipe(takeUntilDestroyed()).subscribe(event => this.focus.emit(event));
192
- this.treeService.blur$.pipe(takeUntilDestroyed()).subscribe(event => this.blur.emit(event));
193
- this.treeService.childrenLoadStart$
194
- .pipe(takeUntilDestroyed())
195
- .subscribe(node => this.#announceLoadingAfterDelay(node));
196
- inject(DestroyRef).onDestroy(() => this.#loadingTimers.forEach(timer => clearTimeout(timer)));
197
- this.treeService.childrenLoadError$.pipe(takeUntilDestroyed()).subscribe(({ error, node }) => {
198
- this.#announcer.announce(this.messages().loadError(this.treeService.getNodeText(node)), "polite");
199
- this.childrenLoadError.emit({ error, node: node.nodeItem });
200
- });
201
- if (isDevMode()) {
202
- afterNextRender({ read: () => this.#warnIfUnnamed() });
203
- }
204
- }
205
- /**
206
- * Moves a node in the tree's internal structure, without going through `data`.
207
- * @returns a snapshot for `undoMoveNode`, or `null` when nothing moved: `position` is `"outside"`, a node isn't
208
- * in the tree, or the move isn't possible (onto the node itself or into its own subtree, inside its own parent or
209
- * a disabled node).
210
- */
211
- moveNode(source, target, position) {
212
- if (position === "outside") {
213
- return null;
214
- }
215
- const sourceNode = this.treeService.getNodeByUid(source.uid);
216
- if (!sourceNode) {
217
- return null;
218
- }
219
- const targetNode = this.treeService.getNodeByUid(target.uid);
220
- if (!targetNode) {
221
- return null;
222
- }
223
- const originalParentUid = sourceNode.parent?.uid ?? null;
224
- const originalIndex = sourceNode.parent !== null
225
- ? sourceNode.parent.children().toList().indexOf(sourceNode)
226
- : this.treeService.nodeSet().toList().indexOf(sourceNode);
227
- if (!this.treeService.moveNode(sourceNode, targetNode, position)) {
228
- return null;
229
- }
230
- return { originalParentUid, originalIndex, sourceNodeUid: sourceNode.uid };
231
- }
232
- /** Reverts a move previously performed by `moveNode`. */
233
- undoMoveNode(snapshot) {
234
- const sourceNode = this.treeService.getNodeByUid(snapshot.sourceNodeUid);
235
- if (!sourceNode) {
236
- return;
237
- }
238
- if (snapshot.originalParentUid === null) {
239
- this.treeService.detachNode(sourceNode);
240
- this.treeService.insertNodeAtIndex(sourceNode, null, snapshot.originalIndex);
241
- }
242
- else {
243
- this.treeService.detachNode(sourceNode);
244
- this.treeService.insertNodeAtIndex(sourceNode, snapshot.originalParentUid, snapshot.originalIndex);
245
- }
246
- }
247
- onFilterChange(event) {
248
- this.treeService.filterChange$.next(event);
249
- if (!event.isDefaultPrevented()) {
250
- this.#pendingFilterAnnouncement = event.filter;
251
- this.treeService.filter$.next(event.filter);
252
- }
253
- }
254
- /**
255
- * Announces a load that is still running after a moment; quicker loads just show their children. The timer runs
256
- * outside Angular, so it doesn't hold up the app's stability.
257
- */
258
- #announceLoadingAfterDelay(node) {
259
- this.#zone.runOutsideAngular(() => {
260
- const timer = setTimeout(() => {
261
- this.#loadingTimers.delete(timer);
262
- if (node.loading()) {
263
- this.#announcer.announce(this.messages().loadingNode(this.treeService.getNodeText(node)), "polite");
264
- }
265
- }, LOADING_ANNOUNCEMENT_DELAY);
266
- this.#loadingTimers.add(timer);
267
- });
268
- }
269
- /** Announces how many nodes match once the filter the user typed applies. Filters set from code aren't announced. */
270
- #announceFilterResults(filterText, matchCount) {
271
- if (this.#pendingFilterAnnouncement === null || this.#pendingFilterAnnouncement !== filterText) {
272
- return;
273
- }
274
- this.#pendingFilterAnnouncement = null;
275
- if (!filterText) {
276
- return;
277
- }
278
- const messages = this.messages();
279
- this.#announcer.announce(matchCount === 0 ? messages.noMatches : messages.results(matchCount), "polite");
280
- }
281
- #setFlatDataStructureFields() {
282
- const idField = this.idField();
283
- const parentIdField = this.parentIdField();
284
- untracked(() => {
285
- this.treeService.setFlatIdField(idField);
286
- this.treeService.setFlatParentIdField(parentIdField);
287
- });
288
- }
289
- #setHierarchicalDataStructureFields() {
290
- const childrenSelector = this.children();
291
- const hasChildren = this.hasChildren();
292
- untracked(() => {
293
- this.treeService.setChildrenSelector(childrenSelector);
294
- this.treeService.setHasChildrenPredicate(hasChildren);
295
- });
296
- }
297
- #warnIfUnnamed() {
298
- if (this.ariaLabel().trim() || this.ariaLabelledBy().trim()) {
299
- return;
300
- }
301
- console.warn("[Mona TreeView] A tree view needs an accessible name. Set aria-label or aria-labelledby.", this.#hostElementRef.nativeElement);
302
- }
303
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
304
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TreeViewComponent, isStandalone: true, selector: "mona-tree-view", inputs: { animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, children: { classPropertyName: "children", publicName: "children", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, hasChildren: { classPropertyName: "hasChildren", publicName: "hasChildren", isSignal: true, isRequired: false, transformFunction: null }, idField: { classPropertyName: "idField", publicName: "idField", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, parentIdField: { classPropertyName: "parentIdField", publicName: "parentIdField", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { blur: "blur", childrenLoadError: "childrenLoadError", focus: "focus", nodeClick: "nodeClick" }, host: { properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null" } }, providers: [TreeService], queries: [{ propertyName: "nodeTemplate", first: true, predicate: TreeViewNodeTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "@if (treeService.filterableOptions().enabled) {\n <div role=\"search\" [attr.aria-label]=\"filterAriaLabel()\">\n <mona-filter-input\n [filter]=\"treeService.filterText()\"\n [debounce]=\"treeService.filterableOptions().debounce\"\n [placeholder]=\"treeService.filterPlaceholder()\"\n [ariaLabel]=\"filterAriaLabel()\"\n [ariaControls]=\"treeId\"\n [autoFocus]=\"false\"\n (filterChange)=\"onFilterChange($event)\"></mona-filter-input>\n </div>\n}\n<!-- An empty tree stays a named Tab stop, lying over the \"No data\" or \"No matching items\" text that describes it. -->\n<div class=\"relative flex-1 overflow-auto\">\n @if (empty()) {\n <mona-placeholder\n [id]=\"statusId\"\n [text]=\"emptyText()\"\n class=\"flex h-full w-full items-center justify-center\"></mona-placeholder>\n }\n <mona-tree\n [id]=\"treeId\"\n [class.absolute]=\"empty()\"\n [class.inset-0]=\"empty()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [ariaDescribedBy]=\"empty() ? statusId : ''\">\n @if (nodeTemplate()) {\n <ng-template monaTreeNodeTemplate let-dataItem let-element=\"element\">\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, element }\"></ng-container>\n </ng-template>\n }\n </mona-tree>\n</div>\n", dependencies: [{ kind: "component", type: FilterInputComponent, selector: "mona-filter-input", inputs: ["activeDescendant", "ariaControls", "ariaLabel", "autoFocus", "controls", "debounce", "filter", "placeholder", "size"], outputs: ["filterChange", "inputBlur", "inputFocus"] }, { kind: "component", type: PlaceholderComponent, selector: "mona-placeholder", inputs: ["text", "class"] }, { kind: "component", type: TreeComponent, selector: "mona-tree", inputs: ["ariaDescribedBy", "ariaLabel", "ariaLabelledBy", "data"] }, { kind: "directive", type: TreeNodeTemplateDirective, selector: "ng-template[monaTreeNodeTemplate]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
305
- }
306
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewComponent, decorators: [{
307
- type: Component,
308
- args: [{ selector: "mona-tree-view", imports: [FilterInputComponent, PlaceholderComponent, TreeComponent, TreeNodeTemplateDirective, NgTemplateOutlet], providers: [TreeService], host: {
309
- "[attr.aria-label]": "null",
310
- "[attr.aria-labelledby]": "null"
311
- }, template: "@if (treeService.filterableOptions().enabled) {\n <div role=\"search\" [attr.aria-label]=\"filterAriaLabel()\">\n <mona-filter-input\n [filter]=\"treeService.filterText()\"\n [debounce]=\"treeService.filterableOptions().debounce\"\n [placeholder]=\"treeService.filterPlaceholder()\"\n [ariaLabel]=\"filterAriaLabel()\"\n [ariaControls]=\"treeId\"\n [autoFocus]=\"false\"\n (filterChange)=\"onFilterChange($event)\"></mona-filter-input>\n </div>\n}\n<!-- An empty tree stays a named Tab stop, lying over the \"No data\" or \"No matching items\" text that describes it. -->\n<div class=\"relative flex-1 overflow-auto\">\n @if (empty()) {\n <mona-placeholder\n [id]=\"statusId\"\n [text]=\"emptyText()\"\n class=\"flex h-full w-full items-center justify-center\"></mona-placeholder>\n }\n <mona-tree\n [id]=\"treeId\"\n [class.absolute]=\"empty()\"\n [class.inset-0]=\"empty()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [ariaDescribedBy]=\"empty() ? statusId : ''\">\n @if (nodeTemplate()) {\n <ng-template monaTreeNodeTemplate let-dataItem let-element=\"element\">\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, element }\"></ng-container>\n </ng-template>\n }\n </mona-tree>\n</div>\n" }]
312
- }], ctorParameters: () => [], propDecorators: { nodeTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TreeViewNodeTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], animate: [{ type: i0.Input, args: [{ isSignal: true, alias: "animate", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], blur: [{ type: i0.Output, args: ["blur"] }], children: [{ type: i0.Input, args: [{ isSignal: true, alias: "children", required: false }] }], childrenLoadError: [{ type: i0.Output, args: ["childrenLoadError"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], focus: [{ type: i0.Output, args: ["focus"] }], hasChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasChildren", required: false }] }], idField: [{ type: i0.Input, args: [{ isSignal: true, alias: "idField", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], nodeClick: [{ type: i0.Output, args: ["nodeClick"] }], parentIdField: [{ type: i0.Input, args: [{ isSignal: true, alias: "parentIdField", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }] } });
313
-
314
- class TreeViewCheckableDirective {
315
- #defaultOptions;
316
- #treeService;
317
- constructor() {
318
- this.#defaultOptions = {
319
- checkChildren: true,
320
- checkDisabledChildren: false,
321
- checkParents: true,
322
- childrenOnly: false,
323
- enabled: true,
324
- mode: "multiple"
325
- };
326
- this.#treeService = inject(TreeService);
327
- /**
328
- * @description Property name or accessor used to derive a node's check key from its data. Falls back to the node's data when unset.
329
- * @default ""
330
- */
331
- this.checkBy = input("", /* @ts-ignore */
332
- ...(ngDevMode ? [{ debugName: "checkBy" }] : /* istanbul ignore next */ []));
333
- /**
334
- * @description Keys of the currently checked nodes.
335
- * @default []
336
- */
337
- this.checkedKeys = input([], /* @ts-ignore */
338
- ...(ngDevMode ? [{ debugName: "checkedKeys" }] : /* istanbul ignore next */ []));
339
- /**
340
- * @description Emitted with the checked keys when the user checks or unchecks a node, including the children and
341
- * parents that check follows (`checkChildren`, `checkParents`). Not emitted for keys set through `checkedKeys`,
342
- * nor for keys the tree derives on its own: checked parents of checked children set from code, lazily loaded
343
- * children of a checked node, and ancestors after a drop. Those are reported with the next user change.
344
- */
345
- this.checkedKeysChange = output();
346
- /**
347
- * @description Predicate that determines whether a node displays a checkbox. When unset, every node displays a checkbox.
348
- * @default null
349
- */
350
- this.hasCheckbox = input(null, /* @ts-ignore */
351
- ...(ngDevMode ? [{ debugName: "hasCheckbox" }] : /* istanbul ignore next */ []));
352
- /**
353
- * @description Emitted when a node is checked or unchecked.
354
- */
355
- this.nodeCheck = output();
356
- /**
357
- * @description Configures check mode and whether checking a node also checks its children or parents. Merged over `{ checkChildren: true, checkDisabledChildren: false, checkParents: true, childrenOnly: false, enabled: true, mode: "multiple" }` when applied bare.
358
- * @default ""
359
- */
360
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaTreeViewCheckable" });
361
- effect(() => {
362
- const checkBy = this.checkBy();
363
- untracked(() => {
364
- this.#treeService.setCheckBy(checkBy ?? "");
365
- });
366
- });
367
- effect(() => {
368
- const checkedKeys = this.checkedKeys();
369
- untracked(() => {
370
- this.#treeService.setCheckedKeys(checkedKeys ?? []);
371
- });
372
- });
373
- effect(() => {
374
- const options = this.options();
375
- untracked(() => {
376
- if (options === "") {
377
- this.#treeService.setCheckableOptions(this.#defaultOptions);
378
- }
379
- else {
380
- this.#treeService.setCheckableOptions({
381
- ...this.#defaultOptions,
382
- ...options
383
- });
384
- }
385
- });
386
- });
387
- effect(() => {
388
- const hasCheckbox = this.hasCheckbox();
389
- untracked(() => {
390
- this.#treeService.setHasCheckboxPredicate(hasCheckbox);
391
- });
392
- });
393
- this.#treeService.checkedKeysChange$
394
- .pipe(takeUntilDestroyed())
395
- .subscribe(keys => this.checkedKeysChange.emit(keys.toArray()));
396
- this.#treeService.nodeCheck$.pipe(takeUntilDestroyed()).subscribe(event => this.nodeCheck.emit(event));
397
- }
398
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewCheckableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
399
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TreeViewCheckableDirective, isStandalone: true, selector: "mona-tree-view[monaTreeViewCheckable]", inputs: { checkBy: { classPropertyName: "checkBy", publicName: "checkBy", isSignal: true, isRequired: false, transformFunction: null }, checkedKeys: { classPropertyName: "checkedKeys", publicName: "checkedKeys", isSignal: true, isRequired: false, transformFunction: null }, hasCheckbox: { classPropertyName: "hasCheckbox", publicName: "hasCheckbox", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaTreeViewCheckable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedKeysChange: "checkedKeysChange", nodeCheck: "nodeCheck" }, exportAs: ["monaTreeViewCheckable"], ngImport: i0 }); }
400
- }
401
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewCheckableDirective, decorators: [{
402
- type: Directive,
403
- args: [{
404
- selector: "mona-tree-view[monaTreeViewCheckable]",
405
- exportAs: "monaTreeViewCheckable"
406
- }]
407
- }], ctorParameters: () => [], propDecorators: { checkBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkBy", required: false }] }], checkedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkedKeys", required: false }] }], checkedKeysChange: [{ type: i0.Output, args: ["checkedKeysChange"] }], hasCheckbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasCheckbox", required: false }] }], nodeCheck: [{ type: i0.Output, args: ["nodeCheck"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaTreeViewCheckable", required: false }] }] } });
408
-
409
- class TreeViewDisableDirective {
410
- #defaultOptions;
411
- #treeService;
412
- constructor() {
413
- this.#defaultOptions = {
414
- disableChildren: true,
415
- enabled: true
416
- };
417
- this.#treeService = inject(TreeService);
418
- /**
419
- * @description Property name or accessor used to derive a node's disable key from its data. Falls back to the node's data when unset.
420
- * @default ""
421
- */
422
- this.disableBy = input("", /* @ts-ignore */
423
- ...(ngDevMode ? [{ debugName: "disableBy" }] : /* istanbul ignore next */ []));
424
- /**
425
- * @description Keys of the currently disabled nodes.
426
- * @default []
427
- */
428
- this.disabledKeys = input([], /* @ts-ignore */
429
- ...(ngDevMode ? [{ debugName: "disabledKeys" }] : /* istanbul ignore next */ []));
430
- /**
431
- * @description Configures whether disabling a node also disables its children. Merged over `{ disableChildren: true, enabled: true }` when applied bare.
432
- * @default ""
433
- */
434
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaTreeViewDisable" });
435
- effect(() => {
436
- const disableBy = this.disableBy();
437
- untracked(() => {
438
- this.#treeService.setDisableBy(disableBy ?? "");
439
- });
440
- });
441
- effect(() => {
442
- const disabledKeys = this.disabledKeys();
443
- untracked(() => {
444
- this.#treeService.setDisabledKeys(disabledKeys ?? []);
445
- });
446
- });
447
- effect(() => {
448
- const options = this.options();
449
- untracked(() => {
450
- if (options === "") {
451
- this.#treeService.setDisableOptions(this.#defaultOptions);
452
- }
453
- else {
454
- this.#treeService.setDisableOptions({
455
- ...this.#defaultOptions,
456
- ...options
457
- });
458
- }
459
- });
460
- });
461
- }
462
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewDisableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
463
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TreeViewDisableDirective, isStandalone: true, selector: "mona-tree-view[monaTreeViewDisable]", inputs: { disableBy: { classPropertyName: "disableBy", publicName: "disableBy", isSignal: true, isRequired: false, transformFunction: null }, disabledKeys: { classPropertyName: "disabledKeys", publicName: "disabledKeys", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaTreeViewDisable", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["monaTreeViewDisable"], ngImport: i0 }); }
464
- }
465
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewDisableDirective, decorators: [{
466
- type: Directive,
467
- args: [{
468
- selector: "mona-tree-view[monaTreeViewDisable]",
469
- exportAs: "monaTreeViewDisable"
470
- }]
471
- }], ctorParameters: () => [], propDecorators: { disableBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBy", required: false }] }], disabledKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledKeys", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaTreeViewDisable", required: false }] }] } });
472
-
473
- class TreeViewDragAndDropDirective {
474
- #defaultOptions;
475
- #treeService;
476
- #treeView;
477
- constructor() {
478
- this.#defaultOptions = {
479
- enabled: true
480
- };
481
- this.#treeService = inject(TreeService);
482
- this.#treeView = inject((TreeViewComponent));
483
- /**
484
- * @description Emitted while a node is being dragged.
485
- */
486
- this.nodeDrag = output();
487
- /**
488
- * @description Emitted when a node drag ends, dropped or not. Not cancelable: the drag is over either way.
489
- */
490
- this.nodeDragEnd = output();
491
- /**
492
- * @description Emitted when a node drag starts.
493
- */
494
- this.nodeDragStart = output();
495
- /**
496
- * @description Emitted when a node is dropped on another node, or moved with Ctrl+Shift+Arrow (Cmd+Shift+Arrow on
497
- * macOS). The tree doesn't move the node: the handler applies the move (with `moveTreeNode`,
498
- * `moveFlatTreeNode` or `event.treeView.moveNode`). Call `preventDefault()` when the move isn't applied.
499
- */
500
- this.nodeDrop = output();
501
- /**
502
- * @description Configures whether dragging nodes to reorder or reparent them is enabled. Merged over `{ enabled: true }` when applied bare.
503
- * @default ""
504
- */
505
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaTreeViewDragAndDrop" });
506
- effect(() => {
507
- const options = this.options();
508
- untracked(() => {
509
- if (options === "") {
510
- this.#treeService.setDraggableOptions(this.#defaultOptions);
511
- }
512
- else {
513
- this.#treeService.setDraggableOptions({
514
- ...this.#defaultOptions,
515
- ...options
516
- });
517
- }
518
- });
519
- });
520
- this.#treeService.nodeDrag$.pipe(takeUntilDestroyed()).subscribe(e => {
521
- this.nodeDrag.emit(e.dragEvent);
522
- });
523
- this.#treeService.nodeDragEnd$.pipe(takeUntilDestroyed()).subscribe(e => {
524
- this.nodeDragEnd.emit(e);
525
- });
526
- this.#treeService.nodeDragStart$.pipe(takeUntilDestroyed()).subscribe(e => {
527
- this.nodeDragStart.emit(e);
528
- });
529
- this.#treeService.nodeDrop$.pipe(takeUntilDestroyed()).subscribe(e => {
530
- const event = new NodeDropEvent({
531
- event: e.event,
532
- position: e.position,
533
- sourceNode: e.sourceNode,
534
- targetNode: e.targetNode,
535
- treeView: this.#treeView
536
- });
537
- this.nodeDrop.emit(event);
538
- if (event.isDefaultPrevented()) {
539
- e.preventDefault();
540
- }
541
- });
542
- }
543
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewDragAndDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
544
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TreeViewDragAndDropDirective, isStandalone: true, selector: "mona-tree-view[monaTreeViewDragAndDrop]", inputs: { options: { classPropertyName: "options", publicName: "monaTreeViewDragAndDrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeDrag: "nodeDrag", nodeDragEnd: "nodeDragEnd", nodeDragStart: "nodeDragStart", nodeDrop: "nodeDrop" }, exportAs: ["monaTreeViewDragAndDrop"], ngImport: i0 }); }
545
- }
546
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewDragAndDropDirective, decorators: [{
547
- type: Directive,
548
- args: [{
549
- selector: "mona-tree-view[monaTreeViewDragAndDrop]",
550
- exportAs: "monaTreeViewDragAndDrop"
551
- }]
552
- }], ctorParameters: () => [], propDecorators: { nodeDrag: [{ type: i0.Output, args: ["nodeDrag"] }], nodeDragEnd: [{ type: i0.Output, args: ["nodeDragEnd"] }], nodeDragStart: [{ type: i0.Output, args: ["nodeDragStart"] }], nodeDrop: [{ type: i0.Output, args: ["nodeDrop"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaTreeViewDragAndDrop", required: false }] }] } });
553
-
554
- class TreeViewExpandableDirective {
555
- #defaultOptions;
556
- #treeService;
557
- constructor() {
558
- this.#defaultOptions = {
559
- enabled: true
560
- };
561
- this.#treeService = inject(TreeService);
562
- /**
563
- * @description Emitted when a node is collapsed.
564
- */
565
- this.collapse = output();
566
- /**
567
- * @description Emitted when a node is expanded.
568
- */
569
- this.expand = output();
570
- /**
571
- * @description Property name or accessor used to derive a node's expand key from its data. Falls back to the node's data when unset.
572
- * @default ""
573
- */
574
- this.expandBy = input("", /* @ts-ignore */
575
- ...(ngDevMode ? [{ debugName: "expandBy" }] : /* istanbul ignore next */ []));
576
- /**
577
- * @description Keys of the currently expanded nodes.
578
- * @default []
579
- */
580
- this.expandedKeys = input([], /* @ts-ignore */
581
- ...(ngDevMode ? [{ debugName: "expandedKeys" }] : /* istanbul ignore next */ []));
582
- /**
583
- * @description Emitted with the expanded keys when the user expands or collapses a node. Not emitted for keys set
584
- * through `expandedKeys`, nor for the expansion a filter applies (which is undone when the filter is cleared).
585
- */
586
- this.expandedKeysChange = output();
587
- /**
588
- * @description Configures whether expanding and collapsing nodes is enabled. Merged over `{ enabled: true }` when applied bare.
589
- * @default ""
590
- */
591
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaTreeViewExpandable" });
592
- effect(() => {
593
- const expandBy = this.expandBy();
594
- untracked(() => {
595
- this.#treeService.setExpandBy(expandBy ?? "");
596
- });
597
- });
598
- effect(() => {
599
- const expandedKeys = this.expandedKeys();
600
- untracked(() => {
601
- this.#treeService.setExpandedKeys(expandedKeys ?? []);
602
- });
603
- });
604
- effect(() => {
605
- const options = this.options();
606
- untracked(() => {
607
- if (options === "") {
608
- this.#treeService.setExpandableOptions(this.#defaultOptions);
609
- }
610
- else {
611
- this.#treeService.setExpandableOptions({
612
- ...this.#defaultOptions,
613
- ...options
614
- });
615
- }
616
- });
617
- });
618
- this.#treeService.expandedKeysChange$
619
- .pipe(takeUntilDestroyed())
620
- .subscribe(keys => this.expandedKeysChange.emit(keys.toArray()));
621
- this.#treeService.nodeExpand$.pipe(takeUntilDestroyed()).subscribe(event => {
622
- if (event.expanded) {
623
- this.expand.emit(event.node.nodeItem);
624
- }
625
- else {
626
- this.collapse.emit(event.node.nodeItem);
627
- }
628
- });
629
- }
630
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewExpandableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
631
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TreeViewExpandableDirective, isStandalone: true, selector: "mona-tree-view[monaTreeViewExpandable]", inputs: { expandBy: { classPropertyName: "expandBy", publicName: "expandBy", isSignal: true, isRequired: false, transformFunction: null }, expandedKeys: { classPropertyName: "expandedKeys", publicName: "expandedKeys", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaTreeViewExpandable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapse: "collapse", expand: "expand", expandedKeysChange: "expandedKeysChange" }, exportAs: ["monaTreeViewExpandable"], ngImport: i0 }); }
632
- }
633
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewExpandableDirective, decorators: [{
634
- type: Directive,
635
- args: [{
636
- selector: "mona-tree-view[monaTreeViewExpandable]",
637
- exportAs: "monaTreeViewExpandable"
638
- }]
639
- }], ctorParameters: () => [], propDecorators: { collapse: [{ type: i0.Output, args: ["collapse"] }], expand: [{ type: i0.Output, args: ["expand"] }], expandBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandBy", required: false }] }], expandedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedKeys", required: false }] }], expandedKeysChange: [{ type: i0.Output, args: ["expandedKeysChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaTreeViewExpandable", required: false }] }] } });
640
-
641
- class TreeViewFilterableDirective {
642
- #defaultOptions;
643
- #treeService;
644
- constructor() {
645
- this.#defaultOptions = {
646
- enabled: true,
647
- operator: "contains",
648
- caseSensitive: false,
649
- debounce: 0
650
- };
651
- this.#treeService = inject(TreeService);
652
- /**
653
- * @description Current filter text used to narrow the visible nodes. Two-way bindable (`[(filter)]`); the user's
654
- * typing updates it, so setting it from code (including back to `""`) always applies.
655
- * @default ""
656
- */
657
- this.filter = model("", /* @ts-ignore */
658
- ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
659
- /**
660
- * @description Emitted when the user types in the filter input, before the filter applies. Call
661
- * `preventDefault()` to keep the current filter; otherwise `filterChange` reports the new text.
662
- */
663
- this.filterInput = output();
664
- /**
665
- * @description Placeholder text shown in the filter input.
666
- * @default ""
667
- */
668
- this.filterPlaceholder = input("", /* @ts-ignore */
669
- ...(ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []));
670
- /**
671
- * @description Configures the filter operator, case sensitivity, and debounce delay. Merged over `{ enabled: true, operator: "contains", caseSensitive: false, debounce: 0 }` when applied bare.
672
- * @default ""
673
- */
674
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaTreeViewFilterable" });
675
- effect(() => {
676
- const filter = this.filter();
677
- untracked(() => this.#treeService.filter$.next(filter));
678
- });
679
- effect(() => {
680
- const filterPlaceholder = this.filterPlaceholder();
681
- untracked(() => this.#treeService.filterPlaceholder.set(filterPlaceholder));
682
- });
683
- effect(() => {
684
- const options = this.options();
685
- untracked(() => {
686
- if (options === "") {
687
- this.#treeService.setFilterableOptions(this.#defaultOptions);
688
- }
689
- else {
690
- this.#treeService.setFilterableOptions({
691
- ...this.#defaultOptions,
692
- ...options
693
- });
694
- }
695
- });
696
- });
697
- this.#treeService.filterChange$.pipe(takeUntilDestroyed()).subscribe(event => {
698
- this.filterInput.emit(event);
699
- if (!event.isDefaultPrevented()) {
700
- this.filter.set(event.filter);
701
- }
702
- });
703
- }
704
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewFilterableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
705
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TreeViewFilterableDirective, isStandalone: true, selector: "mona-tree-view[monaTreeViewFilterable]", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaTreeViewFilterable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filter: "filterChange", filterInput: "filterInput" }, exportAs: ["monaTreeViewFilterable"], ngImport: i0 }); }
706
- }
707
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewFilterableDirective, decorators: [{
708
- type: Directive,
709
- args: [{
710
- selector: "mona-tree-view[monaTreeViewFilterable]",
711
- exportAs: "monaTreeViewFilterable"
712
- }]
713
- }], ctorParameters: () => [], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }, { type: i0.Output, args: ["filterChange"] }], filterInput: [{ type: i0.Output, args: ["filterInput"] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaTreeViewFilterable", required: false }] }] } });
714
-
715
- class TreeViewSelectableDirective {
716
- #defaultOptions;
717
- #treeService;
718
- constructor() {
719
- this.#defaultOptions = {
720
- childrenOnly: false,
721
- enabled: true,
722
- mode: "single",
723
- toggleable: false
724
- };
725
- this.#treeService = inject(TreeService);
726
- /**
727
- * @description Emitted before the user selects or deselects a node, by click or Enter. Call `preventDefault()`
728
- * to keep the selection as it is; `selectionChange` follows when it isn't prevented.
729
- */
730
- this.nodeSelect = output();
731
- /**
732
- * @description Configures selection mode, toggleability, and whether only child nodes are selectable. Merged over `{ childrenOnly: false, enabled: true, mode: "single", toggleable: false }` when applied bare.
733
- * @default ""
734
- */
735
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaTreeViewSelectable" });
736
- /**
737
- * @description Property name or accessor used to derive a node's selection key from its data. Falls back to the node's data when unset.
738
- * @default ""
739
- */
740
- this.selectBy = input("", /* @ts-ignore */
741
- ...(ngDevMode ? [{ debugName: "selectBy" }] : /* istanbul ignore next */ []));
742
- /**
743
- * @description Keys of the currently selected nodes.
744
- * @default []
745
- */
746
- this.selectedKeys = input([], /* @ts-ignore */
747
- ...(ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []));
748
- /**
749
- * @description Emitted with the selected keys when the user selects or deselects a node. Not emitted for keys set
750
- * through `selectedKeys`.
751
- */
752
- this.selectedKeysChange = output();
753
- /**
754
- * @description Emitted with the node after the user selects or deselects it (after a `nodeSelect` that wasn't
755
- * prevented).
756
- */
757
- this.selectionChange = output();
758
- effect(() => {
759
- const selectBy = this.selectBy();
760
- untracked(() => this.#treeService.setSelectBy(selectBy ?? ""));
761
- });
762
- effect(() => {
763
- const selectedKeys = this.selectedKeys();
764
- untracked(() => this.#treeService.setSelectedKeys(selectedKeys ?? []));
765
- });
766
- effect(() => {
767
- const options = this.options();
768
- untracked(() => {
769
- if (options === "") {
770
- this.#treeService.setSelectableOptions(this.#defaultOptions);
771
- }
772
- else {
773
- this.#treeService.setSelectableOptions({
774
- ...this.#defaultOptions,
775
- ...options
776
- });
777
- }
778
- });
779
- });
780
- this.#treeService.nodeSelect$.pipe(takeUntilDestroyed()).subscribe(event => this.nodeSelect.emit(event));
781
- this.#treeService.selectedKeysChange$
782
- .pipe(takeUntilDestroyed())
783
- .subscribe(keys => this.selectedKeysChange.emit(keys.toArray()));
784
- this.#treeService.selectionChange$
785
- .pipe(takeUntilDestroyed())
786
- .subscribe(nodeItem => this.selectionChange.emit(nodeItem));
787
- }
788
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewSelectableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
789
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TreeViewSelectableDirective, isStandalone: true, selector: "mona-tree-view[monaTreeViewSelectable]", inputs: { options: { classPropertyName: "options", publicName: "monaTreeViewSelectable", isSignal: true, isRequired: false, transformFunction: null }, selectBy: { classPropertyName: "selectBy", publicName: "selectBy", isSignal: true, isRequired: false, transformFunction: null }, selectedKeys: { classPropertyName: "selectedKeys", publicName: "selectedKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeSelect: "nodeSelect", selectedKeysChange: "selectedKeysChange", selectionChange: "selectionChange" }, exportAs: ["monaTreeViewSelectable"], ngImport: i0 }); }
790
- }
791
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TreeViewSelectableDirective, decorators: [{
792
- type: Directive,
793
- args: [{
794
- selector: "mona-tree-view[monaTreeViewSelectable]",
795
- exportAs: "monaTreeViewSelectable"
796
- }]
797
- }], ctorParameters: () => [], propDecorators: { nodeSelect: [{ type: i0.Output, args: ["nodeSelect"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaTreeViewSelectable", required: false }] }], selectBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectBy", required: false }] }], selectedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedKeys", required: false }] }], selectedKeysChange: [{ type: i0.Output, args: ["selectedKeysChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
798
-
799
- /*
800
- * Public API Surface of @nanahoshi/mona-ui/tree-view
801
- */
802
-
803
- /**
804
- * Generated bundle index. Do not edit.
805
- */
66
+ var TreeViewComponent = class TreeViewComponent {
67
+ #announcer;
68
+ #hostElementRef;
69
+ #i18n;
70
+ #labelledByText;
71
+ #loadingTimers;
72
+ #zone;
73
+ #pendingFilterAnnouncement;
74
+ constructor() {
75
+ this.#announcer = inject(LiveAnnouncer);
76
+ this.#hostElementRef = inject(ElementRef);
77
+ this.#i18n = inject(MonaI18nService);
78
+ this.#labelledByText = injectLabelledByText(() => this.ariaLabelledBy());
79
+ this.#loadingTimers = /* @__PURE__ */ new Set();
80
+ this.#zone = inject(NgZone);
81
+ this.#pendingFilterAnnouncement = null;
82
+ this.empty = computed(() => this.treeService.viewNodeSet().isEmpty(), ...ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []);
83
+ this.emptyText = computed(() => this.treeService.isTreeFiltered() ? this.messages().noMatches : this.messages().noData, ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
84
+ this.filterAriaLabel = computed(() => {
85
+ const name = this.ariaLabel().trim() || this.#labelledByText();
86
+ return name ? this.messages().filterLabel(name) : this.messages().filterTree;
87
+ }, ...ngDevMode ? [{ debugName: "filterAriaLabel" }] : /* istanbul ignore next */ []);
88
+ this.messages = this.#i18n.componentMessages("treeView", TREE_VIEW_DEFAULT_MESSAGES);
89
+ this.nodeTemplate = contentChild(TreeViewNodeTemplateDirective, {
90
+ ...ngDevMode ? { debugName: "nodeTemplate" } : /* istanbul ignore next */ {},
91
+ read: TemplateRef
92
+ });
93
+ this.statusId = `${createElementControlId()}-status`;
94
+ this.treeId = createElementControlId();
95
+ this.treeService = inject(TreeService);
96
+ this.animate = input(true, {
97
+ ...ngDevMode ? { debugName: "animate" } : /* istanbul ignore next */ {},
98
+ transform: booleanAttribute
99
+ });
100
+ this.ariaLabel = input("", {
101
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
102
+ alias: "aria-label"
103
+ });
104
+ this.ariaLabelledBy = input("", {
105
+ ...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
106
+ alias: "aria-labelledby"
107
+ });
108
+ this.blur = output();
109
+ this.children = input("", ...ngDevMode ? [{ debugName: "children" }] : /* istanbul ignore next */ []);
110
+ this.childrenLoadError = output();
111
+ this.data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
112
+ this.focus = output();
113
+ this.hasChildren = input(null, ...ngDevMode ? [{ debugName: "hasChildren" }] : /* istanbul ignore next */ []);
114
+ this.idField = input("", ...ngDevMode ? [{ debugName: "idField" }] : /* istanbul ignore next */ []);
115
+ this.mode = input("hierarchical", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
116
+ this.nodeClick = output();
117
+ this.parentIdField = input("", ...ngDevMode ? [{ debugName: "parentIdField" }] : /* istanbul ignore next */ []);
118
+ this.textField = input("", ...ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []);
119
+ effect(() => {
120
+ const textField = this.textField();
121
+ untracked(() => this.treeService.setTextField(textField));
122
+ });
123
+ effect(() => {
124
+ const mode = this.mode();
125
+ if (mode === "flat") this.#setFlatDataStructureFields();
126
+ else if (mode === "hierarchical") this.#setHierarchicalDataStructureFields();
127
+ const data = this.data();
128
+ untracked(() => {
129
+ this.treeService.setDataStructure(mode);
130
+ this.treeService.setData(data);
131
+ });
132
+ });
133
+ effect(() => {
134
+ const animate = this.animate();
135
+ untracked(() => {
136
+ this.treeService.setAnimationEnabled(animate);
137
+ });
138
+ });
139
+ effect(() => {
140
+ const filterText = this.treeService.filterText();
141
+ const matchCount = this.treeService.matchCount();
142
+ untracked(() => this.#announceFilterResults(filterText, matchCount));
143
+ });
144
+ this.treeService.nodeClick$.pipe(takeUntilDestroyed()).subscribe((event) => this.nodeClick.emit(event));
145
+ this.treeService.focus$.pipe(takeUntilDestroyed()).subscribe((event) => this.focus.emit(event));
146
+ this.treeService.blur$.pipe(takeUntilDestroyed()).subscribe((event) => this.blur.emit(event));
147
+ this.treeService.childrenLoadStart$.pipe(takeUntilDestroyed()).subscribe((node) => this.#announceLoadingAfterDelay(node));
148
+ inject(DestroyRef).onDestroy(() => this.#loadingTimers.forEach((timer) => clearTimeout(timer)));
149
+ this.treeService.childrenLoadError$.pipe(takeUntilDestroyed()).subscribe(({ error, node }) => {
150
+ this.#announcer.announce(this.messages().loadError(this.treeService.getNodeText(node)), "polite");
151
+ this.childrenLoadError.emit({
152
+ error,
153
+ node: node.nodeItem
154
+ });
155
+ });
156
+ if (isDevMode()) afterNextRender({ read: () => this.#warnIfUnnamed() });
157
+ }
158
+ moveNode(source, target, position) {
159
+ if (position === "outside") return null;
160
+ const sourceNode = this.treeService.getNodeByUid(source.uid);
161
+ if (!sourceNode) return null;
162
+ const targetNode = this.treeService.getNodeByUid(target.uid);
163
+ if (!targetNode) return null;
164
+ const originalParentUid = sourceNode.parent?.uid ?? null;
165
+ const originalIndex = sourceNode.parent !== null ? sourceNode.parent.children().toList().indexOf(sourceNode) : this.treeService.nodeSet().toList().indexOf(sourceNode);
166
+ if (!this.treeService.moveNode(sourceNode, targetNode, position)) return null;
167
+ return {
168
+ originalParentUid,
169
+ originalIndex,
170
+ sourceNodeUid: sourceNode.uid
171
+ };
172
+ }
173
+ undoMoveNode(snapshot) {
174
+ const sourceNode = this.treeService.getNodeByUid(snapshot.sourceNodeUid);
175
+ if (!sourceNode) return;
176
+ if (snapshot.originalParentUid === null) {
177
+ this.treeService.detachNode(sourceNode);
178
+ this.treeService.insertNodeAtIndex(sourceNode, null, snapshot.originalIndex);
179
+ } else {
180
+ this.treeService.detachNode(sourceNode);
181
+ this.treeService.insertNodeAtIndex(sourceNode, snapshot.originalParentUid, snapshot.originalIndex);
182
+ }
183
+ }
184
+ onFilterChange(event) {
185
+ this.treeService.filterChange$.next(event);
186
+ if (!event.isDefaultPrevented()) {
187
+ this.#pendingFilterAnnouncement = event.filter;
188
+ this.treeService.filter$.next(event.filter);
189
+ }
190
+ }
191
+ #announceLoadingAfterDelay(node) {
192
+ this.#zone.runOutsideAngular(() => {
193
+ const timer = setTimeout(() => {
194
+ this.#loadingTimers.delete(timer);
195
+ if (node.loading()) this.#announcer.announce(this.messages().loadingNode(this.treeService.getNodeText(node)), "polite");
196
+ }, LOADING_ANNOUNCEMENT_DELAY);
197
+ this.#loadingTimers.add(timer);
198
+ });
199
+ }
200
+ #announceFilterResults(filterText, matchCount) {
201
+ if (this.#pendingFilterAnnouncement === null || this.#pendingFilterAnnouncement !== filterText) return;
202
+ this.#pendingFilterAnnouncement = null;
203
+ if (!filterText) return;
204
+ const messages = this.messages();
205
+ this.#announcer.announce(matchCount === 0 ? messages.noMatches : messages.results(matchCount), "polite");
206
+ }
207
+ #setFlatDataStructureFields() {
208
+ const idField = this.idField();
209
+ const parentIdField = this.parentIdField();
210
+ untracked(() => {
211
+ this.treeService.setFlatIdField(idField);
212
+ this.treeService.setFlatParentIdField(parentIdField);
213
+ });
214
+ }
215
+ #setHierarchicalDataStructureFields() {
216
+ const childrenSelector = this.children();
217
+ const hasChildren = this.hasChildren();
218
+ untracked(() => {
219
+ this.treeService.setChildrenSelector(childrenSelector);
220
+ this.treeService.setHasChildrenPredicate(hasChildren);
221
+ });
222
+ }
223
+ #warnIfUnnamed() {
224
+ if (this.ariaLabel().trim() || this.ariaLabelledBy().trim()) return;
225
+ console.warn("[Mona TreeView] A tree view needs an accessible name. Set aria-label or aria-labelledby.", this.#hostElementRef.nativeElement);
226
+ }
227
+ static {
228
+ this.ɵfac = i0.ɵɵngDeclareFactory({
229
+ minVersion: "12.0.0",
230
+ version: "22.2.6",
231
+ ngImport: i0,
232
+ type: TreeViewComponent,
233
+ deps: [],
234
+ target: i0.ɵɵFactoryTarget.Component
235
+ });
236
+ }
237
+ static {
238
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
239
+ minVersion: "17.0.0",
240
+ version: "22.2.6",
241
+ type: TreeViewComponent,
242
+ isStandalone: true,
243
+ selector: "mona-tree-view",
244
+ inputs: {
245
+ animate: {
246
+ classPropertyName: "animate",
247
+ publicName: "animate",
248
+ isSignal: true,
249
+ isRequired: false,
250
+ transformFunction: null
251
+ },
252
+ ariaLabel: {
253
+ classPropertyName: "ariaLabel",
254
+ publicName: "aria-label",
255
+ isSignal: true,
256
+ isRequired: false,
257
+ transformFunction: null
258
+ },
259
+ ariaLabelledBy: {
260
+ classPropertyName: "ariaLabelledBy",
261
+ publicName: "aria-labelledby",
262
+ isSignal: true,
263
+ isRequired: false,
264
+ transformFunction: null
265
+ },
266
+ children: {
267
+ classPropertyName: "children",
268
+ publicName: "children",
269
+ isSignal: true,
270
+ isRequired: false,
271
+ transformFunction: null
272
+ },
273
+ data: {
274
+ classPropertyName: "data",
275
+ publicName: "data",
276
+ isSignal: true,
277
+ isRequired: false,
278
+ transformFunction: null
279
+ },
280
+ hasChildren: {
281
+ classPropertyName: "hasChildren",
282
+ publicName: "hasChildren",
283
+ isSignal: true,
284
+ isRequired: false,
285
+ transformFunction: null
286
+ },
287
+ idField: {
288
+ classPropertyName: "idField",
289
+ publicName: "idField",
290
+ isSignal: true,
291
+ isRequired: false,
292
+ transformFunction: null
293
+ },
294
+ mode: {
295
+ classPropertyName: "mode",
296
+ publicName: "mode",
297
+ isSignal: true,
298
+ isRequired: false,
299
+ transformFunction: null
300
+ },
301
+ parentIdField: {
302
+ classPropertyName: "parentIdField",
303
+ publicName: "parentIdField",
304
+ isSignal: true,
305
+ isRequired: false,
306
+ transformFunction: null
307
+ },
308
+ textField: {
309
+ classPropertyName: "textField",
310
+ publicName: "textField",
311
+ isSignal: true,
312
+ isRequired: false,
313
+ transformFunction: null
314
+ }
315
+ },
316
+ outputs: {
317
+ blur: "blur",
318
+ childrenLoadError: "childrenLoadError",
319
+ focus: "focus",
320
+ nodeClick: "nodeClick"
321
+ },
322
+ host: { properties: {
323
+ "attr.aria-label": "null",
324
+ "attr.aria-labelledby": "null"
325
+ } },
326
+ providers: [TreeService],
327
+ queries: [{
328
+ propertyName: "nodeTemplate",
329
+ first: true,
330
+ predicate: TreeViewNodeTemplateDirective,
331
+ descendants: true,
332
+ read: TemplateRef,
333
+ isSignal: true
334
+ }],
335
+ ngImport: i0,
336
+ template: "@if (treeService.filterableOptions().enabled) {\n <div role=\"search\" [attr.aria-label]=\"filterAriaLabel()\">\n <mona-filter-input\n [filter]=\"treeService.filterText()\"\n [debounce]=\"treeService.filterableOptions().debounce\"\n [placeholder]=\"treeService.filterPlaceholder()\"\n [ariaLabel]=\"filterAriaLabel()\"\n [ariaControls]=\"treeId\"\n [autoFocus]=\"false\"\n (filterChange)=\"onFilterChange($event)\"></mona-filter-input>\n </div>\n}\n<!-- An empty tree stays a named Tab stop, lying over the \"No data\" or \"No matching items\" text that describes it. -->\n<div class=\"relative flex-1 overflow-auto\">\n @if (empty()) {\n <mona-placeholder\n [id]=\"statusId\"\n [text]=\"emptyText()\"\n class=\"flex h-full w-full items-center justify-center\"></mona-placeholder>\n }\n <mona-tree\n [id]=\"treeId\"\n [class.absolute]=\"empty()\"\n [class.inset-0]=\"empty()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [ariaDescribedBy]=\"empty() ? statusId : ''\">\n @if (nodeTemplate()) {\n <ng-template monaTreeNodeTemplate let-dataItem let-element=\"element\">\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, element }\"></ng-container>\n </ng-template>\n }\n </mona-tree>\n</div>\n",
337
+ dependencies: [
338
+ {
339
+ kind: "component",
340
+ type: FilterInputComponent,
341
+ selector: "mona-filter-input",
342
+ inputs: [
343
+ "activeDescendant",
344
+ "ariaControls",
345
+ "ariaLabel",
346
+ "autoFocus",
347
+ "controls",
348
+ "debounce",
349
+ "filter",
350
+ "placeholder",
351
+ "size"
352
+ ],
353
+ outputs: [
354
+ "filterChange",
355
+ "inputBlur",
356
+ "inputFocus"
357
+ ]
358
+ },
359
+ {
360
+ kind: "component",
361
+ type: PlaceholderComponent,
362
+ selector: "mona-placeholder",
363
+ inputs: ["text", "class"]
364
+ },
365
+ {
366
+ kind: "component",
367
+ type: TreeComponent,
368
+ selector: "mona-tree",
369
+ inputs: [
370
+ "ariaDescribedBy",
371
+ "ariaLabel",
372
+ "ariaLabelledBy",
373
+ "data"
374
+ ]
375
+ },
376
+ {
377
+ kind: "directive",
378
+ type: TreeNodeTemplateDirective,
379
+ selector: "ng-template[monaTreeNodeTemplate]"
380
+ },
381
+ {
382
+ kind: "directive",
383
+ type: NgTemplateOutlet,
384
+ selector: "[ngTemplateOutlet]",
385
+ inputs: [
386
+ "ngTemplateOutletContext",
387
+ "ngTemplateOutlet",
388
+ "ngTemplateOutletInjector"
389
+ ]
390
+ }
391
+ ]
392
+ });
393
+ }
394
+ };
395
+ i0.ɵɵngDeclareClassMetadata({
396
+ minVersion: "12.0.0",
397
+ version: "22.2.6",
398
+ ngImport: i0,
399
+ type: TreeViewComponent,
400
+ decorators: [{
401
+ type: Component,
402
+ args: [{
403
+ selector: "mona-tree-view",
404
+ imports: [
405
+ FilterInputComponent,
406
+ PlaceholderComponent,
407
+ TreeComponent,
408
+ TreeNodeTemplateDirective,
409
+ NgTemplateOutlet
410
+ ],
411
+ providers: [TreeService],
412
+ host: {
413
+ "[attr.aria-label]": "null",
414
+ "[attr.aria-labelledby]": "null"
415
+ },
416
+ template: "@if (treeService.filterableOptions().enabled) {\n <div role=\"search\" [attr.aria-label]=\"filterAriaLabel()\">\n <mona-filter-input\n [filter]=\"treeService.filterText()\"\n [debounce]=\"treeService.filterableOptions().debounce\"\n [placeholder]=\"treeService.filterPlaceholder()\"\n [ariaLabel]=\"filterAriaLabel()\"\n [ariaControls]=\"treeId\"\n [autoFocus]=\"false\"\n (filterChange)=\"onFilterChange($event)\"></mona-filter-input>\n </div>\n}\n<!-- An empty tree stays a named Tab stop, lying over the \"No data\" or \"No matching items\" text that describes it. -->\n<div class=\"relative flex-1 overflow-auto\">\n @if (empty()) {\n <mona-placeholder\n [id]=\"statusId\"\n [text]=\"emptyText()\"\n class=\"flex h-full w-full items-center justify-center\"></mona-placeholder>\n }\n <mona-tree\n [id]=\"treeId\"\n [class.absolute]=\"empty()\"\n [class.inset-0]=\"empty()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [ariaDescribedBy]=\"empty() ? statusId : ''\">\n @if (nodeTemplate()) {\n <ng-template monaTreeNodeTemplate let-dataItem let-element=\"element\">\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, element }\"></ng-container>\n </ng-template>\n }\n </mona-tree>\n</div>\n"
417
+ }]
418
+ }],
419
+ ctorParameters: () => [],
420
+ propDecorators: {
421
+ nodeTemplate: [{
422
+ type: i0.ContentChild,
423
+ args: [i0.forwardRef(() => TreeViewNodeTemplateDirective), {
424
+ read: TemplateRef,
425
+ isSignal: true
426
+ }]
427
+ }],
428
+ animate: [{
429
+ type: i0.Input,
430
+ args: [{
431
+ isSignal: true,
432
+ alias: "animate",
433
+ required: false
434
+ }]
435
+ }],
436
+ ariaLabel: [{
437
+ type: i0.Input,
438
+ args: [{
439
+ isSignal: true,
440
+ alias: "aria-label",
441
+ required: false
442
+ }]
443
+ }],
444
+ ariaLabelledBy: [{
445
+ type: i0.Input,
446
+ args: [{
447
+ isSignal: true,
448
+ alias: "aria-labelledby",
449
+ required: false
450
+ }]
451
+ }],
452
+ blur: [{
453
+ type: i0.Output,
454
+ args: ["blur"]
455
+ }],
456
+ children: [{
457
+ type: i0.Input,
458
+ args: [{
459
+ isSignal: true,
460
+ alias: "children",
461
+ required: false
462
+ }]
463
+ }],
464
+ childrenLoadError: [{
465
+ type: i0.Output,
466
+ args: ["childrenLoadError"]
467
+ }],
468
+ data: [{
469
+ type: i0.Input,
470
+ args: [{
471
+ isSignal: true,
472
+ alias: "data",
473
+ required: false
474
+ }]
475
+ }],
476
+ focus: [{
477
+ type: i0.Output,
478
+ args: ["focus"]
479
+ }],
480
+ hasChildren: [{
481
+ type: i0.Input,
482
+ args: [{
483
+ isSignal: true,
484
+ alias: "hasChildren",
485
+ required: false
486
+ }]
487
+ }],
488
+ idField: [{
489
+ type: i0.Input,
490
+ args: [{
491
+ isSignal: true,
492
+ alias: "idField",
493
+ required: false
494
+ }]
495
+ }],
496
+ mode: [{
497
+ type: i0.Input,
498
+ args: [{
499
+ isSignal: true,
500
+ alias: "mode",
501
+ required: false
502
+ }]
503
+ }],
504
+ nodeClick: [{
505
+ type: i0.Output,
506
+ args: ["nodeClick"]
507
+ }],
508
+ parentIdField: [{
509
+ type: i0.Input,
510
+ args: [{
511
+ isSignal: true,
512
+ alias: "parentIdField",
513
+ required: false
514
+ }]
515
+ }],
516
+ textField: [{
517
+ type: i0.Input,
518
+ args: [{
519
+ isSignal: true,
520
+ alias: "textField",
521
+ required: false
522
+ }]
523
+ }]
524
+ }
525
+ });
526
+ var TreeViewCheckableDirective = class TreeViewCheckableDirective {
527
+ #defaultOptions;
528
+ #treeService;
529
+ constructor() {
530
+ this.#defaultOptions = {
531
+ checkChildren: true,
532
+ checkDisabledChildren: false,
533
+ checkParents: true,
534
+ childrenOnly: false,
535
+ enabled: true,
536
+ mode: "multiple"
537
+ };
538
+ this.#treeService = inject(TreeService);
539
+ this.checkBy = input("", ...ngDevMode ? [{ debugName: "checkBy" }] : /* istanbul ignore next */ []);
540
+ this.checkedKeys = input([], ...ngDevMode ? [{ debugName: "checkedKeys" }] : /* istanbul ignore next */ []);
541
+ this.checkedKeysChange = output();
542
+ this.hasCheckbox = input(null, ...ngDevMode ? [{ debugName: "hasCheckbox" }] : /* istanbul ignore next */ []);
543
+ this.nodeCheck = output();
544
+ this.options = input("", {
545
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
546
+ alias: "monaTreeViewCheckable"
547
+ });
548
+ effect(() => {
549
+ const checkBy = this.checkBy();
550
+ untracked(() => {
551
+ this.#treeService.setCheckBy(checkBy ?? "");
552
+ });
553
+ });
554
+ effect(() => {
555
+ const checkedKeys = this.checkedKeys();
556
+ untracked(() => {
557
+ this.#treeService.setCheckedKeys(checkedKeys ?? []);
558
+ });
559
+ });
560
+ effect(() => {
561
+ const options = this.options();
562
+ untracked(() => {
563
+ if (options === "") this.#treeService.setCheckableOptions(this.#defaultOptions);
564
+ else this.#treeService.setCheckableOptions({
565
+ ...this.#defaultOptions,
566
+ ...options
567
+ });
568
+ });
569
+ });
570
+ effect(() => {
571
+ const hasCheckbox = this.hasCheckbox();
572
+ untracked(() => {
573
+ this.#treeService.setHasCheckboxPredicate(hasCheckbox);
574
+ });
575
+ });
576
+ this.#treeService.checkedKeysChange$.pipe(takeUntilDestroyed()).subscribe((keys) => this.checkedKeysChange.emit(keys.toArray()));
577
+ this.#treeService.nodeCheck$.pipe(takeUntilDestroyed()).subscribe((event) => this.nodeCheck.emit(event));
578
+ }
579
+ static {
580
+ this.ɵfac = i0.ɵɵngDeclareFactory({
581
+ minVersion: "12.0.0",
582
+ version: "22.2.6",
583
+ ngImport: i0,
584
+ type: TreeViewCheckableDirective,
585
+ deps: [],
586
+ target: i0.ɵɵFactoryTarget.Directive
587
+ });
588
+ }
589
+ static {
590
+ this.ɵdir = i0.ɵɵngDeclareDirective({
591
+ minVersion: "17.1.0",
592
+ version: "22.2.6",
593
+ type: TreeViewCheckableDirective,
594
+ isStandalone: true,
595
+ selector: "mona-tree-view[monaTreeViewCheckable]",
596
+ inputs: {
597
+ checkBy: {
598
+ classPropertyName: "checkBy",
599
+ publicName: "checkBy",
600
+ isSignal: true,
601
+ isRequired: false,
602
+ transformFunction: null
603
+ },
604
+ checkedKeys: {
605
+ classPropertyName: "checkedKeys",
606
+ publicName: "checkedKeys",
607
+ isSignal: true,
608
+ isRequired: false,
609
+ transformFunction: null
610
+ },
611
+ hasCheckbox: {
612
+ classPropertyName: "hasCheckbox",
613
+ publicName: "hasCheckbox",
614
+ isSignal: true,
615
+ isRequired: false,
616
+ transformFunction: null
617
+ },
618
+ options: {
619
+ classPropertyName: "options",
620
+ publicName: "monaTreeViewCheckable",
621
+ isSignal: true,
622
+ isRequired: false,
623
+ transformFunction: null
624
+ }
625
+ },
626
+ outputs: {
627
+ checkedKeysChange: "checkedKeysChange",
628
+ nodeCheck: "nodeCheck"
629
+ },
630
+ exportAs: ["monaTreeViewCheckable"],
631
+ ngImport: i0
632
+ });
633
+ }
634
+ };
635
+ i0.ɵɵngDeclareClassMetadata({
636
+ minVersion: "12.0.0",
637
+ version: "22.2.6",
638
+ ngImport: i0,
639
+ type: TreeViewCheckableDirective,
640
+ decorators: [{
641
+ type: Directive,
642
+ args: [{
643
+ selector: "mona-tree-view[monaTreeViewCheckable]",
644
+ exportAs: "monaTreeViewCheckable"
645
+ }]
646
+ }],
647
+ ctorParameters: () => [],
648
+ propDecorators: {
649
+ checkBy: [{
650
+ type: i0.Input,
651
+ args: [{
652
+ isSignal: true,
653
+ alias: "checkBy",
654
+ required: false
655
+ }]
656
+ }],
657
+ checkedKeys: [{
658
+ type: i0.Input,
659
+ args: [{
660
+ isSignal: true,
661
+ alias: "checkedKeys",
662
+ required: false
663
+ }]
664
+ }],
665
+ checkedKeysChange: [{
666
+ type: i0.Output,
667
+ args: ["checkedKeysChange"]
668
+ }],
669
+ hasCheckbox: [{
670
+ type: i0.Input,
671
+ args: [{
672
+ isSignal: true,
673
+ alias: "hasCheckbox",
674
+ required: false
675
+ }]
676
+ }],
677
+ nodeCheck: [{
678
+ type: i0.Output,
679
+ args: ["nodeCheck"]
680
+ }],
681
+ options: [{
682
+ type: i0.Input,
683
+ args: [{
684
+ isSignal: true,
685
+ alias: "monaTreeViewCheckable",
686
+ required: false
687
+ }]
688
+ }]
689
+ }
690
+ });
691
+ var TreeViewDisableDirective = class TreeViewDisableDirective {
692
+ #defaultOptions;
693
+ #treeService;
694
+ constructor() {
695
+ this.#defaultOptions = {
696
+ disableChildren: true,
697
+ enabled: true
698
+ };
699
+ this.#treeService = inject(TreeService);
700
+ this.disableBy = input("", ...ngDevMode ? [{ debugName: "disableBy" }] : /* istanbul ignore next */ []);
701
+ this.disabledKeys = input([], ...ngDevMode ? [{ debugName: "disabledKeys" }] : /* istanbul ignore next */ []);
702
+ this.options = input("", {
703
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
704
+ alias: "monaTreeViewDisable"
705
+ });
706
+ effect(() => {
707
+ const disableBy = this.disableBy();
708
+ untracked(() => {
709
+ this.#treeService.setDisableBy(disableBy ?? "");
710
+ });
711
+ });
712
+ effect(() => {
713
+ const disabledKeys = this.disabledKeys();
714
+ untracked(() => {
715
+ this.#treeService.setDisabledKeys(disabledKeys ?? []);
716
+ });
717
+ });
718
+ effect(() => {
719
+ const options = this.options();
720
+ untracked(() => {
721
+ if (options === "") this.#treeService.setDisableOptions(this.#defaultOptions);
722
+ else this.#treeService.setDisableOptions({
723
+ ...this.#defaultOptions,
724
+ ...options
725
+ });
726
+ });
727
+ });
728
+ }
729
+ static {
730
+ this.ɵfac = i0.ɵɵngDeclareFactory({
731
+ minVersion: "12.0.0",
732
+ version: "22.2.6",
733
+ ngImport: i0,
734
+ type: TreeViewDisableDirective,
735
+ deps: [],
736
+ target: i0.ɵɵFactoryTarget.Directive
737
+ });
738
+ }
739
+ static {
740
+ this.ɵdir = i0.ɵɵngDeclareDirective({
741
+ minVersion: "17.1.0",
742
+ version: "22.2.6",
743
+ type: TreeViewDisableDirective,
744
+ isStandalone: true,
745
+ selector: "mona-tree-view[monaTreeViewDisable]",
746
+ inputs: {
747
+ disableBy: {
748
+ classPropertyName: "disableBy",
749
+ publicName: "disableBy",
750
+ isSignal: true,
751
+ isRequired: false,
752
+ transformFunction: null
753
+ },
754
+ disabledKeys: {
755
+ classPropertyName: "disabledKeys",
756
+ publicName: "disabledKeys",
757
+ isSignal: true,
758
+ isRequired: false,
759
+ transformFunction: null
760
+ },
761
+ options: {
762
+ classPropertyName: "options",
763
+ publicName: "monaTreeViewDisable",
764
+ isSignal: true,
765
+ isRequired: false,
766
+ transformFunction: null
767
+ }
768
+ },
769
+ exportAs: ["monaTreeViewDisable"],
770
+ ngImport: i0
771
+ });
772
+ }
773
+ };
774
+ i0.ɵɵngDeclareClassMetadata({
775
+ minVersion: "12.0.0",
776
+ version: "22.2.6",
777
+ ngImport: i0,
778
+ type: TreeViewDisableDirective,
779
+ decorators: [{
780
+ type: Directive,
781
+ args: [{
782
+ selector: "mona-tree-view[monaTreeViewDisable]",
783
+ exportAs: "monaTreeViewDisable"
784
+ }]
785
+ }],
786
+ ctorParameters: () => [],
787
+ propDecorators: {
788
+ disableBy: [{
789
+ type: i0.Input,
790
+ args: [{
791
+ isSignal: true,
792
+ alias: "disableBy",
793
+ required: false
794
+ }]
795
+ }],
796
+ disabledKeys: [{
797
+ type: i0.Input,
798
+ args: [{
799
+ isSignal: true,
800
+ alias: "disabledKeys",
801
+ required: false
802
+ }]
803
+ }],
804
+ options: [{
805
+ type: i0.Input,
806
+ args: [{
807
+ isSignal: true,
808
+ alias: "monaTreeViewDisable",
809
+ required: false
810
+ }]
811
+ }]
812
+ }
813
+ });
814
+ var TreeViewDragAndDropDirective = class TreeViewDragAndDropDirective {
815
+ #defaultOptions;
816
+ #treeService;
817
+ #treeView;
818
+ constructor() {
819
+ this.#defaultOptions = { enabled: true };
820
+ this.#treeService = inject(TreeService);
821
+ this.#treeView = inject(TreeViewComponent);
822
+ this.nodeDrag = output();
823
+ this.nodeDragEnd = output();
824
+ this.nodeDragStart = output();
825
+ this.nodeDrop = output();
826
+ this.options = input("", {
827
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
828
+ alias: "monaTreeViewDragAndDrop"
829
+ });
830
+ effect(() => {
831
+ const options = this.options();
832
+ untracked(() => {
833
+ if (options === "") this.#treeService.setDraggableOptions(this.#defaultOptions);
834
+ else this.#treeService.setDraggableOptions({
835
+ ...this.#defaultOptions,
836
+ ...options
837
+ });
838
+ });
839
+ });
840
+ this.#treeService.nodeDrag$.pipe(takeUntilDestroyed()).subscribe((e) => {
841
+ this.nodeDrag.emit(e.dragEvent);
842
+ });
843
+ this.#treeService.nodeDragEnd$.pipe(takeUntilDestroyed()).subscribe((e) => {
844
+ this.nodeDragEnd.emit(e);
845
+ });
846
+ this.#treeService.nodeDragStart$.pipe(takeUntilDestroyed()).subscribe((e) => {
847
+ this.nodeDragStart.emit(e);
848
+ });
849
+ this.#treeService.nodeDrop$.pipe(takeUntilDestroyed()).subscribe((e) => {
850
+ const event = new NodeDropEvent$1({
851
+ event: e.event,
852
+ position: e.position,
853
+ sourceNode: e.sourceNode,
854
+ targetNode: e.targetNode,
855
+ treeView: this.#treeView
856
+ });
857
+ this.nodeDrop.emit(event);
858
+ if (event.isDefaultPrevented()) e.preventDefault();
859
+ });
860
+ }
861
+ static {
862
+ this.ɵfac = i0.ɵɵngDeclareFactory({
863
+ minVersion: "12.0.0",
864
+ version: "22.2.6",
865
+ ngImport: i0,
866
+ type: TreeViewDragAndDropDirective,
867
+ deps: [],
868
+ target: i0.ɵɵFactoryTarget.Directive
869
+ });
870
+ }
871
+ static {
872
+ this.ɵdir = i0.ɵɵngDeclareDirective({
873
+ minVersion: "17.1.0",
874
+ version: "22.2.6",
875
+ type: TreeViewDragAndDropDirective,
876
+ isStandalone: true,
877
+ selector: "mona-tree-view[monaTreeViewDragAndDrop]",
878
+ inputs: { options: {
879
+ classPropertyName: "options",
880
+ publicName: "monaTreeViewDragAndDrop",
881
+ isSignal: true,
882
+ isRequired: false,
883
+ transformFunction: null
884
+ } },
885
+ outputs: {
886
+ nodeDrag: "nodeDrag",
887
+ nodeDragEnd: "nodeDragEnd",
888
+ nodeDragStart: "nodeDragStart",
889
+ nodeDrop: "nodeDrop"
890
+ },
891
+ exportAs: ["monaTreeViewDragAndDrop"],
892
+ ngImport: i0
893
+ });
894
+ }
895
+ };
896
+ i0.ɵɵngDeclareClassMetadata({
897
+ minVersion: "12.0.0",
898
+ version: "22.2.6",
899
+ ngImport: i0,
900
+ type: TreeViewDragAndDropDirective,
901
+ decorators: [{
902
+ type: Directive,
903
+ args: [{
904
+ selector: "mona-tree-view[monaTreeViewDragAndDrop]",
905
+ exportAs: "monaTreeViewDragAndDrop"
906
+ }]
907
+ }],
908
+ ctorParameters: () => [],
909
+ propDecorators: {
910
+ nodeDrag: [{
911
+ type: i0.Output,
912
+ args: ["nodeDrag"]
913
+ }],
914
+ nodeDragEnd: [{
915
+ type: i0.Output,
916
+ args: ["nodeDragEnd"]
917
+ }],
918
+ nodeDragStart: [{
919
+ type: i0.Output,
920
+ args: ["nodeDragStart"]
921
+ }],
922
+ nodeDrop: [{
923
+ type: i0.Output,
924
+ args: ["nodeDrop"]
925
+ }],
926
+ options: [{
927
+ type: i0.Input,
928
+ args: [{
929
+ isSignal: true,
930
+ alias: "monaTreeViewDragAndDrop",
931
+ required: false
932
+ }]
933
+ }]
934
+ }
935
+ });
936
+ var TreeViewExpandableDirective = class TreeViewExpandableDirective {
937
+ #defaultOptions;
938
+ #treeService;
939
+ constructor() {
940
+ this.#defaultOptions = { enabled: true };
941
+ this.#treeService = inject(TreeService);
942
+ this.collapse = output();
943
+ this.expand = output();
944
+ this.expandBy = input("", ...ngDevMode ? [{ debugName: "expandBy" }] : /* istanbul ignore next */ []);
945
+ this.expandedKeys = input([], ...ngDevMode ? [{ debugName: "expandedKeys" }] : /* istanbul ignore next */ []);
946
+ this.expandedKeysChange = output();
947
+ this.options = input("", {
948
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
949
+ alias: "monaTreeViewExpandable"
950
+ });
951
+ effect(() => {
952
+ const expandBy = this.expandBy();
953
+ untracked(() => {
954
+ this.#treeService.setExpandBy(expandBy ?? "");
955
+ });
956
+ });
957
+ effect(() => {
958
+ const expandedKeys = this.expandedKeys();
959
+ untracked(() => {
960
+ this.#treeService.setExpandedKeys(expandedKeys ?? []);
961
+ });
962
+ });
963
+ effect(() => {
964
+ const options = this.options();
965
+ untracked(() => {
966
+ if (options === "") this.#treeService.setExpandableOptions(this.#defaultOptions);
967
+ else this.#treeService.setExpandableOptions({
968
+ ...this.#defaultOptions,
969
+ ...options
970
+ });
971
+ });
972
+ });
973
+ this.#treeService.expandedKeysChange$.pipe(takeUntilDestroyed()).subscribe((keys) => this.expandedKeysChange.emit(keys.toArray()));
974
+ this.#treeService.nodeExpand$.pipe(takeUntilDestroyed()).subscribe((event) => {
975
+ if (event.expanded) this.expand.emit(event.node.nodeItem);
976
+ else this.collapse.emit(event.node.nodeItem);
977
+ });
978
+ }
979
+ static {
980
+ this.ɵfac = i0.ɵɵngDeclareFactory({
981
+ minVersion: "12.0.0",
982
+ version: "22.2.6",
983
+ ngImport: i0,
984
+ type: TreeViewExpandableDirective,
985
+ deps: [],
986
+ target: i0.ɵɵFactoryTarget.Directive
987
+ });
988
+ }
989
+ static {
990
+ this.ɵdir = i0.ɵɵngDeclareDirective({
991
+ minVersion: "17.1.0",
992
+ version: "22.2.6",
993
+ type: TreeViewExpandableDirective,
994
+ isStandalone: true,
995
+ selector: "mona-tree-view[monaTreeViewExpandable]",
996
+ inputs: {
997
+ expandBy: {
998
+ classPropertyName: "expandBy",
999
+ publicName: "expandBy",
1000
+ isSignal: true,
1001
+ isRequired: false,
1002
+ transformFunction: null
1003
+ },
1004
+ expandedKeys: {
1005
+ classPropertyName: "expandedKeys",
1006
+ publicName: "expandedKeys",
1007
+ isSignal: true,
1008
+ isRequired: false,
1009
+ transformFunction: null
1010
+ },
1011
+ options: {
1012
+ classPropertyName: "options",
1013
+ publicName: "monaTreeViewExpandable",
1014
+ isSignal: true,
1015
+ isRequired: false,
1016
+ transformFunction: null
1017
+ }
1018
+ },
1019
+ outputs: {
1020
+ collapse: "collapse",
1021
+ expand: "expand",
1022
+ expandedKeysChange: "expandedKeysChange"
1023
+ },
1024
+ exportAs: ["monaTreeViewExpandable"],
1025
+ ngImport: i0
1026
+ });
1027
+ }
1028
+ };
1029
+ i0.ɵɵngDeclareClassMetadata({
1030
+ minVersion: "12.0.0",
1031
+ version: "22.2.6",
1032
+ ngImport: i0,
1033
+ type: TreeViewExpandableDirective,
1034
+ decorators: [{
1035
+ type: Directive,
1036
+ args: [{
1037
+ selector: "mona-tree-view[monaTreeViewExpandable]",
1038
+ exportAs: "monaTreeViewExpandable"
1039
+ }]
1040
+ }],
1041
+ ctorParameters: () => [],
1042
+ propDecorators: {
1043
+ collapse: [{
1044
+ type: i0.Output,
1045
+ args: ["collapse"]
1046
+ }],
1047
+ expand: [{
1048
+ type: i0.Output,
1049
+ args: ["expand"]
1050
+ }],
1051
+ expandBy: [{
1052
+ type: i0.Input,
1053
+ args: [{
1054
+ isSignal: true,
1055
+ alias: "expandBy",
1056
+ required: false
1057
+ }]
1058
+ }],
1059
+ expandedKeys: [{
1060
+ type: i0.Input,
1061
+ args: [{
1062
+ isSignal: true,
1063
+ alias: "expandedKeys",
1064
+ required: false
1065
+ }]
1066
+ }],
1067
+ expandedKeysChange: [{
1068
+ type: i0.Output,
1069
+ args: ["expandedKeysChange"]
1070
+ }],
1071
+ options: [{
1072
+ type: i0.Input,
1073
+ args: [{
1074
+ isSignal: true,
1075
+ alias: "monaTreeViewExpandable",
1076
+ required: false
1077
+ }]
1078
+ }]
1079
+ }
1080
+ });
1081
+ var TreeViewFilterableDirective = class TreeViewFilterableDirective {
1082
+ #defaultOptions;
1083
+ #treeService;
1084
+ constructor() {
1085
+ this.#defaultOptions = {
1086
+ enabled: true,
1087
+ operator: "contains",
1088
+ caseSensitive: false,
1089
+ debounce: 0
1090
+ };
1091
+ this.#treeService = inject(TreeService);
1092
+ this.filter = model("", ...ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []);
1093
+ this.filterInput = output();
1094
+ this.filterPlaceholder = input("", ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
1095
+ this.options = input("", {
1096
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
1097
+ alias: "monaTreeViewFilterable"
1098
+ });
1099
+ effect(() => {
1100
+ const filter = this.filter();
1101
+ untracked(() => this.#treeService.filter$.next(filter));
1102
+ });
1103
+ effect(() => {
1104
+ const filterPlaceholder = this.filterPlaceholder();
1105
+ untracked(() => this.#treeService.filterPlaceholder.set(filterPlaceholder));
1106
+ });
1107
+ effect(() => {
1108
+ const options = this.options();
1109
+ untracked(() => {
1110
+ if (options === "") this.#treeService.setFilterableOptions(this.#defaultOptions);
1111
+ else this.#treeService.setFilterableOptions({
1112
+ ...this.#defaultOptions,
1113
+ ...options
1114
+ });
1115
+ });
1116
+ });
1117
+ this.#treeService.filterChange$.pipe(takeUntilDestroyed()).subscribe((event) => {
1118
+ this.filterInput.emit(event);
1119
+ if (!event.isDefaultPrevented()) this.filter.set(event.filter);
1120
+ });
1121
+ }
1122
+ static {
1123
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1124
+ minVersion: "12.0.0",
1125
+ version: "22.2.6",
1126
+ ngImport: i0,
1127
+ type: TreeViewFilterableDirective,
1128
+ deps: [],
1129
+ target: i0.ɵɵFactoryTarget.Directive
1130
+ });
1131
+ }
1132
+ static {
1133
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1134
+ minVersion: "17.1.0",
1135
+ version: "22.2.6",
1136
+ type: TreeViewFilterableDirective,
1137
+ isStandalone: true,
1138
+ selector: "mona-tree-view[monaTreeViewFilterable]",
1139
+ inputs: {
1140
+ filter: {
1141
+ classPropertyName: "filter",
1142
+ publicName: "filter",
1143
+ isSignal: true,
1144
+ isRequired: false,
1145
+ transformFunction: null
1146
+ },
1147
+ filterPlaceholder: {
1148
+ classPropertyName: "filterPlaceholder",
1149
+ publicName: "filterPlaceholder",
1150
+ isSignal: true,
1151
+ isRequired: false,
1152
+ transformFunction: null
1153
+ },
1154
+ options: {
1155
+ classPropertyName: "options",
1156
+ publicName: "monaTreeViewFilterable",
1157
+ isSignal: true,
1158
+ isRequired: false,
1159
+ transformFunction: null
1160
+ }
1161
+ },
1162
+ outputs: {
1163
+ filter: "filterChange",
1164
+ filterInput: "filterInput"
1165
+ },
1166
+ exportAs: ["monaTreeViewFilterable"],
1167
+ ngImport: i0
1168
+ });
1169
+ }
1170
+ };
1171
+ i0.ɵɵngDeclareClassMetadata({
1172
+ minVersion: "12.0.0",
1173
+ version: "22.2.6",
1174
+ ngImport: i0,
1175
+ type: TreeViewFilterableDirective,
1176
+ decorators: [{
1177
+ type: Directive,
1178
+ args: [{
1179
+ selector: "mona-tree-view[monaTreeViewFilterable]",
1180
+ exportAs: "monaTreeViewFilterable"
1181
+ }]
1182
+ }],
1183
+ ctorParameters: () => [],
1184
+ propDecorators: {
1185
+ filter: [{
1186
+ type: i0.Input,
1187
+ args: [{
1188
+ isSignal: true,
1189
+ alias: "filter",
1190
+ required: false
1191
+ }]
1192
+ }, {
1193
+ type: i0.Output,
1194
+ args: ["filterChange"]
1195
+ }],
1196
+ filterInput: [{
1197
+ type: i0.Output,
1198
+ args: ["filterInput"]
1199
+ }],
1200
+ filterPlaceholder: [{
1201
+ type: i0.Input,
1202
+ args: [{
1203
+ isSignal: true,
1204
+ alias: "filterPlaceholder",
1205
+ required: false
1206
+ }]
1207
+ }],
1208
+ options: [{
1209
+ type: i0.Input,
1210
+ args: [{
1211
+ isSignal: true,
1212
+ alias: "monaTreeViewFilterable",
1213
+ required: false
1214
+ }]
1215
+ }]
1216
+ }
1217
+ });
1218
+ var TreeViewSelectableDirective = class TreeViewSelectableDirective {
1219
+ #defaultOptions;
1220
+ #treeService;
1221
+ constructor() {
1222
+ this.#defaultOptions = {
1223
+ childrenOnly: false,
1224
+ enabled: true,
1225
+ mode: "single",
1226
+ toggleable: false
1227
+ };
1228
+ this.#treeService = inject(TreeService);
1229
+ this.nodeSelect = output();
1230
+ this.options = input("", {
1231
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
1232
+ alias: "monaTreeViewSelectable"
1233
+ });
1234
+ this.selectBy = input("", ...ngDevMode ? [{ debugName: "selectBy" }] : /* istanbul ignore next */ []);
1235
+ this.selectedKeys = input([], ...ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []);
1236
+ this.selectedKeysChange = output();
1237
+ this.selectionChange = output();
1238
+ effect(() => {
1239
+ const selectBy = this.selectBy();
1240
+ untracked(() => this.#treeService.setSelectBy(selectBy ?? ""));
1241
+ });
1242
+ effect(() => {
1243
+ const selectedKeys = this.selectedKeys();
1244
+ untracked(() => this.#treeService.setSelectedKeys(selectedKeys ?? []));
1245
+ });
1246
+ effect(() => {
1247
+ const options = this.options();
1248
+ untracked(() => {
1249
+ if (options === "") this.#treeService.setSelectableOptions(this.#defaultOptions);
1250
+ else this.#treeService.setSelectableOptions({
1251
+ ...this.#defaultOptions,
1252
+ ...options
1253
+ });
1254
+ });
1255
+ });
1256
+ this.#treeService.nodeSelect$.pipe(takeUntilDestroyed()).subscribe((event) => this.nodeSelect.emit(event));
1257
+ this.#treeService.selectedKeysChange$.pipe(takeUntilDestroyed()).subscribe((keys) => this.selectedKeysChange.emit(keys.toArray()));
1258
+ this.#treeService.selectionChange$.pipe(takeUntilDestroyed()).subscribe((nodeItem) => this.selectionChange.emit(nodeItem));
1259
+ }
1260
+ static {
1261
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1262
+ minVersion: "12.0.0",
1263
+ version: "22.2.6",
1264
+ ngImport: i0,
1265
+ type: TreeViewSelectableDirective,
1266
+ deps: [],
1267
+ target: i0.ɵɵFactoryTarget.Directive
1268
+ });
1269
+ }
1270
+ static {
1271
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1272
+ minVersion: "17.1.0",
1273
+ version: "22.2.6",
1274
+ type: TreeViewSelectableDirective,
1275
+ isStandalone: true,
1276
+ selector: "mona-tree-view[monaTreeViewSelectable]",
1277
+ inputs: {
1278
+ options: {
1279
+ classPropertyName: "options",
1280
+ publicName: "monaTreeViewSelectable",
1281
+ isSignal: true,
1282
+ isRequired: false,
1283
+ transformFunction: null
1284
+ },
1285
+ selectBy: {
1286
+ classPropertyName: "selectBy",
1287
+ publicName: "selectBy",
1288
+ isSignal: true,
1289
+ isRequired: false,
1290
+ transformFunction: null
1291
+ },
1292
+ selectedKeys: {
1293
+ classPropertyName: "selectedKeys",
1294
+ publicName: "selectedKeys",
1295
+ isSignal: true,
1296
+ isRequired: false,
1297
+ transformFunction: null
1298
+ }
1299
+ },
1300
+ outputs: {
1301
+ nodeSelect: "nodeSelect",
1302
+ selectedKeysChange: "selectedKeysChange",
1303
+ selectionChange: "selectionChange"
1304
+ },
1305
+ exportAs: ["monaTreeViewSelectable"],
1306
+ ngImport: i0
1307
+ });
1308
+ }
1309
+ };
1310
+ i0.ɵɵngDeclareClassMetadata({
1311
+ minVersion: "12.0.0",
1312
+ version: "22.2.6",
1313
+ ngImport: i0,
1314
+ type: TreeViewSelectableDirective,
1315
+ decorators: [{
1316
+ type: Directive,
1317
+ args: [{
1318
+ selector: "mona-tree-view[monaTreeViewSelectable]",
1319
+ exportAs: "monaTreeViewSelectable"
1320
+ }]
1321
+ }],
1322
+ ctorParameters: () => [],
1323
+ propDecorators: {
1324
+ nodeSelect: [{
1325
+ type: i0.Output,
1326
+ args: ["nodeSelect"]
1327
+ }],
1328
+ options: [{
1329
+ type: i0.Input,
1330
+ args: [{
1331
+ isSignal: true,
1332
+ alias: "monaTreeViewSelectable",
1333
+ required: false
1334
+ }]
1335
+ }],
1336
+ selectBy: [{
1337
+ type: i0.Input,
1338
+ args: [{
1339
+ isSignal: true,
1340
+ alias: "selectBy",
1341
+ required: false
1342
+ }]
1343
+ }],
1344
+ selectedKeys: [{
1345
+ type: i0.Input,
1346
+ args: [{
1347
+ isSignal: true,
1348
+ alias: "selectedKeys",
1349
+ required: false
1350
+ }]
1351
+ }],
1352
+ selectedKeysChange: [{
1353
+ type: i0.Output,
1354
+ args: ["selectedKeysChange"]
1355
+ }],
1356
+ selectionChange: [{
1357
+ type: i0.Output,
1358
+ args: ["selectionChange"]
1359
+ }]
1360
+ }
1361
+ });
1362
+ export { NodeCheckEvent, NodeClickEvent, NodeDragEndEvent, NodeDragEvent, NodeDragStartEvent, NodeDropEvent, NodeSelectEvent, TREE_VIEW_DEFAULT_MESSAGES, TreeViewCheckableDirective, TreeViewComponent, TreeViewDisableDirective, TreeViewDragAndDropDirective, TreeViewExpandableDirective, TreeViewFilterableDirective, TreeViewNodeTemplateDirective, TreeViewSelectableDirective, moveFlatTreeNode, moveTreeNode };
806
1363
 
807
- export { TREE_VIEW_DEFAULT_MESSAGES, TreeViewCheckableDirective, TreeViewComponent, TreeViewDisableDirective, TreeViewDragAndDropDirective, TreeViewExpandableDirective, TreeViewFilterableDirective, TreeViewNodeTemplateDirective, TreeViewSelectableDirective };
808
- //# sourceMappingURL=nanahoshi-mona-ui-tree-view.mjs.map
1364
+ //# sourceMappingURL=nanahoshi-mona-ui-tree-view.mjs.map