UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 2.02 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */ import{__decorate as o}from"tslib";import{generateUUID as t}from"../../../core/uuid.js";import{property as e,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../Widget.js";import{durationConfiguratorCss as r}from"../css.js";import{ColorPicker as c}from"../../support/ColorPicker.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{messageBundle as n,tsx as a}from"../../support/widget.js";let p=class extends s{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="continuous"},this._setHourly=()=>{this.options.mode="hourly"}}loadDependencies(){return l({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:e}=this.options;return a("div",{class:r.base},a("calcite-label",{for:this._modeSelectorId,key:this._modeSelectorId,scale:"s"},o.modeLabel,a("div",{class:r.radioGroup},a(d,{active:"continuous"===e,label:o.continuousLabel,onclick:this._setContinuous}),a(d,{active:"hourly"===e,label:o.hourlyLabel,onclick:this._setHourly}))),this.colorPickerVisible?a("calcite-label",{for:this._colorPickerId,key:this._colorPickerId,layout:"inline",scale:"s"},a(c,{id:this._colorPickerId,value:t,onChange:this._onColorChange}),o.colorLabel):null)}};function d({active:o,label:t,...e}){return a("calcite-button",{alignment:"center",appearance:o?"solid":"outline",scale:"s",width:"full",...e},t)}o([e()],p.prototype,"options",void 0),o([e()],p.prototype,"colorPickerVisible",void 0),o([e(),n("esri/widgets/ShadowCast/t9n/ShadowCast")],p.prototype,"_messages",void 0),p=o([i("esri.widgets.ShadowCast.components.DurationConfigurator")],p);export{p as DurationConfigurator};