@anthropomorphic/delorean 0.1.0 → 0.2.1
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/core/index.js +61 -43
- package/dist/delorean/adapters/leaflet/leaflet.adapter.d.ts +1 -1
- package/dist/delorean/adapters/maplibre/maplibregl.adapter.d.ts +1 -1
- package/dist/delorean/core/delorean.store.d.ts +5 -4
- package/dist/delorean/ui/delorean.component.d.ts +1 -1
- package/dist/leaflet/index.js +26 -24
- package/dist/maplibre/index.js +27 -25
- package/dist/ui/index.js +9 -9
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -1,89 +1,107 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var C = (n) => {
|
|
2
|
+
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var i = (
|
|
6
|
-
var
|
|
7
|
-
set _(
|
|
8
|
-
n
|
|
4
|
+
var c = (n, t, e) => t.has(n) || C("Cannot " + e);
|
|
5
|
+
var i = (n, t, e) => (c(n, t, "read from private field"), e ? e.call(n) : t.get(n)), u = (n, t, e) => t.has(n) ? C("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), h = (n, t, e, m) => (c(n, t, "write to private field"), m ? m.call(n, e) : t.set(n, e), e), d = (n, t, e) => (c(n, t, "access private method"), e);
|
|
6
|
+
var f = (n, t, e, m) => ({
|
|
7
|
+
set _(a) {
|
|
8
|
+
h(n, t, a, e);
|
|
9
9
|
},
|
|
10
10
|
get _() {
|
|
11
|
-
return i(
|
|
11
|
+
return i(n, t, m);
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
import { a as
|
|
15
|
-
import { g as
|
|
16
|
-
var
|
|
17
|
-
class
|
|
14
|
+
import { a as v } from "../delorean.utils-DOgTNSYn.js";
|
|
15
|
+
import { g as P } from "../delorean.utils-DOgTNSYn.js";
|
|
16
|
+
var s, r, o, l, g, p, x;
|
|
17
|
+
class w {
|
|
18
18
|
constructor(t = [], e = (/* @__PURE__ */ new Date()).getTime()) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
u(this, g);
|
|
20
|
+
u(this, s);
|
|
21
|
+
u(this, r);
|
|
22
|
+
u(this, o, []);
|
|
23
|
+
u(this, l, !1);
|
|
24
|
+
h(this, s, [...t].toSorted((m, a) => m - a)), h(this, r, i(this, s).length > 0 ? v(e, i(this, s)) : void 0);
|
|
25
25
|
}
|
|
26
26
|
get times() {
|
|
27
|
-
return i(this,
|
|
27
|
+
return i(this, s);
|
|
28
28
|
}
|
|
29
29
|
get currentTime() {
|
|
30
|
-
return i(this,
|
|
30
|
+
return i(this, r) ? i(this, s)[i(this, r)] : void 0;
|
|
31
31
|
}
|
|
32
32
|
setTimes(t, e = "intersect") {
|
|
33
|
+
const m = this.currentTime;
|
|
33
34
|
switch (e) {
|
|
34
35
|
case "union":
|
|
35
|
-
|
|
36
|
+
h(this, s, [.../* @__PURE__ */ new Set([...i(this, s), ...t])].sort((a, T) => a - T));
|
|
36
37
|
break;
|
|
37
38
|
case "intersect":
|
|
38
|
-
|
|
39
|
+
h(this, s, [.../* @__PURE__ */ new Set([...i(this, s), ...t])].sort((a, T) => a - T));
|
|
39
40
|
break;
|
|
40
41
|
default:
|
|
41
|
-
|
|
42
|
+
h(this, s, [...t].sort((a, T) => a - T));
|
|
42
43
|
break;
|
|
43
44
|
}
|
|
45
|
+
i(this, s).length === 0 ? (h(this, r, void 0), h(this, l, !1)) : m !== void 0 && i(this, s).includes(m) ? h(this, r, i(this, s).indexOf(m)) : (h(this, r, void 0), h(this, l, !1)), this.currentTime !== m && this.timeChanged(this.currentTime);
|
|
44
46
|
}
|
|
45
47
|
setCurrentTime(t) {
|
|
46
|
-
|
|
48
|
+
if (i(this, s).length === 0) {
|
|
49
|
+
this.resetCurrentTime();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
h(this, r, v(t, i(this, s))), this.timeChanged(this.currentTime);
|
|
53
|
+
}
|
|
54
|
+
resetCurrentTime() {
|
|
55
|
+
h(this, r, void 0), h(this, l, !1), this.timeChanged(void 0);
|
|
47
56
|
}
|
|
48
57
|
removeTimes(t) {
|
|
49
|
-
const e = new Set(t);
|
|
50
|
-
|
|
51
|
-
(a) => !e.has(a)
|
|
52
|
-
));
|
|
58
|
+
const e = this.currentTime, m = new Set(t);
|
|
59
|
+
h(this, s, i(this, s).filter((a) => !m.has(a))), i(this, s).length === 0 || e === void 0 || m.has(e) ? (h(this, r, void 0), h(this, l, !1)) : h(this, r, i(this, s).indexOf(e)), this.currentTime !== e && this.timeChanged(this.currentTime);
|
|
53
60
|
}
|
|
54
61
|
prevTime(t = !0) {
|
|
55
|
-
|
|
62
|
+
i(this, r) === void 0 || i(this, s).length === 0 || (f(this, r)._--, t ? i(this, r) < 0 && h(this, r, i(this, s).length - 1) : h(this, r, Math.max(0, i(this, r))), this.timeChanged(this.currentTime));
|
|
56
63
|
}
|
|
57
64
|
nextTime(t = !0) {
|
|
58
|
-
|
|
65
|
+
i(this, r) === void 0 || i(this, s).length === 0 || (f(this, r)._++, t ? i(this, r) >= i(this, s).length && h(this, r, 0) : h(this, r, Math.min(
|
|
66
|
+
i(this, s).length - 1,
|
|
67
|
+
i(this, r)
|
|
68
|
+
)), this.timeChanged(this.currentTime));
|
|
59
69
|
}
|
|
60
70
|
firstTime() {
|
|
61
|
-
|
|
71
|
+
if (i(this, s).length === 0) {
|
|
72
|
+
this.resetCurrentTime();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
h(this, r, 0), this.timeChanged(this.currentTime);
|
|
62
76
|
}
|
|
63
77
|
lastTime() {
|
|
64
|
-
|
|
78
|
+
if (i(this, s).length === 0) {
|
|
79
|
+
this.resetCurrentTime();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
h(this, r, i(this, s).length - 1), this.timeChanged(this.currentTime);
|
|
65
83
|
}
|
|
66
84
|
togglePlay(t, e = 3e3) {
|
|
67
|
-
|
|
85
|
+
h(this, l, t), d(this, g, p).call(this, () => this.nextTime(), e);
|
|
68
86
|
}
|
|
69
87
|
addTimeChangedCallback(t) {
|
|
70
|
-
i(this,
|
|
88
|
+
i(this, o).push(t);
|
|
71
89
|
}
|
|
72
90
|
removeTimeChangedCallback(t) {
|
|
73
|
-
|
|
91
|
+
h(this, o, i(this, o).filter((e) => e !== t));
|
|
74
92
|
}
|
|
75
93
|
timeChanged(t) {
|
|
76
|
-
i(this,
|
|
94
|
+
i(this, o).forEach((e) => e(t));
|
|
77
95
|
}
|
|
78
96
|
}
|
|
79
|
-
|
|
80
|
-
for (; i(this,
|
|
81
|
-
await
|
|
82
|
-
},
|
|
97
|
+
s = new WeakMap(), r = new WeakMap(), o = new WeakMap(), l = new WeakMap(), g = new WeakSet(), p = async function(t, e) {
|
|
98
|
+
for (; i(this, l) && (await t(), !!i(this, l)); )
|
|
99
|
+
await d(this, g, x).call(this, e);
|
|
100
|
+
}, x = function(t) {
|
|
83
101
|
return new Promise((e) => setTimeout(e, t));
|
|
84
102
|
};
|
|
85
103
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
104
|
+
w as Delorean,
|
|
105
|
+
v as getCurrentTimeIndex,
|
|
106
|
+
P as getLayerTimes
|
|
89
107
|
};
|
|
@@ -10,5 +10,5 @@ export declare class LeafletRasterTimeLayer {
|
|
|
10
10
|
addTo(map: leaflet.Map, defaultTime?: number, operation?: TimesOperation): Promise<this>;
|
|
11
11
|
removeFrom(map: leaflet.Map): this;
|
|
12
12
|
loadTimes(): Promise<LayerTimeInfo>;
|
|
13
|
-
setTime(time: number): Promise<this>;
|
|
13
|
+
setTime(time: number | undefined): Promise<this>;
|
|
14
14
|
}
|
|
@@ -12,5 +12,5 @@ export declare class MaplibreglRasterTimeLayer {
|
|
|
12
12
|
addTo(map: maplibregl.Map, defaultTime?: number, operation?: TimesOperation): Promise<this>;
|
|
13
13
|
removeFrom(map: maplibregl.Map): this;
|
|
14
14
|
loadTimes(): Promise<LayerTimeInfo>;
|
|
15
|
-
setTime(map: maplibregl.Map, time: number): Promise<this>;
|
|
15
|
+
setTime(map: maplibregl.Map, time: number | undefined): Promise<this>;
|
|
16
16
|
}
|
|
@@ -3,16 +3,17 @@ export declare class Delorean {
|
|
|
3
3
|
#private;
|
|
4
4
|
constructor(defaultTimes?: number[], defaultCurrentTime?: number);
|
|
5
5
|
get times(): number[];
|
|
6
|
-
get currentTime(): number;
|
|
6
|
+
get currentTime(): number | undefined;
|
|
7
7
|
setTimes(newTimes: number[], operation?: TimesOperation): void;
|
|
8
8
|
setCurrentTime(time: number): void;
|
|
9
|
+
resetCurrentTime(): void;
|
|
9
10
|
removeTimes(timesToRemove: number[]): void;
|
|
10
11
|
prevTime(loop?: boolean): void;
|
|
11
12
|
nextTime(loop?: boolean): void;
|
|
12
13
|
firstTime(): void;
|
|
13
14
|
lastTime(): void;
|
|
14
15
|
togglePlay(isPlaying: boolean, interval?: number): void;
|
|
15
|
-
addTimeChangedCallback(callback: (newTime: number) => void): void;
|
|
16
|
-
removeTimeChangedCallback(callback: (newTime: number) => void): void;
|
|
17
|
-
timeChanged(newTime: number): void;
|
|
16
|
+
addTimeChangedCallback(callback: (newTime: number | undefined) => void): void;
|
|
17
|
+
removeTimeChangedCallback(callback: (newTime: number | undefined) => void): void;
|
|
18
|
+
timeChanged(newTime: number | undefined): void;
|
|
18
19
|
}
|
package/dist/leaflet/index.js
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
var
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
2
|
var g = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var s = (t, e, i) => (
|
|
5
|
+
var w = (t, e, i) => e in t ? u(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
|
|
6
|
+
var T = (t, e, i) => w(t, typeof e != "symbol" ? e + "" : e, i), f = (t, e, i) => e.has(t) || g("Cannot " + i);
|
|
7
|
+
var s = (t, e, i) => (f(t, e, "read from private field"), i ? i.call(t) : e.get(t)), h = (t, e, i) => e.has(t) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), m = (t, e, i, r) => (f(t, e, "write to private field"), r ? r.call(t, i) : e.set(t, i), i);
|
|
8
8
|
import * as b from "leaflet";
|
|
9
9
|
import { g as p } from "../delorean.utils-DOgTNSYn.js";
|
|
10
|
-
var a,
|
|
11
|
-
class
|
|
10
|
+
var a, n, d, o, l;
|
|
11
|
+
class I {
|
|
12
12
|
constructor(e, i) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
T(this, "layerId");
|
|
14
|
+
T(this, "layer");
|
|
15
|
+
T(this, "getCapabilitiesUrl");
|
|
16
16
|
h(this, a);
|
|
17
|
-
h(this, o);
|
|
18
|
-
h(this, d);
|
|
19
17
|
h(this, n);
|
|
20
|
-
h(this,
|
|
21
|
-
|
|
18
|
+
h(this, d);
|
|
19
|
+
h(this, o);
|
|
20
|
+
h(this, l);
|
|
21
|
+
m(this, a, e), this.layerId = i.layerId, this.getCapabilitiesUrl = i.getCapabilitiesUrl, m(this, n, i.tileBaseUrl), m(this, d, i.wmsOptions), this.layer = b.tileLayer.wms(s(this, n), s(this, d));
|
|
22
22
|
}
|
|
23
|
-
async addTo(e, i,
|
|
23
|
+
async addTo(e, i, r = "intersect") {
|
|
24
24
|
const y = await this.loadTimes();
|
|
25
|
-
e.addLayer(this.layer), m(this,
|
|
26
|
-
const
|
|
27
|
-
return
|
|
25
|
+
e.addLayer(this.layer), m(this, o, y.discreteValues), s(this, a).setTimes(s(this, o) ?? [], r), m(this, l, (C) => this.setTime(C)), s(this, a).addTimeChangedCallback(s(this, l));
|
|
26
|
+
const c = i ?? y.defaultValue;
|
|
27
|
+
return c !== void 0 ? s(this, a).setCurrentTime(c) : s(this, a).lastTime(), await new Promise((C) => this.layer.once("load", C)), this;
|
|
28
28
|
}
|
|
29
29
|
removeFrom(e) {
|
|
30
|
-
return e.removeLayer(this.layer), s(this, a).removeTimes(s(this,
|
|
30
|
+
return e.removeLayer(this.layer), s(this, a).removeTimes(s(this, o) ?? []), s(this, l) && s(this, a).removeTimeChangedCallback(s(this, l)), this;
|
|
31
31
|
}
|
|
32
32
|
loadTimes() {
|
|
33
33
|
if (!this.getCapabilitiesUrl) throw new Error("getCapabilitiesUrl undefined");
|
|
34
34
|
return p(this.getCapabilitiesUrl, this.layerId);
|
|
35
35
|
}
|
|
36
36
|
async setTime(e) {
|
|
37
|
-
const i = this.layer,
|
|
38
|
-
|
|
37
|
+
const i = this.layer, r = e ?? s(this, a).times.at(-1);
|
|
38
|
+
if (r === void 0) return this;
|
|
39
|
+
const y = new Promise((c) => {
|
|
40
|
+
i.once("load", () => c());
|
|
39
41
|
});
|
|
40
42
|
return i.setParams({
|
|
41
|
-
time: new Date(
|
|
42
|
-
}), await
|
|
43
|
+
time: new Date(r).toISOString()
|
|
44
|
+
}), await y, this;
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
a = new WeakMap(),
|
|
47
|
+
a = new WeakMap(), n = new WeakMap(), d = new WeakMap(), o = new WeakMap(), l = new WeakMap();
|
|
46
48
|
export {
|
|
47
|
-
|
|
49
|
+
I as LeafletRasterTimeLayer
|
|
48
50
|
};
|
package/dist/maplibre/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var U = (i) => {
|
|
3
3
|
throw TypeError(i);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var n = (i, e, t) =>
|
|
7
|
-
var r = (i, e, t) => (
|
|
8
|
-
import * as
|
|
9
|
-
import { g as
|
|
10
|
-
var s, I, u,
|
|
5
|
+
var $ = (i, e, t) => e in i ? v(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
6
|
+
var n = (i, e, t) => $(i, typeof e != "symbol" ? e + "" : e, t), b = (i, e, t) => e.has(i) || U("Cannot " + t);
|
|
7
|
+
var r = (i, e, t) => (b(i, e, "read from private field"), t ? t.call(i) : e.get(i)), l = (i, e, t) => e.has(i) ? U("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), d = (i, e, t, h) => (b(i, e, "write to private field"), h ? h.call(i, t) : e.set(i, t), t), T = (i, e, t) => (b(i, e, "access private method"), t);
|
|
8
|
+
import * as L from "maplibre-gl";
|
|
9
|
+
import { g as p } from "../delorean.utils-DOgTNSYn.js";
|
|
10
|
+
var s, I, u, g, m, c, a, w, S, C;
|
|
11
11
|
class R {
|
|
12
12
|
constructor(e, t) {
|
|
13
13
|
l(this, a);
|
|
@@ -19,37 +19,39 @@ class R {
|
|
|
19
19
|
l(this, s);
|
|
20
20
|
l(this, I);
|
|
21
21
|
l(this, u);
|
|
22
|
-
l(this,
|
|
22
|
+
l(this, g);
|
|
23
23
|
l(this, m);
|
|
24
24
|
l(this, c);
|
|
25
|
-
|
|
25
|
+
d(this, s, e), this.sourceId = t.sourceId, this.layerId = t.layerId, this.getCapabilitiesUrl = t.getCapabilitiesUrl, d(this, I, t.tileBaseUrl), d(this, u, new URLSearchParams(t.tileUrlParams)), d(this, g, t.tileUrlTemplate), this.source = T(this, a, w).call(this), this.layer = T(this, a, S).call(this, t.paint);
|
|
26
26
|
}
|
|
27
|
-
async addTo(e, t,
|
|
28
|
-
const
|
|
29
|
-
e.addSource(this.sourceId, this.source), e.addLayer(this.layer),
|
|
30
|
-
const
|
|
31
|
-
return
|
|
27
|
+
async addTo(e, t, h = "intersect") {
|
|
28
|
+
const f = await this.loadTimes();
|
|
29
|
+
e.addSource(this.sourceId, this.source), e.addLayer(this.layer), d(this, m, f.discreteValues), r(this, s).setTimes(r(this, m) ?? [], h), d(this, c, (y) => this.setTime(e, y)), r(this, s).addTimeChangedCallback(r(this, c));
|
|
30
|
+
const o = t ?? f.defaultValue;
|
|
31
|
+
return o !== void 0 ? r(this, s).setCurrentTime(o) : r(this, s).lastTime(), await new Promise((y) => e.once("idle", y)), this;
|
|
32
32
|
}
|
|
33
33
|
removeFrom(e) {
|
|
34
34
|
return e.getLayer(this.layerId) && e.removeLayer(this.layerId), e.getSource(this.sourceId) && e.removeSource(this.sourceId), r(this, s).removeTimes(r(this, m) ?? []), r(this, c) && r(this, s).removeTimeChangedCallback(r(this, c)), this;
|
|
35
35
|
}
|
|
36
36
|
loadTimes() {
|
|
37
37
|
if (!this.getCapabilitiesUrl) throw new Error("getCapabilitiesUrl undefined");
|
|
38
|
-
return
|
|
38
|
+
return p(this.getCapabilitiesUrl, this.layerId);
|
|
39
39
|
}
|
|
40
40
|
async setTime(e, t) {
|
|
41
41
|
if (!e) throw new Error(`Cannot set time: layer "${this.layerId}" is not attached to a map.`);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
const h = t ?? r(this, s).times.at(-1);
|
|
43
|
+
if (h === void 0) return this;
|
|
44
|
+
const f = new Promise((y) => {
|
|
45
|
+
e.once("idle", () => y());
|
|
46
|
+
}), o = e.getSource(this.sourceId);
|
|
47
|
+
if (!o || o.type !== "raster") throw new Error(`Raster source "${this.sourceId}" not found.`);
|
|
48
|
+
return r(this, u).set("TIME", `${new Date(h).toISOString()}`), o instanceof L.RasterTileSource && o.setTiles([T(this, a, C).call(this)]), await f, this;
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
|
-
s = new WeakMap(), I = new WeakMap(), u = new WeakMap(),
|
|
51
|
+
s = new WeakMap(), I = new WeakMap(), u = new WeakMap(), g = new WeakMap(), m = new WeakMap(), c = new WeakMap(), a = new WeakSet(), w = function() {
|
|
50
52
|
return {
|
|
51
53
|
type: "raster",
|
|
52
|
-
tiles: [
|
|
54
|
+
tiles: [T(this, a, C).call(this)]
|
|
53
55
|
};
|
|
54
56
|
}, S = function(e) {
|
|
55
57
|
return {
|
|
@@ -58,8 +60,8 @@ s = new WeakMap(), I = new WeakMap(), u = new WeakMap(), T = new WeakMap(), m =
|
|
|
58
60
|
type: "raster",
|
|
59
61
|
paint: e ?? {}
|
|
60
62
|
};
|
|
61
|
-
},
|
|
62
|
-
return `${r(this, I)}?${r(this, u).toString()}&${Object.entries(r(this,
|
|
63
|
+
}, C = function() {
|
|
64
|
+
return `${r(this, I)}?${r(this, u).toString()}&${Object.entries(r(this, g)).map(([e, t]) => `${e}=${t}`).join("&")}`;
|
|
63
65
|
};
|
|
64
66
|
export {
|
|
65
67
|
R as MaplibreglRasterTimeLayer
|
package/dist/ui/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var _ = (e) => {
|
|
|
5
5
|
var A = (e, s, t) => s in e ? q(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
6
6
|
var k = (e, s, t) => A(e, typeof s != "symbol" ? s + "" : s, t), y = (e, s, t) => s.has(e) || _("Cannot " + t);
|
|
7
7
|
var n = (e, s, t) => (y(e, s, "read from private field"), t ? t.call(e) : s.get(e)), a = (e, s, t) => s.has(e) ? _("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), l = (e, s, t, i) => (y(e, s, "write to private field"), i ? i.call(e, t) : s.set(e, t), t), h = (e, s, t) => (y(e, s, "access private method"), t);
|
|
8
|
-
var r, p, c, m, g,
|
|
8
|
+
var r, p, c, m, g, v, d, w, b, o, f, B, M, x, D, F, C, E, Z, R;
|
|
9
9
|
class L extends HTMLElement {
|
|
10
10
|
constructor() {
|
|
11
11
|
super();
|
|
@@ -16,7 +16,7 @@ class L extends HTMLElement {
|
|
|
16
16
|
a(this, c);
|
|
17
17
|
a(this, m);
|
|
18
18
|
a(this, g);
|
|
19
|
-
a(this,
|
|
19
|
+
a(this, v);
|
|
20
20
|
a(this, d);
|
|
21
21
|
a(this, w, "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%2224px%22%20viewBox%3D%220%20-960%20960%20960%22%20width%3D%2224px%22%20fill%3D%22%23000000%22%3E%3Cpath%20d%3D%22M560-200v-560h160v560H560Zm-320%200v-560h160v560H240Z%22%2F%3E%3C%2Fsvg%3E");
|
|
22
22
|
a(this, b, "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%2224px%22%20viewBox%3D%220%20-960%20960%20960%22%20width%3D%2224px%22%20fill%3D%22%23000000%22%3E%3Cpath%20d%3D%22M320-200v-560l440%20280-440%20280Z%22%2F%3E%3C%2Fsvg%3E");
|
|
@@ -45,16 +45,16 @@ class L extends HTMLElement {
|
|
|
45
45
|
new CustomEvent("delorean-play", { bubbles: !0, composed: !0, detail: n(this, r) })
|
|
46
46
|
);
|
|
47
47
|
});
|
|
48
|
-
this.shadowRoot = this.attachShadow({ mode: "open" }), this.shadowRoot.appendChild(h(this, o, f).call(this).content.cloneNode(!0)), this.shadowRoot.appendChild(h(this, o, B).call(this).cloneNode(!0)), l(this, p, this.shadowRoot.querySelector("#datetime")), l(this, c, this.shadowRoot.querySelector("#first")), l(this, m, this.shadowRoot.querySelector("#prev")), l(this, g, this.shadowRoot.querySelector("#next")), l(this,
|
|
48
|
+
this.shadowRoot = this.attachShadow({ mode: "open" }), this.shadowRoot.appendChild(h(this, o, f).call(this).content.cloneNode(!0)), this.shadowRoot.appendChild(h(this, o, B).call(this).cloneNode(!0)), l(this, p, this.shadowRoot.querySelector("#datetime")), l(this, c, this.shadowRoot.querySelector("#first")), l(this, m, this.shadowRoot.querySelector("#prev")), l(this, g, this.shadowRoot.querySelector("#next")), l(this, v, this.shadowRoot.querySelector("#last")), l(this, d, this.shadowRoot.querySelector("#play"));
|
|
49
49
|
}
|
|
50
50
|
connectedCallback() {
|
|
51
51
|
h(this, o, M).call(this);
|
|
52
52
|
}
|
|
53
53
|
set time(t) {
|
|
54
|
-
n(this, p).value = h(this, o, R).call(this, t);
|
|
54
|
+
n(this, p).value = t !== void 0 ? h(this, o, R).call(this, t) : "";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
r = new WeakMap(), p = new WeakMap(), c = new WeakMap(), m = new WeakMap(), g = new WeakMap(),
|
|
57
|
+
r = new WeakMap(), p = new WeakMap(), c = new WeakMap(), m = new WeakMap(), g = new WeakMap(), v = new WeakMap(), d = new WeakMap(), w = new WeakMap(), b = new WeakMap(), o = new WeakSet(), f = function() {
|
|
58
58
|
const t = document.createElement("template");
|
|
59
59
|
return t.innerHTML = `
|
|
60
60
|
<div part="delorean" class="delorean">
|
|
@@ -112,15 +112,15 @@ r = new WeakMap(), p = new WeakMap(), c = new WeakMap(), m = new WeakMap(), g =
|
|
|
112
112
|
}
|
|
113
113
|
`, t;
|
|
114
114
|
}, M = function() {
|
|
115
|
-
n(this, c).onclick = n(this, x), n(this, m).onclick = n(this, D), n(this, g).onclick = n(this, F), n(this,
|
|
115
|
+
n(this, c).onclick = n(this, x), n(this, m).onclick = n(this, D), n(this, g).onclick = n(this, F), n(this, v).onclick = n(this, C), n(this, d).onclick = n(this, E);
|
|
116
116
|
}, x = new WeakMap(), D = new WeakMap(), F = new WeakMap(), C = new WeakMap(), E = new WeakMap(), Z = function(t) {
|
|
117
117
|
const i = n(this, d).querySelector("span.delorean-btn__icon");
|
|
118
118
|
i && (i.style.maskImage = `url('${t ? n(this, w) : n(this, b)}')`);
|
|
119
119
|
}, R = function(t) {
|
|
120
|
-
const i = new Date(t),
|
|
120
|
+
const i = new Date(t), u = (S) => S.toString().padStart(2, "0");
|
|
121
121
|
return [
|
|
122
|
-
`${i.getFullYear()}-${
|
|
123
|
-
`${
|
|
122
|
+
`${i.getFullYear()}-${u(i.getMonth() + 1)}-${u(i.getDate())}`,
|
|
123
|
+
`${u(i.getHours())}:${u(i.getMinutes())}`
|
|
124
124
|
].join("T");
|
|
125
125
|
};
|
|
126
126
|
customElements.define("delorean-controller", L);
|
package/package.json
CHANGED