前端打包

This commit is contained in:
liu
2026-07-31 18:51:41 +08:00
parent 50885a98c8
commit f67567bdc9
227 changed files with 912 additions and 804 deletions
+4
View File
@@ -0,0 +1,4 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Bn as t,Dr as n,Ln as r,Ot as i,Pn as a,St as o,Tt as s,Vn as c,Wt as l,Zn as u,Zt as d,at as f,hr as p,p as m,qt as h,wr as g,xn as _,xt as v,yr as y,yt as b,zn as x}from"./jsx-runtime-ADHq9IcL.js";import{a as S,i as C}from"./ColorPresets-wH0crouI.js";import{r as w}from"./button-CcpWP-mq.js";import{n as T,t as E}from"./useBubbleLock-CoAwAGkH.js";var D=e(n()),O=e=>{let{checkboxCls:t,checkboxSize:n,lineWidth:r}=e,i=`${t}-wrapper`,o=`@media (hover: hover) and (pointer: fine)`;return[{[`${t}-group`]:{...d(e),display:`inline-flex`,flexWrap:`wrap`,columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}},[i]:{...d(e),display:`inline-flex`,alignItems:`baseline`,cursor:`pointer`,"&:after":{display:`inline-block`,width:0,overflow:`hidden`,content:`'\\a0'`},[`& + ${i}`]:{marginInlineStart:0}},[t]:{...d(e),position:`relative`,whiteSpace:`nowrap`,lineHeight:1,cursor:`pointer`,alignSelf:`center`,boxSizing:`border-box`,display:`block`,width:n,height:n,direction:`ltr`,backgroundColor:e.colorBgContainer,border:`${a(r)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:`separate`,transition:`all ${e.motionDurationSlow}`,flex:`none`,...w(),"&:after":{boxSizing:`border-box`,position:`absolute`,top:`calc(${n} / 2 - ${r})`,insetInlineStart:`calc(${n} / 4 - ${r})`,display:`table`,width:e.calc(n).div(14).mul(5).equal(),height:e.calc(n).div(14).mul(8).equal(),border:`${a(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:`rotate(45deg) scale(0) translate(-50%,-50%)`,opacity:0,content:`""`,transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`,...w()},[`${t}-input`]:{position:`absolute`,inset:`calc(-1 * (${r}))`,zIndex:1,cursor:`pointer`,opacity:0,margin:0},[`&:has(${t}-input:focus-visible)`]:h(e),"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}}},{[o]:{[`
${i}:not(${i}-disabled),
${t}:not(${t}-disabled)
`]:{[`&:hover ${t}`]:{borderColor:e.colorPrimary}},[`${i}:not(${i}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled)`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`}}}},{[`${t}-checked`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:`rotate(45deg) scale(1) translate(-50%,-50%)`,transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`,...w()},[o]:{[`&:not(${t}-disabled):hover`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`}}}},{[t]:{"&-indeterminate":{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:`50%`,insetInlineStart:`50%`,width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:`translate(-50%, -50%) scale(1)`,opacity:1,content:`""`},[o]:{[`&:not(${t}-disabled):hover`]:{backgroundColor:e.colorBgContainer,borderColor:e.colorPrimary}}}}},{[`${i}-disabled`]:{cursor:`not-allowed`},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:`not-allowed`,pointerEvents:`none`},background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate::after`]:{background:e.colorTextDisabled}}}]};function k(e,t){return O(_(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}var A=l(`Checkbox`,(e,{prefixCls:t})=>[k(t,e)]),j=D.createContext(null),M=D.forwardRef((e,t)=>{let{prefixCls:n,children:r,indeterminate:a=!1,onMouseEnter:s,onMouseLeave:l,skipGroup:u=!1,disabled:d,rootClassName:h,className:_,style:w,classNames:O,styles:k,name:M,value:N,checked:P,defaultChecked:F,onChange:I,...L}=e,{getPrefixCls:R,direction:z,className:B,style:V,classNames:ee,styles:te}=x(`checkbox`),H=D.useContext(j),{isFormItemInput:ne}=D.useContext(m),re=D.useContext(f),U=(H?.disabled||d)??re,[ie,ae]=y(F,P),W=ie,G=g(e=>{ae(e.target.checked),I?.(e),!u&&H?.toggleOption&&H.toggleOption({label:r,value:N})});H&&!u&&(W=H.value.includes(N));let K=D.useRef(null),q=p(t,K);D.useEffect(()=>{if(!(u||!H))return H.registerValue(N),()=>{H.cancelValue(N)}},[N,u]),D.useEffect(()=>{K.current?.input&&(K.current.input.indeterminate=a)},[a]);let J=R(`checkbox`,n),Y=b(J),[X,oe]=A(J,Y),Z={...L},se={...e,indeterminate:a,disabled:U,checked:W},ce=o(V),le=o(w),[Q,$]=v([ee,O],[te,ce,k,le],{props:se}),ue=c(`${J}-wrapper`,{[`${J}-rtl`]:z===`rtl`,[`${J}-wrapper-checked`]:W,[`${J}-wrapper-disabled`]:U,[`${J}-wrapper-in-form-item`]:ne},B,_,Q.root,h,oe,Y,X),de=c(Q.icon,{[`${J}-indeterminate`]:a},S,X),[fe,pe]=E(Z.onClick);return D.createElement(C,{component:`Checkbox`,disabled:U},D.createElement(`label`,{className:ue,style:$.root,onMouseEnter:s,onMouseLeave:l,onClick:fe},D.createElement(T,{...Z,name:!u&&H?H.name:M,checked:W,onClick:pe,onChange:G,prefixCls:J,className:de,style:$.icon,disabled:U,ref:q,value:N}),i(r)&&D.createElement(`span`,{className:c(`${J}-label`,Q.label),style:$.label},r)))}),N=D.forwardRef((e,n)=>{let{defaultValue:i,children:a,options:o=[],prefixCls:l,className:d,rootClassName:f,style:p,onChange:m,role:h=`group`,...g}=e,{getPrefixCls:_,direction:v}=D.useContext(r),[y,x]=D.useState(g.value||i||[]),[S,C]=D.useState([]);D.useEffect(()=>{`value`in g&&x(g.value||[])},[g.value]);let w=D.useMemo(()=>o.map(e=>typeof e==`string`||s(e)?{label:e,value:e}:e),[o]),T=e=>{C(t=>t.filter(t=>t!==e))},E=e=>{C(n=>[].concat(t(n),[e]))},O=e=>{let n=y.indexOf(e.value),r=t(y);n===-1?r.push(e.value):r.splice(n,1),`value`in g||x(r),m?.(r.filter(e=>S.includes(e)).sort((e,t)=>w.findIndex(t=>t.value===e)-w.findIndex(e=>e.value===t)))},k=_(`checkbox`,l),N=`${k}-group`,P=b(k),[F,I]=A(k,P),L=u(g,[`value`,`disabled`]),R=o.length?w.map(e=>D.createElement(M,{prefixCls:k,key:e.value.toString(),disabled:`disabled`in e?e.disabled:g.disabled,value:e.value,checked:y.includes(e.value),onChange:e.onChange,className:c(`${N}-item`,e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):a,z=D.useMemo(()=>({toggleOption:O,value:y,disabled:g.disabled,name:g.name,registerValue:E,cancelValue:T}),[O,y,g.disabled,g.name,E,T]),B=c(N,{[`${N}-rtl`]:v===`rtl`},d,f,I,P,F);return D.createElement(`div`,{className:B,style:p,role:h,...L,ref:n},D.createElement(j.Provider,{value:z},R))}),P=M;P.Group=N,P.__ANT_CHECKBOX=!0;export{k as n,P as t};