@overdoser/react-toolkit 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +2 -0
- package/components/Timeline/GanttTimeline.js +193 -186
- package/components/Timeline/HistoryTimeline.js +172 -172
- package/components/Timeline/TraceTimeline.js +322 -297
- package/components/Timeline/TraceTimeline.module.scss.js +78 -72
- package/components/Timeline/timelineCore.d.ts +12 -2
- package/components/Timeline/timelineCore.js +103 -45
- package/index.css +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +2 -1
- package/package.json +2 -1
|
@@ -1,105 +1,111 @@
|
|
|
1
|
-
const r = "crk-scroller-kwWVy", a = "crk-inner-vJ0BK",
|
|
1
|
+
const r = "crk-scroller-kwWVy", a = "crk-inner-vJ0BK", i = "crk-gridline-pcX-9", e = "crk-nowLine-05lmp", c = "crk-cursorLine-k7KZo", s = "crk-eventLine-znElH", t = "crk-axis--LqeF", n = "crk-axisDivider-gBKss", o = "crk-axisSticky-J-rsF", k = "crk-axisUtc-ySg72", d = "crk-axisViewDate-oRqHL", w = "crk-axisViewTime-bL50a", x = "crk-axisTickLabel-9V7QB", l = "crk-axisDateLabel-QPPf7", p = "crk-axisTickMark-HGAZI", g = "crk-axisSubLabel-mmUpt", u = "crk-axisMinorMark-LmQdS", m = "crk-axisMinorMedium-yyNB-", b = "crk-axisChip-Xr9r0", h = "crk-axisChipEvent-K9r-4", L = "crk-lane-hvtL1", v = "crk-axisLine-ZRK0p", y = "crk-bar-pqjsX", T = "crk-barPending-NsYu7", M = "crk-barDot-ZtYdm", B = "crk-stem-24Ud2", D = "crk-elbow-nQxQZ", S = "crk-chip-vC8yf", R = "crk-chipArrow-pyTpt", X = "crk-chipBadge-Tz11H", C = "crk-chipOp-qkIIM", K = "crk-chipTime-IoXbi", U = "crk-drawerCustom-w5gWa", V = "crk-drawerHead-mfyc3", H = "crk-drawerHeadRow-w-lfX", E = "crk-methodBadge-lfL4x", P = "crk-statusBadge-XiUl9", Q = "crk-statusPending-Yg9At", f = "crk-statusError-G7XH8", O = "crk-drawerRoute-L-hK0", I = "crk-drawerSpacer-f6nIh", Z = "crk-drawerUrl-ajRgO", q = "crk-drawerRid-UsUb1", A = "crk-drawerXrid-JEUOj", j = "crk-drawerTiming-FCpcS", F = "crk-drawerBody-Cx5-E", J = "crk-drawerSection-Zjpm1", N = "crk-kvRow-DXfXI", Y = "crk-kvKey-MmSqV", z = "crk-kvKeyQuery-0hpds", G = "crk-kvVal-PlEQT", W = "crk-awaiting-FNO2u", _ = "crk-awaitingDot-b4OtX", $ = {
|
|
2
2
|
scroller: r,
|
|
3
3
|
inner: a,
|
|
4
|
-
gridline:
|
|
4
|
+
gridline: i,
|
|
5
5
|
nowLine: e,
|
|
6
|
-
cursorLine:
|
|
6
|
+
cursorLine: c,
|
|
7
7
|
eventLine: s,
|
|
8
8
|
axis: t,
|
|
9
9
|
axisDivider: n,
|
|
10
10
|
axisSticky: o,
|
|
11
11
|
axisUtc: k,
|
|
12
12
|
axisViewDate: d,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
axisViewTime: w,
|
|
14
|
+
axisTickLabel: x,
|
|
15
|
+
axisDateLabel: l,
|
|
15
16
|
axisTickMark: p,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
axisSubLabel: g,
|
|
18
|
+
axisMinorMark: u,
|
|
19
|
+
axisMinorMedium: m,
|
|
20
|
+
axisChip: b,
|
|
18
21
|
axisChipEvent: h,
|
|
19
|
-
lane:
|
|
22
|
+
lane: L,
|
|
20
23
|
axisLine: v,
|
|
21
|
-
bar:
|
|
22
|
-
barPending:
|
|
23
|
-
barDot:
|
|
24
|
-
stem:
|
|
24
|
+
bar: y,
|
|
25
|
+
barPending: T,
|
|
26
|
+
barDot: M,
|
|
27
|
+
stem: B,
|
|
25
28
|
elbow: D,
|
|
26
|
-
chip:
|
|
29
|
+
chip: S,
|
|
27
30
|
chipArrow: R,
|
|
28
|
-
chipBadge:
|
|
29
|
-
chipOp:
|
|
30
|
-
chipTime:
|
|
31
|
-
drawerCustom:
|
|
32
|
-
drawerHead:
|
|
31
|
+
chipBadge: X,
|
|
32
|
+
chipOp: C,
|
|
33
|
+
chipTime: K,
|
|
34
|
+
drawerCustom: U,
|
|
35
|
+
drawerHead: V,
|
|
33
36
|
drawerHeadRow: H,
|
|
34
|
-
methodBadge:
|
|
35
|
-
statusBadge:
|
|
36
|
-
statusPending:
|
|
37
|
-
statusError:
|
|
38
|
-
drawerRoute:
|
|
39
|
-
drawerSpacer:
|
|
40
|
-
drawerUrl:
|
|
41
|
-
drawerRid:
|
|
42
|
-
drawerXrid:
|
|
43
|
-
drawerTiming:
|
|
44
|
-
drawerBody:
|
|
45
|
-
drawerSection:
|
|
46
|
-
kvRow:
|
|
47
|
-
kvKey:
|
|
48
|
-
kvKeyQuery:
|
|
49
|
-
kvVal:
|
|
50
|
-
awaiting:
|
|
51
|
-
awaitingDot:
|
|
37
|
+
methodBadge: E,
|
|
38
|
+
statusBadge: P,
|
|
39
|
+
statusPending: Q,
|
|
40
|
+
statusError: f,
|
|
41
|
+
drawerRoute: O,
|
|
42
|
+
drawerSpacer: I,
|
|
43
|
+
drawerUrl: Z,
|
|
44
|
+
drawerRid: q,
|
|
45
|
+
drawerXrid: A,
|
|
46
|
+
drawerTiming: j,
|
|
47
|
+
drawerBody: F,
|
|
48
|
+
drawerSection: J,
|
|
49
|
+
kvRow: N,
|
|
50
|
+
kvKey: Y,
|
|
51
|
+
kvKeyQuery: z,
|
|
52
|
+
kvVal: G,
|
|
53
|
+
awaiting: W,
|
|
54
|
+
awaitingDot: _
|
|
52
55
|
};
|
|
53
56
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
W as awaiting,
|
|
58
|
+
_ as awaitingDot,
|
|
56
59
|
t as axis,
|
|
57
|
-
|
|
60
|
+
b as axisChip,
|
|
58
61
|
h as axisChipEvent,
|
|
59
|
-
|
|
62
|
+
l as axisDateLabel,
|
|
60
63
|
n as axisDivider,
|
|
61
64
|
v as axisLine,
|
|
62
|
-
|
|
65
|
+
u as axisMinorMark,
|
|
66
|
+
m as axisMinorMedium,
|
|
63
67
|
o as axisSticky,
|
|
64
|
-
|
|
68
|
+
g as axisSubLabel,
|
|
69
|
+
x as axisTickLabel,
|
|
65
70
|
p as axisTickMark,
|
|
66
71
|
k as axisUtc,
|
|
67
72
|
d as axisViewDate,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
w as axisViewTime,
|
|
74
|
+
y as bar,
|
|
75
|
+
M as barDot,
|
|
76
|
+
T as barPending,
|
|
77
|
+
S as chip,
|
|
72
78
|
R as chipArrow,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
X as chipBadge,
|
|
80
|
+
C as chipOp,
|
|
81
|
+
K as chipTime,
|
|
82
|
+
c as cursorLine,
|
|
83
|
+
$ as default,
|
|
84
|
+
F as drawerBody,
|
|
85
|
+
U as drawerCustom,
|
|
86
|
+
V as drawerHead,
|
|
81
87
|
H as drawerHeadRow,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
q as drawerRid,
|
|
89
|
+
O as drawerRoute,
|
|
90
|
+
J as drawerSection,
|
|
91
|
+
I as drawerSpacer,
|
|
92
|
+
j as drawerTiming,
|
|
93
|
+
Z as drawerUrl,
|
|
94
|
+
A as drawerXrid,
|
|
89
95
|
D as elbow,
|
|
90
96
|
s as eventLine,
|
|
91
|
-
|
|
97
|
+
i as gridline,
|
|
92
98
|
a as inner,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
Y as kvKey,
|
|
100
|
+
z as kvKeyQuery,
|
|
101
|
+
N as kvRow,
|
|
102
|
+
G as kvVal,
|
|
103
|
+
L as lane,
|
|
104
|
+
E as methodBadge,
|
|
99
105
|
e as nowLine,
|
|
100
106
|
r as scroller,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
P as statusBadge,
|
|
108
|
+
f as statusError,
|
|
109
|
+
Q as statusPending,
|
|
110
|
+
B as stem
|
|
105
111
|
};
|
|
@@ -25,8 +25,17 @@ export declare function fmtDateISO(t: number): string;
|
|
|
25
25
|
export declare function fmtISO(t: number, ms?: boolean): string;
|
|
26
26
|
/** Adaptive duration: `412ms`, `3.1s`, `4m 12s`, `3h 20m`, `2.5d`, `1.2y`. */
|
|
27
27
|
export declare function fmtDur(ms: number | null | undefined): string;
|
|
28
|
-
/** Tick step table spanning 1
|
|
28
|
+
/** Tick step table spanning 1 millisecond → 500 years. */
|
|
29
29
|
export declare const TICK_STEPS: number[];
|
|
30
|
+
/**
|
|
31
|
+
* Subdivision for a tick step: how many equal `parts` it splits into for minor
|
|
32
|
+
* marks, and which part index gets a medium mark (`0` = none). Steps outside
|
|
33
|
+
* `TICK_STEPS` fall back to a plain quarter split.
|
|
34
|
+
*/
|
|
35
|
+
export declare function tickSubdiv(step: number): {
|
|
36
|
+
parts: number;
|
|
37
|
+
medium: number;
|
|
38
|
+
};
|
|
30
39
|
export interface Tick {
|
|
31
40
|
t: number;
|
|
32
41
|
label: string;
|
|
@@ -38,7 +47,8 @@ export interface TickResult {
|
|
|
38
47
|
/**
|
|
39
48
|
* Pick a step from the table so ticks are at least `minPx` apart across
|
|
40
49
|
* `widthPx`, and enumerate them. Labels use the local clock below day
|
|
41
|
-
* granularity and `Jul 27`-style
|
|
50
|
+
* granularity (with milliseconds below second granularity) and `Jul 27`-style
|
|
51
|
+
* dates above it.
|
|
42
52
|
*/
|
|
43
53
|
export declare function ticks(t0: number, t1: number, widthPx: number, minPx?: number): TickResult;
|
|
44
54
|
export interface HighlightPart {
|
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
const O = 1e3,
|
|
2
|
-
function
|
|
1
|
+
const O = 1e3, U = 6e4, N = 36e5, S = 864e5, c = (t) => String(t).padStart(2, "0"), A = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
2
|
+
function u(t, e) {
|
|
3
3
|
const n = new Date(t);
|
|
4
|
-
return c(n.getHours()) + ":" + c(n.getMinutes()) + ":" + c(n.getSeconds());
|
|
4
|
+
return c(n.getHours()) + ":" + c(n.getMinutes()) + ":" + c(n.getSeconds()) + (e ? "." + String(n.getMilliseconds()).padStart(3, "0") : "");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function s(t) {
|
|
7
7
|
const e = new Date(t);
|
|
8
|
-
return
|
|
8
|
+
return A[e.getMonth()] + " " + e.getDate();
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function C(t) {
|
|
11
11
|
const e = new Date(t).getFullYear(), n = e !== (/* @__PURE__ */ new Date()).getFullYear();
|
|
12
|
-
return n && Date.now() - t > 2 * 365 * 864e5 ?
|
|
12
|
+
return n && Date.now() - t > 2 * 365 * 864e5 ? s(t) + " " + e : s(t) + (n ? " " + e : "") + " · " + u(t);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Y(t, e) {
|
|
15
15
|
const n = new Date(t);
|
|
16
16
|
return c(n.getUTCHours()) + ":" + c(n.getUTCMinutes()) + ":" + c(n.getUTCSeconds()) + (e ? "." + String(n.getUTCMilliseconds()).padStart(3, "0") : "");
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function h(t) {
|
|
19
19
|
const e = new Date(t);
|
|
20
20
|
return e.getUTCFullYear() + "-" + c(e.getUTCMonth() + 1) + "-" + c(e.getUTCDate());
|
|
21
21
|
}
|
|
22
22
|
function M(t, e) {
|
|
23
|
-
return
|
|
23
|
+
return h(t) + "T" + Y(t, e) + "Z";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function d(t) {
|
|
26
26
|
return t == null ? "" : t < 1e3 ? Math.round(t) + "ms" : t < 6e4 ? (t / 1e3).toFixed(t < 10 * 1e3 ? 1 : 0) + "s" : t < 36e5 ? Math.floor(t / 6e4) + "m " + Math.round(t % 6e4 / 1e3) + "s" : t < 2 * 864e5 ? Math.floor(t / 36e5) + "h " + Math.round(t % 36e5 / 6e4) + "m" : t < 365 * 864e5 ? (t / 864e5).toFixed(1) + "d" : (t / (365.25 * 864e5)).toFixed(t < 3650 * 864e5 ? 1 : 0) + "y";
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const l = [
|
|
29
|
+
1,
|
|
30
|
+
2,
|
|
31
|
+
5,
|
|
32
|
+
10,
|
|
33
|
+
25,
|
|
34
|
+
50,
|
|
35
|
+
100,
|
|
36
|
+
250,
|
|
37
|
+
500,
|
|
29
38
|
1e3,
|
|
30
39
|
2 * 1e3,
|
|
31
40
|
5 * 1e3,
|
|
@@ -59,30 +68,78 @@ const s = [
|
|
|
59
68
|
36525 * 864e5,
|
|
60
69
|
91311 * 864e5,
|
|
61
70
|
182625 * 864e5
|
|
62
|
-
]
|
|
63
|
-
|
|
71
|
+
], E = /* @__PURE__ */ new Map([
|
|
72
|
+
[1, [0, 0]],
|
|
73
|
+
[2, [2, 0]],
|
|
74
|
+
[5, [5, 0]],
|
|
75
|
+
[10, [10, 5]],
|
|
76
|
+
[25, [5, 0]],
|
|
77
|
+
[50, [10, 5]],
|
|
78
|
+
[100, [10, 5]],
|
|
79
|
+
[250, [5, 0]],
|
|
80
|
+
[500, [10, 5]],
|
|
81
|
+
[1e3, [10, 5]],
|
|
82
|
+
[2 * 1e3, [4, 2]],
|
|
83
|
+
[5 * 1e3, [5, 0]],
|
|
84
|
+
[10 * 1e3, [10, 5]],
|
|
85
|
+
[15 * 1e3, [3, 0]],
|
|
86
|
+
[30 * 1e3, [6, 3]],
|
|
87
|
+
[6e4, [6, 3]],
|
|
88
|
+
[2 * 6e4, [4, 2]],
|
|
89
|
+
[5 * 6e4, [5, 0]],
|
|
90
|
+
[10 * 6e4, [10, 5]],
|
|
91
|
+
[15 * 6e4, [3, 0]],
|
|
92
|
+
[30 * 6e4, [6, 3]],
|
|
93
|
+
[36e5, [6, 3]],
|
|
94
|
+
[2 * 36e5, [4, 2]],
|
|
95
|
+
[3 * 36e5, [3, 0]],
|
|
96
|
+
[6 * 36e5, [6, 3]],
|
|
97
|
+
[12 * 36e5, [4, 2]],
|
|
98
|
+
[864e5, [4, 2]],
|
|
99
|
+
[2 * 864e5, [4, 2]],
|
|
100
|
+
[7 * 864e5, [7, 0]],
|
|
101
|
+
[14 * 864e5, [14, 7]],
|
|
102
|
+
[30 * 864e5, [6, 3]],
|
|
103
|
+
[90 * 864e5, [3, 0]],
|
|
104
|
+
[180 * 864e5, [6, 3]],
|
|
105
|
+
[365 * 864e5, [4, 2]],
|
|
106
|
+
[730 * 864e5, [4, 2]],
|
|
107
|
+
[1825 * 864e5, [5, 0]],
|
|
108
|
+
[3650 * 864e5, [10, 5]],
|
|
109
|
+
[9131 * 864e5, [5, 0]],
|
|
110
|
+
[18262 * 864e5, [10, 5]],
|
|
111
|
+
[36525 * 864e5, [10, 5]],
|
|
112
|
+
[91311 * 864e5, [5, 0]],
|
|
113
|
+
[182625 * 864e5, [5, 0]]
|
|
114
|
+
]);
|
|
115
|
+
function g(t) {
|
|
116
|
+
const e = E.get(t) || [4, 0];
|
|
117
|
+
return { parts: e[0], medium: e[1] };
|
|
118
|
+
}
|
|
119
|
+
function T(t, e, n, a) {
|
|
64
120
|
a = a || 88;
|
|
65
|
-
const
|
|
66
|
-
let
|
|
67
|
-
for (;
|
|
68
|
-
|
|
121
|
+
const D = Math.max(1, e - t), r = l.find((f) => f / D * n >= a) || l[l.length - 1], o = [];
|
|
122
|
+
let i = Math.ceil(t / r) * r;
|
|
123
|
+
for (; i <= e; i += r)
|
|
124
|
+
o.push({ t: i, label: r >= 864e5 ? s(i) : u(i, r < 1e3) });
|
|
125
|
+
return { step: r, list: o };
|
|
69
126
|
}
|
|
70
|
-
function
|
|
127
|
+
function I(t, e) {
|
|
71
128
|
const n = String(t ?? "");
|
|
72
129
|
if (e = (e || "").trim(), !e) return [{ t: n, hit: !1 }];
|
|
73
|
-
const a = e.toLowerCase(),
|
|
130
|
+
const a = e.toLowerCase(), D = n.toLowerCase(), r = [];
|
|
74
131
|
let o = 0;
|
|
75
132
|
for (; ; ) {
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
o < n.length &&
|
|
133
|
+
const i = D.indexOf(a, o);
|
|
134
|
+
if (i < 0) {
|
|
135
|
+
o < n.length && r.push({ t: n.slice(o), hit: !1 });
|
|
79
136
|
break;
|
|
80
137
|
}
|
|
81
|
-
|
|
138
|
+
i > o && r.push({ t: n.slice(o, i), hit: !1 }), r.push({ t: n.slice(i, i + e.length), hit: !0 }), o = i + e.length;
|
|
82
139
|
}
|
|
83
|
-
return
|
|
140
|
+
return r.length ? r : [{ t: n, hit: !1 }];
|
|
84
141
|
}
|
|
85
|
-
function
|
|
142
|
+
function k(t, e) {
|
|
86
143
|
if (e = (e || "").trim(), !e) return !0;
|
|
87
144
|
let n;
|
|
88
145
|
try {
|
|
@@ -92,7 +149,7 @@ function Y(t, e) {
|
|
|
92
149
|
}
|
|
93
150
|
return e.toLowerCase().split(/\s+/).filter(Boolean).every((a) => n.includes(a));
|
|
94
151
|
}
|
|
95
|
-
const
|
|
152
|
+
const H = [
|
|
96
153
|
"var(--crk-timeline-1, #0e7568)",
|
|
97
154
|
"var(--crk-timeline-2, #4c5bd4)",
|
|
98
155
|
"var(--crk-timeline-3, #c05f2c)",
|
|
@@ -100,10 +157,10 @@ const k = [
|
|
|
100
157
|
"var(--crk-timeline-5, #3e6b8f)",
|
|
101
158
|
"var(--crk-timeline-6, #b03a48)"
|
|
102
159
|
];
|
|
103
|
-
function
|
|
160
|
+
function R(t, e) {
|
|
104
161
|
return `color-mix(in srgb, ${t} ${e}%, white)`;
|
|
105
162
|
}
|
|
106
|
-
const
|
|
163
|
+
const m = {
|
|
107
164
|
body: "var(--crk-timeline-body, #3b352f)",
|
|
108
165
|
stem: "var(--crk-timeline-stem, #c9c1b5)",
|
|
109
166
|
stemHot: "var(--crk-timeline-stem-hot, #8a8175)",
|
|
@@ -114,22 +171,23 @@ const I = {
|
|
|
114
171
|
selectedRing: "var(--crk-timeline-selected-ring, #b8ddd6)"
|
|
115
172
|
};
|
|
116
173
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
174
|
+
S as DAY,
|
|
175
|
+
N as HOUR,
|
|
176
|
+
U as MINUTE,
|
|
120
177
|
O as SECOND,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
178
|
+
l as TICK_STEPS,
|
|
179
|
+
H as TIMELINE_PALETTE_VARS,
|
|
180
|
+
m as TL_COLORS,
|
|
181
|
+
k as eventMatches,
|
|
182
|
+
u as fmtClock,
|
|
183
|
+
Y as fmtClockUTC,
|
|
184
|
+
s as fmtDate,
|
|
185
|
+
h as fmtDateISO,
|
|
186
|
+
C as fmtDateTime,
|
|
187
|
+
d as fmtDur,
|
|
131
188
|
M as fmtISO,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
189
|
+
I as highlightParts,
|
|
190
|
+
g as tickSubdiv,
|
|
191
|
+
T as ticks,
|
|
192
|
+
R as tint
|
|
135
193
|
};
|