chainlesschain 0.165.1 → 0.165.2
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/README.md +248 -2
- package/package.json +4 -1
- package/src/assets/web-panel/assets/{AIOps-CYxFDrcm.js → AIOps-lS1R0Cza.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-CPBtdiU2.js → ActionButton-BmlgBPsj.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-Dayq7Dp7.js → Analytics-CNKczv1S.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-6U7bPb2s.js → AppLayout-BuZGJARQ.js} +4 -4
- package/src/assets/web-panel/assets/{Artifacts-D2Iqg_3D.js → Artifacts-Dm73Sl-O.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-CdoOB7WV.js → Audit-BGMW7A5e.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-DrnAVB8w.js → BackgroundAgents-BQ6M54JR.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-CesMi5cy.js → Backup-DBzGP0bR.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-DaX9ptax.js → BaseInput-D1mLCoOV.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-OrwOPxDS.js → Chat-BUfcN7p8.js} +4 -4
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-CvPZFRxM.js → ChatBubbleRenderer-CY5m8ZHg.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-DiHbcysC.js → Checkbox-Du0Yg5Pi.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-CbgCkaBJ.js → Codegen-B2RXziHW.js} +1 -1
- package/src/assets/web-panel/assets/{Col-Du5hgrh4.js → Col-DWhekOrR.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DsPOBW-p.js → Community-HQhrkon4.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BwHIFkNC.js → Compact-izHNb4uz.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-BvrDQSgd.js → Compliance-BDwLy41-.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-gwAE6arx.js → Cowork-DFJhLa7K.js} +3 -3
- package/src/assets/web-panel/assets/{Cron-DW-0l4uF.js → Cron-DYY9RG7-.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-j-NsLesB.js → Crosschain-rr7tJTtv.js} +1 -1
- package/src/assets/web-panel/assets/{DID-CibVEBOI.js → DID-D2sfHRLi.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-W4z9vSfe.js → Dashboard-q_eGdhha.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-DAcrkKxG.js → Dropdown-Cufrh2Bz.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-6GXah-89.js → EmailListRenderer-B-kdv10f.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-TKDCq8Ku.js → FamilyGuardDashboard-D21XjgfG.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-BXBLlcNm.js → Federation-CAwRTLZH.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-BoJJBkG3.js → FormItemContext-vx3daNDF.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-okjsl46v.js → GenericCardRenderer-CRWY2wU4.js} +1 -1
- package/src/assets/web-panel/assets/{Git-Rvs7i6nn.js → Git-Q6SwauyD.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-CHSUxXXS.js → Governance-BJ1q4IQZ.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-V3BlfxsB.js → Inference-CSWjROgD.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-C_NlD4aR.js → KnowledgeGraph-fzuQsWuY.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-Nn4LNxhA.js → Logs-DVF8Mnns.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-BLif4QSg.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-DEmjFcg-.js → Marketplace-BQP7LOA4.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-DlopXipI.js → McpTools-BNlJCmNc.js} +4 -4
- package/src/assets/web-panel/assets/{Memory-BG3ynX60.js → Memory-DLLg5WQ4.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-DeRzWOfT.js → MobileBridge-CR2skNAF.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-Tyd3o2A0.js → MobileProjects-BxVavObl.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-BoPbOv1C.js → Mtc-B17pgqMI.js} +4 -4
- package/src/assets/web-panel/assets/{MtcAudit-un-rTHp7.js → MtcAudit-4UmV5cIL.js} +2 -2
- package/src/assets/web-panel/assets/{Multisig-Ds0oveEB.js → Multisig-DoMEXEcU.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-D09JI-yY.js → NLProgramming-h9DMXFX4.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-DTRhiKJn.js → Notes-Cihn-xX8.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-BAnnNCim.js → NotificationSettings-BE6ZGa3R.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-Yr-1fSYi.js → OrderTableRenderer-CnwojoSI.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-S9EAolpj.js → Organization-B2vpwmjb.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-CqcLKqJ8.js → Overflow-C4z28R0-.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-Dw0F9EcU.js → P2P-BVlFkwhW.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-BDRwUevN.js → PdhVaultBrowser-BXbEdL5B.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-D3_c3nKB.js → Permissions-C28xs4lp.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-CxdMV98x.js → PersonalDataHub-Dgl_rBjM.js} +3 -3
- package/src/assets/web-panel/assets/{Pipeline-CgjNQFLI.js → Pipeline-3QUIhrKI.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-BHghIIht.js → Privacy-8Gh33OZ5.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-De6pqaKM.js → ProjectInit-BNmg4tZi.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-Bg4ZkNYQ.js → ProjectSettings-vgMfeCf9.js} +2 -2
- package/src/assets/web-panel/assets/Projects-BhtAVilc.js +1 -0
- package/src/assets/web-panel/assets/{Providers-CUnHbNf-.js → Providers-CXoOa8eX.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-DA2f3Wts.js → QrScannerModal-BhfTF0oS.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-C1FeHDqp.js → QuickAsk-C746HEAj.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-B5guaUMN.js → Recommend-BSej8Eo0.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-PDADSds3.js → RemoteSession-f3gmnlG3.js} +3 -3
- package/src/assets/web-panel/assets/{Reputation-eTlRhgvK.js → Reputation-CyvybpkN.js} +1 -1
- package/src/assets/web-panel/assets/{Row-D7AqSGY0.js → Row-DwV2PeYn.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-JiuLm4Ja.js → RssFeed-11GrzjZy.js} +3 -3
- package/src/assets/web-panel/assets/{Search-CwruahW3.js → Search-BjKXkrAY.js} +1 -1
- package/src/assets/web-panel/assets/{Security-CdhqaR0b.js → Security-eWiFb9Yk.js} +4 -4
- package/src/assets/web-panel/assets/{Services-CU0ZIlcT.js → Services-CdCsMAtt.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-CtduPfAb.js → Skeleton-4Q2UTKQ5.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-CROXm6AY.js → Skills-v4rtYrRj.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-DiZiABFD.js → Sla-CRhsFvd_.js} +1 -1
- package/src/assets/web-panel/assets/SpeechSettings-DLjKsDVu.js +1 -0
- package/src/assets/web-panel/assets/{SyncSettings-DBX6J1Oe.js → SyncSettings-D16zonl7.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-BLyRJd3-.js → Tasks-Xxozz0i_.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-BKa5qzmk.js → Templates-CXJpPtCT.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-DnD3a4M6.js → Tenant-XRV0L1ZF.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-DEitQeTb.js → Terminal-CYuO1i_w.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-CjHggTDq.js → TimelineRenderer-BXqitWsu.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-CsGT7sfl.js → Tokens-BvPrDHIy.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-yr4rFDrW.js → Trigger-DhCrSTf5.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-CLvu1Sjp.js → Trust-DmsuZD6K.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-B0m7yUP8.js → UkeySign-D_yrts5C.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-C0VvP4lc.js → VideoEditing-B01ihPrm.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-kllBAG1M.js → Wallet-DpUjKa-N.js} +3 -3
- package/src/assets/web-panel/assets/{WebAuthn-C54UQNLx.js → WebAuthn-CL07yON6.js} +3 -3
- package/src/assets/web-panel/assets/{WorkflowEditor-B7y8qSvU.js → WorkflowEditor-CLMflnRr.js} +1 -1
- package/src/assets/web-panel/assets/{chat-DRzTh8CJ.js → chat-DtUqe8h_.js} +1 -1
- package/src/assets/web-panel/assets/{colors-BSMwSnCx.js → colors-DPKrgVfy.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-BTg602H5.js → compact-item-BTt2GtOm.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-B6EGsdvp.js → createContext-D_VeUc1J.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-Bj5nUW2v.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-DDKqJ8RD.js → hasIn-1kndiylj.js} +1 -1
- package/src/assets/web-panel/assets/{index-CUEU48o1.js → index-2eyAXE3d.js} +1 -1
- package/src/assets/web-panel/assets/{index-rjzk9z1Q.js → index-4bna2_SR.js} +1 -1
- package/src/assets/web-panel/assets/{index-CmAubjDi.js → index-8nz_fmlj.js} +1 -1
- package/src/assets/web-panel/assets/{index-Co7oM1qr.js → index-B9KvcS7R.js} +1 -1
- package/src/assets/web-panel/assets/{index-BMuGd2--.js → index-BAXfRKfG.js} +1 -1
- package/src/assets/web-panel/assets/{index-BVTAl5N2.js → index-BHpBMWCh.js} +1 -1
- package/src/assets/web-panel/assets/{index-DpTHIRfZ.js → index-BaZAbw9A.js} +1 -1
- package/src/assets/web-panel/assets/{index-CWGax2QW.js → index-BepLZwgB.js} +1 -1
- package/src/assets/web-panel/assets/{index-DiW0sDkz.js → index-Bhudc_Ez.js} +1 -1
- package/src/assets/web-panel/assets/{index-CGNklbP6.js → index-BlDNVgBt.js} +1 -1
- package/src/assets/web-panel/assets/{index-u2YVld9W.js → index-By5n8up9.js} +1 -1
- package/src/assets/web-panel/assets/{index-pqfux8vZ.js → index-CHG-KcS4.js} +1 -1
- package/src/assets/web-panel/assets/index-CPcM-eqo.js +1 -0
- package/src/assets/web-panel/assets/{index-BRqt4fO-.js → index-CX81qSM4.js} +1 -1
- package/src/assets/web-panel/assets/{index-BsR7Y2NG.js → index-CauoBQkH.js} +1 -1
- package/src/assets/web-panel/assets/{index-C_JzIXUq.js → index-CcO04eDn.js} +1 -1
- package/src/assets/web-panel/assets/{index-CQlHFN_g.js → index-CtF7EN49.js} +1 -1
- package/src/assets/web-panel/assets/{index-CwPUZbMI.js → index-CzjkKUmR.js} +1 -1
- package/src/assets/web-panel/assets/{index-th2ihDc0.js → index-D95OFht7.js} +1 -1
- package/src/assets/web-panel/assets/{index-CHfLYwcW.js → index-DFIZ_1Sf.js} +1 -1
- package/src/assets/web-panel/assets/{index-C1GFfuqN.js → index-DG2MZQ3f.js} +1 -1
- package/src/assets/web-panel/assets/{index-D1naNj4U.js → index-DJ8vXGOa.js} +1 -1
- package/src/assets/web-panel/assets/{index-DLdrHhML.js → index-Dbbymxpj.js} +1 -1
- package/src/assets/web-panel/assets/{index-DBT3YeQ9.js → index-DdkplL9R.js} +1 -1
- package/src/assets/web-panel/assets/{index-BICn3Qh1.js → index-DfGl8CqG.js} +1 -1
- package/src/assets/web-panel/assets/{index-DqFXGzzC.js → index-DfKBRdSS.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bx044qDj.js → index-DsJCDUJG.js} +1 -1
- package/src/assets/web-panel/assets/{index-XFe-1twF.js → index-Dwqmtk65.js} +1 -1
- package/src/assets/web-panel/assets/{index-C66NpWy5.js → index-DxdTdBix.js} +1 -1
- package/src/assets/web-panel/assets/{index-CmAInUkX.js → index-FzdwcSy2.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cf23wVMs.js → index-GsoUQ2M7.js} +1 -1
- package/src/assets/web-panel/assets/{index-D5CsBShd.js → index-brCInrzq.js} +1 -1
- package/src/assets/web-panel/assets/{index-323Hhxxt.js → index-dVc-CXY4.js} +1 -1
- package/src/assets/web-panel/assets/{index-p2HYn89m.js → index-fk2Rjacw.js} +3 -3
- package/src/assets/web-panel/assets/{index-Dfv2lKu3.js → index-l1BETrDb.js} +1 -1
- package/src/assets/web-panel/assets/{index-CNxg61YP.js → index-m31Ka8hZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-CDTvsX8t.js → index-ocf06EVQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dc77VR3H.js → index-sDoMHTNA.js} +1 -1
- package/src/assets/web-panel/assets/index-xeSyVoRe.js +1 -0
- package/src/assets/web-panel/assets/{initDefaultProps-C3Djh9fa.js → initDefaultProps-CvyYJd7z.js} +1 -1
- package/src/assets/web-panel/assets/{motion-BzqFmbSe.js → motion-DYZkhUdz.js} +1 -1
- package/src/assets/web-panel/assets/{move-DJo_FFaW.js → move-slnJRVT1.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-_tlTiBvk.js → mtc-parser-DVc0CKmy.js} +1 -1
- package/src/assets/web-panel/assets/{omit-CB2ZyxUg.js → omit-BCXAtHCq.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-DZwIFD4u.js → pickAttrs-DBsemz_K.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-DxZY0dgk.js → placementArrow-BRtkJ-nv.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-CzzGt7GL.js → responsiveObserve-Cebq7EZn.js} +1 -1
- package/src/assets/web-panel/assets/{slide-BaIK52yz.js → slide-DT7qvId2.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-3-FHu9_M.js → statusUtils-pQiITLkG.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-BkRT68fK.js → styleChecker-c-19BVKQ.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-DHYwKS-s.js → useFlexGapSupport-DsS5-0bE.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-DVVUhV8p.js → useFs-CxGiMe5n.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-CkrFKAzQ.js → usePersonalDataHub-D9btVID5.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-BuBLFz0c.js → vnode-CUYFsFEN.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-kpm6LtXU.js → zoom-CXmn_35j.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +1 -1
- package/src/commands/cowork.js +280 -5
- package/src/commands/plugin.js +819 -64
- package/src/commands/session-location.js +318 -7
- package/src/constants.js +2 -2
- package/src/data/changelog.json +14 -1
- package/src/gateways/ws/action-protocol.js +1 -1
- package/src/harness/jsonl-session-store.js +638 -2
- package/src/harness/prompt-compressor.js +4 -0
- package/src/lib/background-agent-keeper-client.js +29 -0
- package/src/lib/background-agent-keeper-protocol.js +4 -0
- package/src/lib/background-agent-supervisor.js +59 -29
- package/src/lib/cowork-task-runner.js +70 -0
- package/src/lib/cowork-workflow.js +42 -9
- package/src/lib/doctor-checkup.js +34 -10
- package/src/lib/dynamic-workflow-draft.js +535 -0
- package/src/lib/dynamic-workflow-facade.js +11 -11
- package/src/lib/dynamic-workflow-runtime.js +2974 -0
- package/src/lib/execution-location-contract.js +111 -7
- package/src/lib/execution-location-runtime.js +3 -1
- package/src/lib/execution-location-target.js +910 -0
- package/src/lib/llm-providers.js +1 -0
- package/src/lib/mcp-call-ledger-store.js +35 -0
- package/src/lib/mcp-call-ledger.js +30 -0
- package/src/lib/plugin-runtime/__tests__/remote-source.test.js +34 -16
- package/src/lib/plugin-runtime/install.js +4956 -657
- package/src/lib/plugin-runtime/manifest.js +3 -1
- package/src/lib/plugin-runtime/marketplace-artifact-readback.js +671 -31
- package/src/lib/plugin-runtime/marketplace-catalog.js +68 -2
- package/src/lib/plugin-runtime/marketplace-impact.js +208 -15
- package/src/lib/plugin-runtime/marketplace-network.js +317 -0
- package/src/lib/plugin-runtime/marketplace-pac-worker.js +15 -0
- package/src/lib/plugin-runtime/marketplace-remote-artifacts.js +25 -2
- package/src/lib/plugin-runtime/marketplace-source-cache.js +359 -0
- package/src/lib/plugin-runtime/policy.js +21 -6
- package/src/lib/plugin-runtime/publisher-trust.js +332 -0
- package/src/lib/plugin-runtime/remote-source.js +323 -27
- package/src/lib/plugin-runtime/scopes.js +317 -41
- package/src/lib/plugin-runtime/transaction-journal.js +806 -0
- package/src/lib/public-ide-capability-manifest.js +1 -1
- package/src/lib/remote-membership-coordinator.js +8 -6
- package/src/lib/sub-agent-context.js +268 -2
- package/src/lib/task-model-selector.js +1 -1
- package/src/lib/with-file-lock.js +95 -5
- package/src/runtime/agent-core.js +595 -41
- package/src/workers/background-agent-keeper.js +40 -10
- package/src/assets/web-panel/assets/MarkdownRenderer-SVAgNnkt.js +0 -1
- package/src/assets/web-panel/assets/Projects-CP8vPvzs.js +0 -1
- package/src/assets/web-panel/assets/SpeechSettings-B5pLcXUw.js +0 -1
- package/src/assets/web-panel/assets/devWarning-Dol8jLEP.js +0 -1
- package/src/assets/web-panel/assets/index-C3QX5tOl.js +0 -1
- package/src/assets/web-panel/assets/index-xYybvEic.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,i as F,P as T,q as L,N as lt,l as it,m as st,r as Y,K as O,f as z,a1 as ut,L as ct,g as dt}from"./index-p2HYn89m.js";import{d as W,b as f,a as mt,w as J,x as gt,c as v,r as R,a6 as bt,a3 as ft,a4 as vt}from"./vendor-Bn1JzzAn.js";import{c as Q}from"./vnode-BuBLFz0c.js";import{g as q,i as k}from"./colors-BSMwSnCx.js";import{i as pt}from"./isNumeric-DjvBa-1E.js";import"./icons-DG5UD-6K.js";function G(t){let{prefixCls:o,value:a,current:e,offset:n=0}=t,c;return n&&(c={position:"absolute",top:`${n}00%`,left:0}),v("p",{style:c,class:F(`${o}-only-unit`,{current:e})},[a])}function ht(t,o,a){let e=t,n=0;for(;(e+10)%10!==o;)e+=a,n+=a;return n}const $t=W({compatConfig:{MODE:3},name:"SingleNumber",props:{prefixCls:String,value:String,count:Number},setup(t){const o=f(()=>Number(t.value)),a=f(()=>Math.abs(t.count)),e=mt({prevValue:o.value,prevCount:a.value}),n=()=>{e.prevValue=o.value,e.prevCount=a.value},c=R();return J(o,()=>{clearTimeout(c.value),c.value=setTimeout(()=>{n()},1e3)},{flush:"post"}),gt(()=>{clearTimeout(c.value)}),()=>{let d,p={};const s=o.value;if(e.prevValue===s||Number.isNaN(s)||Number.isNaN(e.prevValue))d=[G(i(i({},t),{current:!0}))],p={transition:"none"};else{d=[];const h=s+10,m=[];for(let r=s;r<=h;r+=1)m.push(r);const l=m.findIndex(r=>r%10===e.prevValue);d=m.map((r,y)=>{const $=r%10;return G(i(i({},t),{value:$,offset:y-l,current:y===l}))});const u=e.prevCount<a.value?1:-1;p={transform:`translateY(${-ht(e.prevValue,s,u)}00%)`}}return v("span",{class:`${t.prefixCls}-only`,style:p,onTransitionend:()=>n()},[d])}}});var St=function(t,o){var a={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(a[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(t);n<e.length;n++)o.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(a[e[n]]=t[e[n]]);return a};const yt={prefixCls:String,count:T.any,component:String,title:T.any,show:Boolean},Ct=W({compatConfig:{MODE:3},name:"ScrollNumber",inheritAttrs:!1,props:yt,setup(t,o){let{attrs:a,slots:e}=o;const{prefixCls:n}=L("scroll-number",t);return()=>{var c;const d=i(i({},t),a),{prefixCls:p,count:s,title:h,show:m,component:l="sup",class:u,style:r}=d,y=St(d,["prefixCls","count","title","show","component","class","style"]),$=i(i({},y),{style:r,"data-show":t.show,class:F(n.value,u),title:h});let g=s;if(s&&Number(s)%1===0){const b=String(s).split("");g=b.map((P,B)=>v($t,{prefixCls:n.value,count:Number(s),value:P,key:b.length-B},null))}r&&r.borderColor&&($.style=i(i({},r),{boxShadow:`0 0 0 1px ${r.borderColor} inset`}));const S=lt((c=e.default)===null||c===void 0?void 0:c.call(e));return S&&S.length?Q(S,{class:F(`${n.value}-custom-component`)},!1):v(l,$,{default:()=>[g]})}}}),xt=new O("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),wt=new O("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),Nt=new O("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),Ot=new O("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),Pt=new O("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),Bt=new O("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),It=t=>{const{componentCls:o,iconCls:a,antCls:e,badgeFontHeight:n,badgeShadowSize:c,badgeHeightSm:d,motionDurationSlow:p,badgeStatusSize:s,marginXS:h,badgeRibbonOffset:m}=t,l=`${e}-scroll-number`,u=`${e}-ribbon`,r=`${e}-ribbon-wrapper`,y=q(t,(g,S)=>{let{darkColor:b}=S;return{[`&${o} ${o}-color-${g}`]:{background:b,[`&:not(${o}-count)`]:{color:b}}}}),$=q(t,(g,S)=>{let{darkColor:b}=S;return{[`&${u}-color-${g}`]:{background:b,color:b}}});return{[o]:i(i(i(i({},Y(t)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${o}-count`]:{zIndex:t.badgeZIndex,minWidth:t.badgeHeight,height:t.badgeHeight,color:t.badgeTextColor,fontWeight:t.badgeFontWeight,fontSize:t.badgeFontSize,lineHeight:`${t.badgeHeight}px`,whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:t.badgeHeight/2,boxShadow:`0 0 0 ${c}px ${t.badgeShadowColor}`,transition:`background ${t.motionDurationMid}`,a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},[`${o}-count-sm`]:{minWidth:d,height:d,fontSize:t.badgeFontSizeSm,lineHeight:`${d}px`,borderRadius:d/2},[`${o}-multiple-words`]:{padding:`0 ${t.paddingXS}px`},[`${o}-dot`]:{zIndex:t.badgeZIndex,width:t.badgeDotSize,minWidth:t.badgeDotSize,height:t.badgeDotSize,background:t.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${c}px ${t.badgeShadowColor}`},[`${o}-dot${l}`]:{transition:`background ${p}`},[`${o}-count, ${o}-dot, ${l}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${a}-spin`]:{animationName:Bt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${o}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${o}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},[`${o}-status-success`]:{backgroundColor:t.colorSuccess},[`${o}-status-processing`]:{overflow:"visible",color:t.colorPrimary,backgroundColor:t.colorPrimary,"&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:c,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:xt,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${o}-status-default`]:{backgroundColor:t.colorTextPlaceholder},[`${o}-status-error`]:{backgroundColor:t.colorError},[`${o}-status-warning`]:{backgroundColor:t.colorWarning},[`${o}-status-text`]:{marginInlineStart:h,color:t.colorText,fontSize:t.fontSize}}}),y),{[`${o}-zoom-appear, ${o}-zoom-enter`]:{animationName:wt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${o}-zoom-leave`]:{animationName:Nt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${o}-not-a-wrapper`]:{[`${o}-zoom-appear, ${o}-zoom-enter`]:{animationName:Ot,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${o}-zoom-leave`]:{animationName:Pt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`&:not(${o}-status)`]:{verticalAlign:"middle"},[`${l}-custom-component, ${o}-count`]:{transform:"none"},[`${l}-custom-component, ${l}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[`${l}`]:{overflow:"hidden",[`${l}-only`]:{position:"relative",display:"inline-block",height:t.badgeHeight,transition:`all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${l}-only-unit`]:{height:t.badgeHeight,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${l}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${o}-count, ${o}-dot, ${l}-custom-component`]:{transform:"translate(-50%, -50%)"}}}),[`${r}`]:{position:"relative"},[`${u}`]:i(i(i(i({},Y(t)),{position:"absolute",top:h,padding:`0 ${t.paddingXS}px`,color:t.colorPrimary,lineHeight:`${n}px`,whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,[`${u}-text`]:{color:t.colorTextLightSolid},[`${u}-corner`]:{position:"absolute",top:"100%",width:m,height:m,color:"currentcolor",border:`${m/2}px solid`,transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter}}),$),{[`&${u}-placement-end`]:{insetInlineEnd:-m,borderEndEndRadius:0,[`${u}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${u}-placement-start`]:{insetInlineStart:-m,borderEndStartRadius:0,[`${u}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},tt=it("Badge",t=>{const{fontSize:o,lineHeight:a,fontSizeSM:e,lineWidth:n,marginXS:c,colorBorderBg:d}=t,p=Math.round(o*a),s=n,h="auto",m=p-2*s,l=t.colorBgContainer,u="normal",r=e,y=t.colorError,$=t.colorErrorHover,g=o,S=e/2,b=e,P=e/2,B=st(t,{badgeFontHeight:p,badgeShadowSize:s,badgeZIndex:h,badgeHeight:m,badgeTextColor:l,badgeFontWeight:u,badgeFontSize:r,badgeColor:y,badgeColorHover:$,badgeShadowColor:d,badgeHeightSm:g,badgeDotSize:S,badgeFontSizeSm:b,badgeStatusSize:P,badgeProcessingDuration:"1.2s",badgeRibbonOffset:c,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"});return[It(B)]});var zt=function(t,o){var a={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(a[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(t);n<e.length;n++)o.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(a[e[n]]=t[e[n]]);return a};const Tt=()=>({prefix:String,color:{type:String},text:T.any,placement:{type:String,default:"end"}}),V=W({compatConfig:{MODE:3},name:"ABadgeRibbon",inheritAttrs:!1,props:Tt(),slots:Object,setup(t,o){let{attrs:a,slots:e}=o;const{prefixCls:n,direction:c}=L("ribbon",t),[d,p]=tt(n),s=f(()=>k(t.color,!1)),h=f(()=>[n.value,`${n.value}-placement-${t.placement}`,{[`${n.value}-rtl`]:c.value==="rtl",[`${n.value}-color-${t.color}`]:s.value}]);return()=>{var m,l;const{class:u,style:r}=a,y=zt(a,["class","style"]),$={},g={};return t.color&&!s.value&&($.background=t.color,g.color=t.color),d(v("div",z({class:`${n.value}-wrapper ${p.value}`},y),[(m=e.default)===null||m===void 0?void 0:m.call(e),v("div",{class:[h.value,u,p.value],style:i(i({},$),r)},[v("span",{class:`${n.value}-text`},[t.text||((l=e.text)===null||l===void 0?void 0:l.call(e))]),v("div",{class:`${n.value}-corner`,style:g},null)])]))}}}),Et=()=>({count:T.any.def(null),showZero:{type:Boolean,default:void 0},overflowCount:{type:Number,default:99},dot:{type:Boolean,default:void 0},prefixCls:String,scrollNumberPrefixCls:String,status:{type:String},size:{type:String,default:"default"},color:String,text:T.any,offset:Array,numberStyle:{type:Object,default:void 0},title:String}),M=W({compatConfig:{MODE:3},name:"ABadge",Ribbon:V,inheritAttrs:!1,props:Et(),slots:Object,setup(t,o){let{slots:a,attrs:e}=o;const{prefixCls:n,direction:c}=L("badge",t),[d,p]=tt(n),s=f(()=>t.count>t.overflowCount?`${t.overflowCount}+`:t.count),h=f(()=>s.value==="0"||s.value===0),m=f(()=>t.count===null||h.value&&!t.showZero),l=f(()=>(t.status!==null&&t.status!==void 0||t.color!==null&&t.color!==void 0)&&m.value),u=f(()=>t.dot&&!h.value),r=f(()=>u.value?"":s.value),y=f(()=>(r.value===null||r.value===void 0||r.value===""||h.value&&!t.showZero)&&!u.value),$=R(t.count),g=R(r.value),S=R(u.value);J([()=>t.count,r,u],()=>{y.value||($.value=t.count,g.value=r.value,S.value=u.value)},{immediate:!0});const b=f(()=>k(t.color,!1)),P=f(()=>({[`${n.value}-status-dot`]:l.value,[`${n.value}-status-${t.status}`]:!!t.status,[`${n.value}-color-${t.color}`]:b.value})),B=f(()=>t.color&&!b.value?{background:t.color,color:t.color}:{}),et=f(()=>({[`${n.value}-dot`]:S.value,[`${n.value}-count`]:!S.value,[`${n.value}-count-sm`]:t.size==="small",[`${n.value}-multiple-words`]:!S.value&&g.value&&g.value.toString().length>1,[`${n.value}-status-${t.status}`]:!!t.status,[`${n.value}-color-${t.color}`]:b.value}));return()=>{var E,_;const{offset:N,title:Z,color:X}=t,U=e.style,j=ut(a,t,"text"),x=n.value,C=$.value;let w=ct((E=a.default)===null||E===void 0?void 0:E.call(a));w=w.length?w:null;const A=!!(!y.value||a.count),D=(()=>{if(!N)return i({},U);const I={marginTop:pt(N[1])?`${N[1]}px`:N[1]};return c.value==="rtl"?I.left=`${parseInt(N[0],10)}px`:I.right=`${-parseInt(N[0],10)}px`,i(i({},I),U)})(),ot=Z??(typeof C=="string"||typeof C=="number"?C:void 0),nt=A||!j?null:v("span",{class:`${x}-status-text`},[j]),at=typeof C=="object"||C===void 0&&a.count?Q(C??((_=a.count)===null||_===void 0?void 0:_.call(a)),{style:D},!1):null,K=F(x,{[`${x}-status`]:l.value,[`${x}-not-a-wrapper`]:!w,[`${x}-rtl`]:c.value==="rtl"},e.class,p.value);if(!w&&l.value){const I=D.color;return d(v("span",z(z({},e),{},{class:K,style:D}),[v("span",{class:P.value,style:B.value},null),v("span",{style:{color:I},class:`${x}-status-text`},[j])]))}const rt=dt(w?`${x}-zoom`:"",{appear:!1});let H=i(i({},D),t.numberStyle);return X&&!b.value&&(H=H||{},H.background=X),d(v("span",z(z({},e),{},{class:K}),[w,v(bt,rt,{default:()=>[ft(v(Ct,{prefixCls:t.scrollNumberPrefixCls,show:A,class:et.value,count:g.value,title:ot,style:H,key:"scrollNumber"},{default:()=>[at]}),[[vt,A]])]}),nt]))}}});M.install=function(t){return t.component(M.name,M),t.component(V.name,V),t};export{V as BadgeRibbon,M as default};
|
|
1
|
+
import{h as i,i as F,P as T,q as L,N as lt,l as it,m as st,r as Y,K as O,f as z,a1 as ut,L as ct,g as dt}from"./index-fk2Rjacw.js";import{d as W,b as f,a as mt,w as J,x as gt,c as v,r as R,a6 as bt,a3 as ft,a4 as vt}from"./vendor-Bn1JzzAn.js";import{c as Q}from"./vnode-CUYFsFEN.js";import{g as q,i as k}from"./colors-DPKrgVfy.js";import{i as pt}from"./isNumeric-DjvBa-1E.js";import"./icons-DG5UD-6K.js";function G(t){let{prefixCls:o,value:a,current:e,offset:n=0}=t,c;return n&&(c={position:"absolute",top:`${n}00%`,left:0}),v("p",{style:c,class:F(`${o}-only-unit`,{current:e})},[a])}function ht(t,o,a){let e=t,n=0;for(;(e+10)%10!==o;)e+=a,n+=a;return n}const $t=W({compatConfig:{MODE:3},name:"SingleNumber",props:{prefixCls:String,value:String,count:Number},setup(t){const o=f(()=>Number(t.value)),a=f(()=>Math.abs(t.count)),e=mt({prevValue:o.value,prevCount:a.value}),n=()=>{e.prevValue=o.value,e.prevCount=a.value},c=R();return J(o,()=>{clearTimeout(c.value),c.value=setTimeout(()=>{n()},1e3)},{flush:"post"}),gt(()=>{clearTimeout(c.value)}),()=>{let d,p={};const s=o.value;if(e.prevValue===s||Number.isNaN(s)||Number.isNaN(e.prevValue))d=[G(i(i({},t),{current:!0}))],p={transition:"none"};else{d=[];const h=s+10,m=[];for(let r=s;r<=h;r+=1)m.push(r);const l=m.findIndex(r=>r%10===e.prevValue);d=m.map((r,y)=>{const $=r%10;return G(i(i({},t),{value:$,offset:y-l,current:y===l}))});const u=e.prevCount<a.value?1:-1;p={transform:`translateY(${-ht(e.prevValue,s,u)}00%)`}}return v("span",{class:`${t.prefixCls}-only`,style:p,onTransitionend:()=>n()},[d])}}});var St=function(t,o){var a={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(a[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(t);n<e.length;n++)o.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(a[e[n]]=t[e[n]]);return a};const yt={prefixCls:String,count:T.any,component:String,title:T.any,show:Boolean},Ct=W({compatConfig:{MODE:3},name:"ScrollNumber",inheritAttrs:!1,props:yt,setup(t,o){let{attrs:a,slots:e}=o;const{prefixCls:n}=L("scroll-number",t);return()=>{var c;const d=i(i({},t),a),{prefixCls:p,count:s,title:h,show:m,component:l="sup",class:u,style:r}=d,y=St(d,["prefixCls","count","title","show","component","class","style"]),$=i(i({},y),{style:r,"data-show":t.show,class:F(n.value,u),title:h});let g=s;if(s&&Number(s)%1===0){const b=String(s).split("");g=b.map((P,B)=>v($t,{prefixCls:n.value,count:Number(s),value:P,key:b.length-B},null))}r&&r.borderColor&&($.style=i(i({},r),{boxShadow:`0 0 0 1px ${r.borderColor} inset`}));const S=lt((c=e.default)===null||c===void 0?void 0:c.call(e));return S&&S.length?Q(S,{class:F(`${n.value}-custom-component`)},!1):v(l,$,{default:()=>[g]})}}}),xt=new O("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),wt=new O("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),Nt=new O("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),Ot=new O("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),Pt=new O("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),Bt=new O("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),It=t=>{const{componentCls:o,iconCls:a,antCls:e,badgeFontHeight:n,badgeShadowSize:c,badgeHeightSm:d,motionDurationSlow:p,badgeStatusSize:s,marginXS:h,badgeRibbonOffset:m}=t,l=`${e}-scroll-number`,u=`${e}-ribbon`,r=`${e}-ribbon-wrapper`,y=q(t,(g,S)=>{let{darkColor:b}=S;return{[`&${o} ${o}-color-${g}`]:{background:b,[`&:not(${o}-count)`]:{color:b}}}}),$=q(t,(g,S)=>{let{darkColor:b}=S;return{[`&${u}-color-${g}`]:{background:b,color:b}}});return{[o]:i(i(i(i({},Y(t)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${o}-count`]:{zIndex:t.badgeZIndex,minWidth:t.badgeHeight,height:t.badgeHeight,color:t.badgeTextColor,fontWeight:t.badgeFontWeight,fontSize:t.badgeFontSize,lineHeight:`${t.badgeHeight}px`,whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:t.badgeHeight/2,boxShadow:`0 0 0 ${c}px ${t.badgeShadowColor}`,transition:`background ${t.motionDurationMid}`,a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},[`${o}-count-sm`]:{minWidth:d,height:d,fontSize:t.badgeFontSizeSm,lineHeight:`${d}px`,borderRadius:d/2},[`${o}-multiple-words`]:{padding:`0 ${t.paddingXS}px`},[`${o}-dot`]:{zIndex:t.badgeZIndex,width:t.badgeDotSize,minWidth:t.badgeDotSize,height:t.badgeDotSize,background:t.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${c}px ${t.badgeShadowColor}`},[`${o}-dot${l}`]:{transition:`background ${p}`},[`${o}-count, ${o}-dot, ${l}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${a}-spin`]:{animationName:Bt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${o}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${o}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},[`${o}-status-success`]:{backgroundColor:t.colorSuccess},[`${o}-status-processing`]:{overflow:"visible",color:t.colorPrimary,backgroundColor:t.colorPrimary,"&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:c,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:xt,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${o}-status-default`]:{backgroundColor:t.colorTextPlaceholder},[`${o}-status-error`]:{backgroundColor:t.colorError},[`${o}-status-warning`]:{backgroundColor:t.colorWarning},[`${o}-status-text`]:{marginInlineStart:h,color:t.colorText,fontSize:t.fontSize}}}),y),{[`${o}-zoom-appear, ${o}-zoom-enter`]:{animationName:wt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${o}-zoom-leave`]:{animationName:Nt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${o}-not-a-wrapper`]:{[`${o}-zoom-appear, ${o}-zoom-enter`]:{animationName:Ot,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${o}-zoom-leave`]:{animationName:Pt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`&:not(${o}-status)`]:{verticalAlign:"middle"},[`${l}-custom-component, ${o}-count`]:{transform:"none"},[`${l}-custom-component, ${l}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[`${l}`]:{overflow:"hidden",[`${l}-only`]:{position:"relative",display:"inline-block",height:t.badgeHeight,transition:`all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${l}-only-unit`]:{height:t.badgeHeight,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${l}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${o}-count, ${o}-dot, ${l}-custom-component`]:{transform:"translate(-50%, -50%)"}}}),[`${r}`]:{position:"relative"},[`${u}`]:i(i(i(i({},Y(t)),{position:"absolute",top:h,padding:`0 ${t.paddingXS}px`,color:t.colorPrimary,lineHeight:`${n}px`,whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,[`${u}-text`]:{color:t.colorTextLightSolid},[`${u}-corner`]:{position:"absolute",top:"100%",width:m,height:m,color:"currentcolor",border:`${m/2}px solid`,transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter}}),$),{[`&${u}-placement-end`]:{insetInlineEnd:-m,borderEndEndRadius:0,[`${u}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${u}-placement-start`]:{insetInlineStart:-m,borderEndStartRadius:0,[`${u}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},tt=it("Badge",t=>{const{fontSize:o,lineHeight:a,fontSizeSM:e,lineWidth:n,marginXS:c,colorBorderBg:d}=t,p=Math.round(o*a),s=n,h="auto",m=p-2*s,l=t.colorBgContainer,u="normal",r=e,y=t.colorError,$=t.colorErrorHover,g=o,S=e/2,b=e,P=e/2,B=st(t,{badgeFontHeight:p,badgeShadowSize:s,badgeZIndex:h,badgeHeight:m,badgeTextColor:l,badgeFontWeight:u,badgeFontSize:r,badgeColor:y,badgeColorHover:$,badgeShadowColor:d,badgeHeightSm:g,badgeDotSize:S,badgeFontSizeSm:b,badgeStatusSize:P,badgeProcessingDuration:"1.2s",badgeRibbonOffset:c,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"});return[It(B)]});var zt=function(t,o){var a={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(a[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(t);n<e.length;n++)o.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(a[e[n]]=t[e[n]]);return a};const Tt=()=>({prefix:String,color:{type:String},text:T.any,placement:{type:String,default:"end"}}),V=W({compatConfig:{MODE:3},name:"ABadgeRibbon",inheritAttrs:!1,props:Tt(),slots:Object,setup(t,o){let{attrs:a,slots:e}=o;const{prefixCls:n,direction:c}=L("ribbon",t),[d,p]=tt(n),s=f(()=>k(t.color,!1)),h=f(()=>[n.value,`${n.value}-placement-${t.placement}`,{[`${n.value}-rtl`]:c.value==="rtl",[`${n.value}-color-${t.color}`]:s.value}]);return()=>{var m,l;const{class:u,style:r}=a,y=zt(a,["class","style"]),$={},g={};return t.color&&!s.value&&($.background=t.color,g.color=t.color),d(v("div",z({class:`${n.value}-wrapper ${p.value}`},y),[(m=e.default)===null||m===void 0?void 0:m.call(e),v("div",{class:[h.value,u,p.value],style:i(i({},$),r)},[v("span",{class:`${n.value}-text`},[t.text||((l=e.text)===null||l===void 0?void 0:l.call(e))]),v("div",{class:`${n.value}-corner`,style:g},null)])]))}}}),Et=()=>({count:T.any.def(null),showZero:{type:Boolean,default:void 0},overflowCount:{type:Number,default:99},dot:{type:Boolean,default:void 0},prefixCls:String,scrollNumberPrefixCls:String,status:{type:String},size:{type:String,default:"default"},color:String,text:T.any,offset:Array,numberStyle:{type:Object,default:void 0},title:String}),M=W({compatConfig:{MODE:3},name:"ABadge",Ribbon:V,inheritAttrs:!1,props:Et(),slots:Object,setup(t,o){let{slots:a,attrs:e}=o;const{prefixCls:n,direction:c}=L("badge",t),[d,p]=tt(n),s=f(()=>t.count>t.overflowCount?`${t.overflowCount}+`:t.count),h=f(()=>s.value==="0"||s.value===0),m=f(()=>t.count===null||h.value&&!t.showZero),l=f(()=>(t.status!==null&&t.status!==void 0||t.color!==null&&t.color!==void 0)&&m.value),u=f(()=>t.dot&&!h.value),r=f(()=>u.value?"":s.value),y=f(()=>(r.value===null||r.value===void 0||r.value===""||h.value&&!t.showZero)&&!u.value),$=R(t.count),g=R(r.value),S=R(u.value);J([()=>t.count,r,u],()=>{y.value||($.value=t.count,g.value=r.value,S.value=u.value)},{immediate:!0});const b=f(()=>k(t.color,!1)),P=f(()=>({[`${n.value}-status-dot`]:l.value,[`${n.value}-status-${t.status}`]:!!t.status,[`${n.value}-color-${t.color}`]:b.value})),B=f(()=>t.color&&!b.value?{background:t.color,color:t.color}:{}),et=f(()=>({[`${n.value}-dot`]:S.value,[`${n.value}-count`]:!S.value,[`${n.value}-count-sm`]:t.size==="small",[`${n.value}-multiple-words`]:!S.value&&g.value&&g.value.toString().length>1,[`${n.value}-status-${t.status}`]:!!t.status,[`${n.value}-color-${t.color}`]:b.value}));return()=>{var E,_;const{offset:N,title:Z,color:X}=t,U=e.style,j=ut(a,t,"text"),x=n.value,C=$.value;let w=ct((E=a.default)===null||E===void 0?void 0:E.call(a));w=w.length?w:null;const A=!!(!y.value||a.count),D=(()=>{if(!N)return i({},U);const I={marginTop:pt(N[1])?`${N[1]}px`:N[1]};return c.value==="rtl"?I.left=`${parseInt(N[0],10)}px`:I.right=`${-parseInt(N[0],10)}px`,i(i({},I),U)})(),ot=Z??(typeof C=="string"||typeof C=="number"?C:void 0),nt=A||!j?null:v("span",{class:`${x}-status-text`},[j]),at=typeof C=="object"||C===void 0&&a.count?Q(C??((_=a.count)===null||_===void 0?void 0:_.call(a)),{style:D},!1):null,K=F(x,{[`${x}-status`]:l.value,[`${x}-not-a-wrapper`]:!w,[`${x}-rtl`]:c.value==="rtl"},e.class,p.value);if(!w&&l.value){const I=D.color;return d(v("span",z(z({},e),{},{class:K,style:D}),[v("span",{class:P.value,style:B.value},null),v("span",{style:{color:I},class:`${x}-status-text`},[j])]))}const rt=dt(w?`${x}-zoom`:"",{appear:!1});let H=i(i({},D),t.numberStyle);return X&&!b.value&&(H=H||{},H.background=X),d(v("span",z(z({},e),{},{class:K}),[w,v(bt,rt,{default:()=>[ft(v(Ct,{prefixCls:t.scrollNumberPrefixCls,show:A,class:et.value,count:g.value,title:ot,style:H,key:"scrollNumber"},{default:()=>[at]}),[[vt,A]])]}),nt]))}}});M.install=function(t){return t.component(M.name,M),t.component(V.name,V),t};export{V as BadgeRibbon,M as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as S,ah as gn,P as V,f as k,i as ue,ae as Pe,L as Rt,B as bn,Q as ve,aB as St,r as Je,ab as Qe,m as Se,ai as Dt,l as Sn,q as yn,M as wn,aC as In,a5 as Cn,af as Me,H as xn,a6 as yt,s as $n,aD as On}from"./index-p2HYn89m.js";import{d as fe,b as H,c as M,r as me,k as Tn,a7 as Vt,i as Be,e as Ie,o as ye,w as ne,Q as qe,F as Fe,s as X,f as De,p as ke,j as Mn,a as $e,t as En,x as Pn,z as et,n as Ee,q as Fn,a9 as ge}from"./vendor-Bn1JzzAn.js";import{T as Rn}from"./Trigger-yr4rFDrW.js";import{K as _}from"./KeyCode-D63Tfrq7.js";import{c as Ht}from"./vnode-BuBLFz0c.js";import{B as Dn}from"./BaseInput-DaX9ptax.js";import{p as tt}from"./pickAttrs-DZwIFD4u.js";import{O as Vn}from"./Overflow-CqcLKqJ8.js";import{i as Hn}from"./isMobile--2fOlCHx.js";import{i as nt}from"./initDefaultProps-C3Djh9fa.js";import{R as Nn}from"./index-CDTvsX8t.js";import{w as he}from"./raf-Deuc0E8-.js";import{s as be}from"./motion-BzqFmbSe.js";import{o as _e}from"./omit-CB2ZyxUg.js";import{u as wt}from"./useMergedState-DXbJa_zE.js";import{u as It}from"./useState-CnxtbLoC.js";import{C as Ln,L as Bn,ak as _n,b as An,k as zn,ai as Wn}from"./icons-DG5UD-6K.js";import{u as Kn,F as jn}from"./FormItemContext-BoJJBkG3.js";import{a as Un,g as Gn}from"./statusUtils-3-FHu9_M.js";import{u as Yn}from"./Compact-BwHIFkNC.js";import{i as Ct}from"./move-DJo_FFaW.js";import{s as Xn,a as Qn,b as qn,c as Zn,i as xt}from"./slide-BaIK52yz.js";import{g as Jn}from"./compact-item-BTg602H5.js";import{d as kn}from"./devWarning-Dol8jLEP.js";function $t(e,t){const{key:o}=e;let n;return"value"in e&&({value:n}=e),o??(n!==void 0?n:`rc-index-key-${t}`)}function Nt(e,t){const{label:o,value:n,options:l}=e||{};return{label:o||(t?"children":"label"),value:n||"value",options:l||"options"}}function eo(e){let{fieldNames:t,childrenAsData:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=[],{label:l,value:i,options:c}=Nt(t,!1);function a(f,s){f.forEach(r=>{const m=r[l];if(s||!(c in r)){const b=r[i];n.push({key:$t(r,n.length),groupOption:s,data:r,label:m,value:b})}else{let b=m;b===void 0&&o&&(b=r.label),n.push({key:$t(r,n.length),group:!0,data:r,label:b}),a(r[c],!0)}})}return a(e,!1),n}function Ze(e){const t=S({},e);return"props"in t||Object.defineProperty(t,"props",{get(){return gn(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}function to(e,t){if(!t||!t.length)return null;let o=!1;function n(i,c){let[a,...f]=c;if(!a)return[i];const s=i.split(a);return o=o||s.length>1,s.reduce((r,m)=>[...r,...n(m,f)],[]).filter(r=>r)}const l=n(e,t);return o?l:null}var no=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};const oo=e=>{const t=e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}},lo=fe({name:"SelectTrigger",inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:V.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:V.oneOfType([Number,Boolean]).def(!0),popupElement:V.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function,onPopupFocusin:Function,onPopupFocusout:Function},setup(e,t){let{slots:o,attrs:n,expose:l}=t;const i=H(()=>{const{dropdownMatchSelectWidth:a}=e;return oo(a)}),c=me();return l({getPopupElement:()=>c.value}),()=>{const a=S(S({},e),n),{empty:f=!1}=a,s=no(a,["empty"]),{visible:r,dropdownAlign:m,prefixCls:b,popupElement:C,dropdownClassName:g,dropdownStyle:y,direction:w="ltr",placement:x,dropdownMatchSelectWidth:D,containerWidth:E,dropdownRender:I,animation:v,transitionName:P,getPopupContainer:O,getTriggerDOMNode:R,onPopupVisibleChange:N,onPopupMouseEnter:A,onPopupFocusin:B,onPopupFocusout:U}=s,Y=`${b}-dropdown`;let W=C;I&&(W=I({menuNode:C,props:e}));const G=v?`${Y}-${v}`:P,z=S({minWidth:`${E}px`},y);return typeof D=="number"?z.width=`${D}px`:D&&(z.width=`${E}px`),M(Rn,k(k({},e),{},{showAction:N?["click"]:[],hideAction:N?["click"]:[],popupPlacement:x||(w==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:i.value,prefixCls:Y,popupTransitionName:G,popupAlign:m,popupVisible:r,getPopupContainer:O,popupClassName:ue(g,{[`${Y}-empty`]:f}),popupStyle:z,getTriggerDOMNode:R,onPopupVisibleChange:N}),{default:o.default,popup:()=>M("div",{ref:c,onMouseenter:A,onFocusin:B,onFocusout:U},[W])})}}}),Ce=(e,t)=>{let{slots:o}=t;var n;const{class:l,customizeIcon:i,customizeIconProps:c,onMousedown:a,onClick:f}=e;let s;return typeof i=="function"?s=i(c):s=Tn(i)?Vt(i):i,M("span",{class:l,onMousedown:r=>{r.preventDefault(),a&&a(r)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:f,"aria-hidden":!0},[s!==void 0?s:M("span",{class:l.split(/\s+/).map(r=>`${r}-icon`)},[(n=o.default)===null||n===void 0?void 0:n.call(o)])])};Ce.inheritAttrs=!1;Ce.displayName="TransBtn";Ce.props={class:String,customizeIcon:V.any,customizeIconProps:V.any,onMousedown:Function,onClick:Function};const io={inputRef:V.any,prefixCls:String,id:String,inputElement:V.VueNode,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,editable:{type:Boolean,default:void 0},activeDescendantId:String,value:String,open:{type:Boolean,default:void 0},tabindex:V.oneOfType([V.number,V.string]),attrs:V.object,onKeydown:{type:Function},onMousedown:{type:Function},onChange:{type:Function},onPaste:{type:Function},onCompositionstart:{type:Function},onCompositionend:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},Lt=fe({compatConfig:{MODE:3},name:"SelectInput",inheritAttrs:!1,props:io,setup(e){let t=null;const o=Be("VCSelectContainerEvent");return()=>{var n;const{prefixCls:l,id:i,inputElement:c,disabled:a,tabindex:f,autofocus:s,autocomplete:r,editable:m,activeDescendantId:b,value:C,onKeydown:g,onMousedown:y,onChange:w,onPaste:x,onCompositionstart:D,onCompositionend:E,onFocus:I,onBlur:v,open:P,inputRef:O,attrs:R}=e;let N=c||M(Dn,null,null);const A=N.props||{},{onKeydown:B,onInput:U,onFocus:Y,onBlur:W,onMousedown:G,onCompositionstart:z,onCompositionend:oe,style:ie}=A;return N=Ht(N,S(S(S(S(S({type:"search"},A),{id:i,ref:O,disabled:a,tabindex:f,lazy:!1,autocomplete:r||"off",autofocus:s,class:ue(`${l}-selection-search-input`,(n=N?.props)===null||n===void 0?void 0:n.class),role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-owns":`${i}_list`,"aria-autocomplete":"list","aria-controls":`${i}_list`,"aria-activedescendant":b}),R),{value:m?C:"",readonly:!m,unselectable:m?null:"on",style:S(S({},ie),{opacity:m?null:0}),onKeydown:p=>{g(p),B&&B(p)},onMousedown:p=>{y(p),G&&G(p)},onInput:p=>{w(p),U&&U(p)},onCompositionstart(p){D(p),z&&z(p)},onCompositionend(p){E(p),oe&&oe(p)},onPaste:x,onFocus:function(){clearTimeout(t),Y&&Y(arguments.length<=0?void 0:arguments[0]),I&&I(arguments.length<=0?void 0:arguments[0]),o?.focus(arguments.length<=0?void 0:arguments[0])},onBlur:function(){for(var p=arguments.length,L=new Array(p),T=0;T<p;T++)L[T]=arguments[T];t=setTimeout(()=>{W&&W(L[0]),v&&v(L[0]),o?.blur(L[0])},100)}}),N.type==="textarea"?{}:{type:"search"}),!0,!0),N}}}),ao=Symbol("TreeSelectLegacyContextPropsKey");function ot(){return Be(ao,{})}const ro={id:String,prefixCls:String,values:V.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:V.any,placeholder:V.any,disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:V.oneOfType([V.number,V.string]),compositionStatus:Boolean,removeIcon:V.any,choiceTransitionName:String,maxTagCount:V.oneOfType([V.number,V.string]),maxTagTextLength:Number,maxTagPlaceholder:V.any.def(()=>e=>`+ ${e.length} ...`),tagRender:Function,onToggleOpen:{type:Function},onRemove:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},Ot=e=>{e.preventDefault(),e.stopPropagation()},so=fe({name:"MultipleSelectSelector",inheritAttrs:!1,props:ro,setup(e){const t=X(),o=X(0),n=X(!1),l=ot(),i=H(()=>`${e.prefixCls}-selection`),c=H(()=>e.open||e.mode==="tags"?e.searchValue:""),a=H(()=>e.mode==="tags"||e.showSearch&&(e.open||n.value)),f=me("");Ie(()=>{f.value=c.value}),ye(()=>{ne(f,()=>{o.value=t.value.scrollWidth},{flush:"post",immediate:!0})});function s(g,y,w,x,D){return M("span",{class:ue(`${i.value}-item`,{[`${i.value}-item-disabled`]:w}),title:typeof g=="string"||typeof g=="number"?g.toString():void 0},[M("span",{class:`${i.value}-item-content`},[y]),x&&M(Ce,{class:`${i.value}-item-remove`,onMousedown:Ot,onClick:D,customizeIcon:e.removeIcon},{default:()=>[qe("×")]})])}function r(g,y,w,x,D,E){var I;const v=O=>{Ot(O),e.onToggleOpen(!open)};let P=E;return l.keyEntities&&(P=((I=l.keyEntities[g])===null||I===void 0?void 0:I.node)||{}),M("span",{key:g,onMousedown:v},[e.tagRender({label:y,value:g,disabled:w,closable:x,onClose:D,option:P})])}function m(g){const{disabled:y,label:w,value:x,option:D}=g,E=!e.disabled&&!y;let I=w;if(typeof e.maxTagTextLength=="number"&&(typeof w=="string"||typeof w=="number")){const P=String(I);P.length>e.maxTagTextLength&&(I=`${P.slice(0,e.maxTagTextLength)}...`)}const v=P=>{var O;P&&P.stopPropagation(),(O=e.onRemove)===null||O===void 0||O.call(e,g)};return typeof e.tagRender=="function"?r(x,I,y,E,v,D):s(w,I,y,E,v)}function b(g){const{maxTagPlaceholder:y=x=>`+ ${x.length} ...`}=e,w=typeof y=="function"?y(g):y;return s(w,w,!1)}const C=g=>{const y=g.target.composing;f.value=g.target.value,y||e.onInputChange(g)};return()=>{const{id:g,prefixCls:y,values:w,open:x,inputRef:D,placeholder:E,disabled:I,autofocus:v,autocomplete:P,activeDescendantId:O,tabindex:R,compositionStatus:N,onInputPaste:A,onInputKeyDown:B,onInputMouseDown:U,onInputCompositionStart:Y,onInputCompositionEnd:W}=e,G=M("div",{class:`${i.value}-search`,style:{width:o.value+"px"},key:"input"},[M(Lt,{inputRef:D,open:x,prefixCls:y,id:g,inputElement:null,disabled:I,autofocus:v,autocomplete:P,editable:a.value,activeDescendantId:O,value:f.value,onKeydown:B,onMousedown:U,onChange:C,onPaste:A,onCompositionstart:Y,onCompositionend:W,tabindex:R,attrs:tt(e,!0),onFocus:()=>n.value=!0,onBlur:()=>n.value=!1},null),M("span",{ref:t,class:`${i.value}-search-mirror`,"aria-hidden":!0},[f.value,qe(" ")])]),z=M(Vn,{prefixCls:`${i.value}-overflow`,data:w,renderItem:m,renderRest:b,suffix:G,itemKey:"key",maxCount:e.maxTagCount,key:"overflow"},null);return M(Fe,null,[z,!w.length&&!c.value&&!N&&M("span",{class:`${i.value}-placeholder`},[E])])}}}),uo={inputElement:V.any,id:String,prefixCls:String,values:V.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:V.any,placeholder:V.any,compositionStatus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:V.oneOfType([V.number,V.string]),activeValue:String,backfill:{type:Boolean,default:void 0},optionLabelRender:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},lt=fe({name:"SingleSelector",setup(e){const t=X(!1),o=H(()=>e.mode==="combobox"),n=H(()=>o.value||e.showSearch),l=H(()=>{let r=e.searchValue||"";return o.value&&e.activeValue&&!t.value&&(r=e.activeValue),r}),i=ot();ne([o,()=>e.activeValue],()=>{o.value&&(t.value=!1)},{immediate:!0});const c=H(()=>e.mode!=="combobox"&&!e.open&&!e.showSearch?!1:!!l.value||e.compositionStatus),a=H(()=>{const r=e.values[0];return r&&(typeof r.label=="string"||typeof r.label=="number")?r.label.toString():void 0}),f=()=>{if(e.values[0])return null;const r=c.value?{visibility:"hidden"}:void 0;return M("span",{class:`${e.prefixCls}-selection-placeholder`,style:r},[e.placeholder])},s=r=>{r.target.composing||(t.value=!0,e.onInputChange(r))};return()=>{var r,m,b,C;const{inputElement:g,prefixCls:y,id:w,values:x,inputRef:D,disabled:E,autofocus:I,autocomplete:v,activeDescendantId:P,open:O,tabindex:R,optionLabelRender:N,onInputKeyDown:A,onInputMouseDown:B,onInputPaste:U,onInputCompositionStart:Y,onInputCompositionEnd:W}=e,G=x[0];let z=null;if(G&&i.customSlots){const oe=(r=G.key)!==null&&r!==void 0?r:G.value,ie=((m=i.keyEntities[oe])===null||m===void 0?void 0:m.node)||{};z=i.customSlots[(b=ie.slots)===null||b===void 0?void 0:b.title]||i.customSlots.title||G.label,typeof z=="function"&&(z=z(ie))}else z=N&&G?N(G.option):G?.label;return M(Fe,null,[M("span",{class:`${y}-selection-search`},[M(Lt,{inputRef:D,prefixCls:y,id:w,open:O,inputElement:g,disabled:E,autofocus:I,autocomplete:v,editable:n.value,activeDescendantId:P,value:l.value,onKeydown:A,onMousedown:B,onChange:s,onPaste:U,onCompositionstart:Y,onCompositionend:W,tabindex:R,attrs:tt(e,!0)},null)]),!o.value&&G&&!c.value&&M("span",{class:`${y}-selection-item`,title:a.value},[M(Fe,{key:(C=G.key)!==null&&C!==void 0?C:G.value},[z])]),f()])}}});lt.props=uo;lt.inheritAttrs=!1;function co(e){return![_.ESC,_.SHIFT,_.BACKSPACE,_.TAB,_.WIN_KEY,_.ALT,_.META,_.WIN_KEY_RIGHT,_.CTRL,_.SEMICOLON,_.EQUALS,_.CAPS_LOCK,_.CONTEXT_MENU,_.F1,_.F2,_.F3,_.F4,_.F5,_.F6,_.F7,_.F8,_.F9,_.F10,_.F11,_.F12].includes(e)}function Bt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=null,o;De(()=>{clearTimeout(o)});function n(l){(l||t===null)&&(t=l),clearTimeout(o),o=setTimeout(()=>{t=null},e)}return[()=>t,n]}function Re(){const e=t=>{e.current=t};return e}const fo=fe({name:"Selector",inheritAttrs:!1,props:{id:String,prefixCls:String,showSearch:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},values:V.array,multiple:{type:Boolean,default:void 0},mode:String,searchValue:String,activeValue:String,inputElement:V.any,autofocus:{type:Boolean,default:void 0},activeDescendantId:String,tabindex:V.oneOfType([V.number,V.string]),disabled:{type:Boolean,default:void 0},placeholder:V.any,removeIcon:V.any,maxTagCount:V.oneOfType([V.number,V.string]),maxTagTextLength:Number,maxTagPlaceholder:V.any,tagRender:Function,optionLabelRender:Function,tokenWithEnter:{type:Boolean,default:void 0},choiceTransitionName:String,onToggleOpen:{type:Function},onSearch:Function,onSearchSubmit:Function,onRemove:Function,onInputKeyDown:{type:Function},domRef:Function},setup(e,t){let{expose:o}=t;const n=Re(),l=me(!1),[i,c]=Bt(0),a=x=>{const{which:D}=x;(D===_.UP||D===_.DOWN)&&x.preventDefault(),e.onInputKeyDown&&e.onInputKeyDown(x),D===_.ENTER&&e.mode==="tags"&&!l.value&&!e.open&&e.onSearchSubmit(x.target.value),co(D)&&e.onToggleOpen(!0)},f=()=>{c(!0)};let s=null;const r=x=>{e.onSearch(x,!0,l.value)!==!1&&e.onToggleOpen(!0)},m=()=>{l.value=!0},b=x=>{l.value=!1,e.mode!=="combobox"&&r(x.target.value)},C=x=>{let{target:{value:D}}=x;if(e.tokenWithEnter&&s&&/[\r\n]/.test(s)){const E=s.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");D=D.replace(E,s)}s=null,r(D)},g=x=>{const{clipboardData:D}=x;s=D.getData("text")},y=x=>{let{target:D}=x;D!==n.current&&(document.body.style.msTouchAction!==void 0?setTimeout(()=>{n.current.focus()}):n.current.focus())},w=x=>{const D=i();x.target!==n.current&&!D&&x.preventDefault(),(e.mode!=="combobox"&&(!e.showSearch||!D)||!e.open)&&(e.open&&e.onSearch("",!0,!1),e.onToggleOpen())};return o({focus:()=>{n.current.focus()},blur:()=>{n.current.blur()}}),()=>{const{prefixCls:x,domRef:D,mode:E}=e,I={inputRef:n,onInputKeyDown:a,onInputMouseDown:f,onInputChange:C,onInputPaste:g,compositionStatus:l.value,onInputCompositionStart:m,onInputCompositionEnd:b},v=E==="multiple"||E==="tags"?M(so,k(k({},e),I),null):M(lt,k(k({},e),I),null);return M("div",{ref:D,class:`${x}-selector`,onClick:y,onMousedown:w},[v])}}});function po(e,t,o){function n(l){var i,c,a;let f=l.target;f.shadowRoot&&l.composed&&(f=l.composedPath()[0]||f);const s=[(i=e[0])===null||i===void 0?void 0:i.value,(a=(c=e[1])===null||c===void 0?void 0:c.value)===null||a===void 0?void 0:a.getPopupElement()];t.value&&s.every(r=>r&&!r.contains(f)&&r!==f)&&o(!1)}ye(()=>{window.addEventListener("mousedown",n)}),De(()=>{window.removeEventListener("mousedown",n)})}function mo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;const t=X(!1);let o;const n=()=>{clearTimeout(o)};return ye(()=>{n()}),[t,(i,c)=>{n(),o=setTimeout(()=>{t.value=i,c&&c()},e)},n]}const _t=Symbol("BaseSelectContextKey");function vo(e){return ke(_t,e)}function ho(){return Be(_t,{})}function At(e){if(!Mn(e))return $e(e);const t=new Proxy({},{get(o,n,l){return Reflect.get(e.value,n,l)},set(o,n,l){return e.value[n]=l,!0},deleteProperty(o,n){return Reflect.deleteProperty(e.value,n)},has(o,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return $e(t)}var go=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};const bo=["value","onChange","removeIcon","placeholder","autofocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabindex","OptionList","notFoundContent"],So=()=>({prefixCls:String,id:String,omitDomProps:Array,displayValues:Array,onDisplayValuesChange:Function,activeValue:String,activeDescendantId:String,onActiveValueChange:Function,searchValue:String,onSearch:Function,onSearchSplit:Function,maxLength:Number,OptionList:V.any,emptyOptions:Boolean}),zt=()=>({showSearch:{type:Boolean,default:void 0},tagRender:{type:Function},optionLabelRender:{type:Function},direction:{type:String},tabindex:Number,autofocus:Boolean,notFoundContent:V.any,placeholder:V.any,onClear:Function,choiceTransitionName:String,mode:String,disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{type:Function},getInputElement:{type:Function},getRawInputElement:{type:Function},maxTagTextLength:Number,maxTagCount:{type:[String,Number]},maxTagPlaceholder:V.any,tokenSeparators:{type:Array},allowClear:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},inputIcon:V.any,clearIcon:V.any,removeIcon:V.any,animation:String,transitionName:String,dropdownStyle:{type:Object},dropdownClassName:String,dropdownMatchSelectWidth:{type:[Boolean,Number],default:void 0},dropdownRender:{type:Function},dropdownAlign:Object,placement:{type:String},getPopupContainer:{type:Function},showAction:{type:Array},onBlur:{type:Function},onFocus:{type:Function},onKeyup:Function,onKeydown:Function,onMousedown:Function,onPopupScroll:Function,onInputKeyDown:Function,onMouseenter:Function,onMouseleave:Function,onClick:Function}),yo=()=>S(S({},So()),zt());function it(e){return e==="tags"||e==="multiple"}const wo=fe({compatConfig:{MODE:3},name:"BaseSelect",inheritAttrs:!1,props:nt(yo(),{showAction:[],notFoundContent:"Not Found"}),setup(e,t){let{attrs:o,expose:n,slots:l}=t;const i=H(()=>it(e.mode)),c=H(()=>e.showSearch!==void 0?e.showSearch:i.value||e.mode==="combobox"),a=X(!1);ye(()=>{a.value=Hn()});const f=ot(),s=X(null),r=Re(),m=X(null),b=X(null),C=X(null),g=me(!1),[y,w,x]=mo();n({focus:()=>{var u;(u=b.value)===null||u===void 0||u.focus()},blur:()=>{var u;(u=b.value)===null||u===void 0||u.blur()},scrollTo:u=>{var d;return(d=C.value)===null||d===void 0?void 0:d.scrollTo(u)}});const I=H(()=>{var u;if(e.mode!=="combobox")return e.searchValue;const d=(u=e.displayValues[0])===null||u===void 0?void 0:u.value;return typeof d=="string"||typeof d=="number"?String(d):""}),v=e.open!==void 0?e.open:e.defaultOpen,P=X(v),O=X(v),R=u=>{P.value=e.open!==void 0?e.open:u,O.value=P.value};ne(()=>e.open,()=>{R(e.open)});const N=H(()=>!e.notFoundContent&&e.emptyOptions);Ie(()=>{O.value=P.value,(e.disabled||N.value&&O.value&&e.mode==="combobox")&&(O.value=!1)});const A=H(()=>N.value?!1:O.value),B=u=>{const d=u!==void 0?u:!O.value;O.value!==d&&!e.disabled&&(R(d),e.onDropdownVisibleChange&&e.onDropdownVisibleChange(d),!d&&K.value&&(K.value=!1,w(!1,()=>{L.value=!1,g.value=!1})))},U=H(()=>(e.tokenSeparators||[]).some(u=>[`
|
|
1
|
+
import{h as S,ah as gn,P as V,f as k,i as ue,ae as Pe,L as Rt,B as bn,Q as ve,aB as St,r as Je,ab as Qe,m as Se,ai as Dt,l as Sn,q as yn,M as wn,aC as In,a5 as Cn,af as Me,H as xn,a6 as yt,s as $n,aD as On}from"./index-fk2Rjacw.js";import{d as fe,b as H,c as M,r as me,k as Tn,a7 as Vt,i as Be,e as Ie,o as ye,w as ne,Q as qe,F as Fe,s as X,f as De,p as ke,j as Mn,a as $e,t as En,x as Pn,z as et,n as Ee,q as Fn,a9 as ge}from"./vendor-Bn1JzzAn.js";import{T as Rn}from"./Trigger-DhCrSTf5.js";import{K as _}from"./KeyCode-D63Tfrq7.js";import{c as Ht}from"./vnode-CUYFsFEN.js";import{B as Dn}from"./BaseInput-D1mLCoOV.js";import{p as tt}from"./pickAttrs-DBsemz_K.js";import{O as Vn}from"./Overflow-C4z28R0-.js";import{i as Hn}from"./isMobile--2fOlCHx.js";import{i as nt}from"./initDefaultProps-CvyYJd7z.js";import{R as Nn}from"./index-ocf06EVQ.js";import{w as he}from"./raf-Deuc0E8-.js";import{s as be}from"./motion-DYZkhUdz.js";import{o as _e}from"./omit-BCXAtHCq.js";import{u as wt}from"./useMergedState-DXbJa_zE.js";import{u as It}from"./useState-CnxtbLoC.js";import{C as Ln,L as Bn,ak as _n,b as An,k as zn,ai as Wn}from"./icons-DG5UD-6K.js";import{u as Kn,F as jn}from"./FormItemContext-vx3daNDF.js";import{a as Un,g as Gn}from"./statusUtils-pQiITLkG.js";import{u as Yn}from"./Compact-izHNb4uz.js";import{i as Ct}from"./move-slnJRVT1.js";import{s as Xn,a as Qn,b as qn,c as Zn,i as xt}from"./slide-DT7qvId2.js";import{g as Jn}from"./compact-item-BTt2GtOm.js";import{d as kn}from"./devWarning-Bj5nUW2v.js";function $t(e,t){const{key:o}=e;let n;return"value"in e&&({value:n}=e),o??(n!==void 0?n:`rc-index-key-${t}`)}function Nt(e,t){const{label:o,value:n,options:l}=e||{};return{label:o||(t?"children":"label"),value:n||"value",options:l||"options"}}function eo(e){let{fieldNames:t,childrenAsData:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=[],{label:l,value:i,options:c}=Nt(t,!1);function a(f,s){f.forEach(r=>{const m=r[l];if(s||!(c in r)){const b=r[i];n.push({key:$t(r,n.length),groupOption:s,data:r,label:m,value:b})}else{let b=m;b===void 0&&o&&(b=r.label),n.push({key:$t(r,n.length),group:!0,data:r,label:b}),a(r[c],!0)}})}return a(e,!1),n}function Ze(e){const t=S({},e);return"props"in t||Object.defineProperty(t,"props",{get(){return gn(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}function to(e,t){if(!t||!t.length)return null;let o=!1;function n(i,c){let[a,...f]=c;if(!a)return[i];const s=i.split(a);return o=o||s.length>1,s.reduce((r,m)=>[...r,...n(m,f)],[]).filter(r=>r)}const l=n(e,t);return o?l:null}var no=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};const oo=e=>{const t=e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}},lo=fe({name:"SelectTrigger",inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:V.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:V.oneOfType([Number,Boolean]).def(!0),popupElement:V.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function,onPopupFocusin:Function,onPopupFocusout:Function},setup(e,t){let{slots:o,attrs:n,expose:l}=t;const i=H(()=>{const{dropdownMatchSelectWidth:a}=e;return oo(a)}),c=me();return l({getPopupElement:()=>c.value}),()=>{const a=S(S({},e),n),{empty:f=!1}=a,s=no(a,["empty"]),{visible:r,dropdownAlign:m,prefixCls:b,popupElement:C,dropdownClassName:g,dropdownStyle:y,direction:w="ltr",placement:x,dropdownMatchSelectWidth:D,containerWidth:E,dropdownRender:I,animation:v,transitionName:P,getPopupContainer:O,getTriggerDOMNode:R,onPopupVisibleChange:N,onPopupMouseEnter:A,onPopupFocusin:B,onPopupFocusout:U}=s,Y=`${b}-dropdown`;let W=C;I&&(W=I({menuNode:C,props:e}));const G=v?`${Y}-${v}`:P,z=S({minWidth:`${E}px`},y);return typeof D=="number"?z.width=`${D}px`:D&&(z.width=`${E}px`),M(Rn,k(k({},e),{},{showAction:N?["click"]:[],hideAction:N?["click"]:[],popupPlacement:x||(w==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:i.value,prefixCls:Y,popupTransitionName:G,popupAlign:m,popupVisible:r,getPopupContainer:O,popupClassName:ue(g,{[`${Y}-empty`]:f}),popupStyle:z,getTriggerDOMNode:R,onPopupVisibleChange:N}),{default:o.default,popup:()=>M("div",{ref:c,onMouseenter:A,onFocusin:B,onFocusout:U},[W])})}}}),Ce=(e,t)=>{let{slots:o}=t;var n;const{class:l,customizeIcon:i,customizeIconProps:c,onMousedown:a,onClick:f}=e;let s;return typeof i=="function"?s=i(c):s=Tn(i)?Vt(i):i,M("span",{class:l,onMousedown:r=>{r.preventDefault(),a&&a(r)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:f,"aria-hidden":!0},[s!==void 0?s:M("span",{class:l.split(/\s+/).map(r=>`${r}-icon`)},[(n=o.default)===null||n===void 0?void 0:n.call(o)])])};Ce.inheritAttrs=!1;Ce.displayName="TransBtn";Ce.props={class:String,customizeIcon:V.any,customizeIconProps:V.any,onMousedown:Function,onClick:Function};const io={inputRef:V.any,prefixCls:String,id:String,inputElement:V.VueNode,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,editable:{type:Boolean,default:void 0},activeDescendantId:String,value:String,open:{type:Boolean,default:void 0},tabindex:V.oneOfType([V.number,V.string]),attrs:V.object,onKeydown:{type:Function},onMousedown:{type:Function},onChange:{type:Function},onPaste:{type:Function},onCompositionstart:{type:Function},onCompositionend:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},Lt=fe({compatConfig:{MODE:3},name:"SelectInput",inheritAttrs:!1,props:io,setup(e){let t=null;const o=Be("VCSelectContainerEvent");return()=>{var n;const{prefixCls:l,id:i,inputElement:c,disabled:a,tabindex:f,autofocus:s,autocomplete:r,editable:m,activeDescendantId:b,value:C,onKeydown:g,onMousedown:y,onChange:w,onPaste:x,onCompositionstart:D,onCompositionend:E,onFocus:I,onBlur:v,open:P,inputRef:O,attrs:R}=e;let N=c||M(Dn,null,null);const A=N.props||{},{onKeydown:B,onInput:U,onFocus:Y,onBlur:W,onMousedown:G,onCompositionstart:z,onCompositionend:oe,style:ie}=A;return N=Ht(N,S(S(S(S(S({type:"search"},A),{id:i,ref:O,disabled:a,tabindex:f,lazy:!1,autocomplete:r||"off",autofocus:s,class:ue(`${l}-selection-search-input`,(n=N?.props)===null||n===void 0?void 0:n.class),role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-owns":`${i}_list`,"aria-autocomplete":"list","aria-controls":`${i}_list`,"aria-activedescendant":b}),R),{value:m?C:"",readonly:!m,unselectable:m?null:"on",style:S(S({},ie),{opacity:m?null:0}),onKeydown:p=>{g(p),B&&B(p)},onMousedown:p=>{y(p),G&&G(p)},onInput:p=>{w(p),U&&U(p)},onCompositionstart(p){D(p),z&&z(p)},onCompositionend(p){E(p),oe&&oe(p)},onPaste:x,onFocus:function(){clearTimeout(t),Y&&Y(arguments.length<=0?void 0:arguments[0]),I&&I(arguments.length<=0?void 0:arguments[0]),o?.focus(arguments.length<=0?void 0:arguments[0])},onBlur:function(){for(var p=arguments.length,L=new Array(p),T=0;T<p;T++)L[T]=arguments[T];t=setTimeout(()=>{W&&W(L[0]),v&&v(L[0]),o?.blur(L[0])},100)}}),N.type==="textarea"?{}:{type:"search"}),!0,!0),N}}}),ao=Symbol("TreeSelectLegacyContextPropsKey");function ot(){return Be(ao,{})}const ro={id:String,prefixCls:String,values:V.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:V.any,placeholder:V.any,disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:V.oneOfType([V.number,V.string]),compositionStatus:Boolean,removeIcon:V.any,choiceTransitionName:String,maxTagCount:V.oneOfType([V.number,V.string]),maxTagTextLength:Number,maxTagPlaceholder:V.any.def(()=>e=>`+ ${e.length} ...`),tagRender:Function,onToggleOpen:{type:Function},onRemove:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},Ot=e=>{e.preventDefault(),e.stopPropagation()},so=fe({name:"MultipleSelectSelector",inheritAttrs:!1,props:ro,setup(e){const t=X(),o=X(0),n=X(!1),l=ot(),i=H(()=>`${e.prefixCls}-selection`),c=H(()=>e.open||e.mode==="tags"?e.searchValue:""),a=H(()=>e.mode==="tags"||e.showSearch&&(e.open||n.value)),f=me("");Ie(()=>{f.value=c.value}),ye(()=>{ne(f,()=>{o.value=t.value.scrollWidth},{flush:"post",immediate:!0})});function s(g,y,w,x,D){return M("span",{class:ue(`${i.value}-item`,{[`${i.value}-item-disabled`]:w}),title:typeof g=="string"||typeof g=="number"?g.toString():void 0},[M("span",{class:`${i.value}-item-content`},[y]),x&&M(Ce,{class:`${i.value}-item-remove`,onMousedown:Ot,onClick:D,customizeIcon:e.removeIcon},{default:()=>[qe("×")]})])}function r(g,y,w,x,D,E){var I;const v=O=>{Ot(O),e.onToggleOpen(!open)};let P=E;return l.keyEntities&&(P=((I=l.keyEntities[g])===null||I===void 0?void 0:I.node)||{}),M("span",{key:g,onMousedown:v},[e.tagRender({label:y,value:g,disabled:w,closable:x,onClose:D,option:P})])}function m(g){const{disabled:y,label:w,value:x,option:D}=g,E=!e.disabled&&!y;let I=w;if(typeof e.maxTagTextLength=="number"&&(typeof w=="string"||typeof w=="number")){const P=String(I);P.length>e.maxTagTextLength&&(I=`${P.slice(0,e.maxTagTextLength)}...`)}const v=P=>{var O;P&&P.stopPropagation(),(O=e.onRemove)===null||O===void 0||O.call(e,g)};return typeof e.tagRender=="function"?r(x,I,y,E,v,D):s(w,I,y,E,v)}function b(g){const{maxTagPlaceholder:y=x=>`+ ${x.length} ...`}=e,w=typeof y=="function"?y(g):y;return s(w,w,!1)}const C=g=>{const y=g.target.composing;f.value=g.target.value,y||e.onInputChange(g)};return()=>{const{id:g,prefixCls:y,values:w,open:x,inputRef:D,placeholder:E,disabled:I,autofocus:v,autocomplete:P,activeDescendantId:O,tabindex:R,compositionStatus:N,onInputPaste:A,onInputKeyDown:B,onInputMouseDown:U,onInputCompositionStart:Y,onInputCompositionEnd:W}=e,G=M("div",{class:`${i.value}-search`,style:{width:o.value+"px"},key:"input"},[M(Lt,{inputRef:D,open:x,prefixCls:y,id:g,inputElement:null,disabled:I,autofocus:v,autocomplete:P,editable:a.value,activeDescendantId:O,value:f.value,onKeydown:B,onMousedown:U,onChange:C,onPaste:A,onCompositionstart:Y,onCompositionend:W,tabindex:R,attrs:tt(e,!0),onFocus:()=>n.value=!0,onBlur:()=>n.value=!1},null),M("span",{ref:t,class:`${i.value}-search-mirror`,"aria-hidden":!0},[f.value,qe(" ")])]),z=M(Vn,{prefixCls:`${i.value}-overflow`,data:w,renderItem:m,renderRest:b,suffix:G,itemKey:"key",maxCount:e.maxTagCount,key:"overflow"},null);return M(Fe,null,[z,!w.length&&!c.value&&!N&&M("span",{class:`${i.value}-placeholder`},[E])])}}}),uo={inputElement:V.any,id:String,prefixCls:String,values:V.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:V.any,placeholder:V.any,compositionStatus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:V.oneOfType([V.number,V.string]),activeValue:String,backfill:{type:Boolean,default:void 0},optionLabelRender:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},lt=fe({name:"SingleSelector",setup(e){const t=X(!1),o=H(()=>e.mode==="combobox"),n=H(()=>o.value||e.showSearch),l=H(()=>{let r=e.searchValue||"";return o.value&&e.activeValue&&!t.value&&(r=e.activeValue),r}),i=ot();ne([o,()=>e.activeValue],()=>{o.value&&(t.value=!1)},{immediate:!0});const c=H(()=>e.mode!=="combobox"&&!e.open&&!e.showSearch?!1:!!l.value||e.compositionStatus),a=H(()=>{const r=e.values[0];return r&&(typeof r.label=="string"||typeof r.label=="number")?r.label.toString():void 0}),f=()=>{if(e.values[0])return null;const r=c.value?{visibility:"hidden"}:void 0;return M("span",{class:`${e.prefixCls}-selection-placeholder`,style:r},[e.placeholder])},s=r=>{r.target.composing||(t.value=!0,e.onInputChange(r))};return()=>{var r,m,b,C;const{inputElement:g,prefixCls:y,id:w,values:x,inputRef:D,disabled:E,autofocus:I,autocomplete:v,activeDescendantId:P,open:O,tabindex:R,optionLabelRender:N,onInputKeyDown:A,onInputMouseDown:B,onInputPaste:U,onInputCompositionStart:Y,onInputCompositionEnd:W}=e,G=x[0];let z=null;if(G&&i.customSlots){const oe=(r=G.key)!==null&&r!==void 0?r:G.value,ie=((m=i.keyEntities[oe])===null||m===void 0?void 0:m.node)||{};z=i.customSlots[(b=ie.slots)===null||b===void 0?void 0:b.title]||i.customSlots.title||G.label,typeof z=="function"&&(z=z(ie))}else z=N&&G?N(G.option):G?.label;return M(Fe,null,[M("span",{class:`${y}-selection-search`},[M(Lt,{inputRef:D,prefixCls:y,id:w,open:O,inputElement:g,disabled:E,autofocus:I,autocomplete:v,editable:n.value,activeDescendantId:P,value:l.value,onKeydown:A,onMousedown:B,onChange:s,onPaste:U,onCompositionstart:Y,onCompositionend:W,tabindex:R,attrs:tt(e,!0)},null)]),!o.value&&G&&!c.value&&M("span",{class:`${y}-selection-item`,title:a.value},[M(Fe,{key:(C=G.key)!==null&&C!==void 0?C:G.value},[z])]),f()])}}});lt.props=uo;lt.inheritAttrs=!1;function co(e){return![_.ESC,_.SHIFT,_.BACKSPACE,_.TAB,_.WIN_KEY,_.ALT,_.META,_.WIN_KEY_RIGHT,_.CTRL,_.SEMICOLON,_.EQUALS,_.CAPS_LOCK,_.CONTEXT_MENU,_.F1,_.F2,_.F3,_.F4,_.F5,_.F6,_.F7,_.F8,_.F9,_.F10,_.F11,_.F12].includes(e)}function Bt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=null,o;De(()=>{clearTimeout(o)});function n(l){(l||t===null)&&(t=l),clearTimeout(o),o=setTimeout(()=>{t=null},e)}return[()=>t,n]}function Re(){const e=t=>{e.current=t};return e}const fo=fe({name:"Selector",inheritAttrs:!1,props:{id:String,prefixCls:String,showSearch:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},values:V.array,multiple:{type:Boolean,default:void 0},mode:String,searchValue:String,activeValue:String,inputElement:V.any,autofocus:{type:Boolean,default:void 0},activeDescendantId:String,tabindex:V.oneOfType([V.number,V.string]),disabled:{type:Boolean,default:void 0},placeholder:V.any,removeIcon:V.any,maxTagCount:V.oneOfType([V.number,V.string]),maxTagTextLength:Number,maxTagPlaceholder:V.any,tagRender:Function,optionLabelRender:Function,tokenWithEnter:{type:Boolean,default:void 0},choiceTransitionName:String,onToggleOpen:{type:Function},onSearch:Function,onSearchSubmit:Function,onRemove:Function,onInputKeyDown:{type:Function},domRef:Function},setup(e,t){let{expose:o}=t;const n=Re(),l=me(!1),[i,c]=Bt(0),a=x=>{const{which:D}=x;(D===_.UP||D===_.DOWN)&&x.preventDefault(),e.onInputKeyDown&&e.onInputKeyDown(x),D===_.ENTER&&e.mode==="tags"&&!l.value&&!e.open&&e.onSearchSubmit(x.target.value),co(D)&&e.onToggleOpen(!0)},f=()=>{c(!0)};let s=null;const r=x=>{e.onSearch(x,!0,l.value)!==!1&&e.onToggleOpen(!0)},m=()=>{l.value=!0},b=x=>{l.value=!1,e.mode!=="combobox"&&r(x.target.value)},C=x=>{let{target:{value:D}}=x;if(e.tokenWithEnter&&s&&/[\r\n]/.test(s)){const E=s.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");D=D.replace(E,s)}s=null,r(D)},g=x=>{const{clipboardData:D}=x;s=D.getData("text")},y=x=>{let{target:D}=x;D!==n.current&&(document.body.style.msTouchAction!==void 0?setTimeout(()=>{n.current.focus()}):n.current.focus())},w=x=>{const D=i();x.target!==n.current&&!D&&x.preventDefault(),(e.mode!=="combobox"&&(!e.showSearch||!D)||!e.open)&&(e.open&&e.onSearch("",!0,!1),e.onToggleOpen())};return o({focus:()=>{n.current.focus()},blur:()=>{n.current.blur()}}),()=>{const{prefixCls:x,domRef:D,mode:E}=e,I={inputRef:n,onInputKeyDown:a,onInputMouseDown:f,onInputChange:C,onInputPaste:g,compositionStatus:l.value,onInputCompositionStart:m,onInputCompositionEnd:b},v=E==="multiple"||E==="tags"?M(so,k(k({},e),I),null):M(lt,k(k({},e),I),null);return M("div",{ref:D,class:`${x}-selector`,onClick:y,onMousedown:w},[v])}}});function po(e,t,o){function n(l){var i,c,a;let f=l.target;f.shadowRoot&&l.composed&&(f=l.composedPath()[0]||f);const s=[(i=e[0])===null||i===void 0?void 0:i.value,(a=(c=e[1])===null||c===void 0?void 0:c.value)===null||a===void 0?void 0:a.getPopupElement()];t.value&&s.every(r=>r&&!r.contains(f)&&r!==f)&&o(!1)}ye(()=>{window.addEventListener("mousedown",n)}),De(()=>{window.removeEventListener("mousedown",n)})}function mo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;const t=X(!1);let o;const n=()=>{clearTimeout(o)};return ye(()=>{n()}),[t,(i,c)=>{n(),o=setTimeout(()=>{t.value=i,c&&c()},e)},n]}const _t=Symbol("BaseSelectContextKey");function vo(e){return ke(_t,e)}function ho(){return Be(_t,{})}function At(e){if(!Mn(e))return $e(e);const t=new Proxy({},{get(o,n,l){return Reflect.get(e.value,n,l)},set(o,n,l){return e.value[n]=l,!0},deleteProperty(o,n){return Reflect.deleteProperty(e.value,n)},has(o,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return $e(t)}var go=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};const bo=["value","onChange","removeIcon","placeholder","autofocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabindex","OptionList","notFoundContent"],So=()=>({prefixCls:String,id:String,omitDomProps:Array,displayValues:Array,onDisplayValuesChange:Function,activeValue:String,activeDescendantId:String,onActiveValueChange:Function,searchValue:String,onSearch:Function,onSearchSplit:Function,maxLength:Number,OptionList:V.any,emptyOptions:Boolean}),zt=()=>({showSearch:{type:Boolean,default:void 0},tagRender:{type:Function},optionLabelRender:{type:Function},direction:{type:String},tabindex:Number,autofocus:Boolean,notFoundContent:V.any,placeholder:V.any,onClear:Function,choiceTransitionName:String,mode:String,disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{type:Function},getInputElement:{type:Function},getRawInputElement:{type:Function},maxTagTextLength:Number,maxTagCount:{type:[String,Number]},maxTagPlaceholder:V.any,tokenSeparators:{type:Array},allowClear:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},inputIcon:V.any,clearIcon:V.any,removeIcon:V.any,animation:String,transitionName:String,dropdownStyle:{type:Object},dropdownClassName:String,dropdownMatchSelectWidth:{type:[Boolean,Number],default:void 0},dropdownRender:{type:Function},dropdownAlign:Object,placement:{type:String},getPopupContainer:{type:Function},showAction:{type:Array},onBlur:{type:Function},onFocus:{type:Function},onKeyup:Function,onKeydown:Function,onMousedown:Function,onPopupScroll:Function,onInputKeyDown:Function,onMouseenter:Function,onMouseleave:Function,onClick:Function}),yo=()=>S(S({},So()),zt());function it(e){return e==="tags"||e==="multiple"}const wo=fe({compatConfig:{MODE:3},name:"BaseSelect",inheritAttrs:!1,props:nt(yo(),{showAction:[],notFoundContent:"Not Found"}),setup(e,t){let{attrs:o,expose:n,slots:l}=t;const i=H(()=>it(e.mode)),c=H(()=>e.showSearch!==void 0?e.showSearch:i.value||e.mode==="combobox"),a=X(!1);ye(()=>{a.value=Hn()});const f=ot(),s=X(null),r=Re(),m=X(null),b=X(null),C=X(null),g=me(!1),[y,w,x]=mo();n({focus:()=>{var u;(u=b.value)===null||u===void 0||u.focus()},blur:()=>{var u;(u=b.value)===null||u===void 0||u.blur()},scrollTo:u=>{var d;return(d=C.value)===null||d===void 0?void 0:d.scrollTo(u)}});const I=H(()=>{var u;if(e.mode!=="combobox")return e.searchValue;const d=(u=e.displayValues[0])===null||u===void 0?void 0:u.value;return typeof d=="string"||typeof d=="number"?String(d):""}),v=e.open!==void 0?e.open:e.defaultOpen,P=X(v),O=X(v),R=u=>{P.value=e.open!==void 0?e.open:u,O.value=P.value};ne(()=>e.open,()=>{R(e.open)});const N=H(()=>!e.notFoundContent&&e.emptyOptions);Ie(()=>{O.value=P.value,(e.disabled||N.value&&O.value&&e.mode==="combobox")&&(O.value=!1)});const A=H(()=>N.value?!1:O.value),B=u=>{const d=u!==void 0?u:!O.value;O.value!==d&&!e.disabled&&(R(d),e.onDropdownVisibleChange&&e.onDropdownVisibleChange(d),!d&&K.value&&(K.value=!1,w(!1,()=>{L.value=!1,g.value=!1})))},U=H(()=>(e.tokenSeparators||[]).some(u=>[`
|
|
2
2
|
`,`\r
|
|
3
3
|
`].includes(u))),Y=(u,d,F)=>{var $,j;let q=!0,Z=u;($=e.onActiveValueChange)===null||$===void 0||$.call(e,null);const J=F?null:to(u,e.tokenSeparators);return e.mode!=="combobox"&&J&&(Z="",(j=e.onSearchSplit)===null||j===void 0||j.call(e,J),B(!1),q=!1),e.onSearch&&I.value!==Z&&e.onSearch(Z,{source:d?"typing":"effect"}),q},W=u=>{var d;!u||!u.trim()||(d=e.onSearch)===null||d===void 0||d.call(e,u,{source:"submit"})};ne(O,()=>{!O.value&&!i.value&&e.mode!=="combobox"&&Y("",!1,!1)},{immediate:!0,flush:"post"}),ne(()=>e.disabled,()=>{P.value&&e.disabled&&R(!1),e.disabled&&!g.value&&w(!1)},{immediate:!0});const[G,z]=Bt(),oe=function(u){var d;const F=G(),{which:$}=u;if($===_.ENTER&&(e.mode!=="combobox"&&u.preventDefault(),O.value||B(!0)),z(!!I.value),$===_.BACKSPACE&&!F&&i.value&&!I.value&&e.displayValues.length){const J=[...e.displayValues];let Q=null;for(let le=J.length-1;le>=0;le-=1){const ae=J[le];if(!ae.disabled){J.splice(le,1),Q=ae;break}}Q&&e.onDisplayValuesChange(J,{type:"remove",values:[Q]})}for(var j=arguments.length,q=new Array(j>1?j-1:0),Z=1;Z<j;Z++)q[Z-1]=arguments[Z];O.value&&C.value&&C.value.onKeydown(u,...q),(d=e.onKeydown)===null||d===void 0||d.call(e,u,...q)},ie=function(u){for(var d=arguments.length,F=new Array(d>1?d-1:0),$=1;$<d;$++)F[$-1]=arguments[$];O.value&&C.value&&C.value.onKeyup(u,...F),e.onKeyup&&e.onKeyup(u,...F)},p=u=>{const d=e.displayValues.filter(F=>F!==u);e.onDisplayValuesChange(d,{type:"remove",values:[u]})},L=X(!1),T=function(){w(!0),e.disabled||(e.onFocus&&!L.value&&e.onFocus(...arguments),e.showAction&&e.showAction.includes("focus")&&B(!0)),L.value=!0},K=me(!1),te=function(){if(K.value||(g.value=!0,w(!1,()=>{L.value=!1,g.value=!1,B(!1)}),e.disabled))return;const u=I.value;u&&(e.mode==="tags"?e.onSearch(u,{source:"submit"}):e.mode==="multiple"&&e.onSearch("",{source:"blur"})),e.onBlur&&e.onBlur(...arguments)},re=()=>{K.value=!0},se=()=>{K.value=!1};ke("VCSelectContainerEvent",{focus:T,blur:te});const ee=[];ye(()=>{ee.forEach(u=>clearTimeout(u)),ee.splice(0,ee.length)}),De(()=>{ee.forEach(u=>clearTimeout(u)),ee.splice(0,ee.length)});const ce=function(u){var d,F;const{target:$}=u,j=(d=m.value)===null||d===void 0?void 0:d.getPopupElement();if(j&&j.contains($)){const Q=setTimeout(()=>{var le;const ae=ee.indexOf(Q);ae!==-1&&ee.splice(ae,1),x(),!a.value&&!j.contains(document.activeElement)&&((le=b.value)===null||le===void 0||le.focus())});ee.push(Q)}for(var q=arguments.length,Z=new Array(q>1?q-1:0),J=1;J<q;J++)Z[J-1]=arguments[J];(F=e.onMousedown)===null||F===void 0||F.call(e,u,...Z)},de=X(null),h=()=>{};return ye(()=>{ne(A,()=>{var u;if(A.value){const d=Math.ceil((u=s.value)===null||u===void 0?void 0:u.offsetWidth);de.value!==d&&!Number.isNaN(d)&&(de.value=d)}},{immediate:!0,flush:"post"})}),po([s,m],A,B),vo(At(S(S({},En(e)),{open:O,triggerOpen:A,showSearch:c,multiple:i,toggleOpen:B}))),()=>{const u=S(S({},e),o),{prefixCls:d,id:F,open:$,defaultOpen:j,mode:q,showSearch:Z,searchValue:J,onSearch:Q,allowClear:le,clearIcon:ae,showArrow:Ve,inputIcon:He,disabled:Oe,loading:Ne,getInputElement:ct,getPopupContainer:Xt,placement:Qt,animation:qt,transitionName:Zt,dropdownStyle:Jt,dropdownClassName:kt,dropdownMatchSelectWidth:en,dropdownRender:tn,dropdownAlign:nn,showAction:cl,direction:on,tokenSeparators:dl,tagRender:ln,optionLabelRender:an,onPopupScroll:fl,onDropdownVisibleChange:pl,onFocus:ml,onBlur:vl,onKeyup:hl,onKeydown:gl,onMousedown:bl,onClear:ze,omitDomProps:We,getRawInputElement:dt,displayValues:Le,onDisplayValuesChange:rn,emptyOptions:sn,activeDescendantId:un,activeValue:cn,OptionList:dn}=u,fn=go(u,["prefixCls","id","open","defaultOpen","mode","showSearch","searchValue","onSearch","allowClear","clearIcon","showArrow","inputIcon","disabled","loading","getInputElement","getPopupContainer","placement","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","showAction","direction","tokenSeparators","tagRender","optionLabelRender","onPopupScroll","onDropdownVisibleChange","onFocus","onBlur","onKeyup","onKeydown","onMousedown","onClear","omitDomProps","getRawInputElement","displayValues","onDisplayValuesChange","emptyOptions","activeDescendantId","activeValue","OptionList"]),ft=q==="combobox"&&ct&&ct()||null,Te=typeof dt=="function"&&dt(),Ke=S({},fn);let pt;Te&&(pt=we=>{B(we)}),bo.forEach(we=>{delete Ke[we]}),We?.forEach(we=>{delete Ke[we]});const mt=Ve!==void 0?Ve:Ne||!i.value&&q!=="combobox";let vt;mt&&(vt=M(Ce,{class:ue(`${d}-arrow`,{[`${d}-arrow-loading`]:Ne}),customizeIcon:He,customizeIconProps:{loading:Ne,searchValue:I.value,open:O.value,focused:y.value,showSearch:c.value}},null));let ht;const pn=()=>{ze?.(),rn([],{type:"clear",values:Le}),Y("",!1,!1)};!Oe&&le&&(Le.length||I.value)&&(ht=M(Ce,{class:`${d}-clear`,onMousedown:pn,customizeIcon:ae},{default:()=>[qe("×")]}));const mn=M(dn,{ref:C},S(S({},f.customSlots),{option:l.option})),vn=ue(d,o.class,{[`${d}-focused`]:y.value,[`${d}-multiple`]:i.value,[`${d}-single`]:!i.value,[`${d}-allow-clear`]:le,[`${d}-show-arrow`]:mt,[`${d}-disabled`]:Oe,[`${d}-loading`]:Ne,[`${d}-open`]:O.value,[`${d}-customize-input`]:ft,[`${d}-show-search`]:c.value}),gt=M(lo,{ref:m,disabled:Oe,prefixCls:d,visible:A.value,popupElement:mn,containerWidth:de.value,animation:qt,transitionName:Zt,dropdownStyle:Jt,dropdownClassName:kt,direction:on,dropdownMatchSelectWidth:en,dropdownRender:tn,dropdownAlign:nn,placement:Qt,getPopupContainer:Xt,empty:sn,getTriggerDOMNode:()=>r.current,onPopupVisibleChange:pt,onPopupMouseEnter:h,onPopupFocusin:re,onPopupFocusout:se},{default:()=>Te?Pe(Te)&&Ht(Te,{ref:r},!1,!0):M(fo,k(k({},e),{},{domRef:r,prefixCls:d,inputElement:ft,ref:b,id:F,showSearch:c.value,mode:q,activeDescendantId:un,tagRender:ln,optionLabelRender:an,values:Le,open:O.value,onToggleOpen:B,activeValue:cn,searchValue:I.value,onSearch:Y,onSearchSubmit:W,onRemove:p,tokenWithEnter:U.value}),null)});let je;return Te?je=gt:je=M("div",k(k({},Ke),{},{class:vn,ref:s,onMousedown:ce,onKeydown:oe,onKeyup:ie}),[y.value&&!O.value&&M("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},[`${Le.map(we=>{let{label:bt,value:hn}=we;return["number","string"].includes(typeof bt)?bt:hn}).join(", ")}`]),gt,vt,ht]),je}}}),Ae=(e,t)=>{let{height:o,offset:n,prefixCls:l,onInnerResize:i}=e,{slots:c}=t;var a;let f={},s={display:"flex",flexDirection:"column"};return n!==void 0&&(f={height:`${o}px`,position:"relative",overflow:"hidden"},s=S(S({},s),{transform:`translateY(${n}px)`,position:"absolute",left:0,right:0,top:0})),M("div",{style:f},[M(Nn,{onResize:r=>{let{offsetHeight:m}=r;m&&i&&i()}},{default:()=>[M("div",{style:s,class:ue({[`${l}-holder-inner`]:l})},[(a=c.default)===null||a===void 0?void 0:a.call(c)])]})])};Ae.displayName="Filter";Ae.inheritAttrs=!1;Ae.props={prefixCls:String,height:Number,offset:Number,onInnerResize:Function};const Wt=(e,t)=>{let{setRef:o}=e,{slots:n}=t;var l;const i=Rt((l=n.default)===null||l===void 0?void 0:l.call(n));return i&&i.length?Vt(i[0],{ref:o}):i};Wt.props={setRef:{type:Function,default:()=>{}}};const Io=20;function Tt(e){return"touches"in e?e.touches[0].pageY:e.pageY}const Co=fe({compatConfig:{MODE:3},name:"ScrollBar",inheritAttrs:!1,props:{prefixCls:String,scrollTop:Number,scrollHeight:Number,height:Number,count:Number,onScroll:{type:Function},onStartMove:{type:Function},onStopMove:{type:Function}},setup(){return{moveRaf:null,scrollbarRef:Re(),thumbRef:Re(),visibleTimeout:null,state:$e({dragging:!1,pageY:null,startTop:null,visible:!1})}},watch:{scrollTop:{handler(){this.delayHidden()},flush:"post"}},mounted(){var e,t;(e=this.scrollbarRef.current)===null||e===void 0||e.addEventListener("touchstart",this.onScrollbarTouchStart,be?{passive:!1}:!1),(t=this.thumbRef.current)===null||t===void 0||t.addEventListener("touchstart",this.onMouseDown,be?{passive:!1}:!1)},beforeUnmount(){this.removeEvents(),clearTimeout(this.visibleTimeout)},methods:{delayHidden(){clearTimeout(this.visibleTimeout),this.state.visible=!0,this.visibleTimeout=setTimeout(()=>{this.state.visible=!1},2e3)},onScrollbarTouchStart(e){e.preventDefault()},onContainerMouseDown(e){e.stopPropagation(),e.preventDefault()},patchEvents(){window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),this.thumbRef.current.addEventListener("touchmove",this.onMouseMove,be?{passive:!1}:!1),this.thumbRef.current.addEventListener("touchend",this.onMouseUp)},removeEvents(){window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),this.scrollbarRef.current.removeEventListener("touchstart",this.onScrollbarTouchStart,be?{passive:!1}:!1),this.thumbRef.current&&(this.thumbRef.current.removeEventListener("touchstart",this.onMouseDown,be?{passive:!1}:!1),this.thumbRef.current.removeEventListener("touchmove",this.onMouseMove,be?{passive:!1}:!1),this.thumbRef.current.removeEventListener("touchend",this.onMouseUp)),he.cancel(this.moveRaf)},onMouseDown(e){const{onStartMove:t}=this.$props;S(this.state,{dragging:!0,pageY:Tt(e),startTop:this.getTop()}),t(),this.patchEvents(),e.stopPropagation(),e.preventDefault()},onMouseMove(e){const{dragging:t,pageY:o,startTop:n}=this.state,{onScroll:l}=this.$props;if(he.cancel(this.moveRaf),t){const i=Tt(e)-o,c=n+i,a=this.getEnableScrollRange(),f=this.getEnableHeightRange(),s=f?c/f:0,r=Math.ceil(s*a);this.moveRaf=he(()=>{l(r)})}},onMouseUp(){const{onStopMove:e}=this.$props;this.state.dragging=!1,e(),this.removeEvents()},getSpinHeight(){const{height:e,scrollHeight:t}=this.$props;let o=e/t*100;return o=Math.max(o,Io),o=Math.min(o,e/2),Math.floor(o)},getEnableScrollRange(){const{scrollHeight:e,height:t}=this.$props;return e-t||0},getEnableHeightRange(){const{height:e}=this.$props,t=this.getSpinHeight();return e-t||0},getTop(){const{scrollTop:e}=this.$props,t=this.getEnableScrollRange(),o=this.getEnableHeightRange();return e===0||t===0?0:e/t*o},showScroll(){const{height:e,scrollHeight:t}=this.$props;return t>e}},render(){const{dragging:e,visible:t}=this.state,{prefixCls:o}=this.$props,n=this.getSpinHeight()+"px",l=this.getTop()+"px",i=this.showScroll(),c=i&&t;return M("div",{ref:this.scrollbarRef,class:ue(`${o}-scrollbar`,{[`${o}-scrollbar-show`]:i}),style:{width:"8px",top:0,bottom:0,right:0,position:"absolute",display:c?void 0:"none"},onMousedown:this.onContainerMouseDown,onMousemove:this.delayHidden},[M("div",{ref:this.thumbRef,class:ue(`${o}-scrollbar-thumb`,{[`${o}-scrollbar-thumb-moving`]:e}),style:{width:"100%",height:n,top:l,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:"99px",cursor:"pointer",userSelect:"none"},onMousedown:this.onMouseDown},null)])}});function xo(e,t,o,n){const l=new Map,i=new Map,c=me(Symbol("update"));ne(e,()=>{c.value=Symbol("update")});let a;function f(){he.cancel(a)}function s(){f(),a=he(()=>{l.forEach((m,b)=>{if(m&&m.offsetParent){const{offsetHeight:C}=m;i.get(b)!==C&&(c.value=Symbol("update"),i.set(b,m.offsetHeight))}})})}function r(m,b){const C=t(m);l.get(C),b?(l.set(C,b.$el||b),s()):l.delete(C)}return Pn(()=>{f()}),[r,s,i,c]}function $o(e,t,o,n,l,i,c,a){let f;return s=>{if(s==null){a();return}he.cancel(f);const r=t.value,m=n.itemHeight;if(typeof s=="number")c(s);else if(s&&typeof s=="object"){let b;const{align:C}=s;"index"in s?{index:b}=s:b=r.findIndex(w=>l(w)===s.key);const{offset:g=0}=s,y=(w,x)=>{if(w<0||!e.value)return;const D=e.value.clientHeight;let E=!1,I=x;if(D){const v=x||C;let P=0,O=0,R=0;const N=Math.min(r.length,b);for(let U=0;U<=N;U+=1){const Y=l(r[U]);O=P;const W=o.get(Y);R=O+(W===void 0?m:W),P=R,U===b&&W===void 0&&(E=!0)}const A=e.value.scrollTop;let B=null;switch(v){case"top":B=O-g;break;case"bottom":B=R-D+g;break;default:{const U=A+D;O<A?I="top":R>U&&(I="bottom")}}B!==null&&B!==A&&c(B)}f=he(()=>{E&&i(),y(w-1,I)},2)};y(5)}}}const Oo=typeof navigator=="object"&&/Firefox/i.test(navigator.userAgent),Kt=((e,t)=>{let o=!1,n=null;function l(){clearTimeout(n),o=!0,n=setTimeout(()=>{o=!1},50)}return function(i){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const a=i<0&&e.value||i>0&&t.value;return c&&a?(clearTimeout(n),o=!1):(!a||o)&&l(),!o&&a}});function To(e,t,o,n){let l=0,i=null,c=null,a=!1;const f=Kt(t,o);function s(m){if(!e.value)return;he.cancel(i);const{deltaY:b}=m;l+=b,c=b,!f(b)&&(Oo||m.preventDefault(),i=he(()=>{n(l*(a?10:1)),l=0}))}function r(m){e.value&&(a=m.detail===c)}return[s,r]}const Mo=14/15;function Eo(e,t,o){let n=!1,l=0,i=null,c=null;const a=()=>{i&&(i.removeEventListener("touchmove",f),i.removeEventListener("touchend",s))},f=b=>{if(n){const C=Math.ceil(b.touches[0].pageY);let g=l-C;l=C,o(g)&&b.preventDefault(),clearInterval(c),c=setInterval(()=>{g*=Mo,(!o(g,!0)||Math.abs(g)<=.1)&&clearInterval(c)},16)}},s=()=>{n=!1,a()},r=b=>{a(),b.touches.length===1&&!n&&(n=!0,l=Math.ceil(b.touches[0].pageY),i=b.target,i.addEventListener("touchmove",f,{passive:!1}),i.addEventListener("touchend",s))},m=()=>{};ye(()=>{document.addEventListener("touchmove",m,{passive:!1}),ne(e,b=>{t.value.removeEventListener("touchstart",r),a(),clearInterval(c),b&&t.value.addEventListener("touchstart",r,{passive:!1})},{immediate:!0})}),De(()=>{document.removeEventListener("touchmove",m)})}var Po=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};const Fo=[],Ro={overflowY:"auto",overflowAnchor:"none"};function Do(e,t,o,n,l,i){let{getKey:c}=i;return e.slice(t,o+1).map((a,f)=>{const s=t+f,r=l(a,s,{}),m=c(a);return M(Wt,{key:m,setRef:b=>n(a,b)},{default:()=>[r]})})}const Vo=fe({compatConfig:{MODE:3},name:"List",inheritAttrs:!1,props:{prefixCls:String,data:V.array,height:Number,itemHeight:Number,fullHeight:{type:Boolean,default:void 0},itemKey:{type:[String,Number,Function],required:!0},component:{type:[String,Object]},virtual:{type:Boolean,default:void 0},children:Function,onScroll:Function,onMousedown:Function,onMouseenter:Function,onVisibleChange:Function},setup(e,t){let{expose:o}=t;const n=H(()=>{const{height:p,itemHeight:L,virtual:T}=e;return!!(T!==!1&&p&&L)}),l=H(()=>{const{height:p,itemHeight:L,data:T}=e;return n.value&&T&&L*T.length>p}),i=$e({scrollTop:0,scrollMoving:!1}),c=H(()=>e.data||Fo),a=X([]);ne(c,()=>{a.value=et(c.value).slice()},{immediate:!0});const f=X(p=>{});ne(()=>e.itemKey,p=>{typeof p=="function"?f.value=p:f.value=L=>L?.[p]},{immediate:!0});const s=X(),r=X(),m=X(),b=p=>f.value(p),C={getKey:b};function g(p){let L;typeof p=="function"?L=p(i.scrollTop):L=p;const T=P(L);s.value&&(s.value.scrollTop=T),i.scrollTop=T}const[y,w,x,D]=xo(a,b),E=$e({scrollHeight:void 0,start:0,end:0,offset:void 0}),I=X(0);ye(()=>{Ee(()=>{var p;I.value=((p=r.value)===null||p===void 0?void 0:p.offsetHeight)||0})}),Fn(()=>{Ee(()=>{var p;I.value=((p=r.value)===null||p===void 0?void 0:p.offsetHeight)||0})}),ne([n,a],()=>{n.value||S(E,{scrollHeight:void 0,start:0,end:a.value.length-1,offset:void 0})},{immediate:!0}),ne([n,a,I,l],()=>{n.value&&!l.value&&S(E,{scrollHeight:I.value,start:0,end:a.value.length-1,offset:void 0}),s.value&&(i.scrollTop=s.value.scrollTop)},{immediate:!0}),ne([l,n,()=>i.scrollTop,a,D,()=>e.height,I],()=>{if(!n.value||!l.value)return;let p=0,L,T,K;const te=a.value.length,re=a.value,se=i.scrollTop,{itemHeight:ee,height:ce}=e,de=se+ce;for(let h=0;h<te;h+=1){const u=re[h],d=b(u);let F=x.get(d);F===void 0&&(F=ee);const $=p+F;L===void 0&&$>=se&&(L=h,T=p),K===void 0&&$>de&&(K=h),p=$}L===void 0&&(L=0,T=0,K=Math.ceil(ce/ee)),K===void 0&&(K=te-1),K=Math.min(K+1,te),S(E,{scrollHeight:p,start:L,end:K,offset:T})},{immediate:!0});const v=H(()=>E.scrollHeight-e.height);function P(p){let L=p;return Number.isNaN(v.value)||(L=Math.min(L,v.value)),L=Math.max(L,0),L}const O=H(()=>i.scrollTop<=0),R=H(()=>i.scrollTop>=v.value),N=Kt(O,R);function A(p){g(p)}function B(p){var L;const{scrollTop:T}=p.currentTarget;T!==i.scrollTop&&g(T),(L=e.onScroll)===null||L===void 0||L.call(e,p)}const[U,Y]=To(n,O,R,p=>{g(L=>L+p)});Eo(n,s,(p,L)=>N(p,L)?!1:(U({preventDefault(){},deltaY:p}),!0));function W(p){n.value&&p.preventDefault()}const G=()=>{s.value&&(s.value.removeEventListener("wheel",U,be?{passive:!1}:!1),s.value.removeEventListener("DOMMouseScroll",Y),s.value.removeEventListener("MozMousePixelScroll",W))};Ie(()=>{Ee(()=>{s.value&&(G(),s.value.addEventListener("wheel",U,be?{passive:!1}:!1),s.value.addEventListener("DOMMouseScroll",Y),s.value.addEventListener("MozMousePixelScroll",W))})}),De(()=>{G()});const z=$o(s,a,x,e,b,w,g,()=>{var p;(p=m.value)===null||p===void 0||p.delayHidden()});o({scrollTo:z});const oe=H(()=>{let p=null;return e.height&&(p=S({[e.fullHeight?"height":"maxHeight"]:e.height+"px"},Ro),n.value&&(p.overflowY="hidden",i.scrollMoving&&(p.pointerEvents="none"))),p});return ne([()=>E.start,()=>E.end,a],()=>{if(e.onVisibleChange){const p=a.value.slice(E.start,E.end+1);e.onVisibleChange(p,a.value)}},{flush:"post"}),{state:i,mergedData:a,componentStyle:oe,onFallbackScroll:B,onScrollBar:A,componentRef:s,useVirtual:n,calRes:E,collectHeight:w,setInstance:y,sharedConfig:C,scrollBarRef:m,fillerInnerRef:r,delayHideScrollBar:()=>{var p;(p=m.value)===null||p===void 0||p.delayHidden()}}},render(){const e=S(S({},this.$props),this.$attrs),{prefixCls:t="rc-virtual-list",height:o,itemHeight:n,fullHeight:l,data:i,itemKey:c,virtual:a,component:f="div",onScroll:s,children:r=this.$slots.default,style:m,class:b}=e,C=Po(e,["prefixCls","height","itemHeight","fullHeight","data","itemKey","virtual","component","onScroll","children","style","class"]),g=ue(t,b),{scrollTop:y}=this.state,{scrollHeight:w,offset:x,start:D,end:E}=this.calRes,{componentStyle:I,onFallbackScroll:v,onScrollBar:P,useVirtual:O,collectHeight:R,sharedConfig:N,setInstance:A,mergedData:B,delayHideScrollBar:U}=this;return M("div",k({style:S(S({},m),{position:"relative"}),class:g},C),[M(f,{class:`${t}-holder`,style:I,ref:"componentRef",onScroll:v,onMouseenter:U},{default:()=>[M(Ae,{prefixCls:t,height:w,offset:x,onInnerResize:R,ref:"fillerInnerRef"},{default:()=>Do(B,D,E,A,r,N)})]}),O&&M(Co,{ref:"scrollBarRef",prefixCls:t,scrollTop:y,height:o,scrollHeight:w,count:B.length,onScroll:P,onStartMove:()=>{this.state.scrollMoving=!0},onStopMove:()=>{this.state.scrollMoving=!1}},null)])}});function Ho(e,t,o){const n=me(e());return ne(t,(l,i)=>{o?o(l,i)&&(n.value=e()):n.value=e()}),n}function No(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}const jt=Symbol("SelectContextKey");function Lo(e){return ke(jt,e)}function Bo(){return Be(jt,{})}var _o=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};function Mt(e){return typeof e=="string"||typeof e=="number"}const Ao=fe({compatConfig:{MODE:3},name:"OptionList",inheritAttrs:!1,setup(e,t){let{expose:o,slots:n}=t;const l=ho(),i=Bo(),c=H(()=>`${l.prefixCls}-item`),a=Ho(()=>i.flattenOptions,[()=>l.open,()=>i.flattenOptions],v=>v[0]),f=Re(),s=v=>{v.preventDefault()},r=v=>{f.current&&f.current.scrollTo(typeof v=="number"?{index:v}:v)},m=function(v){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const O=a.value.length;for(let R=0;R<O;R+=1){const N=(v+R*P+O)%O,{group:A,data:B}=a.value[N];if(!A&&!B.disabled)return N}return-1},b=$e({activeIndex:m(0)}),C=function(v){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;b.activeIndex=v;const O={source:P?"keyboard":"mouse"},R=a.value[v];if(!R){i.onActiveValue(null,-1,O);return}i.onActiveValue(R.value,v,O)};ne([()=>a.value.length,()=>l.searchValue],()=>{C(i.defaultActiveFirstOption!==!1?m(0):-1)},{immediate:!0});const g=v=>i.rawValues.has(v)&&l.mode!=="combobox";ne([()=>l.open,()=>l.searchValue],()=>{if(!l.multiple&&l.open&&i.rawValues.size===1){const v=Array.from(i.rawValues)[0],P=et(a.value).findIndex(O=>{let{data:R}=O;return R[i.fieldNames.value]===v});P!==-1&&(C(P),Ee(()=>{r(P)}))}l.open&&Ee(()=>{var v;(v=f.current)===null||v===void 0||v.scrollTo(void 0)})},{immediate:!0,flush:"post"});const y=v=>{v!==void 0&&i.onSelect(v,{selected:!i.rawValues.has(v)}),l.multiple||l.toggleOpen(!1)},w=v=>typeof v.label=="function"?v.label():v.label;function x(v){const P=a.value[v];if(!P)return null;const O=P.data||{},{value:R}=O,{group:N}=P,A=tt(O,!0),B=w(P);return P?M("div",k(k({"aria-label":typeof B=="string"&&!N?B:null},A),{},{key:v,role:N?"presentation":"option",id:`${l.id}_list_${v}`,"aria-selected":g(R)}),[R]):null}return o({onKeydown:v=>{const{which:P,ctrlKey:O}=v;switch(P){case _.N:case _.P:case _.UP:case _.DOWN:{let R=0;if(P===_.UP?R=-1:P===_.DOWN?R=1:No()&&O&&(P===_.N?R=1:P===_.P&&(R=-1)),R!==0){const N=m(b.activeIndex+R,R);r(N),C(N,!0)}break}case _.ENTER:{const R=a.value[b.activeIndex];R&&!R.data.disabled?y(R.value):y(void 0),l.open&&v.preventDefault();break}case _.ESC:l.toggleOpen(!1),l.open&&v.stopPropagation()}},onKeyup:()=>{},scrollTo:v=>{r(v)}}),()=>{const{id:v,notFoundContent:P,onPopupScroll:O}=l,{menuItemSelectedIcon:R,fieldNames:N,virtual:A,listHeight:B,listItemHeight:U}=i,Y=n.option,{activeIndex:W}=b,G=Object.keys(N).map(z=>N[z]);return a.value.length===0?M("div",{role:"listbox",id:`${v}_list`,class:`${c.value}-empty`,onMousedown:s},[P]):M(Fe,null,[M("div",{role:"listbox",id:`${v}_list`,style:{height:0,width:0,overflow:"hidden"}},[x(W-1),x(W),x(W+1)]),M(Vo,{itemKey:"key",ref:f,data:a.value,height:B,itemHeight:U,fullHeight:!1,onMousedown:s,onScroll:O,virtual:A},{default:(z,oe)=>{var ie;const{group:p,groupOption:L,data:T,value:K}=z,{key:te}=T,re=typeof z.label=="function"?z.label():z.label;if(p){const ae=(ie=T.title)!==null&&ie!==void 0?ie:Mt(re)&&re;return M("div",{class:ue(c.value,`${c.value}-group`),title:ae},[Y?Y(T):re!==void 0?re:te])}const{disabled:se,title:ee,children:ce,style:de,class:h,className:u}=T,d=_o(T,["disabled","title","children","style","class","className"]),F=_e(d,G),$=g(K),j=`${c.value}-option`,q=ue(c.value,j,h,u,{[`${j}-grouped`]:L,[`${j}-active`]:W===oe&&!se,[`${j}-disabled`]:se,[`${j}-selected`]:$}),Z=w(z),J=!R||typeof R=="function"||$,Q=typeof Z=="number"?Z:Z||K;let le=Mt(Q)?Q.toString():void 0;return ee!==void 0&&(le=ee),M("div",k(k({},F),{},{"aria-selected":$,class:q,title:le,onMousemove:ae=>{d.onMousemove&&d.onMousemove(ae),!(W===oe||se)&&C(oe)},onClick:ae=>{se||y(K),d.onClick&&d.onClick(ae)},style:de}),[M("div",{class:`${j}-content`},[Y?Y(T):Q]),Pe(R)||$,J&&M(Ce,{class:`${c.value}-option-state`,customizeIcon:R,customizeIconProps:{isSelected:$}},{default:()=>[$?"✓":null]})])}})])}}});var zo=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};function Wo(e){const t=e,{key:o,children:n}=t,l=t.props,{value:i,disabled:c}=l,a=zo(l,["value","disabled"]),f=n?.default;return S({key:o,value:i!==void 0?i:o,children:f,disabled:c||c===""},a)}function at(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Rt(e).map((n,l)=>{var i;if(!Pe(n)||!n.type)return null;const{type:{isSelectOptGroup:c},key:a,children:f,props:s}=n;if(t||!c)return Wo(n);const r=f&&f.default?f.default():void 0,m=s?.label||((i=f.label)===null||i===void 0?void 0:i.call(f))||a;return S(S({key:`__RC_SELECT_GRP__${a===null?l:String(a)}__`},s),{label:m,options:at(r||[])})}).filter(n=>n)}function Ko(e,t,o){const n=X(),l=X(),i=X(),c=X([]);return ne([e,t],()=>{e.value?c.value=et(e.value).slice():c.value=at(t.value)},{immediate:!0,deep:!0}),Ie(()=>{const a=c.value,f=new Map,s=new Map,r=o.value;function m(b){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(let g=0;g<b.length;g+=1){const y=b[g];!y[r.options]||C?(f.set(y[r.value],y),s.set(y[r.label],y)):m(y[r.options],!0)}}m(a),n.value=a,l.value=f,i.value=s}),{options:n,valueOptions:l,labelOptions:i}}let Et=0;const jo=bn();function Uo(){let e;return jo?(e=Et,Et+=1):e="TEST_OR_SSR",e}function Go(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:me("");const t=`rc_select_${Uo()}`;return e.value||t}function rt(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function Yo(e){const{mode:t,options:o,children:n,backfill:l,allowClear:i,placeholder:c,getInputElement:a,showSearch:f,onSearch:s,defaultOpen:r,autofocus:m,labelInValue:b,value:C,inputValue:g,optionLabelProp:y}=e,w=it(t),x=f!==void 0?f:w||t==="combobox",D=o||at(n);if(ve(t!=="tags"||D.every(E=>!E.disabled),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ve(t!=="combobox"||!y,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),ve(t==="combobox"||!l,"`backfill` only works with `combobox` mode."),ve(t==="combobox"||!a,"`getInputElement` only work with `combobox` mode."),St(t!=="combobox"||!a||!i||!c,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),s&&!x&&t!=="combobox"&&t!=="tags"&&ve(!1,"`onSearch` should work with `showSearch` instead of use alone."),St(!r||m,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autofocus` if needed."),C!=null){const E=rt(C);ve(!b||E.every(I=>typeof I=="object"&&("key"in I||"value"in I)),"`value` should in shape of `{ value: string | number, label?: any }` when you set `labelInValue` to `true`"),ve(!w||Array.isArray(C),"`value` should be array when `mode` is `multiple` or `tags`")}if(n){let E=null;n.some(I=>{var v;if(!Pe(I)||!I.type)return!1;const{type:P}=I;return P.isSelectOption?!1:P.isSelectOptGroup?!(((v=I.children)===null||v===void 0?void 0:v.default())||[]).every(N=>!Pe(N)||!I.type||N.type.isSelectOption?!0:(E=N.type,!1)):(E=P,!0)}),E&&ve(!1,`\`children\` should be \`Select.Option\` or \`Select.OptGroup\` instead of \`${E.displayName||E.name||E}\`.`),ve(g===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Ue(e,t){return rt(e).join("").toUpperCase().includes(t)}const Xo=((e,t,o,n,l)=>H(()=>{const i=o.value,c=l?.value,a=n?.value;if(!i||a===!1)return e.value;const{options:f,label:s,value:r}=t.value,m=[],b=typeof a=="function",C=i.toUpperCase(),g=b?a:(w,x)=>c?Ue(x[c],C):x[f]?Ue(x[s!=="children"?s:"label"],C):Ue(x[r],C),y=b?w=>Ze(w):w=>w;return e.value.forEach(w=>{if(w[f]){if(g(i,y(w)))m.push(w);else{const D=w[f].filter(E=>g(i,y(E)));D.length&&m.push(S(S({},w),{[f]:D}))}return}g(i,y(w))&&m.push(w)}),m})),Qo=((e,t)=>{const o=X({values:new Map,options:new Map});return[H(()=>{const{values:i,options:c}=o.value,a=e.value.map(r=>{var m;return r.label===void 0?S(S({},r),{label:(m=i.get(r.value))===null||m===void 0?void 0:m.label}):r}),f=new Map,s=new Map;return a.forEach(r=>{f.set(r.value,r),s.set(r.value,t.value.get(r.value)||c.get(r.value))}),o.value.values=f,o.value.options=s,a}),i=>t.value.get(i)||o.value.options.get(i)]}),qo=["inputValue"];function Ut(){return S(S({},zt()),{prefixCls:String,id:String,backfill:{type:Boolean,default:void 0},fieldNames:Object,inputValue:String,searchValue:String,onSearch:Function,autoClearSearchValue:{type:Boolean,default:void 0},onSelect:Function,onDeselect:Function,filterOption:{type:[Boolean,Function],default:void 0},filterSort:Function,optionFilterProp:String,optionLabelProp:String,options:Array,defaultActiveFirstOption:{type:Boolean,default:void 0},virtual:{type:Boolean,default:void 0},listHeight:Number,listItemHeight:Number,menuItemSelectedIcon:V.any,mode:String,labelInValue:{type:Boolean,default:void 0},value:V.any,defaultValue:V.any,onChange:Function,children:Array})}function Zo(e){return!e||typeof e!="object"}const Jo=fe({compatConfig:{MODE:3},name:"VcSelect",inheritAttrs:!1,props:nt(Ut(),{prefixCls:"vc-select",autoClearSearchValue:!0,listHeight:200,listItemHeight:20,dropdownMatchSelectWidth:!0}),setup(e,t){let{expose:o,attrs:n,slots:l}=t;const i=Go(ge(e,"id")),c=H(()=>it(e.mode)),a=H(()=>!!(!e.options&&e.children)),f=H(()=>e.filterOption===void 0&&e.mode==="combobox"?!1:e.filterOption),s=H(()=>Nt(e.fieldNames,a.value)),[r,m]=wt("",{value:H(()=>e.searchValue!==void 0?e.searchValue:e.inputValue),postState:h=>h||""}),b=Ko(ge(e,"options"),ge(e,"children"),s),{valueOptions:C,labelOptions:g,options:y}=b,w=h=>rt(h).map(d=>{var F,$;let j,q,Z,J;Zo(d)?j=d:(Z=d.key,q=d.label,j=(F=d.value)!==null&&F!==void 0?F:Z);const Q=C.value.get(j);return Q&&(q===void 0&&(q=Q?.[e.optionLabelProp||s.value.label]),Z===void 0&&(Z=($=Q?.key)!==null&&$!==void 0?$:j),J=Q?.disabled),{label:q,value:j,key:Z,disabled:J,option:Q}}),[x,D]=wt(e.defaultValue,{value:ge(e,"value")}),E=H(()=>{var h;const u=w(x.value);return e.mode==="combobox"&&!(!((h=u[0])===null||h===void 0)&&h.value)?[]:u}),[I,v]=Qo(E,C),P=H(()=>{if(!e.mode&&I.value.length===1){const h=I.value[0];if(h.value===null&&(h.label===null||h.label===void 0))return[]}return I.value.map(h=>{var u;return S(S({},h),{label:(u=typeof h.label=="function"?h.label():h.label)!==null&&u!==void 0?u:h.value})})}),O=H(()=>new Set(I.value.map(h=>h.value)));Ie(()=>{var h;if(e.mode==="combobox"){const u=(h=I.value[0])===null||h===void 0?void 0:h.value;u!=null&&m(String(u))}},{flush:"post"});const R=(h,u)=>{const d=u??h;return{[s.value.value]:h,[s.value.label]:d}},N=X();Ie(()=>{if(e.mode!=="tags"){N.value=y.value;return}const h=y.value.slice(),u=d=>C.value.has(d);[...I.value].sort((d,F)=>d.value<F.value?-1:1).forEach(d=>{const F=d.value;u(F)||h.push(R(F,d.label))}),N.value=h});const A=Xo(N,s,r,f,ge(e,"optionFilterProp")),B=H(()=>e.mode!=="tags"||!r.value||A.value.some(h=>h[e.optionFilterProp||"value"]===r.value)?A.value:[R(r.value),...A.value]),U=H(()=>e.filterSort?[...B.value].sort((h,u)=>e.filterSort(h,u)):B.value),Y=H(()=>eo(U.value,{fieldNames:s.value,childrenAsData:a.value})),W=h=>{const u=w(h);if(D(u),e.onChange&&(u.length!==I.value.length||u.some((d,F)=>{var $;return(($=I.value[F])===null||$===void 0?void 0:$.value)!==d?.value}))){const d=e.labelInValue?u.map($=>S(S({},$),{originLabel:$.label,label:typeof $.label=="function"?$.label():$.label})):u.map($=>$.value),F=u.map($=>Ze(v($.value)));e.onChange(c.value?d:d[0],c.value?F:F[0])}},[G,z]=It(null),[oe,ie]=It(0),p=H(()=>e.defaultActiveFirstOption!==void 0?e.defaultActiveFirstOption:e.mode!=="combobox"),L=function(h,u){let{source:d="keyboard"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};ie(u),e.backfill&&e.mode==="combobox"&&h!==null&&d==="keyboard"&&z(String(h))},T=(h,u)=>{const d=()=>{var F;const $=v(h),j=$?.[s.value.label];return[e.labelInValue?{label:typeof j=="function"?j():j,originLabel:j,value:h,key:(F=$?.key)!==null&&F!==void 0?F:h}:h,Ze($)]};if(u&&e.onSelect){const[F,$]=d();e.onSelect(F,$)}else if(!u&&e.onDeselect){const[F,$]=d();e.onDeselect(F,$)}},K=(h,u)=>{let d;const F=c.value?u.selected:!0;F?d=c.value?[...I.value,h]:[h]:d=I.value.filter($=>$.value!==h),W(d),T(h,F),e.mode==="combobox"?z(""):(!c.value||e.autoClearSearchValue)&&(m(""),z(""))},te=(h,u)=>{W(h),(u.type==="remove"||u.type==="clear")&&u.values.forEach(d=>{T(d.value,!1)})},re=(h,u)=>{var d;if(m(h),z(null),u.source==="submit"){const F=(h||"").trim();if(F){const $=Array.from(new Set([...O.value,F]));W($),T(F,!0),m("")}return}u.source!=="blur"&&(e.mode==="combobox"&&W(h),(d=e.onSearch)===null||d===void 0||d.call(e,h))},se=h=>{let u=h;e.mode!=="tags"&&(u=h.map(F=>{const $=g.value.get(F);return $?.value}).filter(F=>F!==void 0));const d=Array.from(new Set([...O.value,...u]));W(d),d.forEach(F=>{T(F,!0)})},ee=H(()=>e.virtual!==!1&&e.dropdownMatchSelectWidth!==!1);Lo(At(S(S({},b),{flattenOptions:Y,onActiveValue:L,defaultActiveFirstOption:p,onSelect:K,menuItemSelectedIcon:ge(e,"menuItemSelectedIcon"),rawValues:O,fieldNames:s,virtual:ee,listHeight:ge(e,"listHeight"),listItemHeight:ge(e,"listItemHeight"),childrenAsData:a}))),Ie(()=>{Yo(e)},{flush:"post"});const ce=me();o({focus(){var h;(h=ce.value)===null||h===void 0||h.focus()},blur(){var h;(h=ce.value)===null||h===void 0||h.blur()},scrollTo(h){var u;(u=ce.value)===null||u===void 0||u.scrollTo(h)}});const de=H(()=>_e(e,["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"]));return()=>M(wo,k(k(k({},de.value),n),{},{id:i,prefixCls:e.prefixCls,ref:ce,omitDomProps:qo,mode:e.mode,displayValues:P.value,onDisplayValuesChange:te,searchValue:r.value,onSearch:re,onSearchSplit:se,dropdownMatchSelectWidth:e.dropdownMatchSelectWidth,OptionList:Ao,emptyOptions:!Y.value.length,activeValue:G.value,activeDescendantId:`${i}_list_${oe.value}`}),l)}}),st=()=>null;st.isSelectOption=!0;st.displayName="ASelectOption";const ut=()=>null;ut.isSelectOptGroup=!0;ut.displayName="ASelectOptGroup";function ko(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{loading:o,multiple:n,prefixCls:l,hasFeedback:i,feedbackIcon:c,showArrow:a}=e,f=e.suffixIcon||t.suffixIcon&&t.suffixIcon(),s=e.clearIcon||t.clearIcon&&t.clearIcon(),r=e.menuItemSelectedIcon||t.menuItemSelectedIcon&&t.menuItemSelectedIcon(),m=e.removeIcon||t.removeIcon&&t.removeIcon(),b=s??M(Ln,null,null),C=x=>M(Fe,null,[a!==!1&&x,i&&c]);let g=null;if(f!==void 0)g=C(f);else if(o)g=C(M(Bn,{spin:!0},null));else{const x=`${l}-suffix`;g=D=>{let{open:E,showSearch:I}=D;return C(E&&I?M(zn,{class:x},null):M(Wn,{class:x},null))}}let y=null;r!==void 0?y=r:n?y=M(_n,null,null):y=null;let w=null;return m!==void 0?w=m:w=M(An,null,null),{clearIcon:b,suffixIcon:g,itemIcon:y,removeIcon:w}}const Pt=e=>{const{controlPaddingHorizontal:t}=e;return{position:"relative",display:"block",minHeight:e.controlHeight,padding:`${(e.controlHeight-e.fontSize*e.lineHeight)/2}px ${t}px`,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,boxSizing:"border-box"}},el=e=>{const{antCls:t,componentCls:o}=e,n=`${o}-item`;return[{[`${o}-dropdown`]:S(S({},Je(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,[`
|
|
4
4
|
&${t}-slide-up-enter${t}-slide-up-enter-active${o}-dropdown-placement-bottomLeft,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as q,m as J,h as N,r as Q,af as P,v as tt,f as y,a0 as et,w as nt,p as ot,q as st,J as it}from"./index-p2HYn89m.js";import{d as L,b as F,e as D,w as rt,c as C,F as O,s as I,r as lt}from"./vendor-Bn1JzzAn.js";import at from"./index-BsR7Y2NG.js";import{B as ut}from"./index-Dc77VR3H.js";import{R as ct}from"./icons-DG5UD-6K.js";import"./initDefaultProps-C3Djh9fa.js";import"./index-CUEU48o1.js";import"./isVisible-C7tPsqfj.js";import"./useState-CnxtbLoC.js";import"./raf-Deuc0E8-.js";import"./devWarning-Dol8jLEP.js";import"./compact-item-BTg602H5.js";import"./createContext-B6EGsdvp.js";import"./Compact-BwHIFkNC.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=I(null),E=I(null),t=I(!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",y(y({},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",y(y({},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,y({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,af as P,v as tt,f as y,a0 as et,w as nt,p as ot,q as st,J as it}from"./index-fk2Rjacw.js";import{d as L,b as F,e as D,w as rt,c as C,F as O,s as I,r as lt}from"./vendor-Bn1JzzAn.js";import at from"./index-CauoBQkH.js";import{B as ut}from"./index-sDoMHTNA.js";import{R as ct}from"./icons-DG5UD-6K.js";import"./initDefaultProps-CvyYJd7z.js";import"./index-2eyAXE3d.js";import"./isVisible-C7tPsqfj.js";import"./useState-CnxtbLoC.js";import"./raf-Deuc0E8-.js";import"./devWarning-Bj5nUW2v.js";import"./compact-item-BTt2GtOm.js";import"./createContext-D_VeUc1J.js";import"./Compact-izHNb4uz.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=I(null),E=I(null),t=I(!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",y(y({},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",y(y({},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,y({ref:o},i.value),null):C(Ct,i.value,null)]))}}}),Dt=et(Rt);export{Dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as re,m as ne,h as v,q as I,i as D,f as M,P as p,R as F}from"./index-
|
|
1
|
+
import{l as re,m as ne,h as v,q as I,i as D,f as M,P as p,R as F}from"./index-fk2Rjacw.js";import{d as L,c as g,p as Z,b as ae,r as ie,i as le,s as R,w as j,o as se,f as de}from"./vendor-Bn1JzzAn.js";import{a as G,S as ce}from"./injectionKey-BXVc-oGP.js";import{i as ue}from"./initDefaultProps-CvyYJd7z.js";import{i as ge}from"./isNumeric-DjvBa-1E.js";import{bf as fe,bc as _,ah as X}from"./icons-DG5UD-6K.js";const pe=e=>{const{componentCls:n,colorBgContainer:o,colorBgBody:s,colorText:a}=e;return{[`${n}-sider-light`]:{background:o,[`${n}-sider-trigger`]:{color:a,background:o},[`${n}-sider-zero-width-trigger`]:{color:a,background:o,border:`1px solid ${s}`,borderInlineStart:0}}}},me=e=>{const{antCls:n,componentCls:o,colorText:s,colorTextLightSolid:a,colorBgHeader:f,colorBgBody:d,colorBgTrigger:i,layoutHeaderHeight:c,layoutHeaderPaddingInline:h,layoutHeaderColor:x,layoutFooterPadding:t,layoutTriggerHeight:l,layoutZeroTriggerSize:y,motionDurationMid:S,motionDurationSlow:r,fontSize:m,borderRadius:u}=e;return{[o]:v(v({display:"flex",flex:"auto",flexDirection:"column",color:s,minHeight:0,background:d,"&, *":{boxSizing:"border-box"},[`&${o}-has-sider`]:{flexDirection:"row",[`> ${o}, > ${o}-content`]:{width:0}},[`${o}-header, &${o}-footer`]:{flex:"0 0 auto"},[`${o}-header`]:{height:c,paddingInline:h,color:x,lineHeight:`${c}px`,background:f,[`${n}-menu`]:{lineHeight:"inherit"}},[`${o}-footer`]:{padding:t,color:s,fontSize:m,background:d},[`${o}-content`]:{flex:"auto",minHeight:0},[`${o}-sider`]:{position:"relative",minWidth:0,background:f,transition:`all ${S}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${n}-menu${n}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:l},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:l,color:a,lineHeight:`${l}px`,textAlign:"center",background:i,cursor:"pointer",transition:`all ${S}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:c,insetInlineEnd:-y,zIndex:1,width:y,height:y,color:a,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:f,borderStartStartRadius:0,borderStartEndRadius:u,borderEndEndRadius:u,borderEndStartRadius:0,cursor:"pointer",transition:`background ${r} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${r}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-y,borderStartStartRadius:u,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:u}}}}},pe(e)),{"&-rtl":{direction:"rtl"}})}},he=re("Layout",e=>{const{colorText:n,controlHeightSM:o,controlHeight:s,controlHeightLG:a,marginXXS:f}=e,d=a*1.25,i=ne(e,{layoutHeaderHeight:s*2,layoutHeaderPaddingInline:d,layoutHeaderColor:n,layoutFooterPadding:`${o}px ${d}px`,layoutTriggerHeight:a+f*2,layoutZeroTriggerSize:a});return[me(i)]},e=>{const{colorBgLayout:n}=e;return{colorBgHeader:"#001529",colorBgBody:n,colorBgTrigger:"#002140"}}),O=()=>({prefixCls:String,hasSider:{type:Boolean,default:void 0},tagName:String});function B(e){let{suffixCls:n,tagName:o,name:s}=e;return a=>L({compatConfig:{MODE:3},name:s,props:O(),setup(d,i){let{slots:c}=i;const{prefixCls:h}=I(n,d);return()=>{const x=v(v({},d),{prefixCls:h.value,tagName:o});return g(a,x,c)}}})}const P=L({compatConfig:{MODE:3},props:O(),setup(e,n){let{slots:o}=n;return()=>g(e.tagName,{class:e.prefixCls},o)}}),xe=L({compatConfig:{MODE:3},inheritAttrs:!1,props:O(),setup(e,n){let{slots:o,attrs:s}=n;const{prefixCls:a,direction:f}=I("",e),[d,i]=he(a),c=ie([]);Z(G,{addSider:t=>{c.value=[...c.value,t]},removeSider:t=>{c.value=c.value.filter(l=>l!==t)}});const x=ae(()=>{const{prefixCls:t,hasSider:l}=e;return{[i.value]:!0,[`${t}`]:!0,[`${t}-has-sider`]:typeof l=="boolean"?l:c.value.length>0,[`${t}-rtl`]:f.value==="rtl"}});return()=>{const{tagName:t}=e;return d(g(t,v(v({},s),{class:[x.value,s.class]}),o))}}}),A=B({suffixCls:"layout",tagName:"section",name:"ALayout"})(xe),C=B({suffixCls:"layout-header",tagName:"header",name:"ALayoutHeader"})(P),w=B({suffixCls:"layout-footer",tagName:"footer",name:"ALayoutFooter"})(P),H=B({suffixCls:"layout-content",tagName:"main",name:"ALayoutContent"})(P),K={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px",xxxl:"1999.98px"},ye=()=>({prefixCls:String,collapsible:{type:Boolean,default:void 0},collapsed:{type:Boolean,default:void 0},defaultCollapsed:{type:Boolean,default:void 0},reverseArrow:{type:Boolean,default:void 0},zeroWidthTriggerStyle:{type:Object,default:void 0},trigger:p.any,width:p.oneOfType([p.number,p.string]),collapsedWidth:p.oneOfType([p.number,p.string]),breakpoint:p.oneOf(F("xs","sm","md","lg","xl","xxl","xxxl")),theme:p.oneOf(F("light","dark")).def("dark"),onBreakpoint:Function,onCollapse:Function}),ve=(()=>{let e=0;return function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e+=1,`${n}${e}`}})(),k=L({compatConfig:{MODE:3},name:"ALayoutSider",inheritAttrs:!1,props:ue(ye(),{collapsible:!1,defaultCollapsed:!1,reverseArrow:!1,width:200,collapsedWidth:80}),emits:["breakpoint","update:collapsed","collapse"],setup(e,n){let{emit:o,attrs:s,slots:a}=n;const{prefixCls:f}=I("layout-sider",e),d=le(G,void 0),i=R(!!(e.collapsed!==void 0?e.collapsed:e.defaultCollapsed)),c=R(!1);j(()=>e.collapsed,()=>{i.value=!!e.collapsed}),Z(ce,i);const h=(r,m)=>{e.collapsed===void 0&&(i.value=r),o("update:collapsed",r),o("collapse",r,m)},x=R(r=>{c.value=r.matches,o("breakpoint",r.matches),i.value!==r.matches&&h(r.matches,"responsive")});let t;function l(r){return x.value(r)}const y=ve("ant-sider-");d&&d.addSider(y),se(()=>{j(()=>e.breakpoint,()=>{try{t?.removeEventListener("change",l)}catch{t?.removeListener(l)}if(typeof window<"u"){const{matchMedia:r}=window;if(r&&e.breakpoint&&e.breakpoint in K){t=r(`(max-width: ${K[e.breakpoint]})`);try{t.addEventListener("change",l)}catch{t.addListener(l)}l(t)}}},{immediate:!0})}),de(()=>{try{t?.removeEventListener("change",l)}catch{t?.removeListener(l)}d&&d.removeSider(y)});const S=()=>{h(!i.value,"clickTrigger")};return()=>{var r,m;const u=f.value,{collapsedWidth:N,width:U,reverseArrow:T,zeroWidthTriggerStyle:V,trigger:$=(r=a.trigger)===null||r===void 0?void 0:r.call(a),collapsible:W,theme:q}=e,z=i.value?N:U,b=ge(z)?`${z}px`:String(z),E=parseFloat(String(N||0))===0?g("span",{onClick:S,class:D(`${u}-zero-width-trigger`,`${u}-zero-width-trigger-${T?"right":"left"}`),style:V},[$||g(fe,null,null)]):null,J={expanded:T?g(X,null,null):g(_,null,null),collapsed:T?g(_,null,null):g(X,null,null)},Q=i.value?"collapsed":"expanded",Y=J[Q],ee=$!==null?E||g("div",{class:`${u}-trigger`,onClick:S,style:{width:b}},[$||Y]):null,te=[s.style,{flex:`0 0 ${b}`,maxWidth:b,minWidth:b,width:b}],oe=D(u,`${u}-${q}`,{[`${u}-collapsed`]:!!i.value,[`${u}-has-trigger`]:W&&$!==null&&!E,[`${u}-below`]:!!c.value,[`${u}-zero-width`]:parseFloat(b)===0},s.class);return g("aside",M(M({},s),{},{class:oe,style:te}),[g("div",{class:`${u}-children`},[(m=a.default)===null||m===void 0?void 0:m.call(a)]),W||c.value&&E?ee:null])}}}),ke=C,Le=w,Be=k,Te=H,ze=v(A,{Header:C,Footer:w,Content:H,Sider:k,install:e=>(e.component(A.name,A),e.component(C.name,C),e.component(w.name,w),e.component(k.name,k),e.component(H.name,H),e)});export{Te as LayoutContent,Le as LayoutFooter,ke as LayoutHeader,Be as LayoutSider,ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as L,m as O,h as w,r as V,n as W,a0 as _,M as A,q as X,f as $,a1 as v,P as c,R,w as f}from"./index-
|
|
1
|
+
import{l as L,m as O,h as w,r as V,n as W,a0 as _,M as A,q as X,f as $,a1 as v,P as c,R,w as f}from"./index-fk2Rjacw.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-Bn1JzzAn.js";import{T as G,L as Q}from"./icons-DG5UD-6K.js";import{K as C}from"./KeyCode-D63Tfrq7.js";import{W as J}from"./index-2eyAXE3d.js";import{u as Y}from"./FormItemContext-vx3daNDF.js";import{o as Z}from"./omit-BCXAtHCq.js";import"./isVisible-C7tPsqfj.js";import"./useState-CnxtbLoC.js";import"./raf-Deuc0E8-.js";import"./devWarning-Bj5nUW2v.js";import"./createContext-D_VeUc1J.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({},V(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=L("Switch",i=>{const n=i.fontSize*i.lineHeight,e=i.controlHeight/2,t=2,h=n-t*2,l=e-t*2,s=O(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 G("#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)},B=a=>{var r;(r=u.value)===null||r===void 0||r.blur(),l("mouseup",a)},F=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:B,type:"button",role:"switch","aria-checked":S.value,disabled:g.value||i.loading,class:[e.class,F.value],ref:u}),[o("div",{class:`${d.value}-handle`},[i.loading?o(Q,{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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as oo,m as eo,h as I,r as H,K as to,at as K,M as _,q as M,i as V,f as D,P as L,a5 as E,H as z,af as j,a7 as ro}from"./index-
|
|
1
|
+
import{l as oo,m as eo,h as I,r as H,K as to,at as K,M as _,q as M,i as V,f as D,P as L,a5 as E,H as z,af as j,a7 as ro}from"./index-fk2Rjacw.js";import{p as U,i as N,d as W,b as O,c as T,r as F,w as no,n as ao}from"./vendor-Bn1JzzAn.js";import{V as io}from"./Checkbox-Du0Yg5Pi.js";import{u as X,F as lo}from"./FormItemContext-vx3daNDF.js";import{o as so}from"./omit-BCXAtHCq.js";import"./icons-DG5UD-6K.js";import"./initDefaultProps-CvyYJd7z.js";import"./devWarning-Bj5nUW2v.js";import"./createContext-D_VeUc1J.js";const q=Symbol("radioGroupContextKey"),co=o=>{U(q,o)},uo=()=>N(q,void 0),J=Symbol("radioOptionTypeContextKey"),po=o=>{U(J,o)},bo=()=>N(J,void 0),go=new to("antRadioEffect",{"0%":{transform:"scale(1)",opacity:.5},"100%":{transform:"scale(1.6)",opacity:0}}),ho=o=>{const{componentCls:r,antCls:n}=o,t=`${r}-group`;return{[t]:I(I({},H(o)),{display:"inline-block",fontSize:0,[`&${t}-rtl`]:{direction:"rtl"},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:"none"}})}},fo=o=>{const{componentCls:r,radioWrapperMarginRight:n,radioCheckedColor:t,radioSize:e,motionDurationSlow:d,motionDurationMid:s,motionEaseInOut:w,motionEaseInOutCirc:f,radioButtonBg:b,colorBorder:B,lineWidth:g,radioDotSize:C,colorBgContainerDisabled:x,colorTextDisabled:c,paddingXS:h,radioDotDisabledColor:a,lineType:m,radioDotDisabledSize:u,wireframe:p,colorWhite:y}=o,i=`${r}-inner`;return{[`${r}-wrapper`]:I(I({},H(o)),{position:"relative",display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",[`&${r}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:o.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${r}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${g}px ${m} ${t}`,borderRadius:"50%",visibility:"hidden",animationName:go,animationDuration:d,animationTimingFunction:w,animationFillMode:"both",content:'""'},[r]:I(I({},H(o)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center"}),[`${r}-wrapper:hover &,
|
|
2
2
|
&:hover ${i}`]:{borderColor:t},[`${r}-input:focus-visible + ${i}`]:I({},K(o)),[`${r}:hover::after, ${r}-wrapper:hover &::after`]:{visibility:"visible"},[`${r}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:e,height:e,marginBlockStart:e/-2,marginInlineStart:e/-2,backgroundColor:p?t:y,borderBlockStart:0,borderInlineStart:0,borderRadius:e,transform:"scale(0)",opacity:0,transition:`all ${d} ${f}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:e,height:e,backgroundColor:b,borderColor:B,borderStyle:"solid",borderWidth:g,borderRadius:"50%",transition:`all ${s}`},[`${r}-input`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,insetBlockEnd:0,insetInlineStart:0,zIndex:1,cursor:"pointer",opacity:0},[`${r}-checked`]:{[i]:{borderColor:t,backgroundColor:p?b:t,"&::after":{transform:`scale(${C/e})`,opacity:1,transition:`all ${d} ${f}`}}},[`${r}-disabled`]:{cursor:"not-allowed",[i]:{backgroundColor:x,borderColor:B,cursor:"not-allowed","&::after":{backgroundColor:a}},[`${r}-input`]:{cursor:"not-allowed"},[`${r}-disabled + span`]:{color:c,cursor:"not-allowed"},[`&${r}-checked`]:{[i]:{"&::after":{transform:`scale(${u/e})`}}}},[`span${r} + *`]:{paddingInlineStart:h,paddingInlineEnd:h}})}},Co=o=>{const{radioButtonColor:r,controlHeight:n,componentCls:t,lineWidth:e,lineType:d,colorBorder:s,motionDurationSlow:w,motionDurationMid:f,radioButtonPaddingHorizontal:b,fontSize:B,radioButtonBg:g,fontSizeLG:C,controlHeightLG:x,controlHeightSM:c,paddingXS:h,borderRadius:a,borderRadiusSM:m,borderRadiusLG:u,radioCheckedColor:p,radioButtonCheckedBg:y,radioButtonHoverColor:i,radioButtonActiveColor:v,radioSolidCheckedColor:R,colorTextDisabled:l,colorBgContainerDisabled:S,radioDisabledButtonCheckedColor:P,radioDisabledButtonCheckedBg:G}=o;return{[`${t}-button-wrapper`]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:b,paddingBlock:0,color:r,fontSize:B,lineHeight:`${n-e*2}px`,background:g,border:`${e}px ${d} ${s}`,borderBlockStartWidth:e+.02,borderInlineStartWidth:0,borderInlineEndWidth:e,cursor:"pointer",transition:[`color ${f}`,`background ${f}`,`border-color ${f}`,`box-shadow ${f}`].join(","),a:{color:r},[`> ${t}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-e,insetInlineStart:-e,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:e,paddingInline:0,backgroundColor:s,transition:`background-color ${w}`,content:'""'}},"&:first-child":{borderInlineStart:`${e}px ${d} ${s}`,borderStartStartRadius:a,borderEndStartRadius:a},"&:last-child":{borderStartEndRadius:a,borderEndEndRadius:a},"&:first-child:last-child":{borderRadius:a},[`${t}-group-large &`]:{height:x,fontSize:C,lineHeight:`${x-e*2}px`,"&:first-child":{borderStartStartRadius:u,borderEndStartRadius:u},"&:last-child":{borderStartEndRadius:u,borderEndEndRadius:u}},[`${t}-group-small &`]:{height:c,paddingInline:h-e,paddingBlock:0,lineHeight:`${c-e*2}px`,"&:first-child":{borderStartStartRadius:m,borderEndStartRadius:m},"&:last-child":{borderStartEndRadius:m,borderEndEndRadius:m}},"&:hover":{position:"relative",color:p},"&:has(:focus-visible)":I({},K(o)),[`${t}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${t}-button-wrapper-disabled)`]:{zIndex:1,color:p,background:y,borderColor:p,"&::before":{backgroundColor:p},"&:first-child":{borderColor:p},"&:hover":{color:i,borderColor:i,"&::before":{backgroundColor:i}},"&:active":{color:v,borderColor:v,"&::before":{backgroundColor:v}}},[`${t}-group-solid &-checked:not(${t}-button-wrapper-disabled)`]:{color:R,background:p,borderColor:p,"&:hover":{color:R,background:i,borderColor:i},"&:active":{color:R,background:v,borderColor:v}},"&-disabled":{color:l,backgroundColor:S,borderColor:s,cursor:"not-allowed","&:first-child, &:hover":{color:l,backgroundColor:S,borderColor:s}},[`&-disabled${t}-button-wrapper-checked`]:{color:P,backgroundColor:G,borderColor:s,boxShadow:"none"}}}},Q=oo("Radio",o=>{const{padding:r,lineWidth:n,controlItemBgActiveDisabled:t,colorTextDisabled:e,colorBgContainer:d,fontSizeLG:s,controlOutline:w,colorPrimaryHover:f,colorPrimaryActive:b,colorText:B,colorPrimary:g,marginXS:C,controlOutlineWidth:x,colorTextLightSolid:c,wireframe:h}=o,a=`0 0 0 ${x}px ${w}`,m=a,u=s,p=4,y=u-p*2,i=h?y:u-(p+n)*2,v=g,R=B,l=f,S=b,P=r-n,$=eo(o,{radioFocusShadow:a,radioButtonFocusShadow:m,radioSize:u,radioDotSize:i,radioDotDisabledSize:y,radioCheckedColor:v,radioDotDisabledColor:e,radioSolidCheckedColor:c,radioButtonBg:d,radioButtonCheckedBg:d,radioButtonColor:R,radioButtonHoverColor:l,radioButtonActiveColor:S,radioButtonPaddingHorizontal:P,radioDisabledButtonCheckedBg:t,radioDisabledButtonCheckedColor:e,radioWrapperMarginRight:C});return[ho($),fo($),Co($)]});var vo=function(o,r){var n={};for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&r.indexOf(t)<0&&(n[t]=o[t]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,t=Object.getOwnPropertySymbols(o);e<t.length;e++)r.indexOf(t[e])<0&&Object.prototype.propertyIsEnumerable.call(o,t[e])&&(n[t[e]]=o[t[e]]);return n};const Y=()=>({prefixCls:String,checked:z(),disabled:z(),isGroup:z(),value:L.any,name:String,id:String,autofocus:z(),onChange:E(),onFocus:E(),onBlur:E(),onClick:E(),"onUpdate:checked":E(),"onUpdate:value":E()}),k=W({compatConfig:{MODE:3},name:"ARadio",inheritAttrs:!1,props:Y(),setup(o,r){let{emit:n,expose:t,slots:e,attrs:d}=r;const s=X(),w=lo.useInject(),f=bo(),b=uo(),B=_(),g=O(()=>{var l;return(l=h.value)!==null&&l!==void 0?l:B.value}),C=F(),{prefixCls:x,direction:c,disabled:h}=M("radio",o),a=O(()=>b?.optionType.value==="button"||f==="button"?`${x.value}-button`:x.value),m=_(),[u,p]=Q(x);t({focus:()=>{C.value.focus()},blur:()=>{C.value.blur()}});const v=l=>{const S=l.target.checked;n("update:checked",S),n("update:value",S),n("change",l),s.onFieldChange()},R=l=>{n("change",l),b&&b.onChange&&b.onChange(l)};return()=>{var l;const S=b,{prefixCls:P,id:G=s.id.value}=o,A=vo(o,["prefixCls","id"]),$=I(I({prefixCls:a.value,id:G},so(A,["onUpdate:checked","onUpdate:value"])),{disabled:(l=h.value)!==null&&l!==void 0?l:m.value});S?($.name=S.name.value,$.onChange=R,$.checked=o.value===S.value.value,$.disabled=g.value||S.disabled.value):$.onChange=v;const Z=V({[`${a.value}-wrapper`]:!0,[`${a.value}-wrapper-checked`]:$.checked,[`${a.value}-wrapper-disabled`]:$.disabled,[`${a.value}-wrapper-rtl`]:c.value==="rtl",[`${a.value}-wrapper-in-form-item`]:w.isFormItemInput},d.class,p.value);return u(T("label",D(D({},d),{},{class:Z}),[T(io,D(D({},$),{},{type:"radio",ref:C}),null),e.default&&T("span",null,[e.default()])]))}}}),mo=()=>({prefixCls:String,value:L.any,size:j(),options:ro(),disabled:z(),name:String,buttonStyle:j("outline"),id:String,optionType:j("default"),onChange:E(),"onUpdate:value":E()}),So=W({compatConfig:{MODE:3},name:"ARadioGroup",inheritAttrs:!1,props:mo(),setup(o,r){let{slots:n,emit:t,attrs:e}=r;const d=X(),{prefixCls:s,direction:w,size:f}=M("radio",o),[b,B]=Q(s),g=F(o.value),C=F(!1);return no(()=>o.value,c=>{g.value=c,C.value=!1}),co({onChange:c=>{const h=g.value,{value:a}=c.target;"value"in o||(g.value=a),!C.value&&a!==h&&(C.value=!0,t("update:value",a),t("change",c),d.onFieldChange()),ao(()=>{C.value=!1})},value:g,disabled:O(()=>o.disabled),name:O(()=>o.name),optionType:O(()=>o.optionType)}),()=>{var c;const{options:h,buttonStyle:a,id:m=d.id.value}=o,u=`${s.value}-group`,p=V(u,`${u}-${a}`,{[`${u}-${f.value}`]:f.value,[`${u}-rtl`]:w.value==="rtl"},e.class,B.value);let y=null;return h&&h.length>0?y=h.map(i=>{if(typeof i=="string"||typeof i=="number")return T(k,{key:i,prefixCls:s.value,disabled:o.disabled,value:i,checked:g.value===i},{default:()=>[i]});const{value:v,disabled:R,label:l}=i;return T(k,{key:`radio-group-value-options-${v}`,prefixCls:s.value,disabled:R||o.disabled,value:v,checked:g.value===v},{default:()=>[l]})}):y=(c=n.default)===null||c===void 0?void 0:c.call(n),b(T("div",D(D({},e),{},{class:p,id:m}),[y]))}}}),$o=W({compatConfig:{MODE:3},name:"ARadioButton",inheritAttrs:!1,props:Y(),setup(o,r){let{slots:n,attrs:t}=r;const{prefixCls:e}=M("radio",o);return po("button"),()=>{var d;return T(k,D(D(D({},t),o),{},{prefixCls:e.value}),{default:()=>[(d=n.default)===null||d===void 0?void 0:d.call(n)]})}}});k.Group=So;k.Button=$o;k.install=function(o){return o.component(k.name,k),o.component(k.Group.name,k.Group),o.component(k.Button.name,k.Button),o};export{$o as Button,So as Group,$o as RadioButton,So as RadioGroup,k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as p,b as i,p as $}from"./vendor-Bn1JzzAn.js";import{l as d,m as u,h as a}from"./index-
|
|
1
|
+
import{i as p,b as i,p as $}from"./vendor-Bn1JzzAn.js";import{l as d,m as u,h as a}from"./index-fk2Rjacw.js";const c=Symbol("rowContextKey"),w=o=>{$(c,o)},I=()=>p(c,{gutter:i(()=>{}),wrap:i(()=>{}),supportFlexGap:i(()=>{})}),m=o=>{const{componentCls:e}=o;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around ":{justifyContent:"space-around"},"&-space-evenly ":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},f=o=>{const{componentCls:e}=o;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},y=(o,e)=>{const{componentCls:t,gridColumns:s}=o,r={};for(let n=s;n>=0;n--)n===0?(r[`${t}${e}-${n}`]={display:"none"},r[`${t}-push-${n}`]={insetInlineStart:"auto"},r[`${t}-pull-${n}`]={insetInlineEnd:"auto"},r[`${t}${e}-push-${n}`]={insetInlineStart:"auto"},r[`${t}${e}-pull-${n}`]={insetInlineEnd:"auto"},r[`${t}${e}-offset-${n}`]={marginInlineEnd:0},r[`${t}${e}-order-${n}`]={order:0}):(r[`${t}${e}-${n}`]={display:"block",flex:`0 0 ${n/s*100}%`,maxWidth:`${n/s*100}%`},r[`${t}${e}-push-${n}`]={insetInlineStart:`${n/s*100}%`},r[`${t}${e}-pull-${n}`]={insetInlineEnd:`${n/s*100}%`},r[`${t}${e}-offset-${n}`]={marginInlineStart:`${n/s*100}%`},r[`${t}${e}-order-${n}`]={order:n});return r},l=(o,e)=>y(o,e),x=(o,e,t)=>({[`@media (min-width: ${e}px)`]:a({},l(o,t))}),M=d("Grid",o=>[m(o)]),b=d("Grid",o=>{const e=u(o,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[f(e),l(e,""),l(e,"-xs"),Object.keys(t).map(s=>x(e,t[s],s)).reduce((s,r)=>a(a({},s),r),{})]});export{b as a,M as b,w as c,I as u};
|