@rytass/bpm-core-react 0.3.1 → 0.3.2

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