@rytass/bpm-core-react 0.17.1 → 0.17.3

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