@rytass/bpm-core-react 0.22.0 → 0.23.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 (87) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/chunks/{FormBuilderView-DbfbLZCI.js → FormBuilderView-D_bN9gzT.js} +675 -614
  3. package/dist/chunks/FormBuilderView-D_bN9gzT.js.map +1 -0
  4. package/dist/chunks/FormBuilderView-bm8P55hp.cjs +4 -0
  5. package/dist/chunks/FormBuilderView-bm8P55hp.cjs.map +1 -0
  6. package/dist/chunks/FormRendererView-BlQgJOkI.cjs +6 -0
  7. package/dist/chunks/FormRendererView-BlQgJOkI.cjs.map +1 -0
  8. package/dist/chunks/{FormRendererView-CAyPXhPq.js → FormRendererView-CemHvfAT.js} +298 -290
  9. package/dist/chunks/FormRendererView-CemHvfAT.js.map +1 -0
  10. package/dist/chunks/compose-CdKVQfjB.cjs +2 -0
  11. package/dist/chunks/compose-CdKVQfjB.cjs.map +1 -0
  12. package/dist/chunks/{compose-U1zs3Yof.js → compose-N9657E5u.js} +161 -147
  13. package/dist/chunks/compose-N9657E5u.js.map +1 -0
  14. package/dist/chunks/{designer-DPG7R_WP.js → designer-CKwG_vM5.js} +1913 -1715
  15. package/dist/chunks/designer-CKwG_vM5.js.map +1 -0
  16. package/dist/chunks/designer-JPs7EijM.cjs +69 -0
  17. package/dist/chunks/designer-JPs7EijM.cjs.map +1 -0
  18. package/dist/chunks/detail-Dqu0K9QM.cjs +5 -0
  19. package/dist/chunks/detail-Dqu0K9QM.cjs.map +1 -0
  20. package/dist/chunks/{detail-CHZDNNM6.js → detail-fW0vJudE.js} +902 -895
  21. package/dist/chunks/detail-fW0vJudE.js.map +1 -0
  22. package/dist/chunks/instance-error-message-BKt07-Bo.js +270 -0
  23. package/dist/chunks/instance-error-message-BKt07-Bo.js.map +1 -0
  24. package/dist/chunks/instance-error-message-BL_X7Af8.cjs +2 -0
  25. package/dist/chunks/instance-error-message-BL_X7Af8.cjs.map +1 -0
  26. package/dist/pages/instances/detail/index.cjs +1 -1
  27. package/dist/pages/instances/detail/index.js +1 -1
  28. package/dist/pages/templates/compose/index.cjs +1 -1
  29. package/dist/pages/templates/compose/index.js +1 -1
  30. package/dist/pages/templates/designer/index.cjs +1 -1
  31. package/dist/pages/templates/designer/index.js +1 -1
  32. package/dist/views/forms/builder/index.cjs +1 -1
  33. package/dist/views/forms/builder/index.js +1 -1
  34. package/dist/views/forms/renderer/FormRendererView.d.cts +26 -1
  35. package/dist/views/forms/renderer/FormRendererView.d.ts +26 -1
  36. package/dist/views/forms/renderer/index.cjs +1 -1
  37. package/dist/views/forms/renderer/index.js +1 -1
  38. package/dist/views/instances/approver-filled-form.d.cts +56 -20
  39. package/dist/views/instances/approver-filled-form.d.ts +56 -20
  40. package/dist/views/instances/detail/index.cjs +1 -1
  41. package/dist/views/instances/detail/index.js +1 -1
  42. package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +7 -0
  43. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +7 -0
  44. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +1 -1
  45. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +1 -1
  46. package/dist/views/instances/new/index.cjs +1 -1
  47. package/dist/views/instances/new/index.js +2 -2
  48. package/dist/views/templates/compose/index.cjs +1 -1
  49. package/dist/views/templates/compose/index.js +1 -1
  50. package/dist/views/templates/compose/steps/ComposeReviewStep.d.cts +3 -1
  51. package/dist/views/templates/compose/steps/ComposeReviewStep.d.ts +3 -1
  52. package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.cts +4 -1
  53. package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.ts +4 -1
  54. package/dist/views/templates/compose/use-template-compose-wizard.d.cts +3 -1
  55. package/dist/views/templates/compose/use-template-compose-wizard.d.ts +3 -1
  56. package/dist/views/templates/designer/TemplateDesignerView.d.cts +10 -1
  57. package/dist/views/templates/designer/TemplateDesignerView.d.ts +10 -1
  58. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +3 -1
  59. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +3 -1
  60. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.cts +3 -2
  61. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.ts +3 -2
  62. package/dist/views/templates/designer/index.cjs +1 -1
  63. package/dist/views/templates/designer/index.js +1 -1
  64. package/dist/views/templates/designer/launch-mode.d.cts +19 -0
  65. package/dist/views/templates/designer/launch-mode.d.ts +19 -0
  66. package/dist/views/templates/designer/publish-default-value-check.d.cts +36 -0
  67. package/dist/views/templates/designer/publish-default-value-check.d.ts +36 -0
  68. package/package.json +3 -3
  69. package/dist/chunks/FormBuilderView-Bok4Y59D.cjs +0 -4
  70. package/dist/chunks/FormBuilderView-Bok4Y59D.cjs.map +0 -1
  71. package/dist/chunks/FormBuilderView-DbfbLZCI.js.map +0 -1
  72. package/dist/chunks/FormRendererView-CAyPXhPq.js.map +0 -1
  73. package/dist/chunks/FormRendererView-iLlHFIUR.cjs +0 -6
  74. package/dist/chunks/FormRendererView-iLlHFIUR.cjs.map +0 -1
  75. package/dist/chunks/compose-DP1N4twA.cjs +0 -2
  76. package/dist/chunks/compose-DP1N4twA.cjs.map +0 -1
  77. package/dist/chunks/compose-U1zs3Yof.js.map +0 -1
  78. package/dist/chunks/designer-CWL-dCQ_.cjs +0 -69
  79. package/dist/chunks/designer-CWL-dCQ_.cjs.map +0 -1
  80. package/dist/chunks/designer-DPG7R_WP.js.map +0 -1
  81. package/dist/chunks/detail-BUfsSal0.cjs +0 -5
  82. package/dist/chunks/detail-BUfsSal0.cjs.map +0 -1
  83. package/dist/chunks/detail-CHZDNNM6.js.map +0 -1
  84. package/dist/chunks/instance-error-message-BEM4O_Kj.js +0 -208
  85. package/dist/chunks/instance-error-message-BEM4O_Kj.js.map +0 -1
  86. package/dist/chunks/instance-error-message-BpCLCOjp.cjs +0 -2
  87. package/dist/chunks/instance-error-message-BpCLCOjp.cjs.map +0 -1
@@ -6,12 +6,12 @@ import { AutoComplete as s, Button as c, CheckboxGroup as l, DatePicker as u, Da
6
6
  import { resolveMembers as b, searchMembers as x } from "@rytass/bpm-core-client";
7
7
  import { jsx as S, jsxs as C } from "react/jsx-runtime";
8
8
  import { FormFieldDensity as w, FormFieldLayout as T } from "@mezzanine-ui/core/form";
9
- import { buildFormRendererValues as E, clampOptionalNumber as D, createFormTableRow as O, formatDatePickerValue as k, formatDateTimePickerValue as A, isFormRendererFieldReadonly as j, isFormRendererFieldRequired as M, mergeFormDataSourceOptions as N, parseOptionalNumberInput as ee, previewFormFieldOptions as te, previewResolveFormFieldOptions as ne, readDatePickerValue as P, readFieldOptionAsSelectOption as F, readFormDataSourceErrorCode as re, readFormDataSourceErrorMessage as ie, readFormDataSourceSelectedValues as ae, readFormDataSourceValueSignature as I, readFormFieldOptions as oe, readFormTableCellPath as se, readFormTableRowBounds as ce, readFormTableRows as L, readMissingFormDataSourceDependencies as le, readMissingFormDataSourceOptionValues as R, readSelectOption as z, readSelectedFormDataSourceOptions as ue, readVisibleFormRendererFields as B, resolveFormFieldOptions as de } from "@rytass/bpm-core-client/form";
10
- import { PlusIcon as V, TrashIcon as fe } from "@mezzanine-ui/icons";
11
- import { isFormDataSourceFieldDefinition as pe, isFormStaticOptionFieldDefinition as me, isFormTableCellValue as he, isTableFieldDefinition as H, readFormFieldSelectionMode as ge, readFormMemberIds as _e } from "@rytass/bpm-core-shared/form";
12
- import { resolveOrgUnitOptions as ve, searchOrgUnitOptions as ye } from "@rytass/bpm-core-client/organization";
9
+ import { buildFormRendererValues as E, clampOptionalNumber as D, createFormTableRow as O, formatDatePickerValue as k, formatDateTimePickerValue as A, isFormRendererFieldReadonly as j, isFormRendererFieldRequired as M, mergeFormDataSourceOptions as N, parseOptionalNumberInput as P, previewFormFieldOptions as ee, previewResolveFormFieldOptions as te, readDatePickerValue as F, readFieldOptionAsSelectOption as I, readFormDataSourceErrorCode as ne, readFormDataSourceErrorMessage as re, readFormDataSourceSelectedValues as ie, readFormDataSourceValueSignature as L, readFormFieldOptions as ae, readFormTableCellPath as oe, readFormTableRowBounds as se, readFormTableRows as ce, readMissingFormDataSourceDependencies as le, readMissingFormDataSourceOptionValues as ue, readSelectOption as R, readSelectedFormDataSourceOptions as de, readVisibleFormRendererFields as z, resolveFormFieldOptions as fe } from "@rytass/bpm-core-client/form";
10
+ import { PlusIcon as B, TrashIcon as V } from "@mezzanine-ui/icons";
11
+ import { isFormDataSourceFieldDefinition as pe, isFormStaticOptionFieldDefinition as me, isFormTableCellValue as he, isTableFieldDefinition as H, readFormFieldSelectionMode as U, readFormMemberIds as ge } from "@rytass/bpm-core-shared/form";
12
+ import { resolveOrgUnitOptions as _e, searchOrgUnitOptions as ve } from "@rytass/bpm-core-client/organization";
13
13
  // src/views/forms/renderer/form-data-source-field.ts
14
- var be = {
14
+ var ye = {
15
15
  canRetry: !1,
16
16
  error: null,
17
17
  hasValue: !1,
@@ -24,16 +24,16 @@ var be = {
24
24
  options: [],
25
25
  retry: () => void 0,
26
26
  status: "IDLE"
27
- }, xe = [], Se = 10, Ce = 300, we = ["FORM_DATA_SOURCE_SEARCH_NOT_SUPPORTED", "FORM_DATA_SOURCE_SEARCH_TOO_SHORT"];
28
- function Te(e, t) {
27
+ }, W = [], be = 10, xe = 300, Se = ["FORM_DATA_SOURCE_SEARCH_NOT_SUPPORTED", "FORM_DATA_SOURCE_SEARCH_TOO_SHORT"];
28
+ function Ce(e, t) {
29
29
  if (!t.row) return e;
30
30
  let n = t.fieldPath?.indexOf(".") ?? -1;
31
31
  return t.fieldPath && n > 0 ? t.fieldPath.slice(0, n) : null;
32
32
  }
33
- function Ee(e, t) {
33
+ function we(e, t) {
34
34
  return t === null ? e : Object.fromEntries(Object.entries(e).filter(([e]) => e !== t));
35
35
  }
36
- function De(e, t) {
36
+ function Te(e, t) {
37
37
  let n = e.from;
38
38
  switch (n.kind) {
39
39
  case "FIELD": return {
@@ -47,32 +47,32 @@ function De(e, t) {
47
47
  };
48
48
  case "EXPRESSION": return {
49
49
  expression: n.expression,
50
- form: Ee(t.formData, t.ownFormKey),
51
- row: t.rowValues ? Ee(t.rowValues, t.ownRowKey) : null
50
+ form: we(t.formData, t.ownFormKey),
51
+ row: t.rowValues ? we(t.rowValues, t.ownRowKey) : null
52
52
  };
53
- default: return U(n);
53
+ default: return Ee(n);
54
54
  }
55
55
  }
56
- function U(e) {
56
+ function Ee(e) {
57
57
  return { unsupported: !0 };
58
58
  }
59
- function Oe(e) {
60
- return JSON.stringify(ke(e)) ?? "null";
59
+ function De(e) {
60
+ return JSON.stringify(G(e)) ?? "null";
61
61
  }
62
- function ke(e) {
63
- return Array.isArray(e) ? e.map(ke) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => [e, ke(t)])) : e;
62
+ function G(e) {
63
+ return Array.isArray(e) ? e.map(G) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => [e, G(t)])) : e;
64
64
  }
65
- function W(e) {
65
+ function Oe(e) {
66
66
  let t = pe(e.field) ? e.field : null, s = e.fieldPath ?? t?.fieldKey ?? "", c = t ? e.optionSnapshots?.[e.snapshotKey ?? t.fieldKey] : void 0, l = t ? JSON.stringify({
67
67
  dataSource: t.dataSource,
68
68
  fieldKey: t.fieldKey,
69
69
  type: t.type
70
- }) : "", u = JSON.stringify(c ?? null), d = i(() => c?.options ?? [], [u]), f = JSON.stringify(e.formData), p = JSON.stringify(e.initialFormData ?? {}), m = JSON.stringify(e.schema), h = JSON.stringify(e.uiSchema), g = e.context?.kind, _ = e.context?.kind === "runtime" ? e.context.instanceId : void 0, v = e.context?.kind === "runtime" ? e.context.templateId : void 0, y = JSON.stringify(e.row?.values ?? null), b = JSON.stringify(e.row?.initialValues ?? null), x = t ? e.row ? e.row.values[t.fieldKey] : e.formData[t.fieldKey] : void 0, S = I(x), C = i(() => ae(x), [S]), w = C.length > 0, T = t ? JSON.stringify(t.dataSource.bindings.map((n) => De(n, {
70
+ }) : "", 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 = L(x), C = i(() => ie(x), [S]), w = C.length > 0, T = t ? JSON.stringify(t.dataSource.bindings.map((n) => Te(n, {
71
71
  formData: e.formData,
72
- ownFormKey: Te(t.fieldKey, e),
72
+ ownFormKey: Ce(t.fieldKey, e),
73
73
  ownRowKey: e.row ? t.fieldKey : null,
74
74
  rowValues: e.row?.values
75
- }))) : "", D = t ? JSON.stringify(e.initialFormData !== void 0 || e.initialValue !== void 0 ? x ?? null : null) : "", O = t ? `${T}\u0000${D}` : "", k = Ae(T, t?.dataSource.bindings.some((e) => e.from.kind === "EXPRESSION") ? Ce : 0), A = k !== T, j = i(() => {
75
+ }))) : "", D = t ? JSON.stringify(e.initialFormData !== void 0 || e.initialValue !== void 0 ? x ?? null : null) : "", O = t ? `${T}\u0000${D}` : "", k = ke(T, t?.dataSource.bindings.some((e) => e.from.kind === "EXPRESSION") ? xe : 0), A = k !== T, j = i(() => {
76
76
  if (g === "preview") return { kind: "preview" };
77
77
  if (g === "runtime" && !e.readonly) return {
78
78
  instanceId: _,
@@ -84,85 +84,85 @@ function W(e) {
84
84
  g,
85
85
  v,
86
86
  e.readonly
87
- ]), M = t ? (e.initialFormData !== void 0 || e.initialValue !== void 0) && I(e.initialValue) !== S : !1, ee = t ? e.initialFormData !== void 0 && t.dataSource.bindings.some((n) => {
88
- if (n.from.kind === "FIELD") return I(e.initialFormData?.[n.from.fieldKey]) !== I(e.formData[n.from.fieldKey]);
89
- if (n.from.kind === "ROW_FIELD" && e.row?.initialValues) return I(e.row.initialValues[n.from.columnKey]) !== I(e.row.values[n.from.columnKey]);
87
+ ]), M = t ? (e.initialFormData !== void 0 || e.initialValue !== void 0) && L(e.initialValue) !== S : !1, P = t ? e.initialFormData !== void 0 && t.dataSource.bindings.some((n) => {
88
+ if (n.from.kind === "FIELD") return L(e.initialFormData?.[n.from.fieldKey]) !== L(e.formData[n.from.fieldKey]);
89
+ if (n.from.kind === "ROW_FIELD" && e.row?.initialValues) return L(e.row.initialValues[n.from.columnKey]) !== L(e.row.values[n.from.columnKey]);
90
90
  if (n.from.kind === "EXPRESSION") {
91
91
  if (!j) return !1;
92
92
  let r = {
93
- ownFormKey: Te(t.fieldKey, e),
93
+ ownFormKey: Ce(t.fieldKey, e),
94
94
  ownRowKey: e.row ? t.fieldKey : null
95
95
  };
96
- return Oe(De(n, {
96
+ return De(Te(n, {
97
97
  ...r,
98
98
  formData: E(e.schema.fields, e.initialFormData ?? {}),
99
99
  rowValues: e.row?.initialValues ?? e.row?.values
100
- })) !== Oe(De(n, {
100
+ })) !== De(Te(n, {
101
101
  ...r,
102
102
  formData: E(e.schema.fields, e.formData),
103
103
  rowValues: e.row?.values
104
104
  }));
105
105
  }
106
106
  return !1;
107
- }) : !1, P = !!t?.dataSource.bindings.some((e) => e.from.kind === "EXPRESSION"), [F, se] = o(() => ({
107
+ }) : !1, F = !!t?.dataSource.bindings.some((e) => e.from.kind === "EXPRESSION"), [I, oe] = o(() => ({
108
108
  bindings: k,
109
109
  value: S
110
110
  }));
111
- F.value !== S && se({
111
+ I.value !== S && oe({
112
112
  bindings: k,
113
113
  value: S
114
114
  });
115
- let ce = !!(P && j && w && F.value === S && F.bindings !== k), L = !!((c || w) && (M || ee || ce)), R = !!(t && j && L && w), z = Pe({
115
+ let se = !!(F && j && w && I.value === S && I.bindings !== k), ce = !(!t || c || e.initialFormData !== void 0 || e.initialValue !== void 0 || t.defaultValue === void 0 || S !== L(t.defaultValue)), ue = !!((c || w) && (M || P || se || ce)), R = !!(t && j && ue && w), z = Ne({
116
116
  hasSnapshot: !!c,
117
117
  hasValue: w,
118
- isStale: L,
118
+ isStale: ue,
119
119
  readonly: e.readonly
120
- }), B = !!(t && j && t.type !== "autocomplete"), V = Fe(L, B && t !== null && le(t, e.formData, e.row?.values).length > 0), fe = a(z);
121
- fe.current = z;
122
- let [me, he] = o([]), [H, ge] = o(""), [_e, ve] = o(null), [ye, xe] = o(null), [Ee, U] = o(() => t ? B ? V : z : "IDLE"), [ke, W] = o(null), [je, G] = o(!1), Me = a(0), K = a(0), q = a(0), Be = a(null), Ve = a(null), J = a(!1), He = a({
120
+ }), B = !!(t && j && t.type !== "autocomplete"), V = Pe(ue, B && t !== null && le(t, e.formData, e.row?.values).length > 0), me = a(z);
121
+ me.current = z;
122
+ let [he, H] = o([]), [U, ge] = o(""), [_e, ve] = o(null), [W, we] = o(null), [Ee, G] = o(() => t ? B ? V : z : "IDLE"), [Oe, K] = o(null), [Ae, je] = o(!1), q = a(0), J = a(0), Y = a(0), ze = a(null), Be = a(null), Ve = a(!1), He = a({
123
123
  cursor: null,
124
124
  searchText: ""
125
- }), Y = i(() => ze(e.formData), [f]), X = i(() => e.row ? ze(e.row.values) : void 0, [y]), Ue = i(() => N(d, me), [me, d]), We = ye && ye.signature === O && ye.valueSignature === S ? ye : null, Ge = R && !We, Ke = !!(ce && We && We.unresolvedValues.length > 0), qe = Ne({
125
+ }), X = i(() => Re(e.formData), [f]), Z = i(() => e.row ? Re(e.row.values) : void 0, [y]), Ue = i(() => N(d, he), [he, d]), We = W && W.signature === O && W.valueSignature === S ? W : null, Ge = R && !We, Ke = !!(se && We && We.unresolvedValues.length > 0), qe = Me({
126
126
  options: Ue,
127
127
  resolution: We,
128
128
  resolvePending: Ge,
129
129
  value: x
130
- }), Z = n((n, r) => {
130
+ }), Q = n((n, r) => {
131
131
  if (!t || !j) return;
132
- let i = K.current + 1;
133
- K.current = i, J.current = !0, He.current = {
132
+ let i = J.current + 1;
133
+ J.current = i, Ve.current = !0, He.current = {
134
134
  cursor: r,
135
135
  searchText: n
136
- }, Be.current?.abort();
136
+ }, ze.current?.abort();
137
137
  let a = new AbortController();
138
- Be.current = a, U(V), G(r !== null), W(null), (j.kind === "preview" ? te({
138
+ ze.current = a, G(V), je(r !== null), K(null), (j.kind === "preview" ? ee({
139
139
  cursor: r,
140
140
  fieldKey: s,
141
- formData: Y,
142
- rowValues: X,
141
+ formData: X,
142
+ rowValues: Z,
143
143
  schema: e.schema,
144
144
  searchText: n,
145
145
  signal: a.signal,
146
146
  uiSchema: e.uiSchema
147
- }) : oe({
147
+ }) : ae({
148
148
  cursor: r,
149
149
  fieldKey: s,
150
- formData: Y,
150
+ formData: X,
151
151
  instanceId: j.instanceId ?? null,
152
- rowValues: X,
152
+ rowValues: Z,
153
153
  searchText: n,
154
154
  signal: a.signal,
155
155
  templateId: j.templateId ?? null
156
156
  })).then((e) => {
157
- Re(a, K, i) || (G(!1), he((t) => {
158
- let n = ue(x, t);
157
+ Le(a, J, i) || (je(!1), H((t) => {
158
+ let n = de(x, t);
159
159
  return N(n, r ? t : [], e.options);
160
- }), ve(e.nextCursor), W(null), Me.current = r ? Me.current + e.options.length : e.options.length, e.nextCursor && e.options.length > 0 && Me.current < Se && Q.current(n, e.nextCursor), U(e.waitingForFieldKeys.length ? "WAITING_FOR_DEPENDENCIES" : "VALID"));
160
+ }), ve(e.nextCursor), K(null), q.current = r ? q.current + e.options.length : e.options.length, e.nextCursor && e.options.length > 0 && q.current < be && Je.current(n, e.nextCursor), G(e.waitingForFieldKeys.length ? "WAITING_FOR_DEPENDENCIES" : "VALID"));
161
161
  }).catch((e) => {
162
- if (Re(a, K, i)) return;
163
- r === null && (J.current = !1), G(!1);
164
- let t = ie(e) ?? "選項來源暫時無法使用。", n = re(e);
165
- W(t), U(Ie(!!(n && we.includes(n)), w));
162
+ if (Le(a, J, i)) return;
163
+ r === null && (Ve.current = !1), je(!1);
164
+ let t = re(e) ?? "選項來源暫時無法使用。", n = ne(e);
165
+ K(t), G(Fe(!!(n && Se.includes(n)), w));
166
166
  });
167
167
  }, [
168
168
  S,
@@ -171,41 +171,41 @@ function W(e) {
171
171
  w,
172
172
  V,
173
173
  s,
174
- Y,
175
174
  X,
175
+ Z,
176
176
  m,
177
177
  h
178
- ]), Q = a(Z);
179
- Q.current = Z;
180
- let Je = n(() => {
178
+ ]), Je = a(Q);
179
+ Je.current = Q;
180
+ let Ye = n(() => {
181
181
  if (!t || !j || C.length === 0) return;
182
- let n = O, r = S, i = q.current + 1;
183
- q.current = i, Ve.current?.abort();
182
+ let n = O, r = S, i = Y.current + 1;
183
+ Y.current = i, Be.current?.abort();
184
184
  let a = new AbortController();
185
- Ve.current = a, W(null), (j.kind === "preview" ? ne({
185
+ Be.current = a, K(null), (j.kind === "preview" ? te({
186
186
  fieldKey: s,
187
- formData: Y,
188
- rowValues: X,
187
+ formData: X,
188
+ rowValues: Z,
189
189
  schema: e.schema,
190
190
  signal: a.signal,
191
191
  uiSchema: e.uiSchema,
192
192
  values: C
193
- }) : de({
193
+ }) : fe({
194
194
  fieldKey: s,
195
- formData: Y,
195
+ formData: X,
196
196
  instanceId: j.instanceId ?? null,
197
- rowValues: X,
197
+ rowValues: Z,
198
198
  signal: a.signal,
199
199
  templateId: j.templateId ?? null,
200
200
  values: C
201
201
  })).then((e) => {
202
- Re(a, q, i) || (e.waitingForFieldKeys.length ? U("WAITING_FOR_DEPENDENCIES") : (he((t) => N(t, e.options)), xe({
202
+ Le(a, Y, i) || (e.waitingForFieldKeys.length ? G("WAITING_FOR_DEPENDENCIES") : (H((t) => N(t, e.options)), we({
203
203
  signature: n,
204
204
  unresolvedValues: e.unresolvedValues,
205
205
  valueSignature: r
206
- }), U("VALID")));
206
+ }), G("VALID")));
207
207
  }).catch((e) => {
208
- Re(a, q, i) || (U("UNAVAILABLE"), W(ie(e) ?? "選項來源暫時無法使用。"));
208
+ Le(a, Y, i) || (G("UNAVAILABLE"), K(re(e) ?? "選項來源暫時無法使用。"));
209
209
  });
210
210
  }, [
211
211
  S,
@@ -213,14 +213,14 @@ function W(e) {
213
213
  l,
214
214
  j,
215
215
  s,
216
- Y,
217
216
  X,
217
+ Z,
218
218
  m,
219
219
  C,
220
220
  h
221
- ]), Ye = a(Je);
222
- Ye.current = Je, r(() => {
223
- K.current += 1, J.current = !1, Be.current?.abort(), G(!1), he((e) => ue(x, e)), ve((e) => e === null ? e : null), ge((e) => e && ""), W((e) => e && null), t ? B ? Q.current("", null) : U(fe.current) : U("IDLE");
221
+ ]), Xe = a(Ye);
222
+ Xe.current = Ye, r(() => {
223
+ J.current += 1, Ve.current = !1, ze.current?.abort(), je(!1), H((e) => de(x, e)), ve((e) => e === null ? e : null), ge((e) => e && ""), K((e) => e && null), t ? B ? Je.current("", null) : G(me.current) : G("IDLE");
224
224
  }, [
225
225
  B,
226
226
  l,
@@ -232,13 +232,13 @@ function W(e) {
232
232
  e.readonly,
233
233
  u
234
234
  ]), r(() => {
235
- t && !B && U(z);
235
+ t && !B && G(z);
236
236
  }, [
237
237
  B,
238
238
  l,
239
239
  z
240
240
  ]), r(() => {
241
- R && !A && Ye.current();
241
+ R && !A && Xe.current();
242
242
  }, [
243
243
  j,
244
244
  R,
@@ -246,57 +246,57 @@ function W(e) {
246
246
  k,
247
247
  D
248
248
  ]), r(() => () => {
249
- Be.current?.abort(), Ve.current?.abort();
249
+ ze.current?.abort(), Be.current?.abort();
250
250
  }, []);
251
- let Xe = n((e) => {
252
- ge(e), he((e) => ue(x, e)), ve(null), Z(e, null);
253
- }, [Z]), Ze = n(() => {
254
- B || !j || e.readonly || J.current && H === "" || Xe("");
251
+ let Ze = n((e) => {
252
+ ge(e), H((e) => de(x, e)), ve(null), Q(e, null);
253
+ }, [Q]), Qe = n(() => {
254
+ B || !j || e.readonly || Ve.current && U === "" || Ze("");
255
255
  }, [
256
256
  B,
257
257
  j,
258
258
  e.readonly,
259
- Xe,
260
- H
261
- ]), Qe = a({
259
+ Ze,
260
+ U
261
+ ]), $e = a({
262
262
  cursor: _e,
263
- searchText: H
263
+ searchText: U
264
264
  });
265
- Qe.current = {
265
+ $e.current = {
266
266
  cursor: _e,
267
- searchText: H
267
+ searchText: U
268
268
  };
269
- let $e = n(() => {
270
- let { cursor: e, searchText: t } = Qe.current;
271
- e && Q.current(t, e);
272
- }, []), et = n(() => {
273
- j && (Z(He.current.searchText, He.current.cursor), R && Ye.current());
269
+ let et = n(() => {
270
+ let { cursor: e, searchText: t } = $e.current;
271
+ e && Je.current(t, e);
272
+ }, []), tt = n(() => {
273
+ j && (Q(He.current.searchText, He.current.cursor), R && Xe.current());
274
274
  }, [
275
275
  j,
276
- Z,
276
+ Q,
277
277
  R
278
278
  ]);
279
279
  return t ? {
280
280
  canRetry: !!j,
281
- error: ke,
281
+ error: Oe,
282
282
  hasValue: w,
283
283
  hasNextPage: !!_e,
284
- loadingNextPage: je,
284
+ loadingNextPage: Ae,
285
285
  invalidValues: qe,
286
- onOpen: Ze,
287
- onReachBottom: $e,
288
- onSearch: Xe,
286
+ onOpen: Qe,
287
+ onReachBottom: et,
288
+ onSearch: Ze,
289
289
  options: Ue,
290
- retry: et,
290
+ retry: tt,
291
291
  selectionExpired: Ke,
292
- status: A && j && (B || w) ? B ? V : "STALE" : Le({
292
+ status: A && j && (B || w) ? B ? V : "STALE" : Ie({
293
293
  invalidValues: qe,
294
294
  resolvePending: Ge,
295
295
  status: Ee
296
296
  })
297
- } : be;
297
+ } : ye;
298
298
  }
299
- function Ae(e, t) {
299
+ function ke(e, t) {
300
300
  let [n, i] = o(e);
301
301
  return r(() => {
302
302
  if (t <= 0) return;
@@ -308,70 +308,70 @@ function Ae(e, t) {
308
308
  };
309
309
  }, [t, e]), t > 0 ? n : e;
310
310
  }
311
- function je(e) {
311
+ function K(e) {
312
312
  switch (e.status) {
313
313
  case "WAITING_FOR_DEPENDENCIES": return "請先填寫相依欄位。";
314
314
  case "STALE": return "選項需要重新載入或驗證。";
315
- case "INVALID": return e.selectionExpired ? ie("FORM_DATA_SOURCE_VALUE_NOT_RESOLVED") : e.invalidValues.length ? `無法辨識選項:${e.invalidValues.join("、")}` : "目前選項已失效,請重新選擇。";
315
+ case "INVALID": return e.selectionExpired ? re("FORM_DATA_SOURCE_VALUE_NOT_RESOLVED") : e.invalidValues.length ? `無法辨識選項:${e.invalidValues.join("、")}` : "目前選項已失效,請重新選擇。";
316
316
  case "UNAVAILABLE": return e.error ?? "選項來源暫時無法使用。";
317
317
  case "VALID": return e.error ?? (e.options.length ? null : "目前沒有可用選項。");
318
318
  default: return e.error;
319
319
  }
320
320
  }
321
- function G(e) {
321
+ function Ae(e) {
322
322
  return e.hasValue && e.status !== "VALID";
323
323
  }
324
+ function je(e) {
325
+ let t = e.filter(Ae);
326
+ return t.length === 0 ? null : t.some((e) => e.status === "INVALID" && e.selectionExpired === !0) ? re("FORM_DATA_SOURCE_VALUE_NOT_RESOLVED") : t.every((e) => e.status === "LOADING" || e.status === "STALE") ? "選項驗證中,請稍候再送出。" : "請先完成動態選項驗證。";
327
+ }
324
328
  function Me(e) {
325
- let t = e.filter(G);
326
- return t.length === 0 ? null : t.some((e) => e.status === "INVALID" && e.selectionExpired === !0) ? ie("FORM_DATA_SOURCE_VALUE_NOT_RESOLVED") : t.every((e) => e.status === "LOADING" || e.status === "STALE") ? "選項驗證中,請稍候再送出。" : "請先完成動態選項驗證。";
329
+ return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ? W : ue(e.value, e.options);
327
330
  }
328
331
  function Ne(e) {
329
- return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ? xe : R(e.value, e.options);
330
- }
331
- function Pe(e) {
332
332
  return e.isStale ? "STALE" : e.hasSnapshot ? "VALID" : e.readonly && e.hasValue ? "UNAVAILABLE" : "IDLE";
333
333
  }
334
- function Fe(e, t) {
334
+ function Pe(e, t) {
335
335
  return t ? "WAITING_FOR_DEPENDENCIES" : e ? "STALE" : "LOADING";
336
336
  }
337
- function Ie(e, t) {
337
+ function Fe(e, t) {
338
338
  return e ? t ? "VALID" : "IDLE" : "UNAVAILABLE";
339
339
  }
340
- function Le(e) {
340
+ function Ie(e) {
341
341
  return e.status === "LOADING" || e.status === "UNAVAILABLE" || e.status === "WAITING_FOR_DEPENDENCIES" ? e.status : e.invalidValues.length ? "INVALID" : e.resolvePending ? "STALE" : e.status;
342
342
  }
343
- function Re(e, t, n) {
343
+ function Le(e, t, n) {
344
344
  return e.signal.aborted || t.current !== n;
345
345
  }
346
- function ze(e) {
346
+ function Re(e) {
347
347
  return Object.entries(e).reduce((e, [t, n]) => n === void 0 ? e : {
348
348
  ...e,
349
349
  [t]: n
350
350
  }, {});
351
351
  }
352
352
  // src/views/forms/renderer/form-value-readers.ts
353
- function K(e) {
353
+ function q(e) {
354
354
  return Array.isArray(e) && e.every((e) => typeof e == "string") ? e : [];
355
355
  }
356
356
  // src/views/forms/renderer/file-upload-field.tsx
357
- function q(e) {
357
+ function J(e) {
358
358
  return e.some((e) => e.pendingCount > 0) ? "附件仍在上傳中,請稍候再送出。" : e.some((e) => e.failedCount > 0) ? "有附件上傳失敗,請重試或移除後再送出。" : null;
359
359
  }
360
- function Be() {
360
+ function Y() {
361
361
  let [e, t] = o({}), r = n((e, n) => t((t) => ({
362
362
  ...t,
363
363
  [e]: n
364
364
  })), []);
365
365
  return {
366
- blockMessage: q(Object.values(e)),
366
+ blockMessage: J(Object.values(e)),
367
367
  onFileUploadStateChange: r
368
368
  };
369
369
  }
370
- var Ve = "無法讀取檔名的附件", J = "此處無法上傳附件";
371
- function He({ attachments: e, field: t, onChange: s, onDownloadAttachment: c, onStateChange: l, onUploadAttachment: u, readonly: d, value: f }) {
372
- let [p, m] = o([]), [h, g] = o(() => /* @__PURE__ */ new Map()), [_, v] = o([]), b = K(f), x = b.join("\n"), C = i(() => new Map((e ?? []).map((e) => [e.id, e])), [e]), w = i(() => {
370
+ var ze = "無法讀取檔名的附件", Be = "此處無法上傳附件";
371
+ function Ve({ attachments: e, field: t, onChange: s, onDownloadAttachment: c, onStateChange: l, onUploadAttachment: u, readonly: d, value: f }) {
372
+ let [p, m] = o([]), [h, g] = o(() => /* @__PURE__ */ new Map()), [_, v] = o([]), b = q(f), x = b.join("\n"), C = i(() => new Map((e ?? []).map((e) => [e.id, e])), [e]), w = i(() => {
373
373
  let e = new Map(_.map((e, t) => [e, t]));
374
- return [...b.map((e) => h.get(e) ?? Y(e, C.get(e))), ...p].sort((t, n) => (e.get(t.id) ?? -1) - (e.get(n.id) ?? -1));
374
+ return [...b.map((e) => h.get(e) ?? He(e, C.get(e))), ...p].sort((t, n) => (e.get(t.id) ?? -1) - (e.get(n.id) ?? -1));
375
375
  }, [
376
376
  C,
377
377
  _,
@@ -400,7 +400,7 @@ function He({ attachments: e, field: t, onChange: s, onDownloadAttachment: c, on
400
400
  T.current = e, v(e.map((e) => e.id)), m(e.filter((e) => e.status !== "done")), i.length > 0 && g((e) => new Map([...e, ...i.map((e) => [e.id, e])])), n.join("\n") !== x && s(n.length ? n : void 0);
401
401
  }
402
402
  async function N(e) {
403
- if (!u) throw Error(J);
403
+ if (!u) throw Error(Be);
404
404
  return {
405
405
  file: e,
406
406
  id: (await u(t, e)).id,
@@ -408,20 +408,20 @@ function He({ attachments: e, field: t, onChange: s, onDownloadAttachment: c, on
408
408
  status: "done"
409
409
  };
410
410
  }
411
- async function ee(e, t) {
411
+ async function P(e, t) {
412
412
  let n = await N(t).catch((n) => ({
413
- errorMessage: Ue(n),
413
+ errorMessage: Z(n),
414
414
  file: t,
415
415
  id: e,
416
416
  status: "error"
417
417
  }));
418
418
  D.current(T.current.map((t) => t.id === e ? n : t));
419
419
  }
420
- function te(e, t) {
421
- h.has(e) ? We(t) : c?.(e);
420
+ function ee(e, t) {
421
+ h.has(e) ? Ue(t) : c?.(e);
422
422
  }
423
- let ne = !!u && !d, P = [...!d && !u ? [{
424
- label: J,
423
+ let te = !!u && !d, F = [...!d && !u ? [{
424
+ label: Be,
425
425
  type: "info"
426
426
  }] : [], ...p.filter((e) => e.status === "error").map((e) => ({
427
427
  label: `${e.file?.name ?? "檔案"}:${e.errorMessage ?? "上傳失敗"},未附加。請重試或刪除。`,
@@ -429,19 +429,19 @@ function He({ attachments: e, field: t, onChange: s, onDownloadAttachment: c, on
429
429
  }))];
430
430
  return /* @__PURE__ */ S(y, {
431
431
  accept: t.acceptedMimeTypes?.join(","),
432
- disabled: !ne,
432
+ disabled: !te,
433
433
  files: w,
434
- ...P.length > 0 ? { hints: P } : {},
434
+ ...F.length > 0 ? { hints: F } : {},
435
435
  maxFiles: t.maxFiles,
436
436
  mode: "button-list",
437
437
  ...(t.maxFiles ?? 1) > 1 ? { multiple: !0 } : {},
438
438
  onChange: O,
439
- onDownload: te,
439
+ onDownload: ee,
440
440
  onReload: (e, t) => {
441
- ee(e, t);
441
+ P(e, t);
442
442
  },
443
443
  onUpload: async (e) => Promise.all(e.map(async (e) => N(e).catch((t) => ({
444
- errorMessage: Ue(t),
444
+ errorMessage: Z(t),
445
445
  file: e,
446
446
  id: `failed-${e.name}-${e.lastModified}-${Math.random()}`,
447
447
  status: "error"
@@ -449,7 +449,7 @@ function He({ attachments: e, field: t, onChange: s, onDownloadAttachment: c, on
449
449
  size: "sub"
450
450
  });
451
451
  }
452
- function Y(e, t) {
452
+ function He(e, t) {
453
453
  return t ? {
454
454
  file: X(t),
455
455
  id: e,
@@ -459,34 +459,34 @@ function Y(e, t) {
459
459
  id: e,
460
460
  progress: 100,
461
461
  status: "done",
462
- url: Ve
462
+ url: ze
463
463
  };
464
464
  }
465
465
  function X(e) {
466
466
  let t = new File([], e.filename), n = Number(e.sizeBytes);
467
467
  return Number.isFinite(n) && n >= 0 && Object.defineProperty(t, "size", { value: n }), t;
468
468
  }
469
- function Ue(e) {
469
+ function Z(e) {
470
470
  return e instanceof Error && e.message ? `上傳失敗:${e.message}` : "上傳失敗,請重試。";
471
471
  }
472
- function We(e) {
472
+ function Ue(e) {
473
473
  let t = URL.createObjectURL(e), n = document.createElement("a");
474
474
  n.href = t, n.download = e.name, n.style.display = "none", document.body.appendChild(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 3e4);
475
475
  }
476
476
  // src/views/forms/renderer/form-field-link.ts
477
- var Ge = /\s/u;
478
- function Ke(e) {
477
+ var We = /\s/u;
478
+ function Ge(e) {
479
479
  return [...e].some((e) => {
480
480
  let t = e.codePointAt(0) ?? 0;
481
- return t <= 32 || t >= 127 && t <= 160 || Ge.test(e);
481
+ return t <= 32 || t >= 127 && t <= 160 || We.test(e);
482
482
  });
483
483
  }
484
- var qe = /^https?:\/\//iu;
485
- function Z(e) {
486
- return typeof e != "string" || !e || e.includes("\\") || Ke(e) ? null : e.startsWith("/") ? !e.startsWith("//") && Je(e) ? {
484
+ var Ke = /^https?:\/\//iu;
485
+ function qe(e) {
486
+ return typeof e != "string" || !e || e.includes("\\") || Ge(e) ? null : e.startsWith("/") ? !e.startsWith("//") && Je(e) ? {
487
487
  external: !1,
488
488
  href: e
489
- } : null : qe.test(e) && Ye(e) ? {
489
+ } : null : Ke.test(e) && Ye(e) ? {
490
490
  external: !0,
491
491
  href: e
492
492
  } : null;
@@ -570,10 +570,10 @@ function nt(e, t) {
570
570
  }
571
571
  function rt(e, t) {
572
572
  let n = new Set(t.filter((e) => !e.unresolved).map((e) => e.id));
573
- return _e(e).filter((e) => !n.has(e));
573
+ return ge(e).filter((e) => !n.has(e));
574
574
  }
575
575
  function it(e, t) {
576
- return _e(e).map((e) => t.find((t) => t.id === e) ?? tt(e));
576
+ return ge(e).map((e) => t.find((t) => t.id === e) ?? tt(e));
577
577
  }
578
578
  function at(e, t) {
579
579
  if (e.length !== 0) return t ? e.map((e) => e.id) : e[0]?.id;
@@ -693,7 +693,7 @@ function yt({ name: e, onChange: t, placeholder: n, readonly: i, size: c, value:
693
693
  let [u, d] = o([]), [f, p] = o([]), [m, h] = o(!1), [g, _] = o(!1), y = a(0), b = ht(l, u);
694
694
  r(() => {
695
695
  let e = !1;
696
- return b === null ? () => void 0 : (ve([b]).then((e) => {
696
+ return b === null ? () => void 0 : (_e([b]).then((e) => {
697
697
  let t = e.map(lt);
698
698
  return t.some((e) => e.id.toLowerCase() === b.toLowerCase()) ? t : [...t, dt(b)];
699
699
  }).catch(() => [dt(b)]).then((t) => {
@@ -706,7 +706,7 @@ function yt({ name: e, onChange: t, placeholder: n, readonly: i, size: c, value:
706
706
  let t = y.current + 1;
707
707
  y.current = t, h(!0);
708
708
  try {
709
- let n = (await ye(e)).map(lt);
709
+ let n = (await ve(e)).map(lt);
710
710
  y.current === t && (p(n), _(!1), d((e) => gt(e, n)));
711
711
  } catch {
712
712
  y.current === t && (p([]), _(!0));
@@ -767,8 +767,8 @@ var bt = {
767
767
  function wt(e) {
768
768
  e && (e.style.width = "100%");
769
769
  }
770
- function Tt({ attachments: e, dataSourceContext: t, dataSourceInitialValues: n, emptyText: s = "尚未建立欄位。", errors: c = {}, fieldAccess: l, fieldLabelMarkers: u, maxWidth: d, onChange: f, onDataSourceStateChange: p, onDownloadAttachment: m, onFileUploadStateChange: h, onUploadAttachment: g, optionSnapshots: _, readonly: y = !1, schema: b, singleColumn: x = !1, uiSchema: C, value: w }) {
771
- let T = i(() => ({
770
+ function Tt({ attachments: e, dataSourceContext: t, dataSourceInitialValues: n, emptyText: s = "尚未建立欄位。", errors: c = {}, fieldAccess: l, fieldLabelMarkers: u, maxWidth: d, onChange: f, onDataSourceStateChange: p, onDownloadAttachment: m, onFileUploadStateChange: h, onUploadAttachment: g, optionSnapshots: _, readonly: y = !1, schema: b, singleColumn: x = !1, tableAccess: C, uiSchema: w, value: T }) {
771
+ let D = i(() => ({
772
772
  attachments: e,
773
773
  onDownloadAttachment: m,
774
774
  onStateChange: h,
@@ -778,34 +778,34 @@ function Tt({ attachments: e, dataSourceContext: t, dataSourceInitialValues: n,
778
778
  m,
779
779
  h,
780
780
  g
781
- ]), [D, O] = o(() => E(b.fields, w ?? {})), k = i(() => E(b.fields, w ?? D), [
782
- D,
781
+ ]), [O, k] = o(() => E(b.fields, T ?? {})), A = i(() => E(b.fields, T ?? O), [
782
+ O,
783
783
  b.fields,
784
- w
785
- ]), A = a(k), j = i(() => B(b, C, k).filter((e) => Et(l, e.fieldKey)?.visible !== !1), [
784
+ T
785
+ ]), j = a(A), M = i(() => z(b, w, A).filter((e) => Et(l, e.fieldKey)?.visible !== !1), [
786
786
  l,
787
787
  b,
788
- C,
789
- k
788
+ w,
789
+ A
790
790
  ]);
791
791
  r(() => {
792
- A.current = k;
793
- }, [k]), r(() => {
794
- O((e) => E(b.fields, w ?? e));
795
- }, [b.fields, w]);
796
- function M(e, t) {
792
+ j.current = A;
793
+ }, [A]), r(() => {
794
+ k((e) => E(b.fields, T ?? e));
795
+ }, [b.fields, T]);
796
+ function N(e, t) {
797
797
  let n = {
798
- ...A.current,
798
+ ...j.current,
799
799
  [e]: t
800
800
  };
801
- A.current = n, w || O(n), f?.(n);
801
+ j.current = n, T || k(n), f?.(n);
802
802
  }
803
- return j.length ? /* @__PURE__ */ S("div", {
803
+ return M.length ? /* @__PURE__ */ S("div", {
804
804
  style: {
805
805
  ...bt,
806
806
  ...x ? { width: "100%" } : {}
807
807
  },
808
- children: j.map((e) => /* @__PURE__ */ S(Ot, {
808
+ children: M.map((e) => /* @__PURE__ */ S(At, {
809
809
  dataSourceContext: t,
810
810
  dataSourceInitialValues: n,
811
811
  field: e,
@@ -813,20 +813,21 @@ function Tt({ attachments: e, dataSourceContext: t, dataSourceInitialValues: n,
813
813
  errors: c,
814
814
  fields: b.fields,
815
815
  labelMarker: u !== void 0 && Object.prototype.hasOwnProperty.call(u, e.fieldKey) ? u[e.fieldKey] : void 0,
816
- onChange: M,
817
- fileUpload: T,
816
+ onChange: N,
817
+ fileUpload: D,
818
818
  onDataSourceStateChange: p,
819
819
  optionSnapshots: _,
820
- readonly: Dt(Et(l, e.fieldKey), y),
820
+ readonly: kt(e, Et(l, e.fieldKey), Ot(C, e.fieldKey), y),
821
821
  schema: b,
822
+ tableAccess: Ot(C, e.fieldKey),
822
823
  style: {
823
824
  ...St,
824
- gridColumn: `span ${x ? 12 : qt(e, C)}`,
825
+ gridColumn: `span ${x ? 12 : Yt(e, w)}`,
825
826
  ...x && !H(e) ? { maxWidth: d } : {}
826
827
  },
827
- value: k[e.fieldKey],
828
- values: k,
829
- uiSchema: C
828
+ value: A[e.fieldKey],
829
+ values: A,
830
+ uiSchema: w
830
831
  }, e.fieldKey))
831
832
  }) : /* @__PURE__ */ S("div", {
832
833
  style: bt,
@@ -844,32 +845,38 @@ function Et(e, t) {
844
845
  function Dt(e, t) {
845
846
  return e === void 0 ? t : !e.editable;
846
847
  }
847
- function Ot({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors: a, field: o, fields: s, fileUpload: l, labelMarker: u, onChange: d, onDataSourceStateChange: f, optionSnapshots: p, readonly: m, schema: h, style: g, value: _, values: y, uiSchema: b }) {
848
- let x = M(o, s, y), w = m || j(o, s, y), T = W({
848
+ function Ot(e, t) {
849
+ return e !== void 0 && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
850
+ }
851
+ function kt(e, t, n, r) {
852
+ return n !== void 0 && H(e) ? r : Dt(t, r);
853
+ }
854
+ function At({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors: a, field: o, fields: s, fileUpload: l, labelMarker: u, onChange: d, onDataSourceStateChange: f, optionSnapshots: p, readonly: m, schema: h, style: g, tableAccess: _, value: y, values: b, uiSchema: x }) {
855
+ let w = M(o, s, b), T = m || j(o, s, b), E = Oe({
849
856
  context: t,
850
857
  field: o,
851
- formData: y,
858
+ formData: b,
852
859
  initialFormData: n,
853
860
  initialValue: n?.[o.fieldKey],
854
861
  optionSnapshots: p,
855
- readonly: w,
862
+ readonly: T,
856
863
  schema: h,
857
- uiSchema: b
858
- }), E = je(T), D = JSON.stringify({
859
- hasValue: T.hasValue,
860
- invalidValues: T.invalidValues,
861
- selectionExpired: T.selectionExpired === !0,
862
- status: T.status
864
+ uiSchema: x
865
+ }), D = K(E), O = JSON.stringify({
866
+ hasValue: E.hasValue,
867
+ invalidValues: E.invalidValues,
868
+ selectionExpired: E.selectionExpired === !0,
869
+ status: E.status
863
870
  });
864
871
  return r(() => {
865
872
  pe(o) && f?.(o.fieldKey, {
866
- hasValue: T.hasValue,
867
- invalidValues: T.invalidValues,
868
- selectionExpired: T.selectionExpired === !0,
869
- status: T.status
873
+ hasValue: E.hasValue,
874
+ invalidValues: E.invalidValues,
875
+ selectionExpired: E.selectionExpired === !0,
876
+ status: E.status
870
877
  });
871
878
  }, [
872
- D,
879
+ O,
873
880
  o.fieldKey,
874
881
  f
875
882
  ]), /* @__PURE__ */ C("div", {
@@ -879,10 +886,10 @@ function Ot({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
879
886
  /* @__PURE__ */ S(e, {
880
887
  label: o.label,
881
888
  ...u ? { labelOptionalMarker: u } : {},
882
- ...H(o) ? It : {},
889
+ ...H(o) ? Rt : {},
883
890
  name: o.fieldKey,
884
- required: x,
885
- children: H(o) ? /* @__PURE__ */ S(Rt, {
891
+ required: w,
892
+ children: H(o) ? /* @__PURE__ */ S(Bt, {
886
893
  dataSourceContext: t,
887
894
  dataSourceInitialValues: n,
888
895
  errors: a,
@@ -890,26 +897,27 @@ function Ot({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
890
897
  onChange: d,
891
898
  onDataSourceStateChange: f,
892
899
  optionSnapshots: p,
893
- readonly: w,
900
+ readonly: T,
894
901
  schema: h,
895
- uiSchema: b,
896
- value: _,
897
- values: y
898
- }) : Wt(o, _, w, d, l, t, T)
902
+ tableAccess: _,
903
+ uiSchema: x,
904
+ value: y,
905
+ values: b
906
+ }) : Kt(o, y, T, d, l, t, E)
899
907
  }),
900
908
  i ? /* @__PURE__ */ S(v, {
901
909
  color: "text-error",
902
910
  variant: "caption",
903
911
  children: i
904
912
  }) : null,
905
- E ? /* @__PURE__ */ C("div", {
906
- style: Mt,
913
+ D ? /* @__PURE__ */ C("div", {
914
+ style: Pt,
907
915
  children: [/* @__PURE__ */ S(v, {
908
- color: T.status === "INVALID" || T.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
916
+ color: E.status === "INVALID" || E.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
909
917
  variant: "caption",
910
- children: E
911
- }), T.status === "UNAVAILABLE" && T.canRetry ? /* @__PURE__ */ S(c, {
912
- onClick: T.retry,
918
+ children: D
919
+ }), E.status === "UNAVAILABLE" && E.canRetry ? /* @__PURE__ */ S(c, {
920
+ onClick: E.retry,
913
921
  size: "sub",
914
922
  type: "button",
915
923
  variant: "base-ghost",
@@ -919,100 +927,100 @@ function Ot({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
919
927
  ]
920
928
  });
921
929
  }
922
- var kt = "(另開新分頁)", At = "另開新分頁", jt = {
930
+ var jt = "(另開新分頁)", Mt = "另開新分頁", Nt = {
923
931
  color: "inherit",
924
932
  textDecoration: "underline",
925
933
  wordBreak: "break-all"
926
- }, Mt = {
934
+ }, Pt = {
927
935
  alignItems: "center",
928
936
  display: "flex",
929
937
  gap: 8
930
- }, Nt = {
938
+ }, Ft = {
931
939
  display: "grid",
932
940
  gap: 8,
933
941
  minWidth: 0,
934
942
  width: "100%"
935
- }, Pt = {
943
+ }, It = {
936
944
  display: "flex",
937
945
  justifyContent: "flex-start"
938
- }, Ft = 160, It = {
946
+ }, Lt = 160, Rt = {
939
947
  density: w.BASE,
940
948
  layout: T.STRETCH
941
- }, Lt = {
949
+ }, zt = {
942
950
  display: "grid",
943
951
  gap: 4,
944
952
  minWidth: 0
945
953
  };
946
- function Rt({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field: i, onChange: s, onDataSourceStateChange: l, optionSnapshots: u, readonly: d, schema: f, uiSchema: p, value: m, values: g }) {
947
- let _ = L(m), v = ce(i), y = a(0), [b, x] = o(() => _.map(() => Vt(y)));
954
+ function Bt({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field: i, onChange: s, onDataSourceStateChange: l, optionSnapshots: u, readonly: d, schema: f, tableAccess: p, uiSchema: m, value: g, values: _ }) {
955
+ let v = ce(g), y = se(i), b = p?.lockRows === !0, x = (e) => p === void 0 || p.editableColumns.includes(e), w = a(0), [T, E] = o(() => v.map(() => Ut(w)));
948
956
  r(() => {
949
- b.length !== _.length && x(_.map(() => Vt(y)));
950
- }, [b.length, _.length]);
951
- function w(e) {
957
+ T.length !== v.length && E(v.map(() => Ut(w)));
958
+ }, [T.length, v.length]);
959
+ function D(e) {
952
960
  s(i.fieldKey, e);
953
961
  }
954
- function T() {
955
- x([...b, Vt(y)]), w([..._, O(i.columns)]);
962
+ function k() {
963
+ E([...T, Ut(w)]), D([...v, O(i.columns)]);
956
964
  }
957
- function E(e) {
958
- x(b.filter((t, n) => n !== e)), w(_.filter((t, n) => n !== e));
965
+ function A(e) {
966
+ E(T.filter((t, n) => n !== e)), D(v.filter((t, n) => n !== e));
959
967
  }
960
- function D(e, t, n) {
961
- w(_.map((r, i) => i === e ? Ht(r, t, n) : r));
968
+ function j(e, t, n) {
969
+ D(v.map((r, i) => i === e ? Wt(r, t, n) : r));
962
970
  }
963
- let k = _.map((e, t) => ({
971
+ let M = v.map((e, t) => ({
964
972
  ...e,
965
973
  index: t,
966
- key: b[t] ?? `row-${t}`
967
- })), A = i.columns.map((r) => ({
974
+ key: T[t] ?? `row-${t}`
975
+ })), N = i.columns.map((r) => ({
968
976
  key: r.fieldKey,
969
- minWidth: Ft,
970
- render: (a) => /* @__PURE__ */ S(zt, {
977
+ minWidth: Lt,
978
+ render: (a) => /* @__PURE__ */ S(Vt, {
971
979
  column: r,
972
980
  dataSourceContext: e,
973
- error: n[se(i.fieldKey, a.index, r.fieldKey)] ?? null,
981
+ error: n[oe(i.fieldKey, a.index, r.fieldKey)] ?? null,
974
982
  fieldPath: `${i.fieldKey}.${r.fieldKey}`,
975
- formData: g,
983
+ formData: _,
976
984
  initialFormData: t,
977
- initialRowValues: Bt(t?.[i.fieldKey], a.index),
978
- onChange: (e) => D(a.index, r.fieldKey, e),
985
+ initialRowValues: Ht(t?.[i.fieldKey], a.index),
986
+ onChange: (e) => j(a.index, r.fieldKey, e),
979
987
  onDataSourceStateChange: l,
980
988
  optionSnapshots: u,
981
- path: se(i.fieldKey, a.index, r.fieldKey),
982
- readonly: d,
983
- rowValues: _[a.index] ?? {},
989
+ path: oe(i.fieldKey, a.index, r.fieldKey),
990
+ readonly: d || !x(r.fieldKey),
991
+ rowValues: v[a.index] ?? {},
984
992
  schema: f,
985
- uiSchema: p
986
- }, `${b[a.index] ?? a.index}-${r.fieldKey}`),
993
+ uiSchema: m
994
+ }, `${T[a.index] ?? a.index}-${r.fieldKey}`),
987
995
  title: r.label || r.fieldKey
988
- })), j = d ? void 0 : {
996
+ })), P = d || b ? void 0 : {
989
997
  render: (e) => [{
990
- disabled: () => _.length <= v.minRows,
991
- icon: fe,
998
+ disabled: () => v.length <= y.minRows,
999
+ icon: V,
992
1000
  iconType: "icon-only",
993
1001
  name: "刪除此列",
994
- onClick: () => E(e.index),
1002
+ onClick: () => A(e.index),
995
1003
  variant: "destructive-ghost"
996
1004
  }],
997
1005
  fixed: "end",
998
1006
  width: 56
999
1007
  };
1000
1008
  return /* @__PURE__ */ C("div", {
1001
- style: Nt,
1009
+ style: Ft,
1002
1010
  children: [/* @__PURE__ */ S(h, {
1003
- ...j ? { actions: j } : {},
1004
- columns: A,
1005
- dataSource: [...k],
1011
+ ...P ? { actions: P } : {},
1012
+ columns: N,
1013
+ dataSource: [...M],
1006
1014
  rowHeightPreset: "roomy",
1007
1015
  showHeader: !0,
1008
1016
  size: "sub"
1009
- }), d ? null : /* @__PURE__ */ S("div", {
1010
- style: Pt,
1017
+ }), d || b ? null : /* @__PURE__ */ S("div", {
1018
+ style: It,
1011
1019
  children: /* @__PURE__ */ S(c, {
1012
- disabled: _.length >= v.maxRows,
1013
- icon: V,
1020
+ disabled: v.length >= y.maxRows,
1021
+ icon: B,
1014
1022
  iconType: "leading",
1015
- onClick: T,
1023
+ onClick: k,
1016
1024
  size: "sub",
1017
1025
  type: "button",
1018
1026
  variant: "base-secondary",
@@ -1021,14 +1029,14 @@ function Rt({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
1021
1029
  })]
1022
1030
  });
1023
1031
  }
1024
- function zt({ 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 }) {
1025
- let _ = Ut(m, e.fieldKey), y = W({
1032
+ function Vt({ 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 }) {
1033
+ let _ = Gt(m, e.fieldKey), y = Oe({
1026
1034
  context: t,
1027
1035
  field: e,
1028
1036
  fieldPath: i,
1029
1037
  formData: a,
1030
1038
  initialFormData: o,
1031
- initialValue: s ? Ut(s, e.fieldKey) : void 0,
1039
+ initialValue: s ? Gt(s, e.fieldKey) : void 0,
1032
1040
  optionSnapshots: d,
1033
1041
  readonly: p,
1034
1042
  row: {
@@ -1038,7 +1046,7 @@ function zt({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
1038
1046
  schema: h,
1039
1047
  snapshotKey: f,
1040
1048
  uiSchema: g
1041
- }), b = je(y), x = JSON.stringify({
1049
+ }), b = K(y), x = JSON.stringify({
1042
1050
  hasValue: y.hasValue,
1043
1051
  invalidValues: y.invalidValues,
1044
1052
  selectionExpired: y.selectionExpired === !0,
@@ -1063,16 +1071,16 @@ function zt({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
1063
1071
  x
1064
1072
  ]), /* @__PURE__ */ C("div", {
1065
1073
  "data-form-field-key": f,
1066
- style: Lt,
1074
+ style: zt,
1067
1075
  children: [
1068
- Wt(e, _, p, (e, t) => l(t), void 0, t, y, "sub"),
1076
+ Kt(e, _, p, (e, t) => l(t), void 0, t, y, "sub"),
1069
1077
  n ? /* @__PURE__ */ S(v, {
1070
1078
  color: "text-error",
1071
1079
  variant: "caption",
1072
1080
  children: n
1073
1081
  }) : null,
1074
1082
  b ? /* @__PURE__ */ C("div", {
1075
- style: Mt,
1083
+ style: Pt,
1076
1084
  children: [/* @__PURE__ */ S(v, {
1077
1085
  color: y.status === "INVALID" || y.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
1078
1086
  variant: "caption",
@@ -1088,38 +1096,38 @@ function zt({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
1088
1096
  ]
1089
1097
  });
1090
1098
  }
1091
- function Bt(e, t) {
1092
- return L(e)[t];
1099
+ function Ht(e, t) {
1100
+ return ce(e)[t];
1093
1101
  }
1094
- function Vt(e) {
1102
+ function Ut(e) {
1095
1103
  return e.current += 1, `table-row-${e.current}`;
1096
1104
  }
1097
- function Ht(e, t, n) {
1105
+ function Wt(e, t, n) {
1098
1106
  return n === void 0 || !he(n) ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {
1099
1107
  ...e,
1100
1108
  [t]: n
1101
1109
  };
1102
1110
  }
1103
- function Ut(e, t) {
1111
+ function Gt(e, t) {
1104
1112
  if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
1105
1113
  }
1106
- function Wt(e, t, n, r, i, a, o, s = "main") {
1107
- return pe(e) ? Kt(e, t, n, r, a, o, s) : Gt(e, t, n, r, i, s);
1114
+ function Kt(e, t, n, r, i, a, o, s = "main") {
1115
+ return pe(e) ? Jt(e, t, n, r, a, o, s) : qt(e, t, n, r, i, s);
1108
1116
  }
1109
- function Gt(e, t, n, r, i, a = "main") {
1110
- let o = n && (e.type === "text" || e.type === "textarea") && e.displayAs === "link" ? Z(t) : null;
1117
+ function qt(e, t, n, r, i, a = "main") {
1118
+ let o = n && (e.type === "text" || e.type === "textarea") && e.displayAs === "link" ? qe(t) : null;
1111
1119
  if (o) return /* @__PURE__ */ S(v, {
1112
1120
  color: "text-brand",
1113
1121
  component: "span",
1114
1122
  variant: "body",
1115
1123
  children: /* @__PURE__ */ S("a", {
1116
1124
  href: o.href,
1117
- style: jt,
1125
+ style: Nt,
1118
1126
  ...o.external ? {
1119
- "aria-label": `${o.href}${kt}`,
1127
+ "aria-label": `${o.href}${jt}`,
1120
1128
  rel: "noopener noreferrer",
1121
1129
  target: "_blank",
1122
- title: At
1130
+ title: Mt
1123
1131
  } : {},
1124
1132
  children: o.href
1125
1133
  })
@@ -1131,7 +1139,7 @@ function Gt(e, t, n, r, i, a = "main") {
1131
1139
  ref: wt,
1132
1140
  rows: 3,
1133
1141
  style: Ct,
1134
- value: Jt(t)
1142
+ value: Xt(t)
1135
1143
  });
1136
1144
  if (e.type === "boolean") return /* @__PURE__ */ S(_, {
1137
1145
  checked: t === !0,
@@ -1141,7 +1149,7 @@ function Gt(e, t, n, r, i, a = "main") {
1141
1149
  size: a
1142
1150
  });
1143
1151
  if (me(e) && e.type === "checkbox") {
1144
- let i = e.options.map(F);
1152
+ let i = e.options.map(I);
1145
1153
  return /* @__PURE__ */ S(m, {
1146
1154
  menuMaxHeight: 320,
1147
1155
  mode: "multiple",
@@ -1150,11 +1158,11 @@ function Gt(e, t, n, r, i, a = "main") {
1150
1158
  placeholder: e.placeholder ?? "請選擇一或多個選項",
1151
1159
  readOnly: n,
1152
1160
  size: a,
1153
- value: i.filter((e) => K(t).includes(e.id))
1161
+ value: i.filter((e) => q(t).includes(e.id))
1154
1162
  });
1155
1163
  }
1156
1164
  if (me(e)) {
1157
- let i = e.options.map(F);
1165
+ let i = e.options.map(I);
1158
1166
  return /* @__PURE__ */ S(m, {
1159
1167
  menuMaxHeight: 320,
1160
1168
  onChange: (t) => r(e.fieldKey, t?.id ?? void 0),
@@ -1162,7 +1170,7 @@ function Gt(e, t, n, r, i, a = "main") {
1162
1170
  placeholder: e.placeholder ?? "請選擇",
1163
1171
  readOnly: n,
1164
1172
  size: a,
1165
- value: z(i, Jt(t))
1173
+ value: R(i, Xt(t))
1166
1174
  });
1167
1175
  }
1168
1176
  return e.type === "member" ? /* @__PURE__ */ S(ot, {
@@ -1176,11 +1184,11 @@ function Gt(e, t, n, r, i, a = "main") {
1176
1184
  }) : e.type === "org_unit" ? /* @__PURE__ */ S(yt, {
1177
1185
  name: e.fieldKey,
1178
1186
  onChange: (t) => r(e.fieldKey, t),
1179
- placeholder: e.placeholder ?? Xt(e.type),
1187
+ placeholder: e.placeholder ?? Qt(e.type),
1180
1188
  readonly: n,
1181
1189
  size: a,
1182
1190
  value: t
1183
- }) : e.type === "file_upload" ? /* @__PURE__ */ S(He, {
1191
+ }) : e.type === "file_upload" ? /* @__PURE__ */ S(Ve, {
1184
1192
  attachments: i?.attachments,
1185
1193
  field: e,
1186
1194
  onChange: (t) => r(e.fieldKey, t),
@@ -1193,9 +1201,9 @@ function Gt(e, t, n, r, i, a = "main") {
1193
1201
  format: "YYYY-MM-DD",
1194
1202
  fullWidth: !0,
1195
1203
  onChange: (t) => r(e.fieldKey, k(t)),
1196
- placeholder: e.placeholder ?? Xt(e.type),
1204
+ placeholder: e.placeholder ?? Qt(e.type),
1197
1205
  readOnly: n,
1198
- value: P(t)
1206
+ value: F(t)
1199
1207
  }) : e.type === "datetime" ? /* @__PURE__ */ S(d, {
1200
1208
  formatDate: "YYYY-MM-DD",
1201
1209
  formatTime: "HH:mm",
@@ -1205,34 +1213,34 @@ function Gt(e, t, n, r, i, a = "main") {
1205
1213
  placeholderLeft: "選擇日期",
1206
1214
  placeholderRight: "選擇時間",
1207
1215
  readOnly: n,
1208
- value: P(t)
1216
+ value: F(t)
1209
1217
  }) : e.type === "number" || e.type === "money" ? /* @__PURE__ */ S(f, {
1210
1218
  fullWidth: !0,
1211
1219
  max: e.maximum,
1212
1220
  min: e.minimum,
1213
1221
  size: a,
1214
- onChange: (t) => r(e.fieldKey, D(ee(t.target.value), {
1222
+ onChange: (t) => r(e.fieldKey, D(P(t.target.value), {
1215
1223
  max: e.maximum,
1216
1224
  min: e.minimum
1217
1225
  })),
1218
- placeholder: e.placeholder ?? Xt(e.type),
1226
+ placeholder: e.placeholder ?? Qt(e.type),
1219
1227
  ...n ? { readonly: !0 } : {},
1220
1228
  showSpinner: !0,
1221
- value: Yt(t),
1229
+ value: Zt(t),
1222
1230
  variant: "measure"
1223
1231
  }) : /* @__PURE__ */ S(f, {
1224
1232
  fullWidth: !0,
1225
1233
  onChange: (t) => r(e.fieldKey, t.target.value),
1226
- placeholder: e.placeholder ?? Xt(e.type),
1234
+ placeholder: e.placeholder ?? Qt(e.type),
1227
1235
  ...n ? { readonly: !0 } : {},
1228
1236
  size: a,
1229
- value: Jt(t),
1237
+ value: Xt(t),
1230
1238
  variant: "base"
1231
1239
  });
1232
1240
  }
1233
- function Kt(e, t, n, r, i, a, o = "main") {
1234
- let c = a.options.map(F), u = ue(t, a.options).map(F), d = a.status === "LOADING", f = d && !a.loadingNextPage, h = a.status === "WAITING_FOR_DEPENDENCIES", g = !!i && !n, _ = n || h, v = n;
1235
- return e.type === "autocomplete" ? ge(e) === "multiple" ? /* @__PURE__ */ S(s, {
1241
+ function Jt(e, t, n, r, i, a, o = "main") {
1242
+ let c = a.options.map(I), u = de(t, a.options).map(I), d = a.status === "LOADING", f = d && !a.loadingNextPage, h = a.status === "WAITING_FOR_DEPENDENCIES", g = !!i && !n, _ = n || h, v = n;
1243
+ return e.type === "autocomplete" ? U(e) === "multiple" ? /* @__PURE__ */ S(s, {
1236
1244
  asyncData: g,
1237
1245
  clearSearchText: !0,
1238
1246
  disabled: v,
@@ -1279,7 +1287,7 @@ function Kt(e, t, n, r, i, a, o = "main") {
1279
1287
  name: e.fieldKey,
1280
1288
  onChange: (t) => r(e.fieldKey, t.target.value || void 0),
1281
1289
  options: c,
1282
- value: Jt(t)
1290
+ value: Xt(t)
1283
1291
  }) : e.type === "checkbox" ? /* @__PURE__ */ S(l, {
1284
1292
  disabled: _,
1285
1293
  name: e.fieldKey,
@@ -1288,8 +1296,8 @@ function Kt(e, t, n, r, i, a, o = "main") {
1288
1296
  label: e.name,
1289
1297
  value: e.id
1290
1298
  })),
1291
- value: [...K(t)]
1292
- }) : ge(e) === "multiple" ? /* @__PURE__ */ S(m, {
1299
+ value: [...q(t)]
1300
+ }) : U(e) === "multiple" ? /* @__PURE__ */ S(m, {
1293
1301
  disabled: _,
1294
1302
  loading: d,
1295
1303
  menuMaxHeight: 320,
@@ -1314,20 +1322,20 @@ function Kt(e, t, n, r, i, a, o = "main") {
1314
1322
  value: u[0] ?? null
1315
1323
  });
1316
1324
  }
1317
- function qt(e, t) {
1325
+ function Yt(e, t) {
1318
1326
  return {
1319
1327
  FULL: 12,
1320
1328
  HALF: 6,
1321
1329
  THIRD: 4
1322
1330
  }[t.layout.find((t) => t.fieldKey === e.fieldKey)?.width ?? "FULL"];
1323
1331
  }
1324
- function Jt(e) {
1332
+ function Xt(e) {
1325
1333
  return typeof e == "string" ? e : "";
1326
1334
  }
1327
- function Yt(e) {
1335
+ function Zt(e) {
1328
1336
  return typeof e == "number" ? String(e) : "";
1329
1337
  }
1330
- function Xt(e) {
1338
+ function Qt(e) {
1331
1339
  return {
1332
1340
  boolean: "",
1333
1341
  autocomplete: "請輸入或選擇",
@@ -1346,6 +1354,6 @@ function Xt(e) {
1346
1354
  textarea: "請輸入多行文字"
1347
1355
  }[e];
1348
1356
  }
1349
- export { q as a, je as c, Xe as i, Me as l, lt as n, Be as o, Ze as r, G as s, Tt as t, W as u };
1357
+ export { J as a, K as c, Xe as i, je as l, lt as n, Y as o, Ze as r, Ae as s, Tt as t, Oe as u };
1350
1358
 
1351
- //# sourceMappingURL=FormRendererView-CAyPXhPq.js.map
1359
+ //# sourceMappingURL=FormRendererView-CemHvfAT.js.map