@rio-cloud/uikit-mcp 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/README.md +75 -39
  2. package/dist/doc-metadata.json +1872 -0
  3. package/dist/docs/components/accentBar.md +582 -0
  4. package/dist/docs/components/activity.md +330 -0
  5. package/dist/docs/components/animatedNumber.md +88 -0
  6. package/dist/docs/components/animatedTextReveal.md +381 -0
  7. package/dist/docs/components/animations.md +459 -0
  8. package/dist/docs/components/appHeader.md +737 -0
  9. package/dist/docs/components/appLayout.md +2033 -0
  10. package/dist/docs/components/appNavigationBar.md +274 -0
  11. package/dist/docs/components/areaCharts.md +828 -0
  12. package/dist/docs/components/aspectRatioPlaceholder.md +106 -0
  13. package/dist/docs/components/assetTree.md +3132 -0
  14. package/dist/docs/components/autosuggests.md +1177 -0
  15. package/dist/docs/components/avatar.md +206 -0
  16. package/dist/docs/components/banner.md +668 -0
  17. package/dist/docs/components/barCharts.md +2765 -0
  18. package/dist/docs/components/barList.md +517 -0
  19. package/dist/docs/components/basicMap.md +167 -0
  20. package/dist/docs/components/bottomSheet.md +721 -0
  21. package/dist/docs/components/button.md +775 -0
  22. package/dist/docs/components/buttonToolbar.md +134 -0
  23. package/dist/docs/components/calendarStripe.md +533 -0
  24. package/dist/docs/components/card.md +86 -0
  25. package/dist/docs/components/carousel.md +128 -0
  26. package/dist/docs/components/chartColors.md +716 -0
  27. package/dist/docs/components/chartsGettingStarted.md +28 -0
  28. package/dist/docs/components/chat.md +935 -0
  29. package/dist/docs/components/checkbox.md +996 -0
  30. package/dist/docs/components/clearableInput.md +806 -0
  31. package/dist/docs/components/collapse.md +189 -0
  32. package/dist/docs/components/composedCharts.md +424 -0
  33. package/dist/docs/components/contentLoader.md +674 -0
  34. package/dist/docs/components/dataTabs.md +1251 -0
  35. package/dist/docs/components/datepickers.md +2543 -0
  36. package/dist/docs/components/dialogs.md +2244 -0
  37. package/dist/docs/components/divider.md +219 -0
  38. package/dist/docs/components/dropdowns.md +17538 -0
  39. package/dist/docs/components/editableContent.md +1127 -0
  40. package/dist/docs/components/expander.md +970 -0
  41. package/dist/docs/components/fade.md +836 -0
  42. package/dist/docs/components/fadeExpander.md +180 -0
  43. package/dist/docs/components/fadeUp.md +396 -0
  44. package/dist/docs/components/feedback.md +758 -0
  45. package/dist/docs/components/filePickers.md +370 -0
  46. package/dist/docs/components/formLabel.md +251 -0
  47. package/dist/docs/components/fullscreenMap.md +10 -0
  48. package/dist/docs/components/groupedItemList.md +1001 -0
  49. package/dist/docs/components/iconList.md +306 -0
  50. package/dist/docs/components/imagePreloader.md +167 -0
  51. package/dist/docs/components/labeledElement.md +115 -0
  52. package/dist/docs/components/licensePlate.md +412 -0
  53. package/dist/docs/components/lineCharts.md +2014 -0
  54. package/dist/docs/components/listMenu.md +392 -0
  55. package/dist/docs/components/loadMore.md +219 -0
  56. package/dist/docs/components/mainNavigation.md +129 -0
  57. package/dist/docs/components/mapCircle.md +93 -0
  58. package/dist/docs/components/mapCluster.md +337 -0
  59. package/dist/docs/components/mapContext.md +284 -0
  60. package/dist/docs/components/mapDraggableMarker.md +150 -0
  61. package/dist/docs/components/mapGettingStarted.md +39 -0
  62. package/dist/docs/components/mapInfoBubble.md +135 -0
  63. package/dist/docs/components/mapLayerGroup.md +94 -0
  64. package/dist/docs/components/mapMarker.md +1814 -0
  65. package/dist/docs/components/mapPolygon.md +959 -0
  66. package/dist/docs/components/mapRoute.md +3816 -0
  67. package/dist/docs/components/mapRouteGenerator.md +6 -0
  68. package/dist/docs/components/mapSettings.md +1040 -0
  69. package/dist/docs/components/mapUtils.md +132 -0
  70. package/dist/docs/components/multiselects.md +1921 -0
  71. package/dist/docs/components/noData.md +210 -0
  72. package/dist/docs/components/notifications.md +314 -0
  73. package/dist/docs/components/numbercontrol.md +706 -0
  74. package/dist/docs/components/onboarding.md +297 -0
  75. package/dist/docs/components/page.md +241 -0
  76. package/dist/docs/components/pager.md +133 -0
  77. package/dist/docs/components/pieCharts.md +1284 -0
  78. package/dist/docs/components/popover.md +222 -0
  79. package/dist/docs/components/position.md +50 -0
  80. package/dist/docs/components/radialBarCharts.md +3663 -0
  81. package/dist/docs/components/radiobutton.md +1271 -0
  82. package/dist/docs/components/releaseNotes.md +135 -0
  83. package/dist/docs/components/resizer.md +162 -0
  84. package/dist/docs/components/responsiveColumnStripe.md +435 -0
  85. package/dist/docs/components/responsiveVideo.md +71 -0
  86. package/dist/docs/components/rioglyph.md +331 -0
  87. package/dist/docs/components/rules.md +965 -0
  88. package/dist/docs/components/saveableInput.md +1721 -0
  89. package/dist/docs/components/selects.md +1993 -0
  90. package/dist/docs/components/sidebar.md +332 -0
  91. package/dist/docs/components/sliders.md +376 -0
  92. package/dist/docs/components/smoothScrollbars.md +1180 -0
  93. package/dist/docs/components/spinners.md +506 -0
  94. package/dist/docs/components/states.md +1176 -0
  95. package/dist/docs/components/statsWidgets.md +636 -0
  96. package/dist/docs/components/statusBar.md +644 -0
  97. package/dist/docs/components/stepButton.md +61 -0
  98. package/dist/docs/components/steppedProgressBars.md +1064 -0
  99. package/dist/docs/components/subNavigation.md +470 -0
  100. package/dist/docs/components/supportMarker.md +115 -0
  101. package/dist/docs/components/svgImage.md +248 -0
  102. package/dist/docs/components/switch.md +554 -0
  103. package/dist/docs/components/tables.md +8 -0
  104. package/dist/docs/components/tagManager.md +476 -0
  105. package/dist/docs/components/tags.md +785 -0
  106. package/dist/docs/components/teaser.md +925 -0
  107. package/dist/docs/components/timeline.md +514 -0
  108. package/dist/docs/components/timepicker.md +262 -0
  109. package/dist/docs/components/toggleButton.md +178 -0
  110. package/dist/docs/components/tooltip.md +454 -0
  111. package/dist/docs/components/virtualList.md +486 -0
  112. package/dist/docs/foundations.md +20901 -0
  113. package/dist/docs/start/changelog.md +714 -0
  114. package/dist/docs/start/goodtoknow.md +14 -0
  115. package/dist/docs/start/guidelines/color-combinations.md +678 -0
  116. package/dist/docs/start/guidelines/custom-css.md +42 -0
  117. package/dist/docs/start/guidelines/custom-rioglyph.md +35 -0
  118. package/dist/docs/start/guidelines/formatting.md +587 -0
  119. package/dist/docs/start/guidelines/iframe.md +323 -0
  120. package/dist/docs/start/guidelines/obfuscate-data.md +30 -0
  121. package/dist/docs/start/guidelines/print-css.md +36 -0
  122. package/dist/docs/start/guidelines/spinner.md +710 -0
  123. package/dist/docs/start/guidelines/supported-browsers.md +10 -0
  124. package/dist/docs/start/guidelines/writing.md +635 -0
  125. package/dist/docs/start/howto.md +187 -0
  126. package/dist/docs/start/intro.md +43 -0
  127. package/dist/docs/start/responsiveness.md +98 -0
  128. package/dist/docs/templates/common-table.md +1111 -0
  129. package/dist/docs/templates/detail-views.md +942 -0
  130. package/dist/docs/templates/expandable-details.md +228 -0
  131. package/dist/docs/templates/feature-cards.md +549 -0
  132. package/dist/docs/templates/form-summary.md +199 -0
  133. package/dist/docs/templates/form-toggle.md +367 -0
  134. package/dist/docs/templates/list-blocks.md +1021 -0
  135. package/dist/docs/templates/loading-progress.md +109 -0
  136. package/dist/docs/templates/options-panel.md +152 -0
  137. package/dist/docs/templates/panel-variants.md +164 -0
  138. package/dist/docs/templates/progress-cards.md +607 -0
  139. package/dist/docs/templates/progress-success.md +142 -0
  140. package/dist/docs/templates/settings-form.md +434 -0
  141. package/dist/docs/templates/stats-blocks.md +1381 -0
  142. package/dist/docs/templates/table-panel.md +184 -0
  143. package/dist/docs/templates/table-row-animation.md +317 -0
  144. package/dist/docs/templates/usage-cards.md +227 -0
  145. package/dist/docs/utilities/deviceUtils.md +123 -0
  146. package/dist/docs/utilities/featureToggles.md +90 -0
  147. package/dist/docs/utilities/fuelTypeUtils.md +186 -0
  148. package/dist/docs/utilities/routeUtils.md +138 -0
  149. package/dist/docs/utilities/useAfterMount.md +66 -0
  150. package/dist/docs/utilities/useAutoAnimate.md +193 -0
  151. package/dist/docs/utilities/useAverage.md +95 -0
  152. package/dist/docs/utilities/useClickOutside.md +61 -0
  153. package/dist/docs/utilities/useClipboard.md +93 -0
  154. package/dist/docs/utilities/useCount.md +178 -0
  155. package/dist/docs/utilities/useDarkMode.md +49 -0
  156. package/dist/docs/utilities/useDebugInfo.md +126 -0
  157. package/dist/docs/utilities/useEffectOnce.md +58 -0
  158. package/dist/docs/utilities/useElapsedTime.md +58 -0
  159. package/dist/docs/utilities/useElementSize.md +71 -0
  160. package/dist/docs/utilities/useEsc.md +58 -0
  161. package/dist/docs/utilities/useEvent.md +64 -0
  162. package/dist/docs/utilities/useFocusTrap.md +85 -0
  163. package/dist/docs/utilities/useFullscreen.md +198 -0
  164. package/dist/docs/utilities/useHover.md +55 -0
  165. package/dist/docs/utilities/useIncomingPostMessages.md +237 -0
  166. package/dist/docs/utilities/useInterval.md +85 -0
  167. package/dist/docs/utilities/useIsFocusWithin.md +114 -0
  168. package/dist/docs/utilities/useKey.md +151 -0
  169. package/dist/docs/utilities/useLocalStorage.md +91 -0
  170. package/dist/docs/utilities/useLocationSuggestions.md +114 -0
  171. package/dist/docs/utilities/useMax.md +62 -0
  172. package/dist/docs/utilities/useMin.md +78 -0
  173. package/dist/docs/utilities/useMutationObserver.md +113 -0
  174. package/dist/docs/utilities/useOnScreen.md +138 -0
  175. package/dist/docs/utilities/useOnlineStatus.md +49 -0
  176. package/dist/docs/utilities/usePostMessage.md +117 -0
  177. package/dist/docs/utilities/usePostMessageSender.md +257 -0
  178. package/dist/docs/utilities/usePrevious.md +101 -0
  179. package/dist/docs/utilities/useResizeObserver.md +151 -0
  180. package/dist/docs/utilities/useScrollPosition.md +252 -0
  181. package/dist/docs/utilities/useSearch.md +228 -0
  182. package/dist/docs/utilities/useSorting.md +389 -0
  183. package/dist/docs/utilities/useStateWithValidation.md +83 -0
  184. package/dist/docs/utilities/useSum.md +155 -0
  185. package/dist/docs/utilities/useTableExport.md +404 -0
  186. package/dist/docs/utilities/useTableSelection.md +1120 -0
  187. package/dist/docs/utilities/useTimeout.md +55 -0
  188. package/dist/docs/utilities/useToggle.md +115 -0
  189. package/dist/docs/utilities/useWindowResize.md +70 -0
  190. package/dist/index.mjs +271 -0
  191. package/dist/search-synonyms.json +134 -0
  192. package/dist/version.json +4 -0
  193. package/package.json +23 -19
  194. package/bin/uikit-mcp.mjs +0 -23
  195. package/data/pages/Components/components/accentbar.json +0 -207
  196. package/data/pages/Components/components/activity.json +0 -87
  197. package/data/pages/Components/components/animatednumber.json +0 -99
  198. package/data/pages/Components/components/animations.json +0 -87
  199. package/data/pages/Components/components/appheader.json +0 -291
  200. package/data/pages/Components/components/applayout.json +0 -1198
  201. package/data/pages/Components/components/appnavigationbar.json +0 -327
  202. package/data/pages/Components/components/areacharts.json +0 -563
  203. package/data/pages/Components/components/aspectratioplaceholder.json +0 -75
  204. package/data/pages/Components/components/assettree.json +0 -3080
  205. package/data/pages/Components/components/autosuggests.json +0 -710
  206. package/data/pages/Components/components/avatar.json +0 -157
  207. package/data/pages/Components/components/banner.json +0 -599
  208. package/data/pages/Components/components/barcharts.json +0 -1507
  209. package/data/pages/Components/components/barlist.json +0 -223
  210. package/data/pages/Components/components/basicmap.json +0 -68
  211. package/data/pages/Components/components/bottomsheet.json +0 -601
  212. package/data/pages/Components/components/button.json +0 -583
  213. package/data/pages/Components/components/buttontoolbar.json +0 -63
  214. package/data/pages/Components/components/calendarstripe.json +0 -235
  215. package/data/pages/Components/components/card.json +0 -69
  216. package/data/pages/Components/components/carousel.json +0 -39
  217. package/data/pages/Components/components/chartcolors.json +0 -34
  218. package/data/pages/Components/components/chartsgettingstarted.json +0 -32
  219. package/data/pages/Components/components/chat.json +0 -39
  220. package/data/pages/Components/components/checkbox.json +0 -847
  221. package/data/pages/Components/components/clearableinput.json +0 -789
  222. package/data/pages/Components/components/collapse.json +0 -175
  223. package/data/pages/Components/components/composedcharts.json +0 -159
  224. package/data/pages/Components/components/contentloader.json +0 -233
  225. package/data/pages/Components/components/datatabs.json +0 -680
  226. package/data/pages/Components/components/datepickers.json +0 -287
  227. package/data/pages/Components/components/dialogs.json +0 -1492
  228. package/data/pages/Components/components/divider.json +0 -93
  229. package/data/pages/Components/components/dropdowns.json +0 -936
  230. package/data/pages/Components/components/editablecontent.json +0 -1117
  231. package/data/pages/Components/components/expander.json +0 -377
  232. package/data/pages/Components/components/fade.json +0 -403
  233. package/data/pages/Components/components/fadeexpander.json +0 -75
  234. package/data/pages/Components/components/fadeup.json +0 -127
  235. package/data/pages/Components/components/feedback.json +0 -269
  236. package/data/pages/Components/components/filepickers.json +0 -269
  237. package/data/pages/Components/components/formlabel.json +0 -115
  238. package/data/pages/Components/components/fullscreenmap.json +0 -22
  239. package/data/pages/Components/components/groupeditemlist.json +0 -323
  240. package/data/pages/Components/components/iconlist.json +0 -45
  241. package/data/pages/Components/components/imagepreloader.json +0 -81
  242. package/data/pages/Components/components/labeledelement.json +0 -75
  243. package/data/pages/Components/components/licenseplate.json +0 -69
  244. package/data/pages/Components/components/linecharts.json +0 -987
  245. package/data/pages/Components/components/listmenu.json +0 -313
  246. package/data/pages/Components/components/loadmore.json +0 -175
  247. package/data/pages/Components/components/mainnavigation.json +0 -39
  248. package/data/pages/Components/components/mapcircle.json +0 -34
  249. package/data/pages/Components/components/mapcluster.json +0 -51
  250. package/data/pages/Components/components/mapcontext.json +0 -105
  251. package/data/pages/Components/components/mapdraggablemarker.json +0 -34
  252. package/data/pages/Components/components/mapgettingstarted.json +0 -27
  253. package/data/pages/Components/components/mapgroup.json +0 -1198
  254. package/data/pages/Components/components/mapinfobubble.json +0 -34
  255. package/data/pages/Components/components/maplayergroup.json +0 -34
  256. package/data/pages/Components/components/mapmarker.json +0 -700
  257. package/data/pages/Components/components/mappolygon.json +0 -45
  258. package/data/pages/Components/components/maproute.json +0 -623
  259. package/data/pages/Components/components/maproutegenerator.json +0 -16
  260. package/data/pages/Components/components/mapsettings.json +0 -51
  261. package/data/pages/Components/components/maputils.json +0 -34
  262. package/data/pages/Components/components/multiselects.json +0 -1451
  263. package/data/pages/Components/components/nodata.json +0 -139
  264. package/data/pages/Components/components/notifications.json +0 -65
  265. package/data/pages/Components/components/numbercontrol.json +0 -301
  266. package/data/pages/Components/components/onboarding.json +0 -302
  267. package/data/pages/Components/components/page.json +0 -197
  268. package/data/pages/Components/components/pager.json +0 -93
  269. package/data/pages/Components/components/piecharts.json +0 -731
  270. package/data/pages/Components/components/popover.json +0 -251
  271. package/data/pages/Components/components/position.json +0 -69
  272. package/data/pages/Components/components/radialbarcharts.json +0 -1304
  273. package/data/pages/Components/components/radiobutton.json +0 -1105
  274. package/data/pages/Components/components/releasenotes.json +0 -44
  275. package/data/pages/Components/components/resizer.json +0 -93
  276. package/data/pages/Components/components/responsivecolumnstripe.json +0 -123
  277. package/data/pages/Components/components/responsivevideo.json +0 -75
  278. package/data/pages/Components/components/rioglyph.json +0 -93
  279. package/data/pages/Components/components/rules.json +0 -410
  280. package/data/pages/Components/components/saveableinput.json +0 -703
  281. package/data/pages/Components/components/selects.json +0 -701
  282. package/data/pages/Components/components/sidebar.json +0 -243
  283. package/data/pages/Components/components/sliders.json +0 -235
  284. package/data/pages/Components/components/smoothscrollbars.json +0 -335
  285. package/data/pages/Components/components/spinners.json +0 -343
  286. package/data/pages/Components/components/states.json +0 -1705
  287. package/data/pages/Components/components/statswidgets.json +0 -314
  288. package/data/pages/Components/components/statusbar.json +0 -177
  289. package/data/pages/Components/components/stepbutton.json +0 -57
  290. package/data/pages/Components/components/steppedprogressbars.json +0 -417
  291. package/data/pages/Components/components/subnavigation.json +0 -107
  292. package/data/pages/Components/components/supportmarker.json +0 -45
  293. package/data/pages/Components/components/svgimage.json +0 -81
  294. package/data/pages/Components/components/switch.json +0 -111
  295. package/data/pages/Components/components/tables.json +0 -144
  296. package/data/pages/Components/components/tagmanager.json +0 -86
  297. package/data/pages/Components/components/tags.json +0 -146
  298. package/data/pages/Components/components/teaser.json +0 -188
  299. package/data/pages/Components/components/timeline.json +0 -45
  300. package/data/pages/Components/components/timepicker.json +0 -163
  301. package/data/pages/Components/components/togglebutton.json +0 -247
  302. package/data/pages/Components/components/tooltip.json +0 -270
  303. package/data/pages/Components/components/virtuallist.json +0 -175
  304. package/data/pages/Foundations/foundations.json +0 -2475
  305. package/data/pages/Getting-started/start/changelog.json +0 -22
  306. package/data/pages/Getting-started/start/goodtoknow.json +0 -32
  307. package/data/pages/Getting-started/start/guidelines/color-combinations.json +0 -58
  308. package/data/pages/Getting-started/start/guidelines/custom-css.json +0 -27
  309. package/data/pages/Getting-started/start/guidelines/custom-rioglyph.json +0 -22
  310. package/data/pages/Getting-started/start/guidelines/formatting.json +0 -97
  311. package/data/pages/Getting-started/start/guidelines/iframe.json +0 -93
  312. package/data/pages/Getting-started/start/guidelines/obfuscate-data.json +0 -22
  313. package/data/pages/Getting-started/start/guidelines/print-css.json +0 -37
  314. package/data/pages/Getting-started/start/guidelines/spinner.json +0 -144
  315. package/data/pages/Getting-started/start/guidelines/supported-browsers.json +0 -22
  316. package/data/pages/Getting-started/start/guidelines/writing.json +0 -242
  317. package/data/pages/Getting-started/start/howto.json +0 -72
  318. package/data/pages/Getting-started/start/intro.json +0 -37
  319. package/data/pages/Getting-started/start/responsiveness.json +0 -52
  320. package/data/pages/Templates/templates/common-table.json +0 -39
  321. package/data/pages/Templates/templates/detail-views.json +0 -71
  322. package/data/pages/Templates/templates/expandable-details.json +0 -39
  323. package/data/pages/Templates/templates/feature-cards.json +0 -103
  324. package/data/pages/Templates/templates/form-summary.json +0 -39
  325. package/data/pages/Templates/templates/form-toggle.json +0 -39
  326. package/data/pages/Templates/templates/list-blocks.json +0 -119
  327. package/data/pages/Templates/templates/loading-progress.json +0 -39
  328. package/data/pages/Templates/templates/options-panel.json +0 -39
  329. package/data/pages/Templates/templates/panel-variants.json +0 -39
  330. package/data/pages/Templates/templates/progress-cards.json +0 -71
  331. package/data/pages/Templates/templates/progress-success.json +0 -39
  332. package/data/pages/Templates/templates/settings-form.json +0 -39
  333. package/data/pages/Templates/templates/stats-blocks.json +0 -135
  334. package/data/pages/Templates/templates/table-panel.json +0 -39
  335. package/data/pages/Templates/templates/table-row-animation.json +0 -39
  336. package/data/pages/Templates/templates/usage-cards.json +0 -39
  337. package/data/pages/Utilities/utilities/deviceutils.json +0 -39
  338. package/data/pages/Utilities/utilities/featuretoggles.json +0 -42
  339. package/data/pages/Utilities/utilities/fueltypeutils.json +0 -118
  340. package/data/pages/Utilities/utilities/routeutils.json +0 -34
  341. package/data/pages/Utilities/utilities/useaftermount.json +0 -63
  342. package/data/pages/Utilities/utilities/useaverage.json +0 -86
  343. package/data/pages/Utilities/utilities/useclickoutside.json +0 -69
  344. package/data/pages/Utilities/utilities/useclipboard.json +0 -57
  345. package/data/pages/Utilities/utilities/usecount.json +0 -92
  346. package/data/pages/Utilities/utilities/usedarkmode.json +0 -50
  347. package/data/pages/Utilities/utilities/usedebuginfo.json +0 -63
  348. package/data/pages/Utilities/utilities/useeffectonce.json +0 -57
  349. package/data/pages/Utilities/utilities/useelapsedtime.json +0 -57
  350. package/data/pages/Utilities/utilities/useelementsize.json +0 -63
  351. package/data/pages/Utilities/utilities/useesc.json +0 -57
  352. package/data/pages/Utilities/utilities/useevent.json +0 -75
  353. package/data/pages/Utilities/utilities/usefocustrap.json +0 -57
  354. package/data/pages/Utilities/utilities/usefullscreen.json +0 -197
  355. package/data/pages/Utilities/utilities/usehover.json +0 -57
  356. package/data/pages/Utilities/utilities/useinterval.json +0 -63
  357. package/data/pages/Utilities/utilities/useisfocuswithin.json +0 -75
  358. package/data/pages/Utilities/utilities/usekey.json +0 -75
  359. package/data/pages/Utilities/utilities/uselocalstorage.json +0 -69
  360. package/data/pages/Utilities/utilities/uselocationsuggestions.json +0 -110
  361. package/data/pages/Utilities/utilities/usemax.json +0 -86
  362. package/data/pages/Utilities/utilities/usemin.json +0 -86
  363. package/data/pages/Utilities/utilities/usemutationobserver.json +0 -69
  364. package/data/pages/Utilities/utilities/useonlinestatus.json +0 -39
  365. package/data/pages/Utilities/utilities/useonscreen.json +0 -63
  366. package/data/pages/Utilities/utilities/usepostmessage.json +0 -80
  367. package/data/pages/Utilities/utilities/useprevious.json +0 -63
  368. package/data/pages/Utilities/utilities/useresizeobserver.json +0 -65
  369. package/data/pages/Utilities/utilities/usescrollposition.json +0 -103
  370. package/data/pages/Utilities/utilities/usesearch.json +0 -197
  371. package/data/pages/Utilities/utilities/usesorting.json +0 -139
  372. package/data/pages/Utilities/utilities/usestatewithvalidation.json +0 -69
  373. package/data/pages/Utilities/utilities/usesum.json +0 -86
  374. package/data/pages/Utilities/utilities/usetableexport.json +0 -87
  375. package/data/pages/Utilities/utilities/usetableselection.json +0 -311
  376. package/data/pages/Utilities/utilities/usetimeout.json +0 -63
  377. package/data/pages/Utilities/utilities/usetoggle.json +0 -75
  378. package/data/pages/Utilities/utilities/usewindowresize.json +0 -63
  379. package/data/version.json +0 -4
  380. package/docs/content-schema.md +0 -147
  381. package/docs/navigation-inventory.json +0 -1310
  382. package/docs/search-synonyms.json +0 -43
  383. package/server/index.mjs +0 -268
  384. package/server/lib/load-docs.mjs +0 -48
  385. package/server/lib/normalise-doc.mjs +0 -220
  386. package/server/lib/render-markdown.mjs +0 -82
  387. package/server/lib/search-index.mjs +0 -49
  388. package/server/lib/types.js +0 -99
@@ -0,0 +1,3132 @@
1
+ # AssetTree
2
+
3
+ *Category:* Components
4
+ *Section:* Selection
5
+ *Source:* https://uikit.developers.rio.cloud/#components/assetTree
6
+ *Captured:* 2025-12-12T14:20:32.129Z
7
+
8
+ The asset tree components are using labels that need to be defined from the outside of the components, meaning the come from your service. To align on the labels and their translations you should use the shared project on Phrase.
9
+
10
+ ## AssetTree
11
+
12
+ ### Example: Example 1
13
+
14
+ Filter
15
+
16
+ 5920
17
+ 4
18
+
19
+ Group - Ada Carroll - 364111
20
+
21
+ Group - Adrienne Hartmann - 323112
22
+
23
+ Group - Adrienne Ritchie - 744514
24
+
25
+ Group - Agnes Boyer - 871212
26
+
27
+ Group - Alan Bauch - 196214
28
+
29
+ Group - Albert Hudson - 836021
30
+
31
+ Group - Alejandro Considine - 895713
32
+
33
+ Group - Alexander McGlynn - 779416
34
+
35
+ Group - Alison Olson - 595512
36
+
37
+ Group - Allen Jakubowski - 804915
38
+
39
+ Group - Allen Waters - 354312
40
+
41
+ Group - Alonzo Brekke - 57275
42
+
43
+ Group - Alonzo Morar - 447115
44
+
45
+ Group - Alton Lindgren - 417810
46
+
47
+ 200
48
+
49
+ 200
50
+
51
+ Load trucksClear treeToggle all groups selection
52
+
53
+ Current category:
54
+ trucks
55
+ Selected groups:
56
+
57
+ Selected assets:
58
+
59
+ Expanded groups:
60
+ Trailer Group
61
+
62
+ Selected drivers:
63
+
64
+ Search value:
65
+
66
+ Asset type filter:
67
+ []
68
+
69
+ #### Summary
70
+
71
+ Filter
72
+
73
+ 5920
74
+ 4
75
+
76
+ Group - Ada Carroll - 364111
77
+
78
+ Group - Adrienne Hartmann - 323112
79
+
80
+ Group - Adrienne Ritchie - 744514
81
+
82
+ Group - Agnes Boyer - 871212
83
+
84
+ Group - Alan Bauch - 196214
85
+
86
+ Group - Albert Hudson - 836021
87
+
88
+ Group - Alejandro Considine - 895713
89
+
90
+ Group - Alexander McGlynn - 779416
91
+
92
+ Group - Alison Olson - 595512
93
+
94
+ Group - Allen Jakubowski - 804915
95
+
96
+ Group - Allen Waters - 354312
97
+
98
+ Group - Alonzo Brekke - 57275
99
+
100
+ Group - Alonzo Morar - 447115
101
+
102
+ Group - Alton Lindgren - 417810
103
+
104
+ 200
105
+
106
+ 200
107
+
108
+ Load trucksClear treeToggle all groups selection
109
+
110
+ Current category:
111
+ trucks
112
+ Selected groups:
113
+
114
+ Selected assets:
115
+
116
+ Expanded groups:
117
+ Trailer Group
118
+
119
+ Selected drivers:
120
+
121
+ Search value:
122
+
123
+ Asset type filter:
124
+ []
125
+
126
+ #### React (tsx)
127
+
128
+ ```tsx
129
+ import { useState } from 'react';
130
+ import { get, isEmpty, isObject, random } from 'es-toolkit/compat';
131
+ import faker from 'faker';
132
+
133
+ import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
134
+ import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
135
+ import Tree, {
136
+ type TreeItemName,
137
+ type TreeGroup,
138
+ type TreeItem,
139
+ type SelectionChangeResponse,
140
+ } from '@rio-cloud/rio-uikit/Tree';
141
+ import TreeSearch from '@rio-cloud/rio-uikit/TreeSearch';
142
+ import TreeSummary from '@rio-cloud/rio-uikit/TreeSummary';
143
+ import TreeOption from '@rio-cloud/rio-uikit/TreeOption';
144
+ import Button from '@rio-cloud/rio-uikit/Button';
145
+
146
+ const CATEGORY_FILTER = 'filter';
147
+ const CATEGORY_TRUCKS = 'trucks';
148
+ const CATEGORY_DRIVER = 'driver';
149
+ const CATEGORY_LOREM = 'lorem';
150
+
151
+ const randomDrivers = Array.from({ length: 200 }, (_, index) => ({
152
+ id: `74e8eb86-18a1-4abe-90cb-aeee7909f85${index}`,
153
+ name: {
154
+ firstName: faker.internet.userName(),
155
+ lastName: faker.name.firstName(),
156
+ },
157
+ type: 'driver',
158
+ }));
159
+
160
+ const getTruckGroups = (): TreeGroup[] => {
161
+ const groups = Array.from({ length: random(400, 600) }, (_, index) => ({
162
+ id: `group-${index}`,
163
+ name: `Group - ${faker.name.findName()} - ${random(1000, 9999)}`,
164
+ }));
165
+ return [
166
+ ...groups,
167
+ {
168
+ id: 'truck-6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5',
169
+ name: 'Truck Group North',
170
+ },
171
+ {
172
+ id: 'truck-b40aabcf-01f8-4be2-bc3d-9157cbdb395f',
173
+ name: 'Truck Group East',
174
+ },
175
+ {
176
+ id: 'truck-722a5f86-eb6c-46cf-83da-3f8dbfbcca5e',
177
+ name: 'Truck Group South',
178
+ },
179
+ {
180
+ id: 'truck-0250a8aa-721e-40b4-b1ea-7908acddfdf4',
181
+ name: 'Truck Group West',
182
+ className: 'foobar',
183
+ },
184
+ {
185
+ id: 'unassigned',
186
+ name: 'Ungrouped',
187
+ position: 'last',
188
+ },
189
+ ];
190
+ };
191
+
192
+ const trailerGroups: TreeGroup[] = [
193
+ {
194
+ id: '6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5',
195
+ name: 'Trailer Group',
196
+ },
197
+ ];
198
+
199
+ const trailer: TreeItem[] = [
200
+ {
201
+ id: '110191ac-d06d-4567-b13a-7b7fd85d9731',
202
+ name: 'Trailer 03',
203
+ type: 'trailer',
204
+ groupIds: ['unassigned'],
205
+ },
206
+ {
207
+ id: '110191ac-d06d-4567-b13a-7b7fd85d9740',
208
+ name: 'Trailer 04',
209
+ type: 'trailer',
210
+ groupIds: ['unassigned'],
211
+ },
212
+ {
213
+ id: '16807251-95d2-4d73-afd0-4fbd0eadebf4',
214
+ name: 'Trailer 01',
215
+ type: 'trailer',
216
+ groupIds: ['6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5'],
217
+ },
218
+ {
219
+ id: '16807251-95d2-4d73-afd0-4fbd0eadebf6',
220
+ name: 'Trailer 02',
221
+ type: 'trailer',
222
+ groupIds: ['6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5'],
223
+ },
224
+ ];
225
+
226
+ const getTrucks = (namePrefix = 'Vehicle-'): TreeItem[] => {
227
+ const groups = getTruckGroups();
228
+ const randomTrucks = Array.from({ length: random(5000, 6000) }, (_, index) => ({
229
+ id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
230
+ name: `${namePrefix}${random(1000, 9999)}`,
231
+ info: `M-AN 1${String(index).padStart(3, '0')}`,
232
+ type: 'truck',
233
+ groupIds: [faker.random.arrayElement(groups).id],
234
+ }));
235
+ return [...randomTrucks, ...trailer];
236
+ };
237
+
238
+ const truckGroupsWithEmptyGroup: TreeGroup[] = [
239
+ ...getTruckGroups(),
240
+ {
241
+ id: '0350a8aa-721e-40b4-b1ea-7908acddfdf4',
242
+ name: 'My Empty Group',
243
+ disabled: true,
244
+ },
245
+ {
246
+ id: 'truck-0250a8aa-721e-40b4-b1ea-7908acddfdf1',
247
+ name: 'Truck Group West 2',
248
+ },
249
+ {
250
+ id: 'truck-0250a8aa-721e-40b4-b1ea-7908acddfdf2',
251
+ name: 'Truck Group West 3',
252
+ },
253
+ ...trailerGroups,
254
+ ];
255
+
256
+ const defaultExpandedTruckGroups: string[] = ['6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5'];
257
+
258
+ const AssetTreeExample = () => {
259
+ const [trucks, setTrucks] = useState<TreeItem[]>(getTrucks());
260
+ const [truckGroups, setTruckGroups] = useState<TreeGroup[]>(truckGroupsWithEmptyGroup);
261
+ const [selectedTruckGroupIds, setSelectedTruckGroupIds] = useState<string[]>([]);
262
+ const [selectedTruckIds, setSelectedTruckIds] = useState<string[]>([]);
263
+ const [selectedDrivers, setSelectedDrivers] = useState<string[]>([]);
264
+ const [expandedTruckGroups, setExpandedTruckGroups] = useState(defaultExpandedTruckGroups);
265
+ const [currentCategoryId, setCurrentCategoryId] = useState(CATEGORY_TRUCKS);
266
+ const [isTreeOpen, setIsTreeOpen] = useState(true);
267
+ const [searchValue, setSearchValue] = useState('');
268
+ const [showEmptyGroups, setShowEmptyGroups] = useState(false);
269
+ const [showAssetGroups, setShowAssetGroups] = useState(true);
270
+ const [currentTypeFilter, setCurrentTypeFilter] = useState<string[]>([]);
271
+
272
+ const handleSelectTruck = ({ items, groups }: SelectionChangeResponse) => {
273
+ setSelectedTruckIds(items);
274
+ setSelectedTruckGroupIds(groups);
275
+ };
276
+
277
+ const handleExpandTruckGroups = (newExpandedTruckGroups: string[]) =>
278
+ setExpandedTruckGroups(newExpandedTruckGroups);
279
+
280
+ const handleSelectDriver = ({ items }: SelectionChangeResponse) => setSelectedDrivers(items);
281
+ const handleChangeCategories = (categoryId: string) => setCurrentCategoryId(categoryId);
282
+ const handleUpdateSearch = (value: string) => setSearchValue(value);
283
+ const handleToggleTree = (toggle: boolean) => setIsTreeOpen(toggle);
284
+ const handleToggleEmptyGroups = () => setShowEmptyGroups(!showEmptyGroups);
285
+ const handleToggleAssetGroups = () => setShowAssetGroups(!showAssetGroups);
286
+
287
+ const renderSelectedItemsOfList = (selectedItemIds: string[], list: TreeGroup[] | TreeItem[]) => {
288
+ return selectedItemIds.map(selectedItemId => {
289
+ const result = list.find(listItem => listItem.id === selectedItemId);
290
+ if (result) {
291
+ const name = isObject(result.name)
292
+ ? `${(result.name as TreeItemName).firstName} ${(result.name as TreeItemName).lastName}`
293
+ : result.name;
294
+ return <li key={selectedItemId}>{name}</li>;
295
+ }
296
+ return null;
297
+ });
298
+ };
299
+
300
+ // Custom filter function for driver as for this we showcase the usage of a custom search component
301
+ const filteredDrivers = randomDrivers.filter(driver =>
302
+ `${get(driver, 'name.firstName', '')} ${get(driver, 'name.lastName', '')}`.includes(searchValue)
303
+ );
304
+
305
+ return (
306
+ <div className='display-flex flex-wrap gap-25'>
307
+ <div>
308
+ <AssetTree
309
+ bordered
310
+ minWidth={300}
311
+ maxWidth={450}
312
+ currentCategoryId={currentCategoryId}
313
+ onCategoryChange={handleChangeCategories}
314
+ height={500}
315
+ isOpen={isTreeOpen}
316
+ onToggleTree={handleToggleTree}
317
+ useOffscreen
318
+ >
319
+ <TreeCategory key={CATEGORY_FILTER} id={CATEGORY_FILTER} label='Filter' icon='rioglyph-filter'>
320
+ <div className='margin-15'>Filter</div>
321
+ </TreeCategory>
322
+
323
+ <TreeCategory
324
+ key={CATEGORY_TRUCKS}
325
+ id={CATEGORY_TRUCKS}
326
+ label='Assets'
327
+ icon='rioglyph-truck'
328
+ hasSelection={!isEmpty(selectedTruckIds) || !isEmpty(selectedTruckGroupIds)}
329
+ >
330
+ <Tree
331
+ groups={showAssetGroups ? truckGroups : []}
332
+ items={trucks}
333
+ expandedGroups={expandedTruckGroups}
334
+ onExpandGroupsChange={handleExpandTruckGroups}
335
+ selectedGroups={selectedTruckGroupIds}
336
+ selectedItems={selectedTruckIds}
337
+ onSelectionChange={handleSelectTruck}
338
+ searchPlaceholder='Find asset'
339
+ onSearchChange={handleUpdateSearch}
340
+ showEmptyGroups={showEmptyGroups}
341
+ onTypeFilterChange={setCurrentTypeFilter}
342
+ treeOptionsTooltip='Vehicle tree options'
343
+ treeOptions={[
344
+ <TreeOption
345
+ key='emptyGroupsToggle'
346
+ label='Show empty groups'
347
+ isChecked={showEmptyGroups}
348
+ onChange={handleToggleEmptyGroups}
349
+ />,
350
+ <TreeOption
351
+ key='assetGroupsToggle'
352
+ label='Show groups'
353
+ isChecked={showAssetGroups}
354
+ onChange={handleToggleAssetGroups}
355
+ />,
356
+ ]}
357
+ />
358
+ </TreeCategory>
359
+
360
+ <TreeCategory
361
+ key={CATEGORY_DRIVER}
362
+ id={CATEGORY_DRIVER}
363
+ label='My Drivers'
364
+ icon='rioglyph-driver'
365
+ hasSelection={!isEmpty(selectedDrivers)}
366
+ >
367
+ <Tree
368
+ items={filteredDrivers}
369
+ selectedItems={selectedDrivers}
370
+ onSelectionChange={handleSelectDriver}
371
+ hasMultiselect={!isEmpty(filteredDrivers)}
372
+ summary={<TreeSummary assetCounts={{ driver: filteredDrivers.length }} />}
373
+ search={
374
+ <TreeSearch
375
+ value={searchValue}
376
+ placeholder='this is a custom search'
377
+ onChange={handleUpdateSearch}
378
+ />
379
+ }
380
+ />
381
+ </TreeCategory>
382
+
383
+ <TreeCategory key='lorem-ipsum' id={CATEGORY_LOREM} label='Lorem ipsum' icon='rioglyph-layer-pois'>
384
+ <div className='custom-pois-wrapper height-100pct'>
385
+ <Tree
386
+ items={filteredDrivers}
387
+ selectedItems={selectedDrivers}
388
+ onSelectionChange={handleSelectDriver}
389
+ hasMultiselect={!isEmpty(filteredDrivers)}
390
+ treeHeaderContent={
391
+ <ul className='rounded-none nav nav-pills nav-pills-filled nav-justified text-size-18'>
392
+ <li className='active'>
393
+ <span className='rioglyph rioglyph-pushpin' />
394
+ </li>
395
+ <li>
396
+ <span className='rioglyph rioglyph-geofence' />
397
+ </li>
398
+ <li>
399
+ <span className='rioglyph rioglyph-workshop' />
400
+ </li>
401
+ <li>
402
+ <span className='rioglyph rioglyph-filling-e-station' />
403
+ </li>
404
+ </ul>
405
+ }
406
+ summary={<TreeSummary assetCounts={{ driver: filteredDrivers.length }} />}
407
+ search={
408
+ <TreeSearch
409
+ value={searchValue}
410
+ placeholder='this is a custom search'
411
+ onChange={handleUpdateSearch}
412
+ />
413
+ }
414
+ />
415
+ </div>
416
+ </TreeCategory>
417
+ </AssetTree>
418
+ <div className='btn-toolbar margin-top-25'>
419
+ <Button
420
+ onClick={() => {
421
+ setTrucks(getTrucks('RIO'));
422
+ setTruckGroups(getTruckGroups());
423
+ }}
424
+ >
425
+ Load trucks
426
+ </Button>
427
+ <Button
428
+ onClick={() => {
429
+ setTrucks([]);
430
+ setTruckGroups([]);
431
+ }}
432
+ >
433
+ Clear tree
434
+ </Button>
435
+ <Button
436
+ onClick={() => {
437
+ const isListEmpty = isEmpty(selectedTruckGroupIds);
438
+ setSelectedTruckGroupIds(isListEmpty ? truckGroups.map(group => group.id) : []);
439
+ }}
440
+ >
441
+ Toggle all groups selection
442
+ </Button>
443
+ </div>
444
+ </div>
445
+ <div>
446
+ <div className='h6'>Current category:</div>
447
+ <ul>{currentCategoryId}</ul>
448
+ <div className='h6'>Selected groups:</div>
449
+ <ul>{renderSelectedItemsOfList(selectedTruckGroupIds, truckGroups)}</ul>
450
+ <div className='h6'>Selected assets:</div>
451
+ <ul>{renderSelectedItemsOfList(selectedTruckIds, trucks)}</ul>
452
+ <div className='h6'>Expanded groups:</div>
453
+ <ul>{renderSelectedItemsOfList(expandedTruckGroups, truckGroups)}</ul>
454
+ <hr />
455
+ <div className='h6'>Selected drivers:</div>
456
+ <ul>{renderSelectedItemsOfList(selectedDrivers, randomDrivers)}</ul>
457
+ <hr />
458
+ <div className='h6'>Search value:</div>
459
+ <ul>{searchValue}</ul>
460
+ <hr />
461
+ <div className='h6'>Asset type filter:</div>
462
+ <ul>{`[${currentTypeFilter.join(', ')}]`}</ul>
463
+ </div>
464
+ </div>
465
+ );
466
+ };
467
+
468
+ export default AssetTreeExample;
469
+ ```
470
+
471
+ #### Props: AssetTree
472
+
473
+ ### AssetTree
474
+
475
+ | Name | Type | Default | Description |
476
+ | --- | --- | --- | --- |
477
+ | fly | boolean | false | Defines if the component will overlap the body content. |
478
+ | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
479
+ | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
480
+ | bordered | boolean | false | Defines whether the component has a border or not. |
481
+ | width | string / number | 350 | Defines the width of the component. The value is set as inline style. Note: when component is resizable it will take the provided width in px only and convert it to number in case. |
482
+ | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
483
+ | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
484
+ | height | number | — | Defines the height of the component in px. |
485
+ | isOpen | boolean | true | Defines whether the component is open or not. |
486
+ | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
487
+ | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
488
+ | onCategoryChange | Function | () => {} | Callback for handling change of category. |
489
+ | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
490
+ | className | String | — | Additional classes added on the wrapper element. |
491
+ | children | TreeCategory | — | A list of TreeCategory components |
492
+
493
+ #### Props: TreeCategory
494
+
495
+ ### TreeCategory
496
+
497
+ | Name | Type | Default | Description |
498
+ | --- | --- | --- | --- |
499
+ | id | String | — | A unique identifier for that category. |
500
+ | icon | String | — | The rioglyph icon name for that category. |
501
+ | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
502
+ | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
503
+
504
+ #### Props: Tree
505
+
506
+ ### Tree
507
+
508
+ | Name | Type | Default | Description |
509
+ | --- | --- | --- | --- |
510
+ | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
511
+ | └id | String | — | A unique identifier of a group. |
512
+ | └name | String | — | The name of a group. |
513
+ | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
514
+ | └disabled | Boolean | — | Disallows the selection of the group itself. |
515
+ | └className | String | — | Additional classes added to the group element. |
516
+ | items | Array of Objects | [] | The list of items. |
517
+ | └id | String | — | A unique identifier of an item. |
518
+ | └name | string / object | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory |
519
+ | └info | String \| Node | — | The subline of an item. |
520
+ | └type | string | — | The primary type of the item. This is also used as the fallback icon name and refers to the name of the respective rioglyph icon (excluding the `rioglyph-` prefix). |
521
+ | └subType | string | — | The sub type of an item which is also the name of the respective rioglyph icon without the prefix. This could be used to show a secondary paired icon like for fuel type. |
522
+ | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
523
+ | └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g. `'truck'`), this icon will be used explicitly. If set to `undefined`, the `type` property will be used as the fallback icon. If set to `null`, no icon will be rendered, even if `type` is defined. This allows full control over the icon behavior while maintaining backward compatibility with type-based icons. |
524
+ | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
525
+ | └className | string | — | Additional classes added to the item element. |
526
+ | selectedGroups | Array of strings | — | List of selected group ids. |
527
+ | selectedItems | Array of strings | — | List of selected item ids. |
528
+ | onSelectionChange | Function | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
529
+ | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
530
+ | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
531
+ | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
532
+ | searchPlaceholder | string | — | The text used as placeholder for the search input. |
533
+ | onSearchChange | Function | — | Callback for when the search value changes. |
534
+ | search | node | — | Used to define custom custom search component which replaces the built-in search. |
535
+ | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
536
+ | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
537
+ | hideSummary | boolean | false | Defines whether a summary is shown. |
538
+ | hideTreeHead | boolean | false | Defines whether the entire area below the search field is shown or not. Note: Disabling the tree head will hide the select all checkbox and the tree options as well as the tree summary. |
539
+ | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
540
+ | scrollHeight | Number | — | Defines the max-height of the scrollable list |
541
+ | expandedGroups | Array of String | — | List of group ids which are expanded. |
542
+ | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
543
+ | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
544
+ | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
545
+ | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
546
+ | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
547
+ | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
548
+ | className | String | — | Additional classes added to the wrapping element. |
549
+
550
+ #### Props: TreeSearch
551
+
552
+ ### TreeSearch
553
+
554
+ | Name | Type | Default | Description |
555
+ | --- | --- | --- | --- |
556
+ | value | String | — | The search value to be shown and used for the search. |
557
+ | onChange | Function | () => {} | Callback for when the search value changes. |
558
+ | placeholder | String | — | The placeholder text used for the input field. |
559
+ | className | String | — | Additional classes added to the wrapping element. |
560
+
561
+ #### Props: TreeSummary
562
+
563
+ ### TreeSummary
564
+
565
+ | Name | Type | Default | Description |
566
+ | --- | --- | --- | --- |
567
+ | assetCounts | object | — | The object containing various asset type counter. |
568
+ | └truck | number | — | The amount of trucks. |
569
+ | └trailer | number | — | The amount of trailers. |
570
+ | └bus | number | — | The amount of buses. |
571
+ | └van | number | — | The amount of vans. |
572
+ | └driver | number | — | The amount of drivers. |
573
+ | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
574
+ | className | string | — | Additional classes added to the wrapping element. |
575
+
576
+ #### Props: TreeSummaryRow
577
+
578
+ ### TreeSummaryRow
579
+
580
+ | Name | Type | Default | Description |
581
+ | --- | --- | --- | --- |
582
+ | gridCols | number | 4 | Defined the number of grid columns for a single row. Note, when the amount of children exceed the columns it will wrap around to a new line. |
583
+
584
+ #### Props: TypeCounter
585
+
586
+ ### TypeCounter
587
+
588
+ | Name | Type | Default | Description |
589
+ | --- | --- | --- | --- |
590
+ | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
591
+ | icon | string | — | The icon name. Note, when using the built-in generic type counter, the icon name will the same as the item type. So make sure there is a corresponding icon for the defined type. |
592
+ | isActive | Boolean | — | Sets the active styling if active. |
593
+ | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
594
+ | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
595
+ | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
596
+ | onClick | Function | — | Callback function when the counter is clicked. It returns the type value.Make sure the "type" prop is defined to receive the value in the callback and the flag "enableActivity" is set to true otherwise the callback is not triggered. |
597
+ | value | String / Number / Node | — | A custom value to be shown in the counter. |
598
+
599
+ #### Props: TreeOption
600
+
601
+ ### TreeOption
602
+
603
+ | Name | Type | Default | Description |
604
+ | --- | --- | --- | --- |
605
+ | isChecked | boolean | — | Defines whether the option is set. |
606
+ | label | string / node | — | The label for the option. |
607
+ | onChange | Function | — | Callback triggered when option is selected. |
608
+ | className | string | — | Additional classes added to the wrapping element. |
609
+
610
+ ## AssetTree with single select
611
+
612
+ ### Example: Example 2
613
+
614
+ 10
615
+ 9
616
+ 8
617
+ 3
618
+
619
+ My Empty Group5
620
+
621
+ Truck Group East8
622
+
623
+ Truck Group North4
624
+ N18-G546 / M-AN 1006
625
+ N18-G661 / M-AN 1028
626
+ N18-G787 / M-AN 1004
627
+ N18-G911 / M-AN 1029
628
+
629
+ Truck Group South6
630
+
631
+ Truck Group West4
632
+
633
+ All my unassigned Trucks3
634
+
635
+ Current category:
636
+ assets
637
+ Selected tree groups:
638
+
639
+ Selected assets:
640
+
641
+ Expanded tree groups:
642
+ Truck Group North
643
+
644
+ #### Summary
645
+
646
+ 10
647
+ 9
648
+ 8
649
+ 3
650
+
651
+ My Empty Group5
652
+
653
+ Truck Group East8
654
+
655
+ Truck Group North4
656
+ N18-G546 / M-AN 1006
657
+ N18-G661 / M-AN 1028
658
+ N18-G787 / M-AN 1004
659
+ N18-G911 / M-AN 1029
660
+
661
+ Truck Group South6
662
+
663
+ Truck Group West4
664
+
665
+ All my unassigned Trucks3
666
+
667
+ Current category:
668
+ assets
669
+ Selected tree groups:
670
+
671
+ Selected assets:
672
+
673
+ Expanded tree groups:
674
+ Truck Group North
675
+
676
+ #### React (tsx)
677
+
678
+ ```tsx
679
+ import { useState } from 'react';
680
+ import { isEmpty, isObject, random } from 'es-toolkit/compat';
681
+ import faker from 'faker';
682
+
683
+ import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
684
+ import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
685
+ import Tree, {
686
+ type TreeGroup,
687
+ type TreeItem,
688
+ type TreeItemName,
689
+ type SelectionChangeResponse,
690
+ } from '@rio-cloud/rio-uikit/Tree';
691
+
692
+ const CATEGORY_ASSETS = 'assets';
693
+
694
+ const assetGroups: TreeGroup[] = [
695
+ {
696
+ id: '6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5',
697
+ name: 'Truck Group North',
698
+ },
699
+ {
700
+ id: 'b40aabcf-01f8-4be2-bc3d-9157cbdb395f',
701
+ name: 'Truck Group East',
702
+ },
703
+ {
704
+ id: '722a5f86-eb6c-46cf-83da-3f8dbfbcca5e',
705
+ name: 'Truck Group South',
706
+ },
707
+ {
708
+ id: '0250a8aa-721e-40b4-b1ea-7908acddfdf4',
709
+ name: 'Truck Group West',
710
+ },
711
+ {
712
+ id: '0350a8aa-721e-40b4-b1ea-7908acddfdf4',
713
+ name: 'My Empty Group',
714
+ },
715
+ {
716
+ id: 'static/unassignedTrucks',
717
+ name: 'All my unassigned Trucks',
718
+ position: 'last',
719
+ },
720
+ ];
721
+
722
+ const defaultExpandedAssetGroups = ['6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5'];
723
+ const assetTypes = ['truck', 'bus', 'van', 'trailer'];
724
+
725
+ const assets = Array.from({ length: 30 }, (_, index) => ({
726
+ id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
727
+ name: `N18-G${random(100, 999)} / M-AN 1${String(index).padStart(3, '0')}`,
728
+ type: faker.random.arrayElement(assetTypes),
729
+ groupIds: [faker.random.arrayElement(assetGroups).id],
730
+ }));
731
+
732
+ const AssetTreeSingleSelectExample = () => {
733
+ const [selectedAssetGroupIds, setSelectedAssetGroupIds] = useState<string[]>([]);
734
+ const [selectedAssetIds, setSelectedAssetIds] = useState<string[]>([]);
735
+ const [expandedAssetGroups, setExpandedAssetGroups] = useState<string[]>(defaultExpandedAssetGroups);
736
+ const [currentCategoryId, setCurrentCategoryId] = useState<string>(CATEGORY_ASSETS);
737
+ const [isTreeOpen, setIsTreeOpen] = useState(true);
738
+
739
+ const handleSelectAsset = ({ items, groups }: SelectionChangeResponse) => {
740
+ setSelectedAssetIds(items);
741
+ setSelectedAssetGroupIds(groups);
742
+ };
743
+
744
+ const handleExpandAssetGroups = (expandedGroups: string[]) => setExpandedAssetGroups(expandedGroups);
745
+ const handleChangeCategories = (newCategoryId: string) => setCurrentCategoryId(newCategoryId);
746
+ const handleToggleTree = (toggle: boolean) => setIsTreeOpen(toggle);
747
+
748
+ const renderSelectedItemsOfList = (selectedItemIds: string[], list: TreeGroup[] | TreeItem[]) => {
749
+ return selectedItemIds.map(selectedItemId => {
750
+ const result = list.find(listItem => listItem.id === selectedItemId);
751
+ if (result) {
752
+ const name = isObject(result.name)
753
+ ? `${(result.name as TreeItemName).firstName} ${(result.name as TreeItemName).lastName}`
754
+ : result.name;
755
+ return <li key={selectedItemId}>{name}</li>;
756
+ }
757
+ return null;
758
+ });
759
+ };
760
+
761
+ return (
762
+ <div className='display-flex flex-wrap gap-25 overflow-auto'>
763
+ <div>
764
+ <AssetTree
765
+ resizable
766
+ bordered
767
+ minWidth={300}
768
+ maxWidth={450}
769
+ currentCategoryId={currentCategoryId}
770
+ onCategoryChange={handleChangeCategories}
771
+ height={500}
772
+ isOpen={isTreeOpen}
773
+ onToggleTree={handleToggleTree}
774
+ >
775
+ <TreeCategory
776
+ key={CATEGORY_ASSETS}
777
+ id={CATEGORY_ASSETS}
778
+ label='Assets'
779
+ icon='rioglyph-truck'
780
+ hasSelection={!isEmpty(selectedAssetIds) || !isEmpty(selectedAssetGroupIds)}
781
+ >
782
+ <Tree
783
+ groups={assetGroups}
784
+ items={assets}
785
+ expandedGroups={expandedAssetGroups}
786
+ onExpandGroupsChange={handleExpandAssetGroups}
787
+ selectedGroups={selectedAssetGroupIds}
788
+ selectedItems={selectedAssetIds}
789
+ onSelectionChange={handleSelectAsset}
790
+ searchPlaceholder='Find asset by name'
791
+ hasMultiselect={false}
792
+ />
793
+ </TreeCategory>
794
+ </AssetTree>
795
+ </div>
796
+ <div>
797
+ <div className='h6'>Current category:</div>
798
+ <ul>{currentCategoryId}</ul>
799
+ <div className='h6'>Selected tree groups:</div>
800
+ <ul>{renderSelectedItemsOfList(selectedAssetGroupIds, assetGroups)}</ul>
801
+ <div className='h6'>Selected assets:</div>
802
+ <ul>{renderSelectedItemsOfList(selectedAssetIds, assets)}</ul>
803
+ <div className='h6'>Expanded tree groups:</div>
804
+ <ul>{renderSelectedItemsOfList(expandedAssetGroups, assetGroups)}</ul>
805
+ </div>
806
+ </div>
807
+ );
808
+ };
809
+
810
+ export default AssetTreeSingleSelectExample;
811
+ ```
812
+
813
+ #### HTML (html)
814
+
815
+ ```html
816
+ <div class="display-flex flex-wrap gap-25 overflow-auto">
817
+ <div>
818
+ <div class="AssetTree border fluid" style="width: 350px; height: 500px;">
819
+ <div class="AssetTreeResizeLimit" style="left: 450px;">
820
+ </div>
821
+ <div class="AssetTreeContent">
822
+ <div class="TreeSidebar">
823
+ <ul class="TreeSidebarNavigation">
824
+ <li class="active">
825
+ <div class="selection-bubble">
826
+ <span class="rioglyph rioglyph-truck">
827
+ </span>
828
+ </div>
829
+ </li>
830
+ </ul>
831
+ <div class="TreeSidebarToggle">
832
+ <span class="rioglyph rioglyph-chevron-left">
833
+ </span>
834
+ </div>
835
+ </div>
836
+ <div class="AssetTreeBody scrollbar-fly-in smooth-scrollbar-wrapper" style="position: relative; overflow: hidden; width: 100%; height: 100%;">
837
+ <div class="scrollbar-view" style="position: absolute; inset: 0px; overflow: scroll; margin-right: 0px; margin-bottom: 0px;">
838
+ <div class="scrollbar-content-wrapper">
839
+ <div class="Tree">
840
+ <div class="TreeHeader">
841
+ <div class="TreeSearch">
842
+ <div class="input-group flex-1-0">
843
+ <span class="input-group-addon">
844
+ <span class="rioglyph rioglyph-search" aria-hidden="true">
845
+ </span>
846
+ </span>
847
+ <div class="ClearableInput input-group">
848
+ <input placeholder="Find asset by name" class="form-control" type="text" tabindex="0" value="">
849
+ <span class="clearButton hide">
850
+ <span class="clearButtonIcon rioglyph rioglyph-remove-sign">
851
+ </span>
852
+ </span>
853
+ </div>
854
+ </div>
855
+ </div>
856
+ <div class="TreeHead display-flex gap-5 padding-15">
857
+ <div class="border border-right-only hidden-empty padding-right-10 margin-right-2">
858
+ </div>
859
+ <div class="display-flex justify-content-between align-items-start width-100pct">
860
+ <div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
861
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
862
+ <span class="rioglyph rioglyph-van text-size-16 margin-right-2">
863
+ </span>
864
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">10</span>
865
+ </div>
866
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
867
+ <span class="rioglyph rioglyph-bus text-size-16 margin-right-2">
868
+ </span>
869
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">9</span>
870
+ </div>
871
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
872
+ <span class="rioglyph rioglyph-truck text-size-16 margin-right-2">
873
+ </span>
874
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">8</span>
875
+ </div>
876
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
877
+ <span class="rioglyph rioglyph-trailer text-size-16 margin-right-2">
878
+ </span>
879
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">3</span>
880
+ </div>
881
+ </div>
882
+ </div>
883
+ </div>
884
+ </div>
885
+ <div class="TreeRoot user-select-none overflow-hidden" style="position: relative;">
886
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="0350a8aa-721e-40b4-b1ea-7908acddfdf4">
887
+ <div class="TreeNode from-group" data-key="0350a8aa-721e-40b4-b1ea-7908acddfdf4">
888
+ <span class="TreeLabel TreeLabelName">
889
+ <span class="TreeLabelNameText">
890
+ <span class="TreeLabelNameTextHeadline">My Empty Group</span>
891
+ </span>
892
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
893
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
894
+ </span>
895
+ </span>
896
+ </div>
897
+ </div>
898
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="b40aabcf-01f8-4be2-bc3d-9157cbdb395f">
899
+ <div class="TreeNode from-group" data-key="b40aabcf-01f8-4be2-bc3d-9157cbdb395f">
900
+ <span class="TreeLabel TreeLabelName">
901
+ <span class="TreeLabelNameText">
902
+ <span class="TreeLabelNameTextHeadline">Truck Group East</span>
903
+ </span>
904
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">8</span>
905
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
906
+ </span>
907
+ </span>
908
+ </div>
909
+ </div>
910
+ <div class="TreeNodeContainer user-select-none overflow-hidden open" data-id="6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5">
911
+ <div class="TreeNode from-group" data-key="6ba7c2ec-8bd4-4470-98a4-313c9d33e8d5">
912
+ <span class="TreeLabel TreeLabelName">
913
+ <span class="TreeLabelNameText">
914
+ <span class="TreeLabelNameTextHeadline">Truck Group North</span>
915
+ </span>
916
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
917
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
918
+ </span>
919
+ </span>
920
+ </div>
921
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d976">
922
+ <span class="TreeLabel TreeLabelName">
923
+ <span class="rioglyph rioglyph-bus">
924
+ </span>
925
+ <span class="TreeLabelNameText">
926
+ <span class="TreeLabelNameTextHeadline">N18-G546 / M-AN 1006</span>
927
+ </span>
928
+ </span>
929
+ </div>
930
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9728">
931
+ <span class="TreeLabel TreeLabelName">
932
+ <span class="rioglyph rioglyph-van">
933
+ </span>
934
+ <span class="TreeLabelNameText">
935
+ <span class="TreeLabelNameTextHeadline">N18-G661 / M-AN 1028</span>
936
+ </span>
937
+ </span>
938
+ </div>
939
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d974">
940
+ <span class="TreeLabel TreeLabelName">
941
+ <span class="rioglyph rioglyph-truck">
942
+ </span>
943
+ <span class="TreeLabelNameText">
944
+ <span class="TreeLabelNameTextHeadline">N18-G787 / M-AN 1004</span>
945
+ </span>
946
+ </span>
947
+ </div>
948
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9729">
949
+ <span class="TreeLabel TreeLabelName">
950
+ <span class="rioglyph rioglyph-van">
951
+ </span>
952
+ <span class="TreeLabelNameText">
953
+ <span class="TreeLabelNameTextHeadline">N18-G911 / M-AN 1029</span>
954
+ </span>
955
+ </span>
956
+ </div>
957
+ </div>
958
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="722a5f86-eb6c-46cf-83da-3f8dbfbcca5e">
959
+ <div class="TreeNode from-group" data-key="722a5f86-eb6c-46cf-83da-3f8dbfbcca5e">
960
+ <span class="TreeLabel TreeLabelName">
961
+ <span class="TreeLabelNameText">
962
+ <span class="TreeLabelNameTextHeadline">Truck Group South</span>
963
+ </span>
964
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">6</span>
965
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
966
+ </span>
967
+ </span>
968
+ </div>
969
+ </div>
970
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="0250a8aa-721e-40b4-b1ea-7908acddfdf4">
971
+ <div class="TreeNode from-group" data-key="0250a8aa-721e-40b4-b1ea-7908acddfdf4">
972
+ <span class="TreeLabel TreeLabelName">
973
+ <span class="TreeLabelNameText">
974
+ <span class="TreeLabelNameTextHeadline">Truck Group West</span>
975
+ </span>
976
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
977
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
978
+ </span>
979
+ </span>
980
+ </div>
981
+ </div>
982
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="static/unassignedTrucks">
983
+ <div class="TreeNode from-group" data-key="static/unassignedTrucks">
984
+ <span class="TreeLabel TreeLabelName">
985
+ <span class="TreeLabelNameText">
986
+ <span class="TreeLabelNameTextHeadline">All my unassigned Trucks</span>
987
+ </span>
988
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">3</span>
989
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
990
+ </span>
991
+ </span>
992
+ </div>
993
+ </div>
994
+ </div>
995
+ </div>
996
+ </div>
997
+ </div>
998
+ <div class="scrollbar-track-horizontal" style="position: absolute; height: 6px; display: none;">
999
+ <div class="scrollbar-thumb-horizontal" style="position: relative; display: block; height: 100%;">
1000
+ </div>
1001
+ </div>
1002
+ <div class="scrollbar-track-vertical" style="position: absolute; width: 6px; display: none;">
1003
+ <div class="scrollbar-thumb-vertical" style="position: relative; display: block; width: 100%;">
1004
+ </div>
1005
+ </div>
1006
+ </div>
1007
+ </div>
1008
+ <div class="Resizer resize-horizontal resize-right">
1009
+ </div>
1010
+ </div>
1011
+ </div>
1012
+ <div>
1013
+ <div class="h6">Current category:</div>
1014
+ <ul>assets</ul>
1015
+ <div class="h6">Selected tree groups:</div>
1016
+ <ul>
1017
+ </ul>
1018
+ <div class="h6">Selected assets:</div>
1019
+ <ul>
1020
+ </ul>
1021
+ <div class="h6">Expanded tree groups:</div>
1022
+ <ul>
1023
+ <li>Truck Group North</li>
1024
+ </ul>
1025
+ </div>
1026
+ </div>
1027
+ ```
1028
+
1029
+ #### Props: AssetTree
1030
+
1031
+ ### AssetTree
1032
+
1033
+ | Name | Type | Default | Description |
1034
+ | --- | --- | --- | --- |
1035
+ | fly | boolean | false | Defines if the component will overlap the body content. |
1036
+ | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
1037
+ | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
1038
+ | bordered | boolean | false | Defines whether the component has a border or not. |
1039
+ | width | string / number | 350 | Defines the width of the component. The value is set as inline style. Note: when component is resizable it will take the provided width in px only and convert it to number in case. |
1040
+ | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
1041
+ | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
1042
+ | height | number | — | Defines the height of the component in px. |
1043
+ | isOpen | boolean | true | Defines whether the component is open or not. |
1044
+ | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
1045
+ | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
1046
+ | onCategoryChange | Function | () => {} | Callback for handling change of category. |
1047
+ | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
1048
+ | className | String | — | Additional classes added on the wrapper element. |
1049
+ | children | TreeCategory | — | A list of TreeCategory components |
1050
+
1051
+ #### Props: TreeCategory
1052
+
1053
+ ### TreeCategory
1054
+
1055
+ | Name | Type | Default | Description |
1056
+ | --- | --- | --- | --- |
1057
+ | id | String | — | A unique identifier for that category. |
1058
+ | icon | String | — | The rioglyph icon name for that category. |
1059
+ | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
1060
+ | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
1061
+
1062
+ #### Props: Tree
1063
+
1064
+ ### Tree
1065
+
1066
+ | Name | Type | Default | Description |
1067
+ | --- | --- | --- | --- |
1068
+ | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
1069
+ | └id | String | — | A unique identifier of a group. |
1070
+ | └name | String | — | The name of a group. |
1071
+ | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
1072
+ | └disabled | Boolean | — | Disallows the selection of the group itself. |
1073
+ | └className | String | — | Additional classes added to the group element. |
1074
+ | items | Array of Objects | [] | The list of items. |
1075
+ | └id | String | — | A unique identifier of an item. |
1076
+ | └name | string / object | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory |
1077
+ | └info | String \| Node | — | The subline of an item. |
1078
+ | └type | string | — | The primary type of the item. This is also used as the fallback icon name and refers to the name of the respective rioglyph icon (excluding the `rioglyph-` prefix). |
1079
+ | └subType | string | — | The sub type of an item which is also the name of the respective rioglyph icon without the prefix. This could be used to show a secondary paired icon like for fuel type. |
1080
+ | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
1081
+ | └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g. `'truck'`), this icon will be used explicitly. If set to `undefined`, the `type` property will be used as the fallback icon. If set to `null`, no icon will be rendered, even if `type` is defined. This allows full control over the icon behavior while maintaining backward compatibility with type-based icons. |
1082
+ | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
1083
+ | └className | string | — | Additional classes added to the item element. |
1084
+ | selectedGroups | Array of strings | — | List of selected group ids. |
1085
+ | selectedItems | Array of strings | — | List of selected item ids. |
1086
+ | onSelectionChange | Function | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
1087
+ | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
1088
+ | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
1089
+ | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
1090
+ | searchPlaceholder | string | — | The text used as placeholder for the search input. |
1091
+ | onSearchChange | Function | — | Callback for when the search value changes. |
1092
+ | search | node | — | Used to define custom custom search component which replaces the built-in search. |
1093
+ | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
1094
+ | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
1095
+ | hideSummary | boolean | false | Defines whether a summary is shown. |
1096
+ | hideTreeHead | boolean | false | Defines whether the entire area below the search field is shown or not. Note: Disabling the tree head will hide the select all checkbox and the tree options as well as the tree summary. |
1097
+ | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
1098
+ | scrollHeight | Number | — | Defines the max-height of the scrollable list |
1099
+ | expandedGroups | Array of String | — | List of group ids which are expanded. |
1100
+ | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
1101
+ | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
1102
+ | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
1103
+ | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
1104
+ | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
1105
+ | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
1106
+ | className | String | — | Additional classes added to the wrapping element. |
1107
+
1108
+ #### Props: TreeSearch
1109
+
1110
+ ### TreeSearch
1111
+
1112
+ | Name | Type | Default | Description |
1113
+ | --- | --- | --- | --- |
1114
+ | value | String | — | The search value to be shown and used for the search. |
1115
+ | onChange | Function | () => {} | Callback for when the search value changes. |
1116
+ | placeholder | String | — | The placeholder text used for the input field. |
1117
+ | className | String | — | Additional classes added to the wrapping element. |
1118
+
1119
+ #### Props: TreeSummary
1120
+
1121
+ ### TreeSummary
1122
+
1123
+ | Name | Type | Default | Description |
1124
+ | --- | --- | --- | --- |
1125
+ | assetCounts | object | — | The object containing various asset type counter. |
1126
+ | └truck | number | — | The amount of trucks. |
1127
+ | └trailer | number | — | The amount of trailers. |
1128
+ | └bus | number | — | The amount of buses. |
1129
+ | └van | number | — | The amount of vans. |
1130
+ | └driver | number | — | The amount of drivers. |
1131
+ | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
1132
+ | className | string | — | Additional classes added to the wrapping element. |
1133
+
1134
+ #### Props: TreeSummaryRow
1135
+
1136
+ ### TreeSummaryRow
1137
+
1138
+ | Name | Type | Default | Description |
1139
+ | --- | --- | --- | --- |
1140
+ | gridCols | number | 4 | Defined the number of grid columns for a single row. Note, when the amount of children exceed the columns it will wrap around to a new line. |
1141
+
1142
+ #### Props: TypeCounter
1143
+
1144
+ ### TypeCounter
1145
+
1146
+ | Name | Type | Default | Description |
1147
+ | --- | --- | --- | --- |
1148
+ | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
1149
+ | icon | string | — | The icon name. Note, when using the built-in generic type counter, the icon name will the same as the item type. So make sure there is a corresponding icon for the defined type. |
1150
+ | isActive | Boolean | — | Sets the active styling if active. |
1151
+ | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
1152
+ | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
1153
+ | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
1154
+ | onClick | Function | — | Callback function when the counter is clicked. It returns the type value.Make sure the "type" prop is defined to receive the value in the callback and the flag "enableActivity" is set to true otherwise the callback is not triggered. |
1155
+ | value | String / Number / Node | — | A custom value to be shown in the counter. |
1156
+
1157
+ #### Props: TreeOption
1158
+
1159
+ ### TreeOption
1160
+
1161
+ | Name | Type | Default | Description |
1162
+ | --- | --- | --- | --- |
1163
+ | isChecked | boolean | — | Defines whether the option is set. |
1164
+ | label | string / node | — | The label for the option. |
1165
+ | onChange | Function | — | Callback triggered when option is selected. |
1166
+ | className | string | — | Additional classes added to the wrapping element. |
1167
+
1168
+ ## AssetTree with multiple asset filter in summary
1169
+
1170
+ When using fuel filter, please check out the fuel type utils that ease the implementation of mapping vehicle fuel types to common fuel type groups.
1171
+
1172
+ ### Example: Example 3
1173
+
1174
+ 5
1175
+ 2
1176
+ 8
1177
+ 5
1178
+
1179
+ 15
1180
+ 2
1181
+ 1
1182
+ 1
1183
+ 1
1184
+
1185
+ Mixed Vehicles9
1186
+ Vehicle-1564Debug: hydrogen
1187
+ Vehicle-2359Debug: lpg
1188
+ Vehicle-2411Debug: heavy_fuel_oil
1189
+ Vehicle-3355Debug: gas
1190
+ Vehicle-6981Debug: electric
1191
+ Vehicle-7289Debug: gas
1192
+ Vehicle-8098Debug: heavy_fuel_oil
1193
+ Vehicle-8298Debug: heavy_fuel_oil
1194
+ Vehicle-9591Debug: lpg
1195
+
1196
+ Ungrouped11
1197
+
1198
+ Selected groups:
1199
+
1200
+ Selected vehicles:
1201
+
1202
+ Expanded groups:
1203
+ Mixed Vehicles
1204
+
1205
+ #### Summary
1206
+
1207
+ 5
1208
+ 2
1209
+ 8
1210
+ 5
1211
+
1212
+ 15
1213
+ 2
1214
+ 1
1215
+ 1
1216
+ 1
1217
+
1218
+ Mixed Vehicles9
1219
+ Vehicle-1564Debug: hydrogen
1220
+ Vehicle-2359Debug: lpg
1221
+ Vehicle-2411Debug: heavy_fuel_oil
1222
+ Vehicle-3355Debug: gas
1223
+ Vehicle-6981Debug: electric
1224
+ Vehicle-7289Debug: gas
1225
+ Vehicle-8098Debug: heavy_fuel_oil
1226
+ Vehicle-8298Debug: heavy_fuel_oil
1227
+ Vehicle-9591Debug: lpg
1228
+
1229
+ Ungrouped11
1230
+
1231
+ Selected groups:
1232
+
1233
+ Selected vehicles:
1234
+
1235
+ Expanded groups:
1236
+ Mixed Vehicles
1237
+
1238
+ #### React (tsx)
1239
+
1240
+ ```tsx
1241
+ import { useMemo, useState } from 'react';
1242
+ import { isEmpty, random } from 'es-toolkit/compat';
1243
+ import faker from 'faker';
1244
+
1245
+ import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
1246
+ import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
1247
+ import Tree, {
1248
+ type TreeGroup,
1249
+ type TreeItem,
1250
+ type SelectionChangeResponse,
1251
+ getTypeCounts,
1252
+ } from '@rio-cloud/rio-uikit/Tree';
1253
+ import TreeOption from '@rio-cloud/rio-uikit/TreeOption';
1254
+ import TreeSummary, { type TreeSummaryCounts } from '@rio-cloud/rio-uikit/TreeSummary';
1255
+ import TreeSummaryRow from '@rio-cloud/rio-uikit/TreeSummaryRow';
1256
+ import TypeCounter from '@rio-cloud/rio-uikit/TypeCounter';
1257
+ import {
1258
+ countFuelTypeGroups,
1259
+ filterByFuelTypeGroup,
1260
+ fuelTypeGroups,
1261
+ getFuelIcon,
1262
+ getFuelTypeGroupIcon,
1263
+ type FuelType,
1264
+ type FuelTypeGroup,
1265
+ } from '@rio-cloud/rio-uikit/fuelTypeUtils';
1266
+
1267
+ const toggleListItem = (list: string[], item: string) => {
1268
+ const set = new Set(list);
1269
+ if (set.has(item)) {
1270
+ set.delete(item);
1271
+ } else {
1272
+ set.add(item);
1273
+ }
1274
+ return [...set];
1275
+ };
1276
+
1277
+ const truckGroups: TreeGroup[] = [
1278
+ {
1279
+ id: 'group-1',
1280
+ name: 'Mixed Vehicles',
1281
+ },
1282
+ {
1283
+ id: 'unassigned-group',
1284
+ name: 'Ungrouped',
1285
+ position: 'last',
1286
+ },
1287
+ ];
1288
+
1289
+ const assetTypes = ['truck', 'bus', 'van', 'car'];
1290
+ const fuelTypes = ['diesel', 'electric', 'gas', 'hydrogen', 'cng', 'lpg', 'dual_fuel_diesel_cng', 'heavy_fuel_oil'];
1291
+
1292
+ const getVehicles = (withSubType = true): TreeItem[] =>
1293
+ Array.from({ length: 20 }, (_, index) => {
1294
+ const fuelType = withSubType ? faker.random.arrayElement(fuelTypes) : undefined;
1295
+ return {
1296
+ id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
1297
+ name: `Vehicle-${random(1000, 9999)}`,
1298
+ info: <span>Debug: {fuelType}</span>,
1299
+ type: faker.random.arrayElement(assetTypes),
1300
+ subType: fuelType, // subType cannot be used as icon here anymore
1301
+ pairIcon: getFuelIcon(fuelType),
1302
+ groupIds: [faker.random.arrayElement(truckGroups).id],
1303
+ };
1304
+ });
1305
+
1306
+ const defaultExpandedTruckGroups = ['group-1'];
1307
+
1308
+ const getAssetTypeCounts = getTypeCounts;
1309
+ const getFuelTypeCounts = (items: TreeItem[]) => countFuelTypeGroups(items, item => item.subType as FuelType);
1310
+
1311
+ const AssetTreeExample = () => {
1312
+ const [selectedTruckGroupIds, setSelectedTruckGroupIds] = useState<string[]>([]);
1313
+ const [selectedTruckIds, setSelectedTruckIds] = useState<string[]>([]);
1314
+ const [expandedTruckGroups, setExpandedTruckGroups] = useState(defaultExpandedTruckGroups);
1315
+
1316
+ const [isTreeOpen, setIsTreeOpen] = useState(true);
1317
+
1318
+ const [showEmptyGroups, setShowEmptyGroups] = useState(false);
1319
+ const [showAssetGroups, setShowAssetGroups] = useState(true);
1320
+ const [showFuelType, setShowFuelType] = useState(true);
1321
+
1322
+ const [activeAssetTypeFilter, setActiveAssetTypeFilter] = useState<string[]>([]);
1323
+ const [activeFuelTypeGroupFilter, setActiveFuelTypeGroupFilter] = useState<string[]>([]);
1324
+
1325
+ const [counters, setCounters] = useState<TreeSummaryCounts>({});
1326
+ const [fuelCounters, setFuelCounters] = useState<Record<string, number>>({});
1327
+
1328
+ const items = useMemo(() => {
1329
+ // Regenerate vehicles to omit the fuel type data used for the sub type
1330
+ const result = getVehicles(showFuelType);
1331
+
1332
+ // Count again all vehicle types and sub types
1333
+ setCounters(getAssetTypeCounts(result));
1334
+ setFuelCounters(getFuelTypeCounts(result));
1335
+
1336
+ return result;
1337
+ }, [showFuelType]);
1338
+
1339
+ const filteredItems = useMemo(() => {
1340
+ let result = items;
1341
+
1342
+ // filter by asset type
1343
+ if (!isEmpty(activeAssetTypeFilter)) {
1344
+ result = result.filter(item => activeAssetTypeFilter.includes(item.type));
1345
+ }
1346
+
1347
+ // filter by fuel type
1348
+ if (!isEmpty(activeFuelTypeGroupFilter)) {
1349
+ result = filterByFuelTypeGroup(
1350
+ result,
1351
+ activeFuelTypeGroupFilter as FuelTypeGroup[],
1352
+ item => item.subType as FuelType
1353
+ );
1354
+ }
1355
+
1356
+ return result;
1357
+ }, [items, activeAssetTypeFilter, activeFuelTypeGroupFilter]);
1358
+
1359
+ const handleSelectTruck = ({ items, groups }: SelectionChangeResponse) => {
1360
+ setSelectedTruckIds(items);
1361
+ setSelectedTruckGroupIds(groups);
1362
+ };
1363
+
1364
+ const handleExpandTruckGroups = (newExpandedTruckGroups: string[]) =>
1365
+ setExpandedTruckGroups(newExpandedTruckGroups);
1366
+
1367
+ const handleToggleTree = (toggle: boolean) => setIsTreeOpen(toggle);
1368
+ const handleToggleEmptyGroups = () => setShowEmptyGroups(!showEmptyGroups);
1369
+ const handleToggleAssetGroups = () => setShowAssetGroups(!showAssetGroups);
1370
+ const handleToggleFuelType = () => {
1371
+ setShowFuelType(!showFuelType);
1372
+ setActiveFuelTypeGroupFilter([]);
1373
+ };
1374
+
1375
+ const handleSearchChange = (searchValue: string) => {
1376
+ const filteredAssets = filteredItems.filter(item =>
1377
+ (item.name as string).toLowerCase().includes(searchValue.toLowerCase())
1378
+ );
1379
+ };
1380
+
1381
+ const handleAssetTypeFilterChange = (assetTypeFilter: string) => {
1382
+ setActiveAssetTypeFilter(toggleListItem(activeAssetTypeFilter, assetTypeFilter));
1383
+ };
1384
+
1385
+ const handleFuelTypeGroupFilterChange = (fuelTypeGroupFilter: string) => {
1386
+ setActiveFuelTypeGroupFilter(toggleListItem(activeFuelTypeGroupFilter, fuelTypeGroupFilter));
1387
+ };
1388
+
1389
+ const renderSelectedItemsOfList = (selectedItemIds: string[], list: TreeGroup[] | TreeItem[]) => {
1390
+ return selectedItemIds.map(selectedItemId => {
1391
+ const result = list.find(listItem => listItem.id === selectedItemId);
1392
+ if (result) {
1393
+ return <li key={selectedItemId}>{`${result.name}`}</li>;
1394
+ }
1395
+ return null;
1396
+ });
1397
+ };
1398
+
1399
+ return (
1400
+ <div className='display-flex flex-wrap gap-25 overflow-auto'>
1401
+ <AssetTree
1402
+ bordered
1403
+ minWidth={300}
1404
+ maxWidth={450}
1405
+ height={500}
1406
+ isOpen={isTreeOpen}
1407
+ onToggleTree={handleToggleTree}
1408
+ currentCategoryId='trucks'
1409
+ useOffscreen
1410
+ >
1411
+ <TreeCategory
1412
+ key='trucks'
1413
+ id='trucks'
1414
+ label='Assets'
1415
+ icon='rioglyph-truck'
1416
+ hasSelection={!isEmpty(selectedTruckIds) || !isEmpty(selectedTruckGroupIds)}
1417
+ >
1418
+ <Tree
1419
+ groups={showAssetGroups ? truckGroups : []}
1420
+ items={filteredItems}
1421
+ expandedGroups={expandedTruckGroups}
1422
+ onExpandGroupsChange={handleExpandTruckGroups}
1423
+ selectedGroups={selectedTruckGroupIds}
1424
+ selectedItems={selectedTruckIds}
1425
+ onSelectionChange={handleSelectTruck}
1426
+ searchPlaceholder='Find vehicle'
1427
+ showEmptyGroups={showEmptyGroups}
1428
+ onSearchChange={handleSearchChange}
1429
+ virtualizeThreshold={14}
1430
+ summary={
1431
+ <TreeSummary>
1432
+ <TreeSummaryRow>
1433
+ {assetTypes.map(assetType => (
1434
+ <TypeCounter
1435
+ key={assetType}
1436
+ type={assetType}
1437
+ icon={`${assetType}-baseline`}
1438
+ value={(counters as Record<string, number>)[assetType]}
1439
+ isActive={activeAssetTypeFilter.includes(assetType)}
1440
+ hasFilter={!isEmpty(activeAssetTypeFilter)}
1441
+ onClick={handleAssetTypeFilterChange}
1442
+ enableActivity
1443
+ hideOnZero
1444
+ />
1445
+ ))}
1446
+ </TreeSummaryRow>
1447
+ <TreeSummaryRow>
1448
+ {showFuelType &&
1449
+ fuelTypeGroups.map(fuelTypeGroup => (
1450
+ <TypeCounter
1451
+ key={fuelTypeGroup}
1452
+ type={fuelTypeGroup}
1453
+ icon={getFuelTypeGroupIcon(fuelTypeGroup)}
1454
+ value={fuelCounters[fuelTypeGroup]}
1455
+ isActive={activeFuelTypeGroupFilter.includes(fuelTypeGroup)}
1456
+ hasFilter={!isEmpty(activeFuelTypeGroupFilter)}
1457
+ onClick={handleFuelTypeGroupFilterChange}
1458
+ enableActivity
1459
+ hideOnZero
1460
+ />
1461
+ ))}
1462
+ </TreeSummaryRow>
1463
+ </TreeSummary>
1464
+ }
1465
+ treeOptionsTooltip='Customize view'
1466
+ treeOptions={[
1467
+ <TreeOption
1468
+ key='emptyGroupsToggle'
1469
+ label='Show empty groups'
1470
+ isChecked={showEmptyGroups}
1471
+ onChange={handleToggleEmptyGroups}
1472
+ />,
1473
+ <TreeOption
1474
+ key='assetGroupsToggle'
1475
+ label='Show groups'
1476
+ isChecked={showAssetGroups}
1477
+ onChange={handleToggleAssetGroups}
1478
+ />,
1479
+ <hr key='hr' className='width-100pct margin-y-5' />,
1480
+ <TreeOption
1481
+ key='fuelTypeToggle'
1482
+ label='Show alternative fuel types'
1483
+ isChecked={showFuelType}
1484
+ onChange={handleToggleFuelType}
1485
+ />,
1486
+ ]}
1487
+ />
1488
+ </TreeCategory>
1489
+ </AssetTree>
1490
+ <div>
1491
+ <div className='h6'>Selected groups:</div>
1492
+ <ul>{renderSelectedItemsOfList(selectedTruckGroupIds, truckGroups)}</ul>
1493
+ <div className='h6'>Selected vehicles:</div>
1494
+ <ul>{renderSelectedItemsOfList(selectedTruckIds, items)}</ul>
1495
+ <div className='h6'>Expanded groups:</div>
1496
+ <ul>{renderSelectedItemsOfList(expandedTruckGroups, truckGroups)}</ul>
1497
+ </div>
1498
+ </div>
1499
+ );
1500
+ };
1501
+
1502
+ export default AssetTreeExample;
1503
+ ```
1504
+
1505
+ #### HTML (html)
1506
+
1507
+ ```html
1508
+ <div class="display-flex flex-wrap gap-25 overflow-auto">
1509
+ <div class="AssetTree border fluid" style="width: 350px; height: 500px;">
1510
+ <div class="AssetTreeResizeLimit" style="left: 450px;">
1511
+ </div>
1512
+ <div class="AssetTreeContent">
1513
+ <div class="TreeSidebar">
1514
+ <ul class="TreeSidebarNavigation">
1515
+ <li class="active">
1516
+ <div class="selection-bubble">
1517
+ <span class="rioglyph rioglyph-truck">
1518
+ </span>
1519
+ </div>
1520
+ </li>
1521
+ </ul>
1522
+ <div class="TreeSidebarToggle">
1523
+ <span class="rioglyph rioglyph-chevron-left">
1524
+ </span>
1525
+ </div>
1526
+ </div>
1527
+ <div class="AssetTreeBody scrollbar-fly-in smooth-scrollbar-wrapper" style="position: relative; overflow: hidden; width: 100%; height: 100%;">
1528
+ <div class="scrollbar-view" style="position: absolute; inset: 0px; overflow: scroll; margin-right: 0px; margin-bottom: 0px;">
1529
+ <div class="scrollbar-content-wrapper">
1530
+ <div class="TreeOffscreenWrapper">
1531
+ <div class="Tree">
1532
+ <div class="TreeHeader">
1533
+ <div class="TreeSearch">
1534
+ <div class="input-group flex-1-0">
1535
+ <span class="input-group-addon">
1536
+ <span class="rioglyph rioglyph-search" aria-hidden="true">
1537
+ </span>
1538
+ </span>
1539
+ <div class="ClearableInput input-group">
1540
+ <input placeholder="Find vehicle" class="form-control" type="text" tabindex="0" value="">
1541
+ <span class="clearButton hide">
1542
+ <span class="clearButtonIcon rioglyph rioglyph-remove-sign">
1543
+ </span>
1544
+ </span>
1545
+ </div>
1546
+ </div>
1547
+ </div>
1548
+ <div class="TreeHead display-flex gap-5 padding-15">
1549
+ <div class="border border-right-only hidden-empty padding-right-10 margin-right-2">
1550
+ <div class="TreeSelectAll display-flex align-items-center">
1551
+ <label class="checkbox margin-top--1" tabindex="0">
1552
+ <input type="checkbox" class="margin-top--1">
1553
+ <span class="checkbox-text">
1554
+ </span>
1555
+ </label>
1556
+ </div>
1557
+ </div>
1558
+ <div class="display-flex justify-content-between align-items-start width-100pct">
1559
+ <div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
1560
+ <div class="TreeSummaryRow display-grid grid-cols-4 gap-10">
1561
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1562
+ <span class="rioglyph rioglyph-truck-baseline text-size-16 margin-right-2">
1563
+ </span>
1564
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">5</span>
1565
+ </div>
1566
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1567
+ <span class="rioglyph rioglyph-bus-baseline text-size-16 margin-right-2">
1568
+ </span>
1569
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
1570
+ </div>
1571
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1572
+ <span class="rioglyph rioglyph-van-baseline text-size-16 margin-right-2">
1573
+ </span>
1574
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">8</span>
1575
+ </div>
1576
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1577
+ <span class="rioglyph rioglyph-car-baseline text-size-16 margin-right-2">
1578
+ </span>
1579
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">5</span>
1580
+ </div>
1581
+ </div>
1582
+ <div class="TreeSummaryRow display-grid grid-cols-4 gap-10">
1583
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1584
+ <span class="rioglyph rioglyph-fuel-liquid text-size-16 margin-right-2">
1585
+ </span>
1586
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">15</span>
1587
+ </div>
1588
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1589
+ <span class="rioglyph rioglyph-fuel-gas text-size-16 margin-right-2">
1590
+ </span>
1591
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
1592
+ </div>
1593
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1594
+ <span class="rioglyph rioglyph-fuel-electric text-size-16 margin-right-2">
1595
+ </span>
1596
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">1</span>
1597
+ </div>
1598
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1599
+ <span class="rioglyph rioglyph-fuel-hydrogen text-size-16 margin-right-2">
1600
+ </span>
1601
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">1</span>
1602
+ </div>
1603
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1604
+ <span class="rioglyph rioglyph-fuel-mix text-size-16 margin-right-2">
1605
+ </span>
1606
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">1</span>
1607
+ </div>
1608
+ </div>
1609
+ </div>
1610
+ </div>
1611
+ <div>
1612
+ <div class="dropdown btn-group TreeHeaderOptions height-20">
1613
+ <button type="button" id="7947qsy9jao" class="btn btn-default btn-sm btn-icon-only btn-component dropdown-toggle hover-bg-white border-none text-color-gray hover-text-color-dark" tabindex="0">
1614
+ <span class="rioglyph rioglyph-option-vertical" aria-hidden="true">
1615
+ </span>
1616
+ </button>
1617
+ </div>
1618
+ </div>
1619
+ </div>
1620
+ </div>
1621
+ <div class="TreeRoot user-select-none overflow-hidden" style="position: relative;">
1622
+ <div class="TreeNodeContainer user-select-none overflow-hidden open" data-id="group-1">
1623
+ <div class="TreeNode from-group" data-key="group-1">
1624
+ <label class="checkbox TreeCheckbox" tabindex="0">
1625
+ <input type="checkbox" class="TreeCheckbox">
1626
+ <span class="checkbox-text">
1627
+ </span>
1628
+ </label>
1629
+ <span class="TreeLabel TreeLabelName">
1630
+ <span class="TreeLabelNameText">
1631
+ <span class="TreeLabelNameTextHeadline">Mixed Vehicles</span>
1632
+ </span>
1633
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">9</span>
1634
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1635
+ </span>
1636
+ </span>
1637
+ </div>
1638
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d971">
1639
+ <label class="checkbox TreeCheckbox" tabindex="0">
1640
+ <input type="checkbox" class="TreeCheckbox">
1641
+ <span class="checkbox-text">
1642
+ </span>
1643
+ </label>
1644
+ <span class="TreeLabel TreeLabelName">
1645
+ <span class="rioglyph-icon-pair">
1646
+ <span class="rioglyph rioglyph-car">
1647
+ </span>
1648
+ <span class="rioglyph rioglyph-fuel-hydrogen">
1649
+ </span>
1650
+ </span>
1651
+ <span class="TreeLabelNameText">
1652
+ <span class="TreeLabelNameTextHeadline">Vehicle-1564</span>
1653
+ <span class="TreeLabelNameTextSubline">
1654
+ <span>Debug: hydrogen</span>
1655
+ </span>
1656
+ </span>
1657
+ </span>
1658
+ </div>
1659
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9713">
1660
+ <label class="checkbox TreeCheckbox" tabindex="0">
1661
+ <input type="checkbox" class="TreeCheckbox">
1662
+ <span class="checkbox-text">
1663
+ </span>
1664
+ </label>
1665
+ <span class="TreeLabel TreeLabelName">
1666
+ <span class="rioglyph-icon-pair">
1667
+ <span class="rioglyph rioglyph-bus">
1668
+ </span>
1669
+ <span class="rioglyph rioglyph-fuel-gas">
1670
+ </span>
1671
+ </span>
1672
+ <span class="TreeLabelNameText">
1673
+ <span class="TreeLabelNameTextHeadline">Vehicle-2359</span>
1674
+ <span class="TreeLabelNameTextSubline">
1675
+ <span>Debug: lpg</span>
1676
+ </span>
1677
+ </span>
1678
+ </span>
1679
+ </div>
1680
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d977">
1681
+ <label class="checkbox TreeCheckbox" tabindex="0">
1682
+ <input type="checkbox" class="TreeCheckbox">
1683
+ <span class="checkbox-text">
1684
+ </span>
1685
+ </label>
1686
+ <span class="TreeLabel TreeLabelName">
1687
+ <span class="rioglyph-icon-pair">
1688
+ <span class="rioglyph rioglyph-truck">
1689
+ </span>
1690
+ <span class="rioglyph rioglyph-fuel-liquid">
1691
+ </span>
1692
+ </span>
1693
+ <span class="TreeLabelNameText">
1694
+ <span class="TreeLabelNameTextHeadline">Vehicle-2411</span>
1695
+ <span class="TreeLabelNameTextSubline">
1696
+ <span>Debug: heavy_fuel_oil</span>
1697
+ </span>
1698
+ </span>
1699
+ </span>
1700
+ </div>
1701
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d975">
1702
+ <label class="checkbox TreeCheckbox" tabindex="0">
1703
+ <input type="checkbox" class="TreeCheckbox">
1704
+ <span class="checkbox-text">
1705
+ </span>
1706
+ </label>
1707
+ <span class="TreeLabel TreeLabelName">
1708
+ <span class="rioglyph-icon-pair">
1709
+ <span class="rioglyph rioglyph-car">
1710
+ </span>
1711
+ <span class="rioglyph rioglyph-fuel-liquid">
1712
+ </span>
1713
+ </span>
1714
+ <span class="TreeLabelNameText">
1715
+ <span class="TreeLabelNameTextHeadline">Vehicle-3355</span>
1716
+ <span class="TreeLabelNameTextSubline">
1717
+ <span>Debug: gas</span>
1718
+ </span>
1719
+ </span>
1720
+ </span>
1721
+ </div>
1722
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9712">
1723
+ <label class="checkbox TreeCheckbox" tabindex="0">
1724
+ <input type="checkbox" class="TreeCheckbox">
1725
+ <span class="checkbox-text">
1726
+ </span>
1727
+ </label>
1728
+ <span class="TreeLabel TreeLabelName">
1729
+ <span class="rioglyph-icon-pair">
1730
+ <span class="rioglyph rioglyph-truck">
1731
+ </span>
1732
+ <span class="rioglyph rioglyph-fuel-electric">
1733
+ </span>
1734
+ </span>
1735
+ <span class="TreeLabelNameText">
1736
+ <span class="TreeLabelNameTextHeadline">Vehicle-6981</span>
1737
+ <span class="TreeLabelNameTextSubline">
1738
+ <span>Debug: electric</span>
1739
+ </span>
1740
+ </span>
1741
+ </span>
1742
+ </div>
1743
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d978">
1744
+ <label class="checkbox TreeCheckbox" tabindex="0">
1745
+ <input type="checkbox" class="TreeCheckbox">
1746
+ <span class="checkbox-text">
1747
+ </span>
1748
+ </label>
1749
+ <span class="TreeLabel TreeLabelName">
1750
+ <span class="rioglyph-icon-pair">
1751
+ <span class="rioglyph rioglyph-truck">
1752
+ </span>
1753
+ <span class="rioglyph rioglyph-fuel-liquid">
1754
+ </span>
1755
+ </span>
1756
+ <span class="TreeLabelNameText">
1757
+ <span class="TreeLabelNameTextHeadline">Vehicle-7289</span>
1758
+ <span class="TreeLabelNameTextSubline">
1759
+ <span>Debug: gas</span>
1760
+ </span>
1761
+ </span>
1762
+ </span>
1763
+ </div>
1764
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9714">
1765
+ <label class="checkbox TreeCheckbox" tabindex="0">
1766
+ <input type="checkbox" class="TreeCheckbox">
1767
+ <span class="checkbox-text">
1768
+ </span>
1769
+ </label>
1770
+ <span class="TreeLabel TreeLabelName">
1771
+ <span class="rioglyph-icon-pair">
1772
+ <span class="rioglyph rioglyph-car">
1773
+ </span>
1774
+ <span class="rioglyph rioglyph-fuel-liquid">
1775
+ </span>
1776
+ </span>
1777
+ <span class="TreeLabelNameText">
1778
+ <span class="TreeLabelNameTextHeadline">Vehicle-8098</span>
1779
+ <span class="TreeLabelNameTextSubline">
1780
+ <span>Debug: heavy_fuel_oil</span>
1781
+ </span>
1782
+ </span>
1783
+ </span>
1784
+ </div>
1785
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d973">
1786
+ <label class="checkbox TreeCheckbox" tabindex="0">
1787
+ <input type="checkbox" class="TreeCheckbox">
1788
+ <span class="checkbox-text">
1789
+ </span>
1790
+ </label>
1791
+ <span class="TreeLabel TreeLabelName">
1792
+ <span class="rioglyph-icon-pair">
1793
+ <span class="rioglyph rioglyph-truck">
1794
+ </span>
1795
+ <span class="rioglyph rioglyph-fuel-liquid">
1796
+ </span>
1797
+ </span>
1798
+ <span class="TreeLabelNameText">
1799
+ <span class="TreeLabelNameTextHeadline">Vehicle-8298</span>
1800
+ <span class="TreeLabelNameTextSubline">
1801
+ <span>Debug: heavy_fuel_oil</span>
1802
+ </span>
1803
+ </span>
1804
+ </span>
1805
+ </div>
1806
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9711">
1807
+ <label class="checkbox TreeCheckbox" tabindex="0">
1808
+ <input type="checkbox" class="TreeCheckbox">
1809
+ <span class="checkbox-text">
1810
+ </span>
1811
+ </label>
1812
+ <span class="TreeLabel TreeLabelName">
1813
+ <span class="rioglyph-icon-pair">
1814
+ <span class="rioglyph rioglyph-van">
1815
+ </span>
1816
+ <span class="rioglyph rioglyph-fuel-gas">
1817
+ </span>
1818
+ </span>
1819
+ <span class="TreeLabelNameText">
1820
+ <span class="TreeLabelNameTextHeadline">Vehicle-9591</span>
1821
+ <span class="TreeLabelNameTextSubline">
1822
+ <span>Debug: lpg</span>
1823
+ </span>
1824
+ </span>
1825
+ </span>
1826
+ </div>
1827
+ </div>
1828
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="unassigned-group">
1829
+ <div class="TreeNode from-group" data-key="unassigned-group">
1830
+ <label class="checkbox TreeCheckbox" tabindex="0">
1831
+ <input type="checkbox" class="TreeCheckbox">
1832
+ <span class="checkbox-text">
1833
+ </span>
1834
+ </label>
1835
+ <span class="TreeLabel TreeLabelName">
1836
+ <span class="TreeLabelNameText">
1837
+ <span class="TreeLabelNameTextHeadline">Ungrouped</span>
1838
+ </span>
1839
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">11</span>
1840
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1841
+ </span>
1842
+ </span>
1843
+ </div>
1844
+ </div>
1845
+ </div>
1846
+ </div>
1847
+ </div>
1848
+ </div>
1849
+ </div>
1850
+ <div class="scrollbar-track-horizontal" style="position: absolute; height: 6px; display: none;">
1851
+ <div class="scrollbar-thumb-horizontal" style="position: relative; display: block; height: 100%;">
1852
+ </div>
1853
+ </div>
1854
+ <div class="scrollbar-track-vertical" style="position: absolute; width: 6px; display: none;">
1855
+ <div class="scrollbar-thumb-vertical" style="position: relative; display: block; width: 100%;">
1856
+ </div>
1857
+ </div>
1858
+ </div>
1859
+ </div>
1860
+ <div class="Resizer resize-horizontal resize-right">
1861
+ </div>
1862
+ </div>
1863
+ <div>
1864
+ <div class="h6">Selected groups:</div>
1865
+ <ul>
1866
+ </ul>
1867
+ <div class="h6">Selected vehicles:</div>
1868
+ <ul>
1869
+ </ul>
1870
+ <div class="h6">Expanded groups:</div>
1871
+ <ul>
1872
+ <li>Mixed Vehicles</li>
1873
+ </ul>
1874
+ </div>
1875
+ </div>
1876
+ ```
1877
+
1878
+ #### Props: AssetTree
1879
+
1880
+ ### AssetTree
1881
+
1882
+ | Name | Type | Default | Description |
1883
+ | --- | --- | --- | --- |
1884
+ | fly | boolean | false | Defines if the component will overlap the body content. |
1885
+ | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
1886
+ | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
1887
+ | bordered | boolean | false | Defines whether the component has a border or not. |
1888
+ | width | string / number | 350 | Defines the width of the component. The value is set as inline style. Note: when component is resizable it will take the provided width in px only and convert it to number in case. |
1889
+ | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
1890
+ | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
1891
+ | height | number | — | Defines the height of the component in px. |
1892
+ | isOpen | boolean | true | Defines whether the component is open or not. |
1893
+ | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
1894
+ | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
1895
+ | onCategoryChange | Function | () => {} | Callback for handling change of category. |
1896
+ | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
1897
+ | className | String | — | Additional classes added on the wrapper element. |
1898
+ | children | TreeCategory | — | A list of TreeCategory components |
1899
+
1900
+ #### Props: TreeCategory
1901
+
1902
+ ### TreeCategory
1903
+
1904
+ | Name | Type | Default | Description |
1905
+ | --- | --- | --- | --- |
1906
+ | id | String | — | A unique identifier for that category. |
1907
+ | icon | String | — | The rioglyph icon name for that category. |
1908
+ | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
1909
+ | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
1910
+
1911
+ #### Props: Tree
1912
+
1913
+ ### Tree
1914
+
1915
+ | Name | Type | Default | Description |
1916
+ | --- | --- | --- | --- |
1917
+ | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
1918
+ | └id | String | — | A unique identifier of a group. |
1919
+ | └name | String | — | The name of a group. |
1920
+ | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
1921
+ | └disabled | Boolean | — | Disallows the selection of the group itself. |
1922
+ | └className | String | — | Additional classes added to the group element. |
1923
+ | items | Array of Objects | [] | The list of items. |
1924
+ | └id | String | — | A unique identifier of an item. |
1925
+ | └name | string / object | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory |
1926
+ | └info | String \| Node | — | The subline of an item. |
1927
+ | └type | string | — | The primary type of the item. This is also used as the fallback icon name and refers to the name of the respective rioglyph icon (excluding the `rioglyph-` prefix). |
1928
+ | └subType | string | — | The sub type of an item which is also the name of the respective rioglyph icon without the prefix. This could be used to show a secondary paired icon like for fuel type. |
1929
+ | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
1930
+ | └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g. `'truck'`), this icon will be used explicitly. If set to `undefined`, the `type` property will be used as the fallback icon. If set to `null`, no icon will be rendered, even if `type` is defined. This allows full control over the icon behavior while maintaining backward compatibility with type-based icons. |
1931
+ | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
1932
+ | └className | string | — | Additional classes added to the item element. |
1933
+ | selectedGroups | Array of strings | — | List of selected group ids. |
1934
+ | selectedItems | Array of strings | — | List of selected item ids. |
1935
+ | onSelectionChange | Function | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
1936
+ | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
1937
+ | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
1938
+ | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
1939
+ | searchPlaceholder | string | — | The text used as placeholder for the search input. |
1940
+ | onSearchChange | Function | — | Callback for when the search value changes. |
1941
+ | search | node | — | Used to define custom custom search component which replaces the built-in search. |
1942
+ | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
1943
+ | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
1944
+ | hideSummary | boolean | false | Defines whether a summary is shown. |
1945
+ | hideTreeHead | boolean | false | Defines whether the entire area below the search field is shown or not. Note: Disabling the tree head will hide the select all checkbox and the tree options as well as the tree summary. |
1946
+ | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
1947
+ | scrollHeight | Number | — | Defines the max-height of the scrollable list |
1948
+ | expandedGroups | Array of String | — | List of group ids which are expanded. |
1949
+ | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
1950
+ | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
1951
+ | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
1952
+ | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
1953
+ | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
1954
+ | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
1955
+ | className | String | — | Additional classes added to the wrapping element. |
1956
+
1957
+ #### Props: TreeSearch
1958
+
1959
+ ### TreeSearch
1960
+
1961
+ | Name | Type | Default | Description |
1962
+ | --- | --- | --- | --- |
1963
+ | value | String | — | The search value to be shown and used for the search. |
1964
+ | onChange | Function | () => {} | Callback for when the search value changes. |
1965
+ | placeholder | String | — | The placeholder text used for the input field. |
1966
+ | className | String | — | Additional classes added to the wrapping element. |
1967
+
1968
+ #### Props: TreeSummary
1969
+
1970
+ ### TreeSummary
1971
+
1972
+ | Name | Type | Default | Description |
1973
+ | --- | --- | --- | --- |
1974
+ | assetCounts | object | — | The object containing various asset type counter. |
1975
+ | └truck | number | — | The amount of trucks. |
1976
+ | └trailer | number | — | The amount of trailers. |
1977
+ | └bus | number | — | The amount of buses. |
1978
+ | └van | number | — | The amount of vans. |
1979
+ | └driver | number | — | The amount of drivers. |
1980
+ | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
1981
+ | className | string | — | Additional classes added to the wrapping element. |
1982
+
1983
+ #### Props: TreeSummaryRow
1984
+
1985
+ ### TreeSummaryRow
1986
+
1987
+ | Name | Type | Default | Description |
1988
+ | --- | --- | --- | --- |
1989
+ | gridCols | number | 4 | Defined the number of grid columns for a single row. Note, when the amount of children exceed the columns it will wrap around to a new line. |
1990
+
1991
+ #### Props: TypeCounter
1992
+
1993
+ ### TypeCounter
1994
+
1995
+ | Name | Type | Default | Description |
1996
+ | --- | --- | --- | --- |
1997
+ | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
1998
+ | icon | string | — | The icon name. Note, when using the built-in generic type counter, the icon name will the same as the item type. So make sure there is a corresponding icon for the defined type. |
1999
+ | isActive | Boolean | — | Sets the active styling if active. |
2000
+ | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
2001
+ | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
2002
+ | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
2003
+ | onClick | Function | — | Callback function when the counter is clicked. It returns the type value.Make sure the "type" prop is defined to receive the value in the callback and the flag "enableActivity" is set to true otherwise the callback is not triggered. |
2004
+ | value | String / Number / Node | — | A custom value to be shown in the counter. |
2005
+
2006
+ #### Props: TreeOption
2007
+
2008
+ ### TreeOption
2009
+
2010
+ | Name | Type | Default | Description |
2011
+ | --- | --- | --- | --- |
2012
+ | isChecked | boolean | — | Defines whether the option is set. |
2013
+ | label | string / node | — | The label for the option. |
2014
+ | onChange | Function | — | Callback triggered when option is selected. |
2015
+ | className | string | — | Additional classes added to the wrapping element. |
2016
+
2017
+ ## AssetTree with custom summary
2018
+
2019
+ ### Example: Some small dummy text at the bottom to showcase that you can put something here
2020
+
2021
+ 3
2022
+ 15
2023
+
2024
+ JohnDoe
2025
+ MaxlRainer
2026
+ JohanSchmidt
2027
+
2028
+ Some small dummy text at the bottom to showcase that you can put something here
2029
+
2030
+ #### Summary
2031
+
2032
+ 3
2033
+ 15
2034
+
2035
+ JohnDoe
2036
+ MaxlRainer
2037
+ JohanSchmidt
2038
+
2039
+ Some small dummy text at the bottom to showcase that you can put something here
2040
+
2041
+ #### React (tsx)
2042
+
2043
+ ```tsx
2044
+ import { useState } from 'react';
2045
+ import { countBy } from 'es-toolkit/compat';
2046
+
2047
+ import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
2048
+ import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
2049
+ import Tree, { type TreeItemName, type TreeItem } from '@rio-cloud/rio-uikit/Tree';
2050
+ import TreeSummary from '@rio-cloud/rio-uikit/TreeSummary';
2051
+ import TypeCounter from '@rio-cloud/rio-uikit/TypeCounter';
2052
+ import Notification from '@rio-cloud/rio-uikit/Notification';
2053
+
2054
+ const CATEGORY_DRIVER = 'assets';
2055
+
2056
+ const drivers: TreeItem[] = [
2057
+ {
2058
+ id: '74e8eb86-18a1-4abe-90cb-aeee7909f857',
2059
+ name: {
2060
+ firstName: 'John',
2061
+ lastName: 'Doe',
2062
+ },
2063
+ type: 'driver',
2064
+ },
2065
+ {
2066
+ id: '3abc20f5-e0b6-42bb-b310-4e57fdd2be55',
2067
+ name: {
2068
+ firstName: 'Maxl',
2069
+ lastName: 'Rainer',
2070
+ },
2071
+ type: 'driver',
2072
+ },
2073
+ {
2074
+ id: '3abc20f5-e0b6-42bb-b310-4e57fdd2be56',
2075
+ name: {
2076
+ firstName: 'Johan',
2077
+ lastName: 'Schmidt',
2078
+ },
2079
+ type: 'driver',
2080
+ },
2081
+ ];
2082
+
2083
+ const getTypeCounts = (items: TreeItem[]) => countBy(items, item => item.type);
2084
+
2085
+ const AssetTreeWithCustomSummaryExample = () => {
2086
+ const [counters, setCounters] = useState({
2087
+ driver: 3,
2088
+ driverOut: 15,
2089
+ });
2090
+
2091
+ const handleSearchChange = (searchValue: string) => {
2092
+ const filteredDriver = drivers.filter(driver =>
2093
+ `${(driver.name as TreeItemName).firstName} ${(driver.name as TreeItemName).lastName}`
2094
+ .toLowerCase()
2095
+ .includes(searchValue.toLowerCase())
2096
+ );
2097
+ const counts = getTypeCounts(filteredDriver);
2098
+
2099
+ setCounters({
2100
+ ...counters,
2101
+ driver: counts.driver,
2102
+ });
2103
+ };
2104
+
2105
+ return (
2106
+ <div className='display-flex flex-wrap overflow-auto'>
2107
+ <AssetTree
2108
+ resizable
2109
+ bordered
2110
+ minWidth={300}
2111
+ maxWidth={450}
2112
+ currentCategoryId={CATEGORY_DRIVER}
2113
+ height={500}
2114
+ isOpen
2115
+ >
2116
+ <TreeCategory
2117
+ key={CATEGORY_DRIVER}
2118
+ id={CATEGORY_DRIVER}
2119
+ label='Driver'
2120
+ icon='rioglyph-driver'
2121
+ hasSelection={false}
2122
+ >
2123
+ <div className='flex-1-1 display-flex flex-column justify-content-between'>
2124
+ <Tree
2125
+ summary={
2126
+ <TreeSummary>
2127
+ <TypeCounter
2128
+ icon='driver'
2129
+ value={counters.driver}
2130
+ enableActivity
2131
+ type='driver'
2132
+ onClick={(type: string) => Notification.default(`TypeCounter ${type} clicked`)}
2133
+ />
2134
+ <TypeCounter icon='drivercard-out' value={counters.driverOut} />
2135
+ </TreeSummary>
2136
+ }
2137
+ groups={[]}
2138
+ items={drivers}
2139
+ expandedGroups={[]}
2140
+ selectedGroups={[]}
2141
+ selectedItems={[]}
2142
+ searchPlaceholder='Find driver by name'
2143
+ onSearchChange={handleSearchChange}
2144
+ hasMultiselect={false}
2145
+ />
2146
+ <div className='margin-15 padding-10 rounded border1 border-color-lightest shadow-accent text-color-dark line-height-125rel'>
2147
+ Some small dummy text at the bottom to showcase that you can put something here
2148
+ </div>
2149
+ </div>
2150
+ </TreeCategory>
2151
+ </AssetTree>
2152
+ </div>
2153
+ );
2154
+ };
2155
+
2156
+ export default AssetTreeWithCustomSummaryExample;
2157
+ ```
2158
+
2159
+ #### HTML (html)
2160
+
2161
+ ```html
2162
+ <div class="display-flex flex-wrap overflow-auto">
2163
+ <div class="AssetTree border fluid" style="width: 350px; height: 500px;">
2164
+ <div class="AssetTreeResizeLimit" style="left: 450px;">
2165
+ </div>
2166
+ <div class="AssetTreeContent">
2167
+ <div class="TreeSidebar">
2168
+ <ul class="TreeSidebarNavigation">
2169
+ <li class="active">
2170
+ <div class="selection-bubble">
2171
+ <span class="rioglyph rioglyph-driver">
2172
+ </span>
2173
+ </div>
2174
+ </li>
2175
+ </ul>
2176
+ <div class="TreeSidebarToggle">
2177
+ <span class="rioglyph rioglyph-chevron-left">
2178
+ </span>
2179
+ </div>
2180
+ </div>
2181
+ <div class="AssetTreeBody scrollbar-fly-in smooth-scrollbar-wrapper" style="position: relative; overflow: hidden; width: 100%; height: 100%;">
2182
+ <div class="scrollbar-view" style="position: absolute; inset: 0px; overflow: scroll; margin-right: 0px; margin-bottom: 0px;">
2183
+ <div class="scrollbar-content-wrapper">
2184
+ <div class="flex-1-1 display-flex flex-column justify-content-between">
2185
+ <div class="Tree">
2186
+ <div class="TreeHeader">
2187
+ <div class="TreeSearch">
2188
+ <div class="input-group flex-1-0">
2189
+ <span class="input-group-addon">
2190
+ <span class="rioglyph rioglyph-search" aria-hidden="true">
2191
+ </span>
2192
+ </span>
2193
+ <div class="ClearableInput input-group">
2194
+ <input placeholder="Find driver by name" class="form-control" type="text" tabindex="0" value="">
2195
+ <span class="clearButton hide">
2196
+ <span class="clearButtonIcon rioglyph rioglyph-remove-sign">
2197
+ </span>
2198
+ </span>
2199
+ </div>
2200
+ </div>
2201
+ </div>
2202
+ <div class="TreeHead display-flex gap-5 padding-15">
2203
+ <div class="border border-right-only hidden-empty padding-right-10 margin-right-2">
2204
+ </div>
2205
+ <div class="display-flex justify-content-between align-items-start width-100pct">
2206
+ <div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
2207
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
2208
+ <span class="rioglyph rioglyph-driver text-size-16 margin-right-2">
2209
+ </span>
2210
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">3</span>
2211
+ </div>
2212
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
2213
+ <span class="rioglyph rioglyph-drivercard-out text-size-16 margin-right-2">
2214
+ </span>
2215
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">15</span>
2216
+ </div>
2217
+ </div>
2218
+ </div>
2219
+ </div>
2220
+ </div>
2221
+ <div class="TreeRoot user-select-none overflow-hidden" style="position: relative;">
2222
+ <div class="TreeNodeContainer user-select-none overflow-hidden open">
2223
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="74e8eb86-18a1-4abe-90cb-aeee7909f857">
2224
+ <span class="TreeLabel TreeLabelName">
2225
+ <span class="rioglyph rioglyph-driver">
2226
+ </span>
2227
+ <span class="TreeLabelNameText">
2228
+ <span class="TreeLabelNameTextHeadline">
2229
+ <span class="text-light margin-right-3">John</span>
2230
+ <span>Doe</span>
2231
+ </span>
2232
+ </span>
2233
+ </span>
2234
+ </div>
2235
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="3abc20f5-e0b6-42bb-b310-4e57fdd2be55">
2236
+ <span class="TreeLabel TreeLabelName">
2237
+ <span class="rioglyph rioglyph-driver">
2238
+ </span>
2239
+ <span class="TreeLabelNameText">
2240
+ <span class="TreeLabelNameTextHeadline">
2241
+ <span class="text-light margin-right-3">Maxl</span>
2242
+ <span>Rainer</span>
2243
+ </span>
2244
+ </span>
2245
+ </span>
2246
+ </div>
2247
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="3abc20f5-e0b6-42bb-b310-4e57fdd2be56">
2248
+ <span class="TreeLabel TreeLabelName">
2249
+ <span class="rioglyph rioglyph-driver">
2250
+ </span>
2251
+ <span class="TreeLabelNameText">
2252
+ <span class="TreeLabelNameTextHeadline">
2253
+ <span class="text-light margin-right-3">Johan</span>
2254
+ <span>Schmidt</span>
2255
+ </span>
2256
+ </span>
2257
+ </span>
2258
+ </div>
2259
+ </div>
2260
+ </div>
2261
+ </div>
2262
+ <div class="margin-15 padding-10 rounded border1 border-color-lightest shadow-accent text-color-dark line-height-125rel">Some small dummy text at the bottom to showcase that you can put something here</div>
2263
+ </div>
2264
+ </div>
2265
+ </div>
2266
+ <div class="scrollbar-track-horizontal" style="position: absolute; height: 6px; display: none;">
2267
+ <div class="scrollbar-thumb-horizontal" style="position: relative; display: block; height: 100%;">
2268
+ </div>
2269
+ </div>
2270
+ <div class="scrollbar-track-vertical" style="position: absolute; width: 6px; display: none;">
2271
+ <div class="scrollbar-thumb-vertical" style="position: relative; display: block; width: 100%;">
2272
+ </div>
2273
+ </div>
2274
+ </div>
2275
+ </div>
2276
+ <div class="Resizer resize-horizontal resize-right">
2277
+ </div>
2278
+ </div>
2279
+ </div>
2280
+ ```
2281
+
2282
+ #### Props: AssetTree
2283
+
2284
+ ### AssetTree
2285
+
2286
+ | Name | Type | Default | Description |
2287
+ | --- | --- | --- | --- |
2288
+ | fly | boolean | false | Defines if the component will overlap the body content. |
2289
+ | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
2290
+ | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
2291
+ | bordered | boolean | false | Defines whether the component has a border or not. |
2292
+ | width | string / number | 350 | Defines the width of the component. The value is set as inline style. Note: when component is resizable it will take the provided width in px only and convert it to number in case. |
2293
+ | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
2294
+ | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
2295
+ | height | number | — | Defines the height of the component in px. |
2296
+ | isOpen | boolean | true | Defines whether the component is open or not. |
2297
+ | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
2298
+ | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
2299
+ | onCategoryChange | Function | () => {} | Callback for handling change of category. |
2300
+ | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
2301
+ | className | String | — | Additional classes added on the wrapper element. |
2302
+ | children | TreeCategory | — | A list of TreeCategory components |
2303
+
2304
+ #### Props: TreeCategory
2305
+
2306
+ ### TreeCategory
2307
+
2308
+ | Name | Type | Default | Description |
2309
+ | --- | --- | --- | --- |
2310
+ | id | String | — | A unique identifier for that category. |
2311
+ | icon | String | — | The rioglyph icon name for that category. |
2312
+ | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
2313
+ | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
2314
+
2315
+ #### Props: Tree
2316
+
2317
+ ### Tree
2318
+
2319
+ | Name | Type | Default | Description |
2320
+ | --- | --- | --- | --- |
2321
+ | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2322
+ | └id | String | — | A unique identifier of a group. |
2323
+ | └name | String | — | The name of a group. |
2324
+ | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2325
+ | └disabled | Boolean | — | Disallows the selection of the group itself. |
2326
+ | └className | String | — | Additional classes added to the group element. |
2327
+ | items | Array of Objects | [] | The list of items. |
2328
+ | └id | String | — | A unique identifier of an item. |
2329
+ | └name | string / object | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory |
2330
+ | └info | String \| Node | — | The subline of an item. |
2331
+ | └type | string | — | The primary type of the item. This is also used as the fallback icon name and refers to the name of the respective rioglyph icon (excluding the `rioglyph-` prefix). |
2332
+ | └subType | string | — | The sub type of an item which is also the name of the respective rioglyph icon without the prefix. This could be used to show a secondary paired icon like for fuel type. |
2333
+ | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2334
+ | └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g. `'truck'`), this icon will be used explicitly. If set to `undefined`, the `type` property will be used as the fallback icon. If set to `null`, no icon will be rendered, even if `type` is defined. This allows full control over the icon behavior while maintaining backward compatibility with type-based icons. |
2335
+ | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2336
+ | └className | string | — | Additional classes added to the item element. |
2337
+ | selectedGroups | Array of strings | — | List of selected group ids. |
2338
+ | selectedItems | Array of strings | — | List of selected item ids. |
2339
+ | onSelectionChange | Function | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
2340
+ | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2341
+ | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2342
+ | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2343
+ | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2344
+ | onSearchChange | Function | — | Callback for when the search value changes. |
2345
+ | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2346
+ | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2347
+ | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2348
+ | hideSummary | boolean | false | Defines whether a summary is shown. |
2349
+ | hideTreeHead | boolean | false | Defines whether the entire area below the search field is shown or not. Note: Disabling the tree head will hide the select all checkbox and the tree options as well as the tree summary. |
2350
+ | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2351
+ | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2352
+ | expandedGroups | Array of String | — | List of group ids which are expanded. |
2353
+ | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2354
+ | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2355
+ | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2356
+ | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2357
+ | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2358
+ | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2359
+ | className | String | — | Additional classes added to the wrapping element. |
2360
+
2361
+ #### Props: TreeSearch
2362
+
2363
+ ### TreeSearch
2364
+
2365
+ | Name | Type | Default | Description |
2366
+ | --- | --- | --- | --- |
2367
+ | value | String | — | The search value to be shown and used for the search. |
2368
+ | onChange | Function | () => {} | Callback for when the search value changes. |
2369
+ | placeholder | String | — | The placeholder text used for the input field. |
2370
+ | className | String | — | Additional classes added to the wrapping element. |
2371
+
2372
+ #### Props: TreeSummary
2373
+
2374
+ ### TreeSummary
2375
+
2376
+ | Name | Type | Default | Description |
2377
+ | --- | --- | --- | --- |
2378
+ | assetCounts | object | — | The object containing various asset type counter. |
2379
+ | └truck | number | — | The amount of trucks. |
2380
+ | └trailer | number | — | The amount of trailers. |
2381
+ | └bus | number | — | The amount of buses. |
2382
+ | └van | number | — | The amount of vans. |
2383
+ | └driver | number | — | The amount of drivers. |
2384
+ | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
2385
+ | className | string | — | Additional classes added to the wrapping element. |
2386
+
2387
+ #### Props: TreeSummaryRow
2388
+
2389
+ ### TreeSummaryRow
2390
+
2391
+ | Name | Type | Default | Description |
2392
+ | --- | --- | --- | --- |
2393
+ | gridCols | number | 4 | Defined the number of grid columns for a single row. Note, when the amount of children exceed the columns it will wrap around to a new line. |
2394
+
2395
+ #### Props: TypeCounter
2396
+
2397
+ ### TypeCounter
2398
+
2399
+ | Name | Type | Default | Description |
2400
+ | --- | --- | --- | --- |
2401
+ | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
2402
+ | icon | string | — | The icon name. Note, when using the built-in generic type counter, the icon name will the same as the item type. So make sure there is a corresponding icon for the defined type. |
2403
+ | isActive | Boolean | — | Sets the active styling if active. |
2404
+ | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
2405
+ | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
2406
+ | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
2407
+ | onClick | Function | — | Callback function when the counter is clicked. It returns the type value.Make sure the "type" prop is defined to receive the value in the callback and the flag "enableActivity" is set to true otherwise the callback is not triggered. |
2408
+ | value | String / Number / Node | — | A custom value to be shown in the counter. |
2409
+
2410
+ #### Props: TreeOption
2411
+
2412
+ ### TreeOption
2413
+
2414
+ | Name | Type | Default | Description |
2415
+ | --- | --- | --- | --- |
2416
+ | isChecked | boolean | — | Defines whether the option is set. |
2417
+ | label | string / node | — | The label for the option. |
2418
+ | onChange | Function | — | Callback triggered when option is selected. |
2419
+ | className | string | — | Additional classes added to the wrapping element. |
2420
+
2421
+ ## Tree
2422
+
2423
+ ### Example: Tree with header and search
2424
+
2425
+ Tree with header and search
2426
+
2427
+ 20
2428
+
2429
+ Folder 015
2430
+
2431
+ Folder 025
2432
+
2433
+ Folder 035
2434
+
2435
+ Folder 045
2436
+
2437
+ Selected items:
2438
+
2439
+ Expanded folders:
2440
+
2441
+ #### Summary
2442
+
2443
+ Tree with header and search
2444
+
2445
+ 20
2446
+
2447
+ Folder 015
2448
+
2449
+ Folder 025
2450
+
2451
+ Folder 035
2452
+
2453
+ Folder 045
2454
+
2455
+ Selected items:
2456
+
2457
+ Expanded folders:
2458
+
2459
+ #### React (tsx)
2460
+
2461
+ ```tsx
2462
+ import { useState } from 'react';
2463
+ import { random } from 'es-toolkit/compat';
2464
+ import faker from 'faker';
2465
+
2466
+ import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
2467
+ import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
2468
+
2469
+ const folders: TreeGroup[] = [
2470
+ {
2471
+ id: '1',
2472
+ name: 'Folder 01',
2473
+ icon: 'folder-open',
2474
+ },
2475
+ {
2476
+ id: '2',
2477
+ name: 'Folder 02',
2478
+ icon: 'folder-open',
2479
+ },
2480
+ {
2481
+ id: '3',
2482
+ name: 'Folder 03',
2483
+ icon: 'folder-open',
2484
+ },
2485
+ {
2486
+ id: '4',
2487
+ name: 'Folder 04',
2488
+ icon: 'folder-open',
2489
+ },
2490
+ ];
2491
+
2492
+ const treeItems: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
2493
+ id: `${index}`,
2494
+ name: `${faker.random.words()} ${random(100, 999)}`,
2495
+ type: 'files',
2496
+ icon: 'files',
2497
+ // icon: null, // Set to "null" to omit the icon
2498
+ groupIds: [faker.random.arrayElement(folders).id],
2499
+ }));
2500
+
2501
+ const TreeOnlyExample = () => {
2502
+ const [selectedItemIds, setSelectedItemIds] = useState<string[]>([]);
2503
+ const [expandedFolders, setExpandedFolders] = useState<string[]>([]);
2504
+
2505
+ const handleSelection = ({ items }: SelectionChangeResponse) => {
2506
+ setSelectedItemIds(items);
2507
+ };
2508
+
2509
+ const handleExpandFolder = (newExpandedFolders: string[]) => setExpandedFolders(newExpandedFolders);
2510
+
2511
+ const renderSelectedItemsOfList = (itemIds: string[], list: TreeGroup[] | TreeItem[]) => {
2512
+ return itemIds.map(selectedItemId => {
2513
+ const result = list.find(listItem => listItem.id === selectedItemId);
2514
+ if (result) {
2515
+ return <li key={selectedItemId}>{`${result.name}`}</li>;
2516
+ }
2517
+ return null;
2518
+ });
2519
+ };
2520
+
2521
+ return (
2522
+ <div className='display-flex flex-wrap gap-25 overflow-auto'>
2523
+ <div className='width-500'>
2524
+ <LabeledElement label='Tree with header and search'>
2525
+ <Tree
2526
+ groups={folders}
2527
+ items={treeItems}
2528
+ expandedGroups={expandedFolders}
2529
+ onExpandGroupsChange={handleExpandFolder}
2530
+ selectedItems={selectedItemIds}
2531
+ onSelectionChange={handleSelection}
2532
+ searchPlaceholder='Find file'
2533
+ scrollHeight={300}
2534
+ hasMultiselect={false}
2535
+ />
2536
+ </LabeledElement>
2537
+ </div>
2538
+ <div>
2539
+ <div className='h6'>Selected items:</div>
2540
+ <ul>{renderSelectedItemsOfList(selectedItemIds, treeItems)}</ul>
2541
+ <div className='h6'>Expanded folders:</div>
2542
+ <ul>{renderSelectedItemsOfList(expandedFolders, folders)}</ul>
2543
+ </div>
2544
+ </div>
2545
+ );
2546
+ };
2547
+
2548
+ export default TreeOnlyExample;
2549
+ ```
2550
+
2551
+ #### HTML (html)
2552
+
2553
+ ```html
2554
+ <div class="display-flex flex-wrap gap-25 overflow-auto">
2555
+ <div class="width-500">
2556
+ <div class="LabeledElement display-flex flex-column">
2557
+ <div class="text-color-dark max-width-100pct text-size-12 display-inline-block margin-bottom-5">Tree with header and search</div>
2558
+ <div class="Tree">
2559
+ <div class="TreeHeader">
2560
+ <div class="TreeSearch">
2561
+ <div class="input-group flex-1-0">
2562
+ <span class="input-group-addon">
2563
+ <span class="rioglyph rioglyph-search" aria-hidden="true">
2564
+ </span>
2565
+ </span>
2566
+ <div class="ClearableInput input-group">
2567
+ <input placeholder="Find file" class="form-control" type="text" tabindex="0" value="">
2568
+ <span class="clearButton hide">
2569
+ <span class="clearButtonIcon rioglyph rioglyph-remove-sign">
2570
+ </span>
2571
+ </span>
2572
+ </div>
2573
+ </div>
2574
+ </div>
2575
+ <div class="TreeHead display-flex gap-5 padding-15">
2576
+ <div class="border border-right-only hidden-empty padding-right-10 margin-right-2">
2577
+ </div>
2578
+ <div class="display-flex justify-content-between align-items-start width-100pct">
2579
+ <div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
2580
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
2581
+ <span class="rioglyph rioglyph-files text-size-16 margin-right-2">
2582
+ </span>
2583
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">20</span>
2584
+ </div>
2585
+ </div>
2586
+ </div>
2587
+ </div>
2588
+ </div>
2589
+ <div class="TreeRoot user-select-none overflow-auto" style="max-height: 300px; position: relative;">
2590
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="1">
2591
+ <div class="TreeNode from-group" data-key="1">
2592
+ <span class="TreeLabel TreeLabelName">
2593
+ <span class="rioglyph rioglyph-folder-open">
2594
+ </span>
2595
+ <span class="TreeLabelNameText">
2596
+ <span class="TreeLabelNameTextHeadline">Folder 01</span>
2597
+ </span>
2598
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2599
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2600
+ </span>
2601
+ </span>
2602
+ </div>
2603
+ </div>
2604
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="2">
2605
+ <div class="TreeNode from-group" data-key="2">
2606
+ <span class="TreeLabel TreeLabelName">
2607
+ <span class="rioglyph rioglyph-folder-open">
2608
+ </span>
2609
+ <span class="TreeLabelNameText">
2610
+ <span class="TreeLabelNameTextHeadline">Folder 02</span>
2611
+ </span>
2612
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2613
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2614
+ </span>
2615
+ </span>
2616
+ </div>
2617
+ </div>
2618
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="3">
2619
+ <div class="TreeNode from-group" data-key="3">
2620
+ <span class="TreeLabel TreeLabelName">
2621
+ <span class="rioglyph rioglyph-folder-open">
2622
+ </span>
2623
+ <span class="TreeLabelNameText">
2624
+ <span class="TreeLabelNameTextHeadline">Folder 03</span>
2625
+ </span>
2626
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2627
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2628
+ </span>
2629
+ </span>
2630
+ </div>
2631
+ </div>
2632
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="4">
2633
+ <div class="TreeNode from-group" data-key="4">
2634
+ <span class="TreeLabel TreeLabelName">
2635
+ <span class="rioglyph rioglyph-folder-open">
2636
+ </span>
2637
+ <span class="TreeLabelNameText">
2638
+ <span class="TreeLabelNameTextHeadline">Folder 04</span>
2639
+ </span>
2640
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2641
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2642
+ </span>
2643
+ </span>
2644
+ </div>
2645
+ </div>
2646
+ </div>
2647
+ </div>
2648
+ </div>
2649
+ </div>
2650
+ <div>
2651
+ <div class="h6">Selected items:</div>
2652
+ <ul>
2653
+ </ul>
2654
+ <div class="h6">Expanded folders:</div>
2655
+ <ul>
2656
+ </ul>
2657
+ </div>
2658
+ </div>
2659
+ ```
2660
+
2661
+ #### Props
2662
+
2663
+ | Name | Type | Default | Description |
2664
+ | --- | --- | --- | --- |
2665
+ | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2666
+ | └id | String | — | A unique identifier of a group. |
2667
+ | └name | String | — | The name of a group. |
2668
+ | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2669
+ | └disabled | Boolean | — | Disallows the selection of the group itself. |
2670
+ | └className | String | — | Additional classes added to the group element. |
2671
+ | items | Array of Objects | [] | The list of items. |
2672
+ | └id | String | — | A unique identifier of an item. |
2673
+ | └name | string / object | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory |
2674
+ | └info | String \| Node | — | The subline of an item. |
2675
+ | └type | string | — | The primary type of the item. This is also used as the fallback icon name and refers to the name of the respective rioglyph icon (excluding the `rioglyph-` prefix). |
2676
+ | └subType | string | — | The sub type of an item which is also the name of the respective rioglyph icon without the prefix. This could be used to show a secondary paired icon like for fuel type. |
2677
+ | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2678
+ | └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g. `'truck'`), this icon will be used explicitly. If set to `undefined`, the `type` property will be used as the fallback icon. If set to `null`, no icon will be rendered, even if `type` is defined. This allows full control over the icon behavior while maintaining backward compatibility with type-based icons. |
2679
+ | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2680
+ | └className | string | — | Additional classes added to the item element. |
2681
+ | selectedGroups | Array of strings | — | List of selected group ids. |
2682
+ | selectedItems | Array of strings | — | List of selected item ids. |
2683
+ | onSelectionChange | Function | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
2684
+ | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2685
+ | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2686
+ | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2687
+ | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2688
+ | onSearchChange | Function | — | Callback for when the search value changes. |
2689
+ | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2690
+ | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2691
+ | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2692
+ | hideSummary | boolean | false | Defines whether a summary is shown. |
2693
+ | hideTreeHead | boolean | false | Defines whether the entire area below the search field is shown or not. Note: Disabling the tree head will hide the select all checkbox and the tree options as well as the tree summary. |
2694
+ | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2695
+ | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2696
+ | expandedGroups | Array of String | — | List of group ids which are expanded. |
2697
+ | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2698
+ | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2699
+ | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2700
+ | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2701
+ | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2702
+ | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2703
+ | className | String | — | Additional classes added to the wrapping element. |
2704
+
2705
+ ### Example: Tree without header and search
2706
+
2707
+ Tree without header and search
2708
+
2709
+ Folder 014
2710
+
2711
+ Folder 024
2712
+
2713
+ Folder 037
2714
+
2715
+ Folder 045
2716
+
2717
+ Selected items:
2718
+
2719
+ Expanded folders:
2720
+
2721
+ #### Summary
2722
+
2723
+ Tree without header and search
2724
+
2725
+ Folder 014
2726
+
2727
+ Folder 024
2728
+
2729
+ Folder 037
2730
+
2731
+ Folder 045
2732
+
2733
+ Selected items:
2734
+
2735
+ Expanded folders:
2736
+
2737
+ #### React (tsx)
2738
+
2739
+ ```tsx
2740
+ import { useState } from 'react';
2741
+ import { random } from 'es-toolkit/compat';
2742
+ import faker from 'faker';
2743
+
2744
+ import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
2745
+ import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
2746
+
2747
+ const folders2: TreeGroup[] = [
2748
+ {
2749
+ id: '1',
2750
+ name: 'Folder 01',
2751
+ icon: 'folder-closed',
2752
+ expandedIcon: 'folder-open',
2753
+ },
2754
+ {
2755
+ id: '2',
2756
+ name: 'Folder 02',
2757
+ icon: 'folder-closed',
2758
+ expandedIcon: 'folder-open',
2759
+ },
2760
+ {
2761
+ id: '3',
2762
+ name: 'Folder 03',
2763
+ icon: 'folder-closed',
2764
+ expandedIcon: 'folder-open',
2765
+ },
2766
+ {
2767
+ id: '4',
2768
+ name: 'Folder 04',
2769
+ icon: 'folder-closed',
2770
+ expandedIcon: 'folder-open',
2771
+ },
2772
+ ];
2773
+
2774
+ const treeItems2: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
2775
+ id: `${index}`,
2776
+ name: `${faker.random.words()} ${random(100, 999)}`,
2777
+ type: 'files',
2778
+ icon: null, // Set to "null" to omit the icon
2779
+ groupIds: [faker.random.arrayElement(folders2).id],
2780
+ }));
2781
+
2782
+ const TreeOnlyExample = () => {
2783
+ const [selectedItemIds, setSelectedItemIds] = useState<string[]>([]);
2784
+ const [expandedFolders, setExpandedFolders] = useState<string[]>([]);
2785
+
2786
+ const handleSelection = ({ items }: SelectionChangeResponse) => {
2787
+ setSelectedItemIds(items);
2788
+ };
2789
+
2790
+ const handleExpandFolder = (newExpandedFolders: string[]) => setExpandedFolders(newExpandedFolders);
2791
+
2792
+ const renderSelectedItemsOfList = (itemIds: string[], list: TreeGroup[] | TreeItem[]) => {
2793
+ return itemIds.map(selectedItemId => {
2794
+ const result = list.find(listItem => listItem.id === selectedItemId);
2795
+ if (result) {
2796
+ return <li key={selectedItemId}>{`${result.name}`}</li>;
2797
+ }
2798
+ return null;
2799
+ });
2800
+ };
2801
+
2802
+ return (
2803
+ <div className='display-flex flex-wrap gap-25 overflow-auto'>
2804
+ <div className='width-500'>
2805
+ <LabeledElement label='Tree without header and search'>
2806
+ <Tree
2807
+ groups={folders2}
2808
+ items={treeItems2}
2809
+ expandedGroups={expandedFolders}
2810
+ onExpandGroupsChange={handleExpandFolder}
2811
+ selectedItems={selectedItemIds}
2812
+ onSelectionChange={handleSelection}
2813
+ scrollHeight={300}
2814
+ hasMultiselect={false}
2815
+ hideSearch={true}
2816
+ hideTreeHead={true}
2817
+ />
2818
+ </LabeledElement>
2819
+ </div>
2820
+ <div>
2821
+ <div className='h6'>Selected items:</div>
2822
+ <ul>{renderSelectedItemsOfList(selectedItemIds, treeItems2)}</ul>
2823
+ <div className='h6'>Expanded folders:</div>
2824
+ <ul>{renderSelectedItemsOfList(expandedFolders, folders2)}</ul>
2825
+ </div>
2826
+ </div>
2827
+ );
2828
+ };
2829
+
2830
+ export default TreeOnlyExample;
2831
+ ```
2832
+
2833
+ #### HTML (html)
2834
+
2835
+ ```html
2836
+ <div class="display-flex flex-wrap gap-25 overflow-auto">
2837
+ <div class="width-500">
2838
+ <div class="LabeledElement display-flex flex-column">
2839
+ <div class="text-color-dark max-width-100pct text-size-12 display-inline-block margin-bottom-5">Tree without header and search</div>
2840
+ <div class="Tree">
2841
+ <div class="TreeHeader">
2842
+ </div>
2843
+ <div class="TreeRoot user-select-none overflow-auto" style="max-height: 300px; position: relative;">
2844
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="1">
2845
+ <div class="TreeNode from-group" data-key="1">
2846
+ <span class="TreeLabel TreeLabelName">
2847
+ <span class="rioglyph rioglyph-folder-closed">
2848
+ </span>
2849
+ <span class="TreeLabelNameText">
2850
+ <span class="TreeLabelNameTextHeadline">Folder 01</span>
2851
+ </span>
2852
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
2853
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2854
+ </span>
2855
+ </span>
2856
+ </div>
2857
+ </div>
2858
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="2">
2859
+ <div class="TreeNode from-group" data-key="2">
2860
+ <span class="TreeLabel TreeLabelName">
2861
+ <span class="rioglyph rioglyph-folder-closed">
2862
+ </span>
2863
+ <span class="TreeLabelNameText">
2864
+ <span class="TreeLabelNameTextHeadline">Folder 02</span>
2865
+ </span>
2866
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
2867
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2868
+ </span>
2869
+ </span>
2870
+ </div>
2871
+ </div>
2872
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="3">
2873
+ <div class="TreeNode from-group" data-key="3">
2874
+ <span class="TreeLabel TreeLabelName">
2875
+ <span class="rioglyph rioglyph-folder-closed">
2876
+ </span>
2877
+ <span class="TreeLabelNameText">
2878
+ <span class="TreeLabelNameTextHeadline">Folder 03</span>
2879
+ </span>
2880
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">7</span>
2881
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2882
+ </span>
2883
+ </span>
2884
+ </div>
2885
+ </div>
2886
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="4">
2887
+ <div class="TreeNode from-group" data-key="4">
2888
+ <span class="TreeLabel TreeLabelName">
2889
+ <span class="rioglyph rioglyph-folder-closed">
2890
+ </span>
2891
+ <span class="TreeLabelNameText">
2892
+ <span class="TreeLabelNameTextHeadline">Folder 04</span>
2893
+ </span>
2894
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2895
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2896
+ </span>
2897
+ </span>
2898
+ </div>
2899
+ </div>
2900
+ </div>
2901
+ </div>
2902
+ </div>
2903
+ </div>
2904
+ <div>
2905
+ <div class="h6">Selected items:</div>
2906
+ <ul>
2907
+ </ul>
2908
+ <div class="h6">Expanded folders:</div>
2909
+ <ul>
2910
+ </ul>
2911
+ </div>
2912
+ </div>
2913
+ ```
2914
+
2915
+ #### Props
2916
+
2917
+ | Name | Type | Default | Description |
2918
+ | --- | --- | --- | --- |
2919
+ | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2920
+ | └id | String | — | A unique identifier of a group. |
2921
+ | └name | String | — | The name of a group. |
2922
+ | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2923
+ | └disabled | Boolean | — | Disallows the selection of the group itself. |
2924
+ | └className | String | — | Additional classes added to the group element. |
2925
+ | items | Array of Objects | [] | The list of items. |
2926
+ | └id | String | — | A unique identifier of an item. |
2927
+ | └name | string / object | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory |
2928
+ | └info | String \| Node | — | The subline of an item. |
2929
+ | └type | string | — | The primary type of the item. This is also used as the fallback icon name and refers to the name of the respective rioglyph icon (excluding the `rioglyph-` prefix). |
2930
+ | └subType | string | — | The sub type of an item which is also the name of the respective rioglyph icon without the prefix. This could be used to show a secondary paired icon like for fuel type. |
2931
+ | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2932
+ | └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g. `'truck'`), this icon will be used explicitly. If set to `undefined`, the `type` property will be used as the fallback icon. If set to `null`, no icon will be rendered, even if `type` is defined. This allows full control over the icon behavior while maintaining backward compatibility with type-based icons. |
2933
+ | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2934
+ | └className | string | — | Additional classes added to the item element. |
2935
+ | selectedGroups | Array of strings | — | List of selected group ids. |
2936
+ | selectedItems | Array of strings | — | List of selected item ids. |
2937
+ | onSelectionChange | Function | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
2938
+ | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2939
+ | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2940
+ | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2941
+ | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2942
+ | onSearchChange | Function | — | Callback for when the search value changes. |
2943
+ | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2944
+ | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2945
+ | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2946
+ | hideSummary | boolean | false | Defines whether a summary is shown. |
2947
+ | hideTreeHead | boolean | false | Defines whether the entire area below the search field is shown or not. Note: Disabling the tree head will hide the select all checkbox and the tree options as well as the tree summary. |
2948
+ | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2949
+ | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2950
+ | expandedGroups | Array of String | — | List of group ids which are expanded. |
2951
+ | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2952
+ | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2953
+ | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2954
+ | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2955
+ | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2956
+ | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2957
+ | className | String | — | Additional classes added to the wrapping element. |
2958
+
2959
+ ## TreeSummary with assetCounts
2960
+
2961
+ ### Example: Example 7
2962
+
2963
+ 12
2964
+ 7
2965
+ 2
2966
+ 2
2967
+ 10
2968
+
2969
+ #### Summary
2970
+
2971
+ 12
2972
+ 7
2973
+ 2
2974
+ 2
2975
+ 10
2976
+
2977
+ #### React (tsx)
2978
+
2979
+ ```tsx
2980
+ import TreeSummary from '@rio-cloud/rio-uikit/TreeSummary';
2981
+
2982
+ const assetCounts = {
2983
+ truck: 12,
2984
+ trailer: 7,
2985
+ bus: 2,
2986
+ van: 2,
2987
+ driver: 10,
2988
+ };
2989
+
2990
+ const TreeSummaryExample = () => <TreeSummary assetCounts={assetCounts} gridCols={5} />;
2991
+
2992
+ export default TreeSummaryExample;
2993
+ ```
2994
+
2995
+ #### HTML (html)
2996
+
2997
+ ```html
2998
+ <div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
2999
+ <div class="TreeSummaryRow display-grid grid-cols-5 gap-10">
3000
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
3001
+ <span class="rioglyph rioglyph-truck-baseline text-size-16 margin-right-2">
3002
+ </span>
3003
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">12</span>
3004
+ </div>
3005
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
3006
+ <span class="rioglyph rioglyph-trailer-baseline text-size-16 margin-right-2">
3007
+ </span>
3008
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
3009
+ </div>
3010
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
3011
+ <span class="rioglyph rioglyph-bus-baseline text-size-16 margin-right-2">
3012
+ </span>
3013
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
3014
+ </div>
3015
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
3016
+ <span class="rioglyph rioglyph-van-baseline text-size-16 margin-right-2">
3017
+ </span>
3018
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
3019
+ </div>
3020
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
3021
+ <span class="rioglyph rioglyph-driver text-size-16 margin-right-2">
3022
+ </span>
3023
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">10</span>
3024
+ </div>
3025
+ </div>
3026
+ </div>
3027
+ ```
3028
+
3029
+ #### Props: TreeSummary
3030
+
3031
+ ### TreeSummary
3032
+
3033
+ | Name | Type | Default | Description |
3034
+ | --- | --- | --- | --- |
3035
+ | assetCounts | object | — | The object containing various asset type counter. |
3036
+ | └truck | number | — | The amount of trucks. |
3037
+ | └trailer | number | — | The amount of trailers. |
3038
+ | └bus | number | — | The amount of buses. |
3039
+ | └van | number | — | The amount of vans. |
3040
+ | └driver | number | — | The amount of drivers. |
3041
+ | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
3042
+ | className | string | — | Additional classes added to the wrapping element. |
3043
+
3044
+ #### Props: TypeCounter
3045
+
3046
+ ### TypeCounter
3047
+
3048
+ | Name | Type | Default | Description |
3049
+ | --- | --- | --- | --- |
3050
+ | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
3051
+ | icon | string | — | The icon name. Note, when using the built-in generic type counter, the icon name will the same as the item type. So make sure there is a corresponding icon for the defined type. |
3052
+ | isActive | Boolean | — | Sets the active styling if active. |
3053
+ | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
3054
+ | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
3055
+ | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
3056
+ | onClick | Function | — | Callback function when the counter is clicked. It returns the type value.Make sure the "type" prop is defined to receive the value in the callback and the flag "enableActivity" is set to true otherwise the callback is not triggered. |
3057
+ | value | String / Number / Node | — | A custom value to be shown in the counter. |
3058
+
3059
+ ## TreeSummary with TypeCounter
3060
+
3061
+ ### Example: Example 8
3062
+
3063
+ 9
3064
+ 15
3065
+
3066
+ #### Summary
3067
+
3068
+ 9
3069
+ 15
3070
+
3071
+ #### React (tsx)
3072
+
3073
+ ```tsx
3074
+ import TreeSummary from '@rio-cloud/rio-uikit/TreeSummary';
3075
+ import TypeCounter from '@rio-cloud/rio-uikit/TypeCounter';
3076
+
3077
+ const TreeSummaryCustomExample = () => (
3078
+ <TreeSummary>
3079
+ <TypeCounter icon='driver' value={9} />
3080
+ <TypeCounter icon='drivercard-out' value={15} />
3081
+ </TreeSummary>
3082
+ );
3083
+
3084
+ export default TreeSummaryCustomExample;
3085
+ ```
3086
+
3087
+ #### HTML (html)
3088
+
3089
+ ```html
3090
+ <div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
3091
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
3092
+ <span class="rioglyph rioglyph-driver text-size-16 margin-right-2">
3093
+ </span>
3094
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">9</span>
3095
+ </div>
3096
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
3097
+ <span class="rioglyph rioglyph-drivercard-out text-size-16 margin-right-2">
3098
+ </span>
3099
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">15</span>
3100
+ </div>
3101
+ </div>
3102
+ ```
3103
+
3104
+ #### Props: TreeSummary
3105
+
3106
+ ### TreeSummary
3107
+
3108
+ | Name | Type | Default | Description |
3109
+ | --- | --- | --- | --- |
3110
+ | assetCounts | object | — | The object containing various asset type counter. |
3111
+ | └truck | number | — | The amount of trucks. |
3112
+ | └trailer | number | — | The amount of trailers. |
3113
+ | └bus | number | — | The amount of buses. |
3114
+ | └van | number | — | The amount of vans. |
3115
+ | └driver | number | — | The amount of drivers. |
3116
+ | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
3117
+ | className | string | — | Additional classes added to the wrapping element. |
3118
+
3119
+ #### Props: TypeCounter
3120
+
3121
+ ### TypeCounter
3122
+
3123
+ | Name | Type | Default | Description |
3124
+ | --- | --- | --- | --- |
3125
+ | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
3126
+ | icon | string | — | The icon name. Note, when using the built-in generic type counter, the icon name will the same as the item type. So make sure there is a corresponding icon for the defined type. |
3127
+ | isActive | Boolean | — | Sets the active styling if active. |
3128
+ | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
3129
+ | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
3130
+ | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
3131
+ | onClick | Function | — | Callback function when the counter is clicked. It returns the type value.Make sure the "type" prop is defined to receive the value in the callback and the flag "enableActivity" is set to true otherwise the callback is not triggered. |
3132
+ | value | String / Number / Node | — | A custom value to be shown in the counter. |