@rytass/bpm-core-react 0.8.0 → 0.9.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.
Files changed (154) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +18 -2
  3. package/dist/chunks/FormBuilderView-BPLwAJGv.cjs +3 -0
  4. package/dist/chunks/FormBuilderView-BPLwAJGv.cjs.map +1 -0
  5. package/dist/chunks/FormBuilderView-Do9-MIAe.js +1477 -0
  6. package/dist/chunks/FormBuilderView-Do9-MIAe.js.map +1 -0
  7. package/dist/chunks/FormRendererView-C5POZbWz.js +492 -0
  8. package/dist/chunks/FormRendererView-C5POZbWz.js.map +1 -0
  9. package/dist/chunks/FormRendererView-DNtNodNl.cjs +2 -0
  10. package/dist/chunks/FormRendererView-DNtNodNl.cjs.map +1 -0
  11. package/dist/chunks/{approval-instance-list-page-YZcGGDD8.js → approval-instance-list-page-BjX2kaoF.js} +56 -54
  12. package/dist/chunks/approval-instance-list-page-BjX2kaoF.js.map +1 -0
  13. package/dist/chunks/approval-instance-list-page-C408vxE2.cjs +2 -0
  14. package/dist/chunks/approval-instance-list-page-C408vxE2.cjs.map +1 -0
  15. package/dist/chunks/{categories-DBPoSrsi.js → categories-DGlxuC6X.js} +5 -5
  16. package/dist/chunks/{categories-DBPoSrsi.js.map → categories-DGlxuC6X.js.map} +1 -1
  17. package/dist/chunks/{categories-B6QZKZRt.cjs → categories-DUfldZ_9.cjs} +2 -2
  18. package/dist/chunks/{categories-B6QZKZRt.cjs.map → categories-DUfldZ_9.cjs.map} +1 -1
  19. package/dist/chunks/compose-CULMDsLS.cjs +2 -0
  20. package/dist/chunks/compose-CULMDsLS.cjs.map +1 -0
  21. package/dist/chunks/{compose-CQHDT7vh.js → compose-DJBlA5PD.js} +60 -58
  22. package/dist/chunks/compose-DJBlA5PD.js.map +1 -0
  23. package/dist/chunks/{delegations-DDEk-WI6.cjs → delegations-CGj-tZNO.cjs} +2 -2
  24. package/dist/chunks/{delegations-DDEk-WI6.cjs.map → delegations-CGj-tZNO.cjs.map} +1 -1
  25. package/dist/chunks/{delegations-iVnRi3QE.js → delegations-DLEEFBlH.js} +231 -231
  26. package/dist/chunks/{delegations-iVnRi3QE.js.map → delegations-DLEEFBlH.js.map} +1 -1
  27. package/dist/chunks/{delegations-ZNtodFaD.js → delegations-DqMpI_Nk.js} +168 -167
  28. package/dist/chunks/delegations-DqMpI_Nk.js.map +1 -0
  29. package/dist/chunks/delegations-kbMOSEif.cjs +2 -0
  30. package/dist/chunks/delegations-kbMOSEif.cjs.map +1 -0
  31. package/dist/chunks/{designer-CUbVXEtS.js → designer-BszXJ5RO.js} +1227 -990
  32. package/dist/chunks/designer-BszXJ5RO.js.map +1 -0
  33. package/dist/chunks/designer-CmqAU92b.cjs +65 -0
  34. package/dist/chunks/designer-CmqAU92b.cjs.map +1 -0
  35. package/dist/chunks/detail-CDexqBoU.cjs +2 -0
  36. package/dist/chunks/detail-CDexqBoU.cjs.map +1 -0
  37. package/dist/chunks/{detail-Cts5_gVp.js → detail-DAak2OXS.js} +704 -622
  38. package/dist/chunks/detail-DAak2OXS.js.map +1 -0
  39. package/dist/chunks/notifications--hwl-DR0.cjs +2 -0
  40. package/dist/chunks/{notifications-BKs4--96.cjs.map → notifications--hwl-DR0.cjs.map} +1 -1
  41. package/dist/chunks/{notifications-CSulztkU.js → notifications-DJ5wzCye.js} +7 -7
  42. package/dist/chunks/{notifications-CSulztkU.js.map → notifications-DJ5wzCye.js.map} +1 -1
  43. package/dist/chunks/{orgs-CrNxqlwp.js → orgs-DytLvZ_X.js} +243 -241
  44. package/dist/chunks/{orgs-CrNxqlwp.js.map → orgs-DytLvZ_X.js.map} +1 -1
  45. package/dist/chunks/orgs-Ni22buHs.cjs +2 -0
  46. package/dist/chunks/orgs-Ni22buHs.cjs.map +1 -0
  47. package/dist/chunks/providers-DEqcuXw9.js +506 -0
  48. package/dist/chunks/providers-DEqcuXw9.js.map +1 -0
  49. package/dist/chunks/providers-D_zTbkQH.cjs +2 -0
  50. package/dist/chunks/providers-D_zTbkQH.cjs.map +1 -0
  51. package/dist/chunks/{users-qghSMtLn.cjs → users-0HqlM_VQ.cjs} +2 -2
  52. package/dist/chunks/{users-qghSMtLn.cjs.map → users-0HqlM_VQ.cjs.map} +1 -1
  53. package/dist/chunks/{users-CUY139DF.js → users-FWrb3ehW.js} +5 -5
  54. package/dist/chunks/{users-CUY139DF.js.map → users-FWrb3ehW.js.map} +1 -1
  55. package/dist/components/notification-drawer.d.ts +4 -3
  56. package/dist/index.cjs +1 -1
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.js +21 -428
  59. package/dist/index.js.map +1 -1
  60. package/dist/next/index.cjs +1 -1
  61. package/dist/next/index.cjs.map +1 -1
  62. package/dist/next/index.js +16 -15
  63. package/dist/next/index.js.map +1 -1
  64. package/dist/pages/admin/delegations/index.cjs +1 -1
  65. package/dist/pages/admin/delegations/index.js +1 -1
  66. package/dist/pages/admin/orgs/index.cjs +1 -1
  67. package/dist/pages/admin/orgs/index.js +1 -1
  68. package/dist/pages/admin/users/index.cjs +1 -1
  69. package/dist/pages/admin/users/index.js +1 -1
  70. package/dist/pages/delegations/index.cjs +1 -1
  71. package/dist/pages/delegations/index.js +1 -1
  72. package/dist/pages/instances/detail/index.cjs +1 -1
  73. package/dist/pages/instances/detail/index.js +1 -1
  74. package/dist/pages/settings/notifications/index.cjs +1 -1
  75. package/dist/pages/settings/notifications/index.js +1 -1
  76. package/dist/pages/templates/categories/index.cjs +1 -1
  77. package/dist/pages/templates/categories/index.js +1 -1
  78. package/dist/pages/templates/compose/index.cjs +1 -1
  79. package/dist/pages/templates/compose/index.js +1 -1
  80. package/dist/pages/templates/designer/index.cjs +1 -1
  81. package/dist/pages/templates/designer/index.js +1 -1
  82. package/dist/views/admin/delegations/index.cjs +1 -1
  83. package/dist/views/admin/delegations/index.js +1 -1
  84. package/dist/views/admin/index.cjs +1 -1
  85. package/dist/views/admin/index.js +3 -3
  86. package/dist/views/admin/orgs/index.cjs +1 -1
  87. package/dist/views/admin/orgs/index.js +1 -1
  88. package/dist/views/admin/users/index.cjs +1 -1
  89. package/dist/views/admin/users/index.js +1 -1
  90. package/dist/views/cc/index.cjs +1 -1
  91. package/dist/views/cc/index.js +1 -1
  92. package/dist/views/delegations/index.cjs +1 -1
  93. package/dist/views/delegations/index.js +1 -1
  94. package/dist/views/forms/builder/index.cjs +1 -1
  95. package/dist/views/forms/builder/index.js +1 -1
  96. package/dist/views/forms/renderer/FormRendererView.d.ts +7 -2
  97. package/dist/views/forms/renderer/form-data-source-field.d.ts +34 -0
  98. package/dist/views/forms/renderer/index.cjs +1 -1
  99. package/dist/views/forms/renderer/index.d.ts +1 -0
  100. package/dist/views/forms/renderer/index.js +2 -2
  101. package/dist/views/instances/detail/index.cjs +1 -1
  102. package/dist/views/instances/detail/index.js +1 -1
  103. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +4 -1
  104. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +5 -1
  105. package/dist/views/instances/new/index.cjs +1 -1
  106. package/dist/views/instances/new/index.cjs.map +1 -1
  107. package/dist/views/instances/new/index.js +105 -86
  108. package/dist/views/instances/new/index.js.map +1 -1
  109. package/dist/views/search/index.cjs +1 -1
  110. package/dist/views/search/index.js +1 -1
  111. package/dist/views/sent/index.cjs +1 -1
  112. package/dist/views/sent/index.js +1 -1
  113. package/dist/views/settings/index.cjs +1 -1
  114. package/dist/views/settings/index.js +1 -1
  115. package/dist/views/settings/notifications/index.cjs +1 -1
  116. package/dist/views/settings/notifications/index.js +1 -1
  117. package/dist/views/templates/categories/index.cjs +1 -1
  118. package/dist/views/templates/categories/index.js +1 -1
  119. package/dist/views/templates/compose/TemplateComposeWizardView.d.ts +3 -2
  120. package/dist/views/templates/compose/index.cjs +1 -1
  121. package/dist/views/templates/compose/index.js +1 -1
  122. package/dist/views/templates/designer/index.cjs +1 -1
  123. package/dist/views/templates/designer/index.js +1 -1
  124. package/dist/views/templates/index.cjs +1 -1
  125. package/dist/views/templates/index.cjs.map +1 -1
  126. package/dist/views/templates/index.js +153 -112
  127. package/dist/views/templates/index.js.map +1 -1
  128. package/package.json +56 -11
  129. package/dist/chunks/FormBuilderView-B_KGPjlp.cjs +0 -3
  130. package/dist/chunks/FormBuilderView-B_KGPjlp.cjs.map +0 -1
  131. package/dist/chunks/FormBuilderView-D8DrQOXD.js +0 -1090
  132. package/dist/chunks/FormBuilderView-D8DrQOXD.js.map +0 -1
  133. package/dist/chunks/FormRendererView-BwVsH2eX.cjs +0 -2
  134. package/dist/chunks/FormRendererView-BwVsH2eX.cjs.map +0 -1
  135. package/dist/chunks/FormRendererView-DrHsuSVo.js +0 -220
  136. package/dist/chunks/FormRendererView-DrHsuSVo.js.map +0 -1
  137. package/dist/chunks/approval-instance-list-page-BMUKxzcz.cjs +0 -2
  138. package/dist/chunks/approval-instance-list-page-BMUKxzcz.cjs.map +0 -1
  139. package/dist/chunks/approval-instance-list-page-YZcGGDD8.js.map +0 -1
  140. package/dist/chunks/compose-CQHDT7vh.js.map +0 -1
  141. package/dist/chunks/compose-Ds_cAefe.cjs +0 -2
  142. package/dist/chunks/compose-Ds_cAefe.cjs.map +0 -1
  143. package/dist/chunks/delegations-C2wLWsDQ.cjs +0 -2
  144. package/dist/chunks/delegations-C2wLWsDQ.cjs.map +0 -1
  145. package/dist/chunks/delegations-ZNtodFaD.js.map +0 -1
  146. package/dist/chunks/designer-CQ9hxSdD.cjs +0 -65
  147. package/dist/chunks/designer-CQ9hxSdD.cjs.map +0 -1
  148. package/dist/chunks/designer-CUbVXEtS.js.map +0 -1
  149. package/dist/chunks/detail-B-Q4W-iw.cjs +0 -2
  150. package/dist/chunks/detail-B-Q4W-iw.cjs.map +0 -1
  151. package/dist/chunks/detail-Cts5_gVp.js.map +0 -1
  152. package/dist/chunks/notifications-BKs4--96.cjs +0 -2
  153. package/dist/chunks/orgs-iNJ0QEcK.cjs +0 -2
  154. package/dist/chunks/orgs-iNJ0QEcK.cjs.map +0 -1
@@ -2,19 +2,19 @@
2
2
  import { n as e } from "./auth-provider-B5oPmvk2.js";
3
3
  import { t } from "./format-date-time-CB-LxzqT.js";
4
4
  import { t as n } from "./bpm-form-field-Cao0rMol.js";
5
- import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
6
- import { AutoComplete as s, Badge as c, Button as ee, DateTimePicker as te, Filter as ne, FilterArea as re, FilterLine as ie, FormField as ae, Modal as oe, PageHeader as se, Section as ce, SectionGroup as le, Select as l, Tab as ue, TabItem as de, Table as fe, Tooltip as u, Typography as d } from "@mezzanine-ui/react";
7
- import { Fragment as pe, jsx as f, jsxs as p } from "react/jsx-runtime";
8
- import { createDelegationRule as me, listDelegationRulesPage as he, revokeDelegationRule as ge, searchMembers as m } from "@rytass/bpm-core-client/workflow";
5
+ import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
6
+ import { AutoComplete as c, Badge as l, Button as ee, DateTimePicker as te, Filter as ne, FilterArea as re, FilterLine as ie, FormField as ae, Modal as oe, PageHeader as se, Section as ce, SectionGroup as le, Select as u, Tab as ue, TabItem as de, Table as fe, Tooltip as d, Typography as f } from "@mezzanine-ui/react";
7
+ import { Fragment as pe, jsx as p, jsxs as m } from "react/jsx-runtime";
8
+ import { createDelegationRule as me, listDelegationRulesPage as he, revokeDelegationRule as ge, searchMembers as h } from "@rytass/bpm-core-client/workflow";
9
+ import { FormFieldLayout as g } from "@mezzanine-ui/core/form";
9
10
  import _e from "@mezzanine-ui/react/ContentHeader";
10
- import { FormFieldLayout as h } from "@mezzanine-ui/core/form";
11
11
  import { PlusIcon as ve } from "@mezzanine-ui/icons";
12
12
  import { listApprovalTemplates as ye } from "@rytass/bpm-core-client/template";
13
- import '../delegations2.css';var g = {
13
+ import '../delegations2.css';var _ = {
14
14
  delegationFilterArea: "bpm_delegationFilterArea_hAA4C",
15
15
  delegationModalFields: "bpm_delegationModalFields_1aOVW",
16
16
  memberNameWithTooltip: "bpm_memberNameWithTooltip_6Mojc"
17
- }, _ = h.HORIZONTAL, be = [
17
+ }, v = g.HORIZONTAL, be = [
18
18
  10,
19
19
  20,
20
20
  50
@@ -35,7 +35,7 @@ import '../delegations2.css';var g = {
35
35
  key: "EXPIRED",
36
36
  label: "已過期"
37
37
  }
38
- ], v = [
38
+ ], y = [
39
39
  {
40
40
  id: "ALL_SCOPES",
41
41
  name: "全部範圍",
@@ -51,55 +51,56 @@ import '../delegations2.css';var g = {
51
51
  name: "指定模板",
52
52
  scopeType: "TEMPLATE_LIST"
53
53
  }
54
- ], y = [{
54
+ ], b = [{
55
55
  id: "ALL",
56
56
  name: "全部簽核"
57
57
  }, {
58
58
  id: "TEMPLATE_LIST",
59
59
  name: "指定模板"
60
60
  }];
61
- function b() {
62
- let { member: c } = e(), u = c?.memberId ?? null, [_, b] = o(null), [S, C] = o(""), [T, O] = o(null), [k, A] = o(!0), [M, N] = o(!1), [P, F] = o([]), [Ne, I] = o(!1), [L, R] = o(1), [z, Pe] = o(10), [B, Fe] = o("ALL"), [Ie, Le] = o(0), [V, Re] = o([]), [H, U] = o(!1), [W, ze] = o(v[0]), [G, K] = o([]), [Be, Ve] = o(y[0]), [q, He] = o(""), [Ue, We] = o(!1), [Ge, J] = o([]), Y = r(async () => {
63
- if (!u) {
64
- A(!1);
61
+ function x() {
62
+ let { member: l } = e(), d = l?.memberId ?? null, [v, x] = s(null), [C, w] = s(""), [E, k] = s(null), [A, j] = s(!0), [N, P] = s(!1), [F, I] = s([]), [Ne, L] = s(!1), [R, z] = s(1), [B, Pe] = s(10), [V, Fe] = s("ALL"), [Ie, Le] = s(0), [H, Re] = s([]), [U, ze] = s(!1), [W, Be] = s(y[0]), [G, Ve] = s([]), [He, Ue] = s(b[0]), [K, We] = s(""), [Ge, Ke] = s(!1), [qe, q] = s([]), J = o(0), Y = r(async () => {
63
+ let e = J.current + 1;
64
+ if (J.current = e, !d) {
65
+ j(!1);
65
66
  return;
66
67
  }
67
- A(!0), O(null);
68
+ j(!0), k(null);
68
69
  try {
69
- let [e, t] = await Promise.all([he({
70
+ let [t, n] = await Promise.all([he({
70
71
  includeInactive: !0,
71
- page: L,
72
- pageSize: z,
73
- principalMemberId: u,
72
+ page: R,
73
+ pageSize: B,
74
+ principalMemberId: d,
74
75
  scopeType: W.scopeType,
75
- status: B === "ALL" ? null : B
76
- }), m("")]);
77
- Re(e.rules), Le(e.totalCount), F(t.map(x));
78
- } catch (e) {
79
- O(j(e));
76
+ status: V === "ALL" ? null : V
77
+ }), h("")]);
78
+ e === J.current && (Re(t.rules), Le(t.totalCount), I(n.map(S)));
79
+ } catch (t) {
80
+ e === J.current && k(M(t));
80
81
  } finally {
81
- A(!1);
82
+ e === J.current && j(!1);
82
83
  }
83
84
  }, [
84
- u,
85
- L,
86
- z,
85
+ d,
86
+ R,
87
87
  B,
88
+ V,
88
89
  W
89
90
  ]);
90
91
  i(() => {
91
92
  Y();
92
93
  }, [Y]);
93
- let X = a(() => new Map(P.map((e) => [e.id, e])), [P]), Ke = a(() => V.map((e) => ({
94
+ let X = a(() => new Map(F.map((e) => [e.id, e])), [F]), Je = a(() => H.map((e) => ({
94
95
  ...e,
95
96
  agentEmail: X.get(e.agentMemberId)?.email ?? null,
96
97
  agentName: X.get(e.agentMemberId)?.displayName ?? e.agentMemberId,
97
98
  key: e.id,
98
99
  scopeLabel: Oe(e)
99
- })), [X, V]), Z = y.find((e) => e.id === Be.id) ?? y[0], qe = a(() => [
100
+ })), [X, H]), Z = b.find((e) => e.id === He.id) ?? b[0], Ye = a(() => [
100
101
  {
101
102
  key: "agent",
102
- render: (e) => /* @__PURE__ */ f(Ce, {
103
+ render: (e) => /* @__PURE__ */ p(Ce, {
103
104
  email: e.agentEmail,
104
105
  name: e.agentName
105
106
  }),
@@ -114,13 +115,13 @@ function b() {
114
115
  },
115
116
  {
116
117
  key: "status",
117
- render: (e) => /* @__PURE__ */ f(Ae, { status: e.status }),
118
+ render: (e) => /* @__PURE__ */ p(Ae, { status: e.status }),
118
119
  title: "狀態",
119
120
  width: 120
120
121
  },
121
122
  {
122
123
  key: "startAt",
123
- render: (e) => /* @__PURE__ */ f(d, {
124
+ render: (e) => /* @__PURE__ */ p(f, {
124
125
  component: "span",
125
126
  variant: "body",
126
127
  children: t(e.startAt)
@@ -130,7 +131,7 @@ function b() {
130
131
  },
131
132
  {
132
133
  key: "endAt",
133
- render: (e) => /* @__PURE__ */ f(d, {
134
+ render: (e) => /* @__PURE__ */ p(f, {
134
135
  component: "span",
135
136
  variant: "body",
136
137
  children: e.endAt ? t(e.endAt) : "-"
@@ -138,120 +139,120 @@ function b() {
138
139
  title: "結束時間",
139
140
  width: 220
140
141
  }
141
- ], []), Je = r(async (e) => {
142
- if (u) {
143
- O(null);
142
+ ], []), Xe = r(async (e) => {
143
+ if (d) {
144
+ k(null);
144
145
  try {
145
146
  await ge({
146
147
  id: e,
147
- revokedByMemberId: u
148
+ revokedByMemberId: d
148
149
  }), await Y();
149
150
  } catch (e) {
150
- O(j(e));
151
+ k(M(e));
151
152
  }
152
153
  }
153
- }, [u, Y]), Ye = a(() => ({
154
+ }, [d, Y]), Ze = a(() => ({
154
155
  render: (e) => e.status === "ACTIVE" ? [{
155
156
  name: "撤銷",
156
- onClick: () => void Je(e.id)
157
+ onClick: () => void Xe(e.id)
157
158
  }] : [],
158
159
  variant: "destructive-secondary",
159
160
  width: 88
160
- }), [Je]);
161
- async function Xe(e) {
162
- N(!0);
161
+ }), [Xe]);
162
+ async function Qe(e) {
163
+ P(!0);
163
164
  try {
164
- F((await m(e)).map(x));
165
+ I((await h(e)).map(S));
165
166
  } catch (e) {
166
- O(j(e));
167
+ k(M(e));
167
168
  } finally {
168
- N(!1);
169
+ P(!1);
169
170
  }
170
171
  }
171
172
  async function Q(e, t = G) {
172
- We(!0);
173
+ Ke(!0);
173
174
  try {
174
- J(w(t, Ee((await ye()).map(we), e)));
175
+ q(T(t, Ee((await ye()).map(we), e)));
175
176
  } catch (e) {
176
- O(j(e));
177
+ k(M(e));
177
178
  } finally {
178
- We(!1);
179
+ Ke(!1);
179
180
  }
180
181
  }
181
- function Ze() {
182
- b(null), C(""), K([]), Ve(y[0]), He(""), J([]), Q("", []), I(!0);
182
+ function $e() {
183
+ x(null), w(""), Ve([]), Ue(b[0]), We(""), q([]), Q("", []), L(!0);
183
184
  }
184
185
  function $() {
185
- H || I(!1);
186
+ U || L(!1);
186
187
  }
187
- async function Qe() {
188
- if (u) {
189
- if (!_) {
190
- O("請選擇代理人");
188
+ async function et() {
189
+ if (d) {
190
+ if (!v) {
191
+ k("請選擇代理人");
191
192
  return;
192
193
  }
193
- if (_.id === u) {
194
- O("代理人不可設定為自己");
194
+ if (v.id === d) {
195
+ k("代理人不可設定為自己");
195
196
  return;
196
197
  }
197
198
  if (Z.id === "TEMPLATE_LIST" && G.length < 1) {
198
- O("請選擇至少一個簽核模板");
199
+ k("請選擇至少一個簽核模板");
199
200
  return;
200
201
  }
201
- if (Me(q, S)) {
202
- O("結束時間必須晚於起始時間");
202
+ if (Me(K, C)) {
203
+ k("結束時間必須晚於起始時間");
203
204
  return;
204
205
  }
205
- U(!0), O(null);
206
+ ze(!0), k(null);
206
207
  try {
207
208
  await me({
208
- agentMemberId: _.id,
209
- createdByMemberId: u,
210
- endAt: S || null,
211
- principalMemberId: u,
209
+ agentMemberId: v.id,
210
+ createdByMemberId: d,
211
+ endAt: C || null,
212
+ principalMemberId: d,
212
213
  priority: 100,
213
214
  requiresConfirmation: !1,
214
215
  scopeConditionCel: null,
215
216
  scopeTemplateIds: Z.id === "TEMPLATE_LIST" ? G.map((e) => e.id) : [],
216
217
  scopeType: Z.id,
217
- startAt: q || null
218
- }), I(!1), L === 1 ? await Y() : R(1);
218
+ startAt: K || null
219
+ }), L(!1), R === 1 ? await Y() : z(1);
219
220
  } catch (e) {
220
- O(j(e));
221
+ k(M(e));
221
222
  } finally {
222
- U(!1);
223
+ ze(!1);
223
224
  }
224
225
  }
225
226
  }
226
- return /* @__PURE__ */ p(pe, { children: [
227
- /* @__PURE__ */ f(se, { children: /* @__PURE__ */ f(_e, {
227
+ return /* @__PURE__ */ m(pe, { children: [
228
+ /* @__PURE__ */ p(se, { children: /* @__PURE__ */ p(_e, {
228
229
  description: "設定自己的簽核代理,讓指定期間內的新待簽任務自動交由代理人處理。",
229
230
  title: "我的代理",
230
- children: /* @__PURE__ */ f(ee, {
231
+ children: /* @__PURE__ */ p(ee, {
231
232
  icon: ve,
232
233
  iconType: "leading",
233
- onClick: Ze,
234
+ onClick: $e,
234
235
  variant: "base-primary",
235
236
  children: "建立代理"
236
237
  })
237
238
  }) }),
238
- /* @__PURE__ */ f(le, { children: /* @__PURE__ */ p(ce, {
239
- filterArea: /* @__PURE__ */ f(re, {
240
- className: g.delegationFilterArea,
239
+ /* @__PURE__ */ p(le, { children: /* @__PURE__ */ m(ce, {
240
+ filterArea: /* @__PURE__ */ p(re, {
241
+ className: _.delegationFilterArea,
241
242
  size: "sub",
242
- children: /* @__PURE__ */ f(ie, { children: /* @__PURE__ */ f(ne, {
243
+ children: /* @__PURE__ */ p(ie, { children: /* @__PURE__ */ p(ne, {
243
244
  span: 2,
244
- children: /* @__PURE__ */ f(ae, {
245
+ children: /* @__PURE__ */ p(ae, {
245
246
  fullWidth: !0,
246
- layout: h.VERTICAL,
247
+ layout: g.VERTICAL,
247
248
  name: "scopeFilterType",
248
- children: /* @__PURE__ */ f(l, {
249
+ children: /* @__PURE__ */ p(u, {
249
250
  clearable: !1,
250
251
  fullWidth: !0,
251
252
  onChange: (e) => {
252
- ze(De(e)), R(1);
253
+ Be(De(e)), z(1);
253
254
  },
254
- options: [...v],
255
+ options: [...y],
255
256
  placeholder: "代理範圍",
256
257
  size: "sub",
257
258
  value: W
@@ -259,32 +260,32 @@ function b() {
259
260
  })
260
261
  }) })
261
262
  }),
262
- tab: /* @__PURE__ */ f(ue, {
263
- activeKey: B,
263
+ tab: /* @__PURE__ */ p(ue, {
264
+ activeKey: V,
264
265
  onChange: (e) => {
265
- Fe(je(e)), R(1);
266
+ Fe(je(e)), z(1);
266
267
  },
267
- children: xe.map((e) => /* @__PURE__ */ f(de, { children: e.label }, e.key))
268
+ children: xe.map((e) => /* @__PURE__ */ p(de, { children: e.label }, e.key))
268
269
  }),
269
- children: [T ? /* @__PURE__ */ f(d, {
270
+ children: [E ? /* @__PURE__ */ p(f, {
270
271
  color: "text-error",
271
272
  variant: "body",
272
- children: T
273
- }) : null, /* @__PURE__ */ f(fe, {
274
- actions: Ye,
275
- columns: qe,
276
- dataSource: Ke,
273
+ children: E
274
+ }) : null, /* @__PURE__ */ p(fe, {
275
+ actions: Ze,
276
+ columns: Ye,
277
+ dataSource: Je,
277
278
  fullWidth: !0,
278
- loading: k,
279
+ loading: A,
279
280
  pagination: {
280
- current: L,
281
+ current: R,
281
282
  onChange: (e) => {
282
- R(e);
283
+ z(e);
283
284
  },
284
285
  onChangePageSize: (e) => {
285
- R(1), Pe(e);
286
+ z(1), Pe(e);
286
287
  },
287
- pageSize: z,
288
+ pageSize: B,
288
289
  pageSizeLabel: "每頁筆數",
289
290
  pageSizeOptions: be,
290
291
  renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
@@ -293,51 +294,51 @@ function b() {
293
294
  }
294
295
  })]
295
296
  }) }),
296
- /* @__PURE__ */ f(oe, {
297
+ /* @__PURE__ */ p(oe, {
297
298
  cancelText: "取消",
298
- confirmButtonProps: { disabled: !_ },
299
+ confirmButtonProps: { disabled: !v },
299
300
  confirmText: "建立代理",
300
- loading: H,
301
+ loading: U,
301
302
  modalType: "standard",
302
303
  onCancel: $,
303
304
  onClose: $,
304
- onConfirm: () => void Qe(),
305
+ onConfirm: () => void et(),
305
306
  open: Ne,
306
307
  showModalFooter: !0,
307
308
  showModalHeader: !0,
308
309
  size: "regular",
309
310
  supportingText: "代理生效後,後續建立的待簽任務會依範圍自動指派給代理人。",
310
311
  title: "建立個人代理",
311
- children: /* @__PURE__ */ p("div", {
312
- className: g.delegationModalFields,
312
+ children: /* @__PURE__ */ m("div", {
313
+ className: _.delegationModalFields,
313
314
  children: [
314
- /* @__PURE__ */ f(Se, {
315
+ /* @__PURE__ */ p(Se, {
315
316
  label: "代理人",
316
- loading: M,
317
+ loading: N,
317
318
  name: "agentMemberId",
318
- onChange: b,
319
- onSearch: Xe,
320
- options: P,
321
- value: _
319
+ onChange: x,
320
+ onSearch: Qe,
321
+ options: F,
322
+ value: v
322
323
  }),
323
- /* @__PURE__ */ f(n, {
324
+ /* @__PURE__ */ p(n, {
324
325
  label: "代理範圍",
325
326
  name: "scopeType",
326
327
  required: !0,
327
- children: /* @__PURE__ */ f(l, {
328
+ children: /* @__PURE__ */ p(u, {
328
329
  clearable: !1,
329
330
  fullWidth: !0,
330
- onChange: (e) => Ve(ke(e)),
331
- options: [...y],
331
+ onChange: (e) => Ue(ke(e)),
332
+ options: [...b],
332
333
  placeholder: "選擇代理範圍",
333
334
  value: Z
334
335
  })
335
336
  }),
336
- Z.id === "TEMPLATE_LIST" ? /* @__PURE__ */ f(n, {
337
+ Z.id === "TEMPLATE_LIST" ? /* @__PURE__ */ p(n, {
337
338
  label: "簽核模板",
338
339
  name: "scopeTemplateIds",
339
340
  required: !0,
340
- children: /* @__PURE__ */ f(s, {
341
+ children: /* @__PURE__ */ p(c, {
341
342
  asyncData: !0,
342
343
  disabledOptionsFilter: !0,
343
344
  emptyText: "沒有符合的模板",
@@ -347,50 +348,50 @@ function b() {
347
348
  name: "scopeTemplateIds",
348
349
  spellCheck: !1
349
350
  },
350
- loading: Ue,
351
+ loading: Ge,
351
352
  loadingText: "搜尋模板中...",
352
353
  mode: "multiple",
353
354
  onChange: (e) => {
354
355
  let t = Te(e);
355
- K(t), J((e) => w(t, e));
356
+ Ve(t), q((e) => T(t, e));
356
357
  },
357
358
  onSearch: Q,
358
359
  onVisibilityChange: (e) => {
359
360
  e && Q("");
360
361
  },
361
- options: [...Ge],
362
+ options: [...qe],
362
363
  overflowStrategy: "wrap",
363
364
  placeholder: "搜尋並選取簽核模板",
364
365
  searchDebounceTime: 300,
365
366
  value: [...G]
366
367
  })
367
368
  }) : null,
368
- /* @__PURE__ */ f(n, {
369
+ /* @__PURE__ */ p(n, {
369
370
  label: "起始時間",
370
371
  name: "startAt",
371
- children: /* @__PURE__ */ f(te, {
372
+ children: /* @__PURE__ */ p(te, {
372
373
  formatDate: "YYYY-MM-DD",
373
374
  formatTime: "HH:mm",
374
375
  fullWidth: !0,
375
376
  hideSecond: !0,
376
- onChange: (e) => He(D(e)),
377
+ onChange: (e) => We(O(e)),
377
378
  placeholderLeft: "留空立即生效",
378
379
  placeholderRight: "選擇時間",
379
- value: E(q)
380
+ value: D(K)
380
381
  })
381
382
  }),
382
- /* @__PURE__ */ f(n, {
383
+ /* @__PURE__ */ p(n, {
383
384
  label: "結束時間",
384
385
  name: "endAt",
385
- children: /* @__PURE__ */ f(te, {
386
+ children: /* @__PURE__ */ p(te, {
386
387
  formatDate: "YYYY-MM-DD",
387
388
  formatTime: "HH:mm",
388
389
  fullWidth: !0,
389
390
  hideSecond: !0,
390
- onChange: (e) => C(D(e)),
391
+ onChange: (e) => w(O(e)),
391
392
  placeholderLeft: "可留空",
392
393
  placeholderRight: "選擇時間",
393
- value: E(S)
394
+ value: D(C)
394
395
  })
395
396
  })
396
397
  ]
@@ -398,13 +399,13 @@ function b() {
398
399
  })
399
400
  ] });
400
401
  }
401
- function Se({ label: e, loading: t, name: r, onChange: i, onSearch: a, options: o, value: c }) {
402
- return /* @__PURE__ */ f(n, {
402
+ function Se({ label: e, loading: t, name: r, onChange: i, onSearch: a, options: o, value: s }) {
403
+ return /* @__PURE__ */ p(n, {
403
404
  label: e,
404
- layout: _,
405
+ layout: v,
405
406
  name: r,
406
407
  required: !0,
407
- children: /* @__PURE__ */ f(s, {
408
+ children: /* @__PURE__ */ p(c, {
408
409
  asyncData: !0,
409
410
  disabledOptionsFilter: !0,
410
411
  emptyText: "沒有符合的成員",
@@ -417,32 +418,32 @@ function Se({ label: e, loading: t, name: r, onChange: i, onSearch: a, options:
417
418
  loading: t,
418
419
  loadingText: "搜尋成員中...",
419
420
  mode: "single",
420
- onChange: (e) => i(S(e)),
421
+ onChange: (e) => i(C(e)),
421
422
  onSearch: a,
422
- onSearchTextChange: (e) => i(C(e, o)),
423
+ onSearchTextChange: (e) => i(w(e, o)),
423
424
  onVisibilityChange: (e) => {
424
425
  e && a("");
425
426
  },
426
427
  options: [...o],
427
428
  placeholder: "搜尋姓名或信箱",
428
429
  searchDebounceTime: 300,
429
- value: c
430
+ value: s
430
431
  })
431
432
  });
432
433
  }
433
434
  function Ce({ email: e, name: t }) {
434
- return e ? /* @__PURE__ */ f(u, {
435
+ return e ? /* @__PURE__ */ p(d, {
435
436
  title: e,
436
- children: ({ onMouseEnter: e, onMouseLeave: n, ref: r }) => /* @__PURE__ */ f("span", {
437
- className: g.memberNameWithTooltip,
437
+ children: ({ onMouseEnter: e, onMouseLeave: n, ref: r }) => /* @__PURE__ */ p("span", {
438
+ className: _.memberNameWithTooltip,
438
439
  onMouseEnter: e,
439
440
  onMouseLeave: n,
440
441
  ref: r,
441
442
  children: t
442
443
  })
443
- }) : /* @__PURE__ */ f("span", { children: t });
444
+ }) : /* @__PURE__ */ p("span", { children: t });
444
445
  }
445
- function x(e) {
446
+ function S(e) {
446
447
  return {
447
448
  displayName: e.name,
448
449
  email: e.email,
@@ -450,8 +451,8 @@ function x(e) {
450
451
  name: `${e.name} (${e.email})`
451
452
  };
452
453
  }
453
- function S(e) {
454
- if (!M(e)) return null;
454
+ function C(e) {
455
+ if (!N(e)) return null;
455
456
  let t = e.displayName, n = e.email, r = e.id, i = e.name;
456
457
  return typeof r == "string" && typeof i == "string" ? {
457
458
  displayName: typeof t == "string" ? t : i,
@@ -460,7 +461,7 @@ function S(e) {
460
461
  name: i
461
462
  } : null;
462
463
  }
463
- function C(e, t) {
464
+ function w(e, t) {
464
465
  let n = e.trim().toLocaleLowerCase();
465
466
  if (!n) return null;
466
467
  let r = t.filter((e) => [
@@ -478,7 +479,7 @@ function we(e) {
478
479
  }
479
480
  function Te(e) {
480
481
  return e.flatMap((e) => {
481
- if (!M(e)) return [];
482
+ if (!N(e)) return [];
482
483
  let t = e.id, n = e.name;
483
484
  return typeof t == "string" && typeof n == "string" ? [{
484
485
  id: t,
@@ -490,37 +491,37 @@ function Ee(e, t) {
490
491
  let n = t.trim().toLocaleLowerCase();
491
492
  return n ? e.filter((e) => [e.id, e.name].some((e) => e.toLocaleLowerCase().includes(n))) : e;
492
493
  }
493
- function w(e, t) {
494
+ function T(e, t) {
494
495
  return [...e, ...t].reduce((e, t) => e.some((e) => e.id === t.id) ? e : [...e, t], []);
495
496
  }
496
497
  function De(e) {
497
- if (!M(e)) return v[0];
498
+ if (!N(e)) return y[0];
498
499
  let t = e.id;
499
- return v.find((e) => e.id === t) ?? v[0];
500
+ return y.find((e) => e.id === t) ?? y[0];
500
501
  }
501
502
  function Oe(e) {
502
503
  return e.scopeType === "ALL" ? "全部簽核" : e.scopeType === "TEMPLATE_LIST" ? `指定模板:${e.scopeTemplateIds.length}` : e.scopeConditionCel ? `條件:${e.scopeConditionCel}` : "條件式";
503
504
  }
504
505
  function ke(e) {
505
- return !M(e) || !T(e.id) ? y[0] : y.find((t) => t.id === e.id) ?? y[0];
506
+ return !N(e) || !E(e.id) ? b[0] : b.find((t) => t.id === e.id) ?? b[0];
506
507
  }
507
- function T(e) {
508
+ function E(e) {
508
509
  return e === "ALL" || e === "TEMPLATE_LIST";
509
510
  }
510
511
  function Ae({ status: e }) {
511
- return e === "ACTIVE" ? /* @__PURE__ */ f(c, {
512
+ return e === "ACTIVE" ? /* @__PURE__ */ p(l, {
512
513
  size: "sub",
513
514
  text: "啟用中",
514
515
  variant: "dot-success"
515
- }) : e === "REVOKED" ? /* @__PURE__ */ f(c, {
516
+ }) : e === "REVOKED" ? /* @__PURE__ */ p(l, {
516
517
  size: "sub",
517
518
  text: "已撤銷",
518
519
  variant: "dot-inactive"
519
- }) : e === "EXPIRED" ? /* @__PURE__ */ f(c, {
520
+ }) : e === "EXPIRED" ? /* @__PURE__ */ p(l, {
520
521
  size: "sub",
521
522
  text: "已過期",
522
523
  variant: "dot-warning"
523
- }) : /* @__PURE__ */ f(c, {
524
+ }) : /* @__PURE__ */ p(l, {
524
525
  size: "sub",
525
526
  text: e,
526
527
  variant: "dot-info"
@@ -529,20 +530,20 @@ function Ae({ status: e }) {
529
530
  function je(e) {
530
531
  return e === "ACTIVE" || e === "REVOKED" || e === "EXPIRED" ? e : "ALL";
531
532
  }
532
- function E(e) {
533
- let t = e ? O(e) : null;
534
- return t ? `${k(t)}T${A(t.getHours())}:${A(t.getMinutes())}` : void 0;
535
- }
536
533
  function D(e) {
537
- let t = e ? O(e) : null;
534
+ let t = e ? k(e) : null;
535
+ return t ? `${A(t)}T${j(t.getHours())}:${j(t.getMinutes())}` : void 0;
536
+ }
537
+ function O(e) {
538
+ let t = e ? k(e) : null;
538
539
  return t ? t.toISOString() : "";
539
540
  }
540
541
  function Me(e, t) {
541
542
  if (!e || !t) return !1;
542
- let n = O(e), r = O(t);
543
+ let n = k(e), r = k(t);
543
544
  return !!n && !!r && r.getTime() <= n.getTime();
544
545
  }
545
- function O(e) {
546
+ function k(e) {
546
547
  if (e.endsWith("Z") || /[+-]\d{2}:\d{2}$/.test(e)) {
547
548
  let t = new Date(e);
548
549
  return Number.isNaN(t.getTime()) ? null : t;
@@ -550,19 +551,19 @@ function O(e) {
550
551
  let [t = "", n = "00:00"] = e.split("T"), [r = 0, i = 1, a = 1] = t.split("-").map(Number), [o = 0, s = 0] = n.split(":").map(Number), c = new Date(r, i - 1, a, o, s);
551
552
  return Number.isNaN(c.getTime()) ? null : c;
552
553
  }
553
- function k(e) {
554
- return `${e.getFullYear()}-${A(e.getMonth() + 1)}-${A(e.getDate())}`;
555
- }
556
554
  function A(e) {
557
- return String(e).padStart(2, "0");
555
+ return `${e.getFullYear()}-${j(e.getMonth() + 1)}-${j(e.getDate())}`;
558
556
  }
559
557
  function j(e) {
560
- return e instanceof Error ? e.message : "發生未知錯誤";
558
+ return String(e).padStart(2, "0");
561
559
  }
562
560
  function M(e) {
561
+ return e instanceof Error ? e.message : "發生未知錯誤";
562
+ }
563
+ function N(e) {
563
564
  return typeof e == "object" && !!e;
564
565
  }
565
566
  //#endregion
566
- export { b as t };
567
+ export { x as t };
567
568
 
568
- //# sourceMappingURL=delegations-ZNtodFaD.js.map
569
+ //# sourceMappingURL=delegations-DqMpI_Nk.js.map