@rytass/bpm-core-react 0.18.0 → 0.18.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 (271) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/chunks/FormBuilderView-CHaAQL5v.cjs +3 -0
  3. package/dist/chunks/FormBuilderView-CHaAQL5v.cjs.map +1 -0
  4. package/dist/chunks/{FormBuilderView-BVKY1j_0.js → FormBuilderView-vQfVc08Z.js} +485 -481
  5. package/dist/chunks/FormBuilderView-vQfVc08Z.js.map +1 -0
  6. package/dist/chunks/{FormRendererView-BsTwZkqU.js → FormRendererView-CTLlG13b.js} +300 -189
  7. package/dist/chunks/FormRendererView-CTLlG13b.js.map +1 -0
  8. package/dist/chunks/FormRendererView-ChmM_4Yc.cjs +4 -0
  9. package/dist/chunks/FormRendererView-ChmM_4Yc.cjs.map +1 -0
  10. package/dist/chunks/admin-pickers-BjbkBpSJ.cjs +2 -0
  11. package/dist/chunks/admin-pickers-BjbkBpSJ.cjs.map +1 -0
  12. package/dist/chunks/{admin-pickers-Djq3h-UR.js → admin-pickers-DfGxsjpp.js} +42 -42
  13. package/dist/chunks/admin-pickers-DfGxsjpp.js.map +1 -0
  14. package/dist/chunks/{approval-instance-list-page-CPXMP3PL.js → approval-instance-list-page-BnI4t5mD.js} +7 -8
  15. package/dist/chunks/{approval-instance-list-page-CPXMP3PL.js.map → approval-instance-list-page-BnI4t5mD.js.map} +1 -1
  16. package/dist/chunks/{approval-instance-list-page-ax0pm8bt.cjs → approval-instance-list-page-fqvmkBlg.cjs} +2 -2
  17. package/dist/chunks/{approval-instance-list-page-ax0pm8bt.cjs.map → approval-instance-list-page-fqvmkBlg.cjs.map} +1 -1
  18. package/dist/chunks/{approver-filled-form-Dm3Iw7iw.cjs → approver-filled-form-B4zPg9kz.cjs} +2 -2
  19. package/dist/chunks/approver-filled-form-B4zPg9kz.cjs.map +1 -0
  20. package/dist/chunks/{approver-filled-form-ZEwpmsHJ.js → approver-filled-form-Bgazhbvd.js} +40 -36
  21. package/dist/chunks/approver-filled-form-Bgazhbvd.js.map +1 -0
  22. package/dist/chunks/auth-provider-4BeCw7cI.cjs.map +1 -1
  23. package/dist/chunks/{auth-provider-B5oPmvk2.js → auth-provider-C2b-5mGt.js} +2 -3
  24. package/dist/chunks/{auth-provider-B5oPmvk2.js.map → auth-provider-C2b-5mGt.js.map} +1 -1
  25. package/dist/chunks/{bpm-form-field-Cao0rMol.js → bpm-form-field-9B-Det0u.js} +2 -3
  26. package/dist/chunks/{bpm-form-field-Cao0rMol.js.map → bpm-form-field-9B-Det0u.js.map} +1 -1
  27. package/dist/chunks/bpm-form-field-Bc6k4ZEO.cjs.map +1 -1
  28. package/dist/chunks/{categories-riC33J_j.js → categories-BAdxjNSA.js} +14 -15
  29. package/dist/chunks/{categories-riC33J_j.js.map → categories-BAdxjNSA.js.map} +1 -1
  30. package/dist/chunks/{categories-AxxhqjLZ.cjs → categories-DQUtVEiV.cjs} +2 -2
  31. package/dist/chunks/{categories-AxxhqjLZ.cjs.map → categories-DQUtVEiV.cjs.map} +1 -1
  32. package/dist/chunks/{compose-B1GlrZW9.js → compose-D9ipJpF_.js} +131 -148
  33. package/dist/chunks/compose-D9ipJpF_.js.map +1 -0
  34. package/dist/chunks/compose-DtfX8DQ9.cjs +2 -0
  35. package/dist/chunks/compose-DtfX8DQ9.cjs.map +1 -0
  36. package/dist/chunks/{dashboard-page-DdBvV6YI.js → dashboard-page-BoqNhjT_.js} +5 -6
  37. package/dist/chunks/{dashboard-page-DdBvV6YI.js.map → dashboard-page-BoqNhjT_.js.map} +1 -1
  38. package/dist/chunks/{dashboard-page-BWQBSGDq.cjs → dashboard-page-D7YJ3udk.cjs} +2 -2
  39. package/dist/chunks/{dashboard-page-BWQBSGDq.cjs.map → dashboard-page-D7YJ3udk.cjs.map} +1 -1
  40. package/dist/chunks/{delegations-MxF3uJGW.js → delegations-BfhCDz5e.js} +15 -16
  41. package/dist/chunks/{delegations-MxF3uJGW.js.map → delegations-BfhCDz5e.js.map} +1 -1
  42. package/dist/chunks/{delegations-Ckf03icM.cjs → delegations-BmFGcuhA.cjs} +2 -2
  43. package/dist/chunks/{delegations-Ckf03icM.cjs.map → delegations-BmFGcuhA.cjs.map} +1 -1
  44. package/dist/chunks/{delegations-V9HIe3_P.cjs → delegations-CcS0SHbf.cjs} +2 -2
  45. package/dist/chunks/{delegations-V9HIe3_P.cjs.map → delegations-CcS0SHbf.cjs.map} +1 -1
  46. package/dist/chunks/{delegations-xUt1tj8d.js → delegations-DBh5TT6G.js} +16 -17
  47. package/dist/chunks/{delegations-xUt1tj8d.js.map → delegations-DBh5TT6G.js.map} +1 -1
  48. package/dist/chunks/designer-Df79YzUn.cjs +65 -0
  49. package/dist/chunks/designer-Df79YzUn.cjs.map +1 -0
  50. package/dist/chunks/{designer-BCLrjb4H.js → designer-ubnZbP-A.js} +1791 -1407
  51. package/dist/chunks/designer-ubnZbP-A.js.map +1 -0
  52. package/dist/chunks/detail-BBC9kqXd.cjs +5 -0
  53. package/dist/chunks/detail-BBC9kqXd.cjs.map +1 -0
  54. package/dist/chunks/{detail-4F39ggBn.js → detail-C6XKZjlF.js} +1033 -1005
  55. package/dist/chunks/detail-C6XKZjlF.js.map +1 -0
  56. package/dist/chunks/{format-date-time-CB-LxzqT.js → format-date-time-B0LdmWg4.js} +2 -3
  57. package/dist/chunks/{format-date-time-CB-LxzqT.js.map → format-date-time-B0LdmWg4.js.map} +1 -1
  58. package/dist/chunks/format-date-time-D-cx5M8z.cjs.map +1 -1
  59. package/dist/chunks/{format-member-label-DudVI55w.js → format-member-label-C73FuP-d.js} +2 -3
  60. package/dist/chunks/{format-member-label-DudVI55w.js.map → format-member-label-C73FuP-d.js.map} +1 -1
  61. package/dist/chunks/format-member-label-t7ANTF62.cjs.map +1 -1
  62. package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +1 -1
  63. package/dist/chunks/{language-provider-B3cEbLe4.js → language-provider-phkWOapf.js} +2 -3
  64. package/dist/chunks/{language-provider-B3cEbLe4.js.map → language-provider-phkWOapf.js.map} +1 -1
  65. package/dist/chunks/{login-C6qlTC6F.js → login-D6cc3bo7.js} +4 -5
  66. package/dist/chunks/{login-C6qlTC6F.js.map → login-D6cc3bo7.js.map} +1 -1
  67. package/dist/chunks/{login-AtVxZBsC.cjs → login-uvVcltrS.cjs} +2 -2
  68. package/dist/chunks/{login-AtVxZBsC.cjs.map → login-uvVcltrS.cjs.map} +1 -1
  69. package/dist/chunks/notifications-Bc4mgSds.cjs.map +1 -1
  70. package/dist/chunks/{notifications-DJ5wzCye.js → notifications-Cvme5Qbl.js} +2 -3
  71. package/dist/chunks/{notifications-DJ5wzCye.js.map → notifications-Cvme5Qbl.js.map} +1 -1
  72. package/dist/chunks/orgs-B_2J2tLX.cjs +2 -0
  73. package/dist/chunks/{orgs-BeeDDWL1.cjs.map → orgs-B_2J2tLX.cjs.map} +1 -1
  74. package/dist/chunks/{orgs-8hje_l2n.js → orgs-DqxMds26.js} +48 -49
  75. package/dist/chunks/{orgs-8hje_l2n.js.map → orgs-DqxMds26.js.map} +1 -1
  76. package/dist/chunks/{providers-B_d5tbCL.js → providers-BbCs23sk.js} +21 -25
  77. package/dist/chunks/{providers-B_d5tbCL.js.map → providers-BbCs23sk.js.map} +1 -1
  78. package/dist/chunks/{providers-chuJvMgv.cjs → providers-D_KAgOOu.cjs} +2 -2
  79. package/dist/chunks/{providers-chuJvMgv.cjs.map → providers-D_KAgOOu.cjs.map} +1 -1
  80. package/dist/chunks/router-adapter--gYs13E8.cjs.map +1 -1
  81. package/dist/chunks/{router-adapter-DftlFTOd.js → router-adapter-CkxCyzf5.js} +2 -3
  82. package/dist/chunks/{router-adapter-DftlFTOd.js.map → router-adapter-CkxCyzf5.js.map} +1 -1
  83. package/dist/chunks/{routes-config-yZbESPlw.js → routes-config-BcNaWJWJ.js} +2 -3
  84. package/dist/chunks/{routes-config-yZbESPlw.js.map → routes-config-BcNaWJWJ.js.map} +1 -1
  85. package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
  86. package/dist/chunks/task-decision-3d17ZvZE.js +29 -0
  87. package/dist/chunks/task-decision-3d17ZvZE.js.map +1 -0
  88. package/dist/chunks/task-decision-CqZ4WQOC.cjs +2 -0
  89. package/dist/chunks/task-decision-CqZ4WQOC.cjs.map +1 -0
  90. package/dist/chunks/{use-bpm-member-D57LKe_u.js → use-bpm-member-BPzcNU1g.js} +3 -4
  91. package/dist/chunks/{use-bpm-member-D57LKe_u.js.map → use-bpm-member-BPzcNU1g.js.map} +1 -1
  92. package/dist/chunks/use-bpm-member-DpNAQtNC.cjs.map +1 -1
  93. package/dist/chunks/{users-Pl6hY5Y5.js → users-BBtiZ9QQ.js} +22 -25
  94. package/dist/chunks/{users-Pl6hY5Y5.js.map → users-BBtiZ9QQ.js.map} +1 -1
  95. package/dist/chunks/{users-O2L_M3BK.cjs → users-EqSzDhuj.cjs} +2 -2
  96. package/dist/chunks/{users-O2L_M3BK.cjs.map → users-EqSzDhuj.cjs.map} +1 -1
  97. package/dist/components/admin-picker-options.d.cts +11 -0
  98. package/dist/components/admin-picker-options.d.ts +11 -0
  99. package/dist/components/admin-pickers.d.cts +2 -11
  100. package/dist/components/admin-pickers.d.ts +2 -11
  101. package/dist/index.cjs +1 -1
  102. package/dist/index.cjs.map +1 -1
  103. package/dist/index.js +17 -19
  104. package/dist/index.js.map +1 -1
  105. package/dist/lib/task-decision.d.cts +16 -0
  106. package/dist/lib/task-decision.d.ts +16 -0
  107. package/dist/lib/use-org-unit-names.d.cts +10 -0
  108. package/dist/lib/use-org-unit-names.d.ts +10 -0
  109. package/dist/next/index.cjs +1 -1
  110. package/dist/next/index.cjs.map +1 -1
  111. package/dist/next/index.js +7 -8
  112. package/dist/next/index.js.map +1 -1
  113. package/dist/next/workflow-chat-route.cjs +19 -1
  114. package/dist/next/workflow-chat-route.cjs.map +1 -1
  115. package/dist/next/workflow-chat-route.js +2 -3
  116. package/dist/next/workflow-chat-route.js.map +1 -1
  117. package/dist/pages/admin/delegations/index.cjs +1 -1
  118. package/dist/pages/admin/delegations/index.cjs.map +1 -1
  119. package/dist/pages/admin/delegations/index.js +2 -3
  120. package/dist/pages/admin/orgs/index.cjs +1 -1
  121. package/dist/pages/admin/orgs/index.cjs.map +1 -1
  122. package/dist/pages/admin/orgs/index.js +2 -3
  123. package/dist/pages/admin/users/index.cjs +1 -1
  124. package/dist/pages/admin/users/index.cjs.map +1 -1
  125. package/dist/pages/admin/users/index.js +2 -3
  126. package/dist/pages/admin/webhook-endpoints/index.cjs.map +1 -1
  127. package/dist/pages/admin/webhook-endpoints/index.js +1 -2
  128. package/dist/pages/cc/index.cjs.map +1 -1
  129. package/dist/pages/cc/index.js +1 -2
  130. package/dist/pages/dashboard/index.cjs.map +1 -1
  131. package/dist/pages/dashboard/index.js +1 -2
  132. package/dist/pages/delegations/index.cjs +1 -1
  133. package/dist/pages/delegations/index.cjs.map +1 -1
  134. package/dist/pages/delegations/index.js +2 -3
  135. package/dist/pages/inbox/index.cjs.map +1 -1
  136. package/dist/pages/inbox/index.js +1 -2
  137. package/dist/pages/instances/detail/index.cjs +1 -1
  138. package/dist/pages/instances/detail/index.cjs.map +1 -1
  139. package/dist/pages/instances/detail/index.js +2 -3
  140. package/dist/pages/instances/new/index.cjs.map +1 -1
  141. package/dist/pages/instances/new/index.js +1 -2
  142. package/dist/pages/login/index.cjs +1 -1
  143. package/dist/pages/login/index.cjs.map +1 -1
  144. package/dist/pages/login/index.js +2 -3
  145. package/dist/pages/root/index.cjs.map +1 -1
  146. package/dist/pages/root/index.js +1 -2
  147. package/dist/pages/search/index.cjs.map +1 -1
  148. package/dist/pages/search/index.js +1 -2
  149. package/dist/pages/sent/index.cjs.map +1 -1
  150. package/dist/pages/sent/index.js +1 -2
  151. package/dist/pages/settings/notifications/index.cjs.map +1 -1
  152. package/dist/pages/settings/notifications/index.js +2 -3
  153. package/dist/pages/templates/categories/index.cjs +1 -1
  154. package/dist/pages/templates/categories/index.cjs.map +1 -1
  155. package/dist/pages/templates/categories/index.js +2 -3
  156. package/dist/pages/templates/compose/index.cjs +1 -1
  157. package/dist/pages/templates/compose/index.cjs.map +1 -1
  158. package/dist/pages/templates/compose/index.js +2 -3
  159. package/dist/pages/templates/designer/index.cjs +1 -1
  160. package/dist/pages/templates/designer/index.cjs.map +1 -1
  161. package/dist/pages/templates/designer/index.js +2 -3
  162. package/dist/pages/templates/index.cjs.map +1 -1
  163. package/dist/pages/templates/index.js +1 -2
  164. package/dist/pages/templates/versions/index.cjs.map +1 -1
  165. package/dist/pages/templates/versions/index.js +1 -2
  166. package/dist/views/admin/delegations/index.cjs +1 -1
  167. package/dist/views/admin/delegations/index.js +1 -1
  168. package/dist/views/admin/index.cjs +1 -1
  169. package/dist/views/admin/index.js +3 -3
  170. package/dist/views/admin/orgs/index.cjs +1 -1
  171. package/dist/views/admin/orgs/index.js +1 -1
  172. package/dist/views/admin/users/index.cjs +1 -1
  173. package/dist/views/admin/users/index.js +1 -1
  174. package/dist/views/admin/webhook-endpoints/index.cjs +1 -1
  175. package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
  176. package/dist/views/admin/webhook-endpoints/index.js +52 -53
  177. package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
  178. package/dist/views/cc/index.cjs +1 -1
  179. package/dist/views/cc/index.cjs.map +1 -1
  180. package/dist/views/cc/index.js +2 -3
  181. package/dist/views/dashboard/index.cjs +1 -1
  182. package/dist/views/dashboard/index.cjs.map +1 -1
  183. package/dist/views/dashboard/index.js +2 -3
  184. package/dist/views/delegations/index.cjs +1 -1
  185. package/dist/views/delegations/index.js +1 -1
  186. package/dist/views/forms/builder/index.cjs +1 -1
  187. package/dist/views/forms/builder/index.js +1 -1
  188. package/dist/views/forms/renderer/index.cjs +1 -1
  189. package/dist/views/forms/renderer/index.js +1 -1
  190. package/dist/views/forms/renderer/org-unit-field-options.d.cts +44 -0
  191. package/dist/views/forms/renderer/org-unit-field-options.d.ts +44 -0
  192. package/dist/views/forms/renderer/org-unit-field.d.cts +23 -0
  193. package/dist/views/forms/renderer/org-unit-field.d.ts +23 -0
  194. package/dist/views/inbox/index.cjs +1 -1
  195. package/dist/views/inbox/index.cjs.map +1 -1
  196. package/dist/views/inbox/index.js +133 -137
  197. package/dist/views/inbox/index.js.map +1 -1
  198. package/dist/views/instances/approver-filled-form.d.cts +9 -2
  199. package/dist/views/instances/approver-filled-form.d.ts +9 -2
  200. package/dist/views/instances/detail/index.cjs +1 -1
  201. package/dist/views/instances/detail/index.js +1 -1
  202. package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +8 -1
  203. package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +8 -1
  204. package/dist/views/instances/detail/sections/container-helpers.d.cts +0 -1
  205. package/dist/views/instances/detail/sections/container-helpers.d.ts +0 -1
  206. package/dist/views/instances/detail/sections/shared.d.cts +2 -2
  207. package/dist/views/instances/detail/sections/shared.d.ts +2 -2
  208. package/dist/views/instances/new/index.cjs +1 -1
  209. package/dist/views/instances/new/index.cjs.map +1 -1
  210. package/dist/views/instances/new/index.js +14 -15
  211. package/dist/views/instances/new/index.js.map +1 -1
  212. package/dist/views/login/index.cjs +1 -1
  213. package/dist/views/login/index.js +1 -1
  214. package/dist/views/search/index.cjs +1 -1
  215. package/dist/views/search/index.cjs.map +1 -1
  216. package/dist/views/search/index.js +2 -3
  217. package/dist/views/sent/index.cjs +1 -1
  218. package/dist/views/sent/index.cjs.map +1 -1
  219. package/dist/views/sent/index.js +2 -3
  220. package/dist/views/settings/index.js +1 -1
  221. package/dist/views/settings/notifications/index.js +1 -1
  222. package/dist/views/templates/categories/index.cjs +1 -1
  223. package/dist/views/templates/categories/index.js +1 -1
  224. package/dist/views/templates/compose/index.cjs +1 -1
  225. package/dist/views/templates/compose/index.js +1 -1
  226. package/dist/views/templates/designer/approver-resolver-model.d.cts +211 -0
  227. package/dist/views/templates/designer/approver-resolver-model.d.ts +211 -0
  228. package/dist/views/templates/designer/dry-run-assignee-label.d.cts +2 -0
  229. package/dist/views/templates/designer/dry-run-assignee-label.d.ts +2 -0
  230. package/dist/views/templates/designer/dry-run-sample-data.d.cts +6 -0
  231. package/dist/views/templates/designer/dry-run-sample-data.d.ts +6 -0
  232. package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +25 -0
  233. package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +25 -0
  234. package/dist/views/templates/designer/index.cjs +1 -1
  235. package/dist/views/templates/designer/index.js +1 -1
  236. package/dist/views/templates/designer/node-actor-resolver-options.d.cts +38 -0
  237. package/dist/views/templates/designer/node-actor-resolver-options.d.ts +38 -0
  238. package/dist/views/templates/index.cjs +1 -1
  239. package/dist/views/templates/index.cjs.map +1 -1
  240. package/dist/views/templates/index.js +50 -51
  241. package/dist/views/templates/index.js.map +1 -1
  242. package/dist/views/templates/versions/index.cjs +1 -1
  243. package/dist/views/templates/versions/index.cjs.map +1 -1
  244. package/dist/views/templates/versions/index.js +7 -8
  245. package/dist/views/templates/versions/index.js.map +1 -1
  246. package/package.json +3 -3
  247. package/dist/chunks/FormBuilderView-BVKY1j_0.js.map +0 -1
  248. package/dist/chunks/FormBuilderView-SrGltzFT.cjs +0 -3
  249. package/dist/chunks/FormBuilderView-SrGltzFT.cjs.map +0 -1
  250. package/dist/chunks/FormRendererView-BsTwZkqU.js.map +0 -1
  251. package/dist/chunks/FormRendererView-GpsE03np.cjs +0 -4
  252. package/dist/chunks/FormRendererView-GpsE03np.cjs.map +0 -1
  253. package/dist/chunks/admin-pickers-BRHk3qKq.cjs +0 -2
  254. package/dist/chunks/admin-pickers-BRHk3qKq.cjs.map +0 -1
  255. package/dist/chunks/admin-pickers-Djq3h-UR.js.map +0 -1
  256. package/dist/chunks/approver-filled-form-Dm3Iw7iw.cjs.map +0 -1
  257. package/dist/chunks/approver-filled-form-ZEwpmsHJ.js.map +0 -1
  258. package/dist/chunks/compose-B1GlrZW9.js.map +0 -1
  259. package/dist/chunks/compose-DZk-SfHT.cjs +0 -2
  260. package/dist/chunks/compose-DZk-SfHT.cjs.map +0 -1
  261. package/dist/chunks/designer-BCLrjb4H.js.map +0 -1
  262. package/dist/chunks/designer-BYYxEN9L.cjs +0 -65
  263. package/dist/chunks/designer-BYYxEN9L.cjs.map +0 -1
  264. package/dist/chunks/detail-4F39ggBn.js.map +0 -1
  265. package/dist/chunks/detail-BkMtA_0K.cjs +0 -2
  266. package/dist/chunks/detail-BkMtA_0K.cjs.map +0 -1
  267. package/dist/chunks/orgs-BeeDDWL1.cjs +0 -2
  268. package/dist/chunks/task-node-label-BF6UllxP.cjs +0 -2
  269. package/dist/chunks/task-node-label-BF6UllxP.cjs.map +0 -1
  270. package/dist/chunks/task-node-label-CWZgOBj0.js +0 -9
  271. package/dist/chunks/task-node-label-CWZgOBj0.js.map +0 -1
@@ -1,15 +1,16 @@
1
1
  "use client";
2
- import { t as e } from "./bpm-form-field-Cao0rMol.js";
3
- import { t } from "./format-member-label-DudVI55w.js";
2
+ import { t as e } from "./bpm-form-field-9B-Det0u.js";
3
+ import { t } from "./format-member-label-C73FuP-d.js";
4
4
  import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
5
5
  import { AutoComplete as s, Button as c, CheckboxGroup as l, DatePicker as u, DateTimePicker as d, Input as f, RadioGroup as p, Select as m, Table as h, Textarea as g, Toggle as _, Typography as v, Upload as y } from "@mezzanine-ui/react";
6
6
  import { resolveMembers as b, searchMembers as x } from "@rytass/bpm-core-client";
7
7
  import { jsx as S, jsxs as C } from "react/jsx-runtime";
8
8
  import { PlusIcon as w, TrashIcon as T } from "@mezzanine-ui/icons";
9
- import { buildFormRendererValues as E, clampOptionalNumber as D, createFormTableRow as ee, formatDatePickerValue as O, formatDateTimePickerValue as k, isFormRendererFieldReadonly as A, isFormRendererFieldRequired as j, mergeFormDataSourceOptions as M, parseOptionalNumberInput as N, previewFormFieldOptions as te, previewResolveFormFieldOptions as ne, readDatePickerValue as re, readFieldOptionAsSelectOption as P, readFormDataSourceErrorCode as ie, readFormDataSourceErrorMessage as ae, readFormDataSourceSelectedValues as oe, readFormDataSourceValueSignature as F, readFormFieldOptions as se, readFormTableCellPath as I, readFormTableRowBounds as ce, readFormTableRows as L, readMissingFormDataSourceDependencies as le, readMissingFormDataSourceOptionValues as R, readSelectOption as z, readSelectedFormDataSourceOptions as B, readVisibleFormRendererFields as ue, resolveFormFieldOptions as de } from "@rytass/bpm-core-client/form";
10
- import { isFormDataSourceFieldDefinition as V, isFormStaticOptionFieldDefinition as fe, isFormTableCellValue as H, isTableFieldDefinition as pe, readFormFieldSelectionMode as U, readFormMemberIds as W } from "@rytass/bpm-core-shared/form";
11
- //#region src/views/forms/renderer/form-data-source-field.ts
12
- var me = {
9
+ import { buildFormRendererValues as E, clampOptionalNumber as D, createFormTableRow as ee, formatDatePickerValue as O, formatDateTimePickerValue as k, isFormRendererFieldReadonly as A, isFormRendererFieldRequired as j, mergeFormDataSourceOptions as M, parseOptionalNumberInput as N, previewFormFieldOptions as te, previewResolveFormFieldOptions as ne, readDatePickerValue as P, readFieldOptionAsSelectOption as F, readFormDataSourceErrorCode as re, readFormDataSourceErrorMessage as ie, readFormDataSourceSelectedValues as ae, readFormDataSourceValueSignature as I, readFormFieldOptions as oe, readFormTableCellPath as L, readFormTableRowBounds as se, readFormTableRows as R, readMissingFormDataSourceDependencies as ce, readMissingFormDataSourceOptionValues as z, readSelectOption as B, readSelectedFormDataSourceOptions as le, readVisibleFormRendererFields as ue, resolveFormFieldOptions as de } from "@rytass/bpm-core-client/form";
10
+ import { isFormDataSourceFieldDefinition as fe, isFormStaticOptionFieldDefinition as pe, isFormTableCellValue as V, isTableFieldDefinition as me, readFormFieldSelectionMode as H, readFormMemberIds as U } from "@rytass/bpm-core-shared/form";
11
+ import { resolveOrgUnitOptions as W, searchOrgUnitOptions as G } from "@rytass/bpm-core-client/organization";
12
+ // src/views/forms/renderer/form-data-source-field.ts
13
+ var he = {
13
14
  canRetry: !1,
14
15
  error: null,
15
16
  hasValue: !1,
@@ -20,13 +21,13 @@ var me = {
20
21
  options: [],
21
22
  retry: () => void 0,
22
23
  status: "IDLE"
23
- }, G = [], he = 10, ge = ["FORM_DATA_SOURCE_SEARCH_NOT_SUPPORTED", "FORM_DATA_SOURCE_SEARCH_TOO_SHORT"];
24
- function K(e) {
25
- let t = V(e.field) ? e.field : null, s = e.fieldPath ?? t?.fieldKey ?? "", c = t ? e.optionSnapshots?.[e.snapshotKey ?? t.fieldKey] : void 0, l = t ? JSON.stringify({
24
+ }, K = [], ge = 10, _e = ["FORM_DATA_SOURCE_SEARCH_NOT_SUPPORTED", "FORM_DATA_SOURCE_SEARCH_TOO_SHORT"];
25
+ function q(e) {
26
+ let t = fe(e.field) ? e.field : null, s = e.fieldPath ?? t?.fieldKey ?? "", c = t ? e.optionSnapshots?.[e.snapshotKey ?? t.fieldKey] : void 0, l = t ? JSON.stringify({
26
27
  dataSource: t.dataSource,
27
28
  fieldKey: t.fieldKey,
28
29
  type: t.type
29
- }) : "", u = JSON.stringify(c ?? null), d = i(() => c?.options ?? [], [u]), f = JSON.stringify(e.formData), p = JSON.stringify(e.initialFormData ?? {}), m = JSON.stringify(e.schema), h = JSON.stringify(e.uiSchema), g = e.context?.kind, _ = e.context?.kind === "runtime" ? e.context.instanceId : void 0, v = e.context?.kind === "runtime" ? e.context.templateId : void 0, y = JSON.stringify(e.row?.values ?? null), b = JSON.stringify(e.row?.initialValues ?? null), x = t ? e.row ? e.row.values[t.fieldKey] : e.formData[t.fieldKey] : void 0, S = F(x), C = i(() => oe(x), [S]), w = C.length > 0, T = t ? JSON.stringify({
30
+ }) : "", u = JSON.stringify(c ?? null), d = i(() => c?.options ?? [], [u]), f = JSON.stringify(e.formData), p = JSON.stringify(e.initialFormData ?? {}), m = JSON.stringify(e.schema), h = JSON.stringify(e.uiSchema), g = e.context?.kind, _ = e.context?.kind === "runtime" ? e.context.instanceId : void 0, v = e.context?.kind === "runtime" ? e.context.templateId : void 0, y = JSON.stringify(e.row?.values ?? null), b = JSON.stringify(e.row?.initialValues ?? null), x = t ? e.row ? e.row.values[t.fieldKey] : e.formData[t.fieldKey] : void 0, S = I(x), C = i(() => ae(x), [S]), w = C.length > 0, T = t ? JSON.stringify({
30
31
  bindings: t.dataSource.bindings.map((t) => t.from.kind === "FIELD" ? {
31
32
  fieldKey: t.from.fieldKey,
32
33
  value: e.formData[t.from.fieldKey]
@@ -47,28 +48,28 @@ function K(e) {
47
48
  g,
48
49
  v,
49
50
  e.readonly
50
- ]), D = t ? (e.initialFormData !== void 0 || e.initialValue !== void 0) && F(e.initialValue) !== S : !1, ee = t ? e.initialFormData !== void 0 && t.dataSource.bindings.some((t) => t.from.kind === "FIELD" ? F(e.initialFormData?.[t.from.fieldKey]) !== F(e.formData[t.from.fieldKey]) : t.from.kind === "ROW_FIELD" && e.row?.initialValues ? F(e.row.initialValues[t.from.columnKey]) !== F(e.row.values[t.from.columnKey]) : !1) : !1, O = !(!c && !w || !D && !ee), k = !!(t && E && O && w), A = ye({
51
+ ]), D = t ? (e.initialFormData !== void 0 || e.initialValue !== void 0) && I(e.initialValue) !== S : !1, ee = t ? e.initialFormData !== void 0 && t.dataSource.bindings.some((t) => t.from.kind === "FIELD" ? I(e.initialFormData?.[t.from.fieldKey]) !== I(e.formData[t.from.fieldKey]) : t.from.kind === "ROW_FIELD" && e.row?.initialValues ? I(e.row.initialValues[t.from.columnKey]) !== I(e.row.values[t.from.columnKey]) : !1) : !1, O = !(!c && !w || !D && !ee), k = !!(t && E && O && w), A = ye({
51
52
  hasSnapshot: !!c,
52
53
  hasValue: w,
53
54
  isStale: O,
54
55
  readonly: e.readonly
55
- }), j = !!(t && E && t.type !== "autocomplete"), N = be(O, j && t !== null && le(t, e.formData, e.row?.values).length > 0), [re, P] = o([]), [I, ce] = o(""), [L, R] = o(null), [z, ue] = o(null), [fe, H] = o(() => t ? j ? N : A : "IDLE"), [pe, U] = o(null), W = a(0), G = a(0), K = a(0), q = a(null), J = a(null), _e = a({
56
+ }), j = !!(t && E && t.type !== "autocomplete"), N = be(O, j && t !== null && ce(t, e.formData, e.row?.values).length > 0), [P, F] = o([]), [L, se] = o(""), [R, z] = o(null), [B, ue] = o(null), [pe, V] = o(() => t ? j ? N : A : "IDLE"), [me, H] = o(null), U = a(0), W = a(0), G = a(0), K = a(null), q = a(null), J = a({
56
57
  cursor: null,
57
58
  searchText: ""
58
- }), Y = i(() => we(e.formData), [f]), X = i(() => e.row ? we(e.row.values) : void 0, [y]), Te = i(() => M(d, re), [re, d]), Ee = z && z.signature === T ? z : null, De = k && !Ee, Oe = ve({
59
+ }), Y = i(() => we(e.formData), [f]), X = i(() => e.row ? we(e.row.values) : void 0, [y]), Te = i(() => M(d, P), [P, d]), Ee = B && B.signature === T ? B : null, De = k && !Ee, Oe = ve({
59
60
  options: Te,
60
61
  resolution: Ee,
61
62
  resolvePending: De,
62
63
  value: x
63
64
  }), Z = n((n, r) => {
64
65
  if (!t || !E) return;
65
- let i = G.current + 1;
66
- G.current = i, _e.current = {
66
+ let i = W.current + 1;
67
+ W.current = i, J.current = {
67
68
  cursor: r,
68
69
  searchText: n
69
- }, q.current?.abort();
70
+ }, K.current?.abort();
70
71
  let a = new AbortController();
71
- q.current = a, H(N), U(null), (E.kind === "preview" ? te({
72
+ K.current = a, V(N), H(null), (E.kind === "preview" ? te({
72
73
  cursor: r,
73
74
  fieldKey: s,
74
75
  formData: Y,
@@ -77,7 +78,7 @@ function K(e) {
77
78
  searchText: n,
78
79
  signal: a.signal,
79
80
  uiSchema: e.uiSchema
80
- }) : se({
81
+ }) : oe({
81
82
  cursor: r,
82
83
  fieldKey: s,
83
84
  formData: Y,
@@ -87,14 +88,14 @@ function K(e) {
87
88
  signal: a.signal,
88
89
  templateId: E.templateId ?? null
89
90
  })).then((e) => {
90
- Ce(a, G, i) || (P((t) => {
91
- let n = B(x, t);
91
+ Ce(a, W, i) || (F((t) => {
92
+ let n = le(x, t);
92
93
  return M(n, r ? t : [], e.options);
93
- }), R(e.nextCursor), U(null), W.current = r ? W.current + e.options.length : e.options.length, e.nextCursor && e.options.length > 0 && W.current < he && Q.current(n, e.nextCursor), H(e.waitingForFieldKeys.length ? "WAITING_FOR_DEPENDENCIES" : "VALID"));
94
+ }), z(e.nextCursor), H(null), U.current = r ? U.current + e.options.length : e.options.length, e.nextCursor && e.options.length > 0 && U.current < ge && ke.current(n, e.nextCursor), V(e.waitingForFieldKeys.length ? "WAITING_FOR_DEPENDENCIES" : "VALID"));
94
95
  }).catch((e) => {
95
- if (Ce(a, G, i)) return;
96
- let t = ae(e) ?? "選項來源暫時無法使用。", n = ie(e);
97
- U(t), H(xe(!!(n && ge.includes(n)), w));
96
+ if (Ce(a, W, i)) return;
97
+ let t = ie(e) ?? "選項來源暫時無法使用。", n = re(e);
98
+ H(t), V(xe(!!(n && _e.includes(n)), w));
98
99
  });
99
100
  }, [
100
101
  S,
@@ -107,14 +108,14 @@ function K(e) {
107
108
  X,
108
109
  m,
109
110
  h
110
- ]), Q = a(Z);
111
- Q.current = Z;
112
- let ke = n(() => {
111
+ ]), ke = a(Z);
112
+ ke.current = Z;
113
+ let Ae = n(() => {
113
114
  if (!t || !E || C.length === 0) return;
114
- let n = T, r = K.current + 1;
115
- K.current = r, J.current?.abort();
115
+ let n = T, r = G.current + 1;
116
+ G.current = r, q.current?.abort();
116
117
  let i = new AbortController();
117
- J.current = i, U(null), (E.kind === "preview" ? ne({
118
+ q.current = i, H(null), (E.kind === "preview" ? ne({
118
119
  fieldKey: s,
119
120
  formData: Y,
120
121
  rowValues: X,
@@ -131,12 +132,12 @@ function K(e) {
131
132
  templateId: E.templateId ?? null,
132
133
  values: C
133
134
  })).then((e) => {
134
- Ce(i, K, r) || (e.waitingForFieldKeys.length ? H("WAITING_FOR_DEPENDENCIES") : (P((t) => M(t, e.options)), ue({
135
+ Ce(i, G, r) || (e.waitingForFieldKeys.length ? V("WAITING_FOR_DEPENDENCIES") : (F((t) => M(t, e.options)), ue({
135
136
  signature: n,
136
137
  unresolvedValues: e.unresolvedValues
137
- }), H("VALID")));
138
+ }), V("VALID")));
138
139
  }).catch((e) => {
139
- Ce(i, K, r) || (H("UNAVAILABLE"), U(ae(e) ?? "選項來源暫時無法使用。"));
140
+ Ce(i, G, r) || (V("UNAVAILABLE"), H(ie(e) ?? "選項來源暫時無法使用。"));
140
141
  });
141
142
  }, [
142
143
  T,
@@ -148,9 +149,9 @@ function K(e) {
148
149
  m,
149
150
  C,
150
151
  h
151
- ]), Ae = a(ke);
152
- Ae.current = ke, r(() => {
153
- G.current += 1, q.current?.abort(), P((e) => B(x, e)), R((e) => e === null ? e : null), ce((e) => e && ""), U((e) => e && null), t ? j ? Q.current("", null) : H(A) : H("IDLE");
152
+ ]), Q = a(Ae);
153
+ Q.current = Ae, r(() => {
154
+ W.current += 1, K.current?.abort(), F((e) => le(x, e)), z((e) => e === null ? e : null), se((e) => e && ""), H((e) => e && null), t ? j ? ke.current("", null) : V(A) : V("IDLE");
154
155
  }, [
155
156
  j,
156
157
  l,
@@ -163,24 +164,24 @@ function K(e) {
163
164
  A,
164
165
  u
165
166
  ]), r(() => {
166
- k && Ae.current();
167
+ k && Q.current();
167
168
  }, [
168
169
  T,
169
170
  E,
170
171
  k
171
172
  ]), r(() => () => {
172
- q.current?.abort(), J.current?.abort();
173
+ K.current?.abort(), q.current?.abort();
173
174
  }, []);
174
175
  let je = n((e) => {
175
- ce(e), P((e) => B(x, e)), R(null), Z(e, null);
176
+ se(e), F((e) => le(x, e)), z(null), Z(e, null);
176
177
  }, [Z]), Me = n(() => {
177
- L && Z(I, L);
178
+ R && Z(L, R);
178
179
  }, [
179
180
  Z,
180
- L,
181
- I
181
+ R,
182
+ L
182
183
  ]), Ne = n(() => {
183
- E && (Z(_e.current.searchText, _e.current.cursor), k && Ae.current());
184
+ E && (Z(J.current.searchText, J.current.cursor), k && Q.current());
184
185
  }, [
185
186
  E,
186
187
  Z,
@@ -188,9 +189,9 @@ function K(e) {
188
189
  ]);
189
190
  return t ? {
190
191
  canRetry: !!E,
191
- error: pe,
192
+ error: me,
192
193
  hasValue: w,
193
- hasNextPage: !!L,
194
+ hasNextPage: !!R,
194
195
  invalidValues: Oe,
195
196
  onReachBottom: Me,
196
197
  onSearch: je,
@@ -199,11 +200,11 @@ function K(e) {
199
200
  status: Se({
200
201
  invalidValues: Oe,
201
202
  resolvePending: De,
202
- status: fe
203
+ status: pe
203
204
  })
204
- } : me;
205
+ } : he;
205
206
  }
206
- function q(e) {
207
+ function J(e) {
207
208
  switch (e.status) {
208
209
  case "WAITING_FOR_DEPENDENCIES": return "請先填寫相依欄位。";
209
210
  case "STALE": return "選項需要重新載入或驗證。";
@@ -213,15 +214,15 @@ function q(e) {
213
214
  default: return e.error;
214
215
  }
215
216
  }
216
- function J(e) {
217
+ function Y(e) {
217
218
  return e.hasValue && e.status !== "VALID";
218
219
  }
219
- function _e(e) {
220
- let t = e.filter(J);
220
+ function X(e) {
221
+ let t = e.filter(Y);
221
222
  return t.length === 0 ? null : t.every((e) => e.status === "LOADING" || e.status === "STALE") ? "選項驗證中,請稍候再送出。" : "請先完成動態選項驗證。";
222
223
  }
223
224
  function ve(e) {
224
- return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ? G : R(e.value, e.options);
225
+ return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ? K : z(e.value, e.options);
225
226
  }
226
227
  function ye(e) {
227
228
  return e.isStale ? "STALE" : e.hasSnapshot ? "VALID" : e.readonly && e.hasValue ? "UNAVAILABLE" : "IDLE";
@@ -244,35 +245,34 @@ function we(e) {
244
245
  [t]: n
245
246
  }, {});
246
247
  }
247
- //#endregion
248
- //#region src/views/forms/renderer/form-field-link.ts
249
- var Y = /\s/u;
250
- function X(e) {
248
+ // src/views/forms/renderer/form-field-link.ts
249
+ var Te = /\s/u;
250
+ function Ee(e) {
251
251
  return [...e].some((e) => {
252
252
  let t = e.codePointAt(0) ?? 0;
253
- return t <= 32 || t >= 127 && t <= 160 || Y.test(e);
253
+ return t <= 32 || t >= 127 && t <= 160 || Te.test(e);
254
254
  });
255
255
  }
256
- var Te = /^https?:\/\//iu;
257
- function Ee(e) {
258
- return typeof e != "string" || !e || e.includes("\\") || X(e) ? null : e.startsWith("/") ? !e.startsWith("//") && Oe(e) ? {
256
+ var De = /^https?:\/\//iu;
257
+ function Oe(e) {
258
+ return typeof e != "string" || !e || e.includes("\\") || Ee(e) ? null : e.startsWith("/") ? !e.startsWith("//") && ke(e) ? {
259
259
  external: !1,
260
260
  href: e
261
- } : null : Te.test(e) && Z(e) ? {
261
+ } : null : De.test(e) && Ae(e) ? {
262
262
  external: !0,
263
263
  href: e
264
264
  } : null;
265
265
  }
266
- var De = "http://placeholder.invalid";
267
- function Oe(e) {
266
+ var Z = "http://placeholder.invalid";
267
+ function ke(e) {
268
268
  try {
269
- let t = new URL(e, De);
270
- return t.origin === De && !t.pathname.startsWith("//");
269
+ let t = new URL(e, Z);
270
+ return t.origin === Z && !t.pathname.startsWith("//");
271
271
  } catch {
272
272
  return !1;
273
273
  }
274
274
  }
275
- function Z(e) {
275
+ function Ae(e) {
276
276
  try {
277
277
  let t = new URL(e);
278
278
  return (t.protocol === "http:" || t.protocol === "https:") && !!t.hostname && !t.username && !t.password;
@@ -295,17 +295,17 @@ async function Q(e, t, n = {}) {
295
295
  skippedIds: []
296
296
  };
297
297
  }
298
- let a = e.slice(0, r), o = await Ae(a, i, (e) => t([e]));
298
+ let a = e.slice(0, r), o = await Me(a, i, (e) => t([e]));
299
299
  return {
300
300
  failedIds: a.filter((e, t) => o[t].status === "rejected"),
301
301
  profiles: o.flatMap((e) => e.status === "fulfilled" ? e.value : []),
302
302
  skippedIds: e.slice(r)
303
303
  };
304
304
  }
305
- function ke(e, t) {
305
+ function je(e, t) {
306
306
  return e.filter((e) => !t.has(e));
307
307
  }
308
- async function Ae(e, t, n) {
308
+ async function Me(e, t, n) {
309
309
  let r = [], i = 0;
310
310
  async function a() {
311
311
  for (; i < e.length;) {
@@ -321,46 +321,44 @@ async function Ae(e, t, n) {
321
321
  }
322
322
  return await Promise.all(Array.from({ length: Math.min(t, e.length) }, a)), r;
323
323
  }
324
- //#endregion
325
- //#region src/views/forms/renderer/member-field-options.ts
326
- var je = "未知會員";
327
- function Me(e) {
324
+ // src/views/forms/renderer/member-field-options.ts
325
+ var Ne = "未知會員";
326
+ function Pe(e) {
328
327
  return {
329
328
  id: e.memberId,
330
329
  name: t(e.name, e.email)
331
330
  };
332
331
  }
333
- function Ne(e) {
332
+ function Fe(e) {
334
333
  return {
335
334
  id: e,
336
- name: je,
335
+ name: Ne,
337
336
  unresolved: !0
338
337
  };
339
338
  }
340
- function Pe(e, t) {
339
+ function Ie(e, t) {
341
340
  let n = new Map(t.filter((e) => !e.unresolved).map((e) => [e.id, e])), r = new Set(e.map((e) => e.id)), i = t.filter((e, n) => !r.has(e.id) && t.findIndex((t) => t.id === e.id) === n), a = e.map((e) => (e.unresolved ? n.get(e.id) : void 0) ?? e);
342
341
  return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
343
342
  }
344
- function Fe(e, t) {
343
+ function Le(e, t) {
345
344
  let n = new Set(t.filter((e) => !e.unresolved).map((e) => e.id));
346
- return W(e).filter((e) => !n.has(e));
345
+ return U(e).filter((e) => !n.has(e));
347
346
  }
348
- function Ie(e, t) {
349
- return W(e).map((e) => t.find((t) => t.id === e) ?? Ne(e));
347
+ function Re(e, t) {
348
+ return U(e).map((e) => t.find((t) => t.id === e) ?? Fe(e));
350
349
  }
351
- function Le(e, t) {
350
+ function ze(e, t) {
352
351
  if (e.length !== 0) return t ? e.map((e) => e.id) : e[0]?.id;
353
352
  }
354
- //#endregion
355
- //#region src/views/forms/renderer/member-field.tsx
356
- function Re({ multiple: e, name: t, onChange: n, placeholder: i, readonly: c, size: l, value: u }) {
357
- let [d, f] = o([]), [p, m] = o([]), [h, g] = o(!1), _ = a(0), v = a(/* @__PURE__ */ new Set()), y = Fe(u, d).join("\n");
353
+ // src/views/forms/renderer/member-field.tsx
354
+ function Be({ multiple: e, name: t, onChange: n, placeholder: i, readonly: c, size: l, value: u }) {
355
+ let [d, f] = o([]), [p, m] = o([]), [h, g] = o(!1), _ = a(0), v = a(/* @__PURE__ */ new Set()), y = Le(u, d).join("\n");
358
356
  r(() => {
359
- let e = ke(y ? y.split("\n") : [], v.current), t = !1;
357
+ let e = je(y ? y.split("\n") : [], v.current), t = !1;
360
358
  return e.length === 0 ? () => void 0 : (Q(e, b).then(({ profiles: n, skippedIds: r }) => {
361
359
  if (t) return;
362
- let i = n.map(Me), a = e.filter((e) => !i.some((t) => t.id === e)).map(Ne);
363
- a.filter((e) => !r.includes(e.id)).forEach((e) => v.current.add(e.id)), f((e) => Pe(e, [...i, ...a]));
360
+ let i = n.map(Pe), a = e.filter((e) => !i.some((t) => t.id === e)).map(Fe);
361
+ a.filter((e) => !r.includes(e.id)).forEach((e) => v.current.add(e.id)), f((e) => Ie(e, [...i, ...a]));
364
362
  }), () => {
365
363
  t = !0;
366
364
  });
@@ -369,15 +367,15 @@ function Re({ multiple: e, name: t, onChange: n, placeholder: i, readonly: c, si
369
367
  let t = _.current + 1;
370
368
  _.current = t, g(!0);
371
369
  try {
372
- let n = (await x(e)).map(Me);
373
- _.current === t && (m(n), f((e) => Pe(e, n)));
370
+ let n = (await x(e)).map(Pe);
371
+ _.current === t && (m(n), f((e) => Ie(e, n)));
374
372
  } catch {
375
373
  _.current === t && m([]);
376
374
  } finally {
377
375
  _.current === t && g(!1);
378
376
  }
379
377
  }
380
- let w = Ie(u, d), T = [...Pe(w, p)], E = {
378
+ let w = Re(u, d), T = [...Ie(w, p)], E = {
381
379
  asyncData: !0,
382
380
  clearSearchText: !0,
383
381
  disabled: c,
@@ -405,40 +403,146 @@ function Re({ multiple: e, name: t, onChange: n, placeholder: i, readonly: c, si
405
403
  return e ? /* @__PURE__ */ S(s, {
406
404
  ...E,
407
405
  mode: "multiple",
408
- onChange: (e) => n(Le(e, !0)),
406
+ onChange: (e) => n(ze(e, !0)),
409
407
  value: [...w]
410
408
  }) : /* @__PURE__ */ S(s, {
411
409
  ...E,
412
410
  mode: "single",
413
- onChange: (e) => n(Le(e ? [e] : [], !1)),
411
+ onChange: (e) => n(ze(e ? [e] : [], !1)),
414
412
  value: w[0] ?? null
415
413
  });
416
414
  }
417
- //#endregion
418
- //#region src/views/forms/renderer/FormRendererView.tsx
419
- var ze = {
415
+ // src/views/forms/renderer/org-unit-field-options.ts
416
+ var Ve = "未知組織", He = "(已刪除)";
417
+ function Ue(e) {
418
+ return {
419
+ id: e.id,
420
+ name: e.deleted ? `${e.name}${He}` : e.name
421
+ };
422
+ }
423
+ function We(e) {
424
+ return {
425
+ id: e,
426
+ name: e,
427
+ unresolved: !0
428
+ };
429
+ }
430
+ function Ge(e) {
431
+ return {
432
+ id: e,
433
+ name: Ve,
434
+ unresolved: !0
435
+ };
436
+ }
437
+ function Ke(e) {
438
+ return typeof e == "string" && e.trim() ? e : null;
439
+ }
440
+ function $(e) {
441
+ return e.toLowerCase();
442
+ }
443
+ function qe(e, t) {
444
+ return $(e) === $(t);
445
+ }
446
+ function Je(e, t) {
447
+ let n = Ke(e);
448
+ return n === null ? null : t.find((e) => qe(e.id, n)) ?? We(n);
449
+ }
450
+ function Ye(e, t) {
451
+ let n = Ke(e);
452
+ return n !== null && !t.some((e) => qe(e.id, n)) ? n : null;
453
+ }
454
+ function Xe(e, t) {
455
+ let n = new Map(t.filter((e) => !e.unresolved).map((e) => [$(e.id), e])), r = new Set(e.map((e) => $(e.id))), i = t.filter((e, n) => !r.has($(e.id)) && t.findIndex((t) => qe(t.id, e.id)) === n), a = e.map((e) => (e.unresolved ? n.get($(e.id)) : void 0) ?? e);
456
+ return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
457
+ }
458
+ function Ze(e) {
459
+ return e ? e.id : void 0;
460
+ }
461
+ // src/views/forms/renderer/org-unit-field.tsx
462
+ var Qe = "搜尋組織失敗,請稍後再試。";
463
+ function $e({ name: e, onChange: t, placeholder: n, readonly: i, size: c, value: l }) {
464
+ let [u, d] = o([]), [f, p] = o([]), [m, h] = o(!1), [g, _] = o(!1), y = a(0), b = Ye(l, u);
465
+ r(() => {
466
+ let e = !1;
467
+ return b === null ? () => void 0 : (W([b]).then((e) => {
468
+ let t = e.map(Ue);
469
+ return t.some((e) => e.id.toLowerCase() === b.toLowerCase()) ? t : [...t, Ge(b)];
470
+ }).catch(() => [Ge(b)]).then((t) => {
471
+ e || d((e) => Xe(e, t));
472
+ }), () => {
473
+ e = !0;
474
+ });
475
+ }, [b]);
476
+ async function x(e) {
477
+ let t = y.current + 1;
478
+ y.current = t, h(!0);
479
+ try {
480
+ let n = (await G(e)).map(Ue);
481
+ y.current === t && (p(n), _(!1), d((e) => Xe(e, n)));
482
+ } catch {
483
+ y.current === t && (p([]), _(!0));
484
+ } finally {
485
+ y.current === t && h(!1);
486
+ }
487
+ }
488
+ let w = Je(l, u), T = [...Xe(w ? [w] : [], f)];
489
+ return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(s, {
490
+ asyncData: !0,
491
+ clearSearchText: !0,
492
+ disabled: i,
493
+ disabledOptionsFilter: !0,
494
+ emptyText: "沒有符合的組織",
495
+ globalPortal: !0,
496
+ inputProps: {
497
+ autoCapitalize: "none",
498
+ autoCorrect: "off",
499
+ name: e,
500
+ spellCheck: !1
501
+ },
502
+ loading: m,
503
+ loadingText: "搜尋組織中...",
504
+ mode: "single",
505
+ onChange: (e) => t(Ze(e ?? null)),
506
+ onSearch: x,
507
+ onVisibilityChange: (e) => {
508
+ e && (p([]), x(""));
509
+ },
510
+ options: T,
511
+ placeholder: n ?? "搜尋組織名稱",
512
+ readOnly: i,
513
+ searchDebounceTime: 300,
514
+ size: c,
515
+ value: w
516
+ }), g ? /* @__PURE__ */ S(v, {
517
+ color: "text-error",
518
+ variant: "caption",
519
+ children: Qe
520
+ }) : null] });
521
+ }
522
+ // src/views/forms/renderer/FormRendererView.tsx
523
+ var et = {
420
524
  alignItems: "start",
421
525
  display: "grid",
422
526
  gap: 12,
423
527
  gridTemplateColumns: "repeat(12, minmax(0, 1fr))"
424
- }, Be = { gridColumn: "1 / -1" }, Ve = {
528
+ }, tt = { gridColumn: "1 / -1" }, nt = {
425
529
  alignItems: "start",
426
530
  display: "grid",
427
531
  gap: 8,
428
532
  minWidth: 0
429
- }, He = {
533
+ }, rt = {
430
534
  minWidth: "100%",
431
535
  width: "100%"
432
536
  };
433
- function Ue(e) {
537
+ function it(e) {
434
538
  e && (e.style.width = "100%");
435
539
  }
436
- function We({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "尚未建立欄位。", errors: s = {}, fieldAccess: c, fieldLabelMarkers: l, maxWidth: u, onChange: d, onDataSourceStateChange: f, onUploadAttachment: p, optionSnapshots: m, readonly: h = !1, schema: g, singleColumn: _ = !1, uiSchema: y, value: b }) {
540
+ function at({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "尚未建立欄位。", errors: s = {}, fieldAccess: c, fieldLabelMarkers: l, maxWidth: u, onChange: d, onDataSourceStateChange: f, onUploadAttachment: p, optionSnapshots: m, readonly: h = !1, schema: g, singleColumn: _ = !1, uiSchema: y, value: b }) {
437
541
  let [x, C] = o(() => E(g.fields, b ?? {})), w = i(() => E(g.fields, b ?? x), [
438
542
  x,
439
543
  g.fields,
440
544
  b
441
- ]), T = a(w), D = i(() => ue(g, y, w).filter((e) => Ge(c, e.fieldKey)?.visible !== !1), [
545
+ ]), T = a(w), D = i(() => ue(g, y, w).filter((e) => ot(c, e.fieldKey)?.visible !== !1), [
442
546
  c,
443
547
  g,
444
548
  y,
@@ -458,10 +562,10 @@ function We({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "
458
562
  }
459
563
  return D.length ? /* @__PURE__ */ S("div", {
460
564
  style: {
461
- ...ze,
565
+ ...et,
462
566
  ..._ ? { width: "100%" } : {}
463
567
  },
464
- children: D.map((n) => /* @__PURE__ */ S(qe, {
568
+ children: D.map((n) => /* @__PURE__ */ S(ct, {
465
569
  dataSourceContext: e,
466
570
  dataSourceInitialValues: t,
467
571
  field: n,
@@ -473,35 +577,35 @@ function We({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "
473
577
  onDataSourceStateChange: f,
474
578
  onUploadAttachment: p,
475
579
  optionSnapshots: m,
476
- readonly: Ke(Ge(c, n.fieldKey), h),
580
+ readonly: st(ot(c, n.fieldKey), h),
477
581
  schema: g,
478
582
  style: {
479
- ...Ve,
480
- gridColumn: `span ${_ ? 12 : pt(n, y)}`,
481
- ..._ && !pe(n) ? { maxWidth: u } : {}
583
+ ...nt,
584
+ gridColumn: `span ${_ ? 12 : Ot(n, y)}`,
585
+ ..._ && !me(n) ? { maxWidth: u } : {}
482
586
  },
483
587
  value: w[n.fieldKey],
484
588
  values: w,
485
589
  uiSchema: y
486
590
  }, n.fieldKey))
487
591
  }) : /* @__PURE__ */ S("div", {
488
- style: ze,
592
+ style: et,
489
593
  children: /* @__PURE__ */ S(v, {
490
594
  color: "text-neutral",
491
- style: Be,
595
+ style: tt,
492
596
  variant: "body",
493
597
  children: g.fields.length > 0 ? "目前條件下沒有可填寫欄位。" : n
494
598
  })
495
599
  });
496
600
  }
497
- function Ge(e, t) {
601
+ function ot(e, t) {
498
602
  return e !== void 0 && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
499
603
  }
500
- function Ke(e, t) {
604
+ function st(e, t) {
501
605
  return e === void 0 ? t : !e.editable;
502
606
  }
503
- function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors: a, field: o, fields: s, labelMarker: l, onChange: u, onDataSourceStateChange: d, onUploadAttachment: f, optionSnapshots: p, readonly: m, schema: h, style: g, value: _, values: y, uiSchema: b }) {
504
- let x = j(o, s, y), w = m || A(o, s, y), T = K({
607
+ function ct({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors: a, field: o, fields: s, labelMarker: l, onChange: u, onDataSourceStateChange: d, onUploadAttachment: f, optionSnapshots: p, readonly: m, schema: h, style: g, value: _, values: y, uiSchema: b }) {
608
+ let x = j(o, s, y), w = m || A(o, s, y), T = q({
505
609
  context: t,
506
610
  field: o,
507
611
  formData: y,
@@ -511,13 +615,13 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
511
615
  readonly: w,
512
616
  schema: h,
513
617
  uiSchema: b
514
- }), E = q(T), D = JSON.stringify({
618
+ }), E = J(T), D = JSON.stringify({
515
619
  hasValue: T.hasValue,
516
620
  invalidValues: T.invalidValues,
517
621
  status: T.status
518
622
  });
519
623
  return r(() => {
520
- V(o) && d?.(o.fieldKey, {
624
+ fe(o) && d?.(o.fieldKey, {
521
625
  hasValue: T.hasValue,
522
626
  invalidValues: T.invalidValues,
523
627
  status: T.status
@@ -535,7 +639,7 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
535
639
  ...l ? { labelOptionalMarker: l } : {},
536
640
  name: o.fieldKey,
537
641
  required: x,
538
- children: pe(o) ? /* @__PURE__ */ S(it, {
642
+ children: me(o) ? /* @__PURE__ */ S(yt, {
539
643
  dataSourceContext: t,
540
644
  dataSourceInitialValues: n,
541
645
  errors: a,
@@ -548,7 +652,7 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
548
652
  uiSchema: b,
549
653
  value: _,
550
654
  values: y
551
- }) : ut(o, _, w, u, f, t, T)
655
+ }) : Tt(o, _, w, u, f, t, T)
552
656
  }),
553
657
  i ? /* @__PURE__ */ S(v, {
554
658
  color: "text-error",
@@ -556,7 +660,7 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
556
660
  children: i
557
661
  }) : null,
558
662
  E ? /* @__PURE__ */ C("div", {
559
- style: Ze,
663
+ style: ft,
560
664
  children: [/* @__PURE__ */ S(v, {
561
665
  color: T.status === "INVALID" || T.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
562
666
  variant: "caption",
@@ -572,46 +676,46 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
572
676
  ]
573
677
  });
574
678
  }
575
- var Je = "(另開新分頁)", Ye = "另開新分頁", Xe = {
679
+ var lt = "(另開新分頁)", ut = "另開新分頁", dt = {
576
680
  color: "inherit",
577
681
  textDecoration: "underline",
578
682
  wordBreak: "break-all"
579
- }, Ze = {
683
+ }, ft = {
580
684
  alignItems: "center",
581
685
  display: "flex",
582
686
  gap: 8
583
- }, Qe = {
687
+ }, pt = {
584
688
  display: "grid",
585
689
  gap: 8,
586
690
  minWidth: 0,
587
691
  width: "100%"
588
- }, $e = {
692
+ }, mt = {
589
693
  display: "flex",
590
694
  justifyContent: "flex-start"
591
- }, et = {
695
+ }, ht = {
592
696
  maxWidth: "100%",
593
697
  overflowX: "auto"
594
- }, tt = 160, nt = 56, rt = {
698
+ }, gt = 160, _t = 56, vt = {
595
699
  display: "grid",
596
700
  gap: 4,
597
701
  minWidth: 0
598
702
  };
599
- function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field: i, onChange: s, onDataSourceStateChange: l, optionSnapshots: u, readonly: d, schema: f, uiSchema: p, value: m, values: g }) {
600
- let _ = L(m), v = ce(i), y = a(0), [b, x] = o(() => _.map(() => st(y)));
703
+ function yt({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field: i, onChange: s, onDataSourceStateChange: l, optionSnapshots: u, readonly: d, schema: f, uiSchema: p, value: m, values: g }) {
704
+ let _ = R(m), v = se(i), y = a(0), [b, x] = o(() => _.map(() => St(y)));
601
705
  r(() => {
602
- b.length !== _.length && x(_.map(() => st(y)));
706
+ b.length !== _.length && x(_.map(() => St(y)));
603
707
  }, [b.length, _.length]);
604
708
  function E(e) {
605
709
  s(i.fieldKey, e);
606
710
  }
607
711
  function D() {
608
- x([...b, st(y)]), E([..._, ee(i.columns)]);
712
+ x([...b, St(y)]), E([..._, ee(i.columns)]);
609
713
  }
610
714
  function O(e) {
611
715
  x(b.filter((t, n) => n !== e)), E(_.filter((t, n) => n !== e));
612
716
  }
613
717
  function k(e, t, n) {
614
- E(_.map((r, i) => i === e ? ct(r, t, n) : r));
718
+ E(_.map((r, i) => i === e ? Ct(r, t, n) : r));
615
719
  }
616
720
  let A = _.map((e, t) => ({
617
721
  ...e,
@@ -619,18 +723,18 @@ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
619
723
  key: b[t] ?? `row-${t}`
620
724
  })), j = i.columns.map((r) => ({
621
725
  key: r.fieldKey,
622
- render: (a) => /* @__PURE__ */ S(at, {
726
+ render: (a) => /* @__PURE__ */ S(bt, {
623
727
  column: r,
624
728
  dataSourceContext: e,
625
- error: n[I(i.fieldKey, a.index, r.fieldKey)] ?? null,
729
+ error: n[L(i.fieldKey, a.index, r.fieldKey)] ?? null,
626
730
  fieldPath: `${i.fieldKey}.${r.fieldKey}`,
627
731
  formData: g,
628
732
  initialFormData: t,
629
- initialRowValues: ot(t?.[i.fieldKey], a.index),
733
+ initialRowValues: xt(t?.[i.fieldKey], a.index),
630
734
  onChange: (e) => k(a.index, r.fieldKey, e),
631
735
  onDataSourceStateChange: l,
632
736
  optionSnapshots: u,
633
- path: I(i.fieldKey, a.index, r.fieldKey),
737
+ path: L(i.fieldKey, a.index, r.fieldKey),
634
738
  readonly: d,
635
739
  rowValues: _[a.index] ?? {},
636
740
  schema: f,
@@ -649,11 +753,11 @@ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
649
753
  width: 56
650
754
  };
651
755
  return /* @__PURE__ */ C("div", {
652
- style: Qe,
756
+ style: pt,
653
757
  children: [/* @__PURE__ */ S("div", {
654
- style: et,
758
+ style: ht,
655
759
  children: /* @__PURE__ */ S("div", {
656
- style: { minWidth: i.columns.length * tt + (M ? nt : 0) },
760
+ style: { minWidth: i.columns.length * gt + (M ? _t : 0) },
657
761
  children: /* @__PURE__ */ S(h, {
658
762
  ...M ? { actions: M } : {},
659
763
  columns: j,
@@ -664,7 +768,7 @@ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
664
768
  })
665
769
  })
666
770
  }), d ? null : /* @__PURE__ */ S("div", {
667
- style: $e,
771
+ style: mt,
668
772
  children: /* @__PURE__ */ S(c, {
669
773
  disabled: _.length >= v.maxRows,
670
774
  icon: w,
@@ -678,14 +782,14 @@ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
678
782
  })]
679
783
  });
680
784
  }
681
- function at({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData: a, initialFormData: o, initialRowValues: s, onChange: l, onDataSourceStateChange: u, optionSnapshots: d, path: f, readonly: p, rowValues: m, schema: h, uiSchema: g }) {
682
- let _ = lt(m, e.fieldKey), y = K({
785
+ function bt({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData: a, initialFormData: o, initialRowValues: s, onChange: l, onDataSourceStateChange: u, optionSnapshots: d, path: f, readonly: p, rowValues: m, schema: h, uiSchema: g }) {
786
+ let _ = wt(m, e.fieldKey), y = q({
683
787
  context: t,
684
788
  field: e,
685
789
  fieldPath: i,
686
790
  formData: a,
687
791
  initialFormData: o,
688
- initialValue: s ? lt(s, e.fieldKey) : void 0,
792
+ initialValue: s ? wt(s, e.fieldKey) : void 0,
689
793
  optionSnapshots: d,
690
794
  readonly: p,
691
795
  row: {
@@ -695,13 +799,13 @@ function at({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
695
799
  schema: h,
696
800
  snapshotKey: f,
697
801
  uiSchema: g
698
- }), b = q(y), x = JSON.stringify({
802
+ }), b = J(y), x = JSON.stringify({
699
803
  hasValue: y.hasValue,
700
804
  invalidValues: y.invalidValues,
701
805
  status: y.status
702
806
  });
703
807
  return r(() => {
704
- if (V(e)) return u?.(f, {
808
+ if (fe(e)) return u?.(f, {
705
809
  hasValue: y.hasValue,
706
810
  invalidValues: y.invalidValues,
707
811
  status: y.status
@@ -718,16 +822,16 @@ function at({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
718
822
  x
719
823
  ]), /* @__PURE__ */ C("div", {
720
824
  "data-form-field-key": f,
721
- style: rt,
825
+ style: vt,
722
826
  children: [
723
- ut(e, _, p, (e, t) => l(t), void 0, t, y, "sub"),
827
+ Tt(e, _, p, (e, t) => l(t), void 0, t, y, "sub"),
724
828
  n ? /* @__PURE__ */ S(v, {
725
829
  color: "text-error",
726
830
  variant: "caption",
727
831
  children: n
728
832
  }) : null,
729
833
  b ? /* @__PURE__ */ C("div", {
730
- style: Ze,
834
+ style: ft,
731
835
  children: [/* @__PURE__ */ S(v, {
732
836
  color: y.status === "INVALID" || y.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
733
837
  variant: "caption",
@@ -743,38 +847,38 @@ function at({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
743
847
  ]
744
848
  });
745
849
  }
746
- function ot(e, t) {
747
- return L(e)[t];
850
+ function xt(e, t) {
851
+ return R(e)[t];
748
852
  }
749
- function st(e) {
853
+ function St(e) {
750
854
  return e.current += 1, `table-row-${e.current}`;
751
855
  }
752
- function ct(e, t, n) {
753
- return n === void 0 || !H(n) ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {
856
+ function Ct(e, t, n) {
857
+ return n === void 0 || !V(n) ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {
754
858
  ...e,
755
859
  [t]: n
756
860
  };
757
861
  }
758
- function lt(e, t) {
862
+ function wt(e, t) {
759
863
  if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
760
864
  }
761
- function ut(e, t, n, r, i, a, o, s = "main") {
762
- return V(e) ? ft(e, t, n, r, a, o, s) : dt(e, t, n, r, i, s);
865
+ function Tt(e, t, n, r, i, a, o, s = "main") {
866
+ return fe(e) ? Dt(e, t, n, r, a, o, s) : Et(e, t, n, r, i, s);
763
867
  }
764
- function dt(e, t, n, r, i, a = "main") {
765
- let o = n && (e.type === "text" || e.type === "textarea") && e.displayAs === "link" ? Ee(t) : null;
868
+ function Et(e, t, n, r, i, a = "main") {
869
+ let o = n && (e.type === "text" || e.type === "textarea") && e.displayAs === "link" ? Oe(t) : null;
766
870
  if (o) return /* @__PURE__ */ S(v, {
767
871
  color: "text-brand",
768
872
  component: "span",
769
873
  variant: "body",
770
874
  children: /* @__PURE__ */ S("a", {
771
875
  href: o.href,
772
- style: Xe,
876
+ style: dt,
773
877
  ...o.external ? {
774
- "aria-label": `${o.href}${Je}`,
878
+ "aria-label": `${o.href}${lt}`,
775
879
  rel: "noopener noreferrer",
776
880
  target: "_blank",
777
- title: Ye
881
+ title: ut
778
882
  } : {},
779
883
  children: o.href
780
884
  })
@@ -783,10 +887,10 @@ function dt(e, t, n, r, i, a = "main") {
783
887
  onChange: (t) => r(e.fieldKey, t.target.value),
784
888
  placeholder: e.placeholder ?? "請輸入多行文字",
785
889
  readOnly: n,
786
- ref: Ue,
890
+ ref: it,
787
891
  rows: 3,
788
- style: He,
789
- value: $(t)
892
+ style: rt,
893
+ value: kt(t)
790
894
  });
791
895
  if (e.type === "boolean") return /* @__PURE__ */ S(_, {
792
896
  checked: t === !0,
@@ -795,8 +899,8 @@ function dt(e, t, n, r, i, a = "main") {
795
899
  onChange: (t) => r(e.fieldKey, t.target.checked),
796
900
  size: a
797
901
  });
798
- if (fe(e) && e.type === "checkbox") {
799
- let i = e.options.map(P);
902
+ if (pe(e) && e.type === "checkbox") {
903
+ let i = e.options.map(F);
800
904
  return /* @__PURE__ */ S(m, {
801
905
  mode: "multiple",
802
906
  onChange: (t) => r(e.fieldKey, t?.length ? t.map((e) => e.id) : void 0),
@@ -804,21 +908,21 @@ function dt(e, t, n, r, i, a = "main") {
804
908
  placeholder: e.placeholder ?? "請選擇一或多個選項",
805
909
  readOnly: n,
806
910
  size: a,
807
- value: i.filter((e) => mt(t).includes(e.id))
911
+ value: i.filter((e) => At(t).includes(e.id))
808
912
  });
809
913
  }
810
- if (fe(e)) {
811
- let i = e.options.map(P);
914
+ if (pe(e)) {
915
+ let i = e.options.map(F);
812
916
  return /* @__PURE__ */ S(m, {
813
917
  onChange: (t) => r(e.fieldKey, t?.id ?? void 0),
814
918
  options: i,
815
919
  placeholder: e.placeholder ?? "請選擇",
816
920
  readOnly: n,
817
921
  size: a,
818
- value: z(i, $(t))
922
+ value: B(i, kt(t))
819
923
  });
820
924
  }
821
- return e.type === "member" ? /* @__PURE__ */ S(Re, {
925
+ return e.type === "member" ? /* @__PURE__ */ S(Be, {
822
926
  multiple: e.multiple === !0,
823
927
  name: e.fieldKey,
824
928
  onChange: (t) => r(e.fieldKey, t),
@@ -826,6 +930,13 @@ function dt(e, t, n, r, i, a = "main") {
826
930
  readonly: n,
827
931
  size: a,
828
932
  value: t
933
+ }) : e.type === "org_unit" ? /* @__PURE__ */ S($e, {
934
+ name: e.fieldKey,
935
+ onChange: (t) => r(e.fieldKey, t),
936
+ placeholder: e.placeholder ?? Mt(e.type),
937
+ readonly: n,
938
+ size: a,
939
+ value: t
829
940
  }) : e.type === "file_upload" ? /* @__PURE__ */ S(y, {
830
941
  accept: e.acceptedMimeTypes?.join(","),
831
942
  disabled: n,
@@ -844,9 +955,9 @@ function dt(e, t, n, r, i, a = "main") {
844
955
  format: "YYYY-MM-DD",
845
956
  fullWidth: !0,
846
957
  onChange: (t) => r(e.fieldKey, O(t)),
847
- placeholder: e.placeholder ?? gt(e.type),
958
+ placeholder: e.placeholder ?? Mt(e.type),
848
959
  readOnly: n,
849
- value: re(t)
960
+ value: P(t)
850
961
  }) : e.type === "datetime" ? /* @__PURE__ */ S(d, {
851
962
  formatDate: "YYYY-MM-DD",
852
963
  formatTime: "HH:mm",
@@ -856,7 +967,7 @@ function dt(e, t, n, r, i, a = "main") {
856
967
  placeholderLeft: "選擇日期",
857
968
  placeholderRight: "選擇時間",
858
969
  readOnly: n,
859
- value: re(t)
970
+ value: P(t)
860
971
  }) : e.type === "number" || e.type === "money" ? /* @__PURE__ */ S(f, {
861
972
  fullWidth: !0,
862
973
  max: e.maximum,
@@ -866,24 +977,24 @@ function dt(e, t, n, r, i, a = "main") {
866
977
  max: e.maximum,
867
978
  min: e.minimum
868
979
  })),
869
- placeholder: e.placeholder ?? gt(e.type),
980
+ placeholder: e.placeholder ?? Mt(e.type),
870
981
  ...n ? { readonly: !0 } : {},
871
982
  showSpinner: !0,
872
- value: ht(t),
983
+ value: jt(t),
873
984
  variant: "measure"
874
985
  }) : /* @__PURE__ */ S(f, {
875
986
  fullWidth: !0,
876
987
  onChange: (t) => r(e.fieldKey, t.target.value),
877
- placeholder: e.placeholder ?? gt(e.type),
988
+ placeholder: e.placeholder ?? Mt(e.type),
878
989
  ...n ? { readonly: !0 } : {},
879
990
  size: a,
880
- value: $(t),
991
+ value: kt(t),
881
992
  variant: "base"
882
993
  });
883
994
  }
884
- function ft(e, t, n, r, i, a, o = "main") {
885
- let c = a.options.map(P), u = B(t, a.options).map(P), d = a.status === "LOADING", f = a.status === "WAITING_FOR_DEPENDENCIES", h = !!i && !n, g = n || f, _ = n;
886
- return e.type === "autocomplete" ? U(e) === "multiple" ? /* @__PURE__ */ S(s, {
995
+ function Dt(e, t, n, r, i, a, o = "main") {
996
+ let c = a.options.map(F), u = le(t, a.options).map(F), d = a.status === "LOADING", f = a.status === "WAITING_FOR_DEPENDENCIES", h = !!i && !n, g = n || f, _ = n;
997
+ return e.type === "autocomplete" ? H(e) === "multiple" ? /* @__PURE__ */ S(s, {
887
998
  asyncData: h,
888
999
  clearSearchText: !0,
889
1000
  disabled: _,
@@ -922,7 +1033,7 @@ function ft(e, t, n, r, i, a, o = "main") {
922
1033
  name: e.fieldKey,
923
1034
  onChange: (t) => r(e.fieldKey, t.target.value || void 0),
924
1035
  options: c,
925
- value: $(t)
1036
+ value: kt(t)
926
1037
  }) : e.type === "checkbox" ? /* @__PURE__ */ S(l, {
927
1038
  disabled: g,
928
1039
  name: e.fieldKey,
@@ -931,8 +1042,8 @@ function ft(e, t, n, r, i, a, o = "main") {
931
1042
  label: e.name,
932
1043
  value: e.id
933
1044
  })),
934
- value: [...mt(t)]
935
- }) : U(e) === "multiple" ? /* @__PURE__ */ S(m, {
1045
+ value: [...At(t)]
1046
+ }) : H(e) === "multiple" ? /* @__PURE__ */ S(m, {
936
1047
  disabled: g,
937
1048
  loading: d,
938
1049
  mode: "multiple",
@@ -955,23 +1066,23 @@ function ft(e, t, n, r, i, a, o = "main") {
955
1066
  value: u[0] ?? null
956
1067
  });
957
1068
  }
958
- function pt(e, t) {
1069
+ function Ot(e, t) {
959
1070
  return {
960
1071
  FULL: 12,
961
1072
  HALF: 6,
962
1073
  THIRD: 4
963
1074
  }[t.layout.find((t) => t.fieldKey === e.fieldKey)?.width ?? "FULL"];
964
1075
  }
965
- function $(e) {
1076
+ function kt(e) {
966
1077
  return typeof e == "string" ? e : "";
967
1078
  }
968
- function mt(e) {
1079
+ function At(e) {
969
1080
  return Array.isArray(e) && e.every((e) => typeof e == "string") ? e : [];
970
1081
  }
971
- function ht(e) {
1082
+ function jt(e) {
972
1083
  return typeof e == "number" ? String(e) : "";
973
1084
  }
974
- function gt(e) {
1085
+ function Mt(e) {
975
1086
  return {
976
1087
  boolean: "",
977
1088
  autocomplete: "請輸入或選擇",
@@ -982,6 +1093,7 @@ function gt(e) {
982
1093
  member: "搜尋姓名或信箱",
983
1094
  money: "請輸入金額",
984
1095
  number: "請輸入數字",
1096
+ org_unit: "搜尋組織名稱",
985
1097
  radio: "請選擇一個選項",
986
1098
  select: "請選擇一個選項",
987
1099
  table: "",
@@ -989,7 +1101,6 @@ function gt(e) {
989
1101
  textarea: "請輸入多行文字"
990
1102
  }[e];
991
1103
  }
992
- //#endregion
993
- export { q as a, J as i, ke as n, _e as o, Q as r, K as s, We as t };
1104
+ export { Y as a, q as c, Q as i, Ue as n, J as o, je as r, X as s, at as t };
994
1105
 
995
- //# sourceMappingURL=FormRendererView-BsTwZkqU.js.map
1106
+ //# sourceMappingURL=FormRendererView-CTLlG13b.js.map