Files
school2/public/assets/space-BqavXZJj.js
T
2026-07-31 18:51:41 +08:00

1 line
6.8 KiB
JavaScript

import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,E as n,Jn as r,Ln as i,Ot as a,Pn as o,Tt as s,Ut as c,Vn as l,Wt as u,Y as d,Z as f,Zt as p,tt as m,xn as h,xt as g,zn as _}from"./jsx-runtime-ADHq9IcL.js";import{p as v}from"./tooltip-CRuv8UNz.js";var y=e(t()),b=(0,y.createContext)(void 0),x=e=>{let{componentCls:t}=e;return{[t]:{display:`flex`,flexFlow:`row wrap`,minWidth:0,"&::before, &::after":{display:`flex`},"&-no-wrap":{flexWrap:`nowrap`},"&-start":{justifyContent:`flex-start`},"&-center":{justifyContent:`center`},"&-end":{justifyContent:`flex-end`},"&-space-between":{justifyContent:`space-between`},"&-space-around":{justifyContent:`space-around`},"&-space-evenly":{justifyContent:`space-evenly`},"&-top":{alignItems:`flex-start`},"&-middle":{alignItems:`center`},"&-bottom":{alignItems:`flex-end`}}}},S=e=>{let{componentCls:t}=e;return{[t]:{position:`relative`,maxWidth:`100%`,minHeight:1}}},C=(e,t)=>{let{componentCls:n,gridColumns:r,antCls:i}=e,[a,o]=c(i,`grid`),[,s]=c(i,`col`),l={};for(let e=r;e>=0;e--)e===0?(l[`${n}${t}-${e}`]={display:`none`},l[`${n}-push-${e}`]={insetInlineStart:`auto`},l[`${n}-pull-${e}`]={insetInlineEnd:`auto`},l[`${n}${t}-push-${e}`]={insetInlineStart:`auto`},l[`${n}${t}-pull-${e}`]={insetInlineEnd:`auto`},l[`${n}${t}-offset-${e}`]={marginInlineStart:0},l[`${n}${t}-order-${e}`]={order:0}):(l[`${n}${t}-${e}`]=[{[a(`display`)]:`block`,display:`block`},{display:o(`display`),flex:`0 0 ${e/r*100}%`,maxWidth:`${e/r*100}%`}],l[`${n}${t}-push-${e}`]={insetInlineStart:`${e/r*100}%`},l[`${n}${t}-pull-${e}`]={insetInlineEnd:`${e/r*100}%`},l[`${n}${t}-offset-${e}`]={marginInlineStart:`${e/r*100}%`},l[`${n}${t}-order-${e}`]={order:e});return l[`${n}${t}-flex`]={flex:s(`${t.replace(/-/,``)}-flex`)},l},w=(e,t)=>C(e,t),T=(e,t,n)=>({[`@media (min-width: ${o(t)})`]:{...w(e,n)}}),E=()=>({}),D=()=>({}),O=u(`Grid`,x,E),k=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin,xxxl:e.screenXXXLMin}),A=u(`Grid`,e=>{let t=h(e,{gridColumns:24}),n=k(t);return delete n.xs,[S(t),w(t,``),w(t,`-xs`),Object.keys(n).map(e=>T(t,n[e],`-${e}`)).reduce((e,t)=>({...e,...t}),{})]},D),j=e=>{let{componentCls:t,borderRadius:n,paddingSM:r,colorBorder:i,paddingXS:a,fontSizeLG:o,fontSizeSM:s,borderRadiusLG:l,borderRadiusSM:u,colorBgContainerDisabled:d,lineWidth:f,antCls:m}=e,[h,g]=c(m,`space-addon`);return{[t]:[{...p(e),display:`inline-flex`,alignItems:`center`,gap:0,whiteSpace:`nowrap`,paddingInline:r,margin:0,borderWidth:f,borderStyle:`solid`,borderRadius:n,"&:hover":{zIndex:0},[`&${t}-disabled`]:{color:e.colorTextDisabled},"&-large":{fontSize:o,borderRadius:l},"&-small":{paddingInline:a,borderRadius:u,fontSize:s},"&-compact-last-item":{borderEndStartRadius:0,borderStartStartRadius:0},"&-compact-first-item":{borderEndEndRadius:0,borderStartEndRadius:0},"&-compact-item:not(:first-child):not(:last-child)":{borderRadius:0},"&-compact-item:not(:last-child)":{borderInlineEndWidth:0},"&-compact-item:not(:first-child)":{borderInlineStartWidth:0}},{[h(`addon-border-color`)]:i,[h(`addon-background`)]:d,[h(`addon-border-color-outlined`)]:i,[h(`addon-background-filled`)]:d,borderColor:g(`addon-border-color`),background:g(`addon-background`),"&-variant-outlined":{[h(`addon-border-color`)]:g(`addon-border-color-outlined`)},"&-variant-filled":{[h(`addon-border-color`)]:`transparent`,[h(`addon-background`)]:g(`addon-background-filled`),[`&${t}-disabled`]:{[h(`addon-border-color`)]:i,[h(`addon-background`)]:d}},"&-variant-borderless":{border:`none`,background:`transparent`},"&-variant-underlined":{border:`none`,background:`transparent`}},{"&-status-error":{[h(`addon-border-color-outlined`)]:e.colorError,[h(`addon-background-filled`)]:e.colorErrorBg,color:e.colorError},"&-status-warning":{[h(`addon-border-color-outlined`)]:e.colorWarning,[h(`addon-background-filled`)]:e.colorWarningBg,color:e.colorWarning}}]}},M=u(`Addon`,e=>[j(e),n(e,{focus:!1})]),N=y.forwardRef((e,t)=>{let{className:n,children:r,style:a,prefixCls:o,variant:s=`outlined`,disabled:c,status:u,...d}=e,{getPrefixCls:p,direction:m}=y.useContext(i),h=p(`space-addon`,o),[g,_]=M(h),{compactItemClassnames:b,compactSize:x}=f(h,m),S=v(h,u),C=l(h,g,b,_,`${h}-variant-${s}`,S,{[`${h}-${x}`]:x,[`${h}-disabled`]:c},n);return y.createElement(`div`,{ref:t,className:C,style:a,...d},r)});function P(e){return[`small`,`middle`,`medium`,`large`].includes(e)}function F(e){return e?s(e):!1}var I=y.createContext({latestIndex:0}),L=I.Provider,R=e=>{let{className:t,prefix:n,index:r,children:i,separator:o,style:s,classNames:c,styles:u}=e,{latestIndex:d}=y.useContext(I);return a(i)?y.createElement(y.Fragment,null,y.createElement(`div`,{className:t,style:s},i),r<d&&o&&y.createElement(`span`,{className:l(`${n}-item-separator`,c?.separator),style:u?.separator},o)):null},z=e=>{let{componentCls:t,antCls:n}=e;return{[t]:{display:`inline-flex`,"&-rtl":{direction:`rtl`},"&-vertical":{flexDirection:`column`},"&-align":{flexDirection:`column`,"&-center":{alignItems:`center`},"&-start":{alignItems:`flex-start`},"&-end":{alignItems:`flex-end`},"&-baseline":{alignItems:`baseline`}},[`${t}-item:empty`]:{display:`none`},[`${t}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:`block`}}}},B=e=>{let{componentCls:t}=e;return{[t]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-medium, &-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-medium, &-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}},V=u(`Space`,e=>{let t=h(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[z(t),B(t)]},()=>({}),{resetStyle:!1}),H=y.forwardRef((e,t)=>{let{getPrefixCls:n,direction:i,size:o,className:s,style:c,classNames:u,styles:d}=_(`space`),{size:f=o??`small`,align:p,className:h,rootClassName:v,children:b,direction:x,orientation:S,prefixCls:C,split:w,separator:T,style:E,vertical:D,wrap:O=!1,classNames:k,styles:A,...j}=e,[M,N]=Array.isArray(f)?f:[f,f],I=P(N),z=P(M),B=F(N),H=F(M),U=r(b,{keepEmpty:!0}),[W,G]=m(S,D,x),K=p===void 0&&!G?`center`:p,q=T??w,J=n(`space`,C),[Y,ee]=V(J),te={...e,size:f,orientation:W,align:K},[X,Z]=g([u,k],[d,A],{props:te}),ne=l(J,s,Y,`${J}-${W}`,{[`${J}-rtl`]:i===`rtl`,[`${J}-align-${K}`]:K,[`${J}-gap-row-${N}`]:I,[`${J}-gap-col-${M}`]:z},h,v,ee,X.root),Q=l(`${J}-item`,X.item),re=U.map((e,t)=>{let n=e?.key||`${Q}-${t}`;return y.createElement(R,{prefix:J,classNames:X,styles:Z,className:Q,key:n,index:t,separator:q,style:Z.item},e)}),ie=y.useMemo(()=>({latestIndex:U.reduce((e,t,n)=>a(t)?n:e,0)}),[U]);if(U.length===0)return null;let $={};return O&&($.flexWrap=`wrap`),!z&&H&&($.columnGap=M),!I&&B&&($.rowGap=N),y.createElement(`div`,{ref:t,className:ne,style:{...$,...Z.root,...c,...E},...j},y.createElement(L,{value:ie},re))});H.Compact=d,H.Addon=N;export{A as a,k as i,P as n,O as o,N as r,b as s,H as t};