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

2 lines
7.7 KiB
JavaScript

import{z as xe,G as $e,a3 as le,H as Se,co as ye,cp as ve,aE as _,r as s,bg as re,bK as se,L as D,R as q,J as ae,K as te,aA as Te,M as Ne,aL as Pe,ba as De,bj as Be,cq as Ie,cr as ce,bh as Ee,bx as we,cs as ze,ct as oe,P as He,b7 as Me,cu as Re}from"./index-B-sDl1ER.js";const Ae=e=>{const{paddingXXS:r,lineWidth:l,tagPaddingHorizontal:a,componentCls:o,calc:c}=e,t=c(a).sub(l).equal(),i=c(r).sub(l).equal();return{[o]:{...Se(e),display:"inline-block",height:"auto",paddingInline:t,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",backgroundColor:e.defaultBg,border:`${le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:i,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${o}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive},"&-disabled":{cursor:"not-allowed",[`&:not(${o}-checkable-checked)`]:{color:e.colorTextDisabled,"&:hover":{backgroundColor:"transparent"}},[`&${o}-checkable-checked`]:{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled},"&:hover, &:active":{backgroundColor:e.colorBgContainerDisabled,color:e.colorTextDisabled},[`&:not(${o}-checkable-checked):hover`]:{color:e.colorTextDisabled}},"&-group":{display:"flex",flexWrap:"wrap",gap:e.paddingXS}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:t}},[`&${e.componentCls}-solid`]:{borderColor:"transparent",color:e.colorTextLightSolid,backgroundColor:e.colorBgSolid,[`&${o}-default`]:{color:e.solidTextColor}},[`${o}-filled`]:{borderColor:"transparent",backgroundColor:e.tagBorderlessBg},[`&${o}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",backgroundColor:e.colorBgContainerDisabled,a:{cursor:"not-allowed",pointerEvents:"none",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}},"a&":{"&:hover, &:active":{color:e.colorTextDisabled}},[`&${o}-outlined`]:{borderColor:e.colorBorderDisabled},[`&${o}-solid, &${o}-filled`]:{color:e.colorTextDisabled,[`${o}-close-icon`]:{color:e.colorTextDisabled}},[`${o}-close-icon`]:{cursor:"not-allowed",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}}}}},J=e=>{const{lineWidth:r,fontSizeIcon:l,calc:a}=e,o=e.fontSizeSM;return $e(e,{tagFontSize:o,tagLineHeight:le(a(e.lineHeightSM).mul(o).equal()),tagIconSize:a(l).sub(a(r).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},O=e=>{const r=ye(new ve(e.colorBgSolid),"#fff")?"#000":"#fff";return{defaultBg:new _(e.colorFillTertiary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText,solidTextColor:r}},U=xe("Tag",e=>{const r=J(e);return Ae(r)},O),ne=s.forwardRef((e,r)=>{const{prefixCls:l,style:a,className:o,checked:c,children:t,icon:i,onChange:h,onClick:b,disabled:d,...x}=e,{getPrefixCls:B,tag:p}=s.useContext(re),$=s.useContext(se),S=d??$,I=H=>{S||(h?.(!c),b?.(H))},g=B("tag",l),[E,w]=U(g),z=D(g,`${g}-checkable`,{[`${g}-checkable-checked`]:c,[`${g}-checkable-disabled`]:S},p?.className,o,E,w);return s.createElement("span",{...x,ref:r,style:{...a,...p?.style},className:z,onClick:I},i,s.createElement("span",null,t))}),Ve=q.forwardRef((e,r)=>{const{id:l,prefixCls:a,rootClassName:o,className:c,style:t,classNames:i,styles:h,disabled:b,options:d,value:x,defaultValue:B,onChange:p,multiple:$,...S}=e,{getPrefixCls:I,direction:g,className:E,style:w,classNames:z,styles:H}=ae("tag"),y=I("tag",a),v=`${y}-checkable-group`,X=Pe(y),[V,W]=U(y,X),[M,R]=te([z,i],[H,h],{props:e}),L=s.useMemo(()=>Array.isArray(d)?d.map(n=>n&&typeof n=="object"?n:{value:n,label:n}):[],[d]),[A,j]=Te(B,x),C=(n,f)=>{let T=null;if($){const N=A||[];T=n?[].concat(De(N),[f.value]):N.filter(P=>P!==f.value)}else T=n?f.value:null;j(T),p?.(T)},F=q.useRef(null);s.useImperativeHandle(r,()=>({nativeElement:F.current}));const K=Ne(S,{aria:!0,data:!0});return q.createElement("div",{...K,className:D(v,E,o,{[`${v}-disabled`]:b,[`${v}-rtl`]:g==="rtl"},V,W,c,M.root),style:{...w,...R.root,...t},id:l,ref:F},L.map(n=>q.createElement(ne,{key:n.value,className:D(`${v}-item`,M.item),style:R.item,checked:$?(A||[]).includes(n.value):A===n.value,onChange:f=>C(f,n),disabled:b},n.label)))});function We(e,r){const{color:l,variant:a,bordered:o}=e;return s.useMemo(()=>{const c=l?.endsWith("-inverse");let t;a?t=a:c?t="solid":o===!1?t="filled":t=r||"filled";const i=c?l?.replace("-inverse",""):l,h=Be(l),b=Ie(l),d={};if(!h&&!b&&i)if(t==="solid")d.backgroundColor=l;else{const x=new _(i).toHsl();x.l=.95,d.backgroundColor=new _(x).toHexString(),d.color=l,t==="outlined"&&(d.borderColor=l)}return[t,i,h,b,d]},[l,a,o,r])}const Le=e=>Ee(e,(r,{textColor:l,lightBorderColor:a,lightColor:o,darkColor:c})=>({[`${e.componentCls}${e.componentCls}-${r}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:o,borderColor:a,color:l},[`&${e.componentCls}-solid`]:{backgroundColor:c,borderColor:c,color:e.colorTextLightSolid},[`&${e.componentCls}-filled`]:{backgroundColor:o,color:l}}})),Fe=ce(["Tag","preset"],e=>{const r=J(e);return Le(r)},O);function qe(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const G=(e,r,l)=>{const a=qe(l);return{[`${e.componentCls}${e.componentCls}-${r}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:e[`color${a}Bg`],borderColor:e[`color${a}Border`],color:e[`color${l}`]},[`&${e.componentCls}-solid`]:{backgroundColor:e[`color${l}`],borderColor:e[`color${l}`]},[`&${e.componentCls}-filled`]:{backgroundColor:e[`color${a}Bg`],color:e[`color${l}`]}}}},Ge=ce(["Tag","status"],e=>{const r=J(e);return[G(r,"success","Success"),G(r,"processing","Info"),G(r,"error","Error"),G(r,"warning","Warning")]},O),Xe=s.forwardRef((e,r)=>{const{prefixCls:l,className:a,rootClassName:o,style:c,children:t,icon:i,color:h,variant:b,onClose:d,bordered:x,disabled:B,href:p,target:$,styles:S,classNames:I,...g}=e,{getPrefixCls:E,direction:w,className:z,variant:H,style:y,classNames:v,styles:X}=ae("tag"),[V,W,M,R,L]=We(e,H),A=M||R,j=s.useContext(se),C=B??j,{tag:F}=s.useContext(re),[K,n]=s.useState(!0),f=we(g,["closeIcon","closable"]),T={...e,color:W,variant:V,disabled:C},[N,P]=te([v,I],[X,S],{props:T}),de=s.useMemo(()=>{let m={...P.root,...y,...c};return C||(m={...L,...m}),m},[P.root,y,c,L,C]),u=E("tag",l),[ue,ge]=U(u),Ce=D(u,z,N.root,`${u}-${V}`,{[`${u}-${W}`]:A,[`${u}-hidden`]:!K,[`${u}-rtl`]:w==="rtl",[`${u}-disabled`]:C},a,o,ue,ge),Q=m=>{C||(m.stopPropagation(),d?.(m),!m.defaultPrevented&&n(!1))},[,me]=ze(oe(e),oe(F),{closable:!1,closeIconRender:m=>{const he=s.createElement("span",{className:`${u}-close-icon`,onClick:Q},m);return Re(m,he,k=>({onClick:ee=>{k?.onClick?.(ee),Q(ee)},className:D(k?.className,`${u}-close-icon`)}))}}),be=typeof g.onClick=="function"||t&&t.type==="a",Y=He(i,{className:D(s.isValidElement(i)?i.props?.className:void 0,N.icon),style:P.icon}),pe=Y?s.createElement(s.Fragment,null,Y,t&&s.createElement("span",{className:N.content,style:P.content},t)):t,fe=p?"a":"span",Z=s.createElement(fe,{...f,ref:r,className:Ce,style:de,href:C?void 0:p,target:$,onClick:C?void 0:f.onClick,...p&&C?{"aria-disabled":!0}:{}},pe,me,M&&s.createElement(Fe,{key:"preset",prefixCls:u}),R&&s.createElement(Ge,{key:"status",prefixCls:u}));return be?s.createElement(Me,{component:"Tag"},Z):Z}),ie=Xe;ie.CheckableTag=ne;ie.CheckableTagGroup=Ve;export{ie as T};