@arcgis/map-components
Version:
ArcGIS Map Components
2 lines • 2.33 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import{a as p}from"./HZFVK34O.js";import b from"./OAWV35F7.js";import{h as c}from"./AKBXFBDL.js";import"./LMBRORN7.js";import a from"./5E6WEUZS.js";import"./PBSJQPB2.js";import{O as l,R as r,U as h,b as e,p as o,x as n}from"./WUJCCZQC.js";import"./3TTFCHAA.js";export default $arcgis.t(([{when:y},,{a:m}])=>{var a=t=>t==="hidden"?"hide-link-chart-nonspatial-data":"show-link-chart-nonspatial-data",s=class extends l{constructor(){super(...arguments),this.messages=p(),this._state="disabled",this.view=d.useView(this),this.autoDestroyDisabled=!1,this.icon=a(this.view?.map?.linkChartProperties?.nonspatialDataDisplay?.mode??"visible"),this.visualScale="m",this.arcgisPropertyChange=c()("state"),this.arcgisReady=n()}static{this.properties={_state:16,view:0,autoDestroyDisabled:5,icon:1,label:1,messageOverrides:0,referenceElement:1,state:32,visualScale:1}}get state(){return this._state}async destroy(){await this.manager.destroy()}async switchNonspatialVisibility(i){this.view&&(d.changeNonspatialDataDisplay(this.view,i),this.icon=a(i))}loaded(){this.manager.onLifecycle(()=>[y(()=>this.view?.ready?"ready":"disabled",i=>{this._state=i,this.icon=a(this.view?.map?.linkChartProperties?.nonspatialDataDisplay?.mode??"visible")},{sync:!0,initial:!0})])}_handleToggle(){let i=(this.view?.map?.linkChartProperties?.nonspatialDataDisplay?.mode??"visible")==="hidden"?"visible":"hidden";this.switchNonspatialVisibility(i)}render(){let{messages:i}=this;return this.state==="ready"&&this.view?.map&&this.view?.map.mapType!=="webLinkChart"&&o("error",this,"The <arcgis-link-chart-nonspatial-visibility-toggle> component must be used with an <arcgis-link-chart> component to provide the view"),e`<calcite-action class="root" .scale=${this.visualScale} .icon=${this.icon} =${this._handleToggle} =${g=>{g.key==="Enter"&&this._handleToggle()}} .disabled=${this.view?.map?.mapType!=="webLinkChart"} .text=${i.toggleLabel} title=${i.toggleLabel??r} data-testid=link-chart-nonspatial-visibility-toggle-action></calcite-action>`}},d={changeNonspatialDataDisplay:(t,i)=>{t.map.changeNonspatialDataDisplay(i)},useView:t=>m(t)};h("arcgis-link-chart-nonspatial-visibility-toggle",s);return{ArcgisLinkChartNonspatialVisibilityToggle:s,exportsForTests:d}},"core/reactiveUtils",a,b)