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