UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 3.6 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 e}from"../../../chunks/tslib.es6.js";import{clamp as t}from"../../../core/mathUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import r from"../../Widget.js";import{css as o}from"../css.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/jsxFactory.js";const c=5;let h=class extends r{constructor(e){super(e),this.cameraHeadingThreshold=c,this.cameraPitchThreshold=c,this.uiStrings=null,this.preserveHeading=!1,this.preservePitch=!1,this._handleHeadingThresholdChange=e=>{this.cameraHeadingThreshold=+e.target.value,this.onInputChange?.("cameraHeading",this.cameraHeadingThreshold)},this._handleHeadingToggle=()=>{const{preserveHeading:e,preservePitch:t}=this;this.preserveHeading=!e,this.onToggle?.(this.preserveHeading?t?"both":"heading":t?"pitch":"none")},this._handlePitchThresholdChange=e=>{this.cameraPitchThreshold=+e.target.value,this.onInputChange?.("cameraPitch",this.cameraPitchThreshold)},this._handlePitchToggle=()=>{const{preserveHeading:e,preservePitch:t}=this;this.preservePitch=!t,this.onToggle?.(this.preservePitch?e?"both":"pitch":e?"heading":"none")}}loadDependencies(){return a({label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}static{this.vnodeSelector="calcite-panel"}render(){return n("calcite-panel",{heading:this.uiStrings.configureNavigation,scale:"s"},n("calcite-list",{class:o.navigationSettingsUI,label:this.uiStrings.configureNavigation,scale:"s",selectionMode:"multiple"},n("calcite-list-item",{description:this.uiStrings.preserveHeadingDescription,label:this.uiStrings.preserveHeading,selected:this.preserveHeading,value:this.uiStrings.preserveHeading,onCalciteListItemSelect:this._handleHeadingToggle},n("calcite-label",{layout:"inline",scale:"s",slot:"content-bottom"},this.uiStrings.thresholdLabel,n("calcite-input",{max:30,min:0,scale:"s",type:"number",value:`${this.cameraHeadingThreshold}`,onCalciteInputChange:this._handleHeadingThresholdChange}))),n("calcite-list-item",{description:this.uiStrings.preservePitchDescription,label:this.uiStrings.preservePitch,selected:this.preservePitch,value:this.uiStrings.preservePitch,onCalciteListItemSelect:this._handlePitchToggle},n("calcite-label",{layout:"inline",scale:"s",slot:"content-bottom"},this.uiStrings.thresholdLabel,n("calcite-input",{max:30,min:0,scale:"s",type:"number",value:`${this.cameraPitchThreshold}`,onCalciteInputChange:this._handlePitchThresholdChange})))))}};e([i({cast:e=>t(e,0,30)})],h.prototype,"cameraHeadingThreshold",void 0),e([i()],h.prototype,"onInputChange",void 0),e([i()],h.prototype,"onToggle",void 0),e([i({cast:e=>t(e,0,30)})],h.prototype,"cameraPitchThreshold",void 0),e([i()],h.prototype,"uiStrings",void 0),e([i()],h.prototype,"preserveHeading",void 0),e([i()],h.prototype,"preservePitch",void 0),h=e([s("esri.widgets.OrientedImageryViewer.components.NavigationSettings")],h);const l=h;export{l as default};