@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.
Files changed (99) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -1
  3. package/dist/chunks/{FormBuilderView-aBcA-_tt.cjs → FormBuilderView-CUOyS07f.cjs} +2 -2
  4. package/dist/chunks/{FormBuilderView-aBcA-_tt.cjs.map → FormBuilderView-CUOyS07f.cjs.map} +1 -1
  5. package/dist/chunks/{FormBuilderView-BYL42M0d.js → FormBuilderView-ClLnQ1e_.js} +2 -2
  6. package/dist/chunks/{FormBuilderView-BYL42M0d.js.map → FormBuilderView-ClLnQ1e_.js.map} +1 -1
  7. package/dist/chunks/{FormRendererView-cZGOOjU5.js → FormRendererView-BsTwZkqU.js} +207 -198
  8. package/dist/chunks/FormRendererView-BsTwZkqU.js.map +1 -0
  9. package/dist/chunks/FormRendererView-GpsE03np.cjs +4 -0
  10. package/dist/chunks/FormRendererView-GpsE03np.cjs.map +1 -0
  11. package/dist/chunks/approver-filled-form-D1DmqDVP.cjs +2 -0
  12. package/dist/chunks/approver-filled-form-D1DmqDVP.cjs.map +1 -0
  13. package/dist/chunks/approver-filled-form-DuQGPtNB.js +95 -0
  14. package/dist/chunks/approver-filled-form-DuQGPtNB.js.map +1 -0
  15. package/dist/chunks/{compose-DOEaPfEC.cjs → compose-DjEJi5Dv.cjs} +2 -2
  16. package/dist/chunks/{compose-DOEaPfEC.cjs.map → compose-DjEJi5Dv.cjs.map} +1 -1
  17. package/dist/chunks/{compose-v1Vcw9hE.js → compose-WekGZj74.js} +4 -4
  18. package/dist/chunks/{compose-v1Vcw9hE.js.map → compose-WekGZj74.js.map} +1 -1
  19. package/dist/chunks/{designer-DBBrktom.js → designer-D87ILhjz.js} +1664 -1182
  20. package/dist/chunks/designer-D87ILhjz.js.map +1 -0
  21. package/dist/chunks/designer-DESS0CMl.cjs +65 -0
  22. package/dist/chunks/designer-DESS0CMl.cjs.map +1 -0
  23. package/dist/chunks/detail-D49NuNCn.cjs +2 -0
  24. package/dist/chunks/detail-D49NuNCn.cjs.map +1 -0
  25. package/dist/chunks/{detail-B_bSg31B.js → detail-URwxkcro.js} +1036 -847
  26. package/dist/chunks/detail-URwxkcro.js.map +1 -0
  27. package/dist/chunks/{providers-H_vPRsSN.js → providers-B_d5tbCL.js} +178 -167
  28. package/dist/chunks/providers-B_d5tbCL.js.map +1 -0
  29. package/dist/chunks/providers-chuJvMgv.cjs +2 -0
  30. package/dist/chunks/providers-chuJvMgv.cjs.map +1 -0
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/next/index.cjs +1 -1
  34. package/dist/next/index.js +1 -1
  35. package/dist/next/workflow-chat-route.cjs +1 -0
  36. package/dist/next/workflow-chat-route.cjs.map +1 -1
  37. package/dist/next/workflow-chat-route.d.cts +1 -1
  38. package/dist/next/workflow-chat-route.d.ts +1 -1
  39. package/dist/next/workflow-chat-route.js +1 -1
  40. package/dist/next/workflow-chat-route.js.map +1 -1
  41. package/dist/pages/instances/detail/index.cjs +1 -1
  42. package/dist/pages/instances/detail/index.js +1 -1
  43. package/dist/pages/templates/compose/index.cjs +1 -1
  44. package/dist/pages/templates/compose/index.js +1 -1
  45. package/dist/pages/templates/designer/index.cjs +1 -1
  46. package/dist/pages/templates/designer/index.js +1 -1
  47. package/dist/views/forms/builder/index.cjs +1 -1
  48. package/dist/views/forms/builder/index.js +1 -1
  49. package/dist/views/forms/renderer/FormRendererView.d.cts +16 -1
  50. package/dist/views/forms/renderer/FormRendererView.d.ts +16 -1
  51. package/dist/views/forms/renderer/index.cjs +1 -1
  52. package/dist/views/forms/renderer/index.js +1 -1
  53. package/dist/views/inbox/index.cjs +1 -1
  54. package/dist/views/inbox/index.cjs.map +1 -1
  55. package/dist/views/inbox/index.js +109 -99
  56. package/dist/views/inbox/index.js.map +1 -1
  57. package/dist/views/instances/approver-filled-form.d.cts +76 -0
  58. package/dist/views/instances/approver-filled-form.d.ts +76 -0
  59. package/dist/views/instances/detail/index.cjs +1 -1
  60. package/dist/views/instances/detail/index.js +1 -1
  61. package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +30 -2
  62. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +30 -2
  63. package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +4 -1
  64. package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +4 -1
  65. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +21 -0
  66. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +21 -0
  67. package/dist/views/instances/detail/sections/container-helpers.d.cts +1 -1
  68. package/dist/views/instances/detail/sections/container-helpers.d.ts +1 -1
  69. package/dist/views/instances/detail/sections/shared.d.cts +11 -2
  70. package/dist/views/instances/detail/sections/shared.d.ts +11 -2
  71. package/dist/views/instances/new/index.cjs +1 -1
  72. package/dist/views/instances/new/index.cjs.map +1 -1
  73. package/dist/views/instances/new/index.js +88 -87
  74. package/dist/views/instances/new/index.js.map +1 -1
  75. package/dist/views/instances/viewer-field-access.d.cts +22 -0
  76. package/dist/views/instances/viewer-field-access.d.ts +22 -0
  77. package/dist/views/templates/compose/index.cjs +1 -1
  78. package/dist/views/templates/compose/index.js +1 -1
  79. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +33 -0
  80. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +33 -0
  81. package/dist/views/templates/designer/field-access-matrix/FieldAccessNodeSection.d.cts +20 -0
  82. package/dist/views/templates/designer/field-access-matrix/FieldAccessNodeSection.d.ts +20 -0
  83. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.cts +22 -0
  84. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.ts +22 -0
  85. package/dist/views/templates/designer/index.cjs +1 -1
  86. package/dist/views/templates/designer/index.js +1 -1
  87. package/package.json +3 -3
  88. package/dist/chunks/FormRendererView-DRFi_IH7.cjs +0 -4
  89. package/dist/chunks/FormRendererView-DRFi_IH7.cjs.map +0 -1
  90. package/dist/chunks/FormRendererView-cZGOOjU5.js.map +0 -1
  91. package/dist/chunks/designer-CTXMqCD2.cjs +0 -65
  92. package/dist/chunks/designer-CTXMqCD2.cjs.map +0 -1
  93. package/dist/chunks/designer-DBBrktom.js.map +0 -1
  94. package/dist/chunks/detail-BQSVgVlO.cjs +0 -2
  95. package/dist/chunks/detail-BQSVgVlO.cjs.map +0 -1
  96. package/dist/chunks/detail-B_bSg31B.js.map +0 -1
  97. package/dist/chunks/providers-DP7b0TMN.cjs +0 -2
  98. package/dist/chunks/providers-DP7b0TMN.cjs.map +0 -1
  99. 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 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";
12
- import se from "@mezzanine-ui/react/Drawer";
13
- import b from "@mezzanine-ui/react/Modal";
14
- import ce from "@mezzanine-ui/react/NotificationCenter";
15
- import x from "@mezzanine-ui/react/Textarea";
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 S = c(null);
18
- function C({ children: e }) {
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(S.Provider, {
36
+ return /* @__PURE__ */ p(x.Provider, {
37
37
  value: o,
38
38
  children: e
39
39
  });
40
40
  }
41
- function w() {
42
- return u(S) || {
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 T = c(null);
52
- function E({ children: e }) {
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 _(r);
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(T.Provider, {
75
+ return /* @__PURE__ */ p(w.Provider, {
76
76
  value: s,
77
77
  children: e
78
78
  });
79
79
  }
80
- function D() {
81
- return u(T) || {
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 O = [
88
+ var D = [
89
89
  "today",
90
90
  "yesterday",
91
91
  "past7Days",
92
92
  "earlier"
93
- ], le = {
93
+ ], ue = {
94
94
  earlier: "更早",
95
95
  past7Days: "過去七天",
96
96
  today: "今天",
97
97
  yesterday: "昨天"
98
- }, ue = 50, de = "toggleArchived";
99
- function fe(e) {
100
- let t = M(e) !== !1;
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 pe = {
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 === "APPROVED" ? "success" : e.resolution === "REJECTED" ? "error" : e.resolution ? "info" : A(e.type);
137
+ return e.resolution ? me[e.resolution] : e.title;
138
138
  }
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);
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 ie({
145
- includeArchived: z,
147
+ let n = await ae({
148
+ includeArchived: R,
146
149
  includeRead: !0,
147
150
  page: e,
148
- pageSize: ue,
149
- recipientMemberId: v
151
+ pageSize: de,
152
+ recipientMemberId: _
150
153
  });
151
- return S((e) => t ? [...e, ...n.notifications] : n.notifications), T(n.totalCount), pe(e), await _(), !0;
154
+ return x((e) => t ? [...e, ...n.notifications] : n.notifications), w(n.totalCount), me(e), await g(), !0;
152
155
  } catch (e) {
153
- return F(j(e)), !1;
156
+ return P(A(e)), !1;
154
157
  } finally {
155
- A(!1);
158
+ k(!1);
156
159
  }
157
160
  }, [
158
- v,
159
- z,
160
- _
161
+ _,
162
+ R,
163
+ g
161
164
  ]);
162
165
  ee(() => {
163
- u && v && (F(null), L(null), Y(1, !1));
166
+ u && _ && (P(null), I(null), Y(1, !1));
164
167
  }, [
165
168
  u,
166
- v,
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") && _e(t);
174
+ (t === "all" || t === "read" || t === "unread") && ve(t);
172
175
  }, []), Ce = l(async () => {
173
- if (v && !M) {
174
- N(!0), F(null);
176
+ if (_ && !j) {
177
+ M(!0), P(null);
175
178
  try {
176
- await ae({ recipientMemberId: v }), await Y(1, !1);
179
+ await oe({ recipientMemberId: _ }), await Y(1, !1);
177
180
  } catch (e) {
178
- F(j(e));
181
+ P(A(e));
179
182
  } finally {
180
- N(!1);
183
+ M(!1);
181
184
  }
182
185
  }
183
186
  }, [
184
- M,
185
- v,
187
+ j,
188
+ _,
186
189
  Y
187
190
  ]), we = l(() => {
188
- k || Y(E + 1, !0);
191
+ O || Y(T + 1, !0);
189
192
  }, [
190
- k,
193
+ O,
191
194
  Y,
192
- E
195
+ T
193
196
  ]), Te = l(async (e) => {
194
- if (v) try {
195
- await g({
197
+ if (_) try {
198
+ await h({
196
199
  id: e,
197
- readerMemberId: v
200
+ readerMemberId: _
198
201
  }), await Y(1, !1);
199
202
  } catch (e) {
200
- F(j(e));
203
+ P(A(e));
201
204
  }
202
- }, [v, Y]), Ee = l(async (e) => {
203
- if (v) {
204
- F(null), L(null);
205
+ }, [_, Y]), Ee = l(async (e) => {
206
+ if (_) {
207
+ P(null), I(null);
205
208
  try {
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);
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
- F(j(e));
212
+ P(A(e));
210
213
  }
211
214
  }
212
- }, [v, Y]), De = l((e) => {
213
- e.id === de && (L(null), ve((e) => !e));
215
+ }, [_, Y]), De = l((e) => {
216
+ e.id === fe && (I(null), ye((e) => !e));
214
217
  }, []), X = l(async (e) => {
215
- if (e.instanceId && v) try {
216
- e.status !== "READ" && (await g({
218
+ if (e.instanceId && _) try {
219
+ e.status !== "READ" && (await h({
217
220
  id: e.id,
218
- readerMemberId: v
219
- }), await _()), c(), n.push(r.caseDetail(e.instanceId));
221
+ readerMemberId: _
222
+ }), await g()), c(), n.push(r.caseDetail(e.instanceId));
220
223
  } catch (e) {
221
- F(j(e));
224
+ P(A(e));
222
225
  }
223
226
  }, [
224
227
  c,
225
- v,
226
228
  _,
229
+ g,
227
230
  n,
228
231
  r
229
- ]), Oe = l((e) => {
230
- F(null), V(e), H("");
231
- }, []), ke = l(() => {
232
- K || (V(null), H(""));
233
- }, [K]), Ae = l(async () => {
234
- let e = B;
235
- if (e?.taskId && v && !K) {
236
- q(!0), F(null), L(null);
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 h({
241
+ if (await ie({
239
242
  action: "APPROVED",
240
243
  comment: xe || null,
241
- decidedByMemberId: v,
244
+ decidedByMemberId: _,
242
245
  taskId: e.taskId
243
246
  }), !await Y(1, !1)) return;
244
- V(null), H(""), L(`已同意「${e.title}」。`);
247
+ B(null), V(""), I(`已同意「${e.title}」。`);
245
248
  } catch (e) {
246
- F(j(e));
249
+ P(A(e));
247
250
  } finally {
248
251
  q(!1);
249
252
  }
250
253
  }
251
254
  }, [
252
- B,
253
- v,
255
+ z,
256
+ _,
254
257
  K,
255
258
  Y,
256
259
  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);
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 h({
269
+ await ie({
267
270
  action: "REJECTED",
268
271
  comment: J,
269
- decidedByMemberId: v,
272
+ decidedByMemberId: _,
270
273
  taskId: e.taskId
271
- }), W(null), G(""), L(`已拒絕「${e.title}」。`), await Y(1, !1);
274
+ }), U(null), G(""), I(`已拒絕「${e.title}」。`), await Y(1, !1);
272
275
  } catch (e) {
273
- F(j(e));
276
+ P(A(e));
274
277
  } finally {
275
278
  q(!1);
276
279
  }
277
280
  }
278
281
  }, [
279
- v,
282
+ _,
280
283
  K,
281
284
  Y,
282
- U,
285
+ H,
283
286
  J
284
- ]), Pe = l((e, t) => {
287
+ ]), Ne = l((e, t) => {
285
288
  let n = t.id;
286
- n === "approve" ? Oe(e) : n === "reject" ? je(e) : n === "view" ? X(e) : n === "read" ? Te(e.id) : (n === "archive" || n === "unarchive") && Ee(e);
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
- 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), {
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 Le.forEach((n) => {
305
- t[ge(n.createdAt, e)].push(n);
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,
311
- bottomGhostActionLoading: M,
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: !$ || k,
320
- bottomPrimaryActionLoading: k && $,
322
+ bottomPrimaryActionDisabled: !$ || O,
323
+ bottomPrimaryActionLoading: O && $,
321
324
  bottomPrimaryActionText: $ ? "載入更多" : "已顯示全部",
322
- contentKey: `${R}:${z}:${y.length}`,
325
+ contentKey: `${L}:${R}:${v.length}`,
323
326
  filterAreaAllRadioLabel: "全部",
324
327
  filterAreaOnRadioChange: Se,
325
328
  filterAreaOnSelect: De,
326
329
  filterAreaOptions: [{
327
- id: de,
328
- name: z ? "隱藏已封存" : "顯示已封存"
330
+ id: fe,
331
+ name: R ? "隱藏已封存" : "顯示已封存"
329
332
  }],
330
333
  filterAreaReadRadioLabel: "已讀",
331
334
  filterAreaShow: !0,
332
335
  filterAreaUnreadRadioLabel: "未讀",
333
- filterAreaValue: R,
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
- P ? /* @__PURE__ */ p("p", {
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: P
352
+ children: N
350
353
  }) : null,
351
- I ? /* @__PURE__ */ p("p", {
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: I
360
+ children: F
358
361
  }) : null,
359
- Q.length === 0 ? /* @__PURE__ */ p("p", {
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: k ? "載入中…" : "目前沒有通知"
368
+ children: O ? "載入中…" : "目前沒有通知"
366
369
  }) : null,
367
- Q.map(([e, t]) => /* @__PURE__ */ p(s, { children: t.map((t, n) => {
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
- Fe(t, e);
374
+ Pe(t, e);
372
375
  } : void 0,
373
376
  onKeyDown: r ? (e) => {
374
- Ie(t, e);
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(ce, {
382
+ children: /* @__PURE__ */ p(le, {
380
383
  appendTips: t.archivedAt ? "已封存" : void 0,
381
384
  description: t.body,
382
385
  onBadgeSelect: (e) => {
383
- Pe(t, e);
386
+ Ne(t, e);
384
387
  },
385
- options: [...fe(t)],
386
- prependTips: n === 0 ? le[e] : void 0,
388
+ options: [...pe(t)],
389
+ prependTips: n === 0 ? ue[e] : void 0,
387
390
  reference: t.id,
388
- severity: he(t),
391
+ severity: ge(t),
389
392
  showBadge: t.status !== "READ",
390
393
  timeStamp: t.createdAt,
391
- title: me(t),
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(b, {
402
+ /* @__PURE__ */ m(y, {
400
403
  cancelText: "取消",
401
404
  confirmText: "送出同意",
402
405
  loading: K,
403
406
  modalType: "standard",
404
- onCancel: ke,
405
- onClose: ke,
407
+ onCancel: Oe,
408
+ onClose: Oe,
406
409
  onConfirm: () => {
407
- Ae();
410
+ ke();
408
411
  },
409
- open: B !== null,
412
+ open: z !== null,
410
413
  showModalFooter: !0,
411
414
  showModalHeader: !0,
412
415
  size: "regular",
413
416
  supportingText: "可以留下同意說明,內容會記錄在簽核歷程;不填也可以直接送出。",
414
417
  title: "簽核意見",
415
- children: [P ? /* @__PURE__ */ p(te, {
418
+ children: [N ? /* @__PURE__ */ p(te, {
416
419
  color: "text-error",
417
420
  role: "alert",
418
421
  variant: "body",
419
- children: P
422
+ children: N
420
423
  }) : null, /* @__PURE__ */ p(o, {
421
424
  label: "簽核意見",
422
425
  name: "notificationApproveComment",
423
- children: /* @__PURE__ */ p(x, {
426
+ children: /* @__PURE__ */ p(b, {
424
427
  autoFocus: !0,
425
428
  onChange: (e) => {
426
- H(e.target.value);
429
+ V(e.target.value);
427
430
  },
428
431
  placeholder: "選填,例如補充核准條件或提醒事項",
429
432
  rows: 4,
430
- value: ye
433
+ value: be
431
434
  })
432
435
  })]
433
436
  }),
434
- /* @__PURE__ */ p(b, {
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: Me,
445
- onClose: Me,
447
+ onCancel: je,
448
+ onClose: je,
446
449
  onConfirm: () => {
447
- Ne();
450
+ Me();
448
451
  },
449
- open: U !== null,
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(x, {
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: be
465
+ value: W
463
466
  })
464
467
  })
465
468
  ] }) : null;
466
469
  }
467
- function A(e) {
470
+ function k(e) {
468
471
  return e === "SLA_OVERDUE" ? "error" : e === "SLA_WARNING" ? "warning" : e === "INSTANCE_COMPLETED" ? "success" : "info";
469
472
  }
470
- function ge(e, t) {
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 j(e) {
481
+ function A(e) {
479
482
  return e instanceof Error ? e.message : "發生未知錯誤";
480
483
  }
481
- function M(e) {
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 = y.ZH_TW, language: a = r, publicPaths: o, loginPath: s }) {
495
- return /* @__PURE__ */ p(v, {
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(E, { children: /* @__PURE__ */ m(C, { children: [e, /* @__PURE__ */ p(k, {})] }) })
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 { C as a, D as i, k as n, w as o, E as r, P as t };
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-H_vPRsSN.js.map
521
+ //# sourceMappingURL=providers-B_d5tbCL.js.map