????

Your IP : 216.73.216.152


Current Path : C:/inetpub/vhost/tracnghiem.gdtsolutions.vn/wwwroot/assets/
Upload File :
Current File : C:/inetpub/vhost/tracnghiem.gdtsolutions.vn/wwwroot/assets/AppSwitch-48650fee.js

import{s,j as e,T as u,b as m,aH as p,aI as b,aJ as g,a4 as h,E as w,x as k,V as f,ai as j,aj as n}from"./index-9bcd78a9.js";import{S as a}from"./Switch-04a62a88.js";import{F as d}from"./FormGroup-c4ebc22e.js";import{F as i}from"./FormControlLabel-a1a576f7.js";import{S as x}from"./Stack-6f785cc2.js";import"./SwitchBase-f2562236.js";const S=s(a)(({theme:t})=>({width:62,height:34,padding:7,"& .MuiSwitch-switchBase":{margin:1,padding:0,transform:"translateX(6px)","&.Mui-checked":{color:"#fff",transform:"translateX(22px)","& .MuiSwitch-thumb:before":{backgroundImage:`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 20 20"><path fill="${encodeURIComponent("#fff")}" d="M4.2 2.5l-.7 1.8-1.8.7 1.8.7.7 1.8.6-1.8L6.7 5l-1.9-.7-.6-1.8zm15 8.3a6.7 6.7 0 11-6.6-6.6 5.8 5.8 0 006.6 6.6z"/></svg>')`},"& + .MuiSwitch-track":{opacity:1,backgroundColor:t.palette.mode==="dark"?"#8796A5":"#aab4be"}}},"& .MuiSwitch-thumb":{backgroundColor:t.palette.mode==="dark"?"#003892":"#001e3c",width:32,height:32,"&:before":{content:"''",position:"absolute",width:"100%",height:"100%",left:0,top:0,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundImage:`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 20 20"><path fill="${encodeURIComponent("#fff")}" d="M9.305 1.667V3.75h1.389V1.667h-1.39zm-4.707 1.95l-.982.982L5.09 6.072l.982-.982-1.473-1.473zm10.802 0L13.927 5.09l.982.982 1.473-1.473-.982-.982zM10 5.139a4.872 4.872 0 00-4.862 4.86A4.872 4.872 0 0010 14.862 4.872 4.872 0 0014.86 10 4.872 4.872 0 0010 5.139zm0 1.389A3.462 3.462 0 0113.471 10a3.462 3.462 0 01-3.473 3.472A3.462 3.462 0 016.527 10 3.462 3.462 0 0110 6.528zM1.665 9.305v1.39h2.083v-1.39H1.666zm14.583 0v1.39h2.084v-1.39h-2.084zM5.09 13.928L3.616 15.4l.982.982 1.473-1.473-.982-.982zm9.82 0l-.982.982 1.473 1.473.982-.982-1.473-1.473zM9.305 16.25v2.083h1.389V16.25h-1.39z"/></svg>')`}},"& .MuiSwitch-track":{opacity:1,backgroundColor:t.palette.mode==="dark"?"#8796A5":"#aab4be",borderRadius:20/2}})),v=s(a)(({theme:t})=>({padding:8,"& .MuiSwitch-track":{borderRadius:22/2,"&:before, &:after":{content:'""',position:"absolute",top:"50%",transform:"translateY(-50%)",width:16,height:16},"&:before":{backgroundImage:`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="${encodeURIComponent(t.palette.getContrastText(t.palette.primary.main))}" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"/></svg>')`,left:12},"&:after":{backgroundImage:`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="${encodeURIComponent(t.palette.getContrastText(t.palette.primary.main))}" d="M19,13H5V11H19V13Z" /></svg>')`,right:12}},"& .MuiSwitch-thumb":{boxShadow:"none",width:16,height:16,margin:2}})),C=s(t=>e.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.mode==="dark"?"#2ECA45":"#65C466",opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:"#33cf4d",border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.mode==="light"?"#E9E9EA":"#39393D",opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}})),M=s(a)(({theme:t})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:t.palette.mode==="dark"?"#177ddc":"#1890ff"}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:t.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:t.palette.mode==="dark"?"rgba(255,255,255,.35)":"rgba(0,0,0,.25)",boxSizing:"border-box"}}));function y(){return e.jsxs(d,{children:[e.jsx(i,{control:e.jsx(S,{sx:{m:1},defaultChecked:!0}),label:"MUI switch"}),e.jsx(i,{control:e.jsx(v,{defaultChecked:!0}),label:"Android 12"}),e.jsx(i,{control:e.jsx(C,{sx:{m:1},defaultChecked:!0}),label:"iOS style"}),e.jsxs(x,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(u,{children:"Off"}),e.jsx(M,{defaultChecked:!0,inputProps:{"aria-label":"ant design"}}),e.jsx(u,{children:"On"})]})]})}function B(){const[t,r]=m.useState({gilad:!0,jason:!1,antoine:!0}),o=c=>l=>{r({...t,[c]:l.target.checked})};return e.jsxs(p,{component:"fieldset",children:[e.jsx(b,{component:"legend",children:"Assign responsibility"}),e.jsxs(d,{children:[e.jsx(i,{label:"Gilad Gray",control:e.jsx(a,{checked:t.gilad,onChange:o("gilad"),value:"gilad"})}),e.jsx(i,{label:"Jason Killian",control:e.jsx(a,{checked:t.jason,onChange:o("jason"),value:"jason"})}),e.jsx(i,{label:"Antoine Llorca",control:e.jsx(a,{checked:t.antoine,onChange:o("antoine"),value:"antoine"})})]}),e.jsx(g,{children:"Be careful"})]})}function A(){const[t,r]=h.useState({checkedA:!0,checkedB:!0}),o=c=>l=>{r({...t,[c]:l.target.checked})};return e.jsxs(d,{row:!0,children:[e.jsx(i,{label:"Secondary",control:e.jsx(a,{checked:t.checkedA,onChange:o("checkedA"),value:"checkedA"})}),e.jsx(i,{label:"Primary",control:e.jsx(a,{color:"primary",value:"checkedB",checked:t.checkedB,onChange:o("checkedB")})}),e.jsx(i,{control:e.jsx(a,{value:"checkedC"}),label:"Uncontrolled"}),e.jsx(i,{disabled:!0,control:e.jsx(a,{value:"checkedD"}),label:"Disabled"}),e.jsx(i,{disabled:!0,control:e.jsx(a,{checked:!0,value:"checkedE"}),label:"Disabled"})]})}function L(){const[t,r]=h.useState("female");function o(c){r(c.target.value)}return e.jsxs(p,{component:"fieldset",children:[e.jsx(b,{component:"legend",children:"labelPlacement"}),e.jsxs(d,{"aria-label":"position",name:"position",value:t,onChange:o,row:!0,children:[e.jsx(i,{value:"top",control:e.jsx(a,{color:"primary"}),label:"Top",labelPlacement:"top"}),e.jsx(i,{value:"start",control:e.jsx(a,{color:"primary"}),label:"Start",labelPlacement:"start"}),e.jsx(i,{value:"bottom",control:e.jsx(a,{color:"primary"}),label:"Bottom",labelPlacement:"bottom"}),e.jsx(i,{value:"end",control:e.jsx(a,{color:"primary"}),label:"End",labelPlacement:"end"})]})]})}function z(){const[t,r]=h.useState({checkedA:!0,checkedB:!0}),o=c=>l=>{r({...t,[c]:l.target.checked})};return e.jsxs(w,{children:[e.jsx(a,{value:"checkedA",checked:t.checkedA,onChange:o("checkedA"),inputProps:{"aria-label":"secondary checkbox"}}),e.jsx(a,{color:"primary",value:"checkedB",checked:t.checkedB,onChange:o("checkedB"),inputProps:{"aria-label":"primary checkbox"}}),e.jsx(a,{value:"checkedC",inputProps:{"aria-label":"primary checkbox"}}),e.jsx(a,{disabled:!0,value:"checkedD",inputProps:{"aria-label":"disabled checkbox"}}),e.jsx(a,{disabled:!0,checked:!0,value:"checkedE",inputProps:{"aria-label":"primary checkbox"}}),e.jsx(a,{defaultChecked:!0,value:"checkedF",color:"default",inputProps:{"aria-label":"checkbox with default color"}})]})}const P=k("div")(({theme:t})=>({margin:"30px",[t.breakpoints.down("sm")]:{margin:"16px"},"& .breadcrumb":{marginBottom:"30px",[t.breakpoints.down("sm")]:{marginBottom:"16px"}}})),U=()=>e.jsxs(P,{children:[e.jsx(f,{className:"mb-sm-30",children:e.jsx(j,{routeSegments:[{name:"Material",path:"/material"},{name:"Switch"}]})}),e.jsxs(x,{spacing:3,children:[e.jsx(n,{title:"Simple Switch",children:e.jsx(z,{})}),e.jsx(n,{title:"Switch with Label",children:e.jsx(A,{})}),e.jsx(n,{title:"Switch with Form Group",children:e.jsx(B,{})}),e.jsx(n,{title:"Customized Switch",children:e.jsx(y,{})}),e.jsx(n,{title:"Switch with Different Label Placement",children:e.jsx(L,{})})]})]});export{U as default};