%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/public_html/ezone-accounting.optisoft.com.ng/static/js/
Upload File :
Create Path :
Current File : /home/opti/public_html/ezone-accounting.optisoft.com.ng/static/js/51.1ac6b9c5.chunk.js

(this["webpackJsonpfuse-react-app"]=this["webpackJsonpfuse-react-app"]||[]).push([[51],{1129:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FrameContextConsumer=t.FrameContextProvider=t.FrameContext=void 0;var o,a=n(0),r=(o=a)&&o.__esModule?o:{default:o};var c=void 0,i=void 0;"undefined"!==typeof document&&(c=document),"undefined"!==typeof window&&(i=window);var l=t.FrameContext=r.default.createContext({document:c,window:i}),s=l.Provider,d=l.Consumer;t.FrameContextProvider=s,t.FrameContextConsumer=d},1130:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o=n(118),a=n(1100),r=n(1109),c=n(1090),i=n(1117),l=n(1119),s=n(5),d=n(0),h=n(1024),m=n(551),u=n(1087),p=n(1099),b=n(11),f=n(370),j=n(371),x=n(1131),g=n.n(x),O=n(1);const w=Object(h.a)({productionPrefix:"iframe-"});class y extends d.Component{constructor(){super(...arguments),this.state={ready:!1},this.handleRef=e=>{this.contentDocument=e?e.node.contentDocument:null},this.onContentDidMount=()=>{this.setState({ready:!0,jss:Object(f.a)({...Object(m.a)(),plugins:[...Object(m.a)().plugins,Object(j.a)()],insertionPoint:this.contentDocument.querySelector("#jss-demo-insertion-point")}),sheetsManager:new Map,container:this.contentDocument.body})},this.onContentDidUpdate=()=>{this.contentDocument.body.dir=this.props.theme.direction},this.renderHead=()=>Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n                    html {\n                    font-size: 62.5%;\n                    font-family: Poppins, Roboto, Helvetica Neue, Arial, sans-serif;\n                    }\n                "}}),Object(O.jsx)("noscript",{id:"jss-demo-insertion-point"})]})}render(){const{children:e,classes:t,theme:n}=this.props;return Object(O.jsx)(g.a,{head:this.renderHead(),ref:this.handleRef,className:Object(s.a)(t.root,"shadow"),contentDidMount:this.onContentDidMount,contentDidUpdate:this.onContentDidUpdate,children:this.state.ready?Object(O.jsx)(u.b,{jss:this.state.jss,generateClassName:w,sheetsManager:this.state.sheetsManager,children:Object(O.jsx)(p.a,{theme:n,children:Object(d.cloneElement)(e,{container:this.state.container})})}):null})}}var k=Object(b.a)((e=>({root:{backgroundColor:e.palette.background.default,flexGrow:1,height:400,border:"none"}})),{withTheme:!0})(y);function C(e){const[t,n]=Object(d.useState)(e.currentTabIndex),{component:h,raw:m,iframe:u,className:p}=e;return Object(O.jsxs)(r.a,{className:Object(s.a)(p,"shadow"),children:[Object(O.jsx)(a.a,{position:"static",color:"default",className:"shadow-0",children:Object(O.jsxs)(l.a,{classes:{root:"border-b-1",flexContainer:"justify-end"},value:t,onChange:function(e,t){n(t)},children:[h&&Object(O.jsx)(i.a,{classes:{root:"min-w-64"},icon:Object(O.jsx)(c.a,{children:"remove_red_eye"})}),m&&Object(O.jsx)(i.a,{classes:{root:"min-w-64"},icon:Object(O.jsx)(c.a,{children:"code"})})]})}),Object(O.jsxs)("div",{className:"flex justify-center max-w-full",children:[Object(O.jsx)("div",{className:0===t?"flex flex-1 max-w-full":"hidden",children:h&&(u?Object(O.jsx)(k,{children:Object(O.jsx)(h,{})}):Object(O.jsx)("div",{className:"p-24 flex flex-1 justify-center max-w-full",children:Object(O.jsx)(h,{})}))}),Object(O.jsx)("div",{className:1===t?"flex flex-1":"hidden",children:m&&Object(O.jsx)("div",{className:"flex flex-1",children:Object(O.jsx)(o.a,{component:"pre",className:"language-javascript w-full",children:m.default})})})]})]})}C.defaultProps={currentTabIndex:0};var v=C},1131:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FrameContextConsumer=t.FrameContext=void 0;var o=n(1129);Object.defineProperty(t,"FrameContext",{enumerable:!0,get:function(){return o.FrameContext}}),Object.defineProperty(t,"FrameContextConsumer",{enumerable:!0,get:function(){return o.FrameContextConsumer}});var a,r=n(1132),c=(a=r)&&a.__esModule?a:{default:a};t.default=c.default},1132:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(0),c=h(r),i=h(n(22)),l=h(n(553)),s=n(1129),d=h(n(1133));function h(e){return e&&e.__esModule?e:{default:e}}var m=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.handleLoad=function(){o.forceUpdate()},o._isMounted=!1,o}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"componentDidMount",value:function(){this._isMounted=!0;var e=this.getDoc();e&&"complete"===e.readyState?this.forceUpdate():this.node.addEventListener("load",this.handleLoad)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.node.removeEventListener("load",this.handleLoad)}},{key:"getDoc",value:function(){return this.node?this.node.contentDocument:null}},{key:"getMountTarget",value:function(){var e=this.getDoc();return this.props.mountTarget?e.querySelector(this.props.mountTarget):e.body.children[0]}},{key:"renderFrameContents",value:function(){if(!this._isMounted)return null;var e=this.getDoc();if(!e)return null;var t=this.props.contentDidMount,n=this.props.contentDidUpdate,o=e.defaultView||e.parentView,a=c.default.createElement(d.default,{contentDidMount:t,contentDidUpdate:n},c.default.createElement(s.FrameContextProvider,{value:{document:e,window:o}},c.default.createElement("div",{className:"frame-content"},this.props.children)));e.body.children.length<1&&(e.open("text/html","replace"),e.write(this.props.initialContent),e.close());var r=this.getMountTarget();return[i.default.createPortal(this.props.head,this.getDoc().head),i.default.createPortal(a,r)]}},{key:"render",value:function(){var e=this,t=o({},this.props,{children:void 0});return delete t.head,delete t.initialContent,delete t.mountTarget,delete t.contentDidMount,delete t.contentDidUpdate,c.default.createElement("iframe",o({},t,{ref:function(t){e.node=t}}),this.renderFrameContents())}}]),t}(r.Component);m.propTypes={style:l.default.object,head:l.default.node,initialContent:l.default.string,mountTarget:l.default.string,contentDidMount:l.default.func,contentDidUpdate:l.default.func,children:l.default.oneOfType([l.default.element,l.default.arrayOf(l.default.element)])},m.defaultProps={style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:function(){},contentDidUpdate:function(){},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'},t.default=m},1133:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(0),r=(c(a),c(n(553)));function c(e){return e&&e.__esModule?e:{default:e}}var i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.props.contentDidMount()}},{key:"componentDidUpdate",value:function(){this.props.contentDidUpdate()}},{key:"render",value:function(){return a.Children.only(this.props.children)}}]),t}(a.Component);i.propTypes={children:r.default.element.isRequired,contentDidMount:r.default.func.isRequired,contentDidUpdate:r.default.func.isRequired},t.default=i},1172:function(e,t,n){"use strict";var o=n(7),a=n(2),r=n(0),c=n(8),i=n(11),l=[0,1,2,3,4,5,6,7,8,9,10],s=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseFloat(e);return"".concat(n/t).concat(String(e).replace(String(n),"")||"px")}var h=r.forwardRef((function(e,t){var n=e.alignContent,i=void 0===n?"stretch":n,l=e.alignItems,s=void 0===l?"stretch":l,d=e.classes,h=e.className,m=e.component,u=void 0===m?"div":m,p=e.container,b=void 0!==p&&p,f=e.direction,j=void 0===f?"row":f,x=e.item,g=void 0!==x&&x,O=e.justify,w=e.justifyContent,y=void 0===w?"flex-start":w,k=e.lg,C=void 0!==k&&k,v=e.md,S=void 0!==v&&v,F=e.sm,P=void 0!==F&&F,N=e.spacing,L=void 0===N?0:N,D=e.wrap,G=void 0===D?"wrap":D,_=e.xl,M=void 0!==_&&_,B=e.xs,T=void 0!==B&&B,A=e.zeroMinWidth,R=void 0!==A&&A,$=Object(o.a)(e,["alignContent","alignItems","classes","className","component","container","direction","item","justify","justifyContent","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),E=Object(c.a)(d.root,h,b&&[d.container,0!==L&&d["spacing-xs-".concat(String(L))]],g&&d.item,R&&d.zeroMinWidth,"row"!==j&&d["direction-xs-".concat(String(j))],"wrap"!==G&&d["wrap-xs-".concat(String(G))],"stretch"!==s&&d["align-items-xs-".concat(String(s))],"stretch"!==i&&d["align-content-xs-".concat(String(i))],"flex-start"!==(O||y)&&d["justify-content-xs-".concat(String(O||y))],!1!==T&&d["grid-xs-".concat(String(T))],!1!==P&&d["grid-sm-".concat(String(P))],!1!==S&&d["grid-md-".concat(String(S))],!1!==C&&d["grid-lg-".concat(String(C))],!1!==M&&d["grid-xl-".concat(String(M))]);return r.createElement(u,Object(a.a)({className:E,ref:t},$))})),m=Object(i.a)((function(e){return Object(a.a)({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-content-xs-center":{justifyContent:"center"},"justify-content-xs-flex-end":{justifyContent:"flex-end"},"justify-content-xs-space-between":{justifyContent:"space-between"},"justify-content-xs-space-around":{justifyContent:"space-around"},"justify-content-xs-space-evenly":{justifyContent:"space-evenly"}},function(e,t){var n={};return l.forEach((function(o){var a=e.spacing(o);0!==a&&(n["spacing-".concat(t,"-").concat(o)]={margin:"-".concat(d(a,2)),width:"calc(100% + ".concat(d(a),")"),"& > $item":{padding:d(a,2)}})})),n}(e,"xs"),e.breakpoints.keys.reduce((function(t,n){return function(e,t,n){var o={};s.forEach((function(e){var t="grid-".concat(n,"-").concat(e);if(!0!==e)if("auto"!==e){var a="".concat(Math.round(e/12*1e8)/1e6,"%");o[t]={flexBasis:a,flexGrow:0,maxWidth:a}}else o[t]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};else o[t]={flexBasis:0,flexGrow:1,maxWidth:"100%"}})),"xs"===n?Object(a.a)(e,o):e[t.breakpoints.up(n)]=o}(t,e,n),t}),{}))}),{name:"MuiGrid"})(h);t.a=m},2274:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return i}));var o=n(0),a=n.n(o),r=n(1095),c=n(1);function i(){const[e,t]=a.a.useState({checkedA:!0,checkedB:!0}),n=n=>{t({...e,[n.target.name]:n.target.checked})};return Object(c.jsxs)("div",{children:[Object(c.jsx)(r.a,{checked:e.checkedA,onChange:n,name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),Object(c.jsx)(r.a,{checked:e.checkedB,onChange:n,color:"primary",name:"checkedB",inputProps:{"aria-label":"primary checkbox"}}),Object(c.jsx)(r.a,{inputProps:{"aria-label":"primary checkbox"}}),Object(c.jsx)(r.a,{disabled:!0,inputProps:{"aria-label":"disabled checkbox"}}),Object(c.jsx)(r.a,{disabled:!0,checked:!0,inputProps:{"aria-label":"primary checkbox"}}),Object(c.jsx)(r.a,{defaultChecked:!0,color:"default",inputProps:{"aria-label":"checkbox with default color"}})]})}},2275:function(e,t,n){"use strict";n.r(t),t.default="import React from 'react';\nimport Switch from '@material-ui/core/Switch';\n\nexport default function Switches() {\n  const [state, setState] = React.useState({\n    checkedA: true,\n    checkedB: true,\n  });\n\n  const handleChange = (event) => {\n    setState({ ...state, [event.target.name]: event.target.checked });\n  };\n\n  return (\n    <div>\n      <Switch\n        checked={state.checkedA}\n        onChange={handleChange}\n        name=\"checkedA\"\n        inputProps={{ 'aria-label': 'secondary checkbox' }}\n      />\n      <Switch\n        checked={state.checkedB}\n        onChange={handleChange}\n        color=\"primary\"\n        name=\"checkedB\"\n        inputProps={{ 'aria-label': 'primary checkbox' }}\n      />\n      <Switch inputProps={{ 'aria-label': 'primary checkbox' }} />\n      <Switch disabled inputProps={{ 'aria-label': 'disabled checkbox' }} />\n      <Switch disabled checked inputProps={{ 'aria-label': 'primary checkbox' }} />\n      <Switch\n        defaultChecked\n        color=\"default\"\n        inputProps={{ 'aria-label': 'checkbox with default color' }}\n      />\n    </div>\n  );\n}\n"},2276:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return s}));var o=n(0),a=n.n(o),r=n(1037),c=n(1094),i=n(1095),l=n(1);function s(){const[e,t]=a.a.useState({checkedA:!0,checkedB:!0}),n=n=>{t({...e,[n.target.name]:n.target.checked})};return Object(l.jsxs)(r.a,{row:!0,children:[Object(l.jsx)(c.a,{control:Object(l.jsx)(i.a,{checked:e.checkedA,onChange:n,name:"checkedA"}),label:"Secondary"}),Object(l.jsx)(c.a,{control:Object(l.jsx)(i.a,{checked:e.checkedB,onChange:n,name:"checkedB",color:"primary"}),label:"Primary"}),Object(l.jsx)(c.a,{control:Object(l.jsx)(i.a,{}),label:"Uncontrolled"}),Object(l.jsx)(c.a,{disabled:!0,control:Object(l.jsx)(i.a,{}),label:"Disabled"}),Object(l.jsx)(c.a,{disabled:!0,control:Object(l.jsx)(i.a,{checked:!0}),label:"Disabled"})]})}},2277:function(e,t,n){"use strict";n.r(t),t.default='import React from \'react\';\nimport FormGroup from \'@material-ui/core/FormGroup\';\nimport FormControlLabel from \'@material-ui/core/FormControlLabel\';\nimport Switch from \'@material-ui/core/Switch\';\n\nexport default function SwitchLabels() {\n  const [state, setState] = React.useState({\n    checkedA: true,\n    checkedB: true,\n  });\n\n  const handleChange = (event) => {\n    setState({ ...state, [event.target.name]: event.target.checked });\n  };\n\n  return (\n    <FormGroup row>\n      <FormControlLabel\n        control={<Switch checked={state.checkedA} onChange={handleChange} name="checkedA" />}\n        label="Secondary"\n      />\n      <FormControlLabel\n        control={\n          <Switch\n            checked={state.checkedB}\n            onChange={handleChange}\n            name="checkedB"\n            color="primary"\n          />\n        }\n        label="Primary"\n      />\n      <FormControlLabel control={<Switch />} label="Uncontrolled" />\n      <FormControlLabel disabled control={<Switch />} label="Disabled" />\n      <FormControlLabel disabled control={<Switch checked />} label="Disabled" />\n    </FormGroup>\n  );\n}\n'},2278:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return m}));var o=n(0),a=n.n(o),r=n(1036),c=n(1035),i=n(1037),l=n(1094),s=n(1039),d=n(1095),h=n(1);function m(){const[e,t]=a.a.useState({gilad:!0,jason:!1,antoine:!0}),n=n=>{t({...e,[n.target.name]:n.target.checked})};return Object(h.jsxs)(c.a,{component:"fieldset",children:[Object(h.jsx)(r.a,{component:"legend",children:"Assign responsibility"}),Object(h.jsxs)(i.a,{children:[Object(h.jsx)(l.a,{control:Object(h.jsx)(d.a,{checked:e.gilad,onChange:n,name:"gilad"}),label:"Gilad Gray"}),Object(h.jsx)(l.a,{control:Object(h.jsx)(d.a,{checked:e.jason,onChange:n,name:"jason"}),label:"Jason Killian"}),Object(h.jsx)(l.a,{control:Object(h.jsx)(d.a,{checked:e.antoine,onChange:n,name:"antoine"}),label:"Antoine Llorca"})]}),Object(h.jsx)(s.a,{children:"Be careful"})]})}},2279:function(e,t,n){"use strict";n.r(t),t.default='import React from \'react\';\nimport FormLabel from \'@material-ui/core/FormLabel\';\nimport FormControl from \'@material-ui/core/FormControl\';\nimport FormGroup from \'@material-ui/core/FormGroup\';\nimport FormControlLabel from \'@material-ui/core/FormControlLabel\';\nimport FormHelperText from \'@material-ui/core/FormHelperText\';\nimport Switch from \'@material-ui/core/Switch\';\n\nexport default function SwitchesGroup() {\n  const [state, setState] = React.useState({\n    gilad: true,\n    jason: false,\n    antoine: true,\n  });\n\n  const handleChange = (event) => {\n    setState({ ...state, [event.target.name]: event.target.checked });\n  };\n\n  return (\n    <FormControl component="fieldset">\n      <FormLabel component="legend">Assign responsibility</FormLabel>\n      <FormGroup>\n        <FormControlLabel\n          control={<Switch checked={state.gilad} onChange={handleChange} name="gilad" />}\n          label="Gilad Gray"\n        />\n        <FormControlLabel\n          control={<Switch checked={state.jason} onChange={handleChange} name="jason" />}\n          label="Jason Killian"\n        />\n        <FormControlLabel\n          control={<Switch checked={state.antoine} onChange={handleChange} name="antoine" />}\n          label="Antoine Llorca"\n        />\n      </FormGroup>\n      <FormHelperText>Be careful</FormHelperText>\n    </FormControl>\n  );\n}\n'},2280:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return f}));var o=n(0),a=n.n(o),r=n(11),c=n(425),i=n(1037),l=n(1094),s=n(1095),d=n(1172),h=n(194),m=n(1);const u=Object(r.a)({switchBase:{color:c.a[300],"&$checked":{color:c.a[500]},"&$checked + $track":{backgroundColor:c.a[500]}},checked:{},track:{}})(s.a),p=Object(r.a)((e=>({root:{width:42,height:26,padding:0,margin:e.spacing(1)},switchBase:{padding:1,"&$checked":{transform:"translateX(16px)",color:e.palette.common.white,"& + $track":{backgroundColor:"#52d869",opacity:1,border:"none"}},"&$focusVisible $thumb":{color:"#52d869",border:"6px solid #fff"}},thumb:{width:24,height:24},track:{borderRadius:13,border:"1px solid ".concat(e.palette.grey[400]),backgroundColor:e.palette.grey[50],opacity:1,transition:e.transitions.create(["background-color","border"])},checked:{},focusVisible:{}})))((e=>{let{classes:t,...n}=e;return Object(m.jsx)(s.a,{focusVisibleClassName:t.focusVisible,disableRipple:!0,classes:{root:t.root,switchBase:t.switchBase,thumb:t.thumb,track:t.track,checked:t.checked},...n})})),b=Object(r.a)((e=>({root:{width:28,height:16,padding:0,display:"flex"},switchBase:{padding:2,color:e.palette.grey[500],"&$checked":{transform:"translateX(12px)",color:e.palette.common.white,"& + $track":{opacity:1,backgroundColor:e.palette.primary.main,borderColor:e.palette.primary.main}}},thumb:{width:12,height:12,boxShadow:"none"},track:{border:"1px solid ".concat(e.palette.grey[500]),borderRadius:8,opacity:1,backgroundColor:e.palette.common.white},checked:{}})))(s.a);function f(){const[e,t]=a.a.useState({checkedA:!0,checkedB:!0,checkedC:!0}),n=n=>{t({...e,[n.target.name]:n.target.checked})};return Object(m.jsxs)(i.a,{children:[Object(m.jsx)(l.a,{control:Object(m.jsx)(u,{checked:e.checkedA,onChange:n,name:"checkedA"}),label:"Custom color"}),Object(m.jsx)(l.a,{control:Object(m.jsx)(p,{checked:e.checkedB,onChange:n,name:"checkedB"}),label:"iOS style"}),Object(m.jsx)(h.a,{component:"div",children:Object(m.jsxs)(d.a,{component:"label",container:!0,alignItems:"center",spacing:1,children:[Object(m.jsx)(d.a,{item:!0,children:"Off"}),Object(m.jsx)(d.a,{item:!0,children:Object(m.jsx)(b,{checked:e.checkedC,onChange:n,name:"checkedC"})}),Object(m.jsx)(d.a,{item:!0,children:"On"})]})})]})}},2281:function(e,t,n){"use strict";n.r(t),t.default="import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport { purple } from '@material-ui/core/colors';\nimport FormGroup from '@material-ui/core/FormGroup';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Switch from '@material-ui/core/Switch';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\n\nconst PurpleSwitch = withStyles({\n  switchBase: {\n    color: purple[300],\n    '&$checked': {\n      color: purple[500],\n    },\n    '&$checked + $track': {\n      backgroundColor: purple[500],\n    },\n  },\n  checked: {},\n  track: {},\n})(Switch);\n\nconst IOSSwitch = withStyles((theme) => ({\n  root: {\n    width: 42,\n    height: 26,\n    padding: 0,\n    margin: theme.spacing(1),\n  },\n  switchBase: {\n    padding: 1,\n    '&$checked': {\n      transform: 'translateX(16px)',\n      color: theme.palette.common.white,\n      '& + $track': {\n        backgroundColor: '#52d869',\n        opacity: 1,\n        border: 'none',\n      },\n    },\n    '&$focusVisible $thumb': {\n      color: '#52d869',\n      border: '6px solid #fff',\n    },\n  },\n  thumb: {\n    width: 24,\n    height: 24,\n  },\n  track: {\n    borderRadius: 26 / 2,\n    border: `1px solid ${theme.palette.grey[400]}`,\n    backgroundColor: theme.palette.grey[50],\n    opacity: 1,\n    transition: theme.transitions.create(['background-color', 'border']),\n  },\n  checked: {},\n  focusVisible: {},\n}))(({ classes, ...props }) => {\n  return (\n    <Switch\n      focusVisibleClassName={classes.focusVisible}\n      disableRipple\n      classes={{\n        root: classes.root,\n        switchBase: classes.switchBase,\n        thumb: classes.thumb,\n        track: classes.track,\n        checked: classes.checked,\n      }}\n      {...props}\n    />\n  );\n});\n\nconst AntSwitch = withStyles((theme) => ({\n  root: {\n    width: 28,\n    height: 16,\n    padding: 0,\n    display: 'flex',\n  },\n  switchBase: {\n    padding: 2,\n    color: theme.palette.grey[500],\n    '&$checked': {\n      transform: 'translateX(12px)',\n      color: theme.palette.common.white,\n      '& + $track': {\n        opacity: 1,\n        backgroundColor: theme.palette.primary.main,\n        borderColor: theme.palette.primary.main,\n      },\n    },\n  },\n  thumb: {\n    width: 12,\n    height: 12,\n    boxShadow: 'none',\n  },\n  track: {\n    border: `1px solid ${theme.palette.grey[500]}`,\n    borderRadius: 16 / 2,\n    opacity: 1,\n    backgroundColor: theme.palette.common.white,\n  },\n  checked: {},\n}))(Switch);\n\nexport default function CustomizedSwitches() {\n  const [state, setState] = React.useState({\n    checkedA: true,\n    checkedB: true,\n    checkedC: true,\n  });\n\n  const handleChange = (event) => {\n    setState({ ...state, [event.target.name]: event.target.checked });\n  };\n\n  return (\n    <FormGroup>\n      <FormControlLabel\n        control={<PurpleSwitch checked={state.checkedA} onChange={handleChange} name=\"checkedA\" />}\n        label=\"Custom color\"\n      />\n      <FormControlLabel\n        control={<IOSSwitch checked={state.checkedB} onChange={handleChange} name=\"checkedB\" />}\n        label=\"iOS style\"\n      />\n      <Typography component=\"div\">\n        <Grid component=\"label\" container alignItems=\"center\" spacing={1}>\n          <Grid item>Off</Grid>\n          <Grid item>\n            <AntSwitch checked={state.checkedC} onChange={handleChange} name=\"checkedC\" />\n          </Grid>\n          <Grid item>On</Grid>\n        </Grid>\n      </Typography>\n    </FormGroup>\n  );\n}\n"},2282:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return s}));var o=n(0),a=n.n(o),r=n(1095),c=n(1037),i=n(1094),l=n(1);function s(){const[e,t]=a.a.useState(!1),n=()=>{t((e=>!e))};return Object(l.jsxs)(c.a,{children:[Object(l.jsx)(i.a,{control:Object(l.jsx)(r.a,{size:"small",checked:e,onChange:n}),label:"Small"}),Object(l.jsx)(i.a,{control:Object(l.jsx)(r.a,{checked:e,onChange:n}),label:"Normal"})]})}},2283:function(e,t,n){"use strict";n.r(t),t.default="import React from 'react';\nimport Switch from '@material-ui/core/Switch';\nimport FormGroup from '@material-ui/core/FormGroup';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\n\nexport default function SwitchesSize() {\n  const [checked, setChecked] = React.useState(false);\n\n  const toggleChecked = () => {\n    setChecked((prev) => !prev);\n  };\n\n  return (\n    <FormGroup>\n      <FormControlLabel\n        control={<Switch size=\"small\" checked={checked} onChange={toggleChecked} />}\n        label=\"Small\"\n      />\n      <FormControlLabel\n        control={<Switch checked={checked} onChange={toggleChecked} />}\n        label=\"Normal\"\n      />\n    </FormGroup>\n  );\n}\n"},2284:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return l}));n(0);var o=n(1095),a=n(1037),r=n(1094),c=n(1035),i=n(1);function l(){return Object(i.jsx)(c.a,{component:"fieldset",children:Object(i.jsxs)(a.a,{"aria-label":"position",row:!0,children:[Object(i.jsx)(r.a,{value:"top",control:Object(i.jsx)(o.a,{color:"primary"}),label:"Top",labelPlacement:"top"}),Object(i.jsx)(r.a,{value:"start",control:Object(i.jsx)(o.a,{color:"primary"}),label:"Start",labelPlacement:"start"}),Object(i.jsx)(r.a,{value:"bottom",control:Object(i.jsx)(o.a,{color:"primary"}),label:"Bottom",labelPlacement:"bottom"}),Object(i.jsx)(r.a,{value:"end",control:Object(i.jsx)(o.a,{color:"primary"}),label:"End",labelPlacement:"end"})]})})}},2285:function(e,t,n){"use strict";n.r(t),t.default='import React from \'react\';\nimport Switch from \'@material-ui/core/Switch\';\nimport FormGroup from \'@material-ui/core/FormGroup\';\nimport FormControlLabel from \'@material-ui/core/FormControlLabel\';\nimport FormControl from \'@material-ui/core/FormControl\';\n\nexport default function FormControlLabelPosition() {\n  return (\n    <FormControl component="fieldset">\n      <FormGroup aria-label="position" row>\n        <FormControlLabel\n          value="top"\n          control={<Switch color="primary" />}\n          label="Top"\n          labelPlacement="top"\n        />\n        <FormControlLabel\n          value="start"\n          control={<Switch color="primary" />}\n          label="Start"\n          labelPlacement="start"\n        />\n        <FormControlLabel\n          value="bottom"\n          control={<Switch color="primary" />}\n          label="Bottom"\n          labelPlacement="bottom"\n        />\n        <FormControlLabel\n          value="end"\n          control={<Switch color="primary" />}\n          label="End"\n          labelPlacement="end"\n        />\n      </FormGroup>\n    </FormControl>\n  );\n}\n'},2607:function(e,t,n){"use strict";n.r(t);var o=n(1130),a=n(118),r=n(1098),c=n(1090),i=n(194),l=n(1072),s=n(1);const d=Object(l.a)((e=>({layoutRoot:{"& .description":{marginBottom:16}}})));t.default=function(e){return d(),Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)("div",{className:"flex flex-1 flex-grow-0 items-center justify-end",children:Object(s.jsxs)(r.a,{className:"normal-case",variant:"outlined",component:"a",href:"https://material-ui.com/components/switches",target:"_blank",role:"button",children:[Object(s.jsx)(c.a,{children:"link"}),Object(s.jsx)("span",{className:"mx-4",children:"Reference"})]})}),Object(s.jsx)(i.a,{className:"text-44 mt-32 mb-8",component:"h1",children:"Switch"}),Object(s.jsx)(i.a,{className:"description",children:"Switches toggle the state of a single setting on or off."}),Object(s.jsxs)(i.a,{className:"mb-16",component:"div",children:[Object(s.jsx)("a",{href:"https://material.io/design/components/selection-controls.html#switches",children:"Switches"})," ","are the preferred way to adjust settings on mobile. The option that the switch controls, as well as the state it\u2019s in, should be made clear from the corresponding inline label."]}),Object(s.jsx)(i.a,{className:"text-32 mt-32 mb-8",component:"h2",children:"Basic switches"}),Object(s.jsx)(i.a,{className:"mb-16",component:"div",children:Object(s.jsx)(o.a,{className:"my-24",iframe:!1,component:n(2274).default,raw:n(2275)})}),Object(s.jsx)(i.a,{className:"text-32 mt-32 mb-8",component:"h2",children:"Switch with FormControlLabel"}),Object(s.jsxs)(i.a,{className:"mb-16",component:"div",children:[Object(s.jsx)("code",{children:"Switch"})," can be provided with a description thanks to the"," ",Object(s.jsx)("code",{children:"FormControlLabel"})," component."]}),Object(s.jsx)(i.a,{className:"mb-16",component:"div",children:Object(s.jsx)(o.a,{className:"my-24",iframe:!1,component:n(2276).default,raw:n(2277)})}),Object(s.jsx)(i.a,{className:"text-32 mt-32 mb-8",component:"h2",children:"Switches with FormGroup"}),Object(s.jsxs)(i.a,{className:"mb-16",component:"div",children:[Object(s.jsx)("code",{children:"FormGroup"})," is a helpful wrapper used to group selection controls components that provides an easier API. However, you are encouraged you to use"," ",Object(s.jsx)("a",{href:"/components/checkboxes/",children:"Checkboxes"})," instead if multiple related controls are required. (See: ",Object(s.jsx)("a",{href:"#when-to-use",children:"When to use"}),")."]}),Object(s.jsx)(i.a,{className:"mb-16",component:"div",children:Object(s.jsx)(o.a,{className:"my-24",iframe:!1,component:n(2278).default,raw:n(2279)})}),Object(s.jsx)(i.a,{className:"text-32 mt-32 mb-8",component:"h2",children:"Customized switches"}),Object(s.jsxs)(i.a,{className:"mb-16",component:"div",children:["Here are some examples of customizing the component. You can learn more about this in the",Object(s.jsx)("a",{href:"/customization/components/",children:"overrides documentation page"}),"."]}),Object(s.jsx)(i.a,{className:"mb-16",component:"div",children:Object(s.jsx)(o.a,{className:"my-24",iframe:!1,component:n(2280).default,raw:n(2281)})}),Object(s.jsxs)(i.a,{className:"mb-16",component:"div",children:["\ud83c\udfa8 If you are looking for inspiration, you can check"," ",Object(s.jsx)("a",{href:"https://mui-treasury.com/styles/switch",children:"MUI Treasury's customization examples"}),"."]}),Object(s.jsx)(i.a,{className:"text-32 mt-32 mb-8",component:"h2",children:"Sizes"}),Object(s.jsxs)(i.a,{className:"mb-16",component:"div",children:["Fancy smaller switches? Use the ",Object(s.jsx)("code",{children:"size"})," property."]}),Object(s.jsx)(i.a,{className:"mb-16",component:"div",children:Object(s.jsx)(o.a,{className:"my-24",iframe:!1,component:n(2282).default,raw:n(2283)})}),Object(s.jsx)(i.a,{className:"text-32 mt-32 mb-8",component:"h2",children:"Label placement"}),Object(s.jsx)(i.a,{className:"mb-16",component:"div",children:"You can change the placement of the label:"}),Object(s.jsx)(i.a,{className:"mb-16",component:"div",children:Object(s.jsx)(o.a,{className:"my-24",iframe:!1,component:n(2284).default,raw:n(2285)})}),Object(s.jsx)(i.a,{className:"text-32 mt-32 mb-8",component:"h2",children:"When to use"}),Object(s.jsx)("ul",{children:Object(s.jsx)("li",{children:Object(s.jsx)("a",{href:"https://uxplanet.org/checkbox-vs-toggle-switch-7fc6e83f10b8",children:"Checkboxes vs. Switches"})})}),Object(s.jsx)(i.a,{className:"text-32 mt-32 mb-8",component:"h2",children:"Accessibility"}),Object(s.jsxs)("ul",{children:[Object(s.jsxs)("li",{children:["It will render an element with the ",Object(s.jsx)("code",{children:"checkbox"})," role not ",Object(s.jsx)("code",{children:"switch"})," role since this role isn't widely supported yet. Please test first if assistive technology of your target audience supports this role properly. Then you can change the role with",Object(s.jsx)("code",{children:"<Switch inputProps={{ role: 'switch' }}>"})]}),Object(s.jsxs)("li",{children:["All form controls should have labels, and this includes radio buttons, checkboxes, and switches. In most cases, this is done by using the ",Object(s.jsx)("code",{children:"<label>"})," element (",Object(s.jsx)("a",{href:"/api/form-control-label/",children:"FormControlLabel"}),")."]}),Object(s.jsxs)("li",{children:["When a label can't be used, it's necessary to add an attribute directly to the input component. In this case, you can apply the additional attribute (e.g."," ",Object(s.jsx)("code",{children:"aria-label"}),", ",Object(s.jsx)("code",{children:"aria-labelledby"}),", ",Object(s.jsx)("code",{children:"title"}),") via the"," ",Object(s.jsx)("code",{children:"inputProps"})," property."]})]}),Object(s.jsx)(a.a,{component:"pre",className:"language-jsx",children:" \n<Switch value=\"checkedA\" inputProps={{ 'aria-label': 'Switch A' }} />\n"})]})}}}]);

Zerion Mini Shell 1.0