@rio-cloud/uikit-mcp 1.1.3 → 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 (190) hide show
  1. package/dist/doc-metadata.json +97 -97
  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 +3 -16
  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 +44 -572
  9. package/dist/docs/components/appNavigationBar.md +2 -54
  10. package/dist/docs/components/areaCharts.md +38 -38
  11. package/dist/docs/components/aspectRatioPlaceholder.md +2 -11
  12. package/dist/docs/components/assetTree.md +417 -991
  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 +187 -187
  17. package/dist/docs/components/barList.md +10 -44
  18. package/dist/docs/components/basicMap.md +1 -1
  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 +46 -72
  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 +2 -2
  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 +32 -74
  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 -4511
  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 +4 -4
  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 +58 -58
  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 +1 -1
  56. package/dist/docs/components/mapCluster.md +1 -1
  57. package/dist/docs/components/mapContext.md +1 -1
  58. package/dist/docs/components/mapDraggableMarker.md +1 -1
  59. package/dist/docs/components/mapGettingStarted.md +1 -1
  60. package/dist/docs/components/mapInfoBubble.md +1 -1
  61. package/dist/docs/components/mapLayerGroup.md +1 -1
  62. package/dist/docs/components/mapMarker.md +339 -345
  63. package/dist/docs/components/mapPolygon.md +16 -20
  64. package/dist/docs/components/mapRoute.md +14 -20
  65. package/dist/docs/components/mapRouteGenerator.md +1 -1
  66. package/dist/docs/components/mapSettings.md +263 -274
  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 +124 -124
  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 +21 -135
  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 +119 -119
  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 +79 -26
  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 +203 -203
  133. package/dist/docs/templates/loading-progress.md +1 -1
  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 +58 -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 +92 -92
  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 +1 -1
  189. package/dist/version.json +2 -2
  190. package/package.json +1 -1
@@ -3,9 +3,7 @@
3
3
  *Category:* Components
4
4
  *Section:* Selection
5
5
  *Source:* https://uikit.developers.rio.cloud/#components/assetTree
6
- *Captured:* 2026-01-07T12:11:29.011Z
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,38 +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
- 5384
14
+ 5495
17
15
  4
18
16
 
19
- Group - Abraham Watsica - 621113
20
-
21
- Group - Adam Windler - 770317
17
+ Group - Aaron Mohr - 86039
22
18
 
23
- Group - Alexandra Collins - 999013
19
+ Group - Adrian O'Hara - 439811
24
20
 
25
- Group - Alfred Olson - 956712
21
+ Group - Adrienne Schaden - 479210
26
22
 
27
- Group - Alfred Stokes - 89338
23
+ Group - Al Goldner - 873914
28
24
 
29
- Group - Alice Green - 890610
25
+ Group - Albert King - 98799
30
26
 
31
- Group - Allison Padberg III - 27086
27
+ Group - Alberta Hilpert-Walter - 88645
32
28
 
33
- Group - Alma Sanford - 66055
29
+ Group - Alberta Shields - 35378
34
30
 
35
- Group - Alvin Wolf Sr. - 47075
31
+ Group - Alberto Kohler - 649411
36
32
 
37
- Group - Amanda Kunde - 348613
33
+ Group - Alberto O'Keefe-Connelly - 37468
38
34
 
39
- Group - Amelia Zemlak - 819710
35
+ Group - Alberto Schultz Jr. - 66257
40
36
 
41
- Group - Amos Welch - 13858
37
+ Group - Alex Johnson - 42376
42
38
 
43
- Group - Ana Greenfelder - 97437
39
+ Group - Alexandra Smith - 303812
44
40
 
45
- Group - Andrea Mueller - 75687
41
+ Group - Alexandra Volkman-Huels - 20898
46
42
 
47
- Group - Andrew Howell Sr. - 815511
43
+ Group - Alonzo Runte - 23058
48
44
 
49
45
  200
50
46
 
@@ -72,38 +68,36 @@ Asset type filter:
72
68
 
73
69
  Filter
74
70
 
75
- 5384
71
+ 5495
76
72
  4
77
73
 
78
- Group - Abraham Watsica - 621113
79
-
80
- Group - Adam Windler - 770317
74
+ Group - Aaron Mohr - 86039
81
75
 
82
- Group - Alexandra Collins - 999013
76
+ Group - Adrian O'Hara - 439811
83
77
 
84
- Group - Alfred Olson - 956712
78
+ Group - Adrienne Schaden - 479210
85
79
 
86
- Group - Alfred Stokes - 89338
80
+ Group - Al Goldner - 873914
87
81
 
88
- Group - Alice Green - 890610
82
+ Group - Albert King - 98799
89
83
 
90
- Group - Allison Padberg III - 27086
84
+ Group - Alberta Hilpert-Walter - 88645
91
85
 
92
- Group - Alma Sanford - 66055
86
+ Group - Alberta Shields - 35378
93
87
 
94
- Group - Alvin Wolf Sr. - 47075
88
+ Group - Alberto Kohler - 649411
95
89
 
96
- Group - Amanda Kunde - 348613
90
+ Group - Alberto O'Keefe-Connelly - 37468
97
91
 
98
- Group - Amelia Zemlak - 819710
92
+ Group - Alberto Schultz Jr. - 66257
99
93
 
100
- Group - Amos Welch - 13858
94
+ Group - Alex Johnson - 42376
101
95
 
102
- Group - Ana Greenfelder - 97437
96
+ Group - Alexandra Smith - 303812
103
97
 
104
- Group - Andrea Mueller - 75687
98
+ Group - Alexandra Volkman-Huels - 20898
105
99
 
106
- Group - Andrew Howell Sr. - 815511
100
+ Group - Alonzo Runte - 23058
107
101
 
108
102
  200
109
103
 
@@ -132,7 +126,7 @@ Asset type filter:
132
126
  ```tsx
133
127
  import { useState } from 'react';
134
128
  import { get, isEmpty, isObject, random } from 'es-toolkit/compat';
135
- import faker from 'faker';
129
+ import { faker } from '@faker-js/faker';
136
130
 
137
131
  import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
138
132
  import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
@@ -155,8 +149,8 @@ const CATEGORY_LOREM = 'lorem';
155
149
  const randomDrivers = Array.from({ length: 200 }, (_, index) => ({
156
150
  id: `74e8eb86-18a1-4abe-90cb-aeee7909f85${index}`,
157
151
  name: {
158
- firstName: faker.internet.userName(),
159
- lastName: faker.name.firstName(),
152
+ firstName: faker.internet.username(),
153
+ lastName: faker.person.firstName(),
160
154
  },
161
155
  type: 'driver',
162
156
  }));
@@ -164,7 +158,7 @@ const randomDrivers = Array.from({ length: 200 }, (_, index) => ({
164
158
  const getTruckGroups = (): TreeGroup[] => {
165
159
  const groups = Array.from({ length: random(400, 600) }, (_, index) => ({
166
160
  id: `group-${index}`,
167
- name: `Group - ${faker.name.findName()} - ${random(1000, 9999)}`,
161
+ name: `Group - ${faker.person.fullName()} - ${random(1000, 9999)}`,
168
162
  }));
169
163
  return [
170
164
  ...groups,
@@ -234,7 +228,7 @@ const getTrucks = (namePrefix = 'Vehicle-'): TreeItem[] => {
234
228
  name: `${namePrefix}${random(1000, 9999)}`,
235
229
  info: `M-AN 1${String(index).padStart(3, '0')}`,
236
230
  type: 'truck',
237
- groupIds: [faker.random.arrayElement(groups).id],
231
+ groupIds: [faker.helpers.arrayElement(groups).id],
238
232
  }));
239
233
  return [...randomTrucks, ...trailer];
240
234
  };
@@ -472,172 +466,35 @@ const AssetTreeExample = () => {
472
466
  export default AssetTreeExample;
473
467
  ```
474
468
 
475
- #### Props: AssetTree
476
-
477
- ### AssetTree
478
-
479
- | Name | Type | Default | Description |
480
- | --- | --- | --- | --- |
481
- | fly | boolean | false | Defines if the component will overlap the body content. |
482
- | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
483
- | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
484
- | bordered | boolean | false | Defines whether the component has a border or not. |
485
- | 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. |
486
- | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
487
- | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
488
- | height | number | — | Defines the height of the component in px. |
489
- | isOpen | boolean | true | Defines whether the component is open or not. |
490
- | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
491
- | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
492
- | onCategoryChange | Function | () => {} | Callback for handling change of category. |
493
- | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
494
- | className | String | — | Additional classes added on the wrapper element. |
495
- | children | TreeCategory | — | A list of TreeCategory components |
496
-
497
- #### Props: TreeCategory
498
-
499
- ### TreeCategory
500
-
501
- | Name | Type | Default | Description |
502
- | --- | --- | --- | --- |
503
- | id | String | — | A unique identifier for that category. |
504
- | icon | String | — | The rioglyph icon name for that category. |
505
- | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
506
- | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
507
-
508
- #### Props: Tree
509
-
510
- ### Tree
511
-
512
- | Name | Type | Default | Description |
513
- | --- | --- | --- | --- |
514
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
515
- | └id | String | — | A unique identifier of a group. |
516
- | └name | String | — | The name of a group. |
517
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
518
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
519
- | └className | String | — | Additional classes added to the group element. |
520
- | items | Array of Objects | [] | The list of items. |
521
- | └id | String | — | A unique identifier of an item. |
522
- | └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 |
523
- | └info | String \| Node | — | The subline of an item. |
524
- | └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). |
525
- | └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. |
526
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
527
- | └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. |
528
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
529
- | └className | string | — | Additional classes added to the item element. |
530
- | selectedGroups | Array of strings | — | List of selected group ids. |
531
- | selectedItems | Array of strings | — | List of selected item ids. |
532
- | 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: [] } |
533
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
534
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
535
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
536
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
537
- | onSearchChange | Function | — | Callback for when the search value changes. |
538
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
539
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
540
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
541
- | hideSummary | boolean | false | Defines whether a summary is shown. |
542
- | 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. |
543
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
544
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
545
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
546
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
547
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
548
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
549
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
550
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
551
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
552
- | className | String | — | Additional classes added to the wrapping element. |
553
-
554
- #### Props: TreeSearch
555
-
556
- ### TreeSearch
557
-
558
- | Name | Type | Default | Description |
559
- | --- | --- | --- | --- |
560
- | value | String | — | The search value to be shown and used for the search. |
561
- | onChange | Function | () => {} | Callback for when the search value changes. |
562
- | placeholder | String | — | The placeholder text used for the input field. |
563
- | className | String | — | Additional classes added to the wrapping element. |
564
-
565
- #### Props: TreeSummary
566
-
567
- ### TreeSummary
568
-
569
- | Name | Type | Default | Description |
570
- | --- | --- | --- | --- |
571
- | assetCounts | object | — | The object containing various asset type counter. |
572
- | └truck | number | — | The amount of trucks. |
573
- | └trailer | number | — | The amount of trailers. |
574
- | └bus | number | — | The amount of buses. |
575
- | └van | number | — | The amount of vans. |
576
- | └driver | number | — | The amount of drivers. |
577
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
578
- | className | string | — | Additional classes added to the wrapping element. |
579
-
580
- #### Props: TreeSummaryRow
581
-
582
- ### TreeSummaryRow
583
-
584
- | Name | Type | Default | Description |
585
- | --- | --- | --- | --- |
586
- | 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. |
587
-
588
- #### Props: TypeCounter
589
-
590
- ### TypeCounter
591
-
592
- | Name | Type | Default | Description |
593
- | --- | --- | --- | --- |
594
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
595
- | 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. |
596
- | isActive | Boolean | — | Sets the active styling if active. |
597
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
598
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
599
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
600
- | 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. |
601
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
602
-
603
- #### Props: TreeOption
604
-
605
- ### TreeOption
606
-
607
- | Name | Type | Default | Description |
608
- | --- | --- | --- | --- |
609
- | isChecked | boolean | — | Defines whether the option is set. |
610
- | label | string / node | — | The label for the option. |
611
- | onChange | Function | — | Callback triggered when option is selected. |
612
- | className | string | — | Additional classes added to the wrapping element. |
613
-
614
469
  ## AssetTree with single select
615
470
 
616
471
  ### Example: Example 2
617
472
 
618
- 10
619
- 5
620
- 9
473
+ 6
474
+ 11
475
+ 7
621
476
  6
622
477
 
623
- My Empty Group5
478
+ My Empty Group2
624
479
 
625
480
  Truck Group East5
626
481
 
627
- Truck Group North7
628
- N18-G109 / M-AN 1018
629
- N18-G176 / M-AN 1026
630
- N18-G560 / M-AN 1006
631
- N18-G704 / M-AN 1007
632
- N18-G811 / M-AN 1005
633
- N18-G830 / M-AN 1010
634
- N18-G961 / M-AN 1009
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
635
492
 
636
- Truck Group South7
493
+ Truck Group South4
637
494
 
638
- Truck Group West3
495
+ Truck Group West4
639
496
 
640
- All my unassigned Trucks3
497
+ All my unassigned Trucks6
641
498
 
642
499
  Current category:
643
500
  assets
@@ -650,29 +507,31 @@ Truck Group North
650
507
 
651
508
  #### Summary
652
509
 
653
- 10
654
- 5
655
- 9
510
+ 6
511
+ 11
512
+ 7
656
513
  6
657
514
 
658
- My Empty Group5
515
+ My Empty Group2
659
516
 
660
517
  Truck Group East5
661
518
 
662
- Truck Group North7
663
- N18-G109 / M-AN 1018
664
- N18-G176 / M-AN 1026
665
- N18-G560 / M-AN 1006
666
- N18-G704 / M-AN 1007
667
- N18-G811 / M-AN 1005
668
- N18-G830 / M-AN 1010
669
- N18-G961 / M-AN 1009
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
670
529
 
671
- Truck Group South7
530
+ Truck Group South4
672
531
 
673
- Truck Group West3
532
+ Truck Group West4
674
533
 
675
- All my unassigned Trucks3
534
+ All my unassigned Trucks6
676
535
 
677
536
  Current category:
678
537
  assets
@@ -688,7 +547,7 @@ Truck Group North
688
547
  ```tsx
689
548
  import { useState } from 'react';
690
549
  import { isEmpty, isObject, random } from 'es-toolkit/compat';
691
- import faker from 'faker';
550
+ import { faker } from '@faker-js/faker';
692
551
 
693
552
  import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
694
553
  import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
@@ -735,8 +594,8 @@ const assetTypes = ['truck', 'bus', 'van', 'trailer'];
735
594
  const assets = Array.from({ length: 30 }, (_, index) => ({
736
595
  id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
737
596
  name: `N18-G${random(100, 999)} / M-AN 1${String(index).padStart(3, '0')}`,
738
- type: faker.random.arrayElement(assetTypes),
739
- groupIds: [faker.random.arrayElement(assetGroups).id],
597
+ type: faker.helpers.arrayElement(assetTypes),
598
+ groupIds: [faker.helpers.arrayElement(assetGroups).id],
740
599
  }));
741
600
 
742
601
  const AssetTreeSingleSelectExample = () => {
@@ -871,20 +730,20 @@ export default AssetTreeSingleSelectExample;
871
730
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
872
731
  <span class="rioglyph rioglyph-trailer text-size-16 margin-right-2">
873
732
  </span>
874
- <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>
875
734
  </div>
876
735
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
877
736
  <span class="rioglyph rioglyph-van text-size-16 margin-right-2">
878
737
  </span>
879
- <span class="TreeLabelCount label label-condensed label-muted label-filled">5</span>
738
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">11</span>
880
739
  </div>
881
740
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
882
- <span class="rioglyph rioglyph-bus text-size-16 margin-right-2">
741
+ <span class="rioglyph rioglyph-truck text-size-16 margin-right-2">
883
742
  </span>
884
- <span class="TreeLabelCount label label-condensed label-muted label-filled">9</span>
743
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
885
744
  </div>
886
745
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
887
- <span class="rioglyph rioglyph-truck text-size-16 margin-right-2">
746
+ <span class="rioglyph rioglyph-bus text-size-16 margin-right-2">
888
747
  </span>
889
748
  <span class="TreeLabelCount label label-condensed label-muted label-filled">6</span>
890
749
  </div>
@@ -899,7 +758,7 @@ export default AssetTreeSingleSelectExample;
899
758
  <span class="TreeLabelNameText">
900
759
  <span class="TreeLabelNameTextHeadline">My Empty Group</span>
901
760
  </span>
902
- <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
761
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">2</span>
903
762
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
904
763
  </span>
905
764
  </span>
@@ -923,17 +782,35 @@ export default AssetTreeSingleSelectExample;
923
782
  <span class="TreeLabelNameText">
924
783
  <span class="TreeLabelNameTextHeadline">Truck Group North</span>
925
784
  </span>
926
- <span class="TreeLabelCount label label-muted label-filled label-condensed">7</span>
785
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">9</span>
927
786
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
928
787
  </span>
929
788
  </span>
930
789
  </div>
790
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9728">
791
+ <span class="TreeLabel TreeLabelName">
792
+ <span class="rioglyph rioglyph-trailer">
793
+ </span>
794
+ <span class="TreeLabelNameText">
795
+ <span class="TreeLabelNameTextHeadline">N18-G262 / M-AN 1028</span>
796
+ </span>
797
+ </span>
798
+ </div>
931
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">
932
809
  <span class="TreeLabel TreeLabelName">
933
810
  <span class="rioglyph rioglyph-truck">
934
811
  </span>
935
812
  <span class="TreeLabelNameText">
936
- <span class="TreeLabelNameTextHeadline">N18-G109 / M-AN 1018</span>
813
+ <span class="TreeLabelNameTextHeadline">N18-G399 / M-AN 1005</span>
937
814
  </span>
938
815
  </span>
939
816
  </div>
@@ -942,52 +819,52 @@ export default AssetTreeSingleSelectExample;
942
819
  <span class="rioglyph rioglyph-van">
943
820
  </span>
944
821
  <span class="TreeLabelNameText">
945
- <span class="TreeLabelNameTextHeadline">N18-G176 / M-AN 1026</span>
822
+ <span class="TreeLabelNameTextHeadline">N18-G458 / M-AN 1026</span>
946
823
  </span>
947
824
  </span>
948
825
  </div>
949
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d976">
826
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9713">
950
827
  <span class="TreeLabel TreeLabelName">
951
- <span class="rioglyph rioglyph-bus">
828
+ <span class="rioglyph rioglyph-truck">
952
829
  </span>
953
830
  <span class="TreeLabelNameText">
954
- <span class="TreeLabelNameTextHeadline">N18-G560 / M-AN 1006</span>
831
+ <span class="TreeLabelNameTextHeadline">N18-G467 / M-AN 1013</span>
955
832
  </span>
956
833
  </span>
957
834
  </div>
958
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d977">
835
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9711">
959
836
  <span class="TreeLabel TreeLabelName">
960
- <span class="rioglyph rioglyph-trailer">
837
+ <span class="rioglyph rioglyph-van">
961
838
  </span>
962
839
  <span class="TreeLabelNameText">
963
- <span class="TreeLabelNameTextHeadline">N18-G704 / M-AN 1007</span>
840
+ <span class="TreeLabelNameTextHeadline">N18-G489 / M-AN 1011</span>
964
841
  </span>
965
842
  </span>
966
843
  </div>
967
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d975">
844
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9719">
968
845
  <span class="TreeLabel TreeLabelName">
969
- <span class="rioglyph rioglyph-trailer">
846
+ <span class="rioglyph rioglyph-van">
970
847
  </span>
971
848
  <span class="TreeLabelNameText">
972
- <span class="TreeLabelNameTextHeadline">N18-G811 / M-AN 1005</span>
849
+ <span class="TreeLabelNameTextHeadline">N18-G728 / M-AN 1019</span>
973
850
  </span>
974
851
  </span>
975
852
  </div>
976
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9710">
853
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9722">
977
854
  <span class="TreeLabel TreeLabelName">
978
- <span class="rioglyph rioglyph-truck">
855
+ <span class="rioglyph rioglyph-bus">
979
856
  </span>
980
857
  <span class="TreeLabelNameText">
981
- <span class="TreeLabelNameTextHeadline">N18-G830 / M-AN 1010</span>
858
+ <span class="TreeLabelNameTextHeadline">N18-G796 / M-AN 1022</span>
982
859
  </span>
983
860
  </span>
984
861
  </div>
985
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d979">
862
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9716">
986
863
  <span class="TreeLabel TreeLabelName">
987
- <span class="rioglyph rioglyph-trailer">
864
+ <span class="rioglyph rioglyph-bus">
988
865
  </span>
989
866
  <span class="TreeLabelNameText">
990
- <span class="TreeLabelNameTextHeadline">N18-G961 / M-AN 1009</span>
867
+ <span class="TreeLabelNameTextHeadline">N18-G815 / M-AN 1016</span>
991
868
  </span>
992
869
  </span>
993
870
  </div>
@@ -998,7 +875,7 @@ export default AssetTreeSingleSelectExample;
998
875
  <span class="TreeLabelNameText">
999
876
  <span class="TreeLabelNameTextHeadline">Truck Group South</span>
1000
877
  </span>
1001
- <span class="TreeLabelCount label label-muted label-filled label-condensed">7</span>
878
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
1002
879
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1003
880
  </span>
1004
881
  </span>
@@ -1010,7 +887,7 @@ export default AssetTreeSingleSelectExample;
1010
887
  <span class="TreeLabelNameText">
1011
888
  <span class="TreeLabelNameTextHeadline">Truck Group West</span>
1012
889
  </span>
1013
- <span class="TreeLabelCount label label-muted label-filled label-condensed">3</span>
890
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
1014
891
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1015
892
  </span>
1016
893
  </span>
@@ -1022,7 +899,7 @@ export default AssetTreeSingleSelectExample;
1022
899
  <span class="TreeLabelNameText">
1023
900
  <span class="TreeLabelNameTextHeadline">All my unassigned Trucks</span>
1024
901
  </span>
1025
- <span class="TreeLabelCount label label-muted label-filled label-condensed">3</span>
902
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">6</span>
1026
903
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1027
904
  </span>
1028
905
  </span>
@@ -1063,177 +940,33 @@ export default AssetTreeSingleSelectExample;
1063
940
  </div>
1064
941
  ```
1065
942
 
1066
- #### Props: AssetTree
1067
-
1068
- ### AssetTree
1069
-
1070
- | Name | Type | Default | Description |
1071
- | --- | --- | --- | --- |
1072
- | fly | boolean | false | Defines if the component will overlap the body content. |
1073
- | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
1074
- | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
1075
- | bordered | boolean | false | Defines whether the component has a border or not. |
1076
- | 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. |
1077
- | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
1078
- | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
1079
- | height | number | — | Defines the height of the component in px. |
1080
- | isOpen | boolean | true | Defines whether the component is open or not. |
1081
- | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
1082
- | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
1083
- | onCategoryChange | Function | () => {} | Callback for handling change of category. |
1084
- | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
1085
- | className | String | — | Additional classes added on the wrapper element. |
1086
- | children | TreeCategory | — | A list of TreeCategory components |
1087
-
1088
- #### Props: TreeCategory
1089
-
1090
- ### TreeCategory
1091
-
1092
- | Name | Type | Default | Description |
1093
- | --- | --- | --- | --- |
1094
- | id | String | — | A unique identifier for that category. |
1095
- | icon | String | — | The rioglyph icon name for that category. |
1096
- | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
1097
- | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
1098
-
1099
- #### Props: Tree
1100
-
1101
- ### Tree
1102
-
1103
- | Name | Type | Default | Description |
1104
- | --- | --- | --- | --- |
1105
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
1106
- | └id | String | — | A unique identifier of a group. |
1107
- | └name | String | — | The name of a group. |
1108
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
1109
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
1110
- | └className | String | — | Additional classes added to the group element. |
1111
- | items | Array of Objects | [] | The list of items. |
1112
- | └id | String | — | A unique identifier of an item. |
1113
- | └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 |
1114
- | └info | String \| Node | — | The subline of an item. |
1115
- | └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). |
1116
- | └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. |
1117
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
1118
- | └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. |
1119
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
1120
- | └className | string | — | Additional classes added to the item element. |
1121
- | selectedGroups | Array of strings | — | List of selected group ids. |
1122
- | selectedItems | Array of strings | — | List of selected item ids. |
1123
- | 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: [] } |
1124
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
1125
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
1126
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
1127
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
1128
- | onSearchChange | Function | — | Callback for when the search value changes. |
1129
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
1130
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
1131
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
1132
- | hideSummary | boolean | false | Defines whether a summary is shown. |
1133
- | 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. |
1134
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
1135
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
1136
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
1137
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
1138
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
1139
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
1140
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
1141
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
1142
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
1143
- | className | String | — | Additional classes added to the wrapping element. |
1144
-
1145
- #### Props: TreeSearch
1146
-
1147
- ### TreeSearch
1148
-
1149
- | Name | Type | Default | Description |
1150
- | --- | --- | --- | --- |
1151
- | value | String | — | The search value to be shown and used for the search. |
1152
- | onChange | Function | () => {} | Callback for when the search value changes. |
1153
- | placeholder | String | — | The placeholder text used for the input field. |
1154
- | className | String | — | Additional classes added to the wrapping element. |
1155
-
1156
- #### Props: TreeSummary
1157
-
1158
- ### TreeSummary
1159
-
1160
- | Name | Type | Default | Description |
1161
- | --- | --- | --- | --- |
1162
- | assetCounts | object | — | The object containing various asset type counter. |
1163
- | └truck | number | — | The amount of trucks. |
1164
- | └trailer | number | — | The amount of trailers. |
1165
- | └bus | number | — | The amount of buses. |
1166
- | └van | number | — | The amount of vans. |
1167
- | └driver | number | — | The amount of drivers. |
1168
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
1169
- | className | string | — | Additional classes added to the wrapping element. |
1170
-
1171
- #### Props: TreeSummaryRow
1172
-
1173
- ### TreeSummaryRow
1174
-
1175
- | Name | Type | Default | Description |
1176
- | --- | --- | --- | --- |
1177
- | 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. |
1178
-
1179
- #### Props: TypeCounter
1180
-
1181
- ### TypeCounter
1182
-
1183
- | Name | Type | Default | Description |
1184
- | --- | --- | --- | --- |
1185
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
1186
- | 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. |
1187
- | isActive | Boolean | — | Sets the active styling if active. |
1188
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
1189
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
1190
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
1191
- | 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. |
1192
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
1193
-
1194
- #### Props: TreeOption
1195
-
1196
- ### TreeOption
1197
-
1198
- | Name | Type | Default | Description |
1199
- | --- | --- | --- | --- |
1200
- | isChecked | boolean | — | Defines whether the option is set. |
1201
- | label | string / node | — | The label for the option. |
1202
- | onChange | Function | — | Callback triggered when option is selected. |
1203
- | className | string | — | Additional classes added to the wrapping element. |
1204
-
1205
943
  ## AssetTree with multiple asset filter in summary
1206
944
 
1207
- 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.
1208
-
1209
945
  ### Example: Example 3
1210
946
 
1211
- 7
947
+ 5
948
+ 4
1212
949
  4
1213
- 3
1214
- 6
1215
-
1216
950
  7
951
+
952
+ 8
1217
953
  5
1218
- 1
1219
- 4
954
+ 2
955
+ 2
1220
956
  3
1221
957
 
1222
- Mixed Vehicles12
1223
- Vehicle-1219Debug: lpg
1224
- Vehicle-1695Debug: heavy_fuel_oil
1225
- Vehicle-2865Debug: gas
1226
- Vehicle-2935Debug: hydrogen
1227
- Vehicle-4548Debug: lpg
1228
- Vehicle-4993Debug: hydrogen
1229
- Vehicle-5555Debug: heavy_fuel_oil
1230
- Vehicle-7086Debug: diesel
1231
- Vehicle-8678Debug: dual_fuel_diesel_cng
1232
- Vehicle-8791Debug: hydrogen
1233
- Vehicle-9194Debug: lpg
1234
- Vehicle-9266Debug: hydrogen
1235
-
1236
- Ungrouped8
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
968
+
969
+ Ungrouped11
1237
970
 
1238
971
  Selected groups:
1239
972
 
@@ -1244,32 +977,29 @@ Mixed Vehicles
1244
977
 
1245
978
  #### Summary
1246
979
 
1247
- 7
980
+ 5
981
+ 4
1248
982
  4
1249
- 3
1250
- 6
1251
-
1252
983
  7
984
+
985
+ 8
1253
986
  5
1254
- 1
1255
- 4
987
+ 2
988
+ 2
1256
989
  3
1257
990
 
1258
- Mixed Vehicles12
1259
- Vehicle-1219Debug: lpg
1260
- Vehicle-1695Debug: heavy_fuel_oil
1261
- Vehicle-2865Debug: gas
1262
- Vehicle-2935Debug: hydrogen
1263
- Vehicle-4548Debug: lpg
1264
- Vehicle-4993Debug: hydrogen
1265
- Vehicle-5555Debug: heavy_fuel_oil
1266
- Vehicle-7086Debug: diesel
1267
- Vehicle-8678Debug: dual_fuel_diesel_cng
1268
- Vehicle-8791Debug: hydrogen
1269
- Vehicle-9194Debug: lpg
1270
- Vehicle-9266Debug: hydrogen
1271
-
1272
- Ungrouped8
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
1001
+
1002
+ Ungrouped11
1273
1003
 
1274
1004
  Selected groups:
1275
1005
 
@@ -1283,7 +1013,7 @@ Mixed Vehicles
1283
1013
  ```tsx
1284
1014
  import { useMemo, useState } from 'react';
1285
1015
  import { isEmpty, random } from 'es-toolkit/compat';
1286
- import faker from 'faker';
1016
+ import { faker } from '@faker-js/faker';
1287
1017
 
1288
1018
  import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
1289
1019
  import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
@@ -1334,15 +1064,15 @@ const fuelTypes = ['diesel', 'electric', 'gas', 'hydrogen', 'cng', 'lpg', 'dual_
1334
1064
 
1335
1065
  const getVehicles = (withSubType = true): TreeItem[] =>
1336
1066
  Array.from({ length: 20 }, (_, index) => {
1337
- const fuelType = withSubType ? faker.random.arrayElement(fuelTypes) : undefined;
1067
+ const fuelType = withSubType ? faker.helpers.arrayElement(fuelTypes) : undefined;
1338
1068
  return {
1339
1069
  id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
1340
1070
  name: `Vehicle-${random(1000, 9999)}`,
1341
1071
  info: <span>Debug: {fuelType}</span>,
1342
- type: faker.random.arrayElement(assetTypes),
1072
+ type: faker.helpers.arrayElement(assetTypes),
1343
1073
  subType: fuelType, // subType cannot be used as icon here anymore
1344
1074
  pairIcon: getFuelIcon(fuelType),
1345
- groupIds: [faker.random.arrayElement(truckGroups).id],
1075
+ groupIds: [faker.helpers.arrayElement(truckGroups).id],
1346
1076
  };
1347
1077
  });
1348
1078
 
@@ -1604,7 +1334,7 @@ export default AssetTreeExample;
1604
1334
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1605
1335
  <span class="rioglyph rioglyph-truck-baseline text-size-16 margin-right-2">
1606
1336
  </span>
1607
- <span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
1337
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">5</span>
1608
1338
  </div>
1609
1339
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1610
1340
  <span class="rioglyph rioglyph-bus-baseline text-size-16 margin-right-2">
@@ -1614,19 +1344,19 @@ export default AssetTreeExample;
1614
1344
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1615
1345
  <span class="rioglyph rioglyph-van-baseline text-size-16 margin-right-2">
1616
1346
  </span>
1617
- <span class="TreeLabelCount label label-condensed label-muted label-filled">3</span>
1347
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">4</span>
1618
1348
  </div>
1619
1349
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1620
1350
  <span class="rioglyph rioglyph-car-baseline text-size-16 margin-right-2">
1621
1351
  </span>
1622
- <span class="TreeLabelCount label label-condensed label-muted label-filled">6</span>
1352
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
1623
1353
  </div>
1624
1354
  </div>
1625
1355
  <div class="TreeSummaryRow display-grid grid-cols-4 gap-10">
1626
1356
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1627
1357
  <span class="rioglyph rioglyph-fuel-liquid text-size-16 margin-right-2">
1628
1358
  </span>
1629
- <span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
1359
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">8</span>
1630
1360
  </div>
1631
1361
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1632
1362
  <span class="rioglyph rioglyph-fuel-gas text-size-16 margin-right-2">
@@ -1636,12 +1366,12 @@ export default AssetTreeExample;
1636
1366
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1637
1367
  <span class="rioglyph rioglyph-fuel-electric text-size-16 margin-right-2">
1638
1368
  </span>
1639
- <span class="TreeLabelCount label label-condensed label-muted label-filled">1</span>
1369
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
1640
1370
  </div>
1641
1371
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1642
1372
  <span class="rioglyph rioglyph-fuel-hydrogen text-size-16 margin-right-2">
1643
1373
  </span>
1644
- <span class="TreeLabelCount label label-condensed label-muted label-filled">4</span>
1374
+ <span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
1645
1375
  </div>
1646
1376
  <div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
1647
1377
  <span class="rioglyph rioglyph-fuel-mix text-size-16 margin-right-2">
@@ -1653,7 +1383,7 @@ export default AssetTreeExample;
1653
1383
  </div>
1654
1384
  <div>
1655
1385
  <div class="dropdown btn-group TreeHeaderOptions height-20">
1656
- <button type="button" id="9bc9newyu7d" 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">
1657
1387
  <span class="rioglyph rioglyph-option-vertical" aria-hidden="true">
1658
1388
  </span>
1659
1389
  </button>
@@ -1673,12 +1403,12 @@ export default AssetTreeExample;
1673
1403
  <span class="TreeLabelNameText">
1674
1404
  <span class="TreeLabelNameTextHeadline">Mixed Vehicles</span>
1675
1405
  </span>
1676
- <span class="TreeLabelCount label label-muted label-filled label-condensed">12</span>
1406
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">9</span>
1677
1407
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1678
1408
  </span>
1679
1409
  </span>
1680
1410
  </div>
1681
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d970">
1411
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9711">
1682
1412
  <label class="checkbox TreeCheckbox" tabindex="0">
1683
1413
  <input type="checkbox" class="TreeCheckbox">
1684
1414
  <span class="checkbox-text">
@@ -1686,20 +1416,20 @@ export default AssetTreeExample;
1686
1416
  </label>
1687
1417
  <span class="TreeLabel TreeLabelName">
1688
1418
  <span class="rioglyph-icon-pair">
1689
- <span class="rioglyph rioglyph-truck">
1419
+ <span class="rioglyph rioglyph-van">
1690
1420
  </span>
1691
1421
  <span class="rioglyph rioglyph-fuel-gas">
1692
1422
  </span>
1693
1423
  </span>
1694
1424
  <span class="TreeLabelNameText">
1695
- <span class="TreeLabelNameTextHeadline">Vehicle-1219</span>
1425
+ <span class="TreeLabelNameTextHeadline">Vehicle-2340</span>
1696
1426
  <span class="TreeLabelNameTextSubline">
1697
- <span>Debug: lpg</span>
1427
+ <span>Debug: cng</span>
1698
1428
  </span>
1699
1429
  </span>
1700
1430
  </span>
1701
1431
  </div>
1702
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d978">
1432
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d972">
1703
1433
  <label class="checkbox TreeCheckbox" tabindex="0">
1704
1434
  <input type="checkbox" class="TreeCheckbox">
1705
1435
  <span class="checkbox-text">
@@ -1707,20 +1437,20 @@ export default AssetTreeExample;
1707
1437
  </label>
1708
1438
  <span class="TreeLabel TreeLabelName">
1709
1439
  <span class="rioglyph-icon-pair">
1710
- <span class="rioglyph rioglyph-car">
1440
+ <span class="rioglyph rioglyph-van">
1711
1441
  </span>
1712
- <span class="rioglyph rioglyph-fuel-liquid">
1442
+ <span class="rioglyph rioglyph-fuel-electric">
1713
1443
  </span>
1714
1444
  </span>
1715
1445
  <span class="TreeLabelNameText">
1716
- <span class="TreeLabelNameTextHeadline">Vehicle-1695</span>
1446
+ <span class="TreeLabelNameTextHeadline">Vehicle-3222</span>
1717
1447
  <span class="TreeLabelNameTextSubline">
1718
- <span>Debug: heavy_fuel_oil</span>
1448
+ <span>Debug: electric</span>
1719
1449
  </span>
1720
1450
  </span>
1721
1451
  </span>
1722
1452
  </div>
1723
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9718">
1453
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d978">
1724
1454
  <label class="checkbox TreeCheckbox" tabindex="0">
1725
1455
  <input type="checkbox" class="TreeCheckbox">
1726
1456
  <span class="checkbox-text">
@@ -1728,41 +1458,20 @@ export default AssetTreeExample;
1728
1458
  </label>
1729
1459
  <span class="TreeLabel TreeLabelName">
1730
1460
  <span class="rioglyph-icon-pair">
1731
- <span class="rioglyph rioglyph-car">
1461
+ <span class="rioglyph rioglyph-van">
1732
1462
  </span>
1733
1463
  <span class="rioglyph rioglyph-fuel-liquid">
1734
1464
  </span>
1735
1465
  </span>
1736
1466
  <span class="TreeLabelNameText">
1737
- <span class="TreeLabelNameTextHeadline">Vehicle-2865</span>
1738
- <span class="TreeLabelNameTextSubline">
1739
- <span>Debug: gas</span>
1740
- </span>
1741
- </span>
1742
- </span>
1743
- </div>
1744
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9714">
1745
- <label class="checkbox TreeCheckbox" tabindex="0">
1746
- <input type="checkbox" class="TreeCheckbox">
1747
- <span class="checkbox-text">
1748
- </span>
1749
- </label>
1750
- <span class="TreeLabel TreeLabelName">
1751
- <span class="rioglyph-icon-pair">
1752
- <span class="rioglyph rioglyph-truck">
1753
- </span>
1754
- <span class="rioglyph rioglyph-fuel-hydrogen">
1755
- </span>
1756
- </span>
1757
- <span class="TreeLabelNameText">
1758
- <span class="TreeLabelNameTextHeadline">Vehicle-2935</span>
1467
+ <span class="TreeLabelNameTextHeadline">Vehicle-3383</span>
1759
1468
  <span class="TreeLabelNameTextSubline">
1760
- <span>Debug: hydrogen</span>
1469
+ <span>Debug: heavy_fuel_oil</span>
1761
1470
  </span>
1762
1471
  </span>
1763
1472
  </span>
1764
1473
  </div>
1765
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d979">
1474
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d975">
1766
1475
  <label class="checkbox TreeCheckbox" tabindex="0">
1767
1476
  <input type="checkbox" class="TreeCheckbox">
1768
1477
  <span class="checkbox-text">
@@ -1776,14 +1485,14 @@ export default AssetTreeExample;
1776
1485
  </span>
1777
1486
  </span>
1778
1487
  <span class="TreeLabelNameText">
1779
- <span class="TreeLabelNameTextHeadline">Vehicle-4548</span>
1488
+ <span class="TreeLabelNameTextHeadline">Vehicle-3519</span>
1780
1489
  <span class="TreeLabelNameTextSubline">
1781
1490
  <span>Debug: lpg</span>
1782
1491
  </span>
1783
1492
  </span>
1784
1493
  </span>
1785
1494
  </div>
1786
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9717">
1495
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d970">
1787
1496
  <label class="checkbox TreeCheckbox" tabindex="0">
1788
1497
  <input type="checkbox" class="TreeCheckbox">
1789
1498
  <span class="checkbox-text">
@@ -1793,60 +1502,18 @@ export default AssetTreeExample;
1793
1502
  <span class="rioglyph-icon-pair">
1794
1503
  <span class="rioglyph rioglyph-bus">
1795
1504
  </span>
1796
- <span class="rioglyph rioglyph-fuel-hydrogen">
1797
- </span>
1798
- </span>
1799
- <span class="TreeLabelNameText">
1800
- <span class="TreeLabelNameTextHeadline">Vehicle-4993</span>
1801
- <span class="TreeLabelNameTextSubline">
1802
- <span>Debug: hydrogen</span>
1803
- </span>
1804
- </span>
1805
- </span>
1806
- </div>
1807
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d973">
1808
- <label class="checkbox TreeCheckbox" tabindex="0">
1809
- <input type="checkbox" class="TreeCheckbox">
1810
- <span class="checkbox-text">
1811
- </span>
1812
- </label>
1813
- <span class="TreeLabel TreeLabelName">
1814
- <span class="rioglyph-icon-pair">
1815
- <span class="rioglyph rioglyph-car">
1816
- </span>
1817
1505
  <span class="rioglyph rioglyph-fuel-liquid">
1818
1506
  </span>
1819
1507
  </span>
1820
1508
  <span class="TreeLabelNameText">
1821
- <span class="TreeLabelNameTextHeadline">Vehicle-5555</span>
1509
+ <span class="TreeLabelNameTextHeadline">Vehicle-3837</span>
1822
1510
  <span class="TreeLabelNameTextSubline">
1823
- <span>Debug: heavy_fuel_oil</span>
1824
- </span>
1825
- </span>
1826
- </span>
1827
- </div>
1828
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d971">
1829
- <label class="checkbox TreeCheckbox" tabindex="0">
1830
- <input type="checkbox" class="TreeCheckbox">
1831
- <span class="checkbox-text">
1832
- </span>
1833
- </label>
1834
- <span class="TreeLabel TreeLabelName">
1835
- <span class="rioglyph-icon-pair">
1836
- <span class="rioglyph rioglyph-car">
1837
- </span>
1838
- <span class="rioglyph rioglyph-fuel-liquid">
1839
- </span>
1840
- </span>
1841
- <span class="TreeLabelNameText">
1842
- <span class="TreeLabelNameTextHeadline">Vehicle-7086</span>
1843
- <span class="TreeLabelNameTextSubline">
1844
- <span>Debug: diesel</span>
1511
+ <span>Debug: gas</span>
1845
1512
  </span>
1846
1513
  </span>
1847
1514
  </span>
1848
1515
  </div>
1849
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d976">
1516
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d977">
1850
1517
  <label class="checkbox TreeCheckbox" tabindex="0">
1851
1518
  <input type="checkbox" class="TreeCheckbox">
1852
1519
  <span class="checkbox-text">
@@ -1854,20 +1521,20 @@ export default AssetTreeExample;
1854
1521
  </label>
1855
1522
  <span class="TreeLabel TreeLabelName">
1856
1523
  <span class="rioglyph-icon-pair">
1857
- <span class="rioglyph rioglyph-bus">
1524
+ <span class="rioglyph rioglyph-truck">
1858
1525
  </span>
1859
1526
  <span class="rioglyph rioglyph-fuel-mix">
1860
1527
  </span>
1861
1528
  </span>
1862
1529
  <span class="TreeLabelNameText">
1863
- <span class="TreeLabelNameTextHeadline">Vehicle-8678</span>
1530
+ <span class="TreeLabelNameTextHeadline">Vehicle-4670</span>
1864
1531
  <span class="TreeLabelNameTextSubline">
1865
1532
  <span>Debug: dual_fuel_diesel_cng</span>
1866
1533
  </span>
1867
1534
  </span>
1868
1535
  </span>
1869
1536
  </div>
1870
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9719">
1537
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9714">
1871
1538
  <label class="checkbox TreeCheckbox" tabindex="0">
1872
1539
  <input type="checkbox" class="TreeCheckbox">
1873
1540
  <span class="checkbox-text">
@@ -1875,20 +1542,20 @@ export default AssetTreeExample;
1875
1542
  </label>
1876
1543
  <span class="TreeLabel TreeLabelName">
1877
1544
  <span class="rioglyph-icon-pair">
1878
- <span class="rioglyph rioglyph-bus">
1545
+ <span class="rioglyph rioglyph-car">
1879
1546
  </span>
1880
- <span class="rioglyph rioglyph-fuel-hydrogen">
1547
+ <span class="rioglyph rioglyph-fuel-gas">
1881
1548
  </span>
1882
1549
  </span>
1883
1550
  <span class="TreeLabelNameText">
1884
- <span class="TreeLabelNameTextHeadline">Vehicle-8791</span>
1551
+ <span class="TreeLabelNameTextHeadline">Vehicle-6233</span>
1885
1552
  <span class="TreeLabelNameTextSubline">
1886
- <span>Debug: hydrogen</span>
1553
+ <span>Debug: cng</span>
1887
1554
  </span>
1888
1555
  </span>
1889
1556
  </span>
1890
1557
  </div>
1891
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d972">
1558
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9713">
1892
1559
  <label class="checkbox TreeCheckbox" tabindex="0">
1893
1560
  <input type="checkbox" class="TreeCheckbox">
1894
1561
  <span class="checkbox-text">
@@ -1896,20 +1563,20 @@ export default AssetTreeExample;
1896
1563
  </label>
1897
1564
  <span class="TreeLabel TreeLabelName">
1898
1565
  <span class="rioglyph-icon-pair">
1899
- <span class="rioglyph rioglyph-van">
1566
+ <span class="rioglyph rioglyph-car">
1900
1567
  </span>
1901
- <span class="rioglyph rioglyph-fuel-gas">
1568
+ <span class="rioglyph rioglyph-fuel-electric">
1902
1569
  </span>
1903
1570
  </span>
1904
1571
  <span class="TreeLabelNameText">
1905
- <span class="TreeLabelNameTextHeadline">Vehicle-9194</span>
1572
+ <span class="TreeLabelNameTextHeadline">Vehicle-7297</span>
1906
1573
  <span class="TreeLabelNameTextSubline">
1907
- <span>Debug: lpg</span>
1574
+ <span>Debug: electric</span>
1908
1575
  </span>
1909
1576
  </span>
1910
1577
  </span>
1911
1578
  </div>
1912
- <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d974">
1579
+ <div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d971">
1913
1580
  <label class="checkbox TreeCheckbox" tabindex="0">
1914
1581
  <input type="checkbox" class="TreeCheckbox">
1915
1582
  <span class="checkbox-text">
@@ -1917,15 +1584,15 @@ export default AssetTreeExample;
1917
1584
  </label>
1918
1585
  <span class="TreeLabel TreeLabelName">
1919
1586
  <span class="rioglyph-icon-pair">
1920
- <span class="rioglyph rioglyph-truck">
1587
+ <span class="rioglyph rioglyph-bus">
1921
1588
  </span>
1922
- <span class="rioglyph rioglyph-fuel-hydrogen">
1589
+ <span class="rioglyph rioglyph-fuel-mix">
1923
1590
  </span>
1924
1591
  </span>
1925
1592
  <span class="TreeLabelNameText">
1926
- <span class="TreeLabelNameTextHeadline">Vehicle-9266</span>
1593
+ <span class="TreeLabelNameTextHeadline">Vehicle-8794</span>
1927
1594
  <span class="TreeLabelNameTextSubline">
1928
- <span>Debug: hydrogen</span>
1595
+ <span>Debug: dual_fuel_diesel_cng</span>
1929
1596
  </span>
1930
1597
  </span>
1931
1598
  </span>
@@ -1942,7 +1609,7 @@ export default AssetTreeExample;
1942
1609
  <span class="TreeLabelNameText">
1943
1610
  <span class="TreeLabelNameTextHeadline">Ungrouped</span>
1944
1611
  </span>
1945
- <span class="TreeLabelCount label label-muted label-filled label-condensed">8</span>
1612
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">11</span>
1946
1613
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
1947
1614
  </span>
1948
1615
  </span>
@@ -1981,145 +1648,6 @@ export default AssetTreeExample;
1981
1648
  </div>
1982
1649
  ```
1983
1650
 
1984
- #### Props: AssetTree
1985
-
1986
- ### AssetTree
1987
-
1988
- | Name | Type | Default | Description |
1989
- | --- | --- | --- | --- |
1990
- | fly | boolean | false | Defines if the component will overlap the body content. |
1991
- | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
1992
- | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
1993
- | bordered | boolean | false | Defines whether the component has a border or not. |
1994
- | 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. |
1995
- | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
1996
- | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
1997
- | height | number | — | Defines the height of the component in px. |
1998
- | isOpen | boolean | true | Defines whether the component is open or not. |
1999
- | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
2000
- | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
2001
- | onCategoryChange | Function | () => {} | Callback for handling change of category. |
2002
- | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
2003
- | className | String | — | Additional classes added on the wrapper element. |
2004
- | children | TreeCategory | — | A list of TreeCategory components |
2005
-
2006
- #### Props: TreeCategory
2007
-
2008
- ### TreeCategory
2009
-
2010
- | Name | Type | Default | Description |
2011
- | --- | --- | --- | --- |
2012
- | id | String | — | A unique identifier for that category. |
2013
- | icon | String | — | The rioglyph icon name for that category. |
2014
- | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
2015
- | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
2016
-
2017
- #### Props: Tree
2018
-
2019
- ### Tree
2020
-
2021
- | Name | Type | Default | Description |
2022
- | --- | --- | --- | --- |
2023
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2024
- | └id | String | — | A unique identifier of a group. |
2025
- | └name | String | — | The name of a group. |
2026
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2027
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
2028
- | └className | String | — | Additional classes added to the group element. |
2029
- | items | Array of Objects | [] | The list of items. |
2030
- | └id | String | — | A unique identifier of an item. |
2031
- | └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 |
2032
- | └info | String \| Node | — | The subline of an item. |
2033
- | └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). |
2034
- | └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. |
2035
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2036
- | └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. |
2037
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2038
- | └className | string | — | Additional classes added to the item element. |
2039
- | selectedGroups | Array of strings | — | List of selected group ids. |
2040
- | selectedItems | Array of strings | — | List of selected item ids. |
2041
- | 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: [] } |
2042
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2043
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2044
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2045
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2046
- | onSearchChange | Function | — | Callback for when the search value changes. |
2047
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2048
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2049
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2050
- | hideSummary | boolean | false | Defines whether a summary is shown. |
2051
- | 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. |
2052
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2053
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2054
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
2055
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2056
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2057
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2058
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2059
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2060
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2061
- | className | String | — | Additional classes added to the wrapping element. |
2062
-
2063
- #### Props: TreeSearch
2064
-
2065
- ### TreeSearch
2066
-
2067
- | Name | Type | Default | Description |
2068
- | --- | --- | --- | --- |
2069
- | value | String | — | The search value to be shown and used for the search. |
2070
- | onChange | Function | () => {} | Callback for when the search value changes. |
2071
- | placeholder | String | — | The placeholder text used for the input field. |
2072
- | className | String | — | Additional classes added to the wrapping element. |
2073
-
2074
- #### Props: TreeSummary
2075
-
2076
- ### TreeSummary
2077
-
2078
- | Name | Type | Default | Description |
2079
- | --- | --- | --- | --- |
2080
- | assetCounts | object | — | The object containing various asset type counter. |
2081
- | └truck | number | — | The amount of trucks. |
2082
- | └trailer | number | — | The amount of trailers. |
2083
- | └bus | number | — | The amount of buses. |
2084
- | └van | number | — | The amount of vans. |
2085
- | └driver | number | — | The amount of drivers. |
2086
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
2087
- | className | string | — | Additional classes added to the wrapping element. |
2088
-
2089
- #### Props: TreeSummaryRow
2090
-
2091
- ### TreeSummaryRow
2092
-
2093
- | Name | Type | Default | Description |
2094
- | --- | --- | --- | --- |
2095
- | 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. |
2096
-
2097
- #### Props: TypeCounter
2098
-
2099
- ### TypeCounter
2100
-
2101
- | Name | Type | Default | Description |
2102
- | --- | --- | --- | --- |
2103
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
2104
- | 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. |
2105
- | isActive | Boolean | — | Sets the active styling if active. |
2106
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
2107
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
2108
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
2109
- | 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. |
2110
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
2111
-
2112
- #### Props: TreeOption
2113
-
2114
- ### TreeOption
2115
-
2116
- | Name | Type | Default | Description |
2117
- | --- | --- | --- | --- |
2118
- | isChecked | boolean | — | Defines whether the option is set. |
2119
- | label | string / node | — | The label for the option. |
2120
- | onChange | Function | — | Callback triggered when option is selected. |
2121
- | className | string | — | Additional classes added to the wrapping element. |
2122
-
2123
1651
  ## AssetTree with custom summary
2124
1652
 
2125
1653
  ### Example: Some small dummy text at the bottom to showcase that you can put something here
@@ -2385,144 +1913,190 @@ export default AssetTreeWithCustomSummaryExample;
2385
1913
  </div>
2386
1914
  ```
2387
1915
 
2388
- #### Props: AssetTree
2389
-
2390
- ### AssetTree
2391
-
2392
- | Name | Type | Default | Description |
2393
- | --- | --- | --- | --- |
2394
- | fly | boolean | false | Defines if the component will overlap the body content. |
2395
- | resizable | boolean | true | Defines whether or not the sidebar is resizable. |
2396
- | onResizeEnd | Function | () => {} | Callback for when the resize is done. |
2397
- | bordered | boolean | false | Defines whether the component has a border or not. |
2398
- | 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. |
2399
- | minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
2400
- | maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
2401
- | height | number | — | Defines the height of the component in px. |
2402
- | isOpen | boolean | true | Defines whether the component is open or not. |
2403
- | onToggleTree | Function | () => {} | Callback for when the tree visibility is toggled. |
2404
- | currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
2405
- | onCategoryChange | Function | () => {} | Callback for handling change of category. |
2406
- | useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
2407
- | className | String | — | Additional classes added on the wrapper element. |
2408
- | children | TreeCategory | — | A list of TreeCategory components |
2409
-
2410
- #### Props: TreeCategory
2411
-
2412
- ### TreeCategory
2413
-
2414
- | Name | Type | Default | Description |
2415
- | --- | --- | --- | --- |
2416
- | id | String | — | A unique identifier for that category. |
2417
- | icon | String | — | The rioglyph icon name for that category. |
2418
- | label | String / Node | — | The optional label for the category which will be shown in a tooltip. |
2419
- | hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
2420
-
2421
- #### Props: Tree
2422
-
2423
- ### Tree
2424
-
2425
- | Name | Type | Default | Description |
2426
- | --- | --- | --- | --- |
2427
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2428
- | └id | String | — | A unique identifier of a group. |
2429
- | └name | String | — | The name of a group. |
2430
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2431
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
2432
- | └className | String | — | Additional classes added to the group element. |
2433
- | items | Array of Objects | [] | The list of items. |
2434
- | └id | String | — | A unique identifier of an item. |
2435
- | └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 |
2436
- | └info | String \| Node | — | The subline of an item. |
2437
- | └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). |
2438
- | └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. |
2439
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2440
- | └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. |
2441
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2442
- | └className | string | | Additional classes added to the item element. |
2443
- | selectedGroups | Array of strings | — | List of selected group ids. |
2444
- | selectedItems | Array of strings | — | List of selected item ids. |
2445
- | 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: [] } |
2446
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2447
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2448
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2449
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2450
- | onSearchChange | Function | — | Callback for when the search value changes. |
2451
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2452
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2453
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2454
- | hideSummary | boolean | false | Defines whether a summary is shown. |
2455
- | 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. |
2456
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2457
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2458
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
2459
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2460
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2461
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2462
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2463
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2464
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2465
- | className | String | — | Additional classes added to the wrapping element. |
2466
-
2467
- #### Props: TreeSearch
2468
-
2469
- ### TreeSearch
2470
-
2471
- | Name | Type | Default | Description |
2472
- | --- | --- | --- | --- |
2473
- | value | String | — | The search value to be shown and used for the search. |
2474
- | onChange | Function | () => {} | Callback for when the search value changes. |
2475
- | placeholder | String | — | The placeholder text used for the input field. |
2476
- | className | String | — | Additional classes added to the wrapping element. |
2477
-
2478
- #### Props: TreeSummary
2479
-
2480
- ### TreeSummary
2481
-
2482
- | Name | Type | Default | Description |
2483
- | --- | --- | --- | --- |
2484
- | assetCounts | object | — | The object containing various asset type counter. |
2485
- | └truck | number | — | The amount of trucks. |
2486
- | └trailer | number | — | The amount of trailers. |
2487
- | └bus | number | | The amount of buses. |
2488
- | └van | number | — | The amount of vans. |
2489
- | └driver | number | — | The amount of drivers. |
2490
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
2491
- | className | string | — | Additional classes added to the wrapping element. |
2492
-
2493
- #### Props: TreeSummaryRow
2494
-
2495
- ### TreeSummaryRow
2496
-
2497
- | Name | Type | Default | Description |
2498
- | --- | --- | --- | --- |
2499
- | 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. |
2500
-
2501
- #### Props: TypeCounter
2502
-
2503
- ### TypeCounter
2504
-
2505
- | Name | Type | Default | Description |
2506
- | --- | --- | --- | --- |
2507
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
2508
- | 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. |
2509
- | isActive | Boolean | — | Sets the active styling if active. |
2510
- | hasFilter | boolean | | Should be set when there is a type filter set in the tree to style the counter accordingly. |
2511
- | enableActivity | boolean | | Allows for interactivity. Use this prop when you allow clicking on the counter. |
2512
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
2513
- | 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. |
2514
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
2515
-
2516
- #### Props: TreeOption
2517
-
2518
- ### TreeOption
2519
-
2520
- | Name | Type | Default | Description |
2521
- | --- | --- | --- | --- |
2522
- | isChecked | boolean | — | Defines whether the option is set. |
2523
- | label | string / node | — | The label for the option. |
2524
- | onChange | Function | | Callback triggered when option is selected. |
2525
- | 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
+ ```
2526
2100
 
2527
2101
  ## Tree
2528
2102
 
@@ -2532,13 +2106,13 @@ Tree with header and search
2532
2106
 
2533
2107
  20
2534
2108
 
2535
- Folder 015
2109
+ Folder 018
2536
2110
 
2537
- Folder 024
2111
+ Folder 023
2538
2112
 
2539
- Folder 034
2113
+ Folder 035
2540
2114
 
2541
- Folder 047
2115
+ Folder 044
2542
2116
 
2543
2117
  Selected items:
2544
2118
 
@@ -2550,13 +2124,13 @@ Tree with header and search
2550
2124
 
2551
2125
  20
2552
2126
 
2553
- Folder 015
2127
+ Folder 018
2554
2128
 
2555
- Folder 024
2129
+ Folder 023
2556
2130
 
2557
- Folder 034
2131
+ Folder 035
2558
2132
 
2559
- Folder 047
2133
+ Folder 044
2560
2134
 
2561
2135
  Selected items:
2562
2136
 
@@ -2567,7 +2141,7 @@ Expanded folders:
2567
2141
  ```tsx
2568
2142
  import { useState } from 'react';
2569
2143
  import { random } from 'es-toolkit/compat';
2570
- import faker from 'faker';
2144
+ import { faker } from '@faker-js/faker';
2571
2145
 
2572
2146
  import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
2573
2147
  import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
@@ -2597,11 +2171,11 @@ const folders: TreeGroup[] = [
2597
2171
 
2598
2172
  const treeItems: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
2599
2173
  id: `${index}`,
2600
- name: `${faker.random.words()} ${random(100, 999)}`,
2174
+ name: `${faker.lorem.words()} ${random(100, 999)}`,
2601
2175
  type: 'files',
2602
2176
  icon: 'files',
2603
2177
  // icon: null, // Set to "null" to omit the icon
2604
- groupIds: [faker.random.arrayElement(folders).id],
2178
+ groupIds: [faker.helpers.arrayElement(folders).id],
2605
2179
  }));
2606
2180
 
2607
2181
  const TreeOnlyExample = () => {
@@ -2701,7 +2275,7 @@ export default TreeOnlyExample;
2701
2275
  <span class="TreeLabelNameText">
2702
2276
  <span class="TreeLabelNameTextHeadline">Folder 01</span>
2703
2277
  </span>
2704
- <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>
2705
2279
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2706
2280
  </span>
2707
2281
  </span>
@@ -2715,7 +2289,7 @@ export default TreeOnlyExample;
2715
2289
  <span class="TreeLabelNameText">
2716
2290
  <span class="TreeLabelNameTextHeadline">Folder 02</span>
2717
2291
  </span>
2718
- <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
2292
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">3</span>
2719
2293
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2720
2294
  </span>
2721
2295
  </span>
@@ -2729,7 +2303,7 @@ export default TreeOnlyExample;
2729
2303
  <span class="TreeLabelNameText">
2730
2304
  <span class="TreeLabelNameTextHeadline">Folder 03</span>
2731
2305
  </span>
2732
- <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
2306
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
2733
2307
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2734
2308
  </span>
2735
2309
  </span>
@@ -2743,7 +2317,7 @@ export default TreeOnlyExample;
2743
2317
  <span class="TreeLabelNameText">
2744
2318
  <span class="TreeLabelNameTextHeadline">Folder 04</span>
2745
2319
  </span>
2746
- <span class="TreeLabelCount label label-muted label-filled label-condensed">7</span>
2320
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
2747
2321
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2748
2322
  </span>
2749
2323
  </span>
@@ -2764,61 +2338,17 @@ export default TreeOnlyExample;
2764
2338
  </div>
2765
2339
  ```
2766
2340
 
2767
- #### Props
2768
-
2769
- | Name | Type | Default | Description |
2770
- | --- | --- | --- | --- |
2771
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
2772
- | └id | String | — | A unique identifier of a group. |
2773
- | └name | String | — | The name of a group. |
2774
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
2775
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
2776
- | └className | String | — | Additional classes added to the group element. |
2777
- | items | Array of Objects | [] | The list of items. |
2778
- | └id | String | — | A unique identifier of an item. |
2779
- | └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 |
2780
- | └info | String \| Node | — | The subline of an item. |
2781
- | └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). |
2782
- | └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. |
2783
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
2784
- | └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. |
2785
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
2786
- | └className | string | — | Additional classes added to the item element. |
2787
- | selectedGroups | Array of strings | — | List of selected group ids. |
2788
- | selectedItems | Array of strings | — | List of selected item ids. |
2789
- | 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: [] } |
2790
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
2791
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
2792
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
2793
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
2794
- | onSearchChange | Function | — | Callback for when the search value changes. |
2795
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
2796
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
2797
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
2798
- | hideSummary | boolean | false | Defines whether a summary is shown. |
2799
- | 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. |
2800
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
2801
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
2802
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
2803
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
2804
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
2805
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
2806
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
2807
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
2808
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
2809
- | className | String | — | Additional classes added to the wrapping element. |
2810
-
2811
2341
  ### Example: Tree without header and search
2812
2342
 
2813
2343
  Tree without header and search
2814
2344
 
2815
- Folder 017
2345
+ Folder 012
2816
2346
 
2817
- Folder 024
2347
+ Folder 028
2818
2348
 
2819
2349
  Folder 036
2820
2350
 
2821
- Folder 043
2351
+ Folder 044
2822
2352
 
2823
2353
  Selected items:
2824
2354
 
@@ -2828,13 +2358,13 @@ Expanded folders:
2828
2358
 
2829
2359
  Tree without header and search
2830
2360
 
2831
- Folder 017
2361
+ Folder 012
2832
2362
 
2833
- Folder 024
2363
+ Folder 028
2834
2364
 
2835
2365
  Folder 036
2836
2366
 
2837
- Folder 043
2367
+ Folder 044
2838
2368
 
2839
2369
  Selected items:
2840
2370
 
@@ -2845,7 +2375,7 @@ Expanded folders:
2845
2375
  ```tsx
2846
2376
  import { useState } from 'react';
2847
2377
  import { random } from 'es-toolkit/compat';
2848
- import faker from 'faker';
2378
+ import { faker } from '@faker-js/faker';
2849
2379
 
2850
2380
  import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
2851
2381
  import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
@@ -2879,10 +2409,10 @@ const folders2: TreeGroup[] = [
2879
2409
 
2880
2410
  const treeItems2: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
2881
2411
  id: `${index}`,
2882
- name: `${faker.random.words()} ${random(100, 999)}`,
2412
+ name: `${faker.lorem.words()} ${random(100, 999)}`,
2883
2413
  type: 'files',
2884
2414
  icon: null, // Set to "null" to omit the icon
2885
- groupIds: [faker.random.arrayElement(folders2).id],
2415
+ groupIds: [faker.helpers.arrayElement(folders2).id],
2886
2416
  }));
2887
2417
 
2888
2418
  const TreeOnlyExample = () => {
@@ -2955,7 +2485,7 @@ export default TreeOnlyExample;
2955
2485
  <span class="TreeLabelNameText">
2956
2486
  <span class="TreeLabelNameTextHeadline">Folder 01</span>
2957
2487
  </span>
2958
- <span class="TreeLabelCount label label-muted label-filled label-condensed">7</span>
2488
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">2</span>
2959
2489
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2960
2490
  </span>
2961
2491
  </span>
@@ -2969,7 +2499,7 @@ export default TreeOnlyExample;
2969
2499
  <span class="TreeLabelNameText">
2970
2500
  <span class="TreeLabelNameTextHeadline">Folder 02</span>
2971
2501
  </span>
2972
- <span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
2502
+ <span class="TreeLabelCount label label-muted label-filled label-condensed">8</span>
2973
2503
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
2974
2504
  </span>
2975
2505
  </span>
@@ -2997,7 +2527,7 @@ export default TreeOnlyExample;
2997
2527
  <span class="TreeLabelNameText">
2998
2528
  <span class="TreeLabelNameTextHeadline">Folder 04</span>
2999
2529
  </span>
3000
- <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>
3001
2531
  <span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
3002
2532
  </span>
3003
2533
  </span>
@@ -3018,53 +2548,9 @@ export default TreeOnlyExample;
3018
2548
  </div>
3019
2549
  ```
3020
2550
 
3021
- #### Props
3022
-
3023
- | Name | Type | Default | Description |
3024
- | --- | --- | --- | --- |
3025
- | groups | Array of objects | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
3026
- | └id | String | — | A unique identifier of a group. |
3027
- | └name | String | — | The name of a group. |
3028
- | └position | string | — | Can be set to "last" to enforce the last position in the tree. |
3029
- | └disabled | Boolean | — | Disallows the selection of the group itself. |
3030
- | └className | String | — | Additional classes added to the group element. |
3031
- | items | Array of Objects | [] | The list of items. |
3032
- | └id | String | — | A unique identifier of an item. |
3033
- | └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 |
3034
- | └info | String \| Node | — | The subline of an item. |
3035
- | └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). |
3036
- | └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. |
3037
- | └icon | string | — | The rioglyph icon name for a group. The prefix `rioglyph-` can be omitted. |
3038
- | └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. |
3039
- | └groupIds | Array of strings | [] | List of group ids the items is associated with. |
3040
- | └className | string | — | Additional classes added to the item element. |
3041
- | selectedGroups | Array of strings | — | List of selected group ids. |
3042
- | selectedItems | Array of strings | — | List of selected item ids. |
3043
- | 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: [] } |
3044
- | hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
3045
- | showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
3046
- | hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
3047
- | searchPlaceholder | string | — | The text used as placeholder for the search input. |
3048
- | onSearchChange | Function | — | Callback for when the search value changes. |
3049
- | search | node | — | Used to define custom custom search component which replaces the built-in search. |
3050
- | onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
3051
- | summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
3052
- | hideSummary | boolean | false | Defines whether a summary is shown. |
3053
- | 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. |
3054
- | treeHeaderContent | ReactNode | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
3055
- | scrollHeight | Number | — | Defines the max-height of the scrollable list |
3056
- | expandedGroups | Array of String | — | List of group ids which are expanded. |
3057
- | onExpandGroupsChange | Function | — | Callback function triggered when a group expands or collapses. |
3058
- | showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
3059
- | treeOptions | ReactNode | — | Component to offer customization options for the tree. |
3060
- | treeOptionsTooltip | ReactNode | — | Tooltip content for the tree options dropdown. |
3061
- | virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
3062
- | overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
3063
- | className | String | — | Additional classes added to the wrapping element. |
3064
-
3065
2551
  ## TreeSummary with assetCounts
3066
2552
 
3067
- ### Example: Example 7
2553
+ ### Example: Example 8
3068
2554
 
3069
2555
  12
3070
2556
  7
@@ -3132,39 +2618,9 @@ export default TreeSummaryExample;
3132
2618
  </div>
3133
2619
  ```
3134
2620
 
3135
- #### Props: TreeSummary
3136
-
3137
- ### TreeSummary
3138
-
3139
- | Name | Type | Default | Description |
3140
- | --- | --- | --- | --- |
3141
- | assetCounts | object | — | The object containing various asset type counter. |
3142
- | └truck | number | — | The amount of trucks. |
3143
- | └trailer | number | — | The amount of trailers. |
3144
- | └bus | number | — | The amount of buses. |
3145
- | └van | number | — | The amount of vans. |
3146
- | └driver | number | — | The amount of drivers. |
3147
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
3148
- | className | string | — | Additional classes added to the wrapping element. |
3149
-
3150
- #### Props: TypeCounter
3151
-
3152
- ### TypeCounter
3153
-
3154
- | Name | Type | Default | Description |
3155
- | --- | --- | --- | --- |
3156
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
3157
- | 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. |
3158
- | isActive | Boolean | — | Sets the active styling if active. |
3159
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
3160
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
3161
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
3162
- | 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. |
3163
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
3164
-
3165
2621
  ## TreeSummary with TypeCounter
3166
2622
 
3167
- ### Example: Example 8
2623
+ ### Example: Example 9
3168
2624
 
3169
2625
  9
3170
2626
  15
@@ -3205,34 +2661,4 @@ export default TreeSummaryCustomExample;
3205
2661
  <span class="TreeLabelCount label label-condensed label-muted label-filled">15</span>
3206
2662
  </div>
3207
2663
  </div>
3208
- ```
3209
-
3210
- #### Props: TreeSummary
3211
-
3212
- ### TreeSummary
3213
-
3214
- | Name | Type | Default | Description |
3215
- | --- | --- | --- | --- |
3216
- | assetCounts | object | — | The object containing various asset type counter. |
3217
- | └truck | number | — | The amount of trucks. |
3218
- | └trailer | number | — | The amount of trailers. |
3219
- | └bus | number | — | The amount of buses. |
3220
- | └van | number | — | The amount of vans. |
3221
- | └driver | number | — | The amount of drivers. |
3222
- | gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow |
3223
- | className | string | — | Additional classes added to the wrapping element. |
3224
-
3225
- #### Props: TypeCounter
3226
-
3227
- ### TypeCounter
3228
-
3229
- | Name | Type | Default | Description |
3230
- | --- | --- | --- | --- |
3231
- | type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
3232
- | 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. |
3233
- | isActive | Boolean | — | Sets the active styling if active. |
3234
- | hasFilter | boolean | — | Should be set when there is a type filter set in the tree to style the counter accordingly. |
3235
- | enableActivity | boolean | — | Allows for interactivity. Use this prop when you allow clicking on the counter. |
3236
- | hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
3237
- | 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. |
3238
- | value | String / Number / Node | — | A custom value to be shown in the counter. |
2664
+ ```