@rytass/bpm-core-react 0.17.9 → 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 (275) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +8 -0
  3. package/dist/chunks/FormBuilderView-CHaAQL5v.cjs +3 -0
  4. package/dist/chunks/FormBuilderView-CHaAQL5v.cjs.map +1 -0
  5. package/dist/chunks/{FormBuilderView-ClLnQ1e_.js → FormBuilderView-vQfVc08Z.js} +493 -437
  6. package/dist/chunks/FormBuilderView-vQfVc08Z.js.map +1 -0
  7. package/dist/chunks/{FormRendererView-BsTwZkqU.js → FormRendererView-CTLlG13b.js} +300 -189
  8. package/dist/chunks/FormRendererView-CTLlG13b.js.map +1 -0
  9. package/dist/chunks/FormRendererView-ChmM_4Yc.cjs +4 -0
  10. package/dist/chunks/FormRendererView-ChmM_4Yc.cjs.map +1 -0
  11. package/dist/chunks/admin-pickers-BjbkBpSJ.cjs +2 -0
  12. package/dist/chunks/admin-pickers-BjbkBpSJ.cjs.map +1 -0
  13. package/dist/chunks/{admin-pickers-Djq3h-UR.js → admin-pickers-DfGxsjpp.js} +42 -42
  14. package/dist/chunks/admin-pickers-DfGxsjpp.js.map +1 -0
  15. package/dist/chunks/{approval-instance-list-page-CPXMP3PL.js → approval-instance-list-page-BnI4t5mD.js} +7 -8
  16. package/dist/chunks/{approval-instance-list-page-CPXMP3PL.js.map → approval-instance-list-page-BnI4t5mD.js.map} +1 -1
  17. package/dist/chunks/{approval-instance-list-page-ax0pm8bt.cjs → approval-instance-list-page-fqvmkBlg.cjs} +2 -2
  18. package/dist/chunks/{approval-instance-list-page-ax0pm8bt.cjs.map → approval-instance-list-page-fqvmkBlg.cjs.map} +1 -1
  19. package/dist/chunks/approver-filled-form-B4zPg9kz.cjs +2 -0
  20. package/dist/chunks/approver-filled-form-B4zPg9kz.cjs.map +1 -0
  21. package/dist/chunks/approver-filled-form-Bgazhbvd.js +112 -0
  22. package/dist/chunks/approver-filled-form-Bgazhbvd.js.map +1 -0
  23. package/dist/chunks/auth-provider-4BeCw7cI.cjs.map +1 -1
  24. package/dist/chunks/{auth-provider-B5oPmvk2.js → auth-provider-C2b-5mGt.js} +2 -3
  25. package/dist/chunks/{auth-provider-B5oPmvk2.js.map → auth-provider-C2b-5mGt.js.map} +1 -1
  26. package/dist/chunks/{bpm-form-field-Cao0rMol.js → bpm-form-field-9B-Det0u.js} +2 -3
  27. package/dist/chunks/{bpm-form-field-Cao0rMol.js.map → bpm-form-field-9B-Det0u.js.map} +1 -1
  28. package/dist/chunks/bpm-form-field-Bc6k4ZEO.cjs.map +1 -1
  29. package/dist/chunks/{categories-riC33J_j.js → categories-BAdxjNSA.js} +14 -15
  30. package/dist/chunks/{categories-riC33J_j.js.map → categories-BAdxjNSA.js.map} +1 -1
  31. package/dist/chunks/{categories-AxxhqjLZ.cjs → categories-DQUtVEiV.cjs} +2 -2
  32. package/dist/chunks/{categories-AxxhqjLZ.cjs.map → categories-DQUtVEiV.cjs.map} +1 -1
  33. package/dist/chunks/{compose-jnvnnVfN.js → compose-D9ipJpF_.js} +131 -148
  34. package/dist/chunks/compose-D9ipJpF_.js.map +1 -0
  35. package/dist/chunks/compose-DtfX8DQ9.cjs +2 -0
  36. package/dist/chunks/compose-DtfX8DQ9.cjs.map +1 -0
  37. package/dist/chunks/{dashboard-page-DdBvV6YI.js → dashboard-page-BoqNhjT_.js} +5 -6
  38. package/dist/chunks/{dashboard-page-DdBvV6YI.js.map → dashboard-page-BoqNhjT_.js.map} +1 -1
  39. package/dist/chunks/{dashboard-page-BWQBSGDq.cjs → dashboard-page-D7YJ3udk.cjs} +2 -2
  40. package/dist/chunks/{dashboard-page-BWQBSGDq.cjs.map → dashboard-page-D7YJ3udk.cjs.map} +1 -1
  41. package/dist/chunks/{delegations-MxF3uJGW.js → delegations-BfhCDz5e.js} +15 -16
  42. package/dist/chunks/{delegations-MxF3uJGW.js.map → delegations-BfhCDz5e.js.map} +1 -1
  43. package/dist/chunks/{delegations-Ckf03icM.cjs → delegations-BmFGcuhA.cjs} +2 -2
  44. package/dist/chunks/{delegations-Ckf03icM.cjs.map → delegations-BmFGcuhA.cjs.map} +1 -1
  45. package/dist/chunks/{delegations-V9HIe3_P.cjs → delegations-CcS0SHbf.cjs} +2 -2
  46. package/dist/chunks/{delegations-V9HIe3_P.cjs.map → delegations-CcS0SHbf.cjs.map} +1 -1
  47. package/dist/chunks/{delegations-xUt1tj8d.js → delegations-DBh5TT6G.js} +16 -17
  48. package/dist/chunks/{delegations-xUt1tj8d.js.map → delegations-DBh5TT6G.js.map} +1 -1
  49. package/dist/chunks/designer-Df79YzUn.cjs +65 -0
  50. package/dist/chunks/designer-Df79YzUn.cjs.map +1 -0
  51. package/dist/chunks/{designer-B8Gvew_k.js → designer-ubnZbP-A.js} +1779 -1360
  52. package/dist/chunks/designer-ubnZbP-A.js.map +1 -0
  53. package/dist/chunks/detail-BBC9kqXd.cjs +5 -0
  54. package/dist/chunks/detail-BBC9kqXd.cjs.map +1 -0
  55. package/dist/chunks/detail-C6XKZjlF.js +2665 -0
  56. package/dist/chunks/detail-C6XKZjlF.js.map +1 -0
  57. package/dist/chunks/{format-date-time-CB-LxzqT.js → format-date-time-B0LdmWg4.js} +2 -3
  58. package/dist/chunks/{format-date-time-CB-LxzqT.js.map → format-date-time-B0LdmWg4.js.map} +1 -1
  59. package/dist/chunks/format-date-time-D-cx5M8z.cjs.map +1 -1
  60. package/dist/chunks/{format-member-label-DudVI55w.js → format-member-label-C73FuP-d.js} +2 -3
  61. package/dist/chunks/{format-member-label-DudVI55w.js.map → format-member-label-C73FuP-d.js.map} +1 -1
  62. package/dist/chunks/format-member-label-t7ANTF62.cjs.map +1 -1
  63. package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +1 -1
  64. package/dist/chunks/{language-provider-B3cEbLe4.js → language-provider-phkWOapf.js} +2 -3
  65. package/dist/chunks/{language-provider-B3cEbLe4.js.map → language-provider-phkWOapf.js.map} +1 -1
  66. package/dist/chunks/{login-C6qlTC6F.js → login-D6cc3bo7.js} +4 -5
  67. package/dist/chunks/{login-C6qlTC6F.js.map → login-D6cc3bo7.js.map} +1 -1
  68. package/dist/chunks/{login-AtVxZBsC.cjs → login-uvVcltrS.cjs} +2 -2
  69. package/dist/chunks/{login-AtVxZBsC.cjs.map → login-uvVcltrS.cjs.map} +1 -1
  70. package/dist/chunks/notifications-Bc4mgSds.cjs.map +1 -1
  71. package/dist/chunks/{notifications-DJ5wzCye.js → notifications-Cvme5Qbl.js} +2 -3
  72. package/dist/chunks/{notifications-DJ5wzCye.js.map → notifications-Cvme5Qbl.js.map} +1 -1
  73. package/dist/chunks/orgs-B_2J2tLX.cjs +2 -0
  74. package/dist/chunks/{orgs-BeeDDWL1.cjs.map → orgs-B_2J2tLX.cjs.map} +1 -1
  75. package/dist/chunks/{orgs-8hje_l2n.js → orgs-DqxMds26.js} +48 -49
  76. package/dist/chunks/{orgs-8hje_l2n.js.map → orgs-DqxMds26.js.map} +1 -1
  77. package/dist/chunks/{providers-B_d5tbCL.js → providers-BbCs23sk.js} +21 -25
  78. package/dist/chunks/{providers-B_d5tbCL.js.map → providers-BbCs23sk.js.map} +1 -1
  79. package/dist/chunks/{providers-chuJvMgv.cjs → providers-D_KAgOOu.cjs} +2 -2
  80. package/dist/chunks/{providers-chuJvMgv.cjs.map → providers-D_KAgOOu.cjs.map} +1 -1
  81. package/dist/chunks/router-adapter--gYs13E8.cjs.map +1 -1
  82. package/dist/chunks/{router-adapter-DftlFTOd.js → router-adapter-CkxCyzf5.js} +2 -3
  83. package/dist/chunks/{router-adapter-DftlFTOd.js.map → router-adapter-CkxCyzf5.js.map} +1 -1
  84. package/dist/chunks/{routes-config-yZbESPlw.js → routes-config-BcNaWJWJ.js} +2 -3
  85. package/dist/chunks/{routes-config-yZbESPlw.js.map → routes-config-BcNaWJWJ.js.map} +1 -1
  86. package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
  87. package/dist/chunks/task-decision-3d17ZvZE.js +29 -0
  88. package/dist/chunks/task-decision-3d17ZvZE.js.map +1 -0
  89. package/dist/chunks/task-decision-CqZ4WQOC.cjs +2 -0
  90. package/dist/chunks/task-decision-CqZ4WQOC.cjs.map +1 -0
  91. package/dist/chunks/{use-bpm-member-D57LKe_u.js → use-bpm-member-BPzcNU1g.js} +3 -4
  92. package/dist/chunks/{use-bpm-member-D57LKe_u.js.map → use-bpm-member-BPzcNU1g.js.map} +1 -1
  93. package/dist/chunks/use-bpm-member-DpNAQtNC.cjs.map +1 -1
  94. package/dist/chunks/{users-Pl6hY5Y5.js → users-BBtiZ9QQ.js} +22 -25
  95. package/dist/chunks/{users-Pl6hY5Y5.js.map → users-BBtiZ9QQ.js.map} +1 -1
  96. package/dist/chunks/{users-O2L_M3BK.cjs → users-EqSzDhuj.cjs} +2 -2
  97. package/dist/chunks/{users-O2L_M3BK.cjs.map → users-EqSzDhuj.cjs.map} +1 -1
  98. package/dist/components/admin-picker-options.d.cts +11 -0
  99. package/dist/components/admin-picker-options.d.ts +11 -0
  100. package/dist/components/admin-pickers.d.cts +2 -11
  101. package/dist/components/admin-pickers.d.ts +2 -11
  102. package/dist/index.cjs +1 -1
  103. package/dist/index.cjs.map +1 -1
  104. package/dist/index.js +17 -19
  105. package/dist/index.js.map +1 -1
  106. package/dist/lib/task-decision.d.cts +16 -0
  107. package/dist/lib/task-decision.d.ts +16 -0
  108. package/dist/lib/use-org-unit-names.d.cts +10 -0
  109. package/dist/lib/use-org-unit-names.d.ts +10 -0
  110. package/dist/next/index.cjs +1 -1
  111. package/dist/next/index.cjs.map +1 -1
  112. package/dist/next/index.js +7 -8
  113. package/dist/next/index.js.map +1 -1
  114. package/dist/next/workflow-chat-route.cjs +19 -1
  115. package/dist/next/workflow-chat-route.cjs.map +1 -1
  116. package/dist/next/workflow-chat-route.js +2 -3
  117. package/dist/next/workflow-chat-route.js.map +1 -1
  118. package/dist/pages/admin/delegations/index.cjs +1 -1
  119. package/dist/pages/admin/delegations/index.cjs.map +1 -1
  120. package/dist/pages/admin/delegations/index.js +2 -3
  121. package/dist/pages/admin/orgs/index.cjs +1 -1
  122. package/dist/pages/admin/orgs/index.cjs.map +1 -1
  123. package/dist/pages/admin/orgs/index.js +2 -3
  124. package/dist/pages/admin/users/index.cjs +1 -1
  125. package/dist/pages/admin/users/index.cjs.map +1 -1
  126. package/dist/pages/admin/users/index.js +2 -3
  127. package/dist/pages/admin/webhook-endpoints/index.cjs.map +1 -1
  128. package/dist/pages/admin/webhook-endpoints/index.js +1 -2
  129. package/dist/pages/cc/index.cjs.map +1 -1
  130. package/dist/pages/cc/index.js +1 -2
  131. package/dist/pages/dashboard/index.cjs.map +1 -1
  132. package/dist/pages/dashboard/index.js +1 -2
  133. package/dist/pages/delegations/index.cjs +1 -1
  134. package/dist/pages/delegations/index.cjs.map +1 -1
  135. package/dist/pages/delegations/index.js +2 -3
  136. package/dist/pages/inbox/index.cjs.map +1 -1
  137. package/dist/pages/inbox/index.js +1 -2
  138. package/dist/pages/instances/detail/index.cjs +1 -1
  139. package/dist/pages/instances/detail/index.cjs.map +1 -1
  140. package/dist/pages/instances/detail/index.js +2 -3
  141. package/dist/pages/instances/new/index.cjs.map +1 -1
  142. package/dist/pages/instances/new/index.js +1 -2
  143. package/dist/pages/login/index.cjs +1 -1
  144. package/dist/pages/login/index.cjs.map +1 -1
  145. package/dist/pages/login/index.js +2 -3
  146. package/dist/pages/root/index.cjs.map +1 -1
  147. package/dist/pages/root/index.js +1 -2
  148. package/dist/pages/search/index.cjs.map +1 -1
  149. package/dist/pages/search/index.js +1 -2
  150. package/dist/pages/sent/index.cjs.map +1 -1
  151. package/dist/pages/sent/index.js +1 -2
  152. package/dist/pages/settings/notifications/index.cjs.map +1 -1
  153. package/dist/pages/settings/notifications/index.js +2 -3
  154. package/dist/pages/templates/categories/index.cjs +1 -1
  155. package/dist/pages/templates/categories/index.cjs.map +1 -1
  156. package/dist/pages/templates/categories/index.js +2 -3
  157. package/dist/pages/templates/compose/index.cjs +1 -1
  158. package/dist/pages/templates/compose/index.cjs.map +1 -1
  159. package/dist/pages/templates/compose/index.js +2 -3
  160. package/dist/pages/templates/designer/index.cjs +1 -1
  161. package/dist/pages/templates/designer/index.cjs.map +1 -1
  162. package/dist/pages/templates/designer/index.js +2 -3
  163. package/dist/pages/templates/index.cjs.map +1 -1
  164. package/dist/pages/templates/index.js +1 -2
  165. package/dist/pages/templates/versions/index.cjs.map +1 -1
  166. package/dist/pages/templates/versions/index.js +1 -2
  167. package/dist/views/admin/delegations/index.cjs +1 -1
  168. package/dist/views/admin/delegations/index.js +1 -1
  169. package/dist/views/admin/index.cjs +1 -1
  170. package/dist/views/admin/index.js +3 -3
  171. package/dist/views/admin/orgs/index.cjs +1 -1
  172. package/dist/views/admin/orgs/index.js +1 -1
  173. package/dist/views/admin/users/index.cjs +1 -1
  174. package/dist/views/admin/users/index.js +1 -1
  175. package/dist/views/admin/webhook-endpoints/index.cjs +1 -1
  176. package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
  177. package/dist/views/admin/webhook-endpoints/index.js +52 -53
  178. package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
  179. package/dist/views/cc/index.cjs +1 -1
  180. package/dist/views/cc/index.cjs.map +1 -1
  181. package/dist/views/cc/index.js +2 -3
  182. package/dist/views/dashboard/index.cjs +1 -1
  183. package/dist/views/dashboard/index.cjs.map +1 -1
  184. package/dist/views/dashboard/index.js +2 -3
  185. package/dist/views/delegations/index.cjs +1 -1
  186. package/dist/views/delegations/index.js +1 -1
  187. package/dist/views/forms/builder/index.cjs +1 -1
  188. package/dist/views/forms/builder/index.js +1 -1
  189. package/dist/views/forms/renderer/index.cjs +1 -1
  190. package/dist/views/forms/renderer/index.js +1 -1
  191. package/dist/views/forms/renderer/org-unit-field-options.d.cts +44 -0
  192. package/dist/views/forms/renderer/org-unit-field-options.d.ts +44 -0
  193. package/dist/views/forms/renderer/org-unit-field.d.cts +23 -0
  194. package/dist/views/forms/renderer/org-unit-field.d.ts +23 -0
  195. package/dist/views/inbox/index.cjs +1 -1
  196. package/dist/views/inbox/index.cjs.map +1 -1
  197. package/dist/views/inbox/index.js +133 -137
  198. package/dist/views/inbox/index.js.map +1 -1
  199. package/dist/views/instances/approver-filled-form.d.cts +9 -2
  200. package/dist/views/instances/approver-filled-form.d.ts +9 -2
  201. package/dist/views/instances/detail/index.cjs +1 -1
  202. package/dist/views/instances/detail/index.js +1 -1
  203. package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +8 -1
  204. package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +8 -1
  205. package/dist/views/instances/detail/sections/container-helpers.d.cts +0 -1
  206. package/dist/views/instances/detail/sections/container-helpers.d.ts +0 -1
  207. package/dist/views/instances/detail/sections/shared.d.cts +2 -2
  208. package/dist/views/instances/detail/sections/shared.d.ts +2 -2
  209. package/dist/views/instances/new/index.cjs +1 -1
  210. package/dist/views/instances/new/index.cjs.map +1 -1
  211. package/dist/views/instances/new/index.js +24 -21
  212. package/dist/views/instances/new/index.js.map +1 -1
  213. package/dist/views/login/index.cjs +1 -1
  214. package/dist/views/login/index.js +1 -1
  215. package/dist/views/search/index.cjs +1 -1
  216. package/dist/views/search/index.cjs.map +1 -1
  217. package/dist/views/search/index.js +2 -3
  218. package/dist/views/sent/index.cjs +1 -1
  219. package/dist/views/sent/index.cjs.map +1 -1
  220. package/dist/views/sent/index.js +2 -3
  221. package/dist/views/settings/index.js +1 -1
  222. package/dist/views/settings/notifications/index.js +1 -1
  223. package/dist/views/templates/categories/index.cjs +1 -1
  224. package/dist/views/templates/categories/index.js +1 -1
  225. package/dist/views/templates/compose/index.cjs +1 -1
  226. package/dist/views/templates/compose/index.js +1 -1
  227. package/dist/views/templates/designer/approver-resolver-model.d.cts +211 -0
  228. package/dist/views/templates/designer/approver-resolver-model.d.ts +211 -0
  229. package/dist/views/templates/designer/dry-run-assignee-label.d.cts +2 -0
  230. package/dist/views/templates/designer/dry-run-assignee-label.d.ts +2 -0
  231. package/dist/views/templates/designer/dry-run-sample-data.d.cts +6 -0
  232. package/dist/views/templates/designer/dry-run-sample-data.d.ts +6 -0
  233. package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +25 -0
  234. package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +25 -0
  235. package/dist/views/templates/designer/index.cjs +1 -1
  236. package/dist/views/templates/designer/index.js +1 -1
  237. package/dist/views/templates/designer/node-actor-resolver-options.d.cts +38 -0
  238. package/dist/views/templates/designer/node-actor-resolver-options.d.ts +38 -0
  239. package/dist/views/templates/index.cjs +1 -1
  240. package/dist/views/templates/index.cjs.map +1 -1
  241. package/dist/views/templates/index.js +50 -51
  242. package/dist/views/templates/index.js.map +1 -1
  243. package/dist/views/templates/versions/index.cjs +1 -1
  244. package/dist/views/templates/versions/index.cjs.map +1 -1
  245. package/dist/views/templates/versions/index.js +7 -8
  246. package/dist/views/templates/versions/index.js.map +1 -1
  247. package/package.json +3 -3
  248. package/dist/chunks/FormBuilderView-CUOyS07f.cjs +0 -3
  249. package/dist/chunks/FormBuilderView-CUOyS07f.cjs.map +0 -1
  250. package/dist/chunks/FormBuilderView-ClLnQ1e_.js.map +0 -1
  251. package/dist/chunks/FormRendererView-BsTwZkqU.js.map +0 -1
  252. package/dist/chunks/FormRendererView-GpsE03np.cjs +0 -4
  253. package/dist/chunks/FormRendererView-GpsE03np.cjs.map +0 -1
  254. package/dist/chunks/admin-pickers-BRHk3qKq.cjs +0 -2
  255. package/dist/chunks/admin-pickers-BRHk3qKq.cjs.map +0 -1
  256. package/dist/chunks/admin-pickers-Djq3h-UR.js.map +0 -1
  257. package/dist/chunks/approver-filled-form-D1DmqDVP.cjs +0 -2
  258. package/dist/chunks/approver-filled-form-D1DmqDVP.cjs.map +0 -1
  259. package/dist/chunks/approver-filled-form-DuQGPtNB.js +0 -95
  260. package/dist/chunks/approver-filled-form-DuQGPtNB.js.map +0 -1
  261. package/dist/chunks/compose-Cock_B2Q.cjs +0 -2
  262. package/dist/chunks/compose-Cock_B2Q.cjs.map +0 -1
  263. package/dist/chunks/compose-jnvnnVfN.js.map +0 -1
  264. package/dist/chunks/designer-B8Gvew_k.js.map +0 -1
  265. package/dist/chunks/designer-CAEFV1ve.cjs +0 -65
  266. package/dist/chunks/designer-CAEFV1ve.cjs.map +0 -1
  267. package/dist/chunks/detail-CExpbazF.js +0 -2629
  268. package/dist/chunks/detail-CExpbazF.js.map +0 -1
  269. package/dist/chunks/detail-DIY-L4i-.cjs +0 -2
  270. package/dist/chunks/detail-DIY-L4i-.cjs.map +0 -1
  271. package/dist/chunks/orgs-BeeDDWL1.cjs +0 -2
  272. package/dist/chunks/task-node-label-BF6UllxP.cjs +0 -2
  273. package/dist/chunks/task-node-label-BF6UllxP.cjs.map +0 -1
  274. package/dist/chunks/task-node-label-CWZgOBj0.js +0 -9
  275. package/dist/chunks/task-node-label-CWZgOBj0.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,64 @@
1
+ ## 0.18.1 (2026-11-01)
2
+
3
+ ### 🚀 Features
4
+
5
+ - add form-field and prior-node approver sources ([#132](https://github.com/Rytass/BPMCore/pull/132))
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **bpm-core-react:** keep the decision comparator defined for bad times ([58b01d6](https://github.com/Rytass/BPMCore/commit/58b01d6))
10
+ - **bpm-core-react:** fill timeline rows only from their own decision ([f336c1d](https://github.com/Rytass/BPMCore/commit/f336c1d))
11
+ - **bpm-core-react:** leave the sign time blank without an own decision ([85b5281](https://github.com/Rytass/BPMCore/commit/85b5281))
12
+ - **bpm-core-react:** render the timeline metadata line as a div ([fa228bb](https://github.com/Rytass/BPMCore/commit/fa228bb))
13
+ - **bpm-core-react:** raise the timeline metadata line to body text ([b62ae00](https://github.com/Rytass/BPMCore/commit/b62ae00))
14
+ - **bpm-core-react:** show the signer's own decision in inbox history ([4b07a1f](https://github.com/Rytass/BPMCore/commit/4b07a1f))
15
+ - **bpm-core-react:** stop repeating the last comment on silent signers ([45c74b2](https://github.com/Rytass/BPMCore/commit/45c74b2))
16
+
17
+ ### 🔥 Performance
18
+
19
+ - **bpm-core-react:** search each timeline row only within its own task ([0ddbe46](https://github.com/Rytass/BPMCore/commit/0ddbe46))
20
+
21
+ ### ❤️ Thank You
22
+
23
+ - Chia Yu Pai @fantasywind
24
+ - Kai-Chieh Yang @coollugi
25
+
26
+ ## 0.18.0 (2026-10-28)
27
+
28
+ ### 🚀 Features
29
+
30
+ - **bpm-core-client:** check text field formats in a Web Worker ([a3c3d65](https://github.com/Rytass/BPMCore/commit/a3c3d65))
31
+ - **bpm-core-react:** name text length and format errors on the case pages ([074d4b9](https://github.com/Rytass/BPMCore/commit/074d4b9))
32
+ - **bpm-core-react:** set a text format in the form builder ([ce74cd1](https://github.com/Rytass/BPMCore/commit/ce74cd1))
33
+ - **bpm-core-react:** set where a return goes on the user task panel ([b3b9fe0](https://github.com/Rytass/BPMCore/commit/b3b9fe0))
34
+ - **bpm-core-react:** offer only reachable nodes in the return dialog ([690042a](https://github.com/Rytass/BPMCore/commit/690042a))
35
+
36
+ ### 🩹 Fixes
37
+
38
+ - **bpm-core:** ask the directory only about delegation rules in scope ([022304e](https://github.com/Rytass/BPMCore/commit/022304e))
39
+ - **bpm-core-react:** drop patternErrorMessage when the designer clears it ([74a007b](https://github.com/Rytass/BPMCore/commit/74a007b))
40
+ - **bpm-core-react:** release the busy state when form validation throws ([a300d2b](https://github.com/Rytass/BPMCore/commit/a300d2b))
41
+ - **bpm-core:** hold service-task text writes to the field's rules ([fcde1df](https://github.com/Rytass/BPMCore/commit/fcde1df))
42
+ - **bpm-core-react:** check formats off the main thread on the case pages ([58a1a9d](https://github.com/Rytass/BPMCore/commit/58a1a9d))
43
+ - **bpm-core:** keep the directory's error out of the delegation refusal ([14ccd0e](https://github.com/Rytass/BPMCore/commit/14ccd0e))
44
+ - **bpm-core:** refuse to dispatch when the delegation directory lookup fails ([8ef8a88](https://github.com/Rytass/BPMCore/commit/8ef8a88))
45
+ - **bpm-core:** check the type of a text field whose visibleWhen is false ([b256040](https://github.com/Rytass/BPMCore/commit/b256040))
46
+ - **bpm-core-react:** word a timed-out format check on the approver page ([3a223a3](https://github.com/Rytass/BPMCore/commit/3a223a3))
47
+ - **shared:** refuse every repeated group in a text field pattern ([d0daa77](https://github.com/Rytass/BPMCore/commit/d0daa77))
48
+ - **bpm-core-react:** flag an over-long pattern or error message in the builder ([68baf21](https://github.com/Rytass/BPMCore/commit/68baf21))
49
+ - **shared:** refuse repeated alternations whose branches can start alike ([5e6e12e](https://github.com/Rytass/BPMCore/commit/5e6e12e))
50
+ - **bpm-core-react:** show the designer's message for a fill format error ([a69399d](https://github.com/Rytass/BPMCore/commit/a69399d))
51
+ - **bpm-core-react:** warn about every format the linter refuses ([d637d58](https://github.com/Rytass/BPMCore/commit/d637d58))
52
+
53
+ ### 🔥 Performance
54
+
55
+ - **bpm-core:** ask the host directory once per node when resolving delegation ([cb62b00](https://github.com/Rytass/BPMCore/commit/cb62b00))
56
+
57
+ ### ❤️ Thank You
58
+
59
+ - Chia Yu Pai @fantasywind
60
+ - Kai-Chieh Yang
61
+
1
62
  ## 0.17.9 (2026-10-27)
2
63
 
3
64
  ### 🚀 Features
package/README.md CHANGED
@@ -88,6 +88,14 @@ module.exports = {
88
88
  };
89
89
  ```
90
90
 
91
+ ### Content Security Policy (conditional)
92
+
93
+ The case pages check text field formats in a Web Worker started from a `blob:`
94
+ URL, so a designer's pattern that backtracks cannot freeze the page. If your
95
+ host sets a Content Security Policy, allow `worker-src blob:` (or `script-src
96
+ blob:` where `worker-src` is not set). Without it the check falls back to the
97
+ main thread with no time limit; submitting still works.
98
+
91
99
  ### Designer feature flags (Next.js host env)
92
100
 
93
101
  The designer page shim (`pages/templates/designer`) reads these server-side
@@ -0,0 +1,3 @@
1
+ "use client";const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./bpm-form-field-Bc6k4ZEO.cjs"),n=require("./FormRendererView-ChmM_4Yc.cjs");let r=require("react"),i=require("@mezzanine-ui/react"),a=require("react/jsx-runtime"),o=require("@mezzanine-ui/core/form"),s=require("@mezzanine-ui/icons"),c=require("@rytass/bpm-core-client/form"),l=require("@rytass/bpm-core-shared/form"),u=require("@hello-pangea/dnd"),d=require("next/dynamic");d=e.t(d,1);let f=require("@codemirror/lang-json"),p=require("@codemirror/view");var m={alignItems:`center`,border:`1px solid var(--mzn-color-border-neutral)`,borderRadius:4,color:`var(--mzn-color-text-neutral)`,display:`flex`,minHeight:160,padding:12,width:`100%`},h=[(0,f.json)(),p.EditorView.lineWrapping,p.EditorView.theme({"&":{border:`1px solid var(--mzn-color-border-neutral)`,borderRadius:`4px`,fontSize:`13px`,width:`100%`},"&.cm-focused":{outline:`1px solid var(--mzn-color-border-primary)`},".cm-content":{fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace`,minHeight:`100%`},".cm-editor":{width:`100%`},".cm-gutters":{borderRight:`1px solid var(--mzn-color-border-neutral)`},".cm-scroller":{fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace`}})],g=(0,d.default)(()=>import(`@uiw/react-codemirror`),{loading:()=>(0,a.jsx)(`div`,{style:m,children:`載入 JSON 編輯器`}),ssr:!1});function ee({disabled:e=!1,height:t,name:n,onChange:r,placeholder:i,value:o}){return(0,a.jsx)(g,{"aria-label":n,basicSetup:{autocompletion:!0,bracketMatching:!0,closeBrackets:!0,defaultKeymap:!0,foldGutter:!0,highlightActiveLine:!0,highlightSelectionMatches:!0,lineNumbers:!0,syntaxHighlighting:!0},editable:!e,extensions:[...h],height:t,indentWithTab:!1,onChange:r,placeholder:i,readOnly:e,theme:`light`,value:o,width:`100%`})}var _=[{description:`單行文字、姓名、編號`,icon:s.AlignLeftIcon,label:`文字`,type:`text`},{description:`多行補充內容`,icon:s.FileIcon,label:`長文字`,type:`textarea`},{description:`金額、數量、分數`,icon:s.CurrencyDollarIcon,label:`數字`,type:`number`},{description:`金額與費用`,icon:s.CurrencyDollarIcon,label:`金額`,type:`money`},{description:`日期或到期日`,icon:s.CalendarIcon,label:`日期`,type:`date`},{description:`日期與時間`,icon:s.CalendarIcon,label:`日期時間`,type:`datetime`},{description:`是 / 否狀態`,icon:s.CheckedIcon,label:`開關`,type:`boolean`},{description:`固定選項擇一`,icon:s.ListIcon,label:`下拉選單`,type:`select`},{description:`可搜尋的固定選項`,icon:s.ListIcon,label:`自動完成`,type:`autocomplete`},{description:`固定選項單選`,icon:s.DotGridIcon,label:`單選`,type:`radio`},{description:`固定選項複選`,icon:s.CheckedOutlineIcon,label:`複選`,type:`checkbox`},{description:`附件或佐證資料`,icon:s.FileAttachmentIcon,label:`附件`,type:`file_upload`},{description:`從成員名單挑選一或多位人員`,icon:s.UserIcon,label:`人員選擇`,type:`member`},{description:`從組織圖挑選一個組織`,icon:s.FolderIcon,label:`組織選擇`,type:`org_unit`},{description:`多列多欄明細`,icon:s.DotGridIcon,label:`表格`,type:`table`}],v=_.filter(e=>(0,l.isTableColumnFieldType)(e.type)).map(e=>({id:e.type,name:e.label})),te={alignItems:`start`,display:`flex`,flexWrap:`wrap`,gap:16},ne={flex:`0.55 1 300px`,minWidth:0},re={flex:`1.45 1 720px`,minWidth:620,paddingBottom:260},ie=240,ae={BOOLEAN:`開關`,NUMBER:`數字`,STRING:`文字或選單`,STRING_ARRAY:`多選`},oe=/^schema\.fields\[(\d+)\](?:\.columns\[(\d+)\])?\.dataSource\.bindings missing required parameter: (.+)$/u,se=/^schema\.fields\[(\d+)\](?:\.columns\[(\d+)\])?\.dataSource\.bindings unknown parameter: (.+)$/u,y={display:`grid`,gap:12},ce={display:`flex`,flexWrap:`wrap`,gap:6},le={flex:`0 0 auto`,whiteSpace:`nowrap`},ue={display:`grid`,gap:8},de={alignItems:`center`,cursor:`grab`,display:`flex`,gap:12,touchAction:`none`},fe={display:`grid`,flex:`1 1 auto`,gap:2,minWidth:0},pe={alignItems:`center`,display:`flex`,flex:`0 0 auto`,gap:4},me={alignItems:`center`,display:`flex`,gap:6},he={cursor:`pointer`,userSelect:`none`},ge={filter:`drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12))`},_e={backgroundColor:`color-mix(in srgb, var(--mzn-color-primary) 8%, var(--mzn-color-bg-surface))`,boxShadow:`inset 0 0 0 1px var(--mzn-color-border-primary)`},ve={alignItems:`center`,border:`1px dashed var(--mzn-color-border-neutral)`,borderRadius:6,display:`grid`,gap:12,minHeight:240,padding:32,textAlign:`center`},ye={display:`flex`,gap:8,justifyContent:`center`},be={display:`grid`,gap:14},xe={display:`grid`,columnGap:16,gridTemplateColumns:`repeat(auto-fit, minmax(280px, 360px))`,justifyContent:`start`,maxWidth:736,rowGap:8},Se={gridColumn:`1 / -1`},Ce={alignItems:`center`,display:`flex`,gap:8,gridColumn:`1 / -1`,justifyContent:`flex-end`},b={gridColumn:`1 / -1`},we={alignItems:`start`,display:`block`,width:`100%`},Te={...we,gridColumn:`1 / -1`},Ee={minWidth:0,width:`100%`},De={minWidth:`100%`,width:`100%`},Oe={display:`grid`,gap:14},ke={alignItems:`start`,display:`block`,width:`100%`},Ae={minWidth:0,width:`100%`},je={gridColumn:`2 / -1`},Me={display:`grid`,gap:10,width:`100%`},Ne={display:`grid`,gap:8,gridTemplateColumns:`repeat(auto-fit, minmax(160px, 1fr))`},Pe={display:`inline-flex`},Fe={display:`grid`,gap:16},Ie={display:`grid`,gap:8},Le={display:`flex`,justifyContent:`flex-end`},Re={color:`var(--mzn-color-text-error)`,fontSize:`0.72em`,lineHeight:0,marginLeft:2,verticalAlign:`super`},ze={display:`grid`,gap:10,gridColumn:`1 / -1`},Be={display:`grid`,gap:2},Ve={display:`grid`,gap:8},He={display:`flex`,justifyContent:`flex-start`},Ue={display:`flex`,flexWrap:`wrap`,gap:4},We={backgroundColor:`var(--mzn-color-bg-surface-secondary)`,borderRadius:6,display:`grid`,gap:4,padding:10},Ge={...xe,gridTemplateColumns:`minmax(280px, 520px)`,padding:`4px 0 8px`},Ke={display:`grid`,gap:8,gridColumn:`1 / -1`},qe={alignItems:`center`,display:`flex`,gap:12,justifyContent:`space-between`},Je={alignItems:`baseline`,display:`flex`,gap:2},Ye={display:`grid`,gap:4};function Xe(e){e&&(e.style.width=`100%`)}var Ze={fields:[],schemaVersion:1},Qe={layout:[],schemaVersion:1},x=`__STATIC_OPTIONS__`,S=`__CONSTANT__`,C=`__ROW_FIELD__:`,w=`__UNBOUND__`,$e=[{id:x,name:`靜態選項`}],et=[{id:`single`,name:`單選`},{id:`multiple`,name:`複選`}],tt=[{id:`unset`,name:`不預設`},{id:`true`,name:`是`},{id:`false`,name:`否`}],nt=[{id:`true`,name:`是`},{id:`false`,name:`否`}],rt=[{label:`顯示`,name:`fieldVisibleWhen`,supportingText:`符合條件時才顯示這個欄位。`,target:`visibleWhen`},{label:`必填`,name:`fieldRequiredWhen`,supportingText:`符合條件時才要求填寫這個欄位。`,target:`requiredWhen`},{label:`唯讀`,name:`fieldReadonlyWhen`,supportingText:`符合條件時不允許修改這個欄位。`,target:`readonlyWhen`}];function T({onChange:e,value:d}){let f=d?.schema??Ze,p=d?.uiSchema??Qe,[m,h]=(0,r.useState)(f),[g,T]=(0,r.useState)(p),[ct,D]=(0,r.useState)(A(f)),[pt,j]=(0,r.useState)(A(p)),[Et,Dt]=(0,r.useState)({}),[Ot,N]=(0,r.useState)(null),[P,kt]=(0,r.useState)(`design`),[F,I]=(0,r.useState)(null),[L,At]=(0,r.useState)([]),[R,jt]=(0,r.useState)(null),[Mt,Nt]=(0,r.useState)(`loading`),[z,B]=(0,r.useState)(null),[Pt,Ft]=(0,r.useState)(!1),[V,H]=(0,r.useState)(null),[It,U]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=!0;return(0,c.listFormDataSources)().then(t=>{e&&(At(t),jt(null),Nt(`ready`))}).catch(t=>{e&&(At([]),jt(`目前無法載入 DataSource Catalog,請稍後重試。`),Nt(`unavailable`))}),()=>{e=!1}},[]),(0,r.useEffect)(()=>{m.fields.some(e=>e.fieldKey===F)||I(m.fields[0]?.fieldKey??null)},[m.fields,F]),(0,r.useEffect)(()=>{Dt(e=>(0,c.buildFormRendererValues)(m.fields,e))},[m.fields]),(0,r.useEffect)(()=>{P!==`advanced`&&(D(A(m)),j(A(g)))},[P,m,g]);let W=(0,r.useMemo)(()=>m.fields.find(e=>e.fieldKey===F)??m.fields[0]??null,[m.fields,F]);(0,r.useEffect)(()=>{e?.({schema:m,uiSchema:g})},[m,g]);function G(e){let t=m.fields.length+1,n=(0,c.createFieldDefinition)(e,t);h({...m,fields:[...m.fields,n]}),T({...g,layout:[...g.layout,{fieldKey:n.fieldKey,width:e===`textarea`||e===`file_upload`||e===`table`?`FULL`:`HALF`}]}),I(n.fieldKey),kt(`design`),N(null)}function Lt(e){let t=e;t===`advanced`&&P!==`advanced`&&(D(A(m)),j(A(g))),kt(t)}function Rt(e){let t=m.fields.flatMap(t=>(0,l.isTableFieldDefinition)(t)?t.columns.flatMap(n=>(0,l.isFormDataSourceFieldDefinition)(n)&&(0,c.readFormDataSourceFieldDependencyKeys)(n).includes(e)?[`${t.fieldKey}.${n.fieldKey}`]:[]):(0,l.isFormDataSourceFieldDefinition)(t)&&(0,c.readFormDataSourceFieldDependencyKeys)(t).includes(e)?[t.fieldKey]:[]);t.length>0?H({affectedFieldKeys:t,fieldKey:e,kind:`remove-field`}):zt(e)}function zt(e){let t=m.fields.filter(t=>t.fieldKey!==e);h({...m,fields:t}),T({...g,layout:g.layout.filter(t=>t.fieldKey!==e)}),I(F===e?t[0]?.fieldKey??null:F),N(null),B(null)}function Bt(e){let t=e.destination;t&&e.source.index!==t.index&&(h(n=>({...n,fields:M(n.fields,e.source.index,t.index)})),T(n=>({...n,layout:M(n.layout,e.source.index,t.index)})),N(null))}function K(e){q(t=>({...t,...e}))}function q(e){if(!W)return;let t=W.fieldKey,n=e(W),r=n.fieldKey,i={...m,fields:m.fields.map(e=>e.fieldKey===t?n:e)},a=t===r?i:(0,c.renameFormDataSourceFieldBindings)(i,t,r);h(a),T({...g,layout:g.layout.map(e=>e.fieldKey===t?{...e,fieldKey:r}:e)}),I(r),N(null),B(null)}function Vt(e){q(()=>e)}function J(e,t){h(n=>({...n,fields:n.fields.map(n=>n.fieldKey===e&&(0,l.isTableFieldDefinition)(n)?t(n):n)})),N(null),B(null)}function Y(e,t,n){let r=e.columns[t]?.fieldKey;J(e.fieldKey,e=>{let i={...e,columns:e.columns.map((e,r)=>r===t?n:e)};return typeof r==`string`&&r!==n.fieldKey?(0,c.renameFormTableColumnBindings)(i,r,n.fieldKey):i})}function Ht(e){let t=(0,c.createTableColumnDefinition)(e.columns,`text`);J(e.fieldKey,e=>({...e,columns:[...e.columns,t]})),U(e.columns.length)}function Ut(e,t){J(e,e=>({...e,columns:e.columns.filter((e,n)=>n!==t)})),U(e=>e===null||e<t?e:e===t?null:e-1)}function Wt(e,t,n){J(e.fieldKey,e=>({...e,columns:M(e.columns,t,n)})),U(e=>e===null?e:e===t?n:e>t&&e<=n?e-1:e<t&&e>=n?e+1:e)}function Gt(e,t,n){if(e.type!==`select`&&e.type!==`autocomplete`||(0,l.readFormFieldSelectionMode)(e)===t)return;let r=e.defaultValue,i=t===`multiple`?typeof r==`string`?[r]:r:Array.isArray(r)?r[0]:r;n(e,{...e,defaultValue:i,mode:t},`選擇模式變更可能轉換或捨棄既有預設值。`)}function Kt(e,t,n=`此變更會替換目前選項來源;既有 options、dynamic reference 或 bindings 可能失效。`){JSON.stringify(e)!==JSON.stringify(t)&&H({fieldKey:e.fieldKey,impact:n,kind:`replace-field`,nextField:t})}function qt(e,t,n){if(!t)return;if(t===x){if(!(0,l.isFormDataSourceFieldDefinition)(e))return;let{dataSource:t,defaultValue:r,...i}=e;n({...i,options:[]});return}let r=L.find(e=>E(e)===t);if(!r)return;if((0,l.isFormDataSourceFieldDefinition)(e)){let t=new Set(r.parameters.map(e=>e.key)),i=e.dataSource.bindings.filter(e=>t.has(e.parameter));n({...e,dataSource:{bindings:i,key:r.key,version:r.version}});return}let{options:i,defaultValue:a,...o}=e;n({...o,dataSource:{bindings:[],key:r.key,version:r.version}})}function Jt(){V&&(Yt(V),H(null))}function Yt(e){e.kind===`remove-field`?zt(e.fieldKey):e.kind===`remove-column`?Ut(e.fieldKey,e.columnIndex):e.kind===`replace-column`?(J(e.fieldKey,t=>({...t,columns:t.columns.map(t=>t.fieldKey===e.columnKey?e.nextColumn:t)})),U(e.columnIndex)):(h({...m,fields:m.fields.map(t=>t.fieldKey===e.fieldKey?e.nextField:t)}),N(null),B(null))}async function Xt(){Ft(!0);try{let e=await(0,c.lintFormSchema)(m,g);B(e.errors.map(Zt))}catch{B([`目前無法完成 DataSource schema 驗證。`])}finally{Ft(!1)}}function Zt(e){let t=oe.exec(e);if(t?.[1]&&t[3])return`${Qt(t[1],t[2])}尚未指定必要參數「${$t(t[1],t[2],t[3])}」的來源`;let n=se.exec(e);return n?.[1]&&n[3]?`${Qt(n[1],n[2])}綁定了來源沒有的參數「${n[3]}」`:(0,c.readFormSchemaLintMessage)(e)}function Qt(e,t){let n=m.fields[Number(e)];if(!n)return``;let r=n.label||n.fieldKey,i=en(n,t);return i?`「${r}」表格的「${i.label||i.fieldKey}」欄`:`「${r}」欄位`}function $t(e,t,n){let r=m.fields[Number(e)];if(!r)return n;let i=en(r,t)??r,a=(0,l.isFormDataSourceFieldDefinition)(i)?i.dataSource:null;return(a?L.find(e=>e.key===a.key&&e.version===a.version):void 0)?.parameters.find(e=>e.key===n)?.label||n}function en(e,t){return typeof t==`string`&&(0,l.isTableFieldDefinition)(e)?e.columns[Number(t)]:void 0}function tn(e){Dt(e)}function nn(e,t){h(n=>({...n,fields:n.fields.map(n=>n.fieldKey===e?{...n,required:t}:n)})),N(null)}function rn(e){D(e);try{h(JSON.parse(e)),N(null)}catch{N(`Form Schema JSON 格式不正確`)}}function an(e){j(e);try{T(JSON.parse(e)),N(null)}catch{N(`UI Schema JSON 格式不正確`)}}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(i.SectionGroup,{children:(0,a.jsx)(i.Section,{children:(0,a.jsxs)(`div`,{style:Fe,children:[(0,a.jsxs)(i.Tab,{activeKey:P,onChange:Lt,size:`sub`,children:[(0,a.jsx)(i.TabItem,{children:`設計`},`design`),(0,a.jsx)(i.TabItem,{children:`預覽`},`preview`),(0,a.jsx)(i.TabItem,{children:`進階`},`advanced`)]}),P===`design`?on():null,P===`preview`?Gn():null,P===`advanced`?Kn():null]})})})}),V?(0,a.jsx)(i.Modal,{cancelText:`返回`,confirmText:`確認變更`,modalType:`standard`,onCancel:()=>H(null),onClose:()=>H(null),onConfirm:Jt,open:!0,showModalFooter:!0,showModalHeader:!0,title:dt(V),children:V.kind===`remove-field`?(0,a.jsxs)(`div`,{style:Ie,children:[(0,a.jsx)(i.Typography,{variant:`body`,children:`此欄位仍被下列 DataSource binding 使用;移除後請重新設定這些欄位。`}),(0,a.jsx)(i.Typography,{color:`text-warning`,variant:`body`,children:V.affectedFieldKeys.join(`、`)})]}):V.kind===`remove-column`?(0,a.jsxs)(i.Typography,{variant:`body`,children:[`移除欄「`,V.columnKey,`」後,既有案件仍保留原本的表單版本,但新版本的這一欄資料將不再被填寫。`]}):(0,a.jsx)(i.Typography,{variant:`body`,children:V.impact})}):null]});function on(){return(0,a.jsxs)(`div`,{style:y,children:[(0,a.jsxs)(`div`,{style:ue,children:[(0,a.jsx)(i.Typography,{component:`h2`,variant:`label-primary`,children:`新增欄位`}),(0,a.jsx)(`div`,{style:ce,children:_.map(e=>(0,a.jsx)(i.Button,{icon:e.icon,iconType:`leading`,onClick:()=>G(e.type),size:`sub`,style:le,type:`button`,variant:`base-secondary`,children:e.label},e.type))})]}),(0,a.jsxs)(`div`,{style:te,children:[(0,a.jsxs)(`div`,{style:{...y,...ne},children:[(0,a.jsx)(i.Typography,{component:`h2`,variant:`label-primary`,children:`表單畫布`}),m.fields.length>0?(0,a.jsx)(u.DragDropContext,{onDragEnd:Bt,children:(0,a.jsx)(u.Droppable,{droppableId:`form-builder-fields`,children:e=>(0,a.jsxs)(`div`,{...e.droppableProps,ref:e.innerRef,style:y,children:[m.fields.map((e,t)=>(0,a.jsx)(u.Draggable,{draggableId:e.fieldKey,index:t,children:(t,n)=>Un(e,t,n.isDragging)},e.fieldKey)),e.placeholder]})})}):(0,a.jsxs)(`div`,{style:ve,children:[(0,a.jsxs)(`div`,{style:y,children:[(0,a.jsx)(i.Typography,{component:`h3`,variant:`h3`,children:`尚未建立欄位`}),(0,a.jsx)(i.Typography,{color:`text-neutral`,variant:`body`,children:`從上方新增第一個欄位,或直接建立常用文字欄位開始設計。`})]}),(0,a.jsxs)(`div`,{style:ye,children:[(0,a.jsx)(i.Button,{onClick:()=>G(`text`),variant:`base-primary`,children:`新增文字欄位`}),(0,a.jsx)(i.Button,{onClick:()=>G(`textarea`),variant:`base-secondary`,children:`新增長文字`})]})]})]}),(0,a.jsxs)(`div`,{style:{...y,...re},children:[(0,a.jsx)(i.Typography,{component:`h2`,variant:`label-primary`,children:`欄位設定`}),W?sn(W):(0,a.jsx)(i.Typography,{color:`text-neutral`,variant:`body`,children:`請先新增或選取欄位。`})]})]})]})}function sn(e){return(0,a.jsxs)(`div`,{style:be,children:[cn(e),(0,l.isTableFieldDefinition)(e)?fn(e):null,ln(e)]})}function cn(e){return(0,a.jsxs)(`div`,{style:xe,children:[(0,a.jsx)(`div`,{style:Ce,children:(0,a.jsx)(i.Badge,{size:`main`,text:it(e.type),variant:`text-info`})}),$(`標題`,`fieldLabel`,(0,a.jsx)(i.Input,{onChange:e=>K({label:e.target.value}),placeholder:`例如:申請金額`,value:e.label,variant:`base`})),$(`欄位 Key`,`fieldKey`,(0,a.jsx)(i.Input,{onChange:e=>K({fieldKey:e.target.value}),placeholder:`例如:amount`,value:e.fieldKey,variant:`base`})),(0,l.isTableFieldDefinition)(e)?null:$(`提示文字`,`fieldPlaceholder`,(0,a.jsx)(i.Input,{onChange:e=>K({placeholder:e.target.value||void 0}),placeholder:`例如:請輸入申請金額`,value:e.placeholder??``,variant:`base`})),un(e,Vt,Kt),O(e)?$(`以連結顯示`,`fieldDisplayAsLink`,(0,a.jsx)(i.Toggle,{checked:e.displayAs===`link`,onChange:e=>q(t=>e.target.checked?O(t)?{...t,displayAs:`link`}:t:yt(t,`displayAs`))})):null,$(`只存不顯示(系統整合用)`,`fieldHidden`,(0,a.jsx)(i.Toggle,{checked:e.hidden===!0,onChange:e=>q(t=>e.target.checked?{...t,hidden:!0,required:!1}:yt(t,`hidden`))})),e.hidden===!0?(0,a.jsx)(i.Typography,{color:`text-neutral`,style:b,variant:`body`,children:`填寫、唯讀與重送畫面都不會顯示這個欄位,值仍會存下來; 透過 API 仍然讀得到這個值,不是權限控管。`}):null]})}function ln(e){return(0,a.jsx)(i.Accordion,{defaultExpanded:bt(e),size:`sub`,title:`進階設定`,children:(0,a.jsxs)(`div`,{style:xe,children:[(0,a.jsx)(i.Typography,{component:`h3`,style:Se,variant:`label-primary`,children:`條件規則`}),(0,a.jsx)(i.Typography,{color:`text-neutral`,style:b,variant:`body`,children:`只有需要根據其他欄位改變顯示、必填或唯讀狀態時才需要設定。`}),Ln(e)]})})}function un(e,t,n,r){return O(e)?_n(e,t):(0,c.isNumberFieldDefinition)(e)?vn(e,t):(0,c.isDateFieldDefinition)(e)?yn(e,t):(0,l.isFormOptionFieldDefinition)(e)?bn(e,t,n,r):e.type===`boolean`?Pn(e,t):e.type===`file_upload`?In(e,t):(0,l.isMemberFieldDefinition)(e)?Fn(e,t):(0,l.isTableFieldDefinition)(e)?dn(e):null}function dn(e){let t=(0,c.readFormTableRowBounds)(e);return(0,a.jsxs)(a.Fragment,{children:[$(`最少列數`,`fieldMinRows`,Q(e.minRows,t=>J(e.fieldKey,e=>({...e,minRows:t})),`例如:1`,{max:t.maxRows,min:0})),$(`最多列數`,`fieldMaxRows`,Q(e.maxRows,t=>J(e.fieldKey,e=>({...e,maxRows:t})),`未設定即為 ${l.FORM_TABLE_MAX_ROWS}`,{max:l.FORM_TABLE_MAX_ROWS,min:Math.max(t.minRows,1)})),$(`新增列按鈕文字`,`fieldAddRowLabel`,(0,a.jsx)(i.Input,{onChange:t=>J(e.fieldKey,e=>({...e,addRowLabel:t.target.value||void 0})),placeholder:`預設為「新增一列」`,value:e.addRowLabel??``,variant:`base`}))]})}function fn(e){return(0,a.jsxs)(`div`,{style:Ke,children:[(0,a.jsxs)(`div`,{style:qe,children:[(0,a.jsxs)(i.Typography,{component:`h3`,variant:`label-primary`,children:[`欄(`,e.columns.length,`)`]}),(0,a.jsx)(i.Button,{icon:s.PlusIcon,iconType:`leading`,onClick:()=>Ht(e),size:`sub`,type:`button`,variant:`base-secondary`,children:`新增欄`})]}),pn(e)]})}function pn(e){let t=e.columns.map((t,n)=>({fieldKey:t.fieldKey,index:n,key:`${e.fieldKey}-column-${n}`,label:t.label,type:t.type})),n=[{key:`label`,render:t=>(0,a.jsx)(i.Input,{fullWidth:!0,onChange:n=>Y(e,t.index,{...X(e,t.index),label:n.target.value}),placeholder:`例如:數量`,size:`sub`,value:t.label,variant:`base`}),title:`標題`},{key:`type`,render:t=>(0,a.jsx)(i.Select,{fullWidth:!0,clearable:!1,menuMaxHeight:ie,onChange:n=>hn(e,t.index,n?.id),options:[...v],size:`sub`,value:(0,c.readSelectOption)(v,t.type)}),title:`型別`},{key:`required`,render:t=>(0,a.jsx)(i.Toggle,{checked:X(e,t.index).required===!0,inputProps:{"aria-label":`${t.label||t.fieldKey} 必填`},onChange:n=>Y(e,t.index,{...X(e,t.index),required:n.target.checked}),size:`sub`}),title:`必填`}],r={render:t=>[{disabled:()=>e.columns.length<=1,icon:s.TrashIcon,iconType:`leading`,name:`移除此欄`,onClick:()=>H({columnIndex:t.index,columnKey:t.fieldKey,fieldKey:e.fieldKey,kind:`remove-column`}),variant:`destructive-ghost`}],width:104},o=It===null?void 0:t[It]?.key;return(0,a.jsx)(i.Table,{actions:r,columns:n,dataSource:t,draggable:{enabled:!0,onDragEnd:(t,n)=>Wt(e,n.fromIndex,n.toIndex)},expandable:{expandedRowKeys:o?[o]:[],expandedRowRender:t=>mn(e,t.index),onExpand:(e,t)=>U(e?t.index:null)},fullWidth:!0,rowHeightPreset:`roomy`,showHeader:!0,size:`sub`})}function mn(e,t){let n=e.columns[t];return n?(0,a.jsxs)(`div`,{style:Ge,children:[$(`欄位 Key`,`columnFieldKey`,(0,a.jsx)(i.Input,{onChange:r=>Y(e,t,{...n,fieldKey:r.target.value}),placeholder:`例如:qty`,value:n.fieldKey,variant:`base`})),$(`提示文字`,`columnPlaceholder`,(0,a.jsx)(i.Input,{onChange:r=>Y(e,t,{...n,placeholder:r.target.value||void 0}),placeholder:`例如:請輸入數量`,value:n.placeholder??``,variant:`base`})),un(n,n=>{(0,l.isTableColumnFieldType)(n.type)&&Y(e,t,n)},(n,r)=>{(0,l.isTableColumnFieldType)(r.type)&&Y(e,t,r)},e.columns)]}):null}function hn(e,t,n){let r=e.columns[t],i=v.find(e=>e.id===n)?.id;if(!r||!i||r.type===i)return;let a=vt(r,i),o=ft(r);o.length===0?(Y(e,t,a),U(t)):H({columnIndex:t,columnKey:r.fieldKey,fieldKey:e.fieldKey,impact:`「${r.label||r.fieldKey}」改為${gn(i)}後,這一欄的${o.join(`、`)}會被捨棄。`,kind:`replace-column`,nextColumn:a})}function gn(e){return v.find(t=>t.id===e)?.name??e}function X(e,t){let n=e.columns[t];if(!n)throw Error(`Table ${e.fieldKey} has no column at index ${t}.`);return n}function _n(e,t){return(0,a.jsxs)(a.Fragment,{children:[$(`預設值`,`fieldDefaultValue`,e.type===`textarea`?Bn({name:`fieldDefaultValue`,onChange:n=>t({...e,defaultValue:n||void 0}),placeholder:`輸入此欄位的預設文字`,rows:3,value:k(e.defaultValue)}):(0,a.jsx)(i.Input,{onChange:n=>t({...e,defaultValue:n.target.value||void 0}),placeholder:`輸入此欄位的預設文字`,value:k(e.defaultValue),variant:`base`})),$(`最小長度`,`fieldMinLength`,Q(e.minLength,n=>t({...e,minLength:n}),`例如:2`,{min:0})),$(`最大長度`,`fieldMaxLength`,Q(e.maxLength,n=>t({...e,maxLength:n}),`例如:100`,{min:1})),$(`格式(正規表示式)`,`fieldPattern`,(0,a.jsx)(i.Input,{onChange:n=>t(mt(e,n.target.value)),placeholder:`例如:[0-9]{8}`,value:e.pattern??``,variant:`base`}),!1,gt(e.pattern)),e.pattern?$(`格式錯誤訊息`,`fieldPatternErrorMessage`,(0,a.jsx)(i.Input,{onChange:n=>t(ht(e,n.target.value)),placeholder:`例如:統一編號為 8 位數字。`,value:e.patternErrorMessage??``,variant:`base`}),!1,_t(e.patternErrorMessage)):null]})}function vn(e,t){return(0,a.jsxs)(a.Fragment,{children:[$(`預設值`,`fieldDefaultValue`,Q(typeof e.defaultValue==`number`?e.defaultValue:void 0,n=>t({...e,defaultValue:n}),e.type===`money`?`例如:1000`:`輸入預設數值`,{max:e.maximum,min:e.minimum})),$(`最小值`,`fieldMinimum`,Q(e.minimum,n=>t({...e,minimum:n}),`例如:0`)),$(`最大值`,`fieldMaximum`,Q(e.maximum,n=>t({...e,maximum:n}),`例如:999999`))]})}function yn(e,t){return $(`預設值`,`fieldDefaultValue`,Vn(e,k(e.defaultValue),n=>t({...e,defaultValue:n})))}function bn(e,t,n,r){let o=(0,c.readCompatibleFormDataSourceDescriptors)(e.type,L),s={commit:e=>t(e),rowColumns:r},u=(0,l.isFormDataSourceFieldDefinition)(e)?E(e.dataSource):x,d=(0,l.isFormDataSourceFieldDefinition)(e)?L.find(t=>t.key===e.dataSource.key&&t.version===e.dataSource.version):null,f=d?o.some(e=>e.key===d.key&&e.version===d.version):!1,p=[...$e,...o.map(ot),...(0,l.isFormDataSourceFieldDefinition)(e)&&!f?[{id:u,name:`${e.dataSource.key} v${e.dataSource.version}(目前不可用或不支援)`}]:[]],m=(0,l.readFormFieldSelectionMode)(e);return(0,a.jsxs)(a.Fragment,{children:[e.type===`select`||e.type===`autocomplete`?$(`選擇模式`,`fieldSelectionMode`,(0,a.jsx)(i.Select,{clearable:!1,onChange:t=>{(t?.id===`single`||t?.id===`multiple`)&&Gt(e,t.id,n)},options:[...et],value:(0,c.readSelectOption)(et,m)})):$(`選擇模式`,`fieldSelectionMode`,(0,a.jsx)(i.Typography,{color:`text-neutral`,variant:`body`,children:m===`multiple`?`固定複選`:`固定單選`})),$(`選項來源`,`fieldOptionSource`,(0,a.jsx)(i.Select,{clearable:!1,disabled:Mt===`loading`&&!(0,l.isFormDataSourceFieldDefinition)(e),onChange:n=>qt(e,n?.id,t),options:p,placeholder:`選擇選項來源`,value:(0,c.readSelectOption)(p,u)})),(0,l.isFormDataSourceFieldDefinition)(e)?xn(e,o,s):Nn(e,t)]})}function xn(e,t,n){let r=L.find(t=>t.key===e.dataSource.key&&t.version===e.dataSource.version),o=r&&!(0,c.isFormDataSourceDescriptorCompatible)(r,e.type);return(0,a.jsxs)(`div`,{style:ze,children:[Mt===`loading`?(0,a.jsx)(i.Typography,{color:`text-neutral`,variant:`body`,children:`正在載入可用的選項來源…`}):null,R?(0,a.jsx)(i.Typography,{color:`text-error`,variant:`body`,children:R}):null,r?null:(0,a.jsx)(i.Typography,{color:`text-warning`,variant:`body`,children:`找不到目前設定的來源版本。設定會保留,但這張表單在來源恢復前無法發布。`}),o?(0,a.jsx)(i.Typography,{color:`text-error`,variant:`body`,children:`這個來源不支援目前的控制項,請改選其他來源。`}):null,r?Sn(r):null,r&&r.parameters.length>0?Cn(e,r,n):null,t.length===0&&!R?(0,a.jsx)(i.Typography,{color:`text-warning`,variant:`body`,children:`沒有支援目前控制項的已註冊來源。`}):null,(0,a.jsx)(`div`,{style:He,children:(0,a.jsx)(i.Button,{disabled:Pt,loading:Pt,onClick:()=>void Xt(),size:`sub`,type:`button`,variant:`base-secondary`,children:`檢查全部動態選項設定`})}),z?(0,a.jsx)(`div`,{style:Be,children:z.length>0?z.map(e=>(0,a.jsx)(i.Typography,{color:`text-error`,variant:`caption`,children:e},e)):(0,a.jsx)(i.Typography,{color:`text-success`,variant:`caption`,children:`這張表單的動態選項設定都可以使用。`})}):null]})}function Sn(e){return(0,a.jsxs)(`div`,{style:We,children:[e.description?(0,a.jsx)(i.Typography,{variant:`body`,children:e.description}):null,(0,a.jsx)(`div`,{style:Ue,children:at(e).map(e=>(0,a.jsx)(i.Tag,{label:e,readOnly:!0,size:`minor`},e))}),(0,a.jsxs)(i.Typography,{color:`text-neutral`,variant:`caption`,children:[`來源代號:`,e.key,` · v`,e.version]})]})}function Cn(e,t,n){let r=t.parameters.map((e,t)=>({key:e.key,index:t,parameter:e}));return(0,a.jsxs)(`div`,{style:Ve,children:[(0,a.jsx)(i.Typography,{color:`text-neutral`,variant:`label-secondary`,children:`這個來源需要的條件`}),(0,a.jsx)(i.Table,{columns:[{key:`parameter`,render:e=>(0,a.jsxs)(`div`,{style:Je,children:[(0,a.jsx)(i.Typography,{variant:`input`,children:e.parameter.label??e.parameter.key}),e.parameter.required?(0,a.jsx)(i.Typography,{color:`text-error`,variant:`input`,children:`*`}):null]}),title:`條件`,width:100},{key:`binding`,width:268,render:t=>Tn(e,t.parameter,n),title:`值從哪裡來`},{key:`constant`,width:140,render:t=>(0,c.readFormDataSourceBindingValueKind)((0,c.readFormDataSourceBinding)(e,t.parameter.key))===`CONSTANT`?kn(e,t.parameter.key,t.parameter.type,(0,c.readFormDataSourceBinding)(e,t.parameter.key),n):(0,a.jsx)(i.Typography,{color:`text-neutral`,variant:`caption`,children:`—`}),title:`固定值`},{key:`meaning`,render:t=>(0,a.jsx)(i.Typography,{color:`text-neutral`,variant:`caption`,children:Dn((0,c.readFormDataSourceBinding)(e,t.parameter.key),t.parameter,n,wn(e,t.parameter,n))}),title:`填寫時的行為`}],dataSource:r,fullWidth:!0,showHeader:!0,size:`sub`})]})}function wn(e,t,n){return(0,c.readCompatibleFormDataSourceBindingFields)(t.type,m.fields,e.fieldKey).length+(n.rowColumns?(0,c.readCompatibleFormTableColumnBindingFields)(t.type,n.rowColumns,e.fieldKey).length:0)}function Tn(e,t,n){let r=st((0,c.readFormDataSourceBinding)(e,t.key)),o=n.rowColumns?(0,c.readCompatibleFormTableColumnBindingFields)(t.type,n.rowColumns,e.fieldKey).map(e=>({id:`${C}${e.id}`,name:`同列:${e.name}`})):[],s=[...t.required?[]:[{id:w,name:`未綁定`}],...o,...(0,c.readCompatibleFormDataSourceBindingFields)(t.type,m.fields,e.fieldKey),...t.type===`STRING_ARRAY`?[]:[{id:S,name:`固定常數`}]];return(0,a.jsx)(`div`,{"data-data-source-parameter":t.key,style:Ye,children:(0,a.jsx)(i.Select,{clearable:!1,fullWidth:!0,inputProps:{"aria-label":`${t.label??t.key} 的值來源`,title:(0,c.readSelectOption)(s,r)?.name??``},onChange:r=>jn(e,t.key,t.type,r?.id,n),options:s,placeholder:`選擇欄位或常數`,size:`sub`,value:(0,c.readSelectOption)(s,r)})})}function En(e){return ae[e]}function Dn(e,t,n,r){let i=(0,c.readFormDataSourceBindingValueKind)(e);return i===`CONSTANT`?`固定值,不隨填寫變動`:i===`FIELD`?`隨欄位「${On(e,n)}」變動`:i===`ROW_FIELD`?`隨同列「${On(e,n)}」變動`:t.required?r>0?`尚未設定,選項無法載入`:`沒有相容的${En(t.type)}欄位,請改用固定值`:`未設定,不做這層篩選`}function On(e,t){let n=e?.from;if(n?.kind===`FIELD`){let e=m.fields.find(e=>e.fieldKey===n.fieldKey);return e?e.label||e.fieldKey:``}if(n?.kind===`ROW_FIELD`){let e=t.rowColumns?.find(e=>e.fieldKey===n.columnKey);return e?e.label||e.fieldKey:``}return``}function kn(e,t,n,r,i){return(0,a.jsx)(`div`,{"data-data-source-constant":t,children:An(e,t,n,r,i)})}function An(e,t,n,r,o){let s=(0,c.readFormDataSourceBindingValue)(e,t);if(n===`BOOLEAN`){let n=[{id:`true`,name:`是`},{id:`false`,name:`否`}];return(0,a.jsx)(i.Select,{clearable:!1,fullWidth:!0,onChange:n=>Mn(e,t,n?.id===`true`,o),options:n,size:`sub`,value:(0,c.readSelectOption)(n,s===!0?`true`:`false`)})}return n===`STRING_ARRAY`?(0,a.jsx)(i.Typography,{color:`text-warning`,variant:`caption`,children:`這個條件要收多個值,請綁定一個複選欄位;不接受固定值。`}):(0,a.jsx)(i.Input,{onChange:r=>Mn(e,t,n===`NUMBER`?(0,c.parseOptionalNumberInput)(r.target.value)??0:r.target.value,o),placeholder:n===`NUMBER`?`輸入數字`:`輸入固定值`,value:lt(r,n),variant:`base`})}function jn(e,t,n,r,i){i.commit((0,c.upsertFormDataSourceFieldBinding)(e,t,ut(t,n,r)))}function Mn(e,t,n,r){r.commit((0,c.upsertFormDataSourceFieldBinding)(e,t,{from:{kind:`CONSTANT`,value:n},parameter:t}))}function Nn(e,t){let n=(0,l.readFormFieldSelectionMode)(e),r=Array.isArray(e.defaultValue)?e.defaultValue:[],o=e.options.map(c.readFieldOptionAsSelectOption),s=o.filter(e=>r.includes(e.id));return(0,a.jsxs)(a.Fragment,{children:[$(`預設值`,`fieldDefaultValue`,n===`multiple`?(0,a.jsx)(i.Select,{clearable:!0,mode:`multiple`,onChange:n=>t({...e,defaultValue:n.length?n.map(e=>e.id):void 0}),options:o,placeholder:`選擇一或多個預設選項`,value:s}):(0,a.jsx)(i.Select,{clearable:!0,onChange:n=>t({...e,defaultValue:n?.id||void 0}),options:o,placeholder:`選擇預設選項`,value:typeof e.defaultValue==`string`?(0,c.readSelectOption)(o,e.defaultValue):null})),$(`選項`,`fieldOptions`,Hn(e,t),!0)]})}function Pn(e,t){let n=typeof e.defaultValue==`boolean`?String(e.defaultValue):`unset`;return $(`預設值`,`fieldDefaultValue`,(0,a.jsx)(i.Select,{clearable:!1,onChange:n=>t({...e,defaultValue:n?.id===`true`||n?.id!==`false`&&void 0}),options:[...tt],placeholder:`選擇預設狀態`,value:(0,c.readSelectOption)(tt,n)}))}function Fn(e,t){return $(`可複選`,`fieldMemberMultiple`,(0,a.jsx)(i.Toggle,{checked:e.multiple===!0,label:e.multiple===!0?`可選多位`:`只能選一位`,onChange:n=>t({...e,defaultValue:void 0,multiple:n.target.checked||void 0}),size:`sub`}))}function In(e,t){return(0,a.jsxs)(a.Fragment,{children:[$(`檔案數`,`fieldMaxFiles`,Q(e.maxFiles,n=>t({...e,maxFiles:n}),`例如:1`,{min:1})),$(`MIME`,`fieldAcceptedMimeTypes`,Bn({name:`fieldAcceptedMimeTypes`,onChange:n=>t({...e,acceptedMimeTypes:St(n)}),placeholder:`每行一個 MIME type,例如:application/pdf`,rows:3,value:Ct(e.acceptedMimeTypes)}),!1)]})}function Ln(e){let t=m.fields.filter(t=>t.fieldKey!==e.fieldKey&&!(0,l.isMemberFieldDefinition)(t)&&!(0,l.isOrgUnitFieldDefinition)(t));return t.length?(0,a.jsx)(a.Fragment,{children:rt.map(n=>Rn(e,n,t))}):(0,a.jsx)(i.Typography,{color:`text-neutral`,style:b,variant:`body`,children:`目前沒有其他欄位可作為條件來源。新增更多欄位後即可設定條件規則。`})}function Rn(e,t,n){let r=e[t.target],o=r?(0,c.parseConditionRule)(r):null,s=n.find(e=>e.fieldKey===o?.fieldKey),l=s??n[0],u=n.map(xt),d=(0,c.readConditionOperatorOptions)(l),f=o&&d.some(e=>e.id===o.operator)?o.operator:(0,c.readDefaultConditionOperator)(l),p=o?.value??(0,c.readDefaultConditionValue)(l),m=!!r,h=m&&(!o||!s);return $(t.label,t.name,(0,a.jsxs)(`div`,{style:Me,children:[(0,a.jsx)(i.Toggle,{checked:m,label:m?`已啟用`:`不啟用`,onChange:e=>Z(t.target,e.target.checked?(0,c.buildConditionExpression)(l,(0,c.readDefaultConditionOperator)(l),(0,c.readDefaultConditionValue)(l)):void 0),size:`sub`,supportingText:t.supportingText}),m?h?(0,a.jsx)(i.Typography,{color:`text-warning`,variant:`body`,children:`這個規則不是目前 UI 支援的格式。重新選擇條件後會取代既有規則。`}):(0,a.jsxs)(`div`,{style:Ne,children:[(0,a.jsx)(i.Select,{clearable:!1,onChange:e=>{let r=n.find(t=>t.fieldKey===e?.id)??l;Z(t.target,(0,c.buildConditionExpression)(r,(0,c.readDefaultConditionOperator)(r),(0,c.readDefaultConditionValue)(r)))},options:u,placeholder:`選擇欄位`,value:(0,c.readSelectOption)(u,l.fieldKey)}),(0,a.jsx)(i.Select,{clearable:!1,onChange:e=>Z(t.target,(0,c.buildConditionExpression)(l,(0,c.readConditionOperatorOption)(e?.id)??f,p)),options:[...d],placeholder:`判斷方式`,value:(0,c.readSelectOption)(d,f)}),zn(l,p,e=>Z(t.target,(0,c.buildConditionExpression)(l,f,e)))]}):null]}),!0)}function Z(e,t){K({[e]:t})}function zn(e,t,n){if(e.type===`boolean`)return(0,a.jsx)(i.Select,{clearable:!1,onChange:e=>n(e?.id??`true`),options:[...nt],placeholder:`比較值`,value:(0,c.readSelectOption)(nt,t===`false`?`false`:`true`)});if((0,c.isSelectFieldDefinition)(e)){let r=e.options.map(c.readFieldOptionAsSelectOption);return(0,a.jsx)(i.Select,{clearable:!1,onChange:e=>n(e?.id??r[0]?.id??``),options:r,placeholder:`比較值`,value:(0,c.readSelectOption)(r,t)})}return(0,c.isNumberFieldDefinition)(e)?Q((0,c.parseOptionalNumberInput)(t),e=>n(String(e??0)),`比較值`):(0,c.isDateFieldDefinition)(e)?Vn(e,t,e=>n(e??``)):(0,a.jsx)(i.Input,{onChange:e=>n(e.target.value),placeholder:`比較值`,value:t,variant:`base`})}function Bn({name:e,onChange:t,placeholder:n,rows:r,value:o}){return(0,a.jsx)(i.Textarea,{"aria-label":e,onChange:e=>t(e.target.value),placeholder:n,ref:Xe,resize:`vertical`,rows:r,style:De,value:o})}function Q(e,t,n,r={}){return(0,a.jsx)(i.Input,{max:r.max,min:r.min,onChange:e=>t((0,c.clampOptionalNumber)((0,c.parseOptionalNumberInput)(e.target.value),r)),placeholder:n,showSpinner:!0,step:r.step??1,value:typeof e==`number`?String(e):``,variant:`measure`})}function Vn(e,t,n){return e.type===`datetime`?(0,a.jsx)(i.DateTimePicker,{formatDate:`YYYY-MM-DD`,formatTime:`HH:mm`,hideSecond:!0,onChange:e=>n((0,c.formatDateTimePickerValue)(e)),placeholderLeft:`選擇日期`,placeholderRight:`選擇時間`,value:(0,c.readDatePickerValue)(t)}):(0,a.jsx)(i.DatePicker,{format:`YYYY-MM-DD`,onChange:e=>n((0,c.formatDatePickerValue)(e)),placeholder:`選擇日期`,value:(0,c.readDatePickerValue)(t)})}function Hn(e,t){let n=e.options.map((t,n)=>({index:n,key:`${e.fieldKey}-${n}`,label:t.label,value:t.value}));return(0,a.jsxs)(`div`,{style:Ie,children:[(0,a.jsx)(i.Table,{actions:{render:n=>[{disabled:()=>e.options.length<=1,icon:s.TrashIcon,iconType:`icon-only`,name:`移除選項`,onClick:()=>t({...e,options:e.options.filter((e,t)=>t!==n.index)}),variant:`destructive-ghost`}],width:56},columns:[{key:`label`,render:n=>(0,a.jsx)(i.Input,{onChange:r=>t({...e,options:wt(e.options,n.index,{label:r.target.value})}),placeholder:`例如:主管`,size:`sub`,value:n.label,variant:`base`}),title:`Label`},{key:`value`,render:n=>(0,a.jsx)(i.Input,{onChange:r=>t({...e,options:wt(e.options,n.index,{value:r.target.value})}),placeholder:`例如:manager`,size:`sub`,value:n.value,variant:`base`}),title:`Value`}],dataSource:n,showHeader:!0,size:`sub`}),(0,a.jsx)(`div`,{style:Le,children:(0,a.jsx)(i.Button,{icon:s.PlusIcon,iconType:`leading`,onClick:()=>t({...e,options:[...e.options,Tt(e.options)]}),variant:`base-secondary`,children:`新增選項`})})]})}function Un(e,t,n){return(0,a.jsx)(`div`,{...t.draggableProps,"data-form-builder-field-key":e.fieldKey,ref:t.innerRef,style:{...he,...n?ge:null,...t.draggableProps.style},children:(0,a.jsx)(i.BaseCard,{style:e.fieldKey===W?.fieldKey?_e:void 0,children:Wn(e,t,n)})})}function $(e,n,r,i=!1,s){return(0,a.jsx)(`div`,{style:i?Te:we,children:(0,a.jsx)(`div`,{style:Ee,children:(0,a.jsx)(t.t,{label:e,layout:i?o.FormFieldLayout.VERTICAL:o.FormFieldLayout.STRETCH,name:n,...s?{hintText:s.text,severity:s.severity}:{},children:r})})})}function Wn(e,t,n){return(0,a.jsxs)(`div`,{...t.dragHandleProps??{},"aria-label":`選取或拖曳排序欄位`,onClick:()=>I(e.fieldKey),style:de,title:`點擊選取,拖曳排序`,children:[(0,a.jsx)(`span`,{"aria-label":`拖曳排序`,role:`img`,style:Pe,title:`拖曳排序`,children:(0,a.jsx)(i.Icon,{icon:s.DotDragVerticalIcon,size:20})}),(0,a.jsxs)(`div`,{style:fe,children:[(0,a.jsxs)(i.Typography,{component:`span`,ellipsis:!0,variant:`label-primary`,children:[e.label,e.required?(0,a.jsx)(`sup`,{"aria-label":`必填`,style:Re,children:`*`}):null]}),(0,a.jsxs)(i.Typography,{color:`text-neutral`,component:`span`,ellipsis:!0,variant:`caption`,children:[it(e.type),` ·`,e.required?` 必填`:` 選填`,` ·`,e.fieldKey,e.hidden?` · 只存不顯示`:null]})]}),(0,a.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:pe,children:[(0,a.jsx)(`div`,{style:me,children:(0,a.jsx)(i.Toggle,{checked:!!e.required,disabled:n||e.hidden===!0,label:`必填`,onChange:t=>nn(e.fieldKey,t.target.checked)})}),(0,a.jsx)(i.Button,{disabled:n,icon:s.TrashIcon,iconType:`icon-only`,onClick:()=>Rt(e.fieldKey),variant:`destructive-ghost`,children:`移除欄位`})]})]})}function Gn(){return(0,a.jsxs)(`div`,{style:y,children:[(0,a.jsx)(i.Typography,{component:`h2`,variant:`h3`,children:`填寫預覽`}),(0,a.jsx)(n.t,{dataSourceContext:{kind:`preview`},onChange:tn,schema:m,uiSchema:g,value:Et})]})}function Kn(){return(0,a.jsxs)(`div`,{style:y,children:[(0,a.jsx)(i.Typography,{component:`h2`,variant:`h3`,children:`Schema`}),(0,a.jsxs)(`div`,{style:Oe,children:[qn(`Form Schema`,`schemaJson`,(0,a.jsx)(ee,{height:`360px`,name:`schemaJson`,onChange:rn,placeholder:`輸入 Form Schema JSON`,value:ct})),qn(`UI Schema`,`uiSchemaJson`,(0,a.jsx)(ee,{height:`240px`,name:`uiSchemaJson`,onChange:an,placeholder:`輸入 UI Schema JSON`,value:pt})),Ot?(0,a.jsx)(i.Typography,{color:`text-error`,style:je,variant:`body`,children:Ot}):null]})]})}function qn(e,n,r){return(0,a.jsx)(`div`,{style:ke,children:(0,a.jsx)(`div`,{style:Ae,children:(0,a.jsx)(t.t,{label:e,name:n,children:r})})})}}function it(e){return _.find(t=>t.type===e)?.label??e}function E(e){return`${e.key}@${e.version}`}function at(e){return[e.supportsSearch?`可輸入關鍵字搜尋${e.minimumSearchLength>1?`(至少 ${e.minimumSearchLength} 字)`:``}`:`不支援搜尋`,e.paginationMode===`CURSOR`?`捲動載入更多(每次 ${e.pageSize} 筆)`:`一次載入完整清單(最多 ${e.maximumResultCount} 筆)`,e.revalidationPolicy===`ALWAYS`?`退回重送時一律重新確認`:`值與條件未變時沿用上次結果`]}function ot(e){return{id:E(e),name:e.label}}function st(e){return e?e.from.kind===`FIELD`?e.from.fieldKey:e.from.kind===`ROW_FIELD`?`${C}${e.from.columnKey}`:S:w}function ct(e){switch(e){case`BOOLEAN`:return!1;case`NUMBER`:return 0;case`STRING_ARRAY`:return``;case`STRING`:return``;default:return``}}function lt(e,t){let n=e?.from.kind===`CONSTANT`?e.from.value:``;return t===`NUMBER`?typeof n==`number`?String(n):``:typeof n==`string`?n:``}function ut(e,t,n){return!n||n===w?null:n===S?{from:{kind:`CONSTANT`,value:ct(t)},parameter:e}:n.startsWith(C)?{from:{columnKey:n.slice(14),kind:`ROW_FIELD`},parameter:e}:{from:{fieldKey:n,kind:`FIELD`},parameter:e}}function dt(e){return e.kind===`remove-field`?`確認移除 dependency 欄位`:e.kind===`remove-column`?`確認移除表格欄`:e.kind===`replace-column`?`確認變更欄型別`:`確認變更選擇模式`}var D=[{label:`選項 A`,value:`option_a`},{label:`選項 B`,value:`option_b`}];function ft(e){let t=[];return e.defaultValue!==void 0&&t.push(`預設值`),e.type===`text`&&(typeof e.minLength==`number`||typeof e.maxLength==`number`)&&t.push(`長度限制`),e.type===`text`&&e.pattern&&t.push(`格式`),e.type!==`number`&&e.type!==`money`||typeof e.minimum!=`number`&&typeof e.maximum!=`number`||t.push(`數值範圍`),(0,l.isFormDataSourceFieldDefinition)(e)?t.push(`選項來源設定`):(0,l.isFormStaticOptionFieldDefinition)(e)&&!pt(e.options)&&t.push(`${e.options.length} 個選項`),(e.type===`select`||e.type===`autocomplete`)&&e.mode===`multiple`&&t.push(`選擇模式`),t}function pt(e){return e.length===D.length&&e.every((e,t)=>e.label===D[t]?.label&&e.value===D[t]?.value)}function mt(e,t){return t?{...e,pattern:t}:Object.fromEntries(Object.entries(e).filter(([e])=>e!==`pattern`&&e!==`patternErrorMessage`))}function ht(e,t){return t?{...e,patternErrorMessage:t}:Object.fromEntries(Object.entries(e).filter(([e])=>e!==`patternErrorMessage`))}function gt(e){return e&&!e.trim()?{severity:`error`,text:`格式不能只有空白,儲存時會被拒絕。`}:e&&e.length>l.TEXT_FIELD_PATTERN_MAX_LENGTH?{severity:`error`,text:`格式最多 ${l.TEXT_FIELD_PATTERN_MAX_LENGTH} 個字元,儲存時會被拒絕。`}:e&&!(0,l.compileTextFieldPattern)(e)?{severity:`error`,text:`這不是有效的正規表示式,儲存時會被拒絕。格式以 u 模式檢查,多餘的跳脫(例如在方括號 [ ] 外寫 \\-)也算錯誤。`}:e&&(0,l.hasRepeatedTextFieldPatternGroup)(e)?{severity:`error`,text:`格式裡的括號群組後面不能接重複次數(例如 (ab)+、(\\w|\\d)*、(ab){2}),填寫的內容可能讓系統卡住,儲存時會被拒絕。請把重複的部分直接寫出來,或改用 [ ] 字元集合加次數。`}:{severity:`info`,text:`填寫的內容要整段符合格式才能送出;留空表示不檢查格式。`}}function _t(e){return e&&e.length>l.TEXT_FIELD_PATTERN_ERROR_MESSAGE_MAX_LENGTH?{severity:`error`,text:`錯誤訊息最多 ${l.TEXT_FIELD_PATTERN_ERROR_MESSAGE_MAX_LENGTH} 個字元,儲存時會被拒絕。`}:void 0}function vt(e,t){let n={fieldKey:e.fieldKey,label:e.label,required:e.required,...e.description?{description:e.description}:{},...e.placeholder?{placeholder:e.placeholder}:{}};return t===`select`||t===`autocomplete`?{...n,mode:`single`,options:[...D],type:t}:{...n,type:t}}function yt(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>e!==t))}function bt(e){return!!(e.visibleWhen||e.requiredWhen||e.readonlyWhen)}function xt(e){return{id:e.fieldKey,name:e.label}}function O(e){return e.type===`text`||e.type===`textarea`}function k(e){return typeof e==`string`?e:``}function St(e){let t=e.split(/[\n,]/u).map(e=>e.trim()).filter(Boolean);return t.length?t:void 0}function Ct(e){return e?.join(`
2
+ `)??``}function A(e){return JSON.stringify(e,null,2)}function wt(e,t,n){return e.map((e,r)=>r===t?{...e,...n}:e)}function Tt(e){let t=e.length+1;return{label:`選項 ${t}`,value:j(e,t)}}function j(e,t){let n=`option_${t}`;return e.some(e=>e.value===n)?j(e,t+1):n}function M(e,t,n){let r=e[t];if(!r||t===n)return[...e];let i=e.filter((e,n)=>n!==t);return[...i.slice(0,n),r,...i.slice(n)]}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return T}});
3
+ //# sourceMappingURL=FormBuilderView-CHaAQL5v.cjs.map