@rio-cloud/uikit-mcp 1.1.3 → 1.1.5
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.
- package/README.md +1 -0
- package/dist/doc-metadata.json +97 -97
- package/dist/docs/components/accentBar.md +5 -5
- package/dist/docs/components/activity.md +7 -7
- package/dist/docs/components/animatedNumber.md +10 -10
- package/dist/docs/components/animatedTextReveal.md +42 -43
- package/dist/docs/components/animations.md +42 -34
- package/dist/docs/components/appHeader.md +20 -35
- package/dist/docs/components/appLayout.md +198 -221
- package/dist/docs/components/appNavigationBar.md +21 -21
- package/dist/docs/components/areaCharts.md +38 -38
- package/dist/docs/components/aspectRatioPlaceholder.md +4 -5
- package/dist/docs/components/assetTree.md +887 -614
- package/dist/docs/components/autosuggests.md +4 -4
- package/dist/docs/components/avatar.md +7 -7
- package/dist/docs/components/banner.md +2 -2
- package/dist/docs/components/barCharts.md +173 -173
- package/dist/docs/components/barList.md +19 -41
- package/dist/docs/components/basicMap.md +1 -1
- package/dist/docs/components/bottomSheet.md +74 -74
- package/dist/docs/components/button.md +161 -71
- package/dist/docs/components/buttonToolbar.md +3 -3
- package/dist/docs/components/calendarStripe.md +71 -123
- package/dist/docs/components/card.md +4 -4
- package/dist/docs/components/carousel.md +1 -1
- package/dist/docs/components/chartColors.md +1 -1
- package/dist/docs/components/chartsGettingStarted.md +1 -1
- package/dist/docs/components/chat.md +2 -2
- package/dist/docs/components/checkbox.md +56 -131
- package/dist/docs/components/clearableInput.md +23 -127
- package/dist/docs/components/collapse.md +14 -16
- package/dist/docs/components/composedCharts.md +31 -31
- package/dist/docs/components/contentLoader.md +125 -122
- package/dist/docs/components/dataTabs.md +103 -93
- package/dist/docs/components/datepickers.md +734 -764
- package/dist/docs/components/dialogs.md +299 -186
- package/dist/docs/components/divider.md +4 -4
- package/dist/docs/components/dropdowns.md +4555 -4498
- package/dist/docs/components/editableContent.md +97 -97
- package/dist/docs/components/expander.md +56 -56
- package/dist/docs/components/fade.md +41 -41
- package/dist/docs/components/fadeExpander.md +4 -4
- package/dist/docs/components/fadeUp.md +8 -10
- package/dist/docs/components/feedback.md +22 -21
- package/dist/docs/components/filePickers.md +25 -25
- package/dist/docs/components/formLabel.md +5 -7
- package/dist/docs/components/groupedItemList.md +37 -37
- package/dist/docs/components/iconList.md +4 -4
- package/dist/docs/components/imagePreloader.md +6 -6
- package/dist/docs/components/labeledElement.md +4 -3
- package/dist/docs/components/licensePlate.md +2 -2
- package/dist/docs/components/lineCharts.md +58 -58
- package/dist/docs/components/listMenu.md +63 -41
- package/dist/docs/components/loadMore.md +17 -17
- package/dist/docs/components/mainNavigation.md +1 -1
- package/dist/docs/components/mapCircle.md +1 -1
- package/dist/docs/components/mapCluster.md +1 -1
- package/dist/docs/components/mapContext.md +1 -1
- package/dist/docs/components/mapDraggableMarker.md +1 -1
- package/dist/docs/components/mapGettingStarted.md +1 -1
- package/dist/docs/components/mapInfoBubble.md +1 -1
- package/dist/docs/components/mapLayerGroup.md +1 -1
- package/dist/docs/components/mapMarker.md +339 -345
- package/dist/docs/components/mapPolygon.md +16 -20
- package/dist/docs/components/mapRoute.md +14 -20
- package/dist/docs/components/mapRouteGenerator.md +1 -1
- package/dist/docs/components/mapSettings.md +263 -274
- package/dist/docs/components/mapUtils.md +3 -5
- package/dist/docs/components/multiselects.md +1 -1
- package/dist/docs/components/noData.md +11 -11
- package/dist/docs/components/notifications.md +1 -1
- package/dist/docs/components/numbercontrol.md +39 -37
- package/dist/docs/components/onboarding.md +18 -38
- package/dist/docs/components/page.md +16 -16
- package/dist/docs/components/pager.md +8 -8
- package/dist/docs/components/pieCharts.md +124 -124
- package/dist/docs/components/popover.md +37 -53
- package/dist/docs/components/position.md +4 -4
- package/dist/docs/components/radialBarCharts.md +506 -506
- package/dist/docs/components/radiobutton.md +209 -191
- package/dist/docs/components/releaseNotes.md +9 -3
- package/dist/docs/components/resizer.md +7 -8
- package/dist/docs/components/responsiveColumnStripe.md +11 -11
- package/dist/docs/components/responsiveVideo.md +5 -5
- package/dist/docs/components/rioglyph.md +11 -11
- package/dist/docs/components/rules.md +118 -92
- package/dist/docs/components/saveableInput.md +366 -356
- package/dist/docs/components/selects.md +9996 -15
- package/dist/docs/components/sidebar.md +22 -23
- package/dist/docs/components/sliders.md +26 -26
- package/dist/docs/components/smoothScrollbars.md +61 -25
- package/dist/docs/components/spinners.md +32 -30
- package/dist/docs/components/states.md +236 -245
- package/dist/docs/components/statsWidgets.md +37 -28
- package/dist/docs/components/statusBar.md +22 -22
- package/dist/docs/components/stepButton.md +2 -2
- package/dist/docs/components/steppedProgressBars.md +45 -45
- package/dist/docs/components/subNavigation.md +3 -3
- package/dist/docs/components/supportMarker.md +1 -1
- package/dist/docs/components/svgImage.md +2 -38
- package/dist/docs/components/switch.md +11 -11
- package/dist/docs/components/tables.md +1 -1
- package/dist/docs/components/tagManager.md +40 -40
- package/dist/docs/components/tags.md +21 -20
- package/dist/docs/components/teaser.md +22 -23
- package/dist/docs/components/timeline.md +1 -1
- package/dist/docs/components/timepicker.md +17 -13
- package/dist/docs/components/toggleButton.md +65 -29
- package/dist/docs/components/tooltip.md +27 -50
- package/dist/docs/components/virtualList.md +75 -75
- package/dist/docs/foundations.md +167 -167
- package/dist/docs/start/changelog.md +23 -1
- package/dist/docs/start/goodtoknow.md +1 -1
- package/dist/docs/start/guidelines/color-combinations.md +1 -1
- package/dist/docs/start/guidelines/custom-css.md +1 -1
- package/dist/docs/start/guidelines/custom-rioglyph.md +1 -1
- package/dist/docs/start/guidelines/formatting.md +1 -1
- package/dist/docs/start/guidelines/iframe.md +80 -27
- package/dist/docs/start/guidelines/obfuscate-data.md +1 -1
- package/dist/docs/start/guidelines/print-css.md +1 -1
- package/dist/docs/start/guidelines/spinner.md +81 -81
- package/dist/docs/start/guidelines/supported-browsers.md +1 -1
- package/dist/docs/start/guidelines/writing.md +1 -1
- package/dist/docs/start/howto.md +9 -9
- package/dist/docs/start/intro.md +1 -1
- package/dist/docs/start/responsiveness.md +1 -1
- package/dist/docs/templates/common-table.md +11 -11
- package/dist/docs/templates/detail-views.md +2 -2
- package/dist/docs/templates/expandable-details.md +1 -1
- package/dist/docs/templates/feature-cards.md +55 -55
- package/dist/docs/templates/form-summary.md +22 -22
- package/dist/docs/templates/form-toggle.md +1 -1
- package/dist/docs/templates/list-blocks.md +197 -197
- package/dist/docs/templates/loading-progress.md +1 -1
- package/dist/docs/templates/options-panel.md +1 -1
- package/dist/docs/templates/panel-variants.md +1 -1
- package/dist/docs/templates/progress-cards.md +1 -1
- package/dist/docs/templates/progress-success.md +1 -1
- package/dist/docs/templates/settings-form.md +23 -23
- package/dist/docs/templates/stats-blocks.md +41 -41
- package/dist/docs/templates/table-panel.md +1 -1
- package/dist/docs/templates/table-row-animation.md +1 -1
- package/dist/docs/templates/usage-cards.md +1 -1
- package/dist/docs/utilities/deviceUtils.md +6 -3
- package/dist/docs/utilities/featureToggles.md +1 -1
- package/dist/docs/utilities/fuelTypeUtils.md +1 -1
- package/dist/docs/utilities/routeUtils.md +59 -23
- package/dist/docs/utilities/useAfterMount.md +1 -1
- package/dist/docs/utilities/useAutoAnimate.md +1 -1
- package/dist/docs/utilities/useAverage.md +1 -1
- package/dist/docs/utilities/useClickOutside.md +1 -1
- package/dist/docs/utilities/useClipboard.md +2 -2
- package/dist/docs/utilities/useCount.md +1 -1
- package/dist/docs/utilities/useDarkMode.md +1 -1
- package/dist/docs/utilities/useDebugInfo.md +4 -4
- package/dist/docs/utilities/useEffectOnce.md +1 -1
- package/dist/docs/utilities/useElapsedTime.md +1 -1
- package/dist/docs/utilities/useElementSize.md +1 -1
- package/dist/docs/utilities/useEsc.md +1 -1
- package/dist/docs/utilities/useEvent.md +1 -1
- package/dist/docs/utilities/useFocusTrap.md +1 -1
- package/dist/docs/utilities/useFullscreen.md +1 -1
- package/dist/docs/utilities/useHover.md +1 -1
- package/dist/docs/utilities/useIncomingPostMessages.md +1 -1
- package/dist/docs/utilities/useInterval.md +1 -1
- package/dist/docs/utilities/useIsFocusWithin.md +1 -1
- package/dist/docs/utilities/useKey.md +7 -5
- package/dist/docs/utilities/useLocalStorage.md +1 -1
- package/dist/docs/utilities/useLocationSuggestions.md +1 -1
- package/dist/docs/utilities/useMax.md +1 -1
- package/dist/docs/utilities/useMin.md +1 -1
- package/dist/docs/utilities/useMutationObserver.md +1 -1
- package/dist/docs/utilities/useOnScreen.md +1 -1
- package/dist/docs/utilities/useOnlineStatus.md +1 -1
- package/dist/docs/utilities/usePostMessage.md +58 -2
- package/dist/docs/utilities/usePostMessageSender.md +1 -1
- package/dist/docs/utilities/usePrevious.md +1 -1
- package/dist/docs/utilities/useResizeObserver.md +1 -1
- package/dist/docs/utilities/useScrollPosition.md +1 -1
- package/dist/docs/utilities/useSearch.md +1 -1
- package/dist/docs/utilities/useSorting.md +1 -1
- package/dist/docs/utilities/useStateWithValidation.md +1 -1
- package/dist/docs/utilities/useSum.md +1 -1
- package/dist/docs/utilities/useTableExport.md +54 -54
- package/dist/docs/utilities/useTableSelection.md +93 -93
- package/dist/docs/utilities/useTimeout.md +1 -1
- package/dist/docs/utilities/useToggle.md +1 -1
- package/dist/docs/utilities/useWindowResize.md +1 -1
- package/dist/index.mjs +8 -8
- package/dist/version.json +2 -2
- package/package.json +6 -6
|
@@ -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-
|
|
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-02-03T14:04:32.850Z
|
|
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
|
-
|
|
14
|
+
5868
|
|
17
15
|
4
|
|
18
16
|
|
|
19
|
-
Group -
|
|
20
|
-
|
|
21
|
-
Group - Adam Windler - 770317
|
|
17
|
+
Group - Adrienne Weimann - 60548
|
|
22
18
|
|
|
23
|
-
Group -
|
|
19
|
+
Group - Agnes Homenick - 817311
|
|
24
20
|
|
|
25
|
-
Group -
|
|
21
|
+
Group - Alejandro Little - 593623
|
|
26
22
|
|
|
27
|
-
Group -
|
|
23
|
+
Group - Alexander Kautzer - 58489
|
|
28
24
|
|
|
29
|
-
Group -
|
|
25
|
+
Group - Alexandra McGlynn - 40409
|
|
30
26
|
|
|
31
|
-
Group -
|
|
27
|
+
Group - Allen Feeney - 758310
|
|
32
28
|
|
|
33
|
-
Group - Alma
|
|
29
|
+
Group - Alma Bradtke - 812611
|
|
34
30
|
|
|
35
|
-
Group -
|
|
31
|
+
Group - Alton Becker MD - 390414
|
|
36
32
|
|
|
37
|
-
Group -
|
|
33
|
+
Group - Amber Swift IV - 81856
|
|
38
34
|
|
|
39
|
-
Group -
|
|
35
|
+
Group - Amos Gorczany - 298611
|
|
40
36
|
|
|
41
|
-
Group - Amos
|
|
37
|
+
Group - Amos Hickle - 741010
|
|
42
38
|
|
|
43
|
-
Group -
|
|
39
|
+
Group - Amos Nader - 357510
|
|
44
40
|
|
|
45
|
-
Group -
|
|
41
|
+
Group - Ana Sanford - 221715
|
|
46
42
|
|
|
47
|
-
Group -
|
|
43
|
+
Group - Ana Sporer - 48377
|
|
48
44
|
|
|
49
45
|
200
|
|
50
46
|
|
|
@@ -72,38 +68,36 @@ Asset type filter:
|
|
|
72
68
|
|
|
73
69
|
Filter
|
|
74
70
|
|
|
75
|
-
|
|
71
|
+
5868
|
|
76
72
|
4
|
|
77
73
|
|
|
78
|
-
Group -
|
|
74
|
+
Group - Adrienne Weimann - 60548
|
|
79
75
|
|
|
80
|
-
Group -
|
|
76
|
+
Group - Agnes Homenick - 817311
|
|
81
77
|
|
|
82
|
-
Group -
|
|
78
|
+
Group - Alejandro Little - 593623
|
|
83
79
|
|
|
84
|
-
Group -
|
|
80
|
+
Group - Alexander Kautzer - 58489
|
|
85
81
|
|
|
86
|
-
Group -
|
|
82
|
+
Group - Alexandra McGlynn - 40409
|
|
87
83
|
|
|
88
|
-
Group -
|
|
84
|
+
Group - Allen Feeney - 758310
|
|
89
85
|
|
|
90
|
-
Group -
|
|
86
|
+
Group - Alma Bradtke - 812611
|
|
91
87
|
|
|
92
|
-
Group -
|
|
88
|
+
Group - Alton Becker MD - 390414
|
|
93
89
|
|
|
94
|
-
Group -
|
|
90
|
+
Group - Amber Swift IV - 81856
|
|
95
91
|
|
|
96
|
-
Group -
|
|
92
|
+
Group - Amos Gorczany - 298611
|
|
97
93
|
|
|
98
|
-
Group -
|
|
94
|
+
Group - Amos Hickle - 741010
|
|
99
95
|
|
|
100
|
-
Group - Amos
|
|
96
|
+
Group - Amos Nader - 357510
|
|
101
97
|
|
|
102
|
-
Group - Ana
|
|
98
|
+
Group - Ana Sanford - 221715
|
|
103
99
|
|
|
104
|
-
Group -
|
|
105
|
-
|
|
106
|
-
Group - Andrew Howell Sr. - 815511
|
|
100
|
+
Group - Ana Sporer - 48377
|
|
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.
|
|
159
|
-
lastName: faker.
|
|
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.
|
|
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.
|
|
231
|
+
groupIds: [faker.helpers.arrayElement(groups).id],
|
|
238
232
|
}));
|
|
239
233
|
return [...randomTrucks, ...trailer];
|
|
240
234
|
};
|
|
@@ -480,19 +474,18 @@ export default AssetTreeExample;
|
|
|
480
474
|
| --- | --- | --- | --- |
|
|
481
475
|
| fly | boolean | false | Defines if the component will overlap the body content. |
|
|
482
476
|
| resizable | boolean | true | Defines whether or not the sidebar is resizable. |
|
|
483
|
-
| onResizeEnd | Function | () => {} | Callback for when the resize is done. |
|
|
484
477
|
| bordered | boolean | false | Defines whether the component has a border or not. |
|
|
485
|
-
| width |
|
|
478
|
+
| width | 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
479
|
| minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
|
|
487
480
|
| maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
|
|
488
481
|
| height | number | — | Defines the height of the component in px. |
|
|
489
482
|
| isOpen | boolean | true | Defines whether the component is open or not. |
|
|
490
|
-
| onToggleTree |
|
|
483
|
+
| onToggleTree | (isOpen: boolean) => void | () => {} | Callback for when the tree visibility is toggled. |
|
|
491
484
|
| currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
|
|
492
|
-
| onCategoryChange |
|
|
485
|
+
| onCategoryChange | (selectedCategoryId: string) => void | () => {} | Callback for handling change of category. |
|
|
486
|
+
| onResizeEnd | VoidFunction | () => {} | Callback for when the resize is done. |
|
|
493
487
|
| useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
|
|
494
|
-
| className |
|
|
495
|
-
| children | TreeCategory | — | A list of TreeCategory components |
|
|
488
|
+
| className | string | — | Additional classes added on the wrapper element. |
|
|
496
489
|
|
|
497
490
|
#### Props: TreeCategory
|
|
498
491
|
|
|
@@ -500,9 +493,9 @@ export default AssetTreeExample;
|
|
|
500
493
|
|
|
501
494
|
| Name | Type | Default | Description |
|
|
502
495
|
| --- | --- | --- | --- |
|
|
503
|
-
| id |
|
|
504
|
-
| icon |
|
|
505
|
-
| label |
|
|
496
|
+
| id | string | — | A unique identifier for that category. |
|
|
497
|
+
| icon | string | — | The rioglyph icon name for that category. |
|
|
498
|
+
| label | string \| React.ReactNode | — | The optional label for the category which will be shown in a tooltip. |
|
|
506
499
|
| hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
|
|
507
500
|
|
|
508
501
|
#### Props: Tree
|
|
@@ -511,45 +504,48 @@ export default AssetTreeExample;
|
|
|
511
504
|
|
|
512
505
|
| Name | Type | Default | Description |
|
|
513
506
|
| --- | --- | --- | --- |
|
|
514
|
-
| groups |
|
|
515
|
-
| └id |
|
|
516
|
-
| └name |
|
|
517
|
-
| └position |
|
|
518
|
-
| └disabled |
|
|
519
|
-
| └
|
|
520
|
-
|
|
|
521
|
-
| └
|
|
522
|
-
|
|
|
523
|
-
| └
|
|
524
|
-
| └
|
|
525
|
-
| └
|
|
526
|
-
| └
|
|
527
|
-
| └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g.
|
|
528
|
-
| └
|
|
507
|
+
| groups | TreeGroup[] | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
|
|
508
|
+
| └id | string | — | A unique identifier of a group. |
|
|
509
|
+
| └name | string \| React.ReactNode | — | The name of a group. |
|
|
510
|
+
| └position | 'last' | — | Can be set to "last" to enforce the last position in the tree. |
|
|
511
|
+
| └disabled | boolean | — | Disallows the selection of the group itself. |
|
|
512
|
+
| └icon | string | — | The rioglyph icon name for a group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
513
|
+
| └expandedIcon | string | — | The rioglyph icon name for a expanded group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
514
|
+
| └className | string | — | Additional classes added to the group element. |
|
|
515
|
+
| items | TreeItem[] | [] | The list of items. |
|
|
516
|
+
| └id | string | — | A unique identifier of an item. |
|
|
517
|
+
| └name | string \| TreeItemName | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory. |
|
|
518
|
+
| └info | string \| React.ReactNode | — | The subline of an item. This can e used to show additional information for that item. |
|
|
519
|
+
| └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). |
|
|
520
|
+
| └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. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
521
|
+
| └subType | string | — | Optional sub-type of the item. This refers to the name of an additional rioglyph icon (excluding the rioglyph- prefix), typically used to render a secondary icon next to the primary one (Note: for fuel types better use the pairIcon prop). |
|
|
522
|
+
| └pairIcon | string \| null \| undefined | — | Optional pair icon override for the subType. If set to a string (e.g. 'fuel-gas'), this icon will be used explicitly. If set to undefined, the subType property will be used as the fallback icon. If set to null, no icon will be rendered, even if subType is defined. This allows full control over the icon behavior while maintaining backward compatibility with subType-based icons. |
|
|
523
|
+
| └groupIds | string[] | [] | List of group ids the items is associated with. |
|
|
529
524
|
| └className | string | — | Additional classes added to the item element. |
|
|
530
|
-
| selectedGroups |
|
|
531
|
-
| selectedItems |
|
|
532
|
-
| onSelectionChange |
|
|
525
|
+
| selectedGroups | string[] | [] | List of selected group ids. |
|
|
526
|
+
| selectedItems | string[] | [] | List of selected item ids. |
|
|
527
|
+
| onSelectionChange | ({ items, groups }: SelectionChangeResponse) => void | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
|
|
533
528
|
| hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
|
|
534
529
|
| showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
|
|
535
530
|
| hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
|
|
536
531
|
| searchPlaceholder | string | — | The text used as placeholder for the search input. |
|
|
537
|
-
| onSearchChange |
|
|
538
|
-
| search |
|
|
539
|
-
|
|
|
540
|
-
| summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
532
|
+
| onSearchChange | (value: string) => void | — | Callback for when the search value changes. |
|
|
533
|
+
| search | React.ReactNode | — | Used to define custom search component which replaces the built-in search. |
|
|
534
|
+
| summary | React.ReactNode | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
541
535
|
| hideSummary | boolean | false | Defines whether a summary is shown. |
|
|
536
|
+
| onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
|
|
542
537
|
| 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 |
|
|
544
|
-
| scrollHeight |
|
|
545
|
-
| expandedGroups |
|
|
546
|
-
| onExpandGroupsChange |
|
|
538
|
+
| treeHeaderContent | React.ReactElement | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
|
|
539
|
+
| scrollHeight | number | — | Defines the max-height of the scrollable list. |
|
|
540
|
+
| expandedGroups | string[] | — | List of group ids which are expanded. |
|
|
541
|
+
| onExpandGroupsChange | (newExpandedGroups: string[]) => void | — | Callback function triggered when a group expands or collapses. |
|
|
547
542
|
| 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. |
|
|
543
|
+
| treeOptions | React.ReactNode[] | — | Component to offer customization options for the tree. |
|
|
544
|
+
| treeOptionsTooltip | React.ReactNode | — | Tooltip content for the tree options dropdown. |
|
|
545
|
+
| disableAnimation | boolean | false | Disables animation when filtering or using search |
|
|
550
546
|
| virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
|
|
551
547
|
| overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
|
|
552
|
-
| className |
|
|
548
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
553
549
|
|
|
554
550
|
#### Props: TreeSearch
|
|
555
551
|
|
|
@@ -557,10 +553,10 @@ export default AssetTreeExample;
|
|
|
557
553
|
|
|
558
554
|
| Name | Type | Default | Description |
|
|
559
555
|
| --- | --- | --- | --- |
|
|
560
|
-
| value |
|
|
561
|
-
| onChange |
|
|
562
|
-
| placeholder |
|
|
563
|
-
| className |
|
|
556
|
+
| value | string | — | The search value to be shown and used for the search. |
|
|
557
|
+
| onChange | (newValue: string, event: React.ChangeEvent \| React.MouseEvent) => void | () => {} | Callback for when the search value changes. |
|
|
558
|
+
| placeholder | string | — | The placeholder text used for the input field. |
|
|
559
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
564
560
|
|
|
565
561
|
#### Props: TreeSummary
|
|
566
562
|
|
|
@@ -568,13 +564,14 @@ export default AssetTreeExample;
|
|
|
568
564
|
|
|
569
565
|
| Name | Type | Default | Description |
|
|
570
566
|
| --- | --- | --- | --- |
|
|
571
|
-
| assetCounts |
|
|
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
|
-
| └
|
|
577
|
-
|
|
|
567
|
+
| assetCounts | TreeSummaryCounts | — | The object containing various asset type counter. |
|
|
568
|
+
| └truck | number | — | The amount of trucks |
|
|
569
|
+
| └trailer | number | — | The amount of trailers |
|
|
570
|
+
| └bus | number | — | The amount of buses |
|
|
571
|
+
| └van | number | — | The amount of vans |
|
|
572
|
+
| └car | number | — | The amount of cars |
|
|
573
|
+
| └driver | number | — | The amount of drivers |
|
|
574
|
+
| gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow. |
|
|
578
575
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
579
576
|
|
|
580
577
|
#### Props: TreeSummaryRow
|
|
@@ -593,12 +590,12 @@ export default AssetTreeExample;
|
|
|
593
590
|
| --- | --- | --- | --- |
|
|
594
591
|
| type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
|
|
595
592
|
| 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 |
|
|
597
|
-
| hasFilter | boolean |
|
|
598
|
-
| enableActivity | boolean |
|
|
593
|
+
| isActive | boolean | — | Sets the active styling if active |
|
|
594
|
+
| hasFilter | boolean | false | Should be set when there is a type filter set in the tree to style the counter accordingly. |
|
|
595
|
+
| enableActivity | boolean | false | Allows for interactivity. Use this prop when you allow clicking on the counter. |
|
|
599
596
|
| hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
|
|
600
|
-
| onClick |
|
|
601
|
-
| value |
|
|
597
|
+
| onClick | (type: string) => void | — | 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. |
|
|
598
|
+
| value | string \| React.ReactNode \| number | — | A custom value to be shown in the counter. |
|
|
602
599
|
|
|
603
600
|
#### Props: TreeOption
|
|
604
601
|
|
|
@@ -606,38 +603,40 @@ export default AssetTreeExample;
|
|
|
606
603
|
|
|
607
604
|
| Name | Type | Default | Description |
|
|
608
605
|
| --- | --- | --- | --- |
|
|
609
|
-
| isChecked | boolean |
|
|
610
|
-
|
|
|
611
|
-
|
|
|
606
|
+
| isChecked | boolean | false | Defines whether the option is set. |
|
|
607
|
+
| onChange | (event: React.MouseEvent<HTMLDivElement>) => void | — | Callback triggered when option is selected. |
|
|
608
|
+
| label | string \| React.ReactNode | — | The label for the option. |
|
|
612
609
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
613
610
|
|
|
614
611
|
## AssetTree with single select
|
|
615
612
|
|
|
616
613
|
### Example: Example 2
|
|
617
614
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
615
|
+
11
|
|
616
|
+
7
|
|
617
|
+
4
|
|
618
|
+
8
|
|
622
619
|
|
|
623
|
-
My Empty
|
|
620
|
+
My Empty Group4
|
|
624
621
|
|
|
625
|
-
Truck Group
|
|
622
|
+
Truck Group East4
|
|
626
623
|
|
|
627
|
-
Truck Group
|
|
628
|
-
N18-
|
|
629
|
-
N18-
|
|
630
|
-
N18-
|
|
631
|
-
N18-
|
|
632
|
-
N18-
|
|
633
|
-
N18-
|
|
634
|
-
N18-
|
|
624
|
+
Truck Group North9
|
|
625
|
+
N18-G203 / M-AN 1002
|
|
626
|
+
N18-G260 / M-AN 1028
|
|
627
|
+
N18-G314 / M-AN 1006
|
|
628
|
+
N18-G370 / M-AN 1022
|
|
629
|
+
N18-G455 / M-AN 1024
|
|
630
|
+
N18-G502 / M-AN 1014
|
|
631
|
+
N18-G600 / M-AN 1001
|
|
632
|
+
N18-G752 / M-AN 1021
|
|
633
|
+
N18-G990 / M-AN 1015
|
|
635
634
|
|
|
636
|
-
Truck Group
|
|
635
|
+
Truck Group South5
|
|
637
636
|
|
|
638
637
|
Truck Group West3
|
|
639
638
|
|
|
640
|
-
All my unassigned
|
|
639
|
+
All my unassigned Trucks5
|
|
641
640
|
|
|
642
641
|
Current category:
|
|
643
642
|
assets
|
|
@@ -650,29 +649,31 @@ Truck Group North
|
|
|
650
649
|
|
|
651
650
|
#### Summary
|
|
652
651
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
652
|
+
11
|
|
653
|
+
7
|
|
654
|
+
4
|
|
655
|
+
8
|
|
657
656
|
|
|
658
|
-
My Empty
|
|
657
|
+
My Empty Group4
|
|
659
658
|
|
|
660
|
-
Truck Group
|
|
659
|
+
Truck Group East4
|
|
661
660
|
|
|
662
|
-
Truck Group
|
|
663
|
-
N18-
|
|
664
|
-
N18-
|
|
665
|
-
N18-
|
|
666
|
-
N18-
|
|
667
|
-
N18-
|
|
668
|
-
N18-
|
|
669
|
-
N18-
|
|
661
|
+
Truck Group North9
|
|
662
|
+
N18-G203 / M-AN 1002
|
|
663
|
+
N18-G260 / M-AN 1028
|
|
664
|
+
N18-G314 / M-AN 1006
|
|
665
|
+
N18-G370 / M-AN 1022
|
|
666
|
+
N18-G455 / M-AN 1024
|
|
667
|
+
N18-G502 / M-AN 1014
|
|
668
|
+
N18-G600 / M-AN 1001
|
|
669
|
+
N18-G752 / M-AN 1021
|
|
670
|
+
N18-G990 / M-AN 1015
|
|
670
671
|
|
|
671
|
-
Truck Group
|
|
672
|
+
Truck Group South5
|
|
672
673
|
|
|
673
674
|
Truck Group West3
|
|
674
675
|
|
|
675
|
-
All my unassigned
|
|
676
|
+
All my unassigned Trucks5
|
|
676
677
|
|
|
677
678
|
Current category:
|
|
678
679
|
assets
|
|
@@ -688,7 +689,7 @@ Truck Group North
|
|
|
688
689
|
```tsx
|
|
689
690
|
import { useState } from 'react';
|
|
690
691
|
import { isEmpty, isObject, random } from 'es-toolkit/compat';
|
|
691
|
-
import faker from 'faker';
|
|
692
|
+
import { faker } from '@faker-js/faker';
|
|
692
693
|
|
|
693
694
|
import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
|
|
694
695
|
import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
|
|
@@ -735,8 +736,8 @@ const assetTypes = ['truck', 'bus', 'van', 'trailer'];
|
|
|
735
736
|
const assets = Array.from({ length: 30 }, (_, index) => ({
|
|
736
737
|
id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
|
|
737
738
|
name: `N18-G${random(100, 999)} / M-AN 1${String(index).padStart(3, '0')}`,
|
|
738
|
-
type: faker.
|
|
739
|
-
groupIds: [faker.
|
|
739
|
+
type: faker.helpers.arrayElement(assetTypes),
|
|
740
|
+
groupIds: [faker.helpers.arrayElement(assetGroups).id],
|
|
740
741
|
}));
|
|
741
742
|
|
|
742
743
|
const AssetTreeSingleSelectExample = () => {
|
|
@@ -871,22 +872,22 @@ export default AssetTreeSingleSelectExample;
|
|
|
871
872
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
872
873
|
<span class="rioglyph rioglyph-trailer text-size-16 margin-right-2">
|
|
873
874
|
</span>
|
|
874
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
875
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">11</span>
|
|
875
876
|
</div>
|
|
876
877
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
877
|
-
<span class="rioglyph rioglyph-
|
|
878
|
+
<span class="rioglyph rioglyph-bus text-size-16 margin-right-2">
|
|
878
879
|
</span>
|
|
879
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
880
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
|
|
880
881
|
</div>
|
|
881
882
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
882
|
-
<span class="rioglyph rioglyph-
|
|
883
|
+
<span class="rioglyph rioglyph-van text-size-16 margin-right-2">
|
|
883
884
|
</span>
|
|
884
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
885
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">4</span>
|
|
885
886
|
</div>
|
|
886
887
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
887
888
|
<span class="rioglyph rioglyph-truck text-size-16 margin-right-2">
|
|
888
889
|
</span>
|
|
889
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
890
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">8</span>
|
|
890
891
|
</div>
|
|
891
892
|
</div>
|
|
892
893
|
</div>
|
|
@@ -899,7 +900,7 @@ export default AssetTreeSingleSelectExample;
|
|
|
899
900
|
<span class="TreeLabelNameText">
|
|
900
901
|
<span class="TreeLabelNameTextHeadline">My Empty Group</span>
|
|
901
902
|
</span>
|
|
902
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
903
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
|
|
903
904
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
904
905
|
</span>
|
|
905
906
|
</span>
|
|
@@ -911,7 +912,7 @@ export default AssetTreeSingleSelectExample;
|
|
|
911
912
|
<span class="TreeLabelNameText">
|
|
912
913
|
<span class="TreeLabelNameTextHeadline">Truck Group East</span>
|
|
913
914
|
</span>
|
|
914
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
915
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
|
|
915
916
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
916
917
|
</span>
|
|
917
918
|
</span>
|
|
@@ -923,71 +924,89 @@ export default AssetTreeSingleSelectExample;
|
|
|
923
924
|
<span class="TreeLabelNameText">
|
|
924
925
|
<span class="TreeLabelNameTextHeadline">Truck Group North</span>
|
|
925
926
|
</span>
|
|
926
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
927
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">9</span>
|
|
927
928
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
928
929
|
</span>
|
|
929
930
|
</span>
|
|
930
931
|
</div>
|
|
931
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
932
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d972">
|
|
932
933
|
<span class="TreeLabel TreeLabelName">
|
|
933
|
-
<span class="rioglyph rioglyph-
|
|
934
|
+
<span class="rioglyph rioglyph-trailer">
|
|
934
935
|
</span>
|
|
935
936
|
<span class="TreeLabelNameText">
|
|
936
|
-
<span class="TreeLabelNameTextHeadline">N18-
|
|
937
|
+
<span class="TreeLabelNameTextHeadline">N18-G203 / M-AN 1002</span>
|
|
937
938
|
</span>
|
|
938
939
|
</span>
|
|
939
940
|
</div>
|
|
940
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
941
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9728">
|
|
941
942
|
<span class="TreeLabel TreeLabelName">
|
|
942
|
-
<span class="rioglyph rioglyph-
|
|
943
|
+
<span class="rioglyph rioglyph-bus">
|
|
943
944
|
</span>
|
|
944
945
|
<span class="TreeLabelNameText">
|
|
945
|
-
<span class="TreeLabelNameTextHeadline">N18-
|
|
946
|
+
<span class="TreeLabelNameTextHeadline">N18-G260 / M-AN 1028</span>
|
|
946
947
|
</span>
|
|
947
948
|
</span>
|
|
948
949
|
</div>
|
|
949
950
|
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d976">
|
|
950
951
|
<span class="TreeLabel TreeLabelName">
|
|
951
|
-
<span class="rioglyph rioglyph-
|
|
952
|
+
<span class="rioglyph rioglyph-truck">
|
|
952
953
|
</span>
|
|
953
954
|
<span class="TreeLabelNameText">
|
|
954
|
-
<span class="TreeLabelNameTextHeadline">N18-
|
|
955
|
+
<span class="TreeLabelNameTextHeadline">N18-G314 / M-AN 1006</span>
|
|
955
956
|
</span>
|
|
956
957
|
</span>
|
|
957
958
|
</div>
|
|
958
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
959
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9722">
|
|
959
960
|
<span class="TreeLabel TreeLabelName">
|
|
960
|
-
<span class="rioglyph rioglyph-
|
|
961
|
+
<span class="rioglyph rioglyph-bus">
|
|
961
962
|
</span>
|
|
962
963
|
<span class="TreeLabelNameText">
|
|
963
|
-
<span class="TreeLabelNameTextHeadline">N18-
|
|
964
|
+
<span class="TreeLabelNameTextHeadline">N18-G370 / M-AN 1022</span>
|
|
964
965
|
</span>
|
|
965
966
|
</span>
|
|
966
967
|
</div>
|
|
967
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
968
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9724">
|
|
968
969
|
<span class="TreeLabel TreeLabelName">
|
|
969
|
-
<span class="rioglyph rioglyph-
|
|
970
|
+
<span class="rioglyph rioglyph-van">
|
|
970
971
|
</span>
|
|
971
972
|
<span class="TreeLabelNameText">
|
|
972
|
-
<span class="TreeLabelNameTextHeadline">N18-
|
|
973
|
+
<span class="TreeLabelNameTextHeadline">N18-G455 / M-AN 1024</span>
|
|
973
974
|
</span>
|
|
974
975
|
</span>
|
|
975
976
|
</div>
|
|
976
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
977
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9714">
|
|
977
978
|
<span class="TreeLabel TreeLabelName">
|
|
978
979
|
<span class="rioglyph rioglyph-truck">
|
|
979
980
|
</span>
|
|
980
981
|
<span class="TreeLabelNameText">
|
|
981
|
-
<span class="TreeLabelNameTextHeadline">N18-
|
|
982
|
+
<span class="TreeLabelNameTextHeadline">N18-G502 / M-AN 1014</span>
|
|
982
983
|
</span>
|
|
983
984
|
</span>
|
|
984
985
|
</div>
|
|
985
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
986
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d971">
|
|
987
|
+
<span class="TreeLabel TreeLabelName">
|
|
988
|
+
<span class="rioglyph rioglyph-bus">
|
|
989
|
+
</span>
|
|
990
|
+
<span class="TreeLabelNameText">
|
|
991
|
+
<span class="TreeLabelNameTextHeadline">N18-G600 / M-AN 1001</span>
|
|
992
|
+
</span>
|
|
993
|
+
</span>
|
|
994
|
+
</div>
|
|
995
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9721">
|
|
986
996
|
<span class="TreeLabel TreeLabelName">
|
|
987
997
|
<span class="rioglyph rioglyph-trailer">
|
|
988
998
|
</span>
|
|
989
999
|
<span class="TreeLabelNameText">
|
|
990
|
-
<span class="TreeLabelNameTextHeadline">N18-
|
|
1000
|
+
<span class="TreeLabelNameTextHeadline">N18-G752 / M-AN 1021</span>
|
|
1001
|
+
</span>
|
|
1002
|
+
</span>
|
|
1003
|
+
</div>
|
|
1004
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9715">
|
|
1005
|
+
<span class="TreeLabel TreeLabelName">
|
|
1006
|
+
<span class="rioglyph rioglyph-bus">
|
|
1007
|
+
</span>
|
|
1008
|
+
<span class="TreeLabelNameText">
|
|
1009
|
+
<span class="TreeLabelNameTextHeadline">N18-G990 / M-AN 1015</span>
|
|
991
1010
|
</span>
|
|
992
1011
|
</span>
|
|
993
1012
|
</div>
|
|
@@ -998,7 +1017,7 @@ export default AssetTreeSingleSelectExample;
|
|
|
998
1017
|
<span class="TreeLabelNameText">
|
|
999
1018
|
<span class="TreeLabelNameTextHeadline">Truck Group South</span>
|
|
1000
1019
|
</span>
|
|
1001
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
1020
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
|
|
1002
1021
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
1003
1022
|
</span>
|
|
1004
1023
|
</span>
|
|
@@ -1022,7 +1041,7 @@ export default AssetTreeSingleSelectExample;
|
|
|
1022
1041
|
<span class="TreeLabelNameText">
|
|
1023
1042
|
<span class="TreeLabelNameTextHeadline">All my unassigned Trucks</span>
|
|
1024
1043
|
</span>
|
|
1025
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
1044
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
|
|
1026
1045
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
1027
1046
|
</span>
|
|
1028
1047
|
</span>
|
|
@@ -1071,19 +1090,18 @@ export default AssetTreeSingleSelectExample;
|
|
|
1071
1090
|
| --- | --- | --- | --- |
|
|
1072
1091
|
| fly | boolean | false | Defines if the component will overlap the body content. |
|
|
1073
1092
|
| resizable | boolean | true | Defines whether or not the sidebar is resizable. |
|
|
1074
|
-
| onResizeEnd | Function | () => {} | Callback for when the resize is done. |
|
|
1075
1093
|
| bordered | boolean | false | Defines whether the component has a border or not. |
|
|
1076
|
-
| width |
|
|
1094
|
+
| width | 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
1095
|
| minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
|
|
1078
1096
|
| maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
|
|
1079
1097
|
| height | number | — | Defines the height of the component in px. |
|
|
1080
1098
|
| isOpen | boolean | true | Defines whether the component is open or not. |
|
|
1081
|
-
| onToggleTree |
|
|
1099
|
+
| onToggleTree | (isOpen: boolean) => void | () => {} | Callback for when the tree visibility is toggled. |
|
|
1082
1100
|
| currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
|
|
1083
|
-
| onCategoryChange |
|
|
1101
|
+
| onCategoryChange | (selectedCategoryId: string) => void | () => {} | Callback for handling change of category. |
|
|
1102
|
+
| onResizeEnd | VoidFunction | () => {} | Callback for when the resize is done. |
|
|
1084
1103
|
| useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
|
|
1085
|
-
| className |
|
|
1086
|
-
| children | TreeCategory | — | A list of TreeCategory components |
|
|
1104
|
+
| className | string | — | Additional classes added on the wrapper element. |
|
|
1087
1105
|
|
|
1088
1106
|
#### Props: TreeCategory
|
|
1089
1107
|
|
|
@@ -1091,9 +1109,9 @@ export default AssetTreeSingleSelectExample;
|
|
|
1091
1109
|
|
|
1092
1110
|
| Name | Type | Default | Description |
|
|
1093
1111
|
| --- | --- | --- | --- |
|
|
1094
|
-
| id |
|
|
1095
|
-
| icon |
|
|
1096
|
-
| label |
|
|
1112
|
+
| id | string | — | A unique identifier for that category. |
|
|
1113
|
+
| icon | string | — | The rioglyph icon name for that category. |
|
|
1114
|
+
| label | string \| React.ReactNode | — | The optional label for the category which will be shown in a tooltip. |
|
|
1097
1115
|
| hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
|
|
1098
1116
|
|
|
1099
1117
|
#### Props: Tree
|
|
@@ -1102,45 +1120,48 @@ export default AssetTreeSingleSelectExample;
|
|
|
1102
1120
|
|
|
1103
1121
|
| Name | Type | Default | Description |
|
|
1104
1122
|
| --- | --- | --- | --- |
|
|
1105
|
-
| groups |
|
|
1106
|
-
| └id |
|
|
1107
|
-
| └name |
|
|
1108
|
-
| └position |
|
|
1109
|
-
| └disabled |
|
|
1110
|
-
| └
|
|
1111
|
-
|
|
|
1112
|
-
| └
|
|
1113
|
-
|
|
|
1114
|
-
| └
|
|
1115
|
-
| └
|
|
1116
|
-
| └
|
|
1117
|
-
| └
|
|
1118
|
-
| └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g.
|
|
1119
|
-
| └
|
|
1123
|
+
| groups | TreeGroup[] | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
|
|
1124
|
+
| └id | string | — | A unique identifier of a group. |
|
|
1125
|
+
| └name | string \| React.ReactNode | — | The name of a group. |
|
|
1126
|
+
| └position | 'last' | — | Can be set to "last" to enforce the last position in the tree. |
|
|
1127
|
+
| └disabled | boolean | — | Disallows the selection of the group itself. |
|
|
1128
|
+
| └icon | string | — | The rioglyph icon name for a group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
1129
|
+
| └expandedIcon | string | — | The rioglyph icon name for a expanded group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
1130
|
+
| └className | string | — | Additional classes added to the group element. |
|
|
1131
|
+
| items | TreeItem[] | [] | The list of items. |
|
|
1132
|
+
| └id | string | — | A unique identifier of an item. |
|
|
1133
|
+
| └name | string \| TreeItemName | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory. |
|
|
1134
|
+
| └info | string \| React.ReactNode | — | The subline of an item. This can e used to show additional information for that item. |
|
|
1135
|
+
| └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). |
|
|
1136
|
+
| └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. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
1137
|
+
| └subType | string | — | Optional sub-type of the item. This refers to the name of an additional rioglyph icon (excluding the rioglyph- prefix), typically used to render a secondary icon next to the primary one (Note: for fuel types better use the pairIcon prop). |
|
|
1138
|
+
| └pairIcon | string \| null \| undefined | — | Optional pair icon override for the subType. If set to a string (e.g. 'fuel-gas'), this icon will be used explicitly. If set to undefined, the subType property will be used as the fallback icon. If set to null, no icon will be rendered, even if subType is defined. This allows full control over the icon behavior while maintaining backward compatibility with subType-based icons. |
|
|
1139
|
+
| └groupIds | string[] | [] | List of group ids the items is associated with. |
|
|
1120
1140
|
| └className | string | — | Additional classes added to the item element. |
|
|
1121
|
-
| selectedGroups |
|
|
1122
|
-
| selectedItems |
|
|
1123
|
-
| onSelectionChange |
|
|
1141
|
+
| selectedGroups | string[] | [] | List of selected group ids. |
|
|
1142
|
+
| selectedItems | string[] | [] | List of selected item ids. |
|
|
1143
|
+
| onSelectionChange | ({ items, groups }: SelectionChangeResponse) => void | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
|
|
1124
1144
|
| hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
|
|
1125
1145
|
| showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
|
|
1126
1146
|
| hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
|
|
1127
1147
|
| searchPlaceholder | string | — | The text used as placeholder for the search input. |
|
|
1128
|
-
| onSearchChange |
|
|
1129
|
-
| search |
|
|
1130
|
-
|
|
|
1131
|
-
| summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
1148
|
+
| onSearchChange | (value: string) => void | — | Callback for when the search value changes. |
|
|
1149
|
+
| search | React.ReactNode | — | Used to define custom search component which replaces the built-in search. |
|
|
1150
|
+
| summary | React.ReactNode | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
1132
1151
|
| hideSummary | boolean | false | Defines whether a summary is shown. |
|
|
1152
|
+
| onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
|
|
1133
1153
|
| 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 |
|
|
1135
|
-
| scrollHeight |
|
|
1136
|
-
| expandedGroups |
|
|
1137
|
-
| onExpandGroupsChange |
|
|
1154
|
+
| treeHeaderContent | React.ReactElement | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
|
|
1155
|
+
| scrollHeight | number | — | Defines the max-height of the scrollable list. |
|
|
1156
|
+
| expandedGroups | string[] | — | List of group ids which are expanded. |
|
|
1157
|
+
| onExpandGroupsChange | (newExpandedGroups: string[]) => void | — | Callback function triggered when a group expands or collapses. |
|
|
1138
1158
|
| 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. |
|
|
1159
|
+
| treeOptions | React.ReactNode[] | — | Component to offer customization options for the tree. |
|
|
1160
|
+
| treeOptionsTooltip | React.ReactNode | — | Tooltip content for the tree options dropdown. |
|
|
1161
|
+
| disableAnimation | boolean | false | Disables animation when filtering or using search |
|
|
1141
1162
|
| virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
|
|
1142
1163
|
| overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
|
|
1143
|
-
| className |
|
|
1164
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
1144
1165
|
|
|
1145
1166
|
#### Props: TreeSearch
|
|
1146
1167
|
|
|
@@ -1148,10 +1169,10 @@ export default AssetTreeSingleSelectExample;
|
|
|
1148
1169
|
|
|
1149
1170
|
| Name | Type | Default | Description |
|
|
1150
1171
|
| --- | --- | --- | --- |
|
|
1151
|
-
| value |
|
|
1152
|
-
| onChange |
|
|
1153
|
-
| placeholder |
|
|
1154
|
-
| className |
|
|
1172
|
+
| value | string | — | The search value to be shown and used for the search. |
|
|
1173
|
+
| onChange | (newValue: string, event: React.ChangeEvent \| React.MouseEvent) => void | () => {} | Callback for when the search value changes. |
|
|
1174
|
+
| placeholder | string | — | The placeholder text used for the input field. |
|
|
1175
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
1155
1176
|
|
|
1156
1177
|
#### Props: TreeSummary
|
|
1157
1178
|
|
|
@@ -1159,13 +1180,14 @@ export default AssetTreeSingleSelectExample;
|
|
|
1159
1180
|
|
|
1160
1181
|
| Name | Type | Default | Description |
|
|
1161
1182
|
| --- | --- | --- | --- |
|
|
1162
|
-
| assetCounts |
|
|
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
|
-
| └
|
|
1168
|
-
|
|
|
1183
|
+
| assetCounts | TreeSummaryCounts | — | The object containing various asset type counter. |
|
|
1184
|
+
| └truck | number | — | The amount of trucks |
|
|
1185
|
+
| └trailer | number | — | The amount of trailers |
|
|
1186
|
+
| └bus | number | — | The amount of buses |
|
|
1187
|
+
| └van | number | — | The amount of vans |
|
|
1188
|
+
| └car | number | — | The amount of cars |
|
|
1189
|
+
| └driver | number | — | The amount of drivers |
|
|
1190
|
+
| gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow. |
|
|
1169
1191
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
1170
1192
|
|
|
1171
1193
|
#### Props: TreeSummaryRow
|
|
@@ -1184,12 +1206,12 @@ export default AssetTreeSingleSelectExample;
|
|
|
1184
1206
|
| --- | --- | --- | --- |
|
|
1185
1207
|
| type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
|
|
1186
1208
|
| 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 |
|
|
1188
|
-
| hasFilter | boolean |
|
|
1189
|
-
| enableActivity | boolean |
|
|
1209
|
+
| isActive | boolean | — | Sets the active styling if active |
|
|
1210
|
+
| hasFilter | boolean | false | Should be set when there is a type filter set in the tree to style the counter accordingly. |
|
|
1211
|
+
| enableActivity | boolean | false | Allows for interactivity. Use this prop when you allow clicking on the counter. |
|
|
1190
1212
|
| hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
|
|
1191
|
-
| onClick |
|
|
1192
|
-
| value |
|
|
1213
|
+
| onClick | (type: string) => void | — | 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. |
|
|
1214
|
+
| value | string \| React.ReactNode \| number | — | A custom value to be shown in the counter. |
|
|
1193
1215
|
|
|
1194
1216
|
#### Props: TreeOption
|
|
1195
1217
|
|
|
@@ -1197,43 +1219,37 @@ export default AssetTreeSingleSelectExample;
|
|
|
1197
1219
|
|
|
1198
1220
|
| Name | Type | Default | Description |
|
|
1199
1221
|
| --- | --- | --- | --- |
|
|
1200
|
-
| isChecked | boolean |
|
|
1201
|
-
|
|
|
1202
|
-
|
|
|
1222
|
+
| isChecked | boolean | false | Defines whether the option is set. |
|
|
1223
|
+
| onChange | (event: React.MouseEvent<HTMLDivElement>) => void | — | Callback triggered when option is selected. |
|
|
1224
|
+
| label | string \| React.ReactNode | — | The label for the option. |
|
|
1203
1225
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
1204
1226
|
|
|
1205
1227
|
## AssetTree with multiple asset filter in summary
|
|
1206
1228
|
|
|
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
1229
|
### Example: Example 3
|
|
1210
1230
|
|
|
1231
|
+
9
|
|
1211
1232
|
7
|
|
1212
|
-
4
|
|
1213
1233
|
3
|
|
1214
|
-
|
|
1234
|
+
1
|
|
1215
1235
|
|
|
1236
|
+
8
|
|
1216
1237
|
7
|
|
1217
|
-
5
|
|
1218
1238
|
1
|
|
1219
|
-
|
|
1220
|
-
|
|
1239
|
+
2
|
|
1240
|
+
2
|
|
1221
1241
|
|
|
1222
|
-
Mixed
|
|
1223
|
-
Vehicle-
|
|
1224
|
-
Vehicle-
|
|
1225
|
-
Vehicle-
|
|
1226
|
-
Vehicle-
|
|
1227
|
-
Vehicle-
|
|
1228
|
-
Vehicle-
|
|
1229
|
-
Vehicle-
|
|
1230
|
-
Vehicle-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
Vehicle-9194Debug: lpg
|
|
1234
|
-
Vehicle-9266Debug: hydrogen
|
|
1235
|
-
|
|
1236
|
-
Ungrouped8
|
|
1242
|
+
Mixed Vehicles8
|
|
1243
|
+
Vehicle-1670Debug: hydrogen
|
|
1244
|
+
Vehicle-2011Debug: diesel
|
|
1245
|
+
Vehicle-3346Debug: dual_fuel_diesel_cng
|
|
1246
|
+
Vehicle-3670Debug: lpg
|
|
1247
|
+
Vehicle-5464Debug: cng
|
|
1248
|
+
Vehicle-6229Debug: lpg
|
|
1249
|
+
Vehicle-6521Debug: cng
|
|
1250
|
+
Vehicle-7377Debug: gas
|
|
1251
|
+
|
|
1252
|
+
Ungrouped12
|
|
1237
1253
|
|
|
1238
1254
|
Selected groups:
|
|
1239
1255
|
|
|
@@ -1244,32 +1260,28 @@ Mixed Vehicles
|
|
|
1244
1260
|
|
|
1245
1261
|
#### Summary
|
|
1246
1262
|
|
|
1263
|
+
9
|
|
1247
1264
|
7
|
|
1248
|
-
4
|
|
1249
1265
|
3
|
|
1250
|
-
|
|
1266
|
+
1
|
|
1251
1267
|
|
|
1268
|
+
8
|
|
1252
1269
|
7
|
|
1253
|
-
5
|
|
1254
1270
|
1
|
|
1255
|
-
|
|
1256
|
-
|
|
1271
|
+
2
|
|
1272
|
+
2
|
|
1273
|
+
|
|
1274
|
+
Mixed Vehicles8
|
|
1275
|
+
Vehicle-1670Debug: hydrogen
|
|
1276
|
+
Vehicle-2011Debug: diesel
|
|
1277
|
+
Vehicle-3346Debug: dual_fuel_diesel_cng
|
|
1278
|
+
Vehicle-3670Debug: lpg
|
|
1279
|
+
Vehicle-5464Debug: cng
|
|
1280
|
+
Vehicle-6229Debug: lpg
|
|
1281
|
+
Vehicle-6521Debug: cng
|
|
1282
|
+
Vehicle-7377Debug: gas
|
|
1257
1283
|
|
|
1258
|
-
|
|
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
|
|
1284
|
+
Ungrouped12
|
|
1273
1285
|
|
|
1274
1286
|
Selected groups:
|
|
1275
1287
|
|
|
@@ -1283,7 +1295,7 @@ Mixed Vehicles
|
|
|
1283
1295
|
```tsx
|
|
1284
1296
|
import { useMemo, useState } from 'react';
|
|
1285
1297
|
import { isEmpty, random } from 'es-toolkit/compat';
|
|
1286
|
-
import faker from 'faker';
|
|
1298
|
+
import { faker } from '@faker-js/faker';
|
|
1287
1299
|
|
|
1288
1300
|
import AssetTree from '@rio-cloud/rio-uikit/AssetTree';
|
|
1289
1301
|
import TreeCategory from '@rio-cloud/rio-uikit/TreeCategory';
|
|
@@ -1334,15 +1346,15 @@ const fuelTypes = ['diesel', 'electric', 'gas', 'hydrogen', 'cng', 'lpg', 'dual_
|
|
|
1334
1346
|
|
|
1335
1347
|
const getVehicles = (withSubType = true): TreeItem[] =>
|
|
1336
1348
|
Array.from({ length: 20 }, (_, index) => {
|
|
1337
|
-
const fuelType = withSubType ? faker.
|
|
1349
|
+
const fuelType = withSubType ? faker.helpers.arrayElement(fuelTypes) : undefined;
|
|
1338
1350
|
return {
|
|
1339
1351
|
id: `010191ac-d06d-4567-b13a-7b7fd85d97${index}`,
|
|
1340
1352
|
name: `Vehicle-${random(1000, 9999)}`,
|
|
1341
1353
|
info: <span>Debug: {fuelType}</span>,
|
|
1342
|
-
type: faker.
|
|
1354
|
+
type: faker.helpers.arrayElement(assetTypes),
|
|
1343
1355
|
subType: fuelType, // subType cannot be used as icon here anymore
|
|
1344
1356
|
pairIcon: getFuelIcon(fuelType),
|
|
1345
|
-
groupIds: [faker.
|
|
1357
|
+
groupIds: [faker.helpers.arrayElement(truckGroups).id],
|
|
1346
1358
|
};
|
|
1347
1359
|
});
|
|
1348
1360
|
|
|
@@ -1604,12 +1616,12 @@ export default AssetTreeExample;
|
|
|
1604
1616
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1605
1617
|
<span class="rioglyph rioglyph-truck-baseline text-size-16 margin-right-2">
|
|
1606
1618
|
</span>
|
|
1607
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
1619
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">9</span>
|
|
1608
1620
|
</div>
|
|
1609
1621
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1610
1622
|
<span class="rioglyph rioglyph-bus-baseline text-size-16 margin-right-2">
|
|
1611
1623
|
</span>
|
|
1612
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
1624
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
|
|
1613
1625
|
</div>
|
|
1614
1626
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1615
1627
|
<span class="rioglyph rioglyph-van-baseline text-size-16 margin-right-2">
|
|
@@ -1619,19 +1631,19 @@ export default AssetTreeExample;
|
|
|
1619
1631
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1620
1632
|
<span class="rioglyph rioglyph-car-baseline text-size-16 margin-right-2">
|
|
1621
1633
|
</span>
|
|
1622
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
1634
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">1</span>
|
|
1623
1635
|
</div>
|
|
1624
1636
|
</div>
|
|
1625
1637
|
<div class="TreeSummaryRow display-grid grid-cols-4 gap-10">
|
|
1626
1638
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1627
1639
|
<span class="rioglyph rioglyph-fuel-liquid text-size-16 margin-right-2">
|
|
1628
1640
|
</span>
|
|
1629
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
1641
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">8</span>
|
|
1630
1642
|
</div>
|
|
1631
1643
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1632
1644
|
<span class="rioglyph rioglyph-fuel-gas text-size-16 margin-right-2">
|
|
1633
1645
|
</span>
|
|
1634
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
1646
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">7</span>
|
|
1635
1647
|
</div>
|
|
1636
1648
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1637
1649
|
<span class="rioglyph rioglyph-fuel-electric text-size-16 margin-right-2">
|
|
@@ -1641,19 +1653,19 @@ export default AssetTreeExample;
|
|
|
1641
1653
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1642
1654
|
<span class="rioglyph rioglyph-fuel-hydrogen text-size-16 margin-right-2">
|
|
1643
1655
|
</span>
|
|
1644
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
1656
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
|
|
1645
1657
|
</div>
|
|
1646
1658
|
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 cursor-pointer">
|
|
1647
1659
|
<span class="rioglyph rioglyph-fuel-mix text-size-16 margin-right-2">
|
|
1648
1660
|
</span>
|
|
1649
|
-
<span class="TreeLabelCount label label-condensed label-muted label-filled">
|
|
1661
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">2</span>
|
|
1650
1662
|
</div>
|
|
1651
1663
|
</div>
|
|
1652
1664
|
</div>
|
|
1653
1665
|
</div>
|
|
1654
1666
|
<div>
|
|
1655
1667
|
<div class="dropdown btn-group TreeHeaderOptions height-20">
|
|
1656
|
-
<button type="button" id="
|
|
1668
|
+
<button type="button" id="ujryythjcze" 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
1669
|
<span class="rioglyph rioglyph-option-vertical" aria-hidden="true">
|
|
1658
1670
|
</span>
|
|
1659
1671
|
</button>
|
|
@@ -1673,32 +1685,11 @@ export default AssetTreeExample;
|
|
|
1673
1685
|
<span class="TreeLabelNameText">
|
|
1674
1686
|
<span class="TreeLabelNameTextHeadline">Mixed Vehicles</span>
|
|
1675
1687
|
</span>
|
|
1676
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
1688
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">8</span>
|
|
1677
1689
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
1678
1690
|
</span>
|
|
1679
1691
|
</span>
|
|
1680
1692
|
</div>
|
|
1681
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d970">
|
|
1682
|
-
<label class="checkbox TreeCheckbox" tabindex="0">
|
|
1683
|
-
<input type="checkbox" class="TreeCheckbox">
|
|
1684
|
-
<span class="checkbox-text">
|
|
1685
|
-
</span>
|
|
1686
|
-
</label>
|
|
1687
|
-
<span class="TreeLabel TreeLabelName">
|
|
1688
|
-
<span class="rioglyph-icon-pair">
|
|
1689
|
-
<span class="rioglyph rioglyph-truck">
|
|
1690
|
-
</span>
|
|
1691
|
-
<span class="rioglyph rioglyph-fuel-gas">
|
|
1692
|
-
</span>
|
|
1693
|
-
</span>
|
|
1694
|
-
<span class="TreeLabelNameText">
|
|
1695
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-1219</span>
|
|
1696
|
-
<span class="TreeLabelNameTextSubline">
|
|
1697
|
-
<span>Debug: lpg</span>
|
|
1698
|
-
</span>
|
|
1699
|
-
</span>
|
|
1700
|
-
</span>
|
|
1701
|
-
</div>
|
|
1702
1693
|
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d978">
|
|
1703
1694
|
<label class="checkbox TreeCheckbox" tabindex="0">
|
|
1704
1695
|
<input type="checkbox" class="TreeCheckbox">
|
|
@@ -1707,20 +1698,20 @@ export default AssetTreeExample;
|
|
|
1707
1698
|
</label>
|
|
1708
1699
|
<span class="TreeLabel TreeLabelName">
|
|
1709
1700
|
<span class="rioglyph-icon-pair">
|
|
1710
|
-
<span class="rioglyph rioglyph-
|
|
1701
|
+
<span class="rioglyph rioglyph-van">
|
|
1711
1702
|
</span>
|
|
1712
|
-
<span class="rioglyph rioglyph-fuel-
|
|
1703
|
+
<span class="rioglyph rioglyph-fuel-hydrogen">
|
|
1713
1704
|
</span>
|
|
1714
1705
|
</span>
|
|
1715
1706
|
<span class="TreeLabelNameText">
|
|
1716
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-
|
|
1707
|
+
<span class="TreeLabelNameTextHeadline">Vehicle-1670</span>
|
|
1717
1708
|
<span class="TreeLabelNameTextSubline">
|
|
1718
|
-
<span>Debug:
|
|
1709
|
+
<span>Debug: hydrogen</span>
|
|
1719
1710
|
</span>
|
|
1720
1711
|
</span>
|
|
1721
1712
|
</span>
|
|
1722
1713
|
</div>
|
|
1723
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
1714
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d970">
|
|
1724
1715
|
<label class="checkbox TreeCheckbox" tabindex="0">
|
|
1725
1716
|
<input type="checkbox" class="TreeCheckbox">
|
|
1726
1717
|
<span class="checkbox-text">
|
|
@@ -1728,20 +1719,20 @@ export default AssetTreeExample;
|
|
|
1728
1719
|
</label>
|
|
1729
1720
|
<span class="TreeLabel TreeLabelName">
|
|
1730
1721
|
<span class="rioglyph-icon-pair">
|
|
1731
|
-
<span class="rioglyph rioglyph-
|
|
1722
|
+
<span class="rioglyph rioglyph-truck">
|
|
1732
1723
|
</span>
|
|
1733
1724
|
<span class="rioglyph rioglyph-fuel-liquid">
|
|
1734
1725
|
</span>
|
|
1735
1726
|
</span>
|
|
1736
1727
|
<span class="TreeLabelNameText">
|
|
1737
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-
|
|
1728
|
+
<span class="TreeLabelNameTextHeadline">Vehicle-2011</span>
|
|
1738
1729
|
<span class="TreeLabelNameTextSubline">
|
|
1739
|
-
<span>Debug:
|
|
1730
|
+
<span>Debug: diesel</span>
|
|
1740
1731
|
</span>
|
|
1741
1732
|
</span>
|
|
1742
1733
|
</span>
|
|
1743
1734
|
</div>
|
|
1744
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
1735
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9715">
|
|
1745
1736
|
<label class="checkbox TreeCheckbox" tabindex="0">
|
|
1746
1737
|
<input type="checkbox" class="TreeCheckbox">
|
|
1747
1738
|
<span class="checkbox-text">
|
|
@@ -1751,13 +1742,13 @@ export default AssetTreeExample;
|
|
|
1751
1742
|
<span class="rioglyph-icon-pair">
|
|
1752
1743
|
<span class="rioglyph rioglyph-truck">
|
|
1753
1744
|
</span>
|
|
1754
|
-
<span class="rioglyph rioglyph-fuel-
|
|
1745
|
+
<span class="rioglyph rioglyph-fuel-mix">
|
|
1755
1746
|
</span>
|
|
1756
1747
|
</span>
|
|
1757
1748
|
<span class="TreeLabelNameText">
|
|
1758
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-
|
|
1749
|
+
<span class="TreeLabelNameTextHeadline">Vehicle-3346</span>
|
|
1759
1750
|
<span class="TreeLabelNameTextSubline">
|
|
1760
|
-
<span>Debug:
|
|
1751
|
+
<span>Debug: dual_fuel_diesel_cng</span>
|
|
1761
1752
|
</span>
|
|
1762
1753
|
</span>
|
|
1763
1754
|
</span>
|
|
@@ -1770,13 +1761,13 @@ export default AssetTreeExample;
|
|
|
1770
1761
|
</label>
|
|
1771
1762
|
<span class="TreeLabel TreeLabelName">
|
|
1772
1763
|
<span class="rioglyph-icon-pair">
|
|
1773
|
-
<span class="rioglyph rioglyph-
|
|
1764
|
+
<span class="rioglyph rioglyph-bus">
|
|
1774
1765
|
</span>
|
|
1775
1766
|
<span class="rioglyph rioglyph-fuel-gas">
|
|
1776
1767
|
</span>
|
|
1777
1768
|
</span>
|
|
1778
1769
|
<span class="TreeLabelNameText">
|
|
1779
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-
|
|
1770
|
+
<span class="TreeLabelNameTextHeadline">Vehicle-3670</span>
|
|
1780
1771
|
<span class="TreeLabelNameTextSubline">
|
|
1781
1772
|
<span>Debug: lpg</span>
|
|
1782
1773
|
</span>
|
|
@@ -1791,36 +1782,15 @@ export default AssetTreeExample;
|
|
|
1791
1782
|
</label>
|
|
1792
1783
|
<span class="TreeLabel TreeLabelName">
|
|
1793
1784
|
<span class="rioglyph-icon-pair">
|
|
1794
|
-
<span class="rioglyph rioglyph-
|
|
1795
|
-
</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">
|
|
1785
|
+
<span class="rioglyph rioglyph-truck">
|
|
1816
1786
|
</span>
|
|
1817
|
-
<span class="rioglyph rioglyph-fuel-
|
|
1787
|
+
<span class="rioglyph rioglyph-fuel-gas">
|
|
1818
1788
|
</span>
|
|
1819
1789
|
</span>
|
|
1820
1790
|
<span class="TreeLabelNameText">
|
|
1821
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-
|
|
1791
|
+
<span class="TreeLabelNameTextHeadline">Vehicle-5464</span>
|
|
1822
1792
|
<span class="TreeLabelNameTextSubline">
|
|
1823
|
-
<span>Debug:
|
|
1793
|
+
<span>Debug: cng</span>
|
|
1824
1794
|
</span>
|
|
1825
1795
|
</span>
|
|
1826
1796
|
</span>
|
|
@@ -1833,15 +1803,15 @@ export default AssetTreeExample;
|
|
|
1833
1803
|
</label>
|
|
1834
1804
|
<span class="TreeLabel TreeLabelName">
|
|
1835
1805
|
<span class="rioglyph-icon-pair">
|
|
1836
|
-
<span class="rioglyph rioglyph-
|
|
1806
|
+
<span class="rioglyph rioglyph-truck">
|
|
1837
1807
|
</span>
|
|
1838
|
-
<span class="rioglyph rioglyph-fuel-
|
|
1808
|
+
<span class="rioglyph rioglyph-fuel-gas">
|
|
1839
1809
|
</span>
|
|
1840
1810
|
</span>
|
|
1841
1811
|
<span class="TreeLabelNameText">
|
|
1842
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-
|
|
1812
|
+
<span class="TreeLabelNameTextHeadline">Vehicle-6229</span>
|
|
1843
1813
|
<span class="TreeLabelNameTextSubline">
|
|
1844
|
-
<span>Debug:
|
|
1814
|
+
<span>Debug: lpg</span>
|
|
1845
1815
|
</span>
|
|
1846
1816
|
</span>
|
|
1847
1817
|
</span>
|
|
@@ -1856,60 +1826,18 @@ export default AssetTreeExample;
|
|
|
1856
1826
|
<span class="rioglyph-icon-pair">
|
|
1857
1827
|
<span class="rioglyph rioglyph-bus">
|
|
1858
1828
|
</span>
|
|
1859
|
-
<span class="rioglyph rioglyph-fuel-mix">
|
|
1860
|
-
</span>
|
|
1861
|
-
</span>
|
|
1862
|
-
<span class="TreeLabelNameText">
|
|
1863
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-8678</span>
|
|
1864
|
-
<span class="TreeLabelNameTextSubline">
|
|
1865
|
-
<span>Debug: dual_fuel_diesel_cng</span>
|
|
1866
|
-
</span>
|
|
1867
|
-
</span>
|
|
1868
|
-
</span>
|
|
1869
|
-
</div>
|
|
1870
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9719">
|
|
1871
|
-
<label class="checkbox TreeCheckbox" tabindex="0">
|
|
1872
|
-
<input type="checkbox" class="TreeCheckbox">
|
|
1873
|
-
<span class="checkbox-text">
|
|
1874
|
-
</span>
|
|
1875
|
-
</label>
|
|
1876
|
-
<span class="TreeLabel TreeLabelName">
|
|
1877
|
-
<span class="rioglyph-icon-pair">
|
|
1878
|
-
<span class="rioglyph rioglyph-bus">
|
|
1879
|
-
</span>
|
|
1880
|
-
<span class="rioglyph rioglyph-fuel-hydrogen">
|
|
1881
|
-
</span>
|
|
1882
|
-
</span>
|
|
1883
|
-
<span class="TreeLabelNameText">
|
|
1884
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-8791</span>
|
|
1885
|
-
<span class="TreeLabelNameTextSubline">
|
|
1886
|
-
<span>Debug: hydrogen</span>
|
|
1887
|
-
</span>
|
|
1888
|
-
</span>
|
|
1889
|
-
</span>
|
|
1890
|
-
</div>
|
|
1891
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d972">
|
|
1892
|
-
<label class="checkbox TreeCheckbox" tabindex="0">
|
|
1893
|
-
<input type="checkbox" class="TreeCheckbox">
|
|
1894
|
-
<span class="checkbox-text">
|
|
1895
|
-
</span>
|
|
1896
|
-
</label>
|
|
1897
|
-
<span class="TreeLabel TreeLabelName">
|
|
1898
|
-
<span class="rioglyph-icon-pair">
|
|
1899
|
-
<span class="rioglyph rioglyph-van">
|
|
1900
|
-
</span>
|
|
1901
1829
|
<span class="rioglyph rioglyph-fuel-gas">
|
|
1902
1830
|
</span>
|
|
1903
1831
|
</span>
|
|
1904
1832
|
<span class="TreeLabelNameText">
|
|
1905
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-
|
|
1833
|
+
<span class="TreeLabelNameTextHeadline">Vehicle-6521</span>
|
|
1906
1834
|
<span class="TreeLabelNameTextSubline">
|
|
1907
|
-
<span>Debug:
|
|
1835
|
+
<span>Debug: cng</span>
|
|
1908
1836
|
</span>
|
|
1909
1837
|
</span>
|
|
1910
1838
|
</span>
|
|
1911
1839
|
</div>
|
|
1912
|
-
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-
|
|
1840
|
+
<div class="TreeLeaf form-group margin-bottom-0" data-key="010191ac-d06d-4567-b13a-7b7fd85d9719">
|
|
1913
1841
|
<label class="checkbox TreeCheckbox" tabindex="0">
|
|
1914
1842
|
<input type="checkbox" class="TreeCheckbox">
|
|
1915
1843
|
<span class="checkbox-text">
|
|
@@ -1919,13 +1847,13 @@ export default AssetTreeExample;
|
|
|
1919
1847
|
<span class="rioglyph-icon-pair">
|
|
1920
1848
|
<span class="rioglyph rioglyph-truck">
|
|
1921
1849
|
</span>
|
|
1922
|
-
<span class="rioglyph rioglyph-fuel-
|
|
1850
|
+
<span class="rioglyph rioglyph-fuel-liquid">
|
|
1923
1851
|
</span>
|
|
1924
1852
|
</span>
|
|
1925
1853
|
<span class="TreeLabelNameText">
|
|
1926
|
-
<span class="TreeLabelNameTextHeadline">Vehicle-
|
|
1854
|
+
<span class="TreeLabelNameTextHeadline">Vehicle-7377</span>
|
|
1927
1855
|
<span class="TreeLabelNameTextSubline">
|
|
1928
|
-
<span>Debug:
|
|
1856
|
+
<span>Debug: gas</span>
|
|
1929
1857
|
</span>
|
|
1930
1858
|
</span>
|
|
1931
1859
|
</span>
|
|
@@ -1942,7 +1870,7 @@ export default AssetTreeExample;
|
|
|
1942
1870
|
<span class="TreeLabelNameText">
|
|
1943
1871
|
<span class="TreeLabelNameTextHeadline">Ungrouped</span>
|
|
1944
1872
|
</span>
|
|
1945
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
1873
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">12</span>
|
|
1946
1874
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
1947
1875
|
</span>
|
|
1948
1876
|
</span>
|
|
@@ -1989,19 +1917,18 @@ export default AssetTreeExample;
|
|
|
1989
1917
|
| --- | --- | --- | --- |
|
|
1990
1918
|
| fly | boolean | false | Defines if the component will overlap the body content. |
|
|
1991
1919
|
| resizable | boolean | true | Defines whether or not the sidebar is resizable. |
|
|
1992
|
-
| onResizeEnd | Function | () => {} | Callback for when the resize is done. |
|
|
1993
1920
|
| bordered | boolean | false | Defines whether the component has a border or not. |
|
|
1994
|
-
| width |
|
|
1921
|
+
| width | 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
1922
|
| minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
|
|
1996
1923
|
| maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
|
|
1997
1924
|
| height | number | — | Defines the height of the component in px. |
|
|
1998
1925
|
| isOpen | boolean | true | Defines whether the component is open or not. |
|
|
1999
|
-
| onToggleTree |
|
|
1926
|
+
| onToggleTree | (isOpen: boolean) => void | () => {} | Callback for when the tree visibility is toggled. |
|
|
2000
1927
|
| currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
|
|
2001
|
-
| onCategoryChange |
|
|
1928
|
+
| onCategoryChange | (selectedCategoryId: string) => void | () => {} | Callback for handling change of category. |
|
|
1929
|
+
| onResizeEnd | VoidFunction | () => {} | Callback for when the resize is done. |
|
|
2002
1930
|
| useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
|
|
2003
|
-
| className |
|
|
2004
|
-
| children | TreeCategory | — | A list of TreeCategory components |
|
|
1931
|
+
| className | string | — | Additional classes added on the wrapper element. |
|
|
2005
1932
|
|
|
2006
1933
|
#### Props: TreeCategory
|
|
2007
1934
|
|
|
@@ -2009,9 +1936,9 @@ export default AssetTreeExample;
|
|
|
2009
1936
|
|
|
2010
1937
|
| Name | Type | Default | Description |
|
|
2011
1938
|
| --- | --- | --- | --- |
|
|
2012
|
-
| id |
|
|
2013
|
-
| icon |
|
|
2014
|
-
| label |
|
|
1939
|
+
| id | string | — | A unique identifier for that category. |
|
|
1940
|
+
| icon | string | — | The rioglyph icon name for that category. |
|
|
1941
|
+
| label | string \| React.ReactNode | — | The optional label for the category which will be shown in a tooltip. |
|
|
2015
1942
|
| hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
|
|
2016
1943
|
|
|
2017
1944
|
#### Props: Tree
|
|
@@ -2020,45 +1947,48 @@ export default AssetTreeExample;
|
|
|
2020
1947
|
|
|
2021
1948
|
| Name | Type | Default | Description |
|
|
2022
1949
|
| --- | --- | --- | --- |
|
|
2023
|
-
| groups |
|
|
2024
|
-
| └id |
|
|
2025
|
-
| └name |
|
|
2026
|
-
| └position |
|
|
2027
|
-
| └disabled |
|
|
2028
|
-
| └
|
|
2029
|
-
|
|
|
2030
|
-
| └
|
|
2031
|
-
|
|
|
2032
|
-
| └
|
|
2033
|
-
| └
|
|
2034
|
-
| └
|
|
2035
|
-
| └
|
|
2036
|
-
| └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g.
|
|
2037
|
-
| └
|
|
1950
|
+
| groups | TreeGroup[] | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
|
|
1951
|
+
| └id | string | — | A unique identifier of a group. |
|
|
1952
|
+
| └name | string \| React.ReactNode | — | The name of a group. |
|
|
1953
|
+
| └position | 'last' | — | Can be set to "last" to enforce the last position in the tree. |
|
|
1954
|
+
| └disabled | boolean | — | Disallows the selection of the group itself. |
|
|
1955
|
+
| └icon | string | — | The rioglyph icon name for a group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
1956
|
+
| └expandedIcon | string | — | The rioglyph icon name for a expanded group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
1957
|
+
| └className | string | — | Additional classes added to the group element. |
|
|
1958
|
+
| items | TreeItem[] | [] | The list of items. |
|
|
1959
|
+
| └id | string | — | A unique identifier of an item. |
|
|
1960
|
+
| └name | string \| TreeItemName | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory. |
|
|
1961
|
+
| └info | string \| React.ReactNode | — | The subline of an item. This can e used to show additional information for that item. |
|
|
1962
|
+
| └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). |
|
|
1963
|
+
| └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. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
1964
|
+
| └subType | string | — | Optional sub-type of the item. This refers to the name of an additional rioglyph icon (excluding the rioglyph- prefix), typically used to render a secondary icon next to the primary one (Note: for fuel types better use the pairIcon prop). |
|
|
1965
|
+
| └pairIcon | string \| null \| undefined | — | Optional pair icon override for the subType. If set to a string (e.g. 'fuel-gas'), this icon will be used explicitly. If set to undefined, the subType property will be used as the fallback icon. If set to null, no icon will be rendered, even if subType is defined. This allows full control over the icon behavior while maintaining backward compatibility with subType-based icons. |
|
|
1966
|
+
| └groupIds | string[] | [] | List of group ids the items is associated with. |
|
|
2038
1967
|
| └className | string | — | Additional classes added to the item element. |
|
|
2039
|
-
| selectedGroups |
|
|
2040
|
-
| selectedItems |
|
|
2041
|
-
| onSelectionChange |
|
|
1968
|
+
| selectedGroups | string[] | [] | List of selected group ids. |
|
|
1969
|
+
| selectedItems | string[] | [] | List of selected item ids. |
|
|
1970
|
+
| onSelectionChange | ({ items, groups }: SelectionChangeResponse) => void | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
|
|
2042
1971
|
| hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
|
|
2043
1972
|
| showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
|
|
2044
1973
|
| hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
|
|
2045
1974
|
| searchPlaceholder | string | — | The text used as placeholder for the search input. |
|
|
2046
|
-
| onSearchChange |
|
|
2047
|
-
| search |
|
|
2048
|
-
|
|
|
2049
|
-
| summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
1975
|
+
| onSearchChange | (value: string) => void | — | Callback for when the search value changes. |
|
|
1976
|
+
| search | React.ReactNode | — | Used to define custom search component which replaces the built-in search. |
|
|
1977
|
+
| summary | React.ReactNode | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
2050
1978
|
| hideSummary | boolean | false | Defines whether a summary is shown. |
|
|
1979
|
+
| onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
|
|
2051
1980
|
| 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 |
|
|
2053
|
-
| scrollHeight |
|
|
2054
|
-
| expandedGroups |
|
|
2055
|
-
| onExpandGroupsChange |
|
|
1981
|
+
| treeHeaderContent | React.ReactElement | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
|
|
1982
|
+
| scrollHeight | number | — | Defines the max-height of the scrollable list. |
|
|
1983
|
+
| expandedGroups | string[] | — | List of group ids which are expanded. |
|
|
1984
|
+
| onExpandGroupsChange | (newExpandedGroups: string[]) => void | — | Callback function triggered when a group expands or collapses. |
|
|
2056
1985
|
| 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. |
|
|
1986
|
+
| treeOptions | React.ReactNode[] | — | Component to offer customization options for the tree. |
|
|
1987
|
+
| treeOptionsTooltip | React.ReactNode | — | Tooltip content for the tree options dropdown. |
|
|
1988
|
+
| disableAnimation | boolean | false | Disables animation when filtering or using search |
|
|
2059
1989
|
| virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
|
|
2060
1990
|
| overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
|
|
2061
|
-
| className |
|
|
1991
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2062
1992
|
|
|
2063
1993
|
#### Props: TreeSearch
|
|
2064
1994
|
|
|
@@ -2066,10 +1996,10 @@ export default AssetTreeExample;
|
|
|
2066
1996
|
|
|
2067
1997
|
| Name | Type | Default | Description |
|
|
2068
1998
|
| --- | --- | --- | --- |
|
|
2069
|
-
| value |
|
|
2070
|
-
| onChange |
|
|
2071
|
-
| placeholder |
|
|
2072
|
-
| className |
|
|
1999
|
+
| value | string | — | The search value to be shown and used for the search. |
|
|
2000
|
+
| onChange | (newValue: string, event: React.ChangeEvent \| React.MouseEvent) => void | () => {} | Callback for when the search value changes. |
|
|
2001
|
+
| placeholder | string | — | The placeholder text used for the input field. |
|
|
2002
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2073
2003
|
|
|
2074
2004
|
#### Props: TreeSummary
|
|
2075
2005
|
|
|
@@ -2077,13 +2007,14 @@ export default AssetTreeExample;
|
|
|
2077
2007
|
|
|
2078
2008
|
| Name | Type | Default | Description |
|
|
2079
2009
|
| --- | --- | --- | --- |
|
|
2080
|
-
| assetCounts |
|
|
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
|
-
| └
|
|
2086
|
-
|
|
|
2010
|
+
| assetCounts | TreeSummaryCounts | — | The object containing various asset type counter. |
|
|
2011
|
+
| └truck | number | — | The amount of trucks |
|
|
2012
|
+
| └trailer | number | — | The amount of trailers |
|
|
2013
|
+
| └bus | number | — | The amount of buses |
|
|
2014
|
+
| └van | number | — | The amount of vans |
|
|
2015
|
+
| └car | number | — | The amount of cars |
|
|
2016
|
+
| └driver | number | — | The amount of drivers |
|
|
2017
|
+
| gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow. |
|
|
2087
2018
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
2088
2019
|
|
|
2089
2020
|
#### Props: TreeSummaryRow
|
|
@@ -2102,12 +2033,12 @@ export default AssetTreeExample;
|
|
|
2102
2033
|
| --- | --- | --- | --- |
|
|
2103
2034
|
| type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
|
|
2104
2035
|
| 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 |
|
|
2106
|
-
| hasFilter | boolean |
|
|
2107
|
-
| enableActivity | boolean |
|
|
2036
|
+
| isActive | boolean | — | Sets the active styling if active |
|
|
2037
|
+
| hasFilter | boolean | false | Should be set when there is a type filter set in the tree to style the counter accordingly. |
|
|
2038
|
+
| enableActivity | boolean | false | Allows for interactivity. Use this prop when you allow clicking on the counter. |
|
|
2108
2039
|
| hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
|
|
2109
|
-
| onClick |
|
|
2110
|
-
| value |
|
|
2040
|
+
| onClick | (type: string) => void | — | 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. |
|
|
2041
|
+
| value | string \| React.ReactNode \| number | — | A custom value to be shown in the counter. |
|
|
2111
2042
|
|
|
2112
2043
|
#### Props: TreeOption
|
|
2113
2044
|
|
|
@@ -2115,9 +2046,9 @@ export default AssetTreeExample;
|
|
|
2115
2046
|
|
|
2116
2047
|
| Name | Type | Default | Description |
|
|
2117
2048
|
| --- | --- | --- | --- |
|
|
2118
|
-
| isChecked | boolean |
|
|
2119
|
-
|
|
|
2120
|
-
|
|
|
2049
|
+
| isChecked | boolean | false | Defines whether the option is set. |
|
|
2050
|
+
| onChange | (event: React.MouseEvent<HTMLDivElement>) => void | — | Callback triggered when option is selected. |
|
|
2051
|
+
| label | string \| React.ReactNode | — | The label for the option. |
|
|
2121
2052
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
2122
2053
|
|
|
2123
2054
|
## AssetTree with custom summary
|
|
@@ -2393,19 +2324,18 @@ export default AssetTreeWithCustomSummaryExample;
|
|
|
2393
2324
|
| --- | --- | --- | --- |
|
|
2394
2325
|
| fly | boolean | false | Defines if the component will overlap the body content. |
|
|
2395
2326
|
| resizable | boolean | true | Defines whether or not the sidebar is resizable. |
|
|
2396
|
-
| onResizeEnd | Function | () => {} | Callback for when the resize is done. |
|
|
2397
2327
|
| bordered | boolean | false | Defines whether the component has a border or not. |
|
|
2398
|
-
| width |
|
|
2328
|
+
| width | 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
2329
|
| minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
|
|
2400
2330
|
| maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
|
|
2401
2331
|
| height | number | — | Defines the height of the component in px. |
|
|
2402
2332
|
| isOpen | boolean | true | Defines whether the component is open or not. |
|
|
2403
|
-
| onToggleTree |
|
|
2333
|
+
| onToggleTree | (isOpen: boolean) => void | () => {} | Callback for when the tree visibility is toggled. |
|
|
2404
2334
|
| currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
|
|
2405
|
-
| onCategoryChange |
|
|
2335
|
+
| onCategoryChange | (selectedCategoryId: string) => void | () => {} | Callback for handling change of category. |
|
|
2336
|
+
| onResizeEnd | VoidFunction | () => {} | Callback for when the resize is done. |
|
|
2406
2337
|
| useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
|
|
2407
|
-
| className |
|
|
2408
|
-
| children | TreeCategory | — | A list of TreeCategory components |
|
|
2338
|
+
| className | string | — | Additional classes added on the wrapper element. |
|
|
2409
2339
|
|
|
2410
2340
|
#### Props: TreeCategory
|
|
2411
2341
|
|
|
@@ -2413,9 +2343,9 @@ export default AssetTreeWithCustomSummaryExample;
|
|
|
2413
2343
|
|
|
2414
2344
|
| Name | Type | Default | Description |
|
|
2415
2345
|
| --- | --- | --- | --- |
|
|
2416
|
-
| id |
|
|
2417
|
-
| icon |
|
|
2418
|
-
| label |
|
|
2346
|
+
| id | string | — | A unique identifier for that category. |
|
|
2347
|
+
| icon | string | — | The rioglyph icon name for that category. |
|
|
2348
|
+
| label | string \| React.ReactNode | — | The optional label for the category which will be shown in a tooltip. |
|
|
2419
2349
|
| hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
|
|
2420
2350
|
|
|
2421
2351
|
#### Props: Tree
|
|
@@ -2424,45 +2354,375 @@ export default AssetTreeWithCustomSummaryExample;
|
|
|
2424
2354
|
|
|
2425
2355
|
| Name | Type | Default | Description |
|
|
2426
2356
|
| --- | --- | --- | --- |
|
|
2427
|
-
| groups |
|
|
2428
|
-
| └id |
|
|
2429
|
-
| └name |
|
|
2430
|
-
| └position |
|
|
2431
|
-
| └disabled |
|
|
2432
|
-
| └
|
|
2433
|
-
|
|
|
2434
|
-
| └
|
|
2435
|
-
|
|
|
2436
|
-
| └
|
|
2437
|
-
| └
|
|
2438
|
-
| └
|
|
2439
|
-
| └
|
|
2440
|
-
| └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g.
|
|
2441
|
-
| └
|
|
2357
|
+
| groups | TreeGroup[] | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
|
|
2358
|
+
| └id | string | — | A unique identifier of a group. |
|
|
2359
|
+
| └name | string \| React.ReactNode | — | The name of a group. |
|
|
2360
|
+
| └position | 'last' | — | Can be set to "last" to enforce the last position in the tree. |
|
|
2361
|
+
| └disabled | boolean | — | Disallows the selection of the group itself. |
|
|
2362
|
+
| └icon | string | — | The rioglyph icon name for a group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
2363
|
+
| └expandedIcon | string | — | The rioglyph icon name for a expanded group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
2364
|
+
| └className | string | — | Additional classes added to the group element. |
|
|
2365
|
+
| items | TreeItem[] | [] | The list of items. |
|
|
2366
|
+
| └id | string | — | A unique identifier of an item. |
|
|
2367
|
+
| └name | string \| TreeItemName | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory. |
|
|
2368
|
+
| └info | string \| React.ReactNode | — | The subline of an item. This can e used to show additional information for that item. |
|
|
2369
|
+
| └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). |
|
|
2370
|
+
| └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. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
2371
|
+
| └subType | string | — | Optional sub-type of the item. This refers to the name of an additional rioglyph icon (excluding the rioglyph- prefix), typically used to render a secondary icon next to the primary one (Note: for fuel types better use the pairIcon prop). |
|
|
2372
|
+
| └pairIcon | string \| null \| undefined | — | Optional pair icon override for the subType. If set to a string (e.g. 'fuel-gas'), this icon will be used explicitly. If set to undefined, the subType property will be used as the fallback icon. If set to null, no icon will be rendered, even if subType is defined. This allows full control over the icon behavior while maintaining backward compatibility with subType-based icons. |
|
|
2373
|
+
| └groupIds | string[] | [] | List of group ids the items is associated with. |
|
|
2442
2374
|
| └className | string | — | Additional classes added to the item element. |
|
|
2443
|
-
| selectedGroups |
|
|
2444
|
-
| selectedItems |
|
|
2445
|
-
| onSelectionChange |
|
|
2375
|
+
| selectedGroups | string[] | [] | List of selected group ids. |
|
|
2376
|
+
| selectedItems | string[] | [] | List of selected item ids. |
|
|
2377
|
+
| onSelectionChange | ({ items, groups }: SelectionChangeResponse) => void | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
|
|
2446
2378
|
| hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
|
|
2447
2379
|
| showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
|
|
2448
2380
|
| hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
|
|
2449
2381
|
| searchPlaceholder | string | — | The text used as placeholder for the search input. |
|
|
2450
|
-
| onSearchChange |
|
|
2451
|
-
| search |
|
|
2382
|
+
| onSearchChange | (value: string) => void | — | Callback for when the search value changes. |
|
|
2383
|
+
| search | React.ReactNode | — | Used to define custom search component which replaces the built-in search. |
|
|
2384
|
+
| summary | React.ReactNode | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
2385
|
+
| hideSummary | boolean | false | Defines whether a summary is shown. |
|
|
2452
2386
|
| 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
|
-
|
|
|
2387
|
+
| 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. |
|
|
2388
|
+
| treeHeaderContent | React.ReactElement | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
|
|
2389
|
+
| scrollHeight | number | — | Defines the max-height of the scrollable list. |
|
|
2390
|
+
| expandedGroups | string[] | — | List of group ids which are expanded. |
|
|
2391
|
+
| onExpandGroupsChange | (newExpandedGroups: string[]) => void | — | Callback function triggered when a group expands or collapses. |
|
|
2392
|
+
| showEmptyGroups | boolean | true | Defines whether empty groups are shown or not. |
|
|
2393
|
+
| treeOptions | React.ReactNode[] | — | Component to offer customization options for the tree. |
|
|
2394
|
+
| treeOptionsTooltip | React.ReactNode | — | Tooltip content for the tree options dropdown. |
|
|
2395
|
+
| disableAnimation | boolean | false | Disables animation when filtering or using search |
|
|
2396
|
+
| virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
|
|
2397
|
+
| overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
|
|
2398
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2399
|
+
|
|
2400
|
+
#### Props: TreeSearch
|
|
2401
|
+
|
|
2402
|
+
### TreeSearch
|
|
2403
|
+
|
|
2404
|
+
| Name | Type | Default | Description |
|
|
2405
|
+
| --- | --- | --- | --- |
|
|
2406
|
+
| value | string | — | The search value to be shown and used for the search. |
|
|
2407
|
+
| onChange | (newValue: string, event: React.ChangeEvent \| React.MouseEvent) => void | () => {} | Callback for when the search value changes. |
|
|
2408
|
+
| placeholder | string | — | The placeholder text used for the input field. |
|
|
2409
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2410
|
+
|
|
2411
|
+
#### Props: TreeSummary
|
|
2412
|
+
|
|
2413
|
+
### TreeSummary
|
|
2414
|
+
|
|
2415
|
+
| Name | Type | Default | Description |
|
|
2416
|
+
| --- | --- | --- | --- |
|
|
2417
|
+
| assetCounts | TreeSummaryCounts | — | The object containing various asset type counter. |
|
|
2418
|
+
| └truck | number | — | The amount of trucks |
|
|
2419
|
+
| └trailer | number | — | The amount of trailers |
|
|
2420
|
+
| └bus | number | — | The amount of buses |
|
|
2421
|
+
| └van | number | — | The amount of vans |
|
|
2422
|
+
| └car | number | — | The amount of cars |
|
|
2423
|
+
| └driver | number | — | The amount of drivers |
|
|
2424
|
+
| gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow. |
|
|
2425
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2426
|
+
|
|
2427
|
+
#### Props: TreeSummaryRow
|
|
2428
|
+
|
|
2429
|
+
### TreeSummaryRow
|
|
2430
|
+
|
|
2431
|
+
| Name | Type | Default | Description |
|
|
2432
|
+
| --- | --- | --- | --- |
|
|
2433
|
+
| 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. |
|
|
2434
|
+
|
|
2435
|
+
#### Props: TypeCounter
|
|
2436
|
+
|
|
2437
|
+
### TypeCounter
|
|
2438
|
+
|
|
2439
|
+
| Name | Type | Default | Description |
|
|
2440
|
+
| --- | --- | --- | --- |
|
|
2441
|
+
| type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
|
|
2442
|
+
| 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. |
|
|
2443
|
+
| isActive | boolean | — | Sets the active styling if active |
|
|
2444
|
+
| hasFilter | boolean | false | Should be set when there is a type filter set in the tree to style the counter accordingly. |
|
|
2445
|
+
| enableActivity | boolean | false | Allows for interactivity. Use this prop when you allow clicking on the counter. |
|
|
2446
|
+
| hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
|
|
2447
|
+
| onClick | (type: string) => void | — | 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. |
|
|
2448
|
+
| value | string \| React.ReactNode \| number | — | A custom value to be shown in the counter. |
|
|
2449
|
+
|
|
2450
|
+
#### Props: TreeOption
|
|
2451
|
+
|
|
2452
|
+
### TreeOption
|
|
2453
|
+
|
|
2454
|
+
| Name | Type | Default | Description |
|
|
2455
|
+
| --- | --- | --- | --- |
|
|
2456
|
+
| isChecked | boolean | false | Defines whether the option is set. |
|
|
2457
|
+
| onChange | (event: React.MouseEvent<HTMLDivElement>) => void | — | Callback triggered when option is selected. |
|
|
2458
|
+
| label | string \| React.ReactNode | — | The label for the option. |
|
|
2459
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2460
|
+
|
|
2461
|
+
## Tree with custom icons
|
|
2462
|
+
|
|
2463
|
+
### Example: Tree with header and search
|
|
2464
|
+
|
|
2465
|
+
Tree with header and search
|
|
2466
|
+
|
|
2467
|
+
20
|
|
2468
|
+
|
|
2469
|
+
Group 014
|
|
2470
|
+
|
|
2471
|
+
Group 026
|
|
2472
|
+
|
|
2473
|
+
Group 0310
|
|
2474
|
+
|
|
2475
|
+
#### Summary
|
|
2476
|
+
|
|
2477
|
+
Tree with header and search
|
|
2478
|
+
|
|
2479
|
+
20
|
|
2480
|
+
|
|
2481
|
+
Group 014
|
|
2482
|
+
|
|
2483
|
+
Group 026
|
|
2484
|
+
|
|
2485
|
+
Group 0310
|
|
2486
|
+
|
|
2487
|
+
#### React (tsx)
|
|
2488
|
+
|
|
2489
|
+
```tsx
|
|
2490
|
+
import { useState } from 'react';
|
|
2491
|
+
import { random } from 'es-toolkit/compat';
|
|
2492
|
+
import { faker } from '@faker-js/faker';
|
|
2493
|
+
|
|
2494
|
+
import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
|
|
2495
|
+
import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
|
|
2496
|
+
|
|
2497
|
+
const groups: TreeGroup[] = [
|
|
2498
|
+
{
|
|
2499
|
+
id: '1',
|
|
2500
|
+
name: 'Group 01',
|
|
2501
|
+
icon: 'https://cdn.rio.cloud/images/uikit/react_logo.svg',
|
|
2502
|
+
},
|
|
2503
|
+
{
|
|
2504
|
+
id: '2',
|
|
2505
|
+
name: 'Group 02',
|
|
2506
|
+
icon: 'https://cdn.rio.cloud/images/uikit/react_logo.svg',
|
|
2507
|
+
},
|
|
2508
|
+
{
|
|
2509
|
+
id: '3',
|
|
2510
|
+
name: 'Group 03',
|
|
2511
|
+
icon: 'https://cdn.rio.cloud/svg/common/ico_rio_colored.svg',
|
|
2512
|
+
},
|
|
2513
|
+
];
|
|
2514
|
+
|
|
2515
|
+
const treeItems: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
|
|
2516
|
+
id: `${index}`,
|
|
2517
|
+
name: `${faker.lorem.words()} ${random(100, 999)}`,
|
|
2518
|
+
type: 'files',
|
|
2519
|
+
icon: 'https://cdn.rio.cloud/svg/common/ico_rio_colored.svg',
|
|
2520
|
+
groupIds: [faker.helpers.arrayElement(groups).id],
|
|
2521
|
+
}));
|
|
2522
|
+
|
|
2523
|
+
export default () => {
|
|
2524
|
+
const [selectedItemIds, setSelectedItemIds] = useState<string[]>([]);
|
|
2525
|
+
const [expandedGroups, setExpandedGroups] = useState<string[]>([]);
|
|
2526
|
+
|
|
2527
|
+
const handleSelection = ({ items }: SelectionChangeResponse) => {
|
|
2528
|
+
setSelectedItemIds(items);
|
|
2529
|
+
};
|
|
2530
|
+
|
|
2531
|
+
const handleExpandGroups = (newExpandedGroups: string[]) => setExpandedGroups(newExpandedGroups);
|
|
2532
|
+
|
|
2533
|
+
return (
|
|
2534
|
+
<div className='display-flex flex-wrap gap-25 overflow-auto'>
|
|
2535
|
+
<LabeledElement label='Tree with header and search'>
|
|
2536
|
+
<div className='width-500 border border-color-lighter border-bottom-none'>
|
|
2537
|
+
<Tree
|
|
2538
|
+
groups={groups}
|
|
2539
|
+
items={treeItems}
|
|
2540
|
+
expandedGroups={expandedGroups}
|
|
2541
|
+
onExpandGroupsChange={handleExpandGroups}
|
|
2542
|
+
selectedItems={selectedItemIds}
|
|
2543
|
+
onSelectionChange={handleSelection}
|
|
2544
|
+
searchPlaceholder='Find items'
|
|
2545
|
+
scrollHeight={300}
|
|
2546
|
+
hasMultiselect={false}
|
|
2547
|
+
/>
|
|
2548
|
+
</div>
|
|
2549
|
+
</LabeledElement>
|
|
2550
|
+
</div>
|
|
2551
|
+
);
|
|
2552
|
+
};
|
|
2553
|
+
```
|
|
2554
|
+
|
|
2555
|
+
#### HTML (html)
|
|
2556
|
+
|
|
2557
|
+
```html
|
|
2558
|
+
<div class="display-flex flex-wrap gap-25 overflow-auto">
|
|
2559
|
+
<div class="LabeledElement display-flex flex-column">
|
|
2560
|
+
<div class="text-color-dark max-width-100pct text-size-12 display-inline-block margin-bottom-5">Tree with header and search</div>
|
|
2561
|
+
<div class="width-500 border border-color-lighter border-bottom-none">
|
|
2562
|
+
<div class="Tree">
|
|
2563
|
+
<div class="TreeHeader">
|
|
2564
|
+
<div class="TreeSearch">
|
|
2565
|
+
<div class="input-group flex-1-0">
|
|
2566
|
+
<span class="input-group-addon">
|
|
2567
|
+
<span class="rioglyph rioglyph-search" aria-hidden="true">
|
|
2568
|
+
</span>
|
|
2569
|
+
</span>
|
|
2570
|
+
<div class="ClearableInput input-group">
|
|
2571
|
+
<input placeholder="Find items" class="form-control" type="text" tabindex="0" value="">
|
|
2572
|
+
<span class="clearButton hide">
|
|
2573
|
+
<span class="clearButtonIcon rioglyph rioglyph-remove-sign">
|
|
2574
|
+
</span>
|
|
2575
|
+
</span>
|
|
2576
|
+
</div>
|
|
2577
|
+
</div>
|
|
2578
|
+
</div>
|
|
2579
|
+
<div class="TreeHead display-flex gap-5 padding-15">
|
|
2580
|
+
<div class="border border-right-only hidden-empty padding-right-10 margin-right-2">
|
|
2581
|
+
</div>
|
|
2582
|
+
<div class="display-flex justify-content-between align-items-start width-100pct">
|
|
2583
|
+
<div class="TreeSummary display-flex flex-wrap align-items-center gap-10 padding-left-3">
|
|
2584
|
+
<div class="TypeCounter display-flex align-items-center user-select-none margin-right-2 pointer-events-none">
|
|
2585
|
+
<span class="rioglyph rioglyph-files text-size-16 margin-right-2">
|
|
2586
|
+
</span>
|
|
2587
|
+
<span class="TreeLabelCount label label-condensed label-muted label-filled">20</span>
|
|
2588
|
+
</div>
|
|
2589
|
+
</div>
|
|
2590
|
+
</div>
|
|
2591
|
+
</div>
|
|
2592
|
+
</div>
|
|
2593
|
+
<div class="TreeRoot user-select-none overflow-auto" style="max-height: 300px; position: relative;">
|
|
2594
|
+
<div class="TreeNodeContainer user-select-none overflow-hidden" data-id="1">
|
|
2595
|
+
<div class="TreeNode from-group" data-key="1">
|
|
2596
|
+
<span class="TreeLabel TreeLabelName">
|
|
2597
|
+
<div class="display-grid place-items-center margin-right-5" style="width: 18px; height: 18px;">
|
|
2598
|
+
<img src="https://cdn.rio.cloud/images/uikit/react_logo.svg" style="max-width: 100%; max-height: 100%;">
|
|
2599
|
+
</div>
|
|
2600
|
+
<span class="TreeLabelNameText">
|
|
2601
|
+
<span class="TreeLabelNameTextHeadline">Group 01</span>
|
|
2602
|
+
</span>
|
|
2603
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
|
|
2604
|
+
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2605
|
+
</span>
|
|
2606
|
+
</span>
|
|
2607
|
+
</div>
|
|
2608
|
+
</div>
|
|
2609
|
+
<div class="TreeNodeContainer user-select-none overflow-hidden" data-id="2">
|
|
2610
|
+
<div class="TreeNode from-group" data-key="2">
|
|
2611
|
+
<span class="TreeLabel TreeLabelName">
|
|
2612
|
+
<div class="display-grid place-items-center margin-right-5" style="width: 18px; height: 18px;">
|
|
2613
|
+
<img src="https://cdn.rio.cloud/images/uikit/react_logo.svg" style="max-width: 100%; max-height: 100%;">
|
|
2614
|
+
</div>
|
|
2615
|
+
<span class="TreeLabelNameText">
|
|
2616
|
+
<span class="TreeLabelNameTextHeadline">Group 02</span>
|
|
2617
|
+
</span>
|
|
2618
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">6</span>
|
|
2619
|
+
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2620
|
+
</span>
|
|
2621
|
+
</span>
|
|
2622
|
+
</div>
|
|
2623
|
+
</div>
|
|
2624
|
+
<div class="TreeNodeContainer user-select-none overflow-hidden" data-id="3">
|
|
2625
|
+
<div class="TreeNode from-group" data-key="3">
|
|
2626
|
+
<span class="TreeLabel TreeLabelName">
|
|
2627
|
+
<div class="display-grid place-items-center margin-right-5" style="width: 18px; height: 18px;">
|
|
2628
|
+
<img src="https://cdn.rio.cloud/svg/common/ico_rio_colored.svg" style="max-width: 100%; max-height: 100%;">
|
|
2629
|
+
</div>
|
|
2630
|
+
<span class="TreeLabelNameText">
|
|
2631
|
+
<span class="TreeLabelNameTextHeadline">Group 03</span>
|
|
2632
|
+
</span>
|
|
2633
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">10</span>
|
|
2634
|
+
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2635
|
+
</span>
|
|
2636
|
+
</span>
|
|
2637
|
+
</div>
|
|
2638
|
+
</div>
|
|
2639
|
+
</div>
|
|
2640
|
+
</div>
|
|
2641
|
+
</div>
|
|
2642
|
+
</div>
|
|
2643
|
+
</div>
|
|
2644
|
+
```
|
|
2645
|
+
|
|
2646
|
+
#### Props: AssetTree
|
|
2647
|
+
|
|
2648
|
+
### AssetTree
|
|
2649
|
+
|
|
2650
|
+
| Name | Type | Default | Description |
|
|
2651
|
+
| --- | --- | --- | --- |
|
|
2652
|
+
| fly | boolean | false | Defines if the component will overlap the body content. |
|
|
2653
|
+
| resizable | boolean | true | Defines whether or not the sidebar is resizable. |
|
|
2654
|
+
| bordered | boolean | false | Defines whether the component has a border or not. |
|
|
2655
|
+
| width | 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. |
|
|
2656
|
+
| minWidth | number | 100 | Defines the minimum width of the component in px that will take effect when resizing. |
|
|
2657
|
+
| maxWidth | number | 0 | Defines the maximum width of the component in px that will take effect when resizing. |
|
|
2658
|
+
| height | number | — | Defines the height of the component in px. |
|
|
2659
|
+
| isOpen | boolean | true | Defines whether the component is open or not. |
|
|
2660
|
+
| onToggleTree | (isOpen: boolean) => void | () => {} | Callback for when the tree visibility is toggled. |
|
|
2661
|
+
| currentCategoryId | string | — | The id of the category which is currently active and shall be shown. |
|
|
2662
|
+
| onCategoryChange | (selectedCategoryId: string) => void | () => {} | Callback for handling change of category. |
|
|
2663
|
+
| onResizeEnd | VoidFunction | () => {} | Callback for when the resize is done. |
|
|
2664
|
+
| useOffscreen | boolean | false | Defines whether the tree components are rendered offscreen and kept mounted in the DOM. |
|
|
2665
|
+
| className | string | — | Additional classes added on the wrapper element. |
|
|
2666
|
+
|
|
2667
|
+
#### Props: TreeCategory
|
|
2668
|
+
|
|
2669
|
+
### TreeCategory
|
|
2670
|
+
|
|
2671
|
+
| Name | Type | Default | Description |
|
|
2672
|
+
| --- | --- | --- | --- |
|
|
2673
|
+
| id | string | — | A unique identifier for that category. |
|
|
2674
|
+
| icon | string | — | The rioglyph icon name for that category. |
|
|
2675
|
+
| label | string \| React.ReactNode | — | The optional label for the category which will be shown in a tooltip. |
|
|
2676
|
+
| hasSelection | boolean | — | Defines whether or not a selection indicator should be shown. |
|
|
2677
|
+
|
|
2678
|
+
#### Props: Tree
|
|
2679
|
+
|
|
2680
|
+
### Tree
|
|
2681
|
+
|
|
2682
|
+
| Name | Type | Default | Description |
|
|
2683
|
+
| --- | --- | --- | --- |
|
|
2684
|
+
| groups | TreeGroup[] | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
|
|
2685
|
+
| └id | string | — | A unique identifier of a group. |
|
|
2686
|
+
| └name | string \| React.ReactNode | — | The name of a group. |
|
|
2687
|
+
| └position | 'last' | — | Can be set to "last" to enforce the last position in the tree. |
|
|
2688
|
+
| └disabled | boolean | — | Disallows the selection of the group itself. |
|
|
2689
|
+
| └icon | string | — | The rioglyph icon name for a group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
2690
|
+
| └expandedIcon | string | — | The rioglyph icon name for a expanded group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
2691
|
+
| └className | string | — | Additional classes added to the group element. |
|
|
2692
|
+
| items | TreeItem[] | [] | The list of items. |
|
|
2693
|
+
| └id | string | — | A unique identifier of an item. |
|
|
2694
|
+
| └name | string \| TreeItemName | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory. |
|
|
2695
|
+
| └info | string \| React.ReactNode | — | The subline of an item. This can e used to show additional information for that item. |
|
|
2696
|
+
| └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). |
|
|
2697
|
+
| └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. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
2698
|
+
| └subType | string | — | Optional sub-type of the item. This refers to the name of an additional rioglyph icon (excluding the rioglyph- prefix), typically used to render a secondary icon next to the primary one (Note: for fuel types better use the pairIcon prop). |
|
|
2699
|
+
| └pairIcon | string \| null \| undefined | — | Optional pair icon override for the subType. If set to a string (e.g. 'fuel-gas'), this icon will be used explicitly. If set to undefined, the subType property will be used as the fallback icon. If set to null, no icon will be rendered, even if subType is defined. This allows full control over the icon behavior while maintaining backward compatibility with subType-based icons. |
|
|
2700
|
+
| └groupIds | string[] | [] | List of group ids the items is associated with. |
|
|
2701
|
+
| └className | string | — | Additional classes added to the item element. |
|
|
2702
|
+
| selectedGroups | string[] | [] | List of selected group ids. |
|
|
2703
|
+
| selectedItems | string[] | [] | List of selected item ids. |
|
|
2704
|
+
| onSelectionChange | ({ items, groups }: SelectionChangeResponse) => void | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
|
|
2705
|
+
| hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
|
|
2706
|
+
| showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
|
|
2707
|
+
| hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
|
|
2708
|
+
| searchPlaceholder | string | — | The text used as placeholder for the search input. |
|
|
2709
|
+
| onSearchChange | (value: string) => void | — | Callback for when the search value changes. |
|
|
2710
|
+
| search | React.ReactNode | — | Used to define custom search component which replaces the built-in search. |
|
|
2711
|
+
| summary | React.ReactNode | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
2454
2712
|
| hideSummary | boolean | false | Defines whether a summary is shown. |
|
|
2713
|
+
| onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
|
|
2455
2714
|
| 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 |
|
|
2457
|
-
| scrollHeight |
|
|
2458
|
-
| expandedGroups |
|
|
2459
|
-
| onExpandGroupsChange |
|
|
2715
|
+
| treeHeaderContent | React.ReactElement | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
|
|
2716
|
+
| scrollHeight | number | — | Defines the max-height of the scrollable list. |
|
|
2717
|
+
| expandedGroups | string[] | — | List of group ids which are expanded. |
|
|
2718
|
+
| onExpandGroupsChange | (newExpandedGroups: string[]) => void | — | Callback function triggered when a group expands or collapses. |
|
|
2460
2719
|
| 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. |
|
|
2720
|
+
| treeOptions | React.ReactNode[] | — | Component to offer customization options for the tree. |
|
|
2721
|
+
| treeOptionsTooltip | React.ReactNode | — | Tooltip content for the tree options dropdown. |
|
|
2722
|
+
| disableAnimation | boolean | false | Disables animation when filtering or using search |
|
|
2463
2723
|
| virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
|
|
2464
2724
|
| overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
|
|
2465
|
-
| className |
|
|
2725
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2466
2726
|
|
|
2467
2727
|
#### Props: TreeSearch
|
|
2468
2728
|
|
|
@@ -2470,10 +2730,10 @@ export default AssetTreeWithCustomSummaryExample;
|
|
|
2470
2730
|
|
|
2471
2731
|
| Name | Type | Default | Description |
|
|
2472
2732
|
| --- | --- | --- | --- |
|
|
2473
|
-
| value |
|
|
2474
|
-
| onChange |
|
|
2475
|
-
| placeholder |
|
|
2476
|
-
| className |
|
|
2733
|
+
| value | string | — | The search value to be shown and used for the search. |
|
|
2734
|
+
| onChange | (newValue: string, event: React.ChangeEvent \| React.MouseEvent) => void | () => {} | Callback for when the search value changes. |
|
|
2735
|
+
| placeholder | string | — | The placeholder text used for the input field. |
|
|
2736
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2477
2737
|
|
|
2478
2738
|
#### Props: TreeSummary
|
|
2479
2739
|
|
|
@@ -2481,13 +2741,14 @@ export default AssetTreeWithCustomSummaryExample;
|
|
|
2481
2741
|
|
|
2482
2742
|
| Name | Type | Default | Description |
|
|
2483
2743
|
| --- | --- | --- | --- |
|
|
2484
|
-
| assetCounts |
|
|
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
|
-
| └
|
|
2490
|
-
|
|
|
2744
|
+
| assetCounts | TreeSummaryCounts | — | The object containing various asset type counter. |
|
|
2745
|
+
| └truck | number | — | The amount of trucks |
|
|
2746
|
+
| └trailer | number | — | The amount of trailers |
|
|
2747
|
+
| └bus | number | — | The amount of buses |
|
|
2748
|
+
| └van | number | — | The amount of vans |
|
|
2749
|
+
| └car | number | — | The amount of cars |
|
|
2750
|
+
| └driver | number | — | The amount of drivers |
|
|
2751
|
+
| gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow. |
|
|
2491
2752
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
2492
2753
|
|
|
2493
2754
|
#### Props: TreeSummaryRow
|
|
@@ -2506,12 +2767,12 @@ export default AssetTreeWithCustomSummaryExample;
|
|
|
2506
2767
|
| --- | --- | --- | --- |
|
|
2507
2768
|
| type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
|
|
2508
2769
|
| 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 |
|
|
2510
|
-
| hasFilter | boolean |
|
|
2511
|
-
| enableActivity | boolean |
|
|
2770
|
+
| isActive | boolean | — | Sets the active styling if active |
|
|
2771
|
+
| hasFilter | boolean | false | Should be set when there is a type filter set in the tree to style the counter accordingly. |
|
|
2772
|
+
| enableActivity | boolean | false | Allows for interactivity. Use this prop when you allow clicking on the counter. |
|
|
2512
2773
|
| hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
|
|
2513
|
-
| onClick |
|
|
2514
|
-
| value |
|
|
2774
|
+
| onClick | (type: string) => void | — | 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. |
|
|
2775
|
+
| value | string \| React.ReactNode \| number | — | A custom value to be shown in the counter. |
|
|
2515
2776
|
|
|
2516
2777
|
#### Props: TreeOption
|
|
2517
2778
|
|
|
@@ -2519,9 +2780,9 @@ export default AssetTreeWithCustomSummaryExample;
|
|
|
2519
2780
|
|
|
2520
2781
|
| Name | Type | Default | Description |
|
|
2521
2782
|
| --- | --- | --- | --- |
|
|
2522
|
-
| isChecked | boolean |
|
|
2523
|
-
|
|
|
2524
|
-
|
|
|
2783
|
+
| isChecked | boolean | false | Defines whether the option is set. |
|
|
2784
|
+
| onChange | (event: React.MouseEvent<HTMLDivElement>) => void | — | Callback triggered when option is selected. |
|
|
2785
|
+
| label | string \| React.ReactNode | — | The label for the option. |
|
|
2525
2786
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
2526
2787
|
|
|
2527
2788
|
## Tree
|
|
@@ -2532,13 +2793,13 @@ Tree with header and search
|
|
|
2532
2793
|
|
|
2533
2794
|
20
|
|
2534
2795
|
|
|
2535
|
-
Folder
|
|
2796
|
+
Folder 017
|
|
2536
2797
|
|
|
2537
2798
|
Folder 024
|
|
2538
2799
|
|
|
2539
|
-
Folder
|
|
2800
|
+
Folder 035
|
|
2540
2801
|
|
|
2541
|
-
Folder
|
|
2802
|
+
Folder 044
|
|
2542
2803
|
|
|
2543
2804
|
Selected items:
|
|
2544
2805
|
|
|
@@ -2550,13 +2811,13 @@ Tree with header and search
|
|
|
2550
2811
|
|
|
2551
2812
|
20
|
|
2552
2813
|
|
|
2553
|
-
Folder
|
|
2814
|
+
Folder 017
|
|
2554
2815
|
|
|
2555
2816
|
Folder 024
|
|
2556
2817
|
|
|
2557
|
-
Folder
|
|
2818
|
+
Folder 035
|
|
2558
2819
|
|
|
2559
|
-
Folder
|
|
2820
|
+
Folder 044
|
|
2560
2821
|
|
|
2561
2822
|
Selected items:
|
|
2562
2823
|
|
|
@@ -2567,7 +2828,7 @@ Expanded folders:
|
|
|
2567
2828
|
```tsx
|
|
2568
2829
|
import { useState } from 'react';
|
|
2569
2830
|
import { random } from 'es-toolkit/compat';
|
|
2570
|
-
import faker from 'faker';
|
|
2831
|
+
import { faker } from '@faker-js/faker';
|
|
2571
2832
|
|
|
2572
2833
|
import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
|
|
2573
2834
|
import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
|
|
@@ -2597,11 +2858,11 @@ const folders: TreeGroup[] = [
|
|
|
2597
2858
|
|
|
2598
2859
|
const treeItems: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
|
|
2599
2860
|
id: `${index}`,
|
|
2600
|
-
name: `${faker.
|
|
2861
|
+
name: `${faker.lorem.words()} ${random(100, 999)}`,
|
|
2601
2862
|
type: 'files',
|
|
2602
2863
|
icon: 'files',
|
|
2603
2864
|
// icon: null, // Set to "null" to omit the icon
|
|
2604
|
-
groupIds: [faker.
|
|
2865
|
+
groupIds: [faker.helpers.arrayElement(folders).id],
|
|
2605
2866
|
}));
|
|
2606
2867
|
|
|
2607
2868
|
const TreeOnlyExample = () => {
|
|
@@ -2701,7 +2962,7 @@ export default TreeOnlyExample;
|
|
|
2701
2962
|
<span class="TreeLabelNameText">
|
|
2702
2963
|
<span class="TreeLabelNameTextHeadline">Folder 01</span>
|
|
2703
2964
|
</span>
|
|
2704
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
2965
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">7</span>
|
|
2705
2966
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2706
2967
|
</span>
|
|
2707
2968
|
</span>
|
|
@@ -2729,7 +2990,7 @@ export default TreeOnlyExample;
|
|
|
2729
2990
|
<span class="TreeLabelNameText">
|
|
2730
2991
|
<span class="TreeLabelNameTextHeadline">Folder 03</span>
|
|
2731
2992
|
</span>
|
|
2732
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
2993
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">5</span>
|
|
2733
2994
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2734
2995
|
</span>
|
|
2735
2996
|
</span>
|
|
@@ -2743,7 +3004,7 @@ export default TreeOnlyExample;
|
|
|
2743
3004
|
<span class="TreeLabelNameText">
|
|
2744
3005
|
<span class="TreeLabelNameTextHeadline">Folder 04</span>
|
|
2745
3006
|
</span>
|
|
2746
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
3007
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
|
|
2747
3008
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2748
3009
|
</span>
|
|
2749
3010
|
</span>
|
|
@@ -2764,61 +3025,66 @@ export default TreeOnlyExample;
|
|
|
2764
3025
|
</div>
|
|
2765
3026
|
```
|
|
2766
3027
|
|
|
2767
|
-
#### Props
|
|
3028
|
+
#### Props: Tree
|
|
3029
|
+
|
|
3030
|
+
### Tree
|
|
2768
3031
|
|
|
2769
3032
|
| Name | Type | Default | Description |
|
|
2770
3033
|
| --- | --- | --- | --- |
|
|
2771
|
-
| groups |
|
|
2772
|
-
| └id |
|
|
2773
|
-
| └name |
|
|
2774
|
-
| └position |
|
|
2775
|
-
| └disabled |
|
|
2776
|
-
| └
|
|
2777
|
-
|
|
|
2778
|
-
| └
|
|
2779
|
-
|
|
|
2780
|
-
| └
|
|
2781
|
-
| └
|
|
2782
|
-
| └
|
|
2783
|
-
| └
|
|
2784
|
-
| └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g.
|
|
2785
|
-
| └
|
|
3034
|
+
| groups | TreeGroup[] | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
|
|
3035
|
+
| └id | string | — | A unique identifier of a group. |
|
|
3036
|
+
| └name | string \| React.ReactNode | — | The name of a group. |
|
|
3037
|
+
| └position | 'last' | — | Can be set to "last" to enforce the last position in the tree. |
|
|
3038
|
+
| └disabled | boolean | — | Disallows the selection of the group itself. |
|
|
3039
|
+
| └icon | string | — | The rioglyph icon name for a group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
3040
|
+
| └expandedIcon | string | — | The rioglyph icon name for a expanded group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
3041
|
+
| └className | string | — | Additional classes added to the group element. |
|
|
3042
|
+
| items | TreeItem[] | [] | The list of items. |
|
|
3043
|
+
| └id | string | — | A unique identifier of an item. |
|
|
3044
|
+
| └name | string \| TreeItemName | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory. |
|
|
3045
|
+
| └info | string \| React.ReactNode | — | The subline of an item. This can e used to show additional information for that item. |
|
|
3046
|
+
| └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). |
|
|
3047
|
+
| └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. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
3048
|
+
| └subType | string | — | Optional sub-type of the item. This refers to the name of an additional rioglyph icon (excluding the rioglyph- prefix), typically used to render a secondary icon next to the primary one (Note: for fuel types better use the pairIcon prop). |
|
|
3049
|
+
| └pairIcon | string \| null \| undefined | — | Optional pair icon override for the subType. If set to a string (e.g. 'fuel-gas'), this icon will be used explicitly. If set to undefined, the subType property will be used as the fallback icon. If set to null, no icon will be rendered, even if subType is defined. This allows full control over the icon behavior while maintaining backward compatibility with subType-based icons. |
|
|
3050
|
+
| └groupIds | string[] | [] | List of group ids the items is associated with. |
|
|
2786
3051
|
| └className | string | — | Additional classes added to the item element. |
|
|
2787
|
-
| selectedGroups |
|
|
2788
|
-
| selectedItems |
|
|
2789
|
-
| onSelectionChange |
|
|
3052
|
+
| selectedGroups | string[] | [] | List of selected group ids. |
|
|
3053
|
+
| selectedItems | string[] | [] | List of selected item ids. |
|
|
3054
|
+
| onSelectionChange | ({ items, groups }: SelectionChangeResponse) => void | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
|
|
2790
3055
|
| hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
|
|
2791
3056
|
| showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
|
|
2792
3057
|
| hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
|
|
2793
3058
|
| searchPlaceholder | string | — | The text used as placeholder for the search input. |
|
|
2794
|
-
| onSearchChange |
|
|
2795
|
-
| search |
|
|
2796
|
-
|
|
|
2797
|
-
| summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
3059
|
+
| onSearchChange | (value: string) => void | — | Callback for when the search value changes. |
|
|
3060
|
+
| search | React.ReactNode | — | Used to define custom search component which replaces the built-in search. |
|
|
3061
|
+
| summary | React.ReactNode | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
2798
3062
|
| hideSummary | boolean | false | Defines whether a summary is shown. |
|
|
3063
|
+
| onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
|
|
2799
3064
|
| 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 |
|
|
2801
|
-
| scrollHeight |
|
|
2802
|
-
| expandedGroups |
|
|
2803
|
-
| onExpandGroupsChange |
|
|
3065
|
+
| treeHeaderContent | React.ReactElement | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
|
|
3066
|
+
| scrollHeight | number | — | Defines the max-height of the scrollable list. |
|
|
3067
|
+
| expandedGroups | string[] | — | List of group ids which are expanded. |
|
|
3068
|
+
| onExpandGroupsChange | (newExpandedGroups: string[]) => void | — | Callback function triggered when a group expands or collapses. |
|
|
2804
3069
|
| 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. |
|
|
3070
|
+
| treeOptions | React.ReactNode[] | — | Component to offer customization options for the tree. |
|
|
3071
|
+
| treeOptionsTooltip | React.ReactNode | — | Tooltip content for the tree options dropdown. |
|
|
3072
|
+
| disableAnimation | boolean | false | Disables animation when filtering or using search |
|
|
2807
3073
|
| virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
|
|
2808
3074
|
| overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
|
|
2809
|
-
| className |
|
|
3075
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
2810
3076
|
|
|
2811
3077
|
### Example: Tree without header and search
|
|
2812
3078
|
|
|
2813
3079
|
Tree without header and search
|
|
2814
3080
|
|
|
2815
|
-
Folder
|
|
3081
|
+
Folder 012
|
|
2816
3082
|
|
|
2817
|
-
Folder
|
|
3083
|
+
Folder 028
|
|
2818
3084
|
|
|
2819
|
-
Folder
|
|
3085
|
+
Folder 034
|
|
2820
3086
|
|
|
2821
|
-
Folder
|
|
3087
|
+
Folder 046
|
|
2822
3088
|
|
|
2823
3089
|
Selected items:
|
|
2824
3090
|
|
|
@@ -2828,13 +3094,13 @@ Expanded folders:
|
|
|
2828
3094
|
|
|
2829
3095
|
Tree without header and search
|
|
2830
3096
|
|
|
2831
|
-
Folder
|
|
3097
|
+
Folder 012
|
|
2832
3098
|
|
|
2833
|
-
Folder
|
|
3099
|
+
Folder 028
|
|
2834
3100
|
|
|
2835
|
-
Folder
|
|
3101
|
+
Folder 034
|
|
2836
3102
|
|
|
2837
|
-
Folder
|
|
3103
|
+
Folder 046
|
|
2838
3104
|
|
|
2839
3105
|
Selected items:
|
|
2840
3106
|
|
|
@@ -2845,7 +3111,7 @@ Expanded folders:
|
|
|
2845
3111
|
```tsx
|
|
2846
3112
|
import { useState } from 'react';
|
|
2847
3113
|
import { random } from 'es-toolkit/compat';
|
|
2848
|
-
import faker from 'faker';
|
|
3114
|
+
import { faker } from '@faker-js/faker';
|
|
2849
3115
|
|
|
2850
3116
|
import Tree, { type TreeItem, type TreeGroup, type SelectionChangeResponse } from '@rio-cloud/rio-uikit/Tree';
|
|
2851
3117
|
import LabeledElement from '@rio-cloud/rio-uikit/LabeledElement';
|
|
@@ -2879,10 +3145,10 @@ const folders2: TreeGroup[] = [
|
|
|
2879
3145
|
|
|
2880
3146
|
const treeItems2: TreeItem[] = Array.from({ length: 20 }, (_, index) => ({
|
|
2881
3147
|
id: `${index}`,
|
|
2882
|
-
name: `${faker.
|
|
3148
|
+
name: `${faker.lorem.words()} ${random(100, 999)}`,
|
|
2883
3149
|
type: 'files',
|
|
2884
3150
|
icon: null, // Set to "null" to omit the icon
|
|
2885
|
-
groupIds: [faker.
|
|
3151
|
+
groupIds: [faker.helpers.arrayElement(folders2).id],
|
|
2886
3152
|
}));
|
|
2887
3153
|
|
|
2888
3154
|
const TreeOnlyExample = () => {
|
|
@@ -2955,7 +3221,7 @@ export default TreeOnlyExample;
|
|
|
2955
3221
|
<span class="TreeLabelNameText">
|
|
2956
3222
|
<span class="TreeLabelNameTextHeadline">Folder 01</span>
|
|
2957
3223
|
</span>
|
|
2958
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
3224
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">2</span>
|
|
2959
3225
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2960
3226
|
</span>
|
|
2961
3227
|
</span>
|
|
@@ -2969,7 +3235,7 @@ export default TreeOnlyExample;
|
|
|
2969
3235
|
<span class="TreeLabelNameText">
|
|
2970
3236
|
<span class="TreeLabelNameTextHeadline">Folder 02</span>
|
|
2971
3237
|
</span>
|
|
2972
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
3238
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">8</span>
|
|
2973
3239
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2974
3240
|
</span>
|
|
2975
3241
|
</span>
|
|
@@ -2983,7 +3249,7 @@ export default TreeOnlyExample;
|
|
|
2983
3249
|
<span class="TreeLabelNameText">
|
|
2984
3250
|
<span class="TreeLabelNameTextHeadline">Folder 03</span>
|
|
2985
3251
|
</span>
|
|
2986
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
3252
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">4</span>
|
|
2987
3253
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
2988
3254
|
</span>
|
|
2989
3255
|
</span>
|
|
@@ -2997,7 +3263,7 @@ export default TreeOnlyExample;
|
|
|
2997
3263
|
<span class="TreeLabelNameText">
|
|
2998
3264
|
<span class="TreeLabelNameTextHeadline">Folder 04</span>
|
|
2999
3265
|
</span>
|
|
3000
|
-
<span class="TreeLabelCount label label-muted label-filled label-condensed">
|
|
3266
|
+
<span class="TreeLabelCount label label-muted label-filled label-condensed">6</span>
|
|
3001
3267
|
<span class="TreeLabelExpander rioglyph rioglyph-chevron-down ">
|
|
3002
3268
|
</span>
|
|
3003
3269
|
</span>
|
|
@@ -3018,53 +3284,58 @@ export default TreeOnlyExample;
|
|
|
3018
3284
|
</div>
|
|
3019
3285
|
```
|
|
3020
3286
|
|
|
3021
|
-
#### Props
|
|
3287
|
+
#### Props: Tree
|
|
3288
|
+
|
|
3289
|
+
### Tree
|
|
3022
3290
|
|
|
3023
3291
|
| Name | Type | Default | Description |
|
|
3024
3292
|
| --- | --- | --- | --- |
|
|
3025
|
-
| groups |
|
|
3026
|
-
| └id |
|
|
3027
|
-
| └name |
|
|
3028
|
-
| └position |
|
|
3029
|
-
| └disabled |
|
|
3030
|
-
| └
|
|
3031
|
-
|
|
|
3032
|
-
| └
|
|
3033
|
-
|
|
|
3034
|
-
| └
|
|
3035
|
-
| └
|
|
3036
|
-
| └
|
|
3037
|
-
| └
|
|
3038
|
-
| └icon | string \| null | — | Optional icon override for the item. If set to a string (e.g.
|
|
3039
|
-
| └
|
|
3293
|
+
| groups | TreeGroup[] | [] | The list of groups of the items. If no groups are provided all items are rendered as flat list. |
|
|
3294
|
+
| └id | string | — | A unique identifier of a group. |
|
|
3295
|
+
| └name | string \| React.ReactNode | — | The name of a group. |
|
|
3296
|
+
| └position | 'last' | — | Can be set to "last" to enforce the last position in the tree. |
|
|
3297
|
+
| └disabled | boolean | — | Disallows the selection of the group itself. |
|
|
3298
|
+
| └icon | string | — | The rioglyph icon name for a group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
3299
|
+
| └expandedIcon | string | — | The rioglyph icon name for a expanded group. The prefix rioglyph- can be omitted. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
3300
|
+
| └className | string | — | Additional classes added to the group element. |
|
|
3301
|
+
| items | TreeItem[] | [] | The list of items. |
|
|
3302
|
+
| └id | string | — | A unique identifier of an item. |
|
|
3303
|
+
| └name | string \| TreeItemName | — | The name of an item. Either it is a plain string or an object composed of: firstName and lastName where lastName is mandatory. |
|
|
3304
|
+
| └info | string \| React.ReactNode | — | The subline of an item. This can e used to show additional information for that item. |
|
|
3305
|
+
| └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). |
|
|
3306
|
+
| └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. For custom icons and logos, provide an image URL with one of these extensions: .png, .webp, .jpg, .jpeg, .svg. In this case, an img tag is rendered instead of the rioglyph. |
|
|
3307
|
+
| └subType | string | — | Optional sub-type of the item. This refers to the name of an additional rioglyph icon (excluding the rioglyph- prefix), typically used to render a secondary icon next to the primary one (Note: for fuel types better use the pairIcon prop). |
|
|
3308
|
+
| └pairIcon | string \| null \| undefined | — | Optional pair icon override for the subType. If set to a string (e.g. 'fuel-gas'), this icon will be used explicitly. If set to undefined, the subType property will be used as the fallback icon. If set to null, no icon will be rendered, even if subType is defined. This allows full control over the icon behavior while maintaining backward compatibility with subType-based icons. |
|
|
3309
|
+
| └groupIds | string[] | [] | List of group ids the items is associated with. |
|
|
3040
3310
|
| └className | string | — | Additional classes added to the item element. |
|
|
3041
|
-
| selectedGroups |
|
|
3042
|
-
| selectedItems |
|
|
3043
|
-
| onSelectionChange |
|
|
3311
|
+
| selectedGroups | string[] | [] | List of selected group ids. |
|
|
3312
|
+
| selectedItems | string[] | [] | List of selected item ids. |
|
|
3313
|
+
| onSelectionChange | ({ items, groups }: SelectionChangeResponse) => void | — | Merged Callback for item and group selection changes. It responds with a selection object that contains the selected itemIds and groupIds: { items: [], groups: [] } |
|
|
3044
3314
|
| hasMultiselect | boolean | true | Defines the selection behavior of the tree. |
|
|
3045
3315
|
| showRadioButtons | boolean | false | Defines if the single selection should also show radios. |
|
|
3046
3316
|
| hideSearch | boolean | false | Defines whether or not the built-in Search is shown. |
|
|
3047
3317
|
| searchPlaceholder | string | — | The text used as placeholder for the search input. |
|
|
3048
|
-
| onSearchChange |
|
|
3049
|
-
| search |
|
|
3050
|
-
|
|
|
3051
|
-
| summary | node | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
3318
|
+
| onSearchChange | (value: string) => void | — | Callback for when the search value changes. |
|
|
3319
|
+
| search | React.ReactNode | — | Used to define custom search component which replaces the built-in search. |
|
|
3320
|
+
| summary | React.ReactNode | — | Used to define custom asset type counter component which replaces the built-in summary. |
|
|
3052
3321
|
| hideSummary | boolean | false | Defines whether a summary is shown. |
|
|
3322
|
+
| onTypeFilterChange | (currentTypes: string[]) => void | — | Callback triggered when the built-in asset type filter changes. This is only available when the default summary is used. |
|
|
3053
3323
|
| 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 |
|
|
3055
|
-
| scrollHeight |
|
|
3056
|
-
| expandedGroups |
|
|
3057
|
-
| onExpandGroupsChange |
|
|
3324
|
+
| treeHeaderContent | React.ReactElement | — | Additional custom content that is rendered at the top of the tree component. This can be used for nav pills. |
|
|
3325
|
+
| scrollHeight | number | — | Defines the max-height of the scrollable list. |
|
|
3326
|
+
| expandedGroups | string[] | — | List of group ids which are expanded. |
|
|
3327
|
+
| onExpandGroupsChange | (newExpandedGroups: string[]) => void | — | Callback function triggered when a group expands or collapses. |
|
|
3058
3328
|
| 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. |
|
|
3329
|
+
| treeOptions | React.ReactNode[] | — | Component to offer customization options for the tree. |
|
|
3330
|
+
| treeOptionsTooltip | React.ReactNode | — | Tooltip content for the tree options dropdown. |
|
|
3331
|
+
| disableAnimation | boolean | false | Disables animation when filtering or using search |
|
|
3061
3332
|
| virtualizeThreshold | number | 50 | The number of items (including groups and children) used for virtualizing the tree. |
|
|
3062
3333
|
| overscan | number | 5 | The number of items rendered beyond the visible area of a virtualized tree. |
|
|
3063
|
-
| className |
|
|
3334
|
+
| className | string | — | Additional classes added to the wrapping element. |
|
|
3064
3335
|
|
|
3065
3336
|
## TreeSummary with assetCounts
|
|
3066
3337
|
|
|
3067
|
-
### Example: Example
|
|
3338
|
+
### Example: Example 8
|
|
3068
3339
|
|
|
3069
3340
|
12
|
|
3070
3341
|
7
|
|
@@ -3138,13 +3409,14 @@ export default TreeSummaryExample;
|
|
|
3138
3409
|
|
|
3139
3410
|
| Name | Type | Default | Description |
|
|
3140
3411
|
| --- | --- | --- | --- |
|
|
3141
|
-
| assetCounts |
|
|
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
|
-
| └
|
|
3147
|
-
|
|
|
3412
|
+
| assetCounts | TreeSummaryCounts | — | The object containing various asset type counter. |
|
|
3413
|
+
| └truck | number | — | The amount of trucks |
|
|
3414
|
+
| └trailer | number | — | The amount of trailers |
|
|
3415
|
+
| └bus | number | — | The amount of buses |
|
|
3416
|
+
| └van | number | — | The amount of vans |
|
|
3417
|
+
| └car | number | — | The amount of cars |
|
|
3418
|
+
| └driver | number | — | The amount of drivers |
|
|
3419
|
+
| gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow. |
|
|
3148
3420
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
3149
3421
|
|
|
3150
3422
|
#### Props: TypeCounter
|
|
@@ -3155,16 +3427,16 @@ export default TreeSummaryExample;
|
|
|
3155
3427
|
| --- | --- | --- | --- |
|
|
3156
3428
|
| type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
|
|
3157
3429
|
| 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 |
|
|
3159
|
-
| hasFilter | boolean |
|
|
3160
|
-
| enableActivity | boolean |
|
|
3430
|
+
| isActive | boolean | — | Sets the active styling if active |
|
|
3431
|
+
| hasFilter | boolean | false | Should be set when there is a type filter set in the tree to style the counter accordingly. |
|
|
3432
|
+
| enableActivity | boolean | false | Allows for interactivity. Use this prop when you allow clicking on the counter. |
|
|
3161
3433
|
| hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
|
|
3162
|
-
| onClick |
|
|
3163
|
-
| value |
|
|
3434
|
+
| onClick | (type: string) => void | — | 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. |
|
|
3435
|
+
| value | string \| React.ReactNode \| number | — | A custom value to be shown in the counter. |
|
|
3164
3436
|
|
|
3165
3437
|
## TreeSummary with TypeCounter
|
|
3166
3438
|
|
|
3167
|
-
### Example: Example
|
|
3439
|
+
### Example: Example 9
|
|
3168
3440
|
|
|
3169
3441
|
9
|
|
3170
3442
|
15
|
|
@@ -3213,13 +3485,14 @@ export default TreeSummaryCustomExample;
|
|
|
3213
3485
|
|
|
3214
3486
|
| Name | Type | Default | Description |
|
|
3215
3487
|
| --- | --- | --- | --- |
|
|
3216
|
-
| assetCounts |
|
|
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
|
-
| └
|
|
3222
|
-
|
|
|
3488
|
+
| assetCounts | TreeSummaryCounts | — | The object containing various asset type counter. |
|
|
3489
|
+
| └truck | number | — | The amount of trucks |
|
|
3490
|
+
| └trailer | number | — | The amount of trailers |
|
|
3491
|
+
| └bus | number | — | The amount of buses |
|
|
3492
|
+
| └van | number | — | The amount of vans |
|
|
3493
|
+
| └car | number | — | The amount of cars |
|
|
3494
|
+
| └driver | number | — | The amount of drivers |
|
|
3495
|
+
| gridCols | number | 4 | The number of grid columns used for the built-in TreeSummaryRow. |
|
|
3223
3496
|
| className | string | — | Additional classes added to the wrapping element. |
|
|
3224
3497
|
|
|
3225
3498
|
#### Props: TypeCounter
|
|
@@ -3230,9 +3503,9 @@ export default TreeSummaryCustomExample;
|
|
|
3230
3503
|
| --- | --- | --- | --- |
|
|
3231
3504
|
| type | string | — | The item type for that counter. This will be used as a return value for the onClick callback. |
|
|
3232
3505
|
| 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 |
|
|
3234
|
-
| hasFilter | boolean |
|
|
3235
|
-
| enableActivity | boolean |
|
|
3506
|
+
| isActive | boolean | — | Sets the active styling if active |
|
|
3507
|
+
| hasFilter | boolean | false | Should be set when there is a type filter set in the tree to style the counter accordingly. |
|
|
3508
|
+
| enableActivity | boolean | false | Allows for interactivity. Use this prop when you allow clicking on the counter. |
|
|
3236
3509
|
| hideOnZero | boolean | false | Defines if the counter is rendered at all when the value is not defined ot 0. |
|
|
3237
|
-
| onClick |
|
|
3238
|
-
| value |
|
|
3510
|
+
| onClick | (type: string) => void | — | 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. |
|
|
3511
|
+
| value | string \| React.ReactNode \| number | — | A custom value to be shown in the counter. |
|