@arcgis/map-components 5.1.0-next.83 → 5.1.0-next.85

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 (181) hide show
  1. package/dist/cdn/66YJK5TN.js +2 -0
  2. package/dist/cdn/{HBEEL7IW.js → 6VJBGE5W.js} +1 -1
  3. package/dist/cdn/AFAQWPXY.js +2 -0
  4. package/dist/cdn/AU2CHOT7.js +2 -0
  5. package/dist/cdn/{GPU57C3Y.js → CLGZBSF4.js} +1 -1
  6. package/dist/cdn/EIVHDZFM.js +2 -0
  7. package/dist/cdn/{7TRV2EOI.js → ELGQ2B5Q.js} +1 -1
  8. package/dist/cdn/{JT5PIQU5.js → FPT2UAZM.js} +1 -1
  9. package/dist/cdn/{MVULTZL6.js → FQY55PPT.js} +1 -1
  10. package/dist/cdn/GUYOWFTW.js +2 -0
  11. package/dist/cdn/HN5OI754.js +2 -0
  12. package/dist/cdn/{K2RCQ3S4.js → HTNECFCQ.js} +1 -1
  13. package/dist/cdn/{GDHU6FB7.js → HU4V2LGL.js} +1 -1
  14. package/dist/cdn/{5SWQQWAZ.js → IMENOON5.js} +1 -1
  15. package/dist/cdn/IYYLPWB4.js +2 -0
  16. package/dist/cdn/{6ECAKVHP.js → KKQWYK3S.js} +1 -1
  17. package/dist/cdn/{L3OVLVI3.js → LLRYOV3A.js} +1 -1
  18. package/dist/cdn/{DTRSQHPV.js → MV6B2G3T.js} +1 -1
  19. package/dist/cdn/{VQ7UIUFE.js → NOIIORU5.js} +1 -1
  20. package/dist/cdn/{CVNE57KC.js → NUXHWUHW.js} +1 -1
  21. package/dist/cdn/O5ZWXMTJ.js +2 -0
  22. package/dist/cdn/{WKA6U2M7.js → OYSW2K2B.js} +1 -1
  23. package/dist/cdn/{NVRFQSZB.js → ST5DXIZ6.js} +1 -1
  24. package/dist/cdn/{F7UR4A5G.js → U5G4PHA4.js} +1 -1
  25. package/dist/cdn/{6BESCJK6.js → XQ5BV7DL.js} +1 -1
  26. package/dist/cdn/{NGAZTR7Y.js → XWYXHSGO.js} +1 -1
  27. package/dist/cdn/{CQ7BRDZC.js → YACNPFYK.js} +1 -1
  28. package/dist/cdn/{G4QTXMBQ.js → ZO7ZJ52E.js} +1 -1
  29. package/dist/cdn/{7NFLP5PG.js → ZPSJEBD6.js} +1 -1
  30. package/dist/cdn/assets/features/t9n/messages.ar.json +1 -1
  31. package/dist/cdn/assets/features/t9n/messages.bg.json +1 -1
  32. package/dist/cdn/assets/features/t9n/messages.bs.json +1 -1
  33. package/dist/cdn/assets/features/t9n/messages.ca.json +1 -1
  34. package/dist/cdn/assets/features/t9n/messages.cs.json +1 -1
  35. package/dist/cdn/assets/features/t9n/messages.da.json +1 -1
  36. package/dist/cdn/assets/features/t9n/messages.de.json +1 -1
  37. package/dist/cdn/assets/features/t9n/messages.el.json +1 -1
  38. package/dist/cdn/assets/features/t9n/messages.es.json +1 -1
  39. package/dist/cdn/assets/features/t9n/messages.et.json +1 -1
  40. package/dist/cdn/assets/features/t9n/messages.fi.json +1 -1
  41. package/dist/cdn/assets/features/t9n/messages.fr.json +1 -1
  42. package/dist/cdn/assets/features/t9n/messages.he.json +1 -1
  43. package/dist/cdn/assets/features/t9n/messages.hr.json +1 -1
  44. package/dist/cdn/assets/features/t9n/messages.hu.json +1 -1
  45. package/dist/cdn/assets/features/t9n/messages.id.json +1 -1
  46. package/dist/cdn/assets/features/t9n/messages.it.json +1 -1
  47. package/dist/cdn/assets/features/t9n/messages.ja.json +1 -1
  48. package/dist/cdn/assets/features/t9n/messages.ko.json +1 -1
  49. package/dist/cdn/assets/features/t9n/messages.lt.json +1 -1
  50. package/dist/cdn/assets/features/t9n/messages.lv.json +1 -1
  51. package/dist/cdn/assets/features/t9n/messages.nl.json +1 -1
  52. package/dist/cdn/assets/features/t9n/messages.no.json +1 -1
  53. package/dist/cdn/assets/features/t9n/messages.pl.json +1 -1
  54. package/dist/cdn/assets/features/t9n/messages.pt-BR.json +1 -1
  55. package/dist/cdn/assets/features/t9n/messages.pt-PT.json +1 -1
  56. package/dist/cdn/assets/features/t9n/messages.ro.json +1 -1
  57. package/dist/cdn/assets/features/t9n/messages.ru.json +1 -1
  58. package/dist/cdn/assets/features/t9n/messages.sk.json +1 -1
  59. package/dist/cdn/assets/features/t9n/messages.sl.json +1 -1
  60. package/dist/cdn/assets/features/t9n/messages.sr.json +1 -1
  61. package/dist/cdn/assets/features/t9n/messages.sv.json +1 -1
  62. package/dist/cdn/assets/features/t9n/messages.th.json +1 -1
  63. package/dist/cdn/assets/features/t9n/messages.tr.json +1 -1
  64. package/dist/cdn/assets/features/t9n/messages.uk.json +1 -1
  65. package/dist/cdn/assets/features/t9n/messages.vi.json +1 -1
  66. package/dist/cdn/assets/features/t9n/messages.zh-CN.json +1 -1
  67. package/dist/cdn/assets/features/t9n/messages.zh-HK.json +1 -1
  68. package/dist/cdn/assets/features/t9n/messages.zh-TW.json +1 -1
  69. package/dist/cdn/assets/time-slider/t9n/messages.ar.json +1 -0
  70. package/dist/cdn/assets/time-slider/t9n/messages.bg.json +1 -0
  71. package/dist/cdn/assets/time-slider/t9n/messages.bs.json +1 -0
  72. package/dist/cdn/assets/time-slider/t9n/messages.ca.json +1 -0
  73. package/dist/cdn/assets/time-slider/t9n/messages.cs.json +1 -0
  74. package/dist/cdn/assets/time-slider/t9n/messages.da.json +1 -0
  75. package/dist/cdn/assets/time-slider/t9n/messages.de.json +1 -0
  76. package/dist/cdn/assets/time-slider/t9n/messages.el.json +1 -0
  77. package/dist/cdn/assets/time-slider/t9n/messages.en.json +1 -0
  78. package/dist/cdn/assets/time-slider/t9n/messages.es.json +1 -0
  79. package/dist/cdn/assets/time-slider/t9n/messages.et.json +1 -0
  80. package/dist/cdn/assets/time-slider/t9n/messages.fi.json +1 -0
  81. package/dist/cdn/assets/time-slider/t9n/messages.fr.json +1 -0
  82. package/dist/cdn/assets/time-slider/t9n/messages.he.json +1 -0
  83. package/dist/cdn/assets/time-slider/t9n/messages.hr.json +1 -0
  84. package/dist/cdn/assets/time-slider/t9n/messages.hu.json +1 -0
  85. package/dist/cdn/assets/time-slider/t9n/messages.id.json +1 -0
  86. package/dist/cdn/assets/time-slider/t9n/messages.it.json +1 -0
  87. package/dist/cdn/assets/time-slider/t9n/messages.ja.json +1 -0
  88. package/dist/cdn/assets/time-slider/t9n/messages.ko.json +1 -0
  89. package/dist/cdn/assets/time-slider/t9n/messages.lt.json +1 -0
  90. package/dist/cdn/assets/time-slider/t9n/messages.lv.json +1 -0
  91. package/dist/cdn/assets/time-slider/t9n/messages.nl.json +1 -0
  92. package/dist/cdn/assets/time-slider/t9n/messages.no.json +1 -0
  93. package/dist/cdn/assets/time-slider/t9n/messages.pl.json +1 -0
  94. package/dist/cdn/assets/time-slider/t9n/messages.pt-BR.json +1 -0
  95. package/dist/cdn/assets/time-slider/t9n/messages.pt-PT.json +1 -0
  96. package/dist/cdn/assets/time-slider/t9n/messages.ro.json +1 -0
  97. package/dist/cdn/assets/time-slider/t9n/messages.ru.json +1 -0
  98. package/dist/cdn/assets/time-slider/t9n/messages.sk.json +1 -0
  99. package/dist/cdn/assets/time-slider/t9n/messages.sl.json +1 -0
  100. package/dist/cdn/assets/time-slider/t9n/messages.sr.json +1 -0
  101. package/dist/cdn/assets/time-slider/t9n/messages.sv.json +1 -0
  102. package/dist/cdn/assets/time-slider/t9n/messages.th.json +1 -0
  103. package/dist/cdn/assets/time-slider/t9n/messages.tr.json +1 -0
  104. package/dist/cdn/assets/time-slider/t9n/messages.uk.json +1 -0
  105. package/dist/cdn/assets/time-slider/t9n/messages.vi.json +1 -0
  106. package/dist/cdn/assets/time-slider/t9n/messages.zh-CN.json +1 -0
  107. package/dist/cdn/assets/time-slider/t9n/messages.zh-HK.json +1 -0
  108. package/dist/cdn/assets/time-slider/t9n/messages.zh-TW.json +1 -0
  109. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.ar.json +1 -0
  110. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.bg.json +1 -0
  111. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.bs.json +1 -0
  112. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.ca.json +1 -0
  113. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.cs.json +1 -0
  114. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.da.json +1 -0
  115. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.de.json +1 -0
  116. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.el.json +1 -0
  117. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.es.json +1 -0
  118. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.et.json +1 -0
  119. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.fi.json +1 -0
  120. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.fr.json +1 -0
  121. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.he.json +1 -0
  122. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.hr.json +1 -0
  123. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.hu.json +1 -0
  124. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.id.json +1 -0
  125. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.it.json +1 -0
  126. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.ja.json +1 -0
  127. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.ko.json +1 -0
  128. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.lt.json +1 -0
  129. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.lv.json +1 -0
  130. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.nl.json +1 -0
  131. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.no.json +1 -0
  132. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.pl.json +1 -0
  133. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.pt-BR.json +1 -0
  134. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.pt-PT.json +1 -0
  135. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.ro.json +1 -0
  136. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.ru.json +1 -0
  137. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.sk.json +1 -0
  138. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.sl.json +1 -0
  139. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.sr.json +1 -0
  140. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.sv.json +1 -0
  141. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.th.json +1 -0
  142. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.tr.json +1 -0
  143. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.uk.json +1 -0
  144. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.vi.json +1 -0
  145. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.zh-CN.json +1 -0
  146. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.zh-HK.json +1 -0
  147. package/dist/cdn/assets/utility-network-validate-network-topology/t9n/messages.zh-TW.json +1 -0
  148. package/dist/cdn/index.js +1 -1
  149. package/dist/chunks/async-utils.js +63 -51
  150. package/dist/components/arcgis-aggregated-features/customElement.js +27 -23
  151. package/dist/components/arcgis-daylight/customElement.js +1 -1
  152. package/dist/components/arcgis-elevation-profile/customElement.d.ts +2 -3
  153. package/dist/components/arcgis-elevation-profile/customElement.js +1 -1
  154. package/dist/components/arcgis-elevation-profile-legend/customElement.js +20 -14
  155. package/dist/components/arcgis-features/customElement.js +99 -84
  156. package/dist/components/arcgis-time-of-day-slider/customElement.js +74 -46
  157. package/dist/components/arcgis-time-slider/customElement.d.ts +687 -352
  158. package/dist/components/arcgis-time-slider/customElement.js +678 -26
  159. package/dist/components/arcgis-time-slider/index.js +7 -0
  160. package/dist/components/arcgis-time-slider/types.d.ts +147 -0
  161. package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +24 -24
  162. package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +1 -1
  163. package/dist/components/arcgis-zoom/customElement.js +27 -33
  164. package/dist/docs/api.json +1 -1
  165. package/dist/docs/docs.json +1 -1
  166. package/dist/docs/vscode.html-custom-data.json +1 -1
  167. package/dist/docs/web-types.json +1 -1
  168. package/dist/loader.js +2 -2
  169. package/dist/types/lumina.d.ts +1 -2
  170. package/dist/types/preact.d.ts +1 -2
  171. package/dist/types/react.d.ts +1 -2
  172. package/dist/types/stencil.d.ts +1 -2
  173. package/package.json +4 -4
  174. package/dist/cdn/5UBX7NJZ.js +0 -2
  175. package/dist/cdn/7752ICPP.js +0 -2
  176. package/dist/cdn/K6DM6L64.js +0 -2
  177. package/dist/cdn/OZZ7CYLP.js +0 -2
  178. package/dist/cdn/PQSRQNWY.js +0 -2
  179. package/dist/cdn/V4RMKJUW.js +0 -2
  180. package/dist/cdn/VWL5JQZ4.js +0 -2
  181. package/dist/cdn/XUYGLABO.js +0 -2
@@ -1,83 +1,103 @@
1
1
  /// <reference path="../../index.d.ts" />
2
- import type WebMap from "@arcgis/core/WebMap.js";
3
- import type Collection from "@arcgis/core/core/Collection.js";
4
2
  import type TimeExtent from "@arcgis/core/time/TimeExtent.js";
3
+ import type Collection from "@arcgis/core/core/Collection.js";
4
+ 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";
5
8
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
6
9
  import type { ArcgisReferenceElement, IconName } from "../types.js";
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";
10
+ import type { Action, DateLabelFormatter, Layout, TickConfig, TimeSliderSettings, TriggerActionEvent, Mode, State, Stops } from "./types.js";
11
+ import type { T9nMeta } from "@arcgis/lumina/controllers";
13
12
 
14
13
  /**
15
- * The Time Slider component simplifies visualization of temporal data in your application.
14
+ * The `<arcgis-time-slider>` component provides interactive time selection and playback within a defined temporal extent.
16
15
  *
17
16
  * @since 4.28
18
17
  */
19
18
  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
+ }>;
20
47
  /**
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.avif) 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.
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`.
26
51
  *
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.
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.
30
53
  *
31
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)
32
55
  *
33
- * @since 4.21
34
- * @see [Sample - TimeSlider with offset](https://developers.arcgis.com/javascript/latest/sample-code/widgets-timeslider-offset/)
35
56
  * @example
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"
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
+ * }
50
95
  * },
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
- * });
96
+ * );
97
+ * </script>
98
+ * ```
79
99
  */
80
- accessor actions: Collection<Action>;
100
+ accessor actions: Collection<Action> | undefined;
81
101
  /**
82
102
  * If true, the component will not be destroyed automatically when it is
83
103
  * disconnected from the document. This is useful when you want to move the
@@ -93,46 +113,94 @@ export abstract class ArcgisTimeSlider extends LitElement {
93
113
  *
94
114
  * @default false
95
115
  * @example
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
- * });
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
+ * ```
105
138
  */
106
139
  accessor disabled: boolean;
107
140
  /**
108
- * Lists the specific locations on the timeline where handle(s) will snap to when manipulated.
141
+ * The dates that the time slider's handles will snap to when manipulated.
109
142
  *
110
143
  * @example
111
- * timeSlider.effectiveStops.forEach((stop) => {
112
- * console.log(stop);
113
- * });
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
+ * ```
114
176
  */
115
- get effectiveStops(): Array<Date> | null | undefined;
177
+ get effectiveStops(): Date[] | null | undefined;
116
178
  /**
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.
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.
120
181
  *
121
182
  * @example
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
- * });
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
+ * ```
136
204
  */
137
205
  accessor fullTimeExtent: TimeExtent | null | undefined;
138
206
  /**
@@ -140,95 +208,139 @@ export abstract class ArcgisTimeSlider extends LitElement {
140
208
  * Typically used when the component is controlled by another component (e.g. by the Expand component).
141
209
  *
142
210
  * @default "clock"
143
- * @since 4.27
144
211
  * @see [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/)
145
212
  */
146
- get icon(): Icon["icon"];
147
- set icon(value: IconName);
213
+ accessor icon: IconName | undefined;
214
+ /** The component's default label. */
215
+ accessor label: string | undefined;
148
216
  /**
149
- * The component's default label.
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.
150
220
  *
151
- * @since 4.11
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
+ * ```
152
262
  */
153
- accessor label: string;
263
+ accessor labelFormatFunction: DateLabelFormatter | undefined;
154
264
  /**
155
- * Determines the layout used by the TimeSlider component.
265
+ * Defines the layout of the component. The layout determines the orientation of the component elements and how much space they consume.
156
266
  *
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. |
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.
163
270
  *
164
271
  * @default "auto"
165
- * @since 4.16
166
- * @example timeSlider.layout = "compact";
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
+ * ```
167
279
  */
168
- accessor layout: TimeSliderLayout;
280
+ accessor layout: Layout;
169
281
  /**
170
- * When `true`, the time slider will play its animation in a loop.
282
+ * When `true`, time slider will restart from the beginning when it reaches the end of the slider when playing.
171
283
  *
172
284
  * @default false
173
285
  * @example
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();
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
+ * ```
181
292
  */
182
293
  accessor loop: boolean;
183
294
  /**
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.
295
+ * Replace localized message strings with your own strings.
187
296
  *
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.avif"> |
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.avif"> |
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.avif"> |
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.avif"> |
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.
194
316
  *
195
317
  * @default "time-window"
196
- * @see [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent)
197
318
  * @example
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
- * });
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
+ * ```
212
325
  */
213
- accessor mode: TimeSliderMode;
326
+ accessor mode: Mode;
214
327
  /**
215
- * The time (in milliseconds) between animation steps.
328
+ * When `arcgis-time-slider` is playing, the play rate determines the interval (in milliseconds) between animation steps.
216
329
  *
217
330
  * > [!WARNING]
218
331
  * >
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.
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.
222
335
  *
223
336
  * @default 1000
224
337
  * @example
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();
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
+ * ```
232
344
  */
233
345
  accessor playRate: number;
234
346
  /**
@@ -242,260 +354,483 @@ export abstract class ArcgisTimeSlider extends LitElement {
242
354
  *
243
355
  * @default "disabled"
244
356
  * @example
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
- * }
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
+ * ```
257
385
  */
258
- get state(): TimeSliderState;
386
+ get state(): State;
259
387
  /**
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.
388
+ * Defines the stops on the time slider. Stops are specific dates that the thumb, or thumbs, will snap to when manipulated.
262
389
  *
263
- * For continuous sliding, set `stops` to `null`:
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.
264
394
  * ```js
265
- * timeSlider.stops = null;
266
- * ```
267
- *
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.
395
+ * <script type="module">
396
+ * const timeSliderElement = document.querySelector("arcgis-time-slider");
397
+ * await timeSliderElement.componentOnReady();
274
398
  *
399
+ * timeSliderElement.stops = {
400
+ * count: 10,
401
+ * };
402
+ * </script>
403
+ * ```
404
+ * @example
405
+ * To allow thumbs to be manipulated continuously without snapping to specific dates, set `stops` to `null`:
275
406
  * ```js
276
- * // Add yearly intervals starting from the beginning of the TimeSlider.
277
- * timeSlider.stops = {
278
- * interval: {
279
- * value: 1,
280
- * unit: "years"
281
- * }
282
- * };
407
+ * <script type="module">
408
+ * const timeSliderElement = document.querySelector("arcgis-time-slider");
409
+ * await timeSliderElement.componentOnReady();
410
+ *
411
+ * timeSliderElement.stops = null;
412
+ * </script>
283
413
  * ```
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.
414
+ * @example
415
+ * To allow thumbs to snap to specific dates, assign an array of dates to a `dates` property as shown below.
287
416
  * ```js
288
- * // Add stops at 15 evenly spaced intervals.
289
- * timeSlider.stops = {
290
- * count: 15
291
- * };
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>
292
429
  * ```
293
- * For irregularly spaced stops, simply assign an array of dates as demonstrated below.
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.
294
432
  * ```js
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.
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>
448
+ * ```
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.
305
452
  * ```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
- * };
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>
326
480
  * ```
327
- *
328
- * @default { count : 10 }
329
481
  */
330
482
  accessor stops: Stops | null | undefined;
331
483
  /**
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.
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.
335
486
  *
336
- * @since 4.16
337
487
  * @example
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}`;
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,
356
545
  * },
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
- * }
546
+ * ];
547
+ * </script>
548
+ * ```
375
549
  */
376
- accessor tickConfigs: Array<TickConfig> | null | undefined;
550
+ accessor tickConfigs: TickConfig[] | undefined;
377
551
  /**
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).
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.
381
562
  *
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}` |
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 }` |
388
570
  *
389
571
  * @example
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
- * });
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
+ * });
403
592
  *
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
- * );
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
+ * };
607
+ *
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
+ * ```
410
620
  */
411
621
  accessor timeExtent: TimeExtent | null | undefined;
412
622
  /**
413
- * Shows/hides time in the display.
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.
414
625
  *
415
626
  * @default false
416
627
  * @example
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
- * });
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
+ * ```
431
633
  */
432
634
  accessor timeVisible: boolean;
433
635
  /**
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.
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.
437
639
  *
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
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)
447
650
  */
448
- accessor timeZone: string;
651
+ accessor timeZone: string | undefined;
449
652
  /**
450
653
  * The view associated with the component.
451
654
  * > **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.
452
663
  *
664
+ * @param settings
453
665
  * @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
+ * ```
454
673
  * ```js
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");
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();
470
685
  *
471
- * reactiveUtils.watch(
472
- * () => view.timeExtent,
473
- * (timeExtent) => {
474
- * console.log("New view time is: ", timeExtent.start);
475
- * }
476
- * );
686
+ * const timeSliderSettings = await timeUtils.getTimeSliderSettingsFromWebDocument(webMap);
687
+ *
688
+ * const timeSlider = document.querySelector("arcgis-time-slider");
689
+ * await timeSlider.componentOnReady();
690
+ * timeSlider.applyTimeSliderSettings(timeSliderSettings);
691
+ * </script>
477
692
  * ```
478
693
  */
479
- accessor view: MapViewOrSceneView | null | undefined;
480
- /** @param settings */
481
694
  applyTimeSliderSettings(settings: TimeSliderSettings): Promise<void>;
482
695
  /** Permanently destroy the component. */
483
696
  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
+ */
484
720
  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
+ */
485
749
  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
+ */
486
773
  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
+ */
487
797
  stop(): Promise<void>;
488
- /** @param webmap */
489
- updateWebDocument(webmap: WebMap): Promise<void>;
490
- "@setterTypes": {
491
- icon?: IconName;
492
- };
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>;
493
828
  /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
494
- readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "effectiveStops" | "fullTimeExtent" | "timeExtent" | "state"; }>;
829
+ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "state"; }>;
495
830
  /** Emitted when the component associated with a map or scene view is ready to be interacted with. */
496
831
  readonly arcgisReady: import("@arcgis/lumina").TargetedEvent<this, void>;
497
832
  /** Emitted when an action is triggered on the component. */
498
- readonly arcgisTriggerAction: import("@arcgis/lumina").TargetedEvent<this, TimeSliderViewModelTriggerActionEvent>;
833
+ readonly arcgisTriggerAction: import("@arcgis/lumina").TargetedEvent<this, TriggerActionEvent>;
499
834
  readonly "@eventTypes": {
500
835
  arcgisPropertyChange: ArcgisTimeSlider["arcgisPropertyChange"]["detail"];
501
836
  arcgisReady: ArcgisTimeSlider["arcgisReady"]["detail"];