@esri/calcite-components 5.0.0-next.4 → 5.0.0-next.5
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/dist/calcite/{TS65SISB.js → 2GG4AF5T.js} +1 -1
- package/dist/calcite/{CDLGLCFD.js → 2HKRJLBG.js} +2 -2
- package/dist/calcite/{RBJEATU3.js → 2IWOXJH7.js} +2 -2
- package/dist/calcite/{WLLFG3M7.js → 2KH3AUCG.js} +2 -2
- package/dist/calcite/{H3EPIYLG.js → 2VKJIYLT.js} +1 -1
- package/dist/calcite/{JBMFTM4R.js → 2YBCAJSV.js} +2 -2
- package/dist/calcite/{26KO5WLB.js → 3266GV6Z.js} +2 -2
- package/dist/calcite/{WGQ2SERU.js → 3HXEF55M.js} +2 -2
- package/dist/calcite/{MHGTLCFX.js → 3KUVOQAL.js} +2 -2
- package/dist/calcite/{6OSIXZYU.js → 3NOZ7M75.js} +2 -2
- package/dist/calcite/{TLLHA7VC.js → 3YZG7MA3.js} +2 -2
- package/dist/calcite/{R2KPGC7W.js → 45F6XOYY.js} +2 -2
- package/dist/calcite/{EWNCXKJC.js → 4ARTWEEZ.js} +2 -2
- package/dist/calcite/{544AASIY.js → 4GHB4NY4.js} +2 -2
- package/dist/calcite/{ETHM6IZM.js → 4JZMONLD.js} +2 -2
- package/dist/calcite/{BG5JIUF3.js → 5AL5GWRD.js} +2 -2
- package/dist/calcite/{Z6CRZOOK.js → 5IPJANUU.js} +2 -2
- package/dist/calcite/{AK4EMEY2.js → 5K2Z2TMW.js} +2 -2
- package/dist/calcite/{VLOLYD36.js → 5LAPR75M.js} +2 -2
- package/dist/calcite/{7TJP2ISL.js → 62OUMNJ6.js} +2 -2
- package/dist/calcite/{DNVDDGB7.js → 67HVFNHP.js} +2 -2
- package/dist/calcite/{HZVCGOQL.js → 6J5W2PAJ.js} +2 -2
- package/dist/calcite/{MM5GOLON.js → 6VPACZP5.js} +2 -2
- package/dist/calcite/{Y6BDELTJ.js → 6VQ5IL36.js} +2 -2
- package/dist/calcite/{U3RNUZF6.js → 73LRFHS4.js} +2 -2
- package/dist/calcite/{QW2OFS26.js → 7DTG5KDL.js} +2 -2
- package/dist/calcite/{SBO2DPVJ.js → 7IHVHMIY.js} +2 -2
- package/dist/calcite/{QNVFFZ3F.js → 7IYAKB7Q.js} +2 -2
- package/dist/calcite/{3PSVZRKA.js → 7NUC3WBG.js} +1 -1
- package/dist/calcite/{RSHJ2ULC.js → 7PFVW4JF.js} +1 -1
- package/dist/calcite/{6CJF3ZME.js → 7QP5BUGE.js} +2 -2
- package/dist/calcite/{2J5IS422.js → 7XJU5OTS.js} +2 -2
- package/dist/calcite/{POOH5QBE.js → 7ZNR3GNI.js} +2 -2
- package/dist/calcite/{PQACJ4N6.js → A4CO6B7Z.js} +2 -2
- package/dist/calcite/{AKR5JHPW.js → AHOXXRX5.js} +2 -2
- package/dist/calcite/{J2NLU7RP.js → ALDDSDTX.js} +1 -1
- package/dist/calcite/{VV3MILRZ.js → APIFFM3O.js} +2 -2
- package/dist/calcite/{FNH5JSBK.js → AQ4DKRX6.js} +2 -2
- package/dist/calcite/{SQ25UCSA.js → AUF6YLAM.js} +2 -2
- package/dist/calcite/{CSQVLDPF.js → AUIOWPFN.js} +2 -2
- package/dist/calcite/{D5SFHDV6.js → B5JXPZDV.js} +2 -2
- package/dist/calcite/{TCB3D44T.js → BE5OB2TH.js} +2 -2
- package/dist/calcite/{PWWVHZBN.js → BEUZYBM5.js} +3 -3
- package/dist/calcite/{WYHGKROL.js → BFINWHLX.js} +2 -2
- package/dist/calcite/{QRBJKU6C.js → BHBYSC5H.js} +2 -2
- package/dist/calcite/{GTU5X7O7.js → BHU252WA.js} +2 -2
- package/dist/calcite/{NI3OLQU4.js → BNKVQYLQ.js} +2 -2
- package/dist/calcite/{P2J4VCQF.js → BYZPKQRD.js} +2 -2
- package/dist/calcite/{AAV5EWQK.js → C2X6VADY.js} +2 -2
- package/dist/calcite/{G73EBLG4.js → C3BQ4W7K.js} +2 -2
- package/dist/calcite/{YASA2V4I.js → C4S2BOWK.js} +2 -2
- package/dist/calcite/{GU5MLWDX.js → CF6DTFNX.js} +2 -2
- package/dist/calcite/{VZVYZPXQ.js → CIU4VM7X.js} +2 -2
- package/dist/calcite/{X2PZLQSO.js → CJWGQETT.js} +2 -2
- package/dist/calcite/{VBGPBKJL.js → CQMVTE7J.js} +2 -2
- package/dist/calcite/{CAHGZMOM.js → CTLGVBKW.js} +2 -2
- package/dist/calcite/{K6FTZ2ZF.js → CUL3VHSD.js} +2 -2
- package/dist/calcite/{RUMWLVIQ.js → CVLFEMH2.js} +2 -2
- package/dist/calcite/{Q2KBZ6FQ.js → DDW4WTS2.js} +2 -2
- package/dist/calcite/{WDKPAPPB.js → DDXY7TRY.js} +2 -2
- package/dist/calcite/{2C6PV6LO.js → DJVVGNTK.js} +1 -1
- package/dist/calcite/{5FUKNERA.js → DOH3ZW2R.js} +2 -2
- package/dist/calcite/{2GMLRXCX.js → DONAES6Q.js} +2 -2
- package/dist/calcite/{4VQGRHEV.js → DSEMLW7Z.js} +2 -2
- package/dist/calcite/{N7QD2WXH.js → DZWPXJWV.js} +2 -2
- package/dist/calcite/{6G3IVAVE.js → F6EDNLSI.js} +2 -2
- package/dist/calcite/{U5ZHIRE4.js → FZIUTVKD.js} +1 -1
- package/dist/calcite/{ETUOSTGW.js → GE7SQF7S.js} +2 -2
- package/dist/calcite/{BK2W2RW3.js → GUT2GKDG.js} +2 -2
- package/dist/calcite/{63S6JWID.js → H2FWQITV.js} +1 -1
- package/dist/calcite/{35DVUKKJ.js → H5ANNFJC.js} +2 -2
- package/dist/calcite/{PLRKNZ2Y.js → H5DKF7F3.js} +2 -2
- package/dist/calcite/{M5QNDD4X.js → HBHSBTMM.js} +1 -1
- package/dist/calcite/{NPXLX7L5.js → HT5KXL4J.js} +2 -2
- package/dist/calcite/{WSETKDK2.js → HU4SHWE7.js} +2 -2
- package/dist/calcite/{QYCVH2VH.js → HVF3RXXI.js} +2 -2
- package/dist/calcite/{E3C36U7C.js → HXGFAPCM.js} +2 -2
- package/dist/calcite/{XYU7WBO7.js → I53JH7YD.js} +2 -2
- package/dist/calcite/{SLUOB5WF.js → IEL7YV5C.js} +2 -2
- package/dist/calcite/{GV755OVW.js → IHEW664E.js} +2 -2
- package/dist/calcite/{NS7XIDPL.js → IKDSO2OB.js} +2 -2
- package/dist/calcite/{2VXNPHIO.js → JJWGSKGI.js} +2 -2
- package/dist/calcite/{FX45OPBE.js → K3AHNZL7.js} +2 -2
- package/dist/calcite/{BQI7TWVC.js → K5GJLIBR.js} +2 -2
- package/dist/calcite/{R534LDNQ.js → KH3UKQ2D.js} +2 -2
- package/dist/calcite/{SHXU5GEM.js → KRHM7ACI.js} +2 -2
- package/dist/calcite/{XQGQJEI2.js → KT4EQWT6.js} +2 -2
- package/dist/calcite/{PNBL2IVW.js → LH7245HX.js} +2 -2
- package/dist/calcite/{32YCYEKN.js → LJI5SYGA.js} +1 -1
- package/dist/calcite/{HBVWYA2B.js → LQ3URZCB.js} +2 -2
- package/dist/calcite/{JJNFTIBI.js → LRKWQ3C3.js} +2 -2
- package/dist/calcite/{HPWHHEM4.js → LROCCBRV.js} +2 -2
- package/dist/calcite/{JRPSHIET.js → LYDOM6VQ.js} +2 -2
- package/dist/calcite/{X7GVFGBQ.js → MEFMO7UB.js} +2 -2
- package/dist/calcite/{CYVISXIT.js → MP3OWQ2A.js} +2 -2
- package/dist/calcite/{TU2PNKWS.js → MVLJJOH2.js} +2 -2
- package/dist/calcite/{HOUDAAST.js → N5MSFOLW.js} +2 -2
- package/dist/calcite/{YGYOIYMF.js → N7OO7R2S.js} +2 -2
- package/dist/calcite/{XGLTZ4HO.js → NID6WJOW.js} +2 -2
- package/dist/calcite/{FKYJEFNP.js → NLYYOFNV.js} +1 -1
- package/dist/calcite/{RPLPMP3J.js → NQJMDHT5.js} +2 -2
- package/dist/calcite/{PRB44CR7.js → NSBK36H4.js} +2 -2
- package/dist/calcite/{AS2E2XYE.js → NU57UAAO.js} +1 -1
- package/dist/calcite/{H42LHYUA.js → NULQJBCW.js} +2 -2
- package/dist/calcite/{7SVIAOHO.js → OCT7LR2O.js} +1 -1
- package/dist/calcite/{JDPMMX2J.js → OFZACK2Y.js} +2 -2
- package/dist/calcite/{Y7L5PL4A.js → OMKDUGKV.js} +2 -2
- package/dist/calcite/{TDROT2JJ.js → PFDLGOVS.js} +2 -2
- package/dist/calcite/{AICLNUQ5.js → PFKUB7JD.js} +2 -2
- package/dist/calcite/{QSTLY3DQ.js → PJOGMC7F.js} +2 -2
- package/dist/calcite/{HKNQLLG7.js → PLD7OLLJ.js} +2 -2
- package/dist/calcite/{MPZ73UTT.js → PSCEW76J.js} +2 -2
- package/dist/calcite/{JIKG4DHH.js → PSNA5FAF.js} +2 -2
- package/dist/calcite/{SOFELOS3.js → PU5TGCQG.js} +2 -2
- package/dist/calcite/{TPG23UCD.js → PVL2DQVP.js} +2 -2
- package/dist/calcite/{GCPYRD7U.js → PZL4QWV5.js} +2 -2
- package/dist/calcite/{ZCWFURSE.js → Q23OEAP2.js} +2 -2
- package/dist/calcite/{WJA2X3C2.js → Q2GRCTSJ.js} +2 -2
- package/dist/calcite/{C7C75GTM.js → Q3MUDXRY.js} +2 -2
- package/dist/calcite/{M7H4RC23.js → QF6F6CY3.js} +2 -2
- package/dist/calcite/{T3UNO6JW.js → QFT74HW3.js} +2 -2
- package/dist/calcite/{EKOGELYT.js → R73QB7MJ.js} +2 -2
- package/dist/calcite/{ZUMJB5U3.js → RFALVOKT.js} +2 -2
- package/dist/calcite/{6TAH2TAT.js → RI3NRBMI.js} +2 -2
- package/dist/calcite/{WNEJDZTS.js → RND3V33U.js} +1 -1
- package/dist/calcite/{M6OBWXQN.js → ROWPIQLT.js} +2 -2
- package/dist/calcite/{JJOW6LLC.js → RRP2E2T3.js} +2 -2
- package/dist/calcite/{2DX2SAQ7.js → S5CLKCGJ.js} +1 -1
- package/dist/calcite/{INNXW35W.js → SGJU36YV.js} +2 -2
- package/dist/calcite/{RFA6VADW.js → SMRCCHJE.js} +2 -2
- package/dist/calcite/{R4PTX2BD.js → SXB76NOR.js} +2 -2
- package/dist/calcite/{YA3YNL2F.js → SZWYWOXZ.js} +2 -2
- package/dist/calcite/{NFBDMCMY.js → T6Y6ZTWW.js} +2 -2
- package/dist/calcite/{XHCNKCYX.js → U3KRKTQY.js} +2 -2
- package/dist/calcite/{QWN5XHMG.js → UGI3YWJM.js} +2 -2
- package/dist/calcite/{QK7SZUAI.js → UN7GLLXI.js} +2 -2
- package/dist/calcite/{W2KQ3FF5.js → UNJRBV2R.js} +2 -2
- package/dist/calcite/{YUOVY5RN.js → UOZDXXIF.js} +2 -2
- package/dist/calcite/{JAM3DZYC.js → V3ZR6RFK.js} +1 -1
- package/dist/calcite/{V6JTY5IT.js → V4NPQ4WA.js} +2 -2
- package/dist/calcite/{AILXQSIJ.js → VBRBI7IU.js} +2 -2
- package/dist/calcite/{INNX6VTE.js → VIWDW2WZ.js} +2 -2
- package/dist/calcite/{XM6I5JZM.js → VKRWRFEJ.js} +2 -2
- package/dist/calcite/{MDLPBZOZ.js → VMWAAH5B.js} +2 -2
- package/dist/calcite/{6PIHPAZF.js → VQMSSO2U.js} +2 -2
- package/dist/calcite/{OTRRBSYY.js → VYFT5EAY.js} +1 -1
- package/dist/calcite/{EQC2JW3I.js → W5OJOVZY.js} +1 -1
- package/dist/calcite/{AE4AQEU5.js → W6EWFSR3.js} +2 -2
- package/dist/calcite/{KSITDI7Y.js → W72YZH73.js} +2 -2
- package/dist/calcite/{JCGVWBAA.js → WBGRGCXR.js} +2 -2
- package/dist/calcite/{HKVRX5SD.js → WOTQIMPZ.js} +2 -2
- package/dist/calcite/{SU2JQIB4.js → WPTOKN7K.js} +1 -1
- package/dist/calcite/{2JFH2WAM.js → WTY55PPZ.js} +2 -2
- package/dist/calcite/{C77NX62C.js → WWJXVV6U.js} +2 -2
- package/dist/calcite/{VVCB7N7V.js → X374PRV7.js} +2 -2
- package/dist/calcite/{A2TCAPW4.js → XNFJXDQ6.js} +2 -2
- package/dist/calcite/{A5CVK7TL.js → XNLWKJLM.js} +2 -2
- package/dist/calcite/{HIB3Q63Z.js → XRSYDXWZ.js} +1 -1
- package/dist/calcite/{ALQH5DCZ.js → XZTRPLLK.js} +2 -2
- package/dist/calcite/{U3G47NPB.js → Y3HXK6MO.js} +2 -2
- package/dist/calcite/{QDXVT7UF.js → Y442PVMQ.js} +2 -2
- package/dist/calcite/{EDVRYPYX.js → YCLOS6NX.js} +2 -2
- package/dist/calcite/{S6HTKBNB.js → YSBWKH76.js} +1 -1
- package/dist/calcite/{C3BIK3DY.js → YSP6WWQB.js} +1 -1
- package/dist/calcite/{KCVWP63F.js → YV7DKMEQ.js} +2 -2
- package/dist/calcite/{TXZPVAH4.js → ZAQTILTS.js} +2 -2
- package/dist/calcite/{XRJOD24G.js → ZLR2B6GQ.js} +1 -1
- package/dist/calcite/{2CJWVM4R.js → ZSMNT5VS.js} +2 -2
- package/dist/calcite/{B3KV4G2W.js → ZTOBC3PN.js} +2 -2
- package/dist/calcite/{IXK4BTNI.js → ZV7YL7QG.js} +2 -2
- package/dist/calcite/{J2ACTXE5.js → ZVWKN3G7.js} +2 -2
- package/dist/calcite/{LAAEPNIM.js → ZZGPQLEW.js} +2 -2
- package/dist/calcite/calcite.esm.js +2 -2
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useFocusTrap.js +2 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as W,b as F,c as z}from"./M5QNDD4X.js";import{a as y}from"./H42LHYUA.js";import{a as g}from"./J2NLU7RP.js";import{a as O}from"./PNBL2IVW.js";import"./D5SFHDV6.js";import{e as k,l as B,n as p,y as E}from"./Z6CRZOOK.js";import"./XRJOD24G.js";import{C as w,D as C,E as b,J as x,P as S,g as I,h as u,o as T}from"./CSQVLDPF.js";var $={chevronRight:"chevron-right",chevronLeft:"chevron-left"},c={container:"container",scrollButton:"scroll-button",scrollButtonContainer:"scroll-button-container",scrollBackwardButton:"scroll-button--backward",scrollForwardButton:"scroll-button--forward",tabTitleSlotWrapper:"tab-titles-slot-wrapper",scale:h=>`scale-${h}`,position:h=>`position-${h}`},V=I`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{position:relative;display:flex}:host([bordered]) .scroll-button--forward calcite-button{--calcite-internal-button-border-inline-end-color: var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered]) .scroll-button--backward calcite-button{--calcite-internal-button-border-inline-start-color: var( --calcite-tab-border-color, var(--calcite-color-border-1) )}.scale-s{--calcite-internal-tab-nav-button-width: 24px;min-block-size:1.5rem}.scale-m{--calcite-internal-tab-nav-button-width: 32px;min-block-size:2rem}.scale-l{--calcite-internal-tab-nav-button-width: 44px;min-block-size:2.75rem}.container::-webkit-scrollbar{display:none;-ms-overflow-style:none;scrollbar-width:none}:host([layout=center]) ::slotted(calcite-tab-title){display:flex;flex-grow:1;flex-shrink:0;min-inline-size:auto;white-space:nowrap}:host([layout=center]) ::slotted(calcite-tab-title[selected]){overflow:unset}:host(:not([bordered])) .scale-l{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xxl)}:host(:not([bordered])) .scale-m{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xl)}:host(:not([bordered])) .scale-s{--calcite-internal-tab-nav-gap: var(--calcite-spacing-lg)}:host(:not([bordered])) .tab-titles-slot-wrapper{gap:var(--calcite-internal-tab-nav-gap)}:host([layout=center]:not([bordered])) .tab-titles-slot-wrapper{padding-inline:var(--calcite-spacing-xl)}.tab-titles-slot-wrapper{flex:1 1 0%}.container,.tab-titles-slot-wrapper{display:flex;inline-size:100%;justify-content:flex-start;overflow:hidden;white-space:nowrap}.scroll-button{position:absolute;inset-block:0px}.scroll-button calcite-button{--calcite-button-text-color: var(--calcite-tab-text-color, var(--calcite-color-text-3));--calcite-button-background-color: var(--calcite-color-transparent);--calcite-offset-invert-focus: 1;block-size:var(--calcite-container-size-content-fluid)}.scroll-button-container{display:flex;inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);inset-inline-end:0;inline-size:calc(2 * var(--calcite-internal-tab-nav-button-width))}.scroll-button--forward{inset-inline-end:0;z-index:var(--calcite-z-index)}.scroll-button--backward{inset-inline-end:var(--calcite-internal-tab-nav-button-width);z-index:var(--calcite-z-index)}:host(:not([bordered])) .scroll-button--backward:before{background-color:var(--calcite-tab-border-color, var(--calcite-color-border-3));content:"";inline-size:var(--calcite-border-width-sm);inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);position:absolute;inset-inline-start:0}:host([hidden]){display:none}[hidden]{display:none}`,v=class extends C{constructor(){super(),this.effectiveDir="ltr",this.lastScrollWheelAxis="x",this.resizeObserver=g("resize",()=>{this.updateScrollingState()}),this.makeFirstVisibleTabClosable=!1,this.messages=O(),this.hasOverflowingEndTabTitle=!1,this.hasOverflowingStartTabTitle=!1,this.bordered=!1,this.layout="inline",this.position="bottom",this.scale="m",this.selectedTitle=null,this.calciteInternalTabChange=T({cancelable:!1}),this.calciteInternalTabNavSlotChange=T(),this.calciteTabChange=T({cancelable:!1}),this.listen("calciteInternalTabsFocusPrevious",this.focusPreviousTabHandler),this.listen("calciteInternalTabsFocusNext",this.focusNextTabHandler),this.listen("calciteInternalTabsFocusFirst",this.focusFirstTabHandler),this.listen("calciteInternalTabsFocusLast",this.focusLastTabHandler),this.listen("calciteInternalTabsActivate",this.internalActivateTabHandler),this.listen("calciteInternalTabsClose",this.internalCloseTabHandler),this.listen("calciteInternalTabTitleRegister",this.updateTabTitles),this.listenOn(document.body,"calciteInternalTabChange",this.globalInternalTabChangeHandler)}static{this.properties={hasOverflowingEndTabTitle:[16,{},{state:!0}],hasOverflowingStartTabTitle:[16,{},{state:!0}],selectedTabId:[16,{},{state:!0}],bordered:[7,{},{reflect:!0,type:Boolean}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:1,scale:1,selectedTitle:[0,{},{attribute:!1}],storageId:[3,{},{reflect:!0}],syncId:[3,{},{reflect:!0}]}}static{this.styles=V}connectedCallback(){super.connectedCallback(),this.parentTabsEl=this.el.closest("calcite-tabs"),this.resizeObserver?.observe(this.el)}async load(){let t=`calcite-tab-nav-${this.storageId}`;if(localStorage&&this.storageId&&localStorage.getItem(t)){let e=JSON.parse(localStorage.getItem(t));this.selectedTabId=e}}willUpdate(t){t.has("selectedTitle")&&(this.hasUpdated||this.selectedTitle!==null)&&this.calciteInternalTabChange.emit({tab:this.selectedTabId}),t.has("selectedTabId")&&this.selectedTabIdChanged();let{parentTabsEl:e}=this;this.layout=e?.layout,this.bordered=e?.bordered,this.effectiveDir=k(this.el)}loaded(){this.scrollTabTitleIntoView(this.selectedTitle,"instant"),this.tabTitles.length&&this.tabTitles.every(t=>!t.selected)&&!this.selectedTabId&&this.tabTitles[0].getTabIdentifier().then(t=>{this.calciteInternalTabChange.emit({tab:t})})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}get enabledTabTitles(){return p(this.el,"calcite-tab-title:not([disabled])").filter(t=>!t.closed)}get scrollerButtonWidth(){let{scale:t}=this;return parseInt(t==="s"?W:t==="m"?F:z)}get tabTitles(){return p(this.el,"calcite-tab-title")}focusPreviousTabHandler(t){this.handleTabFocus(t,t.target,"previous")}focusNextTabHandler(t){this.handleTabFocus(t,t.target,"next")}focusFirstTabHandler(t){this.handleTabFocus(t,t.target,"first")}focusLastTabHandler(t){this.handleTabFocus(t,t.target,"last")}internalActivateTabHandler(t){let e=t.target,i=this.selectedTitle;this.selectedTabId=t.detail.tab?t.detail.tab:this.getIndexOfTabTitle(e),t.stopPropagation(),this.selectedTitle=e,i?.id!==e.id&&t.detail.userTriggered&&this.calciteTabChange.emit(),this.scrollTabTitleIntoView(e)}scrollTabTitleIntoView(t,e="smooth"){t&&requestAnimationFrame(()=>{let i=this.tabTitleContainerEl;if(!i)return;let l=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=i.scrollLeft;if(a.left<l.left){let r=s+(a.left-l.left);i.scrollTo({left:r,behavior:e})}else if(a.right>l.right){let r=s+(a.right-l.right);i.scrollTo({left:r,behavior:e})}})}internalCloseTabHandler(t){let e=t.target;this.handleTabTitleClose(e),t.stopPropagation()}async updateTabTitles(t){t.target.selected&&(this.selectedTabId=t.detail,this.selectedTitle=await this.getTabTitleById(this.selectedTabId))}globalInternalTabChangeHandler(t){this.syncId&&t.target!==this.el&&t.target.syncId===this.syncId&&this.selectedTabId!==t.detail.tab&&(this.selectedTabId=t.detail.tab),t.stopPropagation()}async selectedTabIdChanged(){await this.componentOnReady(),localStorage&&this.storageId&&this.selectedTabId!==void 0&&this.selectedTabId!==null&&localStorage.setItem(`calcite-tab-nav-${this.storageId}`,JSON.stringify(this.selectedTabId)),this.calciteInternalTabChange.emit({tab:this.selectedTabId})}onTabTitleWheel(t){t.preventDefault();let{deltaX:e,deltaY:i}=t,l=Math.abs(e),a=Math.abs(i),s;l===a?s=this.lastScrollWheelAxis==="x"?e:i:l>a?(s=e,this.lastScrollWheelAxis="x"):(s=i,this.lastScrollWheelAxis="y");let r=(this.effectiveDir==="rtl"?-1:1)*s;t.currentTarget.scrollBy(r,0)}onSlotChange(){this.intersectionObserver?.disconnect();let t=this.tabTitles;t.forEach(l=>{this.intersectionObserver?.observe(l)});let e=this.getVisibleTabTitlesIndices(t);e.length>1&&this.makeFirstVisibleTabClosable&&(t[e[0]].closable=!0,this.makeFirstVisibleTabClosable=!1),this.calciteInternalTabNavSlotChange.emit(t)}setTabTitleContainerEl(t){this.tabTitleContainerEl=t,this.intersectionObserver?.disconnect(),t&&(this.intersectionObserver=g("intersection",()=>this.updateScrollingState(),{root:t,threshold:[0,.5,1]}))}updateScrollingState(){let t=this.tabTitleContainerEl;if(!t)return;let e,i,l=t.scrollLeft,a=t.clientWidth,s=t.scrollWidth;this.effectiveDir==="ltr"?(e=l>0,i=l+a<s):(e=l<0,i=l!==-(s-a)),this.hasOverflowingStartTabTitle=e,this.hasOverflowingEndTabTitle=i}scrollToTabTitles(t){requestAnimationFrame(()=>{let e=this.tabTitleContainerEl;if(!e)return;let i=e.getBoundingClientRect(),l=Array.from(this.el.querySelectorAll("calcite-tab-title")),{effectiveDir:a}=this;t==="forward"&&l.reverse();let s=null;l.forEach(o=>{let n=o.getBoundingClientRect(),f=i.x+i.width,d=n.x+n.width;t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?(n.x>f||d>f&&n.x>i.x)&&(s=o):(d<i.x||n.x<i.x&&d>i.x)&&(s=o)});let r;if(s){let o=2*this.scrollerButtonWidth,n=t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?-o:s.offsetWidth-(e.clientWidth+o);r=s.offsetLeft+n}else{let o=e.scrollLeft,n=i.width,d=e.scrollWidth-(n+Math.abs(o));d>0&&(r=o+(a==="ltr"?1:-1)*d)}e.scrollTo({left:r,behavior:"smooth"})})}scrollToNextTabTitles(){this.scrollToTabTitles("forward")}scrollToPreviousTabTitles(){this.scrollToTabTitles("backward")}handleTabFocus(t,e,i){let l=E(this.enabledTabTitles,e,i);this.scrollTabTitleIntoView(l,"instant"),t.stopPropagation()}getIndexOfTabTitle(t,e=this.tabTitles){return e.indexOf(t)}onTabTitleScroll(){this.updateScrollingState()}async getTabTitleById(t){return Promise.all(this.tabTitles.map(e=>e.getTabIdentifier())).then(e=>this.tabTitles[e.indexOf(t)])}getVisibleTabTitlesIndices(t){return t.reduce((e,i,l)=>i.closed?e:[...e,l],[])}handleTabTitleClose(t){let{tabTitles:e}=this,i=t.selected,l=this.getVisibleTabTitlesIndices(e),a=l.length;if(a===1&&e[l[0]].closable)this.makeFirstVisibleTabClosable=!0,e[l[0]].closable=!1,this.selectedTabId=l[0],i&&e[l[0]].activateTab();else if(a>1){let s=e.findIndex(o=>o===t),r=l.find(o=>o>s);this.selectedTabId===s&&(this.selectedTabId=r||a-1,e[this.selectedTabId].activateTab())}requestAnimationFrame(()=>{B(e[this.selectedTabId])})}render(){return this.el.role="tablist",u`<div class=${b({[c.container]:!0,[c.scale(this.scale)]:!0,[c.position(this.position)]:!0,[x.rtl]:this.effectiveDir==="rtl"})}><div class=${b({[c.tabTitleSlotWrapper]:!0})} @scroll=${this.onTabTitleScroll} @wheel=${this.onTabTitleWheel} ${w(this.setTabTitleContainerEl)}><slot @slotchange=${this.onSlotChange}></slot></div><div class=${b(c.scrollButtonContainer)} .hidden=${!this.hasOverflowingEndTabTitle&&!this.hasOverflowingStartTabTitle}>${this.renderScrollButton("start")}${this.renderScrollButton("end")}</div></div>`}renderScrollButton(t){let{messages:e,scale:i,hasOverflowingEndTabTitle:l,hasOverflowingStartTabTitle:a}=this,s=t==="end";return y(t,u`<div class=${b({[c.scrollButton]:!0,[c.scrollBackwardButton]:!s,[c.scrollForwardButton]:s})}><calcite-button appearance=transparent .ariaLabel=${s?e.nextTabTitles:e.previousTabTitles} .disabled=${s?!l:!a} icon-flip-rtl=both .iconStart=${s?$.chevronRight:$.chevronLeft} kind=neutral @click=${s?this.scrollToNextTabTitles:this.scrollToPreviousTabTitles} .scale=${i} tabindex=-1></calcite-button></div>`)}};S("calcite-tab-nav",v);export{v as TabNav};
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as W,b as F,c as z}from"./HBHSBTMM.js";import{a as y}from"./NULQJBCW.js";import{a as g}from"./ALDDSDTX.js";import{a as O}from"./LH7245HX.js";import"./B5JXPZDV.js";import{e as k,l as B,n as p,y as E}from"./5IPJANUU.js";import"./ZLR2B6GQ.js";import{C as w,D as C,E as b,J as x,P as S,g as I,h as u,o as T}from"./AUIOWPFN.js";var $={chevronRight:"chevron-right",chevronLeft:"chevron-left"},c={container:"container",scrollButton:"scroll-button",scrollButtonContainer:"scroll-button-container",scrollBackwardButton:"scroll-button--backward",scrollForwardButton:"scroll-button--forward",tabTitleSlotWrapper:"tab-titles-slot-wrapper",scale:h=>`scale-${h}`,position:h=>`position-${h}`},V=I`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{position:relative;display:flex}:host([bordered]) .scroll-button--forward calcite-button{--calcite-internal-button-border-inline-end-color: var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered]) .scroll-button--backward calcite-button{--calcite-internal-button-border-inline-start-color: var( --calcite-tab-border-color, var(--calcite-color-border-1) )}.scale-s{--calcite-internal-tab-nav-button-width: 24px;min-block-size:1.5rem}.scale-m{--calcite-internal-tab-nav-button-width: 32px;min-block-size:2rem}.scale-l{--calcite-internal-tab-nav-button-width: 44px;min-block-size:2.75rem}.container::-webkit-scrollbar{display:none;-ms-overflow-style:none;scrollbar-width:none}:host([layout=center]) ::slotted(calcite-tab-title){display:flex;flex-grow:1;flex-shrink:0;min-inline-size:auto;white-space:nowrap}:host([layout=center]) ::slotted(calcite-tab-title[selected]){overflow:unset}:host(:not([bordered])) .scale-l{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xxl)}:host(:not([bordered])) .scale-m{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xl)}:host(:not([bordered])) .scale-s{--calcite-internal-tab-nav-gap: var(--calcite-spacing-lg)}:host(:not([bordered])) .tab-titles-slot-wrapper{gap:var(--calcite-internal-tab-nav-gap)}:host([layout=center]:not([bordered])) .tab-titles-slot-wrapper{padding-inline:var(--calcite-spacing-xl)}.tab-titles-slot-wrapper{flex:1 1 0%}.container,.tab-titles-slot-wrapper{display:flex;inline-size:100%;justify-content:flex-start;overflow:hidden;white-space:nowrap}.scroll-button{position:absolute;inset-block:0px}.scroll-button calcite-button{--calcite-button-text-color: var(--calcite-tab-text-color, var(--calcite-color-text-3));--calcite-button-background-color: var(--calcite-color-transparent);--calcite-offset-invert-focus: 1;block-size:var(--calcite-container-size-content-fluid)}.scroll-button-container{display:flex;inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);inset-inline-end:0;inline-size:calc(2 * var(--calcite-internal-tab-nav-button-width))}.scroll-button--forward{inset-inline-end:0;z-index:var(--calcite-z-index)}.scroll-button--backward{inset-inline-end:var(--calcite-internal-tab-nav-button-width);z-index:var(--calcite-z-index)}:host(:not([bordered])) .scroll-button--backward:before{background-color:var(--calcite-tab-border-color, var(--calcite-color-border-3));content:"";inline-size:var(--calcite-border-width-sm);inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);position:absolute;inset-inline-start:0}:host([hidden]){display:none}[hidden]{display:none}`,v=class extends C{constructor(){super(),this.effectiveDir="ltr",this.lastScrollWheelAxis="x",this.resizeObserver=g("resize",()=>{this.updateScrollingState()}),this.makeFirstVisibleTabClosable=!1,this.messages=O(),this.hasOverflowingEndTabTitle=!1,this.hasOverflowingStartTabTitle=!1,this.bordered=!1,this.layout="inline",this.position="bottom",this.scale="m",this.selectedTitle=null,this.calciteInternalTabChange=T({cancelable:!1}),this.calciteInternalTabNavSlotChange=T(),this.calciteTabChange=T({cancelable:!1}),this.listen("calciteInternalTabsFocusPrevious",this.focusPreviousTabHandler),this.listen("calciteInternalTabsFocusNext",this.focusNextTabHandler),this.listen("calciteInternalTabsFocusFirst",this.focusFirstTabHandler),this.listen("calciteInternalTabsFocusLast",this.focusLastTabHandler),this.listen("calciteInternalTabsActivate",this.internalActivateTabHandler),this.listen("calciteInternalTabsClose",this.internalCloseTabHandler),this.listen("calciteInternalTabTitleRegister",this.updateTabTitles),this.listenOn(document.body,"calciteInternalTabChange",this.globalInternalTabChangeHandler)}static{this.properties={hasOverflowingEndTabTitle:[16,{},{state:!0}],hasOverflowingStartTabTitle:[16,{},{state:!0}],selectedTabId:[16,{},{state:!0}],bordered:[7,{},{reflect:!0,type:Boolean}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:1,scale:1,selectedTitle:[0,{},{attribute:!1}],storageId:[3,{},{reflect:!0}],syncId:[3,{},{reflect:!0}]}}static{this.styles=V}connectedCallback(){super.connectedCallback(),this.parentTabsEl=this.el.closest("calcite-tabs"),this.resizeObserver?.observe(this.el)}async load(){let t=`calcite-tab-nav-${this.storageId}`;if(localStorage&&this.storageId&&localStorage.getItem(t)){let e=JSON.parse(localStorage.getItem(t));this.selectedTabId=e}}willUpdate(t){t.has("selectedTitle")&&(this.hasUpdated||this.selectedTitle!==null)&&this.calciteInternalTabChange.emit({tab:this.selectedTabId}),t.has("selectedTabId")&&this.selectedTabIdChanged();let{parentTabsEl:e}=this;this.layout=e?.layout,this.bordered=e?.bordered,this.effectiveDir=k(this.el)}loaded(){this.scrollTabTitleIntoView(this.selectedTitle,"instant"),this.tabTitles.length&&this.tabTitles.every(t=>!t.selected)&&!this.selectedTabId&&this.tabTitles[0].getTabIdentifier().then(t=>{this.calciteInternalTabChange.emit({tab:t})})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}get enabledTabTitles(){return p(this.el,"calcite-tab-title:not([disabled])").filter(t=>!t.closed)}get scrollerButtonWidth(){let{scale:t}=this;return parseInt(t==="s"?W:t==="m"?F:z)}get tabTitles(){return p(this.el,"calcite-tab-title")}focusPreviousTabHandler(t){this.handleTabFocus(t,t.target,"previous")}focusNextTabHandler(t){this.handleTabFocus(t,t.target,"next")}focusFirstTabHandler(t){this.handleTabFocus(t,t.target,"first")}focusLastTabHandler(t){this.handleTabFocus(t,t.target,"last")}internalActivateTabHandler(t){let e=t.target,i=this.selectedTitle;this.selectedTabId=t.detail.tab?t.detail.tab:this.getIndexOfTabTitle(e),t.stopPropagation(),this.selectedTitle=e,i?.id!==e.id&&t.detail.userTriggered&&this.calciteTabChange.emit(),this.scrollTabTitleIntoView(e)}scrollTabTitleIntoView(t,e="smooth"){t&&requestAnimationFrame(()=>{let i=this.tabTitleContainerEl;if(!i)return;let l=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=i.scrollLeft;if(a.left<l.left){let r=s+(a.left-l.left);i.scrollTo({left:r,behavior:e})}else if(a.right>l.right){let r=s+(a.right-l.right);i.scrollTo({left:r,behavior:e})}})}internalCloseTabHandler(t){let e=t.target;this.handleTabTitleClose(e),t.stopPropagation()}async updateTabTitles(t){t.target.selected&&(this.selectedTabId=t.detail,this.selectedTitle=await this.getTabTitleById(this.selectedTabId))}globalInternalTabChangeHandler(t){this.syncId&&t.target!==this.el&&t.target.syncId===this.syncId&&this.selectedTabId!==t.detail.tab&&(this.selectedTabId=t.detail.tab),t.stopPropagation()}async selectedTabIdChanged(){await this.componentOnReady(),localStorage&&this.storageId&&this.selectedTabId!==void 0&&this.selectedTabId!==null&&localStorage.setItem(`calcite-tab-nav-${this.storageId}`,JSON.stringify(this.selectedTabId)),this.calciteInternalTabChange.emit({tab:this.selectedTabId})}onTabTitleWheel(t){t.preventDefault();let{deltaX:e,deltaY:i}=t,l=Math.abs(e),a=Math.abs(i),s;l===a?s=this.lastScrollWheelAxis==="x"?e:i:l>a?(s=e,this.lastScrollWheelAxis="x"):(s=i,this.lastScrollWheelAxis="y");let r=(this.effectiveDir==="rtl"?-1:1)*s;t.currentTarget.scrollBy(r,0)}onSlotChange(){this.intersectionObserver?.disconnect();let t=this.tabTitles;t.forEach(l=>{this.intersectionObserver?.observe(l)});let e=this.getVisibleTabTitlesIndices(t);e.length>1&&this.makeFirstVisibleTabClosable&&(t[e[0]].closable=!0,this.makeFirstVisibleTabClosable=!1),this.calciteInternalTabNavSlotChange.emit(t)}setTabTitleContainerEl(t){this.tabTitleContainerEl=t,this.intersectionObserver?.disconnect(),t&&(this.intersectionObserver=g("intersection",()=>this.updateScrollingState(),{root:t,threshold:[0,.5,1]}))}updateScrollingState(){let t=this.tabTitleContainerEl;if(!t)return;let e,i,l=t.scrollLeft,a=t.clientWidth,s=t.scrollWidth;this.effectiveDir==="ltr"?(e=l>0,i=l+a<s):(e=l<0,i=l!==-(s-a)),this.hasOverflowingStartTabTitle=e,this.hasOverflowingEndTabTitle=i}scrollToTabTitles(t){requestAnimationFrame(()=>{let e=this.tabTitleContainerEl;if(!e)return;let i=e.getBoundingClientRect(),l=Array.from(this.el.querySelectorAll("calcite-tab-title")),{effectiveDir:a}=this;t==="forward"&&l.reverse();let s=null;l.forEach(o=>{let n=o.getBoundingClientRect(),f=i.x+i.width,d=n.x+n.width;t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?(n.x>f||d>f&&n.x>i.x)&&(s=o):(d<i.x||n.x<i.x&&d>i.x)&&(s=o)});let r;if(s){let o=2*this.scrollerButtonWidth,n=t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?-o:s.offsetWidth-(e.clientWidth+o);r=s.offsetLeft+n}else{let o=e.scrollLeft,n=i.width,d=e.scrollWidth-(n+Math.abs(o));d>0&&(r=o+(a==="ltr"?1:-1)*d)}e.scrollTo({left:r,behavior:"smooth"})})}scrollToNextTabTitles(){this.scrollToTabTitles("forward")}scrollToPreviousTabTitles(){this.scrollToTabTitles("backward")}handleTabFocus(t,e,i){let l=E(this.enabledTabTitles,e,i);this.scrollTabTitleIntoView(l,"instant"),t.stopPropagation()}getIndexOfTabTitle(t,e=this.tabTitles){return e.indexOf(t)}onTabTitleScroll(){this.updateScrollingState()}async getTabTitleById(t){return Promise.all(this.tabTitles.map(e=>e.getTabIdentifier())).then(e=>this.tabTitles[e.indexOf(t)])}getVisibleTabTitlesIndices(t){return t.reduce((e,i,l)=>i.closed?e:[...e,l],[])}handleTabTitleClose(t){let{tabTitles:e}=this,i=t.selected,l=this.getVisibleTabTitlesIndices(e),a=l.length;if(a===1&&e[l[0]].closable)this.makeFirstVisibleTabClosable=!0,e[l[0]].closable=!1,this.selectedTabId=l[0],i&&e[l[0]].activateTab();else if(a>1){let s=e.findIndex(o=>o===t),r=l.find(o=>o>s);this.selectedTabId===s&&(this.selectedTabId=r||a-1,e[this.selectedTabId].activateTab())}requestAnimationFrame(()=>{B(e[this.selectedTabId])})}render(){return this.el.role="tablist",u`<div class=${b({[c.container]:!0,[c.scale(this.scale)]:!0,[c.position(this.position)]:!0,[x.rtl]:this.effectiveDir==="rtl"})}><div class=${b({[c.tabTitleSlotWrapper]:!0})} @scroll=${this.onTabTitleScroll} @wheel=${this.onTabTitleWheel} ${w(this.setTabTitleContainerEl)}><slot @slotchange=${this.onSlotChange}></slot></div><div class=${b(c.scrollButtonContainer)} .hidden=${!this.hasOverflowingEndTabTitle&&!this.hasOverflowingStartTabTitle}>${this.renderScrollButton("start")}${this.renderScrollButton("end")}</div></div>`}renderScrollButton(t){let{messages:e,scale:i,hasOverflowingEndTabTitle:l,hasOverflowingStartTabTitle:a}=this,s=t==="end";return y(t,u`<div class=${b({[c.scrollButton]:!0,[c.scrollBackwardButton]:!s,[c.scrollForwardButton]:s})}><calcite-button appearance=transparent .ariaLabel=${s?e.nextTabTitles:e.previousTabTitles} .disabled=${s?!l:!a} icon-flip-rtl=both .iconStart=${s?$.chevronRight:$.chevronLeft} kind=neutral @click=${s?this.scrollToNextTabTitles:this.scrollToPreviousTabTitles} .scale=${i} tabindex=-1></calcite-button></div>`)}};S("calcite-tab-nav",v);export{v as TabNav};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as o}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as o}from"./NULQJBCW.js";import{a as l}from"./WOTQIMPZ.js";import"./B5JXPZDV.js";import"./3YZG7MA3.js";import"./CIU4VM7X.js";import"./5IPJANUU.js";import"./ZLR2B6GQ.js";import{D as n,E as a,P as c,g as r,h as e}from"./AUIOWPFN.js";var t={textContainer:"text-container",fullName:"full-name",username:"username",button:"button"},u=r`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{display:inline-flex;outline:2px solid transparent;outline-offset:2px}:host .button{margin:0;display:flex;cursor:pointer;align-items:center;justify-content:center;font-size:var(--calcite-font-size-0);line-height:1.25rem;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;outline-color:transparent;font-family:inherit;border:none;background-color:var(--calcite-navigation-background-color, var(--calcite-internal-navigation-user-background-color, var(--calcite-color-transparent)));border-block-end:2px solid var(--calcite-color-transparent)}.text-container{margin-block-start:.125rem;display:flex;flex-direction:column;padding-inline:1rem;text-align:start}calcite-avatar{padding-inline:1rem;--calcite-avatar-corner-radius: var(--calcite-navigation-user-avatar-corner-radius);--calcite-avatar-color: var(--calcite-navigation-user-avatar-color)}calcite-avatar~.text-container{padding-inline-start:0px}.full-name{margin-inline-start:0px;font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-navigation-user-full-name-text-color, var(--calcite-color-text-1))}.username{font-size:var(--calcite-font-size--1);color:var(--calcite-navigation-user-name-text-color, var(--calcite-color-text-2))}:host(:hover) .button,:host(:focus) .button{--calcite-internal-navigation-user-background-color: var(--calcite-color-foreground-2)}:host(:focus) .button{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host(:active) .button{--calcite-internal-navigation-user-background-color: var(--calcite-color-foreground-3)}:host([active]) .button{border-block-end-color:var(--calcite-navigation-accent-color, var(--calcite-color-brand))}:host([hidden]){display:none}[hidden]{display:none}`,i=class extends n{constructor(){super(...arguments),this.focusSetter=l()(this),this.textDisabled=!1}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],fullName:1,label:1,textDisabled:[7,{},{reflect:!0,type:Boolean}],thumbnail:1,userId:1,username:1}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=u}async setFocus(s){return this.focusSetter(()=>this.el,s)}render(){return e`<button .ariaLabel=${this.label} class=${a(t.button)}><calcite-avatar .fullName=${this.fullName} .label=${this.label} .thumbnail=${this.thumbnail} .userId=${this.userId} .username=${this.username}></calcite-avatar>${(this.fullName||this.username)&&!this.textDisabled&&e`<div class=${a(t.textContainer)}>${this.fullName&&o(t.fullName,e`<span class=${a(t.fullName)}>${this.fullName}</span>`)||""}${this.username&&o(t.username,e`<span class=${a(t.username)}>${this.username}</span>`)||""}</div>`||""}</button>`}};c("calcite-navigation-user",i);export{i as NavigationUser};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as T}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as T}from"./ZLR2B6GQ.js";import{J as h}from"./AUIOWPFN.js";var P=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],b=P.join(","),I=typeof Element>"u",d=I?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,g=!I&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},v=function e(t,r){var n;r===void 0&&(r=!0);var a=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),o=a===""||a==="true",i=o||r&&t&&e(t.parentNode);return i},L=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},x=function(t,r,n){if(v(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(b));return r&&d.call(t,b)&&a.unshift(t),a=a.filter(n),a},A=function e(t,r,n){for(var a=[],o=Array.from(t);o.length;){var i=o.shift();if(!v(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),l=s.length?s:i.children,u=e(l,!0,n);n.flatten?a.push.apply(a,u):a.push({scopeParent:i,candidates:u})}else{var f=d.call(i,b);f&&n.filter(i)&&(r||!t.includes(i))&&a.push(i);var c=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),B=!v(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(c&&B){var S=e(c===!0?i.children:c.children,!0,n);n.flatten?a.push.apply(a,S):a.push({scopeParent:i,candidates:S})}else o.unshift.apply(o,i.children)}}return a},R=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},F=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||L(t))&&!R(t)?0:t.tabIndex},q=function(t,r){var n=F(t);return n<0&&r&&!R(t)?0:n},W=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},D=function(t){return t.tagName==="INPUT"},$=function(t){return D(t)&&t.type==="hidden"},U=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},G=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},j=function(t){if(!t.name)return!0;var r=t.form||g(t),n=function(s){return r.querySelectorAll('input[type="radio"][name="'+s+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=n(window.CSS.escape(t.name));else try{a=n(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var o=G(a,t.form);return!o||o===t},z=function(t){return D(t)&&t.type==="radio"},X=function(t){return z(t)&&!j(t)},H=function(t){var r,n=t&&g(t),a=(r=n)===null||r===void 0?void 0:r.host,o=!1;if(n&&n!==t){var i,s,l;for(o=!!((i=a)!==null&&i!==void 0&&(s=i.ownerDocument)!==null&&s!==void 0&&s.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&a;){var u,f,c;n=g(a),a=(u=n)===null||u===void 0?void 0:u.host,o=!!((f=a)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(a))}}return o},w=function(t){var r=t.getBoundingClientRect(),n=r.width,a=r.height;return n===0&&a===0},V=function(t,r){var n=r.displayCheck,a=r.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=d.call(t,"details>summary:first-of-type"),i=o?t.parentElement:t;if(d.call(i,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof a=="function"){for(var s=t;t;){var l=t.parentElement,u=g(t);if(l&&!l.shadowRoot&&a(l)===!0)return w(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=s}if(H(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return w(t);return!1},Y=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n<r.children.length;n++){var a=r.children.item(n);if(a.tagName==="LEGEND")return d.call(r,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}r=r.parentElement}return!1},y=function(t,r){return!(r.disabled||v(r)||$(r)||V(r,t)||U(r)||Y(r))},C=function(t,r){return!(X(r)||F(r)<0||!y(t,r))},Z=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},K=function e(t){var r=[],n=[];return t.forEach(function(a,o){var i=!!a.scopeParent,s=i?a.scopeParent:a,l=q(s,i),u=i?e(a.candidates):s;l===0?i?r.push.apply(r,u):r.push(s):n.push({documentOrder:o,tabIndex:l,item:a,isScope:i,content:u})}),n.sort(W).reduce(function(a,o){return o.isScope?a.push.apply(a,o.content):a.push(o.content),a},[]).concat(r)},J=function(t,r){r=r||{};var n;return r.getShadowRoot?n=A([t],r.includeContainer,{filter:C.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:Z}):n=x(t,r.includeContainer,C.bind(null,r)),K(n)},Q=function(t,r){r=r||{};var n;return r.getShadowRoot?n=A([t],r.includeContainer,{filter:y.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):n=x(t,r.includeContainer,y.bind(null,r)),n},O={getShadowRoot:!0};function bt(e){return e?e.id=e.id||`${e.tagName.toLowerCase()}-${T()}`:""}function yt(e){return Array.isArray(e)?e:Array.from(e)}function pt(e){let t=m(e,`.${h.darkMode}, .${h.lightMode}, .${h.autoMode}`);return t?.classList.contains("calcite-mode-dark")||t?.classList.contains("calcite-mode-auto")&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function mt(e){let n=m(e,"[dir]");return n?n.getAttribute("dir"):"ltr"}function St(e){return e?parseFloat(getComputedStyle(e).inlineSize):0}function p(e){return e.getRootNode()}function Tt(e){let t=p(e);return"host"in t?t:null}function wt(e,t){if(!e)return 0;let n=document.createElement("canvas").getContext("2d");return n.font=t,n.measureText(e).width}function M(e){return e.host||null}function _(e,{selector:t,id:r}){if(!e)return null;e.assignedSlot&&(e=e.assignedSlot);let n=p(e);return(r?"getElementById"in n?n.getElementById(r):null:t?n.querySelector(t):null)||_(M(n),{selector:t,id:r})}function m(e,t){return e?e.closest(t)||m(M(p(e)),t):null}function tt(e){return typeof e?.setFocus=="function"}async function et(e,t=!1,r="tabbable",n,a){return e?tt(e)&&n!==e?e.setFocus(a):(r==="tabbable"?nt:it)(e,t,a):void 0}function rt(e,t){if(e)return J(e,{...O,includeContainer:t})[0]??e}function nt(e,t,r){rt(e,t)?.focus(r)}function at(e,t){if(e)return Q(e,{...O,includeContainer:t})[0]??e}function it(e,t,r){at(e,t)?.focus(r)}function Ct(e,t){return Array.from(e.children).filter(r=>r.matches(t))}function ot(e,t){return e.filter(r=>r.matches(t))}function Et(e,t,r){if(typeof t=="string"&&t!=="")return t;if(t===""||t===!0)return e[r]}function Nt(e,t){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)}function It(e){return(!!e).toString()}function xt(e){return ct(e)||st(e)}function ut(e){return lt(e).filter(t=>t.nodeType===Node.TEXT_NODE).map(t=>t.textContent).join("").trim()}function At(e){for(let t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()!==""||t.nodeType===Node.ELEMENT_NODE)return!0;return!1}function st(e){return!!ut(e)}function lt(e){return e.currentTarget.assignedNodes({flatten:!0})}function ct(e){return!!ft(e).length}function ft(e,t){return dt(e.currentTarget,t)}function dt(e,t){let r=e.assignedElements({flatten:!0});return t?ot(r,t):r}function Rt(e){return!!(e.isPrimary&&e.button===0)}function Ft(e){return e.detail===0}var Dt=(e,t,r,n=!0,a=!0,o=!1)=>{let i=e.indexOf(t),s=i===0,l=i===e.length-1;n&&(r=r==="previous"&&s?"last":r==="next"&&l?"first":r);let u;return r==="previous"?u=e[i-1]||e[n?e.length-1:i]:r==="next"?u=e[i+1]||e[n?0:i]:r==="last"?u=e[e.length-1]:u=e[0],et(u,a,"tabbable",o?u:void 0),u};function Ot(e,t){if(e.parentNode!==t.parentNode)return!1;let r=Array.from(e.parentNode.children);return r.indexOf(e)<r.indexOf(t)}async function Mt(e,t){return k(e,t,"animation")}async function kt(e,t){return k(e,t,"transition")}function E(e,t,r){let n=t==="transition"?"transitionProperty":"animationName";return e.getAnimations().find(a=>a[n]===r)}async function k(e,t,r){let n=E(e,r,t);if(n||(await ht(),n=E(e,r,t)),!!n)try{await n.finished}catch{}}async function ht(){await new Promise(e=>requestAnimationFrame(()=>e()))}function Bt(e){return e.endsWith("px")?parseFloat(e):e.endsWith("vw")?N(parseFloat(e),window.innerWidth):e.endsWith("vh")?N(parseFloat(e),window.innerHeight):0}function N(e,t){return e*t/100}export{O as a,bt as b,yt as c,pt as d,mt as e,St as f,p as g,Tt as h,wt as i,_ as j,m as k,et as l,rt as m,Ct as n,Et as o,Nt as p,It as q,xt as r,At as s,ct as t,ft as u,dt as v,Rt as w,Ft as x,Dt as y,Ot as z,Mt as A,kt as B,ht as C,Bt as D};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as u,b as h}from"./PRB44CR7.js";import{a as p}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import"./TLLHA7VC.js";import"./VZVYZPXQ.js";import"./Z6CRZOOK.js";import"./XRJOD24G.js";import{D as c,E as t,I as s,P as d,g as n,h as l,o}from"./CSQVLDPF.js";var r={container:"container",dividerContainer:"divider-container",divider:"divider"},b={trigger:"trigger"},e={chevronDown:"chevronDown",caretDown:"caretDown",ellipsis:"ellipsis",handleVertical:"handle-vertical"},v=n`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([kind=brand]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-brand);--calcite-internal-split-button-divider-color: var(--calcite-color-foreground-1)}:host([kind=danger]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-status-danger);--calcite-internal-split-button-divider-color: var(--calcite-color-foreground-1)}:host([kind=neutral]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-foreground-3);--calcite-internal-split-button-divider-color: var(--calcite-color-text-1)}:host([kind=inverse]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-inverse);--calcite-internal-split-button-divider-color: var(--calcite-color-foreground-1)}:host([appearance=transparent]){--calcite-internal-split-button-divider-border-color: transparent}:host([appearance=transparent]):host([kind=brand]){--calcite-internal-split-button-divider-color: var(--calcite-color-brand)}:host([appearance=transparent]):host([kind=danger]){--calcite-internal-split-button-divider-color: var(--calcite-color-status-danger)}:host([appearance=transparent]):host([kind=neutral]){--calcite-internal-split-button-divider-color: var(--calcite-color-text-1)}:host([appearance=transparent]):host([kind=inverse]){--calcite-internal-split-button-divider-color: var(--calcite-color-foreground-1)}:host([appearance=outline]):host([kind=brand]),:host([appearance=outline]):host([kind=danger]),:host([appearance=outline]):host([kind=neutral]),:host([appearance=outline]):host([kind=inverse]){--calcite-internal-split-button-divider-border-color: transparent}:host([appearance=outline-fill]):host([kind=brand]),:host([appearance=outline-fill]):host([kind=danger]),:host([appearance=outline-fill]):host([kind=neutral]),:host([appearance=outline-fill]):host([kind=inverse]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-background)}:host([appearance=outline]):host([kind=brand]),:host([appearance=outline-fill]):host([kind=brand]){--calcite-internal-split-button-divider-color: var(--calcite-color-brand)}:host([appearance=outline]):host([kind=danger]),:host([appearance=outline-fill]):host([kind=danger]){--calcite-internal-split-button-divider-color: var(--calcite-color-status-danger)}:host([appearance=outline]):host([kind=neutral]),:host([appearance=outline-fill]):host([kind=neutral]){--calcite-internal-split-button-divider-color: var(--calcite-color-border-1)}:host([appearance=outline]):host([kind=inverse]),:host([appearance=outline-fill]):host([kind=inverse]){--calcite-internal-split-button-divider-color: var(--calcite-color-inverse)}.container{display:flex;align-items:stretch}.container>calcite-dropdown>calcite-button{block-size:100%;vertical-align:top}.divider-container{display:flex;inline-size:1px;align-items:stretch;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;background-color:var(--calcite-split-button-divider-color, var(--calcite-internal-split-button-divider-border-color))}.divider{margin-block:.25rem;display:inline-block;inline-size:1px;background-color:var(--calcite-split-button-divider-border-color, var(--calcite-internal-split-button-divider-color))}:host([appearance=outline-fill]) .divider-container,:host([appearance=outline]) .divider-container{border-block:1px solid var(--calcite-internal-split-button-divider-color)}:host([appearance=outline-fill]):hover .divider-container,:host([appearance=outline]):hover .divider-container{background-color:var(--calcite-internal-split-button-divider-color)}:host([appearance=outline-fill]:hover) .divider-container,:host([appearance=outline]:hover) .divider-container{background-color:var(--calcite-internal-split-button-divider-color)}:host([appearance=outline-fill]:focus-within):host([kind=brand]),:host([appearance=outline]:focus-within):host([kind=brand]){--calcite-internal-split-button-divider-color: var(--calcite-color-brand-press)}:host([appearance=outline-fill]:focus-within):host([kind=danger]),:host([appearance=outline]:focus-within):host([kind=danger]){--calcite-internal-split-button-divider-color: var(--calcite-color-danger-press)}:host([appearance=outline-fill]:focus-within) .divider-container,:host([appearance=outline]:focus-within) .divider-container{background-color:var(--calcite-internal-split-button-divider-color)}calcite-button[split-child=primary],calcite-button[split-child=secondary]{--calcite-button-background-color: var(--calcite-split-button-background-color);--calcite-button-border-color: var(--calcite-split-button-border-color);--calcite-button-text-color: var(--calcite-split-button-text-color);--calcite-button-icon-color: var(--calcite-split-button-icon-color);--calcite-button-loading-color: var(--calcite-split-button-loading-color);--calcite-button-shadow: var(--calcite-split-button-shadow)}calcite-button[split-child=primary]{--calcite-button-corner-radius: var(--calcite-split-button-corner-radius) var(--calcite-corner-radius-none) var(--calcite-corner-radius-none) var(--calcite-split-button-corner-radius)}calcite-button[split-child=secondary]{--calcite-button-corner-radius: var(--calcite-corner-radius-none) var(--calcite-split-button-corner-radius) var(--calcite-split-button-corner-radius) var(--calcite-corner-radius-none)}calcite-dropdown{--calcite-dropdown-shadow: var(--calcite-split-button-dropdown-shadow);--calcite-dropdown-background-color: var(--calcite-split-button-dropdown-background-color);--calcite-dropdown-width: var(--calcite-split-button-dropdown-width)}:host([disabled]) calcite-dropdown>calcite-button{pointer-events:none}:host([disabled]):host([appearance=outline-fill]) .divider-container{background-color:var(--calcite-color-background)}:host([disabled]):host([appearance=outline]) .divider-container{background-color:transparent}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,a=class extends c{constructor(){super(...arguments),this.focusSetter=p()(this),this.active=!1,this.appearance="solid",this.disabled=!1,this.download=!1,this.dropdownIconType="chevron",this.kind="brand",this.loading=!1,this.overlayPositioning="absolute",this.placement="bottom-end",this.scale="m",this.width="auto",this.calciteSplitButtonPrimaryClick=o({cancelable:!1}),this.calciteSplitButtonSecondaryClick=o({cancelable:!1})}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],download:[3,{converter:s},{reflect:!0}],dropdownIconType:[3,{},{reflect:!0}],dropdownLabel:[3,{},{reflect:!0}],flipPlacements:[0,{},{attribute:!1}],href:[3,{},{reflect:!0}],kind:[3,{},{reflect:!0}],loading:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],rel:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],primaryIconEnd:[3,{type:String},{reflect:!0}],primaryIconFlipRtl:[3,{},{reflect:!0}],primaryIconStart:[3,{type:String},{reflect:!0}],primaryLabel:[3,{},{reflect:!0}],primaryText:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}],target:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=v}get dropdownIcon(){return this.dropdownIconType==="chevron"?e.chevronDown:this.dropdownIconType==="caret"?e.caretDown:this.dropdownIconType==="ellipsis"?e.ellipsis:e.handleVertical}async setFocus(i){return this.focusSetter(()=>this.el,i)}updated(){u(this)}calciteSplitButtonPrimaryClickHandler(){this.calciteSplitButtonPrimaryClick.emit()}calciteSplitButtonSecondaryClickHandler(){this.calciteSplitButtonSecondaryClick.emit()}render(){let i=this.width==="auto"?"auto":"full";return h({disabled:this.disabled,children:l`<div class=${t(r.container)}><calcite-button .appearance=${this.appearance} .disabled=${this.disabled} .download=${this.download} .href=${this.href} .iconEnd=${this.primaryIconEnd?this.primaryIconEnd:null} .iconFlipRtl=${this.primaryIconFlipRtl?this.primaryIconFlipRtl:null} .iconStart=${this.primaryIconStart?this.primaryIconStart:null} .kind=${this.kind} .label=${this.primaryLabel} .loading=${this.loading} @click=${this.calciteSplitButtonPrimaryClickHandler} .rel=${this.rel} .scale=${this.scale} split-child=primary .target=${this.target} type=button .width=${i}>${this.primaryText}</calcite-button><div class=${t(r.dividerContainer)}><div class=${t(r.divider)}></div></div><calcite-dropdown .disabled=${this.disabled} .flipPlacements=${this.flipPlacements} @click=${this.calciteSplitButtonSecondaryClickHandler} .open=${this.active} .overlayPositioning=${this.overlayPositioning} .placement=${this.placement} .scale=${this.scale} .widthScale=${this.scale}><calcite-button .appearance=${this.appearance} .disabled=${this.disabled} .iconStart=${this.dropdownIcon} .kind=${this.kind} .label=${this.dropdownLabel} .scale=${this.scale} slot=${b.trigger} split-child=secondary type=button></calcite-button><slot></slot></calcite-dropdown></div>`})}};d("calcite-split-button",a);export{a as SplitButton};
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as u,b as h}from"./NSBK36H4.js";import{a as p}from"./WOTQIMPZ.js";import"./B5JXPZDV.js";import"./3YZG7MA3.js";import"./CIU4VM7X.js";import"./5IPJANUU.js";import"./ZLR2B6GQ.js";import{D as c,E as t,I as s,P as d,g as n,h as l,o}from"./AUIOWPFN.js";var r={container:"container",dividerContainer:"divider-container",divider:"divider"},b={trigger:"trigger"},e={chevronDown:"chevronDown",caretDown:"caretDown",ellipsis:"ellipsis",handleVertical:"handle-vertical"},v=n`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([kind=brand]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-brand);--calcite-internal-split-button-divider-color: var(--calcite-color-foreground-1)}:host([kind=danger]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-status-danger);--calcite-internal-split-button-divider-color: var(--calcite-color-foreground-1)}:host([kind=neutral]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-foreground-3);--calcite-internal-split-button-divider-color: var(--calcite-color-text-1)}:host([kind=inverse]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-inverse);--calcite-internal-split-button-divider-color: var(--calcite-color-foreground-1)}:host([appearance=transparent]){--calcite-internal-split-button-divider-border-color: transparent}:host([appearance=transparent]):host([kind=brand]){--calcite-internal-split-button-divider-color: var(--calcite-color-brand)}:host([appearance=transparent]):host([kind=danger]){--calcite-internal-split-button-divider-color: var(--calcite-color-status-danger)}:host([appearance=transparent]):host([kind=neutral]){--calcite-internal-split-button-divider-color: var(--calcite-color-text-1)}:host([appearance=transparent]):host([kind=inverse]){--calcite-internal-split-button-divider-color: var(--calcite-color-foreground-1)}:host([appearance=outline]):host([kind=brand]),:host([appearance=outline]):host([kind=danger]),:host([appearance=outline]):host([kind=neutral]),:host([appearance=outline]):host([kind=inverse]){--calcite-internal-split-button-divider-border-color: transparent}:host([appearance=outline-fill]):host([kind=brand]),:host([appearance=outline-fill]):host([kind=danger]),:host([appearance=outline-fill]):host([kind=neutral]),:host([appearance=outline-fill]):host([kind=inverse]){--calcite-internal-split-button-divider-border-color: var(--calcite-color-background)}:host([appearance=outline]):host([kind=brand]),:host([appearance=outline-fill]):host([kind=brand]){--calcite-internal-split-button-divider-color: var(--calcite-color-brand)}:host([appearance=outline]):host([kind=danger]),:host([appearance=outline-fill]):host([kind=danger]){--calcite-internal-split-button-divider-color: var(--calcite-color-status-danger)}:host([appearance=outline]):host([kind=neutral]),:host([appearance=outline-fill]):host([kind=neutral]){--calcite-internal-split-button-divider-color: var(--calcite-color-border-1)}:host([appearance=outline]):host([kind=inverse]),:host([appearance=outline-fill]):host([kind=inverse]){--calcite-internal-split-button-divider-color: var(--calcite-color-inverse)}.container{display:flex;align-items:stretch}.container>calcite-dropdown>calcite-button{block-size:100%;vertical-align:top}.divider-container{display:flex;inline-size:1px;align-items:stretch;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;background-color:var(--calcite-split-button-divider-color, var(--calcite-internal-split-button-divider-border-color))}.divider{margin-block:.25rem;display:inline-block;inline-size:1px;background-color:var(--calcite-split-button-divider-border-color, var(--calcite-internal-split-button-divider-color))}:host([appearance=outline-fill]) .divider-container,:host([appearance=outline]) .divider-container{border-block:1px solid var(--calcite-internal-split-button-divider-color)}:host([appearance=outline-fill]):hover .divider-container,:host([appearance=outline]):hover .divider-container{background-color:var(--calcite-internal-split-button-divider-color)}:host([appearance=outline-fill]:hover) .divider-container,:host([appearance=outline]:hover) .divider-container{background-color:var(--calcite-internal-split-button-divider-color)}:host([appearance=outline-fill]:focus-within):host([kind=brand]),:host([appearance=outline]:focus-within):host([kind=brand]){--calcite-internal-split-button-divider-color: var(--calcite-color-brand-press)}:host([appearance=outline-fill]:focus-within):host([kind=danger]),:host([appearance=outline]:focus-within):host([kind=danger]){--calcite-internal-split-button-divider-color: var(--calcite-color-danger-press)}:host([appearance=outline-fill]:focus-within) .divider-container,:host([appearance=outline]:focus-within) .divider-container{background-color:var(--calcite-internal-split-button-divider-color)}calcite-button[split-child=primary],calcite-button[split-child=secondary]{--calcite-button-background-color: var(--calcite-split-button-background-color);--calcite-button-border-color: var(--calcite-split-button-border-color);--calcite-button-text-color: var(--calcite-split-button-text-color);--calcite-button-icon-color: var(--calcite-split-button-icon-color);--calcite-button-loading-color: var(--calcite-split-button-loading-color);--calcite-button-shadow: var(--calcite-split-button-shadow)}calcite-button[split-child=primary]{--calcite-button-corner-radius: var(--calcite-split-button-corner-radius) var(--calcite-corner-radius-none) var(--calcite-corner-radius-none) var(--calcite-split-button-corner-radius)}calcite-button[split-child=secondary]{--calcite-button-corner-radius: var(--calcite-corner-radius-none) var(--calcite-split-button-corner-radius) var(--calcite-split-button-corner-radius) var(--calcite-corner-radius-none)}calcite-dropdown{--calcite-dropdown-shadow: var(--calcite-split-button-dropdown-shadow);--calcite-dropdown-background-color: var(--calcite-split-button-dropdown-background-color);--calcite-dropdown-width: var(--calcite-split-button-dropdown-width)}:host([disabled]) calcite-dropdown>calcite-button{pointer-events:none}:host([disabled]):host([appearance=outline-fill]) .divider-container{background-color:var(--calcite-color-background)}:host([disabled]):host([appearance=outline]) .divider-container{background-color:transparent}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,a=class extends c{constructor(){super(...arguments),this.focusSetter=p()(this),this.active=!1,this.appearance="solid",this.disabled=!1,this.download=!1,this.dropdownIconType="chevron",this.kind="brand",this.loading=!1,this.overlayPositioning="absolute",this.placement="bottom-end",this.scale="m",this.width="auto",this.calciteSplitButtonPrimaryClick=o({cancelable:!1}),this.calciteSplitButtonSecondaryClick=o({cancelable:!1})}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],download:[3,{converter:s},{reflect:!0}],dropdownIconType:[3,{},{reflect:!0}],dropdownLabel:[3,{},{reflect:!0}],flipPlacements:[0,{},{attribute:!1}],href:[3,{},{reflect:!0}],kind:[3,{},{reflect:!0}],loading:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],rel:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],primaryIconEnd:[3,{type:String},{reflect:!0}],primaryIconFlipRtl:[3,{},{reflect:!0}],primaryIconStart:[3,{type:String},{reflect:!0}],primaryLabel:[3,{},{reflect:!0}],primaryText:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}],target:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=v}get dropdownIcon(){return this.dropdownIconType==="chevron"?e.chevronDown:this.dropdownIconType==="caret"?e.caretDown:this.dropdownIconType==="ellipsis"?e.ellipsis:e.handleVertical}async setFocus(i){return this.focusSetter(()=>this.el,i)}updated(){u(this)}calciteSplitButtonPrimaryClickHandler(){this.calciteSplitButtonPrimaryClick.emit()}calciteSplitButtonSecondaryClickHandler(){this.calciteSplitButtonSecondaryClick.emit()}render(){let i=this.width==="auto"?"auto":"full";return h({disabled:this.disabled,children:l`<div class=${t(r.container)}><calcite-button .appearance=${this.appearance} .disabled=${this.disabled} .download=${this.download} .href=${this.href} .iconEnd=${this.primaryIconEnd?this.primaryIconEnd:null} .iconFlipRtl=${this.primaryIconFlipRtl?this.primaryIconFlipRtl:null} .iconStart=${this.primaryIconStart?this.primaryIconStart:null} .kind=${this.kind} .label=${this.primaryLabel} .loading=${this.loading} @click=${this.calciteSplitButtonPrimaryClickHandler} .rel=${this.rel} .scale=${this.scale} split-child=primary .target=${this.target} type=button .width=${i}>${this.primaryText}</calcite-button><div class=${t(r.dividerContainer)}><div class=${t(r.divider)}></div></div><calcite-dropdown .disabled=${this.disabled} .flipPlacements=${this.flipPlacements} @click=${this.calciteSplitButtonSecondaryClickHandler} .open=${this.active} .overlayPositioning=${this.overlayPositioning} .placement=${this.placement} .scale=${this.scale} .widthScale=${this.scale}><calcite-button .appearance=${this.appearance} .disabled=${this.disabled} .iconStart=${this.dropdownIcon} .kind=${this.kind} .label=${this.dropdownLabel} .scale=${this.scale} slot=${b.trigger} split-child=secondary type=button></calcite-button><slot></slot></calcite-dropdown></div>`})}};d("calcite-split-button",a);export{a as SplitButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as Dt}from"./EQC2JW3I.js";import{e as Lt}from"./Z6CRZOOK.js";import{K as Tt}from"./CSQVLDPF.js";var vt=["top","right","bottom","left"],Ft=["start","end"],bt=vt.reduce((t,e)=>t.concat(e,e+"-"+Ft[0],e+"-"+Ft[1]),[]),j=Math.min,V=Math.max,rt=Math.round,ct=Math.floor,M=t=>({x:t,y:t}),Oe={left:"right",right:"left",bottom:"top",top:"bottom"},Re={start:"end",end:"start"};function ut(t,e,n){return V(t,j(e,n))}function X(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function k(t){return t.split("-")[1]}function At(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}var Se=new Set(["top","bottom"]);function _(t){return Se.has(W(t))?"y":"x"}function mt(t){return At(_(t))}function Ot(t,e,n){n===void 0&&(n=!1);let o=k(t),i=mt(t),r=dt(i),s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=st(s)),[s,st(s)]}function Nt(t){let e=st(t);return[it(t),e,it(e)]}function it(t){return t.replace(/start|end/g,e=>Re[e])}var Mt=["left","right"],kt=["right","left"],Pe=["top","bottom"],Ce=["bottom","top"];function Ee(t,e,n){switch(t){case"top":case"bottom":return n?e?kt:Mt:e?Mt:kt;case"left":case"right":return e?Pe:Ce;default:return[]}}function Bt(t,e,n,o){let i=k(t),r=Ee(W(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(it)))),r}function st(t){return t.replace(/left|right|bottom|top/g,e=>Oe[e])}function Te(t){return{top:0,right:0,bottom:0,left:0,...t}}function Rt(t){return typeof t!="number"?Te(t):{top:t,right:t,bottom:t,left:t}}function K(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Wt(t,e,n){let{reference:o,floating:i}=t,r=_(e),s=mt(e),c=dt(s),l=W(e),a=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2,f;switch(l){case"top":f={x:d,y:o.y-i.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(k(e)){case"start":f[s]-=m*(n&&a?-1:1);break;case"end":f[s]+=m*(n&&a?-1:1);break}return f}var Vt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e)),a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=Wt(a,o,l),m=o,f={},g=0;for(let h=0;h<c.length;h++){let{name:p,fn:w}=c[h],{x,y,data:b,reset:v}=await w({x:d,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:f,rects:a,platform:s,elements:{reference:t,floating:e}});d=x??d,u=y??u,f={...f,[p]:{...f[p],...b}},v&&g<=50&&(g++,typeof v=="object"&&(v.placement&&(m=v.placement),v.rects&&(a=v.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:d,y:u}=Wt(a,m,l)),h=-1)}return{x:d,y:u,placement:m,strategy:i,middlewareData:f}};async function Z(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:f=0}=X(e,t),g=Rt(f),p=c[m?u==="floating"?"reference":"floating":u],w=K(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(p)))==null||n?p:p.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),x=u==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),b=await(r.isElement==null?void 0:r.isElement(y))?await(r.getScale==null?void 0:r.getScale(y))||{x:1,y:1}:{x:1,y:1},v=K(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:l}):x);return{top:(w.top-v.top+g.top)/b.y,bottom:(v.bottom-w.bottom+g.bottom)/b.y,left:(w.left-v.left+g.left)/b.x,right:(v.right-w.right+g.right)/b.x}}var _t=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:l}=e,{element:a,padding:d=0}=X(t,e)||{};if(a==null)return{};let u=Rt(d),m={x:n,y:o},f=mt(i),g=dt(f),h=await s.getDimensions(a),p=f==="y",w=p?"top":"left",x=p?"bottom":"right",y=p?"clientHeight":"clientWidth",b=r.reference[g]+r.reference[f]-m[f]-r.floating[g],v=m[f]-r.reference[f],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a)),O=R?R[y]:0;(!O||!await(s.isElement==null?void 0:s.isElement(R)))&&(O=c.floating[y]||r.floating[g]);let I=b/2-v/2,C=O/2-h[g]/2-1,A=j(u[w],C),L=j(u[x],C),$=A,Y=O-h[g]-L,S=O/2-h[g]/2+I,q=ut($,S,Y),H=!l.arrow&&k(i)!=null&&S!==q&&r.reference[g]/2-(S<$?A:L)-h[g]/2<0,D=H?S<$?S-$:S-Y:0;return{[f]:m[f]+D,data:{[f]:q,centerOffset:S-q-D,...H&&{alignmentOffset:D}},reset:H}}});function Le(t,e,n){return(t?[...n.filter(i=>k(i)===t),...n.filter(i=>k(i)!==t)]:n.filter(i=>W(i)===i)).filter(i=>t?k(i)===t||(e?it(i)!==i:!1):!0)}var zt=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;let{rects:r,middlewareData:s,placement:c,platform:l,elements:a}=e,{crossAxis:d=!1,alignment:u,allowedPlacements:m=bt,autoAlignment:f=!0,...g}=X(t,e),h=u!==void 0||m===bt?Le(u||null,f,m):m,p=await Z(e,g),w=((n=s.autoPlacement)==null?void 0:n.index)||0,x=h[w];if(x==null)return{};let y=Ot(x,r,await(l.isRTL==null?void 0:l.isRTL(a.floating)));if(c!==x)return{reset:{placement:h[0]}};let b=[p[W(x)],p[y[0]],p[y[1]]],v=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:x,overflows:b}],R=h[w+1];if(R)return{data:{index:w+1,overflows:v},reset:{placement:R}};let O=v.map(A=>{let L=k(A.placement);return[A.placement,L&&d?A.overflows.slice(0,2).reduce(($,Y)=>$+Y,0):A.overflows[0],A.overflows]}).sort((A,L)=>A[1]-L[1]),C=((i=O.filter(A=>A[2].slice(0,k(A[0])?2:3).every(L=>L<=0))[0])==null?void 0:i[0])||O[0][0];return C!==c?{data:{index:w+1,overflows:v},reset:{placement:C}}:{}}}},It=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...p}=X(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};let w=W(i),x=_(c),y=W(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),v=m||(y||!h?[st(c)]:Nt(c)),R=g!=="none";!m&&R&&v.push(...Bt(c,h,g,b));let O=[c,...v],I=await Z(e,p),C=[],A=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&C.push(I[w]),u){let S=Ot(i,s,b);C.push(I[S[0]],I[S[1]])}if(A=[...A,{placement:i,overflows:C}],!C.every(S=>S<=0)){var L,$;let S=(((L=r.flip)==null?void 0:L.index)||0)+1,q=O[S];if(q&&(!(u==="alignment"?x!==_(q):!1)||A.every(F=>_(F.placement)===x?F.overflows[0]>0:!0)))return{data:{index:S,overflows:A},reset:{placement:q}};let H=($=A.filter(D=>D.overflows[0]<=0).sort((D,F)=>D.overflows[1]-F.overflows[1])[0])==null?void 0:$.placement;if(!H)switch(f){case"bestFit":{var Y;let D=(Y=A.filter(F=>{if(R){let U=_(F.placement);return U===x||U==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(U=>U>0).reduce((U,Ae)=>U+Ae,0)]).sort((F,U)=>F[1]-U[1])[0])==null?void 0:Y[0];D&&(H=D);break}case"initialPlacement":H=c;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function $t(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ht(t){return vt.some(e=>t[e]>=0)}var Ut=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n}=e,{strategy:o="referenceHidden",...i}=X(t,e);switch(o){case"referenceHidden":{let r=await Z(e,{...i,elementContext:"reference"}),s=$t(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ht(s)}}}case"escaped":{let r=await Z(e,{...i,altBoundary:!0}),s=$t(r,n.floating);return{data:{escapedOffsets:s,escaped:Ht(s)}}}default:return{}}}}};var De=new Set(["left","top"]);async function Fe(t,e){let{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=W(n),c=k(n),l=_(n)==="y",a=De.has(s)?-1:1,d=r&&l?-1:1,u=X(e,t),{mainAxis:m,crossAxis:f,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof g=="number"&&(f=c==="end"?g*-1:g),l?{x:f*d,y:m*a}:{x:m*a,y:f*d}}var jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:i,y:r,placement:s,middlewareData:c}=e,l=await Fe(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Xt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:p=>{let{x:w,y:x}=p;return{x:w,y:x}}},...l}=X(t,e),a={x:n,y:o},d=await Z(e,l),u=_(W(i)),m=At(u),f=a[m],g=a[u];if(r){let p=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=f+d[p],y=f-d[w];f=ut(x,f,y)}if(s){let p=u==="y"?"top":"left",w=u==="y"?"bottom":"right",x=g+d[p],y=g-d[w];g=ut(x,g,y)}let h=c.fn({...e,[m]:f,[u]:g});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[m]:r,[u]:s}}}}}};function gt(){return typeof window<"u"}function G(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qt(t){return gt()?t instanceof Node||t instanceof P(t).Node:!1}function E(t){return gt()?t instanceof Element||t instanceof P(t).Element:!1}function B(t){return gt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function Yt(t){return!gt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}var Me=new Set(["inline","contents"]);function et(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=T(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!Me.has(i)}var ke=new Set(["table","td","th"]);function Kt(t){return ke.has(G(t))}var Ne=[":popover-open",":modal"];function lt(t){return Ne.some(e=>{try{return t.matches(e)}catch{return!1}})}var Be=["transform","translate","scale","rotate","perspective"],We=["transform","translate","scale","rotate","perspective","filter"],$e=["paint","layout","strict","content"];function nt(t){let e=ht(),n=E(t)?T(t):t;return Be.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||We.some(o=>(n.willChange||"").includes(o))||$e.some(o=>(n.contain||"").includes(o))}function Gt(t){let e=z(t);for(;B(e)&&!J(e);){if(nt(e))return e;if(lt(e))return null;e=z(e)}return null}function ht(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var He=new Set(["html","body","#document"]);function J(t){return He.has(G(t))}function T(t){return P(t).getComputedStyle(t)}function at(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function z(t){if(G(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Yt(t)&&t.host||N(t);return Yt(e)?e.host:e}function Jt(t){let e=z(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&et(e)?e:Jt(e)}function tt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Jt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=P(i);if(r){let c=pt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],c&&n?tt(c):[])}return e.concat(i,tt(i,[],n))}function pt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ee(t){let e=T(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=B(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=rt(n)!==r||rt(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Pt(t){return E(t)?t:t.contextElement}function ot(t){let e=Pt(t);if(!B(e))return M(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=ee(e),s=(r?rt(n.width):n.width)/o,c=(r?rt(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var Ve=M(0);function ne(t){let e=P(t);return!ht()||!e.visualViewport?Ve:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _e(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=Pt(t),s=M(1);e&&(o?E(o)&&(s=ot(o)):s=ot(t));let c=_e(r,n,o)?ne(r):M(0),l=(i.left+c.x)/s.x,a=(i.top+c.y)/s.y,d=i.width/s.x,u=i.height/s.y;if(r){let m=P(r),f=o&&E(o)?P(o):o,g=m,h=pt(g);for(;h&&o&&f!==g;){let p=ot(h),w=h.getBoundingClientRect(),x=T(h),y=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*p.x,b=w.top+(h.clientTop+parseFloat(x.paddingTop))*p.y;l*=p.x,a*=p.y,d*=p.x,u*=p.y,l+=y,a+=b,g=P(h),h=pt(g)}}return K({width:d,height:u,x:l,y:a})}function wt(t,e){let n=at(t).scrollLeft;return e?e.left+n:Q(N(t)).left+n}function oe(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-wt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function ze(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",s=N(o),c=e?lt(e.floating):!1;if(o===s||c&&r)return n;let l={scrollLeft:0,scrollTop:0},a=M(1),d=M(0),u=B(o);if((u||!u&&!r)&&((G(o)!=="body"||et(s))&&(l=at(o)),B(o))){let f=Q(o);a=ot(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}let m=s&&!u&&!r?oe(s,l):M(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+d.x+m.x,y:n.y*a.y-l.scrollTop*a.y+d.y+m.y}}function Ie(t){return Array.from(t.getClientRects())}function Ue(t){let e=N(t),n=at(t),o=t.ownerDocument.body,i=V(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=V(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+wt(t),c=-n.scrollTop;return T(o).direction==="rtl"&&(s+=V(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}var Qt=25;function je(t,e){let n=P(t),o=N(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,c=0,l=0;if(i){r=i.width,s=i.height;let d=ht();(!d||d&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}let a=wt(o);if(a<=0){let d=o.ownerDocument,u=d.body,m=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(o.clientWidth-u.clientWidth-f);g<=Qt&&(r-=g)}else a<=Qt&&(r+=a);return{width:r,height:s,x:c,y:l}}var Xe=new Set(["absolute","fixed"]);function Ye(t,e){let n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?ot(t):M(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=i*r.x,a=o*r.y;return{width:s,height:c,x:l,y:a}}function Zt(t,e,n){let o;if(e==="viewport")o=je(t,n);else if(e==="document")o=Ue(N(t));else if(E(e))o=Ye(e,n);else{let i=ne(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return K(o)}function ie(t,e){let n=z(t);return n===e||!E(n)||J(n)?!1:T(n).position==="fixed"||ie(n,e)}function qe(t,e){let n=e.get(t);if(n)return n;let o=tt(t,[],!1).filter(c=>E(c)&&G(c)!=="body"),i=null,r=T(t).position==="fixed",s=r?z(t):t;for(;E(s)&&!J(s);){let c=T(s),l=nt(s);!l&&c.position==="fixed"&&(i=null),(r?!l&&!i:!l&&c.position==="static"&&!!i&&Xe.has(i.position)||et(s)&&!l&&ie(t,s))?o=o.filter(d=>d!==s):i=c,s=z(s)}return e.set(t,o),o}function Ke(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,s=[...n==="clippingAncestors"?lt(e)?[]:qe(e,this._c):[].concat(n),o],c=s[0],l=s.reduce((a,d)=>{let u=Zt(e,d,i);return a.top=V(u.top,a.top),a.right=j(u.right,a.right),a.bottom=j(u.bottom,a.bottom),a.left=V(u.left,a.left),a},Zt(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ge(t){let{width:e,height:n}=ee(t);return{width:e,height:n}}function Je(t,e,n){let o=B(e),i=N(e),r=n==="fixed",s=Q(t,!0,r,e),c={scrollLeft:0,scrollTop:0},l=M(0);function a(){l.x=wt(i)}if(o||!o&&!r)if((G(e)!=="body"||et(i))&&(c=at(e)),o){let f=Q(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&a();r&&!o&&i&&a();let d=i&&!o&&!r?oe(i,c):M(0),u=s.left+c.scrollLeft-l.x-d.x,m=s.top+c.scrollTop-l.y-d.y;return{x:u,y:m,width:s.width,height:s.height}}function St(t){return T(t).position==="static"}function te(t,e){if(!B(t)||T(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return N(t)===n&&(n=n.ownerDocument.body),n}function se(t,e){let n=P(t);if(lt(t))return n;if(!B(t)){let i=z(t);for(;i&&!J(i);){if(E(i)&&!St(i))return i;i=z(i)}return n}let o=te(t,e);for(;o&&Kt(o)&&St(o);)o=te(o,e);return o&&J(o)&&St(o)&&!nt(o)?n:o||Gt(t)||n}var Qe=async function(t){let e=this.getOffsetParent||se,n=this.getDimensions,o=await n(t.floating);return{reference:Je(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ze(t){return T(t).direction==="rtl"}var xt={convertOffsetParentRelativeRectToViewportRelativeRect:ze,getDocumentElement:N,getClippingRect:Ke,getOffsetParent:se,getElementRects:Qe,getClientRects:Ie,getDimensions:Ge,getScale:ot,isElement:E,isRTL:Ze};function re(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function tn(t,e){let n=null,o,i=N(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();let a=t.getBoundingClientRect(),{left:d,top:u,width:m,height:f}=a;if(c||e(),!m||!f)return;let g=ct(u),h=ct(i.clientWidth-(d+m)),p=ct(i.clientHeight-(u+f)),w=ct(d),y={rootMargin:-g+"px "+-h+"px "+-p+"px "+-w+"px",threshold:V(0,j(1,l))||1},b=!0;function v(R){let O=R[0].intersectionRatio;if(O!==l){if(!b)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!re(a,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(v,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,y)}n.observe(t)}return s(!0),r}function ce(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Pt(t),d=i||r?[...a?tt(a):[],...tt(e)]:[];d.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});let u=a&&c?tn(a,n):null,m=-1,f=null;s&&(f=new ResizeObserver(w=>{let[x]=w;x&&x.target===a&&f&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(e)})),n()}),a&&!l&&f.observe(a),f.observe(e));let g,h=l?Q(t):null;l&&p();function p(){let w=Q(t);h&&!re(h,w)&&n(),h=w,g=requestAnimationFrame(p)}return n(),()=>{var w;d.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),u?.(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(g)}}var le=jt,ae=zt,fe=Xt,Ct=It;var ue=Ut,de=_t;var me=(t,e,n)=>{let o=new Map,i={platform:xt,...n},r={...i.platform,_c:o};return Vt(t,e,{...i,platform:r})};function ge(t){return en(t)}function Et(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function en(t){for(let e=t;e;e=Et(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=Et(t);e;e=Et(e)){if(!(e instanceof Element))continue;let n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||nt(n)||e.tagName==="BODY"))return e}return null}(function(){if(!!1){let e=xt.getOffsetParent;xt.getOffsetParent=n=>e(n,ge)}})();function he(t){let e=window.devicePixelRatio||1;return Math.round(t*e)/e}var ye=(async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:r,flipPlacements:s,offsetDistance:c,offsetSkidding:l,arrowEl:a,type:d})=>{if(!e||!n)return;let u=Lt(n)==="rtl",{x:m,y:f,placement:g,strategy:h,middlewareData:p}=await me(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:pe(i,u),middleware:on({placement:i,flipDisabled:r,flipPlacements:s?.map(b=>pe(b,u)),offsetDistance:c,offsetSkidding:l,arrowEl:a,type:d})});if(a&&p.arrow){let{x:b,y:v}=p.arrow,R=g.split("-")[0],O=b!=null?"left":"top",I=cn[R],C={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=R==="left"||R==="right"?"horizontal":"vertical"),Object.assign(a.style,{...C,[O]:`${O=="left"?b:v}px`,[R]:"100%",transform:I})}let x=p.hide?.referenceHidden?"hidden":null,y=x?"none":null;n.setAttribute(nn,g),Object.assign(n.style,{pointerEvents:y,position:h,transform:`translate(${he(m)}px,${he(f)}px)`,visibility:x})}),nn="data-placement",ve=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],Ln="bottom-start",Dn="bottom-end",Fn={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function on({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:r,type:s}){let c=[fe(),ue()];return s==="menu"&&c.push(Ct({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})),c.push(le({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})),t==="auto"||t==="auto-start"||t==="auto-end"?c.push(ae({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(Ct(n?{fallbackPlacements:n}:{})),r&&c.push(de({element:r})),c}function sn(t){return ve.includes(t)}function Mn(t,e){let n=t.filter(sn);return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${ve.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function pe(t,e=!1){let n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function kn(t,e,n=!1){if(!t.open||!e.floatingEl||!e.referenceEl)return;if(Object.assign(e.floatingEl.style,{display:"block",position:e.overlayPositioning??"absolute"}),!ft.get(t))return be(t);await(n?rn(t):ye)(t,e)}function rn(t){let e=yt.get(t);return e||(e=Dt(ye,Tt.reposition,{edges:["leading","trailing"]}),yt.set(t,e),e)}var cn={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},ft=new WeakMap,yt=new WeakMap;async function be(t){let{referenceEl:e,floatingEl:n}=t;if(!n.isConnected)return;let o=ce;ft.set(t,{state:"pending"});let i,r=o(e,n,()=>{let s=t.reposition();i||(i=s)});return ft.set(t,{state:"active",cleanUp:r}),i}function ln(t){let{floatingEl:e}=t;e&&Object.assign(e.style,{display:"",pointerEvents:"",position:"",transform:"",visibility:""})}async function Nn(t){let{floatingEl:e,referenceEl:n}=t;if(ln(t),!(!e||!n)&&(an(t),!!t.open))return be(t)}function an(t){let e=ft.get(t);e?.state==="active"&&e.cleanUp(),ft.delete(t),yt.get(t)?.cancel(),yt.delete(t)}var we=4,Bn=Math.ceil(Math.hypot(we,we));export{Ln as a,Dn as b,Fn as c,Mn as d,kn as e,ln as f,Nn as g,an as h,Bn as i};
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as Dt}from"./W5OJOVZY.js";import{e as Lt}from"./5IPJANUU.js";import{K as Tt}from"./AUIOWPFN.js";var vt=["top","right","bottom","left"],Ft=["start","end"],bt=vt.reduce((t,e)=>t.concat(e,e+"-"+Ft[0],e+"-"+Ft[1]),[]),j=Math.min,V=Math.max,rt=Math.round,ct=Math.floor,M=t=>({x:t,y:t}),Oe={left:"right",right:"left",bottom:"top",top:"bottom"},Re={start:"end",end:"start"};function ut(t,e,n){return V(t,j(e,n))}function X(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function k(t){return t.split("-")[1]}function At(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}var Se=new Set(["top","bottom"]);function _(t){return Se.has(W(t))?"y":"x"}function mt(t){return At(_(t))}function Ot(t,e,n){n===void 0&&(n=!1);let o=k(t),i=mt(t),r=dt(i),s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=st(s)),[s,st(s)]}function Nt(t){let e=st(t);return[it(t),e,it(e)]}function it(t){return t.replace(/start|end/g,e=>Re[e])}var Mt=["left","right"],kt=["right","left"],Pe=["top","bottom"],Ce=["bottom","top"];function Ee(t,e,n){switch(t){case"top":case"bottom":return n?e?kt:Mt:e?Mt:kt;case"left":case"right":return e?Pe:Ce;default:return[]}}function Bt(t,e,n,o){let i=k(t),r=Ee(W(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(it)))),r}function st(t){return t.replace(/left|right|bottom|top/g,e=>Oe[e])}function Te(t){return{top:0,right:0,bottom:0,left:0,...t}}function Rt(t){return typeof t!="number"?Te(t):{top:t,right:t,bottom:t,left:t}}function K(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Wt(t,e,n){let{reference:o,floating:i}=t,r=_(e),s=mt(e),c=dt(s),l=W(e),a=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2,f;switch(l){case"top":f={x:d,y:o.y-i.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(k(e)){case"start":f[s]-=m*(n&&a?-1:1);break;case"end":f[s]+=m*(n&&a?-1:1);break}return f}var Vt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e)),a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=Wt(a,o,l),m=o,f={},g=0;for(let h=0;h<c.length;h++){let{name:p,fn:w}=c[h],{x,y,data:b,reset:v}=await w({x:d,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:f,rects:a,platform:s,elements:{reference:t,floating:e}});d=x??d,u=y??u,f={...f,[p]:{...f[p],...b}},v&&g<=50&&(g++,typeof v=="object"&&(v.placement&&(m=v.placement),v.rects&&(a=v.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:d,y:u}=Wt(a,m,l)),h=-1)}return{x:d,y:u,placement:m,strategy:i,middlewareData:f}};async function Z(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:f=0}=X(e,t),g=Rt(f),p=c[m?u==="floating"?"reference":"floating":u],w=K(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(p)))==null||n?p:p.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),x=u==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),b=await(r.isElement==null?void 0:r.isElement(y))?await(r.getScale==null?void 0:r.getScale(y))||{x:1,y:1}:{x:1,y:1},v=K(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:l}):x);return{top:(w.top-v.top+g.top)/b.y,bottom:(v.bottom-w.bottom+g.bottom)/b.y,left:(w.left-v.left+g.left)/b.x,right:(v.right-w.right+g.right)/b.x}}var _t=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:l}=e,{element:a,padding:d=0}=X(t,e)||{};if(a==null)return{};let u=Rt(d),m={x:n,y:o},f=mt(i),g=dt(f),h=await s.getDimensions(a),p=f==="y",w=p?"top":"left",x=p?"bottom":"right",y=p?"clientHeight":"clientWidth",b=r.reference[g]+r.reference[f]-m[f]-r.floating[g],v=m[f]-r.reference[f],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a)),O=R?R[y]:0;(!O||!await(s.isElement==null?void 0:s.isElement(R)))&&(O=c.floating[y]||r.floating[g]);let I=b/2-v/2,C=O/2-h[g]/2-1,A=j(u[w],C),L=j(u[x],C),$=A,Y=O-h[g]-L,S=O/2-h[g]/2+I,q=ut($,S,Y),H=!l.arrow&&k(i)!=null&&S!==q&&r.reference[g]/2-(S<$?A:L)-h[g]/2<0,D=H?S<$?S-$:S-Y:0;return{[f]:m[f]+D,data:{[f]:q,centerOffset:S-q-D,...H&&{alignmentOffset:D}},reset:H}}});function Le(t,e,n){return(t?[...n.filter(i=>k(i)===t),...n.filter(i=>k(i)!==t)]:n.filter(i=>W(i)===i)).filter(i=>t?k(i)===t||(e?it(i)!==i:!1):!0)}var zt=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;let{rects:r,middlewareData:s,placement:c,platform:l,elements:a}=e,{crossAxis:d=!1,alignment:u,allowedPlacements:m=bt,autoAlignment:f=!0,...g}=X(t,e),h=u!==void 0||m===bt?Le(u||null,f,m):m,p=await Z(e,g),w=((n=s.autoPlacement)==null?void 0:n.index)||0,x=h[w];if(x==null)return{};let y=Ot(x,r,await(l.isRTL==null?void 0:l.isRTL(a.floating)));if(c!==x)return{reset:{placement:h[0]}};let b=[p[W(x)],p[y[0]],p[y[1]]],v=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:x,overflows:b}],R=h[w+1];if(R)return{data:{index:w+1,overflows:v},reset:{placement:R}};let O=v.map(A=>{let L=k(A.placement);return[A.placement,L&&d?A.overflows.slice(0,2).reduce(($,Y)=>$+Y,0):A.overflows[0],A.overflows]}).sort((A,L)=>A[1]-L[1]),C=((i=O.filter(A=>A[2].slice(0,k(A[0])?2:3).every(L=>L<=0))[0])==null?void 0:i[0])||O[0][0];return C!==c?{data:{index:w+1,overflows:v},reset:{placement:C}}:{}}}},It=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...p}=X(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};let w=W(i),x=_(c),y=W(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),v=m||(y||!h?[st(c)]:Nt(c)),R=g!=="none";!m&&R&&v.push(...Bt(c,h,g,b));let O=[c,...v],I=await Z(e,p),C=[],A=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&C.push(I[w]),u){let S=Ot(i,s,b);C.push(I[S[0]],I[S[1]])}if(A=[...A,{placement:i,overflows:C}],!C.every(S=>S<=0)){var L,$;let S=(((L=r.flip)==null?void 0:L.index)||0)+1,q=O[S];if(q&&(!(u==="alignment"?x!==_(q):!1)||A.every(F=>_(F.placement)===x?F.overflows[0]>0:!0)))return{data:{index:S,overflows:A},reset:{placement:q}};let H=($=A.filter(D=>D.overflows[0]<=0).sort((D,F)=>D.overflows[1]-F.overflows[1])[0])==null?void 0:$.placement;if(!H)switch(f){case"bestFit":{var Y;let D=(Y=A.filter(F=>{if(R){let U=_(F.placement);return U===x||U==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(U=>U>0).reduce((U,Ae)=>U+Ae,0)]).sort((F,U)=>F[1]-U[1])[0])==null?void 0:Y[0];D&&(H=D);break}case"initialPlacement":H=c;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function $t(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ht(t){return vt.some(e=>t[e]>=0)}var Ut=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n}=e,{strategy:o="referenceHidden",...i}=X(t,e);switch(o){case"referenceHidden":{let r=await Z(e,{...i,elementContext:"reference"}),s=$t(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ht(s)}}}case"escaped":{let r=await Z(e,{...i,altBoundary:!0}),s=$t(r,n.floating);return{data:{escapedOffsets:s,escaped:Ht(s)}}}default:return{}}}}};var De=new Set(["left","top"]);async function Fe(t,e){let{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=W(n),c=k(n),l=_(n)==="y",a=De.has(s)?-1:1,d=r&&l?-1:1,u=X(e,t),{mainAxis:m,crossAxis:f,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof g=="number"&&(f=c==="end"?g*-1:g),l?{x:f*d,y:m*a}:{x:m*a,y:f*d}}var jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:i,y:r,placement:s,middlewareData:c}=e,l=await Fe(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Xt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:p=>{let{x:w,y:x}=p;return{x:w,y:x}}},...l}=X(t,e),a={x:n,y:o},d=await Z(e,l),u=_(W(i)),m=At(u),f=a[m],g=a[u];if(r){let p=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=f+d[p],y=f-d[w];f=ut(x,f,y)}if(s){let p=u==="y"?"top":"left",w=u==="y"?"bottom":"right",x=g+d[p],y=g-d[w];g=ut(x,g,y)}let h=c.fn({...e,[m]:f,[u]:g});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[m]:r,[u]:s}}}}}};function gt(){return typeof window<"u"}function G(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qt(t){return gt()?t instanceof Node||t instanceof P(t).Node:!1}function E(t){return gt()?t instanceof Element||t instanceof P(t).Element:!1}function B(t){return gt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function Yt(t){return!gt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}var Me=new Set(["inline","contents"]);function et(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=T(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!Me.has(i)}var ke=new Set(["table","td","th"]);function Kt(t){return ke.has(G(t))}var Ne=[":popover-open",":modal"];function lt(t){return Ne.some(e=>{try{return t.matches(e)}catch{return!1}})}var Be=["transform","translate","scale","rotate","perspective"],We=["transform","translate","scale","rotate","perspective","filter"],$e=["paint","layout","strict","content"];function nt(t){let e=ht(),n=E(t)?T(t):t;return Be.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||We.some(o=>(n.willChange||"").includes(o))||$e.some(o=>(n.contain||"").includes(o))}function Gt(t){let e=z(t);for(;B(e)&&!J(e);){if(nt(e))return e;if(lt(e))return null;e=z(e)}return null}function ht(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var He=new Set(["html","body","#document"]);function J(t){return He.has(G(t))}function T(t){return P(t).getComputedStyle(t)}function at(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function z(t){if(G(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Yt(t)&&t.host||N(t);return Yt(e)?e.host:e}function Jt(t){let e=z(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&et(e)?e:Jt(e)}function tt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Jt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=P(i);if(r){let c=pt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],c&&n?tt(c):[])}return e.concat(i,tt(i,[],n))}function pt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ee(t){let e=T(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=B(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=rt(n)!==r||rt(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Pt(t){return E(t)?t:t.contextElement}function ot(t){let e=Pt(t);if(!B(e))return M(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=ee(e),s=(r?rt(n.width):n.width)/o,c=(r?rt(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var Ve=M(0);function ne(t){let e=P(t);return!ht()||!e.visualViewport?Ve:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _e(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=Pt(t),s=M(1);e&&(o?E(o)&&(s=ot(o)):s=ot(t));let c=_e(r,n,o)?ne(r):M(0),l=(i.left+c.x)/s.x,a=(i.top+c.y)/s.y,d=i.width/s.x,u=i.height/s.y;if(r){let m=P(r),f=o&&E(o)?P(o):o,g=m,h=pt(g);for(;h&&o&&f!==g;){let p=ot(h),w=h.getBoundingClientRect(),x=T(h),y=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*p.x,b=w.top+(h.clientTop+parseFloat(x.paddingTop))*p.y;l*=p.x,a*=p.y,d*=p.x,u*=p.y,l+=y,a+=b,g=P(h),h=pt(g)}}return K({width:d,height:u,x:l,y:a})}function wt(t,e){let n=at(t).scrollLeft;return e?e.left+n:Q(N(t)).left+n}function oe(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-wt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function ze(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",s=N(o),c=e?lt(e.floating):!1;if(o===s||c&&r)return n;let l={scrollLeft:0,scrollTop:0},a=M(1),d=M(0),u=B(o);if((u||!u&&!r)&&((G(o)!=="body"||et(s))&&(l=at(o)),B(o))){let f=Q(o);a=ot(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}let m=s&&!u&&!r?oe(s,l):M(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+d.x+m.x,y:n.y*a.y-l.scrollTop*a.y+d.y+m.y}}function Ie(t){return Array.from(t.getClientRects())}function Ue(t){let e=N(t),n=at(t),o=t.ownerDocument.body,i=V(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=V(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+wt(t),c=-n.scrollTop;return T(o).direction==="rtl"&&(s+=V(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}var Qt=25;function je(t,e){let n=P(t),o=N(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,c=0,l=0;if(i){r=i.width,s=i.height;let d=ht();(!d||d&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}let a=wt(o);if(a<=0){let d=o.ownerDocument,u=d.body,m=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(o.clientWidth-u.clientWidth-f);g<=Qt&&(r-=g)}else a<=Qt&&(r+=a);return{width:r,height:s,x:c,y:l}}var Xe=new Set(["absolute","fixed"]);function Ye(t,e){let n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?ot(t):M(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=i*r.x,a=o*r.y;return{width:s,height:c,x:l,y:a}}function Zt(t,e,n){let o;if(e==="viewport")o=je(t,n);else if(e==="document")o=Ue(N(t));else if(E(e))o=Ye(e,n);else{let i=ne(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return K(o)}function ie(t,e){let n=z(t);return n===e||!E(n)||J(n)?!1:T(n).position==="fixed"||ie(n,e)}function qe(t,e){let n=e.get(t);if(n)return n;let o=tt(t,[],!1).filter(c=>E(c)&&G(c)!=="body"),i=null,r=T(t).position==="fixed",s=r?z(t):t;for(;E(s)&&!J(s);){let c=T(s),l=nt(s);!l&&c.position==="fixed"&&(i=null),(r?!l&&!i:!l&&c.position==="static"&&!!i&&Xe.has(i.position)||et(s)&&!l&&ie(t,s))?o=o.filter(d=>d!==s):i=c,s=z(s)}return e.set(t,o),o}function Ke(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,s=[...n==="clippingAncestors"?lt(e)?[]:qe(e,this._c):[].concat(n),o],c=s[0],l=s.reduce((a,d)=>{let u=Zt(e,d,i);return a.top=V(u.top,a.top),a.right=j(u.right,a.right),a.bottom=j(u.bottom,a.bottom),a.left=V(u.left,a.left),a},Zt(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ge(t){let{width:e,height:n}=ee(t);return{width:e,height:n}}function Je(t,e,n){let o=B(e),i=N(e),r=n==="fixed",s=Q(t,!0,r,e),c={scrollLeft:0,scrollTop:0},l=M(0);function a(){l.x=wt(i)}if(o||!o&&!r)if((G(e)!=="body"||et(i))&&(c=at(e)),o){let f=Q(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&a();r&&!o&&i&&a();let d=i&&!o&&!r?oe(i,c):M(0),u=s.left+c.scrollLeft-l.x-d.x,m=s.top+c.scrollTop-l.y-d.y;return{x:u,y:m,width:s.width,height:s.height}}function St(t){return T(t).position==="static"}function te(t,e){if(!B(t)||T(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return N(t)===n&&(n=n.ownerDocument.body),n}function se(t,e){let n=P(t);if(lt(t))return n;if(!B(t)){let i=z(t);for(;i&&!J(i);){if(E(i)&&!St(i))return i;i=z(i)}return n}let o=te(t,e);for(;o&&Kt(o)&&St(o);)o=te(o,e);return o&&J(o)&&St(o)&&!nt(o)?n:o||Gt(t)||n}var Qe=async function(t){let e=this.getOffsetParent||se,n=this.getDimensions,o=await n(t.floating);return{reference:Je(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ze(t){return T(t).direction==="rtl"}var xt={convertOffsetParentRelativeRectToViewportRelativeRect:ze,getDocumentElement:N,getClippingRect:Ke,getOffsetParent:se,getElementRects:Qe,getClientRects:Ie,getDimensions:Ge,getScale:ot,isElement:E,isRTL:Ze};function re(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function tn(t,e){let n=null,o,i=N(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();let a=t.getBoundingClientRect(),{left:d,top:u,width:m,height:f}=a;if(c||e(),!m||!f)return;let g=ct(u),h=ct(i.clientWidth-(d+m)),p=ct(i.clientHeight-(u+f)),w=ct(d),y={rootMargin:-g+"px "+-h+"px "+-p+"px "+-w+"px",threshold:V(0,j(1,l))||1},b=!0;function v(R){let O=R[0].intersectionRatio;if(O!==l){if(!b)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!re(a,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(v,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,y)}n.observe(t)}return s(!0),r}function ce(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Pt(t),d=i||r?[...a?tt(a):[],...tt(e)]:[];d.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});let u=a&&c?tn(a,n):null,m=-1,f=null;s&&(f=new ResizeObserver(w=>{let[x]=w;x&&x.target===a&&f&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(e)})),n()}),a&&!l&&f.observe(a),f.observe(e));let g,h=l?Q(t):null;l&&p();function p(){let w=Q(t);h&&!re(h,w)&&n(),h=w,g=requestAnimationFrame(p)}return n(),()=>{var w;d.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),u?.(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(g)}}var le=jt,ae=zt,fe=Xt,Ct=It;var ue=Ut,de=_t;var me=(t,e,n)=>{let o=new Map,i={platform:xt,...n},r={...i.platform,_c:o};return Vt(t,e,{...i,platform:r})};function ge(t){return en(t)}function Et(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function en(t){for(let e=t;e;e=Et(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=Et(t);e;e=Et(e)){if(!(e instanceof Element))continue;let n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||nt(n)||e.tagName==="BODY"))return e}return null}(function(){if(!!1){let e=xt.getOffsetParent;xt.getOffsetParent=n=>e(n,ge)}})();function he(t){let e=window.devicePixelRatio||1;return Math.round(t*e)/e}var ye=(async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:r,flipPlacements:s,offsetDistance:c,offsetSkidding:l,arrowEl:a,type:d})=>{if(!e||!n)return;let u=Lt(n)==="rtl",{x:m,y:f,placement:g,strategy:h,middlewareData:p}=await me(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:pe(i,u),middleware:on({placement:i,flipDisabled:r,flipPlacements:s?.map(b=>pe(b,u)),offsetDistance:c,offsetSkidding:l,arrowEl:a,type:d})});if(a&&p.arrow){let{x:b,y:v}=p.arrow,R=g.split("-")[0],O=b!=null?"left":"top",I=cn[R],C={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=R==="left"||R==="right"?"horizontal":"vertical"),Object.assign(a.style,{...C,[O]:`${O=="left"?b:v}px`,[R]:"100%",transform:I})}let x=p.hide?.referenceHidden?"hidden":null,y=x?"none":null;n.setAttribute(nn,g),Object.assign(n.style,{pointerEvents:y,position:h,transform:`translate(${he(m)}px,${he(f)}px)`,visibility:x})}),nn="data-placement",ve=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],Ln="bottom-start",Dn="bottom-end",Fn={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function on({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:r,type:s}){let c=[fe(),ue()];return s==="menu"&&c.push(Ct({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})),c.push(le({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})),t==="auto"||t==="auto-start"||t==="auto-end"?c.push(ae({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(Ct(n?{fallbackPlacements:n}:{})),r&&c.push(de({element:r})),c}function sn(t){return ve.includes(t)}function Mn(t,e){let n=t.filter(sn);return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${ve.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function pe(t,e=!1){let n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function kn(t,e,n=!1){if(!t.open||!e.floatingEl||!e.referenceEl)return;if(Object.assign(e.floatingEl.style,{display:"block",position:e.overlayPositioning??"absolute"}),!ft.get(t))return be(t);await(n?rn(t):ye)(t,e)}function rn(t){let e=yt.get(t);return e||(e=Dt(ye,Tt.reposition,{edges:["leading","trailing"]}),yt.set(t,e),e)}var cn={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},ft=new WeakMap,yt=new WeakMap;async function be(t){let{referenceEl:e,floatingEl:n}=t;if(!n.isConnected)return;let o=ce;ft.set(t,{state:"pending"});let i,r=o(e,n,()=>{let s=t.reposition();i||(i=s)});return ft.set(t,{state:"active",cleanUp:r}),i}function ln(t){let{floatingEl:e}=t;e&&Object.assign(e.style,{display:"",pointerEvents:"",position:"",transform:"",visibility:""})}async function Nn(t){let{floatingEl:e,referenceEl:n}=t;if(ln(t),!(!e||!n)&&(an(t),!!t.open))return be(t)}function an(t){let e=ft.get(t);e?.state==="active"&&e.cleanUp(),ft.delete(t),yt.get(t)?.cancel(),yt.delete(t)}var we=4,Bn=Math.ceil(Math.hypot(we,we));export{Ln as a,Dn as b,Fn as c,Mn as d,kn as e,ln as f,Nn as g,an as h,Bn as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as x,b as f}from"./PRB44CR7.js";import{a as k}from"./2DX2SAQ7.js";import{a as g}from"./PNBL2IVW.js";import{a as b}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import{a as l}from"./TLLHA7VC.js";import"./VZVYZPXQ.js";import{l as u,t as m}from"./Z6CRZOOK.js";import"./XRJOD24G.js";import{B as r,C as o,D as d,E as i,P as v,g as h,h as t,o as a}from"./CSQVLDPF.js";var c={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",single:"single",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle",selected:"selected"},C={image:"image"},n={close:"x",checkedSingle:"circle-f",uncheckedMultiple:"square",checkedMultiple:"check-square-f"},I=h`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;cursor:default;border-radius:var(--calcite-chip-corner-radius, 9999px)}:host([closed]){display:none}:host([appearance=outline]) .container,:host([appearance=outline-fill]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([appearance=outline]) .close,:host([appearance=outline-fill]) .close{color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, var(--calcite-color-text-3)))}:host([appearance=outline]):host([kind=brand]),:host([appearance=outline-fill]):host([kind=brand]){--calcite-internal-chip-border-color: var(--calcite-chip-border-color, var(--calcite-color-brand));--calcite-internal-chip-selectable-hover-border-color: var(--calcite-chip-border-color, var(--calcite-color-brand));--calcite-internal-chip-selectable-active-border-color: var( --calcite-chip-border-color, var(--calcite-color-brand) )}:host([appearance=outline]):host([kind=inverse]),:host([appearance=outline-fill]):host([kind=inverse]){--calcite-internal-chip-border-color: var(--calcite-chip-border-color, var(--calcite-color-border-inverse))}:host([appearance=outline]):host([kind=neutral]),:host([appearance=outline-fill]):host([kind=neutral]){--calcite-internal-chip-border-color: var(--calcite-chip-border-color, var(--calcite-color-border-1))}:host([appearance=outline]){--calcite-internal-chip-background-color: transparent}:host([appearance=outline-fill]){--calcite-internal-chip-background-color: var(--calcite-chip-background-color, var(--calcite-color-foreground-1))}:host([appearance=solid]){--calcite-internal-chip-border-color: transparent;--calcite-internal-chip-selectable-hover-border-color: transparent;--calcite-internal-chip-selectable-active-border-color: transparent}:host([appearance=solid]):host([kind=brand]) .container,:host([appearance=solid]):host([kind=inverse]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-inverse))}:host([appearance=solid]):host([kind=brand]) .close,:host([appearance=solid]):host([kind=inverse]) .close{outline-color:var(--calcite-color-text-inverse)}:host([appearance=solid]):host([kind=brand]){--calcite-internal-chip-background-color: var(--calcite-chip-background-color, var(--calcite-color-brand))}:host([appearance=solid]):host([kind=inverse]){--calcite-internal-chip-background-color: var(--calcite-chip-background-color, var(--calcite-color-inverse))}:host([appearance=solid]):host([kind=inverse]) .close:hover{background-color:var(--calcite-color-inverse-hover)}:host([appearance=solid]):host([kind=inverse]) .close:active{background-color:var(--calcite-color-inverse-press)}:host([appearance=solid]):host([kind=neutral]){--calcite-internal-chip-background-color: var(--calcite-chip-background-color, var(--calcite-color-foreground-2))}:host([kind=neutral]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([kind=neutral]) .close{color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, var(--calcite-color-text-3)))}:host([selected]) .select-icon{opacity:1}:host([appearance=solid]):host([kind=neutral]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-foreground-3);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-border-2)}:host([appearance=solid]):host([kind=inverse]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-inverse-hover);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-inverse-press)}:host([appearance=solid]):host([kind=brand]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-brand-hover);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-brand-press)}:host([appearance=outline-fill]):host([kind=neutral]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-foreground-2);--calcite-internal-chip-selectable-hover-border-color: var(--calcite-color-border-input);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-foreground-3);--calcite-internal-chip-selectable-active-border-color: var(--calcite-color-text-3)}:host([appearance=outline-fill]):host([kind=inverse]),:host([appearance=outline-fill]):host([kind=brand]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-foreground-2);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-foreground-3)}:host([appearance=outline]):host([kind=neutral]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-transparent-hover);--calcite-internal-chip-selectable-hover-border-color: var(--calcite-color-border-input);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-transparent-press);--calcite-internal-chip-selectable-active-border-color: var(--calcite-color-text-3)}:host([appearance=outline]):host([kind=inverse]),:host([appearance=outline]):host([kind=brand]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-transparent-hover);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-transparent-press)}:host([scale=s]) .container{--calcite-internal-chip-block-size: var(--calcite-size-sm, 1.5rem) ;--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-font-size: var(--calcite-font-size--2);--calcite-internal-chip-icon-size: var(--calcite-size-xs, 1rem) ;--calcite-internal-chip-icon-space: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-image-size: var(--calcite-spacing-xl, 1.25rem) ;--calcite-internal-chip-title-space: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-close-size: var(--calcite-size-xs, 1rem) }:host([scale=s]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-px)}:host([scale=s]) .container.image--slotted:has(.chip-icon),:host([scale=s]) .container.image--slotted.text--slotted,:host([scale=s]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end: var(--calcite-spacing-xxs, .25rem) }:host([scale=s]) .container.image--slotted:not(.text--slotted,:has(.chip-icon)),:host([scale=s]) .container.image--slotted:not(.selectable){--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-none, 0)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end: .5rem ;--calcite-internal-chip-select-space-x-start: .125rem }:host([scale=s]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=s]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end: .5rem ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px)}:host([scale=s]) .container.multiple:not(.is-circle).image--slotted:not(.text--slotted){--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xs, .375rem) }:host([scale=m]) .container{--calcite-internal-chip-block-size: var(--calcite-size-md, 2rem) ;--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-font-size: var(--calcite-font-size--1);--calcite-internal-chip-icon-size: var(--calcite-size-sm, 1.5rem) ;--calcite-internal-chip-icon-space: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-image-size: var(--calcite-size-sm, 1.5rem) ;--calcite-internal-chip-title-space: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-close-size: var(--calcite-size-sm, 1.5rem) }:host([scale=m]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px)}:host([scale=m]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=m]) .container.image--slotted:has(.chip-icon),:host([scale=m]) .container.image--slotted.text--slotted,:host([scale=m]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end: var(--calcite-spacing-xs, .375rem) }:host([scale=m]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=m]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-px);--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-none, 0)}:host([scale=m]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xs, .375rem) }:host([scale=m]) .container.multiple:not(.is-circle){--calcite-internal-chip-select-space-x-end: .125rem ;--calcite-internal-chip-select-space-x-start: .125rem }:host([scale=m]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end: .5rem ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=m]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xxs, .25rem) }:host([scale=l]) .container{--calcite-internal-chip-block-size: 2.75rem ;--calcite-internal-chip-container-space-x-end: .5rem ;--calcite-internal-chip-container-space-x-start: .5rem ;--calcite-internal-chip-font-size: var(--calcite-font-size-0);--calcite-internal-chip-icon-size: var(--calcite-size-md, 2rem) ;--calcite-internal-chip-icon-space: .5rem ;--calcite-internal-chip-image-size: var(--calcite-size-md, 2rem) ;--calcite-internal-chip-title-space: .5rem ;--calcite-internal-close-size: var(--calcite-size-md, 2rem) }:host([scale=l]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=l]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xs, .375rem) }:host([scale=l]) .container.image--slotted:has(.chip-icon),:host([scale=l]) .container.image--slotted.text--slotted,:host([scale=l]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end: .5rem }:host([scale=l]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xs, .375rem) }:host([scale=l]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-none, 0)}:host([scale=l]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-select-space-x-start: .5rem }:host([scale=l]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start: .5rem ;--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=l]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end: .75rem }:host([scale=l]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xs, .375rem) }.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;background-color:var(--calcite-internal-chip-background-color);border-color:var(--calcite-internal-chip-border-color);border-radius:var(--calcite-chip-corner-radius, 9999px);border-width:var(--calcite-border-width-sm);border-style:solid;font-size:var(--calcite-internal-chip-font-size, var(--calcite-font-size));padding-inline-start:var(--calcite-internal-chip-container-space-x-start);padding-inline-end:var(--calcite-internal-chip-container-space-x-end);block-size:var(--calcite-internal-chip-block-size, auto);inline-size:var(--calcite-internal-chip-inline-size, auto);min-inline-size:var(--calcite-internal-chip-block-size, auto)}.container:hover .select-icon--active{opacity:var(--calcite-opacity-full, 1)}.container.selectable{cursor:pointer}.container.selectable:hover{background-color:var(--calcite-internal-chip-selectable-hover-background-color);border-color:var(--calcite-internal-chip-selectable-hover-border-color)}.container.selectable:active{background-color:var(--calcite-internal-chip-selectable-active-background-color);border-color:var(--calcite-internal-chip-selectable-active-border-color)}.container:not(.non-interactive):focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(var(--calcite-spacing-base) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.container.text--slotted .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.container:not(.text--slotted) .title,.container:not(.image--slotted) .image-container{display:none}.container.is-circle .chip-icon,.container.is-circle .image-container{padding:var(--calcite-spacing-none, 0)}.title{padding-inline:var(--calcite-internal-chip-title-space)}.image-container{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;pointer-events:none;block-size:var(--calcite-internal-chip-image-size, var(--calcite-spacing-xxl, 1.5rem));inline-size:var(--calcite-internal-chip-image-size, var(--calcite-spacing-xxl, 1.5rem));padding-inline-start:var(--calcite-spacing-none, 0);padding-inline-end:var(--calcite-internal-chip-image-space-x-end, 0)}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-timing-function:cubic-bezier(.4,0,.2,1);color:var(--calcite-chip-icon-color, var(--calcite-chip-text-color, var(--calcite-icon-color, currentColor)));padding-inline:var(--calcite-internal-chip-icon-space, var(--calcite-spacing-xs, .375rem))}.select-icon{align-self:center;justify-content:center;align-items:center;display:flex;inset-block-start:-1px;position:absolute;visibility:hidden;inline-size:auto;opacity:0;transition:opacity .15s ease-in-out,inline-size .15s ease-in-out;color:var(--calcite-chip-select-icon-color, currentColor)}.select-icon.select-icon--active{position:relative;visibility:visible;opacity:var(--calcite-opacity-half, .5);color:var(--calcite-chip-select-icon-color-press, var(--calcite-chip-select-icon-color-pressed, var(--calcite-chip-select-icon-color, currentColor)))}.multiple .select-icon{display:flex;align-items:center;justify-content:center}.multiple .select-icon,.single .select-icon--active{padding-inline-start:var(--calcite-internal-chip-select-space-x-start);padding-inline-end:var(--calcite-internal-chip-select-space-x-end);block-size:var(--calcite-internal-chip-icon-size, var(--calcite-spacing-xxl, 1.5rem));inline-size:var(--calcite-internal-chip-icon-size, var(--calcite-spacing-xxl, 1.5rem))}slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}.close{margin:0;cursor:pointer;align-items:center;border-radius:50%;border-style:none;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;outline-color:transparent;background-color:var(--calcite-close-background-color, var(--calcite-color-transparent));-webkit-appearance:none;display:flex;align-content:center;justify-content:center;color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, currentColor));block-size:var(--calcite-internal-close-size, var(--calcite-spacing-xxl, 1.5rem));inline-size:var(--calcite-internal-close-size, var(--calcite-spacing-xxl, 1.5rem));padding:0}.close:hover,.close:focus{background-color:var(--calcite-close-background-color-hover, var(--calcite-color-transparent-hover))}.close:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.close:active{background-color:var(--calcite-close-background-color-press, var(--calcite-color-transparent-press))}.close calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,s=class extends d{constructor(){super(),this.closeButtonRef=r(),this.containerRef=r(),this.messages=g(),this.focusSetter=b()(this),this.hasImage=!1,this.hasText=!1,this.appearance="solid",this.closable=!1,this.closed=!1,this.closeOnDelete=!1,this.disabled=!1,this.iconFlipRtl=!1,this.interactive=!1,this.kind="neutral",this.scale="m",this.selected=!1,this.selectionMode="none",this.calciteChipClose=a({cancelable:!1}),this.calciteChipSelect=a({cancelable:!1}),this.calciteInternalChipKeyEvent=a({cancelable:!1}),this.calciteInternalChipSelect=a({cancelable:!1}),this.calciteInternalSyncSelectedChips=a({cancelable:!1}),this.listen("keydown",this.keyDownHandler),this.listen("click",this.clickHandler)}static{this.properties={hasImage:[16,{},{state:!0}],hasText:[16,{},{state:!0}],appearance:[3,{},{reflect:!0}],closable:[7,{},{reflect:!0,type:Boolean}],closed:[7,{},{reflect:!0,type:Boolean}],closeOnDelete:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],icon:[3,{type:String},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],interactive:[5,{},{type:Boolean}],kind:[3,{},{reflect:!0}],label:1,messageOverrides:[0,{},{attribute:!1}],parentChipGroup:[0,{},{attribute:!1}],scale:[3,{},{reflect:!0}],selected:[7,{},{reflect:!0,type:Boolean}],selectionMode:1,value:1}}static{this.styles=I}async setFocus(e){return this.focusSetter(()=>{if(this.interactive)return this.containerRef.value;if(this.closable)return this.closeButtonRef.value},e)}async load(){this.updateHasText()}willUpdate(e){e.has("selected")&&this.hasUpdated&&this.watchSelected(this.selected)}updated(){x(this)}loaded(){this.selectionMode!=="none"&&this.interactive&&this.selected&&this.handleSelectionPropertyChange(this.selected)}watchSelected(e){this.selectionMode!=="none"&&this.handleSelectionPropertyChange(e)}keyDownHandler(e){if(e.target===this.el)switch(e.key){case" ":case"Enter":this.handleEmittingEvent(),e.preventDefault();break;case"Backspace":case"Delete":this.closable&&!this.closed&&this.closeOnDelete&&(e.preventDefault(),this.close());break;case"ArrowRight":case"ArrowLeft":case"Home":case"End":this.calciteInternalChipKeyEvent.emit(e),e.preventDefault();break}}clickHandler(){!this.interactive&&this.closable&&u(this.closeButtonRef.value)}handleDefaultSlotChange(){this.updateHasText()}close(){this.calciteChipClose.emit(),this.selected=!1,this.closed=!0}closeButtonKeyDownHandler(e){k(e.key)&&(e.preventDefault(),this.close())}updateHasText(){this.hasText=this.el.textContent.trim().length>0}handleSlotImageChange(e){this.hasImage=m(e)}handleEmittingEvent(){this.interactive&&this.calciteChipSelect.emit()}handleSelectionPropertyChange(e){this.selectionMode==="single"&&this.calciteInternalSyncSelectedChips.emit(),!this.parentChipGroup.selectedItems.includes(this.el)&&e&&this.selectionMode!=="multiple"&&this.calciteInternalChipSelect.emit(),this.selectionMode!=="single"&&this.calciteInternalSyncSelectedChips.emit()}renderChipImage(){return t`<div class=${i(c.imageContainer)}><slot name=${C.image} @slotchange=${this.handleSlotImageChange}></slot></div>`}renderSelectionIcon(){let e=this.selectionMode==="multiple"?this.selected?n.checkedMultiple:n.uncheckedMultiple:this.selected?n.checkedSingle:void 0;return t`<div class=${i({[c.selectIcon]:!0,[c.selectIconActive]:this.selectionMode==="multiple"||this.selected})}>${e?t`<calcite-icon .icon=${e} .scale=${l(this.scale)}></calcite-icon>`:null}</div>`}renderCloseButton(){return t`<button .ariaLabel=${this.messages.dismissLabel} class=${i(c.close)} @click=${this.close} @keydown=${this.closeButtonKeyDownHandler} .tabIndex=${this.disabled?-1:0} ${o(this.closeButtonRef)}><calcite-icon .icon=${n.close} .scale=${l(this.scale)}></calcite-icon></button>`}renderIcon(){return t`<calcite-icon class=${i(c.chipIcon)} .flipRtl=${this.iconFlipRtl} .icon=${this.icon} .scale=${l(this.scale)}></calcite-icon>`}render(){let{disabled:e}=this,p=e||!e&&!this.interactive,y=this.selectionMode==="multiple"&&this.interactive?"checkbox":this.selectionMode!=="none"&&this.interactive?"radio":this.interactive?"button":"img";return f({disabled:e,children:t`<div .ariaChecked=${this.selectionMode!=="none"&&this.interactive?this.selected:void 0} .ariaLabel=${this.label} class=${i({[c.container]:!0,[c.textSlotted]:this.hasText,[c.imageSlotted]:this.hasImage,[c.selectable]:this.selectionMode!=="none",[c.multiple]:this.selectionMode==="multiple",[c.single]:this.selectionMode==="single"||this.selectionMode==="single-persist",[c.selected]:this.selected,[c.closable]:this.closable,[c.nonInteractive]:!this.interactive,[c.isCircle]:!this.closable&&!this.hasText&&(!this.icon||!this.hasImage)&&(this.selectionMode==="none"||!!this.selectionMode&&this.selectionMode!=="multiple"&&!this.selected)})} @click=${this.handleEmittingEvent} .role=${y} .tabIndex=${p?-1:0} ${o(this.containerRef)}>${this.selectionMode!=="none"&&this.renderSelectionIcon()||""}${this.renderChipImage()}${this.icon&&this.renderIcon()||""}<span class=${i(c.title)}><slot @slotchange=${this.handleDefaultSlotChange}></slot></span>${this.closable&&this.renderCloseButton()||""}</div>`})}};v("calcite-chip",s);export{s as Chip};
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as x,b as f}from"./NSBK36H4.js";import{a as k}from"./S5CLKCGJ.js";import{a as g}from"./LH7245HX.js";import{a as b}from"./WOTQIMPZ.js";import"./B5JXPZDV.js";import{a as l}from"./3YZG7MA3.js";import"./CIU4VM7X.js";import{l as u,t as m}from"./5IPJANUU.js";import"./ZLR2B6GQ.js";import{B as r,C as o,D as d,E as i,P as v,g as h,h as t,o as a}from"./AUIOWPFN.js";var c={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",single:"single",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle",selected:"selected"},C={image:"image"},n={close:"x",checkedSingle:"circle-f",uncheckedMultiple:"square",checkedMultiple:"check-square-f"},I=h`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;cursor:default;border-radius:var(--calcite-chip-corner-radius, 9999px)}:host([closed]){display:none}:host([appearance=outline]) .container,:host([appearance=outline-fill]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([appearance=outline]) .close,:host([appearance=outline-fill]) .close{color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, var(--calcite-color-text-3)))}:host([appearance=outline]):host([kind=brand]),:host([appearance=outline-fill]):host([kind=brand]){--calcite-internal-chip-border-color: var(--calcite-chip-border-color, var(--calcite-color-brand));--calcite-internal-chip-selectable-hover-border-color: var(--calcite-chip-border-color, var(--calcite-color-brand));--calcite-internal-chip-selectable-active-border-color: var( --calcite-chip-border-color, var(--calcite-color-brand) )}:host([appearance=outline]):host([kind=inverse]),:host([appearance=outline-fill]):host([kind=inverse]){--calcite-internal-chip-border-color: var(--calcite-chip-border-color, var(--calcite-color-border-inverse))}:host([appearance=outline]):host([kind=neutral]),:host([appearance=outline-fill]):host([kind=neutral]){--calcite-internal-chip-border-color: var(--calcite-chip-border-color, var(--calcite-color-border-1))}:host([appearance=outline]){--calcite-internal-chip-background-color: transparent}:host([appearance=outline-fill]){--calcite-internal-chip-background-color: var(--calcite-chip-background-color, var(--calcite-color-foreground-1))}:host([appearance=solid]){--calcite-internal-chip-border-color: transparent;--calcite-internal-chip-selectable-hover-border-color: transparent;--calcite-internal-chip-selectable-active-border-color: transparent}:host([appearance=solid]):host([kind=brand]) .container,:host([appearance=solid]):host([kind=inverse]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-inverse))}:host([appearance=solid]):host([kind=brand]) .close,:host([appearance=solid]):host([kind=inverse]) .close{outline-color:var(--calcite-color-text-inverse)}:host([appearance=solid]):host([kind=brand]){--calcite-internal-chip-background-color: var(--calcite-chip-background-color, var(--calcite-color-brand))}:host([appearance=solid]):host([kind=inverse]){--calcite-internal-chip-background-color: var(--calcite-chip-background-color, var(--calcite-color-inverse))}:host([appearance=solid]):host([kind=inverse]) .close:hover{background-color:var(--calcite-color-inverse-hover)}:host([appearance=solid]):host([kind=inverse]) .close:active{background-color:var(--calcite-color-inverse-press)}:host([appearance=solid]):host([kind=neutral]){--calcite-internal-chip-background-color: var(--calcite-chip-background-color, var(--calcite-color-foreground-2))}:host([kind=neutral]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([kind=neutral]) .close{color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, var(--calcite-color-text-3)))}:host([selected]) .select-icon{opacity:1}:host([appearance=solid]):host([kind=neutral]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-foreground-3);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-border-2)}:host([appearance=solid]):host([kind=inverse]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-inverse-hover);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-inverse-press)}:host([appearance=solid]):host([kind=brand]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-brand-hover);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-brand-press)}:host([appearance=outline-fill]):host([kind=neutral]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-foreground-2);--calcite-internal-chip-selectable-hover-border-color: var(--calcite-color-border-input);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-foreground-3);--calcite-internal-chip-selectable-active-border-color: var(--calcite-color-text-3)}:host([appearance=outline-fill]):host([kind=inverse]),:host([appearance=outline-fill]):host([kind=brand]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-foreground-2);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-foreground-3)}:host([appearance=outline]):host([kind=neutral]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-transparent-hover);--calcite-internal-chip-selectable-hover-border-color: var(--calcite-color-border-input);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-transparent-press);--calcite-internal-chip-selectable-active-border-color: var(--calcite-color-text-3)}:host([appearance=outline]):host([kind=inverse]),:host([appearance=outline]):host([kind=brand]){--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-transparent-hover);--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-transparent-press)}:host([scale=s]) .container{--calcite-internal-chip-block-size: var(--calcite-size-sm, 1.5rem) ;--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-font-size: var(--calcite-font-size--2);--calcite-internal-chip-icon-size: var(--calcite-size-xs, 1rem) ;--calcite-internal-chip-icon-space: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-image-size: var(--calcite-spacing-xl, 1.25rem) ;--calcite-internal-chip-title-space: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-close-size: var(--calcite-size-xs, 1rem) }:host([scale=s]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-px)}:host([scale=s]) .container.image--slotted:has(.chip-icon),:host([scale=s]) .container.image--slotted.text--slotted,:host([scale=s]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end: var(--calcite-spacing-xxs, .25rem) }:host([scale=s]) .container.image--slotted:not(.text--slotted,:has(.chip-icon)),:host([scale=s]) .container.image--slotted:not(.selectable){--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-none, 0)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end: .5rem ;--calcite-internal-chip-select-space-x-start: .125rem }:host([scale=s]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=s]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end: .5rem ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px)}:host([scale=s]) .container.multiple:not(.is-circle).image--slotted:not(.text--slotted){--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xs, .375rem) }:host([scale=m]) .container{--calcite-internal-chip-block-size: var(--calcite-size-md, 2rem) ;--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-font-size: var(--calcite-font-size--1);--calcite-internal-chip-icon-size: var(--calcite-size-sm, 1.5rem) ;--calcite-internal-chip-icon-space: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-image-size: var(--calcite-size-sm, 1.5rem) ;--calcite-internal-chip-title-space: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-close-size: var(--calcite-size-sm, 1.5rem) }:host([scale=m]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-px)}:host([scale=m]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=m]) .container.image--slotted:has(.chip-icon),:host([scale=m]) .container.image--slotted.text--slotted,:host([scale=m]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end: var(--calcite-spacing-xs, .375rem) }:host([scale=m]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=m]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-px);--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-none, 0)}:host([scale=m]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xs, .375rem) }:host([scale=m]) .container.multiple:not(.is-circle){--calcite-internal-chip-select-space-x-end: .125rem ;--calcite-internal-chip-select-space-x-start: .125rem }:host([scale=m]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end: .5rem ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=m]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xxs, .25rem) }:host([scale=l]) .container{--calcite-internal-chip-block-size: 2.75rem ;--calcite-internal-chip-container-space-x-end: .5rem ;--calcite-internal-chip-container-space-x-start: .5rem ;--calcite-internal-chip-font-size: var(--calcite-font-size-0);--calcite-internal-chip-icon-size: var(--calcite-size-md, 2rem) ;--calcite-internal-chip-icon-space: .5rem ;--calcite-internal-chip-image-size: var(--calcite-size-md, 2rem) ;--calcite-internal-chip-title-space: .5rem ;--calcite-internal-close-size: var(--calcite-size-md, 2rem) }:host([scale=l]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=l]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xs, .375rem) }:host([scale=l]) .container.image--slotted:has(.chip-icon),:host([scale=l]) .container.image--slotted.text--slotted,:host([scale=l]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end: .5rem }:host([scale=l]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start: var(--calcite-spacing-xs, .375rem) }:host([scale=l]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-none, 0)}:host([scale=l]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xs, .375rem) ;--calcite-internal-chip-select-space-x-start: .5rem }:host([scale=l]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start: .5rem ;--calcite-internal-chip-select-space-x-end: var(--calcite-spacing-xxs, .25rem) ;--calcite-internal-chip-select-space-x-start: var(--calcite-spacing-xxs, .25rem) }:host([scale=l]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end: .75rem }:host([scale=l]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end: var(--calcite-spacing-xs, .375rem) }.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;background-color:var(--calcite-internal-chip-background-color);border-color:var(--calcite-internal-chip-border-color);border-radius:var(--calcite-chip-corner-radius, 9999px);border-width:var(--calcite-border-width-sm);border-style:solid;font-size:var(--calcite-internal-chip-font-size, var(--calcite-font-size));padding-inline-start:var(--calcite-internal-chip-container-space-x-start);padding-inline-end:var(--calcite-internal-chip-container-space-x-end);block-size:var(--calcite-internal-chip-block-size, auto);inline-size:var(--calcite-internal-chip-inline-size, auto);min-inline-size:var(--calcite-internal-chip-block-size, auto)}.container:hover .select-icon--active{opacity:var(--calcite-opacity-full, 1)}.container.selectable{cursor:pointer}.container.selectable:hover{background-color:var(--calcite-internal-chip-selectable-hover-background-color);border-color:var(--calcite-internal-chip-selectable-hover-border-color)}.container.selectable:active{background-color:var(--calcite-internal-chip-selectable-active-background-color);border-color:var(--calcite-internal-chip-selectable-active-border-color)}.container:not(.non-interactive):focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(var(--calcite-spacing-base) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.container.text--slotted .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.container:not(.text--slotted) .title,.container:not(.image--slotted) .image-container{display:none}.container.is-circle .chip-icon,.container.is-circle .image-container{padding:var(--calcite-spacing-none, 0)}.title{padding-inline:var(--calcite-internal-chip-title-space)}.image-container{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;pointer-events:none;block-size:var(--calcite-internal-chip-image-size, var(--calcite-spacing-xxl, 1.5rem));inline-size:var(--calcite-internal-chip-image-size, var(--calcite-spacing-xxl, 1.5rem));padding-inline-start:var(--calcite-spacing-none, 0);padding-inline-end:var(--calcite-internal-chip-image-space-x-end, 0)}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-timing-function:cubic-bezier(.4,0,.2,1);color:var(--calcite-chip-icon-color, var(--calcite-chip-text-color, var(--calcite-icon-color, currentColor)));padding-inline:var(--calcite-internal-chip-icon-space, var(--calcite-spacing-xs, .375rem))}.select-icon{align-self:center;justify-content:center;align-items:center;display:flex;inset-block-start:-1px;position:absolute;visibility:hidden;inline-size:auto;opacity:0;transition:opacity .15s ease-in-out,inline-size .15s ease-in-out;color:var(--calcite-chip-select-icon-color, currentColor)}.select-icon.select-icon--active{position:relative;visibility:visible;opacity:var(--calcite-opacity-half, .5);color:var(--calcite-chip-select-icon-color-press, var(--calcite-chip-select-icon-color-pressed, var(--calcite-chip-select-icon-color, currentColor)))}.multiple .select-icon{display:flex;align-items:center;justify-content:center}.multiple .select-icon,.single .select-icon--active{padding-inline-start:var(--calcite-internal-chip-select-space-x-start);padding-inline-end:var(--calcite-internal-chip-select-space-x-end);block-size:var(--calcite-internal-chip-icon-size, var(--calcite-spacing-xxl, 1.5rem));inline-size:var(--calcite-internal-chip-icon-size, var(--calcite-spacing-xxl, 1.5rem))}slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}.close{margin:0;cursor:pointer;align-items:center;border-radius:50%;border-style:none;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;outline-color:transparent;background-color:var(--calcite-close-background-color, var(--calcite-color-transparent));-webkit-appearance:none;display:flex;align-content:center;justify-content:center;color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, currentColor));block-size:var(--calcite-internal-close-size, var(--calcite-spacing-xxl, 1.5rem));inline-size:var(--calcite-internal-close-size, var(--calcite-spacing-xxl, 1.5rem));padding:0}.close:hover,.close:focus{background-color:var(--calcite-close-background-color-hover, var(--calcite-color-transparent-hover))}.close:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.close:active{background-color:var(--calcite-close-background-color-press, var(--calcite-color-transparent-press))}.close calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,s=class extends d{constructor(){super(),this.closeButtonRef=r(),this.containerRef=r(),this.messages=g(),this.focusSetter=b()(this),this.hasImage=!1,this.hasText=!1,this.appearance="solid",this.closable=!1,this.closed=!1,this.closeOnDelete=!1,this.disabled=!1,this.iconFlipRtl=!1,this.interactive=!1,this.kind="neutral",this.scale="m",this.selected=!1,this.selectionMode="none",this.calciteChipClose=a({cancelable:!1}),this.calciteChipSelect=a({cancelable:!1}),this.calciteInternalChipKeyEvent=a({cancelable:!1}),this.calciteInternalChipSelect=a({cancelable:!1}),this.calciteInternalSyncSelectedChips=a({cancelable:!1}),this.listen("keydown",this.keyDownHandler),this.listen("click",this.clickHandler)}static{this.properties={hasImage:[16,{},{state:!0}],hasText:[16,{},{state:!0}],appearance:[3,{},{reflect:!0}],closable:[7,{},{reflect:!0,type:Boolean}],closed:[7,{},{reflect:!0,type:Boolean}],closeOnDelete:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],icon:[3,{type:String},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],interactive:[5,{},{type:Boolean}],kind:[3,{},{reflect:!0}],label:1,messageOverrides:[0,{},{attribute:!1}],parentChipGroup:[0,{},{attribute:!1}],scale:[3,{},{reflect:!0}],selected:[7,{},{reflect:!0,type:Boolean}],selectionMode:1,value:1}}static{this.styles=I}async setFocus(e){return this.focusSetter(()=>{if(this.interactive)return this.containerRef.value;if(this.closable)return this.closeButtonRef.value},e)}async load(){this.updateHasText()}willUpdate(e){e.has("selected")&&this.hasUpdated&&this.watchSelected(this.selected)}updated(){x(this)}loaded(){this.selectionMode!=="none"&&this.interactive&&this.selected&&this.handleSelectionPropertyChange(this.selected)}watchSelected(e){this.selectionMode!=="none"&&this.handleSelectionPropertyChange(e)}keyDownHandler(e){if(e.target===this.el)switch(e.key){case" ":case"Enter":this.handleEmittingEvent(),e.preventDefault();break;case"Backspace":case"Delete":this.closable&&!this.closed&&this.closeOnDelete&&(e.preventDefault(),this.close());break;case"ArrowRight":case"ArrowLeft":case"Home":case"End":this.calciteInternalChipKeyEvent.emit(e),e.preventDefault();break}}clickHandler(){!this.interactive&&this.closable&&u(this.closeButtonRef.value)}handleDefaultSlotChange(){this.updateHasText()}close(){this.calciteChipClose.emit(),this.selected=!1,this.closed=!0}closeButtonKeyDownHandler(e){k(e.key)&&(e.preventDefault(),this.close())}updateHasText(){this.hasText=this.el.textContent.trim().length>0}handleSlotImageChange(e){this.hasImage=m(e)}handleEmittingEvent(){this.interactive&&this.calciteChipSelect.emit()}handleSelectionPropertyChange(e){this.selectionMode==="single"&&this.calciteInternalSyncSelectedChips.emit(),!this.parentChipGroup.selectedItems.includes(this.el)&&e&&this.selectionMode!=="multiple"&&this.calciteInternalChipSelect.emit(),this.selectionMode!=="single"&&this.calciteInternalSyncSelectedChips.emit()}renderChipImage(){return t`<div class=${i(c.imageContainer)}><slot name=${C.image} @slotchange=${this.handleSlotImageChange}></slot></div>`}renderSelectionIcon(){let e=this.selectionMode==="multiple"?this.selected?n.checkedMultiple:n.uncheckedMultiple:this.selected?n.checkedSingle:void 0;return t`<div class=${i({[c.selectIcon]:!0,[c.selectIconActive]:this.selectionMode==="multiple"||this.selected})}>${e?t`<calcite-icon .icon=${e} .scale=${l(this.scale)}></calcite-icon>`:null}</div>`}renderCloseButton(){return t`<button .ariaLabel=${this.messages.dismissLabel} class=${i(c.close)} @click=${this.close} @keydown=${this.closeButtonKeyDownHandler} .tabIndex=${this.disabled?-1:0} ${o(this.closeButtonRef)}><calcite-icon .icon=${n.close} .scale=${l(this.scale)}></calcite-icon></button>`}renderIcon(){return t`<calcite-icon class=${i(c.chipIcon)} .flipRtl=${this.iconFlipRtl} .icon=${this.icon} .scale=${l(this.scale)}></calcite-icon>`}render(){let{disabled:e}=this,p=e||!e&&!this.interactive,y=this.selectionMode==="multiple"&&this.interactive?"checkbox":this.selectionMode!=="none"&&this.interactive?"radio":this.interactive?"button":"img";return f({disabled:e,children:t`<div .ariaChecked=${this.selectionMode!=="none"&&this.interactive?this.selected:void 0} .ariaLabel=${this.label} class=${i({[c.container]:!0,[c.textSlotted]:this.hasText,[c.imageSlotted]:this.hasImage,[c.selectable]:this.selectionMode!=="none",[c.multiple]:this.selectionMode==="multiple",[c.single]:this.selectionMode==="single"||this.selectionMode==="single-persist",[c.selected]:this.selected,[c.closable]:this.closable,[c.nonInteractive]:!this.interactive,[c.isCircle]:!this.closable&&!this.hasText&&(!this.icon||!this.hasImage)&&(this.selectionMode==="none"||!!this.selectionMode&&this.selectionMode!=="multiple"&&!this.selected)})} @click=${this.handleEmittingEvent} .role=${y} .tabIndex=${p?-1:0} ${o(this.containerRef)}>${this.selectionMode!=="none"&&this.renderSelectionIcon()||""}${this.renderChipImage()}${this.icon&&this.renderIcon()||""}<span class=${i(c.title)}><slot @slotchange=${this.handleDefaultSlotChange}></slot></span>${this.closable&&this.renderCloseButton()||""}</div>`})}};v("calcite-chip",s);export{s as Chip};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as X}from"./RBJEATU3.js";import{a as _}from"./PWWVHZBN.js";import{c as v,d as S,e as U,f as I,g as N,h as q,i as g}from"./VLOLYD36.js";import{a as T}from"./6PIHPAZF.js";import{a as O}from"./JRPSHIET.js";import"./FNH5JSBK.js";import{a as c}from"./H42LHYUA.js";import"./EQC2JW3I.js";import{a as z}from"./2DX2SAQ7.js";import{a as C}from"./J2NLU7RP.js";import{a as R}from"./PNBL2IVW.js";import{a as $}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import{a as H}from"./TLLHA7VC.js";import"./VZVYZPXQ.js";import{j as A,q as B,w as L,x as F}from"./Z6CRZOOK.js";import{a as D}from"./XRJOD24G.js";import{B as y,C as m,D as P,E as n,H as k,P as x,g as E,h as l,o as s}from"./CSQVLDPF.js";var G=5;function J({startX:d,startY:e,endX:t,endY:i}){return Math.hypot(t-d,i-e)>G}var b=class{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{let{registeredElements:t}=this,i=e.find(r=>t.has(r));return t.get(i)},this.togglePopovers=e=>{let t=e.composedPath(),i=this.queryPopover(t);i&&!i.triggerDisabled&&(i.open=!i.open),Array.from(this.registeredElements.values()).filter(r=>r!==i&&r.autoClose&&r.open&&!t.includes(r)).forEach(r=>r.open=!1)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"?this.closeAllPopovers():z(e.key)&&this.togglePopovers(e))},this.pointerDownHandler=e=>{if(e.defaultPrevented||!L(e))return;let{clientX:t,clientY:i}=e;this.pointerDownPosition={x:t,y:i}},this.clickHandler=e=>{F(e)||e.defaultPrevented||this.pointerDownPosition&&J({endY:e.clientY,endX:e.clientX,startY:this.pointerDownPosition.y,startX:this.pointerDownPosition.x})||(this.pointerDownPosition=void 0,this.togglePopovers(e))}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){window.addEventListener("pointerdown",this.pointerDownHandler),window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("pointerdown",this.pointerDownHandler),window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}},o={positionContainer:"position-container",container:"container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"header-container",heading:"heading"},Y="auto",K="aria-controls",M="aria-expanded",Q=E`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{display:contents}.position-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0}@starting-style{.position-container{opacity:0;inset-block-start:0;left:0}}.position-container{max-inline-size:var(--calcite-popover-max-size-x, 100vw)}.position-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.position-container:popover-open{display:block}.position-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.position-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.position-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.position-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.position-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding:.5rem .75rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding:.75rem 1rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding:1rem 1.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}.position-container .calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-bottom-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container{position:relative;display:flex;height:100%;flex-direction:row;flex-wrap:nowrap;border-radius:.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container.has-header{flex-direction:column}.content{display:flex;height:100%;width:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));--calcite-action-corner-radius-start-end: var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp));--calcite-action-corner-radius-end-end: var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp))}::slotted(calcite-panel),::slotted(calcite-flow){height:100%}:host([hidden]){display:none}[hidden]{display:none}`,j=new b,w=class extends P{constructor(){super(...arguments),this.focusTrap=_({triggerProp:"open",focusTrapOptions:{allowOutsideClick:!0,escapeDeactivates:e=>(e.defaultPrevented||(this.open=!1,e.preventDefault()),!1)}})(this),this.guid=`calcite-popover-${D()}`,this.hasLoaded=!1,this.mutationObserver=C("mutation",()=>this.focusTrap.updateContainerElements()),this.transitionProp="opacity",this.transitionRef=y(),this.messages=R(),this.focusSetter=$()(this),this.floatingLayout="vertical",this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.offsetDistance=g,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=Y,this.pointerDisabled=!1,this.scale="m",this.triggerDisabled=!1,this.calcitePopoverBeforeClose=s({cancelable:!1}),this.calcitePopoverBeforeOpen=s({cancelable:!1}),this.calcitePopoverClose=s({cancelable:!1}),this.calcitePopoverOpen=s({cancelable:!1})}static{this.properties={floatingLayout:[16,{},{state:!0}],referenceEl:[16,{},{state:!0}],autoClose:[7,{},{reflect:!0,type:Boolean}],closable:[7,{},{reflect:!0,type:Boolean}],flipDisabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],focusTrapDisabled:[7,{},{reflect:!0,type:Boolean}],focusTrapOptions:[0,{},{attribute:!1}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],label:1,messageOverrides:[0,{},{attribute:!1}],offsetDistance:[11,{},{type:Number,reflect:!0}],offsetSkidding:[11,{},{reflect:!0,type:Number}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],pointerDisabled:[7,{},{reflect:!0,type:Boolean}],referenceElement:1,scale:[3,{},{reflect:!0}],triggerDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=Q}async reposition(e=!1){let{referenceEl:t,placement:i,overlayPositioning:r,flipDisabled:p,filteredFlipPlacements:h,offsetDistance:a,offsetSkidding:f,arrowEl:u,floatingEl:V}=this;return U(this,{floatingEl:V,referenceEl:t,overlayPositioning:r,placement:i,flipDisabled:p,flipPlacements:h,offsetDistance:a,offsetSkidding:f,arrowEl:u,type:"popover"},e)}async setFocus(e){return this.focusSetter(()=>this.el,e)}async updateFocusTrapElements(){this.focusTrap.updateContainerElements()}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}willUpdate(e){e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),(e.has("offsetDistance")&&(this.hasUpdated||this.offsetDistance!==g)||e.has("offsetSkidding")&&(this.hasUpdated||this.offsetSkidding!==0)||e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")||e.has("placement")&&(this.hasUpdated||this.placement!==Y))&&this.reposition(!0),e.has("referenceElement")&&this.referenceElementHandler()}loaded(){this.referenceElement&&!this.referenceEl&&this.setUpReferenceElement(),this.hasLoaded=!0}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeReferences(),q(this)}async handlePopover(){await this.componentOnReady(),this.floatingEl&&(this.open&&this.referenceEl?this.floatingEl.showPopover():this.floatingEl.hidePopover())}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}openHandler(){T(this),this.reposition(!0),this.setExpandedAttr(),this.handlePopover()}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}setFloatingEl(e){this.floatingEl=e,e&&requestAnimationFrame(()=>this.setUpReferenceElement())}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?S(t,e):null}setUpReferenceElement(e=!0){this.removeReferences(),this.referenceEl=this.getReferenceElement(),N(this);let{el:t,referenceElement:i,referenceEl:r}=this;e&&i&&!r&&console.warn(`${t.tagName}: reference-element id "${i}" was not found.`,{el:t}),this.addReferences(),this.handlePopover()}getId(){return this.el.id||this.guid}setExpandedAttr(){let{referenceEl:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(M,B(t))}addReferences(){let{referenceEl:e}=this;if(!e)return;let t=this.getId();"setAttribute"in e&&e.setAttribute(K,t),j.registerElement(e,this.el),this.setExpandedAttr()}removeReferences(){let{referenceEl:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(K),e.removeAttribute(M)),j.unregisterElement(e))}getReferenceElement(){let{referenceElement:e,el:t}=this;return(typeof e=="string"?A(t,{id:e}):e)||null}hide(){this.open=!1}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),this.focusTrap.activate()}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),I(this),this.focusTrap.deactivate()}setArrowEl(e){this.arrowEl=e,this.reposition(!0)}renderCloseButton(){let{messages:e,closable:t}=this;return t?c(o.closeButtonContainer,l`<div class=${n(o.closeButtonContainer)}><calcite-action appearance=transparent class=${n(o.closeButton)} @click=${this.hide} .scale=${this.scale} .text=${e.close}><calcite-icon icon=x .scale=${H(this.scale)}></calcite-icon></calcite-action></div>`):null}renderHeader(){let{heading:e,headingLevel:t}=this,i=e?O({class:o.heading,level:t,children:e}):null;return i?c(o.header,l`<div class=${n(o.header)}>${i}${this.renderCloseButton()}</div>`):null}render(){let{referenceEl:e,heading:t,label:i,open:r,pointerDisabled:p,floatingLayout:h}=this,a=e&&r,f=!a,u=p?null:c("floating-arrow",X({floatingLayout:h,ref:this.setArrowEl}));return this.el.inert=f,this.el.ariaLabel=i,this.el.ariaLive="polite",k(this.el,"id",this.getId()),this.el.role="dialog",l`<div class=${n(o.positionContainer)} popover=manual ${m(this.setFloatingEl)}><div class=${n({[o.container]:!0,[v.animation]:!0,[v.animationActive]:a})} ${m(this.transitionRef)}>${u}<div class=${n({[o.hasHeader]:!!t,[o.headerContainer]:!0})}>${this.renderHeader()}<div class=${n(o.content)}><slot></slot></div>${t?null:this.renderCloseButton()}</div></div></div>`}};x("calcite-popover",w);export{w as Popover};
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as X}from"./2IWOXJH7.js";import{a as _}from"./BEUZYBM5.js";import{c as v,d as S,e as U,f as I,g as N,h as q,i as g}from"./5LAPR75M.js";import{a as T}from"./VQMSSO2U.js";import{a as O}from"./LYDOM6VQ.js";import"./AQ4DKRX6.js";import{a as c}from"./NULQJBCW.js";import"./W5OJOVZY.js";import{a as z}from"./S5CLKCGJ.js";import{a as C}from"./ALDDSDTX.js";import{a as R}from"./LH7245HX.js";import{a as $}from"./WOTQIMPZ.js";import"./B5JXPZDV.js";import{a as H}from"./3YZG7MA3.js";import"./CIU4VM7X.js";import{j as A,q as B,w as L,x as F}from"./5IPJANUU.js";import{a as D}from"./ZLR2B6GQ.js";import{B as y,C as m,D as P,E as n,H as k,P as x,g as E,h as l,o as s}from"./AUIOWPFN.js";var G=5;function J({startX:d,startY:e,endX:t,endY:i}){return Math.hypot(t-d,i-e)>G}var b=class{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{let{registeredElements:t}=this,i=e.find(r=>t.has(r));return t.get(i)},this.togglePopovers=e=>{let t=e.composedPath(),i=this.queryPopover(t);i&&!i.triggerDisabled&&(i.open=!i.open),Array.from(this.registeredElements.values()).filter(r=>r!==i&&r.autoClose&&r.open&&!t.includes(r)).forEach(r=>r.open=!1)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"?this.closeAllPopovers():z(e.key)&&this.togglePopovers(e))},this.pointerDownHandler=e=>{if(e.defaultPrevented||!L(e))return;let{clientX:t,clientY:i}=e;this.pointerDownPosition={x:t,y:i}},this.clickHandler=e=>{F(e)||e.defaultPrevented||this.pointerDownPosition&&J({endY:e.clientY,endX:e.clientX,startY:this.pointerDownPosition.y,startX:this.pointerDownPosition.x})||(this.pointerDownPosition=void 0,this.togglePopovers(e))}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){window.addEventListener("pointerdown",this.pointerDownHandler),window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("pointerdown",this.pointerDownHandler),window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}},o={positionContainer:"position-container",container:"container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"header-container",heading:"heading"},Y="auto",K="aria-controls",M="aria-expanded",Q=E`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{display:contents}.position-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0}@starting-style{.position-container{opacity:0;inset-block-start:0;left:0}}.position-container{max-inline-size:var(--calcite-popover-max-size-x, 100vw)}.position-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.position-container:popover-open{display:block}.position-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.position-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.position-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.position-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.position-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding:.5rem .75rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding:.75rem 1rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding:1rem 1.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}.position-container .calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-bottom-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container{position:relative;display:flex;height:100%;flex-direction:row;flex-wrap:nowrap;border-radius:.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.header-container.has-header{flex-direction:column}.content{display:flex;height:100%;width:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));--calcite-action-corner-radius-start-end: var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp));--calcite-action-corner-radius-end-end: var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp))}::slotted(calcite-panel),::slotted(calcite-flow){height:100%}:host([hidden]){display:none}[hidden]{display:none}`,j=new b,w=class extends P{constructor(){super(...arguments),this.focusTrap=_({triggerProp:"open",focusTrapOptions:{allowOutsideClick:!0,escapeDeactivates:e=>(e.defaultPrevented||(this.open=!1,e.preventDefault()),!1)}})(this),this.guid=`calcite-popover-${D()}`,this.hasLoaded=!1,this.mutationObserver=C("mutation",()=>this.focusTrap.updateContainerElements()),this.transitionProp="opacity",this.transitionRef=y(),this.messages=R(),this.focusSetter=$()(this),this.floatingLayout="vertical",this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.offsetDistance=g,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=Y,this.pointerDisabled=!1,this.scale="m",this.triggerDisabled=!1,this.calcitePopoverBeforeClose=s({cancelable:!1}),this.calcitePopoverBeforeOpen=s({cancelable:!1}),this.calcitePopoverClose=s({cancelable:!1}),this.calcitePopoverOpen=s({cancelable:!1})}static{this.properties={floatingLayout:[16,{},{state:!0}],referenceEl:[16,{},{state:!0}],autoClose:[7,{},{reflect:!0,type:Boolean}],closable:[7,{},{reflect:!0,type:Boolean}],flipDisabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],focusTrapDisabled:[7,{},{reflect:!0,type:Boolean}],focusTrapOptions:[0,{},{attribute:!1}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],label:1,messageOverrides:[0,{},{attribute:!1}],offsetDistance:[11,{},{type:Number,reflect:!0}],offsetSkidding:[11,{},{reflect:!0,type:Number}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],pointerDisabled:[7,{},{reflect:!0,type:Boolean}],referenceElement:1,scale:[3,{},{reflect:!0}],triggerDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=Q}async reposition(e=!1){let{referenceEl:t,placement:i,overlayPositioning:r,flipDisabled:p,filteredFlipPlacements:h,offsetDistance:a,offsetSkidding:f,arrowEl:u,floatingEl:V}=this;return U(this,{floatingEl:V,referenceEl:t,overlayPositioning:r,placement:i,flipDisabled:p,flipPlacements:h,offsetDistance:a,offsetSkidding:f,arrowEl:u,type:"popover"},e)}async setFocus(e){return this.focusSetter(()=>this.el,e)}async updateFocusTrapElements(){this.focusTrap.updateContainerElements()}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}willUpdate(e){e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),(e.has("offsetDistance")&&(this.hasUpdated||this.offsetDistance!==g)||e.has("offsetSkidding")&&(this.hasUpdated||this.offsetSkidding!==0)||e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")||e.has("placement")&&(this.hasUpdated||this.placement!==Y))&&this.reposition(!0),e.has("referenceElement")&&this.referenceElementHandler()}loaded(){this.referenceElement&&!this.referenceEl&&this.setUpReferenceElement(),this.hasLoaded=!0}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeReferences(),q(this)}async handlePopover(){await this.componentOnReady(),this.floatingEl&&(this.open&&this.referenceEl?this.floatingEl.showPopover():this.floatingEl.hidePopover())}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}openHandler(){T(this),this.reposition(!0),this.setExpandedAttr(),this.handlePopover()}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}setFloatingEl(e){this.floatingEl=e,e&&requestAnimationFrame(()=>this.setUpReferenceElement())}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?S(t,e):null}setUpReferenceElement(e=!0){this.removeReferences(),this.referenceEl=this.getReferenceElement(),N(this);let{el:t,referenceElement:i,referenceEl:r}=this;e&&i&&!r&&console.warn(`${t.tagName}: reference-element id "${i}" was not found.`,{el:t}),this.addReferences(),this.handlePopover()}getId(){return this.el.id||this.guid}setExpandedAttr(){let{referenceEl:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(M,B(t))}addReferences(){let{referenceEl:e}=this;if(!e)return;let t=this.getId();"setAttribute"in e&&e.setAttribute(K,t),j.registerElement(e,this.el),this.setExpandedAttr()}removeReferences(){let{referenceEl:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(K),e.removeAttribute(M)),j.unregisterElement(e))}getReferenceElement(){let{referenceElement:e,el:t}=this;return(typeof e=="string"?A(t,{id:e}):e)||null}hide(){this.open=!1}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),this.focusTrap.activate()}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),I(this),this.focusTrap.deactivate()}setArrowEl(e){this.arrowEl=e,this.reposition(!0)}renderCloseButton(){let{messages:e,closable:t}=this;return t?c(o.closeButtonContainer,l`<div class=${n(o.closeButtonContainer)}><calcite-action appearance=transparent class=${n(o.closeButton)} @click=${this.hide} .scale=${this.scale} .text=${e.close}><calcite-icon icon=x .scale=${H(this.scale)}></calcite-icon></calcite-action></div>`):null}renderHeader(){let{heading:e,headingLevel:t}=this,i=e?O({class:o.heading,level:t,children:e}):null;return i?c(o.header,l`<div class=${n(o.header)}>${i}${this.renderCloseButton()}</div>`):null}render(){let{referenceEl:e,heading:t,label:i,open:r,pointerDisabled:p,floatingLayout:h}=this,a=e&&r,f=!a,u=p?null:c("floating-arrow",X({floatingLayout:h,ref:this.setArrowEl}));return this.el.inert=f,this.el.ariaLabel=i,this.el.ariaLive="polite",k(this.el,"id",this.getId()),this.el.role="dialog",l`<div class=${n(o.positionContainer)} popover=manual ${m(this.setFloatingEl)}><div class=${n({[o.container]:!0,[v.animation]:!0,[v.animationActive]:a})} ${m(this.transitionRef)}>${u}<div class=${n({[o.hasHeader]:!!t,[o.headerContainer]:!0})}>${this.renderHeader()}<div class=${n(o.content)}><slot></slot></div>${t?null:this.renderCloseButton()}</div></div></div>`}};x("calcite-popover",w);export{w as Popover};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as u}from"./
|
|
3
|
+
v5.0.0-next.5 */
|
|
4
|
+
import{a as u}from"./NULQJBCW.js";import{a}from"./3YZG7MA3.js";import{C as e,E as r,h as o,l as n}from"./AUIOWPFN.js";var i={button:"x-button",buttonRound:"x-button--round"},k=({disabled:c,focusable:b,key:m,label:s,onClick:l,ref:$,round:f=!0,scale:t,title:p})=>u(m,o`<button .ariaLabel=${s} class=${r({[(d=>`x-button--${d}`)(t)]:!0,[i.button]:!0,[i.buttonRound]:f})} .disabled=${c} @click=${l} .tabIndex=${b?0:-1} title=${p??n} type=button ${e($)}><calcite-icon icon=x .scale=${a(t)}></calcite-icon></button>`);export{i as a,k as b};
|