chainlesschain 0.162.69 → 0.162.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/assets/web-panel/assets/{AIOps-mRHaZd6j.js → AIOps-CnHIXe2L.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-DKwlStrh.js → ActionButton-CzDyhTAp.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-JKNBk90h.js → Analytics-rwvDMCd-.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-D_00au6T.js → AppLayout-D-Q1M-5V.js} +5 -5
- package/src/assets/web-panel/assets/{Audit-COIvlSub.js → Audit-BIFSGnAE.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-DM0caJ_V.js → Backup-CbUdiVeS.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-BCcZwFqj.js → BaseInput-D3P_pICH.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-Mzs83VXS.js → Chat-DRrX7vVB.js} +6 -6
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-B3WgjkqK.js → ChatBubbleRenderer-DTC1ElV-.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-BSK8NcWS.js → Checkbox-Dpq9X8Xd.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-CEZLn0zj.js → Codegen-yQQOSuHA.js} +1 -1
- package/src/assets/web-panel/assets/{Col-C3wDVrB5.js → Col-DLFLDxar.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DgGS3UTp.js → Community-DYbdX-GB.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BYw2zw-v.js → Compact-Dclrp1HE.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-DkkuY155.js → Compliance-C9EQMgoP.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-CExycS2P.js → Cowork-B9IMFsMk.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-CIERLVft.js → Cron-V6TlbDey.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-CsHN5kXa.js → Crosschain-Cl_vG8R_.js} +1 -1
- package/src/assets/web-panel/assets/{DID-BVSo2C6D.js → DID-DoUUF9cz.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-DmC4cW02.js → Dashboard-DcA8WmrS.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-B73mSg7P.js → Dropdown-wyGMYzw9.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-B6m4si5I.js → EmailListRenderer-B1T3ziIH.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-DLcJUP1r.js → FamilyGuardDashboard-CW4CwYbZ.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-gzFvFfqM.js → Federation-9tEiw0KA.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-CR4BrjCr.js → FormItemContext-DbocfnNQ.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-D-vZ_Mus.js → GenericCardRenderer-CGNsG2qI.js} +1 -1
- package/src/assets/web-panel/assets/{Git-Cy2qd9re.js → Git-BxA3dgT8.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-CCxHR2cK.js → Governance-DqnhaC7n.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-CPGRthgg.js → Inference-D6Ll4t9c.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-rNtsv5PI.js → KnowledgeGraph-Bb8IXGl7.js} +1 -1
- package/src/assets/web-panel/assets/Logs-DRUUVMdc.js +2 -0
- package/src/assets/web-panel/assets/{Marketplace-fv9Y2P9i.js → Marketplace-BYRM186w.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BXdt1OfF.js → McpTools-DLbh7uS8.js} +5 -5
- package/src/assets/web-panel/assets/{Memory-uVwjHReb.js → Memory-D2_uZEOI.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-DUekknEV.js → MobileBridge-CXVJoMKk.js} +2 -2
- package/src/assets/web-panel/assets/MobileProjects-QRZYgIME.js +1 -0
- package/src/assets/web-panel/assets/{Mtc-DU7qxB15.js → Mtc-D3mv30gW.js} +6 -6
- package/src/assets/web-panel/assets/{MtcAudit-D82jFkm-.js → MtcAudit-__QPus22.js} +6 -6
- package/src/assets/web-panel/assets/{Multisig-CbXPwmLK.js → Multisig-Bu5gaTn6.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-xinU-pAd.js → NLProgramming-SjaViyfR.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-CF695fi9.js → Notes-feXsl0dN.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-DqE8Uw97.js → NotificationSettings-BtVFokbM.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-CJJ2GWDf.js +1 -0
- package/src/assets/web-panel/assets/{Organization-BdSbVJSd.js → Organization-CewL60Rd.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-Cwd_BqS5.js → Overflow-2ZRChJ7E.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-Cu9QkrOR.js → P2P-DuMr6G9y.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-B-qgBBLE.js → PdhVaultBrowser-BMOcHCWd.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-BM4iUYhq.js → Permissions-Cj94ql75.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-BFFOGNIt.js → PersonalDataHub-BYK4mlk7.js} +3 -3
- package/src/assets/web-panel/assets/{Pipeline-CfgXjou1.js → Pipeline-maRvdrbO.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-B5BKvDsX.js → Privacy-CKb2zZJz.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-YdvJ_Keh.js → ProjectInit-C2pfXv4l.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-2WrdaB3v.js → ProjectSettings-DGeNwq0h.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-DIziui4g.js → Projects-BRypTQUV.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-B6_KBUE6.js → Providers-DYwMPXEO.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-CrNUnzCS.js → QuickAsk-DE6isYZV.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-C776RdRO.js → Recommend-Rc-AE6y9.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-RMht4VQm.js → Reputation-DDQ8_kmM.js} +1 -1
- package/src/assets/web-panel/assets/{Row-D0WYOsJu.js → Row-Do5iQUFj.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BVPn-wVM.js → RssFeed-cxG0ulSw.js} +2 -2
- package/src/assets/web-panel/assets/{Search-5G03gU05.js → Search-D3-8EdNk.js} +1 -1
- package/src/assets/web-panel/assets/{Security-B7_HAVGp.js → Security-DtBfws1D.js} +4 -4
- package/src/assets/web-panel/assets/{Services-DG-gNQSw.js → Services-DzeN8HsG.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-DXUXpGp2.js → Skeleton-BQCVeTUf.js} +1 -1
- package/src/assets/web-panel/assets/Skills-D6mCVKt7.js +1 -0
- package/src/assets/web-panel/assets/{Sla-DZdS2c4B.js → Sla-d2IOd-AA.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-DEWyi82O.js → SpeechSettings-BjfopwT6.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-COwILO7T.js → SyncSettings-D5_c1_rI.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-D-O2-bZx.js → Tasks-BCmxDMZx.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-CouCONlo.js → Templates-CCXFgNy3.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-DJF8zjXy.js → Tenant-Duz6eEK3.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-BTXj0cal.js → Terminal-Buc6UbYo.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-Hd1UCvLm.js → TimelineRenderer-Du5jKHJz.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-DvR4eNpx.js → Tokens-B12vLtQm.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-CYslzJDF.js → Trigger-s_pHOerx.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-Bje6U7_E.js → Trust-4sDhbAls.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-Cz-GZJDg.js → UkeySign-UeyFknip.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-Bb1UWWOc.js → VideoEditing-DsopM2S5.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-B2ZGejOh.js → Wallet-CreLjC5U.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-CKJmoHdr.js → WebAuthn-CBuMMZbK.js} +4 -4
- package/src/assets/web-panel/assets/{WorkflowEditor-Whk2YLrb.js → WorkflowEditor-DWhHHSFW.js} +1 -1
- package/src/assets/web-panel/assets/{chat-RoIuy9Y2.js → chat-Iurq_BMY.js} +1 -1
- package/src/assets/web-panel/assets/{colors-BhEd_bKZ.js → colors-BIOTIa89.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-CidH0uK1.js → compact-item-B7lPu9pO.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-C_rRS-Ds.js → createContext-Bzzk7mrh.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-CuIq7zBB.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-CmeIRIpe.js → hasIn-B11xqp5O.js} +1 -1
- package/src/assets/web-panel/assets/{index-BzUwFZ_8.js → index-3LgeP4ij.js} +1 -1
- package/src/assets/web-panel/assets/{index-D-_Hp7sk.js → index-5BkUKVyj.js} +1 -1
- package/src/assets/web-panel/assets/{index-DT1y-Y3f.js → index-6QGNBg3m.js} +3 -3
- package/src/assets/web-panel/assets/{index-B6m1mhdz.js → index-AmHa_sOB.js} +1 -1
- package/src/assets/web-panel/assets/{index-Luxberfg.js → index-B4rXFIOG.js} +1 -1
- package/src/assets/web-panel/assets/{index-CrfbYvUn.js → index-B93pM-xx.js} +1 -1
- package/src/assets/web-panel/assets/{index-C5PRk4sg.js → index-BIFscFlm.js} +1 -1
- package/src/assets/web-panel/assets/{index-GjeCpE-O.js → index-BLREN4NE.js} +1 -1
- package/src/assets/web-panel/assets/index-BRsns-SP.js +1 -0
- package/src/assets/web-panel/assets/{index-CZHr43Om.js → index-BVIXYV1R.js} +1 -1
- package/src/assets/web-panel/assets/{index-B1mwMvn4.js → index-BgmBZgU9.js} +1 -1
- package/src/assets/web-panel/assets/{index-C6k3kLEx.js → index-BlR8YVlt.js} +1 -1
- package/src/assets/web-panel/assets/{index-CWd-l-yG.js → index-C-lwsB2F.js} +1 -1
- package/src/assets/web-panel/assets/{index-IGkFXvXp.js → index-C4wV32Dn.js} +1 -1
- package/src/assets/web-panel/assets/{index-ys4rkmSl.js → index-CA-GPOd9.js} +1 -1
- package/src/assets/web-panel/assets/{index-DoZHyQzC.js → index-CCxGEK8b.js} +1 -1
- package/src/assets/web-panel/assets/{index-CONjSq4V.js → index-CEKRqrI-.js} +1 -1
- package/src/assets/web-panel/assets/{index-DBkcH93B.js → index-CLhpFnSR.js} +1 -1
- package/src/assets/web-panel/assets/{index-CEQ-hwZR.js → index-CS2UWrIt.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cb96fe_j.js → index-CULCwI_H.js} +1 -1
- package/src/assets/web-panel/assets/{index-CqGJIS-s.js → index-CiXNVmcx.js} +1 -1
- package/src/assets/web-panel/assets/{index-DPvldj2b.js → index-CxDOX4g6.js} +1 -1
- package/src/assets/web-panel/assets/{index-CX3pUViM.js → index-CzY2mdiR.js} +1 -1
- package/src/assets/web-panel/assets/{index-Np_V608u.js → index-D25-u3Q2.js} +1 -1
- package/src/assets/web-panel/assets/{index-j5F0sAV-.js → index-D6q-fkXs.js} +1 -1
- package/src/assets/web-panel/assets/{index-CNIuqDnx.js → index-D8tm9JnQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-Ds3Cg0Ae.js → index-DEKeoJ6I.js} +1 -1
- package/src/assets/web-panel/assets/{index-qksnYfTn.js → index-DMrzHgE6.js} +1 -1
- package/src/assets/web-panel/assets/{index-CcXsvVqO.js → index-DX7HGwP_.js} +1 -1
- package/src/assets/web-panel/assets/{index-Ruva8uPi.js → index-Dn_Ht3v2.js} +1 -1
- package/src/assets/web-panel/assets/{index-_dSvONj9.js → index-DsoyfOzW.js} +1 -1
- package/src/assets/web-panel/assets/{index-dMw41BZp.js → index-DwGVPCZb.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bx_Je5Dv.js → index-DyV9331f.js} +1 -1
- package/src/assets/web-panel/assets/index-QTuoOvJA.js +1 -0
- package/src/assets/web-panel/assets/{index-CoGpLFSs.js → index-R-YSpvg4.js} +1 -1
- package/src/assets/web-panel/assets/{index-CNr2Jahq.js → index-Y4gmywZo.js} +1 -1
- package/src/assets/web-panel/assets/{index-DLQQetVM.js → index-htxy7qDG.js} +1 -1
- package/src/assets/web-panel/assets/{index-DjMeZpai.js → index-tub9w6us.js} +1 -1
- package/src/assets/web-panel/assets/{index-r7fl2fJ5.js → index-vZCGFSJN.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-DkSV8vgw.js → initDefaultProps-Bl6klCzd.js} +1 -1
- package/src/assets/web-panel/assets/{motion-Cp8NKUFr.js → motion-B9IxS1-S.js} +1 -1
- package/src/assets/web-panel/assets/{move-CLyMNWcC.js → move-NJ5XDNQe.js} +1 -1
- package/src/assets/web-panel/assets/{omit-8eo0vufF.js → omit-ByO8GI_H.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-DezDJBf9.js → pickAttrs-W6iTcLuH.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-MzOUG99n.js → placementArrow-JMndCFEP.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-BIM3OijT.js → responsiveObserve-DHV7-FuY.js} +1 -1
- package/src/assets/web-panel/assets/{slide-BboGfin4.js → slide-DioRUeNF.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-B2H0FDx9.js → statusUtils-DMp2b9Ze.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-BEkY7TC8.js → styleChecker-DamP5BTS.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-BsmYDsvA.js → useFlexGapSupport-D338iARz.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-CO3oipa2.js → useFs-DE_HJgk6.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-C-yb9KXG.js → usePersonalDataHub-914YxO9q.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-2w5Ks8oo.js → vnode-CY39Ky7P.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-BbwfKB6m.js → zoom-BEghlCth.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/commands/agent.js +4 -0
- package/src/lib/agent-core.js +1 -0
- package/src/runtime/headless-stream.js +14 -2
- package/src/assets/web-panel/assets/Logs-D2uSdTps.js +0 -2
- package/src/assets/web-panel/assets/MobileProjects-Dl8xYWOU.js +0 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-C6OcpNmv.js +0 -1
- package/src/assets/web-panel/assets/Skills-D19MUfuA.js +0 -1
- package/src/assets/web-panel/assets/devWarning-CahsJx-O.js +0 -1
- package/src/assets/web-panel/assets/index-BpAHKzLk.js +0 -1
- package/src/assets/web-panel/assets/index-D-uS5svS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as q,m as J,h as N,r as Q,a8 as P,t as tt,f as I,U as et,w as nt,p as ot,q as st,I as it}from"./index-DT1y-Y3f.js";import{d as L,b as F,e as D,w as rt,c as C,F as O,s as y,r as lt}from"./vendor-BvqAck49.js";import at from"./index-DjMeZpai.js";import{B as ut}from"./index-B1mwMvn4.js";import{R as ct}from"./icons-DP3uiYxy.js";import"./initDefaultProps-DkSV8vgw.js";import"./index-CcXsvVqO.js";import"./isVisible-C7tPsqfj.js";import"./useState-BK4hy8Ma.js";import"./raf-Deuc0E8-.js";import"./devWarning-CahsJx-O.js";import"./compact-item-CidH0uK1.js";import"./createContext-C_rRS-Ds.js";import"./Compact-BYw2zw-v.js";import"./_getTag-DnrRH4E6.js";const ht=r=>{const{componentCls:s}=r;return{[s]:N(N({},Q(r)),{display:"flex",justifyContent:"center",alignItems:"center",padding:r.paddingSM,backgroundColor:r.colorWhite,borderRadius:r.borderRadiusLG,border:`${r.lineWidth}px ${r.lineType} ${r.colorSplit}`,position:"relative",width:"100%",height:"100%",overflow:"hidden",[`& > ${s}-mask`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:10,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",color:r.colorText,lineHeight:r.lineHeight,background:r.QRCodeMaskBackgroundColor,textAlign:"center",[`& > ${s}-expired , & > ${s}-scanned`]:{color:r.QRCodeTextColor}},"&-icon":{marginBlockEnd:r.marginXS,fontSize:r.controlHeight}}),[`${s}-borderless`]:{borderColor:"transparent"}}},dt=q("QRCode",r=>ht(J(r,{QRCodeTextColor:"rgba(0, 0, 0, 0.88)",QRCodeMaskBackgroundColor:"rgba(255, 255, 255, 0.96)"}))),z=()=>({size:{type:Number,default:160},value:{type:String,required:!0},type:P("canvas"),color:String,bgColor:String,includeMargin:Boolean,imageSettings:tt()}),ft=()=>N(N({},z()),{errorLevel:P("M"),icon:String,iconSize:{type:Number,default:40},status:P("active"),bordered:{type:Boolean,default:!0}});var R;(function(r){class s{static encodeText(t,n){const e=r.QrSegment.makeSegments(t);return s.encodeSegments(e,n)}static encodeBinary(t,n){const e=r.QrSegment.makeBytes(t);return s.encodeSegments([e],n)}static encodeSegments(t,n){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:40,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1,c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(!(s.MIN_VERSION<=e&&e<=o&&o<=s.MAX_VERSION)||i<-1||i>7)throw new RangeError("Invalid value");let a,g;for(a=e;;a++){const m=s.getNumDataCodewords(a,n)*8,w=l.getTotalBits(t,a);if(w<=m){g=w;break}if(a>=o)throw new RangeError("Data too long")}for(const m of[s.Ecc.MEDIUM,s.Ecc.QUARTILE,s.Ecc.HIGH])c&&g<=s.getNumDataCodewords(a,m)*8&&(n=m);const d=[];for(const m of t){u(m.mode.modeBits,4,d),u(m.numChars,m.mode.numCharCountBits(a),d);for(const w of m.getData())d.push(w)}h(d.length==g);const p=s.getNumDataCodewords(a,n)*8;h(d.length<=p),u(0,Math.min(4,p-d.length),d),u(0,(8-d.length%8)%8,d),h(d.length%8==0);for(let m=236;d.length<p;m^=253)u(m,8,d);const M=[];for(;M.length*8<d.length;)M.push(0);return d.forEach((m,w)=>M[w>>>3]|=m<<7-(w&7)),new s(a,n,M,i)}constructor(t,n,e,o){if(this.version=t,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],t<s.MIN_VERSION||t>s.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=t*4+17;const i=[];for(let a=0;a<this.size;a++)i.push(!1);for(let a=0;a<this.size;a++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();const c=this.addEccAndInterleave(e);if(this.drawCodewords(c),o==-1){let a=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);const d=this.getPenaltyScore();d<a&&(o=g,a=d),this.applyMask(g)}}h(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}getModule(t,n){return 0<=t&&t<this.size&&0<=n&&n<this.size&&this.modules[n][t]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const t=this.getAlignmentPatternPositions(),n=t.length;for(let e=0;e<n;e++)for(let o=0;o<n;o++)e==0&&o==0||e==0&&o==n-1||e==n-1&&o==0||this.drawAlignmentPattern(t[e],t[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){const n=this.errorCorrectionLevel.formatBits<<3|t;let e=n;for(let i=0;i<10;i++)e=e<<1^(e>>>9)*1335;const o=(n<<10|e)^21522;h(o>>>15==0);for(let i=0;i<=5;i++)this.setFunctionModule(8,i,f(o,i));this.setFunctionModule(8,7,f(o,6)),this.setFunctionModule(8,8,f(o,7)),this.setFunctionModule(7,8,f(o,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,f(o,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,f(o,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,f(o,i));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let e=0;e<12;e++)t=t<<1^(t>>>11)*7973;const n=this.version<<12|t;h(n>>>18==0);for(let e=0;e<18;e++){const o=f(n,e),i=this.size-11+e%3,c=Math.floor(e/3);this.setFunctionModule(i,c,o),this.setFunctionModule(c,i,o)}}drawFinderPattern(t,n){for(let e=-4;e<=4;e++)for(let o=-4;o<=4;o++){const i=Math.max(Math.abs(o),Math.abs(e)),c=t+o,a=n+e;0<=c&&c<this.size&&0<=a&&a<this.size&&this.setFunctionModule(c,a,i!=2&&i!=4)}}drawAlignmentPattern(t,n){for(let e=-2;e<=2;e++)for(let o=-2;o<=2;o++)this.setFunctionModule(t+o,n+e,Math.max(Math.abs(o),Math.abs(e))!=1)}setFunctionModule(t,n,e){this.modules[n][t]=e,this.isFunction[n][t]=!0}addEccAndInterleave(t){const n=this.version,e=this.errorCorrectionLevel;if(t.length!=s.getNumDataCodewords(n,e))throw new RangeError("Invalid argument");const o=s.NUM_ERROR_CORRECTION_BLOCKS[e.ordinal][n],i=s.ECC_CODEWORDS_PER_BLOCK[e.ordinal][n],c=Math.floor(s.getNumRawDataModules(n)/8),a=o-c%o,g=Math.floor(c/o),d=[],p=s.reedSolomonComputeDivisor(i);for(let m=0,w=0;m<o;m++){const v=t.slice(w,w+g-i+(m<a?0:1));w+=v.length;const A=s.reedSolomonComputeRemainder(v,p);m<a&&v.push(0),d.push(v.concat(A))}const M=[];for(let m=0;m<d[0].length;m++)d.forEach((w,v)=>{(m!=g-i||v>=a)&&M.push(w[m])});return h(M.length==c),M}drawCodewords(t){if(t.length!=Math.floor(s.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let e=this.size-1;e>=1;e-=2){e==6&&(e=5);for(let o=0;o<this.size;o++)for(let i=0;i<2;i++){const c=e-i,g=(e+1&2)==0?this.size-1-o:o;!this.isFunction[g][c]&&n<t.length*8&&(this.modules[g][c]=f(t[n>>>3],7-(n&7)),n++)}}h(n==t.length*8)}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let e=0;e<this.size;e++){let o;switch(t){case 0:o=(e+n)%2==0;break;case 1:o=n%2==0;break;case 2:o=e%3==0;break;case 3:o=(e+n)%3==0;break;case 4:o=(Math.floor(e/3)+Math.floor(n/2))%2==0;break;case 5:o=e*n%2+e*n%3==0;break;case 6:o=(e*n%2+e*n%3)%2==0;break;case 7:o=((e+n)%2+e*n%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[n][e]&&o&&(this.modules[n][e]=!this.modules[n][e])}}getPenaltyScore(){let t=0;for(let i=0;i<this.size;i++){let c=!1,a=0;const g=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[i][d]==c?(a++,a==5?t+=s.PENALTY_N1:a>5&&t++):(this.finderPenaltyAddHistory(a,g),c||(t+=this.finderPenaltyCountPatterns(g)*s.PENALTY_N3),c=this.modules[i][d],a=1);t+=this.finderPenaltyTerminateAndCount(c,a,g)*s.PENALTY_N3}for(let i=0;i<this.size;i++){let c=!1,a=0;const g=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[d][i]==c?(a++,a==5?t+=s.PENALTY_N1:a>5&&t++):(this.finderPenaltyAddHistory(a,g),c||(t+=this.finderPenaltyCountPatterns(g)*s.PENALTY_N3),c=this.modules[d][i],a=1);t+=this.finderPenaltyTerminateAndCount(c,a,g)*s.PENALTY_N3}for(let i=0;i<this.size-1;i++)for(let c=0;c<this.size-1;c++){const a=this.modules[i][c];a==this.modules[i][c+1]&&a==this.modules[i+1][c]&&a==this.modules[i+1][c+1]&&(t+=s.PENALTY_N2)}let n=0;for(const i of this.modules)n=i.reduce((c,a)=>c+(a?1:0),n);const e=this.size*this.size,o=Math.ceil(Math.abs(n*20-e*10)/e)-1;return h(0<=o&&o<=9),t+=o*s.PENALTY_N4,h(0<=t&&t<=2568888),t}getAlignmentPatternPositions(){if(this.version==1)return[];{const t=Math.floor(this.version/7)+2,n=this.version==32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,e=[6];for(let o=this.size-7;e.length<t;o-=n)e.splice(1,0,o);return e}}static getNumRawDataModules(t){if(t<s.MIN_VERSION||t>s.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*t+128)*t+64;if(t>=2){const e=Math.floor(t/7)+2;n-=(25*e-10)*e-55,t>=7&&(n-=36)}return h(208<=n&&n<=29648),n}static getNumDataCodewords(t,n){return Math.floor(s.getNumRawDataModules(t)/8)-s.ECC_CODEWORDS_PER_BLOCK[n.ordinal][t]*s.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][t]}static reedSolomonComputeDivisor(t){if(t<1||t>255)throw new RangeError("Degree out of range");const n=[];for(let o=0;o<t-1;o++)n.push(0);n.push(1);let e=1;for(let o=0;o<t;o++){for(let i=0;i<n.length;i++)n[i]=s.reedSolomonMultiply(n[i],e),i+1<n.length&&(n[i]^=n[i+1]);e=s.reedSolomonMultiply(e,2)}return n}static reedSolomonComputeRemainder(t,n){const e=n.map(o=>0);for(const o of t){const i=o^e.shift();e.push(0),n.forEach((c,a)=>e[a]^=s.reedSolomonMultiply(c,i))}return e}static reedSolomonMultiply(t,n){if(t>>>8||n>>>8)throw new RangeError("Byte out of range");let e=0;for(let o=7;o>=0;o--)e=e<<1^(e>>>7)*285,e^=(n>>>o&1)*t;return h(e>>>8==0),e}finderPenaltyCountPatterns(t){const n=t[1];h(n<=this.size*3);const e=n>0&&t[2]==n&&t[3]==n*3&&t[4]==n&&t[5]==n;return(e&&t[0]>=n*4&&t[6]>=n?1:0)+(e&&t[6]>=n*4&&t[0]>=n?1:0)}finderPenaltyTerminateAndCount(t,n,e){return t&&(this.finderPenaltyAddHistory(n,e),n=0),n+=this.size,this.finderPenaltyAddHistory(n,e),this.finderPenaltyCountPatterns(e)}finderPenaltyAddHistory(t,n){n[0]==0&&(t+=this.size),n.pop(),n.unshift(t)}}s.MIN_VERSION=1,s.MAX_VERSION=40,s.PENALTY_N1=3,s.PENALTY_N2=3,s.PENALTY_N3=40,s.PENALTY_N4=10,s.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],s.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],r.QrCode=s;function u(E,t,n){if(t<0||t>31||E>>>t)throw new RangeError("Value out of range");for(let e=t-1;e>=0;e--)n.push(E>>>e&1)}function f(E,t){return(E>>>t&1)!=0}function h(E){if(!E)throw new Error("Assertion error")}class l{static makeBytes(t){const n=[];for(const e of t)u(e,8,n);return new l(l.Mode.BYTE,t.length,n)}static makeNumeric(t){if(!l.isNumeric(t))throw new RangeError("String contains non-numeric characters");const n=[];for(let e=0;e<t.length;){const o=Math.min(t.length-e,3);u(parseInt(t.substring(e,e+o),10),o*3+1,n),e+=o}return new l(l.Mode.NUMERIC,t.length,n)}static makeAlphanumeric(t){if(!l.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");const n=[];let e;for(e=0;e+2<=t.length;e+=2){let o=l.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e))*45;o+=l.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e+1)),u(o,11,n)}return e<t.length&&u(l.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e)),6,n),new l(l.Mode.ALPHANUMERIC,t.length,n)}static makeSegments(t){return t==""?[]:l.isNumeric(t)?[l.makeNumeric(t)]:l.isAlphanumeric(t)?[l.makeAlphanumeric(t)]:[l.makeBytes(l.toUtf8ByteArray(t))]}static makeEci(t){const n=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)u(t,8,n);else if(t<16384)u(2,2,n),u(t,14,n);else if(t<1e6)u(6,3,n),u(t,21,n);else throw new RangeError("ECI assignment value out of range");return new l(l.Mode.ECI,0,n)}static isNumeric(t){return l.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return l.ALPHANUMERIC_REGEX.test(t)}constructor(t,n,e){if(this.mode=t,this.numChars=n,this.bitData=e,n<0)throw new RangeError("Invalid argument");this.bitData=e.slice()}getData(){return this.bitData.slice()}static getTotalBits(t,n){let e=0;for(const o of t){const i=o.mode.numCharCountBits(n);if(o.numChars>=1<<i)return 1/0;e+=4+i+o.bitData.length}return e}static toUtf8ByteArray(t){t=encodeURI(t);const n=[];for(let e=0;e<t.length;e++)t.charAt(e)!="%"?n.push(t.charCodeAt(e)):(n.push(parseInt(t.substring(e+1,e+3),16)),e+=2);return n}}l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.QrSegment=l})(R||(R={}));(function(r){(function(s){class u{constructor(h,l){this.ordinal=h,this.formatBits=l}}u.LOW=new u(0,1),u.MEDIUM=new u(1,0),u.QUARTILE=new u(2,3),u.HIGH=new u(3,2),s.Ecc=u})(r.QrCode||(r.QrCode={}))})(R||(R={}));(function(r){(function(s){class u{constructor(h,l){this.modeBits=h,this.numBitsCharCount=l}numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}}u.NUMERIC=new u(1,[10,12,14]),u.ALPHANUMERIC=new u(2,[9,11,13]),u.BYTE=new u(4,[8,16,16]),u.KANJI=new u(8,[8,10,12]),u.ECI=new u(7,[0,0,0]),s.Mode=u})(r.QrSegment||(r.QrSegment={}))})(R||(R={}));const U={L:R.QrCode.Ecc.LOW,M:R.QrCode.Ecc.MEDIUM,Q:R.QrCode.Ecc.QUARTILE,H:R.QrCode.Ecc.HIGH},S=128,$="L",k="#FFFFFF",H="#000000",G=!1,gt=4,mt=0,Et=.1;function Y(r){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const u=[];return r.forEach(function(f,h){let l=null;f.forEach(function(E,t){if(!E&&l!==null){u.push(`M${l+s} ${h+s}h${t-l}v1H${l+s}z`),l=null;return}if(t===f.length-1){if(!E)return;l===null?u.push(`M${t+s},${h+s} h1v1H${t+s}z`):u.push(`M${l+s},${h+s} h${t+1-l}v1H${l+s}z`);return}E&&l===null&&(l=t)})}),u.join("")}function V(r,s){return r.slice().map((u,f)=>f<s.y||f>=s.y+s.h?u:u.map((h,l)=>l<s.x||l>=s.x+s.w?h:!1))}function X(r,s,u,f){if(f==null)return null;const h=r.length+u*2,l=Math.floor(s*Et),E=h/s,t=(f.width||l)*E,n=(f.height||l)*E,e=f.x==null?r.length/2-t/2:f.x*E,o=f.y==null?r.length/2-n/2:f.y*E;let i=null;if(f.excavate){const c=Math.floor(e),a=Math.floor(o),g=Math.ceil(t+e-c),d=Math.ceil(n+o-a);i={x:c,y:a,w:g,h:d}}return{x:e,y:o,h:n,w:t,excavation:i}}function _(r,s){return s!=null?Math.floor(s):r?gt:mt}const wt=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Mt=L({name:"QRCodeCanvas",inheritAttrs:!1,props:N(N({},z()),{level:String,bgColor:String,fgColor:String,marginSize:Number}),setup(r,s){let{attrs:u,expose:f}=s;const h=F(()=>{var n;return(n=r.imageSettings)===null||n===void 0?void 0:n.src}),l=y(null),E=y(null),t=y(!1);return f({toDataURL:(n,e)=>{var o;return(o=l.value)===null||o===void 0?void 0:o.toDataURL(n,e)}}),D(()=>{const{value:n,size:e=S,level:o=$,bgColor:i=k,fgColor:c=H,includeMargin:a=G,marginSize:g,imageSettings:d}=r;if(l.value!=null){const p=l.value,M=p.getContext("2d");if(!M)return;let m=R.QrCode.encodeText(n,U[o]).getModules();const w=_(a,g),v=m.length+w*2,A=X(m,e,w,d),b=E.value,x=t.value&&A!=null&&b!==null&&b.complete&&b.naturalHeight!==0&&b.naturalWidth!==0;x&&A.excavation!=null&&(m=V(m,A.excavation));const B=window.devicePixelRatio||1;p.height=p.width=e*B;const T=e/v*B;M.scale(T,T),M.fillStyle=i,M.fillRect(0,0,v,v),M.fillStyle=c,wt?M.fill(new Path2D(Y(m,w))):m.forEach(function(W,j){W.forEach(function(K,Z){K&&M.fillRect(Z+w,j+w,1,1)})}),x&&M.drawImage(b,A.x+w,A.y+w,A.w,A.h)}},{flush:"post"}),rt(h,()=>{t.value=!1}),()=>{var n;const e=(n=r.size)!==null&&n!==void 0?n:S,o={height:`${e}px`,width:`${e}px`};let i=null;return h.value!=null&&(i=C("img",{src:h.value,key:h.value,style:{display:"none"},onLoad:()=>{t.value=!0},ref:E},null)),C(O,null,[C("canvas",I(I({},u),{},{style:[o,u.style],ref:l}),null),i])}}}),Ct=L({name:"QRCodeSVG",inheritAttrs:!1,props:N(N({},z()),{color:String,level:String,bgColor:String,fgColor:String,marginSize:Number,title:String}),setup(r){let s=null,u=null,f=null,h=null,l=null,E=null;return D(()=>{const{value:t,size:n=S,level:e=$,includeMargin:o=G,marginSize:i,imageSettings:c}=r;s=R.QrCode.encodeText(t,U[e]).getModules(),u=_(o,i),f=s.length+u*2,h=X(s,n,u,c),c!=null&&h!=null&&(h.excavation!=null&&(s=V(s,h.excavation)),E=C("image",{"xlink:href":c.src,height:h.h,width:h.w,x:h.x+u,y:h.y+u,preserveAspectRatio:"none"},null)),l=Y(s,u)}),()=>{const t=r.bgColor&&k,n=r.fgColor&&H;return C("svg",{height:r.size,width:r.size,viewBox:`0 0 ${f} ${f}`},[!!r.title&&C("title",null,[r.title]),C("path",{fill:t,d:`M0,0 h${f}v${f}H0z`,"shape-rendering":"crispEdges"},null),C("path",{fill:n,d:l,"shape-rendering":"crispEdges"},null),E])}}}),Rt=L({name:"AQrcode",inheritAttrs:!1,props:ft(),emits:["refresh"],setup(r,s){let{emit:u,attrs:f,expose:h}=s;nt(!(r.icon&&r.errorLevel==="L"),"QRCode","ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.");const[l]=ot("QRCode"),{prefixCls:E}=st("qrcode",r),[t,n]=dt(E),[,e]=it(),o=lt();h({toDataURL:(c,a)=>{var g;return(g=o.value)===null||g===void 0?void 0:g.toDataURL(c,a)}});const i=F(()=>{const{value:c,icon:a="",size:g=160,iconSize:d=40,color:p=e.value.colorText,bgColor:M="transparent",errorLevel:m="M"}=r,w={src:a,x:void 0,y:void 0,height:d,width:d,excavate:!0};return{value:c,size:g-(e.value.paddingSM+e.value.lineWidth)*2,level:m,bgColor:M,fgColor:p,imageSettings:a?w:void 0}});return()=>{const c=E.value;return t(C("div",I(I({},f),{},{style:[f.style,{width:`${r.size}px`,height:`${r.size}px`,backgroundColor:i.value.bgColor}],class:[n.value,c,{[`${c}-borderless`]:!r.bordered}]}),[r.status!=="active"&&C("div",{class:`${c}-mask`},[r.status==="loading"&&C(at,null,null),r.status==="expired"&&C(O,null,[C("p",{class:`${c}-expired`},[l.value.expired]),C(ut,{type:"link",onClick:a=>u("refresh",a)},{default:()=>[l.value.refresh],icon:()=>C(ct,null,null)})]),r.status==="scanned"&&C("p",{class:`${c}-scanned`},[l.value.scanned])]),r.type==="canvas"?C(Mt,I({ref:o},i.value),null):C(Ct,i.value,null)]))}}}),Dt=et(Rt);export{Dt as default};
|
|
1
|
+
import{l as q,m as J,h as N,r as Q,a8 as P,t as tt,f as I,U as et,w as nt,p as ot,q as st,I as it}from"./index-6QGNBg3m.js";import{d as L,b as F,e as D,w as rt,c as C,F as O,s as y,r as lt}from"./vendor-BvqAck49.js";import at from"./index-tub9w6us.js";import{B as ut}from"./index-BgmBZgU9.js";import{R as ct}from"./icons-DP3uiYxy.js";import"./initDefaultProps-Bl6klCzd.js";import"./index-DX7HGwP_.js";import"./isVisible-C7tPsqfj.js";import"./useState-BK4hy8Ma.js";import"./raf-Deuc0E8-.js";import"./devWarning-CuIq7zBB.js";import"./compact-item-B7lPu9pO.js";import"./createContext-Bzzk7mrh.js";import"./Compact-Dclrp1HE.js";import"./_getTag-DnrRH4E6.js";const ht=r=>{const{componentCls:s}=r;return{[s]:N(N({},Q(r)),{display:"flex",justifyContent:"center",alignItems:"center",padding:r.paddingSM,backgroundColor:r.colorWhite,borderRadius:r.borderRadiusLG,border:`${r.lineWidth}px ${r.lineType} ${r.colorSplit}`,position:"relative",width:"100%",height:"100%",overflow:"hidden",[`& > ${s}-mask`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:10,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",color:r.colorText,lineHeight:r.lineHeight,background:r.QRCodeMaskBackgroundColor,textAlign:"center",[`& > ${s}-expired , & > ${s}-scanned`]:{color:r.QRCodeTextColor}},"&-icon":{marginBlockEnd:r.marginXS,fontSize:r.controlHeight}}),[`${s}-borderless`]:{borderColor:"transparent"}}},dt=q("QRCode",r=>ht(J(r,{QRCodeTextColor:"rgba(0, 0, 0, 0.88)",QRCodeMaskBackgroundColor:"rgba(255, 255, 255, 0.96)"}))),z=()=>({size:{type:Number,default:160},value:{type:String,required:!0},type:P("canvas"),color:String,bgColor:String,includeMargin:Boolean,imageSettings:tt()}),ft=()=>N(N({},z()),{errorLevel:P("M"),icon:String,iconSize:{type:Number,default:40},status:P("active"),bordered:{type:Boolean,default:!0}});var R;(function(r){class s{static encodeText(t,n){const e=r.QrSegment.makeSegments(t);return s.encodeSegments(e,n)}static encodeBinary(t,n){const e=r.QrSegment.makeBytes(t);return s.encodeSegments([e],n)}static encodeSegments(t,n){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:40,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1,c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(!(s.MIN_VERSION<=e&&e<=o&&o<=s.MAX_VERSION)||i<-1||i>7)throw new RangeError("Invalid value");let a,g;for(a=e;;a++){const m=s.getNumDataCodewords(a,n)*8,w=l.getTotalBits(t,a);if(w<=m){g=w;break}if(a>=o)throw new RangeError("Data too long")}for(const m of[s.Ecc.MEDIUM,s.Ecc.QUARTILE,s.Ecc.HIGH])c&&g<=s.getNumDataCodewords(a,m)*8&&(n=m);const d=[];for(const m of t){u(m.mode.modeBits,4,d),u(m.numChars,m.mode.numCharCountBits(a),d);for(const w of m.getData())d.push(w)}h(d.length==g);const p=s.getNumDataCodewords(a,n)*8;h(d.length<=p),u(0,Math.min(4,p-d.length),d),u(0,(8-d.length%8)%8,d),h(d.length%8==0);for(let m=236;d.length<p;m^=253)u(m,8,d);const M=[];for(;M.length*8<d.length;)M.push(0);return d.forEach((m,w)=>M[w>>>3]|=m<<7-(w&7)),new s(a,n,M,i)}constructor(t,n,e,o){if(this.version=t,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],t<s.MIN_VERSION||t>s.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=t*4+17;const i=[];for(let a=0;a<this.size;a++)i.push(!1);for(let a=0;a<this.size;a++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();const c=this.addEccAndInterleave(e);if(this.drawCodewords(c),o==-1){let a=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);const d=this.getPenaltyScore();d<a&&(o=g,a=d),this.applyMask(g)}}h(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}getModule(t,n){return 0<=t&&t<this.size&&0<=n&&n<this.size&&this.modules[n][t]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const t=this.getAlignmentPatternPositions(),n=t.length;for(let e=0;e<n;e++)for(let o=0;o<n;o++)e==0&&o==0||e==0&&o==n-1||e==n-1&&o==0||this.drawAlignmentPattern(t[e],t[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){const n=this.errorCorrectionLevel.formatBits<<3|t;let e=n;for(let i=0;i<10;i++)e=e<<1^(e>>>9)*1335;const o=(n<<10|e)^21522;h(o>>>15==0);for(let i=0;i<=5;i++)this.setFunctionModule(8,i,f(o,i));this.setFunctionModule(8,7,f(o,6)),this.setFunctionModule(8,8,f(o,7)),this.setFunctionModule(7,8,f(o,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,f(o,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,f(o,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,f(o,i));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let e=0;e<12;e++)t=t<<1^(t>>>11)*7973;const n=this.version<<12|t;h(n>>>18==0);for(let e=0;e<18;e++){const o=f(n,e),i=this.size-11+e%3,c=Math.floor(e/3);this.setFunctionModule(i,c,o),this.setFunctionModule(c,i,o)}}drawFinderPattern(t,n){for(let e=-4;e<=4;e++)for(let o=-4;o<=4;o++){const i=Math.max(Math.abs(o),Math.abs(e)),c=t+o,a=n+e;0<=c&&c<this.size&&0<=a&&a<this.size&&this.setFunctionModule(c,a,i!=2&&i!=4)}}drawAlignmentPattern(t,n){for(let e=-2;e<=2;e++)for(let o=-2;o<=2;o++)this.setFunctionModule(t+o,n+e,Math.max(Math.abs(o),Math.abs(e))!=1)}setFunctionModule(t,n,e){this.modules[n][t]=e,this.isFunction[n][t]=!0}addEccAndInterleave(t){const n=this.version,e=this.errorCorrectionLevel;if(t.length!=s.getNumDataCodewords(n,e))throw new RangeError("Invalid argument");const o=s.NUM_ERROR_CORRECTION_BLOCKS[e.ordinal][n],i=s.ECC_CODEWORDS_PER_BLOCK[e.ordinal][n],c=Math.floor(s.getNumRawDataModules(n)/8),a=o-c%o,g=Math.floor(c/o),d=[],p=s.reedSolomonComputeDivisor(i);for(let m=0,w=0;m<o;m++){const v=t.slice(w,w+g-i+(m<a?0:1));w+=v.length;const A=s.reedSolomonComputeRemainder(v,p);m<a&&v.push(0),d.push(v.concat(A))}const M=[];for(let m=0;m<d[0].length;m++)d.forEach((w,v)=>{(m!=g-i||v>=a)&&M.push(w[m])});return h(M.length==c),M}drawCodewords(t){if(t.length!=Math.floor(s.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let e=this.size-1;e>=1;e-=2){e==6&&(e=5);for(let o=0;o<this.size;o++)for(let i=0;i<2;i++){const c=e-i,g=(e+1&2)==0?this.size-1-o:o;!this.isFunction[g][c]&&n<t.length*8&&(this.modules[g][c]=f(t[n>>>3],7-(n&7)),n++)}}h(n==t.length*8)}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let e=0;e<this.size;e++){let o;switch(t){case 0:o=(e+n)%2==0;break;case 1:o=n%2==0;break;case 2:o=e%3==0;break;case 3:o=(e+n)%3==0;break;case 4:o=(Math.floor(e/3)+Math.floor(n/2))%2==0;break;case 5:o=e*n%2+e*n%3==0;break;case 6:o=(e*n%2+e*n%3)%2==0;break;case 7:o=((e+n)%2+e*n%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[n][e]&&o&&(this.modules[n][e]=!this.modules[n][e])}}getPenaltyScore(){let t=0;for(let i=0;i<this.size;i++){let c=!1,a=0;const g=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[i][d]==c?(a++,a==5?t+=s.PENALTY_N1:a>5&&t++):(this.finderPenaltyAddHistory(a,g),c||(t+=this.finderPenaltyCountPatterns(g)*s.PENALTY_N3),c=this.modules[i][d],a=1);t+=this.finderPenaltyTerminateAndCount(c,a,g)*s.PENALTY_N3}for(let i=0;i<this.size;i++){let c=!1,a=0;const g=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[d][i]==c?(a++,a==5?t+=s.PENALTY_N1:a>5&&t++):(this.finderPenaltyAddHistory(a,g),c||(t+=this.finderPenaltyCountPatterns(g)*s.PENALTY_N3),c=this.modules[d][i],a=1);t+=this.finderPenaltyTerminateAndCount(c,a,g)*s.PENALTY_N3}for(let i=0;i<this.size-1;i++)for(let c=0;c<this.size-1;c++){const a=this.modules[i][c];a==this.modules[i][c+1]&&a==this.modules[i+1][c]&&a==this.modules[i+1][c+1]&&(t+=s.PENALTY_N2)}let n=0;for(const i of this.modules)n=i.reduce((c,a)=>c+(a?1:0),n);const e=this.size*this.size,o=Math.ceil(Math.abs(n*20-e*10)/e)-1;return h(0<=o&&o<=9),t+=o*s.PENALTY_N4,h(0<=t&&t<=2568888),t}getAlignmentPatternPositions(){if(this.version==1)return[];{const t=Math.floor(this.version/7)+2,n=this.version==32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,e=[6];for(let o=this.size-7;e.length<t;o-=n)e.splice(1,0,o);return e}}static getNumRawDataModules(t){if(t<s.MIN_VERSION||t>s.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*t+128)*t+64;if(t>=2){const e=Math.floor(t/7)+2;n-=(25*e-10)*e-55,t>=7&&(n-=36)}return h(208<=n&&n<=29648),n}static getNumDataCodewords(t,n){return Math.floor(s.getNumRawDataModules(t)/8)-s.ECC_CODEWORDS_PER_BLOCK[n.ordinal][t]*s.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][t]}static reedSolomonComputeDivisor(t){if(t<1||t>255)throw new RangeError("Degree out of range");const n=[];for(let o=0;o<t-1;o++)n.push(0);n.push(1);let e=1;for(let o=0;o<t;o++){for(let i=0;i<n.length;i++)n[i]=s.reedSolomonMultiply(n[i],e),i+1<n.length&&(n[i]^=n[i+1]);e=s.reedSolomonMultiply(e,2)}return n}static reedSolomonComputeRemainder(t,n){const e=n.map(o=>0);for(const o of t){const i=o^e.shift();e.push(0),n.forEach((c,a)=>e[a]^=s.reedSolomonMultiply(c,i))}return e}static reedSolomonMultiply(t,n){if(t>>>8||n>>>8)throw new RangeError("Byte out of range");let e=0;for(let o=7;o>=0;o--)e=e<<1^(e>>>7)*285,e^=(n>>>o&1)*t;return h(e>>>8==0),e}finderPenaltyCountPatterns(t){const n=t[1];h(n<=this.size*3);const e=n>0&&t[2]==n&&t[3]==n*3&&t[4]==n&&t[5]==n;return(e&&t[0]>=n*4&&t[6]>=n?1:0)+(e&&t[6]>=n*4&&t[0]>=n?1:0)}finderPenaltyTerminateAndCount(t,n,e){return t&&(this.finderPenaltyAddHistory(n,e),n=0),n+=this.size,this.finderPenaltyAddHistory(n,e),this.finderPenaltyCountPatterns(e)}finderPenaltyAddHistory(t,n){n[0]==0&&(t+=this.size),n.pop(),n.unshift(t)}}s.MIN_VERSION=1,s.MAX_VERSION=40,s.PENALTY_N1=3,s.PENALTY_N2=3,s.PENALTY_N3=40,s.PENALTY_N4=10,s.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],s.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],r.QrCode=s;function u(E,t,n){if(t<0||t>31||E>>>t)throw new RangeError("Value out of range");for(let e=t-1;e>=0;e--)n.push(E>>>e&1)}function f(E,t){return(E>>>t&1)!=0}function h(E){if(!E)throw new Error("Assertion error")}class l{static makeBytes(t){const n=[];for(const e of t)u(e,8,n);return new l(l.Mode.BYTE,t.length,n)}static makeNumeric(t){if(!l.isNumeric(t))throw new RangeError("String contains non-numeric characters");const n=[];for(let e=0;e<t.length;){const o=Math.min(t.length-e,3);u(parseInt(t.substring(e,e+o),10),o*3+1,n),e+=o}return new l(l.Mode.NUMERIC,t.length,n)}static makeAlphanumeric(t){if(!l.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");const n=[];let e;for(e=0;e+2<=t.length;e+=2){let o=l.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e))*45;o+=l.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e+1)),u(o,11,n)}return e<t.length&&u(l.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e)),6,n),new l(l.Mode.ALPHANUMERIC,t.length,n)}static makeSegments(t){return t==""?[]:l.isNumeric(t)?[l.makeNumeric(t)]:l.isAlphanumeric(t)?[l.makeAlphanumeric(t)]:[l.makeBytes(l.toUtf8ByteArray(t))]}static makeEci(t){const n=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)u(t,8,n);else if(t<16384)u(2,2,n),u(t,14,n);else if(t<1e6)u(6,3,n),u(t,21,n);else throw new RangeError("ECI assignment value out of range");return new l(l.Mode.ECI,0,n)}static isNumeric(t){return l.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return l.ALPHANUMERIC_REGEX.test(t)}constructor(t,n,e){if(this.mode=t,this.numChars=n,this.bitData=e,n<0)throw new RangeError("Invalid argument");this.bitData=e.slice()}getData(){return this.bitData.slice()}static getTotalBits(t,n){let e=0;for(const o of t){const i=o.mode.numCharCountBits(n);if(o.numChars>=1<<i)return 1/0;e+=4+i+o.bitData.length}return e}static toUtf8ByteArray(t){t=encodeURI(t);const n=[];for(let e=0;e<t.length;e++)t.charAt(e)!="%"?n.push(t.charCodeAt(e)):(n.push(parseInt(t.substring(e+1,e+3),16)),e+=2);return n}}l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.QrSegment=l})(R||(R={}));(function(r){(function(s){class u{constructor(h,l){this.ordinal=h,this.formatBits=l}}u.LOW=new u(0,1),u.MEDIUM=new u(1,0),u.QUARTILE=new u(2,3),u.HIGH=new u(3,2),s.Ecc=u})(r.QrCode||(r.QrCode={}))})(R||(R={}));(function(r){(function(s){class u{constructor(h,l){this.modeBits=h,this.numBitsCharCount=l}numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}}u.NUMERIC=new u(1,[10,12,14]),u.ALPHANUMERIC=new u(2,[9,11,13]),u.BYTE=new u(4,[8,16,16]),u.KANJI=new u(8,[8,10,12]),u.ECI=new u(7,[0,0,0]),s.Mode=u})(r.QrSegment||(r.QrSegment={}))})(R||(R={}));const U={L:R.QrCode.Ecc.LOW,M:R.QrCode.Ecc.MEDIUM,Q:R.QrCode.Ecc.QUARTILE,H:R.QrCode.Ecc.HIGH},S=128,$="L",k="#FFFFFF",H="#000000",G=!1,gt=4,mt=0,Et=.1;function Y(r){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const u=[];return r.forEach(function(f,h){let l=null;f.forEach(function(E,t){if(!E&&l!==null){u.push(`M${l+s} ${h+s}h${t-l}v1H${l+s}z`),l=null;return}if(t===f.length-1){if(!E)return;l===null?u.push(`M${t+s},${h+s} h1v1H${t+s}z`):u.push(`M${l+s},${h+s} h${t+1-l}v1H${l+s}z`);return}E&&l===null&&(l=t)})}),u.join("")}function V(r,s){return r.slice().map((u,f)=>f<s.y||f>=s.y+s.h?u:u.map((h,l)=>l<s.x||l>=s.x+s.w?h:!1))}function X(r,s,u,f){if(f==null)return null;const h=r.length+u*2,l=Math.floor(s*Et),E=h/s,t=(f.width||l)*E,n=(f.height||l)*E,e=f.x==null?r.length/2-t/2:f.x*E,o=f.y==null?r.length/2-n/2:f.y*E;let i=null;if(f.excavate){const c=Math.floor(e),a=Math.floor(o),g=Math.ceil(t+e-c),d=Math.ceil(n+o-a);i={x:c,y:a,w:g,h:d}}return{x:e,y:o,h:n,w:t,excavation:i}}function _(r,s){return s!=null?Math.floor(s):r?gt:mt}const wt=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Mt=L({name:"QRCodeCanvas",inheritAttrs:!1,props:N(N({},z()),{level:String,bgColor:String,fgColor:String,marginSize:Number}),setup(r,s){let{attrs:u,expose:f}=s;const h=F(()=>{var n;return(n=r.imageSettings)===null||n===void 0?void 0:n.src}),l=y(null),E=y(null),t=y(!1);return f({toDataURL:(n,e)=>{var o;return(o=l.value)===null||o===void 0?void 0:o.toDataURL(n,e)}}),D(()=>{const{value:n,size:e=S,level:o=$,bgColor:i=k,fgColor:c=H,includeMargin:a=G,marginSize:g,imageSettings:d}=r;if(l.value!=null){const p=l.value,M=p.getContext("2d");if(!M)return;let m=R.QrCode.encodeText(n,U[o]).getModules();const w=_(a,g),v=m.length+w*2,A=X(m,e,w,d),b=E.value,x=t.value&&A!=null&&b!==null&&b.complete&&b.naturalHeight!==0&&b.naturalWidth!==0;x&&A.excavation!=null&&(m=V(m,A.excavation));const B=window.devicePixelRatio||1;p.height=p.width=e*B;const T=e/v*B;M.scale(T,T),M.fillStyle=i,M.fillRect(0,0,v,v),M.fillStyle=c,wt?M.fill(new Path2D(Y(m,w))):m.forEach(function(W,j){W.forEach(function(K,Z){K&&M.fillRect(Z+w,j+w,1,1)})}),x&&M.drawImage(b,A.x+w,A.y+w,A.w,A.h)}},{flush:"post"}),rt(h,()=>{t.value=!1}),()=>{var n;const e=(n=r.size)!==null&&n!==void 0?n:S,o={height:`${e}px`,width:`${e}px`};let i=null;return h.value!=null&&(i=C("img",{src:h.value,key:h.value,style:{display:"none"},onLoad:()=>{t.value=!0},ref:E},null)),C(O,null,[C("canvas",I(I({},u),{},{style:[o,u.style],ref:l}),null),i])}}}),Ct=L({name:"QRCodeSVG",inheritAttrs:!1,props:N(N({},z()),{color:String,level:String,bgColor:String,fgColor:String,marginSize:Number,title:String}),setup(r){let s=null,u=null,f=null,h=null,l=null,E=null;return D(()=>{const{value:t,size:n=S,level:e=$,includeMargin:o=G,marginSize:i,imageSettings:c}=r;s=R.QrCode.encodeText(t,U[e]).getModules(),u=_(o,i),f=s.length+u*2,h=X(s,n,u,c),c!=null&&h!=null&&(h.excavation!=null&&(s=V(s,h.excavation)),E=C("image",{"xlink:href":c.src,height:h.h,width:h.w,x:h.x+u,y:h.y+u,preserveAspectRatio:"none"},null)),l=Y(s,u)}),()=>{const t=r.bgColor&&k,n=r.fgColor&&H;return C("svg",{height:r.size,width:r.size,viewBox:`0 0 ${f} ${f}`},[!!r.title&&C("title",null,[r.title]),C("path",{fill:t,d:`M0,0 h${f}v${f}H0z`,"shape-rendering":"crispEdges"},null),C("path",{fill:n,d:l,"shape-rendering":"crispEdges"},null),E])}}}),Rt=L({name:"AQrcode",inheritAttrs:!1,props:ft(),emits:["refresh"],setup(r,s){let{emit:u,attrs:f,expose:h}=s;nt(!(r.icon&&r.errorLevel==="L"),"QRCode","ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.");const[l]=ot("QRCode"),{prefixCls:E}=st("qrcode",r),[t,n]=dt(E),[,e]=it(),o=lt();h({toDataURL:(c,a)=>{var g;return(g=o.value)===null||g===void 0?void 0:g.toDataURL(c,a)}});const i=F(()=>{const{value:c,icon:a="",size:g=160,iconSize:d=40,color:p=e.value.colorText,bgColor:M="transparent",errorLevel:m="M"}=r,w={src:a,x:void 0,y:void 0,height:d,width:d,excavate:!0};return{value:c,size:g-(e.value.paddingSM+e.value.lineWidth)*2,level:m,bgColor:M,fgColor:p,imageSettings:a?w:void 0}});return()=>{const c=E.value;return t(C("div",I(I({},f),{},{style:[f.style,{width:`${r.size}px`,height:`${r.size}px`,backgroundColor:i.value.bgColor}],class:[n.value,c,{[`${c}-borderless`]:!r.bordered}]}),[r.status!=="active"&&C("div",{class:`${c}-mask`},[r.status==="loading"&&C(at,null,null),r.status==="expired"&&C(O,null,[C("p",{class:`${c}-expired`},[l.value.expired]),C(ut,{type:"link",onClick:a=>u("refresh",a)},{default:()=>[l.value.refresh],icon:()=>C(ct,null,null)})]),r.status==="scanned"&&C("p",{class:`${c}-scanned`},[l.value.scanned])]),r.type==="canvas"?C(Mt,I({ref:o},i.value),null):C(Ct,i.value,null)]))}}}),Dt=et(Rt);export{Dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as v,h as i,V as ee,t as I,i as k,l as te,m as q,r as oe,w as ne,q as re,M as ae,a7 as le,ar as ie,s as se,a3 as pe,U as ue}from"./index-DT1y-Y3f.js";import{d as H,c as P,e as de,s as R,b as A,r as z,w as ce}from"./vendor-BvqAck49.js";import{T as fe}from"./Trigger-CYslzJDF.js";import{p as me,M as ge,g as ve,a as ye}from"./placementArrow-MzOUG99n.js";import{c as W}from"./vnode-2w5Ks8oo.js";import{f as be}from"./firstNotUndefined-CLFzEa0p.js";import{w as U}from"./raf-Deuc0E8-.js";import{i as Ce,g as he}from"./colors-BhEd_bKZ.js";import{i as Pe}from"./zoom-BbwfKB6m.js";import{i as we}from"./initDefaultProps-DkSV8vgw.js";const Oe={prefixCls:String,id:String,overlayInnerStyle:v.any},Se=H({compatConfig:{MODE:3},name:"TooltipContent",props:Oe,setup(e,r){let{slots:l}=r;return()=>{var o;return P("div",{class:`${e.prefixCls}-inner`,id:e.id,role:"tooltip",style:e.overlayInnerStyle},[(o=l.overlay)===null||o===void 0?void 0:o.call(l)])}}});var xe=function(e,r){var l={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(l[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(l[o[a]]=e[o[a]]);return l};function X(){}const Te=H({compatConfig:{MODE:3},name:"Tooltip",inheritAttrs:!1,props:{trigger:v.any.def(["hover"]),defaultVisible:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:v.string.def("right"),transitionName:String,animation:v.any,afterVisibleChange:v.func.def(()=>{}),overlayStyle:{type:Object,default:void 0},overlayClassName:String,prefixCls:v.string.def("rc-tooltip"),mouseEnterDelay:v.number.def(.1),mouseLeaveDelay:v.number.def(.1),getPopupContainer:Function,destroyTooltipOnHide:{type:Boolean,default:!1},align:v.object.def(()=>({})),arrowContent:v.any.def(null),tipId:String,builtinPlacements:v.object,overlayInnerStyle:{type:Object,default:void 0},popupVisible:{type:Boolean,default:void 0},onVisibleChange:Function,onPopupAlign:Function,arrow:{type:Boolean,default:!0}},setup(e,r){let{slots:l,attrs:o,expose:a}=r;const p=R(),m=()=>{const{prefixCls:s,tipId:f,overlayInnerStyle:h}=e;return[e.arrow?P("div",{class:`${s}-arrow`,key:"arrow"},[ee(l,e,"arrowContent")]):null,P(Se,{key:"content",prefixCls:s,id:f,overlayInnerStyle:h},{overlay:l.overlay})]};a({getPopupDomNode:()=>p.value.getPopupDomNode(),triggerDOM:p,forcePopupAlign:()=>{var s;return(s=p.value)===null||s===void 0?void 0:s.forcePopupAlign()}});const C=R(!1),O=R(!1);return de(()=>{const{destroyTooltipOnHide:s}=e;if(typeof s=="boolean")C.value=s;else if(s&&typeof s=="object"){const{keepParent:f}=s;C.value=f===!0,O.value=f===!1}}),()=>{const{overlayClassName:s,trigger:f,mouseEnterDelay:h,mouseLeaveDelay:S,overlayStyle:w,prefixCls:$,afterVisibleChange:M,transitionName:_,animation:x,placement:B,align:V,destroyTooltipOnHide:F,defaultVisible:N}=e,j=xe(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible"]),D=i({},j);e.visible!==void 0&&(D.popupVisible=e.visible);const E=i(i(i({popupClassName:s,prefixCls:$,action:f,builtinPlacements:me,popupPlacement:B,popupAlign:V,afterPopupVisibleChange:M,popupTransitionName:_,popupAnimation:x,defaultPopupVisible:N,destroyPopupOnHide:C.value,autoDestroy:O.value,mouseLeaveDelay:S,popupStyle:w,mouseEnterDelay:h},D),o),{onPopupVisibleChange:e.onVisibleChange||X,onPopupAlign:e.onPopupAlign||X,ref:p,arrow:!!e.arrow,popup:m()});return P(fe,E,{default:l.default})}}}),Ne=(()=>({trigger:[String,Array],open:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:String,color:String,transitionName:String,overlayStyle:I(),overlayInnerStyle:I(),overlayClassName:String,openClassName:String,prefixCls:String,mouseEnterDelay:Number,mouseLeaveDelay:Number,getPopupContainer:Function,arrowPointAtCenter:{type:Boolean,default:void 0},arrow:{type:[Boolean,Object],default:!0},autoAdjustOverflow:{type:[Boolean,Object],default:void 0},destroyTooltipOnHide:{type:Boolean,default:void 0},align:I(),builtinPlacements:I(),children:Array,onVisibleChange:Function,"onUpdate:visible":Function,onOpenChange:Function,"onUpdate:open":Function}));function Ae(e,r){const l=Ce(r),o=k({[`${e}-${r}`]:r&&l}),a={},p={};return r&&!l&&(a.background=r,p["--antd-arrow-background-color"]=r),{className:o,overlayStyle:a,arrowStyle:p}}const _e=e=>{const{componentCls:r,tooltipMaxWidth:l,tooltipColor:o,tooltipBg:a,tooltipBorderRadius:p,zIndexPopup:m,controlHeight:b,boxShadowSecondary:C,paddingSM:O,paddingXS:s,tooltipRadiusOuter:f}=e;return[{[r]:i(i(i(i({},oe(e)),{position:"absolute",zIndex:m,display:"block","&":[{width:"max-content"},{width:"intrinsic"}],maxWidth:l,visibility:"visible","&-hidden":{display:"none"},"--antd-arrow-background-color":a,[`${r}-inner`]:{minWidth:b,minHeight:b,padding:`${O/2}px ${s}px`,color:o,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:p,boxShadow:C},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${r}-inner`]:{borderRadius:Math.min(p,ge)}},[`${r}-content`]:{position:"relative"}}),he(e,(h,S)=>{let{darkColor:w}=S;return{[`&${r}-${h}`]:{[`${r}-inner`]:{backgroundColor:w},[`${r}-arrow`]:{"--antd-arrow-background-color":w}}}})),{"&-rtl":{direction:"rtl"}})},ve(q(e,{borderRadiusOuter:f}),{colorBg:"var(--antd-arrow-background-color)",showArrowCls:"",contentRadius:p,limitVerticalRadius:!0}),{[`${r}-pure`]:{position:"relative",maxWidth:"none"}}]},De=((e,r)=>te("Tooltip",o=>{if(r?.value===!1)return[];const{borderRadius:a,colorTextLightSolid:p,colorBgDefault:m,borderRadiusOuter:b}=o,C=q(o,{tooltipMaxWidth:250,tooltipColor:p,tooltipBorderRadius:a,tooltipBg:m,tooltipRadiusOuter:b>4?4:b});return[_e(C),Pe(o,"zoom-big-fast")]},o=>{let{zIndexPopupBase:a,colorBgSpotlight:p}=o;return{zIndexPopup:a+70,colorBgDefault:p}})(e)),Ie=(e,r)=>{const l={},o=i({},e);return r.forEach(a=>{e&&a in e&&(l[a]=e[a],delete o[a])}),{picked:l,omitted:o}},Z=()=>i(i({},Ne()),{title:v.any}),We=()=>({trigger:"hover",align:{},placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),$e=H({compatConfig:{MODE:3},name:"ATooltip",inheritAttrs:!1,props:we(Z(),{trigger:"hover",align:{},placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),slots:Object,setup(e,r){let{slots:l,emit:o,attrs:a,expose:p}=r;[["visible","open"],["onVisibleChange","onOpenChange"]].forEach(t=>{let[n,y]=t;ne(e[n]===void 0,"Tooltip",`\`${n}\` is deprecated, please use \`${y}\` instead.`)});const{prefixCls:m,getPopupContainer:b,direction:C,rootPrefixCls:O}=re("tooltip",e),s=A(()=>{var t;return(t=e.open)!==null&&t!==void 0?t:e.visible}),f=z(be([e.open,e.visible])),h=z();let S;ce(s,t=>{U.cancel(S),S=U(()=>{f.value=!!t})});const w=()=>{var t;const n=(t=e.title)!==null&&t!==void 0?t:l.title;return!n&&n!==0},$=t=>{const n=w();s.value===void 0&&(f.value=n?!1:t),n||(o("update:visible",t),o("visibleChange",t),o("update:open",t),o("openChange",t))};p({getPopupDomNode:()=>h.value.getPopupDomNode(),open:f,forcePopupAlign:()=>{var t;return(t=h.value)===null||t===void 0?void 0:t.forcePopupAlign()}});const _=A(()=>{var t;const{builtinPlacements:n,autoAdjustOverflow:y,arrow:d,arrowPointAtCenter:g}=e;let u=g;return typeof d=="object"&&(u=(t=d.pointAtCenter)!==null&&t!==void 0?t:g),n||ye({arrowPointAtCenter:u,autoAdjustOverflow:y})}),x=t=>t||t==="",B=t=>{const n=t.type;if(typeof n=="object"&&t.props&&((n.__ANT_BUTTON===!0||n==="button")&&x(t.props.disabled)||n.__ANT_SWITCH===!0&&(x(t.props.disabled)||x(t.props.loading))||n.__ANT_RADIO===!0&&x(t.props.disabled))){const{picked:y,omitted:d}=Ie(pe(t),["position","left","right","top","bottom","float","display","zIndex"]),g=i(i({display:"inline-block"},y),{cursor:"not-allowed",lineHeight:1,width:t.props&&t.props.block?"100%":void 0}),u=i(i({},d),{pointerEvents:"none"}),c=W(t,{style:u},!0);return P("span",{style:g,class:`${m.value}-disabled-compatible-wrapper`},[c])}return t},V=()=>{var t,n;return(t=e.title)!==null&&t!==void 0?t:(n=l.title)===null||n===void 0?void 0:n.call(l)},F=(t,n)=>{const y=_.value,d=Object.keys(y).find(g=>{var u,c;return y[g].points[0]===((u=n.points)===null||u===void 0?void 0:u[0])&&y[g].points[1]===((c=n.points)===null||c===void 0?void 0:c[1])});if(d){const g=t.getBoundingClientRect(),u={top:"50%",left:"50%"};d.indexOf("top")>=0||d.indexOf("Bottom")>=0?u.top=`${g.height-n.offset[1]}px`:(d.indexOf("Top")>=0||d.indexOf("bottom")>=0)&&(u.top=`${-n.offset[1]}px`),d.indexOf("left")>=0||d.indexOf("Right")>=0?u.left=`${g.width-n.offset[0]}px`:(d.indexOf("right")>=0||d.indexOf("Left")>=0)&&(u.left=`${-n.offset[0]}px`),t.style.transformOrigin=`${u.left} ${u.top}`}},N=A(()=>Ae(m.value,e.color)),j=A(()=>a["data-popover-inject"]),[D,E]=De(m,A(()=>!j.value));return()=>{var t,n;const{openClassName:y,overlayClassName:d,overlayStyle:g,overlayInnerStyle:u}=e;let c=(n=ae((t=l.default)===null||t===void 0?void 0:t.call(l)))!==null&&n!==void 0?n:null;c=c.length===1?c[0]:c;let L=f.value;if(s.value===void 0&&w()&&(L=!1),!c)return null;const T=B(le(c)&&!ie(c)?c:P("span",null,[c])),G=k({[y||`${m.value}-open`]:!0,[T.props&&T.props.class]:T.props&&T.props.class}),J=k(d,{[`${m.value}-rtl`]:C.value==="rtl"},N.value.className,E.value),K=i(i({},N.value.overlayStyle),u),Q=N.value.arrowStyle,Y=i(i(i({},a),e),{prefixCls:m.value,arrow:!!e.arrow,getPopupContainer:b?.value,builtinPlacements:_.value,visible:L,ref:h,overlayClassName:J,overlayStyle:i(i({},Q),g),overlayInnerStyle:K,onVisibleChange:$,onPopupAlign:F,transitionName:se(O.value,"zoom-big-fast",e.transitionName)});return D(P(Te,Y,{default:()=>[f.value?W(T,{class:G}):T],arrowContent:()=>P("span",{class:`${m.value}-arrow-content`},null),overlay:V}))}}}),Be=ue($e),Ue=Object.freeze(Object.defineProperty({__proto__:null,default:Be,tooltipProps:Z},Symbol.toStringTag,{value:"Module"}));export{Be as T,Ne as a,Z as b,Ue as i,We as t};
|
|
1
|
+
import{P as v,h as i,V as ee,t as I,i as k,l as te,m as q,r as oe,w as ne,q as re,M as ae,a7 as le,ar as ie,s as se,a3 as pe,U as ue}from"./index-6QGNBg3m.js";import{d as H,c as P,e as de,s as R,b as A,r as z,w as ce}from"./vendor-BvqAck49.js";import{T as fe}from"./Trigger-s_pHOerx.js";import{p as me,M as ge,g as ve,a as ye}from"./placementArrow-JMndCFEP.js";import{c as W}from"./vnode-CY39Ky7P.js";import{f as be}from"./firstNotUndefined-CLFzEa0p.js";import{w as U}from"./raf-Deuc0E8-.js";import{i as Ce,g as he}from"./colors-BIOTIa89.js";import{i as Pe}from"./zoom-BEghlCth.js";import{i as we}from"./initDefaultProps-Bl6klCzd.js";const Oe={prefixCls:String,id:String,overlayInnerStyle:v.any},Se=H({compatConfig:{MODE:3},name:"TooltipContent",props:Oe,setup(e,r){let{slots:l}=r;return()=>{var o;return P("div",{class:`${e.prefixCls}-inner`,id:e.id,role:"tooltip",style:e.overlayInnerStyle},[(o=l.overlay)===null||o===void 0?void 0:o.call(l)])}}});var xe=function(e,r){var l={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(l[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(l[o[a]]=e[o[a]]);return l};function X(){}const Te=H({compatConfig:{MODE:3},name:"Tooltip",inheritAttrs:!1,props:{trigger:v.any.def(["hover"]),defaultVisible:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:v.string.def("right"),transitionName:String,animation:v.any,afterVisibleChange:v.func.def(()=>{}),overlayStyle:{type:Object,default:void 0},overlayClassName:String,prefixCls:v.string.def("rc-tooltip"),mouseEnterDelay:v.number.def(.1),mouseLeaveDelay:v.number.def(.1),getPopupContainer:Function,destroyTooltipOnHide:{type:Boolean,default:!1},align:v.object.def(()=>({})),arrowContent:v.any.def(null),tipId:String,builtinPlacements:v.object,overlayInnerStyle:{type:Object,default:void 0},popupVisible:{type:Boolean,default:void 0},onVisibleChange:Function,onPopupAlign:Function,arrow:{type:Boolean,default:!0}},setup(e,r){let{slots:l,attrs:o,expose:a}=r;const p=R(),m=()=>{const{prefixCls:s,tipId:f,overlayInnerStyle:h}=e;return[e.arrow?P("div",{class:`${s}-arrow`,key:"arrow"},[ee(l,e,"arrowContent")]):null,P(Se,{key:"content",prefixCls:s,id:f,overlayInnerStyle:h},{overlay:l.overlay})]};a({getPopupDomNode:()=>p.value.getPopupDomNode(),triggerDOM:p,forcePopupAlign:()=>{var s;return(s=p.value)===null||s===void 0?void 0:s.forcePopupAlign()}});const C=R(!1),O=R(!1);return de(()=>{const{destroyTooltipOnHide:s}=e;if(typeof s=="boolean")C.value=s;else if(s&&typeof s=="object"){const{keepParent:f}=s;C.value=f===!0,O.value=f===!1}}),()=>{const{overlayClassName:s,trigger:f,mouseEnterDelay:h,mouseLeaveDelay:S,overlayStyle:w,prefixCls:$,afterVisibleChange:M,transitionName:_,animation:x,placement:B,align:V,destroyTooltipOnHide:F,defaultVisible:N}=e,j=xe(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible"]),D=i({},j);e.visible!==void 0&&(D.popupVisible=e.visible);const E=i(i(i({popupClassName:s,prefixCls:$,action:f,builtinPlacements:me,popupPlacement:B,popupAlign:V,afterPopupVisibleChange:M,popupTransitionName:_,popupAnimation:x,defaultPopupVisible:N,destroyPopupOnHide:C.value,autoDestroy:O.value,mouseLeaveDelay:S,popupStyle:w,mouseEnterDelay:h},D),o),{onPopupVisibleChange:e.onVisibleChange||X,onPopupAlign:e.onPopupAlign||X,ref:p,arrow:!!e.arrow,popup:m()});return P(fe,E,{default:l.default})}}}),Ne=(()=>({trigger:[String,Array],open:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:String,color:String,transitionName:String,overlayStyle:I(),overlayInnerStyle:I(),overlayClassName:String,openClassName:String,prefixCls:String,mouseEnterDelay:Number,mouseLeaveDelay:Number,getPopupContainer:Function,arrowPointAtCenter:{type:Boolean,default:void 0},arrow:{type:[Boolean,Object],default:!0},autoAdjustOverflow:{type:[Boolean,Object],default:void 0},destroyTooltipOnHide:{type:Boolean,default:void 0},align:I(),builtinPlacements:I(),children:Array,onVisibleChange:Function,"onUpdate:visible":Function,onOpenChange:Function,"onUpdate:open":Function}));function Ae(e,r){const l=Ce(r),o=k({[`${e}-${r}`]:r&&l}),a={},p={};return r&&!l&&(a.background=r,p["--antd-arrow-background-color"]=r),{className:o,overlayStyle:a,arrowStyle:p}}const _e=e=>{const{componentCls:r,tooltipMaxWidth:l,tooltipColor:o,tooltipBg:a,tooltipBorderRadius:p,zIndexPopup:m,controlHeight:b,boxShadowSecondary:C,paddingSM:O,paddingXS:s,tooltipRadiusOuter:f}=e;return[{[r]:i(i(i(i({},oe(e)),{position:"absolute",zIndex:m,display:"block","&":[{width:"max-content"},{width:"intrinsic"}],maxWidth:l,visibility:"visible","&-hidden":{display:"none"},"--antd-arrow-background-color":a,[`${r}-inner`]:{minWidth:b,minHeight:b,padding:`${O/2}px ${s}px`,color:o,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:p,boxShadow:C},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${r}-inner`]:{borderRadius:Math.min(p,ge)}},[`${r}-content`]:{position:"relative"}}),he(e,(h,S)=>{let{darkColor:w}=S;return{[`&${r}-${h}`]:{[`${r}-inner`]:{backgroundColor:w},[`${r}-arrow`]:{"--antd-arrow-background-color":w}}}})),{"&-rtl":{direction:"rtl"}})},ve(q(e,{borderRadiusOuter:f}),{colorBg:"var(--antd-arrow-background-color)",showArrowCls:"",contentRadius:p,limitVerticalRadius:!0}),{[`${r}-pure`]:{position:"relative",maxWidth:"none"}}]},De=((e,r)=>te("Tooltip",o=>{if(r?.value===!1)return[];const{borderRadius:a,colorTextLightSolid:p,colorBgDefault:m,borderRadiusOuter:b}=o,C=q(o,{tooltipMaxWidth:250,tooltipColor:p,tooltipBorderRadius:a,tooltipBg:m,tooltipRadiusOuter:b>4?4:b});return[_e(C),Pe(o,"zoom-big-fast")]},o=>{let{zIndexPopupBase:a,colorBgSpotlight:p}=o;return{zIndexPopup:a+70,colorBgDefault:p}})(e)),Ie=(e,r)=>{const l={},o=i({},e);return r.forEach(a=>{e&&a in e&&(l[a]=e[a],delete o[a])}),{picked:l,omitted:o}},Z=()=>i(i({},Ne()),{title:v.any}),We=()=>({trigger:"hover",align:{},placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),$e=H({compatConfig:{MODE:3},name:"ATooltip",inheritAttrs:!1,props:we(Z(),{trigger:"hover",align:{},placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),slots:Object,setup(e,r){let{slots:l,emit:o,attrs:a,expose:p}=r;[["visible","open"],["onVisibleChange","onOpenChange"]].forEach(t=>{let[n,y]=t;ne(e[n]===void 0,"Tooltip",`\`${n}\` is deprecated, please use \`${y}\` instead.`)});const{prefixCls:m,getPopupContainer:b,direction:C,rootPrefixCls:O}=re("tooltip",e),s=A(()=>{var t;return(t=e.open)!==null&&t!==void 0?t:e.visible}),f=z(be([e.open,e.visible])),h=z();let S;ce(s,t=>{U.cancel(S),S=U(()=>{f.value=!!t})});const w=()=>{var t;const n=(t=e.title)!==null&&t!==void 0?t:l.title;return!n&&n!==0},$=t=>{const n=w();s.value===void 0&&(f.value=n?!1:t),n||(o("update:visible",t),o("visibleChange",t),o("update:open",t),o("openChange",t))};p({getPopupDomNode:()=>h.value.getPopupDomNode(),open:f,forcePopupAlign:()=>{var t;return(t=h.value)===null||t===void 0?void 0:t.forcePopupAlign()}});const _=A(()=>{var t;const{builtinPlacements:n,autoAdjustOverflow:y,arrow:d,arrowPointAtCenter:g}=e;let u=g;return typeof d=="object"&&(u=(t=d.pointAtCenter)!==null&&t!==void 0?t:g),n||ye({arrowPointAtCenter:u,autoAdjustOverflow:y})}),x=t=>t||t==="",B=t=>{const n=t.type;if(typeof n=="object"&&t.props&&((n.__ANT_BUTTON===!0||n==="button")&&x(t.props.disabled)||n.__ANT_SWITCH===!0&&(x(t.props.disabled)||x(t.props.loading))||n.__ANT_RADIO===!0&&x(t.props.disabled))){const{picked:y,omitted:d}=Ie(pe(t),["position","left","right","top","bottom","float","display","zIndex"]),g=i(i({display:"inline-block"},y),{cursor:"not-allowed",lineHeight:1,width:t.props&&t.props.block?"100%":void 0}),u=i(i({},d),{pointerEvents:"none"}),c=W(t,{style:u},!0);return P("span",{style:g,class:`${m.value}-disabled-compatible-wrapper`},[c])}return t},V=()=>{var t,n;return(t=e.title)!==null&&t!==void 0?t:(n=l.title)===null||n===void 0?void 0:n.call(l)},F=(t,n)=>{const y=_.value,d=Object.keys(y).find(g=>{var u,c;return y[g].points[0]===((u=n.points)===null||u===void 0?void 0:u[0])&&y[g].points[1]===((c=n.points)===null||c===void 0?void 0:c[1])});if(d){const g=t.getBoundingClientRect(),u={top:"50%",left:"50%"};d.indexOf("top")>=0||d.indexOf("Bottom")>=0?u.top=`${g.height-n.offset[1]}px`:(d.indexOf("Top")>=0||d.indexOf("bottom")>=0)&&(u.top=`${-n.offset[1]}px`),d.indexOf("left")>=0||d.indexOf("Right")>=0?u.left=`${g.width-n.offset[0]}px`:(d.indexOf("right")>=0||d.indexOf("Left")>=0)&&(u.left=`${-n.offset[0]}px`),t.style.transformOrigin=`${u.left} ${u.top}`}},N=A(()=>Ae(m.value,e.color)),j=A(()=>a["data-popover-inject"]),[D,E]=De(m,A(()=>!j.value));return()=>{var t,n;const{openClassName:y,overlayClassName:d,overlayStyle:g,overlayInnerStyle:u}=e;let c=(n=ae((t=l.default)===null||t===void 0?void 0:t.call(l)))!==null&&n!==void 0?n:null;c=c.length===1?c[0]:c;let L=f.value;if(s.value===void 0&&w()&&(L=!1),!c)return null;const T=B(le(c)&&!ie(c)?c:P("span",null,[c])),G=k({[y||`${m.value}-open`]:!0,[T.props&&T.props.class]:T.props&&T.props.class}),J=k(d,{[`${m.value}-rtl`]:C.value==="rtl"},N.value.className,E.value),K=i(i({},N.value.overlayStyle),u),Q=N.value.arrowStyle,Y=i(i(i({},a),e),{prefixCls:m.value,arrow:!!e.arrow,getPopupContainer:b?.value,builtinPlacements:_.value,visible:L,ref:h,overlayClassName:J,overlayStyle:i(i({},Q),g),overlayInnerStyle:K,onVisibleChange:$,onPopupAlign:F,transitionName:se(O.value,"zoom-big-fast",e.transitionName)});return D(P(Te,Y,{default:()=>[f.value?W(T,{class:G}):T],arrowContent:()=>P("span",{class:`${m.value}-arrow-content`},null),overlay:V}))}}}),Be=ue($e),Ue=Object.freeze(Object.defineProperty({__proto__:null,default:Be,tooltipProps:Z},Symbol.toStringTag,{value:"Module"}));export{Be as T,Ne as a,Z as b,Ue as i,We as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as F,m as V,h as w,r as O,n as W,U as _,L as A,q as X,f as $,V as v,P as c,Q as R,w as f}from"./index-
|
|
1
|
+
import{l as F,m as V,h as w,r as O,n as W,U as _,L as A,q as X,f as $,V as v,P as c,Q as R,w as f}from"./index-6QGNBg3m.js";import{d as j,b as p,m as K,r as b,w as N,o as U,n as Q,c as o}from"./vendor-BvqAck49.js";import{T as q,L as G}from"./icons-DP3uiYxy.js";import{K as C}from"./KeyCode-D63Tfrq7.js";import{W as J}from"./index-DX7HGwP_.js";import{u as Y}from"./FormItemContext-DbocfnNQ.js";import{o as Z}from"./omit-ByO8GI_H.js";import"./isVisible-C7tPsqfj.js";import"./useState-BK4hy8Ma.js";import"./raf-Deuc0E8-.js";import"./devWarning-CuIq7zBB.js";import"./createContext-Bzzk7mrh.js";const k=i=>{const{componentCls:n}=i,e=`${n}-inner`;return{[n]:{[`&${n}-small`]:{minWidth:i.switchMinWidthSM,height:i.switchHeightSM,lineHeight:`${i.switchHeightSM}px`,[`${n}-inner`]:{paddingInlineStart:i.switchInnerMarginMaxSM,paddingInlineEnd:i.switchInnerMarginMinSM,[`${e}-checked`]:{marginInlineStart:`calc(-100% + ${i.switchPinSizeSM+i.switchPadding*2}px - ${i.switchInnerMarginMaxSM*2}px)`,marginInlineEnd:`calc(100% - ${i.switchPinSizeSM+i.switchPadding*2}px + ${i.switchInnerMarginMaxSM*2}px)`},[`${e}-unchecked`]:{marginTop:-i.switchHeightSM,marginInlineStart:0,marginInlineEnd:0}},[`${n}-handle`]:{width:i.switchPinSizeSM,height:i.switchPinSizeSM},[`${n}-loading-icon`]:{top:(i.switchPinSizeSM-i.switchLoadingIconSize)/2,fontSize:i.switchLoadingIconSize},[`&${n}-checked`]:{[`${n}-inner`]:{paddingInlineStart:i.switchInnerMarginMinSM,paddingInlineEnd:i.switchInnerMarginMaxSM,[`${e}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${e}-unchecked`]:{marginInlineStart:`calc(100% - ${i.switchPinSizeSM+i.switchPadding*2}px + ${i.switchInnerMarginMaxSM*2}px)`,marginInlineEnd:`calc(-100% + ${i.switchPinSizeSM+i.switchPadding*2}px - ${i.switchInnerMarginMaxSM*2}px)`}},[`${n}-handle`]:{insetInlineStart:`calc(100% - ${i.switchPinSizeSM+i.switchPadding}px)`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${e}`]:{[`${e}-unchecked`]:{marginInlineStart:i.marginXXS/2,marginInlineEnd:-i.marginXXS/2}},[`&${n}-checked ${e}`]:{[`${e}-checked`]:{marginInlineStart:-i.marginXXS/2,marginInlineEnd:i.marginXXS/2}}}}}}},ii=i=>{const{componentCls:n}=i;return{[n]:{[`${n}-loading-icon${i.iconCls}`]:{position:"relative",top:(i.switchPinSize-i.fontSize)/2,color:i.switchLoadingIconColor,verticalAlign:"top"},[`&${n}-checked ${n}-loading-icon`]:{color:i.switchColor}}}},ni=i=>{const{componentCls:n}=i,e=`${n}-handle`;return{[n]:{[e]:{position:"absolute",top:i.switchPadding,insetInlineStart:i.switchPadding,width:i.switchPinSize,height:i.switchPinSize,transition:`all ${i.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:i.colorWhite,borderRadius:i.switchPinSize/2,boxShadow:i.switchHandleShadow,transition:`all ${i.switchDuration} ease-in-out`,content:'""'}},[`&${n}-checked ${e}`]:{insetInlineStart:`calc(100% - ${i.switchPinSize+i.switchPadding}px)`},[`&:not(${n}-disabled):active`]:{[`${e}::before`]:{insetInlineEnd:i.switchHandleActiveInset,insetInlineStart:0},[`&${n}-checked ${e}::before`]:{insetInlineEnd:0,insetInlineStart:i.switchHandleActiveInset}}}}},ei=i=>{const{componentCls:n}=i,e=`${n}-inner`;return{[n]:{[e]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:i.switchInnerMarginMax,paddingInlineEnd:i.switchInnerMarginMin,transition:`padding-inline-start ${i.switchDuration} ease-in-out, padding-inline-end ${i.switchDuration} ease-in-out`,[`${e}-checked, ${e}-unchecked`]:{display:"block",color:i.colorTextLightSolid,fontSize:i.fontSizeSM,transition:`margin-inline-start ${i.switchDuration} ease-in-out, margin-inline-end ${i.switchDuration} ease-in-out`,pointerEvents:"none"},[`${e}-checked`]:{marginInlineStart:`calc(-100% + ${i.switchPinSize+i.switchPadding*2}px - ${i.switchInnerMarginMax*2}px)`,marginInlineEnd:`calc(100% - ${i.switchPinSize+i.switchPadding*2}px + ${i.switchInnerMarginMax*2}px)`},[`${e}-unchecked`]:{marginTop:-i.switchHeight,marginInlineStart:0,marginInlineEnd:0}},[`&${n}-checked ${e}`]:{paddingInlineStart:i.switchInnerMarginMin,paddingInlineEnd:i.switchInnerMarginMax,[`${e}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${e}-unchecked`]:{marginInlineStart:`calc(100% - ${i.switchPinSize+i.switchPadding*2}px + ${i.switchInnerMarginMax*2}px)`,marginInlineEnd:`calc(-100% + ${i.switchPinSize+i.switchPadding*2}px - ${i.switchInnerMarginMax*2}px)`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${e}`]:{[`${e}-unchecked`]:{marginInlineStart:i.switchPadding*2,marginInlineEnd:-i.switchPadding*2}},[`&${n}-checked ${e}`]:{[`${e}-checked`]:{marginInlineStart:-i.switchPadding*2,marginInlineEnd:i.switchPadding*2}}}}}},ai=i=>{const{componentCls:n}=i;return{[n]:w(w(w(w({},O(i)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:i.switchMinWidth,height:i.switchHeight,lineHeight:`${i.switchHeight}px`,verticalAlign:"middle",background:i.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${i.motionDurationMid}`,userSelect:"none",[`&:hover:not(${n}-disabled)`]:{background:i.colorTextTertiary}}),W(i)),{[`&${n}-checked`]:{background:i.switchColor,[`&:hover:not(${n}-disabled)`]:{background:i.colorPrimaryHover}},[`&${n}-loading, &${n}-disabled`]:{cursor:"not-allowed",opacity:i.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${n}-rtl`]:{direction:"rtl"}})}},ci=F("Switch",i=>{const n=i.fontSize*i.lineHeight,e=i.controlHeight/2,t=2,h=n-t*2,l=e-t*2,s=V(i,{switchMinWidth:h*2+t*4,switchHeight:n,switchDuration:i.motionDurationMid,switchColor:i.colorPrimary,switchDisabledOpacity:i.opacityLoading,switchInnerMarginMin:h/2,switchInnerMarginMax:h+t+t*2,switchPadding:t,switchPinSize:h,switchBg:i.colorBgContainer,switchMinWidthSM:l*2+t*2,switchHeightSM:e,switchInnerMarginMinSM:l/2,switchInnerMarginMaxSM:l+t+t*2,switchPinSizeSM:l,switchHandleShadow:`0 2px 4px 0 ${new q("#00230b").setAlpha(.2).toRgbString()}`,switchLoadingIconSize:i.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${i.opacityLoading})`,switchHandleActiveInset:"-30%"});return[ai(s),ei(s),ni(s),ii(s),k(s)]}),ti=R("small","default"),di=()=>({id:String,prefixCls:String,size:c.oneOf(ti),disabled:{type:Boolean,default:void 0},checkedChildren:c.any,unCheckedChildren:c.any,tabindex:c.oneOfType([c.string,c.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:c.oneOfType([c.string,c.number,c.looseBool]),checkedValue:c.oneOfType([c.string,c.number,c.looseBool]).def(!0),unCheckedValue:c.oneOfType([c.string,c.number,c.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function}),li=j({compatConfig:{MODE:3},name:"ASwitch",__ANT_SWITCH:!0,inheritAttrs:!1,props:di(),slots:Object,setup(i,n){let{attrs:e,slots:t,expose:h,emit:l}=n;const s=Y(),x=A(),g=p(()=>{var a;return(a=i.disabled)!==null&&a!==void 0?a:x.value});K(()=>{f(!("defaultChecked"in e),"Switch","'defaultChecked' is deprecated, please use 'v-model:checked'"),f(!("value"in e),"Switch","`value` is not validate prop, do you mean `checked`?")});const S=b(i.checked!==void 0?i.checked:e.defaultChecked),I=p(()=>S.value===i.checkedValue);N(()=>i.checked,()=>{S.value=i.checked});const{prefixCls:d,direction:y,size:P}=X("switch",i),[z,H]=ci(d),u=b(),M=()=>{var a;(a=u.value)===null||a===void 0||a.focus()};h({focus:M,blur:()=>{var a;(a=u.value)===null||a===void 0||a.blur()}}),U(()=>{Q(()=>{i.autofocus&&!g.value&&u.value.focus()})});const m=(a,r)=>{g.value||(l("update:checked",a),l("change",a,r),s.onFieldChange())},E=a=>{l("blur",a)},T=a=>{M();const r=I.value?i.unCheckedValue:i.checkedValue;m(r,a),l("click",r,a)},D=a=>{a.keyCode===C.LEFT?m(i.unCheckedValue,a):a.keyCode===C.RIGHT&&m(i.checkedValue,a),l("keydown",a)},L=a=>{var r;(r=u.value)===null||r===void 0||r.blur(),l("mouseup",a)},B=p(()=>({[`${d.value}-small`]:P.value==="small",[`${d.value}-loading`]:i.loading,[`${d.value}-checked`]:I.value,[`${d.value}-disabled`]:g.value,[d.value]:!0,[`${d.value}-rtl`]:y.value==="rtl",[H.value]:!0}));return()=>{var a;return z(o(J,null,{default:()=>[o("button",$($($({},Z(i,["prefixCls","checkedChildren","unCheckedChildren","checked","autofocus","checkedValue","unCheckedValue","id","onChange","onUpdate:checked"])),e),{},{id:(a=i.id)!==null&&a!==void 0?a:s.id.value,onKeydown:D,onClick:T,onBlur:E,onMouseup:L,type:"button",role:"switch","aria-checked":S.value,disabled:g.value||i.loading,class:[e.class,B.value],ref:u}),[o("div",{class:`${d.value}-handle`},[i.loading?o(G,{class:`${d.value}-loading-icon`},null):null]),o("span",{class:`${d.value}-inner`},[o("span",{class:`${d.value}-inner-checked`},[v(t,i,"checkedChildren")]),o("span",{class:`${d.value}-inner-unchecked`},[v(t,i,"unCheckedChildren")])])])]}))}}}),vi=_(li);export{ti as SwitchSizes,vi as default,di as switchProps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as o}from"./Row-Do5iQUFj.js";import{U as t}from"./index-6QGNBg3m.js";import"./vendor-BvqAck49.js";import"./responsiveObserve-DHV7-FuY.js";import"./useFlexGapSupport-D338iARz.js";import"./styleChecker-DamP5BTS.js";import"./index-DEKeoJ6I.js";import"./icons-DP3uiYxy.js";const l=t(o);export{l as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as ie,h as T,P as we,Z as j,ag as me,f as te,t as he,l as bt,m as ft,r as tt,a4 as mt,n as at,J as ht,a7 as gt,ah as $t,q as yt,a0 as xt,a8 as xe,G as St,$ as _t}from"./index-DT1y-Y3f.js";import{s as W,f as Me,d as re,b as H,c as h,r as J,e as Ce,o as Te,w as oe,p as Ct,i as Tt}from"./vendor-BvqAck49.js";import{w as ge}from"./raf-Deuc0E8-.js";import{K as q}from"./KeyCode-D63Tfrq7.js";import wt,{Item as Pt}from"./index-IGkFXvXp.js";import{D as Rt}from"./Dropdown-B73mSg7P.js";import{u as D}from"./useState-BK4hy8Ma.js";import{ba as It,as as Et,b as Bt}from"./icons-DP3uiYxy.js";import{u as Lt}from"./OverrideContext-C2r4vyBb.js";import{R as Xe}from"./index-Np_V608u.js";import{u as At}from"./useRefs-DD9q4mOT.js";import{f as nt,t as Dt,a as kt,c as Mt,h as Nt,g as Ot}from"./hasIn-CmeIRIpe.js";import{j as Wt}from"./Trigger-CYslzJDF.js";import{h as Fe}from"./_getTag-DnrRH4E6.js";import{c as Ht}from"./vnode-2w5Ks8oo.js";import{i as zt}from"./isMobile--2fOlCHx.js";import{u as je}from"./useMergedState-Cl2q1fes.js";import{d as De}from"./devWarning-CahsJx-O.js";import{o as Kt}from"./omit-8eo0vufF.js";import{i as Ve}from"./slide-BboGfin4.js";import{i as ot}from"./initDefaultProps-DkSV8vgw.js";import"./_arrayIncludes-B8uzE354.js";import"./injectionKey-BXVc-oGP.js";import"./Overflow-Cwd_BqS5.js";import"./index-dMw41BZp.js";import"./placementArrow-MzOUG99n.js";import"./firstNotUndefined-CLFzEa0p.js";import"./colors-BhEd_bKZ.js";import"./zoom-BbwfKB6m.js";import"./motion-Cp8NKUFr.js";import"./collapseMotion-mxzzcDsg.js";import"./ResizeObserver.es-D6qJbdzf.js";import"./isSymbol-S5WZT7lS.js";import"./isVisible-C7tPsqfj.js";function Gt(e,t,a,i){if(!Fe(e))return e;t=nt(t,e);for(var o=-1,r=t.length,n=r-1,s=e;s!=null&&++o<r;){var v=Dt(t[o]),d=a;if(v==="__proto__"||v==="constructor"||v==="prototype")return e;if(o!=n){var b=s[v];d=void 0,d===void 0&&(d=Fe(b)?b:Wt(t[o+1])?[]:{})}kt(s,v,d),s=s[v]}return e}function Xt(e,t,a){for(var i=-1,o=t.length,r={};++i<o;){var n=t[i],s=Mt(e,n);a(s,n)&&Gt(r,nt(n,e),s)}return r}function Ft(e,t){return Xt(e,t,function(a,i){return Nt(e,i)})}var it=Ot(function(e,t){return e==null?{}:Ft(e,t)});function jt(e){const t=W(),a=W(!1);function i(){for(var o=arguments.length,r=new Array(o),n=0;n<o;n++)r[n]=arguments[n];a.value||(ge.cancel(t.value),t.value=ge(()=>{e(...r)}))}return Me(()=>{a.value=!0,ge.cancel(t.value)}),i}function Vt(e){const t=W([]),a=W(typeof e=="function"?e():e),i=jt(()=>{let r=a.value;t.value.forEach(n=>{r=n(r)}),t.value=[],a.value=r});function o(r){t.value.push(r),i()}return[a,o]}const Yt=re({compatConfig:{MODE:3},name:"TabNode",props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:["click","resize","remove","focus"],setup(e,t){let{expose:a,attrs:i}=t;const o=J();function r(v){var d;!((d=e.tab)===null||d===void 0)&&d.disabled||e.onClick(v)}a({domRef:o});function n(v){var d;v.preventDefault(),v.stopPropagation(),e.editable.onEdit("remove",{key:(d=e.tab)===null||d===void 0?void 0:d.key,event:v})}const s=H(()=>{var v;return e.editable&&e.closable!==!1&&!(!((v=e.tab)===null||v===void 0)&&v.disabled)});return()=>{var v;const{prefixCls:d,id:b,active:_,tab:{key:m,tab:c,disabled:y,closeIcon:x},renderWrapper:w,removeAriaLabel:C,editable:k,onFocus:K}=e,M=`${d}-tab`,l=h("div",{key:m,ref:o,class:ie(M,{[`${M}-with-remove`]:s.value,[`${M}-active`]:_,[`${M}-disabled`]:y}),style:i.style,onClick:r},[h("div",{role:"tab","aria-selected":_,id:b&&`${b}-tab-${m}`,class:`${M}-btn`,"aria-controls":b&&`${b}-panel-${m}`,"aria-disabled":y,tabindex:y?null:0,onClick:g=>{g.stopPropagation(),r(g)},onKeydown:g=>{[q.SPACE,q.ENTER].includes(g.which)&&(g.preventDefault(),r(g))},onFocus:K},[typeof c=="function"?c():c]),s.value&&h("button",{type:"button","aria-label":C||"remove",tabindex:0,class:`${M}-remove`,onClick:g=>{g.stopPropagation(),n(g)}},[x?.()||((v=k.removeIcon)===null||v===void 0?void 0:v.call(k))||"×"])]);return w?w(l):l}}}),Ye={width:0,height:0,left:0,top:0};function Ut(e,t){const a=J(new Map);return Ce(()=>{var i,o;const r=new Map,n=e.value,s=t.value.get((i=n[0])===null||i===void 0?void 0:i.key)||Ye,v=s.left+s.width;for(let d=0;d<n.length;d+=1){const{key:b}=n[d];let _=t.value.get(b);_||(_=t.value.get((o=n[d-1])===null||o===void 0?void 0:o.key)||Ye);const m=r.get(b)||T({},_);m.right=v-m.left-m.width,r.set(b,m)}a.value=new Map(r)}),a}const rt=re({compatConfig:{MODE:3},name:"AddButton",inheritAttrs:!1,props:{prefixCls:String,editable:{type:Object},locale:{type:Object,default:void 0}},setup(e,t){let{expose:a,attrs:i}=t;const o=J();return a({domRef:o}),()=>{const{prefixCls:r,editable:n,locale:s}=e;return!n||n.showAdd===!1?null:h("button",{ref:o,type:"button",class:`${r}-nav-add`,style:i.style,"aria-label":s?.addAriaLabel||"Add tab",onClick:v=>{n.onEdit("add",{event:v})}},[n.addIcon?n.addIcon():"+"])}}}),Zt={prefixCls:{type:String},id:{type:String},tabs:{type:Object},rtl:{type:Boolean},tabBarGutter:{type:Number},activeKey:{type:[String,Number]},mobile:{type:Boolean},moreIcon:we.any,moreTransitionName:{type:String},editable:{type:Object},locale:{type:Object,default:void 0},removeAriaLabel:String,onTabClick:{type:Function},popupClassName:String,getPopupContainer:j()},qt=re({compatConfig:{MODE:3},name:"OperationNode",inheritAttrs:!1,props:Zt,emits:["tabClick"],slots:Object,setup(e,t){let{attrs:a,slots:i}=t;const[o,r]=D(!1),[n,s]=D(null),v=c=>{const y=e.tabs.filter(C=>!C.disabled);let x=y.findIndex(C=>C.key===n.value)||0;const w=y.length;for(let C=0;C<w;C+=1){x=(x+c+w)%w;const k=y[x];if(!k.disabled){s(k.key);return}}},d=c=>{const{which:y}=c;if(!o.value){[q.DOWN,q.SPACE,q.ENTER].includes(y)&&(r(!0),c.preventDefault());return}switch(y){case q.UP:v(-1),c.preventDefault();break;case q.DOWN:v(1),c.preventDefault();break;case q.ESC:r(!1);break;case q.SPACE:case q.ENTER:n.value!==null&&e.onTabClick(n.value,c);break}},b=H(()=>`${e.id}-more-popup`),_=H(()=>n.value!==null?`${b.value}-${n.value}`:null),m=(c,y)=>{c.preventDefault(),c.stopPropagation(),e.editable.onEdit("remove",{key:y,event:c})};return Te(()=>{oe(n,()=>{const c=document.getElementById(_.value);c&&c.scrollIntoView&&c.scrollIntoView(!1)},{flush:"post",immediate:!0})}),oe(o,()=>{o.value||s(null)}),Lt({}),()=>{var c;const{prefixCls:y,id:x,tabs:w,locale:C,mobile:k,moreIcon:K=((c=i.moreIcon)===null||c===void 0?void 0:c.call(i))||h(It,null,null),moreTransitionName:M,editable:l,tabBarGutter:g,rtl:u,onTabClick:$,popupClassName:E}=e;if(!w.length)return null;const R=`${y}-dropdown`,G=C?.dropdownAriaLabel,le={[u?"marginRight":"marginLeft"]:g};w.length||(le.visibility="hidden",le.order=1);const se=ie({[`${R}-rtl`]:u,[`${E}`]:!0}),ce=k?null:h(Rt,{prefixCls:R,trigger:["hover"],visible:o.value,transitionName:M,onVisibleChange:r,overlayClassName:se,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:e.getPopupContainer},{overlay:()=>h(wt,{onClick:I=>{let{key:Q,domEvent:N}=I;$(Q,N),r(!1)},id:b.value,tabindex:-1,role:"listbox","aria-activedescendant":_.value,selectedKeys:[n.value],"aria-label":G!==void 0?G:"expanded dropdown"},{default:()=>[w.map(I=>{var Q,N;const V=l&&I.closable!==!1&&!I.disabled;return h(Pt,{key:I.key,id:`${b.value}-${I.key}`,role:"option","aria-controls":x&&`${x}-panel-${I.key}`,disabled:I.disabled},{default:()=>[h("span",null,[typeof I.tab=="function"?I.tab():I.tab]),V&&h("button",{type:"button","aria-label":e.removeAriaLabel||"remove",tabindex:0,class:`${R}-menu-item-remove`,onClick:Y=>{Y.stopPropagation(),m(Y,I.key)}},[((Q=I.closeIcon)===null||Q===void 0?void 0:Q.call(I))||((N=l.removeIcon)===null||N===void 0?void 0:N.call(l))||"×"])]})})]}),default:()=>h("button",{type:"button",class:`${y}-nav-more`,style:le,tabindex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":b.value,id:`${x}-more`,"aria-expanded":o.value,onKeydown:d},[K])});return h("div",{class:ie(`${y}-nav-operations`,a.class),style:a.style},[ce,h(rt,{prefixCls:y,locale:C,editable:l},null)])}}}),lt=Symbol("tabsContextKey"),Jt=e=>{Ct(lt,e)},st=()=>Tt(lt,{tabs:J([]),prefixCls:J()}),Qt=.1,Ue=.01,Se=20,Ze=Math.pow(.995,Se);function ea(e,t){const[a,i]=D(),[o,r]=D(0),[n,s]=D(0),[v,d]=D(),b=J();function _(l){const{screenX:g,screenY:u}=l.touches[0];i({x:g,y:u}),clearInterval(b.value)}function m(l){if(!a.value)return;l.preventDefault();const{screenX:g,screenY:u}=l.touches[0],$=g-a.value.x,E=u-a.value.y;t($,E),i({x:g,y:u});const R=Date.now();s(R-o.value),r(R),d({x:$,y:E})}function c(){if(!a.value)return;const l=v.value;if(i(null),d(null),l){const g=l.x/n.value,u=l.y/n.value,$=Math.abs(g),E=Math.abs(u);if(Math.max($,E)<Qt)return;let R=g,G=u;b.value=setInterval(()=>{if(Math.abs(R)<Ue&&Math.abs(G)<Ue){clearInterval(b.value);return}R*=Ze,G*=Ze,t(R*Se,G*Se)},Se)}}const y=J();function x(l){const{deltaX:g,deltaY:u}=l;let $=0;const E=Math.abs(g),R=Math.abs(u);E===R?$=y.value==="x"?g:u:E>R?($=g,y.value="x"):($=u,y.value="y"),t(-$,-$)&&l.preventDefault()}const w=J({onTouchStart:_,onTouchMove:m,onTouchEnd:c,onWheel:x});function C(l){w.value.onTouchStart(l)}function k(l){w.value.onTouchMove(l)}function K(l){w.value.onTouchEnd(l)}function M(l){w.value.onWheel(l)}Te(()=>{var l,g;document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("touchend",K,{passive:!1}),(l=e.value)===null||l===void 0||l.addEventListener("touchstart",C,{passive:!1}),(g=e.value)===null||g===void 0||g.addEventListener("wheel",M,{passive:!1})}),Me(()=>{document.removeEventListener("touchmove",k),document.removeEventListener("touchend",K)})}function qe(e,t){const a=J(e);function i(o){const r=typeof o=="function"?o(a.value):o;r!==a.value&&t(r,a.value),a.value=r}return[a,i]}const Je={width:0,height:0,left:0,top:0,right:0},ta=()=>({id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:he(),editable:he(),moreIcon:we.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:he(),popupClassName:String,getPopupContainer:j(),onTabClick:{type:Function},onTabScroll:{type:Function}}),aa=(e,t)=>{const{offsetWidth:a,offsetHeight:i,offsetTop:o,offsetLeft:r}=e,{width:n,height:s,x:v,y:d}=e.getBoundingClientRect();return Math.abs(n-a)<1?[n,s,v-t.x,d-t.y]:[a,i,r,o]},Qe=re({compatConfig:{MODE:3},name:"TabNavList",inheritAttrs:!1,props:ta(),slots:Object,emits:["tabClick","tabScroll"],setup(e,t){let{attrs:a,slots:i}=t;const{tabs:o,prefixCls:r}=st(),n=W(),s=W(),v=W(),d=W(),[b,_]=At(),m=H(()=>e.tabPosition==="top"||e.tabPosition==="bottom"),[c,y]=qe(0,(f,p)=>{m.value&&e.onTabScroll&&e.onTabScroll({direction:f>p?"left":"right"})}),[x,w]=qe(0,(f,p)=>{!m.value&&e.onTabScroll&&e.onTabScroll({direction:f>p?"top":"bottom"})}),[C,k]=D(0),[K,M]=D(0),[l,g]=D(null),[u,$]=D(null),[E,R]=D(0),[G,le]=D(0),[se,ce]=Vt(new Map),I=Ut(o,se),Q=H(()=>`${r.value}-nav-operations-hidden`),N=W(0),V=W(0);Ce(()=>{m.value?e.rtl?(N.value=0,V.value=Math.max(0,C.value-l.value)):(N.value=Math.min(0,l.value-C.value),V.value=0):(N.value=Math.min(0,u.value-K.value),V.value=0)});const Y=f=>f<N.value?N.value:f>V.value?V.value:f,ue=W(),[z,ve]=D(),pe=()=>{ve(Date.now())},be=()=>{clearTimeout(ue.value)},$e=(f,p)=>{f(S=>Y(S+p))};ea(n,(f,p)=>{if(m.value){if(l.value>=C.value)return!1;$e(y,f)}else{if(u.value>=K.value)return!1;$e(w,p)}return be(),pe(),!0}),oe(z,()=>{be(),z.value&&(ue.value=setTimeout(()=>{ve(0)},100))});const de=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey;const p=I.value.get(f)||{width:0,height:0,left:0,right:0,top:0};if(m.value){let S=c.value;e.rtl?p.right<c.value?S=p.right:p.right+p.width>c.value+l.value&&(S=p.right+p.width-l.value):p.left<-c.value?S=-p.left:p.left+p.width>-c.value+l.value&&(S=-(p.left+p.width-l.value)),w(0),y(Y(S))}else{let S=x.value;p.top<-x.value?S=-p.top:p.top+p.height>-x.value+u.value&&(S=-(p.top+p.height-u.value)),y(0),w(Y(S))}},Pe=W(0),Re=W(0);Ce(()=>{let f,p,S,P,L,B;const U=I.value;["top","bottom"].includes(e.tabPosition)?(f="width",P=l.value,L=C.value,B=E.value,p=e.rtl?"right":"left",S=Math.abs(c.value)):(f="height",P=u.value,L=C.value,B=G.value,p="top",S=-x.value);let O=P;L+B>P&&L<P&&(O=P-B);const F=o.value;if(!F.length)return[Pe.value,Re.value]=[0,0];const Z=F.length;let ne=Z;for(let X=0;X<Z;X+=1){const ee=U.get(F[X].key)||Je;if(ee[p]+ee[f]>S+O){ne=X-1;break}}let A=0;for(let X=Z-1;X>=0;X-=1)if((U.get(F[X].key)||Je)[p]<S){A=X+1;break}return[Pe.value,Re.value]=[A,ne]});const Ne=()=>{ce(()=>{var f;const p=new Map,S=(f=s.value)===null||f===void 0?void 0:f.getBoundingClientRect();return o.value.forEach(P=>{let{key:L}=P;const B=_.value.get(L),U=B?.$el||B;if(U){const[O,F,Z,ne]=aa(U,S);p.set(L,{width:O,height:F,left:Z,top:ne})}}),p})};oe(()=>o.value.map(f=>f.key).join("%%"),()=>{Ne()},{flush:"post"});const Ie=()=>{var f,p,S,P,L;const B=((f=n.value)===null||f===void 0?void 0:f.offsetWidth)||0,U=((p=n.value)===null||p===void 0?void 0:p.offsetHeight)||0,O=((S=d.value)===null||S===void 0?void 0:S.$el)||{},F=O.offsetWidth||0,Z=O.offsetHeight||0;g(B),$(U),R(F),le(Z);const ne=(((P=s.value)===null||P===void 0?void 0:P.offsetWidth)||0)-F,A=(((L=s.value)===null||L===void 0?void 0:L.offsetHeight)||0)-Z;k(ne),M(A),Ne()},Oe=H(()=>[...o.value.slice(0,Pe.value),...o.value.slice(Re.value+1)]),[ct,ut]=D(),ae=H(()=>I.value.get(e.activeKey)),We=W(),He=()=>{ge.cancel(We.value)};oe([ae,m,()=>e.rtl],()=>{const f={};ae.value&&(m.value?(e.rtl?f.right=me(ae.value.right):f.left=me(ae.value.left),f.width=me(ae.value.width)):(f.top=me(ae.value.top),f.height=me(ae.value.height))),He(),We.value=ge(()=>{ut(f)})}),oe([()=>e.activeKey,ae,I,m],()=>{de()},{flush:"post"}),oe([()=>e.rtl,()=>e.tabBarGutter,()=>e.activeKey,()=>o.value],()=>{Ie()},{flush:"post"});const Ee=f=>{let{position:p,prefixCls:S,extra:P}=f;if(!P)return null;const L=P?.({position:p});return L?h("div",{class:`${S}-extra-content`},[L]):null};return Me(()=>{be(),He()}),()=>{const{id:f,animated:p,activeKey:S,rtl:P,editable:L,locale:B,tabPosition:U,tabBarGutter:O,onTabClick:F}=e,{class:Z,style:ne}=a,A=r.value,X=!!Oe.value.length,ee=`${A}-nav-wrap`;let Be,Le,ze,Ke;m.value?P?(Le=c.value>0,Be=c.value+l.value<C.value):(Be=c.value<0,Le=-c.value+l.value<C.value):(ze=x.value<0,Ke=-x.value+u.value<K.value);const ye={};U==="top"||U==="bottom"?ye[P?"marginRight":"marginLeft"]=typeof O=="number"?`${O}px`:O:ye.marginTop=typeof O=="number"?`${O}px`:O;const Ge=o.value.map((Ae,vt)=>{const{key:fe}=Ae;return h(Yt,{id:f,prefixCls:A,key:fe,tab:Ae,style:vt===0?void 0:ye,closable:Ae.closable,editable:L,active:fe===S,removeAriaLabel:B?.removeAriaLabel,ref:b(fe),onClick:pt=>{F(fe,pt)},onFocus:()=>{de(fe),pe(),n.value&&(P||(n.value.scrollLeft=0),n.value.scrollTop=0)}},i)});return h("div",{role:"tablist",class:ie(`${A}-nav`,Z),style:ne,onKeydown:()=>{pe()}},[h(Ee,{position:"left",prefixCls:A,extra:i.leftExtra},null),h(Xe,{onResize:Ie},{default:()=>[h("div",{class:ie(ee,{[`${ee}-ping-left`]:Be,[`${ee}-ping-right`]:Le,[`${ee}-ping-top`]:ze,[`${ee}-ping-bottom`]:Ke}),ref:n},[h(Xe,{onResize:Ie},{default:()=>[h("div",{ref:s,class:`${A}-nav-list`,style:{transform:`translate(${c.value}px, ${x.value}px)`,transition:z.value?"none":void 0}},[Ge,h(rt,{ref:d,prefixCls:A,locale:B,editable:L,style:T(T({},Ge.length===0?void 0:ye),{visibility:X?"hidden":null})},null),h("div",{class:ie(`${A}-ink-bar`,{[`${A}-ink-bar-animated`]:p.inkBar}),style:ct.value},null)])]})])]}),h(qt,te(te({},e),{},{removeAriaLabel:B?.removeAriaLabel,ref:v,prefixCls:A,tabs:Oe.value,class:!X&&Q.value}),it(i,["moreIcon"])),h(Ee,{position:"right",prefixCls:A,extra:i.rightExtra},null),h(Ee,{position:"right",prefixCls:A,extra:i.tabBarExtraContent},null)])}}}),na=re({compatConfig:{MODE:3},name:"TabPanelList",inheritAttrs:!1,props:{activeKey:{type:[String,Number]},id:{type:String},rtl:{type:Boolean},animated:{type:Object,default:void 0},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean}},setup(e){const{tabs:t,prefixCls:a}=st();return()=>{const{id:i,activeKey:o,animated:r,tabPosition:n,rtl:s,destroyInactiveTabPane:v}=e,d=r.tabPane,b=a.value,_=t.value.findIndex(m=>m.key===o);return h("div",{class:`${b}-content-holder`},[h("div",{class:[`${b}-content`,`${b}-content-${n}`,{[`${b}-content-animated`]:d}],style:_&&d?{[s?"marginRight":"marginLeft"]:`-${_}00%`}:null},[t.value.map(m=>Ht(m.node,{key:m.key,prefixCls:b,tabKey:m.key,id:i,animated:d,active:m.key===o,destroyInactiveTabPane:v}))])])}}}),oa=e=>{const{componentCls:t,motionDurationSlow:a}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${a}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${a}`}}}}},[Ve(e,"slide-up"),Ve(e,"slide-down")]]},ia=e=>{const{componentCls:t,tabsCardHorizontalPadding:a,tabsCardHeadBackground:i,tabsCardGutter:o,colorSplit:r}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:a,background:i,border:`${e.lineWidth}px ${e.lineType} ${r}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:e.colorPrimary,background:e.colorBgContainer},[`${t}-ink-bar`]:{visibility:"hidden"}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:`${o}px`}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:`${o}px`}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadiusLG}px 0 0 ${e.borderRadiusLG}px`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},ra=e=>{const{componentCls:t,tabsHoverColor:a,dropdownEdgeChildVerticalPadding:i}=e;return{[`${t}-dropdown`]:T(T({},tt(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${i}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":T(T({},mt),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:`${e.paddingXXS}px ${e.paddingSM}px`,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:a}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},la=e=>{const{componentCls:t,margin:a,colorSplit:i}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:"column",[`> ${t}-nav, > div > ${t}-nav`]:{margin:`0 0 ${a}px 0`,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${e.lineWidth}px ${e.lineType} ${i}`,content:"''"},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow},
|
|
1
|
+
import{i as ie,h as T,P as we,Z as j,ag as me,f as te,t as he,l as bt,m as ft,r as tt,a4 as mt,n as at,J as ht,a7 as gt,ah as $t,q as yt,a0 as xt,a8 as xe,G as St,$ as _t}from"./index-6QGNBg3m.js";import{s as W,f as Me,d as re,b as H,c as h,r as J,e as Ce,o as Te,w as oe,p as Ct,i as Tt}from"./vendor-BvqAck49.js";import{w as ge}from"./raf-Deuc0E8-.js";import{K as q}from"./KeyCode-D63Tfrq7.js";import wt,{Item as Pt}from"./index-C4wV32Dn.js";import{D as Rt}from"./Dropdown-wyGMYzw9.js";import{u as D}from"./useState-BK4hy8Ma.js";import{ba as It,as as Et,b as Bt}from"./icons-DP3uiYxy.js";import{u as Lt}from"./OverrideContext-C2r4vyBb.js";import{R as Xe}from"./index-D25-u3Q2.js";import{u as At}from"./useRefs-DD9q4mOT.js";import{f as nt,t as Dt,a as kt,c as Mt,h as Nt,g as Ot}from"./hasIn-B11xqp5O.js";import{j as Wt}from"./Trigger-s_pHOerx.js";import{h as Fe}from"./_getTag-DnrRH4E6.js";import{c as Ht}from"./vnode-CY39Ky7P.js";import{i as zt}from"./isMobile--2fOlCHx.js";import{u as je}from"./useMergedState-Cl2q1fes.js";import{d as De}from"./devWarning-CuIq7zBB.js";import{o as Kt}from"./omit-ByO8GI_H.js";import{i as Ve}from"./slide-DioRUeNF.js";import{i as ot}from"./initDefaultProps-Bl6klCzd.js";import"./_arrayIncludes-B8uzE354.js";import"./injectionKey-BXVc-oGP.js";import"./Overflow-2ZRChJ7E.js";import"./index-DwGVPCZb.js";import"./placementArrow-JMndCFEP.js";import"./firstNotUndefined-CLFzEa0p.js";import"./colors-BIOTIa89.js";import"./zoom-BEghlCth.js";import"./motion-B9IxS1-S.js";import"./collapseMotion-mxzzcDsg.js";import"./ResizeObserver.es-D6qJbdzf.js";import"./isSymbol-S5WZT7lS.js";import"./isVisible-C7tPsqfj.js";function Gt(e,t,a,i){if(!Fe(e))return e;t=nt(t,e);for(var o=-1,r=t.length,n=r-1,s=e;s!=null&&++o<r;){var v=Dt(t[o]),d=a;if(v==="__proto__"||v==="constructor"||v==="prototype")return e;if(o!=n){var b=s[v];d=void 0,d===void 0&&(d=Fe(b)?b:Wt(t[o+1])?[]:{})}kt(s,v,d),s=s[v]}return e}function Xt(e,t,a){for(var i=-1,o=t.length,r={};++i<o;){var n=t[i],s=Mt(e,n);a(s,n)&&Gt(r,nt(n,e),s)}return r}function Ft(e,t){return Xt(e,t,function(a,i){return Nt(e,i)})}var it=Ot(function(e,t){return e==null?{}:Ft(e,t)});function jt(e){const t=W(),a=W(!1);function i(){for(var o=arguments.length,r=new Array(o),n=0;n<o;n++)r[n]=arguments[n];a.value||(ge.cancel(t.value),t.value=ge(()=>{e(...r)}))}return Me(()=>{a.value=!0,ge.cancel(t.value)}),i}function Vt(e){const t=W([]),a=W(typeof e=="function"?e():e),i=jt(()=>{let r=a.value;t.value.forEach(n=>{r=n(r)}),t.value=[],a.value=r});function o(r){t.value.push(r),i()}return[a,o]}const Yt=re({compatConfig:{MODE:3},name:"TabNode",props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:["click","resize","remove","focus"],setup(e,t){let{expose:a,attrs:i}=t;const o=J();function r(v){var d;!((d=e.tab)===null||d===void 0)&&d.disabled||e.onClick(v)}a({domRef:o});function n(v){var d;v.preventDefault(),v.stopPropagation(),e.editable.onEdit("remove",{key:(d=e.tab)===null||d===void 0?void 0:d.key,event:v})}const s=H(()=>{var v;return e.editable&&e.closable!==!1&&!(!((v=e.tab)===null||v===void 0)&&v.disabled)});return()=>{var v;const{prefixCls:d,id:b,active:_,tab:{key:m,tab:c,disabled:y,closeIcon:x},renderWrapper:w,removeAriaLabel:C,editable:k,onFocus:K}=e,M=`${d}-tab`,l=h("div",{key:m,ref:o,class:ie(M,{[`${M}-with-remove`]:s.value,[`${M}-active`]:_,[`${M}-disabled`]:y}),style:i.style,onClick:r},[h("div",{role:"tab","aria-selected":_,id:b&&`${b}-tab-${m}`,class:`${M}-btn`,"aria-controls":b&&`${b}-panel-${m}`,"aria-disabled":y,tabindex:y?null:0,onClick:g=>{g.stopPropagation(),r(g)},onKeydown:g=>{[q.SPACE,q.ENTER].includes(g.which)&&(g.preventDefault(),r(g))},onFocus:K},[typeof c=="function"?c():c]),s.value&&h("button",{type:"button","aria-label":C||"remove",tabindex:0,class:`${M}-remove`,onClick:g=>{g.stopPropagation(),n(g)}},[x?.()||((v=k.removeIcon)===null||v===void 0?void 0:v.call(k))||"×"])]);return w?w(l):l}}}),Ye={width:0,height:0,left:0,top:0};function Ut(e,t){const a=J(new Map);return Ce(()=>{var i,o;const r=new Map,n=e.value,s=t.value.get((i=n[0])===null||i===void 0?void 0:i.key)||Ye,v=s.left+s.width;for(let d=0;d<n.length;d+=1){const{key:b}=n[d];let _=t.value.get(b);_||(_=t.value.get((o=n[d-1])===null||o===void 0?void 0:o.key)||Ye);const m=r.get(b)||T({},_);m.right=v-m.left-m.width,r.set(b,m)}a.value=new Map(r)}),a}const rt=re({compatConfig:{MODE:3},name:"AddButton",inheritAttrs:!1,props:{prefixCls:String,editable:{type:Object},locale:{type:Object,default:void 0}},setup(e,t){let{expose:a,attrs:i}=t;const o=J();return a({domRef:o}),()=>{const{prefixCls:r,editable:n,locale:s}=e;return!n||n.showAdd===!1?null:h("button",{ref:o,type:"button",class:`${r}-nav-add`,style:i.style,"aria-label":s?.addAriaLabel||"Add tab",onClick:v=>{n.onEdit("add",{event:v})}},[n.addIcon?n.addIcon():"+"])}}}),Zt={prefixCls:{type:String},id:{type:String},tabs:{type:Object},rtl:{type:Boolean},tabBarGutter:{type:Number},activeKey:{type:[String,Number]},mobile:{type:Boolean},moreIcon:we.any,moreTransitionName:{type:String},editable:{type:Object},locale:{type:Object,default:void 0},removeAriaLabel:String,onTabClick:{type:Function},popupClassName:String,getPopupContainer:j()},qt=re({compatConfig:{MODE:3},name:"OperationNode",inheritAttrs:!1,props:Zt,emits:["tabClick"],slots:Object,setup(e,t){let{attrs:a,slots:i}=t;const[o,r]=D(!1),[n,s]=D(null),v=c=>{const y=e.tabs.filter(C=>!C.disabled);let x=y.findIndex(C=>C.key===n.value)||0;const w=y.length;for(let C=0;C<w;C+=1){x=(x+c+w)%w;const k=y[x];if(!k.disabled){s(k.key);return}}},d=c=>{const{which:y}=c;if(!o.value){[q.DOWN,q.SPACE,q.ENTER].includes(y)&&(r(!0),c.preventDefault());return}switch(y){case q.UP:v(-1),c.preventDefault();break;case q.DOWN:v(1),c.preventDefault();break;case q.ESC:r(!1);break;case q.SPACE:case q.ENTER:n.value!==null&&e.onTabClick(n.value,c);break}},b=H(()=>`${e.id}-more-popup`),_=H(()=>n.value!==null?`${b.value}-${n.value}`:null),m=(c,y)=>{c.preventDefault(),c.stopPropagation(),e.editable.onEdit("remove",{key:y,event:c})};return Te(()=>{oe(n,()=>{const c=document.getElementById(_.value);c&&c.scrollIntoView&&c.scrollIntoView(!1)},{flush:"post",immediate:!0})}),oe(o,()=>{o.value||s(null)}),Lt({}),()=>{var c;const{prefixCls:y,id:x,tabs:w,locale:C,mobile:k,moreIcon:K=((c=i.moreIcon)===null||c===void 0?void 0:c.call(i))||h(It,null,null),moreTransitionName:M,editable:l,tabBarGutter:g,rtl:u,onTabClick:$,popupClassName:E}=e;if(!w.length)return null;const R=`${y}-dropdown`,G=C?.dropdownAriaLabel,le={[u?"marginRight":"marginLeft"]:g};w.length||(le.visibility="hidden",le.order=1);const se=ie({[`${R}-rtl`]:u,[`${E}`]:!0}),ce=k?null:h(Rt,{prefixCls:R,trigger:["hover"],visible:o.value,transitionName:M,onVisibleChange:r,overlayClassName:se,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:e.getPopupContainer},{overlay:()=>h(wt,{onClick:I=>{let{key:Q,domEvent:N}=I;$(Q,N),r(!1)},id:b.value,tabindex:-1,role:"listbox","aria-activedescendant":_.value,selectedKeys:[n.value],"aria-label":G!==void 0?G:"expanded dropdown"},{default:()=>[w.map(I=>{var Q,N;const V=l&&I.closable!==!1&&!I.disabled;return h(Pt,{key:I.key,id:`${b.value}-${I.key}`,role:"option","aria-controls":x&&`${x}-panel-${I.key}`,disabled:I.disabled},{default:()=>[h("span",null,[typeof I.tab=="function"?I.tab():I.tab]),V&&h("button",{type:"button","aria-label":e.removeAriaLabel||"remove",tabindex:0,class:`${R}-menu-item-remove`,onClick:Y=>{Y.stopPropagation(),m(Y,I.key)}},[((Q=I.closeIcon)===null||Q===void 0?void 0:Q.call(I))||((N=l.removeIcon)===null||N===void 0?void 0:N.call(l))||"×"])]})})]}),default:()=>h("button",{type:"button",class:`${y}-nav-more`,style:le,tabindex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":b.value,id:`${x}-more`,"aria-expanded":o.value,onKeydown:d},[K])});return h("div",{class:ie(`${y}-nav-operations`,a.class),style:a.style},[ce,h(rt,{prefixCls:y,locale:C,editable:l},null)])}}}),lt=Symbol("tabsContextKey"),Jt=e=>{Ct(lt,e)},st=()=>Tt(lt,{tabs:J([]),prefixCls:J()}),Qt=.1,Ue=.01,Se=20,Ze=Math.pow(.995,Se);function ea(e,t){const[a,i]=D(),[o,r]=D(0),[n,s]=D(0),[v,d]=D(),b=J();function _(l){const{screenX:g,screenY:u}=l.touches[0];i({x:g,y:u}),clearInterval(b.value)}function m(l){if(!a.value)return;l.preventDefault();const{screenX:g,screenY:u}=l.touches[0],$=g-a.value.x,E=u-a.value.y;t($,E),i({x:g,y:u});const R=Date.now();s(R-o.value),r(R),d({x:$,y:E})}function c(){if(!a.value)return;const l=v.value;if(i(null),d(null),l){const g=l.x/n.value,u=l.y/n.value,$=Math.abs(g),E=Math.abs(u);if(Math.max($,E)<Qt)return;let R=g,G=u;b.value=setInterval(()=>{if(Math.abs(R)<Ue&&Math.abs(G)<Ue){clearInterval(b.value);return}R*=Ze,G*=Ze,t(R*Se,G*Se)},Se)}}const y=J();function x(l){const{deltaX:g,deltaY:u}=l;let $=0;const E=Math.abs(g),R=Math.abs(u);E===R?$=y.value==="x"?g:u:E>R?($=g,y.value="x"):($=u,y.value="y"),t(-$,-$)&&l.preventDefault()}const w=J({onTouchStart:_,onTouchMove:m,onTouchEnd:c,onWheel:x});function C(l){w.value.onTouchStart(l)}function k(l){w.value.onTouchMove(l)}function K(l){w.value.onTouchEnd(l)}function M(l){w.value.onWheel(l)}Te(()=>{var l,g;document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("touchend",K,{passive:!1}),(l=e.value)===null||l===void 0||l.addEventListener("touchstart",C,{passive:!1}),(g=e.value)===null||g===void 0||g.addEventListener("wheel",M,{passive:!1})}),Me(()=>{document.removeEventListener("touchmove",k),document.removeEventListener("touchend",K)})}function qe(e,t){const a=J(e);function i(o){const r=typeof o=="function"?o(a.value):o;r!==a.value&&t(r,a.value),a.value=r}return[a,i]}const Je={width:0,height:0,left:0,top:0,right:0},ta=()=>({id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:he(),editable:he(),moreIcon:we.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:he(),popupClassName:String,getPopupContainer:j(),onTabClick:{type:Function},onTabScroll:{type:Function}}),aa=(e,t)=>{const{offsetWidth:a,offsetHeight:i,offsetTop:o,offsetLeft:r}=e,{width:n,height:s,x:v,y:d}=e.getBoundingClientRect();return Math.abs(n-a)<1?[n,s,v-t.x,d-t.y]:[a,i,r,o]},Qe=re({compatConfig:{MODE:3},name:"TabNavList",inheritAttrs:!1,props:ta(),slots:Object,emits:["tabClick","tabScroll"],setup(e,t){let{attrs:a,slots:i}=t;const{tabs:o,prefixCls:r}=st(),n=W(),s=W(),v=W(),d=W(),[b,_]=At(),m=H(()=>e.tabPosition==="top"||e.tabPosition==="bottom"),[c,y]=qe(0,(f,p)=>{m.value&&e.onTabScroll&&e.onTabScroll({direction:f>p?"left":"right"})}),[x,w]=qe(0,(f,p)=>{!m.value&&e.onTabScroll&&e.onTabScroll({direction:f>p?"top":"bottom"})}),[C,k]=D(0),[K,M]=D(0),[l,g]=D(null),[u,$]=D(null),[E,R]=D(0),[G,le]=D(0),[se,ce]=Vt(new Map),I=Ut(o,se),Q=H(()=>`${r.value}-nav-operations-hidden`),N=W(0),V=W(0);Ce(()=>{m.value?e.rtl?(N.value=0,V.value=Math.max(0,C.value-l.value)):(N.value=Math.min(0,l.value-C.value),V.value=0):(N.value=Math.min(0,u.value-K.value),V.value=0)});const Y=f=>f<N.value?N.value:f>V.value?V.value:f,ue=W(),[z,ve]=D(),pe=()=>{ve(Date.now())},be=()=>{clearTimeout(ue.value)},$e=(f,p)=>{f(S=>Y(S+p))};ea(n,(f,p)=>{if(m.value){if(l.value>=C.value)return!1;$e(y,f)}else{if(u.value>=K.value)return!1;$e(w,p)}return be(),pe(),!0}),oe(z,()=>{be(),z.value&&(ue.value=setTimeout(()=>{ve(0)},100))});const de=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey;const p=I.value.get(f)||{width:0,height:0,left:0,right:0,top:0};if(m.value){let S=c.value;e.rtl?p.right<c.value?S=p.right:p.right+p.width>c.value+l.value&&(S=p.right+p.width-l.value):p.left<-c.value?S=-p.left:p.left+p.width>-c.value+l.value&&(S=-(p.left+p.width-l.value)),w(0),y(Y(S))}else{let S=x.value;p.top<-x.value?S=-p.top:p.top+p.height>-x.value+u.value&&(S=-(p.top+p.height-u.value)),y(0),w(Y(S))}},Pe=W(0),Re=W(0);Ce(()=>{let f,p,S,P,L,B;const U=I.value;["top","bottom"].includes(e.tabPosition)?(f="width",P=l.value,L=C.value,B=E.value,p=e.rtl?"right":"left",S=Math.abs(c.value)):(f="height",P=u.value,L=C.value,B=G.value,p="top",S=-x.value);let O=P;L+B>P&&L<P&&(O=P-B);const F=o.value;if(!F.length)return[Pe.value,Re.value]=[0,0];const Z=F.length;let ne=Z;for(let X=0;X<Z;X+=1){const ee=U.get(F[X].key)||Je;if(ee[p]+ee[f]>S+O){ne=X-1;break}}let A=0;for(let X=Z-1;X>=0;X-=1)if((U.get(F[X].key)||Je)[p]<S){A=X+1;break}return[Pe.value,Re.value]=[A,ne]});const Ne=()=>{ce(()=>{var f;const p=new Map,S=(f=s.value)===null||f===void 0?void 0:f.getBoundingClientRect();return o.value.forEach(P=>{let{key:L}=P;const B=_.value.get(L),U=B?.$el||B;if(U){const[O,F,Z,ne]=aa(U,S);p.set(L,{width:O,height:F,left:Z,top:ne})}}),p})};oe(()=>o.value.map(f=>f.key).join("%%"),()=>{Ne()},{flush:"post"});const Ie=()=>{var f,p,S,P,L;const B=((f=n.value)===null||f===void 0?void 0:f.offsetWidth)||0,U=((p=n.value)===null||p===void 0?void 0:p.offsetHeight)||0,O=((S=d.value)===null||S===void 0?void 0:S.$el)||{},F=O.offsetWidth||0,Z=O.offsetHeight||0;g(B),$(U),R(F),le(Z);const ne=(((P=s.value)===null||P===void 0?void 0:P.offsetWidth)||0)-F,A=(((L=s.value)===null||L===void 0?void 0:L.offsetHeight)||0)-Z;k(ne),M(A),Ne()},Oe=H(()=>[...o.value.slice(0,Pe.value),...o.value.slice(Re.value+1)]),[ct,ut]=D(),ae=H(()=>I.value.get(e.activeKey)),We=W(),He=()=>{ge.cancel(We.value)};oe([ae,m,()=>e.rtl],()=>{const f={};ae.value&&(m.value?(e.rtl?f.right=me(ae.value.right):f.left=me(ae.value.left),f.width=me(ae.value.width)):(f.top=me(ae.value.top),f.height=me(ae.value.height))),He(),We.value=ge(()=>{ut(f)})}),oe([()=>e.activeKey,ae,I,m],()=>{de()},{flush:"post"}),oe([()=>e.rtl,()=>e.tabBarGutter,()=>e.activeKey,()=>o.value],()=>{Ie()},{flush:"post"});const Ee=f=>{let{position:p,prefixCls:S,extra:P}=f;if(!P)return null;const L=P?.({position:p});return L?h("div",{class:`${S}-extra-content`},[L]):null};return Me(()=>{be(),He()}),()=>{const{id:f,animated:p,activeKey:S,rtl:P,editable:L,locale:B,tabPosition:U,tabBarGutter:O,onTabClick:F}=e,{class:Z,style:ne}=a,A=r.value,X=!!Oe.value.length,ee=`${A}-nav-wrap`;let Be,Le,ze,Ke;m.value?P?(Le=c.value>0,Be=c.value+l.value<C.value):(Be=c.value<0,Le=-c.value+l.value<C.value):(ze=x.value<0,Ke=-x.value+u.value<K.value);const ye={};U==="top"||U==="bottom"?ye[P?"marginRight":"marginLeft"]=typeof O=="number"?`${O}px`:O:ye.marginTop=typeof O=="number"?`${O}px`:O;const Ge=o.value.map((Ae,vt)=>{const{key:fe}=Ae;return h(Yt,{id:f,prefixCls:A,key:fe,tab:Ae,style:vt===0?void 0:ye,closable:Ae.closable,editable:L,active:fe===S,removeAriaLabel:B?.removeAriaLabel,ref:b(fe),onClick:pt=>{F(fe,pt)},onFocus:()=>{de(fe),pe(),n.value&&(P||(n.value.scrollLeft=0),n.value.scrollTop=0)}},i)});return h("div",{role:"tablist",class:ie(`${A}-nav`,Z),style:ne,onKeydown:()=>{pe()}},[h(Ee,{position:"left",prefixCls:A,extra:i.leftExtra},null),h(Xe,{onResize:Ie},{default:()=>[h("div",{class:ie(ee,{[`${ee}-ping-left`]:Be,[`${ee}-ping-right`]:Le,[`${ee}-ping-top`]:ze,[`${ee}-ping-bottom`]:Ke}),ref:n},[h(Xe,{onResize:Ie},{default:()=>[h("div",{ref:s,class:`${A}-nav-list`,style:{transform:`translate(${c.value}px, ${x.value}px)`,transition:z.value?"none":void 0}},[Ge,h(rt,{ref:d,prefixCls:A,locale:B,editable:L,style:T(T({},Ge.length===0?void 0:ye),{visibility:X?"hidden":null})},null),h("div",{class:ie(`${A}-ink-bar`,{[`${A}-ink-bar-animated`]:p.inkBar}),style:ct.value},null)])]})])]}),h(qt,te(te({},e),{},{removeAriaLabel:B?.removeAriaLabel,ref:v,prefixCls:A,tabs:Oe.value,class:!X&&Q.value}),it(i,["moreIcon"])),h(Ee,{position:"right",prefixCls:A,extra:i.rightExtra},null),h(Ee,{position:"right",prefixCls:A,extra:i.tabBarExtraContent},null)])}}}),na=re({compatConfig:{MODE:3},name:"TabPanelList",inheritAttrs:!1,props:{activeKey:{type:[String,Number]},id:{type:String},rtl:{type:Boolean},animated:{type:Object,default:void 0},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean}},setup(e){const{tabs:t,prefixCls:a}=st();return()=>{const{id:i,activeKey:o,animated:r,tabPosition:n,rtl:s,destroyInactiveTabPane:v}=e,d=r.tabPane,b=a.value,_=t.value.findIndex(m=>m.key===o);return h("div",{class:`${b}-content-holder`},[h("div",{class:[`${b}-content`,`${b}-content-${n}`,{[`${b}-content-animated`]:d}],style:_&&d?{[s?"marginRight":"marginLeft"]:`-${_}00%`}:null},[t.value.map(m=>Ht(m.node,{key:m.key,prefixCls:b,tabKey:m.key,id:i,animated:d,active:m.key===o,destroyInactiveTabPane:v}))])])}}}),oa=e=>{const{componentCls:t,motionDurationSlow:a}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${a}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${a}`}}}}},[Ve(e,"slide-up"),Ve(e,"slide-down")]]},ia=e=>{const{componentCls:t,tabsCardHorizontalPadding:a,tabsCardHeadBackground:i,tabsCardGutter:o,colorSplit:r}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:a,background:i,border:`${e.lineWidth}px ${e.lineType} ${r}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:e.colorPrimary,background:e.colorBgContainer},[`${t}-ink-bar`]:{visibility:"hidden"}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:`${o}px`}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:`${o}px`}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadiusLG}px 0 0 ${e.borderRadiusLG}px`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},ra=e=>{const{componentCls:t,tabsHoverColor:a,dropdownEdgeChildVerticalPadding:i}=e;return{[`${t}-dropdown`]:T(T({},tt(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${i}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":T(T({},mt),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:`${e.paddingXXS}px ${e.paddingSM}px`,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:a}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},la=e=>{const{componentCls:t,margin:a,colorSplit:i}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:"column",[`> ${t}-nav, > div > ${t}-nav`]:{margin:`0 0 ${a}px 0`,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${e.lineWidth}px ${e.lineType} ${i}`,content:"''"},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow},
|
|
2
2
|
right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav,
|
|
3
3
|
> div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:`${a}px`,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:"column",minWidth:e.controlHeight*1.25,[`${t}-tab`]:{padding:`${e.paddingXS}px ${e.paddingLG}px`,textAlign:"center"},[`${t}-tab + ${t}-tab`]:{margin:`${e.margin}px 0 0 0`},[`${t}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${e.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-e.lineWidth},borderRight:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},sa=e=>{const{componentCls:t,padding:a}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px 0`,fontSize:e.fontSize}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${a}px 0`,fontSize:e.fontSizeLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXXS*1.5}px ${a}px`}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${e.borderRadius}px ${e.borderRadius}px`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadius}px ${e.borderRadius}px 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadius}px 0 0 ${e.borderRadius}px`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px ${a}px ${e.paddingXXS*1.5}px`}}}}}},da=e=>{const{componentCls:t,tabsActiveColor:a,tabsHoverColor:i,iconCls:o,tabsHorizontalGutter:r}=e,n=`${t}-tab`;return{[n]:{position:"relative",display:"inline-flex",alignItems:"center",padding:`${e.paddingSM}px 0`,fontSize:`${e.fontSize}px`,background:"transparent",border:0,outline:"none",cursor:"pointer","&-btn, &-remove":T({"&:focus:not(:focus-visible), &:active":{color:a}},at(e)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-e.marginXXS},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},"&:hover":{color:i},[`&${n}-active ${n}-btn`]:{color:e.colorPrimary,textShadow:e.tabsActiveTextShadow},[`&${n}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${n}-disabled ${n}-btn, &${n}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${n}-remove ${o}`]:{margin:0},[o]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${n} + ${n}`]:{margin:{_skip_check_:!0,value:`0 0 0 ${r}px`}}}},ca=e=>{const{componentCls:t,tabsHorizontalGutter:a,iconCls:i,tabsCardGutter:o}=e;return{[`${t}-rtl`]:{direction:"rtl",[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:`0 0 0 ${a}px`},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[i]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${e.marginSM}px`}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${e.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${e.marginXXS}px`},[i]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:`${o}px`},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:"rtl"},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},ua=e=>{const{componentCls:t,tabsCardHorizontalPadding:a,tabsCardHeight:i,tabsCardGutter:o,tabsHoverColor:r,tabsActiveColor:n,colorSplit:s}=e;return{[t]:T(T(T(T({},tt(e)),{display:"flex",[`> ${t}-nav, > div > ${t}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${t}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${t}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${t}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${t}-nav-more`]:{position:"relative",padding:a,background:"transparent",border:0,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${t}-nav-add`]:T({minWidth:`${i}px`,marginLeft:{_skip_check_:!0,value:`${o}px`},padding:`0 ${e.paddingXS}px`,background:"transparent",border:`${e.lineWidth}px ${e.lineType} ${s}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:r},"&:active, &:focus:not(:focus-visible)":{color:n}},at(e))},[`${t}-extra-content`]:{flex:"none"},[`${t}-ink-bar`]:{position:"absolute",background:e.colorPrimary,pointerEvents:"none"}}),da(e)),{[`${t}-content`]:{position:"relative",display:"flex",width:"100%","&-animated":{transition:"margin 0.3s"}},[`${t}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${t}-tabpane`]:{outline:"none",flex:"none",width:"100%"}}),[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},va=bt("Tabs",e=>{const t=e.controlHeightLG,a=ft(e,{tabsHoverColor:e.colorPrimaryHover,tabsActiveColor:e.colorPrimaryActive,tabsCardHorizontalPadding:`${(t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth}px ${e.padding}px`,tabsCardHeight:t,tabsCardGutter:e.marginXXS/2,tabsHorizontalGutter:32,tabsCardHeadBackground:e.colorFillAlter,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120});return[sa(a),ca(a),la(a),ra(a),ia(a),ua(a),oa(a)]},e=>({zIndexPopup:e.zIndexPopupBase+50}));let et=0;const dt=()=>({prefixCls:{type:String},id:{type:String},popupClassName:String,getPopupContainer:j(),activeKey:{type:[String,Number]},defaultActiveKey:{type:[String,Number]},direction:xe(),animated:_t([Boolean,Object]),renderTabBar:j(),tabBarGutter:{type:Number},tabBarStyle:he(),tabPosition:xe(),destroyInactiveTabPane:St(),hideAdd:Boolean,type:xe(),size:xe(),centered:Boolean,onEdit:j(),onChange:j(),onTabClick:j(),onTabScroll:j(),"onUpdate:activeKey":j(),locale:he(),onPrevClick:j(),onNextClick:j(),tabBarExtraContent:we.any});function pa(e){return e.map(t=>{if(gt(t)){const a=T({},t.props||{});for(const[m,c]of Object.entries(a))delete a[m],a[$t(m)]=c;const i=t.children||{},o=t.key!==void 0?t.key:void 0,{tab:r=i.tab,disabled:n,forceRender:s,closable:v,animated:d,active:b,destroyInactiveTabPane:_}=a;return T(T({key:o},a),{node:t,closeIcon:i.closeIcon,tab:r,disabled:n===""||n,forceRender:s===""||s,closable:v===""||v,animated:d===""||d,active:b===""||b,destroyInactiveTabPane:_===""||_})}return null}).filter(t=>t)}const ba=re({compatConfig:{MODE:3},name:"InternalTabs",inheritAttrs:!1,props:T(T({},ot(dt(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}})),{tabs:xt()}),slots:Object,setup(e,t){let{attrs:a,slots:i}=t;De(e.onPrevClick===void 0&&e.onNextClick===void 0,"Tabs","`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."),De(e.tabBarExtraContent===void 0,"Tabs","`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."),De(i.tabBarExtraContent===void 0,"Tabs","`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");const{prefixCls:o,direction:r,size:n,rootPrefixCls:s,getPopupContainer:v}=yt("tabs",e),[d,b]=va(o),_=H(()=>r.value==="rtl"),m=H(()=>{const{animated:u,tabPosition:$}=e;return u===!1||["left","right"].includes($)?{inkBar:!1,tabPane:!1}:u===!0?{inkBar:!0,tabPane:!0}:T({inkBar:!0,tabPane:!1},typeof u=="object"?u:{})}),[c,y]=D(!1);Te(()=>{y(zt())});const[x,w]=je(()=>{var u;return(u=e.tabs[0])===null||u===void 0?void 0:u.key},{value:H(()=>e.activeKey),defaultValue:e.defaultActiveKey}),[C,k]=D(()=>e.tabs.findIndex(u=>u.key===x.value));Ce(()=>{var u;let $=e.tabs.findIndex(E=>E.key===x.value);$===-1&&($=Math.max(0,Math.min(C.value,e.tabs.length-1)),w((u=e.tabs[$])===null||u===void 0?void 0:u.key)),k($)});const[K,M]=je(null,{value:H(()=>e.id)}),l=H(()=>c.value&&!["left","right"].includes(e.tabPosition)?"top":e.tabPosition);Te(()=>{e.id||(M(`rc-tabs-${et}`),et+=1)});const g=(u,$)=>{var E,R;(E=e.onTabClick)===null||E===void 0||E.call(e,u,$);const G=u!==x.value;w(u),G&&((R=e.onChange)===null||R===void 0||R.call(e,u))};return Jt({tabs:H(()=>e.tabs),prefixCls:o}),()=>{const{id:u,type:$,tabBarGutter:E,tabBarStyle:R,locale:G,destroyInactiveTabPane:le,renderTabBar:se=i.renderTabBar,onTabScroll:ce,hideAdd:I,centered:Q}=e,N={id:K.value,activeKey:x.value,animated:m.value,tabPosition:l.value,rtl:_.value,mobile:c.value};let V;$==="editable-card"&&(V={onEdit:(ve,pe)=>{let{key:be,event:$e}=pe;var de;(de=e.onEdit)===null||de===void 0||de.call(e,ve==="add"?$e:be,ve)},removeIcon:()=>h(Bt,null,null),addIcon:i.addIcon?i.addIcon:()=>h(Et,null,null),showAdd:I!==!0});let Y;const ue=T(T({},N),{moreTransitionName:`${s.value}-slide-up`,editable:V,locale:G,tabBarGutter:E,onTabClick:g,onTabScroll:ce,style:R,getPopupContainer:v.value,popupClassName:ie(e.popupClassName,b.value)});se?Y=se(T(T({},ue),{DefaultTabBar:Qe})):Y=h(Qe,ue,it(i,["moreIcon","leftExtra","rightExtra","tabBarExtraContent"]));const z=o.value;return d(h("div",te(te({},a),{},{id:u,class:ie(z,`${z}-${l.value}`,{[b.value]:!0,[`${z}-${n.value}`]:n.value,[`${z}-card`]:["card","editable-card"].includes($),[`${z}-editable-card`]:$==="editable-card",[`${z}-centered`]:Q,[`${z}-mobile`]:c.value,[`${z}-editable`]:$==="editable-card",[`${z}-rtl`]:_.value},a.class)}),[Y,h(na,te(te({destroyInactiveTabPane:le},N),{},{animated:m.value}),null)]))}}}),_e=re({compatConfig:{MODE:3},name:"ATabs",inheritAttrs:!1,props:ot(dt(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}}),slots:Object,setup(e,t){let{attrs:a,slots:i,emit:o}=t;const r=n=>{o("update:activeKey",n),o("change",n)};return()=>{var n;const s=pa(ht((n=i.default)===null||n===void 0?void 0:n.call(i)));return h(ba,te(te(te({},Kt(e,["onUpdate:activeKey"])),a),{},{onChange:r,tabs:s}),i)}}}),fa=()=>({tab:we.any,disabled:{type:Boolean},forceRender:{type:Boolean},closable:{type:Boolean},animated:{type:Boolean},active:{type:Boolean},destroyInactiveTabPane:{type:Boolean},prefixCls:{type:String},tabKey:{type:[String,Number]},id:{type:String}}),ke=re({compatConfig:{MODE:3},name:"ATabPane",inheritAttrs:!1,__ANT_TAB_PANE:!0,props:fa(),slots:Object,setup(e,t){let{attrs:a,slots:i}=t;const o=J(e.forceRender);oe([()=>e.active,()=>e.destroyInactiveTabPane],()=>{e.active?o.value=!0:e.destroyInactiveTabPane&&(o.value=!1)},{immediate:!0});const r=H(()=>e.active?{}:e.animated?{visibility:"hidden",height:0,overflowY:"hidden"}:{display:"none"});return()=>{var n;const{prefixCls:s,forceRender:v,id:d,active:b,tabKey:_}=e;return h("div",{id:d&&`${d}-panel-${_}`,role:"tabpanel",tabindex:b?0:-1,"aria-labelledby":d&&`${d}-tab-${_}`,"aria-hidden":!b,style:[r.value,a.style],class:[`${s}-tabpane`,b&&`${s}-tabpane-active`,a.class]},[(b||o.value||v)&&((n=i.default)===null||n===void 0?void 0:n.call(i))])}}});_e.TabPane=ke;_e.install=function(e){return e.component(_e.name,_e),e.component(ke.name,ke),e};export{ke as TabPane,_e as default};
|