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