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