@arcgis/map-components 5.1.0-next.89 → 5.1.0-next.90

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.
Files changed (196) hide show
  1. package/dist/cdn/{BOMPCJ77.js → 2LNLB4XY.js} +1 -1
  2. package/dist/cdn/{25LLGDTO.js → 2YB6S64G.js} +1 -1
  3. package/dist/cdn/3A4SIMPX.js +2 -0
  4. package/dist/cdn/3N5NYUQ4.js +2 -0
  5. package/dist/cdn/{K6FLTE5C.js → 3YVU66DR.js} +1 -1
  6. package/dist/cdn/4GX6K4QV.js +2 -0
  7. package/dist/cdn/{UMATWIWL.js → 5BKXAZGJ.js} +1 -1
  8. package/dist/cdn/{6352EDBR.js → 64Q47BWH.js} +1 -1
  9. package/dist/cdn/{XQ5BV7DL.js → 6BESCJK6.js} +1 -1
  10. package/dist/cdn/{TUY46VJP.js → 7GN54I5I.js} +1 -1
  11. package/dist/cdn/A35RPLAM.js +2 -0
  12. package/dist/cdn/AOKQLNNK.js +2 -0
  13. package/dist/cdn/{MAVNZR2L.js → BLH76V4B.js} +1 -1
  14. package/dist/cdn/D4ZQOMOH.js +2 -0
  15. package/dist/cdn/{ZSG6TJPR.js → FJY5EA2S.js} +1 -1
  16. package/dist/cdn/{HU4V2LGL.js → GDHU6FB7.js} +1 -1
  17. package/dist/cdn/{5GEYGYVM.js → GFNS6DWD.js} +1 -1
  18. package/dist/cdn/{ACT4QKSO.js → GPMDFKYC.js} +1 -1
  19. package/dist/cdn/{24VXNB37.js → IWGEVWTS.js} +1 -1
  20. package/dist/cdn/{FDNFARSM.js → JHRFJTE4.js} +1 -1
  21. package/dist/cdn/{3BUCNQ3Q.js → JWYAOQXS.js} +1 -1
  22. package/dist/cdn/{HTNECFCQ.js → K2RCQ3S4.js} +1 -1
  23. package/dist/cdn/{MAILZU6P.js → MAFF3ZL7.js} +1 -1
  24. package/dist/cdn/{FQY55PPT.js → MVULTZL6.js} +1 -1
  25. package/dist/cdn/{GCPE7SKR.js → NJP6OBBN.js} +1 -1
  26. package/dist/cdn/{ST5DXIZ6.js → NVRFQSZB.js} +1 -1
  27. package/dist/cdn/{WJWYFM4K.js → PSIEACM5.js} +1 -1
  28. package/dist/cdn/{F5RARHY3.js → Q6IMZMFI.js} +1 -1
  29. package/dist/cdn/{MQ4W6OKL.js → QHSIMKPK.js} +1 -1
  30. package/dist/cdn/QMR3YL46.js +2 -0
  31. package/dist/cdn/{C6DEM2XB.js → RCLKTOCN.js} +1 -1
  32. package/dist/cdn/{ZIV7S3DE.js → THXCDBHG.js} +1 -1
  33. package/dist/cdn/V4RMKJUW.js +2 -0
  34. package/dist/cdn/WRWNOEUN.js +2 -0
  35. package/dist/cdn/{PFHHH6X2.js → XF7T7NTL.js} +1 -1
  36. package/dist/cdn/{R2EXDY7E.js → XHYVTSLE.js} +1 -1
  37. package/dist/cdn/assets/bookmarks/t9n/messages.ar.json +1 -1
  38. package/dist/cdn/assets/bookmarks/t9n/messages.bg.json +1 -1
  39. package/dist/cdn/assets/bookmarks/t9n/messages.bs.json +1 -1
  40. package/dist/cdn/assets/bookmarks/t9n/messages.ca.json +1 -1
  41. package/dist/cdn/assets/bookmarks/t9n/messages.cs.json +1 -1
  42. package/dist/cdn/assets/bookmarks/t9n/messages.da.json +1 -1
  43. package/dist/cdn/assets/bookmarks/t9n/messages.de.json +1 -1
  44. package/dist/cdn/assets/bookmarks/t9n/messages.el.json +1 -1
  45. package/dist/cdn/assets/bookmarks/t9n/messages.es.json +1 -1
  46. package/dist/cdn/assets/bookmarks/t9n/messages.et.json +1 -1
  47. package/dist/cdn/assets/bookmarks/t9n/messages.fi.json +1 -1
  48. package/dist/cdn/assets/bookmarks/t9n/messages.fr.json +1 -1
  49. package/dist/cdn/assets/bookmarks/t9n/messages.he.json +1 -1
  50. package/dist/cdn/assets/bookmarks/t9n/messages.hr.json +1 -1
  51. package/dist/cdn/assets/bookmarks/t9n/messages.hu.json +1 -1
  52. package/dist/cdn/assets/bookmarks/t9n/messages.id.json +1 -1
  53. package/dist/cdn/assets/bookmarks/t9n/messages.it.json +1 -1
  54. package/dist/cdn/assets/bookmarks/t9n/messages.ja.json +1 -1
  55. package/dist/cdn/assets/bookmarks/t9n/messages.ko.json +1 -1
  56. package/dist/cdn/assets/bookmarks/t9n/messages.lt.json +1 -1
  57. package/dist/cdn/assets/bookmarks/t9n/messages.lv.json +1 -1
  58. package/dist/cdn/assets/bookmarks/t9n/messages.nl.json +1 -1
  59. package/dist/cdn/assets/bookmarks/t9n/messages.no.json +1 -1
  60. package/dist/cdn/assets/bookmarks/t9n/messages.pl.json +1 -1
  61. package/dist/cdn/assets/bookmarks/t9n/messages.pt-BR.json +1 -1
  62. package/dist/cdn/assets/bookmarks/t9n/messages.pt-PT.json +1 -1
  63. package/dist/cdn/assets/bookmarks/t9n/messages.ro.json +1 -1
  64. package/dist/cdn/assets/bookmarks/t9n/messages.ru.json +1 -1
  65. package/dist/cdn/assets/bookmarks/t9n/messages.sk.json +1 -1
  66. package/dist/cdn/assets/bookmarks/t9n/messages.sl.json +1 -1
  67. package/dist/cdn/assets/bookmarks/t9n/messages.sr.json +1 -1
  68. package/dist/cdn/assets/bookmarks/t9n/messages.sv.json +1 -1
  69. package/dist/cdn/assets/bookmarks/t9n/messages.th.json +1 -1
  70. package/dist/cdn/assets/bookmarks/t9n/messages.tr.json +1 -1
  71. package/dist/cdn/assets/bookmarks/t9n/messages.uk.json +1 -1
  72. package/dist/cdn/assets/bookmarks/t9n/messages.vi.json +1 -1
  73. package/dist/cdn/assets/bookmarks/t9n/messages.zh-CN.json +1 -1
  74. package/dist/cdn/assets/bookmarks/t9n/messages.zh-HK.json +1 -1
  75. package/dist/cdn/assets/bookmarks/t9n/messages.zh-TW.json +1 -1
  76. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.en.json +1 -0
  77. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ar.json +1 -1
  78. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.bg.json +1 -1
  79. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.bs.json +1 -1
  80. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ca.json +1 -1
  81. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.cs.json +1 -1
  82. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.da.json +1 -1
  83. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.de.json +1 -1
  84. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.el.json +1 -1
  85. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.es.json +1 -1
  86. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.et.json +1 -1
  87. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.fi.json +1 -1
  88. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.fr.json +1 -1
  89. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.he.json +1 -1
  90. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.hr.json +1 -1
  91. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.hu.json +1 -1
  92. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.id.json +1 -1
  93. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.it.json +1 -1
  94. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ja.json +1 -1
  95. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ko.json +1 -1
  96. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.lt.json +1 -1
  97. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.lv.json +1 -1
  98. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.nl.json +1 -1
  99. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.no.json +1 -1
  100. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.pl.json +1 -1
  101. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.pt-BR.json +1 -1
  102. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.pt-PT.json +1 -1
  103. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ro.json +1 -1
  104. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ru.json +1 -1
  105. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.sk.json +1 -1
  106. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.sl.json +1 -1
  107. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.sr.json +1 -1
  108. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.sv.json +1 -1
  109. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.th.json +1 -1
  110. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.tr.json +1 -1
  111. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.uk.json +1 -1
  112. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.vi.json +1 -1
  113. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.zh-CN.json +1 -1
  114. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.zh-HK.json +1 -1
  115. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.zh-TW.json +1 -1
  116. package/dist/cdn/index.js +1 -1
  117. package/dist/cdn/main.css +1 -1
  118. package/dist/chunks/async-utils.js +51 -63
  119. package/dist/chunks/urlUtils.js +17 -0
  120. package/dist/components/arcgis-aggregated-features/customElement.js +69 -46
  121. package/dist/components/arcgis-daylight/customElement.js +2 -2
  122. package/dist/components/arcgis-directions/customElement.js +1 -1
  123. package/dist/components/arcgis-feature-table/customElement.js +1 -1
  124. package/dist/components/arcgis-features/customElement.d.ts +7 -0
  125. package/dist/components/arcgis-features/customElement.js +68 -51
  126. package/dist/components/arcgis-grid-controls/customElement.js +26 -26
  127. package/dist/components/arcgis-oriented-imagery-viewer/customElement.js +1 -1
  128. package/dist/components/arcgis-oriented-imagery-viewer-image-viewer/customElement.d.ts +41 -0
  129. package/dist/components/arcgis-oriented-imagery-viewer-image-viewer/customElement.js +299 -0
  130. package/dist/components/arcgis-oriented-imagery-viewer-image-viewer/index.d.ts +1 -0
  131. package/dist/components/arcgis-oriented-imagery-viewer-image-viewer/index.js +4 -0
  132. package/dist/components/arcgis-oriented-imagery-viewer-image-viewer/support/NonPanoramicMedia.d.ts +25 -0
  133. package/dist/components/arcgis-search/customElement.js +1 -1
  134. package/dist/components/arcgis-time-of-day-slider/customElement.js +47 -47
  135. package/dist/components/arcgis-time-slider/customElement.d.ts +353 -688
  136. package/dist/components/arcgis-time-slider/customElement.js +26 -678
  137. package/dist/components/arcgis-time-slider/index.js +0 -7
  138. package/dist/docs/api.json +1 -1
  139. package/dist/docs/docs.json +1 -1
  140. package/dist/docs/vscode.html-custom-data.json +1 -1
  141. package/dist/docs/web-types.json +1 -1
  142. package/dist/index.d.ts +4 -0
  143. package/dist/loader.js +3 -2
  144. package/dist/types/lumina.d.ts +9 -2
  145. package/dist/types/preact.d.ts +10 -2
  146. package/dist/types/react.d.ts +11 -2
  147. package/dist/types/stencil.d.ts +9 -2
  148. package/package.json +5 -5
  149. package/dist/cdn/AFAQWPXY.js +0 -2
  150. package/dist/cdn/DWADIUIX.js +0 -2
  151. package/dist/cdn/F2UYN7PY.js +0 -2
  152. package/dist/cdn/F74DKJP5.js +0 -2
  153. package/dist/cdn/JE5PV6KP.js +0 -2
  154. package/dist/cdn/MDC6LZQV.js +0 -2
  155. package/dist/cdn/Z33HF7ZE.js +0 -2
  156. package/dist/cdn/assets/time-slider/t9n/messages.ar.json +0 -1
  157. package/dist/cdn/assets/time-slider/t9n/messages.bg.json +0 -1
  158. package/dist/cdn/assets/time-slider/t9n/messages.bs.json +0 -1
  159. package/dist/cdn/assets/time-slider/t9n/messages.ca.json +0 -1
  160. package/dist/cdn/assets/time-slider/t9n/messages.cs.json +0 -1
  161. package/dist/cdn/assets/time-slider/t9n/messages.da.json +0 -1
  162. package/dist/cdn/assets/time-slider/t9n/messages.de.json +0 -1
  163. package/dist/cdn/assets/time-slider/t9n/messages.el.json +0 -1
  164. package/dist/cdn/assets/time-slider/t9n/messages.en.json +0 -1
  165. package/dist/cdn/assets/time-slider/t9n/messages.es.json +0 -1
  166. package/dist/cdn/assets/time-slider/t9n/messages.et.json +0 -1
  167. package/dist/cdn/assets/time-slider/t9n/messages.fi.json +0 -1
  168. package/dist/cdn/assets/time-slider/t9n/messages.fr.json +0 -1
  169. package/dist/cdn/assets/time-slider/t9n/messages.he.json +0 -1
  170. package/dist/cdn/assets/time-slider/t9n/messages.hr.json +0 -1
  171. package/dist/cdn/assets/time-slider/t9n/messages.hu.json +0 -1
  172. package/dist/cdn/assets/time-slider/t9n/messages.id.json +0 -1
  173. package/dist/cdn/assets/time-slider/t9n/messages.it.json +0 -1
  174. package/dist/cdn/assets/time-slider/t9n/messages.ja.json +0 -1
  175. package/dist/cdn/assets/time-slider/t9n/messages.ko.json +0 -1
  176. package/dist/cdn/assets/time-slider/t9n/messages.lt.json +0 -1
  177. package/dist/cdn/assets/time-slider/t9n/messages.lv.json +0 -1
  178. package/dist/cdn/assets/time-slider/t9n/messages.nl.json +0 -1
  179. package/dist/cdn/assets/time-slider/t9n/messages.no.json +0 -1
  180. package/dist/cdn/assets/time-slider/t9n/messages.pl.json +0 -1
  181. package/dist/cdn/assets/time-slider/t9n/messages.pt-BR.json +0 -1
  182. package/dist/cdn/assets/time-slider/t9n/messages.pt-PT.json +0 -1
  183. package/dist/cdn/assets/time-slider/t9n/messages.ro.json +0 -1
  184. package/dist/cdn/assets/time-slider/t9n/messages.ru.json +0 -1
  185. package/dist/cdn/assets/time-slider/t9n/messages.sk.json +0 -1
  186. package/dist/cdn/assets/time-slider/t9n/messages.sl.json +0 -1
  187. package/dist/cdn/assets/time-slider/t9n/messages.sr.json +0 -1
  188. package/dist/cdn/assets/time-slider/t9n/messages.sv.json +0 -1
  189. package/dist/cdn/assets/time-slider/t9n/messages.th.json +0 -1
  190. package/dist/cdn/assets/time-slider/t9n/messages.tr.json +0 -1
  191. package/dist/cdn/assets/time-slider/t9n/messages.uk.json +0 -1
  192. package/dist/cdn/assets/time-slider/t9n/messages.vi.json +0 -1
  193. package/dist/cdn/assets/time-slider/t9n/messages.zh-CN.json +0 -1
  194. package/dist/cdn/assets/time-slider/t9n/messages.zh-HK.json +0 -1
  195. package/dist/cdn/assets/time-slider/t9n/messages.zh-TW.json +0 -1
  196. package/dist/components/arcgis-time-slider/types.d.ts +0 -147
@@ -1,103 +1,83 @@
1
1
  /// <reference path="../../index.d.ts" />
2
- import type TimeExtent from "@arcgis/core/time/TimeExtent.js";
3
- import type Collection from "@arcgis/core/core/Collection.js";
4
2
  import type WebMap from "@arcgis/core/WebMap.js";
5
- import type WebScene from "@arcgis/core/WebScene.js";
6
- import type MapView from "@arcgis/core/views/MapView.js";
7
- import type SceneView from "@arcgis/core/views/SceneView.js";
3
+ import type Collection from "@arcgis/core/core/Collection.js";
4
+ import type TimeExtent from "@arcgis/core/time/TimeExtent.js";
8
5
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
9
6
  import type { ArcgisReferenceElement, IconName } from "../types.js";
10
- import type { Action, DateLabelFormatter, Layout, TickConfig, TimeSliderSettings, TriggerActionEvent, Mode, State, Stops } from "./types.js";
11
- import type { T9nMeta } from "@arcgis/lumina/controllers";
7
+ import type { TimeSliderViewModelTriggerActionEvent } from "@arcgis/core/widgets/TimeSlider/TimeSliderViewModel.js";
8
+ import type { TimeSliderSettings, Action, TimeSliderMode, TimeSliderState, Stops } from "@arcgis/core/widgets/TimeSlider/types.js";
9
+ import type { MapViewOrSceneView } from "@arcgis/core/views/MapViewOrSceneView.js";
10
+ import type { Icon } from "@esri/calcite-components/components/calcite-icon";
11
+ import type { TimeSliderLayout } from "@arcgis/core/widgets/TimeSlider.js";
12
+ import type { TickConfig } from "@arcgis/core/widgets/Slider/types.js";
12
13
 
13
14
  /**
14
- * The `<arcgis-time-slider>` component provides interactive time selection and playback within a defined temporal extent.
15
+ * The Time Slider component simplifies visualization of temporal data in your application.
15
16
  *
16
17
  * @since 4.28
17
18
  */
18
19
  export abstract class ArcgisTimeSlider extends LitElement {
19
- /** @internal */
20
- protected readonly _messages: {
21
- componentLabel: string;
22
- control: {
23
- play: string;
24
- stop: string;
25
- };
26
- emptyTimeExtent: string;
27
- noTimeExtent: string;
28
- options: string;
29
- pagination: {
30
- next: string;
31
- previous: string;
32
- };
33
- } & T9nMeta<{
34
- componentLabel: string;
35
- control: {
36
- play: string;
37
- stop: string;
38
- };
39
- emptyTimeExtent: string;
40
- noTimeExtent: string;
41
- options: string;
42
- pagination: {
43
- next: string;
44
- previous: string;
45
- };
46
- }>;
47
20
  /**
48
- * When defined, the actions will be displayed in an ellipsis button menu within the component.
49
- * This property accepts a collection of actions.
50
- * Each action is an object that must contain a unique `id`, a `title`, and an `icon`.
21
+ * Defines actions that will appear in a menu when the user clicks the ellipsis button
22
+ * ![timeSlider-actions-menu](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/timeslider/ellipsis.png) in the component. The
23
+ * ellipsis button will not display if this property is `null` or if the collection is empty.
24
+ * Each [Action](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/types/#Action) is defined with a unique id, a title,
25
+ * and an icon.
51
26
  *
52
- * When an action is clicked, the component emits a [@arcgisTriggerAction](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-slider/#event-arcgisTriggerAction) event.
27
+ * The [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#event-trigger-action) event fires each time an action in the menu is clicked. This event
28
+ * can be used to execute custom code such as setting the [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent) to a specific date or copying the
29
+ * timeExtent to the browser's clipboard.
53
30
  *
54
- * [![widgets-timeSlider-actions](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/timeslider/widgets-timeslider-actions.avif)](https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-timeslider-offset)
31
+ * [![widgets-timeSlider-actions](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/timeslider/widgets-timeslider-actions.png)](https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-timeslider-offset)
55
32
  *
33
+ * @since 4.21
34
+ * @see [Sample - TimeSlider with offset](https://developers.arcgis.com/javascript/latest/sample-code/widgets-timeslider-offset/)
56
35
  * @example
57
- * ```html
58
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
59
- * <arcgis-time-slider slot="top-right"></arcgis-time-slider>
60
- * </arcgis-map>
61
- * ```
62
- * ```js
63
- * <script type="module">
64
- * const [TimeExtent, Collection, reactiveUtils] = await $arcgis.import([
65
- * "@arcgis/core/time/TimeExtent.js",
66
- * "@arcgis/core/core/Collection.js",
67
- * "@arcgis/core/core/reactiveUtils.js",
68
- * ]);
69
- *
70
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
71
- * await timeSliderElement.componentOnReady();
72
- *
73
- * timeSliderElement.fullTimeExtent = new TimeExtent({
74
- * start: new Date(2000, 0, 1),
75
- * end: new Date(2010, 0, 1),
76
- * });
77
- * timeSliderElement.actions = new Collection([
78
- * { id: "quake", icon: "exclamation-mark-triangle", title: "Jump to Earthquake" },
79
- * { id: "quake-plus-one-month", icon: "organization", title: "One month later" },
80
- * ]);
81
- *
82
- * reactiveUtils.on(
83
- * () => timeSliderElement,
84
- * "arcgisTriggerAction",
85
- * (event) => {
86
- * const id = event.detail.action.id;
87
- * switch (id) {
88
- * case "quake":
89
- * console.log("Jump to Earthquake action triggered");
90
- * break;
91
- * case "quake-plus-one-month":
92
- * console.log("One month later action triggered");
93
- * break;
94
- * }
36
+ * // Create a TimeSlider with two actions to snap the thumb to
37
+ * // two specific time extents.
38
+ * const timeSlider = new TimeSlider({
39
+ * container: "timeSliderDiv",
40
+ * fullTimeExtent: {
41
+ * start: new Date(2011, 0, 1),
42
+ * end: new Date(2012, 0, 1)
43
+ * },
44
+ * mode: "instant",
45
+ * actions: [
46
+ * {
47
+ * id: "quake",
48
+ * icon: "exclamation-mark-triangle",
49
+ * title: "Jump to Earthquake"
95
50
  * },
96
- * );
97
- * </script>
98
- * ```
51
+ * {
52
+ * id: "quake-plus-one-month",
53
+ * icon: "organization",
54
+ * title: "One month later"
55
+ * }
56
+ * ]
57
+ * });
58
+ *
59
+ * // listen to timeSlider's trigger-action event
60
+ * // check what action user clicked on and respond accordingly.
61
+ * timeSlider.on("trigger-action", (event) => {
62
+ * const quake = new Date(Date.UTC(2011, 3, 11, 8, 16, 12));
63
+ * const oneMonthLater = new Date(quake.getTime()).setMonth(quake.getMonth() + 1);
64
+ * switch(event.action.id) {
65
+ * case "quake":
66
+ * timeSlider.timeExtent = {
67
+ * start: quake,
68
+ * end: quake
69
+ * };
70
+ * break;
71
+ * case "quake-plus-one-month":
72
+ * timeSlider.timeExtent = {
73
+ * start: oneMonthLater,
74
+ * end: oneMonthLater
75
+ * };
76
+ * break;
77
+ * }
78
+ * });
99
79
  */
100
- accessor actions: Collection<Action> | undefined;
80
+ accessor actions: Collection<Action>;
101
81
  /**
102
82
  * If true, the component will not be destroyed automatically when it is
103
83
  * disconnected from the document. This is useful when you want to move the
@@ -113,94 +93,46 @@ export abstract class ArcgisTimeSlider extends LitElement {
113
93
  *
114
94
  * @default false
115
95
  * @example
116
- * ```html
117
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
118
- * <arcgis-time-slider slot="top-right" disabled></arcgis-time-slider>
119
- * </arcgis-map>
120
- * ```
121
- * ```js
122
- * <script type="module">
123
- * const [TimeExtent] = await $arcgis.import([
124
- * "@arcgis/core/time/TimeExtent.js",
125
- * ]);
126
- *
127
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
128
- * await timeSliderElement.componentOnReady();
129
- *
130
- * timeSliderElement.fullTimeExtent = new TimeExtent({
131
- * start: new Date(2000, 0, 1),
132
- * end: new Date(2010, 0, 1),
133
- * });
134
- *
135
- * console.log("Time slider disabled:", timeSliderElement.disabled); // true
136
- * </script>
137
- * ```
96
+ * // Create a timeslider widget that is initially disabled.
97
+ * const timeSlider = new TimeSlider({
98
+ * container: "timeSliderDiv",
99
+ * fullTimeExtent: {
100
+ * start: new Date(2000, 5, 1),
101
+ * end: new Date(2010, 0, 1)
102
+ * },
103
+ * disabled: true
104
+ * });
138
105
  */
139
106
  accessor disabled: boolean;
140
107
  /**
141
- * The dates that the time slider's handles will snap to when manipulated.
108
+ * Lists the specific locations on the timeline where handle(s) will snap to when manipulated.
142
109
  *
143
110
  * @example
144
- * ```html
145
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
146
- * <arcgis-time-slider slot="top-right"></arcgis-time-slider>
147
- * </arcgis-map>
148
- * ```
149
- * ```js
150
- * <script type="module">
151
- * const [TimeExtent] = await $arcgis.import([
152
- * "@arcgis/core/time/TimeExtent.js",
153
- * ]);
154
- *
155
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
156
- * await timeSliderElement.componentOnReady();
157
- *
158
- * // The time-slider will span the first five days of 2000.
159
- * timeSliderElement.fullTimeExtent = new TimeExtent({
160
- * start: new Date(2000, 0, 1),
161
- * end: new Date(2000, 0, 6),
162
- * });
163
- *
164
- * // Specify stops at five evenly spaced intervals.
165
- * timeSliderElement.stops = {
166
- * count: 5,
167
- * };
168
- *
169
- * // Display the effective stops to the console.
170
- * console.log(timeSliderElement.effectiveStops.map(
171
- * (date) => new Intl.DateTimeFormat("en-US", { dateStyle: "short" }).format(date)
172
- * ).join(", "));
173
- * // Output: "1/1/00", "1/2/00", "1/3/00", "1/4/00", "1/6/00"
174
- * </script>
175
- * ```
111
+ * timeSlider.effectiveStops.forEach((stop) => {
112
+ * console.log(stop);
113
+ * });
176
114
  */
177
- get effectiveStops(): Date[] | null | undefined;
115
+ get effectiveStops(): Array<Date> | null | undefined;
178
116
  /**
179
- * The temporal extent of the entire slider. It defines the upper and lower bounds of the time slider and the range
180
- * within which the thumbs can be manipulated.
117
+ * The temporal extent of the entire slider.
118
+ * It defines the entire time period within which you can visualize
119
+ * your time aware data using the time slider component.
181
120
  *
182
121
  * @example
183
- * ```html
184
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
185
- * <arcgis-time-slider slot="top-right"></arcgis-time-slider>
186
- * </arcgis-map>
187
- * ```
188
- * ```js
189
- * <script type="module">
190
- * const [TimeExtent] = await $arcgis.import([
191
- * "@arcgis/core/time/TimeExtent.js",
192
- * ]);
193
- *
194
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
195
- * await timeSliderElement.componentOnReady();
196
- *
197
- * // The time-slider will span ten years from 2000 to 2010.
198
- * timeSliderElement.fullTimeExtent = new TimeExtent({
199
- * start: new Date(2000, 0, 1),
200
- * end: new Date(2010, 0, 1),
201
- * });
202
- * </script>
203
- * ```
122
+ * // Create a new TimeSlider with set dates
123
+ * const timeSlider = new TimeSlider({
124
+ * container: "timeSliderDiv",
125
+ * view: view
126
+ * });
127
+ *
128
+ * // wait for the time-aware layer to load
129
+ * layer.when(() => {
130
+ * // set up time slider properties based on layer timeInfo
131
+ * timeSlider.fullTimeExtent = layer.timeInfo.fullTimeExtent;
132
+ * timeSlider.stops = {
133
+ * interval: layer.timeInfo.interval
134
+ * };
135
+ * });
204
136
  */
205
137
  accessor fullTimeExtent: TimeExtent | null | undefined;
206
138
  /**
@@ -208,139 +140,95 @@ export abstract class ArcgisTimeSlider extends LitElement {
208
140
  * Typically used when the component is controlled by another component (e.g. by the Expand component).
209
141
  *
210
142
  * @default "clock"
143
+ * @since 4.27
211
144
  * @see [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/)
212
145
  */
213
- accessor icon: IconName | undefined;
214
- /** The component's default label. */
215
- accessor label: string | undefined;
146
+ get icon(): Icon["icon"];
147
+ set icon(value: IconName);
216
148
  /**
217
- * An optional callback function that can be used to customize the content of the minimum, maximum, and extent labels.
218
- * The function receives the date(s) to be formatted, the type of label to format, the HTML element in which the
219
- * formatted string will be placed, and the layout of the component as arguments.
149
+ * The component's default label.
220
150
  *
221
- * @example
222
- * The following snippet will display the day of the week (e.g. Monday, Tuesday, etc.) rather than the default
223
- * date format for the min, max, and extent labels.
224
- * ```html
225
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
226
- * <arcgis-time-slider slot="top-right" mode="instant"></arcgis-time-slider>
227
- * </arcgis-map>
228
- * ```
229
- * ```js
230
- * <script type="module">
231
- * const [TimeExtent, TimeInterval] = await $arcgis.import([
232
- * "@arcgis/core/time/TimeExtent.js",
233
- * "@arcgis/core/time/TimeInterval.js",
234
- * ]);
235
- *
236
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
237
- * await timeSliderElement.componentOnReady();
238
- *
239
- * timeSliderElement.fullTimeExtent = new TimeExtent({
240
- * start: new Date(2026, 3, 6),
241
- * end: new Date(2026, 3, 10),
242
- * });
243
- * timeSliderElement.stops = {
244
- * interval: new TimeInterval({
245
- * unit: "days",
246
- * value: 1,
247
- * }),
248
- * };
249
- *
250
- * function getDayOfTheWeek(date: Date): string {
251
- * return date.toLocaleDateString("en-US", { weekday: "long" });
252
- * }
253
- *
254
- * timeSliderElement.labelFormatFunction = (value, type, element, layout) => {
255
- * element.innerHTML =
256
- * type === "extent"
257
- * ? getDayOfTheWeek(date[0]) // Format the start date of the time-slider's current time extent.
258
- * : getDayOfTheWeek(date); // Format the min/max of the time-slider's full time extent.
259
- * };
260
- * </script>
261
- * ```
151
+ * @since 4.11
262
152
  */
263
- accessor labelFormatFunction: DateLabelFormatter | undefined;
153
+ accessor label: string;
264
154
  /**
265
- * Defines the layout of the component. The layout determines the orientation of the component elements and how much space they consume.
155
+ * Determines the layout used by the TimeSlider component.
266
156
  *
267
- * There are main layouts, "compact" and "wide", and an "auto" layout that switches between the two based on the component's width.
268
- * The "compact" layout stacks the elements vertically and is better suited for narrow widths, while the "wide"
269
- * layout arranges the elements laterally and is better for wider applications.
157
+ * Possible values are listed below:
158
+ * | Value | Description |
159
+ * | --- | --- |
160
+ * | auto | Automatically uses the "compact" layout when the component width is less than 858 pixels. Otherwise the "wide" layout it used. |
161
+ * | compact | Component elements are oriented vertically. This layout is better suited to narrower widths. |
162
+ * | wide | Component elements are oriented laterally. This thinner design is better suited to wide applications. |
270
163
  *
271
164
  * @default "auto"
272
- * @example
273
- * Explicitly set the layout to "wide".
274
- * ```html
275
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
276
- * <arcgis-time-slider slot="top-right" layout="wide"></arcgis-time-slider>
277
- * </arcgis-map>
278
- * ```
165
+ * @since 4.16
166
+ * @example timeSlider.layout = "compact";
279
167
  */
280
- accessor layout: Layout;
168
+ accessor layout: TimeSliderLayout;
281
169
  /**
282
- * When `true`, time slider will restart from the beginning when it reaches the end of the slider when playing.
170
+ * When `true`, the time slider will play its animation in a loop.
283
171
  *
284
172
  * @default false
285
173
  * @example
286
- * Set the time slider to loop continuously while playing.
287
- * ```html
288
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
289
- * <arcgis-time-slider slot="top-right" loop></arcgis-time-slider>
290
- * </arcgis-map>
291
- * ```
174
+ * // Start a time slider animation that advances every second
175
+ * // and restarts when it reaches the end.
176
+ * timeSlider.set({
177
+ * loop: true,
178
+ * playRate: 1000
179
+ * });
180
+ * timeSlider.play();
292
181
  */
293
182
  accessor loop: boolean;
294
183
  /**
295
- * Replace localized message strings with your own strings.
184
+ * The time slider mode. This property is used for defining if the temporal data will be displayed
185
+ * cumulatively up to a point in time, a single instant in time, or within a time range. See
186
+ * the following table for possible values.
296
187
  *
297
- * _**Note**: Individual message keys may change between releases._
298
- */
299
- accessor messageOverrides: {
300
- componentLabel?: string | undefined;
301
- control?: {
302
- play?: string | undefined;
303
- stop?: string | undefined;
304
- } | undefined;
305
- emptyTimeExtent?: string | undefined;
306
- noTimeExtent?: string | undefined;
307
- options?: string | undefined;
308
- pagination?: {
309
- next?: string | undefined;
310
- previous?: string | undefined;
311
- } | undefined;
312
- };
313
- /**
314
- * The time slider mode. The mode determines how the time extent is calculated based on the position of the thumb(s)
315
- * and the behavior of the component when the thumbs are manipulated.
188
+ * Possible Values | Description | Example |
189
+ * ----------------------|-------------- | ------- |
190
+ * instant | The slider will show temporal data that falls on a single instance in time. Set the [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent) property's `start` and `end` dates to same date: `{start: sameDate, end: sameDate}` | <img alt="mode-instance" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/timeslider/mode-instance.png"> |
191
+ * time-window | The slider will show temporal data that falls within a given time range. This is the default. Set [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent) property's `start` and `date` properties to desired dates. | <img alt="mode-instance" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/timeslider/mode-time-window.png"> |
192
+ * cumulative-from-start | Similar to `time-window` with the start time is always pinned to the start of the slider. Set the [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent) property's `start` date to `null` and set `end` date to a desired date: `{start: null, end: date}` | <img alt="mode-instance" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/timeslider/mode-from-start.png"> |
193
+ * cumulative-from-end | Also, similar to the `time-window` with the end time pinned to the end of the slider. Set the [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent) property's `start` date to a desired date and set `end` date to `null`: `{start: date, end: null}` | <img alt="mode-instance" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/timeslider/mode-from-end.png"> |
316
194
  *
317
195
  * @default "time-window"
196
+ * @see [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent)
318
197
  * @example
319
- * Set the mode to "instant" to show temporal data that falls on a single instance in time.
320
- * ```html
321
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
322
- * <arcgis-time-slider slot="top-right" mode="instant"></arcgis-time-slider>
323
- * </arcgis-map>
324
- * ```
198
+ * // Create a single thumbed time slider that includes all historic content.
199
+ * const timeSlider = new TimeSlider({
200
+ * container: "timeSliderDiv",
201
+ * view: view,
202
+ * mode: "cumulative-from-start",
203
+ * fullTimeExtent: {
204
+ * start: new Date(2000, 0, 1),
205
+ * end: new Date(2010, 0, 1)
206
+ * },
207
+ * timeExtent: {
208
+ * start: null,
209
+ * end: new Date(2001, 0, 1) //end date
210
+ * }
211
+ * });
325
212
  */
326
- accessor mode: Mode;
213
+ accessor mode: TimeSliderMode;
327
214
  /**
328
- * When `arcgis-time-slider` is playing, the play rate determines the interval (in milliseconds) between animation steps.
215
+ * The time (in milliseconds) between animation steps.
329
216
  *
330
217
  * > [!WARNING]
331
218
  * >
332
- * > When `arcgis-time-slider` is associated with a `arcgis-map` or `argis-scene` component, the actual playback rate may differ.
333
- * > Specifically, the current time extent will only advance after the designated play rate interval and after the view has finished updating.
334
- * > This means that if the view takes longer to update than the specified play rate, the effective play rate will be slower than expected.
219
+ * > When a [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/) is associated with a TimeSlider and the TimeSlider is playing, the playback will pause before advancing if the View is still updating.
220
+ * > For example, if the `playRate` is set to 1,000 (one second) and the `View` takes 1.5 seconds to render then the TimeSlider thumb(s) will advance every
221
+ * > 1.5 seconds rather than every second.
335
222
  *
336
223
  * @default 1000
337
224
  * @example
338
- * Set the play rate to 500 milliseconds (half a second).
339
- * ```html
340
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
341
- * <arcgis-time-slider slot="top-right" play-rate="500"></arcgis-time-slider>
342
- * </arcgis-map>
343
- * ```
225
+ * // Start a time slider animation that advances
226
+ * // ten times a second and stops when it reaches the end.
227
+ * timeSlider.set({
228
+ * loop: false,
229
+ * playRate: 100
230
+ * });
231
+ * timeSlider.play();
344
232
  */
345
233
  accessor playRate: number;
346
234
  /**
@@ -354,483 +242,260 @@ export abstract class ArcgisTimeSlider extends LitElement {
354
242
  *
355
243
  * @default "disabled"
356
244
  * @example
357
- * The following snippet will log the time slider's state to the console whenever it changes.
358
- * ```html
359
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
360
- * <arcgis-time-slider slot="top-right"></arcgis-time-slider>
361
- * </arcgis-map>
362
- * ```
363
- * ```js
364
- * <script type="module">
365
- * const [TimeExtent, reactiveUtils] = await $arcgis.import([
366
- * "@arcgis/core/time/TimeExtent.js",
367
- * "@arcgis/core/core/reactiveUtils.js",
368
- * ]);
369
- *
370
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
371
- * await timeSliderElement.componentOnReady();
372
- *
373
- * timeSliderElement.fullTimeExtent = new TimeExtent({
374
- * start: new Date(2026, 3, 6),
375
- * end: new Date(2026, 3, 10),
376
- * });
377
- * reactiveUtils.watch(
378
- * () => timeSliderElement.state,
379
- * (state) => {
380
- * console.log("Time slider state:", state);
381
- * },
382
- * );
383
- * </script>
384
- * ```
245
+ * // Display the current state of the view model.
246
+ * switch (timeSlider.viewModel.state) {
247
+ * case "disabled":
248
+ * console.log("The view is not ready or some property are not set.");
249
+ * break;
250
+ * case "ready":
251
+ * console.log("The time slider is ready for use.");
252
+ * break;
253
+ * case "playing":
254
+ * console.log("The time slider is currently animating.");
255
+ * break;
256
+ * }
385
257
  */
386
- get state(): State;
258
+ get state(): TimeSliderState;
387
259
  /**
388
- * Defines the stops on the time slider. Stops are specific dates that the thumb, or thumbs, will snap to when manipulated.
260
+ * Defines specific locations on the time slider where thumbs will snap to when manipulated.
261
+ * If unspecified, ten evenly spaced stops will be added.
389
262
  *
390
- * @default { count : 10 }
391
- * @example
392
- * To allow thumbs to snap to evenly spaced intervals, assign an object with a `count` property as shown below.
393
- * The default value for stops is ten evenly spaced intervals across the full time extent.
263
+ * For continuous sliding, set `stops` to `null`:
394
264
  * ```js
395
- * <script type="module">
396
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
397
- * await timeSliderElement.componentOnReady();
398
- *
399
- * timeSliderElement.stops = {
400
- * count: 10,
401
- * };
402
- * </script>
265
+ * timeSlider.stops = null;
403
266
  * ```
404
- * @example
405
- * To allow thumbs to be manipulated continuously without snapping to specific dates, set `stops` to `null`:
406
- * ```js
407
- * <script type="module">
408
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
409
- * await timeSliderElement.componentOnReady();
410
267
  *
411
- * timeSliderElement.stops = null;
412
- * </script>
413
- * ```
414
- * @example
415
- * To allow thumbs to snap to specific dates, assign an array of dates to a `dates` property as shown below.
268
+ * To define regularly spaced stops, parse an object with `interval` and `timeExtent` properties
269
+ * with types [TimeInterval](https://developers.arcgis.com/javascript/latest/references/core/time/TimeInterval/) and [TimeExtent](https://developers.arcgis.com/javascript/latest/references/core/time/TimeExtent/) respectively.
270
+ * The [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent) property is optional and used to confine stops to a certain date range.
271
+ * This property is useful to commence stops on a specific day of the week or month.
272
+ * If a stop definition by interval results in excess of 10,000 stops, then the view model
273
+ * will default to ten evenly spaced stops.
274
+ *
416
275
  * ```js
417
- * <script type="module">
418
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
419
- * await timeSliderElement.componentOnReady();
420
- *
421
- * timeSliderElement.stops = {
422
- * dates: [
423
- * new Date(2000, 0, 1), new Date(2001, 3, 8), new Date(2002, 0, 10),
424
- * new Date(2003, 12, 8), new Date(2004, 2, 19), new Date(2005, 7, 5),
425
- * new Date(2006, 9, 11), new Date(2007, 11, 21), new Date(2008, 1, 10)
426
- * ],
427
- * };
428
- * </script>
276
+ * // Add yearly intervals starting from the beginning of the TimeSlider.
277
+ * timeSlider.stops = {
278
+ * interval: {
279
+ * value: 1,
280
+ * unit: "years"
281
+ * }
282
+ * };
429
283
  * ```
430
- * @example
431
- * To allow thumbs to snap at a regular interval, such as daily, month or yearly, assign a `TimeInterval` object to an `interval` property as shown below.
284
+ * Rather than setting the stops as time intervals, the TimeSlider can be divided into evenly spaced
285
+ * stops using the `count` property. Similar to the previous method, divisions can be confined to a specific date range
286
+ * using the optional timeExtent property.
432
287
  * ```js
433
- * <script type="module">
434
- * const [TimeInterval] = await $arcgis.import([
435
- * "@arcgis/core/time/TimeInterval.js",
436
- * ]);
437
- *
438
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
439
- * await timeSliderElement.componentOnReady();
440
- *
441
- * timeSliderElement.stops = {
442
- * interval: new TimeInterval({
443
- * value: 1,
444
- * unit: "years"
445
- * }),
446
- * };
447
- * </script>
288
+ * // Add stops at 15 evenly spaced intervals.
289
+ * timeSlider.stops = {
290
+ * count: 15
291
+ * };
448
292
  * ```
449
- * @example
450
- * Lastly, both the interval and count stop definitions can optionally use a `timeExtent` property to confine the definitions to a specific range.
451
- * For example, the following defines a time slider with a full time extent of the year 2026. However, daily stops only exist in the month of April.
293
+ * For irregularly spaced stops, simply assign an array of dates as demonstrated below.
452
294
  * ```js
453
- * <script type="module">
454
- * const [TimeExtent, TimeInterval] = await $arcgis.import([
455
- * "@arcgis/core/time/TimeExtent.js",
456
- * "@arcgis/core/time/TimeInterval.js",
457
- * ]);
458
- *
459
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
460
- * await timeSliderElement.componentOnReady();
461
- *
462
- * // The time-slider will span the entire year of 2026.
463
- * timeSliderElement.fullTimeExtent = new TimeExtent({
464
- * start: new Date(2026, 0, 1),
465
- * end: new Date(2027, 0, 1),
466
- * });
467
- *
468
- * // However, the slider's thumbs will only snap to days within the month of April.
469
- * timeSliderElement.stops = {
470
- * interval: new TimeInterval({
471
- * value: 1,
472
- * unit: "days"
473
- * }),
474
- * timeExtent: new TimeExtent({
475
- * start: new Date(2026, 3, 1),
476
- * end: new Date(2026, 4, 1),
477
- * }),
478
- * };
479
- * </script>
295
+ * // Add nine irregular stops.
296
+ * timeSlider.stops = {
297
+ * dates: [
298
+ * new Date(2000, 0, 1), new Date(2001, 3, 8), new Date(2002, 0, 10),
299
+ * new Date(2003, 12, 8), new Date(2004, 2, 19), new Date(2005, 7, 5),
300
+ * new Date(2006, 9, 11), new Date(2007, 11, 21), new Date(2008, 1, 10)
301
+ * ]
302
+ * };
303
+ * ```
304
+ * Lastly, to constrain or offset division by count or interval use the optional timeExtent property.
305
+ * ```js
306
+ * // Add yearly stops from Christmas 2019 to Christmas 2029 only
307
+ * timeSlider.stops = {
308
+ * interval: {
309
+ * value: 1,
310
+ * unit: "years"
311
+ * },
312
+ * timeExtent: {
313
+ * start: new Date(2019, 11, 25),
314
+ * end: new Date(2029, 11, 25)
315
+ * }
316
+ * };
317
+ *
318
+ * // Likewise, add stops that represent quarters of 2019 only.
319
+ * timeSlider.stops = {
320
+ * count: 4,
321
+ * timeExtent: {
322
+ * start: new Date(2019, 0, 1),
323
+ * end: new Date(2020, 0, 1)
324
+ * }
325
+ * };
480
326
  * ```
327
+ *
328
+ * @default { count : 10 }
481
329
  */
482
330
  accessor stops: Stops | null | undefined;
483
331
  /**
484
- * Use `tickConfigs` to define custom ticks on the time slider.
485
- * Custom ticks can be used instead of the default ticks provided by the component.
332
+ * When set, overrides the default TimeSlider ticks labelling system.
333
+ * Please refer to [TickConfig](https://developers.arcgis.com/javascript/latest/references/core/widgets/Slider/types/#TickConfig) for detailed documentation
334
+ * on how to configure tick placement, style, and behavior.
486
335
  *
336
+ * @since 4.16
487
337
  * @example
488
- * The following example adds labelled ticks representing the Northern Hemisphere seasons.
489
- * ```html
490
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
491
- * <arcgis-time-slider slot="top-left" mode="instant"></arcgis-time-slider>
492
- * </arcgis-map>
493
- * ```
494
- * ```js
495
- * <script type="module">
496
- * const [TimeExtent] = await $arcgis.import([
497
- * "@arcgis/core/time/TimeExtent.js",
498
- * ]);
499
- *
500
- * // Define custom ticks with a label and date.
501
- * interface Tick {
502
- * label: string;
503
- * date: Date;
504
- * }
505
- * const ticks: Tick[] = [
506
- * { label: "Winter", date: new Date(2026, 0, 1) },
507
- * { label: "Spring", date: new Date(2026, 2, 20) },
508
- * { label: "Summer", date: new Date(2026, 5, 21) },
509
- * { label: "Fall", date: new Date(2026, 8, 22) },
510
- * { label: "Winter", date: new Date(2027, 0, 1) },
511
- * ];
512
- *
513
- * // Convenience function to match the tick's date to the corresponding label.
514
- * function getLabelForEpoch(epoch: number): string {
515
- * const tick = ticks.find(({ date }) => date.getTime() === epoch);
516
- * return tick?.label ?? "";
517
- * }
518
- *
519
- * // Obtain a reference to the time slider element.
520
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
521
- * await timeSliderElement.componentOnReady();
522
- *
523
- * // Set the time slider's full time extent to span the year 2026.
524
- * timeSliderElement.fullTimeExtent = new TimeExtent({
525
- * start: new Date(2026, 0, 1),
526
- * end: new Date(2027, 0, 1),
527
- * });
528
- *
529
- * // Set the time slider's stops to the custom ticks.
530
- * const dates = ticks.map(({ date }) => date);
531
- * timeSliderElement.stops = { dates };
532
- *
533
- * // Set the time slider's tick configurations to the custom ticks.
534
- * const values = dates.map((date) => date.getTime());
535
- * timeSliderElement.tickConfigs = [
536
- * {
537
- * // Position ticks absolutely based on the date, rather than at regular intervals.
538
- * mode: "position",
539
- * // Show labels for the ticks.
540
- * labelsVisible: true,
541
- * // Match the tick's date to the corresponding label.
542
- * labelFormatFunction: (epoch) => getLabelForEpoch(epoch),
543
- * // Location of the ticks based on the date.
544
- * values,
338
+ * // By default in "en-US" the TimeSlider will display ticks with "2010, 2011, 2012, etc".
339
+ * // Overwrite TimeSlider tick configuration so that labels display "'10, '12, '14, etc" in red.
340
+ * const timeSlider = new TimeSlider({
341
+ * container: "timeSliderDiv",
342
+ * fullTimeExtent: {
343
+ * start: new Date(2010, 0, 1),
344
+ * end: new Date(2020, 0, 1)
345
+ * },
346
+ * tickConfigs: [{
347
+ * mode: "position",
348
+ * values: [
349
+ * new Date(2010, 0, 1), new Date(2012, 0, 1), new Date(2014, 0, 1),
350
+ * new Date(2016, 0, 1), new Date(2018, 0, 1), new Date(2020, 0, 1)
351
+ * ].map((date) => date.getTime()),
352
+ * labelsVisible: true,
353
+ * labelFormatFunction: (value) => {
354
+ * const date = new Date(value);
355
+ * return `'${date.getUTCFullYear() - 2000}`;
545
356
  * },
546
- * ];
547
- * </script>
548
- * ```
357
+ * tickCreatedFunction: (value, tickElement, labelElement) => {
358
+ * tickElement.classList.add("custom-ticks");
359
+ * labelElement.classList.add("custom-labels");
360
+ * }
361
+ * }]
362
+ * };
363
+ * @example
364
+ * // this CSS goes with the snippet above.
365
+ * #timeSlider .custom-ticks {
366
+ * background-color: red;
367
+ * width: 1px;
368
+ * height: 8px;
369
+ * }
370
+ * #timeSlider .custom-labels {
371
+ * font-family: Georgia, 'Times New Roman', Times, serif;
372
+ * font-size: 15px;
373
+ * color: red;
374
+ * }
549
375
  */
550
- accessor tickConfigs: TickConfig[] | undefined;
376
+ accessor tickConfigs: Array<TickConfig> | null | undefined;
551
377
  /**
552
- * The current time extent of the time slider.
553
- *
554
- * When the `arcgis-time-slider` is associated with an `arcgis-map` or `arcgis-scene` component,
555
- * the time slider's time extent will synchronize with the view's time extent.
556
- * Meaning that any changes to one time extent property will be mirrored in the other.
557
- *
558
- * It is important to note that the time extent returned by this property will conform to the format in the table
559
- * below based on the current `mode` of the time slider. Similarly, this format should be followed when assigning
560
- * a new time extent to ensure proper behavior of the component and synchronization with an attached map or scene's
561
- * time extent.
378
+ * The current time extent of the time slider. This property can be watched for
379
+ * updates and used to update the time extent property in queries and/or the layer filters and effects.
380
+ * The following table shows the `timeExtent` values returned for each [mode](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#mode).
562
381
  *
563
- *
564
- * | Mode | Description | Example |
565
- * |-------------------------|-------------------------------|---------------------------------------------------------------|
566
- * | `time-window` | Non-null start and end dates | `{ start: new Date(2019, 2, 1), end: new Date(2019, 2, 28) }` |
567
- * | `instant` | Identical start and end dates | `{ start: new Date(2019, 2, 1), end: new Date(2019, 2, 1) }` |
568
- * | `cumulative-from-start` | `null` start date | `{ start: null, end: new Date(2019, 2, 28) }` |
569
- * | `cumulative-from-end` | `null` end date | `{ start: new Date(2019, 2, 1), end: null }` |
382
+ * | Mode | The timeExtent value |
383
+ * | ------- | -------------------- |
384
+ * | `time-window` | `{start: startDate, end: endDate}` |
385
+ * | `instant` | `{start: sameDate, end: sameDate}` |
386
+ * | `cumulative-from-start` | `{start: null, end: endDate}` |
387
+ * | `cumulative-from-end` | `{start: startDate, end: null}` |
570
388
  *
571
389
  * @example
572
- * The `arcgis-time-slider` may be used indepentantly of an `arcgis-map` or `arcgis-scene` component.
573
- * In the following example, the time slider does not reference an `arcgis-map` and is used to update a single layer's filter.
574
- * ```html
575
- * <arcgis-map basemap="dark-gray-vector" zoom="13" center="-117.512764, 34.04355"></arcgis-map>
576
- * <arcgis-time-slider mode="time-window" play-rate="50"></arcgis-time-slider>
577
- * ```
578
- * ```js
579
- * <script type="module">
580
- * const [GeoJSONLayer, TimeInterval, reactiveUtils] = await $arcgis.import([
581
- * "@arcgis/core/layers/GeoJSONLayer.js",
582
- * "@arcgis/core/time/TimeInterval.js",
583
- * "@arcgis/core/core/reactiveUtils.js",
584
- * ]);
585
- * const layer = new GeoJSONLayer({
586
- * url: "https://bsvensson.github.io/various-tests/geojson/usgs-earthquakes-06182019.geojson",
587
- * timeInfo: {
588
- * startField: "time",
589
- * interval: { unit: "days", value: 1 },
590
- * },
591
- * });
592
- *
593
- * const viewElement = document.querySelector("arcgis-map");
594
- * await viewElement.viewOnReady();
595
- * viewElement.add(layer);
596
- *
597
- * await viewElement.viewOnReady();
598
- * const layerView = await viewElement.whenLayerView(layer);
599
- *
600
- * const timeSlider = document.querySelector("arcgis-time-slider");
601
- * await timeSlider.componentOnReady()
602
- *
603
- * timeSlider.fullTimeExtent = layer.timeInfo.fullTimeExtent.expandTo("hours");
604
- * timeSlider.stops = {
605
- * interval: new TimeInterval({ value: 1, unit: "hours" }),
606
- * };
390
+ * // Display the time extent to the console whenever it changes.
391
+ * const timeSlider = new TimeSlider({
392
+ * container: "timeSliderDiv",
393
+ * mode: "time-window",
394
+ * fullTimeExtent: {
395
+ * start: new Date(2019, 2, 3),
396
+ * end: new Date(2019, 2, 5)
397
+ * },
398
+ * timeExtent: {
399
+ * start: new Date(2019, 2, 1),
400
+ * end: new Date(2019, 2, 28)
401
+ * }
402
+ * });
607
403
  *
608
- * // Whenever the time slider's time extent changes, update the layer view's feature effect to highlight features
609
- * // that fall within the current time extent and dim features that fall outside of it.
610
- * reactiveUtils.watch(
611
- * () => timeSlider.timeExtent,
612
- * (timeExtent) => {
613
- * layerView.featureEffect = {
614
- * filter: { timeExtent },
615
- * excludedEffect: "grayscale(20%) opacity(12%)",
616
- * };
617
- * }
618
- * );
619
- * ```
404
+ * reactiveUtils.watch(
405
+ * () => timeSlider.timeExtent,
406
+ * (timeExtent) => {
407
+ * console.log("Time extent now starts at", timeExtent.start, "and finishes at:", timeExtent.end);
408
+ * }
409
+ * );
620
410
  */
621
411
  accessor timeExtent: TimeExtent | null | undefined;
622
412
  /**
623
- * If `true`, the time component of dates is displayed in the minimum, maximum, and time extent labels.
624
- * This property is useful when the time extent of the slider is narrow or when the time component of the date is relevant to the user.
413
+ * Shows/hides time in the display.
625
414
  *
626
415
  * @default false
627
416
  * @example
628
- * ```html
629
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
630
- * <arcgis-time-slider slot="top-left" time-visible></arcgis-time-slider>
631
- * </arcgis-map>
632
- * ```
417
+ * // For time sliders with a small time extent it may be useful to display times as shown below.
418
+ * const timeSlider = new TimeSlider({
419
+ * container: "timeSliderDiv",
420
+ * mode: "time-window",
421
+ * timeVisible: true,
422
+ * fullTimeExtent: {
423
+ * start: new Date(2019, 2, 3),
424
+ * end: new Date(2019, 2, 5)
425
+ * },
426
+ * timeExtent: {
427
+ * start: new Date(2019, 2, 1),
428
+ * end: new Date(2019, 2, 28)
429
+ * }
430
+ * });
633
431
  */
634
432
  accessor timeVisible: boolean;
635
433
  /**
636
- * The `arcgis-time-slider` component will display dates and times in the time zone specified by this property.
637
- * By default, the time zone is inherited from an associated `arcgis-map` or `arcgis-scene` component's view.
638
- * If there is no associated view, the time zone will default to `"system"`, the device's time zone.
434
+ * Dates and times displayed in the component will be displayed in this time zone. By default this time zone is
435
+ * inherited from [MapView#timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone). When a MapView is not associated with the component
436
+ * then the property will fallback to the `system` time zone.
639
437
  *
640
- * @example
641
- * To specify a particular time zone, assign a valid IANA time zone string to the `time-zone` property as shown below.
642
- * ```html
643
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
644
- * <arcgis-time-slider slot="top-left" time-zone="Pacific/Auckland"></arcgis-time-slider>
645
- * </arcgis-map>
646
- * ```
647
- * @see [wikipedia - List of tz database time zones](https://wikipedia.org/wiki/List_of_tz_database_time_zones)
648
- * @see [arcgis-map.timeZone](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/#timeZone)
649
- * @see [MapView#timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone)
438
+ * **Possible Values**
439
+ *
440
+ * Value | Description |
441
+ * ----- | ----------- |
442
+ * system | Dates and times will be displayed in the timezone of the device or browser.
443
+ * unknown | Dates and time are not adjusted for any timezone. [TimeSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/) will be disabled.
444
+ * Specified IANA timezone | Dates and times will be displayed in the specified IANA time zone. See [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
445
+ *
446
+ * @since 4.28
650
447
  */
651
- accessor timeZone: string | undefined;
448
+ accessor timeZone: string;
652
449
  /**
653
450
  * The view associated with the component.
654
451
  * > **Note:** The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this `view` property which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-time-slider component will be associated with a map or scene component rather than using the `view` property.
655
- */
656
- accessor view: MapView | SceneView | null | undefined;
657
- /**
658
- * This method will update multiple time slider properties and is intended to be used in conjunction with
659
- * [getTimeSliderSettingsFromWebDocument](https://developers.arcgis.com/javascript/latest/references/core/support/timeUtils/#getTimeSliderSettingsFromWebDocument).
660
- *
661
- * `getTimeSliderSettingsFromWebDocument` is a utility function that extracts time slider settings (if any) from a
662
- * published web map or web scene. This method can be used to apply those settings to the time slider component.
663
452
  *
664
- * @param settings
665
453
  * @example
666
- * The following example demonstrates how to use `getTimeSliderSettingsFromWebDocument` and `applyTimeSliderSettings`
667
- * together to extract time slider settings from a web map and apply them to the time slider component.
668
- * ```html
669
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
670
- * <arcgis-time-slider slot="top-left"></arcgis-time-slider>
671
- * </arcgis-map>
672
- * ```
673
454
  * ```js
674
- * <script type="module">
675
- * const [timeUtils] = await $arcgis.import([
676
- * "@arcgis/core/support/timeUtils.js",
677
- * ]);
678
- *
679
- * const webMap = new WebMap({
680
- * portalItem: {
681
- * id: "your-webmap-id",
682
- * }
683
- * });
684
- * await webMap.load();
685
- *
686
- * const timeSliderSettings = await timeUtils.getTimeSliderSettingsFromWebDocument(webMap);
455
+ * // Create and then add a TimeSlider component and then listen to changes in the View's time extent.
456
+ * const timeSlider = new TimeSlider({
457
+ * container: "timeSliderDiv",
458
+ * view: view,
459
+ * mode: "instant",
460
+ * fullTimeExtent: {
461
+ * start: new Date(2000, 0, 1),
462
+ * end: new Date(2010, 0, 1)
463
+ * },
464
+ * timeExtent: {
465
+ * start: new Date(2000, 0, 1),
466
+ * end: new Date(2000, 0, 1)
467
+ * }
468
+ * });
469
+ * view.ui.add(timeSlider, "top-left");
687
470
  *
688
- * const timeSlider = document.querySelector("arcgis-time-slider");
689
- * await timeSlider.componentOnReady();
690
- * timeSlider.applyTimeSliderSettings(timeSliderSettings);
691
- * </script>
471
+ * reactiveUtils.watch(
472
+ * () => view.timeExtent,
473
+ * (timeExtent) => {
474
+ * console.log("New view time is: ", timeExtent.start);
475
+ * }
476
+ * );
692
477
  * ```
693
478
  */
479
+ accessor view: MapViewOrSceneView | null | undefined;
480
+ /** @param settings */
694
481
  applyTimeSliderSettings(settings: TimeSliderSettings): Promise<void>;
695
482
  /** Permanently destroy the component. */
696
483
  destroy(): Promise<void>;
697
- /**
698
- * Incrementally moves the [timeExtent](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-slider/#timeExtent) forward one stop.
699
- *
700
- * @example
701
- * The following example demonstrates how to use the `next` method to move the time slider's time extent forward one
702
- * stop when a button is clicked.
703
- * ```html
704
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
705
- * <arcgis-time-slider slot="top-left" mode="instant"></arcgis-time-slider>
706
- * </arcgis-map>
707
- * <button id="next-button">Next</button>
708
- * ```
709
- * ```js
710
- * <script type="module">
711
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
712
- * await timeSliderElement.componentOnReady();
713
- *
714
- * document.getElementById("next-button").addEventListener("click", () => {
715
- * timeSliderElement.next();
716
- * });
717
- * </script>
718
- * ```
719
- */
720
484
  next(): Promise<void>;
721
- /**
722
- * Initiates playback of the time slider, causing the [timeExtent](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-slider/#timeExtent) to
723
- * incrementally move forward based on the defined [playRate](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-slider/#playRate) and
724
- * [stops](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-slider/#stops).
725
- *
726
- * Note that when [loop](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-slider/#loop) is `true`, the time slider will restart from the
727
- * beginning when it reaches the end of the slider while playing.
728
- *
729
- * @example
730
- * The following example demonstrates how to use the `play` method to start playback of the time slider when a button
731
- * is clicked.
732
- * ```html
733
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
734
- * <arcgis-time-slider slot="top-left" mode="instant"></arcgis-time-slider>
735
- * </arcgis-map>
736
- * <button id="play-button">Play</button>
737
- * ```
738
- * ```js
739
- * <script type="module">
740
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
741
- * await timeSliderElement.componentOnReady();
742
- *
743
- * document.getElementById("play-button").addEventListener("click", () => {
744
- * timeSliderElement.play();
745
- * });
746
- * </script>
747
- * ```
748
- */
749
485
  play(): Promise<void>;
750
- /**
751
- * Incrementally moves the [timeExtent](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-slider/#timeExtent) backward one stop.
752
- *
753
- * @example
754
- * The following example demonstrates how to use the `previous` method to move the time slider's time extent backward
755
- * one stop when a button is clicked.
756
- * ```html
757
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
758
- * <arcgis-time-slider slot="top-left" mode="instant"></arcgis-time-slider>
759
- * </arcgis-map>
760
- * <button id="previous-button">Previous</button>
761
- * ```
762
- * ```js
763
- * <script type="module">
764
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
765
- * await timeSliderElement.componentOnReady();
766
- *
767
- * document.getElementById("previous-button").addEventListener("click", () => {
768
- * timeSliderElement.previous();
769
- * });
770
- * </script>
771
- * ```
772
- */
773
486
  previous(): Promise<void>;
774
- /**
775
- * Stops time slider playback.
776
- *
777
- * @example
778
- * The following example demonstrates how to use the `stop` method to stop time slider playback when a button
779
- * is clicked.
780
- * ```html
781
- * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
782
- * <arcgis-time-slider slot="top-left" mode="instant"></arcgis-time-slider>
783
- * </arcgis-map>
784
- * <button id="stop-button">Stop</button>
785
- * ```
786
- * ```js
787
- * <script type="module">
788
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
789
- * await timeSliderElement.componentOnReady();
790
- *
791
- * document.getElementById("stop-button").addEventListener("click", () => {
792
- * timeSliderElement.stop();
793
- * });
794
- * </script>
795
- * ```
796
- */
797
487
  stop(): Promise<void>;
798
- /**
799
- * Updates the time slider definition in the parsed web document.
800
- *
801
- * @param document
802
- * @example
803
- * The following example demonstrates how to use the `stop` method to stop time slider playback when a button
804
- * is clicked.
805
- * ```html
806
- * <arcgis-map item-id="acea555a4b6f412dae98994bcfdbc002">
807
- * <arcgis-time-slider slot="top-left"></arcgis-time-slider>
808
- * </arcgis-map>
809
- * <button id="save-button">Save</button>
810
- * ```
811
- * ```js
812
- * <script type="module">
813
- * const timeSliderElement = document.querySelector("arcgis-time-slider");
814
- * await timeSliderElement.componentOnReady();
815
- *
816
- * const viewElement = document.querySelector("arcgis-map");
817
- * await viewElement.viewOnReady();
818
- *
819
- * document.getElementById("save-button").addEventListener("click", async () => {
820
- * timeSliderElement.updateWebDocument(viewElement.map);
821
- * const portalItem = await viewElement.map.save();
822
- * });
823
- * </script>
824
- * ```
825
- * @see [timeSlider](https://developers.arcgis.com/javascript/latest/references/core/webdoc/Widgets/#timeSlider)
826
- */
827
- updateWebDocument(document: WebMap | WebScene): Promise<void>;
488
+ /** @param webmap */
489
+ updateWebDocument(webmap: WebMap): Promise<void>;
490
+ "@setterTypes": {
491
+ icon?: IconName;
492
+ };
828
493
  /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
829
- readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "state"; }>;
494
+ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "effectiveStops" | "fullTimeExtent" | "timeExtent" | "state"; }>;
830
495
  /** Emitted when the component associated with a map or scene view is ready to be interacted with. */
831
496
  readonly arcgisReady: import("@arcgis/lumina").TargetedEvent<this, void>;
832
497
  /** Emitted when an action is triggered on the component. */
833
- readonly arcgisTriggerAction: import("@arcgis/lumina").TargetedEvent<this, TriggerActionEvent>;
498
+ readonly arcgisTriggerAction: import("@arcgis/lumina").TargetedEvent<this, TimeSliderViewModelTriggerActionEvent>;
834
499
  readonly "@eventTypes": {
835
500
  arcgisPropertyChange: ArcgisTimeSlider["arcgisPropertyChange"]["detail"];
836
501
  arcgisReady: ArcgisTimeSlider["arcgisReady"]["detail"];