@rytass/bpm-core-react 0.4.1 → 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 +61 -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-C5ZKPHdA.cjs → approval-instance-list-page-BMUKxzcz.cjs} +2 -2
- package/dist/chunks/{approval-instance-list-page-C5ZKPHdA.cjs.map → approval-instance-list-page-BMUKxzcz.cjs.map} +1 -1
- package/dist/chunks/{approval-instance-list-page-BF2r5D2-.js → approval-instance-list-page-YZcGGDD8.js} +2 -2
- package/dist/chunks/{approval-instance-list-page-BF2r5D2-.js.map → approval-instance-list-page-YZcGGDD8.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-Ib8srCMy.js → dashboard-page-DJ9vOPga.js} +2 -2
- package/dist/chunks/{dashboard-page-Ib8srCMy.js.map → dashboard-page-DJ9vOPga.js.map} +1 -1
- package/dist/chunks/{dashboard-page-CddG1MnK.cjs → dashboard-page-DwHQY6Ki.cjs} +2 -2
- package/dist/chunks/{dashboard-page-CddG1MnK.cjs.map → dashboard-page-DwHQY6Ki.cjs.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/{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 +268 -128
- package/dist/index.js.map +1 -1
- package/dist/lib/routes-config.d.ts +6 -4
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.js +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/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/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/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/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 +1 -1
- 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 +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/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 +38 -42
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +22 -19
- package/dist/chunks/builder-BLVnnpnP.js +0 -1300
- package/dist/chunks/builder-BLVnnpnP.js.map +0 -1
- package/dist/chunks/builder-DVE9zIKH.cjs +0 -3
- package/dist/chunks/builder-DVE9zIKH.cjs.map +0 -1
- package/dist/chunks/detail-Dcr5mM8g.cjs +0 -2
- package/dist/chunks/detail-Dcr5mM8g.cjs.map +0 -1
- package/dist/chunks/detail-u9DdLhDW.js +0 -1518
- package/dist/chunks/detail-u9DdLhDW.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/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-D44FSB46.js +0 -380
- package/dist/chunks/templates-D44FSB46.js.map +0 -1
- package/dist/chunks/templates-w96t83N-.cjs +0 -2
- package/dist/chunks/templates-w96t83N-.cjs.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
package/dist/index.js
CHANGED
|
@@ -2,29 +2,31 @@
|
|
|
2
2
|
import { n as e, r as t, t as n } from "./chunks/router-adapter-DftlFTOd.js";
|
|
3
3
|
import { n as r, t as i } from "./chunks/auth-provider-B5oPmvk2.js";
|
|
4
4
|
import { t as a } from "./chunks/format-date-time-CB-LxzqT.js";
|
|
5
|
-
import { n as o, r as s, t as c } from "./chunks/routes-config-
|
|
6
|
-
import { a as l, i as u, n as d, o as f, r as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { NavigationIconButton as
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { listNotifications as
|
|
14
|
-
import { CalendarConfigProviderMoment as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
5
|
+
import { n as o, r as s, t as c } from "./chunks/routes-config-RBYQtUd0.js";
|
|
6
|
+
import { a as l, i as u, n as d, o as f, r as ee, t as p } from "./chunks/admin-pickers-DLlG_1du.js";
|
|
7
|
+
import { t as m } from "./chunks/approval-instance-list-page-YZcGGDD8.js";
|
|
8
|
+
import { t as h } from "./chunks/bpm-form-field-Cao0rMol.js";
|
|
9
|
+
import { t as g } from "./chunks/dashboard-page-DJ9vOPga.js";
|
|
10
|
+
import { Fragment as te, createContext as _, useCallback as v, useContext as y, useEffect as b, useMemo as x, useState as S } from "react";
|
|
11
|
+
import { NavigationIconButton as C } from "@mezzanine-ui/react";
|
|
12
|
+
import { Fragment as ne, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
13
|
+
import { decideTask as E, listNotifications as re, markAllNotificationsRead as ie, markNotificationRead as D, readUnreadNotificationCount as O } from "@rytass/bpm-core-client/workflow";
|
|
14
|
+
import { CalendarConfigProviderMoment as k, CalendarLocale as A } from "@mezzanine-ui/react/moment";
|
|
15
|
+
import ae from "@mezzanine-ui/react/Drawer";
|
|
16
|
+
import oe from "@mezzanine-ui/react/Modal";
|
|
17
|
+
import se from "@mezzanine-ui/react/NotificationCenter";
|
|
18
|
+
import ce from "@mezzanine-ui/react/Textarea";
|
|
19
|
+
import { NotificationUnreadIcon as j } from "@mezzanine-ui/icons";
|
|
18
20
|
import './index.css';//#region src/lib/notification-drawer-provider.tsx
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
let [t, n] =
|
|
21
|
+
var M = _(null);
|
|
22
|
+
function N({ children: e }) {
|
|
23
|
+
let [t, n] = S(!1), r = v(() => {
|
|
22
24
|
n(!0);
|
|
23
|
-
}, []), i =
|
|
25
|
+
}, []), i = v(() => {
|
|
24
26
|
n(!1);
|
|
25
|
-
}, []), a =
|
|
27
|
+
}, []), a = v(() => {
|
|
26
28
|
n((e) => !e);
|
|
27
|
-
}, []), o =
|
|
29
|
+
}, []), o = x(() => ({
|
|
28
30
|
close: i,
|
|
29
31
|
isOpen: t,
|
|
30
32
|
open: r,
|
|
@@ -35,13 +37,13 @@ function R({ children: e }) {
|
|
|
35
37
|
r,
|
|
36
38
|
a
|
|
37
39
|
]);
|
|
38
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ w(M.Provider, {
|
|
39
41
|
value: o,
|
|
40
42
|
children: e
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
+
function P() {
|
|
46
|
+
return y(M) || {
|
|
45
47
|
close: () => void 0,
|
|
46
48
|
isOpen: !1,
|
|
47
49
|
open: () => void 0,
|
|
@@ -50,14 +52,14 @@ function z() {
|
|
|
50
52
|
}
|
|
51
53
|
//#endregion
|
|
52
54
|
//#region src/lib/notification-unread-provider.tsx
|
|
53
|
-
var
|
|
54
|
-
function
|
|
55
|
-
let { member: t } = r(), n = t?.memberId ?? null, [i, a] =
|
|
55
|
+
var F = _(null);
|
|
56
|
+
function I({ children: e }) {
|
|
57
|
+
let { member: t } = r(), n = t?.memberId ?? null, [i, a] = S(0), o = v(async () => {
|
|
56
58
|
if (!n) return a(0), 0;
|
|
57
|
-
let e = await
|
|
59
|
+
let e = await O(n);
|
|
58
60
|
return a(e), e;
|
|
59
61
|
}, [n]);
|
|
60
|
-
|
|
62
|
+
b(() => {
|
|
61
63
|
let e = !0;
|
|
62
64
|
return (async () => {
|
|
63
65
|
try {
|
|
@@ -70,101 +72,133 @@ function V({ children: e }) {
|
|
|
70
72
|
e = !1;
|
|
71
73
|
};
|
|
72
74
|
}, [o]);
|
|
73
|
-
let s =
|
|
75
|
+
let s = x(() => ({
|
|
74
76
|
refreshUnreadCount: o,
|
|
75
77
|
unreadCount: i
|
|
76
78
|
}), [o, i]);
|
|
77
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ w(F.Provider, {
|
|
78
80
|
value: s,
|
|
79
81
|
children: e
|
|
80
82
|
});
|
|
81
83
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
84
|
+
function L() {
|
|
85
|
+
return y(F) || {
|
|
84
86
|
refreshUnreadCount: async () => 0,
|
|
85
87
|
unreadCount: 0
|
|
86
88
|
};
|
|
87
89
|
}
|
|
88
90
|
//#endregion
|
|
89
91
|
//#region src/components/notification-drawer.tsx
|
|
90
|
-
var
|
|
92
|
+
var R = [
|
|
91
93
|
"today",
|
|
92
94
|
"yesterday",
|
|
93
95
|
"past7Days",
|
|
94
96
|
"earlier"
|
|
95
|
-
],
|
|
97
|
+
], le = {
|
|
96
98
|
earlier: "更早",
|
|
97
99
|
past7Days: "過去七天",
|
|
98
100
|
today: "今天",
|
|
99
101
|
yesterday: "昨天"
|
|
100
|
-
},
|
|
101
|
-
function
|
|
102
|
-
|
|
102
|
+
}, ue = 50;
|
|
103
|
+
function de(e) {
|
|
104
|
+
return [
|
|
105
|
+
...e.actionable ? [{
|
|
106
|
+
id: "approve",
|
|
107
|
+
name: "同意"
|
|
108
|
+
}, {
|
|
109
|
+
id: "reject",
|
|
110
|
+
name: "拒絕"
|
|
111
|
+
}] : [],
|
|
112
|
+
...e.instanceId ? [{
|
|
113
|
+
id: "view",
|
|
114
|
+
name: "查看案件"
|
|
115
|
+
}] : [],
|
|
116
|
+
...e.status === "READ" ? [] : [{
|
|
117
|
+
id: "read",
|
|
118
|
+
name: "標為已讀"
|
|
119
|
+
}]
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
var z = {
|
|
123
|
+
APPROVED: "簽核任務已同意",
|
|
124
|
+
REJECTED: "簽核任務已拒絕",
|
|
125
|
+
RETURNED: "簽核任務已退回",
|
|
126
|
+
SUPERSEDED: "簽核任務已結束",
|
|
127
|
+
TRANSFERRED: "簽核任務已轉派"
|
|
128
|
+
};
|
|
129
|
+
function fe(e) {
|
|
130
|
+
return e.resolution ? z[e.resolution] : e.title;
|
|
131
|
+
}
|
|
132
|
+
function pe(e) {
|
|
133
|
+
return e.resolution === "APPROVED" ? "success" : e.resolution === "REJECTED" ? "error" : e.resolution ? "info" : V(e.type);
|
|
134
|
+
}
|
|
135
|
+
function B() {
|
|
136
|
+
let e = t(), n = s(), { member: i } = r(), { close: a, isOpen: o } = P(), { refreshUnreadCount: c } = L(), l = i?.memberId ?? null, [u, d] = S([]), [f, ee] = S(0), [p, m] = S(1), [h, g] = S(!1), [_, y] = S(!1), [C, O] = S(null), [k, A] = S(null), [j, M] = S("all"), [N, F] = S(null), [I, z] = S(""), [B, V] = S(!1), U = I.trim(), W = v(async (e, t) => {
|
|
103
137
|
if (l) {
|
|
104
|
-
|
|
138
|
+
g(!0), O(null);
|
|
105
139
|
try {
|
|
106
|
-
let n = await
|
|
140
|
+
let n = await re({
|
|
107
141
|
includeRead: !0,
|
|
108
142
|
page: e,
|
|
109
|
-
pageSize:
|
|
143
|
+
pageSize: ue,
|
|
110
144
|
recipientMemberId: l
|
|
111
145
|
});
|
|
112
|
-
d((e) => t ? [...e, ...n.notifications] : n.notifications),
|
|
146
|
+
d((e) => t ? [...e, ...n.notifications] : n.notifications), ee(n.totalCount), m(e), await c();
|
|
113
147
|
} catch (e) {
|
|
114
|
-
|
|
148
|
+
O(H(e));
|
|
115
149
|
} finally {
|
|
116
|
-
|
|
150
|
+
g(!1);
|
|
117
151
|
}
|
|
118
152
|
}
|
|
119
153
|
}, [l, c]);
|
|
120
|
-
|
|
121
|
-
!o || !l ||
|
|
154
|
+
b(() => {
|
|
155
|
+
!o || !l || (O(null), A(null), W(1, !1));
|
|
122
156
|
}, [
|
|
123
157
|
o,
|
|
124
158
|
l,
|
|
125
|
-
|
|
159
|
+
W
|
|
126
160
|
]);
|
|
127
|
-
let
|
|
161
|
+
let G = v((e) => {
|
|
128
162
|
let t = e.target.value;
|
|
129
|
-
(t === "all" || t === "read" || t === "unread") &&
|
|
130
|
-
}, []),
|
|
131
|
-
if (!(!l ||
|
|
132
|
-
|
|
163
|
+
(t === "all" || t === "read" || t === "unread") && M(t);
|
|
164
|
+
}, []), K = v(async () => {
|
|
165
|
+
if (!(!l || _)) {
|
|
166
|
+
y(!0), O(null);
|
|
133
167
|
try {
|
|
134
|
-
await
|
|
168
|
+
await ie({ recipientMemberId: l }), await W(1, !1);
|
|
135
169
|
} catch (e) {
|
|
136
|
-
|
|
170
|
+
O(H(e));
|
|
137
171
|
} finally {
|
|
138
|
-
|
|
172
|
+
y(!1);
|
|
139
173
|
}
|
|
140
174
|
}
|
|
141
175
|
}, [
|
|
142
|
-
|
|
176
|
+
_,
|
|
143
177
|
l,
|
|
144
|
-
|
|
145
|
-
]),
|
|
146
|
-
|
|
178
|
+
W
|
|
179
|
+
]), q = v(() => {
|
|
180
|
+
h || W(p + 1, !0);
|
|
147
181
|
}, [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
]),
|
|
182
|
+
h,
|
|
183
|
+
W,
|
|
184
|
+
p
|
|
185
|
+
]), J = v(async (e) => {
|
|
152
186
|
if (l) try {
|
|
153
|
-
await
|
|
187
|
+
await D({
|
|
154
188
|
id: e,
|
|
155
189
|
readerMemberId: l
|
|
156
|
-
}), await
|
|
190
|
+
}), await W(1, !1);
|
|
157
191
|
} catch (e) {
|
|
158
|
-
|
|
192
|
+
O(H(e));
|
|
159
193
|
}
|
|
160
|
-
}, [l,
|
|
194
|
+
}, [l, W]), Y = v(async (t) => {
|
|
161
195
|
if (!(!t.instanceId || !l)) try {
|
|
162
|
-
t.status !== "READ" && (await
|
|
196
|
+
t.status !== "READ" && (await D({
|
|
163
197
|
id: t.id,
|
|
164
198
|
readerMemberId: l
|
|
165
199
|
}), await c()), a(), e.push(n.caseDetail(t.instanceId));
|
|
166
200
|
} catch (e) {
|
|
167
|
-
|
|
201
|
+
O(H(e));
|
|
168
202
|
}
|
|
169
203
|
}, [
|
|
170
204
|
a,
|
|
@@ -172,89 +206,195 @@ function K() {
|
|
|
172
206
|
c,
|
|
173
207
|
e,
|
|
174
208
|
n
|
|
175
|
-
]), X =
|
|
176
|
-
|
|
209
|
+
]), X = v(async (e) => {
|
|
210
|
+
if (!(!e.taskId || !l || B)) {
|
|
211
|
+
V(!0), O(null), A(null);
|
|
212
|
+
try {
|
|
213
|
+
await E({
|
|
214
|
+
action: "APPROVED",
|
|
215
|
+
comment: null,
|
|
216
|
+
decidedByMemberId: l,
|
|
217
|
+
taskId: e.taskId
|
|
218
|
+
}), A(`已同意「${e.title}」。`), await W(1, !1);
|
|
219
|
+
} catch (e) {
|
|
220
|
+
O(H(e));
|
|
221
|
+
} finally {
|
|
222
|
+
V(!1);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}, [
|
|
226
|
+
l,
|
|
227
|
+
B,
|
|
228
|
+
W
|
|
229
|
+
]), Z = v((e) => {
|
|
230
|
+
F(e), z("");
|
|
231
|
+
}, []), Q = v(() => {
|
|
232
|
+
F(null), z("");
|
|
233
|
+
}, []), he = v(async () => {
|
|
234
|
+
let e = N;
|
|
235
|
+
if (!(!e?.taskId || !l || !U || B)) {
|
|
236
|
+
V(!0), O(null), A(null);
|
|
237
|
+
try {
|
|
238
|
+
await E({
|
|
239
|
+
action: "REJECTED",
|
|
240
|
+
comment: U,
|
|
241
|
+
decidedByMemberId: l,
|
|
242
|
+
taskId: e.taskId
|
|
243
|
+
}), F(null), z(""), A(`已拒絕「${e.title}」。`), await W(1, !1);
|
|
244
|
+
} catch (e) {
|
|
245
|
+
O(H(e));
|
|
246
|
+
} finally {
|
|
247
|
+
V(!1);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}, [
|
|
251
|
+
l,
|
|
252
|
+
B,
|
|
253
|
+
W,
|
|
254
|
+
N,
|
|
255
|
+
U
|
|
256
|
+
]), ge = v((e, t) => {
|
|
257
|
+
let n = t.id;
|
|
258
|
+
n === "approve" ? X(e) : n === "reject" ? Z(e) : n === "view" ? Y(e) : n === "read" && J(e.id);
|
|
259
|
+
}, [
|
|
260
|
+
X,
|
|
261
|
+
J,
|
|
262
|
+
Y,
|
|
263
|
+
Z
|
|
264
|
+
]), _e = v((e, t) => {
|
|
265
|
+
t instanceof Element && t.closest("button") || Y(e);
|
|
266
|
+
}, [Y]), ve = v((e, t) => {
|
|
267
|
+
t.key !== "Enter" && t.key !== " " || t.target instanceof Element && t.target.closest("button") || (t.preventDefault(), Y(e));
|
|
268
|
+
}, [Y]), ye = x(() => u.filter((e) => j === "all" ? !0 : j === "read" ? e.status === "READ" : e.status !== "READ"), [j, u]), be = x(() => {
|
|
269
|
+
let e = /* @__PURE__ */ new Date(), t = R.reduce((e, t) => (e[t] = [], e), {
|
|
177
270
|
earlier: [],
|
|
178
271
|
past7Days: [],
|
|
179
272
|
today: [],
|
|
180
273
|
yesterday: []
|
|
181
274
|
});
|
|
182
|
-
return
|
|
183
|
-
t[
|
|
184
|
-
}),
|
|
185
|
-
}, [
|
|
186
|
-
return l ? /* @__PURE__ */
|
|
187
|
-
bottomGhostActionDisabled:
|
|
188
|
-
bottomGhostActionLoading:
|
|
275
|
+
return ye.forEach((n) => {
|
|
276
|
+
t[me(n.createdAt, e)].push(n);
|
|
277
|
+
}), R.map((e) => [e, t[e]]).filter(([, e]) => e.length > 0);
|
|
278
|
+
}, [ye]), $ = u.length < f;
|
|
279
|
+
return l ? /* @__PURE__ */ T(ne, { children: [/* @__PURE__ */ w(ae, {
|
|
280
|
+
bottomGhostActionDisabled: _ || h,
|
|
281
|
+
bottomGhostActionLoading: _,
|
|
189
282
|
bottomGhostActionText: "全部標為已讀",
|
|
190
283
|
bottomOnGhostActionClick: () => {
|
|
191
|
-
|
|
284
|
+
K();
|
|
192
285
|
},
|
|
193
286
|
bottomOnPrimaryActionClick: () => {
|
|
194
|
-
|
|
287
|
+
q();
|
|
195
288
|
},
|
|
196
|
-
bottomPrimaryActionDisabled:
|
|
197
|
-
bottomPrimaryActionLoading:
|
|
198
|
-
bottomPrimaryActionText:
|
|
199
|
-
contentKey: `${
|
|
289
|
+
bottomPrimaryActionDisabled: !$ || h,
|
|
290
|
+
bottomPrimaryActionLoading: h && $,
|
|
291
|
+
bottomPrimaryActionText: $ ? "載入更多" : "已顯示全部",
|
|
292
|
+
contentKey: `${j}:${u.length}`,
|
|
200
293
|
filterAreaAllRadioLabel: "全部",
|
|
201
|
-
filterAreaOnRadioChange:
|
|
294
|
+
filterAreaOnRadioChange: G,
|
|
202
295
|
filterAreaReadRadioLabel: "已讀",
|
|
203
296
|
filterAreaShow: !0,
|
|
204
297
|
filterAreaUnreadRadioLabel: "未讀",
|
|
205
|
-
filterAreaValue:
|
|
298
|
+
filterAreaValue: j,
|
|
206
299
|
headerTitle: "通知中心",
|
|
207
300
|
isBottomDisplay: !0,
|
|
208
301
|
isHeaderDisplay: !0,
|
|
209
302
|
onClose: a,
|
|
210
303
|
open: o,
|
|
211
304
|
size: "medium",
|
|
212
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ T("div", {
|
|
213
306
|
role: "list",
|
|
214
307
|
children: [
|
|
215
|
-
|
|
308
|
+
C ? /* @__PURE__ */ w("p", {
|
|
216
309
|
role: "alert",
|
|
217
310
|
style: {
|
|
218
311
|
color: "var(--mzn-color-text-error, #d92d20)",
|
|
219
312
|
padding: "12px 16px"
|
|
220
313
|
},
|
|
221
|
-
children:
|
|
314
|
+
children: C
|
|
315
|
+
}) : null,
|
|
316
|
+
k ? /* @__PURE__ */ w("p", {
|
|
317
|
+
role: "status",
|
|
318
|
+
style: {
|
|
319
|
+
color: "var(--mzn-color-text-success, #079455)",
|
|
320
|
+
padding: "12px 16px"
|
|
321
|
+
},
|
|
322
|
+
children: k
|
|
222
323
|
}) : null,
|
|
223
|
-
|
|
324
|
+
be.length === 0 ? /* @__PURE__ */ w("p", {
|
|
224
325
|
style: {
|
|
225
326
|
color: "var(--mzn-color-text-secondary, #6b7280)",
|
|
226
327
|
padding: "24px 16px",
|
|
227
328
|
textAlign: "center"
|
|
228
329
|
},
|
|
229
|
-
children:
|
|
330
|
+
children: h ? "載入中…" : "目前沒有通知"
|
|
230
331
|
}) : null,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
332
|
+
be.map(([e, t]) => /* @__PURE__ */ w(te, { children: t.map((t, n) => {
|
|
333
|
+
let r = t.instanceId !== null;
|
|
334
|
+
return /* @__PURE__ */ w("div", {
|
|
335
|
+
onClick: r ? (e) => {
|
|
336
|
+
_e(t, e.target);
|
|
337
|
+
} : void 0,
|
|
338
|
+
onKeyDown: r ? (e) => {
|
|
339
|
+
ve(t, e);
|
|
340
|
+
} : void 0,
|
|
341
|
+
role: r ? "button" : void 0,
|
|
342
|
+
style: r ? { cursor: "pointer" } : void 0,
|
|
343
|
+
tabIndex: r ? 0 : void 0,
|
|
344
|
+
children: /* @__PURE__ */ w(se, {
|
|
345
|
+
description: t.body,
|
|
346
|
+
onBadgeSelect: (e) => {
|
|
347
|
+
ge(t, e);
|
|
348
|
+
},
|
|
349
|
+
options: [...de(t)],
|
|
350
|
+
prependTips: n === 0 ? le[e] : void 0,
|
|
351
|
+
reference: t.id,
|
|
352
|
+
severity: pe(t),
|
|
353
|
+
showBadge: t.status !== "READ",
|
|
354
|
+
timeStamp: t.createdAt,
|
|
355
|
+
title: fe(t),
|
|
356
|
+
type: "drawer"
|
|
357
|
+
})
|
|
358
|
+
}, t.id);
|
|
359
|
+
}) }, e))
|
|
250
360
|
]
|
|
251
361
|
})
|
|
252
|
-
})
|
|
362
|
+
}), /* @__PURE__ */ w(oe, {
|
|
363
|
+
cancelText: "取消",
|
|
364
|
+
confirmButtonProps: {
|
|
365
|
+
disabled: !U,
|
|
366
|
+
variant: "destructive-primary"
|
|
367
|
+
},
|
|
368
|
+
confirmText: "送出拒絕",
|
|
369
|
+
loading: B,
|
|
370
|
+
modalStatusType: "error",
|
|
371
|
+
modalType: "standard",
|
|
372
|
+
onCancel: Q,
|
|
373
|
+
onClose: Q,
|
|
374
|
+
onConfirm: () => {
|
|
375
|
+
he();
|
|
376
|
+
},
|
|
377
|
+
open: N !== null,
|
|
378
|
+
showModalFooter: !0,
|
|
379
|
+
showModalHeader: !0,
|
|
380
|
+
size: "regular",
|
|
381
|
+
supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
|
|
382
|
+
title: "拒絕原因",
|
|
383
|
+
children: /* @__PURE__ */ w(ce, {
|
|
384
|
+
autoFocus: !0,
|
|
385
|
+
onChange: (e) => {
|
|
386
|
+
z(e.target.value);
|
|
387
|
+
},
|
|
388
|
+
placeholder: "請輸入拒絕原因",
|
|
389
|
+
rows: 4,
|
|
390
|
+
value: I
|
|
391
|
+
})
|
|
392
|
+
})] }) : null;
|
|
253
393
|
}
|
|
254
|
-
function
|
|
394
|
+
function V(e) {
|
|
255
395
|
return e === "SLA_OVERDUE" ? "error" : e === "SLA_WARNING" ? "warning" : e === "INSTANCE_COMPLETED" ? "success" : "info";
|
|
256
396
|
}
|
|
257
|
-
function
|
|
397
|
+
function me(e, t) {
|
|
258
398
|
let n = new Date(e);
|
|
259
399
|
if (Number.isNaN(n.getTime())) return "earlier";
|
|
260
400
|
let r = new Date(t.getFullYear(), t.getMonth(), t.getDate()), i = new Date(n.getFullYear(), n.getMonth(), n.getDate());
|
|
@@ -262,58 +402,58 @@ function J(e, t) {
|
|
|
262
402
|
let a = new Date(r);
|
|
263
403
|
return a.setDate(a.getDate() - 1), i.getTime() === a.getTime() ? "yesterday" : (t.getTime() - n.getTime()) / (1e3 * 60 * 60 * 24) <= 7 ? "past7Days" : "earlier";
|
|
264
404
|
}
|
|
265
|
-
function
|
|
405
|
+
function H(e) {
|
|
266
406
|
return e instanceof Error ? e.message : "發生未知錯誤";
|
|
267
407
|
}
|
|
268
408
|
//#endregion
|
|
269
409
|
//#region src/lib/providers.tsx
|
|
270
|
-
function
|
|
271
|
-
return /* @__PURE__ */
|
|
410
|
+
function U({ children: e, locale: t = A.ZH_TW, publicPaths: n, loginPath: r }) {
|
|
411
|
+
return /* @__PURE__ */ w(k, {
|
|
272
412
|
locale: t,
|
|
273
|
-
children: /* @__PURE__ */
|
|
413
|
+
children: /* @__PURE__ */ w(i, {
|
|
274
414
|
publicPaths: n,
|
|
275
415
|
loginPath: r,
|
|
276
|
-
children: /* @__PURE__ */
|
|
416
|
+
children: /* @__PURE__ */ w(I, { children: /* @__PURE__ */ T(N, { children: [e, /* @__PURE__ */ w(B, {})] }) })
|
|
277
417
|
})
|
|
278
418
|
});
|
|
279
419
|
}
|
|
280
420
|
//#endregion
|
|
281
421
|
//#region src/lib/use-bpm-logout.ts
|
|
282
|
-
function
|
|
422
|
+
function W() {
|
|
283
423
|
let { logout: e } = r();
|
|
284
424
|
return e;
|
|
285
425
|
}
|
|
286
426
|
//#endregion
|
|
287
427
|
//#region src/lib/use-bpm-member.ts
|
|
288
|
-
function
|
|
428
|
+
function G() {
|
|
289
429
|
let { member: e } = r();
|
|
290
430
|
return e;
|
|
291
431
|
}
|
|
292
|
-
var
|
|
432
|
+
var K = {
|
|
293
433
|
root: "bpm_root_jl5S-",
|
|
294
434
|
badge: "bpm_badge_SIKJk"
|
|
295
435
|
};
|
|
296
436
|
//#endregion
|
|
297
437
|
//#region src/components/bpm-notification-bell-button.tsx
|
|
298
|
-
function
|
|
299
|
-
let { open: t } =
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
className:
|
|
302
|
-
children: [/* @__PURE__ */
|
|
438
|
+
function q({ label: e = "通知中心" } = {}) {
|
|
439
|
+
let { open: t } = P(), { unreadCount: n } = L(), r = n > 0 ? `${e},${n} 則未讀` : e;
|
|
440
|
+
return /* @__PURE__ */ T("span", {
|
|
441
|
+
className: K.root,
|
|
442
|
+
children: [/* @__PURE__ */ w(C, {
|
|
303
443
|
"aria-label": r,
|
|
304
|
-
icon:
|
|
444
|
+
icon: j,
|
|
305
445
|
onClick: () => {
|
|
306
446
|
t();
|
|
307
447
|
},
|
|
308
448
|
title: e,
|
|
309
449
|
type: "button"
|
|
310
|
-
}), n > 0 ? /* @__PURE__ */
|
|
311
|
-
className:
|
|
450
|
+
}), n > 0 ? /* @__PURE__ */ w("span", {
|
|
451
|
+
className: K.badge,
|
|
312
452
|
children: n > 99 ? "99+" : n
|
|
313
453
|
}) : null]
|
|
314
454
|
});
|
|
315
455
|
}
|
|
316
456
|
//#endregion
|
|
317
|
-
export {
|
|
457
|
+
export { m as ApprovalInstanceListPage, i as AuthProvider, h as BPMFormField, q as BPMNotificationBellButton, c as BPMRoutesProvider, g as DashboardPage, p as MemberPicker, B as NotificationDrawer, N as NotificationDrawerProvider, I as NotificationUnreadProvider, d as OrgUnitPicker, ee as PositionPicker, U as Providers, n as RouterAdapterProvider, o as createDefaultBPMRoutes, e as defaultBrowserSearchParams, a as formatDateTime, u as readMemberOption, l as readOrgUnitOption, f as readPositionOption, r as useAuth, W as useBPMLogout, G as useBPMMember, s as useBPMRoutes, P as useNotificationDrawer, L as useNotificationUnread, t as useRouterAdapter };
|
|
318
458
|
|
|
319
459
|
//# sourceMappingURL=index.js.map
|