@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 3.33 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{__decorate as e}from"tslib";import{clamp as t}from"../../../core/mathUtils.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"../../Widget.js";import{css as n}from"../css.js";import{loadCalciteComponents as o}from"../../support/componentsUtils.js";import{tsx as a}from"../../support/widget.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 o({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 a("calcite-panel",{heading:this.uiStrings.configureNavigation,scale:"s"},a("calcite-list",{class:n.navigationSettingsUI,label:this.uiStrings.configureNavigation,scale:"s",selectionMode:"multiple"},a("calcite-list-item",{description:this.uiStrings.preserveHeadingDescription,label:this.uiStrings.preserveHeading,selected:this.preserveHeading,value:this.uiStrings.preserveHeading,onCalciteListItemSelect:this._handleHeadingToggle},a("calcite-label",{layout:"inline",scale:"s",slot:"content-bottom"},this.uiStrings.thresholdLabel,a("calcite-input",{max:30,min:0,scale:"s",type:"number",value:`${this.cameraHeadingThreshold}`,onCalciteInputChange:this._handleHeadingThresholdChange}))),a("calcite-list-item",{description:this.uiStrings.preservePitchDescription,label:this.uiStrings.preservePitch,selected:this.preservePitch,value:this.uiStrings.preservePitch,onCalciteListItemSelect:this._handlePitchToggle},a("calcite-label",{layout:"inline",scale:"s",slot:"content-bottom"},this.uiStrings.thresholdLabel,a("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};