@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
|
@@ -38,7 +38,13 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
38
38
|
* buttons displayed and the fallback label displayed in the `time-extent` slot.
|
|
39
39
|
* ```html
|
|
40
40
|
* <arcgis-map basemap="satellite" zoom="6" center="-2,54">
|
|
41
|
-
* <arcgis-time-bar
|
|
41
|
+
* <arcgis-time-bar
|
|
42
|
+
* show-play
|
|
43
|
+
* show-next
|
|
44
|
+
* show-previous
|
|
45
|
+
* show-time-extent
|
|
46
|
+
* slot="top-right">
|
|
47
|
+
* </arcgis-time-bar>
|
|
42
48
|
* </arcgis-map>
|
|
43
49
|
* ```
|
|
44
50
|
* ```js
|
|
@@ -65,8 +71,16 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
65
71
|
* An alternative to the default label is to use a `<arcgis-time-bar-slider>` component in the `time-extent` slot.
|
|
66
72
|
* ```html
|
|
67
73
|
* <arcgis-map basemap="satellite" zoom="6" center="-2,54">
|
|
68
|
-
* <arcgis-time-bar
|
|
69
|
-
*
|
|
74
|
+
* <arcgis-time-bar
|
|
75
|
+
* show-play
|
|
76
|
+
* show-next
|
|
77
|
+
* show-previous
|
|
78
|
+
* show-time-extent
|
|
79
|
+
* slot="top-right">
|
|
80
|
+
* <arcgis-time-bar-slider
|
|
81
|
+
* slot="time-extent"
|
|
82
|
+
* >
|
|
83
|
+
* </arcgis-time-bar-slider>
|
|
70
84
|
* </arcgis-time-bar>
|
|
71
85
|
* </arcgis-map>
|
|
72
86
|
* ```
|
|
@@ -126,7 +140,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
126
140
|
* @example
|
|
127
141
|
* ```html
|
|
128
142
|
* <arcgis-map basemap="satellite" zoom="6" center="-2,54">
|
|
129
|
-
* <arcgis-time-bar slot="top-right" disabled></arcgis-time-bar>
|
|
143
|
+
* <arcgis-time-bar show-time-extent slot="top-right" disabled></arcgis-time-bar>
|
|
130
144
|
* </arcgis-map>
|
|
131
145
|
* ```
|
|
132
146
|
* ```js
|
|
@@ -174,7 +188,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
174
188
|
* @example
|
|
175
189
|
* ```html
|
|
176
190
|
* <arcgis-map basemap="satellite" zoom="6" center="-2,54">
|
|
177
|
-
* <arcgis-time-bar slot="top-right" format="date-time"></arcgis-time-bar>
|
|
191
|
+
* <arcgis-time-bar show-time-extent slot="top-right" format="date-time"></arcgis-time-bar>
|
|
178
192
|
* </arcgis-map>
|
|
179
193
|
* ```
|
|
180
194
|
*/
|
|
@@ -186,7 +200,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
186
200
|
* @example
|
|
187
201
|
* ```html
|
|
188
202
|
* <arcgis-map basemap="satellite" zoom="6" center="-2,54">
|
|
189
|
-
* <arcgis-time-bar slot="top-right">
|
|
203
|
+
* <arcgis-time-bar show-time-extent slot="top-right" >
|
|
190
204
|
* <arcgis-time-bar-slider slot="time-extent"></arcgis-time-bar-slider>
|
|
191
205
|
* </arcgis-time-bar>
|
|
192
206
|
* </arcgis-map>
|
|
@@ -233,7 +247,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
233
247
|
* Disable loading persisted settings from the associated view's web document.
|
|
234
248
|
* ```html
|
|
235
249
|
* <arcgis-map item-id="3542f60d24484cb0af84f1a346607722">
|
|
236
|
-
* <arcgis-time-bar slot="top-right"
|
|
250
|
+
* <arcgis-time-bar slot="top-right" load-persisted-settings-disabled></arcgis-time-bar>
|
|
237
251
|
* </arcgis-map>
|
|
238
252
|
* ```
|
|
239
253
|
*/
|
|
@@ -302,6 +316,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
302
316
|
stopsDescription?: string | undefined;
|
|
303
317
|
time?: string | undefined;
|
|
304
318
|
timeBarSettings?: string | undefined;
|
|
319
|
+
timeExtent?: string | undefined;
|
|
305
320
|
timeUnitOptions?: {
|
|
306
321
|
day?: string | undefined;
|
|
307
322
|
hour?: string | undefined;
|
|
@@ -365,6 +380,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
365
380
|
stopsDescription: string;
|
|
366
381
|
time: string;
|
|
367
382
|
timeBarSettings: string;
|
|
383
|
+
timeExtent: string;
|
|
368
384
|
timeUnitOptions: {
|
|
369
385
|
day: string;
|
|
370
386
|
hour: string;
|
|
@@ -426,6 +442,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
426
442
|
stopsDescription: string;
|
|
427
443
|
time: string;
|
|
428
444
|
timeBarSettings: string;
|
|
445
|
+
timeExtent: string;
|
|
429
446
|
timeUnitOptions: {
|
|
430
447
|
day: string;
|
|
431
448
|
hour: string;
|
|
@@ -489,7 +506,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
489
506
|
* Disable saving persisted settings to the associated view's web document.
|
|
490
507
|
* ```html
|
|
491
508
|
* <arcgis-map item-id="3542f60d24484cb0af84f1a346607722">
|
|
492
|
-
* <arcgis-time-bar slot="top-right"
|
|
509
|
+
* <arcgis-time-bar slot="top-right" save-persisted-settings-disabled></arcgis-time-bar>
|
|
493
510
|
* </arcgis-map>
|
|
494
511
|
* ```
|
|
495
512
|
*/
|
|
@@ -505,7 +522,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
505
522
|
* Add a `arcgis-time-bar` to a map with the *next* button displayed.
|
|
506
523
|
* ```html
|
|
507
524
|
* <arcgis-map item-id="3542f60d24484cb0af84f1a346607722">
|
|
508
|
-
* <arcgis-time-bar slot="top-right"
|
|
525
|
+
* <arcgis-time-bar slot="top-right" show-next></arcgis-time-bar>
|
|
509
526
|
* </arcgis-map>
|
|
510
527
|
* ```
|
|
511
528
|
* @see [next()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/#next)
|
|
@@ -521,7 +538,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
521
538
|
* Add a `arcgis-time-bar` to a map with the *play* button displayed.
|
|
522
539
|
* ```html
|
|
523
540
|
* <arcgis-map item-id="3542f60d24484cb0af84f1a346607722">
|
|
524
|
-
* <arcgis-time-bar slot="top-right"
|
|
541
|
+
* <arcgis-time-bar slot="top-right" show-play></arcgis-time-bar>
|
|
525
542
|
* </arcgis-map>
|
|
526
543
|
* ```
|
|
527
544
|
* @see [play()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/#play)
|
|
@@ -538,7 +555,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
538
555
|
* Add a `arcgis-time-bar` to a map with the *previous* button displayed.
|
|
539
556
|
* ```html
|
|
540
557
|
* <arcgis-map item-id="3542f60d24484cb0af84f1a346607722">
|
|
541
|
-
* <arcgis-time-bar slot="top-right"
|
|
558
|
+
* <arcgis-time-bar slot="top-right" show-previous></arcgis-time-bar>
|
|
542
559
|
* </arcgis-map>
|
|
543
560
|
* ```
|
|
544
561
|
* @see [previous()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/#previous)
|
|
@@ -554,11 +571,25 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
554
571
|
* Add a `arcgis-time-bar` to a map with the *settings* button displayed.
|
|
555
572
|
* ```html
|
|
556
573
|
* <arcgis-map item-id="3542f60d24484cb0af84f1a346607722">
|
|
557
|
-
* <arcgis-time-bar slot="top-right"
|
|
574
|
+
* <arcgis-time-bar slot="top-right" show-settings></arcgis-time-bar>
|
|
558
575
|
* </arcgis-map>
|
|
559
576
|
* ```
|
|
560
577
|
*/
|
|
561
578
|
accessor showSettings: boolean;
|
|
579
|
+
/**
|
|
580
|
+
* When `true`, the `arcgis-time-bar` will display the time extent.
|
|
581
|
+
* To customize the display of the time extent, use the `time-extent` slot with the `arcgis-time-bar-slider` component.
|
|
582
|
+
*
|
|
583
|
+
* @default false
|
|
584
|
+
* @example
|
|
585
|
+
* Add a `arcgis-time-bar` to a map with the time extent displayed.
|
|
586
|
+
* ```html
|
|
587
|
+
* <arcgis-map item-id="3542f60d24484cb0af84f1a346607722">
|
|
588
|
+
* <arcgis-time-bar slot="top-right" show-time-extent></arcgis-time-bar>
|
|
589
|
+
* </arcgis-map>
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
accessor showTimeExtent: boolean;
|
|
562
593
|
/**
|
|
563
594
|
* The current state of the component.
|
|
564
595
|
*
|
|
@@ -566,7 +597,7 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
566
597
|
* The following snippet will log the `arcgis-time-bar`'s state to the console whenever it changes.
|
|
567
598
|
* ```html
|
|
568
599
|
* <arcgis-map basemap="satellite" zoom="6" center="-2,54">
|
|
569
|
-
* <arcgis-time-bar slot="top-right">
|
|
600
|
+
* <arcgis-time-bar slot="top-right" show-time-extent>
|
|
570
601
|
* <arcgis-time-bar-slider slot="time-extent"></arcgis-time-bar-slider>
|
|
571
602
|
* </arcgis-time-bar>
|
|
572
603
|
* </arcgis-map>
|
|
@@ -623,10 +654,10 @@ export abstract class ArcgisTimeBar extends LitElement {
|
|
|
623
654
|
* To allow thumbs to be manipulated continuously without snapping to specific dates, set `stops` to `null`:
|
|
624
655
|
* ```js
|
|
625
656
|
* <script type="module">
|
|
626
|
-
* const
|
|
627
|
-
* await
|
|
657
|
+
* const timeBarElement = document.querySelector("arcgis-time-bar");
|
|
658
|
+
* await timeBarElement.componentOnReady();
|
|
628
659
|
*
|
|
629
|
-
*
|
|
660
|
+
* timeBarElement.stops = null;
|
|
630
661
|
* </script>
|
|
631
662
|
* ```
|
|
632
663
|
* @example
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as W } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as z, html as
|
|
3
|
+
import { css as z, html as d } from "lit";
|
|
4
4
|
import V from "@arcgis/core/core/Accessor.js";
|
|
5
5
|
import x from "@arcgis/core/time/TimeExtent.js";
|
|
6
6
|
import q from "@arcgis/core/webdoc/widgets/TimeSlider.js";
|
|
7
|
-
import
|
|
8
|
-
import { b as
|
|
9
|
-
import { c as
|
|
7
|
+
import H from "@arcgis/core/webdoc/Widgets.js";
|
|
8
|
+
import { b as K, d as j, a as L } from "../../chunks/async-utils.js";
|
|
9
|
+
import { c as G, e as U, g as F, i as C, h as Y, j as J, k as Q, l as R, a as X } from "../../chunks/dateUtils.js";
|
|
10
10
|
import { convertDateFormatToIntlOptions as b } from "@arcgis/core/intl.js";
|
|
11
11
|
import { r as tt, u as et, s as it } from "../../chunks/time-utils.js";
|
|
12
12
|
import st from "@arcgis/core/time/TimeInterval.js";
|
|
@@ -104,7 +104,7 @@ const i = (t, e) => ({ tick: t, tickFormat: e }), s = {
|
|
|
104
104
|
i({ value: 1e4, unit: "centuries" }, s.y),
|
|
105
105
|
i({ value: 2e4, unit: "centuries" }, s.y)
|
|
106
106
|
];
|
|
107
|
-
function
|
|
107
|
+
function Et(t) {
|
|
108
108
|
return xt.map(({ tick: e, tickFormat: n }) => {
|
|
109
109
|
const a = new st(e), m = a.toMilliseconds(), h = {
|
|
110
110
|
...n,
|
|
@@ -113,16 +113,16 @@ function _t(t) {
|
|
|
113
113
|
return { duration: m, format: h, timeInterval: a };
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
var
|
|
116
|
+
var _t = Object.defineProperty, bt = Object.getOwnPropertyDescriptor, I = (t) => {
|
|
117
117
|
throw TypeError(t);
|
|
118
118
|
}, r = (t, e, n, a) => {
|
|
119
119
|
for (var m = a > 1 ? void 0 : a ? bt(e, n) : e, h = t.length - 1, f; h >= 0; h--)
|
|
120
120
|
(f = t[h]) && (m = (a ? f(e, n, m) : f(m)) || m);
|
|
121
|
-
return a && m &&
|
|
122
|
-
}, N = (t, e, n) => e.has(t) || I("Cannot " + n), M = (t, e, n) => (N(t, e, "read from private field"), n ? n.call(t) : e.get(t)), A = (t, e, n) => e.has(t) ? I("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), v = (t, e, n) => (N(t, e, "access private method"), n),
|
|
121
|
+
return a && m && _t(e, n, m), m;
|
|
122
|
+
}, N = (t, e, n) => e.has(t) || I("Cannot " + n), M = (t, e, n) => (N(t, e, "read from private field"), n ? n.call(t) : e.get(t)), A = (t, e, n) => e.has(t) ? I("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), v = (t, e, n) => (N(t, e, "access private method"), n), E, u, $, D, _, T, P;
|
|
123
123
|
let o = class extends V {
|
|
124
124
|
constructor() {
|
|
125
|
-
super(...arguments), A(this, u), A(this,
|
|
125
|
+
super(...arguments), A(this, u), A(this, E, new AbortController()), this.disabled = !1, this.format = "date", this.loadPersistedSettingsDisabled = !1, this.loop = !1, this.mode = "time-window", this.savePersistedSettingsDisabled = !1, this.stops = U;
|
|
126
126
|
}
|
|
127
127
|
get _adjustedTickFormat() {
|
|
128
128
|
const { era: t, timeZone: e } = this;
|
|
@@ -171,13 +171,13 @@ let o = class extends V {
|
|
|
171
171
|
const { dates: a } = e;
|
|
172
172
|
if (!a?.length)
|
|
173
173
|
return;
|
|
174
|
-
const m = a.sort((y,
|
|
174
|
+
const m = a.sort((y, p) => y.getTime() - p.getTime());
|
|
175
175
|
if (!t?.start || !t?.end)
|
|
176
176
|
return m;
|
|
177
177
|
const { start: h, end: f } = t, c = h.getTime(), g = f.getTime();
|
|
178
178
|
return m.filter((y) => {
|
|
179
|
-
const
|
|
180
|
-
return
|
|
179
|
+
const p = y.getTime();
|
|
180
|
+
return p >= c && p <= g;
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
const n = e.timeExtent ?? t;
|
|
@@ -201,7 +201,7 @@ let o = class extends V {
|
|
|
201
201
|
return f || c;
|
|
202
202
|
}
|
|
203
203
|
set playRate(t) {
|
|
204
|
-
t <= 0 || t > 1e3 * 60 * 60 || (this.state === "playing" && v(this, u,
|
|
204
|
+
t <= 0 || t > 1e3 * 60 * 60 || (this.state === "playing" && v(this, u, D).call(this), this._set("playRate", t));
|
|
205
205
|
}
|
|
206
206
|
get state() {
|
|
207
207
|
return this.fullTimeExtent ? this._animationController ? "playing" : "ready" : "disabled";
|
|
@@ -210,7 +210,7 @@ let o = class extends V {
|
|
|
210
210
|
return (t) => this._formatDate(t, this._adjustedTickFormat);
|
|
211
211
|
}
|
|
212
212
|
get tickFormats() {
|
|
213
|
-
return
|
|
213
|
+
return Et(this.timeZone);
|
|
214
214
|
}
|
|
215
215
|
get timeZone() {
|
|
216
216
|
return this._userTimeZone ?? this.viewTimeZone ?? it;
|
|
@@ -224,7 +224,7 @@ let o = class extends V {
|
|
|
224
224
|
//#endregion
|
|
225
225
|
//#region Public Methods
|
|
226
226
|
destroy() {
|
|
227
|
-
M(this,
|
|
227
|
+
M(this, E).abort(), this.view?.unregisterComponent(this), v(this, u, T).call(this);
|
|
228
228
|
}
|
|
229
229
|
formatDate(t) {
|
|
230
230
|
return this._formatDate(t, this._dateFormat);
|
|
@@ -310,26 +310,26 @@ let o = class extends V {
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
)
|
|
313
|
-
]), await
|
|
313
|
+
]), await K(
|
|
314
314
|
(async () => {
|
|
315
|
-
if (await Z(() => this.view?.ready, { signal: M(this,
|
|
315
|
+
if (await Z(() => this.view?.ready, { signal: M(this, E).signal }), this.loadPersistedSettingsDisabled)
|
|
316
316
|
return;
|
|
317
317
|
const t = await nt(
|
|
318
318
|
this.view?.map,
|
|
319
|
-
M(this,
|
|
319
|
+
M(this, E).signal
|
|
320
320
|
);
|
|
321
321
|
t && (this.fullTimeExtent = t.fullTimeExtent ?? void 0, this.loop = t.loop, this.mode = t.mode, this.playRate = t.playRate, this.stops = t.stops ?? void 0, this.timeExtent = t.timeExtent ?? void 0);
|
|
322
322
|
})()
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
325
|
next() {
|
|
326
|
-
v(this, u,
|
|
326
|
+
v(this, u, _).call(this, { forward: !0, allowRestart: !1 });
|
|
327
327
|
}
|
|
328
328
|
play() {
|
|
329
|
-
v(this, u,
|
|
329
|
+
v(this, u, D).call(this);
|
|
330
330
|
}
|
|
331
331
|
previous() {
|
|
332
|
-
v(this, u,
|
|
332
|
+
v(this, u, _).call(this, { forward: !1, allowRestart: !1 });
|
|
333
333
|
}
|
|
334
334
|
stop() {
|
|
335
335
|
v(this, u, T).call(this);
|
|
@@ -347,7 +347,7 @@ let o = class extends V {
|
|
|
347
347
|
stopInterval: X(this.stops) ? this.stops.interval : null,
|
|
348
348
|
stops: F(this.stops) ? this.stops.dates : null
|
|
349
349
|
});
|
|
350
|
-
t.widgets ??= new
|
|
350
|
+
t.widgets ??= new H(), t.widgets.timeSlider = e;
|
|
351
351
|
}
|
|
352
352
|
_formatDate(t, e) {
|
|
353
353
|
return gt({ locale: this.locale, formatOptions: e }).format(t);
|
|
@@ -357,22 +357,22 @@ let o = class extends V {
|
|
|
357
357
|
}
|
|
358
358
|
//#endregion
|
|
359
359
|
};
|
|
360
|
-
|
|
360
|
+
E = /* @__PURE__ */ new WeakMap();
|
|
361
361
|
u = /* @__PURE__ */ new WeakSet();
|
|
362
|
-
|
|
362
|
+
$ = async function() {
|
|
363
363
|
try {
|
|
364
364
|
const { view: t } = this, e = this._animationController?.signal;
|
|
365
|
-
await Promise.all([
|
|
365
|
+
await Promise.all([j(this.playRate, e), t && Z(() => !t.updating, e)]);
|
|
366
366
|
} catch (t) {
|
|
367
|
-
|
|
367
|
+
L(t) || at("error", "arcgis-slider-time", "animation error", { detail: { error: t } }), this._animationController = void 0;
|
|
368
368
|
return;
|
|
369
369
|
}
|
|
370
|
-
v(this, u,
|
|
370
|
+
v(this, u, _).call(this, { forward: !0, allowRestart: !1 }), this._animationController && v(this, u, $).call(this);
|
|
371
371
|
};
|
|
372
|
-
|
|
373
|
-
v(this, u, T).call(this), this._animationController = new AbortController(), v(this, u,
|
|
372
|
+
D = function() {
|
|
373
|
+
v(this, u, T).call(this), this._animationController = new AbortController(), v(this, u, _).call(this, { forward: !0, allowRestart: !0 }), v(this, u, $).call(this);
|
|
374
374
|
};
|
|
375
|
-
|
|
375
|
+
_ = function({ forward: t, allowRestart: e }) {
|
|
376
376
|
const { _thumbPositions: n, effectiveStopsEpoch: a } = this;
|
|
377
377
|
if (!n || !a)
|
|
378
378
|
return;
|
|
@@ -381,13 +381,13 @@ E = function({ forward: t, allowRestart: e }) {
|
|
|
381
381
|
if (g !== -1)
|
|
382
382
|
return g;
|
|
383
383
|
const S = a.reduce(
|
|
384
|
-
(y,
|
|
384
|
+
(y, p) => Math.abs(p - c) < Math.abs(y - c) ? p : y
|
|
385
385
|
);
|
|
386
386
|
return a.indexOf(S);
|
|
387
387
|
}), h = m.map((c) => c += t ? 1 : -1);
|
|
388
388
|
if (h.some((c) => c < 0 || c > a.length - 1))
|
|
389
389
|
if (this.loop || e) {
|
|
390
|
-
const c = Math.min(...m), g = Math.max(...m), y = (t ? m.map((
|
|
390
|
+
const c = Math.min(...m), g = Math.max(...m), y = (t ? m.map((p) => p - c) : m.map((p) => p + (a.length - 1 - g))).map((p) => a[p]);
|
|
391
391
|
this.timeExtent = v(this, u, P).call(this, y);
|
|
392
392
|
} else
|
|
393
393
|
this.state === "playing" && this.stop();
|
|
@@ -472,7 +472,7 @@ r([
|
|
|
472
472
|
l()
|
|
473
473
|
], o.prototype, "state", 1);
|
|
474
474
|
r([
|
|
475
|
-
l({ cast:
|
|
475
|
+
l({ cast: G })
|
|
476
476
|
], o.prototype, "stops", 2);
|
|
477
477
|
r([
|
|
478
478
|
l()
|
|
@@ -503,10 +503,10 @@ class Mt extends rt {
|
|
|
503
503
|
constructor() {
|
|
504
504
|
super(...arguments), this._viewModel = St(this), this.messages = pt({ name: "time-bar", blocking: !0 }), this.#t = mt(), this.#e = ut(), this.#i = (e) => {
|
|
505
505
|
this._settingsActionElement = e;
|
|
506
|
-
}, this.autoDestroyDisabled = !1, this.disabled = this._viewModel.disabled, this.effectiveStops = this._viewModel.effectiveStops, this.format = this._viewModel.format, this.fullTimeExtent = this._viewModel.fullTimeExtent, this.icon = "clock", this.loadPersistedSettingsDisabled = this._viewModel.loadPersistedSettingsDisabled, this.loop = this._viewModel.loop, this.mode = this._viewModel.mode, this.playRate = this._viewModel.playRate, this.savePersistedSettingsDisabled = this._viewModel.savePersistedSettingsDisabled, this.showNext = !1, this.showPlay = !1, this.showPrevious = !1, this.showSettings = !1, this.state = this._viewModel.state, this.stops = this._viewModel.stops, this.timeExtent = this._viewModel.timeExtent, this.timeZone = this._viewModel.timeZone, this.toolbarKind = "floating", this.view = this._viewModel.view, this.arcgisPropertyChange = dt()("effectiveStops", "fullTimeExtent", "state", "timeExtent"), this.arcgisReady = lt();
|
|
506
|
+
}, this.autoDestroyDisabled = !1, this.disabled = this._viewModel.disabled, this.effectiveStops = this._viewModel.effectiveStops, this.format = this._viewModel.format, this.fullTimeExtent = this._viewModel.fullTimeExtent, this.icon = "clock", this.loadPersistedSettingsDisabled = this._viewModel.loadPersistedSettingsDisabled, this.loop = this._viewModel.loop, this.mode = this._viewModel.mode, this.playRate = this._viewModel.playRate, this.savePersistedSettingsDisabled = this._viewModel.savePersistedSettingsDisabled, this.showNext = !1, this.showPlay = !1, this.showPrevious = !1, this.showSettings = !1, this.showTimeExtent = !1, this.state = this._viewModel.state, this.stops = this._viewModel.stops, this.timeExtent = this._viewModel.timeExtent, this.timeZone = this._viewModel.timeZone, this.toolbarKind = "floating", this.view = this._viewModel.view, this.arcgisPropertyChange = dt()("effectiveStops", "fullTimeExtent", "state", "timeExtent"), this.arcgisReady = lt();
|
|
507
507
|
}
|
|
508
508
|
static {
|
|
509
|
-
this.properties = { _settingsActionElement: 16, autoDestroyDisabled: 5, disabled: 5, effectiveStops: 32, format: 1, fullTimeExtent: 0, icon: 1, label: 1, loadPersistedSettingsDisabled: 5, loop: 5, messageOverrides: 0, mode: 1, playRate: 9, referenceElement: 1, savePersistedSettingsDisabled: 5, showNext: 5, showPlay: 5, showPrevious: 5, showSettings: 5, state: 32, stops: 0, timeExtent: 0, timeZone: 1, toolbarKind: 1, view: 0 };
|
|
509
|
+
this.properties = { _settingsActionElement: 16, autoDestroyDisabled: 5, disabled: 5, effectiveStops: 32, format: 1, fullTimeExtent: 0, icon: 1, label: 1, loadPersistedSettingsDisabled: 5, loop: 5, messageOverrides: 0, mode: 1, playRate: 9, referenceElement: 1, savePersistedSettingsDisabled: 5, showNext: 5, showPlay: 5, showPrevious: 5, showSettings: 5, showTimeExtent: 5, state: 32, stops: 0, timeExtent: 0, timeZone: 1, toolbarKind: 1, view: 0 };
|
|
510
510
|
}
|
|
511
511
|
static {
|
|
512
512
|
this.styles = Tt;
|
|
@@ -538,15 +538,15 @@ class Mt extends rt {
|
|
|
538
538
|
willUpdate(e) {
|
|
539
539
|
e.has("messages") && (this._viewModel.locale = this.messages._lang);
|
|
540
540
|
}
|
|
541
|
-
#
|
|
541
|
+
#h(e) {
|
|
542
542
|
const { currentTarget: n } = e, a = (
|
|
543
543
|
// prioritizes slotted element (if it exists)
|
|
544
544
|
ct(n).at(0) ?? // fallback to default label
|
|
545
545
|
n.querySelector("arcgis-time-bar-extent")
|
|
546
546
|
);
|
|
547
|
-
a && (a.viewModel = this._viewModel);
|
|
547
|
+
a && (a.messages = this.messages, a.viewModel = this._viewModel);
|
|
548
548
|
}
|
|
549
|
-
async #
|
|
549
|
+
async #u() {
|
|
550
550
|
switch (this.state) {
|
|
551
551
|
case "disabled":
|
|
552
552
|
case "playing":
|
|
@@ -556,30 +556,33 @@ class Mt extends rt {
|
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
render() {
|
|
559
|
-
return
|
|
559
|
+
return d`<div role=presentation><calcite-action-bar class="action-bar" layout=horizontal expand-disabled .floating=${this.toolbarKind === "floating"} overflow-actions-disabled>${this.#e === "ltr" ? d`${this.#s()}${this.#a()}${this.#c()}${this.#m()}${this.#n()}` : d`${this.#s()}${this.#m()}${this.#c()}${this.#a()}${this.#n()}`}</calcite-action-bar></div>`;
|
|
560
560
|
}
|
|
561
561
|
#s() {
|
|
562
|
-
return
|
|
562
|
+
return this.showNext || this.showPlay || this.showPrevious || this.showTimeExtent || this.showSettings ? null : d`<calcite-action disabled .text=${this.messages.componentLabel} text-enabled></calcite-action>`;
|
|
563
563
|
}
|
|
564
564
|
#n() {
|
|
565
|
-
return
|
|
565
|
+
return d`<slot name=actions-end slot=actions-end></slot>`;
|
|
566
566
|
}
|
|
567
567
|
#a() {
|
|
568
|
-
return this.
|
|
568
|
+
return this.showPrevious || this.showPlay || this.showNext ? d`<calcite-action-group>${this.#e === "ltr" ? d`${this.#r()}${this.#l()}${this.#o()}` : d`${this.#o()}${this.#l()}${this.#r()}`}</calcite-action-group>` : null;
|
|
569
569
|
}
|
|
570
570
|
#o() {
|
|
571
|
-
return this.
|
|
571
|
+
return this.showNext ? d`<calcite-action .disabled=${this._viewModel.isOutOfRange || !this._viewModel.interactive || !this.effectiveStops?.length || this.state === "playing"} icon=forward @click=${this.next} .text=${this.messages.next}></calcite-action>` : null;
|
|
572
572
|
}
|
|
573
573
|
#r() {
|
|
574
|
-
return this.
|
|
574
|
+
return this.showPlay ? d`<calcite-action .disabled=${this._viewModel.isOutOfRange || !this._viewModel.interactive || !this.effectiveStops?.length} .icon=${this.state === "playing" ? "pause-f" : "play-f"} @click=${this.#u} .text=${this.state === "playing" ? this.messages.stop : this.messages.play}></calcite-action>` : null;
|
|
575
575
|
}
|
|
576
576
|
#l() {
|
|
577
|
-
return this.
|
|
577
|
+
return this.showPrevious ? d`<calcite-action .disabled=${this._viewModel.isOutOfRange || !this._viewModel.interactive || !this.effectiveStops?.length || this.state === "playing"} icon=reverse @click=${this.previous} .text=${this.messages.previous}></calcite-action>` : null;
|
|
578
|
+
}
|
|
579
|
+
#m() {
|
|
580
|
+
return this.showSettings ? d`<calcite-action-group><calcite-action .disabled=${!this._viewModel.interactive} .text=${this.messages.settings} icon=sliders-horizontal ${k(this.#i)}></calcite-action>${this._settingsActionElement ? d`<calcite-popover auto-close .heading=${this.messages.timeBarSettings} .label=${this.messages.timeBarSettings} .referenceElement=${this._settingsActionElement} @calcitePopoverClose=${() => {
|
|
578
581
|
this.#t.value?.navigateToOverview();
|
|
579
582
|
}} overlay-positioning=fixed><slot name=settings><arcgis-time-bar-settings class="settings" .messages=${this.messages} .viewModel=${this._viewModel} ${k(this.#t)}></arcgis-time-bar-settings></slot></calcite-popover>` : void 0}</calcite-action-group>` : null;
|
|
580
583
|
}
|
|
581
|
-
#
|
|
582
|
-
return
|
|
584
|
+
#c() {
|
|
585
|
+
return this.showTimeExtent ? d`<calcite-action-group class="time-extent-group"><slot name=time-extent @slotchange=${this.#h}><arcgis-time-bar-extent class="label" .viewModel=${this._viewModel}></arcgis-time-bar-extent></slot></calcite-action-group>` : null;
|
|
583
586
|
}
|
|
584
587
|
}
|
|
585
588
|
W("arcgis-time-bar", Mt);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@esri/calcite-components/components/calcite-action-bar";
|
|
2
|
-
import "@esri/calcite-components/components/calcite-action-group";
|
|
3
2
|
import "@esri/calcite-components/components/calcite-action";
|
|
3
|
+
import "@esri/calcite-components/components/calcite-action-group";
|
|
4
4
|
import "@esri/calcite-components/components/calcite-popover";
|
|
5
5
|
import "../arcgis-time-bar-settings/index.js";
|
|
6
6
|
import "../arcgis-time-bar-extent/index.js";
|