ll-package
Version:
2 lines (1 loc) • 6.81 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../../../@babel/runtime/helpers/esm/extends.js");require("../../theme/internal.js");const B=require("./group.js"),H=require("../../style/index.js"),x=require("../../style/compact-item.js"),E=require("../../style/compact-item-vertical.js"),T=require("../../theme/util/genComponentStyleHook.js"),g=require("../../theme/util/statistic.js"),P=o=>{const{componentCls:l,iconCls:e}=o;return{[l]:{outline:"none",position:"relative",display:"inline-block",fontWeight:400,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",backgroundColor:"transparent",border:`${o.lineWidth}px ${o.lineType} transparent`,cursor:"pointer",transition:`all ${o.motionDurationMid} ${o.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",lineHeight:o.lineHeight,color:o.colorText,"> span":{display:"inline-block"},[`> ${e} + span, > span + ${e}`]:{marginInlineStart:o.marginXS},"> a":{color:"currentColor"},"&:not(:disabled)":r.default({},H.genFocusStyle(o)),[`&-icon-only${l}-compact-item`]:{flex:"none"},[`&-compact-item${l}-primary`]:{[`&:not([disabled]) + ${l}-compact-item${l}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-o.lineWidth,insetInlineStart:-o.lineWidth,display:"inline-block",width:o.lineWidth,height:`calc(100% + ${o.lineWidth*2}px)`,backgroundColor:o.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${l}-primary`]:{[`&:not([disabled]) + ${l}-compact-vertical-item${l}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-o.lineWidth,insetInlineStart:-o.lineWidth,display:"inline-block",width:`calc(100% + ${o.lineWidth*2}px)`,height:o.lineWidth,backgroundColor:o.colorPrimaryHover,content:'""'}}}}}}},i=(o,l)=>({"&:not(:disabled)":{"&:hover":o,"&:active":l}}),w=o=>({minWidth:o.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),I=o=>({borderRadius:o.controlHeight,paddingInlineStart:o.controlHeight/2,paddingInlineEnd:o.controlHeight/2}),s=o=>({cursor:"not-allowed",borderColor:o.colorBorder,color:o.colorTextDisabled,backgroundColor:o.colorBgContainerDisabled,boxShadow:"none"}),a=(o,l,e,t,c,n,u)=>({[`&${o}-background-ghost`]:r.default(r.default({color:l||void 0,backgroundColor:"transparent",borderColor:e||void 0,boxShadow:"none"},i(r.default({backgroundColor:"transparent"},n),r.default({backgroundColor:"transparent"},u))),{"&:disabled":{cursor:"not-allowed",color:t||void 0,borderColor:c||void 0}})}),b=o=>({"&:disabled":r.default({},s(o))}),S=o=>r.default({},b(o)),d=o=>({"&:disabled":{cursor:"not-allowed",color:o.colorTextDisabled}}),y=o=>r.default(r.default(r.default(r.default(r.default({},S(o)),{backgroundColor:o.colorBgContainer,borderColor:o.colorBorder,boxShadow:`0 ${o.controlOutlineWidth}px 0 ${o.controlTmpOutline}`}),i({color:o.colorPrimaryHover,borderColor:o.colorPrimaryHover},{color:o.colorPrimaryActive,borderColor:o.colorPrimaryActive})),a(o.componentCls,o.colorBgContainer,o.colorBgContainer,o.colorTextDisabled,o.colorBorder)),{[`&${o.componentCls}-dangerous`]:r.default(r.default(r.default({color:o.colorError,borderColor:o.colorError},i({color:o.colorErrorHover,borderColor:o.colorErrorBorderHover},{color:o.colorErrorActive,borderColor:o.colorErrorActive})),a(o.componentCls,o.colorError,o.colorError,o.colorTextDisabled,o.colorBorder)),b(o))}),D=o=>r.default(r.default(r.default(r.default(r.default({},S(o)),{color:o.colorTextLightSolid,backgroundColor:o.colorPrimary,boxShadow:`0 ${o.controlOutlineWidth}px 0 ${o.controlOutline}`}),i({color:o.colorTextLightSolid,backgroundColor:o.colorPrimaryHover},{color:o.colorTextLightSolid,backgroundColor:o.colorPrimaryActive})),a(o.componentCls,o.colorPrimary,o.colorPrimary,o.colorTextDisabled,o.colorBorder,{color:o.colorPrimaryHover,borderColor:o.colorPrimaryHover},{color:o.colorPrimaryActive,borderColor:o.colorPrimaryActive})),{[`&${o.componentCls}-dangerous`]:r.default(r.default(r.default({backgroundColor:o.colorError,boxShadow:`0 ${o.controlOutlineWidth}px 0 ${o.colorErrorOutline}`},i({backgroundColor:o.colorErrorHover},{backgroundColor:o.colorErrorActive})),a(o.componentCls,o.colorError,o.colorError,o.colorTextDisabled,o.colorBorder,{color:o.colorErrorHover,borderColor:o.colorErrorHover},{color:o.colorErrorActive,borderColor:o.colorErrorActive})),b(o))}),A=o=>r.default(r.default({},y(o)),{borderStyle:"dashed"}),W=o=>r.default(r.default(r.default({color:o.colorLink},i({color:o.colorLinkHover},{color:o.colorLinkActive})),d(o)),{[`&${o.componentCls}-dangerous`]:r.default(r.default({color:o.colorError},i({color:o.colorErrorHover},{color:o.colorErrorActive})),d(o))}),z=o=>r.default(r.default(r.default({},i({color:o.colorText,backgroundColor:o.colorBgTextHover},{color:o.colorText,backgroundColor:o.colorBgTextActive})),d(o)),{[`&${o.componentCls}-dangerous`]:r.default(r.default({color:o.colorError},d(o)),i({color:o.colorErrorHover,backgroundColor:o.colorErrorBg},{color:o.colorErrorHover,backgroundColor:o.colorErrorBg}))}),O=o=>r.default(r.default({},s(o)),{[`&${o.componentCls}:hover`]:r.default({},s(o))}),L=o=>{const{componentCls:l}=o;return{[`${l}-default`]:y(o),[`${l}-primary`]:D(o),[`${l}-dashed`]:A(o),[`${l}-link`]:W(o),[`${l}-text`]:z(o),[`${l}-disabled`]:O(o)}},p=function(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:e,iconCls:t,controlHeight:c,fontSize:n,lineHeight:u,lineWidth:m,borderRadius:C,buttonPaddingHorizontal:h}=o,$=Math.max(0,(c-n*u)/2-m),v=h-m,f=`${e}-icon-only`;return[{[`${e}${l}`]:{fontSize:n,height:c,padding:`${$}px ${v}px`,borderRadius:C,[`&${f}`]:{width:c,paddingInlineStart:0,paddingInlineEnd:0,[`&${e}-round`]:{width:"auto"},"> span":{transform:"scale(1.143)"}},[`&${e}-loading`]:{opacity:o.opacityLoading,cursor:"default"},[`${e}-loading-icon`]:{transition:`width ${o.motionDurationSlow} ${o.motionEaseInOut}, opacity ${o.motionDurationSlow} ${o.motionEaseInOut}`},[`&:not(${f}) ${e}-loading-icon > ${t}`]:{marginInlineEnd:o.marginXS}}},{[`${e}${e}-circle${l}`]:w(o)},{[`${e}${e}-round${l}`]:I(o)}]},q=o=>p(o),R=o=>{const l=g.merge(o,{controlHeight:o.controlHeightSM,padding:o.paddingXS,buttonPaddingHorizontal:8,borderRadius:o.borderRadiusSM});return p(l,`${o.componentCls}-sm`)},M=o=>{const l=g.merge(o,{controlHeight:o.controlHeightLG,fontSize:o.fontSizeLG,borderRadius:o.borderRadiusLG});return p(l,`${o.componentCls}-lg`)},G=o=>{const{componentCls:l}=o;return{[l]:{[`&${l}-block`]:{width:"100%"}}}},V=T.default("Button",o=>{const{controlTmpOutline:l,paddingContentHorizontal:e}=o,t=g.merge(o,{colorOutlineDefault:l,buttonPaddingHorizontal:e});return[P(t),R(t),q(t),M(t),G(t),L(t),B.default(t),x.genCompactItemStyle(o,{focus:!1}),E.genCompactItemVerticalStyle(o)]});exports.default=V;
;