UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 1.91 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../Widget.js";import{tsx as s,isRTL as r}from"../../support/widget.js";import{storeNode as l}from"../../support/widgetUtils.js";const n="esri-building-level-picker-item",h={container:n,base:`${n}__base`,hover:`${n}--hover`,active:`${n}--active`};let a=class extends i{constructor(t,e){super(t,e),this.active=!1,this.hovering=!1,this.width=0,this.height=0,this.onSelect=()=>{},this.onFocus=()=>{},this.onBlur=()=>{},this._baseElement=null}render(){return s("div",{bind:this,class:this.classes(h.container,{[h.active]:this.active,[h.hover]:this.hovering}),key:this,styles:{height:`${this.height}px`}},this._renderBase())}focus(){null!=this._baseElement&&this._baseElement.focus()}_renderBase(){const t=this.width,e=.8*this.width;return s("div",{class:h.base,styles:{width:`${Math.round(t)}px`,height:`${Math.round(t)}px`}},s("button",{afterCreate:l,"aria-label":this.label,bind:this,class:"rect","data-node-ref":"_baseElement",onblur:this.onBlur,onclick:this.onSelect,onfocus:this.onFocus,styles:{width:`${Math.round(e)}px`,height:`${Math.round(e)}px`,transform:`translate(${r(this.container),-50}%, -50%) rotateX(66deg) rotateZ(45deg)`},tabIndex:-1,title:this.label??"",type:"button"}))}};t([e({nonNullable:!0})],a.prototype,"level",void 0),t([e({nonNullable:!0})],a.prototype,"active",void 0),t([e({nonNullable:!0})],a.prototype,"hovering",void 0),t([e({nonNullable:!0})],a.prototype,"width",void 0),t([e({nonNullable:!0})],a.prototype,"height",void 0),t([e({nonNullable:!0})],a.prototype,"onSelect",void 0),t([e({nonNullable:!0})],a.prototype,"onFocus",void 0),t([e({nonNullable:!0})],a.prototype,"onBlur",void 0),a=t([o("esri.widgets.BuildingExplorer.BuildingLevelPicker.LevelItem")],a);export{a as LevelItem};