2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
import{a7 as M,g as N,a as _,s as j,b as y,_ as p,r as C,u as U,e as k,K as w,M as D,T as P,j as E,h,f as W,i as z}from"./index.4f61bfb1.js";const A=M(),O=A;function B(o){return _("MuiFormControlLabel",o)}const H=N("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error"]),c=H,I=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","slotProps","value"],K=o=>{const{classes:e,disabled:a,labelPlacement:r,error:l}=o,d={root:["root",a&&"disabled",`labelPlacement${y(r)}`,l&&"error"],label:["label",a&&"disabled"]};return z(d,B,e)},q=j("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[{[`& .${c.label}`]:e.label},e.root,e[`labelPlacement${y(a.labelPlacement)}`]]}})(({theme:o,ownerState:e})=>p({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${c.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${c.label}`]:{[`&.${c.disabled}`]:{color:(o.vars||o).palette.text.disabled}}})),G=C.exports.forwardRef(function(e,a){var r;const l=U({props:e,name:"MuiFormControlLabel"}),{className:d,componentsProps:L={},control:n,disabled:x,disableTypography:F,label:v,labelPlacement:$="end",slotProps:R={}}=l,S=k(l,I),b=w();let t=x;typeof t>"u"&&typeof n.props.disabled<"u"&&(t=n.props.disabled),typeof t>"u"&&b&&(t=b.disabled);const f={disabled:t};["checked","name","onChange","value","inputRef"].forEach(i=>{typeof n.props[i]>"u"&&typeof l[i]<"u"&&(f[i]=l[i])});const T=D({props:l,muiFormControl:b,states:["error"]}),u=p({},l,{disabled:t,labelPlacement:$,error:T.error}),g=K(u),m=(r=R.typography)!=null?r:L.typography;let s=v;return s!=null&&s.type!==P&&!F&&(s=E(P,p({component:"span"},m,{className:h(g.label,m==null?void 0:m.className),children:s}))),W(q,p({className:h(g.root,d),ownerState:u,ref:a},S,{children:[C.exports.cloneElement(n,f),s]}))}),Q=G;export{Q as F,O as S};
|