@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.8 kB
JavaScript
/*
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{isMeasurementSystem as t}from"../../core/unitUtils.js";import{property as o}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{loadCalciteComponents as c}from"./componentsUtils.js";import"./widgetUtils.js";import{messageBundle as i}from"./decorators/messageBundle.js";import{tsx as l}from"./jsxFactory.js";const a="esri-unit-select",p={base:a,label:`${a}__label`,select:`${a}__select`};let n=class extends r{constructor(e,t){super(e,t),this._onSelectChange=e=>{this.onChange(e.currentTarget.value)}}loadDependencies(){return c({label:()=>import("@esri/calcite-components/dist/components/calcite-label"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}render(){const{messages:e,options:o,selectLabel:s,value:r,_onSelectChange:c}=this;return l("div",{class:p.base,key:"units"},l("calcite-label",{class:p.label},s,l("calcite-select",{class:p.select,label:s,onCalciteSelectChange:c},o.map((o=>l("calcite-option",{key:o,selected:o===r,value:o},t(o)?e.systems[o]:e.units[o]?.pluralCapitalized))))))}};e([o()],n.prototype,"options",void 0),e([o()],n.prototype,"onChange",void 0),e([o()],n.prototype,"selectLabel",void 0),e([o()],n.prototype,"value",void 0),e([o(),i("esri/core/t9n/Units")],n.prototype,"messages",void 0),n=e([s("esri.widgets.support.UnitSelect")],n);export{n as UnitSelect};