@arcgis/map-components 5.1.0-next.101 → 5.1.0-next.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{3EF4MN6L.js → 42YT33SI.js} +1 -1
- package/dist/cdn/{J3MFZHTJ.js → 4P5SOHAK.js} +1 -1
- package/dist/cdn/{VD5IUHXQ.js → 4T6TILWS.js} +1 -1
- package/dist/cdn/{SFXP3DOP.js → 5CVCIDET.js} +1 -1
- package/dist/cdn/5F4QQFMV.js +2 -0
- package/dist/cdn/{IQHG6OT4.js → 5FHYTVXJ.js} +1 -1
- package/dist/cdn/{SEJ6JCXN.js → 6SLFSRO3.js} +1 -1
- package/dist/cdn/{5AY6FU6R.js → 6U7WM64M.js} +1 -1
- package/dist/cdn/{MFXNJZSL.js → 7MG2HVHJ.js} +1 -1
- package/dist/cdn/{7UZP3RBC.js → AWQHNAWY.js} +1 -1
- package/dist/cdn/{TZKT637Q.js → C5RCUSYN.js} +1 -1
- package/dist/cdn/CKK5QADX.js +2 -0
- package/dist/cdn/{GHISRID5.js → D4ATYXZL.js} +1 -1
- package/dist/cdn/DTIC27TR.js +2 -0
- package/dist/cdn/{5FEFHUMM.js → DWWDCRDK.js} +1 -1
- package/dist/cdn/{6QTNDMTM.js → EE4OHTHH.js} +1 -1
- package/dist/cdn/FBVHVWJP.js +2 -0
- package/dist/cdn/FM2ZJK25.js +2 -0
- package/dist/cdn/{ZYG4YNMK.js → GAWULXAQ.js} +1 -1
- package/dist/cdn/{CY5MXN4Q.js → GBHDATFS.js} +1 -1
- package/dist/cdn/{GZSSBAS6.js → HIYCE253.js} +1 -1
- package/dist/cdn/{MGLV5EEI.js → HVKDLP74.js} +1 -1
- package/dist/cdn/{XSZJFT45.js → HW3D7A2P.js} +1 -1
- package/dist/cdn/{K6JERTMI.js → I7HKS77T.js} +1 -1
- package/dist/cdn/ICIX7OQK.js +2 -0
- package/dist/cdn/JW6K33EY.js +2 -0
- package/dist/cdn/LFFZNI4J.js +2 -0
- package/dist/cdn/{5VV4YRMW.js → LNB4R35D.js} +1 -1
- package/dist/cdn/{P27CM5PI.js → M2ECO3EZ.js} +1 -1
- package/dist/cdn/{T5YUD4HI.js → MLD4FBFB.js} +1 -1
- package/dist/cdn/{SBWTPIZH.js → NWLO4YJB.js} +1 -1
- package/dist/cdn/{KEKKHAC3.js → OGV2KLWY.js} +1 -1
- package/dist/cdn/{RQQW45SO.js → P36R3KMU.js} +1 -1
- package/dist/cdn/{7KIORSA4.js → PO4N3MEU.js} +1 -1
- package/dist/cdn/{KGWDZNHG.js → SKRNQKVO.js} +1 -1
- package/dist/cdn/{DU33A6QD.js → T2RNAPRO.js} +1 -1
- package/dist/cdn/{JTZZY6SL.js → TQA6ARSR.js} +1 -1
- package/dist/cdn/{2M7OVKOX.js → UCPJMQPU.js} +1 -1
- package/dist/cdn/{YNGHIC64.js → UNFS72TS.js} +1 -1
- package/dist/cdn/UW5RUFDI.js +2 -0
- package/dist/cdn/{HYNB4OPZ.js → VDSKVXIQ.js} +1 -1
- package/dist/cdn/{PWCOBDBK.js → VSZ3LZA2.js} +1 -1
- package/dist/cdn/{FJYJ55I6.js → X6BCGFB3.js} +1 -1
- package/dist/cdn/{CUJU6FOW.js → YGYGCNWI.js} +1 -1
- package/dist/cdn/{ZVTZRBDZ.js → Z5RIW77H.js} +1 -1
- package/dist/cdn/ZDOE5UWP.js +2 -0
- package/dist/cdn/assets/search/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/search/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/slider-time/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/slider-time/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/unit-select/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/utility-network-trace-results/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/async-utils.js +63 -51
- package/dist/chunks/slots.js +3 -3
- package/dist/chunks/sr.js +6 -0
- package/dist/chunks/time-utils.js +27 -15
- package/dist/components/arcgis-bookmarks/customElement.d.ts +3 -0
- package/dist/components/arcgis-bookmarks/customElement.js +51 -50
- package/dist/components/arcgis-coordinate-conversion/customElement.js +6 -6
- package/dist/components/arcgis-daylight/customElement.js +1 -1
- package/dist/components/arcgis-legend/customElement.js +1 -1
- package/dist/components/arcgis-scale-range-slider/customElement.d.ts +5 -0
- package/dist/components/arcgis-search/customElement.d.ts +6 -0
- package/dist/components/arcgis-search/customElement.js +39 -35
- package/dist/components/arcgis-slider-time/customElement.d.ts +868 -0
- package/dist/components/arcgis-slider-time/customElement.js +740 -0
- package/dist/components/arcgis-slider-time/index.d.ts +1 -0
- package/dist/components/arcgis-slider-time/index.js +8 -0
- package/dist/components/arcgis-slider-time/types.d.ts +147 -0
- package/dist/components/arcgis-time-slider/customElement.d.ts +2 -1
- package/dist/components/arcgis-time-slider/customElement.js +2 -2
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +18 -6
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-results/customElement.d.ts +3 -0
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +13 -9
- package/dist/components/arcgis-utility-network-validate-network-topology/customElement.js +1 -1
- package/dist/components/arcgis-volume-measurement/customElement.d.ts +1 -3
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/loader.js +2 -1
- package/dist/types/lumina.d.ts +9 -1
- package/dist/types/preact.d.ts +10 -1
- package/dist/types/react.d.ts +11 -1
- package/dist/types/stencil.d.ts +9 -1
- package/package.json +5 -5
- package/dist/cdn/5L6QRSD5.js +0 -2
- package/dist/cdn/6S6N2CNY.js +0 -2
- package/dist/cdn/IQPGSWSL.js +0 -2
- package/dist/cdn/IU2X5JKR.js +0 -2
- package/dist/cdn/L7LTDZU6.js +0 -2
- package/dist/cdn/OSRU2RUW.js +0 -2
- package/dist/cdn/RBTK5IMU.js +0 -2
- package/dist/cdn/YFFIRY3F.js +0 -2
|
@@ -0,0 +1,740 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { c as N } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as y } from "lit/directives/keyed.js";
|
|
4
|
+
import { usePropertyChange as H } from "@arcgis/lumina/controllers";
|
|
5
|
+
import { LitElement as q, createEvent as F, nothing as S, safeClassMap as G } from "@arcgis/lumina";
|
|
6
|
+
import { classes as U } from "@arcgis/toolkit/dom";
|
|
7
|
+
import { u as Y } from "../../chunks/useT9n.js";
|
|
8
|
+
import { css as J, html as l } from "lit";
|
|
9
|
+
import p from "@arcgis/core/time/TimeExtent.js";
|
|
10
|
+
import C from "@arcgis/core/time/TimeInterval.js";
|
|
11
|
+
import K from "@arcgis/core/core/Accessor.js";
|
|
12
|
+
import { property as h, subclass as Q } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
13
|
+
import { log as Z } from "@arcgis/toolkit/log";
|
|
14
|
+
import { u as X, r as tt } from "../../chunks/time-utils.js";
|
|
15
|
+
import { offsetDate as j, truncateDate as et } from "@arcgis/core/core/timeUtils.js";
|
|
16
|
+
import { watch as w, whenOnce as M } from "@arcgis/core/core/reactiveUtils.js";
|
|
17
|
+
import { convertDateFormatToIntlOptions as P } from "@arcgis/core/intl.js";
|
|
18
|
+
import it from "@arcgis/core/webdoc/Widgets.js";
|
|
19
|
+
import st from "@arcgis/core/webdoc/widgets/TimeSlider.js";
|
|
20
|
+
import { b as nt, d as at, i as rt } from "../../chunks/async-utils.js";
|
|
21
|
+
import { getTimeSliderSettingsFromWebDocument as ot } from "@arcgis/core/support/timeUtils.js";
|
|
22
|
+
import { m as lt } from "../../chunks/useViewModel.js";
|
|
23
|
+
import { createRef as _, ref as b } from "lit/directives/ref.js";
|
|
24
|
+
import { m as ct } from "../../chunks/handle.js";
|
|
25
|
+
import "@arcgis/core/core/Collection.js";
|
|
26
|
+
const mt = J`:host{background-color:var(--calcite-color-foreground-1);box-shadow:var(--arcgis-internal-box-shadow, var(--calcite-shadow-sm));box-sizing:border-box;color:var(--calcite-color-text-2);display:flex;flex-direction:column;flex-wrap:nowrap;font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight);overflow:visible;transition:max-height .25s ease-in-out}:host([disabled]){.max,.min,.time-extent{opacity:var(--calcite-opacity-disabled)}}.wide{min-width:800px;.max,.min,.time-extent{align-items:center;width:calc(var(--calcite-size-lg) * 2.5)}.play{flex:0 0 var(--calcite-size-xxl)}.playback-controls{direction:ltr;display:flex;flex:auto}.previous,.next{flex:0 0 var(--calcite-size-lg)}.row{display:flex;height:calc(var(--calcite-size-lg) * 2)}.slider{flex:1;margin-top:calc(var(--calcite-size-fixed-md) * -1)}.time-extent{display:flex;flex-flow:column nowrap;flex:0 0 auto;font-size:var(--calcite-font-size-sm);justify-content:center;line-height:var(--calcite-font-line-height-relative-tight)}.time-extent-separator{height:var(--calcite-size-px);margin-bottom:var(--calcite-spacing-fixed-xs);margin-top:var(--calcite-spacing-fixed-xxs);opacity:var(--calcite-opacity-disabled);width:75%}.warning{flex-flow:column nowrap}.action-menu,.actions,.min,.previous,.time-extent{border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-1)}}.compact{min-width:375px;.action-menu{margin-inline-start:auto}.max,.min{flex:1 0 auto}.max{align-items:flex-end;margin-inline-end:var(--calcite-size-md)}.min{align-items:flex-start;margin-inline-start:var(--calcite-size-md)}.play,.previous,.next{flex:0 0 var(--calcite-size-md)}.row1,.row2,.row3{display:flex}.row1,.row3{height:calc(var(--calcite-size-md) * 1.1)}.row1{align-items:center;position:relative}.row2{height:var(--calcite-size-xxl)}.row3{direction:ltr}.slider{margin-top:calc(var(--calcite-spacing-fixed-sm) * -1)}.time-extent{align-items:center;display:flex;flex-flow:row nowrap;flex:auto;justify-content:center;left:50%;position:absolute;transform:translate(-50%);white-space:nowrap}.time-extent-separator{height:var(--calcite-size-sm);margin-inline:var(--calcite-spacing-fixed-sm);opacity:var(--calcite-opacity-disabled);width:var(--calcite-size-px)}.warning{flex-flow:row nowrap}.warning-label{margin-inline-start:var(--calcite-spacing-xs)}}.max,.min{display:flex;flex-flow:column nowrap;justify-content:center}.max-date,.min-date,.max-time,.min-time{--calcite-label-margin-bottom: 0}.max-date,.min-date{font-weight:var(--calcite-font-weight-bold)}.out-of-range{.slider{--calcite-color-border-2: var(--calcite-color-status-danger)}}.slider{--labels-container-width: 100%}.slider-container{display:flex;background-color:var(--calcite-color-foreground-2);flex:1}.slider-parent{display:flex;flex:1;margin-inline:var(--calcite-spacing-fixed-xxxl)}.slider-ticks-container{flex:1;position:relative;width:100%}.slider-custom-ticks,.slider-major-ticks,.slider-minor-ticks{inset:0;position:absolute}.slider-major-ticks,.slider-minor-ticks{--arcgis-ticks-tick-transform: unset;--arcgis-ticks-tick-width: var(--calcite-size-px)}.slider-minor-ticks{--arcgis-ticks-tick-length: var(--calcite-size-fixed-xxs)}.slider-major-ticks{--arcgis-ticks-font-weight: var(--calcite-font-weight-normal)}.time-extent-end-group,.time-extent-start-group{align-items:center;display:flex;flex-flow:column nowrap}.time-extent-end-date,.time-extent-start-date,.time-extent-end-time,.time-extent-start-time{--calcite-label-margin-bottom: 0;--calcite-label-text-color: var(--calcite-color-brand)}.time-extent-end-date,.time-extent-start-date{font-weight:var(--calcite-font-weight-bold)}.time-extent-separator{background-color:var(--calcite-color-brand)}.warning{align-items:center;display:flex;justify-content:center}.warning-label{--calcite-label-margin-bottom: 0;--calcite-label-text-color: var(--calcite-color-status-danger)}.warning-icon{--calcite-icon-color: var(--calcite-color-status-danger)}:dir(rtl){.max-date,.max-time,.min-date,.min-time,.slider,.time-extent-end-date,.time-extent-end-time,.time-extent-start-date,.time-extent-start-time{direction:rtl}}`, n = (e, t, i) => ({ minorTick: e, majorTick: t, majorTickFormat: i }), a = {
|
|
27
|
+
sf: { second: "numeric", fractionalSecondDigits: 3 },
|
|
28
|
+
s: { second: "numeric" },
|
|
29
|
+
ms: { minute: "numeric", second: "numeric" },
|
|
30
|
+
mi: { minute: "numeric" },
|
|
31
|
+
hm: { hour: "numeric", minute: "numeric" },
|
|
32
|
+
dm: { day: "numeric", month: "short" },
|
|
33
|
+
m: { month: "short" },
|
|
34
|
+
my: { month: "short", year: "numeric" },
|
|
35
|
+
y: { year: "numeric" }
|
|
36
|
+
}, ut = [
|
|
37
|
+
n({ value: 1, unit: "milliseconds" }, { value: 20, unit: "milliseconds" }, a.sf),
|
|
38
|
+
n({ value: 2, unit: "milliseconds" }, { value: 50, unit: "milliseconds" }, a.sf),
|
|
39
|
+
n({ value: 5, unit: "milliseconds" }, { value: 100, unit: "milliseconds" }, a.sf),
|
|
40
|
+
n({ value: 10, unit: "milliseconds" }, { value: 200, unit: "milliseconds" }, a.sf),
|
|
41
|
+
n({ value: 20, unit: "milliseconds" }, { value: 500, unit: "milliseconds" }, a.sf),
|
|
42
|
+
n({ value: 50, unit: "milliseconds" }, { value: 1, unit: "seconds" }, a.s),
|
|
43
|
+
n({ value: 100, unit: "milliseconds" }, { value: 2, unit: "seconds" }, a.s),
|
|
44
|
+
n({ value: 200, unit: "milliseconds" }, { value: 5, unit: "seconds" }, a.s),
|
|
45
|
+
n({ value: 500, unit: "milliseconds" }, { value: 10, unit: "seconds" }, a.s),
|
|
46
|
+
n({ value: 1, unit: "seconds" }, { value: 20, unit: "seconds" }, a.ms),
|
|
47
|
+
n({ value: 2, unit: "seconds" }, { value: 30, unit: "seconds" }, a.ms),
|
|
48
|
+
n({ value: 5, unit: "seconds" }, { value: 1, unit: "minutes" }, a.mi),
|
|
49
|
+
n({ value: 10, unit: "seconds" }, { value: 2, unit: "minutes" }, a.mi),
|
|
50
|
+
n({ value: 20, unit: "seconds" }, { value: 5, unit: "minutes" }, a.mi),
|
|
51
|
+
n({ value: 40, unit: "seconds" }, { value: 10, unit: "minutes" }, a.mi),
|
|
52
|
+
n({ value: 1, unit: "minutes" }, { value: 30, unit: "minutes" }, a.hm),
|
|
53
|
+
n({ value: 2, unit: "minutes" }, { value: 1, unit: "hours" }, a.hm),
|
|
54
|
+
n({ value: 5, unit: "minutes" }, { value: 2, unit: "hours" }, a.hm),
|
|
55
|
+
n({ value: 10, unit: "minutes" }, { value: 4, unit: "hours" }, a.hm),
|
|
56
|
+
n({ value: 20, unit: "minutes" }, { value: 8, unit: "hours" }, a.hm),
|
|
57
|
+
n({ value: 40, unit: "minutes" }, { value: 12, unit: "hours" }, a.hm),
|
|
58
|
+
n({ value: 1, unit: "hours" }, { value: 1, unit: "days" }, a.dm),
|
|
59
|
+
n({ value: 2, unit: "hours" }, { value: 2, unit: "days" }, a.dm),
|
|
60
|
+
n({ value: 5, unit: "hours" }, { value: 4, unit: "days" }, a.dm),
|
|
61
|
+
n({ value: 10, unit: "hours" }, { value: 10, unit: "days" }, a.dm),
|
|
62
|
+
n({ value: 20, unit: "hours" }, { value: 15, unit: "days" }, a.dm),
|
|
63
|
+
n({ value: 1, unit: "days" }, { value: 20, unit: "days" }, a.dm),
|
|
64
|
+
n({ value: 2, unit: "days" }, { value: 1, unit: "months" }, a.m),
|
|
65
|
+
n({ value: 5, unit: "days" }, { value: 3, unit: "months" }, a.m),
|
|
66
|
+
n({ value: 10, unit: "days" }, { value: 6, unit: "months" }, a.my),
|
|
67
|
+
n({ value: 20, unit: "days" }, { value: 1, unit: "years" }, a.y),
|
|
68
|
+
n({ value: 1, unit: "months" }, { value: 2, unit: "years" }, a.y),
|
|
69
|
+
n({ value: 2, unit: "months" }, { value: 4, unit: "years" }, a.y),
|
|
70
|
+
n({ value: 5, unit: "months" }, { value: 10, unit: "years" }, a.y),
|
|
71
|
+
n({ value: 1, unit: "years" }, { value: 20, unit: "years" }, a.y),
|
|
72
|
+
n({ value: 2, unit: "years" }, { value: 50, unit: "years" }, a.y),
|
|
73
|
+
n({ value: 5, unit: "years" }, { value: 100, unit: "years" }, a.y),
|
|
74
|
+
n({ value: 10, unit: "years" }, { value: 200, unit: "years" }, a.y),
|
|
75
|
+
n({ value: 20, unit: "years" }, { value: 500, unit: "years" }, a.y),
|
|
76
|
+
n({ value: 50, unit: "years" }, { value: 1e3, unit: "years" }, a.y),
|
|
77
|
+
n({ value: 1, unit: "centuries" }, { value: 20, unit: "centuries" }, a.y),
|
|
78
|
+
n({ value: 2, unit: "centuries" }, { value: 50, unit: "centuries" }, a.y),
|
|
79
|
+
n({ value: 5, unit: "centuries" }, { value: 100, unit: "centuries" }, a.y),
|
|
80
|
+
n({ value: 10, unit: "centuries" }, { value: 200, unit: "centuries" }, a.y),
|
|
81
|
+
n({ value: 20, unit: "centuries" }, { value: 500, unit: "centuries" }, a.y),
|
|
82
|
+
n({ value: 50, unit: "centuries" }, { value: 1e3, unit: "centuries" }, a.y),
|
|
83
|
+
n({ value: 100, unit: "centuries" }, { value: 2e3, unit: "centuries" }, a.y),
|
|
84
|
+
n({ value: 200, unit: "centuries" }, { value: 5e3, unit: "centuries" }, a.y),
|
|
85
|
+
n({ value: 500, unit: "centuries" }, { value: 1e4, unit: "centuries" }, a.y),
|
|
86
|
+
n({ value: 1e3, unit: "centuries" }, { value: 2e4, unit: "centuries" }, a.y)
|
|
87
|
+
];
|
|
88
|
+
function dt(e) {
|
|
89
|
+
return ut.map(({ minorTick: t, majorTick: i, majorTickFormat: s }, r) => {
|
|
90
|
+
const o = new C(t), m = new C(i), c = o.toMilliseconds(), v = {
|
|
91
|
+
...s,
|
|
92
|
+
timeZone: e
|
|
93
|
+
};
|
|
94
|
+
return { minor: o, major: m, duration: c, format: v, index: r };
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function ht(e) {
|
|
98
|
+
return e === "position" ? "value" : e;
|
|
99
|
+
}
|
|
100
|
+
const k = { count: 10 };
|
|
101
|
+
function vt(e) {
|
|
102
|
+
return W(e) && e.interval.unit === X ? (Z(
|
|
103
|
+
"warn",
|
|
104
|
+
"arcgis-slider-time",
|
|
105
|
+
'A stop interval with an "unknown" time unit is not supported. The default stop definition will be used.'
|
|
106
|
+
), k) : e;
|
|
107
|
+
}
|
|
108
|
+
function O(e) {
|
|
109
|
+
return !!e && "count" in e;
|
|
110
|
+
}
|
|
111
|
+
function A(e) {
|
|
112
|
+
return !!e && "dates" in e;
|
|
113
|
+
}
|
|
114
|
+
function W(e) {
|
|
115
|
+
return !!e && "interval" in e;
|
|
116
|
+
}
|
|
117
|
+
const I = 1e4;
|
|
118
|
+
function D(e, t) {
|
|
119
|
+
const { start: i, end: s } = e;
|
|
120
|
+
if (!i || !s || i.getTime() > s.getTime() || t <= 0)
|
|
121
|
+
return [];
|
|
122
|
+
if (t > I)
|
|
123
|
+
return D(e, k.count);
|
|
124
|
+
const r = [], o = i.getTime(), c = s.getTime() - o;
|
|
125
|
+
for (let v = 0; v <= t; v++)
|
|
126
|
+
r.push(new Date(o + v / t * c));
|
|
127
|
+
return r;
|
|
128
|
+
}
|
|
129
|
+
function ft(e, t) {
|
|
130
|
+
const { start: i, end: s } = e, { value: r, unit: o } = t;
|
|
131
|
+
if (!i || !s || i.getTime() > s.getTime() || r <= 0)
|
|
132
|
+
return [];
|
|
133
|
+
const m = s.getTime() - i.getTime(), c = t.toMilliseconds();
|
|
134
|
+
if (c <= 0 || m / c > I)
|
|
135
|
+
return D(e, k.count);
|
|
136
|
+
const v = [];
|
|
137
|
+
let g = i;
|
|
138
|
+
for (; g.getTime() <= s.getTime(); )
|
|
139
|
+
v.push(new Date(g)), g = j(g, r, o);
|
|
140
|
+
return v;
|
|
141
|
+
}
|
|
142
|
+
function z(e, t) {
|
|
143
|
+
const [i, s] = e;
|
|
144
|
+
if (i)
|
|
145
|
+
switch (t) {
|
|
146
|
+
case "time-window":
|
|
147
|
+
return s ? new p({ start: i, end: s }) : void 0;
|
|
148
|
+
case "cumulative-from-start":
|
|
149
|
+
return new p({ start: null, end: i });
|
|
150
|
+
case "cumulative-from-end":
|
|
151
|
+
return new p({ start: i, end: null });
|
|
152
|
+
case "instant":
|
|
153
|
+
return new p({ start: i, end: i });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function pt(e, t, i, s) {
|
|
157
|
+
const { value: r, unit: o } = i;
|
|
158
|
+
if (e.getTime() > t.getTime() || r <= 0 || o === "unknown")
|
|
159
|
+
return [];
|
|
160
|
+
let m = et(e, i, s);
|
|
161
|
+
const c = [];
|
|
162
|
+
for (; m.getTime() <= t.getTime(); )
|
|
163
|
+
m.getTime() >= e.getTime() && c.push(m), m = j(m, r, o, s);
|
|
164
|
+
return c;
|
|
165
|
+
}
|
|
166
|
+
const L = /* @__PURE__ */ new WeakMap();
|
|
167
|
+
function gt(e) {
|
|
168
|
+
const { locale: t, formatOptions: i } = e, s = yt(i), r = new Intl.DateTimeFormat(t, s);
|
|
169
|
+
return L.set(e, r), r;
|
|
170
|
+
}
|
|
171
|
+
function xt(e) {
|
|
172
|
+
return L.get(e) ?? gt(e);
|
|
173
|
+
}
|
|
174
|
+
function yt(e) {
|
|
175
|
+
return e.timeZone ? {
|
|
176
|
+
...e,
|
|
177
|
+
timeZone: tt(e.timeZone)
|
|
178
|
+
} : e;
|
|
179
|
+
}
|
|
180
|
+
var wt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, V = (e) => {
|
|
181
|
+
throw TypeError(e);
|
|
182
|
+
}, d = (e, t, i, s) => {
|
|
183
|
+
for (var r = s > 1 ? void 0 : s ? Tt(t, i) : t, o = e.length - 1, m; o >= 0; o--)
|
|
184
|
+
(m = e[o]) && (r = (s ? m(t, i, r) : m(r)) || r);
|
|
185
|
+
return s && r && wt(t, i, r), r;
|
|
186
|
+
}, B = (e, t, i) => t.has(e) || V("Cannot " + i), E = (e, t, i) => (B(e, t, "read from private field"), i ? i.call(e) : t.get(e)), R = (e, t, i) => t.has(e) ? V("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), _t = (e, t, i, s) => (B(e, t, "write to private field"), t.set(e, i), i), T, $;
|
|
187
|
+
let u = class extends K {
|
|
188
|
+
constructor() {
|
|
189
|
+
super(...arguments), R(this, T, new AbortController()), R(this, $, !1), this.loadPersistedSettingsDisabled = !1, this.loop = !1, this.mode = "time-window", this.savePersistedSettingsDisabled = !1, this.stops = k;
|
|
190
|
+
}
|
|
191
|
+
get _adjustedMajorTickFormat() {
|
|
192
|
+
const { era: e, timeZone: t } = this;
|
|
193
|
+
return {
|
|
194
|
+
...this.majorTickFormat,
|
|
195
|
+
era: this.majorTickFormat?.year ? e : void 0,
|
|
196
|
+
timeZone: t
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
get _dateFormat() {
|
|
200
|
+
const { era: e, timeZone: t } = this;
|
|
201
|
+
return { ...P("short-date"), era: e, timeZone: t };
|
|
202
|
+
}
|
|
203
|
+
get _effectiveStopValues() {
|
|
204
|
+
return this.effectiveStops?.map((e) => e.getTime()) ?? null;
|
|
205
|
+
}
|
|
206
|
+
get _thumbPositions() {
|
|
207
|
+
if (!this.timeExtent || this.timeExtent.isAllTime || this.timeExtent.isEmpty)
|
|
208
|
+
return null;
|
|
209
|
+
const { start: e, end: t } = this.timeExtent;
|
|
210
|
+
switch (this.mode) {
|
|
211
|
+
case "cumulative-from-end":
|
|
212
|
+
case "instant":
|
|
213
|
+
return e ? [e.getTime()] : null;
|
|
214
|
+
case "cumulative-from-start":
|
|
215
|
+
return t ? [t.getTime()] : null;
|
|
216
|
+
case "time-window":
|
|
217
|
+
return e && t ? [e.getTime(), t.getTime()] : null;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
get _timeFormat() {
|
|
221
|
+
const { timeZone: e } = this;
|
|
222
|
+
return { ...P("long-time"), timeZone: e };
|
|
223
|
+
}
|
|
224
|
+
get effectiveStops() {
|
|
225
|
+
const { fullTimeExtent: e, stops: t } = this;
|
|
226
|
+
if (!t)
|
|
227
|
+
return [];
|
|
228
|
+
if (A(t)) {
|
|
229
|
+
const { dates: s } = t;
|
|
230
|
+
if (!s?.length)
|
|
231
|
+
return;
|
|
232
|
+
const r = s.sort((x, f) => x.getTime() - f.getTime());
|
|
233
|
+
if (!e?.start || !e?.end)
|
|
234
|
+
return r;
|
|
235
|
+
const { start: o, end: m } = e, c = o.getTime(), v = m.getTime();
|
|
236
|
+
return r.filter((x) => {
|
|
237
|
+
const f = x.getTime();
|
|
238
|
+
return f >= c && f <= v;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const i = t.timeExtent ?? e;
|
|
242
|
+
if (i)
|
|
243
|
+
return O(t) ? D(i, t.count) : ft(i, t.interval);
|
|
244
|
+
}
|
|
245
|
+
get era() {
|
|
246
|
+
return (this.fullTimeExtent?.start?.getFullYear() ?? 0) < 0 ? "short" : void 0;
|
|
247
|
+
}
|
|
248
|
+
get majorTickFormatter() {
|
|
249
|
+
return (e) => this._formatDate(e, this._adjustedMajorTickFormat);
|
|
250
|
+
}
|
|
251
|
+
set playRate(e) {
|
|
252
|
+
e <= 0 || e > 1e3 * 60 * 60 || (this.state === "playing" && this._startAnimation(), this._set("playRate", e));
|
|
253
|
+
}
|
|
254
|
+
get state() {
|
|
255
|
+
return this.fullTimeExtent ? this._animationController ? "playing" : "ready" : "disabled";
|
|
256
|
+
}
|
|
257
|
+
get tickFormats() {
|
|
258
|
+
return dt(this.timeZone);
|
|
259
|
+
}
|
|
260
|
+
get timeZone() {
|
|
261
|
+
return this._userTimeZone ?? this.viewTimeZone ?? "system";
|
|
262
|
+
}
|
|
263
|
+
set timeZone(e) {
|
|
264
|
+
this._userTimeZone = e ?? void 0;
|
|
265
|
+
}
|
|
266
|
+
get viewTimeZone() {
|
|
267
|
+
return this.view?.type === "2d" ? this.view.timeZone : void 0;
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region Public Methods
|
|
271
|
+
destroy() {
|
|
272
|
+
E(this, T).abort(), this.view?.unregisterComponent(this), this._stopAnimation();
|
|
273
|
+
}
|
|
274
|
+
async initialize() {
|
|
275
|
+
this.addHandles([
|
|
276
|
+
w(
|
|
277
|
+
() => this.effectiveStops,
|
|
278
|
+
(e) => {
|
|
279
|
+
e && (this.timeExtent ??= z(e, this.mode));
|
|
280
|
+
},
|
|
281
|
+
{ initial: !0 }
|
|
282
|
+
),
|
|
283
|
+
w(
|
|
284
|
+
() => this.view,
|
|
285
|
+
(e, t) => {
|
|
286
|
+
t?.unregisterComponent(this), e?.registerComponent(this);
|
|
287
|
+
},
|
|
288
|
+
{ initial: !0, sync: !0 }
|
|
289
|
+
),
|
|
290
|
+
w(
|
|
291
|
+
() => this.timeExtent,
|
|
292
|
+
(e) => {
|
|
293
|
+
if (!this.view)
|
|
294
|
+
return;
|
|
295
|
+
const t = this.view.timeExtent;
|
|
296
|
+
(!e || e.isAllTime) && (!t || t.isAllTime) || t && e?.equals(t) || (this.view.timeExtent = e);
|
|
297
|
+
},
|
|
298
|
+
{ initial: !0 }
|
|
299
|
+
),
|
|
300
|
+
w(
|
|
301
|
+
() => this.view?.timeExtent,
|
|
302
|
+
(e) => {
|
|
303
|
+
if (!E(this, $)) {
|
|
304
|
+
_t(this, $, !0);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
(!e || e.isAllTime) && (!this.timeExtent || this.timeExtent.isAllTime) || this.timeExtent && e?.equals(this.timeExtent) || (this.timeExtent = e ?? void 0);
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
]), await nt(
|
|
311
|
+
M(() => this.view?.ready, { signal: E(this, T).signal }).then(async () => {
|
|
312
|
+
if (this.loadPersistedSettingsDisabled)
|
|
313
|
+
return;
|
|
314
|
+
const e = await ot(
|
|
315
|
+
this.view?.map,
|
|
316
|
+
E(this, T).signal
|
|
317
|
+
);
|
|
318
|
+
e && (this.fullTimeExtent = e.fullTimeExtent ?? void 0, this.loop = e.loop, this.mode = e.mode, this.playRate = e.playRate, this.stops = e.stops ?? void 0, this.timeExtent = e.timeExtent ?? void 0);
|
|
319
|
+
})
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
formatDate(e) {
|
|
323
|
+
return this._formatDate(e, this._dateFormat);
|
|
324
|
+
}
|
|
325
|
+
formatTime(e) {
|
|
326
|
+
return this._formatDate(e, this._timeFormat);
|
|
327
|
+
}
|
|
328
|
+
formatTick(e, t) {
|
|
329
|
+
return new Intl.DateTimeFormat(this.timeZone, t).format(new Date(e));
|
|
330
|
+
}
|
|
331
|
+
getTickValues(e) {
|
|
332
|
+
const { fullTimeExtent: t, timeZone: i } = this;
|
|
333
|
+
if (!t)
|
|
334
|
+
return [];
|
|
335
|
+
const { start: s, end: r } = t;
|
|
336
|
+
return !s || !r ? [] : pt(s, r, e, i).map((m) => m.getTime());
|
|
337
|
+
}
|
|
338
|
+
next() {
|
|
339
|
+
this._step({ forward: !0, allowRestart: !1 });
|
|
340
|
+
}
|
|
341
|
+
play() {
|
|
342
|
+
this._startAnimation();
|
|
343
|
+
}
|
|
344
|
+
previous() {
|
|
345
|
+
this._step({ forward: !1, allowRestart: !1 });
|
|
346
|
+
}
|
|
347
|
+
stop() {
|
|
348
|
+
this._stopAnimation();
|
|
349
|
+
}
|
|
350
|
+
updateWebDocument(e) {
|
|
351
|
+
if (this.savePersistedSettingsDisabled)
|
|
352
|
+
return;
|
|
353
|
+
const t = new st({
|
|
354
|
+
currentTimeExtent: this.timeExtent,
|
|
355
|
+
fullTimeExtent: this.fullTimeExtent,
|
|
356
|
+
loop: this.loop,
|
|
357
|
+
numStops: O(this.stops) ? this.stops.count : null,
|
|
358
|
+
numThumbs: this.mode === "time-window" ? 2 : 1,
|
|
359
|
+
stopDelay: this.playRate,
|
|
360
|
+
stopInterval: W(this.stops) ? this.stops.interval : null,
|
|
361
|
+
stops: A(this.stops) ? this.stops.dates : null
|
|
362
|
+
});
|
|
363
|
+
e.widgets ??= new it(), e.widgets.timeSlider = t;
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region Private Methods
|
|
367
|
+
async _animate() {
|
|
368
|
+
try {
|
|
369
|
+
const { view: e } = this, t = this._animationController?.signal;
|
|
370
|
+
await Promise.all([at(this.playRate, t), e && M(() => !e.updating, t)]);
|
|
371
|
+
} catch (e) {
|
|
372
|
+
rt(e) || Z("error", "arcgis-slider-time", "animation error", { detail: { error: e } }), this._animationController = void 0;
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
this._step({ forward: !0, allowRestart: !1 }), this._animationController && this._animate();
|
|
376
|
+
}
|
|
377
|
+
_formatDate(e, t) {
|
|
378
|
+
return xt({ locale: this.locale, formatOptions: t }).format(e);
|
|
379
|
+
}
|
|
380
|
+
_startAnimation() {
|
|
381
|
+
this._stopAnimation(), this._animationController = new AbortController(), this._step({ forward: !0, allowRestart: !0 }), this._animate();
|
|
382
|
+
}
|
|
383
|
+
_step({ forward: e, allowRestart: t }) {
|
|
384
|
+
const i = this._thumbPositions, s = this._effectiveStopValues;
|
|
385
|
+
if (!i || !s)
|
|
386
|
+
return;
|
|
387
|
+
const r = i.map((c) => {
|
|
388
|
+
const v = s.indexOf(c);
|
|
389
|
+
if (v !== -1)
|
|
390
|
+
return v;
|
|
391
|
+
const g = s.reduce(
|
|
392
|
+
(x, f) => Math.abs(f - c) < Math.abs(x - c) ? f : x
|
|
393
|
+
);
|
|
394
|
+
return s.indexOf(g);
|
|
395
|
+
}), o = r.map((c) => c += e ? 1 : -1);
|
|
396
|
+
if (o.some((c) => c < 0 || c > s.length - 1))
|
|
397
|
+
if (this.loop || t) {
|
|
398
|
+
const c = Math.min(...r), v = Math.max(...r), x = (e ? r.map((f) => f - c) : r.map((f) => f + (s.length - 1 - v))).map((f) => s[f]);
|
|
399
|
+
this.timeExtent = this._toTimeExtent(x);
|
|
400
|
+
} else
|
|
401
|
+
this.state === "playing" && this.stop();
|
|
402
|
+
else {
|
|
403
|
+
const c = o.map((v) => s[v]);
|
|
404
|
+
this.timeExtent = this._toTimeExtent(c);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
_stopAnimation() {
|
|
408
|
+
this._animationController?.abort(), this._animationController = void 0;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* This method converts thumb position value(s) into a TimeExtent.
|
|
412
|
+
*/
|
|
413
|
+
_toTimeExtent(e) {
|
|
414
|
+
if (!e)
|
|
415
|
+
return;
|
|
416
|
+
const t = [...e].sort((i, s) => i - s).map((i) => new Date(i));
|
|
417
|
+
return z(t, this.mode);
|
|
418
|
+
}
|
|
419
|
+
//#endregion
|
|
420
|
+
};
|
|
421
|
+
T = /* @__PURE__ */ new WeakMap();
|
|
422
|
+
$ = /* @__PURE__ */ new WeakMap();
|
|
423
|
+
d([
|
|
424
|
+
h()
|
|
425
|
+
], u.prototype, "_adjustedMajorTickFormat", 1);
|
|
426
|
+
d([
|
|
427
|
+
h()
|
|
428
|
+
], u.prototype, "_animationController", 2);
|
|
429
|
+
d([
|
|
430
|
+
h()
|
|
431
|
+
], u.prototype, "_dateFormat", 1);
|
|
432
|
+
d([
|
|
433
|
+
h()
|
|
434
|
+
], u.prototype, "_effectiveStopValues", 1);
|
|
435
|
+
d([
|
|
436
|
+
h()
|
|
437
|
+
], u.prototype, "_thumbPositions", 1);
|
|
438
|
+
d([
|
|
439
|
+
h()
|
|
440
|
+
], u.prototype, "_timeFormat", 1);
|
|
441
|
+
d([
|
|
442
|
+
h()
|
|
443
|
+
], u.prototype, "_userTimeZone", 2);
|
|
444
|
+
d([
|
|
445
|
+
h()
|
|
446
|
+
], u.prototype, "effectiveStops", 1);
|
|
447
|
+
d([
|
|
448
|
+
h()
|
|
449
|
+
], u.prototype, "era", 1);
|
|
450
|
+
d([
|
|
451
|
+
h({ type: p })
|
|
452
|
+
], u.prototype, "fullTimeExtent", 2);
|
|
453
|
+
d([
|
|
454
|
+
h()
|
|
455
|
+
], u.prototype, "loadPersistedSettingsDisabled", 2);
|
|
456
|
+
d([
|
|
457
|
+
h()
|
|
458
|
+
], u.prototype, "locale", 2);
|
|
459
|
+
d([
|
|
460
|
+
h()
|
|
461
|
+
], u.prototype, "loop", 2);
|
|
462
|
+
d([
|
|
463
|
+
h()
|
|
464
|
+
], u.prototype, "majorTickFormat", 2);
|
|
465
|
+
d([
|
|
466
|
+
h()
|
|
467
|
+
], u.prototype, "majorTickFormatter", 1);
|
|
468
|
+
d([
|
|
469
|
+
h()
|
|
470
|
+
], u.prototype, "mode", 2);
|
|
471
|
+
d([
|
|
472
|
+
h({ value: 1e3 })
|
|
473
|
+
], u.prototype, "playRate", 1);
|
|
474
|
+
d([
|
|
475
|
+
h()
|
|
476
|
+
], u.prototype, "savePersistedSettingsDisabled", 2);
|
|
477
|
+
d([
|
|
478
|
+
h()
|
|
479
|
+
], u.prototype, "state", 1);
|
|
480
|
+
d([
|
|
481
|
+
h({ cast: vt })
|
|
482
|
+
], u.prototype, "stops", 2);
|
|
483
|
+
d([
|
|
484
|
+
h()
|
|
485
|
+
], u.prototype, "tickFormats", 1);
|
|
486
|
+
d([
|
|
487
|
+
h({ type: p })
|
|
488
|
+
], u.prototype, "timeExtent", 2);
|
|
489
|
+
d([
|
|
490
|
+
h()
|
|
491
|
+
], u.prototype, "timeZone", 1);
|
|
492
|
+
d([
|
|
493
|
+
h()
|
|
494
|
+
], u.prototype, "view", 2);
|
|
495
|
+
d([
|
|
496
|
+
h()
|
|
497
|
+
], u.prototype, "viewTimeZone", 1);
|
|
498
|
+
u = d([
|
|
499
|
+
Q("components.slider-time.SliderTimeViewModel")
|
|
500
|
+
], u);
|
|
501
|
+
const bt = lt(u);
|
|
502
|
+
class Et extends q {
|
|
503
|
+
constructor() {
|
|
504
|
+
super(...arguments), this._resizeObserver = new ResizeObserver((t) => {
|
|
505
|
+
const i = t.at(0)?.contentRect.width ?? 0;
|
|
506
|
+
i && (this._sliderContainerWidth = i);
|
|
507
|
+
}), this.#e = _(), this.#i = _(), this.#l = 3, this.#c = 858, this.#o = _(), this.#s = _(), this.#t = bt(this), this.messages = Y({ blocking: !0 }), this.autoDestroyDisabled = !1, this.disabled = !1, this.effectiveStops = this.#t.effectiveStops, this.fullTimeExtent = this.#t.fullTimeExtent, this.icon = "clock", this.layout = "auto", this.loadPersistedSettingsDisabled = this.#t.loadPersistedSettingsDisabled, this.loop = this.#t.loop, this.mode = this.#t.mode, this.playRate = this.#t.playRate, this.savePersistedSettingsDisabled = this.#t.savePersistedSettingsDisabled, this.showTime = !1, this.state = this.#t.state, this.stops = this.#t.stops, this.timeExtent = this.#t.timeExtent, this.timeZone = this.#t.timeZone, this.view = this.#t.view, this.arcgisPropertyChange = H()("effectiveStops", "fullTimeExtent", "state", "timeExtent"), this.arcgisReady = F(), this.arcgisTriggerAction = F();
|
|
508
|
+
}
|
|
509
|
+
static {
|
|
510
|
+
this.properties = { _effectiveStopsEpoch: 16, _interactive: 16, _isOutOfRange: 16, _sliderContainerWidth: 16, _sliderFillPlacement: 16, actions: 0, autoDestroyDisabled: 5, disabled: 7, effectiveStops: 32, fullTimeExtent: 0, icon: 1, label: 1, labelFormatFunction: 0, layout: 1, loadPersistedSettingsDisabled: 5, loop: 5, messageOverrides: 0, mode: 1, playRate: 9, referenceElement: 1, savePersistedSettingsDisabled: 5, showTime: 5, state: 32, stops: 0, tickConfigs: 0, timeExtent: 0, timeZone: 1, view: 0 };
|
|
511
|
+
}
|
|
512
|
+
static {
|
|
513
|
+
this.styles = mt;
|
|
514
|
+
}
|
|
515
|
+
#n;
|
|
516
|
+
#a;
|
|
517
|
+
#r;
|
|
518
|
+
#e;
|
|
519
|
+
#i;
|
|
520
|
+
#l;
|
|
521
|
+
#c;
|
|
522
|
+
#o;
|
|
523
|
+
#s;
|
|
524
|
+
#t;
|
|
525
|
+
get effectiveLayout() {
|
|
526
|
+
return this.layout === "auto" ? this.el.clientWidth < this.#c ? "compact" : "wide" : this.layout;
|
|
527
|
+
}
|
|
528
|
+
get _effectiveStopsEpoch() {
|
|
529
|
+
return this.effectiveStops?.map((t) => t.getTime());
|
|
530
|
+
}
|
|
531
|
+
get _interactive() {
|
|
532
|
+
return !(this.disabled || this.state === "disabled");
|
|
533
|
+
}
|
|
534
|
+
get _isOutOfRange() {
|
|
535
|
+
const { timeExtent: t, fullTimeExtent: i } = this, { start: s, end: r } = i ?? {};
|
|
536
|
+
if (!s || !r || !t || t.isAllTime || t.isEmpty)
|
|
537
|
+
return !0;
|
|
538
|
+
const { start: o, end: m } = t ?? {}, c = o != null && (o < s || o > r), v = m != null && (m > r || m < s);
|
|
539
|
+
return c || v;
|
|
540
|
+
}
|
|
541
|
+
get _sliderFillPlacement() {
|
|
542
|
+
switch (this.mode) {
|
|
543
|
+
case "cumulative-from-end":
|
|
544
|
+
return "end";
|
|
545
|
+
case "cumulative-from-start":
|
|
546
|
+
return "start";
|
|
547
|
+
case "instant":
|
|
548
|
+
return "none";
|
|
549
|
+
case "time-window":
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
async applyTimeSliderSettings(t) {
|
|
554
|
+
this.#t.set(t);
|
|
555
|
+
}
|
|
556
|
+
async destroy() {
|
|
557
|
+
await this.manager.destroy();
|
|
558
|
+
}
|
|
559
|
+
async next() {
|
|
560
|
+
this.#t.next();
|
|
561
|
+
}
|
|
562
|
+
async play() {
|
|
563
|
+
this.#t.play();
|
|
564
|
+
}
|
|
565
|
+
async previous() {
|
|
566
|
+
this.#t.previous();
|
|
567
|
+
}
|
|
568
|
+
async stop() {
|
|
569
|
+
this.#t.stop();
|
|
570
|
+
}
|
|
571
|
+
async updateWebDocument(t) {
|
|
572
|
+
this.#t.updateWebDocument(t);
|
|
573
|
+
}
|
|
574
|
+
willUpdate(t) {
|
|
575
|
+
t.has("messages") && (this.#t.locale = this.messages._lang);
|
|
576
|
+
}
|
|
577
|
+
updated(t) {
|
|
578
|
+
this.labelFormatFunction && ((t.has("labelFormatFunction") || t.has("timeExtent") || t.has("effectiveLayout")) && this.#s.value && this._formatExtent(this.#s.value), (t.has("labelFormatFunction") || t.has("fullTimeExtent") || t.has("effectiveLayout")) && (this.#e.value && this._formatMax(this.#e.value), this.#i.value && this._formatMin(this.#i.value)));
|
|
579
|
+
}
|
|
580
|
+
async loaded() {
|
|
581
|
+
this.manager.onLifecycle(() => [
|
|
582
|
+
w(() => this.#o.value, (t) => {
|
|
583
|
+
this._resizeObserver.disconnect(), t && this._resizeObserver.observe(t);
|
|
584
|
+
}, { initial: !0 }),
|
|
585
|
+
ct(() => {
|
|
586
|
+
this._resizeObserver.disconnect();
|
|
587
|
+
})
|
|
588
|
+
]);
|
|
589
|
+
}
|
|
590
|
+
_formatExtent(t) {
|
|
591
|
+
this.labelFormatFunction?.([this.timeExtent?.start, this.timeExtent?.end], "extent", t, this.effectiveLayout);
|
|
592
|
+
}
|
|
593
|
+
_formatMin(t) {
|
|
594
|
+
this.labelFormatFunction?.(this.fullTimeExtent?.start, "min", t, this.effectiveLayout);
|
|
595
|
+
}
|
|
596
|
+
_formatMax(t) {
|
|
597
|
+
this.labelFormatFunction?.(this.fullTimeExtent?.end, "max", t, this.effectiveLayout);
|
|
598
|
+
}
|
|
599
|
+
_getTickFormat(t, i) {
|
|
600
|
+
const r = (t.end.getTime() - t.start.getTime()) / i;
|
|
601
|
+
return this.#t.tickFormats.find(({ duration: o }) => o > this.#l * r) ?? this.#t.tickFormats.at(-1);
|
|
602
|
+
}
|
|
603
|
+
_onSliderInput(t) {
|
|
604
|
+
this.timeExtent = this._toTimeExtent(t.target.values);
|
|
605
|
+
}
|
|
606
|
+
async _playOrStopClick() {
|
|
607
|
+
switch (this.state) {
|
|
608
|
+
case "disabled":
|
|
609
|
+
case "playing":
|
|
610
|
+
return await this.stop();
|
|
611
|
+
case "ready":
|
|
612
|
+
return await this.play();
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
_toTimeExtent([t, i]) {
|
|
616
|
+
switch (this.mode) {
|
|
617
|
+
case "cumulative-from-end":
|
|
618
|
+
return new p({
|
|
619
|
+
start: new Date(t),
|
|
620
|
+
end: null
|
|
621
|
+
});
|
|
622
|
+
case "cumulative-from-start":
|
|
623
|
+
return new p({
|
|
624
|
+
start: null,
|
|
625
|
+
end: new Date(t)
|
|
626
|
+
});
|
|
627
|
+
case "instant":
|
|
628
|
+
return new p({
|
|
629
|
+
start: new Date(t),
|
|
630
|
+
end: new Date(t)
|
|
631
|
+
});
|
|
632
|
+
case "time-window":
|
|
633
|
+
return new p({
|
|
634
|
+
start: new Date(t),
|
|
635
|
+
end: new Date(i)
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
render() {
|
|
640
|
+
return l`<div aria-label=${this.messages.componentLabel ?? S} class=${G(U("root", this.effectiveLayout, { "out-of-range": this._isOutOfRange }))} role=presentation>${this._renderContent()}</div>`;
|
|
641
|
+
}
|
|
642
|
+
_renderActions() {
|
|
643
|
+
return this.actions?.length ? l`<calcite-action-menu class="action-menu" .label=${this.messages.options}>${this.actions.toArray().map(({ icon: t, id: i, title: s }) => l`<calcite-action .icon=${t} id=${i ?? S} @click=${() => this.arcgisTriggerAction.emit({ action: { icon: t, id: i, title: s } })} .text=${s} text-enabled></calcite-action>`)}</calcite-action-menu>` : null;
|
|
644
|
+
}
|
|
645
|
+
_renderContent() {
|
|
646
|
+
const t = this._renderActions(), i = this._renderMaxContainer(), s = this._renderMinContainer(), r = this._renderNext(), o = this._renderPlay(), m = this._renderPrevious(), c = this._renderSliderContainer(), v = this._renderTimeExtentContainer();
|
|
647
|
+
switch (this.effectiveLayout) {
|
|
648
|
+
case "compact":
|
|
649
|
+
return l`<div class="row1">${v}${t}</div><div class="row2">${c}</div><div class="row3">${s}${m}${o}${r}${i}</div>`;
|
|
650
|
+
case "wide":
|
|
651
|
+
return l`<div class="row"><div class="playback-controls">${o}${v}${s}${c}${i}${m}${r}</div>${t}</div>`;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
_renderCustomSliderTicks(t, i) {
|
|
655
|
+
return this.tickConfigs?.map(({ labelFormatFunction: s, mode: r, values: o, labelsVisible: m }) => l`<arcgis-ticks class="slider-custom-ticks" .labelFormatter=${s} .max=${i} .min=${t} .mode=${ht(r)} .showLabels=${m} .values=${o}></arcgis-ticks>`);
|
|
656
|
+
}
|
|
657
|
+
_renderDefaultSliderTicks(t, i) {
|
|
658
|
+
return l`<arcgis-ticks class="slider-minor-ticks" .max=${i} .min=${t} mode=value .values=${this.#r}></arcgis-ticks><arcgis-ticks class="slider-major-ticks" .labelFormatter=${this.#t.majorTickFormatter} .max=${i} .min=${t} mode=value show-labels .values=${this.#a}></arcgis-ticks>`;
|
|
659
|
+
}
|
|
660
|
+
_renderMaxContainer() {
|
|
661
|
+
return this.labelFormatFunction ? l`<div class="max" ${b(this.#e)}></div>` : l`<div class="max">${this._renderMaxContent(this.fullTimeExtent?.end)}</div>`;
|
|
662
|
+
}
|
|
663
|
+
_renderMaxContent(t) {
|
|
664
|
+
return t ? l`${this._renderMaxDate(t)}${this._renderMaxTime(t)}` : null;
|
|
665
|
+
}
|
|
666
|
+
_renderMaxDate(t) {
|
|
667
|
+
return l`<calcite-label class="max-date" scale=s>${this.#t.formatDate(t)}</calcite-label>`;
|
|
668
|
+
}
|
|
669
|
+
_renderMaxTime(t) {
|
|
670
|
+
return this.showTime ? l`<calcite-label class="max-time" scale=s>${this.#t.formatTime(t)}</calcite-label>` : null;
|
|
671
|
+
}
|
|
672
|
+
_renderMinContainer() {
|
|
673
|
+
return this.labelFormatFunction ? l`<div class="min" ${b(this.#i)}></div>` : l`<div class="min">${this._renderMinContent(this.fullTimeExtent?.start)}</div>`;
|
|
674
|
+
}
|
|
675
|
+
_renderMinContent(t) {
|
|
676
|
+
return t ? l`${this._renderMinDate(t)}${this._renderMinTime(t)}` : null;
|
|
677
|
+
}
|
|
678
|
+
_renderMinDate(t) {
|
|
679
|
+
return l`<calcite-label class="min-date" scale=s>${this.#t.formatDate(t)}</calcite-label>`;
|
|
680
|
+
}
|
|
681
|
+
_renderMinTime(t) {
|
|
682
|
+
return this.showTime ? l`<calcite-label class="min-time" scale=s>${this.#t.formatTime(t)}</calcite-label>` : null;
|
|
683
|
+
}
|
|
684
|
+
_renderPlay() {
|
|
685
|
+
return l`<calcite-button appearance=transparent class="play" .disabled=${this._isOutOfRange || !this._interactive || !this.effectiveStops?.length} .iconStart=${this.state === "playing" ? "pause" : "play"} kind=neutral .label=${this.state === "playing" ? this.messages.control.stop : this.messages.control.play} @click=${this._playOrStopClick} .scale=${this.effectiveLayout === "wide" ? "l" : "m"} width=full></calcite-button>`;
|
|
686
|
+
}
|
|
687
|
+
_renderPrevious() {
|
|
688
|
+
return l`<calcite-button appearance=transparent class="previous" .disabled=${this._isOutOfRange || !this._interactive || !this.effectiveStops?.length || this.state === "playing"} icon-start=reverse kind=neutral .label=${this.messages.pagination.previous} @click=${this.previous} .scale=${this.effectiveLayout === "wide" ? "l" : "m"} width=full></calcite-button>`;
|
|
689
|
+
}
|
|
690
|
+
_renderNext() {
|
|
691
|
+
return l`<calcite-button appearance=transparent class="next" .disabled=${this._isOutOfRange || !this._interactive || !this.effectiveStops?.length || this.state === "playing"} icon-start=forward kind=neutral .label=${this.messages.pagination.next} @click=${this.next} .scale=${this.effectiveLayout === "wide" ? "l" : "m"} width=full></calcite-button>`;
|
|
692
|
+
}
|
|
693
|
+
_renderSliderContainer() {
|
|
694
|
+
return l`<div class="slider-container"><div class="slider-parent" ${b(this.#o)}>${this._renderSliderContent()}</div></div>`;
|
|
695
|
+
}
|
|
696
|
+
_renderSliderContent() {
|
|
697
|
+
if (!this.timeExtent || !this.fullTimeExtent?.start || !this.fullTimeExtent.end || !this._sliderContainerWidth)
|
|
698
|
+
return null;
|
|
699
|
+
const t = this._getTickFormat(this.fullTimeExtent, this._sliderContainerWidth);
|
|
700
|
+
(!this.#n || !this.#r || !this.#a || this.#n !== t) && (this.#n = t, this.#r = this.#t.getTickValues(t.minor), this.#a = this.#t.getTickValues(t.major), this.#t.majorTickFormat = t.format);
|
|
701
|
+
const i = this.fullTimeExtent.start.getTime(), s = this.fullTimeExtent.end.getTime(), r = this._isOutOfRange ? [] : this._renderTimeExtentValues(), o = this._renderCustomSliderTicks(i, s) ?? this._renderDefaultSliderTicks(i, s);
|
|
702
|
+
return l`<arcgis-slider class="slider" .disabled=${!this._interactive} fill-placement=${this._sliderFillPlacement ?? S} .max=${s} .min=${i} @arcgisInput=${this._onSliderInput} precision=0 .steps=${this._effectiveStopsEpoch} .values=${r}><div slot=content-end class="slider-ticks-container">${o}</div></arcgis-slider>`;
|
|
703
|
+
}
|
|
704
|
+
_renderTimeExtentContainer() {
|
|
705
|
+
return this.labelFormatFunction ? l`<div class="time-extent" ${b(this.#s)}></div>` : l`<div class="time-extent">${this._renderTimeExtentContent()}</div>`;
|
|
706
|
+
}
|
|
707
|
+
_renderTimeExtentContent() {
|
|
708
|
+
return !this.timeExtent || this.timeExtent.isAllTime ? this._renderWarning(this.messages.noTimeExtent) : this.timeExtent.isEmpty ? this._renderWarning(this.messages.emptyTimeExtent) : l`${this._renderTimeExtentStart()}${this._renderTimeExtentSeparator()}${this._renderTimeExtentEnd()}`;
|
|
709
|
+
}
|
|
710
|
+
_renderTimeExtentEnd() {
|
|
711
|
+
return this.timeExtent?.end && this.timeExtent.start?.getTime() !== this.timeExtent.end.getTime() ? y("time-extent-end-group", l`<div class="time-extent-end-group">${y("time-extent-end-date", l`<calcite-label alignment=center class="time-extent-end-date" scale=s>${this.#t.formatDate(this.timeExtent.end)}</calcite-label>`)}${this.showTime ? y("time-extent-end-time", l`<calcite-label alignment=center class="time-extent-end-time" scale=s>${this.#t.formatTime(this.timeExtent.end)}</calcite-label>`) : null}</div>`) : null;
|
|
712
|
+
}
|
|
713
|
+
_renderTimeExtentStart() {
|
|
714
|
+
return this.timeExtent?.start ? y("time-extent-start-group", l`<div class="time-extent-start-group">${y("time-extent-start-date", l`<calcite-label alignment=center class="time-extent-start-date" scale=s>${this.#t.formatDate(this.timeExtent.start)}</calcite-label>`)}${this.showTime ? y("time-extent-start-time", l`<calcite-label alignment=center class="time-extent-start-time" scale=s>${this.#t.formatTime(this.timeExtent.start)}</calcite-label>`) : null}</div>`) : null;
|
|
715
|
+
}
|
|
716
|
+
_renderTimeExtentSeparator() {
|
|
717
|
+
return this.timeExtent?.start && this.timeExtent?.end && this.timeExtent.start.getTime() !== this.timeExtent.end.getTime() ? y("time-extent-separator", l`<div class="time-extent-separator"></div>`) : null;
|
|
718
|
+
}
|
|
719
|
+
_renderTimeExtentValues() {
|
|
720
|
+
if (!this.timeExtent)
|
|
721
|
+
return;
|
|
722
|
+
const { start: t, end: i } = this.timeExtent;
|
|
723
|
+
switch (this.mode) {
|
|
724
|
+
case "cumulative-from-end":
|
|
725
|
+
case "instant":
|
|
726
|
+
return t ? [t.getTime()] : void 0;
|
|
727
|
+
case "cumulative-from-start":
|
|
728
|
+
return i ? [i.getTime()] : void 0;
|
|
729
|
+
case "time-window":
|
|
730
|
+
return t && i ? [t.getTime(), i.getTime()] : void 0;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
_renderWarning(t) {
|
|
734
|
+
return l`<div class="warning"><calcite-icon class="warning-icon" icon=exclamation-mark-triangle></calcite-icon><calcite-label alignment=center class="warning-label" scale=s>${t}</calcite-label></div>`;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
N("arcgis-slider-time", Et);
|
|
738
|
+
export {
|
|
739
|
+
Et as ArcgisSliderTime
|
|
740
|
+
};
|