@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
@@ -3,22 +3,22 @@ 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
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 l, DateTimePicker as u, Filter as d, FilterArea as f, FilterLine as p, FormField as m, Input as ee, Modal as te, PageHeader as ne, Section as re, SectionGroup as ie, Select as ae, Tab as oe, TabItem as se, Table as ce, Tooltip as h, Typography as g } from "@mezzanine-ui/react";
7
- import { Fragment as le, jsx as _, jsxs as v } from "react/jsx-runtime";
8
- import { createDelegationRule as ue, listDelegationRulesPage as de, revokeDelegationRule as fe, searchMembers as pe } from "@rytass/bpm-core-client/workflow";
9
- import me from "@mezzanine-ui/react/ContentHeader";
10
- import { FormFieldLayout as y } from "@mezzanine-ui/core/form";
11
- import { PlusIcon as he } from "@mezzanine-ui/icons";
12
- import { listApprovalTemplates as ge } from "@rytass/bpm-core-client/template";
13
- import '../delegations.css';var b = {
6
+ import { AutoComplete as s, Badge as c, Button as l, DateTimePicker as u, Filter as d, FilterArea as f, FilterLine as p, FormField as ee, Input as te, Modal as ne, PageHeader as re, Section as ie, SectionGroup as ae, Select as oe, Tab as se, TabItem as ce, Table as le, Tooltip as m, Typography as h } from "@mezzanine-ui/react";
7
+ import { Fragment as ue, jsx as g, jsxs as _ } from "react/jsx-runtime";
8
+ import { createDelegationRule as de, listDelegationRulesPage as fe, revokeDelegationRule as pe, searchMembers as me } from "@rytass/bpm-core-client/workflow";
9
+ import { FormFieldLayout as v } from "@mezzanine-ui/core/form";
10
+ import he from "@mezzanine-ui/react/ContentHeader";
11
+ import { PlusIcon as ge } from "@mezzanine-ui/icons";
12
+ import { listApprovalTemplates as _e } from "@rytass/bpm-core-client/template";
13
+ import '../delegations.css';var y = {
14
14
  delegationModalFields: "bpm_delegationModalFields_gUlCQ",
15
15
  delegationFilterArea: "bpm_delegationFilterArea_QDZkw",
16
16
  memberNameWithTooltip: "bpm_memberNameWithTooltip_RggTW"
17
- }, x = y.HORIZONTAL, _e = [
17
+ }, b = v.HORIZONTAL, ve = [
18
18
  10,
19
19
  20,
20
20
  50
21
- ], ve = [
21
+ ], ye = [
22
22
  {
23
23
  key: "ALL",
24
24
  label: "全部"
@@ -35,13 +35,13 @@ import '../delegations.css';var b = {
35
35
  key: "EXPIRED",
36
36
  label: "已過期"
37
37
  }
38
- ], S = [{
38
+ ], x = [{
39
39
  id: "ALL",
40
40
  name: "全部簽核"
41
41
  }, {
42
42
  id: "TEMPLATE_LIST",
43
43
  name: "指定模板"
44
- }], C = [
44
+ }], S = [
45
45
  {
46
46
  id: "ALL_SCOPES",
47
47
  name: "全部範圍",
@@ -58,48 +58,48 @@ import '../delegations.css';var b = {
58
58
  scopeType: "TEMPLATE_LIST"
59
59
  }
60
60
  ];
61
- function w() {
62
- let { member: c } = e(), h = c?.memberId ?? null, [x, w] = o(null), [E, D] = o(""), [k, A] = o(null), [Me, j] = o(!0), [N, Ne] = o(!1), [P, Pe] = o([]), [F, Fe] = o(null), [I, Ie] = o(null), [Le, L] = o(!1), [R, z] = o(null), [B, Re] = o("100"), [V, H] = o(1), [U, ze] = o(10), [W, Be] = o("ALL"), [Ve, He] = o(0), [Ue, We] = o([]), [Ge, Ke] = o(!1), [G, qe] = o([]), [K, Je] = o(C[0]), [Ye, Xe] = o(S[0]), [q, Ze] = o(""), [Qe, $e] = o(!1), [et, J] = o([]), Y = r(async () => {
63
- j(!0), A(null);
61
+ function C() {
62
+ let { member: c } = e(), m = c?.memberId ?? null, [b, C] = o(null), [T, E] = o(""), [O, j] = o(null), [je, M] = o(!0), [P, Me] = o(!1), [F, Ne] = o([]), [I, Pe] = o(null), [L, Fe] = o(null), [Ie, R] = o(!1), [z, Le] = o(null), [Re, ze] = o("100"), [B, V] = o(1), [H, Be] = o(10), [U, Ve] = o("ALL"), [He, Ue] = o(0), [We, Ge] = o([]), [Ke, qe] = o(!1), [W, Je] = o([]), [G, Ye] = o(S[0]), [Xe, Ze] = o(x[0]), [K, Qe] = o(""), [$e, et] = o(!1), [tt, q] = o([]), J = r(async () => {
63
+ M(!0), j(null);
64
64
  try {
65
- let [e, t] = await Promise.all([de({
66
- agentMemberId: I?.id ?? null,
65
+ let [e, t] = await Promise.all([fe({
66
+ agentMemberId: L?.id ?? null,
67
67
  includeInactive: !0,
68
- page: V,
69
- pageSize: U,
70
- principalMemberId: F?.id ?? null,
71
- scopeType: K.scopeType,
72
- status: W === "ALL" ? null : W
73
- }), pe("")]);
74
- We(e.rules), He(e.totalCount), Pe(t.map(ye));
68
+ page: B,
69
+ pageSize: H,
70
+ principalMemberId: I?.id ?? null,
71
+ scopeType: G.scopeType,
72
+ status: U === "ALL" ? null : U
73
+ }), me("")]);
74
+ Ge(e.rules), Ue(e.totalCount), Ne(t.map(be));
75
75
  } catch (e) {
76
- A(M(e));
76
+ j(N(e));
77
77
  } finally {
78
- j(!1);
78
+ M(!1);
79
79
  }
80
80
  }, [
81
+ L,
81
82
  I,
82
- F,
83
- V,
83
+ B,
84
+ H,
84
85
  U,
85
- W,
86
- K
86
+ G
87
87
  ]);
88
88
  i(() => {
89
- Y();
90
- }, [Y]);
91
- let X = a(() => new Map(P.map((e) => [e.id, e])), [P]), tt = a(() => Ue.map((e) => ({
89
+ J();
90
+ }, [J]);
91
+ let Y = a(() => new Map(F.map((e) => [e.id, e])), [F]), nt = a(() => We.map((e) => ({
92
92
  ...e,
93
- agentEmail: X.get(e.agentMemberId)?.email ?? null,
94
- agentName: X.get(e.agentMemberId)?.displayName ?? e.agentMemberId,
93
+ agentEmail: Y.get(e.agentMemberId)?.email ?? null,
94
+ agentName: Y.get(e.agentMemberId)?.displayName ?? e.agentMemberId,
95
95
  key: e.id,
96
- principalEmail: X.get(e.principalMemberId)?.email ?? null,
97
- principalName: X.get(e.principalMemberId)?.displayName ?? e.principalMemberId,
98
- scopeLabel: Ee(e)
99
- })), [X, Ue]), Z = S.find((e) => e.id === Ye.id) ?? S[0], nt = a(() => [
96
+ principalEmail: Y.get(e.principalMemberId)?.email ?? null,
97
+ principalName: Y.get(e.principalMemberId)?.displayName ?? e.principalMemberId,
98
+ scopeLabel: De(e)
99
+ })), [Y, We]), X = x.find((e) => e.id === Xe.id) ?? x[0], rt = a(() => [
100
100
  {
101
101
  key: "principal",
102
- render: (e) => /* @__PURE__ */ _(be, {
102
+ render: (e) => /* @__PURE__ */ g(xe, {
103
103
  email: e.principalEmail,
104
104
  name: e.principalName
105
105
  }),
@@ -108,7 +108,7 @@ function w() {
108
108
  },
109
109
  {
110
110
  key: "agent",
111
- render: (e) => /* @__PURE__ */ _(be, {
111
+ render: (e) => /* @__PURE__ */ g(xe, {
112
112
  email: e.agentEmail,
113
113
  name: e.agentName
114
114
  }),
@@ -123,7 +123,7 @@ function w() {
123
123
  },
124
124
  {
125
125
  key: "status",
126
- render: (e) => /* @__PURE__ */ _(De, { status: e.status }),
126
+ render: (e) => /* @__PURE__ */ g(Oe, { status: e.status }),
127
127
  title: "狀態",
128
128
  width: 120
129
129
  },
@@ -135,7 +135,7 @@ function w() {
135
135
  },
136
136
  {
137
137
  key: "startAt",
138
- render: (e) => /* @__PURE__ */ _(g, {
138
+ render: (e) => /* @__PURE__ */ g(h, {
139
139
  component: "span",
140
140
  variant: "body",
141
141
  children: t(e.startAt)
@@ -145,7 +145,7 @@ function w() {
145
145
  },
146
146
  {
147
147
  key: "endAt",
148
- render: (e) => /* @__PURE__ */ _(g, {
148
+ render: (e) => /* @__PURE__ */ g(h, {
149
149
  component: "span",
150
150
  variant: "body",
151
151
  children: e.endAt ? t(e.endAt) : "-"
@@ -153,247 +153,247 @@ function w() {
153
153
  title: "結束時間",
154
154
  width: 220
155
155
  }
156
- ], []), rt = r(async (e) => {
157
- if (h) {
158
- A(null);
156
+ ], []), it = r(async (e) => {
157
+ if (m) {
158
+ j(null);
159
159
  try {
160
- await fe({
160
+ await pe({
161
161
  id: e,
162
- revokedByMemberId: h
163
- }), await Y();
162
+ revokedByMemberId: m
163
+ }), await J();
164
164
  } catch (e) {
165
- A(M(e));
165
+ j(N(e));
166
166
  }
167
167
  }
168
- }, [h, Y]), it = a(() => ({
168
+ }, [m, J]), at = a(() => ({
169
169
  render: (e) => e.status === "ACTIVE" ? [{
170
170
  name: "撤銷",
171
- onClick: () => void rt(e.id)
171
+ onClick: () => void it(e.id)
172
172
  }] : [],
173
173
  variant: "destructive-secondary",
174
174
  width: 88
175
- }), [rt]);
176
- async function Q(e) {
177
- Ne(!0);
175
+ }), [it]);
176
+ async function Z(e) {
177
+ Me(!0);
178
178
  try {
179
- Pe((await pe(e)).map(ye));
179
+ Ne((await me(e)).map(be));
180
180
  } catch (e) {
181
- A(M(e));
181
+ j(N(e));
182
182
  } finally {
183
- Ne(!1);
183
+ Me(!1);
184
184
  }
185
185
  }
186
- async function $(e, t = G) {
187
- $e(!0);
186
+ async function Q(e, t = W) {
187
+ et(!0);
188
188
  try {
189
- J(O(t, Ce((await ge()).map(xe), e)));
189
+ q(D(t, we((await _e()).map(Se), e)));
190
190
  } catch (e) {
191
- A(M(e));
191
+ j(N(e));
192
192
  } finally {
193
- $e(!1);
193
+ et(!1);
194
194
  }
195
195
  }
196
- function at() {
197
- w(null), D(""), z(null), Re("100"), qe([]), Xe(S[0]), Ze(""), J([]), $("", []), L(!0);
198
- }
199
196
  function ot() {
200
- Ge || L(!1);
197
+ C(null), E(""), Le(null), ze("100"), Je([]), Ze(x[0]), Qe(""), q([]), Q("", []), R(!0);
198
+ }
199
+ function $() {
200
+ Ke || R(!1);
201
201
  }
202
202
  async function st() {
203
- if (h) {
204
- if (!R || !x) {
205
- A("請選擇原簽核人與代理人");
203
+ if (m) {
204
+ if (!z || !b) {
205
+ j("請選擇原簽核人與代理人");
206
206
  return;
207
207
  }
208
- if (Z.id === "TEMPLATE_LIST" && G.length < 1) {
209
- A("請選擇至少一個簽核模板");
208
+ if (X.id === "TEMPLATE_LIST" && W.length < 1) {
209
+ j("請選擇至少一個簽核模板");
210
210
  return;
211
211
  }
212
- if (je(q, E)) {
213
- A("結束時間必須晚於起始時間");
212
+ if (Ae(K, T)) {
213
+ j("結束時間必須晚於起始時間");
214
214
  return;
215
215
  }
216
- Ke(!0), A(null);
216
+ qe(!0), j(null);
217
217
  try {
218
- await ue({
219
- agentMemberId: x.id,
220
- createdByMemberId: h,
221
- endAt: E || null,
222
- principalMemberId: R.id,
223
- priority: Number(B) || 100,
218
+ await de({
219
+ agentMemberId: b.id,
220
+ createdByMemberId: m,
221
+ endAt: T || null,
222
+ principalMemberId: z.id,
223
+ priority: Number(Re) || 100,
224
224
  requiresConfirmation: !1,
225
225
  scopeConditionCel: null,
226
- scopeTemplateIds: Z.id === "TEMPLATE_LIST" ? G.map((e) => e.id) : [],
227
- scopeType: Z.id,
228
- startAt: q || null
229
- }), L(!1), V === 1 ? await Y() : H(1);
226
+ scopeTemplateIds: X.id === "TEMPLATE_LIST" ? W.map((e) => e.id) : [],
227
+ scopeType: X.id,
228
+ startAt: K || null
229
+ }), R(!1), B === 1 ? await J() : V(1);
230
230
  } catch (e) {
231
- A(M(e));
231
+ j(N(e));
232
232
  } finally {
233
- Ke(!1);
233
+ qe(!1);
234
234
  }
235
235
  }
236
236
  }
237
- return /* @__PURE__ */ v(le, { children: [
238
- /* @__PURE__ */ _(ne, { children: /* @__PURE__ */ _(me, {
237
+ return /* @__PURE__ */ _(ue, { children: [
238
+ /* @__PURE__ */ g(re, { children: /* @__PURE__ */ g(he, {
239
239
  description: "設定簽核代理規則,讓符合範圍的待簽任務自動改派給代理人。",
240
240
  title: "代理設定",
241
- children: /* @__PURE__ */ _(l, {
242
- icon: he,
241
+ children: /* @__PURE__ */ g(l, {
242
+ icon: ge,
243
243
  iconType: "leading",
244
- onClick: at,
244
+ onClick: ot,
245
245
  variant: "base-primary",
246
246
  children: "建立代理"
247
247
  })
248
248
  }) }),
249
- /* @__PURE__ */ _(ie, { children: /* @__PURE__ */ v(re, {
250
- filterArea: /* @__PURE__ */ _(f, {
251
- className: b.delegationFilterArea,
252
- children: /* @__PURE__ */ v(p, { children: [
253
- /* @__PURE__ */ _(d, {
249
+ /* @__PURE__ */ g(ae, { children: /* @__PURE__ */ _(ie, {
250
+ filterArea: /* @__PURE__ */ g(f, {
251
+ className: y.delegationFilterArea,
252
+ children: /* @__PURE__ */ _(p, { children: [
253
+ /* @__PURE__ */ g(d, {
254
254
  span: 2,
255
- children: /* @__PURE__ */ _(T, {
255
+ children: /* @__PURE__ */ g(w, {
256
256
  hideLabel: !0,
257
257
  label: "原簽核人",
258
- loading: N,
258
+ loading: P,
259
259
  name: "principalFilterMemberId",
260
260
  onChange: (e) => {
261
- Fe(e), H(1);
261
+ Pe(e), V(1);
262
262
  },
263
- onSearch: Q,
264
- options: P,
263
+ onSearch: Z,
264
+ options: F,
265
265
  required: !1,
266
- layout: y.VERTICAL,
266
+ layout: v.VERTICAL,
267
267
  size: "sub",
268
- value: F
268
+ value: I
269
269
  })
270
270
  }),
271
- /* @__PURE__ */ _(d, {
271
+ /* @__PURE__ */ g(d, {
272
272
  span: 2,
273
- children: /* @__PURE__ */ _(T, {
273
+ children: /* @__PURE__ */ g(w, {
274
274
  hideLabel: !0,
275
275
  label: "代理人",
276
- loading: N,
276
+ loading: P,
277
277
  name: "agentFilterMemberId",
278
278
  onChange: (e) => {
279
- Ie(e), H(1);
279
+ Fe(e), V(1);
280
280
  },
281
- onSearch: Q,
282
- options: P,
281
+ onSearch: Z,
282
+ options: F,
283
283
  required: !1,
284
- layout: y.VERTICAL,
284
+ layout: v.VERTICAL,
285
285
  size: "sub",
286
- value: I
286
+ value: L
287
287
  })
288
288
  }),
289
- /* @__PURE__ */ _(d, {
289
+ /* @__PURE__ */ g(d, {
290
290
  span: 2,
291
- children: /* @__PURE__ */ _(m, {
291
+ children: /* @__PURE__ */ g(ee, {
292
292
  fullWidth: !0,
293
- layout: y.VERTICAL,
293
+ layout: v.VERTICAL,
294
294
  name: "scopeFilterType",
295
- children: /* @__PURE__ */ _(ae, {
295
+ children: /* @__PURE__ */ g(oe, {
296
296
  clearable: !1,
297
297
  fullWidth: !0,
298
298
  onChange: (e) => {
299
- Je(Te(e)), H(1);
299
+ Ye(Ee(e)), V(1);
300
300
  },
301
- options: [...C],
301
+ options: [...S],
302
302
  placeholder: "代理範圍",
303
303
  size: "sub",
304
- value: K
304
+ value: G
305
305
  })
306
306
  })
307
307
  })
308
308
  ] })
309
309
  }),
310
- tab: /* @__PURE__ */ _(oe, {
311
- activeKey: W,
310
+ tab: /* @__PURE__ */ g(se, {
311
+ activeKey: U,
312
312
  onChange: (e) => {
313
- Be(Oe(e)), H(1);
313
+ Ve(ke(e)), V(1);
314
314
  },
315
- children: ve.map((e) => /* @__PURE__ */ _(se, { children: e.label }, e.key))
315
+ children: ye.map((e) => /* @__PURE__ */ g(ce, { children: e.label }, e.key))
316
316
  }),
317
- children: [k ? /* @__PURE__ */ _(g, {
317
+ children: [O ? /* @__PURE__ */ g(h, {
318
318
  color: "text-error",
319
319
  variant: "body",
320
- children: k
321
- }) : null, /* @__PURE__ */ _(ce, {
322
- actions: it,
323
- columns: nt,
324
- dataSource: tt,
320
+ children: O
321
+ }) : null, /* @__PURE__ */ g(le, {
322
+ actions: at,
323
+ columns: rt,
324
+ dataSource: nt,
325
325
  fullWidth: !0,
326
- loading: Me,
326
+ loading: je,
327
327
  pagination: {
328
- current: V,
328
+ current: B,
329
329
  onChange: (e) => {
330
- H(e);
330
+ V(e);
331
331
  },
332
332
  onChangePageSize: (e) => {
333
- H(1), ze(e);
333
+ V(1), Be(e);
334
334
  },
335
- pageSize: U,
335
+ pageSize: H,
336
336
  pageSizeLabel: "每頁筆數",
337
- pageSizeOptions: _e,
337
+ pageSizeOptions: ve,
338
338
  renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
339
339
  showPageSizeOptions: !0,
340
- total: Ve
340
+ total: He
341
341
  }
342
342
  })]
343
343
  }) }),
344
- /* @__PURE__ */ _(te, {
344
+ /* @__PURE__ */ g(ne, {
345
345
  cancelText: "取消",
346
- confirmButtonProps: { disabled: !R || !x },
346
+ confirmButtonProps: { disabled: !z || !b },
347
347
  confirmText: "建立代理",
348
- loading: Ge,
348
+ loading: Ke,
349
349
  modalType: "standard",
350
- onCancel: ot,
351
- onClose: ot,
350
+ onCancel: $,
351
+ onClose: $,
352
352
  onConfirm: () => void st(),
353
- open: Le,
353
+ open: Ie,
354
354
  showModalFooter: !0,
355
355
  showModalHeader: !0,
356
356
  size: "regular",
357
357
  supportingText: "代理生效後,後續建立的待簽任務會依範圍自動指派。",
358
358
  title: "建立代理",
359
- children: /* @__PURE__ */ v("div", {
360
- className: b.delegationModalFields,
359
+ children: /* @__PURE__ */ _("div", {
360
+ className: y.delegationModalFields,
361
361
  children: [
362
- /* @__PURE__ */ _(T, {
362
+ /* @__PURE__ */ g(w, {
363
363
  label: "原簽核人",
364
- loading: N,
364
+ loading: P,
365
365
  name: "principalMemberId",
366
- onChange: z,
367
- onSearch: Q,
368
- options: P,
369
- value: R
366
+ onChange: Le,
367
+ onSearch: Z,
368
+ options: F,
369
+ value: z
370
370
  }),
371
- /* @__PURE__ */ _(T, {
371
+ /* @__PURE__ */ g(w, {
372
372
  label: "代理人",
373
- loading: N,
373
+ loading: P,
374
374
  name: "agentMemberId",
375
- onChange: w,
376
- onSearch: Q,
377
- options: P,
378
- value: x
375
+ onChange: C,
376
+ onSearch: Z,
377
+ options: F,
378
+ value: b
379
379
  }),
380
- /* @__PURE__ */ _(n, {
380
+ /* @__PURE__ */ g(n, {
381
381
  label: "代理範圍",
382
382
  name: "scopeType",
383
383
  required: !0,
384
- children: /* @__PURE__ */ _(ae, {
384
+ children: /* @__PURE__ */ g(oe, {
385
385
  clearable: !1,
386
386
  fullWidth: !0,
387
- onChange: (e) => Xe(we(e)),
388
- options: [...S],
389
- value: Z
387
+ onChange: (e) => Ze(Te(e)),
388
+ options: [...x],
389
+ value: X
390
390
  })
391
391
  }),
392
- Z.id === "TEMPLATE_LIST" ? /* @__PURE__ */ _(n, {
392
+ X.id === "TEMPLATE_LIST" ? /* @__PURE__ */ g(n, {
393
393
  label: "簽核模板",
394
394
  name: "scopeTemplateIds",
395
395
  required: !0,
396
- children: /* @__PURE__ */ _(s, {
396
+ children: /* @__PURE__ */ g(s, {
397
397
  asyncData: !0,
398
398
  disabledOptionsFilter: !0,
399
399
  emptyText: "沒有符合的模板",
@@ -403,60 +403,60 @@ function w() {
403
403
  name: "scopeTemplateIds",
404
404
  spellCheck: !1
405
405
  },
406
- loading: Qe,
406
+ loading: $e,
407
407
  loadingText: "搜尋模板中...",
408
408
  mode: "multiple",
409
409
  onChange: (e) => {
410
- let t = Se(e);
411
- qe(t), J((e) => O(t, e));
410
+ let t = Ce(e);
411
+ Je(t), q((e) => D(t, e));
412
412
  },
413
- onSearch: $,
413
+ onSearch: Q,
414
414
  onVisibilityChange: (e) => {
415
- e && $("");
415
+ e && Q("");
416
416
  },
417
- options: [...et],
417
+ options: [...tt],
418
418
  overflowStrategy: "wrap",
419
419
  placeholder: "搜尋並選取簽核模板",
420
420
  searchDebounceTime: 300,
421
- value: [...G]
421
+ value: [...W]
422
422
  })
423
423
  }) : null,
424
- /* @__PURE__ */ _(n, {
424
+ /* @__PURE__ */ g(n, {
425
425
  label: "優先序",
426
426
  name: "priority",
427
- children: /* @__PURE__ */ _(ee, {
427
+ children: /* @__PURE__ */ g(te, {
428
428
  fullWidth: !0,
429
- onChange: (e) => Re(e.target.value),
430
- value: B,
429
+ onChange: (e) => ze(e.target.value),
430
+ value: Re,
431
431
  variant: "base"
432
432
  })
433
433
  }),
434
- /* @__PURE__ */ _(n, {
434
+ /* @__PURE__ */ g(n, {
435
435
  label: "起始時間",
436
436
  name: "startAt",
437
- children: /* @__PURE__ */ _(u, {
437
+ children: /* @__PURE__ */ g(u, {
438
438
  formatDate: "YYYY-MM-DD",
439
439
  formatTime: "HH:mm",
440
440
  fullWidth: !0,
441
441
  hideSecond: !0,
442
- onChange: (e) => Ze(Ae(e)),
442
+ onChange: (e) => Qe(A(e)),
443
443
  placeholderLeft: "留空立即生效",
444
444
  placeholderRight: "選擇時間",
445
- value: ke(q)
445
+ value: k(K)
446
446
  })
447
447
  }),
448
- /* @__PURE__ */ _(n, {
448
+ /* @__PURE__ */ g(n, {
449
449
  label: "結束時間",
450
450
  name: "endAt",
451
- children: /* @__PURE__ */ _(u, {
451
+ children: /* @__PURE__ */ g(u, {
452
452
  formatDate: "YYYY-MM-DD",
453
453
  formatTime: "HH:mm",
454
454
  fullWidth: !0,
455
455
  hideSecond: !0,
456
- onChange: (e) => D(Ae(e)),
456
+ onChange: (e) => E(A(e)),
457
457
  placeholderLeft: "可留空",
458
458
  placeholderRight: "選擇時間",
459
- value: ke(E)
459
+ value: k(T)
460
460
  })
461
461
  })
462
462
  ]
@@ -464,8 +464,8 @@ function w() {
464
464
  })
465
465
  ] });
466
466
  }
467
- function T({ hideLabel: e = !1, label: t, layout: r = x, loading: i, name: a, onChange: o, onSearch: c, options: l, required: u = !0, size: d, value: f }) {
468
- let p = /* @__PURE__ */ _(s, {
467
+ function w({ hideLabel: e = !1, label: t, layout: r = b, loading: i, name: a, onChange: o, onSearch: c, options: l, required: u = !0, size: d, value: f }) {
468
+ let p = /* @__PURE__ */ g(s, {
469
469
  asyncData: !0,
470
470
  disabledOptionsFilter: !0,
471
471
  emptyText: "沒有符合的成員",
@@ -478,9 +478,9 @@ function T({ hideLabel: e = !1, label: t, layout: r = x, loading: i, name: a, on
478
478
  loading: i,
479
479
  loadingText: "搜尋成員中...",
480
480
  mode: "single",
481
- onChange: (e) => o(E(e)),
481
+ onChange: (e) => o(T(e)),
482
482
  onSearch: c,
483
- onSearchTextChange: (e) => o(D(e, l)),
483
+ onSearchTextChange: (e) => o(E(e, l)),
484
484
  onVisibilityChange: (e) => {
485
485
  e && c("");
486
486
  },
@@ -490,12 +490,12 @@ function T({ hideLabel: e = !1, label: t, layout: r = x, loading: i, name: a, on
490
490
  size: d,
491
491
  value: f
492
492
  });
493
- return e ? /* @__PURE__ */ _(m, {
493
+ return e ? /* @__PURE__ */ g(ee, {
494
494
  fullWidth: !0,
495
495
  layout: r,
496
496
  name: a,
497
497
  children: p
498
- }) : /* @__PURE__ */ _(n, {
498
+ }) : /* @__PURE__ */ g(n, {
499
499
  label: t,
500
500
  layout: r,
501
501
  name: a,
@@ -503,7 +503,7 @@ function T({ hideLabel: e = !1, label: t, layout: r = x, loading: i, name: a, on
503
503
  children: p
504
504
  });
505
505
  }
506
- function ye(e) {
506
+ function be(e) {
507
507
  return {
508
508
  displayName: e.name,
509
509
  email: e.email,
@@ -511,8 +511,8 @@ function ye(e) {
511
511
  name: `${e.name} · ${e.email}`
512
512
  };
513
513
  }
514
- function E(e) {
515
- if (!N(e)) return null;
514
+ function T(e) {
515
+ if (!P(e)) return null;
516
516
  let t = e.id, n = e.name, r = e.email, i = e.displayName;
517
517
  return typeof t == "string" && typeof n == "string" ? {
518
518
  displayName: typeof i == "string" ? i : n,
@@ -521,19 +521,19 @@ function E(e) {
521
521
  name: n
522
522
  } : null;
523
523
  }
524
- function be({ email: e, name: t }) {
525
- return e ? /* @__PURE__ */ _(h, {
524
+ function xe({ email: e, name: t }) {
525
+ return e ? /* @__PURE__ */ g(m, {
526
526
  title: e,
527
- children: ({ onMouseEnter: e, onMouseLeave: n, ref: r }) => /* @__PURE__ */ _("span", {
528
- className: b.memberNameWithTooltip,
527
+ children: ({ onMouseEnter: e, onMouseLeave: n, ref: r }) => /* @__PURE__ */ g("span", {
528
+ className: y.memberNameWithTooltip,
529
529
  onMouseEnter: e,
530
530
  onMouseLeave: n,
531
531
  ref: r,
532
532
  children: t
533
533
  })
534
- }) : /* @__PURE__ */ _("span", { children: t });
534
+ }) : /* @__PURE__ */ g("span", { children: t });
535
535
  }
536
- function D(e, t) {
536
+ function E(e, t) {
537
537
  let n = e.trim().toLocaleLowerCase();
538
538
  if (!n) return null;
539
539
  let r = t.filter((e) => [
@@ -543,15 +543,15 @@ function D(e, t) {
543
543
  ].some((e) => e.toLocaleLowerCase().includes(n)));
544
544
  return r.length === 1 ? r[0] ?? null : null;
545
545
  }
546
- function xe(e) {
546
+ function Se(e) {
547
547
  return {
548
548
  id: e.id,
549
549
  name: e.name
550
550
  };
551
551
  }
552
- function Se(e) {
552
+ function Ce(e) {
553
553
  return e.flatMap((e) => {
554
- if (!N(e)) return [];
554
+ if (!P(e)) return [];
555
555
  let t = e.id, n = e.name;
556
556
  return typeof t == "string" && typeof n == "string" ? [{
557
557
  id: t,
@@ -559,63 +559,63 @@ function Se(e) {
559
559
  }] : [];
560
560
  });
561
561
  }
562
- function Ce(e, t) {
562
+ function we(e, t) {
563
563
  let n = t.trim().toLocaleLowerCase();
564
564
  return n ? e.filter((e) => [e.id, e.name].some((e) => e.toLocaleLowerCase().includes(n))) : e;
565
565
  }
566
- function O(e, t) {
566
+ function D(e, t) {
567
567
  return [...e, ...t].reduce((e, t) => e.some((e) => e.id === t.id) ? e : [...e, t], []);
568
568
  }
569
- function we(e) {
570
- return !N(e) || !k(e.id) ? S[0] : S.find((t) => t.id === e.id) ?? S[0];
571
- }
572
569
  function Te(e) {
573
- if (!N(e)) return C[0];
570
+ return !P(e) || !O(e.id) ? x[0] : x.find((t) => t.id === e.id) ?? x[0];
571
+ }
572
+ function Ee(e) {
573
+ if (!P(e)) return S[0];
574
574
  let t = e.id;
575
- return C.find((e) => e.id === t) ?? C[0];
575
+ return S.find((e) => e.id === t) ?? S[0];
576
576
  }
577
- function k(e) {
577
+ function O(e) {
578
578
  return e === "ALL" || e === "TEMPLATE_LIST";
579
579
  }
580
- function Ee(e) {
580
+ function De(e) {
581
581
  return e.scopeType === "ALL" ? "全部簽核" : e.scopeType === "TEMPLATE_LIST" ? `指定模板:${e.scopeTemplateIds.length}` : e.scopeConditionCel ? `條件:${e.scopeConditionCel}` : "條件式";
582
582
  }
583
- function De({ status: e }) {
584
- return e === "ACTIVE" ? /* @__PURE__ */ _(c, {
583
+ function Oe({ status: e }) {
584
+ return e === "ACTIVE" ? /* @__PURE__ */ g(c, {
585
585
  size: "sub",
586
586
  text: "啟用中",
587
587
  variant: "dot-success"
588
- }) : e === "REVOKED" ? /* @__PURE__ */ _(c, {
588
+ }) : e === "REVOKED" ? /* @__PURE__ */ g(c, {
589
589
  size: "sub",
590
590
  text: "已撤銷",
591
591
  variant: "dot-inactive"
592
- }) : e === "EXPIRED" ? /* @__PURE__ */ _(c, {
592
+ }) : e === "EXPIRED" ? /* @__PURE__ */ g(c, {
593
593
  size: "sub",
594
594
  text: "已過期",
595
595
  variant: "dot-warning"
596
- }) : /* @__PURE__ */ _(c, {
596
+ }) : /* @__PURE__ */ g(c, {
597
597
  size: "sub",
598
598
  text: e,
599
599
  variant: "dot-info"
600
600
  });
601
601
  }
602
- function Oe(e) {
602
+ function ke(e) {
603
603
  return e === "ACTIVE" || e === "REVOKED" || e === "EXPIRED" ? e : "ALL";
604
604
  }
605
- function ke(e) {
606
- let t = e ? A(e) : null;
607
- return t ? `${Me(t)}T${j(t.getHours())}:${j(t.getMinutes())}` : void 0;
605
+ function k(e) {
606
+ let t = e ? j(e) : null;
607
+ return t ? `${je(t)}T${M(t.getHours())}:${M(t.getMinutes())}` : void 0;
608
608
  }
609
- function Ae(e) {
610
- let t = e ? A(e) : null;
609
+ function A(e) {
610
+ let t = e ? j(e) : null;
611
611
  return t ? t.toISOString() : "";
612
612
  }
613
- function je(e, t) {
613
+ function Ae(e, t) {
614
614
  if (!e || !t) return !1;
615
- let n = A(e), r = A(t);
615
+ let n = j(e), r = j(t);
616
616
  return !!n && !!r && r.getTime() <= n.getTime();
617
617
  }
618
- function A(e) {
618
+ function j(e) {
619
619
  if (e.endsWith("Z") || /[+-]\d{2}:\d{2}$/.test(e)) {
620
620
  let t = new Date(e);
621
621
  return Number.isNaN(t.getTime()) ? null : t;
@@ -623,19 +623,19 @@ function A(e) {
623
623
  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);
624
624
  return Number.isNaN(c.getTime()) ? null : c;
625
625
  }
626
- function Me(e) {
627
- return `${e.getFullYear()}-${j(e.getMonth() + 1)}-${j(e.getDate())}`;
626
+ function je(e) {
627
+ return `${e.getFullYear()}-${M(e.getMonth() + 1)}-${M(e.getDate())}`;
628
628
  }
629
- function j(e) {
629
+ function M(e) {
630
630
  return String(e).padStart(2, "0");
631
631
  }
632
- function M(e) {
632
+ function N(e) {
633
633
  return e instanceof Error ? e.message : "發生未知錯誤";
634
634
  }
635
- function N(e) {
635
+ function P(e) {
636
636
  return typeof e == "object" && !!e;
637
637
  }
638
638
  //#endregion
639
- export { w as t };
639
+ export { C as t };
640
640
 
641
- //# sourceMappingURL=delegations-iVnRi3QE.js.map
641
+ //# sourceMappingURL=delegations-DLEEFBlH.js.map