@nice2dev/ui 1.3.16 → 1.3.17
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 +67 -0
- package/dist/NiceEventOrchestrator.doc-Dwtq2s_L.cjs +6 -0
- package/dist/docs/NiceEventOrchestrator.doc.json.mjs +19 -19
- package/dist/index.cjs +221 -221
- package/dist/index.d.ts +81 -48
- package/dist/index.mjs +912 -910
- package/dist/style.css +1 -1
- package/dist/tools/NiceThemeDesigner.mjs +1359 -900
- package/dist/tools/NiceThemePreview.mjs +18 -18
- package/dist/tools/themeCatalog.mjs +50 -0
- package/dist/workflow/NiceWorkflowDesigner.mjs +452 -898
- package/package.json +4 -4
- package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +0 -6
|
@@ -1,137 +1,68 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRovingFocus as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { NiceAppShell as
|
|
1
|
+
import { jsx as n, jsxs as a, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useRovingFocus as ie, useNiceTranslation as he, NiceIcon as p } from "@nice2dev/ui-core";
|
|
3
|
+
import { useRef as L, useState as E, useMemo as K, useCallback as y } from "react";
|
|
4
|
+
import { NiceAppShell as Ye } from "../navigation/NiceAppShell.mjs";
|
|
5
5
|
/* empty css */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
titleKey: "tutorial.workflowDesigner.intro.title",
|
|
10
|
-
title: "Workflow designer",
|
|
11
|
-
contentKey: "tutorial.workflowDesigner.intro.content",
|
|
12
|
-
content: "Add states and transitions on the canvas, validate the flow, simulate it, then test or publish your workflow.",
|
|
13
|
-
placement: "auto"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
target: ".nice-workflow-designer__toolbar",
|
|
17
|
-
titleKey: "tutorial.workflowDesigner.toolbar.title",
|
|
18
|
-
title: "Toolbar",
|
|
19
|
-
contentKey: "tutorial.workflowDesigner.toolbar.content",
|
|
20
|
-
content: "Add states and approvals, run a simulation, then test or publish the workflow.",
|
|
21
|
-
placement: "bottom"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
target: ".nice-workflow-designer__canvas",
|
|
25
|
-
titleKey: "tutorial.workflowDesigner.canvas.title",
|
|
26
|
-
title: "Canvas",
|
|
27
|
-
contentKey: "tutorial.workflowDesigner.canvas.content",
|
|
28
|
-
content: "Drag to arrange states, click one to edit it, and connect them into transitions.",
|
|
29
|
-
placement: "auto"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
target: ".nice-workflow-designer__minimap",
|
|
33
|
-
titleKey: "tutorial.workflowDesigner.minimap.title",
|
|
34
|
-
title: "Minimap",
|
|
35
|
-
contentKey: "tutorial.workflowDesigner.minimap.content",
|
|
36
|
-
content: "A bird’s-eye overview of the whole flow for quick navigation.",
|
|
37
|
-
placement: "left"
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
function je(i, c) {
|
|
41
|
-
const b = [], H = i.states.filter((d) => d.type === "initial"), m = i.states.filter((d) => d.type === "final");
|
|
42
|
-
H.length === 0 && b.push({
|
|
43
|
-
type: "error",
|
|
44
|
-
message: c("workflowDesigner.val.noInitial", "No initial state")
|
|
45
|
-
}), H.length > 1 && b.push({
|
|
46
|
-
type: "warning",
|
|
47
|
-
message: c("workflowDesigner.val.multiInitial", "More than one initial state")
|
|
48
|
-
}), m.length === 0 && b.push({ type: "error", message: c("workflowDesigner.val.noFinal", "No final state") });
|
|
49
|
-
for (const d of i.states) {
|
|
50
|
-
const D = i.transitions.some((N) => N.fromStateId === d.id), P = i.transitions.some((N) => N.toStateId === d.id);
|
|
51
|
-
!D && d.type !== "final" && d.type !== "error" && b.push({
|
|
52
|
-
type: "warning",
|
|
53
|
-
message: c(
|
|
54
|
-
"workflowDesigner.val.deadEnd",
|
|
55
|
-
'State "{name}" has no outgoing transitions (dead-end)'
|
|
56
|
-
).replace("{name}", d.name),
|
|
57
|
-
elementId: d.id
|
|
58
|
-
}), !P && d.type !== "initial" && b.push({
|
|
59
|
-
type: "warning",
|
|
60
|
-
message: c(
|
|
61
|
-
"workflowDesigner.val.orphan",
|
|
62
|
-
'State "{name}" is unreachable (orphan)'
|
|
63
|
-
).replace("{name}", d.name),
|
|
64
|
-
elementId: d.id
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return b;
|
|
68
|
-
}
|
|
69
|
-
function Ue(i, c) {
|
|
70
|
-
const b = [];
|
|
71
|
-
i.elements.filter(
|
|
6
|
+
function He(t, l) {
|
|
7
|
+
const f = [];
|
|
8
|
+
t.elements.filter(
|
|
72
9
|
(d) => d.elementType === "event" && d.eventType === "startEvent"
|
|
73
|
-
).length === 0 &&
|
|
10
|
+
).length === 0 && f.push({
|
|
74
11
|
type: "error",
|
|
75
|
-
message:
|
|
76
|
-
}),
|
|
12
|
+
message: l("workflowDesigner.val.bpmnNoStart", "Process must have at least one start event")
|
|
13
|
+
}), t.elements.filter(
|
|
77
14
|
(d) => d.elementType === "event" && d.eventType === "endEvent"
|
|
78
|
-
).length === 0 &&
|
|
15
|
+
).length === 0 && f.push({
|
|
79
16
|
type: "error",
|
|
80
|
-
message:
|
|
17
|
+
message: l("workflowDesigner.val.bpmnNoEnd", "Process must have at least one end event")
|
|
81
18
|
});
|
|
82
|
-
for (const d of
|
|
83
|
-
const
|
|
84
|
-
d.elementType === "event" ? (d.eventType === "startEvent" && !N &&
|
|
19
|
+
for (const d of t.elements) {
|
|
20
|
+
const w = d.id, F = t.sequenceFlows.some((A) => A.targetRef === w), N = t.sequenceFlows.some((A) => A.sourceRef === w);
|
|
21
|
+
d.elementType === "event" ? (d.eventType === "startEvent" && !N && f.push({
|
|
85
22
|
type: "warning",
|
|
86
|
-
message:
|
|
23
|
+
message: l(
|
|
87
24
|
"workflowDesigner.val.startNoOut",
|
|
88
25
|
'Start event "{name}" has no outgoing flow'
|
|
89
26
|
).replace("{name}", d.name),
|
|
90
|
-
elementId:
|
|
91
|
-
}), d.eventType === "endEvent" && !
|
|
27
|
+
elementId: w
|
|
28
|
+
}), d.eventType === "endEvent" && !F && f.push({
|
|
92
29
|
type: "warning",
|
|
93
|
-
message:
|
|
30
|
+
message: l(
|
|
94
31
|
"workflowDesigner.val.endNoIn",
|
|
95
32
|
'End event "{name}" has no incoming flow'
|
|
96
33
|
).replace("{name}", d.name),
|
|
97
|
-
elementId:
|
|
98
|
-
})) : (d.elementType === "task" || d.elementType === "gateway") && (
|
|
34
|
+
elementId: w
|
|
35
|
+
})) : (d.elementType === "task" || d.elementType === "gateway") && (F || f.push({
|
|
99
36
|
type: "warning",
|
|
100
|
-
message:
|
|
37
|
+
message: l(
|
|
101
38
|
"workflowDesigner.val.unreachable",
|
|
102
39
|
'Element "{name}" is unreachable'
|
|
103
|
-
).replace("{name}", d.name ||
|
|
104
|
-
elementId:
|
|
105
|
-
}), N ||
|
|
40
|
+
).replace("{name}", d.name || w),
|
|
41
|
+
elementId: w
|
|
42
|
+
}), N || f.push({
|
|
106
43
|
type: "warning",
|
|
107
|
-
message:
|
|
44
|
+
message: l(
|
|
108
45
|
"workflowDesigner.val.elemNoOut",
|
|
109
46
|
'Element "{name}" has no outgoing flow'
|
|
110
|
-
).replace("{name}", d.name ||
|
|
111
|
-
elementId:
|
|
47
|
+
).replace("{name}", d.name || w),
|
|
48
|
+
elementId: w
|
|
112
49
|
}));
|
|
113
50
|
}
|
|
114
|
-
for (const d of
|
|
51
|
+
for (const d of t.elements)
|
|
115
52
|
if (d.elementType === "gateway" && d.gatewayType === "exclusiveGateway") {
|
|
116
|
-
const
|
|
117
|
-
|
|
53
|
+
const w = t.sequenceFlows.filter((N) => N.sourceRef === d.id), F = w.filter((N) => N.conditionExpression || N.isDefault);
|
|
54
|
+
w.length > 1 && F.length < w.length - 1 && f.push({
|
|
118
55
|
type: "warning",
|
|
119
|
-
message:
|
|
56
|
+
message: l(
|
|
120
57
|
"workflowDesigner.val.xorNoConditions",
|
|
121
58
|
'Exclusive gateway "{name}" should have conditions on its flows'
|
|
122
59
|
).replace("{name}", d.name || d.id),
|
|
123
60
|
elementId: d.id
|
|
124
61
|
});
|
|
125
62
|
}
|
|
126
|
-
return
|
|
63
|
+
return f;
|
|
127
64
|
}
|
|
128
|
-
const
|
|
129
|
-
initial: "var(--nice-color-success, #22c55e)",
|
|
130
|
-
intermediate: "var(--nice-color-primary, #3b82f6)",
|
|
131
|
-
approval: "var(--nice-color-warning, #f59e0b)",
|
|
132
|
-
final: "var(--nice-text-muted, #6b7280)",
|
|
133
|
-
error: "var(--nice-color-error, #ef4444)"
|
|
134
|
-
}, Ve = {
|
|
65
|
+
const Xe = {
|
|
135
66
|
none: "circle",
|
|
136
67
|
message: "mail",
|
|
137
68
|
timer: "clock",
|
|
@@ -142,7 +73,7 @@ const Ne = {
|
|
|
142
73
|
signal: "target",
|
|
143
74
|
terminate: "circle",
|
|
144
75
|
link: "arrow-right"
|
|
145
|
-
},
|
|
76
|
+
}, Le = {
|
|
146
77
|
task: "check-square",
|
|
147
78
|
userTask: "user",
|
|
148
79
|
serviceTask: "settings",
|
|
@@ -152,25 +83,25 @@ const Ne = {
|
|
|
152
83
|
receiveTask: "download",
|
|
153
84
|
manualTask: "cursor",
|
|
154
85
|
callActivity: "arrow-right"
|
|
155
|
-
},
|
|
86
|
+
}, Ke = {
|
|
156
87
|
events: "circle",
|
|
157
88
|
tasks: "square",
|
|
158
89
|
gateways: "diamond",
|
|
159
90
|
subprocesses: "layers",
|
|
160
91
|
artifacts: "file"
|
|
161
|
-
},
|
|
92
|
+
}, ve = {
|
|
162
93
|
events: "Events",
|
|
163
94
|
tasks: "Tasks",
|
|
164
95
|
gateways: "Gateways",
|
|
165
96
|
subprocesses: "Subprocesses",
|
|
166
97
|
artifacts: "Artifacts"
|
|
167
|
-
},
|
|
98
|
+
}, je = {
|
|
168
99
|
exclusiveGateway: "close",
|
|
169
100
|
parallelGateway: "plus",
|
|
170
101
|
inclusiveGateway: "circle",
|
|
171
102
|
eventBasedGateway: "target",
|
|
172
103
|
complexGateway: "star"
|
|
173
|
-
},
|
|
104
|
+
}, Ve = [
|
|
174
105
|
// Events
|
|
175
106
|
{
|
|
176
107
|
id: "startEvent",
|
|
@@ -346,236 +277,236 @@ const Ne = {
|
|
|
346
277
|
elementType: "dataObject"
|
|
347
278
|
}
|
|
348
279
|
];
|
|
349
|
-
function
|
|
350
|
-
return `${
|
|
280
|
+
function ae(t) {
|
|
281
|
+
return `${t}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
351
282
|
}
|
|
352
|
-
function
|
|
353
|
-
const
|
|
354
|
-
return
|
|
355
|
-
id:
|
|
356
|
-
name:
|
|
283
|
+
function ke(t, l) {
|
|
284
|
+
const f = ae(t.elementType);
|
|
285
|
+
return t.category === "events" ? {
|
|
286
|
+
id: f,
|
|
287
|
+
name: t.label,
|
|
357
288
|
elementType: "event",
|
|
358
|
-
eventType:
|
|
359
|
-
eventDefinition:
|
|
360
|
-
position:
|
|
361
|
-
} :
|
|
362
|
-
id:
|
|
363
|
-
name:
|
|
289
|
+
eventType: t.elementType,
|
|
290
|
+
eventDefinition: t.eventDefinition || "none",
|
|
291
|
+
position: l
|
|
292
|
+
} : t.category === "tasks" ? {
|
|
293
|
+
id: f,
|
|
294
|
+
name: t.label,
|
|
364
295
|
elementType: "task",
|
|
365
|
-
taskType:
|
|
366
|
-
position:
|
|
296
|
+
taskType: t.elementType,
|
|
297
|
+
position: l,
|
|
367
298
|
size: { width: 100, height: 80 }
|
|
368
|
-
} :
|
|
369
|
-
id:
|
|
299
|
+
} : t.category === "gateways" ? {
|
|
300
|
+
id: f,
|
|
370
301
|
name: "",
|
|
371
302
|
elementType: "gateway",
|
|
372
|
-
gatewayType:
|
|
373
|
-
position:
|
|
374
|
-
} :
|
|
375
|
-
id:
|
|
376
|
-
name:
|
|
303
|
+
gatewayType: t.elementType,
|
|
304
|
+
position: l
|
|
305
|
+
} : t.category === "subprocesses" ? {
|
|
306
|
+
id: f,
|
|
307
|
+
name: t.label,
|
|
377
308
|
elementType: "subprocess",
|
|
378
|
-
position:
|
|
309
|
+
position: l,
|
|
379
310
|
size: { width: 300, height: 200 },
|
|
380
311
|
isExpanded: !0,
|
|
381
312
|
elements: [],
|
|
382
313
|
sequenceFlows: []
|
|
383
314
|
} : null;
|
|
384
315
|
}
|
|
385
|
-
function
|
|
386
|
-
return Math.round(
|
|
316
|
+
function j(t, l) {
|
|
317
|
+
return Math.round(t / l) * l;
|
|
387
318
|
}
|
|
388
|
-
const
|
|
389
|
-
process:
|
|
390
|
-
onChange:
|
|
391
|
-
availableUsers:
|
|
392
|
-
availableRoles:
|
|
393
|
-
readOnly:
|
|
319
|
+
const Qe = ({
|
|
320
|
+
process: t,
|
|
321
|
+
onChange: l,
|
|
322
|
+
availableUsers: f = [],
|
|
323
|
+
availableRoles: _e = [],
|
|
324
|
+
readOnly: o = !1,
|
|
394
325
|
showMinimap: d = !0,
|
|
395
|
-
showToolbar:
|
|
396
|
-
showValidation:
|
|
326
|
+
showToolbar: w = !0,
|
|
327
|
+
showValidation: F = !0,
|
|
397
328
|
showPalette: N = !0,
|
|
398
|
-
showProperties:
|
|
399
|
-
showVariables:
|
|
400
|
-
gridSize:
|
|
401
|
-
snapToGrid:
|
|
402
|
-
onTest:
|
|
403
|
-
onPublish:
|
|
404
|
-
onExportBPMN:
|
|
405
|
-
onImportBPMN:
|
|
406
|
-
className:
|
|
407
|
-
style:
|
|
408
|
-
"data-testid":
|
|
329
|
+
showProperties: A = !0,
|
|
330
|
+
showVariables: se = !1,
|
|
331
|
+
gridSize: C = 20,
|
|
332
|
+
snapToGrid: I = !0,
|
|
333
|
+
onTest: le,
|
|
334
|
+
onPublish: re,
|
|
335
|
+
onExportBPMN: oe,
|
|
336
|
+
onImportBPMN: ce,
|
|
337
|
+
className: Te,
|
|
338
|
+
style: De,
|
|
339
|
+
"data-testid": xe
|
|
409
340
|
}) => {
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
const { t:
|
|
413
|
-
() =>
|
|
414
|
-
[
|
|
415
|
-
),
|
|
416
|
-
() =>
|
|
417
|
-
[
|
|
418
|
-
),
|
|
419
|
-
() =>
|
|
420
|
-
[
|
|
421
|
-
),
|
|
422
|
-
() =>
|
|
341
|
+
const de = L(null);
|
|
342
|
+
ie(de, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
|
|
343
|
+
const { t: me } = he(), { t: i } = he(), [S, z] = E(null), [R, B] = E(null), [V, W] = E(null), [_, Z] = E(null), [h, U] = E({ x: 0, y: 0 }), [T, G] = E(1), [J, pe] = E(!1), Y = L(null), [H, Ee] = E("tasks"), [$, ue] = E(!1), [X, O] = E(null), q = K(
|
|
344
|
+
() => F ? He(t, i) : [],
|
|
345
|
+
[t, F, i]
|
|
346
|
+
), Q = q.filter((e) => e.type === "error"), Ne = q.filter((e) => e.type === "warning"), m = K(
|
|
347
|
+
() => t.elements.find((e) => e.id === S),
|
|
348
|
+
[t.elements, S]
|
|
349
|
+
), k = K(
|
|
350
|
+
() => t.sequenceFlows.find((e) => e.id === R),
|
|
351
|
+
[t.sequenceFlows, R]
|
|
352
|
+
), Pe = K(
|
|
353
|
+
() => Ve.filter((e) => e.category === H).map((e) => ({
|
|
423
354
|
...e,
|
|
424
|
-
label:
|
|
355
|
+
label: i(`workflowDesigner.palette.${e.id}`, e.label)
|
|
425
356
|
})),
|
|
426
|
-
[
|
|
427
|
-
), Fe =
|
|
357
|
+
[H, i]
|
|
358
|
+
), Fe = y(
|
|
428
359
|
(e) => {
|
|
429
|
-
if (
|
|
360
|
+
if (o || !V)
|
|
430
361
|
return;
|
|
431
|
-
const
|
|
432
|
-
let
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
-
|
|
436
|
-
...
|
|
437
|
-
elements: [...
|
|
438
|
-
}),
|
|
362
|
+
const s = e.currentTarget.getBoundingClientRect();
|
|
363
|
+
let r = (e.clientX - s.left - h.x) / T, u = (e.clientY - s.top - h.y) / T;
|
|
364
|
+
I && (r = j(r, C), u = j(u, C));
|
|
365
|
+
const b = ke(V, { x: r, y: u });
|
|
366
|
+
b && (l?.({
|
|
367
|
+
...t,
|
|
368
|
+
elements: [...t.elements, b]
|
|
369
|
+
}), z(b.id)), W(null);
|
|
439
370
|
},
|
|
440
371
|
[
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
372
|
+
o,
|
|
373
|
+
V,
|
|
374
|
+
h,
|
|
375
|
+
T,
|
|
376
|
+
I,
|
|
377
|
+
C,
|
|
378
|
+
t,
|
|
379
|
+
l
|
|
449
380
|
]
|
|
450
|
-
),
|
|
381
|
+
), Ce = y(
|
|
451
382
|
(e) => {
|
|
452
|
-
if (
|
|
383
|
+
if (o)
|
|
453
384
|
return;
|
|
454
|
-
const
|
|
455
|
-
let
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
|
|
385
|
+
const s = t.elements.length % 8 * 30;
|
|
386
|
+
let r = (40 - h.x) / T + s, u = (40 - h.y) / T + s;
|
|
387
|
+
I && (r = j(r, C), u = j(u, C));
|
|
388
|
+
const b = ke(e, { x: r, y: u });
|
|
389
|
+
b && (l?.({ ...t, elements: [...t.elements, b] }), z(b.id));
|
|
459
390
|
},
|
|
460
|
-
[
|
|
461
|
-
),
|
|
462
|
-
|
|
463
|
-
const
|
|
391
|
+
[o, h, T, I, C, t, l]
|
|
392
|
+
), ge = L(null), be = L(null);
|
|
393
|
+
ie(ge, { orientation: "vertical", typeahead: !0 }), ie(be, { orientation: "horizontal", itemSelector: "button" });
|
|
394
|
+
const ee = y(
|
|
464
395
|
(e) => {
|
|
465
|
-
if (
|
|
466
|
-
const
|
|
467
|
-
id:
|
|
468
|
-
sourceRef:
|
|
396
|
+
if (_) {
|
|
397
|
+
const s = {
|
|
398
|
+
id: ae("flow"),
|
|
399
|
+
sourceRef: _.fromId,
|
|
469
400
|
targetRef: e
|
|
470
401
|
};
|
|
471
|
-
|
|
472
|
-
...
|
|
473
|
-
sequenceFlows: [...
|
|
474
|
-
}),
|
|
402
|
+
l?.({
|
|
403
|
+
...t,
|
|
404
|
+
sequenceFlows: [...t.sequenceFlows, s]
|
|
405
|
+
}), Z(null);
|
|
475
406
|
} else
|
|
476
|
-
|
|
407
|
+
z(e), B(null);
|
|
477
408
|
},
|
|
478
|
-
[
|
|
479
|
-
),
|
|
409
|
+
[_, t, l]
|
|
410
|
+
), fe = y(
|
|
480
411
|
(e) => {
|
|
481
|
-
|
|
412
|
+
o || Z({ fromId: e });
|
|
482
413
|
},
|
|
483
|
-
[
|
|
484
|
-
),
|
|
414
|
+
[o]
|
|
415
|
+
), ne = y(
|
|
485
416
|
(e) => {
|
|
486
|
-
|
|
487
|
-
...
|
|
488
|
-
elements:
|
|
489
|
-
sequenceFlows:
|
|
490
|
-
(
|
|
417
|
+
o || (l?.({
|
|
418
|
+
...t,
|
|
419
|
+
elements: t.elements.filter((s) => s.id !== e),
|
|
420
|
+
sequenceFlows: t.sequenceFlows.filter(
|
|
421
|
+
(s) => s.sourceRef !== e && s.targetRef !== e
|
|
491
422
|
)
|
|
492
|
-
}),
|
|
423
|
+
}), S === e && z(null));
|
|
493
424
|
},
|
|
494
|
-
[
|
|
495
|
-
),
|
|
425
|
+
[o, t, l, S]
|
|
426
|
+
), Se = y(
|
|
496
427
|
(e) => {
|
|
497
|
-
|
|
498
|
-
...
|
|
499
|
-
sequenceFlows:
|
|
500
|
-
}),
|
|
428
|
+
o || (l?.({
|
|
429
|
+
...t,
|
|
430
|
+
sequenceFlows: t.sequenceFlows.filter((s) => s.id !== e)
|
|
431
|
+
}), R === e && B(null));
|
|
501
432
|
},
|
|
502
|
-
[
|
|
503
|
-
),
|
|
504
|
-
(e,
|
|
505
|
-
|
|
506
|
-
...
|
|
507
|
-
elements:
|
|
508
|
-
(
|
|
433
|
+
[o, t, l, R]
|
|
434
|
+
), P = y(
|
|
435
|
+
(e, s) => {
|
|
436
|
+
o || l?.({
|
|
437
|
+
...t,
|
|
438
|
+
elements: t.elements.map(
|
|
439
|
+
(r) => r.id === e ? { ...r, ...s } : r
|
|
509
440
|
)
|
|
510
441
|
});
|
|
511
442
|
},
|
|
512
|
-
[
|
|
513
|
-
),
|
|
514
|
-
(e,
|
|
515
|
-
|
|
516
|
-
...
|
|
517
|
-
sequenceFlows:
|
|
518
|
-
(
|
|
443
|
+
[o, t, l]
|
|
444
|
+
), te = y(
|
|
445
|
+
(e, s) => {
|
|
446
|
+
o || l?.({
|
|
447
|
+
...t,
|
|
448
|
+
sequenceFlows: t.sequenceFlows.map(
|
|
449
|
+
(r) => r.id === e ? { ...r, ...s } : r
|
|
519
450
|
)
|
|
520
451
|
});
|
|
521
452
|
},
|
|
522
|
-
[
|
|
523
|
-
),
|
|
524
|
-
if (
|
|
453
|
+
[o, t, l]
|
|
454
|
+
), ze = y(() => {
|
|
455
|
+
if (o)
|
|
525
456
|
return;
|
|
526
457
|
const e = {
|
|
527
|
-
id:
|
|
458
|
+
id: ae("var"),
|
|
528
459
|
name: "newVariable",
|
|
529
460
|
type: "string"
|
|
530
461
|
};
|
|
531
|
-
|
|
532
|
-
...
|
|
533
|
-
variables: [...
|
|
462
|
+
l?.({
|
|
463
|
+
...t,
|
|
464
|
+
variables: [...t.variables || [], e]
|
|
534
465
|
});
|
|
535
|
-
}, [
|
|
536
|
-
const e =
|
|
537
|
-
(
|
|
466
|
+
}, [o, t, l]), Re = y(() => {
|
|
467
|
+
const e = t.elements.find(
|
|
468
|
+
(s) => s.elementType === "event" && s.eventType === "startEvent"
|
|
538
469
|
);
|
|
539
|
-
e && (
|
|
540
|
-
}, [
|
|
470
|
+
e && (O(e.id), ue(!0));
|
|
471
|
+
}, [t.elements]), we = y(
|
|
541
472
|
(e) => {
|
|
542
|
-
const
|
|
543
|
-
|
|
473
|
+
const s = t.sequenceFlows.find((r) => r.id === e);
|
|
474
|
+
s && O(s.targetRef);
|
|
544
475
|
},
|
|
545
|
-
[
|
|
546
|
-
), $e =
|
|
476
|
+
[t.sequenceFlows]
|
|
477
|
+
), $e = y(
|
|
547
478
|
(e) => {
|
|
548
|
-
const
|
|
549
|
-
let
|
|
479
|
+
const s = S === e.id, r = $ && X === e.id, u = q.some((c) => c.elementId === e.id), b = $ ? t.sequenceFlows.filter((c) => c.sourceRef === e.id) : [];
|
|
480
|
+
let D, g = "nice-bpmn-element", x = {
|
|
550
481
|
left: e.position.x,
|
|
551
482
|
top: e.position.y
|
|
552
483
|
};
|
|
553
484
|
if (e.elementType === "event") {
|
|
554
|
-
const
|
|
555
|
-
|
|
485
|
+
const c = Xe[e.eventDefinition], v = e.eventType === "startEvent", Be = e.eventType === "endEvent", Ge = e.eventType === "boundaryEvent";
|
|
486
|
+
g += " nice-bpmn-event", g += v ? " nice-bpmn-event--start" : "", g += Be ? " nice-bpmn-event--end" : "", g += Ge ? " nice-bpmn-event--boundary" : "", D = /* @__PURE__ */ n("div", { className: "nice-bpmn-event__icon", title: e.name, children: /* @__PURE__ */ n(p, { name: c, size: 16 }) });
|
|
556
487
|
} else if (e.elementType === "task") {
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
...
|
|
488
|
+
const c = Le[e.taskType];
|
|
489
|
+
g += " nice-bpmn-task", g += ` nice-bpmn-task--${e.taskType}`, x = {
|
|
490
|
+
...x,
|
|
560
491
|
width: e.size?.width || 100,
|
|
561
492
|
height: e.size?.height || 80
|
|
562
|
-
},
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
493
|
+
}, D = /* @__PURE__ */ a(M, { children: [
|
|
494
|
+
/* @__PURE__ */ n("span", { className: "nice-bpmn-task__icon", children: /* @__PURE__ */ n(p, { name: c, size: 16 }) }),
|
|
495
|
+
/* @__PURE__ */ n("span", { className: "nice-bpmn-task__name", children: e.name }),
|
|
565
496
|
e.assignee && /* @__PURE__ */ a("span", { className: "nice-bpmn-task__assignee", children: [
|
|
566
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ n(p, { name: "user", size: 14 }),
|
|
567
498
|
" ",
|
|
568
499
|
e.assignee
|
|
569
500
|
] }),
|
|
570
|
-
e.sla && /* @__PURE__ */
|
|
501
|
+
e.sla && /* @__PURE__ */ n(
|
|
571
502
|
"span",
|
|
572
503
|
{
|
|
573
504
|
className: "nice-bpmn-task__sla",
|
|
574
|
-
title:
|
|
575
|
-
children: /* @__PURE__ */
|
|
505
|
+
title: me("workflowDesigner.slaHH", "SLA: {warningHours}h / {criticalHours}h").replace("{warningHours}", String(e.sla.warningHours)).replace("{criticalHours}", String(e.sla.criticalHours)),
|
|
506
|
+
children: /* @__PURE__ */ n(p, { name: "clock", size: 14 })
|
|
576
507
|
}
|
|
577
508
|
),
|
|
578
|
-
e.loopCharacteristics && /* @__PURE__ */
|
|
509
|
+
e.loopCharacteristics && /* @__PURE__ */ n("span", { className: "nice-bpmn-task__loop", children: /* @__PURE__ */ n(
|
|
579
510
|
p,
|
|
580
511
|
{
|
|
581
512
|
name: e.loopCharacteristics.type === "multiInstanceParallel" ? "bars-vertical" : e.loopCharacteristics.type === "multiInstanceSequential" ? "menu" : "refresh",
|
|
@@ -584,89 +515,89 @@ const ot = ({
|
|
|
584
515
|
) })
|
|
585
516
|
] });
|
|
586
517
|
} else if (e.elementType === "gateway") {
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
} else e.elementType === "subprocess" && (
|
|
590
|
-
...
|
|
518
|
+
const c = je[e.gatewayType];
|
|
519
|
+
g += " nice-bpmn-gateway", g += ` nice-bpmn-gateway--${e.gatewayType}`, D = /* @__PURE__ */ n("div", { className: "nice-bpmn-gateway__diamond", children: /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(p, { name: c, size: 16 }) }) });
|
|
520
|
+
} else e.elementType === "subprocess" && (g += " nice-bpmn-subprocess", g += e.isExpanded ? " nice-bpmn-subprocess--expanded" : "", x = {
|
|
521
|
+
...x,
|
|
591
522
|
width: e.size.width,
|
|
592
523
|
height: e.size.height
|
|
593
|
-
},
|
|
524
|
+
}, D = /* @__PURE__ */ a(M, { children: [
|
|
594
525
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-subprocess__header", children: [
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ n("span", { children: e.name }),
|
|
527
|
+
/* @__PURE__ */ n(
|
|
597
528
|
"button",
|
|
598
529
|
{
|
|
599
530
|
type: "button",
|
|
600
|
-
onClick: (
|
|
601
|
-
|
|
531
|
+
onClick: (c) => {
|
|
532
|
+
c.stopPropagation(), P(e.id, {
|
|
602
533
|
isExpanded: !e.isExpanded
|
|
603
534
|
});
|
|
604
535
|
},
|
|
605
|
-
"aria-label": e.isExpanded ?
|
|
536
|
+
"aria-label": e.isExpanded ? i("workflowDesigner.collapse", "Collapse") : i("workflowDesigner.expand", "Expand"),
|
|
606
537
|
children: e.isExpanded ? "−" : "+"
|
|
607
538
|
}
|
|
608
539
|
)
|
|
609
540
|
] }),
|
|
610
|
-
e.isExpanded && /* @__PURE__ */
|
|
541
|
+
e.isExpanded && /* @__PURE__ */ n("div", { className: "nice-bpmn-subprocess__content" })
|
|
611
542
|
] }));
|
|
612
|
-
return
|
|
543
|
+
return s && (g += " nice-bpmn-element--selected"), r && (g += " nice-bpmn-element--active"), u && (g += " nice-bpmn-element--has-issue"), /* @__PURE__ */ a(
|
|
613
544
|
"div",
|
|
614
545
|
{
|
|
615
|
-
className:
|
|
616
|
-
style:
|
|
617
|
-
onClick: (
|
|
618
|
-
|
|
546
|
+
className: g,
|
|
547
|
+
style: x,
|
|
548
|
+
onClick: (c) => {
|
|
549
|
+
c.stopPropagation(), ee(e.id);
|
|
619
550
|
},
|
|
620
551
|
role: "button",
|
|
621
552
|
tabIndex: 0,
|
|
622
553
|
"aria-label": `${e.elementType}: ${e.name || e.id}`,
|
|
623
|
-
onKeyDown: (
|
|
624
|
-
|
|
554
|
+
onKeyDown: (c) => {
|
|
555
|
+
c.key === "Enter" && ee(e.id), c.key === "Delete" && !o && ne(e.id);
|
|
625
556
|
},
|
|
626
557
|
children: [
|
|
627
|
-
|
|
628
|
-
!
|
|
629
|
-
/* @__PURE__ */
|
|
558
|
+
D,
|
|
559
|
+
!o && s && /* @__PURE__ */ a("div", { className: "nice-bpmn-element__actions", children: [
|
|
560
|
+
/* @__PURE__ */ n(
|
|
630
561
|
"button",
|
|
631
562
|
{
|
|
632
563
|
type: "button",
|
|
633
564
|
className: "nice-bpmn-element__action nice-bpmn-element__action--connect",
|
|
634
|
-
onClick: (
|
|
635
|
-
|
|
565
|
+
onClick: (c) => {
|
|
566
|
+
c.stopPropagation(), fe(e.id);
|
|
636
567
|
},
|
|
637
|
-
title:
|
|
638
|
-
"aria-label":
|
|
639
|
-
children: /* @__PURE__ */
|
|
568
|
+
title: i("workflowDesigner.connect", "Connect"),
|
|
569
|
+
"aria-label": i("workflowDesigner.startConnect", "Start connection"),
|
|
570
|
+
children: /* @__PURE__ */ n(p, { name: "arrow-right", size: 14 })
|
|
640
571
|
}
|
|
641
572
|
),
|
|
642
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ n(
|
|
643
574
|
"button",
|
|
644
575
|
{
|
|
645
576
|
type: "button",
|
|
646
577
|
className: "nice-bpmn-element__action nice-bpmn-element__action--delete",
|
|
647
|
-
onClick: (
|
|
648
|
-
|
|
578
|
+
onClick: (c) => {
|
|
579
|
+
c.stopPropagation(), ne(e.id);
|
|
649
580
|
},
|
|
650
|
-
title:
|
|
651
|
-
"aria-label":
|
|
652
|
-
children: /* @__PURE__ */
|
|
581
|
+
title: i("workflowDesigner.delete", "Delete"),
|
|
582
|
+
"aria-label": i("workflowDesigner.deleteElement", "Delete element"),
|
|
583
|
+
children: /* @__PURE__ */ n(p, { name: "close", size: 12 })
|
|
653
584
|
}
|
|
654
585
|
)
|
|
655
586
|
] }),
|
|
656
|
-
|
|
587
|
+
r && b.map((c) => /* @__PURE__ */ a(
|
|
657
588
|
"button",
|
|
658
589
|
{
|
|
659
590
|
type: "button",
|
|
660
591
|
className: "nice-bpmn-element__sim-action",
|
|
661
|
-
onClick: (
|
|
662
|
-
|
|
592
|
+
onClick: (v) => {
|
|
593
|
+
v.stopPropagation(), we(c.id);
|
|
663
594
|
},
|
|
664
595
|
children: [
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
|
|
596
|
+
/* @__PURE__ */ n(p, { name: "arrow-right", size: 12 }),
|
|
597
|
+
c.name || t.elements.find((v) => v.id === c.targetRef)?.name || i("workflowDesigner.next", "Next")
|
|
667
598
|
]
|
|
668
599
|
},
|
|
669
|
-
|
|
600
|
+
c.id
|
|
670
601
|
))
|
|
671
602
|
]
|
|
672
603
|
},
|
|
@@ -674,29 +605,29 @@ const ot = ({
|
|
|
674
605
|
);
|
|
675
606
|
},
|
|
676
607
|
[
|
|
677
|
-
|
|
608
|
+
S,
|
|
609
|
+
$,
|
|
678
610
|
X,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
i.elements,
|
|
683
|
-
m,
|
|
684
|
-
be,
|
|
685
|
-
De,
|
|
686
|
-
he,
|
|
687
|
-
Y,
|
|
688
|
-
Te,
|
|
611
|
+
q,
|
|
612
|
+
t.sequenceFlows,
|
|
613
|
+
t.elements,
|
|
689
614
|
o,
|
|
690
|
-
|
|
615
|
+
ee,
|
|
616
|
+
fe,
|
|
617
|
+
ne,
|
|
618
|
+
P,
|
|
619
|
+
we,
|
|
620
|
+
i,
|
|
621
|
+
me
|
|
691
622
|
]
|
|
692
|
-
),
|
|
623
|
+
), Me = y(() => /* @__PURE__ */ a(
|
|
693
624
|
"svg",
|
|
694
625
|
{
|
|
695
626
|
className: "nice-bpmn-flows",
|
|
696
627
|
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "visible" },
|
|
697
628
|
children: [
|
|
698
629
|
/* @__PURE__ */ a("defs", { children: [
|
|
699
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ n(
|
|
700
631
|
"marker",
|
|
701
632
|
{
|
|
702
633
|
id: "arrowhead",
|
|
@@ -705,10 +636,10 @@ const ot = ({
|
|
|
705
636
|
refX: "9",
|
|
706
637
|
refY: "3.5",
|
|
707
638
|
orient: "auto",
|
|
708
|
-
children: /* @__PURE__ */
|
|
639
|
+
children: /* @__PURE__ */ n("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--nice-text-secondary, #64748b)" })
|
|
709
640
|
}
|
|
710
641
|
),
|
|
711
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ n(
|
|
712
643
|
"marker",
|
|
713
644
|
{
|
|
714
645
|
id: "arrowhead-selected",
|
|
@@ -717,36 +648,36 @@ const ot = ({
|
|
|
717
648
|
refX: "9",
|
|
718
649
|
refY: "3.5",
|
|
719
650
|
orient: "auto",
|
|
720
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ n("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--nice-color-primary, #3b82f6)" })
|
|
721
652
|
}
|
|
722
653
|
)
|
|
723
654
|
] }),
|
|
724
|
-
|
|
725
|
-
const
|
|
726
|
-
if (!
|
|
655
|
+
t.sequenceFlows.map((e) => {
|
|
656
|
+
const s = t.elements.find((v) => v.id === e.sourceRef), r = t.elements.find((v) => v.id === e.targetRef);
|
|
657
|
+
if (!s || !r)
|
|
727
658
|
return null;
|
|
728
|
-
const
|
|
659
|
+
const u = R === e.id, b = s.position.x + (s.elementType === "task" ? s.size?.width || 100 : s.elementType === "gateway" ? 25 : 15), D = s.position.y + (s.elementType === "task" ? (s.size?.height || 80) / 2 : s.elementType === "gateway" ? 25 : 15), g = r.position.x, x = r.position.y + (r.elementType === "task" ? (r.size?.height || 80) / 2 : r.elementType === "gateway" ? 25 : 15), c = e.waypoints && e.waypoints.length > 0 ? `M ${b} ${D} ${e.waypoints.map((v) => `L ${v.x} ${v.y}`).join(" ")} L ${g} ${x}` : `M ${b} ${D} L ${g} ${x}`;
|
|
729
660
|
return /* @__PURE__ */ a("g", { children: [
|
|
730
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ n(
|
|
731
662
|
"path",
|
|
732
663
|
{
|
|
733
|
-
d:
|
|
664
|
+
d: c,
|
|
734
665
|
fill: "none",
|
|
735
|
-
stroke:
|
|
736
|
-
strokeWidth:
|
|
666
|
+
stroke: u ? "var(--nice-color-primary, #3b82f6)" : "var(--nice-text-muted, #64748b)",
|
|
667
|
+
strokeWidth: u ? 3 : 2,
|
|
737
668
|
strokeDasharray: e.isDefault ? "5,5" : void 0,
|
|
738
|
-
markerEnd:
|
|
669
|
+
markerEnd: u ? "url(#arrowhead-selected)" : "url(#arrowhead)",
|
|
739
670
|
style: { pointerEvents: "stroke", cursor: "pointer" },
|
|
740
671
|
onClick: () => {
|
|
741
|
-
|
|
672
|
+
B(e.id), z(null);
|
|
742
673
|
}
|
|
743
674
|
}
|
|
744
675
|
),
|
|
745
|
-
e.name && /* @__PURE__ */
|
|
676
|
+
e.name && /* @__PURE__ */ n(
|
|
746
677
|
"text",
|
|
747
678
|
{
|
|
748
|
-
x: (
|
|
749
|
-
y: (
|
|
679
|
+
x: (b + g) / 2,
|
|
680
|
+
y: (D + x) / 2 - 5,
|
|
750
681
|
textAnchor: "middle",
|
|
751
682
|
fontSize: "11",
|
|
752
683
|
fill: "var(--nice-text-secondary, #64748b)",
|
|
@@ -756,8 +687,8 @@ const ot = ({
|
|
|
756
687
|
e.conditionExpression && /* @__PURE__ */ a(
|
|
757
688
|
"text",
|
|
758
689
|
{
|
|
759
|
-
x: (
|
|
760
|
-
y: (
|
|
690
|
+
x: (b + g) / 2,
|
|
691
|
+
y: (D + x) / 2 + 10,
|
|
761
692
|
textAnchor: "middle",
|
|
762
693
|
fontSize: "10",
|
|
763
694
|
fill: "var(--nice-text-muted, #94a3b8)",
|
|
@@ -771,13 +702,13 @@ const ot = ({
|
|
|
771
702
|
)
|
|
772
703
|
] }, e.id);
|
|
773
704
|
}),
|
|
774
|
-
|
|
705
|
+
_ && /* @__PURE__ */ n(
|
|
775
706
|
"line",
|
|
776
707
|
{
|
|
777
|
-
x1:
|
|
778
|
-
y1:
|
|
779
|
-
x2:
|
|
780
|
-
y2:
|
|
708
|
+
x1: t.elements.find((e) => e.id === _.fromId)?.position.x || 0,
|
|
709
|
+
y1: t.elements.find((e) => e.id === _.fromId)?.position.y || 0,
|
|
710
|
+
x2: t.elements.find((e) => e.id === _.fromId)?.position.x || 0,
|
|
711
|
+
y2: t.elements.find((e) => e.id === _.fromId)?.position.y || 0,
|
|
781
712
|
stroke: "var(--nice-color-primary, #3b82f6)",
|
|
782
713
|
strokeWidth: "2",
|
|
783
714
|
strokeDasharray: "5,5"
|
|
@@ -785,182 +716,182 @@ const ot = ({
|
|
|
785
716
|
)
|
|
786
717
|
]
|
|
787
718
|
}
|
|
788
|
-
), [
|
|
719
|
+
), [t.sequenceFlows, t.elements, R, _]), Ae = w ? /* @__PURE__ */ a(
|
|
789
720
|
"div",
|
|
790
721
|
{
|
|
791
|
-
ref:
|
|
722
|
+
ref: be,
|
|
792
723
|
className: "nice-bpmn-designer__toolbar",
|
|
793
724
|
role: "toolbar",
|
|
794
|
-
"aria-label":
|
|
725
|
+
"aria-label": i("workflowDesigner.bpmnToolbar", "BPMN designer toolbar"),
|
|
795
726
|
children: [
|
|
796
727
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__toolbar-group", children: [
|
|
797
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ n(
|
|
798
729
|
"button",
|
|
799
730
|
{
|
|
800
731
|
type: "button",
|
|
801
|
-
onClick: () =>
|
|
802
|
-
title:
|
|
803
|
-
"aria-label":
|
|
804
|
-
children: /* @__PURE__ */
|
|
732
|
+
onClick: () => G((e) => Math.min(e + 0.1, 2)),
|
|
733
|
+
title: i("workflowDesigner.zoomIn", "Zoom in"),
|
|
734
|
+
"aria-label": i("workflowDesigner.zoomIn", "Zoom in"),
|
|
735
|
+
children: /* @__PURE__ */ n(p, { name: "plus", size: 14 })
|
|
805
736
|
}
|
|
806
737
|
),
|
|
807
738
|
/* @__PURE__ */ a("span", { className: "nice-bpmn-designer__zoom-label", children: [
|
|
808
|
-
Math.round(
|
|
739
|
+
Math.round(T * 100),
|
|
809
740
|
"%"
|
|
810
741
|
] }),
|
|
811
|
-
/* @__PURE__ */
|
|
742
|
+
/* @__PURE__ */ n(
|
|
812
743
|
"button",
|
|
813
744
|
{
|
|
814
745
|
type: "button",
|
|
815
|
-
onClick: () =>
|
|
816
|
-
title:
|
|
817
|
-
"aria-label":
|
|
818
|
-
children: /* @__PURE__ */
|
|
746
|
+
onClick: () => G((e) => Math.max(e - 0.1, 0.5)),
|
|
747
|
+
title: i("workflowDesigner.zoomOut", "Zoom out"),
|
|
748
|
+
"aria-label": i("workflowDesigner.zoomOut", "Zoom out"),
|
|
749
|
+
children: /* @__PURE__ */ n(p, { name: "minus", size: 14 })
|
|
819
750
|
}
|
|
820
751
|
),
|
|
821
|
-
/* @__PURE__ */
|
|
752
|
+
/* @__PURE__ */ n(
|
|
822
753
|
"button",
|
|
823
754
|
{
|
|
824
755
|
type: "button",
|
|
825
756
|
onClick: () => {
|
|
826
|
-
|
|
757
|
+
G(1), U({ x: 0, y: 0 });
|
|
827
758
|
},
|
|
828
|
-
title:
|
|
829
|
-
"aria-label":
|
|
830
|
-
children: /* @__PURE__ */
|
|
759
|
+
title: i("workflowDesigner.resetView", "Reset view"),
|
|
760
|
+
"aria-label": i("workflowDesigner.resetView", "Reset view"),
|
|
761
|
+
children: /* @__PURE__ */ n(p, { name: "refresh", size: 14 })
|
|
831
762
|
}
|
|
832
763
|
)
|
|
833
764
|
] }),
|
|
834
765
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__toolbar-group", children: [
|
|
835
|
-
!
|
|
766
|
+
!o && /* @__PURE__ */ a(M, { children: [
|
|
836
767
|
/* @__PURE__ */ a(
|
|
837
768
|
"button",
|
|
838
769
|
{
|
|
839
770
|
type: "button",
|
|
840
771
|
onClick: Re,
|
|
841
|
-
disabled:
|
|
842
|
-
title:
|
|
772
|
+
disabled: Q.length > 0 || $,
|
|
773
|
+
title: i("workflowDesigner.simulateFlow", "Simulate flow"),
|
|
843
774
|
children: [
|
|
844
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ n(p, { name: "play", size: 14 }),
|
|
845
776
|
" ",
|
|
846
|
-
|
|
777
|
+
i("workflowDesigner.simulate", "Simulate")
|
|
847
778
|
]
|
|
848
779
|
}
|
|
849
780
|
),
|
|
850
|
-
|
|
781
|
+
$ && /* @__PURE__ */ a(
|
|
851
782
|
"button",
|
|
852
783
|
{
|
|
853
784
|
type: "button",
|
|
854
785
|
onClick: () => {
|
|
855
|
-
|
|
786
|
+
ue(!1), O(null);
|
|
856
787
|
},
|
|
857
788
|
children: [
|
|
858
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ n(p, { name: "stop", size: 14 }),
|
|
859
790
|
" ",
|
|
860
|
-
|
|
791
|
+
i("workflowDesigner.stop", "Stop")
|
|
861
792
|
]
|
|
862
793
|
}
|
|
863
794
|
)
|
|
864
795
|
] }),
|
|
865
|
-
|
|
796
|
+
le && /* @__PURE__ */ a(
|
|
866
797
|
"button",
|
|
867
798
|
{
|
|
868
799
|
type: "button",
|
|
869
|
-
onClick: () =>
|
|
870
|
-
title:
|
|
800
|
+
onClick: () => le(t),
|
|
801
|
+
title: i("workflowDesigner.testProcess", "Test process"),
|
|
871
802
|
children: [
|
|
872
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ n(p, { name: "flask", size: 14 }),
|
|
873
804
|
" ",
|
|
874
|
-
|
|
805
|
+
i("workflowDesigner.test", "Test")
|
|
875
806
|
]
|
|
876
807
|
}
|
|
877
808
|
),
|
|
878
|
-
|
|
809
|
+
re && !o && /* @__PURE__ */ a(
|
|
879
810
|
"button",
|
|
880
811
|
{
|
|
881
812
|
type: "button",
|
|
882
|
-
onClick: () =>
|
|
883
|
-
disabled:
|
|
884
|
-
title:
|
|
813
|
+
onClick: () => re(t),
|
|
814
|
+
disabled: Q.length > 0,
|
|
815
|
+
title: i("workflowDesigner.publishProcess", "Publish process"),
|
|
885
816
|
children: [
|
|
886
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ n(p, { name: "rocket", size: 14 }),
|
|
887
818
|
" ",
|
|
888
|
-
|
|
819
|
+
i("workflowDesigner.publish", "Publish")
|
|
889
820
|
]
|
|
890
821
|
}
|
|
891
822
|
),
|
|
892
|
-
|
|
823
|
+
oe && /* @__PURE__ */ a(
|
|
893
824
|
"button",
|
|
894
825
|
{
|
|
895
826
|
type: "button",
|
|
896
|
-
onClick: () =>
|
|
897
|
-
title:
|
|
827
|
+
onClick: () => oe("<bpmn>"),
|
|
828
|
+
title: i("workflowDesigner.exportBpmn", "Export BPMN XML"),
|
|
898
829
|
children: [
|
|
899
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ n(p, { name: "upload", size: 14 }),
|
|
900
831
|
" ",
|
|
901
|
-
|
|
832
|
+
i("workflowDesigner.export", "Export")
|
|
902
833
|
]
|
|
903
834
|
}
|
|
904
835
|
),
|
|
905
|
-
|
|
836
|
+
ce && !o && /* @__PURE__ */ a(
|
|
906
837
|
"button",
|
|
907
838
|
{
|
|
908
839
|
type: "button",
|
|
909
|
-
onClick:
|
|
910
|
-
title:
|
|
840
|
+
onClick: ce,
|
|
841
|
+
title: i("workflowDesigner.importBpmn", "Import BPMN XML"),
|
|
911
842
|
children: [
|
|
912
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ n(p, { name: "download", size: 14 }),
|
|
913
844
|
" ",
|
|
914
|
-
|
|
845
|
+
i("workflowDesigner.import", "Import")
|
|
915
846
|
]
|
|
916
847
|
}
|
|
917
848
|
)
|
|
918
849
|
] })
|
|
919
850
|
]
|
|
920
851
|
}
|
|
921
|
-
) : void 0,
|
|
852
|
+
) : void 0, qe = N && !o ? /* @__PURE__ */ a(
|
|
922
853
|
"aside",
|
|
923
854
|
{
|
|
924
855
|
className: "nice-bpmn-designer__palette",
|
|
925
|
-
"aria-label":
|
|
856
|
+
"aria-label": i("workflowDesigner.palette", "BPMN element palette"),
|
|
926
857
|
children: [
|
|
927
|
-
/* @__PURE__ */
|
|
858
|
+
/* @__PURE__ */ n("div", { className: "nice-bpmn-designer__palette-tabs", ref: de, role: "tablist", children: ["events", "tasks", "gateways", "subprocesses", "artifacts"].map((e) => /* @__PURE__ */ n(
|
|
928
859
|
"button",
|
|
929
860
|
{
|
|
930
861
|
type: "button",
|
|
931
862
|
role: "tab",
|
|
932
|
-
"aria-selected":
|
|
933
|
-
className: `nice-bpmn-designer__palette-tab${
|
|
934
|
-
onClick: () =>
|
|
935
|
-
"aria-label":
|
|
936
|
-
title:
|
|
937
|
-
children: /* @__PURE__ */
|
|
863
|
+
"aria-selected": H === e,
|
|
864
|
+
className: `nice-bpmn-designer__palette-tab${H === e ? " nice-bpmn-designer__palette-tab--active" : ""}`,
|
|
865
|
+
onClick: () => Ee(e),
|
|
866
|
+
"aria-label": i(`workflowDesigner.cat.${e}`, ve[e]),
|
|
867
|
+
title: i(`workflowDesigner.cat.${e}`, ve[e]),
|
|
868
|
+
children: /* @__PURE__ */ n(p, { name: Ke[e], size: 16 })
|
|
938
869
|
},
|
|
939
870
|
e
|
|
940
871
|
)) }),
|
|
941
|
-
/* @__PURE__ */
|
|
872
|
+
/* @__PURE__ */ n(
|
|
942
873
|
"div",
|
|
943
874
|
{
|
|
944
|
-
ref:
|
|
875
|
+
ref: ge,
|
|
945
876
|
className: "nice-bpmn-designer__palette-items",
|
|
946
877
|
role: "listbox",
|
|
947
|
-
"aria-label":
|
|
948
|
-
children:
|
|
878
|
+
"aria-label": i("workflowDesigner.palette", "BPMN element palette"),
|
|
879
|
+
children: Pe.map((e) => /* @__PURE__ */ a(
|
|
949
880
|
"div",
|
|
950
881
|
{
|
|
951
882
|
className: "nice-bpmn-designer__palette-item",
|
|
952
883
|
draggable: !0,
|
|
953
|
-
onDragStart: () =>
|
|
954
|
-
onDragEnd: () =>
|
|
955
|
-
onKeyDown: (
|
|
956
|
-
(
|
|
884
|
+
onDragStart: () => W(e),
|
|
885
|
+
onDragEnd: () => W(null),
|
|
886
|
+
onKeyDown: (s) => {
|
|
887
|
+
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), Ce(e));
|
|
957
888
|
},
|
|
958
889
|
role: "option",
|
|
959
890
|
"aria-selected": !1,
|
|
960
891
|
"aria-label": e.label,
|
|
961
892
|
children: [
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ n("span", { className: "nice-bpmn-designer__palette-icon", children: /* @__PURE__ */ n(p, { name: e.icon, size: 16 }) }),
|
|
894
|
+
/* @__PURE__ */ n("span", { className: "nice-bpmn-designer__palette-label", children: e.label })
|
|
964
895
|
]
|
|
965
896
|
},
|
|
966
897
|
e.id
|
|
@@ -969,89 +900,89 @@ const ot = ({
|
|
|
969
900
|
)
|
|
970
901
|
]
|
|
971
902
|
}
|
|
972
|
-
) : void 0,
|
|
973
|
-
|
|
903
|
+
) : void 0, ye = A && (m || k) && !o, Ie = ye || se ? /* @__PURE__ */ a("div", { style: { display: "flex", height: "100%", minHeight: 0 }, children: [
|
|
904
|
+
ye && /* @__PURE__ */ a(
|
|
974
905
|
"aside",
|
|
975
906
|
{
|
|
976
907
|
className: "nice-bpmn-designer__properties",
|
|
977
|
-
"aria-label":
|
|
908
|
+
"aria-label": i("workflowDesigner.properties", "Properties"),
|
|
978
909
|
children: [
|
|
979
|
-
|
|
980
|
-
/* @__PURE__ */
|
|
910
|
+
m && /* @__PURE__ */ a(M, { children: [
|
|
911
|
+
/* @__PURE__ */ n("h3", { children: i("workflowDesigner.propertiesOf", "Properties: {name}").replace(
|
|
981
912
|
"{name}",
|
|
982
|
-
|
|
913
|
+
m.name || m.id
|
|
983
914
|
) }),
|
|
984
915
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ n("label", { htmlFor: "prop-name", children: i("workflowDesigner.name", "Name") }),
|
|
917
|
+
/* @__PURE__ */ n(
|
|
987
918
|
"input",
|
|
988
919
|
{
|
|
989
920
|
id: "prop-name",
|
|
990
921
|
type: "text",
|
|
991
|
-
value:
|
|
992
|
-
onChange: (e) =>
|
|
922
|
+
value: m.name || "",
|
|
923
|
+
onChange: (e) => P(m.id, {
|
|
993
924
|
name: e.target.value
|
|
994
925
|
})
|
|
995
926
|
}
|
|
996
927
|
)
|
|
997
928
|
] }),
|
|
998
|
-
|
|
929
|
+
m.elementType === "task" && /* @__PURE__ */ a(M, { children: [
|
|
999
930
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
1000
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ n("label", { htmlFor: "prop-assignee", children: i("workflowDesigner.assignee", "Assigned to") }),
|
|
1001
932
|
/* @__PURE__ */ a(
|
|
1002
933
|
"select",
|
|
1003
934
|
{
|
|
1004
935
|
id: "prop-assignee",
|
|
1005
|
-
value:
|
|
1006
|
-
onChange: (e) =>
|
|
936
|
+
value: m.assignee || "",
|
|
937
|
+
onChange: (e) => P(m.id, {
|
|
1007
938
|
assignee: e.target.value
|
|
1008
939
|
}),
|
|
1009
940
|
children: [
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
|
|
941
|
+
/* @__PURE__ */ n("option", { value: "", children: i("workflowDesigner.select", "— Select —") }),
|
|
942
|
+
f.map((e) => /* @__PURE__ */ n("option", { value: e.id, children: e.name }, e.id))
|
|
1012
943
|
]
|
|
1013
944
|
}
|
|
1014
945
|
)
|
|
1015
946
|
] }),
|
|
1016
947
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ n("label", { htmlFor: "prop-dueDate", children: i("workflowDesigner.dueDate", "Due date") }),
|
|
949
|
+
/* @__PURE__ */ n(
|
|
1019
950
|
"input",
|
|
1020
951
|
{
|
|
1021
952
|
id: "prop-dueDate",
|
|
1022
953
|
type: "text",
|
|
1023
|
-
placeholder:
|
|
1024
|
-
value:
|
|
1025
|
-
onChange: (e) =>
|
|
954
|
+
placeholder: i("workflowDesigner.dueDatePlaceholder", "P3D (3 days)"),
|
|
955
|
+
value: m.dueDate || "",
|
|
956
|
+
onChange: (e) => P(m.id, {
|
|
1026
957
|
dueDate: e.target.value
|
|
1027
958
|
})
|
|
1028
959
|
}
|
|
1029
960
|
)
|
|
1030
961
|
] }),
|
|
1031
962
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ n("label", { htmlFor: "prop-priority", children: i("workflowDesigner.priority", "Priority") }),
|
|
964
|
+
/* @__PURE__ */ n(
|
|
1034
965
|
"input",
|
|
1035
966
|
{
|
|
1036
967
|
id: "prop-priority",
|
|
1037
968
|
type: "number",
|
|
1038
969
|
min: "0",
|
|
1039
970
|
max: "100",
|
|
1040
|
-
value:
|
|
1041
|
-
onChange: (e) =>
|
|
971
|
+
value: m.priority || 50,
|
|
972
|
+
onChange: (e) => P(m.id, {
|
|
1042
973
|
priority: parseInt(e.target.value)
|
|
1043
974
|
})
|
|
1044
975
|
}
|
|
1045
976
|
)
|
|
1046
977
|
] }),
|
|
1047
978
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ n("label", { htmlFor: "prop-documentation", children: i("workflowDesigner.documentation", "Documentation") }),
|
|
980
|
+
/* @__PURE__ */ n(
|
|
1050
981
|
"textarea",
|
|
1051
982
|
{
|
|
1052
983
|
id: "prop-documentation",
|
|
1053
|
-
value:
|
|
1054
|
-
onChange: (e) =>
|
|
984
|
+
value: m.documentation || "",
|
|
985
|
+
onChange: (e) => P(m.id, {
|
|
1055
986
|
documentation: e.target.value
|
|
1056
987
|
}),
|
|
1057
988
|
rows: 3
|
|
@@ -1059,93 +990,93 @@ const ot = ({
|
|
|
1059
990
|
)
|
|
1060
991
|
] })
|
|
1061
992
|
] }),
|
|
1062
|
-
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
/* @__PURE__ */
|
|
993
|
+
m.elementType === "event" && m.eventDefinition === "timer" && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
994
|
+
/* @__PURE__ */ n("label", { htmlFor: "prop-timer", children: i("workflowDesigner.timer", "Timer (ISO 8601)") }),
|
|
995
|
+
/* @__PURE__ */ n(
|
|
1065
996
|
"input",
|
|
1066
997
|
{
|
|
1067
998
|
id: "prop-timer",
|
|
1068
999
|
type: "text",
|
|
1069
|
-
placeholder:
|
|
1000
|
+
placeholder: i(
|
|
1070
1001
|
"workflowDesigner.timerPlaceholder",
|
|
1071
1002
|
"PT1H (1 hour) or R3/PT1H (3 repetitions)"
|
|
1072
1003
|
),
|
|
1073
|
-
value:
|
|
1074
|
-
onChange: (e) =>
|
|
1004
|
+
value: m.timerDefinition?.expression || "",
|
|
1005
|
+
onChange: (e) => P(m.id, {
|
|
1075
1006
|
timerDefinition: { type: "duration", expression: e.target.value }
|
|
1076
1007
|
})
|
|
1077
1008
|
}
|
|
1078
1009
|
)
|
|
1079
1010
|
] }),
|
|
1080
|
-
|
|
1081
|
-
/* @__PURE__ */
|
|
1011
|
+
m.elementType === "gateway" && m.gatewayType === "exclusiveGateway" && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
1012
|
+
/* @__PURE__ */ n("label", { htmlFor: "prop-default", children: i("workflowDesigner.defaultFlow", "Default flow") }),
|
|
1082
1013
|
/* @__PURE__ */ a(
|
|
1083
1014
|
"select",
|
|
1084
1015
|
{
|
|
1085
1016
|
id: "prop-default",
|
|
1086
|
-
value:
|
|
1087
|
-
onChange: (e) =>
|
|
1017
|
+
value: m.defaultFlow || "",
|
|
1018
|
+
onChange: (e) => P(m.id, {
|
|
1088
1019
|
defaultFlow: e.target.value
|
|
1089
1020
|
}),
|
|
1090
1021
|
children: [
|
|
1091
|
-
/* @__PURE__ */
|
|
1092
|
-
|
|
1022
|
+
/* @__PURE__ */ n("option", { value: "", children: i("workflowDesigner.select", "— Select —") }),
|
|
1023
|
+
t.sequenceFlows.filter((e) => e.sourceRef === m.id).map((e) => /* @__PURE__ */ n("option", { value: e.id, children: e.name || e.id }, e.id))
|
|
1093
1024
|
]
|
|
1094
1025
|
}
|
|
1095
1026
|
)
|
|
1096
1027
|
] })
|
|
1097
1028
|
] }),
|
|
1098
|
-
|
|
1099
|
-
/* @__PURE__ */
|
|
1029
|
+
k && /* @__PURE__ */ a(M, { children: [
|
|
1030
|
+
/* @__PURE__ */ n("h3", { children: i("workflowDesigner.flowOf", "Flow: {name}").replace(
|
|
1100
1031
|
"{name}",
|
|
1101
|
-
|
|
1032
|
+
k.name || k.id
|
|
1102
1033
|
) }),
|
|
1103
1034
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ n("label", { htmlFor: "flow-name", children: i("workflowDesigner.name", "Name") }),
|
|
1036
|
+
/* @__PURE__ */ n(
|
|
1106
1037
|
"input",
|
|
1107
1038
|
{
|
|
1108
1039
|
id: "flow-name",
|
|
1109
1040
|
type: "text",
|
|
1110
|
-
value:
|
|
1111
|
-
onChange: (e) =>
|
|
1041
|
+
value: k.name || "",
|
|
1042
|
+
onChange: (e) => te(k.id, { name: e.target.value })
|
|
1112
1043
|
}
|
|
1113
1044
|
)
|
|
1114
1045
|
] }),
|
|
1115
1046
|
/* @__PURE__ */ a("div", { className: "nice-bpmn-designer__property", children: [
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ n("label", { htmlFor: "flow-condition", children: i("workflowDesigner.condition", "Condition") }),
|
|
1048
|
+
/* @__PURE__ */ n(
|
|
1118
1049
|
"input",
|
|
1119
1050
|
{
|
|
1120
1051
|
id: "flow-condition",
|
|
1121
1052
|
type: "text",
|
|
1122
1053
|
placeholder: "${amount > 1000}",
|
|
1123
|
-
value:
|
|
1124
|
-
onChange: (e) =>
|
|
1054
|
+
value: k.conditionExpression || "",
|
|
1055
|
+
onChange: (e) => te(k.id, { conditionExpression: e.target.value })
|
|
1125
1056
|
}
|
|
1126
1057
|
)
|
|
1127
1058
|
] }),
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ n("div", { className: "nice-bpmn-designer__property", children: /* @__PURE__ */ a("label", { children: [
|
|
1060
|
+
/* @__PURE__ */ n(
|
|
1130
1061
|
"input",
|
|
1131
1062
|
{
|
|
1132
1063
|
type: "checkbox",
|
|
1133
|
-
checked:
|
|
1134
|
-
onChange: (e) =>
|
|
1064
|
+
checked: k.isDefault || !1,
|
|
1065
|
+
onChange: (e) => te(k.id, { isDefault: e.target.checked })
|
|
1135
1066
|
}
|
|
1136
1067
|
),
|
|
1137
|
-
|
|
1068
|
+
i("workflowDesigner.defaultFlow", "Default flow")
|
|
1138
1069
|
] }) }),
|
|
1139
1070
|
/* @__PURE__ */ a(
|
|
1140
1071
|
"button",
|
|
1141
1072
|
{
|
|
1142
1073
|
type: "button",
|
|
1143
1074
|
className: "nice-bpmn-designer__delete-flow",
|
|
1144
|
-
onClick: () =>
|
|
1075
|
+
onClick: () => Se(k.id),
|
|
1145
1076
|
children: [
|
|
1146
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ n(p, { name: "trash", size: 14 }),
|
|
1147
1078
|
" ",
|
|
1148
|
-
|
|
1079
|
+
i("workflowDesigner.deleteFlow", "Delete flow")
|
|
1149
1080
|
]
|
|
1150
1081
|
}
|
|
1151
1082
|
)
|
|
@@ -1153,83 +1084,83 @@ const ot = ({
|
|
|
1153
1084
|
]
|
|
1154
1085
|
}
|
|
1155
1086
|
),
|
|
1156
|
-
|
|
1087
|
+
se && /* @__PURE__ */ a(
|
|
1157
1088
|
"aside",
|
|
1158
1089
|
{
|
|
1159
1090
|
className: "nice-bpmn-designer__variables",
|
|
1160
|
-
"aria-label":
|
|
1091
|
+
"aria-label": i("workflowDesigner.variables", "Process variables"),
|
|
1161
1092
|
children: [
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ n("h3", { children: i("workflowDesigner.variables", "Process variables") }),
|
|
1094
|
+
/* @__PURE__ */ n("ul", { className: "nice-bpmn-designer__variable-list", children: (t.variables || []).map((e) => /* @__PURE__ */ a("li", { className: "nice-bpmn-designer__variable-item", children: [
|
|
1095
|
+
/* @__PURE__ */ n("span", { className: "nice-bpmn-designer__variable-name", children: e.name }),
|
|
1096
|
+
/* @__PURE__ */ n("span", { className: "nice-bpmn-designer__variable-type", children: e.type })
|
|
1166
1097
|
] }, e.id)) }),
|
|
1167
|
-
!
|
|
1098
|
+
!o && /* @__PURE__ */ a("button", { type: "button", onClick: ze, children: [
|
|
1168
1099
|
"+ ",
|
|
1169
|
-
|
|
1100
|
+
i("workflowDesigner.addVariable", "Add variable")
|
|
1170
1101
|
] })
|
|
1171
1102
|
]
|
|
1172
1103
|
}
|
|
1173
1104
|
)
|
|
1174
1105
|
] }) : void 0;
|
|
1175
|
-
return /* @__PURE__ */
|
|
1176
|
-
|
|
1106
|
+
return /* @__PURE__ */ n(
|
|
1107
|
+
Ye,
|
|
1177
1108
|
{
|
|
1178
1109
|
flush: !0,
|
|
1179
|
-
className: `nice-bpmn-designer${
|
|
1180
|
-
style:
|
|
1181
|
-
"data-testid":
|
|
1182
|
-
toolbar:
|
|
1183
|
-
sidebar:
|
|
1184
|
-
rightSidebar:
|
|
1185
|
-
bottomPanel:
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
-
|
|
1110
|
+
className: `nice-bpmn-designer${o ? " nice-bpmn-designer--readonly" : ""} ${Te ?? ""}`,
|
|
1111
|
+
style: De,
|
|
1112
|
+
"data-testid": xe,
|
|
1113
|
+
toolbar: Ae,
|
|
1114
|
+
sidebar: qe,
|
|
1115
|
+
rightSidebar: Ie,
|
|
1116
|
+
bottomPanel: $ ? /* @__PURE__ */ n("div", { className: "nice-bpmn-designer__simulation-bar", children: /* @__PURE__ */ a("span", { children: [
|
|
1117
|
+
/* @__PURE__ */ n(p, { name: "video", size: 14 }),
|
|
1118
|
+
i("workflowDesigner.simActiveElement", "Simulation active — current element:"),
|
|
1188
1119
|
" ",
|
|
1189
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ n("strong", { children: t.elements.find((e) => e.id === X)?.name || X })
|
|
1190
1121
|
] }) }) : void 0,
|
|
1191
1122
|
children: /* @__PURE__ */ a("div", { style: { position: "relative", height: "100%", overflow: "hidden" }, children: [
|
|
1192
1123
|
/* @__PURE__ */ a(
|
|
1193
1124
|
"div",
|
|
1194
1125
|
{
|
|
1195
|
-
className: `nice-bpmn-designer__canvas${
|
|
1126
|
+
className: `nice-bpmn-designer__canvas${J ? " nice-bpmn-designer__canvas--panning" : ""}`,
|
|
1196
1127
|
onDragOver: (e) => e.preventDefault(),
|
|
1197
1128
|
onDrop: Fe,
|
|
1198
1129
|
onClick: () => {
|
|
1199
|
-
|
|
1130
|
+
z(null), B(null), Z(null);
|
|
1200
1131
|
},
|
|
1201
1132
|
onWheel: (e) => {
|
|
1202
1133
|
if (e.ctrlKey || e.metaKey) {
|
|
1203
1134
|
e.preventDefault();
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1135
|
+
const u = -e.deltaY * 15e-4;
|
|
1136
|
+
G((b) => Math.max(0.25, Math.min(3, b + u)));
|
|
1206
1137
|
return;
|
|
1207
1138
|
}
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1139
|
+
const s = e.shiftKey ? e.deltaY : e.deltaX, r = e.shiftKey ? 0 : e.deltaY;
|
|
1140
|
+
U((u) => ({ x: u.x - s, y: u.y - r }));
|
|
1210
1141
|
},
|
|
1211
1142
|
onPointerDown: (e) => {
|
|
1212
|
-
(e.button === 1 || e.button === 0 && e.altKey) && (e.preventDefault(), pe(!0),
|
|
1143
|
+
(e.button === 1 || e.button === 0 && e.altKey) && (e.preventDefault(), pe(!0), Y.current = {
|
|
1213
1144
|
x: e.clientX,
|
|
1214
1145
|
y: e.clientY,
|
|
1215
|
-
offX:
|
|
1216
|
-
offY:
|
|
1146
|
+
offX: h.x,
|
|
1147
|
+
offY: h.y
|
|
1217
1148
|
}, e.currentTarget.setPointerCapture(e.pointerId));
|
|
1218
1149
|
},
|
|
1219
1150
|
onPointerMove: (e) => {
|
|
1220
|
-
if (!
|
|
1151
|
+
if (!J || !Y.current)
|
|
1221
1152
|
return;
|
|
1222
|
-
const { x:
|
|
1223
|
-
|
|
1153
|
+
const { x: s, y: r, offX: u, offY: b } = Y.current;
|
|
1154
|
+
U({ x: u + (e.clientX - s), y: b + (e.clientY - r) });
|
|
1224
1155
|
},
|
|
1225
1156
|
onPointerUp: (e) => {
|
|
1226
|
-
|
|
1157
|
+
J && (pe(!1), Y.current = null, e.currentTarget.releasePointerCapture(e.pointerId));
|
|
1227
1158
|
},
|
|
1228
1159
|
role: "application",
|
|
1229
|
-
"aria-label":
|
|
1160
|
+
"aria-label": i("workflowDesigner.bpmnCanvas", "BPMN canvas"),
|
|
1230
1161
|
style: {
|
|
1231
|
-
backgroundSize: `${
|
|
1232
|
-
backgroundPosition: `${
|
|
1162
|
+
backgroundSize: `${C * T}px ${C * T}px`,
|
|
1163
|
+
backgroundPosition: `${h.x}px ${h.y}px`
|
|
1233
1164
|
},
|
|
1234
1165
|
children: [
|
|
1235
1166
|
/* @__PURE__ */ a(
|
|
@@ -1237,29 +1168,29 @@ const ot = ({
|
|
|
1237
1168
|
{
|
|
1238
1169
|
className: "nice-bpmn-designer__canvas-content",
|
|
1239
1170
|
style: {
|
|
1240
|
-
transform: `translate(${
|
|
1171
|
+
transform: `translate(${h.x}px, ${h.y}px) scale(${T})`,
|
|
1241
1172
|
transformOrigin: "0 0"
|
|
1242
1173
|
},
|
|
1243
1174
|
children: [
|
|
1244
|
-
|
|
1245
|
-
|
|
1175
|
+
Me(),
|
|
1176
|
+
t.elements.map($e)
|
|
1246
1177
|
]
|
|
1247
1178
|
}
|
|
1248
1179
|
),
|
|
1249
|
-
|
|
1180
|
+
_ && /* @__PURE__ */ n("div", { className: "nice-bpmn-designer__connect-hint", children: i(
|
|
1250
1181
|
"workflowDesigner.connectHint",
|
|
1251
1182
|
"Click a target element to connect, or click empty space to cancel"
|
|
1252
1183
|
) })
|
|
1253
1184
|
]
|
|
1254
1185
|
}
|
|
1255
1186
|
),
|
|
1256
|
-
d && /* @__PURE__ */
|
|
1187
|
+
d && /* @__PURE__ */ n(
|
|
1257
1188
|
"div",
|
|
1258
1189
|
{
|
|
1259
1190
|
className: "nice-bpmn-designer__minimap",
|
|
1260
|
-
"aria-label":
|
|
1191
|
+
"aria-label": i("workflowDesigner.minimap", "Minimap"),
|
|
1261
1192
|
"aria-hidden": "true",
|
|
1262
|
-
children:
|
|
1193
|
+
children: t.elements.map((e) => /* @__PURE__ */ n(
|
|
1263
1194
|
"div",
|
|
1264
1195
|
{
|
|
1265
1196
|
className: `nice-bpmn-designer__minimap-dot nice-bpmn-designer__minimap-dot--${e.elementType}`,
|
|
@@ -1272,399 +1203,22 @@ const ot = ({
|
|
|
1272
1203
|
))
|
|
1273
1204
|
}
|
|
1274
1205
|
),
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
/* @__PURE__ */
|
|
1206
|
+
F && q.length > 0 && /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__validation", role: "status", "aria-live": "polite", children: [
|
|
1207
|
+
Q.map((e, s) => /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__issue nice-bpmn-designer__issue--error", children: [
|
|
1208
|
+
/* @__PURE__ */ n(p, { name: "error", size: 14 }),
|
|
1278
1209
|
" ",
|
|
1279
1210
|
e.message
|
|
1280
|
-
] },
|
|
1281
|
-
|
|
1282
|
-
/* @__PURE__ */
|
|
1211
|
+
] }, s)),
|
|
1212
|
+
Ne.map((e, s) => /* @__PURE__ */ a("div", { className: "nice-bpmn-designer__issue nice-bpmn-designer__issue--warning", children: [
|
|
1213
|
+
/* @__PURE__ */ n(p, { name: "warning", size: 14 }),
|
|
1283
1214
|
" ",
|
|
1284
1215
|
e.message
|
|
1285
|
-
] },
|
|
1216
|
+
] }, s))
|
|
1286
1217
|
] })
|
|
1287
1218
|
] })
|
|
1288
1219
|
}
|
|
1289
1220
|
);
|
|
1290
|
-
}, st = ({
|
|
1291
|
-
workflow: i,
|
|
1292
|
-
nodes: c,
|
|
1293
|
-
edges: b,
|
|
1294
|
-
onChange: H,
|
|
1295
|
-
readOnly: m = !1,
|
|
1296
|
-
showMinimap: d = !0,
|
|
1297
|
-
showToolbar: D = !0,
|
|
1298
|
-
showValidation: P = !0,
|
|
1299
|
-
onTest: N,
|
|
1300
|
-
onPublish: K,
|
|
1301
|
-
tutorial: de,
|
|
1302
|
-
className: R,
|
|
1303
|
-
style: J,
|
|
1304
|
-
"data-testid": me
|
|
1305
|
-
}) => {
|
|
1306
|
-
const { t: ae } = we(), { t: h } = we(), oe = Z(null);
|
|
1307
|
-
fe(oe, { orientation: "horizontal", itemSelector: "button" });
|
|
1308
|
-
const y = ce(() => {
|
|
1309
|
-
if (i)
|
|
1310
|
-
return i;
|
|
1311
|
-
const n = (c ?? []).map((r) => ({
|
|
1312
|
-
id: r.id,
|
|
1313
|
-
name: r.name ?? r.label ?? r.id,
|
|
1314
|
-
type: r.type === "start" ? "initial" : r.type === "end" ? "final" : r.type ?? "intermediate",
|
|
1315
|
-
position: { x: r.x ?? 0, y: r.y ?? 0 }
|
|
1316
|
-
})), s = (b ?? []).map((r, k) => ({
|
|
1317
|
-
id: r.id ?? `t${k}`,
|
|
1318
|
-
fromStateId: r.fromStateId ?? r.from ?? r.source,
|
|
1319
|
-
toStateId: r.toStateId ?? r.to ?? r.target,
|
|
1320
|
-
name: r.name ?? r.label ?? ""
|
|
1321
|
-
}));
|
|
1322
|
-
return {
|
|
1323
|
-
id: "workflow",
|
|
1324
|
-
name: "Workflow",
|
|
1325
|
-
entityType: "generic",
|
|
1326
|
-
version: 1,
|
|
1327
|
-
states: n,
|
|
1328
|
-
transitions: s
|
|
1329
|
-
};
|
|
1330
|
-
}, [i, c, b]), [se, B] = S(null), [W, O] = S(null), [o, L] = S(!1), G = Z(null), I = Z(
|
|
1331
|
-
null
|
|
1332
|
-
), [Q, j] = S(!1);
|
|
1333
|
-
We(() => {
|
|
1334
|
-
const n = G.current, s = o && W ? [...n?.querySelectorAll("[data-state-id]") ?? []].find(
|
|
1335
|
-
(C) => C.dataset.stateId === W
|
|
1336
|
-
) : null;
|
|
1337
|
-
if (!n || !s)
|
|
1338
|
-
return;
|
|
1339
|
-
const r = 24, { offsetLeft: k, offsetTop: w, offsetWidth: $, offsetHeight: g } = s;
|
|
1340
|
-
k - r < n.scrollLeft ? n.scrollLeft = k - r : k + $ + r > n.scrollLeft + n.clientWidth && (n.scrollLeft = k + $ + r - n.clientWidth), w - r < n.scrollTop ? n.scrollTop = w - r : w + g + r > n.scrollTop + n.clientHeight && (n.scrollTop = w + g + r - n.clientHeight);
|
|
1341
|
-
}, [o, W]);
|
|
1342
|
-
const U = P ? je(y, h) : [], E = U.filter((n) => n.type === "error"), le = U.filter((n) => n.type === "warning"), x = y.states.find((n) => n.id === se), ee = (n) => {
|
|
1343
|
-
if (m)
|
|
1344
|
-
return;
|
|
1345
|
-
const s = `state-${Date.now()}`, r = {
|
|
1346
|
-
id: s,
|
|
1347
|
-
name: h("workflowDesigner.newState", "New state"),
|
|
1348
|
-
type: n,
|
|
1349
|
-
position: { x: 200, y: 200 }
|
|
1350
|
-
};
|
|
1351
|
-
H?.({ ...y, states: [...y.states, r] }), B(s);
|
|
1352
|
-
}, z = (n) => {
|
|
1353
|
-
m || (H?.({
|
|
1354
|
-
...y,
|
|
1355
|
-
states: y.states.filter((s) => s.id !== n),
|
|
1356
|
-
transitions: y.transitions.filter((s) => s.fromStateId !== n && s.toStateId !== n)
|
|
1357
|
-
}), se === n && B(null));
|
|
1358
|
-
}, te = (n, s) => {
|
|
1359
|
-
H?.({
|
|
1360
|
-
...y,
|
|
1361
|
-
states: y.states.map((r) => r.id === n ? { ...r, name: s } : r)
|
|
1362
|
-
});
|
|
1363
|
-
}, re = () => {
|
|
1364
|
-
const n = y.states.find((s) => s.type === "initial");
|
|
1365
|
-
n && (B(null), O(n.id), L(!0));
|
|
1366
|
-
}, pe = (n) => {
|
|
1367
|
-
const s = y.transitions.find((r) => r.id === n);
|
|
1368
|
-
s && O(s.toStateId);
|
|
1369
|
-
}, ne = D && !m ? /* @__PURE__ */ a(
|
|
1370
|
-
"div",
|
|
1371
|
-
{
|
|
1372
|
-
ref: oe,
|
|
1373
|
-
className: "nice-workflow-designer__toolbar",
|
|
1374
|
-
role: "toolbar",
|
|
1375
|
-
"aria-label": h("workflowDesigner.toolbar", "Workflow toolbar"),
|
|
1376
|
-
children: [
|
|
1377
|
-
/* @__PURE__ */ a("button", { onClick: () => ee("intermediate"), type: "button", children: [
|
|
1378
|
-
/* @__PURE__ */ t(p, { name: "plus", size: 14 }),
|
|
1379
|
-
" ",
|
|
1380
|
-
h("workflowDesigner.addState", "State")
|
|
1381
|
-
] }),
|
|
1382
|
-
/* @__PURE__ */ a("button", { onClick: () => ee("approval"), type: "button", children: [
|
|
1383
|
-
/* @__PURE__ */ t(p, { name: "plus", size: 14 }),
|
|
1384
|
-
" ",
|
|
1385
|
-
h("workflowDesigner.addApproval", "Approval")
|
|
1386
|
-
] }),
|
|
1387
|
-
/* @__PURE__ */ a("button", { onClick: re, type: "button", disabled: E.length > 0, children: [
|
|
1388
|
-
/* @__PURE__ */ t(p, { name: "play", size: 14 }),
|
|
1389
|
-
" ",
|
|
1390
|
-
h("workflowDesigner.simulate", "Simulate")
|
|
1391
|
-
] }),
|
|
1392
|
-
N && /* @__PURE__ */ t("button", { onClick: () => N(y), type: "button", children: h("workflowDesigner.test", "Test") }),
|
|
1393
|
-
K && /* @__PURE__ */ t("button", { onClick: () => K(y), type: "button", disabled: E.length > 0, children: h("workflowDesigner.publish", "Publish") })
|
|
1394
|
-
]
|
|
1395
|
-
}
|
|
1396
|
-
) : void 0, ie = x && !m && !o ? /* @__PURE__ */ a(
|
|
1397
|
-
"aside",
|
|
1398
|
-
{
|
|
1399
|
-
className: "nice-workflow-designer__props",
|
|
1400
|
-
"aria-label": h("workflowDesigner.stateProps", "State properties"),
|
|
1401
|
-
children: [
|
|
1402
|
-
/* @__PURE__ */ a("div", { className: "nice-workflow-designer__props-header", children: [
|
|
1403
|
-
/* @__PURE__ */ t("h3", { children: x.name }),
|
|
1404
|
-
/* @__PURE__ */ t(
|
|
1405
|
-
"button",
|
|
1406
|
-
{
|
|
1407
|
-
type: "button",
|
|
1408
|
-
className: "nice-workflow-designer__props-close",
|
|
1409
|
-
onClick: () => B(null),
|
|
1410
|
-
"aria-label": h("workflowDesigner.closeProps", "Close properties"),
|
|
1411
|
-
title: h("workflowDesigner.closeProps", "Close properties"),
|
|
1412
|
-
children: /* @__PURE__ */ t(p, { name: "close", size: 12 })
|
|
1413
|
-
}
|
|
1414
|
-
)
|
|
1415
|
-
] }),
|
|
1416
|
-
/* @__PURE__ */ a("label", { children: [
|
|
1417
|
-
h("workflowDesigner.type", "Type"),
|
|
1418
|
-
":",
|
|
1419
|
-
/* @__PURE__ */ t(
|
|
1420
|
-
"select",
|
|
1421
|
-
{
|
|
1422
|
-
value: x.type,
|
|
1423
|
-
onChange: (n) => H?.({
|
|
1424
|
-
...y,
|
|
1425
|
-
states: y.states.map(
|
|
1426
|
-
(s) => s.id === x.id ? { ...s, type: n.target.value } : s
|
|
1427
|
-
)
|
|
1428
|
-
}),
|
|
1429
|
-
"aria-label": h("workflowDesigner.stateType", "State type"),
|
|
1430
|
-
children: ["initial", "intermediate", "approval", "final", "error"].map((n) => /* @__PURE__ */ t("option", { value: n, children: n }, n))
|
|
1431
|
-
}
|
|
1432
|
-
)
|
|
1433
|
-
] })
|
|
1434
|
-
]
|
|
1435
|
-
}
|
|
1436
|
-
) : void 0, ue = P && U.length > 0, X = ue || o ? /* @__PURE__ */ a(V, { children: [
|
|
1437
|
-
ue && /* @__PURE__ */ a("div", { className: "nice-workflow-designer__validation", role: "status", "aria-live": "polite", children: [
|
|
1438
|
-
E.map((n, s) => /* @__PURE__ */ a(
|
|
1439
|
-
"div",
|
|
1440
|
-
{
|
|
1441
|
-
className: "nice-workflow-designer__issue nice-workflow-designer__issue--error",
|
|
1442
|
-
children: [
|
|
1443
|
-
/* @__PURE__ */ t(p, { name: "error", size: 14 }),
|
|
1444
|
-
" ",
|
|
1445
|
-
n.message
|
|
1446
|
-
]
|
|
1447
|
-
},
|
|
1448
|
-
s
|
|
1449
|
-
)),
|
|
1450
|
-
le.map((n, s) => /* @__PURE__ */ a(
|
|
1451
|
-
"div",
|
|
1452
|
-
{
|
|
1453
|
-
className: "nice-workflow-designer__issue nice-workflow-designer__issue--warning",
|
|
1454
|
-
children: [
|
|
1455
|
-
/* @__PURE__ */ t(p, { name: "warning", size: 14 }),
|
|
1456
|
-
" ",
|
|
1457
|
-
n.message
|
|
1458
|
-
]
|
|
1459
|
-
},
|
|
1460
|
-
s
|
|
1461
|
-
))
|
|
1462
|
-
] }),
|
|
1463
|
-
o && /* @__PURE__ */ a("div", { className: "nice-workflow-designer__sim-toolbar", children: [
|
|
1464
|
-
/* @__PURE__ */ a("span", { children: [
|
|
1465
|
-
h("workflowDesigner.simActiveState", "Simulation active — current state:"),
|
|
1466
|
-
" ",
|
|
1467
|
-
/* @__PURE__ */ t("strong", { children: y.states.find((n) => n.id === W)?.name })
|
|
1468
|
-
] }),
|
|
1469
|
-
/* @__PURE__ */ t(
|
|
1470
|
-
"button",
|
|
1471
|
-
{
|
|
1472
|
-
onClick: () => {
|
|
1473
|
-
L(!1), O(null);
|
|
1474
|
-
},
|
|
1475
|
-
type: "button",
|
|
1476
|
-
children: h("workflowDesigner.endSimulation", "End simulation")
|
|
1477
|
-
}
|
|
1478
|
-
)
|
|
1479
|
-
] })
|
|
1480
|
-
] }) : void 0;
|
|
1481
|
-
return /* @__PURE__ */ t(
|
|
1482
|
-
Pe,
|
|
1483
|
-
{
|
|
1484
|
-
flush: !0,
|
|
1485
|
-
className: `nice-workflow-designer${m ? " nice-workflow-designer--readonly" : ""} ${R ?? ""}`,
|
|
1486
|
-
style: J,
|
|
1487
|
-
"data-testid": me,
|
|
1488
|
-
toolbar: ne,
|
|
1489
|
-
rightSidebar: ie,
|
|
1490
|
-
bottomPanel: X,
|
|
1491
|
-
children: /* @__PURE__ */ a(
|
|
1492
|
-
"div",
|
|
1493
|
-
{
|
|
1494
|
-
style: {
|
|
1495
|
-
position: "relative",
|
|
1496
|
-
height: "100%",
|
|
1497
|
-
overflow: "hidden",
|
|
1498
|
-
display: "flex",
|
|
1499
|
-
flexDirection: "column"
|
|
1500
|
-
},
|
|
1501
|
-
children: [
|
|
1502
|
-
/* @__PURE__ */ t("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ t(Ye, { steps: Ke(de, Xe) }) }),
|
|
1503
|
-
/* @__PURE__ */ t(
|
|
1504
|
-
"div",
|
|
1505
|
-
{
|
|
1506
|
-
ref: G,
|
|
1507
|
-
className: `nice-workflow-designer__canvas${Q ? " nice-workflow-designer__canvas--panning" : ""}`,
|
|
1508
|
-
role: "application",
|
|
1509
|
-
"aria-label": h("workflowDesigner.canvas", "Workflow canvas"),
|
|
1510
|
-
onPointerDown: (n) => {
|
|
1511
|
-
if (n.button !== 0 || n.target.closest(".nice-workflow-designer__state-node"))
|
|
1512
|
-
return;
|
|
1513
|
-
const s = n.currentTarget;
|
|
1514
|
-
I.current = {
|
|
1515
|
-
x: n.clientX,
|
|
1516
|
-
y: n.clientY,
|
|
1517
|
-
left: s.scrollLeft,
|
|
1518
|
-
top: s.scrollTop,
|
|
1519
|
-
moved: !1
|
|
1520
|
-
}, s.setPointerCapture?.(n.pointerId);
|
|
1521
|
-
},
|
|
1522
|
-
onPointerMove: (n) => {
|
|
1523
|
-
const s = I.current;
|
|
1524
|
-
if (!s)
|
|
1525
|
-
return;
|
|
1526
|
-
const r = n.clientX - s.x, k = n.clientY - s.y;
|
|
1527
|
-
!s.moved && Math.abs(r) + Math.abs(k) < 4 || (s.moved || (s.moved = !0, j(!0)), n.currentTarget.scrollLeft = s.left - r, n.currentTarget.scrollTop = s.top - k);
|
|
1528
|
-
},
|
|
1529
|
-
onPointerUp: () => {
|
|
1530
|
-
const n = I.current;
|
|
1531
|
-
I.current = null, j(!1), n && !n.moved && B(null);
|
|
1532
|
-
},
|
|
1533
|
-
onPointerCancel: () => {
|
|
1534
|
-
I.current = null, j(!1);
|
|
1535
|
-
},
|
|
1536
|
-
children: /* @__PURE__ */ t(
|
|
1537
|
-
"div",
|
|
1538
|
-
{
|
|
1539
|
-
className: "nice-workflow-designer__canvas-content",
|
|
1540
|
-
style: (() => {
|
|
1541
|
-
const r = y.states.reduce(
|
|
1542
|
-
(w, $) => Math.max(w, ($.position.x ?? 0) + 200),
|
|
1543
|
-
800
|
|
1544
|
-
), k = y.states.reduce(
|
|
1545
|
-
(w, $) => Math.max(w, ($.position.y ?? 0) + 120),
|
|
1546
|
-
800 / 2
|
|
1547
|
-
);
|
|
1548
|
-
return {
|
|
1549
|
-
position: "relative",
|
|
1550
|
-
width: r + 240,
|
|
1551
|
-
height: k + 240,
|
|
1552
|
-
minWidth: "100%",
|
|
1553
|
-
minHeight: "100%"
|
|
1554
|
-
};
|
|
1555
|
-
})(),
|
|
1556
|
-
children: y.states.map((n) => {
|
|
1557
|
-
const s = o && W === n.id, r = se === n.id, k = o ? y.transitions.filter((w) => w.fromStateId === n.id) : [];
|
|
1558
|
-
return /* @__PURE__ */ a(
|
|
1559
|
-
"div",
|
|
1560
|
-
{
|
|
1561
|
-
"data-state-id": n.id,
|
|
1562
|
-
className: `nice-workflow-designer__state-node nice-workflow-designer__state-node--${n.type}${r ? " nice-workflow-designer__state-node--selected" : ""}${s ? " nice-workflow-designer__state-node--active" : ""}`,
|
|
1563
|
-
style: {
|
|
1564
|
-
left: n.position.x,
|
|
1565
|
-
top: n.position.y,
|
|
1566
|
-
borderColor: Ne[n.type]
|
|
1567
|
-
},
|
|
1568
|
-
onClick: () => B(n.id),
|
|
1569
|
-
role: "button",
|
|
1570
|
-
tabIndex: 0,
|
|
1571
|
-
"aria-label": h("workflowDesigner.stateLabel", "State: {name}").replace(
|
|
1572
|
-
"{name}",
|
|
1573
|
-
n.name
|
|
1574
|
-
),
|
|
1575
|
-
onKeyDown: (w) => w.key === "Enter" && B(n.id),
|
|
1576
|
-
children: [
|
|
1577
|
-
/* @__PURE__ */ t("span", { className: "nice-workflow-designer__state-type", children: n.type }),
|
|
1578
|
-
m ? /* @__PURE__ */ t("span", { className: "nice-workflow-designer__state-name", children: n.name }) : /* @__PURE__ */ t(
|
|
1579
|
-
"input",
|
|
1580
|
-
{
|
|
1581
|
-
type: "text",
|
|
1582
|
-
value: n.name,
|
|
1583
|
-
onChange: (w) => te(n.id, w.target.value),
|
|
1584
|
-
className: "nice-workflow-designer__state-name-input",
|
|
1585
|
-
"aria-label": h("workflowDesigner.stateName", "State name"),
|
|
1586
|
-
onClick: (w) => w.stopPropagation()
|
|
1587
|
-
}
|
|
1588
|
-
),
|
|
1589
|
-
n.sla && /* @__PURE__ */ a(
|
|
1590
|
-
"span",
|
|
1591
|
-
{
|
|
1592
|
-
className: "nice-workflow-designer__sla-badge",
|
|
1593
|
-
title: ae("workflowDesigner.slaHH", "SLA: {warningHours}h / {criticalHours}h").replace("{warningHours}", String(n.sla.warningHours)).replace("{criticalHours}", String(n.sla.criticalHours)),
|
|
1594
|
-
children: [
|
|
1595
|
-
/* @__PURE__ */ t(p, { name: "clock", size: 10 }),
|
|
1596
|
-
" ",
|
|
1597
|
-
ae("workflowDesigner.sla", "SLA")
|
|
1598
|
-
]
|
|
1599
|
-
}
|
|
1600
|
-
),
|
|
1601
|
-
s && k.map((w) => /* @__PURE__ */ a(
|
|
1602
|
-
"button",
|
|
1603
|
-
{
|
|
1604
|
-
className: "nice-workflow-designer__sim-btn",
|
|
1605
|
-
onClick: ($) => {
|
|
1606
|
-
$.stopPropagation(), pe(w.id);
|
|
1607
|
-
},
|
|
1608
|
-
type: "button",
|
|
1609
|
-
children: [
|
|
1610
|
-
/* @__PURE__ */ t(p, { name: "arrow-right", size: 12 }),
|
|
1611
|
-
" ",
|
|
1612
|
-
w.name
|
|
1613
|
-
]
|
|
1614
|
-
},
|
|
1615
|
-
w.id
|
|
1616
|
-
)),
|
|
1617
|
-
!m && /* @__PURE__ */ t(
|
|
1618
|
-
"button",
|
|
1619
|
-
{
|
|
1620
|
-
className: "nice-workflow-designer__delete-btn",
|
|
1621
|
-
onClick: (w) => {
|
|
1622
|
-
w.stopPropagation(), z(n.id);
|
|
1623
|
-
},
|
|
1624
|
-
type: "button",
|
|
1625
|
-
"aria-label": h("workflowDesigner.deleteState", "Delete state {name}").replace(
|
|
1626
|
-
"{name}",
|
|
1627
|
-
n.name
|
|
1628
|
-
),
|
|
1629
|
-
children: /* @__PURE__ */ t(p, { name: "close", size: 10 })
|
|
1630
|
-
}
|
|
1631
|
-
)
|
|
1632
|
-
]
|
|
1633
|
-
},
|
|
1634
|
-
n.id
|
|
1635
|
-
);
|
|
1636
|
-
})
|
|
1637
|
-
}
|
|
1638
|
-
)
|
|
1639
|
-
}
|
|
1640
|
-
),
|
|
1641
|
-
d && /* @__PURE__ */ t(
|
|
1642
|
-
"div",
|
|
1643
|
-
{
|
|
1644
|
-
className: "nice-workflow-designer__minimap",
|
|
1645
|
-
"aria-label": h("workflowDesigner.minimap", "Minimap"),
|
|
1646
|
-
"aria-hidden": "true",
|
|
1647
|
-
children: y.states.map((n) => /* @__PURE__ */ t(
|
|
1648
|
-
"div",
|
|
1649
|
-
{
|
|
1650
|
-
className: "nice-workflow-designer__minimap-dot",
|
|
1651
|
-
style: {
|
|
1652
|
-
left: n.position.x / 10,
|
|
1653
|
-
top: n.position.y / 10,
|
|
1654
|
-
background: Ne[n.type]
|
|
1655
|
-
}
|
|
1656
|
-
},
|
|
1657
|
-
n.id
|
|
1658
|
-
))
|
|
1659
|
-
}
|
|
1660
|
-
)
|
|
1661
|
-
]
|
|
1662
|
-
}
|
|
1663
|
-
)
|
|
1664
|
-
}
|
|
1665
|
-
);
|
|
1666
1221
|
};
|
|
1667
1222
|
export {
|
|
1668
|
-
|
|
1669
|
-
st as NiceWorkflowDesigner
|
|
1223
|
+
Qe as NiceBPMNDesigner
|
|
1670
1224
|
};
|