UNPKG

@arcgis/map-components

Version:
5 lines (4 loc) 1.8 kB
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. v4.32.13 */ import{a as f}from"./NYXWVKGC.js";import{a as u}from"./QKQNYHUC.js";import{a as i}from"./KWBN5CHV.js";import"./JM4XJJFL.js";import"./AX2MGWNF.js";import{A as d,B as h,C as s,D as p,E as e,G as g,a as r,g as n,q as c,r as l,s as m}from"./NIZJVZRG.js";var v=await $arcgis.l("widgets/Compass/CompassViewModel");var w=l`@layer{arcgis-compass{display:block}}`,y="esri-compass",$={base:y,iconContainer:`${y}__icon-container`},M=f(v),o=class extends h{constructor(){super(...arguments),this.messages=u(),this.viewModel=M(this),this.autoDestroyDisabled=!1,this.orientation=this.viewModel.orientation,this.position="top-left",this.state=this.viewModel.state,this.arcgisPropertyChange=c()("state","orientation"),this.arcgisReady=d()}static{this.properties={autoDestroyDisabled:5,icon:3,label:1,messageOverrides:0,orientation:0,position:3,referenceElement:1,state:3}}static{this.shadowRootOptions=n}static{this.styles=w}get icon(){return this._icon??(this.state==="rotation"?"arrow-up":"compass-needle")}set icon(t){this._icon=t}async destroy(){await this.manager.destroy()}async reset(){this.viewModel.reset()}_reset(){this.viewModel.reset()}render(){let{messages:t,icon:b}=this;return m`<div class=${s(r($.base,i.widget))}><calcite-button class=${s(i.widgetButton)} .disabled=${this.state==="disabled"} kind=neutral .label=${t.reset} @click=${this._reset} round scale=s title=${t.reset??e}><div aria-hidden=true class=${s($.iconContainer)} title=${t.reset??e}><calcite-icon .icon=${b} style=${p(_(this.orientation))}></calcite-icon></div></calcite-button></div>`}},_=a=>({transform:`rotateZ(${a.z}deg)`});g("arcgis-compass",o);export{o as ArcgisCompass};