@rio-cloud/uikit-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +91 -0
- package/bin/uikit-mcp.mjs +23 -0
- package/data/pages/Components/components/accentbar.json +207 -0
- package/data/pages/Components/components/activity.json +87 -0
- package/data/pages/Components/components/animatednumber.json +99 -0
- package/data/pages/Components/components/animations.json +87 -0
- package/data/pages/Components/components/appheader.json +291 -0
- package/data/pages/Components/components/applayout.json +1198 -0
- package/data/pages/Components/components/appnavigationbar.json +327 -0
- package/data/pages/Components/components/areacharts.json +563 -0
- package/data/pages/Components/components/aspectratioplaceholder.json +75 -0
- package/data/pages/Components/components/assettree.json +3080 -0
- package/data/pages/Components/components/autosuggests.json +710 -0
- package/data/pages/Components/components/avatar.json +157 -0
- package/data/pages/Components/components/banner.json +599 -0
- package/data/pages/Components/components/barcharts.json +1507 -0
- package/data/pages/Components/components/barlist.json +223 -0
- package/data/pages/Components/components/basicmap.json +68 -0
- package/data/pages/Components/components/bottomsheet.json +601 -0
- package/data/pages/Components/components/button.json +583 -0
- package/data/pages/Components/components/buttontoolbar.json +63 -0
- package/data/pages/Components/components/calendarstripe.json +235 -0
- package/data/pages/Components/components/card.json +69 -0
- package/data/pages/Components/components/carousel.json +39 -0
- package/data/pages/Components/components/chartcolors.json +34 -0
- package/data/pages/Components/components/chartsgettingstarted.json +32 -0
- package/data/pages/Components/components/chat.json +39 -0
- package/data/pages/Components/components/checkbox.json +847 -0
- package/data/pages/Components/components/clearableinput.json +789 -0
- package/data/pages/Components/components/collapse.json +175 -0
- package/data/pages/Components/components/composedcharts.json +159 -0
- package/data/pages/Components/components/contentloader.json +233 -0
- package/data/pages/Components/components/datatabs.json +680 -0
- package/data/pages/Components/components/datepickers.json +287 -0
- package/data/pages/Components/components/dialogs.json +1492 -0
- package/data/pages/Components/components/divider.json +93 -0
- package/data/pages/Components/components/dropdowns.json +936 -0
- package/data/pages/Components/components/editablecontent.json +1117 -0
- package/data/pages/Components/components/expander.json +377 -0
- package/data/pages/Components/components/fade.json +403 -0
- package/data/pages/Components/components/fadeexpander.json +75 -0
- package/data/pages/Components/components/fadeup.json +127 -0
- package/data/pages/Components/components/feedback.json +269 -0
- package/data/pages/Components/components/filepickers.json +269 -0
- package/data/pages/Components/components/formlabel.json +115 -0
- package/data/pages/Components/components/fullscreenmap.json +22 -0
- package/data/pages/Components/components/groupeditemlist.json +323 -0
- package/data/pages/Components/components/iconlist.json +45 -0
- package/data/pages/Components/components/imagepreloader.json +81 -0
- package/data/pages/Components/components/labeledelement.json +75 -0
- package/data/pages/Components/components/licenseplate.json +69 -0
- package/data/pages/Components/components/linecharts.json +987 -0
- package/data/pages/Components/components/listmenu.json +313 -0
- package/data/pages/Components/components/loadmore.json +175 -0
- package/data/pages/Components/components/mainnavigation.json +39 -0
- package/data/pages/Components/components/mapcircle.json +34 -0
- package/data/pages/Components/components/mapcluster.json +51 -0
- package/data/pages/Components/components/mapcontext.json +105 -0
- package/data/pages/Components/components/mapdraggablemarker.json +34 -0
- package/data/pages/Components/components/mapgettingstarted.json +27 -0
- package/data/pages/Components/components/mapgroup.json +1198 -0
- package/data/pages/Components/components/mapinfobubble.json +34 -0
- package/data/pages/Components/components/maplayergroup.json +34 -0
- package/data/pages/Components/components/mapmarker.json +700 -0
- package/data/pages/Components/components/mappolygon.json +45 -0
- package/data/pages/Components/components/maproute.json +623 -0
- package/data/pages/Components/components/maproutegenerator.json +16 -0
- package/data/pages/Components/components/mapsettings.json +51 -0
- package/data/pages/Components/components/maputils.json +34 -0
- package/data/pages/Components/components/multiselects.json +1451 -0
- package/data/pages/Components/components/nodata.json +139 -0
- package/data/pages/Components/components/notifications.json +65 -0
- package/data/pages/Components/components/numbercontrol.json +301 -0
- package/data/pages/Components/components/onboarding.json +302 -0
- package/data/pages/Components/components/page.json +197 -0
- package/data/pages/Components/components/pager.json +93 -0
- package/data/pages/Components/components/piecharts.json +731 -0
- package/data/pages/Components/components/popover.json +251 -0
- package/data/pages/Components/components/position.json +69 -0
- package/data/pages/Components/components/radialbarcharts.json +1304 -0
- package/data/pages/Components/components/radiobutton.json +1105 -0
- package/data/pages/Components/components/releasenotes.json +44 -0
- package/data/pages/Components/components/resizer.json +93 -0
- package/data/pages/Components/components/responsivecolumnstripe.json +123 -0
- package/data/pages/Components/components/responsivevideo.json +75 -0
- package/data/pages/Components/components/rioglyph.json +93 -0
- package/data/pages/Components/components/rules.json +410 -0
- package/data/pages/Components/components/saveableinput.json +703 -0
- package/data/pages/Components/components/selects.json +701 -0
- package/data/pages/Components/components/sidebar.json +243 -0
- package/data/pages/Components/components/sliders.json +235 -0
- package/data/pages/Components/components/smoothscrollbars.json +335 -0
- package/data/pages/Components/components/spinners.json +343 -0
- package/data/pages/Components/components/states.json +1705 -0
- package/data/pages/Components/components/statswidgets.json +314 -0
- package/data/pages/Components/components/statusbar.json +177 -0
- package/data/pages/Components/components/stepbutton.json +57 -0
- package/data/pages/Components/components/steppedprogressbars.json +417 -0
- package/data/pages/Components/components/subnavigation.json +107 -0
- package/data/pages/Components/components/supportmarker.json +45 -0
- package/data/pages/Components/components/svgimage.json +81 -0
- package/data/pages/Components/components/switch.json +111 -0
- package/data/pages/Components/components/tables.json +144 -0
- package/data/pages/Components/components/tagmanager.json +86 -0
- package/data/pages/Components/components/tags.json +146 -0
- package/data/pages/Components/components/teaser.json +188 -0
- package/data/pages/Components/components/timeline.json +45 -0
- package/data/pages/Components/components/timepicker.json +163 -0
- package/data/pages/Components/components/togglebutton.json +247 -0
- package/data/pages/Components/components/tooltip.json +270 -0
- package/data/pages/Components/components/virtuallist.json +175 -0
- package/data/pages/Foundations/foundations.json +2475 -0
- package/data/pages/Getting-started/start/changelog.json +22 -0
- package/data/pages/Getting-started/start/goodtoknow.json +32 -0
- package/data/pages/Getting-started/start/guidelines/color-combinations.json +58 -0
- package/data/pages/Getting-started/start/guidelines/custom-css.json +27 -0
- package/data/pages/Getting-started/start/guidelines/custom-rioglyph.json +22 -0
- package/data/pages/Getting-started/start/guidelines/formatting.json +97 -0
- package/data/pages/Getting-started/start/guidelines/iframe.json +93 -0
- package/data/pages/Getting-started/start/guidelines/obfuscate-data.json +22 -0
- package/data/pages/Getting-started/start/guidelines/print-css.json +37 -0
- package/data/pages/Getting-started/start/guidelines/spinner.json +144 -0
- package/data/pages/Getting-started/start/guidelines/supported-browsers.json +22 -0
- package/data/pages/Getting-started/start/guidelines/writing.json +242 -0
- package/data/pages/Getting-started/start/howto.json +72 -0
- package/data/pages/Getting-started/start/intro.json +37 -0
- package/data/pages/Getting-started/start/responsiveness.json +52 -0
- package/data/pages/Templates/templates/common-table.json +39 -0
- package/data/pages/Templates/templates/detail-views.json +71 -0
- package/data/pages/Templates/templates/expandable-details.json +39 -0
- package/data/pages/Templates/templates/feature-cards.json +103 -0
- package/data/pages/Templates/templates/form-summary.json +39 -0
- package/data/pages/Templates/templates/form-toggle.json +39 -0
- package/data/pages/Templates/templates/list-blocks.json +119 -0
- package/data/pages/Templates/templates/loading-progress.json +39 -0
- package/data/pages/Templates/templates/options-panel.json +39 -0
- package/data/pages/Templates/templates/panel-variants.json +39 -0
- package/data/pages/Templates/templates/progress-cards.json +71 -0
- package/data/pages/Templates/templates/progress-success.json +39 -0
- package/data/pages/Templates/templates/settings-form.json +39 -0
- package/data/pages/Templates/templates/stats-blocks.json +135 -0
- package/data/pages/Templates/templates/table-panel.json +39 -0
- package/data/pages/Templates/templates/table-row-animation.json +39 -0
- package/data/pages/Templates/templates/usage-cards.json +39 -0
- package/data/pages/Utilities/utilities/deviceutils.json +39 -0
- package/data/pages/Utilities/utilities/featuretoggles.json +42 -0
- package/data/pages/Utilities/utilities/fueltypeutils.json +118 -0
- package/data/pages/Utilities/utilities/routeutils.json +34 -0
- package/data/pages/Utilities/utilities/useaftermount.json +63 -0
- package/data/pages/Utilities/utilities/useaverage.json +86 -0
- package/data/pages/Utilities/utilities/useclickoutside.json +69 -0
- package/data/pages/Utilities/utilities/useclipboard.json +57 -0
- package/data/pages/Utilities/utilities/usecount.json +92 -0
- package/data/pages/Utilities/utilities/usedarkmode.json +50 -0
- package/data/pages/Utilities/utilities/usedebuginfo.json +63 -0
- package/data/pages/Utilities/utilities/useeffectonce.json +57 -0
- package/data/pages/Utilities/utilities/useelapsedtime.json +57 -0
- package/data/pages/Utilities/utilities/useelementsize.json +63 -0
- package/data/pages/Utilities/utilities/useesc.json +57 -0
- package/data/pages/Utilities/utilities/useevent.json +75 -0
- package/data/pages/Utilities/utilities/usefocustrap.json +57 -0
- package/data/pages/Utilities/utilities/usefullscreen.json +197 -0
- package/data/pages/Utilities/utilities/usehover.json +57 -0
- package/data/pages/Utilities/utilities/useinterval.json +63 -0
- package/data/pages/Utilities/utilities/useisfocuswithin.json +75 -0
- package/data/pages/Utilities/utilities/usekey.json +75 -0
- package/data/pages/Utilities/utilities/uselocalstorage.json +69 -0
- package/data/pages/Utilities/utilities/uselocationsuggestions.json +110 -0
- package/data/pages/Utilities/utilities/usemax.json +86 -0
- package/data/pages/Utilities/utilities/usemin.json +86 -0
- package/data/pages/Utilities/utilities/usemutationobserver.json +69 -0
- package/data/pages/Utilities/utilities/useonlinestatus.json +39 -0
- package/data/pages/Utilities/utilities/useonscreen.json +63 -0
- package/data/pages/Utilities/utilities/usepostmessage.json +80 -0
- package/data/pages/Utilities/utilities/useprevious.json +63 -0
- package/data/pages/Utilities/utilities/useresizeobserver.json +65 -0
- package/data/pages/Utilities/utilities/usescrollposition.json +103 -0
- package/data/pages/Utilities/utilities/usesearch.json +197 -0
- package/data/pages/Utilities/utilities/usesorting.json +139 -0
- package/data/pages/Utilities/utilities/usestatewithvalidation.json +69 -0
- package/data/pages/Utilities/utilities/usesum.json +86 -0
- package/data/pages/Utilities/utilities/usetableexport.json +87 -0
- package/data/pages/Utilities/utilities/usetableselection.json +311 -0
- package/data/pages/Utilities/utilities/usetimeout.json +63 -0
- package/data/pages/Utilities/utilities/usetoggle.json +75 -0
- package/data/pages/Utilities/utilities/usewindowresize.json +63 -0
- package/data/version.json +4 -0
- package/docs/content-schema.md +147 -0
- package/docs/navigation-inventory.json +1310 -0
- package/docs/search-synonyms.json +43 -0
- package/package.json +38 -0
- package/server/index.mjs +268 -0
- package/server/lib/load-docs.mjs +48 -0
- package/server/lib/normalise-doc.mjs +220 -0
- package/server/lib/render-markdown.mjs +82 -0
- package/server/lib/search-index.mjs +49 -0
- package/server/lib/types.js +99 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"captured_at": "2025-11-21T12:07:39.291Z",
|
|
4
|
+
"source": "https://uikit.developers.rio.cloud/#components/groupedItemList",
|
|
5
|
+
"category": "Components",
|
|
6
|
+
"section": "Content",
|
|
7
|
+
"slug": "components/groupeditemlist",
|
|
8
|
+
"version": "v1.13.2",
|
|
9
|
+
"hash_algorithm": "sha256",
|
|
10
|
+
"hash": "19e74beb2f592b68f8d8a1135e8459afc72819150f72229102c4101c63656c9c"
|
|
11
|
+
},
|
|
12
|
+
"title": "GroupedItemList",
|
|
13
|
+
"lead": null,
|
|
14
|
+
"content": [
|
|
15
|
+
{
|
|
16
|
+
"heading": "GroupedItemList",
|
|
17
|
+
"body": "",
|
|
18
|
+
"examples": [
|
|
19
|
+
{
|
|
20
|
+
"caption": "Grouped by name (default)",
|
|
21
|
+
"rendered_html": "<div class=\"playground-content bg-lightest padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><h4>Grouped by name (default)</h4><div class=\"grouped-item-list \"><div class=\"group-divider \"><div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">A</div></div><ul class=\"list-group border rounded shadow-default\"><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Aaron</div><div>bar2</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Alice</div><div>bar1</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Amelia</div><div>bar3</div></div></li></ul><div class=\"group-divider \"><div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">B</div></div><ul class=\"list-group border rounded shadow-default\"><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Barbara</div><div>bar5</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Bob</div><div>bar4</div></div></li></ul><div class=\"group-divider \"><div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">C</div></div><ul class=\"list-group border rounded shadow-default\"><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Carl</div><div>bar7</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Catherine</div><div>bar8</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 list-group-item-warning\"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Charlie</div><div>bar6</div></div></li></ul><div class=\"group-divider \"><div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">D</div></div><ul class=\"list-group border rounded shadow-default\"><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Daniel</div><div>bar10</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">David</div><div>bar9</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Diana</div><div>bar11</div></div></li></ul><div class=\"group-divider \"><div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">E</div></div><ul class=\"list-group border rounded shadow-default\"><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Edward</div><div>bar12</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Eleanor</div><div>bar14</div></div></li><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Eve</div><div>bar13</div></div></li></ul><div class=\"group-divider \"><div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">F</div></div><ul class=\"list-group border rounded shadow-default\"><li class=\"list-group-item display-flex gap-15 padding-y-15 \"><div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\"><span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\"></span></div><div><div class=\"text-bold\">Fred</div><div>bar15</div></div></li></ul></div></div></div>",
|
|
22
|
+
"tabs": [
|
|
23
|
+
{
|
|
24
|
+
"label": "React",
|
|
25
|
+
"language": "tsx",
|
|
26
|
+
"code": "import GroupedItemList from '@rio-cloud/rio-uikit/GroupedItemList';\n\ntype CustomItem = {\n id: string;\n name: string;\n foo: string;\n creationDate: string;\n};\n\nconst items: CustomItem[] = [\n { id: '1', name: 'Alice', foo: 'bar1', creationDate: '2024-09-01' },\n { id: '2', name: 'Aaron', foo: 'bar2', creationDate: '2024-09-01' },\n { id: '3', name: 'Amelia', foo: 'bar3', creationDate: '2024-09-01' },\n { id: '4', name: 'Bob', foo: 'bar4', creationDate: '2024-09-02' },\n { id: '5', name: 'Barbara', foo: 'bar5', creationDate: '2024-09-02' },\n { id: '6', name: 'Charlie', foo: 'bar6', creationDate: '2024-09-03' },\n { id: '7', name: 'Carl', foo: 'bar7', creationDate: '2024-09-03' },\n { id: '8', name: 'Catherine', foo: 'bar8', creationDate: '2024-09-03' },\n { id: '9', name: 'David', foo: 'bar9', creationDate: '2024-09-04' },\n { id: '10', name: 'Daniel', foo: 'bar10', creationDate: '2024-09-04' },\n { id: '11', name: 'Diana', foo: 'bar11', creationDate: '2024-09-05' },\n { id: '12', name: 'Edward', foo: 'bar12', creationDate: '2024-09-05' },\n { id: '13', name: 'Eve', foo: 'bar13', creationDate: '2024-09-06' },\n { id: '14', name: 'Eleanor', foo: 'bar14', creationDate: '2024-09-06' },\n { id: '15', name: 'Fred', foo: 'bar15', creationDate: '2024-09-07' },\n];\n\nexport default () => {\n // Custom render function for group dividers\n const renderCustomDivider = (groupKey: string) => (\n <div className='text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16'>{groupKey}</div>\n );\n\n // Custom render function for list items (rendered as <li> when using <ul>)\n const renderCustomItem = (item: CustomItem) => (\n <li\n key={item.id}\n className={`list-group-item display-flex gap-15 padding-y-15 ${item.id === '6' ? 'list-group-item-warning' : ''}`}\n >\n <div className='rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40'>\n <span className='rioglyph rioglyph-user text-size-20 text-color-darker' />\n </div>\n <div>\n <div className='text-bold'>{item.name}</div>\n <div>{item.foo}</div>\n </div>\n </li>\n );\n\n return (\n <div>\n <h4>Grouped by name (default)</h4>\n <GroupedItemList\n items={items}\n renderDivider={renderCustomDivider}\n renderItem={renderCustomItem}\n listElement='ul' // Render the list as unordered list\n listElementClassName='list-group border rounded shadow-default'\n />\n </div>\n );\n};"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "HTML",
|
|
30
|
+
"language": "html",
|
|
31
|
+
"code": "<div>\n <h4>Grouped by name (default)</h4>\n <div class=\"grouped-item-list \">\n <div class=\"group-divider \">\n <div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">A</div>\n </div>\n <ul class=\"list-group border rounded shadow-default\">\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Aaron</div>\n <div>bar2</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Alice</div>\n <div>bar1</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Amelia</div>\n <div>bar3</div>\n </div>\n </li>\n </ul>\n <div class=\"group-divider \">\n <div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">B</div>\n </div>\n <ul class=\"list-group border rounded shadow-default\">\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Barbara</div>\n <div>bar5</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Bob</div>\n <div>bar4</div>\n </div>\n </li>\n </ul>\n <div class=\"group-divider \">\n <div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">C</div>\n </div>\n <ul class=\"list-group border rounded shadow-default\">\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Carl</div>\n <div>bar7</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Catherine</div>\n <div>bar8</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 list-group-item-warning\">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Charlie</div>\n <div>bar6</div>\n </div>\n </li>\n </ul>\n <div class=\"group-divider \">\n <div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">D</div>\n </div>\n <ul class=\"list-group border rounded shadow-default\">\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Daniel</div>\n <div>bar10</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">David</div>\n <div>bar9</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Diana</div>\n <div>bar11</div>\n </div>\n </li>\n </ul>\n <div class=\"group-divider \">\n <div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">E</div>\n </div>\n <ul class=\"list-group border rounded shadow-default\">\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Edward</div>\n <div>bar12</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Eleanor</div>\n <div>bar14</div>\n </div>\n </li>\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Eve</div>\n <div>bar13</div>\n </div>\n </li>\n </ul>\n <div class=\"group-divider \">\n <div class=\"text-color-dark text-medium margin-bottom-10 margin-top-25 text-size-16\">F</div>\n </div>\n <ul class=\"list-group border rounded shadow-default\">\n <li class=\"list-group-item display-flex gap-15 padding-y-15 \">\n <div class=\"rounded-circle aspect-ratio-1 display-grid place-items-center border max-width-40 width-40\">\n <span class=\"rioglyph rioglyph-user text-size-20 text-color-darker\">\n </span>\n </div>\n <div>\n <div class=\"text-bold\">Fred</div>\n <div>bar15</div>\n </div>\n </li>\n </ul>\n </div>\n</div>"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"label": "Props",
|
|
35
|
+
"language": "json",
|
|
36
|
+
"code": null,
|
|
37
|
+
"props": [
|
|
38
|
+
{
|
|
39
|
+
"heading": null,
|
|
40
|
+
"rows": [
|
|
41
|
+
{
|
|
42
|
+
"name": "items",
|
|
43
|
+
"type": "Array",
|
|
44
|
+
"default": "",
|
|
45
|
+
"description": "The list of items to be grouped and rendered. By default, the component assumes an item object containing an \"id\" and \"name\" property plus some other attributes."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "groupBy",
|
|
49
|
+
"type": "String / Function",
|
|
50
|
+
"default": "",
|
|
51
|
+
"description": "The property of the items to group by, either as a string (e.g., \"name\") or a custom grouping function. If not provided, it defaults to grouping by \"name\"."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "groupSortOrder",
|
|
55
|
+
"type": "String",
|
|
56
|
+
"default": "asc",
|
|
57
|
+
"description": "Defines the sort order for groups. Accepts \"asc\" for ascending or \"desc\" for descending order."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "itemSortOrder",
|
|
61
|
+
"type": "String",
|
|
62
|
+
"default": "asc",
|
|
63
|
+
"description": "Defines the sort order for items within each group. Accepts \"asc\" for ascending or \"desc\" for descending order."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "groupSortFunction",
|
|
67
|
+
"type": "Function",
|
|
68
|
+
"default": "",
|
|
69
|
+
"description": "Optional sorting function for the groups. It takes an array of groups and returns them in the desired order."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "itemSortFunction",
|
|
73
|
+
"type": "Function",
|
|
74
|
+
"default": "",
|
|
75
|
+
"description": "Optional sorting function for items within each group. It takes an array of items and returns them in the desired order."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "renderDivider",
|
|
79
|
+
"type": "Function",
|
|
80
|
+
"default": "",
|
|
81
|
+
"description": "Custom render function for the group divider. Receives the group key as a parameter and should return a React node to render as the divider."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "renderItem",
|
|
85
|
+
"type": "Function",
|
|
86
|
+
"default": "",
|
|
87
|
+
"description": "Custom render function for individual list items. Receives an item as a parameter and should return a React node representing the item."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "listElement",
|
|
91
|
+
"type": "\"div\" | \"ul\"",
|
|
92
|
+
"default": "div",
|
|
93
|
+
"description": "Specifies the HTML element to use for the list inside each group. Defaults to \"div\", but \"ul\" can be used if rendering list items as `<li>` elements."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "listElementClassName",
|
|
97
|
+
"type": "String",
|
|
98
|
+
"default": "",
|
|
99
|
+
"description": "Optional class name for the list element inside each group (applies to the `div` or `ul` wrapping the items)."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "dividerElementClassName",
|
|
103
|
+
"type": "String",
|
|
104
|
+
"default": "",
|
|
105
|
+
"description": "Optional class name for the divider element in each group (applies to the `div` wrapping each group divider)."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "className",
|
|
109
|
+
"type": "String",
|
|
110
|
+
"default": "",
|
|
111
|
+
"description": "Optional class name for the outer wrapper element (applies to the outer `div` wrapping the entire component)."
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"caption": "Grouped by date",
|
|
121
|
+
"rendered_html": "<div class=\"playground-content bg-lightest padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><h4>Grouped by date</h4><div class=\"btn-toolbar\"><button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Switch group sort order</button><button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Switch item sort order</button></div><div class=\"grouped-item-list \"><div class=\"group-divider \"><div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-07</div></div><div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Parcel O</div><div class=\"text-light\">(Pending)</div></div></div><div class=\"group-divider \"><div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-06</div></div><div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Truck N</div><div class=\"text-light\">(Delivered)</div></div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Truck M</div><div class=\"text-light\">(In Transit)</div></div></div><div class=\"group-divider \"><div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-05</div></div><div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Freight L</div><div class=\"text-light\">(Pending)</div></div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Freight K</div><div class=\"text-light\">(Delivered)</div></div></div><div class=\"group-divider \"><div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-04</div></div><div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Pallet J</div><div class=\"text-light\">(In Transit)</div></div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Pallet I</div><div class=\"text-light\">(Pending)</div></div></div><div class=\"group-divider \"><div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-03</div></div><div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Container H</div><div class=\"text-light\">(Delivered)</div></div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Container G</div><div class=\"text-light\">(In Transit)</div></div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Container F</div><div class=\"text-light\">(Pending)</div></div></div><div class=\"group-divider \"><div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-02</div></div><div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Package E</div><div class=\"text-light\">(Delivered)</div></div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Package D</div><div class=\"text-light\">(In Transit)</div></div></div><div class=\"group-divider \"><div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-01</div></div><div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Shipment C</div><div class=\"text-light\">(Pending)</div></div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Shipment B</div><div class=\"text-light\">(Delivered)</div></div><div class=\"padding-10 border border-bottom-only display-flex gap-5\"><div>Shipment A</div><div class=\"text-light\">(In Transit)</div></div></div></div></div></div>",
|
|
122
|
+
"tabs": [
|
|
123
|
+
{
|
|
124
|
+
"label": "React",
|
|
125
|
+
"language": "tsx",
|
|
126
|
+
"code": "import { useState } from 'react';\n\nimport GroupedItemList, { type Group } from '@rio-cloud/rio-uikit/GroupedItemList';\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport { naturalSortByProperty, sortByProperty } from '@rio-cloud/rio-uikit/SortUtils';\n\ntype LogisticItem = {\n id: string;\n name: string;\n status: string;\n deliveryDate: string;\n};\n\nconst logisticItems: LogisticItem[] = [\n { id: '1', name: 'Shipment A', status: 'In Transit', deliveryDate: '2024-09-01' },\n { id: '2', name: 'Shipment B', status: 'Delivered', deliveryDate: '2024-09-01' },\n { id: '3', name: 'Shipment C', status: 'Pending', deliveryDate: '2024-09-01' },\n { id: '4', name: 'Package D', status: 'In Transit', deliveryDate: '2024-09-02' },\n { id: '5', name: 'Package E', status: 'Delivered', deliveryDate: '2024-09-02' },\n { id: '6', name: 'Container F', status: 'Pending', deliveryDate: '2024-09-03' },\n { id: '7', name: 'Container G', status: 'In Transit', deliveryDate: '2024-09-03' },\n { id: '8', name: 'Container H', status: 'Delivered', deliveryDate: '2024-09-03' },\n { id: '9', name: 'Pallet I', status: 'Pending', deliveryDate: '2024-09-04' },\n { id: '10', name: 'Pallet J', status: 'In Transit', deliveryDate: '2024-09-04' },\n { id: '11', name: 'Freight K', status: 'Delivered', deliveryDate: '2024-09-05' },\n { id: '12', name: 'Freight L', status: 'Pending', deliveryDate: '2024-09-05' },\n { id: '13', name: 'Truck M', status: 'In Transit', deliveryDate: '2024-09-06' },\n { id: '14', name: 'Truck N', status: 'Delivered', deliveryDate: '2024-09-06' },\n { id: '15', name: 'Parcel O', status: 'Pending', deliveryDate: '2024-09-07' },\n];\n\nexport default () => {\n const [sortOrder, setSortOrder] = useState<'asc' | 'desc'>('desc');\n const [itemSortOrder, setItemSortOrder] = useState<'asc' | 'desc'>('desc');\n\n const handleChangeSortOrder = () => {\n setSortOrder(prevOrder => (prevOrder === 'asc' ? 'desc' : 'asc'));\n };\n\n const handleChangeItemSortOrder = () => {\n setItemSortOrder(prevOrder => (prevOrder === 'asc' ? 'desc' : 'asc'));\n };\n\n // Custom render function for group dividers\n const renderCustomDivider = (groupKey: string) => (\n <div className='text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16'>{groupKey}</div>\n );\n\n // Custom render function for list items (rendered as <li> when using <ul>)\n const renderSimpleCustomItem = (item: LogisticItem) => (\n <div key={item.id} className='padding-10 border border-bottom-only display-flex gap-5'>\n <div>{item.name}</div>\n <div className='text-light'>({item.status})</div>\n </div>\n );\n\n // Sorting function for groups by deliveryDate\n const groupSortFunction = (groups: Group[]) => {\n return naturalSortByProperty(groups, 'groupKey', sortOrder);\n };\n\n // Sorting function for items within each group\n const itemSortFunction = (items: LogisticItem[]) => {\n return sortByProperty(items, 'name', itemSortOrder);\n };\n\n return (\n <div>\n <h4>Grouped by date</h4>\n <div className='btn-toolbar'>\n <Button onClick={handleChangeSortOrder}>Switch group sort order</Button>\n <Button onClick={handleChangeItemSortOrder}>Switch item sort order</Button>\n </div>\n <GroupedItemList\n items={logisticItems}\n groupBy={(item: LogisticItem) => item.deliveryDate}\n groupSortOrder={sortOrder}\n groupSortFunction={groupSortFunction}\n itemSortFunction={itemSortFunction}\n renderDivider={renderCustomDivider}\n renderItem={renderSimpleCustomItem}\n />\n </div>\n );\n};"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"label": "HTML",
|
|
130
|
+
"language": "html",
|
|
131
|
+
"code": "<div>\n <h4>Grouped by date</h4>\n <div class=\"btn-toolbar\">\n <button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Switch group sort order</button>\n <button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Switch item sort order</button>\n </div>\n <div class=\"grouped-item-list \">\n <div class=\"group-divider \">\n <div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-07</div>\n </div>\n <div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Parcel O</div>\n <div class=\"text-light\">(Pending)</div>\n </div>\n </div>\n <div class=\"group-divider \">\n <div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-06</div>\n </div>\n <div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Truck N</div>\n <div class=\"text-light\">(Delivered)</div>\n </div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Truck M</div>\n <div class=\"text-light\">(In Transit)</div>\n </div>\n </div>\n <div class=\"group-divider \">\n <div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-05</div>\n </div>\n <div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Freight L</div>\n <div class=\"text-light\">(Pending)</div>\n </div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Freight K</div>\n <div class=\"text-light\">(Delivered)</div>\n </div>\n </div>\n <div class=\"group-divider \">\n <div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-04</div>\n </div>\n <div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Pallet J</div>\n <div class=\"text-light\">(In Transit)</div>\n </div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Pallet I</div>\n <div class=\"text-light\">(Pending)</div>\n </div>\n </div>\n <div class=\"group-divider \">\n <div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-03</div>\n </div>\n <div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Container H</div>\n <div class=\"text-light\">(Delivered)</div>\n </div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Container G</div>\n <div class=\"text-light\">(In Transit)</div>\n </div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Container F</div>\n <div class=\"text-light\">(Pending)</div>\n </div>\n </div>\n <div class=\"group-divider \">\n <div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-02</div>\n </div>\n <div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Package E</div>\n <div class=\"text-light\">(Delivered)</div>\n </div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Package D</div>\n <div class=\"text-light\">(In Transit)</div>\n </div>\n </div>\n <div class=\"group-divider \">\n <div class=\"text-color-darker text-medium margin-bottom-5 margin-top-50 text-size-16\">2024-09-01</div>\n </div>\n <div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Shipment C</div>\n <div class=\"text-light\">(Pending)</div>\n </div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Shipment B</div>\n <div class=\"text-light\">(Delivered)</div>\n </div>\n <div class=\"padding-10 border border-bottom-only display-flex gap-5\">\n <div>Shipment A</div>\n <div class=\"text-light\">(In Transit)</div>\n </div>\n </div>\n </div>\n</div>"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"label": "Props",
|
|
135
|
+
"language": "json",
|
|
136
|
+
"code": null,
|
|
137
|
+
"props": [
|
|
138
|
+
{
|
|
139
|
+
"heading": null,
|
|
140
|
+
"rows": [
|
|
141
|
+
{
|
|
142
|
+
"name": "items",
|
|
143
|
+
"type": "Array",
|
|
144
|
+
"default": "",
|
|
145
|
+
"description": "The list of items to be grouped and rendered. By default, the component assumes an item object containing an \"id\" and \"name\" property plus some other attributes."
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "groupBy",
|
|
149
|
+
"type": "String / Function",
|
|
150
|
+
"default": "",
|
|
151
|
+
"description": "The property of the items to group by, either as a string (e.g., \"name\") or a custom grouping function. If not provided, it defaults to grouping by \"name\"."
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "groupSortOrder",
|
|
155
|
+
"type": "String",
|
|
156
|
+
"default": "asc",
|
|
157
|
+
"description": "Defines the sort order for groups. Accepts \"asc\" for ascending or \"desc\" for descending order."
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "itemSortOrder",
|
|
161
|
+
"type": "String",
|
|
162
|
+
"default": "asc",
|
|
163
|
+
"description": "Defines the sort order for items within each group. Accepts \"asc\" for ascending or \"desc\" for descending order."
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "groupSortFunction",
|
|
167
|
+
"type": "Function",
|
|
168
|
+
"default": "",
|
|
169
|
+
"description": "Optional sorting function for the groups. It takes an array of groups and returns them in the desired order."
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "itemSortFunction",
|
|
173
|
+
"type": "Function",
|
|
174
|
+
"default": "",
|
|
175
|
+
"description": "Optional sorting function for items within each group. It takes an array of items and returns them in the desired order."
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "renderDivider",
|
|
179
|
+
"type": "Function",
|
|
180
|
+
"default": "",
|
|
181
|
+
"description": "Custom render function for the group divider. Receives the group key as a parameter and should return a React node to render as the divider."
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "renderItem",
|
|
185
|
+
"type": "Function",
|
|
186
|
+
"default": "",
|
|
187
|
+
"description": "Custom render function for individual list items. Receives an item as a parameter and should return a React node representing the item."
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "listElement",
|
|
191
|
+
"type": "\"div\" | \"ul\"",
|
|
192
|
+
"default": "div",
|
|
193
|
+
"description": "Specifies the HTML element to use for the list inside each group. Defaults to \"div\", but \"ul\" can be used if rendering list items as `<li>` elements."
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "listElementClassName",
|
|
197
|
+
"type": "String",
|
|
198
|
+
"default": "",
|
|
199
|
+
"description": "Optional class name for the list element inside each group (applies to the `div` or `ul` wrapping the items)."
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "dividerElementClassName",
|
|
203
|
+
"type": "String",
|
|
204
|
+
"default": "",
|
|
205
|
+
"description": "Optional class name for the divider element in each group (applies to the `div` wrapping each group divider)."
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "className",
|
|
209
|
+
"type": "String",
|
|
210
|
+
"default": "",
|
|
211
|
+
"description": "Optional class name for the outer wrapper element (applies to the outer `div` wrapping the entire component)."
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"caption": "Example 3",
|
|
221
|
+
"rendered_html": "<div class=\"playground-content bg-lightest padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><h5>Grouped by custom key with basic styling</h5><div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\"><div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\"></div></div><div class=\"grouped-item-list \"><div class=\"group-divider \">A</div><ul class=\"margin-bottom-20\"><li><span class=\"text-bold\">Air Freight: </span><span>The transportation of goods via air</span></li><li><span class=\"text-bold\">Air Waybill (AWB): </span><span>A document for air shipments detailing the goods and their destination</span></li></ul><div class=\"group-divider \">B</div><ul class=\"margin-bottom-20\"><li><span class=\"text-bold\">Bill of Lading (B/L): </span><span>A contract between the shipper and the carrier for ocean transport</span></li><li><span class=\"text-bold\">Bulk Cargo: </span><span>Unpackaged goods shipped in large quantities, like grains or coal</span></li></ul><div class=\"group-divider \">C</div><ul class=\"margin-bottom-20\"><li><span class=\"text-bold\">Cargo: </span><span>Goods transported by a vehicle such as a ship, truck, or aircraft</span></li><li><span class=\"text-bold\">Carrier: </span><span>A company that transports goods via road, rail, sea, or air</span></li><li><span class=\"text-bold\">Consignee: </span><span>The person or company receiving the shipment</span></li><li><span class=\"text-bold\">Customs: </span><span>Government agency responsible for regulating shipments entering a country</span></li></ul><div class=\"group-divider \">D</div><ul class=\"margin-bottom-20\"><li><span class=\"text-bold\">Dangerous Goods: </span><span>Items that require special handling due to safety concerns, like chemicals</span></li><li><span class=\"text-bold\">Demurrage: </span><span>A charge for delaying the return of a container beyond the allowed time</span></li></ul><div class=\"group-divider \">F</div><ul class=\"margin-bottom-20\"><li><span class=\"text-bold\">Freight Forwarder: </span><span>A company that organizes shipments on behalf of shippers</span></li><li><span class=\"text-bold\">Full Container Load (FCL): </span><span>A shipment that fills an entire container</span></li></ul><div class=\"group-divider \">L</div><ul class=\"margin-bottom-20\"><li><span class=\"text-bold\">Logistics: </span><span>The management of the flow of goods between the point of origin and consumption</span></li><li><span class=\"text-bold\">LTL (Less than Truckload): </span><span>A shipment that doesn’t require a full truckload</span></li></ul><div class=\"group-divider \">V</div><ul class=\"margin-bottom-20\"><li><span class=\"text-bold\">Vessel: </span><span>A large ship used to transport goods across seas and oceans</span></li></ul></div></div></div>",
|
|
222
|
+
"tabs": [
|
|
223
|
+
{
|
|
224
|
+
"label": "React",
|
|
225
|
+
"language": "tsx",
|
|
226
|
+
"code": "import Divider from '@rio-cloud/rio-uikit/Divider';\nimport GroupedItemList from '@rio-cloud/rio-uikit/GroupedItemList';\n\ntype Item = {\n id: string;\n term: string;\n explanation: string;\n};\n\nconst items = [\n { id: '1', term: 'Air Freight', explanation: 'The transportation of goods via air' },\n {\n id: '2',\n term: 'Air Waybill (AWB)',\n explanation: 'A document for air shipments detailing the goods and their destination',\n },\n {\n id: '3',\n term: 'Bill of Lading (B/L)',\n explanation: 'A contract between the shipper and the carrier for ocean transport',\n },\n { id: '4', term: 'Bulk Cargo', explanation: 'Unpackaged goods shipped in large quantities, like grains or coal' },\n { id: '5', term: 'Cargo', explanation: 'Goods transported by a vehicle such as a ship, truck, or aircraft' },\n { id: '6', term: 'Carrier', explanation: 'A company that transports goods via road, rail, sea, or air' },\n { id: '7', term: 'Consignee', explanation: 'The person or company receiving the shipment' },\n {\n id: '8',\n term: 'Customs',\n explanation: 'Government agency responsible for regulating shipments entering a country',\n },\n {\n id: '9',\n term: 'Demurrage',\n explanation: 'A charge for delaying the return of a container beyond the allowed time',\n },\n {\n id: '10',\n term: 'Dangerous Goods',\n explanation: 'Items that require special handling due to safety concerns, like chemicals',\n },\n { id: '11', term: 'Freight Forwarder', explanation: 'A company that organizes shipments on behalf of shippers' },\n { id: '12', term: 'Full Container Load (FCL)', explanation: 'A shipment that fills an entire container' },\n { id: '13', term: 'LTL (Less than Truckload)', explanation: 'A shipment that doesn’t require a full truckload' },\n {\n id: '14',\n term: 'Logistics',\n explanation: 'The management of the flow of goods between the point of origin and consumption',\n },\n { id: '15', term: 'Vessel', explanation: 'A large ship used to transport goods across seas and oceans' },\n];\n\nexport default () => {\n // Custom render function for list items (rendered as <li> when using <ul>)\n const renderCustomItem = (item: Item) => (\n <li key={item.id}>\n <span className='text-bold'>{item.term}: </span>\n <span>{item.explanation}</span>\n </li>\n );\n\n return (\n <div>\n <h5>Grouped by custom key with basic styling</h5>\n <Divider />\n <GroupedItemList\n items={items}\n groupBy='term'\n renderItem={renderCustomItem}\n listElement='ul'\n listElementClassName='margin-bottom-20'\n />\n </div>\n );\n};"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"label": "HTML",
|
|
230
|
+
"language": "html",
|
|
231
|
+
"code": "<div>\n <h5>Grouped by custom key with basic styling</h5>\n <div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\">\n <div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\">\n </div>\n </div>\n <div class=\"grouped-item-list \">\n <div class=\"group-divider \">A</div>\n <ul class=\"margin-bottom-20\">\n <li>\n <span class=\"text-bold\">Air Freight: </span>\n <span>The transportation of goods via air</span>\n </li>\n <li>\n <span class=\"text-bold\">Air Waybill (AWB): </span>\n <span>A document for air shipments detailing the goods and their destination</span>\n </li>\n </ul>\n <div class=\"group-divider \">B</div>\n <ul class=\"margin-bottom-20\">\n <li>\n <span class=\"text-bold\">Bill of Lading (B/L): </span>\n <span>A contract between the shipper and the carrier for ocean transport</span>\n </li>\n <li>\n <span class=\"text-bold\">Bulk Cargo: </span>\n <span>Unpackaged goods shipped in large quantities, like grains or coal</span>\n </li>\n </ul>\n <div class=\"group-divider \">C</div>\n <ul class=\"margin-bottom-20\">\n <li>\n <span class=\"text-bold\">Cargo: </span>\n <span>Goods transported by a vehicle such as a ship, truck, or aircraft</span>\n </li>\n <li>\n <span class=\"text-bold\">Carrier: </span>\n <span>A company that transports goods via road, rail, sea, or air</span>\n </li>\n <li>\n <span class=\"text-bold\">Consignee: </span>\n <span>The person or company receiving the shipment</span>\n </li>\n <li>\n <span class=\"text-bold\">Customs: </span>\n <span>Government agency responsible for regulating shipments entering a country</span>\n </li>\n </ul>\n <div class=\"group-divider \">D</div>\n <ul class=\"margin-bottom-20\">\n <li>\n <span class=\"text-bold\">Dangerous Goods: </span>\n <span>Items that require special handling due to safety concerns, like chemicals</span>\n </li>\n <li>\n <span class=\"text-bold\">Demurrage: </span>\n <span>A charge for delaying the return of a container beyond the allowed time</span>\n </li>\n </ul>\n <div class=\"group-divider \">F</div>\n <ul class=\"margin-bottom-20\">\n <li>\n <span class=\"text-bold\">Freight Forwarder: </span>\n <span>A company that organizes shipments on behalf of shippers</span>\n </li>\n <li>\n <span class=\"text-bold\">Full Container Load (FCL): </span>\n <span>A shipment that fills an entire container</span>\n </li>\n </ul>\n <div class=\"group-divider \">L</div>\n <ul class=\"margin-bottom-20\">\n <li>\n <span class=\"text-bold\">Logistics: </span>\n <span>The management of the flow of goods between the point of origin and consumption</span>\n </li>\n <li>\n <span class=\"text-bold\">LTL (Less than Truckload): </span>\n <span>A shipment that doesn’t require a full truckload</span>\n </li>\n </ul>\n <div class=\"group-divider \">V</div>\n <ul class=\"margin-bottom-20\">\n <li>\n <span class=\"text-bold\">Vessel: </span>\n <span>A large ship used to transport goods across seas and oceans</span>\n </li>\n </ul>\n </div>\n</div>"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"label": "Props",
|
|
235
|
+
"language": "json",
|
|
236
|
+
"code": null,
|
|
237
|
+
"props": [
|
|
238
|
+
{
|
|
239
|
+
"heading": null,
|
|
240
|
+
"rows": [
|
|
241
|
+
{
|
|
242
|
+
"name": "items",
|
|
243
|
+
"type": "Array",
|
|
244
|
+
"default": "",
|
|
245
|
+
"description": "The list of items to be grouped and rendered. By default, the component assumes an item object containing an \"id\" and \"name\" property plus some other attributes."
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "groupBy",
|
|
249
|
+
"type": "String / Function",
|
|
250
|
+
"default": "",
|
|
251
|
+
"description": "The property of the items to group by, either as a string (e.g., \"name\") or a custom grouping function. If not provided, it defaults to grouping by \"name\"."
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "groupSortOrder",
|
|
255
|
+
"type": "String",
|
|
256
|
+
"default": "asc",
|
|
257
|
+
"description": "Defines the sort order for groups. Accepts \"asc\" for ascending or \"desc\" for descending order."
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "itemSortOrder",
|
|
261
|
+
"type": "String",
|
|
262
|
+
"default": "asc",
|
|
263
|
+
"description": "Defines the sort order for items within each group. Accepts \"asc\" for ascending or \"desc\" for descending order."
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "groupSortFunction",
|
|
267
|
+
"type": "Function",
|
|
268
|
+
"default": "",
|
|
269
|
+
"description": "Optional sorting function for the groups. It takes an array of groups and returns them in the desired order."
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "itemSortFunction",
|
|
273
|
+
"type": "Function",
|
|
274
|
+
"default": "",
|
|
275
|
+
"description": "Optional sorting function for items within each group. It takes an array of items and returns them in the desired order."
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "renderDivider",
|
|
279
|
+
"type": "Function",
|
|
280
|
+
"default": "",
|
|
281
|
+
"description": "Custom render function for the group divider. Receives the group key as a parameter and should return a React node to render as the divider."
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "renderItem",
|
|
285
|
+
"type": "Function",
|
|
286
|
+
"default": "",
|
|
287
|
+
"description": "Custom render function for individual list items. Receives an item as a parameter and should return a React node representing the item."
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"name": "listElement",
|
|
291
|
+
"type": "\"div\" | \"ul\"",
|
|
292
|
+
"default": "div",
|
|
293
|
+
"description": "Specifies the HTML element to use for the list inside each group. Defaults to \"div\", but \"ul\" can be used if rendering list items as `<li>` elements."
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "listElementClassName",
|
|
297
|
+
"type": "String",
|
|
298
|
+
"default": "",
|
|
299
|
+
"description": "Optional class name for the list element inside each group (applies to the `div` or `ul` wrapping the items)."
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"name": "dividerElementClassName",
|
|
303
|
+
"type": "String",
|
|
304
|
+
"default": "",
|
|
305
|
+
"description": "Optional class name for the divider element in each group (applies to the `div` wrapping each group divider)."
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "className",
|
|
309
|
+
"type": "String",
|
|
310
|
+
"default": "",
|
|
311
|
+
"description": "Optional class name for the outer wrapper element (applies to the outer `div` wrapping the entire component)."
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"see_also": []
|
|
323
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"captured_at": "2025-11-21T12:08:01.031Z",
|
|
4
|
+
"source": "https://uikit.developers.rio.cloud/#components/iconList",
|
|
5
|
+
"category": "Components",
|
|
6
|
+
"section": "CSS Only",
|
|
7
|
+
"slug": "components/iconlist",
|
|
8
|
+
"version": "v1.13.2",
|
|
9
|
+
"hash_algorithm": "sha256",
|
|
10
|
+
"hash": "d4661778afbfc083a29b38841e5794cc38936b11a85d7b3f894d535d081680bb"
|
|
11
|
+
},
|
|
12
|
+
"title": "IconList",
|
|
13
|
+
"lead": "The timeline component is a pure CSS component.",
|
|
14
|
+
"content": [
|
|
15
|
+
{
|
|
16
|
+
"heading": "IconList",
|
|
17
|
+
"body": "",
|
|
18
|
+
"examples": [
|
|
19
|
+
{
|
|
20
|
+
"caption": "Example 1",
|
|
21
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"display-grid grid-cols-1 grid-cols-2-sm gap-50\"><div><div class=\"lead \"><div class=\"display-flex justify-content-between\"><div>Icon list</div></div><hr class=\"margin-top-10 border-color-light\"></div><ul class=\"icon-list margin-bottom-0\"><li><span class=\"rioglyph rioglyph-ok-sign text-color-success margin-top--1\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></li><li><span class=\"rioglyph rioglyph-ok-sign text-color-success margin-top--1\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></li><li><span class=\"rioglyph rioglyph-ok-sign text-color-success margin-top--1\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></li></ul></div><div><div class=\"lead \"><div class=\"display-flex justify-content-between\"><div>Icon list</div></div><hr class=\"margin-top-10 border-color-light\"></div><ul class=\"icon-list margin-bottom-0\"><li><span class=\"rioglyph rioglyph-bus margin-top--1\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></li><li><span class=\"rioglyph rioglyph-truck margin-top--1\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></li><li><span class=\"rioglyph rioglyph-truck margin-top--1\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></li></ul></div></div></div>",
|
|
22
|
+
"tabs": [
|
|
23
|
+
{
|
|
24
|
+
"label": "HTML",
|
|
25
|
+
"language": "html",
|
|
26
|
+
"code": "<div class=\"display-grid grid-cols-1 grid-cols-2-sm gap-50\">\n <div>\n <div class=\"lead \">\n <div class=\"display-flex justify-content-between\">\n <div>Icon list</div>\n </div>\n <hr class=\"margin-top-10 border-color-light\">\n </div>\n <ul class=\"icon-list margin-bottom-0\">\n <li>\n <span class=\"rioglyph rioglyph-ok-sign text-color-success margin-top--1\">\n </span>\n <span>\n 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.</span>\n </li>\n <li>\n <span class=\"rioglyph rioglyph-ok-sign text-color-success margin-top--1\">\n </span>\n <span>\n 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.</span>\n </li>\n <li>\n <span class=\"rioglyph rioglyph-ok-sign text-color-success margin-top--1\">\n </span>\n <span>\n 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.</span>\n </li>\n </ul>\n </div>\n <div>\n <div class=\"lead \">\n <div class=\"display-flex justify-content-between\">\n <div>Icon list</div>\n </div>\n <hr class=\"margin-top-10 border-color-light\">\n </div>\n <ul class=\"icon-list margin-bottom-0\">\n <li>\n <span class=\"rioglyph rioglyph-bus margin-top--1\">\n </span>\n <span>\n 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.</span>\n </li>\n <li>\n <span class=\"rioglyph rioglyph-truck margin-top--1\">\n </span>\n <span>\n 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.</span>\n </li>\n <li>\n <span class=\"rioglyph rioglyph-truck margin-top--1\">\n </span>\n <span>\n 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.</span>\n </li>\n </ul>\n </div>\n</div>"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"caption": "Example 2",
|
|
32
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"display-grid grid-cols-1 grid-cols-5-sm gap-50\"><div><div class=\"lead \"><div class=\"display-flex justify-content-between\"><div>Tree list</div></div><hr class=\"margin-top-10 border-color-light\"></div><ul class=\"tree-list margin-bottom-0 margin-left-15\"><li><span>Lorem ipsum</span></li><li><span>Lorem ipsum</span><ul><li>Lorem ipsum<ul><li>Lorem ipsum</li><li>Lorem ipsum</li><li>Lorem ipsum</li></ul></li><li>Lorem ipsum<ul><li>Lorem ipsum</li><li>Lorem ipsum</li><li>Lorem ipsum</li></ul></li></ul></li><li><span>Lorem ipsum</span><ul><li>Lorem ipsum<ul><li>Lorem ipsum</li><li>Lorem ipsum</li><li>Lorem ipsum</li></ul></li><li>Lorem ipsum<ul><li>Lorem ipsum</li><li>Lorem ipsum</li><li>Lorem ipsum</li></ul></li></ul></li><li><span>Lorem Ipsum</span></li></ul></div><div class=\"grid-colspan-2-sm\"><div class=\"lead \"><div class=\"display-flex justify-content-between\"><div>Tree list with panels</div></div><hr class=\"margin-top-10 border-color-light\"></div><ul class=\"tree-list\"><li><div class=\"panel panel-default panel-body margin-bottom-15 shadow-default\"><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></div></li><li><div class=\"panel panel-default panel-body margin-bottom-15 shadow-default\"><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></div></li><li><div class=\"panel panel-default panel-body margin-bottom-15 shadow-default\"><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></div></li></ul></div><div class=\"grid-colspan-2-sm\"><div class=\"lead \"><div class=\"display-flex justify-content-between\"><div>Tree list with icons</div></div><hr class=\"margin-top-10 border-color-light\"></div><ul class=\"tree-list\"><li><div class=\"display-flex gap-5 margin-bottom-10\"><span class=\"rioglyph rioglyph-ok-sign text-color-success text-size-18 margin-top-2\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></div></li><li><div class=\"display-flex gap-5 margin-bottom-10\"><span class=\"rioglyph rioglyph-ok-sign text-color-success text-size-18 margin-top-2\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></div></li><li><div class=\"display-flex gap-5 margin-bottom-10\"><span class=\"rioglyph rioglyph-ok-sign text-color-success text-size-18 margin-top-2\"></span><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis.</span></div></li></ul></div></div></div>",
|
|
33
|
+
"tabs": [
|
|
34
|
+
{
|
|
35
|
+
"label": "HTML",
|
|
36
|
+
"language": "html",
|
|
37
|
+
"code": "<div class=\"display-grid grid-cols-1 grid-cols-5-sm gap-50\">\n <div>\n <div class=\"lead \">\n <div class=\"display-flex justify-content-between\">\n <div>Tree list</div>\n </div>\n <hr class=\"margin-top-10 border-color-light\">\n </div>\n <ul class=\"tree-list margin-bottom-0 margin-left-15\">\n <li>\n <span>Lorem ipsum</span>\n </li>\n <li>\n <span>Lorem ipsum</span>\n <ul>\n <li>Lorem ipsum<ul>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n </ul>\n </li>\n <li>Lorem ipsum<ul>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n </ul>\n </li>\n </ul>\n </li>\n <li>\n <span>Lorem ipsum</span>\n <ul>\n <li>Lorem ipsum<ul>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n </ul>\n </li>\n <li>Lorem ipsum<ul>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n <li>Lorem ipsum</li>\n </ul>\n </li>\n </ul>\n </li>\n <li>\n <span>Lorem Ipsum</span>\n </li>\n </ul>\n </div>\n <div class=\"grid-colspan-2-sm\">\n <div class=\"lead \">\n <div class=\"display-flex justify-content-between\">\n <div>Tree list with panels</div>\n </div>\n <hr class=\"margin-top-10 border-color-light\">\n </div>\n <ul class=\"tree-list\">\n <li>\n <div class=\"panel panel-default panel-body margin-bottom-15 shadow-default\">\n <span>\n 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.</span>\n </div>\n </li>\n <li>\n <div class=\"panel panel-default panel-body margin-bottom-15 shadow-default\">\n <span>\n 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.</span>\n </div>\n </li>\n <li>\n <div class=\"panel panel-default panel-body margin-bottom-15 shadow-default\">\n <span>\n 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.</span>\n </div>\n </li>\n </ul>\n </div>\n <div class=\"grid-colspan-2-sm\">\n <div class=\"lead \">\n <div class=\"display-flex justify-content-between\">\n <div>Tree list with icons</div>\n </div>\n <hr class=\"margin-top-10 border-color-light\">\n </div>\n <ul class=\"tree-list\">\n <li>\n <div class=\"display-flex gap-5 margin-bottom-10\">\n <span class=\"rioglyph rioglyph-ok-sign text-color-success text-size-18 margin-top-2\">\n </span>\n <span>\n 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.</span>\n </div>\n </li>\n <li>\n <div class=\"display-flex gap-5 margin-bottom-10\">\n <span class=\"rioglyph rioglyph-ok-sign text-color-success text-size-18 margin-top-2\">\n </span>\n <span>\n 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.</span>\n </div>\n </li>\n <li>\n <div class=\"display-flex gap-5 margin-bottom-10\">\n <span class=\"rioglyph rioglyph-ok-sign text-color-success text-size-18 margin-top-2\">\n </span>\n <span>\n 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.</span>\n </div>\n </li>\n </ul>\n </div>\n</div>"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"see_also": []
|
|
45
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"captured_at": "2025-11-21T12:07:50.623Z",
|
|
4
|
+
"source": "https://uikit.developers.rio.cloud/#components/imagePreloader",
|
|
5
|
+
"category": "Components",
|
|
6
|
+
"section": "Misc",
|
|
7
|
+
"slug": "components/imagepreloader",
|
|
8
|
+
"version": "v1.13.2",
|
|
9
|
+
"hash_algorithm": "sha256",
|
|
10
|
+
"hash": "11fc70dcc0e56e8cc64e979a57d652532cdc5cafcaa8009e174bc45113e6e9b3"
|
|
11
|
+
},
|
|
12
|
+
"title": "ImagePreloader",
|
|
13
|
+
"lead": "Use the preloader for controlling the various states when fetching the image. It allows to handle the failure case as well.",
|
|
14
|
+
"content": [
|
|
15
|
+
{
|
|
16
|
+
"heading": "ImagePreloader",
|
|
17
|
+
"body": "",
|
|
18
|
+
"examples": [
|
|
19
|
+
{
|
|
20
|
+
"caption": "Example 1",
|
|
21
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"row\"><div class=\"col-md-4\"><div class=\"h5 ellipsis-1\">With Image tag</div><div class=\"position-relative \" style=\"aspect-ratio: 1000 / 560;\"><div class=\"display-grid place-items-center position-absolute inset-0\"><div class=\"spinnerInfoBox display-flex justify-content-center align-items-center height-100pct\"><div class=\"spinner\"><div></div><div></div><div></div><div></div></div></div></div></div></div><div class=\"col-md-4\"><div class=\"h5 ellipsis-1\">As background image without spinner</div></div><div class=\"col-md-4\"><div class=\"h5 ellipsis-1\">Fallback case</div></div></div></div>",
|
|
22
|
+
"tabs": [
|
|
23
|
+
{
|
|
24
|
+
"label": "React",
|
|
25
|
+
"language": "tsx",
|
|
26
|
+
"code": "import ImagePreloader from '@rio-cloud/rio-uikit/ImagePreloader';\nimport AspectRatioPlaceholder from '@rio-cloud/rio-uikit/AspectRatioPlaceholder';\nimport Spinner from '@rio-cloud/rio-uikit/Spinner';\n\nexport default () => (\n <div className='row'>\n <div className='col-md-4'>\n <div className='h5 ellipsis-1'>With Image tag</div>\n {imageExample}\n </div>\n <div className='col-md-4'>\n <div className='h5 ellipsis-1'>As background image without spinner</div>\n {backgroundImageExample}\n </div>\n <div className='col-md-4'>\n <div className='h5 ellipsis-1'>Fallback case</div>\n {failedImageExample}\n </div>\n </div>\n);\n\nconst fallback = (\n <AspectRatioPlaceholder width={1000} height={562}>\n <div className='text-size-h3 display-grid place-items-center position-absolute inset-0'>\n <span className='rioglyph rioglyph-missing text-size-200pct text-color-gray' />\n </div>\n </AspectRatioPlaceholder>\n);\n\nconst imageExample = (\n <ImagePreloader src='https://picsum.photos/1000/560'>\n {({ status, image }) => {\n switch (status) {\n case 'FAILED':\n return fallback;\n\n case 'LOADED':\n // When image has been loaded, render the image tag\n return <img src={image.src} className='img-responsive ani-fade-in' alt='Awesome stuff.' />;\n\n default:\n return (\n <AspectRatioPlaceholder width={1000} height={560}>\n <div className='display-grid place-items-center position-absolute inset-0'>\n <Spinner isInverse={false} />\n </div>\n </AspectRatioPlaceholder>\n );\n }\n }}\n </ImagePreloader>\n);\n\nconst backgroundImageExample = (\n <ImagePreloader src='https://picsum.photos/1000/560'>\n {({ status, image }) => {\n switch (status) {\n case 'FAILED':\n return fallback;\n\n case 'LOADED':\n // When image has been loaded, set it as background\n return (\n <div\n className='bg-size-cover bg-position-center ani-fade-in'\n style={{ backgroundImage: `url(${image.src})` }}\n >\n <AspectRatioPlaceholder width={1000} height={560} />\n </div>\n );\n\n default:\n return null;\n }\n }}\n </ImagePreloader>\n);\n\nconst failedImageExample = (\n <ImagePreloader src='https://not-there'>\n {({ status }) => {\n if (status === 'FAILED') {\n return fallback;\n }\n return null;\n }}\n </ImagePreloader>\n);"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "HTML",
|
|
30
|
+
"language": "html",
|
|
31
|
+
"code": "<div class=\"row\">\n <div class=\"col-md-4\">\n <div class=\"h5 ellipsis-1\">With Image tag</div>\n <div class=\"position-relative \" style=\"aspect-ratio: 1000 / 560;\">\n <div class=\"display-grid place-items-center position-absolute inset-0\">\n <div class=\"spinnerInfoBox display-flex justify-content-center align-items-center height-100pct\">\n <div class=\"spinner\">\n <div>\n </div>\n <div>\n </div>\n <div>\n </div>\n <div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-4\">\n <div class=\"h5 ellipsis-1\">As background image without spinner</div>\n </div>\n <div class=\"col-md-4\">\n <div class=\"h5 ellipsis-1\">Fallback case</div>\n <div class=\"position-relative \" style=\"aspect-ratio: 1000 / 562;\">\n <div class=\"text-size-h3 display-grid place-items-center position-absolute inset-0\">\n <span class=\"rioglyph rioglyph-missing text-size-200pct text-color-gray\">\n </span>\n </div>\n </div>\n </div>\n</div>"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"label": "Props",
|
|
35
|
+
"language": "json",
|
|
36
|
+
"code": null,
|
|
37
|
+
"props": [
|
|
38
|
+
{
|
|
39
|
+
"heading": null,
|
|
40
|
+
"rows": [
|
|
41
|
+
{
|
|
42
|
+
"name": "src",
|
|
43
|
+
"type": "String",
|
|
44
|
+
"default": "",
|
|
45
|
+
"description": "The source location for the image to load."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "onLoaded",
|
|
49
|
+
"type": "(image: HTMLImageElement) => void",
|
|
50
|
+
"default": "() => {}",
|
|
51
|
+
"description": "Invoked when the image is loaded. The image object will be passed as argument."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "onFailed",
|
|
55
|
+
"type": "(image: HTMLImageElement) => void",
|
|
56
|
+
"default": "() => {}",
|
|
57
|
+
"description": "Invoked when the image failed to load. The image object will be passed as argument."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "isAnonymous",
|
|
61
|
+
"type": "Boolean",
|
|
62
|
+
"default": "false",
|
|
63
|
+
"description": "Defines whether to set \"crossOrigin\" to \"Anonymous\" or not."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "children",
|
|
67
|
+
"type": "(props: { status: ImagePreloaderStatus; image: HTMLImageElement }) => JSX.Element | null",
|
|
68
|
+
"default": "",
|
|
69
|
+
"description": "A render function can be used to access both the current state and the image element. Using this, you can decide how to render the different states and/or the loaded image. The function will receive props containing the status and image properties. status will be one of 'PENDING', 'FAILED' or 'LOADED'. image is the Image element."
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"see_also": []
|
|
81
|
+
}
|