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