@rytass/bpm-core-react 0.21.0 → 0.21.1
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 +46 -0
- package/dist/chunks/{FormBuilderView-WtC2iW5f.js → FormBuilderView-6KdApi-D.js} +8 -8
- package/dist/chunks/{FormBuilderView-WtC2iW5f.js.map → FormBuilderView-6KdApi-D.js.map} +1 -1
- package/dist/chunks/{FormBuilderView-DjPGrOJ2.cjs → FormBuilderView-CGKkuVFi.cjs} +3 -3
- package/dist/chunks/{FormBuilderView-DjPGrOJ2.cjs.map → FormBuilderView-CGKkuVFi.cjs.map} +1 -1
- package/dist/chunks/{approval-instance-list-page-Bth7Raya.js → approval-instance-list-page-BI5fIXc-.js} +26 -26
- package/dist/chunks/{approval-instance-list-page-Bth7Raya.js.map → approval-instance-list-page-BI5fIXc-.js.map} +1 -1
- package/dist/chunks/{approval-instance-list-page-Dcvo6TrT.cjs → approval-instance-list-page-Cv5I1YPX.cjs} +2 -2
- package/dist/chunks/{approval-instance-list-page-Dcvo6TrT.cjs.map → approval-instance-list-page-Cv5I1YPX.cjs.map} +1 -1
- package/dist/chunks/{compose-DZvIspW3.js → compose-DFuLPmOA.js} +4 -4
- package/dist/chunks/{compose-DZvIspW3.js.map → compose-DFuLPmOA.js.map} +1 -1
- package/dist/chunks/compose-DK3ocWwG.cjs +2 -0
- package/dist/chunks/compose-DK3ocWwG.cjs.map +1 -0
- package/dist/chunks/designer-CAUWEKJ4.cjs +69 -0
- package/dist/chunks/designer-CAUWEKJ4.cjs.map +1 -0
- package/dist/chunks/{designer-CWubIE69.js → designer-CCy5EbOe.js} +2189 -1608
- package/dist/chunks/designer-CCy5EbOe.js.map +1 -0
- package/dist/chunks/detail-C5KrUC7s.cjs +5 -0
- package/dist/chunks/detail-C5KrUC7s.cjs.map +1 -0
- package/dist/chunks/{detail-Bv90gvy0.js → detail-Dnc4PPWO.js} +768 -742
- package/dist/chunks/detail-Dnc4PPWO.js.map +1 -0
- package/dist/chunks/{instance-error-message-CAP1vJhX.js → instance-error-message-BEM4O_Kj.js} +6 -2
- package/dist/chunks/instance-error-message-BEM4O_Kj.js.map +1 -0
- package/dist/chunks/instance-error-message-BpCLCOjp.cjs +2 -0
- package/dist/chunks/instance-error-message-BpCLCOjp.cjs.map +1 -0
- package/dist/chunks/organization-time-zone-provider-B7CXQril.cjs +2 -0
- package/dist/chunks/organization-time-zone-provider-B7CXQril.cjs.map +1 -0
- package/dist/chunks/organization-time-zone-provider-DNL8yo4-.js +42 -0
- package/dist/chunks/organization-time-zone-provider-DNL8yo4-.js.map +1 -0
- package/dist/chunks/{providers-BbCs23sk.js → providers-CQWekD7_.js} +197 -196
- package/dist/chunks/providers-CQWekD7_.js.map +1 -0
- package/dist/chunks/providers-VUOh6i0i.cjs +2 -0
- package/dist/chunks/providers-VUOh6i0i.cjs.map +1 -0
- package/dist/components/notification-drawer-options.d.cts +18 -0
- package/dist/components/notification-drawer-options.d.ts +18 -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 +23 -23
- package/dist/index.js.map +1 -1
- package/dist/lib/organization-time-zone-provider.d.cts +20 -0
- package/dist/lib/organization-time-zone-provider.d.ts +20 -0
- package/dist/lib/organization-time-zone.d.cts +8 -0
- package/dist/lib/organization-time-zone.d.ts +8 -0
- package/dist/lib/providers.d.cts +10 -1
- package/dist/lib/providers.d.ts +10 -1
- package/dist/next/BPMNextProviders.d.cts +8 -1
- package/dist/next/BPMNextProviders.d.ts +8 -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/cc/index.cjs +1 -1
- package/dist/views/cc/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/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/instances/detail/sections/shared.d.cts +0 -1
- package/dist/views/instances/detail/sections/shared.d.ts +0 -1
- 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/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/approver-resolver-model.d.cts +105 -1
- package/dist/views/templates/designer/approver-resolver-model.d.ts +105 -1
- package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +5 -0
- package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +5 -0
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/node-actor-resolver-options.d.cts +44 -1
- package/dist/views/templates/designer/node-actor-resolver-options.d.ts +44 -1
- package/dist/views/templates/designer/notify-recipient-options.d.cts +81 -0
- package/dist/views/templates/designer/notify-recipient-options.d.ts +81 -0
- package/dist/views/templates/designer/position-level-options.d.cts +3 -1
- package/dist/views/templates/designer/position-level-options.d.ts +3 -1
- package/dist/views/templates/designer/position-scope.d.cts +51 -0
- package/dist/views/templates/designer/position-scope.d.ts +51 -0
- package/package.json +3 -3
- package/dist/chunks/compose-BKUTsB2W.cjs +0 -2
- package/dist/chunks/compose-BKUTsB2W.cjs.map +0 -1
- package/dist/chunks/designer-CWubIE69.js.map +0 -1
- package/dist/chunks/designer-C_m8DmMl.cjs +0 -69
- package/dist/chunks/designer-C_m8DmMl.cjs.map +0 -1
- package/dist/chunks/detail-Bv90gvy0.js.map +0 -1
- package/dist/chunks/detail-DNzqesdI.cjs +0 -5
- package/dist/chunks/detail-DNzqesdI.cjs.map +0 -1
- package/dist/chunks/instance-error-message-BW464LRQ.cjs +0 -2
- package/dist/chunks/instance-error-message-BW464LRQ.cjs.map +0 -1
- package/dist/chunks/instance-error-message-CAP1vJhX.js.map +0 -1
- package/dist/chunks/language-provider-Bdnx3Gxl.cjs +0 -2
- package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +0 -1
- package/dist/chunks/language-provider-phkWOapf.js +0 -17
- package/dist/chunks/language-provider-phkWOapf.js.map +0 -1
- package/dist/chunks/providers-BbCs23sk.js.map +0 -1
- package/dist/chunks/providers-D_KAgOOu.cjs +0 -2
- package/dist/chunks/providers-D_KAgOOu.cjs.map +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { n as e, t } from "./auth-provider-C2b-5mGt.js";
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
import { r as
|
|
6
|
-
import { t as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { Typography as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { archiveNotifications as
|
|
11
|
-
import { CalendarConfigProviderMoment as
|
|
3
|
+
import { a as n, r, t as i } from "./organization-time-zone-provider-DNL8yo4-.js";
|
|
4
|
+
import { r as a } from "./router-adapter-CkxCyzf5.js";
|
|
5
|
+
import { r as o } from "./routes-config-BcNaWJWJ.js";
|
|
6
|
+
import { t as s } from "./bpm-form-field-9B-Det0u.js";
|
|
7
|
+
import { Fragment as c, createContext as l, useCallback as u, useContext as d, useEffect as f, useMemo as p, useState as m } from "react";
|
|
8
|
+
import { Typography as ee } from "@mezzanine-ui/react";
|
|
9
|
+
import { Fragment as te, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
|
+
import { archiveNotifications as ne, decideTask as re, listNotifications as ie, markAllNotificationsRead as ae, markNotificationRead as oe, readUnreadNotificationCount as _, unarchiveNotifications as se } from "@rytass/bpm-core-client/workflow";
|
|
11
|
+
import { CalendarConfigProviderMoment as v, CalendarLocale as y } from "@mezzanine-ui/react/moment";
|
|
12
12
|
import ce from "@mezzanine-ui/react/Drawer";
|
|
13
|
-
import
|
|
13
|
+
import b from "@mezzanine-ui/react/Modal";
|
|
14
14
|
import le from "@mezzanine-ui/react/NotificationCenter";
|
|
15
|
-
import
|
|
15
|
+
import x from "@mezzanine-ui/react/Textarea";
|
|
16
16
|
// src/lib/notification-drawer-provider.tsx
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
let [t, n] =
|
|
17
|
+
var S = l(null);
|
|
18
|
+
function C({ children: e }) {
|
|
19
|
+
let [t, n] = m(!1), r = u(() => {
|
|
20
20
|
n(!0);
|
|
21
|
-
}, []), i =
|
|
21
|
+
}, []), i = u(() => {
|
|
22
22
|
n(!1);
|
|
23
|
-
}, []), a =
|
|
23
|
+
}, []), a = u(() => {
|
|
24
24
|
n((e) => !e);
|
|
25
|
-
}, []), o =
|
|
25
|
+
}, []), o = p(() => ({
|
|
26
26
|
close: i,
|
|
27
27
|
isOpen: t,
|
|
28
28
|
open: r,
|
|
@@ -33,13 +33,13 @@ function S({ children: e }) {
|
|
|
33
33
|
r,
|
|
34
34
|
a
|
|
35
35
|
]);
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ h(S.Provider, {
|
|
37
37
|
value: o,
|
|
38
38
|
children: e
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
41
|
+
function w() {
|
|
42
|
+
return d(S) || {
|
|
43
43
|
close: () => void 0,
|
|
44
44
|
isOpen: !1,
|
|
45
45
|
open: () => void 0,
|
|
@@ -47,14 +47,14 @@ function C() {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
// src/lib/notification-unread-provider.tsx
|
|
50
|
-
var
|
|
51
|
-
function
|
|
52
|
-
let { member: n } = e(), r = n?.memberId ?? null, [i, a] =
|
|
50
|
+
var T = l(null);
|
|
51
|
+
function E({ children: t }) {
|
|
52
|
+
let { member: n } = e(), r = n?.memberId ?? null, [i, a] = m(0), o = u(async () => {
|
|
53
53
|
if (!r) return a(0), 0;
|
|
54
|
-
let e = await
|
|
54
|
+
let e = await _(r);
|
|
55
55
|
return a(e), e;
|
|
56
56
|
}, [r]);
|
|
57
|
-
|
|
57
|
+
f(() => {
|
|
58
58
|
let e = !0;
|
|
59
59
|
return (async () => {
|
|
60
60
|
try {
|
|
@@ -67,47 +67,36 @@ function T({ children: t }) {
|
|
|
67
67
|
e = !1;
|
|
68
68
|
};
|
|
69
69
|
}, [o]);
|
|
70
|
-
let s =
|
|
70
|
+
let s = p(() => ({
|
|
71
71
|
refreshUnreadCount: o,
|
|
72
72
|
unreadCount: i
|
|
73
73
|
}), [o, i]);
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ h(T.Provider, {
|
|
75
75
|
value: s,
|
|
76
76
|
children: t
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
79
|
+
function ue() {
|
|
80
|
+
return d(T) || {
|
|
81
81
|
refreshUnreadCount: async () => 0,
|
|
82
82
|
unreadCount: 0
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
// src/components/notification-drawer.
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"yesterday",
|
|
89
|
-
"past7Days",
|
|
90
|
-
"earlier"
|
|
91
|
-
], ue = {
|
|
92
|
-
earlier: "更早",
|
|
93
|
-
past7Days: "過去七天",
|
|
94
|
-
today: "今天",
|
|
95
|
-
yesterday: "昨天"
|
|
96
|
-
}, de = 50, fe = "toggleArchived";
|
|
97
|
-
function pe(e) {
|
|
98
|
-
let t = j(e) !== !1, n = e.actionable && !!e.instanceId && M(e);
|
|
85
|
+
// src/components/notification-drawer-options.ts
|
|
86
|
+
function de(e) {
|
|
87
|
+
let t = D(e), n = O(e, t) !== !1, r = e.actionable && !!e.instanceId && (k(t, "hasFillableFields") || k(t, "requireApprovalComment"));
|
|
99
88
|
return [
|
|
100
|
-
...e.actionable ? [
|
|
89
|
+
...e.actionable ? [r ? {
|
|
101
90
|
id: "view",
|
|
102
91
|
name: "開啟案件"
|
|
103
92
|
} : {
|
|
104
93
|
id: "approve",
|
|
105
94
|
name: "同意"
|
|
106
|
-
}, ...
|
|
95
|
+
}, ...n ? [{
|
|
107
96
|
id: "reject",
|
|
108
97
|
name: "拒絕"
|
|
109
98
|
}] : []] : [],
|
|
110
|
-
...e.instanceId && !
|
|
99
|
+
...e.instanceId && !r ? [{
|
|
111
100
|
id: "view",
|
|
112
101
|
name: "查看案件"
|
|
113
102
|
}] : [],
|
|
@@ -124,127 +113,155 @@ function pe(e) {
|
|
|
124
113
|
}
|
|
125
114
|
];
|
|
126
115
|
}
|
|
127
|
-
|
|
116
|
+
function D(e) {
|
|
117
|
+
try {
|
|
118
|
+
let t = JSON.parse(e.payloadJson);
|
|
119
|
+
return A(t) ? t : null;
|
|
120
|
+
} catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function O(e, t) {
|
|
125
|
+
return t && typeof t.allowReject == "boolean" ? t.allowReject : e.allowReject;
|
|
126
|
+
}
|
|
127
|
+
function k(e, t) {
|
|
128
|
+
return e !== null && e[t] === !0;
|
|
129
|
+
}
|
|
130
|
+
function A(e) {
|
|
131
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
132
|
+
}
|
|
133
|
+
// src/components/notification-drawer.tsx
|
|
134
|
+
var fe = [
|
|
135
|
+
"today",
|
|
136
|
+
"yesterday",
|
|
137
|
+
"past7Days",
|
|
138
|
+
"earlier"
|
|
139
|
+
], pe = {
|
|
140
|
+
earlier: "更早",
|
|
141
|
+
past7Days: "過去七天",
|
|
142
|
+
today: "今天",
|
|
143
|
+
yesterday: "昨天"
|
|
144
|
+
}, me = 50, he = "toggleArchived", j = {
|
|
128
145
|
APPROVED: "簽核任務已同意",
|
|
129
146
|
REJECTED: "簽核任務已拒絕",
|
|
130
147
|
RETURNED: "簽核任務已退回",
|
|
131
148
|
SUPERSEDED: "簽核任務已結束",
|
|
132
149
|
TRANSFERRED: "簽核任務已轉派"
|
|
133
150
|
};
|
|
134
|
-
function
|
|
135
|
-
return e.resolution ?
|
|
151
|
+
function M(e) {
|
|
152
|
+
return e.resolution ? j[e.resolution] : e.title;
|
|
136
153
|
}
|
|
137
154
|
function ge(e) {
|
|
138
|
-
return e.resolution === "APPROVED" ? "success" : e.resolution === "REJECTED" ? "error" : e.resolution ? "info" :
|
|
155
|
+
return e.resolution === "APPROVED" ? "success" : e.resolution === "REJECTED" ? "error" : e.resolution ? "info" : P(e.type);
|
|
139
156
|
}
|
|
140
|
-
function
|
|
141
|
-
let t =
|
|
157
|
+
function N() {
|
|
158
|
+
let t = a(), n = o(), { member: r } = e(), { close: i, isOpen: l } = w(), { refreshUnreadCount: d } = ue(), _ = r?.memberId ?? null, [v, y] = m([]), [S, C] = m(0), [T, E] = m(1), [D, O] = m(!1), [k, A] = m(!1), [j, N] = m(null), [P, I] = m(null), [L, ve] = m("all"), [R, ye] = m(!1), [z, B] = m(null), [V, H] = m(""), [U, W] = m(null), [be, G] = m(""), [K, q] = m(!1), xe = V.trim(), J = be.trim(), Y = u(async (e, t) => {
|
|
142
159
|
if (!_) return !1;
|
|
143
|
-
|
|
160
|
+
O(!0), N(null);
|
|
144
161
|
try {
|
|
145
|
-
let n = await
|
|
162
|
+
let n = await ie({
|
|
146
163
|
includeArchived: R,
|
|
147
164
|
includeRead: !0,
|
|
148
165
|
page: e,
|
|
149
|
-
pageSize:
|
|
166
|
+
pageSize: me,
|
|
150
167
|
recipientMemberId: _
|
|
151
168
|
});
|
|
152
|
-
return
|
|
169
|
+
return y((e) => t ? [...e, ...n.notifications] : n.notifications), C(n.totalCount), E(e), await d(), !0;
|
|
153
170
|
} catch (e) {
|
|
154
|
-
return
|
|
171
|
+
return N(F(e)), !1;
|
|
155
172
|
} finally {
|
|
156
|
-
|
|
173
|
+
O(!1);
|
|
157
174
|
}
|
|
158
175
|
}, [
|
|
159
176
|
_,
|
|
160
177
|
R,
|
|
161
|
-
|
|
178
|
+
d
|
|
162
179
|
]);
|
|
163
|
-
|
|
164
|
-
|
|
180
|
+
f(() => {
|
|
181
|
+
l && _ && (N(null), I(null), Y(1, !1));
|
|
165
182
|
}, [
|
|
166
|
-
|
|
183
|
+
l,
|
|
167
184
|
_,
|
|
168
185
|
Y
|
|
169
186
|
]);
|
|
170
|
-
let Se =
|
|
187
|
+
let Se = u((e) => {
|
|
171
188
|
let t = e.target.value;
|
|
172
189
|
(t === "all" || t === "read" || t === "unread") && ve(t);
|
|
173
|
-
}, []), Ce =
|
|
174
|
-
if (_ && !
|
|
175
|
-
|
|
190
|
+
}, []), Ce = u(async () => {
|
|
191
|
+
if (_ && !k) {
|
|
192
|
+
A(!0), N(null);
|
|
176
193
|
try {
|
|
177
|
-
await
|
|
194
|
+
await ae({ recipientMemberId: _ }), await Y(1, !1);
|
|
178
195
|
} catch (e) {
|
|
179
|
-
|
|
196
|
+
N(F(e));
|
|
180
197
|
} finally {
|
|
181
|
-
|
|
198
|
+
A(!1);
|
|
182
199
|
}
|
|
183
200
|
}
|
|
184
201
|
}, [
|
|
185
|
-
|
|
202
|
+
k,
|
|
186
203
|
_,
|
|
187
204
|
Y
|
|
188
|
-
]), we =
|
|
189
|
-
|
|
205
|
+
]), we = u(() => {
|
|
206
|
+
D || Y(T + 1, !0);
|
|
190
207
|
}, [
|
|
191
|
-
|
|
208
|
+
D,
|
|
192
209
|
Y,
|
|
193
210
|
T
|
|
194
|
-
]), Te =
|
|
211
|
+
]), Te = u(async (e) => {
|
|
195
212
|
if (_) try {
|
|
196
|
-
await
|
|
213
|
+
await oe({
|
|
197
214
|
id: e,
|
|
198
215
|
readerMemberId: _
|
|
199
216
|
}), await Y(1, !1);
|
|
200
217
|
} catch (e) {
|
|
201
|
-
|
|
218
|
+
N(F(e));
|
|
202
219
|
}
|
|
203
|
-
}, [_, Y]), Ee =
|
|
220
|
+
}, [_, Y]), Ee = u(async (e) => {
|
|
204
221
|
if (_) {
|
|
205
|
-
|
|
222
|
+
N(null), I(null);
|
|
206
223
|
try {
|
|
207
|
-
let t =
|
|
208
|
-
e.archivedAt ? (await se({ ids: [e.id] }), I(`已將「${t}」移出封存。`)) : (await
|
|
224
|
+
let t = M(e);
|
|
225
|
+
e.archivedAt ? (await se({ ids: [e.id] }), I(`已將「${t}」移出封存。`)) : (await ne({ ids: [e.id] }), I(`已封存「${t}」。`)), await Y(1, !1);
|
|
209
226
|
} catch (e) {
|
|
210
|
-
|
|
227
|
+
N(F(e));
|
|
211
228
|
}
|
|
212
229
|
}
|
|
213
|
-
}, [_, Y]), De =
|
|
214
|
-
e.id ===
|
|
215
|
-
}, []), X =
|
|
230
|
+
}, [_, Y]), De = u((e) => {
|
|
231
|
+
e.id === he && (I(null), ye((e) => !e));
|
|
232
|
+
}, []), X = u(async (e) => {
|
|
216
233
|
if (e.instanceId && _) try {
|
|
217
|
-
e.status !== "READ" && (await
|
|
234
|
+
e.status !== "READ" && (await oe({
|
|
218
235
|
id: e.id,
|
|
219
236
|
readerMemberId: _
|
|
220
|
-
}), await
|
|
237
|
+
}), await d()), i(), t.push(n.caseDetail(e.instanceId));
|
|
221
238
|
} catch (e) {
|
|
222
|
-
|
|
239
|
+
N(F(e));
|
|
223
240
|
}
|
|
224
241
|
}, [
|
|
225
|
-
|
|
242
|
+
i,
|
|
226
243
|
_,
|
|
227
|
-
|
|
244
|
+
d,
|
|
228
245
|
t,
|
|
229
246
|
n
|
|
230
|
-
]),
|
|
231
|
-
|
|
232
|
-
}, []),
|
|
233
|
-
K || (B(null),
|
|
234
|
-
}, [K]),
|
|
247
|
+
]), Oe = u((e) => {
|
|
248
|
+
N(null), B(e), H("");
|
|
249
|
+
}, []), ke = u(() => {
|
|
250
|
+
K || (B(null), H(""));
|
|
251
|
+
}, [K]), Ae = u(async () => {
|
|
235
252
|
let e = z;
|
|
236
253
|
if (e?.taskId && _ && !K) {
|
|
237
|
-
q(!0),
|
|
254
|
+
q(!0), N(null), I(null);
|
|
238
255
|
try {
|
|
239
|
-
if (await
|
|
256
|
+
if (await re({
|
|
240
257
|
action: "APPROVED",
|
|
241
258
|
comment: xe || null,
|
|
242
259
|
decidedByMemberId: _,
|
|
243
260
|
taskId: e.taskId
|
|
244
261
|
}), !await Y(1, !1)) return;
|
|
245
|
-
B(null),
|
|
262
|
+
B(null), H(""), I(`已同意「${e.title}」。`);
|
|
246
263
|
} catch (e) {
|
|
247
|
-
|
|
264
|
+
N(F(e));
|
|
248
265
|
} finally {
|
|
249
266
|
q(!1);
|
|
250
267
|
}
|
|
@@ -255,23 +272,23 @@ function O() {
|
|
|
255
272
|
K,
|
|
256
273
|
Y,
|
|
257
274
|
xe
|
|
258
|
-
]),
|
|
259
|
-
|
|
260
|
-
}, []),
|
|
261
|
-
|
|
262
|
-
}, []),
|
|
263
|
-
let e =
|
|
275
|
+
]), je = u((e) => {
|
|
276
|
+
W(e), G("");
|
|
277
|
+
}, []), Me = u(() => {
|
|
278
|
+
W(null), G("");
|
|
279
|
+
}, []), Ne = u(async () => {
|
|
280
|
+
let e = U;
|
|
264
281
|
if (e?.taskId && _ && J && !K) {
|
|
265
|
-
q(!0),
|
|
282
|
+
q(!0), N(null), I(null);
|
|
266
283
|
try {
|
|
267
|
-
await
|
|
284
|
+
await re({
|
|
268
285
|
action: "REJECTED",
|
|
269
286
|
comment: J,
|
|
270
287
|
decidedByMemberId: _,
|
|
271
288
|
taskId: e.taskId
|
|
272
|
-
}),
|
|
289
|
+
}), W(null), G(""), I(`已拒絕「${e.title}」。`), await Y(1, !1);
|
|
273
290
|
} catch (e) {
|
|
274
|
-
|
|
291
|
+
N(F(e));
|
|
275
292
|
} finally {
|
|
276
293
|
q(!1);
|
|
277
294
|
}
|
|
@@ -280,36 +297,36 @@ function O() {
|
|
|
280
297
|
_,
|
|
281
298
|
K,
|
|
282
299
|
Y,
|
|
283
|
-
|
|
300
|
+
U,
|
|
284
301
|
J
|
|
285
|
-
]),
|
|
302
|
+
]), Pe = u((e, t) => {
|
|
286
303
|
let n = t.id;
|
|
287
|
-
n === "approve" ?
|
|
304
|
+
n === "approve" ? Oe(e) : n === "reject" ? je(e) : n === "view" ? X(e) : n === "read" ? Te(e.id) : (n === "archive" || n === "unarchive") && Ee(e);
|
|
288
305
|
}, [
|
|
289
306
|
Ee,
|
|
290
307
|
Te,
|
|
291
308
|
X,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
]),
|
|
295
|
-
|
|
296
|
-
}, [X,
|
|
297
|
-
(t.key === "Enter" || t.key === " ") &&
|
|
298
|
-
}, [X,
|
|
299
|
-
let e = /* @__PURE__ */ new Date(), t =
|
|
309
|
+
Oe,
|
|
310
|
+
je
|
|
311
|
+
]), Z = u((e, t) => !(e instanceof Node) || !t.contains(e) ? !1 : !(e instanceof Element && e.closest("button")), []), Fe = u((e, t) => {
|
|
312
|
+
Z(t.target, t.currentTarget) && X(e);
|
|
313
|
+
}, [X, Z]), Ie = u((e, t) => {
|
|
314
|
+
(t.key === "Enter" || t.key === " ") && Z(t.target, t.currentTarget) && (t.preventDefault(), X(e));
|
|
315
|
+
}, [X, Z]), Le = p(() => v.filter((e) => L === "all" ? !0 : L === "read" ? e.status === "READ" : e.status !== "READ"), [L, v]), Q = p(() => {
|
|
316
|
+
let e = /* @__PURE__ */ new Date(), t = fe.reduce((e, t) => (e[t] = [], e), {
|
|
300
317
|
earlier: [],
|
|
301
318
|
past7Days: [],
|
|
302
319
|
today: [],
|
|
303
320
|
yesterday: []
|
|
304
321
|
});
|
|
305
|
-
return
|
|
322
|
+
return Le.forEach((n) => {
|
|
306
323
|
t[_e(n.createdAt, e)].push(n);
|
|
307
|
-
}),
|
|
308
|
-
}, [
|
|
309
|
-
return _ ? /* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
bottomGhostActionDisabled:
|
|
312
|
-
bottomGhostActionLoading:
|
|
324
|
+
}), fe.map((e) => [e, t[e]]).filter(([, e]) => e.length > 0);
|
|
325
|
+
}, [Le]), $ = v.length < S;
|
|
326
|
+
return _ ? /* @__PURE__ */ g(te, { children: [
|
|
327
|
+
/* @__PURE__ */ h(ce, {
|
|
328
|
+
bottomGhostActionDisabled: k || D,
|
|
329
|
+
bottomGhostActionLoading: k,
|
|
313
330
|
bottomGhostActionText: "全部標為已讀",
|
|
314
331
|
bottomOnGhostActionClick: () => {
|
|
315
332
|
Ce();
|
|
@@ -317,15 +334,15 @@ function O() {
|
|
|
317
334
|
bottomOnPrimaryActionClick: () => {
|
|
318
335
|
we();
|
|
319
336
|
},
|
|
320
|
-
bottomPrimaryActionDisabled: !$ ||
|
|
321
|
-
bottomPrimaryActionLoading:
|
|
337
|
+
bottomPrimaryActionDisabled: !$ || D,
|
|
338
|
+
bottomPrimaryActionLoading: D && $,
|
|
322
339
|
bottomPrimaryActionText: $ ? "載入更多" : "已顯示全部",
|
|
323
340
|
contentKey: `${L}:${R}:${v.length}`,
|
|
324
341
|
filterAreaAllRadioLabel: "全部",
|
|
325
342
|
filterAreaOnRadioChange: Se,
|
|
326
343
|
filterAreaOnSelect: De,
|
|
327
344
|
filterAreaOptions: [{
|
|
328
|
-
id:
|
|
345
|
+
id: he,
|
|
329
346
|
name: R ? "隱藏已封存" : "顯示已封存"
|
|
330
347
|
}],
|
|
331
348
|
filterAreaReadRadioLabel: "已讀",
|
|
@@ -335,61 +352,61 @@ function O() {
|
|
|
335
352
|
headerTitle: "通知中心",
|
|
336
353
|
isBottomDisplay: !0,
|
|
337
354
|
isHeaderDisplay: !0,
|
|
338
|
-
onClose:
|
|
339
|
-
open:
|
|
355
|
+
onClose: i,
|
|
356
|
+
open: l,
|
|
340
357
|
size: "medium",
|
|
341
|
-
children: /* @__PURE__ */
|
|
358
|
+
children: /* @__PURE__ */ g("div", {
|
|
342
359
|
role: "list",
|
|
343
360
|
children: [
|
|
344
|
-
|
|
361
|
+
j ? /* @__PURE__ */ h("p", {
|
|
345
362
|
role: "alert",
|
|
346
363
|
style: {
|
|
347
364
|
color: "var(--mzn-color-text-error, #d92d20)",
|
|
348
365
|
padding: "12px 16px"
|
|
349
366
|
},
|
|
350
|
-
children:
|
|
367
|
+
children: j
|
|
351
368
|
}) : null,
|
|
352
|
-
|
|
369
|
+
P ? /* @__PURE__ */ h("p", {
|
|
353
370
|
role: "status",
|
|
354
371
|
style: {
|
|
355
372
|
color: "var(--mzn-color-text-success, #079455)",
|
|
356
373
|
padding: "12px 16px"
|
|
357
374
|
},
|
|
358
|
-
children:
|
|
375
|
+
children: P
|
|
359
376
|
}) : null,
|
|
360
|
-
|
|
377
|
+
Q.length === 0 ? /* @__PURE__ */ h("p", {
|
|
361
378
|
style: {
|
|
362
379
|
color: "var(--mzn-color-text-secondary, #6b7280)",
|
|
363
380
|
padding: "24px 16px",
|
|
364
381
|
textAlign: "center"
|
|
365
382
|
},
|
|
366
|
-
children:
|
|
383
|
+
children: D ? "載入中…" : "目前沒有通知"
|
|
367
384
|
}) : null,
|
|
368
|
-
|
|
385
|
+
Q.map(([e, t]) => /* @__PURE__ */ h(c, { children: t.map((t, n) => {
|
|
369
386
|
let r = t.instanceId !== null;
|
|
370
|
-
return /* @__PURE__ */
|
|
387
|
+
return /* @__PURE__ */ h("div", {
|
|
371
388
|
onClick: r ? (e) => {
|
|
372
|
-
|
|
389
|
+
Fe(t, e);
|
|
373
390
|
} : void 0,
|
|
374
391
|
onKeyDown: r ? (e) => {
|
|
375
|
-
|
|
392
|
+
Ie(t, e);
|
|
376
393
|
} : void 0,
|
|
377
394
|
role: r ? "button" : void 0,
|
|
378
395
|
style: r ? { cursor: "pointer" } : void 0,
|
|
379
396
|
tabIndex: r ? 0 : void 0,
|
|
380
|
-
children: /* @__PURE__ */
|
|
397
|
+
children: /* @__PURE__ */ h(le, {
|
|
381
398
|
appendTips: t.archivedAt ? "已封存" : void 0,
|
|
382
399
|
description: t.body,
|
|
383
400
|
onBadgeSelect: (e) => {
|
|
384
|
-
|
|
401
|
+
Pe(t, e);
|
|
385
402
|
},
|
|
386
|
-
options: [...
|
|
387
|
-
prependTips: n === 0 ?
|
|
403
|
+
options: [...de(t)],
|
|
404
|
+
prependTips: n === 0 ? pe[e] : void 0,
|
|
388
405
|
reference: t.id,
|
|
389
406
|
severity: ge(t),
|
|
390
407
|
showBadge: t.status !== "READ",
|
|
391
408
|
timeStamp: t.createdAt,
|
|
392
|
-
title:
|
|
409
|
+
title: M(t),
|
|
393
410
|
type: "drawer"
|
|
394
411
|
})
|
|
395
412
|
}, t.id);
|
|
@@ -397,15 +414,15 @@ function O() {
|
|
|
397
414
|
]
|
|
398
415
|
})
|
|
399
416
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ g(b, {
|
|
401
418
|
cancelText: "取消",
|
|
402
419
|
confirmText: "送出同意",
|
|
403
420
|
loading: K,
|
|
404
421
|
modalType: "standard",
|
|
405
|
-
onCancel:
|
|
406
|
-
onClose:
|
|
422
|
+
onCancel: ke,
|
|
423
|
+
onClose: ke,
|
|
407
424
|
onConfirm: () => {
|
|
408
|
-
|
|
425
|
+
Ae();
|
|
409
426
|
},
|
|
410
427
|
open: z !== null,
|
|
411
428
|
showModalFooter: !0,
|
|
@@ -413,26 +430,26 @@ function O() {
|
|
|
413
430
|
size: "regular",
|
|
414
431
|
supportingText: "可以留下同意說明,內容會記錄在簽核歷程;不填也可以直接送出。",
|
|
415
432
|
title: "簽核意見",
|
|
416
|
-
children: [
|
|
433
|
+
children: [j ? /* @__PURE__ */ h(ee, {
|
|
417
434
|
color: "text-error",
|
|
418
435
|
role: "alert",
|
|
419
436
|
variant: "body",
|
|
420
|
-
children:
|
|
421
|
-
}) : null, /* @__PURE__ */
|
|
437
|
+
children: j
|
|
438
|
+
}) : null, /* @__PURE__ */ h(s, {
|
|
422
439
|
label: "簽核意見",
|
|
423
440
|
name: "notificationApproveComment",
|
|
424
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ h(x, {
|
|
425
442
|
autoFocus: !0,
|
|
426
443
|
onChange: (e) => {
|
|
427
|
-
|
|
444
|
+
H(e.target.value);
|
|
428
445
|
},
|
|
429
446
|
placeholder: "選填,例如補充核准條件或提醒事項",
|
|
430
447
|
rows: 4,
|
|
431
|
-
value:
|
|
448
|
+
value: V
|
|
432
449
|
})
|
|
433
450
|
})]
|
|
434
451
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ h(b, {
|
|
436
453
|
cancelText: "取消",
|
|
437
454
|
confirmButtonProps: {
|
|
438
455
|
disabled: !J,
|
|
@@ -442,30 +459,30 @@ function O() {
|
|
|
442
459
|
loading: K,
|
|
443
460
|
modalStatusType: "error",
|
|
444
461
|
modalType: "standard",
|
|
445
|
-
onCancel:
|
|
446
|
-
onClose:
|
|
462
|
+
onCancel: Me,
|
|
463
|
+
onClose: Me,
|
|
447
464
|
onConfirm: () => {
|
|
448
|
-
|
|
465
|
+
Ne();
|
|
449
466
|
},
|
|
450
|
-
open:
|
|
467
|
+
open: U !== null,
|
|
451
468
|
showModalFooter: !0,
|
|
452
469
|
showModalHeader: !0,
|
|
453
470
|
size: "regular",
|
|
454
471
|
supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
|
|
455
472
|
title: "拒絕原因",
|
|
456
|
-
children: /* @__PURE__ */
|
|
473
|
+
children: /* @__PURE__ */ h(x, {
|
|
457
474
|
autoFocus: !0,
|
|
458
475
|
onChange: (e) => {
|
|
459
476
|
G(e.target.value);
|
|
460
477
|
},
|
|
461
478
|
placeholder: "請輸入拒絕原因",
|
|
462
479
|
rows: 4,
|
|
463
|
-
value:
|
|
480
|
+
value: be
|
|
464
481
|
})
|
|
465
482
|
})
|
|
466
483
|
] }) : null;
|
|
467
484
|
}
|
|
468
|
-
function
|
|
485
|
+
function P(e) {
|
|
469
486
|
return e === "SLA_OVERDUE" ? "error" : e === "SLA_WARNING" ? "warning" : e === "INSTANCE_COMPLETED" ? "success" : "info";
|
|
470
487
|
}
|
|
471
488
|
function _e(e, t) {
|
|
@@ -476,42 +493,26 @@ function _e(e, t) {
|
|
|
476
493
|
let a = new Date(r);
|
|
477
494
|
return a.setDate(a.getDate() - 1), i.getTime() === a.getTime() ? "yesterday" : (t.getTime() - n.getTime()) / 864e5 <= 7 ? "past7Days" : "earlier";
|
|
478
495
|
}
|
|
479
|
-
function
|
|
496
|
+
function F(e) {
|
|
480
497
|
return e instanceof Error ? e.message : "發生未知錯誤";
|
|
481
498
|
}
|
|
482
|
-
function j(e) {
|
|
483
|
-
try {
|
|
484
|
-
let t = JSON.parse(e.payloadJson);
|
|
485
|
-
return N(t) && typeof t.allowReject == "boolean" ? t.allowReject : e.allowReject;
|
|
486
|
-
} catch {
|
|
487
|
-
return e.allowReject;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
function M(e) {
|
|
491
|
-
try {
|
|
492
|
-
let t = JSON.parse(e.payloadJson);
|
|
493
|
-
return N(t) && t.hasFillableFields === !0;
|
|
494
|
-
} catch {
|
|
495
|
-
return !1;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
function N(e) {
|
|
499
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
500
|
-
}
|
|
501
499
|
// src/lib/providers.tsx
|
|
502
|
-
function
|
|
503
|
-
return /* @__PURE__ */
|
|
504
|
-
locale:
|
|
505
|
-
children: /* @__PURE__ */
|
|
506
|
-
language:
|
|
507
|
-
children: /* @__PURE__ */
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
500
|
+
function I({ children: e, locale: a = y.ZH_TW, language: o = n, organizationTimeZone: s, publicPaths: c, loginPath: l }) {
|
|
501
|
+
return /* @__PURE__ */ h(v, {
|
|
502
|
+
locale: a,
|
|
503
|
+
children: /* @__PURE__ */ h(r, {
|
|
504
|
+
language: o,
|
|
505
|
+
children: /* @__PURE__ */ h(i, {
|
|
506
|
+
timeZone: s,
|
|
507
|
+
children: /* @__PURE__ */ h(t, {
|
|
508
|
+
publicPaths: c,
|
|
509
|
+
loginPath: l,
|
|
510
|
+
children: /* @__PURE__ */ h(E, { children: /* @__PURE__ */ g(C, { children: [e, /* @__PURE__ */ h(N, {})] }) })
|
|
511
|
+
})
|
|
511
512
|
})
|
|
512
513
|
})
|
|
513
514
|
});
|
|
514
515
|
}
|
|
515
|
-
export {
|
|
516
|
+
export { C as a, ue as i, N as n, w as o, E as r, I as t };
|
|
516
517
|
|
|
517
|
-
//# sourceMappingURL=providers-
|
|
518
|
+
//# sourceMappingURL=providers-CQWekD7_.js.map
|