@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.31 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{_ as o}from"../../../chunks/tslib.es6.js";import{generateUUID as e}from"../../../core/uuid.js";import{property as t}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{formatDuration as r}from"../../../intl/duration.js";import i from"../../Widget.js";import{discreteConfiguratorCss as c}from"../css.js";import{Label as l}from"./Label.js";import{LabeledColorPicker as n}from"./LabeledColorPicker.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{messageBundle as p}from"../../support/decorators/messageBundle.js";import{tsx as m}from"../../support/jsxFactory.js";let d=class extends i{constructor(o){super(o),this.colorPickerVisible=!0,this._selectId=`select-${e()}`,this._colorPickerId=`color-picker-${e()}`,this._onColorChange=o=>{this.options.color=o}}loadDependencies(){return a({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 o=this._messages.discrete,e=o.intervalLabel,{color:t,interval:s,intervalOptions:i}=this.options;return m("div",{class:c.base},m(l,{for:this._selectId,label:e},m("calcite-select",{bind:this,id:this._selectId,label:e,onCalciteSelectChange:this._onIntervalChange},i.toArray().map((o=>m("calcite-option",{key:o,selected:o===s,value:String(o)},r(o)))))),this.colorPickerVisible?m(n,{id:this._colorPickerId,label:o.colorLabel,value:t,onChange:this._onColorChange}):null)}_onIntervalChange(o){const e=parseInt(o.currentTarget.selectedOption?.value,10);Number.isFinite(e)&&(this.options.interval=e)}};o([t()],d.prototype,"options",void 0),o([t()],d.prototype,"colorPickerVisible",void 0),o([t(),p("esri/widgets/ShadowCast/t9n/ShadowCast")],d.prototype,"_messages",void 0),d=o([s("esri.widgets.ShadowCast.components.DiscreteConfigurator")],d);export{d as DiscreteConfigurator};