@kteneyck/cesium-timeline-react 0.7.0 → 0.9.0
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/README.md +62 -0
- package/dist/cesium-timeline-react.js +828 -775
- package/dist/cesium-timeline-react.umd.cjs +4 -4
- package/dist/index.d.ts +6 -0
- package/package.json +6 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import { DEFAULT_LABELS as
|
|
1
|
+
import ct, { useMemo as Ne, useRef as x, useState as Ae, useEffect as z, forwardRef as st, useCallback as ae, useImperativeHandle as it, useLayoutEffect as ut } from "react";
|
|
2
|
+
import * as D from "cesium";
|
|
3
|
+
import { DEFAULT_LABELS as lt, splitForDisplay as at, getTimezoneAbbr as dt, formatDateTime as We, resolveLabel as Be, drawTimeline as ft, hitTestSwimLane as pt, hitTestLaneLabel as mt, isInSwimLaneRegion as ht, TICK_AREA_HEIGHT as Oe, zoomRange as gt, DEFAULT_LANE_HEIGHT as $e, LANE_GAP as He, SWIM_LANE_SCROLL_SPEED as xt, MIN_SPAN_MS as vt, MAX_SPAN_MS as bt, zoomAroundMs as Tt, toJulianDate as De, defaultTheme as wt, generateTicks as Mt, timeToPosition as yt, snapToTick as Et } from "@kteneyck/cesium-timeline-core";
|
|
4
4
|
export * from "@kteneyck/cesium-timeline-core";
|
|
5
|
-
import { TICK_AREA_HEIGHT as
|
|
6
|
-
var
|
|
5
|
+
import { TICK_AREA_HEIGHT as Ot } from "@kteneyck/cesium-timeline-core";
|
|
6
|
+
var Xe = { exports: {} }, Se = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.js
|
|
@@ -13,29 +13,29 @@ var Me = { exports: {} }, Te = {};
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
for (var
|
|
26
|
-
|
|
27
|
-
} else
|
|
28
|
-
return
|
|
29
|
-
$$typeof:
|
|
30
|
-
type:
|
|
31
|
-
key:
|
|
32
|
-
ref:
|
|
33
|
-
props:
|
|
16
|
+
var Ue;
|
|
17
|
+
function Rt() {
|
|
18
|
+
if (Ue) return Se;
|
|
19
|
+
Ue = 1;
|
|
20
|
+
var F = Symbol.for("react.transitional.element"), X = Symbol.for("react.fragment");
|
|
21
|
+
function K(d, _, S) {
|
|
22
|
+
var W = null;
|
|
23
|
+
if (S !== void 0 && (W = "" + S), _.key !== void 0 && (W = "" + _.key), "key" in _) {
|
|
24
|
+
S = {};
|
|
25
|
+
for (var $ in _)
|
|
26
|
+
$ !== "key" && (S[$] = _[$]);
|
|
27
|
+
} else S = _;
|
|
28
|
+
return _ = S.ref, {
|
|
29
|
+
$$typeof: F,
|
|
30
|
+
type: d,
|
|
31
|
+
key: W,
|
|
32
|
+
ref: _ !== void 0 ? _ : null,
|
|
33
|
+
props: S
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return Se.Fragment = X, Se.jsx = K, Se.jsxs = K, Se;
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var Le = {};
|
|
39
39
|
/**
|
|
40
40
|
* @license React
|
|
41
41
|
* react-jsx-runtime.development.js
|
|
@@ -45,126 +45,126 @@ var we = {};
|
|
|
45
45
|
* This source code is licensed under the MIT license found in the
|
|
46
46
|
* LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
-
return
|
|
51
|
-
function
|
|
48
|
+
var qe;
|
|
49
|
+
function Dt() {
|
|
50
|
+
return qe || (qe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
|
+
function F(t) {
|
|
52
52
|
if (t == null) return null;
|
|
53
53
|
if (typeof t == "function")
|
|
54
|
-
return t.$$typeof ===
|
|
54
|
+
return t.$$typeof === p ? null : t.displayName || t.name || null;
|
|
55
55
|
if (typeof t == "string") return t;
|
|
56
56
|
switch (t) {
|
|
57
|
-
case
|
|
57
|
+
case te:
|
|
58
58
|
return "Fragment";
|
|
59
|
-
case
|
|
59
|
+
case w:
|
|
60
60
|
return "Profiler";
|
|
61
|
-
case
|
|
61
|
+
case ue:
|
|
62
62
|
return "StrictMode";
|
|
63
|
-
case
|
|
63
|
+
case B:
|
|
64
64
|
return "Suspense";
|
|
65
|
-
case
|
|
65
|
+
case oe:
|
|
66
66
|
return "SuspenseList";
|
|
67
|
-
case
|
|
67
|
+
case A:
|
|
68
68
|
return "Activity";
|
|
69
69
|
}
|
|
70
70
|
if (typeof t == "object")
|
|
71
71
|
switch (typeof t.tag == "number" && console.error(
|
|
72
72
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
73
|
), t.$$typeof) {
|
|
74
|
-
case
|
|
74
|
+
case ie:
|
|
75
75
|
return "Portal";
|
|
76
|
-
case
|
|
76
|
+
case Q:
|
|
77
77
|
return t.displayName || "Context";
|
|
78
|
-
case
|
|
78
|
+
case v:
|
|
79
79
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
80
|
-
case
|
|
81
|
-
var
|
|
82
|
-
return t = t.displayName, t || (t =
|
|
83
|
-
case
|
|
84
|
-
return
|
|
85
|
-
case
|
|
86
|
-
|
|
80
|
+
case M:
|
|
81
|
+
var f = t.render;
|
|
82
|
+
return t = t.displayName, t || (t = f.displayName || f.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
83
|
+
case ge:
|
|
84
|
+
return f = t.displayName || null, f !== null ? f : F(t.type) || "Memo";
|
|
85
|
+
case ce:
|
|
86
|
+
f = t._payload, t = t._init;
|
|
87
87
|
try {
|
|
88
|
-
return
|
|
88
|
+
return F(t(f));
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function X(t) {
|
|
95
95
|
return "" + t;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function K(t) {
|
|
98
98
|
try {
|
|
99
|
-
|
|
100
|
-
var
|
|
99
|
+
X(t);
|
|
100
|
+
var f = !1;
|
|
101
101
|
} catch {
|
|
102
|
-
|
|
102
|
+
f = !0;
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
return
|
|
108
|
-
|
|
104
|
+
if (f) {
|
|
105
|
+
f = console;
|
|
106
|
+
var b = f.error, y = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
107
|
+
return b.call(
|
|
108
|
+
f,
|
|
109
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
-
|
|
111
|
-
),
|
|
110
|
+
y
|
|
111
|
+
), X(t);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
if (t ===
|
|
116
|
-
if (typeof t == "object" && t !== null && t.$$typeof ===
|
|
114
|
+
function d(t) {
|
|
115
|
+
if (t === te) return "<>";
|
|
116
|
+
if (typeof t == "object" && t !== null && t.$$typeof === ce)
|
|
117
117
|
return "<...>";
|
|
118
118
|
try {
|
|
119
|
-
var
|
|
120
|
-
return
|
|
119
|
+
var f = F(t);
|
|
120
|
+
return f ? "<" + f + ">" : "<...>";
|
|
121
121
|
} catch {
|
|
122
122
|
return "<...>";
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
var t =
|
|
125
|
+
function _() {
|
|
126
|
+
var t = g.A;
|
|
127
127
|
return t === null ? null : t.getOwner();
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function S() {
|
|
130
130
|
return Error("react-stack-top-frame");
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
if (
|
|
134
|
-
var
|
|
135
|
-
if (
|
|
132
|
+
function W(t) {
|
|
133
|
+
if (L.call(t, "key")) {
|
|
134
|
+
var f = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
135
|
+
if (f && f.isReactWarning) return !1;
|
|
136
136
|
}
|
|
137
137
|
return t.key !== void 0;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
function
|
|
141
|
-
|
|
139
|
+
function $(t, f) {
|
|
140
|
+
function b() {
|
|
141
|
+
O || (O = !0, console.error(
|
|
142
142
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
143
|
-
|
|
143
|
+
f
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
get:
|
|
146
|
+
b.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
147
|
+
get: b,
|
|
148
148
|
configurable: !0
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
var t =
|
|
153
|
-
return
|
|
151
|
+
function de() {
|
|
152
|
+
var t = F(this.type);
|
|
153
|
+
return j[t] || (j[t] = !0, console.error(
|
|
154
154
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
155
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
var
|
|
157
|
+
function H(t, f, b, y, re, he) {
|
|
158
|
+
var J = b.ref;
|
|
159
159
|
return t = {
|
|
160
160
|
$$typeof: Z,
|
|
161
161
|
type: t,
|
|
162
|
-
key:
|
|
163
|
-
props:
|
|
164
|
-
_owner:
|
|
165
|
-
}, (
|
|
162
|
+
key: f,
|
|
163
|
+
props: b,
|
|
164
|
+
_owner: y
|
|
165
|
+
}, (J !== void 0 ? J : null) !== null ? Object.defineProperty(t, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
|
-
get:
|
|
167
|
+
get: de
|
|
168
168
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
169
169
|
configurable: !1,
|
|
170
170
|
enumerable: !1,
|
|
@@ -179,148 +179,148 @@ function mt() {
|
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
|
-
value:
|
|
182
|
+
value: re
|
|
183
183
|
}), Object.defineProperty(t, "_debugTask", {
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: he
|
|
188
188
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
var
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
for (
|
|
196
|
-
|
|
197
|
-
Object.freeze && Object.freeze(
|
|
190
|
+
function G(t, f, b, y, re, he) {
|
|
191
|
+
var J = f.children;
|
|
192
|
+
if (J !== void 0)
|
|
193
|
+
if (y)
|
|
194
|
+
if (C(J)) {
|
|
195
|
+
for (y = 0; y < J.length; y++)
|
|
196
|
+
U(J[y]);
|
|
197
|
+
Object.freeze && Object.freeze(J);
|
|
198
198
|
} else
|
|
199
199
|
console.error(
|
|
200
200
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
201
|
);
|
|
202
|
-
else
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
var
|
|
206
|
-
return
|
|
202
|
+
else U(J);
|
|
203
|
+
if (L.call(f, "key")) {
|
|
204
|
+
J = F(t);
|
|
205
|
+
var E = Object.keys(f).filter(function(Te) {
|
|
206
|
+
return Te !== "key";
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
y = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", k[J + y] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
209
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s {...props} />
|
|
212
212
|
React keys must be passed directly to JSX without using spread:
|
|
213
213
|
let props = %s;
|
|
214
214
|
<%s key={someKey} {...props} />`,
|
|
215
|
+
y,
|
|
216
|
+
J,
|
|
215
217
|
E,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
T
|
|
219
|
-
), q[T + E] = !0);
|
|
218
|
+
J
|
|
219
|
+
), k[J + y] = !0);
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
for (var
|
|
224
|
-
|
|
225
|
-
} else
|
|
226
|
-
return
|
|
227
|
-
|
|
221
|
+
if (J = null, b !== void 0 && (K(b), J = "" + b), W(f) && (K(f.key), J = "" + f.key), "key" in f) {
|
|
222
|
+
b = {};
|
|
223
|
+
for (var fe in f)
|
|
224
|
+
fe !== "key" && (b[fe] = f[fe]);
|
|
225
|
+
} else b = f;
|
|
226
|
+
return J && $(
|
|
227
|
+
b,
|
|
228
228
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
229
|
-
),
|
|
229
|
+
), H(
|
|
230
230
|
t,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
J,
|
|
232
|
+
b,
|
|
233
|
+
_(),
|
|
234
|
+
re,
|
|
235
|
+
he
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
|
|
238
|
+
function U(t) {
|
|
239
|
+
I(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === ce && (t._payload.status === "fulfilled" ? I(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function I(t) {
|
|
242
242
|
return typeof t == "object" && t !== null && t.$$typeof === Z;
|
|
243
243
|
}
|
|
244
|
-
var
|
|
244
|
+
var se = ct, Z = Symbol.for("react.transitional.element"), ie = Symbol.for("react.portal"), te = Symbol.for("react.fragment"), ue = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), Q = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), ge = Symbol.for("react.memo"), ce = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), p = Symbol.for("react.client.reference"), g = se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, C = Array.isArray, ee = console.createTask ? console.createTask : function() {
|
|
245
245
|
return null;
|
|
246
246
|
};
|
|
247
|
-
|
|
247
|
+
se = {
|
|
248
248
|
react_stack_bottom_frame: function(t) {
|
|
249
249
|
return t();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
)(),
|
|
256
|
-
|
|
257
|
-
var
|
|
258
|
-
return
|
|
252
|
+
var O, j = {}, s = se.react_stack_bottom_frame.bind(
|
|
253
|
+
se,
|
|
254
|
+
S
|
|
255
|
+
)(), V = ee(d(S)), k = {};
|
|
256
|
+
Le.Fragment = te, Le.jsx = function(t, f, b) {
|
|
257
|
+
var y = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
258
|
+
return G(
|
|
259
259
|
t,
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
f,
|
|
261
|
+
b,
|
|
262
262
|
!1,
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
y ? Error("react-stack-top-frame") : s,
|
|
264
|
+
y ? ee(d(t)) : V
|
|
265
265
|
);
|
|
266
|
-
},
|
|
267
|
-
var
|
|
268
|
-
return
|
|
266
|
+
}, Le.jsxs = function(t, f, b) {
|
|
267
|
+
var y = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return G(
|
|
269
269
|
t,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
f,
|
|
271
|
+
b,
|
|
272
272
|
!0,
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
y ? Error("react-stack-top-frame") : s,
|
|
274
|
+
y ? ee(d(t)) : V
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
|
-
})()),
|
|
277
|
+
})()), Le;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
279
|
+
var Ge;
|
|
280
|
+
function At() {
|
|
281
|
+
return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? Xe.exports = Rt() : Xe.exports = Dt()), Xe.exports;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
284
|
-
const
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
] }),
|
|
288
|
-
currentTime:
|
|
289
|
-
isPlaying:
|
|
290
|
-
multiplier:
|
|
291
|
-
dateTimeFormat:
|
|
292
|
-
timezone:
|
|
293
|
-
isLive:
|
|
294
|
-
hasStartTime:
|
|
295
|
-
hasEndTime:
|
|
296
|
-
showJumpToStart:
|
|
297
|
-
showJumpToEnd:
|
|
298
|
-
onPlayPause:
|
|
299
|
-
onJumpToStart:
|
|
300
|
-
onRewind:
|
|
301
|
-
onFastForward:
|
|
283
|
+
var u = At();
|
|
284
|
+
const Ct = 520, _t = () => /* @__PURE__ */ u.jsxs("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: [
|
|
285
|
+
/* @__PURE__ */ u.jsx("rect", { x: "1", y: "0", width: "4", height: "16", rx: "1" }),
|
|
286
|
+
/* @__PURE__ */ u.jsx("rect", { x: "9", y: "0", width: "4", height: "16", rx: "1" })
|
|
287
|
+
] }), Ve = () => /* @__PURE__ */ u.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ u.jsx("polyline", { points: "3,5 7,9 11,5" }) }), Ke = () => /* @__PURE__ */ u.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ u.jsx("polyline", { points: "3,9 7,5 11,9" }) }), jt = ({
|
|
288
|
+
currentTime: F,
|
|
289
|
+
isPlaying: X,
|
|
290
|
+
multiplier: K,
|
|
291
|
+
dateTimeFormat: d,
|
|
292
|
+
timezone: _,
|
|
293
|
+
isLive: S,
|
|
294
|
+
hasStartTime: W,
|
|
295
|
+
hasEndTime: $,
|
|
296
|
+
showJumpToStart: de = !0,
|
|
297
|
+
showJumpToEnd: H = !0,
|
|
298
|
+
onPlayPause: G,
|
|
299
|
+
onJumpToStart: U,
|
|
300
|
+
onRewind: I,
|
|
301
|
+
onFastForward: se,
|
|
302
302
|
onJumpToEnd: Z,
|
|
303
|
-
onJumpToLive:
|
|
304
|
-
onResetSpeed:
|
|
305
|
-
onDateTimeClick:
|
|
306
|
-
theme:
|
|
307
|
-
swimLanesVisible:
|
|
308
|
-
onToggleSwimLanes:
|
|
309
|
-
labels:
|
|
303
|
+
onJumpToLive: ie,
|
|
304
|
+
onResetSpeed: te,
|
|
305
|
+
onDateTimeClick: ue,
|
|
306
|
+
theme: w,
|
|
307
|
+
swimLanesVisible: v,
|
|
308
|
+
onToggleSwimLanes: Q,
|
|
309
|
+
labels: M
|
|
310
310
|
}) => {
|
|
311
|
-
const
|
|
312
|
-
() => ({ ...
|
|
313
|
-
[
|
|
314
|
-
),
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
if (!
|
|
318
|
-
const
|
|
319
|
-
|
|
311
|
+
const B = K < 0, oe = K > 1, ge = K === 1, ce = Math.abs(K), A = Ne(
|
|
312
|
+
() => ({ ...lt, ...M }),
|
|
313
|
+
[M]
|
|
314
|
+
), p = x(null), [g, L] = Ae(!1);
|
|
315
|
+
z(() => {
|
|
316
|
+
const s = p.current;
|
|
317
|
+
if (!s) return;
|
|
318
|
+
const V = new ResizeObserver(([k]) => {
|
|
319
|
+
L(k.contentRect.width < Ct);
|
|
320
320
|
});
|
|
321
|
-
return
|
|
321
|
+
return V.observe(s), () => V.disconnect();
|
|
322
322
|
}, []);
|
|
323
|
-
const
|
|
323
|
+
const C = {
|
|
324
324
|
background: "none",
|
|
325
325
|
border: "1px solid transparent",
|
|
326
326
|
cursor: "pointer",
|
|
@@ -337,73 +337,73 @@ const xt = 520, gt = () => /* @__PURE__ */ l.jsxs("svg", { width: "14", height:
|
|
|
337
337
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
338
338
|
flexShrink: 0,
|
|
339
339
|
lineHeight: 1
|
|
340
|
-
},
|
|
341
|
-
...
|
|
342
|
-
color:
|
|
343
|
-
borderColor:
|
|
344
|
-
}),
|
|
345
|
-
|
|
346
|
-
},
|
|
347
|
-
|
|
340
|
+
}, ee = (s) => ({
|
|
341
|
+
...C,
|
|
342
|
+
color: s ? w.buttonActiveColor : w.buttonColor,
|
|
343
|
+
borderColor: s ? `${w.buttonActiveColor}33` : "transparent"
|
|
344
|
+
}), O = (s, V) => {
|
|
345
|
+
s.currentTarget.style.backgroundColor = V ? `${w.buttonActiveColor}22` : w.buttonHoverColor + "44";
|
|
346
|
+
}, j = (s) => {
|
|
347
|
+
s.currentTarget.style.backgroundColor = "transparent";
|
|
348
348
|
};
|
|
349
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ u.jsxs(
|
|
350
350
|
"div",
|
|
351
351
|
{
|
|
352
|
-
ref:
|
|
352
|
+
ref: p,
|
|
353
353
|
style: {
|
|
354
|
-
display:
|
|
355
|
-
gridTemplateColumns:
|
|
354
|
+
display: g ? "flex" : "grid",
|
|
355
|
+
gridTemplateColumns: g ? void 0 : "1fr auto 1fr",
|
|
356
356
|
alignItems: "center",
|
|
357
357
|
padding: "6px 16px",
|
|
358
|
-
backgroundColor:
|
|
359
|
-
borderBottom: `1px solid ${
|
|
358
|
+
backgroundColor: w.controlBarBackground,
|
|
359
|
+
borderBottom: `1px solid ${w.controlBarBorder}`,
|
|
360
360
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
361
361
|
},
|
|
362
362
|
children: [
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexShrink: 0 }, children: [
|
|
364
|
+
/* @__PURE__ */ u.jsx(
|
|
365
365
|
"div",
|
|
366
366
|
{
|
|
367
|
-
onClick:
|
|
368
|
-
title:
|
|
367
|
+
onClick: ue,
|
|
368
|
+
title: ue ? A.dateTimeClickTooltip : void 0,
|
|
369
369
|
style: {
|
|
370
|
-
color:
|
|
370
|
+
color: w.labelColor,
|
|
371
371
|
fontFamily: "monospace",
|
|
372
372
|
lineHeight: 1.15,
|
|
373
|
-
cursor:
|
|
373
|
+
cursor: ue ? "pointer" : "default",
|
|
374
374
|
borderRadius: "4px",
|
|
375
375
|
padding: "2px 4px",
|
|
376
376
|
transition: "background 0.15s"
|
|
377
377
|
},
|
|
378
|
-
onMouseEnter: (
|
|
379
|
-
|
|
378
|
+
onMouseEnter: (s) => {
|
|
379
|
+
ue && (s.currentTarget.style.background = w.buttonHoverColor + "44");
|
|
380
380
|
},
|
|
381
|
-
onMouseLeave: (
|
|
381
|
+
onMouseLeave: (s) => s.currentTarget.style.background = "transparent",
|
|
382
382
|
children: (() => {
|
|
383
|
-
const { timeFormat:
|
|
384
|
-
return /* @__PURE__ */
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
|
|
383
|
+
const { timeFormat: s, dateFormat: V } = at(d), k = dt(F, _);
|
|
384
|
+
return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
385
|
+
s && /* @__PURE__ */ u.jsx("div", { style: { fontSize: "2em", fontWeight: "bold", letterSpacing: "0.02em" }, children: We(F, s, _) }),
|
|
386
|
+
V && /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
387
|
+
/* @__PURE__ */ u.jsx("span", { style: { fontSize: "1.15em", letterSpacing: "0.03em", color: w.buttonActiveColor }, children: We(F, V, _) }),
|
|
388
|
+
k && /* @__PURE__ */ u.jsx("span", { style: {
|
|
389
389
|
fontSize: "0.9em",
|
|
390
|
-
color:
|
|
390
|
+
color: w.labelColor,
|
|
391
391
|
opacity: 0.7,
|
|
392
392
|
fontWeight: "bold",
|
|
393
393
|
letterSpacing: "0.04em"
|
|
394
|
-
}, children:
|
|
394
|
+
}, children: k })
|
|
395
395
|
] })
|
|
396
396
|
] });
|
|
397
397
|
})()
|
|
398
398
|
}
|
|
399
399
|
),
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ u.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px", justifyContent: "center" }, children: [
|
|
401
|
+
/* @__PURE__ */ u.jsx(
|
|
402
402
|
"button",
|
|
403
403
|
{
|
|
404
|
-
onClick:
|
|
404
|
+
onClick: ie,
|
|
405
405
|
style: {
|
|
406
|
-
...
|
|
406
|
+
...C,
|
|
407
407
|
fontSize: "11px",
|
|
408
408
|
fontWeight: "bold",
|
|
409
409
|
letterSpacing: "0.05em",
|
|
@@ -411,816 +411,869 @@ const xt = 520, gt = () => /* @__PURE__ */ l.jsxs("svg", { width: "14", height:
|
|
|
411
411
|
minWidth: "52px",
|
|
412
412
|
height: "20px",
|
|
413
413
|
borderRadius: "3px",
|
|
414
|
-
color:
|
|
415
|
-
backgroundColor:
|
|
416
|
-
borderColor:
|
|
417
|
-
opacity:
|
|
414
|
+
color: S ? w.controlBarBackground : w.buttonActiveColor,
|
|
415
|
+
backgroundColor: S ? w.buttonActiveColor : "transparent",
|
|
416
|
+
borderColor: w.buttonActiveColor,
|
|
417
|
+
opacity: S ? 1 : 0.55
|
|
418
418
|
},
|
|
419
|
-
onMouseEnter: (
|
|
420
|
-
|
|
419
|
+
onMouseEnter: (s) => {
|
|
420
|
+
s.currentTarget.style.opacity = "1";
|
|
421
421
|
},
|
|
422
|
-
onMouseLeave: (
|
|
423
|
-
|
|
422
|
+
onMouseLeave: (s) => {
|
|
423
|
+
s.currentTarget.style.opacity = S ? "1" : "0.55";
|
|
424
424
|
},
|
|
425
|
-
title:
|
|
426
|
-
children:
|
|
425
|
+
title: S ? A.liveActiveTooltip : A.liveTooltip,
|
|
426
|
+
children: S ? A.liveActiveLabel : A.liveLabel
|
|
427
427
|
}
|
|
428
428
|
),
|
|
429
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ u.jsx("div", { style: { height: "20px", display: "flex", alignItems: "center" }, children: !ge && /* @__PURE__ */ u.jsx(
|
|
430
430
|
"button",
|
|
431
431
|
{
|
|
432
|
-
onClick: () =>
|
|
432
|
+
onClick: () => te(),
|
|
433
433
|
style: {
|
|
434
|
-
...
|
|
434
|
+
...C,
|
|
435
435
|
fontSize: "11px",
|
|
436
|
-
color:
|
|
437
|
-
borderColor: `${
|
|
436
|
+
color: w.buttonActiveColor,
|
|
437
|
+
borderColor: `${w.buttonActiveColor}44`,
|
|
438
438
|
width: "52px",
|
|
439
439
|
minWidth: "52px",
|
|
440
440
|
height: "20px"
|
|
441
441
|
},
|
|
442
|
-
onMouseEnter: (
|
|
443
|
-
onMouseLeave:
|
|
444
|
-
title:
|
|
445
|
-
children:
|
|
442
|
+
onMouseEnter: (s) => O(s, !0),
|
|
443
|
+
onMouseLeave: j,
|
|
444
|
+
title: A.resetSpeedTooltip,
|
|
445
|
+
children: B ? `◀ ${ce}×` : `${ce}× ▶`
|
|
446
446
|
}
|
|
447
447
|
) })
|
|
448
448
|
] })
|
|
449
449
|
] }),
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
|
|
450
|
+
/* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px", ...g ? { flex: 1, justifyContent: "center" } : {} }, children: [
|
|
451
|
+
de && /* @__PURE__ */ u.jsx(
|
|
452
452
|
"button",
|
|
453
453
|
{
|
|
454
|
-
onClick:
|
|
455
|
-
disabled: !
|
|
456
|
-
style: { ...
|
|
457
|
-
onMouseEnter:
|
|
458
|
-
onMouseLeave:
|
|
459
|
-
title:
|
|
454
|
+
onClick: W ? U : void 0,
|
|
455
|
+
disabled: !W,
|
|
456
|
+
style: { ...ee(!1), opacity: W ? 1 : 0.3, cursor: W ? "pointer" : "default" },
|
|
457
|
+
onMouseEnter: W ? (s) => O(s, !1) : void 0,
|
|
458
|
+
onMouseLeave: W ? j : void 0,
|
|
459
|
+
title: W ? A.jumpToStartTooltip : A.noStartTimeTooltip,
|
|
460
460
|
children: "⏮"
|
|
461
461
|
}
|
|
462
462
|
),
|
|
463
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ u.jsx(
|
|
464
464
|
"button",
|
|
465
465
|
{
|
|
466
|
-
onClick:
|
|
467
|
-
style: { ...
|
|
468
|
-
onMouseEnter: (
|
|
469
|
-
onMouseLeave:
|
|
470
|
-
title:
|
|
471
|
-
children:
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
|
|
466
|
+
onClick: I,
|
|
467
|
+
style: { ...ee(B), width: "64px", minWidth: "64px", gap: "3px" },
|
|
468
|
+
onMouseEnter: (s) => O(s, B),
|
|
469
|
+
onMouseLeave: j,
|
|
470
|
+
title: B ? Be(A.rewindActiveTooltip, ce) : A.rewindTooltip,
|
|
471
|
+
children: B ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
472
|
+
/* @__PURE__ */ u.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
|
|
473
|
+
ce,
|
|
474
474
|
"×"
|
|
475
475
|
] }),
|
|
476
476
|
"◀◀"
|
|
477
477
|
] }) : "◀◀"
|
|
478
478
|
}
|
|
479
479
|
),
|
|
480
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ u.jsx(
|
|
481
481
|
"button",
|
|
482
482
|
{
|
|
483
|
-
onClick: () =>
|
|
483
|
+
onClick: () => G(!X),
|
|
484
484
|
style: {
|
|
485
|
-
...
|
|
486
|
-
color:
|
|
485
|
+
...C,
|
|
486
|
+
color: w.buttonActiveColor,
|
|
487
487
|
fontSize: "18px",
|
|
488
488
|
width: "40px",
|
|
489
489
|
minWidth: "40px",
|
|
490
490
|
height: "40px",
|
|
491
|
-
borderColor: `${
|
|
491
|
+
borderColor: `${w.buttonActiveColor}55`,
|
|
492
492
|
borderRadius: "50%",
|
|
493
|
-
paddingLeft:
|
|
493
|
+
paddingLeft: X ? "0" : "2px"
|
|
494
494
|
},
|
|
495
|
-
onMouseEnter: (
|
|
496
|
-
onMouseLeave:
|
|
497
|
-
title:
|
|
498
|
-
children:
|
|
495
|
+
onMouseEnter: (s) => O(s, !0),
|
|
496
|
+
onMouseLeave: j,
|
|
497
|
+
title: X ? A.pauseTooltip : B ? A.playFromRewindTooltip : A.playTooltip,
|
|
498
|
+
children: X ? /* @__PURE__ */ u.jsx(_t, {}) : "▶"
|
|
499
499
|
}
|
|
500
500
|
),
|
|
501
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ u.jsx(
|
|
502
502
|
"button",
|
|
503
503
|
{
|
|
504
|
-
onClick:
|
|
505
|
-
style: { ...
|
|
506
|
-
onMouseEnter: (
|
|
507
|
-
onMouseLeave:
|
|
508
|
-
title:
|
|
509
|
-
children:
|
|
504
|
+
onClick: se,
|
|
505
|
+
style: { ...ee(oe), width: "64px", minWidth: "64px", gap: "3px" },
|
|
506
|
+
onMouseEnter: (s) => O(s, oe),
|
|
507
|
+
onMouseLeave: j,
|
|
508
|
+
title: oe ? Be(A.fastForwardActiveTooltip, ce) : A.fastForwardTooltip,
|
|
509
|
+
children: oe ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
510
510
|
"▶▶",
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
|
|
511
|
+
/* @__PURE__ */ u.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
|
|
512
|
+
ce,
|
|
513
513
|
"×"
|
|
514
514
|
] })
|
|
515
515
|
] }) : "▶▶"
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
|
-
|
|
518
|
+
H && /* @__PURE__ */ u.jsx(
|
|
519
519
|
"button",
|
|
520
520
|
{
|
|
521
|
-
onClick:
|
|
522
|
-
disabled:
|
|
523
|
-
style: { ...
|
|
524
|
-
onMouseEnter:
|
|
525
|
-
onMouseLeave:
|
|
526
|
-
title:
|
|
521
|
+
onClick: $ ? Z : void 0,
|
|
522
|
+
disabled: !$,
|
|
523
|
+
style: { ...ee(!1), opacity: $ ? 1 : 0.3, cursor: $ ? "pointer" : "default" },
|
|
524
|
+
onMouseEnter: $ ? (s) => O(s, !1) : void 0,
|
|
525
|
+
onMouseLeave: $ ? j : void 0,
|
|
526
|
+
title: $ ? A.jumpToEndTooltip : A.noEndTimeTooltip,
|
|
527
527
|
children: "⏭"
|
|
528
528
|
}
|
|
529
529
|
)
|
|
530
530
|
] }),
|
|
531
|
-
!
|
|
531
|
+
!g && /* @__PURE__ */ u.jsx("div", { style: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: Q != null && v != null && /* @__PURE__ */ u.jsx(
|
|
532
532
|
"button",
|
|
533
533
|
{
|
|
534
|
-
onClick:
|
|
534
|
+
onClick: Q,
|
|
535
535
|
style: {
|
|
536
|
-
...
|
|
537
|
-
color:
|
|
538
|
-
borderColor: `${
|
|
536
|
+
...C,
|
|
537
|
+
color: w.buttonActiveColor,
|
|
538
|
+
borderColor: `${w.buttonActiveColor}33`
|
|
539
539
|
},
|
|
540
|
-
onMouseEnter: (
|
|
541
|
-
onMouseLeave:
|
|
542
|
-
title:
|
|
543
|
-
children:
|
|
540
|
+
onMouseEnter: (s) => O(s, v),
|
|
541
|
+
onMouseLeave: j,
|
|
542
|
+
title: v ? A.collapseSwimLanesTooltip : A.expandSwimLanesTooltip,
|
|
543
|
+
children: v ? /* @__PURE__ */ u.jsx(Ve, {}) : /* @__PURE__ */ u.jsx(Ke, {})
|
|
544
544
|
}
|
|
545
545
|
) }),
|
|
546
|
-
|
|
546
|
+
g && Q != null && v != null && /* @__PURE__ */ u.jsx(
|
|
547
547
|
"button",
|
|
548
548
|
{
|
|
549
|
-
onClick:
|
|
549
|
+
onClick: Q,
|
|
550
550
|
style: {
|
|
551
|
-
...
|
|
552
|
-
color:
|
|
553
|
-
borderColor: `${
|
|
551
|
+
...C,
|
|
552
|
+
color: w.buttonActiveColor,
|
|
553
|
+
borderColor: `${w.buttonActiveColor}33`,
|
|
554
554
|
marginLeft: "4px"
|
|
555
555
|
},
|
|
556
|
-
onMouseEnter: (
|
|
557
|
-
onMouseLeave:
|
|
558
|
-
title:
|
|
559
|
-
children:
|
|
556
|
+
onMouseEnter: (s) => O(s, v),
|
|
557
|
+
onMouseLeave: j,
|
|
558
|
+
title: v ? A.collapseSwimLanesTooltip : A.expandSwimLanesTooltip,
|
|
559
|
+
children: v ? /* @__PURE__ */ u.jsx(Ve, {}) : /* @__PURE__ */ u.jsx(Ke, {})
|
|
560
560
|
}
|
|
561
561
|
)
|
|
562
562
|
]
|
|
563
563
|
}
|
|
564
564
|
);
|
|
565
|
-
},
|
|
566
|
-
(
|
|
565
|
+
}, et = st(
|
|
566
|
+
(F, X) => {
|
|
567
567
|
const {
|
|
568
|
-
currentTime:
|
|
569
|
-
defaultStartMs:
|
|
570
|
-
defaultEndMs:
|
|
571
|
-
theme:
|
|
572
|
-
maxTicks:
|
|
573
|
-
timezone:
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
568
|
+
currentTime: K,
|
|
569
|
+
defaultStartMs: d,
|
|
570
|
+
defaultEndMs: _,
|
|
571
|
+
theme: S,
|
|
572
|
+
maxTicks: W,
|
|
573
|
+
timezone: $,
|
|
574
|
+
dateTimeFormat: de,
|
|
575
|
+
months: H,
|
|
576
|
+
onTimeChange: G,
|
|
577
|
+
onDragStart: U,
|
|
578
|
+
onDragEnd: I,
|
|
579
|
+
onRangeSelect: se,
|
|
580
|
+
swimLanes: Z,
|
|
581
|
+
showSwimLanes: ie,
|
|
582
|
+
onSwimLaneItemClick: te,
|
|
583
|
+
onSwimLaneItemHover: ue,
|
|
584
|
+
onSwimLaneItemDoubleClick: w,
|
|
585
|
+
onSwimLaneItemContextMenu: v,
|
|
586
|
+
onSwimLaneReorder: Q
|
|
587
|
+
} = F, M = x(null), B = x(S), oe = x(W), ge = x($), ce = x(de), A = x(H), p = x(d), g = x(_), L = x(D.JulianDate.toDate(K).getTime());
|
|
588
|
+
z(() => {
|
|
589
|
+
B.current = S;
|
|
590
|
+
}, [S]), z(() => {
|
|
591
|
+
oe.current = W;
|
|
592
|
+
}, [W]), z(() => {
|
|
593
|
+
ge.current = $, m();
|
|
594
|
+
}, [$]), z(() => {
|
|
595
|
+
ce.current = de, m();
|
|
596
|
+
}, [de]), z(() => {
|
|
597
|
+
A.current = H, m();
|
|
598
|
+
}, [H]);
|
|
599
|
+
const C = x(Z ?? []), ee = x(ie ?? (Z != null && Z.length > 0)), O = x(0), j = x(null), s = x(null), V = x(te), k = x(ue), t = x(w), f = x(v), b = x(Q);
|
|
600
|
+
z(() => {
|
|
601
|
+
V.current = te;
|
|
602
|
+
}, [te]), z(() => {
|
|
603
|
+
k.current = ue;
|
|
604
|
+
}, [ue]), z(() => {
|
|
605
|
+
t.current = w;
|
|
606
|
+
}, [w]), z(() => {
|
|
607
|
+
f.current = v;
|
|
608
|
+
}, [v]), z(() => {
|
|
609
|
+
b.current = Q;
|
|
610
|
+
}, [Q]), z(() => {
|
|
611
|
+
C.current = Z ?? [], m();
|
|
612
|
+
}, [Z]), z(() => {
|
|
613
|
+
ee.current = ie ?? (Z != null && Z.length > 0), m();
|
|
614
|
+
}, [ie, Z]);
|
|
615
|
+
const y = x(null), re = x(null), he = x(!1), J = x(0), E = x("none"), fe = x(0), Te = x(0), ke = x(0), Ce = x(0), Fe = x(0), xe = x(null), q = x(se);
|
|
616
|
+
z(() => {
|
|
617
|
+
q.current = se;
|
|
618
|
+
}, [se]);
|
|
619
|
+
const pe = x("none"), ve = x(0), ye = x(0), _e = x(0), je = x(0), Ie = (e, n) => Math.hypot(n.clientX - e.clientX, n.clientY - e.clientY), be = ae(() => ({
|
|
620
|
+
startMs: p.current,
|
|
621
|
+
endMs: g.current,
|
|
622
|
+
currentMs: L.current,
|
|
623
|
+
theme: B.current,
|
|
624
|
+
maxTicks: oe.current,
|
|
625
|
+
timezone: ge.current,
|
|
626
|
+
use12h: /h/.test(ce.current ?? ""),
|
|
627
|
+
months: A.current,
|
|
628
|
+
swimLanes: C.current,
|
|
629
|
+
showSwimLanes: ee.current,
|
|
630
|
+
scrollTop: O.current,
|
|
631
|
+
reorderState: s.current,
|
|
632
|
+
rangeSelection: xe.current
|
|
619
633
|
}), []);
|
|
620
|
-
|
|
634
|
+
it(X, () => ({
|
|
621
635
|
zoomTo(e, n, r) {
|
|
622
|
-
const
|
|
623
|
-
|
|
636
|
+
const a = Math.max(vt, Math.min(bt, n - e)), o = (e + n) / 2;
|
|
637
|
+
p.current = o - a / 2, g.current = o + a / 2, r !== void 0 && (L.current = r), m();
|
|
624
638
|
},
|
|
625
639
|
getVisibleRange() {
|
|
626
|
-
return { startMs:
|
|
640
|
+
return { startMs: p.current, endMs: g.current };
|
|
627
641
|
},
|
|
628
642
|
startFollow(e) {
|
|
629
|
-
if (
|
|
630
|
-
|
|
643
|
+
if (J.current = e, re.current !== null) return;
|
|
644
|
+
he.current = !0;
|
|
631
645
|
let n = performance.now();
|
|
632
646
|
const r = () => {
|
|
633
|
-
const
|
|
634
|
-
n =
|
|
635
|
-
const
|
|
636
|
-
|
|
647
|
+
const a = performance.now(), o = a - n;
|
|
648
|
+
n = a;
|
|
649
|
+
const c = o * J.current;
|
|
650
|
+
p.current += c, g.current += c, L.current += c, m(), re.current = requestAnimationFrame(r);
|
|
637
651
|
};
|
|
638
|
-
|
|
652
|
+
re.current = requestAnimationFrame(r);
|
|
639
653
|
},
|
|
640
654
|
stopFollow() {
|
|
641
|
-
|
|
655
|
+
he.current = !1, re.current !== null && (cancelAnimationFrame(re.current), re.current = null);
|
|
642
656
|
},
|
|
643
657
|
correctFollow(e) {
|
|
644
|
-
if (!
|
|
645
|
-
const n = e -
|
|
646
|
-
|
|
658
|
+
if (!he.current) return;
|
|
659
|
+
const n = e - L.current;
|
|
660
|
+
L.current = e, p.current += n, g.current += n;
|
|
647
661
|
},
|
|
648
662
|
// ── Swim lane CRUD ──────────────────────────────────────────────
|
|
649
663
|
appendSwimLane(e) {
|
|
650
|
-
|
|
664
|
+
C.current = [...C.current, e], m();
|
|
651
665
|
},
|
|
652
666
|
updateSwimLane(e, n) {
|
|
653
|
-
|
|
667
|
+
C.current = C.current.map(
|
|
654
668
|
(r) => r.id === e ? { ...r, ...n, id: r.id } : r
|
|
655
|
-
),
|
|
669
|
+
), m();
|
|
656
670
|
},
|
|
657
671
|
removeSwimLane(e) {
|
|
658
|
-
|
|
672
|
+
C.current = C.current.filter((n) => n.id !== e), m();
|
|
659
673
|
},
|
|
660
674
|
reorderSwimLanes(e) {
|
|
661
|
-
const n = new Map(
|
|
662
|
-
for (const
|
|
663
|
-
const o = n.get(
|
|
675
|
+
const n = new Map(C.current.map((a) => [a.id, a])), r = [];
|
|
676
|
+
for (const a of e) {
|
|
677
|
+
const o = n.get(a);
|
|
664
678
|
o && r.push(o);
|
|
665
679
|
}
|
|
666
|
-
|
|
680
|
+
C.current = r, m();
|
|
667
681
|
}
|
|
668
682
|
}));
|
|
669
|
-
const
|
|
670
|
-
const e =
|
|
683
|
+
const m = ae(() => {
|
|
684
|
+
const e = M.current;
|
|
671
685
|
if (!e) return;
|
|
672
686
|
const n = e.getContext("2d");
|
|
673
687
|
if (!n) return;
|
|
674
|
-
const r = e.getBoundingClientRect(),
|
|
675
|
-
if (
|
|
676
|
-
const
|
|
677
|
-
(e.width !==
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
}, [
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
const e =
|
|
688
|
+
const r = e.getBoundingClientRect(), a = r.width, o = r.height;
|
|
689
|
+
if (a === 0 || o === 0) return;
|
|
690
|
+
const c = window.devicePixelRatio || 1, h = Math.round(a * c), l = Math.round(o * c);
|
|
691
|
+
(e.width !== h || e.height !== l) && (e.width = h, e.height = l), n.save(), n.scale(c, c);
|
|
692
|
+
const T = ft(n, a, o, be());
|
|
693
|
+
T !== O.current && (O.current = T), n.restore();
|
|
694
|
+
}, [be]);
|
|
695
|
+
ut(() => {
|
|
696
|
+
m();
|
|
697
|
+
const e = M.current;
|
|
684
698
|
if (!e) return;
|
|
685
|
-
const n = new ResizeObserver(() =>
|
|
699
|
+
const n = new ResizeObserver(() => m());
|
|
686
700
|
return n.observe(e), () => n.disconnect();
|
|
687
|
-
}, [
|
|
688
|
-
if (
|
|
689
|
-
const e =
|
|
690
|
-
|
|
691
|
-
}, [
|
|
692
|
-
const
|
|
693
|
-
if (
|
|
701
|
+
}, [m]), z(() => {
|
|
702
|
+
if (he.current) return;
|
|
703
|
+
const e = D.JulianDate.toDate(K).getTime();
|
|
704
|
+
L.current !== e && (L.current = e, m());
|
|
705
|
+
}, [K, m]);
|
|
706
|
+
const we = ae((e) => {
|
|
707
|
+
if (y.current !== null) return;
|
|
694
708
|
const n = () => {
|
|
695
|
-
const r =
|
|
696
|
-
if (
|
|
697
|
-
const
|
|
698
|
-
|
|
709
|
+
const r = M.current, a = g.current - p.current, o = e * a * 0.01;
|
|
710
|
+
if (p.current += o, g.current += o, r) {
|
|
711
|
+
const c = r.getBoundingClientRect(), h = Math.max(0, Math.min(c.width, Te.current - c.left)), l = p.current + h / c.width * (g.current - p.current);
|
|
712
|
+
L.current = l, G(D.JulianDate.fromDate(new Date(l)));
|
|
699
713
|
}
|
|
700
|
-
|
|
714
|
+
m(), y.current = requestAnimationFrame(n);
|
|
701
715
|
};
|
|
702
|
-
|
|
703
|
-
}, [
|
|
704
|
-
|
|
705
|
-
}, []),
|
|
716
|
+
y.current = requestAnimationFrame(n);
|
|
717
|
+
}, [m, G]), Me = ae(() => {
|
|
718
|
+
y.current !== null && (cancelAnimationFrame(y.current), y.current = null);
|
|
719
|
+
}, []), i = ae((e, n, r, a) => pt(e, n, r, a, be()), [be]), R = ae((e, n, r) => mt(e, n, r, be()), [be]), P = ae((e, n) => ht(e, n, be()), [be]), le = ae((e) => {
|
|
706
720
|
e.preventDefault();
|
|
707
|
-
const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left,
|
|
708
|
-
if (e.button === 0 &&
|
|
709
|
-
const o =
|
|
721
|
+
const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top;
|
|
722
|
+
if (e.button === 0 && b.current) {
|
|
723
|
+
const o = R(r, a, n.height);
|
|
710
724
|
if (o) {
|
|
711
|
-
const
|
|
712
|
-
|
|
725
|
+
const h = C.current.findIndex((l) => l.id === o.id);
|
|
726
|
+
s.current = {
|
|
713
727
|
dragging: !0,
|
|
714
728
|
dragLaneId: o.id,
|
|
715
729
|
dragStartY: e.clientY,
|
|
716
730
|
currentY: e.clientY,
|
|
717
|
-
insertIndex:
|
|
731
|
+
insertIndex: h
|
|
718
732
|
}, e.currentTarget.style.cursor = "grabbing";
|
|
719
733
|
return;
|
|
720
734
|
}
|
|
721
735
|
}
|
|
722
|
-
if (e.button === 0 &&
|
|
723
|
-
const o = (
|
|
724
|
-
if (!(Math.abs(r - o) <= 10) &&
|
|
725
|
-
|
|
736
|
+
if (e.button === 0 && P(a, n.height)) {
|
|
737
|
+
const o = (L.current - p.current) / (g.current - p.current) * n.width;
|
|
738
|
+
if (!(Math.abs(r - o) <= 10) && i(r, a, n.width, n.height)) {
|
|
739
|
+
ke.current = performance.now();
|
|
726
740
|
return;
|
|
727
741
|
}
|
|
728
742
|
}
|
|
729
743
|
if (e.button === 0) {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
744
|
+
const o = (L.current - p.current) / (g.current - p.current) * n.width, c = Math.abs(r - o) <= 10, h = a >= n.height - Oe;
|
|
745
|
+
if (!c && h)
|
|
746
|
+
E.current = "rangeSelectPending", Fe.current = r, Ce.current = p.current + r / n.width * (g.current - p.current), e.currentTarget.style.cursor = "crosshair", U == null || U();
|
|
747
|
+
else {
|
|
748
|
+
E.current = "scrub", Te.current = e.clientX, e.currentTarget.style.cursor = "grabbing", U == null || U();
|
|
749
|
+
const l = p.current + r / n.width * (g.current - p.current);
|
|
750
|
+
L.current = l, m(), G(D.JulianDate.fromDate(new Date(l)));
|
|
751
|
+
}
|
|
733
752
|
} else if (e.button === 1)
|
|
734
|
-
|
|
753
|
+
E.current = "slide", fe.current = e.clientX;
|
|
735
754
|
else if (e.button === 2) {
|
|
736
|
-
if (
|
|
755
|
+
if (f.current && P(a, n.height))
|
|
737
756
|
return;
|
|
738
|
-
|
|
757
|
+
E.current = "zoom", fe.current = e.clientX;
|
|
739
758
|
}
|
|
740
|
-
}, [
|
|
741
|
-
|
|
759
|
+
}, [m, G, U, R, P, i]);
|
|
760
|
+
z(() => {
|
|
742
761
|
const e = (r) => {
|
|
743
|
-
const
|
|
744
|
-
if (
|
|
745
|
-
|
|
746
|
-
const
|
|
747
|
-
if (
|
|
748
|
-
const
|
|
749
|
-
let
|
|
750
|
-
const
|
|
751
|
-
let
|
|
752
|
-
for (let
|
|
753
|
-
const
|
|
754
|
-
if (
|
|
755
|
-
|
|
762
|
+
const a = s.current;
|
|
763
|
+
if (a && a.dragging) {
|
|
764
|
+
a.currentY = r.clientY;
|
|
765
|
+
const l = M.current;
|
|
766
|
+
if (l) {
|
|
767
|
+
const T = l.getBoundingClientRect(), Y = r.clientY - T.top;
|
|
768
|
+
let Re = -O.current;
|
|
769
|
+
const Je = C.current;
|
|
770
|
+
let Ye = Je.length;
|
|
771
|
+
for (let Pe = 0; Pe < Je.length; Pe++) {
|
|
772
|
+
const ze = Je[Pe].height ?? $e, ot = Re + ze / 2;
|
|
773
|
+
if (Y < ot) {
|
|
774
|
+
Ye = Pe;
|
|
756
775
|
break;
|
|
757
776
|
}
|
|
758
|
-
|
|
777
|
+
Re += ze + He;
|
|
759
778
|
}
|
|
760
|
-
|
|
779
|
+
a.insertIndex = Ye;
|
|
761
780
|
}
|
|
762
|
-
|
|
781
|
+
m();
|
|
763
782
|
return;
|
|
764
783
|
}
|
|
765
|
-
if (
|
|
766
|
-
const o =
|
|
784
|
+
if (E.current === "none") return;
|
|
785
|
+
const o = M.current;
|
|
767
786
|
if (!o) return;
|
|
768
|
-
const
|
|
769
|
-
if (
|
|
770
|
-
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
} else if (
|
|
776
|
-
const
|
|
777
|
-
if (E.current =
|
|
778
|
-
const
|
|
779
|
-
|
|
787
|
+
const c = o.getBoundingClientRect(), h = c.width;
|
|
788
|
+
if (E.current === "scrub") {
|
|
789
|
+
Te.current = r.clientX;
|
|
790
|
+
const l = r.clientX - c.left, T = h * 0.08;
|
|
791
|
+
l < T ? we(-1) : l > h - T ? we(1) : Me();
|
|
792
|
+
const Y = Math.max(0, Math.min(h, l)), me = p.current + Y / h * (g.current - p.current);
|
|
793
|
+
L.current = me, m(), G(D.JulianDate.fromDate(new Date(me)));
|
|
794
|
+
} else if (E.current === "rangeSelectPending" || E.current === "rangeSelect") {
|
|
795
|
+
const l = r.clientX - c.left, T = Math.abs(l - Fe.current);
|
|
796
|
+
if (E.current === "rangeSelectPending" && T >= 3 && (E.current = "rangeSelect"), E.current === "rangeSelect") {
|
|
797
|
+
const Y = Math.max(0, Math.min(h, l)), me = p.current + Y / h * (g.current - p.current);
|
|
798
|
+
xe.current = {
|
|
799
|
+
startMs: Ce.current,
|
|
800
|
+
endMs: me
|
|
801
|
+
}, m();
|
|
802
|
+
}
|
|
803
|
+
} else if (E.current === "slide") {
|
|
804
|
+
const l = fe.current - r.clientX;
|
|
805
|
+
if (fe.current = r.clientX, l !== 0) {
|
|
806
|
+
const T = l / h * (g.current - p.current);
|
|
807
|
+
p.current += T, g.current += T, m();
|
|
780
808
|
}
|
|
781
|
-
} else if (
|
|
782
|
-
const
|
|
783
|
-
|
|
809
|
+
} else if (E.current === "zoom") {
|
|
810
|
+
const l = fe.current - r.clientX;
|
|
811
|
+
fe.current = r.clientX, l !== 0 && N(Math.pow(1.01, l));
|
|
784
812
|
}
|
|
785
813
|
}, n = () => {
|
|
786
|
-
var
|
|
787
|
-
const r =
|
|
814
|
+
var a, o;
|
|
815
|
+
const r = s.current;
|
|
788
816
|
if (r && r.dragging) {
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
791
|
-
const
|
|
792
|
-
|
|
817
|
+
const c = Math.abs(r.currentY - r.dragStartY), h = C.current, l = h.findIndex((T) => T.id === r.dragLaneId);
|
|
818
|
+
if (c > 5 && l >= 0 && r.insertIndex !== l && r.insertIndex !== l + 1) {
|
|
819
|
+
const T = [...h], [Y] = T.splice(l, 1), me = r.insertIndex > l ? r.insertIndex - 1 : r.insertIndex;
|
|
820
|
+
T.splice(me, 0, Y), C.current = T, (a = b.current) == null || a.call(b, T.map((Re) => Re.id));
|
|
793
821
|
}
|
|
794
|
-
|
|
822
|
+
s.current = null, M.current && (M.current.style.cursor = "default"), m();
|
|
795
823
|
return;
|
|
796
824
|
}
|
|
797
|
-
|
|
825
|
+
if (Me(), E.current === "rangeSelectPending") {
|
|
826
|
+
L.current = Ce.current, xe.current = null, E.current = "none", M.current && (M.current.style.cursor = "default"), m(), G(D.JulianDate.fromDate(new Date(Ce.current))), I == null || I();
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
if (E.current === "rangeSelect") {
|
|
830
|
+
const c = xe.current;
|
|
831
|
+
if (xe.current = null, c) {
|
|
832
|
+
const h = Math.min(c.startMs, c.endMs), l = Math.max(c.startMs, c.endMs);
|
|
833
|
+
p.current = h, g.current = l;
|
|
834
|
+
const T = D.JulianDate.fromDate(new Date(h)), Y = D.JulianDate.fromDate(new Date(l));
|
|
835
|
+
(o = q.current) == null || o.call(q, T, Y);
|
|
836
|
+
}
|
|
837
|
+
E.current = "none", M.current && (M.current.style.cursor = "default"), m(), I == null || I();
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
E.current = "none", M.current && (M.current.style.cursor = "default"), I == null || I();
|
|
798
841
|
};
|
|
799
842
|
return document.addEventListener("mousemove", e), document.addEventListener("mouseup", n), () => {
|
|
800
843
|
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", n);
|
|
801
844
|
};
|
|
802
|
-
}, [
|
|
803
|
-
const
|
|
804
|
-
const n =
|
|
805
|
-
|
|
806
|
-
}, [
|
|
845
|
+
}, [m, G, I, we, Me]);
|
|
846
|
+
const N = ae((e) => {
|
|
847
|
+
const n = gt(p.current, g.current, e);
|
|
848
|
+
p.current = n.startMs, g.current = n.endMs, m();
|
|
849
|
+
}, [m]), ne = ae((e) => {
|
|
807
850
|
e.preventDefault();
|
|
808
|
-
const n =
|
|
851
|
+
const n = M.current;
|
|
809
852
|
if (!n) return;
|
|
810
|
-
const r = n.getBoundingClientRect(),
|
|
811
|
-
if (o &&
|
|
812
|
-
const
|
|
813
|
-
if (
|
|
814
|
-
let
|
|
815
|
-
for (const
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
|
|
853
|
+
const r = n.getBoundingClientRect(), a = e.clientY - r.top, o = ee.current, c = C.current;
|
|
854
|
+
if (o && c.length > 0) {
|
|
855
|
+
const h = Math.max(0, r.height - Oe);
|
|
856
|
+
if (a >= 0 && a < h) {
|
|
857
|
+
let l = 0;
|
|
858
|
+
for (const Y of c) l += (Y.height ?? $e) + He;
|
|
859
|
+
const T = Math.max(0, l - h);
|
|
860
|
+
if (T > 0) {
|
|
861
|
+
O.current = Math.max(0, Math.min(T, O.current + e.deltaY * xt)), m();
|
|
819
862
|
return;
|
|
820
863
|
}
|
|
821
864
|
}
|
|
822
865
|
}
|
|
823
|
-
|
|
824
|
-
}, [
|
|
825
|
-
|
|
826
|
-
const e =
|
|
866
|
+
N(Math.pow(1.05, e.deltaY > 0 ? -1 : 1));
|
|
867
|
+
}, [N, m]);
|
|
868
|
+
z(() => {
|
|
869
|
+
const e = M.current;
|
|
827
870
|
if (e)
|
|
828
|
-
return e.addEventListener("wheel",
|
|
829
|
-
}, [
|
|
830
|
-
const e =
|
|
871
|
+
return e.addEventListener("wheel", ne, { passive: !1 }), () => e.removeEventListener("wheel", ne);
|
|
872
|
+
}, [ne]), z(() => {
|
|
873
|
+
const e = M.current;
|
|
831
874
|
if (!e) return;
|
|
832
875
|
const n = (o) => {
|
|
833
876
|
o.preventDefault();
|
|
834
|
-
const
|
|
877
|
+
const c = e.getBoundingClientRect();
|
|
835
878
|
if (o.touches.length === 1) {
|
|
836
|
-
const
|
|
837
|
-
|
|
838
|
-
} else o.touches.length >= 2 && (
|
|
879
|
+
const h = o.touches[0].clientX - c.left, l = Math.max(0, Math.min(c.width, h)), T = p.current + l / c.width * (g.current - p.current);
|
|
880
|
+
je.current = L.current, pe.current = "scrub", ve.current = o.touches[0].clientX, Te.current = o.touches[0].clientX, L.current = T, m(), U == null || U(), G(D.JulianDate.fromDate(new Date(T)));
|
|
881
|
+
} else o.touches.length >= 2 && (pe.current === "scrub" && (L.current = je.current, m(), G(D.JulianDate.fromDate(new Date(je.current)))), pe.current = "pinch", ye.current = Ie(o.touches[0], o.touches[1]), _e.current = (o.touches[0].clientX + o.touches[1].clientX) / 2 - c.left);
|
|
839
882
|
}, r = (o) => {
|
|
840
883
|
o.preventDefault();
|
|
841
|
-
const
|
|
842
|
-
if (
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
845
|
-
else if (
|
|
884
|
+
const c = e.getBoundingClientRect();
|
|
885
|
+
if (pe.current === "scrub" && o.touches.length >= 1) {
|
|
886
|
+
const h = o.touches[0].clientX - c.left, l = c.width * 0.08;
|
|
887
|
+
if (Te.current = o.touches[0].clientX, h < l) we(-1);
|
|
888
|
+
else if (h > c.width - l) we(1);
|
|
846
889
|
else {
|
|
847
|
-
|
|
848
|
-
const
|
|
849
|
-
|
|
890
|
+
Me();
|
|
891
|
+
const T = Math.max(0, Math.min(c.width, h)), Y = p.current + T / c.width * (g.current - p.current);
|
|
892
|
+
L.current = Y, m(), G(D.JulianDate.fromDate(new Date(Y)));
|
|
893
|
+
}
|
|
894
|
+
} else if (pe.current === "slide" && o.touches.length >= 1) {
|
|
895
|
+
const h = ve.current - o.touches[0].clientX;
|
|
896
|
+
if (ve.current = o.touches[0].clientX, h !== 0) {
|
|
897
|
+
const l = h / c.width * (g.current - p.current);
|
|
898
|
+
p.current += l, g.current += l, m();
|
|
850
899
|
}
|
|
851
|
-
} else if (
|
|
852
|
-
const
|
|
853
|
-
if (
|
|
854
|
-
const
|
|
855
|
-
|
|
900
|
+
} else if (pe.current === "pinch" && o.touches.length >= 2) {
|
|
901
|
+
const h = Ie(o.touches[0], o.touches[1]), l = (o.touches[0].clientX + o.touches[1].clientX) / 2 - c.left;
|
|
902
|
+
if (h > 0 && ye.current > 0) {
|
|
903
|
+
const T = p.current + _e.current / c.width * (g.current - p.current), Y = Tt(p.current, g.current, ye.current / h, T);
|
|
904
|
+
p.current = Y.startMs, g.current = Y.endMs, m();
|
|
856
905
|
}
|
|
857
|
-
|
|
858
|
-
const f = xe(o.touches[0], o.touches[1]);
|
|
859
|
-
f > 0 && ae.current > 0 && he(ae.current / f), ae.current = f;
|
|
906
|
+
ye.current = h, _e.current = l;
|
|
860
907
|
}
|
|
861
|
-
},
|
|
862
|
-
|
|
908
|
+
}, a = (o) => {
|
|
909
|
+
Me(), pe.current === "scrub" && (I == null || I()), o.touches.length === 0 ? pe.current = "none" : o.touches.length === 1 && (pe.current = "slide", ve.current = o.touches[0].clientX);
|
|
863
910
|
};
|
|
864
|
-
return e.addEventListener("touchstart", n, { passive: !1 }), e.addEventListener("touchmove", r, { passive: !1 }), e.addEventListener("touchend",
|
|
865
|
-
e.removeEventListener("touchstart", n), e.removeEventListener("touchmove", r), e.removeEventListener("touchend",
|
|
911
|
+
return e.addEventListener("touchstart", n, { passive: !1 }), e.addEventListener("touchmove", r, { passive: !1 }), e.addEventListener("touchend", a, { passive: !1 }), () => {
|
|
912
|
+
e.removeEventListener("touchstart", n), e.removeEventListener("touchmove", r), e.removeEventListener("touchend", a);
|
|
866
913
|
};
|
|
867
|
-
}, [
|
|
868
|
-
const
|
|
869
|
-
var
|
|
870
|
-
if (
|
|
871
|
-
const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left,
|
|
872
|
-
if (
|
|
873
|
-
const
|
|
874
|
-
if (
|
|
875
|
-
e.currentTarget.style.cursor =
|
|
876
|
-
else if (
|
|
914
|
+
}, [m, U, I, G, N, we, Me]);
|
|
915
|
+
const Ee = ae((e) => {
|
|
916
|
+
var h, l, T;
|
|
917
|
+
if (E.current !== "none") return;
|
|
918
|
+
const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = (L.current - p.current) / (g.current - p.current) * n.width, c = Math.abs(r - o) <= 10;
|
|
919
|
+
if (P(a, n.height)) {
|
|
920
|
+
const Y = i(r, a, n.width, n.height), me = j.current;
|
|
921
|
+
if (Y)
|
|
922
|
+
e.currentTarget.style.cursor = c ? "grab" : "pointer", (!me || me.item.id !== Y.item.id || me.lane.id !== Y.lane.id) && (j.current = Y, (h = k.current) == null || h.call(k, { laneId: Y.lane.id, item: Y.item, originalEvent: e.nativeEvent }), m());
|
|
923
|
+
else if (me && (j.current = null, (l = k.current) == null || l.call(k, null), m()), c)
|
|
877
924
|
e.currentTarget.style.cursor = "grab";
|
|
878
925
|
else {
|
|
879
|
-
const
|
|
880
|
-
e.currentTarget.style.cursor =
|
|
926
|
+
const Re = R(r, a, n.height);
|
|
927
|
+
e.currentTarget.style.cursor = Re && b.current ? "grab" : "default";
|
|
881
928
|
}
|
|
882
929
|
return;
|
|
883
930
|
}
|
|
884
|
-
|
|
885
|
-
}, [
|
|
886
|
-
var
|
|
887
|
-
if (performance.now() -
|
|
888
|
-
const r = e.currentTarget.getBoundingClientRect(),
|
|
889
|
-
|
|
890
|
-
}, [
|
|
891
|
-
var
|
|
892
|
-
const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left,
|
|
893
|
-
o && ((
|
|
894
|
-
}, [
|
|
895
|
-
const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left,
|
|
896
|
-
o &&
|
|
897
|
-
}, [
|
|
898
|
-
return
|
|
899
|
-
|
|
900
|
-
}, []), /* @__PURE__ */
|
|
931
|
+
j.current && (j.current = null, (T = k.current) == null || T.call(k, null), m()), c ? e.currentTarget.style.cursor = "grab" : a >= n.height - Oe ? e.currentTarget.style.cursor = "crosshair" : e.currentTarget.style.cursor = "default";
|
|
932
|
+
}, [m, i, P, R]), tt = ae((e) => {
|
|
933
|
+
var h;
|
|
934
|
+
if (performance.now() - ke.current > 300) return;
|
|
935
|
+
const r = e.currentTarget.getBoundingClientRect(), a = e.clientX - r.left, o = e.clientY - r.top, c = i(a, o, r.width, r.height);
|
|
936
|
+
c && ((h = V.current) == null || h.call(V, { laneId: c.lane.id, item: c.item, originalEvent: e.nativeEvent }));
|
|
937
|
+
}, [i]), nt = ae((e) => {
|
|
938
|
+
var c;
|
|
939
|
+
const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = i(r, a, n.width, n.height);
|
|
940
|
+
o && ((c = t.current) == null || c.call(t, { laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent }));
|
|
941
|
+
}, [i]), rt = ae((e) => {
|
|
942
|
+
const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = i(r, a, n.width, n.height);
|
|
943
|
+
o && f.current ? (e.preventDefault(), f.current({ laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent })) : e.preventDefault();
|
|
944
|
+
}, [i]);
|
|
945
|
+
return z(() => () => {
|
|
946
|
+
y.current !== null && cancelAnimationFrame(y.current), re.current !== null && cancelAnimationFrame(re.current);
|
|
947
|
+
}, []), /* @__PURE__ */ u.jsx(
|
|
901
948
|
"canvas",
|
|
902
949
|
{
|
|
903
|
-
ref:
|
|
950
|
+
ref: M,
|
|
904
951
|
style: { width: "100%", flex: 1, minHeight: 0, display: "block", cursor: "default" },
|
|
905
|
-
onMouseDown:
|
|
906
|
-
onMouseMove:
|
|
907
|
-
onClick:
|
|
908
|
-
onDoubleClick:
|
|
952
|
+
onMouseDown: le,
|
|
953
|
+
onMouseMove: Ee,
|
|
954
|
+
onClick: tt,
|
|
955
|
+
onDoubleClick: nt,
|
|
909
956
|
onMouseLeave: () => {
|
|
910
957
|
var e;
|
|
911
|
-
|
|
958
|
+
j.current && (j.current = null, (e = k.current) == null || e.call(k, null), m()), E.current === "none" && M.current && (M.current.style.cursor = "default");
|
|
912
959
|
},
|
|
913
|
-
onContextMenu:
|
|
960
|
+
onContextMenu: rt
|
|
914
961
|
}
|
|
915
962
|
);
|
|
916
963
|
}
|
|
917
964
|
);
|
|
918
|
-
|
|
919
|
-
const
|
|
920
|
-
startTime:
|
|
921
|
-
endTime:
|
|
922
|
-
currentTime:
|
|
923
|
-
clock:
|
|
924
|
-
onTimeChange:
|
|
925
|
-
onPlayPause:
|
|
926
|
-
onMultiplierChange:
|
|
927
|
-
height:
|
|
928
|
-
showControls:
|
|
929
|
-
showJumpToStart:
|
|
930
|
-
showJumpToEnd:
|
|
931
|
-
enableDrag:
|
|
932
|
-
dateTimeFormat:
|
|
933
|
-
onDateTimeClick:
|
|
965
|
+
et.displayName = "TimelineCanvas";
|
|
966
|
+
const Ze = [2, 4, 8, 16, 32, 100, 1], Qe = [1, 2, 4, 8, 16, 32, 100], kt = ({
|
|
967
|
+
startTime: F,
|
|
968
|
+
endTime: X,
|
|
969
|
+
currentTime: K,
|
|
970
|
+
clock: d,
|
|
971
|
+
onTimeChange: _,
|
|
972
|
+
onPlayPause: S,
|
|
973
|
+
onMultiplierChange: W,
|
|
974
|
+
height: $,
|
|
975
|
+
showControls: de = !0,
|
|
976
|
+
showJumpToStart: H,
|
|
977
|
+
showJumpToEnd: G,
|
|
978
|
+
enableDrag: U = !0,
|
|
979
|
+
dateTimeFormat: I,
|
|
980
|
+
onDateTimeClick: se,
|
|
934
981
|
jumpToTime: Z,
|
|
935
|
-
maxTicks:
|
|
936
|
-
ffSpeeds:
|
|
937
|
-
rwSpeeds:
|
|
938
|
-
theme:
|
|
939
|
-
className:
|
|
940
|
-
timezone:
|
|
941
|
-
swimLanes:
|
|
942
|
-
showSwimLanes:
|
|
943
|
-
onShowSwimLanesChange:
|
|
944
|
-
swimLaneTransition:
|
|
945
|
-
onSwimLaneItemClick:
|
|
946
|
-
onSwimLaneItemHover:
|
|
947
|
-
onSwimLaneItemDoubleClick:
|
|
948
|
-
onSwimLaneItemContextMenu:
|
|
949
|
-
onSwimLaneReorder:
|
|
950
|
-
|
|
982
|
+
maxTicks: ie,
|
|
983
|
+
ffSpeeds: te = Ze,
|
|
984
|
+
rwSpeeds: ue = Qe,
|
|
985
|
+
theme: w,
|
|
986
|
+
className: v,
|
|
987
|
+
timezone: Q,
|
|
988
|
+
swimLanes: M,
|
|
989
|
+
showSwimLanes: B,
|
|
990
|
+
onShowSwimLanesChange: oe,
|
|
991
|
+
swimLaneTransition: ge = "animated",
|
|
992
|
+
onSwimLaneItemClick: ce,
|
|
993
|
+
onSwimLaneItemHover: A,
|
|
994
|
+
onSwimLaneItemDoubleClick: p,
|
|
995
|
+
onSwimLaneItemContextMenu: g,
|
|
996
|
+
onSwimLaneReorder: L,
|
|
997
|
+
onRangeSelect: C,
|
|
998
|
+
labels: ee
|
|
951
999
|
}) => {
|
|
952
|
-
const
|
|
953
|
-
() =>
|
|
954
|
-
), [
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
}, [
|
|
958
|
-
const
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
},
|
|
962
|
-
|
|
963
|
-
const
|
|
964
|
-
if (!
|
|
965
|
-
const
|
|
966
|
-
return
|
|
967
|
-
}, [
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
if (!
|
|
971
|
-
const
|
|
972
|
-
if (!
|
|
973
|
-
const
|
|
974
|
-
if (
|
|
975
|
-
const { startMs:
|
|
976
|
-
|
|
1000
|
+
const O = () => Date.now(), j = F ? D.JulianDate.toDate(De(F)).getTime() : O() - 432e5, s = X ? D.JulianDate.toDate(De(X)).getTime() : O() + 12 * 3600 * 1e3, [V, k] = Ae(
|
|
1001
|
+
() => De(K ?? F ?? D.JulianDate.fromDate(/* @__PURE__ */ new Date()))
|
|
1002
|
+
), [t, f] = Ae((d == null ? void 0 : d.shouldAnimate) ?? !1), [b, y] = Ae((d == null ? void 0 : d.multiplier) ?? 1), [re, he] = Ae(B ?? !0);
|
|
1003
|
+
z(() => {
|
|
1004
|
+
B != null && he(B);
|
|
1005
|
+
}, [B]);
|
|
1006
|
+
const J = () => {
|
|
1007
|
+
const i = !re;
|
|
1008
|
+
he(i), oe == null || oe(i);
|
|
1009
|
+
}, E = M != null && M.length > 0, fe = x(null), [Te, ke] = Ae(0);
|
|
1010
|
+
z(() => {
|
|
1011
|
+
const i = fe.current;
|
|
1012
|
+
if (!i) return;
|
|
1013
|
+
const R = new ResizeObserver(([P]) => ke(P.borderBoxSize[0].blockSize));
|
|
1014
|
+
return R.observe(i), () => R.disconnect();
|
|
1015
|
+
}, [de]);
|
|
1016
|
+
const Fe = E && !re ? `${Te + Oe}px` : $ != null ? `${$}px` : "100%", xe = x(!1), q = x(null), pe = { ...wt, ...w };
|
|
1017
|
+
z(() => {
|
|
1018
|
+
if (!d) return;
|
|
1019
|
+
const i = () => {
|
|
1020
|
+
if (!xe.current) {
|
|
1021
|
+
const R = D.JulianDate.clone(d.currentTime);
|
|
1022
|
+
if (k(R), f(d.shouldAnimate), y(d.multiplier), q.current) {
|
|
1023
|
+
const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P, ne = D.JulianDate.toDate(R).getTime(), Ee = ne - P;
|
|
1024
|
+
Ee <= N * 0.1 ? q.current.zoomTo(ne - N * 0.1, ne + N * 0.9, ne) : Ee >= N * 0.9 && q.current.zoomTo(ne - N * 0.9, ne + N * 0.1, ne);
|
|
977
1025
|
}
|
|
978
1026
|
}
|
|
979
1027
|
};
|
|
980
|
-
return
|
|
981
|
-
|
|
1028
|
+
return d.onTick.addEventListener(i), () => {
|
|
1029
|
+
d.onTick.removeEventListener(i);
|
|
982
1030
|
};
|
|
983
|
-
}, [
|
|
984
|
-
if (
|
|
985
|
-
const
|
|
986
|
-
if (
|
|
987
|
-
const
|
|
988
|
-
if (
|
|
989
|
-
const { startMs:
|
|
990
|
-
|
|
1031
|
+
}, [d]), z(() => {
|
|
1032
|
+
if (d) return;
|
|
1033
|
+
const i = setInterval(() => {
|
|
1034
|
+
if (xe.current) return;
|
|
1035
|
+
const R = D.JulianDate.fromDate(/* @__PURE__ */ new Date());
|
|
1036
|
+
if (k(R), q.current) {
|
|
1037
|
+
const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P, ne = D.JulianDate.toDate(R).getTime(), Ee = ne - P;
|
|
1038
|
+
Ee <= N * 0.1 ? q.current.zoomTo(ne - N * 0.1, ne + N * 0.9, ne) : Ee >= N * 0.9 && q.current.zoomTo(ne - N * 0.9, ne + N * 0.1, ne);
|
|
991
1039
|
}
|
|
992
1040
|
}, 1e3);
|
|
993
|
-
return () => clearInterval(
|
|
994
|
-
}, [
|
|
1041
|
+
return () => clearInterval(i);
|
|
1042
|
+
}, [d]), z(() => {
|
|
995
1043
|
if (!Z) return;
|
|
996
|
-
const
|
|
997
|
-
if (
|
|
998
|
-
const { startMs:
|
|
999
|
-
|
|
1044
|
+
const i = De(Z);
|
|
1045
|
+
if (ye(i), q.current) {
|
|
1046
|
+
const { startMs: R, endMs: P } = q.current.getVisibleRange(), le = P - R, N = D.JulianDate.toDate(i).getTime();
|
|
1047
|
+
q.current.zoomTo(N - le / 2, N + le / 2);
|
|
1000
1048
|
}
|
|
1001
1049
|
}, [Z]);
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1004
|
-
},
|
|
1005
|
-
|
|
1006
|
-
},
|
|
1007
|
-
|
|
1008
|
-
},
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1050
|
+
const ve = (i, R = !0) => {
|
|
1051
|
+
d && (d.multiplier = i, R && (d.shouldAnimate = !0)), y(i), R && f(!0), W == null || W(i);
|
|
1052
|
+
}, ye = (i) => {
|
|
1053
|
+
k(i), d && (d.currentTime = D.JulianDate.clone(i)), _ == null || _(i);
|
|
1054
|
+
}, _e = (i) => {
|
|
1055
|
+
i && b < 0 && ve(1, !1), d && (d.shouldAnimate = i), f(i), S == null || S(i);
|
|
1056
|
+
}, je = () => {
|
|
1057
|
+
const i = te.length > 0 ? te : Ze, R = b > 1 ? b : 1, P = i.indexOf(R), le = i[P < 0 || P === i.length - 1 ? 0 : P + 1];
|
|
1058
|
+
ve(le);
|
|
1059
|
+
}, Ie = () => {
|
|
1060
|
+
const i = ue.length > 0 ? ue : Qe, R = b < 0 ? Math.abs(b) : 0, P = i.indexOf(R), le = -i[P < 0 || P === i.length - 1 ? 0 : P + 1];
|
|
1061
|
+
ve(le);
|
|
1011
1062
|
}, be = () => {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
return /* @__PURE__ */ l.jsxs(
|
|
1063
|
+
var R;
|
|
1064
|
+
const i = De(F ?? D.JulianDate.fromDate(new Date(j)));
|
|
1065
|
+
d && (d.currentTime = D.JulianDate.clone(i)), k(i), (R = q.current) == null || R.zoomTo(j, s);
|
|
1066
|
+
}, m = () => {
|
|
1067
|
+
var R;
|
|
1068
|
+
const i = De(X ?? D.JulianDate.fromDate(new Date(s)));
|
|
1069
|
+
d && (d.currentTime = D.JulianDate.clone(i)), k(i), (R = q.current) == null || R.zoomTo(j, s);
|
|
1070
|
+
}, we = () => {
|
|
1071
|
+
const i = D.JulianDate.fromDate(/* @__PURE__ */ new Date());
|
|
1072
|
+
d && (d.currentTime = D.JulianDate.clone(i)), k(i), ve(1);
|
|
1073
|
+
const R = Date.now();
|
|
1074
|
+
if (q.current) {
|
|
1075
|
+
const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P;
|
|
1076
|
+
q.current.zoomTo(R - N / 2, R + N / 2);
|
|
1077
|
+
}
|
|
1078
|
+
}, Me = Math.abs(D.JulianDate.toDate(V).getTime() - Date.now()) < 1e4;
|
|
1079
|
+
return /* @__PURE__ */ u.jsxs(
|
|
1030
1080
|
"div",
|
|
1031
1081
|
{
|
|
1032
|
-
className:
|
|
1082
|
+
className: v,
|
|
1033
1083
|
style: {
|
|
1034
1084
|
width: "100%",
|
|
1035
|
-
height:
|
|
1085
|
+
height: Fe,
|
|
1036
1086
|
overflow: "hidden",
|
|
1037
1087
|
display: "flex",
|
|
1038
1088
|
flexDirection: "column",
|
|
1039
1089
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
1040
|
-
transition:
|
|
1090
|
+
transition: ge === "animated" ? "height 0.2s ease" : void 0
|
|
1041
1091
|
},
|
|
1042
1092
|
children: [
|
|
1043
|
-
|
|
1044
|
-
|
|
1093
|
+
de && /* @__PURE__ */ u.jsx("div", { ref: fe, children: /* @__PURE__ */ u.jsx(
|
|
1094
|
+
jt,
|
|
1045
1095
|
{
|
|
1046
|
-
currentTime:
|
|
1047
|
-
isPlaying:
|
|
1048
|
-
multiplier:
|
|
1049
|
-
isLive:
|
|
1050
|
-
hasStartTime:
|
|
1051
|
-
hasEndTime:
|
|
1052
|
-
showJumpToStart:
|
|
1053
|
-
showJumpToEnd:
|
|
1054
|
-
onPlayPause:
|
|
1055
|
-
onJumpToStart:
|
|
1056
|
-
onRewind:
|
|
1057
|
-
onFastForward:
|
|
1058
|
-
onJumpToEnd:
|
|
1059
|
-
onJumpToLive:
|
|
1060
|
-
onResetSpeed: () =>
|
|
1061
|
-
onDateTimeClick:
|
|
1062
|
-
dateTimeFormat:
|
|
1063
|
-
timezone:
|
|
1064
|
-
theme:
|
|
1065
|
-
swimLanesVisible:
|
|
1066
|
-
onToggleSwimLanes:
|
|
1067
|
-
labels:
|
|
1096
|
+
currentTime: V,
|
|
1097
|
+
isPlaying: t,
|
|
1098
|
+
multiplier: b,
|
|
1099
|
+
isLive: Me,
|
|
1100
|
+
hasStartTime: F != null,
|
|
1101
|
+
hasEndTime: X != null,
|
|
1102
|
+
showJumpToStart: H,
|
|
1103
|
+
showJumpToEnd: G,
|
|
1104
|
+
onPlayPause: _e,
|
|
1105
|
+
onJumpToStart: be,
|
|
1106
|
+
onRewind: Ie,
|
|
1107
|
+
onFastForward: je,
|
|
1108
|
+
onJumpToEnd: m,
|
|
1109
|
+
onJumpToLive: we,
|
|
1110
|
+
onResetSpeed: () => ve(1),
|
|
1111
|
+
onDateTimeClick: se,
|
|
1112
|
+
dateTimeFormat: I,
|
|
1113
|
+
timezone: Q,
|
|
1114
|
+
theme: pe,
|
|
1115
|
+
swimLanesVisible: E ? re : void 0,
|
|
1116
|
+
onToggleSwimLanes: E ? J : void 0,
|
|
1117
|
+
labels: ee
|
|
1068
1118
|
}
|
|
1069
1119
|
) }),
|
|
1070
|
-
|
|
1071
|
-
|
|
1120
|
+
U !== !1 && /* @__PURE__ */ u.jsx(
|
|
1121
|
+
et,
|
|
1072
1122
|
{
|
|
1073
|
-
ref:
|
|
1074
|
-
currentTime:
|
|
1075
|
-
defaultStartMs:
|
|
1076
|
-
defaultEndMs:
|
|
1077
|
-
theme:
|
|
1078
|
-
maxTicks:
|
|
1079
|
-
timezone:
|
|
1080
|
-
|
|
1123
|
+
ref: q,
|
|
1124
|
+
currentTime: V,
|
|
1125
|
+
defaultStartMs: j,
|
|
1126
|
+
defaultEndMs: s,
|
|
1127
|
+
theme: pe,
|
|
1128
|
+
maxTicks: ie,
|
|
1129
|
+
timezone: Q,
|
|
1130
|
+
dateTimeFormat: I,
|
|
1131
|
+
months: ee == null ? void 0 : ee.months,
|
|
1132
|
+
onTimeChange: ye,
|
|
1081
1133
|
onDragStart: () => {
|
|
1082
|
-
|
|
1134
|
+
xe.current = !0;
|
|
1083
1135
|
},
|
|
1084
1136
|
onDragEnd: () => {
|
|
1085
|
-
|
|
1137
|
+
xe.current = !1;
|
|
1086
1138
|
},
|
|
1087
|
-
swimLanes:
|
|
1088
|
-
showSwimLanes:
|
|
1089
|
-
onSwimLaneItemClick:
|
|
1090
|
-
onSwimLaneItemHover:
|
|
1091
|
-
onSwimLaneItemDoubleClick:
|
|
1092
|
-
onSwimLaneItemContextMenu:
|
|
1093
|
-
onSwimLaneReorder:
|
|
1139
|
+
swimLanes: M,
|
|
1140
|
+
showSwimLanes: re,
|
|
1141
|
+
onSwimLaneItemClick: ce,
|
|
1142
|
+
onSwimLaneItemHover: A,
|
|
1143
|
+
onSwimLaneItemDoubleClick: p,
|
|
1144
|
+
onSwimLaneItemContextMenu: g,
|
|
1145
|
+
onSwimLaneReorder: L,
|
|
1146
|
+
onRangeSelect: C
|
|
1094
1147
|
}
|
|
1095
1148
|
)
|
|
1096
1149
|
]
|
|
1097
1150
|
}
|
|
1098
1151
|
);
|
|
1099
|
-
},
|
|
1100
|
-
startTime:
|
|
1101
|
-
endTime:
|
|
1102
|
-
currentTime:
|
|
1103
|
-
width:
|
|
1104
|
-
height:
|
|
1105
|
-
tickInterval:
|
|
1106
|
-
showLabels:
|
|
1107
|
-
snapToTicks:
|
|
1108
|
-
enableDrag:
|
|
1109
|
-
theme:
|
|
1110
|
-
onTimeChange:
|
|
1111
|
-
onVisibleRangeChange:
|
|
1112
|
-
onDragStart:
|
|
1113
|
-
onDragEnd:
|
|
1152
|
+
}, Ft = ({
|
|
1153
|
+
startTime: F,
|
|
1154
|
+
endTime: X,
|
|
1155
|
+
currentTime: K,
|
|
1156
|
+
width: d,
|
|
1157
|
+
height: _,
|
|
1158
|
+
tickInterval: S,
|
|
1159
|
+
showLabels: W,
|
|
1160
|
+
snapToTicks: $,
|
|
1161
|
+
enableDrag: de,
|
|
1162
|
+
theme: H,
|
|
1163
|
+
onTimeChange: G,
|
|
1164
|
+
onVisibleRangeChange: U,
|
|
1165
|
+
onDragStart: I,
|
|
1166
|
+
onDragEnd: se
|
|
1114
1167
|
}) => {
|
|
1115
|
-
const Z =
|
|
1116
|
-
() =>
|
|
1117
|
-
[
|
|
1118
|
-
),
|
|
1119
|
-
() =>
|
|
1120
|
-
[
|
|
1121
|
-
),
|
|
1122
|
-
if (!
|
|
1123
|
-
const
|
|
1124
|
-
if (!(Math.abs(
|
|
1125
|
-
let
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1168
|
+
const Z = Ne(
|
|
1169
|
+
() => Mt(F, X, S, d),
|
|
1170
|
+
[F, X, S, d]
|
|
1171
|
+
), ie = Ne(
|
|
1172
|
+
() => yt(K, F, X, d),
|
|
1173
|
+
[K, F, X, d]
|
|
1174
|
+
), te = x(null), ue = (v) => {
|
|
1175
|
+
if (!de) return;
|
|
1176
|
+
const Q = v.currentTarget.getBoundingClientRect(), M = v.clientX - Q.left, B = Math.max(0, Math.min(d, M));
|
|
1177
|
+
if (!(Math.abs(B - ie) <= 10)) {
|
|
1178
|
+
let j = B;
|
|
1179
|
+
$ && (j = Et(B, Z, 10));
|
|
1180
|
+
const s = new Date(F).getTime(), V = new Date(X).getTime();
|
|
1181
|
+
G(D.JulianDate.fromDate(new Date(s + j / d * (V - s))));
|
|
1129
1182
|
return;
|
|
1130
1183
|
}
|
|
1131
|
-
|
|
1132
|
-
const
|
|
1133
|
-
let
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
if (
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1184
|
+
I == null || I();
|
|
1185
|
+
const ge = v.clientX, ce = new Date(K).getTime(), A = new Date(F).getTime(), g = (new Date(X).getTime() - A) / d;
|
|
1186
|
+
let L = 0, C = !1;
|
|
1187
|
+
const ee = (j) => {
|
|
1188
|
+
L = j.clientX - ge, C = !0, te.current || (te.current = requestAnimationFrame(() => {
|
|
1189
|
+
if (C) {
|
|
1190
|
+
const s = ce + L * g;
|
|
1191
|
+
G(D.JulianDate.fromDate(new Date(s))), C = !1;
|
|
1139
1192
|
}
|
|
1140
|
-
|
|
1193
|
+
te.current = null;
|
|
1141
1194
|
}));
|
|
1142
|
-
},
|
|
1143
|
-
document.removeEventListener("mousemove",
|
|
1195
|
+
}, O = () => {
|
|
1196
|
+
document.removeEventListener("mousemove", ee), document.removeEventListener("mouseup", O), te.current !== null && (cancelAnimationFrame(te.current), te.current = null), se == null || se();
|
|
1144
1197
|
};
|
|
1145
|
-
document.addEventListener("mousemove",
|
|
1146
|
-
},
|
|
1147
|
-
|
|
1148
|
-
const
|
|
1149
|
-
if (Math.abs(
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1198
|
+
document.addEventListener("mousemove", ee), document.addEventListener("mouseup", O);
|
|
1199
|
+
}, w = (v) => {
|
|
1200
|
+
v.preventDefault();
|
|
1201
|
+
const Q = v.shiftKey ? v.deltaY : v.deltaX !== 0 ? v.deltaX : v.deltaY;
|
|
1202
|
+
if (Math.abs(Q) < 1) return;
|
|
1203
|
+
const M = new Date(F).getTime(), B = new Date(X).getTime(), oe = Q / d * (B - M) * 0.5;
|
|
1204
|
+
U == null || U(
|
|
1205
|
+
D.JulianDate.fromDate(new Date(M + oe)),
|
|
1206
|
+
D.JulianDate.fromDate(new Date(B + oe))
|
|
1154
1207
|
);
|
|
1155
1208
|
};
|
|
1156
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ u.jsxs(
|
|
1157
1210
|
"svg",
|
|
1158
1211
|
{
|
|
1159
1212
|
width: "100%",
|
|
1160
|
-
height:
|
|
1161
|
-
style: { backgroundColor:
|
|
1162
|
-
onMouseDown:
|
|
1163
|
-
onWheel:
|
|
1213
|
+
height: _,
|
|
1214
|
+
style: { backgroundColor: H.backgroundColor, display: "block", cursor: "default" },
|
|
1215
|
+
onMouseDown: ue,
|
|
1216
|
+
onWheel: w,
|
|
1164
1217
|
children: [
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
Z.map((
|
|
1167
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ u.jsx("rect", { width: d, height: _, fill: H.backgroundColor }),
|
|
1219
|
+
Z.map((v, Q) => /* @__PURE__ */ u.jsxs("g", { children: [
|
|
1220
|
+
/* @__PURE__ */ u.jsx(
|
|
1168
1221
|
"line",
|
|
1169
1222
|
{
|
|
1170
|
-
x1:
|
|
1171
|
-
y1:
|
|
1172
|
-
x2:
|
|
1173
|
-
y2:
|
|
1174
|
-
stroke:
|
|
1223
|
+
x1: v.position,
|
|
1224
|
+
y1: _ - (v.isMajor ? H.majorTickHeight : H.minorTickHeight),
|
|
1225
|
+
x2: v.position,
|
|
1226
|
+
y2: _,
|
|
1227
|
+
stroke: v.isMajor ? H.majorTickColor : H.tickColor,
|
|
1175
1228
|
strokeWidth: "1"
|
|
1176
1229
|
}
|
|
1177
1230
|
),
|
|
1178
|
-
|
|
1231
|
+
W && v.isMajor && v.label && /* @__PURE__ */ u.jsx(
|
|
1179
1232
|
"text",
|
|
1180
1233
|
{
|
|
1181
|
-
x:
|
|
1182
|
-
y:
|
|
1234
|
+
x: v.position,
|
|
1235
|
+
y: _ - H.majorTickHeight - 5,
|
|
1183
1236
|
textAnchor: "middle",
|
|
1184
|
-
fill:
|
|
1185
|
-
fontSize:
|
|
1237
|
+
fill: H.labelColor,
|
|
1238
|
+
fontSize: H.fontSize,
|
|
1186
1239
|
fontFamily: "monospace",
|
|
1187
|
-
children:
|
|
1240
|
+
children: v.label
|
|
1188
1241
|
}
|
|
1189
1242
|
)
|
|
1190
|
-
] },
|
|
1191
|
-
/* @__PURE__ */
|
|
1243
|
+
] }, Q)),
|
|
1244
|
+
/* @__PURE__ */ u.jsx(
|
|
1192
1245
|
"line",
|
|
1193
1246
|
{
|
|
1194
|
-
x1:
|
|
1247
|
+
x1: ie,
|
|
1195
1248
|
y1: 0,
|
|
1196
|
-
x2:
|
|
1197
|
-
y2:
|
|
1198
|
-
stroke:
|
|
1199
|
-
strokeWidth:
|
|
1249
|
+
x2: ie,
|
|
1250
|
+
y2: _,
|
|
1251
|
+
stroke: H.indicatorColor,
|
|
1252
|
+
strokeWidth: H.indicatorLineWidth,
|
|
1200
1253
|
pointerEvents: "none"
|
|
1201
1254
|
}
|
|
1202
1255
|
),
|
|
1203
|
-
|
|
1256
|
+
de && /* @__PURE__ */ u.jsx(
|
|
1204
1257
|
"rect",
|
|
1205
1258
|
{
|
|
1206
|
-
x: Math.max(0,
|
|
1259
|
+
x: Math.max(0, ie - 10),
|
|
1207
1260
|
y: 0,
|
|
1208
1261
|
width: 20,
|
|
1209
|
-
height:
|
|
1262
|
+
height: _,
|
|
1210
1263
|
fill: "transparent",
|
|
1211
1264
|
style: { cursor: "ew-resize" },
|
|
1212
1265
|
pointerEvents: "visiblePainted"
|
|
1213
1266
|
}
|
|
1214
1267
|
),
|
|
1215
|
-
/* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ u.jsx("circle", { cx: ie, cy: 5, r: 4, fill: H.indicatorColor, pointerEvents: "none" })
|
|
1216
1269
|
]
|
|
1217
1270
|
}
|
|
1218
1271
|
);
|
|
1219
1272
|
};
|
|
1220
1273
|
export {
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1274
|
+
Ot as TICK_AREA_HEIGHT,
|
|
1275
|
+
kt as Timeline,
|
|
1276
|
+
et as TimelineCanvas,
|
|
1277
|
+
jt as TimelineControls,
|
|
1278
|
+
Ft as TimelineSVG
|
|
1226
1279
|
};
|