@arcgis/map-components 5.2.0-next.103 → 5.2.0-next.105

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 (100) hide show
  1. package/dist/cdn/27IFADBQ.js +2 -0
  2. package/dist/cdn/{YVQJ4XD4.js → 3IQBOCXJ.js} +1 -1
  3. package/dist/cdn/{S7JDLOX2.js → 4J23LF6M.js} +1 -1
  4. package/dist/cdn/{J624KHFL.js → 4R53HBKQ.js} +1 -1
  5. package/dist/cdn/{A3KD2UAY.js → 5ASN6KWI.js} +1 -1
  6. package/dist/cdn/{GGKOLSCH.js → 6AUGGEEP.js} +1 -1
  7. package/dist/cdn/6PKJBJML.js +2 -0
  8. package/dist/cdn/{YEN7K65V.js → 7HFQ4IJ2.js} +1 -1
  9. package/dist/cdn/{ZUWNZX6G.js → BCGLGOZZ.js} +1 -1
  10. package/dist/cdn/CIVENBYG.js +2 -0
  11. package/dist/cdn/{TZEAPNBI.js → IFJS7BSY.js} +1 -1
  12. package/dist/cdn/IJWUCK2O.js +2 -0
  13. package/dist/cdn/{KJTWHP5I.js → ITQE4OCT.js} +1 -1
  14. package/dist/cdn/{4YU2AF7S.js → M4IP3YJG.js} +1 -1
  15. package/dist/cdn/PBIEHFTW.js +2 -0
  16. package/dist/cdn/{GLMK45AB.js → PCQRHDV6.js} +1 -1
  17. package/dist/cdn/{6ZE7BJTS.js → R2WAEZ4G.js} +1 -1
  18. package/dist/cdn/{DVGE5VPK.js → S3U3C6H7.js} +1 -1
  19. package/dist/cdn/{3AIQYNSA.js → SWSQAOGC.js} +1 -1
  20. package/dist/cdn/{ZCRUGROJ.js → SXAPY3VV.js} +1 -1
  21. package/dist/cdn/{VULA5TJD.js → TROUKXL3.js} +1 -1
  22. package/dist/cdn/US6Z6V5I.js +2 -0
  23. package/dist/cdn/VB64Q5DB.js +2 -0
  24. package/dist/cdn/{WAFRMU5C.js → WUHDP2W5.js} +1 -1
  25. package/dist/cdn/{HJ7TFEPK.js → YSWBEPQF.js} +2 -2
  26. package/dist/cdn/{BZGHEINJ.js → ZO4SS6VB.js} +1 -1
  27. package/dist/cdn/assets/time-bar/t9n/messages.en.json +1 -1
  28. package/dist/cdn/index.js +1 -1
  29. package/dist/chunks/messages.en.js +46 -0
  30. package/dist/chunks/slots.js +1 -1
  31. package/dist/components/arcgis-editor/customElement.d.ts +8 -2
  32. package/dist/components/arcgis-editor/customElement.js +2 -2
  33. package/dist/components/arcgis-layer-list-next/customElement.js +12 -7
  34. package/dist/components/arcgis-time-bar/TimeBarViewModel.d.ts +2 -2
  35. package/dist/components/arcgis-time-bar/customElement.d.ts +47 -16
  36. package/dist/components/arcgis-time-bar/customElement.js +162 -158
  37. package/dist/components/arcgis-time-bar/index.js +1 -1
  38. package/dist/components/arcgis-time-bar/types.d.ts +4 -3
  39. package/dist/components/arcgis-time-bar-settings/customElement.js +35 -73
  40. package/dist/components/arcgis-time-bar-slider/customElement.d.ts +88 -13
  41. package/dist/components/arcgis-time-bar-slider/customElement.js +69 -62
  42. package/dist/docs/api.json +1 -1
  43. package/dist/docs/docs.json +1 -1
  44. package/dist/docs/vscode.html-custom-data.json +1 -1
  45. package/dist/docs/web-types.json +1 -1
  46. package/dist/loader.js +2 -2
  47. package/dist/types/lumina.d.ts +2 -2
  48. package/dist/types/preact.d.ts +2 -2
  49. package/dist/types/react.d.ts +2 -2
  50. package/dist/types/stencil.d.ts +2 -2
  51. package/package.json +6 -6
  52. package/dist/cdn/65FGHESR.js +0 -2
  53. package/dist/cdn/CDWU62VR.js +0 -2
  54. package/dist/cdn/EDGLEFG3.js +0 -2
  55. package/dist/cdn/F2ZADKF4.js +0 -2
  56. package/dist/cdn/SA4IYYIE.js +0 -2
  57. package/dist/cdn/ZABYV3VA.js +0 -2
  58. /package/dist/cdn/{6RT7GRX4.js → 2YXG2UVO.js} +0 -0
  59. /package/dist/cdn/{AA2HLLIM.js → 3477AJGP.js} +0 -0
  60. /package/dist/cdn/{2ZG7S6GM.js → 46RONL5G.js} +0 -0
  61. /package/dist/cdn/{GJAC7GKP.js → 4TMO432K.js} +0 -0
  62. /package/dist/cdn/{4J6DMRVO.js → 4TXSVEFQ.js} +0 -0
  63. /package/dist/cdn/{TKEBTPPA.js → 5D7JP2MD.js} +0 -0
  64. /package/dist/cdn/{7JKYXV7H.js → 6AXSN2JJ.js} +0 -0
  65. /package/dist/cdn/{QJBQ3JLC.js → 6T2UQ2JE.js} +0 -0
  66. /package/dist/cdn/{6B4ROFUM.js → 7BTU3W4U.js} +0 -0
  67. /package/dist/cdn/{E3AEBH36.js → AH7T5E6X.js} +0 -0
  68. /package/dist/cdn/{DSPV4EIK.js → ATBK5KMZ.js} +0 -0
  69. /package/dist/cdn/{D2FVI5JG.js → BN7OHAZB.js} +0 -0
  70. /package/dist/cdn/{657KH5W3.js → C66EUSNM.js} +0 -0
  71. /package/dist/cdn/{HRTVHZHG.js → EHCISJXP.js} +0 -0
  72. /package/dist/cdn/{G7DHB4QN.js → F5GIAKDV.js} +0 -0
  73. /package/dist/cdn/{YWQU6EBN.js → H6I3JKBD.js} +0 -0
  74. /package/dist/cdn/{H3RDAWS7.js → HMK6VULW.js} +0 -0
  75. /package/dist/cdn/{JU4MCJPU.js → I4D3VLLY.js} +0 -0
  76. /package/dist/cdn/{HDYBFSI5.js → K2MQIU34.js} +0 -0
  77. /package/dist/cdn/{OTTKYEPK.js → K3DQPSQI.js} +0 -0
  78. /package/dist/cdn/{TTBQBEDS.js → NXYIGLH3.js} +0 -0
  79. /package/dist/cdn/{SE4NXMGA.js → O5WV2YAQ.js} +0 -0
  80. /package/dist/cdn/{D5LP3DJA.js → OTQZC2PT.js} +0 -0
  81. /package/dist/cdn/{SOOVHYLT.js → P3ZJGUIA.js} +0 -0
  82. /package/dist/cdn/{3VWL4SN7.js → PEXZHNPA.js} +0 -0
  83. /package/dist/cdn/{T5QDEAAE.js → QCZLDGXP.js} +0 -0
  84. /package/dist/cdn/{X2MAQDWV.js → SWTIFZKP.js} +0 -0
  85. /package/dist/cdn/{J3KTKVLP.js → T46FMVXL.js} +0 -0
  86. /package/dist/cdn/{DNQGXWL3.js → TPPHNJZM.js} +0 -0
  87. /package/dist/cdn/{LG3G4BFF.js → TRVSOZ6E.js} +0 -0
  88. /package/dist/cdn/{VFHHDNXC.js → TSBXS3ZU.js} +0 -0
  89. /package/dist/cdn/{GLZMKGGW.js → TUC2QO55.js} +0 -0
  90. /package/dist/cdn/{IU63DGNP.js → TVEUPC5T.js} +0 -0
  91. /package/dist/cdn/{B6JLKBMG.js → U2O4UBGQ.js} +0 -0
  92. /package/dist/cdn/{7NO3F7GQ.js → UKEFVOLB.js} +0 -0
  93. /package/dist/cdn/{4F6FNH6V.js → VESS43VK.js} +0 -0
  94. /package/dist/cdn/{KVIE42LT.js → W452TPUB.js} +0 -0
  95. /package/dist/cdn/{JHF7SGKM.js → XVRI7KL6.js} +0 -0
  96. /package/dist/cdn/{FRGVEQAZ.js → XWROBCOJ.js} +0 -0
  97. /package/dist/cdn/{ADZF7IHV.js → XX5K2YYE.js} +0 -0
  98. /package/dist/cdn/{OO4SKY7C.js → YC6OF77P.js} +0 -0
  99. /package/dist/cdn/{HH4A44WX.js → YFA64UQH.js} +0 -0
  100. /package/dist/cdn/{QH4RNPEX.js → YUCXRBNY.js} +0 -0
@@ -1,53 +1,15 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as f } from "../../chunks/runtime.js";
3
- import { css as _, html as n } from "lit";
2
+ import { c as _ } from "../../chunks/runtime.js";
3
+ import { css as f, html as l } from "lit";
4
4
  import h from "@arcgis/core/time/TimeExtent.js";
5
5
  import u from "@arcgis/core/time/TimeInterval.js";
6
- import { LitElement as $, safeClassMap as p } from "@arcgis/lumina";
6
+ import { d as $ } from "../../chunks/messages.en.js";
7
+ import { LitElement as I, safeClassMap as p } from "@arcgis/lumina";
7
8
  import { createRef as o, ref as r } from "lit/directives/ref.js";
8
- import { i as m, a as l, d as g, f as v, b } from "../../chunks/dateUtils.js";
9
- import { r as c, u as y } from "../../chunks/time-utils.js";
10
- const w = "TimeBar", I = "Count", T = "Please enter count", k = "Date", D = "Display", O = "Choose how to display date and time.", S = "End", F = "Choose the time bar's end time.", U = "Every {count} {timeUnit}", C = "Every {duration}", x = { dateAndTime: "Date and time", dateOnly: "Date only" }, E = "Loop", Z = "Mode", V = "Choose the time extent type shown by the time bar.", P = { "cumulative-from-end": "Cumulative from end", "cumulative-from-start": "Cumulative from start", instant: "Instant", "time-window": "Time window" }, R = "Next", z = "No adjustment", B = "Overview", L = "Play", N = "Playback rate", A = "The speed at which the time bar progresses.", j = "Previous", q = "Regular interval", G = "Settings", H = "Start", W = "Choose the time bar's start time.", Y = "Stop", J = { discreteDates: "Discrete dates", evenlySpaced: "Evenly spaced", evenlySpacedTemplate: "{count} evenly spaced", freeMovement: "Free movement" }, K = "Stops", M = "Choose how the stops are generated for the time bar.", Q = "Time", X = "Time bar settings", tt = { day: "Day", hour: "Hour", millisecond: "Millisecond", minute: "Minute", month: "Month", second: "Second", week: "Week", year: "Year" }, et = "Time zone", it = "Choose the time zone used to display the date and time in the time bar.", st = "Unit", at = "Please select unit", nt = "Units", lt = {
11
- componentLabel: w,
12
- count: I,
13
- countPrompt: T,
14
- date: k,
15
- display: D,
16
- displayDescription: O,
17
- end: S,
18
- endDescription: F,
19
- everyDurationPartsTemplate: U,
20
- everyDurationTemplate: C,
21
- formatOptions: x,
22
- loop: E,
23
- mode: Z,
24
- modeDescription: V,
25
- modeOptions: P,
26
- next: R,
27
- noTimeZoneAdjustment: z,
28
- overview: B,
29
- play: L,
30
- playbackRate: N,
31
- playbackRateDescription: A,
32
- previous: j,
33
- regularInterval: q,
34
- settings: G,
35
- start: H,
36
- startDescription: W,
37
- stop: Y,
38
- stopOptions: J,
39
- stops: K,
40
- stopsDescription: M,
41
- time: Q,
42
- timeBarSettings: X,
43
- timeUnitOptions: tt,
44
- timeZone: et,
45
- timeZoneDescription: it,
46
- unit: st,
47
- unitPrompt: at,
48
- units: nt
49
- }, ct = _`:host{background-color:var(--calcite-color-surface-2);block-size:calc(var(--calcite-font-size-relative-5xl) * 8);color:var(--calcite-color-text-1);font-family:var(--calcite-font-family);font-size:var(--calcite-font-size-sm);inline-size:max-content}calcite-flow-item{--calcite-color-background: var(--calcite-color-surface-2)}.disabled{opacity:var(--calcite-opacity-disabled);pointer-events:none}.playback-rate-content{margin-inline-start:var(--calcite-spacing-lg);margin-inline-end:var(--calcite-spacing-lg);margin-block-start:var(--calcite-spacing-lg)}.end-content,.format-content,.mode-content,.start-content,.stops-content,.time-zone-content{margin-inline-start:calc(var(--calcite-spacing-lg) * 3);margin-inline-end:var(--calcite-spacing-lg);margin-block-start:var(--calcite-spacing-lg)}.stops-indent{margin-inline-start:calc(var(--calcite-spacing-lg) * 1.5);margin-block-end:var(--calcite-spacing-lg)}.label-description{font-style:italic}.label-heading{font-weight:var(--calcite-font-weight-semibold)}.list-item--content{--calcite-label-margin-bottom: 0}.time-zone-label{--calcite-color-background: transparent;--calcite-color-border-input: transparent;font-style:italic;margin-inline-start:calc(var(--calcite-spacing-md) * -1);margin-block-start:calc(var(--calcite-spacing-md) * -.5)}`;
50
- class ot extends $ {
9
+ import { i as m, a as n, d as g, f as v, b } from "../../chunks/dateUtils.js";
10
+ import { r as c, u as w } from "../../chunks/time-utils.js";
11
+ const y = f`:host{background-color:var(--calcite-color-surface-2);block-size:calc(var(--calcite-font-size-relative-5xl) * 8);color:var(--calcite-color-text-1);font-family:var(--calcite-font-family);font-size:var(--calcite-font-size-sm);inline-size:max-content}calcite-flow-item{--calcite-color-background: var(--calcite-color-surface-2)}.disabled{opacity:var(--calcite-opacity-disabled);pointer-events:none}.playback-rate-content{margin-inline-start:var(--calcite-spacing-lg);margin-inline-end:var(--calcite-spacing-lg);margin-block-start:var(--calcite-spacing-lg)}.end-content,.format-content,.mode-content,.start-content,.stops-content,.time-zone-content{margin-inline-start:calc(var(--calcite-spacing-lg) * 3);margin-inline-end:var(--calcite-spacing-lg);margin-block-start:var(--calcite-spacing-lg)}.stops-indent{margin-inline-start:calc(var(--calcite-spacing-lg) * 1.5);margin-block-end:var(--calcite-spacing-lg)}.label-description{font-style:italic}.label-heading{font-weight:var(--calcite-font-weight-semibold)}.list-item--content{--calcite-label-margin-bottom: 0}.time-zone-label{--calcite-color-background: transparent;--calcite-color-border-input: transparent;font-style:italic;margin-inline-start:calc(var(--calcite-spacing-md) * -1);margin-block-start:calc(var(--calcite-spacing-md) * -.5)}`;
12
+ class T extends I {
51
13
  constructor() {
52
14
  super(...arguments), this.#e = o(), this.#i = o(), this.#s = o(), this.#a = o(), this.#t = {
53
15
  maximumFractionDigits: 0,
@@ -59,10 +21,10 @@ class ot extends $ {
59
21
  this.properties = { _timeUnitSettings: 16, _defaultStopCount: 16, _defaultStopIntervalValue: 16, _defaultStopIntervalUnit: 16, _messages: 16, _stopCount: 16, _stopIntervalValue: 16, _stopIntervalUnit: 16, _formatDescription: 16, _playbackRateDescription: 16, _formatStart: 16, _formatEnd: 16, _modeDescription: 16, _selectedFlowItem: 16, _stopDescription: 16, autoDestroyDisabled: 5, messages: 0, viewModel: 0 };
60
22
  }
61
23
  static {
62
- this.styles = ct;
24
+ this.styles = y;
63
25
  }
64
- #n;
65
26
  #l;
27
+ #n;
66
28
  #c;
67
29
  #e;
68
30
  #i;
@@ -146,27 +108,27 @@ class ot extends $ {
146
108
  return m(this.viewModel?.stops) ? this.viewModel.stops.count : 10;
147
109
  }
148
110
  get _defaultStopIntervalValue() {
149
- return l(this.viewModel?.stops) ? this.viewModel.stops.interval.value : 1;
111
+ return n(this.viewModel?.stops) ? this.viewModel.stops.interval.value : 1;
150
112
  }
151
113
  get _defaultStopIntervalUnit() {
152
- return l(this.viewModel?.stops) ? this.viewModel.stops.interval.unit : "years";
114
+ return n(this.viewModel?.stops) ? this.viewModel.stops.interval.unit : "years";
153
115
  }
154
116
  get _messages() {
155
- return this.messages ?? lt;
117
+ return this.messages ?? $;
156
118
  }
157
119
  get _stopCount() {
158
- return this.#n ?? this._defaultStopCount;
120
+ return this.#l ?? this._defaultStopCount;
159
121
  }
160
122
  set _stopCount(t) {
161
123
  const e = this._stopCount;
162
- e !== t && (this.#n = t, this.requestUpdate("_stopCount", e));
124
+ e !== t && (this.#l = t, this.requestUpdate("_stopCount", e));
163
125
  }
164
126
  get _stopIntervalValue() {
165
- return this.#l ?? this._defaultStopIntervalValue;
127
+ return this.#n ?? this._defaultStopIntervalValue;
166
128
  }
167
129
  set _stopIntervalValue(t) {
168
130
  const e = this._stopIntervalValue;
169
- e !== t && (this.#l = t, this.requestUpdate("_stopIntervalValue", e));
131
+ e !== t && (this.#n = t, this.requestUpdate("_stopIntervalValue", e));
170
132
  }
171
133
  get _stopIntervalUnit() {
172
134
  return this.#c ?? this._defaultStopIntervalUnit;
@@ -210,7 +172,7 @@ class ot extends $ {
210
172
  return this._messages.stopOptions.freeMovement;
211
173
  if (m(e))
212
174
  return this._messages.stopOptions.evenlySpacedTemplate.replace("{count}", `${e.count}`);
213
- if (l(e)) {
175
+ if (n(e)) {
214
176
  const { value: i, unit: s } = e.interval;
215
177
  if (!this._timeUnitSettings.has(s))
216
178
  return this._messages.everyDurationPartsTemplate.replace("{count}", `${i}`).replace("{timeUnit}", s);
@@ -250,7 +212,7 @@ class ot extends $ {
250
212
  if (!t)
251
213
  return null;
252
214
  const { disabled: e } = t;
253
- return n`<div class=${p({ disabled: e })}><calcite-flow>${this.#p(t)}${this.#m(t)}${this.#d(t)}${this.#u(t)}${this.#h(t)}${this.#g(t)}${this.#v(t)}${this.#b(t)}</calcite-flow></div>`;
215
+ return l`<div class=${p({ disabled: e })}><calcite-flow>${this.#p(t)}${this.#m(t)}${this.#d(t)}${this.#u(t)}${this.#h(t)}${this.#g(t)}${this.#v(t)}${this.#b(t)}</calcite-flow></div>`;
254
216
  }
255
217
  #m(t) {
256
218
  if (this._selectedFlowItem !== "end")
@@ -259,25 +221,25 @@ class ot extends $ {
259
221
  if (!e?.end)
260
222
  return null;
261
223
  const a = c(s);
262
- return n`<calcite-flow-item .description=${this._messages.endDescription} .heading=${this._messages.end} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="end-content"><calcite-label><span>${this._messages.date}</span><calcite-input-date-picker .disabled=${i} @calciteInputDatePickerChange=${this.#o} .value=${v(e.end, a)} ${r(this.#e)}></calcite-input-date-picker></calcite-label><calcite-label><span>${this._messages.time}</span><calcite-input-time-picker .disabled=${i} @calciteInputTimePickerChange=${this.#o} step=1 .value=${b(e.end, a)} ${r(this.#i)}></calcite-input-time-picker></calcite-label></div></calcite-flow-item>`;
224
+ return l`<calcite-flow-item .description=${this._messages.endDescription} .heading=${this._messages.end} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="end-content"><calcite-label><span>${this._messages.date}</span><calcite-input-date-picker .disabled=${i} @calciteInputDatePickerChange=${this.#o} .value=${v(e.end, a)} ${r(this.#e)}></calcite-input-date-picker></calcite-label><calcite-label><span>${this._messages.time}</span><calcite-input-time-picker .disabled=${i} @calciteInputTimePickerChange=${this.#o} step=1 .value=${b(e.end, a)} ${r(this.#i)}></calcite-input-time-picker></calcite-label></div></calcite-flow-item>`;
263
225
  }
264
226
  #d(t) {
265
- return this._selectedFlowItem !== "format" ? null : n`<calcite-flow-item .description=${this._messages.displayDescription} .heading=${this._messages.display} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="format-content"><calcite-radio-button-group class="format-radio-button-group" layout=vertical name=format @calciteRadioButtonGroupChange=${(e) => t.format = e.currentTarget.selectedItem?.value}><calcite-radio-button .labelText=${this._messages.formatOptions.dateOnly} value=date .checked=${t.format === "date"}></calcite-radio-button><calcite-radio-button .checked=${t.format === "date-time"} .labelText=${this._messages.formatOptions.dateAndTime} value=date-time></calcite-radio-button></calcite-radio-button-group></div></calcite-flow-item>`;
227
+ return this._selectedFlowItem !== "format" ? null : l`<calcite-flow-item .description=${this._messages.displayDescription} .heading=${this._messages.display} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="format-content"><calcite-radio-button-group class="format-radio-button-group" layout=vertical name=format @calciteRadioButtonGroupChange=${(e) => t.format = e.currentTarget.selectedItem?.value}><calcite-radio-button .labelText=${this._messages.formatOptions.dateOnly} value=date .checked=${t.format === "date"}></calcite-radio-button><calcite-radio-button .checked=${t.format === "date-time"} .labelText=${this._messages.formatOptions.dateAndTime} value=date-time></calcite-radio-button></calcite-radio-button-group></div></calcite-flow-item>`;
266
228
  }
267
229
  #u(t) {
268
230
  if (this._selectedFlowItem !== "mode")
269
231
  return null;
270
232
  const e = ["instant", "time-window", "cumulative-from-start", "cumulative-from-end"];
271
- return n`<calcite-flow-item .description=${this._messages.modeDescription} .heading=${this._messages.mode} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="mode-content"><calcite-radio-button-group name=mode layout=vertical @calciteRadioButtonGroupChange=${(i) => t.mode = i.currentTarget.selectedItem?.value} class="mode-radio-button-group">${e.map((i) => n`<calcite-radio-button .labelText=${this._messages.modeOptions[i]} .value=${i} .checked=${t.mode === i}></calcite-radio-button>`)}</calcite-radio-button-group></div></calcite-flow-item>`;
233
+ return l`<calcite-flow-item .description=${this._messages.modeDescription} .heading=${this._messages.mode} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="mode-content"><calcite-radio-button-group name=mode layout=vertical @calciteRadioButtonGroupChange=${(i) => t.mode = i.currentTarget.selectedItem?.value} class="mode-radio-button-group">${e.map((i) => l`<calcite-radio-button .labelText=${this._messages.modeOptions[i]} .value=${i} .checked=${t.mode === i}></calcite-radio-button>`)}</calcite-radio-button-group></div></calcite-flow-item>`;
272
234
  }
273
235
  #p(t) {
274
- return n`<calcite-flow-item .selected=${this._selectedFlowItem === "overview"}><calcite-list .label=${this._messages.overview}><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "format"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.display}</calcite-label><calcite-label class="label-description">${this._formatDescription}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "mode"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.mode}</calcite-label><calcite-label class="label-description">${this._modeDescription}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "time-zone"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.timeZone}</calcite-label>${this.#f()}</div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "start"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.start}</calcite-label><calcite-label class="label-description">${this._formatStart}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "end"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.end}</calcite-label><calcite-label class="label-description">${this._formatEnd}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "stops"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.stops}</calcite-label><calcite-label class="label-description">${this._stopDescription}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "playback-rate"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.playbackRate}</calcite-label><calcite-label class="label-description">${this._playbackRateDescription}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item><calcite-label slot=content class="label-heading">${this._messages.loop}</calcite-label><calcite-switch .checked=${t.loop} .label=${this._messages.loop} @calciteSwitchChange=${(e) => t.loop = e.target.checked} slot=content-end></calcite-switch></calcite-list-item></calcite-list></calcite-flow-item>`;
236
+ return l`<calcite-flow-item .selected=${this._selectedFlowItem === "overview"}><calcite-list .label=${this._messages.overview}><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "format"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.display}</calcite-label><calcite-label class="label-description">${this._formatDescription}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "mode"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.mode}</calcite-label><calcite-label class="label-description">${this._modeDescription}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "time-zone"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.timeZone}</calcite-label>${this.#_()}</div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "start"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.start}</calcite-label><calcite-label class="label-description">${this._formatStart}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "end"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.end}</calcite-label><calcite-label class="label-description">${this._formatEnd}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "stops"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.stops}</calcite-label><calcite-label class="label-description">${this._stopDescription}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item @calciteListItemSelect=${() => this._selectedFlowItem = "playback-rate"}><div slot=content class="list-item--content"><calcite-label class="label-heading">${this._messages.playbackRate}</calcite-label><calcite-label class="label-description">${this._playbackRateDescription}</calcite-label></div><calcite-icon slot=content-end scale=s icon=chevron-right flip-rtl></calcite-icon></calcite-list-item><calcite-list-item><calcite-label slot=content class="label-heading">${this._messages.loop}</calcite-label><calcite-switch .checked=${t.loop} .label=${this._messages.loop} @calciteSwitchChange=${(e) => t.loop = e.target.checked} slot=content-end></calcite-switch></calcite-list-item></calcite-list></calcite-flow-item>`;
275
237
  }
276
238
  #h(t) {
277
239
  if (this._selectedFlowItem !== "playback-rate")
278
240
  return null;
279
241
  const { playRate: e, disabled: i } = t;
280
- return n`<calcite-flow-item .description=${this._messages.playbackRateDescription} .heading=${this._messages.playbackRate} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="playback-rate-content"><arcgis-slider .disabled=${i} .labelFormatter=${(s) => t.formatNumber(s, this._timeUnitSettings.get("milliseconds").numberFormatOptions)} max=2000 min=100 @arcgisChange=${(s) => t.playRate = s.target.values[0]} precision=0 steps=10 value-labels-display=always .values=${[e]}><arcgis-ticks max=2000 min=100 mode=value show-labels slot=content-end style="flex:1;" .values=${[100, 500, 1e3, 1500, 2e3]}></arcgis-ticks></arcgis-slider></div></calcite-flow-item>`;
242
+ return l`<calcite-flow-item .description=${this._messages.playbackRateDescription} .heading=${this._messages.playbackRate} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="playback-rate-content"><arcgis-slider .disabled=${i} .labelFormatter=${(s) => t.formatNumber(s, this._timeUnitSettings.get("milliseconds").numberFormatOptions)} max=2000 min=100 @arcgisChange=${(s) => t.playRate = s.target.values[0]} precision=0 steps=10 value-labels-display=always .values=${[e]}><arcgis-ticks max=2000 min=100 mode=value show-labels slot=content-end style="flex:1;" .values=${[100, 500, 1e3, 1500, 2e3]}></arcgis-ticks></arcgis-slider></div></calcite-flow-item>`;
281
243
  }
282
244
  #g(t) {
283
245
  if (this._selectedFlowItem !== "start")
@@ -286,42 +248,42 @@ class ot extends $ {
286
248
  if (!e?.start)
287
249
  return null;
288
250
  const a = c(s);
289
- return n`<calcite-flow-item .description=${this._messages.startDescription} .heading=${this._messages.start} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="start-content"><calcite-label><span>${this._messages.date}</span><calcite-input-date-picker .disabled=${i} @calciteInputDatePickerChange=${this.#r} .value=${v(e.start, a)} ${r(this.#s)}></calcite-input-date-picker></calcite-label><calcite-label><span>${this._messages.time}</span><calcite-input-time-picker .disabled=${i} @calciteInputTimePickerChange=${this.#r} step=1 .value=${b(e.start, a)} ${r(this.#a)}></calcite-input-time-picker></calcite-label></div></calcite-flow-item>`;
251
+ return l`<calcite-flow-item .description=${this._messages.startDescription} .heading=${this._messages.start} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="start-content"><calcite-label><span>${this._messages.date}</span><calcite-input-date-picker .disabled=${i} @calciteInputDatePickerChange=${this.#r} .value=${v(e.start, a)} ${r(this.#s)}></calcite-input-date-picker></calcite-label><calcite-label><span>${this._messages.time}</span><calcite-input-time-picker .disabled=${i} @calciteInputTimePickerChange=${this.#r} step=1 .value=${b(e.start, a)} ${r(this.#a)}></calcite-input-time-picker></calcite-label></div></calcite-flow-item>`;
290
252
  }
291
253
  #v(t) {
292
- return this._selectedFlowItem !== "stops" ? null : n`<calcite-flow-item .description=${this._messages.stopsDescription} .heading=${this._messages.stops} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="stops-content"><calcite-radio-button-group .disabled=${t.disabled} class="mode-radio-button-group" layout=vertical name=stops><calcite-radio-button .checked=${!t.stops} .labelText=${this._messages.stopOptions.freeMovement} @calciteRadioButtonChange=${() => {
254
+ return this._selectedFlowItem !== "stops" ? null : l`<calcite-flow-item .description=${this._messages.stopsDescription} .heading=${this._messages.stops} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="stops-content"><calcite-radio-button-group .disabled=${t.disabled} class="mode-radio-button-group" layout=vertical name=stops><calcite-radio-button .checked=${!t.stops} .labelText=${this._messages.stopOptions.freeMovement} @calciteRadioButtonChange=${() => {
293
255
  t.stops = void 0;
294
256
  }} value></calcite-radio-button><calcite-radio-button .checked=${m(t.stops)} .labelText=${this._messages.stopOptions.evenlySpaced} @calciteRadioButtonChange=${() => {
295
257
  t.stops = { count: 10 };
296
258
  }} value></calcite-radio-button><div class="stops-indent"><calcite-input-number .disabled=${t.disabled || !m(t.stops)} integer min=1 .placeholder=${this._messages.countPrompt} .value=${`${this._stopCount}`} @calciteInputNumberChange=${(e) => {
297
259
  const i = Number.parseInt(e.currentTarget.value, 10);
298
260
  t.stops = { count: i };
299
- }}></calcite-input-number></div><calcite-radio-button .checked=${l(t.stops)} .labelText=${this._messages.regularInterval} @calciteRadioButtonChange=${() => {
261
+ }}></calcite-input-number></div><calcite-radio-button .checked=${n(t.stops)} .labelText=${this._messages.regularInterval} @calciteRadioButtonChange=${() => {
300
262
  t.stops = {
301
263
  interval: new u({ value: this._stopIntervalValue, unit: this._stopIntervalUnit })
302
264
  };
303
- }} value></calcite-radio-button><div class="stops-indent"><calcite-label><span class=${p({ disabled: t.disabled || !l(t.stops) })}>${this._messages.count}</span><calcite-input-number .disabled=${t.disabled || !l(t.stops)} integer min=1 .placeholder=${this._messages.countPrompt} .value=${`${this._stopIntervalValue}`} @calciteInputNumberChange=${(e) => {
265
+ }} value></calcite-radio-button><div class="stops-indent"><calcite-label><span class=${p({ disabled: t.disabled || !n(t.stops) })}>${this._messages.count}</span><calcite-input-number .disabled=${t.disabled || !n(t.stops)} integer min=1 .placeholder=${this._messages.countPrompt} .value=${`${this._stopIntervalValue}`} @calciteInputNumberChange=${(e) => {
304
266
  this._stopIntervalValue = Number.parseInt(e.currentTarget.value, 10), t.stops = {
305
267
  interval: new u({ value: this._stopIntervalValue, unit: this._stopIntervalUnit })
306
268
  };
307
- }}></calcite-input-number></calcite-label><calcite-label><span class=${p({ disabled: t.disabled || !l(t.stops) })}>${this._messages.unit}</span><calcite-combobox .disabled=${t.disabled || !l(t.stops)} .label=${this._messages.units} .placeholder=${this._messages.unitPrompt} selection-mode=single-persist @calciteComboboxChange=${(e) => {
269
+ }}></calcite-input-number></calcite-label><calcite-label><span class=${p({ disabled: t.disabled || !n(t.stops) })}>${this._messages.unit}</span><calcite-combobox .disabled=${t.disabled || !n(t.stops)} .label=${this._messages.units} .placeholder=${this._messages.unitPrompt} selection-mode=single-persist @calciteComboboxChange=${(e) => {
308
270
  this._stopIntervalUnit = e.currentTarget.selectedItems[0]?.value, t.stops = {
309
271
  interval: new u({ value: this._stopIntervalValue, unit: this._stopIntervalUnit })
310
272
  };
311
- }}>${this._timeUnitSettings.values.map(({ timeUnit: e, heading: i }) => n`<calcite-combobox-item .value=${e} .heading=${i} .selected=${this._stopIntervalUnit === e}></calcite-combobox-item>`)}</calcite-combobox></calcite-label></div></calcite-radio-button-group></div></calcite-flow-item>`;
273
+ }}>${this._timeUnitSettings.values.map(({ timeUnit: e, heading: i }) => l`<calcite-combobox-item .value=${e} .heading=${i} .selected=${this._stopIntervalUnit === e}></calcite-combobox-item>`)}</calcite-combobox></calcite-label></div></calcite-radio-button-group></div></calcite-flow-item>`;
312
274
  }
313
275
  #b(t) {
314
- return this._selectedFlowItem !== "time-zone" ? null : n`<calcite-flow-item .description=${this._messages.timeZoneDescription} .heading=${this._messages.timeZone} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="time-zone-content"><arcgis-time-zone-selector .disabled=${t.disabled} .timeZone=${t.timeZone} @arcgisInternalTimeZoneChange=${(e) => t.timeZone = e.detail}></arcgis-time-zone-selector></div></calcite-flow-item>`;
276
+ return this._selectedFlowItem !== "time-zone" ? null : l`<calcite-flow-item .description=${this._messages.timeZoneDescription} .heading=${this._messages.timeZone} @calciteFlowItemBack=${this.navigateToOverview} selected><div class="time-zone-content"><arcgis-time-zone-selector .disabled=${t.disabled} .timeZone=${t.timeZone} @arcgisInternalTimeZoneChange=${(e) => t.timeZone = e.detail}></arcgis-time-zone-selector></div></calcite-flow-item>`;
315
277
  }
316
- #f() {
278
+ #_() {
317
279
  const { viewModel: t } = this;
318
280
  if (!t)
319
281
  return null;
320
282
  const { timeZone: e } = t;
321
- return e === y ? n`<calcite-label class="label-description">${this._messages.noTimeZoneAdjustment}</calcite-label>` : n`<calcite-input-time-zone class="time-zone-label" mode=region overlay-positioning=fixed read-only .value=${c(e)}></calcite-input-time-zone>`;
283
+ return e === w ? l`<calcite-label class="label-description">${this._messages.noTimeZoneAdjustment}</calcite-label>` : l`<calcite-input-time-zone class="time-zone-label" mode=region overlay-positioning=fixed read-only .value=${c(e)}></calcite-input-time-zone>`;
322
284
  }
323
285
  }
324
- f("arcgis-time-bar-settings", ot);
286
+ _("arcgis-time-bar-settings", T);
325
287
  export {
326
- ot as ArcgisTimeBarSettings
288
+ T as ArcgisTimeBarSettings
327
289
  };
@@ -1,11 +1,13 @@
1
1
  /// <reference path="../../index.d.ts" />
2
2
  import type TimeExtent from "@arcgis/core/time/TimeExtent.js";
3
+ import type { PopoverDisplay } from "../arcgis-time-bar/types.js";
3
4
  import type { TimeBarViewModel } from "../arcgis-time-bar/TimeBarViewModel.js";
4
5
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
5
6
 
6
7
  /**
7
8
  * The `arcgis-time-bar-slider` component renders a time-based slider intended for use `arcgis-time-bar`'s "time-extent" slot.
8
9
  *
10
+ * @slot [content-end] - A slot that displays ticks at the end of the slider. If not provided, default ticks will be rendered.
9
11
  * @slot [max] - A slot that displays a label for the end date of the slider. If not provided, a default label will be rendered.
10
12
  * @slot [min] - A slot that displays a label for the start date of the slider. If not provided, a default label will be rendered.
11
13
  * @slot [popover] - A slot that displays a popover's content while interacting with the slider's thumb or range. If not provided, a default content will be rendered.
@@ -14,7 +16,7 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
14
16
  * An example of a `<arcgis-time-bar-slider>` slotted into time-bar's `time-extent` slot.
15
17
  * ```html
16
18
  * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
17
- * <arcgis-time-bar showPlay showNext showPrevious slot="top-right">
19
+ * <arcgis-time-bar show-play show-next show-previous show-time-extent slot="top-right">
18
20
  * <arcgis-time-bar-slider slot="time-extent"></arcgis-time-bar-slider>
19
21
  * </arcgis-time-bar>
20
22
  * </arcgis-map>
@@ -45,10 +47,18 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
45
47
  export abstract class ArcgisTimeBarSlider extends LitElement {
46
48
  /**
47
49
  * This property is intended to be used when inserting an element in the "popover" slot.
48
- * This property will return either a
49
- * [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) or
50
+ * This property will return either `undefined`, a
51
+ * [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) or a
50
52
  * [TimeExtent](https://developers.arcgis.com/javascript/latest/references/core/time/TimeExtent/)
51
- * depending if the user is interacting with either a slider thumb or slider track respectively.
53
+ * depending on [popoverDisplay](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar-slider/#popoverDisplay) and user interaction.
54
+ *
55
+ * When the `popover-display` is set to:
56
+ * - `"none"`, this property will always return `undefined`
57
+ * - `"always"`, this property will always return [arcgis-time-bar.timeExtent](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/#timeExtent),
58
+ * - `"auto"`, this property will either return a [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)
59
+ * if the user is interacting with a slider thumb, or
60
+ * [arcgis-time-bar.timeExtent](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/#timeExtent) if the user is interacting with a slider track, or
61
+ * `undefined` if the user is not interacting with either a slider thumb or slider track.
52
62
  *
53
63
  * @example
54
64
  * The following example demonstrates how to use the `activeValue` property to update the content of a popover while
@@ -60,8 +70,8 @@ export abstract class ArcgisTimeBarSlider extends LitElement {
60
70
  *
61
71
  * ```html
62
72
  * <arcgis-map basemap="satellite" zoom="6" center="-2,54">
63
- * <arcgis-time-bar showPlay showNext showPrevious slot="top-right">
64
- * <arcgis-time-bar-slider slot="time-extent" showTimeExtentPopover>
73
+ * <arcgis-time-bar show-play show-next show-previous show-time-extent slot="top-right">
74
+ * <arcgis-time-bar-slider slot="time-extent" popover-display="auto">
65
75
  * <div slot="popover" style="color: red; font-weight: bold; text-align: center; width: 100px;" />
66
76
  * </arcgis-time-bar-slider>
67
77
  * </arcgis-time-bar>
@@ -143,6 +153,78 @@ export abstract class ArcgisTimeBarSlider extends LitElement {
143
153
  *
144
154
  */
145
155
  accessor autoDestroyDisabled: boolean;
156
+ accessor messages: {
157
+ componentLabel: string;
158
+ count: string;
159
+ countPrompt: string;
160
+ date: string;
161
+ display: string;
162
+ displayDescription: string;
163
+ end: string;
164
+ endDescription: string;
165
+ everyDurationPartsTemplate: string;
166
+ everyDurationTemplate: string;
167
+ formatOptions: {
168
+ dateAndTime: string;
169
+ dateOnly: string;
170
+ };
171
+ loop: string;
172
+ mode: string;
173
+ modeDescription: string;
174
+ modeOptions: {
175
+ "cumulative-from-end": string;
176
+ "cumulative-from-start": string;
177
+ instant: string;
178
+ "time-window": string;
179
+ };
180
+ next: string;
181
+ noTimeZoneAdjustment: string;
182
+ overview: string;
183
+ play: string;
184
+ playbackRate: string;
185
+ playbackRateDescription: string;
186
+ previous: string;
187
+ regularInterval: string;
188
+ settings: string;
189
+ start: string;
190
+ startDescription: string;
191
+ stop: string;
192
+ stopOptions: {
193
+ discreteDates: string;
194
+ evenlySpaced: string;
195
+ evenlySpacedTemplate: string;
196
+ freeMovement: string;
197
+ };
198
+ stops: string;
199
+ stopsDescription: string;
200
+ time: string;
201
+ timeBarSettings: string;
202
+ timeExtent: string;
203
+ timeUnitOptions: {
204
+ day: string;
205
+ hour: string;
206
+ millisecond: string;
207
+ minute: string;
208
+ month: string;
209
+ second: string;
210
+ week: string;
211
+ year: string;
212
+ };
213
+ timeZone: string;
214
+ timeZoneDescription: string;
215
+ unit: string;
216
+ unitPrompt: string;
217
+ units: string;
218
+ } | undefined;
219
+ /**
220
+ * Defines how and when popovers are displayed for the slider's thumb or range.
221
+ * When `none`, popovers are not displayed.
222
+ * When `auto`, popovers are displayed automatically when interacting with a thumb or the slider's range.
223
+ * When `always`, popovers are always displayed. If the slider is in `time-window` mode, popovers are displayed for the slider range otherwise the thumb.
224
+ *
225
+ * @default "none"
226
+ */
227
+ accessor popoverDisplay: PopoverDisplay;
146
228
  /**
147
229
  * When `true`, displays a label for the end date of the slider.
148
230
  * The contents of this label can be customized by providing a slotted element in the "max" slot.
@@ -163,13 +245,6 @@ export abstract class ArcgisTimeBarSlider extends LitElement {
163
245
  * @default false
164
246
  */
165
247
  accessor showTicks: boolean;
166
- /**
167
- * When `true`, displays a popover for while interacting the slider's thumb or range.
168
- * The contents of this popover can be customized by providing a slotted element in the "popover" slot.
169
- *
170
- * @default false
171
- */
172
- accessor showTimeExtentPopover: boolean;
173
248
  /**
174
249
  * The view model for the time bar slider.
175
250
  *
@@ -1,32 +1,32 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as u } from "../../chunks/runtime.js";
3
- import { css as h, html as a } from "lit";
4
- import c from "@arcgis/core/time/TimeExtent.js";
5
- import { LitElement as v, nothing as f, safeClassMap as g } from "@arcgis/lumina";
6
- import { createRef as o, ref as d } from "lit/directives/ref.js";
7
- import { m as w } from "../../chunks/handle.js";
8
- import { watch as x } from "@arcgis/core/core/reactiveUtils.js";
9
- const p = h`:host{background-color:var(--calcite-color-surface-2);block-size:var(--calcite-size-fixed-xxxl);color:var(--calcite-color-text-1);display:flex;flex:1 0 auto;font-family:var(--calcite-font-family);font-size:var(--calcite-font-size-sm);inline-size:auto}.root{align-items:center;block-size:100%;display:flex;inline-size:100%}slot[name=max],slot[name=min]{display:flex}.slider{--labels-container-width: 100%;flex:1 1 auto;min-inline-size:calc(var(--calcite-spacing-md) * 15)}.slider--has-ticks{margin-top:calc(var(--calcite-spacing-md) * -1)}.hidden,.max-date,.min-date{flex:0 0 auto}.hidden{inline-size:0}.max-date,.min-date{inline-size:calc(var(--calcite-size-md) * 3.125)}.popover{padding:var(--calcite-spacing-xxs) var(--calcite-spacing-xs) var(--calcite-spacing-xs)}.ticks-container{flex:1;position:relative;width:100%}.major-ticks,.minor-ticks{inset:0;position:absolute}.major-ticks,.minor-ticks{--arcgis-ticks-tick-transform: unset;--arcgis-ticks-tick-width: var(--calcite-size-px)}.minor-ticks{--arcgis-ticks-tick-length: var(--calcite-size-fixed-xxs)}.major-ticks{--arcgis-ticks-font-weight: var(--calcite-font-weight-normal)}.slider.slider--out-of-range{--arcgis-internal-slider-handle-color: var(--calcite-color-status-danger);--arcgis-internal-slider-track-range-background-color: var(--calcite-color-status-danger)}`;
10
- class T extends v {
2
+ import { c as m } from "../../chunks/runtime.js";
3
+ import { css as u, html as a } from "lit";
4
+ import { ref as h } from "lit/directives/ref.js";
5
+ import o from "@arcgis/core/time/TimeExtent.js";
6
+ import { d as v } from "../../chunks/messages.en.js";
7
+ import { LitElement as g, nothing as c, safeClassMap as f } from "@arcgis/lumina";
8
+ const p = u`:host{background-color:var(--calcite-color-surface-2);block-size:var(--calcite-size-fixed-xxxl);color:var(--calcite-color-text-1);display:flex;flex:1 0 auto;font-family:var(--calcite-font-family);font-size:var(--calcite-font-size-sm);inline-size:auto;--arcgis-internal-time-bar-slider-tick-gap: 100}.root{align-items:center;block-size:100%;display:flex;inline-size:100%}slot[name=max],slot[name=min]{display:flex}.slider{--labels-container-width: 100%}.slider-container{flex:1 1 auto;min-inline-size:calc(var(--calcite-spacing-md) * 15)}.slider--has-ticks{margin-top:calc(var(--calcite-spacing-md) * -1)}.hidden,.max-date,.min-date{flex:0 0 auto}.hidden{inline-size:0}.max-date,.min-date{inline-size:calc(var(--calcite-size-md) * 3.125)}.popover{padding:var(--calcite-spacing-xxs) var(--calcite-spacing-xs) var(--calcite-spacing-xs)}.ticks-container{flex:1;position:relative;width:100%;arcgis-ticks,>slot::slotted(arcgis-ticks){inset:0;position:absolute;--arcgis-ticks-font-weight: var(--calcite-font-weight-normal);--arcgis-ticks-tick-transform: unset;--arcgis-ticks-tick-width: var(--calcite-size-px)}}.slider.slider--out-of-range{--arcgis-internal-slider-handle-color: var(--calcite-color-status-danger);--arcgis-internal-slider-track-range-background-color: var(--calcite-color-status-danger)}`;
9
+ class w extends g {
11
10
  constructor() {
12
- super(...arguments), this.#e = new ResizeObserver(() => {
13
- const e = this.#r.value?.clientWidth;
14
- e && (this._sliderWidth = e);
15
- }), this.#n = 3, this.#a = o(), this.#r = o(), this._sliderWidth = 100, this.autoDestroyDisabled = !1, this.showMax = !1, this.showMin = !1, this.showTicks = !1, this.showTimeExtentPopover = !1;
11
+ super(...arguments), this.#t = new ResizeObserver(([e]) => {
12
+ this._sliderWidth = e.contentRect.width;
13
+ }), this.#a = 100, this.#r = 100, this.autoDestroyDisabled = !1, this.popoverDisplay = "none", this.showMax = !1, this.showMin = !1, this.showTicks = !1;
16
14
  }
17
15
  static {
18
- this.properties = { _activeValue: 16, _sliderFillPlacement: 16, _sliderWidth: 16, _timeExtentEpochValues: 16, activeValue: 32, autoDestroyDisabled: 5, showMax: 5, showMin: 5, showTicks: 5, showTimeExtentPopover: 5, viewModel: 0 };
16
+ this.properties = { _activeValue: 16, _messages: 16, _sliderFillPlacement: 16, _sliderWidth: 16, _timeExtentEpochValues: 16, activeValue: 32, autoDestroyDisabled: 5, messages: 0, popoverDisplay: 1, showMax: 5, showMin: 5, showTicks: 5, viewModel: 0 };
19
17
  }
20
18
  static {
21
19
  this.styles = p;
22
20
  }
23
- #e;
24
21
  #t;
25
22
  #i;
26
23
  #s;
27
- #n;
24
+ #e;
28
25
  #a;
29
26
  #r;
27
+ get _messages() {
28
+ return this.messages ?? v;
29
+ }
30
30
  get _sliderFillPlacement() {
31
31
  switch (this.viewModel?.mode) {
32
32
  case "cumulative-from-end":
@@ -59,92 +59,99 @@ class T extends v {
59
59
  }
60
60
  }
61
61
  get activeValue() {
62
- switch (this._activeValue) {
63
- case void 0:
62
+ switch (this.popoverDisplay) {
63
+ case "none":
64
64
  return;
65
- case "all":
65
+ case "always":
66
66
  return this.viewModel?.timeExtent;
67
- default:
68
- return new Date(this._activeValue);
67
+ case "auto":
68
+ switch (this._activeValue) {
69
+ case void 0:
70
+ return;
71
+ case "all":
72
+ return this.viewModel?.timeExtent;
73
+ default:
74
+ return new Date(this._activeValue);
75
+ }
69
76
  }
70
77
  }
71
78
  async destroy() {
72
79
  await this.manager.destroy();
73
80
  }
74
- async loaded() {
75
- this.manager.onLifecycle(() => [
76
- x(() => this.#a.value, (e) => {
77
- this.#e.disconnect(), e && this.#e.observe(e);
78
- }, { initial: !0 }),
79
- w(() => {
80
- this.#e.disconnect();
81
- })
82
- ]);
83
- }
84
- #l(e, t) {
85
- const { viewModel: i } = this;
86
- if (!i)
87
- return;
88
- const { start: s, end: r } = e;
89
- if (!s || !r)
81
+ #n() {
82
+ return (e) => {
83
+ if (e) {
84
+ this.#e = e, this.#t.observe(e);
85
+ return;
86
+ }
87
+ this.#e && (this.#t.unobserve(this.#e), this.#e = void 0);
88
+ };
89
+ }
90
+ #l() {
91
+ const e = Number.parseInt(window.getComputedStyle(this.el).getPropertyValue("--arcgis-internal-time-bar-slider-tick-gap"), 10);
92
+ return Number.isFinite(e) && e > 0 ? e : this.#a;
93
+ }
94
+ #o(e, t) {
95
+ const { viewModel: i } = this, { start: s, end: r } = e;
96
+ if (!i || !s || !r)
90
97
  return;
91
98
  const n = (r.getTime() - s.getTime()) / t;
92
- return i.tickFormats.find(({ duration: m }) => m > this.#n * n) ?? i.tickFormats.at(-1);
99
+ return i.tickFormats.find(({ duration: d }) => d > this.#l() * n) ?? i.tickFormats.at(-1);
93
100
  }
94
101
  #c(e) {
95
102
  this._activeValue = e.target.activeValue;
96
103
  }
97
- #o(e) {
104
+ #d(e) {
98
105
  const { viewModel: t } = this, i = t?.mode;
99
- i && (t.timeExtent = this.#d(e.target.values, i), this._activeValue = e.target.activeValue);
106
+ i && (t.timeExtent = this.#m(e.target.values, i), this._activeValue = e.target.activeValue);
100
107
  }
101
- #d([e, t], i) {
108
+ #m([e, t], i) {
102
109
  switch (i) {
103
110
  case "cumulative-from-end":
104
- return new c({ start: new Date(e), end: null });
111
+ return new o({ start: new Date(e), end: null });
105
112
  case "cumulative-from-start":
106
- return new c({ start: null, end: new Date(e) });
113
+ return new o({ start: null, end: new Date(e) });
107
114
  case "instant":
108
- return new c({ start: new Date(e), end: new Date(e) });
115
+ return new o({ start: new Date(e), end: new Date(e) });
109
116
  case "time-window":
110
- return new c({ start: new Date(e), end: new Date(t ?? e) });
117
+ return new o({ start: new Date(e), end: new Date(t ?? e) });
111
118
  }
112
119
  }
113
- render() {
114
- return a`<div class="root" ${d(this.#a)}>${this.#u()}${this.#f()}${this.#m()}</div>`;
115
- }
116
- #m() {
117
- return this.showMax ? a`<slot name=max><arcgis-time-bar-date class="max-date" .date=${this.viewModel?.fullTimeExtent?.end} .viewModel=${this.viewModel}></arcgis-time-bar-date></slot>` : a`<div class="hidden"></div>`;
118
- }
119
120
  #u() {
120
- return this.showMin ? a`<slot name=min><arcgis-time-bar-date class="min-date" .date=${this.viewModel?.fullTimeExtent?.start} .viewModel=${this.viewModel}></arcgis-time-bar-date></slot>` : a`<div class="hidden"></div>`;
121
+ return this.showMax ? a`<slot name=max><arcgis-time-bar-date class="max-date" .date=${this.viewModel?.fullTimeExtent?.end} .viewModel=${this.viewModel}></arcgis-time-bar-date></slot>` : a`<div class="hidden"></div>`;
121
122
  }
122
123
  #h() {
123
- return this.showTimeExtentPopover ? a`<div class="popover" slot=popover><slot name=popover>${this.#v()}</slot></div>` : null;
124
+ return this.showMin ? a`<slot name=min><arcgis-time-bar-date class="min-date" .date=${this.viewModel?.fullTimeExtent?.start} .viewModel=${this.viewModel}></arcgis-time-bar-date></slot>` : a`<div class="hidden"></div>`;
124
125
  }
125
126
  #v() {
127
+ return this.popoverDisplay !== "none" ? a`<div class="popover" slot=popover><slot name=popover>${this.#g()}</slot></div>` : null;
128
+ }
129
+ #g() {
126
130
  return this.activeValue ? this.activeValue instanceof Date ? a`<arcgis-time-bar-date .date=${this.activeValue} .viewModel=${this.viewModel}></arcgis-time-bar-date>` : a`<arcgis-time-bar-extent .viewModel=${this.viewModel}></arcgis-time-bar-extent>` : null;
127
131
  }
128
132
  #f() {
129
133
  const { viewModel: e } = this;
130
- if (!e?.fullTimeExtent?.start || !e?.fullTimeExtent?.end || !this._sliderWidth)
134
+ if (!e?.fullTimeExtent?.start || !e?.fullTimeExtent?.end)
131
135
  return null;
132
- const t = this.#l(e.fullTimeExtent, this._sliderWidth);
136
+ const t = this.#o(e.fullTimeExtent, this._sliderWidth ?? this.#r);
133
137
  if (!t)
134
138
  return null;
135
- (!this.#t || !this.#s || !this.#i || this.#t !== t) && (this.#t = t, this.#s = e.getTickValues(t.minor), this.#i = e.getTickValues(t.major), e.majorTickFormat = t.format);
139
+ (!this.#i || !this.#s || this.#i !== t) && (this.#i = t, this.#s = e.getTickValues(t.timeInterval), e.tickFormat = t.format);
136
140
  const i = e.fullTimeExtent.start.getTime(), s = e.fullTimeExtent.end.getTime();
137
- return a`<arcgis-slider allow-values-overlap class=${g({
141
+ return a`<div class="slider-container" ${h(this.#n())}><arcgis-slider allow-values-overlap class=${f({
138
142
  slider: !0,
139
143
  "slider--has-ticks": this.showTicks,
140
144
  "slider--out-of-range": e.isOutOfRange
141
- })} .disabled=${!e.interactive} fill-placement=${this._sliderFillPlacement ?? f} .max=${s} .min=${i} @arcgisActiveValueChange=${this.#c} @arcgisInput=${this.#o} precision=0 .steps=${e.effectiveStopsEpoch} .values=${this._timeExtentEpochValues} ${d(this.#r)}>${this.#h()}${this.#g(e, i, s)}</arcgis-slider>`;
145
+ })} .disabled=${!e.interactive} fill-placement=${this._sliderFillPlacement ?? c} .max=${s} .min=${i} @arcgisActiveValueChange=${this.#c} @arcgisInput=${this.#d} popover-label=${this._messages.timeExtent ?? c} popover-display=${(this.popoverDisplay === "none" ? "auto" : this.popoverDisplay) ?? c} precision=0 .steps=${e.effectiveStopsEpoch} .values=${this._timeExtentEpochValues}>${this.#v()}${this.#p(e, i, s)}</arcgis-slider></div>`;
142
146
  }
143
- #g(e, t, i) {
144
- return this.showTicks ? a`<div slot=content-end class="ticks-container"><arcgis-ticks class="minor-ticks" .max=${i} .min=${t} mode=value .values=${this.#s}></arcgis-ticks><arcgis-ticks class="major-ticks" .labelFormatter=${e.majorTickFormatter} .max=${i} .min=${t} mode=value show-labels .values=${this.#i}></arcgis-ticks></div>` : null;
147
+ #p(e, t, i) {
148
+ return this.showTicks ? a`<div slot=content-end class="ticks-container"><slot name=content-end><arcgis-ticks .labelFormatter=${e.tickFormatter} .max=${i} .min=${t} mode=value show-labels .values=${this.#s}></arcgis-ticks></slot></div>` : null;
149
+ }
150
+ render() {
151
+ return a`<div class="root">${this.#h()}${this.#f()}${this.#u()}</div>`;
145
152
  }
146
153
  }
147
- u("arcgis-time-bar-slider", T);
154
+ m("arcgis-time-bar-slider", w);
148
155
  export {
149
- T as ArcgisTimeBarSlider
156
+ w as ArcgisTimeBarSlider
150
157
  };