UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.63 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 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 i}from"../../../intl/duration.js";import r from"../../Widget.js";import{discreteConfiguratorCss as c}from"../css.js";import{ColorPicker as l}from"../../support/ColorPicker.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{messageBundle as n}from"../../support/decorators/messageBundle.js";import{tsx as p}from"../../support/jsxFactory.js";let m=class extends r{constructor(o){super(o),this.colorPickerVisible=!0,this.timeIntervalVisible=!0,this.colorPickerLabel=void 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:r}=this.options,{colorPickerLabel:a}=this;return p("div",{class:c.base},this.timeIntervalVisible?p("calcite-label",{for:this._selectId,key:this._selectId,scale:"s"},e,p("calcite-select",{bind:this,id:this._selectId,label:e,scale:"s",onCalciteSelectChange:this._onIntervalChange},r.toArray().map((o=>p("calcite-option",{key:o,selected:o===s,value:String(o)},i(o)))))):null,this.colorPickerVisible?p("calcite-label",{for:this._colorPickerId,key:this._colorPickerId,layout:"inline",scale:"s"},p(l,{id:this._colorPickerId,value:t,onChange:this._onColorChange}),a??o.colorLabel):null)}_onIntervalChange(o){const e=parseInt(o.currentTarget.selectedOption?.value,10);Number.isFinite(e)&&(this.options.interval=e)}};o([t()],m.prototype,"options",void 0),o([t()],m.prototype,"colorPickerVisible",void 0),o([t()],m.prototype,"timeIntervalVisible",void 0),o([t()],m.prototype,"colorPickerLabel",void 0),o([t(),n("esri/widgets/ShadowCast/t9n/ShadowCast")],m.prototype,"_messages",void 0),m=o([s("esri.widgets.ShadowCast.components.DiscreteConfigurator")],m);export{m as DiscreteConfigurator};