@arcgis/map-components 5.2.0-next.104 → 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.
- package/dist/cdn/27IFADBQ.js +2 -0
- package/dist/cdn/6PKJBJML.js +2 -0
- package/dist/cdn/CIVENBYG.js +2 -0
- package/dist/cdn/IJWUCK2O.js +2 -0
- package/dist/cdn/assets/time-bar/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/messages.en.js +46 -0
- package/dist/components/arcgis-time-bar/customElement.d.ts +47 -16
- package/dist/components/arcgis-time-bar/customElement.js +50 -47
- package/dist/components/arcgis-time-bar/index.js +1 -1
- package/dist/components/arcgis-time-bar/types.d.ts +3 -1
- package/dist/components/arcgis-time-bar-settings/customElement.js +35 -73
- package/dist/components/arcgis-time-bar-slider/customElement.d.ts +87 -13
- package/dist/components/arcgis-time-bar-slider/customElement.js +31 -20
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +5 -5
- package/dist/cdn/CDWU62VR.js +0 -2
- package/dist/cdn/EBPGSTIL.js +0 -2
- package/dist/cdn/WNZ2XRBD.js +0 -2
|
@@ -1,53 +1,15 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
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 {
|
|
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
|
|
9
|
-
import { r as c, u as
|
|
10
|
-
const
|
|
11
|
-
|
|
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 =
|
|
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
|
|
111
|
+
return n(this.viewModel?.stops) ? this.viewModel.stops.interval.value : 1;
|
|
150
112
|
}
|
|
151
113
|
get _defaultStopIntervalUnit() {
|
|
152
|
-
return
|
|
114
|
+
return n(this.viewModel?.stops) ? this.viewModel.stops.interval.unit : "years";
|
|
153
115
|
}
|
|
154
116
|
get _messages() {
|
|
155
|
-
return this.messages ??
|
|
117
|
+
return this.messages ?? $;
|
|
156
118
|
}
|
|
157
119
|
get _stopCount() {
|
|
158
|
-
return this.#
|
|
120
|
+
return this.#l ?? this._defaultStopCount;
|
|
159
121
|
}
|
|
160
122
|
set _stopCount(t) {
|
|
161
123
|
const e = this._stopCount;
|
|
162
|
-
e !== t && (this.#
|
|
124
|
+
e !== t && (this.#l = t, this.requestUpdate("_stopCount", e));
|
|
163
125
|
}
|
|
164
126
|
get _stopIntervalValue() {
|
|
165
|
-
return this.#
|
|
127
|
+
return this.#n ?? this._defaultStopIntervalValue;
|
|
166
128
|
}
|
|
167
129
|
set _stopIntervalValue(t) {
|
|
168
130
|
const e = this._stopIntervalValue;
|
|
169
|
-
e !== t && (this.#
|
|
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 (
|
|
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
|
|
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
|
|
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 :
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 :
|
|
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=${
|
|
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 || !
|
|
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 || !
|
|
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 }) =>
|
|
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 :
|
|
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
|
-
#
|
|
278
|
+
#_() {
|
|
317
279
|
const { viewModel: t } = this;
|
|
318
280
|
if (!t)
|
|
319
281
|
return null;
|
|
320
282
|
const { timeZone: e } = t;
|
|
321
|
-
return e ===
|
|
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
|
-
|
|
286
|
+
_("arcgis-time-bar-settings", T);
|
|
325
287
|
export {
|
|
326
|
-
|
|
288
|
+
T as ArcgisTimeBarSettings
|
|
327
289
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
|
|
@@ -15,7 +16,7 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
15
16
|
* An example of a `<arcgis-time-bar-slider>` slotted into time-bar's `time-extent` slot.
|
|
16
17
|
* ```html
|
|
17
18
|
* <arcgis-map basemap="satellite" zoom="6" center="-2,54">
|
|
18
|
-
* <arcgis-time-bar
|
|
19
|
+
* <arcgis-time-bar show-play show-next show-previous show-time-extent slot="top-right">
|
|
19
20
|
* <arcgis-time-bar-slider slot="time-extent"></arcgis-time-bar-slider>
|
|
20
21
|
* </arcgis-time-bar>
|
|
21
22
|
* </arcgis-map>
|
|
@@ -46,10 +47,18 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
46
47
|
export abstract class ArcgisTimeBarSlider extends LitElement {
|
|
47
48
|
/**
|
|
48
49
|
* This property is intended to be used when inserting an element in the "popover" slot.
|
|
49
|
-
* This property will return either a
|
|
50
|
-
* [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
|
|
51
52
|
* [TimeExtent](https://developers.arcgis.com/javascript/latest/references/core/time/TimeExtent/)
|
|
52
|
-
* depending
|
|
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.
|
|
53
62
|
*
|
|
54
63
|
* @example
|
|
55
64
|
* The following example demonstrates how to use the `activeValue` property to update the content of a popover while
|
|
@@ -61,8 +70,8 @@ export abstract class ArcgisTimeBarSlider extends LitElement {
|
|
|
61
70
|
*
|
|
62
71
|
* ```html
|
|
63
72
|
* <arcgis-map basemap="satellite" zoom="6" center="-2,54">
|
|
64
|
-
* <arcgis-time-bar
|
|
65
|
-
* <arcgis-time-bar-slider slot="time-extent"
|
|
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">
|
|
66
75
|
* <div slot="popover" style="color: red; font-weight: bold; text-align: center; width: 100px;" />
|
|
67
76
|
* </arcgis-time-bar-slider>
|
|
68
77
|
* </arcgis-time-bar>
|
|
@@ -144,6 +153,78 @@ export abstract class ArcgisTimeBarSlider extends LitElement {
|
|
|
144
153
|
*
|
|
145
154
|
*/
|
|
146
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;
|
|
147
228
|
/**
|
|
148
229
|
* When `true`, displays a label for the end date of the slider.
|
|
149
230
|
* The contents of this label can be customized by providing a slotted element in the "max" slot.
|
|
@@ -164,13 +245,6 @@ export abstract class ArcgisTimeBarSlider extends LitElement {
|
|
|
164
245
|
* @default false
|
|
165
246
|
*/
|
|
166
247
|
accessor showTicks: boolean;
|
|
167
|
-
/**
|
|
168
|
-
* When `true`, displays a popover for while interacting the slider's thumb or range.
|
|
169
|
-
* The contents of this popover can be customized by providing a slotted element in the "popover" slot.
|
|
170
|
-
*
|
|
171
|
-
* @default false
|
|
172
|
-
*/
|
|
173
|
-
accessor showTimeExtentPopover: boolean;
|
|
174
248
|
/**
|
|
175
249
|
* The view model for the time bar slider.
|
|
176
250
|
*
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { ref as
|
|
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
5
|
import o from "@arcgis/core/time/TimeExtent.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
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 {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments), this.#t = new ResizeObserver(([e]) => {
|
|
11
12
|
this._sliderWidth = e.contentRect.width;
|
|
12
|
-
}), this.#a = 100, this.#r = 100, this.autoDestroyDisabled = !1, this.
|
|
13
|
+
}), this.#a = 100, this.#r = 100, this.autoDestroyDisabled = !1, this.popoverDisplay = "none", this.showMax = !1, this.showMin = !1, this.showTicks = !1;
|
|
13
14
|
}
|
|
14
15
|
static {
|
|
15
|
-
this.properties = { _activeValue: 16, _sliderFillPlacement: 16, _sliderWidth: 16, _timeExtentEpochValues: 16, activeValue: 32, autoDestroyDisabled: 5,
|
|
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 };
|
|
16
17
|
}
|
|
17
18
|
static {
|
|
18
|
-
this.styles =
|
|
19
|
+
this.styles = p;
|
|
19
20
|
}
|
|
20
21
|
#t;
|
|
21
22
|
#i;
|
|
@@ -23,6 +24,9 @@ class w extends h {
|
|
|
23
24
|
#e;
|
|
24
25
|
#a;
|
|
25
26
|
#r;
|
|
27
|
+
get _messages() {
|
|
28
|
+
return this.messages ?? v;
|
|
29
|
+
}
|
|
26
30
|
get _sliderFillPlacement() {
|
|
27
31
|
switch (this.viewModel?.mode) {
|
|
28
32
|
case "cumulative-from-end":
|
|
@@ -55,13 +59,20 @@ class w extends h {
|
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
get activeValue() {
|
|
58
|
-
switch (this.
|
|
59
|
-
case
|
|
62
|
+
switch (this.popoverDisplay) {
|
|
63
|
+
case "none":
|
|
60
64
|
return;
|
|
61
|
-
case "
|
|
65
|
+
case "always":
|
|
62
66
|
return this.viewModel?.timeExtent;
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
}
|
|
65
76
|
}
|
|
66
77
|
}
|
|
67
78
|
async destroy() {
|
|
@@ -85,7 +96,7 @@ class w extends h {
|
|
|
85
96
|
if (!i || !s || !r)
|
|
86
97
|
return;
|
|
87
98
|
const n = (r.getTime() - s.getTime()) / t;
|
|
88
|
-
return i.tickFormats.find(({ duration:
|
|
99
|
+
return i.tickFormats.find(({ duration: d }) => d > this.#l() * n) ?? i.tickFormats.at(-1);
|
|
89
100
|
}
|
|
90
101
|
#c(e) {
|
|
91
102
|
this._activeValue = e.target.activeValue;
|
|
@@ -113,7 +124,7 @@ class w extends h {
|
|
|
113
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>`;
|
|
114
125
|
}
|
|
115
126
|
#v() {
|
|
116
|
-
return this.
|
|
127
|
+
return this.popoverDisplay !== "none" ? a`<div class="popover" slot=popover><slot name=popover>${this.#g()}</slot></div>` : null;
|
|
117
128
|
}
|
|
118
129
|
#g() {
|
|
119
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,20 +138,20 @@ class w extends h {
|
|
|
127
138
|
return null;
|
|
128
139
|
(!this.#i || !this.#s || this.#i !== t) && (this.#i = t, this.#s = e.getTickValues(t.timeInterval), e.tickFormat = t.format);
|
|
129
140
|
const i = e.fullTimeExtent.start.getTime(), s = e.fullTimeExtent.end.getTime();
|
|
130
|
-
return a`<div class="slider-container" ${
|
|
141
|
+
return a`<div class="slider-container" ${h(this.#n())}><arcgis-slider allow-values-overlap class=${f({
|
|
131
142
|
slider: !0,
|
|
132
143
|
"slider--has-ticks": this.showTicks,
|
|
133
144
|
"slider--out-of-range": e.isOutOfRange
|
|
134
|
-
})} .disabled=${!e.interactive} fill-placement=${this._sliderFillPlacement ??
|
|
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>`;
|
|
135
146
|
}
|
|
136
|
-
#
|
|
147
|
+
#p(e, t, i) {
|
|
137
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;
|
|
138
149
|
}
|
|
139
150
|
render() {
|
|
140
151
|
return a`<div class="root">${this.#h()}${this.#f()}${this.#u()}</div>`;
|
|
141
152
|
}
|
|
142
153
|
}
|
|
143
|
-
|
|
154
|
+
m("arcgis-time-bar-slider", w);
|
|
144
155
|
export {
|
|
145
156
|
w as ArcgisTimeBarSlider
|
|
146
157
|
};
|