@esri/calcite-components 6.0.0-next.59 → 6.0.0-next.60
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/cdn/{XLVS3QRZ.js → 23ZH34K3.js} +1 -1
- package/dist/cdn/{OL54E2VG.js → 257CYMU4.js} +1 -1
- package/dist/cdn/{5KNIEIQB.js → 2DT5TUSD.js} +1 -1
- package/dist/cdn/{5Q725D3I.js → 2FDZK4SP.js} +1 -1
- package/dist/cdn/{N5HR4JIP.js → 2IIS3KXI.js} +1 -1
- package/dist/cdn/{IPC52TFP.js → 2KMSPIAS.js} +1 -1
- package/dist/cdn/{OGL2CTVW.js → 2UKQIP47.js} +1 -1
- package/dist/cdn/{MVEBOXXC.js → 36ZEWJ72.js} +1 -1
- package/dist/cdn/{Y6Y6YIMO.js → 3BK7GQWU.js} +1 -1
- package/dist/cdn/{CRUXQGDJ.js → 3FDZSMHT.js} +1 -1
- package/dist/cdn/{OEUZECPK.js → 3FRKED6O.js} +1 -1
- package/dist/cdn/{F66HV74D.js → 3K3WZKX6.js} +1 -1
- package/dist/cdn/{KVUDOYXY.js → 44QWLWTD.js} +1 -1
- package/dist/cdn/{XO3KFKRH.js → 4F373FUZ.js} +1 -1
- package/dist/cdn/{HMIAN5WT.js → 4LJDBE3W.js} +1 -1
- package/dist/cdn/{J4SK5XJU.js → 4OHJUF5U.js} +1 -1
- package/dist/cdn/{BAAM6BOB.js → 4QLJN6TZ.js} +1 -1
- package/dist/cdn/{DVW6HSBL.js → 4SLZJ3VJ.js} +1 -1
- package/dist/cdn/{NU5GGR3Y.js → 4Y5CLGZK.js} +1 -1
- package/dist/cdn/{YCQRLOCA.js → 5AN4UW6O.js} +1 -1
- package/dist/cdn/{AMWSJUBQ.js → 5CLS3AFH.js} +1 -1
- package/dist/cdn/{GQYWBUD3.js → 5IJI3EVD.js} +1 -1
- package/dist/cdn/{GFBTUJHM.js → 5N7OHVQJ.js} +1 -1
- package/dist/cdn/{QL2KRA7I.js → 5SHDFPXA.js} +1 -1
- package/dist/cdn/{XX3UQMZC.js → 6AYXET3V.js} +1 -1
- package/dist/cdn/{X7B3K4WG.js → 6EVWTMJD.js} +1 -1
- package/dist/cdn/{HEJHGUMW.js → 6FWGPQL4.js} +1 -1
- package/dist/cdn/{G73N23M2.js → 6HWBAEHO.js} +1 -1
- package/dist/cdn/{ZMSADQUW.js → 6LNUBHXG.js} +1 -1
- package/dist/cdn/{XIN4GD3V.js → 6MEPMUMI.js} +1 -1
- package/dist/cdn/6OZ63KZT.js +2 -0
- package/dist/cdn/{VIBF4GXM.js → 6WIIOXKS.js} +1 -1
- package/dist/cdn/{P22ZY5GU.js → 7LWJZEPF.js} +1 -1
- package/dist/cdn/{UBW23RMT.js → 7OMBQ2LG.js} +1 -1
- package/dist/cdn/{277CTNJY.js → 7OTICPWF.js} +1 -1
- package/dist/cdn/{YK37ODKH.js → 7SBZDWEM.js} +1 -1
- package/dist/cdn/{QRA3JYS2.js → B5C4YZEV.js} +1 -1
- package/dist/cdn/{NID3KRXD.js → B6C6QBFX.js} +1 -1
- package/dist/cdn/{75NQQJNI.js → BAVRQMTY.js} +1 -1
- package/dist/cdn/{B52245TR.js → BCIKYBF3.js} +1 -1
- package/dist/cdn/{D7SAADMD.js → BDWM7ALR.js} +1 -1
- package/dist/cdn/{BNAIOEU3.js → BHELXAGQ.js} +1 -1
- package/dist/cdn/{GZYMMKK3.js → BI7TNEOV.js} +1 -1
- package/dist/cdn/{2EXSTBIN.js → BN7ENVIC.js} +1 -1
- package/dist/cdn/{35FJBHUF.js → BWTQZDQ6.js} +1 -1
- package/dist/cdn/{MUJCH4UY.js → C2JECRTV.js} +1 -1
- package/dist/cdn/{DQXRPHUI.js → C6MFB75B.js} +1 -1
- package/dist/cdn/{JQGKC4WS.js → CAQH3M55.js} +1 -1
- package/dist/cdn/{6HDTB24G.js → CDVOEYND.js} +1 -1
- package/dist/cdn/{AWELH6FI.js → CPPMCAID.js} +1 -1
- package/dist/cdn/{HD6HPIFD.js → CYJMOVVE.js} +1 -1
- package/dist/cdn/{CZTRWN4B.js → DBLK2CMQ.js} +1 -1
- package/dist/cdn/{BFXALCYB.js → DQGBCHSN.js} +1 -1
- package/dist/cdn/{UAWRDZ5O.js → E4HUS55V.js} +1 -1
- package/dist/cdn/{XFXELLFJ.js → E6IOVG3N.js} +1 -1
- package/dist/cdn/{6LQANPML.js → E7MXVWGX.js} +1 -1
- package/dist/cdn/{V4ZUJQFP.js → ECWBSJHW.js} +1 -1
- package/dist/cdn/{QHFK52SN.js → EJR5VIJY.js} +1 -1
- package/dist/cdn/{F7HEFBJ3.js → EXBAP2Y4.js} +1 -1
- package/dist/cdn/{K54GNDS5.js → FQIEABZC.js} +1 -1
- package/dist/cdn/{Y2TCYWVJ.js → FU32CFHC.js} +1 -1
- package/dist/cdn/{EPZE2R4B.js → G3GOX6Q3.js} +1 -1
- package/dist/cdn/{QOD6L3RN.js → G4Q2SWWH.js} +1 -1
- package/dist/cdn/{XD6OEN5W.js → G7H34HIQ.js} +1 -1
- package/dist/cdn/{HMK6XNW4.js → GJSHDNEI.js} +1 -1
- package/dist/cdn/{XR2AI5LF.js → GLW4NDPH.js} +1 -1
- package/dist/cdn/{GCOCPN62.js → HGIXONN3.js} +1 -1
- package/dist/cdn/{BAP2LT6L.js → HHVI5W6F.js} +1 -1
- package/dist/cdn/{CDQE2C4Q.js → IE3NKPOQ.js} +1 -1
- package/dist/cdn/{R66FCABT.js → IITRLQOK.js} +1 -1
- package/dist/cdn/{5X26MSOM.js → IYNVKCUS.js} +1 -1
- package/dist/cdn/{XDX2VVBD.js → J3CT322U.js} +1 -1
- package/dist/cdn/{JPZO3EE3.js → J6RS2ESB.js} +1 -1
- package/dist/cdn/{BQPPMPJS.js → JGBARNCY.js} +1 -1
- package/dist/cdn/{5FKBHN7O.js → JQOAJ37N.js} +1 -1
- package/dist/cdn/{RGQW6RTG.js → JROSHOUF.js} +1 -1
- package/dist/cdn/{KNJMQXHP.js → JYY6YBSK.js} +1 -1
- package/dist/cdn/{IDKAMT5J.js → KDERETE3.js} +1 -1
- package/dist/cdn/{UVG42Q2A.js → KIM73WQR.js} +1 -1
- package/dist/cdn/{L5QOG5SI.js → KK3L5ZGD.js} +1 -1
- package/dist/cdn/{VGSQ57EU.js → KLKEDT2Y.js} +1 -1
- package/dist/cdn/{3VVBMAIY.js → KU76HQZR.js} +1 -1
- package/dist/cdn/{FHDTLXUH.js → L6CQJCBQ.js} +1 -1
- package/dist/cdn/{V37VPTIE.js → LB7UW2Y3.js} +1 -1
- package/dist/cdn/{YAP2ODTA.js → MD3RYRSU.js} +1 -1
- package/dist/cdn/{QAUUNB4V.js → MLEIIIL7.js} +1 -1
- package/dist/cdn/{MZWIFEF4.js → MP2FCWDD.js} +1 -1
- package/dist/cdn/{Z4CNCY5M.js → MQHC7KK6.js} +1 -1
- package/dist/cdn/{BINYFNLS.js → MS5KDFTY.js} +1 -1
- package/dist/cdn/{OEZYNWY2.js → N7LKA77X.js} +1 -1
- package/dist/cdn/{Q2BLYPB6.js → NPRLTYSV.js} +1 -1
- package/dist/cdn/{Y2GZJ5IZ.js → NVVYWR22.js} +1 -1
- package/dist/cdn/{OR33QYWH.js → NYALNICV.js} +1 -1
- package/dist/cdn/{Y2YZHLKZ.js → OAJCI3UF.js} +1 -1
- package/dist/cdn/{W6KTUCBM.js → ODKKJFFR.js} +1 -1
- package/dist/cdn/{ZW2EPUQZ.js → ONJXSMUE.js} +1 -1
- package/dist/cdn/{2RQXL6B4.js → OSPG44XY.js} +1 -1
- package/dist/cdn/{DMDFMT33.js → P3KUY6H3.js} +1 -1
- package/dist/cdn/{LYJN7W62.js → P3OZPAUC.js} +1 -1
- package/dist/cdn/{YYT7RRDM.js → PBRTD24G.js} +1 -1
- package/dist/cdn/{NT2V7ORB.js → PDFS7UA6.js} +1 -1
- package/dist/cdn/{E6AHSYPV.js → PFX7YXIO.js} +1 -1
- package/dist/cdn/{TXYIR3R6.js → PJCHRWO4.js} +1 -1
- package/dist/cdn/{6A5BYMIC.js → Q3CUUGHL.js} +1 -1
- package/dist/cdn/{6IZHEOPN.js → Q6257UUK.js} +1 -1
- package/dist/cdn/{J3POEOT4.js → Q6RI57LC.js} +1 -1
- package/dist/cdn/{MI4QY5FD.js → QJ6M5YEU.js} +1 -1
- package/dist/cdn/{ZF44ZIJ2.js → QJDV2Q35.js} +1 -1
- package/dist/cdn/{Q3YIRHRU.js → QZL5BQLF.js} +1 -1
- package/dist/cdn/{7IG4J3RC.js → RC7R4XGD.js} +1 -1
- package/dist/cdn/{G4VQAHM7.js → RJHT25SN.js} +1 -1
- package/dist/cdn/{WNSVA5TC.js → RKIOFYYA.js} +1 -1
- package/dist/cdn/{J6KQQNJ3.js → ROYPFJB4.js} +1 -1
- package/dist/cdn/{5RA4UYT7.js → RX3L4B7J.js} +1 -1
- package/dist/cdn/{WMDX6OGD.js → SLN4IGHF.js} +1 -1
- package/dist/cdn/{ZU7QAA3U.js → SRISJ3VC.js} +1 -1
- package/dist/cdn/{FDVLFWY3.js → TAUHHB32.js} +1 -1
- package/dist/cdn/{UTGBSCXZ.js → TNYEWBGQ.js} +1 -1
- package/dist/cdn/{CZIC32VL.js → TZDBVRUX.js} +1 -1
- package/dist/cdn/{LWG7CYMV.js → UBAJCG7D.js} +1 -1
- package/dist/cdn/{CMTCQFMP.js → UKECXAGH.js} +1 -1
- package/dist/cdn/{5A6B2JT4.js → UUTQEUTL.js} +1 -1
- package/dist/cdn/{CWZSUMKI.js → V5H2YZT6.js} +1 -1
- package/dist/cdn/{K6RVOBUV.js → V63XBVSE.js} +1 -1
- package/dist/cdn/{I7HDIL4H.js → VGPMXNNU.js} +1 -1
- package/dist/cdn/{LI3FC5GC.js → VUOGZ2U5.js} +1 -1
- package/dist/cdn/{4OY7QXF2.js → VYGPYGAQ.js} +1 -1
- package/dist/cdn/{RSZUKEEU.js → WGRHH222.js} +1 -1
- package/dist/cdn/{EOBN6VLQ.js → WRSFHSVK.js} +1 -1
- package/dist/cdn/{CFMZJOV5.js → WUZCTZE7.js} +1 -1
- package/dist/cdn/{WPS6ASG2.js → WXBRWN5A.js} +1 -1
- package/dist/cdn/{5RWCJVFC.js → WZISGN4V.js} +1 -1
- package/dist/cdn/{WJBKOJ6N.js → XOC4G2FI.js} +1 -1
- package/dist/cdn/{JEPOY4UE.js → XUNSVVBS.js} +1 -1
- package/dist/cdn/{D3LR5SRT.js → Y4J2RN5O.js} +1 -1
- package/dist/cdn/{PRWBLOXR.js → YTWEXRRQ.js} +1 -1
- package/dist/cdn/{FD7VRNOK.js → Z6SNTWBS.js} +1 -1
- package/dist/cdn/{VBTZUXSD.js → ZHUPFYD4.js} +1 -1
- package/dist/cdn/{JWMTQ42V.js → ZPZQHOA5.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +3 -3
- package/dist/components/calcite-accordion/customElement.d.ts +1 -1
- package/dist/components/calcite-action/customElement.d.ts +4 -3
- package/dist/components/calcite-action-bar/customElement.d.ts +1 -1
- package/dist/components/calcite-alert/customElement.d.ts +2 -2
- package/dist/components/calcite-autocomplete/customElement.d.ts +17 -16
- package/dist/components/calcite-autocomplete-item/customElement.d.ts +2 -1
- package/dist/components/calcite-avatar/customElement.d.ts +1 -1
- package/dist/components/calcite-block/customElement.d.ts +3 -2
- package/dist/components/calcite-block-group/customElement.d.ts +3 -2
- package/dist/components/calcite-block-section/customElement.d.ts +1 -1
- package/dist/components/calcite-button/customElement.d.ts +3 -2
- package/dist/components/calcite-card/customElement.d.ts +3 -2
- package/dist/components/calcite-card-group/customElement.d.ts +3 -2
- package/dist/components/calcite-carousel/customElement.d.ts +3 -2
- package/dist/components/calcite-checkbox/customElement.d.ts +4 -3
- package/dist/components/calcite-chip/customElement.d.ts +5 -6
- package/dist/components/calcite-chip-group/customElement.d.ts +3 -2
- package/dist/components/calcite-color-picker/customElement.d.ts +3 -2
- package/dist/components/calcite-color-picker-hex-input/customElement.d.ts +1 -1
- package/dist/components/calcite-combobox/customElement.d.ts +4 -3
- package/dist/components/calcite-combobox-item/customElement.d.ts +3 -2
- package/dist/components/calcite-date-picker/customElement.d.ts +2 -2
- package/dist/components/calcite-dialog/customElement.d.ts +10 -8
- package/dist/components/calcite-dropdown/customElement.d.ts +3 -2
- package/dist/components/calcite-dropdown-item/customElement.d.ts +3 -2
- package/dist/components/calcite-fab/customElement.d.ts +4 -3
- package/dist/components/calcite-filter/customElement.d.ts +4 -3
- package/dist/components/calcite-flow/types.d.ts +4 -4
- package/dist/components/calcite-flow-item/customElement.d.ts +12 -9
- package/dist/components/calcite-icon/customElement.d.ts +1 -1
- package/dist/components/calcite-inline-editable/customElement.d.ts +3 -2
- package/dist/components/calcite-input/customElement.d.ts +7 -9
- package/dist/components/calcite-input-date-picker/customElement.d.ts +4 -3
- package/dist/components/calcite-input-message/customElement.d.ts +2 -2
- package/dist/components/calcite-input-number/customElement.d.ts +6 -7
- package/dist/components/calcite-input-text/customElement.d.ts +7 -9
- package/dist/components/calcite-input-time-picker/customElement.d.ts +3 -2
- package/dist/components/calcite-input-time-zone/customElement.d.ts +3 -2
- package/dist/components/calcite-label/customElement.d.ts +1 -1
- package/dist/components/calcite-link/customElement.d.ts +3 -2
- package/dist/components/calcite-list/customElement.d.ts +10 -5
- package/dist/components/calcite-list-item/customElement.d.ts +5 -4
- package/dist/components/calcite-list-item-group/customElement.d.ts +3 -2
- package/dist/components/calcite-loader/customElement.d.ts +1 -1
- package/dist/components/calcite-menu/customElement.d.ts +1 -1
- package/dist/components/calcite-menu-item/customElement.d.ts +1 -1
- package/dist/components/calcite-meter/customElement.d.ts +3 -2
- package/dist/components/calcite-navigation/customElement.d.ts +1 -1
- package/dist/components/calcite-navigation-logo/customElement.d.ts +1 -1
- package/dist/components/calcite-notice/customElement.d.ts +2 -2
- package/dist/components/calcite-option/customElement.d.ts +3 -2
- package/dist/components/calcite-option-group/customElement.d.ts +2 -1
- package/dist/components/calcite-pagination/customElement.d.ts +1 -1
- package/dist/components/calcite-panel/customElement.d.ts +13 -10
- package/dist/components/calcite-popover/customElement.d.ts +2 -2
- package/dist/components/calcite-radio-button/customElement.d.ts +4 -3
- package/dist/components/calcite-radio-button-group/customElement.d.ts +3 -2
- package/dist/components/calcite-rating/customElement.d.ts +4 -3
- package/dist/components/calcite-segmented-control/customElement.d.ts +4 -3
- package/dist/components/calcite-segmented-control-item/customElement.d.ts +2 -2
- package/dist/components/calcite-select/customElement.d.ts +3 -2
- package/dist/components/calcite-sheet/customElement.d.ts +5 -3
- package/dist/components/calcite-slider/customElement.d.ts +3 -2
- package/dist/components/calcite-slider/customElement.js +73 -106
- package/dist/components/calcite-sort-handle/customElement.d.ts +3 -2
- package/dist/components/calcite-split-button/customElement.d.ts +2 -1
- package/dist/components/calcite-stack/customElement.d.ts +1 -0
- package/dist/components/calcite-stepper-item/customElement.d.ts +3 -2
- package/dist/components/calcite-swatch/customElement.d.ts +3 -2
- package/dist/components/calcite-swatch-group/customElement.d.ts +3 -2
- package/dist/components/calcite-switch/customElement.d.ts +3 -2
- package/dist/components/calcite-tab-title/customElement.d.ts +2 -1
- package/dist/components/calcite-table-row/customElement.d.ts +2 -1
- package/dist/components/calcite-tabs/customElement.d.ts +1 -1
- package/dist/components/calcite-text-area/customElement.d.ts +5 -6
- package/dist/components/calcite-tile/customElement.d.ts +3 -2
- package/dist/components/calcite-tile-group/customElement.d.ts +3 -2
- package/dist/components/calcite-time-picker/customElement.d.ts +1 -1
- package/dist/components/calcite-tooltip/customElement.d.ts +1 -1
- package/dist/components/calcite-tree-item/customElement.d.ts +3 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +1 -1
- package/dist/cdn/7RGQTRRW.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{e as u}from"./YYOLNZRT.js";import"./CSDY4NKB.js";import{a as d}from"./FDHY2TZA.js";import{G as c,T as h,h as r,p as o}from"./
|
|
2
|
+
import{e as u}from"./YYOLNZRT.js";import"./CSDY4NKB.js";import{a as d}from"./FDHY2TZA.js";import{G as c,T as h,h as r,p as o}from"./3K3WZKX6.js";var b=[" ",`
|
|
3
3
|
`," ","\r"],m=/[^\S\u00A0]+/g,a=class extends c{constructor(){super(...arguments),this.mutationObserver=d("mutation",()=>{this.ensureTextContentDependentProps(),this.calciteInternalOptionChange.emit()}),this.disabled=!1,this.selected=!1,this.calciteInternalOptionChange=o({cancelable:!1})}static{this.properties={disabled:[7,{},{reflect:!0,type:Boolean}],label:1,selected:[7,{},{reflect:!0,type:Boolean}],value:1}}connectedCallback(){super.connectedCallback(),this.ensureTextContentDependentProps(),this.mutationObserver?.observe(this.el,{attributeFilter:["label","value"],characterData:!0,childList:!0,subtree:!0})}willUpdate(e){e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handlePropChange(this.disabled,e.get("disabled"),"disabled"),e.has("label")&&this.handlePropChange(this.label,e.get("label"),"label"),e.has("selected")&&this.handlePropChange(this.selected,e.get("selected"),"selected"),e.has("value")&&this.handlePropChange(this.value,e.get("value"),"value")}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect()}handlePropChange(e,s,t){(t==="label"||t==="value")&&this.ensureTextContentDependentProps(),this.calciteInternalOptionChange.emit()}ensureTextContentDependentProps(){let{el:e,internallySetLabel:s,internallySetValue:t,label:p,value:i}=this,l=u(e.textContent,b).replaceAll(m," "),n=p;(!n||n===s)&&(this.label=l,this.internallySetLabel=l),(i==null||i===t)&&(this.value=l,this.internallySetValue=l)}render(){return r`<slot>${this.label}</slot>`}};h("calcite-option",a);export{a as Option};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as re,b as oe}from"./J6KQQNJ3.js";import{a as se}from"./GJJEZYW5.js";import{b as ne}from"./5LWU7V5K.js";import{a as H,c as L,d as Z,e as ee,f as te,g as w,h as ie}from"./XIN4GD3V.js";import"./WTNYMVTD.js";import{a as J}from"./CZIC32VL.js";import"./YYOLNZRT.js";import"./CSDY4NKB.js";import{a as C,b as k}from"./FDHY2TZA.js";import{a as X}from"./CWZSUMKI.js";import{a as Q}from"./WBDWFW77.js";import{a as R}from"./JN6YLTUP.js";import"./TL56TNQ7.js";import{a as P}from"./BQPPMPJS.js";import"./VMHJHFFS.js";import{b as _,e as q}from"./QAUUNB4V.js";import"./F7HEFBJ3.js";import{J as D,b as K,f as Y,i as j,n as S}from"./W77STZAT.js";import{F as y,G as V,H as T,T as G,g as N,h as A,p as I}from"./F66HV74D.js";var E=new WeakMap;function pe(d,e){if(!d)return[];let t=K(d,{...Y,includeContainer:!0}).filter(S);return t.push(...e.filter(s=>(E.get(s)?.tabIndex??-1)>=0)),S(d)&&d.tabIndex>=0&&t.push(d),[...new Set(t)]}var fe=(d={})=>_((e,t)=>{let s=P()(e),r=new Set,p=[],h=null,f=-1,m=[],u,O=!1,l,b=null,M=new WeakSet;function g(){return d.getTraversableElements?.()??d.getElements?.()??p}function F(i){let o=E.get(i);!o||!r.delete(i)||(o.referenceCount--,!(o.referenceCount>0)&&(o.attribute===null?i.removeAttribute("tabindex"):i.setAttribute("tabindex",o.attribute),E.delete(i)))}function ae(i){let o=g(),a=i.composedPath(),n=o.find(x=>a.includes(x));n&&(l=n,v.setActiveIndex(o.indexOf(n)))}function le(i){let o=i.composedPath();if(!p.some(n=>o.includes(n)))return;let a=i.relatedTarget;if(b=a,!(a instanceof Node&&g().some(n=>n.contains(a)))){if(a instanceof Element)l=void 0;else if(l){let n=l;queueMicrotask(()=>{l===n&&n.isConnected&&!n.matches(":focus-within")&&g().includes(n)&&(l=void 0)})}}}t.onLoaded(()=>{e.listenOn(e.renderRoot,"focusin",ae),e.listenOn(e.renderRoot,"focusout",le,{capture:!0})}),e.listenOn(e.el.ownerDocument,"focusin",i=>{if(!l&&!b)return;let o=i.composedPath();b&&o.includes(b)&&M.add(i),b=null,l&&!o.includes(l)&&(l=void 0)},{capture:!0}),t.onDisconnected(()=>{l=void 0,b=null,r.forEach(F)});let v={get activeElement(){return h},get activeIndex(){return f},get hasFocus(){return s.hasFocus||(d.getEntryElement?.()?.matches(":focus-within")??!1)},isFocusFromItem(i){return M.has(i)},get isRestoringFocus(){return O},get shouldRecoverFocus(){if(!l)return!1;let i=j(e.el);return!(e.el.ownerDocument.activeElement===e.el.ownerDocument.body||i instanceof ShadowRoot&&!i.activeElement&&i.host.matches(":focus-within"))&&!l.matches(":focus-within")?(l=void 0,!1):!l.isConnected||!g().includes(l)},update(i,o){let a=d.getEntryElement?.();m.forEach(F);let n=s.getFocusableElements(a),x=pe(a,n),ce=x.length>0?x:m.filter(c=>c.isConnected&&a?.contains(c));p=i;let de=d.getTraversableElements?.()??i;f=o&&d.isActive?.()!==!1&&i.includes(o)?de.indexOf(o):-1,h=f>=0?o:null;let he=s.getDeepActiveElement();u=n.find(c=>c===he)??(u&&n.includes(u)?u:n[0]),m=ce;let B=h?[...i,...m]:i,ue=new Set(B);r.forEach(c=>{ue.has(c)||F(c)}),B.forEach(c=>{if(!r.has(c)){let W=E.get(c);W?W.referenceCount++:E.set(c,{attribute:c.getAttribute("tabindex"),tabIndex:c.tabIndex,referenceCount:1}),r.add(c)}let U=c===h?0:-1;c.getAttribute("tabindex")!==String(U)&&(c.tabIndex=U)})},setActiveIndex(i){let o=d.getElements?.()??p,a=d.getTraversableElements?.()??o,n=i>=0?a[i]??null:null;v.update(o,n)},navigate(i){let o=g(),a=o.length;if(!a)return v.setActiveIndex(-1),null;let n=f;return n<0||n>=a?n=i==="previous"||i==="last"?a-1:0:i==="next"?n=(n+1)%a:i==="previous"?n=(n-1+a)%a:i==="first"?n=0:i==="last"&&(n=a-1),v.update(d.getElements?.()??p,o[n]),h},reconcile(){let i=g(),o=h?i.indexOf(h):-1,a=o>=0?o:i.findIndex(n=>n.matches(":focus-within"));return v.setActiveIndex(a>=0?a:Math.min(Math.max(f,0),i.length-1)),h},restoreFocus(i="within"){let o=p.some(s.isFocusedWithin)||m.some(s.isFocusedWithin)||u!==void 0&&s.isFocusedWithin(u);if(!(!(i==="force"||o||i==="recover"&&v.shouldRecoverFocus)||!u||!u.isConnected)){O=!0;try{u.focus(),l=void 0}finally{O=!1}}}};return v}),me={trigger:"trigger"},$={content:"content",wrapper:"wrapper",triggerContainer:"trigger-container"},ve=N`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}.wrapper{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.wrapper{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .wrapper{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.wrapper[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.wrapper:popover-open{display:block}.wrapper .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;border-radius:var(--calcite-corner-radius-sm);z-index:var(--calcite-z-index)}.wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.wrapper .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}.content{overflow-y:auto;overflow-x:hidden;inline-size:var(--calcite-dropdown-width, var(--calcite-internal-dropdown-width));background-color:var(--calcite-dropdown-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)));max-block-size:var(--calcite-dropdown-max-height, 45vh)}.trigger-container{position:relative;display:flex;flex:1 1 auto;block-size:100%;overflow-wrap:break-word;word-break:break-word}.width-s{--calcite-internal-dropdown-width: 12rem}.width-m{--calcite-internal-dropdown-width: 14rem}.width-l{--calcite-internal-dropdown-width: 16rem}@media(forced-colors:active){:host([open]) .wrapper{border:var(--calcite-border-width-sm) solid canvasText}}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}`,be=oe({click:!0,hover:!0}),z=class extends V{constructor(){super(),this.referenceElementController=re({manager:be})(this),this.direction=q(),this.focusLastDropdownItem=!1,this.focusActiveItemOnOpen=!0,this.focusedElementOnOpen=null,this._open=!1,this.groups=[],this.items=[],this.mutationObserver=C("mutation",()=>this.updateItems()),this.transitionProp="opacity",this.resizeObserver=C("resize",e=>this.resizeObserverCallback(e)),this.onReferenceElementKeyDown=e=>this.keyDownHandler(e),this.onReferenceElementFocusIn=e=>this.openHoverDropdown(e),this.onReferenceElementPointerOpen=()=>{this.open||(this.focusActiveItemOnOpen=!1)},this.focusable=P()(this),this.rovingTabIndex=fe({getElements:()=>this.items,getEntryElement:()=>this.referenceEl instanceof Element?this.referenceEl:void 0,getTraversableElements:()=>this.getTraversableItems(),isActive:()=>this.open&&!this.disabled&&this.focusActiveItemOnOpen})(this),this.interactiveContainer=J(this),this.topLayer=X({target:()=>this.floatingEl})(this),this.closeOnSelectDisabled=!1,this.disabled=!1,this.maxItems=0,this.offsetDistance=0,this.offsetSkidding=0,this.overlayPositioning="absolute",this.placement=H,this.scale="m",this.selectedItems=[],this.topLayerDisabled=!1,this.type="click",this.calciteDropdownBeforeClose=I({cancelable:!1}),this.calciteDropdownBeforeOpen=I({cancelable:!1}),this.calciteDropdownClose=I({cancelable:!1}),this.calciteDropdownOpen=I({cancelable:!1}),this.calciteDropdownSelect=I({cancelable:!1}),this.listen("pointerenter",this.pointerEnterHandler),this.listen("pointerleave",this.pointerLeaveHandler),this.listen("calciteInternalDropdownItemSelect",this.handleItemSelect)}static{this.properties={referenceEl:[16,{},{state:!0}],closeOnSelectDisabled:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],maxItems:[11,{},{reflect:!0,type:Number}],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}],referenceElement:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],type:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=ve}get referenceElementType(){return this.referenceElement?this.type:void 0}get autoClose(){return!0}get isRestoringFocus(){return this.rovingTabIndex.isRestoringFocus}get open(){return this._open}set open(e){e&&!this._open&&(this.focusedElementOnOpen=this.focusable.getDeepActiveElement()),this._open=e}async reposition(e=!1){let{filteredFlipPlacements:t,floatingEl:s,offsetDistance:r,offsetSkidding:p,overlayPositioning:h,placement:f,referenceEl:m}=this;return ee(this,{direction:this.direction,floatingEl:s,referenceEl:m,offsetDistance:r,offsetSkidding:p,overlayPositioning:h,placement:f,flipPlacements:t,type:"menu"},e)}async setFocus(e){return this.focusable.setFocus(()=>{let t=this.referenceEl instanceof HTMLElement?this.referenceEl:this.floatingEl;return t?{target:t,strategy:"focusable"}:void 0},e)}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{attributeFilter:["disabled","hidden","inert"],attributes:!0,childList:!0,subtree:!0}),this.setFilteredPlacements(),this.updateItems(),w(this)}load(){this.listenOn(document,"click",this.closeCalciteDropdownOnClick),this.listenOn(document,"calciteDropdownOpen",this.closeCalciteDropdownOnOpenEvent)}willUpdate(e){e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handleDisabledChange(this.disabled),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("maxItems")&&this.hasUpdated&&this.setMaxScrollerHeight(),this.hasUpdated&&(e.has("offsetDistance")&&this.offsetDistance!==0||e.has("offsetSkidding")&&this.offsetSkidding!==0||e.has("overlayPositioning")&&this.overlayPositioning!=="absolute"||e.has("placement")&&this.placement!==H)&&this.reposition(!0),e.has("scale")&&(this.hasUpdated||this.scale!=="m")&&this.handlePropsChange(),e.has("referenceElement")&&!this.referenceElement&&this.open&&this.topLayer.hide()}updated(e){e.has("referenceEl")&&this.referenceElementType&&(this.syncTabStops(),w(this))}loaded(){this.updateSelectedItems(),w(this)}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),ie(this)}openHandler(){if(this.disabled&&this.open){this.open=!1,this.focusActiveItemOnOpen=!0,this.rovingTabIndex.setActiveIndex(-1);return}this.open||(this.focusActiveItemOnOpen=!0),Q(this),this.open||this.rovingTabIndex.setActiveIndex(-1),this.reposition(!0)}handleDisabledChange(e){e&&(this.open=!1,this.rovingTabIndex.setActiveIndex(-1))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupProps()}closeCalciteDropdownOnClick(e){this.referenceElementType||this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown()}closeCalciteDropdownOnOpenEvent(e){this.referenceElementType||e.composedPath().includes(this.el)||this.closeCalciteDropdown()}pointerEnterHandler(){this.referenceElementType||this.disabled||this.type!=="hover"||(this.open||(this.focusActiveItemOnOpen=!1),this.open=!0)}pointerLeaveHandler(){this.referenceElementType||this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.closest("[hidden], [inert]"))}async handleItemSelect(e){this.updateSelectedItems(),this.syncActiveItemFromTraversableItems();let t=this.focusable.getDeepActiveElement();if(e.stopPropagation(),this.calciteDropdownSelect.emit(),!this.closeOnSelectDisabled)this.closeCalciteDropdown(),this.rovingTabIndex.restoreFocus("recover");else{let{requestedDropdownItem:s}=e.detail,r=this.getTraversableItems().indexOf(s);if(r<0||!s.isConnected){this.updateItems();return}s.matches(":focus-within")&&this.focusable.isFocusUnchanged(t)&&(this.rovingTabIndex.setActiveIndex(r),await this.scrollActiveItemIntoView(s,t))}}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?Z(t,e):void 0}updateItems(){this.items=this.groups.flatMap(e=>Array.from(e.querySelectorAll("calcite-dropdown-item"))),this.updateSelectedItems(),this.syncActiveItemFromTraversableItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)}updateGroups(e){let t=e.target.assignedElements({flatten:!0}).filter(ne);this.groups=t,this.updateItems(),this.updateGroupProps()}updateGroupProps(){this.groups.forEach((e,t)=>{e.scale=this.scale,e.position=t})}resizeObserverCallback(e){e.forEach(({target:t})=>{t===this.referenceEl?this.setDropdownWidth():t===this.scrollerEl&&this.setMaxScrollerHeight()})}setDropdownWidth(){let{referenceEl:e,scrollerEl:t}=this;!t||!(e instanceof HTMLElement)||(t.style.minWidth=`${e.clientWidth}px`)}setMaxScrollerHeight(){let{maxItems:e,items:t,scrollerEl:s}=this;if(!s)return;let r=t.length>=e&&e>0?this.getYDistanceFromScroller(t.at(e-1)):0;s.style.maxBlockSize=r>0?`${r}px`:"",this.reposition(!0)}setScrollerAndTransitionEl(e){k(this.resizeObserver,this.scrollerEl,e),this.scrollerEl=e,this.transitionEl=e}onBeforeOpen(){this.setInitialActiveItem(),this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.rovingTabIndex.restoreFocus("recover"),this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit(),te(this),this.topLayer.hide()}setReferenceEl(e){let t=this.referenceEl instanceof HTMLElement?this.referenceEl:void 0,s=e instanceof HTMLElement?e:void 0;k(this.resizeObserver,t,s),!(this.referenceElementType||!s)&&(this.referenceEl=e,this.syncTabStops(),w(this))}setFloatingEl(e){this.floatingEl=e,w(this)}handleTriggerSlotChange(){this.syncTabStops()}keyDownHandler(e){let t=e.composedPath();if(this.disabled||!t.includes(this.floatingEl)&&(!(this.referenceEl instanceof Element)||!t.includes(this.referenceEl)))return;let{defaultPrevented:s,key:r}=e;if(!s){if(this.open&&r==="Escape"){this.closeCalciteDropdown(),this.rovingTabIndex.restoreFocus(),e.preventDefault();return}if(!this.open&&R(r)){this.focusActiveItemOnOpen=!0,this.open=!0,e.preventDefault();return}if(!this.open&&(r==="ArrowDown"||r==="ArrowUp")){e.preventDefault(),this.focusActiveItemOnOpen=!0,this.focusLastDropdownItem=r==="ArrowUp",this.open=!0;return}if(this.open){if(r==="Tab"){this.rovingTabIndex.restoreFocus(),this.closeCalciteDropdown();return}if(r==="ArrowDown"){e.preventDefault(),this.navigateActiveItem("next");return}if(r==="ArrowUp"){e.preventDefault(),this.navigateActiveItem("previous");return}if(r==="Home"){e.preventDefault(),this.navigateActiveItem("first");return}if(r==="End"){e.preventDefault(),this.navigateActiveItem("last");return}R(r)&&(e.preventDefault(),this.activateActiveItem())}}}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getYDistanceFromScroller(e){let{scrollerEl:t}=this;return!e||!t?NaN:e.getBoundingClientRect().bottom-t.getBoundingClientRect().top+t.scrollTop}closeCalciteDropdown(){this.open=!1,this.rovingTabIndex.setActiveIndex(-1)}async setInitialActiveItem(){let e=this.getTraversableItems(),t=this.focusLastDropdownItem?e.length-1:0,s=!e.length&&this.focusLastDropdownItem?"last":void 0;this.focusLastDropdownItem=!1,this.rovingTabIndex.setActiveIndex(e.length?t:-1),await this.topLayer.show(),this.focusActiveItemOnOpen&&await this.scrollActiveItemIntoView(void 0,this.focusedElementOnOpen,s)}syncActiveItemFromTraversableItems(){let e=this.getTraversableItems(),t=this.rovingTabIndex.activeElement,s=this.rovingTabIndex.shouldRecoverFocus;if(!this.open||!e.length){this.rovingTabIndex.setActiveIndex(-1),this.open&&t&&s&&this.rovingTabIndex.restoreFocus("force");return}let r=this.rovingTabIndex.reconcile();t&&r&&s&&this.scrollActiveItemIntoView(r)}syncTabStops(){this.rovingTabIndex.update(this.items,this.rovingTabIndex.activeElement)}handleItemFocus(){this.focusActiveItemOnOpen=!0}handleItemFocusOut(e){!e.relatedTarget&&this.rovingTabIndex.shouldRecoverFocus||this.closeHoverDropdown(e)}navigateActiveItem(e){this.focusActiveItemOnOpen=!0;let t=this.rovingTabIndex.navigate(e);t&&this.scrollActiveItemIntoView(t)}async scrollActiveItemIntoView(e,t=this.focusable.getDeepActiveElement(),s){await this.updateComplete,await D(),await D(),e??=this.rovingTabIndex.activeElement??void 0,!(!e||!this.open||this.rovingTabIndex.activeElement!==e||!e.isConnected||!this.focusable.isFocusUnchanged(t))&&(s&&(e=this.rovingTabIndex.navigate(s)??e),await e.setFocus({preventScroll:!0}),e.scrollIntoView({block:"nearest"}))}activateActiveItem(){let e=this.getTraversableItems(),t=this.rovingTabIndex.activeIndex,s=t>=0&&t<e.length?t:0,r=e[s];r&&(this.rovingTabIndex.setActiveIndex(s),r.activateItem())}openHoverDropdown(e){if(!(this.disabled||this.type!=="hover"||this.isRestoringFocus)&&!(this.rovingTabIndex.isFocusFromItem(e)||e.relatedTarget instanceof Node&&this.el.contains(e.relatedTarget))){if(this.focusActiveItemOnOpen=!0,this.open){this.rovingTabIndex.activeElement||this.rovingTabIndex.setActiveIndex(0),this.scrollActiveItemIntoView(this.rovingTabIndex.activeElement??void 0);return}this.open=!0}}async closeHoverDropdown(e){if(!this.open||this.disabled||this.type!=="hover")return;let t=e.relatedTarget;t&&(this.el.contains(t)||this.referenceEl instanceof Element&&this.referenceEl.contains(t))||t instanceof Element&&t.shadowRoot&&(await D(),!this.open||this.rovingTabIndex.hasFocus)||this.closeCalciteDropdown()}toggleClickDropdown(){this.disabled||this.type!=="click"||(this.focusActiveItemOnOpen=!0,this.open=!this.open)}render(){let{open:e}=this;return this.interactiveContainer({disabled:this.disabled,children:A`${this.referenceElementType?null:A`<div class=${T($.triggerContainer)} @click=${this.toggleClickDropdown} @focusin=${this.openHoverDropdown} @focusout=${this.closeHoverDropdown} @keydown=${this.keyDownHandler} ${y(this.setReferenceEl)}><slot .ariaControlsElements=${this.scrollerEl?[this.scrollerEl]:void 0} .ariaExpanded=${e} aria-haspopup=menu name=${me.trigger} @slotchange=${this.handleTriggerSlotChange}></slot></div>`}<div class=${T({[$.wrapper]:!0,[se("width",this.width)]:!!this.width})} .inert=${!e} @focusin=${this.handleItemFocus} @focusout=${this.handleItemFocusOut} @keydown=${this.keyDownHandler} popover=manual ${y(this.setFloatingEl)}><div .ariaLabelledByElements=${this.referenceEl instanceof HTMLElement?[this.referenceEl]:void 0} class=${T({[$.content]:!0,[L.animation]:!0,[L.animationActive]:e})} role=menu ${y(this.setScrollerAndTransitionEl)}><slot @slotchange=${this.updateGroups}></slot></div></div>`})}};G("calcite-dropdown",z);export{z as Dropdown};
|
|
2
|
+
import{a as re,b as oe}from"./ROYPFJB4.js";import{a as se}from"./GJJEZYW5.js";import{b as ne}from"./5LWU7V5K.js";import{a as H,c as L,d as Z,e as ee,f as te,g as w,h as ie}from"./6MEPMUMI.js";import"./WTNYMVTD.js";import{a as J}from"./TZDBVRUX.js";import"./YYOLNZRT.js";import"./CSDY4NKB.js";import{a as C,b as k}from"./FDHY2TZA.js";import{a as X}from"./V5H2YZT6.js";import{a as Q}from"./WBDWFW77.js";import{a as R}from"./JN6YLTUP.js";import"./TL56TNQ7.js";import{a as P}from"./JGBARNCY.js";import"./VMHJHFFS.js";import{b as _,e as q}from"./MLEIIIL7.js";import"./EXBAP2Y4.js";import{J as D,b as K,f as Y,i as j,n as S}from"./W77STZAT.js";import{F as y,G as V,H as T,T as G,g as N,h as A,p as I}from"./3K3WZKX6.js";var E=new WeakMap;function pe(d,e){if(!d)return[];let t=K(d,{...Y,includeContainer:!0}).filter(S);return t.push(...e.filter(s=>(E.get(s)?.tabIndex??-1)>=0)),S(d)&&d.tabIndex>=0&&t.push(d),[...new Set(t)]}var fe=(d={})=>_((e,t)=>{let s=P()(e),r=new Set,p=[],h=null,f=-1,m=[],u,O=!1,l,b=null,M=new WeakSet;function g(){return d.getTraversableElements?.()??d.getElements?.()??p}function F(i){let o=E.get(i);!o||!r.delete(i)||(o.referenceCount--,!(o.referenceCount>0)&&(o.attribute===null?i.removeAttribute("tabindex"):i.setAttribute("tabindex",o.attribute),E.delete(i)))}function ae(i){let o=g(),a=i.composedPath(),n=o.find(x=>a.includes(x));n&&(l=n,v.setActiveIndex(o.indexOf(n)))}function le(i){let o=i.composedPath();if(!p.some(n=>o.includes(n)))return;let a=i.relatedTarget;if(b=a,!(a instanceof Node&&g().some(n=>n.contains(a)))){if(a instanceof Element)l=void 0;else if(l){let n=l;queueMicrotask(()=>{l===n&&n.isConnected&&!n.matches(":focus-within")&&g().includes(n)&&(l=void 0)})}}}t.onLoaded(()=>{e.listenOn(e.renderRoot,"focusin",ae),e.listenOn(e.renderRoot,"focusout",le,{capture:!0})}),e.listenOn(e.el.ownerDocument,"focusin",i=>{if(!l&&!b)return;let o=i.composedPath();b&&o.includes(b)&&M.add(i),b=null,l&&!o.includes(l)&&(l=void 0)},{capture:!0}),t.onDisconnected(()=>{l=void 0,b=null,r.forEach(F)});let v={get activeElement(){return h},get activeIndex(){return f},get hasFocus(){return s.hasFocus||(d.getEntryElement?.()?.matches(":focus-within")??!1)},isFocusFromItem(i){return M.has(i)},get isRestoringFocus(){return O},get shouldRecoverFocus(){if(!l)return!1;let i=j(e.el);return!(e.el.ownerDocument.activeElement===e.el.ownerDocument.body||i instanceof ShadowRoot&&!i.activeElement&&i.host.matches(":focus-within"))&&!l.matches(":focus-within")?(l=void 0,!1):!l.isConnected||!g().includes(l)},update(i,o){let a=d.getEntryElement?.();m.forEach(F);let n=s.getFocusableElements(a),x=pe(a,n),ce=x.length>0?x:m.filter(c=>c.isConnected&&a?.contains(c));p=i;let de=d.getTraversableElements?.()??i;f=o&&d.isActive?.()!==!1&&i.includes(o)?de.indexOf(o):-1,h=f>=0?o:null;let he=s.getDeepActiveElement();u=n.find(c=>c===he)??(u&&n.includes(u)?u:n[0]),m=ce;let B=h?[...i,...m]:i,ue=new Set(B);r.forEach(c=>{ue.has(c)||F(c)}),B.forEach(c=>{if(!r.has(c)){let W=E.get(c);W?W.referenceCount++:E.set(c,{attribute:c.getAttribute("tabindex"),tabIndex:c.tabIndex,referenceCount:1}),r.add(c)}let U=c===h?0:-1;c.getAttribute("tabindex")!==String(U)&&(c.tabIndex=U)})},setActiveIndex(i){let o=d.getElements?.()??p,a=d.getTraversableElements?.()??o,n=i>=0?a[i]??null:null;v.update(o,n)},navigate(i){let o=g(),a=o.length;if(!a)return v.setActiveIndex(-1),null;let n=f;return n<0||n>=a?n=i==="previous"||i==="last"?a-1:0:i==="next"?n=(n+1)%a:i==="previous"?n=(n-1+a)%a:i==="first"?n=0:i==="last"&&(n=a-1),v.update(d.getElements?.()??p,o[n]),h},reconcile(){let i=g(),o=h?i.indexOf(h):-1,a=o>=0?o:i.findIndex(n=>n.matches(":focus-within"));return v.setActiveIndex(a>=0?a:Math.min(Math.max(f,0),i.length-1)),h},restoreFocus(i="within"){let o=p.some(s.isFocusedWithin)||m.some(s.isFocusedWithin)||u!==void 0&&s.isFocusedWithin(u);if(!(!(i==="force"||o||i==="recover"&&v.shouldRecoverFocus)||!u||!u.isConnected)){O=!0;try{u.focus(),l=void 0}finally{O=!1}}}};return v}),me={trigger:"trigger"},$={content:"content",wrapper:"wrapper",triggerContainer:"trigger-container"},ve=N`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}.wrapper{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.wrapper{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .wrapper{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.wrapper[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.wrapper:popover-open{display:block}.wrapper .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;border-radius:var(--calcite-corner-radius-sm);z-index:var(--calcite-z-index)}.wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.wrapper .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}.content{overflow-y:auto;overflow-x:hidden;inline-size:var(--calcite-dropdown-width, var(--calcite-internal-dropdown-width));background-color:var(--calcite-dropdown-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)));max-block-size:var(--calcite-dropdown-max-height, 45vh)}.trigger-container{position:relative;display:flex;flex:1 1 auto;block-size:100%;overflow-wrap:break-word;word-break:break-word}.width-s{--calcite-internal-dropdown-width: 12rem}.width-m{--calcite-internal-dropdown-width: 14rem}.width-l{--calcite-internal-dropdown-width: 16rem}@media(forced-colors:active){:host([open]) .wrapper{border:var(--calcite-border-width-sm) solid canvasText}}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}`,be=oe({click:!0,hover:!0}),z=class extends V{constructor(){super(),this.referenceElementController=re({manager:be})(this),this.direction=q(),this.focusLastDropdownItem=!1,this.focusActiveItemOnOpen=!0,this.focusedElementOnOpen=null,this._open=!1,this.groups=[],this.items=[],this.mutationObserver=C("mutation",()=>this.updateItems()),this.transitionProp="opacity",this.resizeObserver=C("resize",e=>this.resizeObserverCallback(e)),this.onReferenceElementKeyDown=e=>this.keyDownHandler(e),this.onReferenceElementFocusIn=e=>this.openHoverDropdown(e),this.onReferenceElementPointerOpen=()=>{this.open||(this.focusActiveItemOnOpen=!1)},this.focusable=P()(this),this.rovingTabIndex=fe({getElements:()=>this.items,getEntryElement:()=>this.referenceEl instanceof Element?this.referenceEl:void 0,getTraversableElements:()=>this.getTraversableItems(),isActive:()=>this.open&&!this.disabled&&this.focusActiveItemOnOpen})(this),this.interactiveContainer=J(this),this.topLayer=X({target:()=>this.floatingEl})(this),this.closeOnSelectDisabled=!1,this.disabled=!1,this.maxItems=0,this.offsetDistance=0,this.offsetSkidding=0,this.overlayPositioning="absolute",this.placement=H,this.scale="m",this.selectedItems=[],this.topLayerDisabled=!1,this.type="click",this.calciteDropdownBeforeClose=I({cancelable:!1}),this.calciteDropdownBeforeOpen=I({cancelable:!1}),this.calciteDropdownClose=I({cancelable:!1}),this.calciteDropdownOpen=I({cancelable:!1}),this.calciteDropdownSelect=I({cancelable:!1}),this.listen("pointerenter",this.pointerEnterHandler),this.listen("pointerleave",this.pointerLeaveHandler),this.listen("calciteInternalDropdownItemSelect",this.handleItemSelect)}static{this.properties={referenceEl:[16,{},{state:!0}],closeOnSelectDisabled:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],maxItems:[11,{},{reflect:!0,type:Number}],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}],referenceElement:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],type:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=ve}get referenceElementType(){return this.referenceElement?this.type:void 0}get autoClose(){return!0}get isRestoringFocus(){return this.rovingTabIndex.isRestoringFocus}get open(){return this._open}set open(e){e&&!this._open&&(this.focusedElementOnOpen=this.focusable.getDeepActiveElement()),this._open=e}async reposition(e=!1){let{filteredFlipPlacements:t,floatingEl:s,offsetDistance:r,offsetSkidding:p,overlayPositioning:h,placement:f,referenceEl:m}=this;return ee(this,{direction:this.direction,floatingEl:s,referenceEl:m,offsetDistance:r,offsetSkidding:p,overlayPositioning:h,placement:f,flipPlacements:t,type:"menu"},e)}async setFocus(e){return this.focusable.setFocus(()=>{let t=this.referenceEl instanceof HTMLElement?this.referenceEl:this.floatingEl;return t?{target:t,strategy:"focusable"}:void 0},e)}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{attributeFilter:["disabled","hidden","inert"],attributes:!0,childList:!0,subtree:!0}),this.setFilteredPlacements(),this.updateItems(),w(this)}load(){this.listenOn(document,"click",this.closeCalciteDropdownOnClick),this.listenOn(document,"calciteDropdownOpen",this.closeCalciteDropdownOnOpenEvent)}willUpdate(e){e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handleDisabledChange(this.disabled),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("maxItems")&&this.hasUpdated&&this.setMaxScrollerHeight(),this.hasUpdated&&(e.has("offsetDistance")&&this.offsetDistance!==0||e.has("offsetSkidding")&&this.offsetSkidding!==0||e.has("overlayPositioning")&&this.overlayPositioning!=="absolute"||e.has("placement")&&this.placement!==H)&&this.reposition(!0),e.has("scale")&&(this.hasUpdated||this.scale!=="m")&&this.handlePropsChange(),e.has("referenceElement")&&!this.referenceElement&&this.open&&this.topLayer.hide()}updated(e){e.has("referenceEl")&&this.referenceElementType&&(this.syncTabStops(),w(this))}loaded(){this.updateSelectedItems(),w(this)}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),ie(this)}openHandler(){if(this.disabled&&this.open){this.open=!1,this.focusActiveItemOnOpen=!0,this.rovingTabIndex.setActiveIndex(-1);return}this.open||(this.focusActiveItemOnOpen=!0),Q(this),this.open||this.rovingTabIndex.setActiveIndex(-1),this.reposition(!0)}handleDisabledChange(e){e&&(this.open=!1,this.rovingTabIndex.setActiveIndex(-1))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupProps()}closeCalciteDropdownOnClick(e){this.referenceElementType||this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown()}closeCalciteDropdownOnOpenEvent(e){this.referenceElementType||e.composedPath().includes(this.el)||this.closeCalciteDropdown()}pointerEnterHandler(){this.referenceElementType||this.disabled||this.type!=="hover"||(this.open||(this.focusActiveItemOnOpen=!1),this.open=!0)}pointerLeaveHandler(){this.referenceElementType||this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.closest("[hidden], [inert]"))}async handleItemSelect(e){this.updateSelectedItems(),this.syncActiveItemFromTraversableItems();let t=this.focusable.getDeepActiveElement();if(e.stopPropagation(),this.calciteDropdownSelect.emit(),!this.closeOnSelectDisabled)this.closeCalciteDropdown(),this.rovingTabIndex.restoreFocus("recover");else{let{requestedDropdownItem:s}=e.detail,r=this.getTraversableItems().indexOf(s);if(r<0||!s.isConnected){this.updateItems();return}s.matches(":focus-within")&&this.focusable.isFocusUnchanged(t)&&(this.rovingTabIndex.setActiveIndex(r),await this.scrollActiveItemIntoView(s,t))}}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?Z(t,e):void 0}updateItems(){this.items=this.groups.flatMap(e=>Array.from(e.querySelectorAll("calcite-dropdown-item"))),this.updateSelectedItems(),this.syncActiveItemFromTraversableItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)}updateGroups(e){let t=e.target.assignedElements({flatten:!0}).filter(ne);this.groups=t,this.updateItems(),this.updateGroupProps()}updateGroupProps(){this.groups.forEach((e,t)=>{e.scale=this.scale,e.position=t})}resizeObserverCallback(e){e.forEach(({target:t})=>{t===this.referenceEl?this.setDropdownWidth():t===this.scrollerEl&&this.setMaxScrollerHeight()})}setDropdownWidth(){let{referenceEl:e,scrollerEl:t}=this;!t||!(e instanceof HTMLElement)||(t.style.minWidth=`${e.clientWidth}px`)}setMaxScrollerHeight(){let{maxItems:e,items:t,scrollerEl:s}=this;if(!s)return;let r=t.length>=e&&e>0?this.getYDistanceFromScroller(t.at(e-1)):0;s.style.maxBlockSize=r>0?`${r}px`:"",this.reposition(!0)}setScrollerAndTransitionEl(e){k(this.resizeObserver,this.scrollerEl,e),this.scrollerEl=e,this.transitionEl=e}onBeforeOpen(){this.setInitialActiveItem(),this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.rovingTabIndex.restoreFocus("recover"),this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit(),te(this),this.topLayer.hide()}setReferenceEl(e){let t=this.referenceEl instanceof HTMLElement?this.referenceEl:void 0,s=e instanceof HTMLElement?e:void 0;k(this.resizeObserver,t,s),!(this.referenceElementType||!s)&&(this.referenceEl=e,this.syncTabStops(),w(this))}setFloatingEl(e){this.floatingEl=e,w(this)}handleTriggerSlotChange(){this.syncTabStops()}keyDownHandler(e){let t=e.composedPath();if(this.disabled||!t.includes(this.floatingEl)&&(!(this.referenceEl instanceof Element)||!t.includes(this.referenceEl)))return;let{defaultPrevented:s,key:r}=e;if(!s){if(this.open&&r==="Escape"){this.closeCalciteDropdown(),this.rovingTabIndex.restoreFocus(),e.preventDefault();return}if(!this.open&&R(r)){this.focusActiveItemOnOpen=!0,this.open=!0,e.preventDefault();return}if(!this.open&&(r==="ArrowDown"||r==="ArrowUp")){e.preventDefault(),this.focusActiveItemOnOpen=!0,this.focusLastDropdownItem=r==="ArrowUp",this.open=!0;return}if(this.open){if(r==="Tab"){this.rovingTabIndex.restoreFocus(),this.closeCalciteDropdown();return}if(r==="ArrowDown"){e.preventDefault(),this.navigateActiveItem("next");return}if(r==="ArrowUp"){e.preventDefault(),this.navigateActiveItem("previous");return}if(r==="Home"){e.preventDefault(),this.navigateActiveItem("first");return}if(r==="End"){e.preventDefault(),this.navigateActiveItem("last");return}R(r)&&(e.preventDefault(),this.activateActiveItem())}}}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getYDistanceFromScroller(e){let{scrollerEl:t}=this;return!e||!t?NaN:e.getBoundingClientRect().bottom-t.getBoundingClientRect().top+t.scrollTop}closeCalciteDropdown(){this.open=!1,this.rovingTabIndex.setActiveIndex(-1)}async setInitialActiveItem(){let e=this.getTraversableItems(),t=this.focusLastDropdownItem?e.length-1:0,s=!e.length&&this.focusLastDropdownItem?"last":void 0;this.focusLastDropdownItem=!1,this.rovingTabIndex.setActiveIndex(e.length?t:-1),await this.topLayer.show(),this.focusActiveItemOnOpen&&await this.scrollActiveItemIntoView(void 0,this.focusedElementOnOpen,s)}syncActiveItemFromTraversableItems(){let e=this.getTraversableItems(),t=this.rovingTabIndex.activeElement,s=this.rovingTabIndex.shouldRecoverFocus;if(!this.open||!e.length){this.rovingTabIndex.setActiveIndex(-1),this.open&&t&&s&&this.rovingTabIndex.restoreFocus("force");return}let r=this.rovingTabIndex.reconcile();t&&r&&s&&this.scrollActiveItemIntoView(r)}syncTabStops(){this.rovingTabIndex.update(this.items,this.rovingTabIndex.activeElement)}handleItemFocus(){this.focusActiveItemOnOpen=!0}handleItemFocusOut(e){!e.relatedTarget&&this.rovingTabIndex.shouldRecoverFocus||this.closeHoverDropdown(e)}navigateActiveItem(e){this.focusActiveItemOnOpen=!0;let t=this.rovingTabIndex.navigate(e);t&&this.scrollActiveItemIntoView(t)}async scrollActiveItemIntoView(e,t=this.focusable.getDeepActiveElement(),s){await this.updateComplete,await D(),await D(),e??=this.rovingTabIndex.activeElement??void 0,!(!e||!this.open||this.rovingTabIndex.activeElement!==e||!e.isConnected||!this.focusable.isFocusUnchanged(t))&&(s&&(e=this.rovingTabIndex.navigate(s)??e),await e.setFocus({preventScroll:!0}),e.scrollIntoView({block:"nearest"}))}activateActiveItem(){let e=this.getTraversableItems(),t=this.rovingTabIndex.activeIndex,s=t>=0&&t<e.length?t:0,r=e[s];r&&(this.rovingTabIndex.setActiveIndex(s),r.activateItem())}openHoverDropdown(e){if(!(this.disabled||this.type!=="hover"||this.isRestoringFocus)&&!(this.rovingTabIndex.isFocusFromItem(e)||e.relatedTarget instanceof Node&&this.el.contains(e.relatedTarget))){if(this.focusActiveItemOnOpen=!0,this.open){this.rovingTabIndex.activeElement||this.rovingTabIndex.setActiveIndex(0),this.scrollActiveItemIntoView(this.rovingTabIndex.activeElement??void 0);return}this.open=!0}}async closeHoverDropdown(e){if(!this.open||this.disabled||this.type!=="hover")return;let t=e.relatedTarget;t&&(this.el.contains(t)||this.referenceEl instanceof Element&&this.referenceEl.contains(t))||t instanceof Element&&t.shadowRoot&&(await D(),!this.open||this.rovingTabIndex.hasFocus)||this.closeCalciteDropdown()}toggleClickDropdown(){this.disabled||this.type!=="click"||(this.focusActiveItemOnOpen=!0,this.open=!this.open)}render(){let{open:e}=this;return this.interactiveContainer({disabled:this.disabled,children:A`${this.referenceElementType?null:A`<div class=${T($.triggerContainer)} @click=${this.toggleClickDropdown} @focusin=${this.openHoverDropdown} @focusout=${this.closeHoverDropdown} @keydown=${this.keyDownHandler} ${y(this.setReferenceEl)}><slot .ariaControlsElements=${this.scrollerEl?[this.scrollerEl]:void 0} .ariaExpanded=${e} aria-haspopup=menu name=${me.trigger} @slotchange=${this.handleTriggerSlotChange}></slot></div>`}<div class=${T({[$.wrapper]:!0,[se("width",this.width)]:!!this.width})} .inert=${!e} @focusin=${this.handleItemFocus} @focusout=${this.handleItemFocusOut} @keydown=${this.keyDownHandler} popover=manual ${y(this.setFloatingEl)}><div .ariaLabelledByElements=${this.referenceEl instanceof HTMLElement?[this.referenceEl]:void 0} class=${T({[$.content]:!0,[L.animation]:!0,[L.animationActive]:e})} role=menu ${y(this.setScrollerAndTransitionEl)}><slot @slotchange=${this.updateGroups}></slot></div></div>`})}};G("calcite-dropdown",z);export{z as Dropdown};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{b as C}from"./
|
|
2
|
+
import{b as C}from"./MLEIIIL7.js";import{G as g,l as h,m as v}from"./W77STZAT.js";var W=C((e,t)=>{t.onConnected(()=>{L(e)}),t.onDisconnected(()=>{O(e)})}),w="calciteInternalLabelClick",E="calciteInternalLabelConnected",f="calciteInternalLabelDisconnected",k="calcite-label",i=new WeakMap,r=new WeakMap,c=new WeakMap,o=new WeakMap,s=new Set,D=e=>{let{id:t}=e,l=t&&h(e,{selector:`${k}[for="${t}"]`});if(l)return l;let a=v(e,k);return!a||M(a,e)?null:a};function M(e,t){let l,a="custom-element-ancestor-check",d=(n=>{n.stopImmediatePropagation();let u=n.composedPath();l=u.slice(u.indexOf(t),u.indexOf(e))});return e.addEventListener(a,d,{once:!0}),t.dispatchEvent(new CustomEvent(a,{composed:!0,bubbles:!0})),e.removeEventListener(a,d),l.filter(n=>n!==t&&n!==e).filter(n=>n.tagName?.includes("-")).length>0}function L(e){if(!e)return;let t=D(e.el);if(t&&r.has(t)&&t===e.labelEl||!t&&s.has(e))return;let l=T.bind(e);if(t){e.labelEl=t;let a=i.get(t)||[];a.push(e),i.set(t,a.sort(y)),r.has(e.labelEl)||(r.set(e.labelEl,m),e.labelEl.addEventListener(w,m)),s.delete(e),document.removeEventListener(E,c.get(e)),o.set(e,l),document.addEventListener(f,l)}else s.has(e)||(l(),document.removeEventListener(f,o.get(e)))}function O(e){if(!e||(s.delete(e),document.removeEventListener(E,c.get(e)),document.removeEventListener(f,o.get(e)),c.delete(e),o.delete(e),!e.labelEl))return;let t=i.get(e.labelEl);t.length===1&&(e.labelEl.removeEventListener(w,r.get(e.labelEl)),r.delete(e.labelEl)),i.set(e.labelEl,t.filter(l=>l!==e).sort(y)),e.labelEl=void 0}function y(e,t){return g(e.el,t.el)?-1:1}function m(e){let t=e.detail.sourceEvent.target,l=i.get(this),a=l.find(n=>n.el===t);if(a&&l.includes(a))return;let b=l[0];b.disabled||b.onLabelClick(e)}function I(){s.has(this)&&L(this)}function T(){s.add(this);let e=c.get(this)||I.bind(this);c.set(this,e),document.addEventListener(E,e)}async function q(e){if(await e.componentOnReady(),i.has(e))return;let l=e.for&&e.ownerDocument?.getElementById(e.for);l&&requestAnimationFrame(()=>{for(let a of s)if(a.el===l){L(a);break}})}export{W as a,E as b,f as c,q as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as M,b as D,c as _}from"./
|
|
2
|
+
import{a as M,b as D,c as _}from"./EXBAP2Y4.js";import{a as L,b as P,c as m,d as f,e as A,f as b,n as N,o as v,q as E}from"./3K3WZKX6.js";var j=t=>(...o)=>{let e=f(),s=new t(...o),r=s.exports;m(e.at(-1));let n=s.component.manager;n.W(s,r),s.watchExports(n.W.bind(n,s)),A(s);let i=[s.component,...e].reverse();return v(i,a=>a===void 0?void 0:U(s,a,r),r)},U=(t,{host:o,key:e,isReactive:s},r)=>{let n=o,i=n[e]!==t.exports,a=n[e]!==r,c=r!==t.exports;if(i&&!a&&c&&(n[e]=t.exports),o===t.component){if(s){let l=t.component.manager;a&&l.W(t,n[e]),t.onUpdate(d=>{if(d.has(e)){let w=n[e];w!==t.exports&&l.W(t,w)}})}t.O=s?void 0:e}let u=t.component.constructor.elementProperties.get(e)?.readOnly;t.watchExports(()=>{n[e]!==t.exports&&(u?b(()=>{n[e]=t.exports}):n[e]=t.exports)})};var k=(t,o)=>{let e=t;for(;e;){if(e===o)return!0;if(!e.parentNode)return!1;e.parentNode instanceof ShadowRoot?e=e.parentNode.host:e=e.parentNode}return!1},h=(t,o,e)=>{let s=K(o).subscribe;return s(r=>{r.some(i=>k(t,i.target))&&e()})},y={},K=t=>{let o=t.join(","),e=y[o];if(e!==void 0)return e;let s=new Set,r=new MutationObserver(i=>s.forEach(a=>a(i)));globalThis.document&&r.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0});let n={subscribe:i=>(s.add(i),()=>{s.delete(i),s.size===0&&(r.disconnect(),y[o]=void 0)})};return y[o]=n,n},R=(t,o)=>{let e=t;for(;e;){let s=e.closest?.(o);if(s)return s;let r=e.getRootNode?.();if(r===globalThis.document)return;e=r?.host}};var g=(t,o,e)=>R(t,`[${o}]`)?.getAttribute(o)??e;var x=t=>{let o=g(t,"lang",globalThis.navigator?.language||M);return{lang:o,t9nLocale:_(o)}},T=(t,o,e,s)=>{let r,n=()=>$(t,o(),s).then(i=>{(r?.lang!==i.lang||r.t9nLocale!==i.t9nLocale||r.t9nStrings!==i.t9nStrings)&&e(i),r=i}).catch(i=>{N("error","intl","Error updating component locale state",{detail:{error:i}})});return queueMicrotask(n),h(t,["lang"],n)},$=async(t,o,e=t.localName.split("-").slice(1).join("-"))=>{let{lang:s,t9nLocale:r}=x(t),n=`${o}/${e}/t9n`,a=e===null?{}:await D(r,n,"messages.");return{lang:s,t9nLocale:r,t9nStrings:a}};var S=t=>W(void 0,t),ge=t=>o=>W(o,t),C=class extends E{constructor(o,e){super(o);let s=this.exports;try{P(this.component);let r=e(this.component,this),n=this.exports!==s;if(L(r)){n||this.setProvisionalExports(r);let i=r.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this.P.reject(a)});this.onLoad(async()=>await i)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},W=j(C),be=(t,o)=>new O(t,o),O=class extends E{#e;#t;#o;constructor(o,e){super(),!!1&&(this.#t=o,this.#o=e,this.#e=new MutationObserver(s=>{s.forEach(r=>{o.includes(r.attributeName)&&e.call(this.component,this.component.el.getAttribute(r.attributeName),r.oldValue,r.attributeName)})}))}hostConnected(){this.#t.forEach(o=>{this.component.el.hasAttribute(o)&&this.#o.call(this.component,this.component.el.getAttribute(o),null,o)}),this.#e.observe(this.component.el,{attributes:!0,attributeOldValue:!0,attributeFilter:this.#t})}hostDisconnected(){this.#e.disconnect()}};var ve=t=>(...o)=>{let e=f(),s=new t(...o);return m(e.at(-1)),s};var V="ltr",Ee=()=>S((t,o)=>{o.exports=V,o.onLifecycle(()=>{let e=()=>{let s=g(t.el,"dir",V);o.exports=s==="rtl"?"rtl":"ltr"};return e(),h(t.el,["dir"],e)})}),ye=t=>(o={})=>S((e,s)=>{let r=x(e.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},i=e;s.onLifecycle(()=>T(e.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:p,lang:u})=>{let l={...p,_lang:u,_t9nLocale:c,_loading:!1};s.exports=l;let d=p.componentLabel;typeof d=="string"&&"label"in e&&e.label==null&&(e.label??=d),a(i.messageOverrides)},o.name));let a=c=>{let p=s.exports,u=p._original??p,l=F(u,c);c&&(l._original=u),s.exports=l};return"messageOverrides"in i&&s.onUpdate(c=>{c.has("messageOverrides")&&a(i.messageOverrides)}),o.blocking?(s.setProvisionalExports(n,!1),s.ready):n}),F=(t,o)=>{if(!o)return t;let e={...t};return Object.entries(o).forEach(([s,r])=>{t[s]!==void 0&&(typeof r=="object"?e[s]=F(t[s],r):e[s]=r??t[s])}),e};export{S as a,ge as b,be as c,ve as d,Ee as e,ye as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as c,b as C,c as A}from"./DJLMVPRW.js";import{a as B,b as N}from"./AWELH6FI.js";import{a as R}from"./GJJEZYW5.js";import{a as S}from"./WTNYMVTD.js";import{c as O}from"./KITAKEBT.js";import{a as f}from"./IPC52TFP.js";import{a as L}from"./35FJBHUF.js";import"./TL56TNQ7.js";import{e as _}from"./QAUUNB4V.js";import"./F7HEFBJ3.js";import{A as P,B as W,K as i}from"./W77STZAT.js";import{E as y,F as w,G as D,H as h,M as v,O as E,P as H,T as U,g as I,h as u,p as b}from"./F66HV74D.js";var K=I`.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@keyframes in{0%{opacity:0}to{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0,-5px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0,5px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(.95,.95,1)}to{opacity:1;transform:scaleZ(1)}}`,T=I`:host{position:relative;pointer-events:none;display:flex;flex:0 1 auto;align-items:stretch;z-index:var(--calcite-shell-panel-z-index, var(--calcite-z-index));--calcite-shell-panel-max-height: unset;--calcite-internal-shell-panel-shadow-block-start: 0 4px 8px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-block-end: 0 -4px 8px -1px rgba(0, 0, 0, .08), 0 -2px 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-start: 4px 0 8px -1px rgba(0, 0, 0, .08), 2px 0 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-end: -4px 0 8px -1px rgba(0, 0, 0, .08), -2px 0 4px -1px rgba(0, 0, 0, .04)}.calcite--rtl.content--overlay{--calcite-internal-shell-panel-shadow-inline-start: -4px 0 8px -1px rgba(0, 0, 0, .08), -2px 0 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-end: 4px 0 8px -1px rgba(0, 0, 0, .08), 2px 0 4px -1px rgba(0, 0, 0, .04)}:host([layout=vertical]){z-index:var(--calcite-shell-panel-z-index, calc(var(--calcite-z-index) + 1))}:host([layout=vertical][display-mode=overlay]){z-index:var(--calcite-shell-panel-z-index, calc(var(--calcite-z-index-header) + 1))}:host([layout=vertical][display-mode=float-all]) .content{flex:2}:host([layout=vertical]:not([display-mode=float-all])) .width-s{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 300px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px)}:host([layout=vertical][display-mode=float-all]) .width-s{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px)}:host([layout=vertical]:not([display-mode=float-all])) .width-m{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 420px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px)}:host([layout=vertical][display-mode=float-all]) .width-m{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px)}:host([layout=vertical]:not([display-mode=float-all])) .width-l{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 680px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px)}:host([layout=vertical][display-mode=float-all]) .width-l{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px)}:host([layout=horizontal]) .content{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 30vh)}:host([layout=horizontal]) .height-s{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 20vh)}:host([layout=horizontal]) .height-l{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 40vh)}:host([display-mode=float-all][height=s]) .content{min-block-size:var(--calcite-shell-panel-height, 20vh)}:host([display-mode=float-all][height=m]) .content{min-block-size:var(--calcite-shell-panel-height, 30vh)}:host([display-mode=float-all][height=l]) .content{min-block-size:var(--calcite-shell-panel-height, 40vh)}.container{font-size:var(--calcite-font-size-relative-base);pointer-events:none;box-sizing:border-box;display:flex;flex:1 1 auto;align-items:stretch;background-color:var(--calcite-color-transparent);block-size:100%;color:var(--calcite-shell-panel-text-color, var(--calcite-color-text-2))}.container *{box-sizing:border-box}.container.float-all{margin-block:var(--calcite-theme-space-sm, var(--calcite-spacing-sm));margin-inline:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}.float-all{max-block-size:var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem) );box-shadow:var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm));border-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));overflow:hidden}:host([layout=vertical][position=start]) .float-all{border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-shell-panel-border-color, var(--calcite-color-border-3))}:host([layout=vertical][position=end]) .float-all{border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-shell-panel-border-color, var(--calcite-color-border-3)))}:host([layout=horizontal]) .float-all{border-inline:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-shell-panel-border-color, var(--calcite-color-border-3)))}:host([layout=horizontal]) .container{inline-size:100%;block-size:auto;flex-direction:column}.resize-handle{outline:var(--calcite-border-width-md) solid transparent;outline-offset:var(--calcite-border-width-md);position:absolute;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;box-sizing:border-box;--calcite-internal-shell-panel-resize-handle-offset: calc( (var(--calcite-size-fixed-xxl) - var(--calcite-size-fixed-sm-plus)) / 2 * -1 );z-index:var(--calcite-z-index-header);touch-action:none}.resize-handle:active .resize-handle-bar,.resize-handle:hover .resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-theme-color-surface-4, var(--calcite-color-foreground-3)))}.resize-handle-bar{display:flex;justify-content:center;align-items:center;pointer-events:none;color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-theme-color-surface-1, var(--calcite-color-background)))}.resize-handle:focus .resize-handle-bar{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)))}:host([position=start][layout=vertical]) .resize-handle{inline-size:var(--calcite-size-fixed-xxl);inset-inline-end:var(--calcite-internal-shell-panel-resize-handle-offset);block-size:100%}:host([position=start][layout=vertical]) .resize-handle-bar{block-size:100%;inline-size:var(--calcite-size-fixed-sm-plus);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start][layout=vertical]):host([display-mode^=float]) .resize-handle-bar{border-start-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));border-end-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}:host([position=end][layout=vertical]) .resize-handle{inline-size:var(--calcite-size-fixed-xxl);inset-inline-start:var(--calcite-internal-shell-panel-resize-handle-offset);block-size:100%}:host([position=end][layout=vertical]) .resize-handle-bar{block-size:100%;inline-size:var(--calcite-size-fixed-sm-plus);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=end][layout=vertical]):host([display-mode^=float]) .resize-handle-bar{border-start-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));border-end-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}:host([position=start][layout=horizontal]) .resize-handle{block-size:var(--calcite-size-fixed-xxl);inline-size:100%;inset-block-end:var(--calcite-internal-shell-panel-resize-handle-offset)}:host([position=start][layout=horizontal]) .resize-handle-bar{inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start][layout=horizontal]):host([display-mode^=float]) .resize-handle-bar{border-end-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));border-end-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}:host([position=end][layout=horizontal]) .resize-handle{block-size:var(--calcite-size-fixed-xxl);inline-size:100%;inset-block-start:var(--calcite-internal-shell-panel-resize-handle-offset)}:host([position=end][layout=horizontal]) .resize-handle-bar{inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=end][layout=horizontal]):host([display-mode^=float]) .resize-handle-bar{border-start-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));border-start-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%;inline-size:100%;flex:1 1 auto;max-block-size:unset;max-inline-size:unset}.action-bar-container{pointer-events:auto;display:flex;flex:1 1 auto;box-sizing:border-box}.content-container{display:flex;flex:1 1 auto;align-items:stretch;align-self:stretch;position:relative;box-sizing:border-box;inline-size:100%;block-size:100%}:host([layout=horizontal]) .action-bar-container,:host([layout=horizontal]) .content-container{flex-direction:column}.content{pointer-events:auto;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;align-self:stretch;padding:var(--calcite-space-none);position:relative;box-sizing:border-box;flex:1 1 auto;background-color:var(--calcite-shell-panel-background-color, var(--calcite-theme-color-surface-1, var(--calcite-color-background)));transition:max-block-size var(--calcite-animation-timing),max-inline-size var(--calcite-animation-timing)}:host([layout=vertical]:not([display-mode=float-all])) .content{inline-size:var(--calcite-internal-shell-panel-width);max-inline-size:var(--calcite-internal-shell-panel-max-width);min-inline-size:var(--calcite-internal-shell-panel-min-width)}:host([layout=vertical][display-mode=float-all]) .content{inline-size:var(--calcite-internal-shell-panel-width);min-inline-size:var(--calcite-internal-shell-panel-min-width)}:host([layout=horizontal]) .content{block-size:var(--calcite-internal-shell-panel-height);max-block-size:var(--calcite-internal-shell-panel-max-height);min-block-size:var(--calcite-internal-shell-panel-min-height)}:host([resizable][layout=vertical][position=start]) .content{padding-inline-end:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=vertical][position=end]) .content{padding-inline-start:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=horizontal][position=start]) .content{padding-block-end:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=horizontal][position=end]) .content{padding-block-start:var(--calcite-size-fixed-sm-plus)}.content__header{display:flex;flex:0 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch}.content__body{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.content--overlay{position:absolute;box-shadow:var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm))}:host([layout=vertical]) .content--overlay{inset-block-start:var(--calcite-space-none);block-size:100%}:host([layout=horizontal]) .content--overlay{inset-inline-start:var(--calcite-space-none);inline-size:100%}:host([layout=vertical][position=start]) .content--overlay{inset-inline-start:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-inline-start)}:host([layout=vertical][position=end]) .content--overlay{inset-inline-end:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-inline-end)}:host([layout=horizontal][position=start]) .content--overlay{inset-block-start:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-block-start)}:host([layout=horizontal][position=end]) .content--overlay{inset-block-end:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-block-end)}.float--content{margin-block-end:auto;block-size:auto;overflow:hidden;box-shadow:var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm));border-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));margin-inline:var(--calcite-theme-space-sm, var(--calcite-spacing-sm));margin-block-start:var(--calcite-theme-space-sm, var(--calcite-spacing-sm));max-block-size:var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem) )}.float--content ::slotted(calcite-panel),.float--content ::slotted(calcite-flow){max-block-size:unset}:host([layout=horizontal]) .float--content{margin-block:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([position=start]) .float--content ::slotted(calcite-panel),:host([position=start]) .float--content ::slotted(calcite-flow),:host([position=end]) .float--content ::slotted(calcite-panel),:host([position=end]) .float--content ::slotted(calcite-flow){border-style:none}slot[name=action-bar]::slotted(calcite-action-bar),.content ::slotted(calcite-flow),.content ::slotted(calcite-panel:not([closed])){border:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start]:not([slot=panel-end])) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start]:not([slot=panel-end])) .content ::slotted(calcite-flow),:host([position=start]:not([slot=panel-end])) .content ::slotted(calcite-panel),:host([position=end][slot=panel-start]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end][slot=panel-start]) .content ::slotted(calcite-flow),:host([position=end][slot=panel-start]) .content ::slotted(calcite-panel){border-inline-start:none}:host([resizable][layout=vertical]) .content ::slotted(calcite-flow),:host([resizable][layout=vertical]) .content ::slotted(calcite-panel){border-inline-start:none;border-inline-end:none}:host([resizable][layout=horizontal]) .content ::slotted(calcite-flow),:host([resizable][layout=horizontal]) .content ::slotted(calcite-panel){border-block-start:none;border-block-end:none}:host([position=end]:not([slot=panel-start])) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end]:not([slot=panel-start])) .content ::slotted(calcite-flow),:host([position=end]:not([slot=panel-start])) .content ::slotted(calcite-panel),:host([position=start][slot=panel-end]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start][slot=panel-end]) .content ::slotted(calcite-flow),:host([position=start][slot=panel-end]) .content ::slotted(calcite-panel){border-inline-end:none}:host([layout=horizontal]) slot[name=action-bar]::slotted(calcite-action-bar){border-inline:0}:host([layout=horizontal][position=start]) .content ::slotted(calcite-flow),:host([layout=horizontal][position=start]) .content ::slotted(calcite-panel){border-inline:0;border-block-start:0}:host([layout=horizontal][position=end]) .content ::slotted(calcite-flow),:host([layout=horizontal][position=end]) .content ::slotted(calcite-panel){border-inline:0;border-block-end:0}:host([display-mode=dock]) .resize-handle-bar,:host([display-mode=float-all]) .resize-handle-bar,:host([display-mode=overlay]) .resize-handle-bar{border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}`,$=class extends D{constructor(){super(...arguments),this.direction=_(),this.resizeHandleRef=y(),this.actionBars=[],this.contentRef=y(),this.containerRef=y(),this.messages=L(),this.sizeOverride=N({targetElement:this.contentRef,getBounds:()=>({inline:{min:this.resizeValues.minInlineSize,max:this.getMaxInlineSize()},block:{min:this.resizeValues.minBlockSize,max:this.getMaxBlockSize()}}),onResize:e=>{this.resizeValues=e}}),this.resizeValues={inlineSize:null,blockSize:null,minInlineSize:null,minBlockSize:null,maxInlineSize:null,maxBlockSize:null},this.hasHeader=!1,this.collapsed=!1,this.displayMode="dock",this.layout="vertical",this.position="start",this.resizable=!1,this.width="m",this.calciteInternalShellPanelResizeEnd=b({cancelable:!1}),this.calciteInternalShellPanelResizeStart=b({cancelable:!1}),this.calciteShellPanelCollapse=b({cancelable:!1}),this.calciteShellPanelExpand=b({cancelable:!1})}static{this.properties={resizeValues:[16,{},{state:!0}],hasHeader:[16,{},{state:!0}],collapsed:[7,{},{reflect:!0,type:Boolean}],displayMode:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:[3,{},{reflect:!0}],resizable:[7,{},{reflect:!0,type:Boolean}],shellSizingDataProvider:[0,{},{attribute:!1}],height:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.styles=[T,K]}async updateSize(e){this.updateSizeInternal(e)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.refreshResize()}load(){this.listenOn(window,"resize",this.handleWindowResize)}willUpdate(e){let t=!1;e.has("layout")&&(this.hasUpdated||this.layout!=="vertical")&&(this.setActionBarsLayout(this.actionBars),this.updateSizeInternal({inline:null,block:null}),t=!0),(e.has("direction")&&this.hasUpdated||e.has("position")&&(this.hasUpdated||this.position!=="start"))&&(t=!0),(e.has("collapsed")&&(this.hasUpdated||this.collapsed!==!1)||e.has("resizable")&&(this.hasUpdated||this.resizable!==!1))&&(t=this.resizable&&!this.collapsed,t||this.cleanUpInteractions()),t&&this.refreshResize(),e.has("collapsed")&&this.hasUpdated&&(this.collapsed?this.calciteShellPanelCollapse.emit():this.calciteShellPanelExpand.emit())}disconnectedCallback(){super.disconnectedCallback(),this.cleanUpInteractions()}handleWindowResize(){this.resizable&&!this.collapsed&&this.refreshResize()}updateSizeInternal(e){this.contentRef.value&&this.sizeOverride.resize(e)}handleKeyDown(e){let{key:t,defaultPrevented:a,shiftKey:o}=e,{position:l,layout:n,resizable:r,contentRef:s,resizeValues:{maxBlockSize:d,maxInlineSize:m,minBlockSize:z,minInlineSize:x}}=this,M=[...n==="horizontal"?["ArrowUp","ArrowDown"]:["ArrowLeft","ArrowRight"],"Home","End"];if(!r||!s.value||a||!M.includes(t))return;let g=s.value.getBoundingClientRect(),V=this.direction==="rtl"?-1:1,p=o?H:E;switch(t){case"ArrowUp":this.updateSizeInternal({block:g.height+(n==="horizontal"&&l==="end"?p:-p)}),e.preventDefault();break;case"ArrowDown":this.updateSizeInternal({block:g.height+(n==="horizontal"&&l==="end"?-p:p)}),e.preventDefault();break;case"ArrowLeft":this.updateSizeInternal({inline:g.width+(n==="vertical"&&l==="end"?p:-p)*V}),e.preventDefault();break;case"ArrowRight":this.updateSizeInternal({inline:g.width+(n==="vertical"&&l==="end"?-p:p)*V}),e.preventDefault();break;case"Home":this.updateSizeInternal(n==="horizontal"?{block:z}:{inline:x}),e.preventDefault();break;case"End":this.updateSizeInternal(n==="horizontal"?{block:d}:{inline:m}),e.preventDefault();break}}cleanUpInteractions(){this.interaction?.unset()}updateResizeValues(){let{contentRef:e,layout:t}=this;if(!e.value)return;let a=window.getComputedStyle(e.value),o=i(a.maxInlineSize)||window.innerWidth,l=i(a.maxBlockSize)||window.innerHeight,n=t==="vertical"?this.getAvailableInlineSize():null,r=t==="horizontal"?this.getAvailableBlockSize():null;this.resizeValues={inlineSize:i(a.inlineSize),blockSize:i(a.blockSize),minInlineSize:i(a.minInlineSize),minBlockSize:i(a.minBlockSize),maxInlineSize:n===null?o:Math.min(o,n),maxBlockSize:r===null?l:Math.min(l,r)}}getAvailableBlockSize(){return this.getAvailableSize("block")}getAvailableInlineSize(){return this.getAvailableSize("inline")}getAvailableSize(e){let t=e==="inline"?"width":"height",a=this.shellSizingDataProvider?.(e),o=this.actionBarContainerEl?.getBoundingClientRect()[t]??0,l=Math.max(o,this.actionBars.reduce((d,m)=>d+m.getBoundingClientRect()[t],0));if(!a)return null;let{availableSize:n}=a,r=this.getContainerSpacingSize(e),s=this.getContentSpacingSize(e);return Math.max(Math.floor(n)-Math.ceil(l)-Math.ceil(r)-Math.ceil(s),0)}getContentSpacingSize(e){let t=this.contentRef.value;if(!t)return 0;let a=window.getComputedStyle(t);return e==="inline"?i(a.marginInlineStart)+i(a.marginInlineEnd)+i(a.borderInlineStartWidth)+i(a.borderInlineEndWidth):i(a.marginBlockStart)+i(a.marginBlockEnd)+i(a.borderBlockStartWidth)+i(a.borderBlockEndWidth)}getContainerSpacingSize(e){let t=this.containerRef.value;if(!t)return 0;let a=window.getComputedStyle(t);return e==="inline"?i(a.marginInlineStart)+i(a.marginInlineEnd)+i(a.borderInlineStartWidth)+i(a.borderInlineEndWidth):i(a.marginBlockStart)+i(a.marginBlockEnd)+i(a.borderBlockStartWidth)+i(a.borderBlockEndWidth)}getMaxBlockSize(){let{layout:e,contentRef:t}=this;if(e!=="horizontal")return this.resizeValues.maxBlockSize;if(!t.value)return this.resizeValues.maxBlockSize;let a=window.getComputedStyle(t.value),o=i(a.maxBlockSize)||window.innerHeight,l=this.getAvailableBlockSize();return l===null?o:Math.min(o,l)}getMaxInlineSize(){let{layout:e,contentRef:t}=this;if(e!=="vertical")return this.resizeValues.maxInlineSize;if(!t.value)return this.resizeValues.maxInlineSize;let a=window.getComputedStyle(t.value),o=i(a.maxInlineSize)||window.innerWidth,l=this.getAvailableInlineSize();return l===null?o:Math.min(o,l)}async refreshResize(){await this.componentOnReady(),await this.updateComplete,this.updateResizeValues(),this.setUpResizeInteractions()}setUpResizeInteractions(){this.cleanUpInteractions();let{el:e,contentRef:t,resizable:a,position:o,collapsed:l,resizeHandleRef:n,layout:r}=this,s=n.value;if(!t.value||l||!a||!s)return;let d=this.direction==="rtl",m=this.resizeValues.minInlineSize===null||this.resizeValues.minBlockSize===null?void 0:{width:this.resizeValues.minInlineSize,height:this.resizeValues.minBlockSize};this.interaction=B(t.value,{context:e.ownerDocument}).resizable({edges:{top:o==="end"&&r==="horizontal"?s:!1,right:o===(d?"end":"start")&&r==="vertical"?s:!1,bottom:o==="start"&&r==="horizontal"?s:!1,left:o===(d?"start":"end")&&r==="vertical"?s:!1},modifiers:[B.modifiers.restrictSize({min:m})],listeners:{resizestart:()=>{this.calciteInternalShellPanelResizeStart.emit()},resizeend:()=>{this.calciteInternalShellPanelResizeEnd.emit()},move:({rect:z})=>{let x=r==="horizontal";this.updateSize(x?{block:z.height}:{inline:z.width})}}})}setActionBarsLayout(e){e.forEach(t=>t.layout=this.layout)}handleActionBarSlotChange(e){let t=W(e).filter(O);this.actionBars=t,this.setActionBarsLayout(t)}handleHeaderSlotChange(e){this.hasHeader=P(e)}getResizeIcon(){let{layout:e}=this;return e==="horizontal"?A.dragVertical:A.dragHorizontal}renderHeader(){return f("header",u`<div class=${h(c.contentHeader)} .hidden=${!this.hasHeader}><slot name=${C.header} @slotchange=${this.handleHeaderSlotChange}></slot></div>`)}render(){let{collapsed:e,position:t,resizable:a,layout:o,displayMode:l,resizeValues:n}=this,r=this.direction,s=o==="horizontal",d=!e&&a?f("resize-handle",u`<div .ariaLabel=${this.messages.resize} .ariaOrientation=${s?"vertical":"horizontal"} .ariaValueMax=${S(s?"block":"inline",n.maxBlockSize,n.maxInlineSize)} .ariaValueMin=${S(s?"block":"inline",n.minBlockSize,n.minInlineSize)} .ariaValueNow=${S(s?"block":"inline",n.blockSize,n.inlineSize)} class=${h(c.resizeHandle)} @keydown=${this.handleKeyDown} role=separator tabindex=0 ${w(this.resizeHandleRef)}><div class=${h(c.resizeHandleBar)}><calcite-icon .icon=${this.getResizeIcon()} scale=s></calcite-icon></div></div>`):null,m=()=>o==="horizontal"?t==="start"?v.calciteAnimateInDown:v.calciteAnimateInUp:r==="ltr"&&t==="end"||r==="rtl"&&t==="start"?v.calciteAnimateInLeft:v.calciteAnimateInRight,z=u`<div class=${h(c.contentContainer)}>${f("content",u`<div class=${h({[v.rtl]:r==="rtl",[c.content]:!0,[c.contentOverlay]:l==="overlay",[c.floatContent]:l==="float-content",[v.calciteAnimate]:l==="overlay",[m()]:l==="overlay",[R("width",this.width)]:!0,[R("height",this.height)]:!!this.height})} .hidden=${e} ${w(this.contentRef)}>${this.renderHeader()}<div class=${h(c.contentBody)}><slot></slot></div>${d}</div>`)}</div>`,k=[f("action-bar-container",u`<div class=${h(c.actionBarContainer)}><slot name=${C.actionBar} @slotchange=${this.handleActionBarSlotChange}></slot></div>`),z];return t==="end"&&k.reverse(),u`<div class=${h({[c.container]:!0,[c.floatAll]:l==="float-all"})} ${w(this.containerRef)}>${k}</div>`}};U("calcite-shell-panel",$);export{$ as ShellPanel};
|
|
2
|
+
import{a as c,b as C,c as A}from"./DJLMVPRW.js";import{a as B,b as N}from"./CPPMCAID.js";import{a as R}from"./GJJEZYW5.js";import{a as S}from"./WTNYMVTD.js";import{c as O}from"./KITAKEBT.js";import{a as f}from"./2KMSPIAS.js";import{a as L}from"./BWTQZDQ6.js";import"./TL56TNQ7.js";import{e as _}from"./MLEIIIL7.js";import"./EXBAP2Y4.js";import{A as P,B as W,K as i}from"./W77STZAT.js";import{E as y,F as w,G as D,H as h,M as v,O as E,P as H,T as U,g as I,h as u,p as b}from"./3K3WZKX6.js";var K=I`.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@keyframes in{0%{opacity:0}to{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0,-5px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0,5px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(.95,.95,1)}to{opacity:1;transform:scaleZ(1)}}`,T=I`:host{position:relative;pointer-events:none;display:flex;flex:0 1 auto;align-items:stretch;z-index:var(--calcite-shell-panel-z-index, var(--calcite-z-index));--calcite-shell-panel-max-height: unset;--calcite-internal-shell-panel-shadow-block-start: 0 4px 8px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-block-end: 0 -4px 8px -1px rgba(0, 0, 0, .08), 0 -2px 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-start: 4px 0 8px -1px rgba(0, 0, 0, .08), 2px 0 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-end: -4px 0 8px -1px rgba(0, 0, 0, .08), -2px 0 4px -1px rgba(0, 0, 0, .04)}.calcite--rtl.content--overlay{--calcite-internal-shell-panel-shadow-inline-start: -4px 0 8px -1px rgba(0, 0, 0, .08), -2px 0 4px -1px rgba(0, 0, 0, .04);--calcite-internal-shell-panel-shadow-inline-end: 4px 0 8px -1px rgba(0, 0, 0, .08), 2px 0 4px -1px rgba(0, 0, 0, .04)}:host([layout=vertical]){z-index:var(--calcite-shell-panel-z-index, calc(var(--calcite-z-index) + 1))}:host([layout=vertical][display-mode=overlay]){z-index:var(--calcite-shell-panel-z-index, calc(var(--calcite-z-index-header) + 1))}:host([layout=vertical][display-mode=float-all]) .content{flex:2}:host([layout=vertical]:not([display-mode=float-all])) .width-s{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 300px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px)}:host([layout=vertical][display-mode=float-all]) .width-s{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px)}:host([layout=vertical]:not([display-mode=float-all])) .width-m{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 420px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px)}:host([layout=vertical][display-mode=float-all]) .width-m{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px)}:host([layout=vertical]:not([display-mode=float-all])) .width-l{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 680px);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px)}:host([layout=vertical][display-mode=float-all]) .width-l{--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px)}:host([layout=horizontal]) .content{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 30vh)}:host([layout=horizontal]) .height-s{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 20vh)}:host([layout=horizontal]) .height-l{--calcite-internal-shell-panel-height: var(--calcite-shell-panel-height);--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 40vh)}:host([display-mode=float-all][height=s]) .content{min-block-size:var(--calcite-shell-panel-height, 20vh)}:host([display-mode=float-all][height=m]) .content{min-block-size:var(--calcite-shell-panel-height, 30vh)}:host([display-mode=float-all][height=l]) .content{min-block-size:var(--calcite-shell-panel-height, 40vh)}.container{font-size:var(--calcite-font-size-relative-base);pointer-events:none;box-sizing:border-box;display:flex;flex:1 1 auto;align-items:stretch;background-color:var(--calcite-color-transparent);block-size:100%;color:var(--calcite-shell-panel-text-color, var(--calcite-color-text-2))}.container *{box-sizing:border-box}.container.float-all{margin-block:var(--calcite-theme-space-sm, var(--calcite-spacing-sm));margin-inline:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}.float-all{max-block-size:var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem) );box-shadow:var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm));border-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));overflow:hidden}:host([layout=vertical][position=start]) .float-all{border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-shell-panel-border-color, var(--calcite-color-border-3))}:host([layout=vertical][position=end]) .float-all{border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-shell-panel-border-color, var(--calcite-color-border-3)))}:host([layout=horizontal]) .float-all{border-inline:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-shell-panel-border-color, var(--calcite-color-border-3)))}:host([layout=horizontal]) .container{inline-size:100%;block-size:auto;flex-direction:column}.resize-handle{outline:var(--calcite-border-width-md) solid transparent;outline-offset:var(--calcite-border-width-md);position:absolute;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;box-sizing:border-box;--calcite-internal-shell-panel-resize-handle-offset: calc( (var(--calcite-size-fixed-xxl) - var(--calcite-size-fixed-sm-plus)) / 2 * -1 );z-index:var(--calcite-z-index-header);touch-action:none}.resize-handle:active .resize-handle-bar,.resize-handle:hover .resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-theme-color-surface-4, var(--calcite-color-foreground-3)))}.resize-handle-bar{display:flex;justify-content:center;align-items:center;pointer-events:none;color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-theme-color-surface-1, var(--calcite-color-background)))}.resize-handle:focus .resize-handle-bar{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)))}:host([position=start][layout=vertical]) .resize-handle{inline-size:var(--calcite-size-fixed-xxl);inset-inline-end:var(--calcite-internal-shell-panel-resize-handle-offset);block-size:100%}:host([position=start][layout=vertical]) .resize-handle-bar{block-size:100%;inline-size:var(--calcite-size-fixed-sm-plus);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start][layout=vertical]):host([display-mode^=float]) .resize-handle-bar{border-start-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));border-end-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}:host([position=end][layout=vertical]) .resize-handle{inline-size:var(--calcite-size-fixed-xxl);inset-inline-start:var(--calcite-internal-shell-panel-resize-handle-offset);block-size:100%}:host([position=end][layout=vertical]) .resize-handle-bar{block-size:100%;inline-size:var(--calcite-size-fixed-sm-plus);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=end][layout=vertical]):host([display-mode^=float]) .resize-handle-bar{border-start-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));border-end-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}:host([position=start][layout=horizontal]) .resize-handle{block-size:var(--calcite-size-fixed-xxl);inline-size:100%;inset-block-end:var(--calcite-internal-shell-panel-resize-handle-offset)}:host([position=start][layout=horizontal]) .resize-handle-bar{inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start][layout=horizontal]):host([display-mode^=float]) .resize-handle-bar{border-end-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));border-end-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}:host([position=end][layout=horizontal]) .resize-handle{block-size:var(--calcite-size-fixed-xxl);inline-size:100%;inset-block-start:var(--calcite-internal-shell-panel-resize-handle-offset)}:host([position=end][layout=horizontal]) .resize-handle-bar{inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=end][layout=horizontal]):host([display-mode^=float]) .resize-handle-bar{border-start-start-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));border-start-end-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%;inline-size:100%;flex:1 1 auto;max-block-size:unset;max-inline-size:unset}.action-bar-container{pointer-events:auto;display:flex;flex:1 1 auto;box-sizing:border-box}.content-container{display:flex;flex:1 1 auto;align-items:stretch;align-self:stretch;position:relative;box-sizing:border-box;inline-size:100%;block-size:100%}:host([layout=horizontal]) .action-bar-container,:host([layout=horizontal]) .content-container{flex-direction:column}.content{pointer-events:auto;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;align-self:stretch;padding:var(--calcite-space-none);position:relative;box-sizing:border-box;flex:1 1 auto;background-color:var(--calcite-shell-panel-background-color, var(--calcite-theme-color-surface-1, var(--calcite-color-background)));transition:max-block-size var(--calcite-animation-timing),max-inline-size var(--calcite-animation-timing)}:host([layout=vertical]:not([display-mode=float-all])) .content{inline-size:var(--calcite-internal-shell-panel-width);max-inline-size:var(--calcite-internal-shell-panel-max-width);min-inline-size:var(--calcite-internal-shell-panel-min-width)}:host([layout=vertical][display-mode=float-all]) .content{inline-size:var(--calcite-internal-shell-panel-width);min-inline-size:var(--calcite-internal-shell-panel-min-width)}:host([layout=horizontal]) .content{block-size:var(--calcite-internal-shell-panel-height);max-block-size:var(--calcite-internal-shell-panel-max-height);min-block-size:var(--calcite-internal-shell-panel-min-height)}:host([resizable][layout=vertical][position=start]) .content{padding-inline-end:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=vertical][position=end]) .content{padding-inline-start:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=horizontal][position=start]) .content{padding-block-end:var(--calcite-size-fixed-sm-plus)}:host([resizable][layout=horizontal][position=end]) .content{padding-block-start:var(--calcite-size-fixed-sm-plus)}.content__header{display:flex;flex:0 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch}.content__body{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.content--overlay{position:absolute;box-shadow:var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm))}:host([layout=vertical]) .content--overlay{inset-block-start:var(--calcite-space-none);block-size:100%}:host([layout=horizontal]) .content--overlay{inset-inline-start:var(--calcite-space-none);inline-size:100%}:host([layout=vertical][position=start]) .content--overlay{inset-inline-start:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-inline-start)}:host([layout=vertical][position=end]) .content--overlay{inset-inline-end:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-inline-end)}:host([layout=horizontal][position=start]) .content--overlay{inset-block-start:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-block-start)}:host([layout=horizontal][position=end]) .content--overlay{inset-block-end:100%;box-shadow:var(--calcite-internal-shell-panel-shadow-block-end)}.float--content{margin-block-end:auto;block-size:auto;overflow:hidden;box-shadow:var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm));border-radius:var(--calcite-shell-panel-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));margin-inline:var(--calcite-theme-space-sm, var(--calcite-spacing-sm));margin-block-start:var(--calcite-theme-space-sm, var(--calcite-spacing-sm));max-block-size:var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem) )}.float--content ::slotted(calcite-panel),.float--content ::slotted(calcite-flow){max-block-size:unset}:host([layout=horizontal]) .float--content{margin-block:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([position=start]) .float--content ::slotted(calcite-panel),:host([position=start]) .float--content ::slotted(calcite-flow),:host([position=end]) .float--content ::slotted(calcite-panel),:host([position=end]) .float--content ::slotted(calcite-flow){border-style:none}slot[name=action-bar]::slotted(calcite-action-bar),.content ::slotted(calcite-flow),.content ::slotted(calcite-panel:not([closed])){border:var(--calcite-border-width-sm) solid var(--calcite-shell-border-color, var(--calcite-color-border-3))}:host([position=start]:not([slot=panel-end])) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start]:not([slot=panel-end])) .content ::slotted(calcite-flow),:host([position=start]:not([slot=panel-end])) .content ::slotted(calcite-panel),:host([position=end][slot=panel-start]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end][slot=panel-start]) .content ::slotted(calcite-flow),:host([position=end][slot=panel-start]) .content ::slotted(calcite-panel){border-inline-start:none}:host([resizable][layout=vertical]) .content ::slotted(calcite-flow),:host([resizable][layout=vertical]) .content ::slotted(calcite-panel){border-inline-start:none;border-inline-end:none}:host([resizable][layout=horizontal]) .content ::slotted(calcite-flow),:host([resizable][layout=horizontal]) .content ::slotted(calcite-panel){border-block-start:none;border-block-end:none}:host([position=end]:not([slot=panel-start])) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=end]:not([slot=panel-start])) .content ::slotted(calcite-flow),:host([position=end]:not([slot=panel-start])) .content ::slotted(calcite-panel),:host([position=start][slot=panel-end]) slot[name=action-bar]::slotted(calcite-action-bar),:host([position=start][slot=panel-end]) .content ::slotted(calcite-flow),:host([position=start][slot=panel-end]) .content ::slotted(calcite-panel){border-inline-end:none}:host([layout=horizontal]) slot[name=action-bar]::slotted(calcite-action-bar){border-inline:0}:host([layout=horizontal][position=start]) .content ::slotted(calcite-flow),:host([layout=horizontal][position=start]) .content ::slotted(calcite-panel){border-inline:0;border-block-start:0}:host([layout=horizontal][position=end]) .content ::slotted(calcite-flow),:host([layout=horizontal][position=end]) .content ::slotted(calcite-panel){border-inline:0;border-block-end:0}:host([display-mode=dock]) .resize-handle-bar,:host([display-mode=float-all]) .resize-handle-bar,:host([display-mode=overlay]) .resize-handle-bar{border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}`,$=class extends D{constructor(){super(...arguments),this.direction=_(),this.resizeHandleRef=y(),this.actionBars=[],this.contentRef=y(),this.containerRef=y(),this.messages=L(),this.sizeOverride=N({targetElement:this.contentRef,getBounds:()=>({inline:{min:this.resizeValues.minInlineSize,max:this.getMaxInlineSize()},block:{min:this.resizeValues.minBlockSize,max:this.getMaxBlockSize()}}),onResize:e=>{this.resizeValues=e}}),this.resizeValues={inlineSize:null,blockSize:null,minInlineSize:null,minBlockSize:null,maxInlineSize:null,maxBlockSize:null},this.hasHeader=!1,this.collapsed=!1,this.displayMode="dock",this.layout="vertical",this.position="start",this.resizable=!1,this.width="m",this.calciteInternalShellPanelResizeEnd=b({cancelable:!1}),this.calciteInternalShellPanelResizeStart=b({cancelable:!1}),this.calciteShellPanelCollapse=b({cancelable:!1}),this.calciteShellPanelExpand=b({cancelable:!1})}static{this.properties={resizeValues:[16,{},{state:!0}],hasHeader:[16,{},{state:!0}],collapsed:[7,{},{reflect:!0,type:Boolean}],displayMode:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:[3,{},{reflect:!0}],resizable:[7,{},{reflect:!0,type:Boolean}],shellSizingDataProvider:[0,{},{attribute:!1}],height:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.styles=[T,K]}async updateSize(e){this.updateSizeInternal(e)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.refreshResize()}load(){this.listenOn(window,"resize",this.handleWindowResize)}willUpdate(e){let t=!1;e.has("layout")&&(this.hasUpdated||this.layout!=="vertical")&&(this.setActionBarsLayout(this.actionBars),this.updateSizeInternal({inline:null,block:null}),t=!0),(e.has("direction")&&this.hasUpdated||e.has("position")&&(this.hasUpdated||this.position!=="start"))&&(t=!0),(e.has("collapsed")&&(this.hasUpdated||this.collapsed!==!1)||e.has("resizable")&&(this.hasUpdated||this.resizable!==!1))&&(t=this.resizable&&!this.collapsed,t||this.cleanUpInteractions()),t&&this.refreshResize(),e.has("collapsed")&&this.hasUpdated&&(this.collapsed?this.calciteShellPanelCollapse.emit():this.calciteShellPanelExpand.emit())}disconnectedCallback(){super.disconnectedCallback(),this.cleanUpInteractions()}handleWindowResize(){this.resizable&&!this.collapsed&&this.refreshResize()}updateSizeInternal(e){this.contentRef.value&&this.sizeOverride.resize(e)}handleKeyDown(e){let{key:t,defaultPrevented:a,shiftKey:o}=e,{position:l,layout:n,resizable:r,contentRef:s,resizeValues:{maxBlockSize:d,maxInlineSize:m,minBlockSize:z,minInlineSize:x}}=this,M=[...n==="horizontal"?["ArrowUp","ArrowDown"]:["ArrowLeft","ArrowRight"],"Home","End"];if(!r||!s.value||a||!M.includes(t))return;let g=s.value.getBoundingClientRect(),V=this.direction==="rtl"?-1:1,p=o?H:E;switch(t){case"ArrowUp":this.updateSizeInternal({block:g.height+(n==="horizontal"&&l==="end"?p:-p)}),e.preventDefault();break;case"ArrowDown":this.updateSizeInternal({block:g.height+(n==="horizontal"&&l==="end"?-p:p)}),e.preventDefault();break;case"ArrowLeft":this.updateSizeInternal({inline:g.width+(n==="vertical"&&l==="end"?p:-p)*V}),e.preventDefault();break;case"ArrowRight":this.updateSizeInternal({inline:g.width+(n==="vertical"&&l==="end"?-p:p)*V}),e.preventDefault();break;case"Home":this.updateSizeInternal(n==="horizontal"?{block:z}:{inline:x}),e.preventDefault();break;case"End":this.updateSizeInternal(n==="horizontal"?{block:d}:{inline:m}),e.preventDefault();break}}cleanUpInteractions(){this.interaction?.unset()}updateResizeValues(){let{contentRef:e,layout:t}=this;if(!e.value)return;let a=window.getComputedStyle(e.value),o=i(a.maxInlineSize)||window.innerWidth,l=i(a.maxBlockSize)||window.innerHeight,n=t==="vertical"?this.getAvailableInlineSize():null,r=t==="horizontal"?this.getAvailableBlockSize():null;this.resizeValues={inlineSize:i(a.inlineSize),blockSize:i(a.blockSize),minInlineSize:i(a.minInlineSize),minBlockSize:i(a.minBlockSize),maxInlineSize:n===null?o:Math.min(o,n),maxBlockSize:r===null?l:Math.min(l,r)}}getAvailableBlockSize(){return this.getAvailableSize("block")}getAvailableInlineSize(){return this.getAvailableSize("inline")}getAvailableSize(e){let t=e==="inline"?"width":"height",a=this.shellSizingDataProvider?.(e),o=this.actionBarContainerEl?.getBoundingClientRect()[t]??0,l=Math.max(o,this.actionBars.reduce((d,m)=>d+m.getBoundingClientRect()[t],0));if(!a)return null;let{availableSize:n}=a,r=this.getContainerSpacingSize(e),s=this.getContentSpacingSize(e);return Math.max(Math.floor(n)-Math.ceil(l)-Math.ceil(r)-Math.ceil(s),0)}getContentSpacingSize(e){let t=this.contentRef.value;if(!t)return 0;let a=window.getComputedStyle(t);return e==="inline"?i(a.marginInlineStart)+i(a.marginInlineEnd)+i(a.borderInlineStartWidth)+i(a.borderInlineEndWidth):i(a.marginBlockStart)+i(a.marginBlockEnd)+i(a.borderBlockStartWidth)+i(a.borderBlockEndWidth)}getContainerSpacingSize(e){let t=this.containerRef.value;if(!t)return 0;let a=window.getComputedStyle(t);return e==="inline"?i(a.marginInlineStart)+i(a.marginInlineEnd)+i(a.borderInlineStartWidth)+i(a.borderInlineEndWidth):i(a.marginBlockStart)+i(a.marginBlockEnd)+i(a.borderBlockStartWidth)+i(a.borderBlockEndWidth)}getMaxBlockSize(){let{layout:e,contentRef:t}=this;if(e!=="horizontal")return this.resizeValues.maxBlockSize;if(!t.value)return this.resizeValues.maxBlockSize;let a=window.getComputedStyle(t.value),o=i(a.maxBlockSize)||window.innerHeight,l=this.getAvailableBlockSize();return l===null?o:Math.min(o,l)}getMaxInlineSize(){let{layout:e,contentRef:t}=this;if(e!=="vertical")return this.resizeValues.maxInlineSize;if(!t.value)return this.resizeValues.maxInlineSize;let a=window.getComputedStyle(t.value),o=i(a.maxInlineSize)||window.innerWidth,l=this.getAvailableInlineSize();return l===null?o:Math.min(o,l)}async refreshResize(){await this.componentOnReady(),await this.updateComplete,this.updateResizeValues(),this.setUpResizeInteractions()}setUpResizeInteractions(){this.cleanUpInteractions();let{el:e,contentRef:t,resizable:a,position:o,collapsed:l,resizeHandleRef:n,layout:r}=this,s=n.value;if(!t.value||l||!a||!s)return;let d=this.direction==="rtl",m=this.resizeValues.minInlineSize===null||this.resizeValues.minBlockSize===null?void 0:{width:this.resizeValues.minInlineSize,height:this.resizeValues.minBlockSize};this.interaction=B(t.value,{context:e.ownerDocument}).resizable({edges:{top:o==="end"&&r==="horizontal"?s:!1,right:o===(d?"end":"start")&&r==="vertical"?s:!1,bottom:o==="start"&&r==="horizontal"?s:!1,left:o===(d?"start":"end")&&r==="vertical"?s:!1},modifiers:[B.modifiers.restrictSize({min:m})],listeners:{resizestart:()=>{this.calciteInternalShellPanelResizeStart.emit()},resizeend:()=>{this.calciteInternalShellPanelResizeEnd.emit()},move:({rect:z})=>{let x=r==="horizontal";this.updateSize(x?{block:z.height}:{inline:z.width})}}})}setActionBarsLayout(e){e.forEach(t=>t.layout=this.layout)}handleActionBarSlotChange(e){let t=W(e).filter(O);this.actionBars=t,this.setActionBarsLayout(t)}handleHeaderSlotChange(e){this.hasHeader=P(e)}getResizeIcon(){let{layout:e}=this;return e==="horizontal"?A.dragVertical:A.dragHorizontal}renderHeader(){return f("header",u`<div class=${h(c.contentHeader)} .hidden=${!this.hasHeader}><slot name=${C.header} @slotchange=${this.handleHeaderSlotChange}></slot></div>`)}render(){let{collapsed:e,position:t,resizable:a,layout:o,displayMode:l,resizeValues:n}=this,r=this.direction,s=o==="horizontal",d=!e&&a?f("resize-handle",u`<div .ariaLabel=${this.messages.resize} .ariaOrientation=${s?"vertical":"horizontal"} .ariaValueMax=${S(s?"block":"inline",n.maxBlockSize,n.maxInlineSize)} .ariaValueMin=${S(s?"block":"inline",n.minBlockSize,n.minInlineSize)} .ariaValueNow=${S(s?"block":"inline",n.blockSize,n.inlineSize)} class=${h(c.resizeHandle)} @keydown=${this.handleKeyDown} role=separator tabindex=0 ${w(this.resizeHandleRef)}><div class=${h(c.resizeHandleBar)}><calcite-icon .icon=${this.getResizeIcon()} scale=s></calcite-icon></div></div>`):null,m=()=>o==="horizontal"?t==="start"?v.calciteAnimateInDown:v.calciteAnimateInUp:r==="ltr"&&t==="end"||r==="rtl"&&t==="start"?v.calciteAnimateInLeft:v.calciteAnimateInRight,z=u`<div class=${h(c.contentContainer)}>${f("content",u`<div class=${h({[v.rtl]:r==="rtl",[c.content]:!0,[c.contentOverlay]:l==="overlay",[c.floatContent]:l==="float-content",[v.calciteAnimate]:l==="overlay",[m()]:l==="overlay",[R("width",this.width)]:!0,[R("height",this.height)]:!!this.height})} .hidden=${e} ${w(this.contentRef)}>${this.renderHeader()}<div class=${h(c.contentBody)}><slot></slot></div>${d}</div>`)}</div>`,k=[f("action-bar-container",u`<div class=${h(c.actionBarContainer)}><slot name=${C.actionBar} @slotchange=${this.handleActionBarSlotChange}></slot></div>`),z];return t==="end"&&k.reverse(),u`<div class=${h({[c.container]:!0,[c.floatAll]:l==="float-all"})} ${w(this.containerRef)}>${k}</div>`}};U("calcite-shell-panel",$);export{$ as ShellPanel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{b as P}from"./IZOUEOSQ.js";import{a as u,b as g,c as L,d as S,e as p,f as $,h as J}from"./BBJ5QQZI.js";import{f as I}from"./COWUMHFG.js";import{a as j}from"./5KNIEIQB.js";import{a as K}from"./NU5GGR3Y.js";import{b as _}from"./WTNYMVTD.js";import{a as W}from"./CZIC32VL.js";import{a as Y}from"./XD6OEN5W.js";import{a as V}from"./YYOLNZRT.js";import"./CSDY4NKB.js";import{a as D}from"./FDHY2TZA.js";import{a as q}from"./CASNTUXN.js";import{k as A}from"./HMIAN5WT.js";import"./JN6YLTUP.js";import{a as E}from"./IPC52TFP.js";import{a as B}from"./35FJBHUF.js";import"./TL56TNQ7.js";import{a as z}from"./BQPPMPJS.js";import"./VMHJHFFS.js";import"./QAUUNB4V.js";import"./F7HEFBJ3.js";import{A as C,i as N,w}from"./W77STZAT.js";import{F as v,G as k,H as h,I as H,M as y,N as T,Q as U,T as G,g as R,h as d,p as m}from"./F66HV74D.js";var Q=R`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=m]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=l]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-xs, var(--calcite-spacing-xs))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}.container{position:relative;background-color:var(--calcite-list-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}.container-height{block-size:100%}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:var(--calcite-color-transparent)}.table-container *{box-sizing:border-box}.table{inline-size:100%}.stack{--calcite-stack-padding-inline: 0;--calcite-stack-padding-block: 0}.sticky-pos{position:sticky;inset-block-start:var(--calcite-space-none);z-index:calc(var(--calcite-z-index-sticky) + 1);background-color:var(--calcite-list-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}::slotted(:is(calcite-action[slot=filter-actions-start],calcite-action[slot=filter-actions-end])){gap:var(--calcite-internal-list-action-spacing);align-self:center}::slotted(calcite-action[slot=filter-actions-start]){margin-inline-start:var(--calcite-internal-list-action-spacing)}::slotted(calcite-action[slot=filter-actions-end]){margin-inline-end:var(--calcite-internal-list-action-spacing)}:host([hidden]){display:none}[hidden]{display:none}`,X=`${S}, ${p}`,O=class extends k{constructor(){super(),this.dragSelector=p,this.focusableItems=[],this.handleSelector="calcite-sort-handle",this.listItems=[],this.listItemGroups=[],this.mutationObserver=D("mutation",()=>{this.willPerformFilter=!0,this.updateListItemsDebounced()}),this.cancelable=Y()(this),this.sortable=j()(this),this.updateListItemsDebounced=V(this.updateListItems,T.nextTick),this.visibleItems=[],this.willFilterEmit=!1,this.willPerformFilter=!1,this.messages=B({blocking:!0}),this.focusSetter=z()(this).setFocus,this.interactiveContainer=W(this),this.filterRowResizeObserver=D("resize",()=>this.updateFilterRowHeight()),this.setFilterContainerEl=e=>{this.filterContainerEl=e,this.observeFilterRow()},this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1,this.sortHandleMenuItems=[],this.hasContent=!1,this.hasEmptyContent=!1,this.filterRowHeight=0,this.disabled=!1,this.dragEnabled=!1,this.filterEnabled=!1,this.filterText="",this.filteredData=[],this.filteredItems=[],this.interactionMode="interactive",this.loading=!1,this.displayMode="flat",this.scale="m",this.selectedItems=[],this.selectionAppearance="icon",this.selectionMode="none",this.sortDisabled=!1,this.calciteInternalListDefaultSlotChange=m({cancelable:!1}),this.calciteListChange=m({cancelable:!1}),this.calciteListDragEnd=m({cancelable:!1}),this.calciteListDragStart=m({cancelable:!1}),this.calciteListFilter=m({cancelable:!1}),this.calciteListOrderChange=m({cancelable:!1}),this.listen("calciteInternalListItemToggle",this.handleCalciteListItemToggle),this.listen("calciteInternalFocusPreviousItem",this.handleCalciteInternalFocusPreviousItem),this.listen("calciteInternalListItemActive",this.handleCalciteInternalListItemActive),this.listen("calciteListItemSelect",this.handleCalciteListItemSelect),this.listen("calciteInternalAssistiveTextChange",this.handleCalciteInternalAssistiveTextChange),this.listen("calciteListItemSortHandleBeforeOpen",this.updateListItemsDebounced),this.listen("calciteSortHandleReorder",this.handleSortReorder),this.listen("calciteSortHandleMove",this.handleSortMove),this.listen("calciteSortHandleAdd",this.handleSortAdd),this.listen("calciteInternalListItemSelect",this.handleCalciteInternalListItemSelect),this.listen("calciteInternalListItemSelectMultiple",this.handleCalciteInternalListItemSelectMultiple),this.listen("calciteInternalListItemChange",this.handleCalciteInternalListItemChange),this.listen("calciteInternalListItemGroupDefaultSlotChange",this.handleCalciteInternalListItemGroupDefaultSlotChange),this.listen("calciteInternalListItemGroupChange",this.handleCalciteInternalListItemChange)}static{this.properties={assistiveText:[16,{},{state:!0}],dataForFilter:[16,{},{state:!0}],hasFilterActionsEnd:[16,{},{state:!0}],hasFilterActionsStart:[16,{},{state:!0}],hasFilterNoResults:[16,{},{state:!0}],sortHandleMenuItems:[16,{},{state:!0}],hasContent:[16,{},{state:!0}],hasEmptyContent:[16,{},{state:!0}],filterRowHeight:[16,{},{state:!0}],canPull:[0,{},{attribute:!1}],canPut:[0,{},{attribute:!1}],disabled:[7,{},{reflect:!0,type:Boolean}],dragEnabled:[7,{},{reflect:!0,type:Boolean}],filterEnabled:[7,{},{reflect:!0,type:Boolean}],filterPredicate:[0,{},{attribute:!1}],filterLabel:[3,{},{reflect:!0}],filterPlaceholder:[3,{},{reflect:!0}],filterProps:[0,{},{attribute:!1}],filterText:[3,{},{reflect:!0}],filteredData:[0,{},{attribute:!1}],filteredItems:[0,{},{attribute:!1}],group:[3,{},{reflect:!0}],interactionMode:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],displayMode:[3,{},{reflect:!0}],numberingSystem:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionAppearance:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}],sortDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=[Q,K]}get hasActiveFilter(){return!!(this.filterEnabled&&this.filterText&&this.filteredItems.length!==this.visibleItems.length)}get showEmptyContentContainer(){return!this.hasContent&&this.hasEmptyContent}get showNoResultsContainer(){return!!(this.filterEnabled&&this.filterText&&this.hasFilterNoResults&&this.visibleItems.length&&!this.filteredItems.length)}get effectiveFilterProps(){return this.filterProps?this.filterProps.filter(e=>e!=="el"):["description","label","metadata","heading"]}emitOrderChangeEvent(e){this.calciteListOrderChange.emit(e)}async setFocus(e){return this.focusSetter(()=>this.filterEnabled?this.filterEl:this.focusableItems.find(t=>t.active),e)}connectedCallback(){super.connectedCallback(),this.connectObserver(),this.willPerformFilter=!0,this.updateListItemsDebounced(),this.setUpSorting(),this.setParentList(),this.setListItemGroups(),this.cancelable.add(this.updateListItemsDebounced)}async load(){this.handleInteractionModeWarning()}willUpdate(e){(e.has("filterText")||e.has("filterProps")||e.has("filterPredicate"))&&this.performFilter(),(e.has("filterEnabled")&&(this.hasUpdated||this.filterEnabled!==!1)||e.has("group")||e.has("sortDisabled")&&(this.hasUpdated||this.sortDisabled!==!1)||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="none")||e.has("selectionAppearance")&&(this.hasUpdated||this.selectionAppearance!=="icon")||e.has("displayMode")&&this.hasUpdated||e.has("scale")&&this.hasUpdated||e.has("canPull")&&this.hasUpdated||e.has("canPut")&&this.hasUpdated||e.has("filterPredicate")&&this.hasUpdated)&&this.handleListItemChange()}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObserver(),this.unobserveFilterRow()}updateListItems(){this.updateFilterRowHeight(),this.updateGroupItems();let{selectionAppearance:e,selectionMode:t,interactionMode:i,dragEnabled:a,el:s,filterEl:n,displayMode:l,scale:r,sortDisabled:c,sortHandleMenuItems:f}=this,b=Array.from(this.el.querySelectorAll(p)),F=s,M=Array.from(F.children).filter(I);if(b.forEach(o=>{o.closest(L)===s&&(o.scale=r,o.selectionAppearance=e,o.selectionMode=t,o.interactionMode=i,o.moveToItems=f.filter(x=>this.validateSortMenuItem({type:"move",fromEl:F,toEl:x.element,dragEl:o,newIndex:0,oldIndex:M.indexOf(o)})),o.addToItems=this.sortHandleMenuItems.filter(x=>this.validateSortMenuItem({type:"add",fromEl:F,toEl:x.element,dragEl:o,newIndex:0,oldIndex:M.indexOf(o)})),o.dragHandle=a,o.displayMode=l,o.sortDisabled=c)}),this.parentListEl){this.setUpSorting();return}this.listItems=b,this.filterEnabled&&this.willPerformFilter&&(this.willPerformFilter=!1,this.dataForFilter=this.getItemData(),n&&(n.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(o=>!o.closed&&!o.hidden),this.updateFilteredItems(),this.borderItems(),this.focusableItems=this.filteredItems.filter(o=>!o.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()}unobserveFilterRow(){this.filterRowResizeObserver?.disconnect()}observeFilterRow(){this.unobserveFilterRow();let e=this.filterContainerEl;e&&this.filterRowResizeObserver?.observe(e)}updateFilterRowHeight(){this.filterRowHeight=this.filterContainerEl?.clientHeight??0}handleListItemChange(){this.willPerformFilter=!0,this.updateListItemsDebounced()}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();let{focusableItems:t}=this,a=t.findIndex(s=>s.active)-1;t[a]&&this.focusRow(t[a])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:i}=this;i.forEach(a=>{a.active=a===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleSortReorder(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleReorder(e))}handleSortAdd(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleAdd(e))}handleSortMove(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleMove(e))}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:i,selectionMode:a}=this;t.selected&&(a==="single"||a==="single-persist")&&i.forEach(s=>s.selected=s===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();let{target:t,detail:i}=e,{focusableItems:a,lastSelectedInfo:s}=this,n=t;if(i.selectMultiple&&s){let l=a.indexOf(n),r=a.indexOf(s.selectedItem),c=Math.min(r,l),f=Math.max(r,l);a.slice(c,f+1).forEach(b=>b.selected=s.selected)}else this.lastSelectedInfo={selectedItem:n,selected:n.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.handleListItemChange())}handleCalciteInternalListItemGroupDefaultSlotChange(e){this.parentListEl||(e.stopPropagation(),this.handleListItemChange())}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){let{dragEnabled:e,defaultSlotEl:t}=this;e&&t&&J(t),this.sortable.reset()}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){e.dragEl.sortHandleOpen=!1,this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItemsDebounced(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest(L)||void 0}handleDefaultSlotChange(e){this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit(),this.hasContent=w(e)}handleEmptyContentSlotChange(e){this.hasEmptyContent=w(e)}setListItemGroups(){this.listItemGroups=Array.from(this.el.querySelectorAll(S))}handleFilterActionsStartSlotChange(e){this.hasFilterActionsStart=C(e)}handleFilterActionsEndSlotChange(e){this.hasFilterActionsEnd=C(e)}handleFilterNoResultsSlotChange(e){this.hasFilterNoResults=C(e)}setActiveListItem(){let{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)}async updateSelectedItems(e=!1){await this.updateComplete,this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()}filterElements({el:e,filteredItems:t,visibleParents:i}){let a=!i.has(e)&&!t.includes(e);e.filterHidden=a;let s=e.parentElement.closest(X);s&&(a||i.add(s),this.filterElements({el:s,filteredItems:t,visibleParents:i}))}allParentListItemsExpanded(e){let t=e.parentElement?.closest(p);if(t){if(!t.expanded)return!1}else return!0;return this.allParentListItemsExpanded(t)}borderItems(){let e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsExpanded(t));e.forEach(t=>t.bordered=t!==e[e.length-1])}updateFilteredItems(){let{visibleItems:e,filteredData:t,filterText:i,filterPredicate:a}=this,s=e?.filter(r=>e.every(c=>c===r||!r.contains(c))),n=a?e.filter(a):i?t.map(r=>r.el):e||[],l=new WeakSet;s.forEach(r=>this.filterElements({el:r,filteredItems:n,visibleParents:l})),this.filteredItems=n,this.willFilterEmit&&(this.willFilterEmit=!1,this.calciteListFilter.emit())}updateFilteredData(){let{filterEl:e}=this;e&&(e.filteredItems&&(this.filteredData=e.filteredItems),this.updateListItemsDebounced())}async filterAndUpdateData(){let e=this.filterEl?.value??this.filterText;await this.filterEl?.filter(e),this.updateFilteredData()}performFilter(){let{filterEl:e,filterText:t,effectiveFilterProps:i}=this;e&&(e.value=t,e.filterProps=i,this.filterAndUpdateData())}setDefaultSlotEl(e){this.defaultSlotEl=e}setFilterEl(e){this.filterEl=e,this.performFilter()}handleFilterChange(e){e.stopPropagation();let{value:t}=e.currentTarget;this.filterText=t,this.willFilterEmit=!0,this.updateFilteredData()}getItemData(){return this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,heading:this.getGroupHeading(e),el:e}))}getGroupHeading(e){return this.listItemGroups.filter(t=>t.contains(e)&&t.heading).map(t=>t.heading)}updateGroupItems(){let{el:e,group:t,scale:i}=this,a=N(e),s=t?Array.from(a.querySelectorAll(`${L}[group="${t}"]`)).filter(l=>!l.disabled&&l.dragEnabled):[];this.sortHandleMenuItems=s.map(l=>({element:l,label:l.label??l.id,id:q()})),Array.from(this.el.querySelectorAll(S)).forEach(l=>{l.scale=i})}focusRow(e){let{focusableItems:t}=this;e&&(t.forEach(i=>i.active=i===e),e.setFocus())}isNavigable(e){let t=e.parentElement?.closest(p);return t?t.expanded&&this.isNavigable(t):!0}handleListKeydown(e){if(e.defaultPrevented||this.parentListEl)return;let{key:t}=e,i=this.focusableItems.filter(s=>this.isNavigable(s)),a=i.findIndex(s=>s.active);if(t==="ArrowDown"){e.preventDefault();let s=e.target===this.filterEl?0:a+1;i[s]&&this.focusRow(i[s])}else if(t==="ArrowUp"){if(e.preventDefault(),a===0&&this.filterEnabled){this.filterEl.setFocus();return}let s=a-1;i[s]&&this.focusRow(i[s])}else if(t==="Home"){e.preventDefault();let s=i[0];s&&this.focusRow(s)}else if(t==="End"){e.preventDefault();let s=i[i.length-1];s&&this.focusRow(s)}}handleInteractionModeWarning(){this.interactionMode==="static"&&this.selectionMode!=="none"&&this.selectionAppearance==="border"&&U.warn('selection-appearance="border" requires interaction-mode="interactive"')}validateSortMenuItem({fromEl:e,toEl:t,dragEl:i,newIndex:a,oldIndex:s,type:n}){if(!e||!t||t===e||i.contains(t))return!1;let l=e.canPull?.({toEl:t,fromEl:e,dragEl:i,newIndex:a,oldIndex:s})??!0,r=t.canPut?.({toEl:t,fromEl:e,dragEl:i,newIndex:a,oldIndex:s})??!0;return(n==="add"?l==="clone":l===!0)&&r}handleAdd(e){let{addTo:t}=e.detail,i=e.target,a=i?.parentElement,s=t.element,l=Array.from(a.children).filter(I).indexOf(i),r=0;if(!this.validateSortMenuItem({type:"add",fromEl:a,toEl:s,dragEl:i,newIndex:r,oldIndex:l}))return;i.sortHandleOpen=!1,this.disconnectObserver();let c=i.cloneNode();s.prepend(c),$(i),this.updateListItemsDebounced(),this.connectObserver();let f={dragEl:i,fromEl:a,toEl:s,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(f),s.emitOrderChangeEvent(f)}handleMove(e){let{moveTo:t}=e.detail,i=e.target,a=i?.parentElement,s=t.element,l=Array.from(a.children).filter(I).indexOf(i),r=0;if(!this.validateSortMenuItem({type:"move",fromEl:a,toEl:s,dragEl:i,newIndex:r,oldIndex:l}))return;i.sortHandleOpen=!1,this.disconnectObserver(),s.prepend(i),$(i),this.updateListItemsDebounced(),this.connectObserver();let c={dragEl:i,fromEl:a,toEl:s,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(c),s.emitOrderChangeEvent(c)}handleReorder(e){let{reorder:t}=e.detail,i=e.target,a=i?.parentElement;if(!a)return;i.sortHandleOpen=!1;let s=Array.from(a.children).filter(I),n=s.length-1,l=s.indexOf(i),r=l;switch(t){case"top":r=0;break;case"bottom":r=n;break;case"up":r=l===0?0:l-1;break;case"down":r=l===n?n:l+1;break}this.disconnectObserver();let c=t==="up"||t==="top"?s[r]:s[r].nextSibling;a.insertBefore(i,c),this.updateListItemsDebounced(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:i,fromEl:a,toEl:a,newIndex:r,oldIndex:l})}render(){let{loading:e,label:t,disabled:i,dataForFilter:a,filterEnabled:s,filterPlaceholder:n,filterLabel:l,hasFilterActionsStart:r,hasFilterActionsEnd:c,effectiveFilterProps:f}=this;return this.interactiveContainer({disabled:this.disabled,children:d`<div class=${h({[u.container]:!0,[u.containerHeight]:this.listItems.length<1&&e})} style=${H({"--calcite-internal-filter-enabled-offset":`${this.filterRowHeight}px`})}>${this.dragEnabled?d`<span aria-live=assertive class=${h(y.screenReaderText)}>${this.assistiveText}</span>`:null}${this.renderItemAriaLive()}<div .ariaBusy=${_(e,void 0)} .ariaLabel=${t||""} class=${h(u.table)} @keydown=${this.handleListKeydown} role=treegrid>${s||r||c?d`<div class=${h(u.sticky)} role=rowgroup ${v(this.setFilterContainerEl)}><div role=row><div role=columnheader><calcite-stack class=${h(u.stack)}><slot name=${g.filterActionsStart} @slotchange=${this.handleFilterActionsStartSlotChange} slot=${P.actionsStart}></slot><calcite-filter .ariaLabel=${n} .disabled=${i} .filterProps=${f} .items=${a} .label=${l} @calciteFilterChange=${this.handleFilterChange} .placeholder=${n} .scale=${this.scale} ${v(this.setFilterEl)}></calcite-filter><slot name=${g.filterActionsEnd} @slotchange=${this.handleFilterActionsEndSlotChange} slot=${P.actionsEnd}></slot></calcite-stack></div></div></div>`:null}<div class=${h(u.tableContainer)} role=rowgroup><div .hidden=${!this.showEmptyContentContainer}><slot name=${g.emptyContent} @slotchange=${this.handleEmptyContentSlotChange}></slot></div><slot @slotchange=${this.handleDefaultSlotChange} ${v(this.setDefaultSlotEl)}></slot></div></div><div aria-live=polite .hidden=${!this.showNoResultsContainer}><slot name=${g.filterNoResults} @slotchange=${this.handleFilterNoResultsSlotChange}></slot></div>${e?d`<calcite-scrim class=${h(u.scrim)} .loading=${e}></calcite-scrim>`:null}</div>`})}renderItemAriaLive(){let{messages:e,filteredItems:t,parentListEl:i,messages:{_lang:a},numberingSystem:s}=this;return A.numberFormatOptions={locale:a,numberingSystem:s},i?null:d`<div aria-live=polite class=${h(y.screenReaderText)}>${this.hasActiveFilter?E("aria-filter-enabled",d`<div>${e.filterEnabled}</div>`):null}${E("aria-item-count",d`<div>${e.total.replace("{count}",A.localize(t.length.toString()))}</div>`)}${t.length?E("aria-item-list",d`<ol>${t.map(n=>d`<li>${n.label}</li>`)}</ol>`):null}</div>`}};G("calcite-list",O);export{O as List};
|
|
2
|
+
import{b as P}from"./IZOUEOSQ.js";import{a as u,b as g,c as L,d as S,e as p,f as $,h as J}from"./BBJ5QQZI.js";import{f as I}from"./COWUMHFG.js";import{a as j}from"./2DT5TUSD.js";import{a as K}from"./4Y5CLGZK.js";import{b as _}from"./WTNYMVTD.js";import{a as W}from"./TZDBVRUX.js";import{a as Y}from"./G7H34HIQ.js";import{a as V}from"./YYOLNZRT.js";import"./CSDY4NKB.js";import{a as D}from"./FDHY2TZA.js";import{a as q}from"./CASNTUXN.js";import{k as A}from"./4LJDBE3W.js";import"./JN6YLTUP.js";import{a as E}from"./2KMSPIAS.js";import{a as B}from"./BWTQZDQ6.js";import"./TL56TNQ7.js";import{a as z}from"./JGBARNCY.js";import"./VMHJHFFS.js";import"./MLEIIIL7.js";import"./EXBAP2Y4.js";import{A as C,i as N,w}from"./W77STZAT.js";import{F as v,G as k,H as h,I as H,M as y,N as T,Q as U,T as G,g as R,h as d,p as m}from"./3K3WZKX6.js";var Q=R`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=m]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=l]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-xs, var(--calcite-spacing-xs))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}.container{position:relative;background-color:var(--calcite-list-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}.container-height{block-size:100%}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:var(--calcite-color-transparent)}.table-container *{box-sizing:border-box}.table{inline-size:100%}.stack{--calcite-stack-padding-inline: 0;--calcite-stack-padding-block: 0}.sticky-pos{position:sticky;inset-block-start:var(--calcite-space-none);z-index:calc(var(--calcite-z-index-sticky) + 1);background-color:var(--calcite-list-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}::slotted(:is(calcite-action[slot=filter-actions-start],calcite-action[slot=filter-actions-end])){gap:var(--calcite-internal-list-action-spacing);align-self:center}::slotted(calcite-action[slot=filter-actions-start]){margin-inline-start:var(--calcite-internal-list-action-spacing)}::slotted(calcite-action[slot=filter-actions-end]){margin-inline-end:var(--calcite-internal-list-action-spacing)}:host([hidden]){display:none}[hidden]{display:none}`,X=`${S}, ${p}`,O=class extends k{constructor(){super(),this.dragSelector=p,this.focusableItems=[],this.handleSelector="calcite-sort-handle",this.listItems=[],this.listItemGroups=[],this.mutationObserver=D("mutation",()=>{this.willPerformFilter=!0,this.updateListItemsDebounced()}),this.cancelable=Y()(this),this.sortable=j()(this),this.updateListItemsDebounced=V(this.updateListItems,T.nextTick),this.visibleItems=[],this.willFilterEmit=!1,this.willPerformFilter=!1,this.messages=B({blocking:!0}),this.focusSetter=z()(this).setFocus,this.interactiveContainer=W(this),this.filterRowResizeObserver=D("resize",()=>this.updateFilterRowHeight()),this.setFilterContainerEl=e=>{this.filterContainerEl=e,this.observeFilterRow()},this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1,this.sortHandleMenuItems=[],this.hasContent=!1,this.hasEmptyContent=!1,this.filterRowHeight=0,this.disabled=!1,this.dragEnabled=!1,this.filterEnabled=!1,this.filterText="",this.filteredData=[],this.filteredItems=[],this.interactionMode="interactive",this.loading=!1,this.displayMode="flat",this.scale="m",this.selectedItems=[],this.selectionAppearance="icon",this.selectionMode="none",this.sortDisabled=!1,this.calciteInternalListDefaultSlotChange=m({cancelable:!1}),this.calciteListChange=m({cancelable:!1}),this.calciteListDragEnd=m({cancelable:!1}),this.calciteListDragStart=m({cancelable:!1}),this.calciteListFilter=m({cancelable:!1}),this.calciteListOrderChange=m({cancelable:!1}),this.listen("calciteInternalListItemToggle",this.handleCalciteListItemToggle),this.listen("calciteInternalFocusPreviousItem",this.handleCalciteInternalFocusPreviousItem),this.listen("calciteInternalListItemActive",this.handleCalciteInternalListItemActive),this.listen("calciteListItemSelect",this.handleCalciteListItemSelect),this.listen("calciteInternalAssistiveTextChange",this.handleCalciteInternalAssistiveTextChange),this.listen("calciteListItemSortHandleBeforeOpen",this.updateListItemsDebounced),this.listen("calciteSortHandleReorder",this.handleSortReorder),this.listen("calciteSortHandleMove",this.handleSortMove),this.listen("calciteSortHandleAdd",this.handleSortAdd),this.listen("calciteInternalListItemSelect",this.handleCalciteInternalListItemSelect),this.listen("calciteInternalListItemSelectMultiple",this.handleCalciteInternalListItemSelectMultiple),this.listen("calciteInternalListItemChange",this.handleCalciteInternalListItemChange),this.listen("calciteInternalListItemGroupDefaultSlotChange",this.handleCalciteInternalListItemGroupDefaultSlotChange),this.listen("calciteInternalListItemGroupChange",this.handleCalciteInternalListItemChange)}static{this.properties={assistiveText:[16,{},{state:!0}],dataForFilter:[16,{},{state:!0}],hasFilterActionsEnd:[16,{},{state:!0}],hasFilterActionsStart:[16,{},{state:!0}],hasFilterNoResults:[16,{},{state:!0}],sortHandleMenuItems:[16,{},{state:!0}],hasContent:[16,{},{state:!0}],hasEmptyContent:[16,{},{state:!0}],filterRowHeight:[16,{},{state:!0}],canPull:[0,{},{attribute:!1}],canPut:[0,{},{attribute:!1}],disabled:[7,{},{reflect:!0,type:Boolean}],dragEnabled:[7,{},{reflect:!0,type:Boolean}],filterEnabled:[7,{},{reflect:!0,type:Boolean}],filterPredicate:[0,{},{attribute:!1}],filterLabel:[3,{},{reflect:!0}],filterPlaceholder:[3,{},{reflect:!0}],filterProps:[0,{},{attribute:!1}],filterText:[3,{},{reflect:!0}],filteredData:[0,{},{attribute:!1}],filteredItems:[0,{},{attribute:!1}],group:[3,{},{reflect:!0}],interactionMode:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],displayMode:[3,{},{reflect:!0}],numberingSystem:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionAppearance:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}],sortDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=[Q,K]}get hasActiveFilter(){return!!(this.filterEnabled&&this.filterText&&this.filteredItems.length!==this.visibleItems.length)}get showEmptyContentContainer(){return!this.hasContent&&this.hasEmptyContent}get showNoResultsContainer(){return!!(this.filterEnabled&&this.filterText&&this.hasFilterNoResults&&this.visibleItems.length&&!this.filteredItems.length)}get effectiveFilterProps(){return this.filterProps?this.filterProps.filter(e=>e!=="el"):["description","label","metadata","heading"]}emitOrderChangeEvent(e){this.calciteListOrderChange.emit(e)}async setFocus(e){return this.focusSetter(()=>this.filterEnabled?this.filterEl:this.focusableItems.find(t=>t.active),e)}connectedCallback(){super.connectedCallback(),this.connectObserver(),this.willPerformFilter=!0,this.updateListItemsDebounced(),this.setUpSorting(),this.setParentList(),this.setListItemGroups(),this.cancelable.add(this.updateListItemsDebounced)}async load(){this.handleInteractionModeWarning()}willUpdate(e){(e.has("filterText")||e.has("filterProps")||e.has("filterPredicate"))&&this.performFilter(),(e.has("filterEnabled")&&(this.hasUpdated||this.filterEnabled!==!1)||e.has("group")||e.has("sortDisabled")&&(this.hasUpdated||this.sortDisabled!==!1)||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="none")||e.has("selectionAppearance")&&(this.hasUpdated||this.selectionAppearance!=="icon")||e.has("displayMode")&&this.hasUpdated||e.has("scale")&&this.hasUpdated||e.has("canPull")&&this.hasUpdated||e.has("canPut")&&this.hasUpdated||e.has("filterPredicate")&&this.hasUpdated)&&this.handleListItemChange()}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObserver(),this.unobserveFilterRow()}updateListItems(){this.updateFilterRowHeight(),this.updateGroupItems();let{selectionAppearance:e,selectionMode:t,interactionMode:i,dragEnabled:a,el:s,filterEl:n,displayMode:l,scale:r,sortDisabled:c,sortHandleMenuItems:f}=this,b=Array.from(this.el.querySelectorAll(p)),F=s,M=Array.from(F.children).filter(I);if(b.forEach(o=>{o.closest(L)===s&&(o.scale=r,o.selectionAppearance=e,o.selectionMode=t,o.interactionMode=i,o.moveToItems=f.filter(x=>this.validateSortMenuItem({type:"move",fromEl:F,toEl:x.element,dragEl:o,newIndex:0,oldIndex:M.indexOf(o)})),o.addToItems=this.sortHandleMenuItems.filter(x=>this.validateSortMenuItem({type:"add",fromEl:F,toEl:x.element,dragEl:o,newIndex:0,oldIndex:M.indexOf(o)})),o.dragHandle=a,o.displayMode=l,o.sortDisabled=c)}),this.parentListEl){this.setUpSorting();return}this.listItems=b,this.filterEnabled&&this.willPerformFilter&&(this.willPerformFilter=!1,this.dataForFilter=this.getItemData(),n&&(n.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(o=>!o.closed&&!o.hidden),this.updateFilteredItems(),this.borderItems(),this.focusableItems=this.filteredItems.filter(o=>!o.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()}unobserveFilterRow(){this.filterRowResizeObserver?.disconnect()}observeFilterRow(){this.unobserveFilterRow();let e=this.filterContainerEl;e&&this.filterRowResizeObserver?.observe(e)}updateFilterRowHeight(){this.filterRowHeight=this.filterContainerEl?.clientHeight??0}handleListItemChange(){this.willPerformFilter=!0,this.updateListItemsDebounced()}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();let{focusableItems:t}=this,a=t.findIndex(s=>s.active)-1;t[a]&&this.focusRow(t[a])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:i}=this;i.forEach(a=>{a.active=a===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleSortReorder(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleReorder(e))}handleSortAdd(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleAdd(e))}handleSortMove(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleMove(e))}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:i,selectionMode:a}=this;t.selected&&(a==="single"||a==="single-persist")&&i.forEach(s=>s.selected=s===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();let{target:t,detail:i}=e,{focusableItems:a,lastSelectedInfo:s}=this,n=t;if(i.selectMultiple&&s){let l=a.indexOf(n),r=a.indexOf(s.selectedItem),c=Math.min(r,l),f=Math.max(r,l);a.slice(c,f+1).forEach(b=>b.selected=s.selected)}else this.lastSelectedInfo={selectedItem:n,selected:n.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.handleListItemChange())}handleCalciteInternalListItemGroupDefaultSlotChange(e){this.parentListEl||(e.stopPropagation(),this.handleListItemChange())}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){let{dragEnabled:e,defaultSlotEl:t}=this;e&&t&&J(t),this.sortable.reset()}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){e.dragEl.sortHandleOpen=!1,this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItemsDebounced(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest(L)||void 0}handleDefaultSlotChange(e){this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit(),this.hasContent=w(e)}handleEmptyContentSlotChange(e){this.hasEmptyContent=w(e)}setListItemGroups(){this.listItemGroups=Array.from(this.el.querySelectorAll(S))}handleFilterActionsStartSlotChange(e){this.hasFilterActionsStart=C(e)}handleFilterActionsEndSlotChange(e){this.hasFilterActionsEnd=C(e)}handleFilterNoResultsSlotChange(e){this.hasFilterNoResults=C(e)}setActiveListItem(){let{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)}async updateSelectedItems(e=!1){await this.updateComplete,this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()}filterElements({el:e,filteredItems:t,visibleParents:i}){let a=!i.has(e)&&!t.includes(e);e.filterHidden=a;let s=e.parentElement.closest(X);s&&(a||i.add(s),this.filterElements({el:s,filteredItems:t,visibleParents:i}))}allParentListItemsExpanded(e){let t=e.parentElement?.closest(p);if(t){if(!t.expanded)return!1}else return!0;return this.allParentListItemsExpanded(t)}borderItems(){let e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsExpanded(t));e.forEach(t=>t.bordered=t!==e[e.length-1])}updateFilteredItems(){let{visibleItems:e,filteredData:t,filterText:i,filterPredicate:a}=this,s=e?.filter(r=>e.every(c=>c===r||!r.contains(c))),n=a?e.filter(a):i?t.map(r=>r.el):e||[],l=new WeakSet;s.forEach(r=>this.filterElements({el:r,filteredItems:n,visibleParents:l})),this.filteredItems=n,this.willFilterEmit&&(this.willFilterEmit=!1,this.calciteListFilter.emit())}updateFilteredData(){let{filterEl:e}=this;e&&(e.filteredItems&&(this.filteredData=e.filteredItems),this.updateListItemsDebounced())}async filterAndUpdateData(){let e=this.filterEl?.value??this.filterText;await this.filterEl?.filter(e),this.updateFilteredData()}performFilter(){let{filterEl:e,filterText:t,effectiveFilterProps:i}=this;e&&(e.value=t,e.filterProps=i,this.filterAndUpdateData())}setDefaultSlotEl(e){this.defaultSlotEl=e}setFilterEl(e){this.filterEl=e,this.performFilter()}handleFilterChange(e){e.stopPropagation();let{value:t}=e.currentTarget;this.filterText=t,this.willFilterEmit=!0,this.updateFilteredData()}getItemData(){return this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,heading:this.getGroupHeading(e),el:e}))}getGroupHeading(e){return this.listItemGroups.filter(t=>t.contains(e)&&t.heading).map(t=>t.heading)}updateGroupItems(){let{el:e,group:t,scale:i}=this,a=N(e),s=t?Array.from(a.querySelectorAll(`${L}[group="${t}"]`)).filter(l=>!l.disabled&&l.dragEnabled):[];this.sortHandleMenuItems=s.map(l=>({element:l,label:l.label??l.id,id:q()})),Array.from(this.el.querySelectorAll(S)).forEach(l=>{l.scale=i})}focusRow(e){let{focusableItems:t}=this;e&&(t.forEach(i=>i.active=i===e),e.setFocus())}isNavigable(e){let t=e.parentElement?.closest(p);return t?t.expanded&&this.isNavigable(t):!0}handleListKeydown(e){if(e.defaultPrevented||this.parentListEl)return;let{key:t}=e,i=this.focusableItems.filter(s=>this.isNavigable(s)),a=i.findIndex(s=>s.active);if(t==="ArrowDown"){e.preventDefault();let s=e.target===this.filterEl?0:a+1;i[s]&&this.focusRow(i[s])}else if(t==="ArrowUp"){if(e.preventDefault(),a===0&&this.filterEnabled){this.filterEl.setFocus();return}let s=a-1;i[s]&&this.focusRow(i[s])}else if(t==="Home"){e.preventDefault();let s=i[0];s&&this.focusRow(s)}else if(t==="End"){e.preventDefault();let s=i[i.length-1];s&&this.focusRow(s)}}handleInteractionModeWarning(){this.interactionMode==="static"&&this.selectionMode!=="none"&&this.selectionAppearance==="border"&&U.warn('selection-appearance="border" requires interaction-mode="interactive"')}validateSortMenuItem({fromEl:e,toEl:t,dragEl:i,newIndex:a,oldIndex:s,type:n}){if(!e||!t||t===e||i.contains(t))return!1;let l=e.canPull?.({toEl:t,fromEl:e,dragEl:i,newIndex:a,oldIndex:s})??!0,r=t.canPut?.({toEl:t,fromEl:e,dragEl:i,newIndex:a,oldIndex:s})??!0;return(n==="add"?l==="clone":l===!0)&&r}handleAdd(e){let{addTo:t}=e.detail,i=e.target,a=i?.parentElement,s=t.element,l=Array.from(a.children).filter(I).indexOf(i),r=0;if(!this.validateSortMenuItem({type:"add",fromEl:a,toEl:s,dragEl:i,newIndex:r,oldIndex:l}))return;i.sortHandleOpen=!1,this.disconnectObserver();let c=i.cloneNode();s.prepend(c),$(i),this.updateListItemsDebounced(),this.connectObserver();let f={dragEl:i,fromEl:a,toEl:s,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(f),s.emitOrderChangeEvent(f)}handleMove(e){let{moveTo:t}=e.detail,i=e.target,a=i?.parentElement,s=t.element,l=Array.from(a.children).filter(I).indexOf(i),r=0;if(!this.validateSortMenuItem({type:"move",fromEl:a,toEl:s,dragEl:i,newIndex:r,oldIndex:l}))return;i.sortHandleOpen=!1,this.disconnectObserver(),s.prepend(i),$(i),this.updateListItemsDebounced(),this.connectObserver();let c={dragEl:i,fromEl:a,toEl:s,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(c),s.emitOrderChangeEvent(c)}handleReorder(e){let{reorder:t}=e.detail,i=e.target,a=i?.parentElement;if(!a)return;i.sortHandleOpen=!1;let s=Array.from(a.children).filter(I),n=s.length-1,l=s.indexOf(i),r=l;switch(t){case"top":r=0;break;case"bottom":r=n;break;case"up":r=l===0?0:l-1;break;case"down":r=l===n?n:l+1;break}this.disconnectObserver();let c=t==="up"||t==="top"?s[r]:s[r].nextSibling;a.insertBefore(i,c),this.updateListItemsDebounced(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:i,fromEl:a,toEl:a,newIndex:r,oldIndex:l})}render(){let{loading:e,label:t,disabled:i,dataForFilter:a,filterEnabled:s,filterPlaceholder:n,filterLabel:l,hasFilterActionsStart:r,hasFilterActionsEnd:c,effectiveFilterProps:f}=this;return this.interactiveContainer({disabled:this.disabled,children:d`<div class=${h({[u.container]:!0,[u.containerHeight]:this.listItems.length<1&&e})} style=${H({"--calcite-internal-filter-enabled-offset":`${this.filterRowHeight}px`})}>${this.dragEnabled?d`<span aria-live=assertive class=${h(y.screenReaderText)}>${this.assistiveText}</span>`:null}${this.renderItemAriaLive()}<div .ariaBusy=${_(e,void 0)} .ariaLabel=${t||""} class=${h(u.table)} @keydown=${this.handleListKeydown} role=treegrid>${s||r||c?d`<div class=${h(u.sticky)} role=rowgroup ${v(this.setFilterContainerEl)}><div role=row><div role=columnheader><calcite-stack class=${h(u.stack)}><slot name=${g.filterActionsStart} @slotchange=${this.handleFilterActionsStartSlotChange} slot=${P.actionsStart}></slot><calcite-filter .ariaLabel=${n} .disabled=${i} .filterProps=${f} .items=${a} .label=${l} @calciteFilterChange=${this.handleFilterChange} .placeholder=${n} .scale=${this.scale} ${v(this.setFilterEl)}></calcite-filter><slot name=${g.filterActionsEnd} @slotchange=${this.handleFilterActionsEndSlotChange} slot=${P.actionsEnd}></slot></calcite-stack></div></div></div>`:null}<div class=${h(u.tableContainer)} role=rowgroup><div .hidden=${!this.showEmptyContentContainer}><slot name=${g.emptyContent} @slotchange=${this.handleEmptyContentSlotChange}></slot></div><slot @slotchange=${this.handleDefaultSlotChange} ${v(this.setDefaultSlotEl)}></slot></div></div><div aria-live=polite .hidden=${!this.showNoResultsContainer}><slot name=${g.filterNoResults} @slotchange=${this.handleFilterNoResultsSlotChange}></slot></div>${e?d`<calcite-scrim class=${h(u.scrim)} .loading=${e}></calcite-scrim>`:null}</div>`})}renderItemAriaLive(){let{messages:e,filteredItems:t,parentListEl:i,messages:{_lang:a},numberingSystem:s}=this;return A.numberFormatOptions={locale:a,numberingSystem:s},i?null:d`<div aria-live=polite class=${h(y.screenReaderText)}>${this.hasActiveFilter?E("aria-filter-enabled",d`<div>${e.filterEnabled}</div>`):null}${E("aria-item-count",d`<div>${e.total.replace("{count}",A.localize(t.length.toString()))}</div>`)}${t.length?E("aria-item-list",d`<ol>${t.map(n=>d`<li>${n.label}</li>`)}</ol>`):null}</div>`}};G("calcite-list",O);export{O as List};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as et}from"./XD6OEN5W.js";import{a as tt}from"./YYOLNZRT.js";import"./CSDY4NKB.js";import{a as _}from"./FDHY2TZA.js";import{b as it}from"./Q5V3JJ3K.js";import{a as y,b as F}from"./KITAKEBT.js";import{a as m,d as f}from"./4K4EWOB2.js";import{c as $,e as b}from"./7JCCKSQC.js";import{c as p}from"./N3SMZYHC.js";import{a as Z}from"./35FJBHUF.js";import"./TL56TNQ7.js";import{a as Y}from"./BQPPMPJS.js";import"./VMHJHFFS.js";import{e as Q}from"./QAUUNB4V.js";import"./F7HEFBJ3.js";import{B as J,C as X,K as v,s as R}from"./W77STZAT.js";import{E as x,F as M,G as q,H as k,N as K,Q as j,T as V,g as U,h as I,l as W,p as D}from"./F66HV74D.js";var nt={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function ct(l,t){return t||l.closest("calcite-shell-panel")?.position||"start"}function lt({actions:l,expandables:t,expanded:e}){l.filter(i=>i.slot!==m.menuActions).forEach(i=>i.textEnabled=e),t.forEach(i=>i.expanded=e)}var dt=({tooltip:l,referenceElement:t,expanded:e,ref:i})=>(l&&(l.referenceElement=!e&&t?t:void 0),i&&i(t),t),ht=({collapseText:l,collapseLabel:t,direction:e,expanded:i,expandText:n,expandLabel:o,toggle:s,el:a,position:c,tooltip:r,ref:d,scale:G})=>{let T=e==="rtl",S=i?l:n,g=i?t:o,h=[nt.chevronsLeft,nt.chevronsRight];T&&h.reverse();let A=ct(a,c)==="end",C=A?h[1]:h[0],u=A?h[0]:h[1];return I`<calcite-action .aria=${{expanded:i}} .icon=${i?C:u} id=expand-toggle .label=${g} @click=${s} .scale=${G} .text=${S} .textEnabled=${i} title=${(!i&&!r?S:void 0)??W} ${M(z=>dt({tooltip:r,referenceElement:z,expanded:i,ref:d}))}></calcite-action>`},ut=({bufferSize:l=0,containerSize:t,itemSizes:e})=>{let i=t-l,n=e.length,o=0;for(let[s,a]of e.entries())if(o=o+a,o>i){n=s;break}else continue;return n},pt=({bufferSize:l=0,containerSize:t,itemSizes:e})=>Math.max(e.length-ut({bufferSize:l,itemSizes:e,containerSize:t}),0),ft=l=>l.flatMap(t=>f(t)?t.actions:b(t)?t.actions.filter(e=>e.slot===$.trigger):t).filter(t=>!!t),gt=({item:l,containerRect:t,horizontal:e,rtl:i})=>{let n=l.getBoundingClientRect();return e?n.top-t.top:i?t.right-n.right:n.left-t.left},vt=({actionGroups:l,expanded:t,overflowCount:e})=>{let i=e;[...l].reverse().forEach(n=>{let o=0,s=n.actions.filter(a=>a.parentElement===n).reverse();s.forEach(a=>{a.slot===m.menuActions&&(a.removeAttribute("slot"),a.textEnabled=t)}),i>0&&!n.overflowActionsDisabled&&s.some(a=>(s.filter(r=>!r.slot).length>1&&s.length>2&&!a.closest("calcite-action-menu")&&!a.overflowDisabled&&(a.textEnabled=!0,a.setAttribute("slot",m.menuActions),o++,o>1&&i--),i<1)),n.manager.component.requestUpdate()})},mt=U`:host{box-sizing:border-box;background-color:var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1));color:var(--calcite-color-text-2);font-size:var(--calcite-font-size-relative-base)}:host *{box-sizing:border-box}:host([scale=s]){--calcite-internal-action-bar-gap: var( --calcite-action-bar-items-space, var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs)) );--calcite-internal-action-bar-padding: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=m]){--calcite-internal-action-bar-gap: var( --calcite-action-bar-items-space, var(--calcite-theme-space-sm, var(--calcite-spacing-sm)) );--calcite-internal-action-bar-padding: var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=l]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-space-sm-plus));--calcite-internal-action-bar-padding: var(--calcite-theme-space-sm-plus, var(--calcite-spacing-sm-plus))}:host{display:inline-flex;align-self:stretch;background:transparent;--calcite-internal-action-group-dividing-border-margin: calc( var(--calcite-theme-space-base, var(--calcite-spacing-base)) + 1px )}.container{display:inline-flex;flex-direction:column;flex:1 1 auto;background-color:var(--calcite-action-bar-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)));gap:var(--calcite-internal-action-bar-gap);padding:var(--calcite-internal-action-bar-padding)}:host([floating]) .container{animation:in var(--calcite-internal-animation-timing-slow) ease-in-out;overflow:hidden;border-radius:var(--calcite-action-bar-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));box-shadow:var(--calcite-action-bar-shadow, var(--calcite-shadow-md))}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]) .container{overflow-y:auto}:host([layout=vertical]):host([expanded]) .container{max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm);border-image:linear-gradient(to right,transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent var(--calcite-internal-action-group-dividing-border-margin));border-image-slice:1;padding-block-end:var(--calcite-internal-action-bar-padding)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]) .container{flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]) .container{overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-image:linear-gradient(transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent var(--calcite-internal-action-group-dividing-border-margin));border-image-slice:1;border-inline-end-width:var(--calcite-border-width-sm);padding-inline-end:var(--calcite-internal-action-bar-padding)}.action-group--end{justify-content:flex-end}.line-overlay{position:absolute;inset:0;pointer-events:none}.line{position:absolute;--calcite-internal-action-bar-divider-inset: calc( var(--calcite-internal-action-group-dividing-border-margin) - var(--calcite-border-width-sm) )}:host([overflow-mode=wrap][layout=horizontal]) .container,:host([overflow-mode=wrap][layout=vertical]) .container{position:relative;flex-wrap:wrap;align-content:flex-start;--calcite-internal-action-bar-line-gap: calc( var(--calcite-internal-action-bar-padding) + var(--calcite-internal-action-bar-gap) )}:host([overflow-mode=wrap][layout=horizontal]) ::slotted(calcite-action-group[slot=actions-start]),:host([overflow-mode=wrap][layout=vertical]) ::slotted(calcite-action-group[slot=actions-start]){padding-inline-end:0;padding-block-end:0;border-inline-end-width:0;border-block-end-width:0}:host([overflow-mode=wrap][layout=horizontal]) .container{row-gap:var(--calcite-internal-action-bar-line-gap)}:host([overflow-mode=wrap][layout=horizontal]) ::slotted(calcite-action-group:not([slot=actions-start])){margin-inline-start:calc(-1 * var(--calcite-border-width-sm));padding-inline:var(--calcite-internal-action-bar-padding) 0;border-inline-start-width:var(--calcite-border-width-sm);border-inline-end-width:0;border-image:linear-gradient(transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent calc(100% - var(--calcite-internal-action-group-dividing-border-margin)));border-image-slice:1}:host([overflow-mode=wrap][layout=horizontal]) .line{inset-inline:var(--calcite-internal-action-bar-padding);block-size:var(--calcite-border-width-sm);inset-block-start:calc(var(--calcite-internal-action-bar-line-offset, 0px) - var(--calcite-internal-action-bar-line-gap) / 2);background:linear-gradient(to right,transparent var(--calcite-internal-action-bar-divider-inset),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-bar-divider-inset),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-bar-divider-inset)),transparent calc(100% - var(--calcite-internal-action-bar-divider-inset)))}:host([overflow-mode=wrap][layout=horizontal]) .container.has-action-groups{overflow:hidden;padding-inline-start:0;column-gap:calc(var(--calcite-internal-action-bar-gap) + var(--calcite-border-width-sm))}:host([overflow-mode=wrap][layout=horizontal]) .container.has-action-groups .action-group--start{padding-inline-start:var(--calcite-internal-action-bar-padding)}:host([overflow-mode=wrap][layout=vertical]) .container{block-size:100%;min-block-size:0;column-gap:var(--calcite-internal-action-bar-line-gap)}:host([overflow-mode=wrap][layout=vertical]) ::slotted(calcite-action-group:not([slot=actions-start])){margin-block-start:calc(-1 * var(--calcite-border-width-sm));padding-block:var(--calcite-internal-action-bar-padding) 0;border-block-start-width:var(--calcite-border-width-sm);border-block-end-width:0;border-image:linear-gradient(to right,transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent calc(100% - var(--calcite-internal-action-group-dividing-border-margin)));border-image-slice:1}:host([overflow-mode=wrap][layout=vertical]) .line{inset-block:var(--calcite-internal-action-bar-padding);inline-size:var(--calcite-border-width-sm);inset-inline-start:calc(var(--calcite-internal-action-bar-line-offset, 0px) - var(--calcite-internal-action-bar-line-gap) / 2);background:linear-gradient(to bottom,transparent var(--calcite-internal-action-bar-divider-inset),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-bar-divider-inset),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-bar-divider-inset)),transparent calc(100% - var(--calcite-internal-action-bar-divider-inset)))}:host([overflow-mode=wrap][layout=vertical]) .container.has-action-groups{overflow:hidden;padding-block-start:0;row-gap:calc(var(--calcite-internal-action-bar-gap) + var(--calcite-border-width-sm))}:host([overflow-mode=wrap][layout=vertical]) .container.has-action-groups .action-group--start{padding-block-start:var(--calcite-internal-action-bar-padding)}:host([overflow-mode=none][layout=horizontal]) .container{overflow-x:auto}:host([overflow-mode=none][layout=vertical]) .container{overflow-y:auto}:host([hidden]){display:none}[hidden]{display:none}`,H=class extends q{constructor(){super(),this.actions=[],this.navigationItems=[],this.containerRef=x(),this.defaultSlotRef=x(),this.actionsStartSlotRef=x(),this.actionsEndSlotRef=x(),this.actionsStartGroupRef=x(),this.actionsEndGroupRef=x(),this.direction=Q(),this.defaultSlotItems=[],this.actionGroups=[],this.actionMenus=[],this.actionsStart=[],this.actionsStartGroups=[],this.actionsEnd=[],this.actionsEndGroups=[],this.automaticallyOverflowedActions=[],this.authoredMenuActions=[],this.overflowPassId=0,this.suppressedActionGroupActionsChange=new WeakMap,this.cancelable=et()(this),this.resize=tt(({width:t,height:e})=>{let{expanded:i,expandToggleDisabled:n,layout:o,expandPosition:s}=this;if(!this.el.isConnected||!this.containerRef.value)return;if(this.updateGroups(),this.usesWrap){this.scheduleLineMeasure();return}if(this.overflowMode!=="collapse"||o==="vertical"&&!e||o==="horizontal"&&!t)return;let a=this.getItemSizes(),{actionGroups:c,actionsEnd:r,actionsEndGroups:d,actionsStart:G,actionsStartGroups:T,defaultSlotItems:S}=this,g=[...T,...c,...d],h=this.hasActionsEnd||!n&&s==="end"?1:0,A=this.hasActionsStart||!n&&s==="start"?1:0,C=S.length+h+A,u=C,E=getComputedStyle(this.containerRef.value);if(u+=v(o==="horizontal"?E.paddingInlineStart:E.paddingBlockStart)+v(o==="horizontal"?E.paddingInlineEnd:E.paddingBlockEnd),g.length>0){let O=g.length-1;g.forEach((N,L)=>{let w=getComputedStyle(N),B=v(w.gap),P=this.getActionGroupItemCount(N),rt=Math.max(P-1,0);u+=B*rt,L!==O&&(u+=v(o==="horizontal"?w.paddingInlineEnd:w.paddingBlockEnd),u+=v(o==="horizontal"?w.borderInlineEndWidth:w.borderBlockEndWidth))})}let z=(O,N,L)=>{if(!N||O.length<1)return;let w=getComputedStyle(N),B=v(w.gap),P=O.length+(L?1:0);u+=B*Math.max(P-1,0)},at=!n&&s==="start",ot=!n&&s==="end";z(G,this.actionsStartGroupRef.value,at),z(r,this.actionsEndGroupRef.value,ot),C>1&&(u+=v(E.gap)*(C-1));let st=pt({bufferSize:u,containerSize:o==="horizontal"?t:e,itemSizes:a});this.runOverflowActions({actionGroups:g,expanded:i,overflowCount:st})},K.resize),this.resizeHandler=t=>{if(this.usesWrap){this.scheduleLineMeasure();return}let{width:e,height:i}=t.target&&t.target!==this.el?{width:this.el.clientWidth,height:this.el.clientHeight}:t.contentRect,n=this.layout==="horizontal"?"width":"height",o=n==="width"?e:i;this.lastOverflowAxisSize?.axis===n&&this.lastOverflowAxisSize.size===o||(this.lastOverflowAxisSize={axis:n,size:o},this.resize({width:e,height:i}))},this.resizeObserver=_("resize",t=>this.resizeHandlerEntries(t)),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.messages=Z({blocking:!0}),this.focusSetter=Y()(this).setFocus,this.setExpandToggleEl=t=>{this.expandToggleEl=t,this.syncNavigationItemTabIndexes()},this.hasActionsEnd=!1,this.hasActionsStart=!1,this.hasActionGroups=!1,this.lineOffsets=[],this.floating=!1,this.expandToggleDisabled=!1,this.expanded=!1,this.expandPosition="end",this.layout="vertical",this.overflowMode="collapse",this.overlayPositioning="absolute",this.scale="m",this.selectionAppearance="neutral",this.calciteActionBarCollapse=D({cancelable:!1}),this.calciteActionBarExpand=D({cancelable:!1}),this.calciteActionBarToggle=D({cancelable:!1}),this.listen("calciteActionMenuOpen",this.actionMenuOpenHandler),this.listen("calciteInternalActionGroupActionsChange",this.handleActionGroupActionsChange),this.listen("calciteInternalActionMenuActionsChange",this.handleActionMenuActionsChange),this.listen("click",this.handleFocusIn),this.listen("keydown",this.handleKeyDown),this.listen("focusin",this.handleFocusIn)}static{this.properties={expandTooltip:[16,{},{state:!0}],hasActionsEnd:[16,{},{state:!0}],hasActionsStart:[16,{},{state:!0}],hasActionGroups:[16,{},{state:!0}],lineOffsets:[16,{},{state:!0}],actionsEndGroupLabel:1,actionsStartGroupLabel:1,floating:[7,{},{reflect:!0,type:Boolean}],expandToggleDisabled:[7,{},{reflect:!0,type:Boolean}],expanded:[7,{},{reflect:!0,type:Boolean}],expandPosition:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],overflowMode:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],overflowActionsDisabled:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],position:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}],selectionAppearance:[3,{},{reflect:!0}]}}static{this.styles=mt}get usesWrap(){return this.overflowMode==="wrap"&&this.layout!=="grid"}get overflowActionsDisabled(){return this.overflowMode==="none"}set overflowActionsDisabled(t){j.deprecated("property",{component:this,name:"overflowActionsDisabled",removalVersion:7,suggested:'overflowMode="none"'}),this.overflowMode=t?"none":"collapse"}async overflowActions(){if(this.overflowMode!=="collapse"){this.usesWrap&&this.scheduleLineMeasure();return}this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(t){return this.focusSetter(()=>this.el,t)}connectedCallback(){super.connectedCallback(),this.updateGroups(),this.updateNavigationItems(),this.syncNavigationItemTabIndexes(),this.overflowActions(),this.updateActions(),this.overflowActionsDisabledHandler(this.overflowActionsDisabled),this.overflowModeHandler(),this.cancelable.add(this.resize)}willUpdate(t){(t.has("expandToggleDisabled")&&(this.hasUpdated||this.expandToggleDisabled!==!1)||t.has("expandPosition")&&(this.hasUpdated||this.expandPosition!=="end"))&&this.overflowActions(),t.has("layout")&&(this.hasUpdated||this.layout!=="vertical")&&(this.updateGroups(),this.overflowModeHandler(),this.usesWrap||this.updateLines()),t.has("overflowActionsDisabled")&&(this.hasUpdated||this.overflowActionsDisabled!==!1)&&this.overflowActionsDisabledHandler(this.overflowActionsDisabled),t.has("overflowMode")&&(this.hasUpdated||this.overflowMode!=="collapse")&&(!this.usesWrap&&this.lineMeasureFrame!=null&&(cancelAnimationFrame(this.lineMeasureFrame),this.lineMeasureFrame=void 0),this.usesWrap?this.scheduleLineMeasure():this.updateLines(),this.overflowModeHandler()),t.has("expanded")&&this.hasUpdated&&(this.expandedHandler(),this.expanded?this.calciteActionBarExpand.emit():this.calciteActionBarCollapse.emit()),t.has("selectionAppearance")&&(this.hasUpdated||this.selectionAppearance!=="neutral")&&this.updateActions()}updated(){this.usesWrap&&this.lineMeasureFrame==null&&this.scheduleLineMeasure()}loaded(){this.syncDefaultSlot(),this.syncActionsStartSlot(),this.syncActionsEndSlot(),this.syncActionsState(),this.overflowActions()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.lineMeasureFrame!=null&&(cancelAnimationFrame(this.lineMeasureFrame),this.lineMeasureFrame=void 0)}getItemSizes(){let{layout:t,expandToggleEl:e}=this,i=t==="horizontal"?"clientWidth":"clientHeight",n=this.actions.map(a=>a[i]||0);this.getTrackedActionGroups().flatMap(a=>R(a,"calcite-action-menu")).forEach(a=>{let c=(a.actions??[]).find(r=>r.slot===$.trigger);n.push((c??a)[i]||0)}),e&&n.push(e[i]||0);let s=Math.max(...n,0);return n.map(a=>a||s)}getActionGroupItemCount(t){let e=t.actions.filter(n=>n.parentElement===t),i=R(t,"calcite-action-menu").length;return e.length+i}expandedHandler(){this.syncActionsState(!0),this.overflowActions()}overflowModeHandler(){this.overflowMode==="none"?this.resizeObserver?.disconnect():this.resizeObserver?.observe(this.el),this.overflowActions()}overflowActionsDisabledHandler(t){if(t){this.resizeObserver?.disconnect();return}this.resizeObserver?.observe(this.el),this.containerRef.value&&this.resizeObserver?.observe(this.containerRef.value),this.overflowActions()}actionMenuOpenHandler(t){let e=t.composedPath(),i=e.find(n=>f(n)||b(n));i&&(f(i)&&!i.menuOpen||b(i)&&!i.open||(this.getTrackedActionGroups().forEach(n=>{e.includes(n)||(n.menuOpen=!1)}),this.getTrackedActionMenus().forEach(n=>{e.includes(n)||(n.open=!1)}),this.updateActions()))}runOverflowActions({actionGroups:t,expanded:e,overflowCount:i}){let n=++this.overflowPassId,o=t.flatMap(a=>a.actions.filter(c=>c.parentElement===a));this.automaticallyOverflowedActions=this.automaticallyOverflowedActions.filter(a=>o.includes(a)),this.authoredMenuActions=this.authoredMenuActions.filter(a=>o.includes(a)&&a.slot===m.menuActions),o.forEach(a=>{a.slot===m.menuActions&&!this.automaticallyOverflowedActions.includes(a)&&!this.authoredMenuActions.includes(a)&&this.authoredMenuActions.push(a)});let s=new Map;t.forEach(a=>{let c=a.actions.filter(r=>r.parentElement===a);s.set(a,c.map(r=>r.slot??"").join("|"))}),vt({actionGroups:t,expanded:e,overflowCount:i}),this.authoredMenuActions.forEach(a=>{a.slot=m.menuActions,a.textEnabled=!0}),this.automaticallyOverflowedActions=o.filter(a=>a.slot===m.menuActions&&!this.authoredMenuActions.includes(a)),t.forEach(a=>{let r=a.actions.filter(d=>d.parentElement===a).map(d=>d.slot??"").join("|");s.get(a)!==r&&(this.suppressedActionGroupActionsChange.set(a,n),this.queueSuppressedActionGroupActionsChangeCleanup(a,n))})}queueSuppressedActionGroupActionsChangeCleanup(t,e){queueMicrotask(()=>{this.suppressedActionGroupActionsChange.get(t)===e&&this.suppressedActionGroupActionsChange.delete(t)})}resizeHandlerEntries(t){t.forEach(this.resizeHandler)}getSectionWrapperGroups(){return[this.actionsStartGroupRef.value,this.actionsEndGroupRef.value].filter(t=>!!t)}updateGroups(){let t=[...this.actionGroups,...this.actionsStartGroups,...this.actionsEndGroups,...this.getSectionWrapperGroups()];this.hasActionGroups=this.actionGroups.length>0,t.forEach(e=>{e.layout=this.layout,e.scale=this.scale}),this.syncNavItems()}syncNavItems(){this.el.isConnected&&(this.updateNavigationItems(),this.syncNavigationItemTabIndexes(),this.updateActions())}scheduleLineMeasure(){this.lineMeasureFrame!=null&&cancelAnimationFrame(this.lineMeasureFrame),this.lineMeasureFrame=requestAnimationFrame(()=>{this.lineMeasureFrame=void 0,this.updateLines()})}getWrapItems(){let t=[],e=this.actionsStartGroupRef.value;e&&!e.hidden&&t.push(e),this.defaultSlotItems.forEach(n=>{n.hidden||t.push(n)});let i=this.actionsEndGroupRef.value;return i&&!i.hidden&&t.push(i),t}updateLines(){let t=this.containerRef.value;if(!t||!this.usesWrap){this.lineOffsets.length>0&&(this.lineOffsets=[]);return}let e=this.layout==="horizontal",i=this.direction==="rtl",n=t.getBoundingClientRect(),o=this.getWrapItems(),s=[],a=null;o.forEach(r=>{let d=gt({item:r,containerRect:n,horizontal:e,rtl:i});a!==null&&Math.abs(d-a)>1&&s.push(d),a=d}),(s.length!==this.lineOffsets.length||s.some((r,d)=>r!==this.lineOffsets[d]))&&(this.lineOffsets=s)}handleDefaultSlotChange(){this.syncSlotAndActions(()=>this.syncDefaultSlot()),this.updateGroups(),this.updateNavigationItems(),this.syncNavigationItemTabIndexes(),this.updateActions(),this.usesWrap&&this.scheduleLineMeasure()}handleActionsEndSlotChange(){this.syncSlotAndActions(()=>this.syncActionsEndSlot()),this.syncNavigationItemTabIndexes()}handleActionsStartSlotChange(){this.syncSlotAndActions(()=>this.syncActionsStartSlot()),this.syncNavigationItemTabIndexes()}handleTooltipSlotChange(t){let e=J(t).filter(it);this.expandTooltip=e[0]}updateActions(){let t=new Set(this.actions);this.getTrackedActionMenus().forEach(e=>{e.actions.forEach(i=>t.add(i))}),t.forEach(e=>{e.selectionAppearance=this.selectionAppearance})}updateNavigationItems(){let t=[...this.getNavigationItems(this.actionsStart),...this.getNavigationItems(this.defaultSlotItems),...this.getNavigationItems(this.actionsEnd)],{expandToggleEl:e}=this;this.navigationItems=e&&this.isNavigableAction(e)?this.expandPosition==="start"?[e,...t]:[...t,e]:t}getNavigationItems(t){return t.flatMap(e=>p(e)?this.isNavigableAction(e)?[e]:[]:b(e)?this.isNavigableActionMenu(e)?[e]:[]:this.getActionGroupNavigationItems(e))}getActionGroupNavigationItems(t){if(t.hasAttribute("hidden"))return[];let e=(t.actions??[]).filter(s=>this.isNavigableAction(s)),i=R(t,"calcite-action-menu").filter(s=>this.isNavigableActionMenu(s)),n=[...e,...i].sort((s,a)=>s===a?0:s.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),{actionMenu:o}=t;return o&&this.isNavigableActionMenu(o)&&!n.includes(o)&&n.push(o),n}isNavigableAction(t){return!t.disabled&&!t.hidden&&!t.inert&&t.slot!=="menu-actions"&&!t.closest("calcite-action-menu")}isNavigableActionMenu(t){let e=t.menuButtonEl??t.actions?.find(i=>i.slot===$.trigger);return!t.hidden&&!t.inert&&!e?.disabled&&!e?.hidden&&!e?.inert}syncActions(){this.actions=ft([...this.actionsStart,...this.defaultSlotItems,...this.actionsEnd])}syncActionsAndOverflow(){this.syncActionsState(),this.overflowActions()}syncSlotAndActions(t){t(),this.syncActionsAndOverflow()}syncActionsState(t=!1){this.syncActions(),this.updateActions(),t&<({actions:this.actions,expandables:[...this.getTrackedActionGroups(),...this.getTrackedActionMenus(),...this.getSectionWrapperGroups()],expanded:this.expanded})}getTrackedActionGroups(){return[...this.actionGroups,...this.actionsStartGroups,...this.actionsEndGroups]}getTrackedActionMenus(){return[...this.actionMenus,...this.actionsStart,...this.actionsEnd].filter(t=>b(t))}getAssignedActionBarItems(t){return t?X(t).filter(e=>p(e)||f(e)||b(e)):[]}syncDefaultSlot(){this.defaultSlotItems=this.getAssignedActionBarItems(this.defaultSlotRef.value),this.actionGroups=this.defaultSlotItems.filter(t=>f(t)),this.actionMenus=this.defaultSlotItems.filter(t=>b(t)),this.updateGroups()}syncActionsStartSlot(){this.actionsStart=this.getAssignedActionBarItems(this.actionsStartSlotRef.value),this.actionsStartGroups=this.actionsStart.filter(t=>f(t)),this.hasActionsStart=this.actionsStart.length>0,this.updateGroups()}syncActionsEndSlot(){this.actionsEnd=this.getAssignedActionBarItems(this.actionsEndSlotRef.value),this.actionsEndGroups=this.actionsEnd.filter(t=>f(t)),this.hasActionsEnd=this.actionsEnd.length>0,this.updateGroups()}handleActionGroupActionsChange(t){let e=t.target;this.getTrackedActionGroups().includes(e)&&(this.suppressedActionGroupActionsChange.has(e)||(this.syncActionsAndOverflow(),this.syncNavigationItemTabIndexes()))}handleActionMenuActionsChange(t){let e=t.target;this.getTrackedActionMenus().includes(e)&&(this.syncActionsAndOverflow(),this.syncNavigationItemTabIndexes())}handleKeyDown(t){if((this.getEventActionMenu(t)||this.getOpenActionMenu())?.open)return t.key==="Escape",void 0;if(t.defaultPrevented)return;this.updateNavigationItems();let i=this.getNavigationItemFromEvent(t);if(!i||!this.navigationItems.length)return;if(this.layout==="grid"&&["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(t.key)){let r=t.key==="ArrowDown"||t.key==="ArrowRight"?"next":"previous";this.focusNavigationItem(r,i),t.preventDefault();return}let n=this.layout!=="horizontal",o=t.composedPath().find(f),s=n?"ArrowRight":"ArrowDown",a=n?"ArrowLeft":"ArrowUp",c=i.matches("calcite-action-menu")&&!i.open;if((o?.selectionMode==="multiple"||o?.selectionMode==="none")&&(t.key===s||t.key===a)&&!c){t.preventDefault();return}if(!this.handleSecondaryArrowActionMenuOpen(t,i,n))switch(t.key){case"ArrowDown":n?(this.focusNavigationItem("next",i),t.preventDefault()):this.focusActionGroupItem("next",i,o)&&t.preventDefault();break;case"ArrowUp":n?(this.focusNavigationItem("previous",i),t.preventDefault()):this.focusActionGroupItem("previous",i,o)&&t.preventDefault();break;case"ArrowRight":n?this.focusActionGroupItem("next",i,o)&&t.preventDefault():(this.focusNavigationItem("next",i),t.preventDefault());break;case"ArrowLeft":n?this.focusActionGroupItem("previous",i,o)&&t.preventDefault():(this.focusNavigationItem("previous",i),t.preventDefault());break;case"Home":this.focusNavigationItem("first",i),t.preventDefault();break;case"End":this.focusNavigationItem("last",i),t.preventDefault();break;case"Tab":t.composedPath().some(r=>p(r)&&r.aria?.role==="menuitem")||this.setNavigationItemTabIndexes(i);break}}handleSecondaryArrowActionMenuOpen(t,e,i){if(!e.matches("calcite-action-menu")||e.open)return!1;let n=i?"ArrowRight":"ArrowDown",o=i?"ArrowLeft":"ArrowUp";return t.key!==n&&t.key!==o?!1:(t.preventDefault(),this.openActionMenuAndFocusBoundaryItem(e,t.key===n?"first":"last"),!0)}openActionMenuAndFocusBoundaryItem(t,e){t.open=!0,this.focusActionMenuBoundaryItem(t,e)}async focusActionMenuBoundaryItem(t,e){if(await t.componentOnReady(),!t.open)return;let i=t.actions.filter(o=>o.aria?.role==="menuitem"&&!o.disabled&&!o.hidden&&!o.inert);await(e==="first"?i[0]:i[i.length-1])?.setFocus({preventScroll:!0})}handleFocusIn(t){this.updateNavigationItems();let e=this.getNavigationItemFromEvent(t);if(t instanceof MouseEvent){t.detail>0&&e&&p(e)&&this.setNavigationItemTabIndexes(e);return}let i=this.getEventActionMenu(t)||this.getOpenActionMenu();if(!i?.open){if(e?.matches("calcite-action-menu")&&i){this.syncClosedActionMenu(i);return}this.syncNavigationItemTabIndexes(e??void 0)}}focusNavigationItem(t,e){let{navigationItems:i}=this,n=i.indexOf(e);if(n===-1)return;let o=n;t==="first"?o=0:t==="last"?o=i.length-1:t==="next"?o=(n+1)%i.length:o=(n-1+i.length)%i.length;let s=i[o];s&&s!==e&&s.setFocus(),this.syncNavigationItemTabIndexes(s)}focusActionGroupItem(t,e,i){if(!p(e)||!i||i.selectionMode==="multiple"||i.selectionMode==="none")return!1;let n=this.navigationItems.filter(c=>p(c)&&i.actions.includes(c)),o=n.indexOf(e);if(n.length<2||o===-1)return!1;let s=t==="next"?(o+1)%n.length:(o-1+n.length)%n.length,a=n[s];return!a||a===e?!1:(a.setFocus(),this.syncNavigationItemTabIndexes(a),!0)}getCurrentNavigationItem(){let{activeElement:t}=document;if(t instanceof HTMLElement){let i=t.matches("calcite-action, calcite-action-menu")?t:t.closest("calcite-action, calcite-action-menu");if(i&&this.navigationItems.includes(i))return i;let n=t.closest("calcite-action-menu");if(n){let o=this.navigationItems.find(s=>s===n);if(o)return o}}let e=this.getCurrentFocusItem();return e||this.getDefaultNavigationItem()}getCurrentFocusItem(){let{currentFocusItem:t}=this;return t?this.navigationItems.find(e=>e===t):void 0}getDefaultNavigationItem(){return this.navigationItems.find(t=>p(t)&&t!==this.expandToggleEl)||this.navigationItems[0]}getEventActionMenu(t){let e=t.composedPath().find(n=>n instanceof HTMLElement&&n.matches("calcite-action-menu"));if(e)return e;let i=t.target;if(i instanceof HTMLElement){let n=i.closest("calcite-action-menu");if(n)return n}return null}getOpenActionMenu(){return this.navigationItems.find(t=>t.matches("calcite-action-menu")&&t.open)}syncClosedActionMenu(t){this.updateNavigationItems();let e=this.navigationItems.find(i=>i===t);e&&this.setNavigationItemTabIndexes(e)}getNavigationItemFromEvent(t){for(let e of t.composedPath()){if(!(e instanceof HTMLElement)||!e.matches("calcite-action, calcite-action-menu"))continue;let i=this.navigationItems.find(o=>o===e);if(i)return i;let n=e.closest("calcite-action-menu");if(n){let o=this.navigationItems.find(s=>s===n);if(o)return o}}return null}syncNavigationItemTabIndexes(t){this.updateNavigationItems();let i=(t?this.navigationItems.find(n=>n===t):void 0)||this.getCurrentNavigationItem();i&&(this.setNavigationItemTabIndexes(i),this.updateActions())}setNavigationItemTabIndexes(t){t.matches(":focus-within")&&(this.currentFocusItem=t),this.navigationItems.forEach(e=>{let i=e===t;if(p(e)){i&&!e.disabled&&!e.hidden?e.removeAttribute("tabindex"):e.tabIndex=-1;return}i?e.removeAttribute("tabindex"):e.tabIndex=-1;let{menuButtonEl:n}=e;n&&(i&&!e.open?n.removeAttribute("tabindex"):n.tabIndex=-1)})}renderExpandTooltipSlot(){return I`<slot name=${F.expandTooltip} @slotchange=${this.handleTooltipSlotChange}></slot>`}renderExpandToggle(){let{el:t,expanded:e,toggleExpand:i,messages:n,position:o,scale:s}=this;return ht({collapseLabel:n.collapseLabel,collapseText:n.collapse,direction:this.direction,el:t,expanded:e,expandLabel:n.expandLabel,expandText:n.expand,position:o,ref:this.setExpandToggleEl,scale:s,toggle:i,tooltip:this.expandTooltip})}renderActionsGroup(t){let{expandToggleDisabled:e,scale:i,layout:n,overlayPositioning:o,expandPosition:s}=this,a=t==="start",c=!e&&s===t,r=a?this.hasActionsStart:this.hasActionsEnd,d=a?F.actionsStart:F.actionsEnd,G=a?this.handleActionsStartSlotChange:this.handleActionsEndSlotChange,T=a?this.actionsStartGroupLabel:this.actionsEndGroupLabel,S=!c&&!r&&!(a?this.hasActionsStart:this.hasActionsEnd),g=a?this.actionsStartGroupRef:this.actionsEndGroupRef,h=a?this.actionsStartSlotRef:this.actionsEndSlotRef,A=c?this.renderExpandToggle():null;return I`<calcite-action-group class=${k({[y.actionGroupStart]:a,[y.actionGroupEnd]:!a})} .hidden=${S} .label=${T} .layout=${n} .overlayPositioning=${o} .scale=${i} ${M(g)}>${a?A:null}<slot name=${d??W} @slotchange=${G} ${M(h)}></slot>${c?this.renderExpandTooltipSlot():null}${a?null:A}</calcite-action-group>`}render(){let t=this.layout==="horizontal"?"horizontal":"vertical";return I`<div .ariaOrientation=${t} class=${k({[y.container]:!0,[y.hasActionGroups]:this.hasActionGroups})} role=toolbar ${M(this.containerRef)}>${this.renderActionsGroup("start")}<slot @slotchange=${this.handleDefaultSlotChange} ${M(this.defaultSlotRef)}></slot>${this.renderActionsGroup("end")}${this.usesWrap?I`<div aria-hidden=true class=${k(y.lineOverlay)}>${this.lineOffsets.map(e=>I`<div class=${k(y.line)} style=${`--calcite-internal-action-bar-line-offset: ${e}px`}></div>`)}</div>`:null}</div>`}};V("calcite-action-bar",H);export{H as ActionBar};
|
|
2
|
+
import{a as et}from"./G7H34HIQ.js";import{a as tt}from"./YYOLNZRT.js";import"./CSDY4NKB.js";import{a as _}from"./FDHY2TZA.js";import{b as it}from"./Q5V3JJ3K.js";import{a as y,b as F}from"./KITAKEBT.js";import{a as m,d as f}from"./4K4EWOB2.js";import{c as $,e as b}from"./7JCCKSQC.js";import{c as p}from"./N3SMZYHC.js";import{a as Z}from"./BWTQZDQ6.js";import"./TL56TNQ7.js";import{a as Y}from"./JGBARNCY.js";import"./VMHJHFFS.js";import{e as Q}from"./MLEIIIL7.js";import"./EXBAP2Y4.js";import{B as J,C as X,K as v,s as R}from"./W77STZAT.js";import{E as x,F as M,G as q,H as k,N as K,Q as j,T as V,g as U,h as I,l as W,p as D}from"./3K3WZKX6.js";var nt={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function ct(l,t){return t||l.closest("calcite-shell-panel")?.position||"start"}function lt({actions:l,expandables:t,expanded:e}){l.filter(i=>i.slot!==m.menuActions).forEach(i=>i.textEnabled=e),t.forEach(i=>i.expanded=e)}var dt=({tooltip:l,referenceElement:t,expanded:e,ref:i})=>(l&&(l.referenceElement=!e&&t?t:void 0),i&&i(t),t),ht=({collapseText:l,collapseLabel:t,direction:e,expanded:i,expandText:n,expandLabel:o,toggle:s,el:a,position:c,tooltip:r,ref:d,scale:G})=>{let T=e==="rtl",S=i?l:n,g=i?t:o,h=[nt.chevronsLeft,nt.chevronsRight];T&&h.reverse();let A=ct(a,c)==="end",C=A?h[1]:h[0],u=A?h[0]:h[1];return I`<calcite-action .aria=${{expanded:i}} .icon=${i?C:u} id=expand-toggle .label=${g} @click=${s} .scale=${G} .text=${S} .textEnabled=${i} title=${(!i&&!r?S:void 0)??W} ${M(z=>dt({tooltip:r,referenceElement:z,expanded:i,ref:d}))}></calcite-action>`},ut=({bufferSize:l=0,containerSize:t,itemSizes:e})=>{let i=t-l,n=e.length,o=0;for(let[s,a]of e.entries())if(o=o+a,o>i){n=s;break}else continue;return n},pt=({bufferSize:l=0,containerSize:t,itemSizes:e})=>Math.max(e.length-ut({bufferSize:l,itemSizes:e,containerSize:t}),0),ft=l=>l.flatMap(t=>f(t)?t.actions:b(t)?t.actions.filter(e=>e.slot===$.trigger):t).filter(t=>!!t),gt=({item:l,containerRect:t,horizontal:e,rtl:i})=>{let n=l.getBoundingClientRect();return e?n.top-t.top:i?t.right-n.right:n.left-t.left},vt=({actionGroups:l,expanded:t,overflowCount:e})=>{let i=e;[...l].reverse().forEach(n=>{let o=0,s=n.actions.filter(a=>a.parentElement===n).reverse();s.forEach(a=>{a.slot===m.menuActions&&(a.removeAttribute("slot"),a.textEnabled=t)}),i>0&&!n.overflowActionsDisabled&&s.some(a=>(s.filter(r=>!r.slot).length>1&&s.length>2&&!a.closest("calcite-action-menu")&&!a.overflowDisabled&&(a.textEnabled=!0,a.setAttribute("slot",m.menuActions),o++,o>1&&i--),i<1)),n.manager.component.requestUpdate()})},mt=U`:host{box-sizing:border-box;background-color:var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1));color:var(--calcite-color-text-2);font-size:var(--calcite-font-size-relative-base)}:host *{box-sizing:border-box}:host([scale=s]){--calcite-internal-action-bar-gap: var( --calcite-action-bar-items-space, var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs)) );--calcite-internal-action-bar-padding: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=m]){--calcite-internal-action-bar-gap: var( --calcite-action-bar-items-space, var(--calcite-theme-space-sm, var(--calcite-spacing-sm)) );--calcite-internal-action-bar-padding: var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=l]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-space-sm-plus));--calcite-internal-action-bar-padding: var(--calcite-theme-space-sm-plus, var(--calcite-spacing-sm-plus))}:host{display:inline-flex;align-self:stretch;background:transparent;--calcite-internal-action-group-dividing-border-margin: calc( var(--calcite-theme-space-base, var(--calcite-spacing-base)) + 1px )}.container{display:inline-flex;flex-direction:column;flex:1 1 auto;background-color:var(--calcite-action-bar-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)));gap:var(--calcite-internal-action-bar-gap);padding:var(--calcite-internal-action-bar-padding)}:host([floating]) .container{animation:in var(--calcite-internal-animation-timing-slow) ease-in-out;overflow:hidden;border-radius:var(--calcite-action-bar-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));box-shadow:var(--calcite-action-bar-shadow, var(--calcite-shadow-md))}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]) .container{overflow-y:auto}:host([layout=vertical]):host([expanded]) .container{max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm);border-image:linear-gradient(to right,transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent var(--calcite-internal-action-group-dividing-border-margin));border-image-slice:1;padding-block-end:var(--calcite-internal-action-bar-padding)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]) .container{flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]) .container{overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-image:linear-gradient(transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent var(--calcite-internal-action-group-dividing-border-margin));border-image-slice:1;border-inline-end-width:var(--calcite-border-width-sm);padding-inline-end:var(--calcite-internal-action-bar-padding)}.action-group--end{justify-content:flex-end}.line-overlay{position:absolute;inset:0;pointer-events:none}.line{position:absolute;--calcite-internal-action-bar-divider-inset: calc( var(--calcite-internal-action-group-dividing-border-margin) - var(--calcite-border-width-sm) )}:host([overflow-mode=wrap][layout=horizontal]) .container,:host([overflow-mode=wrap][layout=vertical]) .container{position:relative;flex-wrap:wrap;align-content:flex-start;--calcite-internal-action-bar-line-gap: calc( var(--calcite-internal-action-bar-padding) + var(--calcite-internal-action-bar-gap) )}:host([overflow-mode=wrap][layout=horizontal]) ::slotted(calcite-action-group[slot=actions-start]),:host([overflow-mode=wrap][layout=vertical]) ::slotted(calcite-action-group[slot=actions-start]){padding-inline-end:0;padding-block-end:0;border-inline-end-width:0;border-block-end-width:0}:host([overflow-mode=wrap][layout=horizontal]) .container{row-gap:var(--calcite-internal-action-bar-line-gap)}:host([overflow-mode=wrap][layout=horizontal]) ::slotted(calcite-action-group:not([slot=actions-start])){margin-inline-start:calc(-1 * var(--calcite-border-width-sm));padding-inline:var(--calcite-internal-action-bar-padding) 0;border-inline-start-width:var(--calcite-border-width-sm);border-inline-end-width:0;border-image:linear-gradient(transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent calc(100% - var(--calcite-internal-action-group-dividing-border-margin)));border-image-slice:1}:host([overflow-mode=wrap][layout=horizontal]) .line{inset-inline:var(--calcite-internal-action-bar-padding);block-size:var(--calcite-border-width-sm);inset-block-start:calc(var(--calcite-internal-action-bar-line-offset, 0px) - var(--calcite-internal-action-bar-line-gap) / 2);background:linear-gradient(to right,transparent var(--calcite-internal-action-bar-divider-inset),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-bar-divider-inset),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-bar-divider-inset)),transparent calc(100% - var(--calcite-internal-action-bar-divider-inset)))}:host([overflow-mode=wrap][layout=horizontal]) .container.has-action-groups{overflow:hidden;padding-inline-start:0;column-gap:calc(var(--calcite-internal-action-bar-gap) + var(--calcite-border-width-sm))}:host([overflow-mode=wrap][layout=horizontal]) .container.has-action-groups .action-group--start{padding-inline-start:var(--calcite-internal-action-bar-padding)}:host([overflow-mode=wrap][layout=vertical]) .container{block-size:100%;min-block-size:0;column-gap:var(--calcite-internal-action-bar-line-gap)}:host([overflow-mode=wrap][layout=vertical]) ::slotted(calcite-action-group:not([slot=actions-start])){margin-block-start:calc(-1 * var(--calcite-border-width-sm));padding-block:var(--calcite-internal-action-bar-padding) 0;border-block-start-width:var(--calcite-border-width-sm);border-block-end-width:0;border-image:linear-gradient(to right,transparent var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-group-dividing-border-margin),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-group-dividing-border-margin)),transparent calc(100% - var(--calcite-internal-action-group-dividing-border-margin)));border-image-slice:1}:host([overflow-mode=wrap][layout=vertical]) .line{inset-block:var(--calcite-internal-action-bar-padding);inline-size:var(--calcite-border-width-sm);inset-inline-start:calc(var(--calcite-internal-action-bar-line-offset, 0px) - var(--calcite-internal-action-bar-line-gap) / 2);background:linear-gradient(to bottom,transparent var(--calcite-internal-action-bar-divider-inset),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) var(--calcite-internal-action-bar-divider-inset),var(--calcite-action-group-border-color, var(--calcite-color-border-3)) calc(100% - var(--calcite-internal-action-bar-divider-inset)),transparent calc(100% - var(--calcite-internal-action-bar-divider-inset)))}:host([overflow-mode=wrap][layout=vertical]) .container.has-action-groups{overflow:hidden;padding-block-start:0;row-gap:calc(var(--calcite-internal-action-bar-gap) + var(--calcite-border-width-sm))}:host([overflow-mode=wrap][layout=vertical]) .container.has-action-groups .action-group--start{padding-block-start:var(--calcite-internal-action-bar-padding)}:host([overflow-mode=none][layout=horizontal]) .container{overflow-x:auto}:host([overflow-mode=none][layout=vertical]) .container{overflow-y:auto}:host([hidden]){display:none}[hidden]{display:none}`,H=class extends q{constructor(){super(),this.actions=[],this.navigationItems=[],this.containerRef=x(),this.defaultSlotRef=x(),this.actionsStartSlotRef=x(),this.actionsEndSlotRef=x(),this.actionsStartGroupRef=x(),this.actionsEndGroupRef=x(),this.direction=Q(),this.defaultSlotItems=[],this.actionGroups=[],this.actionMenus=[],this.actionsStart=[],this.actionsStartGroups=[],this.actionsEnd=[],this.actionsEndGroups=[],this.automaticallyOverflowedActions=[],this.authoredMenuActions=[],this.overflowPassId=0,this.suppressedActionGroupActionsChange=new WeakMap,this.cancelable=et()(this),this.resize=tt(({width:t,height:e})=>{let{expanded:i,expandToggleDisabled:n,layout:o,expandPosition:s}=this;if(!this.el.isConnected||!this.containerRef.value)return;if(this.updateGroups(),this.usesWrap){this.scheduleLineMeasure();return}if(this.overflowMode!=="collapse"||o==="vertical"&&!e||o==="horizontal"&&!t)return;let a=this.getItemSizes(),{actionGroups:c,actionsEnd:r,actionsEndGroups:d,actionsStart:G,actionsStartGroups:T,defaultSlotItems:S}=this,g=[...T,...c,...d],h=this.hasActionsEnd||!n&&s==="end"?1:0,A=this.hasActionsStart||!n&&s==="start"?1:0,C=S.length+h+A,u=C,E=getComputedStyle(this.containerRef.value);if(u+=v(o==="horizontal"?E.paddingInlineStart:E.paddingBlockStart)+v(o==="horizontal"?E.paddingInlineEnd:E.paddingBlockEnd),g.length>0){let O=g.length-1;g.forEach((N,L)=>{let w=getComputedStyle(N),B=v(w.gap),P=this.getActionGroupItemCount(N),rt=Math.max(P-1,0);u+=B*rt,L!==O&&(u+=v(o==="horizontal"?w.paddingInlineEnd:w.paddingBlockEnd),u+=v(o==="horizontal"?w.borderInlineEndWidth:w.borderBlockEndWidth))})}let z=(O,N,L)=>{if(!N||O.length<1)return;let w=getComputedStyle(N),B=v(w.gap),P=O.length+(L?1:0);u+=B*Math.max(P-1,0)},at=!n&&s==="start",ot=!n&&s==="end";z(G,this.actionsStartGroupRef.value,at),z(r,this.actionsEndGroupRef.value,ot),C>1&&(u+=v(E.gap)*(C-1));let st=pt({bufferSize:u,containerSize:o==="horizontal"?t:e,itemSizes:a});this.runOverflowActions({actionGroups:g,expanded:i,overflowCount:st})},K.resize),this.resizeHandler=t=>{if(this.usesWrap){this.scheduleLineMeasure();return}let{width:e,height:i}=t.target&&t.target!==this.el?{width:this.el.clientWidth,height:this.el.clientHeight}:t.contentRect,n=this.layout==="horizontal"?"width":"height",o=n==="width"?e:i;this.lastOverflowAxisSize?.axis===n&&this.lastOverflowAxisSize.size===o||(this.lastOverflowAxisSize={axis:n,size:o},this.resize({width:e,height:i}))},this.resizeObserver=_("resize",t=>this.resizeHandlerEntries(t)),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.messages=Z({blocking:!0}),this.focusSetter=Y()(this).setFocus,this.setExpandToggleEl=t=>{this.expandToggleEl=t,this.syncNavigationItemTabIndexes()},this.hasActionsEnd=!1,this.hasActionsStart=!1,this.hasActionGroups=!1,this.lineOffsets=[],this.floating=!1,this.expandToggleDisabled=!1,this.expanded=!1,this.expandPosition="end",this.layout="vertical",this.overflowMode="collapse",this.overlayPositioning="absolute",this.scale="m",this.selectionAppearance="neutral",this.calciteActionBarCollapse=D({cancelable:!1}),this.calciteActionBarExpand=D({cancelable:!1}),this.calciteActionBarToggle=D({cancelable:!1}),this.listen("calciteActionMenuOpen",this.actionMenuOpenHandler),this.listen("calciteInternalActionGroupActionsChange",this.handleActionGroupActionsChange),this.listen("calciteInternalActionMenuActionsChange",this.handleActionMenuActionsChange),this.listen("click",this.handleFocusIn),this.listen("keydown",this.handleKeyDown),this.listen("focusin",this.handleFocusIn)}static{this.properties={expandTooltip:[16,{},{state:!0}],hasActionsEnd:[16,{},{state:!0}],hasActionsStart:[16,{},{state:!0}],hasActionGroups:[16,{},{state:!0}],lineOffsets:[16,{},{state:!0}],actionsEndGroupLabel:1,actionsStartGroupLabel:1,floating:[7,{},{reflect:!0,type:Boolean}],expandToggleDisabled:[7,{},{reflect:!0,type:Boolean}],expanded:[7,{},{reflect:!0,type:Boolean}],expandPosition:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],overflowMode:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],overflowActionsDisabled:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],position:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}],selectionAppearance:[3,{},{reflect:!0}]}}static{this.styles=mt}get usesWrap(){return this.overflowMode==="wrap"&&this.layout!=="grid"}get overflowActionsDisabled(){return this.overflowMode==="none"}set overflowActionsDisabled(t){j.deprecated("property",{component:this,name:"overflowActionsDisabled",removalVersion:7,suggested:'overflowMode="none"'}),this.overflowMode=t?"none":"collapse"}async overflowActions(){if(this.overflowMode!=="collapse"){this.usesWrap&&this.scheduleLineMeasure();return}this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(t){return this.focusSetter(()=>this.el,t)}connectedCallback(){super.connectedCallback(),this.updateGroups(),this.updateNavigationItems(),this.syncNavigationItemTabIndexes(),this.overflowActions(),this.updateActions(),this.overflowActionsDisabledHandler(this.overflowActionsDisabled),this.overflowModeHandler(),this.cancelable.add(this.resize)}willUpdate(t){(t.has("expandToggleDisabled")&&(this.hasUpdated||this.expandToggleDisabled!==!1)||t.has("expandPosition")&&(this.hasUpdated||this.expandPosition!=="end"))&&this.overflowActions(),t.has("layout")&&(this.hasUpdated||this.layout!=="vertical")&&(this.updateGroups(),this.overflowModeHandler(),this.usesWrap||this.updateLines()),t.has("overflowActionsDisabled")&&(this.hasUpdated||this.overflowActionsDisabled!==!1)&&this.overflowActionsDisabledHandler(this.overflowActionsDisabled),t.has("overflowMode")&&(this.hasUpdated||this.overflowMode!=="collapse")&&(!this.usesWrap&&this.lineMeasureFrame!=null&&(cancelAnimationFrame(this.lineMeasureFrame),this.lineMeasureFrame=void 0),this.usesWrap?this.scheduleLineMeasure():this.updateLines(),this.overflowModeHandler()),t.has("expanded")&&this.hasUpdated&&(this.expandedHandler(),this.expanded?this.calciteActionBarExpand.emit():this.calciteActionBarCollapse.emit()),t.has("selectionAppearance")&&(this.hasUpdated||this.selectionAppearance!=="neutral")&&this.updateActions()}updated(){this.usesWrap&&this.lineMeasureFrame==null&&this.scheduleLineMeasure()}loaded(){this.syncDefaultSlot(),this.syncActionsStartSlot(),this.syncActionsEndSlot(),this.syncActionsState(),this.overflowActions()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.lineMeasureFrame!=null&&(cancelAnimationFrame(this.lineMeasureFrame),this.lineMeasureFrame=void 0)}getItemSizes(){let{layout:t,expandToggleEl:e}=this,i=t==="horizontal"?"clientWidth":"clientHeight",n=this.actions.map(a=>a[i]||0);this.getTrackedActionGroups().flatMap(a=>R(a,"calcite-action-menu")).forEach(a=>{let c=(a.actions??[]).find(r=>r.slot===$.trigger);n.push((c??a)[i]||0)}),e&&n.push(e[i]||0);let s=Math.max(...n,0);return n.map(a=>a||s)}getActionGroupItemCount(t){let e=t.actions.filter(n=>n.parentElement===t),i=R(t,"calcite-action-menu").length;return e.length+i}expandedHandler(){this.syncActionsState(!0),this.overflowActions()}overflowModeHandler(){this.overflowMode==="none"?this.resizeObserver?.disconnect():this.resizeObserver?.observe(this.el),this.overflowActions()}overflowActionsDisabledHandler(t){if(t){this.resizeObserver?.disconnect();return}this.resizeObserver?.observe(this.el),this.containerRef.value&&this.resizeObserver?.observe(this.containerRef.value),this.overflowActions()}actionMenuOpenHandler(t){let e=t.composedPath(),i=e.find(n=>f(n)||b(n));i&&(f(i)&&!i.menuOpen||b(i)&&!i.open||(this.getTrackedActionGroups().forEach(n=>{e.includes(n)||(n.menuOpen=!1)}),this.getTrackedActionMenus().forEach(n=>{e.includes(n)||(n.open=!1)}),this.updateActions()))}runOverflowActions({actionGroups:t,expanded:e,overflowCount:i}){let n=++this.overflowPassId,o=t.flatMap(a=>a.actions.filter(c=>c.parentElement===a));this.automaticallyOverflowedActions=this.automaticallyOverflowedActions.filter(a=>o.includes(a)),this.authoredMenuActions=this.authoredMenuActions.filter(a=>o.includes(a)&&a.slot===m.menuActions),o.forEach(a=>{a.slot===m.menuActions&&!this.automaticallyOverflowedActions.includes(a)&&!this.authoredMenuActions.includes(a)&&this.authoredMenuActions.push(a)});let s=new Map;t.forEach(a=>{let c=a.actions.filter(r=>r.parentElement===a);s.set(a,c.map(r=>r.slot??"").join("|"))}),vt({actionGroups:t,expanded:e,overflowCount:i}),this.authoredMenuActions.forEach(a=>{a.slot=m.menuActions,a.textEnabled=!0}),this.automaticallyOverflowedActions=o.filter(a=>a.slot===m.menuActions&&!this.authoredMenuActions.includes(a)),t.forEach(a=>{let r=a.actions.filter(d=>d.parentElement===a).map(d=>d.slot??"").join("|");s.get(a)!==r&&(this.suppressedActionGroupActionsChange.set(a,n),this.queueSuppressedActionGroupActionsChangeCleanup(a,n))})}queueSuppressedActionGroupActionsChangeCleanup(t,e){queueMicrotask(()=>{this.suppressedActionGroupActionsChange.get(t)===e&&this.suppressedActionGroupActionsChange.delete(t)})}resizeHandlerEntries(t){t.forEach(this.resizeHandler)}getSectionWrapperGroups(){return[this.actionsStartGroupRef.value,this.actionsEndGroupRef.value].filter(t=>!!t)}updateGroups(){let t=[...this.actionGroups,...this.actionsStartGroups,...this.actionsEndGroups,...this.getSectionWrapperGroups()];this.hasActionGroups=this.actionGroups.length>0,t.forEach(e=>{e.layout=this.layout,e.scale=this.scale}),this.syncNavItems()}syncNavItems(){this.el.isConnected&&(this.updateNavigationItems(),this.syncNavigationItemTabIndexes(),this.updateActions())}scheduleLineMeasure(){this.lineMeasureFrame!=null&&cancelAnimationFrame(this.lineMeasureFrame),this.lineMeasureFrame=requestAnimationFrame(()=>{this.lineMeasureFrame=void 0,this.updateLines()})}getWrapItems(){let t=[],e=this.actionsStartGroupRef.value;e&&!e.hidden&&t.push(e),this.defaultSlotItems.forEach(n=>{n.hidden||t.push(n)});let i=this.actionsEndGroupRef.value;return i&&!i.hidden&&t.push(i),t}updateLines(){let t=this.containerRef.value;if(!t||!this.usesWrap){this.lineOffsets.length>0&&(this.lineOffsets=[]);return}let e=this.layout==="horizontal",i=this.direction==="rtl",n=t.getBoundingClientRect(),o=this.getWrapItems(),s=[],a=null;o.forEach(r=>{let d=gt({item:r,containerRect:n,horizontal:e,rtl:i});a!==null&&Math.abs(d-a)>1&&s.push(d),a=d}),(s.length!==this.lineOffsets.length||s.some((r,d)=>r!==this.lineOffsets[d]))&&(this.lineOffsets=s)}handleDefaultSlotChange(){this.syncSlotAndActions(()=>this.syncDefaultSlot()),this.updateGroups(),this.updateNavigationItems(),this.syncNavigationItemTabIndexes(),this.updateActions(),this.usesWrap&&this.scheduleLineMeasure()}handleActionsEndSlotChange(){this.syncSlotAndActions(()=>this.syncActionsEndSlot()),this.syncNavigationItemTabIndexes()}handleActionsStartSlotChange(){this.syncSlotAndActions(()=>this.syncActionsStartSlot()),this.syncNavigationItemTabIndexes()}handleTooltipSlotChange(t){let e=J(t).filter(it);this.expandTooltip=e[0]}updateActions(){let t=new Set(this.actions);this.getTrackedActionMenus().forEach(e=>{e.actions.forEach(i=>t.add(i))}),t.forEach(e=>{e.selectionAppearance=this.selectionAppearance})}updateNavigationItems(){let t=[...this.getNavigationItems(this.actionsStart),...this.getNavigationItems(this.defaultSlotItems),...this.getNavigationItems(this.actionsEnd)],{expandToggleEl:e}=this;this.navigationItems=e&&this.isNavigableAction(e)?this.expandPosition==="start"?[e,...t]:[...t,e]:t}getNavigationItems(t){return t.flatMap(e=>p(e)?this.isNavigableAction(e)?[e]:[]:b(e)?this.isNavigableActionMenu(e)?[e]:[]:this.getActionGroupNavigationItems(e))}getActionGroupNavigationItems(t){if(t.hasAttribute("hidden"))return[];let e=(t.actions??[]).filter(s=>this.isNavigableAction(s)),i=R(t,"calcite-action-menu").filter(s=>this.isNavigableActionMenu(s)),n=[...e,...i].sort((s,a)=>s===a?0:s.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),{actionMenu:o}=t;return o&&this.isNavigableActionMenu(o)&&!n.includes(o)&&n.push(o),n}isNavigableAction(t){return!t.disabled&&!t.hidden&&!t.inert&&t.slot!=="menu-actions"&&!t.closest("calcite-action-menu")}isNavigableActionMenu(t){let e=t.menuButtonEl??t.actions?.find(i=>i.slot===$.trigger);return!t.hidden&&!t.inert&&!e?.disabled&&!e?.hidden&&!e?.inert}syncActions(){this.actions=ft([...this.actionsStart,...this.defaultSlotItems,...this.actionsEnd])}syncActionsAndOverflow(){this.syncActionsState(),this.overflowActions()}syncSlotAndActions(t){t(),this.syncActionsAndOverflow()}syncActionsState(t=!1){this.syncActions(),this.updateActions(),t&<({actions:this.actions,expandables:[...this.getTrackedActionGroups(),...this.getTrackedActionMenus(),...this.getSectionWrapperGroups()],expanded:this.expanded})}getTrackedActionGroups(){return[...this.actionGroups,...this.actionsStartGroups,...this.actionsEndGroups]}getTrackedActionMenus(){return[...this.actionMenus,...this.actionsStart,...this.actionsEnd].filter(t=>b(t))}getAssignedActionBarItems(t){return t?X(t).filter(e=>p(e)||f(e)||b(e)):[]}syncDefaultSlot(){this.defaultSlotItems=this.getAssignedActionBarItems(this.defaultSlotRef.value),this.actionGroups=this.defaultSlotItems.filter(t=>f(t)),this.actionMenus=this.defaultSlotItems.filter(t=>b(t)),this.updateGroups()}syncActionsStartSlot(){this.actionsStart=this.getAssignedActionBarItems(this.actionsStartSlotRef.value),this.actionsStartGroups=this.actionsStart.filter(t=>f(t)),this.hasActionsStart=this.actionsStart.length>0,this.updateGroups()}syncActionsEndSlot(){this.actionsEnd=this.getAssignedActionBarItems(this.actionsEndSlotRef.value),this.actionsEndGroups=this.actionsEnd.filter(t=>f(t)),this.hasActionsEnd=this.actionsEnd.length>0,this.updateGroups()}handleActionGroupActionsChange(t){let e=t.target;this.getTrackedActionGroups().includes(e)&&(this.suppressedActionGroupActionsChange.has(e)||(this.syncActionsAndOverflow(),this.syncNavigationItemTabIndexes()))}handleActionMenuActionsChange(t){let e=t.target;this.getTrackedActionMenus().includes(e)&&(this.syncActionsAndOverflow(),this.syncNavigationItemTabIndexes())}handleKeyDown(t){if((this.getEventActionMenu(t)||this.getOpenActionMenu())?.open)return t.key==="Escape",void 0;if(t.defaultPrevented)return;this.updateNavigationItems();let i=this.getNavigationItemFromEvent(t);if(!i||!this.navigationItems.length)return;if(this.layout==="grid"&&["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(t.key)){let r=t.key==="ArrowDown"||t.key==="ArrowRight"?"next":"previous";this.focusNavigationItem(r,i),t.preventDefault();return}let n=this.layout!=="horizontal",o=t.composedPath().find(f),s=n?"ArrowRight":"ArrowDown",a=n?"ArrowLeft":"ArrowUp",c=i.matches("calcite-action-menu")&&!i.open;if((o?.selectionMode==="multiple"||o?.selectionMode==="none")&&(t.key===s||t.key===a)&&!c){t.preventDefault();return}if(!this.handleSecondaryArrowActionMenuOpen(t,i,n))switch(t.key){case"ArrowDown":n?(this.focusNavigationItem("next",i),t.preventDefault()):this.focusActionGroupItem("next",i,o)&&t.preventDefault();break;case"ArrowUp":n?(this.focusNavigationItem("previous",i),t.preventDefault()):this.focusActionGroupItem("previous",i,o)&&t.preventDefault();break;case"ArrowRight":n?this.focusActionGroupItem("next",i,o)&&t.preventDefault():(this.focusNavigationItem("next",i),t.preventDefault());break;case"ArrowLeft":n?this.focusActionGroupItem("previous",i,o)&&t.preventDefault():(this.focusNavigationItem("previous",i),t.preventDefault());break;case"Home":this.focusNavigationItem("first",i),t.preventDefault();break;case"End":this.focusNavigationItem("last",i),t.preventDefault();break;case"Tab":t.composedPath().some(r=>p(r)&&r.aria?.role==="menuitem")||this.setNavigationItemTabIndexes(i);break}}handleSecondaryArrowActionMenuOpen(t,e,i){if(!e.matches("calcite-action-menu")||e.open)return!1;let n=i?"ArrowRight":"ArrowDown",o=i?"ArrowLeft":"ArrowUp";return t.key!==n&&t.key!==o?!1:(t.preventDefault(),this.openActionMenuAndFocusBoundaryItem(e,t.key===n?"first":"last"),!0)}openActionMenuAndFocusBoundaryItem(t,e){t.open=!0,this.focusActionMenuBoundaryItem(t,e)}async focusActionMenuBoundaryItem(t,e){if(await t.componentOnReady(),!t.open)return;let i=t.actions.filter(o=>o.aria?.role==="menuitem"&&!o.disabled&&!o.hidden&&!o.inert);await(e==="first"?i[0]:i[i.length-1])?.setFocus({preventScroll:!0})}handleFocusIn(t){this.updateNavigationItems();let e=this.getNavigationItemFromEvent(t);if(t instanceof MouseEvent){t.detail>0&&e&&p(e)&&this.setNavigationItemTabIndexes(e);return}let i=this.getEventActionMenu(t)||this.getOpenActionMenu();if(!i?.open){if(e?.matches("calcite-action-menu")&&i){this.syncClosedActionMenu(i);return}this.syncNavigationItemTabIndexes(e??void 0)}}focusNavigationItem(t,e){let{navigationItems:i}=this,n=i.indexOf(e);if(n===-1)return;let o=n;t==="first"?o=0:t==="last"?o=i.length-1:t==="next"?o=(n+1)%i.length:o=(n-1+i.length)%i.length;let s=i[o];s&&s!==e&&s.setFocus(),this.syncNavigationItemTabIndexes(s)}focusActionGroupItem(t,e,i){if(!p(e)||!i||i.selectionMode==="multiple"||i.selectionMode==="none")return!1;let n=this.navigationItems.filter(c=>p(c)&&i.actions.includes(c)),o=n.indexOf(e);if(n.length<2||o===-1)return!1;let s=t==="next"?(o+1)%n.length:(o-1+n.length)%n.length,a=n[s];return!a||a===e?!1:(a.setFocus(),this.syncNavigationItemTabIndexes(a),!0)}getCurrentNavigationItem(){let{activeElement:t}=document;if(t instanceof HTMLElement){let i=t.matches("calcite-action, calcite-action-menu")?t:t.closest("calcite-action, calcite-action-menu");if(i&&this.navigationItems.includes(i))return i;let n=t.closest("calcite-action-menu");if(n){let o=this.navigationItems.find(s=>s===n);if(o)return o}}let e=this.getCurrentFocusItem();return e||this.getDefaultNavigationItem()}getCurrentFocusItem(){let{currentFocusItem:t}=this;return t?this.navigationItems.find(e=>e===t):void 0}getDefaultNavigationItem(){return this.navigationItems.find(t=>p(t)&&t!==this.expandToggleEl)||this.navigationItems[0]}getEventActionMenu(t){let e=t.composedPath().find(n=>n instanceof HTMLElement&&n.matches("calcite-action-menu"));if(e)return e;let i=t.target;if(i instanceof HTMLElement){let n=i.closest("calcite-action-menu");if(n)return n}return null}getOpenActionMenu(){return this.navigationItems.find(t=>t.matches("calcite-action-menu")&&t.open)}syncClosedActionMenu(t){this.updateNavigationItems();let e=this.navigationItems.find(i=>i===t);e&&this.setNavigationItemTabIndexes(e)}getNavigationItemFromEvent(t){for(let e of t.composedPath()){if(!(e instanceof HTMLElement)||!e.matches("calcite-action, calcite-action-menu"))continue;let i=this.navigationItems.find(o=>o===e);if(i)return i;let n=e.closest("calcite-action-menu");if(n){let o=this.navigationItems.find(s=>s===n);if(o)return o}}return null}syncNavigationItemTabIndexes(t){this.updateNavigationItems();let i=(t?this.navigationItems.find(n=>n===t):void 0)||this.getCurrentNavigationItem();i&&(this.setNavigationItemTabIndexes(i),this.updateActions())}setNavigationItemTabIndexes(t){t.matches(":focus-within")&&(this.currentFocusItem=t),this.navigationItems.forEach(e=>{let i=e===t;if(p(e)){i&&!e.disabled&&!e.hidden?e.removeAttribute("tabindex"):e.tabIndex=-1;return}i?e.removeAttribute("tabindex"):e.tabIndex=-1;let{menuButtonEl:n}=e;n&&(i&&!e.open?n.removeAttribute("tabindex"):n.tabIndex=-1)})}renderExpandTooltipSlot(){return I`<slot name=${F.expandTooltip} @slotchange=${this.handleTooltipSlotChange}></slot>`}renderExpandToggle(){let{el:t,expanded:e,toggleExpand:i,messages:n,position:o,scale:s}=this;return ht({collapseLabel:n.collapseLabel,collapseText:n.collapse,direction:this.direction,el:t,expanded:e,expandLabel:n.expandLabel,expandText:n.expand,position:o,ref:this.setExpandToggleEl,scale:s,toggle:i,tooltip:this.expandTooltip})}renderActionsGroup(t){let{expandToggleDisabled:e,scale:i,layout:n,overlayPositioning:o,expandPosition:s}=this,a=t==="start",c=!e&&s===t,r=a?this.hasActionsStart:this.hasActionsEnd,d=a?F.actionsStart:F.actionsEnd,G=a?this.handleActionsStartSlotChange:this.handleActionsEndSlotChange,T=a?this.actionsStartGroupLabel:this.actionsEndGroupLabel,S=!c&&!r&&!(a?this.hasActionsStart:this.hasActionsEnd),g=a?this.actionsStartGroupRef:this.actionsEndGroupRef,h=a?this.actionsStartSlotRef:this.actionsEndSlotRef,A=c?this.renderExpandToggle():null;return I`<calcite-action-group class=${k({[y.actionGroupStart]:a,[y.actionGroupEnd]:!a})} .hidden=${S} .label=${T} .layout=${n} .overlayPositioning=${o} .scale=${i} ${M(g)}>${a?A:null}<slot name=${d??W} @slotchange=${G} ${M(h)}></slot>${c?this.renderExpandTooltipSlot():null}${a?null:A}</calcite-action-group>`}render(){let t=this.layout==="horizontal"?"horizontal":"vertical";return I`<div .ariaOrientation=${t} class=${k({[y.container]:!0,[y.hasActionGroups]:this.hasActionGroups})} role=toolbar ${M(this.containerRef)}>${this.renderActionsGroup("start")}<slot @slotchange=${this.handleDefaultSlotChange} ${M(this.defaultSlotRef)}></slot>${this.renderActionsGroup("end")}${this.usesWrap?I`<div aria-hidden=true class=${k(y.lineOverlay)}>${this.lineOffsets.map(e=>I`<div class=${k(y.line)} style=${`--calcite-internal-action-bar-line-offset: ${e}px`}></div>`)}</div>`:null}</div>`}};V("calcite-action-bar",H);export{H as ActionBar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{F as n,H as o,h as a,l as t}from"./
|
|
2
|
+
import{F as n,H as o,h as a,l as t}from"./3K3WZKX6.js";var m={validationContainer:"validation-container"},d=()=>{},$=({scale:e,status:s,id:r,icon:l,message:c,ref:i})=>a`<div class=${o(m.validationContainer)} ${n(i||d)}><calcite-input-message aria-live=polite .icon=${l} id=${r??t} .scale=${e} .status=${s}>${c}</calcite-input-message></div>`;export{$ as a};
|