UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.19 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../Widget.js";import{storeNode as i,isRTL as r}from"../../support/widgetUtils.js";import{tsx as l}from"../../support/jsxFactory.js";const n="esri-building-level-picker-item",a={container:n,base:`${n}__base`,hover:`${n}--hover`,active:`${n}--active`};let h=class extends s{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 l("div",{bind:this,class:this.classes(a.container,{[a.active]:this.active,[a.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 l("div",{class:a.base,styles:{width:`${Math.round(t)}px`,height:`${Math.round(t)}px`}},l("button",{afterCreate:i,"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})],h.prototype,"level",void 0),t([e({nonNullable:!0})],h.prototype,"active",void 0),t([e({nonNullable:!0})],h.prototype,"hovering",void 0),t([e({nonNullable:!0})],h.prototype,"width",void 0),t([e({nonNullable:!0})],h.prototype,"height",void 0),t([e({nonNullable:!0})],h.prototype,"onSelect",void 0),t([e({nonNullable:!0})],h.prototype,"onFocus",void 0),t([e({nonNullable:!0})],h.prototype,"onBlur",void 0),h=t([o("esri.widgets.BuildingExplorer.BuildingLevelPicker.LevelItem")],h);export{h as LevelItem};