@rio-cloud/uikit-mcp 1.1.2 → 1.1.4

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 (191) hide show
  1. package/dist/doc-metadata.json +117 -127
  2. package/dist/docs/components/accentBar.md +2 -34
  3. package/dist/docs/components/activity.md +2 -13
  4. package/dist/docs/components/animatedNumber.md +4 -17
  5. package/dist/docs/components/animatedTextReveal.md +7 -54
  6. package/dist/docs/components/animations.md +42 -34
  7. package/dist/docs/components/appHeader.md +2 -73
  8. package/dist/docs/components/appLayout.md +36 -496
  9. package/dist/docs/components/appNavigationBar.md +2 -54
  10. package/dist/docs/components/areaCharts.md +37 -37
  11. package/dist/docs/components/aspectRatioPlaceholder.md +2 -11
  12. package/dist/docs/components/assetTree.md +435 -901
  13. package/dist/docs/components/autosuggests.md +4 -4
  14. package/dist/docs/components/avatar.md +2 -24
  15. package/dist/docs/components/banner.md +2 -2
  16. package/dist/docs/components/barCharts.md +186 -186
  17. package/dist/docs/components/barList.md +12 -46
  18. package/dist/docs/components/basicMap.md +7 -7
  19. package/dist/docs/components/bottomSheet.md +3 -100
  20. package/dist/docs/components/button.md +16 -71
  21. package/dist/docs/components/buttonToolbar.md +2 -9
  22. package/dist/docs/components/calendarStripe.md +95 -121
  23. package/dist/docs/components/card.md +2 -10
  24. package/dist/docs/components/carousel.md +1 -1
  25. package/dist/docs/components/chartColors.md +1 -1
  26. package/dist/docs/components/chartsGettingStarted.md +1 -1
  27. package/dist/docs/components/chat.md +4 -1
  28. package/dist/docs/components/checkbox.md +11 -111
  29. package/dist/docs/components/clearableInput.md +7 -111
  30. package/dist/docs/components/collapse.md +3 -29
  31. package/dist/docs/components/composedCharts.md +31 -31
  32. package/dist/docs/components/contentLoader.md +104 -122
  33. package/dist/docs/components/dataTabs.md +24 -194
  34. package/dist/docs/components/datepickers.md +727 -769
  35. package/dist/docs/components/dialogs.md +15 -262
  36. package/dist/docs/components/divider.md +2 -14
  37. package/dist/docs/components/dropdowns.md +4387 -4550
  38. package/dist/docs/components/editableContent.md +2 -186
  39. package/dist/docs/components/expander.md +23 -70
  40. package/dist/docs/components/fade.md +6 -41
  41. package/dist/docs/components/fadeExpander.md +2 -11
  42. package/dist/docs/components/fadeUp.md +3 -23
  43. package/dist/docs/components/feedback.md +2 -42
  44. package/dist/docs/components/filePickers.md +2 -44
  45. package/dist/docs/components/formLabel.md +2 -18
  46. package/dist/docs/components/groupedItemList.md +2 -53
  47. package/dist/docs/components/iconList.md +3 -3
  48. package/dist/docs/components/imagePreloader.md +2 -6
  49. package/dist/docs/components/labeledElement.md +2 -11
  50. package/dist/docs/components/licensePlate.md +2 -10
  51. package/dist/docs/components/lineCharts.md +60 -60
  52. package/dist/docs/components/listMenu.md +2 -50
  53. package/dist/docs/components/loadMore.md +2 -28
  54. package/dist/docs/components/mainNavigation.md +1 -1
  55. package/dist/docs/components/mapCircle.md +3 -3
  56. package/dist/docs/components/mapCluster.md +5 -5
  57. package/dist/docs/components/mapContext.md +3 -3
  58. package/dist/docs/components/mapDraggableMarker.md +3 -3
  59. package/dist/docs/components/mapGettingStarted.md +1 -1
  60. package/dist/docs/components/mapInfoBubble.md +3 -3
  61. package/dist/docs/components/mapLayerGroup.md +3 -3
  62. package/dist/docs/components/mapMarker.md +341 -347
  63. package/dist/docs/components/mapPolygon.md +20 -24
  64. package/dist/docs/components/mapRoute.md +26 -32
  65. package/dist/docs/components/mapRouteGenerator.md +1 -1
  66. package/dist/docs/components/mapSettings.md +273 -284
  67. package/dist/docs/components/mapUtils.md +3 -5
  68. package/dist/docs/components/multiselects.md +1 -1
  69. package/dist/docs/components/noData.md +2 -22
  70. package/dist/docs/components/notifications.md +1 -1
  71. package/dist/docs/components/numbercontrol.md +2 -48
  72. package/dist/docs/components/onboarding.md +2 -46
  73. package/dist/docs/components/page.md +2 -32
  74. package/dist/docs/components/pager.md +2 -14
  75. package/dist/docs/components/pieCharts.md +125 -157
  76. package/dist/docs/components/popover.md +2 -56
  77. package/dist/docs/components/position.md +2 -10
  78. package/dist/docs/components/radialBarCharts.md +506 -506
  79. package/dist/docs/components/radiobutton.md +81 -191
  80. package/dist/docs/components/releaseNotes.md +1 -12
  81. package/dist/docs/components/resizer.md +2 -14
  82. package/dist/docs/components/responsiveColumnStripe.md +2 -19
  83. package/dist/docs/components/responsiveVideo.md +2 -11
  84. package/dist/docs/components/rioglyph.md +2 -12
  85. package/dist/docs/components/rules.md +69 -133
  86. package/dist/docs/components/saveableInput.md +279 -393
  87. package/dist/docs/components/selects.md +9996 -15
  88. package/dist/docs/components/sidebar.md +2 -39
  89. package/dist/docs/components/sliders.md +2 -37
  90. package/dist/docs/components/smoothScrollbars.md +2 -56
  91. package/dist/docs/components/spinners.md +5 -51
  92. package/dist/docs/components/states.md +21 -245
  93. package/dist/docs/components/statsWidgets.md +2 -113
  94. package/dist/docs/components/statusBar.md +2 -28
  95. package/dist/docs/components/stepButton.md +2 -8
  96. package/dist/docs/components/steppedProgressBars.md +2 -66
  97. package/dist/docs/components/subNavigation.md +1 -8
  98. package/dist/docs/components/supportMarker.md +1 -1
  99. package/dist/docs/components/svgImage.md +2 -12
  100. package/dist/docs/components/switch.md +2 -11
  101. package/dist/docs/components/tables.md +1 -1
  102. package/dist/docs/components/tagManager.md +4 -58
  103. package/dist/docs/components/tags.md +2 -31
  104. package/dist/docs/components/teaser.md +2 -30
  105. package/dist/docs/components/timeline.md +1 -1
  106. package/dist/docs/components/timepicker.md +2 -26
  107. package/dist/docs/components/toggleButton.md +7 -29
  108. package/dist/docs/components/tooltip.md +9 -40
  109. package/dist/docs/components/virtualList.md +73 -99
  110. package/dist/docs/foundations.md +167 -167
  111. package/dist/docs/start/changelog.md +23 -1
  112. package/dist/docs/start/goodtoknow.md +1 -1
  113. package/dist/docs/start/guidelines/color-combinations.md +1 -1
  114. package/dist/docs/start/guidelines/custom-css.md +1 -1
  115. package/dist/docs/start/guidelines/custom-rioglyph.md +1 -1
  116. package/dist/docs/start/guidelines/formatting.md +1 -1
  117. package/dist/docs/start/guidelines/iframe.md +80 -27
  118. package/dist/docs/start/guidelines/obfuscate-data.md +1 -1
  119. package/dist/docs/start/guidelines/print-css.md +1 -1
  120. package/dist/docs/start/guidelines/spinner.md +81 -81
  121. package/dist/docs/start/guidelines/supported-browsers.md +1 -1
  122. package/dist/docs/start/guidelines/writing.md +1 -1
  123. package/dist/docs/start/howto.md +9 -9
  124. package/dist/docs/start/intro.md +1 -1
  125. package/dist/docs/start/responsiveness.md +1 -1
  126. package/dist/docs/templates/common-table.md +11 -11
  127. package/dist/docs/templates/detail-views.md +2 -2
  128. package/dist/docs/templates/expandable-details.md +1 -1
  129. package/dist/docs/templates/feature-cards.md +55 -55
  130. package/dist/docs/templates/form-summary.md +22 -22
  131. package/dist/docs/templates/form-toggle.md +1 -1
  132. package/dist/docs/templates/list-blocks.md +200 -200
  133. package/dist/docs/templates/loading-progress.md +3 -3
  134. package/dist/docs/templates/options-panel.md +1 -1
  135. package/dist/docs/templates/panel-variants.md +1 -1
  136. package/dist/docs/templates/progress-cards.md +1 -1
  137. package/dist/docs/templates/progress-success.md +1 -1
  138. package/dist/docs/templates/settings-form.md +23 -23
  139. package/dist/docs/templates/stats-blocks.md +41 -41
  140. package/dist/docs/templates/table-panel.md +1 -1
  141. package/dist/docs/templates/table-row-animation.md +1 -1
  142. package/dist/docs/templates/usage-cards.md +1 -1
  143. package/dist/docs/utilities/deviceUtils.md +6 -3
  144. package/dist/docs/utilities/featureToggles.md +1 -1
  145. package/dist/docs/utilities/fuelTypeUtils.md +1 -1
  146. package/dist/docs/utilities/routeUtils.md +59 -23
  147. package/dist/docs/utilities/useAfterMount.md +1 -1
  148. package/dist/docs/utilities/useAutoAnimate.md +1 -1
  149. package/dist/docs/utilities/useAverage.md +1 -1
  150. package/dist/docs/utilities/useClickOutside.md +1 -1
  151. package/dist/docs/utilities/useClipboard.md +2 -2
  152. package/dist/docs/utilities/useCount.md +1 -1
  153. package/dist/docs/utilities/useDarkMode.md +1 -1
  154. package/dist/docs/utilities/useDebugInfo.md +4 -4
  155. package/dist/docs/utilities/useEffectOnce.md +1 -1
  156. package/dist/docs/utilities/useElapsedTime.md +1 -1
  157. package/dist/docs/utilities/useElementSize.md +1 -1
  158. package/dist/docs/utilities/useEsc.md +1 -1
  159. package/dist/docs/utilities/useEvent.md +1 -1
  160. package/dist/docs/utilities/useFocusTrap.md +1 -1
  161. package/dist/docs/utilities/useFullscreen.md +1 -1
  162. package/dist/docs/utilities/useHover.md +1 -1
  163. package/dist/docs/utilities/useIncomingPostMessages.md +1 -1
  164. package/dist/docs/utilities/useInterval.md +1 -1
  165. package/dist/docs/utilities/useIsFocusWithin.md +1 -1
  166. package/dist/docs/utilities/useKey.md +7 -5
  167. package/dist/docs/utilities/useLocalStorage.md +1 -1
  168. package/dist/docs/utilities/useLocationSuggestions.md +1 -1
  169. package/dist/docs/utilities/useMax.md +1 -1
  170. package/dist/docs/utilities/useMin.md +1 -1
  171. package/dist/docs/utilities/useMutationObserver.md +1 -1
  172. package/dist/docs/utilities/useOnScreen.md +1 -1
  173. package/dist/docs/utilities/useOnlineStatus.md +1 -1
  174. package/dist/docs/utilities/usePostMessage.md +2 -2
  175. package/dist/docs/utilities/usePostMessageSender.md +1 -1
  176. package/dist/docs/utilities/usePrevious.md +1 -1
  177. package/dist/docs/utilities/useResizeObserver.md +1 -1
  178. package/dist/docs/utilities/useScrollPosition.md +1 -1
  179. package/dist/docs/utilities/useSearch.md +1 -1
  180. package/dist/docs/utilities/useSorting.md +1 -1
  181. package/dist/docs/utilities/useStateWithValidation.md +1 -1
  182. package/dist/docs/utilities/useSum.md +1 -1
  183. package/dist/docs/utilities/useTableExport.md +54 -54
  184. package/dist/docs/utilities/useTableSelection.md +93 -93
  185. package/dist/docs/utilities/useTimeout.md +1 -1
  186. package/dist/docs/utilities/useToggle.md +1 -1
  187. package/dist/docs/utilities/useWindowResize.md +1 -1
  188. package/dist/index.mjs +8 -2
  189. package/dist/version.json +2 -2
  190. package/package.json +8 -8
  191. package/dist/docs/components/fullscreenMap.md +0 -10
@@ -3,9 +3,7 @@
3
3
  *Category:* Components
4
4
  *Section:* Selection
5
5
  *Source:* https://uikit.developers.rio.cloud/#components/assetTree
6
- *Captured:* 2025-12-15T15:02:27.564Z
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.
6
+ *Captured:* 2026-01-14T09:07:18.454Z
9
7
 
10
8
  ## AssetTree
11
9
 
@@ -13,36 +11,36 @@ The asset tree components are using labels that need to be defined from the outs
13
11
 
14
12
  Filter
15
13
 
16
- 5413
14
+ 5495
17
15
  4
18
16
 
19
- Group - Abel Botsford - 848515
17
+ Group - Aaron Mohr - 86039
20
18
 
21
- Group - Ada O'Keefe IV - 40215
19
+ Group - Adrian O'Hara - 439811
22
20
 
23
- Group - Albert Kulas - 345412
21
+ Group - Adrienne Schaden - 479210
24
22
 
25
- Group - Alberta Runolfsdottir - 878116
23
+ Group - Al Goldner - 873914
26
24
 
27
- Group - Alexander Johns - 72049
25
+ Group - Albert King - 98799
28
26
 
29
- Group - Alexandra Jenkins Jr. - 462611
27
+ Group - Alberta Hilpert-Walter - 88645
30
28
 
31
- Group - Alfonso Runte - 64749
29
+ Group - Alberta Shields - 35378
32
30
 
33
- Group - Alice Ferry Jr. - 32587
31
+ Group - Alberto Kohler - 649411
34
32
 
35
- Group - Alison Luettgen - 641912
33
+ Group - Alberto O'Keefe-Connelly - 37468
36
34
 
37
- Group - Alonzo Ratke - 810014
35
+ Group - Alberto Schultz Jr. - 66257
38
36
 
39
- Group - Alton Mueller - 81233
37
+ Group - Alex Johnson - 42376
40
38
 
41
- Group - Alyssa Walsh - 25789
39
+ Group - Alexandra Smith - 303812
42
40
 
43
- Group - Amanda Heaney - 34019
41
+ Group - Alexandra Volkman-Huels - 20898
44
42
 
45
- Group - Amanda Klocko - 940415
43
+ Group - Alonzo Runte - 23058
46
44
 
47
45
  200
48
46
 
@@ -70,36 +68,36 @@ Asset type filter:
70
68
 
71
69
  Filter
72
70
 
73
- 5413
71
+ 5495
74
72
  4
75
73
 
76
- Group - Abel Botsford - 848515
74
+ Group - Aaron Mohr - 86039
77
75
 
78
- Group - Ada O'Keefe IV - 40215
76
+ Group - Adrian O'Hara - 439811
79
77
 
80
- Group - Albert Kulas - 345412
78
+ Group - Adrienne Schaden - 479210
81
79
 
82
- Group - Alberta Runolfsdottir - 878116
80
+ Group - Al Goldner - 873914
83
81
 
84
- Group - Alexander Johns - 72049
82
+ Group - Albert King - 98799
85
83
 
86
- Group - Alexandra Jenkins Jr. - 462611
84
+ Group - Alberta Hilpert-Walter - 88645
87
85
 
88
- Group - Alfonso Runte - 64749
86
+ Group - Alberta Shields - 35378
89
87
 
90
- Group - Alice Ferry Jr. - 32587
88
+ Group - Alberto Kohler - 649411
91
89
 
92
- Group - Alison Luettgen - 641912
90
+ Group - Alberto O'Keefe-Connelly - 37468
93
91
 
94
- Group - Alonzo Ratke - 810014
92
+ Group - Alberto Schultz Jr. - 66257
95
93
 
96
- Group - Alton Mueller - 81233
94
+ Group - Alex Johnson - 42376
97
95
 
98
- Group - Alyssa Walsh - 25789
96
+ Group - Alexandra Smith - 303812
99
97
 
100
- Group - Amanda Heaney - 34019
98
+ Group - Alexandra Volkman-Huels - 20898
101
99
 
102
- Group - Amanda Klocko - 940415
100
+ Group - Alonzo Runte - 23058
103
101
 
104
102
  200
105
103
 
@@ -128,7 +126,7 @@ Asset type filter:
128
126
  ```tsx
129
127
  import { useState } from 'react';
130
128
  import { get, isEmpty, isObject, random } from 'es-toolkit/compat';
131
- import faker from 'faker';
129
+ import { faker } from '@faker-js/faker';
132
130
 
133
131
  import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
134
132
  import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
@@ -151,8 +149,8 @@ const CATEGORY_LOREM = 'lorem';
151
149
  const randomDrivers = Array.from({ length: 200 }, (_, index) => ({
152
150
  id: `74e8eb86-18a1-4abe-90cb-aeee7909f85${index}`,
153
151
  name: {
154
- firstName: faker.internet.userName(),
155
- lastName: faker.name.firstName(),
152
+ firstName: faker.internet.username(),
153
+ lastName: faker.person.firstName(),
156
154
  },
157
155
  type: 'driver',
158
156
  }));
@@ -160,7 +158,7 @@ const randomDrivers = Array.from({ length: 200 }, (_, index) => ({
160
158
  const getTruckGroups = (): TreeGroup[] => {
161
159
  const groups = Array.from({ length: random(400, 600) }, (_, index) => ({
162
160
  id: `group-${index}`,
163
- name: `Group - ${faker.name.findName()} - ${random(1000, 9999)}`,
161
+ name: `Group - ${faker.person.fullName()} - ${random(1000, 9999)}`,
164
162
  }));
165
163
  return [
166
164
  ...groups,
@@ -230,7 +228,7 @@ const getTrucks = (namePrefix = 'Vehicle-'): TreeItem[] => {
230
228
  name: `${namePrefix}${random(1000, 9999)}`,
231
229
  info: `M-AN 1${String(index).padStart(3, '0')}`,
232
230
  type: 'truck',
233
- groupIds: [faker.random.arrayElement(groups).id],
231
+ groupIds: [faker.helpers.arrayElement(groups).id],
234
232
  }));
235
233
  return [...randomTrucks, ...trailer];
236
234
  };
@@ -468,173 +466,35 @@ const AssetTreeExample = () => {
468
466
  export default AssetTreeExample;
469
467
  ```
470
468
 
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
469
  ## AssetTree with single select
611
470
 
612
471
  ### Example: Example 2
613
472
 
614
- 10
473
+ 6
474
+ 11
615
475
  7
616
- 3
617
- 10
476
+ 6
618
477
 
619
- My Empty Group4
478
+ My Empty Group2
620
479
 
621
480
  Truck Group East5
622
481
 
623
- Truck Group North8
624
- N18-G101 / M-AN 1020
625
- N18-G103 / M-AN 1023
626
- N18-G324 / M-AN 1025
627
- N18-G330 / M-AN 1000
628
- N18-G508 / M-AN 1005
629
- N18-G609 / M-AN 1024
630
- N18-G747 / M-AN 1003
631
- N18-G997 / M-AN 1010
482
+ Truck Group North9
483
+ N18-G262 / M-AN 1028
484
+ N18-G300 / M-AN 1018
485
+ N18-G399 / M-AN 1005
486
+ N18-G458 / M-AN 1026
487
+ N18-G467 / M-AN 1013
488
+ N18-G489 / M-AN 1011
489
+ N18-G728 / M-AN 1019
490
+ N18-G796 / M-AN 1022
491
+ N18-G815 / M-AN 1016
632
492
 
633
- Truck Group South3
493
+ Truck Group South4
634
494
 
635
- Truck Group West6
495
+ Truck Group West4
636
496
 
637
- All my unassigned Trucks4
497
+ All my unassigned Trucks6
638
498
 
639
499
  Current category:
640
500
  assets
@@ -647,30 +507,31 @@ Truck Group North
647
507
 
648
508
  #### Summary
649
509
 
650
- 10
510
+ 6
511
+ 11
651
512
  7
652
- 3
653
- 10
513
+ 6
654
514
 
655
- My Empty Group4
515
+ My Empty Group2
656
516
 
657
517
  Truck Group East5
658
518
 
659
- Truck Group North8
660
- N18-G101 / M-AN 1020
661
- N18-G103 / M-AN 1023
662
- N18-G324 / M-AN 1025
663
- N18-G330 / M-AN 1000
664
- N18-G508 / M-AN 1005
665
- N18-G609 / M-AN 1024
666
- N18-G747 / M-AN 1003
667
- N18-G997 / M-AN 1010
519
+ Truck Group North9
520
+ N18-G262 / M-AN 1028
521
+ N18-G300 / M-AN 1018
522
+ N18-G399 / M-AN 1005
523
+ N18-G458 / M-AN 1026
524
+ N18-G467 / M-AN 1013
525
+ N18-G489 / M-AN 1011
526
+ N18-G728 / M-AN 1019
527
+ N18-G796 / M-AN 1022
528
+ N18-G815 / M-AN 1016
668
529
 
669
- Truck Group South3
530
+ Truck Group South4
670
531
 
671
- Truck Group West6
532
+ Truck Group West4
672
533
 
673
- All my unassigned Trucks4
534
+ All my unassigned Trucks6
674
535
 
675
536
  Current category:
676
537
  assets
@@ -686,7 +547,7 @@ Truck Group North
686
547
  ```tsx
687
548
  import { useState } from 'react';
688
549
  import { isEmpty, isObject, random } from 'es-toolkit/compat';
689
- import faker from 'faker';
550
+ import { faker } from '@faker-js/faker';
690
551
 
691
552
  import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
692
553
  import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
@@ -733,8 +594,8 @@ const assetTypes = ['truck', 'bus', 'van', 'trailer'];
733
594
  const assets = Array.from({ length: 30 }, (_, index) => ({
734
595
  id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
735
596
  name: `N18-G${random(100, 999)} / M-AN 1${String(index).padStart(3, '0')}`,
736
- type: faker.random.arrayElement(assetTypes),
737
- groupIds: [faker.random.arrayElement(assetGroups).id],
597
+ type: faker.helpers.arrayElement(assetTypes),
598
+ groupIds: [faker.helpers.arrayElement(assetGroups).id],
738
599
  }));
739
600
 
740
601
  const AssetTreeSingleSelectExample = () => {
@@ -867,24 +728,24 @@ export default AssetTreeSingleSelectExample;
867
728
  <div class="display-flex justify-content-between align-items-start width-100pct">
868
729
  <div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
869
730
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
870
- <span class="rioglyph rioglyph-truck text-size-16 margin-right-2">
731
+ <span class="rioglyph rioglyph-trailer text-size-16 margin-right-2">
871
732
  </span>
872
- <span class="TreeLabelCount label label-condensed label-muted label-filled">10</span>
733
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">6</span>
873
734
  </div>
874
735
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
875
736
  <span class="rioglyph rioglyph-van text-size-16 margin-right-2">
876
737
  </span>
877
- <span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
738
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">11</span>
878
739
  </div>
879
740
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
880
- <span class="rioglyph rioglyph-trailer text-size-16 margin-right-2">
741
+ <span class="rioglyph rioglyph-truck text-size-16 margin-right-2">
881
742
  </span>
882
- <span class="TreeLabelCount label label-condensed label-muted label-filled">3</span>
743
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
883
744
  </div>
884
745
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
885
746
  <span class="rioglyph rioglyph-bus text-size-16 margin-right-2">
886
747
  </span>
887
- <span class="TreeLabelCount label label-condensed label-muted label-filled">10</span>
748
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">6</span>
888
749
  </div>
889
750
  </div>
890
751
  </div>
@@ -897,7 +758,7 @@ export default AssetTreeSingleSelectExample;
897
758
  <span class="TreeLabelNameText">
898
759
  <span class="TreeLabelNameTextHeadline">My Empty Group</span>
899
760
  </span>
900
- <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
761
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">2</span>
901
762
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
902
763
  </span>
903
764
  </span>
@@ -921,80 +782,89 @@ export default AssetTreeSingleSelectExample;
921
782
  <span class="TreeLabelNameText">
922
783
  <span class="TreeLabelNameTextHeadline">Truck Group North</span>
923
784
  </span>
924
- <span class="TreeLabelCount label label-muted label-filled label-condensed">8</span>
785
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">9</span>
925
786
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
926
787
  </span>
927
788
  </span>
928
789
  </div>
929
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9720">
790
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9728">
930
791
  <span class="TreeLabel TreeLabelName">
931
- <span class="rioglyph rioglyph-truck">
792
+ <span class="rioglyph rioglyph-trailer">
932
793
  </span>
933
794
  <span class="TreeLabelNameText">
934
- <span class="TreeLabelNameTextHeadline">N18-G101 / M-AN 1020</span>
795
+ <span class="TreeLabelNameTextHeadline">N18-G262 / M-AN 1028</span>
935
796
  </span>
936
797
  </span>
937
798
  </div>
938
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9723">
799
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9718">
800
+ <span class="TreeLabel TreeLabelName">
801
+ <span class="rioglyph rioglyph-van">
802
+ </span>
803
+ <span class="TreeLabelNameText">
804
+ <span class="TreeLabelNameTextHeadline">N18-G300 / M-AN 1018</span>
805
+ </span>
806
+ </span>
807
+ </div>
808
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d975">
939
809
  <span class="TreeLabel TreeLabelName">
940
810
  <span class="rioglyph rioglyph-truck">
941
811
  </span>
942
812
  <span class="TreeLabelNameText">
943
- <span class="TreeLabelNameTextHeadline">N18-G103 / M-AN 1023</span>
813
+ <span class="TreeLabelNameTextHeadline">N18-G399 / M-AN 1005</span>
944
814
  </span>
945
815
  </span>
946
816
  </div>
947
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9725">
817
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9726">
948
818
  <span class="TreeLabel TreeLabelName">
949
- <span class="rioglyph rioglyph-bus">
819
+ <span class="rioglyph rioglyph-van">
950
820
  </span>
951
821
  <span class="TreeLabelNameText">
952
- <span class="TreeLabelNameTextHeadline">N18-G324 / M-AN 1025</span>
822
+ <span class="TreeLabelNameTextHeadline">N18-G458 / M-AN 1026</span>
953
823
  </span>
954
824
  </span>
955
825
  </div>
956
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d970">
826
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9713">
957
827
  <span class="TreeLabel TreeLabelName">
958
828
  <span class="rioglyph rioglyph-truck">
959
829
  </span>
960
830
  <span class="TreeLabelNameText">
961
- <span class="TreeLabelNameTextHeadline">N18-G330 / M-AN 1000</span>
831
+ <span class="TreeLabelNameTextHeadline">N18-G467 / M-AN 1013</span>
962
832
  </span>
963
833
  </span>
964
834
  </div>
965
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d975">
835
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9711">
966
836
  <span class="TreeLabel TreeLabelName">
967
- <span class="rioglyph rioglyph-trailer">
837
+ <span class="rioglyph rioglyph-van">
968
838
  </span>
969
839
  <span class="TreeLabelNameText">
970
- <span class="TreeLabelNameTextHeadline">N18-G508 / M-AN 1005</span>
840
+ <span class="TreeLabelNameTextHeadline">N18-G489 / M-AN 1011</span>
971
841
  </span>
972
842
  </span>
973
843
  </div>
974
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9724">
844
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9719">
975
845
  <span class="TreeLabel TreeLabelName">
976
- <span class="rioglyph rioglyph-bus">
846
+ <span class="rioglyph rioglyph-van">
977
847
  </span>
978
848
  <span class="TreeLabelNameText">
979
- <span class="TreeLabelNameTextHeadline">N18-G609 / M-AN 1024</span>
849
+ <span class="TreeLabelNameTextHeadline">N18-G728 / M-AN 1019</span>
980
850
  </span>
981
851
  </span>
982
852
  </div>
983
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d973">
853
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9722">
984
854
  <span class="TreeLabel TreeLabelName">
985
- <span class="rioglyph rioglyph-van">
855
+ <span class="rioglyph rioglyph-bus">
986
856
  </span>
987
857
  <span class="TreeLabelNameText">
988
- <span class="TreeLabelNameTextHeadline">N18-G747 / M-AN 1003</span>
858
+ <span class="TreeLabelNameTextHeadline">N18-G796 / M-AN 1022</span>
989
859
  </span>
990
860
  </span>
991
861
  </div>
992
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9710">
862
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9716">
993
863
  <span class="TreeLabel TreeLabelName">
994
864
  <span class="rioglyph rioglyph-bus">
995
865
  </span>
996
866
  <span class="TreeLabelNameText">
997
- <span class="TreeLabelNameTextHeadline">N18-G997 / M-AN 1010</span>
867
+ <span class="TreeLabelNameTextHeadline">N18-G815 / M-AN 1016</span>
998
868
  </span>
999
869
  </span>
1000
870
  </div>
@@ -1005,7 +875,7 @@ export default AssetTreeSingleSelectExample;
1005
875
  <span class="TreeLabelNameText">
1006
876
  <span class="TreeLabelNameTextHeadline">Truck Group South</span>
1007
877
  </span>
1008
- <span class="TreeLabelCount label label-muted label-filled label-condensed">3</span>
878
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
1009
879
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1010
880
  </span>
1011
881
  </span>
@@ -1017,7 +887,7 @@ export default AssetTreeSingleSelectExample;
1017
887
  <span class="TreeLabelNameText">
1018
888
  <span class="TreeLabelNameTextHeadline">Truck Group West</span>
1019
889
  </span>
1020
- <span class="TreeLabelCount label label-muted label-filled label-condensed">6</span>
890
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
1021
891
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1022
892
  </span>
1023
893
  </span>
@@ -1029,7 +899,7 @@ export default AssetTreeSingleSelectExample;
1029
899
  <span class="TreeLabelNameText">
1030
900
  <span class="TreeLabelNameTextHeadline">All my unassigned Trucks</span>
1031
901
  </span>
1032
- <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
902
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">6</span>
1033
903
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1034
904
  </span>
1035
905
  </span>
@@ -1070,172 +940,33 @@ export default AssetTreeSingleSelectExample;
1070
940
  </div>
1071
941
  ```
1072
942
 
1073
- #### Props: AssetTree
1074
-
1075
- ### AssetTree
1076
-
1077
- | Name | Type | Default | Description |
1078
- | --- | --- | --- | --- |
1079
- | fly | boolean | false | Defines if the component will overlap the body content. |
1080
- | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
1081
- | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
1082
- | bordered | boolean | false | Defines whether the component has a border or not. |
1083
- | 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. |
1084
- | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
1085
- | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
1086
- | height | number | — | Defines the height of the component in px. |
1087
- | isOpen | boolean | true | Defines whether the component is open or not. |
1088
- | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
1089
- | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
1090
- | onCategoryChange | Function | () => {} | Callback for handling change of category. |
1091
- | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
1092
- | className | String | — | Additional classes added on the wrapper element. |
1093
- | children | TreeCategory | — | A list of TreeCategory components |
1094
-
1095
- #### Props: TreeCategory
1096
-
1097
- ### TreeCategory
1098
-
1099
- | Name | Type | Default | Description |
1100
- | --- | --- | --- | --- |
1101
- | id | String | — | A unique identifier for that category. |
1102
- | icon | String | — | The rioglyph icon name for that category. |
1103
- | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
1104
- | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
1105
-
1106
- #### Props: Tree
1107
-
1108
- ### Tree
1109
-
1110
- | Name | Type | Default | Description |
1111
- | --- | --- | --- | --- |
1112
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
1113
- | └id | String | — | A unique identifier of a group. |
1114
- | └name | String | — | The name of a group. |
1115
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
1116
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
1117
- | └className | String | — | Additional classes added to the group element. |
1118
- | items | Array of Objects | [] | The list of items. |
1119
- | └id | String | — | A unique identifier of an item. |
1120
- | └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 |
1121
- | └info | String \| Node | — | The subline of an item. |
1122
- | └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). |
1123
- | └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. |
1124
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
1125
- | └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. |
1126
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
1127
- | └className | string | — | Additional classes added to the item element. |
1128
- | selectedGroups | Array of strings | — | List of selected group ids. |
1129
- | selectedItems | Array of strings | — | List of selected item ids. |
1130
- | 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: [] } |
1131
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
1132
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
1133
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
1134
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
1135
- | onSearchChange | Function | — | Callback for when the search value changes. |
1136
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
1137
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
1138
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
1139
- | hideSummary | boolean | false | Defines whether a summary is shown. |
1140
- | 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. |
1141
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
1142
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
1143
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
1144
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
1145
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
1146
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
1147
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
1148
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
1149
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
1150
- | className | String | — | Additional classes added to the wrapping element. |
1151
-
1152
- #### Props: TreeSearch
1153
-
1154
- ### TreeSearch
1155
-
1156
- | Name | Type | Default | Description |
1157
- | --- | --- | --- | --- |
1158
- | value | String | — | The search value to be shown and used for the search. |
1159
- | onChange | Function | () => {} | Callback for when the search value changes. |
1160
- | placeholder | String | — | The placeholder text used for the input field. |
1161
- | className | String | — | Additional classes added to the wrapping element. |
1162
-
1163
- #### Props: TreeSummary
1164
-
1165
- ### TreeSummary
1166
-
1167
- | Name | Type | Default | Description |
1168
- | --- | --- | --- | --- |
1169
- | assetCounts | object | — | The object containing various asset type counter. |
1170
- | └truck | number | — | The amount of trucks. |
1171
- | └trailer | number | — | The amount of trailers. |
1172
- | └bus | number | — | The amount of buses. |
1173
- | └van | number | — | The amount of vans. |
1174
- | └driver | number | — | The amount of drivers. |
1175
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
1176
- | className | string | — | Additional classes added to the wrapping element. |
1177
-
1178
- #### Props: TreeSummaryRow
1179
-
1180
- ### TreeSummaryRow
1181
-
1182
- | Name | Type | Default | Description |
1183
- | --- | --- | --- | --- |
1184
- | 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. |
1185
-
1186
- #### Props: TypeCounter
1187
-
1188
- ### TypeCounter
1189
-
1190
- | Name | Type | Default | Description |
1191
- | --- | --- | --- | --- |
1192
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
1193
- | 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. |
1194
- | isActive | Boolean | — | Sets the active styling if active. |
1195
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
1196
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
1197
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
1198
- | 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. |
1199
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
1200
-
1201
- #### Props: TreeOption
1202
-
1203
- ### TreeOption
1204
-
1205
- | Name | Type | Default | Description |
1206
- | --- | --- | --- | --- |
1207
- | isChecked | boolean | — | Defines whether the option is set. |
1208
- | label | string / node | — | The label for the option. |
1209
- | onChange | Function | — | Callback triggered when option is selected. |
1210
- | className | string | — | Additional classes added to the wrapping element. |
1211
-
1212
943
  ## AssetTree with multiple asset filter in summary
1213
944
 
1214
- 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.
1215
-
1216
945
  ### Example: Example 3
1217
946
 
1218
- 8
1219
- 6
1220
- 2
947
+ 5
1221
948
  4
949
+ 4
950
+ 7
1222
951
 
1223
952
  8
1224
953
  5
1225
- 4
1226
954
  2
1227
- 1
955
+ 2
956
+ 3
1228
957
 
1229
- Mixed Vehicles7
1230
- Vehicle-1093Debug: electric
1231
- Vehicle-1580Debug: heavy_fuel_oil
1232
- Vehicle-3686Debug: gas
1233
- Vehicle-4687Debug: gas
1234
- Vehicle-6053Debug: diesel
1235
- Vehicle-6103Debug: cng
1236
- Vehicle-6758Debug: hydrogen
958
+ Mixed Vehicles9
959
+ Vehicle-2340Debug: cng
960
+ Vehicle-3222Debug: electric
961
+ Vehicle-3383Debug: heavy_fuel_oil
962
+ Vehicle-3519Debug: lpg
963
+ Vehicle-3837Debug: gas
964
+ Vehicle-4670Debug: dual_fuel_diesel_cng
965
+ Vehicle-6233Debug: cng
966
+ Vehicle-7297Debug: electric
967
+ Vehicle-8794Debug: dual_fuel_diesel_cng
1237
968
 
1238
- Ungrouped13
969
+ Ungrouped11
1239
970
 
1240
971
  Selected groups:
1241
972
 
@@ -1246,27 +977,29 @@ Mixed Vehicles
1246
977
 
1247
978
  #### Summary
1248
979
 
1249
- 8
1250
- 6
1251
- 2
980
+ 5
1252
981
  4
982
+ 4
983
+ 7
1253
984
 
1254
985
  8
1255
986
  5
1256
- 4
1257
987
  2
1258
- 1
988
+ 2
989
+ 3
1259
990
 
1260
- Mixed Vehicles7
1261
- Vehicle-1093Debug: electric
1262
- Vehicle-1580Debug: heavy_fuel_oil
1263
- Vehicle-3686Debug: gas
1264
- Vehicle-4687Debug: gas
1265
- Vehicle-6053Debug: diesel
1266
- Vehicle-6103Debug: cng
1267
- Vehicle-6758Debug: hydrogen
991
+ Mixed Vehicles9
992
+ Vehicle-2340Debug: cng
993
+ Vehicle-3222Debug: electric
994
+ Vehicle-3383Debug: heavy_fuel_oil
995
+ Vehicle-3519Debug: lpg
996
+ Vehicle-3837Debug: gas
997
+ Vehicle-4670Debug: dual_fuel_diesel_cng
998
+ Vehicle-6233Debug: cng
999
+ Vehicle-7297Debug: electric
1000
+ Vehicle-8794Debug: dual_fuel_diesel_cng
1268
1001
 
1269
- Ungrouped13
1002
+ Ungrouped11
1270
1003
 
1271
1004
  Selected groups:
1272
1005
 
@@ -1280,7 +1013,7 @@ Mixed Vehicles
1280
1013
  ```tsx
1281
1014
  import { useMemo, useState } from 'react';
1282
1015
  import { isEmpty, random } from 'es-toolkit/compat';
1283
- import faker from 'faker';
1016
+ import { faker } from '@faker-js/faker';
1284
1017
 
1285
1018
  import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
1286
1019
  import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
@@ -1331,15 +1064,15 @@ const fuelTypes = ['diesel', 'electric', 'gas', 'hydrogen', 'cng', 'lpg', 'dual_
1331
1064
 
1332
1065
  const getVehicles = (withSubType = true): TreeItem[] =>
1333
1066
  Array.from({ length: 20 }, (_, index) => {
1334
- const fuelType = withSubType ? faker.random.arrayElement(fuelTypes) : undefined;
1067
+ const fuelType = withSubType ? faker.helpers.arrayElement(fuelTypes) : undefined;
1335
1068
  return {
1336
1069
  id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
1337
1070
  name: `Vehicle-${random(1000, 9999)}`,
1338
1071
  info: <span>Debug: {fuelType}</span>,
1339
- type: faker.random.arrayElement(assetTypes),
1072
+ type: faker.helpers.arrayElement(assetTypes),
1340
1073
  subType: fuelType, // subType cannot be used as icon here anymore
1341
1074
  pairIcon: getFuelIcon(fuelType),
1342
- groupIds: [faker.random.arrayElement(truckGroups).id],
1075
+ groupIds: [faker.helpers.arrayElement(truckGroups).id],
1343
1076
  };
1344
1077
  });
1345
1078
 
@@ -1601,22 +1334,22 @@ export default AssetTreeExample;
1601
1334
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1602
1335
  <span class="rioglyph rioglyph-truck-baseline text-size-16 margin-right-2">
1603
1336
  </span>
1604
- <span class="TreeLabelCount label label-condensed label-muted label-filled">8</span>
1337
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">5</span>
1605
1338
  </div>
1606
1339
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1607
1340
  <span class="rioglyph rioglyph-bus-baseline text-size-16 margin-right-2">
1608
1341
  </span>
1609
- <span class="TreeLabelCount label label-condensed label-muted label-filled">6</span>
1342
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">4</span>
1610
1343
  </div>
1611
1344
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1612
1345
  <span class="rioglyph rioglyph-van-baseline text-size-16 margin-right-2">
1613
1346
  </span>
1614
- <span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
1347
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">4</span>
1615
1348
  </div>
1616
1349
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1617
1350
  <span class="rioglyph rioglyph-car-baseline text-size-16 margin-right-2">
1618
1351
  </span>
1619
- <span class="TreeLabelCount label label-condensed label-muted label-filled">4</span>
1352
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
1620
1353
  </div>
1621
1354
  </div>
1622
1355
  <div class="TreeSummaryRow display-grid grid-cols-4 gap-10">
@@ -1633,7 +1366,7 @@ export default AssetTreeExample;
1633
1366
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1634
1367
  <span class="rioglyph rioglyph-fuel-electric text-size-16 margin-right-2">
1635
1368
  </span>
1636
- <span class="TreeLabelCount label label-condensed label-muted label-filled">4</span>
1369
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
1637
1370
  </div>
1638
1371
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1639
1372
  <span class="rioglyph rioglyph-fuel-hydrogen text-size-16 margin-right-2">
@@ -1643,14 +1376,14 @@ export default AssetTreeExample;
1643
1376
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1644
1377
  <span class="rioglyph rioglyph-fuel-mix text-size-16 margin-right-2">
1645
1378
  </span>
1646
- <span class="TreeLabelCount label label-condensed label-muted label-filled">1</span>
1379
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">3</span>
1647
1380
  </div>
1648
1381
  </div>
1649
1382
  </div>
1650
1383
  </div>
1651
1384
  <div>
1652
1385
  <div class="dropdown btn-group TreeHeaderOptions height-20">
1653
- <button type="button" id="ez56znb51dg" 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">
1386
+ <button type="button" id="oegrxubdlai" 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">
1654
1387
  <span class="rioglyph rioglyph-option-vertical" aria-hidden="true">
1655
1388
  </span>
1656
1389
  </button>
@@ -1670,11 +1403,32 @@ export default AssetTreeExample;
1670
1403
  <span class="TreeLabelNameText">
1671
1404
  <span class="TreeLabelNameTextHeadline">Mixed Vehicles</span>
1672
1405
  </span>
1673
- <span class="TreeLabelCount label label-muted label-filled label-condensed">7</span>
1406
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">9</span>
1674
1407
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1675
1408
  </span>
1676
1409
  </span>
1677
1410
  </div>
1411
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9711">
1412
+ <label class="checkbox TreeCheckbox" tabindex="0">
1413
+ <input type="checkbox" class="TreeCheckbox">
1414
+ <span class="checkbox-text">
1415
+ </span>
1416
+ </label>
1417
+ <span class="TreeLabel TreeLabelName">
1418
+ <span class="rioglyph-icon-pair">
1419
+ <span class="rioglyph rioglyph-van">
1420
+ </span>
1421
+ <span class="rioglyph rioglyph-fuel-gas">
1422
+ </span>
1423
+ </span>
1424
+ <span class="TreeLabelNameText">
1425
+ <span class="TreeLabelNameTextHeadline">Vehicle-2340</span>
1426
+ <span class="TreeLabelNameTextSubline">
1427
+ <span>Debug: cng</span>
1428
+ </span>
1429
+ </span>
1430
+ </span>
1431
+ </div>
1678
1432
  <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d972">
1679
1433
  <label class="checkbox TreeCheckbox" tabindex="0">
1680
1434
  <input type="checkbox" class="TreeCheckbox">
@@ -1683,20 +1437,20 @@ export default AssetTreeExample;
1683
1437
  </label>
1684
1438
  <span class="TreeLabel TreeLabelName">
1685
1439
  <span class="rioglyph-icon-pair">
1686
- <span class="rioglyph rioglyph-truck">
1440
+ <span class="rioglyph rioglyph-van">
1687
1441
  </span>
1688
1442
  <span class="rioglyph rioglyph-fuel-electric">
1689
1443
  </span>
1690
1444
  </span>
1691
1445
  <span class="TreeLabelNameText">
1692
- <span class="TreeLabelNameTextHeadline">Vehicle-1093</span>
1446
+ <span class="TreeLabelNameTextHeadline">Vehicle-3222</span>
1693
1447
  <span class="TreeLabelNameTextSubline">
1694
1448
  <span>Debug: electric</span>
1695
1449
  </span>
1696
1450
  </span>
1697
1451
  </span>
1698
1452
  </div>
1699
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9710">
1453
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d978">
1700
1454
  <label class="checkbox TreeCheckbox" tabindex="0">
1701
1455
  <input type="checkbox" class="TreeCheckbox">
1702
1456
  <span class="checkbox-text">
@@ -1704,20 +1458,20 @@ export default AssetTreeExample;
1704
1458
  </label>
1705
1459
  <span class="TreeLabel TreeLabelName">
1706
1460
  <span class="rioglyph-icon-pair">
1707
- <span class="rioglyph rioglyph-bus">
1461
+ <span class="rioglyph rioglyph-van">
1708
1462
  </span>
1709
1463
  <span class="rioglyph rioglyph-fuel-liquid">
1710
1464
  </span>
1711
1465
  </span>
1712
1466
  <span class="TreeLabelNameText">
1713
- <span class="TreeLabelNameTextHeadline">Vehicle-1580</span>
1467
+ <span class="TreeLabelNameTextHeadline">Vehicle-3383</span>
1714
1468
  <span class="TreeLabelNameTextSubline">
1715
1469
  <span>Debug: heavy_fuel_oil</span>
1716
1470
  </span>
1717
1471
  </span>
1718
1472
  </span>
1719
1473
  </div>
1720
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9718">
1474
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d975">
1721
1475
  <label class="checkbox TreeCheckbox" tabindex="0">
1722
1476
  <input type="checkbox" class="TreeCheckbox">
1723
1477
  <span class="checkbox-text">
@@ -1727,18 +1481,18 @@ export default AssetTreeExample;
1727
1481
  <span class="rioglyph-icon-pair">
1728
1482
  <span class="rioglyph rioglyph-truck">
1729
1483
  </span>
1730
- <span class="rioglyph rioglyph-fuel-liquid">
1484
+ <span class="rioglyph rioglyph-fuel-gas">
1731
1485
  </span>
1732
1486
  </span>
1733
1487
  <span class="TreeLabelNameText">
1734
- <span class="TreeLabelNameTextHeadline">Vehicle-3686</span>
1488
+ <span class="TreeLabelNameTextHeadline">Vehicle-3519</span>
1735
1489
  <span class="TreeLabelNameTextSubline">
1736
- <span>Debug: gas</span>
1490
+ <span>Debug: lpg</span>
1737
1491
  </span>
1738
1492
  </span>
1739
1493
  </span>
1740
1494
  </div>
1741
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9716">
1495
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d970">
1742
1496
  <label class="checkbox TreeCheckbox" tabindex="0">
1743
1497
  <input type="checkbox" class="TreeCheckbox">
1744
1498
  <span class="checkbox-text">
@@ -1746,13 +1500,13 @@ export default AssetTreeExample;
1746
1500
  </label>
1747
1501
  <span class="TreeLabel TreeLabelName">
1748
1502
  <span class="rioglyph-icon-pair">
1749
- <span class="rioglyph rioglyph-car">
1503
+ <span class="rioglyph rioglyph-bus">
1750
1504
  </span>
1751
1505
  <span class="rioglyph rioglyph-fuel-liquid">
1752
1506
  </span>
1753
1507
  </span>
1754
1508
  <span class="TreeLabelNameText">
1755
- <span class="TreeLabelNameTextHeadline">Vehicle-4687</span>
1509
+ <span class="TreeLabelNameTextHeadline">Vehicle-3837</span>
1756
1510
  <span class="TreeLabelNameTextSubline">
1757
1511
  <span>Debug: gas</span>
1758
1512
  </span>
@@ -1767,20 +1521,20 @@ export default AssetTreeExample;
1767
1521
  </label>
1768
1522
  <span class="TreeLabel TreeLabelName">
1769
1523
  <span class="rioglyph-icon-pair">
1770
- <span class="rioglyph rioglyph-car">
1524
+ <span class="rioglyph rioglyph-truck">
1771
1525
  </span>
1772
- <span class="rioglyph rioglyph-fuel-liquid">
1526
+ <span class="rioglyph rioglyph-fuel-mix">
1773
1527
  </span>
1774
1528
  </span>
1775
1529
  <span class="TreeLabelNameText">
1776
- <span class="TreeLabelNameTextHeadline">Vehicle-6053</span>
1530
+ <span class="TreeLabelNameTextHeadline">Vehicle-4670</span>
1777
1531
  <span class="TreeLabelNameTextSubline">
1778
- <span>Debug: diesel</span>
1532
+ <span>Debug: dual_fuel_diesel_cng</span>
1779
1533
  </span>
1780
1534
  </span>
1781
1535
  </span>
1782
1536
  </div>
1783
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9713">
1537
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9714">
1784
1538
  <label class="checkbox TreeCheckbox" tabindex="0">
1785
1539
  <input type="checkbox" class="TreeCheckbox">
1786
1540
  <span class="checkbox-text">
@@ -1788,20 +1542,20 @@ export default AssetTreeExample;
1788
1542
  </label>
1789
1543
  <span class="TreeLabel TreeLabelName">
1790
1544
  <span class="rioglyph-icon-pair">
1791
- <span class="rioglyph rioglyph-truck">
1545
+ <span class="rioglyph rioglyph-car">
1792
1546
  </span>
1793
1547
  <span class="rioglyph rioglyph-fuel-gas">
1794
1548
  </span>
1795
1549
  </span>
1796
1550
  <span class="TreeLabelNameText">
1797
- <span class="TreeLabelNameTextHeadline">Vehicle-6103</span>
1551
+ <span class="TreeLabelNameTextHeadline">Vehicle-6233</span>
1798
1552
  <span class="TreeLabelNameTextSubline">
1799
1553
  <span>Debug: cng</span>
1800
1554
  </span>
1801
1555
  </span>
1802
1556
  </span>
1803
1557
  </div>
1804
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9712">
1558
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9713">
1805
1559
  <label class="checkbox TreeCheckbox" tabindex="0">
1806
1560
  <input type="checkbox" class="TreeCheckbox">
1807
1561
  <span class="checkbox-text">
@@ -1811,13 +1565,34 @@ export default AssetTreeExample;
1811
1565
  <span class="rioglyph-icon-pair">
1812
1566
  <span class="rioglyph rioglyph-car">
1813
1567
  </span>
1814
- <span class="rioglyph rioglyph-fuel-hydrogen">
1568
+ <span class="rioglyph rioglyph-fuel-electric">
1815
1569
  </span>
1816
1570
  </span>
1817
1571
  <span class="TreeLabelNameText">
1818
- <span class="TreeLabelNameTextHeadline">Vehicle-6758</span>
1572
+ <span class="TreeLabelNameTextHeadline">Vehicle-7297</span>
1819
1573
  <span class="TreeLabelNameTextSubline">
1820
- <span>Debug: hydrogen</span>
1574
+ <span>Debug: electric</span>
1575
+ </span>
1576
+ </span>
1577
+ </span>
1578
+ </div>
1579
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d971">
1580
+ <label class="checkbox TreeCheckbox" tabindex="0">
1581
+ <input type="checkbox" class="TreeCheckbox">
1582
+ <span class="checkbox-text">
1583
+ </span>
1584
+ </label>
1585
+ <span class="TreeLabel TreeLabelName">
1586
+ <span class="rioglyph-icon-pair">
1587
+ <span class="rioglyph rioglyph-bus">
1588
+ </span>
1589
+ <span class="rioglyph rioglyph-fuel-mix">
1590
+ </span>
1591
+ </span>
1592
+ <span class="TreeLabelNameText">
1593
+ <span class="TreeLabelNameTextHeadline">Vehicle-8794</span>
1594
+ <span class="TreeLabelNameTextSubline">
1595
+ <span>Debug: dual_fuel_diesel_cng</span>
1821
1596
  </span>
1822
1597
  </span>
1823
1598
  </span>
@@ -1834,7 +1609,7 @@ export default AssetTreeExample;
1834
1609
  <span class="TreeLabelNameText">
1835
1610
  <span class="TreeLabelNameTextHeadline">Ungrouped</span>
1836
1611
  </span>
1837
- <span class="TreeLabelCount label label-muted label-filled label-condensed">13</span>
1612
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">11</span>
1838
1613
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1839
1614
  </span>
1840
1615
  </span>
@@ -1873,145 +1648,6 @@ export default AssetTreeExample;
1873
1648
  </div>
1874
1649
  ```
1875
1650
 
1876
- #### Props: AssetTree
1877
-
1878
- ### AssetTree
1879
-
1880
- | Name | Type | Default | Description |
1881
- | --- | --- | --- | --- |
1882
- | fly | boolean | false | Defines if the component will overlap the body content. |
1883
- | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
1884
- | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
1885
- | bordered | boolean | false | Defines whether the component has a border or not. |
1886
- | 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. |
1887
- | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
1888
- | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
1889
- | height | number | — | Defines the height of the component in px. |
1890
- | isOpen | boolean | true | Defines whether the component is open or not. |
1891
- | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
1892
- | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
1893
- | onCategoryChange | Function | () => {} | Callback for handling change of category. |
1894
- | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
1895
- | className | String | — | Additional classes added on the wrapper element. |
1896
- | children | TreeCategory | — | A list of TreeCategory components |
1897
-
1898
- #### Props: TreeCategory
1899
-
1900
- ### TreeCategory
1901
-
1902
- | Name | Type | Default | Description |
1903
- | --- | --- | --- | --- |
1904
- | id | String | — | A unique identifier for that category. |
1905
- | icon | String | — | The rioglyph icon name for that category. |
1906
- | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
1907
- | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
1908
-
1909
- #### Props: Tree
1910
-
1911
- ### Tree
1912
-
1913
- | Name | Type | Default | Description |
1914
- | --- | --- | --- | --- |
1915
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
1916
- | └id | String | — | A unique identifier of a group. |
1917
- | └name | String | — | The name of a group. |
1918
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
1919
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
1920
- | └className | String | — | Additional classes added to the group element. |
1921
- | items | Array of Objects | [] | The list of items. |
1922
- | └id | String | — | A unique identifier of an item. |
1923
- | └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 |
1924
- | └info | String \| Node | — | The subline of an item. |
1925
- | └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). |
1926
- | └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. |
1927
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
1928
- | └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. |
1929
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
1930
- | └className | string | — | Additional classes added to the item element. |
1931
- | selectedGroups | Array of strings | — | List of selected group ids. |
1932
- | selectedItems | Array of strings | — | List of selected item ids. |
1933
- | 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: [] } |
1934
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
1935
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
1936
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
1937
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
1938
- | onSearchChange | Function | — | Callback for when the search value changes. |
1939
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
1940
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
1941
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
1942
- | hideSummary | boolean | false | Defines whether a summary is shown. |
1943
- | 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. |
1944
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
1945
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
1946
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
1947
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
1948
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
1949
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
1950
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
1951
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
1952
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
1953
- | className | String | — | Additional classes added to the wrapping element. |
1954
-
1955
- #### Props: TreeSearch
1956
-
1957
- ### TreeSearch
1958
-
1959
- | Name | Type | Default | Description |
1960
- | --- | --- | --- | --- |
1961
- | value | String | — | The search value to be shown and used for the search. |
1962
- | onChange | Function | () => {} | Callback for when the search value changes. |
1963
- | placeholder | String | — | The placeholder text used for the input field. |
1964
- | className | String | — | Additional classes added to the wrapping element. |
1965
-
1966
- #### Props: TreeSummary
1967
-
1968
- ### TreeSummary
1969
-
1970
- | Name | Type | Default | Description |
1971
- | --- | --- | --- | --- |
1972
- | assetCounts | object | — | The object containing various asset type counter. |
1973
- | └truck | number | — | The amount of trucks. |
1974
- | └trailer | number | — | The amount of trailers. |
1975
- | └bus | number | — | The amount of buses. |
1976
- | └van | number | — | The amount of vans. |
1977
- | └driver | number | — | The amount of drivers. |
1978
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
1979
- | className | string | — | Additional classes added to the wrapping element. |
1980
-
1981
- #### Props: TreeSummaryRow
1982
-
1983
- ### TreeSummaryRow
1984
-
1985
- | Name | Type | Default | Description |
1986
- | --- | --- | --- | --- |
1987
- | 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. |
1988
-
1989
- #### Props: TypeCounter
1990
-
1991
- ### TypeCounter
1992
-
1993
- | Name | Type | Default | Description |
1994
- | --- | --- | --- | --- |
1995
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
1996
- | 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. |
1997
- | isActive | Boolean | — | Sets the active styling if active. |
1998
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
1999
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
2000
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
2001
- | 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. |
2002
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
2003
-
2004
- #### Props: TreeOption
2005
-
2006
- ### TreeOption
2007
-
2008
- | Name | Type | Default | Description |
2009
- | --- | --- | --- | --- |
2010
- | isChecked | boolean | — | Defines whether the option is set. |
2011
- | label | string / node | — | The label for the option. |
2012
- | onChange | Function | — | Callback triggered when option is selected. |
2013
- | className | string | — | Additional classes added to the wrapping element. |
2014
-
2015
1651
  ## AssetTree with custom summary
2016
1652
 
2017
1653
  ### Example: Some small dummy text at the bottom to showcase that you can put something here
@@ -2277,144 +1913,190 @@ export default AssetTreeWithCustomSummaryExample;
2277
1913
  </div>
2278
1914
  ```
2279
1915
 
2280
- #### Props: AssetTree
2281
-
2282
- ### AssetTree
2283
-
2284
- | Name | Type | Default | Description |
2285
- | --- | --- | --- | --- |
2286
- | fly | boolean | false | Defines if the component will overlap the body content. |
2287
- | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
2288
- | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
2289
- | bordered | boolean | false | Defines whether the component has a border or not. |
2290
- | 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. |
2291
- | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
2292
- | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
2293
- | height | number | — | Defines the height of the component in px. |
2294
- | isOpen | boolean | true | Defines whether the component is open or not. |
2295
- | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
2296
- | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
2297
- | onCategoryChange | Function | () => {} | Callback for handling change of category. |
2298
- | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
2299
- | className | String | — | Additional classes added on the wrapper element. |
2300
- | children | TreeCategory | — | A list of TreeCategory components |
2301
-
2302
- #### Props: TreeCategory
2303
-
2304
- ### TreeCategory
2305
-
2306
- | Name | Type | Default | Description |
2307
- | --- | --- | --- | --- |
2308
- | id | String | — | A unique identifier for that category. |
2309
- | icon | String | — | The rioglyph icon name for that category. |
2310
- | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
2311
- | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
2312
-
2313
- #### Props: Tree
2314
-
2315
- ### Tree
2316
-
2317
- | Name | Type | Default | Description |
2318
- | --- | --- | --- | --- |
2319
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2320
- | └id | String | — | A unique identifier of a group. |
2321
- | └name | String | — | The name of a group. |
2322
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2323
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
2324
- | └className | String | — | Additional classes added to the group element. |
2325
- | items | Array of Objects | [] | The list of items. |
2326
- | └id | String | — | A unique identifier of an item. |
2327
- | └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 |
2328
- | └info | String \| Node | — | The subline of an item. |
2329
- | └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). |
2330
- | └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. |
2331
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2332
- | └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. |
2333
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2334
- | └className | string | | Additional classes added to the item element. |
2335
- | selectedGroups | Array of strings | — | List of selected group ids. |
2336
- | selectedItems | Array of strings | — | List of selected item ids. |
2337
- | 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: [] } |
2338
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2339
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2340
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2341
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2342
- | onSearchChange | Function | — | Callback for when the search value changes. |
2343
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2344
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2345
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2346
- | hideSummary | boolean | false | Defines whether a summary is shown. |
2347
- | 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. |
2348
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2349
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2350
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
2351
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2352
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2353
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2354
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2355
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2356
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2357
- | className | String | — | Additional classes added to the wrapping element. |
2358
-
2359
- #### Props: TreeSearch
2360
-
2361
- ### TreeSearch
2362
-
2363
- | Name | Type | Default | Description |
2364
- | --- | --- | --- | --- |
2365
- | value | String | — | The search value to be shown and used for the search. |
2366
- | onChange | Function | () => {} | Callback for when the search value changes. |
2367
- | placeholder | String | — | The placeholder text used for the input field. |
2368
- | className | String | — | Additional classes added to the wrapping element. |
2369
-
2370
- #### Props: TreeSummary
2371
-
2372
- ### TreeSummary
2373
-
2374
- | Name | Type | Default | Description |
2375
- | --- | --- | --- | --- |
2376
- | assetCounts | object | — | The object containing various asset type counter. |
2377
- | └truck | number | — | The amount of trucks. |
2378
- | └trailer | number | — | The amount of trailers. |
2379
- | └bus | number | | The amount of buses. |
2380
- | └van | number | — | The amount of vans. |
2381
- | └driver | number | — | The amount of drivers. |
2382
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
2383
- | className | string | — | Additional classes added to the wrapping element. |
2384
-
2385
- #### Props: TreeSummaryRow
2386
-
2387
- ### TreeSummaryRow
2388
-
2389
- | Name | Type | Default | Description |
2390
- | --- | --- | --- | --- |
2391
- | 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. |
2392
-
2393
- #### Props: TypeCounter
2394
-
2395
- ### TypeCounter
2396
-
2397
- | Name | Type | Default | Description |
2398
- | --- | --- | --- | --- |
2399
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
2400
- | 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. |
2401
- | isActive | Boolean | — | Sets the active styling if active. |
2402
- | hasFilter | boolean | | Should be set when there is a type filter set in the tree to style the counter accordingly. |
2403
- | enableActivity | boolean | | Allows for interactivity. Use this prop when you allow clicking on the counter. |
2404
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
2405
- | 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. |
2406
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
2407
-
2408
- #### Props: TreeOption
2409
-
2410
- ### TreeOption
2411
-
2412
- | Name | Type | Default | Description |
2413
- | --- | --- | --- | --- |
2414
- | isChecked | boolean | — | Defines whether the option is set. |
2415
- | label | string / node | — | The label for the option. |
2416
- | onChange | Function | | Callback triggered when option is selected. |
2417
- | className | string | — | Additional classes added to the wrapping element. |
1916
+ ## Tree with custom icons
1917
+
1918
+ ### Example: Tree with header and search
1919
+
1920
+ Tree with header and search
1921
+
1922
+ 20
1923
+
1924
+ Group 019
1925
+
1926
+ Group 028
1927
+
1928
+ Group 033
1929
+
1930
+ #### Summary
1931
+
1932
+ Tree with header and search
1933
+
1934
+ 20
1935
+
1936
+ Group 019
1937
+
1938
+ Group 028
1939
+
1940
+ Group 033
1941
+
1942
+ #### React (tsx)
1943
+
1944
+ ```tsx
1945
+ import { useState } from 'react';
1946
+ import { random } from 'es-toolkit/compat';
1947
+ import { faker } from '@faker-js/faker';
1948
+
1949
+ import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
1950
+ import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
1951
+
1952
+ const groups: TreeGroup[] = [
1953
+ {
1954
+ id: '1',
1955
+ name: 'Group 01',
1956
+ icon: 'https://cdn.rio.cloud/images/uikit/react_logo.svg',
1957
+ },
1958
+ {
1959
+ id: '2',
1960
+ name: 'Group 02',
1961
+ icon: 'https://cdn.rio.cloud/images/uikit/react_logo.svg',
1962
+ },
1963
+ {
1964
+ id: '3',
1965
+ name: 'Group 03',
1966
+ icon: 'https://cdn.rio.cloud/svg/common/ico_rio_colored.svg',
1967
+ },
1968
+ ];
1969
+
1970
+ const treeItems: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
1971
+ id: `${index}`,
1972
+ name: `${faker.lorem.words()} ${random(100, 999)}`,
1973
+ type: 'files',
1974
+ icon: 'https://cdn.rio.cloud/svg/common/ico_rio_colored.svg',
1975
+ groupIds: [faker.helpers.arrayElement(groups).id],
1976
+ }));
1977
+
1978
+ export default () => {
1979
+ const [selectedItemIds, setSelectedItemIds] = useState<string[]>([]);
1980
+ const [expandedGroups, setExpandedGroups] = useState<string[]>([]);
1981
+
1982
+ const handleSelection = ({ items }: SelectionChangeResponse) => {
1983
+ setSelectedItemIds(items);
1984
+ };
1985
+
1986
+ const handleExpandGroups = (newExpandedGroups: string[]) => setExpandedGroups(newExpandedGroups);
1987
+
1988
+ return (
1989
+ <div className='display-flex flex-wrap gap-25 overflow-auto'>
1990
+ <LabeledElement label='Tree with header and search'>
1991
+ <div className='width-500 border border-color-lighter border-bottom-none'>
1992
+ <Tree
1993
+ groups={groups}
1994
+ items={treeItems}
1995
+ expandedGroups={expandedGroups}
1996
+ onExpandGroupsChange={handleExpandGroups}
1997
+ selectedItems={selectedItemIds}
1998
+ onSelectionChange={handleSelection}
1999
+ searchPlaceholder='Find items'
2000
+ scrollHeight={300}
2001
+ hasMultiselect={false}
2002
+ />
2003
+ </div>
2004
+ </LabeledElement>
2005
+ </div>
2006
+ );
2007
+ };
2008
+ ```
2009
+
2010
+ #### HTML (html)
2011
+
2012
+ ```html
2013
+ <div class="display-flex flex-wrap gap-25 overflow-auto">
2014
+ <div class="LabeledElement display-flex flex-column">
2015
+ <div class="text-color-dark max-width-100pct text-size-12 display-inline-block margin-bottom-5">Tree with header and search</div>
2016
+ <div class="width-500 border border-color-lighter border-bottom-none">
2017
+ <div class="Tree">
2018
+ <div class="TreeHeader">
2019
+ <div class="TreeSearch">
2020
+ <div class="input-group flex-1-0">
2021
+ <span class="input-group-addon">
2022
+ <span class="rioglyph rioglyph-search" aria-hidden="true">
2023
+ </span>
2024
+ </span>
2025
+ <div class="ClearableInput input-group">
2026
+ <input placeholder="Find items" class="form-control" type="text" tabindex="0" value="">
2027
+ <span class="clearButton hide">
2028
+ <span class="clearButtonIcon rioglyph rioglyph-remove-sign">
2029
+ </span>
2030
+ </span>
2031
+ </div>
2032
+ </div>
2033
+ </div>
2034
+ <div class="TreeHead display-flex gap-5 padding-15">
2035
+ <div class="border border-right-only hidden-empty padding-right-10 margin-right-2">
2036
+ </div>
2037
+ <div class="display-flex justify-content-between align-items-start width-100pct">
2038
+ <div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
2039
+ <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
2040
+ <span class="rioglyph rioglyph-files text-size-16 margin-right-2">
2041
+ </span>
2042
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">20</span>
2043
+ </div>
2044
+ </div>
2045
+ </div>
2046
+ </div>
2047
+ </div>
2048
+ <div class="TreeRoot user-select-none overflow-auto" style="max-height: 300px; position: relative;">
2049
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="1">
2050
+ <div class="TreeNode from-group" data-key="1">
2051
+ <span class="TreeLabel TreeLabelName">
2052
+ <div class="display-grid place-items-center margin-right-5" style="width: 18px; height: 18px;">
2053
+ <img src="https://cdn.rio.cloud/images/uikit/react_logo.svg" style="max-width: 100%; max-height: 100%;">
2054
+ </div>
2055
+ <span class="TreeLabelNameText">
2056
+ <span class="TreeLabelNameTextHeadline">Group 01</span>
2057
+ </span>
2058
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">9</span>
2059
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2060
+ </span>
2061
+ </span>
2062
+ </div>
2063
+ </div>
2064
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="2">
2065
+ <div class="TreeNode from-group" data-key="2">
2066
+ <span class="TreeLabel TreeLabelName">
2067
+ <div class="display-grid place-items-center margin-right-5" style="width: 18px; height: 18px;">
2068
+ <img src="https://cdn.rio.cloud/images/uikit/react_logo.svg" style="max-width: 100%; max-height: 100%;">
2069
+ </div>
2070
+ <span class="TreeLabelNameText">
2071
+ <span class="TreeLabelNameTextHeadline">Group 02</span>
2072
+ </span>
2073
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">8</span>
2074
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2075
+ </span>
2076
+ </span>
2077
+ </div>
2078
+ </div>
2079
+ <div class="TreeNodeContainer user-select-none overflow-hidden" data-id="3">
2080
+ <div class="TreeNode from-group" data-key="3">
2081
+ <span class="TreeLabel TreeLabelName">
2082
+ <div class="display-grid place-items-center margin-right-5" style="width: 18px; height: 18px;">
2083
+ <img src="https://cdn.rio.cloud/svg/common/ico_rio_colored.svg" style="max-width: 100%; max-height: 100%;">
2084
+ </div>
2085
+ <span class="TreeLabelNameText">
2086
+ <span class="TreeLabelNameTextHeadline">Group 03</span>
2087
+ </span>
2088
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">3</span>
2089
+ <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2090
+ </span>
2091
+ </span>
2092
+ </div>
2093
+ </div>
2094
+ </div>
2095
+ </div>
2096
+ </div>
2097
+ </div>
2098
+ </div>
2099
+ ```
2418
2100
 
2419
2101
  ## Tree
2420
2102
 
@@ -2424,11 +2106,11 @@ Tree with header and search
2424
2106
 
2425
2107
  20
2426
2108
 
2427
- Folder 015
2109
+ Folder 018
2428
2110
 
2429
- Folder 025
2111
+ Folder 023
2430
2112
 
2431
- Folder 036
2113
+ Folder 035
2432
2114
 
2433
2115
  Folder 044
2434
2116
 
@@ -2442,11 +2124,11 @@ Tree with header and search
2442
2124
 
2443
2125
  20
2444
2126
 
2445
- Folder 015
2127
+ Folder 018
2446
2128
 
2447
- Folder 025
2129
+ Folder 023
2448
2130
 
2449
- Folder 036
2131
+ Folder 035
2450
2132
 
2451
2133
  Folder 044
2452
2134
 
@@ -2459,7 +2141,7 @@ Expanded folders:
2459
2141
  ```tsx
2460
2142
  import { useState } from 'react';
2461
2143
  import { random } from 'es-toolkit/compat';
2462
- import faker from 'faker';
2144
+ import { faker } from '@faker-js/faker';
2463
2145
 
2464
2146
  import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
2465
2147
  import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
@@ -2489,11 +2171,11 @@ const folders: TreeGroup[] = [
2489
2171
 
2490
2172
  const treeItems: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
2491
2173
  id: `${index}`,
2492
- name: `${faker.random.words()} ${random(100, 999)}`,
2174
+ name: `${faker.lorem.words()} ${random(100, 999)}`,
2493
2175
  type: 'files',
2494
2176
  icon: 'files',
2495
2177
  // icon: null, // Set to "null" to omit the icon
2496
- groupIds: [faker.random.arrayElement(folders).id],
2178
+ groupIds: [faker.helpers.arrayElement(folders).id],
2497
2179
  }));
2498
2180
 
2499
2181
  const TreeOnlyExample = () => {
@@ -2593,7 +2275,7 @@ export default TreeOnlyExample;
2593
2275
  <span class="TreeLabelNameText">
2594
2276
  <span class="TreeLabelNameTextHeadline">Folder 01</span>
2595
2277
  </span>
2596
- <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2278
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">8</span>
2597
2279
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2598
2280
  </span>
2599
2281
  </span>
@@ -2607,7 +2289,7 @@ export default TreeOnlyExample;
2607
2289
  <span class="TreeLabelNameText">
2608
2290
  <span class="TreeLabelNameTextHeadline">Folder 02</span>
2609
2291
  </span>
2610
- <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2292
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">3</span>
2611
2293
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2612
2294
  </span>
2613
2295
  </span>
@@ -2621,7 +2303,7 @@ export default TreeOnlyExample;
2621
2303
  <span class="TreeLabelNameText">
2622
2304
  <span class="TreeLabelNameTextHeadline">Folder 03</span>
2623
2305
  </span>
2624
- <span class="TreeLabelCount label label-muted label-filled label-condensed">6</span>
2306
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2625
2307
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2626
2308
  </span>
2627
2309
  </span>
@@ -2656,61 +2338,17 @@ export default TreeOnlyExample;
2656
2338
  </div>
2657
2339
  ```
2658
2340
 
2659
- #### Props
2660
-
2661
- | Name | Type | Default | Description |
2662
- | --- | --- | --- | --- |
2663
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2664
- | └id | String | — | A unique identifier of a group. |
2665
- | └name | String | — | The name of a group. |
2666
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2667
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
2668
- | └className | String | — | Additional classes added to the group element. |
2669
- | items | Array of Objects | [] | The list of items. |
2670
- | └id | String | — | A unique identifier of an item. |
2671
- | └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 |
2672
- | └info | String \| Node | — | The subline of an item. |
2673
- | └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). |
2674
- | └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. |
2675
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2676
- | └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. |
2677
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2678
- | └className | string | — | Additional classes added to the item element. |
2679
- | selectedGroups | Array of strings | — | List of selected group ids. |
2680
- | selectedItems | Array of strings | — | List of selected item ids. |
2681
- | 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: [] } |
2682
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2683
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2684
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2685
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2686
- | onSearchChange | Function | — | Callback for when the search value changes. |
2687
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2688
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2689
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2690
- | hideSummary | boolean | false | Defines whether a summary is shown. |
2691
- | 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. |
2692
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2693
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2694
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
2695
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2696
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2697
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2698
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2699
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2700
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2701
- | className | String | — | Additional classes added to the wrapping element. |
2702
-
2703
2341
  ### Example: Tree without header and search
2704
2342
 
2705
2343
  Tree without header and search
2706
2344
 
2707
- Folder 014
2345
+ Folder 012
2708
2346
 
2709
2347
  Folder 028
2710
2348
 
2711
- Folder 035
2349
+ Folder 036
2712
2350
 
2713
- Folder 043
2351
+ Folder 044
2714
2352
 
2715
2353
  Selected items:
2716
2354
 
@@ -2720,13 +2358,13 @@ Expanded folders:
2720
2358
 
2721
2359
  Tree without header and search
2722
2360
 
2723
- Folder 014
2361
+ Folder 012
2724
2362
 
2725
2363
  Folder 028
2726
2364
 
2727
- Folder 035
2365
+ Folder 036
2728
2366
 
2729
- Folder 043
2367
+ Folder 044
2730
2368
 
2731
2369
  Selected items:
2732
2370
 
@@ -2737,7 +2375,7 @@ Expanded folders:
2737
2375
  ```tsx
2738
2376
  import { useState } from 'react';
2739
2377
  import { random } from 'es-toolkit/compat';
2740
- import faker from 'faker';
2378
+ import { faker } from '@faker-js/faker';
2741
2379
 
2742
2380
  import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
2743
2381
  import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
@@ -2771,10 +2409,10 @@ const folders2: TreeGroup[] = [
2771
2409
 
2772
2410
  const treeItems2: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
2773
2411
  id: `${index}`,
2774
- name: `${faker.random.words()} ${random(100, 999)}`,
2412
+ name: `${faker.lorem.words()} ${random(100, 999)}`,
2775
2413
  type: 'files',
2776
2414
  icon: null, // Set to "null" to omit the icon
2777
- groupIds: [faker.random.arrayElement(folders2).id],
2415
+ groupIds: [faker.helpers.arrayElement(folders2).id],
2778
2416
  }));
2779
2417
 
2780
2418
  const TreeOnlyExample = () => {
@@ -2847,7 +2485,7 @@ export default TreeOnlyExample;
2847
2485
  <span class="TreeLabelNameText">
2848
2486
  <span class="TreeLabelNameTextHeadline">Folder 01</span>
2849
2487
  </span>
2850
- <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
2488
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">2</span>
2851
2489
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2852
2490
  </span>
2853
2491
  </span>
@@ -2875,7 +2513,7 @@ export default TreeOnlyExample;
2875
2513
  <span class="TreeLabelNameText">
2876
2514
  <span class="TreeLabelNameTextHeadline">Folder 03</span>
2877
2515
  </span>
2878
- <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2516
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">6</span>
2879
2517
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2880
2518
  </span>
2881
2519
  </span>
@@ -2889,7 +2527,7 @@ export default TreeOnlyExample;
2889
2527
  <span class="TreeLabelNameText">
2890
2528
  <span class="TreeLabelNameTextHeadline">Folder 04</span>
2891
2529
  </span>
2892
- <span class="TreeLabelCount label label-muted label-filled label-condensed">3</span>
2530
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
2893
2531
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2894
2532
  </span>
2895
2533
  </span>
@@ -2910,53 +2548,9 @@ export default TreeOnlyExample;
2910
2548
  </div>
2911
2549
  ```
2912
2550
 
2913
- #### Props
2914
-
2915
- | Name | Type | Default | Description |
2916
- | --- | --- | --- | --- |
2917
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2918
- | └id | String | — | A unique identifier of a group. |
2919
- | └name | String | — | The name of a group. |
2920
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2921
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
2922
- | └className | String | — | Additional classes added to the group element. |
2923
- | items | Array of Objects | [] | The list of items. |
2924
- | └id | String | — | A unique identifier of an item. |
2925
- | └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 |
2926
- | └info | String \| Node | — | The subline of an item. |
2927
- | └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). |
2928
- | └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. |
2929
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2930
- | └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. |
2931
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2932
- | └className | string | — | Additional classes added to the item element. |
2933
- | selectedGroups | Array of strings | — | List of selected group ids. |
2934
- | selectedItems | Array of strings | — | List of selected item ids. |
2935
- | 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: [] } |
2936
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2937
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2938
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2939
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2940
- | onSearchChange | Function | — | Callback for when the search value changes. |
2941
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2942
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2943
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2944
- | hideSummary | boolean | false | Defines whether a summary is shown. |
2945
- | 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. |
2946
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2947
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2948
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
2949
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2950
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2951
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2952
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2953
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2954
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2955
- | className | String | — | Additional classes added to the wrapping element. |
2956
-
2957
2551
  ## TreeSummary with assetCounts
2958
2552
 
2959
- ### Example: Example 7
2553
+ ### Example: Example 8
2960
2554
 
2961
2555
  12
2962
2556
  7
@@ -3024,39 +2618,9 @@ export default TreeSummaryExample;
3024
2618
  </div>
3025
2619
  ```
3026
2620
 
3027
- #### Props: TreeSummary
3028
-
3029
- ### TreeSummary
3030
-
3031
- | Name | Type | Default | Description |
3032
- | --- | --- | --- | --- |
3033
- | assetCounts | object | — | The object containing various asset type counter. |
3034
- | └truck | number | — | The amount of trucks. |
3035
- | └trailer | number | — | The amount of trailers. |
3036
- | └bus | number | — | The amount of buses. |
3037
- | └van | number | — | The amount of vans. |
3038
- | └driver | number | — | The amount of drivers. |
3039
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
3040
- | className | string | — | Additional classes added to the wrapping element. |
3041
-
3042
- #### Props: TypeCounter
3043
-
3044
- ### TypeCounter
3045
-
3046
- | Name | Type | Default | Description |
3047
- | --- | --- | --- | --- |
3048
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
3049
- | 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. |
3050
- | isActive | Boolean | — | Sets the active styling if active. |
3051
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
3052
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
3053
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
3054
- | 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. |
3055
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
3056
-
3057
2621
  ## TreeSummary with TypeCounter
3058
2622
 
3059
- ### Example: Example 8
2623
+ ### Example: Example 9
3060
2624
 
3061
2625
  9
3062
2626
  15
@@ -3097,34 +2661,4 @@ export default TreeSummaryCustomExample;
3097
2661
  <span class="TreeLabelCount label label-condensed label-muted label-filled">15</span>
3098
2662
  </div>
3099
2663
  </div>
3100
- ```
3101
-
3102
- #### Props: TreeSummary
3103
-
3104
- ### TreeSummary
3105
-
3106
- | Name | Type | Default | Description |
3107
- | --- | --- | --- | --- |
3108
- | assetCounts | object | — | The object containing various asset type counter. |
3109
- | └truck | number | — | The amount of trucks. |
3110
- | └trailer | number | — | The amount of trailers. |
3111
- | └bus | number | — | The amount of buses. |
3112
- | └van | number | — | The amount of vans. |
3113
- | └driver | number | — | The amount of drivers. |
3114
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
3115
- | className | string | — | Additional classes added to the wrapping element. |
3116
-
3117
- #### Props: TypeCounter
3118
-
3119
- ### TypeCounter
3120
-
3121
- | Name | Type | Default | Description |
3122
- | --- | --- | --- | --- |
3123
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
3124
- | 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. |
3125
- | isActive | Boolean | — | Sets the active styling if active. |
3126
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
3127
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
3128
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
3129
- | 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. |
3130
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
2664
+ ```