@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,1492 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"captured_at": "2025-11-21T12:07:45.377Z",
|
|
4
|
+
"source": "https://uikit.developers.rio.cloud/#components/dialogs",
|
|
5
|
+
"category": "Components",
|
|
6
|
+
"section": "Content",
|
|
7
|
+
"slug": "components/dialogs",
|
|
8
|
+
"version": "v1.13.2",
|
|
9
|
+
"hash_algorithm": "sha256",
|
|
10
|
+
"hash": "38c7d090a783e8898449bf77109fda0700062337574cd28453995a013f28f3f4"
|
|
11
|
+
},
|
|
12
|
+
"title": "Dialog",
|
|
13
|
+
"lead": "This component allows the user to create a generic modal dialog.",
|
|
14
|
+
"content": [
|
|
15
|
+
{
|
|
16
|
+
"heading": "Dialog",
|
|
17
|
+
"body": "You can create React nodes and pass those as title, body or footer props to the Dialog component.",
|
|
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><div class=\"btn-toolbar margin-bottom-20\"><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Dialog</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Subtitle dialog</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Long dialog</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Long dialog with overflow</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Dialog with overflow and light background</button></div><label>Dialog sizes</label><div class=\"btn-toolbar\"><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size xs (320px)</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size sm (480px)</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size md (768px - default)</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size lg (1280px)</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size xl (1440px)</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size fullwidth</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size fullheight</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size fullheight lg</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size fullheight xl</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Size fullscreen</button></div></div></div>",
|
|
22
|
+
"tabs": [
|
|
23
|
+
{
|
|
24
|
+
"label": "React",
|
|
25
|
+
"language": "tsx",
|
|
26
|
+
"code": "import { useState } from 'react';\n\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport Dialog from '@rio-cloud/rio-uikit/Dialog';\nimport Tooltip from '@rio-cloud/rio-uikit/Tooltip';\nimport OverlayTrigger from '@rio-cloud/rio-uikit/OverlayTrigger';\n\nimport { dummyTextExtraLong } from '../../../utils/data';\nimport { exampleTitle, exampleSubtitle, ExampleBody, exampleFullScreenBody, exampleFooter } from './DialogData';\n\nexport default () => {\n const [showDialog, setShowDialog] = useState(false);\n const [showSubtitleDialog, setShowSubtitleDialog] = useState(false);\n const [showLongDialog, setShowLongDialog] = useState(false);\n const [showLongOverflowDialog, setShowLongOverflowDialog] = useState(false);\n const [showLongOverflow2Dialog, setShowLongOverflow2Dialog] = useState(false);\n const [showSizeXSDialog, setShowSizeXSDialog] = useState(false);\n const [showSizeSMDialog, setShowSizeSMDialog] = useState(false);\n const [showSizeLGDialog, setShowSizeLGDialog] = useState(false);\n const [showSizeXLDialog, setShowSizeXLDialog] = useState(false);\n const [showSizeFullWidthDialog, setShowSizeFullWidthDialog] = useState(false);\n const [showSizeFullHeightDialog, setShowSizeFullHeightDialog] = useState(false);\n const [showSizeFullHeightLGDialog, setShowSizeFullHeightLGDialog] = useState(false);\n const [showSizeFullHeightXLDialog, setShowSizeFullHeightXLDialog] = useState(false);\n const [showSizeFullScreenDialog, setShowSizeFullScreenDialog] = useState(false);\n\n const renderDialog = () => {\n const onClose = () => setShowDialog(false);\n\n const headerButtons = (\n <>\n <OverlayTrigger placement='bottom' overlay={<Tooltip width='auto'>Download</Tooltip>}>\n <Button bsStyle='muted' iconOnly iconName='rioglyph-cloud-download' />\n </OverlayTrigger>\n <OverlayTrigger placement='bottom' overlay={<Tooltip width='auto'>More options</Tooltip>}>\n <Button bsStyle='muted' iconOnly iconName='rioglyph-option-horizontal' />\n </OverlayTrigger>\n </>\n );\n\n return (\n <Dialog\n show={showDialog}\n title={exampleTitle}\n footer={exampleFooter(onClose)}\n body={<ExampleBody />}\n headerButtons={headerButtons}\n onClose={onClose}\n className='exampleDialog'\n showCloseButton\n bsSize='md'\n />\n );\n };\n\n const renderSubtitleDialog = () => (\n <Dialog\n show={showSubtitleDialog}\n title={exampleTitle}\n subtitle={exampleSubtitle}\n footer={exampleFooter(() => setShowSubtitleDialog(false))}\n body={<ExampleBody />}\n onClose={() => setShowSubtitleDialog(false)}\n bodyClassName='exampleDialog'\n showCloseButton\n />\n );\n\n const renderLongDialog = () => (\n <Dialog\n show={showLongDialog}\n title={exampleTitle}\n body={dummyTextExtraLong}\n footer={exampleFooter(() => setShowLongDialog(false))}\n onClose={() => setShowLongDialog(false)}\n className='longExampleDialog'\n showCloseButton\n />\n );\n\n const renderLongOverflowDialog = () => (\n <Dialog\n show={showLongOverflowDialog}\n title={exampleTitle}\n body={dummyTextExtraLong}\n footer={exampleFooter(() => setShowLongOverflowDialog(false))}\n onClose={() => setShowLongOverflowDialog(false)}\n className='longExampleDialog'\n showCloseButton\n useOverflow\n />\n );\n\n const renderLongOverflow2Dialog = () => (\n <Dialog\n show={showLongOverflow2Dialog}\n title={exampleTitle}\n body={dummyTextExtraLong}\n bodyClassName='no-overflow-gradient bg-lightest'\n footerClassName='shadow-smooth-up'\n footer={exampleFooter(() => setShowLongOverflow2Dialog(false))}\n onClose={() => setShowLongOverflow2Dialog(false)}\n className='longExample2Dialog'\n showCloseButton\n useOverflow\n />\n );\n\n const renderSizeXSDialog = () => (\n <Dialog\n show={showSizeXSDialog}\n title='The smallest dialog'\n footer={\n <div className='display-flex justify-content-end'>\n <Button bsStyle='primary' onClick={() => setShowSizeXSDialog(false)}>\n Ok\n </Button>\n </div>\n }\n body=\"This is our smallest dialog. Please treat it lightly and don't scare him\"\n bsSize={Dialog.SIZE_XS}\n onClose={() => setShowSizeXSDialog(false)}\n />\n );\n\n const renderSizeSMDialog = () => (\n <Dialog\n show={showSizeSMDialog}\n title={exampleTitle}\n footer={exampleFooter(() => setShowSizeSMDialog(false))}\n body={<ExampleBody />}\n bsSize={Dialog.SIZE_SM}\n onClose={() => setShowSizeSMDialog(false)}\n className='exampleDialog'\n showCloseButton\n />\n );\n\n const renderSizeLGDialog = () => (\n <Dialog\n show={showSizeLGDialog}\n title={exampleTitle}\n footer={exampleFooter(() => setShowSizeLGDialog(false))}\n body={<ExampleBody />}\n bsSize={Dialog.SIZE_LG}\n onClose={() => setShowSizeLGDialog(false)}\n className='exampleDialog'\n showCloseButton\n />\n );\n\n const renderSizeXLDialog = () => (\n <Dialog\n show={showSizeXLDialog}\n title={exampleTitle}\n footer={exampleFooter(() => setShowSizeXLDialog(false))}\n body={<ExampleBody />}\n bsSize={Dialog.SIZE_XL}\n onClose={() => setShowSizeXLDialog(false)}\n className='exampleDialog'\n showCloseButton\n />\n );\n\n const renderSizeFullWidthDialog = () => (\n <Dialog\n show={showSizeFullWidthDialog}\n title={exampleTitle}\n footer={exampleFooter(() => setShowSizeFullWidthDialog(false))}\n body={<ExampleBody />}\n bsSize={Dialog.SIZE_FULL_WIDTH}\n onClose={() => setShowSizeFullWidthDialog(false)}\n className='exampleDialog'\n showCloseButton\n />\n );\n\n const renderSizeFullHeightDialog = () => (\n <Dialog\n show={showSizeFullHeightDialog}\n title={exampleTitle}\n footer={exampleFooter(() => setShowSizeFullHeightDialog(false))}\n body={<ExampleBody />}\n bsSize={Dialog.SIZE_FULL_HEIGHT}\n onClose={() => setShowSizeFullHeightDialog(false)}\n className='exampleDialog'\n showCloseButton\n />\n );\n\n const renderSizeFullHeightLGDialog = () => (\n <Dialog\n show={showSizeFullHeightLGDialog}\n title={exampleTitle}\n footer={exampleFooter(() => setShowSizeFullHeightLGDialog(false))}\n body={<ExampleBody />}\n bsSize={Dialog.SIZE_FULL_HEIGHT_LG}\n onClose={() => setShowSizeFullHeightLGDialog(false)}\n className='foobar'\n showCloseButton\n />\n );\n\n const renderSizeFullHeightXLDialog = () => (\n <Dialog\n show={showSizeFullHeightXLDialog}\n title={exampleTitle}\n footer={exampleFooter(() => setShowSizeFullHeightXLDialog(false))}\n body={<ExampleBody />}\n bsSize={Dialog.SIZE_FULL_HEIGHT_XL}\n onClose={() => setShowSizeFullHeightXLDialog(false)}\n showCloseButton\n />\n );\n\n const renderSizeFullScreenDialog = () => (\n <Dialog\n show={showSizeFullScreenDialog}\n title={exampleTitle}\n body={exampleFullScreenBody}\n footer={exampleFooter(() => setShowSizeFullScreenDialog(false))}\n className='exampleDialog'\n bodyClassName='padding-0'\n bsSize={Dialog.SIZE_FULL_SCREEN}\n onClose={() => setShowSizeFullScreenDialog(false)}\n showCloseButton\n />\n );\n\n return (\n <div>\n <div className='btn-toolbar margin-bottom-20'>\n <Button bsStyle='primary' onClick={() => setShowDialog(true)}>\n Dialog\n </Button>\n {renderDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowSubtitleDialog(true)}>\n Subtitle dialog\n </Button>\n {renderSubtitleDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowLongDialog(true)}>\n Long dialog\n </Button>\n {renderLongDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowLongOverflowDialog(true)}>\n Long dialog with overflow\n </Button>\n {renderLongOverflowDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowLongOverflow2Dialog(true)}>\n Dialog with overflow and light background\n </Button>\n {renderLongOverflow2Dialog()}\n </div>\n\n <label>Dialog sizes</label>\n <div className='btn-toolbar'>\n <Button bsStyle='primary' onClick={() => setShowSizeXSDialog(true)}>\n Size xs (320px)\n </Button>\n {renderSizeXSDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowSizeSMDialog(true)}>\n Size sm (480px)\n </Button>\n {renderSizeSMDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowDialog(true)}>\n Size md (768px - default)\n </Button>\n <Button type='button' bsStyle='primary' onClick={() => setShowSizeLGDialog(true)}>\n Size lg (1280px)\n </Button>\n {renderSizeLGDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowSizeXLDialog(true)}>\n Size xl (1440px)\n </Button>\n {renderSizeXLDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowSizeFullWidthDialog(true)}>\n Size fullwidth\n </Button>\n {renderSizeFullWidthDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowSizeFullHeightDialog(true)}>\n Size fullheight\n </Button>\n {renderSizeFullHeightDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowSizeFullHeightLGDialog(true)}>\n Size fullheight lg\n </Button>\n {renderSizeFullHeightLGDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowSizeFullHeightXLDialog(true)}>\n Size fullheight xl\n </Button>\n {renderSizeFullHeightXLDialog()}\n\n <Button bsStyle='primary' onClick={() => setShowSizeFullScreenDialog(true)}>\n Size fullscreen\n </Button>\n {renderSizeFullScreenDialog()}\n </div>\n </div>\n );\n};"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "HTML",
|
|
30
|
+
"language": "html",
|
|
31
|
+
"code": "<div class='modal show exampleDialog modal-enter-done' tabindex='1' role='dialog'>\n<div class='modal-dialog' role='document'>\n <div class='modal-content'>\n <div class='modal-header'>\n <div class='modal-header-text'>\n <div class='modal-header-title'>Dialog title</div>\n </div>\n <div class='modal-header-buttons'>\n <button type='button' class='btn btn-muted btn-icon-only'>\n <span class='rioglyph rioglyph-cloud-download'></span>\n </button>\n <button type='button' class='btn btn-muted btn-icon-only'>\n <span class='rioglyph rioglyph-option-horizontal'></span>\n </button>\n <div class='modal-header-buttons-spacer'></div>\n <button\n type='button'\n class='btn btn-icon-only btn-muted modal-header-close close'\n data-testid='close'\n >\n <span class='rioglyph rioglyph-remove' aria-hidden='true'></span>\n </button>\n </div>\n </div>\n <div class='modal-body'>\n {/* Body Content */}\n </div>\n <div class='modal-footer'>\n {/* Footer Content */}\n </div>\n </div>\n</div>\n<div class='modal-backdrop'></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": "show",
|
|
43
|
+
"type": "Boolean",
|
|
44
|
+
"default": "false",
|
|
45
|
+
"description": "Opens the dialog when set to true"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "title",
|
|
49
|
+
"type": "Node",
|
|
50
|
+
"default": "",
|
|
51
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "subtitle",
|
|
55
|
+
"type": "Node",
|
|
56
|
+
"default": "",
|
|
57
|
+
"description": "The subtitle content"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "body",
|
|
61
|
+
"type": "Node",
|
|
62
|
+
"default": "",
|
|
63
|
+
"description": "The dialog body content"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "footer",
|
|
67
|
+
"type": "Node",
|
|
68
|
+
"default": "",
|
|
69
|
+
"description": "The dialog footer content"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "onClose",
|
|
73
|
+
"type": "Function",
|
|
74
|
+
"default": "() => {}",
|
|
75
|
+
"description": "A callback function invoked when the dialog closes"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "onCloseValidation",
|
|
79
|
+
"type": "Function",
|
|
80
|
+
"default": "() => true",
|
|
81
|
+
"description": "A callback function to be executed before closing the dialog. If the function returns false the dialog will not be closed."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "showCloseButton",
|
|
85
|
+
"type": "Boolean",
|
|
86
|
+
"default": "true",
|
|
87
|
+
"description": "Shows a close button when set to true"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "disableEsc",
|
|
91
|
+
"type": "Boolean",
|
|
92
|
+
"default": "false",
|
|
93
|
+
"description": "Enables or disabled closing the dialog via esc key"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "onEsc",
|
|
97
|
+
"type": "Function",
|
|
98
|
+
"default": "() => {}",
|
|
99
|
+
"description": "A callback fired when esc key is pressed and the dialog is about to close"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "useOverflow",
|
|
103
|
+
"type": "Boolean",
|
|
104
|
+
"default": "false",
|
|
105
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "bsSize",
|
|
109
|
+
"type": "String",
|
|
110
|
+
"default": "md",
|
|
111
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "headerButtons",
|
|
115
|
+
"type": "ReactNode",
|
|
116
|
+
"default": "",
|
|
117
|
+
"description": "Allows to add additional buttons to the dialog header"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "className",
|
|
121
|
+
"type": "String",
|
|
122
|
+
"default": "",
|
|
123
|
+
"description": "Additional classes for the modal element"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "bodyClassName",
|
|
127
|
+
"type": "String",
|
|
128
|
+
"default": "",
|
|
129
|
+
"description": "Additional classes for the modal-body element"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "footerClassName",
|
|
133
|
+
"type": "String",
|
|
134
|
+
"default": "",
|
|
135
|
+
"description": "Additional classes for the modal-footer element"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"heading": "Dialog compound components",
|
|
147
|
+
"body": "To accommodate forms within the dialog body and have the submit button in the footer or wrapping individual parts of the dialog, a more flexible approach to rendering its individual components is needed. In this scenario, you can make use of the dialog compound components.",
|
|
148
|
+
"examples": [
|
|
149
|
+
{
|
|
150
|
+
"caption": "Example 2",
|
|
151
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><div class=\"btn-toolbar margin-bottom-20\"><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Dialog with form</button></div></div></div>",
|
|
152
|
+
"tabs": [
|
|
153
|
+
{
|
|
154
|
+
"label": "React",
|
|
155
|
+
"language": "tsx",
|
|
156
|
+
"code": "import { useState } from 'react';\n\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport Dialog from '@rio-cloud/rio-uikit/Dialog';\n\nimport { exampleTitle } from './DialogData';\n\nexport default () => {\n const [showDialog, setShowDialog] = useState(false);\n const [enableSubmit, setEnableSubmit] = useState(false);\n const [submittedFormData, setSubmittedFormData] = useState<{ [k: string]: FormDataEntryValue } | undefined>();\n\n const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n // Avoid page reload on form submit\n event.preventDefault();\n\n // Get form data of all input elements\n const formData = new FormData(event.target as HTMLFormElement);\n\n // Convert all form data into an object for further use\n const entries = Object.fromEntries(formData.entries());\n setSubmittedFormData(entries);\n\n // Individual debug output of the form inputs\n for (const [key, value] of formData) {\n console.log({ key, value });\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n setEnableSubmit(Boolean(event.currentTarget.value));\n };\n\n const handleClose = () => {\n setShowDialog(false);\n setSubmittedFormData(undefined);\n };\n\n return (\n <div>\n <div className='btn-toolbar margin-bottom-20'>\n <Button bsStyle='primary' onClick={() => setShowDialog(true)}>\n Dialog with form\n </Button>\n <Dialog show={showDialog} onClose={handleClose} showCloseButton bsSize='md'>\n <form onSubmit={handleSubmit}>\n <Dialog.Title\n title={exampleTitle}\n subtitle='This is a subtitle'\n headerButtons={<Button bsStyle='muted' iconOnly iconName='rioglyph-cloud-download' />}\n />\n <Dialog.Body className='foo'>\n <div>\n <div className='form-group'>\n <label htmlFor='demoInput'>Some random input to submit (required)</label>\n <input\n className='form-control'\n name='demoInput'\n placeholder='Please add something to continue'\n onChange={handleInputChange}\n required\n />\n </div>\n <div className='text-italic margin-top-25'>{JSON.stringify(submittedFormData)}</div>\n </div>\n </Dialog.Body>\n <Dialog.Footer className='foobar'>\n <div>\n <Button bsStyle='primary' type='submit' disabled={!enableSubmit}>\n Submit\n </Button>\n </div>\n </Dialog.Footer>\n </form>\n </Dialog>\n </div>\n </div>\n );\n};"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"label": "HTML",
|
|
160
|
+
"language": "html",
|
|
161
|
+
"code": "<div class='modal show exampleDialog modal-enter-done' tabindex='1' role='dialog'>\n<div class='modal-dialog' role='document'>\n <div class='modal-content'>\n <div class='modal-header'>\n <div class='modal-header-text'>\n <div class='modal-header-title'>Dialog title</div>\n </div>\n <div class='modal-header-buttons'>\n <button type='button' class='btn btn-muted btn-icon-only'>\n <span class='rioglyph rioglyph-cloud-download'></span>\n </button>\n <button type='button' class='btn btn-muted btn-icon-only'>\n <span class='rioglyph rioglyph-option-horizontal'></span>\n </button>\n <div class='modal-header-buttons-spacer'></div>\n <button\n type='button'\n class='btn btn-icon-only btn-muted modal-header-close close'\n data-testid='close'\n >\n <span class='rioglyph rioglyph-remove' aria-hidden='true'></span>\n </button>\n </div>\n </div>\n <div class='modal-body'>\n {/* Body Content */}\n </div>\n <div class='modal-footer'>\n {/* Footer Content */}\n </div>\n </div>\n</div>\n<div class='modal-backdrop'></div>\n</div>"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"label": "Props",
|
|
165
|
+
"language": "json",
|
|
166
|
+
"code": null,
|
|
167
|
+
"props": [
|
|
168
|
+
{
|
|
169
|
+
"heading": "Dialog.Title",
|
|
170
|
+
"rows": [
|
|
171
|
+
{
|
|
172
|
+
"name": "title",
|
|
173
|
+
"type": "Node",
|
|
174
|
+
"default": "",
|
|
175
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "subtitle",
|
|
179
|
+
"type": "Node",
|
|
180
|
+
"default": "",
|
|
181
|
+
"description": "The subtitle content"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "headerButtons",
|
|
185
|
+
"type": "ReactNode",
|
|
186
|
+
"default": "",
|
|
187
|
+
"description": "Allows to add additional buttons to the dialog header"
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"heading": "Dialog.Body",
|
|
193
|
+
"rows": [
|
|
194
|
+
{
|
|
195
|
+
"name": "className",
|
|
196
|
+
"type": "String",
|
|
197
|
+
"default": "",
|
|
198
|
+
"description": "Additional classes set on the wrapper element"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"heading": "Dialog.Footer",
|
|
204
|
+
"rows": [
|
|
205
|
+
{
|
|
206
|
+
"name": "className",
|
|
207
|
+
"type": "String",
|
|
208
|
+
"default": "",
|
|
209
|
+
"description": "Additional classes set on the wrapper element"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"heading": "Dialogs with validation",
|
|
221
|
+
"body": "",
|
|
222
|
+
"examples": [
|
|
223
|
+
{
|
|
224
|
+
"caption": "Example 3",
|
|
225
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Open dialog</button></div>",
|
|
226
|
+
"tabs": [
|
|
227
|
+
{
|
|
228
|
+
"label": "React",
|
|
229
|
+
"language": "tsx",
|
|
230
|
+
"code": "import React, { useEffect, useRef, useState } from 'react';\n\nimport Dialog from '@rio-cloud/rio-uikit/Dialog';\nimport Button from '@rio-cloud/rio-uikit/Button';\n\ntype DemoContentProps = {\n inputValue: string;\n showError: boolean;\n onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n};\n\nconst DemoContent = (props: DemoContentProps) => {\n const { inputValue, showError, onInputChange } = props;\n\n // Set the focus on the input.\n // Note: the dialog body need to be in the component that re-renders,\n // otherwise the focus is not set initially.\n const inputRef = useRef<HTMLInputElement>(null);\n useEffect(() => {\n if (inputRef.current) {\n console.log('focus input');\n inputRef.current.focus();\n }\n }, [inputRef.current]);\n\n return (\n <div className={`form-group has-feedback ${showError ? 'has-error' : ''} margin-bottom-15`}>\n <label htmlFor='input'>Some input</label>\n <div className='input-group'>\n <input\n className='form-control'\n value={inputValue}\n id='input'\n type='text'\n placeholder='Please type in something'\n onChange={onInputChange}\n ref={inputRef}\n />\n </div>\n {showError && (\n <span className='help-block'>\n <span>Please enter something</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default () => {\n const [state, setState] = useState({\n showDialog: false,\n hasError: false,\n inputValue: '',\n });\n\n const handleValidation = () => {\n if (!state.inputValue) {\n setState({ ...state, hasError: true });\n return false;\n }\n return true;\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = event.currentTarget.value;\n setState({ ...state, inputValue, hasError: !inputValue });\n };\n\n return (\n <>\n <Button bsStyle='primary' onClick={() => setState({ ...state, showDialog: true })}>\n Open dialog\n </Button>\n <Dialog\n show={state.showDialog}\n title='Dialog with validation example'\n body={\n <DemoContent\n inputValue={state.inputValue}\n showError={state.hasError}\n onInputChange={handleInputChange}\n />\n }\n onClose={() => setState({ ...state, showDialog: false, inputValue: '' })}\n onCloseValidation={handleValidation}\n />\n </>\n );\n};"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"label": "HTML",
|
|
234
|
+
"language": "html",
|
|
235
|
+
"code": "<button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Open dialog</button>"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"label": "Props",
|
|
239
|
+
"language": "json",
|
|
240
|
+
"code": null,
|
|
241
|
+
"props": [
|
|
242
|
+
{
|
|
243
|
+
"heading": null,
|
|
244
|
+
"rows": [
|
|
245
|
+
{
|
|
246
|
+
"name": "show",
|
|
247
|
+
"type": "Boolean",
|
|
248
|
+
"default": "false",
|
|
249
|
+
"description": "Opens the dialog when set to true"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "title",
|
|
253
|
+
"type": "Node",
|
|
254
|
+
"default": "",
|
|
255
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "subtitle",
|
|
259
|
+
"type": "Node",
|
|
260
|
+
"default": "",
|
|
261
|
+
"description": "The subtitle content"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "body",
|
|
265
|
+
"type": "Node",
|
|
266
|
+
"default": "",
|
|
267
|
+
"description": "The dialog body content"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"name": "footer",
|
|
271
|
+
"type": "Node",
|
|
272
|
+
"default": "",
|
|
273
|
+
"description": "The dialog footer content"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "onClose",
|
|
277
|
+
"type": "Function",
|
|
278
|
+
"default": "() => {}",
|
|
279
|
+
"description": "A callback function invoked when the dialog closes"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "onCloseValidation",
|
|
283
|
+
"type": "Function",
|
|
284
|
+
"default": "() => true",
|
|
285
|
+
"description": "A callback function to be executed before closing the dialog. If the function returns false the dialog will not be closed."
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "showCloseButton",
|
|
289
|
+
"type": "Boolean",
|
|
290
|
+
"default": "true",
|
|
291
|
+
"description": "Shows a close button when set to true"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"name": "disableEsc",
|
|
295
|
+
"type": "Boolean",
|
|
296
|
+
"default": "false",
|
|
297
|
+
"description": "Enables or disabled closing the dialog via esc key"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "onEsc",
|
|
301
|
+
"type": "Function",
|
|
302
|
+
"default": "() => {}",
|
|
303
|
+
"description": "A callback fired when esc key is pressed and the dialog is about to close"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "useOverflow",
|
|
307
|
+
"type": "Boolean",
|
|
308
|
+
"default": "false",
|
|
309
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"name": "bsSize",
|
|
313
|
+
"type": "String",
|
|
314
|
+
"default": "md",
|
|
315
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "headerButtons",
|
|
319
|
+
"type": "ReactNode",
|
|
320
|
+
"default": "",
|
|
321
|
+
"description": "Allows to add additional buttons to the dialog header"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"name": "className",
|
|
325
|
+
"type": "String",
|
|
326
|
+
"default": "",
|
|
327
|
+
"description": "Additional classes for the modal element"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "bodyClassName",
|
|
331
|
+
"type": "String",
|
|
332
|
+
"default": "",
|
|
333
|
+
"description": "Additional classes for the modal-body element"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "footerClassName",
|
|
337
|
+
"type": "String",
|
|
338
|
+
"default": "",
|
|
339
|
+
"description": "Additional classes for the modal-footer element"
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"caption": "Example 4",
|
|
349
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><label>Validation with separate validation error dialog</label></div><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Open dialog</button></div>",
|
|
350
|
+
"tabs": [
|
|
351
|
+
{
|
|
352
|
+
"label": "React",
|
|
353
|
+
"language": "tsx",
|
|
354
|
+
"code": "import React, { useState, useRef, useEffect } from 'react';\n\nimport Dialog from '@rio-cloud/rio-uikit/Dialog';\nimport SimpleDialog from '@rio-cloud/rio-uikit/SimpleDialog';\nimport Button from '@rio-cloud/rio-uikit/Button';\n\ntype DemoContentProps = {\n inputRef: React.MutableRefObject<HTMLInputElement>;\n inputValue: string;\n showError: boolean;\n onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n};\n\nconst DemoContent = (props: DemoContentProps) => {\n const { inputRef, inputValue, showError, onInputChange } = props;\n\n // Set the focus on the input.\n // Note: the dialog body need to be in the component that re-renders,\n // otherwise the focus is not set initially.\n useEffect(() => {\n if (inputRef.current) {\n console.log('focus input');\n inputRef.current.focus();\n }\n }, [inputRef.current]);\n\n return (\n <div className={`form-group has-feedback ${showError ? 'has-error' : ''} margin-bottom-15`}>\n <label htmlFor='input'>Some input</label>\n <div className='input-group'>\n <input\n className='form-control'\n value={inputValue}\n id='input'\n type='text'\n placeholder='Please type in something'\n onChange={onInputChange}\n ref={inputRef}\n />\n </div>\n {showError && (\n <span className='help-block'>\n <span>Please enter something</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default () => {\n const [state, setState] = useState({\n showDialog: false,\n hasError: false,\n showErrorDialog: false,\n inputValue: '',\n });\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleValidation = () => {\n if (!state.inputValue) {\n setState({ ...state, hasError: true, showErrorDialog: true });\n return false;\n }\n return true;\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = event.currentTarget.value;\n setState({ ...state, inputValue, hasError: !inputValue });\n };\n\n const handleCloseErrorDialog = () => {\n setState({ ...state, showErrorDialog: false });\n inputRef?.current?.focus();\n };\n\n const handleClose = () => {\n handleValidation() && setState({ ...state, showDialog: false, inputValue: '' });\n };\n\n const showError = state.hasError && !state.showErrorDialog;\n\n return (\n <>\n <div>\n <label>Validation with separate validation error dialog</label>\n </div>\n <Button bsStyle='primary' onClick={() => setState({ ...state, showDialog: true })}>\n Open dialog\n </Button>\n\n <Dialog\n show={state.showDialog}\n title='Dialog with validation example'\n body={\n <DemoContent\n inputRef={inputRef}\n inputValue={state.inputValue}\n showError={showError}\n onInputChange={handleInputChange}\n />\n }\n footer={\n <Button bsStyle='primary' onClick={handleClose}>\n Close\n </Button>\n }\n onClose={handleClose}\n onCloseValidation={handleValidation}\n />\n <SimpleDialog\n show={state.showErrorDialog}\n bsSize='xs'\n title='Validation failed'\n content='Input may not be empty. Please enter some value.'\n footer={\n <Button bsStyle='primary' onClick={handleCloseErrorDialog}>\n Got it\n </Button>\n }\n />\n </>\n );\n};"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"label": "HTML",
|
|
358
|
+
"language": "html",
|
|
359
|
+
"code": "<div>\n <label>Validation with separate validation error dialog</label>\n</div>\n<button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Open dialog</button>"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"label": "Props",
|
|
363
|
+
"language": "json",
|
|
364
|
+
"code": null,
|
|
365
|
+
"props": [
|
|
366
|
+
{
|
|
367
|
+
"heading": null,
|
|
368
|
+
"rows": [
|
|
369
|
+
{
|
|
370
|
+
"name": "show",
|
|
371
|
+
"type": "Boolean",
|
|
372
|
+
"default": "false",
|
|
373
|
+
"description": "Opens the dialog when set to true"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "title",
|
|
377
|
+
"type": "Node",
|
|
378
|
+
"default": "",
|
|
379
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "subtitle",
|
|
383
|
+
"type": "Node",
|
|
384
|
+
"default": "",
|
|
385
|
+
"description": "The subtitle content"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "body",
|
|
389
|
+
"type": "Node",
|
|
390
|
+
"default": "",
|
|
391
|
+
"description": "The dialog body content"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "footer",
|
|
395
|
+
"type": "Node",
|
|
396
|
+
"default": "",
|
|
397
|
+
"description": "The dialog footer content"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"name": "onClose",
|
|
401
|
+
"type": "Function",
|
|
402
|
+
"default": "() => {}",
|
|
403
|
+
"description": "A callback function invoked when the dialog closes"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "onCloseValidation",
|
|
407
|
+
"type": "Function",
|
|
408
|
+
"default": "() => true",
|
|
409
|
+
"description": "A callback function to be executed before closing the dialog. If the function returns false the dialog will not be closed."
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "showCloseButton",
|
|
413
|
+
"type": "Boolean",
|
|
414
|
+
"default": "true",
|
|
415
|
+
"description": "Shows a close button when set to true"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "disableEsc",
|
|
419
|
+
"type": "Boolean",
|
|
420
|
+
"default": "false",
|
|
421
|
+
"description": "Enables or disabled closing the dialog via esc key"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"name": "onEsc",
|
|
425
|
+
"type": "Function",
|
|
426
|
+
"default": "() => {}",
|
|
427
|
+
"description": "A callback fired when esc key is pressed and the dialog is about to close"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "useOverflow",
|
|
431
|
+
"type": "Boolean",
|
|
432
|
+
"default": "false",
|
|
433
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"name": "bsSize",
|
|
437
|
+
"type": "String",
|
|
438
|
+
"default": "md",
|
|
439
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"name": "headerButtons",
|
|
443
|
+
"type": "ReactNode",
|
|
444
|
+
"default": "",
|
|
445
|
+
"description": "Allows to add additional buttons to the dialog header"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"name": "className",
|
|
449
|
+
"type": "String",
|
|
450
|
+
"default": "",
|
|
451
|
+
"description": "Additional classes for the modal element"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "bodyClassName",
|
|
455
|
+
"type": "String",
|
|
456
|
+
"default": "",
|
|
457
|
+
"description": "Additional classes for the modal-body element"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"name": "footerClassName",
|
|
461
|
+
"type": "String",
|
|
462
|
+
"default": "",
|
|
463
|
+
"description": "Additional classes for the modal-footer element"
|
|
464
|
+
}
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
]
|
|
470
|
+
}
|
|
471
|
+
]
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"heading": "SimpleDialog",
|
|
475
|
+
"body": "This component allows the user to create a simple dialog. It uses the dialog component described above.",
|
|
476
|
+
"examples": [
|
|
477
|
+
{
|
|
478
|
+
"caption": "Example 5",
|
|
479
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Simple dialog button</button></div>",
|
|
480
|
+
"tabs": [
|
|
481
|
+
{
|
|
482
|
+
"label": "React",
|
|
483
|
+
"language": "tsx",
|
|
484
|
+
"code": "import { useState } from 'react';\n\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport SimpleDialog from '@rio-cloud/rio-uikit/SimpleDialog';\n\nexport default () => {\n const [show, setShow] = useState(false);\n\n return (\n <>\n <Button bsStyle='primary' onClick={() => setShow(true)}>\n Simple dialog button\n </Button>\n <SimpleDialog\n show={show}\n title='Simple dialog title'\n content='Simple dialog body content'\n bodyClassName='my-content'\n onClose={() => setShow(false)}\n />\n </>\n );\n};"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"label": "HTML",
|
|
488
|
+
"language": "html",
|
|
489
|
+
"code": "<div content='Save Dialog Body Content' class='modal show simple-dialog modal-enter-done' tabindex='1' role='dialog'>\n<div class='modal-dialog' role='document'>\n <div class='modal-content'>\n <div class='modal-header'>\n <div class='modal-header-text'>\n <div class='modal-header-title'>Save Dialog Title</div>\n </div>\n <div class='modal-header-buttons'>\n <button\n type='button'\n class='btn btn-icon-only btn-muted modal-header-close close'\n data-testid='close'\n >\n <span class='rioglyph rioglyph-remove' aria-hidden='true'></span>\n </button>\n </div>\n </div>\n <div class='modal-body'>Save Dialog Body Content</div>\n </div>\n</div>\n<div class='modal-backdrop'></div>\n</div>;"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"label": "Props",
|
|
493
|
+
"language": "json",
|
|
494
|
+
"code": null,
|
|
495
|
+
"props": [
|
|
496
|
+
{
|
|
497
|
+
"heading": null,
|
|
498
|
+
"rows": [
|
|
499
|
+
{
|
|
500
|
+
"name": "show",
|
|
501
|
+
"type": "Boolean",
|
|
502
|
+
"default": "false",
|
|
503
|
+
"description": "Opens the dialog when set to true"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"name": "title",
|
|
507
|
+
"type": "Node",
|
|
508
|
+
"default": "",
|
|
509
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"name": "subtitle",
|
|
513
|
+
"type": "Node",
|
|
514
|
+
"default": "",
|
|
515
|
+
"description": "The subtitle content"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"name": "content",
|
|
519
|
+
"type": "Node",
|
|
520
|
+
"default": "",
|
|
521
|
+
"description": "The content of the dialog body itself"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"name": "footer",
|
|
525
|
+
"type": "Node",
|
|
526
|
+
"default": "",
|
|
527
|
+
"description": "The dialog footer content"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"name": "footerClassName",
|
|
531
|
+
"type": "String",
|
|
532
|
+
"default": "",
|
|
533
|
+
"description": "Additional classes for the modal-footer element"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"name": "bodyClassName",
|
|
537
|
+
"type": "String",
|
|
538
|
+
"default": "",
|
|
539
|
+
"description": "Additional classes for the modal-body element"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"name": "onClose",
|
|
543
|
+
"type": "Function",
|
|
544
|
+
"default": "() => {}",
|
|
545
|
+
"description": "A callback function invoked when the dialog closes"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"name": "onCloseValidation",
|
|
549
|
+
"type": "Function",
|
|
550
|
+
"default": "() => true",
|
|
551
|
+
"description": "A callback function to be executed before closing the dialog. If the function returns false the dialog will not be closed."
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"name": "showCloseButton",
|
|
555
|
+
"type": "Boolean",
|
|
556
|
+
"default": "true",
|
|
557
|
+
"description": "Shows a close button when set to true"
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"name": "disableEsc",
|
|
561
|
+
"type": "Boolean",
|
|
562
|
+
"default": "false",
|
|
563
|
+
"description": "Enables or disabled closing the dialog via esc key"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"name": "onEsc",
|
|
567
|
+
"type": "Function",
|
|
568
|
+
"default": "() => {}",
|
|
569
|
+
"description": "A callback fired when esc key is pressed and the dialog is about to close"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"name": "useOverflow",
|
|
573
|
+
"type": "Boolean",
|
|
574
|
+
"default": "false",
|
|
575
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "bsSize",
|
|
579
|
+
"type": "String",
|
|
580
|
+
"default": "md",
|
|
581
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"name": "className",
|
|
585
|
+
"type": "String",
|
|
586
|
+
"default": "",
|
|
587
|
+
"description": "Additional classes for the modal element"
|
|
588
|
+
}
|
|
589
|
+
]
|
|
590
|
+
}
|
|
591
|
+
]
|
|
592
|
+
}
|
|
593
|
+
]
|
|
594
|
+
}
|
|
595
|
+
]
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"heading": "ConfirmationDialog",
|
|
599
|
+
"body": "This component allows the user to create a confirmation dialog. It uses the dialog component described above.",
|
|
600
|
+
"examples": [
|
|
601
|
+
{
|
|
602
|
+
"caption": "Example 6",
|
|
603
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><button type=\"button\" class=\"btn btn-primary\">Confirmation dialog</button></div></div>",
|
|
604
|
+
"tabs": [
|
|
605
|
+
{
|
|
606
|
+
"label": "React",
|
|
607
|
+
"language": "tsx",
|
|
608
|
+
"code": "import { useState } from 'react';\n\nimport Dialog from '@rio-cloud/rio-uikit/Dialog';\nimport ConfirmationDialog from '@rio-cloud/rio-uikit/ConfirmationDialog';\n\nexport default () => {\n const [show, setShow] = useState(false);\n\n return (\n <div>\n <button type='button' className='btn btn-primary' onClick={() => setShow(true)}>\n Confirmation dialog\n </button>\n <ConfirmationDialog\n show={show}\n title='ConfirmationDialog title'\n content='ConfirmationDialog body content'\n bsSize={Dialog.SIZE_SM}\n onClickConfirm={() => setShow(false)}\n onClickCancel={() => setShow(false)}\n cancelButtonText='Abort the action'\n confirmButtonText={\n <>\n <span className='rioglyph rioglyph-ok margin-right-5' />\n <span>Confirm the action</span>\n </>\n }\n useOverflow\n />\n </div>\n );\n};"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"label": "HTML",
|
|
612
|
+
"language": "html",
|
|
613
|
+
"code": "<div class='modal show confirmation-dialog modal-enter-done' tabindex='1' role='dialog'>\n<div class='modal-dialog modal-overflow modal-sm' role='document'>\n <div class='modal-content'>\n <div class='modal-header'>\n <div class='modal-header-text'>\n <div class='modal-header-title'>Confirmation dialog title</div>\n </div>\n <div class='modal-header-buttons'></div>\n </div>\n <div class='modal-body'>Confirmation dialog body content</div>\n <div class='modal-footer'>\n <div class='btn-toolbar'>\n <button type='button' class='CancelButton btn btn-default'>\n Abort the action\n </button>\n <button type='button' class='ConfirmationButton btn btn-primary'>\n Confirm the action\n </button>\n </div>\n </div>\n </div>\n</div>\n<div class='modal-backdrop'></div>\n</div>;"
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
"label": "Props",
|
|
617
|
+
"language": "json",
|
|
618
|
+
"code": null,
|
|
619
|
+
"props": [
|
|
620
|
+
{
|
|
621
|
+
"heading": null,
|
|
622
|
+
"rows": [
|
|
623
|
+
{
|
|
624
|
+
"name": "show",
|
|
625
|
+
"type": "Boolean",
|
|
626
|
+
"default": "false",
|
|
627
|
+
"description": "Opens the dialog when set to true"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "title",
|
|
631
|
+
"type": "Node",
|
|
632
|
+
"default": "",
|
|
633
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"name": "subtitle",
|
|
637
|
+
"type": "Node",
|
|
638
|
+
"default": "",
|
|
639
|
+
"description": "The subtitle content"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "content",
|
|
643
|
+
"type": "Node",
|
|
644
|
+
"default": "",
|
|
645
|
+
"description": "The content of the dialog body itself"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"name": "useOverflow",
|
|
649
|
+
"type": "Boolean",
|
|
650
|
+
"default": "false",
|
|
651
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"name": "onClickConfirm",
|
|
655
|
+
"type": "Function",
|
|
656
|
+
"default": "() => {}",
|
|
657
|
+
"description": "A callback fired when the confirmation button is clicked."
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "onClickCancel",
|
|
661
|
+
"type": "Function",
|
|
662
|
+
"default": "() => {}",
|
|
663
|
+
"description": "A callback fired when the cancel button is clicked or the dialog is closed."
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"name": "cancelButtonText",
|
|
667
|
+
"type": "Node",
|
|
668
|
+
"default": "",
|
|
669
|
+
"description": "The content of the cancel button. (Usually a text, can also be a FormattedMessage component)."
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"name": "confirmButtonText",
|
|
673
|
+
"type": "Node",
|
|
674
|
+
"default": "",
|
|
675
|
+
"description": "The content of the confirmation button. Since it is a node, it can be a simple text or any JSX node like a div element with an icon and a text."
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "disableConfirm",
|
|
679
|
+
"type": "Boolean",
|
|
680
|
+
"default": "",
|
|
681
|
+
"description": "When set to true the confirmation button will be disabled"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "bsSize",
|
|
685
|
+
"type": "String",
|
|
686
|
+
"default": "md",
|
|
687
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
688
|
+
}
|
|
689
|
+
]
|
|
690
|
+
}
|
|
691
|
+
]
|
|
692
|
+
}
|
|
693
|
+
]
|
|
694
|
+
}
|
|
695
|
+
]
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"heading": "SaveDialog",
|
|
699
|
+
"body": "This component allows the user to create a save dialog. It uses the dialog component described above.",
|
|
700
|
+
"examples": [
|
|
701
|
+
{
|
|
702
|
+
"caption": "Example 7",
|
|
703
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Save dialog</button></div>",
|
|
704
|
+
"tabs": [
|
|
705
|
+
{
|
|
706
|
+
"label": "React",
|
|
707
|
+
"language": "tsx",
|
|
708
|
+
"code": "import { useState } from 'react';\n\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport SaveDialog from '@rio-cloud/rio-uikit/SaveDialog';\n\nexport default () => {\n const [show, setShow] = useState(false);\n\n return (\n <>\n <Button bsStyle='primary' onClick={() => setShow(true)}>\n Save dialog\n </Button>\n <SaveDialog\n show={show}\n title='Save Dialog Title'\n content='Save Dialog Body Content'\n onClickConfirm={() => setShow(false)}\n onClickCancel={() => setShow(false)}\n onClickDiscard={() => setShow(false)}\n discardButtonText='Discard changes'\n cancelButtonText='Continue editing'\n confirmButtonText={\n <>\n <span className='rioglyph rioglyph-save margin-right-5' />\n <span>Save changes</span>\n </>\n }\n />\n </>\n );\n};"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"label": "HTML",
|
|
712
|
+
"language": "html",
|
|
713
|
+
"code": "<div class='modal show save-dialog modal-enter-done' tabindex='1' role='dialog'>\n<div class='modal-dialog' role='document'>\n <div class='modal-content'>\n <div class='modal-header'>\n <div class='modal-header-text'>\n <div class='modal-header-title'>Save Dialog Title</div>\n </div>\n <div class='modal-header-buttons'>\n <button\n type='button'\n class='btn btn-icon-only btn-muted modal-header-close close'\n data-testid='close'\n >\n <span class='rioglyph rioglyph-remove' aria-hidden='true'></span>\n </button>\n </div>\n </div>\n <div class='modal-body'>Save Dialog Body Content</div>\n <div class='modal-footer'>\n <div class='btn-toolbar'>\n <button type='button' class='DiscardButton btn btn-default'>\n Discard\n </button>\n <button type='button' class='CancelButton btn btn-default'>\n Abort\n </button>\n <button type='button' class='ConfirmationButton btn btn-primary'>\n <span> Save</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n<div class='modal-backdrop'></div>\n</div>;"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"label": "Props",
|
|
717
|
+
"language": "json",
|
|
718
|
+
"code": null,
|
|
719
|
+
"props": [
|
|
720
|
+
{
|
|
721
|
+
"heading": null,
|
|
722
|
+
"rows": [
|
|
723
|
+
{
|
|
724
|
+
"name": "show",
|
|
725
|
+
"type": "Boolean",
|
|
726
|
+
"default": "false",
|
|
727
|
+
"description": "Opens the dialog when set to true"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"name": "title",
|
|
731
|
+
"type": "Node",
|
|
732
|
+
"default": "",
|
|
733
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"name": "subtitle",
|
|
737
|
+
"type": "Node",
|
|
738
|
+
"default": "",
|
|
739
|
+
"description": "The subtitle content"
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"name": "content",
|
|
743
|
+
"type": "Node",
|
|
744
|
+
"default": "",
|
|
745
|
+
"description": "The content of the dialog body itself"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"name": "onClickCancel",
|
|
749
|
+
"type": "Function",
|
|
750
|
+
"default": "() => {}",
|
|
751
|
+
"description": "A callback fired when the cancel button is clicked or the dialog is closed."
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"name": "onClickDiscard",
|
|
755
|
+
"type": "Function",
|
|
756
|
+
"default": "() => {}",
|
|
757
|
+
"description": "A callback fired when the discard button is clicked."
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"name": "onClickConfirm",
|
|
761
|
+
"type": "Function",
|
|
762
|
+
"default": "() => {}",
|
|
763
|
+
"description": "A callback fired when the confirmation button is clicked."
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "discardButtonText",
|
|
767
|
+
"type": "Node",
|
|
768
|
+
"default": "",
|
|
769
|
+
"description": "The content of the discard button. (Usually a text, can also be a FormattedMessage component)."
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"name": "cancelButtonText",
|
|
773
|
+
"type": "Node",
|
|
774
|
+
"default": "",
|
|
775
|
+
"description": "The content of the cancel button. (Usually a text, can also be a FormattedMessage component)."
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "confirmButtonText",
|
|
779
|
+
"type": "Node",
|
|
780
|
+
"default": "",
|
|
781
|
+
"description": "The content of the confirmation button. Since it is a node, it can be a simple text or any JSX node like a div element with an icon and a text."
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"name": "bsSize",
|
|
785
|
+
"type": "String",
|
|
786
|
+
"default": "md",
|
|
787
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"name": "onClose",
|
|
791
|
+
"type": "Function",
|
|
792
|
+
"default": "() => {}",
|
|
793
|
+
"description": "A callback function invoked when the dialog closes"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"name": "onCloseValidation",
|
|
797
|
+
"type": "Function",
|
|
798
|
+
"default": "() => true",
|
|
799
|
+
"description": "A callback function to be executed before closing the dialog. If the function returns false the dialog will not be closed."
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"name": "showCloseButton",
|
|
803
|
+
"type": "Boolean",
|
|
804
|
+
"default": "true",
|
|
805
|
+
"description": "Shows a close button when set to true"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"name": "useOverflow",
|
|
809
|
+
"type": "Boolean",
|
|
810
|
+
"default": "false",
|
|
811
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"name": "className",
|
|
815
|
+
"type": "String",
|
|
816
|
+
"default": "",
|
|
817
|
+
"description": "Additional classes for the modal element"
|
|
818
|
+
}
|
|
819
|
+
]
|
|
820
|
+
}
|
|
821
|
+
]
|
|
822
|
+
}
|
|
823
|
+
]
|
|
824
|
+
}
|
|
825
|
+
]
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"heading": "SplitDialog",
|
|
829
|
+
"body": "This component allows the user to create a split dialog. It uses the dialog component described above.",
|
|
830
|
+
"examples": [
|
|
831
|
+
{
|
|
832
|
+
"caption": "Example 8",
|
|
833
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"btn-toolbar\"><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Split dialog</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Split dialog large</button></div></div>",
|
|
834
|
+
"tabs": [
|
|
835
|
+
{
|
|
836
|
+
"label": "React",
|
|
837
|
+
"language": "tsx",
|
|
838
|
+
"code": "import { useState } from 'react';\n\nimport composition from '../../../assets/getting_started_composition.webp';\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport SplitDialog from '@rio-cloud/rio-uikit/SplitDialog';\nimport ListMenu from '@rio-cloud/rio-uikit/ListMenu';\nimport Notification from '@rio-cloud/rio-uikit/Notification';\nimport { dummyTextLong, dummyTextShort } from '../../../utils/data';\n\nexport default () => {\n const [show, setShow] = useState(false);\n const [showLg, setShowLg] = useState(false);\n\n const handleClose = () => {\n setShow(false);\n console.log('dialog closed');\n };\n\n return (\n <div className='btn-toolbar'>\n <Button bsStyle='primary' onClick={() => setShow(true)}>\n Split dialog\n </Button>\n <SplitDialog\n show={show}\n title='Split dialog title'\n onClose={handleClose}\n leftContent={<ListMenu menuItems={menuItems} groupClassName='padding-left-0' />}\n rightContentClassName='bg-lightest'\n footer={<div>Sample footer</div>}\n rightContent={\n <>\n <div className='h4'>Dolor sit amet</div>\n <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy</p>\n <div className='padding-top-15'>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Admin</div>\n <div className='panel-body'>\n <ul className='padding-left-20 margin-0'>\n <li>Permission to read all vehicles and their master data.</li>\n <li>Permission to change driver emails.</li>\n </ul>\n </div>\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Reader</div>\n <div className='panel-body'>\n <ul className='padding-left-20 margin-0'>\n <li>Permission to read all reports</li>\n </ul>\n </div>\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'>\n <div className='panel-heading text-color-darkest text-bold'>Lorem ipsum</div>\n <div className='panel-body' />\n </div>\n </div>\n </>\n }\n />\n\n <Button bsStyle='primary' onClick={() => setShowLg(true)}>\n Split dialog large\n </Button>\n <SplitDialog\n show={showLg}\n bsSize='lg'\n title='Split dialog title'\n onClose={() => setShowLg(false)}\n leftContent={\n <ListMenu menuItems={menuItems2} groupClassName='padding-left-0' className='padding-top-5' />\n }\n leftContentClassName='padding-top-25'\n showDivider={false}\n rightContent={\n <>\n <div className='text-size-h2 text-medium margin-bottom-15'>Dolor sit amet</div>\n <p>{dummyTextShort}</p>\n <img className='img-responsive border rounded' alt='Intro' src={composition} />\n <div className='display-flex gap-50 margin-top-25'>\n <div className='flex-1-1'>\n <p className='h4'>Lorem ipsum dolor sit amet</p>\n <div>{dummyTextLong}</div>\n </div>\n <div className='flex-1-1'>\n <p className='h4'>Lorem ipsum dolor sit amet</p>\n <div>{dummyTextLong}</div>\n </div>\n </div>\n </>\n }\n />\n </div>\n );\n};\n\nconst menuItems = [\n {\n group: 'Rolls',\n navItems: [\n {\n key: '1',\n item: (\n <span className='active' onClick={() => Notification.info('Fleetadmin clicked')}>\n Fleetadmin\n </span>\n ),\n },\n {\n key: '2',\n item: <span onClick={() => Notification.info('Fleetuser clicked')}>Fleetuser</span>,\n },\n {\n key: '3',\n item: <span onClick={() => Notification.info('Fleetdriver clicked')}>Fleetdriver</span>,\n },\n ],\n },\n];\n\nconst menuItems2 = [\n {\n group: 'Service name',\n navItems: [\n {\n key: '1',\n item: <span className='active'>Welcome</span>,\n },\n {\n key: '2',\n item: <span>What's new</span>,\n },\n ],\n },\n {\n group: 'Features',\n navItems: [\n {\n key: '1',\n item: <span>Feature name one</span>,\n },\n {\n key: '2',\n item: <span>Another cool feature for this</span>,\n },\n {\n key: '2',\n item: <span>That is a nice feature</span>,\n },\n ],\n },\n];"
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"label": "HTML",
|
|
842
|
+
"language": "html",
|
|
843
|
+
"code": "<div class='modal show split-dialog modal-enter-done' tabindex='1' role='dialog'>\n<div class='modal-dialog modal-overflow' role='document'>\n <div class='modal-content'>\n <div class='modal-header'>\n <div class='modal-header-text'>\n <div class='modal-header-title'>Split Dialog Title</div>\n </div>\n <div class='modal-header-buttons'>\n <button\n type='button'\n class='btn btn-icon-only btn-muted modal-header-close close'\n data-testid='close'\n >\n <span class='rioglyph rioglyph-remove' aria-hidden='true'></span>\n </button>\n </div>\n </div>\n <div class='modal-body'>\n <div class='split-wrapper'>\n <div class='split-left '>\n {/* <!-- Left Content --> */}\n <div class='split-divider bg-lighter'></div>\n </div>\n <div class='split-right bg-lightest'>\n {/* <!-- Right Content --> */}\n </div>\n </div>\n </div>\n </div>\n</div>\n<div class='modal-backdrop'></div>\n</div>;"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"label": "Props",
|
|
847
|
+
"language": "json",
|
|
848
|
+
"code": null,
|
|
849
|
+
"props": [
|
|
850
|
+
{
|
|
851
|
+
"heading": null,
|
|
852
|
+
"rows": [
|
|
853
|
+
{
|
|
854
|
+
"name": "show",
|
|
855
|
+
"type": "Boolean",
|
|
856
|
+
"default": "false",
|
|
857
|
+
"description": "Opens the dialog when set to true"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"name": "title",
|
|
861
|
+
"type": "Node",
|
|
862
|
+
"default": "",
|
|
863
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"name": "subtitle",
|
|
867
|
+
"type": "Node",
|
|
868
|
+
"default": "",
|
|
869
|
+
"description": "The subtitle content"
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"name": "leftContent",
|
|
873
|
+
"type": "Node",
|
|
874
|
+
"default": "",
|
|
875
|
+
"description": "The content to be shown on the left side."
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"name": "leftContentClassName",
|
|
879
|
+
"type": "String",
|
|
880
|
+
"default": "",
|
|
881
|
+
"description": "Additional classes for the left content element."
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
"name": "rightContent",
|
|
885
|
+
"type": "Node",
|
|
886
|
+
"default": "",
|
|
887
|
+
"description": "The content to be shown on the right side."
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"name": "rightContentClassName",
|
|
891
|
+
"type": "String",
|
|
892
|
+
"default": "",
|
|
893
|
+
"description": "Additional classes for the right content element."
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"name": "onClose",
|
|
897
|
+
"type": "Function",
|
|
898
|
+
"default": "() => {}",
|
|
899
|
+
"description": "A callback function invoked when the dialog closes"
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
"name": "onCloseValidation",
|
|
903
|
+
"type": "Function",
|
|
904
|
+
"default": "() => true",
|
|
905
|
+
"description": "A callback function to be executed before closing the dialog. If the function returns false the dialog will not be closed."
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
"name": "showCloseButton",
|
|
909
|
+
"type": "Boolean",
|
|
910
|
+
"default": "true",
|
|
911
|
+
"description": "Shows a close button when set to true"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"name": "disableEsc",
|
|
915
|
+
"type": "Boolean",
|
|
916
|
+
"default": "false",
|
|
917
|
+
"description": "Enables or disabled closing the dialog via esc key"
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"name": "onEsc",
|
|
921
|
+
"type": "Function",
|
|
922
|
+
"default": "() => {}",
|
|
923
|
+
"description": "A callback fired when esc key is pressed and the dialog is about to close"
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
"name": "useOverflow",
|
|
927
|
+
"type": "Boolean",
|
|
928
|
+
"default": "true",
|
|
929
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"name": "bsSize",
|
|
933
|
+
"type": "String",
|
|
934
|
+
"default": "md",
|
|
935
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"name": "className",
|
|
939
|
+
"type": "String",
|
|
940
|
+
"default": "",
|
|
941
|
+
"description": "Additional classes for the modal element"
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
"name": "footerClassName",
|
|
945
|
+
"type": "String",
|
|
946
|
+
"default": "",
|
|
947
|
+
"description": "Additional classes for the modal-footer element"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
"name": "footer",
|
|
951
|
+
"type": "Node",
|
|
952
|
+
"default": "",
|
|
953
|
+
"description": "The dialog footer content"
|
|
954
|
+
}
|
|
955
|
+
]
|
|
956
|
+
}
|
|
957
|
+
]
|
|
958
|
+
}
|
|
959
|
+
]
|
|
960
|
+
}
|
|
961
|
+
]
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"heading": "InfoDialog",
|
|
965
|
+
"body": "This component allows the user to create a dialog without title and footer. It uses the dialog component described above.",
|
|
966
|
+
"examples": [
|
|
967
|
+
{
|
|
968
|
+
"caption": "Example 9",
|
|
969
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Info dialog</button></div></div>",
|
|
970
|
+
"tabs": [
|
|
971
|
+
{
|
|
972
|
+
"label": "React",
|
|
973
|
+
"language": "tsx",
|
|
974
|
+
"code": "import { useState } from 'react';\n\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport InfoDialog from '@rio-cloud/rio-uikit/InfoDialog';\n\nconst InfoDialogExample = () => {\n const [show, setShow] = useState(false);\n\n const handleShow = () => setShow(true);\n const handleHide = () => setShow(false);\n\n return (\n <div>\n <Button bsStyle='primary' onClick={handleShow}>\n Info dialog\n </Button>\n <InfoDialog\n show={show}\n onClose={handleHide}\n content={\n <div className='text-center'>\n <div className='margin-bottom-25'>\n <h2>Lorem ipsum dolor sit amet</h2>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.Aliquam laoreet nec neque ut\n fermentum. Vestibulum erat enim.\n </p>\n </div>\n <Button className='margin-bottom-20' onClick={handleHide}>\n Got it\n </Button>\n </div>\n }\n />\n </div>\n );\n};\n\nexport default InfoDialogExample;"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"label": "HTML",
|
|
978
|
+
"language": "html",
|
|
979
|
+
"code": "<div class='modal show info-dialog modal-enter-done' tabindex='1' role='dialog'>\n<div class='modal-dialog' role='document'>\n <div class='modal-content'>\n <div class='modal-body'>\n <div class='text-center'>\n <div class='margin-bottom-25'>\n <h2>Lorem ipsum dolor sit amet</h2>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam laoreet nec neque ut\n fermentum. Vestibulum erat enim.\n </p>\n </div>\n <button type='button' class='btn btn-primary margin-bottom-20'>\n Understood, close me\n </button>\n </div>\n </div>\n </div>\n</div>\n<div class='modal-backdrop'></div>\n</div>;"
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
"label": "Props",
|
|
983
|
+
"language": "json",
|
|
984
|
+
"code": null,
|
|
985
|
+
"props": [
|
|
986
|
+
{
|
|
987
|
+
"heading": null,
|
|
988
|
+
"rows": [
|
|
989
|
+
{
|
|
990
|
+
"name": "show",
|
|
991
|
+
"type": "Boolean",
|
|
992
|
+
"default": "false",
|
|
993
|
+
"description": "Opens the dialog when set to true"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
"name": "title",
|
|
997
|
+
"type": "Node",
|
|
998
|
+
"default": "",
|
|
999
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"name": "subtitle",
|
|
1003
|
+
"type": "Node",
|
|
1004
|
+
"default": "",
|
|
1005
|
+
"description": "The subtitle content"
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
"name": "content",
|
|
1009
|
+
"type": "Node",
|
|
1010
|
+
"default": "",
|
|
1011
|
+
"description": "The content of the dialog body itself"
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
"name": "footer",
|
|
1015
|
+
"type": "Node",
|
|
1016
|
+
"default": "",
|
|
1017
|
+
"description": "The dialog footer content"
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
"name": "footerClassName",
|
|
1021
|
+
"type": "String",
|
|
1022
|
+
"default": "",
|
|
1023
|
+
"description": "Additional classes for the modal-footer element"
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
"name": "bodyClassName",
|
|
1027
|
+
"type": "String",
|
|
1028
|
+
"default": "",
|
|
1029
|
+
"description": "Additional classes for the modal-body element"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"name": "onClose",
|
|
1033
|
+
"type": "Function",
|
|
1034
|
+
"default": "() => {}",
|
|
1035
|
+
"description": "A callback function invoked when the dialog closes"
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
"name": "onCloseValidation",
|
|
1039
|
+
"type": "Function",
|
|
1040
|
+
"default": "() => true",
|
|
1041
|
+
"description": "A callback function to be executed before closing the dialog. If the function returns false the dialog will not be closed."
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
"name": "showCloseButton",
|
|
1045
|
+
"type": "Boolean",
|
|
1046
|
+
"default": "true",
|
|
1047
|
+
"description": "Shows a close button when set to true"
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
"name": "disableEsc",
|
|
1051
|
+
"type": "Boolean",
|
|
1052
|
+
"default": "false",
|
|
1053
|
+
"description": "Enables or disabled closing the dialog via esc key"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"name": "onEsc",
|
|
1057
|
+
"type": "Function",
|
|
1058
|
+
"default": "() => {}",
|
|
1059
|
+
"description": "A callback fired when esc key is pressed and the dialog is about to close"
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"name": "useOverflow",
|
|
1063
|
+
"type": "Boolean",
|
|
1064
|
+
"default": "false",
|
|
1065
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
"name": "bsSize",
|
|
1069
|
+
"type": "String",
|
|
1070
|
+
"default": "md",
|
|
1071
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"name": "className",
|
|
1075
|
+
"type": "String",
|
|
1076
|
+
"default": "",
|
|
1077
|
+
"description": "Additional classes for the modal element"
|
|
1078
|
+
}
|
|
1079
|
+
]
|
|
1080
|
+
}
|
|
1081
|
+
]
|
|
1082
|
+
}
|
|
1083
|
+
]
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
"caption": "Example 10",
|
|
1087
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Feature info dialog</button></div></div>",
|
|
1088
|
+
"tabs": [
|
|
1089
|
+
{
|
|
1090
|
+
"label": "React",
|
|
1091
|
+
"language": "tsx",
|
|
1092
|
+
"code": "import { useState } from 'react';\n\nimport composition from '../../../assets/getting_started_composition.webp';\nimport InfoDialog from '@rio-cloud/rio-uikit/InfoDialog';\nimport SimpleTooltip from '@rio-cloud/rio-uikit/SimpleTooltip';\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport { dummyText } from '../../../utils/data';\n\nconst InfoDialogFeatureExample = () => {\n const [show, setShow] = useState(false);\n\n const handleShow = () => setShow(true);\n const handleHide = () => setShow(false);\n\n return (\n <div>\n <Button bsStyle='primary' onClick={handleShow}>\n Feature info dialog\n </Button>\n <InfoDialog\n show={show}\n onClose={handleHide}\n bodyClassName='padding-0'\n content={\n <div>\n <div>\n <img\n className='img-responsive rounded-top-right-extra-large rounded-top-left-extra-large'\n src={composition}\n />\n </div>\n <div className='position-relative padding-20 margin-top-10 margin-x-20'>\n <SimpleTooltip placement='bottom' content='Close'>\n <div\n className='position-absolute top-20 right-20 text-color-gray cursor-pointer'\n onClick={handleHide}\n >\n <span className='rioglyph rioglyph-remove' />\n </div>\n </SimpleTooltip>\n <div className='text-size-h3 text-medium margin-bottom-15 margin-right-20'>\n Feature Lorem Ipsum dolor sit amet (Beta)\n </div>\n <p>{dummyText}</p>\n </div>\n <div\n className={\n 'display-flex flex-row-sm flex-column gap-10 justify-content-between ' +\n 'align-items-start align-items-center-sm width-100pct bg-lightest ' +\n 'padding-20 rounded-bottom-right-extra-large rounded-bottom-left-extra-large'\n }\n >\n <div className='btn-toolbar text-transform-uppercase margin-x-20 text-medium'>\n How important is this feature to you?\n </div>\n <div className='btn-toolbar text-transform-uppercase margin-x-20'>\n <SimpleTooltip placement='top' content='This would be cool, convenient or useful'>\n <Button bsStyle={Button.INFO} onClick={handleHide}>\n Nice-to-have\n </Button>\n </SimpleTooltip>\n <SimpleTooltip placement='top' content='This would solve a major need'>\n <Button bsStyle={Button.INFO} onClick={handleHide}>\n Important\n </Button>\n </SimpleTooltip>\n <SimpleTooltip placement='top' content='Withou it, we cannot use the service'>\n <Button bsStyle={Button.INFO} onClick={handleHide}>\n Critical\n </Button>\n </SimpleTooltip>\n </div>\n </div>\n </div>\n }\n />\n </div>\n );\n};\n\nexport default InfoDialogFeatureExample;"
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
"label": "HTML",
|
|
1096
|
+
"language": "html",
|
|
1097
|
+
"code": "<div class='modal show info-dialog modal-enter-done' tabindex='1' role='dialog'>\n<div class='modal-dialog' role='document'>\n <div class='modal-content'>\n <div class='modal-body'>\n <div class='text-center'>\n <div class='margin-bottom-25'>\n <h2>Lorem ipsum dolor sit amet</h2>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam laoreet nec neque ut\n fermentum. Vestibulum erat enim.\n </p>\n </div>\n <button type='button' class='btn btn-primary margin-bottom-20'>\n Understood, close me\n </button>\n </div>\n </div>\n </div>\n</div>\n<div class='modal-backdrop'></div>\n</div>;"
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
"label": "Props",
|
|
1101
|
+
"language": "json",
|
|
1102
|
+
"code": null,
|
|
1103
|
+
"props": [
|
|
1104
|
+
{
|
|
1105
|
+
"heading": null,
|
|
1106
|
+
"rows": [
|
|
1107
|
+
{
|
|
1108
|
+
"name": "show",
|
|
1109
|
+
"type": "Boolean",
|
|
1110
|
+
"default": "false",
|
|
1111
|
+
"description": "Opens the dialog when set to true"
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
"name": "title",
|
|
1115
|
+
"type": "Node",
|
|
1116
|
+
"default": "",
|
|
1117
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
"name": "subtitle",
|
|
1121
|
+
"type": "Node",
|
|
1122
|
+
"default": "",
|
|
1123
|
+
"description": "The subtitle content"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
"name": "content",
|
|
1127
|
+
"type": "Node",
|
|
1128
|
+
"default": "",
|
|
1129
|
+
"description": "The content of the dialog body itself"
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
"name": "footer",
|
|
1133
|
+
"type": "Node",
|
|
1134
|
+
"default": "",
|
|
1135
|
+
"description": "The dialog footer content"
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
"name": "footerClassName",
|
|
1139
|
+
"type": "String",
|
|
1140
|
+
"default": "",
|
|
1141
|
+
"description": "Additional classes for the modal-footer element"
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
"name": "bodyClassName",
|
|
1145
|
+
"type": "String",
|
|
1146
|
+
"default": "",
|
|
1147
|
+
"description": "Additional classes for the modal-body element"
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
"name": "onClose",
|
|
1151
|
+
"type": "Function",
|
|
1152
|
+
"default": "() => {}",
|
|
1153
|
+
"description": "A callback function invoked when the dialog closes"
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
"name": "onCloseValidation",
|
|
1157
|
+
"type": "Function",
|
|
1158
|
+
"default": "() => true",
|
|
1159
|
+
"description": "A callback function to be executed before closing the dialog. If the function returns false the dialog will not be closed."
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
"name": "showCloseButton",
|
|
1163
|
+
"type": "Boolean",
|
|
1164
|
+
"default": "true",
|
|
1165
|
+
"description": "Shows a close button when set to true"
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
"name": "disableEsc",
|
|
1169
|
+
"type": "Boolean",
|
|
1170
|
+
"default": "false",
|
|
1171
|
+
"description": "Enables or disabled closing the dialog via esc key"
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
"name": "onEsc",
|
|
1175
|
+
"type": "Function",
|
|
1176
|
+
"default": "() => {}",
|
|
1177
|
+
"description": "A callback fired when esc key is pressed and the dialog is about to close"
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
"name": "useOverflow",
|
|
1181
|
+
"type": "Boolean",
|
|
1182
|
+
"default": "false",
|
|
1183
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
"name": "bsSize",
|
|
1187
|
+
"type": "String",
|
|
1188
|
+
"default": "md",
|
|
1189
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
"name": "className",
|
|
1193
|
+
"type": "String",
|
|
1194
|
+
"default": "",
|
|
1195
|
+
"description": "Additional classes for the modal element"
|
|
1196
|
+
}
|
|
1197
|
+
]
|
|
1198
|
+
}
|
|
1199
|
+
]
|
|
1200
|
+
}
|
|
1201
|
+
]
|
|
1202
|
+
}
|
|
1203
|
+
]
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
"heading": "OnboardingDialog",
|
|
1207
|
+
"body": "The OnboardingDialog component is a customizable dialog designed to guide users through the initial steps of an onboarding tour. It displays a welcome message, a brief description of the onboarding process, and action buttons to either start the tour or skip it.",
|
|
1208
|
+
"examples": [
|
|
1209
|
+
{
|
|
1210
|
+
"caption": "Example 11",
|
|
1211
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Onboarding dialog</button></div></div>",
|
|
1212
|
+
"tabs": [
|
|
1213
|
+
{
|
|
1214
|
+
"label": "React",
|
|
1215
|
+
"language": "tsx",
|
|
1216
|
+
"code": "import { useState } from 'react';\n\nimport composition from '../../../assets/getting_started_composition.webp';\nimport OnboardingDialog from '@rio-cloud/rio-uikit/OnboardingDialog';\nimport Button from '@rio-cloud/rio-uikit/Button';\n\nexport default () => {\n const [show, setShow] = useState(false);\n\n const handleShow = () => setShow(true);\n const handleHide = () => setShow(false);\n\n const handleTakeTour = () => {\n // Start onboarding tour - see useOnboardingTour() hook\n setShow(false);\n };\n\n return (\n <div>\n <Button bsStyle='primary' onClick={handleShow}>\n Onboarding dialog\n </Button>\n <OnboardingDialog\n show={show}\n imageSrc={composition}\n imageAlt='Onboarding hero'\n title='Welcome to the RIO UIKIT!'\n description={\n <span>\n <span className='text-medium'>Get started with a quick tour</span> to explore UIKIT and discover\n its key features. It's the easiest way to get familiar with the service and make the most of\n your experience.\n </span>\n }\n onboardingRestartHint='Not ready to take the tour now?'\n onboardingRestartDescription='If you choose to skip the tour now, don’t worry — you can always start it later from the service info option in the application header.'\n skipButtonText='Skip it'\n tourButtonText='Take the tour'\n onClose={handleHide}\n onStartTour={handleTakeTour}\n />\n </div>\n );\n};"
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
"label": "HTML",
|
|
1220
|
+
"language": "html",
|
|
1221
|
+
"code": "<div>\n <button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Onboarding dialog</button>\n</div>"
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
"label": "Props",
|
|
1225
|
+
"language": "json",
|
|
1226
|
+
"code": null,
|
|
1227
|
+
"props": [
|
|
1228
|
+
{
|
|
1229
|
+
"heading": null,
|
|
1230
|
+
"rows": [
|
|
1231
|
+
{
|
|
1232
|
+
"name": "show",
|
|
1233
|
+
"type": "Boolean",
|
|
1234
|
+
"default": "false",
|
|
1235
|
+
"description": "Opens the dialog when set to true"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
"name": "imageSrc",
|
|
1239
|
+
"type": "string",
|
|
1240
|
+
"default": "",
|
|
1241
|
+
"description": "The source URL of the image to be displayed in the dialog."
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
"name": "imageAlt",
|
|
1245
|
+
"type": "string",
|
|
1246
|
+
"default": "",
|
|
1247
|
+
"description": "Alternative text for the image, used for accessibility."
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
"name": "title",
|
|
1251
|
+
"type": "string | React.ReactNode",
|
|
1252
|
+
"default": "",
|
|
1253
|
+
"description": "The title of the dialog. A welcome message."
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
"name": "description",
|
|
1257
|
+
"type": "string | React.ReactNode",
|
|
1258
|
+
"default": "",
|
|
1259
|
+
"description": "A short description of the service and its onboarding."
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
"name": "onboardingRestartHint",
|
|
1263
|
+
"type": "string | React.ReactNode",
|
|
1264
|
+
"default": "",
|
|
1265
|
+
"description": "Hint text for restarting the onboarding process."
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
"name": "onboardingRestartDescription",
|
|
1269
|
+
"type": "string | React.ReactNode",
|
|
1270
|
+
"default": "",
|
|
1271
|
+
"description": "Detailed description for restarting the onboarding process."
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
"name": "skipButtonText",
|
|
1275
|
+
"type": "string | React.ReactNode",
|
|
1276
|
+
"default": "",
|
|
1277
|
+
"description": "Text for the skip button."
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
"name": "tourButtonText",
|
|
1281
|
+
"type": "string | React.ReactNode",
|
|
1282
|
+
"default": "",
|
|
1283
|
+
"description": "Text for the button to start the tour."
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
"name": "onStartTour",
|
|
1287
|
+
"type": "() => void",
|
|
1288
|
+
"default": "",
|
|
1289
|
+
"description": "Callback function to be called when the tour starts."
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
"name": "onClose",
|
|
1293
|
+
"type": "Function",
|
|
1294
|
+
"default": "() => {}",
|
|
1295
|
+
"description": "A callback function invoked when the dialog closes"
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
"name": "className",
|
|
1299
|
+
"type": "String",
|
|
1300
|
+
"default": "",
|
|
1301
|
+
"description": "Additional classes for the modal element"
|
|
1302
|
+
}
|
|
1303
|
+
]
|
|
1304
|
+
}
|
|
1305
|
+
]
|
|
1306
|
+
}
|
|
1307
|
+
]
|
|
1308
|
+
}
|
|
1309
|
+
]
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
"heading": "MediaDialog",
|
|
1313
|
+
"body": "This component allows the user to show media inside a dialog like a set of images or a video. It uses the dialog component described above.",
|
|
1314
|
+
"examples": [
|
|
1315
|
+
{
|
|
1316
|
+
"caption": "Example 12",
|
|
1317
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><div class=\"btn-toolbar\"><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Media dialog with multiple images</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Media dialog with single image</button><button type=\"button\" class=\"btn btn-primary btn-component\" tabindex=\"0\">Media dialog with video</button></div></div></div>",
|
|
1318
|
+
"tabs": [
|
|
1319
|
+
{
|
|
1320
|
+
"label": "React",
|
|
1321
|
+
"language": "tsx",
|
|
1322
|
+
"code": "import { useState } from 'react';\n\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport MediaDialog from '@rio-cloud/rio-uikit/MediaDialog';\nimport ResponsiveVideo from '@rio-cloud/rio-uikit/ResponsiveVideo';\nimport Notification from '@rio-cloud/rio-uikit/Notification';\n\nexport default () => {\n const [showMediaDialog, setShowMediaDialog] = useState(false);\n const [showSingleMediaDialog, setShowSingleMediaDialog] = useState(false);\n const [showVideoMediaDialog, setShowVideoMediaDialog] = useState(false);\n\n return (\n <div>\n <div className='btn-toolbar'>\n <Button bsStyle='primary' onClick={() => setShowMediaDialog(true)}>\n Media dialog with multiple images\n </Button>\n <Button bsStyle='primary' onClick={() => setShowSingleMediaDialog(true)}>\n Media dialog with single image\n </Button>\n <Button bsStyle='primary' onClick={() => setShowVideoMediaDialog(true)}>\n Media dialog with video\n </Button>\n </div>\n\n {/* Multiple images */}\n <MediaDialog\n show={showMediaDialog}\n onClose={() => setShowMediaDialog(false)}\n previousButtonText='Previous'\n useOverflow={false}\n previousButtonCallback={(mediaIndex: number) => mediaIndex === 1 && Notification.info('Cycled through')}\n nextButtonText='Next'\n nextButtonCallback={(mediaIndex: number) => mediaIndex === 0 && Notification.info('Cycled through')}\n media={[\n {\n src: 'https://picsum.photos/1920/1080',\n type: MediaDialog.MEDIA_TYPE_IMAGE,\n title: 'Image 1',\n },\n {\n src: 'https://picsum.photos/1080/1920',\n type: MediaDialog.MEDIA_TYPE_IMAGE,\n title: 'Image 2',\n subtitle: 'Lorem ipsum dolor sit amet',\n },\n ]}\n />\n\n {/* Single image */}\n <MediaDialog\n show={showSingleMediaDialog}\n previousButtonText='Previous'\n nextButtonText='Next'\n onClose={() => setShowSingleMediaDialog(false)}\n media={[\n {\n src: 'https://picsum.photos/1920/1080',\n type: MediaDialog.MEDIA_TYPE_IMAGE,\n title: 'Lonely Image',\n },\n ]}\n />\n\n {/* Embedded video */}\n <MediaDialog\n show={showVideoMediaDialog}\n previousButtonText='Previous'\n nextButtonText='Next'\n onClose={() => setShowVideoMediaDialog(false)}\n media={[\n {\n title: 'Video',\n src: 'https://www.youtube.com/embed/znckWdXTbTk',\n type: MediaDialog.MEDIA_TYPE_VIDEO,\n aspectRatio: ResponsiveVideo.ASPECT_RATIO_16_BY_9,\n className: 'foobar',\n },\n ]}\n />\n </div>\n );\n};"
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
"label": "HTML",
|
|
1326
|
+
"language": "html",
|
|
1327
|
+
"code": "<div class='modal show media-dialog' tabindex='1' role='dialog'>\n <div class='modal-dialog modal-lg' role='document'>\n <div class='modal-content'>\n <div class='modal-header'>\n <div class='modal-header-text'>\n <div class='modal-header-title'>Image 1</div>\n </div>\n <div class='modal-header-buttons'>\n <button\n type='button'\n class='btn btn-icon-only btn-muted modal-header-close close'\n data-testid='close'>\n <span class='rioglyph rioglyph-remove' aria-hidden='true'></span>\n </button>\n </div>\n </div>\n <div class='modal-body padding-0'>\n <div class='media-content content-center'>\n <img class='ani-fade-in' src='https://......' />\n </div>\n </div>\n <div class=\"modal-footer\" aria-label=\"dialog footer\"><button type=\"button\" class=\"btn btn-primary btn-link pull-left\"><span class=\"rioglyph rioglyph-chevron-left\"></span>Previous</button>\n <div>1 / 2</div><button type=\"button\" class=\"btn btn-primary btn-link btn-icon-right\"><span class=\"rioglyph rioglyph-chevron-right\"></span>Next</button>\n </div>\n </div>\n </div>\n <div class='modal-backdrop'></div>\n</div>;"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
"label": "Props",
|
|
1331
|
+
"language": "json",
|
|
1332
|
+
"code": null,
|
|
1333
|
+
"props": [
|
|
1334
|
+
{
|
|
1335
|
+
"heading": null,
|
|
1336
|
+
"rows": [
|
|
1337
|
+
{
|
|
1338
|
+
"name": "show",
|
|
1339
|
+
"type": "Boolean",
|
|
1340
|
+
"default": "false",
|
|
1341
|
+
"description": "Opens the dialog when set to true"
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
"name": "title",
|
|
1345
|
+
"type": "Node",
|
|
1346
|
+
"default": "",
|
|
1347
|
+
"description": "The dialog title (can also be a FormattedMessage component)"
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
"name": "subtitle",
|
|
1351
|
+
"type": "Node",
|
|
1352
|
+
"default": "",
|
|
1353
|
+
"description": "The subtitle content"
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
"name": "useOverflow",
|
|
1357
|
+
"type": "Boolean",
|
|
1358
|
+
"default": "false",
|
|
1359
|
+
"description": "Enables the modal body to overflow and use inline scrolling if needed.Set the class \"no-overflow-gradient\" to remove the overflow gradient in case it is problematic like when the background is gray."
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
"name": "onClose",
|
|
1363
|
+
"type": "Function",
|
|
1364
|
+
"default": "() => {}",
|
|
1365
|
+
"description": "A callback function invoked when the dialog closes"
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
"name": "disableEsc",
|
|
1369
|
+
"type": "Boolean",
|
|
1370
|
+
"default": "false",
|
|
1371
|
+
"description": "Enables or disabled closing the dialog via esc key"
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
"name": "bsSize",
|
|
1375
|
+
"type": "String",
|
|
1376
|
+
"default": "md",
|
|
1377
|
+
"description": "Defined how large the dialog will be rendered. By default, the dialog has a medium size and thus it can be omitted. Possible values are: Dialog.SIZE_XS, Dialog.SIZE_SM, Dialog.SIZE_LG, Dialog.SIZE_XL, Dialog.SIZE_FULL_WIDTH, Dialog.SIZE_FULL_HEIGHT, Dialog.SIZE_FULL_SCREEN or 'xs', 'sm', 'lg', 'xl', 'fullwidth', 'fullheight', 'fullheight-lg', 'fullheight-xl', 'fullscreen'"
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
"name": "previousButtonText",
|
|
1381
|
+
"type": "String / Node",
|
|
1382
|
+
"default": "",
|
|
1383
|
+
"description": "The button text for switching to the previous media if there are multiple."
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
"name": "previousButtonCallback",
|
|
1387
|
+
"type": "Function",
|
|
1388
|
+
"default": "() => {}",
|
|
1389
|
+
"description": "Callback function for when the previous button is clicked."
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
"name": "nextButtonText",
|
|
1393
|
+
"type": "String / Node",
|
|
1394
|
+
"default": "",
|
|
1395
|
+
"description": "The button text for switching to the next media if there are multiple."
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
"name": "nextButtonCallback",
|
|
1399
|
+
"type": "Function",
|
|
1400
|
+
"default": "() => {}",
|
|
1401
|
+
"description": "Callback function for when the next button is clicked."
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
"name": "media",
|
|
1405
|
+
"type": "Array of Objects",
|
|
1406
|
+
"default": "",
|
|
1407
|
+
"description": "List of media objects."
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
"name": "└type",
|
|
1411
|
+
"type": "String",
|
|
1412
|
+
"default": "",
|
|
1413
|
+
"description": "Defines the media type that is going to be displayed. Possible values are: MediaDialog.MEDIA_TYPE_IMAGE, MediaDialog.MEDIA_TYPE_VIDEO or 'image', 'video'"
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
"name": "└src",
|
|
1417
|
+
"type": "String",
|
|
1418
|
+
"default": "",
|
|
1419
|
+
"description": "The source location for the media data."
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
"name": "└aspectRatio",
|
|
1423
|
+
"type": "String",
|
|
1424
|
+
"default": "",
|
|
1425
|
+
"description": "Only relevant for videos where the aspect of the video is defined. Possible values are: ResponsiveVideo.ASPECT_RATIO_4_BY_3, ResponsiveVideo.ASPECT_RATIO_16_BY_9 or '4by3', '16by9'"
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
"name": "└className",
|
|
1429
|
+
"type": "String",
|
|
1430
|
+
"default": "",
|
|
1431
|
+
"description": "Additional classes for the image element."
|
|
1432
|
+
}
|
|
1433
|
+
]
|
|
1434
|
+
}
|
|
1435
|
+
]
|
|
1436
|
+
}
|
|
1437
|
+
]
|
|
1438
|
+
}
|
|
1439
|
+
]
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
"heading": "FrameDialog",
|
|
1443
|
+
"body": "This component allows the user to create a dialog in a parent window triggered and controlled by a widget iframe.\n\nFor more details, please visit iframe guidlines",
|
|
1444
|
+
"examples": [
|
|
1445
|
+
{
|
|
1446
|
+
"caption": "Example 13",
|
|
1447
|
+
"rendered_html": "<div class=\"playground-content bg-lighter padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"iframe-wrapper\"><iframe title=\"iframe\" id=\"widgetDialogFrame\" src=\"https://uikit.developers.rio.cloud/#widgetDemo\" class=\"unstyled width-100pct\" style=\"width: 1px; min-width: 100%; overflow: hidden;\" scrolling=\"no\"></iframe></div></div>",
|
|
1448
|
+
"tabs": [
|
|
1449
|
+
{
|
|
1450
|
+
"label": "React",
|
|
1451
|
+
"language": "tsx",
|
|
1452
|
+
"code": "import React from 'react';\nimport IframeResizer from 'iframe-resizer-react';\n\nimport FrameDialog from '../../../../../../src/FrameDialog';\nimport { PREFIX } from '../../../widgets/WidgetDemo';\n\nconst IFrameWidgetExample = React.memo(() => {\n return (\n <>\n <div className='iframe-wrapper'>\n <IframeResizer\n id='widgetDialogFrame'\n src={`${window.location.origin}${window.location.pathname}#widgetDemo`}\n className='unstyled width-100pct'\n style={{ width: '1px', minWidth: '100%' }}\n />\n </div>\n <FrameDialog\n eventPrefix={PREFIX}\n getSourceFrame={() => document.getElementById('widgetDialogFrame') as HTMLIFrameElement}\n />\n </>\n );\n});\n\nexport default IFrameWidgetExample;\n\n// ----------------------------------------------------------\nimport { useState } from 'react';\n\nimport Button from '../../../../src/Button';\nimport { OPEN_DIALOG_EVENT, CLOSE_DIALOG_EVENT, OPEN_DIALOG_EVENT_TYPE } from '../../../../src/FrameDialog';\nimport usePostMessage, { type RemoteAction } from '../../../../src/usePostMessage';\n\nexport const PREFIX = 'EVENT_UIKIT_WIDGET_DEMO';\n\nconst WidgetDemo = () => {\n const [messageFromDialog, setMessageFromDialog] = useState('-');\n\n const { sendMessageToParent } = usePostMessage(PREFIX, (remoteAction: RemoteAction) => {\n console.log(remoteAction);\n\n if (remoteAction.type === `${PREFIX}${CLOSE_DIALOG_EVENT}`) {\n setMessageFromDialog(remoteAction.payload);\n }\n });\n\n const handleOpenDialog = () => {\n const payload: OPEN_DIALOG_EVENT_TYPE = {\n src: `${window.location.origin}${window.location.pathname}#widgetDemoDialog`,\n dialogProps: {\n bsSize: 'sm',\n },\n };\n\n sendMessageToParent({\n type: `${PREFIX}${OPEN_DIALOG_EVENT}`,\n payload,\n });\n };\n\n return (\n <div className='bg-white border rounded padding-20 height-200'>\n <div className='text-medium'>This is a widget embedded via an iframe</div>\n <div className='btn-toolbar margin-top-20'>\n <Button onClick={handleOpenDialog}>Open dialog in parent frame</Button>\n </div>\n <div className='margin-top-20'>\n <label>Closing message from dialog:</label>\n <div>{messageFromDialog}</div>\n </div>\n </div>\n );\n};\n\nexport default WidgetDemo;\n\n// ----------------------------------------------------------\nimport Button from '../../../../src/Button';\nimport Dialog from '../../../../src/Dialog';\nimport usePostMessage from '../../../../src/usePostMessage';\nimport { CLOSE_DIALOG_EVENT } from '../../../../src/FrameDialog';\n\nimport { dummyText } from '../../utils/data';\nimport { PREFIX } from './WidgetDemo';\n\nconst WidgetDemo = () => {\n const { sendMessageToParent } = usePostMessage(PREFIX);\n\n const handleCloseDialog = () => {\n sendMessageToParent({\n type: `${PREFIX}${CLOSE_DIALOG_EVENT}`,\n payload: 'hello from the dialog view',\n });\n };\n\n return (\n <div className='bg-white min-height-200'>\n <Dialog.Title title='Widget dialog' onCloseButtonClick={handleCloseDialog} />\n\n <Dialog.Body className='padding-20'>\n <div className='text-medium'>This is the widget dialog content embedded via an iframe</div>\n <p>{dummyText}</p>\n </Dialog.Body>\n\n <Dialog.Footer>\n <div>\n <Button onClick={handleCloseDialog}>Close dialog in parent frame</Button>\n </div>\n </Dialog.Footer>\n </div>\n );\n};\n\nexport default WidgetDemo;"
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
"label": "HTML",
|
|
1456
|
+
"language": "html",
|
|
1457
|
+
"code": "<div class=\"iframe-wrapper\">\n <iframe title=\"iframe\" id=\"widgetDialogFrame\" src=\"https://uikit.developers.rio.cloud/#widgetDemo\" class=\"unstyled width-100pct\" style=\"width: 1px; min-width: 100%; overflow: hidden; height: 200px;\" scrolling=\"no\">\n </iframe>\n</div>"
|
|
1458
|
+
}
|
|
1459
|
+
]
|
|
1460
|
+
}
|
|
1461
|
+
]
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
"heading": "ReleaseNotesDialog",
|
|
1465
|
+
"body": "The ReleaseNotesDialog component is meant to be used for the release notes of a service.Note there exists also a separate ReleaseNotes component.",
|
|
1466
|
+
"examples": [
|
|
1467
|
+
{
|
|
1468
|
+
"caption": "Example 14",
|
|
1469
|
+
"rendered_html": "<div class=\"playground-content bg-lighter padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"ApplicationLayout\"><div class=\"ApplicationLayoutHeader\" id=\"ApplicationLayoutHeader\"><nav class=\"ApplicationHeader user-select-none\"><div class=\"navbar-header\"><span class=\"navbar-brand home-icon\"></span></div><ul class=\"ModuleNavigation AppMenu user-select-none pointer-events-none\"><li class=\"dropdown\"><a class=\"ModuleNavigation-dropdown dropdown-toggle justify-content-between inactive\" role=\"button\" id=\"basic-nav-dropdown\"><span>Service</span></a></li></ul><ul class=\"SubmoduleNavigation nav\"></ul><ul class=\"ApplicationActionBar nav navbar-nav navbar-right \"><li role=\"presentation\" class=\"navigationItem\"><div class=\"ActionBarItem\"><div class=\"ActionBarItemIcon\"><span class=\"icon rioglyph rioglyph-info-sign\"></span><span class=\"badge bg-primary badge-indicator\">1</span></div></div></li></ul></nav></div></div></div>",
|
|
1470
|
+
"tabs": [
|
|
1471
|
+
{
|
|
1472
|
+
"label": "React",
|
|
1473
|
+
"language": "tsx",
|
|
1474
|
+
"code": "import { useState } from 'react';\n\nimport ReleaseNotesDialog from '@rio-cloud/rio-uikit/ReleaseNotesDialog';\nimport ApplicationLayout from '@rio-cloud/rio-uikit/ApplicationLayout';\nimport ActionBarItem from '@rio-cloud/rio-uikit/ActionBarItem';\nimport ApplicationHeader from '@rio-cloud/rio-uikit/ApplicationHeader';\n\nimport packageJson from '../../../../package.json';\nconst currentVersion = packageJson.version;\n\nconst RELEASE_NOTES_ITEM = 'TEAMNAME.RELEASENOTES';\n\nconst currentVersionNumbers = currentVersion.split('.');\n\nconst isNewVersion = (localVersion: string | null) => {\n if (!localVersion) {\n return true;\n }\n\n const localVersionNumbers = localVersion.split('.');\n\n return !(\n currentVersionNumbers[0] === localVersionNumbers[0] && currentVersionNumbers[1] === localVersionNumbers[1]\n );\n};\n\nconst releaseNotes = {\n 'en-GB': {\n '1.1.0': {\n date: '23.07.2018',\n content: (\n <div>{`Map view within the tour history table\n• Modern map design as used in the Beta of the fleet monitor\n• Works with all event types\n• Event specific map marker\n• Map size adjustable via slider`}</div>\n ),\n },\n '1.0.0': {\n date: '27.06.2018',\n content: [\n <div key='1'>New feature XYZ has been added ...</div>,\n <div key='2'>fixed bugs in ...</div>,\n <div key='3'>Another feature has been added</div>,\n ],\n },\n },\n};\n\nconst translationKey = 'en-GB';\n\nconst translations = {\n whatsNew: 'What`s new?',\n close: 'Close',\n 'module.name': 'Modulename',\n};\n\nconst handleRemoveReleaseNotesItem = () => {\n window.localStorage.removeItem(RELEASE_NOTES_ITEM);\n};\n\nexport default () => {\n const [show, setShow] = useState(false);\n\n const hasNewReleaseNotes = isNewVersion(window.localStorage.getItem(RELEASE_NOTES_ITEM));\n const actionBarItemTitle = `${translations['module.name']} v.${currentVersion}`;\n\n const actionBarItem = (\n <ActionBarItem id='serviceInfoReleaseNotes'>\n <ActionBarItem.Icon>\n <span className='icon rioglyph rioglyph-info-sign' />\n {hasNewReleaseNotes && <span className='badge bg-primary badge-indicator'>1</span>}\n </ActionBarItem.Icon>\n <ActionBarItem.Popover title={actionBarItemTitle}>\n <ActionBarItem.List>\n <ActionBarItem.ListItem icon='rioglyph-exclamation-sign' onClick={() => setShow(true)}>\n {translations.whatsNew ?? 'What`s new?'}\n {hasNewReleaseNotes && <span className='badge badge-primary margin-left-5'>1</span>}\n </ActionBarItem.ListItem>\n </ActionBarItem.List>\n <ActionBarItem.List>\n <ActionBarItem.ListItem icon='rioglyph-erase' onClick={handleRemoveReleaseNotesItem}>\n Remove Release Notes flag\n </ActionBarItem.ListItem>\n </ActionBarItem.List>\n </ActionBarItem.Popover>\n </ActionBarItem>\n );\n\n return (\n <>\n <ApplicationLayout>\n <ApplicationLayout.Header>\n <ApplicationHeader label='Service' actionBarItems={[actionBarItem]} />\n </ApplicationLayout.Header>\n </ApplicationLayout>\n\n <ReleaseNotesDialog\n showReleaseNotes={show}\n setShowReleaseNotes={setShow}\n moduleName={translations['module.name']}\n whatsNewTitle={translations.whatsNew}\n closeButtonText={translations.close}\n translatedReleaseNotes={releaseNotes[translationKey]}\n currentVersion={currentVersion}\n RELEASE_NOTES_ITEM={RELEASE_NOTES_ITEM}\n />\n </>\n );\n};"
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
"label": "HTML",
|
|
1478
|
+
"language": "html",
|
|
1479
|
+
"code": "<div class=\"ApplicationLayout\">\n <div class=\"ApplicationLayoutHeader\" id=\"ApplicationLayoutHeader\">\n <nav class=\"ApplicationHeader user-select-none\">\n <div class=\"navbar-header\">\n <span class=\"navbar-brand home-icon\">\n </span>\n </div>\n <ul class=\"ModuleNavigation AppMenu user-select-none pointer-events-none\">\n <li class=\"dropdown\">\n <a class=\"ModuleNavigation-dropdown dropdown-toggle justify-content-between inactive\" role=\"button\" id=\"basic-nav-dropdown\">\n <span>Service</span>\n </a>\n </li>\n </ul>\n <ul class=\"SubmoduleNavigation nav\">\n </ul>\n <ul class=\"ApplicationActionBar nav navbar-nav navbar-right \">\n <li role=\"presentation\" class=\"navigationItem\">\n <div class=\"ActionBarItem\">\n <div class=\"ActionBarItemIcon\">\n <span class=\"icon rioglyph rioglyph-info-sign\">\n </span>\n <span class=\"badge bg-primary badge-indicator\">1</span>\n </div>\n </div>\n </li>\n </ul>\n </nav>\n </div>\n</div>"
|
|
1480
|
+
},
|
|
1481
|
+
{
|
|
1482
|
+
"label": "Props",
|
|
1483
|
+
"language": "json",
|
|
1484
|
+
"code": "{\n \"0.1.2\": {\n date: String,\n content: arrayOf(nodes) or single node,\n }\n}"
|
|
1485
|
+
}
|
|
1486
|
+
]
|
|
1487
|
+
}
|
|
1488
|
+
]
|
|
1489
|
+
}
|
|
1490
|
+
],
|
|
1491
|
+
"see_also": []
|
|
1492
|
+
}
|