@rytass/bpm-core-react 0.15.0 → 0.17.0

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