@rio-cloud/uikit-mcp 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -39
- package/dist/doc-metadata.json +1872 -0
- package/dist/docs/components/accentBar.md +582 -0
- package/dist/docs/components/activity.md +330 -0
- package/dist/docs/components/animatedNumber.md +88 -0
- package/dist/docs/components/animatedTextReveal.md +381 -0
- package/dist/docs/components/animations.md +459 -0
- package/dist/docs/components/appHeader.md +737 -0
- package/dist/docs/components/appLayout.md +2033 -0
- package/dist/docs/components/appNavigationBar.md +274 -0
- package/dist/docs/components/areaCharts.md +828 -0
- package/dist/docs/components/aspectRatioPlaceholder.md +106 -0
- package/dist/docs/components/assetTree.md +3132 -0
- package/dist/docs/components/autosuggests.md +1177 -0
- package/dist/docs/components/avatar.md +206 -0
- package/dist/docs/components/banner.md +668 -0
- package/dist/docs/components/barCharts.md +2765 -0
- package/dist/docs/components/barList.md +517 -0
- package/dist/docs/components/basicMap.md +167 -0
- package/dist/docs/components/bottomSheet.md +721 -0
- package/dist/docs/components/button.md +775 -0
- package/dist/docs/components/buttonToolbar.md +134 -0
- package/dist/docs/components/calendarStripe.md +533 -0
- package/dist/docs/components/card.md +86 -0
- package/dist/docs/components/carousel.md +128 -0
- package/dist/docs/components/chartColors.md +716 -0
- package/dist/docs/components/chartsGettingStarted.md +28 -0
- package/dist/docs/components/chat.md +935 -0
- package/dist/docs/components/checkbox.md +996 -0
- package/dist/docs/components/clearableInput.md +806 -0
- package/dist/docs/components/collapse.md +189 -0
- package/dist/docs/components/composedCharts.md +424 -0
- package/dist/docs/components/contentLoader.md +674 -0
- package/dist/docs/components/dataTabs.md +1251 -0
- package/dist/docs/components/datepickers.md +2543 -0
- package/dist/docs/components/dialogs.md +2244 -0
- package/dist/docs/components/divider.md +219 -0
- package/dist/docs/components/dropdowns.md +17538 -0
- package/dist/docs/components/editableContent.md +1127 -0
- package/dist/docs/components/expander.md +970 -0
- package/dist/docs/components/fade.md +836 -0
- package/dist/docs/components/fadeExpander.md +180 -0
- package/dist/docs/components/fadeUp.md +396 -0
- package/dist/docs/components/feedback.md +758 -0
- package/dist/docs/components/filePickers.md +370 -0
- package/dist/docs/components/formLabel.md +251 -0
- package/dist/docs/components/fullscreenMap.md +10 -0
- package/dist/docs/components/groupedItemList.md +1001 -0
- package/dist/docs/components/iconList.md +306 -0
- package/dist/docs/components/imagePreloader.md +167 -0
- package/dist/docs/components/labeledElement.md +115 -0
- package/dist/docs/components/licensePlate.md +412 -0
- package/dist/docs/components/lineCharts.md +2014 -0
- package/dist/docs/components/listMenu.md +392 -0
- package/dist/docs/components/loadMore.md +219 -0
- package/dist/docs/components/mainNavigation.md +129 -0
- package/dist/docs/components/mapCircle.md +93 -0
- package/dist/docs/components/mapCluster.md +337 -0
- package/dist/docs/components/mapContext.md +284 -0
- package/dist/docs/components/mapDraggableMarker.md +150 -0
- package/dist/docs/components/mapGettingStarted.md +39 -0
- package/dist/docs/components/mapInfoBubble.md +135 -0
- package/dist/docs/components/mapLayerGroup.md +94 -0
- package/dist/docs/components/mapMarker.md +1814 -0
- package/dist/docs/components/mapPolygon.md +959 -0
- package/dist/docs/components/mapRoute.md +3816 -0
- package/dist/docs/components/mapRouteGenerator.md +6 -0
- package/dist/docs/components/mapSettings.md +1040 -0
- package/dist/docs/components/mapUtils.md +132 -0
- package/dist/docs/components/multiselects.md +1921 -0
- package/dist/docs/components/noData.md +210 -0
- package/dist/docs/components/notifications.md +314 -0
- package/dist/docs/components/numbercontrol.md +706 -0
- package/dist/docs/components/onboarding.md +297 -0
- package/dist/docs/components/page.md +241 -0
- package/dist/docs/components/pager.md +133 -0
- package/dist/docs/components/pieCharts.md +1284 -0
- package/dist/docs/components/popover.md +222 -0
- package/dist/docs/components/position.md +50 -0
- package/dist/docs/components/radialBarCharts.md +3663 -0
- package/dist/docs/components/radiobutton.md +1271 -0
- package/dist/docs/components/releaseNotes.md +135 -0
- package/dist/docs/components/resizer.md +162 -0
- package/dist/docs/components/responsiveColumnStripe.md +435 -0
- package/dist/docs/components/responsiveVideo.md +71 -0
- package/dist/docs/components/rioglyph.md +331 -0
- package/dist/docs/components/rules.md +965 -0
- package/dist/docs/components/saveableInput.md +1721 -0
- package/dist/docs/components/selects.md +1993 -0
- package/dist/docs/components/sidebar.md +332 -0
- package/dist/docs/components/sliders.md +376 -0
- package/dist/docs/components/smoothScrollbars.md +1180 -0
- package/dist/docs/components/spinners.md +506 -0
- package/dist/docs/components/states.md +1176 -0
- package/dist/docs/components/statsWidgets.md +636 -0
- package/dist/docs/components/statusBar.md +644 -0
- package/dist/docs/components/stepButton.md +61 -0
- package/dist/docs/components/steppedProgressBars.md +1064 -0
- package/dist/docs/components/subNavigation.md +470 -0
- package/dist/docs/components/supportMarker.md +115 -0
- package/dist/docs/components/svgImage.md +248 -0
- package/dist/docs/components/switch.md +554 -0
- package/dist/docs/components/tables.md +8 -0
- package/dist/docs/components/tagManager.md +476 -0
- package/dist/docs/components/tags.md +785 -0
- package/dist/docs/components/teaser.md +925 -0
- package/dist/docs/components/timeline.md +514 -0
- package/dist/docs/components/timepicker.md +262 -0
- package/dist/docs/components/toggleButton.md +178 -0
- package/dist/docs/components/tooltip.md +454 -0
- package/dist/docs/components/virtualList.md +486 -0
- package/dist/docs/foundations.md +20901 -0
- package/dist/docs/start/changelog.md +714 -0
- package/dist/docs/start/goodtoknow.md +14 -0
- package/dist/docs/start/guidelines/color-combinations.md +678 -0
- package/dist/docs/start/guidelines/custom-css.md +42 -0
- package/dist/docs/start/guidelines/custom-rioglyph.md +35 -0
- package/dist/docs/start/guidelines/formatting.md +587 -0
- package/dist/docs/start/guidelines/iframe.md +323 -0
- package/dist/docs/start/guidelines/obfuscate-data.md +30 -0
- package/dist/docs/start/guidelines/print-css.md +36 -0
- package/dist/docs/start/guidelines/spinner.md +710 -0
- package/dist/docs/start/guidelines/supported-browsers.md +10 -0
- package/dist/docs/start/guidelines/writing.md +635 -0
- package/dist/docs/start/howto.md +187 -0
- package/dist/docs/start/intro.md +43 -0
- package/dist/docs/start/responsiveness.md +98 -0
- package/dist/docs/templates/common-table.md +1111 -0
- package/dist/docs/templates/detail-views.md +942 -0
- package/dist/docs/templates/expandable-details.md +228 -0
- package/dist/docs/templates/feature-cards.md +549 -0
- package/dist/docs/templates/form-summary.md +199 -0
- package/dist/docs/templates/form-toggle.md +367 -0
- package/dist/docs/templates/list-blocks.md +1021 -0
- package/dist/docs/templates/loading-progress.md +109 -0
- package/dist/docs/templates/options-panel.md +152 -0
- package/dist/docs/templates/panel-variants.md +164 -0
- package/dist/docs/templates/progress-cards.md +607 -0
- package/dist/docs/templates/progress-success.md +142 -0
- package/dist/docs/templates/settings-form.md +434 -0
- package/dist/docs/templates/stats-blocks.md +1381 -0
- package/dist/docs/templates/table-panel.md +184 -0
- package/dist/docs/templates/table-row-animation.md +317 -0
- package/dist/docs/templates/usage-cards.md +227 -0
- package/dist/docs/utilities/deviceUtils.md +123 -0
- package/dist/docs/utilities/featureToggles.md +90 -0
- package/dist/docs/utilities/fuelTypeUtils.md +186 -0
- package/dist/docs/utilities/routeUtils.md +138 -0
- package/dist/docs/utilities/useAfterMount.md +66 -0
- package/dist/docs/utilities/useAutoAnimate.md +193 -0
- package/dist/docs/utilities/useAverage.md +95 -0
- package/dist/docs/utilities/useClickOutside.md +61 -0
- package/dist/docs/utilities/useClipboard.md +93 -0
- package/dist/docs/utilities/useCount.md +178 -0
- package/dist/docs/utilities/useDarkMode.md +49 -0
- package/dist/docs/utilities/useDebugInfo.md +126 -0
- package/dist/docs/utilities/useEffectOnce.md +58 -0
- package/dist/docs/utilities/useElapsedTime.md +58 -0
- package/dist/docs/utilities/useElementSize.md +71 -0
- package/dist/docs/utilities/useEsc.md +58 -0
- package/dist/docs/utilities/useEvent.md +64 -0
- package/dist/docs/utilities/useFocusTrap.md +85 -0
- package/dist/docs/utilities/useFullscreen.md +198 -0
- package/dist/docs/utilities/useHover.md +55 -0
- package/dist/docs/utilities/useIncomingPostMessages.md +237 -0
- package/dist/docs/utilities/useInterval.md +85 -0
- package/dist/docs/utilities/useIsFocusWithin.md +114 -0
- package/dist/docs/utilities/useKey.md +151 -0
- package/dist/docs/utilities/useLocalStorage.md +91 -0
- package/dist/docs/utilities/useLocationSuggestions.md +114 -0
- package/dist/docs/utilities/useMax.md +62 -0
- package/dist/docs/utilities/useMin.md +78 -0
- package/dist/docs/utilities/useMutationObserver.md +113 -0
- package/dist/docs/utilities/useOnScreen.md +138 -0
- package/dist/docs/utilities/useOnlineStatus.md +49 -0
- package/dist/docs/utilities/usePostMessage.md +117 -0
- package/dist/docs/utilities/usePostMessageSender.md +257 -0
- package/dist/docs/utilities/usePrevious.md +101 -0
- package/dist/docs/utilities/useResizeObserver.md +151 -0
- package/dist/docs/utilities/useScrollPosition.md +252 -0
- package/dist/docs/utilities/useSearch.md +228 -0
- package/dist/docs/utilities/useSorting.md +389 -0
- package/dist/docs/utilities/useStateWithValidation.md +83 -0
- package/dist/docs/utilities/useSum.md +155 -0
- package/dist/docs/utilities/useTableExport.md +404 -0
- package/dist/docs/utilities/useTableSelection.md +1120 -0
- package/dist/docs/utilities/useTimeout.md +55 -0
- package/dist/docs/utilities/useToggle.md +115 -0
- package/dist/docs/utilities/useWindowResize.md +70 -0
- package/dist/index.mjs +271 -0
- package/dist/search-synonyms.json +134 -0
- package/dist/version.json +4 -0
- package/package.json +23 -19
- package/bin/uikit-mcp.mjs +0 -23
- package/data/pages/Components/components/accentbar.json +0 -207
- package/data/pages/Components/components/activity.json +0 -87
- package/data/pages/Components/components/animatednumber.json +0 -99
- package/data/pages/Components/components/animations.json +0 -87
- package/data/pages/Components/components/appheader.json +0 -291
- package/data/pages/Components/components/applayout.json +0 -1198
- package/data/pages/Components/components/appnavigationbar.json +0 -327
- package/data/pages/Components/components/areacharts.json +0 -563
- package/data/pages/Components/components/aspectratioplaceholder.json +0 -75
- package/data/pages/Components/components/assettree.json +0 -3080
- package/data/pages/Components/components/autosuggests.json +0 -710
- package/data/pages/Components/components/avatar.json +0 -157
- package/data/pages/Components/components/banner.json +0 -599
- package/data/pages/Components/components/barcharts.json +0 -1507
- package/data/pages/Components/components/barlist.json +0 -223
- package/data/pages/Components/components/basicmap.json +0 -68
- package/data/pages/Components/components/bottomsheet.json +0 -601
- package/data/pages/Components/components/button.json +0 -583
- package/data/pages/Components/components/buttontoolbar.json +0 -63
- package/data/pages/Components/components/calendarstripe.json +0 -235
- package/data/pages/Components/components/card.json +0 -69
- package/data/pages/Components/components/carousel.json +0 -39
- package/data/pages/Components/components/chartcolors.json +0 -34
- package/data/pages/Components/components/chartsgettingstarted.json +0 -32
- package/data/pages/Components/components/chat.json +0 -39
- package/data/pages/Components/components/checkbox.json +0 -847
- package/data/pages/Components/components/clearableinput.json +0 -789
- package/data/pages/Components/components/collapse.json +0 -175
- package/data/pages/Components/components/composedcharts.json +0 -159
- package/data/pages/Components/components/contentloader.json +0 -233
- package/data/pages/Components/components/datatabs.json +0 -680
- package/data/pages/Components/components/datepickers.json +0 -287
- package/data/pages/Components/components/dialogs.json +0 -1492
- package/data/pages/Components/components/divider.json +0 -93
- package/data/pages/Components/components/dropdowns.json +0 -936
- package/data/pages/Components/components/editablecontent.json +0 -1117
- package/data/pages/Components/components/expander.json +0 -377
- package/data/pages/Components/components/fade.json +0 -403
- package/data/pages/Components/components/fadeexpander.json +0 -75
- package/data/pages/Components/components/fadeup.json +0 -127
- package/data/pages/Components/components/feedback.json +0 -269
- package/data/pages/Components/components/filepickers.json +0 -269
- package/data/pages/Components/components/formlabel.json +0 -115
- package/data/pages/Components/components/fullscreenmap.json +0 -22
- package/data/pages/Components/components/groupeditemlist.json +0 -323
- package/data/pages/Components/components/iconlist.json +0 -45
- package/data/pages/Components/components/imagepreloader.json +0 -81
- package/data/pages/Components/components/labeledelement.json +0 -75
- package/data/pages/Components/components/licenseplate.json +0 -69
- package/data/pages/Components/components/linecharts.json +0 -987
- package/data/pages/Components/components/listmenu.json +0 -313
- package/data/pages/Components/components/loadmore.json +0 -175
- package/data/pages/Components/components/mainnavigation.json +0 -39
- package/data/pages/Components/components/mapcircle.json +0 -34
- package/data/pages/Components/components/mapcluster.json +0 -51
- package/data/pages/Components/components/mapcontext.json +0 -105
- package/data/pages/Components/components/mapdraggablemarker.json +0 -34
- package/data/pages/Components/components/mapgettingstarted.json +0 -27
- package/data/pages/Components/components/mapgroup.json +0 -1198
- package/data/pages/Components/components/mapinfobubble.json +0 -34
- package/data/pages/Components/components/maplayergroup.json +0 -34
- package/data/pages/Components/components/mapmarker.json +0 -700
- package/data/pages/Components/components/mappolygon.json +0 -45
- package/data/pages/Components/components/maproute.json +0 -623
- package/data/pages/Components/components/maproutegenerator.json +0 -16
- package/data/pages/Components/components/mapsettings.json +0 -51
- package/data/pages/Components/components/maputils.json +0 -34
- package/data/pages/Components/components/multiselects.json +0 -1451
- package/data/pages/Components/components/nodata.json +0 -139
- package/data/pages/Components/components/notifications.json +0 -65
- package/data/pages/Components/components/numbercontrol.json +0 -301
- package/data/pages/Components/components/onboarding.json +0 -302
- package/data/pages/Components/components/page.json +0 -197
- package/data/pages/Components/components/pager.json +0 -93
- package/data/pages/Components/components/piecharts.json +0 -731
- package/data/pages/Components/components/popover.json +0 -251
- package/data/pages/Components/components/position.json +0 -69
- package/data/pages/Components/components/radialbarcharts.json +0 -1304
- package/data/pages/Components/components/radiobutton.json +0 -1105
- package/data/pages/Components/components/releasenotes.json +0 -44
- package/data/pages/Components/components/resizer.json +0 -93
- package/data/pages/Components/components/responsivecolumnstripe.json +0 -123
- package/data/pages/Components/components/responsivevideo.json +0 -75
- package/data/pages/Components/components/rioglyph.json +0 -93
- package/data/pages/Components/components/rules.json +0 -410
- package/data/pages/Components/components/saveableinput.json +0 -703
- package/data/pages/Components/components/selects.json +0 -701
- package/data/pages/Components/components/sidebar.json +0 -243
- package/data/pages/Components/components/sliders.json +0 -235
- package/data/pages/Components/components/smoothscrollbars.json +0 -335
- package/data/pages/Components/components/spinners.json +0 -343
- package/data/pages/Components/components/states.json +0 -1705
- package/data/pages/Components/components/statswidgets.json +0 -314
- package/data/pages/Components/components/statusbar.json +0 -177
- package/data/pages/Components/components/stepbutton.json +0 -57
- package/data/pages/Components/components/steppedprogressbars.json +0 -417
- package/data/pages/Components/components/subnavigation.json +0 -107
- package/data/pages/Components/components/supportmarker.json +0 -45
- package/data/pages/Components/components/svgimage.json +0 -81
- package/data/pages/Components/components/switch.json +0 -111
- package/data/pages/Components/components/tables.json +0 -144
- package/data/pages/Components/components/tagmanager.json +0 -86
- package/data/pages/Components/components/tags.json +0 -146
- package/data/pages/Components/components/teaser.json +0 -188
- package/data/pages/Components/components/timeline.json +0 -45
- package/data/pages/Components/components/timepicker.json +0 -163
- package/data/pages/Components/components/togglebutton.json +0 -247
- package/data/pages/Components/components/tooltip.json +0 -270
- package/data/pages/Components/components/virtuallist.json +0 -175
- package/data/pages/Foundations/foundations.json +0 -2475
- package/data/pages/Getting-started/start/changelog.json +0 -22
- package/data/pages/Getting-started/start/goodtoknow.json +0 -32
- package/data/pages/Getting-started/start/guidelines/color-combinations.json +0 -58
- package/data/pages/Getting-started/start/guidelines/custom-css.json +0 -27
- package/data/pages/Getting-started/start/guidelines/custom-rioglyph.json +0 -22
- package/data/pages/Getting-started/start/guidelines/formatting.json +0 -97
- package/data/pages/Getting-started/start/guidelines/iframe.json +0 -93
- package/data/pages/Getting-started/start/guidelines/obfuscate-data.json +0 -22
- package/data/pages/Getting-started/start/guidelines/print-css.json +0 -37
- package/data/pages/Getting-started/start/guidelines/spinner.json +0 -144
- package/data/pages/Getting-started/start/guidelines/supported-browsers.json +0 -22
- package/data/pages/Getting-started/start/guidelines/writing.json +0 -242
- package/data/pages/Getting-started/start/howto.json +0 -72
- package/data/pages/Getting-started/start/intro.json +0 -37
- package/data/pages/Getting-started/start/responsiveness.json +0 -52
- package/data/pages/Templates/templates/common-table.json +0 -39
- package/data/pages/Templates/templates/detail-views.json +0 -71
- package/data/pages/Templates/templates/expandable-details.json +0 -39
- package/data/pages/Templates/templates/feature-cards.json +0 -103
- package/data/pages/Templates/templates/form-summary.json +0 -39
- package/data/pages/Templates/templates/form-toggle.json +0 -39
- package/data/pages/Templates/templates/list-blocks.json +0 -119
- package/data/pages/Templates/templates/loading-progress.json +0 -39
- package/data/pages/Templates/templates/options-panel.json +0 -39
- package/data/pages/Templates/templates/panel-variants.json +0 -39
- package/data/pages/Templates/templates/progress-cards.json +0 -71
- package/data/pages/Templates/templates/progress-success.json +0 -39
- package/data/pages/Templates/templates/settings-form.json +0 -39
- package/data/pages/Templates/templates/stats-blocks.json +0 -135
- package/data/pages/Templates/templates/table-panel.json +0 -39
- package/data/pages/Templates/templates/table-row-animation.json +0 -39
- package/data/pages/Templates/templates/usage-cards.json +0 -39
- package/data/pages/Utilities/utilities/deviceutils.json +0 -39
- package/data/pages/Utilities/utilities/featuretoggles.json +0 -42
- package/data/pages/Utilities/utilities/fueltypeutils.json +0 -118
- package/data/pages/Utilities/utilities/routeutils.json +0 -34
- package/data/pages/Utilities/utilities/useaftermount.json +0 -63
- package/data/pages/Utilities/utilities/useaverage.json +0 -86
- package/data/pages/Utilities/utilities/useclickoutside.json +0 -69
- package/data/pages/Utilities/utilities/useclipboard.json +0 -57
- package/data/pages/Utilities/utilities/usecount.json +0 -92
- package/data/pages/Utilities/utilities/usedarkmode.json +0 -50
- package/data/pages/Utilities/utilities/usedebuginfo.json +0 -63
- package/data/pages/Utilities/utilities/useeffectonce.json +0 -57
- package/data/pages/Utilities/utilities/useelapsedtime.json +0 -57
- package/data/pages/Utilities/utilities/useelementsize.json +0 -63
- package/data/pages/Utilities/utilities/useesc.json +0 -57
- package/data/pages/Utilities/utilities/useevent.json +0 -75
- package/data/pages/Utilities/utilities/usefocustrap.json +0 -57
- package/data/pages/Utilities/utilities/usefullscreen.json +0 -197
- package/data/pages/Utilities/utilities/usehover.json +0 -57
- package/data/pages/Utilities/utilities/useinterval.json +0 -63
- package/data/pages/Utilities/utilities/useisfocuswithin.json +0 -75
- package/data/pages/Utilities/utilities/usekey.json +0 -75
- package/data/pages/Utilities/utilities/uselocalstorage.json +0 -69
- package/data/pages/Utilities/utilities/uselocationsuggestions.json +0 -110
- package/data/pages/Utilities/utilities/usemax.json +0 -86
- package/data/pages/Utilities/utilities/usemin.json +0 -86
- package/data/pages/Utilities/utilities/usemutationobserver.json +0 -69
- package/data/pages/Utilities/utilities/useonlinestatus.json +0 -39
- package/data/pages/Utilities/utilities/useonscreen.json +0 -63
- package/data/pages/Utilities/utilities/usepostmessage.json +0 -80
- package/data/pages/Utilities/utilities/useprevious.json +0 -63
- package/data/pages/Utilities/utilities/useresizeobserver.json +0 -65
- package/data/pages/Utilities/utilities/usescrollposition.json +0 -103
- package/data/pages/Utilities/utilities/usesearch.json +0 -197
- package/data/pages/Utilities/utilities/usesorting.json +0 -139
- package/data/pages/Utilities/utilities/usestatewithvalidation.json +0 -69
- package/data/pages/Utilities/utilities/usesum.json +0 -86
- package/data/pages/Utilities/utilities/usetableexport.json +0 -87
- package/data/pages/Utilities/utilities/usetableselection.json +0 -311
- package/data/pages/Utilities/utilities/usetimeout.json +0 -63
- package/data/pages/Utilities/utilities/usetoggle.json +0 -75
- package/data/pages/Utilities/utilities/usewindowresize.json +0 -63
- package/data/version.json +0 -4
- package/docs/content-schema.md +0 -147
- package/docs/navigation-inventory.json +0 -1310
- package/docs/search-synonyms.json +0 -43
- package/server/index.mjs +0 -268
- package/server/lib/load-docs.mjs +0 -48
- package/server/lib/normalise-doc.mjs +0 -220
- package/server/lib/render-markdown.mjs +0 -82
- package/server/lib/search-index.mjs +0 -49
- package/server/lib/types.js +0 -99
|
@@ -0,0 +1,1251 @@
|
|
|
1
|
+
# DataTabs
|
|
2
|
+
|
|
3
|
+
*Category:* Components
|
|
4
|
+
*Section:* Content
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#components/dataTabs
|
|
6
|
+
*Captured:* 2025-12-12T14:20:43.301Z
|
|
7
|
+
|
|
8
|
+
Passing a single tab content component via commonTabContent prop into the DataTabs component allows to update that single component when switching tabs. This comes in handy for instance when you want to animate a graph with different values from each tab.
|
|
9
|
+
|
|
10
|
+
## DataTabs
|
|
11
|
+
|
|
12
|
+
### Example: Example 1
|
|
13
|
+
|
|
14
|
+
Horizontal layout
|
|
15
|
+
Ø - Consumption
|
|
16
|
+
13,5 km/l
|
|
17
|
+
|
|
18
|
+
Ø - C02 Emission
|
|
19
|
+
12,2 kg
|
|
20
|
+
|
|
21
|
+
Ø - Range
|
|
22
|
+
32,8 l/100
|
|
23
|
+
|
|
24
|
+
Ø - Route type
|
|
25
|
+
ABCDEF
|
|
26
|
+
|
|
27
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.
|
|
28
|
+
|
|
29
|
+
#### Summary
|
|
30
|
+
|
|
31
|
+
Horizontal layout
|
|
32
|
+
Ø - Consumption
|
|
33
|
+
13,5 km/l
|
|
34
|
+
|
|
35
|
+
Ø - C02 Emission
|
|
36
|
+
12,2 kg
|
|
37
|
+
|
|
38
|
+
Ø - Range
|
|
39
|
+
32,8 l/100
|
|
40
|
+
|
|
41
|
+
Ø - Route type
|
|
42
|
+
ABCDEF
|
|
43
|
+
|
|
44
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.
|
|
45
|
+
|
|
46
|
+
#### React (tsx)
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import type React from 'react';
|
|
50
|
+
import { useState } from 'react';
|
|
51
|
+
|
|
52
|
+
import DataTabs from '@rio-cloud/rio-uikit/DataTabs';
|
|
53
|
+
import DataTab from '@rio-cloud/rio-uikit/DataTab';
|
|
54
|
+
import { dummyText } from '../../../utils/data';
|
|
55
|
+
|
|
56
|
+
export default () => {
|
|
57
|
+
const [tabKey, setTabKey] = useState<string>();
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div>
|
|
61
|
+
<div className='h6'>Horizontal layout</div>
|
|
62
|
+
<DataTabs activeKey={tabKey} onSelectTab={newTabKey => setTabKey(newTabKey)}>
|
|
63
|
+
<DataTab tabKey='tab1' title={<Title text='Ø - Consumption' value='13,5 km/l' />}>
|
|
64
|
+
{dummyText}
|
|
65
|
+
</DataTab>
|
|
66
|
+
<DataTab tabKey='tab2' title={<Title text='Ø - C02 Emission' value='12,2 kg' />}>
|
|
67
|
+
{dummyText + dummyText}
|
|
68
|
+
</DataTab>
|
|
69
|
+
<DataTab tabKey='tab3' title={<Title text='Ø - Range' value='32,8 l/100' />}>
|
|
70
|
+
{dummyText}
|
|
71
|
+
</DataTab>
|
|
72
|
+
<DataTab tabKey='tab4' title={<Title text='Ø - Route type' value={<RouteType />} />}>
|
|
73
|
+
{dummyText}
|
|
74
|
+
</DataTab>
|
|
75
|
+
</DataTabs>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const Title = ({ text, value }: { text: string; value: React.ReactNode }) => (
|
|
81
|
+
<div>
|
|
82
|
+
<div>{text}</div>
|
|
83
|
+
<div className='text-bold text-size-18'>{value}</div>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
export const RouteType = () => (
|
|
88
|
+
<div>
|
|
89
|
+
<span className='text-color-light'>A</span>
|
|
90
|
+
<span className='text-color-light'>B</span>
|
|
91
|
+
<span className='text-color-light'>C</span>
|
|
92
|
+
<span className='text-color-light'>D</span>
|
|
93
|
+
<span className='text-color-warning'>E</span>
|
|
94
|
+
<span className='text-color-light'>F</span>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### HTML (html)
|
|
100
|
+
|
|
101
|
+
```html
|
|
102
|
+
<div>
|
|
103
|
+
<div class="h6">Horizontal layout</div>
|
|
104
|
+
<div class="DataTabsContainer DataTab-bordered DataTabs-horizontal">
|
|
105
|
+
<div class="DataTabsWrapper ">
|
|
106
|
+
<ul class="DataTabs" role="tabList">
|
|
107
|
+
<li class="DataTab tab active bg-highlight-dark text-color-white" data-tabkey="tab1">
|
|
108
|
+
<div>
|
|
109
|
+
<div>Ø - Consumption</div>
|
|
110
|
+
<div class="text-bold text-size-18">13,5 km/l</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="arrow bg-highlight-dark border-color-transparent in">
|
|
113
|
+
</div>
|
|
114
|
+
</li>
|
|
115
|
+
<li class="DataTab tab cursor-pointer" data-tabkey="tab2">
|
|
116
|
+
<div>
|
|
117
|
+
<div>Ø - C02 Emission</div>
|
|
118
|
+
<div class="text-bold text-size-18">12,2 kg</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="arrow bg-highlight-dark border-color-transparent ">
|
|
121
|
+
</div>
|
|
122
|
+
</li>
|
|
123
|
+
<li class="DataTab tab cursor-pointer" data-tabkey="tab3">
|
|
124
|
+
<div>
|
|
125
|
+
<div>Ø - Range</div>
|
|
126
|
+
<div class="text-bold text-size-18">32,8 l/100</div>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="arrow bg-highlight-dark border-color-transparent ">
|
|
129
|
+
</div>
|
|
130
|
+
</li>
|
|
131
|
+
<li class="DataTab tab cursor-pointer" data-tabkey="tab4">
|
|
132
|
+
<div>
|
|
133
|
+
<div>Ø - Route type</div>
|
|
134
|
+
<div class="text-bold text-size-18">
|
|
135
|
+
<div>
|
|
136
|
+
<span class="text-color-light">A</span>
|
|
137
|
+
<span class="text-color-light">B</span>
|
|
138
|
+
<span class="text-color-light">C</span>
|
|
139
|
+
<span class="text-color-light">D</span>
|
|
140
|
+
<span class="text-color-warning">E</span>
|
|
141
|
+
<span class="text-color-light">F</span>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="arrow bg-highlight-dark border-color-transparent ">
|
|
146
|
+
</div>
|
|
147
|
+
</li>
|
|
148
|
+
</ul>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="tab-content " role="tabpanel">
|
|
151
|
+
<div style="opacity: 1; transform: none;">
|
|
152
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### Props: DataTabs
|
|
159
|
+
|
|
160
|
+
### DataTabs
|
|
161
|
+
|
|
162
|
+
| Name | Type | Default | Description |
|
|
163
|
+
| --- | --- | --- | --- |
|
|
164
|
+
| activeKey | String | "" | Sets key and id. |
|
|
165
|
+
| onSelectTab | boolean | () => {} | Called when a tab is being activated. |
|
|
166
|
+
| commonTabContent | ReactNode | — | Tab content that is used for all tabs. Using a common tab content will ignore any DataTab child. Additionally, there will be no transition when switching tabs as it is a single tab content component. |
|
|
167
|
+
| vertical | boolean | false | Whether the layout should be vertical. |
|
|
168
|
+
| bordered | boolean | true | Whether the component should add a border. |
|
|
169
|
+
| disableTransition | boolean | false | Transitions between tab contents are enabled by default. Set if you want to disable them. The Navigation tabs will still remain animated. |
|
|
170
|
+
| className | string | — | Additional classes to be set on the wrapper element. |
|
|
171
|
+
| tabContentClassName | string | — | Additional classes to be set on the tabContent wrapper element. |
|
|
172
|
+
| tabsWrapperClassName | string | — | Additional classes to be set on the tabs wrapper element. |
|
|
173
|
+
| arrowClassName | string | bg-highlight-dark | Additional classes to be set on the arrow. |
|
|
174
|
+
| tabClassName | string | bg-white | Additional classes to be set on the tab element. |
|
|
175
|
+
| tabHoverClassName | string | text-color-darkest | Utility hover classes to be set on the tab element. |
|
|
176
|
+
| tabActiveClassName | string | text-color-darkest | Utility active classes to be set on the tab element. |
|
|
177
|
+
|
|
178
|
+
#### Props: DataTab
|
|
179
|
+
|
|
180
|
+
### DataTab
|
|
181
|
+
|
|
182
|
+
| Name | Type | Default | Description |
|
|
183
|
+
| --- | --- | --- | --- |
|
|
184
|
+
| tabKey | string | — | Used to identify the tab. |
|
|
185
|
+
| title | string \| ReactNode | — | The content for the tab. |
|
|
186
|
+
| active | boolean | — | Whether this tab is the one currently active. |
|
|
187
|
+
| disableTransition | boolean | — | Whether the transition effect should be disabled. |
|
|
188
|
+
| onAnimationStart | VoidFunction | — | Callback for when the animation starts. |
|
|
189
|
+
| onAnimationEnd | VoidFunction | — | Callback for when the animation ends. |
|
|
190
|
+
| className | String | — | Additional classes to be set on the element. |
|
|
191
|
+
|
|
192
|
+
### Example: Example 2
|
|
193
|
+
|
|
194
|
+
Vertical layout
|
|
195
|
+
Ø - Consumption
|
|
196
|
+
13,5 km/l
|
|
197
|
+
|
|
198
|
+
Ø - C02 Emission
|
|
199
|
+
12,2 kg
|
|
200
|
+
|
|
201
|
+
Ø - Range
|
|
202
|
+
32,8 l/100
|
|
203
|
+
|
|
204
|
+
Ø - Route type
|
|
205
|
+
ABCDEF
|
|
206
|
+
|
|
207
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.
|
|
208
|
+
|
|
209
|
+
#### Summary
|
|
210
|
+
|
|
211
|
+
Vertical layout
|
|
212
|
+
Ø - Consumption
|
|
213
|
+
13,5 km/l
|
|
214
|
+
|
|
215
|
+
Ø - C02 Emission
|
|
216
|
+
12,2 kg
|
|
217
|
+
|
|
218
|
+
Ø - Range
|
|
219
|
+
32,8 l/100
|
|
220
|
+
|
|
221
|
+
Ø - Route type
|
|
222
|
+
ABCDEF
|
|
223
|
+
|
|
224
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.
|
|
225
|
+
|
|
226
|
+
#### React (tsx)
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
import type React from 'react';
|
|
230
|
+
import { useState } from 'react';
|
|
231
|
+
|
|
232
|
+
import DataTabs from '@rio-cloud/rio-uikit/DataTabs';
|
|
233
|
+
import DataTab from '@rio-cloud/rio-uikit/DataTab';
|
|
234
|
+
import { dummyText } from '../../../utils/data';
|
|
235
|
+
|
|
236
|
+
export default () => {
|
|
237
|
+
const [tabKey, setTabKey] = useState<string>();
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<div>
|
|
241
|
+
<div className='h6'>Vertical layout</div>
|
|
242
|
+
<DataTabs activeKey={tabKey} onSelectTab={newTabKey => setTabKey(newTabKey)} vertical>
|
|
243
|
+
<DataTab tabKey='tab1' title={<Title text='Ø - Consumption' value='13,5 km/l' />}>
|
|
244
|
+
{dummyText}
|
|
245
|
+
</DataTab>
|
|
246
|
+
<DataTab tabKey='tab2' title={<Title text='Ø - C02 Emission' value='12,2 kg' />}>
|
|
247
|
+
{dummyText + dummyText}
|
|
248
|
+
</DataTab>
|
|
249
|
+
<DataTab tabKey='tab3' title={<Title text='Ø - Range' value='32,8 l/100' />}>
|
|
250
|
+
{dummyText}
|
|
251
|
+
</DataTab>
|
|
252
|
+
<DataTab tabKey='tab4' title={<Title text='Ø - Route type' value={<RouteType />} />}>
|
|
253
|
+
{dummyText}
|
|
254
|
+
</DataTab>
|
|
255
|
+
</DataTabs>
|
|
256
|
+
</div>
|
|
257
|
+
);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export const Title = ({ text, value }: { text: string; value: React.ReactNode }) => (
|
|
261
|
+
<div>
|
|
262
|
+
<div>{text}</div>
|
|
263
|
+
<div className='text-bold text-size-18'>{value}</div>
|
|
264
|
+
</div>
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
export const RouteType = () => (
|
|
268
|
+
<div>
|
|
269
|
+
<span className='text-color-light'>A</span>
|
|
270
|
+
<span className='text-color-light'>B</span>
|
|
271
|
+
<span className='text-color-light'>C</span>
|
|
272
|
+
<span className='text-color-light'>D</span>
|
|
273
|
+
<span className='text-color-warning'>E</span>
|
|
274
|
+
<span className='text-color-light'>F</span>
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
#### HTML (html)
|
|
280
|
+
|
|
281
|
+
```html
|
|
282
|
+
<div>
|
|
283
|
+
<div class="h6">Vertical layout</div>
|
|
284
|
+
<div class="DataTabsContainer DataTab-bordered DataTabs-vertical">
|
|
285
|
+
<div class="DataTabsWrapper ">
|
|
286
|
+
<ul class="DataTabs" role="tabList">
|
|
287
|
+
<li class="DataTab tab active bg-highlight-dark text-color-white" data-tabkey="tab1">
|
|
288
|
+
<div>
|
|
289
|
+
<div>Ø - Consumption</div>
|
|
290
|
+
<div class="text-bold text-size-18">13,5 km/l</div>
|
|
291
|
+
</div>
|
|
292
|
+
<div class="arrow bg-highlight-dark border-color-transparent in">
|
|
293
|
+
</div>
|
|
294
|
+
</li>
|
|
295
|
+
<li class="DataTab tab cursor-pointer" data-tabkey="tab2">
|
|
296
|
+
<div>
|
|
297
|
+
<div>Ø - C02 Emission</div>
|
|
298
|
+
<div class="text-bold text-size-18">12,2 kg</div>
|
|
299
|
+
</div>
|
|
300
|
+
<div class="arrow bg-highlight-dark border-color-transparent ">
|
|
301
|
+
</div>
|
|
302
|
+
</li>
|
|
303
|
+
<li class="DataTab tab cursor-pointer" data-tabkey="tab3">
|
|
304
|
+
<div>
|
|
305
|
+
<div>Ø - Range</div>
|
|
306
|
+
<div class="text-bold text-size-18">32,8 l/100</div>
|
|
307
|
+
</div>
|
|
308
|
+
<div class="arrow bg-highlight-dark border-color-transparent ">
|
|
309
|
+
</div>
|
|
310
|
+
</li>
|
|
311
|
+
<li class="DataTab tab cursor-pointer" data-tabkey="tab4">
|
|
312
|
+
<div>
|
|
313
|
+
<div>Ø - Route type</div>
|
|
314
|
+
<div class="text-bold text-size-18">
|
|
315
|
+
<div>
|
|
316
|
+
<span class="text-color-light">A</span>
|
|
317
|
+
<span class="text-color-light">B</span>
|
|
318
|
+
<span class="text-color-light">C</span>
|
|
319
|
+
<span class="text-color-light">D</span>
|
|
320
|
+
<span class="text-color-warning">E</span>
|
|
321
|
+
<span class="text-color-light">F</span>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
<div class="arrow bg-highlight-dark border-color-transparent ">
|
|
326
|
+
</div>
|
|
327
|
+
</li>
|
|
328
|
+
</ul>
|
|
329
|
+
</div>
|
|
330
|
+
<div class="tab-content " role="tabpanel">
|
|
331
|
+
<div style="opacity: 1; transform: none;">
|
|
332
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.</div>
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
#### Props: DataTabs
|
|
339
|
+
|
|
340
|
+
### DataTabs
|
|
341
|
+
|
|
342
|
+
| Name | Type | Default | Description |
|
|
343
|
+
| --- | --- | --- | --- |
|
|
344
|
+
| activeKey | String | "" | Sets key and id. |
|
|
345
|
+
| onSelectTab | boolean | () => {} | Called when a tab is being activated. |
|
|
346
|
+
| commonTabContent | ReactNode | — | Tab content that is used for all tabs. Using a common tab content will ignore any DataTab child. Additionally, there will be no transition when switching tabs as it is a single tab content component. |
|
|
347
|
+
| vertical | boolean | false | Whether the layout should be vertical. |
|
|
348
|
+
| bordered | boolean | true | Whether the component should add a border. |
|
|
349
|
+
| disableTransition | boolean | false | Transitions between tab contents are enabled by default. Set if you want to disable them. The Navigation tabs will still remain animated. |
|
|
350
|
+
| className | string | — | Additional classes to be set on the wrapper element. |
|
|
351
|
+
| tabContentClassName | string | — | Additional classes to be set on the tabContent wrapper element. |
|
|
352
|
+
| tabsWrapperClassName | string | — | Additional classes to be set on the tabs wrapper element. |
|
|
353
|
+
| arrowClassName | string | bg-highlight-dark | Additional classes to be set on the arrow. |
|
|
354
|
+
| tabClassName | string | bg-white | Additional classes to be set on the tab element. |
|
|
355
|
+
| tabHoverClassName | string | text-color-darkest | Utility hover classes to be set on the tab element. |
|
|
356
|
+
| tabActiveClassName | string | text-color-darkest | Utility active classes to be set on the tab element. |
|
|
357
|
+
|
|
358
|
+
#### Props: DataTab
|
|
359
|
+
|
|
360
|
+
### DataTab
|
|
361
|
+
|
|
362
|
+
| Name | Type | Default | Description |
|
|
363
|
+
| --- | --- | --- | --- |
|
|
364
|
+
| tabKey | string | — | Used to identify the tab. |
|
|
365
|
+
| title | string \| ReactNode | — | The content for the tab. |
|
|
366
|
+
| active | boolean | — | Whether this tab is the one currently active. |
|
|
367
|
+
| disableTransition | boolean | — | Whether the transition effect should be disabled. |
|
|
368
|
+
| onAnimationStart | VoidFunction | — | Callback for when the animation starts. |
|
|
369
|
+
| onAnimationEnd | VoidFunction | — | Callback for when the animation ends. |
|
|
370
|
+
| className | String | — | Additional classes to be set on the element. |
|
|
371
|
+
|
|
372
|
+
## DataTabs inside an ExpanderPanel and custom color
|
|
373
|
+
|
|
374
|
+
### Example: Example 3
|
|
375
|
+
|
|
376
|
+
DataTabs inside an ExpanderPanel
|
|
377
|
+
Ø - Consumption
|
|
378
|
+
13,5 km/l
|
|
379
|
+
|
|
380
|
+
Ø - C02 Emission
|
|
381
|
+
12,2 kg
|
|
382
|
+
|
|
383
|
+
Ø - Range
|
|
384
|
+
32,8 l/100
|
|
385
|
+
|
|
386
|
+
Ø - Route Type
|
|
387
|
+
ABCDEF
|
|
388
|
+
|
|
389
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.
|
|
390
|
+
|
|
391
|
+
#### Summary
|
|
392
|
+
|
|
393
|
+
DataTabs inside an ExpanderPanel
|
|
394
|
+
Ø - Consumption
|
|
395
|
+
13,5 km/l
|
|
396
|
+
|
|
397
|
+
Ø - C02 Emission
|
|
398
|
+
12,2 kg
|
|
399
|
+
|
|
400
|
+
Ø - Range
|
|
401
|
+
32,8 l/100
|
|
402
|
+
|
|
403
|
+
Ø - Route Type
|
|
404
|
+
ABCDEF
|
|
405
|
+
|
|
406
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.
|
|
407
|
+
|
|
408
|
+
#### React (tsx)
|
|
409
|
+
|
|
410
|
+
```tsx
|
|
411
|
+
import type React from 'react';
|
|
412
|
+
import { useState } from 'react';
|
|
413
|
+
|
|
414
|
+
import ExpanderPanel from '@rio-cloud/rio-uikit/ExpanderPanel';
|
|
415
|
+
import DataTabs from '@rio-cloud/rio-uikit/DataTabs';
|
|
416
|
+
import DataTab from '@rio-cloud/rio-uikit/DataTab';
|
|
417
|
+
import SimpleTooltip from '@rio-cloud/rio-uikit/SimpleTooltip';
|
|
418
|
+
import { dummyText } from '../../../utils/data';
|
|
419
|
+
|
|
420
|
+
export default () => {
|
|
421
|
+
const [tabKey, setTabKey] = useState('tab1');
|
|
422
|
+
|
|
423
|
+
return (
|
|
424
|
+
<ExpanderPanel
|
|
425
|
+
className='shadow-default'
|
|
426
|
+
bodyClassName='padding-0'
|
|
427
|
+
title='DataTabs inside an ExpanderPanel'
|
|
428
|
+
bsStyle='default'
|
|
429
|
+
open
|
|
430
|
+
>
|
|
431
|
+
<DataTabs
|
|
432
|
+
activeKey={tabKey}
|
|
433
|
+
onSelectTab={newTabKey => setTabKey(newTabKey)}
|
|
434
|
+
bordered={false}
|
|
435
|
+
disableTransition
|
|
436
|
+
tabsWrapperClassName='bg-lightest'
|
|
437
|
+
arrowClassName='bg-white border-color-light margin-bottom--1'
|
|
438
|
+
tabClassName='bg-lightest'
|
|
439
|
+
tabHoverClassName='bg-white'
|
|
440
|
+
tabActiveClassName='bg-white'
|
|
441
|
+
tabContentClassName='rounded-bottom bg-lightest'
|
|
442
|
+
>
|
|
443
|
+
<DataTab tabKey='tab1' title={<Title text='Ø - Consumption' value='13,5 km/l' />}>
|
|
444
|
+
{dummyText}
|
|
445
|
+
</DataTab>
|
|
446
|
+
<DataTab tabKey='tab2' title={<Title text='Ø - C02 Emission' value='12,2 kg' />}>
|
|
447
|
+
{dummyText + dummyText}
|
|
448
|
+
</DataTab>
|
|
449
|
+
<DataTab tabKey='tab3' title={<Title text='Ø - Range' value='32,8 l/100' />}>
|
|
450
|
+
{dummyText}
|
|
451
|
+
</DataTab>
|
|
452
|
+
<DataTab tabKey='tab4' title={<Title text='Ø - Route Type' value={<RouteType />} />}>
|
|
453
|
+
{dummyText}
|
|
454
|
+
</DataTab>
|
|
455
|
+
</DataTabs>
|
|
456
|
+
</ExpanderPanel>
|
|
457
|
+
);
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
export const Title = ({ text, value }: { text: string; value: React.ReactNode }) => (
|
|
461
|
+
<div>
|
|
462
|
+
<div>{text}</div>
|
|
463
|
+
|
|
464
|
+
<div className='text-bold text-size-18'>
|
|
465
|
+
<SimpleTooltip content='This is a tooltip inside a DataTab'>
|
|
466
|
+
<span>{value}</span>
|
|
467
|
+
</SimpleTooltip>
|
|
468
|
+
</div>
|
|
469
|
+
</div>
|
|
470
|
+
);
|
|
471
|
+
|
|
472
|
+
export const RouteType = () => (
|
|
473
|
+
<div>
|
|
474
|
+
<span className='text-color-light'>A</span>
|
|
475
|
+
<span className='text-color-light'>B</span>
|
|
476
|
+
<span className='text-color-light'>C</span>
|
|
477
|
+
<span className='text-color-light'>D</span>
|
|
478
|
+
<span className='text-color-warning'>E</span>
|
|
479
|
+
<span className='text-color-light'>F</span>
|
|
480
|
+
</div>
|
|
481
|
+
);
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
#### HTML (html)
|
|
485
|
+
|
|
486
|
+
```html
|
|
487
|
+
<div class="expander-panel panel panel-default shadow-default" aria-label="expander panel">
|
|
488
|
+
<div class="panel-heading open" aria-label="panel heading">
|
|
489
|
+
<span class="title">DataTabs inside an ExpanderPanel</span>
|
|
490
|
+
<span class="expander-icon rioglyph rioglyph-chevron-down">
|
|
491
|
+
</span>
|
|
492
|
+
</div>
|
|
493
|
+
<div class="collapse display-block width-100pct" style="opacity: 1; height: auto;">
|
|
494
|
+
<div>
|
|
495
|
+
<div class="panel-body padding-0">
|
|
496
|
+
<div class="DataTabsContainer DataTabs-horizontal">
|
|
497
|
+
<div class="DataTabsWrapper bg-lightest">
|
|
498
|
+
<ul class="DataTabs" role="tabList">
|
|
499
|
+
<li class="DataTab tab active bg-white" data-tabkey="tab1">
|
|
500
|
+
<div>
|
|
501
|
+
<div>Ø - Consumption</div>
|
|
502
|
+
<div class="text-bold text-size-18">
|
|
503
|
+
<span>13,5 km/l</span>
|
|
504
|
+
</div>
|
|
505
|
+
</div>
|
|
506
|
+
<div class="arrow bg-white border-color-light margin-bottom--1 in">
|
|
507
|
+
</div>
|
|
508
|
+
</li>
|
|
509
|
+
<li class="DataTab tab bg-lightest cursor-pointer" data-tabkey="tab2">
|
|
510
|
+
<div>
|
|
511
|
+
<div>Ø - C02 Emission</div>
|
|
512
|
+
<div class="text-bold text-size-18">
|
|
513
|
+
<span>12,2 kg</span>
|
|
514
|
+
</div>
|
|
515
|
+
</div>
|
|
516
|
+
<div class="arrow bg-white border-color-light margin-bottom--1 ">
|
|
517
|
+
</div>
|
|
518
|
+
</li>
|
|
519
|
+
<li class="DataTab tab bg-lightest cursor-pointer" data-tabkey="tab3">
|
|
520
|
+
<div>
|
|
521
|
+
<div>Ø - Range</div>
|
|
522
|
+
<div class="text-bold text-size-18">
|
|
523
|
+
<span>32,8 l/100</span>
|
|
524
|
+
</div>
|
|
525
|
+
</div>
|
|
526
|
+
<div class="arrow bg-white border-color-light margin-bottom--1 ">
|
|
527
|
+
</div>
|
|
528
|
+
</li>
|
|
529
|
+
<li class="DataTab tab bg-lightest cursor-pointer" data-tabkey="tab4">
|
|
530
|
+
<div>
|
|
531
|
+
<div>Ø - Route Type</div>
|
|
532
|
+
<div class="text-bold text-size-18">
|
|
533
|
+
<span>
|
|
534
|
+
<div>
|
|
535
|
+
<span class="text-color-light">A</span>
|
|
536
|
+
<span class="text-color-light">B</span>
|
|
537
|
+
<span class="text-color-light">C</span>
|
|
538
|
+
<span class="text-color-light">D</span>
|
|
539
|
+
<span class="text-color-warning">E</span>
|
|
540
|
+
<span class="text-color-light">F</span>
|
|
541
|
+
</div>
|
|
542
|
+
</span>
|
|
543
|
+
</div>
|
|
544
|
+
</div>
|
|
545
|
+
<div class="arrow bg-white border-color-light margin-bottom--1 ">
|
|
546
|
+
</div>
|
|
547
|
+
</li>
|
|
548
|
+
</ul>
|
|
549
|
+
</div>
|
|
550
|
+
<div class="tab-content rounded-bottom bg-lightest" role="tabpanel">
|
|
551
|
+
<div>
|
|
552
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.</div>
|
|
553
|
+
<div>
|
|
554
|
+
</div>
|
|
555
|
+
<div>
|
|
556
|
+
</div>
|
|
557
|
+
<div>
|
|
558
|
+
</div>
|
|
559
|
+
</div>
|
|
560
|
+
</div>
|
|
561
|
+
</div>
|
|
562
|
+
</div>
|
|
563
|
+
</div>
|
|
564
|
+
</div>
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
#### Props: DataTabs
|
|
568
|
+
|
|
569
|
+
### DataTabs
|
|
570
|
+
|
|
571
|
+
| Name | Type | Default | Description |
|
|
572
|
+
| --- | --- | --- | --- |
|
|
573
|
+
| activeKey | String | "" | Sets key and id. |
|
|
574
|
+
| onSelectTab | boolean | () => {} | Called when a tab is being activated. |
|
|
575
|
+
| commonTabContent | ReactNode | — | Tab content that is used for all tabs. Using a common tab content will ignore any DataTab child. Additionally, there will be no transition when switching tabs as it is a single tab content component. |
|
|
576
|
+
| vertical | boolean | false | Whether the layout should be vertical. |
|
|
577
|
+
| bordered | boolean | true | Whether the component should add a border. |
|
|
578
|
+
| disableTransition | boolean | false | Transitions between tab contents are enabled by default. Set if you want to disable them. The Navigation tabs will still remain animated. |
|
|
579
|
+
| className | string | — | Additional classes to be set on the wrapper element. |
|
|
580
|
+
| tabContentClassName | string | — | Additional classes to be set on the tabContent wrapper element. |
|
|
581
|
+
| tabsWrapperClassName | string | — | Additional classes to be set on the tabs wrapper element. |
|
|
582
|
+
| arrowClassName | string | bg-highlight-dark | Additional classes to be set on the arrow. |
|
|
583
|
+
| tabClassName | string | bg-white | Additional classes to be set on the tab element. |
|
|
584
|
+
| tabHoverClassName | string | text-color-darkest | Utility hover classes to be set on the tab element. |
|
|
585
|
+
| tabActiveClassName | string | text-color-darkest | Utility active classes to be set on the tab element. |
|
|
586
|
+
|
|
587
|
+
#### Props: DataTab
|
|
588
|
+
|
|
589
|
+
### DataTab
|
|
590
|
+
|
|
591
|
+
| Name | Type | Default | Description |
|
|
592
|
+
| --- | --- | --- | --- |
|
|
593
|
+
| tabKey | string | — | Used to identify the tab. |
|
|
594
|
+
| title | string \| ReactNode | — | The content for the tab. |
|
|
595
|
+
| active | boolean | — | Whether this tab is the one currently active. |
|
|
596
|
+
| disableTransition | boolean | — | Whether the transition effect should be disabled. |
|
|
597
|
+
| onAnimationStart | VoidFunction | — | Callback for when the animation starts. |
|
|
598
|
+
| onAnimationEnd | VoidFunction | — | Callback for when the animation ends. |
|
|
599
|
+
| className | String | — | Additional classes to be set on the element. |
|
|
600
|
+
|
|
601
|
+
## DataTabs with shared common tab content and custom styling
|
|
602
|
+
|
|
603
|
+
### Example: Example 4
|
|
604
|
+
|
|
605
|
+
DataTabs inside an ExpanderPanel with one common tab content
|
|
606
|
+
Ø - Consumption
|
|
607
|
+
13,5 km/l
|
|
608
|
+
|
|
609
|
+
Ø - C02 Emission
|
|
610
|
+
12,2 kg
|
|
611
|
+
|
|
612
|
+
Ø - Range
|
|
613
|
+
32,8 l/100
|
|
614
|
+
|
|
615
|
+
Ø - Route type
|
|
616
|
+
ABCDEF
|
|
617
|
+
|
|
618
|
+
Page APage BPage CPage DPage EPage FPage G
|
|
619
|
+
|
|
620
|
+
The padding can be changes on demand by passing in util classes via "tabContentClassName" prop.
|
|
621
|
+
|
|
622
|
+
Hide last tab
|
|
623
|
+
|
|
624
|
+
#### Summary
|
|
625
|
+
|
|
626
|
+
DataTabs inside an ExpanderPanel with one common tab content
|
|
627
|
+
Ø - Consumption
|
|
628
|
+
13,5 km/l
|
|
629
|
+
|
|
630
|
+
Ø - C02 Emission
|
|
631
|
+
12,2 kg
|
|
632
|
+
|
|
633
|
+
Ø - Range
|
|
634
|
+
32,8 l/100
|
|
635
|
+
|
|
636
|
+
Ø - Route type
|
|
637
|
+
ABCDEF
|
|
638
|
+
|
|
639
|
+
Page APage BPage CPage DPage EPage FPage G
|
|
640
|
+
|
|
641
|
+
The padding can be changes on demand by passing in util classes via "tabContentClassName" prop.
|
|
642
|
+
|
|
643
|
+
Hide last tab
|
|
644
|
+
|
|
645
|
+
#### React (tsx)
|
|
646
|
+
|
|
647
|
+
```tsx
|
|
648
|
+
/* eslint-disable max-len */
|
|
649
|
+
import type React from 'react';
|
|
650
|
+
import { useState } from 'react';
|
|
651
|
+
import faker from 'faker';
|
|
652
|
+
|
|
653
|
+
import ExpanderPanel from '@rio-cloud/rio-uikit/ExpanderPanel';
|
|
654
|
+
import DataTabs from '@rio-cloud/rio-uikit/DataTabs';
|
|
655
|
+
import DataTab from '@rio-cloud/rio-uikit/DataTab';
|
|
656
|
+
import ToggleButton from '@rio-cloud/rio-uikit/ToggleButton';
|
|
657
|
+
import LineChart from '@rio-cloud/rio-uikit/components/charts/LineChart';
|
|
658
|
+
import Line from '@rio-cloud/rio-uikit/components/charts/Line';
|
|
659
|
+
import { dummyText } from '../../../utils/data';
|
|
660
|
+
|
|
661
|
+
type DummyItem = { name: string; value: number };
|
|
662
|
+
|
|
663
|
+
const getData = (): DummyItem[] =>
|
|
664
|
+
['Page A', 'Page B', 'Page C', 'Page D', 'Page E', 'Page F', 'Page G'].map(item => ({
|
|
665
|
+
name: item,
|
|
666
|
+
value: faker.random.arrayElement([3200, 3000, 2000, 2780, 1890, 2390, 3490]),
|
|
667
|
+
}));
|
|
668
|
+
|
|
669
|
+
const DummyContent = ({ tabKey }: { tabKey: string }) => (
|
|
670
|
+
<div>
|
|
671
|
+
<div className='padding-left-15 padding-right-15'>
|
|
672
|
+
{tabKey === 'tab3' && dummyText}
|
|
673
|
+
<div className='height-200 max-width-500'>
|
|
674
|
+
<LineChart
|
|
675
|
+
data={getData()}
|
|
676
|
+
dataKey={(entry: DummyItem) => entry.name}
|
|
677
|
+
xAxisOptions={{ padding: { left: 30, right: 30 } }}
|
|
678
|
+
showGrid
|
|
679
|
+
gridOptions={{ vertical: false, strokeDasharray: '0', stroke: 'gray-lighter' }}
|
|
680
|
+
lines={[<Line key='line' dataKey={(entry: DummyItem) => `${entry.value}`} />]}
|
|
681
|
+
/>
|
|
682
|
+
</div>
|
|
683
|
+
</div>
|
|
684
|
+
<hr />
|
|
685
|
+
<div className='padding-left-15 padding-right-15'>
|
|
686
|
+
<span className={tabKey === 'tab2' ? 'text-medium text-color-darker' : ''}>
|
|
687
|
+
The padding can be changes on demand by passing in util classes via "tabContentClassName" prop.
|
|
688
|
+
</span>
|
|
689
|
+
</div>
|
|
690
|
+
</div>
|
|
691
|
+
);
|
|
692
|
+
|
|
693
|
+
export default () => {
|
|
694
|
+
const [tabKey, setTabKey] = useState('tab1');
|
|
695
|
+
const [hideLastTab, setHideLastTab] = useState(false);
|
|
696
|
+
|
|
697
|
+
const handleHideLastTab = () => {
|
|
698
|
+
setHideLastTab(!hideLastTab);
|
|
699
|
+
setTabKey('tab1');
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
return (
|
|
703
|
+
<>
|
|
704
|
+
<ExpanderPanel
|
|
705
|
+
className='shadow-default'
|
|
706
|
+
bodyClassName='padding-0'
|
|
707
|
+
title='DataTabs inside an ExpanderPanel with one common tab content'
|
|
708
|
+
bsStyle='default'
|
|
709
|
+
open
|
|
710
|
+
>
|
|
711
|
+
<DataTabs
|
|
712
|
+
activeKey={tabKey}
|
|
713
|
+
bordered={false}
|
|
714
|
+
disableTransition={false}
|
|
715
|
+
commonTabContent={<DummyContent tabKey={tabKey} />}
|
|
716
|
+
onSelectTab={newTabKey => setTabKey(newTabKey)}
|
|
717
|
+
tabsWrapperClassName='bg-white'
|
|
718
|
+
tabClassName='bg-lighter opacity-50 border border-color-transparent padding-y-5'
|
|
719
|
+
tabHoverClassName='bg-lightest opacity-100 border border-color-transparent padding-y-5'
|
|
720
|
+
tabActiveClassName='bg-white text-color-primary opacity-100 margin-bottom--1 border border-top-none border-bottom-none margin-top-1 padding-y-5'
|
|
721
|
+
tabContentClassName='padding-left-0 padding-right-0'
|
|
722
|
+
arrowClassName='left-10 right-10 width-auto bg-primary rotate-0 height-2 bottom-0'
|
|
723
|
+
>
|
|
724
|
+
<DataTab
|
|
725
|
+
tabKey='tab1'
|
|
726
|
+
className='border-left-none'
|
|
727
|
+
title={<Title text='Ø - Consumption' value='13,5 km/l' />}
|
|
728
|
+
/>
|
|
729
|
+
<DataTab tabKey='tab2' title={<Title text='Ø - C02 Emission' value='12,2 kg' />} />
|
|
730
|
+
<DataTab tabKey='tab3' title={<Title text='Ø - Range' value='32,8 l/100' />} />
|
|
731
|
+
{!hideLastTab && (
|
|
732
|
+
<DataTab
|
|
733
|
+
tabKey='tab4'
|
|
734
|
+
className='border-right-none'
|
|
735
|
+
title={<Title text='Ø - Route type' value={<RouteType />} />}
|
|
736
|
+
/>
|
|
737
|
+
)}
|
|
738
|
+
</DataTabs>
|
|
739
|
+
</ExpanderPanel>
|
|
740
|
+
<ToggleButton onClick={handleHideLastTab}>Hide last tab</ToggleButton>
|
|
741
|
+
</>
|
|
742
|
+
);
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
export const Title = ({ text, value }: { text: string; value: React.ReactNode }) => (
|
|
746
|
+
<div>
|
|
747
|
+
<div>{text}</div>
|
|
748
|
+
<div className='text-bold text-size-18'>{value}</div>
|
|
749
|
+
</div>
|
|
750
|
+
);
|
|
751
|
+
|
|
752
|
+
export const RouteType = () => (
|
|
753
|
+
<div>
|
|
754
|
+
<span className='text-color-light'>A</span>
|
|
755
|
+
<span className='text-color-light'>B</span>
|
|
756
|
+
<span className='text-color-light'>C</span>
|
|
757
|
+
<span className='text-color-light'>D</span>
|
|
758
|
+
<span className='text-color-warning'>E</span>
|
|
759
|
+
<span className='text-color-light'>F</span>
|
|
760
|
+
</div>
|
|
761
|
+
);
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
#### HTML (html)
|
|
765
|
+
|
|
766
|
+
```html
|
|
767
|
+
<div class="expander-panel panel panel-default shadow-default" aria-label="expander panel">
|
|
768
|
+
<div class="panel-heading open" aria-label="panel heading">
|
|
769
|
+
<span class="title">DataTabs inside an ExpanderPanel with one common tab content</span>
|
|
770
|
+
<span class="expander-icon rioglyph rioglyph-chevron-down">
|
|
771
|
+
</span>
|
|
772
|
+
</div>
|
|
773
|
+
<div class="collapse display-block width-100pct" style="opacity: 1; height: auto;">
|
|
774
|
+
<div>
|
|
775
|
+
<div class="panel-body padding-0">
|
|
776
|
+
<div class="DataTabsContainer DataTabs-horizontal">
|
|
777
|
+
<div class="DataTabsWrapper bg-white">
|
|
778
|
+
<ul class="DataTabs" role="tabList">
|
|
779
|
+
<li class="DataTab tab active bg-white text-color-primary opacity-100 margin-bottom--1 border border-top-none border-bottom-none margin-top-1 padding-y-5 border-left-none" data-tabkey="tab1">
|
|
780
|
+
<div>
|
|
781
|
+
<div>Ø - Consumption</div>
|
|
782
|
+
<div class="text-bold text-size-18">13,5 km/l</div>
|
|
783
|
+
</div>
|
|
784
|
+
<div class="arrow left-10 right-10 width-auto bg-primary rotate-0 height-2 bottom-0 in">
|
|
785
|
+
</div>
|
|
786
|
+
</li>
|
|
787
|
+
<li class="DataTab tab bg-lighter opacity-50 border border-color-transparent padding-y-5 cursor-pointer" data-tabkey="tab2">
|
|
788
|
+
<div>
|
|
789
|
+
<div>Ø - C02 Emission</div>
|
|
790
|
+
<div class="text-bold text-size-18">12,2 kg</div>
|
|
791
|
+
</div>
|
|
792
|
+
<div class="arrow left-10 right-10 width-auto bg-primary rotate-0 height-2 bottom-0 ">
|
|
793
|
+
</div>
|
|
794
|
+
</li>
|
|
795
|
+
<li class="DataTab tab bg-lighter opacity-50 border border-color-transparent padding-y-5 cursor-pointer" data-tabkey="tab3">
|
|
796
|
+
<div>
|
|
797
|
+
<div>Ø - Range</div>
|
|
798
|
+
<div class="text-bold text-size-18">32,8 l/100</div>
|
|
799
|
+
</div>
|
|
800
|
+
<div class="arrow left-10 right-10 width-auto bg-primary rotate-0 height-2 bottom-0 ">
|
|
801
|
+
</div>
|
|
802
|
+
</li>
|
|
803
|
+
<li class="DataTab tab bg-lighter opacity-50 border border-color-transparent padding-y-5 cursor-pointer border-right-none" data-tabkey="tab4">
|
|
804
|
+
<div>
|
|
805
|
+
<div>Ø - Route type</div>
|
|
806
|
+
<div class="text-bold text-size-18">
|
|
807
|
+
<div>
|
|
808
|
+
<span class="text-color-light">A</span>
|
|
809
|
+
<span class="text-color-light">B</span>
|
|
810
|
+
<span class="text-color-light">C</span>
|
|
811
|
+
<span class="text-color-light">D</span>
|
|
812
|
+
<span class="text-color-warning">E</span>
|
|
813
|
+
<span class="text-color-light">F</span>
|
|
814
|
+
</div>
|
|
815
|
+
</div>
|
|
816
|
+
</div>
|
|
817
|
+
<div class="arrow left-10 right-10 width-auto bg-primary rotate-0 height-2 bottom-0 ">
|
|
818
|
+
</div>
|
|
819
|
+
</li>
|
|
820
|
+
</ul>
|
|
821
|
+
</div>
|
|
822
|
+
<div class="tab-content padding-left-0 padding-right-0" role="tabpanel">
|
|
823
|
+
<div>
|
|
824
|
+
<div class="padding-left-15 padding-right-15">
|
|
825
|
+
<div class="height-200 max-width-500">
|
|
826
|
+
<div class="recharts-responsive-container" style="width: 100%; height: 100%; min-width: 100px; min-height: 100px;">
|
|
827
|
+
<div style="width: 0px; height: 0px; overflow: visible;">
|
|
828
|
+
<div width="500" height="200" class="recharts-wrapper" style="position: relative; cursor: default; width: 500px; height: 200px;">
|
|
829
|
+
<div xmlns="http://www.w3.org/1999/xhtml" tabindex="-1" class="recharts-tooltip-wrapper" style="visibility: hidden; pointer-events: none; position: absolute; top: 0px; left: 0px;">
|
|
830
|
+
<div class="recharts-default-tooltip" role="status" aria-live="assertive" style="margin: 0px; padding: 10px; background-color: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204); white-space: nowrap;">
|
|
831
|
+
<p class="recharts-tooltip-label" style="margin: 0px;">
|
|
832
|
+
</p>
|
|
833
|
+
</div>
|
|
834
|
+
</div>
|
|
835
|
+
<svg role="application" tabindex="0" class="recharts-surface" width="500" height="200" viewBox="0 0 500 200" style="width: 100%; height: 100%; display: block;">
|
|
836
|
+
<title>
|
|
837
|
+
</title>
|
|
838
|
+
<desc>
|
|
839
|
+
</desc>
|
|
840
|
+
<g tabindex="-1" id="recharts-zindex--100-:r5:">
|
|
841
|
+
<g class="recharts-cartesian-grid">
|
|
842
|
+
<g class="recharts-cartesian-grid-horizontal">
|
|
843
|
+
<line stroke-dasharray="0" stroke="#e5ebf0 " fill="none" x="15" y="15" width="470" height="140" x1="15" y1="155" x2="485" y2="155">
|
|
844
|
+
</line>
|
|
845
|
+
<line stroke-dasharray="0" stroke="#e5ebf0 " fill="none" x="15" y="15" width="470" height="140" x1="15" y1="120" x2="485" y2="120">
|
|
846
|
+
</line>
|
|
847
|
+
<line stroke-dasharray="0" stroke="#e5ebf0 " fill="none" x="15" y="15" width="470" height="140" x1="15" y1="85" x2="485" y2="85">
|
|
848
|
+
</line>
|
|
849
|
+
<line stroke-dasharray="0" stroke="#e5ebf0 " fill="none" x="15" y="15" width="470" height="140" x1="15" y1="50" x2="485" y2="50">
|
|
850
|
+
</line>
|
|
851
|
+
<line stroke-dasharray="0" stroke="#e5ebf0 " fill="none" x="15" y="15" width="470" height="140" x1="15" y1="15" x2="485" y2="15">
|
|
852
|
+
</line>
|
|
853
|
+
</g>
|
|
854
|
+
</g>
|
|
855
|
+
</g>
|
|
856
|
+
<g tabindex="-1" id="recharts-zindex--50-:r6:">
|
|
857
|
+
</g>
|
|
858
|
+
<defs>
|
|
859
|
+
<clipPath id="recharts1-clip">
|
|
860
|
+
<rect x="15" y="15" height="140" width="470">
|
|
861
|
+
</rect>
|
|
862
|
+
</clipPath>
|
|
863
|
+
</defs>
|
|
864
|
+
<g tabindex="-1" id="recharts-zindex-100-:r8:">
|
|
865
|
+
</g>
|
|
866
|
+
<g tabindex="-1" id="recharts-zindex-200-:r9:">
|
|
867
|
+
</g>
|
|
868
|
+
<g tabindex="-1" id="recharts-zindex-300-:ra:">
|
|
869
|
+
</g>
|
|
870
|
+
<g tabindex="-1" id="recharts-zindex-400-:rb:">
|
|
871
|
+
<g class="recharts-layer recharts-line">
|
|
872
|
+
<path stroke="#67abc5 " fill="none" stroke-width="1" id="recharts-line-:r7:" height="140" width="470" class="recharts-curve recharts-line-curve" stroke-dasharray="468.18389892578125px 0px" d="M45,30.556C67.778,53.889,90.556,77.222,113.333,77.222C136.111,77.222,158.889,62.056,181.667,62.056C204.444,62.056,227.222,62.056,250,62.056C272.778,62.056,295.556,19.278,318.333,19.278C341.111,19.278,363.889,77.222,386.667,77.222C409.444,77.222,432.222,69.639,455,62.056">
|
|
873
|
+
</path>
|
|
874
|
+
</g>
|
|
875
|
+
</g>
|
|
876
|
+
<g tabindex="-1" id="recharts-zindex-500-:rc:">
|
|
877
|
+
<g class="recharts-layer recharts-cartesian-axis recharts-xAxis xAxis">
|
|
878
|
+
<line angle="0" height="30" orientation="bottom" x="15" y="155" width="470" class="recharts-cartesian-axis-line" stroke="#666" fill="none" x1="15" y1="155" x2="485" y2="155">
|
|
879
|
+
</line>
|
|
880
|
+
<g class="recharts-cartesian-axis-ticks recharts-xAxis-ticks">
|
|
881
|
+
<g class="recharts-cartesian-axis-tick-lines recharts-xAxis-tick-lines">
|
|
882
|
+
<g class="recharts-layer recharts-cartesian-axis-tick">
|
|
883
|
+
<line angle="0" height="30" orientation="bottom" x="15" y="155" width="470" class="recharts-cartesian-axis-tick-line" stroke="#666" fill="none" x1="45" y1="161" x2="45" y2="155">
|
|
884
|
+
</line>
|
|
885
|
+
</g>
|
|
886
|
+
<g class="recharts-layer recharts-cartesian-axis-tick">
|
|
887
|
+
<line angle="0" height="30" orientation="bottom" x="15" y="155" width="470" class="recharts-cartesian-axis-tick-line" stroke="#666" fill="none" x1="113.33333333333333" y1="161" x2="113.33333333333333" y2="155">
|
|
888
|
+
</line>
|
|
889
|
+
</g>
|
|
890
|
+
<g class="recharts-layer recharts-cartesian-axis-tick">
|
|
891
|
+
<line angle="0" height="30" orientation="bottom" x="15" y="155" width="470" class="recharts-cartesian-axis-tick-line" stroke="#666" fill="none" x1="181.66666666666666" y1="161" x2="181.66666666666666" y2="155">
|
|
892
|
+
</line>
|
|
893
|
+
</g>
|
|
894
|
+
<g class="recharts-layer recharts-cartesian-axis-tick">
|
|
895
|
+
<line angle="0" height="30" orientation="bottom" x="15" y="155" width="470" class="recharts-cartesian-axis-tick-line" stroke="#666" fill="none" x1="250" y1="161" x2="250" y2="155">
|
|
896
|
+
</line>
|
|
897
|
+
</g>
|
|
898
|
+
<g class="recharts-layer recharts-cartesian-axis-tick">
|
|
899
|
+
<line angle="0" height="30" orientation="bottom" x="15" y="155" width="470" class="recharts-cartesian-axis-tick-line" stroke="#666" fill="none" x1="318.3333333333333" y1="161" x2="318.3333333333333" y2="155">
|
|
900
|
+
</line>
|
|
901
|
+
</g>
|
|
902
|
+
<g class="recharts-layer recharts-cartesian-axis-tick">
|
|
903
|
+
<line angle="0" height="30" orientation="bottom" x="15" y="155" width="470" class="recharts-cartesian-axis-tick-line" stroke="#666" fill="none" x1="386.66666666666663" y1="161" x2="386.66666666666663" y2="155">
|
|
904
|
+
</line>
|
|
905
|
+
</g>
|
|
906
|
+
<g class="recharts-layer recharts-cartesian-axis-tick">
|
|
907
|
+
<line angle="0" height="30" orientation="bottom" x="15" y="155" width="470" class="recharts-cartesian-axis-tick-line" stroke="#666" fill="none" x1="455" y1="161" x2="455" y2="155">
|
|
908
|
+
</line>
|
|
909
|
+
</g>
|
|
910
|
+
</g>
|
|
911
|
+
</g>
|
|
912
|
+
</g>
|
|
913
|
+
</g>
|
|
914
|
+
<g tabindex="-1" id="recharts-zindex-600-:rd:">
|
|
915
|
+
<g class="recharts-layer recharts-line-dots">
|
|
916
|
+
<circle r="3" stroke="#67abc5 " fill="#fff" stroke-width="1" height="140" width="470" cx="45" cy="30.55555555555556" class="recharts-dot recharts-line-dot">
|
|
917
|
+
</circle>
|
|
918
|
+
<circle r="3" stroke="#67abc5 " fill="#fff" stroke-width="1" height="140" width="470" cx="113.33333333333333" cy="77.22222222222221" class="recharts-dot recharts-line-dot">
|
|
919
|
+
</circle>
|
|
920
|
+
<circle r="3" stroke="#67abc5 " fill="#fff" stroke-width="1" height="140" width="470" cx="181.66666666666666" cy="62.05555555555556" class="recharts-dot recharts-line-dot">
|
|
921
|
+
</circle>
|
|
922
|
+
<circle r="3" stroke="#67abc5 " fill="#fff" stroke-width="1" height="140" width="470" cx="250" cy="62.05555555555556" class="recharts-dot recharts-line-dot">
|
|
923
|
+
</circle>
|
|
924
|
+
<circle r="3" stroke="#67abc5 " fill="#fff" stroke-width="1" height="140" width="470" cx="318.3333333333333" cy="19.27777777777778" class="recharts-dot recharts-line-dot">
|
|
925
|
+
</circle>
|
|
926
|
+
<circle r="3" stroke="#67abc5 " fill="#fff" stroke-width="1" height="140" width="470" cx="386.66666666666663" cy="77.22222222222221" class="recharts-dot recharts-line-dot">
|
|
927
|
+
</circle>
|
|
928
|
+
<circle r="3" stroke="#67abc5 " fill="#fff" stroke-width="1" height="140" width="470" cx="455" cy="62.05555555555556" class="recharts-dot recharts-line-dot">
|
|
929
|
+
</circle>
|
|
930
|
+
</g>
|
|
931
|
+
</g>
|
|
932
|
+
<g tabindex="-1" id="recharts-zindex-1000-:re:">
|
|
933
|
+
</g>
|
|
934
|
+
<g tabindex="-1" id="recharts-zindex-1100-:rf:">
|
|
935
|
+
</g>
|
|
936
|
+
<g tabindex="-1" id="recharts-zindex-1200-:rg:">
|
|
937
|
+
</g>
|
|
938
|
+
<g tabindex="-1" id="recharts-zindex-2000-:rh:">
|
|
939
|
+
<g class="recharts-cartesian-axis-tick-labels recharts-xAxis-tick-labels">
|
|
940
|
+
<g class="recharts-layer recharts-cartesian-axis-tick-label">
|
|
941
|
+
<text height="30" orientation="bottom" width="470" stroke="none" x="45" y="163" class="recharts-text recharts-cartesian-axis-tick-value" text-anchor="middle" fill="#666">
|
|
942
|
+
<tspan x="45" dy="0.71em">Page A</tspan>
|
|
943
|
+
</text>
|
|
944
|
+
</g>
|
|
945
|
+
<g class="recharts-layer recharts-cartesian-axis-tick-label">
|
|
946
|
+
<text height="30" orientation="bottom" width="470" stroke="none" x="113.33333333333333" y="163" class="recharts-text recharts-cartesian-axis-tick-value" text-anchor="middle" fill="#666">
|
|
947
|
+
<tspan x="113.33333333333333" dy="0.71em">Page B</tspan>
|
|
948
|
+
</text>
|
|
949
|
+
</g>
|
|
950
|
+
<g class="recharts-layer recharts-cartesian-axis-tick-label">
|
|
951
|
+
<text height="30" orientation="bottom" width="470" stroke="none" x="181.66666666666666" y="163" class="recharts-text recharts-cartesian-axis-tick-value" text-anchor="middle" fill="#666">
|
|
952
|
+
<tspan x="181.66666666666666" dy="0.71em">Page C</tspan>
|
|
953
|
+
</text>
|
|
954
|
+
</g>
|
|
955
|
+
<g class="recharts-layer recharts-cartesian-axis-tick-label">
|
|
956
|
+
<text height="30" orientation="bottom" width="470" stroke="none" x="250" y="163" class="recharts-text recharts-cartesian-axis-tick-value" text-anchor="middle" fill="#666">
|
|
957
|
+
<tspan x="250" dy="0.71em">Page D</tspan>
|
|
958
|
+
</text>
|
|
959
|
+
</g>
|
|
960
|
+
<g class="recharts-layer recharts-cartesian-axis-tick-label">
|
|
961
|
+
<text height="30" orientation="bottom" width="470" stroke="none" x="318.3333333333333" y="163" class="recharts-text recharts-cartesian-axis-tick-value" text-anchor="middle" fill="#666">
|
|
962
|
+
<tspan x="318.3333333333333" dy="0.71em">Page E</tspan>
|
|
963
|
+
</text>
|
|
964
|
+
</g>
|
|
965
|
+
<g class="recharts-layer recharts-cartesian-axis-tick-label">
|
|
966
|
+
<text height="30" orientation="bottom" width="470" stroke="none" x="386.66666666666663" y="163" class="recharts-text recharts-cartesian-axis-tick-value" text-anchor="middle" fill="#666">
|
|
967
|
+
<tspan x="386.66666666666663" dy="0.71em">Page F</tspan>
|
|
968
|
+
</text>
|
|
969
|
+
</g>
|
|
970
|
+
<g class="recharts-layer recharts-cartesian-axis-tick-label">
|
|
971
|
+
<text height="30" orientation="bottom" width="470" stroke="none" x="455" y="163" class="recharts-text recharts-cartesian-axis-tick-value" text-anchor="middle" fill="#666">
|
|
972
|
+
<tspan x="455" dy="0.71em">Page G</tspan>
|
|
973
|
+
</text>
|
|
974
|
+
</g>
|
|
975
|
+
</g>
|
|
976
|
+
</g>
|
|
977
|
+
</svg>
|
|
978
|
+
</div>
|
|
979
|
+
</div>
|
|
980
|
+
</div>
|
|
981
|
+
</div>
|
|
982
|
+
</div>
|
|
983
|
+
<hr>
|
|
984
|
+
<div class="padding-left-15 padding-right-15">
|
|
985
|
+
<span class="">The padding can be changes on demand by passing in util classes via "tabContentClassName" prop.</span>
|
|
986
|
+
</div>
|
|
987
|
+
</div>
|
|
988
|
+
</div>
|
|
989
|
+
</div>
|
|
990
|
+
</div>
|
|
991
|
+
</div>
|
|
992
|
+
</div>
|
|
993
|
+
</div>
|
|
994
|
+
<button type="button" class="btn btn-default btn-toggle btn-component" tabindex="0">Hide last tab</button>
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
#### Props: DataTabs
|
|
998
|
+
|
|
999
|
+
### DataTabs
|
|
1000
|
+
|
|
1001
|
+
| Name | Type | Default | Description |
|
|
1002
|
+
| --- | --- | --- | --- |
|
|
1003
|
+
| activeKey | String | "" | Sets key and id. |
|
|
1004
|
+
| onSelectTab | boolean | () => {} | Called when a tab is being activated. |
|
|
1005
|
+
| commonTabContent | ReactNode | — | Tab content that is used for all tabs. Using a common tab content will ignore any DataTab child. Additionally, there will be no transition when switching tabs as it is a single tab content component. |
|
|
1006
|
+
| vertical | boolean | false | Whether the layout should be vertical. |
|
|
1007
|
+
| bordered | boolean | true | Whether the component should add a border. |
|
|
1008
|
+
| disableTransition | boolean | false | Transitions between tab contents are enabled by default. Set if you want to disable them. The Navigation tabs will still remain animated. |
|
|
1009
|
+
| className | string | — | Additional classes to be set on the wrapper element. |
|
|
1010
|
+
| tabContentClassName | string | — | Additional classes to be set on the tabContent wrapper element. |
|
|
1011
|
+
| tabsWrapperClassName | string | — | Additional classes to be set on the tabs wrapper element. |
|
|
1012
|
+
| arrowClassName | string | bg-highlight-dark | Additional classes to be set on the arrow. |
|
|
1013
|
+
| tabClassName | string | bg-white | Additional classes to be set on the tab element. |
|
|
1014
|
+
| tabHoverClassName | string | text-color-darkest | Utility hover classes to be set on the tab element. |
|
|
1015
|
+
| tabActiveClassName | string | text-color-darkest | Utility active classes to be set on the tab element. |
|
|
1016
|
+
|
|
1017
|
+
#### Props: DataTab
|
|
1018
|
+
|
|
1019
|
+
### DataTab
|
|
1020
|
+
|
|
1021
|
+
| Name | Type | Default | Description |
|
|
1022
|
+
| --- | --- | --- | --- |
|
|
1023
|
+
| tabKey | string | — | Used to identify the tab. |
|
|
1024
|
+
| title | string \| ReactNode | — | The content for the tab. |
|
|
1025
|
+
| active | boolean | — | Whether this tab is the one currently active. |
|
|
1026
|
+
| disableTransition | boolean | — | Whether the transition effect should be disabled. |
|
|
1027
|
+
| onAnimationStart | VoidFunction | — | Callback for when the animation starts. |
|
|
1028
|
+
| onAnimationEnd | VoidFunction | — | Callback for when the animation ends. |
|
|
1029
|
+
| className | String | — | Additional classes to be set on the element. |
|
|
1030
|
+
|
|
1031
|
+
### Example: Example 5
|
|
1032
|
+
|
|
1033
|
+
Data Set 1Data Set 2
|
|
1034
|
+
Ø - Consumption
|
|
1035
|
+
13,5 km/l
|
|
1036
|
+
|
|
1037
|
+
Ø - C02 Emission
|
|
1038
|
+
12,2 kg
|
|
1039
|
+
|
|
1040
|
+
Ø - Range
|
|
1041
|
+
32,8 l/100
|
|
1042
|
+
|
|
1043
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.
|
|
1044
|
+
|
|
1045
|
+
#### Summary
|
|
1046
|
+
|
|
1047
|
+
Data Set 1Data Set 2
|
|
1048
|
+
Ø - Consumption
|
|
1049
|
+
13,5 km/l
|
|
1050
|
+
|
|
1051
|
+
Ø - C02 Emission
|
|
1052
|
+
12,2 kg
|
|
1053
|
+
|
|
1054
|
+
Ø - Range
|
|
1055
|
+
32,8 l/100
|
|
1056
|
+
|
|
1057
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.
|
|
1058
|
+
|
|
1059
|
+
#### React (tsx)
|
|
1060
|
+
|
|
1061
|
+
```tsx
|
|
1062
|
+
/* eslint-disable max-len */
|
|
1063
|
+
import type React from 'react';
|
|
1064
|
+
import { useState } from 'react';
|
|
1065
|
+
|
|
1066
|
+
import DataTabs from '@rio-cloud/rio-uikit/DataTabs';
|
|
1067
|
+
import DataTab from '@rio-cloud/rio-uikit/DataTab';
|
|
1068
|
+
import Button from '@rio-cloud/rio-uikit/Button';
|
|
1069
|
+
import { dummyText, dummyTextExtraLong, dummyTextLong, dummyTextShort } from '../../../utils/data';
|
|
1070
|
+
|
|
1071
|
+
type DummyTab = { id: string; title: React.ReactNode };
|
|
1072
|
+
|
|
1073
|
+
export const Title = ({ text, value }: { text: string; value: React.ReactNode }) => (
|
|
1074
|
+
<div>
|
|
1075
|
+
<div>{text}</div>
|
|
1076
|
+
<div className='text-bold text-size-18'>{value}</div>
|
|
1077
|
+
</div>
|
|
1078
|
+
);
|
|
1079
|
+
|
|
1080
|
+
const DummyContent = ({ tabKey }: { tabKey: string }) => (
|
|
1081
|
+
<div className='padding-left-15 padding-right-15'>
|
|
1082
|
+
{tabKey === 'tab1' && dummyText}
|
|
1083
|
+
{tabKey === 'tab2' && dummyTextLong}
|
|
1084
|
+
{tabKey === 'tab3' && dummyTextShort}
|
|
1085
|
+
{tabKey === 'tab4' && dummyTextExtraLong}
|
|
1086
|
+
</div>
|
|
1087
|
+
);
|
|
1088
|
+
|
|
1089
|
+
const MyDataTabs = ({
|
|
1090
|
+
tabs = [],
|
|
1091
|
+
activeTab,
|
|
1092
|
+
onTabChange,
|
|
1093
|
+
}: {
|
|
1094
|
+
tabs: DummyTab[];
|
|
1095
|
+
activeTab: string;
|
|
1096
|
+
onTabChange: (newTab: string) => void;
|
|
1097
|
+
}) => {
|
|
1098
|
+
return (
|
|
1099
|
+
<DataTabs
|
|
1100
|
+
activeKey={activeTab}
|
|
1101
|
+
bordered={false}
|
|
1102
|
+
disableTransition={false}
|
|
1103
|
+
commonTabContent={<DummyContent tabKey={activeTab} />}
|
|
1104
|
+
onSelectTab={onTabChange}
|
|
1105
|
+
>
|
|
1106
|
+
{tabs.map(item => (
|
|
1107
|
+
<DataTab key={item.id} tabKey={item.id} title={item.title} />
|
|
1108
|
+
))}
|
|
1109
|
+
</DataTabs>
|
|
1110
|
+
);
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
const tabSetOne: DummyTab[] = [
|
|
1114
|
+
{
|
|
1115
|
+
id: 'tab1',
|
|
1116
|
+
title: <Title text='Ø - Consumption' value='13,5 km/l' />,
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
id: 'tab2',
|
|
1120
|
+
title: <Title text='Ø - C02 Emission' value='12,2 kg' />,
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
id: 'tab3',
|
|
1124
|
+
title: <Title text='Ø - Range' value='32,8 l/100' />,
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
id: 'tab4',
|
|
1128
|
+
title: <Title text='Ø - Route type' value='Foobar' />,
|
|
1129
|
+
},
|
|
1130
|
+
];
|
|
1131
|
+
|
|
1132
|
+
const tabSetTwo: DummyTab[] = [
|
|
1133
|
+
{
|
|
1134
|
+
id: 'tab1',
|
|
1135
|
+
title: <Title text='Ø - Consumption' value='13,5 km/l' />,
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
id: 'tab2',
|
|
1139
|
+
title: <Title text='Ø - C02 Emission' value='12,2 kg' />,
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
id: 'tab3',
|
|
1143
|
+
title: <Title text='Ø - Range' value='32,8 l/100' />,
|
|
1144
|
+
},
|
|
1145
|
+
];
|
|
1146
|
+
|
|
1147
|
+
export default () => {
|
|
1148
|
+
const [tabKey, setTabKey] = useState('tab1');
|
|
1149
|
+
const [activeDataSet, setActiveDataSet] = useState(1);
|
|
1150
|
+
|
|
1151
|
+
const handleSetDataSet = (id: number) => {
|
|
1152
|
+
setActiveDataSet(id);
|
|
1153
|
+
setTabKey('tab1');
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
return (
|
|
1157
|
+
<>
|
|
1158
|
+
<div className='btn-group margin-bottom-15'>
|
|
1159
|
+
<Button className='margin-top-15' onClick={() => handleSetDataSet(1)} active={activeDataSet === 1}>
|
|
1160
|
+
Data Set 1
|
|
1161
|
+
</Button>
|
|
1162
|
+
<Button className='margin-top-15' onClick={() => handleSetDataSet(2)} active={activeDataSet === 2}>
|
|
1163
|
+
Data Set 2
|
|
1164
|
+
</Button>
|
|
1165
|
+
</div>
|
|
1166
|
+
<MyDataTabs
|
|
1167
|
+
activeTab={tabKey}
|
|
1168
|
+
tabs={activeDataSet === 1 ? tabSetTwo : tabSetOne}
|
|
1169
|
+
onTabChange={(newTabKey: string) => setTabKey(newTabKey)}
|
|
1170
|
+
/>
|
|
1171
|
+
</>
|
|
1172
|
+
);
|
|
1173
|
+
};
|
|
1174
|
+
```
|
|
1175
|
+
|
|
1176
|
+
#### HTML (html)
|
|
1177
|
+
|
|
1178
|
+
```html
|
|
1179
|
+
<div class="btn-group margin-bottom-15">
|
|
1180
|
+
<button type="button" class="btn btn-default active btn-component margin-top-15" tabindex="0">Data Set 1</button>
|
|
1181
|
+
<button type="button" class="btn btn-default btn-component margin-top-15" tabindex="0">Data Set 2</button>
|
|
1182
|
+
</div>
|
|
1183
|
+
<div class="DataTabsContainer DataTabs-horizontal">
|
|
1184
|
+
<div class="DataTabsWrapper ">
|
|
1185
|
+
<ul class="DataTabs" role="tabList">
|
|
1186
|
+
<li class="DataTab tab active bg-highlight-dark text-color-white" data-tabkey="tab1">
|
|
1187
|
+
<div>
|
|
1188
|
+
<div>Ø - Consumption</div>
|
|
1189
|
+
<div class="text-bold text-size-18">13,5 km/l</div>
|
|
1190
|
+
</div>
|
|
1191
|
+
<div class="arrow bg-highlight-dark border-color-transparent in">
|
|
1192
|
+
</div>
|
|
1193
|
+
</li>
|
|
1194
|
+
<li class="DataTab tab cursor-pointer" data-tabkey="tab2">
|
|
1195
|
+
<div>
|
|
1196
|
+
<div>Ø - C02 Emission</div>
|
|
1197
|
+
<div class="text-bold text-size-18">12,2 kg</div>
|
|
1198
|
+
</div>
|
|
1199
|
+
<div class="arrow bg-highlight-dark border-color-transparent ">
|
|
1200
|
+
</div>
|
|
1201
|
+
</li>
|
|
1202
|
+
<li class="DataTab tab cursor-pointer" data-tabkey="tab3">
|
|
1203
|
+
<div>
|
|
1204
|
+
<div>Ø - Range</div>
|
|
1205
|
+
<div class="text-bold text-size-18">32,8 l/100</div>
|
|
1206
|
+
</div>
|
|
1207
|
+
<div class="arrow bg-highlight-dark border-color-transparent ">
|
|
1208
|
+
</div>
|
|
1209
|
+
</li>
|
|
1210
|
+
</ul>
|
|
1211
|
+
</div>
|
|
1212
|
+
<div class="tab-content " role="tabpanel">
|
|
1213
|
+
<div class="padding-left-15 padding-right-15">
|
|
1214
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt. Fusce ac ligula bibendum, rutrum libero quis, viverra sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis ut hendrerit massa, in molestie elit. Sed vitae orci ac purus volutpat posuere ac ut neque. Mauris ante orci, semper finibus lorem in, fringilla pretium velit.</div>
|
|
1215
|
+
</div>
|
|
1216
|
+
</div>
|
|
1217
|
+
```
|
|
1218
|
+
|
|
1219
|
+
#### Props: DataTabs
|
|
1220
|
+
|
|
1221
|
+
### DataTabs
|
|
1222
|
+
|
|
1223
|
+
| Name | Type | Default | Description |
|
|
1224
|
+
| --- | --- | --- | --- |
|
|
1225
|
+
| activeKey | String | "" | Sets key and id. |
|
|
1226
|
+
| onSelectTab | boolean | () => {} | Called when a tab is being activated. |
|
|
1227
|
+
| commonTabContent | ReactNode | — | Tab content that is used for all tabs. Using a common tab content will ignore any DataTab child. Additionally, there will be no transition when switching tabs as it is a single tab content component. |
|
|
1228
|
+
| vertical | boolean | false | Whether the layout should be vertical. |
|
|
1229
|
+
| bordered | boolean | true | Whether the component should add a border. |
|
|
1230
|
+
| disableTransition | boolean | false | Transitions between tab contents are enabled by default. Set if you want to disable them. The Navigation tabs will still remain animated. |
|
|
1231
|
+
| className | string | — | Additional classes to be set on the wrapper element. |
|
|
1232
|
+
| tabContentClassName | string | — | Additional classes to be set on the tabContent wrapper element. |
|
|
1233
|
+
| tabsWrapperClassName | string | — | Additional classes to be set on the tabs wrapper element. |
|
|
1234
|
+
| arrowClassName | string | bg-highlight-dark | Additional classes to be set on the arrow. |
|
|
1235
|
+
| tabClassName | string | bg-white | Additional classes to be set on the tab element. |
|
|
1236
|
+
| tabHoverClassName | string | text-color-darkest | Utility hover classes to be set on the tab element. |
|
|
1237
|
+
| tabActiveClassName | string | text-color-darkest | Utility active classes to be set on the tab element. |
|
|
1238
|
+
|
|
1239
|
+
#### Props: DataTab
|
|
1240
|
+
|
|
1241
|
+
### DataTab
|
|
1242
|
+
|
|
1243
|
+
| Name | Type | Default | Description |
|
|
1244
|
+
| --- | --- | --- | --- |
|
|
1245
|
+
| tabKey | string | — | Used to identify the tab. |
|
|
1246
|
+
| title | string \| ReactNode | — | The content for the tab. |
|
|
1247
|
+
| active | boolean | — | Whether this tab is the one currently active. |
|
|
1248
|
+
| disableTransition | boolean | — | Whether the transition effect should be disabled. |
|
|
1249
|
+
| onAnimationStart | VoidFunction | — | Callback for when the animation starts. |
|
|
1250
|
+
| onAnimationEnd | VoidFunction | — | Callback for when the animation ends. |
|
|
1251
|
+
| className | String | — | Additional classes to be set on the element. |
|