import{resetComponent as a}from"../../style/index.mjs";import m from"../../style/motion/collapse.mjs";import"../../_util/cssinjs/StyleContext.mjs";import"vue";import"../../_util/cssinjs/transformers/legacyLogicalProperties.mjs";import{zoomIn as c}from"../../style/motion/zoom.mjs";import"../../theme/internal.mjs";import s from"./explain.mjs";import p from"../../theme/util/genComponentStyleHook.mjs";import{merge as d}from"../../theme/util/statistic.mjs";const g=i=>({legend:{display:"block",width:"100%",marginBottom:i.marginLG,padding:0,color:i.colorTextDescription,fontSize:i.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`},label:{fontSize:i.fontSize},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n  input[type='radio']:focus,\n  input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${i.controlOutlineWidth}px ${i.controlOutline}`},output:{display:"block",paddingTop:15,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight}}),t=(i,o)=>{const{formItemCls:l}=i;return{[l]:{[`${l}-label > label`]:{height:o},[`${l}-control-input`]:{minHeight:o}}}},f=i=>{const{componentCls:o}=i;return{[i.componentCls]:{...a(i),...g(i),[`${o}-text`]:{display:"inline-block",paddingInlineEnd:i.paddingSM},"&-small":{...t(i,i.controlHeightSM)},"&-large":{...t(i,i.controlHeightLG)}}}},h=i=>{const{formItemCls:o,iconCls:l,componentCls:e,rootPrefixCls:n}=i;return{[o]:{...a(i),marginBottom:i.marginLG,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
        &-hidden.${n}-row`]:{display:"none"},"&-has-warning":{[`${o}-split`]:{color:i.colorError}},"&-has-error":{[`${o}-split`]:{color:i.colorWarning}},[`${o}-label`]:{display:"inline-block",flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${i.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:i.controlHeight,color:i.colorTextHeading,fontSize:i.fontSize,[`> ${l}`]:{fontSize:i.fontSize,verticalAlign:"top"},[`&${o}-required:not(${o}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:i.marginXXS,color:i.colorError,fontSize:i.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${e}-hide-required-mark &`]:{display:"none"}},[`${o}-optional`]:{display:"inline-block",marginInlineStart:i.marginXXS,color:i.colorTextDescription,[`${e}-hide-required-mark &`]:{display:"none"}},[`${o}-tooltip`]:{color:i.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:i.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:i.marginXXS/2,marginInlineEnd:i.marginXS},[`&${o}-no-colon::after`]:{content:'" "'}}},[`${o}-control`]:{display:"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${n}-col-'"]):not([class*="' ${n}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:i.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[o]:{"&-explain, &-extra":{clear:"both",color:i.colorTextDescription,fontSize:i.fontSize,lineHeight:i.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:i.controlHeightSM,transition:`color ${i.motionDurationMid} ${i.motionEaseOut}`},"&-explain":{"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning}}},[`&-with-help ${o}-explain`]:{height:"auto",opacity:1},[`${o}-feedback-icon`]:{fontSize:i.fontSize,textAlign:"center",visibility:"visible",animationName:c,animationDuration:i.motionDurationMid,animationTimingFunction:i.motionEaseOutBack,pointerEvents:"none","&-success":{color:i.colorSuccess},"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning},"&-validating":{color:i.colorPrimary}}}}},$=i=>{const{componentCls:o,formItemCls:l,rootPrefixCls:e}=i;return{[`${o}-horizontal`]:{[`${l}-label`]:{flexGrow:0},[`${l}-control`]:{flex:"1 1 0",minWidth:0},[`${l}-label.${e}-col-24 + ${l}-control`]:{minWidth:"unset"}}}},x=i=>{const{componentCls:o,formItemCls:l}=i;return{[`${o}-inline`]:{display:"flex",flexWrap:"wrap",[l]:{flex:"none",flexWrap:"nowrap",marginInlineEnd:i.margin,marginBottom:0,"&-with-help":{marginBottom:i.marginLG},[`> ${l}-label,
        > ${l}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${l}-label`]:{flex:"none"},[`${o}-text`]:{display:"inline-block"},[`${l}-has-feedback`]:{display:"inline-block"}}}}},r=i=>({margin:0,padding:`0 0 ${i.paddingXS}px`,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{display:"none"}}}),u=i=>{const{componentCls:o,formItemCls:l}=i;return{[`${l} ${l}-label`]:r(i),[o]:{[l]:{flexWrap:"wrap",[`${l}-label,
          ${l}-control`]:{flex:"0 0 100%",maxWidth:"100%"}}}}},b=i=>{const{componentCls:o,formItemCls:l,rootPrefixCls:e}=i;return{[`${o}-vertical`]:{[l]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${o}-item-control`]:{width:"100%"}}},[`${o}-vertical ${l}-label,
      .${e}-col-24${l}-label,
      .${e}-col-xl-24${l}-label`]:r(i),[`@media (max-width: ${i.screenXSMax}px)`]:[u(i),{[o]:{[`.${e}-col-xs-24${l}-label`]:r(i)}}],[`@media (max-width: ${i.screenSMMax}px)`]:{[o]:{[`.${e}-col-sm-24${l}-label`]:r(i)}},[`@media (max-width: ${i.screenMDMax}px)`]:{[o]:{[`.${e}-col-md-24${l}-label`]:r(i)}},[`@media (max-width: ${i.screenLGMax}px)`]:{[o]:{[`.${e}-col-lg-24${l}-label`]:r(i)}}}},E=p("Form",(i,{rootPrefixCls:o})=>{const l=d(i,{formItemCls:`${i.componentCls}-item`,rootPrefixCls:o});return[f(l),h(l),s(l),$(l),x(l),b(l),m(l),c]});export{E as default};
