@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,789 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"captured_at": "2025-11-21T12:07:11.796Z",
|
|
4
|
+
"source": "https://uikit.developers.rio.cloud/#components/clearableInput",
|
|
5
|
+
"category": "Components",
|
|
6
|
+
"section": "Interaction",
|
|
7
|
+
"slug": "components/clearableinput",
|
|
8
|
+
"version": "v1.13.2",
|
|
9
|
+
"hash_algorithm": "sha256",
|
|
10
|
+
"hash": "64ee9e49c195c0181797df06fac345764758c4f28d24026dc877924499cc6144"
|
|
11
|
+
},
|
|
12
|
+
"title": "ClearableInput",
|
|
13
|
+
"lead": "Control, which can be cleared when it has a value.",
|
|
14
|
+
"content": [
|
|
15
|
+
{
|
|
16
|
+
"heading": "ClearableInput",
|
|
17
|
+
"body": "Can be used as either a controlled or uncontrolled component, depending on your use case. https://facebook.github.io/react/docs/uncontrolled-components.html",
|
|
18
|
+
"examples": [
|
|
19
|
+
{
|
|
20
|
+
"caption": "Example 1",
|
|
21
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"max-width-600\"><div class=\"form-group\"><label for=\"1\">Default</label><div class=\"ClearableInput input-group\"><input id=\"1\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"2\">With a default value</label><div class=\"ClearableInput input-group\"><input id=\"2\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"Matti\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"3\">With a button addon</label><div class=\"input-group\"><div class=\"ClearableInput input-group\"><input id=\"3\" placeholder=\"Type in here\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div><span class=\"input-group-btn\"><button class=\"btn btn-primary btn-icon-only\" type=\"button\"><span class=\"rioglyph rioglyph-search\"></span></button></span></div></div><div class=\"form-group\"><label for=\"4\">With many button addons</label><div class=\"input-group\"><div class=\"ClearableInput input-group\"><input id=\"4\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"Clear me\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div><span class=\"input-group-btn\"><button class=\"btn btn-default btn-icon-only\" type=\"button\"><span class=\"rioglyph rioglyph-chat\"></span></button><button class=\"btn btn-primary btn-icon-only\" type=\"button\"><span class=\"rioglyph rioglyph-send\"></span></button></span></div></div><div class=\"form-group\"><label for=\"5\">With addons</label><div class=\"input-group\"><span class=\"input-group-addon\"><span class=\"rioglyph rioglyph-search\" aria-hidden=\"true\"></span></span><div class=\"ClearableInput input-group\"><input id=\"5\" placeholder=\"Search by name\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div><span class=\"input-group-btn\"><button class=\"btn btn-primary\" type=\"button\">Button</button></span></div></div><div class=\"form-group\"><label for=\"6\">With addons on both sides</label><div class=\"input-group\"><div class=\"input-group-addon\"><span class=\"rioglyph rioglyph-finish\" aria-hidden=\"true\"></span></div><div class=\"ClearableInput input-group\"><input id=\"6\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"234\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div><div class=\"input-group-addon\">KM</div></div></div><div class=\"form-group\"><label for=\"7\">With type password</label><div class=\"ClearableInput input-group\"><input id=\"1\" class=\"form-control withClearButton\" type=\"password\" tabindex=\"0\" value=\"Matti\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"8\">With type email</label><div class=\"ClearableInput input-group\"><input id=\"8\" class=\"form-control withClearButton\" type=\"email\" tabindex=\"0\" value=\"test@test.de\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"9\">With limited amount of characters</label><div class=\"ClearableInput input-group\"><input id=\"9\" class=\"form-control withClearButton\" type=\"text\" maxlength=\"20\" tabindex=\"0\" value=\"Limited to 20 chars\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"10\">Small input</label><div class=\"ClearableInput input-group\"><input id=\"10\" class=\"form-control input-sm withClearButton\" type=\"text\" tabindex=\"0\" value=\"Matti\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group form-group-lg\"><label for=\"11\">Large input</label><div class=\"input-group\"><div class=\"input-group-addon\"><span class=\"rioglyph rioglyph-finish\" aria-hidden=\"true\"></span></div><div class=\"ClearableInput input-group\"><input id=\"11\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"234\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div><div class=\"input-group-addon\">KM</div></div></div><div class=\"form-group has-error has-feedback\"><label for=\"12\">With feedback</label><div class=\"ClearableInput input-group\"><input id=\"12\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"Some wrong value\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div><span class=\"form-control-feedback rioglyph rioglyph-error-sign\" aria-hidden=\"true\"></span></div><div class=\"form-group\"><label for=\"1\">Disabled input</label><div class=\"ClearableInput input-group pointer-events-none\"><input id=\"13\" class=\"form-control withClearButton disabled\" type=\"text\" disabled=\"\" tabindex=\"0\" value=\"This input is disabled\"><span class=\"clearButton\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div></div></div>",
|
|
22
|
+
"tabs": [
|
|
23
|
+
{
|
|
24
|
+
"label": "React",
|
|
25
|
+
"language": "tsx",
|
|
26
|
+
"code": "import ClearableInput from '@rio-cloud/rio-uikit/ClearableInput';\n\nexport default () => (\n <div className='max-width-600'>\n <div className='form-group'>\n <label htmlFor='1'>Default</label>\n <ClearableInput id='1' />\n </div>\n\n <div className='form-group'>\n <label htmlFor='2'>With a default value</label>\n <ClearableInput id='2' defaultValue='Matti' />\n </div>\n\n <div className='form-group'>\n <label htmlFor='3'>With a button addon</label>\n <div className='input-group'>\n <ClearableInput id='3' placeholder='Type in here' />\n <span className='input-group-btn'>\n <button className='btn btn-primary btn-icon-only' type='button'>\n <span className='rioglyph rioglyph-search' />\n </button>\n </span>\n </div>\n </div>\n\n <div className='form-group'>\n <label htmlFor='4'>With many button addons</label>\n <div className='input-group'>\n <ClearableInput id='4' defaultValue='Clear me' onChange={(value: string) => console.log(value)} />\n <span className='input-group-btn'>\n <button className='btn btn-default btn-icon-only' type='button'>\n <span className='rioglyph rioglyph-chat' />\n </button>\n <button className='btn btn-primary btn-icon-only' type='button'>\n <span className='rioglyph rioglyph-send' />\n </button>\n </span>\n </div>\n </div>\n\n <div className='form-group'>\n <label htmlFor='5'>With addons</label>\n <div className='input-group'>\n <span className='input-group-addon'>\n <span className='rioglyph rioglyph-search' aria-hidden='true' />\n </span>\n <ClearableInput id='5' placeholder='Search by name' onChange={(value: string) => console.log(value)} />\n <span className='input-group-btn'>\n <button className='btn btn-primary' type='button'>\n Button\n </button>\n </span>\n </div>\n </div>\n\n <div className='form-group'>\n <label htmlFor='6'>With addons on both sides</label>\n <div className='input-group'>\n <div className='input-group-addon'>\n <span className='rioglyph rioglyph-finish' aria-hidden='true' />\n </div>\n <ClearableInput id='6' defaultValue='234' onChange={(value: string) => console.log(value)} />\n <div className='input-group-addon'>KM</div>\n </div>\n </div>\n\n <div className='form-group'>\n <label htmlFor='7'>With type password</label>\n <ClearableInput id='1' defaultValue='Matti' type='password' />\n </div>\n\n <div className='form-group'>\n <label htmlFor='8'>With type email</label>\n <ClearableInput id='8' defaultValue='test@test.de' type='email' />\n </div>\n\n <div className='form-group'>\n <label htmlFor='9'>With limited amount of characters</label>\n <ClearableInput id='9' defaultValue='Limited to 20 chars' maxLength={20} />\n </div>\n\n <div className='form-group'>\n <label htmlFor='10'>Small input</label>\n <ClearableInput id='10' defaultValue='Matti' inputClassName='input-sm' />\n </div>\n\n <div className='form-group form-group-lg'>\n <label htmlFor='11'>Large input</label>\n <div className='input-group'>\n <div className='input-group-addon'>\n <span className='rioglyph rioglyph-finish' aria-hidden='true' />\n </div>\n <ClearableInput id='11' defaultValue='234' onChange={(value: string) => console.log(value)} />\n <div className='input-group-addon'>KM</div>\n </div>\n </div>\n\n <div className='form-group has-error has-feedback'>\n <label htmlFor='12'>With feedback</label>\n <ClearableInput id='12' defaultValue='Some wrong value' />\n <span className='form-control-feedback rioglyph rioglyph-error-sign' aria-hidden='true' />\n </div>\n\n <div className='form-group'>\n <label htmlFor='1'>Disabled input</label>\n <ClearableInput id='13' defaultValue='This input is disabled' disabled />\n </div>\n </div>\n);"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "HTML",
|
|
30
|
+
"language": "html",
|
|
31
|
+
"code": "<div class=\"max-width-600\">\n <div class=\"form-group\">\n <label for=\"1\">Default</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"1\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"2\">With a default value</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"2\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"Matti\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"3\">With a button addon</label>\n <div class=\"input-group\">\n <div class=\"ClearableInput input-group\">\n <input id=\"3\" placeholder=\"Type in here\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n <span class=\"input-group-btn\">\n <button class=\"btn btn-primary btn-icon-only\" type=\"button\">\n <span class=\"rioglyph rioglyph-search\">\n </span>\n </button>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"4\">With many button addons</label>\n <div class=\"input-group\">\n <div class=\"ClearableInput input-group\">\n <input id=\"4\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"Clear me\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n <span class=\"input-group-btn\">\n <button class=\"btn btn-default btn-icon-only\" type=\"button\">\n <span class=\"rioglyph rioglyph-chat\">\n </span>\n </button>\n <button class=\"btn btn-primary btn-icon-only\" type=\"button\">\n <span class=\"rioglyph rioglyph-send\">\n </span>\n </button>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"5\">With addons</label>\n <div class=\"input-group\">\n <span class=\"input-group-addon\">\n <span class=\"rioglyph rioglyph-search\" aria-hidden=\"true\">\n </span>\n </span>\n <div class=\"ClearableInput input-group\">\n <input id=\"5\" placeholder=\"Search by name\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n <span class=\"input-group-btn\">\n <button class=\"btn btn-primary\" type=\"button\">Button</button>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"6\">With addons on both sides</label>\n <div class=\"input-group\">\n <div class=\"input-group-addon\">\n <span class=\"rioglyph rioglyph-finish\" aria-hidden=\"true\">\n </span>\n </div>\n <div class=\"ClearableInput input-group\">\n <input id=\"6\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"234\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n <div class=\"input-group-addon\">KM</div>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"7\">With type password</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"1\" class=\"form-control withClearButton\" type=\"password\" tabindex=\"0\" value=\"Matti\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"8\">With type email</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"8\" class=\"form-control withClearButton\" type=\"email\" tabindex=\"0\" value=\"test@test.de\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"9\">With limited amount of characters</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"9\" class=\"form-control withClearButton\" type=\"text\" maxlength=\"20\" tabindex=\"0\" value=\"Limited to 20 chars\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"10\">Small input</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"10\" class=\"form-control input-sm withClearButton\" type=\"text\" tabindex=\"0\" value=\"Matti\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group form-group-lg\">\n <label for=\"11\">Large input</label>\n <div class=\"input-group\">\n <div class=\"input-group-addon\">\n <span class=\"rioglyph rioglyph-finish\" aria-hidden=\"true\">\n </span>\n </div>\n <div class=\"ClearableInput input-group\">\n <input id=\"11\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"234\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n <div class=\"input-group-addon\">KM</div>\n </div>\n </div>\n <div class=\"form-group has-error has-feedback\">\n <label for=\"12\">With feedback</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"12\" class=\"form-control withClearButton\" type=\"text\" tabindex=\"0\" value=\"Some wrong value\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n <span class=\"form-control-feedback rioglyph rioglyph-error-sign\" aria-hidden=\"true\">\n </span>\n </div>\n <div class=\"form-group\">\n <label for=\"1\">Disabled input</label>\n <div class=\"ClearableInput input-group pointer-events-none\">\n <input id=\"13\" class=\"form-control withClearButton disabled\" type=\"text\" disabled=\"\" tabindex=\"0\" value=\"This input is disabled\">\n <span class=\"clearButton\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n</div>"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"label": "Props",
|
|
35
|
+
"language": "json",
|
|
36
|
+
"code": null,
|
|
37
|
+
"props": [
|
|
38
|
+
{
|
|
39
|
+
"heading": null,
|
|
40
|
+
"rows": [
|
|
41
|
+
{
|
|
42
|
+
"name": "children",
|
|
43
|
+
"type": "Function",
|
|
44
|
+
"default": "",
|
|
45
|
+
"description": "Providing a function enables the \"render props\" approach. The function gets the inputProps passed and is responsible for rendering the custom <input> component."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "defaultValue",
|
|
49
|
+
"type": "String",
|
|
50
|
+
"default": "",
|
|
51
|
+
"description": "Initial value of the ClearableInput. Pass this prop if you want to use this component as an uncontrolled component."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "value",
|
|
55
|
+
"type": "String",
|
|
56
|
+
"default": "",
|
|
57
|
+
"description": "Value of the ClearableInput. Pass this prop if you want to use this component as a controlled component."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "onChange",
|
|
61
|
+
"type": "Function",
|
|
62
|
+
"default": "() => {}",
|
|
63
|
+
"description": "Callback function for when the value changes. Receives new value as an argument."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "onClear",
|
|
67
|
+
"type": "Function",
|
|
68
|
+
"default": "() => {}",
|
|
69
|
+
"description": "Callback function for when the value is cleared via the clear button"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "onKeyPress",
|
|
73
|
+
"type": "Function",
|
|
74
|
+
"default": "() => {}",
|
|
75
|
+
"description": "Callback function for every key pressed including \"Enter\" key"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "onBlur",
|
|
79
|
+
"type": "Function",
|
|
80
|
+
"default": "() => {}",
|
|
81
|
+
"description": "Callback function which gets triggered when the input looses the focus"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "onFocus",
|
|
85
|
+
"type": "Function",
|
|
86
|
+
"default": "() => {}",
|
|
87
|
+
"description": "Callback function which gets triggered when the input gains the focus"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "className",
|
|
91
|
+
"type": "String",
|
|
92
|
+
"default": "",
|
|
93
|
+
"description": "Additional classes to be set on the wrapper element"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "inputClassName",
|
|
97
|
+
"type": "String",
|
|
98
|
+
"default": "",
|
|
99
|
+
"description": "Additional classes to be set on the input element"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "placeholder",
|
|
103
|
+
"type": "String",
|
|
104
|
+
"default": "",
|
|
105
|
+
"description": "The translated text that shall be shown when the input is empty"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "inputRef",
|
|
109
|
+
"type": "Function",
|
|
110
|
+
"default": "",
|
|
111
|
+
"description": "The callback ref for the underlying input. Alternatively, use can use a forward ref."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "autoComplete",
|
|
115
|
+
"type": "String",
|
|
116
|
+
"default": "",
|
|
117
|
+
"description": "Sets autocomplete value for autosuggest forms"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "type",
|
|
121
|
+
"type": "String",
|
|
122
|
+
"default": "\"text\"",
|
|
123
|
+
"description": "Defines the type of the input itself. There are three types supported: 'text', 'email' and 'password'"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "maxLength",
|
|
127
|
+
"type": "Number",
|
|
128
|
+
"default": "",
|
|
129
|
+
"description": "Defines the maximum amount of characters that can be entered"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "disabled",
|
|
133
|
+
"type": "Boolean",
|
|
134
|
+
"default": "false",
|
|
135
|
+
"description": "Disables the input component"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "tabIndex",
|
|
139
|
+
"type": "Number",
|
|
140
|
+
"default": "0",
|
|
141
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "hasError",
|
|
145
|
+
"type": "Boolean",
|
|
146
|
+
"default": "",
|
|
147
|
+
"description": "Defined whether or not the input has the error styling"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "mask",
|
|
151
|
+
"type": "string | (string | RegExp)[]",
|
|
152
|
+
"default": "",
|
|
153
|
+
"description": "The mask prop will allow to use the component with an input mask. It defines the pattern that should be followed. For more details on masking, checkout the third party documentation for the input mask here: https://imask.js.org/guide.html Simple masks can be defined as strings. Any format character can be escaped with a backslash. The following characters will define mask format: Character: \"0\" = allowed input: \"0-9\" (digit) Character: \"a\" = allowed input: \"a-z, A-Z\" (letter) Character: \"*\" = allowed input: any character Character: \"#\" = allowed input: \"0-9, a-z, A-Z\" (digit or letter) Other chars which is not in custom definitions supposed to be fixed: [] - make input optional - include fixed part in unmasked value ` - prevent symbols shift back If definition character should be treated as fixed it should be escaped by \\\\ (E.g. \\\\0). Additionally you can provide custom definitions. Examples: \"-- *** *** ***\" \"+49 00 000 00\""
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "maskPlaceholder",
|
|
157
|
+
"type": "string | null",
|
|
158
|
+
"default": "_",
|
|
159
|
+
"description": "Placeholder to cover unfilled parts of the mask"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "maskVisibility",
|
|
163
|
+
"type": "'always' | 'onFocus' | 'never'",
|
|
164
|
+
"default": "onFocus",
|
|
165
|
+
"description": "Controls when the mask pattern is visible."
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "maskOverwrite",
|
|
169
|
+
"type": "boolean | 'shift' | undefined",
|
|
170
|
+
"default": "true",
|
|
171
|
+
"description": "Enable characters overwriting."
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "maskDefinitions",
|
|
175
|
+
"type": "Record<string, string | RegExp>",
|
|
176
|
+
"default": "",
|
|
177
|
+
"description": "Custom definitions to have more control over your mask. The defined character will be replaced in your mask."
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "maskDispatch",
|
|
181
|
+
"type": "(appended: string, dynamicMasked: any) => any",
|
|
182
|
+
"default": "",
|
|
183
|
+
"description": "Chooses the mask for dynamic masking depending on input value. Note, this function may not be an empty function, otherwise the mask selection does not work."
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "min",
|
|
187
|
+
"type": "string | number | undefined | Date",
|
|
188
|
+
"default": "",
|
|
189
|
+
"description": "Minimum value to be entered. This prop is extended to accept a Date when used with an input mask."
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "max",
|
|
193
|
+
"type": "string | number | undefined | Date",
|
|
194
|
+
"default": "",
|
|
195
|
+
"description": "Maximum value to be entered. This prop is extended to accept a Date when used with an input mask."
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "Additional props",
|
|
199
|
+
"type": "",
|
|
200
|
+
"default": "",
|
|
201
|
+
"description": "All additional properties are passed down to the underlying input like the autoComplete prop"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"caption": "Example 2",
|
|
211
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"max-width-600 form-group\"><label for=\"controlledInput\">Controlled example</label><div class=\"ClearableInput input-group\"><input id=\"controlledInput\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div><br><button type=\"button\" class=\"btn btn-primary\">Set random value</button></div></div>",
|
|
212
|
+
"tabs": [
|
|
213
|
+
{
|
|
214
|
+
"label": "React",
|
|
215
|
+
"language": "tsx",
|
|
216
|
+
"code": "import { useState } from 'react';\n\nimport ClearableInput from '@rio-cloud/rio-uikit/ClearableInput';\nimport Notification from '@rio-cloud/rio-uikit/Notification';\nimport { generateDummyText } from '../../../utils/data';\n\nconst ClearableInputControlled = () => {\n const [inputValue, setInputValue] = useState('');\n\n const handleSetRandomValue = () => setInputValue(generateDummyText());\n\n const handleInputChange = (newValue: string) => {\n setInputValue(newValue);\n if (newValue) {\n Notification.info(newValue);\n }\n };\n\n const handleClear = (event: React.MouseEvent<HTMLSpanElement>) => {\n const target = event.target as HTMLSpanElement;\n Notification.info('Input cleared');\n };\n\n const handleKeyPress = (event: React.KeyboardEvent<unknown>) => {\n console.log(event.key);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n Notification.info('Input lost focus');\n };\n\n return (\n <div className='max-width-600 form-group'>\n <label htmlFor='controlledInput'>Controlled example</label>\n <ClearableInput\n id='controlledInput'\n value={inputValue}\n onChange={handleInputChange}\n onClear={handleClear}\n onKeyPress={handleKeyPress}\n onBlur={handleBlur}\n />\n <br />\n <button type='button' className='btn btn-primary' onClick={handleSetRandomValue}>\n Set random value\n </button>\n </div>\n );\n};\n\nexport default ClearableInputControlled;"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"label": "HTML",
|
|
220
|
+
"language": "html",
|
|
221
|
+
"code": "<div class=\"max-width-600 form-group\">\n <label for=\"controlledInput\">Controlled example</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"controlledInput\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n <br>\n <button type=\"button\" class=\"btn btn-primary\">Set random value</button>\n</div>"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"label": "Props",
|
|
225
|
+
"language": "json",
|
|
226
|
+
"code": null,
|
|
227
|
+
"props": [
|
|
228
|
+
{
|
|
229
|
+
"heading": null,
|
|
230
|
+
"rows": [
|
|
231
|
+
{
|
|
232
|
+
"name": "children",
|
|
233
|
+
"type": "Function",
|
|
234
|
+
"default": "",
|
|
235
|
+
"description": "Providing a function enables the \"render props\" approach. The function gets the inputProps passed and is responsible for rendering the custom <input> component."
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": "defaultValue",
|
|
239
|
+
"type": "String",
|
|
240
|
+
"default": "",
|
|
241
|
+
"description": "Initial value of the ClearableInput. Pass this prop if you want to use this component as an uncontrolled component."
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "value",
|
|
245
|
+
"type": "String",
|
|
246
|
+
"default": "",
|
|
247
|
+
"description": "Value of the ClearableInput. Pass this prop if you want to use this component as a controlled component."
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "onChange",
|
|
251
|
+
"type": "Function",
|
|
252
|
+
"default": "() => {}",
|
|
253
|
+
"description": "Callback function for when the value changes. Receives new value as an argument."
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "onClear",
|
|
257
|
+
"type": "Function",
|
|
258
|
+
"default": "() => {}",
|
|
259
|
+
"description": "Callback function for when the value is cleared via the clear button"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "onKeyPress",
|
|
263
|
+
"type": "Function",
|
|
264
|
+
"default": "() => {}",
|
|
265
|
+
"description": "Callback function for every key pressed including \"Enter\" key"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "onBlur",
|
|
269
|
+
"type": "Function",
|
|
270
|
+
"default": "() => {}",
|
|
271
|
+
"description": "Callback function which gets triggered when the input looses the focus"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"name": "onFocus",
|
|
275
|
+
"type": "Function",
|
|
276
|
+
"default": "() => {}",
|
|
277
|
+
"description": "Callback function which gets triggered when the input gains the focus"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "className",
|
|
281
|
+
"type": "String",
|
|
282
|
+
"default": "",
|
|
283
|
+
"description": "Additional classes to be set on the wrapper element"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "inputClassName",
|
|
287
|
+
"type": "String",
|
|
288
|
+
"default": "",
|
|
289
|
+
"description": "Additional classes to be set on the input element"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "placeholder",
|
|
293
|
+
"type": "String",
|
|
294
|
+
"default": "",
|
|
295
|
+
"description": "The translated text that shall be shown when the input is empty"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"name": "inputRef",
|
|
299
|
+
"type": "Function",
|
|
300
|
+
"default": "",
|
|
301
|
+
"description": "The callback ref for the underlying input. Alternatively, use can use a forward ref."
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"name": "autoComplete",
|
|
305
|
+
"type": "String",
|
|
306
|
+
"default": "",
|
|
307
|
+
"description": "Sets autocomplete value for autosuggest forms"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "type",
|
|
311
|
+
"type": "String",
|
|
312
|
+
"default": "\"text\"",
|
|
313
|
+
"description": "Defines the type of the input itself. There are three types supported: 'text', 'email' and 'password'"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "maxLength",
|
|
317
|
+
"type": "Number",
|
|
318
|
+
"default": "",
|
|
319
|
+
"description": "Defines the maximum amount of characters that can be entered"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "disabled",
|
|
323
|
+
"type": "Boolean",
|
|
324
|
+
"default": "false",
|
|
325
|
+
"description": "Disables the input component"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "tabIndex",
|
|
329
|
+
"type": "Number",
|
|
330
|
+
"default": "0",
|
|
331
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"name": "hasError",
|
|
335
|
+
"type": "Boolean",
|
|
336
|
+
"default": "",
|
|
337
|
+
"description": "Defined whether or not the input has the error styling"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "mask",
|
|
341
|
+
"type": "string | (string | RegExp)[]",
|
|
342
|
+
"default": "",
|
|
343
|
+
"description": "The mask prop will allow to use the component with an input mask. It defines the pattern that should be followed. For more details on masking, checkout the third party documentation for the input mask here: https://imask.js.org/guide.html Simple masks can be defined as strings. Any format character can be escaped with a backslash. The following characters will define mask format: Character: \"0\" = allowed input: \"0-9\" (digit) Character: \"a\" = allowed input: \"a-z, A-Z\" (letter) Character: \"*\" = allowed input: any character Character: \"#\" = allowed input: \"0-9, a-z, A-Z\" (digit or letter) Other chars which is not in custom definitions supposed to be fixed: [] - make input optional - include fixed part in unmasked value ` - prevent symbols shift back If definition character should be treated as fixed it should be escaped by \\\\ (E.g. \\\\0). Additionally you can provide custom definitions. Examples: \"-- *** *** ***\" \"+49 00 000 00\""
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"name": "maskPlaceholder",
|
|
347
|
+
"type": "string | null",
|
|
348
|
+
"default": "_",
|
|
349
|
+
"description": "Placeholder to cover unfilled parts of the mask"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"name": "maskVisibility",
|
|
353
|
+
"type": "'always' | 'onFocus' | 'never'",
|
|
354
|
+
"default": "onFocus",
|
|
355
|
+
"description": "Controls when the mask pattern is visible."
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "maskOverwrite",
|
|
359
|
+
"type": "boolean | 'shift' | undefined",
|
|
360
|
+
"default": "true",
|
|
361
|
+
"description": "Enable characters overwriting."
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"name": "maskDefinitions",
|
|
365
|
+
"type": "Record<string, string | RegExp>",
|
|
366
|
+
"default": "",
|
|
367
|
+
"description": "Custom definitions to have more control over your mask. The defined character will be replaced in your mask."
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "maskDispatch",
|
|
371
|
+
"type": "(appended: string, dynamicMasked: any) => any",
|
|
372
|
+
"default": "",
|
|
373
|
+
"description": "Chooses the mask for dynamic masking depending on input value. Note, this function may not be an empty function, otherwise the mask selection does not work."
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "min",
|
|
377
|
+
"type": "string | number | undefined | Date",
|
|
378
|
+
"default": "",
|
|
379
|
+
"description": "Minimum value to be entered. This prop is extended to accept a Date when used with an input mask."
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "max",
|
|
383
|
+
"type": "string | number | undefined | Date",
|
|
384
|
+
"default": "",
|
|
385
|
+
"description": "Maximum value to be entered. This prop is extended to accept a Date when used with an input mask."
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "Additional props",
|
|
389
|
+
"type": "",
|
|
390
|
+
"default": "",
|
|
391
|
+
"description": "All additional properties are passed down to the underlying input like the autoComplete prop"
|
|
392
|
+
}
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
]
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"caption": "Example 3",
|
|
401
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"max-width-600 form-group \"><label for=\"uncontrolledInput\">Controlled component with restriction and used with custom input</label><div class=\"ClearableInput input-group\"><input id=\"uncontrolledInput\" placeholder=\"Please enter a number\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div></div>",
|
|
402
|
+
"tabs": [
|
|
403
|
+
{
|
|
404
|
+
"label": "React",
|
|
405
|
+
"language": "tsx",
|
|
406
|
+
"code": "import { useState, useRef, useEffect } from 'react';\nimport toNumber from 'lodash/fp/toNumber';\nimport isNil from 'lodash/fp/isNil';\n\nimport ClearableInput from '@rio-cloud/rio-uikit/ClearableInput';\n\nconst ClearableInputControlledRestricted = () => {\n const [value, setValue] = useState('');\n const [showError, setShowError] = useState(false);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => console.log({ ref: inputRef.current }), [inputRef.current]);\n\n const handleInputChange = (newValue: string) => {\n const convertedValue = toNumber(newValue);\n const isValid = !Number.isNaN(convertedValue);\n\n setValue(isValid ? newValue : value);\n setShowError(!isNil(newValue) && !isValid);\n };\n\n return (\n <div className={`max-width-600 form-group ${showError ? 'has-error has-feedback' : ''}`}>\n <label htmlFor='uncontrolledInput'>Controlled component with restriction and used with custom input</label>\n <ClearableInput\n id='uncontrolledInput'\n ref={inputRef}\n value={value}\n onChange={handleInputChange}\n onKeyPress={event => console.log(event)}\n placeholder='Please enter a number'\n >\n {inputProps => <input {...(inputProps as React.InputHTMLAttributes<HTMLInputElement>)} />}\n </ClearableInput>\n {showError && <span className='form-control-feedback rioglyph rioglyph-error-sign' />}\n {showError && (\n <span className='help-block'>\n <span>Only Number is allowed</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default ClearableInputControlledRestricted;"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"label": "HTML",
|
|
410
|
+
"language": "html",
|
|
411
|
+
"code": "<div class=\"max-width-600 form-group \">\n <label for=\"uncontrolledInput\">Controlled component with restriction and used with custom input</label>\n <div class=\"ClearableInput input-group\">\n <input id=\"uncontrolledInput\" placeholder=\"Please enter a number\" class=\"form-control\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n</div>"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"label": "Props",
|
|
415
|
+
"language": "json",
|
|
416
|
+
"code": null,
|
|
417
|
+
"props": [
|
|
418
|
+
{
|
|
419
|
+
"heading": null,
|
|
420
|
+
"rows": [
|
|
421
|
+
{
|
|
422
|
+
"name": "children",
|
|
423
|
+
"type": "Function",
|
|
424
|
+
"default": "",
|
|
425
|
+
"description": "Providing a function enables the \"render props\" approach. The function gets the inputProps passed and is responsible for rendering the custom <input> component."
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"name": "defaultValue",
|
|
429
|
+
"type": "String",
|
|
430
|
+
"default": "",
|
|
431
|
+
"description": "Initial value of the ClearableInput. Pass this prop if you want to use this component as an uncontrolled component."
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"name": "value",
|
|
435
|
+
"type": "String",
|
|
436
|
+
"default": "",
|
|
437
|
+
"description": "Value of the ClearableInput. Pass this prop if you want to use this component as a controlled component."
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "onChange",
|
|
441
|
+
"type": "Function",
|
|
442
|
+
"default": "() => {}",
|
|
443
|
+
"description": "Callback function for when the value changes. Receives new value as an argument."
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"name": "onClear",
|
|
447
|
+
"type": "Function",
|
|
448
|
+
"default": "() => {}",
|
|
449
|
+
"description": "Callback function for when the value is cleared via the clear button"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "onKeyPress",
|
|
453
|
+
"type": "Function",
|
|
454
|
+
"default": "() => {}",
|
|
455
|
+
"description": "Callback function for every key pressed including \"Enter\" key"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "onBlur",
|
|
459
|
+
"type": "Function",
|
|
460
|
+
"default": "() => {}",
|
|
461
|
+
"description": "Callback function which gets triggered when the input looses the focus"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "onFocus",
|
|
465
|
+
"type": "Function",
|
|
466
|
+
"default": "() => {}",
|
|
467
|
+
"description": "Callback function which gets triggered when the input gains the focus"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "className",
|
|
471
|
+
"type": "String",
|
|
472
|
+
"default": "",
|
|
473
|
+
"description": "Additional classes to be set on the wrapper element"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"name": "inputClassName",
|
|
477
|
+
"type": "String",
|
|
478
|
+
"default": "",
|
|
479
|
+
"description": "Additional classes to be set on the input element"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "placeholder",
|
|
483
|
+
"type": "String",
|
|
484
|
+
"default": "",
|
|
485
|
+
"description": "The translated text that shall be shown when the input is empty"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"name": "inputRef",
|
|
489
|
+
"type": "Function",
|
|
490
|
+
"default": "",
|
|
491
|
+
"description": "The callback ref for the underlying input. Alternatively, use can use a forward ref."
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "autoComplete",
|
|
495
|
+
"type": "String",
|
|
496
|
+
"default": "",
|
|
497
|
+
"description": "Sets autocomplete value for autosuggest forms"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "type",
|
|
501
|
+
"type": "String",
|
|
502
|
+
"default": "\"text\"",
|
|
503
|
+
"description": "Defines the type of the input itself. There are three types supported: 'text', 'email' and 'password'"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"name": "maxLength",
|
|
507
|
+
"type": "Number",
|
|
508
|
+
"default": "",
|
|
509
|
+
"description": "Defines the maximum amount of characters that can be entered"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"name": "disabled",
|
|
513
|
+
"type": "Boolean",
|
|
514
|
+
"default": "false",
|
|
515
|
+
"description": "Disables the input component"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"name": "tabIndex",
|
|
519
|
+
"type": "Number",
|
|
520
|
+
"default": "0",
|
|
521
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"name": "hasError",
|
|
525
|
+
"type": "Boolean",
|
|
526
|
+
"default": "",
|
|
527
|
+
"description": "Defined whether or not the input has the error styling"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"name": "mask",
|
|
531
|
+
"type": "string | (string | RegExp)[]",
|
|
532
|
+
"default": "",
|
|
533
|
+
"description": "The mask prop will allow to use the component with an input mask. It defines the pattern that should be followed. For more details on masking, checkout the third party documentation for the input mask here: https://imask.js.org/guide.html Simple masks can be defined as strings. Any format character can be escaped with a backslash. The following characters will define mask format: Character: \"0\" = allowed input: \"0-9\" (digit) Character: \"a\" = allowed input: \"a-z, A-Z\" (letter) Character: \"*\" = allowed input: any character Character: \"#\" = allowed input: \"0-9, a-z, A-Z\" (digit or letter) Other chars which is not in custom definitions supposed to be fixed: [] - make input optional - include fixed part in unmasked value ` - prevent symbols shift back If definition character should be treated as fixed it should be escaped by \\\\ (E.g. \\\\0). Additionally you can provide custom definitions. Examples: \"-- *** *** ***\" \"+49 00 000 00\""
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"name": "maskPlaceholder",
|
|
537
|
+
"type": "string | null",
|
|
538
|
+
"default": "_",
|
|
539
|
+
"description": "Placeholder to cover unfilled parts of the mask"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"name": "maskVisibility",
|
|
543
|
+
"type": "'always' | 'onFocus' | 'never'",
|
|
544
|
+
"default": "onFocus",
|
|
545
|
+
"description": "Controls when the mask pattern is visible."
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"name": "maskOverwrite",
|
|
549
|
+
"type": "boolean | 'shift' | undefined",
|
|
550
|
+
"default": "true",
|
|
551
|
+
"description": "Enable characters overwriting."
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"name": "maskDefinitions",
|
|
555
|
+
"type": "Record<string, string | RegExp>",
|
|
556
|
+
"default": "",
|
|
557
|
+
"description": "Custom definitions to have more control over your mask. The defined character will be replaced in your mask."
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"name": "maskDispatch",
|
|
561
|
+
"type": "(appended: string, dynamicMasked: any) => any",
|
|
562
|
+
"default": "",
|
|
563
|
+
"description": "Chooses the mask for dynamic masking depending on input value. Note, this function may not be an empty function, otherwise the mask selection does not work."
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"name": "min",
|
|
567
|
+
"type": "string | number | undefined | Date",
|
|
568
|
+
"default": "",
|
|
569
|
+
"description": "Minimum value to be entered. This prop is extended to accept a Date when used with an input mask."
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"name": "max",
|
|
573
|
+
"type": "string | number | undefined | Date",
|
|
574
|
+
"default": "",
|
|
575
|
+
"description": "Maximum value to be entered. This prop is extended to accept a Date when used with an input mask."
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "Additional props",
|
|
579
|
+
"type": "",
|
|
580
|
+
"default": "",
|
|
581
|
+
"description": "All additional properties are passed down to the underlying input like the autoComplete prop"
|
|
582
|
+
}
|
|
583
|
+
]
|
|
584
|
+
}
|
|
585
|
+
]
|
|
586
|
+
}
|
|
587
|
+
]
|
|
588
|
+
}
|
|
589
|
+
]
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"heading": "ClearableInput with input mask",
|
|
593
|
+
"body": "",
|
|
594
|
+
"examples": [
|
|
595
|
+
{
|
|
596
|
+
"caption": "Example 4",
|
|
597
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"display-flex flex-wrap column-gap-50\"><div class=\"form-group\"><label for=\"inputWithMask1\">Input with input mask</label><div class=\"ClearableInput input-group min-width-300\"><input id=\"inputWithMask1\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"inputWithMask2\">Input with input mask that reveals itself on focus</label><div class=\"ClearableInput input-group min-width-300\"><input id=\"inputWithMask2\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"inputWithMask3\">Input with input mask that is never shown</label><div class=\"ClearableInput input-group min-width-300\"><input id=\"inputWithMask3\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"inputWithMask4\">Input with custom mask definition</label><div class=\"ClearableInput input-group min-width-300\"><input id=\"inputWithMask4\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div><div class=\"form-group\"><label for=\"inputWithMask5\">Input with Date mask</label><div class=\"ClearableInput input-group min-width-300\"><input id=\"inputWithMask5\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\"><span class=\"clearButton hide\"><span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\"></span></span></div></div></div></div>",
|
|
598
|
+
"tabs": [
|
|
599
|
+
{
|
|
600
|
+
"label": "React",
|
|
601
|
+
"language": "tsx",
|
|
602
|
+
"code": "import ClearableInput from '@rio-cloud/rio-uikit/ClearableInput';\n\nexport default () => {\n return (\n <div className='display-flex flex-wrap column-gap-50'>\n <div className='form-group'>\n <label htmlFor='inputWithMask1'>Input with input mask</label>\n <ClearableInput id='inputWithMask1' mask='+49 00 000 00' className='min-width-300' />\n </div>\n\n <div className='form-group'>\n <label htmlFor='inputWithMask2'>Input with input mask that reveals itself on focus</label>\n <ClearableInput\n id='inputWithMask2'\n mask='-- *** *** ***'\n maskVisibility='onFocus'\n className='min-width-300'\n />\n </div>\n\n <div className='form-group'>\n <label htmlFor='inputWithMask3'>Input with input mask that is never shown</label>\n <ClearableInput\n id='inputWithMask3'\n mask='** *** *** ***'\n maskVisibility='never'\n className='min-width-300'\n />\n </div>\n\n <div className='form-group'>\n <label htmlFor='inputWithMask4'>Input with custom mask definition</label>\n <ClearableInput\n id='inputWithMask4'\n mask='AA.AAA-AAAA' // is equivalent to /^[A-Z0-9]{2}[.]{1}[A-Z0-9]{3}[-]{1}[A-Z0-9]{4}/\n maskDefinitions={{\n A: /[A-Z0-9]/,\n }}\n className='min-width-300'\n maskPlaceholder='_'\n maskVisibility='always'\n />\n </div>\n\n <div className='form-group'>\n <label htmlFor='inputWithMask5'>Input with Date mask</label>\n <ClearableInput\n id='inputWithMask5'\n mask={Date}\n min={new Date(1990, 0, 1)}\n max={new Date(2020, 0, 1)}\n className='min-width-300'\n />\n </div>\n </div>\n );\n};"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"label": "HTML",
|
|
606
|
+
"language": "html",
|
|
607
|
+
"code": "<div class=\"display-flex flex-wrap column-gap-50\">\n <div class=\"form-group\">\n <label for=\"inputWithMask1\">Input with input mask</label>\n <div class=\"ClearableInput input-group min-width-300\">\n <input id=\"inputWithMask1\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"inputWithMask2\">Input with input mask that reveals itself on focus</label>\n <div class=\"ClearableInput input-group min-width-300\">\n <input id=\"inputWithMask2\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"inputWithMask3\">Input with input mask that is never shown</label>\n <div class=\"ClearableInput input-group min-width-300\">\n <input id=\"inputWithMask3\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"inputWithMask4\">Input with custom mask definition</label>\n <div class=\"ClearableInput input-group min-width-300\">\n <input id=\"inputWithMask4\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"inputWithMask5\">Input with Date mask</label>\n <div class=\"ClearableInput input-group min-width-300\">\n <input id=\"inputWithMask5\" class=\"form-control withInputMask\" type=\"text\" tabindex=\"0\" value=\"\">\n <span class=\"clearButton hide\">\n <span class=\"clearButtonIcon rioglyph rioglyph-remove-sign\">\n </span>\n </span>\n </div>\n </div>\n</div>"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"label": "Props",
|
|
611
|
+
"language": "json",
|
|
612
|
+
"code": null,
|
|
613
|
+
"props": [
|
|
614
|
+
{
|
|
615
|
+
"heading": null,
|
|
616
|
+
"rows": [
|
|
617
|
+
{
|
|
618
|
+
"name": "children",
|
|
619
|
+
"type": "Function",
|
|
620
|
+
"default": "",
|
|
621
|
+
"description": "Providing a function enables the \"render props\" approach. The function gets the inputProps passed and is responsible for rendering the custom <input> component."
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"name": "defaultValue",
|
|
625
|
+
"type": "String",
|
|
626
|
+
"default": "",
|
|
627
|
+
"description": "Initial value of the ClearableInput. Pass this prop if you want to use this component as an uncontrolled component."
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "value",
|
|
631
|
+
"type": "String",
|
|
632
|
+
"default": "",
|
|
633
|
+
"description": "Value of the ClearableInput. Pass this prop if you want to use this component as a controlled component."
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"name": "onChange",
|
|
637
|
+
"type": "Function",
|
|
638
|
+
"default": "() => {}",
|
|
639
|
+
"description": "Callback function for when the value changes. Receives new value as an argument."
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "onClear",
|
|
643
|
+
"type": "Function",
|
|
644
|
+
"default": "() => {}",
|
|
645
|
+
"description": "Callback function for when the value is cleared via the clear button"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"name": "onKeyPress",
|
|
649
|
+
"type": "Function",
|
|
650
|
+
"default": "() => {}",
|
|
651
|
+
"description": "Callback function for every key pressed including \"Enter\" key"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"name": "onBlur",
|
|
655
|
+
"type": "Function",
|
|
656
|
+
"default": "() => {}",
|
|
657
|
+
"description": "Callback function which gets triggered when the input looses the focus"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "onFocus",
|
|
661
|
+
"type": "Function",
|
|
662
|
+
"default": "() => {}",
|
|
663
|
+
"description": "Callback function which gets triggered when the input gains the focus"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"name": "className",
|
|
667
|
+
"type": "String",
|
|
668
|
+
"default": "",
|
|
669
|
+
"description": "Additional classes to be set on the wrapper element"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"name": "inputClassName",
|
|
673
|
+
"type": "String",
|
|
674
|
+
"default": "",
|
|
675
|
+
"description": "Additional classes to be set on the input element"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "placeholder",
|
|
679
|
+
"type": "String",
|
|
680
|
+
"default": "",
|
|
681
|
+
"description": "The translated text that shall be shown when the input is empty"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "inputRef",
|
|
685
|
+
"type": "Function",
|
|
686
|
+
"default": "",
|
|
687
|
+
"description": "The callback ref for the underlying input. Alternatively, use can use a forward ref."
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"name": "autoComplete",
|
|
691
|
+
"type": "String",
|
|
692
|
+
"default": "",
|
|
693
|
+
"description": "Sets autocomplete value for autosuggest forms"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"name": "type",
|
|
697
|
+
"type": "String",
|
|
698
|
+
"default": "\"text\"",
|
|
699
|
+
"description": "Defines the type of the input itself. There are three types supported: 'text', 'email' and 'password'"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"name": "maxLength",
|
|
703
|
+
"type": "Number",
|
|
704
|
+
"default": "",
|
|
705
|
+
"description": "Defines the maximum amount of characters that can be entered"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"name": "disabled",
|
|
709
|
+
"type": "Boolean",
|
|
710
|
+
"default": "false",
|
|
711
|
+
"description": "Disables the input component"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"name": "tabIndex",
|
|
715
|
+
"type": "Number",
|
|
716
|
+
"default": "0",
|
|
717
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"name": "hasError",
|
|
721
|
+
"type": "Boolean",
|
|
722
|
+
"default": "",
|
|
723
|
+
"description": "Defined whether or not the input has the error styling"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "mask",
|
|
727
|
+
"type": "string | (string | RegExp)[]",
|
|
728
|
+
"default": "",
|
|
729
|
+
"description": "The mask prop will allow to use the component with an input mask. It defines the pattern that should be followed. For more details on masking, checkout the third party documentation for the input mask here: https://imask.js.org/guide.html Simple masks can be defined as strings. Any format character can be escaped with a backslash. The following characters will define mask format: Character: \"0\" = allowed input: \"0-9\" (digit) Character: \"a\" = allowed input: \"a-z, A-Z\" (letter) Character: \"*\" = allowed input: any character Character: \"#\" = allowed input: \"0-9, a-z, A-Z\" (digit or letter) Other chars which is not in custom definitions supposed to be fixed: [] - make input optional - include fixed part in unmasked value ` - prevent symbols shift back If definition character should be treated as fixed it should be escaped by \\\\ (E.g. \\\\0). Additionally you can provide custom definitions. Examples: \"-- *** *** ***\" \"+49 00 000 00\""
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"name": "maskPlaceholder",
|
|
733
|
+
"type": "string | null",
|
|
734
|
+
"default": "_",
|
|
735
|
+
"description": "Placeholder to cover unfilled parts of the mask"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"name": "maskVisibility",
|
|
739
|
+
"type": "'always' | 'onFocus' | 'never'",
|
|
740
|
+
"default": "onFocus",
|
|
741
|
+
"description": "Controls when the mask pattern is visible."
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"name": "maskOverwrite",
|
|
745
|
+
"type": "boolean | 'shift' | undefined",
|
|
746
|
+
"default": "true",
|
|
747
|
+
"description": "Enable characters overwriting."
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"name": "maskDefinitions",
|
|
751
|
+
"type": "Record<string, string | RegExp>",
|
|
752
|
+
"default": "",
|
|
753
|
+
"description": "Custom definitions to have more control over your mask. The defined character will be replaced in your mask."
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"name": "maskDispatch",
|
|
757
|
+
"type": "(appended: string, dynamicMasked: any) => any",
|
|
758
|
+
"default": "",
|
|
759
|
+
"description": "Chooses the mask for dynamic masking depending on input value. Note, this function may not be an empty function, otherwise the mask selection does not work."
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "min",
|
|
763
|
+
"type": "string | number | undefined | Date",
|
|
764
|
+
"default": "",
|
|
765
|
+
"description": "Minimum value to be entered. This prop is extended to accept a Date when used with an input mask."
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"name": "max",
|
|
769
|
+
"type": "string | number | undefined | Date",
|
|
770
|
+
"default": "",
|
|
771
|
+
"description": "Maximum value to be entered. This prop is extended to accept a Date when used with an input mask."
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"name": "Additional props",
|
|
775
|
+
"type": "",
|
|
776
|
+
"default": "",
|
|
777
|
+
"description": "All additional properties are passed down to the underlying input like the autoComplete prop"
|
|
778
|
+
}
|
|
779
|
+
]
|
|
780
|
+
}
|
|
781
|
+
]
|
|
782
|
+
}
|
|
783
|
+
]
|
|
784
|
+
}
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
],
|
|
788
|
+
"see_also": []
|
|
789
|
+
}
|