12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../TimeExtent.js";import r from"../../TimeInterval.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{clone as s}from"../../core/lang.js";import{isSome as n}from"../../core/maybe.js";import{setDeepValue as p}from"../../core/object.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../../core/accessorSupport/decorators/writer.js";var a;let c=a=class extends o{constructor(t){super(t),this.currentTimeExtent=null,this.fullTimeExtent=null,this.loop=!1,this.numStops=null,this.numThumbs=null,this.stopDelay=null,this.stopInterval=null,this.stops=null}readCurrentTimeExtent(t){if(!t)return;const r=null!=t[0]?new Date(t[0]):null,o=null!=t[1]?new Date(t[1]):null;return new e({start:r,end:o})}writeCurrentTimeExtent(t,e,r){t&&p(r,[n(t.start)?t.start.getTime():null,n(t.end)?t.end.getTime():null],e)}readFullTimeExtent(t,r){const o=r.properties;if(!o)return;const s=null!=o.endTime?new Date(o.endTime):null,n=null!=o.startTime?new Date(o.startTime):null;return new e({start:n,end:s})}writeFullTimeExtent(t,e){if(!t)return;const r=e.properties=e.properties||{},o=t.end,s=t.start;o&&(r.endTime=n(o)?o.getTime():null),s&&(r.startTime=n(s)?s.getTime():null)}readStopInterval(t,e,o){return t?r.fromJSON({value:t.interval,unit:t.units},o):null}writeStopInterval(t,e,r,o){if(!t)return;const s=t.toJSON(o);p(r,{interval:s.value,units:s.unit},e)}readStops(t){return t&&t.length?t.map((t=>new Date(t))):null}writeStops(t,e,r){t&&t.length&&p(r,t.map((t=>t.getTime())),e)}clone(){return new a(s({currentTimeExtent:this.currentTimeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:this.numStops,numThumbs:this.numThumbs,stopDelay:this.stopDelay,stopInterval:this.stopInterval,stops:this.stops}))}};t([i({type:e,json:{read:{source:"properties.currentTimeExtent"},write:{target:"properties.currentTimeExtent"}}})],c.prototype,"currentTimeExtent",void 0),t([l("currentTimeExtent")],c.prototype,"readCurrentTimeExtent",null),t([m("currentTimeExtent")],c.prototype,"writeCurrentTimeExtent",null),t([i({type:e,json:{read:{source:["properties.endTime","properties.startTime"]},write:{target:{"properties.endTime":{type:Number},"properties.startTime":{type:Number}}}}})],c.prototype,"fullTimeExtent",void 0),t([l("fullTimeExtent")],c.prototype,"readFullTimeExtent",null),t([m("fullTimeExtent")],c.prototype,"writeFullTimeExtent",null),t([i({type:Boolean,nonNullable:!0,json:{default:!1,read:{source:"properties.loop"},write:{target:"properties.loop"}}})],c.prototype,"loop",void 0),t([i({type:Number,json:{read:{source:"properties.numberOfStops"},write:{target:"properties.numberOfStops",overridePolicy(){const t=!!this.stopInterval,e=!!this.stops?.length,r=!(t||e);return{enabled:r,isRequired:r}}}}})],c.prototype,"numStops",void 0),t([i({type:[1,2],nonNullable:!0,json:{read:{source:"properties.thumbCount"},write:{target:"properties.thumbCount",isRequired:!0}}})],c.prototype,"numThumbs",void 0),t([i({type:Number,nonNullable:!0,json:{read:{source:"properties.thumbMovingRate"},write:{target:"properties.thumbMovingRate",isRequired:!0}}})],c.prototype,"stopDelay",void 0),t([i({type:r,json:{read:{source:"properties.timeStopInterval"},write:{target:"properties.timeStopInterval",overridePolicy(){const t=null!=this.numStops,e=!!this.stops?.length;return{enabled:!e,isRequired:!(t||e)}}}}})],c.prototype,"stopInterval",void 0),t([l("stopInterval")],c.prototype,"readStopInterval",null),t([m("stopInterval")],c.prototype,"writeStopInterval",null),t([i({type:[Date],json:{read:{source:"properties.stops"},write:{target:"properties.stops",overridePolicy(){return{isRequired:null==this.numStops&&!this.stopInterval}}}}})],c.prototype,"stops",void 0),t([l("stops")],c.prototype,"readStops",null),t([m("stops")],c.prototype,"writeStops",null),c=a=t([u("esri.webdoc.widgets.TimeSlider")],c);const d=c;export{d as default};
|