unis_crm/frontend1/dist/assets/index-DqftVe8j.js

2 lines
5.5 KiB
JavaScript

import{x as J,ax as Q,z as _,y as Y,bD as K,r as n,ay as F,C as P,cY as M,e5 as Z,aJ as ee,e6 as oe,cU as re,cV as V,bE as te,e7 as le,G as ne}from"./index-CYM97J2V.js";const ae=e=>{const{paddingXXS:t,lineWidth:l,tagPaddingHorizontal:o,componentCls:r,calc:a}=e,c=a(o).sub(l).equal(),m=a(t).sub(l).equal();return{[r]:Object.assign(Object.assign({},Y(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:c,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${_(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${r}-close-icon`]:{marginInlineStart:m,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-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}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:c}}),[`${r}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},E=e=>{const{lineWidth:t,fontSizeIcon:l,calc:o}=e,r=e.fontSizeSM;return Q(e,{tagFontSize:r,tagLineHeight:_(o(e.lineHeightSM).mul(r).equal()),tagIconSize:o(l).sub(o(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},N=e=>({defaultBg:new K(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText}),W=J("Tag",e=>{const t=E(e);return ae(t)},N);var se=function(e,t){var l={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(l[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(l[o[r]]=e[o[r]]);return l};const ce=n.forwardRef((e,t)=>{const{prefixCls:l,style:o,className:r,checked:a,children:c,icon:m,onChange:i,onClick:u}=e,S=se(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:f,tag:d}=n.useContext(F),$=y=>{i==null||i(!a),u==null||u(y)},p=f("tag",l),[g,x,h]=W(p),O=P(p,`${p}-checkable`,{[`${p}-checkable-checked`]:a},d==null?void 0:d.className,r,x,h);return g(n.createElement("span",Object.assign({},S,{ref:t,style:Object.assign(Object.assign({},o),d==null?void 0:d.style),className:O,onClick:$}),m,n.createElement("span",null,c)))}),ie=e=>Z(e,(t,{textColor:l,lightBorderColor:o,lightColor:r,darkColor:a})=>({[`${e.componentCls}${e.componentCls}-${t}`]:{color:l,background:r,borderColor:o,"&-inverse":{color:e.colorTextLightSolid,background:a,borderColor:a},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}})),de=M(["Tag","preset"],e=>{const t=E(e);return ie(t)},N);function ge(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const v=(e,t,l)=>{const o=ge(l);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${l}`],background:e[`color${o}Bg`],borderColor:e[`color${o}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},ue=M(["Tag","status"],e=>{const t=E(e);return[v(t,"success","Success"),v(t,"processing","Info"),v(t,"error","Error"),v(t,"warning","Warning")]},N);var Ce=function(e,t){var l={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(l[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(l[o[r]]=e[o[r]]);return l};const pe=n.forwardRef((e,t)=>{const{prefixCls:l,className:o,rootClassName:r,style:a,children:c,icon:m,color:i,onClose:u,bordered:S=!0,visible:f}=e,d=Ce(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:$,direction:p,tag:g}=n.useContext(F),[x,h]=n.useState(!0),O=ee(d,["closeIcon","closable"]);n.useEffect(()=>{f!==void 0&&h(f)},[f]);const y=oe(i),j=le(i),T=y||j,L=Object.assign(Object.assign({backgroundColor:i&&!T?i:void 0},g==null?void 0:g.style),a),s=$("tag",l),[R,q,k]=W(s),A=P(s,g==null?void 0:g.className,{[`${s}-${i}`]:T,[`${s}-has-color`]:i&&!T,[`${s}-hidden`]:!x,[`${s}-rtl`]:p==="rtl",[`${s}-borderless`]:!S},o,r,q,k),z=b=>{b.stopPropagation(),u==null||u(b),!b.defaultPrevented&&h(!1)},[,D]=re(V(e),V(g),{closable:!1,closeIconRender:b=>{const G=n.createElement("span",{className:`${s}-close-icon`,onClick:z},b);return ne(b,G,C=>({onClick:H=>{var I;(I=C==null?void 0:C.onClick)===null||I===void 0||I.call(C,H),z(H)},className:P(C==null?void 0:C.className,`${s}-close-icon`)}))}}),X=typeof d.onClick=="function"||c&&c.type==="a",w=m||null,U=w?n.createElement(n.Fragment,null,w,c&&n.createElement("span",null,c)):c,B=n.createElement("span",Object.assign({},O,{ref:t,className:A,style:L}),U,D,y&&n.createElement(de,{key:"preset",prefixCls:s}),j&&n.createElement(ue,{key:"status",prefixCls:s}));return R(X?n.createElement(te,{component:"Tag"},B):B)}),be=pe;be.CheckableTag=ce;export{be as T};