@esri/calcite-components 5.2.0-next.80 → 5.2.0-next.81
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/{3VGVJYKR.js → 24SDNX5W.js} +1 -1
- package/dist/cdn/{TPFJLKRA.js → 2RMB6NE5.js} +1 -1
- package/dist/cdn/2YE7GOZQ.js +2 -0
- package/dist/cdn/{UQYCU67G.js → 34PRJ3IO.js} +1 -1
- package/dist/cdn/{OZGPREDK.js → 367OPBUU.js} +1 -1
- package/dist/cdn/{Z4YO5OK2.js → 3BQY2ELM.js} +1 -1
- package/dist/cdn/{IP7RBEWP.js → 3EEIZXLQ.js} +1 -1
- package/dist/cdn/{E4WNM7ID.js → 457HWG5E.js} +1 -1
- package/dist/cdn/{3QK4UKRU.js → 4HSQ3OW6.js} +1 -1
- package/dist/cdn/{ZHVBRXLM.js → 4SS7D4VW.js} +1 -1
- package/dist/cdn/{5ZFANAVE.js → 4XPFNPZM.js} +1 -1
- package/dist/cdn/{O2F6M3NQ.js → 4ZBFKHMZ.js} +1 -1
- package/dist/cdn/{NBIVPZGP.js → 5ETHX2LI.js} +1 -1
- package/dist/cdn/{AOFJR4G3.js → 5HPNMURT.js} +1 -1
- package/dist/cdn/{Q4ZDKWIX.js → 5MEA362K.js} +1 -1
- package/dist/cdn/{XNCCLJ4O.js → 5YXMJRF7.js} +1 -1
- package/dist/cdn/{D3YJEUCT.js → 67TXTJI6.js} +1 -1
- package/dist/cdn/{PNSHLPHT.js → 6CVUFSLV.js} +1 -1
- package/dist/cdn/{T3O2GQJV.js → 6HE7HZIK.js} +1 -1
- package/dist/cdn/{JVLW3AQQ.js → 6IYFRW7G.js} +1 -1
- package/dist/cdn/{SIKIAQV2.js → 6Y5FJNGF.js} +1 -1
- package/dist/cdn/{T7NBLUEP.js → 6ZPKTX7N.js} +1 -1
- package/dist/cdn/{OJXZ5EVK.js → 7PYNU2VQ.js} +1 -1
- package/dist/cdn/{74DGUGRK.js → ABXNPYGM.js} +1 -1
- package/dist/cdn/{7VNW2CMV.js → ADAXGICT.js} +1 -1
- package/dist/cdn/{COWTNZLJ.js → ANJBVD45.js} +1 -1
- package/dist/cdn/{EPQIXGRB.js → AV67YLCQ.js} +1 -1
- package/dist/cdn/{ZCVSPJIH.js → BDBFEYLH.js} +1 -1
- package/dist/cdn/{Y4EWSZGT.js → BOTPAULU.js} +1 -1
- package/dist/cdn/{AA4ZF7ZX.js → CCDJRUAD.js} +1 -1
- package/dist/cdn/{MVNBHSO2.js → CG7VTX2O.js} +1 -1
- package/dist/cdn/{P6DI2FMY.js → CHVMU3UG.js} +1 -1
- package/dist/cdn/{WL23WOZU.js → CK4I3ZRA.js} +1 -1
- package/dist/cdn/{NVS3Y42V.js → CS73S5VB.js} +1 -1
- package/dist/cdn/{WHZU4NYC.js → CVBD6KCE.js} +1 -1
- package/dist/cdn/{ZNQVRE3T.js → D6RE4NAL.js} +1 -1
- package/dist/cdn/{AJCH27T6.js → DCCER5NW.js} +1 -1
- package/dist/cdn/{5TRB6HCI.js → DX6E4IIS.js} +1 -1
- package/dist/cdn/{D43JETDJ.js → E3NB7TJ2.js} +1 -1
- package/dist/cdn/{P2KZWRWN.js → EJMVNGAI.js} +1 -1
- package/dist/cdn/{NUVU3DRE.js → EPD2C2K7.js} +1 -1
- package/dist/cdn/{U534CXBC.js → ESKLBLMV.js} +1 -1
- package/dist/cdn/{LKFUGB5Y.js → F2NSKPVZ.js} +1 -1
- package/dist/cdn/{7T5E62EB.js → F2OBLYH7.js} +1 -1
- package/dist/cdn/{WMPXRSVG.js → FFS2ZTO4.js} +1 -1
- package/dist/cdn/{RQX5LLKR.js → FLG2UTDC.js} +1 -1
- package/dist/cdn/{XXFXWEUM.js → FUKH2O6R.js} +1 -1
- package/dist/cdn/{RREWMLUG.js → FWUPKEH3.js} +1 -1
- package/dist/cdn/{FI2KPE6Y.js → G5I6PJTI.js} +1 -1
- package/dist/cdn/{ZM6YNS7A.js → GB3FHVRL.js} +1 -1
- package/dist/cdn/{YR2LVODN.js → GCSVWPU2.js} +1 -1
- package/dist/cdn/{FM3FDU5H.js → GSA5CCBN.js} +1 -1
- package/dist/cdn/{QBV3CQO5.js → H4UO4EY7.js} +1 -1
- package/dist/cdn/{KCXNV2XO.js → H6DCVC4A.js} +1 -1
- package/dist/cdn/{KWP4QLI5.js → HAAAMOHP.js} +1 -1
- package/dist/cdn/{YTNP7SOS.js → HPEU4B27.js} +1 -1
- package/dist/cdn/{APWEZLG3.js → HZ47NZ5I.js} +1 -1
- package/dist/cdn/{4AVRFINJ.js → IDZ6OOEJ.js} +1 -1
- package/dist/cdn/{PNXHGJTT.js → IFSBFJEB.js} +1 -1
- package/dist/cdn/{VQQRWFSV.js → IH4VALNR.js} +1 -1
- package/dist/cdn/{MPSV2BAE.js → IU4LH2EI.js} +1 -1
- package/dist/cdn/{7PT2PLLU.js → IYAIM36W.js} +1 -1
- package/dist/cdn/{VVDH4RRG.js → J26SEIMS.js} +1 -1
- package/dist/cdn/{7GYCEA6I.js → J6ADAIFM.js} +1 -1
- package/dist/cdn/{MTUR5KVA.js → J6QY44CB.js} +1 -1
- package/dist/cdn/{WCFCSBZZ.js → JF6NNJ2H.js} +1 -1
- package/dist/cdn/{Q6DIAGOG.js → K4ZXAI7Q.js} +1 -1
- package/dist/cdn/{TM6VKGIF.js → K5HONYT7.js} +1 -1
- package/dist/cdn/{PYVPUWXL.js → KICCIBDU.js} +1 -1
- package/dist/cdn/{FYFLIY5F.js → KUU3SZNI.js} +1 -1
- package/dist/cdn/{WPUVD3LY.js → LJZBPFJW.js} +1 -1
- package/dist/cdn/M2QUNSYM.js +2 -0
- package/dist/cdn/{65UTKOA3.js → MCBEDE75.js} +1 -1
- package/dist/cdn/{U2BGLMRN.js → MEJ7Z55Y.js} +1 -1
- package/dist/cdn/{RZJHK5IF.js → MEWONBVK.js} +1 -1
- package/dist/cdn/{BK3GYM6T.js → MHBD6JKB.js} +1 -1
- package/dist/cdn/{LBUII3SU.js → MOX5KKFM.js} +1 -1
- package/dist/cdn/{2IAN57J2.js → MY3QCOF3.js} +1 -1
- package/dist/cdn/{UKE7DTAT.js → NBQB4NAC.js} +1 -1
- package/dist/cdn/{IHFYE47F.js → NPFRTZB6.js} +1 -1
- package/dist/cdn/{Q76UGDKE.js → OBRGCK53.js} +1 -1
- package/dist/cdn/{ESFZBYY3.js → ODPSLS22.js} +1 -1
- package/dist/cdn/{7NMG5H4P.js → OK4CVJE4.js} +1 -1
- package/dist/cdn/{K5XTTYKP.js → OZ7R5GYX.js} +1 -1
- package/dist/cdn/{IPTV7N7T.js → P6P3IUDR.js} +1 -1
- package/dist/cdn/{KOOIIFT3.js → PA2Q2BOY.js} +1 -1
- package/dist/cdn/{KQX6VM7O.js → PHCOEL3J.js} +1 -1
- package/dist/cdn/{QGC7E3BR.js → PHZC6F76.js} +1 -1
- package/dist/cdn/{4JC5TZ3Z.js → PWT456O7.js} +1 -1
- package/dist/cdn/{ZSMIPNAG.js → QRF7Y5RK.js} +1 -1
- package/dist/cdn/{FRWZPYTX.js → RCZ6HFKZ.js} +1 -1
- package/dist/cdn/{2ZXF3D2D.js → RE3Y2ESK.js} +1 -1
- package/dist/cdn/{NRBNTS6J.js → RGXC7JFO.js} +1 -1
- package/dist/cdn/{VIF7Z5AH.js → RPDJ7EIE.js} +1 -1
- package/dist/cdn/{5S5JXJOB.js → RRO5VD55.js} +1 -1
- package/dist/cdn/{Q7DNN57U.js → RSKIOQCL.js} +1 -1
- package/dist/cdn/{XD6AG6ZT.js → RWHMOWQZ.js} +1 -1
- package/dist/cdn/{M246BFWD.js → RYDTB44Z.js} +1 -1
- package/dist/cdn/{3EL57DDZ.js → RZPGLMMW.js} +1 -1
- package/dist/cdn/{GM6XTLWL.js → S5WB5SEU.js} +1 -1
- package/dist/cdn/{3SCP4V5E.js → SMJIJPMO.js} +1 -1
- package/dist/cdn/{RYS2PNK3.js → SORYFFH7.js} +1 -1
- package/dist/cdn/{DGEJHLW2.js → SSJ6DR6D.js} +1 -1
- package/dist/cdn/{OBB6PCHY.js → SSMNJ3E6.js} +1 -1
- package/dist/cdn/{EQCJM75B.js → SY5MWRX6.js} +1 -1
- package/dist/cdn/{SZLCXXTB.js → T62DWGVX.js} +1 -1
- package/dist/cdn/{PO5DDLO6.js → TEYFJWN6.js} +1 -1
- package/dist/cdn/{QWIKNKUT.js → TFVX54SE.js} +1 -1
- package/dist/cdn/{RFIPWUD6.js → TG64ICYO.js} +1 -1
- package/dist/cdn/{L4Q6V2DH.js → TID4DX3H.js} +1 -1
- package/dist/cdn/{OSKMJOXK.js → TXDS4BGU.js} +1 -1
- package/dist/cdn/{6VXKWJJQ.js → U4J3D4Y5.js} +1 -1
- package/dist/cdn/{VHIVFZBX.js → UIXWWLZ5.js} +1 -1
- package/dist/cdn/{L5HWKCE7.js → UNH2DAW7.js} +1 -1
- package/dist/cdn/{53666KUD.js → UUDYIXV5.js} +1 -1
- package/dist/cdn/{OGC3IVKF.js → V2C6WWEY.js} +1 -1
- package/dist/cdn/{76IXH3H7.js → V545IELK.js} +1 -1
- package/dist/cdn/{STSKIVNN.js → V5SCAKNV.js} +1 -1
- package/dist/cdn/{DRBKQFDL.js → VIT3SQS7.js} +1 -1
- package/dist/cdn/{DNEX3LYK.js → VQEY6ANK.js} +1 -1
- package/dist/cdn/{7ZZPRASC.js → VRDWEY3X.js} +1 -1
- package/dist/cdn/{2V6S7P7F.js → VZOC62NV.js} +1 -1
- package/dist/cdn/{UKD5HP5S.js → WISFG45I.js} +1 -1
- package/dist/cdn/{HNFKIINJ.js → WRG7DNGH.js} +1 -1
- package/dist/cdn/{VQP7LS46.js → WXADOXTY.js} +1 -1
- package/dist/cdn/{3KVZA2OL.js → XAQ4DNLM.js} +1 -1
- package/dist/cdn/{SDE5ZWGN.js → XEPAXCTL.js} +1 -1
- package/dist/cdn/{6WMXB6PK.js → XIOY3P7T.js} +1 -1
- package/dist/cdn/{EGLWFHKF.js → XLPUHS7L.js} +1 -1
- package/dist/cdn/{TZAZICAJ.js → Y7XRTW6L.js} +1 -1
- package/dist/cdn/{RMBOOK2R.js → YIB6PNXV.js} +1 -1
- package/dist/cdn/{TJ6VME7P.js → YM3D3J4E.js} +1 -1
- package/dist/cdn/{B2UALB33.js → YX3TKXSH.js} +1 -1
- package/dist/cdn/{C7CJCL4V.js → Z2TXGQRP.js} +1 -1
- package/dist/cdn/{7C5LJNIE.js → ZCP73LZV.js} +1 -1
- package/dist/cdn/{3O7KU7T7.js → ZCVWWRLL.js} +1 -1
- package/dist/cdn/{WPQTDMEI.js → ZI4XEZDP.js} +1 -1
- package/dist/cdn/{D4JZRKDG.js → ZSHJDKC5.js} +1 -1
- package/dist/cdn/{DY764JG5.js → ZZBNZSSD.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +4 -4
- package/dist/components/calcite-color-picker-hex-input/customElement.d.ts +1 -1
- package/dist/components/calcite-color-picker-swatch/customElement.d.ts +1 -1
- package/dist/components/calcite-handle/customElement.d.ts +1 -1
- package/dist/components/calcite-icon/types.d.ts +1 -2
- package/dist/components/calcite-link/customElement.js +4 -3
- package/dist/components/calcite-sortable-list/customElement.d.ts +1 -1
- package/dist/components/calcite-tile/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +3 -3
- package/dist/cdn/QQL3RSXG.js +0 -2
- package/dist/cdn/X3HJK5QH.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as r}from"./
|
|
2
|
+
import{a as r}from"./MOX5KKFM.js";import{a as t,b as n,c as b}from"./B5TGMHUH.js";import{a as g}from"./QRF7Y5RK.js";import{a as f}from"./T6CCMW7H.js";import"./VUYX7MNO.js";import{a as v}from"./ZWPNZ5XW.js";import"./Z2TXGQRP.js";import{E as u,F as i,R as m,g as h,h as o,p as l}from"./4HSQ3OW6.js";var x=h`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);--calcite-internal-autocomplete-item-spacing-unit-l: .5rem;--calcite-internal-autocomplete-item-spacing-unit-s: .25rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size-xs)}.scale--m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);--calcite-internal-autocomplete-item-spacing-unit-l: .75rem;--calcite-internal-autocomplete-item-spacing-unit-s: .375rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size-sm)}.scale--l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);--calcite-internal-autocomplete-item-spacing-unit-l: 1rem;--calcite-internal-autocomplete-item-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size)}:host{display:flex}.container{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;outline-color:transparent;background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-1));color:var(--calcite-autocomplete-text-color, var(--calcite-color-text-3));gap:var(--calcite-internal-autocomplete-item-spacing-unit-l);padding-inline:var(--calcite-internal-autocomplete-item-spacing-unit-l);padding-block:var(--calcite-internal-autocomplete-item-spacing-unit-s);overflow-wrap:break-word;word-break:break-word;justify-content:space-around}.description{color:var(--calcite-autocomplete-description-text-color);font-size:var(--calcite-internal-autocomplete-item-description-font-size)}.heading{color:var(--calcite-autocomplete-heading-text-color, var(--calcite-color-text-1))}.heading,.description{line-height:var(--calcite-font-line-height-relative-snug)}:host([selected]) .container{color:var(--calcite-color-text-1);background-color:var(--calcite-color-surface-highlight)}:host([selected]) .container .description{color:var(--calcite-autocomplete-description-text-color, var(--calcite-color-text-2))}:host([selected]) .heading{font-weight:var(--calcite-font-weight-medium)}:host(:hover:not([disabled])) .container{background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-2))}:host(:hover:not([disabled])) .container .description{color:var(--calcite-autocomplete-description-text-color, var(--calcite-color-text-2))}.container--active{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.content-center{display:flex;flex-direction:column;flex-grow:1;padding-block:0}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,s=class extends u{constructor(){super(...arguments),this.interactiveContainer=g(this),this.active=!1,this.disabled=!1,this.guid=b.host(f()),this.scale="m",this.selected=!1,this.calciteAutocompleteItemSelect=l({cancelable:!1}),this.calciteInternalAutocompleteItemChange=l({cancelable:!1})}static{this.properties={active:[5,{},{type:Boolean}],description:1,disabled:[7,{},{reflect:!0,type:Boolean}],guid:1,heading:1,iconEnd:[3,{},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{},{reflect:!0}],inputValueMatchPattern:[3,{},{reflect:!0}],label:1,scale:1,selected:[7,{},{reflect:!0,type:Boolean}],value:1}}static{this.styles=x}requestSelection(){this.calciteAutocompleteItemSelect.emit()}willUpdate(e){this.hasUpdated&&(e.has("description")||e.has("disabled")||e.has("heading")||e.has("label")||e.has("selected")||e.has("value"))&&this.calciteInternalAutocompleteItemChange.emit()}handleClick(e){e.preventDefault(),!this.disabled&&this.requestSelection()}render(){let{active:e,description:c,heading:a,disabled:d,inputValueMatchPattern:p}=this;return this.interactiveContainer({disabled:d,children:o`<div class=${i({[t.container]:!0,[t.containerActive]:e&&!d,[t.scale(this.scale)]:!0})} @click=${this.handleClick}>${this.renderIcon("start")}<slot name=${n.contentStart}></slot><div class=${i(t.contentCenter)}><div class=${i(t.heading)}>${r({text:a,pattern:p})}</div><div class=${i(t.description)}>${r({text:c,pattern:p})}</div></div><slot name=${n.contentEnd}></slot>${this.renderIcon("end")}</div>`})}renderIcon(e){let{iconFlipRtl:c}=this,a=e==="start"?this.iconStart:this.iconEnd;return a?o`<calcite-icon class=${i(e==="start"?t.iconStart:t.iconEnd)} .flipRtl=${c===e||c==="both"} .icon=${a} .scale=${v(this.scale)}></calcite-icon>`:null}};m("calcite-autocomplete-item",s);export{s as AutocompleteItem};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{d as r}from"./FCCATXLE.js";import{a as y}from"./
|
|
2
|
+
import{d as r}from"./FCCATXLE.js";import{a as y}from"./JF6NNJ2H.js";import"./VUYX7MNO.js";import{a as g}from"./G5I6PJTI.js";import"./ZWPNZ5XW.js";import{c}from"./Z2TXGQRP.js";import{C as n,p,y as d}from"./3QPETC2U.js";import{E as m,R as f,g as u,h}from"./4HSQ3OW6.js";var I=u`:host{display:flex;line-height:var(--calcite-font-line-height-fixed-lg)}ul{margin:0;display:inline-flex;block-size:100%;align-items:center;padding:0}:host([layout=vertical]) ul{display:flex;inline-size:100%;flex-direction:column}:host([hidden]){display:none}[hidden]{display:none}`,o=class extends m{constructor(){super(),this.attributeWatch=c(["role"],this.handleGlobalAttributesChanged),this.menuItems=[],this.messages=y(),this.focusSetter=g()(this),this.layout="horizontal",this.scale="m",this.listen("keydown",this.calciteInternalNavMenuItemKeyEvent)}static{this.properties={label:1,layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],scale:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=I}async setFocus(t){return this.focusSetter(()=>this.menuItems[0],t)}willUpdate(t){(t.has("layout")&&(this.hasUpdated||this.layout!=="horizontal")||t.has("scale")&&(this.hasUpdated||this.scale!=="m"))&&this.setMenuItemProperties(this.menuItems)}handleGlobalAttributesChanged(){this.requestUpdate(),this.setMenuItemProperties(this.menuItems)}calciteInternalNavMenuItemKeyEvent(t){if(t.defaultPrevented)return;let e=this.getMenuItemFromEvent(t);if(!e)return;let i=this.getSubmenuItems(e),a=i.length>0,l=t.key,s=!1;l==="ArrowDown"?e.layout==="vertical"?(n(this.menuItems,e,"next",!1,!1),s=!0):e.open&&a&&(i[0].setFocus(),s=!0):l==="ArrowUp"?e.layout==="vertical"?(n(this.menuItems,e,"previous",!1,!1),s=!0):e.open&&a&&(i[i.length-1].setFocus(),s=!0):l==="ArrowRight"?this.layout==="horizontal"?(n(this.menuItems,e,"next",!1,!1),s=!0):e.open&&a&&(i[0].setFocus(),s=!0):l==="ArrowLeft"?this.layout==="horizontal"?(n(this.menuItems,e,"previous",!1,!1),s=!0):r(e.parentElement)&&(this.focusParentElement(e),s=!0):l==="Escape"&&r(e.parentElement)&&(this.focusParentElement(e),s=!0),s&&t.preventDefault()}getMenuItemFromEvent(t){let e=t.composedPath().find(r);return e&&this.menuItems.includes(e)?e:void 0}getSubmenuItems(t){return Array.from(t.children).filter(r).filter(e=>e.matches('[slot="submenu-item"]'))}handleMenuSlotChange(t){this.menuItems=d(t),this.setMenuItemProperties(this.menuItems)}focusParentElement(t){let e=t.parentElement;e&&(p(e),e.open=!1)}setMenuItemProperties(t){t.forEach(e=>{e.layout=this.layout,e.scale=this.scale,this.getEffectiveRole()==="menubar"&&(e.isTopLevelItem=!0,e.topLevelMenuLayout=this.layout)})}getEffectiveRole(){return this.el.role||"menubar"}render(){return h`<ul .ariaLabel=${this.label} .role=${this.getEffectiveRole()}><slot @slotchange=${this.handleMenuSlotChange}></slot></ul>`}};f("calcite-menu",o);export{o as Menu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{d as I}from"./66ADBSUG.js";import{b as D}from"./7VTO7SRW.js";import"./VUYX7MNO.js";import{g as m,p as T,y as w}from"./3QPETC2U.js";import{E as A,I as C,R as M,g as S,h as b,p as E}from"./
|
|
2
|
+
import{d as I}from"./66ADBSUG.js";import{b as D}from"./7VTO7SRW.js";import"./VUYX7MNO.js";import{g as m,p as T,y as w}from"./3QPETC2U.js";import{E as A,I as C,R as M,g as S,h as b,p as E}from"./4HSQ3OW6.js";function k(g){return Array.from(g.querySelectorAll("calcite-tree-item:not([disabled])")).filter(e=>{let t=e;for(;t!==g&&t!==null;){let s=t.parentElement;if(!(!I(s)||!s.hasChildren||s.expanded))return!1;t=t.parentElement}return!0})}var O=S`:host{display:block}:host(:focus){outline:2px solid transparent;outline-offset:2px}:host([hidden]){display:none}[hidden]{display:none}`,y=class extends A{constructor(){super(),this.items=[],this.child=!1,this.lines=!1,this.parentExpanded=!1,this.scale="m",this.selectedItems=[],this.selectionMode="single",this.calciteTreeSelect=E({cancelable:!1}),this.listen("focus",this.onFocus),this.listen("focusin",this.onFocusIn),this.listen("focusout",this.onFocusOut),this.listen("calciteInternalTreeItemSelect",this.onInternalTreeItemSelect),this.listen("keydown",this.keyDownHandler)}static{this.properties={child:[7,{},{reflect:!0,type:Boolean}],lines:[7,{},{reflect:!0,type:Boolean}],parentExpanded:[5,{},{type:Boolean}],scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionMode:[3,{},{reflect:!0}]}}static{this.styles=O}willUpdate(e){e.has("parentExpanded")&&(this.hasUpdated||this.parentExpanded!==!1)&&this.updateItems();let t=this.el.parentElement?.closest("calcite-tree")??void 0;this.lines=t?t.lines:this.lines,this.scale=t?t.scale:this.scale,this.selectionMode=t?t.selectionMode:this.selectionMode,this.child=!!t}onFocus(){if(!this.child){let e=(this.el.querySelector("calcite-tree-item[selected]:not([disabled])")||this.el.querySelector("calcite-tree-item:not([disabled])"))??void 0;T(e,!0,"focusable")}}onFocusIn(e){(e.relatedTarget===this.el||!this.el.contains(e.relatedTarget))&&this.el.removeAttribute("tabindex")}onFocusOut(e){!this.el.contains(e.relatedTarget)&&(this.el.tabIndex=this.getRootTabIndex())}onInternalTreeItemSelect(e){if(this.child)return;let t=e.target,s=m(t.querySelectorAll("calcite-tree-item")),r=this.selectionMode==="none",n=r?[]:this.getSelectedItems();if(e.preventDefault(),e.stopPropagation(),this.selectionMode==="ancestors"){this.updateAncestorTree(e,n);return}let l=this.selectionMode!==null&&(!t.hasChildren||t.hasChildren&&(this.selectionMode==="children"||this.selectionMode==="multichildren")),c=this.selectionMode==="multichildren"&&t.hasChildren,d=!r&&e.detail.modifyCurrentSelection&&(this.selectionMode==="multiple"||this.selectionMode==="multichildren"),x=!d&&((this.selectionMode==="single"||this.selectionMode==="multiple")&&s.length<=0||this.selectionMode==="children"||this.selectionMode==="multichildren"||this.selectionMode==="single-persist"&&!t.hasChildren),h=["multiple","none","single","single-persist"].includes(this.selectionMode)&&t.hasChildren,a=[];l&&a.push(t),x&&m(this.el.querySelectorAll("calcite-tree-item[selected]")).forEach(o=>{a.includes(o)||(o.selected=!1)}),h&&["multiple","none","single","single-persist"].includes(this.selectionMode)&&(t.expanded=!t.expanded),c&&s.forEach(i=>{i.selected=!1,i.hasChildren&&(i.expanded=!1)}),d&&window.getSelection().removeAllRanges(),d&&t.selected?a.forEach(i=>{i.disabled||(i.selected=!1)}):r||a.forEach(i=>{i.disabled||(i.selected=this.selectionMode!=="single"||!i.selected)}),this.selectedItems=r?[]:this.getSelectedItems(),this.selectionChanged(n)&&this.calciteTreeSelect.emit(),e.stopPropagation()}keyDownHandler(e){if(this.child)return;let t=this.el,s=e.target,r=["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End","Tab"];if(!(I(s)&&this.el.contains(s))||!r.includes(e.key))return;let n=k(t);if(e.key==="Tab"){n.forEach(l=>l.tabIndex=-1);return}if(e.key==="ArrowDown"){let l=n.indexOf(s);n[l+1]?.focus(),e.preventDefault();return}if(e.key==="ArrowUp"){let l=n.indexOf(s);n[l-1]?.focus(),e.preventDefault();return}if(e.key==="ArrowLeft"){if(s.hasChildren&&s.expanded){s.expanded=!1,e.preventDefault();return}n.slice(0,n.indexOf(s)).reverse().find(d=>d.depth===s.depth-1)?.focus(),e.preventDefault();return}if(e.key==="ArrowRight"){if(!s.disabled&&s.hasChildren)if(!s.expanded)s.expanded=!0,e.preventDefault();else{let l=n.indexOf(s);n[l+1]?.focus(),e.preventDefault()}return}if(e.key==="Home"){let l=n.shift();l&&(l.focus(),e.preventDefault());return}if(e.key==="End"){let l=n.pop();l&&(l.focus(),e.preventDefault());return}}updateAncestorTree(e,t){let s=e.target,r=e.detail.updateItem;if(s.disabled||s.indeterminate&&!r)return;let n=[],l=s.parentElement.closest("calcite-tree-item");for(;l;)n.push(l),l=l.parentElement.closest("calcite-tree-item");let c=Array.from(s.querySelectorAll("calcite-tree-item:not([disabled])")),d=c.filter(i=>!i.hasChildren),x=c.filter(i=>i.hasChildren),h;r?h=s.hasChildren?!(s.selected||s.indeterminate):!s.selected:h=s.selected,d.forEach(i=>{i.selected=h,i.indeterminate=!1});function a(i,o){let u=i.filter(f=>f.selected),p=i.filter(f=>!f.selected);o.selected=u.length===i.length,o.indeterminate=u.length>0&&p.length>0}x.reverse().forEach(i=>{let o=Array.from(i.querySelectorAll(":scope > calcite-tree > calcite-tree-item"));a(o,i)}),r&&(s.hasChildren?a(c,s):(s.selected=h,s.indeterminate=!1)),n.forEach(i=>{let o=m(i.querySelectorAll("calcite-tree-item")),u=o.filter(f=>f.selected);if(u.length===0){i.selected=!1,i.indeterminate=!1;return}let p=u.length<o.length;i.indeterminate=p,i.selected=!p}),this.selectedItems=this.getSelectedItems(),r&&this.selectionChanged(t)&&this.calciteTreeSelect.emit()}getSelectedItems(){return m(this.el.querySelectorAll("calcite-tree-item")).filter(e=>e.selected)}selectionChanged(e){return e.length!==this.selectedItems.length||this.selectedItems.some(t=>!e.includes(t))}updateItems(){this.items.forEach(e=>e.parentExpanded=this.parentExpanded)}handleDefaultSlotChange(e){let t=w(e).filter(I);this.items=t,this.updateItems()}getRootTabIndex(){return this.child?-1:0}render(){let e=!this.child,t=this.selectionMode==="multiple"||this.selectionMode==="multichildren";return this.el.ariaMultiSelectable=D(e&&t,e?"false":null),this.el.role=this.child?null:"tree",C(this.el,"tabIndex",this.getRootTabIndex()),b`<slot @slotchange=${this.handleDefaultSlotChange}></slot>`}};M("calcite-tree",y);export{y as Tree};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a,e as d}from"./F4JFQNV4.js";import{a as r}from"./
|
|
2
|
+
import{a,e as d}from"./F4JFQNV4.js";import{a as r}from"./QRF7Y5RK.js";import"./VUYX7MNO.js";import"./Z2TXGQRP.js";import{E as n,F as i,R as o,g as c,h as s,p as t}from"./4HSQ3OW6.js";var g=c`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column}:host([filter-hidden]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{margin:0;display:flex;flex:1 1 0%;position:sticky;inset-block-start:var(--calcite-internal-filter-enabled-offset, 0);z-index:var(--calcite-z-index-sticky);background-color:var(--calcite-list-background-color, var(--calcite-color-foreground-1));color:var(--calcite-list-color, var(--calcite-color-text-1))}.heading{font-weight:var(--calcite-font-weight-bold)}:host([scale=s]) .container{padding-inline:var(--calcite-spacing-sm)}:host([scale=s]) .heading{font-size:var(--calcite-font-size-sm);line-height:var(--calcite-font-line-height-fixed-base);padding-block:var(--calcite-spacing-sm) var(--calcite-spacing-xxs)}:host([scale=s]:not(:first-child)) .container{padding-block-start:var(--calcite-spacing-sm)}:host([scale=m]) .container{padding-inline:var(--calcite-spacing-md)}:host([scale=m]) .heading{font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-fixed-base);padding-block:var(--calcite-spacing-lg) var(--calcite-spacing-sm)}:host([scale=m]:not(:first-child)) .container{padding-block-start:var(--calcite-spacing-md)}:host([scale=l]) .container{padding-inline:var(--calcite-spacing-lg)}:host([scale=l]) .heading{font-size:var(--calcite-font-size-md);line-height:var(--calcite-font-line-height-fixed-lg);padding-block:var(--calcite-spacing-xl) var(--calcite-spacing-sm-plus, .625rem)}:host([scale=l]:not(:first-child)) .container{padding-block-start:var(--calcite-spacing-md-plus, .875rem)}.heading{padding:0}:host([hidden]){display:none}[hidden]{display:none}`,l=class extends n{constructor(){super(...arguments),this.interactiveContainer=r(this),this.disabled=!1,this.filterHidden=!1,this.scale="m",this.calciteInternalListItemGroupDefaultSlotChange=t({cancelable:!1}),this.calciteInternalListItemGroupChange=t({cancelable:!1})}static{this.properties={disabled:[7,{},{reflect:!0,type:Boolean}],filterHidden:[7,{},{reflect:!0,type:Boolean}],heading:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}]}}static{this.styles=g}willUpdate(e){e.has("heading")&&this.calciteInternalListItemGroupChange.emit()}handleDefaultSlotChange(){this.calciteInternalListItemGroupDefaultSlotChange.emit()}render(){let{disabled:e,heading:h}=this;return this.interactiveContainer({disabled:e,children:s`<div class=${i(a.container)} role=row><div .ariaColSpan=${d} class=${i(a.heading)} role=cell>${h}</div></div><slot @slotchange=${this.handleDefaultSlotChange}></slot>`})}};o("calcite-list-item-group",l);export{l as ListItemGroup};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as g}from"./VI7SBYXT.js";import{a as v}from"./
|
|
2
|
+
import{a as g}from"./VI7SBYXT.js";import{a as v}from"./G5I6PJTI.js";import"./ZWPNZ5XW.js";import"./Z2TXGQRP.js";import{E as b,z as w}from"./3QPETC2U.js";import{C as r,D as o,E as h,F as u,R as p,g as m,h as f}from"./4HSQ3OW6.js";var c={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},I={item:"calcite-flow-item"},x=m`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0;animation-name:none;animation-duration:var(--calcite-animation-timing);background-color:var(--calcite-flow-background-color)}:host ::slotted(*){display:none;block-size:100%}:host ::slotted(*[selected]){display:flex}:host .frame--advancing{animation-name:calcite-frame-advance}:host .frame--retreating{animation-name:calcite-frame-retreat}@keyframes calcite-frame-advance{0%{--tw-bg-opacity: .5;transform:translate3d(50px,0,0)}to{--tw-bg-opacity: 1;transform:translateZ(0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity: .5;transform:translate3d(-50px,0,0)}to{--tw-bg-opacity: 1;transform:translateZ(0)}}:host([hidden]){display:none}[hidden]{display:none}`;function y(a){return a?`${I.item},${a}`:I.item}var l=class extends h{constructor(){super(),this.frameRef=r(),this.defaultSlotRef=r(),this.itemMutationObserver=g("mutation",()=>this.updateItemsAndProps()),this.items=[],this.selectedIndex=-1,this.focusSetter=v()(this),this.flowDirection="standby",this.listen("calciteInternalFlowItemChange",this.handleCalciteInternalFlowItemChange),this.listen("calciteFlowItemBack",this.handleItemBackClick)}static{this.properties={flowDirection:[16,{},{state:!0}],customItemSelectors:1}}static{this.styles=x}async back(){let{items:e,selectedIndex:i}=this,t=e[i],s=e[i-1];if(!t||!s)return;let n=t.beforeBack?t.beforeBack:()=>Promise.resolve();try{await n.call(t)}catch{return}return t.selected=!1,s.selected=!0,s}async setFocus(e){return this.focusSetter(()=>this.items[this.selectedIndex],e)}connectedCallback(){super.connectedCallback(),this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0})}willUpdate(e){e.has("flowDirection")&&(this.hasUpdated||this.flowDirection!=="standby")&&this.handleFlowDirectionChange(this.flowDirection)}loaded(){this.updateItemsAndProps()}disconnectedCallback(){super.disconnectedCallback(),this.itemMutationObserver?.disconnect()}async handleFlowDirectionChange(e){e==="standby"||!this.frameRef.value||(await b(this.frameRef.value,e==="retreating"?"calcite-frame-retreat":"calcite-frame-advance"),this.resetFlowDirection())}handleCalciteInternalFlowItemChange(e){e.stopPropagation(),this.updateFlowProps()}async handleItemBackClick(e){if(!e.defaultPrevented)return await this.back(),this.setFocus()}resetFlowDirection(){this.flowDirection="standby"}getFlowDirection(e,i){let t=e>0;return!(e>-1&&i>0)&&!t?"standby":i<e?"retreating":"advancing"}updateItemsAndProps(){let e=y(this.customItemSelectors),i=this.defaultSlotRef.value?w(this.defaultSlotRef.value,e):[];this.items=i,this.ensureSelectedFlowItemExists(),this.updateFlowProps()}updateFlowProps(){let{selectedIndex:e,items:i}=this,t=this.findSelectedFlowItemIndex(i);i.forEach((s,n)=>{let d=n===t;d||(s.menuOpen=!1),s.showBackButton=d&&t>0}),t!==-1&&(e!==t&&(this.flowDirection=this.getFlowDirection(e,t)),this.selectedIndex=t)}findSelectedFlowItemIndex(e){let i=e.slice(0).reverse().find(t=>!!t.selected);return i?e.indexOf(i):-1}ensureSelectedFlowItemExists(){let{items:e}=this;if(this.findSelectedFlowItemIndex(e)!==-1)return;let t=e[e.length-1];t&&(t.selected=!0)}render(){let{flowDirection:e}=this,i={[c.frame]:!0,[c.frameAdvancing]:e==="advancing",[c.frameRetreating]:e==="retreating"};return f`<div class=${u(i)} ${o(this.frameRef)}><slot @slotchange=${this.updateItemsAndProps} ${o(this.defaultSlotRef)}></slot></div>`}};p("calcite-flow",l);export{l as Flow};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as b,b as z}from"./SZUPQ4CX.js";import{a as ot}from"./D43JETDJ.js";import{a as et}from"./VXDPJESZ.js";import{a as it,c as at}from"./XD6AG6ZT.js";import{a as J}from"./VI7SBYXT.js";import{a as tt}from"./WCFCSBZZ.js";import{b as nt}from"./JL43QOWW.js";import{a as S,d as p}from"./24ZPXFO2.js";import{c as H,e as v}from"./XX43OXTK.js";import{c as P}from"./77M5NVCW.js";import"./VUYX7MNO.js";import{a as _}from"./FI2KPE6Y.js";import"./ZWPNZ5XW.js";import{e as X}from"./C7CJCL4V.js";import{C as G,H as h,r as F,y as Y,z as Z}from"./3QPETC2U.js";import{C as f,D as y,E as j,F as E,L as K,O as W,R as Q,g as V,h as A,l as N,p as k}from"./3QK4UKRU.js";var dt=({bufferSize:l=0,containerSize:t,itemSizes:e})=>{let i=t-l,a=e.length,r=0;for(let[n,o]of e.entries())if(r=r+o,r>i){a=n;break}else continue;return a},ht=({bufferSize:l=0,containerSize:t,itemSizes:e})=>Math.max(e.length-dt({bufferSize:l,itemSizes:e,containerSize:t}),0),pt=l=>l.flatMap(t=>p(t)?t.actions:v(t)?t.actions.filter(e=>e.slot===H.trigger):t).filter(t=>!!t),ut=({item:l,containerRect:t,horizontal:e,rtl:i})=>{let a=l.getBoundingClientRect();return e?a.top-t.top:i?t.right-a.right:a.left-t.left},gt=({actionGroups:l,expanded:t,overflowCount:e})=>{let i=e;[...l].reverse().forEach(a=>{let r=0,n=a.actions.filter(o=>o.parentElement===a).reverse();n.forEach(o=>{o.slot===S.menuActions&&(o.removeAttribute("slot"),o.textEnabled=t)}),i>0&&!a.overflowActionsDisabled&&n.some(o=>(n.filter(c=>!c.slot).length>1&&n.length>2&&!o.closest("calcite-action-menu")&&!o.overflowDisabled&&(o.textEnabled=!0,o.setAttribute("slot",S.menuActions),r++,r>1&&i--),i<1)),a.manager.component.requestUpdate()})},ft=V`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([scale=s]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-spacing-xxs));--calcite-internal-action-bar-padding: var(--calcite-spacing-xxs)}:host([scale=m]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-spacing-sm));--calcite-internal-action-bar-padding: 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-spacing-sm-plus)}:host{display:inline-flex;align-self:stretch;background:transparent;--calcite-internal-action-group-dividing-border-margin: calc(var(--calcite-spacing-base) + 1px)}.container{display:inline-flex;flex:1 1 auto;flex-direction:column;background-color:var(--calcite-action-bar-background-color, var(--calcite-color-foreground-1));gap:var(--calcite-internal-action-bar-gap);padding:var(--calcite-internal-action-bar-padding)}@keyframes in{0%{opacity:0}to{opacity:1}}: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-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}`,U=class extends j{constructor(){super(),this.actions=[],this.containerRef=f(),this.defaultSlotRef=f(),this.actionsStartSlotRef=f(),this.actionsEndSlotRef=f(),this.actionsStartGroupRef=f(),this.actionsEndGroupRef=f(),this.direction=X(),this.defaultSlotItems=[],this.actionGroups=[],this.actionMenus=[],this.actionsStart=[],this.actionsStartGroups=[],this.actionsEnd=[],this.actionsEndGroups=[],this.overflowPassId=0,this.suppressedActionGroupActionsChange=new WeakMap,this.cancelable=ot()(this),this.resize=et(({width:t,height:e})=>{let{expanded:i,expandToggleDisabled:a,layout:r,expandPosition:n}=this;if(!this.containerRef.value)return;if(this.usesWrap){this.scheduleLineMeasure();return}if(this.overflowMode!=="collapse"||r==="vertical"&&!e||r==="horizontal"&&!t)return;this.updateGroups();let o=this.getItemSizes(),{actionGroups:s,actionsEnd:c,actionsEndGroups:d,actionsStart:T,actionsStartGroups:D,defaultSlotItems:I}=this,m=[...D,...s,...d],O=this.hasActionsEnd||!a&&n==="end"?1:0,M=this.hasActionsStart||!a&&n==="start"?1:0,R=I.length+O+M,u=R,w=getComputedStyle(this.containerRef.value);if(u+=h(r==="horizontal"?w.paddingInlineStart:w.paddingBlockStart)+h(r==="horizontal"?w.paddingInlineEnd:w.paddingBlockEnd),m.length>0){let C=m.length-1;m.forEach((x,$)=>{let g=getComputedStyle(x),B=h(g.gap),L=this.getVisibleActionGroupItemCount(x),lt=Math.max(L-1,0);u+=B*lt,$!==C&&(u+=h(r==="horizontal"?g.paddingInlineEnd:g.paddingBlockEnd),u+=h(r==="horizontal"?g.borderInlineEndWidth:g.borderBlockEndWidth))})}let q=(C,x,$)=>{if(!x||C.length<1)return;let g=getComputedStyle(x),B=h(g.gap),L=C.length+($?1:0);u+=B*Math.max(L-1,0)},rt=!a&&n==="start",st=!a&&n==="end";q(T,this.actionsStartGroupRef.value,rt),q(c,this.actionsEndGroupRef.value,st),R>1&&(u+=h(w.gap)*(R-1));let ct=ht({bufferSize:u,containerSize:r==="horizontal"?t:e,itemSizes:o});this.runOverflowActions({actionGroups:m,expanded:i,overflowCount:ct})},K.resize),this.resizeHandler=t=>{if(this.usesWrap){this.scheduleLineMeasure();return}let{width:e,height:i}=t.contentRect;this.resize({width:e,height:i})},this.resizeObserver=J("resize",t=>this.resizeHandlerEntries(t)),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.messages=tt({blocking:!0}),this.focusSetter=_()(this),this.setExpandToggleEl=t=>{this.expandToggleEl=t},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=k({cancelable:!1}),this.calciteActionBarExpand=k({cancelable:!1}),this.calciteActionBarToggle=k({cancelable:!1}),this.listen("calciteActionMenuOpen",this.actionMenuOpenHandler),this.listen("calciteInternalActionGroupActionsChange",this.handleActionGroupActionsChange),this.listen("calciteInternalActionMenuActionsChange",this.handleActionMenuActionsChange),this.listen("keydown",this.handleKeyDown)}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}],expandDisabled:[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=ft}get expandDisabled(){return this.expandToggleDisabled}set expandDisabled(t){W.deprecated("property",{component:this,name:"expandDisabled",removalVersion:6,suggested:"expandToggleDisabled"}),this.expandToggleDisabled=t}get overflowActionsDisabled(){return this.overflowMode==="none"}set overflowActionsDisabled(t){W.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.overflowModeHandler(),this.cancelable.add(this.resize)}willUpdate(t){(t.has("expandDisabled")&&(this.hasUpdated||this.expandDisabled!==!1)||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("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()}loaded(){this.syncDefaultSlot(),this.syncActionsStartSlot(),this.syncActionsEndSlot(),this.syncActionsState(),this.overflowActions()}updated(){this.usesWrap&&this.lineMeasureFrame==null&&this.scheduleLineMeasure()}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",a=this.actions.map(o=>o[i]||0);this.getTrackedActionGroups().flatMap(o=>F(o,"calcite-action-menu")).forEach(o=>{let s=o.actions.find(c=>c.slot===H.trigger);a.push((s??o)[i]||0)}),e&&a.push(e[i]||0);let n=Math.max(...a,0);return a.map(o=>o||n)}getVisibleActionGroupItemCount(t){let e=t.actions.filter(n=>n.parentElement===t),i=F(t,"calcite-action-menu").length,a=e.filter(n=>n.slot!==S.menuActions).length+i,r=e.some(n=>n.slot===S.menuActions);return a+(r?1:0)}expandedHandler(){this.syncActionsState(!0),this.overflowActions()}overflowModeHandler(){this.overflowMode==="none"?this.resizeObserver?.disconnect():this.resizeObserver?.observe(this.el),this.overflowActions()}actionMenuOpenHandler(t){let e=t.composedPath(),i=e.find(a=>p(a)||v(a));i&&(p(i)&&!i.menuOpen||v(i)&&!i.open||(this.getTrackedActionGroups().forEach(a=>{e.includes(a)||(a.menuOpen=!1)}),this.getTrackedActionMenus().forEach(a=>{e.includes(a)||(a.open=!1)})))}runOverflowActions({actionGroups:t,expanded:e,overflowCount:i}){let a=++this.overflowPassId,r=new Map;t.forEach(n=>{let o=n.actions.filter(s=>s.parentElement===n);r.set(n,o.map(s=>s.slot??"").join("|"))}),gt({actionGroups:t,expanded:e,overflowCount:i}),t.forEach(n=>{let s=n.actions.filter(c=>c.parentElement===n).map(c=>c.slot??"").join("|");r.get(n)!==s&&(this.suppressedActionGroupActionsChange.set(n,a),this.queueSuppressedActionGroupActionsChangeCleanup(n,a))})}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})}get usesWrap(){return this.overflowMode==="wrap"&&this.layout!=="grid"}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(a=>{a.hidden||t.push(a)});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",a=t.getBoundingClientRect(),r=this.getWrapItems(),n=[],o=null;r.forEach(c=>{let d=ut({item:c,containerRect:a,horizontal:e,rtl:i});o!==null&&Math.abs(d-o)>1&&n.push(d),o=d}),(n.length!==this.lineOffsets.length||n.some((c,d)=>c!==this.lineOffsets[d]))&&(this.lineOffsets=n)}handleDefaultSlotChange(){this.syncSlotAndActions(()=>this.syncDefaultSlot()),this.usesWrap&&this.scheduleLineMeasure()}handleActionsEndSlotChange(){this.syncSlotAndActions(()=>this.syncActionsEndSlot())}handleActionsStartSlotChange(){this.syncSlotAndActions(()=>this.syncActionsStartSlot())}handleTooltipSlotChange(t){let e=Y(t).filter(nt);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})}syncActions(){this.actions=pt([...this.actionsStart,...this.defaultSlotItems,...this.actionsEnd])}syncActionsAndOverflow(){this.syncActionsState(),this.overflowActions()}syncSlotAndActions(t){t(),this.syncActionsAndOverflow()}syncActionsState(t=!1){this.syncActions(),this.updateActions(),t&&it({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=>v(t))}getAssignedActionBarItems(t){return t?Z(t).filter(e=>P(e)||p(e)||v(e)):[]}syncDefaultSlot(){this.defaultSlotItems=this.getAssignedActionBarItems(this.defaultSlotRef.value),this.actionGroups=this.defaultSlotItems.filter(t=>p(t)),this.actionMenus=this.defaultSlotItems.filter(t=>v(t)),this.updateGroups()}syncActionsStartSlot(){this.actionsStart=this.getAssignedActionBarItems(this.actionsStartSlotRef.value),this.actionsStartGroups=this.actionsStart.filter(t=>p(t)),this.hasActionsStart=this.actionsStart.length>0,this.updateGroups()}syncActionsEndSlot(){this.actionsEnd=this.getAssignedActionBarItems(this.actionsEndSlotRef.value),this.actionsEndGroups=this.actionsEnd.filter(t=>p(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())}handleActionMenuActionsChange(t){let e=t.target;this.getTrackedActionMenus().includes(e)&&this.syncActionsAndOverflow()}getNavigableActions(){return this.actions.filter(t=>!t.disabled&&t.slot!==S.menuActions)}handleKeyDown(t){let e=this.getNavigableActions(),i=document.activeElement;if(!(!P(i)||!e.includes(i)))switch(t.key){case"ArrowRight":case"ArrowDown":G(e,i,"next",!0),t.preventDefault();break;case"ArrowLeft":case"ArrowUp":G(e,i,"previous",!0),t.preventDefault();break;case"Home":G(e,i,"first",!0),t.preventDefault();break;case"End":G(e,i,"last",!0),t.preventDefault();break;case"Tab":this.setActionTabIndexes(i);break}}setActionTabIndexes(t){this.actions.forEach(e=>{let i=!e.disabled&&e===t?0:-1;i===0?e.removeAttribute("tabindex"):e.tabIndex=i})}renderExpandTooltipSlot(){return A`<slot name=${z.expandTooltip} @slotchange=${this.handleTooltipSlotChange}></slot>`}renderExpandToggle(){let{el:t,expanded:e,toggleExpand:i,messages:a,position:r,scale:n}=this;return at({collapseLabel:a.collapseLabel,collapseText:a.collapse,direction:this.direction,el:t,expanded:e,expandLabel:a.expandLabel,expandText:a.expand,position:r,ref:this.setExpandToggleEl,scale:n,toggle:i,tooltip:this.expandTooltip})}renderActionsGroup(t){let{expandToggleDisabled:e,scale:i,layout:a,overlayPositioning:r,expandPosition:n}=this,o=t==="start",s=!e&&n===t,c=o?this.hasActionsStart:this.hasActionsEnd,d=o?z.actionsStart:z.actionsEnd,T=o?this.handleActionsStartSlotChange:this.handleActionsEndSlotChange,D=o?this.actionsStartGroupLabel:this.actionsEndGroupLabel,I=!s&&!c,m=o?this.actionsStartGroupRef:this.actionsEndGroupRef,O=o?this.actionsStartSlotRef:this.actionsEndSlotRef,M=s?this.renderExpandToggle():null;return A`<calcite-action-group class=${E({[b.actionGroupStart]:o,[b.actionGroupEnd]:!o})} .hidden=${I} .label=${D} .layout=${a} .overlayPositioning=${r} .scale=${i} ${y(m)}>${o?M:null}<slot name=${d??N} @slotchange=${T} ${y(O)}></slot>${s?this.renderExpandTooltipSlot():null}${o?null:M}</calcite-action-group>`}render(){let t=this.layout==="horizontal"?"horizontal":"vertical";return A`<div .ariaOrientation=${t} class=${E({[b.container]:!0,[b.hasActionGroups]:this.hasActionGroups})} role=toolbar ${y(this.containerRef)}>${this.renderActionsGroup("start")}<slot @slotchange=${this.handleDefaultSlotChange} ${y(this.defaultSlotRef)}></slot>${this.renderActionsGroup("end")}${this.usesWrap?A`<div aria-hidden=true class=${E(b.lineOverlay)}>${this.lineOffsets.map(e=>A`<div class=${E(b.line)} style=${`--calcite-internal-action-bar-line-offset: ${e}px`}></div>`)}</div>`:null}</div>`}};Q("calcite-action-bar",U);export{U as ActionBar};
|
|
2
|
+
import{a as b,b as z}from"./SZUPQ4CX.js";import{a as ot}from"./E3NB7TJ2.js";import{a as et}from"./VXDPJESZ.js";import{a as it,c as at}from"./RWHMOWQZ.js";import{a as J}from"./VI7SBYXT.js";import{a as tt}from"./JF6NNJ2H.js";import{b as nt}from"./JL43QOWW.js";import{a as S,d as p}from"./24ZPXFO2.js";import{c as H,e as v}from"./XX43OXTK.js";import{c as P}from"./77M5NVCW.js";import"./VUYX7MNO.js";import{a as _}from"./G5I6PJTI.js";import"./ZWPNZ5XW.js";import{e as X}from"./Z2TXGQRP.js";import{C as G,H as h,r as F,y as Y,z as Z}from"./3QPETC2U.js";import{C as f,D as y,E as j,F as E,L as K,O as W,R as Q,g as V,h as A,l as N,p as k}from"./4HSQ3OW6.js";var dt=({bufferSize:l=0,containerSize:t,itemSizes:e})=>{let i=t-l,a=e.length,r=0;for(let[n,o]of e.entries())if(r=r+o,r>i){a=n;break}else continue;return a},ht=({bufferSize:l=0,containerSize:t,itemSizes:e})=>Math.max(e.length-dt({bufferSize:l,itemSizes:e,containerSize:t}),0),pt=l=>l.flatMap(t=>p(t)?t.actions:v(t)?t.actions.filter(e=>e.slot===H.trigger):t).filter(t=>!!t),ut=({item:l,containerRect:t,horizontal:e,rtl:i})=>{let a=l.getBoundingClientRect();return e?a.top-t.top:i?t.right-a.right:a.left-t.left},gt=({actionGroups:l,expanded:t,overflowCount:e})=>{let i=e;[...l].reverse().forEach(a=>{let r=0,n=a.actions.filter(o=>o.parentElement===a).reverse();n.forEach(o=>{o.slot===S.menuActions&&(o.removeAttribute("slot"),o.textEnabled=t)}),i>0&&!a.overflowActionsDisabled&&n.some(o=>(n.filter(c=>!c.slot).length>1&&n.length>2&&!o.closest("calcite-action-menu")&&!o.overflowDisabled&&(o.textEnabled=!0,o.setAttribute("slot",S.menuActions),r++,r>1&&i--),i<1)),a.manager.component.requestUpdate()})},ft=V`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([scale=s]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-spacing-xxs));--calcite-internal-action-bar-padding: var(--calcite-spacing-xxs)}:host([scale=m]){--calcite-internal-action-bar-gap: var(--calcite-action-bar-items-space, var(--calcite-spacing-sm));--calcite-internal-action-bar-padding: 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-spacing-sm-plus)}:host{display:inline-flex;align-self:stretch;background:transparent;--calcite-internal-action-group-dividing-border-margin: calc(var(--calcite-spacing-base) + 1px)}.container{display:inline-flex;flex:1 1 auto;flex-direction:column;background-color:var(--calcite-action-bar-background-color, var(--calcite-color-foreground-1));gap:var(--calcite-internal-action-bar-gap);padding:var(--calcite-internal-action-bar-padding)}@keyframes in{0%{opacity:0}to{opacity:1}}: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-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}`,U=class extends j{constructor(){super(),this.actions=[],this.containerRef=f(),this.defaultSlotRef=f(),this.actionsStartSlotRef=f(),this.actionsEndSlotRef=f(),this.actionsStartGroupRef=f(),this.actionsEndGroupRef=f(),this.direction=X(),this.defaultSlotItems=[],this.actionGroups=[],this.actionMenus=[],this.actionsStart=[],this.actionsStartGroups=[],this.actionsEnd=[],this.actionsEndGroups=[],this.overflowPassId=0,this.suppressedActionGroupActionsChange=new WeakMap,this.cancelable=ot()(this),this.resize=et(({width:t,height:e})=>{let{expanded:i,expandToggleDisabled:a,layout:r,expandPosition:n}=this;if(!this.containerRef.value)return;if(this.usesWrap){this.scheduleLineMeasure();return}if(this.overflowMode!=="collapse"||r==="vertical"&&!e||r==="horizontal"&&!t)return;this.updateGroups();let o=this.getItemSizes(),{actionGroups:s,actionsEnd:c,actionsEndGroups:d,actionsStart:T,actionsStartGroups:D,defaultSlotItems:I}=this,m=[...D,...s,...d],O=this.hasActionsEnd||!a&&n==="end"?1:0,M=this.hasActionsStart||!a&&n==="start"?1:0,R=I.length+O+M,u=R,w=getComputedStyle(this.containerRef.value);if(u+=h(r==="horizontal"?w.paddingInlineStart:w.paddingBlockStart)+h(r==="horizontal"?w.paddingInlineEnd:w.paddingBlockEnd),m.length>0){let C=m.length-1;m.forEach((x,$)=>{let g=getComputedStyle(x),B=h(g.gap),L=this.getVisibleActionGroupItemCount(x),lt=Math.max(L-1,0);u+=B*lt,$!==C&&(u+=h(r==="horizontal"?g.paddingInlineEnd:g.paddingBlockEnd),u+=h(r==="horizontal"?g.borderInlineEndWidth:g.borderBlockEndWidth))})}let q=(C,x,$)=>{if(!x||C.length<1)return;let g=getComputedStyle(x),B=h(g.gap),L=C.length+($?1:0);u+=B*Math.max(L-1,0)},rt=!a&&n==="start",st=!a&&n==="end";q(T,this.actionsStartGroupRef.value,rt),q(c,this.actionsEndGroupRef.value,st),R>1&&(u+=h(w.gap)*(R-1));let ct=ht({bufferSize:u,containerSize:r==="horizontal"?t:e,itemSizes:o});this.runOverflowActions({actionGroups:m,expanded:i,overflowCount:ct})},K.resize),this.resizeHandler=t=>{if(this.usesWrap){this.scheduleLineMeasure();return}let{width:e,height:i}=t.contentRect;this.resize({width:e,height:i})},this.resizeObserver=J("resize",t=>this.resizeHandlerEntries(t)),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.messages=tt({blocking:!0}),this.focusSetter=_()(this),this.setExpandToggleEl=t=>{this.expandToggleEl=t},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=k({cancelable:!1}),this.calciteActionBarExpand=k({cancelable:!1}),this.calciteActionBarToggle=k({cancelable:!1}),this.listen("calciteActionMenuOpen",this.actionMenuOpenHandler),this.listen("calciteInternalActionGroupActionsChange",this.handleActionGroupActionsChange),this.listen("calciteInternalActionMenuActionsChange",this.handleActionMenuActionsChange),this.listen("keydown",this.handleKeyDown)}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}],expandDisabled:[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=ft}get expandDisabled(){return this.expandToggleDisabled}set expandDisabled(t){W.deprecated("property",{component:this,name:"expandDisabled",removalVersion:6,suggested:"expandToggleDisabled"}),this.expandToggleDisabled=t}get overflowActionsDisabled(){return this.overflowMode==="none"}set overflowActionsDisabled(t){W.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.overflowModeHandler(),this.cancelable.add(this.resize)}willUpdate(t){(t.has("expandDisabled")&&(this.hasUpdated||this.expandDisabled!==!1)||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("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()}loaded(){this.syncDefaultSlot(),this.syncActionsStartSlot(),this.syncActionsEndSlot(),this.syncActionsState(),this.overflowActions()}updated(){this.usesWrap&&this.lineMeasureFrame==null&&this.scheduleLineMeasure()}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",a=this.actions.map(o=>o[i]||0);this.getTrackedActionGroups().flatMap(o=>F(o,"calcite-action-menu")).forEach(o=>{let s=o.actions.find(c=>c.slot===H.trigger);a.push((s??o)[i]||0)}),e&&a.push(e[i]||0);let n=Math.max(...a,0);return a.map(o=>o||n)}getVisibleActionGroupItemCount(t){let e=t.actions.filter(n=>n.parentElement===t),i=F(t,"calcite-action-menu").length,a=e.filter(n=>n.slot!==S.menuActions).length+i,r=e.some(n=>n.slot===S.menuActions);return a+(r?1:0)}expandedHandler(){this.syncActionsState(!0),this.overflowActions()}overflowModeHandler(){this.overflowMode==="none"?this.resizeObserver?.disconnect():this.resizeObserver?.observe(this.el),this.overflowActions()}actionMenuOpenHandler(t){let e=t.composedPath(),i=e.find(a=>p(a)||v(a));i&&(p(i)&&!i.menuOpen||v(i)&&!i.open||(this.getTrackedActionGroups().forEach(a=>{e.includes(a)||(a.menuOpen=!1)}),this.getTrackedActionMenus().forEach(a=>{e.includes(a)||(a.open=!1)})))}runOverflowActions({actionGroups:t,expanded:e,overflowCount:i}){let a=++this.overflowPassId,r=new Map;t.forEach(n=>{let o=n.actions.filter(s=>s.parentElement===n);r.set(n,o.map(s=>s.slot??"").join("|"))}),gt({actionGroups:t,expanded:e,overflowCount:i}),t.forEach(n=>{let s=n.actions.filter(c=>c.parentElement===n).map(c=>c.slot??"").join("|");r.get(n)!==s&&(this.suppressedActionGroupActionsChange.set(n,a),this.queueSuppressedActionGroupActionsChangeCleanup(n,a))})}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})}get usesWrap(){return this.overflowMode==="wrap"&&this.layout!=="grid"}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(a=>{a.hidden||t.push(a)});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",a=t.getBoundingClientRect(),r=this.getWrapItems(),n=[],o=null;r.forEach(c=>{let d=ut({item:c,containerRect:a,horizontal:e,rtl:i});o!==null&&Math.abs(d-o)>1&&n.push(d),o=d}),(n.length!==this.lineOffsets.length||n.some((c,d)=>c!==this.lineOffsets[d]))&&(this.lineOffsets=n)}handleDefaultSlotChange(){this.syncSlotAndActions(()=>this.syncDefaultSlot()),this.usesWrap&&this.scheduleLineMeasure()}handleActionsEndSlotChange(){this.syncSlotAndActions(()=>this.syncActionsEndSlot())}handleActionsStartSlotChange(){this.syncSlotAndActions(()=>this.syncActionsStartSlot())}handleTooltipSlotChange(t){let e=Y(t).filter(nt);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})}syncActions(){this.actions=pt([...this.actionsStart,...this.defaultSlotItems,...this.actionsEnd])}syncActionsAndOverflow(){this.syncActionsState(),this.overflowActions()}syncSlotAndActions(t){t(),this.syncActionsAndOverflow()}syncActionsState(t=!1){this.syncActions(),this.updateActions(),t&&it({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=>v(t))}getAssignedActionBarItems(t){return t?Z(t).filter(e=>P(e)||p(e)||v(e)):[]}syncDefaultSlot(){this.defaultSlotItems=this.getAssignedActionBarItems(this.defaultSlotRef.value),this.actionGroups=this.defaultSlotItems.filter(t=>p(t)),this.actionMenus=this.defaultSlotItems.filter(t=>v(t)),this.updateGroups()}syncActionsStartSlot(){this.actionsStart=this.getAssignedActionBarItems(this.actionsStartSlotRef.value),this.actionsStartGroups=this.actionsStart.filter(t=>p(t)),this.hasActionsStart=this.actionsStart.length>0,this.updateGroups()}syncActionsEndSlot(){this.actionsEnd=this.getAssignedActionBarItems(this.actionsEndSlotRef.value),this.actionsEndGroups=this.actionsEnd.filter(t=>p(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())}handleActionMenuActionsChange(t){let e=t.target;this.getTrackedActionMenus().includes(e)&&this.syncActionsAndOverflow()}getNavigableActions(){return this.actions.filter(t=>!t.disabled&&t.slot!==S.menuActions)}handleKeyDown(t){let e=this.getNavigableActions(),i=document.activeElement;if(!(!P(i)||!e.includes(i)))switch(t.key){case"ArrowRight":case"ArrowDown":G(e,i,"next",!0),t.preventDefault();break;case"ArrowLeft":case"ArrowUp":G(e,i,"previous",!0),t.preventDefault();break;case"Home":G(e,i,"first",!0),t.preventDefault();break;case"End":G(e,i,"last",!0),t.preventDefault();break;case"Tab":this.setActionTabIndexes(i);break}}setActionTabIndexes(t){this.actions.forEach(e=>{let i=!e.disabled&&e===t?0:-1;i===0?e.removeAttribute("tabindex"):e.tabIndex=i})}renderExpandTooltipSlot(){return A`<slot name=${z.expandTooltip} @slotchange=${this.handleTooltipSlotChange}></slot>`}renderExpandToggle(){let{el:t,expanded:e,toggleExpand:i,messages:a,position:r,scale:n}=this;return at({collapseLabel:a.collapseLabel,collapseText:a.collapse,direction:this.direction,el:t,expanded:e,expandLabel:a.expandLabel,expandText:a.expand,position:r,ref:this.setExpandToggleEl,scale:n,toggle:i,tooltip:this.expandTooltip})}renderActionsGroup(t){let{expandToggleDisabled:e,scale:i,layout:a,overlayPositioning:r,expandPosition:n}=this,o=t==="start",s=!e&&n===t,c=o?this.hasActionsStart:this.hasActionsEnd,d=o?z.actionsStart:z.actionsEnd,T=o?this.handleActionsStartSlotChange:this.handleActionsEndSlotChange,D=o?this.actionsStartGroupLabel:this.actionsEndGroupLabel,I=!s&&!c,m=o?this.actionsStartGroupRef:this.actionsEndGroupRef,O=o?this.actionsStartSlotRef:this.actionsEndSlotRef,M=s?this.renderExpandToggle():null;return A`<calcite-action-group class=${E({[b.actionGroupStart]:o,[b.actionGroupEnd]:!o})} .hidden=${I} .label=${D} .layout=${a} .overlayPositioning=${r} .scale=${i} ${y(m)}>${o?M:null}<slot name=${d??N} @slotchange=${T} ${y(O)}></slot>${s?this.renderExpandTooltipSlot():null}${o?null:M}</calcite-action-group>`}render(){let t=this.layout==="horizontal"?"horizontal":"vertical";return A`<div .ariaOrientation=${t} class=${E({[b.container]:!0,[b.hasActionGroups]:this.hasActionGroups})} role=toolbar ${y(this.containerRef)}>${this.renderActionsGroup("start")}<slot @slotchange=${this.handleDefaultSlotChange} ${y(this.defaultSlotRef)}></slot>${this.renderActionsGroup("end")}${this.usesWrap?A`<div aria-hidden=true class=${E(b.lineOverlay)}>${this.lineOffsets.map(e=>A`<div class=${E(b.line)} style=${`--calcite-internal-action-bar-line-offset: ${e}px`}></div>`)}</div>`:null}</div>`}};Q("calcite-action-bar",U);export{U as ActionBar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as w,b as P,c as m,d as f,e as $,f as v,n as b,o as C,q as y}from"./
|
|
2
|
+
import{a as w,b as P,c as m,d as f,e as $,f as v,n as b,o as C,q as y}from"./4HSQ3OW6.js";var T=t=>(...o)=>{let e=f(),s=new t(...o),n=s.exports;m(e.at(-1));let r=s.component.manager;r.W(s,n),s.watchExports(r.W.bind(r,s)),$(s);let a=[s.component,...e].reverse();return C(a,i=>i===void 0?void 0:F(s,i,n),n)},F=(t,{host:o,key:e,isReactive:s},n)=>{let r=o,a=r[e]!==t.exports,i=r[e]!==n,c=n!==t.exports;if(a&&!i&&c&&(r[e]=t.exports),o===t.component){if(s){let l=t.component.manager;i&&l.W(t,r[e]),t.onUpdate(g=>{if(g.has(e)){let O=r[e];O!==t.exports&&l.W(t,O)}})}t.O=s?void 0:e}let u=t.component.constructor.elementProperties.get(e)?.readOnly;t.watchExports(()=>{r[e]!==t.exports&&(u?v(()=>{r[e]=t.exports}):r[e]=t.exports)})};var V=(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},p=(t,o,e)=>{let s=z(o).subscribe;return s(n=>{n.some(a=>V(t,a.target))&&e()})},x={},z=t=>{let o=t.join(","),e=x[o];if(e!==void 0)return e;let s=new Set,n=new MutationObserver(a=>s.forEach(i=>i(a)));globalThis.document&&n.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0});let r={subscribe:a=>(s.add(a),()=>{s.delete(a),s.size===0&&(n.disconnect(),x[o]=void 0)})};return x[o]=r,r},S=(t,o)=>{let e=t;for(;e;){let s=e.closest?.(o);if(s)return s;let n=e.getRootNode?.();if(n===globalThis.document)return;e=n?.host}};var h=(t,o,e)=>S(t,`[${o}]`)?.getAttribute(o)??e;var A=t=>{let o=h(t,"lang",globalThis.navigator?.language||E);return{lang:o,t9nLocale:j(o)}},G=(t,o,e,s)=>{let n,r=()=>U(t,o(),s).then(a=>{(n?.lang!==a.lang||n.t9nLocale!==a.t9nLocale||n.t9nStrings!==a.t9nStrings)&&e(a),n=a}).catch(a=>{b("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(r),p(t,["lang"],r)},U=async(t,o,e=t.localName.split("-").slice(1).join("-"))=>{let{lang:s,t9nLocale:n}=A(t),r=`${o}/${e}/t9n`,i=e===null?{}:await I(n,r,"messages.");return{lang:s,t9nLocale:n,t9nStrings:i}};var W="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),q=new Set(W),E="en",K={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},I=async(t,o,e="")=>{let s=`${o}/${e}`,n=`${s}${t}.json`;return k[n]??=H(t,s),await k[n]},k={},H=async(t,o)=>{let e=`${o}${t}.json`;try{let s=await fetch(e);if(s.ok)return await s.json()}catch(s){return b("error","intl",`An unknown error occurred while fetching localization strings at ${e}`,{detail:{error:s}}),{}}return t===E?{}:await H(E,o)},j=t=>{let[o,e]=t.split("-"),s=o.toLowerCase(),n=s;return e&&(n=`${s}-${e.toUpperCase()}`),n=K[n]??n,q.has(n)?n:e?j(s):E};var D=t=>R(void 0,t),Me=t=>o=>R(o,t),L=class extends y{constructor(o,e){super(o);let s=this.exports;try{P(this.component);let n=e(this.component,this),r=this.exports!==s;if(w(n)){r||this.setProvisionalExports(n);let a=n.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!r||n!==void 0)&&(this.exports=n),queueMicrotask(()=>super.catchUpLifecycle())}catch(n){this.P.reject(n)}}catchUpLifecycle(){}},R=T(L),De=(t,o)=>new N(t,o),N=class extends y{#e;#t;#s;constructor(o,e){super(),!!1&&(this.#t=o,this.#s=e,this.#e=new MutationObserver(s=>{s.forEach(n=>{o.includes(n.attributeName)&&e.call(this.component,this.component.el.getAttribute(n.attributeName),n.oldValue,n.attributeName)})}))}hostConnected(){this.#t.forEach(o=>{this.component.el.hasAttribute(o)&&this.#s.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 Re=t=>(...o)=>{let e=f(),s=new t(...o);return m(e.at(-1)),s};var M="ltr",_e=()=>D((t,o)=>{o.exports=M,o.onLifecycle(()=>{let e=()=>{let s=h(t.el,"dir",M);o.exports=s==="rtl"?"rtl":"ltr"};return e(),p(t.el,["dir"],e)})}),Fe=t=>(o={})=>D((e,s)=>{let n=A(e.el),r={_lang:n.lang,_t9nLocale:n.t9nLocale,_loading:!0},a=e;s.onLifecycle(()=>G(e.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:d,lang:u})=>{let l={...d,_lang:u,_t9nLocale:c,_loading:!1};s.exports=l;let g=d.componentLabel;typeof g=="string"&&"label"in e&&e.label==null&&(e.label??=g),i(a.messageOverrides)},o.name));let i=c=>{let d=s.exports,u=d._original??d,l=_(u,c);c&&(l._original=u),s.exports=l};return"messageOverrides"in a&&s.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),o.blocking?(s.setProvisionalExports(r,!1),s.ready):r}),_=(t,o)=>{if(!o)return t;let e={...t};return Object.entries(o).forEach(([s,n])=>{t[s]!==void 0&&(typeof n=="object"?e[s]=_(t[s],n):e[s]=n??t[s])}),e};export{D as a,Me as b,De as c,Re as d,_e as e,Fe as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{b as l}from"./
|
|
2
|
+
import{b as l}from"./Z2TXGQRP.js";var d=s=>l(e=>{function i(r){let{form:t}=e.elementInternals;if(!(r.defaultPrevented||e.disabled||s?.disabled?.()||!t||e.type==="button")){if(e.type==="submit"){t.requestSubmit();return}t.reset()}}e.listen("luminaFormAssociatedCallback",({detail:[r]})=>{r?e.el.addEventListener("click",i):e.el.removeEventListener("click",i)})});export{d as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as x}from"./
|
|
2
|
+
import{a as x}from"./3EEIZXLQ.js";import{a as O}from"./QRF7Y5RK.js";import{a as v}from"./VI7SBYXT.js";import"./Z2TXGQRP.js";import{p as y}from"./3QPETC2U.js";import{E as b,F as f,O as p,R as g,g as h,h as u,p as m}from"./4HSQ3OW6.js";var o={container:"container",containerHorizontal:"container--horizontal",containerVertical:"container--vertical"},S=h`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{display:flex;flex:1 1 auto}.container--vertical{flex-direction:column}.container--horizontal{flex-direction:row}:host([hidden]){display:none}[hidden]{display:none}`,c=class extends b{constructor(){super(),this.dragEnabled=!0,this.items=[],this.mutationObserver=v("mutation",()=>{this.setUpSorting()}),this.sortable=x()(this),this.interactiveContainer=O(this),this.disabled=!1,this.handleSelector="calcite-handle",this.layout="vertical",this.loading=!1,this.calciteListOrderChange=m({cancelable:!1}),this.listen("calciteHandleNudge",this.calciteHandleNudgeNextHandler)}static{this.properties={canPull:[0,{},{attribute:!1}],canPut:[0,{},{attribute:!1}],disabled:[7,{},{reflect:!0,type:Boolean}],dragSelector:[3,{},{reflect:!0}],group:[3,{},{reflect:!0}],handleSelector:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],loading:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=S}connectedCallback(){super.connectedCallback(),this.setUpSorting(),this.beginObserving()}load(){p.deprecated("component",{component:this,name:"sortable-list",removalVersion:5,suggested:"block-group"})}disconnectedCallback(){super.disconnectedCallback(),this.endObserving()}calciteHandleNudgeNextHandler(t){this.handleNudgeEvent(t)}onGlobalDragStart(){this.endObserving()}onGlobalDragEnd(){this.beginObserving()}onDragEnd(){}onDragStart(){}onDragSort(){this.items=Array.from(this.el.children),this.calciteListOrderChange.emit()}handleNudgeEvent(t){let{direction:a}=t.detail,e=t.composedPath().find(r=>r.matches(this.handleSelector)),i=this.items.find(r=>e&&r.contains(e)||t.composedPath().includes(r)),d=this.items.length-1,s=i?this.items.indexOf(i):-1,l=!1,n;a==="up"?s===0?l=!0:n=s-1:s===d?n=0:s===d-1?l=!0:n=s+2,this.endObserving(),l?i.parentElement.appendChild(i):i.parentElement.insertBefore(i,this.items[n]),this.items=Array.from(this.el.children),this.beginObserving(),requestAnimationFrame(()=>y(e)),e&&"selected"in e&&(e.selected=!0)}setUpSorting(){this.items=Array.from(this.el.children),this.sortable.reset()}beginObserving(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}endObserving(){this.mutationObserver?.disconnect()}render(){let{disabled:t,layout:a}=this,e=a==="horizontal"||!1;return this.interactiveContainer({disabled:t,children:u`<div class=${f({[o.container]:!0,[o.containerVertical]:!e,[o.containerHorizontal]:e})}><slot></slot></div>`})}};g("calcite-sortable-list",c);export{c as SortableList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as C}from"./DKJI4BME.js";import{a as S}from"./SIKIAQV2.js";import{b as l,c as w}from"./7ZZPRASC.js";import{a as $}from"./7C5LJNIE.js";import{a as z}from"./ZSMIPNAG.js";import{b as E}from"./7VTO7SRW.js";import{a as c,b as m}from"./VI7SBYXT.js";import{a as y}from"./WCFCSBZZ.js";import{a as x}from"./FI2KPE6Y.js";import{a as i}from"./ZWPNZ5XW.js";import{c as f}from"./C7CJCL4V.js";import{v as k}from"./3QPETC2U.js";import{C as p,D as r,E as h,F as n,H as a,J as v,R as g,g as b,h as o}from"./3QK4UKRU.js";var e={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},L=b`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle;border-radius:var(--calcite-button-corner-radius, var(--calcite-internal-button-corner-radius, var(--calcite-corner-radius)))}:host a,:host button{--calcite-internal-button-content-margin: .5rem;--calcite-internal-button-padding-x: 7px;--calcite-internal-button-padding-y: 3px;appearance:none;box-sizing:border-box;cursor:pointer;display:flex;outline-color:transparent;font-family:inherit;font-weight:var(--calcite-font-weight-normal);block-size:100%;align-items:center;justify-content:center;text-decoration-line:none;position:relative;-webkit-user-select:none;user-select:none;text-align:center;inline-size:100%;box-shadow:var(--calcite-button-shadow, var(--calcite-shadow-none));background-color:var(--calcite-button-background-color, var(--calcite-internal-button-background-color, var(--calcite-color-transparent)));border-block-start-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-block-start-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-block-end-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-block-end-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-inline-start-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-inline-start-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-inline-end-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-inline-end-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-style:solid;border-width:var(--calcite-border-width-sm);border-radius:var(--calcite-button-corner-radius, var(--calcite-internal-button-corner-radius, var(--calcite-corner-radius)));color:var(--calcite-button-text-color, var(--calcite-internal-button-text-color, currentColor));padding-block:var(--calcite-internal-button-padding-y);padding-inline:var(--calcite-internal-button-padding-x);transition:color var(--calcite-animation-timing) ease-in-out,background-color var(--calcite-animation-timing) ease-in-out,box-shadow var(--calcite-animation-timing) ease-in-out,outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host a:hover,:host button:hover{text-decoration-line:none;background-color:var(--calcite-button-background-color, var(--calcite-internal-button-background-color-hover, var(--calcite-color-transparent)))}:host a:focus,:host button:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}:host a:active,:host button:active{background-color:var(--calcite-button-background-color, var(--calcite-internal-button-background-color-press, var(--calcite-color-transparent)))}:host a span,:host button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host a calcite-loader,:host button calcite-loader{color:var(--calcite-button-loader-color, var(--calcite-internal-button-loader-color, var(--calcite-button-text-color, var(--calcite-internal-button-text-color))))}:host([round]){--calcite-internal-button-corner-radius: 50px}.content{margin-inline:var(--calcite-internal-button-content-margin)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-internal-button-content-margin: .75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-internal-button-content-margin: 1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-internal-button-content-margin)}.icon--start,.icon--end{color:var(--calcite-button-icon-color, var(--calcite-icon-color, var(--calcite-ui-icon-color)))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(.5)}to{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}to{inline-size:0;opacity:0;transform:scale(.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-internal-button-content-margin)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{--calcite-internal-button-border-color: var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([kind=brand]){--calcite-internal-button-background-color: var(--calcite-color-brand);--calcite-internal-button-background-color-hover: var(--calcite-color-brand-hover);--calcite-internal-button-background-color-press: var(--calcite-color-brand-press);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse);--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([kind=danger]){--calcite-internal-button-background-color: var(--calcite-color-status-danger);--calcite-internal-button-background-color-hover: var(--calcite-color-status-danger-hover);--calcite-internal-button-background-color-press: var(--calcite-color-status-danger-press);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse);--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([kind=neutral]){--calcite-internal-button-background-color: var(--calcite-color-foreground-3);--calcite-internal-button-background-color-hover: var(--calcite-color-foreground-2);--calcite-internal-button-background-color-press: var(--calcite-color-foreground-1);--calcite-internal-button-loader-color: var(--calcite-color-text-1);--calcite-internal-button-text-color: var(--calcite-color-text-1)}:host([kind=inverse]){--calcite-internal-button-background-color: var(--calcite-color-inverse);--calcite-internal-button-background-color-hover: var(--calcite-color-inverse-hover);--calcite-internal-button-background-color-press: var(--calcite-color-inverse-press);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse);--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([appearance=outline-fill]){--calcite-internal-button-background-color: var(--calcite-color-foreground-1);--calcite-internal-button-background-color-hover: var(--calcite-color-foreground-2);--calcite-internal-button-background-color-press: var(--calcite-color-foreground-3)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{--calcite-internal-button-border-color: var(--calcite-color-brand);--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-brand-hover);--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{--calcite-internal-button-border-color: var(--calcite-color-brand-press);--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{--calcite-internal-button-border-color: var(--calcite-color-status-danger);--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-status-danger-hover);--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{--calcite-internal-button-border-color: var(--calcite-color-status-danger-press);--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{--calcite-internal-button-border-color: var(--calcite-color-border-1);--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-border-input)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{--calcite-internal-button-border-color: var(--calcite-color-text-3)}:host([appearance=solid][kind=neutral]){--calcite-internal-button-background-color-hover: var(--calcite-color-border-2);--calcite-internal-button-background-color-press: var(--calcite-color-border-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-inverse);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{--calcite-internal-button-border-color: var(--calcite-color-inverse-press)}:host([appearance=outline]){--calcite-internal-button-background-color: var(--calcite-color-transparent);--calcite-internal-button-background-color-hover: var(--calcite-color-transparent-hover);--calcite-internal-button-background-color-press: var(--calcite-color-transparent-press)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{--calcite-internal-button-border-color: var(--calcite-color-brand);--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-brand-hover);--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{--calcite-internal-button-border-color: var(--calcite-color-brand-press);--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{--calcite-internal-button-border-color: var(--calcite-color-status-danger);--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-status-danger-hover);--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{--calcite-internal-button-border-color: var(--calcite-color-status-danger-press);--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-border-1);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-border-input)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{--calcite-internal-button-border-color: var(--calcite-color-text-3)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-inverse);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{--calcite-internal-button-border-color: var(--calcite-color-inverse-press)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button,:host([appearance=outline-fill][split-child=primary]) a,:host([appearance=outline][split-child=primary]) a{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button,:host([appearance=outline-fill][split-child=secondary]) a,:host([appearance=outline][split-child=secondary]) a{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]){--calcite-internal-button-background-color: var(--calcite-color-transparent);--calcite-internal-button-background-color-hover: var(--calcite-color-transparent-hover);--calcite-internal-button-background-color-press: var(--calcite-color-transparent-press)}:host([appearance=transparent]:not(.enable-editing-button)){--calcite-internal-button-background-color-hover: var(--calcite-color-transparent-hover);--calcite-internal-button-background-color-press: var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{--calcite-internal-button-text-color: var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{--calcite-internal-button-text-color: var(--calcite-color-text-3)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-padding-y: 0}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]){--calcite-internal-button-background-color-hover: var(--calcite-color-transparent-hover);--calcite-internal-button-background-color-press: var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=inverse]) button calcite-loader,:host([appearance=transparent][kind=inverse]) a calcite-loader{--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm)}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-internal-button-padding-x: .5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-internal-button-padding-y: 3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-internal-button-padding-x: 11px;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=m]) button,:host([scale=m]) a{--calcite-internal-button-padding-y: 7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-internal-button-padding-x: .75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-internal-button-padding-x: 15px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md)}:host([scale=l]) .button-padding{--calcite-internal-button-padding-x: 1rem;--calcite-internal-button-padding-y: 11px}:host([scale=l]) .button-padding--shrunk{--calcite-internal-button-padding-y: 9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 3px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);inline-size:var(--calcite-space-2xl);min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 7px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);inline-size:var(--calcite-space-3xl);min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 9px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);inline-size:var(--calcite-space-4xl);min-block-size:2.75rem}:host(:is([scale=s],[scale=m],[scale=l])[width=full]) a:not(.content--slotted),:host(:is([scale=s],[scale=m],[scale=l])[width=full]) button:not(.content--slotted){inline-size:var(--calcite-container-size-content-fluid)}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-y: var(--calcite-space-sm-plus)}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 23px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);block-size:var(--calcite-space-2xl)}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 2rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);block-size:var(--calcite-space-3xl)}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 43px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);block-size:var(--calcite-space-4xl)}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,s=class extends h{constructor(){super(),this.attributeWatch=f(["aria-expanded"],this.handleGlobalAttributesChanged),this.contentRef=p(),this.mutationObserver=c("mutation",()=>this.updateHasContent()),this.resizeObserver=c("resize",()=>this.setTooltipText()),this.focusSetter=x()(this),this.messages=y(),this.interactiveContainer=z(this),this.hasContent=!1,this.alignment="center",this.appearance="solid",this.disabled=!1,this.download=!1,this.kind="brand",this.loading=!1,this.round=!1,this.scale="m",this.splitChild=!1,this.type="button",this.width="auto",$({disabled:()=>!!this.href})(this),S(this)}static{this.properties={hasContent:[16,{},{state:!0}],tooltipText:[16,{},{state:!0}],alignment:[3,{},{reflect:!0}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],download:[3,{converter:v},{reflect:!0}],form:[3,{},{reflect:!0}],href:[3,{},{reflect:!0}],iconEnd:[3,{},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{},{reflect:!0}],kind:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],name:[3,{},{reflect:!0}],rel:[3,{},{reflect:!0}],round:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],splitChild:[3,{},{reflect:!0}],target:[3,{},{reflect:!0}],type:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.formAssociated=!0}static{this.styles=L}async setFocus(t){return this.focusSetter(()=>this.childEl,t)}connectedCallback(){super.connectedCallback(),this.setupTextContentObserver()}async load(){this.updateHasContent()}loaded(){this.setTooltipText()}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect()}handleGlobalAttributesChanged(){this.requestUpdate()}updateHasContent(){this.hasContent=k(this.el)}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.setFocus()}setTooltipText(){let{contentRef:{value:t}}=this;t&&(this.tooltipText=t.offsetWidth<t.scrollWidth&&this.el.innerText||void 0)}setChildEl(t){m(this.resizeObserver,this.childEl,t),this.childEl=t}render(){let t=this.href?"a":"button",d=this.href?l`a`:l`button`,T=this.loading?o`<div class=${n(e.buttonLoader)}><calcite-loader class=${n(this.loading?e.loadingIn:e.loadingOut)} inline .label=${this.messages.loading} .scale=${this.scale==="l"?"m":"s"}></calcite-loader></div>`:null,u=!this.iconStart&&!this.iconEnd,O=o`<calcite-icon class=${n({[e.icon]:!0,[e.iconStart]:!0})} .flipRtl=${this.iconFlipRtl==="start"||this.iconFlipRtl==="both"} .icon=${this.iconStart} .scale=${i(this.scale)}></calcite-icon>`,R=o`<calcite-icon class=${n({[e.icon]:!0,[e.iconEnd]:!0})} .flipRtl=${this.iconFlipRtl==="end"||this.iconFlipRtl==="both"} .icon=${this.iconEnd} .scale=${i(this.scale)}></calcite-icon>`,F=o`<span class=${n(e.content)} ${r(this.contentRef)}><slot></slot></span>`;return this.interactiveContainer({disabled:this.disabled,children:w`<${d} .ariaBusy=${E(this.loading,void 0)} .ariaExpanded=${this.el.ariaExpanded?this.el.ariaExpanded:void 0} .ariaLabel=${this.loading?this.messages.loading:C(this)} aria-live=polite class=${n({[e.buttonPadding]:u,[e.buttonPaddingShrunk]:!u,[e.contentSlotted]:this.hasContent,[e.iconStartEmpty]:!this.iconStart,[e.iconEndEmpty]:!this.iconEnd})} .disabled=${t==="button"?this.disabled:void 0} download=${(t==="a"?this.download===!0||this.download===""?"":this.download||void 0:void 0)??a} href=${(t==="a"?this.href:void 0)??a} name=${(t==="button"?this.name:void 0)??a} rel=${(t==="a"?this.rel:void 0)??a} tabindex=${(this.disabled?-1:void 0)??a} target=${(t==="a"?this.target:void 0)??a} title=${this.tooltipText??a} type=${(t==="button"?this.type:void 0)??a} ${r(this.setChildEl)}>${T}${this.iconStart?O:null}${this.hasContent?F:null}${this.iconEnd?R:null}</${d}>`})}};g("calcite-button",s);export{s as Button};
|
|
2
|
+
import{a as C}from"./DKJI4BME.js";import{a as S}from"./6Y5FJNGF.js";import{b as l,c as w}from"./VRDWEY3X.js";import{a as $}from"./ZCP73LZV.js";import{a as z}from"./QRF7Y5RK.js";import{b as E}from"./7VTO7SRW.js";import{a as c,b as m}from"./VI7SBYXT.js";import{a as y}from"./JF6NNJ2H.js";import{a as x}from"./G5I6PJTI.js";import{a as i}from"./ZWPNZ5XW.js";import{c as f}from"./Z2TXGQRP.js";import{v as k}from"./3QPETC2U.js";import{C as p,D as r,E as h,F as n,H as a,J as v,R as g,g as b,h as o}from"./4HSQ3OW6.js";var e={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},L=b`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle;border-radius:var(--calcite-button-corner-radius, var(--calcite-internal-button-corner-radius, var(--calcite-corner-radius)))}:host a,:host button{--calcite-internal-button-content-margin: .5rem;--calcite-internal-button-padding-x: 7px;--calcite-internal-button-padding-y: 3px;appearance:none;box-sizing:border-box;cursor:pointer;display:flex;outline-color:transparent;font-family:inherit;font-weight:var(--calcite-font-weight-normal);block-size:100%;align-items:center;justify-content:center;text-decoration-line:none;position:relative;-webkit-user-select:none;user-select:none;text-align:center;inline-size:100%;box-shadow:var(--calcite-button-shadow, var(--calcite-shadow-none));background-color:var(--calcite-button-background-color, var(--calcite-internal-button-background-color, var(--calcite-color-transparent)));border-block-start-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-block-start-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-block-end-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-block-end-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-inline-start-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-inline-start-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-inline-end-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-inline-end-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-style:solid;border-width:var(--calcite-border-width-sm);border-radius:var(--calcite-button-corner-radius, var(--calcite-internal-button-corner-radius, var(--calcite-corner-radius)));color:var(--calcite-button-text-color, var(--calcite-internal-button-text-color, currentColor));padding-block:var(--calcite-internal-button-padding-y);padding-inline:var(--calcite-internal-button-padding-x);transition:color var(--calcite-animation-timing) ease-in-out,background-color var(--calcite-animation-timing) ease-in-out,box-shadow var(--calcite-animation-timing) ease-in-out,outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host a:hover,:host button:hover{text-decoration-line:none;background-color:var(--calcite-button-background-color, var(--calcite-internal-button-background-color-hover, var(--calcite-color-transparent)))}:host a:focus,:host button:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}:host a:active,:host button:active{background-color:var(--calcite-button-background-color, var(--calcite-internal-button-background-color-press, var(--calcite-color-transparent)))}:host a span,:host button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host a calcite-loader,:host button calcite-loader{color:var(--calcite-button-loader-color, var(--calcite-internal-button-loader-color, var(--calcite-button-text-color, var(--calcite-internal-button-text-color))))}:host([round]){--calcite-internal-button-corner-radius: 50px}.content{margin-inline:var(--calcite-internal-button-content-margin)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-internal-button-content-margin: .75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-internal-button-content-margin: 1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-internal-button-content-margin)}.icon--start,.icon--end{color:var(--calcite-button-icon-color, var(--calcite-icon-color, var(--calcite-ui-icon-color)))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(.5)}to{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}to{inline-size:0;opacity:0;transform:scale(.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-internal-button-content-margin)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{--calcite-internal-button-border-color: var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([kind=brand]){--calcite-internal-button-background-color: var(--calcite-color-brand);--calcite-internal-button-background-color-hover: var(--calcite-color-brand-hover);--calcite-internal-button-background-color-press: var(--calcite-color-brand-press);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse);--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([kind=danger]){--calcite-internal-button-background-color: var(--calcite-color-status-danger);--calcite-internal-button-background-color-hover: var(--calcite-color-status-danger-hover);--calcite-internal-button-background-color-press: var(--calcite-color-status-danger-press);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse);--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([kind=neutral]){--calcite-internal-button-background-color: var(--calcite-color-foreground-3);--calcite-internal-button-background-color-hover: var(--calcite-color-foreground-2);--calcite-internal-button-background-color-press: var(--calcite-color-foreground-1);--calcite-internal-button-loader-color: var(--calcite-color-text-1);--calcite-internal-button-text-color: var(--calcite-color-text-1)}:host([kind=inverse]){--calcite-internal-button-background-color: var(--calcite-color-inverse);--calcite-internal-button-background-color-hover: var(--calcite-color-inverse-hover);--calcite-internal-button-background-color-press: var(--calcite-color-inverse-press);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse);--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([appearance=outline-fill]){--calcite-internal-button-background-color: var(--calcite-color-foreground-1);--calcite-internal-button-background-color-hover: var(--calcite-color-foreground-2);--calcite-internal-button-background-color-press: var(--calcite-color-foreground-3)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{--calcite-internal-button-border-color: var(--calcite-color-brand);--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-brand-hover);--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{--calcite-internal-button-border-color: var(--calcite-color-brand-press);--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{--calcite-internal-button-border-color: var(--calcite-color-status-danger);--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-status-danger-hover);--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{--calcite-internal-button-border-color: var(--calcite-color-status-danger-press);--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{--calcite-internal-button-border-color: var(--calcite-color-border-1);--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-border-input)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{--calcite-internal-button-border-color: var(--calcite-color-text-3)}:host([appearance=solid][kind=neutral]){--calcite-internal-button-background-color-hover: var(--calcite-color-border-2);--calcite-internal-button-background-color-press: var(--calcite-color-border-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-inverse);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{--calcite-internal-button-border-color: var(--calcite-color-inverse-press)}:host([appearance=outline]){--calcite-internal-button-background-color: var(--calcite-color-transparent);--calcite-internal-button-background-color-hover: var(--calcite-color-transparent-hover);--calcite-internal-button-background-color-press: var(--calcite-color-transparent-press)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{--calcite-internal-button-border-color: var(--calcite-color-brand);--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-brand-hover);--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{--calcite-internal-button-border-color: var(--calcite-color-brand-press);--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{--calcite-internal-button-border-color: var(--calcite-color-status-danger);--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-status-danger-hover);--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{--calcite-internal-button-border-color: var(--calcite-color-status-danger-press);--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-border-1);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-border-input)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{--calcite-internal-button-border-color: var(--calcite-color-text-3)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-inverse);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{--calcite-internal-button-border-color: var(--calcite-color-inverse-press)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button,:host([appearance=outline-fill][split-child=primary]) a,:host([appearance=outline][split-child=primary]) a{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button,:host([appearance=outline-fill][split-child=secondary]) a,:host([appearance=outline][split-child=secondary]) a{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]){--calcite-internal-button-background-color: var(--calcite-color-transparent);--calcite-internal-button-background-color-hover: var(--calcite-color-transparent-hover);--calcite-internal-button-background-color-press: var(--calcite-color-transparent-press)}:host([appearance=transparent]:not(.enable-editing-button)){--calcite-internal-button-background-color-hover: var(--calcite-color-transparent-hover);--calcite-internal-button-background-color-press: var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{--calcite-internal-button-text-color: var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{--calcite-internal-button-text-color: var(--calcite-color-text-3)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-padding-y: 0}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]){--calcite-internal-button-background-color-hover: var(--calcite-color-transparent-hover);--calcite-internal-button-background-color-press: var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=inverse]) button calcite-loader,:host([appearance=transparent][kind=inverse]) a calcite-loader{--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm)}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-internal-button-padding-x: .5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-internal-button-padding-y: 3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-internal-button-padding-x: 11px;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=m]) button,:host([scale=m]) a{--calcite-internal-button-padding-y: 7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-internal-button-padding-x: .75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-internal-button-padding-x: 15px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md)}:host([scale=l]) .button-padding{--calcite-internal-button-padding-x: 1rem;--calcite-internal-button-padding-y: 11px}:host([scale=l]) .button-padding--shrunk{--calcite-internal-button-padding-y: 9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 3px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);inline-size:var(--calcite-space-2xl);min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 7px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);inline-size:var(--calcite-space-3xl);min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 9px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);inline-size:var(--calcite-space-4xl);min-block-size:2.75rem}:host(:is([scale=s],[scale=m],[scale=l])[width=full]) a:not(.content--slotted),:host(:is([scale=s],[scale=m],[scale=l])[width=full]) button:not(.content--slotted){inline-size:var(--calcite-container-size-content-fluid)}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-y: var(--calcite-space-sm-plus)}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 23px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);block-size:var(--calcite-space-2xl)}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 2rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);block-size:var(--calcite-space-3xl)}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 43px;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);block-size:var(--calcite-space-4xl)}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,s=class extends h{constructor(){super(),this.attributeWatch=f(["aria-expanded"],this.handleGlobalAttributesChanged),this.contentRef=p(),this.mutationObserver=c("mutation",()=>this.updateHasContent()),this.resizeObserver=c("resize",()=>this.setTooltipText()),this.focusSetter=x()(this),this.messages=y(),this.interactiveContainer=z(this),this.hasContent=!1,this.alignment="center",this.appearance="solid",this.disabled=!1,this.download=!1,this.kind="brand",this.loading=!1,this.round=!1,this.scale="m",this.splitChild=!1,this.type="button",this.width="auto",$({disabled:()=>!!this.href})(this),S(this)}static{this.properties={hasContent:[16,{},{state:!0}],tooltipText:[16,{},{state:!0}],alignment:[3,{},{reflect:!0}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],download:[3,{converter:v},{reflect:!0}],form:[3,{},{reflect:!0}],href:[3,{},{reflect:!0}],iconEnd:[3,{},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{},{reflect:!0}],kind:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],name:[3,{},{reflect:!0}],rel:[3,{},{reflect:!0}],round:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],splitChild:[3,{},{reflect:!0}],target:[3,{},{reflect:!0}],type:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.formAssociated=!0}static{this.styles=L}async setFocus(t){return this.focusSetter(()=>this.childEl,t)}connectedCallback(){super.connectedCallback(),this.setupTextContentObserver()}async load(){this.updateHasContent()}loaded(){this.setTooltipText()}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect()}handleGlobalAttributesChanged(){this.requestUpdate()}updateHasContent(){this.hasContent=k(this.el)}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.setFocus()}setTooltipText(){let{contentRef:{value:t}}=this;t&&(this.tooltipText=t.offsetWidth<t.scrollWidth&&this.el.innerText||void 0)}setChildEl(t){m(this.resizeObserver,this.childEl,t),this.childEl=t}render(){let t=this.href?"a":"button",d=this.href?l`a`:l`button`,T=this.loading?o`<div class=${n(e.buttonLoader)}><calcite-loader class=${n(this.loading?e.loadingIn:e.loadingOut)} inline .label=${this.messages.loading} .scale=${this.scale==="l"?"m":"s"}></calcite-loader></div>`:null,u=!this.iconStart&&!this.iconEnd,O=o`<calcite-icon class=${n({[e.icon]:!0,[e.iconStart]:!0})} .flipRtl=${this.iconFlipRtl==="start"||this.iconFlipRtl==="both"} .icon=${this.iconStart} .scale=${i(this.scale)}></calcite-icon>`,R=o`<calcite-icon class=${n({[e.icon]:!0,[e.iconEnd]:!0})} .flipRtl=${this.iconFlipRtl==="end"||this.iconFlipRtl==="both"} .icon=${this.iconEnd} .scale=${i(this.scale)}></calcite-icon>`,F=o`<span class=${n(e.content)} ${r(this.contentRef)}><slot></slot></span>`;return this.interactiveContainer({disabled:this.disabled,children:w`<${d} .ariaBusy=${E(this.loading,void 0)} .ariaExpanded=${this.el.ariaExpanded?this.el.ariaExpanded:void 0} .ariaLabel=${this.loading?this.messages.loading:C(this)} aria-live=polite class=${n({[e.buttonPadding]:u,[e.buttonPaddingShrunk]:!u,[e.contentSlotted]:this.hasContent,[e.iconStartEmpty]:!this.iconStart,[e.iconEndEmpty]:!this.iconEnd})} .disabled=${t==="button"?this.disabled:void 0} download=${(t==="a"?this.download===!0||this.download===""?"":this.download||void 0:void 0)??a} href=${(t==="a"?this.href:void 0)??a} name=${(t==="button"?this.name:void 0)??a} rel=${(t==="a"?this.rel:void 0)??a} tabindex=${(this.disabled?-1:void 0)??a} target=${(t==="a"?this.target:void 0)??a} title=${this.tooltipText??a} type=${(t==="button"?this.type:void 0)??a} ${r(this.setChildEl)}>${T}${this.iconStart?O:null}${this.hasContent?F:null}${this.iconEnd?R:null}</${d}>`})}};g("calcite-button",s);export{s as Button};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{d as a}from"./C4WP5EBM.js";import{a as S}from"./
|
|
2
|
+
import{d as a}from"./C4WP5EBM.js";import{a as S}from"./QRF7Y5RK.js";import"./VUYX7MNO.js";import{a as u}from"./G5I6PJTI.js";import"./ZWPNZ5XW.js";import"./Z2TXGQRP.js";import{C as l,y as f}from"./3QPETC2U.js";import{C as h,D as d,E as p,R as m,g as o,h as n,p as r}from"./4HSQ3OW6.js";var y=o`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.container{display:flex;inline-size:100%;flex-wrap:wrap;gap:.5rem}::slotted(calcite-chip){flex:none}:host([scale=s]) .container{gap:.25rem}:host([scale=l]) .container{gap:.75rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,c=class extends p{constructor(){super(),this.items=[],this.slotRef=h(),this.focusSetter=u()(this),this.interactiveContainer=S(this),this.disabled=!1,this.scale="m",this.selectedItems=[],this.selectionMode="none",this.calciteChipGroupSelect=r({cancelable:!1}),this.listen("keydown",this.keyDownHandler),this.listen("calciteChipClose",this.calciteChipCloseListener),this.listen("calciteChipSelect",this.calciteChipSelectListener),this.listen("calciteInternalChipSelect",this.calciteInternalChipSelectListener),this.listen("calciteInternalSyncSelectedChips",this.calciteInternalSyncSelectedChips)}static{this.properties={disabled:[7,{},{reflect:!0,type:Boolean}],label:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionMode:[3,{},{reflect:!0}]}}static{this.styles=y}async setFocus(e){return this.focusSetter(()=>this.selectedItems[0]||this.items[0],e)}willUpdate(e){(e.has("scale")||e.has("selectionMode"))&&(this.hasUpdated||this.selectionMode!=="none")&&this.updateItems()}keyDownHandler(e){let t={ArrowRight:"next",ArrowLeft:"previous",Home:"first",End:"last"}[e.key];if(e.defaultPrevented||!t)return;let i=e.composedPath().find(a);if(!i||!this.items.includes(i))return;let I=this.items.filter(g=>!g.disabled);l(I,i,t,!0,!0,!0)}calciteChipCloseListener(e){let s=e.target;this.items?.includes(s)&&(this.items?.indexOf(s)>0?l(this.items,s,"previous",!1,!1):this.items?.indexOf(s)===0?l(this.items,s,"next",!1,!1):l(this.items,s,"first",!1,!1)),this.items=this.items.filter(t=>t!==s),e.stopPropagation()}calciteChipSelectListener(e){e.composedPath().includes(this.el)&&this.setSelectedItems(!0,e.target),e.stopPropagation()}calciteInternalChipSelectListener(e){e.composedPath().includes(this.el)&&this.setSelectedItems(!1,e.target),e.stopPropagation()}calciteInternalSyncSelectedChips(e){e.composedPath().includes(this.el)&&(this.updateSelectedItems(),this.selectionMode==="single"&&this.selectedItems.length>1&&this.setSelectedItems(!1,e.target)),e.stopPropagation()}updateItems(e){let s=this.slotRef.value?.assignedElements({flatten:!0}).filter(a)||[];this.items=e?f(e):s,!(this.items?.length<1)&&(this.items?.forEach(t=>{t.interactive=!0,t.scale=this.scale,t.selectionMode=this.selectionMode,t.parentChipGroup=this.el}),this.setSelectedItems(!1))}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}setSelectedItems(e,s){s&&this.items?.forEach(t=>{let i=s===t;switch(this.selectionMode){case"multiple":i&&(t.selected=!t.selected);break;case"single":t.selected=i?!t.selected:!1;break;case"single-persist":t.selected=!!i;break}}),this.updateSelectedItems(),e&&this.calciteChipGroupSelect.emit()}render(){let e=this.selectionMode==="none"||this.selectionMode==="multiple"?"group":"radiogroup",{disabled:s}=this;return this.interactiveContainer({disabled:s,children:n`<div .ariaLabel=${this.label} class="container" .role=${e}><slot @slotchange=${this.updateItems} ${d(this.slotRef)}></slot></div>`})}};m("calcite-chip-group",c);export{c as ChipGroup};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as x,h as y,l as E,n as g,o as b,p,q as I,r as d,s as r,t as h,u as B}from"./LC6H6CKP.js";import"./EM6V55GC.js";import{a as O}from"./
|
|
2
|
+
import{a as x,h as y,l as E,n as g,o as b,p,q as I,r as d,s as r,t as h,u as B}from"./LC6H6CKP.js";import"./EM6V55GC.js";import{a as O}from"./CG7VTX2O.js";import"./VXDPJESZ.js";import{a as T}from"./G5I6PJTI.js";import"./ZWPNZ5XW.js";import"./Z2TXGQRP.js";import"./3QPETC2U.js";import{C,D as v,E as D,F as f,R as F,g as S,h as m,p as R}from"./4HSQ3OW6.js";var $={container:"container",hexInput:"hex-input",opacityInput:"opacity-input"},U=S`:host{display:block}.container{display:flex;inline-size:100%;flex-wrap:nowrap;align-items:center}.hex-input{--calcite-input-text-background-color: var(--calcite-color-picker-input-background-color);--calcite-input-text-border-color: var(--calcite-color-picker-input-border-color);--calcite-input-text-text-color: var(--calcite-color-picker-input-text-color);--calcite-input-prefix-text-color: var(--calcite-color-picker-input-prefix-text-color)}.opacity-input{--calcite-input-number-background-color: var(--calcite-color-picker-input-background-color);--calcite-input-number-border-color: var(--calcite-color-picker-input-border-color);--calcite-input-number-text-color: var(--calcite-color-picker-input-text-color);--calcite-input-suffix-text-color: var(--calcite-color-picker-input-suffix-text-color)}.hex-input{flex-grow:1;text-transform:uppercase}.opacity-input{inline-size:100px;margin-inline-start:-1px}:host([hidden]){display:none}[hidden]{display:none}`,V=x(),k=class extends D{constructor(){super(...arguments),this.hexInputRef=C(),this.opacityInputRef=C(),this.focusSetter=T()(this),this.internalColor=V,this.alphaChannel=!1,this.allowEmpty=!1,this.hexLabel="Hex",this.scale="m",this.value=r(h(V,this.alphaChannel),this.alphaChannel,!0),this.calciteColorPickerHexInputChange=R({cancelable:!1})}static{this.properties={internalColor:[16,{},{state:!0}],alphaChannel:[5,{},{type:Boolean}],allowEmpty:[5,{},{type:Boolean}],hexLabel:1,messages:[0,{},{attribute:!1}],numberingSystem:1,scale:[3,{},{reflect:!0}],value:[3,{},{reflect:!0}]}}static{this.styles=U}async setFocus(t){return this.focusSetter(()=>this.hexInputRef.value,t)}connectedCallback(){super.connectedCallback(),this.previousDefinedValue=this.value;let{allowEmpty:t,alphaChannel:e,value:a}=this;if(a){let n=r(a,e);p(n,e)&&this.internalSetValue(n,n,!1);return}t&&this.internalSetValue(void 0,void 0,!1)}willUpdate(t){t.has("value")&&(this.hasUpdated||this.value!==r(h(V,this.alphaChannel),this.alphaChannel,!0))&&this.internalSetValue(this.value,t.get("value"),!1)}onHexInputBlur(){let t=this.hexInputRef.value,e=t.value,a=`#${e}`,{allowEmpty:n,internalColor:l}=this,o=n&&!e,i=d(a);(I(a,!0)||I(a,!1))&&this.onHexInputChange(),!(o||p(a)&&i)&&(t.value=n&&!l?"":this.formatHexForInternalInput(B(l.object())))}onOpacityInputBlur(){let t=this.opacityInputRef.value,e=t.value,{allowEmpty:a,internalColor:n}=this;a&&!e||(t.value=a&&!n?"":this.formatOpacityForInternalInput(n))}onOpacityInputInput(){this.onOpacityInputChange()}onHexInputChange(){let e=this.hexInputRef.value.value;if(e){let a=r(e,!1);if(p(a)&&this.alphaChannel&&this.internalColor){let l=r(this.internalColor.hexa(),!0).slice(-2);e=`${a+l}`}}this.internalSetValue(e,this.value)}onOpacityInputChange(){let t=this.opacityInputRef.value,e;if(!t.value)e=t.value;else{let a=b(Number(t.value));e=this.internalColor?.alpha(a).hexa()}this.internalSetValue(e,this.value)}onInputFocus(t){(t.type==="calciteInternalInputTextFocus"?this.hexInputRef:this.opacityInputRef).value.selectText()}onHexInputInput(){let t=`#${this.hexInputRef.value.value}`,e=this.value;p(t,this.alphaChannel)&&d(t,this.alphaChannel)&&this.internalSetValue(t,e)}onInputKeyDown(t){let{altKey:e,ctrlKey:a,metaKey:n,shiftKey:l}=t,{alphaChannel:o,hexInputRef:i,internalColor:s,value:c}=this,{key:u}=t,w=t.composedPath();if(u==="Tab"&&I(c,this.alphaChannel)||u==="Enter"){w.includes(i.value)?this.onHexInputChange():this.onOpacityInputChange(),u==="Enter"&&t.preventDefault();return}let L=u==="ArrowDown"||u==="ArrowUp",H=this.value;if(L){if(!c){this.internalSetValue(this.previousDefinedValue,H),t.preventDefault();return}let P=u==="ArrowUp"?1:-1,N=l?10:1;this.internalSetValue(h(this.nudgeRGBChannels(s,N*P,w.includes(i.value)?"rgb":"a"),o),H),t.preventDefault();return}let A=e||a||n,K=u.length===1,z=E.test(u);K&&!A&&!z&&t.preventDefault()}onHexInputPaste(t){let e=t.clipboardData?.getData("text");p(e,this.alphaChannel)&&d(e,this.alphaChannel)&&(t.preventDefault(),this.hexInputRef.value.value=e.slice(1),this.internalSetValue(e,this.value))}internalSetValue(t,e,a=!0){if(t){let{alphaChannel:n}=this,l=r(t,n,n);if(p(l,n)){let{internalColor:o}=this,i=x(l),s=r(h(i,n),n),c=!o||s!==r(h(o,n),n);this.internalColor=i,this.previousDefinedValue=s,this.value=s,c&&a&&this.calciteColorPickerHexInputChange.emit();return}}else if(this.allowEmpty){this.internalColor=void 0,this.value=void 0,a&&this.calciteColorPickerHexInputChange.emit();return}this.value=e}formatHexForInternalInput(t){return t?t.replace("#","").slice(0,6):""}formatOpacityForInternalInput(t){return t?`${g(t.alpha())}`:""}nudgeRGBChannels(t,e,a){let n,l=t.array(),o=l.slice(0,3);if(a==="rgb")n=[...o.map(s=>s+e),this.alphaChannel?l[3]:void 0];else{let i=b(g(t.alpha())+e);n=[...o,i]}return x(n)}render(){let{alphaChannel:t,hexLabel:e,internalColor:a,messages:n,scale:l,value:o}=this,i=this.formatHexForInternalInput(o),s=this.formatOpacityForInternalInput(a),c=l==="l"?"m":"s";return m`<div class=${f($.container)}><calcite-input-text class=${f($.hexInput)} .label=${n?.hex||e} .maxLength=${this.alphaChannel?8:6} @calciteInputTextChange=${this.onHexInputChange} @calciteInputTextInput=${this.onHexInputInput} @calciteInternalInputTextBlur=${this.onHexInputBlur} @calciteInternalInputTextFocus=${this.onInputFocus} @keydown=${this.onInputKeyDown} @paste=${this.onHexInputPaste} prefix-text=# .scale=${c} .value=${i} ${v(this.hexInputRef)}></calcite-input-text>${t?O("opacity-input",m`<calcite-input-number class=${f($.opacityInput)} .label=${n?.opacity} .max=${y.max} max-length=3 .min=${y.min} number-button-type=none .numberingSystem=${this.numberingSystem} @calciteInputNumberInput=${this.onOpacityInputInput} @calciteInternalInputNumberBlur=${this.onOpacityInputBlur} @calciteInternalInputNumberFocus=${this.onInputFocus} @keydown=${this.onInputKeyDown} .scale=${c} suffix-text=% .value=${s} ${v(this.opacityInputRef)}></calcite-input-number>`):null}</div>`}};F("calcite-color-picker-hex-input",k);export{k as ColorPickerHexInput};
|