@esri/calcite-components 5.0.0-next.3 → 5.0.0-next.4
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/{QDR7A47F.js → 26KO5WLB.js} +2 -2
- package/dist/calcite/{57WVJI5D.js → 2C6PV6LO.js} +1 -1
- package/dist/calcite/{ZCDYIKPL.js → 2CJWVM4R.js} +2 -2
- package/dist/calcite/{L6HFE67F.js → 2DX2SAQ7.js} +1 -1
- package/dist/calcite/{ICWMT556.js → 2GMLRXCX.js} +2 -2
- package/dist/calcite/{FXAVGIBO.js → 2J5IS422.js} +2 -2
- package/dist/calcite/{P2MLMFIB.js → 2JFH2WAM.js} +2 -2
- package/dist/calcite/{P5PS2PVQ.js → 2VXNPHIO.js} +2 -2
- package/dist/calcite/{KNTW4634.js → 32YCYEKN.js} +1 -1
- package/dist/calcite/{QX6ZGXUA.js → 35DVUKKJ.js} +2 -2
- package/dist/calcite/{GT3B6N5Y.js → 3PSVZRKA.js} +1 -1
- package/dist/calcite/{52U5HSRZ.js → 4VQGRHEV.js} +2 -2
- package/dist/calcite/544AASIY.js +4 -0
- package/dist/calcite/{777CURPL.js → 5FUKNERA.js} +2 -2
- package/dist/calcite/{XAUVURWR.js → 63S6JWID.js} +1 -1
- package/dist/calcite/{WRVSFB7L.js → 6CJF3ZME.js} +2 -2
- package/dist/calcite/{ZN5NGGVV.js → 6G3IVAVE.js} +2 -2
- package/dist/calcite/{AYEIZT5Y.js → 6OSIXZYU.js} +2 -2
- package/dist/calcite/{TG4OK7FQ.js → 6PIHPAZF.js} +2 -2
- package/dist/calcite/{IWU3WQTA.js → 6TAH2TAT.js} +2 -2
- package/dist/calcite/{PDC2HFCE.js → 7SVIAOHO.js} +1 -1
- package/dist/calcite/{BGDALDXM.js → 7TJP2ISL.js} +2 -2
- package/dist/calcite/{BSQIX4WQ.js → A2TCAPW4.js} +2 -2
- package/dist/calcite/{HS3YVIY4.js → A5CVK7TL.js} +2 -2
- package/dist/calcite/{EWPZP6OD.js → AAV5EWQK.js} +2 -2
- package/dist/calcite/{WLATCKTT.js → AE4AQEU5.js} +2 -2
- package/dist/calcite/{4T2MXJFD.js → AICLNUQ5.js} +2 -2
- package/dist/calcite/{JEZYPF4D.js → AILXQSIJ.js} +2 -2
- package/dist/calcite/{SN7NAXJ7.js → AK4EMEY2.js} +2 -2
- package/dist/calcite/{OBEAWB6Y.js → AKR5JHPW.js} +2 -2
- package/dist/calcite/{QSCN7J3O.js → ALQH5DCZ.js} +2 -2
- package/dist/calcite/{PBJYTCZQ.js → AS2E2XYE.js} +1 -1
- package/dist/calcite/{3DRRZPK3.js → B3KV4G2W.js} +2 -2
- package/dist/calcite/{2OBK2KGK.js → BG5JIUF3.js} +2 -2
- package/dist/calcite/{ZTZGAKAG.js → BK2W2RW3.js} +2 -2
- package/dist/calcite/{YT4SL4T4.js → BQI7TWVC.js} +2 -2
- package/dist/calcite/{7STMP4B2.js → C3BIK3DY.js} +1 -1
- package/dist/calcite/{R7GSVJN5.js → C77NX62C.js} +2 -2
- package/dist/calcite/{YTEVYZWQ.js → C7C75GTM.js} +2 -2
- package/dist/calcite/{VFZYB7KV.js → CAHGZMOM.js} +2 -2
- package/dist/calcite/{LSTKQGBO.js → CDLGLCFD.js} +2 -2
- package/dist/calcite/{ALOAVLGK.js → CSQVLDPF.js} +2 -2
- package/dist/calcite/{BE4UHKT6.js → CYVISXIT.js} +2 -2
- package/dist/calcite/{UXWFYSWM.js → D5SFHDV6.js} +2 -2
- package/dist/calcite/{XXYGNCPD.js → DNVDDGB7.js} +2 -2
- package/dist/calcite/{34B5K3VC.js → E3C36U7C.js} +2 -2
- package/dist/calcite/{A7PQJDZZ.js → EDVRYPYX.js} +2 -2
- package/dist/calcite/{C47YSH7C.js → EKOGELYT.js} +2 -2
- package/dist/calcite/{FPD3KMKK.js → EQC2JW3I.js} +1 -1
- package/dist/calcite/{2FBU6T3T.js → ETHM6IZM.js} +2 -2
- package/dist/calcite/{XRAT3TME.js → ETUOSTGW.js} +2 -2
- package/dist/calcite/{SKKSLFHT.js → EWNCXKJC.js} +2 -2
- package/dist/calcite/{EFEUKCWA.js → FKYJEFNP.js} +1 -1
- package/dist/calcite/{PO2U44AW.js → FNH5JSBK.js} +2 -2
- package/dist/calcite/{ANAWJ75J.js → FX45OPBE.js} +2 -2
- package/dist/calcite/{XYJQXYRM.js → G73EBLG4.js} +2 -2
- package/dist/calcite/{5MCNWZT7.js → GCPYRD7U.js} +2 -2
- package/dist/calcite/{S5R35RX3.js → GTU5X7O7.js} +2 -2
- package/dist/calcite/{BVHWNNF7.js → GU5MLWDX.js} +2 -2
- package/dist/calcite/{XWOGKL32.js → GV755OVW.js} +2 -2
- package/dist/calcite/{KIGAOJGV.js → H3EPIYLG.js} +1 -1
- package/dist/calcite/{7WAFUV2T.js → H42LHYUA.js} +2 -2
- package/dist/calcite/{4BE5CM4R.js → HBVWYA2B.js} +2 -2
- package/dist/calcite/{MBIDNSLG.js → HIB3Q63Z.js} +1 -1
- package/dist/calcite/{WRHL43TZ.js → HKNQLLG7.js} +2 -2
- package/dist/calcite/{XWXCOJUO.js → HKVRX5SD.js} +2 -2
- package/dist/calcite/{XXNZUORE.js → HOUDAAST.js} +2 -2
- package/dist/calcite/{YANBAVXH.js → HPWHHEM4.js} +2 -2
- package/dist/calcite/{HXDER6NO.js → HZVCGOQL.js} +2 -2
- package/dist/calcite/{NHJ736R2.js → INNX6VTE.js} +2 -2
- package/dist/calcite/{7CSKQBJD.js → INNXW35W.js} +2 -2
- package/dist/calcite/{PHQB3YSI.js → IXK4BTNI.js} +2 -2
- package/dist/calcite/{5JALWDSF.js → J2ACTXE5.js} +2 -2
- package/dist/calcite/{RSQ6RL3K.js → J2NLU7RP.js} +1 -1
- package/dist/calcite/{XO5ETFTI.js → JAM3DZYC.js} +1 -1
- package/dist/calcite/{KZSABN6Z.js → JBMFTM4R.js} +2 -2
- package/dist/calcite/{YPBCS4NA.js → JCGVWBAA.js} +2 -2
- package/dist/calcite/{UCRIU7RD.js → JDPMMX2J.js} +2 -2
- package/dist/calcite/{WJT34A4V.js → JIKG4DHH.js} +2 -2
- package/dist/calcite/{LT2NMLTM.js → JJNFTIBI.js} +2 -2
- package/dist/calcite/{6CFV5RKV.js → JJOW6LLC.js} +2 -2
- package/dist/calcite/{X3IVLT67.js → JRPSHIET.js} +2 -2
- package/dist/calcite/{QTBEVUXO.js → K6FTZ2ZF.js} +2 -2
- package/dist/calcite/{U235MJ2F.js → KCVWP63F.js} +2 -2
- package/dist/calcite/{43SYTK5U.js → KSITDI7Y.js} +2 -2
- package/dist/calcite/{4AHB62J2.js → LAAEPNIM.js} +2 -2
- package/dist/calcite/{KMS2JCWI.js → M5QNDD4X.js} +1 -1
- package/dist/calcite/{K6E5LSS6.js → M6OBWXQN.js} +2 -2
- package/dist/calcite/{EH4IJP5H.js → M7H4RC23.js} +2 -2
- package/dist/calcite/{PX5VW7CA.js → MDLPBZOZ.js} +2 -2
- package/dist/calcite/{J3FSCDUX.js → MHGTLCFX.js} +2 -2
- package/dist/calcite/{S5TFXGHY.js → MM5GOLON.js} +2 -2
- package/dist/calcite/{3QKRHYDR.js → MPZ73UTT.js} +2 -2
- package/dist/calcite/{4IBSL24S.js → N7QD2WXH.js} +2 -2
- package/dist/calcite/{KXG3JNXH.js → NFBDMCMY.js} +2 -2
- package/dist/calcite/{6UGLHCRO.js → NI3OLQU4.js} +2 -2
- package/dist/calcite/{WWKRJ5BW.js → NPXLX7L5.js} +2 -2
- package/dist/calcite/{HZVXI5VT.js → NS7XIDPL.js} +2 -2
- package/dist/calcite/{VQT3LLC7.js → OTRRBSYY.js} +1 -1
- package/dist/calcite/{JDVZQ6HH.js → P2J4VCQF.js} +2 -2
- package/dist/calcite/{WTV3W5WN.js → PLRKNZ2Y.js} +2 -2
- package/dist/calcite/{WIJWBGXQ.js → PNBL2IVW.js} +2 -2
- package/dist/calcite/{35QUJIVR.js → POOH5QBE.js} +2 -2
- package/dist/calcite/{6BL35Y24.js → PQACJ4N6.js} +2 -2
- package/dist/calcite/{EU6IVBMM.js → PRB44CR7.js} +2 -2
- package/dist/calcite/{UTGJTZUE.js → PWWVHZBN.js} +2 -2
- package/dist/calcite/{2U5DG73Y.js → Q2KBZ6FQ.js} +2 -2
- package/dist/calcite/{OPTERABQ.js → QDXVT7UF.js} +2 -2
- package/dist/calcite/{AEYCEODJ.js → QK7SZUAI.js} +2 -2
- package/dist/calcite/{MIR3A75I.js → QNVFFZ3F.js} +2 -2
- package/dist/calcite/{KGALTIIM.js → QRBJKU6C.js} +2 -2
- package/dist/calcite/{5MVGEBA4.js → QSTLY3DQ.js} +2 -2
- package/dist/calcite/{JXRRZQUL.js → QW2OFS26.js} +2 -2
- package/dist/calcite/{ZMYI2UVC.js → QWN5XHMG.js} +2 -2
- package/dist/calcite/{K6F4PVVD.js → QYCVH2VH.js} +2 -2
- package/dist/calcite/{GPIMJEMU.js → R2KPGC7W.js} +2 -2
- package/dist/calcite/{RQFHIC47.js → R4PTX2BD.js} +2 -2
- package/dist/calcite/{VAG4CLRN.js → R534LDNQ.js} +2 -2
- package/dist/calcite/{MEERCHNE.js → RBJEATU3.js} +2 -2
- package/dist/calcite/{KUUFM5EV.js → RFA6VADW.js} +2 -2
- package/dist/calcite/{IVEARGFQ.js → RPLPMP3J.js} +2 -2
- package/dist/calcite/{PSYXUHRF.js → RSHJ2ULC.js} +1 -1
- package/dist/calcite/{I2EB746H.js → RUMWLVIQ.js} +2 -2
- package/dist/calcite/{2526AKXE.js → S6HTKBNB.js} +1 -1
- package/dist/calcite/{OT4HMOKY.js → SBO2DPVJ.js} +2 -2
- package/dist/calcite/{E2ETQPML.js → SHXU5GEM.js} +2 -2
- package/dist/calcite/{DQJ4CTWW.js → SLUOB5WF.js} +2 -2
- package/dist/calcite/{E22QVECL.js → SOFELOS3.js} +2 -2
- package/dist/calcite/{BCBU5ZR6.js → SQ25UCSA.js} +2 -2
- package/dist/calcite/{NHUHCQ4J.js → SU2JQIB4.js} +1 -1
- package/dist/calcite/{WWUSLEON.js → T3UNO6JW.js} +2 -2
- package/dist/calcite/{6RMUSGEC.js → TCB3D44T.js} +2 -2
- package/dist/calcite/{FJ6DIGL4.js → TDROT2JJ.js} +2 -2
- package/dist/calcite/{JW4SOJWB.js → TLLHA7VC.js} +2 -2
- package/dist/calcite/{N4VKIVPS.js → TPG23UCD.js} +2 -2
- package/dist/calcite/{VBT5FAGS.js → TS65SISB.js} +1 -1
- package/dist/calcite/{TKNM6PGC.js → TU2PNKWS.js} +2 -2
- package/dist/calcite/{OWE3TUYA.js → TXZPVAH4.js} +2 -2
- package/dist/calcite/{RWVRFF3I.js → U3G47NPB.js} +2 -2
- package/dist/calcite/{6RQZN7N2.js → U3RNUZF6.js} +2 -2
- package/dist/calcite/{3GUK3G7C.js → U5ZHIRE4.js} +1 -1
- package/dist/calcite/{HXF4YIAH.js → V6JTY5IT.js} +2 -2
- package/dist/calcite/{YG7PWF3G.js → VBGPBKJL.js} +2 -2
- package/dist/calcite/{CNF3Q4TX.js → VLOLYD36.js} +2 -2
- package/dist/calcite/{DY2XHFEN.js → VV3MILRZ.js} +2 -2
- package/dist/calcite/{2IUZ3YR2.js → VVCB7N7V.js} +2 -2
- package/dist/calcite/{P2RYGBBZ.js → VZVYZPXQ.js} +2 -2
- package/dist/calcite/{2QSQXOI5.js → W2KQ3FF5.js} +2 -2
- package/dist/calcite/{GTQBX3SK.js → WDKPAPPB.js} +2 -2
- package/dist/calcite/{FQH6NA2N.js → WGQ2SERU.js} +2 -2
- package/dist/calcite/{D2QA5PI3.js → WJA2X3C2.js} +2 -2
- package/dist/calcite/{RQU4NRTA.js → WLLFG3M7.js} +2 -2
- package/dist/calcite/{PAKKXMW6.js → WNEJDZTS.js} +1 -1
- package/dist/calcite/{5E23KXQW.js → WSETKDK2.js} +2 -2
- package/dist/calcite/{WWH2YWKG.js → WYHGKROL.js} +2 -2
- package/dist/calcite/{WVP5XPLP.js → X2PZLQSO.js} +2 -2
- package/dist/calcite/{HJBVI5HP.js → X7GVFGBQ.js} +2 -2
- package/dist/calcite/{UA4KBTNZ.js → XGLTZ4HO.js} +2 -2
- package/dist/calcite/{6HTHE64W.js → XHCNKCYX.js} +2 -2
- package/dist/calcite/{DLM7KEK5.js → XM6I5JZM.js} +2 -2
- package/dist/calcite/{BHCRRG5K.js → XQGQJEI2.js} +2 -2
- package/dist/calcite/{DNM3U3Z7.js → XRJOD24G.js} +1 -1
- package/dist/calcite/{CSBYILHE.js → XYU7WBO7.js} +2 -2
- package/dist/calcite/{VGOGYBOG.js → Y6BDELTJ.js} +2 -2
- package/dist/calcite/{KEKHXXG2.js → Y7L5PL4A.js} +2 -2
- package/dist/calcite/{ZLSS7CXL.js → YA3YNL2F.js} +2 -2
- package/dist/calcite/{QP5GAAB3.js → YASA2V4I.js} +2 -2
- package/dist/calcite/{425YTQUT.js → YGYOIYMF.js} +2 -2
- package/dist/calcite/{6J3DGER2.js → YUOVY5RN.js} +2 -2
- package/dist/calcite/{SLICSH62.js → Z6CRZOOK.js} +2 -2
- package/dist/calcite/{NL3LLRLQ.js → ZCWFURSE.js} +2 -2
- package/dist/calcite/{N5LX4COS.js → ZUMJB5U3.js} +2 -2
- package/dist/calcite/calcite.esm.js +2 -2
- package/dist/chunks/runtime.js +4 -4
- package/dist/components/calcite-block/customElement.js +1 -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
- package/dist/calcite/HGI7ZMWJ.js +0 -4
|
@@ -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{b as r,c as k}from"./
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{b as r,c as k}from"./FNH5JSBK.js";import{a as v,b as y}from"./PRB44CR7.js";import{a as g}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import"./TLLHA7VC.js";import"./VZVYZPXQ.js";import{e as m}from"./Z6CRZOOK.js";import"./XRJOD24G.js";import{B as d,C as h,D as u,E as n,G as e,I as p,J as b,P as f,g as s,h as o}from"./CSQVLDPF.js";var z=s`: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}:host a,:host button{position:relative;display:flex;cursor:pointer;align-items:center;justify-content:center;border-radius:0;border-style:none;font-family:inherit;text-decoration:none;line-height:inherit;font-size:inherit;-webkit-appearance:none}:host a:hover,:host button:hover{text-decoration:none}:host a,:host button{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,background-size;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;outline-color:transparent}:host a:focus,:host button: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))))}calcite-icon{inline-size:1em;block-size:1em;min-inline-size:unset;min-block-size:unset}.calcite-link--icon{vertical-align:middle;margin-block-start:-.25em}:host .calcite-link--icon.icon-start{margin-inline-end:.5rem}:host .calcite-link--icon.icon-end{margin-inline-start:.5rem}:host button,:host a{position:relative;display:inline;border-style:none;background-color:transparent;padding:0;color:var(--calcite-link-text-color, var(--calcite-color-text-link));line-height:inherit;white-space:initial;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px}:host button:hover,:host button:focus,:host a:hover,:host a:focus{background-size:100% 1px,100% 1px}:host button:active,:host a:active{background-size:100% 2px,100% 2px}:host button.calcite--rtl,:host a.calcite--rtl{background-position:100% 100%,100% 100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,c={calciteLinkIcon:"calcite-link--icon",iconStart:"icon-start",iconEnd:"icon-end"},l=class extends u{constructor(){super(),this.childRef=d(),this.focusSetter=g()(this),this.disabled=!1,this.download=!1,this.listen("click",this.clickHandler)}static{this.properties={disabled:[7,{},{reflect:!0,type:Boolean}],download:[3,{converter:p},{reflect:!0}],href:[3,{},{reflect:!0}],iconEnd:[3,{type:String},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{type:String},{reflect:!0}],rel:1,target:1}}static{this.styles=z}async setFocus(t){return this.focusSetter(()=>this.childRef.value,t)}updated(){v(this)}clickHandler(t){this.disabled||t.isTrusted||this.childRef.value.click()}childElClickHandler(t){t.isTrusted||t.stopPropagation()}render(){let{download:t,el:$}=this,x=m($),i=this.href?"a":"button",S=o`<calcite-icon class=${n({[c.calciteLinkIcon]:!0,[c.iconStart]:!0})} .flipRtl=${this.iconFlipRtl==="start"||this.iconFlipRtl==="both"} .icon=${this.iconStart} scale=s></calcite-icon>`,E=o`<calcite-icon class=${n({[c.calciteLinkIcon]:!0,[c.iconEnd]:!0})} .flipRtl=${this.iconFlipRtl==="end"||this.iconFlipRtl==="both"} .icon=${this.iconEnd} scale=s></calcite-icon>`,a=i==="button"?r`button`:r`a`,R=i==="button"?0:null;return this.el.role="presentation",y({disabled:this.disabled,children:k`<${a} class=${n({[b.rtl]:x==="rtl"})} download=${(i==="a"?t===!0||t===""?"":t||null:null)??e} href=${(i==="a"&&this.href)??e} @click=${this.childElClickHandler} rel=${(i==="a"&&this.rel)??e} tabindex=${R??e} target=${(i==="a"&&this.target)??e} ${h(this.childRef)}>${o`${this.iconStart?S:null}<slot></slot>${this.iconEnd?E:null}`}</${a}>`})}};f("calcite-link",l);export{l as Link};
|
|
@@ -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 N,c as h,d as f,e as O,f as g,n as v,p as b}from"./
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{a as w,b as N,c as h,d as f,e as O,f as g,n as v,p as b}from"./CSQVLDPF.js";var A=e=>(...n)=>{let t=f(),o=new e(...n),s=o.exports;h(t.at(-1));let r=o.component.manager;r.W(o,s),o.watchExports(r.W.bind(r,o)),O(o);let i=[o.component,...t].reverse();return v(i,a=>a===void 0?void 0:F(o,a,s),s)},F=(e,{host:n,key:t,isReactive:o},s)=>{let r=n,i=r[t]!==e.exports,a=r[t]!==s,c=s!==e.exports;if(i&&!a&&c&&(r[t]=e.exports),n===e.component){if(o){let l=e.component.manager;a&&l.W(e,r[t]),e.onUpdate(d=>{if(d.has(t)){let P=r[t];P!==e.exports&&l.W(e,P)}})}e.O=o?void 0:t}let u=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(u?g(()=>{r[t]=e.exports}):r[t]=e.exports)})};var D=(e,n)=>{let t=e;for(;t;){if(t===n)return!0;if(!t.parentNode)return!1;t.parentNode instanceof ShadowRoot?t=t.parentNode.host:t=t.parentNode}return!1},T=(e,n,t)=>{let o=V(n).subscribe;return o(s=>{s.some(i=>D(e,i.target))&&t()})},E={},V=e=>{let n=e.join(","),t=E[n];if(t!==void 0)return t;let o=new Set,s=new MutationObserver(i=>o.forEach(a=>a(i)));globalThis.document&&s.observe(document.documentElement,{attributes:!0,attributeFilter:e,subtree:!0});let r={subscribe:i=>(o.add(i),()=>{o.delete(i),o.size===0&&(s.disconnect(),E[n]=void 0)})};return E[n]=r,r},z=(e,n)=>{let t=e;for(;t;){let o=t.closest?.(n);if(o)return o;let s=t.getRootNode?.();if(s===globalThis.document)return;t=s.host}};var M=(e,n,t)=>z(e,`[${n}]`)?.getAttribute(n)??t;var R="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),U=new Set(R),m="en",G={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},W=async(e,n,t="")=>{let o=`${n}/${t}`,s=`${o}${e}.json`;return y[s]??(y[s]=_(e,o)),await y[s]},y={},_=async(e,n)=>{let t=`${n}${e}.json`;try{let o=await fetch(t);if(o.ok)return await o.json()}catch(o){return console.error(o),{}}return e===m?{}:await _(m,n)},C=e=>{let n=M(e,"lang",globalThis.navigator?.language||m);return{lang:n,t9nLocale:$(n)}},$=e=>{let[n,t]=e.split("-"),o=n.toLowerCase(),s=o;return t&&(s=`${o}-${t.toUpperCase()}`),s=G[s]??s,U.has(s)?s:t?$(o):m},k=(e,n,t,o)=>{let s,r=()=>H(e,n(),o).then(i=>{(s?.lang!==i.lang||s.t9nLocale!==i.t9nLocale||s.t9nStrings!==i.t9nStrings)&&t(i),s=i}).catch(console.error);return queueMicrotask(r),T(e,["lang"],r)},H=async(e,n,t=e.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:s}=C(e),r=`${n}/${t}/t9n`,a=t===null?{}:await W(s,r,"messages.");return{lang:o,t9nLocale:s,t9nStrings:a}};var I=e=>S(void 0,e),gt=e=>n=>S(n,e),x=class extends b{constructor(n,t){super(n);let o=this.exports;try{N(this.component);let s=t(this.component,this),r=this.exports!==o;if(w(s)){r||this.setProvisionalExports(s);let i=s.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this.P.reject(a),console.error(a)});this.onLoad(async()=>await i)}else(!r||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s),console.error(s)}}catchUpLifecycle(){}},S=A(x),vt=(e,n)=>new L(e,n),L=class extends b{#t;#e;#o;constructor(n,t){super(),!!1&&(this.#e=n,this.#o=t,this.#t=new MutationObserver(o=>{o.forEach(s=>{n.includes(s.attributeName)&&t.call(this.component,this.component.el.getAttribute(s.attributeName),s.oldValue,s.attributeName)})}))}hostConnected(){this.#e.forEach(n=>{this.component.el.hasAttribute(n)&&this.#o.call(this.component,null,this.component.el.getAttribute(n),n)}),this.#t.observe(this.component.el,{attributes:!0,attributeOldValue:!0,attributeFilter:this.#e})}hostDisconnected(){this.#t.disconnect()}};var bt=e=>(...n)=>{let t=f(),o=new e(...n);return h(t.at(-1)),o};var Et=e=>(n={})=>I((t,o)=>{let s=C(t.el),r={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},i=t;o.onLifecycle(()=>k(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:p,lang:u})=>{let l={...p,_lang:u,_t9nLocale:c,_loading:!1};o.exports=l;let d=p.componentLabel;typeof d=="string"&&"label"in t&&t.label==null&&(t.label??=d),a(i.messageOverrides)},n.name));let a=c=>{let p=o.exports,u=p._original??p,l=j(u,c);c&&(l._original=u),o.exports=l};return"messageOverrides"in i&&o.onUpdate(c=>{c.has("messageOverrides")&&a(i.messageOverrides)}),n.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),j=(e,n)=>{if(!n)return e;let t={...e};return Object.entries(n).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=j(e[o],s):t[o]=s??e[o])}),t};export{gt as a,vt as b,bt as c,Et 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 X}from"./MEERCHNE.js";import{a as _}from"./UTGJTZUE.js";import{c as v,d as S,e as U,f as I,g as N,h as q,i as g}from"./CNF3Q4TX.js";import{a as T}from"./TG4OK7FQ.js";import{a as O}from"./X3IVLT67.js";import"./PO2U44AW.js";import{a as c}from"./7WAFUV2T.js";import"./FPD3KMKK.js";import{a as z}from"./L6HFE67F.js";import{a as C}from"./RSQ6RL3K.js";import{a as R}from"./WIJWBGXQ.js";import{a as $}from"./XWXCOJUO.js";import"./UXWFYSWM.js";import{a as H}from"./JW4SOJWB.js";import"./P2RYGBBZ.js";import{j as A,q as B,w as L,x as F}from"./SLICSH62.js";import{a as D}from"./DNM3U3Z7.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"./ALOAVLGK.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.4 */
|
|
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};
|
|
@@ -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}from"./
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{a}from"./FKYJEFNP.js";import{c as $}from"./63S6JWID.js";import{e as S}from"./Z6CRZOOK.js";import{C as A,h as g,l as v}from"./CSQVLDPF.js";var b=t=>Array.from(t.querySelectorAll("calcite-action")).filter(e=>e.closest("calcite-action-menu")?e.slot===$.trigger:!0),D=({actionGroups:t,expanded:e,overflowCount:o})=>{let c=o;t.reverse().forEach(l=>{let i=0,s=b(l).reverse();s.forEach(n=>{n.slot===a.menuActions&&(n.removeAttribute("slot"),n.textEnabled=e)}),c>0&&s.some(n=>(s.filter(u=>!u.slot).length>1&&s.length>2&&!n.closest("calcite-action-menu")&&(n.textEnabled=!0,n.setAttribute("slot",a.menuActions),i++,i>1&&c--),c<1)),l.manager.component.requestUpdate()})},E={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function y(t,e){return t||e.closest("calcite-shell-panel")?.position||"start"}function G({el:t,expanded:e}){b(t).filter(o=>o.slot!==a.menuActions).forEach(o=>o.textEnabled=e),t.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=e)}var L=({tooltip:t,referenceElement:e,expanded:o,ref:c})=>(t&&(t.referenceElement=!o&&e?e:null),c&&c(e),e),P=({expanded:t,expandText:e,collapseText:o,expandLabel:c,collapseLabel:l,toggle:i,el:s,position:n,tooltip:f,ref:u,scale:d})=>{let T=S(s)==="rtl",m=t?o:e,p=t?l:c,r=[E.chevronsLeft,E.chevronsRight];T&&r.reverse();let h=y(n,s)==="end",q=h?r[1]:r[0],x=h?r[0]:r[1];return g`<calcite-action .aria=${{expanded:t}} .icon=${t?q:x} id=expand-toggle .label=${p} @click=${i} .scale=${d} .text=${m} .textEnabled=${t} title=${(!t&&!f?m:null)??v} ${A(C=>L({tooltip:f,referenceElement:C,expanded:t,ref:u}))}></calcite-action>`};export{b as a,D as b,G as c,P 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{h as O,k as L}from"./I2EB746H.js";import{c as M,e as F,f as E}from"./RWVRFF3I.js";import{a as v}from"./7WAFUV2T.js";import"./L6HFE67F.js";import{a as T}from"./RSQ6RL3K.js";import{a as S}from"./WIJWBGXQ.js";import"./UXWFYSWM.js";import{p as V}from"./SLICSH62.js";import"./DNM3U3Z7.js";import{B as d,C as m,D as k,E as b,F as p,P as C,g as z,h}from"./ALOAVLGK.js";var r={container:"container",fill:"fill",stepLine:"step-line",label:"label",labelHidden:"label-hidden",labelRange:"label-range",labelValue:"label-value",unitLabel:"unit-label",stepsVisible:"steps-visible",valueVisible:"value-visible",success:"fill-success",warning:"fill-warning",danger:"fill-danger"},U=z`: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([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host{display:flex;--calcite-internal-meter-space: var(--calcite-spacing-base);--calcite-internal-meter-height: var(--calcite-spacing-lg);--calcite-internal-meter-font-size: var(--calcite-font-size--1);--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-brand));--calcite-internal-meter-background-color: var(--calcite-meter-background-color, var(--calcite-color-foreground-2));--calcite-internal-meter-border-color: var(--calcite-meter-border-color, var(--calcite-color-border-3));--calcite-internal-meter-shadow: var(--calcite-meter-shadow, var(--calcite-shadow-none));--calcite-internal-meter-corner-radius: var(--calcite-meter-corner-radius, 9999px);--calcite-internal-meter-value-text-color: var(--calcite-meter-value-text-color, var(--calcite-color-text-1));--calcite-internal-meter-range-text-color: var(--calcite-meter-range-text-color, var(--calcite-color-text-3))}:host([scale=s]){--calcite-internal-meter-height: var(--calcite-spacing-md);--calcite-internal-meter-font-size: var(--calcite-font-size--2)}:host([scale=l]){--calcite-internal-meter-height: var(--calcite-spacing-xxl);--calcite-internal-meter-font-size: var(--calcite-font-size-0)}:host([appearance=solid]){--calcite-internal-meter-border-color: var(--calcite-color-foreground-3);--calcite-internal-meter-background-color: var(--calcite-color-foreground-3)}:host([appearance=outline]){--calcite-internal-meter-background-color: transparent}.fill{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-brand))}.fill-danger{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-danger))}.fill-success{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-success))}.fill-warning{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-warning))}.container{position:relative;display:flex;align-items:center;margin:0;inline-size:var(--calcite-container-size-content-fluid);block-size:var(--calcite-internal-meter-height);background-color:var(--calcite-internal-meter-background-color);border:var(--calcite-border-width-sm) solid var(--calcite-internal-meter-border-color);border-radius:var(--calcite-internal-meter-corner-radius);box-shadow:var(--calcite-internal-meter-shadow)}.value-visible{margin-block-start:var(--calcite-spacing-xxl)}.steps-visible{margin-block-end:var(--calcite-spacing-xxl)}.step-line{position:absolute;inset-block:0px;display:block;inline-size:var(--calcite-internal-meter-space);background-color:var(--calcite-internal-meter-border-color)}.label{position:absolute;font-size:var(--calcite-internal-meter-font-size)}.label-hidden{visibility:hidden;opacity:0}.label-value{inset-block-end:calc(100% + .5em);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-internal-meter-value-text-color)}.label-range{color:var(--calcite-internal-meter-range-text-color);inset-block-start:calc(100% + .5em)}.label-range .unit-label{font-weight:var(--calcite-font-weight-medium)}.fill{position:absolute;z-index:var(--calcite-z-index);display:block;transition-timing-function:cubic-bezier(.4,0,.2,1);inset-inline-start:var(--calcite-internal-meter-space);inset-block:var(--calcite-internal-meter-space);border-radius:var(--calcite-internal-meter-corner-radius);max-inline-size:calc(100% - var(--calcite-internal-meter-space) * 2);min-inline-size:calc(var(--calcite-internal-meter-height) - var(--calcite-internal-meter-space) * 2);background-color:var(--calcite-internal-meter-fill-color);transition-property:inline-size,background-color,box-shadow}.solid .fill{inset-block:0;inset-inline-start:0;max-inline-size:100%;min-inline-size:calc(var(--calcite-internal-meter-height));box-shadow:0 0 0 1px var(--calcite-internal-meter-fill-color)}`,y=class extends k{constructor(){super(...arguments),this.highLabelRef=d(),this.labelFlipMax=.8,this.labelFlipProximity=.15,this.lowLabelRef=d(),this.maxLabelRef=d(),this.maxPercent=100,this.messages=S({name:null}),this.meterContainerRef=d(),this.minLabelRef=d(),this.minPercent=0,this.resizeObserver=T("resize",()=>this.resizeHandler()),this.valueLabelRef=d(),this.appearance="outline-fill",this.disabled=!1,this.fillType="range",this.groupSeparator=!1,this.max=100,this.min=0,this.rangeLabelType="percent",this.rangeLabels=!1,this.scale="m",this.unitLabel="",this.valueLabel=!1,this.valueLabelType="percent"}static{this.properties={currentPercent:[16,{},{state:!0}],highActive:[16,{},{state:!0}],highPercent:[16,{},{state:!0}],lowActive:[16,{},{state:!0}],lowPercent:[16,{},{state:!0}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],fillType:[3,{},{reflect:!0}],form:[3,{},{reflect:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],high:[11,{},{reflect:!0,type:Number}],label:1,low:[11,{},{reflect:!0,type:Number}],max:[11,{},{reflect:!0,type:Number}],min:[11,{},{reflect:!0,type:Number}],name:[3,{},{reflect:!0}],numberingSystem:1,rangeLabelType:[3,{},{reflect:!0}],rangeLabels:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],unitLabel:1,value:[9,{},{type:Number}],valueLabel:[7,{},{reflect:!0,type:Boolean}],valueLabelType:[3,{},{reflect:!0}]}}static{this.styles=U}connectedCallback(){super.connectedCallback(),M(this),this.resizeObserver?.observe(this.el)}load(){this.calculateValues(),E(this,this.value)}willUpdate(e){(e.has("min")&&(this.hasUpdated||this.min!==0)||e.has("max")&&(this.hasUpdated||this.max!==100)||e.has("low")||e.has("high")||e.has("value"))&&this.handleRangeChange(),(e.has("rangeLabels")&&(this.hasUpdated||this.rangeLabels!==!1)||e.has("rangeLabelType")&&(this.hasUpdated||this.rangeLabelType!=="percent")||e.has("unitLabel")&&(this.hasUpdated||this.unitLabel!=="")||e.has("valueLabel")&&(this.hasUpdated||this.valueLabel!==!1)||e.has("valueLabelType")&&(this.hasUpdated||this.valueLabelType!=="percent"))&&this.updateLabels()}loaded(){this.updateLabels()}disconnectedCallback(){super.disconnectedCallback(),F(this),this.resizeObserver?.disconnect()}handleRangeChange(){this.calculateValues(),this.updateLabels()}resizeHandler(){this.updateLabels()}updateLabels(){this.valueLabelRef.value&&this.determineValueLabelPosition(),this.rangeLabels&&this.determineVisibleLabels()}calculateValues(){let{min:e,max:l,low:t,high:a,value:i}=this,n=100*(t-e)/(l-e),s=100*(a-e)/(l-e),c=100*(i-e)/(l-e);(!t||t<e||t>a||t>l)&&(this.low=e),(!a||a>l||a<t||a<e)&&(this.high=l),i||(this.value=e),this.lowPercent=n,this.highPercent=s,this.currentPercent=i?c:0,this.lowActive=!!t&&t>e&&(!i||t>i)&&(!a||t<a),this.highActive=!!a&&e<=a&&a<l&&(!i||a>i)&&(!t||a>t)}formatLabel(e,l){if(l==="percent"){if(!this.percentFormatting){let t=O(this.messages._lang),a=new Intl.NumberFormat(t,{useGrouping:this.groupSeparator,style:"percent"});this.percentFormatting={formatter:a,locale:t}}return this.percentFormatting.formatter.format(e)}else return L.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},L.localize(e.toString())}getMeterKindCssClass(){let{low:e,high:l,min:t,max:a,value:i}=this,n=e||t,s=l||a,c=i>=n,u=i<n,f=i>=s,o=i<s;return!i||!e&&o||u?r.success:c&&o?r.warning:f?r.danger:r.success}intersects(e,l){return e&&l&&V(e.getBoundingClientRect(),l.getBoundingClientRect())}determineVisibleLabels(){let{minLabelRef:{value:e},lowLabelRef:{value:l},highLabelRef:{value:t},maxLabelRef:{value:a}}=this,i=this.intersects(t,a),n=this.intersects(l,t),s=this.intersects(l,a),c=this.intersects(e,t),u=this.intersects(e,l),f=this.intersects(e,a),o=r.labelHidden;l&&(u||s||n?l.classList.add(o):l.classList.remove(o)),t&&(c||s||i?t.classList.add(o):t.classList.remove(o)),e&&a&&(f?a.classList.add(o):a.classList.remove(o))}determineValueLabelPosition(){let{valueLabelRef:{value:e},meterContainerRef:{value:l},currentPercent:t}=this,a=t>100?100:t>0?t:0,i=e.getBoundingClientRect().width,n=l.getBoundingClientRect().width,s=100*(i-0)/(n-0);a+s>=100?(e.style.insetInlineEnd="0%",e.style.removeProperty("inset-inline-start")):(e.style.insetInlineStart=`${a}% `,e.style.removeProperty("inset-inline-end"))}renderMeterFill(){let{currentPercent:e,fillType:l}=this,t=this.getMeterKindCssClass();return h`<div class=${b({[r.fill]:!0,[t]:l!=="single"})} style=${p({width:`${e}%`})}></div>`}renderRangeLine(e){let l={insetInlineStart:`${e}%`};return h`<div class=${b(r.stepLine)} style=${p(l)}></div>`}renderValueLabel(){let{currentPercent:e,valueLabelType:l,unitLabel:t,value:a}=this,i=this.formatLabel(l==="percent"?e/100:a||0,l);return v("low-label-line",h`<div class=${b({[r.label]:!0,[r.labelValue]:!0})} ${m(this.valueLabelRef)}>${i}${t&&l!=="percent"&&h`<span class=${b(r.unitLabel)}> ${t}</span>`||""}</div>`)}renderMinLabel(){let{rangeLabelType:e,min:l,minPercent:t,unitLabel:a}=this,i={insetInlineStart:`${t}%`},n=this.formatLabel(e==="percent"?t:l,e);return v("min-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(i)} ${m(this.minLabelRef)}>${n}${a&&e!=="percent"&&h`<span class=${b(r.unitLabel)}> ${a}</span>`||""}</div>`)}renderLowLabel(){let{rangeLabelType:e,low:l,lowPercent:t,highPercent:a,labelFlipProximity:i}=this,n=l?this.formatLabel(e==="percent"?t/100:l,e):"",s={insetInlineStart:`${t}%`},c={insetInlineEnd:`${100-t}%`},u=(a-t)/100<i?c:s;return v("low-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(u)} ${m(this.lowLabelRef)}>${n}</div>`)}renderHighLabel(){let{rangeLabelType:e,high:l,highPercent:t,labelFlipMax:a}=this,i=l?this.formatLabel(e==="percent"?t/100:l,e):"",n={insetInlineStart:`${t}%`},s={insetInlineEnd:`${100-t}%`},c=t/100>=a?s:n;return v("high-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(c)} ${m(this.highLabelRef)}>${i}</div>`)}renderMaxLabel(){let{rangeLabelType:e,max:l,maxPercent:t}=this,a={insetInlineEnd:`${100-t}%`},i=this.formatLabel(e==="percent"?t/100:l,e);return v("max-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(a)} ${m(this.maxLabelRef)}>${i}</div>`)}render(){let{appearance:e,currentPercent:l,highActive:t,highPercent:a,label:i,lowActive:n,lowPercent:s,max:c,maxPercent:u,min:f,minPercent:o,rangeLabels:g,rangeLabelType:x,unitLabel:$,value:w,valueLabel:P,valueLabelType:R}=this,H=this.formatLabel(l/100,"percent"),I=`${w} ${$}`;return h`<div .ariaLabel=${i} .ariaValueMax=${x==="percent"?u:c} .ariaValueMin=${x==="percent"?o:f} .ariaValueNow=${R==="percent"?l:w} .ariaValueText=${R==="percent"?H:$?I:void 0} class=${b({[r.container]:!0,[r.stepsVisible]:g,[r.valueVisible]:P,[e]:e!=="outline-fill"})} role=meter ${m(this.meterContainerRef)}>${this.renderMeterFill()}${P&&this.renderValueLabel()||""}${n&&this.renderRangeLine(s)||""}${t&&this.renderRangeLine(a)||""}${g&&this.renderMinLabel()||""}${g&&n&&this.renderLowLabel()||""}${g&&t&&this.renderHighLabel()||""}${g&&this.renderMaxLabel()||""}</div>`}};C("calcite-meter",y);export{y as Meter};
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{h as O,k as L}from"./RUMWLVIQ.js";import{c as M,e as F,f as E}from"./U3G47NPB.js";import{a as v}from"./H42LHYUA.js";import"./2DX2SAQ7.js";import{a as T}from"./J2NLU7RP.js";import{a as S}from"./PNBL2IVW.js";import"./D5SFHDV6.js";import{p as V}from"./Z6CRZOOK.js";import"./XRJOD24G.js";import{B as d,C as m,D as k,E as b,F as p,P as C,g as z,h}from"./CSQVLDPF.js";var r={container:"container",fill:"fill",stepLine:"step-line",label:"label",labelHidden:"label-hidden",labelRange:"label-range",labelValue:"label-value",unitLabel:"unit-label",stepsVisible:"steps-visible",valueVisible:"value-visible",success:"fill-success",warning:"fill-warning",danger:"fill-danger"},U=z`: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([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host{display:flex;--calcite-internal-meter-space: var(--calcite-spacing-base);--calcite-internal-meter-height: var(--calcite-spacing-lg);--calcite-internal-meter-font-size: var(--calcite-font-size--1);--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-brand));--calcite-internal-meter-background-color: var(--calcite-meter-background-color, var(--calcite-color-foreground-2));--calcite-internal-meter-border-color: var(--calcite-meter-border-color, var(--calcite-color-border-3));--calcite-internal-meter-shadow: var(--calcite-meter-shadow, var(--calcite-shadow-none));--calcite-internal-meter-corner-radius: var(--calcite-meter-corner-radius, 9999px);--calcite-internal-meter-value-text-color: var(--calcite-meter-value-text-color, var(--calcite-color-text-1));--calcite-internal-meter-range-text-color: var(--calcite-meter-range-text-color, var(--calcite-color-text-3))}:host([scale=s]){--calcite-internal-meter-height: var(--calcite-spacing-md);--calcite-internal-meter-font-size: var(--calcite-font-size--2)}:host([scale=l]){--calcite-internal-meter-height: var(--calcite-spacing-xxl);--calcite-internal-meter-font-size: var(--calcite-font-size-0)}:host([appearance=solid]){--calcite-internal-meter-border-color: var(--calcite-color-foreground-3);--calcite-internal-meter-background-color: var(--calcite-color-foreground-3)}:host([appearance=outline]){--calcite-internal-meter-background-color: transparent}.fill{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-brand))}.fill-danger{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-danger))}.fill-success{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-success))}.fill-warning{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-warning))}.container{position:relative;display:flex;align-items:center;margin:0;inline-size:var(--calcite-container-size-content-fluid);block-size:var(--calcite-internal-meter-height);background-color:var(--calcite-internal-meter-background-color);border:var(--calcite-border-width-sm) solid var(--calcite-internal-meter-border-color);border-radius:var(--calcite-internal-meter-corner-radius);box-shadow:var(--calcite-internal-meter-shadow)}.value-visible{margin-block-start:var(--calcite-spacing-xxl)}.steps-visible{margin-block-end:var(--calcite-spacing-xxl)}.step-line{position:absolute;inset-block:0px;display:block;inline-size:var(--calcite-internal-meter-space);background-color:var(--calcite-internal-meter-border-color)}.label{position:absolute;font-size:var(--calcite-internal-meter-font-size)}.label-hidden{visibility:hidden;opacity:0}.label-value{inset-block-end:calc(100% + .5em);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-internal-meter-value-text-color)}.label-range{color:var(--calcite-internal-meter-range-text-color);inset-block-start:calc(100% + .5em)}.label-range .unit-label{font-weight:var(--calcite-font-weight-medium)}.fill{position:absolute;z-index:var(--calcite-z-index);display:block;transition-timing-function:cubic-bezier(.4,0,.2,1);inset-inline-start:var(--calcite-internal-meter-space);inset-block:var(--calcite-internal-meter-space);border-radius:var(--calcite-internal-meter-corner-radius);max-inline-size:calc(100% - var(--calcite-internal-meter-space) * 2);min-inline-size:calc(var(--calcite-internal-meter-height) - var(--calcite-internal-meter-space) * 2);background-color:var(--calcite-internal-meter-fill-color);transition-property:inline-size,background-color,box-shadow}.solid .fill{inset-block:0;inset-inline-start:0;max-inline-size:100%;min-inline-size:calc(var(--calcite-internal-meter-height));box-shadow:0 0 0 1px var(--calcite-internal-meter-fill-color)}`,y=class extends k{constructor(){super(...arguments),this.highLabelRef=d(),this.labelFlipMax=.8,this.labelFlipProximity=.15,this.lowLabelRef=d(),this.maxLabelRef=d(),this.maxPercent=100,this.messages=S({name:null}),this.meterContainerRef=d(),this.minLabelRef=d(),this.minPercent=0,this.resizeObserver=T("resize",()=>this.resizeHandler()),this.valueLabelRef=d(),this.appearance="outline-fill",this.disabled=!1,this.fillType="range",this.groupSeparator=!1,this.max=100,this.min=0,this.rangeLabelType="percent",this.rangeLabels=!1,this.scale="m",this.unitLabel="",this.valueLabel=!1,this.valueLabelType="percent"}static{this.properties={currentPercent:[16,{},{state:!0}],highActive:[16,{},{state:!0}],highPercent:[16,{},{state:!0}],lowActive:[16,{},{state:!0}],lowPercent:[16,{},{state:!0}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],fillType:[3,{},{reflect:!0}],form:[3,{},{reflect:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],high:[11,{},{reflect:!0,type:Number}],label:1,low:[11,{},{reflect:!0,type:Number}],max:[11,{},{reflect:!0,type:Number}],min:[11,{},{reflect:!0,type:Number}],name:[3,{},{reflect:!0}],numberingSystem:1,rangeLabelType:[3,{},{reflect:!0}],rangeLabels:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],unitLabel:1,value:[9,{},{type:Number}],valueLabel:[7,{},{reflect:!0,type:Boolean}],valueLabelType:[3,{},{reflect:!0}]}}static{this.styles=U}connectedCallback(){super.connectedCallback(),M(this),this.resizeObserver?.observe(this.el)}load(){this.calculateValues(),E(this,this.value)}willUpdate(e){(e.has("min")&&(this.hasUpdated||this.min!==0)||e.has("max")&&(this.hasUpdated||this.max!==100)||e.has("low")||e.has("high")||e.has("value"))&&this.handleRangeChange(),(e.has("rangeLabels")&&(this.hasUpdated||this.rangeLabels!==!1)||e.has("rangeLabelType")&&(this.hasUpdated||this.rangeLabelType!=="percent")||e.has("unitLabel")&&(this.hasUpdated||this.unitLabel!=="")||e.has("valueLabel")&&(this.hasUpdated||this.valueLabel!==!1)||e.has("valueLabelType")&&(this.hasUpdated||this.valueLabelType!=="percent"))&&this.updateLabels()}loaded(){this.updateLabels()}disconnectedCallback(){super.disconnectedCallback(),F(this),this.resizeObserver?.disconnect()}handleRangeChange(){this.calculateValues(),this.updateLabels()}resizeHandler(){this.updateLabels()}updateLabels(){this.valueLabelRef.value&&this.determineValueLabelPosition(),this.rangeLabels&&this.determineVisibleLabels()}calculateValues(){let{min:e,max:l,low:t,high:a,value:i}=this,n=100*(t-e)/(l-e),s=100*(a-e)/(l-e),c=100*(i-e)/(l-e);(!t||t<e||t>a||t>l)&&(this.low=e),(!a||a>l||a<t||a<e)&&(this.high=l),i||(this.value=e),this.lowPercent=n,this.highPercent=s,this.currentPercent=i?c:0,this.lowActive=!!t&&t>e&&(!i||t>i)&&(!a||t<a),this.highActive=!!a&&e<=a&&a<l&&(!i||a>i)&&(!t||a>t)}formatLabel(e,l){if(l==="percent"){if(!this.percentFormatting){let t=O(this.messages._lang),a=new Intl.NumberFormat(t,{useGrouping:this.groupSeparator,style:"percent"});this.percentFormatting={formatter:a,locale:t}}return this.percentFormatting.formatter.format(e)}else return L.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},L.localize(e.toString())}getMeterKindCssClass(){let{low:e,high:l,min:t,max:a,value:i}=this,n=e||t,s=l||a,c=i>=n,u=i<n,f=i>=s,o=i<s;return!i||!e&&o||u?r.success:c&&o?r.warning:f?r.danger:r.success}intersects(e,l){return e&&l&&V(e.getBoundingClientRect(),l.getBoundingClientRect())}determineVisibleLabels(){let{minLabelRef:{value:e},lowLabelRef:{value:l},highLabelRef:{value:t},maxLabelRef:{value:a}}=this,i=this.intersects(t,a),n=this.intersects(l,t),s=this.intersects(l,a),c=this.intersects(e,t),u=this.intersects(e,l),f=this.intersects(e,a),o=r.labelHidden;l&&(u||s||n?l.classList.add(o):l.classList.remove(o)),t&&(c||s||i?t.classList.add(o):t.classList.remove(o)),e&&a&&(f?a.classList.add(o):a.classList.remove(o))}determineValueLabelPosition(){let{valueLabelRef:{value:e},meterContainerRef:{value:l},currentPercent:t}=this,a=t>100?100:t>0?t:0,i=e.getBoundingClientRect().width,n=l.getBoundingClientRect().width,s=100*(i-0)/(n-0);a+s>=100?(e.style.insetInlineEnd="0%",e.style.removeProperty("inset-inline-start")):(e.style.insetInlineStart=`${a}% `,e.style.removeProperty("inset-inline-end"))}renderMeterFill(){let{currentPercent:e,fillType:l}=this,t=this.getMeterKindCssClass();return h`<div class=${b({[r.fill]:!0,[t]:l!=="single"})} style=${p({width:`${e}%`})}></div>`}renderRangeLine(e){let l={insetInlineStart:`${e}%`};return h`<div class=${b(r.stepLine)} style=${p(l)}></div>`}renderValueLabel(){let{currentPercent:e,valueLabelType:l,unitLabel:t,value:a}=this,i=this.formatLabel(l==="percent"?e/100:a||0,l);return v("low-label-line",h`<div class=${b({[r.label]:!0,[r.labelValue]:!0})} ${m(this.valueLabelRef)}>${i}${t&&l!=="percent"&&h`<span class=${b(r.unitLabel)}> ${t}</span>`||""}</div>`)}renderMinLabel(){let{rangeLabelType:e,min:l,minPercent:t,unitLabel:a}=this,i={insetInlineStart:`${t}%`},n=this.formatLabel(e==="percent"?t:l,e);return v("min-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(i)} ${m(this.minLabelRef)}>${n}${a&&e!=="percent"&&h`<span class=${b(r.unitLabel)}> ${a}</span>`||""}</div>`)}renderLowLabel(){let{rangeLabelType:e,low:l,lowPercent:t,highPercent:a,labelFlipProximity:i}=this,n=l?this.formatLabel(e==="percent"?t/100:l,e):"",s={insetInlineStart:`${t}%`},c={insetInlineEnd:`${100-t}%`},u=(a-t)/100<i?c:s;return v("low-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(u)} ${m(this.lowLabelRef)}>${n}</div>`)}renderHighLabel(){let{rangeLabelType:e,high:l,highPercent:t,labelFlipMax:a}=this,i=l?this.formatLabel(e==="percent"?t/100:l,e):"",n={insetInlineStart:`${t}%`},s={insetInlineEnd:`${100-t}%`},c=t/100>=a?s:n;return v("high-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(c)} ${m(this.highLabelRef)}>${i}</div>`)}renderMaxLabel(){let{rangeLabelType:e,max:l,maxPercent:t}=this,a={insetInlineEnd:`${100-t}%`},i=this.formatLabel(e==="percent"?t/100:l,e);return v("max-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(a)} ${m(this.maxLabelRef)}>${i}</div>`)}render(){let{appearance:e,currentPercent:l,highActive:t,highPercent:a,label:i,lowActive:n,lowPercent:s,max:c,maxPercent:u,min:f,minPercent:o,rangeLabels:g,rangeLabelType:x,unitLabel:$,value:w,valueLabel:P,valueLabelType:R}=this,H=this.formatLabel(l/100,"percent"),I=`${w} ${$}`;return h`<div .ariaLabel=${i} .ariaValueMax=${x==="percent"?u:c} .ariaValueMin=${x==="percent"?o:f} .ariaValueNow=${R==="percent"?l:w} .ariaValueText=${R==="percent"?H:$?I:void 0} class=${b({[r.container]:!0,[r.stepsVisible]:g,[r.valueVisible]:P,[e]:e!=="outline-fill"})} role=meter ${m(this.meterContainerRef)}>${this.renderMeterFill()}${P&&this.renderValueLabel()||""}${n&&this.renderRangeLine(s)||""}${t&&this.renderRangeLine(a)||""}${g&&this.renderMinLabel()||""}${g&&n&&this.renderLowLabel()||""}${g&&t&&this.renderHighLabel()||""}${g&&this.renderMaxLabel()||""}</div>`}};C("calcite-meter",y);export{y as Meter};
|
|
@@ -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 S}from"./
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{a as x,b as S}from"./PRB44CR7.js";import{a as y}from"./PNBL2IVW.js";import{a as v}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import"./TLLHA7VC.js";import{a as g}from"./VZVYZPXQ.js";import"./Z6CRZOOK.js";import"./XRJOD24G.js";import{B as u,C as b,D as f,E as p,P as m,g as d,h,l as s,o as l}from"./CSQVLDPF.js";var k={handle:"handle",handleSelected:"handle--selected"},C={drag:"drag"},i={itemLabel:"{itemLabel}",position:"{position}",total:"{total}"},H=d`: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:flex}.handle{display:flex;align-items:center;justify-content:center;align-self:stretch;border-style:none;outline-color:transparent;color:var(--calcite-handle-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-handle-background-color, transparent);padding-block:.75rem;padding-inline:.25rem;line-height:0}.handle calcite-icon{color:inherit}:host(:not([disabled])) .handle{cursor:move}:host(:not([disabled])) .handle:hover{color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2))}:host(:not([disabled])) .handle: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))));color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1))}:host(:not([disabled])) .handle--selected{color:var(--calcite-handle-icon-color-selected, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-selected, var(--calcite-color-foreground-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,o=class extends f{constructor(){super(...arguments),this.handleButtonRef=u(),this.messages=y({blocking:!0}),this.focusSetter=v()(this),this.blurUnselectDisabled=!1,this.disabled=!1,this.selected=!1,this.calciteHandleChange=l({cancelable:!1}),this.calciteHandleNudge=l({cancelable:!1}),this.calciteInternalAssistiveTextChange=l({cancelable:!1})}static{this.properties={blurUnselectDisabled:[5,{},{type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],dragHandle:[3,{},{reflect:!0}],label:1,messageOverrides:[0,{},{attribute:!1}],selected:[7,{},{reflect:!0,type:Boolean}],setPosition:[9,{},{type:Number}],setSize:[9,{},{type:Number}]}}static{this.styles=H}async setFocus(e){return this.focusSetter(()=>this.handleButtonRef.value,e)}willUpdate(e){(e.has("messages")||e.has("label")||e.has("selected")&&(this.hasUpdated||this.selected!==!1)||e.has("setPosition")||e.has("setSize"))&&this.handleAriaTextChange()}updated(){x(this)}loaded(){g.deprecated("component",{name:"handle",removalVersion:4,suggested:"sort-handle"})}handleAriaTextChange(){let e=this.getAriaText("live");e&&this.calciteInternalAssistiveTextChange.emit({message:e})}getTooltip(){let{label:e,messages:t}=this;return t?e?t.dragHandle.replace(i.itemLabel,e):t.dragHandleUntitled:""}getAriaText(e){let{setPosition:t,setSize:c,label:r,messages:a,selected:n}=this;return!a||!r||typeof c!="number"||typeof t!="number"?null:(e==="label"?n?a.dragHandleChange:a.dragHandleIdle:n?a.dragHandleActive:a.dragHandleCommit).replace(i.position,t.toString()).replace(i.itemLabel,r).replace(i.total,c.toString())}handleKeyDown(e){if(!this.disabled)switch(e.key){case" ":this.selected=!this.selected,this.calciteHandleChange.emit(),e.preventDefault();break;case"ArrowUp":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"up"});break;case"ArrowDown":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"down"});break}}handleBlur(){this.blurUnselectDisabled||this.disabled||this.selected&&(this.selected=!1,this.calciteHandleChange.emit())}render(){return S({disabled:this.disabled,children:h`<span .ariaChecked=${this.disabled?null:this.selected} .ariaDisabled=${this.disabled?this.disabled:null} .ariaLabel=${this.disabled?null:this.getAriaText("label")} class=${p({[k.handle]:!0,[k.handleSelected]:!this.disabled&&this.selected})} @blur=${this.handleBlur} @keydown=${this.handleKeyDown} role=radio tabindex=${(this.disabled?null:0)??s} title=${this.getTooltip()??s} ${b(this.handleButtonRef)}><calcite-icon .icon=${C.drag} scale=s></calcite-icon></span>`})}};m("calcite-handle",o);export{o as Handle};
|
|
@@ -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.
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
4
|
function s(r,e,{signal:o,edges:m}={}){let p,t=null,i=m!=null&&m.includes("leading"),x=m==null||m.includes("trailing"),l=()=>{t!==null&&(r.apply(p,t),p=void 0,t=null)},h=()=>{x&&l(),a()},f=null,u=()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,h()},e)},y=()=>{f!==null&&(clearTimeout(f),f=null)},a=()=>{y(),p=void 0,t=null},g=()=>{l()},n=function(...b){if(o?.aborted)return;p=this,t=b;let B=f==null;u(),i&&B&&l()};return n.schedule=u,n.cancel=a,n.flush=g,o?.addEventListener("abort",a,{once:!0}),n}function w(r,e,{signal:o,edges:m=["leading","trailing"]}={}){let p=null,t=s(r,e,{signal:o,edges:m}),i=function(...x){p==null?p=Date.now():Date.now()-p>=e&&(p=Date.now(),t.cancel()),t.apply(this,x)};return i.cancel=t.cancel,i.flush=t.flush,i}function c(r,e){if(e===void 0)return r.trimEnd();let o=r.length;switch(typeof e){case"string":{if(e.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;o>0&&r[o-1]===e;)o--;break}case"object":for(;o>0&&e.includes(r[o-1]);)o--}return r.substring(0,o)}function d(r,e){if(e===void 0)return r.trimStart();let o=0;switch(typeof e){case"string":{for(;o<r.length&&r[o]===e;)o++;break}case"object":for(;o<r.length&&e.includes(r[o]);)o++}return r.substring(o)}function S(r,e){return e===void 0?r.trim():d(c(r,e),e)}function z(r){return r}function D(r){return r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}export{s as a,z as b,w as c,D as d,S as e};
|
|
@@ -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"./KMS2JCWI.js";import{a as y}from"./7WAFUV2T.js";import{a as g}from"./RSQ6RL3K.js";import{a as O}from"./WIJWBGXQ.js";import"./UXWFYSWM.js";import{e as k,l as B,n as p,y as E}from"./SLICSH62.js";import"./DNM3U3Z7.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"./ALOAVLGK.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.4 */
|
|
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};
|
|
@@ -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{k as l}from"./I2EB746H.js";import{a as x,b as z}from"./EU6IVBMM.js";import"./L6HFE67F.js";import{a as y}from"./WIJWBGXQ.js";import{a as f}from"./XWXCOJUO.js";import"./UXWFYSWM.js";import{c as g}from"./JW4SOJWB.js";import"./P2RYGBBZ.js";import{r as v}from"./SLICSH62.js";import"./DNM3U3Z7.js";import{B as d,C as h,D as m,E as t,H as u,P as b,g as n,h as i,l as p,o}from"./ALOAVLGK.js";var r={container:"container",hasSlottedContent:"has-slotted-content",stepperItemContent:"stepper-item-content",stepperItemDescription:"stepper-item-description",stepperItemHeader:"stepper-item-header",stepperItemHeading:"stepper-item-heading",stepperItemHeaderText:"stepper-item-header-text",stepperItemIcon:"stepper-item-icon",stepperItemNumber:"stepper-item-number",visuallyHidden:"visually-hidden"},a={circle:"circle",circleF:"circleF",exclamationMarkCircleF:"exclamationMarkCircleF",checkCircleF:"checkCircleF"},I=n`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]),:host([layout=horizontal][disabled]) .stepper-item-header,:host([layout=horizontal-single][disabled]) .stepper-item-header{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([layout=horizontal][disabled]) .stepper-item-header *,:host([layout=horizontal-single][disabled]) .stepper-item-header *,:host([disabled]) ::slotted(*),:host([layout=horizontal][disabled]) .stepper-item-header ::slotted(*),:host([layout=horizontal-single][disabled]) .stepper-item-header ::slotted(*){pointer-events:none}:host([scale=s]){--calcite-internal-stepper-item-spacing-unit-s: .25rem;--calcite-internal-stepper-item-spacing-unit-m: .75rem;--calcite-internal-stepper-item-spacing-unit-l: 1rem;--calcite-internal-stepper-action-inline-size: 2rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-inline-end:.25rem}:host([scale=s]) .stepper-item-description{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){--calcite-internal-stepper-item-spacing-unit-s: .5rem;--calcite-internal-stepper-item-spacing-unit-m: 1rem;--calcite-internal-stepper-item-spacing-unit-l: 1.25rem;--calcite-internal-stepper-action-inline-size: 2.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-inline-end:.5rem}:host([scale=m]) .stepper-item-description{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){--calcite-internal-stepper-item-spacing-unit-s: .75rem;--calcite-internal-stepper-item-spacing-unit-m: 1.25rem;--calcite-internal-stepper-item-spacing-unit-l: 1.5rem;--calcite-internal-stepper-action-inline-size: 3rem;font-size:var(--calcite-font-size-1);line-height:1.5rem;margin-inline-end:.75rem}:host([scale=l]) .stepper-item-description{font-size:var(--calcite-font-size-0);line-height:1.25rem}:host{position:relative;display:flex;flex-grow:1;flex-direction:column;align-self:flex-start;margin-block-end:var(--calcite-stepper-bar-gap, var(--calcite-internal-stepper-item-spacing-unit-s))}:host .container{position:relative;display:flex;flex-grow:1;cursor:pointer;flex-direction:column;border-width:0px;border-block-start-width:2px;border-style:solid;border-color:var(--calcite-color-border-3);color:var(--calcite-color-text-3);text-decoration-line:none;outline:2px solid transparent;outline-offset:2px}:host .container:active{background-color:var(--calcite-stepper-item-background-color-press, var(--calcite-color-foreground-3))}:host{outline-color:transparent}:host(: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))))}:host .stepper-item-header{display:flex;cursor:pointer;align-items:flex-start}:host .stepper-item-header:active{background-color:var(--calcite-stepper-item-background-color-press, var(--calcite-color-foreground-3))}:host .stepper-item-content,:host .stepper-item-header{padding-block:var(--calcite-internal-stepper-item-spacing-unit-l);padding-inline-end:var(--calcite-internal-stepper-item-spacing-unit-m);text-align:start}:host .stepper-item-header *{display:inline-flex;align-items:center}:host .stepper-item-content{display:none;inline-size:100%;flex-direction:column;font-size:var(--calcite-font-size--2);line-height:1.375}:host .stepper-item-icon{margin-inline-end:var(--calcite-internal-stepper-item-spacing-unit-m);margin-block-start:1px;display:inline-flex;block-size:.75rem;flex-shrink:0;align-self:flex-start;color:var(--calcite-stepper-item-icon-color, var(--calcite-color-border-input))}:host([complete]) .stepper-item-icon{opacity:var(--calcite-opacity-disabled)}:host .stepper-item-header-text{flex-direction:column;text-align:initial;margin-inline-end:auto}:host .stepper-item-heading,:host .stepper-item-description{display:flex;inline-size:100%}:host .stepper-item-heading{margin-block-end:.25rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-stepper-item-header-text-color, var(--calcite-color-text-2))}:host .stepper-item-description{color:var(--calcite-stepper-item-description-text-color, var(--calcite-color-text-3))}:host .stepper-item-number{font-weight:var(--calcite-font-weight-medium);margin-inline-end:var(--calcite-internal-stepper-item-spacing-unit-m);color:var(--calcite-stepper-item-description-text-color, var(--calcite-color-text-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([complete]) .container{border-color:#007ac280}:host([complete]) .container .stepper-item-icon{color:var(--calcite-stepper-item-complete-icon-color, var(--calcite-color-brand))}:host([error]) .container{border-block-start-color:var(--calcite-color-status-danger)}:host([error]) .container .stepper-item-number{color:var(--calcite-stepper-item-error-icon-color, var(--calcite-color-status-danger))}:host([error]) .container .stepper-item-icon{opacity:1;color:var(--calcite-stepper-item-error-icon-color, var(--calcite-color-status-danger))}:host(:hover:not([disabled]):not([selected])) .container,:host(:focus:not([disabled]):not([selected])) .container{border-block-start-color:var(--calcite-color-brand)}:host(:hover:not([disabled]):not([selected])) .container .stepper-item-heading,:host(:focus:not([disabled]):not([selected])) .container .stepper-item-heading{color:var(--calcite-stepper-item-header-text-color-hover, var(--calcite-color-text-1))}:host(:hover:not([disabled]):not([selected])) .container .stepper-item-description,:host(:focus:not([disabled]):not([selected])) .container .stepper-item-description{color:var(--calcite-stepper-item-description-text-color-hover, var(--calcite-color-text-2))}:host([error]:hover:not([disabled]):not([selected])) .container,:host([error]:focus:not([disabled]):not([selected])) .container{border-block-start-color:var(--calcite-color-status-danger-hover)}:host([selected]) .container{border-block-start-color:var(--calcite-color-brand)}:host([selected]) .container .stepper-item-heading{color:var(--calcite-stepper-item-selected-header-text-color, var(--calcite-color-text-1))}:host([selected]) .container .stepper-item-description{color:var(--calcite-stepper-item-description-text-color-hover, var(--calcite-color-text-2))}:host([selected]) .container .stepper-item-number{color:var(--calcite-stepper-item-selected-icon-color, var(--calcite-color-brand))}:host([selected]) .container .stepper-item-icon{color:var(--calcite-stepper-item-selected-icon-color, var(--calcite-color-brand));opacity:1}:host([selected]) .container .stepper-item-content{display:flex}:host([layout=vertical]){inline-size:100%}:host([layout=vertical]) .container{margin-inline:0px;margin-block-start:0px;flex:1 1 auto;border-block-start-width:0px;border-style:solid;padding-block:0px;border-inline-start-width:2px;padding-inline-start:var(--calcite-internal-stepper-item-spacing-unit-l);border-color:var(--calcite-stepper-bar-fill-color, var(--calcite-color-border-2))}:host([layout=vertical]) .container .stepper-item-icon{order:3;margin-block:1px 0px;padding-inline-start:var(--calcite-internal-stepper-item-spacing-unit-s);margin-inline-start:auto}:host([layout=vertical]) .container .stepper-item-header{padding-inline-end:0px}:host([layout=vertical]) .container .stepper-item-content{padding:0}:host([layout=vertical][complete]) .container{border-color:var(--calcite-stepper-bar-complete-fill-color, rgba(0, 122, 194, .5))}:host([layout=vertical][complete]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical][complete]:focus:not([disabled]):not([selected])) .container{border-color:var(--calcite-stepper-bar-complete-fill-color-hover, var(--calcite-color-brand))}:host([layout=vertical][error]) .container{border-color:var(--calcite-stepper-bar-error-fill-color, var(--calcite-color-status-danger))}:host([layout=vertical][selected]) .container{border-color:var(--calcite-stepper-bar-selected-fill-color, var(--calcite-color-brand))}:host([layout=vertical][selected]) .container .stepper-item-content.has-slotted-content{margin-block-end:var(--calcite-internal-stepper-item-spacing-unit-l)}:host([layout=vertical]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical]:focus:not([disabled]):not([selected])) .container{border-color:var(--calcite-stepper-bar-fill-color-hover, rgba(0, 122, 194, .5))}:host([layout=vertical][error]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical][error]:focus:not([disabled]):not([selected])) .container{border-color:var(--calcite-stepper-bar-error-fill-color-hover, var(--calcite-color-status-danger-hover))}:host([layout=horizontal]),:host([layout=horizontal-single]){display:contents}:host([layout=horizontal]) .container,:host([layout=horizontal-single]) .container{display:contents}:host([layout=horizontal]) .stepper-item-header,:host([layout=horizontal-single]) .stepper-item-header{border-width:0px;border-block-start-width:2px;border-style:solid;outline-color:transparent;grid-row:items;border-color:var(--calcite-stepper-bar-fill-color, var(--calcite-color-border-2))}:host([layout=horizontal]) .stepper-item-header:focus,:host([layout=horizontal-single]) .stepper-item-header: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))))}:host([layout=horizontal]) .stepper-item-content,:host([layout=horizontal-single]) .stepper-item-content{cursor:auto;transition-timing-function:cubic-bezier(.4,0,.2,1);padding-block:0;padding-inline-end:var(--calcite-internal-stepper-item-spacing-unit-m);text-align:start}:host([layout=horizontal-single]) .stepper-item-header{grid-area:1/1/1/-1}:host([layout=horizontal]) .stepper-item-content,:host([layout=horizontal-single]) .stepper-item-content{grid-area:2/1/2/-1}:host([layout=horizontal][complete]) .stepper-item-header,:host([layout=horizontal-single][complete]) .stepper-item-header{border-color:var(--calcite-stepper-bar-complete-fill-color, rgba(0, 122, 194, .5))}:host([layout=horizontal][complete]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal][complete]:focus:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single][complete]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single][complete]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:var(--calcite-stepper-bar-complete-fill-color-hover, var(--calcite-color-brand))}:host([layout=horizontal][error]) .stepper-item-header,:host([layout=horizontal-single][error]) .stepper-item-header{border-color:var(--calcite-stepper-bar-error-fill-color, var(--calcite-color-status-danger))}:host([layout=horizontal][selected]) .stepper-item-header,:host([layout=horizontal-single][selected]) .stepper-item-header{border-color:var(--calcite-stepper-bar-selected-fill-color, var(--calcite-color-brand))}:host([layout=horizontal]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal]:focus:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:var(--calcite-stepper-bar-fill-color-hover, rgba(0, 122, 194, .5))}:host([layout=horizontal][error]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal][error]:focus:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single][error]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single][error]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:var(--calcite-stepper-bar-error-fill-color-hover, var(--calcite-color-status-danger-hover))}@media(forced-colors:active){:host .container{outline-width:0;outline-offset:0}:host(:focus),:host(:focus-visible){outline-color:canvasText}:host([selected]) .container{border-block-start-color:highlight}:host([selected]) .container .stepper-item-number{color:highlight}:host([selected]) .container .stepper-item-icon{color:highlight}:host([layout=vertical][selected]) .container{border-color:highlight}}:host([layout=horizontal-single]) .stepper-item-header{margin-inline-end:0px;box-sizing:border-box;border-style:none;inline-size:100%;padding-inline:calc(var(--calcite-internal-stepper-action-inline-size) + .5rem)}:host([layout=horizontal-single][error]) .container .stepper-item-number{color:var(--calcite-stepper-item-error-icon-color, var(--calcite-color-status-danger))}:host([layout=horizontal-single][error]) .container .stepper-item-icon{opacity:1;color:var(--calcite-stepper-item-error-icon-color, var(--calcite-color-status-danger))}:host([layout=horizontal-single][error][selected]),:host([layout=horizontal-single][complete][selected]) .container{color:var(--calcite-color-text-3)}:host([layout=horizontal-single][error][selected]) .stepper-item-heading,:host([layout=horizontal-single][complete][selected]) .container .stepper-item-heading{color:var(--calcite-stepper-item-header-text-color, var(--calcite-color-text-2))}:host([layout=horizontal-single][complete][selected]) .container .stepper-item-icon{opacity:var(--calcite-opacity-disabled)}:host([layout=horizontal-single][complete][selected]) .container .stepper-item-number{color:var(--calcite-stepper-item-selected-icon-color, var(--calcite-color-text-3))}.visually-hidden{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}:host([item-hidden]){display:none}`,c=class extends m{constructor(){super(),this.headerRef=d(),this.messages=y(),this.focusSetter=f()(this),this.complete=!1,this.disabled=!1,this.error=!1,this.icon=!1,this.iconFlipRtl=!1,this.itemHidden=!1,this.numbered=!1,this.scale="m",this.selected=!1,this.calciteInternalStepperItemKeyEvent=o({cancelable:!1}),this.calciteInternalStepperItemRegister=o({cancelable:!1}),this.calciteInternalStepperItemSelect=o({cancelable:!1}),this.calciteStepperItemSelect=o({cancelable:!1}),this.listenOn(document.body,"calciteInternalStepperItemChange",this.updateActiveItemOnChange),this.listen("click",this.handleItemClick),this.listen("keydown",this.keyDownHandler)}static{this.properties={stepperItemHasContent:[16,{},{state:!0}],complete:[7,{},{reflect:!0,type:Boolean}],description:1,disabled:[7,{},{reflect:!0,type:Boolean}],error:[7,{},{reflect:!0,type:Boolean}],heading:1,icon:[5,{},{type:Boolean}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],itemHidden:[7,{},{reflect:!0,type:Boolean}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],numbered:[5,{},{type:Boolean}],numberingSystem:1,scale:[3,{},{reflect:!0}],selected:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=I}async setFocus(e){return this.focusSetter(()=>this.layout==="vertical"?this.el:this.headerRef.value,e)}async load(){this.parentStepperEl=this.el.parentElement,this.itemPosition=this.getItemPosition(),this.registerStepperItem(),this.selected&&this.emitRequestedItem()}willUpdate(e){e.has("selected")&&(this.hasUpdated||this.selected!==!1)&&this.selectedHandler(),e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.registerStepperItem(),e.has("messages")&&this.effectiveLocaleWatcher(this.messages._lang)}updated(){x(this),u(this.el,"tabindex",this.disabled||this.layout==="horizontal"?null:0)}selectedHandler(){this.selected&&this.emitRequestedItem()}effectiveLocaleWatcher(e){l.numberFormatOptions={locale:e,numberingSystem:this.numberingSystem,useGrouping:!1}}updateActiveItemOnChange(e){(e.target===this.parentStepperEl||e.composedPath().includes(this.parentStepperEl))&&(this.selectedPosition=e.detail.position,this.determineSelectedItem())}keyDownHandler(e){if(!this.disabled&&e.target===this.el)switch(e.key){case" ":case"Enter":this.emitUserRequestedItem(),e.preventDefault();break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Home":case"End":this.calciteInternalStepperItemKeyEvent.emit({item:e}),e.preventDefault();break}}determineSelectedItem(){this.selected=!this.disabled&&this.itemPosition===this.selectedPosition}registerStepperItem(){this.calciteInternalStepperItemRegister.emit({position:this.itemPosition})}handleItemClick(e){this.disabled||g(this.el)||this.layout==="horizontal"&&e.composedPath().some(s=>s.classList?.contains("stepper-item-content"))||this.emitUserRequestedItem()}emitUserRequestedItem(){this.emitRequestedItem(),this.disabled||this.calciteStepperItemSelect.emit()}emitRequestedItem(){if(!this.disabled){let e=this.itemPosition;this.calciteInternalStepperItemSelect.emit({position:e})}}getItemPosition(){return Array.from(this.parentStepperEl?.querySelectorAll("calcite-stepper-item:not([hidden]):not([item-hidden])")).indexOf(this.el)}render(){this.el.ariaCurrent=this.selected?"step":"false";let e=this.layout==="horizontal"&&!this.disabled?0:null;return z({disabled:this.disabled,children:i`<div class=${t(r.container)}>${this.complete&&i`<span aria-live=polite class=${t(r.visuallyHidden)}>${this.messages.complete}</span>`||""}<div class=${t(r.stepperItemHeader)} tabindex=${e??p} ${h(this.headerRef)}>${this.icon?this.renderIcon():null}${this.numbered?i`<div class=${t(r.stepperItemNumber)}>${this.renderNumbers()}.</div>`:null}<div class=${t(r.stepperItemHeaderText)}><span class=${t(r.stepperItemHeading)}>${this.heading}</span><span class=${t(r.stepperItemDescription)}>${this.description}</span></div></div><div class=${t({[r.stepperItemContent]:!0,[r.hasSlottedContent]:this.stepperItemHasContent})}><slot @slotchange=${s=>this.stepperItemHasContent=v(s)}></slot></div></div>`})}renderIcon(){let e=a.circle;return this.selected&&(this.layout!=="horizontal-single"||!this.error&&!this.complete)?e=a.circleF:this.error?e=a.exclamationMarkCircleF:this.complete&&(e=a.checkCircleF),i`<calcite-icon class=${t(r.stepperItemIcon)} .flipRtl=${this.iconFlipRtl} .icon=${e} scale=s></calcite-icon>`}renderNumbers(){return l.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:!1},l.numberFormatter.format(this.itemPosition+1)}};b("calcite-stepper-item",c);export{c as StepperItem};
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{k as l}from"./RUMWLVIQ.js";import{a as x,b as z}from"./PRB44CR7.js";import"./2DX2SAQ7.js";import{a as y}from"./PNBL2IVW.js";import{a as f}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import{c as g}from"./TLLHA7VC.js";import"./VZVYZPXQ.js";import{r as v}from"./Z6CRZOOK.js";import"./XRJOD24G.js";import{B as d,C as h,D as m,E as t,H as u,P as b,g as n,h as i,l as p,o}from"./CSQVLDPF.js";var r={container:"container",hasSlottedContent:"has-slotted-content",stepperItemContent:"stepper-item-content",stepperItemDescription:"stepper-item-description",stepperItemHeader:"stepper-item-header",stepperItemHeading:"stepper-item-heading",stepperItemHeaderText:"stepper-item-header-text",stepperItemIcon:"stepper-item-icon",stepperItemNumber:"stepper-item-number",visuallyHidden:"visually-hidden"},a={circle:"circle",circleF:"circleF",exclamationMarkCircleF:"exclamationMarkCircleF",checkCircleF:"checkCircleF"},I=n`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]),:host([layout=horizontal][disabled]) .stepper-item-header,:host([layout=horizontal-single][disabled]) .stepper-item-header{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([layout=horizontal][disabled]) .stepper-item-header *,:host([layout=horizontal-single][disabled]) .stepper-item-header *,:host([disabled]) ::slotted(*),:host([layout=horizontal][disabled]) .stepper-item-header ::slotted(*),:host([layout=horizontal-single][disabled]) .stepper-item-header ::slotted(*){pointer-events:none}:host([scale=s]){--calcite-internal-stepper-item-spacing-unit-s: .25rem;--calcite-internal-stepper-item-spacing-unit-m: .75rem;--calcite-internal-stepper-item-spacing-unit-l: 1rem;--calcite-internal-stepper-action-inline-size: 2rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-inline-end:.25rem}:host([scale=s]) .stepper-item-description{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){--calcite-internal-stepper-item-spacing-unit-s: .5rem;--calcite-internal-stepper-item-spacing-unit-m: 1rem;--calcite-internal-stepper-item-spacing-unit-l: 1.25rem;--calcite-internal-stepper-action-inline-size: 2.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-inline-end:.5rem}:host([scale=m]) .stepper-item-description{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){--calcite-internal-stepper-item-spacing-unit-s: .75rem;--calcite-internal-stepper-item-spacing-unit-m: 1.25rem;--calcite-internal-stepper-item-spacing-unit-l: 1.5rem;--calcite-internal-stepper-action-inline-size: 3rem;font-size:var(--calcite-font-size-1);line-height:1.5rem;margin-inline-end:.75rem}:host([scale=l]) .stepper-item-description{font-size:var(--calcite-font-size-0);line-height:1.25rem}:host{position:relative;display:flex;flex-grow:1;flex-direction:column;align-self:flex-start;margin-block-end:var(--calcite-stepper-bar-gap, var(--calcite-internal-stepper-item-spacing-unit-s))}:host .container{position:relative;display:flex;flex-grow:1;cursor:pointer;flex-direction:column;border-width:0px;border-block-start-width:2px;border-style:solid;border-color:var(--calcite-color-border-3);color:var(--calcite-color-text-3);text-decoration-line:none;outline:2px solid transparent;outline-offset:2px}:host .container:active{background-color:var(--calcite-stepper-item-background-color-press, var(--calcite-color-foreground-3))}:host{outline-color:transparent}:host(: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))))}:host .stepper-item-header{display:flex;cursor:pointer;align-items:flex-start}:host .stepper-item-header:active{background-color:var(--calcite-stepper-item-background-color-press, var(--calcite-color-foreground-3))}:host .stepper-item-content,:host .stepper-item-header{padding-block:var(--calcite-internal-stepper-item-spacing-unit-l);padding-inline-end:var(--calcite-internal-stepper-item-spacing-unit-m);text-align:start}:host .stepper-item-header *{display:inline-flex;align-items:center}:host .stepper-item-content{display:none;inline-size:100%;flex-direction:column;font-size:var(--calcite-font-size--2);line-height:1.375}:host .stepper-item-icon{margin-inline-end:var(--calcite-internal-stepper-item-spacing-unit-m);margin-block-start:1px;display:inline-flex;block-size:.75rem;flex-shrink:0;align-self:flex-start;color:var(--calcite-stepper-item-icon-color, var(--calcite-color-border-input))}:host([complete]) .stepper-item-icon{opacity:var(--calcite-opacity-disabled)}:host .stepper-item-header-text{flex-direction:column;text-align:initial;margin-inline-end:auto}:host .stepper-item-heading,:host .stepper-item-description{display:flex;inline-size:100%}:host .stepper-item-heading{margin-block-end:.25rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-stepper-item-header-text-color, var(--calcite-color-text-2))}:host .stepper-item-description{color:var(--calcite-stepper-item-description-text-color, var(--calcite-color-text-3))}:host .stepper-item-number{font-weight:var(--calcite-font-weight-medium);margin-inline-end:var(--calcite-internal-stepper-item-spacing-unit-m);color:var(--calcite-stepper-item-description-text-color, var(--calcite-color-text-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([complete]) .container{border-color:#007ac280}:host([complete]) .container .stepper-item-icon{color:var(--calcite-stepper-item-complete-icon-color, var(--calcite-color-brand))}:host([error]) .container{border-block-start-color:var(--calcite-color-status-danger)}:host([error]) .container .stepper-item-number{color:var(--calcite-stepper-item-error-icon-color, var(--calcite-color-status-danger))}:host([error]) .container .stepper-item-icon{opacity:1;color:var(--calcite-stepper-item-error-icon-color, var(--calcite-color-status-danger))}:host(:hover:not([disabled]):not([selected])) .container,:host(:focus:not([disabled]):not([selected])) .container{border-block-start-color:var(--calcite-color-brand)}:host(:hover:not([disabled]):not([selected])) .container .stepper-item-heading,:host(:focus:not([disabled]):not([selected])) .container .stepper-item-heading{color:var(--calcite-stepper-item-header-text-color-hover, var(--calcite-color-text-1))}:host(:hover:not([disabled]):not([selected])) .container .stepper-item-description,:host(:focus:not([disabled]):not([selected])) .container .stepper-item-description{color:var(--calcite-stepper-item-description-text-color-hover, var(--calcite-color-text-2))}:host([error]:hover:not([disabled]):not([selected])) .container,:host([error]:focus:not([disabled]):not([selected])) .container{border-block-start-color:var(--calcite-color-status-danger-hover)}:host([selected]) .container{border-block-start-color:var(--calcite-color-brand)}:host([selected]) .container .stepper-item-heading{color:var(--calcite-stepper-item-selected-header-text-color, var(--calcite-color-text-1))}:host([selected]) .container .stepper-item-description{color:var(--calcite-stepper-item-description-text-color-hover, var(--calcite-color-text-2))}:host([selected]) .container .stepper-item-number{color:var(--calcite-stepper-item-selected-icon-color, var(--calcite-color-brand))}:host([selected]) .container .stepper-item-icon{color:var(--calcite-stepper-item-selected-icon-color, var(--calcite-color-brand));opacity:1}:host([selected]) .container .stepper-item-content{display:flex}:host([layout=vertical]){inline-size:100%}:host([layout=vertical]) .container{margin-inline:0px;margin-block-start:0px;flex:1 1 auto;border-block-start-width:0px;border-style:solid;padding-block:0px;border-inline-start-width:2px;padding-inline-start:var(--calcite-internal-stepper-item-spacing-unit-l);border-color:var(--calcite-stepper-bar-fill-color, var(--calcite-color-border-2))}:host([layout=vertical]) .container .stepper-item-icon{order:3;margin-block:1px 0px;padding-inline-start:var(--calcite-internal-stepper-item-spacing-unit-s);margin-inline-start:auto}:host([layout=vertical]) .container .stepper-item-header{padding-inline-end:0px}:host([layout=vertical]) .container .stepper-item-content{padding:0}:host([layout=vertical][complete]) .container{border-color:var(--calcite-stepper-bar-complete-fill-color, rgba(0, 122, 194, .5))}:host([layout=vertical][complete]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical][complete]:focus:not([disabled]):not([selected])) .container{border-color:var(--calcite-stepper-bar-complete-fill-color-hover, var(--calcite-color-brand))}:host([layout=vertical][error]) .container{border-color:var(--calcite-stepper-bar-error-fill-color, var(--calcite-color-status-danger))}:host([layout=vertical][selected]) .container{border-color:var(--calcite-stepper-bar-selected-fill-color, var(--calcite-color-brand))}:host([layout=vertical][selected]) .container .stepper-item-content.has-slotted-content{margin-block-end:var(--calcite-internal-stepper-item-spacing-unit-l)}:host([layout=vertical]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical]:focus:not([disabled]):not([selected])) .container{border-color:var(--calcite-stepper-bar-fill-color-hover, rgba(0, 122, 194, .5))}:host([layout=vertical][error]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical][error]:focus:not([disabled]):not([selected])) .container{border-color:var(--calcite-stepper-bar-error-fill-color-hover, var(--calcite-color-status-danger-hover))}:host([layout=horizontal]),:host([layout=horizontal-single]){display:contents}:host([layout=horizontal]) .container,:host([layout=horizontal-single]) .container{display:contents}:host([layout=horizontal]) .stepper-item-header,:host([layout=horizontal-single]) .stepper-item-header{border-width:0px;border-block-start-width:2px;border-style:solid;outline-color:transparent;grid-row:items;border-color:var(--calcite-stepper-bar-fill-color, var(--calcite-color-border-2))}:host([layout=horizontal]) .stepper-item-header:focus,:host([layout=horizontal-single]) .stepper-item-header: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))))}:host([layout=horizontal]) .stepper-item-content,:host([layout=horizontal-single]) .stepper-item-content{cursor:auto;transition-timing-function:cubic-bezier(.4,0,.2,1);padding-block:0;padding-inline-end:var(--calcite-internal-stepper-item-spacing-unit-m);text-align:start}:host([layout=horizontal-single]) .stepper-item-header{grid-area:1/1/1/-1}:host([layout=horizontal]) .stepper-item-content,:host([layout=horizontal-single]) .stepper-item-content{grid-area:2/1/2/-1}:host([layout=horizontal][complete]) .stepper-item-header,:host([layout=horizontal-single][complete]) .stepper-item-header{border-color:var(--calcite-stepper-bar-complete-fill-color, rgba(0, 122, 194, .5))}:host([layout=horizontal][complete]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal][complete]:focus:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single][complete]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single][complete]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:var(--calcite-stepper-bar-complete-fill-color-hover, var(--calcite-color-brand))}:host([layout=horizontal][error]) .stepper-item-header,:host([layout=horizontal-single][error]) .stepper-item-header{border-color:var(--calcite-stepper-bar-error-fill-color, var(--calcite-color-status-danger))}:host([layout=horizontal][selected]) .stepper-item-header,:host([layout=horizontal-single][selected]) .stepper-item-header{border-color:var(--calcite-stepper-bar-selected-fill-color, var(--calcite-color-brand))}:host([layout=horizontal]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal]:focus:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:var(--calcite-stepper-bar-fill-color-hover, rgba(0, 122, 194, .5))}:host([layout=horizontal][error]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal][error]:focus:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single][error]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal-single][error]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:var(--calcite-stepper-bar-error-fill-color-hover, var(--calcite-color-status-danger-hover))}@media(forced-colors:active){:host .container{outline-width:0;outline-offset:0}:host(:focus),:host(:focus-visible){outline-color:canvasText}:host([selected]) .container{border-block-start-color:highlight}:host([selected]) .container .stepper-item-number{color:highlight}:host([selected]) .container .stepper-item-icon{color:highlight}:host([layout=vertical][selected]) .container{border-color:highlight}}:host([layout=horizontal-single]) .stepper-item-header{margin-inline-end:0px;box-sizing:border-box;border-style:none;inline-size:100%;padding-inline:calc(var(--calcite-internal-stepper-action-inline-size) + .5rem)}:host([layout=horizontal-single][error]) .container .stepper-item-number{color:var(--calcite-stepper-item-error-icon-color, var(--calcite-color-status-danger))}:host([layout=horizontal-single][error]) .container .stepper-item-icon{opacity:1;color:var(--calcite-stepper-item-error-icon-color, var(--calcite-color-status-danger))}:host([layout=horizontal-single][error][selected]),:host([layout=horizontal-single][complete][selected]) .container{color:var(--calcite-color-text-3)}:host([layout=horizontal-single][error][selected]) .stepper-item-heading,:host([layout=horizontal-single][complete][selected]) .container .stepper-item-heading{color:var(--calcite-stepper-item-header-text-color, var(--calcite-color-text-2))}:host([layout=horizontal-single][complete][selected]) .container .stepper-item-icon{opacity:var(--calcite-opacity-disabled)}:host([layout=horizontal-single][complete][selected]) .container .stepper-item-number{color:var(--calcite-stepper-item-selected-icon-color, var(--calcite-color-text-3))}.visually-hidden{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}:host([item-hidden]){display:none}`,c=class extends m{constructor(){super(),this.headerRef=d(),this.messages=y(),this.focusSetter=f()(this),this.complete=!1,this.disabled=!1,this.error=!1,this.icon=!1,this.iconFlipRtl=!1,this.itemHidden=!1,this.numbered=!1,this.scale="m",this.selected=!1,this.calciteInternalStepperItemKeyEvent=o({cancelable:!1}),this.calciteInternalStepperItemRegister=o({cancelable:!1}),this.calciteInternalStepperItemSelect=o({cancelable:!1}),this.calciteStepperItemSelect=o({cancelable:!1}),this.listenOn(document.body,"calciteInternalStepperItemChange",this.updateActiveItemOnChange),this.listen("click",this.handleItemClick),this.listen("keydown",this.keyDownHandler)}static{this.properties={stepperItemHasContent:[16,{},{state:!0}],complete:[7,{},{reflect:!0,type:Boolean}],description:1,disabled:[7,{},{reflect:!0,type:Boolean}],error:[7,{},{reflect:!0,type:Boolean}],heading:1,icon:[5,{},{type:Boolean}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],itemHidden:[7,{},{reflect:!0,type:Boolean}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],numbered:[5,{},{type:Boolean}],numberingSystem:1,scale:[3,{},{reflect:!0}],selected:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=I}async setFocus(e){return this.focusSetter(()=>this.layout==="vertical"?this.el:this.headerRef.value,e)}async load(){this.parentStepperEl=this.el.parentElement,this.itemPosition=this.getItemPosition(),this.registerStepperItem(),this.selected&&this.emitRequestedItem()}willUpdate(e){e.has("selected")&&(this.hasUpdated||this.selected!==!1)&&this.selectedHandler(),e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.registerStepperItem(),e.has("messages")&&this.effectiveLocaleWatcher(this.messages._lang)}updated(){x(this),u(this.el,"tabindex",this.disabled||this.layout==="horizontal"?null:0)}selectedHandler(){this.selected&&this.emitRequestedItem()}effectiveLocaleWatcher(e){l.numberFormatOptions={locale:e,numberingSystem:this.numberingSystem,useGrouping:!1}}updateActiveItemOnChange(e){(e.target===this.parentStepperEl||e.composedPath().includes(this.parentStepperEl))&&(this.selectedPosition=e.detail.position,this.determineSelectedItem())}keyDownHandler(e){if(!this.disabled&&e.target===this.el)switch(e.key){case" ":case"Enter":this.emitUserRequestedItem(),e.preventDefault();break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Home":case"End":this.calciteInternalStepperItemKeyEvent.emit({item:e}),e.preventDefault();break}}determineSelectedItem(){this.selected=!this.disabled&&this.itemPosition===this.selectedPosition}registerStepperItem(){this.calciteInternalStepperItemRegister.emit({position:this.itemPosition})}handleItemClick(e){this.disabled||g(this.el)||this.layout==="horizontal"&&e.composedPath().some(s=>s.classList?.contains("stepper-item-content"))||this.emitUserRequestedItem()}emitUserRequestedItem(){this.emitRequestedItem(),this.disabled||this.calciteStepperItemSelect.emit()}emitRequestedItem(){if(!this.disabled){let e=this.itemPosition;this.calciteInternalStepperItemSelect.emit({position:e})}}getItemPosition(){return Array.from(this.parentStepperEl?.querySelectorAll("calcite-stepper-item:not([hidden]):not([item-hidden])")).indexOf(this.el)}render(){this.el.ariaCurrent=this.selected?"step":"false";let e=this.layout==="horizontal"&&!this.disabled?0:null;return z({disabled:this.disabled,children:i`<div class=${t(r.container)}>${this.complete&&i`<span aria-live=polite class=${t(r.visuallyHidden)}>${this.messages.complete}</span>`||""}<div class=${t(r.stepperItemHeader)} tabindex=${e??p} ${h(this.headerRef)}>${this.icon?this.renderIcon():null}${this.numbered?i`<div class=${t(r.stepperItemNumber)}>${this.renderNumbers()}.</div>`:null}<div class=${t(r.stepperItemHeaderText)}><span class=${t(r.stepperItemHeading)}>${this.heading}</span><span class=${t(r.stepperItemDescription)}>${this.description}</span></div></div><div class=${t({[r.stepperItemContent]:!0,[r.hasSlottedContent]:this.stepperItemHasContent})}><slot @slotchange=${s=>this.stepperItemHasContent=v(s)}></slot></div></div>`})}renderIcon(){let e=a.circle;return this.selected&&(this.layout!=="horizontal-single"||!this.error&&!this.complete)?e=a.circleF:this.error?e=a.exclamationMarkCircleF:this.complete&&(e=a.checkCircleF),i`<calcite-icon class=${t(r.stepperItemIcon)} .flipRtl=${this.iconFlipRtl} .icon=${e} scale=s></calcite-icon>`}renderNumbers(){return l.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:!1},l.numberFormatter.format(this.itemPosition+1)}};b("calcite-stepper-item",c);export{c as StepperItem};
|
|
@@ -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 S}from"./
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{a as S}from"./HKVRX5SD.js";import"./D5SFHDV6.js";import"./TLLHA7VC.js";import"./VZVYZPXQ.js";import{t as n}from"./Z6CRZOOK.js";import"./XRJOD24G.js";import{B as m,C as h,D as d,E as o,P as g,g as l,h as s,o as c}from"./CSQVLDPF.js";var a={container:"container",containerContent:"container-content",hasProgress:"progress-bar",hide:"hide",primary:"primary",secondary:"secondary",tertiary:"tertiary"},e={logo:"logo",user:"user",progress:"progress",navigationAction:"navigation-action",contentStart:"content-start",contentEnd:"content-end",contentCenter:"content-center",navSecondary:"navigation-secondary",navTertiary:"navigation-tertiary"},y={hamburger:"hamburger"},u=l`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([hidden]){display:none}[hidden]{display:none}:host{display:block}.container{display:flex;inline-size:100%;flex-direction:column;margin-block:0;margin-inline:auto;background-color:var(--calcite-navigation-background-color, var(--calcite-navigation-background, var(--calcite-color-foreground-1)))}.container.primary,.container.secondary,.container.tertiary{border-block-end:1px solid;border-block-end-color:var(--calcite-navigation-border-color, var(--calcite-color-border-3))}.user,.logo{display:flex}.hide{display:none}.primary{block-size:4rem}.secondary,.tertiary{block-size:3rem}.container-content{margin-inline:auto;display:flex;block-size:100%;inline-size:100%;margin-block:0;inline-size:var(--calcite-navigation-width, 100%);max-inline-size:100%}.container-content.progress-bar{margin-block-start:.125rem}slot[name]{display:flex;flex-direction:row}slot[name=navigation-secondary]::slotted(calcite-navigation),slot[name=navigation-tertiary]::slotted(calcite-navigation){inline-size:100%}slot[name=content-start]::slotted(*),slot[name=content-center]::slotted(*),slot[name=content-end]::slotted(*){display:flex;flex-direction:row;align-items:center}slot[name=progress],slot[name=progress] calcite-progress{inset-block-start:0;inset-inline:0}slot[name=content-end]{margin-inline-start:auto}slot[name=content-start]{margin-inline-end:auto}slot[name=content-end],slot[name=logo]~slot[name=user],slot[name=user]:only-child{margin-inline-start:auto}slot[name=content-center]{margin-inline-start:auto;margin-inline-end:auto}slot[name=content-start]~slot[name=content-center]{margin-inline-start:0px}slot[name=content-start]~slot[name=content-end],slot[name=content-center]~slot[name=content-end],slot[name=content-center]~slot[name=user],slot[name=content-end]~slot[name=user]{margin:0}`,i=class extends d{constructor(){super(...arguments),this.navigationActionRef=m(),this.focusSetter=S()(this),this.navigationAction=!1,this.calciteNavigationActionSelect=c({cancelable:!1})}static{this.properties={logoSlotHasElements:[16,{},{state:!0}],navigationActionSlotHasElements:[16,{},{state:!0}],primaryContentCenterSlotHasElements:[16,{},{state:!0}],primaryContentEndSlotHasElements:[16,{},{state:!0}],primaryContentStartSlotHasElements:[16,{},{state:!0}],progressSlotHasElement:[16,{},{state:!0}],secondarySlotHasElements:[16,{},{state:!0}],tertiarySlotHasElements:[16,{},{state:!0}],userSlotHasElements:[16,{},{state:!0}],label:1,navigationAction:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=u}async setFocus(t){return this.focusSetter(()=>this.navigationActionRef.value,t)}actionClickHandler(){this.calciteNavigationActionSelect.emit()}handleUserSlotChange(t){this.isPrimaryLevel()&&(this.userSlotHasElements=n(t))}handleLogoSlotChange(t){this.isPrimaryLevel()&&(this.logoSlotHasElements=n(t))}handleContentStartSlotChange(t){this.isPrimaryLevel()&&(this.primaryContentStartSlotHasElements=n(t))}handleContentEndSlotChange(t){this.isPrimaryLevel()&&(this.primaryContentEndSlotHasElements=n(t))}handleContentCenterSlotChange(t){this.isPrimaryLevel()&&(this.primaryContentCenterSlotHasElements=n(t))}handleSecondarySlotChange(t){this.secondarySlotHasElements=n(t)}handleTertiarySlotChange(t){this.tertiarySlotHasElements=n(t)}handleMenuActionSlotChange(t){this.isPrimaryLevel()&&(this.navigationActionSlotHasElements=n(t),this.navigationActionSlotHasElements&&(this.navigationAction=!1))}handleProgressSlotChange(t){this.isPrimaryLevel()&&(this.progressSlotHasElement=n(t))}isPrimaryLevel(){return this.el.slot!==e.navSecondary&&this.el.slot!==e.navTertiary}renderMenuAction(){return s`<slot name=${e.navigationAction} @slotchange=${this.handleMenuActionSlotChange}>${this.navigationAction&&s`<calcite-action .icon=${y.hamburger} @click=${this.actionClickHandler} .text=${this.label} ${h(this.navigationActionRef)}></calcite-action>`||""}</slot>`}render(){let t=this.logoSlotHasElements||this.userSlotHasElements||this.navigationActionSlotHasElements||this.primaryContentCenterSlotHasElements||this.primaryContentEndSlotHasElements||this.primaryContentStartSlotHasElements||this.navigationAction,r=this.el.slot;return s`<div class=${o({[a.container]:!0,[a.secondary]:r===e.navSecondary,[a.tertiary]:r===e.navTertiary,[a.primary]:t})}><div class=${o({[a.hide]:!this.progressSlotHasElement,[e.progress]:!0})}><slot name=${e.progress} @slotchange=${this.handleProgressSlotChange}></slot></div><div class=${o({[a.containerContent]:!0,[a.hasProgress]:this.progressSlotHasElement})}>${this.renderMenuAction()}<div class=${o({[a.hide]:!this.logoSlotHasElements,[e.logo]:!0})}><slot name=${e.logo} @slotchange=${this.handleLogoSlotChange}></slot></div><slot name=${e.contentStart} @slotchange=${this.handleContentStartSlotChange}></slot><slot name=${e.contentCenter} @slotchange=${this.handleContentCenterSlotChange}></slot><slot name=${e.contentEnd} @slotchange=${this.handleContentEndSlotChange}></slot><div class=${o({[a.hide]:!this.userSlotHasElements,[e.user]:!0})}><slot name=${e.user} @slotchange=${this.handleUserSlotChange}></slot></div></div></div><slot name=${e.navSecondary} @slotchange=${this.handleSecondarySlotChange}></slot><slot name=${e.navTertiary} @slotchange=${this.handleTertiarySlotChange}></slot>`}};g("calcite-navigation",i);export{i as Navigation};
|
|
@@ -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.
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
4
|
var n={menuActions:"menu-actions",menuTooltip:"menu-tooltip"},o={menu:"ellipsis"},t={container:"container"};export{n as a,o as b,t as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
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{h as m,i as p,j as S}from"./
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{h as m,i as p,j as S}from"./CSQVLDPF.js";var u=Symbol.for(""),d=t=>{if(t?.r===u)return t?._$litStatic$},_=t=>({_$litStatic$:t,r:u}),w=(t,...a)=>({_$litStatic$:a.reduce(((l,i,o)=>l+(e=>{if(e._$litStatic$!==void 0)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but
|
|
5
5
|
take care to ensure page security.`)})(i)+t[o+1]),t[0]),r:u}),v=new Map,c=t=>(a,...l)=>{let i=l.length,o,e,r=[],$=[],n,s=0,f=!1;for(;s<i;){for(n=a[s];s<i&&(e=l[s],(o=d(e))!==void 0);)n+=o+a[++s],f=!0;s!==i&&$.push(e),r.push(n),s++}if(s===i&&r.push(a[i]),f){let h=r.join("$$lit$$");(a=v.get(h))===void 0&&(r.raw=r,v.set(h,a=r)),l=$}return t(a,...l)},b=c(m),y=c(p),j=c(S);export{_ as a,w as b,b as c};
|
|
@@ -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 b,e as g}from"./
|
|
3
|
+
v5.0.0-next.4 */
|
|
4
|
+
import{a as b,e as g}from"./TU2PNKWS.js";import"./C3BIK3DY.js";import"./Z6CRZOOK.js";import{a as p}from"./XRJOD24G.js";import{D as s,E as t,F as e,G as c,P as m,g as r,h as a}from"./CSQVLDPF.js";var i={firstTitle:"first-title",list:"list",label:"label",separator:"separator",title:"title",scale:l=>`scale--${l}`},x=r`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}.scale--s{font-size:var(--calcite-font-size--2);line-height:1rem;--calcite-combobox-item-horizontal-spacing-unit: var(--calcite-spacing-sm);--calcite-combobox-item-vertical-spacing-unit: var(--calcite-spacing-xxs)}.scale--s .first-title{padding-block-start:var(--calcite-spacing-sm)}.scale--s .separator{margin-block:var(--calcite-combobox-item-vertical-spacing-unit);margin-inline-start:calc(var(--calcite-combobox-item-horizontal-spacing-unit) + var(--calcite-combobox-item-horizontal-spacing-unit) * var(--calcite-combobox-item-spacing-indent-multiplier));margin-inline-end:var(--calcite-combobox-item-horizontal-spacing-unit)}.scale--m{font-size:var(--calcite-font-size--1);line-height:1rem;--calcite-combobox-item-horizontal-spacing-unit: var(--calcite-spacing-md);--calcite-combobox-item-vertical-spacing-unit: var(--calcite-spacing-xs)}.scale--m .first-title{padding-block-start:var(--calcite-spacing-md)}.scale--m .separator{margin-block:var(--calcite-combobox-item-vertical-spacing-unit);margin-inline-start:calc(var(--calcite-combobox-item-horizontal-spacing-unit) + var(--calcite-combobox-item-horizontal-spacing-unit) * var(--calcite-combobox-item-spacing-indent-multiplier));margin-inline-end:var(--calcite-combobox-item-horizontal-spacing-unit)}.scale--l{font-size:var(--calcite-font-size-0);line-height:1.25rem;--calcite-combobox-item-horizontal-spacing-unit: var(--calcite-spacing-lg);--calcite-combobox-item-vertical-spacing-unit: var(--calcite-spacing-sm-plus)}.scale--l .first-title{padding-block-start:var(--calcite-spacing-xl)}.scale--l .separator{margin-block:var(--calcite-combobox-item-vertical-spacing-unit);margin-inline-start:calc(var(--calcite-combobox-item-horizontal-spacing-unit) + var(--calcite-combobox-item-horizontal-spacing-unit) * var(--calcite-combobox-item-spacing-indent-multiplier));margin-inline-end:var(--calcite-combobox-item-horizontal-spacing-unit)}:host,.list{margin:0;display:flex;flex-direction:column;padding:0}:host(:focus),.list:focus{outline:2px solid transparent;outline-offset:2px}.separator{block-size:var(--calcite-spacing-px);background-color:var(--calcite-combobox-item-group-border-color, var(--calcite-color-border-3))}.label{box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:0px;max-inline-size:100%}.title{--calcite-combobox-item-indent-value: calc( var(--calcite-combobox-item-horizontal-spacing-unit) * var(--calcite-combobox-item-spacing-indent-multiplier) );border:0 solid;display:block;flex:1 1 0%;font-weight:var(--calcite-font-weight-bold);word-wrap:break-word;word-break:break-word;padding-block:var(--calcite-combobox-item-vertical-spacing-unit);padding-inline-start:calc(var(--calcite-combobox-item-indent-value) + var(--calcite-combobox-item-horizontal-spacing-unit));padding-inline-end:var(--calcite-combobox-item-horizontal-spacing-unit);color:var(--calcite-combobox-item-group-text-color, var(--calcite-color-text-1))}:host([hidden]){display:none}[hidden]{display:none}:host([item-hidden]){display:none}`,o=class extends s{constructor(){super(...arguments),this.guid=p(),this.afterEmptyGroup=!1,this.position=0,this.scale="m",this.itemHidden=!1}static{this.properties={afterEmptyGroup:[7,{},{reflect:!0,type:Boolean}],ancestors:[0,{},{attribute:!1}],label:1,position:[9,{},{type:Number}],scale:1,itemHidden:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=x}connectedCallback(){super.connectedCallback(),this.ancestors=b(this.el)}render(){let{el:d,scale:u}=this,n=g(d),v=this.position>0?a`<div class=${t(i.separator)} role=separator style=${e({"--calcite-combobox-item-spacing-indent-multiplier":`${n}`})}></div>`:null;return a`<ul aria-labelledby=${this.guid??c} class=${t({[i.list]:!0,[i.scale(u)]:!0})} role=group>${v}<li class=${t({[i.label]:!0})} id=${this.guid??c} role=presentation style=${e({"--calcite-combobox-item-spacing-indent-multiplier":`${n}`})}><span class=${t({[i.title]:!0,[i.firstTitle]:this.position===0})}>${this.label}</span></li><slot></slot></ul>`}};m("calcite-combobox-item-group",o);export{o as ComboboxItemGroup};
|