@rio-cloud/uikit-mcp 1.0.0 → 1.1.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/README.md +75 -40
- 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 +2016 -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 +3223 -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 +2785 -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 +525 -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 +932 -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 +17550 -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 +483 -0
- package/dist/docs/foundations.md +20901 -0
- package/dist/docs/start/changelog.md +439 -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,138 @@
|
|
|
1
|
+
# Route Utils
|
|
2
|
+
|
|
3
|
+
*Category:* Utilities
|
|
4
|
+
*Section:* Helper
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#utilities/routeUtils
|
|
6
|
+
*Captured:* 2025-12-12T12:39:34.850Z
|
|
7
|
+
|
|
8
|
+
Set of utility functions which helps parsing and stringify state into and from the URL.
|
|
9
|
+
|
|
10
|
+
## Route Utils
|
|
11
|
+
|
|
12
|
+
These functions will combine sort props like sort order and sort direction and map table settings into a compact comma separated list where hidden columns have a leading "-" and the width of a column will be attached to the column name if it it different from the default.
|
|
13
|
+
|
|
14
|
+
Example: http:/my-url/#demoService/table?sort=+userNickName&columns=itemId,userImageStatus,userNickName:278,userFirstName,userLastName,userActivity,userJobTitle,userEmail,userPhoneNumber
|
|
15
|
+
|
|
16
|
+
### Example: Example 1
|
|
17
|
+
|
|
18
|
+
// Note: this sample uses the "qs" library to parse and stringify data
|
|
19
|
+
|
|
20
|
+
import qs from 'qs';
|
|
21
|
+
import { get } from 'es-toolkit/compat';
|
|
22
|
+
|
|
23
|
+
import { tableConfig, BASE_PATH } from './yourTableConfig';
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
parseColumnsSettingsStrings,
|
|
27
|
+
mapColumnsSettingsToStrings,
|
|
28
|
+
getSortDirShort,
|
|
29
|
+
parseSorting,
|
|
30
|
+
type ColumnsSettings,
|
|
31
|
+
} from '@rio-cloud/rio-uikit/routeUtils';
|
|
32
|
+
|
|
33
|
+
// Options for the "qs" library
|
|
34
|
+
const OPTIONS = {
|
|
35
|
+
comma: true, // required to parse comma separated string into array
|
|
36
|
+
arrayFormat: 'comma', // required to stringify arrays into comma separated strings
|
|
37
|
+
indices: false, // don't use array indices
|
|
38
|
+
encode: false, // don't encode the entire string as it will be done individually for certain params
|
|
39
|
+
decode: false,
|
|
40
|
+
skipNulls: true, // required to remove empty params
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Sample code for parsing the route just for illustration how to use the utils functions
|
|
44
|
+
// Feel free to modify this to your needs.
|
|
45
|
+
// Note: the "parseRoute" and "makeRoute" functions may contain more props which are left out in this demo
|
|
46
|
+
export const parseRoute = (router: any) => {
|
|
47
|
+
const location = get(router, 'location', {}) as Location;
|
|
48
|
+
const searchParams = location.search ? location.search.replace('?', '') : location.search;
|
|
49
|
+
|
|
50
|
+
const { sort, columns } = qs.parse(searchParams, OPTIONS);
|
|
51
|
+
|
|
52
|
+
const sorting = sort && parseSorting(sort);
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
sortBy: sorting?.sortBy,
|
|
56
|
+
sortDir: sorting?.sortDir,
|
|
57
|
+
columns: columns && parseColumnsSettingsStrings(columns, tableConfig.defaultColumnsDetails),
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type mapRouteProps = {
|
|
62
|
+
sortBy: string;
|
|
63
|
+
sortDir: string;
|
|
64
|
+
columns: ColumnsSettings;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const makeRoute = ({ sortBy, sortDir, columns }: mapRouteProps) => {
|
|
68
|
+
// Set props to undefined or null in order to remove it from the URL when not defined
|
|
69
|
+
const params = {
|
|
70
|
+
sort: sortBy && `${getSortDirShort(sortDir)}${sortBy}`,
|
|
71
|
+
columns: columns && mapColumnsSettingsToStrings(columns),
|
|
72
|
+
};
|
|
73
|
+
const queryParams = qs.stringify(params, OPTIONS);
|
|
74
|
+
const searchFragment = queryParams && `?${queryParams}`;
|
|
75
|
+
return `${BASE_PATH}/${searchFragment}`;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
#### Summary
|
|
79
|
+
|
|
80
|
+
// Note: this sample uses the "qs" library to parse and stringify data
|
|
81
|
+
|
|
82
|
+
import qs from 'qs';
|
|
83
|
+
import { get } from 'es-toolkit/compat';
|
|
84
|
+
|
|
85
|
+
import { tableConfig, BASE_PATH } from './yourTableConfig';
|
|
86
|
+
|
|
87
|
+
import {
|
|
88
|
+
parseColumnsSettingsStrings,
|
|
89
|
+
mapColumnsSettingsToStrings,
|
|
90
|
+
getSortDirShort,
|
|
91
|
+
parseSorting,
|
|
92
|
+
type ColumnsSettings,
|
|
93
|
+
} from '@rio-cloud/rio-uikit/routeUtils';
|
|
94
|
+
|
|
95
|
+
// Options for the "qs" library
|
|
96
|
+
const OPTIONS = {
|
|
97
|
+
comma: true, // required to parse comma separated string into array
|
|
98
|
+
arrayFormat: 'comma', // required to stringify arrays into comma separated strings
|
|
99
|
+
indices: false, // don't use array indices
|
|
100
|
+
encode: false, // don't encode the entire string as it will be done individually for certain params
|
|
101
|
+
decode: false,
|
|
102
|
+
skipNulls: true, // required to remove empty params
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// Sample code for parsing the route just for illustration how to use the utils functions
|
|
106
|
+
// Feel free to modify this to your needs.
|
|
107
|
+
// Note: the "parseRoute" and "makeRoute" functions may contain more props which are left out in this demo
|
|
108
|
+
export const parseRoute = (router: any) => {
|
|
109
|
+
const location = get(router, 'location', {}) as Location;
|
|
110
|
+
const searchParams = location.search ? location.search.replace('?', '') : location.search;
|
|
111
|
+
|
|
112
|
+
const { sort, columns } = qs.parse(searchParams, OPTIONS);
|
|
113
|
+
|
|
114
|
+
const sorting = sort && parseSorting(sort);
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
sortBy: sorting?.sortBy,
|
|
118
|
+
sortDir: sorting?.sortDir,
|
|
119
|
+
columns: columns && parseColumnsSettingsStrings(columns, tableConfig.defaultColumnsDetails),
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
type mapRouteProps = {
|
|
124
|
+
sortBy: string;
|
|
125
|
+
sortDir: string;
|
|
126
|
+
columns: ColumnsSettings;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const makeRoute = ({ sortBy, sortDir, columns }: mapRouteProps) => {
|
|
130
|
+
// Set props to undefined or null in order to remove it from the URL when not defined
|
|
131
|
+
const params = {
|
|
132
|
+
sort: sortBy && `${getSortDirShort(sortDir)}${sortBy}`,
|
|
133
|
+
columns: columns && mapColumnsSettingsToStrings(columns),
|
|
134
|
+
};
|
|
135
|
+
const queryParams = qs.stringify(params, OPTIONS);
|
|
136
|
+
const searchFragment = queryParams && `?${queryParams}`;
|
|
137
|
+
return `${BASE_PATH}/${searchFragment}`;
|
|
138
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# useAfterMount
|
|
2
|
+
|
|
3
|
+
*Category:* Utilities
|
|
4
|
+
*Section:* Lifecycle & execution hooks
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#utilities/useAfterMount
|
|
6
|
+
*Captured:* 2025-12-12T12:39:36.322Z
|
|
7
|
+
|
|
8
|
+
The useAfterMount hook allows to use a side effect after the component has been mounted and rendered. The effect will not be triggered on mount and only when the dependencies change.
|
|
9
|
+
|
|
10
|
+
## useAfterMount
|
|
11
|
+
|
|
12
|
+
### Example: Example 1
|
|
13
|
+
|
|
14
|
+
Count: 0
|
|
15
|
+
Increment
|
|
16
|
+
|
|
17
|
+
#### Summary
|
|
18
|
+
|
|
19
|
+
Count: 0
|
|
20
|
+
Increment
|
|
21
|
+
|
|
22
|
+
#### React (tsx)
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { useState, useEffect } from 'react';
|
|
26
|
+
|
|
27
|
+
import Button from '@rio-cloud/rio-uikit/Button';
|
|
28
|
+
import useAfterMount from '@rio-cloud/rio-uikit/useAfterMount';
|
|
29
|
+
|
|
30
|
+
export default () => {
|
|
31
|
+
const [count, setCount] = useState(0);
|
|
32
|
+
|
|
33
|
+
// This will run on initial mount and whenever 'count' changes
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
console.log('useEffect: Component mounted or count changed:', count);
|
|
36
|
+
}, [count]);
|
|
37
|
+
|
|
38
|
+
// This will run only after the initial mount when 'count' changes
|
|
39
|
+
useAfterMount(() => {
|
|
40
|
+
console.log('useAfterMount: Count changed:', count);
|
|
41
|
+
}, [count]);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div>
|
|
45
|
+
<p>Count: {count}</p>
|
|
46
|
+
<Button onClick={() => setCount(count + 1)}>Increment</Button>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### HTML (html)
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div>
|
|
56
|
+
<p>Count: 0</p>
|
|
57
|
+
<button type="button" class="btn btn-default btn-component" tabindex="0">Increment</button>
|
|
58
|
+
</div>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Props
|
|
62
|
+
|
|
63
|
+
| Name | Type | Default | Description |
|
|
64
|
+
| --- | --- | --- | --- |
|
|
65
|
+
| callback | Function | — | The effect callback function to be used after the component has been mounted. |
|
|
66
|
+
| deps | Array | — | The effect dependencies that trigger the effect. |
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# useAutoAnimate
|
|
2
|
+
|
|
3
|
+
*Category:* Utilities
|
|
4
|
+
*Section:* DOM behavior hooks
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#utilities/useAutoAnimate
|
|
6
|
+
*Captured:* 2025-12-12T12:39:38.370Z
|
|
7
|
+
|
|
8
|
+
The useAutoAnimate hook is a thin re-export of the @formkit/auto-animate utility to quickly add enter/leave animations to a container. This page shows a simple example; for full configuration options, check the official documentation.
|
|
9
|
+
|
|
10
|
+
## useAutoAnimate
|
|
11
|
+
|
|
12
|
+
### Example: Ready for pickup
|
|
13
|
+
|
|
14
|
+
Add shipmentChange layoutDisable animation
|
|
15
|
+
|
|
16
|
+
Shipment #1001
|
|
17
|
+
Ready for pickup
|
|
18
|
+
|
|
19
|
+
Shipment #1002
|
|
20
|
+
In transit
|
|
21
|
+
|
|
22
|
+
Shipment #1003
|
|
23
|
+
Delivered
|
|
24
|
+
|
|
25
|
+
#### Summary
|
|
26
|
+
|
|
27
|
+
Add shipmentChange layoutDisable animation
|
|
28
|
+
|
|
29
|
+
Shipment #1001
|
|
30
|
+
Ready for pickup
|
|
31
|
+
|
|
32
|
+
Shipment #1002
|
|
33
|
+
In transit
|
|
34
|
+
|
|
35
|
+
Shipment #1003
|
|
36
|
+
Delivered
|
|
37
|
+
|
|
38
|
+
#### React (tsx)
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { useState } from 'react';
|
|
42
|
+
|
|
43
|
+
import Avatar from '@rio-cloud/rio-uikit/Avatar';
|
|
44
|
+
import Button from '@rio-cloud/rio-uikit/Button';
|
|
45
|
+
import ButtonToolbar from '@rio-cloud/rio-uikit/ButtonToolbar';
|
|
46
|
+
import useAutoAnimate from '@rio-cloud/rio-uikit/useAutoAnimate';
|
|
47
|
+
import useToggle from '@rio-cloud/rio-uikit/useToggle';
|
|
48
|
+
|
|
49
|
+
export default () => {
|
|
50
|
+
const { isToggled: isVertical, toggle: toggleLayout } = useToggle();
|
|
51
|
+
|
|
52
|
+
const [shipments, setShipments] = useState([
|
|
53
|
+
{ id: 1001, title: 'Shipment #1001', status: 'Ready for pickup', icon: 'rioglyph-cube' },
|
|
54
|
+
{ id: 1002, title: 'Shipment #1002', status: 'In transit', icon: 'rioglyph-delivery' },
|
|
55
|
+
{ id: 1003, title: 'Shipment #1003', status: 'Delivered', icon: 'rioglyph-handshake' },
|
|
56
|
+
]);
|
|
57
|
+
|
|
58
|
+
const [parent, enableAnimations] = useAutoAnimate();
|
|
59
|
+
|
|
60
|
+
const addShipment = () => {
|
|
61
|
+
const nextId = shipments.length ? Math.max(...shipments.map(shipment => shipment.id)) + 1 : 1001;
|
|
62
|
+
setShipments([
|
|
63
|
+
...shipments,
|
|
64
|
+
{
|
|
65
|
+
id: nextId,
|
|
66
|
+
title: `Shipment #${nextId}`,
|
|
67
|
+
status: 'Created (awaiting carrier)',
|
|
68
|
+
icon: 'rioglyph-cube-dashed',
|
|
69
|
+
},
|
|
70
|
+
]);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const removeShipment = (id: number) => {
|
|
74
|
+
setShipments(shipments.filter(shipment => shipment.id !== id));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<>
|
|
79
|
+
<ButtonToolbar>
|
|
80
|
+
<Button onClick={addShipment}>Add shipment</Button>
|
|
81
|
+
<Button onClick={toggleLayout}>Change layout</Button>
|
|
82
|
+
<Button onClick={() => enableAnimations(false)}>Disable animation</Button>
|
|
83
|
+
</ButtonToolbar>
|
|
84
|
+
<div
|
|
85
|
+
ref={parent}
|
|
86
|
+
className={`margin-top-15 max-width-300- display-flex flex-wrap gap-10 ${isVertical ? 'flex-row' : 'flex-column'}`}
|
|
87
|
+
>
|
|
88
|
+
{shipments.map(shipment => (
|
|
89
|
+
<div
|
|
90
|
+
key={shipment.id}
|
|
91
|
+
className='width-300 height-70 bg-white shadow-subtle display-flex gap-10 align-items-center justify-content-between border rounded padding-x-10 padding-y-15'
|
|
92
|
+
>
|
|
93
|
+
<div>
|
|
94
|
+
<Avatar
|
|
95
|
+
className='text-color-darker text-size-16 bg-lightest scale-90'
|
|
96
|
+
iconName={`rioglyph ${shipment.icon}`}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
<div className='flex-1-1'>
|
|
100
|
+
<div className='text-medium'>{shipment.title}</div>
|
|
101
|
+
<div className='text-color-dark'>{shipment.status}</div>
|
|
102
|
+
</div>
|
|
103
|
+
<Button
|
|
104
|
+
bsSize='xs'
|
|
105
|
+
bsStyle='muted'
|
|
106
|
+
iconOnly
|
|
107
|
+
iconName='rioglyph-remove'
|
|
108
|
+
onClick={() => removeShipment(shipment.id)}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
))}
|
|
112
|
+
</div>
|
|
113
|
+
</>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
#### HTML (html)
|
|
119
|
+
|
|
120
|
+
```html
|
|
121
|
+
<div class="btn-toolbar">
|
|
122
|
+
<button type="button" class="btn btn-default btn-component" tabindex="0">Add shipment</button>
|
|
123
|
+
<button type="button" class="btn btn-default btn-component" tabindex="0">Change layout</button>
|
|
124
|
+
<button type="button" class="btn btn-default btn-component" tabindex="0">Disable animation</button>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="margin-top-15 max-width-300- display-flex flex-wrap gap-10 flex-column" style="position: relative;">
|
|
127
|
+
<div class="width-300 height-70 bg-white shadow-subtle display-flex gap-10 align-items-center justify-content-between border rounded padding-x-10 padding-y-15">
|
|
128
|
+
<div>
|
|
129
|
+
<div class="Avatar bg-lighter text-color-darker text-size-16 bg-lightest scale-90" style="height: 40px;">
|
|
130
|
+
<span class="Avatar-icon rioglyph rioglyph-rioglyph rioglyph-cube ">
|
|
131
|
+
</span>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="flex-1-1">
|
|
135
|
+
<div class="text-medium">Shipment #1001</div>
|
|
136
|
+
<div class="text-color-dark">Ready for pickup</div>
|
|
137
|
+
</div>
|
|
138
|
+
<button type="button" class="btn btn-muted btn-xs btn-icon-only btn-component" tabindex="0">
|
|
139
|
+
<span class="rioglyph rioglyph-remove">
|
|
140
|
+
</span>
|
|
141
|
+
</button>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="width-300 height-70 bg-white shadow-subtle display-flex gap-10 align-items-center justify-content-between border rounded padding-x-10 padding-y-15">
|
|
144
|
+
<div>
|
|
145
|
+
<div class="Avatar bg-lighter text-color-darker text-size-16 bg-lightest scale-90" style="height: 40px;">
|
|
146
|
+
<span class="Avatar-icon rioglyph rioglyph-rioglyph rioglyph-delivery ">
|
|
147
|
+
</span>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="flex-1-1">
|
|
151
|
+
<div class="text-medium">Shipment #1002</div>
|
|
152
|
+
<div class="text-color-dark">In transit</div>
|
|
153
|
+
</div>
|
|
154
|
+
<button type="button" class="btn btn-muted btn-xs btn-icon-only btn-component" tabindex="0">
|
|
155
|
+
<span class="rioglyph rioglyph-remove">
|
|
156
|
+
</span>
|
|
157
|
+
</button>
|
|
158
|
+
</div>
|
|
159
|
+
<div class="width-300 height-70 bg-white shadow-subtle display-flex gap-10 align-items-center justify-content-between border rounded padding-x-10 padding-y-15">
|
|
160
|
+
<div>
|
|
161
|
+
<div class="Avatar bg-lighter text-color-darker text-size-16 bg-lightest scale-90" style="height: 40px;">
|
|
162
|
+
<span class="Avatar-icon rioglyph rioglyph-rioglyph rioglyph-handshake ">
|
|
163
|
+
</span>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="flex-1-1">
|
|
167
|
+
<div class="text-medium">Shipment #1003</div>
|
|
168
|
+
<div class="text-color-dark">Delivered</div>
|
|
169
|
+
</div>
|
|
170
|
+
<button type="button" class="btn btn-muted btn-xs btn-icon-only btn-component" tabindex="0">
|
|
171
|
+
<span class="rioglyph rioglyph-remove">
|
|
172
|
+
</span>
|
|
173
|
+
</button>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Props: Parameters
|
|
179
|
+
|
|
180
|
+
### Parameters
|
|
181
|
+
|
|
182
|
+
| Name | Type | Default | Description |
|
|
183
|
+
| --- | --- | --- | --- |
|
|
184
|
+
| options | AutoAnimateOptions (optional) | — | Forwarded to @formkit/auto-animate to configure duration, easing, animations, etc. |
|
|
185
|
+
|
|
186
|
+
#### Props: Returns
|
|
187
|
+
|
|
188
|
+
### Returns
|
|
189
|
+
|
|
190
|
+
| Name | Type | Default | Description |
|
|
191
|
+
| --- | --- | --- | --- |
|
|
192
|
+
| parent | RefCallback<HTMLElement> | — | Attach to the container whose children should animate. |
|
|
193
|
+
| enableAnimations | (enabled?: boolean) => void | — | Toggle animations on or off; pass false to disable temporarily. |
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# useAverage
|
|
2
|
+
|
|
3
|
+
*Category:* Utilities
|
|
4
|
+
*Section:* Data aggregation hooks
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#utilities/useAverage
|
|
6
|
+
*Captured:* 2025-12-12T12:39:48.194Z
|
|
7
|
+
|
|
8
|
+
Calculates the arithmetic mean of numeric values extracted from a list of objects using a dot-separated path. Supports localized number formats through optional locale configuration.
|
|
9
|
+
|
|
10
|
+
## useAverage
|
|
11
|
+
|
|
12
|
+
### Example: Example 1
|
|
13
|
+
|
|
14
|
+
Average weight deliveries 1: 982,69 kg
|
|
15
|
+
Average weight deliveries 2: 982,69 kg
|
|
16
|
+
|
|
17
|
+
#### Summary
|
|
18
|
+
|
|
19
|
+
Average weight deliveries 1: 982,69 kg
|
|
20
|
+
Average weight deliveries 2: 982,69 kg
|
|
21
|
+
|
|
22
|
+
#### React (tsx)
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { IntlProvider, FormattedNumber } from 'react-intl';
|
|
26
|
+
|
|
27
|
+
import useAverage from '@rio-cloud/rio-uikit/useAverage';
|
|
28
|
+
|
|
29
|
+
const deliveries1 = [
|
|
30
|
+
{ shipment: { weight: '1.200,5 kg' } },
|
|
31
|
+
{ shipment: { weight: '980,25 kg' } },
|
|
32
|
+
{ shipment: { weight: '750 kg' } },
|
|
33
|
+
{ shipment: { weight: '1.000 kg' } },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const deliveries2 = [
|
|
37
|
+
{ shipment: { weight: 1200.5 } },
|
|
38
|
+
{ shipment: { weight: 980.25 } },
|
|
39
|
+
{ shipment: { weight: 750 } },
|
|
40
|
+
{ shipment: { weight: 1_000 } },
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
export default () => {
|
|
44
|
+
const averageWeight1 = useAverage(deliveries1, 'shipment.weight', {
|
|
45
|
+
locale: 'de-DE',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const averageWeight2 = useAverage(deliveries2, 'shipment.weight');
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<IntlProvider locale='de-DE'>
|
|
52
|
+
<div>
|
|
53
|
+
Average weight deliveries 1:{' '}
|
|
54
|
+
<b>
|
|
55
|
+
<FormattedNumber value={averageWeight1} style='unit' unit='kilogram' maximumFractionDigits={2} />
|
|
56
|
+
</b>
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
Average weight deliveries 2:{' '}
|
|
60
|
+
<b>
|
|
61
|
+
<FormattedNumber value={averageWeight2} style='unit' unit='kilogram' maximumFractionDigits={2} />
|
|
62
|
+
</b>
|
|
63
|
+
</div>
|
|
64
|
+
</IntlProvider>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### HTML (html)
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<div>Average weight deliveries 1: <b>982,69 kg</b>
|
|
73
|
+
</div>
|
|
74
|
+
<div>Average weight deliveries 2: <b>982,69 kg</b>
|
|
75
|
+
</div>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Props: Options for the `useAverage` hook
|
|
79
|
+
|
|
80
|
+
### Options for the `useAverage` hook
|
|
81
|
+
|
|
82
|
+
| Name | Type | Default | Description |
|
|
83
|
+
| --- | --- | --- | --- |
|
|
84
|
+
| items | unknown[] | — | The array of objects to extract numeric values from. |
|
|
85
|
+
| path | string | — | Dot-separated path to the numeric value inside each object. |
|
|
86
|
+
| options | object | — | Optional configuration for number parsing. |
|
|
87
|
+
| └locale | string | "en-GB" | Locale string used for parsing localized number formats. Affects grouping and decimal separator interpretation. |
|
|
88
|
+
|
|
89
|
+
#### Props: Return value of the `useAverage` hook
|
|
90
|
+
|
|
91
|
+
### Return value of the `useAverage` hook
|
|
92
|
+
|
|
93
|
+
| Name | Type | Default | Description |
|
|
94
|
+
| --- | --- | --- | --- |
|
|
95
|
+
| value | number | — | The average of all valid numeric values found at the given path in the item list. |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# useClickOutside
|
|
2
|
+
|
|
3
|
+
*Category:* Utilities
|
|
4
|
+
*Section:* DOM behavior hooks
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#utilities/useClickOutside
|
|
6
|
+
*Captured:* 2025-12-12T12:39:39.138Z
|
|
7
|
+
|
|
8
|
+
The useClickOutside hook allows to easily detect events outside a referenced element.
|
|
9
|
+
|
|
10
|
+
## useClickOutside
|
|
11
|
+
|
|
12
|
+
### Example: Example 1
|
|
13
|
+
|
|
14
|
+
Click outside the box
|
|
15
|
+
|
|
16
|
+
#### Summary
|
|
17
|
+
|
|
18
|
+
Click outside the box
|
|
19
|
+
|
|
20
|
+
#### React (tsx)
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { useState } from 'react';
|
|
24
|
+
|
|
25
|
+
import useClickOutside from '@rio-cloud/rio-uikit/useClickOutside';
|
|
26
|
+
|
|
27
|
+
export default () => {
|
|
28
|
+
const [background, setBackground] = useState('bg-highlight');
|
|
29
|
+
|
|
30
|
+
const ref = useClickOutside(() => setBackground('bg-light'));
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className='display-flex flex-column justify-content-center align-items-center height-100'>
|
|
34
|
+
<label className='margin-bottom-10'>Click outside the box</label>
|
|
35
|
+
<div
|
|
36
|
+
ref={ref}
|
|
37
|
+
className={`width-100 height-100 cursor-pointer rounded ${background}`}
|
|
38
|
+
onClick={() => setBackground('bg-highlight')}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### HTML (html)
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<div class="display-flex flex-column justify-content-center align-items-center height-100">
|
|
49
|
+
<label class="margin-bottom-10">Click outside the box</label>
|
|
50
|
+
<div class="width-100 height-100 cursor-pointer rounded bg-light">
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### Props
|
|
56
|
+
|
|
57
|
+
| Name | Type | Default | Description |
|
|
58
|
+
| --- | --- | --- | --- |
|
|
59
|
+
| callback | (event: MouseEvent \| TouchEvent) => void | — | The callback function to be triggered when click or touch events happen outside the referenced element. |
|
|
60
|
+
| eventTypes | keyof DocumentEventMap | ['mousedown', 'touchstart'] | Customize list of events to listen on. |
|
|
61
|
+
| isActive | boolean | true | Flag to only listen for clicks when target element active. This comes in handy for dropdowns where the event can be registered only when the dropdown is open. |
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# useClipboard
|
|
2
|
+
|
|
3
|
+
*Category:* Utilities
|
|
4
|
+
*Section:* Browser & device hooks
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#utilities/useClipboard
|
|
6
|
+
*Captured:* 2025-12-12T12:39:43.688Z
|
|
7
|
+
|
|
8
|
+
The useClipboard hook allows to easily copy something to the browsers clipboard.
|
|
9
|
+
|
|
10
|
+
## useClipboard
|
|
11
|
+
|
|
12
|
+
### Example: Example 1
|
|
13
|
+
|
|
14
|
+
Random UUID
|
|
15
|
+
|
|
16
|
+
#### Summary
|
|
17
|
+
|
|
18
|
+
Random UUID
|
|
19
|
+
|
|
20
|
+
#### React (tsx)
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { useEffect, useState } from 'react';
|
|
24
|
+
|
|
25
|
+
import useClipboard from '@rio-cloud/rio-uikit/useClipboard';
|
|
26
|
+
import Notification from '@rio-cloud/rio-uikit/Notification';
|
|
27
|
+
import Button from '@rio-cloud/rio-uikit/Button';
|
|
28
|
+
import FormLabel from '@rio-cloud/rio-uikit/FormLabel';
|
|
29
|
+
|
|
30
|
+
export default () => {
|
|
31
|
+
const [inputValue, setInputValue] = useState<string>(crypto.randomUUID());
|
|
32
|
+
|
|
33
|
+
const clipboard = useClipboard();
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
clipboard.copied && Notification.default('Text copied to clipboard');
|
|
37
|
+
}, [clipboard.copied]);
|
|
38
|
+
|
|
39
|
+
const handleCopyButtonClick = () => {
|
|
40
|
+
clipboard.copy(inputValue);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className='form-group max-width-500 margin-auto padding-25'>
|
|
45
|
+
<FormLabel htmlFor='random-uuid'>Random UUID</FormLabel>
|
|
46
|
+
<div className='input-group'>
|
|
47
|
+
<input
|
|
48
|
+
id='random-uuid'
|
|
49
|
+
className='form-control'
|
|
50
|
+
type='text'
|
|
51
|
+
value={inputValue}
|
|
52
|
+
onChange={event => setInputValue(event.currentTarget.value)}
|
|
53
|
+
/>
|
|
54
|
+
<div className='input-group-addon'>
|
|
55
|
+
<Button
|
|
56
|
+
bsStyle='muted'
|
|
57
|
+
bsSize='sm'
|
|
58
|
+
className='position-absolute top-1 right-1'
|
|
59
|
+
onClick={handleCopyButtonClick}
|
|
60
|
+
iconName='rioglyph-duplicate'
|
|
61
|
+
iconOnly
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### HTML (html)
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<div class="form-group max-width-500 margin-auto padding-25">
|
|
74
|
+
<label for="random-uuid" class="display-inline-block">
|
|
75
|
+
<span>Random UUID</span>
|
|
76
|
+
</label>
|
|
77
|
+
<div class="input-group">
|
|
78
|
+
<input id="random-uuid" class="form-control" type="text" value="ac85dc43-adb9-4276-9145-7d6c80c4c6eb">
|
|
79
|
+
<div class="input-group-addon">
|
|
80
|
+
<button type="button" class="btn btn-muted btn-sm btn-icon-only btn-component position-absolute top-1 right-1" tabindex="0">
|
|
81
|
+
<span class="rioglyph rioglyph-duplicate">
|
|
82
|
+
</span>
|
|
83
|
+
</button>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Props
|
|
90
|
+
|
|
91
|
+
| Name | Type | Default | Description |
|
|
92
|
+
| --- | --- | --- | --- |
|
|
93
|
+
| options.timeout | Number | 2000 | The copied status timeout duration in milliseconds. |
|