UNPKG

@arcgis/map-components

Version:
2 lines 2.61 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */ import{a as g}from"./HZFVK34O.js";import{a as v}from"./54VXNFQ4.js";import c from"./OAWV35F7.js";import{h}from"./AKBXFBDL.js";import"./LMBRORN7.js";import b from"./5E6WEUZS.js";import{d,f}from"./PBSJQPB2.js";import{O as i,P as a,R as u,U as m,a as n,b as r,x as o}from"./WUJCCZQC.js";import"./3TTFCHAA.js";export default $arcgis.t(([,{a:p}])=>{var E=n`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);calcite-button{--calcite-offset-invert-focus: 1}display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}`;function x(l){return l.includes("#")||l.includes(".")||l.includes("[")?l:`#${l}`}var c=class extends i{constructor(){super(),this.messages=g(),this.view=p(this),this.visualScale="m",this.arcgisPropertyChange=h()("state"),this.arcgisReady=o(),this.listenOn(document,"fullscreenchange",()=>this.fullscreenElement=document.fullscreenElement)}static{this.properties={fullscreenElement:16,view:0,element:1,label:1,messageOverrides:0,referenceElement:1,visualScale:1,state:35}}static{this.styles=E}get fullscreenTitle(){let e=this.state;return e==="active"?this.messages.exit:e==="ready"?this.messages.enter:""}#e;get element(){return this.#e}set element(e){if(typeof e=="string"){let t=x(e),s=f(this.el,t);this.#e=s||void 0}else this.#e=e}get state(){if(!document.fullscreenEnabled)return"unsupported";let e=this._getElement();return e?this.fullscreenElement===e?"active":"ready":"disabled"}connectedCallback(){super.connectedCallback(),this.fullscreenElement=document.fullscreenElement}_getElement(){let e=this.view?.container,t=e?.getRootNode(),s=t instanceof ShadowRoot?t.host:null;return this.element??e?.parentElement??s??null}_toggle(){document.fullscreenElement?document.exitFullscreen():this._getElement()?.requestFullscreen()}render(){let{fullscreenTitle:e,state:t}=this,s=t==="unsupported",b=t==="ready"||t==="disabled"||t==="unsupported"?"zoom-out-fixed":"zoom-in-fixed";return r`<div class=${a(d("root",v.arcgisButton))}>${!s&&r`<calcite-button .disabled=${t==="disabled"} .iconStart=${b} kind=neutral .label=${e} @click=${this._toggle} .scale=${this.visualScale} title=${e??u}></calcite-button>`||""}</div>`}};m("arcgis-fullscreen",c);return c},b,c)