Files
xin-school/public/assets/index-S1dQ7QE3.js
T
2026-05-30 17:38:49 +08:00

2 lines
9.3 KiB
JavaScript

import{R as $,r as n,bg as O,L as E,P as he,C as ue,aZ as Se,z as xe,G as Ce,a3 as r,H as ye,J as be,b0 as Ee,cg as ve,ba as _,cv as j,a$ as ze,a as Pe,cm as Ne}from"./index-B-sDl1ER.js";import{P as Be,S as Le}from"./index-DmtjhyJb.js";const J=$.createContext({});J.Consumer;const Ie=({prefixCls:t,className:e,avatar:i,title:c,description:o,...d})=>{const{getPrefixCls:f}=n.useContext(O),m=f("list",t),x=E(`${m}-item-meta`,e),p=$.createElement("div",{className:`${m}-item-meta-content`},c&&$.createElement("h4",{className:`${m}-item-meta-title`},c),o&&$.createElement("div",{className:`${m}-item-meta-description`},o));return $.createElement("div",{...d,className:x},i&&$.createElement("div",{className:`${m}-item-meta-avatar`},i),(c||o)&&p)},Me=$.forwardRef((t,e)=>{const{prefixCls:i,children:c,actions:o,extra:d,styles:f,className:m,classNames:x,colStyle:p,...B}=t,{grid:v,itemLayout:s}=n.useContext(J),{getPrefixCls:z,list:C}=n.useContext(O),y=g=>E(C?.item?.classNames?.[g],x?.[g]),P=g=>({...C?.item?.styles?.[g],...f?.[g]}),H=()=>{const g=Se(c);return g.some(A=>typeof A=="string")&&g.length>1},N=()=>s==="vertical"?!!d:!H(),h=z("list",i),M=o&&o.length>0&&$.createElement("ul",{className:E(`${h}-item-action`,y("actions")),key:"actions",style:P("actions")},o.map((g,I)=>$.createElement("li",{key:`${h}-item-action-${I}`},g,I!==o.length-1&&$.createElement("em",{className:`${h}-item-action-split`})))),w=v?"div":"li",L=$.createElement(w,{...B,...v?{}:{ref:e},className:E(`${h}-item`,{[`${h}-item-no-flex`]:!N()},m)},s==="vertical"&&d?[$.createElement("div",{className:`${h}-item-main`,key:"content"},c,M),$.createElement("div",{className:E(`${h}-item-extra`,y("extra")),key:"extra",style:P("extra")},d)]:[c,M,he(d,{key:"extra"})]);return v?$.createElement(ue,{ref:e,flex:1,style:p},L):L}),Q=Me;Q.Meta=Ie;const He=t=>{const{listBorderedCls:e,componentCls:i,paddingLG:c,margin:o,itemPaddingSM:d,itemPaddingLG:f,marginLG:m,borderRadiusLG:x}=t,p=r(t.calc(x).sub(t.lineWidth).equal());return{[e]:{border:`${r(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:x,[`${i}-header`]:{borderRadius:`${p} ${p} 0 0`},[`${i}-footer`]:{borderRadius:`0 0 ${p} ${p}`},[`${i}-header,${i}-footer,${i}-item`]:{paddingInline:c},[`${i}-pagination`]:{margin:`${r(o)} ${r(m)}`}},[`${e}${i}-sm`]:{[`${i}-item,${i}-header,${i}-footer`]:{padding:d}},[`${e}${i}-lg`]:{[`${i}-item,${i}-header,${i}-footer`]:{padding:f}}}},we=t=>{const{componentCls:e,screenSM:i,screenMD:c,marginLG:o,marginSM:d,margin:f}=t;return{[`@media screen and (max-width:${c}px)`]:{[e]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:o}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:o}}}},[`@media screen and (max-width: ${i}px)`]:{[e]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:d}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:t.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${r(f)}`}}}}}},Te=t=>{const{componentCls:e,antCls:i,controlHeight:c,minHeight:o,paddingSM:d,marginLG:f,padding:m,itemPadding:x,colorPrimary:p,itemPaddingSM:B,itemPaddingLG:v,paddingXS:s,margin:z,colorText:C,colorTextDescription:y,motionDurationSlow:P,lineWidth:H,headerBg:N,footerBg:h,emptyTextPadding:M,metaMarginBottom:w,avatarMarginRight:L,titleMarginBottom:g,descriptionFontSize:I}=t;return{[e]:{...ye(t),position:"relative","--rc-virtual-list-scrollbar-bg":t.colorSplit,"*":{outline:"none"},[`${e}-header`]:{background:N},[`${e}-footer`]:{background:h},[`${e}-header, ${e}-footer`]:{paddingBlock:d},[`${e}-pagination`]:{marginBlockStart:f,[`${i}-pagination-options`]:{textAlign:"start"}},[`${e}-spin`]:{minHeight:o,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:x,color:C,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:L},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:C},[`${e}-item-meta-title`]:{margin:`0 0 ${r(t.marginXXS)} 0`,color:C,fontSize:t.fontSize,lineHeight:t.lineHeight,"> a":{color:C,transition:`all ${P}`,"&:hover":{color:p}}},[`${e}-item-meta-description`]:{color:y,fontSize:I,lineHeight:t.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:t.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${r(s)}`,color:y,fontSize:t.fontSize,lineHeight:t.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:H,height:t.calc(t.fontHeight).sub(t.calc(t.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:t.colorSplit}}},[`${e}-empty`]:{padding:`${r(m)} 0`,color:y,fontSize:t.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:M,color:t.colorTextDisabled,fontSize:t.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}},[`${e}-grid ${i}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:z,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:f},[`${e}-item-meta`]:{marginBlockEnd:w,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:g,color:C,fontSize:t.fontSizeLG,lineHeight:t.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:m,marginInlineStart:"auto","> li":{padding:`0 ${r(m)}`,"&:first-child":{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${r(t.lineWidth)} ${t.lineType} ${t.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${r(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${r(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:c},[`${e}-split${e}-something-after-last-item ${i}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${r(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:v},[`${e}-sm ${e}-item`]:{padding:B},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},Re=t=>({contentWidth:220,itemPadding:`${r(t.paddingContentVertical)} 0`,itemPaddingSM:`${r(t.paddingContentVerticalSM)} ${r(t.paddingContentHorizontal)}`,itemPaddingLG:`${r(t.paddingContentVerticalLG)} ${r(t.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:t.padding,metaMarginBottom:t.padding,avatarMarginRight:t.padding,titleMarginBottom:t.paddingSM,descriptionFontSize:t.fontSize}),We=xe("List",t=>{const e=Ce(t,{listBorderedCls:`${t.componentCls}-bordered`,minHeight:t.controlHeightLG});return[Te(e),He(e),we(e)]},Re,{extraCssVarPrefixCls:({prefixCls:t})=>[`${t}-container`]}),Ge=(t,e)=>{const{pagination:i=!1,prefixCls:c,bordered:o=!1,split:d=!0,className:f,rootClassName:m,style:x,children:p,itemLayout:B,loadMore:v,grid:s,dataSource:z=[],size:C,header:y,footer:P,loading:H=!1,rowKey:N,renderItem:h,locale:M,...w}=t,L=i&&typeof i=="object"?i:{},[g,I]=n.useState(L.defaultCurrent||1),[A,U]=n.useState(L.defaultPageSize||10),{getPrefixCls:k,direction:ee,className:te,style:ie}=be("list"),{renderEmpty:ne}=n.useContext(O),ae={current:1,total:0,position:"bottom"},q=a=>(S,b)=>{I(S),U(b),i&&i?.[a]?.(S,b)},re=q("onChange"),oe=q("onShowSizeChange"),se=(a,S)=>{if(!h)return null;let b;return typeof N=="function"?b=N(a):N?b=a[N]:b=a.key,b||(b=`list-item-${S}`),n.createElement(n.Fragment,{key:b},h(a,S))},le=!!(v||i||P),l=k("list",c),[ce,X]=We(l);let T=H;typeof T=="boolean"&&(T={spinning:T});const D=!!T?.spinning,me=Ee(C);let R="";switch(me){case"large":R="lg";break;case"small":R="sm";break}const de=E(l,{[`${l}-vertical`]:B==="vertical",[`${l}-${R}`]:R,[`${l}-split`]:d,[`${l}-bordered`]:o,[`${l}-loading`]:D,[`${l}-grid`]:!!s,[`${l}-something-after-last-item`]:le,[`${l}-rtl`]:ee==="rtl"},te,f,m,ce,X),K=`${l}-container`,u=ve(ae,{total:z.length,current:g,pageSize:A},i||{}),ge=Math.ceil(u.total/u.pageSize);u.current=Math.min(u.current,ge);const Y=i&&n.createElement("div",{className:E(`${l}-pagination`)},n.createElement(Be,{align:"end",...u,onChange:re,onShowSizeChange:oe}));let V=_(z);i&&z.length>(u.current-1)*u.pageSize&&(V=_(z).splice((u.current-1)*u.pageSize,u.pageSize));const $e=Object.keys(s||{}).some(a=>j.includes(a)),Z=ze($e),W=n.useMemo(()=>{for(let a=0;a<j.length;a+=1){const S=j[a];if(Z[S])return S}},[Z]),pe=n.useMemo(()=>{if(!s)return;const a=W&&s[W]?s[W]:s.column;if(a)return{width:`${100/a}%`,maxWidth:`${100/a}%`}},[JSON.stringify(s),W]);let F=D&&n.createElement("div",{style:{minHeight:53}});if(V.length>0){const a=V.map(se);F=s?n.createElement(Pe,{className:E(K,X),gutter:s.gutter},n.Children.map(a,S=>n.createElement("div",{key:S?.key,style:pe},S))):n.createElement("ul",{className:E(`${l}-items`,K,X)},a)}else!p&&!D&&(F=n.createElement("div",{className:`${l}-empty-text`},M?.emptyText||ne?.("List")||n.createElement(Ne,{componentName:"List"})));const G=u.position,fe=n.useMemo(()=>({grid:s,itemLayout:B}),[JSON.stringify(s),B]);return n.createElement(J.Provider,{value:fe},n.createElement("div",{ref:e,style:{...ie,...x},className:de,...w},(G==="top"||G==="both")&&Y,y&&n.createElement("div",{className:`${l}-header`},y),n.createElement(Le,{...T},F,p),P&&n.createElement("div",{className:`${l}-footer`},P),v||(G==="bottom"||G==="both")&&Y))},Ae=n.forwardRef(Ge),Xe=Ae;Xe.Item=Q;export{Xe as L};