@rytass/bpm-core-react 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/dist/chunks/FormBuilderView-B_KGPjlp.cjs +3 -0
- package/dist/chunks/FormBuilderView-B_KGPjlp.cjs.map +1 -0
- package/dist/chunks/FormBuilderView-D8DrQOXD.js +1090 -0
- package/dist/chunks/FormBuilderView-D8DrQOXD.js.map +1 -0
- package/dist/chunks/{approval-instance-list-page-UNIIgUZy.cjs → approval-instance-list-page-BMUKxzcz.cjs} +2 -2
- package/dist/chunks/{approval-instance-list-page-UNIIgUZy.cjs.map → approval-instance-list-page-BMUKxzcz.cjs.map} +1 -1
- package/dist/chunks/{approval-instance-list-page-BtEc8Cs3.js → approval-instance-list-page-YZcGGDD8.js} +3 -3
- package/dist/chunks/{approval-instance-list-page-BtEc8Cs3.js.map → approval-instance-list-page-YZcGGDD8.js.map} +1 -1
- package/dist/chunks/{auth-provider-D2P-qWmY.cjs → auth-provider-4BeCw7cI.cjs} +2 -2
- package/dist/chunks/{auth-provider-D2P-qWmY.cjs.map → auth-provider-4BeCw7cI.cjs.map} +1 -1
- package/dist/chunks/{auth-provider-TTO9eNZV.js → auth-provider-B5oPmvk2.js} +2 -2
- package/dist/chunks/{auth-provider-TTO9eNZV.js.map → auth-provider-B5oPmvk2.js.map} +1 -1
- package/dist/chunks/compose-PMrmi-LE.js +451 -0
- package/dist/chunks/compose-PMrmi-LE.js.map +1 -0
- package/dist/chunks/compose-ziVbRYdo.cjs +2 -0
- package/dist/chunks/compose-ziVbRYdo.cjs.map +1 -0
- package/dist/chunks/{dashboard-page-CQRBJxze.js → dashboard-page-DJ9vOPga.js} +4 -4
- package/dist/chunks/{dashboard-page-CQRBJxze.js.map → dashboard-page-DJ9vOPga.js.map} +1 -1
- package/dist/chunks/{dashboard-page-DrDChhg1.cjs → dashboard-page-DwHQY6Ki.cjs} +2 -2
- package/dist/chunks/{dashboard-page-DrDChhg1.cjs.map → dashboard-page-DwHQY6Ki.cjs.map} +1 -1
- package/dist/chunks/{delegations-CFXaJrdX.cjs → delegations-C2wLWsDQ.cjs} +2 -2
- package/dist/chunks/{delegations-CFXaJrdX.cjs.map → delegations-C2wLWsDQ.cjs.map} +1 -1
- package/dist/chunks/{delegations-DwbYkNUg.cjs → delegations-DDEk-WI6.cjs} +2 -2
- package/dist/chunks/{delegations-DwbYkNUg.cjs.map → delegations-DDEk-WI6.cjs.map} +1 -1
- package/dist/chunks/{delegations-FTLaWo1Y.js → delegations-ZNtodFaD.js} +2 -2
- package/dist/chunks/{delegations-FTLaWo1Y.js.map → delegations-ZNtodFaD.js.map} +1 -1
- package/dist/chunks/{delegations-D5pPEWsP.js → delegations-iVnRi3QE.js} +2 -2
- package/dist/chunks/{delegations-D5pPEWsP.js.map → delegations-iVnRi3QE.js.map} +1 -1
- package/dist/chunks/designer-DCn6_v4b.cjs +65 -0
- package/dist/chunks/designer-DCn6_v4b.cjs.map +1 -0
- package/dist/chunks/designer-mOMxJ0Py.js +2576 -0
- package/dist/chunks/designer-mOMxJ0Py.js.map +1 -0
- package/dist/chunks/detail-Bml-vXHX.js +1622 -0
- package/dist/chunks/detail-Bml-vXHX.js.map +1 -0
- package/dist/chunks/detail-CWeCrmtC.cjs +2 -0
- package/dist/chunks/detail-CWeCrmtC.cjs.map +1 -0
- package/dist/chunks/{login-BfmfCclF.cjs → login-9bCXyjbX.cjs} +2 -2
- package/dist/chunks/{login-BfmfCclF.cjs.map → login-9bCXyjbX.cjs.map} +1 -1
- package/dist/chunks/{login-xgI4wLHe.js → login-BKxpLibd.js} +3 -3
- package/dist/chunks/{login-xgI4wLHe.js.map → login-BKxpLibd.js.map} +1 -1
- package/dist/chunks/{notifications-a-FCxV02.cjs → notifications-BKs4--96.cjs} +2 -2
- package/dist/chunks/{notifications-a-FCxV02.cjs.map → notifications-BKs4--96.cjs.map} +1 -1
- package/dist/chunks/{notifications-BoNa1BXD.js → notifications-CSulztkU.js} +2 -2
- package/dist/chunks/{notifications-BoNa1BXD.js.map → notifications-CSulztkU.js.map} +1 -1
- package/dist/chunks/router-adapter--gYs13E8.cjs +2 -0
- package/dist/chunks/{router-adapter-BybHrCNP.cjs.map → router-adapter--gYs13E8.cjs.map} +1 -1
- package/dist/chunks/{router-adapter-BdHZXLS3.js → router-adapter-DftlFTOd.js} +2 -2
- package/dist/chunks/{router-adapter-BdHZXLS3.js.map → router-adapter-DftlFTOd.js.map} +1 -1
- package/dist/chunks/{routes-config-dxahImVe.js → routes-config-RBYQtUd0.js} +2 -3
- package/dist/chunks/routes-config-RBYQtUd0.js.map +1 -0
- package/dist/chunks/routes-config-fDVHmvXi.cjs +2 -0
- package/dist/chunks/routes-config-fDVHmvXi.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +270 -130
- package/dist/index.js.map +1 -1
- package/dist/lib/routes-config.d.ts +6 -4
- package/dist/next/BPMNextProviders.d.ts +1 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +14 -24
- package/dist/next/index.js.map +1 -1
- package/dist/next/workflow-chat-route.cjs +19 -0
- package/dist/next/workflow-chat-route.cjs.map +1 -0
- package/dist/next/workflow-chat-route.d.ts +17 -0
- package/dist/next/workflow-chat-route.js +31 -0
- package/dist/next/workflow-chat-route.js.map +1 -0
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/login/index.cjs +1 -1
- package/dist/pages/login/index.js +1 -1
- package/dist/pages/settings/notifications/index.cjs +1 -1
- package/dist/pages/settings/notifications/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +2 -0
- package/dist/pages/templates/compose/index.cjs.map +1 -0
- package/dist/pages/templates/compose/index.d.ts +13 -0
- package/dist/pages/templates/compose/index.js +14 -0
- package/dist/pages/templates/compose/index.js.map +1 -0
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.cjs.map +1 -1
- package/dist/pages/templates/designer/index.js +7 -2
- package/dist/pages/templates/designer/index.js.map +1 -1
- package/dist/pages/templates/index.cjs +1 -1
- package/dist/pages/templates/index.cjs.map +1 -1
- package/dist/pages/templates/index.js +3 -3
- package/dist/pages/templates/index.js.map +1 -1
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +1 -1
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/index.js +1 -1
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.js +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/builder/FormBuilderView.d.ts +13 -4
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/builder/json-code-editor.d.ts +1 -1
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.js +3 -3
- package/dist/views/instances/detail/InstanceDetailView.d.ts +11 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.d.ts +5 -0
- package/dist/views/instances/detail/index.js +2 -2
- package/dist/views/instances/detail/sections/InstanceAttachmentsSection.d.ts +15 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +33 -0
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +29 -0
- package/dist/views/instances/detail/sections/InstanceSignaturesSection.d.ts +14 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +44 -0
- package/dist/views/instances/detail/sections/container-helpers.d.ts +8 -0
- package/dist/views/instances/detail/sections/shared.d.ts +103 -0
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.js +3 -3
- package/dist/views/login/index.cjs +1 -1
- package/dist/views/login/index.js +1 -1
- package/dist/views/search/index.cjs +1 -1
- package/dist/views/search/index.js +1 -1
- package/dist/views/sent/index.cjs +1 -1
- package/dist/views/sent/index.js +1 -1
- package/dist/views/settings/index.cjs +1 -1
- package/dist/views/settings/index.js +1 -1
- package/dist/views/settings/notifications/index.cjs +1 -1
- package/dist/views/settings/notifications/index.js +1 -1
- package/dist/views/templates/TemplatesView.d.ts +5 -0
- package/dist/views/templates/compose/TemplateComposeWizardView.d.ts +8 -0
- package/dist/views/templates/compose/index.cjs +1 -0
- package/dist/views/templates/compose/index.d.ts +2 -0
- package/dist/views/templates/compose/index.js +2 -0
- package/dist/views/templates/compose/steps/ComposeFormStep.d.ts +15 -0
- package/dist/views/templates/compose/steps/ComposeReviewStep.d.ts +12 -0
- package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.ts +11 -0
- package/dist/views/templates/compose/use-template-compose-wizard.d.ts +46 -0
- package/dist/views/templates/designer/TemplateDesignerView.d.ts +60 -2
- package/dist/views/templates/designer/chrome-workflow-chat.d.ts +12 -0
- package/dist/views/templates/designer/index.cjs +1 -51
- package/dist/views/templates/designer/index.js +2 -2272
- package/dist/views/templates/designer/use-workflow-chat.d.ts +21 -0
- package/dist/views/templates/designer/use-workflow-designer-controller.d.ts +41 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.ts +16 -0
- package/dist/views/templates/index.cjs +2 -1
- package/dist/views/templates/index.cjs.map +1 -0
- package/dist/views/templates/index.js +265 -4
- package/dist/views/templates/index.js.map +1 -0
- package/dist/views/templates/versions/index.cjs +1 -1
- package/dist/views/templates/versions/index.cjs.map +1 -1
- package/dist/views/templates/versions/index.js +39 -43
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +22 -19
- package/dist/chunks/builder-C3E-8OJu.js +0 -1300
- package/dist/chunks/builder-C3E-8OJu.js.map +0 -1
- package/dist/chunks/builder-f-Q_0NUs.cjs +0 -3
- package/dist/chunks/builder-f-Q_0NUs.cjs.map +0 -1
- package/dist/chunks/detail-B9JkYNHc.cjs +0 -2
- package/dist/chunks/detail-B9JkYNHc.cjs.map +0 -1
- package/dist/chunks/detail-CSxI04gB.js +0 -1518
- package/dist/chunks/detail-CSxI04gB.js.map +0 -1
- package/dist/chunks/form-name-modal-C3OEvkCV.js +0 -64
- package/dist/chunks/form-name-modal-C3OEvkCV.js.map +0 -1
- package/dist/chunks/form-name-modal-uZCHbtRH.cjs +0 -2
- package/dist/chunks/form-name-modal-uZCHbtRH.cjs.map +0 -1
- package/dist/chunks/router-adapter-BybHrCNP.cjs +0 -2
- package/dist/chunks/routes-config-2aKbWq2H.cjs +0 -2
- package/dist/chunks/routes-config-2aKbWq2H.cjs.map +0 -1
- package/dist/chunks/routes-config-dxahImVe.js.map +0 -1
- package/dist/chunks/templates-CL8bPvgn.cjs +0 -2
- package/dist/chunks/templates-CL8bPvgn.cjs.map +0 -1
- package/dist/chunks/templates-DNfDOPGm.js +0 -380
- package/dist/chunks/templates-DNfDOPGm.js.map +0 -1
- package/dist/pages/forms/builder/index.cjs +0 -2
- package/dist/pages/forms/builder/index.cjs.map +0 -1
- package/dist/pages/forms/builder/index.d.ts +0 -21
- package/dist/pages/forms/builder/index.js +0 -15
- package/dist/pages/forms/builder/index.js.map +0 -1
- package/dist/pages/forms/index.cjs +0 -2
- package/dist/pages/forms/index.cjs.map +0 -1
- package/dist/pages/forms/index.d.ts +0 -17
- package/dist/pages/forms/index.js +0 -14
- package/dist/pages/forms/index.js.map +0 -1
- package/dist/views/forms/FormsView.d.ts +0 -2
- package/dist/views/forms/form-name-modal.d.ts +0 -12
- package/dist/views/forms/index.cjs +0 -2
- package/dist/views/forms/index.cjs.map +0 -1
- package/dist/views/forms/index.d.ts +0 -2
- package/dist/views/forms/index.js +0 -186
- package/dist/views/forms/index.js.map +0 -1
- package/dist/views/templates/designer/index.cjs.map +0 -1
- package/dist/views/templates/designer/index.js.map +0 -1
- package/dist/views/templates/template-name-modal.d.ts +0 -22
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { r as e } from "./router-adapter-DftlFTOd.js";
|
|
3
|
+
import { r as t } from "./routes-config-RBYQtUd0.js";
|
|
4
|
+
import { t as n } from "./FormRendererView-DrHsuSVo.js";
|
|
5
|
+
import { t as r } from "./FormBuilderView-D8DrQOXD.js";
|
|
6
|
+
import { t as i } from "./designer-mOMxJ0Py.js";
|
|
7
|
+
import { useCallback as a, useEffect as o, useState as s } from "react";
|
|
8
|
+
import { Button as c, Empty as l, FormField as u, Input as d, PageHeader as f, Section as p, SectionGroup as m, Select as h, Step as g, Stepper as _, Table as v, Tag as y, Typography as b } from "@mezzanine-ui/react";
|
|
9
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
10
|
+
import w from "@mezzanine-ui/react/ContentHeader";
|
|
11
|
+
import { FormFieldLayout as T } from "@mezzanine-ui/core/form";
|
|
12
|
+
import { composeApprovalTemplateWithForm as E, listApprovalTemplateCategoriesPage as D } from "@rytass/bpm-core-client/template";
|
|
13
|
+
//#region src/views/templates/compose/steps/ComposeFormStep.tsx
|
|
14
|
+
var O = {
|
|
15
|
+
id: "UNCATEGORIZED",
|
|
16
|
+
name: "未分類"
|
|
17
|
+
}, k = 100;
|
|
18
|
+
function A({ categoryId: e, formSchema: t, formUiSchema: n, name: i, onCategoryIdChange: a, onFormChange: c, onNameChange: l }) {
|
|
19
|
+
let [f, p] = s([]);
|
|
20
|
+
o(() => {
|
|
21
|
+
let e = !0;
|
|
22
|
+
return (async () => {
|
|
23
|
+
try {
|
|
24
|
+
let t = await D({
|
|
25
|
+
page: 1,
|
|
26
|
+
pageSize: k,
|
|
27
|
+
searchText: "",
|
|
28
|
+
status: "ACTIVE"
|
|
29
|
+
});
|
|
30
|
+
e && p(t.categories);
|
|
31
|
+
} catch {
|
|
32
|
+
e && p([]);
|
|
33
|
+
}
|
|
34
|
+
})(), () => {
|
|
35
|
+
e = !1;
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
let m = [O, ...f.map((e) => ({
|
|
39
|
+
id: e.id,
|
|
40
|
+
name: e.name
|
|
41
|
+
}))], g = m.find((t) => t.id === e) ?? O;
|
|
42
|
+
return /* @__PURE__ */ C(x, { children: [
|
|
43
|
+
/* @__PURE__ */ C("div", {
|
|
44
|
+
style: j,
|
|
45
|
+
children: [/* @__PURE__ */ S(u, {
|
|
46
|
+
label: "名稱",
|
|
47
|
+
layout: T.VERTICAL,
|
|
48
|
+
name: "composeName",
|
|
49
|
+
children: /* @__PURE__ */ S(d, {
|
|
50
|
+
fullWidth: !0,
|
|
51
|
+
onChange: (e) => l(e.target.value),
|
|
52
|
+
placeholder: "例如:請款簽核",
|
|
53
|
+
value: i
|
|
54
|
+
})
|
|
55
|
+
}), /* @__PURE__ */ S(u, {
|
|
56
|
+
label: "分類(選填)",
|
|
57
|
+
layout: T.VERTICAL,
|
|
58
|
+
name: "composeCategory",
|
|
59
|
+
children: /* @__PURE__ */ S(h, {
|
|
60
|
+
clearable: !1,
|
|
61
|
+
fullWidth: !0,
|
|
62
|
+
onChange: (e) => a(e && e.id !== O.id ? e.id : null),
|
|
63
|
+
options: m,
|
|
64
|
+
placeholder: "未分類",
|
|
65
|
+
value: g
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ S(b, {
|
|
70
|
+
color: "text-neutral",
|
|
71
|
+
variant: "caption",
|
|
72
|
+
children: "先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。"
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ S(r, {
|
|
75
|
+
onChange: c,
|
|
76
|
+
value: {
|
|
77
|
+
schema: t,
|
|
78
|
+
uiSchema: n
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
var j = {
|
|
84
|
+
display: "grid",
|
|
85
|
+
gap: 16,
|
|
86
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))"
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/views/templates/compose/steps/ComposeReviewStep.tsx
|
|
90
|
+
function M({ formSchema: e, formUiSchema: t, initiatorPolicyCel: r, name: i, publishError: a, workflowDefinition: o }) {
|
|
91
|
+
let s = o?.nodes ?? [], c = o?.edges ?? [], u = e.fields.length, d = new Map(s.map((e) => [e.id, e.data.label])), f = s.map((e) => ({
|
|
92
|
+
detail: I(e) ?? "—",
|
|
93
|
+
key: e.id,
|
|
94
|
+
label: e.data.label,
|
|
95
|
+
typeLabel: F(e)
|
|
96
|
+
})), p = c.filter((e) => !!e.data.condition).map((e) => ({
|
|
97
|
+
condition: e.data.condition ?? "",
|
|
98
|
+
key: e.id,
|
|
99
|
+
source: d.get(e.source) ?? e.source,
|
|
100
|
+
target: d.get(e.target) ?? e.target
|
|
101
|
+
}));
|
|
102
|
+
return /* @__PURE__ */ C("div", {
|
|
103
|
+
style: L,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ S(b, {
|
|
106
|
+
component: "h2",
|
|
107
|
+
style: R,
|
|
108
|
+
variant: "h2",
|
|
109
|
+
children: i || "(未命名)"
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ C("div", {
|
|
112
|
+
style: L,
|
|
113
|
+
children: [/* @__PURE__ */ S(b, {
|
|
114
|
+
variant: "h3",
|
|
115
|
+
children: "表單預覽"
|
|
116
|
+
}), u > 0 ? /* @__PURE__ */ S(n, {
|
|
117
|
+
readonly: !0,
|
|
118
|
+
schema: e,
|
|
119
|
+
uiSchema: t
|
|
120
|
+
}) : /* @__PURE__ */ S(l, { title: "尚未設計表單欄位" })]
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ C("div", {
|
|
123
|
+
style: L,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ S(b, {
|
|
126
|
+
variant: "h3",
|
|
127
|
+
children: "流程概覽"
|
|
128
|
+
}),
|
|
129
|
+
s.length > 0 ? /* @__PURE__ */ S(v, {
|
|
130
|
+
columns: N,
|
|
131
|
+
dataSource: f,
|
|
132
|
+
fullWidth: !0
|
|
133
|
+
}) : /* @__PURE__ */ S(l, { title: "尚未設計流程節點" }),
|
|
134
|
+
p.length > 0 ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(b, {
|
|
135
|
+
color: "text-neutral",
|
|
136
|
+
variant: "caption",
|
|
137
|
+
children: "條件分流"
|
|
138
|
+
}), /* @__PURE__ */ S(v, {
|
|
139
|
+
columns: P,
|
|
140
|
+
dataSource: p,
|
|
141
|
+
fullWidth: !0
|
|
142
|
+
})] }) : null,
|
|
143
|
+
r ? /* @__PURE__ */ C(b, {
|
|
144
|
+
color: "text-neutral",
|
|
145
|
+
variant: "caption",
|
|
146
|
+
children: ["發起權限:", r]
|
|
147
|
+
}) : null
|
|
148
|
+
]
|
|
149
|
+
}),
|
|
150
|
+
a ? /* @__PURE__ */ S(b, {
|
|
151
|
+
color: "text-error",
|
|
152
|
+
variant: "body",
|
|
153
|
+
children: a
|
|
154
|
+
}) : null
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
var N = [
|
|
159
|
+
{
|
|
160
|
+
key: "type",
|
|
161
|
+
render: (e) => /* @__PURE__ */ S(y, {
|
|
162
|
+
label: e.typeLabel,
|
|
163
|
+
size: "sub",
|
|
164
|
+
type: "static"
|
|
165
|
+
}),
|
|
166
|
+
title: "類型",
|
|
167
|
+
width: 130
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
dataIndex: "label",
|
|
171
|
+
key: "label",
|
|
172
|
+
title: "節點"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
dataIndex: "detail",
|
|
176
|
+
key: "detail",
|
|
177
|
+
title: "簽核方式",
|
|
178
|
+
width: 160
|
|
179
|
+
}
|
|
180
|
+
], P = [
|
|
181
|
+
{
|
|
182
|
+
dataIndex: "source",
|
|
183
|
+
key: "source",
|
|
184
|
+
title: "來源",
|
|
185
|
+
width: 180
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
dataIndex: "target",
|
|
189
|
+
key: "target",
|
|
190
|
+
title: "目標",
|
|
191
|
+
width: 180
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
dataIndex: "condition",
|
|
195
|
+
key: "condition",
|
|
196
|
+
title: "條件"
|
|
197
|
+
}
|
|
198
|
+
];
|
|
199
|
+
function F(e) {
|
|
200
|
+
switch (e.type) {
|
|
201
|
+
case "startEvent": return "開始";
|
|
202
|
+
case "endEvent": return e.data.endState === "REJECTED" ? "結束(駁回)" : "結束(核准)";
|
|
203
|
+
case "userTask": return "簽核";
|
|
204
|
+
case "serviceTask": return "服務";
|
|
205
|
+
case "exclusiveGateway": return "條件閘道";
|
|
206
|
+
case "parallelGateway": return "平行閘道";
|
|
207
|
+
default: return "節點";
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function I(e) {
|
|
211
|
+
if (e.type !== "userTask") return null;
|
|
212
|
+
switch (e.data.approverResolver.type) {
|
|
213
|
+
case "DIRECT": return "指定成員";
|
|
214
|
+
case "POSITION": return "指定職位";
|
|
215
|
+
case "ORG_UNIT_MEMBER": return "單位成員";
|
|
216
|
+
case "ORG_UNIT_POSITION": return "單位職位";
|
|
217
|
+
case "ORG_MANAGER": return "主管";
|
|
218
|
+
case "ORG_UNIT_MANAGER": return "單位主管";
|
|
219
|
+
case "DYNAMIC_FORM": return "表單動態指派";
|
|
220
|
+
case "EXPRESSION": return "運算式";
|
|
221
|
+
default: return "簽核人";
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
var L = {
|
|
225
|
+
display: "grid",
|
|
226
|
+
gap: 12
|
|
227
|
+
}, R = { marginTop: "var(--mzn-spacing-padding-vertical-spacious)" };
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/views/templates/compose/steps/ComposeWorkflowStep.tsx
|
|
230
|
+
function z({ formSchema: e, initiatorPolicyCel: t, onInitiatorPolicyChange: n, onWorkflowChange: r, workflowDefinition: a }) {
|
|
231
|
+
return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(b, {
|
|
232
|
+
color: "text-neutral",
|
|
233
|
+
variant: "caption",
|
|
234
|
+
children: "設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。"
|
|
235
|
+
}), /* @__PURE__ */ S(i, {
|
|
236
|
+
embedded: !0,
|
|
237
|
+
formSchemaOverride: e,
|
|
238
|
+
initialInitiatorPolicyCel: t,
|
|
239
|
+
initialWorkflowDefinition: a ?? void 0,
|
|
240
|
+
onInitiatorPolicyChange: n,
|
|
241
|
+
onWorkflowChange: r
|
|
242
|
+
})] });
|
|
243
|
+
}
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/views/templates/compose/use-template-compose-wizard.ts
|
|
246
|
+
var B = {
|
|
247
|
+
fields: [],
|
|
248
|
+
schemaVersion: 1
|
|
249
|
+
}, V = {
|
|
250
|
+
layout: [],
|
|
251
|
+
schemaVersion: 1
|
|
252
|
+
};
|
|
253
|
+
function H() {
|
|
254
|
+
let [e, t] = s(0), [n, r] = s(""), [i, o] = s(null), [c, l] = s(B), [u, d] = s(V), [f, p] = s(null), [m, h] = s(null), [g, _] = s("idle"), [v, y] = s(null), b = n.trim().length > 0 && c.fields.length > 0, x = a((e) => {
|
|
255
|
+
t(e);
|
|
256
|
+
}, []), S = a(() => {
|
|
257
|
+
t((e) => e < 2 ? e + 1 : e);
|
|
258
|
+
}, []), C = a(() => {
|
|
259
|
+
t((e) => e > 0 ? e - 1 : e);
|
|
260
|
+
}, []), w = a((e) => {
|
|
261
|
+
l(e.schema), d(e.uiSchema);
|
|
262
|
+
}, []), T = a((e) => {
|
|
263
|
+
p(e);
|
|
264
|
+
}, []), D = a((e) => {
|
|
265
|
+
h(e);
|
|
266
|
+
}, []);
|
|
267
|
+
return {
|
|
268
|
+
canLeaveBasics: b,
|
|
269
|
+
categoryId: i,
|
|
270
|
+
currentStep: e,
|
|
271
|
+
formSchema: c,
|
|
272
|
+
formUiSchema: u,
|
|
273
|
+
goBack: C,
|
|
274
|
+
goNext: S,
|
|
275
|
+
goToStep: x,
|
|
276
|
+
initiatorPolicyCel: m,
|
|
277
|
+
name: n,
|
|
278
|
+
publish: a(async () => {
|
|
279
|
+
_("submitting"), y(null);
|
|
280
|
+
try {
|
|
281
|
+
let e = await E({
|
|
282
|
+
category: null,
|
|
283
|
+
categoryId: i,
|
|
284
|
+
formDefinitionId: null,
|
|
285
|
+
formDescription: null,
|
|
286
|
+
formName: n,
|
|
287
|
+
initiatorPolicyCel: m,
|
|
288
|
+
notificationConfig: null,
|
|
289
|
+
publish: !0,
|
|
290
|
+
schema: c,
|
|
291
|
+
slaDefaults: null,
|
|
292
|
+
templateDescription: null,
|
|
293
|
+
templateId: null,
|
|
294
|
+
templateName: n,
|
|
295
|
+
uiSchema: u,
|
|
296
|
+
workflowDefinition: f ?? U
|
|
297
|
+
});
|
|
298
|
+
return _("success"), e;
|
|
299
|
+
} catch (e) {
|
|
300
|
+
return y(W(e)), _("error"), null;
|
|
301
|
+
}
|
|
302
|
+
}, [
|
|
303
|
+
i,
|
|
304
|
+
c,
|
|
305
|
+
u,
|
|
306
|
+
m,
|
|
307
|
+
n,
|
|
308
|
+
f
|
|
309
|
+
]),
|
|
310
|
+
publishError: v,
|
|
311
|
+
publishPhase: g,
|
|
312
|
+
setCategoryId: o,
|
|
313
|
+
setFormValue: w,
|
|
314
|
+
setInitiatorPolicyCel: D,
|
|
315
|
+
setName: r,
|
|
316
|
+
setWorkflowDefinition: T,
|
|
317
|
+
workflowDefinition: f
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
var U = {
|
|
321
|
+
edges: [],
|
|
322
|
+
meta: { schemaVersion: 1 },
|
|
323
|
+
nodes: [{
|
|
324
|
+
data: { label: "開始" },
|
|
325
|
+
id: "start",
|
|
326
|
+
position: {
|
|
327
|
+
x: 80,
|
|
328
|
+
y: 160
|
|
329
|
+
},
|
|
330
|
+
type: "startEvent"
|
|
331
|
+
}, {
|
|
332
|
+
data: {
|
|
333
|
+
endState: "APPROVED",
|
|
334
|
+
label: "完成",
|
|
335
|
+
triggerMode: "AND"
|
|
336
|
+
},
|
|
337
|
+
id: "end",
|
|
338
|
+
position: {
|
|
339
|
+
x: 560,
|
|
340
|
+
y: 160
|
|
341
|
+
},
|
|
342
|
+
type: "endEvent"
|
|
343
|
+
}]
|
|
344
|
+
};
|
|
345
|
+
function W(e) {
|
|
346
|
+
return e instanceof Error ? e.message : "發生未知錯誤";
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/views/templates/compose/TemplateComposeWizardView.tsx
|
|
350
|
+
function G() {
|
|
351
|
+
let n = e(), r = t(), i = H(), a = i.publishPhase === "submitting";
|
|
352
|
+
async function o() {
|
|
353
|
+
let e = await i.publish();
|
|
354
|
+
e && n.push(r.templateDesigner(e.templateId));
|
|
355
|
+
}
|
|
356
|
+
return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(f, { children: /* @__PURE__ */ S(w, {
|
|
357
|
+
description: "一次完成表單與流程設計,發佈後即可直接發起。",
|
|
358
|
+
title: "建立模板(表單 + 流程)",
|
|
359
|
+
children: /* @__PURE__ */ S(c, {
|
|
360
|
+
disabled: a,
|
|
361
|
+
onClick: () => n.push(r.templates()),
|
|
362
|
+
variant: "base-secondary",
|
|
363
|
+
children: "返回模板列表"
|
|
364
|
+
})
|
|
365
|
+
}) }), /* @__PURE__ */ S(m, { children: /* @__PURE__ */ C(p, { children: [
|
|
366
|
+
/* @__PURE__ */ C(_, {
|
|
367
|
+
currentStep: i.currentStep,
|
|
368
|
+
children: [
|
|
369
|
+
/* @__PURE__ */ S(g, {
|
|
370
|
+
description: "設計欄位與版面",
|
|
371
|
+
title: "表單設計"
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ S(g, {
|
|
374
|
+
description: "設計簽核節點與條件",
|
|
375
|
+
title: "流程設計"
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ S(g, {
|
|
378
|
+
description: "確認後發佈",
|
|
379
|
+
title: "檢視並發佈"
|
|
380
|
+
})
|
|
381
|
+
]
|
|
382
|
+
}),
|
|
383
|
+
i.currentStep === 0 ? /* @__PURE__ */ S(A, {
|
|
384
|
+
categoryId: i.categoryId,
|
|
385
|
+
formSchema: i.formSchema,
|
|
386
|
+
formUiSchema: i.formUiSchema,
|
|
387
|
+
name: i.name,
|
|
388
|
+
onCategoryIdChange: i.setCategoryId,
|
|
389
|
+
onFormChange: i.setFormValue,
|
|
390
|
+
onNameChange: i.setName
|
|
391
|
+
}) : null,
|
|
392
|
+
i.currentStep === 1 ? /* @__PURE__ */ S(z, {
|
|
393
|
+
formSchema: i.formSchema,
|
|
394
|
+
initiatorPolicyCel: i.initiatorPolicyCel,
|
|
395
|
+
onInitiatorPolicyChange: i.setInitiatorPolicyCel,
|
|
396
|
+
onWorkflowChange: i.setWorkflowDefinition,
|
|
397
|
+
workflowDefinition: i.workflowDefinition
|
|
398
|
+
}) : null,
|
|
399
|
+
i.currentStep === 2 ? /* @__PURE__ */ S(M, {
|
|
400
|
+
formSchema: i.formSchema,
|
|
401
|
+
formUiSchema: i.formUiSchema,
|
|
402
|
+
initiatorPolicyCel: i.initiatorPolicyCel,
|
|
403
|
+
name: i.name,
|
|
404
|
+
publishError: i.publishError,
|
|
405
|
+
workflowDefinition: i.workflowDefinition
|
|
406
|
+
}) : null,
|
|
407
|
+
/* @__PURE__ */ C("div", {
|
|
408
|
+
style: K,
|
|
409
|
+
children: [i.currentStep === 0 && !i.canLeaveBasics ? /* @__PURE__ */ S(b, {
|
|
410
|
+
color: "text-neutral",
|
|
411
|
+
variant: "caption",
|
|
412
|
+
children: "請填寫模板名稱、表單名稱,並至少新增一個表單欄位。"
|
|
413
|
+
}) : /* @__PURE__ */ S("span", {}), /* @__PURE__ */ C("div", {
|
|
414
|
+
style: q,
|
|
415
|
+
children: [/* @__PURE__ */ S(c, {
|
|
416
|
+
disabled: i.currentStep === 0 || a,
|
|
417
|
+
onClick: i.goBack,
|
|
418
|
+
variant: "base-secondary",
|
|
419
|
+
children: "上一步"
|
|
420
|
+
}), i.currentStep < 2 ? /* @__PURE__ */ S(c, {
|
|
421
|
+
disabled: i.currentStep === 0 && !i.canLeaveBasics,
|
|
422
|
+
onClick: i.goNext,
|
|
423
|
+
variant: "base-primary",
|
|
424
|
+
children: "下一步"
|
|
425
|
+
}) : /* @__PURE__ */ S(c, {
|
|
426
|
+
disabled: a,
|
|
427
|
+
loading: a,
|
|
428
|
+
onClick: () => {
|
|
429
|
+
o();
|
|
430
|
+
},
|
|
431
|
+
variant: "base-primary",
|
|
432
|
+
children: "發佈"
|
|
433
|
+
})]
|
|
434
|
+
})]
|
|
435
|
+
})
|
|
436
|
+
] }) })] });
|
|
437
|
+
}
|
|
438
|
+
var K = {
|
|
439
|
+
alignItems: "center",
|
|
440
|
+
display: "flex",
|
|
441
|
+
marginTop: "var(--mzn-spacing-padding-vertical-spacious)",
|
|
442
|
+
justifyContent: "space-between",
|
|
443
|
+
gap: 16
|
|
444
|
+
}, q = {
|
|
445
|
+
display: "flex",
|
|
446
|
+
gap: 8
|
|
447
|
+
};
|
|
448
|
+
//#endregion
|
|
449
|
+
export { H as i, B as n, V as r, G as t };
|
|
450
|
+
|
|
451
|
+
//# sourceMappingURL=compose-PMrmi-LE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-PMrmi-LE.js","names":[],"sources":["../../src/views/templates/compose/steps/ComposeFormStep.tsx","../../src/views/templates/compose/steps/ComposeReviewStep.tsx","../../src/views/templates/compose/steps/ComposeWorkflowStep.tsx","../../src/views/templates/compose/use-template-compose-wizard.ts","../../src/views/templates/compose/TemplateComposeWizardView.tsx"],"sourcesContent":["'use client';\n\nimport type { ChangeEvent, ReactElement } from 'react';\nimport { useEffect, useState } from 'react';\nimport { FormField, Input, Select, Typography } from '@mezzanine-ui/react';\nimport { FormFieldLayout } from '@mezzanine-ui/core/form';\nimport type { SelectValue } from '@mezzanine-ui/react/Select';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport {\n ApprovalTemplateCategoryRecord,\n listApprovalTemplateCategoriesPage,\n} from '@rytass/bpm-core-client/template';\nimport { FormBuilderView } from '../../../forms/builder';\n\nconst UNCATEGORIZED_OPTION: SelectValue = {\n id: 'UNCATEGORIZED',\n name: '未分類',\n};\n\nconst CATEGORY_PAGE_SIZE = 100;\n\nexport interface ComposeFormStepProps {\n readonly name: string;\n readonly categoryId: string | null;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly onNameChange: (value: string) => void;\n readonly onCategoryIdChange: (value: string | null) => void;\n readonly onFormChange: (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }) => void;\n}\n\nexport function ComposeFormStep({\n categoryId,\n formSchema,\n formUiSchema,\n name,\n onCategoryIdChange,\n onFormChange,\n onNameChange,\n}: ComposeFormStepProps): ReactElement {\n const [categoryOptions, setCategoryOptions] = useState<\n readonly ApprovalTemplateCategoryRecord[]\n >([]);\n\n useEffect((): (() => void) => {\n let active = true;\n\n void (async (): Promise<void> => {\n try {\n const result = await listApprovalTemplateCategoriesPage({\n page: 1,\n pageSize: CATEGORY_PAGE_SIZE,\n searchText: '',\n status: 'ACTIVE',\n });\n\n if (active) {\n setCategoryOptions(result.categories);\n }\n } catch {\n if (active) {\n setCategoryOptions([]);\n }\n }\n })();\n\n return (): void => {\n active = false;\n };\n }, []);\n\n const selectOptions: SelectValue[] = [\n UNCATEGORIZED_OPTION,\n ...categoryOptions.map((category) => ({\n id: category.id,\n name: category.name,\n })),\n ];\n const selectedOption =\n selectOptions.find((option) => option.id === categoryId) ??\n UNCATEGORIZED_OPTION;\n\n return (\n <>\n <div style={BASICS_GRID_STYLE}>\n <FormField\n label=\"名稱\"\n layout={FormFieldLayout.VERTICAL}\n name=\"composeName\"\n >\n <Input\n fullWidth\n onChange={(event: ChangeEvent<HTMLInputElement>): void =>\n onNameChange(event.target.value)\n }\n placeholder=\"例如:請款簽核\"\n value={name}\n />\n </FormField>\n <FormField\n label=\"分類(選填)\"\n layout={FormFieldLayout.VERTICAL}\n name=\"composeCategory\"\n >\n <Select\n clearable={false}\n fullWidth\n onChange={(option): void =>\n onCategoryIdChange(\n option && option.id !== UNCATEGORIZED_OPTION.id\n ? option.id\n : null,\n )\n }\n options={selectOptions}\n placeholder=\"未分類\"\n value={selectedOption}\n />\n </FormField>\n </div>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。\n </Typography>\n <FormBuilderView\n onChange={onFormChange}\n value={{ schema: formSchema, uiSchema: formUiSchema }}\n />\n </>\n );\n}\n\nconst BASICS_GRID_STYLE = {\n display: 'grid',\n gap: 16,\n gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))',\n} as const;\n","'use client';\n\nimport type { CSSProperties, ReactElement } from 'react';\nimport { Empty, Table, Tag, Typography } from '@mezzanine-ui/react';\nimport type { TableColumn } from '@mezzanine-ui/core/table';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport type {\n WorkflowDefinition,\n WorkflowNode,\n} from '@rytass/bpm-core-shared/workflow';\nimport { FormRenderer } from '../../../forms/renderer/FormRendererView';\n\ntype FlowNodeRow = Readonly<\n Record<string, unknown> & {\n detail: string;\n key: string;\n label: string;\n typeLabel: string;\n }\n>;\n\ntype BranchRow = Readonly<\n Record<string, unknown> & {\n condition: string;\n key: string;\n source: string;\n target: string;\n }\n>;\n\nexport interface ComposeReviewStepProps {\n readonly name: string;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly publishError: string | null;\n}\n\nexport function ComposeReviewStep({\n formSchema,\n formUiSchema,\n initiatorPolicyCel,\n name,\n publishError,\n workflowDefinition,\n}: ComposeReviewStepProps): ReactElement {\n const nodes = workflowDefinition?.nodes ?? [];\n const edges = workflowDefinition?.edges ?? [];\n const fieldCount = formSchema.fields.length;\n const nodeLabelById = new Map(\n nodes.map((node) => [node.id, node.data.label] as const),\n );\n const nodeRows: FlowNodeRow[] = nodes.map((node) => ({\n detail: readNodeDetail(node) ?? '—',\n key: node.id,\n label: node.data.label,\n typeLabel: readNodeTypeLabel(node),\n }));\n const branchRows: BranchRow[] = edges\n .filter((edge) => Boolean(edge.data.condition))\n .map((edge) => ({\n condition: edge.data.condition ?? '',\n key: edge.id,\n source: nodeLabelById.get(edge.source) ?? edge.source,\n target: nodeLabelById.get(edge.target) ?? edge.target,\n }));\n\n return (\n <div style={STACK_STYLE}>\n <Typography component=\"h2\" style={TITLE_STYLE} variant=\"h2\">\n {name || '(未命名)'}\n </Typography>\n\n <div style={STACK_STYLE}>\n <Typography variant=\"h3\">表單預覽</Typography>\n {fieldCount > 0 ? (\n <FormRenderer readonly schema={formSchema} uiSchema={formUiSchema} />\n ) : (\n <Empty title=\"尚未設計表單欄位\" />\n )}\n </div>\n\n <div style={STACK_STYLE}>\n <Typography variant=\"h3\">流程概覽</Typography>\n {nodes.length > 0 ? (\n <Table columns={NODE_COLUMNS} dataSource={nodeRows} fullWidth />\n ) : (\n <Empty title=\"尚未設計流程節點\" />\n )}\n {branchRows.length > 0 ? (\n <>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 條件分流\n </Typography>\n <Table columns={BRANCH_COLUMNS} dataSource={branchRows} fullWidth />\n </>\n ) : null}\n {initiatorPolicyCel ? (\n <Typography color=\"text-neutral\" variant=\"caption\">\n 發起權限:{initiatorPolicyCel}\n </Typography>\n ) : null}\n </div>\n\n {publishError ? (\n <Typography color=\"text-error\" variant=\"body\">\n {publishError}\n </Typography>\n ) : null}\n </div>\n );\n}\n\nconst NODE_COLUMNS: TableColumn<FlowNodeRow>[] = [\n {\n key: 'type',\n render: (record: FlowNodeRow): ReactElement => (\n <Tag label={record.typeLabel} size=\"sub\" type=\"static\" />\n ),\n title: '類型',\n width: 130,\n },\n { dataIndex: 'label', key: 'label', title: '節點' },\n { dataIndex: 'detail', key: 'detail', title: '簽核方式', width: 160 },\n];\n\nconst BRANCH_COLUMNS: TableColumn<BranchRow>[] = [\n { dataIndex: 'source', key: 'source', title: '來源', width: 180 },\n { dataIndex: 'target', key: 'target', title: '目標', width: 180 },\n { dataIndex: 'condition', key: 'condition', title: '條件' },\n];\n\nfunction readNodeTypeLabel(node: WorkflowNode): string {\n switch (node.type) {\n case 'startEvent':\n return '開始';\n case 'endEvent':\n return node.data.endState === 'REJECTED' ? '結束(駁回)' : '結束(核准)';\n case 'userTask':\n return '簽核';\n case 'serviceTask':\n return '服務';\n case 'exclusiveGateway':\n return '條件閘道';\n case 'parallelGateway':\n return '平行閘道';\n default:\n return '節點';\n }\n}\n\nfunction readNodeDetail(node: WorkflowNode): string | null {\n if (node.type !== 'userTask') {\n return null;\n }\n\n switch (node.data.approverResolver.type) {\n case 'DIRECT':\n return '指定成員';\n case 'POSITION':\n return '指定職位';\n case 'ORG_UNIT_MEMBER':\n return '單位成員';\n case 'ORG_UNIT_POSITION':\n return '單位職位';\n case 'ORG_MANAGER':\n return '主管';\n case 'ORG_UNIT_MANAGER':\n return '單位主管';\n case 'DYNAMIC_FORM':\n return '表單動態指派';\n case 'EXPRESSION':\n return '運算式';\n default:\n return '簽核人';\n }\n}\n\nconst STACK_STYLE: CSSProperties = {\n display: 'grid',\n gap: 12,\n};\n\n// Match the breathing room between the stepper and the PageHeader, which is the\n// Section's top padding token.\nconst TITLE_STYLE: CSSProperties = {\n marginTop: 'var(--mzn-spacing-padding-vertical-spacious)',\n};\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport { Typography } from '@mezzanine-ui/react';\nimport type { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';\nimport type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';\nimport { TemplateDesignerView } from '../../designer';\n\nexport interface ComposeWorkflowStepProps {\n readonly formSchema: FormDefinitionSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly onWorkflowChange: (definition: WorkflowDefinition) => void;\n readonly onInitiatorPolicyChange: (cel: string | null) => void;\n}\n\nexport function ComposeWorkflowStep({\n formSchema,\n initiatorPolicyCel,\n onInitiatorPolicyChange,\n onWorkflowChange,\n workflowDefinition,\n}: ComposeWorkflowStepProps): ReactElement {\n return (\n <>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。\n </Typography>\n <TemplateDesignerView\n embedded\n formSchemaOverride={formSchema}\n initialInitiatorPolicyCel={initiatorPolicyCel}\n initialWorkflowDefinition={workflowDefinition ?? undefined}\n onInitiatorPolicyChange={onInitiatorPolicyChange}\n onWorkflowChange={onWorkflowChange}\n />\n </>\n );\n}\n","'use client';\n\nimport { useCallback, useState } from 'react';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';\nimport {\n ComposeApprovalTemplateWithFormResult,\n composeApprovalTemplateWithForm,\n} from '@rytass/bpm-core-client/template';\n\nexport type ComposeWizardStep = 0 | 1 | 2;\n\nexport type ComposePublishPhase = 'error' | 'idle' | 'submitting' | 'success';\n\nexport const EMPTY_COMPOSE_FORM_SCHEMA: FormDefinitionSchema = {\n fields: [],\n schemaVersion: 1,\n};\n\nexport const EMPTY_COMPOSE_FORM_UI_SCHEMA: FormUiSchema = {\n layout: [],\n schemaVersion: 1,\n};\n\nexport interface TemplateComposeWizard {\n readonly currentStep: ComposeWizardStep;\n /**\n * Single user-facing name. Persisted to both the template and the form\n * (`templateName` / `formName`) at the `composeApprovalTemplateWithForm`\n * boundary — the DB keeps two columns, the UI keeps one field.\n */\n readonly name: string;\n readonly categoryId: string | null;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly publishPhase: ComposePublishPhase;\n readonly publishError: string | null;\n readonly canLeaveBasics: boolean;\n readonly goToStep: (step: ComposeWizardStep) => void;\n readonly goNext: () => void;\n readonly goBack: () => void;\n readonly setName: (value: string) => void;\n readonly setCategoryId: (value: string | null) => void;\n readonly setFormValue: (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }) => void;\n readonly setWorkflowDefinition: (definition: WorkflowDefinition) => void;\n readonly setInitiatorPolicyCel: (cel: string | null) => void;\n readonly publish: () => Promise<ComposeApprovalTemplateWithFormResult | null>;\n}\n\n/**\n * Owns the cross-step state for the unified \"form + flow\" template wizard.\n *\n * Step 0 (表單) edits `formSchema`/`formUiSchema`; that same in-memory schema\n * feeds Step 1 (流程) as the field source for condition branches, so the\n * embedded designer never needs a published form version. Step 2 (檢視發佈)\n * submits everything through the atomic `composeApprovalTemplateWithForm`\n * mutation.\n */\nexport function useTemplateComposeWizard(): TemplateComposeWizard {\n const [currentStep, setCurrentStep] = useState<ComposeWizardStep>(0);\n const [name, setName] = useState('');\n const [categoryId, setCategoryId] = useState<string | null>(null);\n const [formSchema, setFormSchema] = useState<FormDefinitionSchema>(\n EMPTY_COMPOSE_FORM_SCHEMA,\n );\n const [formUiSchema, setFormUiSchema] = useState<FormUiSchema>(\n EMPTY_COMPOSE_FORM_UI_SCHEMA,\n );\n const [workflowDefinition, setWorkflowDefinitionState] =\n useState<WorkflowDefinition | null>(null);\n const [initiatorPolicyCel, setInitiatorPolicyCelState] = useState<\n string | null\n >(null);\n const [publishPhase, setPublishPhase] = useState<ComposePublishPhase>('idle');\n const [publishError, setPublishError] = useState<string | null>(null);\n\n const canLeaveBasics = name.trim().length > 0 && formSchema.fields.length > 0;\n\n const goToStep = useCallback((step: ComposeWizardStep): void => {\n setCurrentStep(step);\n }, []);\n\n const goNext = useCallback((): void => {\n setCurrentStep((step) =>\n step < 2 ? ((step + 1) as ComposeWizardStep) : step,\n );\n }, []);\n\n const goBack = useCallback((): void => {\n setCurrentStep((step) =>\n step > 0 ? ((step - 1) as ComposeWizardStep) : step,\n );\n }, []);\n\n const setFormValue = useCallback(\n (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }): void => {\n setFormSchema(next.schema);\n setFormUiSchema(next.uiSchema);\n },\n [],\n );\n\n const setWorkflowDefinition = useCallback(\n (definition: WorkflowDefinition): void => {\n setWorkflowDefinitionState(definition);\n },\n [],\n );\n\n const setInitiatorPolicyCel = useCallback((cel: string | null): void => {\n setInitiatorPolicyCelState(cel);\n }, []);\n\n const publish =\n useCallback(async (): Promise<ComposeApprovalTemplateWithFormResult | null> => {\n setPublishPhase('submitting');\n setPublishError(null);\n\n try {\n const result = await composeApprovalTemplateWithForm({\n category: null,\n categoryId,\n formDefinitionId: null,\n formDescription: null,\n // One UI name fans out to both persisted columns.\n formName: name,\n initiatorPolicyCel,\n notificationConfig: null,\n publish: true,\n schema: formSchema,\n slaDefaults: null,\n templateDescription: null,\n templateId: null,\n templateName: name,\n uiSchema: formUiSchema,\n workflowDefinition: workflowDefinition ?? EMPTY_WORKFLOW_DEFINITION,\n });\n\n setPublishPhase('success');\n\n return result;\n } catch (requestError: unknown) {\n setPublishError(readErrorMessage(requestError));\n setPublishPhase('error');\n\n return null;\n }\n }, [\n categoryId,\n formSchema,\n formUiSchema,\n initiatorPolicyCel,\n name,\n workflowDefinition,\n ]);\n\n return {\n canLeaveBasics,\n categoryId,\n currentStep,\n formSchema,\n formUiSchema,\n goBack,\n goNext,\n goToStep,\n initiatorPolicyCel,\n name,\n publish,\n publishError,\n publishPhase,\n setCategoryId,\n setFormValue,\n setInitiatorPolicyCel,\n setName,\n setWorkflowDefinition,\n workflowDefinition,\n };\n}\n\nconst EMPTY_WORKFLOW_DEFINITION: WorkflowDefinition = {\n edges: [],\n meta: { schemaVersion: 1 },\n nodes: [\n {\n data: { label: '開始' },\n id: 'start',\n position: { x: 80, y: 160 },\n type: 'startEvent',\n },\n {\n data: { endState: 'APPROVED', label: '完成', triggerMode: 'AND' },\n id: 'end',\n position: { x: 560, y: 160 },\n type: 'endEvent',\n },\n ],\n};\n\nfunction readErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : '發生未知錯誤';\n}\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport {\n Button,\n PageHeader,\n Section,\n SectionGroup,\n Step,\n Stepper,\n Typography,\n} from '@mezzanine-ui/react';\nimport ContentHeader from '@mezzanine-ui/react/ContentHeader';\nimport { useRouterAdapter } from '../../../lib/router-adapter';\nimport { useBPMRoutes } from '../../../lib/routes-config';\nimport { ComposeFormStep } from './steps/ComposeFormStep';\nimport { ComposeReviewStep } from './steps/ComposeReviewStep';\nimport { ComposeWorkflowStep } from './steps/ComposeWorkflowStep';\nimport { useTemplateComposeWizard } from './use-template-compose-wizard';\n\n/**\n * Unified \"form + flow\" template creation wizard. Walks the user through\n * Step 0 表單設計 → Step 1 流程設計 → Step 2 檢視並發佈, then commits both\n * sides atomically through `composeApprovalTemplateWithForm`. Coexists with\n * the separate `/forms` and `/templates` entry points.\n */\nexport function TemplateComposeWizardView(): ReactElement {\n const router = useRouterAdapter();\n const routes = useBPMRoutes();\n const wizard = useTemplateComposeWizard();\n const submitting = wizard.publishPhase === 'submitting';\n\n async function handlePublish(): Promise<void> {\n const result = await wizard.publish();\n\n if (result) {\n router.push(routes.templateDesigner(result.templateId));\n }\n }\n\n return (\n <>\n <PageHeader>\n <ContentHeader\n description=\"一次完成表單與流程設計,發佈後即可直接發起。\"\n title=\"建立模板(表單 + 流程)\"\n >\n <Button\n disabled={submitting}\n onClick={(): void => router.push(routes.templates())}\n variant=\"base-secondary\"\n >\n 返回模板列表\n </Button>\n </ContentHeader>\n </PageHeader>\n\n <SectionGroup>\n <Section>\n <Stepper currentStep={wizard.currentStep}>\n <Step description=\"設計欄位與版面\" title=\"表單設計\" />\n <Step description=\"設計簽核節點與條件\" title=\"流程設計\" />\n <Step description=\"確認後發佈\" title=\"檢視並發佈\" />\n </Stepper>\n\n {wizard.currentStep === 0 ? (\n <ComposeFormStep\n categoryId={wizard.categoryId}\n formSchema={wizard.formSchema}\n formUiSchema={wizard.formUiSchema}\n name={wizard.name}\n onCategoryIdChange={wizard.setCategoryId}\n onFormChange={wizard.setFormValue}\n onNameChange={wizard.setName}\n />\n ) : null}\n\n {wizard.currentStep === 1 ? (\n <ComposeWorkflowStep\n formSchema={wizard.formSchema}\n initiatorPolicyCel={wizard.initiatorPolicyCel}\n onInitiatorPolicyChange={wizard.setInitiatorPolicyCel}\n onWorkflowChange={wizard.setWorkflowDefinition}\n workflowDefinition={wizard.workflowDefinition}\n />\n ) : null}\n\n {wizard.currentStep === 2 ? (\n <ComposeReviewStep\n formSchema={wizard.formSchema}\n formUiSchema={wizard.formUiSchema}\n initiatorPolicyCel={wizard.initiatorPolicyCel}\n name={wizard.name}\n publishError={wizard.publishError}\n workflowDefinition={wizard.workflowDefinition}\n />\n ) : null}\n\n <div style={FOOTER_STYLE}>\n {wizard.currentStep === 0 && !wizard.canLeaveBasics ? (\n <Typography color=\"text-neutral\" variant=\"caption\">\n 請填寫模板名稱、表單名稱,並至少新增一個表單欄位。\n </Typography>\n ) : (\n <span />\n )}\n <div style={FOOTER_ACTIONS_STYLE}>\n <Button\n disabled={wizard.currentStep === 0 || submitting}\n onClick={wizard.goBack}\n variant=\"base-secondary\"\n >\n 上一步\n </Button>\n {wizard.currentStep < 2 ? (\n <Button\n disabled={wizard.currentStep === 0 && !wizard.canLeaveBasics}\n onClick={wizard.goNext}\n variant=\"base-primary\"\n >\n 下一步\n </Button>\n ) : (\n <Button\n disabled={submitting}\n loading={submitting}\n onClick={(): void => {\n void handlePublish();\n }}\n variant=\"base-primary\"\n >\n 發佈\n </Button>\n )}\n </div>\n </div>\n </Section>\n </SectionGroup>\n </>\n );\n}\n\nconst FOOTER_STYLE = {\n alignItems: 'center',\n display: 'flex',\n // Match the breathing room used elsewhere (the Section's top padding token).\n marginTop: 'var(--mzn-spacing-padding-vertical-spacious)',\n justifyContent: 'space-between',\n gap: 16,\n} as const;\n\nconst FOOTER_ACTIONS_STYLE = {\n display: 'flex',\n gap: 8,\n} as const;\n"],"mappings":";;;;;;;;;;;;;AAiBA,IAAM,IAAoC;CACxC,IAAI;CACJ,MAAM;AACR,GAEM,IAAqB;AAe3B,SAAgB,EAAgB,EAC9B,eACA,eACA,iBACA,SACA,uBACA,iBACA,mBACqC;CACrC,IAAM,CAAC,GAAiB,KAAsB,EAE5C,CAAC,CAAC;CAEJ,QAA8B;EAC5B,IAAI,IAAS;EAqBb,QAnBM,YAA2B;GAC/B,IAAI;IACF,IAAM,IAAS,MAAM,EAAmC;KACtD,MAAM;KACN,UAAU;KACV,YAAY;KACZ,QAAQ;IACV,CAAC;IAED,AAAI,KACF,EAAmB,EAAO,UAAU;GAExC,QAAQ;IACN,AAAI,KACF,EAAmB,CAAC,CAAC;GAEzB;EACF,GAAG,SAEgB;GACjB,IAAS;EACX;CACF,GAAG,CAAC,CAAC;CAEL,IAAM,IAA+B,CACnC,GACA,GAAG,EAAgB,KAAK,OAAc;EACpC,IAAI,EAAS;EACb,MAAM,EAAS;CACjB,EAAE,CACJ,GACM,IACJ,EAAc,MAAM,MAAW,EAAO,OAAO,CAAU,KACvD;CAEF,OACE,kBAAA,GAAA,EAAA,UAAA;EACE,kBAAC,OAAD;GAAK,OAAO;aAAZ,CACE,kBAAC,GAAD;IACE,OAAM;IACN,QAAQ,EAAgB;IACxB,MAAK;cAEL,kBAAC,GAAD;KACE,WAAA;KACA,WAAW,MACT,EAAa,EAAM,OAAO,KAAK;KAEjC,aAAY;KACZ,OAAO;IACR,CAAA;GACQ,CAAA,GAC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AACP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("./chunk-CMqjfN_6.cjs"),t=require("./router-adapter--gYs13E8.cjs"),n=require("./routes-config-fDVHmvXi.cjs"),r=require("./FormRendererView-BwVsH2eX.cjs"),i=require("./FormBuilderView-B_KGPjlp.cjs"),a=require("./designer-DCn6_v4b.cjs");let o=require("react"),s=require("@mezzanine-ui/react"),c=require("react/jsx-runtime"),l=require("@mezzanine-ui/react/ContentHeader");l=e.t(l,1);let u=require("@mezzanine-ui/core/form"),d=require("@rytass/bpm-core-client/template");var f={id:`UNCATEGORIZED`,name:`未分類`},p=100;function m({categoryId:e,formSchema:t,formUiSchema:n,name:r,onCategoryIdChange:a,onFormChange:l,onNameChange:m}){let[g,_]=(0,o.useState)([]);(0,o.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await(0,d.listApprovalTemplateCategoriesPage)({page:1,pageSize:p,searchText:``,status:`ACTIVE`});e&&_(t.categories)}catch{e&&_([])}})(),()=>{e=!1}},[]);let v=[f,...g.map(e=>({id:e.id,name:e.name}))],y=v.find(t=>t.id===e)??f;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`div`,{style:h,children:[(0,c.jsx)(s.FormField,{label:`名稱`,layout:u.FormFieldLayout.VERTICAL,name:`composeName`,children:(0,c.jsx)(s.Input,{fullWidth:!0,onChange:e=>m(e.target.value),placeholder:`例如:請款簽核`,value:r})}),(0,c.jsx)(s.FormField,{label:`分類(選填)`,layout:u.FormFieldLayout.VERTICAL,name:`composeCategory`,children:(0,c.jsx)(s.Select,{clearable:!1,fullWidth:!0,onChange:e=>a(e&&e.id!==f.id?e.id:null),options:v,placeholder:`未分類`,value:y})})]}),(0,c.jsx)(s.Typography,{color:`text-neutral`,variant:`caption`,children:`先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。`}),(0,c.jsx)(i.t,{onChange:l,value:{schema:t,uiSchema:n}})]})}var h={display:`grid`,gap:16,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`};function g({formSchema:e,formUiSchema:t,initiatorPolicyCel:n,name:i,publishError:a,workflowDefinition:o}){let l=o?.nodes??[],u=o?.edges??[],d=e.fields.length,f=new Map(l.map(e=>[e.id,e.data.label])),p=l.map(e=>({detail:b(e)??`—`,key:e.id,label:e.data.label,typeLabel:y(e)})),m=u.filter(e=>!!e.data.condition).map(e=>({condition:e.data.condition??``,key:e.id,source:f.get(e.source)??e.source,target:f.get(e.target)??e.target}));return(0,c.jsxs)(`div`,{style:x,children:[(0,c.jsx)(s.Typography,{component:`h2`,style:S,variant:`h2`,children:i||`(未命名)`}),(0,c.jsxs)(`div`,{style:x,children:[(0,c.jsx)(s.Typography,{variant:`h3`,children:`表單預覽`}),d>0?(0,c.jsx)(r.t,{readonly:!0,schema:e,uiSchema:t}):(0,c.jsx)(s.Empty,{title:`尚未設計表單欄位`})]}),(0,c.jsxs)(`div`,{style:x,children:[(0,c.jsx)(s.Typography,{variant:`h3`,children:`流程概覽`}),l.length>0?(0,c.jsx)(s.Table,{columns:_,dataSource:p,fullWidth:!0}):(0,c.jsx)(s.Empty,{title:`尚未設計流程節點`}),m.length>0?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.Typography,{color:`text-neutral`,variant:`caption`,children:`條件分流`}),(0,c.jsx)(s.Table,{columns:v,dataSource:m,fullWidth:!0})]}):null,n?(0,c.jsxs)(s.Typography,{color:`text-neutral`,variant:`caption`,children:[`發起權限:`,n]}):null]}),a?(0,c.jsx)(s.Typography,{color:`text-error`,variant:`body`,children:a}):null]})}var _=[{key:`type`,render:e=>(0,c.jsx)(s.Tag,{label:e.typeLabel,size:`sub`,type:`static`}),title:`類型`,width:130},{dataIndex:`label`,key:`label`,title:`節點`},{dataIndex:`detail`,key:`detail`,title:`簽核方式`,width:160}],v=[{dataIndex:`source`,key:`source`,title:`來源`,width:180},{dataIndex:`target`,key:`target`,title:`目標`,width:180},{dataIndex:`condition`,key:`condition`,title:`條件`}];function y(e){switch(e.type){case`startEvent`:return`開始`;case`endEvent`:return e.data.endState===`REJECTED`?`結束(駁回)`:`結束(核准)`;case`userTask`:return`簽核`;case`serviceTask`:return`服務`;case`exclusiveGateway`:return`條件閘道`;case`parallelGateway`:return`平行閘道`;default:return`節點`}}function b(e){if(e.type!==`userTask`)return null;switch(e.data.approverResolver.type){case`DIRECT`:return`指定成員`;case`POSITION`:return`指定職位`;case`ORG_UNIT_MEMBER`:return`單位成員`;case`ORG_UNIT_POSITION`:return`單位職位`;case`ORG_MANAGER`:return`主管`;case`ORG_UNIT_MANAGER`:return`單位主管`;case`DYNAMIC_FORM`:return`表單動態指派`;case`EXPRESSION`:return`運算式`;default:return`簽核人`}}var x={display:`grid`,gap:12},S={marginTop:`var(--mzn-spacing-padding-vertical-spacious)`};function C({formSchema:e,initiatorPolicyCel:t,onInitiatorPolicyChange:n,onWorkflowChange:r,workflowDefinition:i}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.Typography,{color:`text-neutral`,variant:`caption`,children:`設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。`}),(0,c.jsx)(a.t,{embedded:!0,formSchemaOverride:e,initialInitiatorPolicyCel:t,initialWorkflowDefinition:i??void 0,onInitiatorPolicyChange:n,onWorkflowChange:r})]})}var w={fields:[],schemaVersion:1},T={layout:[],schemaVersion:1};function E(){let[e,t]=(0,o.useState)(0),[n,r]=(0,o.useState)(``),[i,a]=(0,o.useState)(null),[s,c]=(0,o.useState)(w),[l,u]=(0,o.useState)(T),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(null),[g,_]=(0,o.useState)(`idle`),[v,y]=(0,o.useState)(null),b=n.trim().length>0&&s.fields.length>0,x=(0,o.useCallback)(e=>{t(e)},[]),S=(0,o.useCallback)(()=>{t(e=>e<2?e+1:e)},[]),C=(0,o.useCallback)(()=>{t(e=>e>0?e-1:e)},[]),E=(0,o.useCallback)(e=>{c(e.schema),u(e.uiSchema)},[]),k=(0,o.useCallback)(e=>{p(e)},[]),A=(0,o.useCallback)(e=>{h(e)},[]);return{canLeaveBasics:b,categoryId:i,currentStep:e,formSchema:s,formUiSchema:l,goBack:C,goNext:S,goToStep:x,initiatorPolicyCel:m,name:n,publish:(0,o.useCallback)(async()=>{_(`submitting`),y(null);try{let e=await(0,d.composeApprovalTemplateWithForm)({category:null,categoryId:i,formDefinitionId:null,formDescription:null,formName:n,initiatorPolicyCel:m,notificationConfig:null,publish:!0,schema:s,slaDefaults:null,templateDescription:null,templateId:null,templateName:n,uiSchema:l,workflowDefinition:f??D});return _(`success`),e}catch(e){return y(O(e)),_(`error`),null}},[i,s,l,m,n,f]),publishError:v,publishPhase:g,setCategoryId:a,setFormValue:E,setInitiatorPolicyCel:A,setName:r,setWorkflowDefinition:k,workflowDefinition:f}}var D={edges:[],meta:{schemaVersion:1},nodes:[{data:{label:`開始`},id:`start`,position:{x:80,y:160},type:`startEvent`},{data:{endState:`APPROVED`,label:`完成`,triggerMode:`AND`},id:`end`,position:{x:560,y:160},type:`endEvent`}]};function O(e){return e instanceof Error?e.message:`發生未知錯誤`}function k(){let e=t.r(),r=n.r(),i=E(),a=i.publishPhase===`submitting`;async function o(){let t=await i.publish();t&&e.push(r.templateDesigner(t.templateId))}return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.PageHeader,{children:(0,c.jsx)(l.default,{description:`一次完成表單與流程設計,發佈後即可直接發起。`,title:`建立模板(表單 + 流程)`,children:(0,c.jsx)(s.Button,{disabled:a,onClick:()=>e.push(r.templates()),variant:`base-secondary`,children:`返回模板列表`})})}),(0,c.jsx)(s.SectionGroup,{children:(0,c.jsxs)(s.Section,{children:[(0,c.jsxs)(s.Stepper,{currentStep:i.currentStep,children:[(0,c.jsx)(s.Step,{description:`設計欄位與版面`,title:`表單設計`}),(0,c.jsx)(s.Step,{description:`設計簽核節點與條件`,title:`流程設計`}),(0,c.jsx)(s.Step,{description:`確認後發佈`,title:`檢視並發佈`})]}),i.currentStep===0?(0,c.jsx)(m,{categoryId:i.categoryId,formSchema:i.formSchema,formUiSchema:i.formUiSchema,name:i.name,onCategoryIdChange:i.setCategoryId,onFormChange:i.setFormValue,onNameChange:i.setName}):null,i.currentStep===1?(0,c.jsx)(C,{formSchema:i.formSchema,initiatorPolicyCel:i.initiatorPolicyCel,onInitiatorPolicyChange:i.setInitiatorPolicyCel,onWorkflowChange:i.setWorkflowDefinition,workflowDefinition:i.workflowDefinition}):null,i.currentStep===2?(0,c.jsx)(g,{formSchema:i.formSchema,formUiSchema:i.formUiSchema,initiatorPolicyCel:i.initiatorPolicyCel,name:i.name,publishError:i.publishError,workflowDefinition:i.workflowDefinition}):null,(0,c.jsxs)(`div`,{style:A,children:[i.currentStep===0&&!i.canLeaveBasics?(0,c.jsx)(s.Typography,{color:`text-neutral`,variant:`caption`,children:`請填寫模板名稱、表單名稱,並至少新增一個表單欄位。`}):(0,c.jsx)(`span`,{}),(0,c.jsxs)(`div`,{style:j,children:[(0,c.jsx)(s.Button,{disabled:i.currentStep===0||a,onClick:i.goBack,variant:`base-secondary`,children:`上一步`}),i.currentStep<2?(0,c.jsx)(s.Button,{disabled:i.currentStep===0&&!i.canLeaveBasics,onClick:i.goNext,variant:`base-primary`,children:`下一步`}):(0,c.jsx)(s.Button,{disabled:a,loading:a,onClick:()=>{o()},variant:`base-primary`,children:`發佈`})]})]})]})})]})}var A={alignItems:`center`,display:`flex`,marginTop:`var(--mzn-spacing-padding-vertical-spacious)`,justifyContent:`space-between`,gap:16},j={display:`flex`,gap:8};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return k}});
|
|
2
|
+
//# sourceMappingURL=compose-ziVbRYdo.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-ziVbRYdo.cjs","names":[],"sources":["../../src/views/templates/compose/steps/ComposeFormStep.tsx","../../src/views/templates/compose/steps/ComposeReviewStep.tsx","../../src/views/templates/compose/steps/ComposeWorkflowStep.tsx","../../src/views/templates/compose/use-template-compose-wizard.ts","../../src/views/templates/compose/TemplateComposeWizardView.tsx"],"sourcesContent":["'use client';\n\nimport type { ChangeEvent, ReactElement } from 'react';\nimport { useEffect, useState } from 'react';\nimport { FormField, Input, Select, Typography } from '@mezzanine-ui/react';\nimport { FormFieldLayout } from '@mezzanine-ui/core/form';\nimport type { SelectValue } from '@mezzanine-ui/react/Select';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport {\n ApprovalTemplateCategoryRecord,\n listApprovalTemplateCategoriesPage,\n} from '@rytass/bpm-core-client/template';\nimport { FormBuilderView } from '../../../forms/builder';\n\nconst UNCATEGORIZED_OPTION: SelectValue = {\n id: 'UNCATEGORIZED',\n name: '未分類',\n};\n\nconst CATEGORY_PAGE_SIZE = 100;\n\nexport interface ComposeFormStepProps {\n readonly name: string;\n readonly categoryId: string | null;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly onNameChange: (value: string) => void;\n readonly onCategoryIdChange: (value: string | null) => void;\n readonly onFormChange: (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }) => void;\n}\n\nexport function ComposeFormStep({\n categoryId,\n formSchema,\n formUiSchema,\n name,\n onCategoryIdChange,\n onFormChange,\n onNameChange,\n}: ComposeFormStepProps): ReactElement {\n const [categoryOptions, setCategoryOptions] = useState<\n readonly ApprovalTemplateCategoryRecord[]\n >([]);\n\n useEffect((): (() => void) => {\n let active = true;\n\n void (async (): Promise<void> => {\n try {\n const result = await listApprovalTemplateCategoriesPage({\n page: 1,\n pageSize: CATEGORY_PAGE_SIZE,\n searchText: '',\n status: 'ACTIVE',\n });\n\n if (active) {\n setCategoryOptions(result.categories);\n }\n } catch {\n if (active) {\n setCategoryOptions([]);\n }\n }\n })();\n\n return (): void => {\n active = false;\n };\n }, []);\n\n const selectOptions: SelectValue[] = [\n UNCATEGORIZED_OPTION,\n ...categoryOptions.map((category) => ({\n id: category.id,\n name: category.name,\n })),\n ];\n const selectedOption =\n selectOptions.find((option) => option.id === categoryId) ??\n UNCATEGORIZED_OPTION;\n\n return (\n <>\n <div style={BASICS_GRID_STYLE}>\n <FormField\n label=\"名稱\"\n layout={FormFieldLayout.VERTICAL}\n name=\"composeName\"\n >\n <Input\n fullWidth\n onChange={(event: ChangeEvent<HTMLInputElement>): void =>\n onNameChange(event.target.value)\n }\n placeholder=\"例如:請款簽核\"\n value={name}\n />\n </FormField>\n <FormField\n label=\"分類(選填)\"\n layout={FormFieldLayout.VERTICAL}\n name=\"composeCategory\"\n >\n <Select\n clearable={false}\n fullWidth\n onChange={(option): void =>\n onCategoryIdChange(\n option && option.id !== UNCATEGORIZED_OPTION.id\n ? option.id\n : null,\n )\n }\n options={selectOptions}\n placeholder=\"未分類\"\n value={selectedOption}\n />\n </FormField>\n </div>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。\n </Typography>\n <FormBuilderView\n onChange={onFormChange}\n value={{ schema: formSchema, uiSchema: formUiSchema }}\n />\n </>\n );\n}\n\nconst BASICS_GRID_STYLE = {\n display: 'grid',\n gap: 16,\n gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))',\n} as const;\n","'use client';\n\nimport type { CSSProperties, ReactElement } from 'react';\nimport { Empty, Table, Tag, Typography } from '@mezzanine-ui/react';\nimport type { TableColumn } from '@mezzanine-ui/core/table';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport type {\n WorkflowDefinition,\n WorkflowNode,\n} from '@rytass/bpm-core-shared/workflow';\nimport { FormRenderer } from '../../../forms/renderer/FormRendererView';\n\ntype FlowNodeRow = Readonly<\n Record<string, unknown> & {\n detail: string;\n key: string;\n label: string;\n typeLabel: string;\n }\n>;\n\ntype BranchRow = Readonly<\n Record<string, unknown> & {\n condition: string;\n key: string;\n source: string;\n target: string;\n }\n>;\n\nexport interface ComposeReviewStepProps {\n readonly name: string;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly publishError: string | null;\n}\n\nexport function ComposeReviewStep({\n formSchema,\n formUiSchema,\n initiatorPolicyCel,\n name,\n publishError,\n workflowDefinition,\n}: ComposeReviewStepProps): ReactElement {\n const nodes = workflowDefinition?.nodes ?? [];\n const edges = workflowDefinition?.edges ?? [];\n const fieldCount = formSchema.fields.length;\n const nodeLabelById = new Map(\n nodes.map((node) => [node.id, node.data.label] as const),\n );\n const nodeRows: FlowNodeRow[] = nodes.map((node) => ({\n detail: readNodeDetail(node) ?? '—',\n key: node.id,\n label: node.data.label,\n typeLabel: readNodeTypeLabel(node),\n }));\n const branchRows: BranchRow[] = edges\n .filter((edge) => Boolean(edge.data.condition))\n .map((edge) => ({\n condition: edge.data.condition ?? '',\n key: edge.id,\n source: nodeLabelById.get(edge.source) ?? edge.source,\n target: nodeLabelById.get(edge.target) ?? edge.target,\n }));\n\n return (\n <div style={STACK_STYLE}>\n <Typography component=\"h2\" style={TITLE_STYLE} variant=\"h2\">\n {name || '(未命名)'}\n </Typography>\n\n <div style={STACK_STYLE}>\n <Typography variant=\"h3\">表單預覽</Typography>\n {fieldCount > 0 ? (\n <FormRenderer readonly schema={formSchema} uiSchema={formUiSchema} />\n ) : (\n <Empty title=\"尚未設計表單欄位\" />\n )}\n </div>\n\n <div style={STACK_STYLE}>\n <Typography variant=\"h3\">流程概覽</Typography>\n {nodes.length > 0 ? (\n <Table columns={NODE_COLUMNS} dataSource={nodeRows} fullWidth />\n ) : (\n <Empty title=\"尚未設計流程節點\" />\n )}\n {branchRows.length > 0 ? (\n <>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 條件分流\n </Typography>\n <Table columns={BRANCH_COLUMNS} dataSource={branchRows} fullWidth />\n </>\n ) : null}\n {initiatorPolicyCel ? (\n <Typography color=\"text-neutral\" variant=\"caption\">\n 發起權限:{initiatorPolicyCel}\n </Typography>\n ) : null}\n </div>\n\n {publishError ? (\n <Typography color=\"text-error\" variant=\"body\">\n {publishError}\n </Typography>\n ) : null}\n </div>\n );\n}\n\nconst NODE_COLUMNS: TableColumn<FlowNodeRow>[] = [\n {\n key: 'type',\n render: (record: FlowNodeRow): ReactElement => (\n <Tag label={record.typeLabel} size=\"sub\" type=\"static\" />\n ),\n title: '類型',\n width: 130,\n },\n { dataIndex: 'label', key: 'label', title: '節點' },\n { dataIndex: 'detail', key: 'detail', title: '簽核方式', width: 160 },\n];\n\nconst BRANCH_COLUMNS: TableColumn<BranchRow>[] = [\n { dataIndex: 'source', key: 'source', title: '來源', width: 180 },\n { dataIndex: 'target', key: 'target', title: '目標', width: 180 },\n { dataIndex: 'condition', key: 'condition', title: '條件' },\n];\n\nfunction readNodeTypeLabel(node: WorkflowNode): string {\n switch (node.type) {\n case 'startEvent':\n return '開始';\n case 'endEvent':\n return node.data.endState === 'REJECTED' ? '結束(駁回)' : '結束(核准)';\n case 'userTask':\n return '簽核';\n case 'serviceTask':\n return '服務';\n case 'exclusiveGateway':\n return '條件閘道';\n case 'parallelGateway':\n return '平行閘道';\n default:\n return '節點';\n }\n}\n\nfunction readNodeDetail(node: WorkflowNode): string | null {\n if (node.type !== 'userTask') {\n return null;\n }\n\n switch (node.data.approverResolver.type) {\n case 'DIRECT':\n return '指定成員';\n case 'POSITION':\n return '指定職位';\n case 'ORG_UNIT_MEMBER':\n return '單位成員';\n case 'ORG_UNIT_POSITION':\n return '單位職位';\n case 'ORG_MANAGER':\n return '主管';\n case 'ORG_UNIT_MANAGER':\n return '單位主管';\n case 'DYNAMIC_FORM':\n return '表單動態指派';\n case 'EXPRESSION':\n return '運算式';\n default:\n return '簽核人';\n }\n}\n\nconst STACK_STYLE: CSSProperties = {\n display: 'grid',\n gap: 12,\n};\n\n// Match the breathing room between the stepper and the PageHeader, which is the\n// Section's top padding token.\nconst TITLE_STYLE: CSSProperties = {\n marginTop: 'var(--mzn-spacing-padding-vertical-spacious)',\n};\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport { Typography } from '@mezzanine-ui/react';\nimport type { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';\nimport type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';\nimport { TemplateDesignerView } from '../../designer';\n\nexport interface ComposeWorkflowStepProps {\n readonly formSchema: FormDefinitionSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly onWorkflowChange: (definition: WorkflowDefinition) => void;\n readonly onInitiatorPolicyChange: (cel: string | null) => void;\n}\n\nexport function ComposeWorkflowStep({\n formSchema,\n initiatorPolicyCel,\n onInitiatorPolicyChange,\n onWorkflowChange,\n workflowDefinition,\n}: ComposeWorkflowStepProps): ReactElement {\n return (\n <>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。\n </Typography>\n <TemplateDesignerView\n embedded\n formSchemaOverride={formSchema}\n initialInitiatorPolicyCel={initiatorPolicyCel}\n initialWorkflowDefinition={workflowDefinition ?? undefined}\n onInitiatorPolicyChange={onInitiatorPolicyChange}\n onWorkflowChange={onWorkflowChange}\n />\n </>\n );\n}\n","'use client';\n\nimport { useCallback, useState } from 'react';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';\nimport {\n ComposeApprovalTemplateWithFormResult,\n composeApprovalTemplateWithForm,\n} from '@rytass/bpm-core-client/template';\n\nexport type ComposeWizardStep = 0 | 1 | 2;\n\nexport type ComposePublishPhase = 'error' | 'idle' | 'submitting' | 'success';\n\nexport const EMPTY_COMPOSE_FORM_SCHEMA: FormDefinitionSchema = {\n fields: [],\n schemaVersion: 1,\n};\n\nexport const EMPTY_COMPOSE_FORM_UI_SCHEMA: FormUiSchema = {\n layout: [],\n schemaVersion: 1,\n};\n\nexport interface TemplateComposeWizard {\n readonly currentStep: ComposeWizardStep;\n /**\n * Single user-facing name. Persisted to both the template and the form\n * (`templateName` / `formName`) at the `composeApprovalTemplateWithForm`\n * boundary — the DB keeps two columns, the UI keeps one field.\n */\n readonly name: string;\n readonly categoryId: string | null;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly publishPhase: ComposePublishPhase;\n readonly publishError: string | null;\n readonly canLeaveBasics: boolean;\n readonly goToStep: (step: ComposeWizardStep) => void;\n readonly goNext: () => void;\n readonly goBack: () => void;\n readonly setName: (value: string) => void;\n readonly setCategoryId: (value: string | null) => void;\n readonly setFormValue: (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }) => void;\n readonly setWorkflowDefinition: (definition: WorkflowDefinition) => void;\n readonly setInitiatorPolicyCel: (cel: string | null) => void;\n readonly publish: () => Promise<ComposeApprovalTemplateWithFormResult | null>;\n}\n\n/**\n * Owns the cross-step state for the unified \"form + flow\" template wizard.\n *\n * Step 0 (表單) edits `formSchema`/`formUiSchema`; that same in-memory schema\n * feeds Step 1 (流程) as the field source for condition branches, so the\n * embedded designer never needs a published form version. Step 2 (檢視發佈)\n * submits everything through the atomic `composeApprovalTemplateWithForm`\n * mutation.\n */\nexport function useTemplateComposeWizard(): TemplateComposeWizard {\n const [currentStep, setCurrentStep] = useState<ComposeWizardStep>(0);\n const [name, setName] = useState('');\n const [categoryId, setCategoryId] = useState<string | null>(null);\n const [formSchema, setFormSchema] = useState<FormDefinitionSchema>(\n EMPTY_COMPOSE_FORM_SCHEMA,\n );\n const [formUiSchema, setFormUiSchema] = useState<FormUiSchema>(\n EMPTY_COMPOSE_FORM_UI_SCHEMA,\n );\n const [workflowDefinition, setWorkflowDefinitionState] =\n useState<WorkflowDefinition | null>(null);\n const [initiatorPolicyCel, setInitiatorPolicyCelState] = useState<\n string | null\n >(null);\n const [publishPhase, setPublishPhase] = useState<ComposePublishPhase>('idle');\n const [publishError, setPublishError] = useState<string | null>(null);\n\n const canLeaveBasics = name.trim().length > 0 && formSchema.fields.length > 0;\n\n const goToStep = useCallback((step: ComposeWizardStep): void => {\n setCurrentStep(step);\n }, []);\n\n const goNext = useCallback((): void => {\n setCurrentStep((step) =>\n step < 2 ? ((step + 1) as ComposeWizardStep) : step,\n );\n }, []);\n\n const goBack = useCallback((): void => {\n setCurrentStep((step) =>\n step > 0 ? ((step - 1) as ComposeWizardStep) : step,\n );\n }, []);\n\n const setFormValue = useCallback(\n (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }): void => {\n setFormSchema(next.schema);\n setFormUiSchema(next.uiSchema);\n },\n [],\n );\n\n const setWorkflowDefinition = useCallback(\n (definition: WorkflowDefinition): void => {\n setWorkflowDefinitionState(definition);\n },\n [],\n );\n\n const setInitiatorPolicyCel = useCallback((cel: string | null): void => {\n setInitiatorPolicyCelState(cel);\n }, []);\n\n const publish =\n useCallback(async (): Promise<ComposeApprovalTemplateWithFormResult | null> => {\n setPublishPhase('submitting');\n setPublishError(null);\n\n try {\n const result = await composeApprovalTemplateWithForm({\n category: null,\n categoryId,\n formDefinitionId: null,\n formDescription: null,\n // One UI name fans out to both persisted columns.\n formName: name,\n initiatorPolicyCel,\n notificationConfig: null,\n publish: true,\n schema: formSchema,\n slaDefaults: null,\n templateDescription: null,\n templateId: null,\n templateName: name,\n uiSchema: formUiSchema,\n workflowDefinition: workflowDefinition ?? EMPTY_WORKFLOW_DEFINITION,\n });\n\n setPublishPhase('success');\n\n return result;\n } catch (requestError: unknown) {\n setPublishError(readErrorMessage(requestError));\n setPublishPhase('error');\n\n return null;\n }\n }, [\n categoryId,\n formSchema,\n formUiSchema,\n initiatorPolicyCel,\n name,\n workflowDefinition,\n ]);\n\n return {\n canLeaveBasics,\n categoryId,\n currentStep,\n formSchema,\n formUiSchema,\n goBack,\n goNext,\n goToStep,\n initiatorPolicyCel,\n name,\n publish,\n publishError,\n publishPhase,\n setCategoryId,\n setFormValue,\n setInitiatorPolicyCel,\n setName,\n setWorkflowDefinition,\n workflowDefinition,\n };\n}\n\nconst EMPTY_WORKFLOW_DEFINITION: WorkflowDefinition = {\n edges: [],\n meta: { schemaVersion: 1 },\n nodes: [\n {\n data: { label: '開始' },\n id: 'start',\n position: { x: 80, y: 160 },\n type: 'startEvent',\n },\n {\n data: { endState: 'APPROVED', label: '完成', triggerMode: 'AND' },\n id: 'end',\n position: { x: 560, y: 160 },\n type: 'endEvent',\n },\n ],\n};\n\nfunction readErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : '發生未知錯誤';\n}\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport {\n Button,\n PageHeader,\n Section,\n SectionGroup,\n Step,\n Stepper,\n Typography,\n} from '@mezzanine-ui/react';\nimport ContentHeader from '@mezzanine-ui/react/ContentHeader';\nimport { useRouterAdapter } from '../../../lib/router-adapter';\nimport { useBPMRoutes } from '../../../lib/routes-config';\nimport { ComposeFormStep } from './steps/ComposeFormStep';\nimport { ComposeReviewStep } from './steps/ComposeReviewStep';\nimport { ComposeWorkflowStep } from './steps/ComposeWorkflowStep';\nimport { useTemplateComposeWizard } from './use-template-compose-wizard';\n\n/**\n * Unified \"form + flow\" template creation wizard. Walks the user through\n * Step 0 表單設計 → Step 1 流程設計 → Step 2 檢視並發佈, then commits both\n * sides atomically through `composeApprovalTemplateWithForm`. Coexists with\n * the separate `/forms` and `/templates` entry points.\n */\nexport function TemplateComposeWizardView(): ReactElement {\n const router = useRouterAdapter();\n const routes = useBPMRoutes();\n const wizard = useTemplateComposeWizard();\n const submitting = wizard.publishPhase === 'submitting';\n\n async function handlePublish(): Promise<void> {\n const result = await wizard.publish();\n\n if (result) {\n router.push(routes.templateDesigner(result.templateId));\n }\n }\n\n return (\n <>\n <PageHeader>\n <ContentHeader\n description=\"一次完成表單與流程設計,發佈後即可直接發起。\"\n title=\"建立模板(表單 + 流程)\"\n >\n <Button\n disabled={submitting}\n onClick={(): void => router.push(routes.templates())}\n variant=\"base-secondary\"\n >\n 返回模板列表\n </Button>\n </ContentHeader>\n </PageHeader>\n\n <SectionGroup>\n <Section>\n <Stepper currentStep={wizard.currentStep}>\n <Step description=\"設計欄位與版面\" title=\"表單設計\" />\n <Step description=\"設計簽核節點與條件\" title=\"流程設計\" />\n <Step description=\"確認後發佈\" title=\"檢視並發佈\" />\n </Stepper>\n\n {wizard.currentStep === 0 ? (\n <ComposeFormStep\n categoryId={wizard.categoryId}\n formSchema={wizard.formSchema}\n formUiSchema={wizard.formUiSchema}\n name={wizard.name}\n onCategoryIdChange={wizard.setCategoryId}\n onFormChange={wizard.setFormValue}\n onNameChange={wizard.setName}\n />\n ) : null}\n\n {wizard.currentStep === 1 ? (\n <ComposeWorkflowStep\n formSchema={wizard.formSchema}\n initiatorPolicyCel={wizard.initiatorPolicyCel}\n onInitiatorPolicyChange={wizard.setInitiatorPolicyCel}\n onWorkflowChange={wizard.setWorkflowDefinition}\n workflowDefinition={wizard.workflowDefinition}\n />\n ) : null}\n\n {wizard.currentStep === 2 ? (\n <ComposeReviewStep\n formSchema={wizard.formSchema}\n formUiSchema={wizard.formUiSchema}\n initiatorPolicyCel={wizard.initiatorPolicyCel}\n name={wizard.name}\n publishError={wizard.publishError}\n workflowDefinition={wizard.workflowDefinition}\n />\n ) : null}\n\n <div style={FOOTER_STYLE}>\n {wizard.currentStep === 0 && !wizard.canLeaveBasics ? (\n <Typography color=\"text-neutral\" variant=\"caption\">\n 請填寫模板名稱、表單名稱,並至少新增一個表單欄位。\n </Typography>\n ) : (\n <span />\n )}\n <div style={FOOTER_ACTIONS_STYLE}>\n <Button\n disabled={wizard.currentStep === 0 || submitting}\n onClick={wizard.goBack}\n variant=\"base-secondary\"\n >\n 上一步\n </Button>\n {wizard.currentStep < 2 ? (\n <Button\n disabled={wizard.currentStep === 0 && !wizard.canLeaveBasics}\n onClick={wizard.goNext}\n variant=\"base-primary\"\n >\n 下一步\n </Button>\n ) : (\n <Button\n disabled={submitting}\n loading={submitting}\n onClick={(): void => {\n void handlePublish();\n }}\n variant=\"base-primary\"\n >\n 發佈\n </Button>\n )}\n </div>\n </div>\n </Section>\n </SectionGroup>\n </>\n );\n}\n\nconst FOOTER_STYLE = {\n alignItems: 'center',\n display: 'flex',\n // Match the breathing room used elsewhere (the Section's top padding token).\n marginTop: 'var(--mzn-spacing-padding-vertical-spacious)',\n justifyContent: 'space-between',\n gap: 16,\n} as const;\n\nconst FOOTER_ACTIONS_STYLE = {\n display: 'flex',\n gap: 8,\n} as const;\n"],"mappings":"gfAiBA,IAAM,EAAoC,CACxC,GAAI,gBACJ,KAAM,KACR,EAEM,EAAqB,IAe3B,SAAgB,EAAgB,CAC9B,aACA,aACA,eACA,OACA,qBACA,eACA,gBACqC,CACrC,GAAM,CAAC,EAAiB,IAAA,EAAA,EAAA,UAEtB,CAAC,CAAC,GAEJ,EAAA,EAAA,eAA8B,CAC5B,IAAI,EAAS,GAqBb,OAnBM,SAA2B,CAC/B,GAAI,CACF,IAAM,EAAS,MAAA,EAAA,EAAA,oCAAyC,CACtD,KAAM,EACN,SAAU,EACV,WAAY,GACZ,OAAQ,QACV,CAAC,EAEG,GACF,EAAmB,EAAO,UAAU,CAExC,MAAQ,CACF,GACF,EAAmB,CAAC,CAAC,CAEzB,CACF,GAAG,MAEgB,CACjB,EAAS,EACX,CACF,EAAG,CAAC,CAAC,EAEL,IAAM,EAA+B,CACnC,EACA,GAAG,EAAgB,IAAK,IAAc,CACpC,GAAI,EAAS,GACb,KAAM,EAAS,IACjB,EAAE,CACJ,EACM,EACJ,EAAc,KAAM,GAAW,EAAO,KAAO,CAAU,GACvD,EAEF,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA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
|
3
|
-
import { n as t } from "./auth-provider-
|
|
4
|
-
import { r as n } from "./routes-config-
|
|
2
|
+
import { r as e } from "./router-adapter-DftlFTOd.js";
|
|
3
|
+
import { n as t } from "./auth-provider-B5oPmvk2.js";
|
|
4
|
+
import { r as n } from "./routes-config-RBYQtUd0.js";
|
|
5
5
|
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
6
6
|
import { BaseCard as s, Button as c, CardGroup as l, PageHeader as u, Section as d, SectionGroup as f, Typography as p } from "@mezzanine-ui/react";
|
|
7
7
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
@@ -116,4 +116,4 @@ function w(e) {
|
|
|
116
116
|
//#endregion
|
|
117
117
|
export { S as t };
|
|
118
118
|
|
|
119
|
-
//# sourceMappingURL=dashboard-page-
|
|
119
|
+
//# sourceMappingURL=dashboard-page-DJ9vOPga.js.map
|