ll-package
Version:
5 lines (4 loc) • 3.57 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../../../../@babel/runtime/helpers/esm/extends.js");require("../../theme/internal.js");const p=require("../../style/index.js"),c=require("../../theme/util/statistic.js"),n=2;function g(i){let{controlHeightSM:t,controlHeight:e,lineWidth:r}=i;const o=(e-t)/2-r,l=Math.ceil(o/2);return[o,l]}function a(i,t){const{componentCls:e,iconCls:r}=i,o=`${e}-selection-overflow`,l=i.controlHeightSM,[s]=g(i),u=t?`${e}-${t}`:"";return{[`${e}-multiple${u}`]:{fontSize:i.fontSize,[o]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${e}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${s-n}px ${n*2}px`,borderRadius:i.borderRadius,[`${e}-show-search&`]:{cursor:"text"},[`${e}-disabled&`]:{background:i.colorBgContainerDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${n}px 0`,lineHeight:`${l}px`,content:'"\\a0"'}},[`
&${e}-show-arrow ${e}-selector,
&${e}-allow-clear ${e}-selector
`]:{paddingInlineEnd:i.fontSizeIcon+i.controlPaddingHorizontal},[`${e}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:l,marginTop:n,marginBottom:n,lineHeight:`${l-i.lineWidth*2}px`,background:i.colorFillSecondary,border:`${i.lineWidth}px solid ${i.colorSplit}`,borderRadius:i.borderRadiusSM,cursor:"default",transition:`font-size ${i.motionDurationSlow}, line-height ${i.motionDurationSlow}, height ${i.motionDurationSlow}`,userSelect:"none",marginInlineEnd:n*2,paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS/2,[`${e}-disabled&`]:{color:i.colorTextDisabled,borderColor:i.colorBorder,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:i.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":d.default(d.default({},p.resetIcon()),{display:"inline-block",color:i.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${r}`]:{verticalAlign:"-0.2em"},"&:hover":{color:i.colorIconHover}})},[`${o}-item + ${o}-item`]:{[`${e}-selection-search`]:{marginInlineStart:0}},[`${e}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:i.inputPaddingHorizontalBase-s,"\n &-input,\n &-mirror\n ":{height:l,fontFamily:i.fontFamily,lineHeight:`${l}px`,transition:`all ${i.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${e}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:i.inputPaddingHorizontalBase,insetInlineEnd:i.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${i.motionDurationSlow}`}}}}function h(i){const{componentCls:t}=i,e=c.merge(i,{controlHeight:i.controlHeightSM,controlHeightSM:i.controlHeightXS,borderRadius:i.borderRadiusSM,borderRadiusSM:i.borderRadiusXS}),[,r]=g(i);return[a(i),a(e,"sm"),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInlineStart:i.controlPaddingHorizontalSM-i.lineWidth,insetInlineEnd:"auto"},[`${t}-selection-search`]:{marginInlineStart:r}}},a(c.merge(i,{fontSize:i.fontSizeLG,controlHeight:i.controlHeightLG,controlHeightSM:i.controlHeight,borderRadius:i.borderRadiusLG,borderRadiusSM:i.borderRadius}),"lg")]}exports.default=h;
;