@pihanga2/shadcn 0.2.23 → 0.2.25
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/cards/chart/chart.types.d.ts +21 -3
- package/cards/slider/slider.component.js +47 -37
- package/cards/slider/slider.component.js.map +1 -1
- package/cards/slider/slider.types.d.ts +15 -7
- package/cards/slider/slider.types.js.map +1 -1
- package/cards/swimlane/index.js +7 -7
- package/cards/swimlane/swimlane.component.js +280 -230
- package/cards/swimlane/swimlane.component.js.map +1 -1
- package/cards/swimlane/swimlane.css +1 -1
- package/cards/swimlane/swimlane.model.d.ts +22 -2
- package/cards/swimlane/swimlane.model.js +83 -51
- package/cards/swimlane/swimlane.model.js.map +1 -1
- package/cards/swimlane/swimlane.types.d.ts +124 -6
- package/cards/swimlane/swimlane.types.js.map +1 -1
- package/cards.schema.json +193 -14
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "./swimlane.types.js";
|
|
2
|
-
import { describeSwimlaneTarget as e, formatTs as t, projectPending as n, relatedCallIds as r, rowTouches as i } from "./swimlane.model.js";
|
|
2
|
+
import { describeSwimlaneTarget as e, formatTs as t, projectPending as n, relatedCallIds as r, rowTouches as i, stepKeyOf as a, stepRows as o } from "./swimlane.model.js";
|
|
3
3
|
import './swimlane.css';/* empty css */
|
|
4
|
-
import { memo as
|
|
5
|
-
import
|
|
6
|
-
import { Fragment as
|
|
4
|
+
import { memo as s, useEffect as c, useId as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
5
|
+
import m from "clsx";
|
|
6
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
7
7
|
//#region src/cards/swimlane/swimlane.component.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
n.forEach((n,
|
|
11
|
-
let
|
|
8
|
+
var v = (e, t) => e.gutter + t * e.laneW + e.laneW / 2;
|
|
9
|
+
function y(e, t, n, r, i, a, o, s = null, c = {}, l = {}) {
|
|
10
|
+
n.forEach((n, u) => {
|
|
11
|
+
let d = v(t, u);
|
|
12
12
|
[[
|
|
13
13
|
r,
|
|
14
14
|
0,
|
|
@@ -17,45 +17,49 @@ function _(e, t, n, r, i, a, o, s = null) {
|
|
|
17
17
|
i,
|
|
18
18
|
t.mid,
|
|
19
19
|
t.rowH
|
|
20
|
-
]].forEach(([t, o,
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
className: `swl-ll swl-ll-${
|
|
24
|
-
x1:
|
|
25
|
-
x2:
|
|
20
|
+
]].forEach(([t, o, u], f) => {
|
|
21
|
+
let p = t[n];
|
|
22
|
+
p && (e.visuals.push(/* @__PURE__ */ g("line", {
|
|
23
|
+
className: `swl-ll swl-ll-${p.state}`,
|
|
24
|
+
x1: d,
|
|
25
|
+
x2: d,
|
|
26
26
|
y1: o,
|
|
27
|
-
y2:
|
|
28
|
-
}, `ll-${n}-${
|
|
29
|
-
let
|
|
30
|
-
e.visuals.push(/* @__PURE__ */
|
|
31
|
-
className:
|
|
32
|
-
children: [/* @__PURE__ */
|
|
33
|
-
x:
|
|
27
|
+
y2: u
|
|
28
|
+
}, `ll-${n}-${f}`)), p.acts.forEach((t, p) => {
|
|
29
|
+
let h = d - 5 + p * 5, v = f === 1 && !r[n]?.acts.includes(t), y = f === 0 && !i[n]?.acts.includes(t), b = `M${h},${o} V${u} M${h + 10},${o} V${u}` + (v ? ` M${h},${o} H${h + 10}` : "") + (y ? ` M${h},${u} H${h + 10}` : ""), x = l[n];
|
|
30
|
+
e.visuals.push(/* @__PURE__ */ _("g", {
|
|
31
|
+
className: m("swl-act", c[n], a === t ? "swl-hl" : s === t && "swl-hl-proc"),
|
|
32
|
+
children: [/* @__PURE__ */ g("rect", {
|
|
33
|
+
x: h,
|
|
34
34
|
y: o,
|
|
35
35
|
width: 10,
|
|
36
|
-
height:
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
height: u - o,
|
|
37
|
+
style: x
|
|
38
|
+
}), /* @__PURE__ */ g("path", {
|
|
39
|
+
d: b,
|
|
40
|
+
style: x
|
|
41
|
+
})]
|
|
42
|
+
}, `a-${t}-${f}`)), e.hits.push(/* @__PURE__ */ g("rect", {
|
|
39
43
|
className: "swl-hit",
|
|
40
|
-
x:
|
|
44
|
+
x: h - 8,
|
|
41
45
|
y: o,
|
|
42
46
|
width: 26,
|
|
43
|
-
height:
|
|
47
|
+
height: u - o,
|
|
44
48
|
"data-kind": "activity",
|
|
45
49
|
"data-id": t,
|
|
46
50
|
"data-lane": n
|
|
47
|
-
}, `ha-${t}-${
|
|
51
|
+
}, `ha-${t}-${f}`));
|
|
48
52
|
}));
|
|
49
|
-
}), !r[n] && i[n] && e.visuals.push(/* @__PURE__ */
|
|
53
|
+
}), !r[n] && i[n] && e.visuals.push(/* @__PURE__ */ g("rect", {
|
|
50
54
|
className: "swl-lane-head",
|
|
51
|
-
x:
|
|
55
|
+
x: d - 16,
|
|
52
56
|
y: t.mid - 5,
|
|
53
57
|
width: 32,
|
|
54
58
|
height: 10,
|
|
55
59
|
rx: 2
|
|
56
|
-
}, `h-${n}`), /* @__PURE__ */
|
|
60
|
+
}, `h-${n}`), /* @__PURE__ */ _("text", {
|
|
57
61
|
className: "swl-lbl-muted",
|
|
58
|
-
x:
|
|
62
|
+
x: d + 20,
|
|
59
63
|
y: t.mid + 3,
|
|
60
64
|
children: [
|
|
61
65
|
"+ ",
|
|
@@ -65,26 +69,26 @@ function _(e, t, n, r, i, a, o, s = null) {
|
|
|
65
69
|
}, `ht-${n}`));
|
|
66
70
|
});
|
|
67
71
|
}
|
|
68
|
-
function
|
|
72
|
+
function b(e, t, n, r) {
|
|
69
73
|
let i = n(r.from), a = n(r.to);
|
|
70
74
|
if (i < 0 || a < 0) return;
|
|
71
|
-
let o =
|
|
75
|
+
let o = v(t, i), s = v(t, a), c = m("swl-ar", r.cls, r.hl ? "swl-hl" : r.rel && "swl-hl-rel"), l = `url(#${t.mk}-${r.marker})`, u = {
|
|
72
76
|
"data-kind": r.kind,
|
|
73
77
|
"data-id": r.hitId,
|
|
74
78
|
"data-row": r.rowId
|
|
75
79
|
};
|
|
76
80
|
if (r.from === r.to) {
|
|
77
81
|
let n = `M${o + 6},${t.mid - 9} h26 v16 h-20`;
|
|
78
|
-
e.visuals.push(/* @__PURE__ */
|
|
82
|
+
e.visuals.push(/* @__PURE__ */ g("path", {
|
|
79
83
|
className: c,
|
|
80
84
|
d: n,
|
|
81
85
|
markerEnd: l
|
|
82
|
-
}, "ar"), /* @__PURE__ */
|
|
86
|
+
}, "ar"), /* @__PURE__ */ g("text", {
|
|
83
87
|
className: "swl-lbl",
|
|
84
88
|
x: o + 38,
|
|
85
89
|
y: t.mid + 3,
|
|
86
90
|
children: r.label
|
|
87
|
-
}, "lb")), e.hits.push(/* @__PURE__ */
|
|
91
|
+
}, "lb")), e.hits.push(/* @__PURE__ */ g("path", {
|
|
88
92
|
className: "swl-hit",
|
|
89
93
|
d: n,
|
|
90
94
|
strokeWidth: 14,
|
|
@@ -93,23 +97,23 @@ function v(e, t, n, r) {
|
|
|
93
97
|
}, "hit"));
|
|
94
98
|
return;
|
|
95
99
|
}
|
|
96
|
-
let d = Math.sign(s - o),
|
|
97
|
-
e.visuals.push(/* @__PURE__ */
|
|
100
|
+
let d = Math.sign(s - o), f = o + d * 6, p = s - d * 6;
|
|
101
|
+
e.visuals.push(/* @__PURE__ */ g("line", {
|
|
98
102
|
className: c,
|
|
99
|
-
x1:
|
|
100
|
-
x2:
|
|
103
|
+
x1: f,
|
|
104
|
+
x2: p,
|
|
101
105
|
y1: t.mid,
|
|
102
106
|
y2: t.mid,
|
|
103
107
|
markerEnd: l
|
|
104
|
-
}, "ar"), /* @__PURE__ */
|
|
108
|
+
}, "ar"), /* @__PURE__ */ g("text", {
|
|
105
109
|
className: "swl-lbl",
|
|
106
|
-
x: Math.min(
|
|
110
|
+
x: Math.min(f, p) + 8,
|
|
107
111
|
y: t.mid - 5,
|
|
108
112
|
children: r.label
|
|
109
|
-
}, "lb")), e.hits.push(/* @__PURE__ */
|
|
113
|
+
}, "lb")), e.hits.push(/* @__PURE__ */ g("line", {
|
|
110
114
|
className: "swl-hit",
|
|
111
|
-
x1:
|
|
112
|
-
x2:
|
|
115
|
+
x1: f,
|
|
116
|
+
x2: p,
|
|
113
117
|
y1: t.mid,
|
|
114
118
|
y2: t.mid,
|
|
115
119
|
strokeWidth: 16,
|
|
@@ -117,164 +121,179 @@ function v(e, t, n, r) {
|
|
|
117
121
|
...u
|
|
118
122
|
}, "hit"));
|
|
119
123
|
}
|
|
120
|
-
var
|
|
124
|
+
var x = {
|
|
121
125
|
sync: ["swl-ar-sync", "sync"],
|
|
122
126
|
async: ["swl-ar-async", "async"],
|
|
123
127
|
event: ["swl-ar-event", "event"]
|
|
124
|
-
},
|
|
125
|
-
let
|
|
128
|
+
}, S = s(function({ row: e, g: t, laneOrder: n, laneLabels: r, laneActivityClassName: i, laneActivityStyle: o, width: s, hl: c, rel: l, proc: u, fmtTs: d, grouped: f, stepHl: p }) {
|
|
129
|
+
let h = {
|
|
126
130
|
visuals: [],
|
|
127
131
|
hits: []
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
let
|
|
131
|
-
switch (
|
|
132
|
+
}, S = (e) => n.indexOf(e);
|
|
133
|
+
y(h, t, n, e.pre, e.post, c, r, u, i, o);
|
|
134
|
+
let C = e.event;
|
|
135
|
+
switch (C.type) {
|
|
132
136
|
case "call": {
|
|
133
|
-
let [
|
|
134
|
-
|
|
135
|
-
from:
|
|
136
|
-
to:
|
|
137
|
-
cls:
|
|
137
|
+
let [n, r] = x[C.kind];
|
|
138
|
+
b(h, t, S, {
|
|
139
|
+
from: C.from,
|
|
140
|
+
to: C.to,
|
|
141
|
+
cls: n,
|
|
138
142
|
marker: r,
|
|
139
|
-
label:
|
|
140
|
-
hitId:
|
|
143
|
+
label: C.label,
|
|
144
|
+
hitId: C.id,
|
|
141
145
|
kind: "transition",
|
|
142
146
|
rowId: e.id,
|
|
143
|
-
hl:
|
|
144
|
-
rel:
|
|
147
|
+
hl: c === C.id,
|
|
148
|
+
rel: l
|
|
145
149
|
});
|
|
146
150
|
break;
|
|
147
151
|
}
|
|
148
152
|
case "reply":
|
|
149
|
-
e.route &&
|
|
153
|
+
e.route && b(h, t, S, {
|
|
150
154
|
from: e.route.to,
|
|
151
155
|
to: e.route.from,
|
|
152
|
-
cls:
|
|
153
|
-
marker:
|
|
154
|
-
label:
|
|
155
|
-
hitId:
|
|
156
|
+
cls: C.ok ? "swl-ar-reply" : "swl-ar-error",
|
|
157
|
+
marker: C.ok ? "reply" : "error",
|
|
158
|
+
label: C.label,
|
|
159
|
+
hitId: C.id,
|
|
156
160
|
kind: "transition",
|
|
157
161
|
rowId: e.id,
|
|
158
|
-
hl:
|
|
159
|
-
rel:
|
|
162
|
+
hl: c === C.id,
|
|
163
|
+
rel: l
|
|
160
164
|
});
|
|
161
165
|
break;
|
|
162
166
|
case "done":
|
|
163
|
-
e.route &&
|
|
167
|
+
e.route && h.visuals.push(/* @__PURE__ */ _("text", {
|
|
164
168
|
className: "swl-lbl-muted",
|
|
165
|
-
x:
|
|
166
|
-
y:
|
|
169
|
+
x: v(t, S(e.route.to)) + 14,
|
|
170
|
+
y: t.mid + 3,
|
|
167
171
|
children: ["✓ processed ", e.route.label]
|
|
168
172
|
}, "dn"));
|
|
169
173
|
break;
|
|
170
174
|
case "state": {
|
|
171
|
-
let
|
|
172
|
-
|
|
173
|
-
cx:
|
|
174
|
-
cy:
|
|
175
|
+
let n = v(t, S(C.lane));
|
|
176
|
+
h.visuals.push(/* @__PURE__ */ g("circle", {
|
|
177
|
+
cx: n,
|
|
178
|
+
cy: t.mid,
|
|
175
179
|
r: 5,
|
|
176
|
-
className: `swl-dot-${
|
|
177
|
-
}, "st"), /* @__PURE__ */
|
|
180
|
+
className: `swl-dot-${C.state}`
|
|
181
|
+
}, "st")), (C.showLabel ?? !0) && h.visuals.push(/* @__PURE__ */ _("text", {
|
|
178
182
|
className: "swl-lbl-muted",
|
|
179
|
-
x:
|
|
180
|
-
y:
|
|
181
|
-
children: ["→ ",
|
|
182
|
-
}, "stl")),
|
|
183
|
+
x: n + 10,
|
|
184
|
+
y: t.mid + 3,
|
|
185
|
+
children: ["→ ", C.state]
|
|
186
|
+
}, "stl")), h.hits.push(/* @__PURE__ */ g("circle", {
|
|
183
187
|
className: "swl-hit",
|
|
184
|
-
cx:
|
|
185
|
-
cy:
|
|
188
|
+
cx: n,
|
|
189
|
+
cy: t.mid,
|
|
186
190
|
r: 12,
|
|
187
191
|
"data-kind": "state",
|
|
188
192
|
"data-id": `state-${e.id}`,
|
|
189
|
-
"data-lane":
|
|
193
|
+
"data-lane": C.lane,
|
|
190
194
|
"data-row": e.id
|
|
191
195
|
}, "sth"));
|
|
192
196
|
break;
|
|
193
197
|
}
|
|
194
198
|
}
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
className:
|
|
197
|
-
width:
|
|
198
|
-
height:
|
|
199
|
+
return /* @__PURE__ */ _("svg", {
|
|
200
|
+
className: m("swl-row", e.fulfilled && "swl-arrived", f && "swl-grouped", p && "swl-hl-step"),
|
|
201
|
+
width: s,
|
|
202
|
+
height: t.rowH,
|
|
199
203
|
"data-row": e.id,
|
|
200
204
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
205
|
+
f ? /* @__PURE__ */ g("line", {
|
|
206
|
+
className: "swl-ts-tie",
|
|
207
|
+
x1: 6,
|
|
208
|
+
x2: 6,
|
|
209
|
+
y1: 0,
|
|
210
|
+
y2: t.rowH
|
|
211
|
+
}) : /* @__PURE__ */ g("text", {
|
|
202
212
|
className: "swl-ts",
|
|
203
213
|
x: 0,
|
|
204
|
-
y:
|
|
205
|
-
children:
|
|
214
|
+
y: t.mid + 3,
|
|
215
|
+
children: d(C.ts)
|
|
206
216
|
}),
|
|
207
|
-
e.fulfilled &&
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
217
|
+
e.fulfilled && (() => {
|
|
218
|
+
let e = C.type === "reply" && C.ok === !1;
|
|
219
|
+
return /* @__PURE__ */ _("text", {
|
|
220
|
+
className: m("swl-ok", e && "swl-ok-error"),
|
|
221
|
+
x: t.gutter - 16,
|
|
222
|
+
y: t.mid + 4,
|
|
223
|
+
children: [/* @__PURE__ */ g("title", { children: e ? "replaced an outstanding message (error)" : "replaced an outstanding message" }), e ? "✗" : "✓"]
|
|
224
|
+
});
|
|
225
|
+
})(),
|
|
226
|
+
h.visuals,
|
|
227
|
+
/* @__PURE__ */ g("rect", {
|
|
228
|
+
className: "swl-hit",
|
|
229
|
+
x: 0,
|
|
230
|
+
y: 0,
|
|
231
|
+
width: t.gutter - 2,
|
|
232
|
+
height: t.rowH,
|
|
233
|
+
"data-kind": "step",
|
|
234
|
+
"data-id": a(e),
|
|
235
|
+
"data-row": e.id
|
|
212
236
|
}),
|
|
213
|
-
|
|
214
|
-
l.hits
|
|
237
|
+
h.hits
|
|
215
238
|
]
|
|
216
239
|
});
|
|
217
|
-
}),
|
|
218
|
-
let
|
|
240
|
+
}), C = (e) => `${(e / 1e3).toFixed(1)}s`, w = s(function({ row: e, g: t, laneOrder: n, laneLabels: r, laneActivityClassName: i, laneActivityStyle: a, width: o, hl: s, rel: c, proc: l, now: u, formatWait: d = C }) {
|
|
241
|
+
let f = {
|
|
219
242
|
visuals: [],
|
|
220
243
|
hits: []
|
|
221
|
-
},
|
|
222
|
-
return
|
|
223
|
-
from:
|
|
224
|
-
to:
|
|
225
|
-
cls:
|
|
244
|
+
}, p = e.pending, h = u - p.since, g = p.timeoutMs != null && h > p.timeoutMs;
|
|
245
|
+
return y(f, t, n, e.pre, e.post, s, r, l, i, a), b(f, t, (e) => n.indexOf(e), {
|
|
246
|
+
from: p.from,
|
|
247
|
+
to: p.to,
|
|
248
|
+
cls: m("swl-ar-ghost", g && "swl-overdue"),
|
|
226
249
|
marker: "ghost",
|
|
227
|
-
label: `⌛ ${
|
|
228
|
-
hitId:
|
|
250
|
+
label: `⌛ ${p.label}`,
|
|
251
|
+
hitId: p.id,
|
|
229
252
|
kind: "pending",
|
|
230
|
-
hl:
|
|
231
|
-
rel:
|
|
232
|
-
}), /* @__PURE__ */
|
|
253
|
+
hl: s === p.id,
|
|
254
|
+
rel: c
|
|
255
|
+
}), /* @__PURE__ */ _("svg", {
|
|
233
256
|
className: "swl-row swl-ghost",
|
|
234
|
-
width:
|
|
257
|
+
width: o,
|
|
235
258
|
height: t.rowH,
|
|
236
259
|
children: [
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
className:
|
|
260
|
+
/* @__PURE__ */ _("text", {
|
|
261
|
+
className: m("swl-ts", g && "swl-overdue"),
|
|
239
262
|
x: 0,
|
|
240
263
|
y: t.mid + 3,
|
|
241
|
-
children: [
|
|
242
|
-
"waiting ",
|
|
243
|
-
(d / 1e3).toFixed(1),
|
|
244
|
-
"s"
|
|
245
|
-
]
|
|
264
|
+
children: ["waiting ", d(h)]
|
|
246
265
|
}),
|
|
247
|
-
|
|
248
|
-
|
|
266
|
+
f.visuals,
|
|
267
|
+
f.hits
|
|
249
268
|
]
|
|
250
269
|
});
|
|
251
|
-
}),
|
|
252
|
-
let
|
|
270
|
+
}), T = s(function({ snap: e, count: t, g: n, laneOrder: r, laneLabels: i, laneActivityClassName: a, laneActivityStyle: o, width: s, proc: c }) {
|
|
271
|
+
let l = {
|
|
253
272
|
visuals: [],
|
|
254
273
|
hits: []
|
|
255
274
|
};
|
|
256
|
-
return
|
|
275
|
+
return y(l, n, r, e, e, null, i, c, a, o), /* @__PURE__ */ _("svg", {
|
|
257
276
|
className: "swl-row swl-now",
|
|
258
|
-
width:
|
|
277
|
+
width: s,
|
|
259
278
|
height: n.rowH,
|
|
260
279
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ g("text", {
|
|
262
281
|
className: "swl-now-lbl",
|
|
263
282
|
x: 0,
|
|
264
283
|
y: n.mid + 3,
|
|
265
284
|
children: "now"
|
|
266
285
|
}),
|
|
267
|
-
|
|
268
|
-
/* @__PURE__ */
|
|
286
|
+
l.visuals,
|
|
287
|
+
/* @__PURE__ */ g("line", {
|
|
269
288
|
className: "swl-now-line",
|
|
270
289
|
x1: n.gutter - 6,
|
|
271
|
-
x2:
|
|
290
|
+
x2: s - 10,
|
|
272
291
|
y1: n.mid,
|
|
273
292
|
y2: n.mid
|
|
274
293
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ _("text", {
|
|
276
295
|
className: "swl-now-lbl",
|
|
277
|
-
x:
|
|
296
|
+
x: s - 136,
|
|
278
297
|
y: n.mid - 4,
|
|
279
298
|
children: [
|
|
280
299
|
"▼ ",
|
|
@@ -285,64 +304,75 @@ var y = {
|
|
|
285
304
|
]
|
|
286
305
|
});
|
|
287
306
|
});
|
|
288
|
-
function
|
|
289
|
-
let { model: t, hid: r, related: a, procId:
|
|
290
|
-
|
|
291
|
-
if (!
|
|
292
|
-
let e = setInterval(() =>
|
|
307
|
+
function ee(e) {
|
|
308
|
+
let { model: t, hid: r, related: a, procId: o, clock: s, formatWait: l, ...u } = e, [f, m] = p(() => Date.now()), v = s ?? f, y = t.pending.length > 0;
|
|
309
|
+
c(() => {
|
|
310
|
+
if (!y || s != null) return;
|
|
311
|
+
let e = setInterval(() => m(Date.now()), 250);
|
|
293
312
|
return () => clearInterval(e);
|
|
294
|
-
}, [
|
|
295
|
-
let { current:
|
|
296
|
-
return /* @__PURE__ */ h
|
|
313
|
+
}, [y, s]);
|
|
314
|
+
let { current: b, pending: x } = t, S = d(() => n(b, x), [b, x]);
|
|
315
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(T, {
|
|
297
316
|
snap: t.current,
|
|
298
317
|
count: t.pending.length,
|
|
299
|
-
proc:
|
|
318
|
+
proc: o && i({
|
|
300
319
|
pre: t.current,
|
|
301
320
|
post: t.current
|
|
302
|
-
}, void 0,
|
|
321
|
+
}, void 0, o) ? o : null,
|
|
303
322
|
...u
|
|
304
|
-
}),
|
|
323
|
+
}), S.map((e) => /* @__PURE__ */ g(w, {
|
|
305
324
|
row: e,
|
|
306
|
-
now:
|
|
325
|
+
now: v,
|
|
307
326
|
hl: r && i(e, e.pending.id, r) ? r : null,
|
|
308
327
|
rel: a.has(e.pending.id),
|
|
309
|
-
proc:
|
|
328
|
+
proc: o && i(e, void 0, o) ? o : null,
|
|
329
|
+
formatWait: l,
|
|
310
330
|
...u
|
|
311
331
|
}, e.id))] });
|
|
312
332
|
}
|
|
313
|
-
function
|
|
314
|
-
return /* @__PURE__ */
|
|
333
|
+
function te({ model: e, g: t, headH: n, width: r }) {
|
|
334
|
+
return /* @__PURE__ */ g("svg", {
|
|
315
335
|
width: r,
|
|
316
336
|
height: n,
|
|
317
337
|
children: e.laneOrder.map((r, i) => {
|
|
318
|
-
let a =
|
|
319
|
-
return /* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */
|
|
338
|
+
let a = v(t, i), o = e.current[r], s = n - 24;
|
|
339
|
+
return /* @__PURE__ */ _("g", { children: [
|
|
340
|
+
/* @__PURE__ */ g("text", {
|
|
321
341
|
className: "swl-lane-name",
|
|
322
342
|
x: a + 4,
|
|
323
343
|
y: s,
|
|
324
344
|
transform: `rotate(-90 ${a + 4} ${s})`,
|
|
325
345
|
children: e.laneLabels[r] ?? r
|
|
326
346
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ g("circle", {
|
|
328
348
|
cx: a,
|
|
329
349
|
cy: n - 12,
|
|
330
350
|
r: 5,
|
|
331
351
|
className: `swl-dot-${o?.state}`,
|
|
332
|
-
children: /* @__PURE__ */
|
|
352
|
+
children: /* @__PURE__ */ g("title", { children: o?.state })
|
|
333
353
|
}),
|
|
334
|
-
o && o.acts.length > 0 && /* @__PURE__ */
|
|
354
|
+
o && o.acts.length > 0 && /* @__PURE__ */ g("text", {
|
|
335
355
|
className: "swl-lbl-muted",
|
|
336
356
|
x: a + 9,
|
|
337
357
|
y: n - 8,
|
|
338
358
|
children: o.acts.length
|
|
359
|
+
}),
|
|
360
|
+
/* @__PURE__ */ g("rect", {
|
|
361
|
+
className: "swl-hit",
|
|
362
|
+
x: a - t.laneW / 2,
|
|
363
|
+
y: 0,
|
|
364
|
+
width: t.laneW,
|
|
365
|
+
height: n,
|
|
366
|
+
"data-kind": "lane",
|
|
367
|
+
"data-id": r,
|
|
368
|
+
"data-lane": r
|
|
339
369
|
})
|
|
340
370
|
] }, r);
|
|
341
371
|
})
|
|
342
372
|
});
|
|
343
373
|
}
|
|
344
|
-
function
|
|
345
|
-
let t = (t, n, r) => /* @__PURE__ */
|
|
374
|
+
function ne({ mk: e }) {
|
|
375
|
+
let t = (t, n, r) => /* @__PURE__ */ g("marker", {
|
|
346
376
|
id: `${e}-${t}`,
|
|
347
377
|
viewBox: "0 0 10 10",
|
|
348
378
|
refX: 9,
|
|
@@ -351,20 +381,20 @@ function T({ mk: e }) {
|
|
|
351
381
|
markerHeight: 9,
|
|
352
382
|
markerUnits: "userSpaceOnUse",
|
|
353
383
|
orient: "auto-start-reverse",
|
|
354
|
-
children: r ? /* @__PURE__ */
|
|
384
|
+
children: r ? /* @__PURE__ */ g("path", {
|
|
355
385
|
d: "M1,1 L9,5 L1,9",
|
|
356
386
|
className: n
|
|
357
|
-
}) : /* @__PURE__ */
|
|
387
|
+
}) : /* @__PURE__ */ g("path", {
|
|
358
388
|
d: "M0,0 L10,5 L0,10 z",
|
|
359
389
|
className: n
|
|
360
390
|
})
|
|
361
391
|
});
|
|
362
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ g("svg", {
|
|
363
393
|
width: 0,
|
|
364
394
|
height: 0,
|
|
365
395
|
style: { position: "absolute" },
|
|
366
396
|
"aria-hidden": "true",
|
|
367
|
-
children: /* @__PURE__ */
|
|
397
|
+
children: /* @__PURE__ */ _("defs", { children: [
|
|
368
398
|
t("sync", "swl-mk-sync", !1),
|
|
369
399
|
t("async", "swl-mk-async", !0),
|
|
370
400
|
t("event", "swl-mk-event", !0),
|
|
@@ -384,26 +414,29 @@ function D(e) {
|
|
|
384
414
|
}
|
|
385
415
|
return null;
|
|
386
416
|
}
|
|
387
|
-
var O = (
|
|
388
|
-
let { cardName:
|
|
389
|
-
laneW:
|
|
390
|
-
rowH:
|
|
417
|
+
var O = (n) => {
|
|
418
|
+
let { cardName: s, model: h, showPending: v = !0, autoFollow: y = !0, showTooltip: b = !0, highlightId: x, laneWidth: C = 104, rowHeight: w = 30, headerHeight: T = 130, gutterWidth: O = 92, stickyTop: re = 0, now: k, formatTs: A = t, formatWait: ie, className: j, style: M, onHoverChanged: N, onItemClicked: ae } = n, P = "swl" + l().replace(/[^a-zA-Z0-9_-]/g, ""), F = d(() => ({
|
|
419
|
+
laneW: C,
|
|
420
|
+
rowH: w,
|
|
391
421
|
gutter: O,
|
|
392
|
-
mid:
|
|
393
|
-
mk:
|
|
422
|
+
mid: w / 2,
|
|
423
|
+
mk: P
|
|
394
424
|
}), [
|
|
395
|
-
|
|
396
|
-
|
|
425
|
+
C,
|
|
426
|
+
w,
|
|
397
427
|
O,
|
|
398
|
-
|
|
399
|
-
]),
|
|
400
|
-
g:
|
|
401
|
-
laneOrder:
|
|
402
|
-
laneLabels:
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
428
|
+
P
|
|
429
|
+
]), I = O + h.laneOrder.length * C + 140, L = {
|
|
430
|
+
g: F,
|
|
431
|
+
laneOrder: h.laneOrder,
|
|
432
|
+
laneLabels: h.laneLabels,
|
|
433
|
+
laneActivityClassName: h.laneActivityClassName,
|
|
434
|
+
laneActivityStyle: h.laneActivityStyle,
|
|
435
|
+
width: I,
|
|
436
|
+
fmtTs: A
|
|
437
|
+
}, R = f(null), z = f(null), B = f(h);
|
|
438
|
+
B.current = h;
|
|
439
|
+
let [V, oe] = p(null), H = f(null), U = (e) => {
|
|
407
440
|
let t = e?.closest?.(".swl-hit");
|
|
408
441
|
if (!t) return null;
|
|
409
442
|
let n = t.dataset;
|
|
@@ -411,103 +444,120 @@ var O = (t) => {
|
|
|
411
444
|
kind: n.kind,
|
|
412
445
|
id: n.id,
|
|
413
446
|
lane: n.lane,
|
|
414
|
-
rowId: n.row
|
|
447
|
+
rowId: n.row
|
|
415
448
|
};
|
|
416
449
|
}, W = (e, t) => e === t || !!e && !!t && e.kind === t.kind && e.id === t.id, G = (e) => {
|
|
417
|
-
let t =
|
|
450
|
+
let t = B.current;
|
|
451
|
+
if (e.kind === "step") return { steps: o(t, e.id) };
|
|
452
|
+
if (e.kind === "lane") return { meta: t.laneMeta[e.id] };
|
|
453
|
+
if (e.kind === "state") {
|
|
454
|
+
let n = t.rows.find((t) => String(t.id) === e.rowId);
|
|
455
|
+
return {
|
|
456
|
+
related: void 0,
|
|
457
|
+
process: void 0,
|
|
458
|
+
meta: n && n.event.type === "state" ? n.event.meta : void 0
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
let n = r(t, e.id), i = E(t, e) ?? void 0, a = e.kind === "pending" ? t.pending.find((t) => t.id === e.id) : void 0, s = a ? a.meta : t.spans[e.id]?.meta;
|
|
418
462
|
return e.kind === "pending" ? {
|
|
419
|
-
pending:
|
|
463
|
+
pending: a,
|
|
420
464
|
span: t.spans[e.id],
|
|
421
465
|
related: n,
|
|
422
|
-
process: i
|
|
466
|
+
process: i,
|
|
467
|
+
meta: s
|
|
423
468
|
} : {
|
|
424
469
|
span: t.spans[e.id],
|
|
425
470
|
related: n,
|
|
426
|
-
process: i
|
|
471
|
+
process: i,
|
|
472
|
+
meta: s
|
|
427
473
|
};
|
|
428
474
|
}, K = (e, t) => {
|
|
429
|
-
let n =
|
|
475
|
+
let n = z.current;
|
|
430
476
|
n && (n.style.left = `${e + 14}px`, n.style.top = `${t + 14}px`);
|
|
431
477
|
}, q = (t, n) => {
|
|
432
478
|
let r = H.current;
|
|
433
479
|
if (W(r, t)) return;
|
|
434
|
-
H.current = t,
|
|
435
|
-
let i =
|
|
436
|
-
i && (t &&
|
|
480
|
+
H.current = t, oe(t);
|
|
481
|
+
let i = z.current;
|
|
482
|
+
i && (t && b ? (i.textContent = e(B.current, t, k ?? Date.now(), A), i.style.display = "block", K(n.clientX, n.clientY)) : i.style.display = "none"), N({
|
|
437
483
|
target: t,
|
|
438
484
|
previous: r,
|
|
439
485
|
...t ? G(t) : {},
|
|
440
486
|
clientX: n.clientX,
|
|
441
487
|
clientY: n.clientY
|
|
442
488
|
});
|
|
443
|
-
},
|
|
489
|
+
}, se = (e) => {
|
|
444
490
|
let t = U(e.target);
|
|
445
491
|
t && q(t, e);
|
|
446
|
-
},
|
|
492
|
+
}, ce = (e) => {
|
|
447
493
|
let t = U(e.relatedTarget);
|
|
448
494
|
(!t || !W(t, H.current)) && q(t, e);
|
|
449
|
-
},
|
|
450
|
-
H.current &&
|
|
451
|
-
},
|
|
495
|
+
}, le = (e) => {
|
|
496
|
+
H.current && b && K(e.clientX, e.clientY);
|
|
497
|
+
}, ue = (e) => {
|
|
452
498
|
let t = U(e.target);
|
|
453
|
-
t &&
|
|
499
|
+
t && ae({
|
|
454
500
|
target: t,
|
|
455
501
|
...G(t)
|
|
456
502
|
});
|
|
457
|
-
},
|
|
458
|
-
return
|
|
459
|
-
if (!
|
|
460
|
-
let e = D(
|
|
503
|
+
}, J = V && V.kind !== "state" && V.kind !== "step" && V.kind !== "lane" ? V.id : x ?? null, { spans: Y } = h, X = d(() => new Set(J ? r({ spans: Y }, J) : []), [J, Y]), Z = V ? E(h, V) : null, Q = V?.kind === "step" ? V.id : null, $ = f(!0);
|
|
504
|
+
return c(() => {
|
|
505
|
+
if (!y) return;
|
|
506
|
+
let e = D(R.current), t = e ?? window, n = () => {
|
|
461
507
|
$.current = e ? e.scrollTop + e.clientHeight >= e.scrollHeight - 40 : window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 40;
|
|
462
508
|
};
|
|
463
509
|
return t.addEventListener("scroll", n, { passive: !0 }), () => t.removeEventListener("scroll", n);
|
|
464
|
-
}, [
|
|
465
|
-
if (!
|
|
466
|
-
let e = D(
|
|
510
|
+
}, [y]), u(() => {
|
|
511
|
+
if (!y || !$.current) return;
|
|
512
|
+
let e = D(R.current);
|
|
467
513
|
e ? e.scrollTop = e.scrollHeight : window.scrollTo(0, document.documentElement.scrollHeight);
|
|
468
514
|
}, [
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
]), /* @__PURE__ */
|
|
473
|
-
ref:
|
|
474
|
-
className:
|
|
475
|
-
|
|
515
|
+
y,
|
|
516
|
+
h.rows.length,
|
|
517
|
+
h.pending.length
|
|
518
|
+
]), /* @__PURE__ */ _("div", {
|
|
519
|
+
ref: R,
|
|
520
|
+
className: m("pihanga-swimlane", j),
|
|
521
|
+
style: M,
|
|
522
|
+
"data-pihanga": s,
|
|
523
|
+
onPointerOver: se,
|
|
524
|
+
onPointerOut: ce,
|
|
525
|
+
onPointerMove: le,
|
|
526
|
+
onClick: ue,
|
|
476
527
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ g(ne, { mk: P }),
|
|
529
|
+
/* @__PURE__ */ g("div", {
|
|
479
530
|
className: "swl-header",
|
|
480
|
-
style: { top:
|
|
481
|
-
children: /* @__PURE__ */
|
|
482
|
-
model:
|
|
483
|
-
g:
|
|
484
|
-
headH:
|
|
485
|
-
width:
|
|
531
|
+
style: { top: re },
|
|
532
|
+
children: /* @__PURE__ */ g(te, {
|
|
533
|
+
model: h,
|
|
534
|
+
g: F,
|
|
535
|
+
headH: T,
|
|
536
|
+
width: I
|
|
486
537
|
})
|
|
487
538
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ _("div", {
|
|
489
540
|
className: "swl-rows",
|
|
490
|
-
|
|
491
|
-
onPointerOut: te,
|
|
492
|
-
onPointerMove: ne,
|
|
493
|
-
onClick: re,
|
|
494
|
-
children: [a.rows.map((e) => /* @__PURE__ */ m(b, {
|
|
541
|
+
children: [h.rows.map((e, t) => /* @__PURE__ */ g(S, {
|
|
495
542
|
row: e,
|
|
496
|
-
hl:
|
|
497
|
-
rel: "id" in e.event && e.event.type !== "done" &&
|
|
498
|
-
proc:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
543
|
+
hl: J && i(e, "id" in e.event ? e.event.id : void 0, J) ? J : null,
|
|
544
|
+
rel: "id" in e.event && e.event.type !== "done" && X.has(e.event.id),
|
|
545
|
+
proc: Z && i(e, void 0, Z) ? Z : null,
|
|
546
|
+
grouped: e.event.step != null && e.event.step === h.rows[t - 1]?.event.step,
|
|
547
|
+
stepHl: Q != null && a(e) === Q,
|
|
548
|
+
...L
|
|
549
|
+
}, e.id)), v && /* @__PURE__ */ g(ee, {
|
|
550
|
+
model: h,
|
|
551
|
+
hid: J,
|
|
552
|
+
related: X,
|
|
553
|
+
procId: Z,
|
|
554
|
+
clock: k,
|
|
555
|
+
formatWait: ie,
|
|
556
|
+
...L
|
|
507
557
|
})]
|
|
508
558
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
ref:
|
|
559
|
+
/* @__PURE__ */ g("div", {
|
|
560
|
+
ref: z,
|
|
511
561
|
className: "swl-tooltip",
|
|
512
562
|
role: "tooltip"
|
|
513
563
|
})
|