@rytass/bpm-core-react 0.17.2 → 0.17.4
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 +37 -0
- package/dist/chunks/{compose-_pREPtfN.js → compose-b-vhcOb1.js} +155 -156
- package/dist/chunks/compose-b-vhcOb1.js.map +1 -0
- package/dist/chunks/compose-fdwBNiyg.cjs +2 -0
- package/dist/chunks/compose-fdwBNiyg.cjs.map +1 -0
- package/dist/chunks/designer-CbOCuXHH.cjs +65 -0
- package/dist/chunks/designer-CbOCuXHH.cjs.map +1 -0
- package/dist/chunks/{designer-BiywgNXs.js → designer-Dn49G9s-.js} +1046 -1070
- package/dist/chunks/designer-Dn49G9s-.js.map +1 -0
- package/dist/chunks/{detail-DRCTnuKm.cjs → detail-BQSVgVlO.cjs} +2 -2
- package/dist/chunks/{detail-DRCTnuKm.cjs.map → detail-BQSVgVlO.cjs.map} +1 -1
- package/dist/chunks/{detail-DScLf42P.js → detail-B_bSg31B.js} +3 -1
- package/dist/chunks/{detail-DScLf42P.js.map → detail-B_bSg31B.js.map} +1 -1
- package/dist/chunks/language-provider-B3cEbLe4.js +18 -0
- package/dist/chunks/language-provider-B3cEbLe4.js.map +1 -0
- package/dist/chunks/language-provider-Bdnx3Gxl.cjs +2 -0
- package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +1 -0
- package/dist/chunks/providers-DP7b0TMN.cjs +2 -0
- package/dist/chunks/providers-DP7b0TMN.cjs.map +1 -0
- package/dist/chunks/{providers-J5eyByQj.js → providers-H_vPRsSN.js} +202 -198
- package/dist/chunks/providers-H_vPRsSN.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -21
- package/dist/index.js.map +1 -1
- package/dist/lib/language-provider.d.cts +22 -0
- package/dist/lib/language-provider.d.ts +22 -0
- package/dist/lib/providers.d.cts +9 -1
- package/dist/lib/providers.d.ts +9 -1
- package/dist/next/BPMNextProviders.d.cts +7 -1
- package/dist/next/BPMNextProviders.d.ts +7 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +12 -11
- package/dist/next/index.js.map +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/template-error-message.d.cts +9 -0
- package/dist/views/templates/template-error-message.d.ts +9 -0
- package/package.json +3 -3
- package/dist/chunks/compose-B7TtrpQJ.cjs +0 -2
- package/dist/chunks/compose-B7TtrpQJ.cjs.map +0 -1
- package/dist/chunks/compose-_pREPtfN.js.map +0 -1
- package/dist/chunks/designer-BiywgNXs.js.map +0 -1
- package/dist/chunks/designer-ttAqv859.cjs +0 -65
- package/dist/chunks/designer-ttAqv859.cjs.map +0 -1
- package/dist/chunks/providers-DHtDZFNA.cjs +0 -2
- package/dist/chunks/providers-DHtDZFNA.cjs.map +0 -1
- package/dist/chunks/providers-J5eyByQj.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
## 0.17.4 (2026-10-19)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **form:** translate DataSource error copy per language ([787e7a3](https://github.com/Rytass/BPMCore/commit/787e7a3))
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **react:** name condition operators after the field in the template designer ([54d530a](https://github.com/Rytass/BPMCore/commit/54d530a))
|
|
10
|
+
- **react:** sample multiple-selection fields as arrays in the dry run ([295c23a](https://github.com/Rytass/BPMCore/commit/295c23a))
|
|
11
|
+
|
|
12
|
+
### ❤️ Thank You
|
|
13
|
+
|
|
14
|
+
- Chia Yu Pai @fantasywind
|
|
15
|
+
- Kai-Chieh Yang
|
|
16
|
+
|
|
17
|
+
## 0.17.3 (2026-10-19)
|
|
18
|
+
|
|
19
|
+
### 🚀 Features
|
|
20
|
+
|
|
21
|
+
- **react:** add a BPM message language provider ([355b15c](https://github.com/Rytass/BPMCore/commit/355b15c))
|
|
22
|
+
- **template:** translate publish lint lines per language ([60fa7bc](https://github.com/Rytass/BPMCore/commit/60fa7bc))
|
|
23
|
+
- **react:** enlarge approval comments in the instance history ([b3bb37c](https://github.com/Rytass/BPMCore/commit/b3bb37c))
|
|
24
|
+
- **react:** show structural publish failures in Chinese with node names ([ba90fbd](https://github.com/Rytass/BPMCore/commit/ba90fbd))
|
|
25
|
+
- **client:** translate structural publish-lint lines into designer copy ([490339c](https://github.com/Rytass/BPMCore/commit/490339c))
|
|
26
|
+
|
|
27
|
+
### 🩹 Fixes
|
|
28
|
+
|
|
29
|
+
- **template:** address review of the lint translation ([26d7a54](https://github.com/Rytass/BPMCore/commit/26d7a54))
|
|
30
|
+
- **react:** sample money fields as numbers in the designer dry run ([35dbd9a](https://github.com/Rytass/BPMCore/commit/35dbd9a))
|
|
31
|
+
- **client:** cover blank node labels and never throw while translating lint ([0a8b3af](https://github.com/Rytass/BPMCore/commit/0a8b3af))
|
|
32
|
+
|
|
33
|
+
### ❤️ Thank You
|
|
34
|
+
|
|
35
|
+
- Chia Yu Pai @fantasywind
|
|
36
|
+
- Kai-Chieh Yang
|
|
37
|
+
|
|
1
38
|
## 0.17.2 (2026-10-18)
|
|
2
39
|
|
|
3
40
|
### 🚀 Features
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { r as e } from "./router-adapter-DftlFTOd.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as r } from "./
|
|
6
|
-
import { t as i } from "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { composeApprovalTemplateWithForm as
|
|
3
|
+
import { i as t } from "./language-provider-B3cEbLe4.js";
|
|
4
|
+
import { r as n } from "./routes-config-yZbESPlw.js";
|
|
5
|
+
import { t as r } from "./FormRendererView-cZGOOjU5.js";
|
|
6
|
+
import { t as i } from "./FormBuilderView-BYL42M0d.js";
|
|
7
|
+
import { n as a, t as o } from "./designer-Dn49G9s-.js";
|
|
8
|
+
import { useCallback as s, useEffect as c, useState as l } from "react";
|
|
9
|
+
import { Button as u, Empty as d, FormField as f, Input as p, PageHeader as m, Section as h, SectionGroup as g, Select as _, Step as v, Stepper as y, Table as b, Tag as x, Typography as S } from "@mezzanine-ui/react";
|
|
10
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
11
|
+
import { FormFieldLayout as E } from "@mezzanine-ui/core/form";
|
|
12
|
+
import D from "@mezzanine-ui/react/ContentHeader";
|
|
13
|
+
import { composeApprovalTemplateWithForm as O, listApprovalTemplateCategoriesPage as k } from "@rytass/bpm-core-client/template";
|
|
14
14
|
//#region src/views/templates/compose/steps/ComposeFormStep.tsx
|
|
15
|
-
var
|
|
15
|
+
var A = {
|
|
16
16
|
id: "UNCATEGORIZED",
|
|
17
17
|
name: "未分類"
|
|
18
|
-
},
|
|
19
|
-
function
|
|
20
|
-
let [
|
|
21
|
-
|
|
18
|
+
}, j = 100;
|
|
19
|
+
function M({ categoryId: e, formSchema: t, formUiSchema: n, name: r, onCategoryIdChange: a, onFormChange: o, onNameChange: s }) {
|
|
20
|
+
let [u, d] = l([]);
|
|
21
|
+
c(() => {
|
|
22
22
|
let e = !0;
|
|
23
23
|
return (async () => {
|
|
24
24
|
try {
|
|
25
|
-
let t = await
|
|
25
|
+
let t = await k({
|
|
26
26
|
page: 1,
|
|
27
|
-
pageSize:
|
|
27
|
+
pageSize: j,
|
|
28
28
|
searchText: "",
|
|
29
29
|
status: "ACTIVE"
|
|
30
30
|
});
|
|
31
|
-
e &&
|
|
31
|
+
e && d(t.categories);
|
|
32
32
|
} catch {
|
|
33
|
-
e &&
|
|
33
|
+
e && d([]);
|
|
34
34
|
}
|
|
35
35
|
})(), () => {
|
|
36
36
|
e = !1;
|
|
37
37
|
};
|
|
38
38
|
}, []);
|
|
39
|
-
let m = [
|
|
39
|
+
let m = [A, ...u.map((e) => ({
|
|
40
40
|
id: e.id,
|
|
41
41
|
name: e.name
|
|
42
|
-
}))],
|
|
43
|
-
return /* @__PURE__ */ C
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
style:
|
|
46
|
-
children: [/* @__PURE__ */
|
|
42
|
+
}))], h = m.find((t) => t.id === e) ?? A;
|
|
43
|
+
return /* @__PURE__ */ T(C, { children: [
|
|
44
|
+
/* @__PURE__ */ T("div", {
|
|
45
|
+
style: N,
|
|
46
|
+
children: [/* @__PURE__ */ w(f, {
|
|
47
47
|
label: "名稱",
|
|
48
|
-
layout:
|
|
48
|
+
layout: E.VERTICAL,
|
|
49
49
|
name: "composeName",
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ w(p, {
|
|
51
51
|
fullWidth: !0,
|
|
52
|
-
onChange: (e) =>
|
|
52
|
+
onChange: (e) => s(e.target.value),
|
|
53
53
|
placeholder: "例如:請款簽核",
|
|
54
|
-
value:
|
|
54
|
+
value: r
|
|
55
55
|
})
|
|
56
|
-
}), /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ w(f, {
|
|
57
57
|
label: "分類(選填)",
|
|
58
|
-
layout:
|
|
58
|
+
layout: E.VERTICAL,
|
|
59
59
|
name: "composeCategory",
|
|
60
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ w(_, {
|
|
61
61
|
clearable: !1,
|
|
62
62
|
fullWidth: !0,
|
|
63
|
-
onChange: (e) => a(e && e.id !==
|
|
63
|
+
onChange: (e) => a(e && e.id !== A.id ? e.id : null),
|
|
64
64
|
options: m,
|
|
65
65
|
placeholder: "未分類",
|
|
66
|
-
value:
|
|
66
|
+
value: h
|
|
67
67
|
})
|
|
68
68
|
})]
|
|
69
69
|
}),
|
|
70
|
-
/* @__PURE__ */ S
|
|
70
|
+
/* @__PURE__ */ w(S, {
|
|
71
71
|
color: "text-neutral",
|
|
72
72
|
variant: "caption",
|
|
73
73
|
children: "先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。"
|
|
74
74
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
onChange:
|
|
75
|
+
/* @__PURE__ */ w(i, {
|
|
76
|
+
onChange: o,
|
|
77
77
|
value: {
|
|
78
78
|
schema: t,
|
|
79
79
|
uiSchema: n
|
|
@@ -81,75 +81,75 @@ function j({ categoryId: e, formSchema: t, formUiSchema: n, name: i, onCategoryI
|
|
|
81
81
|
})
|
|
82
82
|
] });
|
|
83
83
|
}
|
|
84
|
-
var
|
|
84
|
+
var N = {
|
|
85
85
|
display: "grid",
|
|
86
86
|
gap: 16,
|
|
87
87
|
gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))"
|
|
88
88
|
};
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/views/templates/compose/steps/ComposeReviewStep.tsx
|
|
91
|
-
function
|
|
92
|
-
let s = o?.nodes ?? [], c = o?.edges ?? [],
|
|
93
|
-
detail:
|
|
91
|
+
function P({ formSchema: e, formUiSchema: t, initiatorPolicyCel: n, name: i, publishError: a, workflowDefinition: o }) {
|
|
92
|
+
let s = o?.nodes ?? [], c = o?.edges ?? [], l = e.fields.length, u = new Map(s.map((e) => [e.id, e.data.label])), f = s.map((e) => ({
|
|
93
|
+
detail: R(e) ?? "—",
|
|
94
94
|
key: e.id,
|
|
95
95
|
label: e.data.label,
|
|
96
|
-
typeLabel:
|
|
96
|
+
typeLabel: L(e)
|
|
97
97
|
})), p = c.filter((e) => !!e.data.condition).map((e) => ({
|
|
98
98
|
condition: e.data.condition ?? "",
|
|
99
99
|
key: e.id,
|
|
100
|
-
source:
|
|
101
|
-
target:
|
|
100
|
+
source: u.get(e.source) ?? e.source,
|
|
101
|
+
target: u.get(e.target) ?? e.target
|
|
102
102
|
}));
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
style:
|
|
103
|
+
return /* @__PURE__ */ T("div", {
|
|
104
|
+
style: z,
|
|
105
105
|
children: [
|
|
106
|
-
/* @__PURE__ */ S
|
|
106
|
+
/* @__PURE__ */ w(S, {
|
|
107
107
|
component: "h2",
|
|
108
|
-
style:
|
|
108
|
+
style: B,
|
|
109
109
|
variant: "h2",
|
|
110
110
|
children: i || "(未命名)"
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
style:
|
|
114
|
-
children: [/* @__PURE__ */ S
|
|
112
|
+
/* @__PURE__ */ T("div", {
|
|
113
|
+
style: z,
|
|
114
|
+
children: [/* @__PURE__ */ w(S, {
|
|
115
115
|
variant: "h3",
|
|
116
116
|
children: "表單預覽"
|
|
117
|
-
}),
|
|
117
|
+
}), l > 0 ? /* @__PURE__ */ w(r, {
|
|
118
118
|
dataSourceContext: { kind: "preview" },
|
|
119
119
|
readonly: !0,
|
|
120
120
|
schema: e,
|
|
121
121
|
uiSchema: t
|
|
122
|
-
}) : /* @__PURE__ */
|
|
122
|
+
}) : /* @__PURE__ */ w(d, { title: "尚未設計表單欄位" })]
|
|
123
123
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
style:
|
|
124
|
+
/* @__PURE__ */ T("div", {
|
|
125
|
+
style: z,
|
|
126
126
|
children: [
|
|
127
|
-
/* @__PURE__ */ S
|
|
127
|
+
/* @__PURE__ */ w(S, {
|
|
128
128
|
variant: "h3",
|
|
129
129
|
children: "流程概覽"
|
|
130
130
|
}),
|
|
131
|
-
s.length > 0 ? /* @__PURE__ */
|
|
132
|
-
columns:
|
|
131
|
+
s.length > 0 ? /* @__PURE__ */ w(b, {
|
|
132
|
+
columns: F,
|
|
133
133
|
dataSource: f,
|
|
134
134
|
fullWidth: !0
|
|
135
|
-
}) : /* @__PURE__ */
|
|
136
|
-
p.length > 0 ? /* @__PURE__ */ C
|
|
135
|
+
}) : /* @__PURE__ */ w(d, { title: "尚未設計流程節點" }),
|
|
136
|
+
p.length > 0 ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(S, {
|
|
137
137
|
color: "text-neutral",
|
|
138
138
|
variant: "caption",
|
|
139
139
|
children: "條件分流"
|
|
140
|
-
}), /* @__PURE__ */
|
|
141
|
-
columns:
|
|
140
|
+
}), /* @__PURE__ */ w(b, {
|
|
141
|
+
columns: I,
|
|
142
142
|
dataSource: p,
|
|
143
143
|
fullWidth: !0
|
|
144
144
|
})] }) : null,
|
|
145
|
-
|
|
145
|
+
n ? /* @__PURE__ */ T(S, {
|
|
146
146
|
color: "text-neutral",
|
|
147
147
|
variant: "caption",
|
|
148
|
-
children: ["發起權限:",
|
|
148
|
+
children: ["發起權限:", n]
|
|
149
149
|
}) : null
|
|
150
150
|
]
|
|
151
151
|
}),
|
|
152
|
-
a ? /* @__PURE__ */ S
|
|
152
|
+
a ? /* @__PURE__ */ w(S, {
|
|
153
153
|
color: "text-error",
|
|
154
154
|
variant: "body",
|
|
155
155
|
children: a
|
|
@@ -157,10 +157,10 @@ function N({ formSchema: e, formUiSchema: t, initiatorPolicyCel: r, name: i, pub
|
|
|
157
157
|
]
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
|
-
var
|
|
160
|
+
var F = [
|
|
161
161
|
{
|
|
162
162
|
key: "type",
|
|
163
|
-
render: (e) => /* @__PURE__ */
|
|
163
|
+
render: (e) => /* @__PURE__ */ w(x, {
|
|
164
164
|
label: e.typeLabel,
|
|
165
165
|
size: "sub",
|
|
166
166
|
type: "static"
|
|
@@ -179,7 +179,7 @@ var P = [
|
|
|
179
179
|
title: "簽核方式",
|
|
180
180
|
width: 160
|
|
181
181
|
}
|
|
182
|
-
],
|
|
182
|
+
], I = [
|
|
183
183
|
{
|
|
184
184
|
dataIndex: "source",
|
|
185
185
|
key: "source",
|
|
@@ -198,7 +198,7 @@ var P = [
|
|
|
198
198
|
title: "條件"
|
|
199
199
|
}
|
|
200
200
|
];
|
|
201
|
-
function
|
|
201
|
+
function L(e) {
|
|
202
202
|
switch (e.type) {
|
|
203
203
|
case "startEvent": return "開始";
|
|
204
204
|
case "endEvent": return e.data.endState === "REJECTED" ? "結束(駁回)" : "結束(核准)";
|
|
@@ -209,7 +209,7 @@ function I(e) {
|
|
|
209
209
|
default: return "節點";
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function R(e) {
|
|
213
213
|
if (e.type !== "userTask") return null;
|
|
214
214
|
switch (e.data.approverResolver.type) {
|
|
215
215
|
case "DIRECT": return "指定成員";
|
|
@@ -224,105 +224,107 @@ function L(e) {
|
|
|
224
224
|
default: return "簽核人";
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
var
|
|
227
|
+
var z = {
|
|
228
228
|
display: "grid",
|
|
229
229
|
gap: 12
|
|
230
|
-
},
|
|
230
|
+
}, B = { marginTop: "var(--mzn-spacing-padding-vertical-spacious)" };
|
|
231
231
|
//#endregion
|
|
232
232
|
//#region src/views/templates/compose/steps/ComposeWorkflowStep.tsx
|
|
233
|
-
function
|
|
234
|
-
return /* @__PURE__ */ C
|
|
233
|
+
function V({ aiAssistantAvailable: e = !1, formSchema: t, initiatorPolicyCel: n, onInitiatorPolicyChange: r, onWorkflowChange: i, showAiAssistant: a = !1, workflowDefinition: s }) {
|
|
234
|
+
return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(S, {
|
|
235
235
|
color: "text-neutral",
|
|
236
236
|
variant: "caption",
|
|
237
237
|
children: "設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。"
|
|
238
|
-
}), /* @__PURE__ */
|
|
238
|
+
}), /* @__PURE__ */ w(o, {
|
|
239
239
|
aiAssistantAvailable: e,
|
|
240
240
|
embedded: !0,
|
|
241
241
|
formSchemaOverride: t,
|
|
242
242
|
initialInitiatorPolicyCel: n,
|
|
243
243
|
initialWorkflowDefinition: s ?? void 0,
|
|
244
244
|
onInitiatorPolicyChange: r,
|
|
245
|
-
onWorkflowChange:
|
|
246
|
-
showAiAssistant:
|
|
245
|
+
onWorkflowChange: i,
|
|
246
|
+
showAiAssistant: a
|
|
247
247
|
})] });
|
|
248
248
|
}
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/views/templates/compose/use-template-compose-wizard.ts
|
|
251
|
-
var
|
|
251
|
+
var H = {
|
|
252
252
|
fields: [],
|
|
253
253
|
schemaVersion: 1
|
|
254
|
-
},
|
|
254
|
+
}, U = {
|
|
255
255
|
layout: [],
|
|
256
256
|
schemaVersion: 1
|
|
257
257
|
};
|
|
258
|
-
function
|
|
259
|
-
let
|
|
260
|
-
|
|
261
|
-
}, []),
|
|
262
|
-
|
|
263
|
-
}, []),
|
|
264
|
-
|
|
265
|
-
}, []),
|
|
266
|
-
|
|
267
|
-
}, []),
|
|
268
|
-
|
|
269
|
-
}, []),
|
|
270
|
-
|
|
258
|
+
function W() {
|
|
259
|
+
let e = t(), [n, r] = l(0), [i, o] = l(""), [c, u] = l(null), [d, f] = l(H), [p, m] = l(U), [h, g] = l(null), [_, v] = l(null), [y, b] = l("idle"), [x, S] = l(null), C = i.trim().length > 0 && d.fields.length > 0, w = s((e) => {
|
|
260
|
+
r(e);
|
|
261
|
+
}, []), T = s(() => {
|
|
262
|
+
r((e) => e < 2 ? e + 1 : e);
|
|
263
|
+
}, []), E = s(() => {
|
|
264
|
+
r((e) => e > 0 ? e - 1 : e);
|
|
265
|
+
}, []), D = s((e) => {
|
|
266
|
+
f(e.schema), m(e.uiSchema);
|
|
267
|
+
}, []), k = s((e) => {
|
|
268
|
+
g(e);
|
|
269
|
+
}, []), A = s((e) => {
|
|
270
|
+
v(e);
|
|
271
271
|
}, []);
|
|
272
272
|
return {
|
|
273
|
-
canLeaveBasics:
|
|
274
|
-
categoryId:
|
|
275
|
-
currentStep:
|
|
276
|
-
formSchema:
|
|
277
|
-
formUiSchema:
|
|
278
|
-
goBack:
|
|
279
|
-
goNext:
|
|
280
|
-
goToStep:
|
|
281
|
-
initiatorPolicyCel:
|
|
282
|
-
name:
|
|
283
|
-
publish:
|
|
284
|
-
|
|
273
|
+
canLeaveBasics: C,
|
|
274
|
+
categoryId: c,
|
|
275
|
+
currentStep: n,
|
|
276
|
+
formSchema: d,
|
|
277
|
+
formUiSchema: p,
|
|
278
|
+
goBack: E,
|
|
279
|
+
goNext: T,
|
|
280
|
+
goToStep: w,
|
|
281
|
+
initiatorPolicyCel: _,
|
|
282
|
+
name: i,
|
|
283
|
+
publish: s(async () => {
|
|
284
|
+
b("submitting"), S(null);
|
|
285
|
+
let t = h ?? G;
|
|
285
286
|
try {
|
|
286
|
-
let e = await
|
|
287
|
+
let e = await O({
|
|
287
288
|
category: null,
|
|
288
|
-
categoryId:
|
|
289
|
+
categoryId: c,
|
|
289
290
|
formDefinitionId: null,
|
|
290
291
|
formDescription: null,
|
|
291
|
-
formName:
|
|
292
|
-
initiatorPolicyCel:
|
|
292
|
+
formName: i,
|
|
293
|
+
initiatorPolicyCel: _,
|
|
293
294
|
notificationConfig: null,
|
|
294
295
|
publish: !0,
|
|
295
|
-
schema:
|
|
296
|
+
schema: d,
|
|
296
297
|
slaDefaults: null,
|
|
297
298
|
templateDescription: null,
|
|
298
299
|
templateId: null,
|
|
299
|
-
templateName:
|
|
300
|
-
uiSchema:
|
|
301
|
-
workflowDefinition:
|
|
300
|
+
templateName: i,
|
|
301
|
+
uiSchema: p,
|
|
302
|
+
workflowDefinition: t
|
|
302
303
|
});
|
|
303
|
-
return
|
|
304
|
-
} catch (
|
|
305
|
-
return
|
|
304
|
+
return b("success"), e;
|
|
305
|
+
} catch (n) {
|
|
306
|
+
return S(a(n, e, t)), b("error"), null;
|
|
306
307
|
}
|
|
307
308
|
}, [
|
|
308
|
-
i,
|
|
309
309
|
c,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
d,
|
|
311
|
+
p,
|
|
312
|
+
_,
|
|
313
|
+
e,
|
|
314
|
+
i,
|
|
315
|
+
h
|
|
314
316
|
]),
|
|
315
|
-
publishError:
|
|
316
|
-
publishPhase:
|
|
317
|
-
setCategoryId:
|
|
318
|
-
setFormValue:
|
|
319
|
-
setInitiatorPolicyCel:
|
|
320
|
-
setName:
|
|
321
|
-
setWorkflowDefinition:
|
|
322
|
-
workflowDefinition:
|
|
317
|
+
publishError: x,
|
|
318
|
+
publishPhase: y,
|
|
319
|
+
setCategoryId: u,
|
|
320
|
+
setFormValue: D,
|
|
321
|
+
setInitiatorPolicyCel: A,
|
|
322
|
+
setName: o,
|
|
323
|
+
setWorkflowDefinition: k,
|
|
324
|
+
workflowDefinition: h
|
|
323
325
|
};
|
|
324
326
|
}
|
|
325
|
-
var
|
|
327
|
+
var G = {
|
|
326
328
|
edges: [],
|
|
327
329
|
meta: { schemaVersion: 1 },
|
|
328
330
|
nodes: [{
|
|
@@ -347,45 +349,42 @@ var W = {
|
|
|
347
349
|
type: "endEvent"
|
|
348
350
|
}]
|
|
349
351
|
};
|
|
350
|
-
function G(e) {
|
|
351
|
-
return e instanceof Error ? E(e.message) : "發生未知錯誤";
|
|
352
|
-
}
|
|
353
352
|
//#endregion
|
|
354
353
|
//#region src/views/templates/compose/TemplateComposeWizardView.tsx
|
|
355
|
-
function K({ aiAssistantAvailable:
|
|
356
|
-
let i = e(), a =
|
|
357
|
-
async function
|
|
354
|
+
function K({ aiAssistantAvailable: t = !1, showAiAssistant: r = !1 } = {}) {
|
|
355
|
+
let i = e(), a = n(), o = W(), s = o.publishPhase === "submitting";
|
|
356
|
+
async function c() {
|
|
358
357
|
let e = await o.publish();
|
|
359
358
|
e && i.push(a.templateDesigner(e.templateId));
|
|
360
359
|
}
|
|
361
|
-
return /* @__PURE__ */ C
|
|
360
|
+
return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(m, { children: /* @__PURE__ */ w(D, {
|
|
362
361
|
description: "一次完成表單與流程設計,發佈後即可直接發起。",
|
|
363
362
|
title: "建立模板(表單 + 流程)",
|
|
364
|
-
children: /* @__PURE__ */
|
|
363
|
+
children: /* @__PURE__ */ w(u, {
|
|
365
364
|
disabled: s,
|
|
366
365
|
onClick: () => i.push(a.templates()),
|
|
367
366
|
variant: "base-secondary",
|
|
368
367
|
children: "返回模板列表"
|
|
369
368
|
})
|
|
370
|
-
}) }), /* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
369
|
+
}) }), /* @__PURE__ */ w(g, { children: /* @__PURE__ */ T(h, { children: [
|
|
370
|
+
/* @__PURE__ */ T(y, {
|
|
372
371
|
currentStep: o.currentStep,
|
|
373
372
|
children: [
|
|
374
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ w(v, {
|
|
375
374
|
description: "設計欄位與版面",
|
|
376
375
|
title: "表單設計"
|
|
377
376
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ w(v, {
|
|
379
378
|
description: "設計簽核節點與條件",
|
|
380
379
|
title: "流程設計"
|
|
381
380
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ w(v, {
|
|
383
382
|
description: "確認後發佈",
|
|
384
383
|
title: "檢視並發佈"
|
|
385
384
|
})
|
|
386
385
|
]
|
|
387
386
|
}),
|
|
388
|
-
o.currentStep === 0 ? /* @__PURE__ */
|
|
387
|
+
o.currentStep === 0 ? /* @__PURE__ */ w(M, {
|
|
389
388
|
categoryId: o.categoryId,
|
|
390
389
|
formSchema: o.formSchema,
|
|
391
390
|
formUiSchema: o.formUiSchema,
|
|
@@ -394,8 +393,8 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
|
|
|
394
393
|
onFormChange: o.setFormValue,
|
|
395
394
|
onNameChange: o.setName
|
|
396
395
|
}) : null,
|
|
397
|
-
o.currentStep === 1 ? /* @__PURE__ */
|
|
398
|
-
aiAssistantAvailable:
|
|
396
|
+
o.currentStep === 1 ? /* @__PURE__ */ w(V, {
|
|
397
|
+
aiAssistantAvailable: t,
|
|
399
398
|
formSchema: o.formSchema,
|
|
400
399
|
initiatorPolicyCel: o.initiatorPolicyCel,
|
|
401
400
|
onInitiatorPolicyChange: o.setInitiatorPolicyCel,
|
|
@@ -403,7 +402,7 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
|
|
|
403
402
|
showAiAssistant: r,
|
|
404
403
|
workflowDefinition: o.workflowDefinition
|
|
405
404
|
}) : null,
|
|
406
|
-
o.currentStep === 2 ? /* @__PURE__ */
|
|
405
|
+
o.currentStep === 2 ? /* @__PURE__ */ w(P, {
|
|
407
406
|
formSchema: o.formSchema,
|
|
408
407
|
formUiSchema: o.formUiSchema,
|
|
409
408
|
initiatorPolicyCel: o.initiatorPolicyCel,
|
|
@@ -411,29 +410,29 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
|
|
|
411
410
|
publishError: o.publishError,
|
|
412
411
|
workflowDefinition: o.workflowDefinition
|
|
413
412
|
}) : null,
|
|
414
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ T("div", {
|
|
415
414
|
style: q,
|
|
416
|
-
children: [o.currentStep === 0 && !o.canLeaveBasics ? /* @__PURE__ */ S
|
|
415
|
+
children: [o.currentStep === 0 && !o.canLeaveBasics ? /* @__PURE__ */ w(S, {
|
|
417
416
|
color: "text-neutral",
|
|
418
417
|
variant: "caption",
|
|
419
418
|
children: "請填寫模板名稱、表單名稱,並至少新增一個表單欄位。"
|
|
420
|
-
}) : /* @__PURE__ */
|
|
419
|
+
}) : /* @__PURE__ */ w("span", {}), /* @__PURE__ */ T("div", {
|
|
421
420
|
style: J,
|
|
422
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ w(u, {
|
|
423
422
|
disabled: o.currentStep === 0 || s,
|
|
424
423
|
onClick: o.goBack,
|
|
425
424
|
variant: "base-secondary",
|
|
426
425
|
children: "上一步"
|
|
427
|
-
}), o.currentStep < 2 ? /* @__PURE__ */
|
|
426
|
+
}), o.currentStep < 2 ? /* @__PURE__ */ w(u, {
|
|
428
427
|
disabled: o.currentStep === 0 && !o.canLeaveBasics,
|
|
429
428
|
onClick: o.goNext,
|
|
430
429
|
variant: "base-primary",
|
|
431
430
|
children: "下一步"
|
|
432
|
-
}) : /* @__PURE__ */
|
|
431
|
+
}) : /* @__PURE__ */ w(u, {
|
|
433
432
|
disabled: s,
|
|
434
433
|
loading: s,
|
|
435
434
|
onClick: () => {
|
|
436
|
-
|
|
435
|
+
c();
|
|
437
436
|
},
|
|
438
437
|
variant: "base-primary",
|
|
439
438
|
children: "發佈"
|
|
@@ -453,6 +452,6 @@ var q = {
|
|
|
453
452
|
gap: 8
|
|
454
453
|
};
|
|
455
454
|
//#endregion
|
|
456
|
-
export {
|
|
455
|
+
export { W as i, H as n, U as r, K as t };
|
|
457
456
|
|
|
458
|
-
//# sourceMappingURL=compose-
|
|
457
|
+
//# sourceMappingURL=compose-b-vhcOb1.js.map
|