UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.34 kB
/* 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 t}from"../../../core/uuid.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import r from"../../Widget.js";import{durationConfiguratorCss as i}from"../css.js";import{DurationMode as c}from"../DurationMode.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 u=class extends r{constructor(o){super(o),this.colorPickerVisible=!0,this._modeSelectorId=`mode-selector-${t()}`,this._colorPickerId=`color-picker-${t()}`,this._onColorChange=o=>{this.options.color=o},this._setContinuous=()=>{this.options.mode=c.Continuous},this._setHourly=()=>{this.options.mode=c.Hourly}}loadDependencies(){return a({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}render(){const o=this._messages.duration,{color:t,mode:s}=this.options;return m("div",{class:i.base},m(l,{for:this._modeSelectorId,label:o.modeLabel},m("div",{class:i.radioGroup},m(d,{active:s===c.Continuous,label:o.continuousLabel,onclick:this._setContinuous}),m(d,{active:s===c.Hourly,label:o.hourlyLabel,onclick:this._setHourly}))),this.colorPickerVisible?m(n,{id:this._colorPickerId,label:o.colorLabel,value:t,onChange:this._onColorChange}):null)}};function d({active:o,label:t,...s}){return m("calcite-button",{alignment:"center",appearance:o?"solid":"outline",scale:"s",width:"full",...s},t)}o([s()],u.prototype,"options",void 0),o([s()],u.prototype,"colorPickerVisible",void 0),o([s(),p("esri/widgets/ShadowCast/t9n/ShadowCast")],u.prototype,"_messages",void 0),u=o([e("esri.widgets.ShadowCast.components.DurationConfigurator")],u);export{u as DurationConfigurator};